From bf7a5a46d023433ecf8b1c080ad4431f0f3d9891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 13 Jan 2020 00:53:58 +0100 Subject: [PATCH] Ignore .map files in standalone packages --- .gitignore | 2 ++ packages/babel-preset-env-standalone/babel-preset-env.js.map | 1 - packages/babel-standalone/babel.js.map | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 packages/babel-preset-env-standalone/babel-preset-env.js.map delete mode 100644 packages/babel-standalone/babel.js.map diff --git a/.gitignore b/.gitignore index e66e4456b432..4f32ee12788d 100644 --- a/.gitignore +++ b/.gitignore @@ -54,8 +54,10 @@ package-lock.json .nyc_output /babel.sublime-workspace packages/babel-standalone/babel.js +packages/babel-standalone/babel.js.map packages/babel-standalone/babel.min.js packages/babel-preset-env-standalone/babel-preset-env.js +packages/babel-preset-env-standalone/babel-preset-env.js.map packages/babel-preset-env-standalone/babel-preset-env.min.js /codemods/*/lib /codemods/*/node_modules diff --git a/packages/babel-preset-env-standalone/babel-preset-env.js.map b/packages/babel-preset-env-standalone/babel-preset-env.js.map deleted file mode 100644 index a3081a9787a1..000000000000 --- a/packages/babel-preset-env-standalone/babel-preset-env.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"babel-preset-env.js","sources":["../../node_modules/rollup-plugin-node-globals/src/global.js","../../node_modules/process-es6/browser.js","../../node_modules/semver/semver.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/data/browsers.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/dist/unpacker/browsers.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/data/browserVersions.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/dist/unpacker/browserVersions.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/data/agents.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/dist/unpacker/agents.js","../babel-helper-compilation-targets/node_modules/electron-to-chromium/versions.js","../babel-helper-compilation-targets/node_modules/browserslist/error.js","../babel-helper-compilation-targets/node_modules/browserslist/browser.js","../babel-helper-compilation-targets/node_modules/browserslist/index.js","../babel-helper-compilation-targets/node_modules/leven/index.js","../babel-helper-compilation-targets/node_modules/levenary/index.mjs","../babel-helper-compilation-targets/node_modules/invariant/browser.js","../babel-compat-data/native-modules.js","../babel-helper-compilation-targets/src/targets.js","../babel-helper-compilation-targets/src/utils.js","../babel-helper-compilation-targets/src/options.js","../babel-helper-compilation-targets/src/pretty.js","../babel-helper-compilation-targets/src/debug.js","../babel-compat-data/plugins.js","../babel-helper-compilation-targets/src/filter-items.js","../babel-helper-compilation-targets/src/index.js","../babel-preset-env/src/debug.js","../babel-preset-env/src/get-option-specific-excludes.js","../babel-preset-env/src/filter-items.js","../babel-preset-env/src/module-transformations.js","../babel-preset-env/node_modules/leven/index.js","../babel-preset-env/node_modules/levenary/index.mjs","../babel-preset-env/node_modules/invariant/browser.js","../babel-compat-data/corejs2-built-ins.js","../babel-preset-env/src/options.js","../babel-preset-env/src/polyfills/corejs2/get-platform-specific-default.js","../babel-preset-env/src/normalize-options.js","../babel-preset-env/data/shipped-proposals.js","../babel-compat-data/overlapping-plugins.js","../babel-preset-env/src/polyfills/corejs2/built-in-definitions.js","../babel-types/src/utils/shallowEqual.js","../babel-types/src/validators/generated/index.js","../babel-types/src/validators/matchesPattern.js","../babel-types/src/validators/buildMatchMemberExpression.js","../babel-types/src/validators/react/isReactComponent.js","../babel-types/src/validators/react/isCompatTag.js","../../node_modules/lodash/_listCacheClear.js","../../node_modules/lodash/eq.js","../../node_modules/lodash/_assocIndexOf.js","../../node_modules/lodash/_listCacheDelete.js","../../node_modules/lodash/_listCacheGet.js","../../node_modules/lodash/_listCacheHas.js","../../node_modules/lodash/_listCacheSet.js","../../node_modules/lodash/_ListCache.js","../../node_modules/lodash/_stackClear.js","../../node_modules/lodash/_stackDelete.js","../../node_modules/lodash/_stackGet.js","../../node_modules/lodash/_stackHas.js","../../node_modules/lodash/_freeGlobal.js","../../node_modules/lodash/_root.js","../../node_modules/lodash/_Symbol.js","../../node_modules/lodash/_getRawTag.js","../../node_modules/lodash/_objectToString.js","../../node_modules/lodash/_baseGetTag.js","../../node_modules/lodash/isObject.js","../../node_modules/lodash/isFunction.js","../../node_modules/lodash/_coreJsData.js","../../node_modules/lodash/_isMasked.js","../../node_modules/lodash/_toSource.js","../../node_modules/lodash/_baseIsNative.js","../../node_modules/lodash/_getValue.js","../../node_modules/lodash/_getNative.js","../../node_modules/lodash/_Map.js","../../node_modules/lodash/_nativeCreate.js","../../node_modules/lodash/_hashClear.js","../../node_modules/lodash/_hashDelete.js","../../node_modules/lodash/_hashGet.js","../../node_modules/lodash/_hashHas.js","../../node_modules/lodash/_hashSet.js","../../node_modules/lodash/_Hash.js","../../node_modules/lodash/_mapCacheClear.js","../../node_modules/lodash/_isKeyable.js","../../node_modules/lodash/_getMapData.js","../../node_modules/lodash/_mapCacheDelete.js","../../node_modules/lodash/_mapCacheGet.js","../../node_modules/lodash/_mapCacheHas.js","../../node_modules/lodash/_mapCacheSet.js","../../node_modules/lodash/_MapCache.js","../../node_modules/lodash/_stackSet.js","../../node_modules/lodash/_Stack.js","../../node_modules/lodash/_arrayEach.js","../../node_modules/lodash/_defineProperty.js","../../node_modules/lodash/_baseAssignValue.js","../../node_modules/lodash/_assignValue.js","../../node_modules/lodash/_copyObject.js","../../node_modules/lodash/_baseTimes.js","../../node_modules/lodash/isObjectLike.js","../../node_modules/lodash/_baseIsArguments.js","../../node_modules/lodash/isArguments.js","../../node_modules/lodash/isArray.js","../../node_modules/lodash/stubFalse.js","../../node_modules/lodash/isBuffer.js","../../node_modules/lodash/_isIndex.js","../../node_modules/lodash/isLength.js","../../node_modules/lodash/_baseIsTypedArray.js","../../node_modules/lodash/_baseUnary.js","../../node_modules/lodash/_nodeUtil.js","../../node_modules/lodash/isTypedArray.js","../../node_modules/lodash/_arrayLikeKeys.js","../../node_modules/lodash/_isPrototype.js","../../node_modules/lodash/_overArg.js","../../node_modules/lodash/_nativeKeys.js","../../node_modules/lodash/_baseKeys.js","../../node_modules/lodash/isArrayLike.js","../../node_modules/lodash/keys.js","../../node_modules/lodash/_baseAssign.js","../../node_modules/lodash/_nativeKeysIn.js","../../node_modules/lodash/_baseKeysIn.js","../../node_modules/lodash/keysIn.js","../../node_modules/lodash/_baseAssignIn.js","../../node_modules/lodash/_cloneBuffer.js","../../node_modules/lodash/_copyArray.js","../../node_modules/lodash/_arrayFilter.js","../../node_modules/lodash/stubArray.js","../../node_modules/lodash/_getSymbols.js","../../node_modules/lodash/_copySymbols.js","../../node_modules/lodash/_arrayPush.js","../../node_modules/lodash/_getPrototype.js","../../node_modules/lodash/_getSymbolsIn.js","../../node_modules/lodash/_copySymbolsIn.js","../../node_modules/lodash/_baseGetAllKeys.js","../../node_modules/lodash/_getAllKeys.js","../../node_modules/lodash/_getAllKeysIn.js","../../node_modules/lodash/_DataView.js","../../node_modules/lodash/_Promise.js","../../node_modules/lodash/_Set.js","../../node_modules/lodash/_WeakMap.js","../../node_modules/lodash/_getTag.js","../../node_modules/lodash/_initCloneArray.js","../../node_modules/lodash/_Uint8Array.js","../../node_modules/lodash/_cloneArrayBuffer.js","../../node_modules/lodash/_cloneDataView.js","../../node_modules/lodash/_cloneRegExp.js","../../node_modules/lodash/_cloneSymbol.js","../../node_modules/lodash/_cloneTypedArray.js","../../node_modules/lodash/_initCloneByTag.js","../../node_modules/lodash/_baseCreate.js","../../node_modules/lodash/_initCloneObject.js","../../node_modules/lodash/_baseIsMap.js","../../node_modules/lodash/isMap.js","../../node_modules/lodash/_baseIsSet.js","../../node_modules/lodash/isSet.js","../../node_modules/lodash/_baseClone.js","../../node_modules/lodash/clone.js","../babel-types/node_modules/to-fast-properties/index.js","../../node_modules/esutils/lib/ast.js","../../node_modules/esutils/lib/code.js","../../node_modules/esutils/lib/keyword.js","../../node_modules/esutils/lib/utils.js","../babel-types/src/validators/isType.js","../babel-types/src/validators/isPlaceholderType.js","../babel-types/src/validators/is.js","../babel-types/src/constants/index.js","../babel-types/src/validators/validate.js","../babel-types/src/definitions/utils.js","../babel-types/src/definitions/core.js","../babel-types/src/definitions/es2015.js","../babel-types/src/definitions/flow.js","../babel-types/src/definitions/jsx.js","../babel-types/src/definitions/placeholders.js","../babel-types/src/definitions/misc.js","../babel-types/src/definitions/experimental.js","../babel-types/src/definitions/typescript.js","../babel-types/src/definitions/index.js","../babel-types/src/builders/builder.js","../babel-types/src/builders/generated/index.js","../babel-types/src/utils/react/cleanJSXElementLiteralChild.js","../babel-types/src/builders/react/buildChildren.js","../babel-types/src/validators/isNode.js","../babel-types/src/asserts/assertNode.js","../babel-types/src/asserts/generated/index.js","../babel-types/src/builders/flow/createTypeAnnotationBasedOnTypeof.js","../babel-types/src/modifications/flow/removeTypeDuplicates.js","../babel-types/src/builders/flow/createUnionTypeAnnotation.js","../babel-types/src/clone/cloneNode.js","../babel-types/src/clone/clone.js","../babel-types/src/clone/cloneDeep.js","../babel-types/src/clone/cloneWithoutLoc.js","../babel-types/src/comments/addComments.js","../babel-types/src/comments/addComment.js","../../node_modules/lodash/_setCacheAdd.js","../../node_modules/lodash/_setCacheHas.js","../../node_modules/lodash/_SetCache.js","../../node_modules/lodash/_baseFindIndex.js","../../node_modules/lodash/_baseIsNaN.js","../../node_modules/lodash/_strictIndexOf.js","../../node_modules/lodash/_baseIndexOf.js","../../node_modules/lodash/_arrayIncludes.js","../../node_modules/lodash/_arrayIncludesWith.js","../../node_modules/lodash/_cacheHas.js","../../node_modules/lodash/noop.js","../../node_modules/lodash/_setToArray.js","../../node_modules/lodash/_createSet.js","../../node_modules/lodash/_baseUniq.js","../../node_modules/lodash/uniq.js","../babel-types/src/utils/inherit.js","../babel-types/src/comments/inheritInnerComments.js","../babel-types/src/comments/inheritLeadingComments.js","../babel-types/src/comments/inheritTrailingComments.js","../babel-types/src/comments/inheritsComments.js","../babel-types/src/comments/removeComments.js","../babel-types/src/constants/generated/index.js","../babel-types/src/converters/toBlock.js","../babel-types/src/converters/ensureBlock.js","../babel-types/src/validators/isValidIdentifier.js","../babel-types/src/converters/toIdentifier.js","../babel-types/src/converters/toBindingIdentifierName.js","../babel-types/src/converters/toComputedKey.js","../babel-types/src/converters/toExpression.js","../babel-types/src/traverse/traverseFast.js","../babel-types/src/modifications/removeProperties.js","../babel-types/src/modifications/removePropertiesDeep.js","../babel-types/src/converters/toKeyAlias.js","../babel-types/src/retrievers/getBindingIdentifiers.js","../babel-types/src/converters/gatherSequenceExpressions.js","../babel-types/src/converters/toSequenceExpression.js","../babel-types/src/converters/toStatement.js","../../node_modules/lodash/isPlainObject.js","../../node_modules/lodash/_baseIsRegExp.js","../../node_modules/lodash/isRegExp.js","../babel-types/src/converters/valueToNode.js","../babel-types/src/modifications/appendToMemberExpression.js","../babel-types/src/modifications/inherits.js","../babel-types/src/modifications/prependToMemberExpression.js","../babel-types/src/retrievers/getOuterBindingIdentifiers.js","../babel-types/src/traverse/traverse.js","../babel-types/src/validators/isBinding.js","../babel-types/src/validators/isLet.js","../babel-types/src/validators/isBlockScoped.js","../babel-types/src/validators/isImmutable.js","../babel-types/src/validators/isNodesEquivalent.js","../babel-types/src/validators/isReferenced.js","../babel-types/src/validators/isScope.js","../babel-types/src/validators/isSpecifierDefault.js","../babel-types/src/validators/isValidES3Identifier.js","../babel-types/src/validators/isVar.js","../babel-types/src/index.js","../../node_modules/buffer-es6/base64.js","../../node_modules/buffer-es6/ieee754.js","../../node_modules/buffer-es6/isArray.js","../../node_modules/buffer-es6/index.js","../../node_modules/rollup-plugin-node-builtins/src/es6/inherits.js","../../node_modules/rollup-plugin-node-builtins/src/es6/util.js","../../node_modules/rollup-plugin-node-builtins/src/es6/assert.js","../babel-helper-module-imports/src/import-builder.js","../babel-helper-module-imports/src/is-module.js","../babel-helper-module-imports/src/import-injector.js","../babel-helper-module-imports/src/index.js","../babel-preset-env/src/utils.js","../babel-preset-env/src/polyfills/corejs2/usage-plugin.js","../babel-preset-env/src/polyfills/corejs3/shipped-proposals.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/internal/debug.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/internal/constants.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/internal/re.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/internal/identifiers.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/classes/semver.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/compare.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/eq.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/neq.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/gt.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/gte.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/lt.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/lte.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/cmp.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/parse.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/coerce.js","../babel-preset-env/node_modules/core-js-compat/helpers.js","../babel-preset-env/node_modules/core-js-compat/get-modules-list-for-target-version.js","../babel-preset-env/src/polyfills/corejs3/built-in-definitions.js","../babel-preset-env/src/polyfills/corejs3/usage-plugin.js","../babel-preset-env/src/polyfills/regenerator/usage-plugin.js","../babel-preset-env/src/polyfills/corejs2/entry-plugin.js","../babel-preset-env/src/polyfills/corejs3/entry-plugin.js","../babel-preset-env/src/polyfills/regenerator/entry-plugin.js","../babel-helper-plugin-utils/src/index.js","../babel-plugin-syntax-json-strings/src/index.js","../babel-plugin-proposal-json-strings/src/index.js","../babel-plugin-syntax-dynamic-import/src/index.js","../babel-plugin-proposal-dynamic-import/src/index.js","../babel-plugin-syntax-nullish-coalescing-operator/src/index.js","../babel-traverse/src/path/lib/virtual-types.js","../babel-traverse/node_modules/ms/index.js","../babel-traverse/node_modules/debug/src/common.js","../babel-traverse/node_modules/debug/src/browser.js","../../node_modules/lodash/isString.js","../../node_modules/lodash/isSymbol.js","../../node_modules/lodash/toNumber.js","../../node_modules/lodash/toFinite.js","../../node_modules/lodash/toInteger.js","../../node_modules/lodash/_arrayMap.js","../../node_modules/lodash/_baseValues.js","../../node_modules/lodash/values.js","../../node_modules/lodash/includes.js","../../node_modules/lodash/_baseRepeat.js","../../node_modules/lodash/_isIterateeCall.js","../../node_modules/lodash/_baseToString.js","../../node_modules/lodash/toString.js","../../node_modules/lodash/repeat.js","../babel-traverse/src/scope/binding.js","../babel-helper-split-export-declaration/src/index.js","../babel-traverse/src/scope/lib/renamer.js","../../node_modules/lodash/identity.js","../../node_modules/lodash/_apply.js","../../node_modules/lodash/_overRest.js","../../node_modules/lodash/constant.js","../../node_modules/lodash/_baseSetToString.js","../../node_modules/lodash/_shortOut.js","../../node_modules/lodash/_setToString.js","../../node_modules/lodash/_baseRest.js","../../node_modules/lodash/defaults.js","../babel-traverse/node_modules/globals/index.js","../babel-traverse/src/cache.js","../babel-traverse/src/scope/index.js","../../node_modules/source-map/lib/base64.js","../../node_modules/source-map/lib/base64-vlq.js","../../node_modules/source-map/lib/util.js","../../node_modules/source-map/lib/array-set.js","../../node_modules/source-map/lib/mapping-list.js","../../node_modules/source-map/lib/source-map-generator.js","../../node_modules/source-map/lib/binary-search.js","../../node_modules/source-map/lib/quick-sort.js","../../node_modules/source-map/lib/source-map-consumer.js","../../node_modules/source-map/lib/source-node.js","../../node_modules/source-map/source-map.js","../babel-generator/src/source-map.js","../../node_modules/lodash/isInteger.js","../babel-generator/src/buffer.js","../babel-generator/src/node/whitespace.js","../babel-generator/src/node/parentheses.js","../babel-generator/src/node/index.js","../babel-generator/src/generators/template-literals.js","../babel-generator/src/generators/expressions.js","../babel-generator/src/generators/statements.js","../babel-generator/src/generators/classes.js","../babel-generator/src/generators/methods.js","../babel-generator/src/generators/modules.js","../babel-generator/node_modules/jsesc/jsesc.js","../babel-generator/src/generators/types.js","../babel-generator/src/generators/flow.js","../babel-generator/src/generators/base.js","../babel-generator/src/generators/jsx.js","../babel-generator/src/generators/typescript.js","../babel-generator/src/printer.js","../babel-generator/src/index.js","../babel-traverse/src/path/ancestry.js","../babel-traverse/src/path/inference/inferer-reference.js","../babel-traverse/src/path/inference/inferers.js","../babel-traverse/src/path/inference/index.js","../babel-highlight/node_modules/js-tokens/index.js","../babel-highlight/node_modules/escape-string-regexp/index.js","../babel-highlight/node_modules/color-name/index.js","../babel-highlight/node_modules/color-convert/conversions.js","../babel-highlight/node_modules/color-convert/route.js","../babel-highlight/node_modules/color-convert/index.js","../babel-highlight/node_modules/ansi-styles/index.js","../babel-highlight/node_modules/supports-color/browser.js","../babel-highlight/node_modules/chalk/templates.js","../babel-highlight/node_modules/chalk/index.js","../babel-highlight/src/index.js","../babel-code-frame/src/index.js","../babel-parser/src/tokenizer/types.js","../babel-parser/src/util/scopeflags.js","../babel-parser/src/plugins/estree.js","../babel-parser/src/util/whitespace.js","../babel-parser/src/tokenizer/context.js","../babel-parser/src/util/identifier.js","../babel-parser/src/plugins/flow.js","../babel-parser/src/plugins/jsx/xhtml.js","../babel-parser/src/plugins/jsx/index.js","../babel-parser/src/util/scope.js","../babel-parser/src/plugins/typescript/scope.js","../babel-parser/src/plugins/typescript/index.js","../babel-parser/src/plugins/placeholders.js","../babel-parser/src/plugins/v8intrinsic.js","../babel-parser/src/plugin-utils.js","../babel-parser/src/options.js","../babel-parser/src/util/location.js","../babel-parser/src/parser/base.js","../babel-parser/src/parser/comments.js","../babel-parser/src/parser/location.js","../babel-parser/src/tokenizer/state.js","../babel-parser/src/tokenizer/index.js","../babel-parser/src/parser/util.js","../babel-parser/src/parser/node.js","../babel-parser/src/parser/lval.js","../babel-parser/src/parser/expression.js","../babel-parser/src/parser/statement.js","../babel-parser/src/util/class-scope.js","../babel-parser/src/parser/index.js","../babel-parser/src/index.js","../babel-traverse/src/path/replacement.js","../babel-traverse/src/path/evaluation.js","../babel-helper-get-function-arity/src/index.js","../babel-template/src/formatters.js","../babel-template/src/options.js","../babel-template/src/parse.js","../babel-template/src/populate.js","../babel-template/src/string.js","../babel-template/src/literal.js","../babel-template/src/builder.js","../babel-template/src/index.js","../babel-helper-function-name/src/index.js","../babel-traverse/src/path/conversion.js","../babel-traverse/src/path/introspection.js","../babel-traverse/src/path/context.js","../babel-traverse/src/path/lib/removal-hooks.js","../babel-traverse/src/path/removal.js","../babel-traverse/src/path/lib/hoister.js","../babel-traverse/src/path/modification.js","../babel-traverse/src/path/family.js","../babel-traverse/src/path/comments.js","../babel-traverse/src/path/index.js","../babel-traverse/src/context.js","../babel-traverse/src/visitors.js","../babel-traverse/src/index.js","../babel-helpers/src/helpers.js","../babel-helpers/src/index.js","../babel-core/src/transformation/file/file.js","../babel-core/src/tools/build-external-helpers.js","../babel-runtime/node_modules/regenerator-runtime/runtime.js","../babel-runtime/regenerator/index.js","../babel-core/src/config/files/index-browser.js","../babel-core/src/config/helpers/environment.js","../../node_modules/rollup-plugin-node-builtins/src/es6/path.js","../babel-core/node_modules/gensync/index.js","../babel-core/src/gensync-utils/async.js","../babel-core/src/config/util.js","../babel-core/src/config/caching.js","../babel-core/src/config/config-descriptors.js","../babel-core/src/config/item.js","../babel-core/src/config/plugin.js","../babel-core/node_modules/ms/index.js","../babel-core/node_modules/debug/src/common.js","../babel-core/node_modules/debug/src/browser.js","../babel-core/src/config/validation/removed.js","../babel-core/src/config/validation/option-assertions.js","../babel-core/src/config/validation/options.js","../../node_modules/lodash/escapeRegExp.js","../babel-core/src/config/pattern-to-regex.js","../babel-core/src/config/config-chain.js","../babel-core/src/config/validation/plugins.js","../babel-core/src/config/helpers/config-api.js","../babel-core/src/config/partial.js","../babel-core/src/config/full.js","../babel-core/src/config/index.js","../babel-core/src/transformation/plugin-pass.js","../../node_modules/lodash/_isFlattenable.js","../../node_modules/lodash/_baseFlatten.js","../../node_modules/lodash/_arraySome.js","../../node_modules/lodash/_equalArrays.js","../../node_modules/lodash/_mapToArray.js","../../node_modules/lodash/_equalByTag.js","../../node_modules/lodash/_equalObjects.js","../../node_modules/lodash/_baseIsEqualDeep.js","../../node_modules/lodash/_baseIsEqual.js","../../node_modules/lodash/_baseIsMatch.js","../../node_modules/lodash/_isStrictComparable.js","../../node_modules/lodash/_getMatchData.js","../../node_modules/lodash/_matchesStrictComparable.js","../../node_modules/lodash/_baseMatches.js","../../node_modules/lodash/_isKey.js","../../node_modules/lodash/memoize.js","../../node_modules/lodash/_memoizeCapped.js","../../node_modules/lodash/_stringToPath.js","../../node_modules/lodash/_castPath.js","../../node_modules/lodash/_toKey.js","../../node_modules/lodash/_baseGet.js","../../node_modules/lodash/get.js","../../node_modules/lodash/_baseHasIn.js","../../node_modules/lodash/_hasPath.js","../../node_modules/lodash/hasIn.js","../../node_modules/lodash/_baseMatchesProperty.js","../../node_modules/lodash/_baseProperty.js","../../node_modules/lodash/_basePropertyDeep.js","../../node_modules/lodash/property.js","../../node_modules/lodash/_baseIteratee.js","../../node_modules/lodash/_createBaseFor.js","../../node_modules/lodash/_baseFor.js","../../node_modules/lodash/_baseForOwn.js","../../node_modules/lodash/_createBaseEach.js","../../node_modules/lodash/_baseEach.js","../../node_modules/lodash/_baseMap.js","../../node_modules/lodash/_baseSortBy.js","../../node_modules/lodash/_compareAscending.js","../../node_modules/lodash/_compareMultiple.js","../../node_modules/lodash/_baseOrderBy.js","../../node_modules/lodash/sortBy.js","../babel-core/src/transformation/block-hoist-plugin.js","../babel-core/src/transformation/normalize-opts.js","../../node_modules/rollup-plugin-node-builtins/src/es6/empty.js","../../node_modules/lodash/cloneDeep.js","../babel-core/node_modules/safe-buffer/index.js","../babel-core/node_modules/convert-source-map/index.js","../babel-core/src/parser/util/missing-plugin-helper.js","../babel-core/src/parser/index.js","../babel-core/src/transformation/normalize-file.js","../babel-core/src/transformation/file/merge-map.js","../babel-core/src/transformation/file/generate.js","../babel-core/src/transformation/index.js","../babel-core/src/transform.js","../babel-core/src/transform-file-browser.js","../babel-core/src/transform-ast.js","../babel-core/src/parse.js","../babel-core/src/index.js","../babel-plugin-proposal-nullish-coalescing-operator/src/index.js","../babel-plugin-syntax-optional-chaining/src/index.js","../babel-plugin-proposal-optional-chaining/src/index.js","../babel-plugin-syntax-top-level-await/src/index.js","../babel-helper-create-regexp-features-plugin/node_modules/regjsgen/regjsgen.js","../babel-helper-create-regexp-features-plugin/node_modules/regjsparser/parser.js","../babel-helper-create-regexp-features-plugin/node_modules/regenerate/regenerate.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-canonical-property-names-ecmascript/index.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-property-aliases-ecmascript/index.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-match-property-ecmascript/index.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-match-property-value-ecmascript/data/mappings.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-match-property-value-ecmascript/index.js","../babel-helper-create-regexp-features-plugin/node_modules/regexpu-core/data/iu-mappings.js","../babel-helper-create-regexp-features-plugin/node_modules/regexpu-core/data/character-class-escape-sets.js","../babel-helper-create-regexp-features-plugin/node_modules/regexpu-core/rewrite-pattern.js","../babel-helper-create-regexp-features-plugin/src/features.js","../babel-helper-create-regexp-features-plugin/src/util.js","../../node_modules/lodash/_baseIndexOfWith.js","../../node_modules/lodash/_basePullAll.js","../../node_modules/lodash/pullAll.js","../../node_modules/lodash/pull.js","../babel-helper-regex/src/index.js","../babel-helper-create-regexp-features-plugin/src/index.js","../babel-plugin-transform-named-capturing-groups-regex/src/index.js","../babel-plugin-transform-new-target/src/index.js","src/available-plugins.js","../babel-preset-env/src/index.js","src/index.js"],"sourcesContent":["export default (typeof global !== \"undefined\" ? global :\n typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window : {});\n","// shim for using process in browser\n// based off https://github.com/defunctzombie/node-process/blob/master/browser.js\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\nvar cachedSetTimeout = defaultSetTimout;\nvar cachedClearTimeout = defaultClearTimeout;\nif (typeof global.setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n}\nif (typeof global.clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n}\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\nexport function nextTick(fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nexport var title = 'browser';\nexport var platform = 'browser';\nexport var browser = true;\nexport var env = {};\nexport var argv = [];\nexport var version = ''; // empty string to avoid regexp issues\nexport var versions = {};\nexport var release = {};\nexport var config = {};\n\nfunction noop() {}\n\nexport var on = noop;\nexport var addListener = noop;\nexport var once = noop;\nexport var off = noop;\nexport var removeListener = noop;\nexport var removeAllListeners = noop;\nexport var emit = noop;\n\nexport function binding(name) {\n throw new Error('process.binding is not supported');\n}\n\nexport function cwd () { return '/' }\nexport function chdir (dir) {\n throw new Error('process.chdir is not supported');\n};\nexport function umask() { return 0; }\n\n// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js\nvar performance = global.performance || {}\nvar performanceNow =\n performance.now ||\n performance.mozNow ||\n performance.msNow ||\n performance.oNow ||\n performance.webkitNow ||\n function(){ return (new Date()).getTime() }\n\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nexport function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime%1)*1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds<0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds,nanoseconds]\n}\n\nvar startTime = new Date();\nexport function uptime() {\n var currentTime = new Date();\n var dif = currentTime - startTime;\n return dif / 1000;\n}\n\nexport default {\n nextTick: nextTick,\n title: title,\n browser: browser,\n env: env,\n argv: argv,\n version: version,\n versions: versions,\n on: on,\n addListener: addListener,\n once: once,\n off: off,\n removeListener: removeListener,\n removeAllListeners: removeAllListeners,\n emit: emit,\n binding: binding,\n cwd: cwd,\n chdir: chdir,\n umask: umask,\n hrtime: hrtime,\n platform: platform,\n release: release,\n config: config,\n uptime: uptime\n};\n","exports = module.exports = SemVer\n\nvar debug\n/* istanbul ignore next */\nif (typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)) {\n debug = function () {\n var args = Array.prototype.slice.call(arguments, 0)\n args.unshift('SEMVER')\n console.log.apply(console, args)\n }\n} else {\n debug = function () {}\n}\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nexports.SEMVER_SPEC_VERSION = '2.0.0'\n\nvar MAX_LENGTH = 256\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nvar MAX_SAFE_COMPONENT_LENGTH = 16\n\n// The actual regexps go on exports.re\nvar re = exports.re = []\nvar src = exports.src = []\nvar t = exports.tokens = {}\nvar R = 0\n\nfunction tok (n) {\n t[n] = R++\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ntok('NUMERICIDENTIFIER')\nsrc[t.NUMERICIDENTIFIER] = '0|[1-9]\\\\d*'\ntok('NUMERICIDENTIFIERLOOSE')\nsrc[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ntok('NONNUMERICIDENTIFIER')\nsrc[t.NONNUMERICIDENTIFIER] = '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*'\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ntok('MAINVERSION')\nsrc[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')'\n\ntok('MAINVERSIONLOOSE')\nsrc[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ntok('PRERELEASEIDENTIFIER')\nsrc[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\ntok('PRERELEASEIDENTIFIERLOOSE')\nsrc[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ntok('PRERELEASE')\nsrc[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'\n\ntok('PRERELEASELOOSE')\nsrc[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ntok('BUILDIDENTIFIER')\nsrc[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ntok('BUILD')\nsrc[t.BUILD] = '(?:\\\\+(' + src[t.BUILDIDENTIFIER] +\n '(?:\\\\.' + src[t.BUILDIDENTIFIER] + ')*))'\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ntok('FULL')\ntok('FULLPLAIN')\nsrc[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +\n src[t.PRERELEASE] + '?' +\n src[t.BUILD] + '?'\n\nsrc[t.FULL] = '^' + src[t.FULLPLAIN] + '$'\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ntok('LOOSEPLAIN')\nsrc[t.LOOSEPLAIN] = '[v=\\\\s]*' + src[t.MAINVERSIONLOOSE] +\n src[t.PRERELEASELOOSE] + '?' +\n src[t.BUILD] + '?'\n\ntok('LOOSE')\nsrc[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'\n\ntok('GTLT')\nsrc[t.GTLT] = '((?:<|>)?=?)'\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ntok('XRANGEIDENTIFIERLOOSE')\nsrc[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\\\*'\ntok('XRANGEIDENTIFIER')\nsrc[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\\\*'\n\ntok('XRANGEPLAIN')\nsrc[t.XRANGEPLAIN] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:' + src[t.PRERELEASE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGEPLAINLOOSE')\nsrc[t.XRANGEPLAINLOOSE] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:' + src[t.PRERELEASELOOSE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGE')\nsrc[t.XRANGE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAIN] + '$'\ntok('XRANGELOOSE')\nsrc[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ntok('COERCE')\nsrc[t.COERCE] = '(^|[^\\\\d])' +\n '(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:$|[^\\\\d])'\ntok('COERCERTL')\nre[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ntok('LONETILDE')\nsrc[t.LONETILDE] = '(?:~>?)'\n\ntok('TILDETRIM')\nsrc[t.TILDETRIM] = '(\\\\s*)' + src[t.LONETILDE] + '\\\\s+'\nre[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')\nvar tildeTrimReplace = '$1~'\n\ntok('TILDE')\nsrc[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'\ntok('TILDELOOSE')\nsrc[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ntok('LONECARET')\nsrc[t.LONECARET] = '(?:\\\\^)'\n\ntok('CARETTRIM')\nsrc[t.CARETTRIM] = '(\\\\s*)' + src[t.LONECARET] + '\\\\s+'\nre[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')\nvar caretTrimReplace = '$1^'\n\ntok('CARET')\nsrc[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'\ntok('CARETLOOSE')\nsrc[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ntok('COMPARATORLOOSE')\nsrc[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'\ntok('COMPARATOR')\nsrc[t.COMPARATOR] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.FULLPLAIN] + ')$|^$'\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ntok('COMPARATORTRIM')\nsrc[t.COMPARATORTRIM] = '(\\\\s*)' + src[t.GTLT] +\n '\\\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'\n\n// this one has to use the /g flag\nre[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')\nvar comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ntok('HYPHENRANGE')\nsrc[t.HYPHENRANGE] = '^\\\\s*(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s*$'\n\ntok('HYPHENRANGELOOSE')\nsrc[t.HYPHENRANGELOOSE] = '^\\\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s*$'\n\n// Star ranges basically just allow anything at all.\ntok('STAR')\nsrc[t.STAR] = '(<|>)?=?\\\\s*\\\\*'\n\n// Compile to actual regexp objects.\n// All are flag-free, unless they were created above with a flag.\nfor (var i = 0; i < R; i++) {\n debug(i, src[i])\n if (!re[i]) {\n re[i] = new RegExp(src[i])\n }\n}\n\nexports.parse = parse\nfunction parse (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n var r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nexports.valid = valid\nfunction valid (version, options) {\n var v = parse(version, options)\n return v ? v.version : null\n}\n\nexports.clean = clean\nfunction clean (version, options) {\n var s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\n\nexports.SemVer = SemVer\n\nfunction SemVer (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n if (version instanceof SemVer) {\n if (version.loose === options.loose) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')\n }\n\n if (!(this instanceof SemVer)) {\n return new SemVer(version, options)\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n\n var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map(function (id) {\n if (/^[0-9]+$/.test(id)) {\n var num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n}\n\nSemVer.prototype.format = function () {\n this.version = this.major + '.' + this.minor + '.' + this.patch\n if (this.prerelease.length) {\n this.version += '-' + this.prerelease.join('.')\n }\n return this.version\n}\n\nSemVer.prototype.toString = function () {\n return this.version\n}\n\nSemVer.prototype.compare = function (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return this.compareMain(other) || this.comparePre(other)\n}\n\nSemVer.prototype.compareMain = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n}\n\nSemVer.prototype.comparePre = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n var i = 0\n do {\n var a = this.prerelease[i]\n var b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\nSemVer.prototype.compareBuild = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n var i = 0\n do {\n var a = this.build[i]\n var b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\n// preminor will bump the version up to the next minor release, and immediately\n// down to pre-release. premajor and prepatch work the same way.\nSemVer.prototype.inc = function (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 \"pre\" would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n var i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error('invalid increment argument: ' + release)\n }\n this.format()\n this.raw = this.version\n return this\n}\n\nexports.inc = inc\nfunction inc (version, release, loose, identifier) {\n if (typeof (loose) === 'string') {\n identifier = loose\n loose = undefined\n }\n\n try {\n return new SemVer(version, loose).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\n\nexports.diff = diff\nfunction diff (version1, version2) {\n if (eq(version1, version2)) {\n return null\n } else {\n var v1 = parse(version1)\n var v2 = parse(version2)\n var prefix = ''\n if (v1.prerelease.length || v2.prerelease.length) {\n prefix = 'pre'\n var defaultResult = 'prerelease'\n }\n for (var key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\n\nexports.compareIdentifiers = compareIdentifiers\n\nvar numeric = /^[0-9]+$/\nfunction compareIdentifiers (a, b) {\n var anum = numeric.test(a)\n var bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nexports.rcompareIdentifiers = rcompareIdentifiers\nfunction rcompareIdentifiers (a, b) {\n return compareIdentifiers(b, a)\n}\n\nexports.major = major\nfunction major (a, loose) {\n return new SemVer(a, loose).major\n}\n\nexports.minor = minor\nfunction minor (a, loose) {\n return new SemVer(a, loose).minor\n}\n\nexports.patch = patch\nfunction patch (a, loose) {\n return new SemVer(a, loose).patch\n}\n\nexports.compare = compare\nfunction compare (a, b, loose) {\n return new SemVer(a, loose).compare(new SemVer(b, loose))\n}\n\nexports.compareLoose = compareLoose\nfunction compareLoose (a, b) {\n return compare(a, b, true)\n}\n\nexports.compareBuild = compareBuild\nfunction compareBuild (a, b, loose) {\n var versionA = new SemVer(a, loose)\n var versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\n\nexports.rcompare = rcompare\nfunction rcompare (a, b, loose) {\n return compare(b, a, loose)\n}\n\nexports.sort = sort\nfunction sort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(a, b, loose)\n })\n}\n\nexports.rsort = rsort\nfunction rsort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(b, a, loose)\n })\n}\n\nexports.gt = gt\nfunction gt (a, b, loose) {\n return compare(a, b, loose) > 0\n}\n\nexports.lt = lt\nfunction lt (a, b, loose) {\n return compare(a, b, loose) < 0\n}\n\nexports.eq = eq\nfunction eq (a, b, loose) {\n return compare(a, b, loose) === 0\n}\n\nexports.neq = neq\nfunction neq (a, b, loose) {\n return compare(a, b, loose) !== 0\n}\n\nexports.gte = gte\nfunction gte (a, b, loose) {\n return compare(a, b, loose) >= 0\n}\n\nexports.lte = lte\nfunction lte (a, b, loose) {\n return compare(a, b, loose) <= 0\n}\n\nexports.cmp = cmp\nfunction cmp (a, op, b, loose) {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError('Invalid operator: ' + op)\n }\n}\n\nexports.Comparator = Comparator\nfunction Comparator (comp, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n if (!(this instanceof Comparator)) {\n return new Comparator(comp, options)\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n}\n\nvar ANY = {}\nComparator.prototype.parse = function (comp) {\n var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n var m = comp.match(r)\n\n if (!m) {\n throw new TypeError('Invalid comparator: ' + comp)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n}\n\nComparator.prototype.toString = function () {\n return this.value\n}\n\nComparator.prototype.test = function (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n}\n\nComparator.prototype.intersects = function (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n var rangeTmp\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n rangeTmp = new Range(comp.value, options)\n return satisfies(this.value, rangeTmp, options)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n rangeTmp = new Range(this.value, options)\n return satisfies(comp.semver, rangeTmp, options)\n }\n\n var sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n var sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n var sameSemVer = this.semver.version === comp.semver.version\n var differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n var oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n ((this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<'))\n var oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n ((this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>'))\n\n return sameDirectionIncreasing || sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan || oppositeDirectionsGreaterThan\n}\n\nexports.Range = Range\nfunction Range (range, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (range instanceof Range) {\n if (range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n return new Range(range.value, options)\n }\n\n if (!(this instanceof Range)) {\n return new Range(range, options)\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First, split based on boolean or ||\n this.raw = range\n this.set = range.split(/\\s*\\|\\|\\s*/).map(function (range) {\n return this.parseRange(range.trim())\n }, this).filter(function (c) {\n // throw out any that are not relevant for whatever reason\n return c.length\n })\n\n if (!this.set.length) {\n throw new TypeError('Invalid SemVer Range: ' + range)\n }\n\n this.format()\n}\n\nRange.prototype.format = function () {\n this.range = this.set.map(function (comps) {\n return comps.join(' ').trim()\n }).join('||').trim()\n return this.range\n}\n\nRange.prototype.toString = function () {\n return this.range\n}\n\nRange.prototype.parseRange = function (range) {\n var loose = this.options.loose\n range = range.trim()\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace)\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, re[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n var set = range.split(' ').map(function (comp) {\n return parseComparator(comp, this.options)\n }, this).join(' ').split(/\\s+/)\n if (this.options.loose) {\n // in loose mode, throw out any that are not valid comparators\n set = set.filter(function (comp) {\n return !!comp.match(compRe)\n })\n }\n set = set.map(function (comp) {\n return new Comparator(comp, this.options)\n }, this)\n\n return set\n}\n\nRange.prototype.intersects = function (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some(function (thisComparators) {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some(function (rangeComparators) {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every(function (thisComparator) {\n return rangeComparators.every(function (rangeComparator) {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n}\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nfunction isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// Mostly just for testing and legacy API reasons\nexports.toComparators = toComparators\nfunction toComparators (range, options) {\n return new Range(range, options).set.map(function (comp) {\n return comp.map(function (c) {\n return c.value\n }).join(' ').trim().split(' ')\n })\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nfunction parseComparator (comp, options) {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nfunction isX (id) {\n return !id || id.toLowerCase() === 'x' || id === '*'\n}\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0\nfunction replaceTildes (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceTilde(comp, options)\n }).join(' ')\n}\n\nfunction replaceTilde (comp, options) {\n var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('tilde', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0\n// ^1.2.3 --> >=1.2.3 <2.0.0\n// ^1.2.0 --> >=1.2.0 <2.0.0\nfunction replaceCarets (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceCaret(comp, options)\n }).join(' ')\n}\n\nfunction replaceCaret (comp, options) {\n debug('caret', comp, options)\n var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('caret', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n if (M === '0') {\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else {\n ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + (+M + 1) + '.0.0'\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + (+M + 1) + '.0.0'\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nfunction replaceXRanges (comp, options) {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map(function (comp) {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nfunction replaceXRange (comp, options) {\n comp = comp.trim()\n var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, function (ret, gtlt, M, m, p, pr) {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n var xM = isX(M)\n var xm = xM || isX(m)\n var xp = xm || isX(p)\n var anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n // >1.2.3 => >= 1.2.4\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n ret = gtlt + M + '.' + m + '.' + p + pr\n } else if (xm) {\n ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr\n } else if (xp) {\n ret = '>=' + M + '.' + m + '.0' + pr +\n ' <' + M + '.' + (+m + 1) + '.0' + pr\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nfunction replaceStars (comp, options) {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0\nfunction hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}\n\n// if ANY of the sets match ALL of its comparators, then pass\nRange.prototype.test = function (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (var i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n}\n\nfunction testSet (set, version, options) {\n for (var i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n var allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n\nexports.satisfies = satisfies\nfunction satisfies (version, range, options) {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\n\nexports.maxSatisfying = maxSatisfying\nfunction maxSatisfying (versions, range, options) {\n var max = null\n var maxSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\n\nexports.minSatisfying = minSatisfying\nfunction minSatisfying (versions, range, options) {\n var min = null\n var minSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\n\nexports.minVersion = minVersion\nfunction minVersion (range, loose) {\n range = new Range(range, loose)\n\n var minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n comparators.forEach(function (comparator) {\n // Clone to avoid manipulating the comparator's semver object.\n var compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!minver || gt(minver, compver)) {\n minver = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected operation: ' + comparator.operator)\n }\n })\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\n\nexports.validRange = validRange\nfunction validRange (range, options) {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\n\n// Determine if version is less than all the versions possible in the range\nexports.ltr = ltr\nfunction ltr (version, range, options) {\n return outside(version, range, '<', options)\n}\n\n// Determine if version is greater than all the versions possible in the range.\nexports.gtr = gtr\nfunction gtr (version, range, options) {\n return outside(version, range, '>', options)\n}\n\nexports.outside = outside\nfunction outside (version, range, hilo, options) {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n var gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisifes the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n var high = null\n var low = null\n\n comparators.forEach(function (comparator) {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nexports.prerelease = prerelease\nfunction prerelease (version, options) {\n var parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\n\nexports.intersects = intersects\nfunction intersects (r1, r2, options) {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\n\nexports.coerce = coerce\nfunction coerce (version, options) {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n var match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n var next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n return parse(match[2] +\n '.' + (match[3] || '0') +\n '.' + (match[4] || '0'), options)\n}\n","module.exports={A:\"ie\",B:\"edge\",C:\"firefox\",D:\"chrome\",E:\"safari\",F:\"opera\",G:\"ios_saf\",H:\"op_mini\",I:\"android\",J:\"bb\",K:\"op_mob\",L:\"and_chr\",M:\"and_ff\",N:\"ie_mob\",O:\"and_uc\",P:\"samsung\",Q:\"and_qq\",R:\"baidu\",S:\"kaios\"};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar browsers = exports.browsers = require('../../data/browsers');","module.exports={\"0\":\"56\",\"1\":\"57\",\"2\":\"58\",\"3\":\"60\",\"4\":\"62\",\"5\":\"63\",\"6\":\"64\",\"7\":\"11.1\",\"8\":\"68\",\"9\":\"12.1\",A:\"10\",B:\"11\",C:\"12\",D:\"7\",E:\"9\",F:\"4\",G:\"8\",H:\"6\",I:\"17\",J:\"18\",K:\"13\",L:\"15\",M:\"46\",N:\"16\",O:\"5\",P:\"19\",Q:\"20\",R:\"21\",S:\"22\",T:\"23\",U:\"24\",V:\"25\",W:\"26\",X:\"27\",Y:\"28\",Z:\"29\",a:\"30\",b:\"31\",c:\"32\",d:\"33\",e:\"34\",f:\"14\",g:\"36\",h:\"37\",i:\"38\",j:\"39\",k:\"40\",l:\"41\",m:\"42\",n:\"43\",o:\"44\",p:\"45\",q:\"76\",r:\"47\",s:\"48\",t:\"49\",u:\"50\",v:\"51\",w:\"52\",x:\"53\",y:\"54\",z:\"55\",AB:\"35\",BB:\"66\",CB:\"4.2-4.3\",DB:\"65\",EB:\"59\",FB:\"67\",GB:\"11.5\",HB:\"69\",IB:\"70\",JB:\"71\",KB:\"72\",LB:\"73\",MB:\"61\",NB:\"3\",OB:\"10.1\",PB:\"3.2\",QB:\"78\",RB:\"9.0-9.2\",SB:\"77\",TB:\"80\",UB:\"81\",VB:\"3.1\",WB:\"75\",XB:\"5.1\",YB:\"6.1\",ZB:\"7.1\",aB:\"9.1\",bB:\"74\",cB:\"3.6\",dB:\"3.5\",eB:\"TP\",fB:\"9.5-9.6\",gB:\"10.0-10.1\",hB:\"10.5\",iB:\"10.6\",jB:\"2\",kB:\"11.6\",lB:\"4.0-4.1\",mB:\"5.5\",nB:\"5.0-5.1\",oB:\"6.0-6.1\",pB:\"7.0-7.1\",qB:\"8.1-8.4\",rB:\"79\",sB:\"9.3\",tB:\"10.0-10.2\",uB:\"10.3\",vB:\"11.0-11.2\",wB:\"11.3-11.4\",xB:\"12.0-12.1\",yB:\"12.2-12.4\",zB:\"13.0-13.1\",\"0B\":\"13.2\",\"1B\":\"13.3\",\"2B\":\"all\",\"3B\":\"2.1\",\"4B\":\"2.2\",\"5B\":\"2.3\",\"6B\":\"4.1\",\"7B\":\"4.4\",\"8B\":\"4.4.3-4.4.4\",\"9B\":\"12.12\",AC:\"5.0-5.4\",BC:\"6.2-6.4\",CC:\"7.2-7.4\",DC:\"8.2\",EC:\"9.2\",FC:\"1.2\",GC:\"7.12\",HC:\"2.5\"};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar browserVersions = exports.browserVersions = require('../../data/browserVersions');","module.exports={A:{A:{H:0.0092277,D:0.0092277,G:0.110732,E:0.0415246,A:0.0369108,B:1.43029,mB:0.009298},B:\"ms\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"mB\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"\",\"\",\"\"],E:\"IE\",F:{mB:962323200,H:998870400,D:1161129600,G:1237420800,E:1300060800,A:1346716800,B:1381968000}},B:{A:{C:0.008806,K:0.008806,f:0.017612,L:0.017612,N:0.039627,I:0.149702,J:1.79642,q:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"q\",\"\",\"\"],E:\"Edge\",F:{C:1438128000,K:1447286400,f:1470096000,L:1491868800,N:1508198400,I:1525046400,J:1542067200,q:null},D:{C:\"ms\",K:\"ms\",f:\"ms\",L:\"ms\",N:\"ms\",I:\"ms\",J:\"ms\"}},C:{A:{\"0\":0.026418,\"1\":0.013209,\"2\":0.008806,\"3\":0.039627,\"4\":0.008806,\"5\":0.017612,\"6\":0.026418,\"8\":0.13209,jB:0.004827,NB:0.00487,F:0.00974,O:0.004879,H:0.020136,D:0.005725,G:0.004525,E:0.00533,A:0.004283,B:0.009042,C:0.004471,K:0.004486,f:0.00453,L:0.004465,N:0.004417,I:0.008922,J:0.004393,P:0.004443,Q:0.004283,R:0.008806,S:0.004393,T:0.004525,U:0.008786,V:0.004403,W:0.004317,X:0.004393,Y:0.004418,Z:0.008834,a:0.004403,b:0.008928,c:0.004471,d:0.008922,e:0.004707,AB:0.022015,g:0.004465,h:0.004783,i:0.008806,j:0.004783,k:0.00487,l:0.005029,m:0.0047,n:0.008806,o:0.008806,p:0.013209,M:0.004525,r:0.022015,s:0.030821,t:0.004403,u:0.013209,v:0.008806,w:0.145299,x:0.008806,y:0.013209,z:0.008806,EB:0.008806,MB:0.013209,DB:0.052836,BB:0.04403,FB:0.026418,HB:0.074851,IB:0.761719,JB:2.42605,KB:0.057239,LB:0,dB:0.008786,cB:0.00487},B:\"moz\",C:[\"\",\"\",\"\",\"jB\",\"NB\",\"dB\",\"cB\",\"F\",\"O\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"EB\",\"3\",\"MB\",\"4\",\"5\",\"6\",\"DB\",\"BB\",\"FB\",\"8\",\"HB\",\"IB\",\"JB\",\"KB\",\"LB\",\"\"],E:\"Firefox\",F:{\"0\":1506556800,\"1\":1510617600,\"2\":1516665600,\"3\":1525824000,\"4\":1536105600,\"5\":1540252800,\"6\":1544486400,\"8\":1562630400,jB:1161648000,NB:1213660800,dB:1246320000,cB:1264032000,F:1300752000,O:1308614400,H:1313452800,D:1317081600,G:1317081600,E:1320710400,A:1324339200,B:1327968000,C:1331596800,K:1335225600,f:1338854400,L:1342483200,N:1346112000,I:1349740800,J:1353628800,P:1357603200,Q:1361232000,R:1364860800,S:1368489600,T:1372118400,U:1375747200,V:1379376000,W:1386633600,X:1391472000,Y:1395100800,Z:1398729600,a:1402358400,b:1405987200,c:1409616000,d:1413244800,e:1417392000,AB:1421107200,g:1424736000,h:1428278400,i:1431475200,j:1435881600,k:1439251200,l:1442880000,m:1446508800,n:1450137600,o:1453852800,p:1457395200,M:1461628800,r:1465257600,s:1470096000,t:1474329600,u:1479168000,v:1485216000,w:1488844800,x:1492560000,y:1497312000,z:1502150400,EB:1520985600,MB:1529971200,DB:1548720000,BB:1552953600,FB:1558396800,HB:1567468800,IB:1571788800,JB:1575331200,KB:null,LB:null}},D:{A:{\"0\":0.035224,\"1\":0.066045,\"2\":0.030821,\"3\":0.030821,\"4\":0.030821,\"5\":0.277389,\"6\":0.017612,\"8\":0.061642,F:0.004706,O:0.004879,H:0.004879,D:0.005591,G:0.005591,E:0.005591,A:0.004534,B:0.004464,C:0.010424,K:0.004403,f:0.004706,L:0.015087,N:0.004393,I:0.004393,J:0.008652,P:0.004418,Q:0.004393,R:0.004317,S:0.004465,T:0.008786,U:0.008806,V:0.004461,W:0.004403,X:0.004326,Y:0.0047,Z:0.004461,a:0.004403,b:0.013209,c:0.004465,d:0.013209,e:0.008806,AB:0.008806,g:0.008806,h:0.004464,i:0.022015,j:0.004464,k:0.013209,l:0.008806,m:0.004403,n:0.017612,o:0.004465,p:0.004403,M:0.004403,r:0.008806,s:0.035224,t:0.515151,u:0.008806,v:0.013209,w:0.004403,x:0.022015,y:0.026418,z:0.04403,EB:0.017612,MB:0.035224,DB:0.052836,BB:0.035224,FB:0.066045,HB:0.184926,IB:0.149702,JB:0.198135,KB:0.206941,LB:0.184926,bB:0.224553,WB:0.268583,q:0.281792,SB:0.409479,QB:13.9971,rB:11.5006,TB:0.039627,UB:0.017612},B:\"webkit\",C:[\"F\",\"O\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"EB\",\"3\",\"MB\",\"4\",\"5\",\"6\",\"DB\",\"BB\",\"FB\",\"8\",\"HB\",\"IB\",\"JB\",\"KB\",\"LB\",\"bB\",\"WB\",\"q\",\"SB\",\"QB\",\"rB\",\"TB\",\"UB\"],E:\"Chrome\",F:{\"0\":1485302400,\"1\":1489017600,\"2\":1492560000,\"3\":1500940800,\"4\":1508198400,\"5\":1512518400,\"6\":1516752000,\"8\":1532390400,F:1264377600,O:1274745600,H:1283385600,D:1287619200,G:1291248000,E:1296777600,A:1299542400,B:1303862400,C:1307404800,K:1312243200,f:1316131200,L:1316131200,N:1319500800,I:1323734400,J:1328659200,P:1332892800,Q:1337040000,R:1340668800,S:1343692800,T:1348531200,U:1352246400,V:1357862400,W:1361404800,X:1364428800,Y:1369094400,Z:1374105600,a:1376956800,b:1384214400,c:1389657600,d:1392940800,e:1397001600,AB:1400544000,g:1405468800,h:1409011200,i:1412640000,j:1416268800,k:1421798400,l:1425513600,m:1429401600,n:1432080000,o:1437523200,p:1441152000,M:1444780800,r:1449014400,s:1453248000,t:1456963200,u:1460592000,v:1464134400,w:1469059200,x:1472601600,y:1476230400,z:1480550400,EB:1496707200,MB:1504569600,DB:1520294400,BB:1523923200,FB:1527552000,HB:1536019200,IB:1539648000,JB:1543968000,KB:1548720000,LB:1552348800,bB:1555977600,WB:1559606400,q:1564444800,SB:1568073600,QB:1571702400,rB:null,TB:null,UB:null}},E:{A:{\"7\":0.184926,\"9\":0.435897,F:0,O:0.004403,H:0.004349,D:0.004465,G:0.026418,E:0.013209,A:0.017612,B:0.039627,C:0.136493,K:2.29396,VB:0,PB:0.008692,XB:0.66045,YB:0.00456,ZB:0.004283,aB:0.035224,OB:0.096866,eB:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"VB\",\"PB\",\"F\",\"O\",\"XB\",\"H\",\"YB\",\"D\",\"ZB\",\"G\",\"E\",\"aB\",\"A\",\"OB\",\"B\",\"7\",\"C\",\"9\",\"K\",\"eB\",\"\",\"\"],E:\"Safari\",F:{\"7\":1522281600,\"9\":1553472000,VB:1205798400,PB:1226534400,F:1244419200,O:1275868800,XB:1311120000,H:1343174400,YB:1382400000,D:1382400000,ZB:1410998400,G:1413417600,E:1443657600,aB:1458518400,A:1474329600,OB:1490572800,B:1505779200,C:1537142400,K:1568851200,eB:null}},F:{A:{\"0\":0.008806,\"1\":0.008806,\"2\":0.013209,\"3\":0.004403,\"4\":0.004403,\"5\":0.013209,\"6\":0.070448,\"7\":0.006229,\"9\":0.008806,E:0.0082,B:0.016581,C:0.004317,L:0.00685,N:0.00685,I:0.00685,J:0.005014,P:0.006015,Q:0.004879,R:0.006597,S:0.006597,T:0.013434,U:0.006702,V:0.006015,W:0.005595,X:0.004393,Y:0.008652,Z:0.004879,a:0.004879,b:0.008806,c:0.005152,d:0.005014,e:0.009758,AB:0.004879,g:0.013209,h:0.004283,i:0.004367,j:0.004534,k:0.004367,l:0.004227,m:0.004418,n:0.009042,o:0.004227,p:0.004725,M:0.004417,r:0.008942,s:0.004707,t:0.004827,u:0.004707,v:0.004707,w:0.004326,x:0.008922,y:0.014349,z:0.004725,fB:0.00685,gB:0,hB:0.008392,iB:0.004706,GB:0.004879,kB:0.008786},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"E\",\"fB\",\"gB\",\"hB\",\"iB\",\"B\",\"7\",\"GB\",\"kB\",\"C\",\"9\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"\",\"\",\"\"],E:\"Opera\",F:{\"0\":1537833600,\"1\":1543363200,\"2\":1548201600,\"3\":1554768000,\"4\":1561593600,\"5\":1566259200,\"6\":1570406400,\"7\":1302566400,\"9\":1352073600,E:1150761600,fB:1223424000,gB:1251763200,hB:1267488000,iB:1277942400,B:1292457600,GB:1309219200,kB:1323129600,C:1323129600,L:1372723200,N:1377561600,I:1381104000,J:1386288000,P:1390867200,Q:1393891200,R:1399334400,S:1401753600,T:1405987200,U:1409616000,V:1413331200,W:1417132800,X:1422316800,Y:1425945600,Z:1430179200,a:1433808000,b:1438646400,c:1442448000,d:1445904000,e:1449100800,AB:1454371200,g:1457308800,h:1462320000,i:1465344000,j:1470096000,k:1474329600,l:1477267200,m:1481587200,n:1486425600,o:1490054400,p:1494374400,M:1498003200,r:1502236800,s:1506470400,t:1510099200,u:1515024000,v:1517961600,w:1521676800,x:1525910400,y:1530144000,z:1534982400},D:{\"7\":\"o\",\"9\":\"o\",E:\"o\",B:\"o\",C:\"o\",fB:\"o\",gB:\"o\",hB:\"o\",iB:\"o\",GB:\"o\",kB:\"o\"}},G:{A:{G:0.00128072,PB:0.00512289,lB:0.00256144,CB:0,nB:0.00768433,oB:0.00256144,pB:0.00896505,qB:0.0166494,RB:0.0153687,sB:0.162652,tB:0.0563518,uB:0.181862,vB:0.153687,wB:0.274074,xB:0.391901,yB:2.77404,zB:4.02787,\"0B\":1.83399,\"1B\":2.88931},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"PB\",\"lB\",\"CB\",\"nB\",\"oB\",\"pB\",\"G\",\"qB\",\"RB\",\"sB\",\"tB\",\"uB\",\"vB\",\"wB\",\"xB\",\"yB\",\"zB\",\"0B\",\"1B\",\"\",\"\"],E:\"iOS Safari\",F:{PB:1270252800,lB:1283904000,CB:1299628800,nB:1331078400,oB:1359331200,pB:1394409600,G:1410912000,qB:1413763200,RB:1442361600,sB:1458518400,tB:1473724800,uB:1490572800,vB:1505779200,wB:1522281600,xB:1537142400,yB:1553472000,zB:1568851200,\"0B\":1572220800,\"1B\":null}},H:{A:{\"2B\":1.16575},B:\"o\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"2B\",\"\",\"\",\"\"],E:\"Opera Mini\",F:{\"2B\":1426464000}},I:{A:{NB:0.000748894,F:0.00324521,q:0,\"3B\":0,\"4B\":0.000499263,\"5B\":0.000499263,\"6B\":0.00574152,CB:0.125565,\"7B\":0,\"8B\":0.0763872},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"3B\",\"4B\",\"5B\",\"NB\",\"F\",\"6B\",\"CB\",\"7B\",\"8B\",\"q\",\"\",\"\",\"\"],E:\"Android Browser\",F:{\"3B\":1256515200,\"4B\":1274313600,\"5B\":1291593600,NB:1298332800,F:1318896000,\"6B\":1341792000,CB:1374624000,\"7B\":1386547200,\"8B\":1401667200,q:1566777600}},J:{A:{D:0,A:0.011194},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"D\",\"A\",\"\",\"\",\"\"],E:\"Blackberry Browser\",F:{D:1325376000,A:1359504000}},K:{A:{\"7\":0,\"9\":0,A:0,B:0,C:0,M:0.0111391,GB:0},B:\"o\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"A\",\"B\",\"7\",\"GB\",\"C\",\"9\",\"M\",\"\",\"\",\"\"],E:\"Opera Mobile\",F:{\"7\":1314835200,\"9\":1349740800,A:1287100800,B:1300752000,GB:1318291200,C:1330300800,M:1474588800},D:{M:\"webkit\"}},L:{A:{QB:35.1619},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"QB\",\"\",\"\",\"\"],E:\"Chrome for Android\",F:{QB:1571702400}},M:{A:{\"8\":0.229477},B:\"moz\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"8\",\"\",\"\",\"\"],E:\"Firefox for Android\",F:{\"8\":1567468800}},N:{A:{A:0.0115934,B:0.050373},B:\"ms\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"A\",\"B\",\"\",\"\",\"\"],E:\"IE Mobile\",F:{A:1340150400,B:1353456000}},O:{A:{\"9B\":2.88246},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"9B\",\"\",\"\",\"\"],E:\"UC Browser for Android\",F:{\"9B\":1471392000},D:{\"9B\":\"webkit\"}},P:{A:{F:0.33211,AC:0.0311353,BC:0.0207569,CC:0.114163,DC:0.0415137,EC:0.321732,OB:2.72953},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"F\",\"AC\",\"BC\",\"CC\",\"DC\",\"EC\",\"OB\",\"\",\"\",\"\"],E:\"Samsung Internet\",F:{F:1461024000,AC:1481846400,BC:1509408000,CC:1528329600,DC:1546128000,EC:1554163200,OB:1567900800}},Q:{A:{FC:0.201492},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"FC\",\"\",\"\",\"\"],E:\"QQ Browser\",F:{FC:1483228800}},R:{A:{GC:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"GC\",\"\",\"\",\"\"],E:\"Baidu Browser\",F:{GC:1491004800}},S:{A:{HC:0.195895},B:\"moz\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"HC\",\"\",\"\",\"\"],E:\"KaiOS Browser\",F:{HC:1527811200}}};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.agents = undefined;\n\nvar _browsers = require('./browsers');\n\nvar _browserVersions = require('./browserVersions');\n\nvar agentsData = require('../../data/agents');\n\nfunction unpackBrowserVersions(versionsData) {\n return Object.keys(versionsData).reduce(function (usage, version) {\n usage[_browserVersions.browserVersions[version]] = versionsData[version];\n return usage;\n }, {});\n}\n\nvar agents = exports.agents = Object.keys(agentsData).reduce(function (map, key) {\n var versionsData = agentsData[key];\n map[_browsers.browsers[key]] = Object.keys(versionsData).reduce(function (data, entry) {\n if (entry === 'A') {\n data.usage_global = unpackBrowserVersions(versionsData[entry]);\n } else if (entry === 'C') {\n data.versions = versionsData[entry].reduce(function (list, version) {\n if (version === '') {\n list.push(null);\n } else {\n list.push(_browserVersions.browserVersions[version]);\n }\n return list;\n }, []);\n } else if (entry === 'D') {\n data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]);\n } else if (entry === 'E') {\n data.browser = versionsData[entry];\n } else if (entry === 'F') {\n data.release_date = Object.keys(versionsData[entry]).reduce(function (map, key) {\n map[_browserVersions.browserVersions[key]] = versionsData[entry][key];\n return map;\n }, {});\n } else {\n // entry is B\n data.prefix = versionsData[entry];\n }\n return data;\n }, {});\n return map;\n}, {});","module.exports = {\n\t\"8.0\": \"79\",\n\t\"7.1\": \"78\",\n\t\"7.0\": \"78\",\n\t\"6.1\": \"76\",\n\t\"6.0\": \"76\",\n\t\"5.0\": \"72\",\n\t\"4.2\": \"69\",\n\t\"4.1\": \"69\",\n\t\"4.0\": \"69\",\n\t\"3.1\": \"66\",\n\t\"3.0\": \"66\",\n\t\"2.1\": \"61\",\n\t\"2.0\": \"61\",\n\t\"1.8\": \"59\",\n\t\"1.7\": \"58\",\n\t\"1.6\": \"56\",\n\t\"1.5\": \"54\",\n\t\"1.4\": \"53\",\n\t\"1.3\": \"52\",\n\t\"1.2\": \"51\",\n\t\"1.1\": \"50\",\n\t\"1.0\": \"49\",\n\t\"0.37\": \"49\",\n\t\"0.36\": \"47\",\n\t\"0.35\": \"45\",\n\t\"0.34\": \"45\",\n\t\"0.33\": \"45\",\n\t\"0.32\": \"45\",\n\t\"0.31\": \"44\",\n\t\"0.30\": \"44\",\n\t\"0.29\": \"43\",\n\t\"0.28\": \"43\",\n\t\"0.27\": \"42\",\n\t\"0.26\": \"42\",\n\t\"0.25\": \"42\",\n\t\"0.24\": \"41\",\n\t\"0.23\": \"41\",\n\t\"0.22\": \"41\",\n\t\"0.21\": \"40\",\n\t\"0.20\": \"39\"\n};","function BrowserslistError (message) {\n this.name = 'BrowserslistError'\n this.message = message\n this.browserslist = true\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, BrowserslistError)\n }\n}\n\nBrowserslistError.prototype = Error.prototype\n\nmodule.exports = BrowserslistError\n","var BrowserslistError = require('./error')\n\nfunction noop () { }\n\nmodule.exports = {\n loadQueries: function loadQueries () {\n throw new BrowserslistError(\n 'Sharable configs are not supported in client-side build of Browserslist')\n },\n\n getStat: function getStat (opts) {\n return opts.stats\n },\n\n loadConfig: function loadConfig (opts) {\n if (opts.config) {\n throw new BrowserslistError(\n 'Browserslist config are not supported in client-side build')\n }\n },\n\n loadCountry: function loadCountry () {\n throw new BrowserslistError(\n 'Country statistics is not supported ' +\n 'in client-side build of Browserslist')\n },\n\n currentNode: function currentNode (resolve, context) {\n return resolve(['maintained node versions'], context)[0]\n },\n\n parseConfig: noop,\n\n readConfig: noop,\n\n findConfig: noop,\n\n clearCaches: noop,\n\n oldDataWarning: noop\n}\n","var jsReleases = require('node-releases/data/processed/envs.json')\nvar agents = require('caniuse-lite/dist/unpacker/agents').agents\nvar jsEOL = require('node-releases/data/release-schedule/release-schedule.json')\nvar path = require('path')\nvar e2c = require('electron-to-chromium/versions')\n\nvar BrowserslistError = require('./error')\nvar env = require('./node') // Will load browser.js in webpack\n\nvar YEAR = 365.259641 * 24 * 60 * 60 * 1000\nvar ANDROID_EVERGREEN_FIRST = 37\n\nvar QUERY_OR = 1\nvar QUERY_AND = 2\n\nfunction isVersionsMatch (versionA, versionB) {\n return (versionA + '.').indexOf(versionB + '.') === 0\n}\n\nfunction isEolReleased (name) {\n var version = name.slice(1)\n return jsReleases.some(function (i) {\n return isVersionsMatch(i.version, version)\n })\n}\n\nfunction normalize (versions) {\n return versions.filter(function (version) {\n return typeof version === 'string'\n })\n}\n\nfunction normalizeElectron (version) {\n var versionToUse = version\n if (version.split('.').length === 3) {\n versionToUse = version\n .split('.')\n .slice(0, -1)\n .join('.')\n }\n return versionToUse\n}\n\nfunction nameMapper (name) {\n return function mapName (version) {\n return name + ' ' + version\n }\n}\n\nfunction getMajor (version) {\n return parseInt(version.split('.')[0])\n}\n\nfunction getMajorVersions (released, number) {\n if (released.length === 0) return []\n var minimum = getMajor(released[released.length - 1]) - parseInt(number) + 1\n var selected = []\n for (var i = released.length - 1; i >= 0; i--) {\n if (minimum > getMajor(released[i])) break\n selected.unshift(released[i])\n }\n return selected\n}\n\nfunction uniq (array) {\n var filtered = []\n for (var i = 0; i < array.length; i++) {\n if (filtered.indexOf(array[i]) === -1) filtered.push(array[i])\n }\n return filtered\n}\n\n// Helpers\n\nfunction fillUsage (result, name, data) {\n for (var i in data) {\n result[name + ' ' + i] = data[i]\n }\n}\n\nfunction generateFilter (sign, version) {\n version = parseFloat(version)\n if (sign === '>') {\n return function (v) {\n return parseFloat(v) > version\n }\n } else if (sign === '>=') {\n return function (v) {\n return parseFloat(v) >= version\n }\n } else if (sign === '<') {\n return function (v) {\n return parseFloat(v) < version\n }\n } else {\n return function (v) {\n return parseFloat(v) <= version\n }\n }\n}\n\nfunction generateSemverFilter (sign, version) {\n version = version.split('.').map(parseSimpleInt)\n version[1] = version[1] || 0\n version[2] = version[2] || 0\n if (sign === '>') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(v, version) > 0\n }\n } else if (sign === '>=') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(v, version) >= 0\n }\n } else if (sign === '<') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(version, v) > 0\n }\n } else {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(version, v) >= 0\n }\n }\n}\n\nfunction parseSimpleInt (x) {\n return parseInt(x)\n}\n\nfunction compare (a, b) {\n if (a < b) return -1\n if (a > b) return +1\n return 0\n}\n\nfunction compareSemver (a, b) {\n return (\n compare(parseInt(a[0]), parseInt(b[0])) ||\n compare(parseInt(a[1] || '0'), parseInt(b[1] || '0')) ||\n compare(parseInt(a[2] || '0'), parseInt(b[2] || '0'))\n )\n}\n\nfunction resolveVersion (data, version) {\n if (data.versions.indexOf(version) !== -1) {\n return version\n } else if (browserslist.versionAliases[data.name][version]) {\n return browserslist.versionAliases[data.name][version]\n } else {\n return false\n }\n}\n\nfunction normalizeVersion (data, version) {\n var resolved = resolveVersion(data, version)\n if (resolved) {\n return resolved\n } else if (data.versions.length === 1) {\n return data.versions[0]\n } else {\n return false\n }\n}\n\nfunction filterByYear (since, context) {\n since = since / 1000\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var versions = Object.keys(data.releaseDate).filter(function (v) {\n return data.releaseDate[v] >= since\n })\n return selected.concat(versions.map(nameMapper(data.name)))\n }, [])\n}\n\nfunction cloneData (data) {\n return {\n name: data.name,\n versions: data.versions,\n released: data.released,\n releaseDate: data.releaseDate\n }\n}\n\nfunction byName (name, context) {\n name = name.toLowerCase()\n name = browserslist.aliases[name] || name\n if (context.mobileToDesktop && browserslist.desktopNames[name]) {\n var desktop = browserslist.data[browserslist.desktopNames[name]]\n if (name === 'android') {\n return normalizeAndroidData(cloneData(browserslist.data[name]), desktop)\n } else {\n var cloned = cloneData(desktop)\n cloned.name = name\n return cloned\n }\n }\n return browserslist.data[name]\n}\n\nfunction normalizeAndroidVersions (androidVersions, chromeVersions) {\n var firstEvergreen = ANDROID_EVERGREEN_FIRST\n var last = chromeVersions[chromeVersions.length - 1]\n return androidVersions\n .filter(function (version) { return /^(?:[2-4]\\.|[34]$)/.test(version) })\n .concat(chromeVersions.slice(firstEvergreen - last - 1))\n}\n\nfunction normalizeAndroidData (android, chrome) {\n android.released = normalizeAndroidVersions(android.released, chrome.released)\n android.versions = normalizeAndroidVersions(android.versions, chrome.versions)\n return android\n}\n\nfunction checkName (name, context) {\n var data = byName(name, context)\n if (!data) throw new BrowserslistError('Unknown browser ' + name)\n return data\n}\n\nfunction unknownQuery (query) {\n return new BrowserslistError(\n 'Unknown browser query `' + query + '`. ' +\n 'Maybe you are using old Browserslist or made typo in query.'\n )\n}\n\nfunction filterAndroid (list, versions, context) {\n if (context.mobileToDesktop) return list\n var released = browserslist.data.android.released\n var last = released[released.length - 1]\n var diff = last - ANDROID_EVERGREEN_FIRST - versions\n if (diff > 0) {\n return list.slice(-1)\n } else {\n return list.slice(diff - 1)\n }\n}\n\n/**\n * Resolves queries into a browser list.\n * @param {string|string[]} queries Queries to combine.\n * Either an array of queries or a long string of queries.\n * @param {object} [context] Optional arguments to\n * the select function in `queries`.\n * @returns {string[]} A list of browsers\n */\nfunction resolve (queries, context) {\n if (Array.isArray(queries)) {\n queries = flatten(queries.map(parse))\n } else {\n queries = parse(queries)\n }\n\n return queries.reduce(function (result, query, index) {\n var selection = query.queryString\n\n var isExclude = selection.indexOf('not ') === 0\n if (isExclude) {\n if (index === 0) {\n throw new BrowserslistError(\n 'Write any browsers query (for instance, `defaults`) ' +\n 'before `' + selection + '`')\n }\n selection = selection.slice(4)\n }\n\n for (var i = 0; i < QUERIES.length; i++) {\n var type = QUERIES[i]\n var match = selection.match(type.regexp)\n if (match) {\n var args = [context].concat(match.slice(1))\n var array = type.select.apply(browserslist, args).map(function (j) {\n var parts = j.split(' ')\n if (parts[1] === '0') {\n return parts[0] + ' ' + byName(parts[0], context).versions[0]\n } else {\n return j\n }\n })\n\n switch (query.type) {\n case QUERY_AND:\n if (isExclude) {\n return result.filter(function (j) {\n return array.indexOf(j) === -1\n })\n } else {\n return result.filter(function (j) {\n return array.indexOf(j) !== -1\n })\n }\n case QUERY_OR:\n default:\n if (isExclude) {\n var filter = { }\n array.forEach(function (j) {\n filter[j] = true\n })\n return result.filter(function (j) {\n return !filter[j]\n })\n }\n return result.concat(array)\n }\n }\n }\n\n throw unknownQuery(selection)\n }, [])\n}\n\nvar cache = { }\n\n/**\n * Return array of browsers by selection queries.\n *\n * @param {(string|string[])} [queries=browserslist.defaults] Browser queries.\n * @param {object} [opts] Options.\n * @param {string} [opts.path=\".\"] Path to processed file.\n * It will be used to find config files.\n * @param {string} [opts.env=\"production\"] Processing environment.\n * It will be used to take right\n * queries from config file.\n * @param {string} [opts.config] Path to config file with queries.\n * @param {object} [opts.stats] Custom browser usage statistics\n * for \"> 1% in my stats\" query.\n * @param {boolean} [opts.ignoreUnknownVersions=false] Do not throw on unknown\n * version in direct query.\n * @param {boolean} [opts.dangerousExtend] Disable security checks\n * for extend query.\n * @param {boolean} [opts.mobileToDesktop] Alias mobile browsers to the desktop\n * version when Can I Use doesn't have\n * data about the specified version.\n * @returns {string[]} Array with browser names in Can I Use.\n *\n * @example\n * browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8']\n */\nfunction browserslist (queries, opts) {\n if (typeof opts === 'undefined') opts = { }\n\n if (typeof opts.path === 'undefined') {\n opts.path = path.resolve ? path.resolve('.') : '.'\n }\n\n if (typeof queries === 'undefined' || queries === null) {\n var config = browserslist.loadConfig(opts)\n if (config) {\n queries = config\n } else {\n queries = browserslist.defaults\n }\n }\n\n if (!(typeof queries === 'string' || Array.isArray(queries))) {\n throw new BrowserslistError(\n 'Browser queries must be an array or string. Got ' + typeof queries + '.')\n }\n\n var context = {\n ignoreUnknownVersions: opts.ignoreUnknownVersions,\n dangerousExtend: opts.dangerousExtend,\n mobileToDesktop: opts.mobileToDesktop\n }\n\n env.oldDataWarning(browserslist.data)\n var stats = env.getStat(opts, browserslist.data)\n if (stats) {\n context.customUsage = { }\n for (var browser in stats) {\n fillUsage(context.customUsage, browser, stats[browser])\n }\n }\n\n var cacheKey = JSON.stringify([queries, context])\n if (cache[cacheKey]) return cache[cacheKey]\n\n var result = uniq(resolve(queries, context)).sort(function (name1, name2) {\n name1 = name1.split(' ')\n name2 = name2.split(' ')\n if (name1[0] === name2[0]) {\n // assumptions on caniuse data\n // 1) version ranges never overlaps\n // 2) if version is not a range, it never contains `-`\n var version1 = name1[1].split('-')[0]\n var version2 = name2[1].split('-')[0]\n return compareSemver(version2.split('.'), version1.split('.'))\n } else {\n return compare(name1[0], name2[0])\n }\n })\n if (!process.env.BROWSERSLIST_DISABLE_CACHE) {\n cache[cacheKey] = result\n }\n return result\n}\n\nfunction parse (queries) {\n var qs = []\n do {\n queries = doMatch(queries, qs)\n } while (queries)\n return qs\n}\n\nfunction doMatch (string, qs) {\n var or = /^(?:,\\s*|\\s+or\\s+)(.*)/i\n var and = /^\\s+and\\s+(.*)/i\n\n return find(string, function (parsed, n, max) {\n if (and.test(parsed)) {\n qs.unshift({ type: QUERY_AND, queryString: parsed.match(and)[1] })\n return true\n } else if (or.test(parsed)) {\n qs.unshift({ type: QUERY_OR, queryString: parsed.match(or)[1] })\n return true\n } else if (n === max) {\n qs.unshift({ type: QUERY_OR, queryString: parsed.trim() })\n return true\n }\n return false\n })\n}\n\nfunction find (string, predicate) {\n for (var n = 1, max = string.length; n <= max; n++) {\n var parsed = string.substr(-n, n)\n if (predicate(parsed, n, max)) {\n return string.slice(0, -n)\n }\n }\n return ''\n}\n\nfunction flatten (array) {\n if (!Array.isArray(array)) return [array]\n return array.reduce(function (a, b) {\n return a.concat(flatten(b))\n }, [])\n}\n\n// Will be filled by Can I Use data below\nbrowserslist.data = { }\nbrowserslist.usage = {\n global: { },\n custom: null\n}\n\n// Default browsers query\nbrowserslist.defaults = [\n '> 0.5%',\n 'last 2 versions',\n 'Firefox ESR',\n 'not dead'\n]\n\n// Browser names aliases\nbrowserslist.aliases = {\n fx: 'firefox',\n ff: 'firefox',\n ios: 'ios_saf',\n explorer: 'ie',\n blackberry: 'bb',\n explorermobile: 'ie_mob',\n operamini: 'op_mini',\n operamobile: 'op_mob',\n chromeandroid: 'and_chr',\n firefoxandroid: 'and_ff',\n ucandroid: 'and_uc',\n qqandroid: 'and_qq'\n}\n\n// Can I Use only provides a few versions for some browsers (e.g. and_chr).\n// Fallback to a similar browser for unknown versions\nbrowserslist.desktopNames = {\n and_chr: 'chrome',\n and_ff: 'firefox',\n ie_mob: 'ie',\n op_mob: 'opera',\n android: 'chrome' // has extra processing logic\n}\n\n// Aliases to work with joined versions like `ios_saf 7.0-7.1`\nbrowserslist.versionAliases = { }\n\nbrowserslist.clearCaches = env.clearCaches\nbrowserslist.parseConfig = env.parseConfig\nbrowserslist.readConfig = env.readConfig\nbrowserslist.findConfig = env.findConfig\nbrowserslist.loadConfig = env.loadConfig\n\n/**\n * Return browsers market coverage.\n *\n * @param {string[]} browsers Browsers names in Can I Use.\n * @param {string|object} [stats=\"global\"] Which statistics should be used.\n * Country code or custom statistics.\n * Pass `\"my stats\"` to load statistics\n * from Browserslist files.\n *\n * @return {number} Total market coverage for all selected browsers.\n *\n * @example\n * browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1\n */\nbrowserslist.coverage = function (browsers, stats) {\n var data\n if (typeof stats === 'undefined') {\n data = browserslist.usage.global\n } else if (stats === 'my stats') {\n var opts = {}\n opts.path = path.resolve ? path.resolve('.') : '.'\n var customStats = env.getStat(opts)\n if (!customStats) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n data = {}\n for (var browser in customStats) {\n fillUsage(data, browser, customStats[browser])\n }\n } else if (typeof stats === 'string') {\n if (stats.length > 2) {\n stats = stats.toLowerCase()\n } else {\n stats = stats.toUpperCase()\n }\n env.loadCountry(browserslist.usage, stats)\n data = browserslist.usage[stats]\n } else {\n if ('dataByBrowser' in stats) {\n stats = stats.dataByBrowser\n }\n data = { }\n for (var name in stats) {\n for (var version in stats[name]) {\n data[name + ' ' + version] = stats[name][version]\n }\n }\n }\n\n return browsers.reduce(function (all, i) {\n var usage = data[i]\n if (usage === undefined) {\n usage = data[i.replace(/ \\S+$/, ' 0')]\n }\n return all + (usage || 0)\n }, 0)\n}\n\nvar QUERIES = [\n {\n regexp: /^last\\s+(\\d+)\\s+major\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = getMajorVersions(data.released, versions)\n list = list.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = data.released.slice(-versions)\n list = list.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+electron\\s+major\\s+versions?$/i,\n select: function (context, versions) {\n var validVersions = getMajorVersions(Object.keys(e2c).reverse(), versions)\n return validVersions.map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+(\\w+)\\s+major\\s+versions?$/i,\n select: function (context, versions, name) {\n var data = checkName(name, context)\n var validVersions = getMajorVersions(data.released, versions)\n var list = validVersions.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return list\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+electron\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(e2c).reverse().slice(-versions).map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+(\\w+)\\s+versions?$/i,\n select: function (context, versions, name) {\n var data = checkName(name, context)\n var list = data.released.slice(-versions).map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return list\n }\n },\n {\n regexp: /^unreleased\\s+versions$/i,\n select: function (context) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = data.versions.filter(function (v) {\n return data.released.indexOf(v) === -1\n })\n list = list.map(nameMapper(data.name))\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^unreleased\\s+electron\\s+versions?$/i,\n select: function () {\n return []\n }\n },\n {\n regexp: /^unreleased\\s+(\\w+)\\s+versions?$/i,\n select: function (context, name) {\n var data = checkName(name, context)\n return data.versions.filter(function (v) {\n return data.released.indexOf(v) === -1\n }).map(nameMapper(data.name))\n }\n },\n {\n regexp: /^last\\s+(\\d*.?\\d+)\\s+years?$/i,\n select: function (context, years) {\n return filterByYear(Date.now() - YEAR * years, context)\n }\n },\n {\n regexp: /^since (\\d+)(?:-(\\d+))?(?:-(\\d+))?$/i,\n select: function (context, year, month, date) {\n year = parseInt(year)\n month = parseInt(month || '01') - 1\n date = parseInt(date || '01')\n return filterByYear(Date.UTC(year, month, date, 0, 0, 0), context)\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%$/,\n select: function (context, sign, popularity) {\n popularity = parseFloat(popularity)\n var usage = browserslist.usage.global\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+my\\s+stats$/,\n select: function (context, sign, popularity) {\n popularity = parseFloat(popularity)\n if (!context.customUsage) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n var usage = context.customUsage\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+(\\S+)\\s+stats$/,\n select: function (context, sign, popularity, name) {\n popularity = parseFloat(popularity)\n var stats = env.loadStat(context, name, browserslist.data)\n if (stats) {\n context.customUsage = { }\n for (var browser in stats) {\n fillUsage(context.customUsage, browser, stats[browser])\n }\n }\n if (!context.customUsage) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n var usage = context.customUsage\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+((alt-)?\\w\\w)$/,\n select: function (context, sign, popularity, place) {\n popularity = parseFloat(popularity)\n if (place.length === 2) {\n place = place.toUpperCase()\n } else {\n place = place.toLowerCase()\n }\n env.loadCountry(browserslist.usage, place)\n var usage = browserslist.usage[place]\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^cover\\s+(\\d*\\.?\\d+)%(\\s+in\\s+(my\\s+stats|(alt-)?\\w\\w))?$/,\n select: function (context, coverage, statMode) {\n coverage = parseFloat(coverage)\n var usage = browserslist.usage.global\n if (statMode) {\n if (statMode.match(/^\\s+in\\s+my\\s+stats$/)) {\n if (!context.customUsage) {\n throw new BrowserslistError(\n 'Custom usage statistics was not provided'\n )\n }\n usage = context.customUsage\n } else {\n var match = statMode.match(/\\s+in\\s+((alt-)?\\w\\w)/)\n var place = match[1]\n if (place.length === 2) {\n place = place.toUpperCase()\n } else {\n place = place.toLowerCase()\n }\n env.loadCountry(browserslist.usage, place)\n usage = browserslist.usage[place]\n }\n }\n var versions = Object.keys(usage).sort(function (a, b) {\n return usage[b] - usage[a]\n })\n var coveraged = 0\n var result = []\n var version\n for (var i = 0; i <= versions.length; i++) {\n version = versions[i]\n if (usage[version] === 0) break\n coveraged += usage[version]\n result.push(version)\n if (coveraged >= coverage) break\n }\n return result\n }\n },\n {\n regexp: /^electron\\s+([\\d.]+)\\s*-\\s*([\\d.]+)$/i,\n select: function (context, from, to) {\n var fromToUse = normalizeElectron(from)\n var toToUse = normalizeElectron(to)\n if (!e2c[fromToUse]) {\n throw new BrowserslistError('Unknown version ' + from + ' of electron')\n }\n if (!e2c[toToUse]) {\n throw new BrowserslistError('Unknown version ' + to + ' of electron')\n }\n from = parseFloat(from)\n to = parseFloat(to)\n return Object.keys(e2c).filter(function (i) {\n var parsed = parseFloat(i)\n return parsed >= from && parsed <= to\n }).map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^(\\w+)\\s+([\\d.]+)\\s*-\\s*([\\d.]+)$/i,\n select: function (context, name, from, to) {\n var data = checkName(name, context)\n from = parseFloat(normalizeVersion(data, from) || from)\n to = parseFloat(normalizeVersion(data, to) || to)\n function filter (v) {\n var parsed = parseFloat(v)\n return parsed >= from && parsed <= to\n }\n return data.released.filter(filter).map(nameMapper(data.name))\n }\n },\n {\n regexp: /^electron\\s*(>=?|<=?)\\s*([\\d.]+)$/i,\n select: function (context, sign, version) {\n var versionToUse = normalizeElectron(version)\n return Object.keys(e2c)\n .filter(generateFilter(sign, versionToUse))\n .map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^node\\s*(>=?|<=?)\\s*([\\d.]+)$/i,\n select: function (context, sign, version) {\n var nodeVersions = jsReleases.filter(function (i) {\n return i.name === 'nodejs'\n }).map(function (i) {\n return i.version\n })\n return nodeVersions\n .filter(generateSemverFilter(sign, version))\n .map(function (v) {\n return 'node ' + v\n })\n }\n },\n {\n regexp: /^(\\w+)\\s*(>=?|<=?)\\s*([\\d.]+)$/,\n select: function (context, name, sign, version) {\n var data = checkName(name, context)\n var alias = browserslist.versionAliases[data.name][version]\n if (alias) {\n version = alias\n }\n return data.released\n .filter(generateFilter(sign, version))\n .map(function (v) {\n return data.name + ' ' + v\n })\n }\n },\n {\n regexp: /^(firefox|ff|fx)\\s+esr$/i,\n select: function () {\n return ['firefox 68']\n }\n },\n {\n regexp: /(operamini|op_mini)\\s+all/i,\n select: function () {\n return ['op_mini all']\n }\n },\n {\n regexp: /^electron\\s+([\\d.]+)$/i,\n select: function (context, version) {\n var versionToUse = normalizeElectron(version)\n var chrome = e2c[versionToUse]\n if (!chrome) {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of electron')\n }\n return ['chrome ' + chrome]\n }\n },\n {\n regexp: /^node\\s+(\\d+(\\.\\d+)?(\\.\\d+)?)$/i,\n select: function (context, version) {\n var nodeReleases = jsReleases.filter(function (i) {\n return i.name === 'nodejs'\n })\n var matched = nodeReleases.filter(function (i) {\n return isVersionsMatch(i.version, version)\n })\n if (matched.length === 0) {\n if (context.ignoreUnknownVersions) {\n return []\n } else {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of Node.js')\n }\n }\n return ['node ' + matched[matched.length - 1].version]\n }\n },\n {\n regexp: /^current\\s+node$/i,\n select: function (context) {\n return [env.currentNode(resolve, context)]\n }\n },\n {\n regexp: /^maintained\\s+node\\s+versions$/i,\n select: function (context) {\n var now = Date.now()\n var queries = Object.keys(jsEOL).filter(function (key) {\n return now < Date.parse(jsEOL[key].end) &&\n now > Date.parse(jsEOL[key].start) &&\n isEolReleased(key)\n }).map(function (key) {\n return 'node ' + key.slice(1)\n })\n return resolve(queries, context)\n }\n },\n {\n regexp: /^phantomjs\\s+1.9$/i,\n select: function () {\n return ['safari 5']\n }\n },\n {\n regexp: /^phantomjs\\s+2.1$/i,\n select: function () {\n return ['safari 6']\n }\n },\n {\n regexp: /^(\\w+)\\s+(tp|[\\d.]+)$/i,\n select: function (context, name, version) {\n if (/^tp$/i.test(version)) version = 'TP'\n var data = checkName(name, context)\n var alias = normalizeVersion(data, version)\n if (alias) {\n version = alias\n } else {\n if (version.indexOf('.') === -1) {\n alias = version + '.0'\n } else {\n alias = version.replace(/\\.0$/, '')\n }\n alias = normalizeVersion(data, alias)\n if (alias) {\n version = alias\n } else if (context.ignoreUnknownVersions) {\n return []\n } else {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of ' + name)\n }\n }\n return [data.name + ' ' + version]\n }\n },\n {\n regexp: /^extends (.+)$/i,\n select: function (context, name) {\n return resolve(env.loadQueries(context, name), context)\n }\n },\n {\n regexp: /^defaults$/i,\n select: function (context) {\n return resolve(browserslist.defaults, context)\n }\n },\n {\n regexp: /^dead$/i,\n select: function (context) {\n var dead = [\n 'ie <= 10', 'ie_mob <= 10',\n 'bb <= 10',\n 'op_mob <= 12.1',\n 'samsung 4'\n ]\n return resolve(dead, context)\n }\n },\n {\n regexp: /^(\\w+)$/i,\n select: function (context, name) {\n if (byName(name, context)) {\n throw new BrowserslistError(\n 'Specify versions in Browserslist query for browser ' + name)\n } else {\n throw unknownQuery(name)\n }\n }\n }\n];\n\n// Get and convert Can I Use data\n\n(function () {\n for (var name in agents) {\n var browser = agents[name]\n browserslist.data[name] = {\n name: name,\n versions: normalize(agents[name].versions),\n released: normalize(agents[name].versions.slice(0, -3)),\n releaseDate: agents[name].release_date\n }\n fillUsage(browserslist.usage.global, name, browser.usage_global)\n\n browserslist.versionAliases[name] = { }\n for (var i = 0; i < browser.versions.length; i++) {\n var full = browser.versions[i]\n if (!full) continue\n\n if (full.indexOf('-') !== -1) {\n var interval = full.split('-')\n for (var j = 0; j < interval.length; j++) {\n browserslist.versionAliases[name][interval[j]] = full\n }\n }\n }\n }\n}())\n\nmodule.exports = browserslist\n","'use strict';\nconst array = [];\nconst charCodeCache = [];\n\nconst leven = (left, right) => {\n\tif (left === right) {\n\t\treturn 0;\n\t}\n\n\tconst swap = left;\n\n\t// Swapping the strings if `a` is longer than `b` so we know which one is the\n\t// shortest & which one is the longest\n\tif (left.length > right.length) {\n\t\tleft = right;\n\t\tright = swap;\n\t}\n\n\tlet leftLength = left.length;\n\tlet rightLength = right.length;\n\n\t// Performing suffix trimming:\n\t// We can linearly drop suffix common to both strings since they\n\t// don't increase distance at all\n\t// Note: `~-` is the bitwise way to perform a `- 1` operation\n\twhile (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {\n\t\tleftLength--;\n\t\trightLength--;\n\t}\n\n\t// Performing prefix trimming\n\t// We can linearly drop prefix common to both strings since they\n\t// don't increase distance at all\n\tlet start = 0;\n\n\twhile (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) {\n\t\tstart++;\n\t}\n\n\tleftLength -= start;\n\trightLength -= start;\n\n\tif (leftLength === 0) {\n\t\treturn rightLength;\n\t}\n\n\tlet bCharCode;\n\tlet result;\n\tlet temp;\n\tlet temp2;\n\tlet i = 0;\n\tlet j = 0;\n\n\twhile (i < leftLength) {\n\t\tcharCodeCache[i] = left.charCodeAt(start + i);\n\t\tarray[i] = ++i;\n\t}\n\n\twhile (j < rightLength) {\n\t\tbCharCode = right.charCodeAt(start + j);\n\t\ttemp = j++;\n\t\tresult = j;\n\n\t\tfor (i = 0; i < leftLength; i++) {\n\t\t\ttemp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;\n\t\t\ttemp = array[i];\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tresult = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;\n\t\t}\n\t}\n\n\treturn result;\n};\n\nmodule.exports = leven;\n// TODO: Remove this for the next major release\nmodule.exports.default = leven;\n","import leven from 'leven';\n\nexport default function levenArray(str, array) {\n let minLeven = Number.POSITIVE_INFINITY;\n let result = undefined;\n for(const item of array) {\n const distance = leven(str, item);\n if (distance < minLeven) {\n minLeven = distance;\n result = item;\n }\n }\n return result;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/native-modules.json\");\n","export const unreleasedLabels = {\n safari: \"tp\",\n};\n\nexport const browserNameMap = {\n and_chr: \"chrome\",\n and_ff: \"firefox\",\n android: \"android\",\n chrome: \"chrome\",\n edge: \"edge\",\n firefox: \"firefox\",\n ie: \"ie\",\n ie_mob: \"ie\",\n ios_saf: \"ios\",\n node: \"node\",\n op_mob: \"opera\",\n opera: \"opera\",\n safari: \"safari\",\n samsung: \"samsung\",\n};\n","// @flow\n\nimport invariant from \"invariant\";\nimport semver from \"semver\";\n\nimport { unreleasedLabels } from \"./targets\";\nimport type { Target, Targets } from \"./types\";\n\nconst versionRegExp = /^(\\d+|\\d+.\\d+)$/;\n\nexport function semverMin(first: ?string, second: string): string {\n return first && semver.lt(first, second) ? first : second;\n}\n\n// Convert version to a semver value.\n// 2.5 -> 2.5.0; 1 -> 1.0.0;\nexport function semverify(version: number | string): string {\n if (typeof version === \"string\" && semver.valid(version)) {\n return version;\n }\n\n invariant(\n typeof version === \"number\" ||\n (typeof version === \"string\" && versionRegExp.test(version)),\n `'${version}' is not a valid version`,\n );\n\n const split = version.toString().split(\".\");\n while (split.length < 3) {\n split.push(\"0\");\n }\n return split.join(\".\");\n}\n\nexport function isUnreleasedVersion(\n version: string | number,\n env: string,\n): boolean {\n const unreleasedLabel = unreleasedLabels[env];\n return (\n !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase()\n );\n}\n\nexport function getLowestUnreleased(a: string, b: string, env: string): string {\n const unreleasedLabel = unreleasedLabels[env];\n const hasUnreleased = [a, b].some(item => item === unreleasedLabel);\n if (hasUnreleased) {\n return a === hasUnreleased ? b : a || b;\n }\n return semverMin(a, b);\n}\n\nexport function getLowestImplementedVersion(\n plugin: Targets,\n environment: Target,\n): string {\n const result = plugin[environment];\n // When Android support data is absent, use Chrome data as fallback\n if (!result && environment === \"android\") {\n return plugin.chrome;\n }\n return result;\n}\n","// @flow\n\nexport const TargetNames = {\n esmodules: \"esmodules\",\n node: \"node\",\n browsers: \"browsers\",\n chrome: \"chrome\",\n opera: \"opera\",\n edge: \"edge\",\n firefox: \"firefox\",\n safari: \"safari\",\n ie: \"ie\",\n ios: \"ios\",\n android: \"android\",\n electron: \"electron\",\n samsung: \"samsung\",\n\n // deprecated\n uglify: \"uglify\",\n};\n","import semver from \"semver\";\nimport { unreleasedLabels } from \"./targets\";\n\nexport function prettifyVersion(version: string) {\n if (typeof version !== \"string\") {\n return version;\n }\n\n const parts = [semver.major(version)];\n const minor = semver.minor(version);\n const patch = semver.patch(version);\n\n if (minor || patch) {\n parts.push(minor);\n }\n\n if (patch) {\n parts.push(patch);\n }\n\n return parts.join(\".\");\n}\n\nexport function prettifyTargets(targets: Targets): Targets {\n return Object.keys(targets).reduce((results, target) => {\n let value = targets[target];\n\n const unreleasedLabel = unreleasedLabels[target];\n if (typeof value === \"string\" && unreleasedLabel !== value) {\n value = prettifyVersion(value);\n }\n\n results[target] = value;\n return results;\n }, {});\n}\n","// @flow\n\nimport semver from \"semver\";\nimport { prettifyVersion } from \"./pretty\";\nimport {\n semverify,\n isUnreleasedVersion,\n getLowestImplementedVersion,\n} from \"./utils\";\nimport type { Targets } from \"./types\";\n\nexport function getInclusionReasons(\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) {\n const minVersions = list[item] || {};\n\n return Object.keys(targetVersions).reduce((result, env) => {\n const minVersion = getLowestImplementedVersion(minVersions, env);\n const targetVersion = targetVersions[env];\n\n if (!minVersion) {\n result[env] = prettifyVersion(targetVersion);\n } else {\n const minIsUnreleased = isUnreleasedVersion(minVersion, env);\n const targetIsUnreleased = isUnreleasedVersion(targetVersion, env);\n\n if (\n !targetIsUnreleased &&\n (minIsUnreleased ||\n semver.lt(targetVersion.toString(), semverify(minVersion)))\n ) {\n result[env] = prettifyVersion(targetVersion);\n }\n }\n\n return result;\n }, {});\n}\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/plugins.json\");\n","// @flow\n\nimport semver from \"semver\";\n\nimport pluginsCompatData from \"@babel/compat-data/plugins\";\n\nimport type { Targets } from \"./types\";\nimport {\n getLowestImplementedVersion,\n isUnreleasedVersion,\n semverify,\n} from \"./utils\";\n\nexport function targetsSupported(target: Targets, support: Targets) {\n const targetEnvironments = Object.keys(target);\n\n if (targetEnvironments.length === 0) {\n return false;\n }\n\n const unsupportedEnvironments = targetEnvironments.filter(environment => {\n const lowestImplementedVersion = getLowestImplementedVersion(\n support,\n environment,\n );\n\n // Feature is not implemented in that environment\n if (!lowestImplementedVersion) {\n return true;\n }\n\n const lowestTargetedVersion = target[environment];\n\n // If targets has unreleased value as a lowest version, then don't require a plugin.\n if (isUnreleasedVersion(lowestTargetedVersion, environment)) {\n return false;\n }\n\n // Include plugin if it is supported in the unreleased environment, which wasn't specified in targets\n if (isUnreleasedVersion(lowestImplementedVersion, environment)) {\n return true;\n }\n\n if (!semver.valid(lowestTargetedVersion.toString())) {\n throw new Error(\n `Invalid version passed for target \"${environment}\": \"${lowestTargetedVersion}\". ` +\n \"Versions must be in semver format (major.minor.patch)\",\n );\n }\n\n return semver.gt(\n semverify(lowestImplementedVersion),\n lowestTargetedVersion.toString(),\n );\n });\n\n return unsupportedEnvironments.length === 0;\n}\n\nexport function isRequired(\n name: string,\n targets: Targets,\n {\n compatData = pluginsCompatData,\n includes,\n excludes,\n }: {\n compatData?: { [feature: string]: Targets },\n includes?: Set,\n excludes?: Set,\n } = {},\n) {\n if (excludes && excludes.has(name)) return false;\n if (includes && includes.has(name)) return true;\n return !targetsSupported(targets, compatData[name]);\n}\n\nexport default function filterItems(\n list: { [feature: string]: Targets },\n includes: Set,\n excludes: Set,\n targets: Targets,\n defaultIncludes: Array | null,\n defaultExcludes?: Array | null,\n pluginSyntaxMap?: Map,\n) {\n const result = new Set();\n const options = { compatData: list, includes, excludes };\n\n for (const item in list) {\n if (isRequired(item, targets, options)) {\n result.add(item);\n } else if (pluginSyntaxMap) {\n const shippedProposalsSyntax = pluginSyntaxMap.get(item);\n\n if (shippedProposalsSyntax) {\n result.add(shippedProposalsSyntax);\n }\n }\n }\n\n if (defaultIncludes) {\n defaultIncludes.forEach(item => !excludes.has(item) && result.add(item));\n }\n\n if (defaultExcludes) {\n defaultExcludes.forEach(item => !includes.has(item) && result.delete(item));\n }\n\n return result;\n}\n","// @flow\n\nimport browserslist from \"browserslist\";\nimport findSuggestion from \"levenary\";\nimport invariant from \"invariant\";\nimport browserModulesData from \"@babel/compat-data/native-modules\";\n\nimport {\n semverify,\n semverMin,\n isUnreleasedVersion,\n getLowestUnreleased,\n} from \"./utils\";\nimport { browserNameMap } from \"./targets\";\nimport { TargetNames } from \"./options\";\nimport type { Targets } from \"./types\";\n\nexport type { Targets };\n\nexport { prettifyTargets } from \"./pretty\";\nexport { getInclusionReasons } from \"./debug\";\nexport { default as filterItems, isRequired } from \"./filter-items\";\nexport { unreleasedLabels } from \"./targets\";\n\nconst browserslistDefaults = browserslist.defaults;\n\nconst validBrowserslistTargets = [\n ...Object.keys(browserslist.data),\n ...Object.keys(browserslist.aliases),\n];\n\nfunction objectToBrowserslist(object: Targets): Array {\n return Object.keys(object).reduce((list, targetName) => {\n if (validBrowserslistTargets.indexOf(targetName) >= 0) {\n const targetVersion = object[targetName];\n return list.concat(`${targetName} ${targetVersion}`);\n }\n return list;\n }, []);\n}\n\nfunction validateTargetNames(targets: Targets): void {\n const validTargets = Object.keys(TargetNames);\n for (const target in targets) {\n if (!TargetNames[target]) {\n throw new Error(\n `Invalid Option: '${target}' is not a valid target\n Maybe you meant to use '${findSuggestion(target, validTargets)}'?`,\n );\n }\n }\n}\n\nexport function isBrowsersQueryValid(\n browsers: string | Array | Targets,\n): boolean {\n return typeof browsers === \"string\" || Array.isArray(browsers);\n}\n\nfunction validateBrowsers(browsers) {\n invariant(\n typeof browsers === \"undefined\" || isBrowsersQueryValid(browsers),\n `Invalid Option: '${browsers}' is not a valid browserslist query`,\n );\n\n return browsers;\n}\n\nfunction mergeBrowsers(fromQuery: Targets, fromTarget: Targets) {\n return Object.keys(fromTarget).reduce((queryObj, targKey) => {\n if (targKey !== TargetNames.browsers) {\n queryObj[targKey] = fromTarget[targKey];\n }\n return queryObj;\n }, fromQuery);\n}\n\nfunction getLowestVersions(browsers: Array): Targets {\n return browsers.reduce((all: Object, browser: string): Object => {\n const [browserName, browserVersion] = browser.split(\" \");\n const normalizedBrowserName = browserNameMap[browserName];\n\n if (!normalizedBrowserName) {\n return all;\n }\n\n try {\n // Browser version can return as \"10.0-10.2\"\n const splitVersion = browserVersion.split(\"-\")[0].toLowerCase();\n const isSplitUnreleased = isUnreleasedVersion(splitVersion, browserName);\n\n if (!all[normalizedBrowserName]) {\n all[normalizedBrowserName] = isSplitUnreleased\n ? splitVersion\n : semverify(splitVersion);\n return all;\n }\n\n const version = all[normalizedBrowserName];\n const isUnreleased = isUnreleasedVersion(version, browserName);\n\n if (isUnreleased && isSplitUnreleased) {\n all[normalizedBrowserName] = getLowestUnreleased(\n version,\n splitVersion,\n browserName,\n );\n } else if (isUnreleased) {\n all[normalizedBrowserName] = semverify(splitVersion);\n } else if (!isUnreleased && !isSplitUnreleased) {\n const parsedBrowserVersion = semverify(splitVersion);\n\n all[normalizedBrowserName] = semverMin(version, parsedBrowserVersion);\n }\n } catch (e) {}\n\n return all;\n }, {});\n}\n\nfunction outputDecimalWarning(decimalTargets: Array): void {\n if (!decimalTargets || !decimalTargets.length) {\n return;\n }\n\n console.log(\"Warning, the following targets are using a decimal version:\");\n console.log(\"\");\n decimalTargets.forEach(({ target, value }) =>\n console.log(` ${target}: ${value}`),\n );\n console.log(\"\");\n console.log(\n \"We recommend using a string for minor/patch versions to avoid numbers like 6.10\",\n );\n console.log(\"getting parsed as 6.1, which can lead to unexpected behavior.\");\n console.log(\"\");\n}\n\nfunction semverifyTarget(target, value) {\n try {\n return semverify(value);\n } catch (error) {\n throw new Error(\n `Invalid Option: '${value}' is not a valid value for 'targets.${target}'.`,\n );\n }\n}\n\nconst targetParserMap = {\n __default(target, value) {\n const version = isUnreleasedVersion(value, target)\n ? value.toLowerCase()\n : semverifyTarget(target, value);\n return [target, version];\n },\n\n // Parse `node: true` and `node: \"current\"` to version\n node(target, value) {\n const parsed =\n value === true || value === \"current\"\n ? process.versions.node\n : semverifyTarget(target, value);\n return [target, parsed];\n },\n};\n\ntype ParsedResult = {\n targets: Targets,\n decimalWarnings: Array,\n};\n\nexport default function getTargets(\n targets: Object = {},\n options: Object = {},\n): Targets {\n const targetOpts: Targets = {};\n\n validateTargetNames(targets);\n\n // `esmodules` as a target indicates the specific set of browsers supporting ES Modules.\n // These values OVERRIDE the `browsers` field.\n if (targets.esmodules) {\n const supportsESModules = browserModulesData[\"es6.module\"];\n targets.browsers = Object.keys(supportsESModules)\n .map(browser => `${browser} ${supportsESModules[browser]}`)\n .join(\", \");\n }\n\n // Parse browsers target via browserslist\n const browsersquery = validateBrowsers(targets.browsers);\n\n const hasTargets = Object.keys(targets).length > 0;\n const shouldParseBrowsers = !!targets.browsers;\n const shouldSearchForConfig =\n !options.ignoreBrowserslistConfig && !hasTargets;\n\n if (shouldParseBrowsers || shouldSearchForConfig) {\n // If no targets are passed, we need to overwrite browserslist's defaults\n // so that we enable all transforms (acting like the now deprecated\n // preset-latest).\n //\n // Note, if browserslist resolves the config (ex. package.json), then usage\n // of `defaults` in queries will be different since we don't want to break\n // the behavior of \"no targets is the same as preset-latest\".\n if (!hasTargets) {\n browserslist.defaults = objectToBrowserslist(targets);\n }\n\n const browsers = browserslist(browsersquery, {\n path: options.configPath,\n mobileToDesktop: true,\n });\n\n const queryBrowsers = getLowestVersions(browsers);\n targets = mergeBrowsers(queryBrowsers, targets);\n\n // Reset browserslist defaults\n browserslist.defaults = browserslistDefaults;\n }\n\n // Parse remaining targets\n const parsed = Object.keys(targets)\n .filter(value => value !== TargetNames.esmodules)\n .sort()\n .reduce(\n (results: ParsedResult, target: string): ParsedResult => {\n if (target !== TargetNames.browsers) {\n const value = targets[target];\n\n // Warn when specifying minor/patch as a decimal\n if (typeof value === \"number\" && value % 1 !== 0) {\n results.decimalWarnings.push({ target, value });\n }\n\n // Check if we have a target parser?\n const parser = targetParserMap[target] || targetParserMap.__default;\n const [parsedTarget, parsedValue] = parser(target, value);\n\n if (parsedValue) {\n // Merge (lowest wins)\n results.targets[parsedTarget] = parsedValue;\n }\n }\n\n return results;\n },\n {\n targets: targetOpts,\n decimalWarnings: [],\n },\n );\n\n outputDecimalWarning(parsed.decimalWarnings);\n\n return parsed.targets;\n}\n","// @flow\n\nimport {\n getInclusionReasons,\n type Targets,\n} from \"@babel/helper-compilation-targets\";\n\nconst wordEnds = (size: number) => {\n return size > 1 ? \"s\" : \"\";\n};\n\n// Outputs a message that shows which target(s) caused an item to be included:\n// transform-foo { \"edge\":\"13\", \"firefox\":\"49\", \"ie\":\"10\" }\nexport const logPluginOrPolyfill = (\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) => {\n const filteredList = getInclusionReasons(item, targetVersions, list);\n\n const formattedTargets = JSON.stringify(filteredList)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n\n console.log(` ${item} ${formattedTargets}`);\n};\n\nexport const logEntryPolyfills = (\n polyfillName: string,\n importPolyfillIncluded: boolean,\n polyfills: Set,\n filename: string,\n polyfillTargets: Targets,\n allBuiltInsList: { [key: string]: Targets },\n) => {\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n if (!importPolyfillIncluded) {\n console.log(`\\n[${filename}] Import of ${polyfillName} was not found.`);\n return;\n }\n if (!polyfills.size) {\n console.log(\n `\\n[${filename}] Based on your targets, polyfills were not added.`,\n );\n return;\n }\n\n console.log(\n `\\n[${filename}] Replaced ${polyfillName} entries with the following polyfill${wordEnds(\n polyfills.size,\n )}:`,\n );\n for (const polyfill of polyfills) {\n logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);\n }\n};\n\nexport const logUsagePolyfills = (\n polyfills: Set,\n filename: string,\n polyfillTargets: Targets,\n allBuiltInsList: { [key: string]: Targets },\n) => {\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n if (!polyfills.size) {\n console.log(\n `\\n[${filename}] Based on your code and targets, core-js polyfills were not added.`,\n );\n return;\n }\n console.log(\n `\\n[${filename}] Added following core-js polyfill${wordEnds(\n polyfills.size,\n )}:`,\n );\n for (const polyfill of polyfills) {\n logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);\n }\n};\n","// @flow\n\nconst defaultExcludesForLooseMode = [\"transform-typeof-symbol\"];\n\nexport default function({ loose }: { loose: boolean }): null | string[] {\n return loose ? defaultExcludesForLooseMode : null;\n}\n","// @flow\n\nexport function removeUnnecessaryItems(\n items: Set,\n overlapping: { [name: string]: string[] },\n) {\n items.forEach(item => {\n // $FlowIgnore Flow doesn't support calls in optional chains\n overlapping[item]?.forEach(name => items.delete(name));\n });\n}\n","// @flow\n\nimport typeof AvailablePlugins from \"./available-plugins\";\n\nexport default ({\n auto: \"transform-modules-commonjs\",\n amd: \"transform-modules-amd\",\n commonjs: \"transform-modules-commonjs\",\n cjs: \"transform-modules-commonjs\",\n systemjs: \"transform-modules-systemjs\",\n umd: \"transform-modules-umd\",\n}: { [transform: string]: $Keys });\n","'use strict';\nconst array = [];\nconst charCodeCache = [];\n\nconst leven = (left, right) => {\n\tif (left === right) {\n\t\treturn 0;\n\t}\n\n\tconst swap = left;\n\n\t// Swapping the strings if `a` is longer than `b` so we know which one is the\n\t// shortest & which one is the longest\n\tif (left.length > right.length) {\n\t\tleft = right;\n\t\tright = swap;\n\t}\n\n\tlet leftLength = left.length;\n\tlet rightLength = right.length;\n\n\t// Performing suffix trimming:\n\t// We can linearly drop suffix common to both strings since they\n\t// don't increase distance at all\n\t// Note: `~-` is the bitwise way to perform a `- 1` operation\n\twhile (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {\n\t\tleftLength--;\n\t\trightLength--;\n\t}\n\n\t// Performing prefix trimming\n\t// We can linearly drop prefix common to both strings since they\n\t// don't increase distance at all\n\tlet start = 0;\n\n\twhile (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) {\n\t\tstart++;\n\t}\n\n\tleftLength -= start;\n\trightLength -= start;\n\n\tif (leftLength === 0) {\n\t\treturn rightLength;\n\t}\n\n\tlet bCharCode;\n\tlet result;\n\tlet temp;\n\tlet temp2;\n\tlet i = 0;\n\tlet j = 0;\n\n\twhile (i < leftLength) {\n\t\tcharCodeCache[i] = left.charCodeAt(start + i);\n\t\tarray[i] = ++i;\n\t}\n\n\twhile (j < rightLength) {\n\t\tbCharCode = right.charCodeAt(start + j);\n\t\ttemp = j++;\n\t\tresult = j;\n\n\t\tfor (i = 0; i < leftLength; i++) {\n\t\t\ttemp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;\n\t\t\ttemp = array[i];\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tresult = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;\n\t\t}\n\t}\n\n\treturn result;\n};\n\nmodule.exports = leven;\n// TODO: Remove this for the next major release\nmodule.exports.default = leven;\n","import leven from 'leven';\n\nexport default function levenArray(str, array) {\n let minLeven = Number.POSITIVE_INFINITY;\n let result = undefined;\n for(const item of array) {\n const distance = leven(str, item);\n if (distance < minLeven) {\n minLeven = distance;\n result = item;\n }\n }\n return result;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/corejs2-built-ins.json\");\n","// @flow\n\nexport const TopLevelOptions = {\n configPath: \"configPath\",\n corejs: \"corejs\",\n debug: \"debug\",\n exclude: \"exclude\",\n forceAllTransforms: \"forceAllTransforms\",\n ignoreBrowserslistConfig: \"ignoreBrowserslistConfig\",\n include: \"include\",\n loose: \"loose\",\n modules: \"modules\",\n shippedProposals: \"shippedProposals\",\n spec: \"spec\",\n targets: \"targets\",\n useBuiltIns: \"useBuiltIns\",\n};\n\nexport const ModulesOption = {\n false: false,\n auto: \"auto\",\n amd: \"amd\",\n commonjs: \"commonjs\",\n cjs: \"cjs\",\n systemjs: \"systemjs\",\n umd: \"umd\",\n};\n\nexport const UseBuiltInsOption = {\n false: false,\n entry: \"entry\",\n usage: \"usage\",\n};\n","// @flow\n\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport const defaultWebIncludes = [\n \"web.timers\",\n \"web.immediate\",\n \"web.dom.iterable\",\n];\n\nexport default function(targets: Targets): null | string[] {\n const targetNames = Object.keys(targets);\n const isAnyTarget = !targetNames.length;\n const isWebTarget = targetNames.some(name => name !== \"node\");\n\n return isAnyTarget || isWebTarget ? defaultWebIncludes : null;\n}\n","// @flow\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport findSuggestion from \"levenary\";\nimport invariant from \"invariant\";\nimport { coerce, SemVer } from \"semver\";\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport pluginsList from \"@babel/compat-data/plugins\";\nimport moduleTransformations from \"./module-transformations\";\nimport { TopLevelOptions, ModulesOption, UseBuiltInsOption } from \"./options\";\nimport { defaultWebIncludes } from \"./polyfills/corejs2/get-platform-specific-default\";\n\nimport type {\n BuiltInsOption,\n CorejsOption,\n ModuleOption,\n Options,\n PluginListItem,\n PluginListOption,\n} from \"./types\";\n\nconst validateTopLevelOptions = (options: Options) => {\n const validOptions = Object.keys(TopLevelOptions);\n\n for (const option in options) {\n if (!TopLevelOptions[option]) {\n throw new Error(\n `Invalid Option: ${option} is not a valid top-level option.\n Maybe you meant to use '${findSuggestion(option, validOptions)}'?`,\n );\n }\n }\n};\n\nconst allPluginsList = Object.keys(pluginsList);\n\n// NOTE: Since module plugins are handled seperatly compared to other plugins (via the \"modules\" option) it\n// should only be possible to exclude and not include module plugins, otherwise it's possible that preset-env\n// will add a module plugin twice.\nconst modulePlugins = [\n \"proposal-dynamic-import\",\n ...Object.keys(moduleTransformations).map(m => moduleTransformations[m]),\n];\n\nconst getValidIncludesAndExcludes = (\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) =>\n new Set([\n ...allPluginsList,\n ...(type === \"exclude\" ? modulePlugins : []),\n ...(corejs\n ? corejs == 2\n ? [...Object.keys(corejs2Polyfills), ...defaultWebIncludes]\n : Object.keys(corejs3Polyfills)\n : []),\n ]);\n\nconst pluginToRegExp = (plugin: PluginListItem) => {\n if (plugin instanceof RegExp) return plugin;\n try {\n return new RegExp(`^${normalizePluginName(plugin)}$`);\n } catch (e) {\n return null;\n }\n};\n\nconst selectPlugins = (\n regexp: RegExp | null,\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) =>\n Array.from(getValidIncludesAndExcludes(type, corejs)).filter(\n item => regexp instanceof RegExp && regexp.test(item),\n );\n\nconst flatten = (array: Array>): Array => [].concat(...array);\n\nconst expandIncludesAndExcludes = (\n plugins: PluginListOption = [],\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) => {\n if (plugins.length === 0) return [];\n\n const selectedPlugins = plugins.map(plugin =>\n selectPlugins(pluginToRegExp(plugin), type, corejs),\n );\n const invalidRegExpList = plugins.filter(\n (p, i) => selectedPlugins[i].length === 0,\n );\n\n invariant(\n invalidRegExpList.length === 0,\n `Invalid Option: The plugins/built-ins '${invalidRegExpList.join(\n \", \",\n )}' passed to the '${type}' option are not\n valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env`,\n );\n\n return flatten(selectedPlugins);\n};\n\nexport const normalizePluginName = (plugin: string) =>\n plugin.replace(/^(@babel\\/|babel-)(plugin-)?/, \"\");\n\nexport const checkDuplicateIncludeExcludes = (\n include: Array = [],\n exclude: Array = [],\n) => {\n const duplicates = include.filter(opt => exclude.indexOf(opt) >= 0);\n\n invariant(\n duplicates.length === 0,\n `Invalid Option: The plugins/built-ins '${duplicates.join(\n \", \",\n )}' were found in both the \"include\" and\n \"exclude\" options.`,\n );\n};\n\nconst normalizeTargets = targets => {\n // TODO: Allow to use only query or strings as a targets from next breaking change.\n if (typeof targets === \"string\" || Array.isArray(targets)) {\n return { browsers: targets };\n }\n return {\n ...targets,\n };\n};\n\nexport const validateConfigPathOption = (\n configPath: string = process.cwd(),\n) => {\n invariant(\n typeof configPath === \"string\",\n `Invalid Option: The configPath option '${configPath}' is invalid, only strings are allowed.`,\n );\n return configPath;\n};\n\nexport const validateBoolOption = (\n name: string,\n value?: boolean,\n defaultValue: boolean,\n) => {\n if (typeof value === \"undefined\") {\n value = defaultValue;\n }\n\n if (typeof value !== \"boolean\") {\n throw new Error(`Preset env: '${name}' option must be a boolean.`);\n }\n\n return value;\n};\n\nexport const validateIgnoreBrowserslistConfig = (\n ignoreBrowserslistConfig: boolean,\n) =>\n validateBoolOption(\n TopLevelOptions.ignoreBrowserslistConfig,\n ignoreBrowserslistConfig,\n false,\n );\n\nexport const validateModulesOption = (\n modulesOpt: ModuleOption = ModulesOption.auto,\n) => {\n invariant(\n ModulesOption[modulesOpt.toString()] ||\n ModulesOption[modulesOpt.toString()] === ModulesOption.false,\n `Invalid Option: The 'modules' option must be one of \\n` +\n ` - 'false' to indicate no module processing\\n` +\n ` - a specific module type: 'commonjs', 'amd', 'umd', 'systemjs'` +\n ` - 'auto' (default) which will automatically select 'false' if the current\\n` +\n ` process is known to support ES module syntax, or \"commonjs\" otherwise\\n`,\n );\n\n return modulesOpt;\n};\n\nexport const validateUseBuiltInsOption = (\n builtInsOpt: BuiltInsOption = false,\n) => {\n invariant(\n UseBuiltInsOption[builtInsOpt.toString()] ||\n UseBuiltInsOption[builtInsOpt.toString()] === UseBuiltInsOption.false,\n `Invalid Option: The 'useBuiltIns' option must be either\n 'false' (default) to indicate no polyfill,\n '\"entry\"' to indicate replacing the entry polyfill, or\n '\"usage\"' to import only used polyfills per file`,\n );\n\n return builtInsOpt;\n};\n\nexport type NormalizedCorejsOption = {\n proposals: boolean,\n version: typeof SemVer | null | false,\n};\n\nexport function normalizeCoreJSOption(\n corejs?: CorejsOption,\n useBuiltIns: BuiltInsOption,\n): NormalizedCorejsOption {\n let proposals = false;\n let rawVersion;\n\n if (useBuiltIns && corejs === undefined) {\n rawVersion = 2;\n console.warn(\n \"\\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a \" +\n \"core-js version. Currently, we assume version 2.x when no version \" +\n \"is passed. Since this default version will likely change in future \" +\n \"versions of Babel, we recommend explicitly setting the core-js version \" +\n \"you are using via the `corejs` option.\\n\" +\n \"\\nYou should also be sure that the version you pass to the `corejs` \" +\n \"option matches the version specified in your `package.json`'s \" +\n \"`dependencies` section. If it doesn't, you need to run one of the \" +\n \"following commands:\\n\\n\" +\n \" npm install --save core-js@2 npm install --save core-js@3\\n\" +\n \" yarn add core-js@2 yarn add core-js@3\\n\",\n );\n } else if (typeof corejs === \"object\" && corejs !== null) {\n rawVersion = corejs.version;\n proposals = Boolean(corejs.proposals);\n } else {\n rawVersion = corejs;\n }\n\n const version = rawVersion ? coerce(String(rawVersion)) : false;\n\n if (!useBuiltIns && version) {\n console.log(\n \"\\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\\n\",\n );\n }\n\n if (useBuiltIns && (!version || version.major < 2 || version.major > 3)) {\n throw new RangeError(\n \"Invalid Option: The version passed to `corejs` is invalid. Currently, \" +\n \"only core-js@2 and core-js@3 are supported.\",\n );\n }\n\n return { version, proposals };\n}\n\nexport default function normalizeOptions(opts: Options) {\n validateTopLevelOptions(opts);\n\n const useBuiltIns = validateUseBuiltInsOption(opts.useBuiltIns);\n\n const corejs = normalizeCoreJSOption(opts.corejs, useBuiltIns);\n\n const include = expandIncludesAndExcludes(\n opts.include,\n TopLevelOptions.include,\n !!corejs.version && corejs.version.major,\n );\n\n const exclude = expandIncludesAndExcludes(\n opts.exclude,\n TopLevelOptions.exclude,\n !!corejs.version && corejs.version.major,\n );\n\n checkDuplicateIncludeExcludes(include, exclude);\n\n const shippedProposals =\n validateBoolOption(\n TopLevelOptions.shippedProposals,\n opts.shippedProposals,\n false,\n ) || corejs.proposals;\n\n return {\n configPath: validateConfigPathOption(opts.configPath),\n corejs,\n debug: validateBoolOption(TopLevelOptions.debug, opts.debug, false),\n include,\n exclude,\n forceAllTransforms: validateBoolOption(\n TopLevelOptions.forceAllTransforms,\n opts.forceAllTransforms,\n false,\n ),\n ignoreBrowserslistConfig: validateIgnoreBrowserslistConfig(\n opts.ignoreBrowserslistConfig,\n ),\n loose: validateBoolOption(TopLevelOptions.loose, opts.loose, false),\n modules: validateModulesOption(opts.modules),\n shippedProposals,\n spec: validateBoolOption(TopLevelOptions.spec, opts.spec, false),\n targets: normalizeTargets(opts.targets),\n useBuiltIns: useBuiltIns,\n };\n}\n","/* eslint sort-keys: \"error\" */\n// These mappings represent the syntax proposals that have been\n// shipped by browsers, and are enabled by the `shippedProposals` option.\n\nconst proposalPlugins = {};\n\n// use intermediary object to enforce alphabetical key order\nconst pluginSyntaxObject = {\n \"proposal-async-generator-functions\": \"syntax-async-generators\",\n \"proposal-json-strings\": \"syntax-json-strings\",\n \"proposal-nullish-coalescing-operator\": \"syntax-nullish-coalescing-operator\",\n \"proposal-object-rest-spread\": \"syntax-object-rest-spread\",\n \"proposal-optional-catch-binding\": \"syntax-optional-catch-binding\",\n \"proposal-optional-chaining\": \"syntax-optional-chaining\",\n \"proposal-unicode-property-regex\": null,\n};\n\nconst pluginSyntaxEntries = Object.keys(pluginSyntaxObject).map(function (key) {\n return [key, pluginSyntaxObject[key]];\n});\n\nconst pluginSyntaxMap = new Map(pluginSyntaxEntries);\n\nmodule.exports = { pluginSyntaxMap, proposalPlugins };\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/overlapping-plugins.json\");\n","// @flow\n\ntype ObjectMap = { [name: string]: V };\n\nconst ArrayNatureIterators = [\n \"es6.object.to-string\",\n \"es6.array.iterator\",\n \"web.dom.iterable\",\n];\n\nconst CommonIterators = [\"es6.string.iterator\", ...ArrayNatureIterators];\n\nconst PromiseDependencies = [\"es6.object.to-string\", \"es6.promise\"];\n\nexport const BuiltIns: ObjectMap = {\n DataView: \"es6.typed.data-view\",\n Float32Array: \"es6.typed.float32-array\",\n Float64Array: \"es6.typed.float64-array\",\n Int8Array: \"es6.typed.int8-array\",\n Int16Array: \"es6.typed.int16-array\",\n Int32Array: \"es6.typed.int32-array\",\n Map: [\"es6.map\", ...CommonIterators],\n Number: \"es6.number.constructor\",\n Promise: PromiseDependencies,\n RegExp: [\"es6.regexp.constructor\"],\n Set: [\"es6.set\", ...CommonIterators],\n Symbol: [\"es6.symbol\", \"es7.symbol.async-iterator\"],\n Uint8Array: \"es6.typed.uint8-array\",\n Uint8ClampedArray: \"es6.typed.uint8-clamped-array\",\n Uint16Array: \"es6.typed.uint16-array\",\n Uint32Array: \"es6.typed.uint32-array\",\n WeakMap: [\"es6.weak-map\", ...CommonIterators],\n WeakSet: [\"es6.weak-set\", ...CommonIterators],\n};\n\nexport const InstanceProperties: ObjectMap = {\n __defineGetter__: [\"es7.object.define-getter\"],\n __defineSetter__: [\"es7.object.define-setter\"],\n __lookupGetter__: [\"es7.object.lookup-getter\"],\n __lookupSetter__: [\"es7.object.lookup-setter\"],\n anchor: [\"es6.string.anchor\"],\n big: [\"es6.string.big\"],\n bind: [\"es6.function.bind\"],\n blink: [\"es6.string.blink\"],\n bold: [\"es6.string.bold\"],\n codePointAt: [\"es6.string.code-point-at\"],\n copyWithin: [\"es6.array.copy-within\"],\n endsWith: [\"es6.string.ends-with\"],\n entries: ArrayNatureIterators,\n every: [\"es6.array.is-array\"],\n fill: [\"es6.array.fill\"],\n filter: [\"es6.array.filter\"],\n finally: [\"es7.promise.finally\", ...PromiseDependencies],\n find: [\"es6.array.find\"],\n findIndex: [\"es6.array.find-index\"],\n fixed: [\"es6.string.fixed\"],\n flags: [\"es6.regexp.flags\"],\n flatMap: [\"es7.array.flat-map\"],\n fontcolor: [\"es6.string.fontcolor\"],\n fontsize: [\"es6.string.fontsize\"],\n forEach: [\"es6.array.for-each\"],\n includes: [\"es6.string.includes\", \"es7.array.includes\"],\n indexOf: [\"es6.array.index-of\"],\n italics: [\"es6.string.italics\"],\n keys: ArrayNatureIterators,\n lastIndexOf: [\"es6.array.last-index-of\"],\n link: [\"es6.string.link\"],\n map: [\"es6.array.map\"],\n match: [\"es6.regexp.match\"],\n name: [\"es6.function.name\"],\n padStart: [\"es7.string.pad-start\"],\n padEnd: [\"es7.string.pad-end\"],\n reduce: [\"es6.array.reduce\"],\n reduceRight: [\"es6.array.reduce-right\"],\n repeat: [\"es6.string.repeat\"],\n replace: [\"es6.regexp.replace\"],\n search: [\"es6.regexp.search\"],\n slice: [\"es6.array.slice\"],\n small: [\"es6.string.small\"],\n some: [\"es6.array.some\"],\n sort: [\"es6.array.sort\"],\n split: [\"es6.regexp.split\"],\n startsWith: [\"es6.string.starts-with\"],\n strike: [\"es6.string.strike\"],\n sub: [\"es6.string.sub\"],\n sup: [\"es6.string.sup\"],\n toISOString: [\"es6.date.to-iso-string\"],\n toJSON: [\"es6.date.to-json\"],\n toString: [\n \"es6.object.to-string\",\n \"es6.date.to-string\",\n \"es6.regexp.to-string\",\n ],\n trim: [\"es6.string.trim\"],\n trimEnd: [\"es7.string.trim-right\"],\n trimLeft: [\"es7.string.trim-left\"],\n trimRight: [\"es7.string.trim-right\"],\n trimStart: [\"es7.string.trim-left\"],\n values: ArrayNatureIterators,\n};\n\nexport const StaticProperties: ObjectMap> = {\n Array: {\n from: [\"es6.array.from\", \"es6.string.iterator\"],\n isArray: \"es6.array.is-array\",\n of: \"es6.array.of\",\n },\n\n Date: {\n now: \"es6.date.now\",\n },\n\n Object: {\n assign: \"es6.object.assign\",\n create: \"es6.object.create\",\n defineProperty: \"es6.object.define-property\",\n defineProperties: \"es6.object.define-properties\",\n entries: \"es7.object.entries\",\n freeze: \"es6.object.freeze\",\n getOwnPropertyDescriptors: \"es7.object.get-own-property-descriptors\",\n getOwnPropertySymbols: \"es6.symbol\",\n is: \"es6.object.is\",\n isExtensible: \"es6.object.is-extensible\",\n isFrozen: \"es6.object.is-frozen\",\n isSealed: \"es6.object.is-sealed\",\n keys: \"es6.object.keys\",\n preventExtensions: \"es6.object.prevent-extensions\",\n seal: \"es6.object.seal\",\n setPrototypeOf: \"es6.object.set-prototype-of\",\n values: \"es7.object.values\",\n },\n\n Math: {\n acosh: \"es6.math.acosh\",\n asinh: \"es6.math.asinh\",\n atanh: \"es6.math.atanh\",\n cbrt: \"es6.math.cbrt\",\n clz32: \"es6.math.clz32\",\n cosh: \"es6.math.cosh\",\n expm1: \"es6.math.expm1\",\n fround: \"es6.math.fround\",\n hypot: \"es6.math.hypot\",\n imul: \"es6.math.imul\",\n log1p: \"es6.math.log1p\",\n log10: \"es6.math.log10\",\n log2: \"es6.math.log2\",\n sign: \"es6.math.sign\",\n sinh: \"es6.math.sinh\",\n tanh: \"es6.math.tanh\",\n trunc: \"es6.math.trunc\",\n },\n\n String: {\n fromCodePoint: \"es6.string.from-code-point\",\n raw: \"es6.string.raw\",\n },\n\n Number: {\n EPSILON: \"es6.number.epsilon\",\n MIN_SAFE_INTEGER: \"es6.number.min-safe-integer\",\n MAX_SAFE_INTEGER: \"es6.number.max-safe-integer\",\n isFinite: \"es6.number.is-finite\",\n isInteger: \"es6.number.is-integer\",\n isSafeInteger: \"es6.number.is-safe-integer\",\n isNaN: \"es6.number.is-nan\",\n parseFloat: \"es6.number.parse-float\",\n parseInt: \"es6.number.parse-int\",\n },\n\n Promise: {\n all: CommonIterators,\n race: CommonIterators,\n },\n\n Reflect: {\n apply: \"es6.reflect.apply\",\n construct: \"es6.reflect.construct\",\n defineProperty: \"es6.reflect.define-property\",\n deleteProperty: \"es6.reflect.delete-property\",\n get: \"es6.reflect.get\",\n getOwnPropertyDescriptor: \"es6.reflect.get-own-property-descriptor\",\n getPrototypeOf: \"es6.reflect.get-prototype-of\",\n has: \"es6.reflect.has\",\n isExtensible: \"es6.reflect.is-extensible\",\n ownKeys: \"es6.reflect.own-keys\",\n preventExtensions: \"es6.reflect.prevent-extensions\",\n set: \"es6.reflect.set\",\n setPrototypeOf: \"es6.reflect.set-prototype-of\",\n },\n};\n","// @flow\nexport default function shallowEqual(\n actual: Object,\n expected: Object,\n): boolean {\n const keys = Object.keys(expected);\n\n for (const key of (keys: Array)) {\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport shallowEqual from \"../../utils/shallowEqual\";\n\nexport function isArrayExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArrayExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isAssignmentExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"AssignmentExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBinaryExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BinaryExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInterpreterDirective(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InterpreterDirective\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDirective(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Directive\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDirectiveLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DirectiveLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBlockStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BlockStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBreakStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BreakStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isCallExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"CallExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isCatchClause(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"CatchClause\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isConditionalExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ConditionalExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isContinueStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ContinueStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDebuggerStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DebuggerStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDoWhileStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DoWhileStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEmptyStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EmptyStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExpressionStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExpressionStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFile(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"File\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isForInStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ForInStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isForStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ForStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"FunctionDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"FunctionExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isIdentifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Identifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isIfStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"IfStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLabeledStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"LabeledStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isStringLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"StringLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNumericLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NumericLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNullLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NullLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBooleanLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BooleanLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isRegExpLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"RegExpLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLogicalExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"LogicalExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isMemberExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"MemberExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNewExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NewExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isProgram(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Program\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isRestElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"RestElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isReturnStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ReturnStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSequenceExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SequenceExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isParenthesizedExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ParenthesizedExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSwitchCase(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SwitchCase\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSwitchStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SwitchStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isThisExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ThisExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isThrowStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ThrowStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTryStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TryStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUnaryExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"UnaryExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUpdateExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"UpdateExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isVariableDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"VariableDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isVariableDeclarator(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"VariableDeclarator\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isWhileStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"WhileStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isWithStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"WithStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isAssignmentPattern(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"AssignmentPattern\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isArrayPattern(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArrayPattern\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isArrowFunctionExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArrowFunctionExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportAllDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportAllDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportDefaultDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportDefaultDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportNamedDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportNamedDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportSpecifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isForOfStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ForOfStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImportDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ImportDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImportDefaultSpecifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ImportDefaultSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImportNamespaceSpecifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ImportNamespaceSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImportSpecifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ImportSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isMetaProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"MetaProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectPattern(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectPattern\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSpreadElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SpreadElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSuper(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Super\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTaggedTemplateExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TaggedTemplateExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTemplateElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TemplateElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTemplateLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TemplateLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isYieldExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"YieldExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isAnyTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"AnyTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isArrayTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArrayTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBooleanTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BooleanTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBooleanLiteralTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BooleanLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNullLiteralTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NullLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassImplements(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassImplements\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareClass(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareClass\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareFunction(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareFunction\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareInterface(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareInterface\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareModule(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareModule\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareModuleExports(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareModuleExports\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareTypeAlias(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareTypeAlias\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareOpaqueType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareOpaqueType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareVariable(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareVariable\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareExportDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareExportDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareExportAllDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareExportAllDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclaredPredicate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclaredPredicate\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExistsTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExistsTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"FunctionTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionTypeParam(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"FunctionTypeParam\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isGenericTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"GenericTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInferredPredicate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InferredPredicate\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInterfaceExtends(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InterfaceExtends\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInterfaceDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InterfaceDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInterfaceTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InterfaceTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isIntersectionTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"IntersectionTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isMixedTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"MixedTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEmptyTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EmptyTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNullableTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NullableTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNumberLiteralTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NumberLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNumberTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NumberTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeInternalSlot(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeInternalSlot\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeCallProperty(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeCallProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeIndexer(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeIndexer\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeSpreadProperty(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeSpreadProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isOpaqueType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"OpaqueType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isQualifiedTypeIdentifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"QualifiedTypeIdentifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isStringLiteralTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"StringLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isStringTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"StringTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isThisTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ThisTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTupleTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TupleTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeofTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeofTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeAlias(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeAlias\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeCastExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeCastExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeParameter(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeParameter\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeParameterDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeParameterDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeParameterInstantiation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeParameterInstantiation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUnionTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"UnionTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isVariance(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Variance\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isVoidTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"VoidTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumBooleanBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumBooleanBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumNumberBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumNumberBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumStringBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumStringBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumSymbolBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumSymbolBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumBooleanMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumBooleanMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumNumberMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumNumberMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumStringMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumStringMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumDefaultedMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumDefaultedMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXAttribute(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXAttribute\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXClosingElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXClosingElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXEmptyExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXEmptyExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXExpressionContainer(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXExpressionContainer\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXSpreadChild(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXSpreadChild\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXIdentifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXIdentifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXMemberExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXMemberExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXNamespacedName(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXNamespacedName\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXOpeningElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXOpeningElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXSpreadAttribute(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXSpreadAttribute\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXText(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXText\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXFragment(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXFragment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXOpeningFragment(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXOpeningFragment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXClosingFragment(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXClosingFragment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNoop(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Noop\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPlaceholder(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Placeholder\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isV8IntrinsicIdentifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"V8IntrinsicIdentifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isArgumentPlaceholder(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArgumentPlaceholder\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isAwaitExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"AwaitExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBindExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BindExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isOptionalMemberExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"OptionalMemberExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPipelineTopicExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"PipelineTopicExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPipelineBareFunction(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"PipelineBareFunction\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPipelinePrimaryTopicReference(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"PipelinePrimaryTopicReference\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isOptionalCallExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"OptionalCallExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassPrivateProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassPrivateProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassPrivateMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassPrivateMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImport(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Import\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDecorator(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Decorator\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDoExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DoExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportDefaultSpecifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportDefaultSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportNamespaceSpecifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportNamespaceSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPrivateName(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"PrivateName\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBigIntLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BigIntLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSParameterProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSParameterProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSDeclareFunction(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSDeclareFunction\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSDeclareMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSDeclareMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSQualifiedName(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSQualifiedName\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSCallSignatureDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSCallSignatureDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSConstructSignatureDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSConstructSignatureDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSPropertySignature(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSPropertySignature\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSMethodSignature(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSMethodSignature\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSIndexSignature(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSIndexSignature\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSAnyKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSAnyKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSBooleanKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSBooleanKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSBigIntKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSBigIntKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNeverKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNeverKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNullKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNullKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNumberKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNumberKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSObjectKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSObjectKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSStringKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSStringKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSSymbolKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSSymbolKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSUndefinedKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSUndefinedKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSUnknownKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSUnknownKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSVoidKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSVoidKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSThisType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSThisType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSFunctionType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSFunctionType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSConstructorType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSConstructorType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeReference(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeReference\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypePredicate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypePredicate\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeQuery(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeQuery\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSArrayType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSArrayType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTupleType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTupleType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSOptionalType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSOptionalType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSRestType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSRestType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSUnionType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSUnionType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSIntersectionType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSIntersectionType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSConditionalType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSConditionalType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSInferType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSInferType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSParenthesizedType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSParenthesizedType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeOperator(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeOperator\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSIndexedAccessType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSIndexedAccessType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSMappedType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSMappedType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSLiteralType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSLiteralType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSExpressionWithTypeArguments(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSExpressionWithTypeArguments\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSInterfaceDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSInterfaceDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSInterfaceBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSInterfaceBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeAliasDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeAliasDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSAsExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSAsExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeAssertion(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeAssertion\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSEnumDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSEnumDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSEnumMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSEnumMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSModuleDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSModuleDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSModuleBlock(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSModuleBlock\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSImportType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSImportType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSImportEqualsDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSImportEqualsDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSExternalModuleReference(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSExternalModuleReference\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNonNullExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNonNullExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSExportAssignment(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSExportAssignment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNamespaceExportDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNamespaceExportDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeParameterInstantiation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeParameterInstantiation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeParameterDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeParameterDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeParameter(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeParameter\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Expression\" ||\n \"ArrayExpression\" === nodeType ||\n \"AssignmentExpression\" === nodeType ||\n \"BinaryExpression\" === nodeType ||\n \"CallExpression\" === nodeType ||\n \"ConditionalExpression\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"Identifier\" === nodeType ||\n \"StringLiteral\" === nodeType ||\n \"NumericLiteral\" === nodeType ||\n \"NullLiteral\" === nodeType ||\n \"BooleanLiteral\" === nodeType ||\n \"RegExpLiteral\" === nodeType ||\n \"LogicalExpression\" === nodeType ||\n \"MemberExpression\" === nodeType ||\n \"NewExpression\" === nodeType ||\n \"ObjectExpression\" === nodeType ||\n \"SequenceExpression\" === nodeType ||\n \"ParenthesizedExpression\" === nodeType ||\n \"ThisExpression\" === nodeType ||\n \"UnaryExpression\" === nodeType ||\n \"UpdateExpression\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassExpression\" === nodeType ||\n \"MetaProperty\" === nodeType ||\n \"Super\" === nodeType ||\n \"TaggedTemplateExpression\" === nodeType ||\n \"TemplateLiteral\" === nodeType ||\n \"YieldExpression\" === nodeType ||\n \"TypeCastExpression\" === nodeType ||\n \"JSXElement\" === nodeType ||\n \"JSXFragment\" === nodeType ||\n \"AwaitExpression\" === nodeType ||\n \"BindExpression\" === nodeType ||\n \"OptionalMemberExpression\" === nodeType ||\n \"PipelinePrimaryTopicReference\" === nodeType ||\n \"OptionalCallExpression\" === nodeType ||\n \"Import\" === nodeType ||\n \"DoExpression\" === nodeType ||\n \"BigIntLiteral\" === nodeType ||\n \"TSAsExpression\" === nodeType ||\n \"TSTypeAssertion\" === nodeType ||\n \"TSNonNullExpression\" === nodeType ||\n (nodeType === \"Placeholder\" &&\n (\"Expression\" === node.expectedNode ||\n \"Identifier\" === node.expectedNode ||\n \"StringLiteral\" === node.expectedNode))\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBinary(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Binary\" ||\n \"BinaryExpression\" === nodeType ||\n \"LogicalExpression\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isScopable(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Scopable\" ||\n \"BlockStatement\" === nodeType ||\n \"CatchClause\" === nodeType ||\n \"DoWhileStatement\" === nodeType ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"Program\" === nodeType ||\n \"ObjectMethod\" === nodeType ||\n \"SwitchStatement\" === nodeType ||\n \"WhileStatement\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassExpression\" === nodeType ||\n \"ClassDeclaration\" === nodeType ||\n \"ForOfStatement\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType ||\n \"TSModuleBlock\" === nodeType ||\n (nodeType === \"Placeholder\" && \"BlockStatement\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBlockParent(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"BlockParent\" ||\n \"BlockStatement\" === nodeType ||\n \"CatchClause\" === nodeType ||\n \"DoWhileStatement\" === nodeType ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"Program\" === nodeType ||\n \"ObjectMethod\" === nodeType ||\n \"SwitchStatement\" === nodeType ||\n \"WhileStatement\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ForOfStatement\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType ||\n \"TSModuleBlock\" === nodeType ||\n (nodeType === \"Placeholder\" && \"BlockStatement\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBlock(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Block\" ||\n \"BlockStatement\" === nodeType ||\n \"Program\" === nodeType ||\n \"TSModuleBlock\" === nodeType ||\n (nodeType === \"Placeholder\" && \"BlockStatement\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Statement\" ||\n \"BlockStatement\" === nodeType ||\n \"BreakStatement\" === nodeType ||\n \"ContinueStatement\" === nodeType ||\n \"DebuggerStatement\" === nodeType ||\n \"DoWhileStatement\" === nodeType ||\n \"EmptyStatement\" === nodeType ||\n \"ExpressionStatement\" === nodeType ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"FunctionDeclaration\" === nodeType ||\n \"IfStatement\" === nodeType ||\n \"LabeledStatement\" === nodeType ||\n \"ReturnStatement\" === nodeType ||\n \"SwitchStatement\" === nodeType ||\n \"ThrowStatement\" === nodeType ||\n \"TryStatement\" === nodeType ||\n \"VariableDeclaration\" === nodeType ||\n \"WhileStatement\" === nodeType ||\n \"WithStatement\" === nodeType ||\n \"ClassDeclaration\" === nodeType ||\n \"ExportAllDeclaration\" === nodeType ||\n \"ExportDefaultDeclaration\" === nodeType ||\n \"ExportNamedDeclaration\" === nodeType ||\n \"ForOfStatement\" === nodeType ||\n \"ImportDeclaration\" === nodeType ||\n \"DeclareClass\" === nodeType ||\n \"DeclareFunction\" === nodeType ||\n \"DeclareInterface\" === nodeType ||\n \"DeclareModule\" === nodeType ||\n \"DeclareModuleExports\" === nodeType ||\n \"DeclareTypeAlias\" === nodeType ||\n \"DeclareOpaqueType\" === nodeType ||\n \"DeclareVariable\" === nodeType ||\n \"DeclareExportDeclaration\" === nodeType ||\n \"DeclareExportAllDeclaration\" === nodeType ||\n \"InterfaceDeclaration\" === nodeType ||\n \"OpaqueType\" === nodeType ||\n \"TypeAlias\" === nodeType ||\n \"TSDeclareFunction\" === nodeType ||\n \"TSInterfaceDeclaration\" === nodeType ||\n \"TSTypeAliasDeclaration\" === nodeType ||\n \"TSEnumDeclaration\" === nodeType ||\n \"TSModuleDeclaration\" === nodeType ||\n \"TSImportEqualsDeclaration\" === nodeType ||\n \"TSExportAssignment\" === nodeType ||\n \"TSNamespaceExportDeclaration\" === nodeType ||\n (nodeType === \"Placeholder\" &&\n (\"Statement\" === node.expectedNode ||\n \"Declaration\" === node.expectedNode ||\n \"BlockStatement\" === node.expectedNode))\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTerminatorless(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Terminatorless\" ||\n \"BreakStatement\" === nodeType ||\n \"ContinueStatement\" === nodeType ||\n \"ReturnStatement\" === nodeType ||\n \"ThrowStatement\" === nodeType ||\n \"YieldExpression\" === nodeType ||\n \"AwaitExpression\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isCompletionStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"CompletionStatement\" ||\n \"BreakStatement\" === nodeType ||\n \"ContinueStatement\" === nodeType ||\n \"ReturnStatement\" === nodeType ||\n \"ThrowStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isConditional(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Conditional\" ||\n \"ConditionalExpression\" === nodeType ||\n \"IfStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLoop(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Loop\" ||\n \"DoWhileStatement\" === nodeType ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"WhileStatement\" === nodeType ||\n \"ForOfStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isWhile(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"While\" ||\n \"DoWhileStatement\" === nodeType ||\n \"WhileStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExpressionWrapper(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ExpressionWrapper\" ||\n \"ExpressionStatement\" === nodeType ||\n \"ParenthesizedExpression\" === nodeType ||\n \"TypeCastExpression\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFor(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"For\" ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"ForOfStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isForXStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ForXStatement\" ||\n \"ForInStatement\" === nodeType ||\n \"ForOfStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunction(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Function\" ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"ObjectMethod\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionParent(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FunctionParent\" ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"ObjectMethod\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPureish(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Pureish\" ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"StringLiteral\" === nodeType ||\n \"NumericLiteral\" === nodeType ||\n \"NullLiteral\" === nodeType ||\n \"BooleanLiteral\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassExpression\" === nodeType ||\n \"ClassDeclaration\" === nodeType ||\n \"BigIntLiteral\" === nodeType ||\n (nodeType === \"Placeholder\" && \"StringLiteral\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Declaration\" ||\n \"FunctionDeclaration\" === nodeType ||\n \"VariableDeclaration\" === nodeType ||\n \"ClassDeclaration\" === nodeType ||\n \"ExportAllDeclaration\" === nodeType ||\n \"ExportDefaultDeclaration\" === nodeType ||\n \"ExportNamedDeclaration\" === nodeType ||\n \"ImportDeclaration\" === nodeType ||\n \"DeclareClass\" === nodeType ||\n \"DeclareFunction\" === nodeType ||\n \"DeclareInterface\" === nodeType ||\n \"DeclareModule\" === nodeType ||\n \"DeclareModuleExports\" === nodeType ||\n \"DeclareTypeAlias\" === nodeType ||\n \"DeclareOpaqueType\" === nodeType ||\n \"DeclareVariable\" === nodeType ||\n \"DeclareExportDeclaration\" === nodeType ||\n \"DeclareExportAllDeclaration\" === nodeType ||\n \"InterfaceDeclaration\" === nodeType ||\n \"OpaqueType\" === nodeType ||\n \"TypeAlias\" === nodeType ||\n \"EnumDeclaration\" === nodeType ||\n \"TSDeclareFunction\" === nodeType ||\n \"TSInterfaceDeclaration\" === nodeType ||\n \"TSTypeAliasDeclaration\" === nodeType ||\n \"TSEnumDeclaration\" === nodeType ||\n \"TSModuleDeclaration\" === nodeType ||\n (nodeType === \"Placeholder\" && \"Declaration\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPatternLike(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"PatternLike\" ||\n \"Identifier\" === nodeType ||\n \"RestElement\" === nodeType ||\n \"AssignmentPattern\" === nodeType ||\n \"ArrayPattern\" === nodeType ||\n \"ObjectPattern\" === nodeType ||\n (nodeType === \"Placeholder\" &&\n (\"Pattern\" === node.expectedNode || \"Identifier\" === node.expectedNode))\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLVal(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"LVal\" ||\n \"Identifier\" === nodeType ||\n \"MemberExpression\" === nodeType ||\n \"RestElement\" === nodeType ||\n \"AssignmentPattern\" === nodeType ||\n \"ArrayPattern\" === nodeType ||\n \"ObjectPattern\" === nodeType ||\n \"TSParameterProperty\" === nodeType ||\n (nodeType === \"Placeholder\" &&\n (\"Pattern\" === node.expectedNode || \"Identifier\" === node.expectedNode))\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSEntityName(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"TSEntityName\" ||\n \"Identifier\" === nodeType ||\n \"TSQualifiedName\" === nodeType ||\n (nodeType === \"Placeholder\" && \"Identifier\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Literal\" ||\n \"StringLiteral\" === nodeType ||\n \"NumericLiteral\" === nodeType ||\n \"NullLiteral\" === nodeType ||\n \"BooleanLiteral\" === nodeType ||\n \"RegExpLiteral\" === nodeType ||\n \"TemplateLiteral\" === nodeType ||\n \"BigIntLiteral\" === nodeType ||\n (nodeType === \"Placeholder\" && \"StringLiteral\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImmutable(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Immutable\" ||\n \"StringLiteral\" === nodeType ||\n \"NumericLiteral\" === nodeType ||\n \"NullLiteral\" === nodeType ||\n \"BooleanLiteral\" === nodeType ||\n \"JSXAttribute\" === nodeType ||\n \"JSXClosingElement\" === nodeType ||\n \"JSXElement\" === nodeType ||\n \"JSXExpressionContainer\" === nodeType ||\n \"JSXSpreadChild\" === nodeType ||\n \"JSXOpeningElement\" === nodeType ||\n \"JSXText\" === nodeType ||\n \"JSXFragment\" === nodeType ||\n \"JSXOpeningFragment\" === nodeType ||\n \"JSXClosingFragment\" === nodeType ||\n \"BigIntLiteral\" === nodeType ||\n (nodeType === \"Placeholder\" && \"StringLiteral\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUserWhitespacable(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"UserWhitespacable\" ||\n \"ObjectMethod\" === nodeType ||\n \"ObjectProperty\" === nodeType ||\n \"ObjectTypeInternalSlot\" === nodeType ||\n \"ObjectTypeCallProperty\" === nodeType ||\n \"ObjectTypeIndexer\" === nodeType ||\n \"ObjectTypeProperty\" === nodeType ||\n \"ObjectTypeSpreadProperty\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Method\" ||\n \"ObjectMethod\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ObjectMember\" ||\n \"ObjectMethod\" === nodeType ||\n \"ObjectProperty\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Property\" ||\n \"ObjectProperty\" === nodeType ||\n \"ClassProperty\" === nodeType ||\n \"ClassPrivateProperty\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUnaryLike(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"UnaryLike\" ||\n \"UnaryExpression\" === nodeType ||\n \"SpreadElement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPattern(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Pattern\" ||\n \"AssignmentPattern\" === nodeType ||\n \"ArrayPattern\" === nodeType ||\n \"ObjectPattern\" === nodeType ||\n (nodeType === \"Placeholder\" && \"Pattern\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClass(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Class\" ||\n \"ClassExpression\" === nodeType ||\n \"ClassDeclaration\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isModuleDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ModuleDeclaration\" ||\n \"ExportAllDeclaration\" === nodeType ||\n \"ExportDefaultDeclaration\" === nodeType ||\n \"ExportNamedDeclaration\" === nodeType ||\n \"ImportDeclaration\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ExportDeclaration\" ||\n \"ExportAllDeclaration\" === nodeType ||\n \"ExportDefaultDeclaration\" === nodeType ||\n \"ExportNamedDeclaration\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isModuleSpecifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ModuleSpecifier\" ||\n \"ExportSpecifier\" === nodeType ||\n \"ImportDefaultSpecifier\" === nodeType ||\n \"ImportNamespaceSpecifier\" === nodeType ||\n \"ImportSpecifier\" === nodeType ||\n \"ExportDefaultSpecifier\" === nodeType ||\n \"ExportNamespaceSpecifier\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlow(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Flow\" ||\n \"AnyTypeAnnotation\" === nodeType ||\n \"ArrayTypeAnnotation\" === nodeType ||\n \"BooleanTypeAnnotation\" === nodeType ||\n \"BooleanLiteralTypeAnnotation\" === nodeType ||\n \"NullLiteralTypeAnnotation\" === nodeType ||\n \"ClassImplements\" === nodeType ||\n \"DeclareClass\" === nodeType ||\n \"DeclareFunction\" === nodeType ||\n \"DeclareInterface\" === nodeType ||\n \"DeclareModule\" === nodeType ||\n \"DeclareModuleExports\" === nodeType ||\n \"DeclareTypeAlias\" === nodeType ||\n \"DeclareOpaqueType\" === nodeType ||\n \"DeclareVariable\" === nodeType ||\n \"DeclareExportDeclaration\" === nodeType ||\n \"DeclareExportAllDeclaration\" === nodeType ||\n \"DeclaredPredicate\" === nodeType ||\n \"ExistsTypeAnnotation\" === nodeType ||\n \"FunctionTypeAnnotation\" === nodeType ||\n \"FunctionTypeParam\" === nodeType ||\n \"GenericTypeAnnotation\" === nodeType ||\n \"InferredPredicate\" === nodeType ||\n \"InterfaceExtends\" === nodeType ||\n \"InterfaceDeclaration\" === nodeType ||\n \"InterfaceTypeAnnotation\" === nodeType ||\n \"IntersectionTypeAnnotation\" === nodeType ||\n \"MixedTypeAnnotation\" === nodeType ||\n \"EmptyTypeAnnotation\" === nodeType ||\n \"NullableTypeAnnotation\" === nodeType ||\n \"NumberLiteralTypeAnnotation\" === nodeType ||\n \"NumberTypeAnnotation\" === nodeType ||\n \"ObjectTypeAnnotation\" === nodeType ||\n \"ObjectTypeInternalSlot\" === nodeType ||\n \"ObjectTypeCallProperty\" === nodeType ||\n \"ObjectTypeIndexer\" === nodeType ||\n \"ObjectTypeProperty\" === nodeType ||\n \"ObjectTypeSpreadProperty\" === nodeType ||\n \"OpaqueType\" === nodeType ||\n \"QualifiedTypeIdentifier\" === nodeType ||\n \"StringLiteralTypeAnnotation\" === nodeType ||\n \"StringTypeAnnotation\" === nodeType ||\n \"ThisTypeAnnotation\" === nodeType ||\n \"TupleTypeAnnotation\" === nodeType ||\n \"TypeofTypeAnnotation\" === nodeType ||\n \"TypeAlias\" === nodeType ||\n \"TypeAnnotation\" === nodeType ||\n \"TypeCastExpression\" === nodeType ||\n \"TypeParameter\" === nodeType ||\n \"TypeParameterDeclaration\" === nodeType ||\n \"TypeParameterInstantiation\" === nodeType ||\n \"UnionTypeAnnotation\" === nodeType ||\n \"Variance\" === nodeType ||\n \"VoidTypeAnnotation\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlowType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FlowType\" ||\n \"AnyTypeAnnotation\" === nodeType ||\n \"ArrayTypeAnnotation\" === nodeType ||\n \"BooleanTypeAnnotation\" === nodeType ||\n \"BooleanLiteralTypeAnnotation\" === nodeType ||\n \"NullLiteralTypeAnnotation\" === nodeType ||\n \"ExistsTypeAnnotation\" === nodeType ||\n \"FunctionTypeAnnotation\" === nodeType ||\n \"GenericTypeAnnotation\" === nodeType ||\n \"InterfaceTypeAnnotation\" === nodeType ||\n \"IntersectionTypeAnnotation\" === nodeType ||\n \"MixedTypeAnnotation\" === nodeType ||\n \"EmptyTypeAnnotation\" === nodeType ||\n \"NullableTypeAnnotation\" === nodeType ||\n \"NumberLiteralTypeAnnotation\" === nodeType ||\n \"NumberTypeAnnotation\" === nodeType ||\n \"ObjectTypeAnnotation\" === nodeType ||\n \"StringLiteralTypeAnnotation\" === nodeType ||\n \"StringTypeAnnotation\" === nodeType ||\n \"ThisTypeAnnotation\" === nodeType ||\n \"TupleTypeAnnotation\" === nodeType ||\n \"TypeofTypeAnnotation\" === nodeType ||\n \"UnionTypeAnnotation\" === nodeType ||\n \"VoidTypeAnnotation\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlowBaseAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FlowBaseAnnotation\" ||\n \"AnyTypeAnnotation\" === nodeType ||\n \"BooleanTypeAnnotation\" === nodeType ||\n \"NullLiteralTypeAnnotation\" === nodeType ||\n \"MixedTypeAnnotation\" === nodeType ||\n \"EmptyTypeAnnotation\" === nodeType ||\n \"NumberTypeAnnotation\" === nodeType ||\n \"StringTypeAnnotation\" === nodeType ||\n \"ThisTypeAnnotation\" === nodeType ||\n \"VoidTypeAnnotation\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlowDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FlowDeclaration\" ||\n \"DeclareClass\" === nodeType ||\n \"DeclareFunction\" === nodeType ||\n \"DeclareInterface\" === nodeType ||\n \"DeclareModule\" === nodeType ||\n \"DeclareModuleExports\" === nodeType ||\n \"DeclareTypeAlias\" === nodeType ||\n \"DeclareOpaqueType\" === nodeType ||\n \"DeclareVariable\" === nodeType ||\n \"DeclareExportDeclaration\" === nodeType ||\n \"DeclareExportAllDeclaration\" === nodeType ||\n \"InterfaceDeclaration\" === nodeType ||\n \"OpaqueType\" === nodeType ||\n \"TypeAlias\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlowPredicate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FlowPredicate\" ||\n \"DeclaredPredicate\" === nodeType ||\n \"InferredPredicate\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"EnumBody\" ||\n \"EnumBooleanBody\" === nodeType ||\n \"EnumNumberBody\" === nodeType ||\n \"EnumStringBody\" === nodeType ||\n \"EnumSymbolBody\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"EnumMember\" ||\n \"EnumBooleanMember\" === nodeType ||\n \"EnumNumberMember\" === nodeType ||\n \"EnumStringMember\" === nodeType ||\n \"EnumDefaultedMember\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSX(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"JSX\" ||\n \"JSXAttribute\" === nodeType ||\n \"JSXClosingElement\" === nodeType ||\n \"JSXElement\" === nodeType ||\n \"JSXEmptyExpression\" === nodeType ||\n \"JSXExpressionContainer\" === nodeType ||\n \"JSXSpreadChild\" === nodeType ||\n \"JSXIdentifier\" === nodeType ||\n \"JSXMemberExpression\" === nodeType ||\n \"JSXNamespacedName\" === nodeType ||\n \"JSXOpeningElement\" === nodeType ||\n \"JSXSpreadAttribute\" === nodeType ||\n \"JSXText\" === nodeType ||\n \"JSXFragment\" === nodeType ||\n \"JSXOpeningFragment\" === nodeType ||\n \"JSXClosingFragment\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPrivate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Private\" ||\n \"ClassPrivateProperty\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType ||\n \"PrivateName\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"TSTypeElement\" ||\n \"TSCallSignatureDeclaration\" === nodeType ||\n \"TSConstructSignatureDeclaration\" === nodeType ||\n \"TSPropertySignature\" === nodeType ||\n \"TSMethodSignature\" === nodeType ||\n \"TSIndexSignature\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"TSType\" ||\n \"TSAnyKeyword\" === nodeType ||\n \"TSBooleanKeyword\" === nodeType ||\n \"TSBigIntKeyword\" === nodeType ||\n \"TSNeverKeyword\" === nodeType ||\n \"TSNullKeyword\" === nodeType ||\n \"TSNumberKeyword\" === nodeType ||\n \"TSObjectKeyword\" === nodeType ||\n \"TSStringKeyword\" === nodeType ||\n \"TSSymbolKeyword\" === nodeType ||\n \"TSUndefinedKeyword\" === nodeType ||\n \"TSUnknownKeyword\" === nodeType ||\n \"TSVoidKeyword\" === nodeType ||\n \"TSThisType\" === nodeType ||\n \"TSFunctionType\" === nodeType ||\n \"TSConstructorType\" === nodeType ||\n \"TSTypeReference\" === nodeType ||\n \"TSTypePredicate\" === nodeType ||\n \"TSTypeQuery\" === nodeType ||\n \"TSTypeLiteral\" === nodeType ||\n \"TSArrayType\" === nodeType ||\n \"TSTupleType\" === nodeType ||\n \"TSOptionalType\" === nodeType ||\n \"TSRestType\" === nodeType ||\n \"TSUnionType\" === nodeType ||\n \"TSIntersectionType\" === nodeType ||\n \"TSConditionalType\" === nodeType ||\n \"TSInferType\" === nodeType ||\n \"TSParenthesizedType\" === nodeType ||\n \"TSTypeOperator\" === nodeType ||\n \"TSIndexedAccessType\" === nodeType ||\n \"TSMappedType\" === nodeType ||\n \"TSLiteralType\" === nodeType ||\n \"TSExpressionWithTypeArguments\" === nodeType ||\n \"TSImportType\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNumberLiteral(node: ?Object, opts?: Object): boolean {\n console.trace(\n \"The node type NumberLiteral has been renamed to NumericLiteral\",\n );\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NumberLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isRegexLiteral(node: ?Object, opts?: Object): boolean {\n console.trace(\"The node type RegexLiteral has been renamed to RegExpLiteral\");\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"RegexLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isRestProperty(node: ?Object, opts?: Object): boolean {\n console.trace(\"The node type RestProperty has been renamed to RestElement\");\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"RestProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSpreadProperty(node: ?Object, opts?: Object): boolean {\n console.trace(\n \"The node type SpreadProperty has been renamed to SpreadElement\",\n );\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SpreadProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\n","import { isIdentifier, isMemberExpression, isStringLiteral } from \"./generated\";\n\n/**\n * Determines whether or not the input node `member` matches the\n * input `match`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\nexport default function matchesPattern(\n member: Object,\n match: string | Array,\n allowPartial?: boolean,\n): boolean {\n // not a member expression\n if (!isMemberExpression(member)) return false;\n\n const parts = Array.isArray(match) ? match : match.split(\".\");\n const nodes = [];\n\n let node;\n for (node = member; isMemberExpression(node); node = node.object) {\n nodes.push(node.property);\n }\n nodes.push(node);\n\n if (nodes.length < parts.length) return false;\n if (!allowPartial && nodes.length > parts.length) return false;\n\n for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {\n const node = nodes[j];\n let value;\n if (isIdentifier(node)) {\n value = node.name;\n } else if (isStringLiteral(node)) {\n value = node.value;\n } else {\n return false;\n }\n\n if (parts[i] !== value) return false;\n }\n\n return true;\n}\n","import matchesPattern from \"./matchesPattern\";\n\n/**\n * Build a function that when called will return whether or not the\n * input `node` `MemberExpression` matches the input `match`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\nexport default function buildMatchMemberExpression(\n match: string,\n allowPartial?: boolean,\n): Object => boolean {\n const parts = match.split(\".\");\n\n return (member: Object): boolean =>\n matchesPattern(member, parts, allowPartial);\n}\n","// @flow\nimport buildMatchMemberExpression from \"../buildMatchMemberExpression\";\n\nconst isReactComponent = buildMatchMemberExpression(\"React.Component\");\n\nexport default isReactComponent;\n","// @flow\nexport default function isCompatTag(tagName?: string): boolean {\n // Must start with a lowercase ASCII letter\n return !!tagName && /^[a-z]/.test(tagName);\n}\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","/** 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 Map = getNative(root, 'Map');\n\nmodule.exports = Map;\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","/**\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 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","/**\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","/**\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","/**\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","/** 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","/** 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 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 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","/** 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","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","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 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","/**\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","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","/**\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 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 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","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 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","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 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","/** 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 root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\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\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","'use strict';\n\nlet fastProto = null;\n\n// Creates an object with permanently fast properties in V8. See Toon Verwaest's\n// post https://medium.com/@tverwaes/setting-up-prototypes-in-v8-ec9c9491dfe2#5f62\n// for more details. Use %HasFastProperties(object) and the Node.js flag\n// --allow-natives-syntax to check whether an object has fast properties.\nfunction FastObject(o) {\n\t// A prototype object will have \"fast properties\" enabled once it is checked\n\t// against the inline property cache of a function, e.g. fastProto.property:\n\t// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63\n\tif (fastProto !== null && typeof fastProto.property) {\n\t\tconst result = fastProto;\n\t\tfastProto = FastObject.prototype = null;\n\t\treturn result;\n\t}\n\tfastProto = FastObject.prototype = o == null ? Object.create(null) : o;\n\treturn new FastObject;\n}\n\n// Initialize the inline property cache of FastObject\nFastObject();\n\nmodule.exports = function toFastproperties(o) {\n\treturn FastObject(o);\n};\n","/*\n Copyright (C) 2013 Yusuke Suzuki \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n(function () {\n 'use strict';\n\n function isExpression(node) {\n if (node == null) { return false; }\n switch (node.type) {\n case 'ArrayExpression':\n case 'AssignmentExpression':\n case 'BinaryExpression':\n case 'CallExpression':\n case 'ConditionalExpression':\n case 'FunctionExpression':\n case 'Identifier':\n case 'Literal':\n case 'LogicalExpression':\n case 'MemberExpression':\n case 'NewExpression':\n case 'ObjectExpression':\n case 'SequenceExpression':\n case 'ThisExpression':\n case 'UnaryExpression':\n case 'UpdateExpression':\n return true;\n }\n return false;\n }\n\n function isIterationStatement(node) {\n if (node == null) { return false; }\n switch (node.type) {\n case 'DoWhileStatement':\n case 'ForInStatement':\n case 'ForStatement':\n case 'WhileStatement':\n return true;\n }\n return false;\n }\n\n function isStatement(node) {\n if (node == null) { return false; }\n switch (node.type) {\n case 'BlockStatement':\n case 'BreakStatement':\n case 'ContinueStatement':\n case 'DebuggerStatement':\n case 'DoWhileStatement':\n case 'EmptyStatement':\n case 'ExpressionStatement':\n case 'ForInStatement':\n case 'ForStatement':\n case 'IfStatement':\n case 'LabeledStatement':\n case 'ReturnStatement':\n case 'SwitchStatement':\n case 'ThrowStatement':\n case 'TryStatement':\n case 'VariableDeclaration':\n case 'WhileStatement':\n case 'WithStatement':\n return true;\n }\n return false;\n }\n\n function isSourceElement(node) {\n return isStatement(node) || node != null && node.type === 'FunctionDeclaration';\n }\n\n function trailingStatement(node) {\n switch (node.type) {\n case 'IfStatement':\n if (node.alternate != null) {\n return node.alternate;\n }\n return node.consequent;\n\n case 'LabeledStatement':\n case 'ForStatement':\n case 'ForInStatement':\n case 'WhileStatement':\n case 'WithStatement':\n return node.body;\n }\n return null;\n }\n\n function isProblematicIfStatement(node) {\n var current;\n\n if (node.type !== 'IfStatement') {\n return false;\n }\n if (node.alternate == null) {\n return false;\n }\n current = node.consequent;\n do {\n if (current.type === 'IfStatement') {\n if (current.alternate == null) {\n return true;\n }\n }\n current = trailingStatement(current);\n } while (current);\n\n return false;\n }\n\n module.exports = {\n isExpression: isExpression,\n isStatement: isStatement,\n isIterationStatement: isIterationStatement,\n isSourceElement: isSourceElement,\n isProblematicIfStatement: isProblematicIfStatement,\n\n trailingStatement: trailingStatement\n };\n}());\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n Copyright (C) 2013-2014 Yusuke Suzuki \n Copyright (C) 2014 Ivan Nikulin \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n(function () {\n 'use strict';\n\n var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;\n\n // See `tools/generate-identifier-regex.js`.\n ES5Regex = {\n // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart:\n NonAsciiIdentifierStart: /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/,\n // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart:\n NonAsciiIdentifierPart: /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/\n };\n\n ES6Regex = {\n // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart:\n NonAsciiIdentifierStart: /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF30-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF19]|\\uD806[\\uDCA0-\\uDCDF\\uDCFF\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00\\uDC01]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1]|\\uD87E[\\uDC00-\\uDE1D]/,\n // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart:\n NonAsciiIdentifierPart: /[\\xAA\\xB5\\xB7\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1369-\\u1371\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19DA\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDDFD\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDEE0\\uDF00-\\uDF1F\\uDF30-\\uDF4A\\uDF50-\\uDF7A\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCA0-\\uDCA9\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE38-\\uDE3A\\uDE3F\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE6\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC00-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDCBA\\uDCD0-\\uDCE8\\uDCF0-\\uDCF9\\uDD00-\\uDD34\\uDD36-\\uDD3F\\uDD50-\\uDD73\\uDD76\\uDD80-\\uDDC4\\uDDCA-\\uDDCC\\uDDD0-\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE37\\uDE3E\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3C-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF50\\uDF57\\uDF5D-\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC00-\\uDC4A\\uDC50-\\uDC59\\uDC80-\\uDCC5\\uDCC7\\uDCD0-\\uDCD9\\uDD80-\\uDDB5\\uDDB8-\\uDDC0\\uDDD8-\\uDDDD\\uDE00-\\uDE40\\uDE44\\uDE50-\\uDE59\\uDE80-\\uDEB7\\uDEC0-\\uDEC9\\uDF00-\\uDF19\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDCA0-\\uDCE9\\uDCFF\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50-\\uDF7E\\uDF8F-\\uDF9F\\uDFE0]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00\\uDC01]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6\\uDD00-\\uDD4A\\uDD50-\\uDD59]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1]|\\uD87E[\\uDC00-\\uDE1D]|\\uDB40[\\uDD00-\\uDDEF]/\n };\n\n function isDecimalDigit(ch) {\n return 0x30 <= ch && ch <= 0x39; // 0..9\n }\n\n function isHexDigit(ch) {\n return 0x30 <= ch && ch <= 0x39 || // 0..9\n 0x61 <= ch && ch <= 0x66 || // a..f\n 0x41 <= ch && ch <= 0x46; // A..F\n }\n\n function isOctalDigit(ch) {\n return ch >= 0x30 && ch <= 0x37; // 0..7\n }\n\n // 7.2 White Space\n\n NON_ASCII_WHITESPACES = [\n 0x1680,\n 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A,\n 0x202F, 0x205F,\n 0x3000,\n 0xFEFF\n ];\n\n function isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 ||\n ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0;\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function fromCodePoint(cp) {\n if (cp <= 0xFFFF) { return String.fromCharCode(cp); }\n var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800);\n var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00);\n return cu1 + cu2;\n }\n\n IDENTIFIER_START = new Array(0x80);\n for(ch = 0; ch < 0x80; ++ch) {\n IDENTIFIER_START[ch] =\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)\n }\n\n IDENTIFIER_PART = new Array(0x80);\n for(ch = 0; ch < 0x80; ++ch) {\n IDENTIFIER_PART[ch] =\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x30 && ch <= 0x39 || // 0..9\n ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)\n }\n\n function isIdentifierStartES5(ch) {\n return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));\n }\n\n function isIdentifierPartES5(ch) {\n return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));\n }\n\n function isIdentifierStartES6(ch) {\n return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));\n }\n\n function isIdentifierPartES6(ch) {\n return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));\n }\n\n module.exports = {\n isDecimalDigit: isDecimalDigit,\n isHexDigit: isHexDigit,\n isOctalDigit: isOctalDigit,\n isWhiteSpace: isWhiteSpace,\n isLineTerminator: isLineTerminator,\n isIdentifierStartES5: isIdentifierStartES5,\n isIdentifierPartES5: isIdentifierPartES5,\n isIdentifierStartES6: isIdentifierStartES6,\n isIdentifierPartES6: isIdentifierPartES6\n };\n}());\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n Copyright (C) 2013 Yusuke Suzuki \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n(function () {\n 'use strict';\n\n var code = require('./code');\n\n function isStrictModeReservedWordES6(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isKeywordES5(id, strict) {\n // yield should not be treated as keyword under non-strict mode.\n if (!strict && id === 'yield') {\n return false;\n }\n return isKeywordES6(id, strict);\n }\n\n function isKeywordES6(id, strict) {\n if (strict && isStrictModeReservedWordES6(id)) {\n return true;\n }\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n function isReservedWordES5(id, strict) {\n return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);\n }\n\n function isReservedWordES6(id, strict) {\n return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n function isIdentifierNameES5(id) {\n var i, iz, ch;\n\n if (id.length === 0) { return false; }\n\n ch = id.charCodeAt(0);\n if (!code.isIdentifierStartES5(ch)) {\n return false;\n }\n\n for (i = 1, iz = id.length; i < iz; ++i) {\n ch = id.charCodeAt(i);\n if (!code.isIdentifierPartES5(ch)) {\n return false;\n }\n }\n return true;\n }\n\n function decodeUtf16(lead, trail) {\n return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n }\n\n function isIdentifierNameES6(id) {\n var i, iz, ch, lowCh, check;\n\n if (id.length === 0) { return false; }\n\n check = code.isIdentifierStartES6;\n for (i = 0, iz = id.length; i < iz; ++i) {\n ch = id.charCodeAt(i);\n if (0xD800 <= ch && ch <= 0xDBFF) {\n ++i;\n if (i >= iz) { return false; }\n lowCh = id.charCodeAt(i);\n if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {\n return false;\n }\n ch = decodeUtf16(ch, lowCh);\n }\n if (!check(ch)) {\n return false;\n }\n check = code.isIdentifierPartES6;\n }\n return true;\n }\n\n function isIdentifierES5(id, strict) {\n return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);\n }\n\n function isIdentifierES6(id, strict) {\n return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);\n }\n\n module.exports = {\n isKeywordES5: isKeywordES5,\n isKeywordES6: isKeywordES6,\n isReservedWordES5: isReservedWordES5,\n isReservedWordES6: isReservedWordES6,\n isRestrictedWord: isRestrictedWord,\n isIdentifierNameES5: isIdentifierNameES5,\n isIdentifierNameES6: isIdentifierNameES6,\n isIdentifierES5: isIdentifierES5,\n isIdentifierES6: isIdentifierES6\n };\n}());\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n Copyright (C) 2013 Yusuke Suzuki \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n\n(function () {\n 'use strict';\n\n exports.ast = require('./ast');\n exports.code = require('./code');\n exports.keyword = require('./keyword');\n}());\n/* vim: set sw=4 ts=4 et tw=80 : */\n","// @flow\nimport { FLIPPED_ALIAS_KEYS, ALIAS_KEYS } from \"../definitions\";\n\n/**\n * Test if a `nodeType` is a `targetType` or if `targetType` is an alias of `nodeType`.\n */\nexport default function isType(nodeType: ?string, targetType: string): boolean {\n if (nodeType === targetType) return true;\n\n // This is a fast-path. If the test above failed, but an alias key is found, then the\n // targetType was a primary node type, so there's no need to check the aliases.\n if (ALIAS_KEYS[targetType]) return false;\n\n const aliases: ?Array = FLIPPED_ALIAS_KEYS[targetType];\n if (aliases) {\n if (aliases[0] === nodeType) return true;\n\n for (const alias of aliases) {\n if (nodeType === alias) return true;\n }\n }\n\n return false;\n}\n","// @flow\nimport { PLACEHOLDERS_ALIAS } from \"../definitions\";\n\n/**\n * Test if a `placeholderType` is a `targetType` or if `targetType` is an alias of `placeholderType`.\n */\nexport default function isPlaceholderType(\n placeholderType: string,\n targetType: string,\n): boolean {\n if (placeholderType === targetType) return true;\n\n const aliases: ?Array = PLACEHOLDERS_ALIAS[placeholderType];\n if (aliases) {\n for (const alias of aliases) {\n if (targetType === alias) return true;\n }\n }\n\n return false;\n}\n","// @flow\nimport shallowEqual from \"../utils/shallowEqual\";\nimport isType from \"./isType\";\nimport isPlaceholderType from \"./isPlaceholderType\";\nimport { FLIPPED_ALIAS_KEYS } from \"../definitions\";\n\n/**\n * Returns whether `node` is of given `type`.\n *\n * For better performance, use this instead of `is[Type]` when `type` is unknown.\n */\nexport default function is(type: string, node: Object, opts?: Object): boolean {\n if (!node) return false;\n\n const matches = isType(node.type, type);\n if (!matches) {\n if (!opts && node.type === \"Placeholder\" && type in FLIPPED_ALIAS_KEYS) {\n // We can only return true if the placeholder doesn't replace a real node,\n // but it replaces a category of nodes (an alias).\n //\n // t.is(\"Identifier\", node) gives some guarantees about node's shape, so we\n // can't say that Placeholder(expectedNode: \"Identifier\") is an identifier\n // because it doesn't have the same properties.\n // On the other hand, t.is(\"Expression\", node) doesn't say anything about\n // the shape of node because Expression can be many different nodes: we can,\n // and should, safely report expression placeholders as Expressions.\n return isPlaceholderType(node.expectedNode, type);\n }\n return false;\n }\n\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n}\n","// @flow\nexport const STATEMENT_OR_BLOCK_KEYS = [\"consequent\", \"body\", \"alternate\"];\nexport const FLATTENABLE_KEYS = [\"body\", \"expressions\"];\nexport const FOR_INIT_KEYS = [\"left\", \"init\"];\nexport const COMMENT_KEYS = [\n \"leadingComments\",\n \"trailingComments\",\n \"innerComments\",\n];\n\nexport const LOGICAL_OPERATORS = [\"||\", \"&&\", \"??\"];\nexport const UPDATE_OPERATORS = [\"++\", \"--\"];\n\nexport const BOOLEAN_NUMBER_BINARY_OPERATORS = [\">\", \"<\", \">=\", \"<=\"];\nexport const EQUALITY_BINARY_OPERATORS = [\"==\", \"===\", \"!=\", \"!==\"];\nexport const COMPARISON_BINARY_OPERATORS = [\n ...EQUALITY_BINARY_OPERATORS,\n \"in\",\n \"instanceof\",\n];\nexport const BOOLEAN_BINARY_OPERATORS = [\n ...COMPARISON_BINARY_OPERATORS,\n ...BOOLEAN_NUMBER_BINARY_OPERATORS,\n];\nexport const NUMBER_BINARY_OPERATORS = [\n \"-\",\n \"/\",\n \"%\",\n \"*\",\n \"**\",\n \"&\",\n \"|\",\n \">>\",\n \">>>\",\n \"<<\",\n \"^\",\n];\nexport const BINARY_OPERATORS = [\n \"+\",\n ...NUMBER_BINARY_OPERATORS,\n ...BOOLEAN_BINARY_OPERATORS,\n];\n\nexport const ASSIGNMENT_OPERATORS = [\n \"=\",\n \"+=\",\n ...NUMBER_BINARY_OPERATORS.map(op => op + \"=\"),\n];\n\nexport const BOOLEAN_UNARY_OPERATORS = [\"delete\", \"!\"];\nexport const NUMBER_UNARY_OPERATORS = [\"+\", \"-\", \"~\"];\nexport const STRING_UNARY_OPERATORS = [\"typeof\"];\nexport const UNARY_OPERATORS = [\n \"void\",\n \"throw\",\n ...BOOLEAN_UNARY_OPERATORS,\n ...NUMBER_UNARY_OPERATORS,\n ...STRING_UNARY_OPERATORS,\n];\n\nexport const INHERIT_KEYS = {\n optional: [\"typeAnnotation\", \"typeParameters\", \"returnType\"],\n force: [\"start\", \"loc\", \"end\"],\n};\n\nexport const BLOCK_SCOPED_SYMBOL = Symbol.for(\"var used to be block scoped\");\nexport const NOT_LOCAL_BINDING = Symbol.for(\n \"should not be considered a local binding\",\n);\n","// @flow\nimport { NODE_FIELDS, NODE_PARENT_VALIDATIONS } from \"../definitions\";\n\nexport default function validate(node?: Object, key: string, val: any): void {\n if (!node) return;\n\n const fields = NODE_FIELDS[node.type];\n if (!fields) return;\n\n const field = fields[key];\n validateField(node, key, val, field);\n validateChild(node, key, val);\n}\n\nexport function validateField(\n node?: Object,\n key: string,\n val: any,\n field: any,\n): void {\n if (!field || !field.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n}\n\nexport function validateChild(node?: Object, key: string, val?: Object) {\n if (val == null) return;\n const validate = NODE_PARENT_VALIDATIONS[val.type];\n if (!validate) return;\n validate(node, key, val);\n}\n","// @flow\nimport is from \"../validators/is\";\nimport { validateField, validateChild } from \"../validators/validate\";\n\nexport const VISITOR_KEYS: { [string]: Array } = {};\nexport const ALIAS_KEYS: { [string]: Array } = {};\nexport const FLIPPED_ALIAS_KEYS: { [string]: Array } = {};\nexport const NODE_FIELDS: { [string]: {} } = {};\nexport const BUILDER_KEYS: { [string]: Array } = {};\nexport const DEPRECATED_KEYS: { [string]: string } = {};\nexport const NODE_PARENT_VALIDATIONS = {};\n\nfunction getType(val) {\n if (Array.isArray(val)) {\n return \"array\";\n } else if (val === null) {\n return \"null\";\n } else {\n return typeof val;\n }\n}\n\n// TODO: Import and use Node instead of any\ntype Validator = (any, string, any) => void;\n\ntype FieldOptions = {\n default?: any,\n optional?: boolean,\n validate?: Validator,\n};\n\nexport function validate(validate: Validator): FieldOptions {\n return { validate };\n}\n\nexport function typeIs(typeName: string | string[]) {\n return typeof typeName === \"string\"\n ? assertNodeType(typeName)\n : assertNodeType(...typeName);\n}\n\nexport function validateType(typeName: string | string[]) {\n return validate(typeIs(typeName));\n}\n\nexport function validateOptional(validate: Validator): FieldOptions {\n return { validate, optional: true };\n}\n\nexport function validateOptionalType(\n typeName: string | string[],\n): FieldOptions {\n return { validate: typeIs(typeName), optional: true };\n}\n\nexport function arrayOf(elementType: Validator): Validator {\n return chain(assertValueType(\"array\"), assertEach(elementType));\n}\n\nexport function arrayOfType(typeName: string | string[]) {\n return arrayOf(typeIs(typeName));\n}\n\nexport function validateArrayOfType(typeName: string | string[]) {\n return validate(arrayOfType(typeName));\n}\n\nexport function assertEach(callback: Validator): Validator {\n function validator(node, key, val) {\n if (!Array.isArray(val)) return;\n\n for (let i = 0; i < val.length; i++) {\n const subkey = `${key}[${i}]`;\n const v = val[i];\n callback(node, subkey, v);\n if (process.env.BABEL_TYPES_8_BREAKING) validateChild(node, subkey, v);\n }\n }\n validator.each = callback;\n return validator;\n}\n\nexport function assertOneOf(...values: Array): Validator {\n function validate(node: Object, key: string, val: any) {\n if (values.indexOf(val) < 0) {\n throw new TypeError(\n `Property ${key} expected value to be one of ${JSON.stringify(\n values,\n )} but got ${JSON.stringify(val)}`,\n );\n }\n }\n\n validate.oneOf = values;\n\n return validate;\n}\n\nexport function assertNodeType(...types: Array): Validator {\n function validate(node, key, val) {\n for (const type of types) {\n if (is(type, val)) {\n validateChild(node, key, val);\n return;\n }\n }\n\n throw new TypeError(\n `Property ${key} of ${\n node.type\n } expected node to be of a type ${JSON.stringify(\n types,\n )} but instead got ${JSON.stringify(val && val.type)}`,\n );\n }\n\n validate.oneOfNodeTypes = types;\n\n return validate;\n}\n\nexport function assertNodeOrValueType(...types: Array): Validator {\n function validate(node, key, val) {\n for (const type of types) {\n if (getType(val) === type || is(type, val)) {\n validateChild(node, key, val);\n return;\n }\n }\n\n throw new TypeError(\n `Property ${key} of ${\n node.type\n } expected node to be of a type ${JSON.stringify(\n types,\n )} but instead got ${JSON.stringify(val && val.type)}`,\n );\n }\n\n validate.oneOfNodeOrValueTypes = types;\n\n return validate;\n}\n\nexport function assertValueType(type: string): Validator {\n function validate(node, key, val) {\n const valid = getType(val) === type;\n\n if (!valid) {\n throw new TypeError(\n `Property ${key} expected type of ${type} but got ${getType(val)}`,\n );\n }\n }\n\n validate.type = type;\n\n return validate;\n}\n\nexport function assertShape(shape: { [string]: FieldOptions }): Validator {\n function validate(node, key, val) {\n const errors = [];\n for (const property of Object.keys(shape)) {\n try {\n validateField(node, property, val[property], shape[property]);\n } catch (error) {\n if (error instanceof TypeError) {\n errors.push(error.message);\n continue;\n }\n throw error;\n }\n }\n if (errors.length) {\n throw new TypeError(\n `Property ${key} of ${\n node.type\n } expected to have the following:\\n${errors.join(\"\\n\")}`,\n );\n }\n }\n\n validate.shapeOf = shape;\n\n return validate;\n}\n\nexport function chain(...fns: Array): Validator {\n function validate(...args) {\n for (const fn of fns) {\n fn(...args);\n }\n }\n validate.chainOf = fns;\n return validate;\n}\n\nconst validTypeOpts = [\n \"aliases\",\n \"builder\",\n \"deprecatedAlias\",\n \"fields\",\n \"inherits\",\n \"visitor\",\n \"validate\",\n];\nconst validFieldKeys = [\"default\", \"optional\", \"validate\"];\n\nexport default function defineType(\n type: string,\n opts: {\n fields?: {\n [string]: FieldOptions,\n },\n visitor?: Array,\n aliases?: Array,\n builder?: Array,\n inherits?: string,\n deprecatedAlias?: string,\n validate?: Validator,\n } = {},\n) {\n const inherits = (opts.inherits && store[opts.inherits]) || {};\n\n let fields = opts.fields;\n if (!fields) {\n fields = {};\n if (inherits.fields) {\n const keys = Object.getOwnPropertyNames(inherits.fields);\n for (const key of (keys: Array)) {\n const field = inherits.fields[key];\n fields[key] = {\n default: field.default,\n optional: field.optional,\n validate: field.validate,\n };\n }\n }\n }\n\n const visitor: Array = opts.visitor || inherits.visitor || [];\n const aliases: Array = opts.aliases || inherits.aliases || [];\n const builder: Array =\n opts.builder || inherits.builder || opts.visitor || [];\n\n for (const k of (Object.keys(opts): Array)) {\n if (validTypeOpts.indexOf(k) === -1) {\n throw new Error(`Unknown type option \"${k}\" on ${type}`);\n }\n }\n\n if (opts.deprecatedAlias) {\n DEPRECATED_KEYS[opts.deprecatedAlias] = type;\n }\n\n // ensure all field keys are represented in `fields`\n for (const key of (visitor.concat(builder): Array)) {\n fields[key] = fields[key] || {};\n }\n\n for (const key of Object.keys(fields)) {\n const field = fields[key];\n\n if (field.default !== undefined && builder.indexOf(key) === -1) {\n field.optional = true;\n }\n if (field.default === undefined) {\n field.default = null;\n } else if (!field.validate && field.default != null) {\n field.validate = assertValueType(getType(field.default));\n }\n\n for (const k of (Object.keys(field): Array)) {\n if (validFieldKeys.indexOf(k) === -1) {\n throw new Error(`Unknown field key \"${k}\" on ${type}.${key}`);\n }\n }\n }\n\n VISITOR_KEYS[type] = opts.visitor = visitor;\n BUILDER_KEYS[type] = opts.builder = builder;\n NODE_FIELDS[type] = opts.fields = fields;\n ALIAS_KEYS[type] = opts.aliases = aliases;\n aliases.forEach(alias => {\n FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];\n FLIPPED_ALIAS_KEYS[alias].push(type);\n });\n\n if (opts.validate) {\n NODE_PARENT_VALIDATIONS[type] = opts.validate;\n }\n\n store[type] = opts;\n}\n\nconst store = {};\n","// @flow\n\nimport esutils from \"esutils\";\n\nimport is from \"../validators/is\";\n\nimport {\n BINARY_OPERATORS,\n LOGICAL_OPERATORS,\n ASSIGNMENT_OPERATORS,\n UNARY_OPERATORS,\n UPDATE_OPERATORS,\n} from \"../constants\";\n\nimport defineType, {\n assertValueType,\n assertNodeType,\n assertNodeOrValueType,\n assertEach,\n chain,\n assertOneOf,\n} from \"./utils\";\n\ndefineType(\"ArrayExpression\", {\n fields: {\n elements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeOrValueType(\"null\", \"Expression\", \"SpreadElement\"),\n ),\n ),\n default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined,\n },\n },\n visitor: [\"elements\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"AssignmentExpression\", {\n fields: {\n operator: {\n validate: (function() {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return assertValueType(\"string\");\n }\n\n const identifier = assertOneOf(...ASSIGNMENT_OPERATORS);\n const pattern = assertOneOf(\"=\");\n\n return function(node, key, val) {\n const validator = is(\"Pattern\", node.left) ? pattern : identifier;\n validator(node, key, val);\n };\n })(),\n },\n left: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"LVal\")\n : assertNodeType(\n \"Identifier\",\n \"MemberExpression\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n ),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n builder: [\"operator\", \"left\", \"right\"],\n visitor: [\"left\", \"right\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"BinaryExpression\", {\n builder: [\"operator\", \"left\", \"right\"],\n fields: {\n operator: {\n validate: assertOneOf(...BINARY_OPERATORS),\n },\n left: {\n validate: assertNodeType(\"Expression\"),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n visitor: [\"left\", \"right\"],\n aliases: [\"Binary\", \"Expression\"],\n});\n\ndefineType(\"InterpreterDirective\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"Directive\", {\n visitor: [\"value\"],\n fields: {\n value: {\n validate: assertNodeType(\"DirectiveLiteral\"),\n },\n },\n});\n\ndefineType(\"DirectiveLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"BlockStatement\", {\n builder: [\"body\", \"directives\"],\n visitor: [\"directives\", \"body\"],\n fields: {\n directives: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Directive\")),\n ),\n default: [],\n },\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\", \"Block\", \"Statement\"],\n});\n\ndefineType(\"BreakStatement\", {\n visitor: [\"label\"],\n fields: {\n label: {\n validate: assertNodeType(\"Identifier\"),\n optional: true,\n },\n },\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n});\n\ndefineType(\"CallExpression\", {\n visitor: [\"callee\", \"arguments\", \"typeParameters\", \"typeArguments\"],\n builder: [\"callee\", \"arguments\"],\n aliases: [\"Expression\"],\n fields: {\n callee: {\n validate: assertNodeType(\"Expression\", \"V8IntrinsicIdentifier\"),\n },\n arguments: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"Expression\",\n \"SpreadElement\",\n \"JSXNamespacedName\",\n \"ArgumentPlaceholder\",\n ),\n ),\n ),\n },\n ...(!process.env.BABEL_TYPES_8_BREAKING\n ? {\n optional: {\n validate: assertOneOf(true, false),\n optional: true,\n },\n }\n : {}),\n typeArguments: {\n validate: assertNodeType(\"TypeParameterInstantiation\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\"TSTypeParameterInstantiation\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"CatchClause\", {\n visitor: [\"param\", \"body\"],\n fields: {\n param: {\n validate: assertNodeType(\"Identifier\", \"ArrayPattern\", \"ObjectPattern\"),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\"],\n});\n\ndefineType(\"ConditionalExpression\", {\n visitor: [\"test\", \"consequent\", \"alternate\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n consequent: {\n validate: assertNodeType(\"Expression\"),\n },\n alternate: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n aliases: [\"Expression\", \"Conditional\"],\n});\n\ndefineType(\"ContinueStatement\", {\n visitor: [\"label\"],\n fields: {\n label: {\n validate: assertNodeType(\"Identifier\"),\n optional: true,\n },\n },\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n});\n\ndefineType(\"DebuggerStatement\", {\n aliases: [\"Statement\"],\n});\n\ndefineType(\"DoWhileStatement\", {\n visitor: [\"test\", \"body\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n aliases: [\"Statement\", \"BlockParent\", \"Loop\", \"While\", \"Scopable\"],\n});\n\ndefineType(\"EmptyStatement\", {\n aliases: [\"Statement\"],\n});\n\ndefineType(\"ExpressionStatement\", {\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n aliases: [\"Statement\", \"ExpressionWrapper\"],\n});\n\ndefineType(\"File\", {\n builder: [\"program\", \"comments\", \"tokens\"],\n visitor: [\"program\"],\n fields: {\n program: {\n validate: assertNodeType(\"Program\"),\n },\n },\n});\n\ndefineType(\"ForInStatement\", {\n visitor: [\"left\", \"right\", \"body\"],\n aliases: [\n \"Scopable\",\n \"Statement\",\n \"For\",\n \"BlockParent\",\n \"Loop\",\n \"ForXStatement\",\n ],\n fields: {\n left: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"VariableDeclaration\", \"LVal\")\n : assertNodeType(\n \"VariableDeclaration\",\n \"Identifier\",\n \"MemberExpression\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n ),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"ForStatement\", {\n visitor: [\"init\", \"test\", \"update\", \"body\"],\n aliases: [\"Scopable\", \"Statement\", \"For\", \"BlockParent\", \"Loop\"],\n fields: {\n init: {\n validate: assertNodeType(\"VariableDeclaration\", \"Expression\"),\n optional: true,\n },\n test: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n update: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\nexport const functionCommon = {\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"Identifier\",\n \"Pattern\",\n \"RestElement\",\n \"TSParameterProperty\",\n ),\n ),\n ),\n },\n generator: {\n default: false,\n },\n async: {\n default: false,\n },\n};\n\nexport const functionTypeAnnotationCommon = {\n returnType: {\n validate: assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterDeclaration\",\n \"TSTypeParameterDeclaration\",\n \"Noop\",\n ),\n optional: true,\n },\n};\n\nexport const functionDeclarationCommon = {\n ...functionCommon,\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n id: {\n validate: assertNodeType(\"Identifier\"),\n optional: true, // May be null for `export default function`\n },\n};\n\ndefineType(\"FunctionDeclaration\", {\n builder: [\"id\", \"params\", \"body\", \"generator\", \"async\"],\n visitor: [\"id\", \"params\", \"body\", \"returnType\", \"typeParameters\"],\n fields: {\n ...functionDeclarationCommon,\n ...functionTypeAnnotationCommon,\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n aliases: [\n \"Scopable\",\n \"Function\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Statement\",\n \"Pureish\",\n \"Declaration\",\n ],\n validate: (function() {\n if (!process.env.BABEL_TYPES_8_BREAKING) return () => {};\n\n const identifier = assertNodeType(\"Identifier\");\n\n return function(parent, key, node) {\n if (!is(\"ExportDefaultDeclaration\", parent)) {\n identifier(node, \"id\", node.id);\n }\n };\n })(),\n});\n\ndefineType(\"FunctionExpression\", {\n inherits: \"FunctionDeclaration\",\n aliases: [\n \"Scopable\",\n \"Function\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Expression\",\n \"Pureish\",\n ],\n fields: {\n ...functionCommon,\n ...functionTypeAnnotationCommon,\n id: {\n validate: assertNodeType(\"Identifier\"),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\nexport const patternLikeCommon = {\n typeAnnotation: {\n // TODO: @babel/plugin-transform-flow-comments puts a Noop here, is there a better way?\n validate: assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n },\n};\n\ndefineType(\"Identifier\", {\n builder: [\"name\"],\n visitor: [\"typeAnnotation\", \"decorators\" /* for legacy param decorators */],\n aliases: [\"Expression\", \"PatternLike\", \"LVal\", \"TSEntityName\"],\n fields: {\n ...patternLikeCommon,\n name: {\n validate: chain(assertValueType(\"string\"), function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!esutils.keyword.isIdentifierNameES6(val)) {\n throw new TypeError(`\"${val}\" is not a valid identifier name`);\n }\n }),\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n },\n validate(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const match = /\\.(\\w+)$/.exec(key);\n if (!match) return;\n\n const [, parentKey] = match;\n const nonComp = { computed: false };\n\n // We can't check if `parent.property === node`, because nodes are validated\n // before replacing them in the AST.\n if (parentKey === \"property\") {\n if (is(\"MemberExpression\", parent, nonComp)) return;\n if (is(\"OptionalMemberExpression\", parent, nonComp)) return;\n } else if (parentKey === \"key\") {\n if (is(\"Property\", parent, nonComp)) return;\n if (is(\"Method\", parent, nonComp)) return;\n } else if (parentKey === \"exported\") {\n if (is(\"ExportSpecifier\", parent)) return;\n } else if (parentKey === \"imported\") {\n if (is(\"ImportSpecifier\", parent, { imported: node })) return;\n } else if (parentKey === \"meta\") {\n if (is(\"MetaProperty\", parent, { meta: node })) return;\n }\n\n if (\n // Ideally this should be strict if this node is a descendant of a block\n // in strict mode. Also, we should disallow \"await\" in modules.\n esutils.keyword.isReservedWordES6(node.name, /* strict */ false) &&\n // Even if \"this\" is a keyword, we are using the Identifier\n // node to represent it.\n node.name !== \"this\"\n ) {\n throw new TypeError(`\"${node.name}\" is not a valid identifer`);\n }\n },\n});\n\ndefineType(\"IfStatement\", {\n visitor: [\"test\", \"consequent\", \"alternate\"],\n aliases: [\"Statement\", \"Conditional\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n consequent: {\n validate: assertNodeType(\"Statement\"),\n },\n alternate: {\n optional: true,\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"LabeledStatement\", {\n visitor: [\"label\", \"body\"],\n aliases: [\"Statement\"],\n fields: {\n label: {\n validate: assertNodeType(\"Identifier\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"StringLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"NumericLiteral\", {\n builder: [\"value\"],\n deprecatedAlias: \"NumberLiteral\",\n fields: {\n value: {\n validate: assertValueType(\"number\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"NullLiteral\", {\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"BooleanLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"boolean\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"RegExpLiteral\", {\n builder: [\"pattern\", \"flags\"],\n deprecatedAlias: \"RegexLiteral\",\n aliases: [\"Expression\", \"Literal\"],\n fields: {\n pattern: {\n validate: assertValueType(\"string\"),\n },\n flags: {\n validate: chain(assertValueType(\"string\"), function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const invalid = /[^gimsuy]/.exec(val);\n if (invalid) {\n throw new TypeError(`\"${invalid[0]}\" is not a valid RegExp flag`);\n }\n }),\n default: \"\",\n },\n },\n});\n\ndefineType(\"LogicalExpression\", {\n builder: [\"operator\", \"left\", \"right\"],\n visitor: [\"left\", \"right\"],\n aliases: [\"Binary\", \"Expression\"],\n fields: {\n operator: {\n validate: assertOneOf(...LOGICAL_OPERATORS),\n },\n left: {\n validate: assertNodeType(\"Expression\"),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"MemberExpression\", {\n builder: [\"object\", \"property\", \"computed\", \"optional\"],\n visitor: [\"object\", \"property\"],\n aliases: [\"Expression\", \"LVal\"],\n fields: {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n property: {\n validate: (function() {\n const normal = assertNodeType(\"Identifier\", \"PrivateName\");\n const computed = assertNodeType(\"Expression\");\n\n return function(node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n },\n computed: {\n default: false,\n },\n ...(!process.env.BABEL_TYPES_8_BREAKING\n ? {\n optional: {\n validate: assertOneOf(true, false),\n optional: true,\n },\n }\n : {}),\n },\n});\n\ndefineType(\"NewExpression\", { inherits: \"CallExpression\" });\n\ndefineType(\"Program\", {\n // Note: We explicitly leave 'interpreter' out here because it is\n // conceptually comment-like, and Babel does not traverse comments either.\n visitor: [\"directives\", \"body\"],\n builder: [\"body\", \"directives\", \"sourceType\", \"interpreter\"],\n fields: {\n sourceFile: {\n validate: assertValueType(\"string\"),\n },\n sourceType: {\n validate: assertOneOf(\"script\", \"module\"),\n default: \"script\",\n },\n interpreter: {\n validate: assertNodeType(\"InterpreterDirective\"),\n default: null,\n optional: true,\n },\n directives: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Directive\")),\n ),\n default: [],\n },\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\", \"Block\"],\n});\n\ndefineType(\"ObjectExpression\", {\n visitor: [\"properties\"],\n aliases: [\"Expression\"],\n fields: {\n properties: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\"ObjectMethod\", \"ObjectProperty\", \"SpreadElement\"),\n ),\n ),\n },\n },\n});\n\ndefineType(\"ObjectMethod\", {\n builder: [\"kind\", \"key\", \"params\", \"body\", \"computed\", \"generator\", \"async\"],\n fields: {\n ...functionCommon,\n ...functionTypeAnnotationCommon,\n kind: {\n validate: assertOneOf(\"method\", \"get\", \"set\"),\n ...(!process.env.BABEL_TYPES_8_BREAKING ? { default: \"method\" } : {}),\n },\n computed: {\n default: false,\n },\n key: {\n validate: (function() {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n );\n const computed = assertNodeType(\"Expression\");\n\n return function(node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n visitor: [\n \"key\",\n \"params\",\n \"body\",\n \"decorators\",\n \"returnType\",\n \"typeParameters\",\n ],\n aliases: [\n \"UserWhitespacable\",\n \"Function\",\n \"Scopable\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Method\",\n \"ObjectMember\",\n ],\n});\n\ndefineType(\"ObjectProperty\", {\n builder: [\n \"key\",\n \"value\",\n \"computed\",\n \"shorthand\",\n ...(!process.env.BABEL_TYPES_8_BREAKING ? [\"decorators\"] : []),\n ],\n fields: {\n computed: {\n default: false,\n },\n key: {\n validate: (function() {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n );\n const computed = assertNodeType(\"Expression\");\n\n return function(node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n },\n value: {\n // Value may be PatternLike if this is an AssignmentProperty\n // https://github.com/babel/babylon/issues/434\n validate: assertNodeType(\"Expression\", \"PatternLike\"),\n },\n shorthand: {\n validate: chain(\n assertValueType(\"boolean\"),\n function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && node.computed) {\n throw new TypeError(\n \"Property shorthand of ObjectProperty cannot be true if computed is true\",\n );\n }\n },\n function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && !is(\"Identifier\", node.key)) {\n throw new TypeError(\n \"Property shorthand of ObjectProperty cannot be true if key is not an Identifier\",\n );\n }\n },\n ),\n default: false,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n visitor: [\"key\", \"value\", \"decorators\"],\n aliases: [\"UserWhitespacable\", \"Property\", \"ObjectMember\"],\n validate: (function() {\n const pattern = assertNodeType(\"Identifier\", \"Pattern\");\n const expression = assertNodeType(\"Expression\");\n\n return function(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const validator = is(\"ObjectPattern\", parent) ? pattern : expression;\n validator(node, \"value\", node.value);\n };\n })(),\n});\n\ndefineType(\"RestElement\", {\n visitor: [\"argument\", \"typeAnnotation\"],\n builder: [\"argument\"],\n aliases: [\"LVal\", \"PatternLike\"],\n deprecatedAlias: \"RestProperty\",\n fields: {\n ...patternLikeCommon,\n argument: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"LVal\")\n : assertNodeType(\"Identifier\", \"Pattern\", \"MemberExpression\"),\n },\n },\n validate(parent, key) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const match = /(\\w+)\\[(\\d+)\\]/.exec(key);\n if (!match) throw new Error(\"Internal Babel error: malformed key.\");\n\n const [, listKey, index] = match;\n if (parent[listKey].length > index + 1) {\n throw new TypeError(`RestElement must be last element of ${listKey}`);\n }\n },\n});\n\ndefineType(\"ReturnStatement\", {\n visitor: [\"argument\"],\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"SequenceExpression\", {\n visitor: [\"expressions\"],\n fields: {\n expressions: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Expression\")),\n ),\n },\n },\n aliases: [\"Expression\"],\n});\n\ndefineType(\"ParenthesizedExpression\", {\n visitor: [\"expression\"],\n aliases: [\"Expression\", \"ExpressionWrapper\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"SwitchCase\", {\n visitor: [\"test\", \"consequent\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n consequent: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n});\n\ndefineType(\"SwitchStatement\", {\n visitor: [\"discriminant\", \"cases\"],\n aliases: [\"Statement\", \"BlockParent\", \"Scopable\"],\n fields: {\n discriminant: {\n validate: assertNodeType(\"Expression\"),\n },\n cases: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"SwitchCase\")),\n ),\n },\n },\n});\n\ndefineType(\"ThisExpression\", {\n aliases: [\"Expression\"],\n});\n\ndefineType(\"ThrowStatement\", {\n visitor: [\"argument\"],\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"TryStatement\", {\n visitor: [\"block\", \"handler\", \"finalizer\"],\n aliases: [\"Statement\"],\n fields: {\n block: {\n validate: chain(assertNodeType(\"BlockStatement\"), function(node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n // This validator isn't put at the top level because we can run it\n // even if this node doesn't have a parent.\n\n if (!node.handler && !node.finalizer) {\n throw new TypeError(\n \"TryStatement expects either a handler or finalizer, or both\",\n );\n }\n }),\n },\n handler: {\n optional: true,\n validate: assertNodeType(\"CatchClause\"),\n },\n finalizer: {\n optional: true,\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"UnaryExpression\", {\n builder: [\"operator\", \"argument\", \"prefix\"],\n fields: {\n prefix: {\n default: true,\n },\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n operator: {\n validate: assertOneOf(...UNARY_OPERATORS),\n },\n },\n visitor: [\"argument\"],\n aliases: [\"UnaryLike\", \"Expression\"],\n});\n\ndefineType(\"UpdateExpression\", {\n builder: [\"operator\", \"argument\", \"prefix\"],\n fields: {\n prefix: {\n default: false,\n },\n argument: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"Expression\")\n : assertNodeType(\"Identifier\", \"MemberExpression\"),\n },\n operator: {\n validate: assertOneOf(...UPDATE_OPERATORS),\n },\n },\n visitor: [\"argument\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"VariableDeclaration\", {\n builder: [\"kind\", \"declarations\"],\n visitor: [\"declarations\"],\n aliases: [\"Statement\", \"Declaration\"],\n fields: {\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n kind: {\n validate: assertOneOf(\"var\", \"let\", \"const\"),\n },\n declarations: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"VariableDeclarator\")),\n ),\n },\n },\n validate(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!is(\"ForXStatement\", parent, { left: node })) return;\n if (node.declarations.length !== 1) {\n throw new TypeError(\n `Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`,\n );\n }\n },\n});\n\ndefineType(\"VariableDeclarator\", {\n visitor: [\"id\", \"init\"],\n fields: {\n id: {\n validate: (function() {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return assertNodeType(\"LVal\");\n }\n\n const normal = assertNodeType(\n \"Identifier\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n );\n const without = assertNodeType(\"Identifier\");\n\n return function(node, key, val) {\n const validator = node.init ? normal : without;\n validator(node, key, val);\n };\n })(),\n },\n definite: {\n optional: true,\n validate: assertValueType(\"boolean\"),\n },\n init: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"WhileStatement\", {\n visitor: [\"test\", \"body\"],\n aliases: [\"Statement\", \"BlockParent\", \"Loop\", \"While\", \"Scopable\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"WithStatement\", {\n visitor: [\"object\", \"body\"],\n aliases: [\"Statement\"],\n fields: {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n","// @flow\nimport defineType, {\n assertShape,\n assertNodeType,\n assertValueType,\n assertNodeOrValueType,\n chain,\n assertEach,\n assertOneOf,\n validateOptional,\n} from \"./utils\";\nimport {\n functionCommon,\n functionTypeAnnotationCommon,\n patternLikeCommon,\n} from \"./core\";\nimport is from \"../validators/is\";\n\ndefineType(\"AssignmentPattern\", {\n visitor: [\"left\", \"right\", \"decorators\" /* for legacy param decorators */],\n builder: [\"left\", \"right\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: {\n ...patternLikeCommon,\n left: {\n validate: assertNodeType(\n \"Identifier\",\n \"ObjectPattern\",\n \"ArrayPattern\",\n \"MemberExpression\",\n ),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n // For TypeScript\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"ArrayPattern\", {\n visitor: [\"elements\", \"typeAnnotation\"],\n builder: [\"elements\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: {\n ...patternLikeCommon,\n elements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeOrValueType(\"null\", \"PatternLike\")),\n ),\n },\n // For TypeScript\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"ArrowFunctionExpression\", {\n builder: [\"params\", \"body\", \"async\"],\n visitor: [\"params\", \"body\", \"returnType\", \"typeParameters\"],\n aliases: [\n \"Scopable\",\n \"Function\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Expression\",\n \"Pureish\",\n ],\n fields: {\n ...functionCommon,\n ...functionTypeAnnotationCommon,\n expression: {\n // https://github.com/babel/babylon/issues/505\n validate: assertValueType(\"boolean\"),\n },\n body: {\n validate: assertNodeType(\"BlockStatement\", \"Expression\"),\n },\n },\n});\n\ndefineType(\"ClassBody\", {\n visitor: [\"body\"],\n fields: {\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"ClassMethod\",\n \"ClassPrivateMethod\",\n \"ClassProperty\",\n \"ClassPrivateProperty\",\n \"TSDeclareMethod\",\n \"TSIndexSignature\",\n ),\n ),\n ),\n },\n },\n});\n\ndefineType(\"ClassExpression\", {\n builder: [\"id\", \"superClass\", \"body\", \"decorators\"],\n visitor: [\n \"id\",\n \"body\",\n \"superClass\",\n \"mixins\",\n \"typeParameters\",\n \"superTypeParameters\",\n \"implements\",\n \"decorators\",\n ],\n aliases: [\"Scopable\", \"Class\", \"Expression\", \"Pureish\"],\n fields: {\n id: {\n validate: assertNodeType(\"Identifier\"),\n // In declarations, this is missing if this is the\n // child of an ExportDefaultDeclaration.\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterDeclaration\",\n \"TSTypeParameterDeclaration\",\n \"Noop\",\n ),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"ClassBody\"),\n },\n superClass: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n superTypeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n implements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\"TSExpressionWithTypeArguments\", \"ClassImplements\"),\n ),\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassDeclaration\", {\n inherits: \"ClassExpression\",\n aliases: [\"Scopable\", \"Class\", \"Statement\", \"Declaration\", \"Pureish\"],\n fields: {\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n abstract: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n },\n validate: (function() {\n const identifier = assertNodeType(\"Identifier\");\n\n return function(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!is(\"ExportDefaultDeclaration\", parent)) {\n identifier(node, \"id\", node.id);\n }\n };\n })(),\n});\n\ndefineType(\"ExportAllDeclaration\", {\n visitor: [\"source\"],\n aliases: [\n \"Statement\",\n \"Declaration\",\n \"ModuleDeclaration\",\n \"ExportDeclaration\",\n ],\n fields: {\n source: {\n validate: assertNodeType(\"StringLiteral\"),\n },\n },\n});\n\ndefineType(\"ExportDefaultDeclaration\", {\n visitor: [\"declaration\"],\n aliases: [\n \"Statement\",\n \"Declaration\",\n \"ModuleDeclaration\",\n \"ExportDeclaration\",\n ],\n fields: {\n declaration: {\n validate: assertNodeType(\n \"FunctionDeclaration\",\n \"TSDeclareFunction\",\n \"ClassDeclaration\",\n \"Expression\",\n ),\n },\n },\n});\n\ndefineType(\"ExportNamedDeclaration\", {\n visitor: [\"declaration\", \"specifiers\", \"source\"],\n aliases: [\n \"Statement\",\n \"Declaration\",\n \"ModuleDeclaration\",\n \"ExportDeclaration\",\n ],\n fields: {\n declaration: {\n optional: true,\n validate: chain(\n assertNodeType(\"Declaration\"),\n function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n // This validator isn't put at the top level because we can run it\n // even if this node doesn't have a parent.\n\n if (val && node.specifiers.length) {\n throw new TypeError(\n \"Only declaration or specifiers is allowed on ExportNamedDeclaration\",\n );\n }\n },\n function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n // This validator isn't put at the top level because we can run it\n // even if this node doesn't have a parent.\n\n if (val && node.source) {\n throw new TypeError(\"Cannot export a declaration from a source\");\n }\n },\n ),\n },\n specifiers: {\n default: [],\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n (function() {\n const sourced = assertNodeType(\n \"ExportSpecifier\",\n \"ExportDefaultSpecifier\",\n \"ExportNamespaceSpecifier\",\n );\n const sourceless = assertNodeType(\"ExportSpecifier\");\n\n if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;\n\n return function(node, key, val) {\n const validator = node.source ? sourced : sourceless;\n validator(node, key, val);\n };\n })(),\n ),\n ),\n },\n source: {\n validate: assertNodeType(\"StringLiteral\"),\n optional: true,\n },\n exportKind: validateOptional(assertOneOf(\"type\", \"value\")),\n },\n});\n\ndefineType(\"ExportSpecifier\", {\n visitor: [\"local\", \"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n exported: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ForOfStatement\", {\n visitor: [\"left\", \"right\", \"body\"],\n builder: [\"left\", \"right\", \"body\", \"await\"],\n aliases: [\n \"Scopable\",\n \"Statement\",\n \"For\",\n \"BlockParent\",\n \"Loop\",\n \"ForXStatement\",\n ],\n fields: {\n left: {\n validate: (function() {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return assertNodeType(\"VariableDeclaration\", \"LVal\");\n }\n\n const declaration = assertNodeType(\"VariableDeclaration\");\n const lval = assertNodeType(\n \"Identifier\",\n \"MemberExpression\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n );\n\n return function(node, key, val) {\n if (is(\"VariableDeclaration\", val)) {\n declaration(node, key, val);\n } else {\n lval(node, key, val);\n }\n };\n })(),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n await: {\n default: false,\n },\n },\n});\n\ndefineType(\"ImportDeclaration\", {\n visitor: [\"specifiers\", \"source\"],\n aliases: [\"Statement\", \"Declaration\", \"ModuleDeclaration\"],\n fields: {\n specifiers: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"ImportSpecifier\",\n \"ImportDefaultSpecifier\",\n \"ImportNamespaceSpecifier\",\n ),\n ),\n ),\n },\n source: {\n validate: assertNodeType(\"StringLiteral\"),\n },\n importKind: {\n // Handle Flowtype's extension \"import {typeof foo} from\"\n validate: assertOneOf(\"type\", \"typeof\", \"value\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ImportDefaultSpecifier\", {\n visitor: [\"local\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ImportNamespaceSpecifier\", {\n visitor: [\"local\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ImportSpecifier\", {\n visitor: [\"local\", \"imported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n imported: {\n validate: assertNodeType(\"Identifier\"),\n },\n importKind: {\n // Handle Flowtype's extension \"import {typeof foo} from\"\n validate: assertOneOf(\"type\", \"typeof\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"MetaProperty\", {\n visitor: [\"meta\", \"property\"],\n aliases: [\"Expression\"],\n fields: {\n meta: {\n validate: chain(assertNodeType(\"Identifier\"), function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n let property;\n switch (val.name) {\n case \"function\":\n property = \"sent\";\n break;\n case \"new\":\n property = \"target\";\n break;\n case \"import\":\n property = \"meta\";\n break;\n }\n if (!is(\"Identifier\", node.property, { name: property })) {\n throw new TypeError(\"Unrecognised MetaProperty\");\n }\n }),\n },\n property: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\nexport const classMethodOrPropertyCommon = {\n abstract: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n accessibility: {\n validate: assertOneOf(\"public\", \"private\", \"protected\"),\n optional: true,\n },\n static: {\n default: false,\n },\n computed: {\n default: false,\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n key: {\n validate: chain(\n (function() {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n );\n const computed = assertNodeType(\"Expression\");\n\n return function(node: Object, key: string, val: any) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"Expression\",\n ),\n ),\n },\n};\n\nexport const classMethodOrDeclareMethodCommon = {\n ...functionCommon,\n ...classMethodOrPropertyCommon,\n kind: {\n validate: assertOneOf(\"get\", \"set\", \"method\", \"constructor\"),\n default: \"method\",\n },\n access: {\n validate: chain(\n assertValueType(\"string\"),\n assertOneOf(\"public\", \"private\", \"protected\"),\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n};\n\ndefineType(\"ClassMethod\", {\n aliases: [\"Function\", \"Scopable\", \"BlockParent\", \"FunctionParent\", \"Method\"],\n builder: [\n \"kind\",\n \"key\",\n \"params\",\n \"body\",\n \"computed\",\n \"static\",\n \"generator\",\n \"async\",\n ],\n visitor: [\n \"key\",\n \"params\",\n \"body\",\n \"decorators\",\n \"returnType\",\n \"typeParameters\",\n ],\n fields: {\n ...classMethodOrDeclareMethodCommon,\n ...functionTypeAnnotationCommon,\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"ObjectPattern\", {\n visitor: [\n \"properties\",\n \"typeAnnotation\",\n \"decorators\" /* for legacy param decorators */,\n ],\n builder: [\"properties\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: {\n ...patternLikeCommon,\n properties: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"RestElement\", \"ObjectProperty\")),\n ),\n },\n },\n});\n\ndefineType(\"SpreadElement\", {\n visitor: [\"argument\"],\n aliases: [\"UnaryLike\"],\n deprecatedAlias: \"SpreadProperty\",\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"Super\", {\n aliases: [\"Expression\"],\n});\n\ndefineType(\"TaggedTemplateExpression\", {\n visitor: [\"tag\", \"quasi\"],\n aliases: [\"Expression\"],\n fields: {\n tag: {\n validate: assertNodeType(\"Expression\"),\n },\n quasi: {\n validate: assertNodeType(\"TemplateLiteral\"),\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"TemplateElement\", {\n builder: [\"value\", \"tail\"],\n fields: {\n value: {\n validate: assertShape({\n raw: {\n validate: assertValueType(\"string\"),\n },\n cooked: {\n validate: assertValueType(\"string\"),\n optional: true,\n },\n }),\n },\n tail: {\n default: false,\n },\n },\n});\n\ndefineType(\"TemplateLiteral\", {\n visitor: [\"quasis\", \"expressions\"],\n aliases: [\"Expression\", \"Literal\"],\n fields: {\n quasis: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"TemplateElement\")),\n ),\n },\n expressions: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Expression\")),\n function(node, key, val) {\n if (node.quasis.length !== val.length + 1) {\n throw new TypeError(\n `Number of ${\n node.type\n } quasis should be exactly one more than the number of expressions.\\nExpected ${val.length +\n 1} quasis but got ${node.quasis.length}`,\n );\n }\n },\n ),\n },\n },\n});\n\ndefineType(\"YieldExpression\", {\n builder: [\"argument\", \"delegate\"],\n visitor: [\"argument\"],\n aliases: [\"Expression\", \"Terminatorless\"],\n fields: {\n delegate: {\n validate: chain(assertValueType(\"boolean\"), function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && !node.argument) {\n throw new TypeError(\n \"Property delegate of YieldExpression cannot be true if there is no argument\",\n );\n }\n }),\n default: false,\n },\n argument: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n","// @flow\nimport defineType, {\n arrayOfType,\n assertOneOf,\n assertValueType,\n validate,\n validateArrayOfType,\n validateOptional,\n validateOptionalType,\n validateType,\n} from \"./utils\";\n\nconst defineInterfaceishType = (\n name: string,\n typeParameterType: string = \"TypeParameterDeclaration\",\n) => {\n defineType(name, {\n builder: [\"id\", \"typeParameters\", \"extends\", \"body\"],\n visitor: [\n \"id\",\n \"typeParameters\",\n \"extends\",\n \"mixins\",\n \"implements\",\n \"body\",\n ],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(typeParameterType),\n extends: validateOptional(arrayOfType(\"InterfaceExtends\")),\n mixins: validateOptional(arrayOfType(\"InterfaceExtends\")),\n implements: validateOptional(arrayOfType(\"ClassImplements\")),\n body: validateType(\"ObjectTypeAnnotation\"),\n },\n });\n};\n\ndefineType(\"AnyTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ArrayTypeAnnotation\", {\n visitor: [\"elementType\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n elementType: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"BooleanTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"BooleanLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n value: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"NullLiteralTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ClassImplements\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"Flow\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterInstantiation\"),\n },\n});\n\ndefineInterfaceishType(\"DeclareClass\");\n\ndefineType(\"DeclareFunction\", {\n visitor: [\"id\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n predicate: validateOptionalType(\"DeclaredPredicate\"),\n },\n});\n\ndefineInterfaceishType(\"DeclareInterface\");\n\ndefineType(\"DeclareModule\", {\n builder: [\"id\", \"body\", \"kind\"],\n visitor: [\"id\", \"body\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType([\"Identifier\", \"StringLiteral\"]),\n body: validateType(\"BlockStatement\"),\n kind: validateOptional(assertOneOf(\"CommonJS\", \"ES\")),\n },\n});\n\ndefineType(\"DeclareModuleExports\", {\n visitor: [\"typeAnnotation\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n typeAnnotation: validateType(\"TypeAnnotation\"),\n },\n});\n\ndefineType(\"DeclareTypeAlias\", {\n visitor: [\"id\", \"typeParameters\", \"right\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n right: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"DeclareOpaqueType\", {\n visitor: [\"id\", \"typeParameters\", \"supertype\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n supertype: validateOptionalType(\"FlowType\"),\n },\n});\n\ndefineType(\"DeclareVariable\", {\n visitor: [\"id\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n },\n});\n\ndefineType(\"DeclareExportDeclaration\", {\n visitor: [\"declaration\", \"specifiers\", \"source\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n declaration: validateOptionalType(\"Flow\"),\n specifiers: validateOptional(\n arrayOfType([\"ExportSpecifier\", \"ExportNamespaceSpecifier\"]),\n ),\n source: validateOptionalType(\"StringLiteral\"),\n default: validateOptional(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"DeclareExportAllDeclaration\", {\n visitor: [\"source\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n source: validateType(\"StringLiteral\"),\n exportKind: validateOptional(assertOneOf(\"type\", \"value\")),\n },\n});\n\ndefineType(\"DeclaredPredicate\", {\n visitor: [\"value\"],\n aliases: [\"Flow\", \"FlowPredicate\"],\n fields: {\n value: validateType(\"Flow\"),\n },\n});\n\ndefineType(\"ExistsTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\"],\n});\n\ndefineType(\"FunctionTypeAnnotation\", {\n visitor: [\"typeParameters\", \"params\", \"rest\", \"returnType\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n params: validate(arrayOfType(\"FunctionTypeParam\")),\n rest: validateOptionalType(\"FunctionTypeParam\"),\n returnType: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"FunctionTypeParam\", {\n visitor: [\"name\", \"typeAnnotation\"],\n aliases: [\"Flow\"],\n fields: {\n name: validateOptionalType(\"Identifier\"),\n typeAnnotation: validateType(\"FlowType\"),\n optional: validateOptional(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"GenericTypeAnnotation\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n id: validateType([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n typeParameters: validateOptionalType(\"TypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"InferredPredicate\", {\n aliases: [\"Flow\", \"FlowPredicate\"],\n});\n\ndefineType(\"InterfaceExtends\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"Flow\"],\n fields: {\n id: validateType([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n typeParameters: validateOptionalType(\"TypeParameterInstantiation\"),\n },\n});\n\ndefineInterfaceishType(\"InterfaceDeclaration\");\n\ndefineType(\"InterfaceTypeAnnotation\", {\n visitor: [\"extends\", \"body\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n extends: validateOptional(arrayOfType(\"InterfaceExtends\")),\n body: validateType(\"ObjectTypeAnnotation\"),\n },\n});\n\ndefineType(\"IntersectionTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n types: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"MixedTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"EmptyTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"NullableTypeAnnotation\", {\n visitor: [\"typeAnnotation\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n typeAnnotation: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"NumberLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n value: validate(assertValueType(\"number\")),\n },\n});\n\ndefineType(\"NumberTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ObjectTypeAnnotation\", {\n visitor: [\"properties\", \"indexers\", \"callProperties\", \"internalSlots\"],\n aliases: [\"Flow\", \"FlowType\"],\n builder: [\n \"properties\",\n \"indexers\",\n \"callProperties\",\n \"internalSlots\",\n \"exact\",\n ],\n fields: {\n properties: validate(\n arrayOfType([\"ObjectTypeProperty\", \"ObjectTypeSpreadProperty\"]),\n ),\n indexers: validateOptional(arrayOfType(\"ObjectTypeIndexer\")),\n callProperties: validateOptional(arrayOfType(\"ObjectTypeCallProperty\")),\n internalSlots: validateOptional(arrayOfType(\"ObjectTypeInternalSlot\")),\n exact: {\n validate: assertValueType(\"boolean\"),\n default: false,\n },\n // If the inexact flag is present then this is an object type, and not a\n // declare class, declare interface, or interface. If it is true, the\n // object uses ... to express that it is inexact.\n inexact: validateOptional(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeInternalSlot\", {\n visitor: [\"id\", \"value\", \"optional\", \"static\", \"method\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n id: validateType(\"Identifier\"),\n value: validateType(\"FlowType\"),\n optional: validate(assertValueType(\"boolean\")),\n static: validate(assertValueType(\"boolean\")),\n method: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeCallProperty\", {\n visitor: [\"value\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n value: validateType(\"FlowType\"),\n static: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeIndexer\", {\n visitor: [\"id\", \"key\", \"value\", \"variance\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n id: validateOptionalType(\"Identifier\"),\n key: validateType(\"FlowType\"),\n value: validateType(\"FlowType\"),\n static: validate(assertValueType(\"boolean\")),\n variance: validateOptionalType(\"Variance\"),\n },\n});\n\ndefineType(\"ObjectTypeProperty\", {\n visitor: [\"key\", \"value\", \"variance\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n key: validateType([\"Identifier\", \"StringLiteral\"]),\n value: validateType(\"FlowType\"),\n kind: validate(assertOneOf(\"init\", \"get\", \"set\")),\n static: validate(assertValueType(\"boolean\")),\n proto: validate(assertValueType(\"boolean\")),\n optional: validate(assertValueType(\"boolean\")),\n variance: validateOptionalType(\"Variance\"),\n },\n});\n\ndefineType(\"ObjectTypeSpreadProperty\", {\n visitor: [\"argument\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n argument: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"OpaqueType\", {\n visitor: [\"id\", \"typeParameters\", \"supertype\", \"impltype\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n supertype: validateOptionalType(\"FlowType\"),\n impltype: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"QualifiedTypeIdentifier\", {\n visitor: [\"id\", \"qualification\"],\n aliases: [\"Flow\"],\n fields: {\n id: validateType(\"Identifier\"),\n qualification: validateType([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n },\n});\n\ndefineType(\"StringLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n value: validate(assertValueType(\"string\")),\n },\n});\n\ndefineType(\"StringTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ThisTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"TupleTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n types: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"TypeofTypeAnnotation\", {\n visitor: [\"argument\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n argument: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"TypeAlias\", {\n visitor: [\"id\", \"typeParameters\", \"right\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n right: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"TypeAnnotation\", {\n aliases: [\"Flow\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"TypeCastExpression\", {\n visitor: [\"expression\", \"typeAnnotation\"],\n aliases: [\"Flow\", \"ExpressionWrapper\", \"Expression\"],\n fields: {\n expression: validateType(\"Expression\"),\n typeAnnotation: validateType(\"TypeAnnotation\"),\n },\n});\n\ndefineType(\"TypeParameter\", {\n aliases: [\"Flow\"],\n visitor: [\"bound\", \"default\", \"variance\"],\n fields: {\n name: validate(assertValueType(\"string\")),\n bound: validateOptionalType(\"TypeAnnotation\"),\n default: validateOptionalType(\"FlowType\"),\n variance: validateOptionalType(\"Variance\"),\n },\n});\n\ndefineType(\"TypeParameterDeclaration\", {\n aliases: [\"Flow\"],\n visitor: [\"params\"],\n fields: {\n params: validate(arrayOfType(\"TypeParameter\")),\n },\n});\n\ndefineType(\"TypeParameterInstantiation\", {\n aliases: [\"Flow\"],\n visitor: [\"params\"],\n fields: {\n params: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"UnionTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n types: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"Variance\", {\n aliases: [\"Flow\"],\n builder: [\"kind\"],\n fields: {\n kind: validate(assertOneOf(\"minus\", \"plus\")),\n },\n});\n\ndefineType(\"VoidTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\n// Enums\ndefineType(\"EnumDeclaration\", {\n aliases: [\"Declaration\"],\n visitor: [\"id\", \"body\"],\n fields: {\n id: validateType(\"Identifier\"),\n body: validateType([\n \"EnumBooleanBody\",\n \"EnumNumberBody\",\n \"EnumStringBody\",\n \"EnumSymbolBody\",\n ]),\n },\n});\n\ndefineType(\"EnumBooleanBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicit: validate(assertValueType(\"boolean\")),\n members: validateArrayOfType(\"EnumBooleanMember\"),\n },\n});\n\ndefineType(\"EnumNumberBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicit: validate(assertValueType(\"boolean\")),\n members: validateArrayOfType(\"EnumNumberMember\"),\n },\n});\n\ndefineType(\"EnumStringBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicit: validate(assertValueType(\"boolean\")),\n members: validateArrayOfType([\"EnumStringMember\", \"EnumDefaultedMember\"]),\n },\n});\n\ndefineType(\"EnumSymbolBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n members: validateArrayOfType(\"EnumDefaultedMember\"),\n },\n});\n\ndefineType(\"EnumBooleanMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\"],\n fields: {\n id: validateType(\"Identifier\"),\n init: validateType(\"BooleanLiteral\"),\n },\n});\n\ndefineType(\"EnumNumberMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\", \"init\"],\n fields: {\n id: validateType(\"Identifier\"),\n init: validateType(\"NumericLiteral\"),\n },\n});\n\ndefineType(\"EnumStringMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\", \"init\"],\n fields: {\n id: validateType(\"Identifier\"),\n init: validateType(\"StringLiteral\"),\n },\n});\n\ndefineType(\"EnumDefaultedMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\"],\n fields: {\n id: validateType(\"Identifier\"),\n },\n});\n","// @flow\nimport defineType, {\n assertNodeType,\n assertValueType,\n chain,\n assertEach,\n} from \"./utils\";\n\ndefineType(\"JSXAttribute\", {\n visitor: [\"name\", \"value\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\"JSXIdentifier\", \"JSXNamespacedName\"),\n },\n value: {\n optional: true,\n validate: assertNodeType(\n \"JSXElement\",\n \"JSXFragment\",\n \"StringLiteral\",\n \"JSXExpressionContainer\",\n ),\n },\n },\n});\n\ndefineType(\"JSXClosingElement\", {\n visitor: [\"name\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\n \"JSXIdentifier\",\n \"JSXMemberExpression\",\n \"JSXNamespacedName\",\n ),\n },\n },\n});\n\ndefineType(\"JSXElement\", {\n builder: [\"openingElement\", \"closingElement\", \"children\", \"selfClosing\"],\n visitor: [\"openingElement\", \"children\", \"closingElement\"],\n aliases: [\"JSX\", \"Immutable\", \"Expression\"],\n fields: {\n openingElement: {\n validate: assertNodeType(\"JSXOpeningElement\"),\n },\n closingElement: {\n optional: true,\n validate: assertNodeType(\"JSXClosingElement\"),\n },\n children: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"JSXText\",\n \"JSXExpressionContainer\",\n \"JSXSpreadChild\",\n \"JSXElement\",\n \"JSXFragment\",\n ),\n ),\n ),\n },\n },\n});\n\ndefineType(\"JSXEmptyExpression\", {\n aliases: [\"JSX\"],\n});\n\ndefineType(\"JSXExpressionContainer\", {\n visitor: [\"expression\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\", \"JSXEmptyExpression\"),\n },\n },\n});\n\ndefineType(\"JSXSpreadChild\", {\n visitor: [\"expression\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"JSXIdentifier\", {\n builder: [\"name\"],\n aliases: [\"JSX\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"JSXMemberExpression\", {\n visitor: [\"object\", \"property\"],\n aliases: [\"JSX\"],\n fields: {\n object: {\n validate: assertNodeType(\"JSXMemberExpression\", \"JSXIdentifier\"),\n },\n property: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n },\n});\n\ndefineType(\"JSXNamespacedName\", {\n visitor: [\"namespace\", \"name\"],\n aliases: [\"JSX\"],\n fields: {\n namespace: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n name: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n },\n});\n\ndefineType(\"JSXOpeningElement\", {\n builder: [\"name\", \"attributes\", \"selfClosing\"],\n visitor: [\"name\", \"attributes\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\n \"JSXIdentifier\",\n \"JSXMemberExpression\",\n \"JSXNamespacedName\",\n ),\n },\n selfClosing: {\n default: false,\n },\n attributes: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"JSXAttribute\", \"JSXSpreadAttribute\")),\n ),\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"JSXSpreadAttribute\", {\n visitor: [\"argument\"],\n aliases: [\"JSX\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"JSXText\", {\n aliases: [\"JSX\", \"Immutable\"],\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"JSXFragment\", {\n builder: [\"openingFragment\", \"closingFragment\", \"children\"],\n visitor: [\"openingFragment\", \"children\", \"closingFragment\"],\n aliases: [\"JSX\", \"Immutable\", \"Expression\"],\n fields: {\n openingFragment: {\n validate: assertNodeType(\"JSXOpeningFragment\"),\n },\n closingFragment: {\n validate: assertNodeType(\"JSXClosingFragment\"),\n },\n children: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"JSXText\",\n \"JSXExpressionContainer\",\n \"JSXSpreadChild\",\n \"JSXElement\",\n \"JSXFragment\",\n ),\n ),\n ),\n },\n },\n});\n\ndefineType(\"JSXOpeningFragment\", {\n aliases: [\"JSX\", \"Immutable\"],\n});\n\ndefineType(\"JSXClosingFragment\", {\n aliases: [\"JSX\", \"Immutable\"],\n});\n","import { ALIAS_KEYS } from \"./utils\";\n\nexport const PLACEHOLDERS = [\n \"Identifier\",\n \"StringLiteral\",\n \"Expression\",\n \"Statement\",\n \"Declaration\",\n \"BlockStatement\",\n \"ClassBody\",\n \"Pattern\",\n];\n\nexport const PLACEHOLDERS_ALIAS: { [string]: Array } = {\n Declaration: [\"Statement\"],\n Pattern: [\"PatternLike\", \"LVal\"],\n};\n\nfor (const type of PLACEHOLDERS) {\n const alias = ALIAS_KEYS[type];\n if (alias && alias.length) PLACEHOLDERS_ALIAS[type] = alias;\n}\n\nexport const PLACEHOLDERS_FLIPPED_ALIAS: { [string]: Array } = {};\n\nObject.keys(PLACEHOLDERS_ALIAS).forEach(type => {\n PLACEHOLDERS_ALIAS[type].forEach(alias => {\n if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {\n PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];\n }\n PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);\n });\n});\n","// @flow\nimport defineType, {\n assertNodeType,\n assertOneOf,\n assertValueType,\n} from \"./utils\";\nimport { PLACEHOLDERS } from \"./placeholders\";\n\ndefineType(\"Noop\", {\n visitor: [],\n});\n\ndefineType(\"Placeholder\", {\n visitor: [],\n builder: [\"expectedNode\", \"name\"],\n // aliases: [], defined in placeholders.js\n fields: {\n name: {\n validate: assertNodeType(\"Identifier\"),\n },\n expectedNode: {\n validate: assertOneOf(...PLACEHOLDERS),\n },\n },\n});\n\ndefineType(\"V8IntrinsicIdentifier\", {\n builder: [\"name\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n","// @flow\nimport defineType, {\n assertEach,\n assertNodeType,\n assertValueType,\n chain,\n} from \"./utils\";\nimport {\n classMethodOrPropertyCommon,\n classMethodOrDeclareMethodCommon,\n} from \"./es2015\";\n\ndefineType(\"ArgumentPlaceholder\", {});\n\ndefineType(\"AwaitExpression\", {\n builder: [\"argument\"],\n visitor: [\"argument\"],\n aliases: [\"Expression\", \"Terminatorless\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"BindExpression\", {\n visitor: [\"object\", \"callee\"],\n aliases: [\"Expression\"],\n fields: !process.env.BABEL_TYPES_8_BREAKING\n ? {}\n : {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n callee: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"ClassProperty\", {\n visitor: [\"key\", \"value\", \"typeAnnotation\", \"decorators\"],\n builder: [\n \"key\",\n \"value\",\n \"typeAnnotation\",\n \"decorators\",\n \"computed\",\n \"static\",\n ],\n aliases: [\"Property\"],\n fields: {\n ...classMethodOrPropertyCommon,\n value: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n definite: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n typeAnnotation: {\n validate: assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n readonly: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"OptionalMemberExpression\", {\n builder: [\"object\", \"property\", \"computed\", \"optional\"],\n visitor: [\"object\", \"property\"],\n aliases: [\"Expression\"],\n fields: {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n property: {\n validate: (function() {\n const normal = assertNodeType(\"Identifier\");\n const computed = assertNodeType(\"Expression\");\n\n return function(node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n },\n computed: {\n default: false,\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n },\n },\n});\n\ndefineType(\"PipelineTopicExpression\", {\n builder: [\"expression\"],\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"PipelineBareFunction\", {\n builder: [\"callee\"],\n visitor: [\"callee\"],\n fields: {\n callee: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"PipelinePrimaryTopicReference\", {\n aliases: [\"Expression\"],\n});\n\ndefineType(\"OptionalCallExpression\", {\n visitor: [\"callee\", \"arguments\", \"typeParameters\", \"typeArguments\"],\n builder: [\"callee\", \"arguments\", \"optional\"],\n aliases: [\"Expression\"],\n fields: {\n callee: {\n validate: assertNodeType(\"Expression\"),\n },\n arguments: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\"Expression\", \"SpreadElement\", \"JSXNamespacedName\"),\n ),\n ),\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n },\n typeArguments: {\n validate: assertNodeType(\"TypeParameterInstantiation\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\"TSTypeParameterInstantiation\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassPrivateProperty\", {\n visitor: [\"key\", \"value\", \"decorators\"],\n builder: [\"key\", \"value\", \"decorators\"],\n aliases: [\"Property\", \"Private\"],\n fields: {\n key: {\n validate: assertNodeType(\"PrivateName\"),\n },\n value: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassPrivateMethod\", {\n builder: [\"kind\", \"key\", \"params\", \"body\", \"static\"],\n visitor: [\n \"key\",\n \"params\",\n \"body\",\n \"decorators\",\n \"returnType\",\n \"typeParameters\",\n ],\n aliases: [\n \"Function\",\n \"Scopable\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Method\",\n \"Private\",\n ],\n fields: {\n ...classMethodOrDeclareMethodCommon,\n key: {\n validate: assertNodeType(\"PrivateName\"),\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"Import\", {\n aliases: [\"Expression\"],\n});\n\ndefineType(\"Decorator\", {\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"DoExpression\", {\n visitor: [\"body\"],\n aliases: [\"Expression\"],\n fields: {\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"ExportDefaultSpecifier\", {\n visitor: [\"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n exported: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ExportNamespaceSpecifier\", {\n visitor: [\"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n exported: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"PrivateName\", {\n visitor: [\"id\"],\n aliases: [\"Private\"],\n fields: {\n id: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"BigIntLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n","// @flow\nimport defineType, {\n arrayOfType,\n assertEach,\n assertNodeType,\n assertOneOf,\n assertValueType,\n chain,\n validate,\n validateArrayOfType,\n validateOptional,\n validateOptionalType,\n validateType,\n} from \"./utils\";\nimport { functionDeclarationCommon } from \"./core\";\nimport { classMethodOrDeclareMethodCommon } from \"./es2015\";\n\nconst bool = assertValueType(\"boolean\");\n\nconst tSFunctionTypeAnnotationCommon = {\n returnType: {\n validate: assertNodeType(\"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\"TSTypeParameterDeclaration\", \"Noop\"),\n optional: true,\n },\n};\n\ndefineType(\"TSParameterProperty\", {\n aliases: [\"LVal\"], // TODO: This isn't usable in general as an LVal. Should have a \"Parameter\" alias.\n visitor: [\"parameter\"],\n fields: {\n accessibility: {\n validate: assertOneOf(\"public\", \"private\", \"protected\"),\n optional: true,\n },\n readonly: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n parameter: {\n validate: assertNodeType(\"Identifier\", \"AssignmentPattern\"),\n },\n },\n});\n\ndefineType(\"TSDeclareFunction\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"params\", \"returnType\"],\n fields: {\n ...functionDeclarationCommon,\n ...tSFunctionTypeAnnotationCommon,\n },\n});\n\ndefineType(\"TSDeclareMethod\", {\n visitor: [\"decorators\", \"key\", \"typeParameters\", \"params\", \"returnType\"],\n fields: {\n ...classMethodOrDeclareMethodCommon,\n ...tSFunctionTypeAnnotationCommon,\n },\n});\n\ndefineType(\"TSQualifiedName\", {\n aliases: [\"TSEntityName\"],\n visitor: [\"left\", \"right\"],\n fields: {\n left: validateType(\"TSEntityName\"),\n right: validateType(\"Identifier\"),\n },\n});\n\nconst signatureDeclarationCommon = {\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n parameters: validateArrayOfType([\"Identifier\", \"RestElement\"]),\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n};\n\nconst callConstructSignatureDeclaration = {\n aliases: [\"TSTypeElement\"],\n visitor: [\"typeParameters\", \"parameters\", \"typeAnnotation\"],\n fields: signatureDeclarationCommon,\n};\n\ndefineType(\"TSCallSignatureDeclaration\", callConstructSignatureDeclaration);\ndefineType(\n \"TSConstructSignatureDeclaration\",\n callConstructSignatureDeclaration,\n);\n\nconst namedTypeElementCommon = {\n key: validateType(\"Expression\"),\n computed: validate(bool),\n optional: validateOptional(bool),\n};\n\ndefineType(\"TSPropertySignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"key\", \"typeAnnotation\", \"initializer\"],\n fields: {\n ...namedTypeElementCommon,\n readonly: validateOptional(bool),\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n initializer: validateOptionalType(\"Expression\"),\n },\n});\n\ndefineType(\"TSMethodSignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"key\", \"typeParameters\", \"parameters\", \"typeAnnotation\"],\n fields: {\n ...signatureDeclarationCommon,\n ...namedTypeElementCommon,\n },\n});\n\ndefineType(\"TSIndexSignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"parameters\", \"typeAnnotation\"],\n fields: {\n readonly: validateOptional(bool),\n parameters: validateArrayOfType(\"Identifier\"), // Length must be 1\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n },\n});\n\nconst tsKeywordTypes = [\n \"TSAnyKeyword\",\n \"TSBooleanKeyword\",\n \"TSBigIntKeyword\",\n \"TSNeverKeyword\",\n \"TSNullKeyword\",\n \"TSNumberKeyword\",\n \"TSObjectKeyword\",\n \"TSStringKeyword\",\n \"TSSymbolKeyword\",\n \"TSUndefinedKeyword\",\n \"TSUnknownKeyword\",\n \"TSVoidKeyword\",\n];\n\nfor (const type of tsKeywordTypes) {\n defineType(type, {\n aliases: [\"TSType\"],\n visitor: [],\n fields: {},\n });\n}\n\ndefineType(\"TSThisType\", {\n aliases: [\"TSType\"],\n visitor: [],\n fields: {},\n});\n\nconst fnOrCtr = {\n aliases: [\"TSType\"],\n visitor: [\"typeParameters\", \"parameters\", \"typeAnnotation\"],\n fields: signatureDeclarationCommon,\n};\n\ndefineType(\"TSFunctionType\", fnOrCtr);\ndefineType(\"TSConstructorType\", fnOrCtr);\n\ndefineType(\"TSTypeReference\", {\n aliases: [\"TSType\"],\n visitor: [\"typeName\", \"typeParameters\"],\n fields: {\n typeName: validateType(\"TSEntityName\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSTypePredicate\", {\n aliases: [\"TSType\"],\n visitor: [\"parameterName\", \"typeAnnotation\"],\n builder: [\"parameterName\", \"typeAnnotation\", \"asserts\"],\n fields: {\n parameterName: validateType([\"Identifier\", \"TSThisType\"]),\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n asserts: validateOptional(bool),\n },\n});\n\ndefineType(\"TSTypeQuery\", {\n aliases: [\"TSType\"],\n visitor: [\"exprName\"],\n fields: {\n exprName: validateType([\"TSEntityName\", \"TSImportType\"]),\n },\n});\n\ndefineType(\"TSTypeLiteral\", {\n aliases: [\"TSType\"],\n visitor: [\"members\"],\n fields: {\n members: validateArrayOfType(\"TSTypeElement\"),\n },\n});\n\ndefineType(\"TSArrayType\", {\n aliases: [\"TSType\"],\n visitor: [\"elementType\"],\n fields: {\n elementType: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSTupleType\", {\n aliases: [\"TSType\"],\n visitor: [\"elementTypes\"],\n fields: {\n elementTypes: validateArrayOfType(\"TSType\"),\n },\n});\n\ndefineType(\"TSOptionalType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSRestType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\nconst unionOrIntersection = {\n aliases: [\"TSType\"],\n visitor: [\"types\"],\n fields: {\n types: validateArrayOfType(\"TSType\"),\n },\n};\n\ndefineType(\"TSUnionType\", unionOrIntersection);\ndefineType(\"TSIntersectionType\", unionOrIntersection);\n\ndefineType(\"TSConditionalType\", {\n aliases: [\"TSType\"],\n visitor: [\"checkType\", \"extendsType\", \"trueType\", \"falseType\"],\n fields: {\n checkType: validateType(\"TSType\"),\n extendsType: validateType(\"TSType\"),\n trueType: validateType(\"TSType\"),\n falseType: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSInferType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeParameter\"],\n fields: {\n typeParameter: validateType(\"TSTypeParameter\"),\n },\n});\n\ndefineType(\"TSParenthesizedType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSTypeOperator\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n operator: validate(assertValueType(\"string\")),\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSIndexedAccessType\", {\n aliases: [\"TSType\"],\n visitor: [\"objectType\", \"indexType\"],\n fields: {\n objectType: validateType(\"TSType\"),\n indexType: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSMappedType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeParameter\", \"typeAnnotation\"],\n fields: {\n readonly: validateOptional(bool),\n typeParameter: validateType(\"TSTypeParameter\"),\n optional: validateOptional(bool),\n typeAnnotation: validateOptionalType(\"TSType\"),\n },\n});\n\ndefineType(\"TSLiteralType\", {\n aliases: [\"TSType\"],\n visitor: [\"literal\"],\n fields: {\n literal: validateType([\n \"NumericLiteral\",\n \"StringLiteral\",\n \"BooleanLiteral\",\n ]),\n },\n});\n\ndefineType(\"TSExpressionWithTypeArguments\", {\n aliases: [\"TSType\"],\n visitor: [\"expression\", \"typeParameters\"],\n fields: {\n expression: validateType(\"TSEntityName\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSInterfaceDeclaration\", {\n // \"Statement\" alias prevents a semicolon from appearing after it in an export declaration.\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"extends\", \"body\"],\n fields: {\n declare: validateOptional(bool),\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n extends: validateOptional(arrayOfType(\"TSExpressionWithTypeArguments\")),\n body: validateType(\"TSInterfaceBody\"),\n },\n});\n\ndefineType(\"TSInterfaceBody\", {\n visitor: [\"body\"],\n fields: {\n body: validateArrayOfType(\"TSTypeElement\"),\n },\n});\n\ndefineType(\"TSTypeAliasDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"typeAnnotation\"],\n fields: {\n declare: validateOptional(bool),\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSAsExpression\", {\n aliases: [\"Expression\"],\n visitor: [\"expression\", \"typeAnnotation\"],\n fields: {\n expression: validateType(\"Expression\"),\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSTypeAssertion\", {\n aliases: [\"Expression\"],\n visitor: [\"typeAnnotation\", \"expression\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n expression: validateType(\"Expression\"),\n },\n});\n\ndefineType(\"TSEnumDeclaration\", {\n // \"Statement\" alias prevents a semicolon from appearing after it in an export declaration.\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"members\"],\n fields: {\n declare: validateOptional(bool),\n const: validateOptional(bool),\n id: validateType(\"Identifier\"),\n members: validateArrayOfType(\"TSEnumMember\"),\n initializer: validateOptionalType(\"Expression\"),\n },\n});\n\ndefineType(\"TSEnumMember\", {\n visitor: [\"id\", \"initializer\"],\n fields: {\n id: validateType([\"Identifier\", \"StringLiteral\"]),\n initializer: validateOptionalType(\"Expression\"),\n },\n});\n\ndefineType(\"TSModuleDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"body\"],\n fields: {\n declare: validateOptional(bool),\n global: validateOptional(bool),\n id: validateType([\"Identifier\", \"StringLiteral\"]),\n body: validateType([\"TSModuleBlock\", \"TSModuleDeclaration\"]),\n },\n});\n\ndefineType(\"TSModuleBlock\", {\n aliases: [\"Scopable\", \"Block\", \"BlockParent\"],\n visitor: [\"body\"],\n fields: {\n body: validateArrayOfType(\"Statement\"),\n },\n});\n\ndefineType(\"TSImportType\", {\n aliases: [\"TSType\"],\n visitor: [\"argument\", \"qualifier\", \"typeParameters\"],\n fields: {\n argument: validateType(\"StringLiteral\"),\n qualifier: validateOptionalType(\"TSEntityName\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSImportEqualsDeclaration\", {\n aliases: [\"Statement\"],\n visitor: [\"id\", \"moduleReference\"],\n fields: {\n isExport: validate(bool),\n id: validateType(\"Identifier\"),\n moduleReference: validateType([\n \"TSEntityName\",\n \"TSExternalModuleReference\",\n ]),\n },\n});\n\ndefineType(\"TSExternalModuleReference\", {\n visitor: [\"expression\"],\n fields: {\n expression: validateType(\"StringLiteral\"),\n },\n});\n\ndefineType(\"TSNonNullExpression\", {\n aliases: [\"Expression\"],\n visitor: [\"expression\"],\n fields: {\n expression: validateType(\"Expression\"),\n },\n});\n\ndefineType(\"TSExportAssignment\", {\n aliases: [\"Statement\"],\n visitor: [\"expression\"],\n fields: {\n expression: validateType(\"Expression\"),\n },\n});\n\ndefineType(\"TSNamespaceExportDeclaration\", {\n aliases: [\"Statement\"],\n visitor: [\"id\"],\n fields: {\n id: validateType(\"Identifier\"),\n },\n});\n\ndefineType(\"TSTypeAnnotation\", {\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: {\n validate: assertNodeType(\"TSType\"),\n },\n },\n});\n\ndefineType(\"TSTypeParameterInstantiation\", {\n visitor: [\"params\"],\n fields: {\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"TSType\")),\n ),\n },\n },\n});\n\ndefineType(\"TSTypeParameterDeclaration\", {\n visitor: [\"params\"],\n fields: {\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"TSTypeParameter\")),\n ),\n },\n },\n});\n\ndefineType(\"TSTypeParameter\", {\n builder: [\"constraint\", \"default\", \"name\"],\n visitor: [\"constraint\", \"default\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n constraint: {\n validate: assertNodeType(\"TSType\"),\n optional: true,\n },\n default: {\n validate: assertNodeType(\"TSType\"),\n optional: true,\n },\n },\n});\n","// @flow\nimport toFastProperties from \"to-fast-properties\";\nimport \"./core\";\nimport \"./es2015\";\nimport \"./flow\";\nimport \"./jsx\";\nimport \"./misc\";\nimport \"./experimental\";\nimport \"./typescript\";\nimport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n} from \"./utils\";\nimport {\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n} from \"./placeholders\";\n\n// We do this here, because at this point the visitor keys should be ready and setup\ntoFastProperties(VISITOR_KEYS);\ntoFastProperties(ALIAS_KEYS);\ntoFastProperties(FLIPPED_ALIAS_KEYS);\ntoFastProperties(NODE_FIELDS);\ntoFastProperties(BUILDER_KEYS);\ntoFastProperties(DEPRECATED_KEYS);\n\ntoFastProperties(PLACEHOLDERS_ALIAS);\ntoFastProperties(PLACEHOLDERS_FLIPPED_ALIAS);\n\nconst TYPES: Array = Object.keys(VISITOR_KEYS)\n .concat(Object.keys(FLIPPED_ALIAS_KEYS))\n .concat(Object.keys(DEPRECATED_KEYS));\n\nexport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n TYPES,\n};\n","// @flow\nimport loClone from \"lodash/clone\";\nimport { NODE_FIELDS, BUILDER_KEYS } from \"../definitions\";\nimport validate from \"../validators/validate\";\n\nexport default function builder(type: string, ...args: Array): Object {\n const keys = BUILDER_KEYS[type];\n const countArgs = args.length;\n if (countArgs > keys.length) {\n throw new Error(\n `${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`,\n );\n }\n\n const node = { type };\n\n let i = 0;\n keys.forEach(key => {\n const field = NODE_FIELDS[type][key];\n\n let arg;\n if (i < countArgs) arg = args[i];\n if (arg === undefined) arg = loClone(field.default);\n\n node[key] = arg;\n i++;\n });\n\n for (const key of Object.keys(node)) {\n validate(node, key, node[key]);\n }\n\n return node;\n}\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport builder from \"../builder\";\n\nexport function ArrayExpression(...args: Array): Object {\n return builder(\"ArrayExpression\", ...args);\n}\nexport { ArrayExpression as arrayExpression };\nexport function AssignmentExpression(...args: Array): Object {\n return builder(\"AssignmentExpression\", ...args);\n}\nexport { AssignmentExpression as assignmentExpression };\nexport function BinaryExpression(...args: Array): Object {\n return builder(\"BinaryExpression\", ...args);\n}\nexport { BinaryExpression as binaryExpression };\nexport function InterpreterDirective(...args: Array): Object {\n return builder(\"InterpreterDirective\", ...args);\n}\nexport { InterpreterDirective as interpreterDirective };\nexport function Directive(...args: Array): Object {\n return builder(\"Directive\", ...args);\n}\nexport { Directive as directive };\nexport function DirectiveLiteral(...args: Array): Object {\n return builder(\"DirectiveLiteral\", ...args);\n}\nexport { DirectiveLiteral as directiveLiteral };\nexport function BlockStatement(...args: Array): Object {\n return builder(\"BlockStatement\", ...args);\n}\nexport { BlockStatement as blockStatement };\nexport function BreakStatement(...args: Array): Object {\n return builder(\"BreakStatement\", ...args);\n}\nexport { BreakStatement as breakStatement };\nexport function CallExpression(...args: Array): Object {\n return builder(\"CallExpression\", ...args);\n}\nexport { CallExpression as callExpression };\nexport function CatchClause(...args: Array): Object {\n return builder(\"CatchClause\", ...args);\n}\nexport { CatchClause as catchClause };\nexport function ConditionalExpression(...args: Array): Object {\n return builder(\"ConditionalExpression\", ...args);\n}\nexport { ConditionalExpression as conditionalExpression };\nexport function ContinueStatement(...args: Array): Object {\n return builder(\"ContinueStatement\", ...args);\n}\nexport { ContinueStatement as continueStatement };\nexport function DebuggerStatement(...args: Array): Object {\n return builder(\"DebuggerStatement\", ...args);\n}\nexport { DebuggerStatement as debuggerStatement };\nexport function DoWhileStatement(...args: Array): Object {\n return builder(\"DoWhileStatement\", ...args);\n}\nexport { DoWhileStatement as doWhileStatement };\nexport function EmptyStatement(...args: Array): Object {\n return builder(\"EmptyStatement\", ...args);\n}\nexport { EmptyStatement as emptyStatement };\nexport function ExpressionStatement(...args: Array): Object {\n return builder(\"ExpressionStatement\", ...args);\n}\nexport { ExpressionStatement as expressionStatement };\nexport function File(...args: Array): Object {\n return builder(\"File\", ...args);\n}\nexport { File as file };\nexport function ForInStatement(...args: Array): Object {\n return builder(\"ForInStatement\", ...args);\n}\nexport { ForInStatement as forInStatement };\nexport function ForStatement(...args: Array): Object {\n return builder(\"ForStatement\", ...args);\n}\nexport { ForStatement as forStatement };\nexport function FunctionDeclaration(...args: Array): Object {\n return builder(\"FunctionDeclaration\", ...args);\n}\nexport { FunctionDeclaration as functionDeclaration };\nexport function FunctionExpression(...args: Array): Object {\n return builder(\"FunctionExpression\", ...args);\n}\nexport { FunctionExpression as functionExpression };\nexport function Identifier(...args: Array): Object {\n return builder(\"Identifier\", ...args);\n}\nexport { Identifier as identifier };\nexport function IfStatement(...args: Array): Object {\n return builder(\"IfStatement\", ...args);\n}\nexport { IfStatement as ifStatement };\nexport function LabeledStatement(...args: Array): Object {\n return builder(\"LabeledStatement\", ...args);\n}\nexport { LabeledStatement as labeledStatement };\nexport function StringLiteral(...args: Array): Object {\n return builder(\"StringLiteral\", ...args);\n}\nexport { StringLiteral as stringLiteral };\nexport function NumericLiteral(...args: Array): Object {\n return builder(\"NumericLiteral\", ...args);\n}\nexport { NumericLiteral as numericLiteral };\nexport function NullLiteral(...args: Array): Object {\n return builder(\"NullLiteral\", ...args);\n}\nexport { NullLiteral as nullLiteral };\nexport function BooleanLiteral(...args: Array): Object {\n return builder(\"BooleanLiteral\", ...args);\n}\nexport { BooleanLiteral as booleanLiteral };\nexport function RegExpLiteral(...args: Array): Object {\n return builder(\"RegExpLiteral\", ...args);\n}\nexport { RegExpLiteral as regExpLiteral };\nexport function LogicalExpression(...args: Array): Object {\n return builder(\"LogicalExpression\", ...args);\n}\nexport { LogicalExpression as logicalExpression };\nexport function MemberExpression(...args: Array): Object {\n return builder(\"MemberExpression\", ...args);\n}\nexport { MemberExpression as memberExpression };\nexport function NewExpression(...args: Array): Object {\n return builder(\"NewExpression\", ...args);\n}\nexport { NewExpression as newExpression };\nexport function Program(...args: Array): Object {\n return builder(\"Program\", ...args);\n}\nexport { Program as program };\nexport function ObjectExpression(...args: Array): Object {\n return builder(\"ObjectExpression\", ...args);\n}\nexport { ObjectExpression as objectExpression };\nexport function ObjectMethod(...args: Array): Object {\n return builder(\"ObjectMethod\", ...args);\n}\nexport { ObjectMethod as objectMethod };\nexport function ObjectProperty(...args: Array): Object {\n return builder(\"ObjectProperty\", ...args);\n}\nexport { ObjectProperty as objectProperty };\nexport function RestElement(...args: Array): Object {\n return builder(\"RestElement\", ...args);\n}\nexport { RestElement as restElement };\nexport function ReturnStatement(...args: Array): Object {\n return builder(\"ReturnStatement\", ...args);\n}\nexport { ReturnStatement as returnStatement };\nexport function SequenceExpression(...args: Array): Object {\n return builder(\"SequenceExpression\", ...args);\n}\nexport { SequenceExpression as sequenceExpression };\nexport function ParenthesizedExpression(...args: Array): Object {\n return builder(\"ParenthesizedExpression\", ...args);\n}\nexport { ParenthesizedExpression as parenthesizedExpression };\nexport function SwitchCase(...args: Array): Object {\n return builder(\"SwitchCase\", ...args);\n}\nexport { SwitchCase as switchCase };\nexport function SwitchStatement(...args: Array): Object {\n return builder(\"SwitchStatement\", ...args);\n}\nexport { SwitchStatement as switchStatement };\nexport function ThisExpression(...args: Array): Object {\n return builder(\"ThisExpression\", ...args);\n}\nexport { ThisExpression as thisExpression };\nexport function ThrowStatement(...args: Array): Object {\n return builder(\"ThrowStatement\", ...args);\n}\nexport { ThrowStatement as throwStatement };\nexport function TryStatement(...args: Array): Object {\n return builder(\"TryStatement\", ...args);\n}\nexport { TryStatement as tryStatement };\nexport function UnaryExpression(...args: Array): Object {\n return builder(\"UnaryExpression\", ...args);\n}\nexport { UnaryExpression as unaryExpression };\nexport function UpdateExpression(...args: Array): Object {\n return builder(\"UpdateExpression\", ...args);\n}\nexport { UpdateExpression as updateExpression };\nexport function VariableDeclaration(...args: Array): Object {\n return builder(\"VariableDeclaration\", ...args);\n}\nexport { VariableDeclaration as variableDeclaration };\nexport function VariableDeclarator(...args: Array): Object {\n return builder(\"VariableDeclarator\", ...args);\n}\nexport { VariableDeclarator as variableDeclarator };\nexport function WhileStatement(...args: Array): Object {\n return builder(\"WhileStatement\", ...args);\n}\nexport { WhileStatement as whileStatement };\nexport function WithStatement(...args: Array): Object {\n return builder(\"WithStatement\", ...args);\n}\nexport { WithStatement as withStatement };\nexport function AssignmentPattern(...args: Array): Object {\n return builder(\"AssignmentPattern\", ...args);\n}\nexport { AssignmentPattern as assignmentPattern };\nexport function ArrayPattern(...args: Array): Object {\n return builder(\"ArrayPattern\", ...args);\n}\nexport { ArrayPattern as arrayPattern };\nexport function ArrowFunctionExpression(...args: Array): Object {\n return builder(\"ArrowFunctionExpression\", ...args);\n}\nexport { ArrowFunctionExpression as arrowFunctionExpression };\nexport function ClassBody(...args: Array): Object {\n return builder(\"ClassBody\", ...args);\n}\nexport { ClassBody as classBody };\nexport function ClassExpression(...args: Array): Object {\n return builder(\"ClassExpression\", ...args);\n}\nexport { ClassExpression as classExpression };\nexport function ClassDeclaration(...args: Array): Object {\n return builder(\"ClassDeclaration\", ...args);\n}\nexport { ClassDeclaration as classDeclaration };\nexport function ExportAllDeclaration(...args: Array): Object {\n return builder(\"ExportAllDeclaration\", ...args);\n}\nexport { ExportAllDeclaration as exportAllDeclaration };\nexport function ExportDefaultDeclaration(...args: Array): Object {\n return builder(\"ExportDefaultDeclaration\", ...args);\n}\nexport { ExportDefaultDeclaration as exportDefaultDeclaration };\nexport function ExportNamedDeclaration(...args: Array): Object {\n return builder(\"ExportNamedDeclaration\", ...args);\n}\nexport { ExportNamedDeclaration as exportNamedDeclaration };\nexport function ExportSpecifier(...args: Array): Object {\n return builder(\"ExportSpecifier\", ...args);\n}\nexport { ExportSpecifier as exportSpecifier };\nexport function ForOfStatement(...args: Array): Object {\n return builder(\"ForOfStatement\", ...args);\n}\nexport { ForOfStatement as forOfStatement };\nexport function ImportDeclaration(...args: Array): Object {\n return builder(\"ImportDeclaration\", ...args);\n}\nexport { ImportDeclaration as importDeclaration };\nexport function ImportDefaultSpecifier(...args: Array): Object {\n return builder(\"ImportDefaultSpecifier\", ...args);\n}\nexport { ImportDefaultSpecifier as importDefaultSpecifier };\nexport function ImportNamespaceSpecifier(...args: Array): Object {\n return builder(\"ImportNamespaceSpecifier\", ...args);\n}\nexport { ImportNamespaceSpecifier as importNamespaceSpecifier };\nexport function ImportSpecifier(...args: Array): Object {\n return builder(\"ImportSpecifier\", ...args);\n}\nexport { ImportSpecifier as importSpecifier };\nexport function MetaProperty(...args: Array): Object {\n return builder(\"MetaProperty\", ...args);\n}\nexport { MetaProperty as metaProperty };\nexport function ClassMethod(...args: Array): Object {\n return builder(\"ClassMethod\", ...args);\n}\nexport { ClassMethod as classMethod };\nexport function ObjectPattern(...args: Array): Object {\n return builder(\"ObjectPattern\", ...args);\n}\nexport { ObjectPattern as objectPattern };\nexport function SpreadElement(...args: Array): Object {\n return builder(\"SpreadElement\", ...args);\n}\nexport { SpreadElement as spreadElement };\nexport function Super(...args: Array): Object {\n return builder(\"Super\", ...args);\n}\nexport { Super as super };\nexport function TaggedTemplateExpression(...args: Array): Object {\n return builder(\"TaggedTemplateExpression\", ...args);\n}\nexport { TaggedTemplateExpression as taggedTemplateExpression };\nexport function TemplateElement(...args: Array): Object {\n return builder(\"TemplateElement\", ...args);\n}\nexport { TemplateElement as templateElement };\nexport function TemplateLiteral(...args: Array): Object {\n return builder(\"TemplateLiteral\", ...args);\n}\nexport { TemplateLiteral as templateLiteral };\nexport function YieldExpression(...args: Array): Object {\n return builder(\"YieldExpression\", ...args);\n}\nexport { YieldExpression as yieldExpression };\nexport function AnyTypeAnnotation(...args: Array): Object {\n return builder(\"AnyTypeAnnotation\", ...args);\n}\nexport { AnyTypeAnnotation as anyTypeAnnotation };\nexport function ArrayTypeAnnotation(...args: Array): Object {\n return builder(\"ArrayTypeAnnotation\", ...args);\n}\nexport { ArrayTypeAnnotation as arrayTypeAnnotation };\nexport function BooleanTypeAnnotation(...args: Array): Object {\n return builder(\"BooleanTypeAnnotation\", ...args);\n}\nexport { BooleanTypeAnnotation as booleanTypeAnnotation };\nexport function BooleanLiteralTypeAnnotation(...args: Array): Object {\n return builder(\"BooleanLiteralTypeAnnotation\", ...args);\n}\nexport { BooleanLiteralTypeAnnotation as booleanLiteralTypeAnnotation };\nexport function NullLiteralTypeAnnotation(...args: Array): Object {\n return builder(\"NullLiteralTypeAnnotation\", ...args);\n}\nexport { NullLiteralTypeAnnotation as nullLiteralTypeAnnotation };\nexport function ClassImplements(...args: Array): Object {\n return builder(\"ClassImplements\", ...args);\n}\nexport { ClassImplements as classImplements };\nexport function DeclareClass(...args: Array): Object {\n return builder(\"DeclareClass\", ...args);\n}\nexport { DeclareClass as declareClass };\nexport function DeclareFunction(...args: Array): Object {\n return builder(\"DeclareFunction\", ...args);\n}\nexport { DeclareFunction as declareFunction };\nexport function DeclareInterface(...args: Array): Object {\n return builder(\"DeclareInterface\", ...args);\n}\nexport { DeclareInterface as declareInterface };\nexport function DeclareModule(...args: Array): Object {\n return builder(\"DeclareModule\", ...args);\n}\nexport { DeclareModule as declareModule };\nexport function DeclareModuleExports(...args: Array): Object {\n return builder(\"DeclareModuleExports\", ...args);\n}\nexport { DeclareModuleExports as declareModuleExports };\nexport function DeclareTypeAlias(...args: Array): Object {\n return builder(\"DeclareTypeAlias\", ...args);\n}\nexport { DeclareTypeAlias as declareTypeAlias };\nexport function DeclareOpaqueType(...args: Array): Object {\n return builder(\"DeclareOpaqueType\", ...args);\n}\nexport { DeclareOpaqueType as declareOpaqueType };\nexport function DeclareVariable(...args: Array): Object {\n return builder(\"DeclareVariable\", ...args);\n}\nexport { DeclareVariable as declareVariable };\nexport function DeclareExportDeclaration(...args: Array): Object {\n return builder(\"DeclareExportDeclaration\", ...args);\n}\nexport { DeclareExportDeclaration as declareExportDeclaration };\nexport function DeclareExportAllDeclaration(...args: Array): Object {\n return builder(\"DeclareExportAllDeclaration\", ...args);\n}\nexport { DeclareExportAllDeclaration as declareExportAllDeclaration };\nexport function DeclaredPredicate(...args: Array): Object {\n return builder(\"DeclaredPredicate\", ...args);\n}\nexport { DeclaredPredicate as declaredPredicate };\nexport function ExistsTypeAnnotation(...args: Array): Object {\n return builder(\"ExistsTypeAnnotation\", ...args);\n}\nexport { ExistsTypeAnnotation as existsTypeAnnotation };\nexport function FunctionTypeAnnotation(...args: Array): Object {\n return builder(\"FunctionTypeAnnotation\", ...args);\n}\nexport { FunctionTypeAnnotation as functionTypeAnnotation };\nexport function FunctionTypeParam(...args: Array): Object {\n return builder(\"FunctionTypeParam\", ...args);\n}\nexport { FunctionTypeParam as functionTypeParam };\nexport function GenericTypeAnnotation(...args: Array): Object {\n return builder(\"GenericTypeAnnotation\", ...args);\n}\nexport { GenericTypeAnnotation as genericTypeAnnotation };\nexport function InferredPredicate(...args: Array): Object {\n return builder(\"InferredPredicate\", ...args);\n}\nexport { InferredPredicate as inferredPredicate };\nexport function InterfaceExtends(...args: Array): Object {\n return builder(\"InterfaceExtends\", ...args);\n}\nexport { InterfaceExtends as interfaceExtends };\nexport function InterfaceDeclaration(...args: Array): Object {\n return builder(\"InterfaceDeclaration\", ...args);\n}\nexport { InterfaceDeclaration as interfaceDeclaration };\nexport function InterfaceTypeAnnotation(...args: Array): Object {\n return builder(\"InterfaceTypeAnnotation\", ...args);\n}\nexport { InterfaceTypeAnnotation as interfaceTypeAnnotation };\nexport function IntersectionTypeAnnotation(...args: Array): Object {\n return builder(\"IntersectionTypeAnnotation\", ...args);\n}\nexport { IntersectionTypeAnnotation as intersectionTypeAnnotation };\nexport function MixedTypeAnnotation(...args: Array): Object {\n return builder(\"MixedTypeAnnotation\", ...args);\n}\nexport { MixedTypeAnnotation as mixedTypeAnnotation };\nexport function EmptyTypeAnnotation(...args: Array): Object {\n return builder(\"EmptyTypeAnnotation\", ...args);\n}\nexport { EmptyTypeAnnotation as emptyTypeAnnotation };\nexport function NullableTypeAnnotation(...args: Array): Object {\n return builder(\"NullableTypeAnnotation\", ...args);\n}\nexport { NullableTypeAnnotation as nullableTypeAnnotation };\nexport function NumberLiteralTypeAnnotation(...args: Array): Object {\n return builder(\"NumberLiteralTypeAnnotation\", ...args);\n}\nexport { NumberLiteralTypeAnnotation as numberLiteralTypeAnnotation };\nexport function NumberTypeAnnotation(...args: Array): Object {\n return builder(\"NumberTypeAnnotation\", ...args);\n}\nexport { NumberTypeAnnotation as numberTypeAnnotation };\nexport function ObjectTypeAnnotation(...args: Array): Object {\n return builder(\"ObjectTypeAnnotation\", ...args);\n}\nexport { ObjectTypeAnnotation as objectTypeAnnotation };\nexport function ObjectTypeInternalSlot(...args: Array): Object {\n return builder(\"ObjectTypeInternalSlot\", ...args);\n}\nexport { ObjectTypeInternalSlot as objectTypeInternalSlot };\nexport function ObjectTypeCallProperty(...args: Array): Object {\n return builder(\"ObjectTypeCallProperty\", ...args);\n}\nexport { ObjectTypeCallProperty as objectTypeCallProperty };\nexport function ObjectTypeIndexer(...args: Array): Object {\n return builder(\"ObjectTypeIndexer\", ...args);\n}\nexport { ObjectTypeIndexer as objectTypeIndexer };\nexport function ObjectTypeProperty(...args: Array): Object {\n return builder(\"ObjectTypeProperty\", ...args);\n}\nexport { ObjectTypeProperty as objectTypeProperty };\nexport function ObjectTypeSpreadProperty(...args: Array): Object {\n return builder(\"ObjectTypeSpreadProperty\", ...args);\n}\nexport { ObjectTypeSpreadProperty as objectTypeSpreadProperty };\nexport function OpaqueType(...args: Array): Object {\n return builder(\"OpaqueType\", ...args);\n}\nexport { OpaqueType as opaqueType };\nexport function QualifiedTypeIdentifier(...args: Array): Object {\n return builder(\"QualifiedTypeIdentifier\", ...args);\n}\nexport { QualifiedTypeIdentifier as qualifiedTypeIdentifier };\nexport function StringLiteralTypeAnnotation(...args: Array): Object {\n return builder(\"StringLiteralTypeAnnotation\", ...args);\n}\nexport { StringLiteralTypeAnnotation as stringLiteralTypeAnnotation };\nexport function StringTypeAnnotation(...args: Array): Object {\n return builder(\"StringTypeAnnotation\", ...args);\n}\nexport { StringTypeAnnotation as stringTypeAnnotation };\nexport function ThisTypeAnnotation(...args: Array): Object {\n return builder(\"ThisTypeAnnotation\", ...args);\n}\nexport { ThisTypeAnnotation as thisTypeAnnotation };\nexport function TupleTypeAnnotation(...args: Array): Object {\n return builder(\"TupleTypeAnnotation\", ...args);\n}\nexport { TupleTypeAnnotation as tupleTypeAnnotation };\nexport function TypeofTypeAnnotation(...args: Array): Object {\n return builder(\"TypeofTypeAnnotation\", ...args);\n}\nexport { TypeofTypeAnnotation as typeofTypeAnnotation };\nexport function TypeAlias(...args: Array): Object {\n return builder(\"TypeAlias\", ...args);\n}\nexport { TypeAlias as typeAlias };\nexport function TypeAnnotation(...args: Array): Object {\n return builder(\"TypeAnnotation\", ...args);\n}\nexport { TypeAnnotation as typeAnnotation };\nexport function TypeCastExpression(...args: Array): Object {\n return builder(\"TypeCastExpression\", ...args);\n}\nexport { TypeCastExpression as typeCastExpression };\nexport function TypeParameter(...args: Array): Object {\n return builder(\"TypeParameter\", ...args);\n}\nexport { TypeParameter as typeParameter };\nexport function TypeParameterDeclaration(...args: Array): Object {\n return builder(\"TypeParameterDeclaration\", ...args);\n}\nexport { TypeParameterDeclaration as typeParameterDeclaration };\nexport function TypeParameterInstantiation(...args: Array): Object {\n return builder(\"TypeParameterInstantiation\", ...args);\n}\nexport { TypeParameterInstantiation as typeParameterInstantiation };\nexport function UnionTypeAnnotation(...args: Array): Object {\n return builder(\"UnionTypeAnnotation\", ...args);\n}\nexport { UnionTypeAnnotation as unionTypeAnnotation };\nexport function Variance(...args: Array): Object {\n return builder(\"Variance\", ...args);\n}\nexport { Variance as variance };\nexport function VoidTypeAnnotation(...args: Array): Object {\n return builder(\"VoidTypeAnnotation\", ...args);\n}\nexport { VoidTypeAnnotation as voidTypeAnnotation };\nexport function EnumDeclaration(...args: Array): Object {\n return builder(\"EnumDeclaration\", ...args);\n}\nexport { EnumDeclaration as enumDeclaration };\nexport function EnumBooleanBody(...args: Array): Object {\n return builder(\"EnumBooleanBody\", ...args);\n}\nexport { EnumBooleanBody as enumBooleanBody };\nexport function EnumNumberBody(...args: Array): Object {\n return builder(\"EnumNumberBody\", ...args);\n}\nexport { EnumNumberBody as enumNumberBody };\nexport function EnumStringBody(...args: Array): Object {\n return builder(\"EnumStringBody\", ...args);\n}\nexport { EnumStringBody as enumStringBody };\nexport function EnumSymbolBody(...args: Array): Object {\n return builder(\"EnumSymbolBody\", ...args);\n}\nexport { EnumSymbolBody as enumSymbolBody };\nexport function EnumBooleanMember(...args: Array): Object {\n return builder(\"EnumBooleanMember\", ...args);\n}\nexport { EnumBooleanMember as enumBooleanMember };\nexport function EnumNumberMember(...args: Array): Object {\n return builder(\"EnumNumberMember\", ...args);\n}\nexport { EnumNumberMember as enumNumberMember };\nexport function EnumStringMember(...args: Array): Object {\n return builder(\"EnumStringMember\", ...args);\n}\nexport { EnumStringMember as enumStringMember };\nexport function EnumDefaultedMember(...args: Array): Object {\n return builder(\"EnumDefaultedMember\", ...args);\n}\nexport { EnumDefaultedMember as enumDefaultedMember };\nexport function JSXAttribute(...args: Array): Object {\n return builder(\"JSXAttribute\", ...args);\n}\nexport { JSXAttribute as jsxAttribute };\nexport { JSXAttribute as jSXAttribute };\nexport function JSXClosingElement(...args: Array): Object {\n return builder(\"JSXClosingElement\", ...args);\n}\nexport { JSXClosingElement as jsxClosingElement };\nexport { JSXClosingElement as jSXClosingElement };\nexport function JSXElement(...args: Array): Object {\n return builder(\"JSXElement\", ...args);\n}\nexport { JSXElement as jsxElement };\nexport { JSXElement as jSXElement };\nexport function JSXEmptyExpression(...args: Array): Object {\n return builder(\"JSXEmptyExpression\", ...args);\n}\nexport { JSXEmptyExpression as jsxEmptyExpression };\nexport { JSXEmptyExpression as jSXEmptyExpression };\nexport function JSXExpressionContainer(...args: Array): Object {\n return builder(\"JSXExpressionContainer\", ...args);\n}\nexport { JSXExpressionContainer as jsxExpressionContainer };\nexport { JSXExpressionContainer as jSXExpressionContainer };\nexport function JSXSpreadChild(...args: Array): Object {\n return builder(\"JSXSpreadChild\", ...args);\n}\nexport { JSXSpreadChild as jsxSpreadChild };\nexport { JSXSpreadChild as jSXSpreadChild };\nexport function JSXIdentifier(...args: Array): Object {\n return builder(\"JSXIdentifier\", ...args);\n}\nexport { JSXIdentifier as jsxIdentifier };\nexport { JSXIdentifier as jSXIdentifier };\nexport function JSXMemberExpression(...args: Array): Object {\n return builder(\"JSXMemberExpression\", ...args);\n}\nexport { JSXMemberExpression as jsxMemberExpression };\nexport { JSXMemberExpression as jSXMemberExpression };\nexport function JSXNamespacedName(...args: Array): Object {\n return builder(\"JSXNamespacedName\", ...args);\n}\nexport { JSXNamespacedName as jsxNamespacedName };\nexport { JSXNamespacedName as jSXNamespacedName };\nexport function JSXOpeningElement(...args: Array): Object {\n return builder(\"JSXOpeningElement\", ...args);\n}\nexport { JSXOpeningElement as jsxOpeningElement };\nexport { JSXOpeningElement as jSXOpeningElement };\nexport function JSXSpreadAttribute(...args: Array): Object {\n return builder(\"JSXSpreadAttribute\", ...args);\n}\nexport { JSXSpreadAttribute as jsxSpreadAttribute };\nexport { JSXSpreadAttribute as jSXSpreadAttribute };\nexport function JSXText(...args: Array): Object {\n return builder(\"JSXText\", ...args);\n}\nexport { JSXText as jsxText };\nexport { JSXText as jSXText };\nexport function JSXFragment(...args: Array): Object {\n return builder(\"JSXFragment\", ...args);\n}\nexport { JSXFragment as jsxFragment };\nexport { JSXFragment as jSXFragment };\nexport function JSXOpeningFragment(...args: Array): Object {\n return builder(\"JSXOpeningFragment\", ...args);\n}\nexport { JSXOpeningFragment as jsxOpeningFragment };\nexport { JSXOpeningFragment as jSXOpeningFragment };\nexport function JSXClosingFragment(...args: Array): Object {\n return builder(\"JSXClosingFragment\", ...args);\n}\nexport { JSXClosingFragment as jsxClosingFragment };\nexport { JSXClosingFragment as jSXClosingFragment };\nexport function Noop(...args: Array): Object {\n return builder(\"Noop\", ...args);\n}\nexport { Noop as noop };\nexport function Placeholder(...args: Array): Object {\n return builder(\"Placeholder\", ...args);\n}\nexport { Placeholder as placeholder };\nexport function V8IntrinsicIdentifier(...args: Array): Object {\n return builder(\"V8IntrinsicIdentifier\", ...args);\n}\nexport { V8IntrinsicIdentifier as v8IntrinsicIdentifier };\nexport function ArgumentPlaceholder(...args: Array): Object {\n return builder(\"ArgumentPlaceholder\", ...args);\n}\nexport { ArgumentPlaceholder as argumentPlaceholder };\nexport function AwaitExpression(...args: Array): Object {\n return builder(\"AwaitExpression\", ...args);\n}\nexport { AwaitExpression as awaitExpression };\nexport function BindExpression(...args: Array): Object {\n return builder(\"BindExpression\", ...args);\n}\nexport { BindExpression as bindExpression };\nexport function ClassProperty(...args: Array): Object {\n return builder(\"ClassProperty\", ...args);\n}\nexport { ClassProperty as classProperty };\nexport function OptionalMemberExpression(...args: Array): Object {\n return builder(\"OptionalMemberExpression\", ...args);\n}\nexport { OptionalMemberExpression as optionalMemberExpression };\nexport function PipelineTopicExpression(...args: Array): Object {\n return builder(\"PipelineTopicExpression\", ...args);\n}\nexport { PipelineTopicExpression as pipelineTopicExpression };\nexport function PipelineBareFunction(...args: Array): Object {\n return builder(\"PipelineBareFunction\", ...args);\n}\nexport { PipelineBareFunction as pipelineBareFunction };\nexport function PipelinePrimaryTopicReference(...args: Array): Object {\n return builder(\"PipelinePrimaryTopicReference\", ...args);\n}\nexport { PipelinePrimaryTopicReference as pipelinePrimaryTopicReference };\nexport function OptionalCallExpression(...args: Array): Object {\n return builder(\"OptionalCallExpression\", ...args);\n}\nexport { OptionalCallExpression as optionalCallExpression };\nexport function ClassPrivateProperty(...args: Array): Object {\n return builder(\"ClassPrivateProperty\", ...args);\n}\nexport { ClassPrivateProperty as classPrivateProperty };\nexport function ClassPrivateMethod(...args: Array): Object {\n return builder(\"ClassPrivateMethod\", ...args);\n}\nexport { ClassPrivateMethod as classPrivateMethod };\nexport function Import(...args: Array): Object {\n return builder(\"Import\", ...args);\n}\nexport { Import as import };\nexport function Decorator(...args: Array): Object {\n return builder(\"Decorator\", ...args);\n}\nexport { Decorator as decorator };\nexport function DoExpression(...args: Array): Object {\n return builder(\"DoExpression\", ...args);\n}\nexport { DoExpression as doExpression };\nexport function ExportDefaultSpecifier(...args: Array): Object {\n return builder(\"ExportDefaultSpecifier\", ...args);\n}\nexport { ExportDefaultSpecifier as exportDefaultSpecifier };\nexport function ExportNamespaceSpecifier(...args: Array): Object {\n return builder(\"ExportNamespaceSpecifier\", ...args);\n}\nexport { ExportNamespaceSpecifier as exportNamespaceSpecifier };\nexport function PrivateName(...args: Array): Object {\n return builder(\"PrivateName\", ...args);\n}\nexport { PrivateName as privateName };\nexport function BigIntLiteral(...args: Array): Object {\n return builder(\"BigIntLiteral\", ...args);\n}\nexport { BigIntLiteral as bigIntLiteral };\nexport function TSParameterProperty(...args: Array): Object {\n return builder(\"TSParameterProperty\", ...args);\n}\nexport { TSParameterProperty as tsParameterProperty };\nexport { TSParameterProperty as tSParameterProperty };\nexport function TSDeclareFunction(...args: Array): Object {\n return builder(\"TSDeclareFunction\", ...args);\n}\nexport { TSDeclareFunction as tsDeclareFunction };\nexport { TSDeclareFunction as tSDeclareFunction };\nexport function TSDeclareMethod(...args: Array): Object {\n return builder(\"TSDeclareMethod\", ...args);\n}\nexport { TSDeclareMethod as tsDeclareMethod };\nexport { TSDeclareMethod as tSDeclareMethod };\nexport function TSQualifiedName(...args: Array): Object {\n return builder(\"TSQualifiedName\", ...args);\n}\nexport { TSQualifiedName as tsQualifiedName };\nexport { TSQualifiedName as tSQualifiedName };\nexport function TSCallSignatureDeclaration(...args: Array): Object {\n return builder(\"TSCallSignatureDeclaration\", ...args);\n}\nexport { TSCallSignatureDeclaration as tsCallSignatureDeclaration };\nexport { TSCallSignatureDeclaration as tSCallSignatureDeclaration };\nexport function TSConstructSignatureDeclaration(...args: Array): Object {\n return builder(\"TSConstructSignatureDeclaration\", ...args);\n}\nexport { TSConstructSignatureDeclaration as tsConstructSignatureDeclaration };\nexport { TSConstructSignatureDeclaration as tSConstructSignatureDeclaration };\nexport function TSPropertySignature(...args: Array): Object {\n return builder(\"TSPropertySignature\", ...args);\n}\nexport { TSPropertySignature as tsPropertySignature };\nexport { TSPropertySignature as tSPropertySignature };\nexport function TSMethodSignature(...args: Array): Object {\n return builder(\"TSMethodSignature\", ...args);\n}\nexport { TSMethodSignature as tsMethodSignature };\nexport { TSMethodSignature as tSMethodSignature };\nexport function TSIndexSignature(...args: Array): Object {\n return builder(\"TSIndexSignature\", ...args);\n}\nexport { TSIndexSignature as tsIndexSignature };\nexport { TSIndexSignature as tSIndexSignature };\nexport function TSAnyKeyword(...args: Array): Object {\n return builder(\"TSAnyKeyword\", ...args);\n}\nexport { TSAnyKeyword as tsAnyKeyword };\nexport { TSAnyKeyword as tSAnyKeyword };\nexport function TSBooleanKeyword(...args: Array): Object {\n return builder(\"TSBooleanKeyword\", ...args);\n}\nexport { TSBooleanKeyword as tsBooleanKeyword };\nexport { TSBooleanKeyword as tSBooleanKeyword };\nexport function TSBigIntKeyword(...args: Array): Object {\n return builder(\"TSBigIntKeyword\", ...args);\n}\nexport { TSBigIntKeyword as tsBigIntKeyword };\nexport { TSBigIntKeyword as tSBigIntKeyword };\nexport function TSNeverKeyword(...args: Array): Object {\n return builder(\"TSNeverKeyword\", ...args);\n}\nexport { TSNeverKeyword as tsNeverKeyword };\nexport { TSNeverKeyword as tSNeverKeyword };\nexport function TSNullKeyword(...args: Array): Object {\n return builder(\"TSNullKeyword\", ...args);\n}\nexport { TSNullKeyword as tsNullKeyword };\nexport { TSNullKeyword as tSNullKeyword };\nexport function TSNumberKeyword(...args: Array): Object {\n return builder(\"TSNumberKeyword\", ...args);\n}\nexport { TSNumberKeyword as tsNumberKeyword };\nexport { TSNumberKeyword as tSNumberKeyword };\nexport function TSObjectKeyword(...args: Array): Object {\n return builder(\"TSObjectKeyword\", ...args);\n}\nexport { TSObjectKeyword as tsObjectKeyword };\nexport { TSObjectKeyword as tSObjectKeyword };\nexport function TSStringKeyword(...args: Array): Object {\n return builder(\"TSStringKeyword\", ...args);\n}\nexport { TSStringKeyword as tsStringKeyword };\nexport { TSStringKeyword as tSStringKeyword };\nexport function TSSymbolKeyword(...args: Array): Object {\n return builder(\"TSSymbolKeyword\", ...args);\n}\nexport { TSSymbolKeyword as tsSymbolKeyword };\nexport { TSSymbolKeyword as tSSymbolKeyword };\nexport function TSUndefinedKeyword(...args: Array): Object {\n return builder(\"TSUndefinedKeyword\", ...args);\n}\nexport { TSUndefinedKeyword as tsUndefinedKeyword };\nexport { TSUndefinedKeyword as tSUndefinedKeyword };\nexport function TSUnknownKeyword(...args: Array): Object {\n return builder(\"TSUnknownKeyword\", ...args);\n}\nexport { TSUnknownKeyword as tsUnknownKeyword };\nexport { TSUnknownKeyword as tSUnknownKeyword };\nexport function TSVoidKeyword(...args: Array): Object {\n return builder(\"TSVoidKeyword\", ...args);\n}\nexport { TSVoidKeyword as tsVoidKeyword };\nexport { TSVoidKeyword as tSVoidKeyword };\nexport function TSThisType(...args: Array): Object {\n return builder(\"TSThisType\", ...args);\n}\nexport { TSThisType as tsThisType };\nexport { TSThisType as tSThisType };\nexport function TSFunctionType(...args: Array): Object {\n return builder(\"TSFunctionType\", ...args);\n}\nexport { TSFunctionType as tsFunctionType };\nexport { TSFunctionType as tSFunctionType };\nexport function TSConstructorType(...args: Array): Object {\n return builder(\"TSConstructorType\", ...args);\n}\nexport { TSConstructorType as tsConstructorType };\nexport { TSConstructorType as tSConstructorType };\nexport function TSTypeReference(...args: Array): Object {\n return builder(\"TSTypeReference\", ...args);\n}\nexport { TSTypeReference as tsTypeReference };\nexport { TSTypeReference as tSTypeReference };\nexport function TSTypePredicate(...args: Array): Object {\n return builder(\"TSTypePredicate\", ...args);\n}\nexport { TSTypePredicate as tsTypePredicate };\nexport { TSTypePredicate as tSTypePredicate };\nexport function TSTypeQuery(...args: Array): Object {\n return builder(\"TSTypeQuery\", ...args);\n}\nexport { TSTypeQuery as tsTypeQuery };\nexport { TSTypeQuery as tSTypeQuery };\nexport function TSTypeLiteral(...args: Array): Object {\n return builder(\"TSTypeLiteral\", ...args);\n}\nexport { TSTypeLiteral as tsTypeLiteral };\nexport { TSTypeLiteral as tSTypeLiteral };\nexport function TSArrayType(...args: Array): Object {\n return builder(\"TSArrayType\", ...args);\n}\nexport { TSArrayType as tsArrayType };\nexport { TSArrayType as tSArrayType };\nexport function TSTupleType(...args: Array): Object {\n return builder(\"TSTupleType\", ...args);\n}\nexport { TSTupleType as tsTupleType };\nexport { TSTupleType as tSTupleType };\nexport function TSOptionalType(...args: Array): Object {\n return builder(\"TSOptionalType\", ...args);\n}\nexport { TSOptionalType as tsOptionalType };\nexport { TSOptionalType as tSOptionalType };\nexport function TSRestType(...args: Array): Object {\n return builder(\"TSRestType\", ...args);\n}\nexport { TSRestType as tsRestType };\nexport { TSRestType as tSRestType };\nexport function TSUnionType(...args: Array): Object {\n return builder(\"TSUnionType\", ...args);\n}\nexport { TSUnionType as tsUnionType };\nexport { TSUnionType as tSUnionType };\nexport function TSIntersectionType(...args: Array): Object {\n return builder(\"TSIntersectionType\", ...args);\n}\nexport { TSIntersectionType as tsIntersectionType };\nexport { TSIntersectionType as tSIntersectionType };\nexport function TSConditionalType(...args: Array): Object {\n return builder(\"TSConditionalType\", ...args);\n}\nexport { TSConditionalType as tsConditionalType };\nexport { TSConditionalType as tSConditionalType };\nexport function TSInferType(...args: Array): Object {\n return builder(\"TSInferType\", ...args);\n}\nexport { TSInferType as tsInferType };\nexport { TSInferType as tSInferType };\nexport function TSParenthesizedType(...args: Array): Object {\n return builder(\"TSParenthesizedType\", ...args);\n}\nexport { TSParenthesizedType as tsParenthesizedType };\nexport { TSParenthesizedType as tSParenthesizedType };\nexport function TSTypeOperator(...args: Array): Object {\n return builder(\"TSTypeOperator\", ...args);\n}\nexport { TSTypeOperator as tsTypeOperator };\nexport { TSTypeOperator as tSTypeOperator };\nexport function TSIndexedAccessType(...args: Array): Object {\n return builder(\"TSIndexedAccessType\", ...args);\n}\nexport { TSIndexedAccessType as tsIndexedAccessType };\nexport { TSIndexedAccessType as tSIndexedAccessType };\nexport function TSMappedType(...args: Array): Object {\n return builder(\"TSMappedType\", ...args);\n}\nexport { TSMappedType as tsMappedType };\nexport { TSMappedType as tSMappedType };\nexport function TSLiteralType(...args: Array): Object {\n return builder(\"TSLiteralType\", ...args);\n}\nexport { TSLiteralType as tsLiteralType };\nexport { TSLiteralType as tSLiteralType };\nexport function TSExpressionWithTypeArguments(...args: Array): Object {\n return builder(\"TSExpressionWithTypeArguments\", ...args);\n}\nexport { TSExpressionWithTypeArguments as tsExpressionWithTypeArguments };\nexport { TSExpressionWithTypeArguments as tSExpressionWithTypeArguments };\nexport function TSInterfaceDeclaration(...args: Array): Object {\n return builder(\"TSInterfaceDeclaration\", ...args);\n}\nexport { TSInterfaceDeclaration as tsInterfaceDeclaration };\nexport { TSInterfaceDeclaration as tSInterfaceDeclaration };\nexport function TSInterfaceBody(...args: Array): Object {\n return builder(\"TSInterfaceBody\", ...args);\n}\nexport { TSInterfaceBody as tsInterfaceBody };\nexport { TSInterfaceBody as tSInterfaceBody };\nexport function TSTypeAliasDeclaration(...args: Array): Object {\n return builder(\"TSTypeAliasDeclaration\", ...args);\n}\nexport { TSTypeAliasDeclaration as tsTypeAliasDeclaration };\nexport { TSTypeAliasDeclaration as tSTypeAliasDeclaration };\nexport function TSAsExpression(...args: Array): Object {\n return builder(\"TSAsExpression\", ...args);\n}\nexport { TSAsExpression as tsAsExpression };\nexport { TSAsExpression as tSAsExpression };\nexport function TSTypeAssertion(...args: Array): Object {\n return builder(\"TSTypeAssertion\", ...args);\n}\nexport { TSTypeAssertion as tsTypeAssertion };\nexport { TSTypeAssertion as tSTypeAssertion };\nexport function TSEnumDeclaration(...args: Array): Object {\n return builder(\"TSEnumDeclaration\", ...args);\n}\nexport { TSEnumDeclaration as tsEnumDeclaration };\nexport { TSEnumDeclaration as tSEnumDeclaration };\nexport function TSEnumMember(...args: Array): Object {\n return builder(\"TSEnumMember\", ...args);\n}\nexport { TSEnumMember as tsEnumMember };\nexport { TSEnumMember as tSEnumMember };\nexport function TSModuleDeclaration(...args: Array): Object {\n return builder(\"TSModuleDeclaration\", ...args);\n}\nexport { TSModuleDeclaration as tsModuleDeclaration };\nexport { TSModuleDeclaration as tSModuleDeclaration };\nexport function TSModuleBlock(...args: Array): Object {\n return builder(\"TSModuleBlock\", ...args);\n}\nexport { TSModuleBlock as tsModuleBlock };\nexport { TSModuleBlock as tSModuleBlock };\nexport function TSImportType(...args: Array): Object {\n return builder(\"TSImportType\", ...args);\n}\nexport { TSImportType as tsImportType };\nexport { TSImportType as tSImportType };\nexport function TSImportEqualsDeclaration(...args: Array): Object {\n return builder(\"TSImportEqualsDeclaration\", ...args);\n}\nexport { TSImportEqualsDeclaration as tsImportEqualsDeclaration };\nexport { TSImportEqualsDeclaration as tSImportEqualsDeclaration };\nexport function TSExternalModuleReference(...args: Array): Object {\n return builder(\"TSExternalModuleReference\", ...args);\n}\nexport { TSExternalModuleReference as tsExternalModuleReference };\nexport { TSExternalModuleReference as tSExternalModuleReference };\nexport function TSNonNullExpression(...args: Array): Object {\n return builder(\"TSNonNullExpression\", ...args);\n}\nexport { TSNonNullExpression as tsNonNullExpression };\nexport { TSNonNullExpression as tSNonNullExpression };\nexport function TSExportAssignment(...args: Array): Object {\n return builder(\"TSExportAssignment\", ...args);\n}\nexport { TSExportAssignment as tsExportAssignment };\nexport { TSExportAssignment as tSExportAssignment };\nexport function TSNamespaceExportDeclaration(...args: Array): Object {\n return builder(\"TSNamespaceExportDeclaration\", ...args);\n}\nexport { TSNamespaceExportDeclaration as tsNamespaceExportDeclaration };\nexport { TSNamespaceExportDeclaration as tSNamespaceExportDeclaration };\nexport function TSTypeAnnotation(...args: Array): Object {\n return builder(\"TSTypeAnnotation\", ...args);\n}\nexport { TSTypeAnnotation as tsTypeAnnotation };\nexport { TSTypeAnnotation as tSTypeAnnotation };\nexport function TSTypeParameterInstantiation(...args: Array): Object {\n return builder(\"TSTypeParameterInstantiation\", ...args);\n}\nexport { TSTypeParameterInstantiation as tsTypeParameterInstantiation };\nexport { TSTypeParameterInstantiation as tSTypeParameterInstantiation };\nexport function TSTypeParameterDeclaration(...args: Array): Object {\n return builder(\"TSTypeParameterDeclaration\", ...args);\n}\nexport { TSTypeParameterDeclaration as tsTypeParameterDeclaration };\nexport { TSTypeParameterDeclaration as tSTypeParameterDeclaration };\nexport function TSTypeParameter(...args: Array): Object {\n return builder(\"TSTypeParameter\", ...args);\n}\nexport { TSTypeParameter as tsTypeParameter };\nexport { TSTypeParameter as tSTypeParameter };\nexport function NumberLiteral(...args: Array): Object {\n console.trace(\n \"The node type NumberLiteral has been renamed to NumericLiteral\",\n );\n return NumberLiteral(\"NumberLiteral\", ...args);\n}\nexport { NumberLiteral as numberLiteral };\nexport function RegexLiteral(...args: Array): Object {\n console.trace(\"The node type RegexLiteral has been renamed to RegExpLiteral\");\n return RegexLiteral(\"RegexLiteral\", ...args);\n}\nexport { RegexLiteral as regexLiteral };\nexport function RestProperty(...args: Array): Object {\n console.trace(\"The node type RestProperty has been renamed to RestElement\");\n return RestProperty(\"RestProperty\", ...args);\n}\nexport { RestProperty as restProperty };\nexport function SpreadProperty(...args: Array): Object {\n console.trace(\n \"The node type SpreadProperty has been renamed to SpreadElement\",\n );\n return SpreadProperty(\"SpreadProperty\", ...args);\n}\nexport { SpreadProperty as spreadProperty };\n","// @flow\nimport { stringLiteral } from \"../../builders/generated\";\n\nexport default function cleanJSXElementLiteralChild(\n child: { value: string },\n args: Array,\n) {\n const lines = child.value.split(/\\r\\n|\\n|\\r/);\n\n let lastNonEmptyLine = 0;\n\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].match(/[^ \\t]/)) {\n lastNonEmptyLine = i;\n }\n }\n\n let str = \"\";\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n const isFirstLine = i === 0;\n const isLastLine = i === lines.length - 1;\n const isLastNonEmptyLine = i === lastNonEmptyLine;\n\n // replace rendered whitespace tabs with spaces\n let trimmedLine = line.replace(/\\t/g, \" \");\n\n // trim whitespace touching a newline\n if (!isFirstLine) {\n trimmedLine = trimmedLine.replace(/^[ ]+/, \"\");\n }\n\n // trim whitespace touching an endline\n if (!isLastLine) {\n trimmedLine = trimmedLine.replace(/[ ]+$/, \"\");\n }\n\n if (trimmedLine) {\n if (!isLastNonEmptyLine) {\n trimmedLine += \" \";\n }\n\n str += trimmedLine;\n }\n }\n\n if (str) args.push(stringLiteral(str));\n}\n","// @flow\nimport {\n isJSXText,\n isJSXExpressionContainer,\n isJSXEmptyExpression,\n} from \"../../validators/generated\";\nimport cleanJSXElementLiteralChild from \"../../utils/react/cleanJSXElementLiteralChild\";\n\nexport default function buildChildren(node: Object): Array {\n const elements = [];\n\n for (let i = 0; i < node.children.length; i++) {\n let child = node.children[i];\n\n if (isJSXText(child)) {\n cleanJSXElementLiteralChild(child, elements);\n continue;\n }\n\n if (isJSXExpressionContainer(child)) child = child.expression;\n if (isJSXEmptyExpression(child)) continue;\n\n elements.push(child);\n }\n\n return elements;\n}\n","// @flow\nimport { VISITOR_KEYS } from \"../definitions\";\n\nexport default function isNode(node?: Object): boolean {\n return !!(node && VISITOR_KEYS[node.type]);\n}\n","// @flow\nimport isNode from \"../validators/isNode\";\n\nexport default function assertNode(node?: Object): void {\n if (!isNode(node)) {\n const type = (node && node.type) || JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${(type: any)}\"`);\n }\n}\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport is from \"../../validators/is\";\n\nfunction assert(type: string, node: Object, opts?: Object): void {\n if (!is(type, node, opts)) {\n throw new Error(\n `Expected type \"${type}\" with option ${JSON.stringify((opts: any))}, ` +\n `but instead got \"${node.type}\".`,\n );\n }\n}\n\nexport function assertArrayExpression(node: Object, opts?: Object = {}): void {\n assert(\"ArrayExpression\", node, opts);\n}\nexport function assertAssignmentExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"AssignmentExpression\", node, opts);\n}\nexport function assertBinaryExpression(node: Object, opts?: Object = {}): void {\n assert(\"BinaryExpression\", node, opts);\n}\nexport function assertInterpreterDirective(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"InterpreterDirective\", node, opts);\n}\nexport function assertDirective(node: Object, opts?: Object = {}): void {\n assert(\"Directive\", node, opts);\n}\nexport function assertDirectiveLiteral(node: Object, opts?: Object = {}): void {\n assert(\"DirectiveLiteral\", node, opts);\n}\nexport function assertBlockStatement(node: Object, opts?: Object = {}): void {\n assert(\"BlockStatement\", node, opts);\n}\nexport function assertBreakStatement(node: Object, opts?: Object = {}): void {\n assert(\"BreakStatement\", node, opts);\n}\nexport function assertCallExpression(node: Object, opts?: Object = {}): void {\n assert(\"CallExpression\", node, opts);\n}\nexport function assertCatchClause(node: Object, opts?: Object = {}): void {\n assert(\"CatchClause\", node, opts);\n}\nexport function assertConditionalExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ConditionalExpression\", node, opts);\n}\nexport function assertContinueStatement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ContinueStatement\", node, opts);\n}\nexport function assertDebuggerStatement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DebuggerStatement\", node, opts);\n}\nexport function assertDoWhileStatement(node: Object, opts?: Object = {}): void {\n assert(\"DoWhileStatement\", node, opts);\n}\nexport function assertEmptyStatement(node: Object, opts?: Object = {}): void {\n assert(\"EmptyStatement\", node, opts);\n}\nexport function assertExpressionStatement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExpressionStatement\", node, opts);\n}\nexport function assertFile(node: Object, opts?: Object = {}): void {\n assert(\"File\", node, opts);\n}\nexport function assertForInStatement(node: Object, opts?: Object = {}): void {\n assert(\"ForInStatement\", node, opts);\n}\nexport function assertForStatement(node: Object, opts?: Object = {}): void {\n assert(\"ForStatement\", node, opts);\n}\nexport function assertFunctionDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FunctionDeclaration\", node, opts);\n}\nexport function assertFunctionExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FunctionExpression\", node, opts);\n}\nexport function assertIdentifier(node: Object, opts?: Object = {}): void {\n assert(\"Identifier\", node, opts);\n}\nexport function assertIfStatement(node: Object, opts?: Object = {}): void {\n assert(\"IfStatement\", node, opts);\n}\nexport function assertLabeledStatement(node: Object, opts?: Object = {}): void {\n assert(\"LabeledStatement\", node, opts);\n}\nexport function assertStringLiteral(node: Object, opts?: Object = {}): void {\n assert(\"StringLiteral\", node, opts);\n}\nexport function assertNumericLiteral(node: Object, opts?: Object = {}): void {\n assert(\"NumericLiteral\", node, opts);\n}\nexport function assertNullLiteral(node: Object, opts?: Object = {}): void {\n assert(\"NullLiteral\", node, opts);\n}\nexport function assertBooleanLiteral(node: Object, opts?: Object = {}): void {\n assert(\"BooleanLiteral\", node, opts);\n}\nexport function assertRegExpLiteral(node: Object, opts?: Object = {}): void {\n assert(\"RegExpLiteral\", node, opts);\n}\nexport function assertLogicalExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"LogicalExpression\", node, opts);\n}\nexport function assertMemberExpression(node: Object, opts?: Object = {}): void {\n assert(\"MemberExpression\", node, opts);\n}\nexport function assertNewExpression(node: Object, opts?: Object = {}): void {\n assert(\"NewExpression\", node, opts);\n}\nexport function assertProgram(node: Object, opts?: Object = {}): void {\n assert(\"Program\", node, opts);\n}\nexport function assertObjectExpression(node: Object, opts?: Object = {}): void {\n assert(\"ObjectExpression\", node, opts);\n}\nexport function assertObjectMethod(node: Object, opts?: Object = {}): void {\n assert(\"ObjectMethod\", node, opts);\n}\nexport function assertObjectProperty(node: Object, opts?: Object = {}): void {\n assert(\"ObjectProperty\", node, opts);\n}\nexport function assertRestElement(node: Object, opts?: Object = {}): void {\n assert(\"RestElement\", node, opts);\n}\nexport function assertReturnStatement(node: Object, opts?: Object = {}): void {\n assert(\"ReturnStatement\", node, opts);\n}\nexport function assertSequenceExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"SequenceExpression\", node, opts);\n}\nexport function assertParenthesizedExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ParenthesizedExpression\", node, opts);\n}\nexport function assertSwitchCase(node: Object, opts?: Object = {}): void {\n assert(\"SwitchCase\", node, opts);\n}\nexport function assertSwitchStatement(node: Object, opts?: Object = {}): void {\n assert(\"SwitchStatement\", node, opts);\n}\nexport function assertThisExpression(node: Object, opts?: Object = {}): void {\n assert(\"ThisExpression\", node, opts);\n}\nexport function assertThrowStatement(node: Object, opts?: Object = {}): void {\n assert(\"ThrowStatement\", node, opts);\n}\nexport function assertTryStatement(node: Object, opts?: Object = {}): void {\n assert(\"TryStatement\", node, opts);\n}\nexport function assertUnaryExpression(node: Object, opts?: Object = {}): void {\n assert(\"UnaryExpression\", node, opts);\n}\nexport function assertUpdateExpression(node: Object, opts?: Object = {}): void {\n assert(\"UpdateExpression\", node, opts);\n}\nexport function assertVariableDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"VariableDeclaration\", node, opts);\n}\nexport function assertVariableDeclarator(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"VariableDeclarator\", node, opts);\n}\nexport function assertWhileStatement(node: Object, opts?: Object = {}): void {\n assert(\"WhileStatement\", node, opts);\n}\nexport function assertWithStatement(node: Object, opts?: Object = {}): void {\n assert(\"WithStatement\", node, opts);\n}\nexport function assertAssignmentPattern(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"AssignmentPattern\", node, opts);\n}\nexport function assertArrayPattern(node: Object, opts?: Object = {}): void {\n assert(\"ArrayPattern\", node, opts);\n}\nexport function assertArrowFunctionExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ArrowFunctionExpression\", node, opts);\n}\nexport function assertClassBody(node: Object, opts?: Object = {}): void {\n assert(\"ClassBody\", node, opts);\n}\nexport function assertClassExpression(node: Object, opts?: Object = {}): void {\n assert(\"ClassExpression\", node, opts);\n}\nexport function assertClassDeclaration(node: Object, opts?: Object = {}): void {\n assert(\"ClassDeclaration\", node, opts);\n}\nexport function assertExportAllDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportAllDeclaration\", node, opts);\n}\nexport function assertExportDefaultDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportDefaultDeclaration\", node, opts);\n}\nexport function assertExportNamedDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportNamedDeclaration\", node, opts);\n}\nexport function assertExportSpecifier(node: Object, opts?: Object = {}): void {\n assert(\"ExportSpecifier\", node, opts);\n}\nexport function assertForOfStatement(node: Object, opts?: Object = {}): void {\n assert(\"ForOfStatement\", node, opts);\n}\nexport function assertImportDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ImportDeclaration\", node, opts);\n}\nexport function assertImportDefaultSpecifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ImportDefaultSpecifier\", node, opts);\n}\nexport function assertImportNamespaceSpecifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ImportNamespaceSpecifier\", node, opts);\n}\nexport function assertImportSpecifier(node: Object, opts?: Object = {}): void {\n assert(\"ImportSpecifier\", node, opts);\n}\nexport function assertMetaProperty(node: Object, opts?: Object = {}): void {\n assert(\"MetaProperty\", node, opts);\n}\nexport function assertClassMethod(node: Object, opts?: Object = {}): void {\n assert(\"ClassMethod\", node, opts);\n}\nexport function assertObjectPattern(node: Object, opts?: Object = {}): void {\n assert(\"ObjectPattern\", node, opts);\n}\nexport function assertSpreadElement(node: Object, opts?: Object = {}): void {\n assert(\"SpreadElement\", node, opts);\n}\nexport function assertSuper(node: Object, opts?: Object = {}): void {\n assert(\"Super\", node, opts);\n}\nexport function assertTaggedTemplateExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TaggedTemplateExpression\", node, opts);\n}\nexport function assertTemplateElement(node: Object, opts?: Object = {}): void {\n assert(\"TemplateElement\", node, opts);\n}\nexport function assertTemplateLiteral(node: Object, opts?: Object = {}): void {\n assert(\"TemplateLiteral\", node, opts);\n}\nexport function assertYieldExpression(node: Object, opts?: Object = {}): void {\n assert(\"YieldExpression\", node, opts);\n}\nexport function assertAnyTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"AnyTypeAnnotation\", node, opts);\n}\nexport function assertArrayTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ArrayTypeAnnotation\", node, opts);\n}\nexport function assertBooleanTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"BooleanTypeAnnotation\", node, opts);\n}\nexport function assertBooleanLiteralTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"BooleanLiteralTypeAnnotation\", node, opts);\n}\nexport function assertNullLiteralTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"NullLiteralTypeAnnotation\", node, opts);\n}\nexport function assertClassImplements(node: Object, opts?: Object = {}): void {\n assert(\"ClassImplements\", node, opts);\n}\nexport function assertDeclareClass(node: Object, opts?: Object = {}): void {\n assert(\"DeclareClass\", node, opts);\n}\nexport function assertDeclareFunction(node: Object, opts?: Object = {}): void {\n assert(\"DeclareFunction\", node, opts);\n}\nexport function assertDeclareInterface(node: Object, opts?: Object = {}): void {\n assert(\"DeclareInterface\", node, opts);\n}\nexport function assertDeclareModule(node: Object, opts?: Object = {}): void {\n assert(\"DeclareModule\", node, opts);\n}\nexport function assertDeclareModuleExports(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclareModuleExports\", node, opts);\n}\nexport function assertDeclareTypeAlias(node: Object, opts?: Object = {}): void {\n assert(\"DeclareTypeAlias\", node, opts);\n}\nexport function assertDeclareOpaqueType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclareOpaqueType\", node, opts);\n}\nexport function assertDeclareVariable(node: Object, opts?: Object = {}): void {\n assert(\"DeclareVariable\", node, opts);\n}\nexport function assertDeclareExportDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclareExportDeclaration\", node, opts);\n}\nexport function assertDeclareExportAllDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclareExportAllDeclaration\", node, opts);\n}\nexport function assertDeclaredPredicate(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclaredPredicate\", node, opts);\n}\nexport function assertExistsTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExistsTypeAnnotation\", node, opts);\n}\nexport function assertFunctionTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FunctionTypeAnnotation\", node, opts);\n}\nexport function assertFunctionTypeParam(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FunctionTypeParam\", node, opts);\n}\nexport function assertGenericTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"GenericTypeAnnotation\", node, opts);\n}\nexport function assertInferredPredicate(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"InferredPredicate\", node, opts);\n}\nexport function assertInterfaceExtends(node: Object, opts?: Object = {}): void {\n assert(\"InterfaceExtends\", node, opts);\n}\nexport function assertInterfaceDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"InterfaceDeclaration\", node, opts);\n}\nexport function assertInterfaceTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"InterfaceTypeAnnotation\", node, opts);\n}\nexport function assertIntersectionTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"IntersectionTypeAnnotation\", node, opts);\n}\nexport function assertMixedTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"MixedTypeAnnotation\", node, opts);\n}\nexport function assertEmptyTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"EmptyTypeAnnotation\", node, opts);\n}\nexport function assertNullableTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"NullableTypeAnnotation\", node, opts);\n}\nexport function assertNumberLiteralTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"NumberLiteralTypeAnnotation\", node, opts);\n}\nexport function assertNumberTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"NumberTypeAnnotation\", node, opts);\n}\nexport function assertObjectTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeAnnotation\", node, opts);\n}\nexport function assertObjectTypeInternalSlot(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeInternalSlot\", node, opts);\n}\nexport function assertObjectTypeCallProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeCallProperty\", node, opts);\n}\nexport function assertObjectTypeIndexer(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeIndexer\", node, opts);\n}\nexport function assertObjectTypeProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeProperty\", node, opts);\n}\nexport function assertObjectTypeSpreadProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeSpreadProperty\", node, opts);\n}\nexport function assertOpaqueType(node: Object, opts?: Object = {}): void {\n assert(\"OpaqueType\", node, opts);\n}\nexport function assertQualifiedTypeIdentifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"QualifiedTypeIdentifier\", node, opts);\n}\nexport function assertStringLiteralTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"StringLiteralTypeAnnotation\", node, opts);\n}\nexport function assertStringTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"StringTypeAnnotation\", node, opts);\n}\nexport function assertThisTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ThisTypeAnnotation\", node, opts);\n}\nexport function assertTupleTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TupleTypeAnnotation\", node, opts);\n}\nexport function assertTypeofTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TypeofTypeAnnotation\", node, opts);\n}\nexport function assertTypeAlias(node: Object, opts?: Object = {}): void {\n assert(\"TypeAlias\", node, opts);\n}\nexport function assertTypeAnnotation(node: Object, opts?: Object = {}): void {\n assert(\"TypeAnnotation\", node, opts);\n}\nexport function assertTypeCastExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TypeCastExpression\", node, opts);\n}\nexport function assertTypeParameter(node: Object, opts?: Object = {}): void {\n assert(\"TypeParameter\", node, opts);\n}\nexport function assertTypeParameterDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TypeParameterDeclaration\", node, opts);\n}\nexport function assertTypeParameterInstantiation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TypeParameterInstantiation\", node, opts);\n}\nexport function assertUnionTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"UnionTypeAnnotation\", node, opts);\n}\nexport function assertVariance(node: Object, opts?: Object = {}): void {\n assert(\"Variance\", node, opts);\n}\nexport function assertVoidTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"VoidTypeAnnotation\", node, opts);\n}\nexport function assertEnumDeclaration(node: Object, opts?: Object = {}): void {\n assert(\"EnumDeclaration\", node, opts);\n}\nexport function assertEnumBooleanBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumBooleanBody\", node, opts);\n}\nexport function assertEnumNumberBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumNumberBody\", node, opts);\n}\nexport function assertEnumStringBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumStringBody\", node, opts);\n}\nexport function assertEnumSymbolBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumSymbolBody\", node, opts);\n}\nexport function assertEnumBooleanMember(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"EnumBooleanMember\", node, opts);\n}\nexport function assertEnumNumberMember(node: Object, opts?: Object = {}): void {\n assert(\"EnumNumberMember\", node, opts);\n}\nexport function assertEnumStringMember(node: Object, opts?: Object = {}): void {\n assert(\"EnumStringMember\", node, opts);\n}\nexport function assertEnumDefaultedMember(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"EnumDefaultedMember\", node, opts);\n}\nexport function assertJSXAttribute(node: Object, opts?: Object = {}): void {\n assert(\"JSXAttribute\", node, opts);\n}\nexport function assertJSXClosingElement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXClosingElement\", node, opts);\n}\nexport function assertJSXElement(node: Object, opts?: Object = {}): void {\n assert(\"JSXElement\", node, opts);\n}\nexport function assertJSXEmptyExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXEmptyExpression\", node, opts);\n}\nexport function assertJSXExpressionContainer(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXExpressionContainer\", node, opts);\n}\nexport function assertJSXSpreadChild(node: Object, opts?: Object = {}): void {\n assert(\"JSXSpreadChild\", node, opts);\n}\nexport function assertJSXIdentifier(node: Object, opts?: Object = {}): void {\n assert(\"JSXIdentifier\", node, opts);\n}\nexport function assertJSXMemberExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXMemberExpression\", node, opts);\n}\nexport function assertJSXNamespacedName(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXNamespacedName\", node, opts);\n}\nexport function assertJSXOpeningElement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXOpeningElement\", node, opts);\n}\nexport function assertJSXSpreadAttribute(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXSpreadAttribute\", node, opts);\n}\nexport function assertJSXText(node: Object, opts?: Object = {}): void {\n assert(\"JSXText\", node, opts);\n}\nexport function assertJSXFragment(node: Object, opts?: Object = {}): void {\n assert(\"JSXFragment\", node, opts);\n}\nexport function assertJSXOpeningFragment(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXOpeningFragment\", node, opts);\n}\nexport function assertJSXClosingFragment(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXClosingFragment\", node, opts);\n}\nexport function assertNoop(node: Object, opts?: Object = {}): void {\n assert(\"Noop\", node, opts);\n}\nexport function assertPlaceholder(node: Object, opts?: Object = {}): void {\n assert(\"Placeholder\", node, opts);\n}\nexport function assertV8IntrinsicIdentifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"V8IntrinsicIdentifier\", node, opts);\n}\nexport function assertArgumentPlaceholder(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ArgumentPlaceholder\", node, opts);\n}\nexport function assertAwaitExpression(node: Object, opts?: Object = {}): void {\n assert(\"AwaitExpression\", node, opts);\n}\nexport function assertBindExpression(node: Object, opts?: Object = {}): void {\n assert(\"BindExpression\", node, opts);\n}\nexport function assertClassProperty(node: Object, opts?: Object = {}): void {\n assert(\"ClassProperty\", node, opts);\n}\nexport function assertOptionalMemberExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"OptionalMemberExpression\", node, opts);\n}\nexport function assertPipelineTopicExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"PipelineTopicExpression\", node, opts);\n}\nexport function assertPipelineBareFunction(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"PipelineBareFunction\", node, opts);\n}\nexport function assertPipelinePrimaryTopicReference(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"PipelinePrimaryTopicReference\", node, opts);\n}\nexport function assertOptionalCallExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"OptionalCallExpression\", node, opts);\n}\nexport function assertClassPrivateProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ClassPrivateProperty\", node, opts);\n}\nexport function assertClassPrivateMethod(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ClassPrivateMethod\", node, opts);\n}\nexport function assertImport(node: Object, opts?: Object = {}): void {\n assert(\"Import\", node, opts);\n}\nexport function assertDecorator(node: Object, opts?: Object = {}): void {\n assert(\"Decorator\", node, opts);\n}\nexport function assertDoExpression(node: Object, opts?: Object = {}): void {\n assert(\"DoExpression\", node, opts);\n}\nexport function assertExportDefaultSpecifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportDefaultSpecifier\", node, opts);\n}\nexport function assertExportNamespaceSpecifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportNamespaceSpecifier\", node, opts);\n}\nexport function assertPrivateName(node: Object, opts?: Object = {}): void {\n assert(\"PrivateName\", node, opts);\n}\nexport function assertBigIntLiteral(node: Object, opts?: Object = {}): void {\n assert(\"BigIntLiteral\", node, opts);\n}\nexport function assertTSParameterProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSParameterProperty\", node, opts);\n}\nexport function assertTSDeclareFunction(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSDeclareFunction\", node, opts);\n}\nexport function assertTSDeclareMethod(node: Object, opts?: Object = {}): void {\n assert(\"TSDeclareMethod\", node, opts);\n}\nexport function assertTSQualifiedName(node: Object, opts?: Object = {}): void {\n assert(\"TSQualifiedName\", node, opts);\n}\nexport function assertTSCallSignatureDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSCallSignatureDeclaration\", node, opts);\n}\nexport function assertTSConstructSignatureDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSConstructSignatureDeclaration\", node, opts);\n}\nexport function assertTSPropertySignature(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSPropertySignature\", node, opts);\n}\nexport function assertTSMethodSignature(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSMethodSignature\", node, opts);\n}\nexport function assertTSIndexSignature(node: Object, opts?: Object = {}): void {\n assert(\"TSIndexSignature\", node, opts);\n}\nexport function assertTSAnyKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSAnyKeyword\", node, opts);\n}\nexport function assertTSBooleanKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSBooleanKeyword\", node, opts);\n}\nexport function assertTSBigIntKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSBigIntKeyword\", node, opts);\n}\nexport function assertTSNeverKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSNeverKeyword\", node, opts);\n}\nexport function assertTSNullKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSNullKeyword\", node, opts);\n}\nexport function assertTSNumberKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSNumberKeyword\", node, opts);\n}\nexport function assertTSObjectKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSObjectKeyword\", node, opts);\n}\nexport function assertTSStringKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSStringKeyword\", node, opts);\n}\nexport function assertTSSymbolKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSSymbolKeyword\", node, opts);\n}\nexport function assertTSUndefinedKeyword(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSUndefinedKeyword\", node, opts);\n}\nexport function assertTSUnknownKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSUnknownKeyword\", node, opts);\n}\nexport function assertTSVoidKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSVoidKeyword\", node, opts);\n}\nexport function assertTSThisType(node: Object, opts?: Object = {}): void {\n assert(\"TSThisType\", node, opts);\n}\nexport function assertTSFunctionType(node: Object, opts?: Object = {}): void {\n assert(\"TSFunctionType\", node, opts);\n}\nexport function assertTSConstructorType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSConstructorType\", node, opts);\n}\nexport function assertTSTypeReference(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeReference\", node, opts);\n}\nexport function assertTSTypePredicate(node: Object, opts?: Object = {}): void {\n assert(\"TSTypePredicate\", node, opts);\n}\nexport function assertTSTypeQuery(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeQuery\", node, opts);\n}\nexport function assertTSTypeLiteral(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeLiteral\", node, opts);\n}\nexport function assertTSArrayType(node: Object, opts?: Object = {}): void {\n assert(\"TSArrayType\", node, opts);\n}\nexport function assertTSTupleType(node: Object, opts?: Object = {}): void {\n assert(\"TSTupleType\", node, opts);\n}\nexport function assertTSOptionalType(node: Object, opts?: Object = {}): void {\n assert(\"TSOptionalType\", node, opts);\n}\nexport function assertTSRestType(node: Object, opts?: Object = {}): void {\n assert(\"TSRestType\", node, opts);\n}\nexport function assertTSUnionType(node: Object, opts?: Object = {}): void {\n assert(\"TSUnionType\", node, opts);\n}\nexport function assertTSIntersectionType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSIntersectionType\", node, opts);\n}\nexport function assertTSConditionalType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSConditionalType\", node, opts);\n}\nexport function assertTSInferType(node: Object, opts?: Object = {}): void {\n assert(\"TSInferType\", node, opts);\n}\nexport function assertTSParenthesizedType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSParenthesizedType\", node, opts);\n}\nexport function assertTSTypeOperator(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeOperator\", node, opts);\n}\nexport function assertTSIndexedAccessType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSIndexedAccessType\", node, opts);\n}\nexport function assertTSMappedType(node: Object, opts?: Object = {}): void {\n assert(\"TSMappedType\", node, opts);\n}\nexport function assertTSLiteralType(node: Object, opts?: Object = {}): void {\n assert(\"TSLiteralType\", node, opts);\n}\nexport function assertTSExpressionWithTypeArguments(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSExpressionWithTypeArguments\", node, opts);\n}\nexport function assertTSInterfaceDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSInterfaceDeclaration\", node, opts);\n}\nexport function assertTSInterfaceBody(node: Object, opts?: Object = {}): void {\n assert(\"TSInterfaceBody\", node, opts);\n}\nexport function assertTSTypeAliasDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSTypeAliasDeclaration\", node, opts);\n}\nexport function assertTSAsExpression(node: Object, opts?: Object = {}): void {\n assert(\"TSAsExpression\", node, opts);\n}\nexport function assertTSTypeAssertion(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeAssertion\", node, opts);\n}\nexport function assertTSEnumDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSEnumDeclaration\", node, opts);\n}\nexport function assertTSEnumMember(node: Object, opts?: Object = {}): void {\n assert(\"TSEnumMember\", node, opts);\n}\nexport function assertTSModuleDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSModuleDeclaration\", node, opts);\n}\nexport function assertTSModuleBlock(node: Object, opts?: Object = {}): void {\n assert(\"TSModuleBlock\", node, opts);\n}\nexport function assertTSImportType(node: Object, opts?: Object = {}): void {\n assert(\"TSImportType\", node, opts);\n}\nexport function assertTSImportEqualsDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSImportEqualsDeclaration\", node, opts);\n}\nexport function assertTSExternalModuleReference(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSExternalModuleReference\", node, opts);\n}\nexport function assertTSNonNullExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSNonNullExpression\", node, opts);\n}\nexport function assertTSExportAssignment(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSExportAssignment\", node, opts);\n}\nexport function assertTSNamespaceExportDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSNamespaceExportDeclaration\", node, opts);\n}\nexport function assertTSTypeAnnotation(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeAnnotation\", node, opts);\n}\nexport function assertTSTypeParameterInstantiation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSTypeParameterInstantiation\", node, opts);\n}\nexport function assertTSTypeParameterDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSTypeParameterDeclaration\", node, opts);\n}\nexport function assertTSTypeParameter(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeParameter\", node, opts);\n}\nexport function assertExpression(node: Object, opts?: Object = {}): void {\n assert(\"Expression\", node, opts);\n}\nexport function assertBinary(node: Object, opts?: Object = {}): void {\n assert(\"Binary\", node, opts);\n}\nexport function assertScopable(node: Object, opts?: Object = {}): void {\n assert(\"Scopable\", node, opts);\n}\nexport function assertBlockParent(node: Object, opts?: Object = {}): void {\n assert(\"BlockParent\", node, opts);\n}\nexport function assertBlock(node: Object, opts?: Object = {}): void {\n assert(\"Block\", node, opts);\n}\nexport function assertStatement(node: Object, opts?: Object = {}): void {\n assert(\"Statement\", node, opts);\n}\nexport function assertTerminatorless(node: Object, opts?: Object = {}): void {\n assert(\"Terminatorless\", node, opts);\n}\nexport function assertCompletionStatement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"CompletionStatement\", node, opts);\n}\nexport function assertConditional(node: Object, opts?: Object = {}): void {\n assert(\"Conditional\", node, opts);\n}\nexport function assertLoop(node: Object, opts?: Object = {}): void {\n assert(\"Loop\", node, opts);\n}\nexport function assertWhile(node: Object, opts?: Object = {}): void {\n assert(\"While\", node, opts);\n}\nexport function assertExpressionWrapper(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExpressionWrapper\", node, opts);\n}\nexport function assertFor(node: Object, opts?: Object = {}): void {\n assert(\"For\", node, opts);\n}\nexport function assertForXStatement(node: Object, opts?: Object = {}): void {\n assert(\"ForXStatement\", node, opts);\n}\nexport function assertFunction(node: Object, opts?: Object = {}): void {\n assert(\"Function\", node, opts);\n}\nexport function assertFunctionParent(node: Object, opts?: Object = {}): void {\n assert(\"FunctionParent\", node, opts);\n}\nexport function assertPureish(node: Object, opts?: Object = {}): void {\n assert(\"Pureish\", node, opts);\n}\nexport function assertDeclaration(node: Object, opts?: Object = {}): void {\n assert(\"Declaration\", node, opts);\n}\nexport function assertPatternLike(node: Object, opts?: Object = {}): void {\n assert(\"PatternLike\", node, opts);\n}\nexport function assertLVal(node: Object, opts?: Object = {}): void {\n assert(\"LVal\", node, opts);\n}\nexport function assertTSEntityName(node: Object, opts?: Object = {}): void {\n assert(\"TSEntityName\", node, opts);\n}\nexport function assertLiteral(node: Object, opts?: Object = {}): void {\n assert(\"Literal\", node, opts);\n}\nexport function assertImmutable(node: Object, opts?: Object = {}): void {\n assert(\"Immutable\", node, opts);\n}\nexport function assertUserWhitespacable(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"UserWhitespacable\", node, opts);\n}\nexport function assertMethod(node: Object, opts?: Object = {}): void {\n assert(\"Method\", node, opts);\n}\nexport function assertObjectMember(node: Object, opts?: Object = {}): void {\n assert(\"ObjectMember\", node, opts);\n}\nexport function assertProperty(node: Object, opts?: Object = {}): void {\n assert(\"Property\", node, opts);\n}\nexport function assertUnaryLike(node: Object, opts?: Object = {}): void {\n assert(\"UnaryLike\", node, opts);\n}\nexport function assertPattern(node: Object, opts?: Object = {}): void {\n assert(\"Pattern\", node, opts);\n}\nexport function assertClass(node: Object, opts?: Object = {}): void {\n assert(\"Class\", node, opts);\n}\nexport function assertModuleDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ModuleDeclaration\", node, opts);\n}\nexport function assertExportDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportDeclaration\", node, opts);\n}\nexport function assertModuleSpecifier(node: Object, opts?: Object = {}): void {\n assert(\"ModuleSpecifier\", node, opts);\n}\nexport function assertFlow(node: Object, opts?: Object = {}): void {\n assert(\"Flow\", node, opts);\n}\nexport function assertFlowType(node: Object, opts?: Object = {}): void {\n assert(\"FlowType\", node, opts);\n}\nexport function assertFlowBaseAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FlowBaseAnnotation\", node, opts);\n}\nexport function assertFlowDeclaration(node: Object, opts?: Object = {}): void {\n assert(\"FlowDeclaration\", node, opts);\n}\nexport function assertFlowPredicate(node: Object, opts?: Object = {}): void {\n assert(\"FlowPredicate\", node, opts);\n}\nexport function assertEnumBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumBody\", node, opts);\n}\nexport function assertEnumMember(node: Object, opts?: Object = {}): void {\n assert(\"EnumMember\", node, opts);\n}\nexport function assertJSX(node: Object, opts?: Object = {}): void {\n assert(\"JSX\", node, opts);\n}\nexport function assertPrivate(node: Object, opts?: Object = {}): void {\n assert(\"Private\", node, opts);\n}\nexport function assertTSTypeElement(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeElement\", node, opts);\n}\nexport function assertTSType(node: Object, opts?: Object = {}): void {\n assert(\"TSType\", node, opts);\n}\nexport function assertNumberLiteral(node: Object, opts: Object): void {\n console.trace(\n \"The node type NumberLiteral has been renamed to NumericLiteral\",\n );\n assert(\"NumberLiteral\", node, opts);\n}\nexport function assertRegexLiteral(node: Object, opts: Object): void {\n console.trace(\"The node type RegexLiteral has been renamed to RegExpLiteral\");\n assert(\"RegexLiteral\", node, opts);\n}\nexport function assertRestProperty(node: Object, opts: Object): void {\n console.trace(\"The node type RestProperty has been renamed to RestElement\");\n assert(\"RestProperty\", node, opts);\n}\nexport function assertSpreadProperty(node: Object, opts: Object): void {\n console.trace(\n \"The node type SpreadProperty has been renamed to SpreadElement\",\n );\n assert(\"SpreadProperty\", node, opts);\n}\n","// @flow\nimport {\n stringTypeAnnotation,\n numberTypeAnnotation,\n voidTypeAnnotation,\n booleanTypeAnnotation,\n genericTypeAnnotation,\n identifier,\n} from \"../generated\";\n\n/**\n * Create a type annotation based on typeof expression.\n */\nexport default function createTypeAnnotationBasedOnTypeof(\n type: string,\n): Object {\n if (type === \"string\") {\n return stringTypeAnnotation();\n } else if (type === \"number\") {\n return numberTypeAnnotation();\n } else if (type === \"undefined\") {\n return voidTypeAnnotation();\n } else if (type === \"boolean\") {\n return booleanTypeAnnotation();\n } else if (type === \"function\") {\n return genericTypeAnnotation(identifier(\"Function\"));\n } else if (type === \"object\") {\n return genericTypeAnnotation(identifier(\"Object\"));\n } else if (type === \"symbol\") {\n return genericTypeAnnotation(identifier(\"Symbol\"));\n } else {\n throw new Error(\"Invalid typeof value\");\n }\n}\n","// @flow\nimport {\n isAnyTypeAnnotation,\n isGenericTypeAnnotation,\n isUnionTypeAnnotation,\n isFlowBaseAnnotation,\n} from \"../../validators/generated\";\n\n/**\n * Dedupe type annotations.\n */\nexport default function removeTypeDuplicates(\n nodes: Array,\n): Array {\n const generics = {};\n const bases = {};\n\n // store union type groups to circular references\n const typeGroups = [];\n\n const types = [];\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (!node) continue;\n\n // detect duplicates\n if (types.indexOf(node) >= 0) {\n continue;\n }\n\n // this type matches anything\n if (isAnyTypeAnnotation(node)) {\n return [node];\n }\n\n if (isFlowBaseAnnotation(node)) {\n bases[node.type] = node;\n continue;\n }\n\n if (isUnionTypeAnnotation(node)) {\n if (typeGroups.indexOf(node.types) < 0) {\n nodes = nodes.concat(node.types);\n typeGroups.push(node.types);\n }\n continue;\n }\n\n // find a matching generic type and merge and deduplicate the type parameters\n if (isGenericTypeAnnotation(node)) {\n const name = node.id.name;\n\n if (generics[name]) {\n let existing = generics[name];\n if (existing.typeParameters) {\n if (node.typeParameters) {\n existing.typeParameters.params = removeTypeDuplicates(\n existing.typeParameters.params.concat(node.typeParameters.params),\n );\n }\n } else {\n existing = node.typeParameters;\n }\n } else {\n generics[name] = node;\n }\n\n continue;\n }\n\n types.push(node);\n }\n\n // add back in bases\n for (const type of Object.keys(bases)) {\n types.push(bases[type]);\n }\n\n // add back in generics\n for (const name of Object.keys(generics)) {\n types.push(generics[name]);\n }\n\n return types;\n}\n","// @flow\nimport { unionTypeAnnotation } from \"../generated\";\nimport removeTypeDuplicates from \"../../modifications/flow/removeTypeDuplicates\";\n\n/**\n * Takes an array of `types` and flattens them, removing duplicates and\n * returns a `UnionTypeAnnotation` node containg them.\n */\nexport default function createUnionTypeAnnotation(\n types: Array,\n): Object {\n const flattened = removeTypeDuplicates(types);\n\n if (flattened.length === 1) {\n return flattened[0];\n } else {\n return unionTypeAnnotation(flattened);\n }\n}\n","import { NODE_FIELDS } from \"../definitions\";\n\nconst has = Function.call.bind(Object.prototype.hasOwnProperty);\n\nfunction cloneIfNode(obj, deep) {\n if (\n obj &&\n typeof obj.type === \"string\" &&\n // CommentLine and CommentBlock are used in File#comments, but they are\n // not defined in babel-types\n obj.type !== \"CommentLine\" &&\n obj.type !== \"CommentBlock\"\n ) {\n return cloneNode(obj, deep);\n }\n\n return obj;\n}\n\nfunction cloneIfNodeOrArray(obj, deep) {\n if (Array.isArray(obj)) {\n return obj.map(node => cloneIfNode(node, deep));\n }\n return cloneIfNode(obj, deep);\n}\n\n/**\n * Create a clone of a `node` including only properties belonging to the node.\n * If the second parameter is `false`, cloneNode performs a shallow clone.\n */\nexport default function cloneNode(node: T, deep: boolean = true): T {\n if (!node) return node;\n\n const { type } = node;\n const newNode = (({ type }: any): T);\n\n // Special-case identifiers since they are the most cloned nodes.\n if (type === \"Identifier\") {\n newNode.name = node.name;\n\n if (has(node, \"optional\") && typeof node.optional === \"boolean\") {\n newNode.optional = node.optional;\n }\n\n if (has(node, \"typeAnnotation\")) {\n newNode.typeAnnotation = deep\n ? cloneIfNodeOrArray(node.typeAnnotation, true)\n : node.typeAnnotation;\n }\n } else if (!has(NODE_FIELDS, type)) {\n throw new Error(`Unknown node type: \"${type}\"`);\n } else {\n for (const field of Object.keys(NODE_FIELDS[type])) {\n if (has(node, field)) {\n newNode[field] = deep\n ? cloneIfNodeOrArray(node[field], true)\n : node[field];\n }\n }\n }\n\n if (has(node, \"loc\")) {\n newNode.loc = node.loc;\n }\n if (has(node, \"leadingComments\")) {\n newNode.leadingComments = node.leadingComments;\n }\n if (has(node, \"innerComments\")) {\n newNode.innerComments = node.innerComments;\n }\n if (has(node, \"trailingComments\")) {\n newNode.trailingComments = node.trailingComments;\n }\n if (has(node, \"extra\")) {\n newNode.extra = {\n ...node.extra,\n };\n }\n\n return newNode;\n}\n","// @flow\n\nimport cloneNode from \"./cloneNode\";\n\n/**\n * Create a shallow clone of a `node`, including only\n * properties belonging to the node.\n * @deprecated Use t.cloneNode instead.\n */\nexport default function clone(node: T): T {\n return cloneNode(node, /* deep */ false);\n}\n","// @flow\n\nimport cloneNode from \"./cloneNode\";\n\n/**\n * Create a deep clone of a `node` and all of it's child nodes\n * including only properties belonging to the node.\n * @deprecated Use t.cloneNode instead.\n */\nexport default function cloneDeep(node: T): T {\n return cloneNode(node);\n}\n","// @flow\nimport clone from \"./clone\";\n\n/**\n * Create a shallow clone of a `node` excluding `_private` and location properties.\n */\nexport default function cloneWithoutLoc(node: T): T {\n const newNode = clone(node);\n newNode.loc = null;\n\n return newNode;\n}\n","// @flow\n\n/**\n * Add comments of certain type to a node.\n */\nexport default function addComments(\n node: T,\n type: string,\n comments: Array,\n): T {\n if (!comments || !node) return node;\n\n const key = `${type}Comments`;\n\n if (node[key]) {\n if (type === \"leading\") {\n node[key] = comments.concat(node[key]);\n } else {\n node[key] = node[key].concat(comments);\n }\n } else {\n node[key] = comments;\n }\n\n return node;\n}\n","// @flow\nimport addComments from \"./addComments\";\n\n/**\n * Add comment of certain type to a node.\n */\nexport default function addComment(\n node: T,\n type: string,\n content: string,\n line?: boolean,\n): T {\n return addComments(node, type, [\n {\n type: line ? \"CommentLine\" : \"CommentBlock\",\n value: content,\n },\n ]);\n}\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 * 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\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 * 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","/**\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","/**\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 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","// @flow\nimport uniq from \"lodash/uniq\";\n\nexport default function inherit(\n key: string,\n child: Object,\n parent: Object,\n): void {\n if (child && parent) {\n child[key] = uniq([].concat(child[key], parent[key]).filter(Boolean));\n }\n}\n","// @flow\nimport inherit from \"../utils/inherit\";\n\nexport default function inheritInnerComments(\n child: Object,\n parent: Object,\n): void {\n inherit(\"innerComments\", child, parent);\n}\n","// @flow\nimport inherit from \"../utils/inherit\";\n\nexport default function inheritLeadingComments(\n child: Object,\n parent: Object,\n): void {\n inherit(\"leadingComments\", child, parent);\n}\n","// @flow\nimport inherit from \"../utils/inherit\";\n\nexport default function inheritTrailingComments(\n child: Object,\n parent: Object,\n): void {\n inherit(\"trailingComments\", child, parent);\n}\n","// @flow\nimport inheritTrailingComments from \"./inheritTrailingComments\";\nimport inheritLeadingComments from \"./inheritLeadingComments\";\nimport inheritInnerComments from \"./inheritInnerComments\";\n\n/**\n * Inherit all unique comments from `parent` node to `child` node.\n */\nexport default function inheritsComments(\n child: T,\n parent: Object,\n): T {\n inheritTrailingComments(child, parent);\n inheritLeadingComments(child, parent);\n inheritInnerComments(child, parent);\n\n return child;\n}\n","// @flow\nimport { COMMENT_KEYS } from \"../constants\";\n\n/**\n * Remove comment properties from a node.\n */\nexport default function removeComments(node: T): T {\n COMMENT_KEYS.forEach(key => {\n node[key] = null;\n });\n\n return node;\n}\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport { FLIPPED_ALIAS_KEYS } from \"../../definitions\";\n\nexport const EXPRESSION_TYPES = FLIPPED_ALIAS_KEYS[\"Expression\"];\nexport const BINARY_TYPES = FLIPPED_ALIAS_KEYS[\"Binary\"];\nexport const SCOPABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Scopable\"];\nexport const BLOCKPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"BlockParent\"];\nexport const BLOCK_TYPES = FLIPPED_ALIAS_KEYS[\"Block\"];\nexport const STATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"Statement\"];\nexport const TERMINATORLESS_TYPES = FLIPPED_ALIAS_KEYS[\"Terminatorless\"];\nexport const COMPLETIONSTATEMENT_TYPES =\n FLIPPED_ALIAS_KEYS[\"CompletionStatement\"];\nexport const CONDITIONAL_TYPES = FLIPPED_ALIAS_KEYS[\"Conditional\"];\nexport const LOOP_TYPES = FLIPPED_ALIAS_KEYS[\"Loop\"];\nexport const WHILE_TYPES = FLIPPED_ALIAS_KEYS[\"While\"];\nexport const EXPRESSIONWRAPPER_TYPES = FLIPPED_ALIAS_KEYS[\"ExpressionWrapper\"];\nexport const FOR_TYPES = FLIPPED_ALIAS_KEYS[\"For\"];\nexport const FORXSTATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"ForXStatement\"];\nexport const FUNCTION_TYPES = FLIPPED_ALIAS_KEYS[\"Function\"];\nexport const FUNCTIONPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"FunctionParent\"];\nexport const PUREISH_TYPES = FLIPPED_ALIAS_KEYS[\"Pureish\"];\nexport const DECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"Declaration\"];\nexport const PATTERNLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"PatternLike\"];\nexport const LVAL_TYPES = FLIPPED_ALIAS_KEYS[\"LVal\"];\nexport const TSENTITYNAME_TYPES = FLIPPED_ALIAS_KEYS[\"TSEntityName\"];\nexport const LITERAL_TYPES = FLIPPED_ALIAS_KEYS[\"Literal\"];\nexport const IMMUTABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Immutable\"];\nexport const USERWHITESPACABLE_TYPES = FLIPPED_ALIAS_KEYS[\"UserWhitespacable\"];\nexport const METHOD_TYPES = FLIPPED_ALIAS_KEYS[\"Method\"];\nexport const OBJECTMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"ObjectMember\"];\nexport const PROPERTY_TYPES = FLIPPED_ALIAS_KEYS[\"Property\"];\nexport const UNARYLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"UnaryLike\"];\nexport const PATTERN_TYPES = FLIPPED_ALIAS_KEYS[\"Pattern\"];\nexport const CLASS_TYPES = FLIPPED_ALIAS_KEYS[\"Class\"];\nexport const MODULEDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"ModuleDeclaration\"];\nexport const EXPORTDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"ExportDeclaration\"];\nexport const MODULESPECIFIER_TYPES = FLIPPED_ALIAS_KEYS[\"ModuleSpecifier\"];\nexport const FLOW_TYPES = FLIPPED_ALIAS_KEYS[\"Flow\"];\nexport const FLOWTYPE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowType\"];\nexport const FLOWBASEANNOTATION_TYPES =\n FLIPPED_ALIAS_KEYS[\"FlowBaseAnnotation\"];\nexport const FLOWDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"FlowDeclaration\"];\nexport const FLOWPREDICATE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowPredicate\"];\nexport const ENUMBODY_TYPES = FLIPPED_ALIAS_KEYS[\"EnumBody\"];\nexport const ENUMMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"EnumMember\"];\nexport const JSX_TYPES = FLIPPED_ALIAS_KEYS[\"JSX\"];\nexport const PRIVATE_TYPES = FLIPPED_ALIAS_KEYS[\"Private\"];\nexport const TSTYPEELEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"TSTypeElement\"];\nexport const TSTYPE_TYPES = FLIPPED_ALIAS_KEYS[\"TSType\"];\n","// @flow\nimport {\n isBlockStatement,\n isFunction,\n isEmptyStatement,\n isStatement,\n} from \"../validators/generated\";\nimport {\n returnStatement,\n expressionStatement,\n blockStatement,\n} from \"../builders/generated\";\n\nexport default function toBlock(node: Object, parent: Object): Object {\n if (isBlockStatement(node)) {\n return node;\n }\n\n let blockNodes = [];\n\n if (isEmptyStatement(node)) {\n blockNodes = [];\n } else {\n if (!isStatement(node)) {\n if (isFunction(parent)) {\n node = returnStatement(node);\n } else {\n node = expressionStatement(node);\n }\n }\n\n blockNodes = [node];\n }\n\n return blockStatement(blockNodes);\n}\n","// @flow\nimport toBlock from \"./toBlock\";\n\n/**\n * Ensure the `key` (defaults to \"body\") of a `node` is a block.\n * Casting it to a block if it is not.\n *\n * Returns the BlockStatement\n */\nexport default function ensureBlock(\n node: Object,\n key: string = \"body\",\n): Object {\n return (node[key] = toBlock(node[key], node));\n}\n","// @flow\nimport esutils from \"esutils\";\n\n/**\n * Check if the input `name` is a valid identifier name\n * and isn't a reserved word.\n */\nexport default function isValidIdentifier(\n name: string,\n reserved: boolean = true,\n): boolean {\n if (typeof name !== \"string\") return false;\n\n if (reserved) {\n if (esutils.keyword.isReservedWordES6(name, true)) {\n return false;\n } else if (name === \"await\") {\n // invalid in module, valid in script; better be safe (see #4952)\n return false;\n }\n }\n\n return esutils.keyword.isIdentifierNameES6(name);\n}\n","// @flow\nimport isValidIdentifier from \"../validators/isValidIdentifier\";\n\nexport default function toIdentifier(name: string): string {\n name = name + \"\";\n\n // replace all non-valid identifiers with dashes\n name = name.replace(/[^a-zA-Z0-9$_]/g, \"-\");\n\n // remove all dashes and numbers from start of name\n name = name.replace(/^[-0-9]+/, \"\");\n\n // camel case\n name = name.replace(/[-\\s]+(.)?/g, function(match, c) {\n return c ? c.toUpperCase() : \"\";\n });\n\n if (!isValidIdentifier(name)) {\n name = `_${name}`;\n }\n\n return name || \"_\";\n}\n","// @flow\nimport toIdentifier from \"./toIdentifier\";\n\nexport default function toBindingIdentifierName(name: string): string {\n name = toIdentifier(name);\n if (name === \"eval\" || name === \"arguments\") name = \"_\" + name;\n\n return name;\n}\n","// @flow\nimport { isIdentifier } from \"../validators/generated\";\nimport { stringLiteral } from \"../builders/generated\";\n\nexport default function toComputedKey(\n node: Object,\n key: Object = node.key || node.property,\n): Object {\n if (!node.computed && isIdentifier(key)) key = stringLiteral(key.name);\n\n return key;\n}\n","// @flow\nimport {\n isExpression,\n isFunction,\n isClass,\n isExpressionStatement,\n} from \"../validators/generated\";\n\nexport default function toExpression(node: Object): Object {\n if (isExpressionStatement(node)) {\n node = node.expression;\n }\n\n // return unmodified node\n // important for things like ArrowFunctions where\n // type change from ArrowFunction to FunctionExpression\n // produces bugs like -> `()=>a` to `function () a`\n // without generating a BlockStatement for it\n // ref: https://github.com/babel/babili/issues/130\n if (isExpression(node)) {\n return node;\n }\n\n // convert all classes and functions\n // ClassDeclaration -> ClassExpression\n // FunctionDeclaration, ObjectMethod, ClassMethod -> FunctionExpression\n if (isClass(node)) {\n node.type = \"ClassExpression\";\n } else if (isFunction(node)) {\n node.type = \"FunctionExpression\";\n }\n\n // if it's still not an expression\n if (!isExpression(node)) {\n throw new Error(`cannot turn ${node.type} to an expression`);\n }\n\n return node;\n}\n","// @flow\nimport { VISITOR_KEYS } from \"../definitions\";\n\n/**\n * A prefix AST traversal implementation meant for simple searching\n * and processing.\n */\nexport default function traverseFast(\n node: Object,\n enter: (node: BabelNode, opts?: Object) => void,\n opts?: Object,\n): void {\n if (!node) return;\n\n const keys = VISITOR_KEYS[node.type];\n if (!keys) return;\n\n opts = opts || {};\n enter(node, opts);\n\n for (const key of keys) {\n const subNode = node[key];\n\n if (Array.isArray(subNode)) {\n for (const node of subNode) {\n traverseFast(node, enter, opts);\n }\n } else {\n traverseFast(subNode, enter, opts);\n }\n }\n}\n","// @flow\nimport { COMMENT_KEYS } from \"../constants\";\n\nconst CLEAR_KEYS = [\"tokens\", \"start\", \"end\", \"loc\", \"raw\", \"rawValue\"];\n\nconst CLEAR_KEYS_PLUS_COMMENTS = COMMENT_KEYS.concat([\"comments\"]).concat(\n CLEAR_KEYS,\n);\n\n/**\n * Remove all of the _* properties from a node along with the additional metadata\n * properties like location data and raw token data.\n */\nexport default function removeProperties(\n node: Object,\n opts?: Object = {},\n): void {\n const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;\n for (const key of map) {\n if (node[key] != null) node[key] = undefined;\n }\n\n for (const key of Object.keys(node)) {\n if (key[0] === \"_\" && node[key] != null) node[key] = undefined;\n }\n\n const symbols: Array = Object.getOwnPropertySymbols(node);\n for (const sym of symbols) {\n node[sym] = null;\n }\n}\n","// @flow\nimport traverseFast from \"../traverse/traverseFast\";\nimport removeProperties from \"./removeProperties\";\n\nexport default function removePropertiesDeep(\n tree: T,\n opts?: Object,\n): T {\n traverseFast(tree, removeProperties, opts);\n\n return tree;\n}\n","// @flow\nimport { isIdentifier, isStringLiteral } from \"../validators/generated\";\nimport cloneNode from \"../clone/cloneNode\";\nimport removePropertiesDeep from \"../modifications/removePropertiesDeep\";\n\nexport default function toKeyAlias(\n node: Object,\n key: Object = node.key,\n): string {\n let alias;\n\n if (node.kind === \"method\") {\n return toKeyAlias.increment() + \"\";\n } else if (isIdentifier(key)) {\n alias = key.name;\n } else if (isStringLiteral(key)) {\n alias = JSON.stringify(key.value);\n } else {\n alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));\n }\n\n if (node.computed) {\n alias = `[${alias}]`;\n }\n\n if (node.static) {\n alias = `static:${alias}`;\n }\n\n return alias;\n}\n\ntoKeyAlias.uid = 0;\n\ntoKeyAlias.increment = function() {\n if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {\n return (toKeyAlias.uid = 0);\n } else {\n return toKeyAlias.uid++;\n }\n};\n","// @flow\nimport {\n isExportDeclaration,\n isIdentifier,\n isDeclaration,\n isFunctionDeclaration,\n isFunctionExpression,\n} from \"../validators/generated\";\n\n/**\n * Return a list of binding identifiers associated with the input `node`.\n */\nexport default function getBindingIdentifiers(\n node: Object,\n duplicates?: boolean,\n outerOnly?: boolean,\n): { [string]: Object | Array } {\n let search = [].concat(node);\n const ids = Object.create(null);\n\n while (search.length) {\n const id = search.shift();\n if (!id) continue;\n\n const keys = getBindingIdentifiers.keys[id.type];\n\n if (isIdentifier(id)) {\n if (duplicates) {\n const _ids = (ids[id.name] = ids[id.name] || []);\n _ids.push(id);\n } else {\n ids[id.name] = id;\n }\n continue;\n }\n\n if (isExportDeclaration(id)) {\n if (isDeclaration(id.declaration)) {\n search.push(id.declaration);\n }\n continue;\n }\n\n if (outerOnly) {\n if (isFunctionDeclaration(id)) {\n search.push(id.id);\n continue;\n }\n\n if (isFunctionExpression(id)) {\n continue;\n }\n }\n\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (id[key]) {\n search = search.concat(id[key]);\n }\n }\n }\n }\n\n // $FlowIssue Object.create() seems broken\n return ids;\n}\n\n/**\n * Mapping of types to their identifier keys.\n */\ngetBindingIdentifiers.keys = {\n DeclareClass: [\"id\"],\n DeclareFunction: [\"id\"],\n DeclareModule: [\"id\"],\n DeclareVariable: [\"id\"],\n DeclareInterface: [\"id\"],\n DeclareTypeAlias: [\"id\"],\n DeclareOpaqueType: [\"id\"],\n InterfaceDeclaration: [\"id\"],\n TypeAlias: [\"id\"],\n OpaqueType: [\"id\"],\n\n CatchClause: [\"param\"],\n LabeledStatement: [\"label\"],\n UnaryExpression: [\"argument\"],\n AssignmentExpression: [\"left\"],\n\n ImportSpecifier: [\"local\"],\n ImportNamespaceSpecifier: [\"local\"],\n ImportDefaultSpecifier: [\"local\"],\n ImportDeclaration: [\"specifiers\"],\n\n ExportSpecifier: [\"exported\"],\n ExportNamespaceSpecifier: [\"exported\"],\n ExportDefaultSpecifier: [\"exported\"],\n\n FunctionDeclaration: [\"id\", \"params\"],\n FunctionExpression: [\"id\", \"params\"],\n ArrowFunctionExpression: [\"params\"],\n ObjectMethod: [\"params\"],\n ClassMethod: [\"params\"],\n\n ForInStatement: [\"left\"],\n ForOfStatement: [\"left\"],\n\n ClassDeclaration: [\"id\"],\n ClassExpression: [\"id\"],\n\n RestElement: [\"argument\"],\n UpdateExpression: [\"argument\"],\n\n ObjectProperty: [\"value\"],\n\n AssignmentPattern: [\"left\"],\n ArrayPattern: [\"elements\"],\n ObjectPattern: [\"properties\"],\n\n VariableDeclaration: [\"declarations\"],\n VariableDeclarator: [\"id\"],\n};\n","// @flow\nimport type { Scope } from \"@babel/traverse\";\nimport getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\nimport {\n isExpression,\n isExpressionStatement,\n isVariableDeclaration,\n isIfStatement,\n isBlockStatement,\n isEmptyStatement,\n} from \"../validators/generated\";\nimport {\n sequenceExpression,\n assignmentExpression,\n conditionalExpression,\n} from \"../builders/generated\";\nimport cloneNode from \"../clone/cloneNode\";\n\nexport default function gatherSequenceExpressions(\n nodes: Array,\n scope: Scope,\n declars: Array,\n): ?Object {\n const exprs = [];\n let ensureLastUndefined = true;\n\n for (const node of nodes) {\n ensureLastUndefined = false;\n\n if (isExpression(node)) {\n exprs.push(node);\n } else if (isExpressionStatement(node)) {\n exprs.push(node.expression);\n } else if (isVariableDeclaration(node)) {\n if (node.kind !== \"var\") return; // bailed\n\n for (const declar of (node.declarations: Array)) {\n const bindings = getBindingIdentifiers(declar);\n for (const key of Object.keys(bindings)) {\n declars.push({\n kind: node.kind,\n id: cloneNode(bindings[key]),\n });\n }\n\n if (declar.init) {\n exprs.push(assignmentExpression(\"=\", declar.id, declar.init));\n }\n }\n\n ensureLastUndefined = true;\n } else if (isIfStatement(node)) {\n const consequent = node.consequent\n ? gatherSequenceExpressions([node.consequent], scope, declars)\n : scope.buildUndefinedNode();\n const alternate = node.alternate\n ? gatherSequenceExpressions([node.alternate], scope, declars)\n : scope.buildUndefinedNode();\n if (!consequent || !alternate) return; // bailed\n\n exprs.push(conditionalExpression(node.test, consequent, alternate));\n } else if (isBlockStatement(node)) {\n const body = gatherSequenceExpressions(node.body, scope, declars);\n if (!body) return; // bailed\n\n exprs.push(body);\n } else if (isEmptyStatement(node)) {\n // empty statement so ensure the last item is undefined if we're last\n ensureLastUndefined = true;\n } else {\n // bailed, we can't turn this statement into an expression\n return;\n }\n }\n\n if (ensureLastUndefined) {\n exprs.push(scope.buildUndefinedNode());\n }\n\n if (exprs.length === 1) {\n return exprs[0];\n } else {\n return sequenceExpression(exprs);\n }\n}\n","// @flow\nimport type { Scope } from \"@babel/traverse\";\nimport gatherSequenceExpressions from \"./gatherSequenceExpressions\";\n\n/**\n * Turn an array of statement `nodes` into a `SequenceExpression`.\n *\n * Variable declarations are turned into simple assignments and their\n * declarations hoisted to the top of the current scope.\n *\n * Expression statements are just resolved to their expression.\n */\nexport default function toSequenceExpression(\n nodes: Array,\n scope: Scope,\n): ?Object {\n if (!nodes || !nodes.length) return;\n\n const declars = [];\n const result = gatherSequenceExpressions(nodes, scope, declars);\n if (!result) return;\n\n for (const declar of declars) {\n scope.push(declar);\n }\n\n return result;\n}\n","// @flow\nimport {\n isStatement,\n isFunction,\n isClass,\n isAssignmentExpression,\n} from \"../validators/generated\";\nimport { expressionStatement } from \"../builders/generated\";\n\nexport default function toStatement(node: Object, ignore?: boolean) {\n if (isStatement(node)) {\n return node;\n }\n\n let mustHaveId = false;\n let newType;\n\n if (isClass(node)) {\n mustHaveId = true;\n newType = \"ClassDeclaration\";\n } else if (isFunction(node)) {\n mustHaveId = true;\n newType = \"FunctionDeclaration\";\n } else if (isAssignmentExpression(node)) {\n return expressionStatement(node);\n }\n\n if (mustHaveId && !node.id) {\n newType = false;\n }\n\n if (!newType) {\n if (ignore) {\n return false;\n } else {\n throw new Error(`cannot turn ${node.type} to a statement`);\n }\n }\n\n node.type = newType;\n\n return node;\n}\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\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 infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\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","// @flow\nimport isPlainObject from \"lodash/isPlainObject\";\nimport isRegExp from \"lodash/isRegExp\";\nimport isValidIdentifier from \"../validators/isValidIdentifier\";\nimport {\n identifier,\n booleanLiteral,\n nullLiteral,\n stringLiteral,\n numericLiteral,\n regExpLiteral,\n arrayExpression,\n objectProperty,\n objectExpression,\n unaryExpression,\n binaryExpression,\n} from \"../builders/generated\";\n\nexport default function valueToNode(value: any): Object {\n // undefined\n if (value === undefined) {\n return identifier(\"undefined\");\n }\n\n // boolean\n if (value === true || value === false) {\n return booleanLiteral(value);\n }\n\n // null\n if (value === null) {\n return nullLiteral();\n }\n\n // strings\n if (typeof value === \"string\") {\n return stringLiteral(value);\n }\n\n // numbers\n if (typeof value === \"number\") {\n let result;\n if (Number.isFinite(value)) {\n result = numericLiteral(Math.abs(value));\n } else {\n let numerator;\n if (Number.isNaN(value)) {\n // NaN\n numerator = numericLiteral(0);\n } else {\n // Infinity / -Infinity\n numerator = numericLiteral(1);\n }\n\n result = binaryExpression(\"/\", numerator, numericLiteral(0));\n }\n\n if (value < 0 || Object.is(value, -0)) {\n result = unaryExpression(\"-\", result);\n }\n\n return result;\n }\n\n // regexes\n if (isRegExp(value)) {\n const pattern = value.source;\n const flags = value.toString().match(/\\/([a-z]+|)$/)[1];\n return regExpLiteral(pattern, flags);\n }\n\n // array\n if (Array.isArray(value)) {\n return arrayExpression(value.map(valueToNode));\n }\n\n // object\n if (isPlainObject(value)) {\n const props = [];\n for (const key of Object.keys(value)) {\n let nodeKey;\n if (isValidIdentifier(key)) {\n nodeKey = identifier(key);\n } else {\n nodeKey = stringLiteral(key);\n }\n props.push(objectProperty(nodeKey, valueToNode(value[key])));\n }\n return objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}\n","// @flow\nimport { memberExpression } from \"../builders/generated\";\n\n/**\n * Append a node to a member expression.\n */\nexport default function appendToMemberExpression(\n member: T,\n append: Object,\n computed?: boolean = false,\n): T {\n member.object = memberExpression(\n member.object,\n member.property,\n member.computed,\n );\n member.property = append;\n member.computed = !!computed;\n\n return member;\n}\n","// @flow\nimport { INHERIT_KEYS } from \"../constants\";\nimport inheritsComments from \"../comments/inheritsComments\";\n\n/**\n * Inherit all contextual properties from `parent` node to `child` node.\n */\nexport default function inherits(child: T, parent: Object): T {\n if (!child || !parent) return child;\n\n // optionally inherit specific properties if not null\n for (const key of (INHERIT_KEYS.optional: Array)) {\n if (child[key] == null) {\n child[key] = parent[key];\n }\n }\n\n // force inherit \"private\" properties\n for (const key of Object.keys(parent)) {\n if (key[0] === \"_\" && key !== \"__clone\") child[key] = parent[key];\n }\n\n // force inherit select properties\n for (const key of (INHERIT_KEYS.force: Array)) {\n child[key] = parent[key];\n }\n\n inheritsComments(child, parent);\n\n return child;\n}\n","// @flow\nimport { memberExpression } from \"../builders/generated\";\n\n/**\n * Prepend a node to a member expression.\n */\nexport default function prependToMemberExpression(\n member: T,\n prepend: Object,\n): T {\n member.object = memberExpression(prepend, member.object);\n\n return member;\n}\n","// @flow\nimport getBindingIdentifiers from \"./getBindingIdentifiers\";\n\nexport default function getOuterBindingIdentifiers(\n node: Object,\n duplicates?: boolean,\n): { [string]: Object | Array } {\n return getBindingIdentifiers(node, duplicates, true);\n}\n","// @flow\nimport { VISITOR_KEYS } from \"../definitions\";\n\nexport type TraversalAncestors = Array<{\n node: BabelNode,\n key: string,\n index?: number,\n}>;\nexport type TraversalHandler = (BabelNode, TraversalAncestors, T) => void;\nexport type TraversalHandlers = {\n enter?: TraversalHandler,\n exit?: TraversalHandler,\n};\n\n/**\n * A general AST traversal with both prefix and postfix handlers, and a\n * state object. Exposes ancestry data to each handler so that more complex\n * AST data can be taken into account.\n */\nexport default function traverse(\n node: BabelNode,\n handlers: TraversalHandler | TraversalHandlers,\n state?: T,\n): void {\n if (typeof handlers === \"function\") {\n handlers = { enter: handlers };\n }\n\n const { enter, exit } = (handlers: TraversalHandlers);\n\n traverseSimpleImpl(node, enter, exit, state, []);\n}\n\nfunction traverseSimpleImpl(\n node: Object,\n enter: ?Function,\n exit: ?Function,\n state: ?T,\n ancestors: TraversalAncestors,\n) {\n const keys = VISITOR_KEYS[node.type];\n if (!keys) return;\n\n if (enter) enter(node, ancestors, state);\n\n for (const key of keys) {\n const subNode = node[key];\n\n if (Array.isArray(subNode)) {\n for (let i = 0; i < subNode.length; i++) {\n const child = subNode[i];\n if (!child) continue;\n\n ancestors.push({\n node,\n key,\n index: i,\n });\n\n traverseSimpleImpl(child, enter, exit, state, ancestors);\n\n ancestors.pop();\n }\n } else if (subNode) {\n ancestors.push({\n node,\n key,\n });\n\n traverseSimpleImpl(subNode, enter, exit, state, ancestors);\n\n ancestors.pop();\n }\n }\n\n if (exit) exit(node, ancestors, state);\n}\n","// @flow\nimport getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\n/**\n * Check if the input `node` is a binding identifier.\n */\nexport default function isBinding(\n node: Object,\n parent: Object,\n grandparent?: Object,\n): boolean {\n if (\n grandparent &&\n node.type === \"Identifier\" &&\n parent.type === \"ObjectProperty\" &&\n grandparent.type === \"ObjectExpression\"\n ) {\n // We need to special-case this, because getBindingIdentifiers\n // has an ObjectProperty->value entry for destructuring patterns.\n return false;\n }\n\n const keys = getBindingIdentifiers.keys[parent.type];\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const val = parent[key];\n if (Array.isArray(val)) {\n if (val.indexOf(node) >= 0) return true;\n } else {\n if (val === node) return true;\n }\n }\n }\n\n return false;\n}\n","// @flow\nimport { isVariableDeclaration } from \"./generated\";\nimport { BLOCK_SCOPED_SYMBOL } from \"../constants\";\n\n/**\n * Check if the input `node` is a `let` variable declaration.\n */\nexport default function isLet(node: Object): boolean {\n return (\n isVariableDeclaration(node) &&\n (node.kind !== \"var\" || node[BLOCK_SCOPED_SYMBOL])\n );\n}\n","// @flow\nimport { isClassDeclaration, isFunctionDeclaration } from \"./generated\";\nimport isLet from \"./isLet\";\n\n/**\n * Check if the input `node` is block scoped.\n */\nexport default function isBlockScoped(node: Object): boolean {\n return isFunctionDeclaration(node) || isClassDeclaration(node) || isLet(node);\n}\n","// @flow\nimport isType from \"./isType\";\nimport { isIdentifier } from \"./generated\";\n\n/**\n * Check if the input `node` is definitely immutable.\n */\nexport default function isImmutable(node: Object): boolean {\n if (isType(node.type, \"Immutable\")) return true;\n\n if (isIdentifier(node)) {\n if (node.name === \"undefined\") {\n // immutable!\n return true;\n } else {\n // no idea...\n return false;\n }\n }\n\n return false;\n}\n","// @flow\nimport { NODE_FIELDS, VISITOR_KEYS } from \"../definitions\";\n\n/**\n * Check if two nodes are equivalent\n */\nexport default function isNodesEquivalent(a: any, b: any): boolean {\n if (\n typeof a !== \"object\" ||\n typeof b !== \"object\" ||\n a == null ||\n b == null\n ) {\n return a === b;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n const fields = Object.keys(NODE_FIELDS[a.type] || a.type);\n const visitorKeys = VISITOR_KEYS[a.type];\n\n for (const field of fields) {\n if (typeof a[field] !== typeof b[field]) {\n return false;\n }\n if (a[field] == null && b[field] == null) {\n continue;\n } else if (a[field] == null || b[field] == null) {\n return false;\n }\n\n if (Array.isArray(a[field])) {\n if (!Array.isArray(b[field])) {\n return false;\n }\n if (a[field].length !== b[field].length) {\n return false;\n }\n\n for (let i = 0; i < a[field].length; i++) {\n if (!isNodesEquivalent(a[field][i], b[field][i])) {\n return false;\n }\n }\n continue;\n }\n\n if (\n typeof a[field] === \"object\" &&\n (!visitorKeys || !visitorKeys.includes(field))\n ) {\n for (const key of Object.keys(a[field])) {\n if (a[field][key] !== b[field][key]) {\n return false;\n }\n }\n continue;\n }\n\n if (!isNodesEquivalent(a[field], b[field])) {\n return false;\n }\n }\n\n return true;\n}\n","// @flow\n/**\n * Check if the input `node` is a reference to a bound variable.\n */\nexport default function isReferenced(\n node: Object,\n parent: Object,\n grandparent?: Object,\n): boolean {\n switch (parent.type) {\n // yes: PARENT[NODE]\n // yes: NODE.child\n // no: parent.NODE\n case \"MemberExpression\":\n case \"JSXMemberExpression\":\n case \"OptionalMemberExpression\":\n if (parent.property === node) {\n return !!parent.computed;\n }\n return parent.object === node;\n\n // no: let NODE = init;\n // yes: let id = NODE;\n case \"VariableDeclarator\":\n return parent.init === node;\n\n // yes: () => NODE\n // no: (NODE) => {}\n case \"ArrowFunctionExpression\":\n return parent.body === node;\n\n // no: export { foo as NODE };\n // yes: export { NODE as foo };\n // no: export { NODE as foo } from \"foo\";\n case \"ExportSpecifier\":\n if (parent.source) {\n return false;\n }\n return parent.local === node;\n\n // no: class { #NODE; }\n // no: class { get #NODE() {} }\n // no: class { #NODE() {} }\n // no: class { fn() { return this.#NODE; } }\n case \"PrivateName\":\n return false;\n\n // yes: { [NODE]: \"\" }\n // no: { NODE: \"\" }\n // depends: { NODE }\n // depends: { key: NODE }\n case \"ObjectProperty\":\n // no: class { NODE = value; }\n // yes: class { [NODE] = value; }\n // yes: class { key = NODE; }\n case \"ClassProperty\":\n case \"ClassPrivateProperty\":\n // no: class { NODE() {} }\n // yes: class { [NODE]() {} }\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"ObjectMethod\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n if (parent.value === node) {\n return !grandparent || grandparent.type !== \"ObjectPattern\";\n }\n return true;\n\n // no: class NODE {}\n // yes: class Foo extends NODE {}\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return parent.superClass === node;\n\n // yes: left = NODE;\n // no: NODE = right;\n case \"AssignmentExpression\":\n return parent.right === node;\n\n // no: [NODE = foo] = [];\n // yes: [foo = NODE] = [];\n case \"AssignmentPattern\":\n return parent.right === node;\n\n // no: NODE: for (;;) {}\n case \"LabeledStatement\":\n return false;\n\n // no: try {} catch (NODE) {}\n case \"CatchClause\":\n return false;\n\n // no: function foo(...NODE) {}\n case \"RestElement\":\n return false;\n\n case \"BreakStatement\":\n case \"ContinueStatement\":\n return false;\n\n // no: function NODE() {}\n // no: function foo(NODE) {}\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n return false;\n\n // no: export NODE from \"foo\";\n // no: export * as NODE from \"foo\";\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n return false;\n\n // no: import NODE from \"foo\";\n // no: import * as NODE from \"foo\";\n // no: import { NODE as foo } from \"foo\";\n // no: import { foo as NODE } from \"foo\";\n // no: import NODE from \"bar\";\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n return false;\n\n // no:
\n case \"JSXAttribute\":\n return false;\n\n // no: [NODE] = [];\n // no: ({ NODE }) = [];\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n return false;\n\n // no: new.NODE\n // no: NODE.target\n case \"MetaProperty\":\n return false;\n\n // yes: type X = { somePropert: NODE }\n // no: type X = { NODE: OtherType }\n case \"ObjectTypeProperty\":\n return parent.key !== node;\n\n // yes: enum X { Foo = NODE }\n // no: enum X { NODE }\n case \"TSEnumMember\":\n return parent.id !== node;\n\n // yes: { [NODE]: value }\n // no: { NODE: value }\n case \"TSPropertySignature\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n\n return true;\n }\n\n return true;\n}\n","// @flow\nimport {\n isFunction,\n isCatchClause,\n isBlockStatement,\n isScopable,\n isPattern,\n} from \"./generated\";\n\n/**\n * Check if the input `node` is a scope.\n */\nexport default function isScope(node: Object, parent: Object): boolean {\n if (isBlockStatement(node) && isFunction(parent, { body: node })) {\n return false;\n }\n\n if (isBlockStatement(node) && isCatchClause(parent, { body: node })) {\n return false;\n }\n\n // If a Pattern is an immediate descendent of a Function, it must be in the params.\n // Hence we skipped the parentKey === \"params\" check\n if (isPattern(node) && isFunction(parent)) {\n return true;\n }\n\n return isScopable(node);\n}\n","// @flow\nimport { isIdentifier, isImportDefaultSpecifier } from \"./generated\";\n\n/**\n * Check if the input `specifier` is a `default` import or export.\n */\nexport default function isSpecifierDefault(specifier: Object): boolean {\n return (\n isImportDefaultSpecifier(specifier) ||\n isIdentifier(specifier.imported || specifier.exported, {\n name: \"default\",\n })\n );\n}\n","// @flow\nimport isValidIdentifier from \"./isValidIdentifier\";\n\nconst RESERVED_WORDS_ES3_ONLY: Set = new Set([\n \"abstract\",\n \"boolean\",\n \"byte\",\n \"char\",\n \"double\",\n \"enum\",\n \"final\",\n \"float\",\n \"goto\",\n \"implements\",\n \"int\",\n \"interface\",\n \"long\",\n \"native\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"short\",\n \"static\",\n \"synchronized\",\n \"throws\",\n \"transient\",\n \"volatile\",\n]);\n\n/**\n * Check if the input `name` is a valid identifier name according to the ES3 specification.\n *\n * Additional ES3 reserved words are\n */\nexport default function isValidES3Identifier(name: string): boolean {\n return isValidIdentifier(name) && !RESERVED_WORDS_ES3_ONLY.has(name);\n}\n","// @flow\nimport { isVariableDeclaration } from \"./generated\";\nimport { BLOCK_SCOPED_SYMBOL } from \"../constants\";\n\n/**\n * Check if the input `node` is a variable declaration.\n */\nexport default function isVar(node: Object): boolean {\n return (\n isVariableDeclaration(node, { kind: \"var\" }) && !node[BLOCK_SCOPED_SYMBOL]\n );\n}\n","// @flow\nimport isReactComponent from \"./validators/react/isReactComponent\";\nimport isCompatTag from \"./validators/react/isCompatTag\";\nimport buildChildren from \"./builders/react/buildChildren\";\n\n// asserts\nexport { default as assertNode } from \"./asserts/assertNode\";\nexport * from \"./asserts/generated\";\n\n// builders\nexport { default as createTypeAnnotationBasedOnTypeof } from \"./builders/flow/createTypeAnnotationBasedOnTypeof\";\nexport { default as createUnionTypeAnnotation } from \"./builders/flow/createUnionTypeAnnotation\";\nexport * from \"./builders/generated\";\n\n// clone\nexport { default as cloneNode } from \"./clone/cloneNode\";\nexport { default as clone } from \"./clone/clone\";\nexport { default as cloneDeep } from \"./clone/cloneDeep\";\nexport { default as cloneWithoutLoc } from \"./clone/cloneWithoutLoc\";\n\n// comments\nexport { default as addComment } from \"./comments/addComment\";\nexport { default as addComments } from \"./comments/addComments\";\nexport { default as inheritInnerComments } from \"./comments/inheritInnerComments\";\nexport { default as inheritLeadingComments } from \"./comments/inheritLeadingComments\";\nexport { default as inheritsComments } from \"./comments/inheritsComments\";\nexport { default as inheritTrailingComments } from \"./comments/inheritTrailingComments\";\nexport { default as removeComments } from \"./comments/removeComments\";\n\n// constants\nexport * from \"./constants/generated\";\nexport * from \"./constants\";\n\n// converters\nexport { default as ensureBlock } from \"./converters/ensureBlock\";\nexport { default as toBindingIdentifierName } from \"./converters/toBindingIdentifierName\";\nexport { default as toBlock } from \"./converters/toBlock\";\nexport { default as toComputedKey } from \"./converters/toComputedKey\";\nexport { default as toExpression } from \"./converters/toExpression\";\nexport { default as toIdentifier } from \"./converters/toIdentifier\";\nexport { default as toKeyAlias } from \"./converters/toKeyAlias\";\nexport { default as toSequenceExpression } from \"./converters/toSequenceExpression\";\nexport { default as toStatement } from \"./converters/toStatement\";\nexport { default as valueToNode } from \"./converters/valueToNode\";\n\n// definitions\nexport * from \"./definitions\";\n\n// modifications\nexport { default as appendToMemberExpression } from \"./modifications/appendToMemberExpression\";\nexport { default as inherits } from \"./modifications/inherits\";\nexport { default as prependToMemberExpression } from \"./modifications/prependToMemberExpression\";\nexport { default as removeProperties } from \"./modifications/removeProperties\";\nexport { default as removePropertiesDeep } from \"./modifications/removePropertiesDeep\";\nexport { default as removeTypeDuplicates } from \"./modifications/flow/removeTypeDuplicates\";\n\n// retrievers\nexport { default as getBindingIdentifiers } from \"./retrievers/getBindingIdentifiers\";\nexport { default as getOuterBindingIdentifiers } from \"./retrievers/getOuterBindingIdentifiers\";\n\n// traverse\nexport { default as traverse } from \"./traverse/traverse\";\nexport type * from \"./traverse/traverse\";\nexport { default as traverseFast } from \"./traverse/traverseFast\";\n\n// utils\nexport { default as shallowEqual } from \"./utils/shallowEqual\";\n\n// validators\nexport { default as is } from \"./validators/is\";\nexport { default as isBinding } from \"./validators/isBinding\";\nexport { default as isBlockScoped } from \"./validators/isBlockScoped\";\nexport { default as isImmutable } from \"./validators/isImmutable\";\nexport { default as isLet } from \"./validators/isLet\";\nexport { default as isNode } from \"./validators/isNode\";\nexport { default as isNodesEquivalent } from \"./validators/isNodesEquivalent\";\nexport { default as isPlaceholderType } from \"./validators/isPlaceholderType\";\nexport { default as isReferenced } from \"./validators/isReferenced\";\nexport { default as isScope } from \"./validators/isScope\";\nexport { default as isSpecifierDefault } from \"./validators/isSpecifierDefault\";\nexport { default as isType } from \"./validators/isType\";\nexport { default as isValidES3Identifier } from \"./validators/isValidES3Identifier\";\nexport { default as isValidIdentifier } from \"./validators/isValidIdentifier\";\nexport { default as isVar } from \"./validators/isVar\";\nexport { default as matchesPattern } from \"./validators/matchesPattern\";\nexport { default as validate } from \"./validators/validate\";\nexport { default as buildMatchMemberExpression } from \"./validators/buildMatchMemberExpression\";\nexport * from \"./validators/generated\";\n\n// react\nexport const react = {\n isReactComponent,\n isCompatTag,\n buildChildren,\n};\n","\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\nvar inited = false;\nfunction init () {\n inited = true;\n var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n for (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n }\n\n revLookup['-'.charCodeAt(0)] = 62\n revLookup['_'.charCodeAt(0)] = 63\n}\n\nexport function toByteArray (b64) {\n if (!inited) {\n init();\n }\n var i, j, l, tmp, placeHolders, arr\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n\n // base64 is 4/3 + up to two characters of the original data\n arr = new Arr(len * 3 / 4 - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0, j = 0; i < l; i += 4, j += 3) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nexport function fromByteArray (uint8) {\n if (!inited) {\n init();\n }\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n","\nexport function read (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexport function write (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nexport default Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\nimport * as base64 from './base64'\nimport * as ieee754 from './ieee754'\nimport isArray from './isArray'\n\nexport var INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : true\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nvar _kMaxLength = kMaxLength()\nexport {_kMaxLength as kMaxLength};\nfunction typedArraySupport () {\n return true;\n // rollup issues\n // try {\n // var arr = new Uint8Array(1)\n // arr.__proto__ = {\n // __proto__: Uint8Array.prototype,\n // foo: function () { return 42 }\n // }\n // return arr.foo() === 42 && // typed array instances can be augmented\n // typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n // arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n // } catch (e) {\n // return false\n // }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nexport function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n // Object.defineProperty(Buffer, Symbol.species, {\n // value: null,\n // configurable: true\n // })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (internalIsBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nexport function SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\nBuffer.isBuffer = isBuffer;\nfunction internalIsBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!internalIsBuffer(a) || !internalIsBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!internalIsBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (internalIsBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!internalIsBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (internalIsBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!internalIsBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = internalIsBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n\n// the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nexport function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}\n\nfunction isFastBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))\n}\n","\nvar inherits;\nif (typeof Object.create === 'function'){\n inherits = function inherits(ctor, superCtor) {\n // implementation from standard node.js 'util' module\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n inherits = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\nexport default inherits;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport process from 'process';\nvar formatRegExp = /%[sdj%]/g;\nexport function format(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexport function deprecate(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexport function debuglog(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = 0;\n debugs[set] = function() {\n var msg = format.apply(null, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nexport function inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n _extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexport function isArray(ar) {\n return Array.isArray(ar);\n}\n\nexport function isBoolean(arg) {\n return typeof arg === 'boolean';\n}\n\nexport function isNull(arg) {\n return arg === null;\n}\n\nexport function isNullOrUndefined(arg) {\n return arg == null;\n}\n\nexport function isNumber(arg) {\n return typeof arg === 'number';\n}\n\nexport function isString(arg) {\n return typeof arg === 'string';\n}\n\nexport function isSymbol(arg) {\n return typeof arg === 'symbol';\n}\n\nexport function isUndefined(arg) {\n return arg === void 0;\n}\n\nexport function isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\n\nexport function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nexport function isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\n\nexport function isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\n\nexport function isBuffer(maybeBuf) {\n return Buffer.isBuffer(maybeBuf);\n}\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexport function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nimport inherits from './inherits';\nexport {inherits}\n\nexport function _extend(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport default {\n inherits: inherits,\n _extend: _extend,\n log: log,\n isBuffer: isBuffer,\n isPrimitive: isPrimitive,\n isFunction: isFunction,\n isError: isError,\n isDate: isDate,\n isObject: isObject,\n isRegExp: isRegExp,\n isUndefined: isUndefined,\n isSymbol: isSymbol,\n isString: isString,\n isNumber: isNumber,\n isNullOrUndefined: isNullOrUndefined,\n isNull: isNull,\n isBoolean: isBoolean,\n isArray: isArray,\n inspect: inspect,\n deprecate: deprecate,\n format: format,\n debuglog: debuglog\n}\n","\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n// based on node assert, original notice:\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport {isBuffer} from 'buffer';\nimport {isPrimitive, inherits, isError, isFunction, isRegExp, isDate, inspect as utilInspect} from 'util';\nvar pSlice = Array.prototype.slice;\nvar _functionsHaveNames;\nfunction functionsHaveNames() {\n if (typeof _functionsHaveNames !== 'undefined') {\n return _functionsHaveNames;\n }\n return _functionsHaveNames = (function () {\n return function foo() {}.name === 'foo';\n }());\n}\nfunction pToString (obj) {\n return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n if (!arrbuf) {\n return false;\n }\n if (arrbuf instanceof DataView) {\n return true;\n }\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nfunction assert(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nexport default assert;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n if (!isFunction(func)) {\n return;\n }\n if (functionsHaveNames()) {\n return func.name;\n }\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\nassert.AssertionError = AssertionError;\nexport function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n}\n\n// assert.AssertionError instanceof Error\ninherits(AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\nfunction inspect(something) {\n if (functionsHaveNames() || !isFunction(something)) {\n return utilInspect(something);\n }\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' +\n self.operator + ' ' +\n truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nexport function fail(actual, expected, message, operator, stackStartFunction) {\n throw new AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nexport function ok(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nassert.ok = ok;\nexport {ok as assert};\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\nassert.equal = equal;\nexport function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', equal);\n}\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\nassert.notEqual = notEqual;\nexport function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', notEqual);\n }\n}\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\nassert.deepEqual = deepEqual;\nexport function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', deepEqual);\n }\n}\nassert.deepStrictEqual = deepStrictEqual;\nexport function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', deepStrictEqual);\n }\n}\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')) {\n return strict ? actual === expected : actual == expected;\n\n // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) &&\n pToString(actual) === pToString(expected) &&\n !(actual instanceof Float32Array ||\n actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer),\n new Uint8Array(expected.buffer)) === 0;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {actual: [], expected: []};\n\n var actualIndex = memos.actual.indexOf(actual);\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined)\n return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b))\n return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\nassert.notDeepEqual = notDeepEqual;\nexport function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', notDeepEqual);\n }\n}\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nexport function notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\nassert.strictEqual = strictEqual;\nexport function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', strictEqual);\n }\n}\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\nassert.notStrictEqual = notStrictEqual;\nexport function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', notStrictEqual);\n }\n}\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {\n // Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n try {\n block();\n } catch (e) {\n error = e;\n }\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if ((isUnwantedException &&\n userProvidedMessage &&\n expectedException(actual, expected)) ||\n isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\nassert.throws = throws;\nexport function throws(block, /*optional*/error, /*optional*/message) {\n _throws(true, block, error, message);\n}\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = doesNotThrow;\nexport function doesNotThrow(block, /*optional*/error, /*optional*/message) {\n _throws(false, block, error, message);\n}\n\nassert.ifError = ifError;\nexport function ifError(err) {\n if (err) throw err;\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\n\n/**\n * A class to track and accumulate mutations to the AST that will eventually\n * output a new require/import statement list.\n */\nexport default class ImportBuilder {\n _statements = [];\n _resultName = null;\n\n _scope = null;\n _hub = null;\n\n constructor(importedSource, scope, hub) {\n this._scope = scope;\n this._hub = hub;\n this._importedSource = importedSource;\n }\n\n done() {\n return {\n statements: this._statements,\n resultName: this._resultName,\n };\n }\n\n import() {\n this._statements.push(\n t.importDeclaration([], t.stringLiteral(this._importedSource)),\n );\n return this;\n }\n\n require() {\n this._statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier(\"require\"), [\n t.stringLiteral(this._importedSource),\n ]),\n ),\n );\n return this;\n }\n\n namespace(name = \"namespace\") {\n name = this._scope.generateUidIdentifier(name);\n\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importNamespaceSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n default(name) {\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importDefaultSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n named(name, importName) {\n if (importName === \"default\") return this.default(name);\n\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importSpecifier(name, t.identifier(importName))];\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n var(name) {\n name = this._scope.generateUidIdentifier(name);\n let statement = this._statements[this._statements.length - 1];\n if (statement.type !== \"ExpressionStatement\") {\n assert(this._resultName);\n statement = t.expressionStatement(this._resultName);\n this._statements.push(statement);\n }\n this._statements[this._statements.length - 1] = t.variableDeclaration(\n \"var\",\n [t.variableDeclarator(name, statement.expression)],\n );\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n defaultInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireDefault\"));\n }\n wildcardInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireWildcard\"));\n }\n\n _interop(callee) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.callExpression(callee, [statement.expression]);\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = t.callExpression(callee, [\n statement.declarations[0].init,\n ]);\n } else {\n assert.fail(\"Unexpected type.\");\n }\n return this;\n }\n\n prop(name) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.memberExpression(\n statement.expression,\n t.identifier(name),\n );\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = t.memberExpression(\n statement.declarations[0].init,\n t.identifier(name),\n );\n } else {\n assert.fail(\"Unexpected type:\" + statement.type);\n }\n return this;\n }\n\n read(name) {\n this._resultName = t.memberExpression(this._resultName, t.identifier(name));\n }\n}\n","/**\n * A small utility to check if a file qualifies as a module.\n */\nexport default function isModule(path: NodePath) {\n const { sourceType } = path.node;\n if (sourceType !== \"module\" && sourceType !== \"script\") {\n throw path.buildCodeFrameError(\n `Unknown sourceType \"${sourceType}\", cannot transform.`,\n );\n }\n\n return path.node.sourceType === \"module\";\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\n\nimport ImportBuilder from \"./import-builder\";\nimport isModule from \"./is-module\";\n\nexport type ImportOptions = {\n /**\n * The module being referenced.\n */\n importedSource: string | null,\n\n /**\n * The type of module being imported:\n *\n * * 'es6' - An ES6 module.\n * * 'commonjs' - A CommonJS module. (Default)\n */\n importedType: \"es6\" | \"commonjs\",\n\n /**\n * The type of interop behavior for namespace/default/named when loading\n * CommonJS modules.\n *\n * ## 'babel' (Default)\n *\n * Load using Babel's interop.\n *\n * If '.__esModule' is true, treat as 'compiled', else:\n *\n * * Namespace: A copy of the module.exports with .default\n * populated by the module.exports object.\n * * Default: The module.exports value.\n * * Named: The .named property of module.exports.\n *\n * The 'ensureLiveReference' has no effect on the liveness of these.\n *\n * ## 'compiled'\n *\n * Assume the module is ES6 compiled to CommonJS. Useful to avoid injecting\n * interop logic if you are confident that the module is a certain format.\n *\n * * Namespace: The root module.exports object.\n * * Default: The .default property of the namespace.\n * * Named: The .named property of the namespace.\n *\n * Will return erroneous results if the imported module is _not_ compiled\n * from ES6 with Babel.\n *\n * ## 'uncompiled'\n *\n * Assume the module is _not_ ES6 compiled to CommonJS. Used a simplified\n * access pattern that doesn't require additional function calls.\n *\n * Will return erroneous results if the imported module _is_ compiled\n * from ES6 with Babel.\n *\n * * Namespace: The module.exports object.\n * * Default: The module.exports object.\n * * Named: The .named property of module.exports.\n */\n importedInterop: \"babel\" | \"node\" | \"compiled\" | \"uncompiled\",\n\n /**\n * The type of CommonJS interop included in the environment that will be\n * loading the output code.\n *\n * * 'babel' - CommonJS modules load with Babel's interop. (Default)\n * * 'node' - CommonJS modules load with Node's interop.\n *\n * See descriptions in 'importedInterop' for more details.\n */\n importingInterop: \"babel\" | \"node\",\n\n /**\n * Define whether we explicitly care that the import be a live reference.\n * Only applies when importing default and named imports, not the namespace.\n *\n * * true - Force imported values to be live references.\n * * false - No particular requirements. Keeps the code simplest. (Default)\n */\n ensureLiveReference: boolean,\n\n /**\n * Define if we explicitly care that the result not be a property reference.\n *\n * * true - Force calls to exclude context. Useful if the value is going to\n * be used as function callee.\n * * false - No particular requirements for context of the access. (Default)\n */\n ensureNoContext: boolean,\n};\n\n/**\n * A general helper classes add imports via transforms. See README for usage.\n */\nexport default class ImportInjector {\n /**\n * The path used for manipulation.\n */\n _programPath: NodePath;\n\n /**\n * The scope used to generate unique variable names.\n */\n _programScope;\n\n /**\n * The file used to inject helpers and resolve paths.\n */\n _hub;\n\n /**\n * The default options to use with this instance when imports are added.\n */\n _defaultOpts: ImportOptions = {\n importedSource: null,\n importedType: \"commonjs\",\n importedInterop: \"babel\",\n importingInterop: \"babel\",\n ensureLiveReference: false,\n ensureNoContext: false,\n };\n\n constructor(path, importedSource, opts) {\n const programPath = path.find(p => p.isProgram());\n\n this._programPath = programPath;\n this._programScope = programPath.scope;\n this._hub = programPath.hub;\n\n this._defaultOpts = this._applyDefaults(importedSource, opts, true);\n }\n\n addDefault(importedSourceIn, opts) {\n return this.addNamed(\"default\", importedSourceIn, opts);\n }\n\n addNamed(importName, importedSourceIn, opts) {\n assert(typeof importName === \"string\");\n\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n importName,\n );\n }\n\n addNamespace(importedSourceIn, opts) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n null,\n );\n }\n\n addSideEffect(importedSourceIn, opts) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n false,\n );\n }\n\n _applyDefaults(importedSource, opts, isInit = false) {\n const optsList = [];\n if (typeof importedSource === \"string\") {\n optsList.push({ importedSource });\n optsList.push(opts);\n } else {\n assert(!opts, \"Unexpected secondary arguments.\");\n\n optsList.push(importedSource);\n }\n\n const newOpts = {\n ...this._defaultOpts,\n };\n for (const opts of optsList) {\n if (!opts) continue;\n Object.keys(newOpts).forEach(key => {\n if (opts[key] !== undefined) newOpts[key] = opts[key];\n });\n\n if (!isInit) {\n if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;\n if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;\n }\n }\n return newOpts;\n }\n\n _generateImport(opts, importName) {\n const isDefault = importName === \"default\";\n const isNamed = !!importName && !isDefault;\n const isNamespace = importName === null;\n\n const {\n importedSource,\n importedType,\n importedInterop,\n importingInterop,\n ensureLiveReference,\n ensureNoContext,\n nameHint,\n\n // Not meant for public usage. Allows code that absolutely must control\n // ordering to set a specific hoist value on the import nodes.\n blockHoist,\n } = opts;\n\n // Provide a hint for generateUidIdentifier for the local variable name\n // to use for the import, if the code will generate a simple assignment\n // to a variable.\n let name = nameHint || importName;\n\n const isMod = isModule(this._programPath);\n const isModuleForNode = isMod && importingInterop === \"node\";\n const isModuleForBabel = isMod && importingInterop === \"babel\";\n\n const builder = new ImportBuilder(\n importedSource,\n this._programScope,\n this._hub,\n );\n\n if (importedType === \"es6\") {\n if (!isModuleForNode && !isModuleForBabel) {\n throw new Error(\"Cannot import an ES6 module from CommonJS\");\n }\n\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(nameHint || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else if (importedType !== \"commonjs\") {\n throw new Error(`Unexpected interopType \"${importedType}\"`);\n } else if (importedInterop === \"babel\") {\n if (isModuleForNode) {\n // import _tmp from ''; var namespace = interopRequireWildcard(_tmp); namespace\n // import _tmp from ''; var def = interopRequireDefault(_tmp).default; def\n // import _tmp from ''; _tmp.named\n name = name !== \"default\" ? name : importedSource;\n const es6Default = `${importedSource}$es6Default`;\n\n builder.import();\n if (isNamespace) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .wildcardInterop();\n } else if (isDefault) {\n if (ensureLiveReference) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .defaultInterop()\n .read(\"default\");\n } else {\n builder\n .default(es6Default)\n .var(name)\n .defaultInterop()\n .prop(importName);\n }\n } else if (isNamed) {\n builder.default(es6Default).read(importName);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = interopRequireWildcard(require(''));\n // var def = interopRequireDefault(require('')).default; def\n // var named = require('').named; named\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource).wildcardInterop();\n } else if ((isDefault || isNamed) && ensureLiveReference) {\n if (isDefault) {\n name = name !== \"default\" ? name : importedSource;\n builder.var(name).read(importName);\n builder.defaultInterop();\n } else {\n builder.var(importedSource).read(importName);\n }\n } else if (isDefault) {\n builder\n .var(name)\n .defaultInterop()\n .prop(importName);\n } else if (isNamed) {\n builder.var(name).prop(importName);\n }\n }\n } else if (importedInterop === \"compiled\") {\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import namespace from ''; namespace.default\n // import namespace from ''; namespace.named\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n // Note: These lookups will break if the module has no __esModule set,\n // hence the warning that 'compiled' will not work on standard CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var namespace = require(''); namespace.default\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault || isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.prop(importName).var(name);\n }\n }\n }\n } else if (importedInterop === \"uncompiled\") {\n if (isDefault && ensureLiveReference) {\n throw new Error(\"No live reference for commonjs default\");\n }\n\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import def from ''; def;\n // import namespace from ''; namespace.named\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import namespace from '';\n // import def from '';\n // import { named } from ''; named;\n // Note: These lookups will break if the module has __esModule set,\n // hence the warning that 'uncompiled' will not work on ES6 transpiled\n // to CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var def = require(''); def\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault) {\n builder.var(name);\n } else if (isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.var(name).prop(importName);\n }\n }\n }\n } else {\n throw new Error(`Unknown importedInterop \"${importedInterop}\".`);\n }\n\n const { statements, resultName } = builder.done();\n\n this._insertStatements(statements, blockHoist);\n\n if (\n (isDefault || isNamed) &&\n ensureNoContext &&\n resultName.type !== \"Identifier\"\n ) {\n return t.sequenceExpression([t.numericLiteral(0), resultName]);\n }\n return resultName;\n }\n\n _insertStatements(statements, blockHoist = 3) {\n statements.forEach(node => {\n node._blockHoist = blockHoist;\n });\n\n const targetPath = this._programPath.get(\"body\").find(p => {\n const val = p.node._blockHoist;\n return Number.isFinite(val) && val < 4;\n });\n\n if (targetPath) {\n targetPath.insertBefore(statements);\n } else {\n this._programPath.unshiftContainer(\"body\", statements);\n }\n }\n}\n","import ImportInjector from \"./import-injector\";\n\nexport { ImportInjector };\n\nexport { default as isModule } from \"./is-module\";\n\nexport function addDefault(path, importedSource, opts) {\n return new ImportInjector(path).addDefault(importedSource, opts);\n}\n\nexport function addNamed(path, name, importedSource, opts) {\n return new ImportInjector(path).addNamed(name, importedSource, opts);\n}\n\nexport function addNamespace(path, importedSource, opts) {\n return new ImportInjector(path).addNamespace(importedSource, opts);\n}\n\nexport function addSideEffect(path, importedSource, opts) {\n return new ImportInjector(path).addSideEffect(importedSource, opts);\n}\n","// @flow\n\nimport * as t from \"@babel/types\";\nimport type { NodePath } from \"@babel/traverse\";\nimport { addSideEffect } from \"@babel/helper-module-imports\";\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport const has = Object.hasOwnProperty.call.bind(Object.hasOwnProperty);\n\nexport function getType(target: any): string {\n return Object.prototype.toString\n .call(target)\n .slice(8, -1)\n .toLowerCase();\n}\n\nexport function intersection(\n first: Set,\n second: Set,\n third: Set,\n): Set {\n const result = new Set();\n for (const el of first) {\n if (second.has(el) && third.has(el)) result.add(el);\n }\n return result;\n}\n\nexport function filterStageFromList(\n list: { [feature: string]: Targets },\n stageList: { [feature: string]: boolean },\n) {\n return Object.keys(list).reduce((result, item) => {\n if (!stageList[item]) {\n result[item] = list[item];\n }\n\n return result;\n }, {});\n}\n\nexport function getImportSource({ node }: NodePath) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath) {\n if (!t.isExpressionStatement(node)) return;\n const { expression } = node;\n const isRequire =\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee) &&\n expression.callee.name === \"require\" &&\n expression.arguments.length === 1 &&\n t.isStringLiteral(expression.arguments[0]);\n if (isRequire) return expression.arguments[0].value;\n}\n\nexport function isPolyfillSource(source: ?string): boolean {\n return source === \"@babel/polyfill\" || source === \"core-js\";\n}\n\nconst modulePathMap = {\n \"regenerator-runtime\": \"regenerator-runtime/runtime\",\n};\n\nexport function getModulePath(mod: string): string {\n return modulePathMap[mod] || `core-js/modules/${mod}`;\n}\n\nexport function createImport(path: NodePath, mod: string) {\n return addSideEffect(path, getModulePath(mod));\n}\n\nexport function isNamespaced(path: NodePath) {\n if (!path.node) return false;\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return false;\n return binding.path.isImportNamespaceSpecifier();\n}\n","// @flow\n\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport getPlatformSpecificDefaultFor from \"./get-platform-specific-default\";\nimport {\n BuiltIns,\n StaticProperties,\n InstanceProperties,\n} from \"./built-in-definitions\";\nimport {\n createImport,\n getType,\n has,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n isNamespaced,\n} from \"../../utils\";\nimport { logUsagePolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nconst NO_DIRECT_POLYFILL_IMPORT = `\n When setting \\`useBuiltIns: 'usage'\\`, polyfills are automatically imported when needed.\n Please remove the \\`import '@babel/polyfill'\\` call or use \\`useBuiltIns: 'entry'\\` instead.`;\n\nexport default function(\n { types: t }: { types: Object },\n { include, exclude, polyfillTargets, debug }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs2Polyfills,\n include,\n exclude,\n polyfillTargets,\n getPlatformSpecificDefaultFor(polyfillTargets),\n );\n\n const addAndRemovePolyfillImports = {\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n path.remove();\n }\n },\n\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n bodyPath.remove();\n }\n });\n },\n\n // Symbol()\n // new Promise\n ReferencedIdentifier({ node: { name }, parent, scope }: NodePath) {\n if (t.isMemberExpression(parent)) return;\n if (!has(BuiltIns, name)) return;\n if (scope.getBindingIdentifier(name)) return;\n\n const BuiltInDependencies = BuiltIns[name];\n this.addUnsupported(BuiltInDependencies);\n },\n\n // arr[Symbol.iterator]()\n CallExpression(path: NodePath) {\n // we can't compile this\n if (path.node.arguments.length) return;\n\n const callee = path.node.callee;\n\n if (!t.isMemberExpression(callee)) return;\n if (!callee.computed) return;\n if (!path.get(\"callee.property\").matchesPattern(\"Symbol.iterator\")) {\n return;\n }\n\n this.addImport(\"web.dom.iterable\");\n },\n\n // Symbol.iterator in arr\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n if (!path.get(\"left\").matchesPattern(\"Symbol.iterator\")) return;\n\n this.addImport(\"web.dom.iterable\");\n },\n\n // yield*\n YieldExpression(path: NodePath) {\n if (path.node.delegate) {\n this.addImport(\"web.dom.iterable\");\n }\n },\n\n // Array.from\n MemberExpression: {\n enter(path: NodePath) {\n const { node } = path;\n const { object, property } = node;\n\n // ignore namespace\n if (isNamespaced(path.get(\"object\"))) return;\n\n let evaluatedPropType = object.name;\n let propertyName = \"\";\n let instanceType = \"\";\n\n if (node.computed) {\n if (t.isStringLiteral(property)) {\n propertyName = property.value;\n } else {\n const result = path.get(\"property\").evaluate();\n if (result.confident && result.value) {\n propertyName = result.value;\n }\n }\n } else {\n propertyName = property.name;\n }\n\n if (path.scope.getBindingIdentifier(object.name)) {\n const result = path.get(\"object\").evaluate();\n if (result.value) {\n instanceType = getType(result.value);\n } else if (result.deopt && result.deopt.isIdentifier()) {\n evaluatedPropType = result.deopt.node.name;\n }\n }\n\n if (has(StaticProperties, evaluatedPropType)) {\n const BuiltInProperties = StaticProperties[evaluatedPropType];\n if (has(BuiltInProperties, propertyName)) {\n const StaticPropertyDependencies = BuiltInProperties[propertyName];\n this.addUnsupported(StaticPropertyDependencies);\n }\n }\n\n if (has(InstanceProperties, propertyName)) {\n let InstancePropertyDependencies = InstanceProperties[propertyName];\n if (instanceType) {\n InstancePropertyDependencies = InstancePropertyDependencies.filter(\n module => module.includes(instanceType),\n );\n }\n this.addUnsupported(InstancePropertyDependencies);\n }\n },\n\n // Symbol.match\n exit(path: NodePath) {\n const { name } = path.node.object;\n\n if (!has(BuiltIns, name)) return;\n if (path.scope.getBindingIdentifier(name)) return;\n\n const BuiltInDependencies = BuiltIns[name];\n this.addUnsupported(BuiltInDependencies);\n },\n },\n\n // var { repeat, startsWith } = String\n VariableDeclarator(path: NodePath) {\n const { node } = path;\n const { id, init } = node;\n\n if (!t.isObjectPattern(id)) return;\n\n // doesn't reference the global\n if (init && path.scope.getBindingIdentifier(init.name)) return;\n\n for (const { key } of id.properties) {\n if (\n !node.computed &&\n t.isIdentifier(key) &&\n has(InstanceProperties, key.name)\n ) {\n const InstancePropertyDependencies = InstanceProperties[key.name];\n this.addUnsupported(InstancePropertyDependencies);\n }\n }\n },\n };\n\n return {\n name: \"corejs2-usage\",\n pre({ path }: { path: NodePath }) {\n this.polyfillsSet = new Set();\n\n this.addImport = function(builtIn) {\n if (!this.polyfillsSet.has(builtIn)) {\n this.polyfillsSet.add(builtIn);\n createImport(path, builtIn);\n }\n };\n\n this.addUnsupported = function(builtIn) {\n const modules = Array.isArray(builtIn) ? builtIn : [builtIn];\n for (const module of modules) {\n if (polyfills.has(module)) {\n this.addImport(module);\n }\n }\n };\n },\n post() {\n if (debug) {\n logUsagePolyfills(\n this.polyfillsSet,\n this.file.opts.filename,\n polyfillTargets,\n corejs2Polyfills,\n );\n }\n },\n visitor: addAndRemovePolyfillImports,\n };\n}\n","// @flow\n\nexport default ([\"esnext.global-this\", \"esnext.string.match-all\"]: string[]);\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\nmodule.exports = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH,\n MAX_SAFE_INTEGER,\n MAX_SAFE_COMPONENT_LENGTH\n}\n","const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst createToken = (name, value, isGlobal) => {\n const index = R++\n debug(index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*')\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { re, t } = require('../internal/re')\n\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const {MAX_LENGTH} = require('../internal/constants')\nconst { re, t } = require('../internal/re')\nconst SemVer = require('../classes/semver')\n\nconst parse = (version, options) => {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n const r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst {re, t} = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null)\n return null\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","'use strict';\nconst cmp = require('semver/functions/cmp');\nconst semver = require('semver/functions/coerce');\n\nconst has = Function.call.bind({}.hasOwnProperty);\n\nfunction compare(a, operator, b) {\n return cmp(semver(a), operator, semver(b));\n}\n\nfunction intersection(list, order) {\n const set = list instanceof Set ? list : new Set(list);\n return order.filter(name => set.has(name));\n}\n\nfunction sortObjectByKey(object, fn) {\n return Object.keys(object).sort(fn).reduce((memo, key) => {\n memo[key] = object[key];\n return memo;\n }, {});\n}\n\nmodule.exports = {\n compare,\n has,\n intersection,\n semver,\n sortObjectByKey,\n};\n","'use strict';\nconst { compare, intersection, semver } = require('./helpers');\nconst modulesByVersions = require('./modules-by-versions');\nconst modules = require('./modules');\n\nmodule.exports = function (raw) {\n const corejs = semver(raw);\n if (corejs.major !== 3) {\n throw RangeError('This version of `core-js-compat` works only with `core-js@3`.');\n }\n const result = [];\n for (const version of Object.keys(modulesByVersions)) {\n if (compare(version, '<=', corejs)) {\n result.push(...modulesByVersions[version]);\n }\n }\n return intersection(result, modules);\n};\n","// @flow\n\ntype ObjectMap = { [name: string]: V };\n\nconst ArrayNatureIterators = [\n \"es.array.iterator\",\n \"web.dom-collections.iterator\",\n];\n\nexport const CommonIterators = [\"es.string.iterator\", ...ArrayNatureIterators];\n\nconst ArrayNatureIteratorsWithTag = [\n \"es.object.to-string\",\n ...ArrayNatureIterators,\n];\n\nconst CommonIteratorsWithTag = [\"es.object.to-string\", ...CommonIterators];\n\nconst TypedArrayDependencies = [\n \"es.typed-array.copy-within\",\n \"es.typed-array.every\",\n \"es.typed-array.fill\",\n \"es.typed-array.filter\",\n \"es.typed-array.find\",\n \"es.typed-array.find-index\",\n \"es.typed-array.for-each\",\n \"es.typed-array.includes\",\n \"es.typed-array.index-of\",\n \"es.typed-array.iterator\",\n \"es.typed-array.join\",\n \"es.typed-array.last-index-of\",\n \"es.typed-array.map\",\n \"es.typed-array.reduce\",\n \"es.typed-array.reduce-right\",\n \"es.typed-array.reverse\",\n \"es.typed-array.set\",\n \"es.typed-array.slice\",\n \"es.typed-array.some\",\n \"es.typed-array.sort\",\n \"es.typed-array.subarray\",\n \"es.typed-array.to-locale-string\",\n \"es.typed-array.to-string\",\n \"es.object.to-string\",\n \"es.array.iterator\",\n \"es.array-buffer.slice\",\n];\n\nconst TypedArrayStaticMethods = {\n from: \"es.typed-array.from\",\n of: \"es.typed-array.of\",\n};\n\nexport const PromiseDependencies = [\"es.promise\", \"es.object.to-string\"];\n\nconst PromiseDependenciesWithIterators = [\n ...PromiseDependencies,\n ...CommonIterators,\n];\n\nconst SymbolDependencies = [\n \"es.symbol\",\n \"es.symbol.description\",\n \"es.object.to-string\",\n];\n\nconst MapDependencies = [\n \"es.map\",\n \"esnext.map.delete-all\",\n \"esnext.map.every\",\n \"esnext.map.filter\",\n \"esnext.map.find\",\n \"esnext.map.find-key\",\n \"esnext.map.includes\",\n \"esnext.map.key-of\",\n \"esnext.map.map-keys\",\n \"esnext.map.map-values\",\n \"esnext.map.merge\",\n \"esnext.map.reduce\",\n \"esnext.map.some\",\n \"esnext.map.update\",\n ...CommonIteratorsWithTag,\n];\n\nconst SetDependencies = [\n \"es.set\",\n \"esnext.set.add-all\",\n \"esnext.set.delete-all\",\n \"esnext.set.difference\",\n \"esnext.set.every\",\n \"esnext.set.filter\",\n \"esnext.set.find\",\n \"esnext.set.intersection\",\n \"esnext.set.is-disjoint-from\",\n \"esnext.set.is-subset-of\",\n \"esnext.set.is-superset-of\",\n \"esnext.set.join\",\n \"esnext.set.map\",\n \"esnext.set.reduce\",\n \"esnext.set.some\",\n \"esnext.set.symmetric-difference\",\n \"esnext.set.union\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakMapDependencies = [\n \"es.weak-map\",\n \"esnext.weak-map.delete-all\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakSetDependencies = [\n \"es.weak-set\",\n \"esnext.weak-set.add-all\",\n \"esnext.weak-set.delete-all\",\n ...CommonIteratorsWithTag,\n];\n\nconst URLSearchParamsDependencies = [\"web.url\", ...CommonIteratorsWithTag];\n\nexport const BuiltIns: ObjectMap = {\n AggregateError: [\"esnext.aggregate-error\", ...CommonIterators],\n ArrayBuffer: [\n \"es.array-buffer.constructor\",\n \"es.array-buffer.slice\",\n \"es.object.to-string\",\n ],\n DataView: [\"es.data-view\", \"es.array-buffer.slice\", \"es.object.to-string\"],\n Date: [\"es.date.to-string\"],\n Float32Array: [\"es.typed-array.float32-array\", ...TypedArrayDependencies],\n Float64Array: [\"es.typed-array.float64-array\", ...TypedArrayDependencies],\n Int8Array: [\"es.typed-array.int8-array\", ...TypedArrayDependencies],\n Int16Array: [\"es.typed-array.int16-array\", ...TypedArrayDependencies],\n Int32Array: [\"es.typed-array.int32-array\", ...TypedArrayDependencies],\n Uint8Array: [\"es.typed-array.uint8-array\", ...TypedArrayDependencies],\n Uint8ClampedArray: [\n \"es.typed-array.uint8-clamped-array\",\n ...TypedArrayDependencies,\n ],\n Uint16Array: [\"es.typed-array.uint16-array\", ...TypedArrayDependencies],\n Uint32Array: [\"es.typed-array.uint32-array\", ...TypedArrayDependencies],\n Map: MapDependencies,\n Number: [\"es.number.constructor\"],\n Observable: [\n \"esnext.observable\",\n \"esnext.symbol.observable\",\n \"es.object.to-string\",\n ...CommonIteratorsWithTag,\n ],\n Promise: PromiseDependencies,\n RegExp: [\"es.regexp.constructor\", \"es.regexp.exec\", \"es.regexp.to-string\"],\n Set: SetDependencies,\n Symbol: SymbolDependencies,\n URL: [\"web.url\", ...URLSearchParamsDependencies],\n URLSearchParams: URLSearchParamsDependencies,\n WeakMap: WeakMapDependencies,\n WeakSet: WeakSetDependencies,\n clearImmediate: [\"web.immediate\"],\n compositeKey: [\"esnext.composite-key\"],\n compositeSymbol: [\"esnext.composite-symbol\", ...SymbolDependencies],\n fetch: PromiseDependencies,\n globalThis: [\"esnext.global-this\"],\n parseFloat: [\"es.parse-float\"],\n parseInt: [\"es.parse-int\"],\n queueMicrotask: [\"web.queue-microtask\"],\n setTimeout: [\"web.timers\"],\n setInterval: [\"web.timers\"],\n setImmediate: [\"web.immediate\"],\n};\n\nexport const InstanceProperties: ObjectMap = {\n at: [\"esnext.string.at\"],\n anchor: [\"es.string.anchor\"],\n big: [\"es.string.big\"],\n bind: [\"es.function.bind\"],\n blink: [\"es.string.blink\"],\n bold: [\"es.string.bold\"],\n codePointAt: [\"es.string.code-point-at\"],\n codePoints: [\"esnext.string.code-points\"],\n concat: [\"es.array.concat\"],\n copyWithin: [\"es.array.copy-within\"],\n description: [\"es.symbol\", \"es.symbol.description\"],\n endsWith: [\"es.string.ends-with\"],\n entries: ArrayNatureIteratorsWithTag,\n every: [\"es.array.every\"],\n exec: [\"es.regexp.exec\"],\n fill: [\"es.array.fill\"],\n filter: [\"es.array.filter\"],\n finally: [\"es.promise.finally\", ...PromiseDependencies],\n find: [\"es.array.find\"],\n findIndex: [\"es.array.find-index\"],\n fixed: [\"es.string.fixed\"],\n flags: [\"es.regexp.flags\"],\n flat: [\"es.array.flat\", \"es.array.unscopables.flat\"],\n flatMap: [\"es.array.flat-map\", \"es.array.unscopables.flat-map\"],\n fontcolor: [\"es.string.fontcolor\"],\n fontsize: [\"es.string.fontsize\"],\n forEach: [\"es.array.for-each\", \"web.dom-collections.for-each\"],\n includes: [\"es.array.includes\", \"es.string.includes\"],\n indexOf: [\"es.array.index-of\"],\n italics: [\"es.string.italics\"],\n join: [\"es.array.join\"],\n keys: ArrayNatureIteratorsWithTag,\n lastIndex: [\"esnext.array.last-index\"],\n lastIndexOf: [\"es.array.last-index-of\"],\n lastItem: [\"esnext.array.last-item\"],\n link: [\"es.string.link\"],\n match: [\"es.string.match\", \"es.regexp.exec\"],\n matchAll: [\"esnext.string.match-all\"],\n map: [\"es.array.map\"],\n name: [\"es.function.name\"],\n padEnd: [\"es.string.pad-end\"],\n padStart: [\"es.string.pad-start\"],\n reduce: [\"es.array.reduce\"],\n reduceRight: [\"es.array.reduce-right\"],\n repeat: [\"es.string.repeat\"],\n replace: [\"es.string.replace\", \"es.regexp.exec\"],\n replaceAll: [\"esnext.string.replace-all\"],\n reverse: [\"es.array.reverse\"],\n search: [\"es.string.search\", \"es.regexp.exec\"],\n slice: [\"es.array.slice\"],\n small: [\"es.string.small\"],\n some: [\"es.array.some\"],\n sort: [\"es.array.sort\"],\n splice: [\"es.array.splice\"],\n split: [\"es.string.split\", \"es.regexp.exec\"],\n startsWith: [\"es.string.starts-with\"],\n strike: [\"es.string.strike\"],\n sub: [\"es.string.sub\"],\n sup: [\"es.string.sup\"],\n toFixed: [\"es.number.to-fixed\"],\n toISOString: [\"es.date.to-iso-string\"],\n toJSON: [\"es.date.to-json\", \"web.url.to-json\"],\n toPrecision: [\"es.number.to-precision\"],\n toString: [\"es.object.to-string\", \"es.regexp.to-string\", \"es.date.to-string\"],\n trim: [\"es.string.trim\"],\n trimEnd: [\"es.string.trim-end\"],\n trimLeft: [\"es.string.trim-start\"],\n trimRight: [\"es.string.trim-end\"],\n trimStart: [\"es.string.trim-start\"],\n values: ArrayNatureIteratorsWithTag,\n __defineGetter__: [\"es.object.define-getter\"],\n __defineSetter__: [\"es.object.define-setter\"],\n __lookupGetter__: [\"es.object.lookup-getter\"],\n __lookupSetter__: [\"es.object.lookup-setter\"],\n};\n\nexport const StaticProperties: ObjectMap> = {\n Array: {\n from: [\"es.array.from\", \"es.string.iterator\"],\n isArray: [\"es.array.is-array\"],\n of: [\"es.array.of\"],\n },\n\n Date: {\n now: \"es.date.now\",\n },\n\n Object: {\n assign: \"es.object.assign\",\n create: \"es.object.create\",\n defineProperty: \"es.object.define-property\",\n defineProperties: \"es.object.define-properties\",\n entries: \"es.object.entries\",\n freeze: \"es.object.freeze\",\n fromEntries: [\"es.object.from-entries\", \"es.array.iterator\"],\n getOwnPropertyDescriptor: \"es.object.get-own-property-descriptor\",\n getOwnPropertyDescriptors: \"es.object.get-own-property-descriptors\",\n getOwnPropertyNames: \"es.object.get-own-property-names\",\n getOwnPropertySymbols: \"es.symbol\",\n getPrototypeOf: \"es.object.get-prototype-of\",\n is: \"es.object.is\",\n isExtensible: \"es.object.is-extensible\",\n isFrozen: \"es.object.is-frozen\",\n isSealed: \"es.object.is-sealed\",\n keys: \"es.object.keys\",\n preventExtensions: \"es.object.prevent-extensions\",\n seal: \"es.object.seal\",\n setPrototypeOf: \"es.object.set-prototype-of\",\n values: \"es.object.values\",\n },\n\n Math: {\n DEG_PER_RAD: \"esnext.math.deg-per-rad\",\n RAD_PER_DEG: \"esnext.math.rad-per-deg\",\n acosh: \"es.math.acosh\",\n asinh: \"es.math.asinh\",\n atanh: \"es.math.atanh\",\n cbrt: \"es.math.cbrt\",\n clamp: \"esnext.math.clamp\",\n clz32: \"es.math.clz32\",\n cosh: \"es.math.cosh\",\n degrees: \"esnext.math.degrees\",\n expm1: \"es.math.expm1\",\n fround: \"es.math.fround\",\n fscale: \"esnext.math.fscale\",\n hypot: \"es.math.hypot\",\n iaddh: \"esnext.math.iaddh\",\n imul: \"es.math.imul\",\n imulh: \"esnext.math.imulh\",\n isubh: \"esnext.math.isubh\",\n log1p: \"es.math.log1p\",\n log10: \"es.math.log10\",\n log2: \"es.math.log2\",\n radians: \"esnext.math.radians\",\n scale: \"esnext.math.scale\",\n seededPRNG: \"esnext.math.seeded-prng\",\n sign: \"es.math.sign\",\n signbit: \"esnext.math.signbit\",\n sinh: \"es.math.sinh\",\n tanh: \"es.math.tanh\",\n trunc: \"es.math.trunc\",\n umulh: \"esnext.math.umulh\",\n },\n\n String: {\n fromCodePoint: \"es.string.from-code-point\",\n raw: \"es.string.raw\",\n },\n\n Number: {\n EPSILON: \"es.number.epsilon\",\n MIN_SAFE_INTEGER: \"es.number.min-safe-integer\",\n MAX_SAFE_INTEGER: \"es.number.max-safe-integer\",\n fromString: \"esnext.number.from-string\",\n isFinite: \"es.number.is-finite\",\n isInteger: \"es.number.is-integer\",\n isSafeInteger: \"es.number.is-safe-integer\",\n isNaN: \"es.number.is-nan\",\n parseFloat: \"es.number.parse-float\",\n parseInt: \"es.number.parse-int\",\n },\n\n Map: {\n from: [\"esnext.map.from\", ...MapDependencies],\n groupBy: [\"esnext.map.group-by\", ...MapDependencies],\n keyBy: [\"esnext.map.key-by\", ...MapDependencies],\n of: [\"esnext.map.of\", ...MapDependencies],\n },\n\n Set: {\n from: [\"esnext.set.from\", ...SetDependencies],\n of: [\"esnext.set.of\", ...SetDependencies],\n },\n\n WeakMap: {\n from: [\"esnext.weak-map.from\", ...WeakMapDependencies],\n of: [\"esnext.weak-map.of\", ...WeakMapDependencies],\n },\n\n WeakSet: {\n from: [\"esnext.weak-set.from\", ...WeakSetDependencies],\n of: [\"esnext.weak-set.of\", ...WeakSetDependencies],\n },\n\n Promise: {\n all: PromiseDependenciesWithIterators,\n allSettled: [\n \"esnext.promise.all-settled\",\n ...PromiseDependenciesWithIterators,\n ],\n any: [\n \"esnext.promise.any\",\n \"esnext.aggregate-error\",\n ...PromiseDependenciesWithIterators,\n ],\n race: PromiseDependenciesWithIterators,\n try: [\"esnext.promise.try\", ...PromiseDependenciesWithIterators],\n },\n\n Reflect: {\n apply: \"es.reflect.apply\",\n construct: \"es.reflect.construct\",\n defineMetadata: \"esnext.reflect.define-metadata\",\n defineProperty: \"es.reflect.define-property\",\n deleteMetadata: \"esnext.reflect.delete-metadata\",\n deleteProperty: \"es.reflect.delete-property\",\n get: \"es.reflect.get\",\n getMetadata: \"esnext.reflect.get-metadata\",\n getMetadataKeys: \"esnext.reflect.get-metadata-keys\",\n getOwnMetadata: \"esnext.reflect.get-own-metadata\",\n getOwnMetadataKeys: \"esnext.reflect.get-own-metadata-keys\",\n getOwnPropertyDescriptor: \"es.reflect.get-own-property-descriptor\",\n getPrototypeOf: \"es.reflect.get-prototype-of\",\n has: \"es.reflect.has\",\n hasMetadata: \"esnext.reflect.has-metadata\",\n hasOwnMetadata: \"esnext.reflect.has-own-metadata\",\n isExtensible: \"es.reflect.is-extensible\",\n metadata: \"esnext.reflect.metadata\",\n ownKeys: \"es.reflect.own-keys\",\n preventExtensions: \"es.reflect.prevent-extensions\",\n set: \"es.reflect.set\",\n setPrototypeOf: \"es.reflect.set-prototype-of\",\n },\n\n Symbol: {\n asyncIterator: [\"es.symbol.async-iterator\"],\n dispose: [\"esnext.symbol.dispose\"],\n hasInstance: [\"es.symbol.has-instance\", \"es.function.has-instance\"],\n isConcatSpreadable: [\"es.symbol.is-concat-spreadable\", \"es.array.concat\"],\n iterator: [\"es.symbol.iterator\", ...CommonIteratorsWithTag],\n match: [\"es.symbol.match\", \"es.string.match\"],\n observable: [\"esnext.symbol.observable\"],\n patternMatch: [\"esnext.symbol.pattern-match\"],\n replace: [\"es.symbol.replace\", \"es.string.replace\"],\n search: [\"es.symbol.search\", \"es.string.search\"],\n species: [\"es.symbol.species\", \"es.array.species\"],\n split: [\"es.symbol.split\", \"es.string.split\"],\n toPrimitive: [\"es.symbol.to-primitive\", \"es.date.to-primitive\"],\n toStringTag: [\n \"es.symbol.to-string-tag\",\n \"es.object.to-string\",\n \"es.math.to-string-tag\",\n \"es.json.to-string-tag\",\n ],\n unscopables: [\"es.symbol.unscopables\"],\n },\n\n ArrayBuffer: {\n isView: [\"es.array-buffer.is-view\"],\n },\n\n Int8Array: TypedArrayStaticMethods,\n Uint8Array: TypedArrayStaticMethods,\n Uint8ClampedArray: TypedArrayStaticMethods,\n Int16Array: TypedArrayStaticMethods,\n Uint16Array: TypedArrayStaticMethods,\n Int32Array: TypedArrayStaticMethods,\n Uint32Array: TypedArrayStaticMethods,\n Float32Array: TypedArrayStaticMethods,\n Float64Array: TypedArrayStaticMethods,\n};\n\nexport const CommonInstanceDependencies = new Set([\n \"es.object.to-string\",\n \"es.object.define-getter\",\n \"es.object.define-setter\",\n \"es.object.lookup-getter\",\n \"es.object.lookup-setter\",\n \"es.regexp.exec\",\n]);\n\nexport const PossibleGlobalObjects = new Set([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n","// @flow\n\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport corejs3ShippedProposalsList from \"./shipped-proposals\";\nimport getModulesListForTargetVersion from \"core-js-compat/get-modules-list-for-target-version\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport {\n BuiltIns,\n StaticProperties,\n InstanceProperties,\n CommonIterators,\n CommonInstanceDependencies,\n PromiseDependencies,\n PossibleGlobalObjects,\n} from \"./built-in-definitions\";\nimport {\n createImport,\n getType,\n has,\n intersection,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n isNamespaced,\n} from \"../../utils\";\nimport { logUsagePolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nconst NO_DIRECT_POLYFILL_IMPORT = `\n When setting \\`useBuiltIns: 'usage'\\`, polyfills are automatically imported when needed.\n Please remove the direct import of \\`core-js\\` or use \\`useBuiltIns: 'entry'\\` instead.`;\n\nconst corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills)\n .filter(name => !name.startsWith(\"esnext.\"))\n .reduce((memo, key) => {\n memo[key] = corejs3Polyfills[key];\n return memo;\n }, {});\n\nconst corejs3PolyfillsWithShippedProposals = corejs3ShippedProposalsList.reduce(\n (memo, key) => {\n memo[key] = corejs3Polyfills[key];\n return memo;\n },\n { ...corejs3PolyfillsWithoutProposals },\n);\n\nexport default function(\n _: any,\n {\n corejs,\n include,\n exclude,\n polyfillTargets,\n proposals,\n shippedProposals,\n debug,\n }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n proposals\n ? corejs3Polyfills\n : shippedProposals\n ? corejs3PolyfillsWithShippedProposals\n : corejs3PolyfillsWithoutProposals,\n include,\n exclude,\n polyfillTargets,\n null,\n );\n\n const available = new Set(getModulesListForTargetVersion(corejs.version));\n\n function resolveKey(path, computed) {\n const { node, parent, scope } = path;\n if (path.isStringLiteral()) return node.value;\n const { name } = node;\n const isIdentifier = path.isIdentifier();\n if (isIdentifier && !(computed || parent.computed)) return name;\n if (!isIdentifier || scope.getBindingIdentifier(name)) {\n const { value } = path.evaluate();\n if (typeof value === \"string\") return value;\n }\n }\n\n function resolveSource(path) {\n const { node, scope } = path;\n let builtIn, instanceType;\n if (node) {\n builtIn = node.name;\n if (!path.isIdentifier() || scope.getBindingIdentifier(builtIn)) {\n const { deopt, value } = path.evaluate();\n if (value !== undefined) {\n instanceType = getType(value);\n } else if (deopt && deopt.isIdentifier()) {\n builtIn = deopt.node.name;\n }\n }\n }\n return { builtIn, instanceType, isNamespaced: isNamespaced(path) };\n }\n\n const addAndRemovePolyfillImports = {\n // import 'core-js'\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n path.remove();\n }\n },\n\n // require('core-js')\n Program: {\n enter(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n bodyPath.remove();\n }\n });\n },\n\n exit(path: NodePath) {\n const filtered = intersection(polyfills, this.polyfillsSet, available);\n const reversed = Array.from(filtered).reverse();\n\n for (const module of reversed) {\n // Program:exit could be called multiple times.\n // Avoid injecting the polyfills twice.\n if (!this.injectedPolyfills.has(module)) {\n createImport(path, module);\n }\n }\n\n filtered.forEach(module => this.injectedPolyfills.add(module));\n },\n },\n\n // import('something').then(...)\n Import() {\n this.addUnsupported(PromiseDependencies);\n },\n\n Function({ node }: NodePath) {\n // (async function () { }).finally(...)\n if (node.async) {\n this.addUnsupported(PromiseDependencies);\n }\n },\n\n // for-of, [a, b] = c\n \"ForOfStatement|ArrayPattern\"() {\n this.addUnsupported(CommonIterators);\n },\n\n // [...spread]\n SpreadElement({ parentPath }: NodePath) {\n if (!parentPath.isObjectExpression()) {\n this.addUnsupported(CommonIterators);\n }\n },\n\n // yield*\n YieldExpression({ node }: NodePath) {\n if (node.delegate) {\n this.addUnsupported(CommonIterators);\n }\n },\n\n // Symbol(), new Promise\n ReferencedIdentifier({ node: { name }, scope }: NodePath) {\n if (scope.getBindingIdentifier(name)) return;\n\n this.addBuiltInDependencies(name);\n },\n\n MemberExpression(path: NodePath) {\n const source = resolveSource(path.get(\"object\"));\n const key = resolveKey(path.get(\"property\"));\n\n // Object.entries\n // [1, 2, 3].entries\n this.addPropertyDependencies(source, key);\n },\n\n ObjectPattern(path: NodePath) {\n const { parentPath, parent, key } = path;\n let source;\n\n // const { keys, values } = Object\n if (parentPath.isVariableDeclarator()) {\n source = resolveSource(parentPath.get(\"init\"));\n // ({ keys, values } = Object)\n } else if (parentPath.isAssignmentExpression()) {\n source = resolveSource(parentPath.get(\"right\"));\n // !function ({ keys, values }) {...} (Object)\n // resolution does not work after properties transform :-(\n } else if (parentPath.isFunctionExpression()) {\n const grand = parentPath.parentPath;\n if (grand.isCallExpression() || grand.isNewExpression()) {\n if (grand.node.callee === parent) {\n source = resolveSource(grand.get(\"arguments\")[key]);\n }\n }\n }\n\n for (const property of path.get(\"properties\")) {\n if (property.isObjectProperty()) {\n const key = resolveKey(property.get(\"key\"));\n // const { keys, values } = Object\n // const { keys, values } = [1, 2, 3]\n this.addPropertyDependencies(source, key);\n }\n }\n },\n\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n\n const source = resolveSource(path.get(\"right\"));\n const key = resolveKey(path.get(\"left\"), true);\n\n // 'entries' in Object\n // 'entries' in [1, 2, 3]\n this.addPropertyDependencies(source, key);\n },\n };\n\n return {\n name: \"corejs3-usage\",\n pre() {\n this.injectedPolyfills = new Set();\n this.polyfillsSet = new Set();\n\n this.addUnsupported = function(builtIn) {\n const modules = Array.isArray(builtIn) ? builtIn : [builtIn];\n for (const module of modules) {\n this.polyfillsSet.add(module);\n }\n };\n\n this.addBuiltInDependencies = function(builtIn) {\n if (has(BuiltIns, builtIn)) {\n const BuiltInDependencies = BuiltIns[builtIn];\n this.addUnsupported(BuiltInDependencies);\n }\n };\n\n this.addPropertyDependencies = function(source = {}, key) {\n const { builtIn, instanceType, isNamespaced } = source;\n if (isNamespaced) return;\n if (PossibleGlobalObjects.has(builtIn)) {\n this.addBuiltInDependencies(key);\n } else if (has(StaticProperties, builtIn)) {\n const BuiltInProperties = StaticProperties[builtIn];\n if (has(BuiltInProperties, key)) {\n const StaticPropertyDependencies = BuiltInProperties[key];\n return this.addUnsupported(StaticPropertyDependencies);\n }\n }\n if (!has(InstanceProperties, key)) return;\n let InstancePropertyDependencies = InstanceProperties[key];\n if (instanceType) {\n InstancePropertyDependencies = InstancePropertyDependencies.filter(\n m => m.includes(instanceType) || CommonInstanceDependencies.has(m),\n );\n }\n this.addUnsupported(InstancePropertyDependencies);\n };\n },\n post() {\n if (debug) {\n logUsagePolyfills(\n this.injectedPolyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs3Polyfills,\n );\n }\n },\n visitor: addAndRemovePolyfillImports,\n };\n}\n","// @flow\n\nimport { createImport } from \"../../utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport default function() {\n return {\n name: \"regenerator-usage\",\n pre() {\n this.usesRegenerator = false;\n },\n visitor: {\n Function(path: NodePath) {\n const { node } = path;\n\n if (!this.usesRegenerator && (node.generator || node.async)) {\n this.usesRegenerator = true;\n createImport(path, \"regenerator-runtime\");\n }\n },\n },\n post() {\n if (this.opts.debug && this.usesRegenerator) {\n let filename = this.file.opts.filename;\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n console.log(\n `\\n[${filename}] Based on your code and targets, added regenerator-runtime.`,\n );\n }\n },\n };\n}\n","// @flow\n\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport getPlatformSpecificDefaultFor from \"./get-platform-specific-default\";\nimport {\n createImport,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n} from \"../../utils\";\nimport { logEntryPolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport default function(\n _: any,\n {\n include,\n exclude,\n polyfillTargets,\n regenerator,\n debug,\n }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs2Polyfills,\n include,\n exclude,\n polyfillTargets,\n getPlatformSpecificDefaultFor(polyfillTargets),\n );\n\n const isPolyfillImport = {\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n this.replaceBySeparateModulesImport(path);\n }\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n this.replaceBySeparateModulesImport(bodyPath);\n }\n });\n },\n };\n\n return {\n name: \"corejs2-entry\",\n visitor: isPolyfillImport,\n pre() {\n this.importPolyfillIncluded = false;\n\n this.replaceBySeparateModulesImport = function(path) {\n this.importPolyfillIncluded = true;\n\n if (regenerator) {\n createImport(path, \"regenerator-runtime\");\n }\n\n const modules = Array.from(polyfills).reverse();\n\n for (const module of modules) {\n createImport(path, module);\n }\n\n path.remove();\n };\n },\n post() {\n if (debug) {\n logEntryPolyfills(\n \"@babel/polyfill\",\n this.importPolyfillIncluded,\n polyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs2Polyfills,\n );\n }\n },\n };\n}\n","// @flow\n\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport corejsEntries from \"core-js-compat/entries\";\nimport getModulesListForTargetVersion from \"core-js-compat/get-modules-list-for-target-version\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport {\n has,\n intersection,\n createImport,\n getImportSource,\n getRequireSource,\n getModulePath,\n} from \"../../utils\";\nimport { logEntryPolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nfunction isBabelPolyfillSource(source) {\n return source === \"@babel/polyfill\" || source === \"babel-polyfill\";\n}\n\nfunction isCoreJSSource(source) {\n if (typeof source === \"string\") {\n source = source\n .replace(/\\\\/g, \"/\")\n .replace(/(\\/(index)?)?(\\.js)?$/i, \"\")\n .toLowerCase();\n }\n return has(corejsEntries, source) && corejsEntries[source];\n}\n\nconst BABEL_POLYFILL_DEPRECATION = `\n \\`@babel/polyfill\\` is deprecated. Please, use required parts of \\`core-js\\`\n and \\`regenerator-runtime/runtime\\` separately`;\n\nexport default function(\n _: any,\n { corejs, include, exclude, polyfillTargets, debug }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs3Polyfills,\n include,\n exclude,\n polyfillTargets,\n null,\n );\n\n const available = new Set(getModulesListForTargetVersion(corejs.version));\n\n function shouldReplace(source, modules) {\n if (!modules) return false;\n if (\n // Don't replace an import with itself to avoid an infinite loop\n modules.length === 1 &&\n polyfills.has(modules[0]) &&\n available.has(modules[0]) &&\n getModulePath(modules[0]) === source\n ) {\n return false;\n }\n return true;\n }\n\n const isPolyfillImport = {\n ImportDeclaration(path: NodePath) {\n const source = getImportSource(path);\n if (!source) return;\n if (isBabelPolyfillSource(source)) {\n console.warn(BABEL_POLYFILL_DEPRECATION);\n } else {\n const modules = isCoreJSSource(source);\n if (shouldReplace(source, modules)) {\n this.replaceBySeparateModulesImport(path, modules);\n }\n }\n },\n Program: {\n enter(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n const source = getRequireSource(bodyPath);\n if (!source) return;\n if (isBabelPolyfillSource(source)) {\n console.warn(BABEL_POLYFILL_DEPRECATION);\n } else {\n const modules = isCoreJSSource(source);\n if (shouldReplace(source, modules)) {\n this.replaceBySeparateModulesImport(bodyPath, modules);\n }\n }\n });\n },\n exit(path: NodePath) {\n const filtered = intersection(polyfills, this.polyfillsSet, available);\n const reversed = Array.from(filtered).reverse();\n\n for (const module of reversed) {\n // Program:exit could be called multiple times.\n // Avoid injecting the polyfills twice.\n if (!this.injectedPolyfills.has(module)) {\n createImport(path, module);\n }\n }\n\n filtered.forEach(module => this.injectedPolyfills.add(module));\n },\n },\n };\n\n return {\n name: \"corejs3-entry\",\n visitor: isPolyfillImport,\n pre() {\n this.injectedPolyfills = new Set();\n this.polyfillsSet = new Set();\n\n this.replaceBySeparateModulesImport = function(path, modules) {\n for (const module of modules) {\n this.polyfillsSet.add(module);\n }\n\n path.remove();\n };\n },\n post() {\n if (debug) {\n logEntryPolyfills(\n \"core-js\",\n this.injectedPolyfills.size > 0,\n this.injectedPolyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs3Polyfills,\n );\n }\n },\n };\n}\n","// @flow\n\nimport { getImportSource, getRequireSource } from \"../../utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nfunction isRegeneratorSource(source) {\n return source === \"regenerator-runtime/runtime\";\n}\n\nexport default function() {\n const visitor = {\n ImportDeclaration(path: NodePath) {\n if (isRegeneratorSource(getImportSource(path))) {\n this.regeneratorImportExcluded = true;\n path.remove();\n }\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isRegeneratorSource(getRequireSource(bodyPath))) {\n this.regeneratorImportExcluded = true;\n bodyPath.remove();\n }\n });\n },\n };\n\n return {\n name: \"regenerator-entry\",\n visitor,\n pre() {\n this.regeneratorImportExcluded = false;\n },\n post() {\n if (this.opts.debug && this.regeneratorImportExcluded) {\n let filename = this.file.opts.filename;\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n console.log(\n `\\n[${filename}] Based on your targets, regenerator-runtime import excluded.`,\n );\n }\n },\n };\n}\n","export function declare(builder) {\n return (api, options, dirname) => {\n if (!api.assertVersion) {\n // Inject a custom version of 'assertVersion' for Babel 6 and early\n // versions of Babel 7's beta that didn't have it.\n api = Object.assign(copyApiObject(api), {\n assertVersion(range) {\n throwVersionError(range, api.version);\n },\n });\n }\n\n return builder(api, options || {}, dirname);\n };\n}\n\nfunction copyApiObject(api) {\n // Babel >= 7 <= beta.41 passed the API as a new object that had\n // babel/core as the prototype. While slightly faster, it also\n // means that the Object.assign copy below fails. Rather than\n // keep complexity, the Babel 6 behavior has been reverted and this\n // normalizes all that for Babel 7.\n let proto = null;\n if (typeof api.version === \"string\" && /^7\\./.test(api.version)) {\n proto = Object.getPrototypeOf(api);\n if (\n proto &&\n (!has(proto, \"version\") ||\n !has(proto, \"transform\") ||\n !has(proto, \"template\") ||\n !has(proto, \"types\"))\n ) {\n proto = null;\n }\n }\n\n return {\n ...proto,\n ...api,\n };\n}\n\nfunction has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nfunction throwVersionError(range, version) {\n if (typeof range === \"number\") {\n if (!Number.isInteger(range)) {\n throw new Error(\"Expected string or integer value.\");\n }\n range = `^${range}.0.0-0`;\n }\n if (typeof range !== \"string\") {\n throw new Error(\"Expected string or integer value.\");\n }\n\n const limit = Error.stackTraceLimit;\n\n if (typeof limit === \"number\" && limit < 25) {\n // Bump up the limit if needed so that users are more likely\n // to be able to see what is calling Babel.\n Error.stackTraceLimit = 25;\n }\n\n let err;\n if (version.slice(0, 2) === \"7.\") {\n err = new Error(\n `Requires Babel \"^7.0.0-beta.41\", but was loaded with \"${version}\". ` +\n `You'll need to update your @babel/core version.`,\n );\n } else {\n err = new Error(\n `Requires Babel \"${range}\", but was loaded with \"${version}\". ` +\n `If you are sure you have a compatible version of @babel/core, ` +\n `it is likely that something in your build process is loading the ` +\n `wrong version. Inspect the stack trace of this error to look for ` +\n `the first entry that doesn't mention \"@babel/core\" or \"babel-core\" ` +\n `to see what is calling Babel.`,\n );\n }\n\n if (typeof limit === \"number\") {\n Error.stackTraceLimit = limit;\n }\n\n throw Object.assign(\n err,\n ({\n code: \"BABEL_VERSION_UNSUPPORTED\",\n version,\n range,\n }: any),\n );\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-json-strings\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"jsonStrings\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxJsonStrings from \"@babel/plugin-syntax-json-strings\";\n\nexport default declare(api => {\n api.assertVersion(7);\n const regex = /(\\\\*)([\\u2028\\u2029])/g;\n function replace(match, escapes, separator) {\n // If there's an odd number, that means the separator itself was escaped.\n // \"\\X\" escapes X.\n // \"\\\\X\" escapes the backslash, so X is unescaped.\n const isEscaped = escapes.length % 2 === 1;\n if (isEscaped) return match;\n\n return `${escapes}\\\\u${separator.charCodeAt(0).toString(16)}`;\n }\n\n return {\n name: \"proposal-json-strings\",\n inherits: syntaxJsonStrings,\n\n visitor: {\n \"DirectiveLiteral|StringLiteral\"({ node }) {\n const { extra } = node;\n if (!extra || !extra.raw) return;\n\n extra.raw = extra.raw.replace(regex, replace);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-dynamic-import\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"dynamicImport\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxDynamicImport from \"@babel/plugin-syntax-dynamic-import\";\nimport { version } from \"../package.json\";\n\nconst SUPPORTED_MODULES = [\"commonjs\", \"amd\", \"systemjs\"];\n\nconst MODULES_NOT_FOUND = `\\\n@babel/plugin-proposal-dynamic-import depends on a modules\ntransform plugin. Supported plugins are:\n - @babel/plugin-transform-modules-commonjs ^7.4.0\n - @babel/plugin-transform-modules-amd ^7.4.0\n - @babel/plugin-transform-modules-systemjs ^7.4.0\n\nIf you are using Webpack or Rollup and thus don't want\nBabel to transpile your imports and exports, you can use\nthe @babel/plugin-syntax-dynamic-import plugin and let your\nbundler handle dynamic imports.\n`;\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-dynamic-import\",\n inherits: syntaxDynamicImport,\n\n pre() {\n this.file.set(\"@babel/plugin-proposal-dynamic-import\", version);\n },\n\n visitor: {\n Program() {\n const modules = this.file.get(\"@babel/plugin-transform-modules-*\");\n\n if (!SUPPORTED_MODULES.includes(modules)) {\n throw new Error(MODULES_NOT_FOUND);\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-nullish-coalescing-operator\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"nullishCoalescingOperator\");\n },\n };\n});\n","import type NodePath from \"../index\";\nimport { react } from \"@babel/types\";\nimport * as t from \"@babel/types\";\n\nexport const ReferencedIdentifier = {\n types: [\"Identifier\", \"JSXIdentifier\"],\n checkPath(path: NodePath, opts?: Object): boolean {\n const { node, parent } = path;\n if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {\n if (t.isJSXIdentifier(node, opts)) {\n if (react.isCompatTag(node.name)) return false;\n } else {\n // not a JSXIdentifier or an Identifier\n return false;\n }\n }\n\n // check if node is referenced\n return t.isReferenced(node, parent, path.parentPath.parent);\n },\n};\n\nexport const ReferencedMemberExpression = {\n types: [\"MemberExpression\"],\n checkPath({ node, parent }) {\n return t.isMemberExpression(node) && t.isReferenced(node, parent);\n },\n};\n\nexport const BindingIdentifier = {\n types: [\"Identifier\"],\n checkPath(path: NodePath): boolean {\n const { node, parent } = path;\n const grandparent = path.parentPath.parent;\n return t.isIdentifier(node) && t.isBinding(node, parent, grandparent);\n },\n};\n\nexport const Statement = {\n types: [\"Statement\"],\n checkPath({ node, parent }: NodePath): boolean {\n if (t.isStatement(node)) {\n if (t.isVariableDeclaration(node)) {\n if (t.isForXStatement(parent, { left: node })) return false;\n if (t.isForStatement(parent, { init: node })) return false;\n }\n\n return true;\n } else {\n return false;\n }\n },\n};\n\nexport const Expression = {\n types: [\"Expression\"],\n checkPath(path: NodePath): boolean {\n if (path.isIdentifier()) {\n return path.isReferencedIdentifier();\n } else {\n return t.isExpression(path.node);\n }\n },\n};\n\nexport const Scope = {\n // When pattern is inside the function params, it is a scope\n types: [\"Scopable\", \"Pattern\"],\n checkPath(path) {\n return t.isScope(path.node, path.parent);\n },\n};\n\nexport const Referenced = {\n checkPath(path: NodePath): boolean {\n return t.isReferenced(path.node, path.parent);\n },\n};\n\nexport const BlockScoped = {\n checkPath(path: NodePath): boolean {\n return t.isBlockScoped(path.node);\n },\n};\n\nexport const Var = {\n types: [\"VariableDeclaration\"],\n checkPath(path: NodePath): boolean {\n return t.isVar(path.node);\n },\n};\n\nexport const User = {\n checkPath(path: NodePath): boolean {\n return path.node && !!path.node.loc;\n },\n};\n\nexport const Generated = {\n checkPath(path: NodePath): boolean {\n return !path.isUser();\n },\n};\n\nexport const Pure = {\n checkPath(path: NodePath, opts?): boolean {\n return path.scope.isPure(path.node, opts);\n },\n};\n\nexport const Flow = {\n types: [\"Flow\", \"ImportDeclaration\", \"ExportDeclaration\", \"ImportSpecifier\"],\n checkPath({ node }: NodePath): boolean {\n if (t.isFlow(node)) {\n return true;\n } else if (t.isImportDeclaration(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else if (t.isExportDeclaration(node)) {\n return node.exportKind === \"type\";\n } else if (t.isImportSpecifier(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else {\n return false;\n }\n },\n};\n\n// TODO: 7.0 Backwards Compat\nexport const RestProperty = {\n types: [\"RestElement\"],\n checkPath(path: NodePath): boolean {\n return path.parentPath && path.parentPath.isObjectPattern();\n },\n};\n\nexport const SpreadProperty = {\n types: [\"RestElement\"],\n checkPath(path: NodePath): boolean {\n return path.parentPath && path.parentPath.isObjectExpression();\n },\n};\n\nexport const ExistentialTypeParam = {\n types: [\"ExistsTypeAnnotation\"],\n};\n\nexport const NumericLiteralTypeAnnotation = {\n types: [\"NumberLiteralTypeAnnotation\"],\n};\n\nexport const ForAwaitStatement = {\n types: [\"ForOfStatement\"],\n checkPath({ node }: NodePath): boolean {\n return node.await === true;\n },\n};\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* Active `debug` instances.\n\t*/\n\tcreateDebug.instances = [];\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.enabled = createDebug.enabled(namespace);\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = selectColor(namespace);\n\t\tdebug.destroy = destroy;\n\t\tdebug.extend = extend;\n\t\t// Debug.formatArgs = formatArgs;\n\t\t// debug.rawLog = rawLog;\n\n\t\t// env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\tcreateDebug.instances.push(debug);\n\n\t\treturn debug;\n\t}\n\n\tfunction destroy() {\n\t\tconst index = createDebug.instances.indexOf(this);\n\t\tif (index !== -1) {\n\t\t\tcreateDebug.instances.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < createDebug.instances.length; i++) {\n\t\t\tconst instance = createDebug.instances[i];\n\t\t\tinstance.enabled = createDebug.enabled(instance.namespace);\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\nfunction log(...args) {\n\t// This hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn typeof console === 'object' &&\n\t\tconsole.log &&\n\t\tconsole.log(...args);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\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 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 isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\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 = value.replace(reTrim, '');\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","/**\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","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","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","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor;\n\n/**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\nfunction baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n}\n\nmodule.exports = baseRepeat;\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 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 baseRepeat = require('./_baseRepeat'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger'),\n toString = require('./toString');\n\n/**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\nfunction repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n}\n\nmodule.exports = repeat;\n","import type NodePath from \"../path\";\n\n/**\n * This class is responsible for a binding inside of a scope.\n *\n * It tracks the following:\n *\n * * Node path.\n * * Amount of times referenced by other nodes.\n * * Paths to nodes that reassign or modify this binding.\n * * The kind of binding. (Is it a parameter, declaration etc)\n */\n\nexport default class Binding {\n constructor({ identifier, scope, path, kind }) {\n this.identifier = identifier;\n this.scope = scope;\n this.path = path;\n this.kind = kind;\n\n this.constantViolations = [];\n this.constant = true;\n\n this.referencePaths = [];\n this.referenced = false;\n this.references = 0;\n\n this.clearValue();\n }\n\n constantViolations: Array;\n constant: boolean;\n\n referencePaths: Array;\n referenced: boolean;\n references: number;\n\n hasDeoptedValue: boolean;\n hasValue: boolean;\n value: any;\n\n deoptValue() {\n this.clearValue();\n this.hasDeoptedValue = true;\n }\n\n setValue(value: any) {\n if (this.hasDeoptedValue) return;\n this.hasValue = true;\n this.value = value;\n }\n\n clearValue() {\n this.hasDeoptedValue = false;\n this.hasValue = false;\n this.value = null;\n }\n\n /**\n * Register a constant violation with the provided `path`.\n */\n\n reassign(path: Object) {\n this.constant = false;\n if (this.constantViolations.indexOf(path) !== -1) {\n return;\n }\n this.constantViolations.push(path);\n }\n\n /**\n * Increment the amount of references to this binding.\n */\n\n reference(path: NodePath) {\n if (this.referencePaths.indexOf(path) !== -1) {\n return;\n }\n this.referenced = true;\n this.references++;\n this.referencePaths.push(path);\n }\n\n /**\n * Decrement the amount of references to this binding.\n */\n\n dereference() {\n this.references--;\n this.referenced = !!this.references;\n }\n}\n","import * as t from \"@babel/types\";\n\nexport default function splitExportDeclaration(exportDeclaration) {\n if (!exportDeclaration.isExportDeclaration()) {\n throw new Error(\"Only export declarations can be splitted.\");\n }\n\n // build specifiers that point back to this export declaration\n const isDefault = exportDeclaration.isExportDefaultDeclaration();\n const declaration = exportDeclaration.get(\"declaration\");\n const isClassDeclaration = declaration.isClassDeclaration();\n\n if (isDefault) {\n const standaloneDeclaration =\n declaration.isFunctionDeclaration() || isClassDeclaration;\n\n const scope = declaration.isScope()\n ? declaration.scope.parent\n : declaration.scope;\n\n let id = declaration.node.id;\n let needBindingRegistration = false;\n\n if (!id) {\n needBindingRegistration = true;\n\n id = scope.generateUidIdentifier(\"default\");\n\n if (\n standaloneDeclaration ||\n declaration.isFunctionExpression() ||\n declaration.isClassExpression()\n ) {\n declaration.node.id = t.cloneNode(id);\n }\n }\n\n const updatedDeclaration = standaloneDeclaration\n ? declaration\n : t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.cloneNode(id), declaration.node),\n ]);\n\n const updatedExportDeclaration = t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(id), t.identifier(\"default\")),\n ]);\n\n exportDeclaration.insertAfter(updatedExportDeclaration);\n exportDeclaration.replaceWith(updatedDeclaration);\n\n if (needBindingRegistration) {\n scope.registerDeclaration(exportDeclaration);\n }\n\n return exportDeclaration;\n }\n\n if (exportDeclaration.get(\"specifiers\").length > 0) {\n throw new Error(\"It doesn't make sense to split exported specifiers.\");\n }\n\n const bindingIdentifiers = declaration.getOuterBindingIdentifiers();\n\n const specifiers = Object.keys(bindingIdentifiers).map(name => {\n return t.exportSpecifier(t.identifier(name), t.identifier(name));\n });\n\n const aliasDeclar = t.exportNamedDeclaration(null, specifiers);\n\n exportDeclaration.insertAfter(aliasDeclar);\n exportDeclaration.replaceWith(declaration.node);\n return exportDeclaration;\n}\n","import Binding from \"../binding\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport * as t from \"@babel/types\";\n\nconst renameVisitor = {\n ReferencedIdentifier({ node }, state) {\n if (node.name === state.oldName) {\n node.name = state.newName;\n }\n },\n\n Scope(path, state) {\n if (\n !path.scope.bindingIdentifierEquals(\n state.oldName,\n state.binding.identifier,\n )\n ) {\n path.skip();\n }\n },\n\n \"AssignmentExpression|Declaration\"(path, state) {\n const ids = path.getOuterBindingIdentifiers();\n\n for (const name in ids) {\n if (name === state.oldName) ids[name].name = state.newName;\n }\n },\n};\n\nexport default class Renamer {\n constructor(binding: Binding, oldName: string, newName: string) {\n this.newName = newName;\n this.oldName = oldName;\n this.binding = binding;\n }\n\n oldName: string;\n newName: string;\n binding: Binding;\n\n maybeConvertFromExportDeclaration(parentDeclar) {\n const maybeExportDeclar = parentDeclar.parentPath;\n\n if (!maybeExportDeclar.isExportDeclaration()) {\n return;\n }\n\n if (\n maybeExportDeclar.isExportDefaultDeclaration() &&\n !maybeExportDeclar.get(\"declaration\").node.id\n ) {\n return;\n }\n\n splitExportDeclaration(maybeExportDeclar);\n }\n\n maybeConvertFromClassFunctionDeclaration(path) {\n return; // TODO\n\n // retain the `name` of a class/function declaration\n\n if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;\n if (this.binding.kind !== \"hoisted\") return;\n\n path.node.id = t.identifier(this.oldName);\n path.node._blockHoist = 3;\n\n path.replaceWith(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(\n t.identifier(this.newName),\n t.toExpression(path.node),\n ),\n ]),\n );\n }\n\n maybeConvertFromClassFunctionExpression(path) {\n return; // TODO\n\n // retain the `name` of a class/function expression\n\n if (!path.isFunctionExpression() && !path.isClassExpression()) return;\n if (this.binding.kind !== \"local\") return;\n\n path.node.id = t.identifier(this.oldName);\n\n this.binding.scope.parent.push({\n id: t.identifier(this.newName),\n });\n\n path.replaceWith(\n t.assignmentExpression(\"=\", t.identifier(this.newName), path.node),\n );\n }\n\n rename(block?) {\n const { binding, oldName, newName } = this;\n const { scope, path } = binding;\n\n const parentDeclar = path.find(\n path =>\n path.isDeclaration() ||\n path.isFunctionExpression() ||\n path.isClassExpression(),\n );\n if (parentDeclar) {\n const bindingIds = parentDeclar.getOuterBindingIdentifiers();\n if (bindingIds[oldName] === binding.identifier) {\n // When we are renaming an exported identifier, we need to ensure that\n // the exported binding keeps the old name.\n this.maybeConvertFromExportDeclaration(parentDeclar);\n }\n }\n\n scope.traverse(block || scope.block, renameVisitor, this);\n\n if (!block) {\n scope.removeOwnBinding(oldName);\n scope.bindings[newName] = binding;\n this.binding.identifier.name = newName;\n }\n\n if (binding.type === \"hoisted\") {\n // https://github.com/babel/babel/issues/2435\n // todo: hoist and convert function to a let\n }\n\n if (parentDeclar) {\n this.maybeConvertFromClassFunctionDeclaration(parentDeclar);\n this.maybeConvertFromClassFunctionExpression(parentDeclar);\n }\n }\n}\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 * 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 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","'use strict';\nmodule.exports = require('./globals.json');\n","export let path = new WeakMap();\nexport let scope = new WeakMap();\n\nexport function clear() {\n clearPath();\n clearScope();\n}\n\nexport function clearPath() {\n path = new WeakMap();\n}\n\nexport function clearScope() {\n scope = new WeakMap();\n}\n","import includes from \"lodash/includes\";\nimport repeat from \"lodash/repeat\";\nimport Renamer from \"./lib/renamer\";\nimport type NodePath from \"../path\";\nimport traverse from \"../index\";\nimport defaults from \"lodash/defaults\";\nimport Binding from \"./binding\";\nimport globals from \"globals\";\nimport * as t from \"@babel/types\";\nimport { scope as scopeCache } from \"../cache\";\n\n// Recursively gathers the identifying names of a node.\nfunction gatherNodeParts(node: Object, parts: Array) {\n if (t.isModuleDeclaration(node)) {\n if (node.source) {\n gatherNodeParts(node.source, parts);\n } else if (node.specifiers && node.specifiers.length) {\n for (const specifier of (node.specifiers: Array)) {\n gatherNodeParts(specifier, parts);\n }\n } else if (node.declaration) {\n gatherNodeParts(node.declaration, parts);\n }\n } else if (t.isModuleSpecifier(node)) {\n gatherNodeParts(node.local, parts);\n } else if (t.isMemberExpression(node)) {\n gatherNodeParts(node.object, parts);\n gatherNodeParts(node.property, parts);\n } else if (t.isIdentifier(node)) {\n parts.push(node.name);\n } else if (t.isLiteral(node)) {\n parts.push(node.value);\n } else if (t.isCallExpression(node)) {\n gatherNodeParts(node.callee, parts);\n } else if (t.isObjectExpression(node) || t.isObjectPattern(node)) {\n for (const prop of (node.properties: Array)) {\n gatherNodeParts(prop.key || prop.argument, parts);\n }\n } else if (t.isPrivateName(node)) {\n gatherNodeParts(node.id, parts);\n } else if (t.isThisExpression(node)) {\n parts.push(\"this\");\n } else if (t.isSuper(node)) {\n parts.push(\"super\");\n }\n}\n\n//\n\nconst collectorVisitor = {\n For(path) {\n for (const key of (t.FOR_INIT_KEYS: Array)) {\n const declar = path.get(key);\n if (declar.isVar()) {\n const parentScope =\n path.scope.getFunctionParent() || path.scope.getProgramParent();\n parentScope.registerBinding(\"var\", declar);\n }\n }\n },\n\n Declaration(path) {\n // delegate block scope handling to the `BlockScoped` method\n if (path.isBlockScoped()) return;\n\n // this will be hit again once we traverse into it after this iteration\n if (path.isExportDeclaration() && path.get(\"declaration\").isDeclaration()) {\n return;\n }\n\n // we've ran into a declaration!\n const parent =\n path.scope.getFunctionParent() || path.scope.getProgramParent();\n parent.registerDeclaration(path);\n },\n\n ReferencedIdentifier(path, state) {\n state.references.push(path);\n },\n\n ForXStatement(path, state) {\n const left = path.get(\"left\");\n if (left.isPattern() || left.isIdentifier()) {\n state.constantViolations.push(path);\n }\n },\n\n ExportDeclaration: {\n exit(path) {\n const { node, scope } = path;\n const declar = node.declaration;\n if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) {\n const id = declar.id;\n if (!id) return;\n\n const binding = scope.getBinding(id.name);\n if (binding) binding.reference(path);\n } else if (t.isVariableDeclaration(declar)) {\n for (const decl of (declar.declarations: Array)) {\n for (const name of Object.keys(t.getBindingIdentifiers(decl))) {\n const binding = scope.getBinding(name);\n if (binding) binding.reference(path);\n }\n }\n }\n },\n },\n\n LabeledStatement(path) {\n path.scope.getProgramParent().addGlobal(path.node);\n path.scope.getBlockParent().registerDeclaration(path);\n },\n\n AssignmentExpression(path, state) {\n state.assignments.push(path);\n },\n\n UpdateExpression(path, state) {\n state.constantViolations.push(path);\n },\n\n UnaryExpression(path, state) {\n if (path.node.operator === \"delete\") {\n state.constantViolations.push(path);\n }\n },\n\n BlockScoped(path) {\n let scope = path.scope;\n if (scope.path === path) scope = scope.parent;\n scope.getBlockParent().registerDeclaration(path);\n },\n\n ClassDeclaration(path) {\n const id = path.node.id;\n if (!id) return;\n\n const name = id.name;\n path.scope.bindings[name] = path.scope.getBinding(name);\n },\n\n Block(path) {\n const paths = path.get(\"body\");\n for (const bodyPath of (paths: Array)) {\n if (bodyPath.isFunctionDeclaration()) {\n path.scope.getBlockParent().registerDeclaration(bodyPath);\n }\n }\n },\n};\n\nlet uid = 0;\n\nexport default class Scope {\n /**\n * This searches the current \"scope\" and collects all references/bindings\n * within.\n */\n\n constructor(path: NodePath) {\n const { node } = path;\n const cached = scopeCache.get(node);\n // Sometimes, a scopable path is placed higher in the AST tree.\n // In these cases, have to create a new Scope.\n if (cached && cached.path === path) {\n return cached;\n }\n scopeCache.set(node, this);\n\n this.uid = uid++;\n\n this.block = node;\n this.path = path;\n\n this.labels = new Map();\n }\n\n /**\n * Globals.\n */\n\n static globals = Object.keys(globals.builtin);\n\n /**\n * Variables available in current context.\n */\n\n static contextVariables = [\"arguments\", \"undefined\", \"Infinity\", \"NaN\"];\n\n get parent() {\n const parent = this.path.findParent(p => p.isScope());\n return parent && parent.scope;\n }\n\n get parentBlock() {\n return this.path.parent;\n }\n\n get hub() {\n return this.path.hub;\n }\n\n /**\n * Traverse node with current scope and path.\n */\n\n traverse(node: Object, opts: Object, state?) {\n traverse(node, opts, this, state, this.path);\n }\n\n /**\n * Generate a unique identifier and add it to the current scope.\n */\n\n generateDeclaredUidIdentifier(name?: string) {\n const id = this.generateUidIdentifier(name);\n this.push({ id });\n return t.cloneNode(id);\n }\n\n /**\n * Generate a unique identifier.\n */\n\n generateUidIdentifier(name?: string) {\n return t.identifier(this.generateUid(name));\n }\n\n /**\n * Generate a unique `_id1` binding.\n */\n\n generateUid(name: string = \"temp\") {\n name = t\n .toIdentifier(name)\n .replace(/^_+/, \"\")\n .replace(/[0-9]+$/g, \"\");\n\n let uid;\n let i = 0;\n do {\n uid = this._generateUid(name, i);\n i++;\n } while (\n this.hasLabel(uid) ||\n this.hasBinding(uid) ||\n this.hasGlobal(uid) ||\n this.hasReference(uid)\n );\n\n const program = this.getProgramParent();\n program.references[uid] = true;\n program.uids[uid] = true;\n\n return uid;\n }\n\n /**\n * Generate an `_id1`.\n */\n\n _generateUid(name, i) {\n let id = name;\n if (i > 1) id += i;\n return `_${id}`;\n }\n\n generateUidBasedOnNode(parent: Object, defaultName?: String) {\n let node = parent;\n\n if (t.isAssignmentExpression(parent)) {\n node = parent.left;\n } else if (t.isVariableDeclarator(parent)) {\n node = parent.id;\n } else if (t.isObjectProperty(node) || t.isObjectMethod(node)) {\n node = node.key;\n }\n\n const parts = [];\n gatherNodeParts(node, parts);\n\n let id = parts.join(\"$\");\n id = id.replace(/^_/, \"\") || defaultName || \"ref\";\n\n return this.generateUid(id.slice(0, 20));\n }\n\n /**\n * Generate a unique identifier based on a node.\n */\n\n generateUidIdentifierBasedOnNode(\n parent: Object,\n defaultName?: String,\n ): Object {\n return t.identifier(this.generateUidBasedOnNode(parent, defaultName));\n }\n\n /**\n * Determine whether evaluating the specific input `node` is a consequenceless reference. ie.\n * evaluating it wont result in potentially arbitrary code from being ran. The following are\n * whitelisted and determined not to cause side effects:\n *\n * - `this` expressions\n * - `super` expressions\n * - Bound identifiers\n */\n\n isStatic(node: Object): boolean {\n if (t.isThisExpression(node) || t.isSuper(node)) {\n return true;\n }\n\n if (t.isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (binding) {\n return binding.constant;\n } else {\n return this.hasBinding(node.name);\n }\n }\n\n return false;\n }\n\n /**\n * Possibly generate a memoised identifier if it is not static and has consequences.\n */\n\n maybeGenerateMemoised(node: Object, dontPush?: boolean): ?Object {\n if (this.isStatic(node)) {\n return null;\n } else {\n const id = this.generateUidIdentifierBasedOnNode(node);\n if (!dontPush) {\n this.push({ id });\n return t.cloneNode(id);\n }\n return id;\n }\n }\n\n checkBlockScopedCollisions(local, kind: string, name: string, id: Object) {\n // ignore parameters\n if (kind === \"param\") return;\n\n // Ignore existing binding if it's the name of the current function or\n // class expression\n if (local.kind === \"local\") return;\n\n const duplicate =\n // don't allow duplicate bindings to exist alongside\n kind === \"let\" ||\n local.kind === \"let\" ||\n local.kind === \"const\" ||\n local.kind === \"module\" ||\n // don't allow a local of param with a kind of let\n (local.kind === \"param\" && (kind === \"let\" || kind === \"const\"));\n\n if (duplicate) {\n throw this.hub.buildError(\n id,\n `Duplicate declaration \"${name}\"`,\n TypeError,\n );\n }\n }\n\n rename(oldName: string, newName: string, block?) {\n const binding = this.getBinding(oldName);\n if (binding) {\n newName = newName || this.generateUidIdentifier(oldName).name;\n return new Renamer(binding, oldName, newName).rename(block);\n }\n }\n\n _renameFromMap(map, oldName, newName, value) {\n if (map[oldName]) {\n map[newName] = value;\n map[oldName] = null;\n }\n }\n\n dump() {\n const sep = repeat(\"-\", 60);\n console.log(sep);\n let scope = this;\n do {\n console.log(\"#\", scope.block.type);\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n console.log(\" -\", name, {\n constant: binding.constant,\n references: binding.references,\n violations: binding.constantViolations.length,\n kind: binding.kind,\n });\n }\n } while ((scope = scope.parent));\n console.log(sep);\n }\n\n toArray(node: Object, i?: number) {\n if (t.isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (binding && binding.constant && binding.path.isGenericType(\"Array\")) {\n return node;\n }\n }\n\n if (t.isArrayExpression(node)) {\n return node;\n }\n\n if (t.isIdentifier(node, { name: \"arguments\" })) {\n return t.callExpression(\n t.memberExpression(\n t.memberExpression(\n t.memberExpression(\n t.identifier(\"Array\"),\n t.identifier(\"prototype\"),\n ),\n t.identifier(\"slice\"),\n ),\n t.identifier(\"call\"),\n ),\n [node],\n );\n }\n\n let helperName;\n const args = [node];\n if (i === true) {\n // Used in array-spread to create an array.\n helperName = \"toConsumableArray\";\n } else if (i) {\n args.push(t.numericLiteral(i));\n\n // Used in array-rest to create an array from a subset of an iterable.\n helperName = \"slicedToArray\";\n // TODO if (this.hub.isLoose(\"es6.forOf\")) helperName += \"-loose\";\n } else {\n // Used in array-rest to create an array\n helperName = \"toArray\";\n }\n return t.callExpression(this.hub.addHelper(helperName), args);\n }\n\n hasLabel(name: string) {\n return !!this.getLabel(name);\n }\n\n getLabel(name: string) {\n return this.labels.get(name);\n }\n\n registerLabel(path: NodePath) {\n this.labels.set(path.node.label.name, path);\n }\n\n registerDeclaration(path: NodePath) {\n if (path.isLabeledStatement()) {\n this.registerLabel(path);\n } else if (path.isFunctionDeclaration()) {\n this.registerBinding(\"hoisted\", path.get(\"id\"), path);\n } else if (path.isVariableDeclaration()) {\n const declarations = path.get(\"declarations\");\n for (const declar of (declarations: Array)) {\n this.registerBinding(path.node.kind, declar);\n }\n } else if (path.isClassDeclaration()) {\n this.registerBinding(\"let\", path);\n } else if (path.isImportDeclaration()) {\n const specifiers = path.get(\"specifiers\");\n for (const specifier of (specifiers: Array)) {\n this.registerBinding(\"module\", specifier);\n }\n } else if (path.isExportDeclaration()) {\n const declar = path.get(\"declaration\");\n if (\n declar.isClassDeclaration() ||\n declar.isFunctionDeclaration() ||\n declar.isVariableDeclaration()\n ) {\n this.registerDeclaration(declar);\n }\n } else {\n this.registerBinding(\"unknown\", path);\n }\n }\n\n buildUndefinedNode() {\n return t.unaryExpression(\"void\", t.numericLiteral(0), true);\n }\n\n registerConstantViolation(path: NodePath) {\n const ids = path.getBindingIdentifiers();\n for (const name of Object.keys(ids)) {\n const binding = this.getBinding(name);\n if (binding) binding.reassign(path);\n }\n }\n\n registerBinding(kind: string, path: NodePath, bindingPath = path) {\n if (!kind) throw new ReferenceError(\"no `kind`\");\n\n if (path.isVariableDeclaration()) {\n const declarators: Array = path.get(\"declarations\");\n for (const declar of declarators) {\n this.registerBinding(kind, declar);\n }\n return;\n }\n\n const parent = this.getProgramParent();\n const ids = path.getOuterBindingIdentifiers(true);\n\n for (const name of Object.keys(ids)) {\n for (const id of (ids[name]: Array)) {\n const local = this.getOwnBinding(name);\n\n if (local) {\n // same identifier so continue safely as we're likely trying to register it\n // multiple times\n if (local.identifier === id) continue;\n\n this.checkBlockScopedCollisions(local, kind, name, id);\n }\n\n parent.references[name] = true;\n\n // A redeclaration of an existing variable is a modification\n if (local) {\n this.registerConstantViolation(bindingPath);\n } else {\n this.bindings[name] = new Binding({\n identifier: id,\n scope: this,\n path: bindingPath,\n kind: kind,\n });\n }\n }\n }\n }\n\n addGlobal(node: Object) {\n this.globals[node.name] = node;\n }\n\n hasUid(name): boolean {\n let scope = this;\n\n do {\n if (scope.uids[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n hasGlobal(name: string): boolean {\n let scope = this;\n\n do {\n if (scope.globals[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n hasReference(name: string): boolean {\n let scope = this;\n\n do {\n if (scope.references[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n isPure(node, constantsOnly?: boolean) {\n if (t.isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (!binding) return false;\n if (constantsOnly) return binding.constant;\n return true;\n } else if (t.isClass(node)) {\n if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {\n return false;\n }\n return this.isPure(node.body, constantsOnly);\n } else if (t.isClassBody(node)) {\n for (const method of node.body) {\n if (!this.isPure(method, constantsOnly)) return false;\n }\n return true;\n } else if (t.isBinary(node)) {\n return (\n this.isPure(node.left, constantsOnly) &&\n this.isPure(node.right, constantsOnly)\n );\n } else if (t.isArrayExpression(node)) {\n for (const elem of (node.elements: Array)) {\n if (!this.isPure(elem, constantsOnly)) return false;\n }\n return true;\n } else if (t.isObjectExpression(node)) {\n for (const prop of (node.properties: Array)) {\n if (!this.isPure(prop, constantsOnly)) return false;\n }\n return true;\n } else if (t.isClassMethod(node)) {\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n if (node.kind === \"get\" || node.kind === \"set\") return false;\n return true;\n } else if (t.isProperty(node)) {\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n return this.isPure(node.value, constantsOnly);\n } else if (t.isUnaryExpression(node)) {\n return this.isPure(node.argument, constantsOnly);\n } else if (t.isTaggedTemplateExpression(node)) {\n return (\n t.matchesPattern(node.tag, \"String.raw\") &&\n !this.hasBinding(\"String\", true) &&\n this.isPure(node.quasi, constantsOnly)\n );\n } else if (t.isTemplateLiteral(node)) {\n for (const expression of (node.expressions: Array)) {\n if (!this.isPure(expression, constantsOnly)) return false;\n }\n return true;\n } else {\n return t.isPureish(node);\n }\n }\n\n /**\n * Set some arbitrary data on the current scope.\n */\n\n setData(key, val) {\n return (this.data[key] = val);\n }\n\n /**\n * Recursively walk up scope tree looking for the data `key`.\n */\n\n getData(key) {\n let scope = this;\n do {\n const data = scope.data[key];\n if (data != null) return data;\n } while ((scope = scope.parent));\n }\n\n /**\n * Recursively walk up scope tree looking for the data `key` and if it exists,\n * remove it.\n */\n\n removeData(key) {\n let scope = this;\n do {\n const data = scope.data[key];\n if (data != null) scope.data[key] = null;\n } while ((scope = scope.parent));\n }\n\n init() {\n if (!this.references) this.crawl();\n }\n\n crawl() {\n const path = this.path;\n\n this.references = Object.create(null);\n this.bindings = Object.create(null);\n this.globals = Object.create(null);\n this.uids = Object.create(null);\n this.data = Object.create(null);\n\n // ForStatement - left, init\n\n if (path.isLoop()) {\n for (const key of (t.FOR_INIT_KEYS: Array)) {\n const node = path.get(key);\n if (node.isBlockScoped()) this.registerBinding(node.node.kind, node);\n }\n }\n\n // FunctionExpression - id\n\n if (path.isFunctionExpression() && path.has(\"id\")) {\n if (!path.get(\"id\").node[t.NOT_LOCAL_BINDING]) {\n this.registerBinding(\"local\", path.get(\"id\"), path);\n }\n }\n\n // Class\n\n if (path.isClassExpression() && path.has(\"id\")) {\n if (!path.get(\"id\").node[t.NOT_LOCAL_BINDING]) {\n this.registerBinding(\"local\", path);\n }\n }\n\n // Function - params, rest\n\n if (path.isFunction()) {\n const params: Array = path.get(\"params\");\n for (const param of params) {\n this.registerBinding(\"param\", param);\n }\n }\n\n // CatchClause - param\n\n if (path.isCatchClause()) {\n this.registerBinding(\"let\", path);\n }\n\n // Program\n\n const parent = this.getProgramParent();\n if (parent.crawling) return;\n\n const state = {\n references: [],\n constantViolations: [],\n assignments: [],\n };\n\n this.crawling = true;\n path.traverse(collectorVisitor, state);\n this.crawling = false;\n\n // register assignments\n for (const path of state.assignments) {\n // register undeclared bindings as globals\n const ids = path.getBindingIdentifiers();\n let programParent;\n for (const name of Object.keys(ids)) {\n if (path.scope.getBinding(name)) continue;\n\n programParent = programParent || path.scope.getProgramParent();\n programParent.addGlobal(ids[name]);\n }\n\n // register as constant violation\n path.scope.registerConstantViolation(path);\n }\n\n // register references\n for (const ref of state.references) {\n const binding = ref.scope.getBinding(ref.node.name);\n if (binding) {\n binding.reference(ref);\n } else {\n ref.scope.getProgramParent().addGlobal(ref.node);\n }\n }\n\n // register constant violations\n for (const path of state.constantViolations) {\n path.scope.registerConstantViolation(path);\n }\n }\n\n push(opts: {\n id: Object,\n init: ?Object,\n unique: ?boolean,\n _blockHoist: ?number,\n kind: \"var\" | \"let\",\n }) {\n let path = this.path;\n\n if (!path.isBlockStatement() && !path.isProgram()) {\n path = this.getBlockParent().path;\n }\n\n if (path.isSwitchStatement()) {\n path = (this.getFunctionParent() || this.getProgramParent()).path;\n }\n\n if (path.isLoop() || path.isCatchClause() || path.isFunction()) {\n path.ensureBlock();\n path = path.get(\"body\");\n }\n\n const unique = opts.unique;\n const kind = opts.kind || \"var\";\n const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;\n\n const dataKey = `declaration:${kind}:${blockHoist}`;\n let declarPath = !unique && path.getData(dataKey);\n\n if (!declarPath) {\n const declar = t.variableDeclaration(kind, []);\n declar._blockHoist = blockHoist;\n\n [declarPath] = path.unshiftContainer(\"body\", [declar]);\n if (!unique) path.setData(dataKey, declarPath);\n }\n\n const declarator = t.variableDeclarator(opts.id, opts.init);\n declarPath.node.declarations.push(declarator);\n this.registerBinding(kind, declarPath.get(\"declarations\").pop());\n }\n\n /**\n * Walk up to the top of the scope tree and get the `Program`.\n */\n\n getProgramParent() {\n let scope = this;\n do {\n if (scope.path.isProgram()) {\n return scope;\n }\n } while ((scope = scope.parent));\n throw new Error(\"Couldn't find a Program\");\n }\n\n /**\n * Walk up the scope tree until we hit either a Function or return null.\n */\n\n getFunctionParent() {\n let scope = this;\n do {\n if (scope.path.isFunctionParent()) {\n return scope;\n }\n } while ((scope = scope.parent));\n return null;\n }\n\n /**\n * Walk up the scope tree until we hit either a BlockStatement/Loop/Program/Function/Switch or reach the\n * very top and hit Program.\n */\n\n getBlockParent() {\n let scope = this;\n do {\n if (scope.path.isBlockParent()) {\n return scope;\n }\n } while ((scope = scope.parent));\n throw new Error(\n \"We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...\",\n );\n }\n\n /**\n * Walks the scope tree and gathers **all** bindings.\n */\n\n getAllBindings(): Object {\n const ids = Object.create(null);\n\n let scope = this;\n do {\n defaults(ids, scope.bindings);\n scope = scope.parent;\n } while (scope);\n\n return ids;\n }\n\n /**\n * Walks the scope tree and gathers all declarations of `kind`.\n */\n\n getAllBindingsOfKind(): Object {\n const ids = Object.create(null);\n\n for (const kind of (arguments: Array)) {\n let scope = this;\n do {\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n if (binding.kind === kind) ids[name] = binding;\n }\n scope = scope.parent;\n } while (scope);\n }\n\n return ids;\n }\n\n bindingIdentifierEquals(name: string, node: Object): boolean {\n return this.getBindingIdentifier(name) === node;\n }\n\n getBinding(name: string) {\n let scope = this;\n let previousPath;\n\n do {\n const binding = scope.getOwnBinding(name);\n if (binding) {\n // Check if a pattern is a part of parameter expressions.\n // 9.2.10.28: The closure created by this expression should not have visibility of\n // declarations in the function body. If the binding is not a `param`-kind,\n // then it must be defined inside the function body, thus it should be skipped\n if (\n previousPath &&\n previousPath.isPattern() &&\n previousPath.parentPath.isFunction() &&\n binding.kind !== \"param\"\n ) {\n // do nothing\n } else {\n return binding;\n }\n }\n previousPath = scope.path;\n } while ((scope = scope.parent));\n }\n\n getOwnBinding(name: string) {\n return this.bindings[name];\n }\n\n getBindingIdentifier(name: string) {\n const info = this.getBinding(name);\n return info && info.identifier;\n }\n\n getOwnBindingIdentifier(name: string) {\n const binding = this.bindings[name];\n return binding && binding.identifier;\n }\n\n hasOwnBinding(name: string) {\n return !!this.getOwnBinding(name);\n }\n\n hasBinding(name: string, noGlobals?) {\n if (!name) return false;\n if (this.hasOwnBinding(name)) return true;\n if (this.parentHasBinding(name, noGlobals)) return true;\n if (this.hasUid(name)) return true;\n if (!noGlobals && includes(Scope.globals, name)) return true;\n if (!noGlobals && includes(Scope.contextVariables, name)) return true;\n return false;\n }\n\n parentHasBinding(name: string, noGlobals?) {\n return this.parent && this.parent.hasBinding(name, noGlobals);\n }\n\n /**\n * Move a binding of `name` to another `scope`.\n */\n\n moveBindingTo(name, scope) {\n const info = this.getBinding(name);\n if (info) {\n info.scope.removeOwnBinding(name);\n info.scope = scope;\n scope.bindings[name] = info;\n }\n }\n\n removeOwnBinding(name: string) {\n delete this.bindings[name];\n }\n\n removeBinding(name: string) {\n // clear literal binding\n const info = this.getBinding(name);\n if (info) {\n info.scope.removeOwnBinding(name);\n }\n\n // clear uids with this name - https://github.com/babel/babel/issues/2101\n let scope = this;\n do {\n if (scope.uids[name]) {\n scope.uids[name] = false;\n }\n } while ((scope = scope.parent));\n }\n}\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","import sourceMap from \"source-map\";\n\n/**\n * Build a sourcemap.\n */\n\nexport default class SourceMap {\n constructor(opts, code) {\n this._cachedMap = null;\n this._code = code;\n this._opts = opts;\n this._rawMappings = [];\n }\n\n /**\n * Get the sourcemap.\n */\n\n get() {\n if (!this._cachedMap) {\n const map = (this._cachedMap = new sourceMap.SourceMapGenerator({\n sourceRoot: this._opts.sourceRoot,\n }));\n\n const code = this._code;\n if (typeof code === \"string\") {\n map.setSourceContent(\n this._opts.sourceFileName.replace(/\\\\/g, \"/\"),\n code,\n );\n } else if (typeof code === \"object\") {\n Object.keys(code).forEach(sourceFileName => {\n map.setSourceContent(\n sourceFileName.replace(/\\\\/g, \"/\"),\n code[sourceFileName],\n );\n });\n }\n\n this._rawMappings.forEach(mapping => map.addMapping(mapping), map);\n }\n\n return this._cachedMap.toJSON();\n }\n\n getRawMappings() {\n return this._rawMappings.slice();\n }\n\n /**\n * Mark the current generated position with a source position. May also be passed null line/column\n * values to insert a mapping to nothing.\n */\n\n mark(\n generatedLine: number,\n generatedColumn: number,\n line: number,\n column: number,\n identifierName: ?string,\n filename: ?string,\n force?: boolean,\n ) {\n // Adding an empty mapping at the start of a generated line just clutters the map.\n if (this._lastGenLine !== generatedLine && line === null) return;\n\n // If this mapping points to the same source location as the last one, we can ignore it since\n // the previous one covers it.\n if (\n !force &&\n this._lastGenLine === generatedLine &&\n this._lastSourceLine === line &&\n this._lastSourceColumn === column\n ) {\n return;\n }\n\n this._cachedMap = null;\n this._lastGenLine = generatedLine;\n this._lastSourceLine = line;\n this._lastSourceColumn = column;\n\n // We are deliberately not using the `source-map` library here to allow\n // callers to use these mappings without any overhead\n this._rawMappings.push({\n // undefined to allow for more compact json serialization\n name: identifierName || undefined,\n generated: {\n line: generatedLine,\n column: generatedColumn,\n },\n source:\n line == null\n ? undefined\n : (filename || this._opts.sourceFileName).replace(/\\\\/g, \"/\"),\n original:\n line == null\n ? undefined\n : {\n line: line,\n column: column,\n },\n });\n }\n}\n","var toInteger = require('./toInteger');\n\n/**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\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 integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\nfunction isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n}\n\nmodule.exports = isInteger;\n","import type SourceMap from \"./source-map\";\n\nconst SPACES_RE = /^[ \\t]+$/;\n\n/**\n * The Buffer class exists to manage the queue of tokens being pushed onto the output string\n * in such a way that the final string buffer is treated as write-only until the final .get()\n * call. This allows V8 to optimize the output efficiently by not requiring it to store the\n * string in contiguous memory.\n */\n\nexport default class Buffer {\n constructor(map: ?SourceMap) {\n this._map = map;\n }\n\n _map: SourceMap = null;\n _buf: Array = [];\n _last: string = \"\";\n _queue: Array = [];\n\n _position: Object = {\n line: 1,\n column: 0,\n };\n _sourcePosition: Object = {\n identifierName: null,\n line: null,\n column: null,\n filename: null,\n };\n _disallowedPop: Object | null = null;\n\n /**\n * Get the final string output from the buffer, along with the sourcemap if one exists.\n */\n\n get(): Object {\n this._flush();\n\n const map = this._map;\n const result = {\n // Whatever trim is used here should not execute a regex against the\n // source string since it may be arbitrarily large after all transformations\n code: this._buf.join(\"\").trimRight(),\n map: null,\n rawMappings: map && map.getRawMappings(),\n };\n\n if (map) {\n // The `.map` property is lazy to allow callers to use the raw mappings\n // without any overhead\n Object.defineProperty(result, \"map\", {\n configurable: true,\n enumerable: true,\n get() {\n return (this.map = map.get());\n },\n set(value) {\n Object.defineProperty(this, \"map\", { value, writable: true });\n },\n });\n }\n\n return result;\n }\n\n /**\n * Add a string to the buffer that cannot be reverted.\n */\n\n append(str: string): void {\n this._flush();\n const {\n line,\n column,\n filename,\n identifierName,\n force,\n } = this._sourcePosition;\n this._append(str, line, column, identifierName, filename, force);\n }\n\n /**\n * Add a string to the buffer than can be reverted.\n */\n\n queue(str: string): void {\n // Drop trailing spaces when a newline is inserted.\n if (str === \"\\n\") {\n while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {\n this._queue.shift();\n }\n }\n\n const {\n line,\n column,\n filename,\n identifierName,\n force,\n } = this._sourcePosition;\n this._queue.unshift([str, line, column, identifierName, filename, force]);\n }\n\n _flush(): void {\n let item;\n while ((item = this._queue.pop())) this._append(...item);\n }\n\n _append(\n str: string,\n line: number,\n column: number,\n identifierName: ?string,\n filename: ?string,\n force?: boolean,\n ): void {\n // If there the line is ending, adding a new mapping marker is redundant\n if (this._map && str[0] !== \"\\n\") {\n this._map.mark(\n this._position.line,\n this._position.column,\n line,\n column,\n identifierName,\n filename,\n force,\n );\n }\n\n this._buf.push(str);\n this._last = str[str.length - 1];\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] === \"\\n\") {\n this._position.line++;\n this._position.column = 0;\n } else {\n this._position.column++;\n }\n }\n }\n\n removeTrailingNewline(): void {\n if (this._queue.length > 0 && this._queue[0][0] === \"\\n\") {\n this._queue.shift();\n }\n }\n\n removeLastSemicolon(): void {\n if (this._queue.length > 0 && this._queue[0][0] === \";\") {\n this._queue.shift();\n }\n }\n\n endsWith(suffix: string): boolean {\n // Fast path to avoid iterating over this._queue.\n if (suffix.length === 1) {\n let last;\n if (this._queue.length > 0) {\n const str = this._queue[0][0];\n last = str[str.length - 1];\n } else {\n last = this._last;\n }\n\n return last === suffix;\n }\n\n const end =\n this._last + this._queue.reduce((acc, item) => item[0] + acc, \"\");\n if (suffix.length <= end.length) {\n return end.slice(-suffix.length) === suffix;\n }\n\n // We assume that everything being matched is at most a single token plus some whitespace,\n // which everything currently is, but otherwise we'd have to expand _last or check _buf.\n return false;\n }\n\n hasContent(): boolean {\n return this._queue.length > 0 || !!this._last;\n }\n\n /**\n * Certain sourcemap usecases expect mappings to be more accurate than\n * Babel's generic sourcemap handling allows. For now, we special-case\n * identifiers to allow for the primary cases to work.\n * The goal of this line is to ensure that the map output from Babel will\n * have an exact range on identifiers in the output code. Without this\n * line, Babel would potentially include some number of trailing tokens\n * that are printed after the identifier, but before another location has\n * been assigned.\n * This allows tooling like Rollup and Webpack to more accurately perform\n * their own transformations. Most importantly, this allows the import/export\n * transformations performed by those tools to loose less information when\n * applying their own transformations on top of the code and map results\n * generated by Babel itself.\n *\n * The primary example of this is the snippet:\n *\n * import mod from \"mod\";\n * mod();\n *\n * With this line, there will be one mapping range over \"mod\" and another\n * over \"();\", where previously it would have been a single mapping.\n */\n exactSource(loc: Object, cb: () => void) {\n // In cases where parent expressions start at the same locations as the\n // identifier itself, the current active location could already be the\n // start of this range. We use 'force' here to explicitly start a new\n // mapping range for this new token.\n this.source(\"start\", loc, true /* force */);\n\n cb();\n\n // In cases where tokens are printed after this item, we want to\n // ensure that they get the location of the _end_ of the identifier.\n // To accomplish this, we assign the location and explicitly disable\n // the standard Buffer withSource previous-position \"reactivation\"\n // logic. This means that if another item calls '.source()' to set\n // the location after the identifier, it is fine, but the position won't\n // be automatically replaced with the previous value.\n this.source(\"end\", loc);\n this._disallowPop(\"start\", loc);\n }\n\n /**\n * Sets a given position as the current source location so generated code after this call\n * will be given this position in the sourcemap.\n */\n\n source(prop: string, loc: Location, force?: boolean): void {\n if (prop && !loc) return;\n\n // Since this is called extremely often, we re-use the same _sourcePosition\n // object for the whole lifetime of the buffer.\n this._normalizePosition(prop, loc, this._sourcePosition, force);\n }\n\n /**\n * Call a callback with a specific source location and restore on completion.\n */\n\n withSource(prop: string, loc: Location, cb: () => void): void {\n if (!this._map) return cb();\n\n // Use the call stack to manage a stack of \"source location\" data because\n // the _sourcePosition object is mutated over the course of code generation,\n // and constantly copying it would be slower.\n const originalLine = this._sourcePosition.line;\n const originalColumn = this._sourcePosition.column;\n const originalFilename = this._sourcePosition.filename;\n const originalIdentifierName = this._sourcePosition.identifierName;\n\n this.source(prop, loc);\n\n cb();\n\n if (\n // If the current active position is forced, we only want to reactivate\n // the old position if it is different from the newest position.\n (!this._sourcePosition.force ||\n this._sourcePosition.line !== originalLine ||\n this._sourcePosition.column !== originalColumn ||\n this._sourcePosition.filename !== originalFilename) &&\n // Verify if reactivating this specific position has been disallowed.\n (!this._disallowedPop ||\n this._disallowedPop.line !== originalLine ||\n this._disallowedPop.column !== originalColumn ||\n this._disallowedPop.filename !== originalFilename)\n ) {\n this._sourcePosition.line = originalLine;\n this._sourcePosition.column = originalColumn;\n this._sourcePosition.filename = originalFilename;\n this._sourcePosition.identifierName = originalIdentifierName;\n this._sourcePosition.force = false;\n this._disallowedPop = null;\n }\n }\n\n /**\n * Allow printers to disable the default location-reset behavior of the\n * sourcemap output, so that certain printers can be sure that the\n * \"end\" location that they set is actually treated as the end position.\n */\n _disallowPop(prop: string, loc: Location) {\n if (prop && !loc) return;\n\n this._disallowedPop = this._normalizePosition(prop, loc);\n }\n\n _normalizePosition(\n prop: string,\n loc: Object,\n targetObj: Object,\n force?: boolean,\n ) {\n const pos = loc ? loc[prop] : null;\n\n if (targetObj === undefined) {\n // Initialize with fields so that the object doesn't change shape.\n targetObj = {\n identifierName: null,\n line: null,\n column: null,\n filename: null,\n force: false,\n };\n }\n\n const origLine = targetObj.line;\n const origColumn = targetObj.column;\n const origFilename = targetObj.filename;\n\n targetObj.identifierName =\n (prop === \"start\" && loc && loc.identifierName) || null;\n targetObj.line = pos ? pos.line : null;\n targetObj.column = pos ? pos.column : null;\n targetObj.filename = (loc && loc.filename) || null;\n\n // We want to skip reassigning `force` if we're re-setting the same position.\n if (\n force ||\n targetObj.line !== origLine ||\n targetObj.column !== origColumn ||\n targetObj.filename !== origFilename\n ) {\n targetObj.force = force;\n }\n\n return targetObj;\n }\n\n getCurrentColumn(): number {\n const extra = this._queue.reduce((acc, item) => item[0] + acc, \"\");\n const lastIndex = extra.lastIndexOf(\"\\n\");\n\n return lastIndex === -1\n ? this._position.column + extra.length\n : extra.length - 1 - lastIndex;\n }\n\n getCurrentLine(): number {\n const extra = this._queue.reduce((acc, item) => item[0] + acc, \"\");\n\n let count = 0;\n for (let i = 0; i < extra.length; i++) {\n if (extra[i] === \"\\n\") count++;\n }\n\n return this._position.line + count;\n }\n}\n","import * as t from \"@babel/types\";\n\ntype WhitespaceObject = {\n before?: boolean,\n after?: boolean,\n};\n\n/**\n * Crawl a node to test if it contains a CallExpression, a Function, or a Helper.\n *\n * @example\n * crawl(node)\n * // { hasCall: false, hasFunction: true, hasHelper: false }\n */\n\nfunction crawl(node, state = {}) {\n if (t.isMemberExpression(node)) {\n crawl(node.object, state);\n if (node.computed) crawl(node.property, state);\n } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {\n crawl(node.left, state);\n crawl(node.right, state);\n } else if (t.isCallExpression(node)) {\n state.hasCall = true;\n crawl(node.callee, state);\n } else if (t.isFunction(node)) {\n state.hasFunction = true;\n } else if (t.isIdentifier(node)) {\n state.hasHelper = state.hasHelper || isHelper(node.callee);\n }\n\n return state;\n}\n\n/**\n * Test if a node is or has a helper.\n */\n\nfunction isHelper(node) {\n if (t.isMemberExpression(node)) {\n return isHelper(node.object) || isHelper(node.property);\n } else if (t.isIdentifier(node)) {\n return node.name === \"require\" || node.name[0] === \"_\";\n } else if (t.isCallExpression(node)) {\n return isHelper(node.callee);\n } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {\n return (\n (t.isIdentifier(node.left) && isHelper(node.left)) || isHelper(node.right)\n );\n } else {\n return false;\n }\n}\n\nfunction isType(node) {\n return (\n t.isLiteral(node) ||\n t.isObjectExpression(node) ||\n t.isArrayExpression(node) ||\n t.isIdentifier(node) ||\n t.isMemberExpression(node)\n );\n}\n\n/**\n * Tests for node types that need whitespace.\n */\n\nexport const nodes = {\n /**\n * Test if AssignmentExpression needs whitespace.\n */\n\n AssignmentExpression(node: Object): ?WhitespaceObject {\n const state = crawl(node.right);\n if ((state.hasCall && state.hasHelper) || state.hasFunction) {\n return {\n before: state.hasFunction,\n after: true,\n };\n }\n },\n\n /**\n * Test if SwitchCase needs whitespace.\n */\n\n SwitchCase(node: Object, parent: Object): WhitespaceObject {\n return {\n before: node.consequent.length || parent.cases[0] === node,\n after:\n !node.consequent.length &&\n parent.cases[parent.cases.length - 1] === node,\n };\n },\n\n /**\n * Test if LogicalExpression needs whitespace.\n */\n\n LogicalExpression(node: Object): ?WhitespaceObject {\n if (t.isFunction(node.left) || t.isFunction(node.right)) {\n return {\n after: true,\n };\n }\n },\n\n /**\n * Test if Literal needs whitespace.\n */\n\n Literal(node: Object): ?WhitespaceObject {\n if (node.value === \"use strict\") {\n return {\n after: true,\n };\n }\n },\n\n /**\n * Test if CallExpression needs whitespace.\n */\n\n CallExpression(node: Object): ?WhitespaceObject {\n if (t.isFunction(node.callee) || isHelper(node)) {\n return {\n before: true,\n after: true,\n };\n }\n },\n\n /**\n * Test if VariableDeclaration needs whitespace.\n */\n\n VariableDeclaration(node: Object): ?WhitespaceObject {\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n\n let enabled = isHelper(declar.id) && !isType(declar.init);\n if (!enabled) {\n const state = crawl(declar.init);\n enabled = (isHelper(declar.init) && state.hasCall) || state.hasFunction;\n }\n\n if (enabled) {\n return {\n before: true,\n after: true,\n };\n }\n }\n },\n\n /**\n * Test if IfStatement needs whitespace.\n */\n\n IfStatement(node: Object): ?WhitespaceObject {\n if (t.isBlockStatement(node.consequent)) {\n return {\n before: true,\n after: true,\n };\n }\n },\n};\n\n/**\n * Test if Property needs whitespace.\n */\n\nnodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function(\n node: Object,\n parent,\n): ?WhitespaceObject {\n if (parent.properties[0] === node) {\n return {\n before: true,\n };\n }\n};\n\nnodes.ObjectTypeCallProperty = function(\n node: Object,\n parent,\n): ?WhitespaceObject {\n if (\n parent.callProperties[0] === node &&\n (!parent.properties || !parent.properties.length)\n ) {\n return {\n before: true,\n };\n }\n};\n\nnodes.ObjectTypeIndexer = function(node: Object, parent): ?WhitespaceObject {\n if (\n parent.indexers[0] === node &&\n (!parent.properties || !parent.properties.length) &&\n (!parent.callProperties || !parent.callProperties.length)\n ) {\n return {\n before: true,\n };\n }\n};\n\nnodes.ObjectTypeInternalSlot = function(\n node: Object,\n parent,\n): ?WhitespaceObject {\n if (\n parent.internalSlots[0] === node &&\n (!parent.properties || !parent.properties.length) &&\n (!parent.callProperties || !parent.callProperties.length) &&\n (!parent.indexers || !parent.indexers.length)\n ) {\n return {\n before: true,\n };\n }\n};\n\n/**\n * Returns lists from node types that need whitespace.\n */\n\nexport const list = {\n /**\n * Return VariableDeclaration declarations init properties.\n */\n\n VariableDeclaration(node: Object): Array {\n return node.declarations.map(decl => decl.init);\n },\n\n /**\n * Return VariableDeclaration elements.\n */\n\n ArrayExpression(node: Object): Array {\n return node.elements;\n },\n\n /**\n * Return VariableDeclaration properties.\n */\n\n ObjectExpression(node: Object): Array {\n return node.properties;\n },\n};\n\n/**\n * Add whitespace tests for nodes and their aliases.\n */\n\n[\n [\"Function\", true],\n [\"Class\", true],\n [\"Loop\", true],\n [\"LabeledStatement\", true],\n [\"SwitchStatement\", true],\n [\"TryStatement\", true],\n].forEach(function([type, amounts]) {\n if (typeof amounts === \"boolean\") {\n amounts = { after: amounts, before: amounts };\n }\n [type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function(type) {\n nodes[type] = function() {\n return amounts;\n };\n });\n});\n","import * as t from \"@babel/types\";\n\nconst PRECEDENCE = {\n \"||\": 0,\n \"&&\": 1,\n \"|\": 2,\n \"^\": 3,\n \"&\": 4,\n \"==\": 5,\n \"===\": 5,\n \"!=\": 5,\n \"!==\": 5,\n \"<\": 6,\n \">\": 6,\n \"<=\": 6,\n \">=\": 6,\n in: 6,\n instanceof: 6,\n \">>\": 7,\n \"<<\": 7,\n \">>>\": 7,\n \"+\": 8,\n \"-\": 8,\n \"*\": 9,\n \"/\": 9,\n \"%\": 9,\n \"**\": 10,\n};\n\nconst isClassExtendsClause = (node: Object, parent: Object): boolean =>\n (t.isClassDeclaration(parent) || t.isClassExpression(parent)) &&\n parent.superClass === node;\n\nexport function NullableTypeAnnotation(node: Object, parent: Object): boolean {\n return t.isArrayTypeAnnotation(parent);\n}\n\nexport function FunctionTypeAnnotation(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return (\n // (() => A) | (() => B)\n t.isUnionTypeAnnotation(parent) ||\n // (() => A) & (() => B)\n t.isIntersectionTypeAnnotation(parent) ||\n // (() => A)[]\n t.isArrayTypeAnnotation(parent) ||\n // (A: T): (T => T[]) => B => [A, B]\n (t.isTypeAnnotation(parent) &&\n // Check grandparent\n t.isArrowFunctionExpression(printStack[printStack.length - 3]))\n );\n}\n\nexport function UpdateExpression(node: Object, parent: Object): boolean {\n return (\n // (foo++).test(), (foo++)[0]\n t.isMemberExpression(parent, { object: node }) ||\n // (foo++)()\n t.isCallExpression(parent, { callee: node }) ||\n // new (foo++)()\n t.isNewExpression(parent, { callee: node }) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport function ObjectExpression(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return isFirstInStatement(printStack, { considerArrow: true });\n}\n\nexport function DoExpression(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return isFirstInStatement(printStack);\n}\n\nexport function Binary(node: Object, parent: Object): boolean {\n if (\n node.operator === \"**\" &&\n t.isBinaryExpression(parent, { operator: \"**\" })\n ) {\n return parent.left === node;\n }\n\n if (isClassExtendsClause(node, parent)) {\n return true;\n }\n\n if (\n ((t.isCallExpression(parent) || t.isNewExpression(parent)) &&\n parent.callee === node) ||\n t.isUnaryLike(parent) ||\n (t.isMemberExpression(parent) && parent.object === node) ||\n t.isAwaitExpression(parent)\n ) {\n return true;\n }\n\n if (t.isBinary(parent)) {\n const parentOp = parent.operator;\n const parentPos = PRECEDENCE[parentOp];\n\n const nodeOp = node.operator;\n const nodePos = PRECEDENCE[nodeOp];\n\n if (\n // Logical expressions with the same precedence don't need parens.\n (parentPos === nodePos &&\n parent.right === node &&\n !t.isLogicalExpression(parent)) ||\n parentPos > nodePos\n ) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function UnionTypeAnnotation(node: Object, parent: Object): boolean {\n return (\n t.isArrayTypeAnnotation(parent) ||\n t.isNullableTypeAnnotation(parent) ||\n t.isIntersectionTypeAnnotation(parent) ||\n t.isUnionTypeAnnotation(parent)\n );\n}\n\nexport { UnionTypeAnnotation as IntersectionTypeAnnotation };\n\nexport function TSAsExpression() {\n return true;\n}\n\nexport function TSTypeAssertion() {\n return true;\n}\n\nexport function TSUnionType(node: Object, parent: Object): boolean {\n return (\n t.isTSArrayType(parent) ||\n t.isTSOptionalType(parent) ||\n t.isTSIntersectionType(parent) ||\n t.isTSUnionType(parent) ||\n t.isTSRestType(parent)\n );\n}\n\nexport { TSUnionType as TSIntersectionType };\n\nexport function BinaryExpression(node: Object, parent: Object): boolean {\n // let i = (1 in []);\n // for ((1 in []);;);\n return (\n node.operator === \"in\" &&\n (t.isVariableDeclarator(parent) || t.isFor(parent))\n );\n}\n\nexport function SequenceExpression(node: Object, parent: Object): boolean {\n if (\n // Although parentheses wouldn\"t hurt around sequence\n // expressions in the head of for loops, traditional style\n // dictates that e.g. i++, j++ should not be wrapped with\n // parentheses.\n t.isForStatement(parent) ||\n t.isThrowStatement(parent) ||\n t.isReturnStatement(parent) ||\n (t.isIfStatement(parent) && parent.test === node) ||\n (t.isWhileStatement(parent) && parent.test === node) ||\n (t.isForInStatement(parent) && parent.right === node) ||\n (t.isSwitchStatement(parent) && parent.discriminant === node) ||\n (t.isExpressionStatement(parent) && parent.expression === node)\n ) {\n return false;\n }\n\n // Otherwise err on the side of overparenthesization, adding\n // explicit exceptions above if this proves overzealous.\n return true;\n}\n\nexport function YieldExpression(node: Object, parent: Object): boolean {\n return (\n t.isBinary(parent) ||\n t.isUnaryLike(parent) ||\n t.isCallExpression(parent) ||\n t.isMemberExpression(parent) ||\n t.isNewExpression(parent) ||\n (t.isAwaitExpression(parent) && t.isYieldExpression(node)) ||\n (t.isConditionalExpression(parent) && node === parent.test) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport { YieldExpression as AwaitExpression };\n\nexport function ClassExpression(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return isFirstInStatement(printStack, { considerDefaultExports: true });\n}\n\nexport function UnaryLike(node: Object, parent: Object): boolean {\n return (\n t.isMemberExpression(parent, { object: node }) ||\n t.isCallExpression(parent, { callee: node }) ||\n t.isNewExpression(parent, { callee: node }) ||\n t.isBinaryExpression(parent, { operator: \"**\", left: node }) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport function FunctionExpression(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return isFirstInStatement(printStack, { considerDefaultExports: true });\n}\n\nexport function ArrowFunctionExpression(node: Object, parent: Object): boolean {\n return t.isExportDeclaration(parent) || ConditionalExpression(node, parent);\n}\n\nexport function ConditionalExpression(node: Object, parent: Object): boolean {\n if (\n t.isUnaryLike(parent) ||\n t.isBinary(parent) ||\n t.isConditionalExpression(parent, { test: node }) ||\n t.isAwaitExpression(parent) ||\n t.isOptionalMemberExpression(parent) ||\n t.isTaggedTemplateExpression(parent) ||\n t.isTSTypeAssertion(parent) ||\n t.isTSAsExpression(parent)\n ) {\n return true;\n }\n\n return UnaryLike(node, parent);\n}\n\nexport function OptionalMemberExpression(\n node: Object,\n parent: Object,\n): boolean {\n return t.isCallExpression(parent) || t.isMemberExpression(parent);\n}\n\nexport function AssignmentExpression(node: Object): boolean {\n if (t.isObjectPattern(node.left)) {\n return true;\n } else {\n return ConditionalExpression(...arguments);\n }\n}\n\nexport function NewExpression(node: Object, parent: Object): boolean {\n return isClassExtendsClause(node, parent);\n}\n\n// Walk up the print stack to determine if our node can come first\n// in statement.\nfunction isFirstInStatement(\n printStack: Array,\n { considerArrow = false, considerDefaultExports = false } = {},\n): boolean {\n let i = printStack.length - 1;\n let node = printStack[i];\n i--;\n let parent = printStack[i];\n while (i > 0) {\n if (\n t.isExpressionStatement(parent, { expression: node }) ||\n t.isTaggedTemplateExpression(parent) ||\n (considerDefaultExports &&\n t.isExportDefaultDeclaration(parent, { declaration: node })) ||\n (considerArrow && t.isArrowFunctionExpression(parent, { body: node }))\n ) {\n return true;\n }\n\n if (\n t.isCallExpression(parent, { callee: node }) ||\n (t.isSequenceExpression(parent) && parent.expressions[0] === node) ||\n t.isMemberExpression(parent, { object: node }) ||\n t.isConditional(parent, { test: node }) ||\n t.isBinary(parent, { left: node }) ||\n t.isAssignmentExpression(parent, { left: node })\n ) {\n node = parent;\n i--;\n parent = printStack[i];\n } else {\n return false;\n }\n }\n\n return false;\n}\n","import * as whitespace from \"./whitespace\";\nimport * as parens from \"./parentheses\";\nimport * as t from \"@babel/types\";\n\nfunction expandAliases(obj) {\n const newObj = {};\n\n function add(type, func) {\n const fn = newObj[type];\n newObj[type] = fn\n ? function(node, parent, stack) {\n const result = fn(node, parent, stack);\n\n return result == null ? func(node, parent, stack) : result;\n }\n : func;\n }\n\n for (const type of Object.keys(obj)) {\n const aliases = t.FLIPPED_ALIAS_KEYS[type];\n if (aliases) {\n for (const alias of aliases) {\n add(alias, obj[type]);\n }\n } else {\n add(type, obj[type]);\n }\n }\n\n return newObj;\n}\n\n// Rather than using `t.is` on each object property, we pre-expand any type aliases\n// into concrete types so that the 'find' call below can be as fast as possible.\nconst expandedParens = expandAliases(parens);\nconst expandedWhitespaceNodes = expandAliases(whitespace.nodes);\nconst expandedWhitespaceList = expandAliases(whitespace.list);\n\nfunction find(obj, node, parent, printStack) {\n const fn = obj[node.type];\n return fn ? fn(node, parent, printStack) : null;\n}\n\nfunction isOrHasCallExpression(node) {\n if (t.isCallExpression(node)) {\n return true;\n }\n\n if (t.isMemberExpression(node)) {\n return (\n isOrHasCallExpression(node.object) ||\n (!node.computed && isOrHasCallExpression(node.property))\n );\n } else {\n return false;\n }\n}\n\nexport function needsWhitespace(node, parent, type) {\n if (!node) return 0;\n\n if (t.isExpressionStatement(node)) {\n node = node.expression;\n }\n\n let linesInfo = find(expandedWhitespaceNodes, node, parent);\n\n if (!linesInfo) {\n const items = find(expandedWhitespaceList, node, parent);\n if (items) {\n for (let i = 0; i < items.length; i++) {\n linesInfo = needsWhitespace(items[i], node, type);\n if (linesInfo) break;\n }\n }\n }\n\n if (typeof linesInfo === \"object\" && linesInfo !== null) {\n return linesInfo[type] || 0;\n }\n\n return 0;\n}\n\nexport function needsWhitespaceBefore(node, parent) {\n return needsWhitespace(node, parent, \"before\");\n}\n\nexport function needsWhitespaceAfter(node, parent) {\n return needsWhitespace(node, parent, \"after\");\n}\n\nexport function needsParens(node, parent, printStack) {\n if (!parent) return false;\n\n if (t.isNewExpression(parent) && parent.callee === node) {\n if (isOrHasCallExpression(node)) return true;\n }\n\n /* this check is for NullishCoalescing being used with LogicalOperators like && and ||\n * For example when someone creates an ast programmaticaly like this\n * t.logicalExpression(\n * \"??\",\n * t.logicalExpression(\"||\", t.identifier(\"a\"), t.identifier(\"b\")),\n * t.identifier(\"c\"),\n * );\n * In the example above the AST is equivalent to writing a || b ?? c\n * This is incorrect because NullishCoalescing when used with LogicalExpressions should have parenthesis\n * The correct syntax is (a || b) ?? c, that is why we need parenthesis in this case\n */\n if (t.isLogicalExpression(node) && parent.operator === \"??\") return true;\n\n return find(expandedParens, node, parent, printStack);\n}\n","export function TaggedTemplateExpression(node: Object) {\n this.print(node.tag, node);\n this.print(node.typeParameters, node); // TS\n this.print(node.quasi, node);\n}\n\nexport function TemplateElement(node: Object, parent: Object) {\n const isFirst = parent.quasis[0] === node;\n const isLast = parent.quasis[parent.quasis.length - 1] === node;\n\n const value = (isFirst ? \"`\" : \"}\") + node.value.raw + (isLast ? \"`\" : \"${\");\n\n this.token(value);\n}\n\nexport function TemplateLiteral(node: Object) {\n const quasis = node.quasis;\n\n for (let i = 0; i < quasis.length; i++) {\n this.print(quasis[i], node);\n\n if (i + 1 < quasis.length) {\n this.print(node.expressions[i], node);\n }\n }\n}\n","import * as t from \"@babel/types\";\nimport * as n from \"../node\";\n\nexport function UnaryExpression(node: Object) {\n if (\n node.operator === \"void\" ||\n node.operator === \"delete\" ||\n node.operator === \"typeof\" ||\n // throwExpressions\n node.operator === \"throw\"\n ) {\n this.word(node.operator);\n this.space();\n } else {\n this.token(node.operator);\n }\n\n this.print(node.argument, node);\n}\n\nexport function DoExpression(node: Object) {\n this.word(\"do\");\n this.space();\n this.print(node.body, node);\n}\n\nexport function ParenthesizedExpression(node: Object) {\n this.token(\"(\");\n this.print(node.expression, node);\n this.token(\")\");\n}\n\nexport function UpdateExpression(node: Object) {\n if (node.prefix) {\n this.token(node.operator);\n this.print(node.argument, node);\n } else {\n this.startTerminatorless(true);\n this.print(node.argument, node);\n this.endTerminatorless();\n this.token(node.operator);\n }\n}\n\nexport function ConditionalExpression(node: Object) {\n this.print(node.test, node);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.consequent, node);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.alternate, node);\n}\n\nexport function NewExpression(node: Object, parent: Object) {\n this.word(\"new\");\n this.space();\n this.print(node.callee, node);\n if (\n this.format.minified &&\n node.arguments.length === 0 &&\n !node.optional &&\n !t.isCallExpression(parent, { callee: node }) &&\n !t.isMemberExpression(parent) &&\n !t.isNewExpression(parent)\n ) {\n return;\n }\n\n this.print(node.typeArguments, node); // Flow\n this.print(node.typeParameters, node); // TS\n\n if (node.optional) {\n this.token(\"?.\");\n }\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.token(\")\");\n}\n\nexport function SequenceExpression(node: Object) {\n this.printList(node.expressions, node);\n}\n\nexport function ThisExpression() {\n this.word(\"this\");\n}\n\nexport function Super() {\n this.word(\"super\");\n}\n\nexport function Decorator(node: Object) {\n this.token(\"@\");\n this.print(node.expression, node);\n this.newline();\n}\n\nexport function OptionalMemberExpression(node: Object) {\n this.print(node.object, node);\n\n if (!node.computed && t.isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n let computed = node.computed;\n if (t.isLiteral(node.property) && typeof node.property.value === \"number\") {\n computed = true;\n }\n if (node.optional) {\n this.token(\"?.\");\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(node.property, node);\n this.token(\"]\");\n } else {\n if (!node.optional) {\n this.token(\".\");\n }\n this.print(node.property, node);\n }\n}\n\nexport function OptionalCallExpression(node: Object) {\n this.print(node.callee, node);\n\n this.print(node.typeArguments, node); // Flow\n this.print(node.typeParameters, node); // TS\n\n if (node.optional) {\n this.token(\"?.\");\n }\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.token(\")\");\n}\n\nexport function CallExpression(node: Object) {\n this.print(node.callee, node);\n\n this.print(node.typeArguments, node); // Flow\n this.print(node.typeParameters, node); // TS\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.token(\")\");\n}\n\nexport function Import() {\n this.word(\"import\");\n}\n\nfunction buildYieldAwait(keyword: string) {\n return function(node: Object) {\n this.word(keyword);\n\n if (node.delegate) {\n this.token(\"*\");\n }\n\n if (node.argument) {\n this.space();\n const terminatorState = this.startTerminatorless();\n this.print(node.argument, node);\n this.endTerminatorless(terminatorState);\n }\n };\n}\n\nexport const YieldExpression = buildYieldAwait(\"yield\");\nexport const AwaitExpression = buildYieldAwait(\"await\");\n\nexport function EmptyStatement() {\n this.semicolon(true /* force */);\n}\n\nexport function ExpressionStatement(node: Object) {\n this.print(node.expression, node);\n this.semicolon();\n}\n\nexport function AssignmentPattern(node: Object) {\n this.print(node.left, node);\n if (node.left.optional) this.token(\"?\");\n this.print(node.left.typeAnnotation, node);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.right, node);\n}\n\nexport function AssignmentExpression(node: Object, parent: Object) {\n // Somewhere inside a for statement `init` node but doesn't usually\n // needs a paren except for `in` expressions: `for (a in b ? a : b;;)`\n const parens =\n this.inForStatementInitCounter &&\n node.operator === \"in\" &&\n !n.needsParens(node, parent);\n\n if (parens) {\n this.token(\"(\");\n }\n\n this.print(node.left, node);\n\n this.space();\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n this.word(node.operator);\n } else {\n this.token(node.operator);\n }\n this.space();\n\n this.print(node.right, node);\n\n if (parens) {\n this.token(\")\");\n }\n}\n\nexport function BindExpression(node: Object) {\n this.print(node.object, node);\n this.token(\"::\");\n this.print(node.callee, node);\n}\n\nexport {\n AssignmentExpression as BinaryExpression,\n AssignmentExpression as LogicalExpression,\n};\n\nexport function MemberExpression(node: Object) {\n this.print(node.object, node);\n\n if (!node.computed && t.isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n let computed = node.computed;\n if (t.isLiteral(node.property) && typeof node.property.value === \"number\") {\n computed = true;\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(node.property, node);\n this.token(\"]\");\n } else {\n this.token(\".\");\n this.print(node.property, node);\n }\n}\n\nexport function MetaProperty(node: Object) {\n this.print(node.meta, node);\n this.token(\".\");\n this.print(node.property, node);\n}\n\nexport function PrivateName(node: Object) {\n this.token(\"#\");\n this.print(node.id, node);\n}\n\nexport function V8IntrinsicIdentifier(node: Object) {\n this.token(\"%\");\n this.word(node.name);\n}\n","import * as t from \"@babel/types\";\n\nexport function WithStatement(node: Object) {\n this.word(\"with\");\n this.space();\n this.token(\"(\");\n this.print(node.object, node);\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport function IfStatement(node: Object) {\n this.word(\"if\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.space();\n\n const needsBlock =\n node.alternate && t.isIfStatement(getLastStatement(node.consequent));\n if (needsBlock) {\n this.token(\"{\");\n this.newline();\n this.indent();\n }\n\n this.printAndIndentOnComments(node.consequent, node);\n\n if (needsBlock) {\n this.dedent();\n this.newline();\n this.token(\"}\");\n }\n\n if (node.alternate) {\n if (this.endsWith(\"}\")) this.space();\n this.word(\"else\");\n this.space();\n this.printAndIndentOnComments(node.alternate, node);\n }\n}\n\n// Recursively get the last statement.\nfunction getLastStatement(statement) {\n if (!t.isStatement(statement.body)) return statement;\n return getLastStatement(statement.body);\n}\n\nexport function ForStatement(node: Object) {\n this.word(\"for\");\n this.space();\n this.token(\"(\");\n\n this.inForStatementInitCounter++;\n this.print(node.init, node);\n this.inForStatementInitCounter--;\n this.token(\";\");\n\n if (node.test) {\n this.space();\n this.print(node.test, node);\n }\n this.token(\";\");\n\n if (node.update) {\n this.space();\n this.print(node.update, node);\n }\n\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport function WhileStatement(node: Object) {\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.printBlock(node);\n}\n\nconst buildForXStatement = function(op) {\n return function(node: Object) {\n this.word(\"for\");\n this.space();\n if (op === \"of\" && node.await) {\n this.word(\"await\");\n this.space();\n }\n this.token(\"(\");\n this.print(node.left, node);\n this.space();\n this.word(op);\n this.space();\n this.print(node.right, node);\n this.token(\")\");\n this.printBlock(node);\n };\n};\n\nexport const ForInStatement = buildForXStatement(\"in\");\nexport const ForOfStatement = buildForXStatement(\"of\");\n\nexport function DoWhileStatement(node: Object) {\n this.word(\"do\");\n this.space();\n this.print(node.body, node);\n this.space();\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.semicolon();\n}\n\nfunction buildLabelStatement(prefix, key = \"label\") {\n return function(node: Object) {\n this.word(prefix);\n\n const label = node[key];\n if (label) {\n this.space();\n const isLabel = key == \"label\";\n const terminatorState = this.startTerminatorless(isLabel);\n this.print(label, node);\n this.endTerminatorless(terminatorState);\n }\n\n this.semicolon();\n };\n}\n\nexport const ContinueStatement = buildLabelStatement(\"continue\");\nexport const ReturnStatement = buildLabelStatement(\"return\", \"argument\");\nexport const BreakStatement = buildLabelStatement(\"break\");\nexport const ThrowStatement = buildLabelStatement(\"throw\", \"argument\");\n\nexport function LabeledStatement(node: Object) {\n this.print(node.label, node);\n this.token(\":\");\n this.space();\n this.print(node.body, node);\n}\n\nexport function TryStatement(node: Object) {\n this.word(\"try\");\n this.space();\n this.print(node.block, node);\n this.space();\n\n // Esprima bug puts the catch clause in a `handlers` array.\n // see https://code.google.com/p/esprima/issues/detail?id=433\n // We run into this from regenerator generated ast.\n if (node.handlers) {\n this.print(node.handlers[0], node);\n } else {\n this.print(node.handler, node);\n }\n\n if (node.finalizer) {\n this.space();\n this.word(\"finally\");\n this.space();\n this.print(node.finalizer, node);\n }\n}\n\nexport function CatchClause(node: Object) {\n this.word(\"catch\");\n this.space();\n if (node.param) {\n this.token(\"(\");\n this.print(node.param, node);\n this.token(\")\");\n this.space();\n }\n this.print(node.body, node);\n}\n\nexport function SwitchStatement(node: Object) {\n this.word(\"switch\");\n this.space();\n this.token(\"(\");\n this.print(node.discriminant, node);\n this.token(\")\");\n this.space();\n this.token(\"{\");\n\n this.printSequence(node.cases, node, {\n indent: true,\n addNewlines(leading, cas) {\n if (!leading && node.cases[node.cases.length - 1] === cas) return -1;\n },\n });\n\n this.token(\"}\");\n}\n\nexport function SwitchCase(node: Object) {\n if (node.test) {\n this.word(\"case\");\n this.space();\n this.print(node.test, node);\n this.token(\":\");\n } else {\n this.word(\"default\");\n this.token(\":\");\n }\n\n if (node.consequent.length) {\n this.newline();\n this.printSequence(node.consequent, node, { indent: true });\n }\n}\n\nexport function DebuggerStatement() {\n this.word(\"debugger\");\n this.semicolon();\n}\n\nfunction variableDeclarationIndent() {\n // \"let \" or \"var \" indentation.\n this.token(\",\");\n this.newline();\n if (this.endsWith(\"\\n\")) for (let i = 0; i < 4; i++) this.space(true);\n}\n\nfunction constDeclarationIndent() {\n // \"const \" indentation.\n this.token(\",\");\n this.newline();\n if (this.endsWith(\"\\n\")) for (let i = 0; i < 6; i++) this.space(true);\n}\n\nexport function VariableDeclaration(node: Object, parent: Object) {\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n this.word(node.kind);\n this.space();\n\n let hasInits = false;\n // don't add whitespace to loop heads\n if (!t.isFor(parent)) {\n for (const declar of (node.declarations: Array)) {\n if (declar.init) {\n // has an init so let's split it up over multiple lines\n hasInits = true;\n }\n }\n }\n\n //\n // use a pretty separator when we aren't in compact mode, have initializers and don't have retainLines on\n // this will format declarations like:\n //\n // let foo = \"bar\", bar = \"foo\";\n //\n // into\n //\n // let foo = \"bar\",\n // bar = \"foo\";\n //\n\n let separator;\n if (hasInits) {\n separator =\n node.kind === \"const\"\n ? constDeclarationIndent\n : variableDeclarationIndent;\n }\n\n //\n\n this.printList(node.declarations, node, { separator });\n\n if (t.isFor(parent)) {\n // don't give semicolons to these nodes since they'll be inserted in the parent generator\n if (parent.left === node || parent.init === node) return;\n }\n\n this.semicolon();\n}\n\nexport function VariableDeclarator(node: Object) {\n this.print(node.id, node);\n if (node.definite) this.token(\"!\"); // TS\n this.print(node.id.typeAnnotation, node);\n if (node.init) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.init, node);\n }\n}\n","import * as t from \"@babel/types\";\n\nexport function ClassDeclaration(node: Object, parent: Object) {\n if (\n !this.format.decoratorsBeforeExport ||\n (!t.isExportDefaultDeclaration(parent) &&\n !t.isExportNamedDeclaration(parent))\n ) {\n this.printJoin(node.decorators, node);\n }\n\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n if (node.abstract) {\n // TS\n this.word(\"abstract\");\n this.space();\n }\n\n this.word(\"class\");\n\n if (node.id) {\n this.space();\n this.print(node.id, node);\n }\n\n this.print(node.typeParameters, node);\n\n if (node.superClass) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.superClass, node);\n this.print(node.superTypeParameters, node);\n }\n\n if (node.implements) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements, node);\n }\n\n this.space();\n this.print(node.body, node);\n}\n\nexport { ClassDeclaration as ClassExpression };\n\nexport function ClassBody(node: Object) {\n this.token(\"{\");\n this.printInnerComments(node);\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n\n this.indent();\n this.printSequence(node.body, node);\n this.dedent();\n\n if (!this.endsWith(\"\\n\")) this.newline();\n\n this.rightBrace();\n }\n}\n\nexport function ClassProperty(node: Object) {\n this.printJoin(node.decorators, node);\n this.tsPrintClassMemberModifiers(node, /* isField */ true);\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key, node);\n this.token(\"]\");\n } else {\n this._variance(node);\n this.print(node.key, node);\n }\n\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n\n this.print(node.typeAnnotation, node);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value, node);\n }\n this.semicolon();\n}\n\nexport function ClassPrivateProperty(node: Object) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n this.print(node.key, node);\n this.print(node.typeAnnotation, node);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value, node);\n }\n this.semicolon();\n}\n\nexport function ClassMethod(node: Object) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body, node);\n}\n\nexport function ClassPrivateMethod(node: Object) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body, node);\n}\n\nexport function _classMethodHead(node) {\n this.printJoin(node.decorators, node);\n this.tsPrintClassMemberModifiers(node, /* isField */ false);\n this._methodHead(node);\n}\n","import * as t from \"@babel/types\";\n\nexport function _params(node: Object) {\n this.print(node.typeParameters, node);\n this.token(\"(\");\n this._parameters(node.params, node);\n this.token(\")\");\n\n this.print(node.returnType, node);\n}\n\nexport function _parameters(parameters, parent) {\n for (let i = 0; i < parameters.length; i++) {\n this._param(parameters[i], parent);\n\n if (i < parameters.length - 1) {\n this.token(\",\");\n this.space();\n }\n }\n}\n\nexport function _param(parameter, parent) {\n this.printJoin(parameter.decorators, parameter);\n this.print(parameter, parent);\n if (parameter.optional) this.token(\"?\"); // TS / flow\n this.print(parameter.typeAnnotation, parameter); // TS / flow\n}\n\nexport function _methodHead(node: Object) {\n const kind = node.kind;\n const key = node.key;\n\n if (kind === \"get\" || kind === \"set\") {\n this.word(kind);\n this.space();\n }\n\n if (node.async) {\n this.word(\"async\");\n this.space();\n }\n\n if (kind === \"method\" || kind === \"init\") {\n if (node.generator) {\n this.token(\"*\");\n }\n }\n\n if (node.computed) {\n this.token(\"[\");\n this.print(key, node);\n this.token(\"]\");\n } else {\n this.print(key, node);\n }\n\n if (node.optional) {\n // TS\n this.token(\"?\");\n }\n\n this._params(node);\n}\n\nexport function _predicate(node: Object) {\n if (node.predicate) {\n if (!node.returnType) {\n this.token(\":\");\n }\n this.space();\n this.print(node.predicate, node);\n }\n}\n\nexport function _functionHead(node: Object) {\n if (node.async) {\n this.word(\"async\");\n this.space();\n }\n this.word(\"function\");\n if (node.generator) this.token(\"*\");\n\n this.space();\n if (node.id) {\n this.print(node.id, node);\n }\n\n this._params(node);\n this._predicate(node);\n}\n\nexport function FunctionExpression(node: Object) {\n this._functionHead(node);\n this.space();\n this.print(node.body, node);\n}\n\nexport { FunctionExpression as FunctionDeclaration };\n\nexport function ArrowFunctionExpression(node: Object) {\n if (node.async) {\n this.word(\"async\");\n this.space();\n }\n\n const firstParam = node.params[0];\n\n if (\n node.params.length === 1 &&\n t.isIdentifier(firstParam) &&\n !hasTypes(node, firstParam)\n ) {\n if (\n this.format.retainLines &&\n node.loc &&\n node.body.loc &&\n node.loc.start.line < node.body.loc.start.line\n ) {\n this.token(\"(\");\n if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {\n this.indent();\n this.print(firstParam, node);\n this.dedent();\n this._catchUp(\"start\", node.body.loc);\n } else {\n this.print(firstParam, node);\n }\n this.token(\")\");\n } else {\n this.print(firstParam, node);\n }\n } else {\n this._params(node);\n }\n\n this._predicate(node);\n\n this.space();\n this.token(\"=>\");\n this.space();\n\n this.print(node.body, node);\n}\n\nfunction hasTypes(node, param) {\n return (\n node.typeParameters ||\n node.returnType ||\n param.typeAnnotation ||\n param.optional ||\n param.trailingComments\n );\n}\n","import * as t from \"@babel/types\";\n\nexport function ImportSpecifier(node: Object) {\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n this.print(node.imported, node);\n if (node.local && node.local.name !== node.imported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local, node);\n }\n}\n\nexport function ImportDefaultSpecifier(node: Object) {\n this.print(node.local, node);\n}\n\nexport function ExportDefaultSpecifier(node: Object) {\n this.print(node.exported, node);\n}\n\nexport function ExportSpecifier(node: Object) {\n this.print(node.local, node);\n if (node.exported && node.local.name !== node.exported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported, node);\n }\n}\n\nexport function ExportNamespaceSpecifier(node: Object) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported, node);\n}\n\nexport function ExportAllDeclaration(node: Object) {\n this.word(\"export\");\n this.space();\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n this.token(\"*\");\n this.space();\n this.word(\"from\");\n this.space();\n this.print(node.source, node);\n this.semicolon();\n}\n\nexport function ExportNamedDeclaration(node: Object) {\n if (\n this.format.decoratorsBeforeExport &&\n t.isClassDeclaration(node.declaration)\n ) {\n this.printJoin(node.declaration.decorators, node);\n }\n\n this.word(\"export\");\n this.space();\n ExportDeclaration.apply(this, arguments);\n}\n\nexport function ExportDefaultDeclaration(node: Object) {\n if (\n this.format.decoratorsBeforeExport &&\n t.isClassDeclaration(node.declaration)\n ) {\n this.printJoin(node.declaration.decorators, node);\n }\n\n this.word(\"export\");\n this.space();\n this.word(\"default\");\n this.space();\n ExportDeclaration.apply(this, arguments);\n}\n\nfunction ExportDeclaration(node: Object) {\n if (node.declaration) {\n const declar = node.declaration;\n this.print(declar, node);\n if (!t.isStatement(declar)) this.semicolon();\n } else {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n\n // print \"special\" specifiers first\n let hasSpecial = false;\n while (true) {\n const first = specifiers[0];\n if (\n t.isExportDefaultSpecifier(first) ||\n t.isExportNamespaceSpecifier(first)\n ) {\n hasSpecial = true;\n this.print(specifiers.shift(), node);\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n if (specifiers.length || (!specifiers.length && !hasSpecial)) {\n this.token(\"{\");\n if (specifiers.length) {\n this.space();\n this.printList(specifiers, node);\n this.space();\n }\n this.token(\"}\");\n }\n\n if (node.source) {\n this.space();\n this.word(\"from\");\n this.space();\n this.print(node.source, node);\n }\n\n this.semicolon();\n }\n}\n\nexport function ImportDeclaration(node: Object) {\n this.word(\"import\");\n this.space();\n\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n if (specifiers && specifiers.length) {\n // print \"special\" specifiers first\n while (true) {\n const first = specifiers[0];\n if (\n t.isImportDefaultSpecifier(first) ||\n t.isImportNamespaceSpecifier(first)\n ) {\n this.print(specifiers.shift(), node);\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n if (specifiers.length) {\n this.token(\"{\");\n this.space();\n this.printList(specifiers, node);\n this.space();\n this.token(\"}\");\n }\n\n this.space();\n this.word(\"from\");\n this.space();\n }\n\n this.print(node.source, node);\n this.semicolon();\n}\n\nexport function ImportNamespaceSpecifier(node: Object) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local, node);\n}\n","'use strict';\n\nconst object = {};\nconst hasOwnProperty = object.hasOwnProperty;\nconst forOwn = (object, callback) => {\n\tfor (const key in object) {\n\t\tif (hasOwnProperty.call(object, key)) {\n\t\t\tcallback(key, object[key]);\n\t\t}\n\t}\n};\n\nconst extend = (destination, source) => {\n\tif (!source) {\n\t\treturn destination;\n\t}\n\tforOwn(source, (key, value) => {\n\t\tdestination[key] = value;\n\t});\n\treturn destination;\n};\n\nconst forEach = (array, callback) => {\n\tconst length = array.length;\n\tlet index = -1;\n\twhile (++index < length) {\n\t\tcallback(array[index]);\n\t}\n};\n\nconst toString = object.toString;\nconst isArray = Array.isArray;\nconst isBuffer = Buffer.isBuffer;\nconst isObject = (value) => {\n\t// This is a very simple check, but it’s good enough for what we need.\n\treturn toString.call(value) == '[object Object]';\n};\nconst isString = (value) => {\n\treturn typeof value == 'string' ||\n\t\ttoString.call(value) == '[object String]';\n};\nconst isNumber = (value) => {\n\treturn typeof value == 'number' ||\n\t\ttoString.call(value) == '[object Number]';\n};\nconst isFunction = (value) => {\n\treturn typeof value == 'function';\n};\nconst isMap = (value) => {\n\treturn toString.call(value) == '[object Map]';\n};\nconst isSet = (value) => {\n\treturn toString.call(value) == '[object Set]';\n};\n\n/*--------------------------------------------------------------------------*/\n\n// https://mathiasbynens.be/notes/javascript-escapes#single\nconst singleEscapes = {\n\t'\"': '\\\\\"',\n\t'\\'': '\\\\\\'',\n\t'\\\\': '\\\\\\\\',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t'\n\t// `\\v` is omitted intentionally, because in IE < 9, '\\v' == 'v'.\n\t// '\\v': '\\\\x0B'\n};\nconst regexSingleEscape = /[\"'\\\\\\b\\f\\n\\r\\t]/;\n\nconst regexDigit = /[0-9]/;\nconst regexWhitelist = /[ !#-&\\(-\\[\\]-_a-~]/;\n\nconst jsesc = (argument, options) => {\n\tconst increaseIndentation = () => {\n\t\toldIndent = indent;\n\t\t++options.indentLevel;\n\t\tindent = options.indent.repeat(options.indentLevel)\n\t};\n\t// Handle options\n\tconst defaults = {\n\t\t'escapeEverything': false,\n\t\t'minimal': false,\n\t\t'isScriptContext': false,\n\t\t'quotes': 'single',\n\t\t'wrap': false,\n\t\t'es6': false,\n\t\t'json': false,\n\t\t'compact': true,\n\t\t'lowercaseHex': false,\n\t\t'numbers': 'decimal',\n\t\t'indent': '\\t',\n\t\t'indentLevel': 0,\n\t\t'__inline1__': false,\n\t\t'__inline2__': false\n\t};\n\tconst json = options && options.json;\n\tif (json) {\n\t\tdefaults.quotes = 'double';\n\t\tdefaults.wrap = true;\n\t}\n\toptions = extend(defaults, options);\n\tif (\n\t\toptions.quotes != 'single' &&\n\t\toptions.quotes != 'double' &&\n\t\toptions.quotes != 'backtick'\n\t) {\n\t\toptions.quotes = 'single';\n\t}\n\tconst quote = options.quotes == 'double' ?\n\t\t'\"' :\n\t\t(options.quotes == 'backtick' ?\n\t\t\t'`' :\n\t\t\t'\\''\n\t\t);\n\tconst compact = options.compact;\n\tconst lowercaseHex = options.lowercaseHex;\n\tlet indent = options.indent.repeat(options.indentLevel);\n\tlet oldIndent = '';\n\tconst inline1 = options.__inline1__;\n\tconst inline2 = options.__inline2__;\n\tconst newLine = compact ? '' : '\\n';\n\tlet result;\n\tlet isEmpty = true;\n\tconst useBinNumbers = options.numbers == 'binary';\n\tconst useOctNumbers = options.numbers == 'octal';\n\tconst useDecNumbers = options.numbers == 'decimal';\n\tconst useHexNumbers = options.numbers == 'hexadecimal';\n\n\tif (json && argument && isFunction(argument.toJSON)) {\n\t\targument = argument.toJSON();\n\t}\n\n\tif (!isString(argument)) {\n\t\tif (isMap(argument)) {\n\t\t\tif (argument.size == 0) {\n\t\t\t\treturn 'new Map()';\n\t\t\t}\n\t\t\tif (!compact) {\n\t\t\t\toptions.__inline1__ = true;\n\t\t\t\toptions.__inline2__ = false;\n\t\t\t}\n\t\t\treturn 'new Map(' + jsesc(Array.from(argument), options) + ')';\n\t\t}\n\t\tif (isSet(argument)) {\n\t\t\tif (argument.size == 0) {\n\t\t\t\treturn 'new Set()';\n\t\t\t}\n\t\t\treturn 'new Set(' + jsesc(Array.from(argument), options) + ')';\n\t\t}\n\t\tif (isBuffer(argument)) {\n\t\t\tif (argument.length == 0) {\n\t\t\t\treturn 'Buffer.from([])';\n\t\t\t}\n\t\t\treturn 'Buffer.from(' + jsesc(Array.from(argument), options) + ')';\n\t\t}\n\t\tif (isArray(argument)) {\n\t\t\tresult = [];\n\t\t\toptions.wrap = true;\n\t\t\tif (inline1) {\n\t\t\t\toptions.__inline1__ = false;\n\t\t\t\toptions.__inline2__ = true;\n\t\t\t}\n\t\t\tif (!inline2) {\n\t\t\t\tincreaseIndentation();\n\t\t\t}\n\t\t\tforEach(argument, (value) => {\n\t\t\t\tisEmpty = false;\n\t\t\t\tif (inline2) {\n\t\t\t\t\toptions.__inline2__ = false;\n\t\t\t\t}\n\t\t\t\tresult.push(\n\t\t\t\t\t(compact || inline2 ? '' : indent) +\n\t\t\t\t\tjsesc(value, options)\n\t\t\t\t);\n\t\t\t});\n\t\t\tif (isEmpty) {\n\t\t\t\treturn '[]';\n\t\t\t}\n\t\t\tif (inline2) {\n\t\t\t\treturn '[' + result.join(', ') + ']';\n\t\t\t}\n\t\t\treturn '[' + newLine + result.join(',' + newLine) + newLine +\n\t\t\t\t(compact ? '' : oldIndent) + ']';\n\t\t} else if (isNumber(argument)) {\n\t\t\tif (json) {\n\t\t\t\t// Some number values (e.g. `Infinity`) cannot be represented in JSON.\n\t\t\t\treturn JSON.stringify(argument);\n\t\t\t}\n\t\t\tif (useDecNumbers) {\n\t\t\t\treturn String(argument);\n\t\t\t}\n\t\t\tif (useHexNumbers) {\n\t\t\t\tlet hexadecimal = argument.toString(16);\n\t\t\t\tif (!lowercaseHex) {\n\t\t\t\t\thexadecimal = hexadecimal.toUpperCase();\n\t\t\t\t}\n\t\t\t\treturn '0x' + hexadecimal;\n\t\t\t}\n\t\t\tif (useBinNumbers) {\n\t\t\t\treturn '0b' + argument.toString(2);\n\t\t\t}\n\t\t\tif (useOctNumbers) {\n\t\t\t\treturn '0o' + argument.toString(8);\n\t\t\t}\n\t\t} else if (!isObject(argument)) {\n\t\t\tif (json) {\n\t\t\t\t// For some values (e.g. `undefined`, `function` objects),\n\t\t\t\t// `JSON.stringify(value)` returns `undefined` (which isn’t valid\n\t\t\t\t// JSON) instead of `'null'`.\n\t\t\t\treturn JSON.stringify(argument) || 'null';\n\t\t\t}\n\t\t\treturn String(argument);\n\t\t} else { // it’s an object\n\t\t\tresult = [];\n\t\t\toptions.wrap = true;\n\t\t\tincreaseIndentation();\n\t\t\tforOwn(argument, (key, value) => {\n\t\t\t\tisEmpty = false;\n\t\t\t\tresult.push(\n\t\t\t\t\t(compact ? '' : indent) +\n\t\t\t\t\tjsesc(key, options) + ':' +\n\t\t\t\t\t(compact ? '' : ' ') +\n\t\t\t\t\tjsesc(value, options)\n\t\t\t\t);\n\t\t\t});\n\t\t\tif (isEmpty) {\n\t\t\t\treturn '{}';\n\t\t\t}\n\t\t\treturn '{' + newLine + result.join(',' + newLine) + newLine +\n\t\t\t\t(compact ? '' : oldIndent) + '}';\n\t\t}\n\t}\n\n\tconst string = argument;\n\t// Loop over each code unit in the string and escape it\n\tlet index = -1;\n\tconst length = string.length;\n\tresult = '';\n\twhile (++index < length) {\n\t\tconst character = string.charAt(index);\n\t\tif (options.es6) {\n\t\t\tconst first = string.charCodeAt(index);\n\t\t\tif ( // check if it’s the start of a surrogate pair\n\t\t\t\tfirst >= 0xD800 && first <= 0xDBFF && // high surrogate\n\t\t\t\tlength > index + 1 // there is a next code unit\n\t\t\t) {\n\t\t\t\tconst second = string.charCodeAt(index + 1);\n\t\t\t\tif (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate\n\t\t\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\t\t\tconst codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n\t\t\t\t\tlet hexadecimal = codePoint.toString(16);\n\t\t\t\t\tif (!lowercaseHex) {\n\t\t\t\t\t\thexadecimal = hexadecimal.toUpperCase();\n\t\t\t\t\t}\n\t\t\t\t\tresult += '\\\\u{' + hexadecimal + '}';\n\t\t\t\t\t++index;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!options.escapeEverything) {\n\t\t\tif (regexWhitelist.test(character)) {\n\t\t\t\t// It’s a printable ASCII character that is not `\"`, `'` or `\\`,\n\t\t\t\t// so don’t escape it.\n\t\t\t\tresult += character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character == '\"') {\n\t\t\t\tresult += quote == character ? '\\\\\"' : character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character == '`') {\n\t\t\t\tresult += quote == character ? '\\\\`' : character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character == '\\'') {\n\t\t\t\tresult += quote == character ? '\\\\\\'' : character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tcharacter == '\\0' &&\n\t\t\t!json &&\n\t\t\t!regexDigit.test(string.charAt(index + 1))\n\t\t) {\n\t\t\tresult += '\\\\0';\n\t\t\tcontinue;\n\t\t}\n\t\tif (regexSingleEscape.test(character)) {\n\t\t\t// no need for a `hasOwnProperty` check here\n\t\t\tresult += singleEscapes[character];\n\t\t\tcontinue;\n\t\t}\n\t\tconst charCode = character.charCodeAt(0);\n\t\tif (options.minimal && charCode != 0x2028 && charCode != 0x2029) {\n\t\t\tresult += character;\n\t\t\tcontinue;\n\t\t}\n\t\tlet hexadecimal = charCode.toString(16);\n\t\tif (!lowercaseHex) {\n\t\t\thexadecimal = hexadecimal.toUpperCase();\n\t\t}\n\t\tconst longhand = hexadecimal.length > 2 || json;\n\t\tconst escaped = '\\\\' + (longhand ? 'u' : 'x') +\n\t\t\t('0000' + hexadecimal).slice(longhand ? -4 : -2);\n\t\tresult += escaped;\n\t\tcontinue;\n\t}\n\tif (options.wrap) {\n\t\tresult = quote + result + quote;\n\t}\n\tif (quote == '`') {\n\t\tresult = result.replace(/\\$\\{/g, '\\\\\\$\\{');\n\t}\n\tif (options.isScriptContext) {\n\t\t// https://mathiasbynens.be/notes/etago\n\t\treturn result\n\t\t\t.replace(/<\\/(script|style)/gi, '<\\\\/$1')\n\t\t\t.replace(/` line comment\n this.skipLineComment(3);\n this.skipSpace();\n this.nextToken();\n return;\n }\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt_gt(code: number): void {\n // '<>'\n const next = this.input.charCodeAt(this.state.pos + 1);\n let size = 1;\n\n if (next === code) {\n size =\n code === charCodes.greaterThan &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan\n ? 3\n : 2;\n if (this.input.charCodeAt(this.state.pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShift, size);\n return;\n }\n\n if (\n next === charCodes.exclamationMark &&\n code === charCodes.lessThan &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dash &&\n this.input.charCodeAt(this.state.pos + 3) === charCodes.dash\n ) {\n // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n this.nextToken();\n return;\n }\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt_gt(code: number): void {\n // '<>'\n const next = this.input.charCodeAt(this.state.pos + 1);\n let size = 1;\n\n if (next === code) {\n size =\n code === charCodes.greaterThan &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan\n ? 3\n : 2;\n if (this.input.charCodeAt(this.state.pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShift, size);\n return;\n }\n\n if (\n next === charCodes.exclamationMark &&\n code === charCodes.lessThan &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dash &&\n this.input.charCodeAt(this.state.pos + 3) === charCodes.dash\n ) {\n // ` * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0\nfunction replaceTildes (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceTilde(comp, options)\n }).join(' ')\n}\n\nfunction replaceTilde (comp, options) {\n var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('tilde', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0\n// ^1.2.3 --> >=1.2.3 <2.0.0\n// ^1.2.0 --> >=1.2.0 <2.0.0\nfunction replaceCarets (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceCaret(comp, options)\n }).join(' ')\n}\n\nfunction replaceCaret (comp, options) {\n debug('caret', comp, options)\n var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('caret', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n if (M === '0') {\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else {\n ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + (+M + 1) + '.0.0'\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + (+M + 1) + '.0.0'\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nfunction replaceXRanges (comp, options) {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map(function (comp) {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nfunction replaceXRange (comp, options) {\n comp = comp.trim()\n var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, function (ret, gtlt, M, m, p, pr) {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n var xM = isX(M)\n var xm = xM || isX(m)\n var xp = xm || isX(p)\n var anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n // >1.2.3 => >= 1.2.4\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n ret = gtlt + M + '.' + m + '.' + p + pr\n } else if (xm) {\n ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr\n } else if (xp) {\n ret = '>=' + M + '.' + m + '.0' + pr +\n ' <' + M + '.' + (+m + 1) + '.0' + pr\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nfunction replaceStars (comp, options) {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0\nfunction hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}\n\n// if ANY of the sets match ALL of its comparators, then pass\nRange.prototype.test = function (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (var i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n}\n\nfunction testSet (set, version, options) {\n for (var i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n var allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n\nexports.satisfies = satisfies\nfunction satisfies (version, range, options) {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\n\nexports.maxSatisfying = maxSatisfying\nfunction maxSatisfying (versions, range, options) {\n var max = null\n var maxSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\n\nexports.minSatisfying = minSatisfying\nfunction minSatisfying (versions, range, options) {\n var min = null\n var minSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\n\nexports.minVersion = minVersion\nfunction minVersion (range, loose) {\n range = new Range(range, loose)\n\n var minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n comparators.forEach(function (comparator) {\n // Clone to avoid manipulating the comparator's semver object.\n var compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!minver || gt(minver, compver)) {\n minver = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected operation: ' + comparator.operator)\n }\n })\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\n\nexports.validRange = validRange\nfunction validRange (range, options) {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\n\n// Determine if version is less than all the versions possible in the range\nexports.ltr = ltr\nfunction ltr (version, range, options) {\n return outside(version, range, '<', options)\n}\n\n// Determine if version is greater than all the versions possible in the range.\nexports.gtr = gtr\nfunction gtr (version, range, options) {\n return outside(version, range, '>', options)\n}\n\nexports.outside = outside\nfunction outside (version, range, hilo, options) {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n var gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisifes the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n var high = null\n var low = null\n\n comparators.forEach(function (comparator) {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nexports.prerelease = prerelease\nfunction prerelease (version, options) {\n var parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\n\nexports.intersects = intersects\nfunction intersects (r1, r2, options) {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\n\nexports.coerce = coerce\nfunction coerce (version, options) {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n var match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n var next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n return parse(match[2] +\n '.' + (match[3] || '0') +\n '.' + (match[4] || '0'), options)\n}\n","// @flow\n\nimport * as helpers from \"@babel/helpers\";\nimport { NodePath, Scope, type HubInterface } from \"@babel/traverse\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport traverse from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\nimport semver from \"semver\";\n\nimport type { NormalizedFile } from \"../normalize-file\";\n\nconst errorVisitor = {\n enter(path, state) {\n const loc = path.node.loc;\n if (loc) {\n state.loc = loc;\n path.stop();\n }\n },\n};\n\nexport type NodeLocation = {\n loc?: {\n end?: { line: number, column: number },\n start: { line: number, column: number },\n },\n _loc?: {\n end?: { line: number, column: number },\n start: { line: number, column: number },\n },\n};\n\nexport default class File {\n _map: Map = new Map();\n opts: Object;\n declarations: Object = {};\n path: NodePath = null;\n ast: Object = {};\n scope: Scope;\n metadata: {} = {};\n code: string = \"\";\n inputMap: Object | null = null;\n\n hub: HubInterface = {\n // keep it for the usage in babel-core, ex: path.hub.file.opts.filename\n file: this,\n getCode: () => this.code,\n getScope: () => this.scope,\n addHelper: this.addHelper.bind(this),\n buildError: this.buildCodeFrameError.bind(this),\n };\n\n constructor(options: {}, { code, ast, inputMap }: NormalizedFile) {\n this.opts = options;\n this.code = code;\n this.ast = ast;\n this.inputMap = inputMap;\n\n this.path = NodePath.get({\n hub: this.hub,\n parentPath: null,\n parent: this.ast,\n container: this.ast,\n key: \"program\",\n }).setContext();\n this.scope = this.path.scope;\n }\n\n /**\n * Provide backward-compatible access to the interpreter directive handling\n * in Babel 6.x. If you are writing a plugin for Babel 7.x, it would be\n * best to use 'program.interpreter' directly.\n */\n get shebang(): string {\n const { interpreter } = this.path.node;\n return interpreter ? interpreter.value : \"\";\n }\n set shebang(value: string): void {\n if (value) {\n this.path.get(\"interpreter\").replaceWith(t.interpreterDirective(value));\n } else {\n this.path.get(\"interpreter\").remove();\n }\n }\n\n set(key: mixed, val: mixed) {\n if (key === \"helpersNamespace\") {\n throw new Error(\n \"Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.\" +\n \"If you are using @babel/plugin-external-helpers you will need to use a newer \" +\n \"version than the one you currently have installed. \" +\n \"If you have your own implementation, you'll want to explore using 'helperGenerator' \" +\n \"alongside 'file.availableHelper()'.\",\n );\n }\n\n this._map.set(key, val);\n }\n\n get(key: mixed): any {\n return this._map.get(key);\n }\n\n has(key: mixed): boolean {\n return this._map.has(key);\n }\n\n getModuleName(): ?string {\n const {\n filename,\n filenameRelative = filename,\n\n moduleId,\n moduleIds = !!moduleId,\n\n getModuleId,\n\n sourceRoot: sourceRootTmp,\n moduleRoot = sourceRootTmp,\n sourceRoot = moduleRoot,\n } = this.opts;\n\n if (!moduleIds) return null;\n\n // moduleId is n/a if a `getModuleId()` is provided\n if (moduleId != null && !getModuleId) {\n return moduleId;\n }\n\n let moduleName = moduleRoot != null ? moduleRoot + \"/\" : \"\";\n\n if (filenameRelative) {\n const sourceRootReplacer =\n sourceRoot != null ? new RegExp(\"^\" + sourceRoot + \"/?\") : \"\";\n\n moduleName += filenameRelative\n // remove sourceRoot from filename\n .replace(sourceRootReplacer, \"\")\n // remove extension\n .replace(/\\.(\\w*?)$/, \"\");\n }\n\n // normalize path separators\n moduleName = moduleName.replace(/\\\\/g, \"/\");\n\n if (getModuleId) {\n // If return is falsy, assume they want us to use our generated default name\n return getModuleId(moduleName) || moduleName;\n } else {\n return moduleName;\n }\n }\n\n addImport() {\n throw new Error(\n \"This API has been removed. If you're looking for this \" +\n \"functionality in Babel 7, you should import the \" +\n \"'@babel/helper-module-imports' module and use the functions exposed \" +\n \" from that module, such as 'addNamed' or 'addDefault'.\",\n );\n }\n\n /**\n * Check if a given helper is available in @babel/core's helper list.\n *\n * This _also_ allows you to pass a Babel version specifically. If the\n * helper exists, but was not available for the full given range, it will be\n * considered unavailable.\n */\n availableHelper(name: string, versionRange: ?string): boolean {\n let minVersion;\n try {\n minVersion = helpers.minVersion(name);\n } catch (err) {\n if (err.code !== \"BABEL_HELPER_UNKNOWN\") throw err;\n\n return false;\n }\n\n if (typeof versionRange !== \"string\") return true;\n\n // semver.intersects() has some surprising behavior with comparing ranges\n // with preprelease versions. We add '^' to ensure that we are always\n // comparing ranges with ranges, which sidesteps this logic.\n // For example:\n //\n // semver.intersects(`<7.0.1`, \"7.0.0-beta.0\") // false - surprising\n // semver.intersects(`<7.0.1`, \"^7.0.0-beta.0\") // true - expected\n //\n // This is because the first falls back to\n //\n // semver.satisfies(\"7.0.0-beta.0\", `<7.0.1`) // false - surprising\n //\n // and this fails because a prerelease version can only satisfy a range\n // if it is a prerelease within the same major/minor/patch range.\n //\n // Note: If this is found to have issues, please also revisit the logic in\n // transform-runtime's definitions.js file.\n if (semver.valid(versionRange)) versionRange = `^${versionRange}`;\n\n return (\n !semver.intersects(`<${minVersion}`, versionRange) &&\n !semver.intersects(`>=8.0.0`, versionRange)\n );\n }\n\n addHelper(name: string): Object {\n const declar = this.declarations[name];\n if (declar) return t.cloneNode(declar);\n\n const generator = this.get(\"helperGenerator\");\n if (generator) {\n const res = generator(name);\n if (res) return res;\n }\n\n // make sure that the helper exists\n helpers.ensure(name);\n\n const uid = (this.declarations[name] = this.scope.generateUidIdentifier(\n name,\n ));\n\n const dependencies = {};\n for (const dep of helpers.getDependencies(name)) {\n dependencies[dep] = this.addHelper(dep);\n }\n\n const { nodes, globals } = helpers.get(\n name,\n dep => dependencies[dep],\n uid,\n Object.keys(this.scope.getAllBindings()),\n );\n\n globals.forEach(name => {\n if (this.path.scope.hasBinding(name, true /* noGlobals */)) {\n this.path.scope.rename(name);\n }\n });\n\n nodes.forEach(node => {\n node._compact = true;\n });\n\n this.path.unshiftContainer(\"body\", nodes);\n // TODO: NodePath#unshiftContainer should automatically register new\n // bindings.\n this.path.get(\"body\").forEach(path => {\n if (nodes.indexOf(path.node) === -1) return;\n if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);\n });\n\n return uid;\n }\n\n addTemplateObject() {\n throw new Error(\n \"This function has been moved into the template literal transform itself.\",\n );\n }\n\n buildCodeFrameError(\n node: ?NodeLocation,\n msg: string,\n Error: typeof Error = SyntaxError,\n ): Error {\n let loc = node && (node.loc || node._loc);\n\n if (!loc && node) {\n const state = {\n loc: null,\n };\n traverse(node, errorVisitor, this.scope, state);\n loc = state.loc;\n\n let txt =\n \"This is an error on an internal node. Probably an internal error.\";\n if (loc) txt += \" Location has been estimated.\";\n\n msg += ` (${txt})`;\n }\n\n if (loc) {\n const { highlightCode = true } = this.opts;\n\n msg +=\n \"\\n\" +\n codeFrameColumns(\n this.code,\n {\n start: {\n line: loc.start.line,\n column: loc.start.column + 1,\n },\n end:\n loc.end && loc.start.line === loc.end.line\n ? {\n line: loc.end.line,\n column: loc.end.column + 1,\n }\n : undefined,\n },\n { highlightCode },\n );\n }\n\n return new Error(msg);\n }\n}\n","import * as helpers from \"@babel/helpers\";\nimport generator from \"@babel/generator\";\nimport template from \"@babel/template\";\nimport * as t from \"@babel/types\";\n\n// Wrapped to avoid wasting time parsing this when almost no-one uses\n// build-external-helpers.\nconst buildUmdWrapper = replacements =>\n template`\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n `(replacements);\n\nfunction buildGlobal(whitelist) {\n const namespace = t.identifier(\"babelHelpers\");\n\n const body = [];\n const container = t.functionExpression(\n null,\n [t.identifier(\"global\")],\n t.blockStatement(body),\n );\n const tree = t.program([\n t.expressionStatement(\n t.callExpression(container, [\n // typeof global === \"undefined\" ? self : global\n t.conditionalExpression(\n t.binaryExpression(\n \"===\",\n t.unaryExpression(\"typeof\", t.identifier(\"global\")),\n t.stringLiteral(\"undefined\"),\n ),\n t.identifier(\"self\"),\n t.identifier(\"global\"),\n ),\n ]),\n ),\n ]);\n\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(\n namespace,\n t.assignmentExpression(\n \"=\",\n t.memberExpression(t.identifier(\"global\"), namespace),\n t.objectExpression([]),\n ),\n ),\n ]),\n );\n\n buildHelpers(body, namespace, whitelist);\n\n return tree;\n}\n\nfunction buildModule(whitelist) {\n const body = [];\n const refs = buildHelpers(body, null, whitelist);\n\n body.unshift(\n t.exportNamedDeclaration(\n null,\n Object.keys(refs).map(name => {\n return t.exportSpecifier(t.cloneNode(refs[name]), t.identifier(name));\n }),\n ),\n );\n\n return t.program(body, [], \"module\");\n}\n\nfunction buildUmd(whitelist) {\n const namespace = t.identifier(\"babelHelpers\");\n\n const body = [];\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(namespace, t.identifier(\"global\")),\n ]),\n );\n\n buildHelpers(body, namespace, whitelist);\n\n return t.program([\n buildUmdWrapper({\n FACTORY_PARAMETERS: t.identifier(\"global\"),\n BROWSER_ARGUMENTS: t.assignmentExpression(\n \"=\",\n t.memberExpression(t.identifier(\"root\"), namespace),\n t.objectExpression([]),\n ),\n COMMON_ARGUMENTS: t.identifier(\"exports\"),\n AMD_ARGUMENTS: t.arrayExpression([t.stringLiteral(\"exports\")]),\n FACTORY_BODY: body,\n UMD_ROOT: t.identifier(\"this\"),\n }),\n ]);\n}\n\nfunction buildVar(whitelist) {\n const namespace = t.identifier(\"babelHelpers\");\n\n const body = [];\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(namespace, t.objectExpression([])),\n ]),\n );\n const tree = t.program(body);\n buildHelpers(body, namespace, whitelist);\n body.push(t.expressionStatement(namespace));\n return tree;\n}\n\nfunction buildHelpers(body, namespace, whitelist) {\n const getHelperReference = name => {\n return namespace\n ? t.memberExpression(namespace, t.identifier(name))\n : t.identifier(`_${name}`);\n };\n\n const refs = {};\n helpers.list.forEach(function(name) {\n if (whitelist && whitelist.indexOf(name) < 0) return;\n\n const ref = (refs[name] = getHelperReference(name));\n\n const { nodes } = helpers.get(name, getHelperReference, ref);\n\n body.push(...nodes);\n });\n return refs;\n}\nexport default function(\n whitelist?: Array,\n outputType: \"global\" | \"module\" | \"umd\" | \"var\" = \"global\",\n) {\n let tree;\n\n const build = {\n global: buildGlobal,\n module: buildModule,\n umd: buildUmd,\n var: buildVar,\n }[outputType];\n\n if (build) {\n tree = build(whitelist);\n } else {\n throw new Error(`Unsupported output type ${outputType}`);\n }\n\n return generator(tree).code;\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","module.exports = require(\"regenerator-runtime\");\n","// @flow\n\nimport type { Handler } from \"gensync\";\n\nimport type {\n ConfigFile,\n IgnoreFile,\n RelativeConfig,\n FilePackageData,\n} from \"./types\";\n\nimport type { CallerMetadata } from \"../validation/options\";\n\nexport type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData };\n\n// eslint-disable-next-line require-yield\nexport function* findConfigUpwards(\n rootDir: string, // eslint-disable-line no-unused-vars\n): Handler {\n return null;\n}\n\n// eslint-disable-next-line require-yield\nexport function* findPackageData(filepath: string): Handler {\n return {\n filepath,\n directories: [],\n pkg: null,\n isPackage: false,\n };\n}\n\n// eslint-disable-next-line require-yield\nexport function* findRelativeConfig(\n pkgData: FilePackageData, // eslint-disable-line no-unused-vars\n envName: string, // eslint-disable-line no-unused-vars\n caller: CallerMetadata | void, // eslint-disable-line no-unused-vars\n): Handler {\n return { pkg: null, config: null, ignore: null };\n}\n\n// eslint-disable-next-line require-yield\nexport function* findRootConfig(\n dirname: string, // eslint-disable-line no-unused-vars\n envName: string, // eslint-disable-line no-unused-vars\n caller: CallerMetadata | void, // eslint-disable-line no-unused-vars\n): Handler {\n return null;\n}\n\n// eslint-disable-next-line require-yield\nexport function* loadConfig(\n name: string,\n dirname: string,\n envName: string, // eslint-disable-line no-unused-vars\n caller: CallerMetadata | void, // eslint-disable-line no-unused-vars\n): Handler {\n throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);\n}\n\nexport const ROOT_CONFIG_FILENAMES = [];\n\n// eslint-disable-next-line no-unused-vars\nexport function resolvePlugin(name: string, dirname: string): string | null {\n return null;\n}\n\n// eslint-disable-next-line no-unused-vars\nexport function resolvePreset(name: string, dirname: string): string | null {\n return null;\n}\n\nexport function loadPlugin(\n name: string,\n dirname: string,\n): { filepath: string, value: mixed } {\n throw new Error(\n `Cannot load plugin ${name} relative to ${dirname} in a browser`,\n );\n}\n\nexport function loadPreset(\n name: string,\n dirname: string,\n): { filepath: string, value: mixed } {\n throw new Error(\n `Cannot load preset ${name} relative to ${dirname} in a browser`,\n );\n}\n","// @flow\n\nexport function getEnv(defaultValue: string = \"development\"): string {\n return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexport function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexport function normalize(path) {\n var isPathAbsolute = isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isPathAbsolute).join('/');\n\n if (!path && !isPathAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isPathAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexport function isAbsolute(path) {\n return path.charAt(0) === '/';\n}\n\n// posix version\nexport function join() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n}\n\n\n// path.relative(from, to)\n// posix version\nexport function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}\n\nexport var sep = '/';\nexport var delimiter = ':';\n\nexport function dirname(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n}\n\nexport function basename(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n}\n\n\nexport function extname(path) {\n return splitPath(path)[3];\n}\nexport default {\n extname: extname,\n basename: basename,\n dirname: dirname,\n sep: sep,\n delimiter: delimiter,\n relative: relative,\n join: join,\n isAbsolute: isAbsolute,\n normalize: normalize,\n resolve: resolve\n};\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b' ?\n function (str, start, len) { return str.substr(start, len) } :\n function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","\"use strict\";\n\n// These use the global symbol registry so that multiple copies of this\n// library can work together in case they are not deduped.\nconst GENSYNC_START = Symbol.for(\"gensync:v1:start\");\nconst GENSYNC_SUSPEND = Symbol.for(\"gensync:v1:suspend\");\n\nconst GENSYNC_EXPECTED_START = \"GENSYNC_EXPECTED_START\";\nconst GENSYNC_EXPECTED_SUSPEND = \"GENSYNC_EXPECTED_SUSPEND\";\nconst GENSYNC_OPTIONS_ERROR = \"GENSYNC_OPTIONS_ERROR\";\nconst GENSYNC_RACE_NONEMPTY = \"GENSYNC_RACE_NONEMPTY\";\nconst GENSYNC_ERRBACK_NO_CALLBACK = \"GENSYNC_ERRBACK_NO_CALLBACK\";\n\nmodule.exports = Object.assign(\n function gensync(optsOrFn) {\n let genFn = optsOrFn;\n if (typeof optsOrFn !== \"function\") {\n genFn = newGenerator(optsOrFn);\n } else {\n genFn = wrapGenerator(optsOrFn);\n }\n\n return Object.assign(genFn, makeFunctionAPI(genFn));\n },\n {\n all: buildOperation({\n name: \"all\",\n arity: 1,\n sync: function(args) {\n const items = Array.from(args[0]);\n return items.map(item => evaluateSync(item));\n },\n async: function(args, resolve, reject) {\n const items = Array.from(args[0]);\n\n let count = 0;\n const results = items.map(() => undefined);\n items.forEach((item, i) => {\n evaluateAsync(\n item,\n val => {\n results[i] = val;\n count += 1;\n\n if (count === results.length) resolve(results);\n },\n reject\n );\n });\n },\n }),\n race: buildOperation({\n name: \"race\",\n arity: 1,\n sync: function(args) {\n const items = Array.from(args[0]);\n if (items.length === 0) {\n throw makeError(\"Must race at least 1 item\", GENSYNC_RACE_NONEMPTY);\n }\n\n return evaluateSync(items[0]);\n },\n async: function(args, resolve, reject) {\n const items = Array.from(args[0]);\n if (items.length === 0) {\n throw makeError(\"Must race at least 1 item\", GENSYNC_RACE_NONEMPTY);\n }\n\n for (const item of items) {\n evaluateAsync(item, resolve, reject);\n }\n },\n }),\n }\n);\n\n/**\n * Given a generator function, return the standard API object that executes\n * the generator and calls the callbacks.\n */\nfunction makeFunctionAPI(genFn) {\n const fns = {\n sync: function(...args) {\n return evaluateSync(genFn.apply(this, args));\n },\n async: function(...args) {\n return new Promise((resolve, reject) => {\n evaluateAsync(genFn.apply(this, args), resolve, reject);\n });\n },\n errback: function(...args) {\n const cb = args.pop();\n if (typeof cb !== \"function\") {\n throw makeError(\n \"Asynchronous function called without callback\",\n GENSYNC_ERRBACK_NO_CALLBACK\n );\n }\n\n let gen;\n try {\n gen = genFn.apply(this, args);\n } catch (err) {\n cb(err);\n return;\n }\n\n evaluateAsync(gen, val => cb(undefined, val), err => cb(err));\n },\n };\n return fns;\n}\n\nfunction assertTypeof(type, name, value, allowUndefined) {\n if (\n typeof value === type ||\n (allowUndefined && typeof value === \"undefined\")\n ) {\n return;\n }\n\n let msg;\n if (allowUndefined) {\n msg = `Expected opts.${name} to be either a ${type}, or undefined.`;\n } else {\n msg = `Expected opts.${name} to be a ${type}.`;\n }\n\n throw makeError(msg, GENSYNC_OPTIONS_ERROR);\n}\nfunction makeError(msg, code) {\n return Object.assign(new Error(msg), { code });\n}\n\n/**\n * Given an options object, return a new generator that dispatches the\n * correct handler based on sync or async execution.\n */\nfunction newGenerator({ name, arity, sync, async, errback }) {\n assertTypeof(\"string\", \"name\", name, true /* allowUndefined */);\n assertTypeof(\"number\", \"arity\", arity, true /* allowUndefined */);\n assertTypeof(\"function\", \"sync\", sync);\n assertTypeof(\"function\", \"async\", async, true /* allowUndefined */);\n assertTypeof(\"function\", \"errback\", errback, true /* allowUndefined */);\n if (async && errback) {\n throw makeError(\n \"Expected one of either opts.async or opts.errback, but got _both_.\",\n GENSYNC_OPTIONS_ERROR\n );\n }\n\n if (typeof name !== \"string\") {\n let fnName;\n if (errback && errback.name && errback.name !== \"errback\") {\n fnName = errback.name;\n }\n if (async && async.name && async.name !== \"async\") {\n fnName = async.name.replace(/Async$/, \"\");\n }\n if (sync && sync.name && sync.name !== \"sync\") {\n fnName = sync.name.replace(/Sync$/, \"\");\n }\n\n if (typeof fnName === \"string\") {\n name = fnName;\n }\n }\n\n if (typeof arity !== \"number\") {\n arity = sync.length;\n }\n\n return buildOperation({\n name,\n arity,\n sync: function(args) {\n return sync.apply(this, args);\n },\n async: function(args, resolve, reject) {\n if (async) {\n async.apply(this, args).then(resolve, reject);\n } else if (errback) {\n errback.call(this, ...args, (err, value) => {\n if (err == null) resolve(value);\n else reject(err);\n });\n } else {\n resolve(sync.apply(this, args));\n }\n },\n });\n}\n\nfunction wrapGenerator(genFn) {\n return setFunctionMetadata(genFn.name, genFn.length, function(...args) {\n return genFn.apply(this, args);\n });\n}\n\nfunction buildOperation({ name, arity, sync, async }) {\n return setFunctionMetadata(name, arity, function*(...args) {\n const resume = yield GENSYNC_START;\n if (!resume) {\n return sync.call(this, args);\n }\n\n let result;\n try {\n async.call(\n this,\n args,\n value => {\n if (result) return;\n\n result = { value };\n resume();\n },\n err => {\n if (result) return;\n\n result = { err };\n resume();\n }\n );\n } catch (err) {\n result = { err };\n resume();\n }\n\n // Suspend until the callbacks run. Will resume synchronously if the\n // callback was already called.\n yield GENSYNC_SUSPEND;\n\n if (result.hasOwnProperty(\"err\")) {\n throw result.err;\n }\n\n return result.value;\n });\n}\n\nfunction evaluateSync(gen) {\n let value;\n while (!({ value } = gen.next()).done) {\n assertStart(value, gen);\n }\n return value;\n}\n\nfunction evaluateAsync(gen, resolve, reject) {\n (function step() {\n try {\n let value;\n while (!({ value } = gen.next()).done) {\n assertStart(value, gen);\n\n // If this throws, it is considered to have broken the contract\n // established for async handlers. If these handlers are called\n // synchronously, it is also considered bad behavior.\n let sync = true;\n let didSyncResume = false;\n const out = gen.next(() => {\n if (sync) {\n didSyncResume = true;\n } else {\n step();\n }\n });\n sync = false;\n\n assertSuspend(out, gen);\n\n if (!didSyncResume) {\n // Callback wasn't called synchronously, so break out of the loop\n // and let it call 'step' later.\n return;\n }\n }\n\n return resolve(value);\n } catch (err) {\n return reject(err);\n }\n })();\n}\n\nfunction assertStart(value, gen) {\n if (value === GENSYNC_START) return;\n\n throwError(\n gen,\n makeError(\n `Got unexpected yielded value in gensync generator: ${JSON.stringify(\n value\n )}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,\n GENSYNC_EXPECTED_START\n )\n );\n}\nfunction assertSuspend({ value, done }, gen) {\n if (!done && value === GENSYNC_SUSPEND) return;\n\n throwError(\n gen,\n makeError(\n done\n ? \"Unexpected generator completion. If you get this, it is probably a gensync bug.\"\n : `Expected GENSYNC_SUSPEND, got ${JSON.stringify(\n value\n )}. If you get this, it is probably a gensync bug.`,\n GENSYNC_EXPECTED_SUSPEND\n )\n );\n}\n\nfunction throwError(gen, err) {\n // Call `.throw` so that users can step in a debugger to easily see which\n // 'yield' passed an unexpected value. If the `.throw` call didn't throw\n // back to the generator, we explicitly do it to stop the error\n // from being swallowed by user code try/catches.\n if (gen.throw) gen.throw(err);\n throw err;\n}\n\nfunction isIterable(value) {\n return (\n !!value &&\n (typeof value === \"object\" || typeof value === \"function\") &&\n !value[Symbol.iterator]\n );\n}\n\nfunction setFunctionMetadata(name, arity, fn) {\n if (typeof name === \"string\") {\n // This should always work on the supported Node versions, but for the\n // sake of users that are compiling to older versions, we check for\n // configurability so we don't throw.\n const nameDesc = Object.getOwnPropertyDescriptor(fn, \"name\");\n if (!nameDesc || nameDesc.configurable) {\n Object.defineProperty(\n fn,\n \"name\",\n Object.assign(nameDesc || {}, {\n configurable: true,\n value: name,\n })\n );\n }\n }\n\n if (typeof arity === \"number\") {\n const lengthDesc = Object.getOwnPropertyDescriptor(fn, \"length\");\n if (!lengthDesc || lengthDesc.configurable) {\n Object.defineProperty(\n fn,\n \"length\",\n Object.assign(lengthDesc || {}, {\n configurable: true,\n value: arity,\n })\n );\n }\n }\n\n return fn;\n}\n","// @flow\n\nimport gensync, { type Gensync, type Handler } from \"gensync\";\n\ntype MaybePromise = T | Promise;\n\nconst id = x => x;\n\nconst runGenerator = gensync(function*(item) {\n return yield* item;\n});\n\n// This Gensync returns true if the current execution contect is\n// asynchronous, otherwise it returns false.\nexport const isAsync = gensync<[], boolean>({\n sync: () => false,\n errback: cb => cb(null, true),\n});\n\n// This function wraps any functions (which could be either synchronous or\n// asynchronous) with a Gensync. If the wrapped function returns a promise\n// but the current execution context is synchronous, it will throw the\n// provided error.\n// This is used to handle user-provided functions which could be asynchronous.\nexport function maybeAsync(\n fn: (...args: Args) => T,\n message: string,\n): Gensync {\n return gensync({\n sync(...args) {\n const result = fn.apply(this, args);\n if (isThenable(result)) throw new Error(message);\n return result;\n },\n async(...args) {\n return Promise.resolve(fn.apply(this, args));\n },\n });\n}\n\nconst withKind = (gensync<[any], any>({\n sync: cb => cb(\"sync\"),\n async: cb => cb(\"async\"),\n}): (cb: (kind: \"sync\" | \"async\") => MaybePromise) => Handler);\n\n// This function wraps a generator (or a Gensync) into another function which,\n// when called, will run the provided generator in a sync or async way, depending\n// on the execution context where this forwardAsync function is called.\n// This is useful, for example, when passing a callback to a function which isn't\n// aware of gensync, but it only knows about synchronous and asynchronous functions.\n// An example is cache.using, which being exposed to the user must be as simple as\n// possible:\n// yield* forwardAsync(gensyncFn, wrappedFn =>\n// cache.using(x => {\n// // Here we don't know about gensync. wrappedFn is a\n// // normal sync or async function\n// return wrappedFn(x);\n// })\n// )\nexport function forwardAsync(\n action: (...args: ActionArgs) => Handler,\n cb: (\n adapted: (...args: ActionArgs) => MaybePromise,\n ) => MaybePromise,\n): Handler {\n const g = gensync(action);\n return withKind(kind => {\n const adapted = g[kind];\n return cb(adapted);\n });\n}\n\n// If the given generator is executed asynchronously, the first time that it\n// is paused (i.e. When it yields a gensync generator which can't be run\n// synchronously), call the \"firstPause\" callback.\nexport const onFirstPause = (gensync<[any, any], any>({\n name: \"onFirstPause\",\n arity: 2,\n sync: function(item) {\n return runGenerator.sync(item);\n },\n errback: function(item, firstPause, cb) {\n let completed = false;\n\n runGenerator.errback(item, (err, value) => {\n completed = true;\n cb(err, value);\n });\n\n if (!completed) {\n firstPause();\n }\n },\n}): (gen: Generator<*, T, *>, cb: Function) => Handler);\n\n// Wait for the given promise to be resolved\nexport const waitFor = (gensync<[any], any>({\n sync: id,\n async: id,\n}): (p: T | Promise) => Handler);\n\nexport function isThenable(val: mixed): boolean %checks {\n return (\n /*:: val instanceof Promise && */\n !!val &&\n (typeof val === \"object\" || typeof val === \"function\") &&\n !!val.then &&\n typeof val.then === \"function\"\n );\n}\n","// @flow\n\nimport type { ValidatedOptions } from \"./validation/options\";\n\nexport function mergeOptions(\n target: ValidatedOptions,\n source: ValidatedOptions,\n): void {\n for (const k of Object.keys(source)) {\n if (k === \"parserOpts\" && source.parserOpts) {\n const parserOpts = source.parserOpts;\n const targetObj = (target.parserOpts = target.parserOpts || {});\n mergeDefaultFields(targetObj, parserOpts);\n } else if (k === \"generatorOpts\" && source.generatorOpts) {\n const generatorOpts = source.generatorOpts;\n const targetObj = (target.generatorOpts = target.generatorOpts || {});\n mergeDefaultFields(targetObj, generatorOpts);\n } else {\n const val = source[k];\n if (val !== undefined) target[k] = (val: any);\n }\n }\n}\n\nfunction mergeDefaultFields(target: T, source: T) {\n for (const k of Object.keys(source)) {\n const val = source[k];\n if (val !== undefined) target[k] = (val: any);\n }\n}\n\nexport function isIterableIterator(value: mixed): boolean %checks {\n return (\n /*:: value instanceof Generator && */\n // /*:: \"@@iterator\" in value && */\n !!value &&\n typeof value.next === \"function\" &&\n // $FlowIgnore\n typeof value[Symbol.iterator] === \"function\"\n );\n}\n","// @flow\n\nimport gensync, { type Handler } from \"gensync\";\nimport {\n maybeAsync,\n isAsync,\n onFirstPause,\n waitFor,\n isThenable,\n} from \"../gensync-utils/async\";\nimport { isIterableIterator } from \"./util\";\n\nexport type { CacheConfigurator };\n\nexport type SimpleCacheConfigurator = SimpleCacheConfiguratorFn &\n SimpleCacheConfiguratorObj;\n\ntype SimpleCacheConfiguratorFn = {\n (boolean): void,\n (handler: () => T): T,\n};\ntype SimpleCacheConfiguratorObj = {\n forever: () => void,\n never: () => void,\n using: (handler: () => T) => T,\n invalidate: (handler: () => T) => T,\n};\n\nexport type CacheEntry = Array<{\n value: ResultT,\n valid: SideChannel => Handler,\n}>;\n\nconst synchronize = (\n gen: (...ArgsT) => Handler,\n // $FlowIssue https://github.com/facebook/flow/issues/7279\n): ((...args: ArgsT) => ResultT) => {\n return gensync(gen).sync;\n};\n\n// eslint-disable-next-line require-yield, no-unused-vars\nfunction* genTrue(data: any) {\n return true;\n}\n\nexport function makeWeakCache(\n handler: (ArgT, CacheConfigurator) => Handler | ResultT,\n): (ArgT, SideChannel) => Handler {\n return makeCachedFunction(WeakMap, handler);\n}\n\nexport function makeWeakCacheSync(\n handler: (ArgT, CacheConfigurator) => ResultT,\n): (ArgT, SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeWeakCache(handler),\n );\n}\n\nexport function makeStrongCache(\n handler: (ArgT, CacheConfigurator) => Handler | ResultT,\n): (ArgT, SideChannel) => Handler {\n return makeCachedFunction(Map, handler);\n}\n\nexport function makeStrongCacheSync(\n handler: (ArgT, CacheConfigurator) => ResultT,\n): (ArgT, SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeStrongCache(handler),\n );\n}\n\n/* NOTE: Part of the logic explained in this comment is explained in the\n * getCachedValueOrWait and setupAsyncLocks functions.\n *\n * > There are only two hard things in Computer Science: cache invalidation and naming things.\n * > -- Phil Karlton\n *\n * I don't know if Phil was also thinking about handling a cache whose invalidation function is\n * defined asynchronously is considered, but it is REALLY hard to do correctly.\n *\n * The implemented logic (only when gensync is run asynchronously) is the following:\n * 1. If there is a valid cache associated to the current \"arg\" parameter,\n * a. RETURN the cached value\n * 3. If there is a FinishLock associated to the current \"arg\" parameter representing a valid cache,\n * a. Wait for that lock to be released\n * b. RETURN the value associated with that lock\n * 5. Start executing the function to be cached\n * a. If it pauses on a promise, then\n * i. Let FinishLock be a new lock\n * ii. Store FinishLock as associated to the current \"arg\" parameter\n * iii. Wait for the function to finish executing\n * iv. Release FinishLock\n * v. Send the function result to anyone waiting on FinishLock\n * 6. Store the result in the cache\n * 7. RETURN the result\n */\nfunction makeCachedFunction(\n CallCache: Class,\n handler: (ArgT, CacheConfigurator) => Handler | ResultT,\n): (ArgT, SideChannel) => Handler {\n const callCacheSync = new CallCache();\n const callCacheAsync = new CallCache();\n const futureCache = new CallCache();\n\n return function* cachedFunction(arg: ArgT, data: SideChannel) {\n const asyncContext = yield* isAsync();\n const callCache = asyncContext ? callCacheAsync : callCacheSync;\n\n const cached = yield* getCachedValueOrWait(\n asyncContext,\n callCache,\n futureCache,\n arg,\n data,\n );\n if (cached.valid) return cached.value;\n\n const cache = new CacheConfigurator(data);\n\n const handlerResult = handler(arg, cache);\n\n let finishLock: ?Lock;\n let value: ResultT;\n\n if (isIterableIterator(handlerResult)) {\n // Flow refines handlerResult to Generator\n const gen = (handlerResult: Generator<*, ResultT, *>);\n\n value = yield* onFirstPause(gen, () => {\n finishLock = setupAsyncLocks(cache, futureCache, arg);\n });\n } else {\n // $FlowIgnore doesn't refine handlerResult to ResultT\n value = (handlerResult: ResultT);\n }\n\n updateFunctionCache(callCache, cache, arg, value);\n\n if (finishLock) {\n futureCache.delete(arg);\n finishLock.release(value);\n }\n\n return value;\n };\n}\n\ntype CacheMap =\n | Map>\n | WeakMap>;\n\nfunction* getCachedValue<\n ArgT,\n ResultT,\n SideChannel,\n // $FlowIssue https://github.com/facebook/flow/issues/4528\n Cache: CacheMap,\n>(\n cache: Cache,\n arg: ArgT,\n data: SideChannel,\n): Handler<{ valid: true, value: ResultT } | { valid: false, value: null }> {\n const cachedValue: CacheEntry | void = cache.get(arg);\n\n if (cachedValue) {\n for (const { value, valid } of cachedValue) {\n if (yield* valid(data)) return { valid: true, value };\n }\n }\n\n return { valid: false, value: null };\n}\n\nfunction* getCachedValueOrWait(\n asyncContext: boolean,\n callCache: CacheMap,\n futureCache: CacheMap, SideChannel>,\n arg: ArgT,\n data: SideChannel,\n): Handler<{ valid: true, value: ResultT } | { valid: false, value: null }> {\n const cached = yield* getCachedValue(callCache, arg, data);\n if (cached.valid) {\n return cached;\n }\n\n if (asyncContext) {\n const cached = yield* getCachedValue(futureCache, arg, data);\n if (cached.valid) {\n const value = yield* waitFor(cached.value.promise);\n return { valid: true, value };\n }\n }\n\n return { valid: false, value: null };\n}\n\nfunction setupAsyncLocks(\n config: CacheConfigurator,\n futureCache: CacheMap, SideChannel>,\n arg: ArgT,\n): Lock {\n const finishLock = new Lock();\n\n updateFunctionCache(futureCache, config, arg, finishLock);\n\n return finishLock;\n}\n\nfunction updateFunctionCache<\n ArgT,\n ResultT,\n SideChannel,\n // $FlowIssue https://github.com/facebook/flow/issues/4528\n Cache: CacheMap,\n>(\n cache: Cache,\n config: CacheConfigurator,\n arg: ArgT,\n value: ResultT,\n) {\n if (!config.configured()) config.forever();\n\n let cachedValue: CacheEntry | void = cache.get(arg);\n\n config.deactivate();\n\n switch (config.mode()) {\n case \"forever\":\n cachedValue = [{ value, valid: genTrue }];\n cache.set(arg, cachedValue);\n break;\n case \"invalidate\":\n cachedValue = [{ value, valid: config.validator() }];\n cache.set(arg, cachedValue);\n break;\n case \"valid\":\n if (cachedValue) {\n cachedValue.push({ value, valid: config.validator() });\n } else {\n cachedValue = [{ value, valid: config.validator() }];\n cache.set(arg, cachedValue);\n }\n }\n}\n\nclass CacheConfigurator {\n _active: boolean = true;\n _never: boolean = false;\n _forever: boolean = false;\n _invalidate: boolean = false;\n\n _configured: boolean = false;\n\n _pairs: Array<[mixed, (SideChannel) => Handler]> = [];\n\n _data: SideChannel;\n\n constructor(data: SideChannel) {\n this._data = data;\n }\n\n simple() {\n return makeSimpleConfigurator(this);\n }\n\n mode() {\n if (this._never) return \"never\";\n if (this._forever) return \"forever\";\n if (this._invalidate) return \"invalidate\";\n return \"valid\";\n }\n\n forever() {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n if (this._never) {\n throw new Error(\"Caching has already been configured with .never()\");\n }\n this._forever = true;\n this._configured = true;\n }\n\n never() {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n if (this._forever) {\n throw new Error(\"Caching has already been configured with .forever()\");\n }\n this._never = true;\n this._configured = true;\n }\n\n using(handler: SideChannel => T): T {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n if (this._never || this._forever) {\n throw new Error(\n \"Caching has already been configured with .never or .forever()\",\n );\n }\n this._configured = true;\n\n const key = handler(this._data);\n\n const fn = maybeAsync(\n handler,\n `You appear to be using an async cache handler, but Babel has been called synchronously`,\n );\n\n if (isThenable(key)) {\n return key.then(key => {\n this._pairs.push([key, fn]);\n return key;\n });\n }\n\n this._pairs.push([key, fn]);\n return key;\n }\n\n invalidate(handler: SideChannel => T): T {\n this._invalidate = true;\n return this.using(handler);\n }\n\n validator(): SideChannel => Handler {\n const pairs = this._pairs;\n return function*(data: SideChannel) {\n for (const [key, fn] of pairs) {\n if (key !== (yield* fn(data))) return false;\n }\n return true;\n };\n }\n\n deactivate() {\n this._active = false;\n }\n\n configured() {\n return this._configured;\n }\n}\n\nfunction makeSimpleConfigurator(\n cache: CacheConfigurator,\n): SimpleCacheConfigurator {\n function cacheFn(val) {\n if (typeof val === \"boolean\") {\n if (val) cache.forever();\n else cache.never();\n return;\n }\n\n return cache.using(() => assertSimpleType(val()));\n }\n cacheFn.forever = () => cache.forever();\n cacheFn.never = () => cache.never();\n cacheFn.using = cb => cache.using(() => assertSimpleType(cb()));\n cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb()));\n\n return (cacheFn: any);\n}\n\n// Types are limited here so that in the future these values can be used\n// as part of Babel's caching logic.\ntype SimpleType = string | boolean | number | null | void | Promise;\nexport function assertSimpleType(value: mixed): SimpleType {\n if (isThenable(value)) {\n throw new Error(\n `You appear to be using an async cache handler, ` +\n `which your current version of Babel does not support. ` +\n `We may add support for this in the future, ` +\n `but if you're on the most recent version of @babel/core and still ` +\n `seeing this error, then you'll need to synchronously handle your caching logic.`,\n );\n }\n\n if (\n value != null &&\n typeof value !== \"string\" &&\n typeof value !== \"boolean\" &&\n typeof value !== \"number\"\n ) {\n throw new Error(\n \"Cache keys must be either string, boolean, number, null, or undefined.\",\n );\n }\n return value;\n}\n\nclass Lock {\n released: boolean = false;\n promise: Promise;\n _resolve: (value: T) => void;\n\n constructor() {\n this.promise = new Promise(resolve => {\n this._resolve = resolve;\n });\n }\n\n release(value: T) {\n this.released = true;\n this._resolve(value);\n }\n}\n","// @flow\n\nimport { loadPlugin, loadPreset } from \"./files\";\n\nimport { getItemDescriptor } from \"./item\";\n\nimport {\n makeWeakCacheSync,\n makeStrongCacheSync,\n type CacheConfigurator,\n} from \"./caching\";\n\nimport type {\n ValidatedOptions,\n PluginList,\n PluginItem,\n} from \"./validation/options\";\n\n// Represents a config object and functions to lazily load the descriptors\n// for the plugins and presets so we don't load the plugins/presets unless\n// the options object actually ends up being applicable.\nexport type OptionsAndDescriptors = {\n options: ValidatedOptions,\n plugins: () => Array,\n presets: () => Array,\n};\n\n// Represents a plugin or presets at a given location in a config object.\n// At this point these have been resolved to a specific object or function,\n// but have not yet been executed to call functions with options.\nexport type UnloadedDescriptor = {\n name: string | void,\n value: {} | Function,\n options: {} | void | false,\n dirname: string,\n alias: string,\n ownPass?: boolean,\n file?: {\n request: string,\n resolved: string,\n } | void,\n};\n\nfunction isEqualDescriptor(\n a: UnloadedDescriptor,\n b: UnloadedDescriptor,\n): boolean {\n return (\n a.name === b.name &&\n a.value === b.value &&\n a.options === b.options &&\n a.dirname === b.dirname &&\n a.alias === b.alias &&\n a.ownPass === b.ownPass &&\n (a.file && a.file.request) === (b.file && b.file.request) &&\n (a.file && a.file.resolved) === (b.file && b.file.resolved)\n );\n}\n\nexport type ValidatedFile = {\n filepath: string,\n dirname: string,\n options: ValidatedOptions,\n};\n\n/**\n * Create a set of descriptors from a given options object, preserving\n * descriptor identity based on the identity of the plugin/preset arrays\n * themselves, and potentially on the identity of the plugins/presets + options.\n */\nexport function createCachedDescriptors(\n dirname: string,\n options: ValidatedOptions,\n alias: string,\n): OptionsAndDescriptors {\n const { plugins, presets, passPerPreset } = options;\n return {\n options,\n plugins: plugins\n ? () => createCachedPluginDescriptors(plugins, dirname)(alias)\n : () => [],\n presets: presets\n ? () =>\n createCachedPresetDescriptors(presets, dirname)(alias)(\n !!passPerPreset,\n )\n : () => [],\n };\n}\n\n/**\n * Create a set of descriptors from a given options object, with consistent\n * identity for the descriptors, but not caching based on any specific identity.\n */\nexport function createUncachedDescriptors(\n dirname: string,\n options: ValidatedOptions,\n alias: string,\n): OptionsAndDescriptors {\n // The returned result here is cached to represent a config object in\n // memory, so we build and memoize the descriptors to ensure the same\n // values are returned consistently.\n let plugins;\n let presets;\n\n return {\n options,\n plugins: () => {\n if (!plugins) {\n plugins = createPluginDescriptors(\n options.plugins || [],\n dirname,\n alias,\n );\n }\n return plugins;\n },\n presets: () => {\n if (!presets) {\n presets = createPresetDescriptors(\n options.presets || [],\n dirname,\n alias,\n !!options.passPerPreset,\n );\n }\n return presets;\n },\n };\n}\n\nconst PRESET_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPresetDescriptors = makeWeakCacheSync(\n (items: PluginList, cache: CacheConfigurator) => {\n const dirname = cache.using(dir => dir);\n return makeStrongCacheSync((alias: string) =>\n makeStrongCacheSync((passPerPreset: boolean) =>\n createPresetDescriptors(items, dirname, alias, passPerPreset).map(\n // Items are cached using the overall preset array identity when\n // possibly, but individual descriptors are also cached if a match\n // can be found in the previously-used descriptor lists.\n desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc),\n ),\n ),\n );\n },\n);\n\nconst PLUGIN_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPluginDescriptors = makeWeakCacheSync(\n (items: PluginList, cache: CacheConfigurator) => {\n const dirname = cache.using(dir => dir);\n return makeStrongCacheSync((alias: string) =>\n createPluginDescriptors(items, dirname, alias).map(\n // Items are cached using the overall plugin array identity when\n // possibly, but individual descriptors are also cached if a match\n // can be found in the previously-used descriptor lists.\n desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc),\n ),\n );\n },\n);\n\n/**\n * When no options object is given in a descriptor, this object is used\n * as a WeakMap key in order to have consistent identity.\n */\nconst DEFAULT_OPTIONS = {};\n\n/**\n * Given the cache and a descriptor, returns a matching descriptor from the\n * cache, or else returns the input descriptor and adds it to the cache for\n * next time.\n */\nfunction loadCachedDescriptor(\n cache: WeakMap<{} | Function, WeakMap<{}, Array>>,\n desc: UnloadedDescriptor,\n) {\n const { value, options = DEFAULT_OPTIONS } = desc;\n if (options === false) return desc;\n\n let cacheByOptions = cache.get(value);\n if (!cacheByOptions) {\n cacheByOptions = new WeakMap();\n cache.set(value, cacheByOptions);\n }\n\n let possibilities = cacheByOptions.get(options);\n if (!possibilities) {\n possibilities = [];\n cacheByOptions.set(options, possibilities);\n }\n\n if (possibilities.indexOf(desc) === -1) {\n const matches = possibilities.filter(possibility =>\n isEqualDescriptor(possibility, desc),\n );\n if (matches.length > 0) {\n return matches[0];\n }\n\n possibilities.push(desc);\n }\n\n return desc;\n}\n\nfunction createPresetDescriptors(\n items: PluginList,\n dirname: string,\n alias: string,\n passPerPreset: boolean,\n): Array {\n return createDescriptors(\"preset\", items, dirname, alias, passPerPreset);\n}\n\nfunction createPluginDescriptors(\n items: PluginList,\n dirname: string,\n alias: string,\n): Array {\n return createDescriptors(\"plugin\", items, dirname, alias);\n}\n\nfunction createDescriptors(\n type: \"plugin\" | \"preset\",\n items: PluginList,\n dirname: string,\n alias: string,\n ownPass?: boolean,\n): Array {\n const descriptors = items.map((item, index) =>\n createDescriptor(item, dirname, {\n type,\n alias: `${alias}$${index}`,\n ownPass: !!ownPass,\n }),\n );\n\n assertNoDuplicates(descriptors);\n\n return descriptors;\n}\n\n/**\n * Given a plugin/preset item, resolve it into a standard format.\n */\nexport function createDescriptor(\n pair: PluginItem,\n dirname: string,\n {\n type,\n alias,\n ownPass,\n }: {\n type?: \"plugin\" | \"preset\",\n alias: string,\n ownPass?: boolean,\n },\n): UnloadedDescriptor {\n const desc = getItemDescriptor(pair);\n if (desc) {\n return desc;\n }\n\n let name;\n let options;\n let value = pair;\n if (Array.isArray(value)) {\n if (value.length === 3) {\n // $FlowIgnore - Flow doesn't like the multiple tuple types.\n [value, options, name] = value;\n } else {\n [value, options] = value;\n }\n }\n\n let file = undefined;\n let filepath = null;\n if (typeof value === \"string\") {\n if (typeof type !== \"string\") {\n throw new Error(\n \"To resolve a string-based item, the type of item must be given\",\n );\n }\n const resolver = type === \"plugin\" ? loadPlugin : loadPreset;\n const request = value;\n\n ({ filepath, value } = resolver(value, dirname));\n\n file = {\n request,\n resolved: filepath,\n };\n }\n\n if (!value) {\n throw new Error(`Unexpected falsy value: ${String(value)}`);\n }\n\n if (typeof value === \"object\" && value.__esModule) {\n if (value.default) {\n value = value.default;\n } else {\n throw new Error(\"Must export a default export when using ES6 modules.\");\n }\n }\n\n if (typeof value !== \"object\" && typeof value !== \"function\") {\n throw new Error(\n `Unsupported format: ${typeof value}. Expected an object or a function.`,\n );\n }\n\n if (filepath !== null && typeof value === \"object\" && value) {\n // We allow object values for plugins/presets nested directly within a\n // config object, because it can be useful to define them in nested\n // configuration contexts.\n throw new Error(\n `Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`,\n );\n }\n\n return {\n name,\n alias: filepath || alias,\n value,\n options,\n dirname,\n ownPass,\n file,\n };\n}\n\nfunction assertNoDuplicates(items: Array): void {\n const map = new Map();\n\n for (const item of items) {\n if (typeof item.value !== \"function\") continue;\n\n let nameMap = map.get(item.value);\n if (!nameMap) {\n nameMap = new Set();\n map.set(item.value, nameMap);\n }\n\n if (nameMap.has(item.name)) {\n const conflicts = items.filter(i => i.value === item.value);\n throw new Error(\n [\n `Duplicate plugin/preset detected.`,\n `If you'd like to use two separate instances of a plugin,`,\n `they need separate names, e.g.`,\n ``,\n ` plugins: [`,\n ` ['some-plugin', {}],`,\n ` ['some-plugin', {}, 'some unique name'],`,\n ` ]`,\n ``,\n `Duplicates detected are:`,\n `${JSON.stringify(conflicts, null, 2)}`,\n ].join(\"\\n\"),\n );\n }\n\n nameMap.add(item.name);\n }\n}\n","// @flow\n\nimport type { PluginTarget, PluginOptions } from \"./validation/options\";\n\nimport path from \"path\";\nimport {\n createDescriptor,\n type UnloadedDescriptor,\n} from \"./config-descriptors\";\n\nexport function createItemFromDescriptor(desc: UnloadedDescriptor): ConfigItem {\n return new ConfigItem(desc);\n}\n\n/**\n * Create a config item using the same value format used in Babel's config\n * files. Items returned from this function should be cached by the caller\n * ideally, as recreating the config item will mean re-resolving the item\n * and re-evaluating the plugin/preset function.\n */\nexport function createConfigItem(\n value:\n | PluginTarget\n | [PluginTarget, PluginOptions]\n | [PluginTarget, PluginOptions, string | void],\n {\n dirname = \".\",\n type,\n }: {\n dirname?: string,\n type?: \"preset\" | \"plugin\",\n } = {},\n): ConfigItem {\n const descriptor = createDescriptor(value, path.resolve(dirname), {\n type,\n alias: \"programmatic item\",\n });\n\n return createItemFromDescriptor(descriptor);\n}\n\nexport function getItemDescriptor(item: mixed): UnloadedDescriptor | void {\n if (item instanceof ConfigItem) {\n return item._descriptor;\n }\n\n return undefined;\n}\n\nexport type { ConfigItem };\n\n/**\n * A public representation of a plugin/preset that will _eventually_ be load.\n * Users can use this to interact with the results of a loaded Babel\n * configuration.\n *\n * Any changes to public properties of this class should be considered a\n * breaking change to Babel's API.\n */\nclass ConfigItem {\n /**\n * The private underlying descriptor that Babel actually cares about.\n * If you access this, you are a bad person.\n */\n _descriptor: UnloadedDescriptor;\n\n /**\n * The resolved value of the item itself.\n */\n value: {} | Function;\n\n /**\n * The options, if any, that were passed to the item.\n * Mutating this will lead to undefined behavior.\n *\n * \"false\" means that this item has been disabled.\n */\n options: {} | void | false;\n\n /**\n * The directory that the options for this item are relative to.\n */\n dirname: string;\n\n /**\n * Get the name of the plugin, if the user gave it one.\n */\n name: string | void;\n\n /**\n * Data about the file that the item was loaded from, if Babel knows it.\n */\n file: {\n // The requested path, e.g. \"@babel/env\".\n request: string,\n\n // The resolved absolute path of the file.\n resolved: string,\n } | void;\n\n constructor(descriptor: UnloadedDescriptor) {\n // Make people less likely to stumble onto this if they are exploring\n // programmatically, and also make sure that if people happen to\n // pass the item through JSON.stringify, it doesn't show up.\n this._descriptor = descriptor;\n Object.defineProperty(this, \"_descriptor\", ({ enumerable: false }: any));\n\n this.value = this._descriptor.value;\n this.options = this._descriptor.options;\n this.dirname = this._descriptor.dirname;\n this.name = this._descriptor.name;\n this.file = this._descriptor.file\n ? {\n request: this._descriptor.file.request,\n resolved: this._descriptor.file.resolved,\n }\n : undefined;\n\n // Freeze the object to make it clear that people shouldn't expect mutating\n // this object to do anything. A new item should be created if they want\n // to change something.\n Object.freeze(this);\n }\n}\n\nObject.freeze(ConfigItem.prototype);\n","// @flow\n\nimport type { PluginObject } from \"./validation/plugins\";\n\nexport default class Plugin {\n key: ?string;\n manipulateOptions: Function | void;\n post: Function | void;\n pre: Function | void;\n visitor: {};\n\n parserOverride: Function | void;\n generatorOverride: Function | void;\n\n options: {};\n\n constructor(plugin: PluginObject, options: {}, key?: string) {\n this.key = plugin.name || key;\n\n this.manipulateOptions = plugin.manipulateOptions;\n this.post = plugin.post;\n this.pre = plugin.pre;\n this.visitor = plugin.visitor || {};\n this.parserOverride = plugin.parserOverride;\n this.generatorOverride = plugin.generatorOverride;\n\n this.options = options;\n }\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* Active `debug` instances.\n\t*/\n\tcreateDebug.instances = [];\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.enabled = createDebug.enabled(namespace);\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = selectColor(namespace);\n\t\tdebug.destroy = destroy;\n\t\tdebug.extend = extend;\n\t\t// Debug.formatArgs = formatArgs;\n\t\t// debug.rawLog = rawLog;\n\n\t\t// env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\tcreateDebug.instances.push(debug);\n\n\t\treturn debug;\n\t}\n\n\tfunction destroy() {\n\t\tconst index = createDebug.instances.indexOf(this);\n\t\tif (index !== -1) {\n\t\t\tcreateDebug.instances.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < createDebug.instances.length; i++) {\n\t\t\tconst instance = createDebug.instances[i];\n\t\t\tinstance.enabled = createDebug.enabled(instance.namespace);\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\nfunction log(...args) {\n\t// This hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn typeof console === 'object' &&\n\t\tconsole.log &&\n\t\tconsole.log(...args);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","// @flow\n\nexport default {\n auxiliaryComment: {\n message: \"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`\",\n },\n blacklist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n breakConfig: {\n message: \"This is not a necessary option in Babel 6\",\n },\n experimental: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n externalHelpers: {\n message:\n \"Use the `external-helpers` plugin instead. \" +\n \"Check out http://babeljs.io/docs/plugins/external-helpers/\",\n },\n extra: {\n message: \"\",\n },\n jsxPragma: {\n message:\n \"use the `pragma` option in the `react-jsx` plugin. \" +\n \"Check out http://babeljs.io/docs/plugins/transform-react-jsx/\",\n },\n loose: {\n message:\n \"Specify the `loose` option for the relevant plugin you are using \" +\n \"or use a preset that sets the option.\",\n },\n metadataUsedHelpers: {\n message: \"Not required anymore as this is enabled by default\",\n },\n modules: {\n message:\n \"Use the corresponding module transform plugin in the `plugins` option. \" +\n \"Check out http://babeljs.io/docs/plugins/#modules\",\n },\n nonStandard: {\n message:\n \"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. \" +\n \"Also check out the react preset http://babeljs.io/docs/plugins/preset-react/\",\n },\n optional: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n sourceMapName: {\n message:\n \"The `sourceMapName` option has been removed because it makes more sense for the \" +\n \"tooling that calls Babel to assign `map.file` themselves.\",\n },\n stage: {\n message:\n \"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets\",\n },\n whitelist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n\n resolveModuleSource: {\n version: 6,\n message: \"Use `babel-plugin-module-resolver@3`'s 'resolvePath' options\",\n },\n\n metadata: {\n version: 6,\n message:\n \"Generated plugin metadata is always included in the output result\",\n },\n\n sourceMapTarget: {\n version: 6,\n message:\n \"The `sourceMapTarget` option has been removed because it makes more sense for the tooling \" +\n \"that calls Babel to assign `map.file` themselves.\",\n },\n};\n","// @flow\n\nimport type {\n ConfigFileSearch,\n BabelrcSearch,\n IgnoreList,\n IgnoreItem,\n PluginList,\n PluginItem,\n PluginTarget,\n ConfigApplicableTest,\n SourceMapsOption,\n SourceTypeOption,\n CompactOption,\n RootInputSourceMapOption,\n NestingPath,\n CallerMetadata,\n RootMode,\n} from \"./options\";\n\nexport type ValidatorSet = {\n [string]: Validator,\n};\n\nexport type Validator = (OptionPath, mixed) => T;\n\nexport function msg(loc: NestingPath | GeneralPath) {\n switch (loc.type) {\n case \"root\":\n return ``;\n case \"env\":\n return `${msg(loc.parent)}.env[\"${loc.name}\"]`;\n case \"overrides\":\n return `${msg(loc.parent)}.overrides[${loc.index}]`;\n case \"option\":\n return `${msg(loc.parent)}.${loc.name}`;\n case \"access\":\n return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`;\n default:\n throw new Error(`Assertion failure: Unknown type ${loc.type}`);\n }\n}\n\nexport function access(loc: GeneralPath, name: string | number): AccessPath {\n return {\n type: \"access\",\n name,\n parent: loc,\n };\n}\n\nexport type OptionPath = $ReadOnly<{\n type: \"option\",\n name: string,\n parent: NestingPath,\n}>;\ntype AccessPath = $ReadOnly<{\n type: \"access\",\n name: string | number,\n parent: GeneralPath,\n}>;\ntype GeneralPath = OptionPath | AccessPath;\n\nexport function assertRootMode(loc: OptionPath, value: mixed): RootMode | void {\n if (\n value !== undefined &&\n value !== \"root\" &&\n value !== \"upward\" &&\n value !== \"upward-optional\"\n ) {\n throw new Error(\n `${msg(loc)} must be a \"root\", \"upward\", \"upward-optional\" or undefined`,\n );\n }\n return value;\n}\n\nexport function assertSourceMaps(\n loc: OptionPath,\n value: mixed,\n): SourceMapsOption | void {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n value !== \"inline\" &&\n value !== \"both\"\n ) {\n throw new Error(\n `${msg(loc)} must be a boolean, \"inline\", \"both\", or undefined`,\n );\n }\n return value;\n}\n\nexport function assertCompact(\n loc: OptionPath,\n value: mixed,\n): CompactOption | void {\n if (value !== undefined && typeof value !== \"boolean\" && value !== \"auto\") {\n throw new Error(`${msg(loc)} must be a boolean, \"auto\", or undefined`);\n }\n return value;\n}\n\nexport function assertSourceType(\n loc: OptionPath,\n value: mixed,\n): SourceTypeOption | void {\n if (\n value !== undefined &&\n value !== \"module\" &&\n value !== \"script\" &&\n value !== \"unambiguous\"\n ) {\n throw new Error(\n `${msg(loc)} must be \"module\", \"script\", \"unambiguous\", or undefined`,\n );\n }\n return value;\n}\n\nexport function assertCallerMetadata(\n loc: OptionPath,\n value: mixed,\n): CallerMetadata | void {\n const obj = assertObject(loc, value);\n if (obj) {\n if (typeof obj[(\"name\": string)] !== \"string\") {\n throw new Error(\n `${msg(loc)} set but does not contain \"name\" property string`,\n );\n }\n\n for (const prop of Object.keys(obj)) {\n const propLoc = access(loc, prop);\n const value = obj[prop];\n if (\n value != null &&\n typeof value !== \"boolean\" &&\n typeof value !== \"string\" &&\n typeof value !== \"number\"\n ) {\n // NOTE(logan): I'm limiting the type here so that we can guarantee that\n // the \"caller\" value will serialize to JSON nicely. We can always\n // allow more complex structures later though.\n throw new Error(\n `${msg(\n propLoc,\n )} must be null, undefined, a boolean, a string, or a number.`,\n );\n }\n }\n }\n return (value: any);\n}\n\nexport function assertInputSourceMap(\n loc: OptionPath,\n value: mixed,\n): RootInputSourceMapOption | void {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n (typeof value !== \"object\" || !value)\n ) {\n throw new Error(`${msg(loc)} must be a boolean, object, or undefined`);\n }\n return value;\n}\n\nexport function assertString(loc: GeneralPath, value: mixed): string | void {\n if (value !== undefined && typeof value !== \"string\") {\n throw new Error(`${msg(loc)} must be a string, or undefined`);\n }\n return value;\n}\n\nexport function assertFunction(\n loc: GeneralPath,\n value: mixed,\n): Function | void {\n if (value !== undefined && typeof value !== \"function\") {\n throw new Error(`${msg(loc)} must be a function, or undefined`);\n }\n return value;\n}\n\nexport function assertBoolean(loc: GeneralPath, value: mixed): boolean | void {\n if (value !== undefined && typeof value !== \"boolean\") {\n throw new Error(`${msg(loc)} must be a boolean, or undefined`);\n }\n return value;\n}\n\nexport function assertObject(loc: GeneralPath, value: mixed): {} | void {\n if (\n value !== undefined &&\n (typeof value !== \"object\" || Array.isArray(value) || !value)\n ) {\n throw new Error(`${msg(loc)} must be an object, or undefined`);\n }\n return value;\n}\n\nexport function assertArray(\n loc: GeneralPath,\n value: mixed,\n): ?$ReadOnlyArray {\n if (value != null && !Array.isArray(value)) {\n throw new Error(`${msg(loc)} must be an array, or undefined`);\n }\n return value;\n}\n\nexport function assertIgnoreList(\n loc: OptionPath,\n value: mixed,\n): IgnoreList | void {\n const arr = assertArray(loc, value);\n if (arr) {\n arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));\n }\n return (arr: any);\n}\nfunction assertIgnoreItem(loc: GeneralPath, value: mixed): IgnoreItem {\n if (\n typeof value !== \"string\" &&\n typeof value !== \"function\" &&\n !(value instanceof RegExp)\n ) {\n throw new Error(\n `${msg(\n loc,\n )} must be an array of string/Function/RegExp values, or undefined`,\n );\n }\n return value;\n}\n\nexport function assertConfigApplicableTest(\n loc: OptionPath,\n value: mixed,\n): ConfigApplicableTest | void {\n if (value === undefined) return value;\n\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n if (!checkValidTest(item)) {\n throw new Error(\n `${msg(access(loc, i))} must be a string/Function/RegExp.`,\n );\n }\n });\n } else if (!checkValidTest(value)) {\n throw new Error(\n `${msg(loc)} must be a string/Function/RegExp, or an array of those`,\n );\n }\n return (value: any);\n}\n\nfunction checkValidTest(value: mixed): boolean {\n return (\n typeof value === \"string\" ||\n typeof value === \"function\" ||\n value instanceof RegExp\n );\n}\n\nexport function assertConfigFileSearch(\n loc: OptionPath,\n value: mixed,\n): ConfigFileSearch | void {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n typeof value !== \"string\"\n ) {\n throw new Error(\n `${msg(loc)} must be a undefined, a boolean, a string, ` +\n `got ${JSON.stringify((value: any))}`,\n );\n }\n\n return value;\n}\n\nexport function assertBabelrcSearch(\n loc: OptionPath,\n value: mixed,\n): BabelrcSearch | void {\n if (value === undefined || typeof value === \"boolean\") return value;\n\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n if (!checkValidTest(item)) {\n throw new Error(\n `${msg(access(loc, i))} must be a string/Function/RegExp.`,\n );\n }\n });\n } else if (!checkValidTest(value)) {\n throw new Error(\n `${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` +\n `or an array of those, got ${JSON.stringify((value: any))}`,\n );\n }\n return (value: any);\n}\n\nexport function assertPluginList(\n loc: OptionPath,\n value: mixed,\n): PluginList | void {\n const arr = assertArray(loc, value);\n if (arr) {\n // Loop instead of using `.map` in order to preserve object identity\n // for plugin array for use during config chain processing.\n arr.forEach((item, i) => assertPluginItem(access(loc, i), item));\n }\n return (arr: any);\n}\nfunction assertPluginItem(loc: GeneralPath, value: mixed): PluginItem {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n throw new Error(`${msg(loc)} must include an object`);\n }\n\n if (value.length > 3) {\n throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`);\n }\n\n assertPluginTarget(access(loc, 0), value[0]);\n\n if (value.length > 1) {\n const opts = value[1];\n if (\n opts !== undefined &&\n opts !== false &&\n (typeof opts !== \"object\" || Array.isArray(opts) || opts === null)\n ) {\n throw new Error(\n `${msg(access(loc, 1))} must be an object, false, or undefined`,\n );\n }\n }\n if (value.length === 3) {\n const name = value[2];\n if (name !== undefined && typeof name !== \"string\") {\n throw new Error(\n `${msg(access(loc, 2))} must be a string, or undefined`,\n );\n }\n }\n } else {\n assertPluginTarget(loc, value);\n }\n\n return (value: any);\n}\nfunction assertPluginTarget(loc: GeneralPath, value: mixed): PluginTarget {\n if (\n (typeof value !== \"object\" || !value) &&\n typeof value !== \"string\" &&\n typeof value !== \"function\"\n ) {\n throw new Error(`${msg(loc)} must be a string, object, function`);\n }\n return value;\n}\n","// @flow\n\nimport type { ConfigItem } from \"../item\";\nimport Plugin from \"../plugin\";\n\nimport removed from \"./removed\";\nimport {\n msg,\n access,\n assertString,\n assertBoolean,\n assertObject,\n assertArray,\n assertCallerMetadata,\n assertInputSourceMap,\n assertIgnoreList,\n assertPluginList,\n assertConfigApplicableTest,\n assertConfigFileSearch,\n assertBabelrcSearch,\n assertFunction,\n assertRootMode,\n assertSourceMaps,\n assertCompact,\n assertSourceType,\n type ValidatorSet,\n type Validator,\n type OptionPath,\n} from \"./option-assertions\";\n\nconst ROOT_VALIDATORS: ValidatorSet = {\n cwd: (assertString: Validator<$PropertyType>),\n root: (assertString: Validator<$PropertyType>),\n rootMode: (assertRootMode: Validator<\n $PropertyType,\n >),\n configFile: (assertConfigFileSearch: Validator<\n $PropertyType,\n >),\n\n caller: (assertCallerMetadata: Validator<\n $PropertyType,\n >),\n filename: (assertString: Validator<\n $PropertyType,\n >),\n filenameRelative: (assertString: Validator<\n $PropertyType,\n >),\n code: (assertBoolean: Validator<$PropertyType>),\n ast: (assertBoolean: Validator<$PropertyType>),\n\n envName: (assertString: Validator<\n $PropertyType,\n >),\n};\n\nconst BABELRC_VALIDATORS: ValidatorSet = {\n babelrc: (assertBoolean: Validator<\n $PropertyType,\n >),\n babelrcRoots: (assertBabelrcSearch: Validator<\n $PropertyType,\n >),\n};\n\nconst NONPRESET_VALIDATORS: ValidatorSet = {\n extends: (assertString: Validator<\n $PropertyType,\n >),\n ignore: (assertIgnoreList: Validator<\n $PropertyType,\n >),\n only: (assertIgnoreList: Validator<$PropertyType>),\n};\n\nconst COMMON_VALIDATORS: ValidatorSet = {\n // TODO: Should 'inputSourceMap' be moved to be a root-only option?\n // We may want a boolean-only version to be a common option, with the\n // object only allowed as a root config argument.\n inputSourceMap: (assertInputSourceMap: Validator<\n $PropertyType,\n >),\n presets: (assertPluginList: Validator<\n $PropertyType,\n >),\n plugins: (assertPluginList: Validator<\n $PropertyType,\n >),\n passPerPreset: (assertBoolean: Validator<\n $PropertyType,\n >),\n\n env: (assertEnvSet: Validator<$PropertyType>),\n overrides: (assertOverridesList: Validator<\n $PropertyType,\n >),\n\n // We could limit these to 'overrides' blocks, but it's not clear why we'd\n // bother, when the ability to limit a config to a specific set of files\n // is a fairly general useful feature.\n test: (assertConfigApplicableTest: Validator<\n $PropertyType,\n >),\n include: (assertConfigApplicableTest: Validator<\n $PropertyType,\n >),\n exclude: (assertConfigApplicableTest: Validator<\n $PropertyType,\n >),\n\n retainLines: (assertBoolean: Validator<\n $PropertyType,\n >),\n comments: (assertBoolean: Validator<\n $PropertyType,\n >),\n shouldPrintComment: (assertFunction: Validator<\n $PropertyType,\n >),\n compact: (assertCompact: Validator<\n $PropertyType,\n >),\n minified: (assertBoolean: Validator<\n $PropertyType,\n >),\n auxiliaryCommentBefore: (assertString: Validator<\n $PropertyType,\n >),\n auxiliaryCommentAfter: (assertString: Validator<\n $PropertyType,\n >),\n sourceType: (assertSourceType: Validator<\n $PropertyType,\n >),\n wrapPluginVisitorMethod: (assertFunction: Validator<\n $PropertyType,\n >),\n highlightCode: (assertBoolean: Validator<\n $PropertyType,\n >),\n sourceMaps: (assertSourceMaps: Validator<\n $PropertyType,\n >),\n sourceMap: (assertSourceMaps: Validator<\n $PropertyType,\n >),\n sourceFileName: (assertString: Validator<\n $PropertyType,\n >),\n sourceRoot: (assertString: Validator<\n $PropertyType,\n >),\n getModuleId: (assertFunction: Validator<\n $PropertyType,\n >),\n moduleRoot: (assertString: Validator<\n $PropertyType,\n >),\n moduleIds: (assertBoolean: Validator<\n $PropertyType,\n >),\n moduleId: (assertString: Validator<\n $PropertyType,\n >),\n parserOpts: (assertObject: Validator<\n $PropertyType,\n >),\n generatorOpts: (assertObject: Validator<\n $PropertyType,\n >),\n};\nexport type InputOptions = ValidatedOptions;\n\nexport type ValidatedOptions = {\n cwd?: string,\n filename?: string,\n filenameRelative?: string,\n babelrc?: boolean,\n babelrcRoots?: BabelrcSearch,\n configFile?: ConfigFileSearch,\n root?: string,\n rootMode?: RootMode,\n code?: boolean,\n ast?: boolean,\n inputSourceMap?: RootInputSourceMapOption,\n envName?: string,\n caller?: CallerMetadata,\n\n extends?: string,\n env?: EnvSet,\n ignore?: IgnoreList,\n only?: IgnoreList,\n overrides?: OverridesList,\n\n // Generally verify if a given config object should be applied to the given file.\n test?: ConfigApplicableTest,\n include?: ConfigApplicableTest,\n exclude?: ConfigApplicableTest,\n\n presets?: PluginList,\n plugins?: PluginList,\n passPerPreset?: boolean,\n\n // Options for @babel/generator\n retainLines?: boolean,\n comments?: boolean,\n shouldPrintComment?: Function,\n compact?: CompactOption,\n minified?: boolean,\n auxiliaryCommentBefore?: string,\n auxiliaryCommentAfter?: string,\n\n // Parser\n sourceType?: SourceTypeOption,\n\n wrapPluginVisitorMethod?: Function,\n highlightCode?: boolean,\n\n // Sourcemap generation options.\n sourceMaps?: SourceMapsOption,\n sourceMap?: SourceMapsOption,\n sourceFileName?: string,\n sourceRoot?: string,\n\n // AMD/UMD/SystemJS module naming options.\n getModuleId?: Function,\n moduleRoot?: string,\n moduleIds?: boolean,\n moduleId?: string,\n\n // Deprecate top level parserOpts\n parserOpts?: {},\n // Deprecate top level generatorOpts\n generatorOpts?: {},\n};\n\nexport type CallerMetadata = {\n // If 'caller' is specified, require that the name is given for debugging\n // messages.\n name: string,\n};\nexport type EnvSet = {\n [string]: ?T,\n};\nexport type IgnoreItem = string | Function | RegExp;\nexport type IgnoreList = $ReadOnlyArray;\n\nexport type PluginOptions = {} | void | false;\nexport type PluginTarget = string | {} | Function;\nexport type PluginItem =\n | ConfigItem\n | Plugin\n | PluginTarget\n | [PluginTarget, PluginOptions]\n | [PluginTarget, PluginOptions, string | void];\nexport type PluginList = $ReadOnlyArray;\n\nexport type OverridesList = Array;\nexport type ConfigApplicableTest = IgnoreItem | Array;\n\nexport type ConfigFileSearch = string | boolean;\nexport type BabelrcSearch = boolean | IgnoreItem | IgnoreList;\nexport type SourceMapsOption = boolean | \"inline\" | \"both\";\nexport type SourceTypeOption = \"module\" | \"script\" | \"unambiguous\";\nexport type CompactOption = boolean | \"auto\";\nexport type RootInputSourceMapOption = {} | boolean;\nexport type RootMode = \"root\" | \"upward\" | \"upward-optional\";\n\nexport type OptionsSource =\n | \"arguments\"\n | \"configfile\"\n | \"babelrcfile\"\n | \"extendsfile\"\n | \"preset\"\n | \"plugin\";\n\ntype RootPath = $ReadOnly<{\n type: \"root\",\n source: OptionsSource,\n}>;\ntype OverridesPath = $ReadOnly<{\n type: \"overrides\",\n index: number,\n parent: RootPath,\n}>;\ntype EnvPath = $ReadOnly<{\n type: \"env\",\n name: string,\n parent: RootPath | OverridesPath,\n}>;\nexport type NestingPath = RootPath | OverridesPath | EnvPath;\n\nfunction getSource(loc: NestingPath): OptionsSource {\n return loc.type === \"root\" ? loc.source : getSource(loc.parent);\n}\n\nexport function validate(type: OptionsSource, opts: {}): ValidatedOptions {\n return validateNested(\n {\n type: \"root\",\n source: type,\n },\n opts,\n );\n}\n\nfunction validateNested(loc: NestingPath, opts: {}) {\n const type = getSource(loc);\n\n assertNoDuplicateSourcemap(opts);\n\n Object.keys(opts).forEach(key => {\n const optLoc = {\n type: \"option\",\n name: key,\n parent: loc,\n };\n\n if (type === \"preset\" && NONPRESET_VALIDATORS[key]) {\n throw new Error(`${msg(optLoc)} is not allowed in preset options`);\n }\n if (type !== \"arguments\" && ROOT_VALIDATORS[key]) {\n throw new Error(\n `${msg(optLoc)} is only allowed in root programmatic options`,\n );\n }\n if (\n type !== \"arguments\" &&\n type !== \"configfile\" &&\n BABELRC_VALIDATORS[key]\n ) {\n if (type === \"babelrcfile\" || type === \"extendsfile\") {\n throw new Error(\n `${msg(\n optLoc,\n )} is not allowed in .babelrc or \"extends\"ed files, only in root programmatic options, ` +\n `or babel.config.js/config file options`,\n );\n }\n\n throw new Error(\n `${msg(\n optLoc,\n )} is only allowed in root programmatic options, or babel.config.js/config file options`,\n );\n }\n\n const validator =\n COMMON_VALIDATORS[key] ||\n NONPRESET_VALIDATORS[key] ||\n BABELRC_VALIDATORS[key] ||\n ROOT_VALIDATORS[key] ||\n (throwUnknownError: Validator);\n\n validator(optLoc, opts[key]);\n });\n\n return (opts: any);\n}\n\nfunction throwUnknownError(loc: OptionPath) {\n const key = loc.name;\n\n if (removed[key]) {\n const { message, version = 5 } = removed[key];\n\n throw new ReferenceError(\n `Using removed Babel ${version} option: ${msg(loc)} - ${message}`,\n );\n } else {\n // eslint-disable-next-line max-len\n const unknownOptErr = `Unknown option: ${msg(\n loc,\n )}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`;\n\n throw new ReferenceError(unknownOptErr);\n }\n}\n\nfunction has(obj: {}, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nfunction assertNoDuplicateSourcemap(opts: {}): void {\n if (has(opts, \"sourceMap\") && has(opts, \"sourceMaps\")) {\n throw new Error(\".sourceMap is an alias for .sourceMaps, cannot use both\");\n }\n}\n\nfunction assertEnvSet(loc: OptionPath, value: mixed): EnvSet {\n if (loc.parent.type === \"env\") {\n throw new Error(`${msg(loc)} is not allowed inside of another .env block`);\n }\n const parent: RootPath | OverridesPath = loc.parent;\n\n const obj = assertObject(loc, value);\n if (obj) {\n // Validate but don't copy the .env object in order to preserve\n // object identity for use during config chain processing.\n for (const envName of Object.keys(obj)) {\n const env = assertObject(access(loc, envName), obj[envName]);\n if (!env) continue;\n\n const envLoc = {\n type: \"env\",\n name: envName,\n parent,\n };\n validateNested(envLoc, env);\n }\n }\n return (obj: any);\n}\n\nfunction assertOverridesList(loc: OptionPath, value: mixed): OverridesList {\n if (loc.parent.type === \"env\") {\n throw new Error(`${msg(loc)} is not allowed inside an .env block`);\n }\n if (loc.parent.type === \"overrides\") {\n throw new Error(`${msg(loc)} is not allowed inside an .overrides block`);\n }\n const parent: RootPath = loc.parent;\n\n const arr = assertArray(loc, value);\n if (arr) {\n for (const [index, item] of arr.entries()) {\n const objLoc = access(loc, index);\n const env = assertObject(objLoc, item);\n if (!env) throw new Error(`${msg(objLoc)} must be an object`);\n\n const overridesLoc = {\n type: \"overrides\",\n index,\n parent,\n };\n validateNested(overridesLoc, env);\n }\n }\n return (arr: any);\n}\n","var toString = require('./toString');\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 reHasRegExpChar = RegExp(reRegExpChar.source);\n\n/**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\nfunction escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n}\n\nmodule.exports = escapeRegExp;\n","// @flow\nimport path from \"path\";\nimport escapeRegExp from \"lodash/escapeRegExp\";\n\nconst sep = `\\\\${path.sep}`;\nconst endSep = `(?:${sep}|$)`;\n\nconst substitution = `[^${sep}]+`;\n\nconst starPat = `(?:${substitution}${sep})`;\nconst starPatLast = `(?:${substitution}${endSep})`;\n\nconst starStarPat = `${starPat}*?`;\nconst starStarPatLast = `${starPat}*?${starPatLast}?`;\n\n/**\n * Implement basic pattern matching that will allow users to do the simple\n * tests with * and **. If users want full complex pattern matching, then can\n * always use regex matching, or function validation.\n */\nexport default function pathToPattern(\n pattern: string,\n dirname: string,\n): RegExp {\n const parts = path.resolve(dirname, pattern).split(path.sep);\n\n return new RegExp(\n [\n \"^\",\n ...parts.map((part, i) => {\n const last = i === parts.length - 1;\n\n // ** matches 0 or more path parts.\n if (part === \"**\") return last ? starStarPatLast : starStarPat;\n\n // * matches 1 path part.\n if (part === \"*\") return last ? starPatLast : starPat;\n\n // *.ext matches a wildcard with an extension.\n if (part.indexOf(\"*.\") === 0) {\n return (\n substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep)\n );\n }\n\n // Otherwise match the pattern text.\n return escapeRegExp(part) + (last ? endSep : sep);\n }),\n ].join(\"\"),\n );\n}\n","// @flow\n\nimport path from \"path\";\nimport buildDebug from \"debug\";\nimport type { Handler } from \"gensync\";\nimport {\n validate,\n type ValidatedOptions,\n type IgnoreList,\n type ConfigApplicableTest,\n type BabelrcSearch,\n type CallerMetadata,\n} from \"./validation/options\";\nimport pathPatternToRegex from \"./pattern-to-regex\";\n\nconst debug = buildDebug(\"babel:config:config-chain\");\n\nimport {\n findPackageData,\n findRelativeConfig,\n findRootConfig,\n loadConfig,\n type ConfigFile,\n type IgnoreFile,\n type FilePackageData,\n} from \"./files\";\n\nimport { makeWeakCacheSync, makeStrongCacheSync } from \"./caching\";\n\nimport {\n createCachedDescriptors,\n createUncachedDescriptors,\n type UnloadedDescriptor,\n type OptionsAndDescriptors,\n type ValidatedFile,\n} from \"./config-descriptors\";\n\nexport type ConfigChain = {\n plugins: Array,\n presets: Array,\n options: Array,\n};\n\nexport type PresetInstance = {\n options: ValidatedOptions,\n alias: string,\n dirname: string,\n};\n\nexport type ConfigContext = {\n filename: string | void,\n cwd: string,\n root: string,\n envName: string,\n caller: CallerMetadata | void,\n};\n\n/**\n * Build a config chain for a given preset.\n */\nexport function* buildPresetChain(\n arg: PresetInstance,\n context: *,\n): Handler {\n const chain = yield* buildPresetChainWalker(arg, context);\n if (!chain) return null;\n\n return {\n plugins: dedupDescriptors(chain.plugins),\n presets: dedupDescriptors(chain.presets),\n options: chain.options.map(o => normalizeOptions(o)),\n };\n}\n\nexport const buildPresetChainWalker: (\n arg: PresetInstance,\n context: *,\n) => * = makeChainWalker({\n init: arg => arg,\n root: preset => loadPresetDescriptors(preset),\n env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),\n overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),\n overridesEnv: (preset, index, envName) =>\n loadPresetOverridesEnvDescriptors(preset)(index)(envName),\n});\nconst loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) =>\n buildRootDescriptors(preset, preset.alias, createUncachedDescriptors),\n);\nconst loadPresetEnvDescriptors = makeWeakCacheSync((preset: PresetInstance) =>\n makeStrongCacheSync((envName: string) =>\n buildEnvDescriptors(\n preset,\n preset.alias,\n createUncachedDescriptors,\n envName,\n ),\n ),\n);\nconst loadPresetOverridesDescriptors = makeWeakCacheSync(\n (preset: PresetInstance) =>\n makeStrongCacheSync((index: number) =>\n buildOverrideDescriptors(\n preset,\n preset.alias,\n createUncachedDescriptors,\n index,\n ),\n ),\n);\nconst loadPresetOverridesEnvDescriptors = makeWeakCacheSync(\n (preset: PresetInstance) =>\n makeStrongCacheSync((index: number) =>\n makeStrongCacheSync((envName: string) =>\n buildOverrideEnvDescriptors(\n preset,\n preset.alias,\n createUncachedDescriptors,\n index,\n envName,\n ),\n ),\n ),\n);\n\nexport type RootConfigChain = ConfigChain & {\n babelrc: ConfigFile | void,\n config: ConfigFile | void,\n ignore: IgnoreFile | void,\n};\n\n/**\n * Build a config chain for Babel's full root configuration.\n */\nexport function* buildRootChain(\n opts: ValidatedOptions,\n context: ConfigContext,\n): Handler {\n const programmaticChain = yield* loadProgrammaticChain(\n {\n options: opts,\n dirname: context.cwd,\n },\n context,\n );\n if (!programmaticChain) return null;\n\n let configFile;\n if (typeof opts.configFile === \"string\") {\n configFile = yield* loadConfig(\n opts.configFile,\n context.cwd,\n context.envName,\n context.caller,\n );\n } else if (opts.configFile !== false) {\n configFile = yield* findRootConfig(\n context.root,\n context.envName,\n context.caller,\n );\n }\n\n let { babelrc, babelrcRoots } = opts;\n let babelrcRootsDirectory = context.cwd;\n\n const configFileChain = emptyChain();\n if (configFile) {\n const validatedFile = validateConfigFile(configFile);\n const result = yield* loadFileChain(validatedFile, context);\n if (!result) return null;\n\n // Allow config files to toggle `.babelrc` resolution on and off and\n // specify where the roots are.\n if (babelrc === undefined) {\n babelrc = validatedFile.options.babelrc;\n }\n if (babelrcRoots === undefined) {\n babelrcRootsDirectory = validatedFile.dirname;\n babelrcRoots = validatedFile.options.babelrcRoots;\n }\n\n mergeChain(configFileChain, result);\n }\n\n const pkgData =\n typeof context.filename === \"string\"\n ? yield* findPackageData(context.filename)\n : null;\n\n let ignoreFile, babelrcFile;\n const fileChain = emptyChain();\n // resolve all .babelrc files\n if (\n (babelrc === true || babelrc === undefined) &&\n pkgData &&\n babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)\n ) {\n ({ ignore: ignoreFile, config: babelrcFile } = yield* findRelativeConfig(\n pkgData,\n context.envName,\n context.caller,\n ));\n\n if (\n ignoreFile &&\n shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)\n ) {\n return null;\n }\n\n if (babelrcFile) {\n const result = yield* loadFileChain(\n validateBabelrcFile(babelrcFile),\n context,\n );\n if (!result) return null;\n\n mergeChain(fileChain, result);\n }\n }\n\n // Insert file chain in front so programmatic options have priority\n // over configuration file chain items.\n const chain = mergeChain(\n mergeChain(mergeChain(emptyChain(), configFileChain), fileChain),\n programmaticChain,\n );\n\n return {\n plugins: dedupDescriptors(chain.plugins),\n presets: dedupDescriptors(chain.presets),\n options: chain.options.map(o => normalizeOptions(o)),\n ignore: ignoreFile || undefined,\n babelrc: babelrcFile || undefined,\n config: configFile || undefined,\n };\n}\n\nfunction babelrcLoadEnabled(\n context: ConfigContext,\n pkgData: FilePackageData,\n babelrcRoots: BabelrcSearch | void,\n babelrcRootsDirectory: string,\n): boolean {\n if (typeof babelrcRoots === \"boolean\") return babelrcRoots;\n\n const absoluteRoot = context.root;\n\n // Fast path to avoid having to match patterns if the babelrc is just\n // loading in the standard root directory.\n if (babelrcRoots === undefined) {\n return pkgData.directories.indexOf(absoluteRoot) !== -1;\n }\n\n let babelrcPatterns = babelrcRoots;\n if (!Array.isArray(babelrcPatterns)) babelrcPatterns = [babelrcPatterns];\n babelrcPatterns = babelrcPatterns.map(pat => {\n return typeof pat === \"string\"\n ? path.resolve(babelrcRootsDirectory, pat)\n : pat;\n });\n\n // Fast path to avoid having to match patterns if the babelrc is just\n // loading in the standard root directory.\n if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {\n return pkgData.directories.indexOf(absoluteRoot) !== -1;\n }\n\n return babelrcPatterns.some(pat => {\n if (typeof pat === \"string\") {\n pat = pathPatternToRegex(pat, babelrcRootsDirectory);\n }\n\n return pkgData.directories.some(directory => {\n return matchPattern(pat, babelrcRootsDirectory, directory, context);\n });\n });\n}\n\nconst validateConfigFile = makeWeakCacheSync(\n (file: ConfigFile): ValidatedFile => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: validate(\"configfile\", file.options),\n }),\n);\n\nconst validateBabelrcFile = makeWeakCacheSync(\n (file: ConfigFile): ValidatedFile => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: validate(\"babelrcfile\", file.options),\n }),\n);\n\nconst validateExtendFile = makeWeakCacheSync(\n (file: ConfigFile): ValidatedFile => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: validate(\"extendsfile\", file.options),\n }),\n);\n\n/**\n * Build a config chain for just the programmatic options passed into Babel.\n */\nconst loadProgrammaticChain = makeChainWalker({\n root: input => buildRootDescriptors(input, \"base\", createCachedDescriptors),\n env: (input, envName) =>\n buildEnvDescriptors(input, \"base\", createCachedDescriptors, envName),\n overrides: (input, index) =>\n buildOverrideDescriptors(input, \"base\", createCachedDescriptors, index),\n overridesEnv: (input, index, envName) =>\n buildOverrideEnvDescriptors(\n input,\n \"base\",\n createCachedDescriptors,\n index,\n envName,\n ),\n});\n\n/**\n * Build a config chain for a given file.\n */\nconst loadFileChain = makeChainWalker({\n root: file => loadFileDescriptors(file),\n env: (file, envName) => loadFileEnvDescriptors(file)(envName),\n overrides: (file, index) => loadFileOverridesDescriptors(file)(index),\n overridesEnv: (file, index, envName) =>\n loadFileOverridesEnvDescriptors(file)(index)(envName),\n});\nconst loadFileDescriptors = makeWeakCacheSync((file: ValidatedFile) =>\n buildRootDescriptors(file, file.filepath, createUncachedDescriptors),\n);\nconst loadFileEnvDescriptors = makeWeakCacheSync((file: ValidatedFile) =>\n makeStrongCacheSync((envName: string) =>\n buildEnvDescriptors(\n file,\n file.filepath,\n createUncachedDescriptors,\n envName,\n ),\n ),\n);\nconst loadFileOverridesDescriptors = makeWeakCacheSync((file: ValidatedFile) =>\n makeStrongCacheSync((index: number) =>\n buildOverrideDescriptors(\n file,\n file.filepath,\n createUncachedDescriptors,\n index,\n ),\n ),\n);\nconst loadFileOverridesEnvDescriptors = makeWeakCacheSync(\n (file: ValidatedFile) =>\n makeStrongCacheSync((index: number) =>\n makeStrongCacheSync((envName: string) =>\n buildOverrideEnvDescriptors(\n file,\n file.filepath,\n createUncachedDescriptors,\n index,\n envName,\n ),\n ),\n ),\n);\n\nfunction buildRootDescriptors({ dirname, options }, alias, descriptors) {\n return descriptors(dirname, options, alias);\n}\n\nfunction buildEnvDescriptors(\n { dirname, options },\n alias,\n descriptors,\n envName,\n) {\n const opts = options.env && options.env[envName];\n return opts ? descriptors(dirname, opts, `${alias}.env[\"${envName}\"]`) : null;\n}\n\nfunction buildOverrideDescriptors(\n { dirname, options },\n alias,\n descriptors,\n index,\n) {\n const opts = options.overrides && options.overrides[index];\n if (!opts) throw new Error(\"Assertion failure - missing override\");\n\n return descriptors(dirname, opts, `${alias}.overrides[${index}]`);\n}\n\nfunction buildOverrideEnvDescriptors(\n { dirname, options },\n alias,\n descriptors,\n index,\n envName,\n) {\n const override = options.overrides && options.overrides[index];\n if (!override) throw new Error(\"Assertion failure - missing override\");\n\n const opts = override.env && override.env[envName];\n return opts\n ? descriptors(\n dirname,\n opts,\n `${alias}.overrides[${index}].env[\"${envName}\"]`,\n )\n : null;\n}\n\nfunction makeChainWalker({\n root,\n env,\n overrides,\n overridesEnv,\n}: {\n root: ArgT => OptionsAndDescriptors,\n env: (ArgT, string) => OptionsAndDescriptors | null,\n overrides: (ArgT, number) => OptionsAndDescriptors,\n overridesEnv: (ArgT, number, string) => OptionsAndDescriptors | null,\n}): (\n ArgT,\n ConfigContext,\n Set | void,\n) => Handler {\n return function*(input, context, files = new Set()) {\n const { dirname } = input;\n\n const flattenedConfigs = [];\n\n const rootOpts = root(input);\n if (configIsApplicable(rootOpts, dirname, context)) {\n flattenedConfigs.push(rootOpts);\n\n const envOpts = env(input, context.envName);\n if (envOpts && configIsApplicable(envOpts, dirname, context)) {\n flattenedConfigs.push(envOpts);\n }\n\n (rootOpts.options.overrides || []).forEach((_, index) => {\n const overrideOps = overrides(input, index);\n if (configIsApplicable(overrideOps, dirname, context)) {\n flattenedConfigs.push(overrideOps);\n\n const overrideEnvOpts = overridesEnv(input, index, context.envName);\n if (\n overrideEnvOpts &&\n configIsApplicable(overrideEnvOpts, dirname, context)\n ) {\n flattenedConfigs.push(overrideEnvOpts);\n }\n }\n });\n }\n\n // Process 'ignore' and 'only' before 'extends' items are processed so\n // that we don't do extra work loading extended configs if a file is\n // ignored.\n if (\n flattenedConfigs.some(({ options: { ignore, only } }) =>\n shouldIgnore(context, ignore, only, dirname),\n )\n ) {\n return null;\n }\n\n const chain = emptyChain();\n\n for (const op of flattenedConfigs) {\n if (\n !(yield* mergeExtendsChain(chain, op.options, dirname, context, files))\n ) {\n return null;\n }\n\n mergeChainOpts(chain, op);\n }\n return chain;\n };\n}\n\nfunction* mergeExtendsChain(\n chain: ConfigChain,\n opts: ValidatedOptions,\n dirname: string,\n context: ConfigContext,\n files: Set,\n): Handler {\n if (opts.extends === undefined) return true;\n\n const file = yield* loadConfig(\n opts.extends,\n dirname,\n context.envName,\n context.caller,\n );\n\n if (files.has(file)) {\n throw new Error(\n `Configuration cycle detected loading ${file.filepath}.\\n` +\n `File already loaded following the config chain:\\n` +\n Array.from(files, file => ` - ${file.filepath}`).join(\"\\n\"),\n );\n }\n\n files.add(file);\n const fileChain = yield* loadFileChain(\n validateExtendFile(file),\n context,\n files,\n );\n files.delete(file);\n\n if (!fileChain) return false;\n\n mergeChain(chain, fileChain);\n\n return true;\n}\n\nfunction mergeChain(target: ConfigChain, source: ConfigChain): ConfigChain {\n target.options.push(...source.options);\n target.plugins.push(...source.plugins);\n target.presets.push(...source.presets);\n\n return target;\n}\n\nfunction mergeChainOpts(\n target: ConfigChain,\n { options, plugins, presets }: OptionsAndDescriptors,\n): ConfigChain {\n target.options.push(options);\n target.plugins.push(...plugins());\n target.presets.push(...presets());\n\n return target;\n}\n\nfunction emptyChain(): ConfigChain {\n return {\n options: [],\n presets: [],\n plugins: [],\n };\n}\n\nfunction normalizeOptions(opts: ValidatedOptions): ValidatedOptions {\n const options = {\n ...opts,\n };\n delete options.extends;\n delete options.env;\n delete options.overrides;\n delete options.plugins;\n delete options.presets;\n delete options.passPerPreset;\n delete options.ignore;\n delete options.only;\n delete options.test;\n delete options.include;\n delete options.exclude;\n\n // \"sourceMap\" is just aliased to sourceMap, so copy it over as\n // we merge the options together.\n if (Object.prototype.hasOwnProperty.call(options, \"sourceMap\")) {\n options.sourceMaps = options.sourceMap;\n delete options.sourceMap;\n }\n return options;\n}\n\nfunction dedupDescriptors(\n items: Array,\n): Array {\n const map: Map<\n Function,\n Map,\n > = new Map();\n\n const descriptors = [];\n\n for (const item of items) {\n if (typeof item.value === \"function\") {\n const fnKey = item.value;\n let nameMap = map.get(fnKey);\n if (!nameMap) {\n nameMap = new Map();\n map.set(fnKey, nameMap);\n }\n let desc = nameMap.get(item.name);\n if (!desc) {\n desc = { value: item };\n descriptors.push(desc);\n\n // Treat passPerPreset presets as unique, skipping them\n // in the merge processing steps.\n if (!item.ownPass) nameMap.set(item.name, desc);\n } else {\n desc.value = item;\n }\n } else {\n descriptors.push({ value: item });\n }\n }\n\n return descriptors.reduce((acc, desc) => {\n acc.push(desc.value);\n return acc;\n }, []);\n}\n\nfunction configIsApplicable(\n { options }: OptionsAndDescriptors,\n dirname: string,\n context: ConfigContext,\n): boolean {\n return (\n (options.test === undefined ||\n configFieldIsApplicable(context, options.test, dirname)) &&\n (options.include === undefined ||\n configFieldIsApplicable(context, options.include, dirname)) &&\n (options.exclude === undefined ||\n !configFieldIsApplicable(context, options.exclude, dirname))\n );\n}\n\nfunction configFieldIsApplicable(\n context: ConfigContext,\n test: ConfigApplicableTest,\n dirname: string,\n): boolean {\n const patterns = Array.isArray(test) ? test : [test];\n\n return matchesPatterns(context, patterns, dirname);\n}\n\n/**\n * Tests if a filename should be ignored based on \"ignore\" and \"only\" options.\n */\nfunction shouldIgnore(\n context: ConfigContext,\n ignore: ?IgnoreList,\n only: ?IgnoreList,\n dirname: string,\n): boolean {\n if (ignore && matchesPatterns(context, ignore, dirname)) {\n debug(\n \"Ignored %o because it matched one of %O from %o\",\n context.filename,\n ignore,\n dirname,\n );\n return true;\n }\n\n if (only && !matchesPatterns(context, only, dirname)) {\n debug(\n \"Ignored %o because it failed to match one of %O from %o\",\n context.filename,\n only,\n dirname,\n );\n return true;\n }\n\n return false;\n}\n\n/**\n * Returns result of calling function with filename if pattern is a function.\n * Otherwise returns result of matching pattern Regex with filename.\n */\nfunction matchesPatterns(\n context: ConfigContext,\n patterns: IgnoreList,\n dirname: string,\n): boolean {\n return patterns.some(pattern =>\n matchPattern(pattern, dirname, context.filename, context),\n );\n}\n\nfunction matchPattern(\n pattern,\n dirname,\n pathToTest,\n context: ConfigContext,\n): boolean {\n if (typeof pattern === \"function\") {\n return !!pattern(pathToTest, {\n dirname,\n envName: context.envName,\n caller: context.caller,\n });\n }\n\n if (typeof pathToTest !== \"string\") {\n throw new Error(\n `Configuration contains string/RegExp pattern, but no filename was passed to Babel`,\n );\n }\n\n if (typeof pattern === \"string\") {\n pattern = pathPatternToRegex(pattern, dirname);\n }\n return pattern.test(pathToTest);\n}\n","import {\n assertString,\n assertFunction,\n assertObject,\n type ValidatorSet,\n type Validator,\n} from \"./option-assertions\";\n\n// Note: The casts here are just meant to be static assertions to make sure\n// that the assertion functions actually assert that the value's type matches\n// the declared types.\nconst VALIDATORS: ValidatorSet = {\n name: (assertString: Validator<$PropertyType>),\n manipulateOptions: (assertFunction: Validator<\n $PropertyType,\n >),\n pre: (assertFunction: Validator<$PropertyType>),\n post: (assertFunction: Validator<$PropertyType>),\n inherits: (assertFunction: Validator<\n $PropertyType,\n >),\n visitor: (assertVisitorMap: Validator<\n $PropertyType,\n >),\n\n parserOverride: (assertFunction: Validator<\n $PropertyType,\n >),\n generatorOverride: (assertFunction: Validator<\n $PropertyType,\n >),\n};\n\nfunction assertVisitorMap(key: string, value: mixed): VisitorMap {\n const obj = assertObject(key, value);\n if (obj) {\n Object.keys(obj).forEach(prop => assertVisitorHandler(prop, obj[prop]));\n\n if (obj.enter || obj.exit) {\n throw new Error(\n `.${key} cannot contain catch-all \"enter\" or \"exit\" handlers. Please target individual nodes.`,\n );\n }\n }\n return (obj: any);\n}\n\nfunction assertVisitorHandler(\n key: string,\n value: mixed,\n): VisitorHandler | void {\n if (value && typeof value === \"object\") {\n Object.keys(value).forEach(handler => {\n if (handler !== \"enter\" && handler !== \"exit\") {\n throw new Error(\n `.visitor[\"${key}\"] may only have .enter and/or .exit handlers.`,\n );\n }\n });\n } else if (typeof value !== \"function\") {\n throw new Error(`.visitor[\"${key}\"] must be a function`);\n }\n\n return (value: any);\n}\n\ntype VisitorHandler = Function | { enter?: Function, exit?: Function };\nexport type VisitorMap = {\n [string]: VisitorHandler,\n};\n\nexport type PluginObject = {\n name?: string,\n manipulateOptions?: Function,\n\n pre?: Function,\n post?: Function,\n\n inherits?: Function,\n visitor?: VisitorMap,\n\n parserOverride?: Function,\n generatorOverride?: Function,\n};\n\nexport function validatePluginObject(obj: {}): PluginObject {\n const rootPath: RootPath = {\n type: \"root\",\n source: \"plugin\",\n };\n Object.keys(obj).forEach(key => {\n const validator = VALIDATORS[key];\n const optLoc = {\n type: \"option\",\n name: key,\n parent: rootPath,\n };\n\n if (validator) validator(optLoc, obj[key]);\n else throw new Error(`.${key} is not a valid Plugin property`);\n });\n\n return (obj: any);\n}\n","// @flow\n\nimport semver from \"semver\";\nimport { version as coreVersion } from \"../../\";\nimport {\n assertSimpleType,\n type CacheConfigurator,\n type SimpleCacheConfigurator,\n} from \"../caching\";\n\nimport type { CallerMetadata } from \"../validation/options\";\n\ntype EnvFunction = {\n (): string,\n ((string) => T): T,\n (string): boolean,\n (Array): boolean,\n};\n\nexport type PluginAPI = {\n version: string,\n cache: SimpleCacheConfigurator,\n env: EnvFunction,\n async: () => boolean,\n assertVersion: typeof assertVersion,\n};\n\nexport default function makeAPI(\n cache: CacheConfigurator<{ envName: string, caller: CallerMetadata | void }>,\n): PluginAPI {\n const env: any = value =>\n cache.using(data => {\n if (typeof value === \"undefined\") return data.envName;\n if (typeof value === \"function\") {\n return assertSimpleType(value(data.envName));\n }\n if (!Array.isArray(value)) value = [value];\n\n return value.some(entry => {\n if (typeof entry !== \"string\") {\n throw new Error(\"Unexpected non-string value\");\n }\n return entry === data.envName;\n });\n });\n\n const caller: any = cb =>\n cache.using(data => assertSimpleType(cb(data.caller)));\n\n return {\n version: coreVersion,\n cache: cache.simple(),\n // Expose \".env()\" so people can easily get the same env that we expose using the \"env\" key.\n env,\n async: () => false,\n caller,\n assertVersion,\n tokTypes: undefined,\n };\n}\n\nfunction assertVersion(range: string | number): void {\n if (typeof range === \"number\") {\n if (!Number.isInteger(range)) {\n throw new Error(\"Expected string or integer value.\");\n }\n range = `^${range}.0.0-0`;\n }\n if (typeof range !== \"string\") {\n throw new Error(\"Expected string or integer value.\");\n }\n\n if (semver.satisfies(coreVersion, range)) return;\n\n const limit = Error.stackTraceLimit;\n\n if (typeof limit === \"number\" && limit < 25) {\n // Bump up the limit if needed so that users are more likely\n // to be able to see what is calling Babel.\n Error.stackTraceLimit = 25;\n }\n\n const err = new Error(\n `Requires Babel \"${range}\", but was loaded with \"${coreVersion}\". ` +\n `If you are sure you have a compatible version of @babel/core, ` +\n `it is likely that something in your build process is loading the ` +\n `wrong version. Inspect the stack trace of this error to look for ` +\n `the first entry that doesn't mention \"@babel/core\" or \"babel-core\" ` +\n `to see what is calling Babel.`,\n );\n\n if (typeof limit === \"number\") {\n Error.stackTraceLimit = limit;\n }\n\n throw Object.assign(\n err,\n ({\n code: \"BABEL_VERSION_UNSUPPORTED\",\n version: coreVersion,\n range,\n }: any),\n );\n}\n","// @flow\n\nimport path from \"path\";\nimport gensync, { type Handler } from \"gensync\";\nimport Plugin from \"./plugin\";\nimport { mergeOptions } from \"./util\";\nimport { createItemFromDescriptor } from \"./item\";\nimport { buildRootChain, type ConfigContext } from \"./config-chain\";\nimport { getEnv } from \"./helpers/environment\";\nimport {\n validate,\n type ValidatedOptions,\n type RootMode,\n} from \"./validation/options\";\n\nimport {\n findConfigUpwards,\n ROOT_CONFIG_FILENAMES,\n type ConfigFile,\n type IgnoreFile,\n} from \"./files\";\n\nfunction* resolveRootMode(\n rootDir: string,\n rootMode: RootMode,\n): Handler {\n switch (rootMode) {\n case \"root\":\n return rootDir;\n\n case \"upward-optional\": {\n const upwardRootDir = yield* findConfigUpwards(rootDir);\n return upwardRootDir === null ? rootDir : upwardRootDir;\n }\n\n case \"upward\": {\n const upwardRootDir = yield* findConfigUpwards(rootDir);\n if (upwardRootDir !== null) return upwardRootDir;\n\n throw Object.assign(\n (new Error(\n `Babel was run with rootMode:\"upward\" but a root could not ` +\n `be found when searching upward from \"${rootDir}\".\\n` +\n `One of the following config files must be in the directory tree: ` +\n `\"${ROOT_CONFIG_FILENAMES.join(\", \")}\".`,\n ): any),\n {\n code: \"BABEL_ROOT_NOT_FOUND\",\n dirname: rootDir,\n },\n );\n }\n default:\n throw new Error(`Assertion failure - unknown rootMode value.`);\n }\n}\n\ntype PrivPartialConfig = {\n options: ValidatedOptions,\n context: ConfigContext,\n ignore: IgnoreFile | void,\n babelrc: ConfigFile | void,\n config: ConfigFile | void,\n};\n\nexport default function* loadPrivatePartialConfig(\n inputOpts: mixed,\n): Handler {\n if (\n inputOpts != null &&\n (typeof inputOpts !== \"object\" || Array.isArray(inputOpts))\n ) {\n throw new Error(\"Babel options must be an object, null, or undefined\");\n }\n\n const args = inputOpts ? validate(\"arguments\", inputOpts) : {};\n\n const {\n envName = getEnv(),\n cwd = \".\",\n root: rootDir = \".\",\n rootMode = \"root\",\n caller,\n } = args;\n const absoluteCwd = path.resolve(cwd);\n const absoluteRootDir = yield* resolveRootMode(\n path.resolve(absoluteCwd, rootDir),\n rootMode,\n );\n\n const context: ConfigContext = {\n filename:\n typeof args.filename === \"string\"\n ? path.resolve(cwd, args.filename)\n : undefined,\n cwd: absoluteCwd,\n root: absoluteRootDir,\n envName,\n caller,\n };\n\n const configChain = yield* buildRootChain(args, context);\n if (!configChain) return null;\n\n const options = {};\n configChain.options.forEach(opts => {\n mergeOptions(options, opts);\n });\n\n // Tack the passes onto the object itself so that, if this object is\n // passed back to Babel a second time, it will be in the right structure\n // to not change behavior.\n options.babelrc = false;\n options.configFile = false;\n options.passPerPreset = false;\n options.envName = context.envName;\n options.cwd = context.cwd;\n options.root = context.root;\n options.filename =\n typeof context.filename === \"string\" ? context.filename : undefined;\n\n options.plugins = configChain.plugins.map(descriptor =>\n createItemFromDescriptor(descriptor),\n );\n options.presets = configChain.presets.map(descriptor =>\n createItemFromDescriptor(descriptor),\n );\n\n return {\n options,\n context,\n ignore: configChain.ignore,\n babelrc: configChain.babelrc,\n config: configChain.config,\n };\n}\n\nexport const loadPartialConfig = gensync<[any], PartialConfig | null>(function*(\n inputOpts: mixed,\n): Handler {\n const result: ?PrivPartialConfig = yield* loadPrivatePartialConfig(inputOpts);\n if (!result) return null;\n\n const { options, babelrc, ignore, config } = result;\n\n (options.plugins || []).forEach(item => {\n if (item.value instanceof Plugin) {\n throw new Error(\n \"Passing cached plugin instances is not supported in \" +\n \"babel.loadPartialConfig()\",\n );\n }\n });\n\n return new PartialConfig(\n options,\n babelrc ? babelrc.filepath : undefined,\n ignore ? ignore.filepath : undefined,\n config ? config.filepath : undefined,\n );\n});\n\nexport type { PartialConfig };\n\nclass PartialConfig {\n /**\n * These properties are public, so any changes to them should be considered\n * a breaking change to Babel's API.\n */\n options: ValidatedOptions;\n babelrc: string | void;\n babelignore: string | void;\n config: string | void;\n\n constructor(\n options: ValidatedOptions,\n babelrc: string | void,\n ignore: string | void,\n config: string | void,\n ) {\n this.options = options;\n this.babelignore = ignore;\n this.babelrc = babelrc;\n this.config = config;\n\n // Freeze since this is a public API and it should be extremely obvious that\n // reassigning properties on here does nothing.\n Object.freeze(this);\n }\n\n /**\n * Returns true if their is a config file in the filesystem for this config.\n *\n * While this only means .babelrc(.mjs)?/package.json#babel right now, it\n * may well expand in the future, so using this is recommended vs checking\n * this.babelrc directly.\n */\n hasFilesystemConfig(): boolean {\n return this.babelrc !== undefined || this.config !== undefined;\n }\n}\nObject.freeze(PartialConfig.prototype);\n","// @flow\n\nimport gensync, { type Handler } from \"gensync\";\nimport { forwardAsync } from \"../gensync-utils/async\";\n\nimport { mergeOptions } from \"./util\";\nimport * as context from \"../index\";\nimport Plugin from \"./plugin\";\nimport { getItemDescriptor } from \"./item\";\nimport {\n buildPresetChain,\n type ConfigContext,\n type ConfigChain,\n type PresetInstance,\n} from \"./config-chain\";\nimport type { UnloadedDescriptor } from \"./config-descriptors\";\nimport traverse from \"@babel/traverse\";\nimport {\n makeWeakCache,\n makeWeakCacheSync,\n type CacheConfigurator,\n} from \"./caching\";\nimport { validate, type CallerMetadata } from \"./validation/options\";\nimport { validatePluginObject } from \"./validation/plugins\";\nimport makeAPI from \"./helpers/config-api\";\n\nimport loadPrivatePartialConfig from \"./partial\";\nimport type { ValidatedOptions } from \"./validation/options\";\n\ntype LoadedDescriptor = {\n value: {},\n options: {},\n dirname: string,\n alias: string,\n};\n\nexport type { InputOptions } from \"./validation/options\";\n\nexport type ResolvedConfig = {\n options: Object,\n passes: PluginPasses,\n};\n\nexport type { Plugin };\nexport type PluginPassList = Array;\nexport type PluginPasses = Array;\n\n// Context not including filename since it is used in places that cannot\n// process 'ignore'/'only' and other filename-based logic.\ntype SimpleContext = {\n envName: string,\n caller: CallerMetadata | void,\n};\n\nexport default gensync<[any], ResolvedConfig | null>(function* loadFullConfig(\n inputOpts: mixed,\n): Handler {\n const result = yield* loadPrivatePartialConfig(inputOpts);\n if (!result) {\n return null;\n }\n const { options, context } = result;\n\n const optionDefaults = {};\n const passes = [[]];\n try {\n const { plugins, presets } = options;\n\n if (!plugins || !presets) {\n throw new Error(\"Assertion failure - plugins and presets exist\");\n }\n\n const ignored = yield* (function* recurseDescriptors(\n config: {\n plugins: Array,\n presets: Array,\n },\n pass: Array,\n ) {\n const plugins = [];\n for (const descriptor of config.plugins) {\n if (descriptor.options !== false) {\n plugins.push(yield* loadPluginDescriptor(descriptor, context));\n }\n }\n\n const presets = [];\n for (const descriptor of config.presets) {\n if (descriptor.options !== false) {\n presets.push({\n preset: yield* loadPresetDescriptor(descriptor, context),\n pass: descriptor.ownPass ? [] : pass,\n });\n }\n }\n\n // resolve presets\n if (presets.length > 0) {\n // The passes are created in the same order as the preset list, but are inserted before any\n // existing additional passes.\n passes.splice(\n 1,\n 0,\n ...presets.map(o => o.pass).filter(p => p !== pass),\n );\n\n for (const { preset, pass } of presets) {\n if (!preset) return true;\n\n const ignored = yield* recurseDescriptors(\n {\n plugins: preset.plugins,\n presets: preset.presets,\n },\n pass,\n );\n if (ignored) return true;\n\n preset.options.forEach(opts => {\n mergeOptions(optionDefaults, opts);\n });\n }\n }\n\n // resolve plugins\n if (plugins.length > 0) {\n pass.unshift(...plugins);\n }\n })(\n {\n plugins: plugins.map(item => {\n const desc = getItemDescriptor(item);\n if (!desc) {\n throw new Error(\"Assertion failure - must be config item\");\n }\n\n return desc;\n }),\n presets: presets.map(item => {\n const desc = getItemDescriptor(item);\n if (!desc) {\n throw new Error(\"Assertion failure - must be config item\");\n }\n\n return desc;\n }),\n },\n passes[0],\n );\n\n if (ignored) return null;\n } catch (e) {\n // There are a few case where thrown errors will try to annotate themselves multiple times, so\n // to keep things simple we just bail out if re-wrapping the message.\n if (!/^\\[BABEL\\]/.test(e.message)) {\n e.message = `[BABEL] ${context.filename || \"unknown\"}: ${e.message}`;\n }\n\n throw e;\n }\n\n const opts: Object = optionDefaults;\n mergeOptions(opts, options);\n\n opts.plugins = passes[0];\n opts.presets = passes\n .slice(1)\n .filter(plugins => plugins.length > 0)\n .map(plugins => ({ plugins }));\n opts.passPerPreset = opts.presets.length > 0;\n\n return {\n options: opts,\n passes: passes,\n };\n});\n\n/**\n * Load a generic plugin/preset from the given descriptor loaded from the config object.\n */\nconst loadDescriptor = makeWeakCache(function*(\n { value, options, dirname, alias }: UnloadedDescriptor,\n cache: CacheConfigurator,\n): Handler {\n // Disabled presets should already have been filtered out\n if (options === false) throw new Error(\"Assertion failure\");\n\n options = options || {};\n\n let item = value;\n if (typeof value === \"function\") {\n const api = {\n ...context,\n ...makeAPI(cache),\n };\n try {\n item = value(api, options, dirname);\n } catch (e) {\n if (alias) {\n e.message += ` (While processing: ${JSON.stringify(alias)})`;\n }\n throw e;\n }\n }\n\n if (!item || typeof item !== \"object\") {\n throw new Error(\"Plugin/Preset did not return an object.\");\n }\n\n if (typeof item.then === \"function\") {\n yield* []; // if we want to support async plugins\n\n throw new Error(\n `You appear to be using an async plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, ` +\n `you may need to upgrade your @babel/core version.`,\n );\n }\n\n return { value: item, options, dirname, alias };\n});\n\n/**\n * Instantiate a plugin for the given descriptor, returning the plugin/options pair.\n */\nfunction* loadPluginDescriptor(\n descriptor: UnloadedDescriptor,\n context: SimpleContext,\n): Handler {\n if (descriptor.value instanceof Plugin) {\n if (descriptor.options) {\n throw new Error(\n \"Passed options to an existing Plugin instance will not work.\",\n );\n }\n\n return descriptor.value;\n }\n\n return yield* instantiatePlugin(\n yield* loadDescriptor(descriptor, context),\n context,\n );\n}\n\nconst instantiatePlugin = makeWeakCache(function*(\n { value, options, dirname, alias }: LoadedDescriptor,\n cache: CacheConfigurator,\n): Handler {\n const pluginObj = validatePluginObject(value);\n\n const plugin = {\n ...pluginObj,\n };\n if (plugin.visitor) {\n plugin.visitor = traverse.explode({\n ...plugin.visitor,\n });\n }\n\n if (plugin.inherits) {\n const inheritsDescriptor = {\n name: undefined,\n alias: `${alias}$inherits`,\n value: plugin.inherits,\n options,\n dirname,\n };\n\n const inherits = yield* forwardAsync(loadPluginDescriptor, run => {\n // If the inherited plugin changes, reinstantiate this plugin.\n return cache.invalidate(data => run(inheritsDescriptor, data));\n });\n\n plugin.pre = chain(inherits.pre, plugin.pre);\n plugin.post = chain(inherits.post, plugin.post);\n plugin.manipulateOptions = chain(\n inherits.manipulateOptions,\n plugin.manipulateOptions,\n );\n plugin.visitor = traverse.visitors.merge([\n inherits.visitor || {},\n plugin.visitor || {},\n ]);\n }\n\n return new Plugin(plugin, options, alias);\n});\n\nconst validateIfOptionNeedsFilename = (\n options: ValidatedOptions,\n descriptor: UnloadedDescriptor,\n): void => {\n if (options.test || options.include || options.exclude) {\n const formattedPresetName = descriptor.name\n ? `\"${descriptor.name}\"`\n : \"/* your preset */\";\n throw new Error(\n [\n `Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`,\n `\\`\\`\\``,\n `babel.transform(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`,\n `\\`\\`\\``,\n `See https://babeljs.io/docs/en/options#filename for more information.`,\n ].join(\"\\n\"),\n );\n }\n};\n\nconst validatePreset = (\n preset: PresetInstance,\n context: ConfigContext,\n descriptor: UnloadedDescriptor,\n): void => {\n if (!context.filename) {\n const { options } = preset;\n validateIfOptionNeedsFilename(options, descriptor);\n if (options.overrides) {\n options.overrides.forEach(overrideOptions =>\n validateIfOptionNeedsFilename(overrideOptions, descriptor),\n );\n }\n }\n};\n\n/**\n * Generate a config object that will act as the root of a new nested config.\n */\nfunction* loadPresetDescriptor(\n descriptor: UnloadedDescriptor,\n context: ConfigContext,\n): Handler {\n const preset = instantiatePreset(yield* loadDescriptor(descriptor, context));\n validatePreset(preset, context, descriptor);\n return yield* buildPresetChain(preset, context);\n}\n\nconst instantiatePreset = makeWeakCacheSync(\n ({ value, dirname, alias }: LoadedDescriptor): PresetInstance => {\n return {\n options: validate(\"preset\", value),\n alias,\n dirname,\n };\n },\n);\n\nfunction chain(a, b) {\n const fns = [a, b].filter(Boolean);\n if (fns.length <= 1) return fns[0];\n\n return function(...args) {\n for (const fn of fns) {\n fn.apply(this, args);\n }\n };\n}\n","// @flow\n\nimport gensync from \"gensync\";\n\nexport type {\n ResolvedConfig,\n InputOptions,\n PluginPasses,\n Plugin,\n} from \"./full\";\n\nimport loadFullConfig from \"./full\";\nimport { loadPartialConfig as loadPartialConfigRunner } from \"./partial\";\n\nexport { loadFullConfig as default };\nexport type { PartialConfig } from \"./partial\";\n\nconst loadOptionsRunner = gensync<[mixed], Object | null>(function*(opts) {\n const config = yield* loadFullConfig(opts);\n return config ? config.options : null;\n});\n\nconst maybeErrback = runner => (opts: mixed, callback: Function) => {\n if (callback === undefined && typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n return callback ? runner.errback(opts, callback) : runner.sync(opts);\n};\n\nexport const loadPartialConfig = maybeErrback(loadPartialConfigRunner);\nexport const loadPartialConfigSync = loadPartialConfigRunner.sync;\nexport const loadPartialConfigAsync = loadPartialConfigRunner.async;\n\nexport const loadOptions = maybeErrback(loadOptionsRunner);\nexport const loadOptionsSync = loadOptionsRunner.sync;\nexport const loadOptionsAsync = loadOptionsRunner.async;\n","// @flow\n\nimport type File from \"./file/file\";\nimport type NodeLocation from \"./file/file\";\n\nexport default class PluginPass {\n _map: Map = new Map();\n key: ?string;\n file: File;\n opts: Object;\n\n // The working directory that Babel's programmatic options are loaded\n // relative to.\n cwd: string;\n\n // The absolute path of the file being compiled.\n filename: string | void;\n\n constructor(file: File, key: ?string, options: ?Object) {\n this.key = key;\n this.file = file;\n this.opts = options || {};\n this.cwd = file.opts.cwd;\n this.filename = file.opts.filename;\n }\n\n set(key: mixed, val: mixed) {\n this._map.set(key, val);\n }\n\n get(key: mixed): any {\n return this._map.get(key);\n }\n\n availableHelper(name: string, versionRange: ?string) {\n return this.file.availableHelper(name, versionRange);\n }\n\n addHelper(name: string) {\n return this.file.addHelper(name);\n }\n\n addImport() {\n return this.file.addImport();\n }\n\n getModuleName(): ?string {\n return this.file.getModuleName();\n }\n\n buildCodeFrameError(node: ?NodeLocation, msg: string, Error?: typeof Error) {\n return this.file.buildCodeFrameError(node, msg, Error);\n }\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","/**\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","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 // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\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","/**\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","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","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 // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\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 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 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 * 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","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are 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|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n","// @flow\n\nimport sortBy from \"lodash/sortBy\";\n\nimport loadConfig, { type Plugin } from \"../config\";\n\nlet LOADED_PLUGIN: Plugin | void;\n\nexport default function loadBlockHoistPlugin(): Plugin {\n if (!LOADED_PLUGIN) {\n // Lazy-init the internal plugin to remove the init-time circular\n // dependency between plugins being passed @babel/core's export object,\n // which loads this file, and this 'loadConfig' loading plugins.\n const config = loadConfig.sync({\n babelrc: false,\n configFile: false,\n plugins: [blockHoistPlugin],\n });\n LOADED_PLUGIN = config ? config.passes[0][0] : undefined;\n if (!LOADED_PLUGIN) throw new Error(\"Assertion failure\");\n }\n\n return LOADED_PLUGIN;\n}\n\nconst blockHoistPlugin = {\n /**\n * [Please add a description.]\n *\n * Priority:\n *\n * - 0 We want this to be at the **very** bottom\n * - 1 Default node position\n * - 2 Priority over normal nodes\n * - 3 We want this to be at the **very** top\n * - 4 Reserved for the helpers used to implement module imports.\n */\n\n name: \"internal.blockHoist\",\n\n visitor: {\n Block: {\n exit({ node }) {\n let hasChange = false;\n for (let i = 0; i < node.body.length; i++) {\n const bodyNode = node.body[i];\n if (bodyNode && bodyNode._blockHoist != null) {\n hasChange = true;\n break;\n }\n }\n if (!hasChange) return;\n\n node.body = sortBy(node.body, function(bodyNode) {\n let priority = bodyNode && bodyNode._blockHoist;\n if (priority == null) priority = 1;\n if (priority === true) priority = 2;\n\n // Higher priorities should move toward the top.\n return -1 * priority;\n });\n },\n },\n },\n};\n","// @flow\n\nimport path from \"path\";\nimport type { ResolvedConfig } from \"../config\";\n\nexport default function normalizeOptions(config: ResolvedConfig): {} {\n const {\n filename,\n cwd,\n filenameRelative = typeof filename === \"string\"\n ? path.relative(cwd, filename)\n : \"unknown\",\n sourceType = \"module\",\n inputSourceMap,\n sourceMaps = !!inputSourceMap,\n\n moduleRoot,\n sourceRoot = moduleRoot,\n\n sourceFileName = path.basename(filenameRelative),\n\n comments = true,\n compact = \"auto\",\n } = config.options;\n\n const opts = config.options;\n\n const options = {\n ...opts,\n\n parserOpts: {\n sourceType:\n path.extname(filenameRelative) === \".mjs\" ? \"module\" : sourceType,\n\n sourceFileName: filename,\n plugins: [],\n ...opts.parserOpts,\n },\n\n generatorOpts: {\n // General generator flags.\n filename,\n\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n retainLines: opts.retainLines,\n comments,\n shouldPrintComment: opts.shouldPrintComment,\n compact,\n minified: opts.minified,\n\n // Source-map generation flags.\n sourceMaps,\n\n sourceRoot,\n sourceFileName,\n ...opts.generatorOpts,\n },\n };\n\n for (const plugins of config.passes) {\n for (const plugin of plugins) {\n if (plugin.manipulateOptions) {\n plugin.manipulateOptions(options, options.parserOpts);\n }\n }\n }\n\n return options;\n}\n","export default {};\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","'use strict';\nvar fs = require('fs');\nvar path = require('path');\nvar SafeBuffer = require('safe-buffer');\n\nObject.defineProperty(exports, 'commentRegex', {\n get: function getCommentRegex () {\n return /^\\s*\\/(?:\\/|\\*)[@#]\\s+sourceMappingURL=data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,(?:.*)$/mg;\n }\n});\n\nObject.defineProperty(exports, 'mapFileCommentRegex', {\n get: function getMapFileCommentRegex () {\n // Matches sourceMappingURL in either // or /* comment styles.\n return /(?:\\/\\/[@#][ \\t]+sourceMappingURL=([^\\s'\"`]+?)[ \\t]*$)|(?:\\/\\*[@#][ \\t]+sourceMappingURL=([^\\*]+?)[ \\t]*(?:\\*\\/){1}[ \\t]*$)/mg;\n }\n});\n\n\nfunction decodeBase64(base64) {\n return SafeBuffer.Buffer.from(base64, 'base64').toString();\n}\n\nfunction stripComment(sm) {\n return sm.split(',').pop();\n}\n\nfunction readFromFileMap(sm, dir) {\n // NOTE: this will only work on the server since it attempts to read the map file\n\n var r = exports.mapFileCommentRegex.exec(sm);\n\n // for some odd reason //# .. captures in 1 and /* .. */ in 2\n var filename = r[1] || r[2];\n var filepath = path.resolve(dir, filename);\n\n try {\n return fs.readFileSync(filepath, 'utf8');\n } catch (e) {\n throw new Error('An error occurred while trying to read the map file at ' + filepath + '\\n' + e);\n }\n}\n\nfunction Converter (sm, opts) {\n opts = opts || {};\n\n if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir);\n if (opts.hasComment) sm = stripComment(sm);\n if (opts.isEncoded) sm = decodeBase64(sm);\n if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);\n\n this.sourcemap = sm;\n}\n\nConverter.prototype.toJSON = function (space) {\n return JSON.stringify(this.sourcemap, null, space);\n};\n\nConverter.prototype.toBase64 = function () {\n var json = this.toJSON();\n return SafeBuffer.Buffer.from(json, 'utf8').toString('base64');\n};\n\nConverter.prototype.toComment = function (options) {\n var base64 = this.toBase64();\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;\n};\n\n// returns copy instead of original\nConverter.prototype.toObject = function () {\n return JSON.parse(this.toJSON());\n};\n\nConverter.prototype.addProperty = function (key, value) {\n if (this.sourcemap.hasOwnProperty(key)) throw new Error('property \"' + key + '\" already exists on the sourcemap, use set property instead');\n return this.setProperty(key, value);\n};\n\nConverter.prototype.setProperty = function (key, value) {\n this.sourcemap[key] = value;\n return this;\n};\n\nConverter.prototype.getProperty = function (key) {\n return this.sourcemap[key];\n};\n\nexports.fromObject = function (obj) {\n return new Converter(obj);\n};\n\nexports.fromJSON = function (json) {\n return new Converter(json, { isJSON: true });\n};\n\nexports.fromBase64 = function (base64) {\n return new Converter(base64, { isEncoded: true });\n};\n\nexports.fromComment = function (comment) {\n comment = comment\n .replace(/^\\/\\*/g, '//')\n .replace(/\\*\\/$/g, '');\n\n return new Converter(comment, { isEncoded: true, hasComment: true });\n};\n\nexports.fromMapFileComment = function (comment, dir) {\n return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true });\n};\n\n// Finds last sourcemap comment in file or returns null if none was found\nexports.fromSource = function (content) {\n var m = content.match(exports.commentRegex);\n return m ? exports.fromComment(m.pop()) : null;\n};\n\n// Finds last sourcemap comment in file or returns null if none was found\nexports.fromMapFileSource = function (content, dir) {\n var m = content.match(exports.mapFileCommentRegex);\n return m ? exports.fromMapFileComment(m.pop(), dir) : null;\n};\n\nexports.removeComments = function (src) {\n return src.replace(exports.commentRegex, '');\n};\n\nexports.removeMapFileComments = function (src) {\n return src.replace(exports.mapFileCommentRegex, '');\n};\n\nexports.generateMapFileComment = function (file, options) {\n var data = 'sourceMappingURL=' + file;\n return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;\n};\n","// @flow\n\nconst pluginNameMap = {\n classProperties: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://git.io/vb4yQ\",\n },\n transform: {\n name: \"@babel/plugin-proposal-class-properties\",\n url: \"https://git.io/vb4SL\",\n },\n },\n decorators: {\n syntax: {\n name: \"@babel/plugin-syntax-decorators\",\n url: \"https://git.io/vb4y9\",\n },\n transform: {\n name: \"@babel/plugin-proposal-decorators\",\n url: \"https://git.io/vb4ST\",\n },\n },\n doExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-do-expressions\",\n url: \"https://git.io/vb4yh\",\n },\n transform: {\n name: \"@babel/plugin-proposal-do-expressions\",\n url: \"https://git.io/vb4S3\",\n },\n },\n dynamicImport: {\n syntax: {\n name: \"@babel/plugin-syntax-dynamic-import\",\n url: \"https://git.io/vb4Sv\",\n },\n },\n exportDefaultFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-default-from\",\n url: \"https://git.io/vb4SO\",\n },\n transform: {\n name: \"@babel/plugin-proposal-export-default-from\",\n url: \"https://git.io/vb4yH\",\n },\n },\n exportNamespaceFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-namespace-from\",\n url: \"https://git.io/vb4Sf\",\n },\n transform: {\n name: \"@babel/plugin-proposal-export-namespace-from\",\n url: \"https://git.io/vb4SG\",\n },\n },\n flow: {\n syntax: {\n name: \"@babel/plugin-syntax-flow\",\n url: \"https://git.io/vb4yb\",\n },\n transform: {\n name: \"@babel/plugin-transform-flow-strip-types\",\n url: \"https://git.io/vb49g\",\n },\n },\n functionBind: {\n syntax: {\n name: \"@babel/plugin-syntax-function-bind\",\n url: \"https://git.io/vb4y7\",\n },\n transform: {\n name: \"@babel/plugin-proposal-function-bind\",\n url: \"https://git.io/vb4St\",\n },\n },\n functionSent: {\n syntax: {\n name: \"@babel/plugin-syntax-function-sent\",\n url: \"https://git.io/vb4yN\",\n },\n transform: {\n name: \"@babel/plugin-proposal-function-sent\",\n url: \"https://git.io/vb4SZ\",\n },\n },\n importMeta: {\n syntax: {\n name: \"@babel/plugin-syntax-import-meta\",\n url: \"https://git.io/vbKK6\",\n },\n },\n jsx: {\n syntax: {\n name: \"@babel/plugin-syntax-jsx\",\n url: \"https://git.io/vb4yA\",\n },\n transform: {\n name: \"@babel/plugin-transform-react-jsx\",\n url: \"https://git.io/vb4yd\",\n },\n },\n logicalAssignment: {\n syntax: {\n name: \"@babel/plugin-syntax-logical-assignment-operators\",\n url: \"https://git.io/vAlBp\",\n },\n transform: {\n name: \"@babel/plugin-proposal-logical-assignment-operators\",\n url: \"https://git.io/vAlRe\",\n },\n },\n numericSeparator: {\n syntax: {\n name: \"@babel/plugin-syntax-numeric-separator\",\n url: \"https://git.io/vb4Sq\",\n },\n transform: {\n name: \"@babel/plugin-proposal-numeric-separator\",\n url: \"https://git.io/vb4yS\",\n },\n },\n optionalChaining: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-chaining\",\n url: \"https://git.io/vb4Sc\",\n },\n transform: {\n name: \"@babel/plugin-proposal-optional-chaining\",\n url: \"https://git.io/vb4Sk\",\n },\n },\n pipelineOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-pipeline-operator\",\n url: \"https://git.io/vb4yj\",\n },\n transform: {\n name: \"@babel/plugin-proposal-pipeline-operator\",\n url: \"https://git.io/vb4SU\",\n },\n },\n throwExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-throw-expressions\",\n url: \"https://git.io/vb4SJ\",\n },\n transform: {\n name: \"@babel/plugin-proposal-throw-expressions\",\n url: \"https://git.io/vb4yF\",\n },\n },\n typescript: {\n syntax: {\n name: \"@babel/plugin-syntax-typescript\",\n url: \"https://git.io/vb4SC\",\n },\n transform: {\n name: \"@babel/plugin-transform-typescript\",\n url: \"https://git.io/vb4Sm\",\n },\n },\n\n // TODO: This plugins are now supported by default by @babel/parser: they can\n // be removed from this list. Although removing them isn't a breaking change,\n // it's better to keep a nice error message for users using older versions of\n // the parser. They can be removed in Babel 8.\n asyncGenerators: {\n syntax: {\n name: \"@babel/plugin-syntax-async-generators\",\n url: \"https://git.io/vb4SY\",\n },\n transform: {\n name: \"@babel/plugin-proposal-async-generator-functions\",\n url: \"https://git.io/vb4yp\",\n },\n },\n nullishCoalescingOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-nullish-coalescing-operator\",\n url: \"https://git.io/vb4yx\",\n },\n transform: {\n name: \"@babel/plugin-proposal-nullish-coalescing-operator\",\n url: \"https://git.io/vb4Se\",\n },\n },\n objectRestSpread: {\n syntax: {\n name: \"@babel/plugin-syntax-object-rest-spread\",\n url: \"https://git.io/vb4y5\",\n },\n transform: {\n name: \"@babel/plugin-proposal-object-rest-spread\",\n url: \"https://git.io/vb4Ss\",\n },\n },\n optionalCatchBinding: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-catch-binding\",\n url: \"https://git.io/vb4Sn\",\n },\n transform: {\n name: \"@babel/plugin-proposal-optional-catch-binding\",\n url: \"https://git.io/vb4SI\",\n },\n },\n};\n\nconst getNameURLCombination = ({ name, url }) => `${name} (${url})`;\n\n/*\nReturns a string of the format:\nSupport for the experimental syntax [@babel/parser plugin name] isn't currently enabled ([loc]):\n\n[code frame]\n\nAdd [npm package name] ([url]) to the 'plugins' section of your Babel config\nto enable [parsing|transformation].\n*/\nexport default function generateMissingPluginMessage(\n missingPluginName: string,\n loc: { line: number, column: number },\n codeFrame: string,\n): string {\n let helpMessage =\n `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` +\n `(${loc.line}:${loc.column + 1}):\\n\\n` +\n codeFrame;\n const pluginInfo = pluginNameMap[missingPluginName];\n if (pluginInfo) {\n const { syntax: syntaxPlugin, transform: transformPlugin } = pluginInfo;\n if (syntaxPlugin) {\n if (transformPlugin) {\n const transformPluginInfo = getNameURLCombination(transformPlugin);\n helpMessage +=\n `\\n\\nAdd ${transformPluginInfo} to the 'plugins' section of your Babel config ` +\n `to enable transformation.`;\n } else {\n const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);\n helpMessage +=\n `\\n\\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` +\n `to enable parsing.`;\n }\n }\n }\n return helpMessage;\n}\n","import type { Handler } from \"gensync\";\nimport { parse } from \"@babel/parser\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport generateMissingPluginMessage from \"./util/missing-plugin-helper\";\n\ntype AstRoot = BabelNodeFile | BabelNodeProgram;\n\nexport type ParseResult = AstRoot;\n\nexport default function* parser(\n pluginPasses: PluginPasses,\n { parserOpts, highlightCode = true, filename = \"unknown\" }: Object,\n code: string,\n): Handler {\n try {\n const results = [];\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const { parserOverride } = plugin;\n if (parserOverride) {\n const ast = parserOverride(code, parserOpts, parse);\n\n if (ast !== undefined) results.push(ast);\n }\n }\n }\n\n if (results.length === 0) {\n return parse(code, parserOpts);\n } else if (results.length === 1) {\n yield* []; // If we want to allow async parsers\n if (typeof results[0].then === \"function\") {\n throw new Error(\n `You appear to be using an async parser plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n return results[0];\n }\n throw new Error(\"More than one plugin attempted to override parsing.\");\n } catch (err) {\n if (err.code === \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\") {\n err.message +=\n \"\\nConsider renaming the file to '.mjs', or setting sourceType:module \" +\n \"or sourceType:unambiguous in your Babel config for this file.\";\n // err.code will be changed to BABEL_PARSE_ERROR later.\n }\n\n const { loc, missingPlugin } = err;\n if (loc) {\n const codeFrame = codeFrameColumns(\n code,\n {\n start: {\n line: loc.line,\n column: loc.column + 1,\n },\n },\n {\n highlightCode,\n },\n );\n if (missingPlugin) {\n err.message =\n `${filename}: ` +\n generateMissingPluginMessage(missingPlugin[0], loc, codeFrame);\n } else {\n err.message = `${filename}: ${err.message}\\n\\n` + codeFrame;\n }\n err.code = \"BABEL_PARSE_ERROR\";\n }\n throw err;\n }\n}\n","// @flow\n\nimport fs from \"fs\";\nimport path from \"path\";\nimport buildDebug from \"debug\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport type { Handler } from \"gensync\";\nimport * as t from \"@babel/types\";\nimport type { PluginPasses } from \"../config\";\nimport convertSourceMap, { typeof Converter } from \"convert-source-map\";\nimport File from \"./file/file\";\nimport parser from \"../parser\";\n\nconst debug = buildDebug(\"babel:transform:file\");\nconst LARGE_INPUT_SOURCEMAP_THRESHOLD = 1_000_000;\n\nexport type NormalizedFile = {\n code: string,\n ast: {},\n inputMap: Converter | null,\n};\n\nexport default function* normalizeFile(\n pluginPasses: PluginPasses,\n options: Object,\n code: string,\n ast: ?(BabelNodeFile | BabelNodeProgram),\n): Handler {\n code = `${code || \"\"}`;\n\n if (ast) {\n if (ast.type === \"Program\") {\n ast = t.file(ast, [], []);\n } else if (ast.type !== \"File\") {\n throw new Error(\"AST root must be a Program or File node\");\n }\n ast = cloneDeep(ast);\n } else {\n ast = yield* parser(pluginPasses, options, code);\n }\n\n let inputMap = null;\n if (options.inputSourceMap !== false) {\n // If an explicit object is passed in, it overrides the processing of\n // source maps that may be in the file itself.\n if (typeof options.inputSourceMap === \"object\") {\n inputMap = convertSourceMap.fromObject(options.inputSourceMap);\n }\n\n if (!inputMap) {\n const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);\n if (lastComment) {\n try {\n inputMap = convertSourceMap.fromComment(lastComment);\n } catch (err) {\n debug(\"discarding unknown inline input sourcemap\", err);\n }\n }\n }\n\n if (!inputMap) {\n const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);\n if (typeof options.filename === \"string\" && lastComment) {\n try {\n // when `lastComment` is non-null, EXTERNAL_SOURCEMAP_REGEX must have matches\n const match: [string, string] = (EXTERNAL_SOURCEMAP_REGEX.exec(\n lastComment,\n ): any);\n const inputMapContent: Buffer = fs.readFileSync(\n path.resolve(path.dirname(options.filename), match[1]),\n );\n if (inputMapContent.length > LARGE_INPUT_SOURCEMAP_THRESHOLD) {\n debug(\"skip merging input map > 1 MB\");\n } else {\n inputMap = convertSourceMap.fromJSON(inputMapContent);\n }\n } catch (err) {\n debug(\"discarding unknown file input sourcemap\", err);\n }\n } else if (lastComment) {\n debug(\"discarding un-loadable file input sourcemap\");\n }\n }\n }\n\n return new File(options, {\n code,\n ast,\n inputMap,\n });\n}\n\n// These regexps are copied from the convert-source-map package,\n// but without // or /* at the beginning of the comment.\n\n// eslint-disable-next-line max-len\nconst INLINE_SOURCEMAP_REGEX = /^[@#]\\s+sourceMappingURL=data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,(?:.*)$/;\nconst EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \\t]+sourceMappingURL=([^\\s'\"`]+)[ \\t]*$/;\n\nfunction extractCommentsFromList(regex, comments, lastComment) {\n if (comments) {\n comments = comments.filter(({ value }) => {\n if (regex.test(value)) {\n lastComment = value;\n return false;\n }\n return true;\n });\n }\n return [comments, lastComment];\n}\n\nfunction extractComments(regex, ast) {\n let lastComment = null;\n t.traverseFast(ast, node => {\n // $FlowIgnore destructuring with expressions is not supported\n [node.leadingComments, lastComment] = extractCommentsFromList(\n regex,\n node.leadingComments,\n lastComment,\n );\n // $FlowIgnore destructuring with expressions is not supported\n [node.innerComments, lastComment] = extractCommentsFromList(\n regex,\n node.innerComments,\n lastComment,\n );\n // $FlowIgnore destructuring with expressions is not supported\n [node.trailingComments, lastComment] = extractCommentsFromList(\n regex,\n node.trailingComments,\n lastComment,\n );\n });\n return lastComment;\n}\n","// @flow\n\nimport typeof { SourceMap } from \"convert-source-map\";\nimport sourceMap from \"source-map\";\n\nexport default function mergeSourceMap(\n inputMap: SourceMap,\n map: SourceMap,\n): SourceMap {\n const input = buildMappingData(inputMap);\n const output = buildMappingData(map);\n\n const mergedGenerator = new sourceMap.SourceMapGenerator();\n for (const { source } of input.sources) {\n if (typeof source.content === \"string\") {\n mergedGenerator.setSourceContent(source.path, source.content);\n }\n }\n\n if (output.sources.length === 1) {\n const defaultSource = output.sources[0];\n\n const insertedMappings = new Map();\n\n // Process each generated range in the input map, e.g. each range over the\n // code that Babel was originally given.\n eachInputGeneratedRange(input, (generated, original, source) => {\n // Then pick out each range over Babel's _output_ that corresponds with\n // the given range on the code given to Babel.\n eachOverlappingGeneratedOutputRange(defaultSource, generated, item => {\n // It's possible that multiple input ranges will overlap the same\n // generated range. Since sourcemap don't traditionally represent\n // generated locations with multiple original locations, we explicitly\n // skip generated locations once we've seen them the first time.\n const key = makeMappingKey(item);\n if (insertedMappings.has(key)) return;\n insertedMappings.set(key, item);\n\n mergedGenerator.addMapping({\n source: source.path,\n original: {\n line: original.line,\n column: original.columnStart,\n },\n generated: {\n line: item.line,\n column: item.columnStart,\n },\n name: original.name,\n });\n });\n });\n\n // Since mappings are manipulated using single locations, but are interpreted\n // as ranges, the insertions above may not actually have their ending\n // locations mapped yet. Here be go through each one and ensure that it has\n // a well-defined ending location, if one wasn't already created by the start\n // of a different range.\n for (const item of insertedMappings.values()) {\n if (item.columnEnd === Infinity) {\n continue;\n }\n\n const clearItem = {\n line: item.line,\n columnStart: item.columnEnd,\n };\n\n const key = makeMappingKey(clearItem);\n if (insertedMappings.has(key)) {\n continue;\n }\n\n // Insert mappings with no original position to terminate any mappings\n // that were found above, so that they don't expand beyond their correct\n // range.\n mergedGenerator.addMapping({\n generated: {\n line: clearItem.line,\n column: clearItem.columnStart,\n },\n });\n }\n }\n\n const result = mergedGenerator.toJSON();\n // addMapping expects a relative path, and setSourceContent expects an\n // absolute path. To avoid this whole confusion, we leave the root out\n // entirely, and add it at the end here.\n if (typeof input.sourceRoot === \"string\") {\n result.sourceRoot = input.sourceRoot;\n }\n return result;\n}\n\nfunction makeMappingKey(item: { line: number, columnStart: number }) {\n return `${item.line}/${item.columnStart}`;\n}\n\nfunction eachOverlappingGeneratedOutputRange(\n outputFile: ResolvedFileMappings,\n inputGeneratedRange: ResolvedGeneratedRange,\n callback: ResolvedGeneratedRange => mixed,\n) {\n // Find the Babel-generated mappings that overlap with this range in the\n // input sourcemap. Generated locations within the input sourcemap\n // correspond with the original locations in the map Babel generates.\n const overlappingOriginal = filterApplicableOriginalRanges(\n outputFile,\n inputGeneratedRange,\n );\n\n for (const { generated } of overlappingOriginal) {\n for (const item of generated) {\n callback(item);\n }\n }\n}\n\nfunction filterApplicableOriginalRanges(\n { mappings }: ResolvedFileMappings,\n { line, columnStart, columnEnd }: ResolvedGeneratedRange,\n): OriginalMappings {\n // The mapping array is sorted by original location, so we can\n // binary-search it for the overlapping ranges.\n return filterSortedArray(mappings, ({ original: outOriginal }) => {\n if (line > outOriginal.line) return -1;\n if (line < outOriginal.line) return 1;\n\n if (columnStart >= outOriginal.columnEnd) return -1;\n if (columnEnd <= outOriginal.columnStart) return 1;\n\n return 0;\n });\n}\n\nfunction eachInputGeneratedRange(\n map: ResolvedMappings,\n callback: (\n ResolvedGeneratedRange,\n ResolvedOriginalRange,\n ResolvedSource,\n ) => mixed,\n) {\n for (const { source, mappings } of map.sources) {\n for (const { original, generated } of mappings) {\n for (const item of generated) {\n callback(item, original, source);\n }\n }\n }\n}\n\ntype ResolvedMappings = {|\n file: ?string,\n sourceRoot: ?string,\n sources: Array,\n|};\ntype ResolvedFileMappings = {|\n source: ResolvedSource,\n mappings: OriginalMappings,\n|};\ntype OriginalMappings = Array<{|\n original: ResolvedOriginalRange,\n generated: Array,\n|}>;\ntype ResolvedSource = {|\n path: string,\n content: string | null,\n|};\ntype ResolvedOriginalRange = {|\n line: number,\n columnStart: number,\n columnEnd: number,\n name: string | null,\n|};\ntype ResolvedGeneratedRange = {|\n line: number,\n columnStart: number,\n columnEnd: number,\n|};\n\nfunction buildMappingData(map: SourceMap): ResolvedMappings {\n const consumer = new sourceMap.SourceMapConsumer({\n ...map,\n\n // This is a bit hack. .addMapping expects source values to be relative,\n // but eachMapping returns mappings with absolute paths. To avoid that\n // incompatibility, we leave the sourceRoot out here and add it to the\n // final map at the end instead.\n sourceRoot: null,\n });\n\n const sources = new Map();\n const mappings = new Map();\n\n let last = null;\n\n consumer.computeColumnSpans();\n\n consumer.eachMapping(\n m => {\n if (m.originalLine === null) return;\n\n let source = sources.get(m.source);\n if (!source) {\n source = {\n path: m.source,\n content: consumer.sourceContentFor(m.source, true),\n };\n sources.set(m.source, source);\n }\n\n let sourceData = mappings.get(source);\n if (!sourceData) {\n sourceData = {\n source,\n mappings: [],\n };\n mappings.set(source, sourceData);\n }\n\n const obj = {\n line: m.originalLine,\n columnStart: m.originalColumn,\n columnEnd: Infinity,\n name: m.name,\n };\n\n if (\n last &&\n last.source === source &&\n last.mapping.line === m.originalLine\n ) {\n last.mapping.columnEnd = m.originalColumn;\n }\n\n last = {\n source,\n mapping: obj,\n };\n\n sourceData.mappings.push({\n original: obj,\n generated: consumer\n .allGeneratedPositionsFor({\n source: m.source,\n line: m.originalLine,\n column: m.originalColumn,\n })\n .map(item => ({\n line: item.line,\n columnStart: item.column,\n // source-map's lastColumn is inclusive, not exclusive, so we need\n // to add 1 to it.\n columnEnd: item.lastColumn + 1,\n })),\n });\n },\n null,\n sourceMap.SourceMapConsumer.ORIGINAL_ORDER,\n );\n\n return {\n file: map.file,\n sourceRoot: map.sourceRoot,\n sources: Array.from(mappings.values()),\n };\n}\n\nfunction findInsertionLocation(\n array: Array,\n callback: T => number,\n): number {\n let left = 0;\n let right = array.length;\n while (left < right) {\n const mid = Math.floor((left + right) / 2);\n const item = array[mid];\n\n const result = callback(item);\n if (result === 0) {\n left = mid;\n break;\n }\n if (result >= 0) {\n right = mid;\n } else {\n left = mid + 1;\n }\n }\n\n // Ensure the value is the start of any set of matches.\n let i = left;\n if (i < array.length) {\n while (i >= 0 && callback(array[i]) >= 0) {\n i--;\n }\n return i + 1;\n }\n\n return i;\n}\n\nfunction filterSortedArray(\n array: Array,\n callback: T => number,\n): Array {\n const start = findInsertionLocation(array, callback);\n\n const results = [];\n for (let i = start; i < array.length && callback(array[i]) === 0; i++) {\n results.push(array[i]);\n }\n\n return results;\n}\n","// @flow\n\nimport type { PluginPasses } from \"../../config\";\nimport convertSourceMap, { typeof SourceMap } from \"convert-source-map\";\nimport generate from \"@babel/generator\";\n\nimport type File from \"./file\";\nimport mergeSourceMap from \"./merge-map\";\n\nexport default function generateCode(\n pluginPasses: PluginPasses,\n file: File,\n): {\n outputCode: string,\n outputMap: SourceMap | null,\n} {\n const { opts, ast, code, inputMap } = file;\n\n const results = [];\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const { generatorOverride } = plugin;\n if (generatorOverride) {\n const result = generatorOverride(\n ast,\n opts.generatorOpts,\n code,\n generate,\n );\n\n if (result !== undefined) results.push(result);\n }\n }\n }\n\n let result;\n if (results.length === 0) {\n result = generate(ast, opts.generatorOpts, code);\n } else if (results.length === 1) {\n result = results[0];\n\n if (typeof result.then === \"function\") {\n throw new Error(\n `You appear to be using an async codegen plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, ` +\n `you may need to upgrade your @babel/core version.`,\n );\n }\n } else {\n throw new Error(\"More than one plugin attempted to override codegen.\");\n }\n\n let { code: outputCode, map: outputMap } = result;\n\n if (outputMap && inputMap) {\n outputMap = mergeSourceMap(inputMap.toObject(), outputMap);\n }\n\n if (opts.sourceMaps === \"inline\" || opts.sourceMaps === \"both\") {\n outputCode += \"\\n\" + convertSourceMap.fromObject(outputMap).toComment();\n }\n\n if (opts.sourceMaps === \"inline\") {\n outputMap = null;\n }\n\n return { outputCode, outputMap };\n}\n","// @flow\nimport traverse from \"@babel/traverse\";\nimport typeof { SourceMap } from \"convert-source-map\";\nimport type { Handler } from \"gensync\";\n\nimport type { ResolvedConfig, PluginPasses } from \"../config\";\n\nimport PluginPass from \"./plugin-pass\";\nimport loadBlockHoistPlugin from \"./block-hoist-plugin\";\nimport normalizeOptions from \"./normalize-opts\";\nimport normalizeFile from \"./normalize-file\";\n\nimport generateCode from \"./file/generate\";\nimport type File from \"./file/file\";\n\nexport type FileResultCallback = {\n (Error, null): any,\n (null, FileResult | null): any,\n};\n\nexport type FileResult = {\n metadata: {},\n options: {},\n ast: {} | null,\n code: string | null,\n map: SourceMap | null,\n};\n\nexport function* run(\n config: ResolvedConfig,\n code: string,\n ast: ?(BabelNodeFile | BabelNodeProgram),\n): Handler {\n const file = yield* normalizeFile(\n config.passes,\n normalizeOptions(config),\n code,\n ast,\n );\n\n const opts = file.opts;\n try {\n yield* transformFile(file, config.passes);\n } catch (e) {\n e.message = `${opts.filename ?? \"unknown\"}: ${e.message}`;\n if (!e.code) {\n e.code = \"BABEL_TRANSFORM_ERROR\";\n }\n throw e;\n }\n\n let outputCode, outputMap;\n try {\n if (opts.code !== false) {\n ({ outputCode, outputMap } = generateCode(config.passes, file));\n }\n } catch (e) {\n e.message = `${opts.filename ?? \"unknown\"}: ${e.message}`;\n if (!e.code) {\n e.code = \"BABEL_GENERATE_ERROR\";\n }\n throw e;\n }\n\n return {\n metadata: file.metadata,\n options: opts,\n ast: opts.ast === true ? file.ast : null,\n code: outputCode === undefined ? null : outputCode,\n map: outputMap === undefined ? null : outputMap,\n sourceType: file.ast.program.sourceType,\n };\n}\n\nfunction* transformFile(file: File, pluginPasses: PluginPasses): Handler {\n for (const pluginPairs of pluginPasses) {\n const passPairs = [];\n const passes = [];\n const visitors = [];\n\n for (const plugin of pluginPairs.concat([loadBlockHoistPlugin()])) {\n const pass = new PluginPass(file, plugin.key, plugin.options);\n\n passPairs.push([plugin, pass]);\n passes.push(pass);\n visitors.push(plugin.visitor);\n }\n\n for (const [plugin, pass] of passPairs) {\n const fn = plugin.pre;\n if (fn) {\n const result = fn.call(pass, file);\n\n yield* [];\n if (isThenable(result)) {\n throw new Error(\n `You appear to be using an plugin with an async .pre, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n }\n }\n\n // merge all plugin visitors into a single visitor\n const visitor = traverse.visitors.merge(\n visitors,\n passes,\n file.opts.wrapPluginVisitorMethod,\n );\n traverse(file.ast, visitor, file.scope);\n\n for (const [plugin, pass] of passPairs) {\n const fn = plugin.post;\n if (fn) {\n const result = fn.call(pass, file);\n\n yield* [];\n if (isThenable(result)) {\n throw new Error(\n `You appear to be using an plugin with an async .post, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n }\n }\n }\n}\n\nfunction isThenable(val: mixed): boolean {\n return (\n !!val &&\n (typeof val === \"object\" || typeof val === \"function\") &&\n !!val.then &&\n typeof val.then === \"function\"\n );\n}\n","// @flow\n\nimport gensync from \"gensync\";\n\nimport loadConfig, { type InputOptions, type ResolvedConfig } from \"./config\";\nimport {\n run,\n type FileResult,\n type FileResultCallback,\n} from \"./transformation\";\n\ntype Transform = {\n (code: string, callback: FileResultCallback): void,\n (code: string, opts: ?InputOptions, callback: FileResultCallback): void,\n\n // Here for backward-compatibility. Ideally use \".transformSync\" if you want\n // a synchronous API.\n (code: string, opts: ?InputOptions): FileResult | null,\n};\n\nconst transformRunner = gensync<[string, ?InputOptions], FileResult | null>(\n function* transform(code, opts) {\n const config: ResolvedConfig | null = yield* loadConfig(opts);\n if (config === null) return null;\n\n return yield* run(config, code);\n },\n);\n\nexport const transform: Transform = (function transform(code, opts, callback) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n // For backward-compat with Babel 6, we allow sync transformation when\n // no callback is given. Will be dropped in some future Babel major version.\n if (callback === undefined) return transformRunner.sync(code, opts);\n\n transformRunner.errback(code, opts, callback);\n}: Function);\n\nexport const transformSync = transformRunner.sync;\nexport const transformAsync = transformRunner.async;\n","// @flow\n\n// duplicated from transform-file so we do not have to import anything here\ntype TransformFile = {\n (filename: string, callback: Function): void,\n (filename: string, opts: ?Object, callback: Function): void,\n};\n\nexport const transformFile: TransformFile = (function transformFile(\n filename,\n opts,\n callback,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n }\n\n callback(new Error(\"Transforming files is not supported in browsers\"), null);\n}: Function);\n\nexport function transformFileSync() {\n throw new Error(\"Transforming files is not supported in browsers\");\n}\n\nexport function transformFileAsync() {\n return Promise.reject(\n new Error(\"Transforming files is not supported in browsers\"),\n );\n}\n","// @flow\n\nimport gensync from \"gensync\";\n\nimport loadConfig, { type InputOptions, type ResolvedConfig } from \"./config\";\nimport {\n run,\n type FileResult,\n type FileResultCallback,\n} from \"./transformation\";\n\ntype AstRoot = BabelNodeFile | BabelNodeProgram;\n\ntype TransformFromAst = {\n (ast: AstRoot, code: string, callback: FileResultCallback): void,\n (\n ast: AstRoot,\n code: string,\n opts: ?InputOptions,\n callback: FileResultCallback,\n ): void,\n\n // Here for backward-compatibility. Ideally use \".transformSync\" if you want\n // a synchronous API.\n (ast: AstRoot, code: string, opts: ?InputOptions): FileResult | null,\n};\n\nconst transformFromAstRunner = gensync<\n [AstRoot, string, ?InputOptions],\n FileResult | null,\n>(function*(ast, code, opts) {\n const config: ResolvedConfig | null = yield* loadConfig(opts);\n if (config === null) return null;\n\n if (!ast) throw new Error(\"No AST given\");\n\n return yield* run(config, code, ast);\n});\n\nexport const transformFromAst: TransformFromAst = (function transformFromAst(\n ast,\n code,\n opts,\n callback,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n // For backward-compat with Babel 6, we allow sync transformation when\n // no callback is given. Will be dropped in some future Babel major version.\n if (callback === undefined) {\n return transformFromAstRunner.sync(ast, code, opts);\n }\n\n transformFromAstRunner.errback(ast, code, opts, callback);\n}: Function);\n\nexport const transformFromAstSync = transformFromAstRunner.sync;\nexport const transformFromAstAsync = transformFromAstRunner.async;\n","// @flow\n\nimport gensync from \"gensync\";\n\nimport loadConfig, { type InputOptions } from \"./config\";\nimport parser from \"./parser\";\nimport type { ParseResult } from \"./parser\";\nimport normalizeOptions from \"./transformation/normalize-opts\";\n\ntype FileParseCallback = {\n (Error, null): any,\n (null, ParseResult | null): any,\n};\n\ntype Parse = {\n (code: string, callback: FileParseCallback): void,\n (code: string, opts: ?InputOptions, callback: FileParseCallback): void,\n\n // Here for backward-compatibility. Ideally use \".parseSync\" if you want\n // a synchronous API.\n (code: string, opts: ?InputOptions): ParseResult | null,\n};\n\nconst parseRunner = gensync<[string, ?InputOptions], ParseResult | null>(\n function* parse(code, opts) {\n const config = yield* loadConfig(opts);\n\n if (config === null) {\n return null;\n }\n\n return yield* parser(config.passes, normalizeOptions(config), code);\n },\n);\n\nexport const parse: Parse = (function parse(code, opts, callback) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n // For backward-compat with Babel 7's early betas, we allow sync parsing when\n // no callback is given. Will be dropped in some future Babel major version.\n if (callback === undefined) return parseRunner.sync(code, opts);\n\n parseRunner.errback(code, opts, callback);\n}: Function);\n\nexport const parseSync = parseRunner.sync;\nexport const parseAsync = parseRunner.async;\n","// @flow\n\nexport { default as File } from \"./transformation/file/file\";\nexport { default as buildExternalHelpers } from \"./tools/build-external-helpers\";\nexport { resolvePlugin, resolvePreset } from \"./config/files\";\n\nexport { version } from \"../package.json\";\nexport { getEnv } from \"./config/helpers/environment\";\n\nexport * as types from \"@babel/types\";\nexport { tokTypes } from \"@babel/parser\";\n\nexport { default as traverse } from \"@babel/traverse\";\nexport { default as template } from \"@babel/template\";\n\nexport { createConfigItem } from \"./config/item\";\n\nexport {\n loadPartialConfig,\n loadPartialConfigSync,\n loadPartialConfigAsync,\n loadOptions,\n loadOptionsSync,\n loadOptionsAsync,\n} from \"./config\";\n\nexport { transform, transformSync, transformAsync } from \"./transform\";\nexport {\n transformFile,\n transformFileSync,\n transformFileAsync,\n} from \"./transform-file\";\nexport {\n transformFromAst,\n transformFromAstSync,\n transformFromAstAsync,\n} from \"./transform-ast\";\nexport { parse, parseSync, parseAsync } from \"./parse\";\n\n/**\n * Recommended set of compilable extensions. Not used in @babel/core directly, but meant as\n * as an easy source for tooling making use of @babel/core.\n */\nexport const DEFAULT_EXTENSIONS = Object.freeze([\n \".js\",\n \".jsx\",\n \".es6\",\n \".es\",\n \".mjs\",\n]);\n\n// For easier backward-compatibility, provide an API like the one we exposed in Babel 6.\nimport { loadOptions } from \"./config\";\nexport class OptionManager {\n init(opts: {}) {\n return loadOptions(opts);\n }\n}\n\nexport function Plugin(alias: string) {\n throw new Error(\n `The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`,\n );\n}\n","export function declare(builder) {\n return (api, options, dirname) => {\n if (!api.assertVersion) {\n // Inject a custom version of 'assertVersion' for Babel 6 and early\n // versions of Babel 7's beta that didn't have it.\n api = Object.assign(copyApiObject(api), {\n assertVersion(range) {\n throwVersionError(range, api.version);\n },\n });\n }\n\n return builder(api, options || {}, dirname);\n };\n}\n\nfunction copyApiObject(api) {\n // Babel >= 7 <= beta.41 passed the API as a new object that had\n // babel/core as the prototype. While slightly faster, it also\n // means that the Object.assign copy below fails. Rather than\n // keep complexity, the Babel 6 behavior has been reverted and this\n // normalizes all that for Babel 7.\n let proto = null;\n if (typeof api.version === \"string\" && /^7\\./.test(api.version)) {\n proto = Object.getPrototypeOf(api);\n if (\n proto &&\n (!has(proto, \"version\") ||\n !has(proto, \"transform\") ||\n !has(proto, \"template\") ||\n !has(proto, \"types\"))\n ) {\n proto = null;\n }\n }\n\n return {\n ...proto,\n ...api,\n };\n}\n\nfunction has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nfunction throwVersionError(range, version) {\n if (typeof range === \"number\") {\n if (!Number.isInteger(range)) {\n throw new Error(\"Expected string or integer value.\");\n }\n range = `^${range}.0.0-0`;\n }\n if (typeof range !== \"string\") {\n throw new Error(\"Expected string or integer value.\");\n }\n\n const limit = Error.stackTraceLimit;\n\n if (typeof limit === \"number\" && limit < 25) {\n // Bump up the limit if needed so that users are more likely\n // to be able to see what is calling Babel.\n Error.stackTraceLimit = 25;\n }\n\n let err;\n if (version.slice(0, 2) === \"7.\") {\n err = new Error(\n `Requires Babel \"^7.0.0-beta.41\", but was loaded with \"${version}\". ` +\n `You'll need to update your @babel/core version.`,\n );\n } else {\n err = new Error(\n `Requires Babel \"${range}\", but was loaded with \"${version}\". ` +\n `If you are sure you have a compatible version of @babel/core, ` +\n `it is likely that something in your build process is loading the ` +\n `wrong version. Inspect the stack trace of this error to look for ` +\n `the first entry that doesn't mention \"@babel/core\" or \"babel-core\" ` +\n `to see what is calling Babel.`,\n );\n }\n\n if (typeof limit === \"number\") {\n Error.stackTraceLimit = limit;\n }\n\n throw Object.assign(\n err,\n ({\n code: \"BABEL_VERSION_UNSUPPORTED\",\n version,\n range,\n }: any),\n );\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { helperVersion = \"7.0.0-beta.0\", whitelist = false } = options;\n\n if (\n whitelist !== false &&\n (!Array.isArray(whitelist) || whitelist.some(w => typeof w !== \"string\"))\n ) {\n throw new Error(\n \".whitelist must be undefined, false, or an array of strings\",\n );\n }\n\n const helperWhitelist = whitelist ? new Set(whitelist) : null;\n\n return {\n name: \"external-helpers\",\n pre(file) {\n file.set(\"helperGenerator\", name => {\n // If the helper didn't exist yet at the version given, we bail\n // out and let Babel either insert it directly, or throw an error\n // so that plugins can handle that case properly.\n if (\n file.availableHelper &&\n !file.availableHelper(name, helperVersion)\n ) {\n return;\n }\n\n // babelCore.buildExternalHelpers() allows a whitelist of helpers that\n // will be inserted into the external helpers list. That same whitelist\n // should be passed into the plugin here in that case, so that we can\n // avoid referencing 'babelHelpers.XX' when the helper does not exist.\n if (helperWhitelist && !helperWhitelist.has(name)) return;\n\n return t.memberExpression(\n t.identifier(\"babelHelpers\"),\n t.identifier(name),\n );\n });\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-async-generators\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"asyncGenerators\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-class-properties\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\n \"classProperties\",\n \"classPrivateProperties\",\n \"classPrivateMethods\",\n );\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { legacy = false } = options;\n if (typeof legacy !== \"boolean\") {\n throw new Error(\"'legacy' must be a boolean.\");\n }\n\n const { decoratorsBeforeExport } = options;\n if (decoratorsBeforeExport === undefined) {\n if (!legacy) {\n throw new Error(\n \"The '@babel/plugin-syntax-decorators' plugin requires a\" +\n \" 'decoratorsBeforeExport' option, whose value must be a boolean.\" +\n \" If you want to use the legacy decorators semantics, you can set\" +\n \" the 'legacy: true' option.\",\n );\n }\n } else {\n if (legacy) {\n throw new Error(\n \"'decoratorsBeforeExport' can't be used with legacy decorators.\",\n );\n }\n if (typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n }\n\n return {\n name: \"syntax-decorators\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\n legacy\n ? \"decorators-legacy\"\n : [\"decorators\", { decoratorsBeforeExport }],\n );\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-do-expressions\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"doExpressions\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-dynamic-import\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"dynamicImport\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-export-default-from\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"exportDefaultFrom\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-export-namespace-from\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"exportNamespaceFrom\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n // When enabled and plugins includes flow, all files should be parsed as if\n // the @flow pragma was provided.\n const { all, enums } = options;\n\n if (typeof all !== \"boolean\" && typeof all !== \"undefined\") {\n throw new Error(\".all must be a boolean, or undefined\");\n }\n\n if (typeof enums !== \"boolean\" && typeof enums !== \"undefined\") {\n throw new Error(\".enums must be a boolean, or undefined\");\n }\n\n return {\n name: \"syntax-flow\",\n\n manipulateOptions(opts, parserOpts) {\n // If the file has already enabled TS, assume that this is not a\n // valid Flowtype file.\n if (\n parserOpts.plugins.some(\n p => (Array.isArray(p) ? p[0] : p) === \"typescript\",\n )\n ) {\n return;\n }\n\n parserOpts.plugins.push([\"flow\", { all, enums }]);\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-function-bind\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"functionBind\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-function-sent\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"functionSent\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-import-meta\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"importMeta\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-jsx\",\n\n manipulateOptions(opts, parserOpts) {\n // If the Typescript plugin already ran, it will have decided whether\n // or not this is a TSX file.\n if (\n parserOpts.plugins.some(\n p => (Array.isArray(p) ? p[0] : p) === \"typescript\",\n )\n ) {\n return;\n }\n\n parserOpts.plugins.push(\"jsx\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-object-rest-spread\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"objectRestSpread\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-optional-catch-binding\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"optionalCatchBinding\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport const proposals = [\"minimal\", \"smart\", \"fsharp\"];\n\nexport default declare((api, { proposal }) => {\n api.assertVersion(7);\n\n if (typeof proposal !== \"string\" || !proposals.includes(proposal)) {\n throw new Error(\n \"The pipeline operator plugin requires a 'proposal' option.\" +\n \"'proposal' must be one of: \" +\n proposals.join(\", \") +\n \". More details: https://babeljs.io/docs/en/next/babel-plugin-proposal-pipeline-operator\",\n );\n }\n\n return {\n name: \"syntax-pipeline-operator\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push([\"pipelineOperator\", { proposal }]);\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-top-level-await\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"topLevelAwait\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nfunction removePlugin(plugins, name) {\n const indices = [];\n plugins.forEach((plugin, i) => {\n const n = Array.isArray(plugin) ? plugin[0] : plugin;\n\n if (n === name) {\n indices.unshift(i);\n }\n });\n\n for (const i of indices) {\n plugins.splice(i, 1);\n }\n}\n\nexport default declare((api, { isTSX }) => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-typescript\",\n\n manipulateOptions(opts, parserOpts) {\n const { plugins } = parserOpts;\n // If the Flow syntax plugin already ran, remove it since Typescript\n // takes priority.\n removePlugin(plugins, \"flow\");\n\n // If the JSX syntax plugin already ran, remove it because JSX handling\n // in TS depends on the extensions, and is purely dependent on 'isTSX'.\n removePlugin(plugins, \"jsx\");\n\n parserOpts.plugins.push(\n \"typescript\",\n \"classProperties\",\n // TODO: This is enabled by default now, remove in Babel 8\n \"objectRestSpread\",\n );\n\n if (isTSX) {\n parserOpts.plugins.push(\"jsx\");\n }\n },\n };\n});\n","import type { NodePath } from \"@babel/traverse\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport template from \"@babel/template\";\nimport * as t from \"@babel/types\";\n\nconst buildAnonymousExpressionWrapper = template.expression(`\n (function () {\n var REF = FUNCTION;\n return function NAME(PARAMS) {\n return REF.apply(this, arguments);\n };\n })()\n`);\n\nconst buildNamedExpressionWrapper = template.expression(`\n (function () {\n var REF = FUNCTION;\n function NAME(PARAMS) {\n return REF.apply(this, arguments);\n }\n return NAME;\n })()\n`);\n\nconst buildDeclarationWrapper = template(`\n function NAME(PARAMS) { return REF.apply(this, arguments); }\n function REF() {\n REF = FUNCTION;\n return REF.apply(this, arguments);\n }\n`);\n\nfunction classOrObjectMethod(path: NodePath, callId: Object) {\n const node = path.node;\n const body = node.body;\n\n const container = t.functionExpression(\n null,\n [],\n t.blockStatement(body.body),\n true,\n );\n body.body = [\n t.returnStatement(\n t.callExpression(t.callExpression(callId, [container]), []),\n ),\n ];\n\n // Regardless of whether or not the wrapped function is a an async method\n // or generator the outer function should not be\n node.async = false;\n node.generator = false;\n\n // Unwrap the wrapper IIFE's environment so super and this and such still work.\n path\n .get(\"body.body.0.argument.callee.arguments.0\")\n .unwrapFunctionEnvironment();\n}\n\nfunction plainFunction(path: NodePath, callId: Object) {\n const node = path.node;\n const isDeclaration = path.isFunctionDeclaration();\n const functionId = node.id;\n const wrapper = isDeclaration\n ? buildDeclarationWrapper\n : functionId\n ? buildNamedExpressionWrapper\n : buildAnonymousExpressionWrapper;\n\n if (path.isArrowFunctionExpression()) {\n path.arrowFunctionToExpression();\n }\n\n node.id = null;\n\n if (isDeclaration) {\n node.type = \"FunctionExpression\";\n }\n\n const built = t.callExpression(callId, [node]);\n const container = wrapper({\n NAME: functionId || null,\n REF: path.scope.generateUidIdentifier(functionId ? functionId.name : \"ref\"),\n FUNCTION: built,\n PARAMS: node.params.reduce(\n (acc, param) => {\n acc.done =\n acc.done || t.isAssignmentPattern(param) || t.isRestElement(param);\n\n if (!acc.done) {\n acc.params.push(path.scope.generateUidIdentifier(\"x\"));\n }\n\n return acc;\n },\n {\n params: [],\n done: false,\n },\n ).params,\n });\n\n if (isDeclaration) {\n path.replaceWith(container[0]);\n path.insertAfter(container[1]);\n } else {\n const retFunction = container.callee.body.body[1].argument;\n if (!functionId) {\n nameFunction({\n node: retFunction,\n parent: path.parent,\n scope: path.scope,\n });\n }\n\n if (!retFunction || retFunction.id || node.params.length) {\n // we have an inferred function id or params so we need this wrapper\n path.replaceWith(container);\n } else {\n // we can omit this wrapper as the conditions it protects for do not apply\n path.replaceWith(built);\n }\n }\n}\n\nexport default function wrapFunction(path: NodePath, callId: Object) {\n if (path.isClassMethod() || path.isObjectMethod()) {\n classOrObjectMethod(path, callId);\n } else {\n plainFunction(path, callId);\n }\n}\n","import * as t from \"@babel/types\";\n\nconst PURE_ANNOTATION = \"#__PURE__\";\n\nconst isPureAnnotated = ({ leadingComments }) =>\n !!leadingComments &&\n leadingComments.some(comment => /[@#]__PURE__/.test(comment.value));\n\nexport default function annotateAsPure(pathOrNode) {\n const node = pathOrNode.node || pathOrNode;\n if (isPureAnnotated(node)) {\n return;\n }\n t.addComment(node, \"leading\", PURE_ANNOTATION);\n}\n","/* @noflow */\n\nimport type { NodePath } from \"@babel/traverse\";\nimport wrapFunction from \"@babel/helper-wrap-function\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport * as t from \"@babel/types\";\n\nconst awaitVisitor = {\n Function(path) {\n path.skip();\n },\n\n AwaitExpression(path, { wrapAwait }) {\n const argument = path.get(\"argument\");\n\n if (path.parentPath.isYieldExpression()) {\n path.replaceWith(argument.node);\n return;\n }\n\n path.replaceWith(\n t.yieldExpression(\n wrapAwait\n ? t.callExpression(t.cloneNode(wrapAwait), [argument.node])\n : argument.node,\n ),\n );\n },\n};\n\nexport default function(\n path: NodePath,\n helpers: { wrapAsync: Object, wrapAwait: Object },\n) {\n path.traverse(awaitVisitor, {\n wrapAwait: helpers.wrapAwait,\n });\n\n const isIIFE = checkIsIIFE(path);\n\n path.node.async = false;\n path.node.generator = true;\n\n wrapFunction(path, t.cloneNode(helpers.wrapAsync));\n\n const isProperty =\n path.isObjectMethod() ||\n path.isClassMethod() ||\n path.parentPath.isObjectProperty() ||\n path.parentPath.isClassProperty();\n\n if (!isProperty && !isIIFE && path.isExpression()) {\n annotateAsPure(path);\n }\n\n function checkIsIIFE(path: NodePath) {\n if (path.parentPath.isCallExpression({ callee: path.node })) {\n return true;\n }\n\n // try to catch calls to Function#bind, as emitted by arrowFunctionToExpression in spec mode\n // this may also catch .bind(this) written by users, but does it matter? 🤔\n const { parentPath } = path;\n if (\n parentPath.isMemberExpression() &&\n t.isIdentifier(parentPath.node.property, { name: \"bind\" })\n ) {\n const { parentPath: bindCall } = parentPath;\n\n // (function () { ... }).bind(this)()\n\n return (\n // first, check if the .bind is actually being called\n bindCall.isCallExpression() &&\n // and whether its sole argument is 'this'\n bindCall.node.arguments.length === 1 &&\n t.isThisExpression(bindCall.node.arguments[0]) &&\n // and whether the result of the .bind(this) is being called\n bindCall.parentPath.isCallExpression({ callee: bindCall.node })\n );\n }\n\n return false;\n }\n}\n","import { types as t, template } from \"@babel/core\";\n\nconst buildForAwait = template(`\n async function wrapper() {\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY;\n try {\n for (\n var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KEY, STEP_VALUE;\n (\n STEP_KEY = await ITERATOR_KEY.next(),\n ITERATOR_COMPLETION = STEP_KEY.done,\n STEP_VALUE = await STEP_KEY.value,\n !ITERATOR_COMPLETION\n );\n ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return != null) {\n await ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n }\n`);\n\nexport default function(path, { getAsyncIterator }) {\n const { node, scope, parent } = path;\n\n const stepKey = scope.generateUidIdentifier(\"step\");\n const stepValue = scope.generateUidIdentifier(\"value\");\n const left = node.left;\n let declar;\n\n if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) {\n // for await (i of test), for await ({ i } of test)\n declar = t.expressionStatement(\n t.assignmentExpression(\"=\", left, stepValue),\n );\n } else if (t.isVariableDeclaration(left)) {\n // for await (let i of test)\n declar = t.variableDeclaration(left.kind, [\n t.variableDeclarator(left.declarations[0].id, stepValue),\n ]);\n }\n let template = buildForAwait({\n ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier(\"didIteratorError\"),\n ITERATOR_COMPLETION: scope.generateUidIdentifier(\n \"iteratorNormalCompletion\",\n ),\n ITERATOR_ERROR_KEY: scope.generateUidIdentifier(\"iteratorError\"),\n ITERATOR_KEY: scope.generateUidIdentifier(\"iterator\"),\n GET_ITERATOR: getAsyncIterator,\n OBJECT: node.right,\n STEP_VALUE: stepValue,\n STEP_KEY: stepKey,\n });\n\n // remove async function wrapper\n template = template.body.body;\n\n const isLabeledParent = t.isLabeledStatement(parent);\n const tryBody = template[3].block.body;\n const loop = tryBody[0];\n\n if (isLabeledParent) {\n tryBody[0] = t.labeledStatement(parent.label, loop);\n }\n\n return {\n replaceParent: isLabeledParent,\n node: template,\n declar,\n loop,\n };\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport remapAsyncToGenerator from \"@babel/helper-remap-async-to-generator\";\nimport syntaxAsyncGenerators from \"@babel/plugin-syntax-async-generators\";\nimport { types as t } from \"@babel/core\";\nimport rewriteForAwait from \"./for-await\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n const yieldStarVisitor = {\n Function(path) {\n path.skip();\n },\n\n YieldExpression({ node }, state) {\n if (!node.delegate) return;\n const callee = state.addHelper(\"asyncGeneratorDelegate\");\n node.argument = t.callExpression(callee, [\n t.callExpression(state.addHelper(\"asyncIterator\"), [node.argument]),\n state.addHelper(\"awaitAsyncGenerator\"),\n ]);\n },\n };\n\n const forAwaitVisitor = {\n Function(path) {\n path.skip();\n },\n\n ForOfStatement(path, { file }) {\n const { node } = path;\n if (!node.await) return;\n\n const build = rewriteForAwait(path, {\n getAsyncIterator: file.addHelper(\"asyncIterator\"),\n });\n\n const { declar, loop } = build;\n const block = loop.body;\n\n // ensure that it's a block so we can take all its statements\n path.ensureBlock();\n\n // add the value declaration to the new loop body\n if (declar) {\n block.body.push(declar);\n }\n\n // push the rest of the original loop body onto our new body\n block.body = block.body.concat(node.body.body);\n\n t.inherits(loop, node);\n t.inherits(loop.body, node.body);\n\n if (build.replaceParent) {\n path.parentPath.replaceWithMultiple(build.node);\n } else {\n path.replaceWithMultiple(build.node);\n }\n },\n };\n\n const visitor = {\n Function(path, state) {\n if (!path.node.async) return;\n\n path.traverse(forAwaitVisitor, state);\n\n if (!path.node.generator) return;\n\n path.traverse(yieldStarVisitor, state);\n\n remapAsyncToGenerator(path, {\n wrapAsync: state.addHelper(\"wrapAsyncGenerator\"),\n wrapAwait: state.addHelper(\"awaitAsyncGenerator\"),\n });\n },\n };\n\n return {\n name: \"proposal-async-generator-functions\",\n inherits: syntaxAsyncGenerators,\n\n visitor: {\n Program(path, state) {\n // We need to traverse the ast here (instead of just vising Function\n // in the top level visitor) because for-await needs to run before the\n // async-to-generator plugin. This is because for-await is transpiled\n // using \"await\" expressions, which are then converted to \"yield\".\n //\n // This is bad for performance, but plugin ordering will allow as to\n // directly visit Function in the top level visitor.\n path.traverse(visitor, state);\n },\n },\n };\n});\n","import * as t from \"@babel/types\";\n\nclass AssignmentMemoiser {\n constructor() {\n this._map = new WeakMap();\n }\n\n has(key) {\n return this._map.has(key);\n }\n\n get(key) {\n if (!this.has(key)) return;\n\n const record = this._map.get(key);\n const { value } = record;\n\n record.count--;\n if (record.count === 0) {\n // The `count` access is the outermost function call (hopefully), so it\n // does the assignment.\n return t.assignmentExpression(\"=\", value, key);\n }\n return value;\n }\n\n set(key, value, count) {\n return this._map.set(key, { count, value });\n }\n}\n\nconst handle = {\n memoise() {\n // noop.\n },\n\n handle(member) {\n const { node, parent, parentPath } = member;\n\n // MEMBER++ -> _set(MEMBER, (_ref = (+_get(MEMBER))) + 1), _ref\n // ++MEMBER -> _set(MEMBER, (+_get(MEMBER)) + 1)\n if (parentPath.isUpdateExpression({ argument: node })) {\n const { operator, prefix } = parent;\n\n // Give the state handler a chance to memoise the member, since we'll\n // reference it twice. The second access (the set) should do the memo\n // assignment.\n this.memoise(member, 2);\n\n const value = t.binaryExpression(\n operator[0],\n t.unaryExpression(\"+\", this.get(member)),\n t.numericLiteral(1),\n );\n\n if (prefix) {\n parentPath.replaceWith(this.set(member, value));\n } else {\n const { scope } = member;\n const ref = scope.generateUidIdentifierBasedOnNode(node);\n scope.push({ id: ref });\n\n value.left = t.assignmentExpression(\"=\", t.cloneNode(ref), value.left);\n\n parentPath.replaceWith(\n t.sequenceExpression([this.set(member, value), t.cloneNode(ref)]),\n );\n }\n return;\n }\n\n // MEMBER = VALUE -> _set(MEMBER, VALUE)\n // MEMBER += VALUE -> _set(MEMBER, _get(MEMBER) + VALUE)\n if (parentPath.isAssignmentExpression({ left: node })) {\n const { operator, right } = parent;\n let value = right;\n\n if (operator !== \"=\") {\n // Give the state handler a chance to memoise the member, since we'll\n // reference it twice. The second access (the set) should do the memo\n // assignment.\n this.memoise(member, 2);\n\n value = t.binaryExpression(\n operator.slice(0, -1),\n this.get(member),\n value,\n );\n }\n\n parentPath.replaceWith(this.set(member, value));\n return;\n }\n\n // MEMBER(ARGS) -> _call(MEMBER, ARGS)\n if (parentPath.isCallExpression({ callee: node })) {\n const { arguments: args } = parent;\n\n parentPath.replaceWith(this.call(member, args));\n return;\n }\n\n // { KEY: MEMBER } = OBJ -> { KEY: _destructureSet(MEMBER) } = OBJ\n // { KEY: MEMBER = _VALUE } = OBJ -> { KEY: _destructureSet(MEMBER) = _VALUE } = OBJ\n // {...MEMBER} -> {..._destructureSet(MEMBER)}\n //\n // [MEMBER] = ARR -> [_destructureSet(MEMBER)] = ARR\n // [MEMBER = _VALUE] = ARR -> [_destructureSet(MEMBER) = _VALUE] = ARR\n // [...MEMBER] -> [..._destructureSet(MEMBER)]\n if (\n // { KEY: MEMBER } = OBJ\n (parentPath.isObjectProperty({ value: node }) &&\n parentPath.parentPath.isObjectPattern()) ||\n // { KEY: MEMBER = _VALUE } = OBJ\n (parentPath.isAssignmentPattern({ left: node }) &&\n parentPath.parentPath.isObjectProperty({ value: parent }) &&\n parentPath.parentPath.parentPath.isObjectPattern()) ||\n // [MEMBER] = ARR\n parentPath.isArrayPattern() ||\n // [MEMBER = _VALUE] = ARR\n (parentPath.isAssignmentPattern({ left: node }) &&\n parentPath.parentPath.isArrayPattern()) ||\n // {...MEMBER}\n // [...MEMBER]\n parentPath.isRestElement()\n ) {\n member.replaceWith(this.destructureSet(member));\n return;\n }\n\n // MEMBER -> _get(MEMBER)\n member.replaceWith(this.get(member));\n },\n};\n\n// We do not provide a default traversal visitor\n// Instead, caller passes one, and must call `state.handle` on the members\n// it wishes to be transformed.\n// Additionally, the caller must pass in a state object with at least\n// get, set, and call methods.\n// Optionally, a memoise method may be defined on the state, which will be\n// called when the member is a self-referential update.\nexport default function memberExpressionToFunctions(path, visitor, state) {\n path.traverse(visitor, {\n ...handle,\n ...state,\n memoiser: new AssignmentMemoiser(),\n });\n}\n","import * as t from \"@babel/types\";\n\nexport default function(callee, thisNode, args) {\n if (\n args.length === 1 &&\n t.isSpreadElement(args[0]) &&\n t.isIdentifier(args[0].argument, { name: \"arguments\" })\n ) {\n // eg. super(...arguments);\n return t.callExpression(t.memberExpression(callee, t.identifier(\"apply\")), [\n thisNode,\n args[0].argument,\n ]);\n } else {\n return t.callExpression(t.memberExpression(callee, t.identifier(\"call\")), [\n thisNode,\n ...args,\n ]);\n }\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport traverse from \"@babel/traverse\";\nimport memberExpressionToFunctions from \"@babel/helper-member-expression-to-functions\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\nimport * as t from \"@babel/types\";\n\n/**\n * Creates an expression which result is the proto of objectRef.\n *\n * @example isStatic === true\n *\n * helpers.getPrototypeOf(CLASS)\n *\n * @example isStatic === false\n *\n * helpers.getPrototypeOf(CLASS.prototype)\n */\nfunction getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) {\n objectRef = t.cloneNode(objectRef);\n const targetRef =\n isStatic || isPrivateMethod\n ? objectRef\n : t.memberExpression(objectRef, t.identifier(\"prototype\"));\n\n return t.callExpression(file.addHelper(\"getPrototypeOf\"), [targetRef]);\n}\n\nfunction skipAllButComputedKey(path) {\n // If the path isn't computed, just skip everything.\n if (!path.node.computed) {\n path.skip();\n return;\n }\n\n // So it's got a computed key. Make sure to skip every other key the\n // traversal would visit.\n const keys = t.VISITOR_KEYS[path.type];\n for (const key of keys) {\n if (key !== \"key\") path.skipKey(key);\n }\n}\n\nexport const environmentVisitor = {\n TypeAnnotation(path) {\n path.skip();\n },\n Function(path) {\n // Methods will be handled by the Method visit\n if (path.isMethod()) return;\n // Arrow functions inherit their parent's environment\n if (path.isArrowFunctionExpression()) return;\n path.skip();\n },\n\n \"Method|ClassProperty|ClassPrivateProperty\"(path) {\n skipAllButComputedKey(path);\n },\n};\n\nconst visitor = traverse.visitors.merge([\n environmentVisitor,\n {\n Super(path, state) {\n const { node, parentPath } = path;\n if (!parentPath.isMemberExpression({ object: node })) return;\n state.handle(parentPath);\n },\n },\n]);\n\nconst specHandlers = {\n memoise(superMember, count) {\n const { scope, node } = superMember;\n const { computed, property } = node;\n if (!computed) {\n return;\n }\n\n const memo = scope.maybeGenerateMemoised(property);\n if (!memo) {\n return;\n }\n\n this.memoiser.set(property, memo, count);\n },\n\n prop(superMember) {\n const { computed, property } = superMember.node;\n if (this.memoiser.has(property)) {\n return t.cloneNode(this.memoiser.get(property));\n }\n\n if (computed) {\n return t.cloneNode(property);\n }\n\n return t.stringLiteral(property.name);\n },\n\n get(superMember) {\n return t.callExpression(this.file.addHelper(\"get\"), [\n getPrototypeOfExpression(\n this.getObjectRef(),\n this.isStatic,\n this.file,\n this.isPrivateMethod,\n ),\n this.prop(superMember),\n t.thisExpression(),\n ]);\n },\n\n set(superMember, value) {\n return t.callExpression(this.file.addHelper(\"set\"), [\n getPrototypeOfExpression(\n this.getObjectRef(),\n this.isStatic,\n this.file,\n this.isPrivateMethod,\n ),\n this.prop(superMember),\n value,\n t.thisExpression(),\n t.booleanLiteral(superMember.isInStrictMode()),\n ]);\n },\n\n destructureSet(superMember) {\n throw superMember.buildCodeFrameError(\n `Destructuring to a super field is not supported yet.`,\n );\n },\n\n call(superMember, args) {\n return optimiseCall(this.get(superMember), t.thisExpression(), args);\n },\n};\n\nconst looseHandlers = {\n ...specHandlers,\n\n prop(superMember) {\n const { property } = superMember.node;\n if (this.memoiser.has(property)) {\n return t.cloneNode(this.memoiser.get(property));\n }\n\n return t.cloneNode(property);\n },\n\n get(superMember) {\n const { isStatic, superRef } = this;\n const { computed } = superMember.node;\n const prop = this.prop(superMember);\n\n let object;\n if (isStatic) {\n object = superRef\n ? t.cloneNode(superRef)\n : t.memberExpression(\n t.identifier(\"Function\"),\n t.identifier(\"prototype\"),\n );\n } else {\n object = superRef\n ? t.memberExpression(t.cloneNode(superRef), t.identifier(\"prototype\"))\n : t.memberExpression(t.identifier(\"Object\"), t.identifier(\"prototype\"));\n }\n\n return t.memberExpression(object, prop, computed);\n },\n\n set(superMember, value) {\n const { computed } = superMember.node;\n const prop = this.prop(superMember);\n\n return t.assignmentExpression(\n \"=\",\n t.memberExpression(t.thisExpression(), prop, computed),\n value,\n );\n },\n\n destructureSet(superMember) {\n const { computed } = superMember.node;\n const prop = this.prop(superMember);\n\n return t.memberExpression(t.thisExpression(), prop, computed);\n },\n};\n\nexport default class ReplaceSupers {\n constructor(opts: Object) {\n const path = opts.methodPath;\n\n this.methodPath = path;\n this.isStatic = path.isObjectMethod() || path.node.static;\n this.isPrivateMethod = path.isPrivate() && path.isMethod();\n\n this.file = opts.file;\n this.superRef = opts.superRef;\n this.isLoose = opts.isLoose;\n this.opts = opts;\n }\n\n methodPath: NodePath;\n superRef: Object;\n isStatic: boolean;\n isLoose: boolean;\n file;\n opts: {\n getObjetRef: Function,\n methodPath: NodePath,\n superRef: Object,\n isLoose: boolean,\n file: any,\n };\n\n getObjectRef() {\n return t.cloneNode(this.opts.objectRef || this.opts.getObjectRef());\n }\n\n replace() {\n const handler = this.isLoose ? looseHandlers : specHandlers;\n\n memberExpressionToFunctions(this.methodPath, visitor, {\n file: this.file,\n isStatic: this.isStatic,\n isPrivateMethod: this.isPrivateMethod,\n getObjectRef: this.getObjectRef.bind(this),\n superRef: this.superRef,\n ...handler,\n });\n }\n}\n","// @flow\n\nimport type { NodePath } from \"@babel/traverse\";\n\nexport function assertFieldTransformed(path: NodePath) {\n // TODO (Babel 8): Also check path.node.definite\n\n if (path.node.declare) {\n throw path.buildCodeFrameError(\n `TypeScript 'declare' fields must first be transformed by ` +\n `@babel/plugin-transform-typescript.\\n` +\n `If you have already enabled that plugin (or '@babel/preset-typescript'), make sure ` +\n `that it runs before any plugin related to additional class features:\\n` +\n ` - @babel/plugin-proposal-class-properties\\n` +\n ` - @babel/plugin-proposal-private-methods\\n` +\n ` - @babel/plugin-proposal-decorators`,\n );\n }\n}\n","import { template, traverse, types as t } from \"@babel/core\";\nimport ReplaceSupers, {\n environmentVisitor,\n} from \"@babel/helper-replace-supers\";\nimport memberExpressionToFunctions from \"@babel/helper-member-expression-to-functions\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\n\nimport * as ts from \"./typescript\";\n\nexport function buildPrivateNamesMap(props) {\n const privateNamesMap = new Map();\n for (const prop of props) {\n const isPrivate = prop.isPrivate();\n const isMethod = !prop.isProperty();\n const isInstance = !prop.node.static;\n if (isPrivate) {\n const { name } = prop.node.key.id;\n const update = privateNamesMap.has(name)\n ? privateNamesMap.get(name)\n : {\n id: prop.scope.generateUidIdentifier(name),\n static: !isInstance,\n method: isMethod,\n };\n if (prop.node.kind === \"get\") {\n update.getId = prop.scope.generateUidIdentifier(`get_${name}`);\n } else if (prop.node.kind === \"set\") {\n update.setId = prop.scope.generateUidIdentifier(`set_${name}`);\n } else if (prop.node.kind === \"method\") {\n update.methodId = prop.scope.generateUidIdentifier(name);\n }\n privateNamesMap.set(name, update);\n }\n }\n return privateNamesMap;\n}\n\nexport function buildPrivateNamesNodes(privateNamesMap, loose, state) {\n const initNodes = [];\n\n for (const [name, value] of privateNamesMap) {\n // In loose mode, both static and instance fields are transpiled using a\n // secret non-enumerable property. Hence, we also need to generate that\n // key (using the classPrivateFieldLooseKey helper).\n // In spec mode, only instance fields need a \"private name\" initializer\n // because static fields are directly assigned to a variable in the\n // buildPrivateStaticFieldInitSpec function.\n const { id, static: isStatic, method: isMethod, getId, setId } = value;\n const isAccessor = getId || setId;\n if (loose) {\n initNodes.push(\n template.statement.ast`\n var ${id} = ${state.addHelper(\"classPrivateFieldLooseKey\")}(\"${name}\")\n `,\n );\n } else if (isMethod && !isStatic) {\n if (isAccessor) {\n initNodes.push(template.statement.ast`var ${id} = new WeakMap();`);\n } else {\n initNodes.push(template.statement.ast`var ${id} = new WeakSet();`);\n }\n } else if (!isStatic) {\n initNodes.push(template.statement.ast`var ${id} = new WeakMap();`);\n }\n }\n\n return initNodes;\n}\n\n// Traverses the class scope, handling private name references. If an inner\n// class redeclares the same private name, it will hand off traversal to the\n// restricted visitor (which doesn't traverse the inner class's inner scope).\nconst privateNameVisitor = {\n PrivateName(path) {\n const { privateNamesMap } = this;\n const { node, parentPath } = path;\n\n if (!parentPath.isMemberExpression({ property: node })) return;\n if (!privateNamesMap.has(node.id.name)) return;\n\n this.handle(parentPath);\n },\n\n Class(path) {\n const { privateNamesMap } = this;\n const body = path.get(\"body.body\");\n\n for (const prop of body) {\n if (!prop.isPrivate()) {\n continue;\n }\n if (!privateNamesMap.has(prop.node.key.id.name)) continue;\n\n // This class redeclares the private name.\n // So, we can only evaluate the things in the outer scope.\n path.traverse(privateNameInnerVisitor, this);\n path.skip();\n break;\n }\n },\n};\n\n// Traverses the outer portion of a class, without touching the class's inner\n// scope, for private names.\nconst privateNameInnerVisitor = traverse.visitors.merge([\n {\n PrivateName: privateNameVisitor.PrivateName,\n },\n environmentVisitor,\n]);\n\nconst privateNameHandlerSpec = {\n memoise(member, count) {\n const { scope } = member;\n const { object } = member.node;\n\n const memo = scope.maybeGenerateMemoised(object);\n if (!memo) {\n return;\n }\n\n this.memoiser.set(object, memo, count);\n },\n\n receiver(member) {\n const { object } = member.node;\n\n if (this.memoiser.has(object)) {\n return t.cloneNode(this.memoiser.get(object));\n }\n\n return t.cloneNode(object);\n },\n\n get(member) {\n const { classRef, privateNamesMap, file } = this;\n const { name } = member.node.property.id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n methodId,\n getId,\n setId,\n } = privateNamesMap.get(name);\n const isAccessor = getId || setId;\n\n if (isStatic) {\n const helperName =\n isMethod && !isAccessor\n ? \"classStaticPrivateMethodGet\"\n : \"classStaticPrivateFieldSpecGet\";\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n ]);\n }\n\n if (isMethod) {\n if (isAccessor) {\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateMethodGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n t.cloneNode(methodId),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n },\n\n set(member, value) {\n const { classRef, privateNamesMap, file } = this;\n const { name } = member.node.property.id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n setId,\n getId,\n } = privateNamesMap.get(name);\n const isAccessor = getId || setId;\n\n if (isStatic) {\n const helperName =\n isMethod && !isAccessor\n ? \"classStaticPrivateMethodSet\"\n : \"classStaticPrivateFieldSpecSet\";\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n value,\n ]);\n }\n if (isMethod) {\n if (setId) {\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateMethodSet\"), []);\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n },\n\n destructureSet(member) {\n const { privateNamesMap, file } = this;\n const { name } = member.node.property.id;\n const { id } = privateNamesMap.get(name);\n return t.memberExpression(\n t.callExpression(file.addHelper(\"classPrivateFieldDestructureSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]),\n t.identifier(\"value\"),\n );\n },\n\n call(member, args) {\n // The first access (the get) should do the memo assignment.\n this.memoise(member, 1);\n\n return optimiseCall(this.get(member), this.receiver(member), args);\n },\n};\n\nconst privateNameHandlerLoose = {\n handle(member) {\n const { privateNamesMap, file } = this;\n const { object } = member.node;\n const { name } = member.node.property.id;\n\n member.replaceWith(\n template.expression`BASE(REF, PROP)[PROP]`({\n BASE: file.addHelper(\"classPrivateFieldLooseBase\"),\n REF: object,\n PROP: privateNamesMap.get(name).id,\n }),\n );\n },\n};\n\nexport function transformPrivateNamesUsage(\n ref,\n path,\n privateNamesMap,\n loose,\n state,\n) {\n const body = path.get(\"body\");\n\n if (loose) {\n body.traverse(privateNameVisitor, {\n privateNamesMap,\n file: state,\n ...privateNameHandlerLoose,\n });\n } else {\n memberExpressionToFunctions(body, privateNameVisitor, {\n privateNamesMap,\n classRef: ref,\n file: state,\n ...privateNameHandlerSpec,\n });\n }\n}\n\nfunction buildPrivateFieldInitLoose(ref, prop, privateNamesMap) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n });\n `;\n}\n\nfunction buildPrivateInstanceFieldInitSpec(ref, prop, privateNamesMap) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return template.statement.ast`${id}.set(${ref}, {\n // configurable is always false for private elements\n // enumerable is always false for private elements\n writable: true,\n value: ${value},\n })`;\n}\n\nfunction buildPrivateStaticFieldInitSpec(prop, privateNamesMap) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId, initAdded } = privateName;\n const isAccessor = getId || setId;\n\n if (!prop.isProperty() && (initAdded || !isAccessor)) return;\n\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return template.statement.ast`\n var ${id.name} = {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n }\n `;\n }\n\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n return template.statement.ast`\n var ${id} = {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n };\n `;\n}\n\nfunction buildPrivateMethodInitLoose(ref, prop, privateNamesMap) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { methodId, id, getId, setId, initAdded } = privateName;\n if (initAdded) return;\n\n if (methodId) {\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n `;\n }\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n `;\n }\n}\n\nfunction buildPrivateInstanceMethodInitSpec(ref, prop, privateNamesMap) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId, initAdded } = privateName;\n\n if (initAdded) return;\n\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return template.statement.ast`\n ${id}.set(${ref}, {\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n `;\n }\n return template.statement.ast`${id}.add(${ref})`;\n}\n\nfunction buildPublicFieldInitLoose(ref, prop) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(ref, key, computed || t.isLiteral(key)),\n value,\n ),\n );\n}\n\nfunction buildPublicFieldInitSpec(ref, prop, state) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return t.expressionStatement(\n t.callExpression(state.addHelper(\"defineProperty\"), [\n ref,\n computed || t.isLiteral(key) ? key : t.stringLiteral(key.name),\n value,\n ]),\n );\n}\n\nfunction buildPrivateStaticMethodInitLoose(ref, prop, state, privateNamesMap) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, methodId, getId, setId, initAdded } = privateName;\n\n if (initAdded) return;\n\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n })\n `;\n }\n\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n `;\n}\n\nfunction buildPrivateMethodDeclaration(prop, privateNamesMap, loose = false) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const {\n id,\n methodId,\n getId,\n setId,\n getterDeclared,\n setterDeclared,\n static: isStatic,\n } = privateName;\n const { params, body, generator, async } = prop.node;\n const methodValue = t.functionExpression(\n methodId,\n params,\n body,\n generator,\n async,\n );\n const isGetter = getId && !getterDeclared && params.length === 0;\n const isSetter = setId && !setterDeclared && params.length > 0;\n\n if (isGetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n getterDeclared: true,\n });\n return t.variableDeclaration(\"var\", [\n t.variableDeclarator(getId, methodValue),\n ]);\n }\n if (isSetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n setterDeclared: true,\n });\n return t.variableDeclaration(\"var\", [\n t.variableDeclarator(setId, methodValue),\n ]);\n }\n if (isStatic && !loose) {\n return t.variableDeclaration(\"var\", [\n t.variableDeclarator(\n id,\n t.functionExpression(id, params, body, generator, async),\n ),\n ]);\n }\n\n return t.variableDeclaration(\"var\", [\n t.variableDeclarator(methodId, methodValue),\n ]);\n}\n\nconst thisContextVisitor = traverse.visitors.merge([\n {\n ThisExpression(path, state) {\n state.needsClassRef = true;\n path.replaceWith(t.cloneNode(state.classRef));\n },\n },\n environmentVisitor,\n]);\n\nfunction replaceThisContext(path, ref, superRef, file, loose) {\n const state = { classRef: ref, needsClassRef: false };\n\n const replacer = new ReplaceSupers({\n methodPath: path,\n isLoose: loose,\n superRef,\n file,\n getObjectRef() {\n state.needsClassRef = true;\n return path.node.static\n ? ref\n : t.memberExpression(ref, t.identifier(\"prototype\"));\n },\n });\n replacer.replace();\n if (path.isProperty()) {\n path.traverse(thisContextVisitor, state);\n }\n return state.needsClassRef;\n}\n\nexport function buildFieldsInitNodes(\n ref,\n superRef,\n props,\n privateNamesMap,\n state,\n loose,\n) {\n const staticNodes = [];\n const instanceNodes = [];\n let needsClassRef = false;\n\n for (const prop of props) {\n ts.assertFieldTransformed(prop);\n\n const isStatic = prop.node.static;\n const isInstance = !isStatic;\n const isPrivate = prop.isPrivate();\n const isPublic = !isPrivate;\n const isField = prop.isProperty();\n const isMethod = !isField;\n\n if (isStatic || (isMethod && isPrivate)) {\n const replaced = replaceThisContext(prop, ref, superRef, state, loose);\n needsClassRef = needsClassRef || replaced;\n }\n\n switch (true) {\n case isStatic && isPrivate && isField && loose:\n needsClassRef = true;\n staticNodes.push(\n buildPrivateFieldInitLoose(t.cloneNode(ref), prop, privateNamesMap),\n );\n break;\n case isStatic && isPrivate && isField && !loose:\n needsClassRef = true;\n staticNodes.push(\n buildPrivateStaticFieldInitSpec(prop, privateNamesMap),\n );\n break;\n case isStatic && isPublic && isField && loose:\n needsClassRef = true;\n staticNodes.push(buildPublicFieldInitLoose(t.cloneNode(ref), prop));\n break;\n case isStatic && isPublic && isField && !loose:\n needsClassRef = true;\n staticNodes.push(\n buildPublicFieldInitSpec(t.cloneNode(ref), prop, state),\n );\n break;\n case isInstance && isPrivate && isField && loose:\n instanceNodes.push(\n buildPrivateFieldInitLoose(t.thisExpression(), prop, privateNamesMap),\n );\n break;\n case isInstance && isPrivate && isField && !loose:\n instanceNodes.push(\n buildPrivateInstanceFieldInitSpec(\n t.thisExpression(),\n prop,\n privateNamesMap,\n ),\n );\n break;\n case isInstance && isPrivate && isMethod && loose:\n instanceNodes.unshift(\n buildPrivateMethodInitLoose(\n t.thisExpression(),\n prop,\n privateNamesMap,\n ),\n );\n staticNodes.push(\n buildPrivateMethodDeclaration(prop, privateNamesMap, loose),\n );\n break;\n case isInstance && isPrivate && isMethod && !loose:\n instanceNodes.unshift(\n buildPrivateInstanceMethodInitSpec(\n t.thisExpression(),\n prop,\n privateNamesMap,\n ),\n );\n staticNodes.push(\n buildPrivateMethodDeclaration(prop, privateNamesMap, loose),\n );\n break;\n case isStatic && isPrivate && isMethod && !loose:\n needsClassRef = true;\n staticNodes.push(\n buildPrivateStaticFieldInitSpec(prop, privateNamesMap),\n );\n staticNodes.unshift(\n buildPrivateMethodDeclaration(prop, privateNamesMap, loose),\n );\n break;\n case isStatic && isPrivate && isMethod && loose:\n needsClassRef = true;\n staticNodes.push(\n buildPrivateStaticMethodInitLoose(\n t.cloneNode(ref),\n prop,\n state,\n privateNamesMap,\n ),\n );\n staticNodes.unshift(\n buildPrivateMethodDeclaration(prop, privateNamesMap, loose),\n );\n break;\n case isInstance && isPublic && isField && loose:\n instanceNodes.push(buildPublicFieldInitLoose(t.thisExpression(), prop));\n break;\n case isInstance && isPublic && isField && !loose:\n instanceNodes.push(\n buildPublicFieldInitSpec(t.thisExpression(), prop, state),\n );\n break;\n default:\n throw new Error(\"Unreachable.\");\n }\n }\n\n return {\n staticNodes: staticNodes.filter(Boolean),\n instanceNodes: instanceNodes.filter(Boolean),\n wrapClass(path) {\n for (const prop of props) {\n prop.remove();\n }\n\n if (!needsClassRef) return path;\n\n if (path.isClassExpression()) {\n path.scope.push({ id: ref });\n path.replaceWith(\n t.assignmentExpression(\"=\", t.cloneNode(ref), path.node),\n );\n } else if (!path.node.id) {\n // Anonymous class declaration\n path.node.id = ref;\n }\n\n return path;\n },\n };\n}\n","import { types as t, template } from \"@babel/core\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport nameFunction from \"@babel/helper-function-name\";\n\nexport function hasOwnDecorators(node) {\n return !!(node.decorators && node.decorators.length);\n}\n\nexport function hasDecorators(node) {\n return hasOwnDecorators(node) || node.body.body.some(hasOwnDecorators);\n}\n\nfunction prop(key, value) {\n if (!value) return null;\n return t.objectProperty(t.identifier(key), value);\n}\n\nfunction method(key, body) {\n return t.objectMethod(\n \"method\",\n t.identifier(key),\n [],\n t.blockStatement(body),\n );\n}\n\nfunction takeDecorators(node) {\n let result;\n if (node.decorators && node.decorators.length > 0) {\n result = t.arrayExpression(\n node.decorators.map(decorator => decorator.expression),\n );\n }\n node.decorators = undefined;\n return result;\n}\n\nfunction getKey(node) {\n if (node.computed) {\n return node.key;\n } else if (t.isIdentifier(node.key)) {\n return t.stringLiteral(node.key.name);\n } else {\n return t.stringLiteral(String(node.key.value));\n }\n}\n\n// NOTE: This function can be easily bound as .bind(file, classRef, superRef)\n// to make it easier to use it in a loop.\nfunction extractElementDescriptor(/* this: File, */ classRef, superRef, path) {\n const { node, scope } = path;\n const isMethod = path.isClassMethod();\n\n if (path.isPrivate()) {\n throw path.buildCodeFrameError(\n `Private ${\n isMethod ? \"methods\" : \"fields\"\n } in decorated classes are not supported yet.`,\n );\n }\n\n new ReplaceSupers(\n {\n methodPath: path,\n methodNode: node,\n objectRef: classRef,\n isStatic: node.static,\n superRef,\n scope,\n file: this,\n },\n true,\n ).replace();\n\n const properties = [\n prop(\"kind\", t.stringLiteral(isMethod ? node.kind : \"field\")),\n prop(\"decorators\", takeDecorators(node)),\n prop(\"static\", node.static && t.booleanLiteral(true)),\n prop(\"key\", getKey(node)),\n ].filter(Boolean);\n\n if (isMethod) {\n const id = node.computed ? null : node.key;\n t.toExpression(node);\n properties.push(prop(\"value\", nameFunction({ node, id, scope }) || node));\n } else if (node.value) {\n properties.push(\n method(\"value\", template.statements.ast`return ${node.value}`),\n );\n } else {\n properties.push(prop(\"value\", scope.buildUndefinedNode()));\n }\n\n path.remove();\n\n return t.objectExpression(properties);\n}\n\nfunction addDecorateHelper(file) {\n try {\n return file.addHelper(\"decorate\");\n } catch (err) {\n if (err.code === \"BABEL_HELPER_UNKNOWN\") {\n err.message +=\n \"\\n '@babel/plugin-transform-decorators' in non-legacy mode\" +\n \" requires '@babel/core' version ^7.0.2 and you appear to be using\" +\n \" an older version.\";\n }\n throw err;\n }\n}\n\nexport function buildDecoratedClass(ref, path, elements, file) {\n const { node, scope } = path;\n const initializeId = scope.generateUidIdentifier(\"initialize\");\n const isDeclaration = node.id && path.isDeclaration();\n const isStrict = path.isInStrictMode();\n const { superClass } = node;\n\n node.type = \"ClassDeclaration\";\n if (!node.id) node.id = t.cloneNode(ref);\n\n let superId;\n if (superClass) {\n superId = scope.generateUidIdentifierBasedOnNode(node.superClass, \"super\");\n node.superClass = superId;\n }\n\n const classDecorators = takeDecorators(node);\n const definitions = t.arrayExpression(\n elements.map(extractElementDescriptor.bind(file, node.id, superId)),\n );\n\n let replacement = template.expression.ast`\n ${addDecorateHelper(file)}(\n ${classDecorators || t.nullLiteral()},\n function (${initializeId}, ${superClass ? superId : null}) {\n ${node}\n return { F: ${t.cloneNode(node.id)}, d: ${definitions} };\n },\n ${superClass}\n )\n `;\n let classPathDesc = \"arguments.1.body.body.0\";\n\n if (!isStrict) {\n replacement.arguments[1].body.directives.push(\n t.directive(t.directiveLiteral(\"use strict\")),\n );\n }\n\n if (isDeclaration) {\n replacement = template.ast`let ${ref} = ${replacement}`;\n classPathDesc = \"declarations.0.init.\" + classPathDesc;\n }\n\n return {\n instanceNodes: [template.statement.ast`${initializeId}(this)`],\n wrapClass(path) {\n path.replaceWith(replacement);\n return path.get(classPathDesc);\n },\n };\n}\n","import { template, traverse, types as t } from \"@babel/core\";\nimport { environmentVisitor } from \"@babel/helper-replace-supers\";\n\nconst findBareSupers = traverse.visitors.merge([\n {\n Super(path) {\n const { node, parentPath } = path;\n if (parentPath.isCallExpression({ callee: node })) {\n this.push(parentPath);\n }\n },\n },\n environmentVisitor,\n]);\n\nconst referenceVisitor = {\n \"TSTypeAnnotation|TypeAnnotation\"(path) {\n path.skip();\n },\n\n ReferencedIdentifier(path) {\n if (this.scope.hasOwnBinding(path.node.name)) {\n this.scope.rename(path.node.name);\n path.skip();\n }\n },\n};\n\nconst classFieldDefinitionEvaluationTDZVisitor = traverse.visitors.merge([\n {\n ReferencedIdentifier(path) {\n if (\n this.classBinding &&\n this.classBinding === path.scope.getBinding(path.node.name)\n ) {\n const classNameTDZError = this.file.addHelper(\"classNameTDZError\");\n const throwNode = t.callExpression(classNameTDZError, [\n t.stringLiteral(path.node.name),\n ]);\n\n path.replaceWith(t.sequenceExpression([throwNode, path.node]));\n path.skip();\n }\n },\n },\n environmentVisitor,\n]);\n\nexport function injectInitialization(path, constructor, nodes, renamer) {\n if (!nodes.length) return;\n\n const isDerived = !!path.node.superClass;\n\n if (!constructor) {\n const newConstructor = t.classMethod(\n \"constructor\",\n t.identifier(\"constructor\"),\n [],\n t.blockStatement([]),\n );\n\n if (isDerived) {\n newConstructor.params = [t.restElement(t.identifier(\"args\"))];\n newConstructor.body.body.push(template.statement.ast`super(...args)`);\n }\n\n [constructor] = path.get(\"body\").unshiftContainer(\"body\", newConstructor);\n }\n\n if (renamer) {\n renamer(referenceVisitor, { scope: constructor.scope });\n }\n\n if (isDerived) {\n const bareSupers = [];\n constructor.traverse(findBareSupers, bareSupers);\n for (const bareSuper of bareSupers) {\n bareSuper.insertAfter(nodes);\n }\n } else {\n constructor.get(\"body\").unshiftContainer(\"body\", nodes);\n }\n}\n\nexport function extractComputedKeys(ref, path, computedPaths, file) {\n const declarations = [];\n\n for (const computedPath of computedPaths) {\n computedPath.traverse(classFieldDefinitionEvaluationTDZVisitor, {\n classBinding: path.node.id && path.scope.getBinding(path.node.id.name),\n file,\n });\n\n const computedNode = computedPath.node;\n // Make sure computed property names are only evaluated once (upon class definition)\n // and in the right order in combination with static properties\n if (!computedPath.get(\"key\").isConstantExpression()) {\n const ident = path.scope.generateUidIdentifierBasedOnNode(\n computedNode.key,\n );\n // Declaring in the same block scope\n // Ref: https://github.com/babel/babel/pull/10029/files#diff-fbbdd83e7a9c998721c1484529c2ce92\n path.scope.push({\n id: ident,\n kind: \"let\",\n });\n declarations.push(\n t.expressionStatement(\n t.assignmentExpression(\"=\", t.cloneNode(ident), computedNode.key),\n ),\n );\n computedNode.key = t.cloneNode(ident);\n }\n }\n\n return declarations;\n}\n","import { hasOwnDecorators } from \"./decorators\";\n\nexport const FEATURES = Object.freeze({\n //classes: 1 << 0,\n fields: 1 << 1,\n privateMethods: 1 << 2,\n decorators: 1 << 3,\n});\n\n// We can't use a symbol because this needs to always be the same, even if\n// this package isn't deduped by npm. e.g.\n// - node_modules/\n// - @babel/plugin-class-features\n// - @babel/plugin-proposal-decorators\n// - node_modules\n// - @babel-plugin-class-features\nconst featuresKey = \"@babel/plugin-class-features/featuresKey\";\nconst looseKey = \"@babel/plugin-class-features/looseKey\";\n\nexport function enableFeature(file, feature, loose) {\n // We can't blindly enable the feature because, if it was already set,\n // \"loose\" can't be changed, so that\n // @babel/plugin-class-properties { loose: true }\n // @babel/plugin-class-properties { loose: false }\n // is transformed in loose mode.\n // We only enabled the feature if it was previously disabled.\n if (!hasFeature(file, feature)) {\n file.set(featuresKey, file.get(featuresKey) | feature);\n if (loose) file.set(looseKey, file.get(looseKey) | feature);\n }\n}\n\nfunction hasFeature(file, feature) {\n return !!(file.get(featuresKey) & feature);\n}\n\nexport function isLoose(file, feature) {\n return !!(file.get(looseKey) & feature);\n}\n\nexport function verifyUsedFeatures(path, file) {\n if (hasOwnDecorators(path.node)) {\n if (!hasFeature(file, FEATURES.decorators)) {\n throw path.buildCodeFrameError(\n \"Decorators are not enabled.\" +\n \"\\nIf you are using \" +\n '[\"@babel/plugin-proposal-decorators\", { \"legacy\": true }], ' +\n 'make sure it comes *before* \"@babel/plugin-proposal-class-properties\" ' +\n \"and enable loose mode, like so:\\n\" +\n '\\t[\"@babel/plugin-proposal-decorators\", { \"legacy\": true }]\\n' +\n '\\t[\"@babel/plugin-proposal-class-properties\", { \"loose\": true }]',\n );\n }\n\n if (path.isPrivate()) {\n throw path.buildCodeFrameError(\n `Private ${\n path.isClassMethod() ? \"methods\" : \"fields\"\n } in decorated classes are not supported yet.`,\n );\n }\n }\n\n // NOTE: We can't use path.isPrivateMethod() because it isn't supported in <7.2.0\n if (path.isPrivate() && path.isMethod()) {\n if (!hasFeature(file, FEATURES.privateMethods)) {\n throw path.buildCodeFrameError(\"Class private methods are not enabled.\");\n }\n }\n\n if (\n hasFeature(file, FEATURES.privateMethods) &&\n hasFeature(file, FEATURES.fields) &&\n isLoose(file, FEATURES.privateMethods) !== isLoose(file, FEATURES.fields)\n ) {\n throw path.buildCodeFrameError(\n \"'loose' mode configuration must be the same for both @babel/plugin-proposal-class-properties \" +\n \"and @babel/plugin-proposal-private-methods\",\n );\n }\n\n if (path.isProperty()) {\n if (!hasFeature(file, FEATURES.fields)) {\n throw path.buildCodeFrameError(\"Class fields are not enabled.\");\n }\n }\n}\n","import nameFunction from \"@babel/helper-function-name\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport {\n buildPrivateNamesNodes,\n buildPrivateNamesMap,\n transformPrivateNamesUsage,\n buildFieldsInitNodes,\n} from \"./fields\";\nimport {\n hasOwnDecorators,\n buildDecoratedClass,\n hasDecorators,\n} from \"./decorators\";\nimport { injectInitialization, extractComputedKeys } from \"./misc\";\nimport {\n enableFeature,\n verifyUsedFeatures,\n FEATURES,\n isLoose,\n} from \"./features\";\n\nimport pkg from \"../package.json\";\n\nexport { FEATURES, injectInitialization };\n\n// Note: Versions are represented as an integer. e.g. 7.1.5 is represented\n// as 70000100005. This method is easier than using a semver-parsing\n// package, but it breaks if we release x.y.z where x, y or z are\n// greater than 99_999.\nconst version = pkg.version.split(\".\").reduce((v, x) => v * 1e5 + +x, 0);\nconst versionKey = \"@babel/plugin-class-features/version\";\n\nexport function createClassFeaturePlugin({\n name,\n feature,\n loose,\n manipulateOptions,\n}) {\n return {\n name,\n manipulateOptions,\n\n pre() {\n enableFeature(this.file, feature, loose);\n\n if (!this.file.get(versionKey) || this.file.get(versionKey) < version) {\n this.file.set(versionKey, version);\n }\n },\n\n visitor: {\n Class(path, state) {\n if (this.file.get(versionKey) !== version) return;\n\n verifyUsedFeatures(path, this.file);\n\n const loose = isLoose(this.file, feature);\n\n let constructor;\n let isDecorated = hasOwnDecorators(path.node);\n const props = [];\n const elements = [];\n const computedPaths = [];\n const privateNames = new Set();\n const body = path.get(\"body\");\n\n for (const path of body.get(\"body\")) {\n verifyUsedFeatures(path, this.file);\n\n if (path.node.computed) {\n computedPaths.push(path);\n }\n\n if (path.isPrivate()) {\n const { name } = path.node.key.id;\n const getName = `get ${name}`;\n const setName = `set ${name}`;\n\n if (path.node.kind === \"get\") {\n if (\n privateNames.has(getName) ||\n (privateNames.has(name) && !privateNames.has(setName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n\n privateNames.add(getName).add(name);\n } else if (path.node.kind === \"set\") {\n if (\n privateNames.has(setName) ||\n (privateNames.has(name) && !privateNames.has(getName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n\n privateNames.add(setName).add(name);\n } else {\n if (\n (privateNames.has(name) &&\n !privateNames.has(getName) &&\n !privateNames.has(setName)) ||\n (privateNames.has(name) &&\n (privateNames.has(getName) || privateNames.has(setName)))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n\n privateNames.add(name);\n }\n }\n\n if (path.isClassMethod({ kind: \"constructor\" })) {\n constructor = path;\n } else {\n elements.push(path);\n if (path.isProperty() || path.isPrivate()) {\n props.push(path);\n }\n }\n\n if (!isDecorated) isDecorated = hasOwnDecorators(path.node);\n }\n\n if (!props.length && !isDecorated) return;\n\n let ref;\n\n if (path.isClassExpression() || !path.node.id) {\n nameFunction(path);\n ref = path.scope.generateUidIdentifier(\"class\");\n } else {\n ref = path.node.id;\n }\n\n // NODE: These three functions don't support decorators yet,\n // but verifyUsedFeatures throws if there are both\n // decorators and private fields.\n const privateNamesMap = buildPrivateNamesMap(props);\n const privateNamesNodes = buildPrivateNamesNodes(\n privateNamesMap,\n loose,\n state,\n );\n\n transformPrivateNamesUsage(ref, path, privateNamesMap, loose, state);\n\n let keysNodes, staticNodes, instanceNodes, wrapClass;\n\n if (isDecorated) {\n staticNodes = keysNodes = [];\n ({ instanceNodes, wrapClass } = buildDecoratedClass(\n ref,\n path,\n elements,\n this.file,\n ));\n } else {\n keysNodes = extractComputedKeys(ref, path, computedPaths, this.file);\n ({ staticNodes, instanceNodes, wrapClass } = buildFieldsInitNodes(\n ref,\n path.node.superClass,\n props,\n privateNamesMap,\n state,\n loose,\n ));\n }\n\n if (instanceNodes.length > 0) {\n injectInitialization(\n path,\n constructor,\n instanceNodes,\n (referenceVisitor, state) => {\n if (isDecorated) return;\n for (const prop of props) {\n if (prop.node.static) continue;\n prop.traverse(referenceVisitor, state);\n }\n },\n );\n }\n\n path = wrapClass(path);\n path.insertBefore(keysNodes);\n path.insertAfter([...privateNamesNodes, ...staticNodes]);\n },\n\n PrivateName(path) {\n if (this.file.get(versionKey) !== version) return;\n\n throw path.buildCodeFrameError(`Unknown PrivateName \"${path}\"`);\n },\n\n ExportDefaultDeclaration(path) {\n if (this.file.get(versionKey) !== version) return;\n\n const decl = path.get(\"declaration\");\n\n if (decl.isClassDeclaration() && hasDecorators(decl.node)) {\n if (decl.node.id) {\n // export default class Foo {}\n // -->\n // class Foo {} export { Foo as default }\n splitExportDeclaration(path);\n } else {\n // Annyms class declarations can be\n // transformed as if they were expressions\n decl.node.type = \"ClassExpression\";\n }\n }\n },\n },\n };\n}\n","/* eslint-disable @babel/development/plugin-name */\n\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport {\n createClassFeaturePlugin,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n return createClassFeaturePlugin({\n name: \"proposal-class-properties\",\n\n feature: FEATURES.fields,\n loose: options.loose,\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"classProperties\", \"classPrivateProperties\");\n },\n });\n});\n","// Fork of https://github.com/loganfsmyth/babel-plugin-proposal-decorators-legacy\n\nimport { template, types as t } from \"@babel/core\";\n\nconst buildClassDecorator = template(`\n DECORATOR(CLASS_REF = INNER) || CLASS_REF;\n`);\n\nconst buildClassPrototype = template(`\n CLASS_REF.prototype;\n`);\n\nconst buildGetDescriptor = template(`\n Object.getOwnPropertyDescriptor(TARGET, PROPERTY);\n`);\n\nconst buildGetObjectInitializer = template(`\n (TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {\n enumerable: true,\n configurable: true,\n writable: true,\n initializer: function(){\n return TEMP;\n }\n })\n`);\n\nconst WARNING_CALLS = new WeakSet();\n\n/**\n * If the decorator expressions are non-identifiers, hoist them to before the class so we can be sure\n * that they are evaluated in order.\n */\nfunction applyEnsureOrdering(path) {\n // TODO: This should probably also hoist computed properties.\n const decorators = (path.isClass()\n ? [path].concat(path.get(\"body.body\"))\n : path.get(\"properties\")\n ).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []);\n\n const identDecorators = decorators.filter(\n decorator => !t.isIdentifier(decorator.expression),\n );\n if (identDecorators.length === 0) return;\n\n return t.sequenceExpression(\n identDecorators\n .map(decorator => {\n const expression = decorator.expression;\n const id = (decorator.expression = path.scope.generateDeclaredUidIdentifier(\n \"dec\",\n ));\n return t.assignmentExpression(\"=\", id, expression);\n })\n .concat([path.node]),\n );\n}\n\n/**\n * Given a class expression with class-level decorators, create a new expression\n * with the proper decorated behavior.\n */\nfunction applyClassDecorators(classPath) {\n if (!hasClassDecorators(classPath.node)) return;\n\n const decorators = classPath.node.decorators || [];\n classPath.node.decorators = null;\n\n const name = classPath.scope.generateDeclaredUidIdentifier(\"class\");\n\n return decorators\n .map(dec => dec.expression)\n .reverse()\n .reduce(function(acc, decorator) {\n return buildClassDecorator({\n CLASS_REF: t.cloneNode(name),\n DECORATOR: t.cloneNode(decorator),\n INNER: acc,\n }).expression;\n }, classPath.node);\n}\n\nfunction hasClassDecorators(classNode) {\n return !!(classNode.decorators && classNode.decorators.length);\n}\n\n/**\n * Given a class expression with method-level decorators, create a new expression\n * with the proper decorated behavior.\n */\nfunction applyMethodDecorators(path, state) {\n if (!hasMethodDecorators(path.node.body.body)) return;\n\n return applyTargetDecorators(path, state, path.node.body.body);\n}\n\nfunction hasMethodDecorators(body) {\n return body.some(node => node.decorators && node.decorators.length);\n}\n\n/**\n * Given an object expression with property decorators, create a new expression\n * with the proper decorated behavior.\n */\nfunction applyObjectDecorators(path, state) {\n if (!hasMethodDecorators(path.node.properties)) return;\n\n return applyTargetDecorators(path, state, path.node.properties);\n}\n\n/**\n * A helper to pull out property decorators into a sequence expression.\n */\nfunction applyTargetDecorators(path, state, decoratedProps) {\n const name = path.scope.generateDeclaredUidIdentifier(\n path.isClass() ? \"class\" : \"obj\",\n );\n\n const exprs = decoratedProps.reduce(function(acc, node) {\n const decorators = node.decorators || [];\n node.decorators = null;\n\n if (decorators.length === 0) return acc;\n\n if (node.computed) {\n throw path.buildCodeFrameError(\n \"Computed method/property decorators are not yet supported.\",\n );\n }\n\n const property = t.isLiteral(node.key)\n ? node.key\n : t.stringLiteral(node.key.name);\n\n const target =\n path.isClass() && !node.static\n ? buildClassPrototype({\n CLASS_REF: name,\n }).expression\n : name;\n\n if (t.isClassProperty(node, { static: false })) {\n const descriptor = path.scope.generateDeclaredUidIdentifier(\"descriptor\");\n\n const initializer = node.value\n ? t.functionExpression(\n null,\n [],\n t.blockStatement([t.returnStatement(node.value)]),\n )\n : t.nullLiteral();\n\n node.value = t.callExpression(\n state.addHelper(\"initializerWarningHelper\"),\n [descriptor, t.thisExpression()],\n );\n\n WARNING_CALLS.add(node.value);\n\n acc = acc.concat([\n t.assignmentExpression(\n \"=\",\n descriptor,\n t.callExpression(state.addHelper(\"applyDecoratedDescriptor\"), [\n t.cloneNode(target),\n t.cloneNode(property),\n t.arrayExpression(\n decorators.map(dec => t.cloneNode(dec.expression)),\n ),\n t.objectExpression([\n t.objectProperty(\n t.identifier(\"configurable\"),\n t.booleanLiteral(true),\n ),\n t.objectProperty(\n t.identifier(\"enumerable\"),\n t.booleanLiteral(true),\n ),\n t.objectProperty(\n t.identifier(\"writable\"),\n t.booleanLiteral(true),\n ),\n t.objectProperty(t.identifier(\"initializer\"), initializer),\n ]),\n ]),\n ),\n ]);\n } else {\n acc = acc.concat(\n t.callExpression(state.addHelper(\"applyDecoratedDescriptor\"), [\n t.cloneNode(target),\n t.cloneNode(property),\n t.arrayExpression(decorators.map(dec => t.cloneNode(dec.expression))),\n t.isObjectProperty(node) || t.isClassProperty(node, { static: true })\n ? buildGetObjectInitializer({\n TEMP: path.scope.generateDeclaredUidIdentifier(\"init\"),\n TARGET: t.cloneNode(target),\n PROPERTY: t.cloneNode(property),\n }).expression\n : buildGetDescriptor({\n TARGET: t.cloneNode(target),\n PROPERTY: t.cloneNode(property),\n }).expression,\n t.cloneNode(target),\n ]),\n );\n }\n\n return acc;\n }, []);\n\n return t.sequenceExpression([\n t.assignmentExpression(\"=\", t.cloneNode(name), path.node),\n t.sequenceExpression(exprs),\n t.cloneNode(name),\n ]);\n}\n\nfunction decoratedClassToExpression({ node, scope }) {\n if (!hasClassDecorators(node) && !hasMethodDecorators(node.body.body)) {\n return;\n }\n\n const ref = node.id\n ? t.cloneNode(node.id)\n : scope.generateUidIdentifier(\"class\");\n\n return t.variableDeclaration(\"let\", [\n t.variableDeclarator(ref, t.toExpression(node)),\n ]);\n}\n\nexport default {\n ExportDefaultDeclaration(path) {\n const decl = path.get(\"declaration\");\n if (!decl.isClassDeclaration()) return;\n\n const replacement = decoratedClassToExpression(decl);\n if (replacement) {\n const [varDeclPath] = path.replaceWithMultiple([\n replacement,\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(\n t.cloneNode(replacement.declarations[0].id),\n t.identifier(\"default\"),\n ),\n ]),\n ]);\n\n if (!decl.node.id) {\n path.scope.registerDeclaration(varDeclPath);\n }\n }\n },\n ClassDeclaration(path) {\n const replacement = decoratedClassToExpression(path);\n if (replacement) {\n path.replaceWith(replacement);\n }\n },\n ClassExpression(path, state) {\n // Create a replacement for the class node if there is one. We do one pass to replace classes with\n // class decorators, and a second pass to process method decorators.\n const decoratedClass =\n applyEnsureOrdering(path) ||\n applyClassDecorators(path, state) ||\n applyMethodDecorators(path, state);\n\n if (decoratedClass) path.replaceWith(decoratedClass);\n },\n ObjectExpression(path, state) {\n const decoratedObject =\n applyEnsureOrdering(path) || applyObjectDecorators(path, state);\n\n if (decoratedObject) path.replaceWith(decoratedObject);\n },\n\n AssignmentExpression(path, state) {\n if (!WARNING_CALLS.has(path.node.right)) return;\n\n path.replaceWith(\n t.callExpression(state.addHelper(\"initializerDefineProperty\"), [\n t.cloneNode(path.get(\"left.object\").node),\n t.stringLiteral(\n path.get(\"left.property\").node.name ||\n path.get(\"left.property\").node.value,\n ),\n t.cloneNode(path.get(\"right.arguments\")[0].node),\n t.cloneNode(path.get(\"right.arguments\")[1].node),\n ]),\n );\n },\n\n CallExpression(path, state) {\n if (path.node.arguments.length !== 3) return;\n if (!WARNING_CALLS.has(path.node.arguments[2])) return;\n\n // If the class properties plugin isn't enabled, this line will add an unused helper\n // to the code. It's not ideal, but it's ok since the configuration is not valid anyway.\n if (path.node.callee.name !== state.addHelper(\"defineProperty\").name) {\n return;\n }\n\n path.replaceWith(\n t.callExpression(state.addHelper(\"initializerDefineProperty\"), [\n t.cloneNode(path.get(\"arguments\")[0].node),\n t.cloneNode(path.get(\"arguments\")[1].node),\n t.cloneNode(path.get(\"arguments.2.arguments\")[0].node),\n t.cloneNode(path.get(\"arguments.2.arguments\")[1].node),\n ]),\n );\n },\n};\n","/* eslint-disable @babel/development/plugin-name */\n\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxDecorators from \"@babel/plugin-syntax-decorators\";\nimport {\n createClassFeaturePlugin,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\nimport legacyVisitor from \"./transformer-legacy\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { legacy = false } = options;\n if (typeof legacy !== \"boolean\") {\n throw new Error(\"'legacy' must be a boolean.\");\n }\n\n const { decoratorsBeforeExport } = options;\n if (decoratorsBeforeExport === undefined) {\n if (!legacy) {\n throw new Error(\n \"The decorators plugin requires a 'decoratorsBeforeExport' option,\" +\n \" whose value must be a boolean. If you want to use the legacy\" +\n \" decorators semantics, you can set the 'legacy: true' option.\",\n );\n }\n } else {\n if (legacy) {\n throw new Error(\n \"'decoratorsBeforeExport' can't be used with legacy decorators.\",\n );\n }\n if (typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n }\n\n if (legacy) {\n return {\n name: \"proposal-decorators\",\n inherits: syntaxDecorators,\n manipulateOptions({ generatorOpts }) {\n generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;\n },\n visitor: legacyVisitor,\n };\n }\n\n return createClassFeaturePlugin({\n name: \"proposal-decorators\",\n\n feature: FEATURES.decorators,\n // loose: options.loose, Not supported\n\n manipulateOptions({ generatorOpts, parserOpts }) {\n parserOpts.plugins.push([\"decorators\", { decoratorsBeforeExport }]);\n generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;\n },\n });\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxDoExpressions from \"@babel/plugin-syntax-do-expressions\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-do-expressions\",\n inherits: syntaxDoExpressions,\n\n visitor: {\n DoExpression: {\n exit(path) {\n const body = path.node.body.body;\n if (body.length) {\n path.replaceExpressionWithStatements(body);\n } else {\n path.replaceWith(path.scope.buildUndefinedNode());\n }\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxDynamicImport from \"@babel/plugin-syntax-dynamic-import\";\nimport { version } from \"../package.json\";\n\nconst SUPPORTED_MODULES = [\"commonjs\", \"amd\", \"systemjs\"];\n\nconst MODULES_NOT_FOUND = `\\\n@babel/plugin-proposal-dynamic-import depends on a modules\ntransform plugin. Supported plugins are:\n - @babel/plugin-transform-modules-commonjs ^7.4.0\n - @babel/plugin-transform-modules-amd ^7.4.0\n - @babel/plugin-transform-modules-systemjs ^7.4.0\n\nIf you are using Webpack or Rollup and thus don't want\nBabel to transpile your imports and exports, you can use\nthe @babel/plugin-syntax-dynamic-import plugin and let your\nbundler handle dynamic imports.\n`;\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-dynamic-import\",\n inherits: syntaxDynamicImport,\n\n pre() {\n this.file.set(\"@babel/plugin-proposal-dynamic-import\", version);\n },\n\n visitor: {\n Program() {\n const modules = this.file.get(\"@babel/plugin-transform-modules-*\");\n\n if (!SUPPORTED_MODULES.includes(modules)) {\n throw new Error(MODULES_NOT_FOUND);\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxExportDefaultFrom from \"@babel/plugin-syntax-export-default-from\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-export-default-from\",\n inherits: syntaxExportDefaultFrom,\n\n visitor: {\n ExportNamedDeclaration(path) {\n const { node, scope } = path;\n const { specifiers } = node;\n if (!t.isExportDefaultSpecifier(specifiers[0])) return;\n\n const specifier = specifiers.shift();\n const { exported } = specifier;\n const uid = scope.generateUidIdentifier(exported.name);\n\n const nodes = [\n t.importDeclaration(\n [t.importDefaultSpecifier(uid)],\n t.cloneNode(node.source),\n ),\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(uid), exported),\n ]),\n ];\n\n if (specifiers.length >= 1) {\n nodes.push(node);\n }\n\n const [importDeclaration] = path.replaceWithMultiple(nodes);\n path.scope.registerDeclaration(importDeclaration);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxExportNamespaceFrom from \"@babel/plugin-syntax-export-namespace-from\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-export-namespace-from\",\n inherits: syntaxExportNamespaceFrom,\n\n visitor: {\n ExportNamedDeclaration(path) {\n const { node, scope } = path;\n const { specifiers } = node;\n\n const index = t.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;\n if (!t.isExportNamespaceSpecifier(specifiers[index])) return;\n\n const nodes = [];\n\n if (index === 1) {\n nodes.push(\n t.exportNamedDeclaration(null, [specifiers.shift()], node.source),\n );\n }\n\n const specifier = specifiers.shift();\n const { exported } = specifier;\n const uid = scope.generateUidIdentifier(exported.name);\n\n nodes.push(\n t.importDeclaration(\n [t.importNamespaceSpecifier(uid)],\n t.cloneNode(node.source),\n ),\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(uid), exported),\n ]),\n );\n\n if (node.specifiers.length >= 1) {\n nodes.push(node);\n }\n\n const [importDeclaration] = path.replaceWithMultiple(nodes);\n path.scope.registerDeclaration(importDeclaration);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxFunctionBind from \"@babel/plugin-syntax-function-bind\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function getTempId(scope) {\n let id = scope.path.getData(\"functionBind\");\n if (id) return id;\n\n id = scope.generateDeclaredUidIdentifier(\"context\");\n return scope.path.setData(\"functionBind\", id);\n }\n\n function getStaticContext(bind, scope) {\n const object = bind.object || bind.callee.object;\n return scope.isStatic(object) && object;\n }\n\n function inferBindContext(bind, scope) {\n const staticContext = getStaticContext(bind, scope);\n if (staticContext) return t.cloneNode(staticContext);\n\n const tempId = getTempId(scope);\n if (bind.object) {\n bind.callee = t.sequenceExpression([\n t.assignmentExpression(\"=\", tempId, bind.object),\n bind.callee,\n ]);\n } else {\n bind.callee.object = t.assignmentExpression(\n \"=\",\n tempId,\n bind.callee.object,\n );\n }\n return tempId;\n }\n\n return {\n name: \"proposal-function-bind\",\n inherits: syntaxFunctionBind,\n\n visitor: {\n CallExpression({ node, scope }) {\n const bind = node.callee;\n if (!t.isBindExpression(bind)) return;\n\n const context = inferBindContext(bind, scope);\n node.callee = t.memberExpression(bind.callee, t.identifier(\"call\"));\n node.arguments.unshift(context);\n },\n\n BindExpression(path) {\n const { node, scope } = path;\n const context = inferBindContext(node, scope);\n path.replaceWith(\n t.callExpression(\n t.memberExpression(node.callee, t.identifier(\"bind\")),\n [context],\n ),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxFunctionSent from \"@babel/plugin-syntax-function-sent\";\nimport wrapFunction from \"@babel/helper-wrap-function\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n const isFunctionSent = node =>\n t.isIdentifier(node.meta, { name: \"function\" }) &&\n t.isIdentifier(node.property, { name: \"sent\" });\n\n const hasBeenReplaced = (node, sentId) =>\n t.isAssignmentExpression(node) &&\n t.isIdentifier(node.left, { name: sentId });\n\n const yieldVisitor = {\n Function(path) {\n path.skip();\n },\n\n YieldExpression(path) {\n if (!hasBeenReplaced(path.parent, this.sentId)) {\n path.replaceWith(\n t.assignmentExpression(\"=\", t.identifier(this.sentId), path.node),\n );\n }\n },\n\n MetaProperty(path) {\n if (isFunctionSent(path.node)) {\n path.replaceWith(t.identifier(this.sentId));\n }\n },\n };\n\n return {\n name: \"proposal-function-sent\",\n inherits: syntaxFunctionSent,\n\n visitor: {\n MetaProperty(path, state) {\n if (!isFunctionSent(path.node)) return;\n\n const fnPath = path.getFunctionParent();\n\n if (!fnPath.node.generator) {\n throw new Error(\"Parent generator function not found\");\n }\n\n const sentId = path.scope.generateUid(\"function.sent\");\n\n fnPath.traverse(yieldVisitor, { sentId });\n fnPath.node.body.body.unshift(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.identifier(sentId), t.yieldExpression()),\n ]),\n );\n\n wrapFunction(fnPath, state.addHelper(\"skipFirstGeneratorNext\"));\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-json-strings\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"jsonStrings\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxJsonStrings from \"@babel/plugin-syntax-json-strings\";\n\nexport default declare(api => {\n api.assertVersion(7);\n const regex = /(\\\\*)([\\u2028\\u2029])/g;\n function replace(match, escapes, separator) {\n // If there's an odd number, that means the separator itself was escaped.\n // \"\\X\" escapes X.\n // \"\\\\X\" escapes the backslash, so X is unescaped.\n const isEscaped = escapes.length % 2 === 1;\n if (isEscaped) return match;\n\n return `${escapes}\\\\u${separator.charCodeAt(0).toString(16)}`;\n }\n\n return {\n name: \"proposal-json-strings\",\n inherits: syntaxJsonStrings,\n\n visitor: {\n \"DirectiveLiteral|StringLiteral\"({ node }) {\n const { extra } = node;\n if (!extra || !extra.raw) return;\n\n extra.raw = extra.raw.replace(regex, replace);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-logical-assignment-operators\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"logicalAssignment\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxLogicalAssignmentOperators from \"@babel/plugin-syntax-logical-assignment-operators\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-logical-assignment-operators\",\n inherits: syntaxLogicalAssignmentOperators,\n\n visitor: {\n AssignmentExpression(path) {\n const { node, scope } = path;\n const { operator, left, right } = node;\n if (operator !== \"||=\" && operator !== \"&&=\" && operator !== \"??=\") {\n return;\n }\n\n const lhs = t.cloneNode(left);\n if (t.isMemberExpression(left)) {\n const { object, property, computed } = left;\n const memo = scope.maybeGenerateMemoised(object);\n if (memo) {\n left.object = memo;\n lhs.object = t.assignmentExpression(\"=\", t.cloneNode(memo), object);\n }\n\n if (computed) {\n const memo = scope.maybeGenerateMemoised(property);\n if (memo) {\n left.property = memo;\n lhs.property = t.assignmentExpression(\n \"=\",\n t.cloneNode(memo),\n property,\n );\n }\n }\n }\n\n path.replaceWith(\n t.logicalExpression(\n operator.slice(0, -1),\n lhs,\n t.assignmentExpression(\"=\", left, right),\n ),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-nullish-coalescing-operator\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"nullishCoalescingOperator\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxNullishCoalescingOperator from \"@babel/plugin-syntax-nullish-coalescing-operator\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, { loose = false }) => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-nullish-coalescing-operator\",\n inherits: syntaxNullishCoalescingOperator,\n\n visitor: {\n LogicalExpression(path) {\n const { node, scope } = path;\n if (node.operator !== \"??\") {\n return;\n }\n\n let ref = scope.maybeGenerateMemoised(node.left);\n let assignment;\n // skip creating extra reference when `left` is static\n if (ref === null) {\n ref = node.left;\n assignment = t.cloneNode(node.left);\n } else {\n assignment = t.assignmentExpression(\"=\", ref, node.left);\n }\n\n path.replaceWith(\n t.conditionalExpression(\n // We cannot use `!= null` in spec mode because\n // `document.all == null` and `document.all` is not \"nullish\".\n loose\n ? t.binaryExpression(\"!=\", assignment, t.nullLiteral())\n : t.logicalExpression(\n \"&&\",\n t.binaryExpression(\"!==\", assignment, t.nullLiteral()),\n t.binaryExpression(\n \"!==\",\n t.cloneNode(ref),\n scope.buildUndefinedNode(),\n ),\n ),\n t.cloneNode(ref),\n node.right,\n ),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-numeric-separator\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"numericSeparator\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxNumericSeparator from \"@babel/plugin-syntax-numeric-separator\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-numeric-separator\",\n inherits: syntaxNumericSeparator,\n\n visitor: {\n NumericLiteral({ node }) {\n const { extra } = node;\n if (extra && /_/.test(extra.raw)) {\n extra.raw = extra.raw.replace(/_/g, \"\");\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxObjectRestSpread from \"@babel/plugin-syntax-object-rest-spread\";\nimport { types as t } from \"@babel/core\";\n\n// TODO: Remove in Babel 8\n// @babel/types <=7.3.3 counts FOO as referenced in var { x: FOO }.\n// We need to detect this bug to know if \"unused\" means 0 or 1 references.\nconst ZERO_REFS = (() => {\n const node = t.identifier(\"a\");\n const property = t.objectProperty(t.identifier(\"key\"), node);\n const pattern = t.objectPattern([property]);\n\n return t.isReferenced(node, property, pattern) ? 1 : 0;\n})();\n\nexport default declare((api, opts) => {\n api.assertVersion(7);\n\n const { useBuiltIns = false, loose = false } = opts;\n\n if (typeof loose !== \"boolean\") {\n throw new Error(\".loose must be a boolean, or undefined\");\n }\n\n function getExtendsHelper(file) {\n return useBuiltIns\n ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n : file.addHelper(\"extends\");\n }\n\n function hasRestElement(path) {\n let foundRestElement = false;\n visitRestElements(path, restElement => {\n foundRestElement = true;\n restElement.stop();\n });\n return foundRestElement;\n }\n\n function hasObjectPatternRestElement(path) {\n let foundRestElement = false;\n visitRestElements(path, restElement => {\n if (restElement.parentPath.isObjectPattern()) {\n foundRestElement = true;\n restElement.stop();\n }\n });\n return foundRestElement;\n }\n\n function visitRestElements(path, visitor) {\n path.traverse({\n Expression(path) {\n const parentType = path.parent.type;\n if (\n (parentType === \"AssignmentPattern\" && path.key === \"right\") ||\n (parentType === \"ObjectProperty\" &&\n path.parent.computed &&\n path.key === \"key\")\n ) {\n path.skip();\n }\n },\n RestElement: visitor,\n });\n }\n\n function hasSpread(node) {\n for (const prop of node.properties) {\n if (t.isSpreadElement(prop)) {\n return true;\n }\n }\n return false;\n }\n\n // returns an array of all keys of an object, and a status flag indicating if all extracted keys\n // were converted to stringLiterals or not\n // e.g. extracts {keys: [\"a\", \"b\", \"3\", ++x], allLiteral: false }\n // from ast of {a: \"foo\", b, 3: \"bar\", [++x]: \"baz\"}\n function extractNormalizedKeys(path) {\n const props = path.node.properties;\n const keys = [];\n let allLiteral = true;\n\n for (const prop of props) {\n if (t.isIdentifier(prop.key) && !prop.computed) {\n // since a key {a: 3} is equivalent to {\"a\": 3}, use the latter\n keys.push(t.stringLiteral(prop.key.name));\n } else if (t.isTemplateLiteral(prop.key)) {\n keys.push(t.cloneNode(prop.key));\n } else if (t.isLiteral(prop.key)) {\n keys.push(t.stringLiteral(String(prop.key.value)));\n } else {\n keys.push(t.cloneNode(prop.key));\n allLiteral = false;\n }\n }\n\n return { keys, allLiteral };\n }\n\n // replaces impure computed keys with new identifiers\n // and returns variable declarators of these new identifiers\n function replaceImpureComputedKeys(properties, scope) {\n const impureComputedPropertyDeclarators = [];\n for (const propPath of properties) {\n const key = propPath.get(\"key\");\n if (propPath.node.computed && !key.isPure()) {\n const name = scope.generateUidBasedOnNode(key.node);\n const declarator = t.variableDeclarator(t.identifier(name), key.node);\n impureComputedPropertyDeclarators.push(declarator);\n key.replaceWith(t.identifier(name));\n }\n }\n return impureComputedPropertyDeclarators;\n }\n\n function removeUnusedExcludedKeys(path) {\n const bindings = path.getOuterBindingIdentifierPaths();\n\n Object.keys(bindings).forEach(bindingName => {\n const bindingParentPath = bindings[bindingName].parentPath;\n if (\n path.scope.getBinding(bindingName).references > ZERO_REFS ||\n !bindingParentPath.isObjectProperty()\n ) {\n return;\n }\n bindingParentPath.remove();\n });\n }\n\n //expects path to an object pattern\n function createObjectSpread(path, file, objRef) {\n const props = path.get(\"properties\");\n const last = props[props.length - 1];\n t.assertRestElement(last.node);\n const restElement = t.cloneNode(last.node);\n last.remove();\n\n const impureComputedPropertyDeclarators = replaceImpureComputedKeys(\n path.get(\"properties\"),\n path.scope,\n );\n const { keys, allLiteral } = extractNormalizedKeys(path);\n\n if (keys.length === 0) {\n return [\n impureComputedPropertyDeclarators,\n restElement.argument,\n t.callExpression(getExtendsHelper(file), [\n t.objectExpression([]),\n t.cloneNode(objRef),\n ]),\n ];\n }\n\n let keyExpression;\n if (!allLiteral) {\n // map to toPropertyKey to handle the possible non-string values\n keyExpression = t.callExpression(\n t.memberExpression(t.arrayExpression(keys), t.identifier(\"map\")),\n [file.addHelper(\"toPropertyKey\")],\n );\n } else {\n keyExpression = t.arrayExpression(keys);\n }\n\n return [\n impureComputedPropertyDeclarators,\n restElement.argument,\n t.callExpression(\n file.addHelper(`objectWithoutProperties${loose ? \"Loose\" : \"\"}`),\n [t.cloneNode(objRef), keyExpression],\n ),\n ];\n }\n\n function replaceRestElement(parentPath, paramPath) {\n if (paramPath.isAssignmentPattern()) {\n replaceRestElement(parentPath, paramPath.get(\"left\"));\n return;\n }\n\n if (paramPath.isArrayPattern() && hasRestElement(paramPath)) {\n const elements = paramPath.get(\"elements\");\n\n for (let i = 0; i < elements.length; i++) {\n replaceRestElement(parentPath, elements[i]);\n }\n }\n\n if (paramPath.isObjectPattern() && hasRestElement(paramPath)) {\n const uid = parentPath.scope.generateUidIdentifier(\"ref\");\n\n const declar = t.variableDeclaration(\"let\", [\n t.variableDeclarator(paramPath.node, uid),\n ]);\n\n parentPath.ensureBlock();\n parentPath.get(\"body\").unshiftContainer(\"body\", declar);\n paramPath.replaceWith(t.cloneNode(uid));\n }\n }\n\n return {\n name: \"proposal-object-rest-spread\",\n inherits: syntaxObjectRestSpread,\n\n visitor: {\n // taken from transform-parameters/src/destructuring.js\n // function a({ b, ...c }) {}\n Function(path) {\n const params = path.get(\"params\");\n for (let i = params.length - 1; i >= 0; i--) {\n replaceRestElement(params[i].parentPath, params[i]);\n }\n },\n // adapted from transform-destructuring/src/index.js#pushObjectRest\n // const { a, ...b } = c;\n VariableDeclarator(path, file) {\n if (!path.get(\"id\").isObjectPattern()) {\n return;\n }\n\n let insertionPath = path;\n const originalPath = path;\n\n visitRestElements(path.get(\"id\"), path => {\n if (!path.parentPath.isObjectPattern()) {\n // Return early if the parent is not an ObjectPattern, but\n // (for example) an ArrayPattern or Function, because that\n // means this RestElement is an not an object property.\n return;\n }\n\n if (\n // skip single-property case, e.g.\n // const { ...x } = foo();\n // since the RHS will not be duplicated\n originalPath.node.id.properties.length > 1 &&\n !t.isIdentifier(originalPath.node.init)\n ) {\n // const { a, ...b } = foo();\n // to avoid calling foo() twice, as a first step convert it to:\n // const _foo = foo(),\n // { a, ...b } = _foo;\n const initRef = path.scope.generateUidIdentifierBasedOnNode(\n originalPath.node.init,\n \"ref\",\n );\n // insert _foo = foo()\n originalPath.insertBefore(\n t.variableDeclarator(initRef, originalPath.node.init),\n );\n // replace foo() with _foo\n originalPath.replaceWith(\n t.variableDeclarator(originalPath.node.id, t.cloneNode(initRef)),\n );\n\n return;\n }\n\n let ref = originalPath.node.init;\n const refPropertyPath = [];\n let kind;\n\n path.findParent(path => {\n if (path.isObjectProperty()) {\n refPropertyPath.unshift(path);\n } else if (path.isVariableDeclarator()) {\n kind = path.parentPath.node.kind;\n return true;\n }\n });\n\n const impureObjRefComputedDeclarators = replaceImpureComputedKeys(\n refPropertyPath,\n path.scope,\n );\n refPropertyPath.forEach(prop => {\n const { node } = prop;\n ref = t.memberExpression(ref, t.cloneNode(node.key), node.computed);\n });\n\n const objectPatternPath = path.findParent(path =>\n path.isObjectPattern(),\n );\n\n const [\n impureComputedPropertyDeclarators,\n argument,\n callExpression,\n ] = createObjectSpread(objectPatternPath, file, ref);\n\n if (loose) {\n removeUnusedExcludedKeys(objectPatternPath);\n }\n\n t.assertIdentifier(argument);\n\n insertionPath.insertBefore(impureComputedPropertyDeclarators);\n\n insertionPath.insertBefore(impureObjRefComputedDeclarators);\n\n insertionPath.insertAfter(\n t.variableDeclarator(argument, callExpression),\n );\n\n insertionPath = insertionPath.getSibling(insertionPath.key + 1);\n\n path.scope.registerBinding(kind, insertionPath);\n\n if (objectPatternPath.node.properties.length === 0) {\n objectPatternPath\n .findParent(\n path => path.isObjectProperty() || path.isVariableDeclarator(),\n )\n .remove();\n }\n });\n },\n // taken from transform-destructuring/src/index.js#visitor\n // export var { a, ...b } = c;\n ExportNamedDeclaration(path) {\n const declaration = path.get(\"declaration\");\n if (!declaration.isVariableDeclaration()) return;\n\n const hasRest = declaration\n .get(\"declarations\")\n .some(path => hasRestElement(path.get(\"id\")));\n if (!hasRest) return;\n\n const specifiers = [];\n\n for (const name of Object.keys(path.getOuterBindingIdentifiers(path))) {\n specifiers.push(\n t.exportSpecifier(t.identifier(name), t.identifier(name)),\n );\n }\n\n // Split the declaration and export list into two declarations so that the variable\n // declaration can be split up later without needing to worry about not being a\n // top-level statement.\n path.replaceWith(declaration.node);\n path.insertAfter(t.exportNamedDeclaration(null, specifiers));\n },\n // try {} catch ({a, ...b}) {}\n CatchClause(path) {\n const paramPath = path.get(\"param\");\n replaceRestElement(paramPath.parentPath, paramPath);\n },\n // ({a, ...b} = c);\n AssignmentExpression(path, file) {\n const leftPath = path.get(\"left\");\n if (leftPath.isObjectPattern() && hasRestElement(leftPath)) {\n const nodes = [];\n\n const refName = path.scope.generateUidBasedOnNode(\n path.node.right,\n \"ref\",\n );\n\n nodes.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(refName), path.node.right),\n ]),\n );\n\n const [\n impureComputedPropertyDeclarators,\n argument,\n callExpression,\n ] = createObjectSpread(leftPath, file, t.identifier(refName));\n\n if (impureComputedPropertyDeclarators.length > 0) {\n nodes.push(\n t.variableDeclaration(\"var\", impureComputedPropertyDeclarators),\n );\n }\n\n const nodeWithoutSpread = t.cloneNode(path.node);\n nodeWithoutSpread.right = t.identifier(refName);\n nodes.push(t.expressionStatement(nodeWithoutSpread));\n nodes.push(\n t.toStatement(\n t.assignmentExpression(\"=\", argument, callExpression),\n ),\n );\n nodes.push(t.expressionStatement(t.identifier(refName)));\n\n path.replaceWithMultiple(nodes);\n }\n },\n // taken from transform-destructuring/src/index.js#visitor\n ForXStatement(path) {\n const { node, scope } = path;\n const leftPath = path.get(\"left\");\n const left = node.left;\n\n if (!hasObjectPatternRestElement(leftPath)) {\n return;\n }\n\n if (!t.isVariableDeclaration(left)) {\n // for ({a, ...b} of []) {}\n const temp = scope.generateUidIdentifier(\"ref\");\n\n node.left = t.variableDeclaration(\"var\", [\n t.variableDeclarator(temp),\n ]);\n\n path.ensureBlock();\n\n if (node.body.body.length === 0 && path.isCompletionRecord()) {\n node.body.body.unshift(\n t.expressionStatement(scope.buildUndefinedNode()),\n );\n }\n\n node.body.body.unshift(\n t.expressionStatement(\n t.assignmentExpression(\"=\", left, t.cloneNode(temp)),\n ),\n );\n } else {\n // for (var {a, ...b} of []) {}\n const pattern = left.declarations[0].id;\n\n const key = scope.generateUidIdentifier(\"ref\");\n node.left = t.variableDeclaration(left.kind, [\n t.variableDeclarator(key, null),\n ]);\n\n path.ensureBlock();\n\n node.body.body.unshift(\n t.variableDeclaration(node.left.kind, [\n t.variableDeclarator(pattern, t.cloneNode(key)),\n ]),\n );\n }\n },\n // [{a, ...b}] = c;\n ArrayPattern(path) {\n const objectPatterns = [];\n\n visitRestElements(path, path => {\n if (!path.parentPath.isObjectPattern()) {\n // Return early if the parent is not an ObjectPattern, but\n // (for example) an ArrayPattern or Function, because that\n // means this RestElement is an not an object property.\n return;\n }\n\n const objectPattern = path.parentPath;\n\n const uid = path.scope.generateUidIdentifier(\"ref\");\n objectPatterns.push(t.variableDeclarator(objectPattern.node, uid));\n\n objectPattern.replaceWith(t.cloneNode(uid));\n path.skip();\n });\n\n if (objectPatterns.length > 0) {\n const statementPath = path.getStatementParent();\n statementPath.insertAfter(\n t.variableDeclaration(\n statementPath.node.kind || \"var\",\n objectPatterns,\n ),\n );\n }\n },\n // var a = { ...b, ...c }\n ObjectExpression(path, file) {\n if (!hasSpread(path.node)) return;\n\n const args = [];\n let props = [];\n\n function push() {\n args.push(t.objectExpression(props));\n props = [];\n }\n\n for (const prop of (path.node.properties: Array)) {\n if (t.isSpreadElement(prop)) {\n push();\n args.push(prop.argument);\n } else {\n props.push(prop);\n }\n }\n\n if (props.length) {\n push();\n }\n\n let helper;\n if (loose) {\n helper = getExtendsHelper(file);\n } else {\n try {\n helper = file.addHelper(\"objectSpread2\");\n } catch {\n // TODO: This is needed to workaround https://github.com/babel/babel/issues/10187\n // and https://github.com/babel/babel/issues/10179 for older @babel/core versions\n // where #10187 isn't fixed.\n this.file.declarations[\"objectSpread2\"] = null;\n\n // objectSpread2 has been introduced in v7.5.0\n // We have to maintain backward compatibility.\n helper = file.addHelper(\"objectSpread\");\n }\n }\n\n path.replaceWith(t.callExpression(helper, args));\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxOptionalCatchBinding from \"@babel/plugin-syntax-optional-catch-binding\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-optional-catch-binding\",\n inherits: syntaxOptionalCatchBinding,\n\n visitor: {\n CatchClause(path) {\n if (!path.node.param) {\n const uid = path.scope.generateUidIdentifier(\"unused\");\n const paramPath = path.get(\"param\");\n paramPath.replaceWith(uid);\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-optional-chaining\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"optionalChaining\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxOptionalChaining from \"@babel/plugin-syntax-optional-chaining\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose = false } = options;\n\n return {\n name: \"proposal-optional-chaining\",\n inherits: syntaxOptionalChaining,\n\n visitor: {\n \"OptionalCallExpression|OptionalMemberExpression\"(path) {\n const { parentPath, scope } = path;\n let isDeleteOperation = false;\n const optionals = [];\n\n let optionalPath = path;\n while (\n optionalPath.isOptionalMemberExpression() ||\n optionalPath.isOptionalCallExpression()\n ) {\n const { node } = optionalPath;\n if (node.optional) {\n optionals.push(node);\n }\n\n if (optionalPath.isOptionalMemberExpression()) {\n optionalPath.node.type = \"MemberExpression\";\n optionalPath = optionalPath.get(\"object\");\n } else if (optionalPath.isOptionalCallExpression()) {\n optionalPath.node.type = \"CallExpression\";\n optionalPath = optionalPath.get(\"callee\");\n }\n }\n\n let replacementPath = path;\n if (parentPath.isUnaryExpression({ operator: \"delete\" })) {\n replacementPath = parentPath;\n isDeleteOperation = true;\n }\n for (let i = optionals.length - 1; i >= 0; i--) {\n const node = optionals[i];\n\n const isCall = t.isCallExpression(node);\n const replaceKey = isCall ? \"callee\" : \"object\";\n const chain = node[replaceKey];\n\n let ref;\n let check;\n if (loose && isCall) {\n // If we are using a loose transform (avoiding a Function#call) and we are at the call,\n // we can avoid a needless memoize.\n check = ref = chain;\n } else {\n ref = scope.maybeGenerateMemoised(chain);\n if (ref) {\n check = t.assignmentExpression(\n \"=\",\n t.cloneNode(ref),\n // Here `chain` MUST NOT be cloned because it could be updated\n // when generating the memoised context of a call espression\n chain,\n );\n node[replaceKey] = ref;\n } else {\n check = ref = chain;\n }\n }\n\n // Ensure call expressions have the proper `this`\n // `foo.bar()` has context `foo`.\n if (isCall && t.isMemberExpression(chain)) {\n if (loose) {\n // To avoid a Function#call, we can instead re-grab the property from the context object.\n // `a.?b.?()` translates roughly to `_a.b != null && _a.b()`\n node.callee = chain;\n } else {\n // Otherwise, we need to memoize the context object, and change the call into a Function#call.\n // `a.?b.?()` translates roughly to `(_b = _a.b) != null && _b.call(_a)`\n const { object } = chain;\n let context = scope.maybeGenerateMemoised(object);\n if (context) {\n chain.object = t.assignmentExpression(\"=\", context, object);\n } else if (t.isSuper(object)) {\n context = t.thisExpression();\n } else {\n context = object;\n }\n\n node.arguments.unshift(t.cloneNode(context));\n node.callee = t.memberExpression(\n node.callee,\n t.identifier(\"call\"),\n );\n }\n }\n\n replacementPath.replaceWith(\n t.conditionalExpression(\n loose\n ? t.binaryExpression(\"==\", t.cloneNode(check), t.nullLiteral())\n : t.logicalExpression(\n \"||\",\n t.binaryExpression(\n \"===\",\n t.cloneNode(check),\n t.nullLiteral(),\n ),\n t.binaryExpression(\n \"===\",\n t.cloneNode(ref),\n scope.buildUndefinedNode(),\n ),\n ),\n isDeleteOperation\n ? t.booleanLiteral(true)\n : scope.buildUndefinedNode(),\n replacementPath.node,\n ),\n );\n\n replacementPath = replacementPath.get(\"alternate\");\n }\n },\n },\n };\n});\n","import { types as t } from \"@babel/core\";\n\n// tries to optimize sequence expressions in the format\n// (a = b, ((c) => d + e)(a))\n// to\n// (a = b, a + e)\nconst buildOptimizedSequenceExpression = ({ assign, call, path }) => {\n const { left: placeholderNode, right: pipelineLeft } = assign;\n const { callee: calledExpression } = call;\n\n let optimizeArrow =\n t.isArrowFunctionExpression(calledExpression) &&\n t.isExpression(calledExpression.body) &&\n !calledExpression.async &&\n !calledExpression.generator;\n let param;\n\n if (optimizeArrow) {\n const { params } = calledExpression;\n if (params.length === 1 && t.isIdentifier(params[0])) {\n param = params[0];\n } else if (params.length > 0) {\n optimizeArrow = false;\n }\n } else if (t.isIdentifier(calledExpression, { name: \"eval\" })) {\n const evalSequence = t.sequenceExpression([\n t.numericLiteral(0),\n calledExpression,\n ]);\n\n call.callee = evalSequence;\n\n path.scope.push({ id: placeholderNode });\n\n return t.sequenceExpression([assign, call]);\n }\n\n if (optimizeArrow && !param) {\n // Arrow function with 0 arguments\n return t.sequenceExpression([pipelineLeft, calledExpression.body]);\n }\n\n path.scope.push({ id: placeholderNode });\n\n if (param) {\n path.get(\"right\").scope.rename(param.name, placeholderNode.name);\n\n return t.sequenceExpression([assign, calledExpression.body]);\n }\n\n return t.sequenceExpression([assign, call]);\n};\n\nexport default buildOptimizedSequenceExpression;\n","import { types as t } from \"@babel/core\";\nimport buildOptimizedSequenceExpression from \"./buildOptimizedSequenceExpression\";\n\nconst minimalVisitor = {\n BinaryExpression(path) {\n const { scope, node } = path;\n const { operator, left, right } = node;\n if (operator !== \"|>\") return;\n\n const placeholder = scope.generateUidIdentifierBasedOnNode(left);\n\n const call = t.callExpression(right, [t.cloneNode(placeholder)]);\n path.replaceWith(\n buildOptimizedSequenceExpression({\n assign: t.assignmentExpression(\"=\", t.cloneNode(placeholder), left),\n call,\n path,\n }),\n );\n },\n};\n\nexport default minimalVisitor;\n","import { types as t } from \"@babel/core\";\n\nconst updateTopicReferenceVisitor = {\n PipelinePrimaryTopicReference(path) {\n path.replaceWith(this.topicId);\n },\n PipelineTopicExpression(path) {\n path.skip();\n },\n};\n\nconst smartVisitor = {\n BinaryExpression(path) {\n const { scope } = path;\n const { node } = path;\n const { operator, left, right } = node;\n if (operator !== \"|>\") return;\n\n const placeholder = scope.generateUidIdentifierBasedOnNode(left);\n scope.push({ id: placeholder });\n\n let call;\n if (t.isPipelineTopicExpression(right)) {\n path\n .get(\"right\")\n .traverse(updateTopicReferenceVisitor, { topicId: placeholder });\n\n call = right.expression;\n } else {\n // PipelineBareFunction\n let callee = right.callee;\n if (t.isIdentifier(callee, { name: \"eval\" })) {\n callee = t.sequenceExpression([t.numericLiteral(0), callee]);\n }\n\n call = t.callExpression(callee, [t.cloneNode(placeholder)]);\n }\n\n path.replaceWith(\n t.sequenceExpression([\n t.assignmentExpression(\"=\", t.cloneNode(placeholder), left),\n call,\n ]),\n );\n },\n};\n\nexport default smartVisitor;\n","import { types as t } from \"@babel/core\";\nimport buildOptimizedSequenceExpression from \"./buildOptimizedSequenceExpression\";\n\nconst fsharpVisitor = {\n BinaryExpression(path) {\n const { scope, node } = path;\n const { operator, left, right } = node;\n if (operator !== \"|>\") return;\n\n const placeholder = scope.generateUidIdentifierBasedOnNode(left);\n\n const call =\n right.type === \"AwaitExpression\"\n ? t.awaitExpression(t.cloneNode(placeholder))\n : t.callExpression(right, [t.cloneNode(placeholder)]);\n const sequence = buildOptimizedSequenceExpression({\n assign: t.assignmentExpression(\"=\", t.cloneNode(placeholder), left),\n call,\n path,\n });\n path.replaceWith(sequence);\n },\n};\n\nexport default fsharpVisitor;\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxPipelineOperator from \"@babel/plugin-syntax-pipeline-operator\";\nimport minimalVisitor from \"./minimalVisitor\";\nimport smartVisitor from \"./smartVisitor\";\nimport fsharpVisitor from \"./fsharpVisitor\";\n\nconst visitorsPerProposal = {\n minimal: minimalVisitor,\n smart: smartVisitor,\n fsharp: fsharpVisitor,\n};\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-pipeline-operator\",\n inherits: syntaxPipelineOperator,\n visitor: visitorsPerProposal[options.proposal],\n };\n});\n","/* eslint-disable @babel/development/plugin-name */\n\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport {\n createClassFeaturePlugin,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n return createClassFeaturePlugin({\n name: \"proposal-private-methods\",\n\n feature: FEATURES.privateMethods,\n loose: options.loose,\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"classPrivateMethods\");\n },\n });\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-throw-expressions\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"throwExpressions\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxThrowExpressions from \"@babel/plugin-syntax-throw-expressions\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-throw-expressions\",\n inherits: syntaxThrowExpressions,\n\n visitor: {\n UnaryExpression(path) {\n const { operator, argument } = path.node;\n if (operator !== \"throw\") return;\n\n const arrow = t.functionExpression(\n null,\n [t.identifier(\"e\")],\n t.blockStatement([t.throwStatement(t.identifier(\"e\"))]),\n );\n\n path.replaceWith(t.callExpression(arrow, [argument]));\n },\n },\n };\n});\n","/*!\n * regjsgen 0.5.1\n * Copyright 2014-2019 Benjamin Tan \n * Available under MIT license \n */\n;(function() {\n 'use strict';\n\n // Used to determine if values are of the language type `Object`.\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n // Used as a reference to the global object.\n var root = (objectTypes[typeof window] && window) || this;\n\n // Detect free variable `exports`.\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n // Detect free variable `module`.\n var hasFreeModule = objectTypes[typeof module] && module && !module.nodeType;\n\n // Detect free variable `global` from Node.js or Browserified code and use it as `root`.\n var freeGlobal = freeExports && hasFreeModule && typeof global == 'object' && global;\n if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {\n root = freeGlobal;\n }\n\n // Used to check objects for own properties.\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n /*--------------------------------------------------------------------------*/\n\n // Generates a string based on the given code point.\n // Based on https://mths.be/fromcodepoint by @mathias.\n function fromCodePoint() {\n var codePoint = Number(arguments[0]);\n\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n Math.floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n\n if (codePoint <= 0xFFFF) {\n // BMP code point\n return String.fromCharCode(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n var highSurrogate = (codePoint >> 10) + 0xD800;\n var lowSurrogate = (codePoint % 0x400) + 0xDC00;\n return String.fromCharCode(highSurrogate, lowSurrogate);\n }\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Ensures that nodes have the correct types.\n var assertTypeRegexMap = {};\n function assertType(type, expected) {\n if (expected.indexOf('|') == -1) {\n if (type == expected) {\n return;\n }\n\n throw Error('Invalid node type: ' + type + '; expected type: ' + expected);\n }\n\n expected = hasOwnProperty.call(assertTypeRegexMap, expected)\n ? assertTypeRegexMap[expected]\n : (assertTypeRegexMap[expected] = RegExp('^(?:' + expected + ')$'));\n\n if (expected.test(type)) {\n return;\n }\n\n throw Error('Invalid node type: ' + type + '; expected types: ' + expected);\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Generates a regular expression string based on an AST.\n function generate(node) {\n var type = node.type;\n\n if (hasOwnProperty.call(generators, type)) {\n return generators[type](node);\n }\n\n throw Error('Invalid node type: ' + type);\n }\n\n /*--------------------------------------------------------------------------*/\n\n function generateAlternative(node) {\n assertType(node.type, 'alternative');\n\n var terms = node.body,\n i = -1,\n length = terms.length,\n result = '';\n\n while (++i < length) {\n result += generateTerm(terms[i]);\n }\n\n return result;\n }\n\n function generateAnchor(node) {\n assertType(node.type, 'anchor');\n\n switch (node.kind) {\n case 'start':\n return '^';\n case 'end':\n return '$';\n case 'boundary':\n return '\\\\b';\n case 'not-boundary':\n return '\\\\B';\n default:\n throw Error('Invalid assertion');\n }\n }\n\n function generateAtom(node) {\n assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value');\n\n return generate(node);\n }\n\n function generateCharacterClass(node) {\n assertType(node.type, 'characterClass');\n\n var classRanges = node.body,\n i = -1,\n length = classRanges.length,\n result = '';\n\n if (node.negative) {\n result += '^';\n }\n\n while (++i < length) {\n result += generateClassAtom(classRanges[i]);\n }\n\n return '[' + result + ']';\n }\n\n function generateCharacterClassEscape(node) {\n assertType(node.type, 'characterClassEscape');\n\n return '\\\\' + node.value;\n }\n\n function generateUnicodePropertyEscape(node) {\n assertType(node.type, 'unicodePropertyEscape');\n\n return '\\\\' + (node.negative ? 'P' : 'p') + '{' + node.value + '}';\n }\n\n function generateCharacterClassRange(node) {\n assertType(node.type, 'characterClassRange');\n\n var min = node.min,\n max = node.max;\n\n if (min.type == 'characterClassRange' || max.type == 'characterClassRange') {\n throw Error('Invalid character class range');\n }\n\n return generateClassAtom(min) + '-' + generateClassAtom(max);\n }\n\n function generateClassAtom(node) {\n assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value');\n\n return generate(node);\n }\n\n function generateDisjunction(node) {\n assertType(node.type, 'disjunction');\n\n var body = node.body,\n i = -1,\n length = body.length,\n result = '';\n\n while (++i < length) {\n if (i != 0) {\n result += '|';\n }\n result += generate(body[i]);\n }\n\n return result;\n }\n\n function generateDot(node) {\n assertType(node.type, 'dot');\n\n return '.';\n }\n\n function generateGroup(node) {\n assertType(node.type, 'group');\n\n var result = '';\n\n switch (node.behavior) {\n case 'normal':\n if (node.name) {\n result += '?<' + generateIdentifier(node.name) + '>';\n }\n break;\n case 'ignore':\n result += '?:';\n break;\n case 'lookahead':\n result += '?=';\n break;\n case 'negativeLookahead':\n result += '?!';\n break;\n case 'lookbehind':\n result += '?<=';\n break;\n case 'negativeLookbehind':\n result += '?';\n }\n\n throw new Error('Unknown reference type');\n }\n\n function generateTerm(node) {\n assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|unicodePropertyEscape|value|dot');\n\n return generate(node);\n }\n\n function generateValue(node) {\n assertType(node.type, 'value');\n\n var kind = node.kind,\n codePoint = node.codePoint;\n\n if (typeof codePoint != 'number') {\n throw new Error('Invalid code point: ' + codePoint);\n }\n\n switch (kind) {\n case 'controlLetter':\n return '\\\\c' + fromCodePoint(codePoint + 64);\n case 'hexadecimalEscape':\n return '\\\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2);\n case 'identifier':\n return '\\\\' + fromCodePoint(codePoint);\n case 'null':\n return '\\\\' + codePoint;\n case 'octal':\n return '\\\\' + codePoint.toString(8);\n case 'singleEscape':\n switch (codePoint) {\n case 0x0008:\n return '\\\\b';\n case 0x0009:\n return '\\\\t';\n case 0x000A:\n return '\\\\n';\n case 0x000B:\n return '\\\\v';\n case 0x000C:\n return '\\\\f';\n case 0x000D:\n return '\\\\r';\n default:\n throw Error('Invalid code point: ' + codePoint);\n }\n case 'symbol':\n return fromCodePoint(codePoint);\n case 'unicodeEscape':\n return '\\\\u' + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4);\n case 'unicodeCodePointEscape':\n return '\\\\u{' + codePoint.toString(16).toUpperCase() + '}';\n default:\n throw Error('Unsupported node kind: ' + kind);\n }\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Used to generate strings for each node type.\n var generators = {\n 'alternative': generateAlternative,\n 'anchor': generateAnchor,\n 'characterClass': generateCharacterClass,\n 'characterClassEscape': generateCharacterClassEscape,\n 'characterClassRange': generateCharacterClassRange,\n 'unicodePropertyEscape': generateUnicodePropertyEscape,\n 'disjunction': generateDisjunction,\n 'dot': generateDot,\n 'group': generateGroup,\n 'quantifier': generateQuantifier,\n 'reference': generateReference,\n 'value': generateValue\n };\n\n /*--------------------------------------------------------------------------*/\n\n // Export regjsgen.\n var regjsgen = {\n 'generate': generate\n };\n\n // Some AMD build optimizers, like r.js, check for condition patterns like the following:\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n // Define as an anonymous module so it can be aliased through path mapping.\n define(function() {\n return regjsgen;\n });\n\n root.regjsgen = regjsgen;\n }\n // Check for `exports` after `define` in case a build optimizer adds an `exports` object.\n else if (freeExports && hasFreeModule) {\n // Export for CommonJS support.\n freeExports.generate = generate;\n }\n else {\n // Export to the global object.\n root.regjsgen = regjsgen;\n }\n}.call(this));\n","// regjsparser\n//\n// ==================================================================\n//\n// See ECMA-262 Standard: 15.10.1\n//\n// NOTE: The ECMA-262 standard uses the term \"Assertion\" for /^/. Here the\n// term \"Anchor\" is used.\n//\n// Pattern ::\n// Disjunction\n//\n// Disjunction ::\n// Alternative\n// Alternative | Disjunction\n//\n// Alternative ::\n// [empty]\n// Alternative Term\n//\n// Term ::\n// Anchor\n// Atom\n// Atom Quantifier\n//\n// Anchor ::\n// ^\n// $\n// \\ b\n// \\ B\n// ( ? = Disjunction )\n// ( ? ! Disjunction )\n// ( ? < = Disjunction )\n// ( ? < ! Disjunction )\n//\n// Quantifier ::\n// QuantifierPrefix\n// QuantifierPrefix ?\n//\n// QuantifierPrefix ::\n// *\n// +\n// ?\n// { DecimalDigits }\n// { DecimalDigits , }\n// { DecimalDigits , DecimalDigits }\n//\n// Atom ::\n// PatternCharacter\n// .\n// \\ AtomEscape\n// CharacterClass\n// ( GroupSpecifier Disjunction )\n// ( ? : Disjunction )\n//\n// PatternCharacter ::\n// SourceCharacter but not any of: ^ $ \\ . * + ? ( ) [ ] { } |\n//\n// AtomEscape ::\n// DecimalEscape\n// CharacterEscape\n// CharacterClassEscape\n// k GroupName\n//\n// CharacterEscape[U] ::\n// ControlEscape\n// c ControlLetter\n// HexEscapeSequence\n// RegExpUnicodeEscapeSequence[?U] (ES6)\n// IdentityEscape[?U]\n//\n// ControlEscape ::\n// one of f n r t v\n// ControlLetter ::\n// one of\n// a b c d e f g h i j k l m n o p q r s t u v w x y z\n// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\n//\n// IdentityEscape ::\n// SourceCharacter but not c\n//\n// DecimalEscape ::\n// DecimalIntegerLiteral [lookahead ∉ DecimalDigit]\n//\n// CharacterClassEscape ::\n// one of d D s S w W\n//\n// CharacterClass ::\n// [ [lookahead ∉ {^}] ClassRanges ]\n// [ ^ ClassRanges ]\n//\n// ClassRanges ::\n// [empty]\n// NonemptyClassRanges\n//\n// NonemptyClassRanges ::\n// ClassAtom\n// ClassAtom NonemptyClassRangesNoDash\n// ClassAtom - ClassAtom ClassRanges\n//\n// NonemptyClassRangesNoDash ::\n// ClassAtom\n// ClassAtomNoDash NonemptyClassRangesNoDash\n// ClassAtomNoDash - ClassAtom ClassRanges\n//\n// ClassAtom ::\n// -\n// ClassAtomNoDash\n//\n// ClassAtomNoDash ::\n// SourceCharacter but not one of \\ or ] or -\n// \\ ClassEscape\n//\n// ClassEscape ::\n// DecimalEscape\n// b\n// CharacterEscape\n// CharacterClassEscape\n//\n// GroupSpecifier ::\n// [empty]\n// ? GroupName\n//\n// GroupName ::\n// < RegExpIdentifierName >\n//\n// RegExpIdentifierName ::\n// RegExpIdentifierStart\n// RegExpIdentifierName RegExpIdentifierContinue\n//\n// RegExpIdentifierStart ::\n// UnicodeIDStart\n// $\n// _\n// \\ RegExpUnicodeEscapeSequence\n//\n// RegExpIdentifierContinue ::\n// UnicodeIDContinue\n// $\n// _\n// \\ RegExpUnicodeEscapeSequence\n// \n// \n\n(function() {\n\n var fromCodePoint = String.fromCodePoint || (function() {\n // Implementation taken from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint\n\n var stringFromCharCode = String.fromCharCode;\n var floor = Math.floor;\n\n return function fromCodePoint() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n if (!length) {\n return '';\n }\n var result = '';\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n if (codePoint <= 0xFFFF) { // BMP code point\n codeUnits.push(codePoint);\n } else { // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xD800;\n lowSurrogate = (codePoint % 0x400) + 0xDC00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n result += stringFromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n }());\n\n function parse(str, flags, features) {\n if (!features) {\n features = {};\n }\n function addRaw(node) {\n node.raw = str.substring(node.range[0], node.range[1]);\n return node;\n }\n\n function updateRawStart(node, start) {\n node.range[0] = start;\n return addRaw(node);\n }\n\n function createAnchor(kind, rawLength) {\n return addRaw({\n type: 'anchor',\n kind: kind,\n range: [\n pos - rawLength,\n pos\n ]\n });\n }\n\n function createValue(kind, codePoint, from, to) {\n return addRaw({\n type: 'value',\n kind: kind,\n codePoint: codePoint,\n range: [from, to]\n });\n }\n\n function createEscaped(kind, codePoint, value, fromOffset) {\n fromOffset = fromOffset || 0;\n return createValue(kind, codePoint, pos - (value.length + fromOffset), pos);\n }\n\n function createCharacter(matches) {\n var _char = matches[0];\n var first = _char.charCodeAt(0);\n if (hasUnicodeFlag) {\n var second;\n if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) {\n second = lookahead().charCodeAt(0);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // Unicode surrogate pair\n pos++;\n return createValue(\n 'symbol',\n (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000,\n pos - 2, pos);\n }\n }\n }\n return createValue('symbol', first, pos - 1, pos);\n }\n\n function createDisjunction(alternatives, from, to) {\n return addRaw({\n type: 'disjunction',\n body: alternatives,\n range: [\n from,\n to\n ]\n });\n }\n\n function createDot() {\n return addRaw({\n type: 'dot',\n range: [\n pos - 1,\n pos\n ]\n });\n }\n\n function createCharacterClassEscape(value) {\n return addRaw({\n type: 'characterClassEscape',\n value: value,\n range: [\n pos - 2,\n pos\n ]\n });\n }\n\n function createReference(matchIndex) {\n return addRaw({\n type: 'reference',\n matchIndex: parseInt(matchIndex, 10),\n range: [\n pos - 1 - matchIndex.length,\n pos\n ]\n });\n }\n\n function createNamedReference(name) {\n return addRaw({\n type: 'reference',\n name: name,\n range: [\n name.range[0] - 3,\n pos\n ]\n });\n }\n\n function createGroup(behavior, disjunction, from, to) {\n return addRaw({\n type: 'group',\n behavior: behavior,\n body: disjunction,\n range: [\n from,\n to\n ]\n });\n }\n\n function createQuantifier(min, max, from, to) {\n if (to == null) {\n from = pos - 1;\n to = pos;\n }\n\n return addRaw({\n type: 'quantifier',\n min: min,\n max: max,\n greedy: true,\n body: null, // set later on\n range: [\n from,\n to\n ]\n });\n }\n\n function createAlternative(terms, from, to) {\n return addRaw({\n type: 'alternative',\n body: terms,\n range: [\n from,\n to\n ]\n });\n }\n\n function createCharacterClass(classRanges, negative, from, to) {\n return addRaw({\n type: 'characterClass',\n body: classRanges,\n negative: negative,\n range: [\n from,\n to\n ]\n });\n }\n\n function createClassRange(min, max, from, to) {\n // See 15.10.2.15:\n if (min.codePoint > max.codePoint) {\n bail('invalid range in character class', min.raw + '-' + max.raw, from, to);\n }\n\n return addRaw({\n type: 'characterClassRange',\n min: min,\n max: max,\n range: [\n from,\n to\n ]\n });\n }\n\n function flattenBody(body) {\n if (body.type === 'alternative') {\n return body.body;\n } else {\n return [body];\n }\n }\n\n function isEmpty(obj) {\n return obj.type === 'empty';\n }\n\n function incr(amount) {\n amount = (amount || 1);\n var res = str.substring(pos, pos + amount);\n pos += (amount || 1);\n return res;\n }\n\n function skip(value) {\n if (!match(value)) {\n bail('character', value);\n }\n }\n\n function match(value) {\n if (str.indexOf(value, pos) === pos) {\n return incr(value.length);\n }\n }\n\n function lookahead() {\n return str[pos];\n }\n\n function current(value) {\n return str.indexOf(value, pos) === pos;\n }\n\n function next(value) {\n return str[pos + 1] === value;\n }\n\n function matchReg(regExp) {\n var subStr = str.substring(pos);\n var res = subStr.match(regExp);\n if (res) {\n res.range = [];\n res.range[0] = pos;\n incr(res[0].length);\n res.range[1] = pos;\n }\n return res;\n }\n\n function parseDisjunction() {\n // Disjunction ::\n // Alternative\n // Alternative | Disjunction\n var res = [], from = pos;\n res.push(parseAlternative());\n\n while (match('|')) {\n res.push(parseAlternative());\n }\n\n if (res.length === 1) {\n return res[0];\n }\n\n return createDisjunction(res, from, pos);\n }\n\n function parseAlternative() {\n var res = [], from = pos;\n var term;\n\n // Alternative ::\n // [empty]\n // Alternative Term\n while (term = parseTerm()) {\n res.push(term);\n }\n\n if (res.length === 1) {\n return res[0];\n }\n\n return createAlternative(res, from, pos);\n }\n\n function parseTerm() {\n // Term ::\n // Anchor\n // Atom\n // Atom Quantifier\n\n if (pos >= str.length || current('|') || current(')')) {\n return null; /* Means: The term is empty */\n }\n\n var anchor = parseAnchor();\n\n if (anchor) {\n return anchor;\n }\n\n var atom = parseAtom();\n if (!atom) {\n bail('Expected atom');\n }\n var quantifier = parseQuantifier() || false;\n if (quantifier) {\n quantifier.body = flattenBody(atom);\n // The quantifier contains the atom. Therefore, the beginning of the\n // quantifier range is given by the beginning of the atom.\n updateRawStart(quantifier, atom.range[0]);\n return quantifier;\n }\n return atom;\n }\n\n function parseGroup(matchA, typeA, matchB, typeB) {\n var type = null, from = pos;\n\n if (match(matchA)) {\n type = typeA;\n } else if (match(matchB)) {\n type = typeB;\n } else {\n return false;\n }\n\n return finishGroup(type, from);\n }\n\n function finishGroup(type, from) {\n var body = parseDisjunction();\n if (!body) {\n bail('Expected disjunction');\n }\n skip(')');\n var group = createGroup(type, flattenBody(body), from, pos);\n\n if (type == 'normal') {\n // Keep track of the number of closed groups. This is required for\n // parseDecimalEscape(). In case the string is parsed a second time the\n // value already holds the total count and no incrementation is required.\n if (firstIteration) {\n closedCaptureCounter++;\n }\n }\n return group;\n }\n\n function parseAnchor() {\n // Anchor ::\n // ^\n // $\n // \\ b\n // \\ B\n // ( ? = Disjunction )\n // ( ? ! Disjunction )\n var res, from = pos;\n\n if (match('^')) {\n return createAnchor('start', 1 /* rawLength */);\n } else if (match('$')) {\n return createAnchor('end', 1 /* rawLength */);\n } else if (match('\\\\b')) {\n return createAnchor('boundary', 2 /* rawLength */);\n } else if (match('\\\\B')) {\n return createAnchor('not-boundary', 2 /* rawLength */);\n } else {\n return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead');\n }\n }\n\n function parseQuantifier() {\n // Quantifier ::\n // QuantifierPrefix\n // QuantifierPrefix ?\n //\n // QuantifierPrefix ::\n // *\n // +\n // ?\n // { DecimalDigits }\n // { DecimalDigits , }\n // { DecimalDigits , DecimalDigits }\n\n var res, from = pos;\n var quantifier;\n var min, max;\n\n if (match('*')) {\n quantifier = createQuantifier(0);\n }\n else if (match('+')) {\n quantifier = createQuantifier(1);\n }\n else if (match('?')) {\n quantifier = createQuantifier(0, 1);\n }\n else if (res = matchReg(/^\\{([0-9]+)\\}/)) {\n min = parseInt(res[1], 10);\n quantifier = createQuantifier(min, min, res.range[0], res.range[1]);\n }\n else if (res = matchReg(/^\\{([0-9]+),\\}/)) {\n min = parseInt(res[1], 10);\n quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]);\n }\n else if (res = matchReg(/^\\{([0-9]+),([0-9]+)\\}/)) {\n min = parseInt(res[1], 10);\n max = parseInt(res[2], 10);\n if (min > max) {\n bail('numbers out of order in {} quantifier', '', from, pos);\n }\n quantifier = createQuantifier(min, max, res.range[0], res.range[1]);\n }\n\n if (quantifier) {\n if (match('?')) {\n quantifier.greedy = false;\n quantifier.range[1] += 1;\n }\n }\n\n return quantifier;\n }\n\n function parseAtom() {\n // Atom ::\n // PatternCharacter\n // .\n // \\ AtomEscape\n // CharacterClass\n // ( GroupSpecifier Disjunction )\n // ( ? : Disjunction )\n\n var res;\n\n // jviereck: allow ']', '}' here as well to be compatible with browser's\n // implementations: ']'.match(/]/);\n // if (res = matchReg(/^[^^$\\\\.*+?()[\\]{}|]/)) {\n if (res = matchReg(/^[^^$\\\\.*+?(){[|]/)) {\n // PatternCharacter\n return createCharacter(res);\n }\n else if (match('.')) {\n // .\n return createDot();\n }\n else if (match('\\\\')) {\n // \\ AtomEscape\n res = parseAtomEscape();\n if (!res) {\n if (!hasUnicodeFlag && lookahead() == 'c') {\n // B.1.4 ExtendedAtom\n // \\[lookahead = c]\n return createValue('symbol', 92, pos - 1, pos);\n }\n bail('atomEscape');\n }\n return res;\n }\n else if (res = parseCharacterClass()) {\n return res;\n }\n else if (features.lookbehind && (res = parseGroup('(?<=', 'lookbehind', '(?\");\n var group = finishGroup(\"normal\", name.range[0] - 3);\n group.name = name;\n return group;\n }\n else {\n // ( Disjunction )\n // ( ? : Disjunction )\n return parseGroup('(?:', 'ignore', '(', 'normal');\n }\n }\n\n function parseUnicodeSurrogatePairEscape(firstEscape) {\n if (hasUnicodeFlag) {\n var first, second;\n if (firstEscape.kind == 'unicodeEscape' &&\n (first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF &&\n current('\\\\') && next('u') ) {\n var prevPos = pos;\n pos++;\n var secondEscape = parseClassEscape();\n if (secondEscape.kind == 'unicodeEscape' &&\n (second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) {\n // Unicode surrogate pair\n firstEscape.range[1] = secondEscape.range[1];\n firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n firstEscape.type = 'value';\n firstEscape.kind = 'unicodeCodePointEscape';\n addRaw(firstEscape);\n }\n else {\n pos = prevPos;\n }\n }\n }\n return firstEscape;\n }\n\n function parseClassEscape() {\n return parseAtomEscape(true);\n }\n\n function parseAtomEscape(insideCharacterClass) {\n // AtomEscape ::\n // DecimalEscape\n // CharacterEscape\n // CharacterClassEscape\n // k GroupName\n\n var res, from = pos;\n\n res = parseDecimalEscape() || parseNamedReference();\n if (res) {\n return res;\n }\n\n // For ClassEscape\n if (insideCharacterClass) {\n // b\n if (match('b')) {\n // 15.10.2.19\n // The production ClassEscape :: b evaluates by returning the\n // CharSet containing the one character (Unicode value 0008).\n return createEscaped('singleEscape', 0x0008, '\\\\b');\n } else if (match('B')) {\n bail('\\\\B not possible inside of CharacterClass', '', from);\n } else if (!hasUnicodeFlag && (res = matchReg(/^c([0-9])/))) {\n // B.1.4\n // c ClassControlLetter\n return createEscaped('controlLetter', res[1] + 16, res[1], 2);\n }\n // [+U] -\n if (match('-') && hasUnicodeFlag) {\n return createEscaped('singleEscape', 0x002d, '\\\\-');\n }\n }\n\n res = parseCharacterEscape();\n\n return res;\n }\n\n\n function parseDecimalEscape() {\n // DecimalEscape ::\n // DecimalIntegerLiteral [lookahead ∉ DecimalDigit]\n // CharacterClassEscape :: one of d D s S w W\n\n var res, match;\n\n if (res = matchReg(/^(?!0)\\d+/)) {\n match = res[0];\n var refIdx = parseInt(res[0], 10);\n if (refIdx <= closedCaptureCounter) {\n // If the number is smaller than the normal-groups found so\n // far, then it is a reference...\n return createReference(res[0]);\n } else {\n // ... otherwise it needs to be interpreted as a octal (if the\n // number is in an octal format). If it is NOT octal format,\n // then the slash is ignored and the number is matched later\n // as normal characters.\n\n // Recall the negative decision to decide if the input must be parsed\n // a second time with the total normal-groups.\n backrefDenied.push(refIdx);\n\n // Reset the position again, as maybe only parts of the previous\n // matched numbers are actual octal numbers. E.g. in '019' only\n // the '01' should be matched.\n incr(-res[0].length);\n if (res = matchReg(/^[0-7]{1,3}/)) {\n return createEscaped('octal', parseInt(res[0], 8), res[0], 1);\n } else {\n // If we end up here, we have a case like /\\91/. Then the\n // first slash is to be ignored and the 9 & 1 to be treated\n // like ordinary characters. Create a character for the\n // first number only here - other number-characters\n // (if available) will be matched later.\n res = createCharacter(matchReg(/^[89]/));\n return updateRawStart(res, res.range[0] - 1);\n }\n }\n }\n // Only allow octal numbers in the following. All matched numbers start\n // with a zero (if the do not, the previous if-branch is executed).\n // If the number is not octal format and starts with zero (e.g. `091`)\n // then only the zeros `0` is treated here and the `91` are ordinary\n // characters.\n // Example:\n // /\\091/.exec('\\091')[0].length === 3\n else if (res = matchReg(/^[0-7]{1,3}/)) {\n match = res[0];\n if (/^0{1,3}$/.test(match)) {\n // If they are all zeros, then only take the first one.\n return createEscaped('null', 0x0000, '0', match.length + 1);\n } else {\n return createEscaped('octal', parseInt(match, 8), match, 1);\n }\n } else if (res = matchReg(/^[dDsSwW]/)) {\n return createCharacterClassEscape(res[0]);\n }\n return false;\n }\n\n function parseNamedReference() {\n if (features.namedGroups && matchReg(/^k<(?=.*?>)/)) {\n var name = parseIdentifier();\n skip('>');\n return createNamedReference(name);\n }\n }\n\n function parseRegExpUnicodeEscapeSequence() {\n var res;\n if (res = matchReg(/^u([0-9a-fA-F]{4})/)) {\n // UnicodeEscapeSequence\n return parseUnicodeSurrogatePairEscape(\n createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2)\n );\n } else if (hasUnicodeFlag && (res = matchReg(/^u\\{([0-9a-fA-F]+)\\}/))) {\n // RegExpUnicodeEscapeSequence (ES6 Unicode code point escape)\n return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4);\n }\n }\n\n function parseCharacterEscape() {\n // CharacterEscape ::\n // ControlEscape\n // c ControlLetter\n // HexEscapeSequence\n // UnicodeEscapeSequence\n // IdentityEscape\n\n var res;\n var from = pos;\n if (res = matchReg(/^[fnrtv]/)) {\n // ControlEscape\n var codePoint = 0;\n switch (res[0]) {\n case 't': codePoint = 0x009; break;\n case 'n': codePoint = 0x00A; break;\n case 'v': codePoint = 0x00B; break;\n case 'f': codePoint = 0x00C; break;\n case 'r': codePoint = 0x00D; break;\n }\n return createEscaped('singleEscape', codePoint, '\\\\' + res[0]);\n } else if (res = matchReg(/^c([a-zA-Z])/)) {\n // c ControlLetter\n return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2);\n } else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) {\n // HexEscapeSequence\n return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2);\n } else if (res = parseRegExpUnicodeEscapeSequence()) {\n if (!res || res.codePoint > 0x10FFFF) {\n bail('Invalid escape sequence', null, from, pos);\n }\n return res;\n } else if (features.unicodePropertyEscape && hasUnicodeFlag && (res = matchReg(/^([pP])\\{([^\\}]+)\\}/))) {\n // https://github.com/jviereck/regjsparser/issues/77\n return addRaw({\n type: 'unicodePropertyEscape',\n negative: res[1] === 'P',\n value: res[2],\n range: [res.range[0] - 1, res.range[1]],\n raw: res[0]\n });\n } else {\n // IdentityEscape\n return parseIdentityEscape();\n }\n }\n\n function parseIdentifierAtom(check) {\n var ch = lookahead();\n var from = pos;\n if (ch === '\\\\') {\n incr();\n var esc = parseRegExpUnicodeEscapeSequence();\n if (!esc || !check(esc.codePoint)) {\n bail('Invalid escape sequence', null, from, pos);\n }\n return fromCodePoint(esc.codePoint);\n }\n var code = ch.charCodeAt(0);\n if (code >= 0xD800 && code <= 0xDBFF) {\n ch += str[pos + 1];\n var second = ch.charCodeAt(1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // Unicode surrogate pair\n code = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n if (!check(code)) return;\n incr();\n if (code > 0xFFFF) incr();\n return ch;\n }\n\n function parseIdentifier() {\n // RegExpIdentifierName ::\n // RegExpIdentifierStart\n // RegExpIdentifierName RegExpIdentifierContinue\n //\n // RegExpIdentifierStart ::\n // UnicodeIDStart\n // $\n // _\n // \\ RegExpUnicodeEscapeSequence\n //\n // RegExpIdentifierContinue ::\n // UnicodeIDContinue\n // $\n // _\n // \\ RegExpUnicodeEscapeSequence\n // \n // \n\n var start = pos;\n var res = parseIdentifierAtom(isIdentifierStart);\n if (!res) {\n bail('Invalid identifier');\n }\n\n var ch;\n while (ch = parseIdentifierAtom(isIdentifierPart)) {\n res += ch;\n }\n\n return addRaw({\n type: 'identifier',\n value: res,\n range: [start, pos]\n });\n }\n\n function isIdentifierStart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierStart = /[\\$A-Z_a-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEF\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7B9\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF1A]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDE9D\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFF1]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]/;\n\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n ((ch >= 0x80) && NonAsciiIdentifierStart.test(fromCodePoint(ch)));\n }\n\n // Taken from the Esprima parser.\n function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }\n\n function parseIdentityEscape() {\n // IdentityEscape ::\n // [+U] SyntaxCharacter\n // [+U] /\n // [~U] SourceCharacterIdentityEscape[?N]\n // SourceCharacterIdentityEscape[?N] ::\n // [~N] SourceCharacter but not c\n // [+N] SourceCharacter but not one of c or k\n\n\n var tmp;\n var l = lookahead();\n if (\n (hasUnicodeFlag && /[\\^\\$\\.\\*\\+\\?\\(\\)\\\\\\[\\]\\{\\}\\|\\/]/.test(l)) ||\n (!hasUnicodeFlag && l !== \"c\")\n ) {\n if (l === \"k\" && features.lookbehind) {\n return null;\n }\n tmp = incr();\n return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1);\n }\n\n return null;\n }\n\n function parseCharacterClass() {\n // CharacterClass ::\n // [ [lookahead ∉ {^}] ClassRanges ]\n // [ ^ ClassRanges ]\n\n var res, from = pos;\n if (res = matchReg(/^\\[\\^/)) {\n res = parseClassRanges();\n skip(']');\n return createCharacterClass(res, true, from, pos);\n } else if (match('[')) {\n res = parseClassRanges();\n skip(']');\n return createCharacterClass(res, false, from, pos);\n }\n\n return null;\n }\n\n function parseClassRanges() {\n // ClassRanges ::\n // [empty]\n // NonemptyClassRanges\n\n var res;\n if (current(']')) {\n // Empty array means nothing insinde of the ClassRange.\n return [];\n } else {\n res = parseNonemptyClassRanges();\n if (!res) {\n bail('nonEmptyClassRanges');\n }\n return res;\n }\n }\n\n function parseHelperClassRanges(atom) {\n var from, to, res;\n if (current('-') && !next(']')) {\n // ClassAtom - ClassAtom ClassRanges\n skip('-');\n\n res = parseClassAtom();\n if (!res) {\n bail('classAtom');\n }\n to = pos;\n var classRanges = parseClassRanges();\n if (!classRanges) {\n bail('classRanges');\n }\n from = atom.range[0];\n if (classRanges.type === 'empty') {\n return [createClassRange(atom, res, from, to)];\n }\n return [createClassRange(atom, res, from, to)].concat(classRanges);\n }\n\n res = parseNonemptyClassRangesNoDash();\n if (!res) {\n bail('nonEmptyClassRangesNoDash');\n }\n\n return [atom].concat(res);\n }\n\n function parseNonemptyClassRanges() {\n // NonemptyClassRanges ::\n // ClassAtom\n // ClassAtom NonemptyClassRangesNoDash\n // ClassAtom - ClassAtom ClassRanges\n\n var atom = parseClassAtom();\n if (!atom) {\n bail('classAtom');\n }\n\n if (current(']')) {\n // ClassAtom\n return [atom];\n }\n\n // ClassAtom NonemptyClassRangesNoDash\n // ClassAtom - ClassAtom ClassRanges\n return parseHelperClassRanges(atom);\n }\n\n function parseNonemptyClassRangesNoDash() {\n // NonemptyClassRangesNoDash ::\n // ClassAtom\n // ClassAtomNoDash NonemptyClassRangesNoDash\n // ClassAtomNoDash - ClassAtom ClassRanges\n\n var res = parseClassAtom();\n if (!res) {\n bail('classAtom');\n }\n if (current(']')) {\n // ClassAtom\n return res;\n }\n\n // ClassAtomNoDash NonemptyClassRangesNoDash\n // ClassAtomNoDash - ClassAtom ClassRanges\n return parseHelperClassRanges(res);\n }\n\n function parseClassAtom() {\n // ClassAtom ::\n // -\n // ClassAtomNoDash\n if (match('-')) {\n return createCharacter('-');\n } else {\n return parseClassAtomNoDash();\n }\n }\n\n function parseClassAtomNoDash() {\n // ClassAtomNoDash ::\n // SourceCharacter but not one of \\ or ] or -\n // \\ ClassEscape\n\n var res;\n if (res = matchReg(/^[^\\\\\\]-]/)) {\n return createCharacter(res[0]);\n } else if (match('\\\\')) {\n res = parseClassEscape();\n if (!res) {\n bail('classEscape');\n }\n\n return parseUnicodeSurrogatePairEscape(res);\n }\n }\n\n function bail(message, details, from, to) {\n from = from == null ? pos : from;\n to = to == null ? from : to;\n\n var contextStart = Math.max(0, from - 10);\n var contextEnd = Math.min(to + 10, str.length);\n\n // Output a bit of context and a line pointing to where our error is.\n //\n // We are assuming that there are no actual newlines in the content as this is a regular expression.\n var context = ' ' + str.substring(contextStart, contextEnd);\n var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^';\n\n throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\\n' + context + '\\n' + pointer);\n }\n\n var backrefDenied = [];\n var closedCaptureCounter = 0;\n var firstIteration = true;\n var hasUnicodeFlag = (flags || \"\").indexOf(\"u\") !== -1;\n var pos = 0;\n\n // Convert the input to a string and treat the empty string special.\n str = String(str);\n if (str === '') {\n str = '(?:)';\n }\n\n var result = parseDisjunction();\n\n if (result.range[1] !== str.length) {\n bail('Could not parse entire input - got stuck', '', result.range[1]);\n }\n\n // The spec requires to interpret the `\\2` in `/\\2()()/` as backreference.\n // As the parser collects the number of capture groups as the string is\n // parsed it is impossible to make these decisions at the point when the\n // `\\2` is handled. In case the local decision turns out to be wrong after\n // the parsing has finished, the input string is parsed a second time with\n // the total number of capture groups set.\n //\n // SEE: https://github.com/jviereck/regjsparser/issues/70\n for (var i = 0; i < backrefDenied.length; i++) {\n if (backrefDenied[i] <= closedCaptureCounter) {\n // Parse the input a second time.\n pos = 0;\n firstIteration = false;\n return parseDisjunction();\n }\n }\n\n return result;\n }\n\n var regjsparser = {\n parse: parse\n };\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = regjsparser;\n } else {\n window.regjsparser = regjsparser;\n }\n\n}());\n","/*! https://mths.be/regenerate v1.3.3 by @mathias | MIT license */\n;(function(root) {\n\n\t// Detect free variables `exports`.\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`.\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js/io.js or Browserified code,\n\t// and use it as `root`.\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar ERRORS = {\n\t\t'rangeOrder': 'A range\\u2019s `stop` value must be greater than or equal ' +\n\t\t\t'to the `start` value.',\n\t\t'codePointRange': 'Invalid code point value. Code points range from ' +\n\t\t\t'U+000000 to U+10FFFF.'\n\t};\n\n\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-pairs\n\tvar HIGH_SURROGATE_MIN = 0xD800;\n\tvar HIGH_SURROGATE_MAX = 0xDBFF;\n\tvar LOW_SURROGATE_MIN = 0xDC00;\n\tvar LOW_SURROGATE_MAX = 0xDFFF;\n\n\t// In Regenerate output, `\\0` is never preceded by `\\` because we sort by\n\t// code point value, so let’s keep this regular expression simple.\n\tvar regexNull = /\\\\x00([^0123456789]|$)/g;\n\n\tvar object = {};\n\tvar hasOwnProperty = object.hasOwnProperty;\n\tvar extend = function(destination, source) {\n\t\tvar key;\n\t\tfor (key in source) {\n\t\t\tif (hasOwnProperty.call(source, key)) {\n\t\t\t\tdestination[key] = source[key];\n\t\t\t}\n\t\t}\n\t\treturn destination;\n\t};\n\n\tvar forEach = function(array, callback) {\n\t\tvar index = -1;\n\t\tvar length = array.length;\n\t\twhile (++index < length) {\n\t\t\tcallback(array[index], index);\n\t\t}\n\t};\n\n\tvar toString = object.toString;\n\tvar isArray = function(value) {\n\t\treturn toString.call(value) == '[object Array]';\n\t};\n\tvar isNumber = function(value) {\n\t\treturn typeof value == 'number' ||\n\t\t\ttoString.call(value) == '[object Number]';\n\t};\n\n\t// This assumes that `number` is a positive integer that `toString()`s nicely\n\t// (which is the case for all code point values).\n\tvar zeroes = '0000';\n\tvar pad = function(number, totalCharacters) {\n\t\tvar string = String(number);\n\t\treturn string.length < totalCharacters\n\t\t\t? (zeroes + string).slice(-totalCharacters)\n\t\t\t: string;\n\t};\n\n\tvar hex = function(number) {\n\t\treturn Number(number).toString(16).toUpperCase();\n\t};\n\n\tvar slice = [].slice;\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar dataFromCodePoints = function(codePoints) {\n\t\tvar index = -1;\n\t\tvar length = codePoints.length;\n\t\tvar max = length - 1;\n\t\tvar result = [];\n\t\tvar isStart = true;\n\t\tvar tmp;\n\t\tvar previous = 0;\n\t\twhile (++index < length) {\n\t\t\ttmp = codePoints[index];\n\t\t\tif (isStart) {\n\t\t\t\tresult.push(tmp);\n\t\t\t\tprevious = tmp;\n\t\t\t\tisStart = false;\n\t\t\t} else {\n\t\t\t\tif (tmp == previous + 1) {\n\t\t\t\t\tif (index != max) {\n\t\t\t\t\t\tprevious = tmp;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisStart = true;\n\t\t\t\t\t\tresult.push(tmp + 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// End the previous range and start a new one.\n\t\t\t\t\tresult.push(previous + 1, tmp);\n\t\t\t\t\tprevious = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!isStart) {\n\t\t\tresult.push(tmp + 1);\n\t\t}\n\t\treturn result;\n\t};\n\n\tvar dataRemove = function(data, codePoint) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\t\t\tif (codePoint >= start && codePoint < end) {\n\t\t\t\t// Modify this pair.\n\t\t\t\tif (codePoint == start) {\n\t\t\t\t\tif (end == start + 1) {\n\t\t\t\t\t\t// Just remove `start` and `end`.\n\t\t\t\t\t\tdata.splice(index, 2);\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Just replace `start` with a new value.\n\t\t\t\t\t\tdata[index] = codePoint + 1;\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}\n\t\t\t\t} else if (codePoint == end - 1) {\n\t\t\t\t\t// Just replace `end` with a new value.\n\t\t\t\t\tdata[index + 1] = codePoint;\n\t\t\t\t\treturn data;\n\t\t\t\t} else {\n\t\t\t\t\t// Replace `[start, end]` with `[startA, endA, startB, endB]`.\n\t\t\t\t\tdata.splice(index, 2, start, codePoint, codePoint + 1, end);\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataRemoveRange = function(data, rangeStart, rangeEnd) {\n\t\tif (rangeEnd < rangeStart) {\n\t\t\tthrow Error(ERRORS.rangeOrder);\n\t\t}\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\twhile (index < data.length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\n\t\t\t// Exit as soon as no more matching pairs can be found.\n\t\t\tif (start > rangeEnd) {\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// Check if this range pair is equal to, or forms a subset of, the range\n\t\t\t// to be removed.\n\t\t\t// E.g. we have `[0, 11, 40, 51]` and want to remove 0-10 → `[40, 51]`.\n\t\t\t// E.g. we have `[40, 51]` and want to remove 0-100 → `[]`.\n\t\t\tif (rangeStart <= start && rangeEnd >= end) {\n\t\t\t\t// Remove this pair.\n\t\t\t\tdata.splice(index, 2);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check if both `rangeStart` and `rangeEnd` are within the bounds of\n\t\t\t// this pair.\n\t\t\t// E.g. we have `[0, 11]` and want to remove 4-6 → `[0, 4, 7, 11]`.\n\t\t\tif (rangeStart >= start && rangeEnd < end) {\n\t\t\t\tif (rangeStart == start) {\n\t\t\t\t\t// Replace `[start, end]` with `[startB, endB]`.\n\t\t\t\t\tdata[index] = rangeEnd + 1;\n\t\t\t\t\tdata[index + 1] = end + 1;\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t\t// Replace `[start, end]` with `[startA, endA, startB, endB]`.\n\t\t\t\tdata.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1);\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// Check if only `rangeStart` is within the bounds of this pair.\n\t\t\t// E.g. we have `[0, 11]` and want to remove 4-20 → `[0, 4]`.\n\t\t\tif (rangeStart >= start && rangeStart <= end) {\n\t\t\t\t// Replace `end` with `rangeStart`.\n\t\t\t\tdata[index + 1] = rangeStart;\n\t\t\t\t// Note: we cannot `return` just yet, in case any following pairs still\n\t\t\t\t// contain matching code points.\n\t\t\t\t// E.g. we have `[0, 11, 14, 31]` and want to remove 4-20\n\t\t\t\t// → `[0, 4, 21, 31]`.\n\t\t\t}\n\n\t\t\t// Check if only `rangeEnd` is within the bounds of this pair.\n\t\t\t// E.g. we have `[14, 31]` and want to remove 4-20 → `[21, 31]`.\n\t\t\telse if (rangeEnd >= start && rangeEnd <= end) {\n\t\t\t\t// Just replace `start`.\n\t\t\t\tdata[index] = rangeEnd + 1;\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\t var dataAdd = function(data, codePoint) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar lastIndex = null;\n\t\tvar length = data.length;\n\t\tif (codePoint < 0x0 || codePoint > 0x10FFFF) {\n\t\t\tthrow RangeError(ERRORS.codePointRange);\n\t\t}\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\n\t\t\t// Check if the code point is already in the set.\n\t\t\tif (codePoint >= start && codePoint < end) {\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tif (codePoint == start - 1) {\n\t\t\t\t// Just replace `start` with a new value.\n\t\t\t\tdata[index] = codePoint;\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// At this point, if `start` is `greater` than `codePoint`, insert a new\n\t\t\t// `[start, end]` pair before the current pair, or after the current pair\n\t\t\t// if there is a known `lastIndex`.\n\t\t\tif (start > codePoint) {\n\t\t\t\tdata.splice(\n\t\t\t\t\tlastIndex != null ? lastIndex + 2 : 0,\n\t\t\t\t\t0,\n\t\t\t\t\tcodePoint,\n\t\t\t\t\tcodePoint + 1\n\t\t\t\t);\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tif (codePoint == end) {\n\t\t\t\t// Check if adding this code point causes two separate ranges to become\n\t\t\t\t// a single range, e.g. `dataAdd([0, 4, 5, 10], 4)` → `[0, 10]`.\n\t\t\t\tif (codePoint + 1 == data[index + 2]) {\n\t\t\t\t\tdata.splice(index, 4, start, data[index + 3]);\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t\t// Else, just replace `end` with a new value.\n\t\t\t\tdata[index + 1] = codePoint + 1;\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\tlastIndex = index;\n\t\t\tindex += 2;\n\t\t}\n\t\t// The loop has finished; add the new pair to the end of the data set.\n\t\tdata.push(codePoint, codePoint + 1);\n\t\treturn data;\n\t};\n\n\tvar dataAddData = function(dataA, dataB) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar data = dataA.slice();\n\t\tvar length = dataB.length;\n\t\twhile (index < length) {\n\t\t\tstart = dataB[index];\n\t\t\tend = dataB[index + 1] - 1;\n\t\t\tif (start == end) {\n\t\t\t\tdata = dataAdd(data, start);\n\t\t\t} else {\n\t\t\t\tdata = dataAddRange(data, start, end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataRemoveData = function(dataA, dataB) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar data = dataA.slice();\n\t\tvar length = dataB.length;\n\t\twhile (index < length) {\n\t\t\tstart = dataB[index];\n\t\t\tend = dataB[index + 1] - 1;\n\t\t\tif (start == end) {\n\t\t\t\tdata = dataRemove(data, start);\n\t\t\t} else {\n\t\t\t\tdata = dataRemoveRange(data, start, end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataAddRange = function(data, rangeStart, rangeEnd) {\n\t\tif (rangeEnd < rangeStart) {\n\t\t\tthrow Error(ERRORS.rangeOrder);\n\t\t}\n\t\tif (\n\t\t\trangeStart < 0x0 || rangeStart > 0x10FFFF ||\n\t\t\trangeEnd < 0x0 || rangeEnd > 0x10FFFF\n\t\t) {\n\t\t\tthrow RangeError(ERRORS.codePointRange);\n\t\t}\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar added = false;\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\n\t\t\tif (added) {\n\t\t\t\t// The range has already been added to the set; at this point, we just\n\t\t\t\t// need to get rid of the following ranges in case they overlap.\n\n\t\t\t\t// Check if this range can be combined with the previous range.\n\t\t\t\tif (start == rangeEnd + 1) {\n\t\t\t\t\tdata.splice(index - 1, 2);\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Exit as soon as no more possibly overlapping pairs can be found.\n\t\t\t\tif (start > rangeEnd) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// E.g. `[0, 11, 12, 16]` and we’ve added 5-15, so we now have\n\t\t\t\t// `[0, 16, 12, 16]`. Remove the `12,16` part, as it lies within the\n\t\t\t\t// `0,16` range that was previously added.\n\t\t\t\tif (start >= rangeStart && start <= rangeEnd) {\n\t\t\t\t\t// `start` lies within the range that was previously added.\n\n\t\t\t\t\tif (end > rangeStart && end - 1 <= rangeEnd) {\n\t\t\t\t\t\t// `end` lies within the range that was previously added as well,\n\t\t\t\t\t\t// so remove this pair.\n\t\t\t\t\t\tdata.splice(index, 2);\n\t\t\t\t\t\tindex -= 2;\n\t\t\t\t\t\t// Note: we cannot `return` just yet, as there may still be other\n\t\t\t\t\t\t// overlapping pairs.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// `start` lies within the range that was previously added, but\n\t\t\t\t\t\t// `end` doesn’t. E.g. `[0, 11, 12, 31]` and we’ve added 5-15, so\n\t\t\t\t\t\t// now we have `[0, 16, 12, 31]`. This must be written as `[0, 31]`.\n\t\t\t\t\t\t// Remove the previously added `end` and the current `start`.\n\t\t\t\t\t\tdata.splice(index - 1, 2);\n\t\t\t\t\t\tindex -= 2;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Note: we cannot return yet.\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse if (start == rangeEnd + 1) {\n\t\t\t\tdata[index] = rangeStart;\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// Check if a new pair must be inserted *before* the current one.\n\t\t\telse if (start > rangeEnd) {\n\t\t\t\tdata.splice(index, 0, rangeStart, rangeEnd + 1);\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\telse if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) {\n\t\t\t\t// The new range lies entirely within an existing range pair. No action\n\t\t\t\t// needed.\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\telse if (\n\t\t\t\t// E.g. `[0, 11]` and you add 5-15 → `[0, 16]`.\n\t\t\t\t(rangeStart >= start && rangeStart < end) ||\n\t\t\t\t// E.g. `[0, 3]` and you add 3-6 → `[0, 7]`.\n\t\t\t\tend == rangeStart\n\t\t\t) {\n\t\t\t\t// Replace `end` with the new value.\n\t\t\t\tdata[index + 1] = rangeEnd + 1;\n\t\t\t\t// Make sure the next range pair doesn’t overlap, e.g. `[0, 11, 12, 14]`\n\t\t\t\t// and you add 5-15 → `[0, 16]`, i.e. remove the `12,14` part.\n\t\t\t\tadded = true;\n\t\t\t\t// Note: we cannot `return` just yet.\n\t\t\t}\n\n\t\t\telse if (rangeStart <= start && rangeEnd + 1 >= end) {\n\t\t\t\t// The new range is a superset of the old range.\n\t\t\t\tdata[index] = rangeStart;\n\t\t\t\tdata[index + 1] = rangeEnd + 1;\n\t\t\t\tadded = true;\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\t\t// The loop has finished without doing anything; add the new pair to the end\n\t\t// of the data set.\n\t\tif (!added) {\n\t\t\tdata.push(rangeStart, rangeEnd + 1);\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataContains = function(data, codePoint) {\n\t\tvar index = 0;\n\t\tvar length = data.length;\n\t\t// Exit early if `codePoint` is not within `data`’s overall range.\n\t\tvar start = data[index];\n\t\tvar end = data[length - 1];\n\t\tif (length >= 2) {\n\t\t\tif (codePoint < start || codePoint > end) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\t\t\tif (codePoint >= start && codePoint < end) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn false;\n\t};\n\n\tvar dataIntersection = function(data, codePoints) {\n\t\tvar index = 0;\n\t\tvar length = codePoints.length;\n\t\tvar codePoint;\n\t\tvar result = [];\n\t\twhile (index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tif (dataContains(data, codePoint)) {\n\t\t\t\tresult.push(codePoint);\n\t\t\t}\n\t\t\t++index;\n\t\t}\n\t\treturn dataFromCodePoints(result);\n\t};\n\n\tvar dataIsEmpty = function(data) {\n\t\treturn !data.length;\n\t};\n\n\tvar dataIsSingleton = function(data) {\n\t\t// Check if the set only represents a single code point.\n\t\treturn data.length == 2 && data[0] + 1 == data[1];\n\t};\n\n\tvar dataToArray = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar result = [];\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\t\t\twhile (start < end) {\n\t\t\t\tresult.push(start);\n\t\t\t\t++start;\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn result;\n\t};\n\n\t/*--------------------------------------------------------------------------*/\n\n\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\tvar floor = Math.floor;\n\tvar highSurrogate = function(codePoint) {\n\t\treturn parseInt(\n\t\t\tfloor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN,\n\t\t\t10\n\t\t);\n\t};\n\n\tvar lowSurrogate = function(codePoint) {\n\t\treturn parseInt(\n\t\t\t(codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN,\n\t\t\t10\n\t\t);\n\t};\n\n\tvar stringFromCharCode = String.fromCharCode;\n\tvar codePointToString = function(codePoint) {\n\t\tvar string;\n\t\t// https://mathiasbynens.be/notes/javascript-escapes#single\n\t\t// Note: the `\\b` escape sequence for U+0008 BACKSPACE in strings has a\n\t\t// different meaning in regular expressions (word boundary), so it cannot\n\t\t// be used here.\n\t\tif (codePoint == 0x09) {\n\t\t\tstring = '\\\\t';\n\t\t}\n\t\t// Note: IE < 9 treats `'\\v'` as `'v'`, so avoid using it.\n\t\t// else if (codePoint == 0x0B) {\n\t\t// \tstring = '\\\\v';\n\t\t// }\n\t\telse if (codePoint == 0x0A) {\n\t\t\tstring = '\\\\n';\n\t\t}\n\t\telse if (codePoint == 0x0C) {\n\t\t\tstring = '\\\\f';\n\t\t}\n\t\telse if (codePoint == 0x0D) {\n\t\t\tstring = '\\\\r';\n\t\t}\n\t\telse if (codePoint == 0x2D) {\n\t\t\t// https://mathiasbynens.be/notes/javascript-escapes#hexadecimal\n\t\t\t// Note: `-` (U+002D HYPHEN-MINUS) is escaped in this way rather\n\t\t\t// than by backslash-escaping, in case the output is used outside\n\t\t\t// of a character class in a `u` RegExp. /\\-/u throws, but\n\t\t\t// /\\x2D/u is fine.\n\t\t\tstring = '\\\\x2D';\n\t\t}\n\t\telse if (codePoint == 0x5C) {\n\t\t\tstring = '\\\\\\\\';\n\t\t}\n\t\telse if (\n\t\t\tcodePoint == 0x24 ||\n\t\t\t(codePoint >= 0x28 && codePoint <= 0x2B) ||\n\t\t\tcodePoint == 0x2E || codePoint == 0x2F ||\n\t\t\tcodePoint == 0x3F ||\n\t\t\t(codePoint >= 0x5B && codePoint <= 0x5E) ||\n\t\t\t(codePoint >= 0x7B && codePoint <= 0x7D)\n\t\t) {\n\t\t\t// The code point maps to an unsafe printable ASCII character;\n\t\t\t// backslash-escape it. Here’s the list of those symbols:\n\t\t\t//\n\t\t\t// $()*+./?[\\]^{|}\n\t\t\t//\n\t\t\t// This matches SyntaxCharacters as well as `/` (U+002F SOLIDUS).\n\t\t\t// https://tc39.github.io/ecma262/#prod-SyntaxCharacter\n\t\t\tstring = '\\\\' + stringFromCharCode(codePoint);\n\t\t}\n\t\telse if (codePoint >= 0x20 && codePoint <= 0x7E) {\n\t\t\t// The code point maps to one of these printable ASCII symbols\n\t\t\t// (including the space character):\n\t\t\t//\n\t\t\t// !\"#%&',/0123456789:;<=>@ABCDEFGHIJKLMNO\n\t\t\t// PQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~\n\t\t\t//\n\t\t\t// These can safely be used directly.\n\t\t\tstring = stringFromCharCode(codePoint);\n\t\t}\n\t\telse if (codePoint <= 0xFF) {\n\t\t\tstring = '\\\\x' + pad(hex(codePoint), 2);\n\t\t}\n\t\telse { // `codePoint <= 0xFFFF` holds true.\n\t\t\t// https://mathiasbynens.be/notes/javascript-escapes#unicode\n\t\t\tstring = '\\\\u' + pad(hex(codePoint), 4);\n\t\t}\n\n\t\t// There’s no need to account for astral symbols / surrogate pairs here,\n\t\t// since `codePointToString` is private and only used for BMP code points.\n\t\t// But if that’s what you need, just add an `else` block with this code:\n\t\t//\n\t\t// string = '\\\\u' + pad(hex(highSurrogate(codePoint)), 4)\n\t\t// \t+ '\\\\u' + pad(hex(lowSurrogate(codePoint)), 4);\n\n\t\treturn string;\n\t};\n\n\tvar codePointToStringUnicode = function(codePoint) {\n\t\tif (codePoint <= 0xFFFF) {\n\t\t\treturn codePointToString(codePoint);\n\t\t}\n\t\treturn '\\\\u{' + codePoint.toString(16).toUpperCase() + '}';\n\t};\n\n\tvar symbolToCodePoint = function(symbol) {\n\t\tvar length = symbol.length;\n\t\tvar first = symbol.charCodeAt(0);\n\t\tvar second;\n\t\tif (\n\t\t\tfirst >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX &&\n\t\t\tlength > 1 // There is a next code unit.\n\t\t) {\n\t\t\t// `first` is a high surrogate, and there is a next character. Assume\n\t\t\t// it’s a low surrogate (else it’s invalid usage of Regenerate anyway).\n\t\t\tsecond = symbol.charCodeAt(1);\n\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\treturn (first - HIGH_SURROGATE_MIN) * 0x400 +\n\t\t\t\tsecond - LOW_SURROGATE_MIN + 0x10000;\n\t\t}\n\t\treturn first;\n\t};\n\n\tvar createBMPCharacterClasses = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar result = '';\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\tif (dataIsSingleton(data)) {\n\t\t\treturn codePointToString(data[0]);\n\t\t}\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\t\t\tif (start == end) {\n\t\t\t\tresult += codePointToString(start);\n\t\t\t} else if (start + 1 == end) {\n\t\t\t\tresult += codePointToString(start) + codePointToString(end);\n\t\t\t} else {\n\t\t\t\tresult += codePointToString(start) + '-' + codePointToString(end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn '[' + result + ']';\n\t};\n\n\tvar createUnicodeCharacterClasses = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar result = '';\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\tif (dataIsSingleton(data)) {\n\t\t\treturn codePointToStringUnicode(data[0]);\n\t\t}\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\t\t\tif (start == end) {\n\t\t\t\tresult += codePointToStringUnicode(start);\n\t\t\t} else if (start + 1 == end) {\n\t\t\t\tresult += codePointToStringUnicode(start) + codePointToStringUnicode(end);\n\t\t\t} else {\n\t\t\t\tresult += codePointToStringUnicode(start) + '-' + codePointToStringUnicode(end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn '[' + result + ']';\n\t};\n\n\tvar splitAtBMP = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar loneHighSurrogates = [];\n\t\tvar loneLowSurrogates = [];\n\t\tvar bmp = [];\n\t\tvar astral = [];\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\n\t\t\tif (start < HIGH_SURROGATE_MIN) {\n\n\t\t\t\t// The range starts and ends before the high surrogate range.\n\t\t\t\t// E.g. (0, 0x10).\n\t\t\t\tif (end < HIGH_SURROGATE_MIN) {\n\t\t\t\t\tbmp.push(start, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts before the high surrogate range and ends within it.\n\t\t\t\t// E.g. (0, 0xD855).\n\t\t\t\tif (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {\n\t\t\t\t\tbmp.push(start, HIGH_SURROGATE_MIN);\n\t\t\t\t\tloneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts before the high surrogate range and ends in the low\n\t\t\t\t// surrogate range. E.g. (0, 0xDCFF).\n\t\t\t\tif (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {\n\t\t\t\t\tbmp.push(start, HIGH_SURROGATE_MIN);\n\t\t\t\t\tloneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts before the high surrogate range and ends after the\n\t\t\t\t// low surrogate range. E.g. (0, 0x10FFFF).\n\t\t\t\tif (end > LOW_SURROGATE_MAX) {\n\t\t\t\t\tbmp.push(start, HIGH_SURROGATE_MIN);\n\t\t\t\t\tloneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);\n\t\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, end + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);\n\t\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {\n\n\t\t\t\t// The range starts and ends in the high surrogate range.\n\t\t\t\t// E.g. (0xD855, 0xD866).\n\t\t\t\tif (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {\n\t\t\t\t\tloneHighSurrogates.push(start, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts in the high surrogate range and ends in the low\n\t\t\t\t// surrogate range. E.g. (0xD855, 0xDCFF).\n\t\t\t\tif (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts in the high surrogate range and ends after the low\n\t\t\t\t// surrogate range. E.g. (0xD855, 0x10FFFF).\n\t\t\t\tif (end > LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);\n\t\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, end + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);\n\t\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) {\n\n\t\t\t\t// The range starts and ends in the low surrogate range.\n\t\t\t\t// E.g. (0xDCFF, 0xDDFF).\n\t\t\t\tif (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneLowSurrogates.push(start, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts in the low surrogate range and ends after the low\n\t\t\t\t// surrogate range. E.g. (0xDCFF, 0x10FFFF).\n\t\t\t\tif (end > LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1);\n\t\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, end + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);\n\t\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) {\n\n\t\t\t\t// The range starts and ends after the low surrogate range.\n\t\t\t\t// E.g. (0xFFAA, 0x10FFFF).\n\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\tbmp.push(start, end + 1);\n\t\t\t\t} else {\n\t\t\t\t\tbmp.push(start, 0xFFFF + 1);\n\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// The range starts and ends in the astral range.\n\t\t\t\tastral.push(start, end + 1);\n\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\t\treturn {\n\t\t\t'loneHighSurrogates': loneHighSurrogates,\n\t\t\t'loneLowSurrogates': loneLowSurrogates,\n\t\t\t'bmp': bmp,\n\t\t\t'astral': astral\n\t\t};\n\t};\n\n\tvar optimizeSurrogateMappings = function(surrogateMappings) {\n\t\tvar result = [];\n\t\tvar tmpLow = [];\n\t\tvar addLow = false;\n\t\tvar mapping;\n\t\tvar nextMapping;\n\t\tvar highSurrogates;\n\t\tvar lowSurrogates;\n\t\tvar nextHighSurrogates;\n\t\tvar nextLowSurrogates;\n\t\tvar index = -1;\n\t\tvar length = surrogateMappings.length;\n\t\twhile (++index < length) {\n\t\t\tmapping = surrogateMappings[index];\n\t\t\tnextMapping = surrogateMappings[index + 1];\n\t\t\tif (!nextMapping) {\n\t\t\t\tresult.push(mapping);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\thighSurrogates = mapping[0];\n\t\t\tlowSurrogates = mapping[1];\n\t\t\tnextHighSurrogates = nextMapping[0];\n\t\t\tnextLowSurrogates = nextMapping[1];\n\n\t\t\t// Check for identical high surrogate ranges.\n\t\t\ttmpLow = lowSurrogates;\n\t\t\twhile (\n\t\t\t\tnextHighSurrogates &&\n\t\t\t\thighSurrogates[0] == nextHighSurrogates[0] &&\n\t\t\t\thighSurrogates[1] == nextHighSurrogates[1]\n\t\t\t) {\n\t\t\t\t// Merge with the next item.\n\t\t\t\tif (dataIsSingleton(nextLowSurrogates)) {\n\t\t\t\t\ttmpLow = dataAdd(tmpLow, nextLowSurrogates[0]);\n\t\t\t\t} else {\n\t\t\t\t\ttmpLow = dataAddRange(\n\t\t\t\t\t\ttmpLow,\n\t\t\t\t\t\tnextLowSurrogates[0],\n\t\t\t\t\t\tnextLowSurrogates[1] - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t++index;\n\t\t\t\tmapping = surrogateMappings[index];\n\t\t\t\thighSurrogates = mapping[0];\n\t\t\t\tlowSurrogates = mapping[1];\n\t\t\t\tnextMapping = surrogateMappings[index + 1];\n\t\t\t\tnextHighSurrogates = nextMapping && nextMapping[0];\n\t\t\t\tnextLowSurrogates = nextMapping && nextMapping[1];\n\t\t\t\taddLow = true;\n\t\t\t}\n\t\t\tresult.push([\n\t\t\t\thighSurrogates,\n\t\t\t\taddLow ? tmpLow : lowSurrogates\n\t\t\t]);\n\t\t\taddLow = false;\n\t\t}\n\t\treturn optimizeByLowSurrogates(result);\n\t};\n\n\tvar optimizeByLowSurrogates = function(surrogateMappings) {\n\t\tif (surrogateMappings.length == 1) {\n\t\t\treturn surrogateMappings;\n\t\t}\n\t\tvar index = -1;\n\t\tvar innerIndex = -1;\n\t\twhile (++index < surrogateMappings.length) {\n\t\t\tvar mapping = surrogateMappings[index];\n\t\t\tvar lowSurrogates = mapping[1];\n\t\t\tvar lowSurrogateStart = lowSurrogates[0];\n\t\t\tvar lowSurrogateEnd = lowSurrogates[1];\n\t\t\tinnerIndex = index; // Note: the loop starts at the next index.\n\t\t\twhile (++innerIndex < surrogateMappings.length) {\n\t\t\t\tvar otherMapping = surrogateMappings[innerIndex];\n\t\t\t\tvar otherLowSurrogates = otherMapping[1];\n\t\t\t\tvar otherLowSurrogateStart = otherLowSurrogates[0];\n\t\t\t\tvar otherLowSurrogateEnd = otherLowSurrogates[1];\n\t\t\t\tif (\n\t\t\t\t\tlowSurrogateStart == otherLowSurrogateStart &&\n\t\t\t\t\tlowSurrogateEnd == otherLowSurrogateEnd\n\t\t\t\t) {\n\t\t\t\t\t// Add the code points in the other item to this one.\n\t\t\t\t\tif (dataIsSingleton(otherMapping[0])) {\n\t\t\t\t\t\tmapping[0] = dataAdd(mapping[0], otherMapping[0][0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapping[0] = dataAddRange(\n\t\t\t\t\t\t\tmapping[0],\n\t\t\t\t\t\t\totherMapping[0][0],\n\t\t\t\t\t\t\totherMapping[0][1] - 1\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Remove the other, now redundant, item.\n\t\t\t\t\tsurrogateMappings.splice(innerIndex, 1);\n\t\t\t\t\t--innerIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn surrogateMappings;\n\t};\n\n\tvar surrogateSet = function(data) {\n\t\t// Exit early if `data` is an empty set.\n\t\tif (!data.length) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar startHigh;\n\t\tvar startLow;\n\t\tvar endHigh;\n\t\tvar endLow;\n\t\tvar surrogateMappings = [];\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1;\n\n\t\t\tstartHigh = highSurrogate(start);\n\t\t\tstartLow = lowSurrogate(start);\n\t\t\tendHigh = highSurrogate(end);\n\t\t\tendLow = lowSurrogate(end);\n\n\t\t\tvar startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN;\n\t\t\tvar endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX;\n\t\t\tvar complete = false;\n\n\t\t\t// Append the previous high-surrogate-to-low-surrogate mappings.\n\t\t\t// Step 1: `(startHigh, startLow)` to `(startHigh, LOW_SURROGATE_MAX)`.\n\t\t\tif (\n\t\t\t\tstartHigh == endHigh ||\n\t\t\t\tstartsWithLowestLowSurrogate && endsWithHighestLowSurrogate\n\t\t\t) {\n\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t[startHigh, endHigh + 1],\n\t\t\t\t\t[startLow, endLow + 1]\n\t\t\t\t]);\n\t\t\t\tcomplete = true;\n\t\t\t} else {\n\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t[startHigh, startHigh + 1],\n\t\t\t\t\t[startLow, LOW_SURROGATE_MAX + 1]\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t// Step 2: `(startHigh + 1, LOW_SURROGATE_MIN)` to\n\t\t\t// `(endHigh - 1, LOW_SURROGATE_MAX)`.\n\t\t\tif (!complete && startHigh + 1 < endHigh) {\n\t\t\t\tif (endsWithHighestLowSurrogate) {\n\t\t\t\t\t// Combine step 2 and step 3.\n\t\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t\t[startHigh + 1, endHigh + 1],\n\t\t\t\t\t\t[LOW_SURROGATE_MIN, endLow + 1]\n\t\t\t\t\t]);\n\t\t\t\t\tcomplete = true;\n\t\t\t\t} else {\n\t\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t\t[startHigh + 1, endHigh],\n\t\t\t\t\t\t[LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1]\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Step 3. `(endHigh, LOW_SURROGATE_MIN)` to `(endHigh, endLow)`.\n\t\t\tif (!complete) {\n\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t[endHigh, endHigh + 1],\n\t\t\t\t\t[LOW_SURROGATE_MIN, endLow + 1]\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\n\t\t// The format of `surrogateMappings` is as follows:\n\t\t//\n\t\t// [ surrogateMapping1, surrogateMapping2 ]\n\t\t//\n\t\t// i.e.:\n\t\t//\n\t\t// [\n\t\t// [ highSurrogates1, lowSurrogates1 ],\n\t\t// [ highSurrogates2, lowSurrogates2 ]\n\t\t// ]\n\t\treturn optimizeSurrogateMappings(surrogateMappings);\n\t};\n\n\tvar createSurrogateCharacterClasses = function(surrogateMappings) {\n\t\tvar result = [];\n\t\tforEach(surrogateMappings, function(surrogateMapping) {\n\t\t\tvar highSurrogates = surrogateMapping[0];\n\t\t\tvar lowSurrogates = surrogateMapping[1];\n\t\t\tresult.push(\n\t\t\t\tcreateBMPCharacterClasses(highSurrogates) +\n\t\t\t\tcreateBMPCharacterClasses(lowSurrogates)\n\t\t\t);\n\t\t});\n\t\treturn result.join('|');\n\t};\n\n\tvar createCharacterClassesFromData = function(data, bmpOnly, hasUnicodeFlag) {\n\t\tif (hasUnicodeFlag) {\n\t\t\treturn createUnicodeCharacterClasses(data);\n\t\t}\n\t\tvar result = [];\n\n\t\tvar parts = splitAtBMP(data);\n\t\tvar loneHighSurrogates = parts.loneHighSurrogates;\n\t\tvar loneLowSurrogates = parts.loneLowSurrogates;\n\t\tvar bmp = parts.bmp;\n\t\tvar astral = parts.astral;\n\t\tvar hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates);\n\t\tvar hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates);\n\n\t\tvar surrogateMappings = surrogateSet(astral);\n\n\t\tif (bmpOnly) {\n\t\t\tbmp = dataAddData(bmp, loneHighSurrogates);\n\t\t\thasLoneHighSurrogates = false;\n\t\t\tbmp = dataAddData(bmp, loneLowSurrogates);\n\t\t\thasLoneLowSurrogates = false;\n\t\t}\n\n\t\tif (!dataIsEmpty(bmp)) {\n\t\t\t// The data set contains BMP code points that are not high surrogates\n\t\t\t// needed for astral code points in the set.\n\t\t\tresult.push(createBMPCharacterClasses(bmp));\n\t\t}\n\t\tif (surrogateMappings.length) {\n\t\t\t// The data set contains astral code points; append character classes\n\t\t\t// based on their surrogate pairs.\n\t\t\tresult.push(createSurrogateCharacterClasses(surrogateMappings));\n\t\t}\n\t\t// https://gist.github.com/mathiasbynens/bbe7f870208abcfec860\n\t\tif (hasLoneHighSurrogates) {\n\t\t\tresult.push(\n\t\t\t\tcreateBMPCharacterClasses(loneHighSurrogates) +\n\t\t\t\t// Make sure the high surrogates aren’t part of a surrogate pair.\n\t\t\t\t'(?![\\\\uDC00-\\\\uDFFF])'\n\t\t\t);\n\t\t}\n\t\tif (hasLoneLowSurrogates) {\n\t\t\tresult.push(\n\t\t\t\t// It is not possible to accurately assert the low surrogates aren’t\n\t\t\t\t// part of a surrogate pair, since JavaScript regular expressions do\n\t\t\t\t// not support lookbehind.\n\t\t\t\t'(?:[^\\\\uD800-\\\\uDBFF]|^)' +\n\t\t\t\tcreateBMPCharacterClasses(loneLowSurrogates)\n\t\t\t);\n\t\t}\n\t\treturn result.join('|');\n\t};\n\n\t/*--------------------------------------------------------------------------*/\n\n\t// `regenerate` can be used as a constructor (and new methods can be added to\n\t// its prototype) but also as a regular function, the latter of which is the\n\t// documented and most common usage. For that reason, it’s not capitalized.\n\tvar regenerate = function(value) {\n\t\tif (arguments.length > 1) {\n\t\t\tvalue = slice.call(arguments);\n\t\t}\n\t\tif (this instanceof regenerate) {\n\t\t\tthis.data = [];\n\t\t\treturn value ? this.add(value) : this;\n\t\t}\n\t\treturn (new regenerate).add(value);\n\t};\n\n\tregenerate.version = '1.3.3';\n\n\tvar proto = regenerate.prototype;\n\textend(proto, {\n\t\t'add': function(value) {\n\t\t\tvar $this = this;\n\t\t\tif (value == null) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (value instanceof regenerate) {\n\t\t\t\t// Allow passing other Regenerate instances.\n\t\t\t\t$this.data = dataAddData($this.data, value.data);\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tvalue = slice.call(arguments);\n\t\t\t}\n\t\t\tif (isArray(value)) {\n\t\t\t\tforEach(value, function(item) {\n\t\t\t\t\t$this.add(item);\n\t\t\t\t});\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\t$this.data = dataAdd(\n\t\t\t\t$this.data,\n\t\t\t\tisNumber(value) ? value : symbolToCodePoint(value)\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'remove': function(value) {\n\t\t\tvar $this = this;\n\t\t\tif (value == null) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (value instanceof regenerate) {\n\t\t\t\t// Allow passing other Regenerate instances.\n\t\t\t\t$this.data = dataRemoveData($this.data, value.data);\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tvalue = slice.call(arguments);\n\t\t\t}\n\t\t\tif (isArray(value)) {\n\t\t\t\tforEach(value, function(item) {\n\t\t\t\t\t$this.remove(item);\n\t\t\t\t});\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\t$this.data = dataRemove(\n\t\t\t\t$this.data,\n\t\t\t\tisNumber(value) ? value : symbolToCodePoint(value)\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'addRange': function(start, end) {\n\t\t\tvar $this = this;\n\t\t\t$this.data = dataAddRange($this.data,\n\t\t\t\tisNumber(start) ? start : symbolToCodePoint(start),\n\t\t\t\tisNumber(end) ? end : symbolToCodePoint(end)\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'removeRange': function(start, end) {\n\t\t\tvar $this = this;\n\t\t\tvar startCodePoint = isNumber(start) ? start : symbolToCodePoint(start);\n\t\t\tvar endCodePoint = isNumber(end) ? end : symbolToCodePoint(end);\n\t\t\t$this.data = dataRemoveRange(\n\t\t\t\t$this.data,\n\t\t\t\tstartCodePoint,\n\t\t\t\tendCodePoint\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'intersection': function(argument) {\n\t\t\tvar $this = this;\n\t\t\t// Allow passing other Regenerate instances.\n\t\t\t// TODO: Optimize this by writing and using `dataIntersectionData()`.\n\t\t\tvar array = argument instanceof regenerate ?\n\t\t\t\tdataToArray(argument.data) :\n\t\t\t\targument;\n\t\t\t$this.data = dataIntersection($this.data, array);\n\t\t\treturn $this;\n\t\t},\n\t\t'contains': function(codePoint) {\n\t\t\treturn dataContains(\n\t\t\t\tthis.data,\n\t\t\t\tisNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint)\n\t\t\t);\n\t\t},\n\t\t'clone': function() {\n\t\t\tvar set = new regenerate;\n\t\t\tset.data = this.data.slice(0);\n\t\t\treturn set;\n\t\t},\n\t\t'toString': function(options) {\n\t\t\tvar result = createCharacterClassesFromData(\n\t\t\t\tthis.data,\n\t\t\t\toptions ? options.bmpOnly : false,\n\t\t\t\toptions ? options.hasUnicodeFlag : false\n\t\t\t);\n\t\t\tif (!result) {\n\t\t\t\t// For an empty set, return something that can be inserted `/here/` to\n\t\t\t\t// form a valid regular expression. Avoid `(?:)` since that matches the\n\t\t\t\t// empty string.\n\t\t\t\treturn '[]';\n\t\t\t}\n\t\t\t// Use `\\0` instead of `\\x00` where possible.\n\t\t\treturn result.replace(regexNull, '\\\\0$1');\n\t\t},\n\t\t'toRegExp': function(flags) {\n\t\t\tvar pattern = this.toString(\n\t\t\t\tflags && flags.indexOf('u') != -1 ?\n\t\t\t\t\t{ 'hasUnicodeFlag': true } :\n\t\t\t\t\tnull\n\t\t\t);\n\t\t\treturn RegExp(pattern, flags || '');\n\t\t},\n\t\t'valueOf': function() { // Note: `valueOf` is aliased as `toArray`.\n\t\t\treturn dataToArray(this.data);\n\t\t}\n\t});\n\n\tproto.toArray = proto.valueOf;\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn regenerate;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = regenerate;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfreeExports.regenerate = regenerate;\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.regenerate = regenerate;\n\t}\n\n}(this));\n","module.exports = new Set([\n\t// Non-binary properties:\n\t'General_Category',\n\t'Script',\n\t'Script_Extensions',\n\t// Binary properties:\n\t'Alphabetic',\n\t'Any',\n\t'ASCII',\n\t'ASCII_Hex_Digit',\n\t'Assigned',\n\t'Bidi_Control',\n\t'Bidi_Mirrored',\n\t'Case_Ignorable',\n\t'Cased',\n\t'Changes_When_Casefolded',\n\t'Changes_When_Casemapped',\n\t'Changes_When_Lowercased',\n\t'Changes_When_NFKC_Casefolded',\n\t'Changes_When_Titlecased',\n\t'Changes_When_Uppercased',\n\t'Dash',\n\t'Default_Ignorable_Code_Point',\n\t'Deprecated',\n\t'Diacritic',\n\t'Emoji',\n\t'Emoji_Component',\n\t'Emoji_Modifier',\n\t'Emoji_Modifier_Base',\n\t'Emoji_Presentation',\n\t'Extended_Pictographic',\n\t'Extender',\n\t'Grapheme_Base',\n\t'Grapheme_Extend',\n\t'Hex_Digit',\n\t'ID_Continue',\n\t'ID_Start',\n\t'Ideographic',\n\t'IDS_Binary_Operator',\n\t'IDS_Trinary_Operator',\n\t'Join_Control',\n\t'Logical_Order_Exception',\n\t'Lowercase',\n\t'Math',\n\t'Noncharacter_Code_Point',\n\t'Pattern_Syntax',\n\t'Pattern_White_Space',\n\t'Quotation_Mark',\n\t'Radical',\n\t'Regional_Indicator',\n\t'Sentence_Terminal',\n\t'Soft_Dotted',\n\t'Terminal_Punctuation',\n\t'Unified_Ideograph',\n\t'Uppercase',\n\t'Variation_Selector',\n\t'White_Space',\n\t'XID_Continue',\n\t'XID_Start'\n]);\n","// Generated using `npm run build`. Do not edit!\nmodule.exports = new Map([\n\t['scx', 'Script_Extensions'],\n\t['sc', 'Script'],\n\t['gc', 'General_Category'],\n\t['AHex', 'ASCII_Hex_Digit'],\n\t['Alpha', 'Alphabetic'],\n\t['Bidi_C', 'Bidi_Control'],\n\t['Bidi_M', 'Bidi_Mirrored'],\n\t['Cased', 'Cased'],\n\t['CI', 'Case_Ignorable'],\n\t['CWCF', 'Changes_When_Casefolded'],\n\t['CWCM', 'Changes_When_Casemapped'],\n\t['CWKCF', 'Changes_When_NFKC_Casefolded'],\n\t['CWL', 'Changes_When_Lowercased'],\n\t['CWT', 'Changes_When_Titlecased'],\n\t['CWU', 'Changes_When_Uppercased'],\n\t['Dash', 'Dash'],\n\t['Dep', 'Deprecated'],\n\t['DI', 'Default_Ignorable_Code_Point'],\n\t['Dia', 'Diacritic'],\n\t['Ext', 'Extender'],\n\t['Gr_Base', 'Grapheme_Base'],\n\t['Gr_Ext', 'Grapheme_Extend'],\n\t['Hex', 'Hex_Digit'],\n\t['IDC', 'ID_Continue'],\n\t['Ideo', 'Ideographic'],\n\t['IDS', 'ID_Start'],\n\t['IDSB', 'IDS_Binary_Operator'],\n\t['IDST', 'IDS_Trinary_Operator'],\n\t['Join_C', 'Join_Control'],\n\t['LOE', 'Logical_Order_Exception'],\n\t['Lower', 'Lowercase'],\n\t['Math', 'Math'],\n\t['NChar', 'Noncharacter_Code_Point'],\n\t['Pat_Syn', 'Pattern_Syntax'],\n\t['Pat_WS', 'Pattern_White_Space'],\n\t['QMark', 'Quotation_Mark'],\n\t['Radical', 'Radical'],\n\t['RI', 'Regional_Indicator'],\n\t['SD', 'Soft_Dotted'],\n\t['STerm', 'Sentence_Terminal'],\n\t['Term', 'Terminal_Punctuation'],\n\t['UIdeo', 'Unified_Ideograph'],\n\t['Upper', 'Uppercase'],\n\t['VS', 'Variation_Selector'],\n\t['WSpace', 'White_Space'],\n\t['space', 'White_Space'],\n\t['XIDC', 'XID_Continue'],\n\t['XIDS', 'XID_Start']\n]);\n","'use strict';\n\nconst canonicalProperties = require('unicode-canonical-property-names-ecmascript');\nconst propertyAliases = require('unicode-property-aliases-ecmascript');\n\nconst matchProperty = function(property) {\n\tif (canonicalProperties.has(property)) {\n\t\treturn property;\n\t}\n\tif (propertyAliases.has(property)) {\n\t\treturn propertyAliases.get(property);\n\t}\n\tthrow new Error(`Unknown property: ${ property }`);\n};\n\nmodule.exports = matchProperty;\n","module.exports = new Map([\n\t['General_Category', new Map([\n\t\t['C', 'Other'],\n\t\t['Cc', 'Control'],\n\t\t['cntrl', 'Control'],\n\t\t['Cf', 'Format'],\n\t\t['Cn', 'Unassigned'],\n\t\t['Co', 'Private_Use'],\n\t\t['Cs', 'Surrogate'],\n\t\t['L', 'Letter'],\n\t\t['LC', 'Cased_Letter'],\n\t\t['Ll', 'Lowercase_Letter'],\n\t\t['Lm', 'Modifier_Letter'],\n\t\t['Lo', 'Other_Letter'],\n\t\t['Lt', 'Titlecase_Letter'],\n\t\t['Lu', 'Uppercase_Letter'],\n\t\t['M', 'Mark'],\n\t\t['Combining_Mark', 'Mark'],\n\t\t['Mc', 'Spacing_Mark'],\n\t\t['Me', 'Enclosing_Mark'],\n\t\t['Mn', 'Nonspacing_Mark'],\n\t\t['N', 'Number'],\n\t\t['Nd', 'Decimal_Number'],\n\t\t['digit', 'Decimal_Number'],\n\t\t['Nl', 'Letter_Number'],\n\t\t['No', 'Other_Number'],\n\t\t['P', 'Punctuation'],\n\t\t['punct', 'Punctuation'],\n\t\t['Pc', 'Connector_Punctuation'],\n\t\t['Pd', 'Dash_Punctuation'],\n\t\t['Pe', 'Close_Punctuation'],\n\t\t['Pf', 'Final_Punctuation'],\n\t\t['Pi', 'Initial_Punctuation'],\n\t\t['Po', 'Other_Punctuation'],\n\t\t['Ps', 'Open_Punctuation'],\n\t\t['S', 'Symbol'],\n\t\t['Sc', 'Currency_Symbol'],\n\t\t['Sk', 'Modifier_Symbol'],\n\t\t['Sm', 'Math_Symbol'],\n\t\t['So', 'Other_Symbol'],\n\t\t['Z', 'Separator'],\n\t\t['Zl', 'Line_Separator'],\n\t\t['Zp', 'Paragraph_Separator'],\n\t\t['Zs', 'Space_Separator'],\n\t\t['Other', 'Other'],\n\t\t['Control', 'Control'],\n\t\t['Format', 'Format'],\n\t\t['Unassigned', 'Unassigned'],\n\t\t['Private_Use', 'Private_Use'],\n\t\t['Surrogate', 'Surrogate'],\n\t\t['Letter', 'Letter'],\n\t\t['Cased_Letter', 'Cased_Letter'],\n\t\t['Lowercase_Letter', 'Lowercase_Letter'],\n\t\t['Modifier_Letter', 'Modifier_Letter'],\n\t\t['Other_Letter', 'Other_Letter'],\n\t\t['Titlecase_Letter', 'Titlecase_Letter'],\n\t\t['Uppercase_Letter', 'Uppercase_Letter'],\n\t\t['Mark', 'Mark'],\n\t\t['Spacing_Mark', 'Spacing_Mark'],\n\t\t['Enclosing_Mark', 'Enclosing_Mark'],\n\t\t['Nonspacing_Mark', 'Nonspacing_Mark'],\n\t\t['Number', 'Number'],\n\t\t['Decimal_Number', 'Decimal_Number'],\n\t\t['Letter_Number', 'Letter_Number'],\n\t\t['Other_Number', 'Other_Number'],\n\t\t['Punctuation', 'Punctuation'],\n\t\t['Connector_Punctuation', 'Connector_Punctuation'],\n\t\t['Dash_Punctuation', 'Dash_Punctuation'],\n\t\t['Close_Punctuation', 'Close_Punctuation'],\n\t\t['Final_Punctuation', 'Final_Punctuation'],\n\t\t['Initial_Punctuation', 'Initial_Punctuation'],\n\t\t['Other_Punctuation', 'Other_Punctuation'],\n\t\t['Open_Punctuation', 'Open_Punctuation'],\n\t\t['Symbol', 'Symbol'],\n\t\t['Currency_Symbol', 'Currency_Symbol'],\n\t\t['Modifier_Symbol', 'Modifier_Symbol'],\n\t\t['Math_Symbol', 'Math_Symbol'],\n\t\t['Other_Symbol', 'Other_Symbol'],\n\t\t['Separator', 'Separator'],\n\t\t['Line_Separator', 'Line_Separator'],\n\t\t['Paragraph_Separator', 'Paragraph_Separator'],\n\t\t['Space_Separator', 'Space_Separator']\n\t])],\n\t['Script', new Map([\n\t\t['Adlm', 'Adlam'],\n\t\t['Aghb', 'Caucasian_Albanian'],\n\t\t['Ahom', 'Ahom'],\n\t\t['Arab', 'Arabic'],\n\t\t['Armi', 'Imperial_Aramaic'],\n\t\t['Armn', 'Armenian'],\n\t\t['Avst', 'Avestan'],\n\t\t['Bali', 'Balinese'],\n\t\t['Bamu', 'Bamum'],\n\t\t['Bass', 'Bassa_Vah'],\n\t\t['Batk', 'Batak'],\n\t\t['Beng', 'Bengali'],\n\t\t['Bhks', 'Bhaiksuki'],\n\t\t['Bopo', 'Bopomofo'],\n\t\t['Brah', 'Brahmi'],\n\t\t['Brai', 'Braille'],\n\t\t['Bugi', 'Buginese'],\n\t\t['Buhd', 'Buhid'],\n\t\t['Cakm', 'Chakma'],\n\t\t['Cans', 'Canadian_Aboriginal'],\n\t\t['Cari', 'Carian'],\n\t\t['Cham', 'Cham'],\n\t\t['Cher', 'Cherokee'],\n\t\t['Copt', 'Coptic'],\n\t\t['Qaac', 'Coptic'],\n\t\t['Cprt', 'Cypriot'],\n\t\t['Cyrl', 'Cyrillic'],\n\t\t['Deva', 'Devanagari'],\n\t\t['Dogr', 'Dogra'],\n\t\t['Dsrt', 'Deseret'],\n\t\t['Dupl', 'Duployan'],\n\t\t['Egyp', 'Egyptian_Hieroglyphs'],\n\t\t['Elba', 'Elbasan'],\n\t\t['Elym', 'Elymaic'],\n\t\t['Ethi', 'Ethiopic'],\n\t\t['Geor', 'Georgian'],\n\t\t['Glag', 'Glagolitic'],\n\t\t['Gong', 'Gunjala_Gondi'],\n\t\t['Gonm', 'Masaram_Gondi'],\n\t\t['Goth', 'Gothic'],\n\t\t['Gran', 'Grantha'],\n\t\t['Grek', 'Greek'],\n\t\t['Gujr', 'Gujarati'],\n\t\t['Guru', 'Gurmukhi'],\n\t\t['Hang', 'Hangul'],\n\t\t['Hani', 'Han'],\n\t\t['Hano', 'Hanunoo'],\n\t\t['Hatr', 'Hatran'],\n\t\t['Hebr', 'Hebrew'],\n\t\t['Hira', 'Hiragana'],\n\t\t['Hluw', 'Anatolian_Hieroglyphs'],\n\t\t['Hmng', 'Pahawh_Hmong'],\n\t\t['Hmnp', 'Nyiakeng_Puachue_Hmong'],\n\t\t['Hrkt', 'Katakana_Or_Hiragana'],\n\t\t['Hung', 'Old_Hungarian'],\n\t\t['Ital', 'Old_Italic'],\n\t\t['Java', 'Javanese'],\n\t\t['Kali', 'Kayah_Li'],\n\t\t['Kana', 'Katakana'],\n\t\t['Khar', 'Kharoshthi'],\n\t\t['Khmr', 'Khmer'],\n\t\t['Khoj', 'Khojki'],\n\t\t['Knda', 'Kannada'],\n\t\t['Kthi', 'Kaithi'],\n\t\t['Lana', 'Tai_Tham'],\n\t\t['Laoo', 'Lao'],\n\t\t['Latn', 'Latin'],\n\t\t['Lepc', 'Lepcha'],\n\t\t['Limb', 'Limbu'],\n\t\t['Lina', 'Linear_A'],\n\t\t['Linb', 'Linear_B'],\n\t\t['Lisu', 'Lisu'],\n\t\t['Lyci', 'Lycian'],\n\t\t['Lydi', 'Lydian'],\n\t\t['Mahj', 'Mahajani'],\n\t\t['Maka', 'Makasar'],\n\t\t['Mand', 'Mandaic'],\n\t\t['Mani', 'Manichaean'],\n\t\t['Marc', 'Marchen'],\n\t\t['Medf', 'Medefaidrin'],\n\t\t['Mend', 'Mende_Kikakui'],\n\t\t['Merc', 'Meroitic_Cursive'],\n\t\t['Mero', 'Meroitic_Hieroglyphs'],\n\t\t['Mlym', 'Malayalam'],\n\t\t['Modi', 'Modi'],\n\t\t['Mong', 'Mongolian'],\n\t\t['Mroo', 'Mro'],\n\t\t['Mtei', 'Meetei_Mayek'],\n\t\t['Mult', 'Multani'],\n\t\t['Mymr', 'Myanmar'],\n\t\t['Nand', 'Nandinagari'],\n\t\t['Narb', 'Old_North_Arabian'],\n\t\t['Nbat', 'Nabataean'],\n\t\t['Newa', 'Newa'],\n\t\t['Nkoo', 'Nko'],\n\t\t['Nshu', 'Nushu'],\n\t\t['Ogam', 'Ogham'],\n\t\t['Olck', 'Ol_Chiki'],\n\t\t['Orkh', 'Old_Turkic'],\n\t\t['Orya', 'Oriya'],\n\t\t['Osge', 'Osage'],\n\t\t['Osma', 'Osmanya'],\n\t\t['Palm', 'Palmyrene'],\n\t\t['Pauc', 'Pau_Cin_Hau'],\n\t\t['Perm', 'Old_Permic'],\n\t\t['Phag', 'Phags_Pa'],\n\t\t['Phli', 'Inscriptional_Pahlavi'],\n\t\t['Phlp', 'Psalter_Pahlavi'],\n\t\t['Phnx', 'Phoenician'],\n\t\t['Plrd', 'Miao'],\n\t\t['Prti', 'Inscriptional_Parthian'],\n\t\t['Rjng', 'Rejang'],\n\t\t['Rohg', 'Hanifi_Rohingya'],\n\t\t['Runr', 'Runic'],\n\t\t['Samr', 'Samaritan'],\n\t\t['Sarb', 'Old_South_Arabian'],\n\t\t['Saur', 'Saurashtra'],\n\t\t['Sgnw', 'SignWriting'],\n\t\t['Shaw', 'Shavian'],\n\t\t['Shrd', 'Sharada'],\n\t\t['Sidd', 'Siddham'],\n\t\t['Sind', 'Khudawadi'],\n\t\t['Sinh', 'Sinhala'],\n\t\t['Sogd', 'Sogdian'],\n\t\t['Sogo', 'Old_Sogdian'],\n\t\t['Sora', 'Sora_Sompeng'],\n\t\t['Soyo', 'Soyombo'],\n\t\t['Sund', 'Sundanese'],\n\t\t['Sylo', 'Syloti_Nagri'],\n\t\t['Syrc', 'Syriac'],\n\t\t['Tagb', 'Tagbanwa'],\n\t\t['Takr', 'Takri'],\n\t\t['Tale', 'Tai_Le'],\n\t\t['Talu', 'New_Tai_Lue'],\n\t\t['Taml', 'Tamil'],\n\t\t['Tang', 'Tangut'],\n\t\t['Tavt', 'Tai_Viet'],\n\t\t['Telu', 'Telugu'],\n\t\t['Tfng', 'Tifinagh'],\n\t\t['Tglg', 'Tagalog'],\n\t\t['Thaa', 'Thaana'],\n\t\t['Thai', 'Thai'],\n\t\t['Tibt', 'Tibetan'],\n\t\t['Tirh', 'Tirhuta'],\n\t\t['Ugar', 'Ugaritic'],\n\t\t['Vaii', 'Vai'],\n\t\t['Wara', 'Warang_Citi'],\n\t\t['Wcho', 'Wancho'],\n\t\t['Xpeo', 'Old_Persian'],\n\t\t['Xsux', 'Cuneiform'],\n\t\t['Yiii', 'Yi'],\n\t\t['Zanb', 'Zanabazar_Square'],\n\t\t['Zinh', 'Inherited'],\n\t\t['Qaai', 'Inherited'],\n\t\t['Zyyy', 'Common'],\n\t\t['Zzzz', 'Unknown'],\n\t\t['Adlam', 'Adlam'],\n\t\t['Caucasian_Albanian', 'Caucasian_Albanian'],\n\t\t['Arabic', 'Arabic'],\n\t\t['Imperial_Aramaic', 'Imperial_Aramaic'],\n\t\t['Armenian', 'Armenian'],\n\t\t['Avestan', 'Avestan'],\n\t\t['Balinese', 'Balinese'],\n\t\t['Bamum', 'Bamum'],\n\t\t['Bassa_Vah', 'Bassa_Vah'],\n\t\t['Batak', 'Batak'],\n\t\t['Bengali', 'Bengali'],\n\t\t['Bhaiksuki', 'Bhaiksuki'],\n\t\t['Bopomofo', 'Bopomofo'],\n\t\t['Brahmi', 'Brahmi'],\n\t\t['Braille', 'Braille'],\n\t\t['Buginese', 'Buginese'],\n\t\t['Buhid', 'Buhid'],\n\t\t['Chakma', 'Chakma'],\n\t\t['Canadian_Aboriginal', 'Canadian_Aboriginal'],\n\t\t['Carian', 'Carian'],\n\t\t['Cherokee', 'Cherokee'],\n\t\t['Coptic', 'Coptic'],\n\t\t['Cypriot', 'Cypriot'],\n\t\t['Cyrillic', 'Cyrillic'],\n\t\t['Devanagari', 'Devanagari'],\n\t\t['Dogra', 'Dogra'],\n\t\t['Deseret', 'Deseret'],\n\t\t['Duployan', 'Duployan'],\n\t\t['Egyptian_Hieroglyphs', 'Egyptian_Hieroglyphs'],\n\t\t['Elbasan', 'Elbasan'],\n\t\t['Elymaic', 'Elymaic'],\n\t\t['Ethiopic', 'Ethiopic'],\n\t\t['Georgian', 'Georgian'],\n\t\t['Glagolitic', 'Glagolitic'],\n\t\t['Gunjala_Gondi', 'Gunjala_Gondi'],\n\t\t['Masaram_Gondi', 'Masaram_Gondi'],\n\t\t['Gothic', 'Gothic'],\n\t\t['Grantha', 'Grantha'],\n\t\t['Greek', 'Greek'],\n\t\t['Gujarati', 'Gujarati'],\n\t\t['Gurmukhi', 'Gurmukhi'],\n\t\t['Hangul', 'Hangul'],\n\t\t['Han', 'Han'],\n\t\t['Hanunoo', 'Hanunoo'],\n\t\t['Hatran', 'Hatran'],\n\t\t['Hebrew', 'Hebrew'],\n\t\t['Hiragana', 'Hiragana'],\n\t\t['Anatolian_Hieroglyphs', 'Anatolian_Hieroglyphs'],\n\t\t['Pahawh_Hmong', 'Pahawh_Hmong'],\n\t\t['Nyiakeng_Puachue_Hmong', 'Nyiakeng_Puachue_Hmong'],\n\t\t['Katakana_Or_Hiragana', 'Katakana_Or_Hiragana'],\n\t\t['Old_Hungarian', 'Old_Hungarian'],\n\t\t['Old_Italic', 'Old_Italic'],\n\t\t['Javanese', 'Javanese'],\n\t\t['Kayah_Li', 'Kayah_Li'],\n\t\t['Katakana', 'Katakana'],\n\t\t['Kharoshthi', 'Kharoshthi'],\n\t\t['Khmer', 'Khmer'],\n\t\t['Khojki', 'Khojki'],\n\t\t['Kannada', 'Kannada'],\n\t\t['Kaithi', 'Kaithi'],\n\t\t['Tai_Tham', 'Tai_Tham'],\n\t\t['Lao', 'Lao'],\n\t\t['Latin', 'Latin'],\n\t\t['Lepcha', 'Lepcha'],\n\t\t['Limbu', 'Limbu'],\n\t\t['Linear_A', 'Linear_A'],\n\t\t['Linear_B', 'Linear_B'],\n\t\t['Lycian', 'Lycian'],\n\t\t['Lydian', 'Lydian'],\n\t\t['Mahajani', 'Mahajani'],\n\t\t['Makasar', 'Makasar'],\n\t\t['Mandaic', 'Mandaic'],\n\t\t['Manichaean', 'Manichaean'],\n\t\t['Marchen', 'Marchen'],\n\t\t['Medefaidrin', 'Medefaidrin'],\n\t\t['Mende_Kikakui', 'Mende_Kikakui'],\n\t\t['Meroitic_Cursive', 'Meroitic_Cursive'],\n\t\t['Meroitic_Hieroglyphs', 'Meroitic_Hieroglyphs'],\n\t\t['Malayalam', 'Malayalam'],\n\t\t['Mongolian', 'Mongolian'],\n\t\t['Mro', 'Mro'],\n\t\t['Meetei_Mayek', 'Meetei_Mayek'],\n\t\t['Multani', 'Multani'],\n\t\t['Myanmar', 'Myanmar'],\n\t\t['Nandinagari', 'Nandinagari'],\n\t\t['Old_North_Arabian', 'Old_North_Arabian'],\n\t\t['Nabataean', 'Nabataean'],\n\t\t['Nko', 'Nko'],\n\t\t['Nushu', 'Nushu'],\n\t\t['Ogham', 'Ogham'],\n\t\t['Ol_Chiki', 'Ol_Chiki'],\n\t\t['Old_Turkic', 'Old_Turkic'],\n\t\t['Oriya', 'Oriya'],\n\t\t['Osage', 'Osage'],\n\t\t['Osmanya', 'Osmanya'],\n\t\t['Palmyrene', 'Palmyrene'],\n\t\t['Pau_Cin_Hau', 'Pau_Cin_Hau'],\n\t\t['Old_Permic', 'Old_Permic'],\n\t\t['Phags_Pa', 'Phags_Pa'],\n\t\t['Inscriptional_Pahlavi', 'Inscriptional_Pahlavi'],\n\t\t['Psalter_Pahlavi', 'Psalter_Pahlavi'],\n\t\t['Phoenician', 'Phoenician'],\n\t\t['Miao', 'Miao'],\n\t\t['Inscriptional_Parthian', 'Inscriptional_Parthian'],\n\t\t['Rejang', 'Rejang'],\n\t\t['Hanifi_Rohingya', 'Hanifi_Rohingya'],\n\t\t['Runic', 'Runic'],\n\t\t['Samaritan', 'Samaritan'],\n\t\t['Old_South_Arabian', 'Old_South_Arabian'],\n\t\t['Saurashtra', 'Saurashtra'],\n\t\t['SignWriting', 'SignWriting'],\n\t\t['Shavian', 'Shavian'],\n\t\t['Sharada', 'Sharada'],\n\t\t['Siddham', 'Siddham'],\n\t\t['Khudawadi', 'Khudawadi'],\n\t\t['Sinhala', 'Sinhala'],\n\t\t['Sogdian', 'Sogdian'],\n\t\t['Old_Sogdian', 'Old_Sogdian'],\n\t\t['Sora_Sompeng', 'Sora_Sompeng'],\n\t\t['Soyombo', 'Soyombo'],\n\t\t['Sundanese', 'Sundanese'],\n\t\t['Syloti_Nagri', 'Syloti_Nagri'],\n\t\t['Syriac', 'Syriac'],\n\t\t['Tagbanwa', 'Tagbanwa'],\n\t\t['Takri', 'Takri'],\n\t\t['Tai_Le', 'Tai_Le'],\n\t\t['New_Tai_Lue', 'New_Tai_Lue'],\n\t\t['Tamil', 'Tamil'],\n\t\t['Tangut', 'Tangut'],\n\t\t['Tai_Viet', 'Tai_Viet'],\n\t\t['Telugu', 'Telugu'],\n\t\t['Tifinagh', 'Tifinagh'],\n\t\t['Tagalog', 'Tagalog'],\n\t\t['Thaana', 'Thaana'],\n\t\t['Tibetan', 'Tibetan'],\n\t\t['Tirhuta', 'Tirhuta'],\n\t\t['Ugaritic', 'Ugaritic'],\n\t\t['Vai', 'Vai'],\n\t\t['Warang_Citi', 'Warang_Citi'],\n\t\t['Wancho', 'Wancho'],\n\t\t['Old_Persian', 'Old_Persian'],\n\t\t['Cuneiform', 'Cuneiform'],\n\t\t['Yi', 'Yi'],\n\t\t['Zanabazar_Square', 'Zanabazar_Square'],\n\t\t['Inherited', 'Inherited'],\n\t\t['Common', 'Common'],\n\t\t['Unknown', 'Unknown']\n\t])],\n\t['Script_Extensions', new Map([\n\t\t['Adlm', 'Adlam'],\n\t\t['Aghb', 'Caucasian_Albanian'],\n\t\t['Ahom', 'Ahom'],\n\t\t['Arab', 'Arabic'],\n\t\t['Armi', 'Imperial_Aramaic'],\n\t\t['Armn', 'Armenian'],\n\t\t['Avst', 'Avestan'],\n\t\t['Bali', 'Balinese'],\n\t\t['Bamu', 'Bamum'],\n\t\t['Bass', 'Bassa_Vah'],\n\t\t['Batk', 'Batak'],\n\t\t['Beng', 'Bengali'],\n\t\t['Bhks', 'Bhaiksuki'],\n\t\t['Bopo', 'Bopomofo'],\n\t\t['Brah', 'Brahmi'],\n\t\t['Brai', 'Braille'],\n\t\t['Bugi', 'Buginese'],\n\t\t['Buhd', 'Buhid'],\n\t\t['Cakm', 'Chakma'],\n\t\t['Cans', 'Canadian_Aboriginal'],\n\t\t['Cari', 'Carian'],\n\t\t['Cham', 'Cham'],\n\t\t['Cher', 'Cherokee'],\n\t\t['Copt', 'Coptic'],\n\t\t['Qaac', 'Coptic'],\n\t\t['Cprt', 'Cypriot'],\n\t\t['Cyrl', 'Cyrillic'],\n\t\t['Deva', 'Devanagari'],\n\t\t['Dogr', 'Dogra'],\n\t\t['Dsrt', 'Deseret'],\n\t\t['Dupl', 'Duployan'],\n\t\t['Egyp', 'Egyptian_Hieroglyphs'],\n\t\t['Elba', 'Elbasan'],\n\t\t['Elym', 'Elymaic'],\n\t\t['Ethi', 'Ethiopic'],\n\t\t['Geor', 'Georgian'],\n\t\t['Glag', 'Glagolitic'],\n\t\t['Gong', 'Gunjala_Gondi'],\n\t\t['Gonm', 'Masaram_Gondi'],\n\t\t['Goth', 'Gothic'],\n\t\t['Gran', 'Grantha'],\n\t\t['Grek', 'Greek'],\n\t\t['Gujr', 'Gujarati'],\n\t\t['Guru', 'Gurmukhi'],\n\t\t['Hang', 'Hangul'],\n\t\t['Hani', 'Han'],\n\t\t['Hano', 'Hanunoo'],\n\t\t['Hatr', 'Hatran'],\n\t\t['Hebr', 'Hebrew'],\n\t\t['Hira', 'Hiragana'],\n\t\t['Hluw', 'Anatolian_Hieroglyphs'],\n\t\t['Hmng', 'Pahawh_Hmong'],\n\t\t['Hmnp', 'Nyiakeng_Puachue_Hmong'],\n\t\t['Hrkt', 'Katakana_Or_Hiragana'],\n\t\t['Hung', 'Old_Hungarian'],\n\t\t['Ital', 'Old_Italic'],\n\t\t['Java', 'Javanese'],\n\t\t['Kali', 'Kayah_Li'],\n\t\t['Kana', 'Katakana'],\n\t\t['Khar', 'Kharoshthi'],\n\t\t['Khmr', 'Khmer'],\n\t\t['Khoj', 'Khojki'],\n\t\t['Knda', 'Kannada'],\n\t\t['Kthi', 'Kaithi'],\n\t\t['Lana', 'Tai_Tham'],\n\t\t['Laoo', 'Lao'],\n\t\t['Latn', 'Latin'],\n\t\t['Lepc', 'Lepcha'],\n\t\t['Limb', 'Limbu'],\n\t\t['Lina', 'Linear_A'],\n\t\t['Linb', 'Linear_B'],\n\t\t['Lisu', 'Lisu'],\n\t\t['Lyci', 'Lycian'],\n\t\t['Lydi', 'Lydian'],\n\t\t['Mahj', 'Mahajani'],\n\t\t['Maka', 'Makasar'],\n\t\t['Mand', 'Mandaic'],\n\t\t['Mani', 'Manichaean'],\n\t\t['Marc', 'Marchen'],\n\t\t['Medf', 'Medefaidrin'],\n\t\t['Mend', 'Mende_Kikakui'],\n\t\t['Merc', 'Meroitic_Cursive'],\n\t\t['Mero', 'Meroitic_Hieroglyphs'],\n\t\t['Mlym', 'Malayalam'],\n\t\t['Modi', 'Modi'],\n\t\t['Mong', 'Mongolian'],\n\t\t['Mroo', 'Mro'],\n\t\t['Mtei', 'Meetei_Mayek'],\n\t\t['Mult', 'Multani'],\n\t\t['Mymr', 'Myanmar'],\n\t\t['Nand', 'Nandinagari'],\n\t\t['Narb', 'Old_North_Arabian'],\n\t\t['Nbat', 'Nabataean'],\n\t\t['Newa', 'Newa'],\n\t\t['Nkoo', 'Nko'],\n\t\t['Nshu', 'Nushu'],\n\t\t['Ogam', 'Ogham'],\n\t\t['Olck', 'Ol_Chiki'],\n\t\t['Orkh', 'Old_Turkic'],\n\t\t['Orya', 'Oriya'],\n\t\t['Osge', 'Osage'],\n\t\t['Osma', 'Osmanya'],\n\t\t['Palm', 'Palmyrene'],\n\t\t['Pauc', 'Pau_Cin_Hau'],\n\t\t['Perm', 'Old_Permic'],\n\t\t['Phag', 'Phags_Pa'],\n\t\t['Phli', 'Inscriptional_Pahlavi'],\n\t\t['Phlp', 'Psalter_Pahlavi'],\n\t\t['Phnx', 'Phoenician'],\n\t\t['Plrd', 'Miao'],\n\t\t['Prti', 'Inscriptional_Parthian'],\n\t\t['Rjng', 'Rejang'],\n\t\t['Rohg', 'Hanifi_Rohingya'],\n\t\t['Runr', 'Runic'],\n\t\t['Samr', 'Samaritan'],\n\t\t['Sarb', 'Old_South_Arabian'],\n\t\t['Saur', 'Saurashtra'],\n\t\t['Sgnw', 'SignWriting'],\n\t\t['Shaw', 'Shavian'],\n\t\t['Shrd', 'Sharada'],\n\t\t['Sidd', 'Siddham'],\n\t\t['Sind', 'Khudawadi'],\n\t\t['Sinh', 'Sinhala'],\n\t\t['Sogd', 'Sogdian'],\n\t\t['Sogo', 'Old_Sogdian'],\n\t\t['Sora', 'Sora_Sompeng'],\n\t\t['Soyo', 'Soyombo'],\n\t\t['Sund', 'Sundanese'],\n\t\t['Sylo', 'Syloti_Nagri'],\n\t\t['Syrc', 'Syriac'],\n\t\t['Tagb', 'Tagbanwa'],\n\t\t['Takr', 'Takri'],\n\t\t['Tale', 'Tai_Le'],\n\t\t['Talu', 'New_Tai_Lue'],\n\t\t['Taml', 'Tamil'],\n\t\t['Tang', 'Tangut'],\n\t\t['Tavt', 'Tai_Viet'],\n\t\t['Telu', 'Telugu'],\n\t\t['Tfng', 'Tifinagh'],\n\t\t['Tglg', 'Tagalog'],\n\t\t['Thaa', 'Thaana'],\n\t\t['Thai', 'Thai'],\n\t\t['Tibt', 'Tibetan'],\n\t\t['Tirh', 'Tirhuta'],\n\t\t['Ugar', 'Ugaritic'],\n\t\t['Vaii', 'Vai'],\n\t\t['Wara', 'Warang_Citi'],\n\t\t['Wcho', 'Wancho'],\n\t\t['Xpeo', 'Old_Persian'],\n\t\t['Xsux', 'Cuneiform'],\n\t\t['Yiii', 'Yi'],\n\t\t['Zanb', 'Zanabazar_Square'],\n\t\t['Zinh', 'Inherited'],\n\t\t['Qaai', 'Inherited'],\n\t\t['Zyyy', 'Common'],\n\t\t['Zzzz', 'Unknown'],\n\t\t['Adlam', 'Adlam'],\n\t\t['Caucasian_Albanian', 'Caucasian_Albanian'],\n\t\t['Arabic', 'Arabic'],\n\t\t['Imperial_Aramaic', 'Imperial_Aramaic'],\n\t\t['Armenian', 'Armenian'],\n\t\t['Avestan', 'Avestan'],\n\t\t['Balinese', 'Balinese'],\n\t\t['Bamum', 'Bamum'],\n\t\t['Bassa_Vah', 'Bassa_Vah'],\n\t\t['Batak', 'Batak'],\n\t\t['Bengali', 'Bengali'],\n\t\t['Bhaiksuki', 'Bhaiksuki'],\n\t\t['Bopomofo', 'Bopomofo'],\n\t\t['Brahmi', 'Brahmi'],\n\t\t['Braille', 'Braille'],\n\t\t['Buginese', 'Buginese'],\n\t\t['Buhid', 'Buhid'],\n\t\t['Chakma', 'Chakma'],\n\t\t['Canadian_Aboriginal', 'Canadian_Aboriginal'],\n\t\t['Carian', 'Carian'],\n\t\t['Cherokee', 'Cherokee'],\n\t\t['Coptic', 'Coptic'],\n\t\t['Cypriot', 'Cypriot'],\n\t\t['Cyrillic', 'Cyrillic'],\n\t\t['Devanagari', 'Devanagari'],\n\t\t['Dogra', 'Dogra'],\n\t\t['Deseret', 'Deseret'],\n\t\t['Duployan', 'Duployan'],\n\t\t['Egyptian_Hieroglyphs', 'Egyptian_Hieroglyphs'],\n\t\t['Elbasan', 'Elbasan'],\n\t\t['Elymaic', 'Elymaic'],\n\t\t['Ethiopic', 'Ethiopic'],\n\t\t['Georgian', 'Georgian'],\n\t\t['Glagolitic', 'Glagolitic'],\n\t\t['Gunjala_Gondi', 'Gunjala_Gondi'],\n\t\t['Masaram_Gondi', 'Masaram_Gondi'],\n\t\t['Gothic', 'Gothic'],\n\t\t['Grantha', 'Grantha'],\n\t\t['Greek', 'Greek'],\n\t\t['Gujarati', 'Gujarati'],\n\t\t['Gurmukhi', 'Gurmukhi'],\n\t\t['Hangul', 'Hangul'],\n\t\t['Han', 'Han'],\n\t\t['Hanunoo', 'Hanunoo'],\n\t\t['Hatran', 'Hatran'],\n\t\t['Hebrew', 'Hebrew'],\n\t\t['Hiragana', 'Hiragana'],\n\t\t['Anatolian_Hieroglyphs', 'Anatolian_Hieroglyphs'],\n\t\t['Pahawh_Hmong', 'Pahawh_Hmong'],\n\t\t['Nyiakeng_Puachue_Hmong', 'Nyiakeng_Puachue_Hmong'],\n\t\t['Katakana_Or_Hiragana', 'Katakana_Or_Hiragana'],\n\t\t['Old_Hungarian', 'Old_Hungarian'],\n\t\t['Old_Italic', 'Old_Italic'],\n\t\t['Javanese', 'Javanese'],\n\t\t['Kayah_Li', 'Kayah_Li'],\n\t\t['Katakana', 'Katakana'],\n\t\t['Kharoshthi', 'Kharoshthi'],\n\t\t['Khmer', 'Khmer'],\n\t\t['Khojki', 'Khojki'],\n\t\t['Kannada', 'Kannada'],\n\t\t['Kaithi', 'Kaithi'],\n\t\t['Tai_Tham', 'Tai_Tham'],\n\t\t['Lao', 'Lao'],\n\t\t['Latin', 'Latin'],\n\t\t['Lepcha', 'Lepcha'],\n\t\t['Limbu', 'Limbu'],\n\t\t['Linear_A', 'Linear_A'],\n\t\t['Linear_B', 'Linear_B'],\n\t\t['Lycian', 'Lycian'],\n\t\t['Lydian', 'Lydian'],\n\t\t['Mahajani', 'Mahajani'],\n\t\t['Makasar', 'Makasar'],\n\t\t['Mandaic', 'Mandaic'],\n\t\t['Manichaean', 'Manichaean'],\n\t\t['Marchen', 'Marchen'],\n\t\t['Medefaidrin', 'Medefaidrin'],\n\t\t['Mende_Kikakui', 'Mende_Kikakui'],\n\t\t['Meroitic_Cursive', 'Meroitic_Cursive'],\n\t\t['Meroitic_Hieroglyphs', 'Meroitic_Hieroglyphs'],\n\t\t['Malayalam', 'Malayalam'],\n\t\t['Mongolian', 'Mongolian'],\n\t\t['Mro', 'Mro'],\n\t\t['Meetei_Mayek', 'Meetei_Mayek'],\n\t\t['Multani', 'Multani'],\n\t\t['Myanmar', 'Myanmar'],\n\t\t['Nandinagari', 'Nandinagari'],\n\t\t['Old_North_Arabian', 'Old_North_Arabian'],\n\t\t['Nabataean', 'Nabataean'],\n\t\t['Nko', 'Nko'],\n\t\t['Nushu', 'Nushu'],\n\t\t['Ogham', 'Ogham'],\n\t\t['Ol_Chiki', 'Ol_Chiki'],\n\t\t['Old_Turkic', 'Old_Turkic'],\n\t\t['Oriya', 'Oriya'],\n\t\t['Osage', 'Osage'],\n\t\t['Osmanya', 'Osmanya'],\n\t\t['Palmyrene', 'Palmyrene'],\n\t\t['Pau_Cin_Hau', 'Pau_Cin_Hau'],\n\t\t['Old_Permic', 'Old_Permic'],\n\t\t['Phags_Pa', 'Phags_Pa'],\n\t\t['Inscriptional_Pahlavi', 'Inscriptional_Pahlavi'],\n\t\t['Psalter_Pahlavi', 'Psalter_Pahlavi'],\n\t\t['Phoenician', 'Phoenician'],\n\t\t['Miao', 'Miao'],\n\t\t['Inscriptional_Parthian', 'Inscriptional_Parthian'],\n\t\t['Rejang', 'Rejang'],\n\t\t['Hanifi_Rohingya', 'Hanifi_Rohingya'],\n\t\t['Runic', 'Runic'],\n\t\t['Samaritan', 'Samaritan'],\n\t\t['Old_South_Arabian', 'Old_South_Arabian'],\n\t\t['Saurashtra', 'Saurashtra'],\n\t\t['SignWriting', 'SignWriting'],\n\t\t['Shavian', 'Shavian'],\n\t\t['Sharada', 'Sharada'],\n\t\t['Siddham', 'Siddham'],\n\t\t['Khudawadi', 'Khudawadi'],\n\t\t['Sinhala', 'Sinhala'],\n\t\t['Sogdian', 'Sogdian'],\n\t\t['Old_Sogdian', 'Old_Sogdian'],\n\t\t['Sora_Sompeng', 'Sora_Sompeng'],\n\t\t['Soyombo', 'Soyombo'],\n\t\t['Sundanese', 'Sundanese'],\n\t\t['Syloti_Nagri', 'Syloti_Nagri'],\n\t\t['Syriac', 'Syriac'],\n\t\t['Tagbanwa', 'Tagbanwa'],\n\t\t['Takri', 'Takri'],\n\t\t['Tai_Le', 'Tai_Le'],\n\t\t['New_Tai_Lue', 'New_Tai_Lue'],\n\t\t['Tamil', 'Tamil'],\n\t\t['Tangut', 'Tangut'],\n\t\t['Tai_Viet', 'Tai_Viet'],\n\t\t['Telugu', 'Telugu'],\n\t\t['Tifinagh', 'Tifinagh'],\n\t\t['Tagalog', 'Tagalog'],\n\t\t['Thaana', 'Thaana'],\n\t\t['Tibetan', 'Tibetan'],\n\t\t['Tirhuta', 'Tirhuta'],\n\t\t['Ugaritic', 'Ugaritic'],\n\t\t['Vai', 'Vai'],\n\t\t['Warang_Citi', 'Warang_Citi'],\n\t\t['Wancho', 'Wancho'],\n\t\t['Old_Persian', 'Old_Persian'],\n\t\t['Cuneiform', 'Cuneiform'],\n\t\t['Yi', 'Yi'],\n\t\t['Zanabazar_Square', 'Zanabazar_Square'],\n\t\t['Inherited', 'Inherited'],\n\t\t['Common', 'Common'],\n\t\t['Unknown', 'Unknown']\n\t])]\n]);\n","'use strict';\n\nconst propertyToValueAliases = require('./data/mappings.js');\n\nconst matchPropertyValue = function(property, value) {\n\tconst aliasToValue = propertyToValueAliases.get(property);\n\tif (!aliasToValue) {\n\t\tthrow new Error(`Unknown property \\`${ property }\\`.`);\n\t}\n\tconst canonicalValue = aliasToValue.get(value);\n\tif (canonicalValue) {\n\t\treturn canonicalValue;\n\t}\n\tthrow new Error(\n\t\t`Unknown value \\`${ value }\\` for property \\`${ property }\\`.`\n\t);\n};\n\nmodule.exports = matchPropertyValue;\n","module.exports = new Map([\n\t[0x4B, 0x212A],\n\t[0x53, 0x17F],\n\t[0x6B, 0x212A],\n\t[0x73, 0x17F],\n\t[0xB5, 0x39C],\n\t[0xC5, 0x212B],\n\t[0xDF, 0x1E9E],\n\t[0xE5, 0x212B],\n\t[0x17F, 0x53],\n\t[0x1C4, 0x1C5],\n\t[0x1C5, 0x1C4],\n\t[0x1C7, 0x1C8],\n\t[0x1C8, 0x1C7],\n\t[0x1CA, 0x1CB],\n\t[0x1CB, 0x1CA],\n\t[0x1F1, 0x1F2],\n\t[0x1F2, 0x1F1],\n\t[0x26A, 0xA7AE],\n\t[0x282, 0xA7C5],\n\t[0x29D, 0xA7B2],\n\t[0x345, 0x1FBE],\n\t[0x392, 0x3D0],\n\t[0x395, 0x3F5],\n\t[0x398, 0x3F4],\n\t[0x399, 0x1FBE],\n\t[0x39A, 0x3F0],\n\t[0x39C, 0xB5],\n\t[0x3A0, 0x3D6],\n\t[0x3A1, 0x3F1],\n\t[0x3A3, 0x3C2],\n\t[0x3A6, 0x3D5],\n\t[0x3A9, 0x2126],\n\t[0x3B8, 0x3F4],\n\t[0x3C2, 0x3A3],\n\t[0x3C9, 0x2126],\n\t[0x3D0, 0x392],\n\t[0x3D1, 0x3F4],\n\t[0x3D5, 0x3A6],\n\t[0x3D6, 0x3A0],\n\t[0x3F0, 0x39A],\n\t[0x3F1, 0x3A1],\n\t[0x3F4, [\n\t\t0x398,\n\t\t0x3D1,\n\t\t0x3B8\n\t]],\n\t[0x3F5, 0x395],\n\t[0x412, 0x1C80],\n\t[0x414, 0x1C81],\n\t[0x41E, 0x1C82],\n\t[0x421, 0x1C83],\n\t[0x422, 0x1C85],\n\t[0x42A, 0x1C86],\n\t[0x432, 0x1C80],\n\t[0x434, 0x1C81],\n\t[0x43E, 0x1C82],\n\t[0x441, 0x1C83],\n\t[0x442, [\n\t\t0x1C84,\n\t\t0x1C85\n\t]],\n\t[0x44A, 0x1C86],\n\t[0x462, 0x1C87],\n\t[0x463, 0x1C87],\n\t[0x10D0, 0x1C90],\n\t[0x10D1, 0x1C91],\n\t[0x10D2, 0x1C92],\n\t[0x10D3, 0x1C93],\n\t[0x10D4, 0x1C94],\n\t[0x10D5, 0x1C95],\n\t[0x10D6, 0x1C96],\n\t[0x10D7, 0x1C97],\n\t[0x10D8, 0x1C98],\n\t[0x10D9, 0x1C99],\n\t[0x10DA, 0x1C9A],\n\t[0x10DB, 0x1C9B],\n\t[0x10DC, 0x1C9C],\n\t[0x10DD, 0x1C9D],\n\t[0x10DE, 0x1C9E],\n\t[0x10DF, 0x1C9F],\n\t[0x10E0, 0x1CA0],\n\t[0x10E1, 0x1CA1],\n\t[0x10E2, 0x1CA2],\n\t[0x10E3, 0x1CA3],\n\t[0x10E4, 0x1CA4],\n\t[0x10E5, 0x1CA5],\n\t[0x10E6, 0x1CA6],\n\t[0x10E7, 0x1CA7],\n\t[0x10E8, 0x1CA8],\n\t[0x10E9, 0x1CA9],\n\t[0x10EA, 0x1CAA],\n\t[0x10EB, 0x1CAB],\n\t[0x10EC, 0x1CAC],\n\t[0x10ED, 0x1CAD],\n\t[0x10EE, 0x1CAE],\n\t[0x10EF, 0x1CAF],\n\t[0x10F0, 0x1CB0],\n\t[0x10F1, 0x1CB1],\n\t[0x10F2, 0x1CB2],\n\t[0x10F3, 0x1CB3],\n\t[0x10F4, 0x1CB4],\n\t[0x10F5, 0x1CB5],\n\t[0x10F6, 0x1CB6],\n\t[0x10F7, 0x1CB7],\n\t[0x10F8, 0x1CB8],\n\t[0x10F9, 0x1CB9],\n\t[0x10FA, 0x1CBA],\n\t[0x10FD, 0x1CBD],\n\t[0x10FE, 0x1CBE],\n\t[0x10FF, 0x1CBF],\n\t[0x13A0, 0xAB70],\n\t[0x13A1, 0xAB71],\n\t[0x13A2, 0xAB72],\n\t[0x13A3, 0xAB73],\n\t[0x13A4, 0xAB74],\n\t[0x13A5, 0xAB75],\n\t[0x13A6, 0xAB76],\n\t[0x13A7, 0xAB77],\n\t[0x13A8, 0xAB78],\n\t[0x13A9, 0xAB79],\n\t[0x13AA, 0xAB7A],\n\t[0x13AB, 0xAB7B],\n\t[0x13AC, 0xAB7C],\n\t[0x13AD, 0xAB7D],\n\t[0x13AE, 0xAB7E],\n\t[0x13AF, 0xAB7F],\n\t[0x13B0, 0xAB80],\n\t[0x13B1, 0xAB81],\n\t[0x13B2, 0xAB82],\n\t[0x13B3, 0xAB83],\n\t[0x13B4, 0xAB84],\n\t[0x13B5, 0xAB85],\n\t[0x13B6, 0xAB86],\n\t[0x13B7, 0xAB87],\n\t[0x13B8, 0xAB88],\n\t[0x13B9, 0xAB89],\n\t[0x13BA, 0xAB8A],\n\t[0x13BB, 0xAB8B],\n\t[0x13BC, 0xAB8C],\n\t[0x13BD, 0xAB8D],\n\t[0x13BE, 0xAB8E],\n\t[0x13BF, 0xAB8F],\n\t[0x13C0, 0xAB90],\n\t[0x13C1, 0xAB91],\n\t[0x13C2, 0xAB92],\n\t[0x13C3, 0xAB93],\n\t[0x13C4, 0xAB94],\n\t[0x13C5, 0xAB95],\n\t[0x13C6, 0xAB96],\n\t[0x13C7, 0xAB97],\n\t[0x13C8, 0xAB98],\n\t[0x13C9, 0xAB99],\n\t[0x13CA, 0xAB9A],\n\t[0x13CB, 0xAB9B],\n\t[0x13CC, 0xAB9C],\n\t[0x13CD, 0xAB9D],\n\t[0x13CE, 0xAB9E],\n\t[0x13CF, 0xAB9F],\n\t[0x13D0, 0xABA0],\n\t[0x13D1, 0xABA1],\n\t[0x13D2, 0xABA2],\n\t[0x13D3, 0xABA3],\n\t[0x13D4, 0xABA4],\n\t[0x13D5, 0xABA5],\n\t[0x13D6, 0xABA6],\n\t[0x13D7, 0xABA7],\n\t[0x13D8, 0xABA8],\n\t[0x13D9, 0xABA9],\n\t[0x13DA, 0xABAA],\n\t[0x13DB, 0xABAB],\n\t[0x13DC, 0xABAC],\n\t[0x13DD, 0xABAD],\n\t[0x13DE, 0xABAE],\n\t[0x13DF, 0xABAF],\n\t[0x13E0, 0xABB0],\n\t[0x13E1, 0xABB1],\n\t[0x13E2, 0xABB2],\n\t[0x13E3, 0xABB3],\n\t[0x13E4, 0xABB4],\n\t[0x13E5, 0xABB5],\n\t[0x13E6, 0xABB6],\n\t[0x13E7, 0xABB7],\n\t[0x13E8, 0xABB8],\n\t[0x13E9, 0xABB9],\n\t[0x13EA, 0xABBA],\n\t[0x13EB, 0xABBB],\n\t[0x13EC, 0xABBC],\n\t[0x13ED, 0xABBD],\n\t[0x13EE, 0xABBE],\n\t[0x13EF, 0xABBF],\n\t[0x13F0, 0x13F8],\n\t[0x13F1, 0x13F9],\n\t[0x13F2, 0x13FA],\n\t[0x13F3, 0x13FB],\n\t[0x13F4, 0x13FC],\n\t[0x13F5, 0x13FD],\n\t[0x13F8, 0x13F0],\n\t[0x13F9, 0x13F1],\n\t[0x13FA, 0x13F2],\n\t[0x13FB, 0x13F3],\n\t[0x13FC, 0x13F4],\n\t[0x13FD, 0x13F5],\n\t[0x1C80, [\n\t\t0x412,\n\t\t0x432\n\t]],\n\t[0x1C81, [\n\t\t0x414,\n\t\t0x434\n\t]],\n\t[0x1C82, [\n\t\t0x41E,\n\t\t0x43E\n\t]],\n\t[0x1C83, [\n\t\t0x421,\n\t\t0x441\n\t]],\n\t[0x1C84, [\n\t\t0x1C85,\n\t\t0x442\n\t]],\n\t[0x1C85, [\n\t\t0x422,\n\t\t0x1C84,\n\t\t0x442\n\t]],\n\t[0x1C86, [\n\t\t0x42A,\n\t\t0x44A\n\t]],\n\t[0x1C87, [\n\t\t0x462,\n\t\t0x463\n\t]],\n\t[0x1C88, [\n\t\t0xA64A,\n\t\t0xA64B\n\t]],\n\t[0x1C90, 0x10D0],\n\t[0x1C91, 0x10D1],\n\t[0x1C92, 0x10D2],\n\t[0x1C93, 0x10D3],\n\t[0x1C94, 0x10D4],\n\t[0x1C95, 0x10D5],\n\t[0x1C96, 0x10D6],\n\t[0x1C97, 0x10D7],\n\t[0x1C98, 0x10D8],\n\t[0x1C99, 0x10D9],\n\t[0x1C9A, 0x10DA],\n\t[0x1C9B, 0x10DB],\n\t[0x1C9C, 0x10DC],\n\t[0x1C9D, 0x10DD],\n\t[0x1C9E, 0x10DE],\n\t[0x1C9F, 0x10DF],\n\t[0x1CA0, 0x10E0],\n\t[0x1CA1, 0x10E1],\n\t[0x1CA2, 0x10E2],\n\t[0x1CA3, 0x10E3],\n\t[0x1CA4, 0x10E4],\n\t[0x1CA5, 0x10E5],\n\t[0x1CA6, 0x10E6],\n\t[0x1CA7, 0x10E7],\n\t[0x1CA8, 0x10E8],\n\t[0x1CA9, 0x10E9],\n\t[0x1CAA, 0x10EA],\n\t[0x1CAB, 0x10EB],\n\t[0x1CAC, 0x10EC],\n\t[0x1CAD, 0x10ED],\n\t[0x1CAE, 0x10EE],\n\t[0x1CAF, 0x10EF],\n\t[0x1CB0, 0x10F0],\n\t[0x1CB1, 0x10F1],\n\t[0x1CB2, 0x10F2],\n\t[0x1CB3, 0x10F3],\n\t[0x1CB4, 0x10F4],\n\t[0x1CB5, 0x10F5],\n\t[0x1CB6, 0x10F6],\n\t[0x1CB7, 0x10F7],\n\t[0x1CB8, 0x10F8],\n\t[0x1CB9, 0x10F9],\n\t[0x1CBA, 0x10FA],\n\t[0x1CBD, 0x10FD],\n\t[0x1CBE, 0x10FE],\n\t[0x1CBF, 0x10FF],\n\t[0x1D8E, 0xA7C6],\n\t[0x1E60, 0x1E9B],\n\t[0x1E9B, 0x1E60],\n\t[0x1E9E, 0xDF],\n\t[0x1F80, 0x1F88],\n\t[0x1F81, 0x1F89],\n\t[0x1F82, 0x1F8A],\n\t[0x1F83, 0x1F8B],\n\t[0x1F84, 0x1F8C],\n\t[0x1F85, 0x1F8D],\n\t[0x1F86, 0x1F8E],\n\t[0x1F87, 0x1F8F],\n\t[0x1F88, 0x1F80],\n\t[0x1F89, 0x1F81],\n\t[0x1F8A, 0x1F82],\n\t[0x1F8B, 0x1F83],\n\t[0x1F8C, 0x1F84],\n\t[0x1F8D, 0x1F85],\n\t[0x1F8E, 0x1F86],\n\t[0x1F8F, 0x1F87],\n\t[0x1F90, 0x1F98],\n\t[0x1F91, 0x1F99],\n\t[0x1F92, 0x1F9A],\n\t[0x1F93, 0x1F9B],\n\t[0x1F94, 0x1F9C],\n\t[0x1F95, 0x1F9D],\n\t[0x1F96, 0x1F9E],\n\t[0x1F97, 0x1F9F],\n\t[0x1F98, 0x1F90],\n\t[0x1F99, 0x1F91],\n\t[0x1F9A, 0x1F92],\n\t[0x1F9B, 0x1F93],\n\t[0x1F9C, 0x1F94],\n\t[0x1F9D, 0x1F95],\n\t[0x1F9E, 0x1F96],\n\t[0x1F9F, 0x1F97],\n\t[0x1FA0, 0x1FA8],\n\t[0x1FA1, 0x1FA9],\n\t[0x1FA2, 0x1FAA],\n\t[0x1FA3, 0x1FAB],\n\t[0x1FA4, 0x1FAC],\n\t[0x1FA5, 0x1FAD],\n\t[0x1FA6, 0x1FAE],\n\t[0x1FA7, 0x1FAF],\n\t[0x1FA8, 0x1FA0],\n\t[0x1FA9, 0x1FA1],\n\t[0x1FAA, 0x1FA2],\n\t[0x1FAB, 0x1FA3],\n\t[0x1FAC, 0x1FA4],\n\t[0x1FAD, 0x1FA5],\n\t[0x1FAE, 0x1FA6],\n\t[0x1FAF, 0x1FA7],\n\t[0x1FB3, 0x1FBC],\n\t[0x1FBC, 0x1FB3],\n\t[0x1FBE, [\n\t\t0x345,\n\t\t0x399\n\t]],\n\t[0x1FC3, 0x1FCC],\n\t[0x1FCC, 0x1FC3],\n\t[0x1FF3, 0x1FFC],\n\t[0x1FFC, 0x1FF3],\n\t[0x2126, [\n\t\t0x3A9,\n\t\t0x3C9\n\t]],\n\t[0x212A, 0x4B],\n\t[0x212B, [\n\t\t0xC5,\n\t\t0xE5\n\t]],\n\t[0xA64A, 0x1C88],\n\t[0xA64B, 0x1C88],\n\t[0xA794, 0xA7C4],\n\t[0xA7AE, 0x26A],\n\t[0xA7B2, 0x29D],\n\t[0xA7B3, 0xAB53],\n\t[0xA7B4, 0xA7B5],\n\t[0xA7B5, 0xA7B4],\n\t[0xA7B6, 0xA7B7],\n\t[0xA7B7, 0xA7B6],\n\t[0xA7B8, 0xA7B9],\n\t[0xA7B9, 0xA7B8],\n\t[0xA7BA, 0xA7BB],\n\t[0xA7BB, 0xA7BA],\n\t[0xA7BC, 0xA7BD],\n\t[0xA7BD, 0xA7BC],\n\t[0xA7BE, 0xA7BF],\n\t[0xA7BF, 0xA7BE],\n\t[0xA7C2, 0xA7C3],\n\t[0xA7C3, 0xA7C2],\n\t[0xA7C4, 0xA794],\n\t[0xA7C5, 0x282],\n\t[0xA7C6, 0x1D8E],\n\t[0xAB53, 0xA7B3],\n\t[0xAB70, 0x13A0],\n\t[0xAB71, 0x13A1],\n\t[0xAB72, 0x13A2],\n\t[0xAB73, 0x13A3],\n\t[0xAB74, 0x13A4],\n\t[0xAB75, 0x13A5],\n\t[0xAB76, 0x13A6],\n\t[0xAB77, 0x13A7],\n\t[0xAB78, 0x13A8],\n\t[0xAB79, 0x13A9],\n\t[0xAB7A, 0x13AA],\n\t[0xAB7B, 0x13AB],\n\t[0xAB7C, 0x13AC],\n\t[0xAB7D, 0x13AD],\n\t[0xAB7E, 0x13AE],\n\t[0xAB7F, 0x13AF],\n\t[0xAB80, 0x13B0],\n\t[0xAB81, 0x13B1],\n\t[0xAB82, 0x13B2],\n\t[0xAB83, 0x13B3],\n\t[0xAB84, 0x13B4],\n\t[0xAB85, 0x13B5],\n\t[0xAB86, 0x13B6],\n\t[0xAB87, 0x13B7],\n\t[0xAB88, 0x13B8],\n\t[0xAB89, 0x13B9],\n\t[0xAB8A, 0x13BA],\n\t[0xAB8B, 0x13BB],\n\t[0xAB8C, 0x13BC],\n\t[0xAB8D, 0x13BD],\n\t[0xAB8E, 0x13BE],\n\t[0xAB8F, 0x13BF],\n\t[0xAB90, 0x13C0],\n\t[0xAB91, 0x13C1],\n\t[0xAB92, 0x13C2],\n\t[0xAB93, 0x13C3],\n\t[0xAB94, 0x13C4],\n\t[0xAB95, 0x13C5],\n\t[0xAB96, 0x13C6],\n\t[0xAB97, 0x13C7],\n\t[0xAB98, 0x13C8],\n\t[0xAB99, 0x13C9],\n\t[0xAB9A, 0x13CA],\n\t[0xAB9B, 0x13CB],\n\t[0xAB9C, 0x13CC],\n\t[0xAB9D, 0x13CD],\n\t[0xAB9E, 0x13CE],\n\t[0xAB9F, 0x13CF],\n\t[0xABA0, 0x13D0],\n\t[0xABA1, 0x13D1],\n\t[0xABA2, 0x13D2],\n\t[0xABA3, 0x13D3],\n\t[0xABA4, 0x13D4],\n\t[0xABA5, 0x13D5],\n\t[0xABA6, 0x13D6],\n\t[0xABA7, 0x13D7],\n\t[0xABA8, 0x13D8],\n\t[0xABA9, 0x13D9],\n\t[0xABAA, 0x13DA],\n\t[0xABAB, 0x13DB],\n\t[0xABAC, 0x13DC],\n\t[0xABAD, 0x13DD],\n\t[0xABAE, 0x13DE],\n\t[0xABAF, 0x13DF],\n\t[0xABB0, 0x13E0],\n\t[0xABB1, 0x13E1],\n\t[0xABB2, 0x13E2],\n\t[0xABB3, 0x13E3],\n\t[0xABB4, 0x13E4],\n\t[0xABB5, 0x13E5],\n\t[0xABB6, 0x13E6],\n\t[0xABB7, 0x13E7],\n\t[0xABB8, 0x13E8],\n\t[0xABB9, 0x13E9],\n\t[0xABBA, 0x13EA],\n\t[0xABBB, 0x13EB],\n\t[0xABBC, 0x13EC],\n\t[0xABBD, 0x13ED],\n\t[0xABBE, 0x13EE],\n\t[0xABBF, 0x13EF],\n\t[0x10400, 0x10428],\n\t[0x10401, 0x10429],\n\t[0x10402, 0x1042A],\n\t[0x10403, 0x1042B],\n\t[0x10404, 0x1042C],\n\t[0x10405, 0x1042D],\n\t[0x10406, 0x1042E],\n\t[0x10407, 0x1042F],\n\t[0x10408, 0x10430],\n\t[0x10409, 0x10431],\n\t[0x1040A, 0x10432],\n\t[0x1040B, 0x10433],\n\t[0x1040C, 0x10434],\n\t[0x1040D, 0x10435],\n\t[0x1040E, 0x10436],\n\t[0x1040F, 0x10437],\n\t[0x10410, 0x10438],\n\t[0x10411, 0x10439],\n\t[0x10412, 0x1043A],\n\t[0x10413, 0x1043B],\n\t[0x10414, 0x1043C],\n\t[0x10415, 0x1043D],\n\t[0x10416, 0x1043E],\n\t[0x10417, 0x1043F],\n\t[0x10418, 0x10440],\n\t[0x10419, 0x10441],\n\t[0x1041A, 0x10442],\n\t[0x1041B, 0x10443],\n\t[0x1041C, 0x10444],\n\t[0x1041D, 0x10445],\n\t[0x1041E, 0x10446],\n\t[0x1041F, 0x10447],\n\t[0x10420, 0x10448],\n\t[0x10421, 0x10449],\n\t[0x10422, 0x1044A],\n\t[0x10423, 0x1044B],\n\t[0x10424, 0x1044C],\n\t[0x10425, 0x1044D],\n\t[0x10426, 0x1044E],\n\t[0x10427, 0x1044F],\n\t[0x10428, 0x10400],\n\t[0x10429, 0x10401],\n\t[0x1042A, 0x10402],\n\t[0x1042B, 0x10403],\n\t[0x1042C, 0x10404],\n\t[0x1042D, 0x10405],\n\t[0x1042E, 0x10406],\n\t[0x1042F, 0x10407],\n\t[0x10430, 0x10408],\n\t[0x10431, 0x10409],\n\t[0x10432, 0x1040A],\n\t[0x10433, 0x1040B],\n\t[0x10434, 0x1040C],\n\t[0x10435, 0x1040D],\n\t[0x10436, 0x1040E],\n\t[0x10437, 0x1040F],\n\t[0x10438, 0x10410],\n\t[0x10439, 0x10411],\n\t[0x1043A, 0x10412],\n\t[0x1043B, 0x10413],\n\t[0x1043C, 0x10414],\n\t[0x1043D, 0x10415],\n\t[0x1043E, 0x10416],\n\t[0x1043F, 0x10417],\n\t[0x10440, 0x10418],\n\t[0x10441, 0x10419],\n\t[0x10442, 0x1041A],\n\t[0x10443, 0x1041B],\n\t[0x10444, 0x1041C],\n\t[0x10445, 0x1041D],\n\t[0x10446, 0x1041E],\n\t[0x10447, 0x1041F],\n\t[0x10448, 0x10420],\n\t[0x10449, 0x10421],\n\t[0x1044A, 0x10422],\n\t[0x1044B, 0x10423],\n\t[0x1044C, 0x10424],\n\t[0x1044D, 0x10425],\n\t[0x1044E, 0x10426],\n\t[0x1044F, 0x10427],\n\t[0x104B0, 0x104D8],\n\t[0x104B1, 0x104D9],\n\t[0x104B2, 0x104DA],\n\t[0x104B3, 0x104DB],\n\t[0x104B4, 0x104DC],\n\t[0x104B5, 0x104DD],\n\t[0x104B6, 0x104DE],\n\t[0x104B7, 0x104DF],\n\t[0x104B8, 0x104E0],\n\t[0x104B9, 0x104E1],\n\t[0x104BA, 0x104E2],\n\t[0x104BB, 0x104E3],\n\t[0x104BC, 0x104E4],\n\t[0x104BD, 0x104E5],\n\t[0x104BE, 0x104E6],\n\t[0x104BF, 0x104E7],\n\t[0x104C0, 0x104E8],\n\t[0x104C1, 0x104E9],\n\t[0x104C2, 0x104EA],\n\t[0x104C3, 0x104EB],\n\t[0x104C4, 0x104EC],\n\t[0x104C5, 0x104ED],\n\t[0x104C6, 0x104EE],\n\t[0x104C7, 0x104EF],\n\t[0x104C8, 0x104F0],\n\t[0x104C9, 0x104F1],\n\t[0x104CA, 0x104F2],\n\t[0x104CB, 0x104F3],\n\t[0x104CC, 0x104F4],\n\t[0x104CD, 0x104F5],\n\t[0x104CE, 0x104F6],\n\t[0x104CF, 0x104F7],\n\t[0x104D0, 0x104F8],\n\t[0x104D1, 0x104F9],\n\t[0x104D2, 0x104FA],\n\t[0x104D3, 0x104FB],\n\t[0x104D8, 0x104B0],\n\t[0x104D9, 0x104B1],\n\t[0x104DA, 0x104B2],\n\t[0x104DB, 0x104B3],\n\t[0x104DC, 0x104B4],\n\t[0x104DD, 0x104B5],\n\t[0x104DE, 0x104B6],\n\t[0x104DF, 0x104B7],\n\t[0x104E0, 0x104B8],\n\t[0x104E1, 0x104B9],\n\t[0x104E2, 0x104BA],\n\t[0x104E3, 0x104BB],\n\t[0x104E4, 0x104BC],\n\t[0x104E5, 0x104BD],\n\t[0x104E6, 0x104BE],\n\t[0x104E7, 0x104BF],\n\t[0x104E8, 0x104C0],\n\t[0x104E9, 0x104C1],\n\t[0x104EA, 0x104C2],\n\t[0x104EB, 0x104C3],\n\t[0x104EC, 0x104C4],\n\t[0x104ED, 0x104C5],\n\t[0x104EE, 0x104C6],\n\t[0x104EF, 0x104C7],\n\t[0x104F0, 0x104C8],\n\t[0x104F1, 0x104C9],\n\t[0x104F2, 0x104CA],\n\t[0x104F3, 0x104CB],\n\t[0x104F4, 0x104CC],\n\t[0x104F5, 0x104CD],\n\t[0x104F6, 0x104CE],\n\t[0x104F7, 0x104CF],\n\t[0x104F8, 0x104D0],\n\t[0x104F9, 0x104D1],\n\t[0x104FA, 0x104D2],\n\t[0x104FB, 0x104D3],\n\t[0x10C80, 0x10CC0],\n\t[0x10C81, 0x10CC1],\n\t[0x10C82, 0x10CC2],\n\t[0x10C83, 0x10CC3],\n\t[0x10C84, 0x10CC4],\n\t[0x10C85, 0x10CC5],\n\t[0x10C86, 0x10CC6],\n\t[0x10C87, 0x10CC7],\n\t[0x10C88, 0x10CC8],\n\t[0x10C89, 0x10CC9],\n\t[0x10C8A, 0x10CCA],\n\t[0x10C8B, 0x10CCB],\n\t[0x10C8C, 0x10CCC],\n\t[0x10C8D, 0x10CCD],\n\t[0x10C8E, 0x10CCE],\n\t[0x10C8F, 0x10CCF],\n\t[0x10C90, 0x10CD0],\n\t[0x10C91, 0x10CD1],\n\t[0x10C92, 0x10CD2],\n\t[0x10C93, 0x10CD3],\n\t[0x10C94, 0x10CD4],\n\t[0x10C95, 0x10CD5],\n\t[0x10C96, 0x10CD6],\n\t[0x10C97, 0x10CD7],\n\t[0x10C98, 0x10CD8],\n\t[0x10C99, 0x10CD9],\n\t[0x10C9A, 0x10CDA],\n\t[0x10C9B, 0x10CDB],\n\t[0x10C9C, 0x10CDC],\n\t[0x10C9D, 0x10CDD],\n\t[0x10C9E, 0x10CDE],\n\t[0x10C9F, 0x10CDF],\n\t[0x10CA0, 0x10CE0],\n\t[0x10CA1, 0x10CE1],\n\t[0x10CA2, 0x10CE2],\n\t[0x10CA3, 0x10CE3],\n\t[0x10CA4, 0x10CE4],\n\t[0x10CA5, 0x10CE5],\n\t[0x10CA6, 0x10CE6],\n\t[0x10CA7, 0x10CE7],\n\t[0x10CA8, 0x10CE8],\n\t[0x10CA9, 0x10CE9],\n\t[0x10CAA, 0x10CEA],\n\t[0x10CAB, 0x10CEB],\n\t[0x10CAC, 0x10CEC],\n\t[0x10CAD, 0x10CED],\n\t[0x10CAE, 0x10CEE],\n\t[0x10CAF, 0x10CEF],\n\t[0x10CB0, 0x10CF0],\n\t[0x10CB1, 0x10CF1],\n\t[0x10CB2, 0x10CF2],\n\t[0x10CC0, 0x10C80],\n\t[0x10CC1, 0x10C81],\n\t[0x10CC2, 0x10C82],\n\t[0x10CC3, 0x10C83],\n\t[0x10CC4, 0x10C84],\n\t[0x10CC5, 0x10C85],\n\t[0x10CC6, 0x10C86],\n\t[0x10CC7, 0x10C87],\n\t[0x10CC8, 0x10C88],\n\t[0x10CC9, 0x10C89],\n\t[0x10CCA, 0x10C8A],\n\t[0x10CCB, 0x10C8B],\n\t[0x10CCC, 0x10C8C],\n\t[0x10CCD, 0x10C8D],\n\t[0x10CCE, 0x10C8E],\n\t[0x10CCF, 0x10C8F],\n\t[0x10CD0, 0x10C90],\n\t[0x10CD1, 0x10C91],\n\t[0x10CD2, 0x10C92],\n\t[0x10CD3, 0x10C93],\n\t[0x10CD4, 0x10C94],\n\t[0x10CD5, 0x10C95],\n\t[0x10CD6, 0x10C96],\n\t[0x10CD7, 0x10C97],\n\t[0x10CD8, 0x10C98],\n\t[0x10CD9, 0x10C99],\n\t[0x10CDA, 0x10C9A],\n\t[0x10CDB, 0x10C9B],\n\t[0x10CDC, 0x10C9C],\n\t[0x10CDD, 0x10C9D],\n\t[0x10CDE, 0x10C9E],\n\t[0x10CDF, 0x10C9F],\n\t[0x10CE0, 0x10CA0],\n\t[0x10CE1, 0x10CA1],\n\t[0x10CE2, 0x10CA2],\n\t[0x10CE3, 0x10CA3],\n\t[0x10CE4, 0x10CA4],\n\t[0x10CE5, 0x10CA5],\n\t[0x10CE6, 0x10CA6],\n\t[0x10CE7, 0x10CA7],\n\t[0x10CE8, 0x10CA8],\n\t[0x10CE9, 0x10CA9],\n\t[0x10CEA, 0x10CAA],\n\t[0x10CEB, 0x10CAB],\n\t[0x10CEC, 0x10CAC],\n\t[0x10CED, 0x10CAD],\n\t[0x10CEE, 0x10CAE],\n\t[0x10CEF, 0x10CAF],\n\t[0x10CF0, 0x10CB0],\n\t[0x10CF1, 0x10CB1],\n\t[0x10CF2, 0x10CB2],\n\t[0x118A0, 0x118C0],\n\t[0x118A1, 0x118C1],\n\t[0x118A2, 0x118C2],\n\t[0x118A3, 0x118C3],\n\t[0x118A4, 0x118C4],\n\t[0x118A5, 0x118C5],\n\t[0x118A6, 0x118C6],\n\t[0x118A7, 0x118C7],\n\t[0x118A8, 0x118C8],\n\t[0x118A9, 0x118C9],\n\t[0x118AA, 0x118CA],\n\t[0x118AB, 0x118CB],\n\t[0x118AC, 0x118CC],\n\t[0x118AD, 0x118CD],\n\t[0x118AE, 0x118CE],\n\t[0x118AF, 0x118CF],\n\t[0x118B0, 0x118D0],\n\t[0x118B1, 0x118D1],\n\t[0x118B2, 0x118D2],\n\t[0x118B3, 0x118D3],\n\t[0x118B4, 0x118D4],\n\t[0x118B5, 0x118D5],\n\t[0x118B6, 0x118D6],\n\t[0x118B7, 0x118D7],\n\t[0x118B8, 0x118D8],\n\t[0x118B9, 0x118D9],\n\t[0x118BA, 0x118DA],\n\t[0x118BB, 0x118DB],\n\t[0x118BC, 0x118DC],\n\t[0x118BD, 0x118DD],\n\t[0x118BE, 0x118DE],\n\t[0x118BF, 0x118DF],\n\t[0x118C0, 0x118A0],\n\t[0x118C1, 0x118A1],\n\t[0x118C2, 0x118A2],\n\t[0x118C3, 0x118A3],\n\t[0x118C4, 0x118A4],\n\t[0x118C5, 0x118A5],\n\t[0x118C6, 0x118A6],\n\t[0x118C7, 0x118A7],\n\t[0x118C8, 0x118A8],\n\t[0x118C9, 0x118A9],\n\t[0x118CA, 0x118AA],\n\t[0x118CB, 0x118AB],\n\t[0x118CC, 0x118AC],\n\t[0x118CD, 0x118AD],\n\t[0x118CE, 0x118AE],\n\t[0x118CF, 0x118AF],\n\t[0x118D0, 0x118B0],\n\t[0x118D1, 0x118B1],\n\t[0x118D2, 0x118B2],\n\t[0x118D3, 0x118B3],\n\t[0x118D4, 0x118B4],\n\t[0x118D5, 0x118B5],\n\t[0x118D6, 0x118B6],\n\t[0x118D7, 0x118B7],\n\t[0x118D8, 0x118B8],\n\t[0x118D9, 0x118B9],\n\t[0x118DA, 0x118BA],\n\t[0x118DB, 0x118BB],\n\t[0x118DC, 0x118BC],\n\t[0x118DD, 0x118BD],\n\t[0x118DE, 0x118BE],\n\t[0x118DF, 0x118BF],\n\t[0x16E40, 0x16E60],\n\t[0x16E41, 0x16E61],\n\t[0x16E42, 0x16E62],\n\t[0x16E43, 0x16E63],\n\t[0x16E44, 0x16E64],\n\t[0x16E45, 0x16E65],\n\t[0x16E46, 0x16E66],\n\t[0x16E47, 0x16E67],\n\t[0x16E48, 0x16E68],\n\t[0x16E49, 0x16E69],\n\t[0x16E4A, 0x16E6A],\n\t[0x16E4B, 0x16E6B],\n\t[0x16E4C, 0x16E6C],\n\t[0x16E4D, 0x16E6D],\n\t[0x16E4E, 0x16E6E],\n\t[0x16E4F, 0x16E6F],\n\t[0x16E50, 0x16E70],\n\t[0x16E51, 0x16E71],\n\t[0x16E52, 0x16E72],\n\t[0x16E53, 0x16E73],\n\t[0x16E54, 0x16E74],\n\t[0x16E55, 0x16E75],\n\t[0x16E56, 0x16E76],\n\t[0x16E57, 0x16E77],\n\t[0x16E58, 0x16E78],\n\t[0x16E59, 0x16E79],\n\t[0x16E5A, 0x16E7A],\n\t[0x16E5B, 0x16E7B],\n\t[0x16E5C, 0x16E7C],\n\t[0x16E5D, 0x16E7D],\n\t[0x16E5E, 0x16E7E],\n\t[0x16E5F, 0x16E7F],\n\t[0x16E60, 0x16E40],\n\t[0x16E61, 0x16E41],\n\t[0x16E62, 0x16E42],\n\t[0x16E63, 0x16E43],\n\t[0x16E64, 0x16E44],\n\t[0x16E65, 0x16E45],\n\t[0x16E66, 0x16E46],\n\t[0x16E67, 0x16E47],\n\t[0x16E68, 0x16E48],\n\t[0x16E69, 0x16E49],\n\t[0x16E6A, 0x16E4A],\n\t[0x16E6B, 0x16E4B],\n\t[0x16E6C, 0x16E4C],\n\t[0x16E6D, 0x16E4D],\n\t[0x16E6E, 0x16E4E],\n\t[0x16E6F, 0x16E4F],\n\t[0x16E70, 0x16E50],\n\t[0x16E71, 0x16E51],\n\t[0x16E72, 0x16E52],\n\t[0x16E73, 0x16E53],\n\t[0x16E74, 0x16E54],\n\t[0x16E75, 0x16E55],\n\t[0x16E76, 0x16E56],\n\t[0x16E77, 0x16E57],\n\t[0x16E78, 0x16E58],\n\t[0x16E79, 0x16E59],\n\t[0x16E7A, 0x16E5A],\n\t[0x16E7B, 0x16E5B],\n\t[0x16E7C, 0x16E5C],\n\t[0x16E7D, 0x16E5D],\n\t[0x16E7E, 0x16E5E],\n\t[0x16E7F, 0x16E5F],\n\t[0x1E900, 0x1E922],\n\t[0x1E901, 0x1E923],\n\t[0x1E902, 0x1E924],\n\t[0x1E903, 0x1E925],\n\t[0x1E904, 0x1E926],\n\t[0x1E905, 0x1E927],\n\t[0x1E906, 0x1E928],\n\t[0x1E907, 0x1E929],\n\t[0x1E908, 0x1E92A],\n\t[0x1E909, 0x1E92B],\n\t[0x1E90A, 0x1E92C],\n\t[0x1E90B, 0x1E92D],\n\t[0x1E90C, 0x1E92E],\n\t[0x1E90D, 0x1E92F],\n\t[0x1E90E, 0x1E930],\n\t[0x1E90F, 0x1E931],\n\t[0x1E910, 0x1E932],\n\t[0x1E911, 0x1E933],\n\t[0x1E912, 0x1E934],\n\t[0x1E913, 0x1E935],\n\t[0x1E914, 0x1E936],\n\t[0x1E915, 0x1E937],\n\t[0x1E916, 0x1E938],\n\t[0x1E917, 0x1E939],\n\t[0x1E918, 0x1E93A],\n\t[0x1E919, 0x1E93B],\n\t[0x1E91A, 0x1E93C],\n\t[0x1E91B, 0x1E93D],\n\t[0x1E91C, 0x1E93E],\n\t[0x1E91D, 0x1E93F],\n\t[0x1E91E, 0x1E940],\n\t[0x1E91F, 0x1E941],\n\t[0x1E920, 0x1E942],\n\t[0x1E921, 0x1E943],\n\t[0x1E922, 0x1E900],\n\t[0x1E923, 0x1E901],\n\t[0x1E924, 0x1E902],\n\t[0x1E925, 0x1E903],\n\t[0x1E926, 0x1E904],\n\t[0x1E927, 0x1E905],\n\t[0x1E928, 0x1E906],\n\t[0x1E929, 0x1E907],\n\t[0x1E92A, 0x1E908],\n\t[0x1E92B, 0x1E909],\n\t[0x1E92C, 0x1E90A],\n\t[0x1E92D, 0x1E90B],\n\t[0x1E92E, 0x1E90C],\n\t[0x1E92F, 0x1E90D],\n\t[0x1E930, 0x1E90E],\n\t[0x1E931, 0x1E90F],\n\t[0x1E932, 0x1E910],\n\t[0x1E933, 0x1E911],\n\t[0x1E934, 0x1E912],\n\t[0x1E935, 0x1E913],\n\t[0x1E936, 0x1E914],\n\t[0x1E937, 0x1E915],\n\t[0x1E938, 0x1E916],\n\t[0x1E939, 0x1E917],\n\t[0x1E93A, 0x1E918],\n\t[0x1E93B, 0x1E919],\n\t[0x1E93C, 0x1E91A],\n\t[0x1E93D, 0x1E91B],\n\t[0x1E93E, 0x1E91C],\n\t[0x1E93F, 0x1E91D],\n\t[0x1E940, 0x1E91E],\n\t[0x1E941, 0x1E91F],\n\t[0x1E942, 0x1E920],\n\t[0x1E943, 0x1E921]\n]);\n","// Generated using `npm run build`. Do not edit.\n'use strict';\n\nconst regenerate = require('regenerate');\n\nexports.REGULAR = new Map([\n\t['d', regenerate()\n\t\t.addRange(0x30, 0x39)],\n\t['D', regenerate()\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0xFFFF)],\n\t['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)\n\t\t.addRange(0x9, 0xD)\n\t\t.addRange(0x2000, 0x200A)\n\t\t.addRange(0x2028, 0x2029)],\n\t['S', regenerate()\n\t\t.addRange(0x0, 0x8)\n\t\t.addRange(0xE, 0x1F)\n\t\t.addRange(0x21, 0x9F)\n\t\t.addRange(0xA1, 0x167F)\n\t\t.addRange(0x1681, 0x1FFF)\n\t\t.addRange(0x200B, 0x2027)\n\t\t.addRange(0x202A, 0x202E)\n\t\t.addRange(0x2030, 0x205E)\n\t\t.addRange(0x2060, 0x2FFF)\n\t\t.addRange(0x3001, 0xFEFE)\n\t\t.addRange(0xFF00, 0xFFFF)],\n\t['w', regenerate(0x5F)\n\t\t.addRange(0x30, 0x39)\n\t\t.addRange(0x41, 0x5A)\n\t\t.addRange(0x61, 0x7A)],\n\t['W', regenerate(0x60)\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x40)\n\t\t.addRange(0x5B, 0x5E)\n\t\t.addRange(0x7B, 0xFFFF)]\n]);\n\nexports.UNICODE = new Map([\n\t['d', regenerate()\n\t\t.addRange(0x30, 0x39)],\n\t['D', regenerate()\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x10FFFF)],\n\t['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)\n\t\t.addRange(0x9, 0xD)\n\t\t.addRange(0x2000, 0x200A)\n\t\t.addRange(0x2028, 0x2029)],\n\t['S', regenerate()\n\t\t.addRange(0x0, 0x8)\n\t\t.addRange(0xE, 0x1F)\n\t\t.addRange(0x21, 0x9F)\n\t\t.addRange(0xA1, 0x167F)\n\t\t.addRange(0x1681, 0x1FFF)\n\t\t.addRange(0x200B, 0x2027)\n\t\t.addRange(0x202A, 0x202E)\n\t\t.addRange(0x2030, 0x205E)\n\t\t.addRange(0x2060, 0x2FFF)\n\t\t.addRange(0x3001, 0xFEFE)\n\t\t.addRange(0xFF00, 0x10FFFF)],\n\t['w', regenerate(0x5F)\n\t\t.addRange(0x30, 0x39)\n\t\t.addRange(0x41, 0x5A)\n\t\t.addRange(0x61, 0x7A)],\n\t['W', regenerate(0x60)\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x40)\n\t\t.addRange(0x5B, 0x5E)\n\t\t.addRange(0x7B, 0x10FFFF)]\n]);\n\nexports.UNICODE_IGNORE_CASE = new Map([\n\t['d', regenerate()\n\t\t.addRange(0x30, 0x39)],\n\t['D', regenerate()\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x10FFFF)],\n\t['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)\n\t\t.addRange(0x9, 0xD)\n\t\t.addRange(0x2000, 0x200A)\n\t\t.addRange(0x2028, 0x2029)],\n\t['S', regenerate()\n\t\t.addRange(0x0, 0x8)\n\t\t.addRange(0xE, 0x1F)\n\t\t.addRange(0x21, 0x9F)\n\t\t.addRange(0xA1, 0x167F)\n\t\t.addRange(0x1681, 0x1FFF)\n\t\t.addRange(0x200B, 0x2027)\n\t\t.addRange(0x202A, 0x202E)\n\t\t.addRange(0x2030, 0x205E)\n\t\t.addRange(0x2060, 0x2FFF)\n\t\t.addRange(0x3001, 0xFEFE)\n\t\t.addRange(0xFF00, 0x10FFFF)],\n\t['w', regenerate(0x5F, 0x17F, 0x212A)\n\t\t.addRange(0x30, 0x39)\n\t\t.addRange(0x41, 0x5A)\n\t\t.addRange(0x61, 0x7A)],\n\t['W', regenerate(0x60)\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x40)\n\t\t.addRange(0x5B, 0x5E)\n\t\t.addRange(0x7B, 0x17E)\n\t\t.addRange(0x180, 0x2129)\n\t\t.addRange(0x212B, 0x10FFFF)]\n]);\n","'use strict';\n\nconst generate = require('regjsgen').generate;\nconst parse = require('regjsparser').parse;\nconst regenerate = require('regenerate');\nconst unicodeMatchProperty = require('unicode-match-property-ecmascript');\nconst unicodeMatchPropertyValue = require('unicode-match-property-value-ecmascript');\nconst iuMappings = require('./data/iu-mappings.js');\nconst ESCAPE_SETS = require('./data/character-class-escape-sets.js');\n\n// Prepare a Regenerate set containing all code points, used for negative\n// character classes (if any).\nconst UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF);\n// Without the `u` flag, the range stops at 0xFFFF.\n// https://mths.be/es6#sec-pattern-semantics\nconst BMP_SET = regenerate().addRange(0x0, 0xFFFF);\n\n// Prepare a Regenerate set containing all code points that are supposed to be\n// matched by `/./u`. https://mths.be/es6#sec-atom\nconst DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points\n\t.remove(\n\t\t// minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators):\n\t\t0x000A, // Line Feed \n\t\t0x000D, // Carriage Return \n\t\t0x2028, // Line Separator \n\t\t0x2029 // Paragraph Separator \n\t);\n\nconst getCharacterClassEscapeSet = (character, unicode, ignoreCase) => {\n\tif (unicode) {\n\t\tif (ignoreCase) {\n\t\t\treturn ESCAPE_SETS.UNICODE_IGNORE_CASE.get(character);\n\t\t}\n\t\treturn ESCAPE_SETS.UNICODE.get(character);\n\t}\n\treturn ESCAPE_SETS.REGULAR.get(character);\n};\n\nconst getUnicodeDotSet = (dotAll) => {\n\treturn dotAll ? UNICODE_SET : DOT_SET_UNICODE;\n};\n\nconst getUnicodePropertyValueSet = (property, value) => {\n\tconst path = value ?\n\t\t`${ property }/${ value }` :\n\t\t`Binary_Property/${ property }`;\n\ttry {\n\t\treturn require(`regenerate-unicode-properties/${ path }.js`);\n\t} catch (exception) {\n\t\tthrow new Error(\n\t\t\t`Failed to recognize value \\`${ value }\\` for property ` +\n\t\t\t`\\`${ property }\\`.`\n\t\t);\n\t}\n};\n\nconst handleLoneUnicodePropertyNameOrValue = (value) => {\n\t// It could be a `General_Category` value or a binary property.\n\t// Note: `unicodeMatchPropertyValue` throws on invalid values.\n\ttry {\n\t\tconst property = 'General_Category';\n\t\tconst category = unicodeMatchPropertyValue(property, value);\n\t\treturn getUnicodePropertyValueSet(property, category);\n\t} catch (exception) {}\n\t// It’s not a `General_Category` value, so check if it’s a binary\n\t// property. Note: `unicodeMatchProperty` throws on invalid properties.\n\tconst property = unicodeMatchProperty(value);\n\treturn getUnicodePropertyValueSet(property);\n};\n\nconst getUnicodePropertyEscapeSet = (value, isNegative) => {\n\tconst parts = value.split('=');\n\tconst firstPart = parts[0];\n\tlet set;\n\tif (parts.length == 1) {\n\t\tset = handleLoneUnicodePropertyNameOrValue(firstPart);\n\t} else {\n\t\t// The pattern consists of two parts, i.e. `Property=Value`.\n\t\tconst property = unicodeMatchProperty(firstPart);\n\t\tconst value = unicodeMatchPropertyValue(property, parts[1]);\n\t\tset = getUnicodePropertyValueSet(property, value);\n\t}\n\tif (isNegative) {\n\t\treturn UNICODE_SET.clone().remove(set);\n\t}\n\treturn set.clone();\n};\n\n// Given a range of code points, add any case-folded code points in that range\n// to a set.\nregenerate.prototype.iuAddRange = function(min, max) {\n\tconst $this = this;\n\tdo {\n\t\tconst folded = caseFold(min);\n\t\tif (folded) {\n\t\t\t$this.add(folded);\n\t\t}\n\t} while (++min <= max);\n\treturn $this;\n};\n\nconst update = (item, pattern) => {\n\tlet tree = parse(pattern, config.useUnicodeFlag ? 'u' : '');\n\tswitch (tree.type) {\n\t\tcase 'characterClass':\n\t\tcase 'group':\n\t\tcase 'value':\n\t\t\t// No wrapping needed.\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Wrap the pattern in a non-capturing group.\n\t\t\ttree = wrap(tree, pattern);\n\t}\n\tObject.assign(item, tree);\n};\n\nconst wrap = (tree, pattern) => {\n\t// Wrap the pattern in a non-capturing group.\n\treturn {\n\t\t'type': 'group',\n\t\t'behavior': 'ignore',\n\t\t'body': [tree],\n\t\t'raw': `(?:${ pattern })`\n\t};\n};\n\nconst caseFold = (codePoint) => {\n\treturn iuMappings.get(codePoint) || false;\n};\n\nconst processCharacterClass = (characterClassItem, regenerateOptions) => {\n\tlet set = regenerate();\n\tfor (const item of characterClassItem.body) {\n\t\tswitch (item.type) {\n\t\t\tcase 'value':\n\t\t\t\tset.add(item.codePoint);\n\t\t\t\tif (config.ignoreCase && config.unicode && !config.useUnicodeFlag) {\n\t\t\t\t\tconst folded = caseFold(item.codePoint);\n\t\t\t\t\tif (folded) {\n\t\t\t\t\t\tset.add(folded);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'characterClassRange':\n\t\t\t\tconst min = item.min.codePoint;\n\t\t\t\tconst max = item.max.codePoint;\n\t\t\t\tset.addRange(min, max);\n\t\t\t\tif (config.ignoreCase && config.unicode && !config.useUnicodeFlag) {\n\t\t\t\t\tset.iuAddRange(min, max);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'characterClassEscape':\n\t\t\t\tset.add(getCharacterClassEscapeSet(\n\t\t\t\t\titem.value,\n\t\t\t\t\tconfig.unicode,\n\t\t\t\t\tconfig.ignoreCase\n\t\t\t\t));\n\t\t\t\tbreak;\n\t\t\tcase 'unicodePropertyEscape':\n\t\t\t\tset.add(getUnicodePropertyEscapeSet(item.value, item.negative));\n\t\t\t\tbreak;\n\t\t\t// The `default` clause is only here as a safeguard; it should never be\n\t\t\t// reached. Code coverage tools should ignore it.\n\t\t\t/* istanbul ignore next */\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown term type: ${ item.type }`);\n\t\t}\n\t}\n\tif (characterClassItem.negative) {\n\t\tset = (config.unicode ? UNICODE_SET : BMP_SET).clone().remove(set);\n\t}\n\tupdate(characterClassItem, set.toString(regenerateOptions));\n\treturn characterClassItem;\n};\n\nconst updateNamedReference = (item, index) => {\n\tdelete item.name;\n\titem.matchIndex = index;\n};\n\nconst assertNoUnmatchedReferences = (groups) => {\n\tconst unmatchedReferencesNames = Object.keys(groups.unmatchedReferences);\n\tif (unmatchedReferencesNames.length > 0) {\n\t\tthrow new Error(`Unknown group names: ${unmatchedReferencesNames}`);\n\t}\n};\n\nconst processTerm = (item, regenerateOptions, groups) => {\n\tswitch (item.type) {\n\t\tcase 'dot':\n\t\t\tif (config.unicode) {\n\t\t\t\tupdate(\n\t\t\t\t\titem,\n\t\t\t\t\tgetUnicodeDotSet(config.dotAll).toString(regenerateOptions)\n\t\t\t\t);\n\t\t\t} else if (config.dotAll) {\n\t\t\t\t// TODO: consider changing this at the regenerate level.\n\t\t\t\tupdate(item, '[\\\\s\\\\S]');\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'characterClass':\n\t\t\titem = processCharacterClass(item, regenerateOptions);\n\t\t\tbreak;\n\t\tcase 'unicodePropertyEscape':\n\t\t\tupdate(\n\t\t\t\titem,\n\t\t\t\tgetUnicodePropertyEscapeSet(item.value, item.negative)\n\t\t\t\t\t.toString(regenerateOptions)\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 'characterClassEscape':\n\t\t\tupdate(\n\t\t\t\titem,\n\t\t\t\tgetCharacterClassEscapeSet(\n\t\t\t\t\titem.value,\n\t\t\t\t\tconfig.unicode,\n\t\t\t\t\tconfig.ignoreCase\n\t\t\t\t).toString(regenerateOptions)\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 'group':\n\t\t\tif (item.behavior == 'normal') {\n\t\t\t\tgroups.lastIndex++;\n\t\t\t}\n\t\t\tif (item.name) {\n\t\t\t\tconst name = item.name.value;\n\n\t\t\t\tif (groups.names[name]) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Multiple groups with the same name (${ name }) are not allowed.`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst index = groups.lastIndex;\n\t\t\t\tdelete item.name;\n\n\t\t\t\tgroups.names[name] = index;\n\t\t\t\tif (groups.onNamedGroup) {\n\t\t\t\t\tgroups.onNamedGroup.call(null, name, index);\n\t\t\t\t}\n\n\t\t\t\tif (groups.unmatchedReferences[name]) {\n\t\t\t\t\tgroups.unmatchedReferences[name].forEach(reference => {\n\t\t\t\t\t\tupdateNamedReference(reference, index);\n\t\t\t\t\t});\n\t\t\t\t\tdelete groups.unmatchedReferences[name];\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* falls through */\n\t\tcase 'alternative':\n\t\tcase 'disjunction':\n\t\tcase 'quantifier':\n\t\t\titem.body = item.body.map(term => {\n\t\t\t\treturn processTerm(term, regenerateOptions, groups);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'value':\n\t\t\tconst codePoint = item.codePoint;\n\t\t\tconst set = regenerate(codePoint);\n\t\t\tif (config.ignoreCase && config.unicode && !config.useUnicodeFlag) {\n\t\t\t\tconst folded = caseFold(codePoint);\n\t\t\t\tif (folded) {\n\t\t\t\t\tset.add(folded);\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdate(item, set.toString(regenerateOptions));\n\t\t\tbreak;\n\t\tcase 'reference':\n\t\t\tif (item.name) {\n\t\t\t\tconst name = item.name.value;\n\t\t\t\tconst index = groups.names[name];\n\t\t\t\tif (index) {\n\t\t\t\t\tupdateNamedReference(item, index);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!groups.unmatchedReferences[name]) {\n\t\t\t\t\tgroups.unmatchedReferences[name] = [];\n\t\t\t\t}\n\t\t\t\t// Keep track of references used before the corresponding group.\n\t\t\t\tgroups.unmatchedReferences[name].push(item);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'anchor':\n\t\tcase 'empty':\n\t\tcase 'group':\n\t\t\t// Nothing to do here.\n\t\t\tbreak;\n\t\t// The `default` clause is only here as a safeguard; it should never be\n\t\t// reached. Code coverage tools should ignore it.\n\t\t/* istanbul ignore next */\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown term type: ${ item.type }`);\n\t}\n\treturn item;\n};\n\nconst config = {\n\t'ignoreCase': false,\n\t'unicode': false,\n\t'dotAll': false,\n\t'useUnicodeFlag': false\n};\nconst rewritePattern = (pattern, flags, options) => {\n\tconst regjsparserFeatures = {\n\t\t'unicodePropertyEscape': options && options.unicodePropertyEscape,\n\t\t'namedGroups': options && options.namedGroup,\n\t\t'lookbehind': options && options.lookbehind\n\t};\n\tconfig.ignoreCase = flags && flags.includes('i');\n\tconfig.unicode = flags && flags.includes('u');\n\tconst supportDotAllFlag = options && options.dotAllFlag;\n\tconfig.dotAll = supportDotAllFlag && flags && flags.includes('s');\n\tconfig.useUnicodeFlag = options && options.useUnicodeFlag;\n\tconst regenerateOptions = {\n\t\t'hasUnicodeFlag': config.useUnicodeFlag,\n\t\t'bmpOnly': !config.unicode\n\t};\n\tconst groups = {\n\t\t'onNamedGroup': options && options.onNamedGroup,\n\t\t'lastIndex': 0,\n\t\t'names': Object.create(null), // { [name]: index }\n\t\t'unmatchedReferences': Object.create(null) // { [name]: Array }\n\t};\n\tconst tree = parse(pattern, flags, regjsparserFeatures);\n\t// Note: `processTerm` mutates `tree` and `groups`.\n\tprocessTerm(tree, regenerateOptions, groups);\n\tassertNoUnmatchedReferences(groups);\n\treturn generate(tree);\n};\n\nmodule.exports = rewritePattern;\n","// @flow\nexport const FEATURES = Object.freeze({\n unicodeFlag: 1 << 0,\n dotAllFlag: 1 << 1,\n unicodePropertyEscape: 1 << 2,\n namedCaptureGroups: 1 << 3,\n});\n\n// We can't use a symbol because this needs to always be the same, even if\n// this package isn't deduped by npm. e.g.\n// - node_modules/\n// - @babel/plugin-regexp-features\n// - @babel/plugin-proposal-unicode-property-regex\n// - node_modules\n// - @babel-plugin-regexp-features\nexport const featuresKey = \"@babel/plugin-regexp-features/featuresKey\";\nexport const runtimeKey = \"@babel/plugin-regexp-features/runtimeKey\";\n\ntype FeatureType = $Values;\n\nexport function enableFeature(features: number, feature: FeatureType): number {\n return features | feature;\n}\n\nexport function hasFeature(features: number, feature: FeatureType) {\n return !!(features & feature);\n}\n","import { FEATURES, hasFeature } from \"./features\";\n\nexport function generateRegexpuOptions(node, features) {\n let useUnicodeFlag = false,\n dotAllFlag = false,\n unicodePropertyEscape = false,\n namedGroup = false;\n const { flags, pattern } = node;\n const flagsIncludesU = flags.includes(\"u\");\n\n if (flagsIncludesU) {\n if (!hasFeature(features, FEATURES.unicodeFlag)) {\n useUnicodeFlag = true;\n }\n if (\n hasFeature(features, FEATURES.unicodePropertyEscape) &&\n /\\\\[pP]{/.test(pattern)\n ) {\n unicodePropertyEscape = true;\n }\n }\n\n if (hasFeature(features, FEATURES.dotAllFlag) && flags.indexOf(\"s\") >= 0) {\n dotAllFlag = true;\n }\n if (\n hasFeature(features, FEATURES.namedCaptureGroups) &&\n /\\(\\?<(?![=!])/.test(pattern)\n ) {\n namedGroup = true;\n }\n if (\n !namedGroup &&\n !unicodePropertyEscape &&\n !dotAllFlag &&\n (!flagsIncludesU || useUnicodeFlag)\n ) {\n return null;\n }\n // Now we have to feed regexpu-core the regex\n if (flagsIncludesU && flags.indexOf(\"s\") >= 0) {\n // When flags includes u, `config.unicode` will be enabled even if `u` is supported natively.\n // In this case we have to enable dotAllFlag, otherwise `rewritePattern(/./su)` will return\n // incorrect result\n // https://github.com/mathiasbynens/regexpu-core/blob/v4.6.0/rewrite-pattern.js#L191\n dotAllFlag = true;\n }\n return {\n useUnicodeFlag,\n onNamedGroup: () => {},\n namedGroup,\n unicodePropertyEscape,\n dotAllFlag,\n lookbehind: true,\n };\n}\n","/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\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 * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseIndexOfWith;\n","var arrayMap = require('./_arrayMap'),\n baseIndexOf = require('./_baseIndexOf'),\n baseIndexOfWith = require('./_baseIndexOfWith'),\n baseUnary = require('./_baseUnary'),\n copyArray = require('./_copyArray');\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 * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n}\n\nmodule.exports = basePullAll;\n","var basePullAll = require('./_basePullAll');\n\n/**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\nfunction pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n}\n\nmodule.exports = pullAll;\n","var baseRest = require('./_baseRest'),\n pullAll = require('./pullAll');\n\n/**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\nvar pull = baseRest(pullAll);\n\nmodule.exports = pull;\n","import pull from \"lodash/pull\";\n\nexport function is(node: Object, flag: string): boolean {\n return node.type === \"RegExpLiteral\" && node.flags.indexOf(flag) >= 0;\n}\n\nexport function pullFlag(node: Object, flag: string) {\n const flags = node.flags.split(\"\");\n if (node.flags.indexOf(flag) < 0) return;\n pull(flags, flag);\n node.flags = flags.join(\"\");\n}\n","import rewritePattern from \"regexpu-core\";\nimport {\n featuresKey,\n FEATURES,\n enableFeature,\n runtimeKey,\n hasFeature,\n} from \"./features\";\nimport { generateRegexpuOptions } from \"./util\";\n\nimport pkg from \"../package.json\";\nimport { types as t } from \"@babel/core\";\nimport { pullFlag } from \"@babel/helper-regex\";\n\n// Note: Versions are represented as an integer. e.g. 7.1.5 is represented\n// as 70000100005. This method is easier than using a semver-parsing\n// package, but it breaks if we release x.y.z where x, y or z are\n// greater than 99_999.\nconst version = pkg.version.split(\".\").reduce((v, x) => v * 1e5 + +x, 0);\nconst versionKey = \"@babel/plugin-regexp-features/version\";\n\nexport function createRegExpFeaturePlugin({ name, feature, options = {} }) {\n return {\n name,\n pre() {\n const { file } = this;\n const features = file.get(featuresKey) ?? 0;\n let newFeatures = enableFeature(features, FEATURES[feature]);\n\n const { useUnicodeFlag, runtime = true } = options;\n if (useUnicodeFlag === false) {\n newFeatures = enableFeature(newFeatures, FEATURES.unicodeFlag);\n }\n if (newFeatures !== features) {\n file.set(featuresKey, newFeatures);\n }\n\n if (!runtime) {\n file.set(runtimeKey, false);\n }\n\n if (!file.has(versionKey) || file.get(versionKey) < version) {\n file.set(versionKey, version);\n }\n },\n\n visitor: {\n RegExpLiteral(path) {\n const { node } = path;\n const { file } = this;\n const features = file.get(featuresKey);\n const runtime = file.get(runtimeKey) ?? true;\n const regexpuOptions = generateRegexpuOptions(node, features);\n if (regexpuOptions === null) {\n return;\n }\n const namedCaptureGroups = {};\n if (regexpuOptions.namedGroup) {\n regexpuOptions.onNamedGroup = (name, index) => {\n namedCaptureGroups[name] = index;\n };\n }\n node.pattern = rewritePattern(node.pattern, node.flags, regexpuOptions);\n\n if (\n regexpuOptions.namedGroup &&\n Object.keys(namedCaptureGroups).length > 0 &&\n runtime &&\n !isRegExpTest(path)\n ) {\n path.replaceWith(\n t.callExpression(this.addHelper(\"wrapRegExp\"), [\n node,\n t.valueToNode(namedCaptureGroups),\n ]),\n );\n }\n if (hasFeature(features, FEATURES.unicodeFlag)) {\n pullFlag(node, \"u\");\n }\n if (hasFeature(features, FEATURES.dotAllFlag)) {\n pullFlag(node, \"s\");\n }\n },\n },\n };\n}\n\nfunction isRegExpTest(path) {\n return (\n path.parentPath.isMemberExpression({\n object: path.node,\n computed: false,\n }) && path.parentPath.get(\"property\").isIdentifier({ name: \"test\" })\n );\n}\n","/* eslint-disable @babel/development/plugin-name */\nimport { createRegExpFeaturePlugin } from \"@babel/helper-create-regexp-features-plugin\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { useUnicodeFlag = true } = options;\n if (typeof useUnicodeFlag !== \"boolean\") {\n throw new Error(\".useUnicodeFlag must be a boolean, or undefined\");\n }\n\n return createRegExpFeaturePlugin({\n name: \"proposal-unicode-property-regex\",\n feature: \"unicodePropertyEscape\",\n options: { useUnicodeFlag },\n });\n});\n","\nvar inherits;\nif (typeof Object.create === 'function'){\n inherits = function inherits(ctor, superCtor) {\n // implementation from standard node.js 'util' module\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n inherits = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\nexport default inherits;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport process from 'process';\nvar formatRegExp = /%[sdj%]/g;\nexport function format(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexport function deprecate(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexport function debuglog(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = 0;\n debugs[set] = function() {\n var msg = format.apply(null, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nexport function inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n _extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexport function isArray(ar) {\n return Array.isArray(ar);\n}\n\nexport function isBoolean(arg) {\n return typeof arg === 'boolean';\n}\n\nexport function isNull(arg) {\n return arg === null;\n}\n\nexport function isNullOrUndefined(arg) {\n return arg == null;\n}\n\nexport function isNumber(arg) {\n return typeof arg === 'number';\n}\n\nexport function isString(arg) {\n return typeof arg === 'string';\n}\n\nexport function isSymbol(arg) {\n return typeof arg === 'symbol';\n}\n\nexport function isUndefined(arg) {\n return arg === void 0;\n}\n\nexport function isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\n\nexport function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nexport function isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\n\nexport function isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\n\nexport function isBuffer(maybeBuf) {\n return Buffer.isBuffer(maybeBuf);\n}\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexport function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nimport inherits from './inherits';\nexport {inherits}\n\nexport function _extend(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport default {\n inherits: inherits,\n _extend: _extend,\n log: log,\n isBuffer: isBuffer,\n isPrimitive: isPrimitive,\n isFunction: isFunction,\n isError: isError,\n isDate: isDate,\n isObject: isObject,\n isRegExp: isRegExp,\n isUndefined: isUndefined,\n isSymbol: isSymbol,\n isString: isString,\n isNumber: isNumber,\n isNullOrUndefined: isNullOrUndefined,\n isNull: isNull,\n isBoolean: isBoolean,\n isArray: isArray,\n inspect: inspect,\n deprecate: deprecate,\n format: format,\n debuglog: debuglog\n}\n","\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n// based on node assert, original notice:\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport {isBuffer} from 'buffer';\nimport {isPrimitive, inherits, isError, isFunction, isRegExp, isDate, inspect as utilInspect} from 'util';\nvar pSlice = Array.prototype.slice;\nvar _functionsHaveNames;\nfunction functionsHaveNames() {\n if (typeof _functionsHaveNames !== 'undefined') {\n return _functionsHaveNames;\n }\n return _functionsHaveNames = (function () {\n return function foo() {}.name === 'foo';\n }());\n}\nfunction pToString (obj) {\n return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n if (!arrbuf) {\n return false;\n }\n if (arrbuf instanceof DataView) {\n return true;\n }\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nfunction assert(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nexport default assert;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n if (!isFunction(func)) {\n return;\n }\n if (functionsHaveNames()) {\n return func.name;\n }\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\nassert.AssertionError = AssertionError;\nexport function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n}\n\n// assert.AssertionError instanceof Error\ninherits(AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\nfunction inspect(something) {\n if (functionsHaveNames() || !isFunction(something)) {\n return utilInspect(something);\n }\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' +\n self.operator + ' ' +\n truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nexport function fail(actual, expected, message, operator, stackStartFunction) {\n throw new AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nexport function ok(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nassert.ok = ok;\nexport {ok as assert};\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\nassert.equal = equal;\nexport function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', equal);\n}\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\nassert.notEqual = notEqual;\nexport function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', notEqual);\n }\n}\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\nassert.deepEqual = deepEqual;\nexport function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', deepEqual);\n }\n}\nassert.deepStrictEqual = deepStrictEqual;\nexport function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', deepStrictEqual);\n }\n}\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')) {\n return strict ? actual === expected : actual == expected;\n\n // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) &&\n pToString(actual) === pToString(expected) &&\n !(actual instanceof Float32Array ||\n actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer),\n new Uint8Array(expected.buffer)) === 0;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {actual: [], expected: []};\n\n var actualIndex = memos.actual.indexOf(actual);\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined)\n return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b))\n return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\nassert.notDeepEqual = notDeepEqual;\nexport function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', notDeepEqual);\n }\n}\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nexport function notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\nassert.strictEqual = strictEqual;\nexport function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', strictEqual);\n }\n}\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\nassert.notStrictEqual = notStrictEqual;\nexport function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', notStrictEqual);\n }\n}\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {\n // Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n try {\n block();\n } catch (e) {\n error = e;\n }\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if ((isUnwantedException &&\n userProvidedMessage &&\n expectedException(actual, expected)) ||\n isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\nassert.throws = throws;\nexport function throws(block, /*optional*/error, /*optional*/message) {\n _throws(true, block, error, message);\n}\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = doesNotThrow;\nexport function doesNotThrow(block, /*optional*/error, /*optional*/message) {\n _throws(false, block, error, message);\n}\n\nassert.ifError = ifError;\nexport function ifError(err) {\n if (err) throw err;\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\n\n/**\n * A class to track and accumulate mutations to the AST that will eventually\n * output a new require/import statement list.\n */\nexport default class ImportBuilder {\n _statements = [];\n _resultName = null;\n\n _scope = null;\n _hub = null;\n\n constructor(importedSource, scope, hub) {\n this._scope = scope;\n this._hub = hub;\n this._importedSource = importedSource;\n }\n\n done() {\n return {\n statements: this._statements,\n resultName: this._resultName,\n };\n }\n\n import() {\n this._statements.push(\n t.importDeclaration([], t.stringLiteral(this._importedSource)),\n );\n return this;\n }\n\n require() {\n this._statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier(\"require\"), [\n t.stringLiteral(this._importedSource),\n ]),\n ),\n );\n return this;\n }\n\n namespace(name = \"namespace\") {\n name = this._scope.generateUidIdentifier(name);\n\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importNamespaceSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n default(name) {\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importDefaultSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n named(name, importName) {\n if (importName === \"default\") return this.default(name);\n\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importSpecifier(name, t.identifier(importName))];\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n var(name) {\n name = this._scope.generateUidIdentifier(name);\n let statement = this._statements[this._statements.length - 1];\n if (statement.type !== \"ExpressionStatement\") {\n assert(this._resultName);\n statement = t.expressionStatement(this._resultName);\n this._statements.push(statement);\n }\n this._statements[this._statements.length - 1] = t.variableDeclaration(\n \"var\",\n [t.variableDeclarator(name, statement.expression)],\n );\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n defaultInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireDefault\"));\n }\n wildcardInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireWildcard\"));\n }\n\n _interop(callee) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.callExpression(callee, [statement.expression]);\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = t.callExpression(callee, [\n statement.declarations[0].init,\n ]);\n } else {\n assert.fail(\"Unexpected type.\");\n }\n return this;\n }\n\n prop(name) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.memberExpression(\n statement.expression,\n t.identifier(name),\n );\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = t.memberExpression(\n statement.declarations[0].init,\n t.identifier(name),\n );\n } else {\n assert.fail(\"Unexpected type:\" + statement.type);\n }\n return this;\n }\n\n read(name) {\n this._resultName = t.memberExpression(this._resultName, t.identifier(name));\n }\n}\n","/**\n * A small utility to check if a file qualifies as a module.\n */\nexport default function isModule(path: NodePath) {\n const { sourceType } = path.node;\n if (sourceType !== \"module\" && sourceType !== \"script\") {\n throw path.buildCodeFrameError(\n `Unknown sourceType \"${sourceType}\", cannot transform.`,\n );\n }\n\n return path.node.sourceType === \"module\";\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\n\nimport ImportBuilder from \"./import-builder\";\nimport isModule from \"./is-module\";\n\nexport type ImportOptions = {\n /**\n * The module being referenced.\n */\n importedSource: string | null,\n\n /**\n * The type of module being imported:\n *\n * * 'es6' - An ES6 module.\n * * 'commonjs' - A CommonJS module. (Default)\n */\n importedType: \"es6\" | \"commonjs\",\n\n /**\n * The type of interop behavior for namespace/default/named when loading\n * CommonJS modules.\n *\n * ## 'babel' (Default)\n *\n * Load using Babel's interop.\n *\n * If '.__esModule' is true, treat as 'compiled', else:\n *\n * * Namespace: A copy of the module.exports with .default\n * populated by the module.exports object.\n * * Default: The module.exports value.\n * * Named: The .named property of module.exports.\n *\n * The 'ensureLiveReference' has no effect on the liveness of these.\n *\n * ## 'compiled'\n *\n * Assume the module is ES6 compiled to CommonJS. Useful to avoid injecting\n * interop logic if you are confident that the module is a certain format.\n *\n * * Namespace: The root module.exports object.\n * * Default: The .default property of the namespace.\n * * Named: The .named property of the namespace.\n *\n * Will return erroneous results if the imported module is _not_ compiled\n * from ES6 with Babel.\n *\n * ## 'uncompiled'\n *\n * Assume the module is _not_ ES6 compiled to CommonJS. Used a simplified\n * access pattern that doesn't require additional function calls.\n *\n * Will return erroneous results if the imported module _is_ compiled\n * from ES6 with Babel.\n *\n * * Namespace: The module.exports object.\n * * Default: The module.exports object.\n * * Named: The .named property of module.exports.\n */\n importedInterop: \"babel\" | \"node\" | \"compiled\" | \"uncompiled\",\n\n /**\n * The type of CommonJS interop included in the environment that will be\n * loading the output code.\n *\n * * 'babel' - CommonJS modules load with Babel's interop. (Default)\n * * 'node' - CommonJS modules load with Node's interop.\n *\n * See descriptions in 'importedInterop' for more details.\n */\n importingInterop: \"babel\" | \"node\",\n\n /**\n * Define whether we explicitly care that the import be a live reference.\n * Only applies when importing default and named imports, not the namespace.\n *\n * * true - Force imported values to be live references.\n * * false - No particular requirements. Keeps the code simplest. (Default)\n */\n ensureLiveReference: boolean,\n\n /**\n * Define if we explicitly care that the result not be a property reference.\n *\n * * true - Force calls to exclude context. Useful if the value is going to\n * be used as function callee.\n * * false - No particular requirements for context of the access. (Default)\n */\n ensureNoContext: boolean,\n};\n\n/**\n * A general helper classes add imports via transforms. See README for usage.\n */\nexport default class ImportInjector {\n /**\n * The path used for manipulation.\n */\n _programPath: NodePath;\n\n /**\n * The scope used to generate unique variable names.\n */\n _programScope;\n\n /**\n * The file used to inject helpers and resolve paths.\n */\n _hub;\n\n /**\n * The default options to use with this instance when imports are added.\n */\n _defaultOpts: ImportOptions = {\n importedSource: null,\n importedType: \"commonjs\",\n importedInterop: \"babel\",\n importingInterop: \"babel\",\n ensureLiveReference: false,\n ensureNoContext: false,\n };\n\n constructor(path, importedSource, opts) {\n const programPath = path.find(p => p.isProgram());\n\n this._programPath = programPath;\n this._programScope = programPath.scope;\n this._hub = programPath.hub;\n\n this._defaultOpts = this._applyDefaults(importedSource, opts, true);\n }\n\n addDefault(importedSourceIn, opts) {\n return this.addNamed(\"default\", importedSourceIn, opts);\n }\n\n addNamed(importName, importedSourceIn, opts) {\n assert(typeof importName === \"string\");\n\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n importName,\n );\n }\n\n addNamespace(importedSourceIn, opts) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n null,\n );\n }\n\n addSideEffect(importedSourceIn, opts) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n false,\n );\n }\n\n _applyDefaults(importedSource, opts, isInit = false) {\n const optsList = [];\n if (typeof importedSource === \"string\") {\n optsList.push({ importedSource });\n optsList.push(opts);\n } else {\n assert(!opts, \"Unexpected secondary arguments.\");\n\n optsList.push(importedSource);\n }\n\n const newOpts = {\n ...this._defaultOpts,\n };\n for (const opts of optsList) {\n if (!opts) continue;\n Object.keys(newOpts).forEach(key => {\n if (opts[key] !== undefined) newOpts[key] = opts[key];\n });\n\n if (!isInit) {\n if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;\n if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;\n }\n }\n return newOpts;\n }\n\n _generateImport(opts, importName) {\n const isDefault = importName === \"default\";\n const isNamed = !!importName && !isDefault;\n const isNamespace = importName === null;\n\n const {\n importedSource,\n importedType,\n importedInterop,\n importingInterop,\n ensureLiveReference,\n ensureNoContext,\n nameHint,\n\n // Not meant for public usage. Allows code that absolutely must control\n // ordering to set a specific hoist value on the import nodes.\n blockHoist,\n } = opts;\n\n // Provide a hint for generateUidIdentifier for the local variable name\n // to use for the import, if the code will generate a simple assignment\n // to a variable.\n let name = nameHint || importName;\n\n const isMod = isModule(this._programPath);\n const isModuleForNode = isMod && importingInterop === \"node\";\n const isModuleForBabel = isMod && importingInterop === \"babel\";\n\n const builder = new ImportBuilder(\n importedSource,\n this._programScope,\n this._hub,\n );\n\n if (importedType === \"es6\") {\n if (!isModuleForNode && !isModuleForBabel) {\n throw new Error(\"Cannot import an ES6 module from CommonJS\");\n }\n\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(nameHint || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else if (importedType !== \"commonjs\") {\n throw new Error(`Unexpected interopType \"${importedType}\"`);\n } else if (importedInterop === \"babel\") {\n if (isModuleForNode) {\n // import _tmp from ''; var namespace = interopRequireWildcard(_tmp); namespace\n // import _tmp from ''; var def = interopRequireDefault(_tmp).default; def\n // import _tmp from ''; _tmp.named\n name = name !== \"default\" ? name : importedSource;\n const es6Default = `${importedSource}$es6Default`;\n\n builder.import();\n if (isNamespace) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .wildcardInterop();\n } else if (isDefault) {\n if (ensureLiveReference) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .defaultInterop()\n .read(\"default\");\n } else {\n builder\n .default(es6Default)\n .var(name)\n .defaultInterop()\n .prop(importName);\n }\n } else if (isNamed) {\n builder.default(es6Default).read(importName);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = interopRequireWildcard(require(''));\n // var def = interopRequireDefault(require('')).default; def\n // var named = require('').named; named\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource).wildcardInterop();\n } else if ((isDefault || isNamed) && ensureLiveReference) {\n if (isDefault) {\n name = name !== \"default\" ? name : importedSource;\n builder.var(name).read(importName);\n builder.defaultInterop();\n } else {\n builder.var(importedSource).read(importName);\n }\n } else if (isDefault) {\n builder\n .var(name)\n .defaultInterop()\n .prop(importName);\n } else if (isNamed) {\n builder.var(name).prop(importName);\n }\n }\n } else if (importedInterop === \"compiled\") {\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import namespace from ''; namespace.default\n // import namespace from ''; namespace.named\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n // Note: These lookups will break if the module has no __esModule set,\n // hence the warning that 'compiled' will not work on standard CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var namespace = require(''); namespace.default\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault || isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.prop(importName).var(name);\n }\n }\n }\n } else if (importedInterop === \"uncompiled\") {\n if (isDefault && ensureLiveReference) {\n throw new Error(\"No live reference for commonjs default\");\n }\n\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import def from ''; def;\n // import namespace from ''; namespace.named\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import namespace from '';\n // import def from '';\n // import { named } from ''; named;\n // Note: These lookups will break if the module has __esModule set,\n // hence the warning that 'uncompiled' will not work on ES6 transpiled\n // to CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var def = require(''); def\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault) {\n builder.var(name);\n } else if (isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.var(name).prop(importName);\n }\n }\n }\n } else {\n throw new Error(`Unknown importedInterop \"${importedInterop}\".`);\n }\n\n const { statements, resultName } = builder.done();\n\n this._insertStatements(statements, blockHoist);\n\n if (\n (isDefault || isNamed) &&\n ensureNoContext &&\n resultName.type !== \"Identifier\"\n ) {\n return t.sequenceExpression([t.numericLiteral(0), resultName]);\n }\n return resultName;\n }\n\n _insertStatements(statements, blockHoist = 3) {\n statements.forEach(node => {\n node._blockHoist = blockHoist;\n });\n\n const targetPath = this._programPath.get(\"body\").find(p => {\n const val = p.node._blockHoist;\n return Number.isFinite(val) && val < 4;\n });\n\n if (targetPath) {\n targetPath.insertBefore(statements);\n } else {\n this._programPath.unshiftContainer(\"body\", statements);\n }\n }\n}\n","import ImportInjector from \"./import-injector\";\n\nexport { ImportInjector };\n\nexport { default as isModule } from \"./is-module\";\n\nexport function addDefault(path, importedSource, opts) {\n return new ImportInjector(path).addDefault(importedSource, opts);\n}\n\nexport function addNamed(path, name, importedSource, opts) {\n return new ImportInjector(path).addNamed(name, importedSource, opts);\n}\n\nexport function addNamespace(path, importedSource, opts) {\n return new ImportInjector(path).addNamespace(importedSource, opts);\n}\n\nexport function addSideEffect(path, importedSource, opts) {\n return new ImportInjector(path).addSideEffect(importedSource, opts);\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport remapAsyncToGenerator from \"@babel/helper-remap-async-to-generator\";\nimport { addNamed } from \"@babel/helper-module-imports\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { method, module } = options;\n\n if (method && module) {\n return {\n name: \"transform-async-to-generator\",\n\n visitor: {\n Function(path, state) {\n if (!path.node.async || path.node.generator) return;\n\n let wrapAsync = state.methodWrapper;\n if (wrapAsync) {\n wrapAsync = t.cloneNode(wrapAsync);\n } else {\n wrapAsync = state.methodWrapper = addNamed(path, method, module);\n }\n\n remapAsyncToGenerator(path, { wrapAsync });\n },\n },\n };\n }\n\n return {\n name: \"transform-async-to-generator\",\n\n visitor: {\n Function(path, state) {\n if (!path.node.async || path.node.generator) return;\n\n remapAsyncToGenerator(path, {\n wrapAsync: state.addHelper(\"asyncToGenerator\"),\n });\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport type NodePath from \"@babel/traverse\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { spec } = options;\n return {\n name: \"transform-arrow-functions\",\n\n visitor: {\n ArrowFunctionExpression(\n path: NodePath,\n ) {\n // In some conversion cases, it may have already been converted to a function while this callback\n // was queued up.\n if (!path.isArrowFunctionExpression()) return;\n\n path.arrowFunctionToExpression({\n // While other utils may be fine inserting other arrows to make more transforms possible,\n // the arrow transform itself absolutely cannot insert new arrow functions.\n allowInsertArrow: false,\n specCompliant: !!spec,\n });\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function statementList(key, path) {\n const paths: Array = path.get(key);\n\n for (const path of paths) {\n const func = path.node;\n if (!path.isFunctionDeclaration()) continue;\n\n const declar = t.variableDeclaration(\"let\", [\n t.variableDeclarator(func.id, t.toExpression(func)),\n ]);\n\n // hoist it up above everything else\n declar._blockHoist = 2;\n\n // todo: name this\n func.id = null;\n\n path.replaceWith(declar);\n }\n }\n\n return {\n name: \"transform-block-scoped-functions\",\n\n visitor: {\n BlockStatement(path) {\n const { node, parent } = path;\n if (\n t.isFunction(parent, { body: node }) ||\n t.isExportDeclaration(parent)\n ) {\n return;\n }\n\n statementList(\"body\", path);\n },\n\n SwitchCase(path) {\n statementList(\"consequent\", path);\n },\n },\n };\n});\n","import { types as t, template } from \"@babel/core\";\n\nfunction getTDZStatus(refPath, bindingPath) {\n const executionStatus = bindingPath._guessExecutionStatusRelativeTo(refPath);\n\n if (executionStatus === \"before\") {\n return \"outside\";\n } else if (executionStatus === \"after\") {\n return \"inside\";\n } else {\n return \"maybe\";\n }\n}\n\nfunction buildTDZAssert(node, state) {\n return t.callExpression(state.addHelper(\"temporalRef\"), [\n node,\n t.stringLiteral(node.name),\n ]);\n}\n\nfunction isReference(node, scope, state) {\n const declared = state.letReferences[node.name];\n if (!declared) return false;\n\n // declared node is different in this scope\n return scope.getBindingIdentifier(node.name) === declared;\n}\n\nexport const visitor = {\n ReferencedIdentifier(path, state) {\n if (!state.tdzEnabled) return;\n\n const { node, parent, scope } = path;\n\n if (path.parentPath.isFor({ left: node })) return;\n if (!isReference(node, scope, state)) return;\n\n const bindingPath = scope.getBinding(node.name).path;\n\n if (bindingPath.isFunctionDeclaration()) return;\n\n const status = getTDZStatus(path, bindingPath);\n if (status === \"outside\") return;\n\n if (status === \"maybe\") {\n const assert = buildTDZAssert(node, state);\n\n // add tdzThis to parent variable declarator so it's exploded\n bindingPath.parent._tdzThis = true;\n\n path.skip();\n\n if (path.parentPath.isUpdateExpression()) {\n if (parent._ignoreBlockScopingTDZ) return;\n path.parentPath.replaceWith(t.sequenceExpression([assert, parent]));\n } else {\n path.replaceWith(assert);\n }\n } else if (status === \"inside\") {\n path.replaceWith(template.ast`${state.addHelper(\"tdz\")}(\"${node.name}\")`);\n }\n },\n\n AssignmentExpression: {\n exit(path, state) {\n if (!state.tdzEnabled) return;\n\n const { node } = path;\n if (node._ignoreBlockScopingTDZ) return;\n\n const nodes = [];\n const ids = path.getBindingIdentifiers();\n\n for (const name of Object.keys(ids)) {\n const id = ids[name];\n\n if (isReference(id, path.scope, state)) {\n nodes.push(id);\n }\n }\n\n if (nodes.length) {\n node._ignoreBlockScopingTDZ = true;\n nodes.push(node);\n path.replaceWithMultiple(nodes.map(n => t.expressionStatement(n)));\n }\n },\n },\n};\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 copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n keysIn = require('./keysIn');\n\n/**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\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 * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\nvar assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n});\n\nmodule.exports = assignIn;\n","module.exports = require('./assignIn');\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport type NodePath from \"@babel/traverse\";\nimport type Scope from \"@babel/traverse\";\nimport { visitor as tdzVisitor } from \"./tdz\";\nimport values from \"lodash/values\";\nimport extend from \"lodash/extend\";\nimport { traverse, template, types as t } from \"@babel/core\";\n\nconst DONE = new WeakSet();\n\nexport default declare((api, opts) => {\n api.assertVersion(7);\n\n const { throwIfClosureRequired = false, tdz: tdzEnabled = false } = opts;\n if (typeof throwIfClosureRequired !== \"boolean\") {\n throw new Error(`.throwIfClosureRequired must be a boolean, or undefined`);\n }\n if (typeof tdzEnabled !== \"boolean\") {\n throw new Error(`.tdz must be a boolean, or undefined`);\n }\n\n return {\n name: \"transform-block-scoping\",\n\n visitor: {\n VariableDeclaration(path) {\n const { node, parent, scope } = path;\n if (!isBlockScoped(node)) return;\n convertBlockScopedToVar(path, null, parent, scope, true);\n\n if (node._tdzThis) {\n const nodes = [node];\n\n for (let i = 0; i < node.declarations.length; i++) {\n const decl = node.declarations[i];\n const assign = t.assignmentExpression(\n \"=\",\n decl.id,\n decl.init || scope.buildUndefinedNode(),\n );\n assign._ignoreBlockScopingTDZ = true;\n nodes.push(t.expressionStatement(assign));\n decl.init = this.addHelper(\"temporalUndefined\");\n }\n\n node._blockHoist = 2;\n\n if (path.isCompletionRecord()) {\n // ensure we don't break completion record semantics by returning\n // the initialiser of the last declarator\n nodes.push(t.expressionStatement(scope.buildUndefinedNode()));\n }\n\n path.replaceWithMultiple(nodes);\n }\n },\n\n Loop(path, state) {\n const { parent, scope } = path;\n path.ensureBlock();\n const blockScoping = new BlockScoping(\n path,\n path.get(\"body\"),\n parent,\n scope,\n throwIfClosureRequired,\n tdzEnabled,\n state,\n );\n const replace = blockScoping.run();\n if (replace) path.replaceWith(replace);\n },\n\n CatchClause(path, state) {\n const { parent, scope } = path;\n const blockScoping = new BlockScoping(\n null,\n path.get(\"body\"),\n parent,\n scope,\n throwIfClosureRequired,\n tdzEnabled,\n state,\n );\n blockScoping.run();\n },\n\n \"BlockStatement|SwitchStatement|Program\"(path, state) {\n if (!ignoreBlock(path)) {\n const blockScoping = new BlockScoping(\n null,\n path,\n path.parent,\n path.scope,\n throwIfClosureRequired,\n tdzEnabled,\n state,\n );\n blockScoping.run();\n }\n },\n },\n };\n});\n\nfunction ignoreBlock(path) {\n return t.isLoop(path.parent) || t.isCatchClause(path.parent);\n}\n\nconst buildRetCheck = template(`\n if (typeof RETURN === \"object\") return RETURN.v;\n`);\n\nfunction isBlockScoped(node) {\n if (!t.isVariableDeclaration(node)) return false;\n if (node[t.BLOCK_SCOPED_SYMBOL]) return true;\n if (node.kind !== \"let\" && node.kind !== \"const\") return false;\n return true;\n}\n\n/**\n * If there is a loop ancestor closer than the closest function, we\n * consider ourselves to be in a loop.\n */\nfunction isInLoop(path) {\n const loopOrFunctionParent = path.find(\n path => path.isLoop() || path.isFunction(),\n );\n\n return loopOrFunctionParent && loopOrFunctionParent.isLoop();\n}\n\nfunction convertBlockScopedToVar(\n path,\n node,\n parent,\n scope,\n moveBindingsToParent = false,\n) {\n if (!node) {\n node = path.node;\n }\n\n // https://github.com/babel/babel/issues/255\n if (isInLoop(path) && !t.isFor(parent)) {\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n declar.init = declar.init || scope.buildUndefinedNode();\n }\n }\n\n node[t.BLOCK_SCOPED_SYMBOL] = true;\n node.kind = \"var\";\n\n // Move bindings from current block scope to function scope.\n if (moveBindingsToParent) {\n const parentScope = scope.getFunctionParent() || scope.getProgramParent();\n for (const name of Object.keys(path.getBindingIdentifiers())) {\n const binding = scope.getOwnBinding(name);\n if (binding) binding.kind = \"var\";\n scope.moveBindingTo(name, parentScope);\n }\n }\n}\n\nfunction isVar(node) {\n return t.isVariableDeclaration(node, { kind: \"var\" }) && !isBlockScoped(node);\n}\n\nconst letReferenceBlockVisitor = traverse.visitors.merge([\n {\n Loop: {\n enter(path, state) {\n state.loopDepth++;\n },\n exit(path, state) {\n state.loopDepth--;\n },\n },\n Function(path, state) {\n // References to block-scoped variables only require added closures if it's\n // possible for the code to run more than once -- otherwise it is safe to\n // simply rename the variables.\n if (state.loopDepth > 0) {\n path.traverse(letReferenceFunctionVisitor, state);\n } else {\n path.traverse(tdzVisitor, state);\n }\n return path.skip();\n },\n },\n tdzVisitor,\n]);\n\nconst letReferenceFunctionVisitor = traverse.visitors.merge([\n {\n ReferencedIdentifier(path, state) {\n const ref = state.letReferences[path.node.name];\n\n // not a part of our scope\n if (!ref) return;\n\n // this scope has a variable with the same name so it couldn't belong\n // to our let scope\n const localBinding = path.scope.getBindingIdentifier(path.node.name);\n if (localBinding && localBinding !== ref) return;\n\n state.closurify = true;\n },\n },\n tdzVisitor,\n]);\n\nconst hoistVarDeclarationsVisitor = {\n enter(path, self) {\n const { node, parent } = path;\n\n if (path.isForStatement()) {\n if (isVar(node.init, node)) {\n const nodes = self.pushDeclar(node.init);\n if (nodes.length === 1) {\n node.init = nodes[0];\n } else {\n node.init = t.sequenceExpression(nodes);\n }\n }\n } else if (path.isFor()) {\n if (isVar(node.left, node)) {\n self.pushDeclar(node.left);\n node.left = node.left.declarations[0].id;\n }\n } else if (isVar(node, parent)) {\n path.replaceWithMultiple(\n self.pushDeclar(node).map(expr => t.expressionStatement(expr)),\n );\n } else if (path.isFunction()) {\n return path.skip();\n }\n },\n};\n\nconst loopLabelVisitor = {\n LabeledStatement({ node }, state) {\n state.innerLabels.push(node.label.name);\n },\n};\n\nconst continuationVisitor = {\n enter(path, state) {\n if (path.isAssignmentExpression() || path.isUpdateExpression()) {\n for (const name of Object.keys(path.getBindingIdentifiers())) {\n if (\n state.outsideReferences[name] !==\n path.scope.getBindingIdentifier(name)\n ) {\n continue;\n }\n state.reassignments[name] = true;\n }\n } else if (path.isReturnStatement()) {\n state.returnStatements.push(path);\n }\n },\n};\n\nfunction loopNodeTo(node) {\n if (t.isBreakStatement(node)) {\n return \"break\";\n } else if (t.isContinueStatement(node)) {\n return \"continue\";\n }\n}\n\nconst loopVisitor = {\n Loop(path, state) {\n const oldIgnoreLabeless = state.ignoreLabeless;\n state.ignoreLabeless = true;\n path.traverse(loopVisitor, state);\n state.ignoreLabeless = oldIgnoreLabeless;\n path.skip();\n },\n\n Function(path) {\n path.skip();\n },\n\n SwitchCase(path, state) {\n const oldInSwitchCase = state.inSwitchCase;\n state.inSwitchCase = true;\n path.traverse(loopVisitor, state);\n state.inSwitchCase = oldInSwitchCase;\n path.skip();\n },\n\n \"BreakStatement|ContinueStatement|ReturnStatement\"(path, state) {\n const { node, scope } = path;\n if (node[this.LOOP_IGNORE]) return;\n\n let replace;\n let loopText = loopNodeTo(node);\n\n if (loopText) {\n if (node.label) {\n // we shouldn't be transforming this because it exists somewhere inside\n if (state.innerLabels.indexOf(node.label.name) >= 0) {\n return;\n }\n\n loopText = `${loopText}|${node.label.name}`;\n } else {\n // we shouldn't be transforming these statements because\n // they don't refer to the actual loop we're scopifying\n if (state.ignoreLabeless) return;\n\n // break statements mean something different in this context\n if (t.isBreakStatement(node) && state.inSwitchCase) return;\n }\n\n state.hasBreakContinue = true;\n state.map[loopText] = node;\n replace = t.stringLiteral(loopText);\n }\n\n if (path.isReturnStatement()) {\n state.hasReturn = true;\n replace = t.objectExpression([\n t.objectProperty(\n t.identifier(\"v\"),\n node.argument || scope.buildUndefinedNode(),\n ),\n ]);\n }\n\n if (replace) {\n replace = t.returnStatement(replace);\n replace[this.LOOP_IGNORE] = true;\n path.skip();\n path.replaceWith(t.inherits(replace, node));\n }\n },\n};\n\nclass BlockScoping {\n constructor(\n loopPath?: NodePath,\n blockPath: NodePath,\n parent: Object,\n scope: Scope,\n throwIfClosureRequired: boolean,\n tdzEnabled: boolean,\n state: Object,\n ) {\n this.parent = parent;\n this.scope = scope;\n this.state = state;\n this.throwIfClosureRequired = throwIfClosureRequired;\n this.tdzEnabled = tdzEnabled;\n\n this.blockPath = blockPath;\n this.block = blockPath.node;\n\n this.outsideLetReferences = Object.create(null);\n this.hasLetReferences = false;\n this.letReferences = Object.create(null);\n this.body = [];\n\n if (loopPath) {\n this.loopParent = loopPath.parent;\n this.loopLabel =\n t.isLabeledStatement(this.loopParent) && this.loopParent.label;\n this.loopPath = loopPath;\n this.loop = loopPath.node;\n }\n }\n\n /**\n * Start the ball rolling.\n */\n\n run() {\n const block = this.block;\n if (DONE.has(block)) return;\n DONE.add(block);\n\n const needsClosure = this.getLetReferences();\n\n this.checkConstants();\n\n // this is a block within a `Function/Program` so we can safely leave it be\n if (t.isFunction(this.parent) || t.isProgram(this.block)) {\n this.updateScopeInfo();\n return;\n }\n\n // we can skip everything\n if (!this.hasLetReferences) return;\n\n if (needsClosure) {\n this.wrapClosure();\n } else {\n this.remap();\n }\n\n this.updateScopeInfo(needsClosure);\n\n if (this.loopLabel && !t.isLabeledStatement(this.loopParent)) {\n return t.labeledStatement(this.loopLabel, this.loop);\n }\n }\n\n checkConstants() {\n const scope = this.scope;\n const state = this.state;\n\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n if (binding.kind !== \"const\") continue;\n\n for (const violation of (binding.constantViolations: Array)) {\n const readOnlyError = state.addHelper(\"readOnlyError\");\n const throwNode = t.callExpression(readOnlyError, [\n t.stringLiteral(name),\n ]);\n\n if (violation.isAssignmentExpression()) {\n violation\n .get(\"right\")\n .replaceWith(\n t.sequenceExpression([throwNode, violation.get(\"right\").node]),\n );\n } else if (violation.isUpdateExpression()) {\n violation.replaceWith(\n t.sequenceExpression([throwNode, violation.node]),\n );\n } else if (violation.isForXStatement()) {\n violation.ensureBlock();\n violation.node.body.body.unshift(t.expressionStatement(throwNode));\n }\n }\n }\n }\n\n updateScopeInfo(wrappedInClosure) {\n const blockScope = this.blockPath.scope;\n\n const parentScope =\n blockScope.getFunctionParent() || blockScope.getProgramParent();\n const letRefs = this.letReferences;\n\n for (const key of Object.keys(letRefs)) {\n const ref = letRefs[key];\n const binding = blockScope.getBinding(ref.name);\n if (!binding) continue;\n if (binding.kind === \"let\" || binding.kind === \"const\") {\n binding.kind = \"var\";\n\n if (wrappedInClosure) {\n if (blockScope.hasOwnBinding(ref.name)) {\n blockScope.removeBinding(ref.name);\n }\n } else {\n blockScope.moveBindingTo(ref.name, parentScope);\n }\n }\n }\n }\n\n remap() {\n const letRefs = this.letReferences;\n const outsideLetRefs = this.outsideLetReferences;\n const scope = this.scope;\n const blockPathScope = this.blockPath.scope;\n\n // alright, so since we aren't wrapping this block in a closure\n // we have to check if any of our let variables collide with\n // those in upper scopes and then if they do, generate a uid\n // for them and replace all references with it\n\n for (const key of Object.keys(letRefs)) {\n // just an Identifier node we collected in `getLetReferences`\n // this is the defining identifier of a declaration\n const ref = letRefs[key];\n\n // todo: could skip this if the colliding binding is in another function\n if (scope.parentHasBinding(key) || scope.hasGlobal(key)) {\n // The same identifier might have been bound separately in the block scope and\n // the enclosing scope (e.g. loop or catch statement), so we should handle both\n // individually\n if (scope.hasOwnBinding(key)) {\n scope.rename(ref.name);\n }\n\n if (blockPathScope.hasOwnBinding(key)) {\n blockPathScope.rename(ref.name);\n }\n }\n }\n\n for (const key of Object.keys(outsideLetRefs)) {\n const ref = letRefs[key];\n // check for collisions with a for loop's init variable and the enclosing scope's bindings\n // https://github.com/babel/babel/issues/8498\n if (isInLoop(this.blockPath) && blockPathScope.hasOwnBinding(key)) {\n blockPathScope.rename(ref.name);\n }\n }\n }\n\n wrapClosure() {\n if (this.throwIfClosureRequired) {\n throw this.blockPath.buildCodeFrameError(\n \"Compiling let/const in this block would add a closure \" +\n \"(throwIfClosureRequired).\",\n );\n }\n const block = this.block;\n\n const outsideRefs = this.outsideLetReferences;\n\n // remap loop heads with colliding variables\n if (this.loop) {\n for (const name of Object.keys(outsideRefs)) {\n const id = outsideRefs[name];\n\n if (\n this.scope.hasGlobal(id.name) ||\n this.scope.parentHasBinding(id.name)\n ) {\n delete outsideRefs[id.name];\n delete this.letReferences[id.name];\n\n this.scope.rename(id.name);\n\n this.letReferences[id.name] = id;\n outsideRefs[id.name] = id;\n }\n }\n }\n\n // if we're inside of a for loop then we search to see if there are any\n // `break`s, `continue`s, `return`s etc\n this.has = this.checkLoop();\n\n // hoist let references to retain scope\n this.hoistVarDeclarations();\n\n // turn outsideLetReferences into an array\n const args = values(outsideRefs).map(id => t.cloneNode(id));\n const params = args.map(id => t.cloneNode(id));\n\n const isSwitch = this.blockPath.isSwitchStatement();\n\n // build the closure that we're going to wrap the block with, possible wrapping switch(){}\n const fn = t.functionExpression(\n null,\n params,\n t.blockStatement(isSwitch ? [block] : block.body),\n );\n\n // continuation\n this.addContinuations(fn);\n\n let call = t.callExpression(t.nullLiteral(), args);\n let basePath = \".callee\";\n\n // handle generators\n const hasYield = traverse.hasType(\n fn.body,\n \"YieldExpression\",\n t.FUNCTION_TYPES,\n );\n if (hasYield) {\n fn.generator = true;\n call = t.yieldExpression(call, true);\n basePath = \".argument\" + basePath;\n }\n\n // handlers async functions\n const hasAsync = traverse.hasType(\n fn.body,\n \"AwaitExpression\",\n t.FUNCTION_TYPES,\n );\n if (hasAsync) {\n fn.async = true;\n call = t.awaitExpression(call);\n basePath = \".argument\" + basePath;\n }\n\n let placeholderPath;\n let index;\n if (this.has.hasReturn || this.has.hasBreakContinue) {\n const ret = this.scope.generateUid(\"ret\");\n\n this.body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(ret), call),\n ]),\n );\n placeholderPath = \"declarations.0.init\" + basePath;\n index = this.body.length - 1;\n\n this.buildHas(ret);\n } else {\n this.body.push(t.expressionStatement(call));\n placeholderPath = \"expression\" + basePath;\n index = this.body.length - 1;\n }\n\n let callPath;\n // replace the current block body with the one we're going to build\n if (isSwitch) {\n const { parentPath, listKey, key } = this.blockPath;\n\n this.blockPath.replaceWithMultiple(this.body);\n callPath = parentPath.get(listKey)[key + index];\n } else {\n block.body = this.body;\n callPath = this.blockPath.get(\"body\")[index];\n }\n\n const placeholder = callPath.get(placeholderPath);\n\n let fnPath;\n if (this.loop) {\n const loopId = this.scope.generateUid(\"loop\");\n const p = this.loopPath.insertBefore(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(loopId), fn),\n ]),\n );\n\n placeholder.replaceWith(t.identifier(loopId));\n fnPath = p[0].get(\"declarations.0.init\");\n } else {\n placeholder.replaceWith(fn);\n fnPath = placeholder;\n }\n\n // Ensure \"this\", \"arguments\", and \"super\" continue to work in the wrapped function.\n fnPath.unwrapFunctionEnvironment();\n }\n\n /**\n * If any of the outer let variables are reassigned then we need to rename them in\n * the closure so we can get direct access to the outer variable to continue the\n * iteration with bindings based on each iteration.\n *\n * Reference: https://github.com/babel/babel/issues/1078\n */\n\n addContinuations(fn) {\n const state = {\n reassignments: {},\n returnStatements: [],\n outsideReferences: this.outsideLetReferences,\n };\n\n this.scope.traverse(fn, continuationVisitor, state);\n\n for (let i = 0; i < fn.params.length; i++) {\n const param = fn.params[i];\n if (!state.reassignments[param.name]) continue;\n\n const paramName = param.name;\n const newParamName = this.scope.generateUid(param.name);\n fn.params[i] = t.identifier(newParamName);\n\n this.scope.rename(paramName, newParamName, fn);\n\n state.returnStatements.forEach(returnStatement => {\n returnStatement.insertBefore(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.identifier(paramName),\n t.identifier(newParamName),\n ),\n ),\n );\n });\n\n // assign outer reference as it's been modified internally and needs to be retained\n fn.body.body.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.identifier(paramName),\n t.identifier(newParamName),\n ),\n ),\n );\n }\n }\n\n getLetReferences() {\n const block = this.block;\n\n let declarators = [];\n\n if (this.loop) {\n const init = this.loop.left || this.loop.init;\n if (isBlockScoped(init)) {\n declarators.push(init);\n extend(this.outsideLetReferences, t.getBindingIdentifiers(init));\n }\n }\n\n const addDeclarationsFromChild = (path, node) => {\n node = node || path.node;\n if (\n t.isClassDeclaration(node) ||\n t.isFunctionDeclaration(node) ||\n isBlockScoped(node)\n ) {\n if (isBlockScoped(node)) {\n convertBlockScopedToVar(path, node, block, this.scope);\n }\n declarators = declarators.concat(node.declarations || node);\n }\n if (t.isLabeledStatement(node)) {\n addDeclarationsFromChild(path.get(\"body\"), node.body);\n }\n };\n\n //\n if (block.body) {\n const declarPaths = this.blockPath.get(\"body\");\n for (let i = 0; i < block.body.length; i++) {\n addDeclarationsFromChild(declarPaths[i]);\n }\n }\n\n if (block.cases) {\n const declarPaths = this.blockPath.get(\"cases\");\n for (let i = 0; i < block.cases.length; i++) {\n const consequents = block.cases[i].consequent;\n\n for (let j = 0; j < consequents.length; j++) {\n const declar = consequents[j];\n addDeclarationsFromChild(declarPaths[i], declar);\n }\n }\n }\n\n //\n for (let i = 0; i < declarators.length; i++) {\n const declar = declarators[i];\n // Passing true as the third argument causes t.getBindingIdentifiers\n // to return only the *outer* binding identifiers of this\n // declaration, rather than (for example) mistakenly including the\n // parameters of a function declaration. Fixes #4880.\n const keys = t.getBindingIdentifiers(declar, false, true);\n extend(this.letReferences, keys);\n this.hasLetReferences = true;\n }\n\n // no let references so we can just quit\n if (!this.hasLetReferences) return;\n\n const state = {\n letReferences: this.letReferences,\n closurify: false,\n loopDepth: 0,\n tdzEnabled: this.tdzEnabled,\n addHelper: name => this.state.addHelper(name),\n };\n\n if (isInLoop(this.blockPath)) {\n state.loopDepth++;\n }\n\n // traverse through this block, stopping on functions and checking if they\n // contain any local let references\n this.blockPath.traverse(letReferenceBlockVisitor, state);\n\n return state.closurify;\n }\n\n /**\n * If we're inside of a loop then traverse it and check if it has one of\n * the following node types `ReturnStatement`, `BreakStatement`,\n * `ContinueStatement` and replace it with a return value that we can track\n * later on.\n */\n\n checkLoop(): Object {\n const state = {\n hasBreakContinue: false,\n ignoreLabeless: false,\n inSwitchCase: false,\n innerLabels: [],\n hasReturn: false,\n isLoop: !!this.loop,\n map: {},\n LOOP_IGNORE: Symbol(),\n };\n\n this.blockPath.traverse(loopLabelVisitor, state);\n this.blockPath.traverse(loopVisitor, state);\n\n return state;\n }\n\n /**\n * Hoist all let declarations in this block to before it so they retain scope\n * once we wrap everything in a closure.\n */\n\n hoistVarDeclarations() {\n this.blockPath.traverse(hoistVarDeclarationsVisitor, this);\n }\n\n /**\n * Turn a `VariableDeclaration` into an array of `AssignmentExpressions` with\n * their declarations hoisted to before the closure wrapper.\n */\n\n pushDeclar(node: { type: \"VariableDeclaration\" }): Array {\n const declars = [];\n const names = t.getBindingIdentifiers(node);\n for (const name of Object.keys(names)) {\n declars.push(t.variableDeclarator(names[name]));\n }\n\n this.body.push(t.variableDeclaration(node.kind, declars));\n\n const replace = [];\n\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n if (!declar.init) continue;\n\n const expr = t.assignmentExpression(\n \"=\",\n t.cloneNode(declar.id),\n t.cloneNode(declar.init),\n );\n replace.push(t.inherits(expr, declar));\n }\n\n return replace;\n }\n\n buildHas(ret: string) {\n const body = this.body;\n\n let retCheck;\n const has = this.has;\n const cases = [];\n\n if (has.hasReturn) {\n // typeof ret === \"object\"\n retCheck = buildRetCheck({\n RETURN: t.identifier(ret),\n });\n }\n\n if (has.hasBreakContinue) {\n for (const key of Object.keys(has.map)) {\n cases.push(t.switchCase(t.stringLiteral(key), [has.map[key]]));\n }\n\n if (has.hasReturn) {\n cases.push(t.switchCase(null, [retCheck]));\n }\n\n if (cases.length === 1) {\n const single = cases[0];\n body.push(\n t.ifStatement(\n t.binaryExpression(\"===\", t.identifier(ret), single.test),\n single.consequent[0],\n ),\n );\n } else {\n if (this.loop) {\n // https://github.com/babel/babel/issues/998\n for (let i = 0; i < cases.length; i++) {\n const caseConsequent = cases[i].consequent[0];\n if (t.isBreakStatement(caseConsequent) && !caseConsequent.label) {\n if (!this.loopLabel) {\n this.loopLabel = this.scope.generateUidIdentifier(\"loop\");\n }\n caseConsequent.label = t.cloneNode(this.loopLabel);\n }\n }\n }\n\n body.push(t.switchStatement(t.identifier(ret), cases));\n }\n } else {\n if (has.hasReturn) {\n body.push(retCheck);\n }\n }\n }\n}\n","'use strict';\nmodule.exports = require('./globals.json');\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","import nameFunction from \"@babel/helper-function-name\";\nimport has from \"lodash/has\";\nimport * as t from \"@babel/types\";\n\nfunction toKind(node: Object) {\n if (t.isClassMethod(node) || t.isObjectMethod(node)) {\n if (node.kind === \"get\" || node.kind === \"set\") {\n return node.kind;\n }\n }\n\n return \"value\";\n}\n\nexport function push(\n mutatorMap: Object,\n node: Object,\n kind: string,\n file,\n scope?,\n): Object {\n const alias = t.toKeyAlias(node);\n\n //\n\n let map = {};\n if (has(mutatorMap, alias)) map = mutatorMap[alias];\n mutatorMap[alias] = map;\n\n //\n\n map._inherits = map._inherits || [];\n map._inherits.push(node);\n\n map._key = node.key;\n\n if (node.computed) {\n map._computed = true;\n }\n\n if (node.decorators) {\n const decorators = (map.decorators =\n map.decorators || t.arrayExpression([]));\n decorators.elements = decorators.elements.concat(\n node.decorators.map(dec => dec.expression).reverse(),\n );\n }\n\n if (map.value || map.initializer) {\n throw file.buildCodeFrameError(node, \"Key conflict with sibling node\");\n }\n\n let key, value;\n\n // save the key so we can possibly do function name inferences\n if (\n t.isObjectProperty(node) ||\n t.isObjectMethod(node) ||\n t.isClassMethod(node)\n ) {\n key = t.toComputedKey(node, node.key);\n }\n\n if (t.isProperty(node)) {\n value = node.value;\n } else if (t.isObjectMethod(node) || t.isClassMethod(node)) {\n value = t.functionExpression(\n null,\n node.params,\n node.body,\n node.generator,\n node.async,\n );\n value.returnType = node.returnType;\n }\n\n const inheritedKind = toKind(node);\n if (!kind || inheritedKind !== \"value\") {\n kind = inheritedKind;\n }\n\n // infer function name\n if (\n scope &&\n t.isStringLiteral(key) &&\n (kind === \"value\" || kind === \"initializer\") &&\n t.isFunctionExpression(value)\n ) {\n value = nameFunction({ id: key, node: value, scope });\n }\n\n if (value) {\n t.inheritsComments(value, node);\n map[kind] = value;\n }\n\n return map;\n}\n\nexport function hasComputed(mutatorMap: Object): boolean {\n for (const key of Object.keys(mutatorMap)) {\n if (mutatorMap[key]._computed) {\n return true;\n }\n }\n return false;\n}\n\nexport function toComputedObjectFromClass(obj: Object): Object {\n const objExpr = t.arrayExpression([]);\n\n for (let i = 0; i < obj.properties.length; i++) {\n const prop = obj.properties[i];\n const val = prop.value;\n val.properties.unshift(\n t.objectProperty(t.identifier(\"key\"), t.toComputedKey(prop)),\n );\n objExpr.elements.push(val);\n }\n\n return objExpr;\n}\n\nexport function toClassObject(mutatorMap: Object): Object {\n const objExpr = t.objectExpression([]);\n\n Object.keys(mutatorMap).forEach(function(mutatorMapKey) {\n const map = mutatorMap[mutatorMapKey];\n const mapNode = t.objectExpression([]);\n\n const propNode = t.objectProperty(map._key, mapNode, map._computed);\n\n Object.keys(map).forEach(function(key) {\n const node = map[key];\n if (key[0] === \"_\") return;\n\n const prop = t.objectProperty(t.identifier(key), node);\n t.inheritsComments(prop, node);\n t.removeComments(node);\n\n mapNode.properties.push(prop);\n });\n\n objExpr.properties.push(propNode);\n });\n\n return objExpr;\n}\n\nexport function toDefineObject(mutatorMap: Object): Object {\n Object.keys(mutatorMap).forEach(function(key) {\n const map = mutatorMap[key];\n if (map.value) map.writable = t.booleanLiteral(true);\n map.configurable = t.booleanLiteral(true);\n map.enumerable = t.booleanLiteral(true);\n });\n\n return toClassObject(mutatorMap);\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport ReplaceSupers, {\n environmentVisitor,\n} from \"@babel/helper-replace-supers\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\nimport * as defineMap from \"@babel/helper-define-map\";\nimport { traverse, template, types as t } from \"@babel/core\";\n\ntype ReadonlySet = Set | { has(val: T): boolean };\n\nfunction buildConstructor(classRef, constructorBody, node) {\n const func = t.functionDeclaration(\n t.cloneNode(classRef),\n [],\n constructorBody,\n );\n t.inherits(func, node);\n return func;\n}\n\nexport default function transformClass(\n path: NodePath,\n file: any,\n builtinClasses: ReadonlySet,\n isLoose: boolean,\n) {\n const classState = {\n parent: undefined,\n scope: undefined,\n node: undefined,\n path: undefined,\n file: undefined,\n\n classId: undefined,\n classRef: undefined,\n superName: undefined,\n superReturns: [],\n isDerived: false,\n extendsNative: false,\n\n construct: undefined,\n constructorBody: undefined,\n userConstructor: undefined,\n userConstructorPath: undefined,\n hasConstructor: false,\n\n instancePropBody: [],\n instancePropRefs: {},\n staticPropBody: [],\n body: [],\n superThises: [],\n pushedConstructor: false,\n pushedInherits: false,\n protoAlias: null,\n isLoose: false,\n\n hasInstanceDescriptors: false,\n hasStaticDescriptors: false,\n instanceMutatorMap: {},\n staticMutatorMap: {},\n };\n\n const setState = newState => {\n Object.assign(classState, newState);\n };\n\n const findThisesVisitor = traverse.visitors.merge([\n environmentVisitor,\n {\n ThisExpression(path) {\n classState.superThises.push(path);\n },\n },\n ]);\n\n function pushToMap(node, enumerable, kind = \"value\", scope?) {\n let mutatorMap;\n if (node.static) {\n setState({ hasStaticDescriptors: true });\n mutatorMap = classState.staticMutatorMap;\n } else {\n setState({ hasInstanceDescriptors: true });\n mutatorMap = classState.instanceMutatorMap;\n }\n\n const map = defineMap.push(mutatorMap, node, kind, classState.file, scope);\n\n if (enumerable) {\n map.enumerable = t.booleanLiteral(true);\n }\n\n return map;\n }\n\n /**\n * Creates a class constructor or bail out if there is none\n */\n function maybeCreateConstructor() {\n let hasConstructor = false;\n const paths = classState.path.get(\"body.body\");\n for (const path of paths) {\n hasConstructor = path.equals(\"kind\", \"constructor\");\n if (hasConstructor) break;\n }\n if (hasConstructor) return;\n\n let params, body;\n\n if (classState.isDerived) {\n const constructor = template.expression.ast`\n (function () {\n super(...arguments);\n })\n `;\n params = constructor.params;\n body = constructor.body;\n } else {\n params = [];\n body = t.blockStatement([]);\n }\n\n classState.path\n .get(\"body\")\n .unshiftContainer(\n \"body\",\n t.classMethod(\"constructor\", t.identifier(\"constructor\"), params, body),\n );\n }\n\n function buildBody() {\n maybeCreateConstructor();\n pushBody();\n verifyConstructor();\n\n if (classState.userConstructor) {\n const { constructorBody, userConstructor, construct } = classState;\n constructorBody.body = constructorBody.body.concat(\n userConstructor.body.body,\n );\n t.inherits(construct, userConstructor);\n t.inherits(constructorBody, userConstructor.body);\n }\n\n pushDescriptors();\n }\n\n function pushBody() {\n const classBodyPaths: Array = classState.path.get(\"body.body\");\n\n for (const path of classBodyPaths) {\n const node = path.node;\n\n if (path.isClassProperty()) {\n throw path.buildCodeFrameError(\"Missing class properties transform.\");\n }\n\n if (node.decorators) {\n throw path.buildCodeFrameError(\n \"Method has decorators, put the decorator plugin before the classes one.\",\n );\n }\n\n if (t.isClassMethod(node)) {\n const isConstructor = node.kind === \"constructor\";\n\n const replaceSupers = new ReplaceSupers({\n methodPath: path,\n objectRef: classState.classRef,\n superRef: classState.superName,\n isLoose: classState.isLoose,\n file: classState.file,\n });\n\n replaceSupers.replace();\n\n const superReturns = [];\n path.traverse(\n traverse.visitors.merge([\n environmentVisitor,\n {\n ReturnStatement(path) {\n if (!path.getFunctionParent().isArrowFunctionExpression()) {\n superReturns.push(path);\n }\n },\n },\n ]),\n );\n\n if (isConstructor) {\n pushConstructor(superReturns, node, path);\n } else {\n pushMethod(node, path);\n }\n }\n }\n }\n\n function clearDescriptors() {\n setState({\n hasInstanceDescriptors: false,\n hasStaticDescriptors: false,\n instanceMutatorMap: {},\n staticMutatorMap: {},\n });\n }\n\n function pushDescriptors() {\n pushInheritsToBody();\n\n const { body } = classState;\n\n let instanceProps;\n let staticProps;\n\n if (classState.hasInstanceDescriptors) {\n instanceProps = defineMap.toClassObject(classState.instanceMutatorMap);\n }\n\n if (classState.hasStaticDescriptors) {\n staticProps = defineMap.toClassObject(classState.staticMutatorMap);\n }\n\n if (instanceProps || staticProps) {\n if (instanceProps) {\n instanceProps = defineMap.toComputedObjectFromClass(instanceProps);\n }\n if (staticProps) {\n staticProps = defineMap.toComputedObjectFromClass(staticProps);\n }\n\n let args = [\n t.cloneNode(classState.classRef), // Constructor\n t.nullLiteral(), // instanceDescriptors\n t.nullLiteral(), // staticDescriptors\n ];\n\n if (instanceProps) args[1] = instanceProps;\n if (staticProps) args[2] = staticProps;\n\n let lastNonNullIndex = 0;\n for (let i = 0; i < args.length; i++) {\n if (!t.isNullLiteral(args[i])) lastNonNullIndex = i;\n }\n args = args.slice(0, lastNonNullIndex + 1);\n\n body.push(\n t.expressionStatement(\n t.callExpression(classState.file.addHelper(\"createClass\"), args),\n ),\n );\n }\n\n clearDescriptors();\n }\n\n function wrapSuperCall(bareSuper, superRef, thisRef, body) {\n let bareSuperNode = bareSuper.node;\n let call;\n\n if (classState.isLoose) {\n bareSuperNode.arguments.unshift(t.thisExpression());\n if (\n bareSuperNode.arguments.length === 2 &&\n t.isSpreadElement(bareSuperNode.arguments[1]) &&\n t.isIdentifier(bareSuperNode.arguments[1].argument, {\n name: \"arguments\",\n })\n ) {\n // special case single arguments spread\n bareSuperNode.arguments[1] = bareSuperNode.arguments[1].argument;\n bareSuperNode.callee = t.memberExpression(\n t.cloneNode(superRef),\n t.identifier(\"apply\"),\n );\n } else {\n bareSuperNode.callee = t.memberExpression(\n t.cloneNode(superRef),\n t.identifier(\"call\"),\n );\n }\n\n call = t.logicalExpression(\"||\", bareSuperNode, t.thisExpression());\n } else {\n bareSuperNode = optimiseCall(\n t.callExpression(classState.file.addHelper(\"getPrototypeOf\"), [\n t.cloneNode(classState.classRef),\n ]),\n t.thisExpression(),\n bareSuperNode.arguments,\n );\n\n call = t.callExpression(\n classState.file.addHelper(\"possibleConstructorReturn\"),\n [t.thisExpression(), bareSuperNode],\n );\n }\n\n if (\n bareSuper.parentPath.isExpressionStatement() &&\n bareSuper.parentPath.container === body.node.body &&\n body.node.body.length - 1 === bareSuper.parentPath.key\n ) {\n // this super call is the last statement in the body so we can just straight up\n // turn it into a return\n\n if (classState.superThises.length) {\n call = t.assignmentExpression(\"=\", thisRef(), call);\n }\n\n bareSuper.parentPath.replaceWith(t.returnStatement(call));\n } else {\n bareSuper.replaceWith(t.assignmentExpression(\"=\", thisRef(), call));\n }\n }\n\n function verifyConstructor() {\n if (!classState.isDerived) return;\n\n const path = classState.userConstructorPath;\n const body = path.get(\"body\");\n\n path.traverse(findThisesVisitor);\n\n let thisRef = function() {\n const ref = path.scope.generateDeclaredUidIdentifier(\"this\");\n thisRef = () => t.cloneNode(ref);\n return ref;\n };\n\n for (const thisPath of classState.superThises) {\n const { node, parentPath } = thisPath;\n if (parentPath.isMemberExpression({ object: node })) {\n thisPath.replaceWith(thisRef());\n continue;\n }\n thisPath.replaceWith(\n t.callExpression(classState.file.addHelper(\"assertThisInitialized\"), [\n thisRef(),\n ]),\n );\n }\n\n const bareSupers = new Set();\n path.traverse(\n traverse.visitors.merge([\n environmentVisitor,\n {\n Super(path) {\n const { node, parentPath } = path;\n if (parentPath.isCallExpression({ callee: node })) {\n bareSupers.add(parentPath);\n }\n },\n },\n ]),\n );\n\n let guaranteedSuperBeforeFinish = !!bareSupers.size;\n\n for (const bareSuper of bareSupers) {\n wrapSuperCall(bareSuper, classState.superName, thisRef, body);\n\n if (guaranteedSuperBeforeFinish) {\n bareSuper.find(function(parentPath) {\n // hit top so short circuit\n if (parentPath === path) {\n return true;\n }\n\n if (\n parentPath.isLoop() ||\n parentPath.isConditional() ||\n parentPath.isArrowFunctionExpression()\n ) {\n guaranteedSuperBeforeFinish = false;\n return true;\n }\n });\n }\n }\n\n let wrapReturn;\n\n if (classState.isLoose) {\n wrapReturn = returnArg => {\n const thisExpr = t.callExpression(\n classState.file.addHelper(\"assertThisInitialized\"),\n [thisRef()],\n );\n return returnArg\n ? t.logicalExpression(\"||\", returnArg, thisExpr)\n : thisExpr;\n };\n } else {\n wrapReturn = returnArg =>\n t.callExpression(\n classState.file.addHelper(\"possibleConstructorReturn\"),\n [thisRef()].concat(returnArg || []),\n );\n }\n\n // if we have a return as the last node in the body then we've already caught that\n // return\n const bodyPaths = body.get(\"body\");\n if (!bodyPaths.length || !bodyPaths.pop().isReturnStatement()) {\n body.pushContainer(\n \"body\",\n t.returnStatement(\n guaranteedSuperBeforeFinish ? thisRef() : wrapReturn(),\n ),\n );\n }\n\n for (const returnPath of classState.superReturns) {\n returnPath\n .get(\"argument\")\n .replaceWith(wrapReturn(returnPath.node.argument));\n }\n }\n\n /**\n * Push a method to its respective mutatorMap.\n */\n function pushMethod(node: { type: \"ClassMethod\" }, path?: NodePath) {\n const scope = path ? path.scope : classState.scope;\n\n if (node.kind === \"method\") {\n if (processMethod(node, scope)) return;\n }\n\n pushToMap(node, false, null, scope);\n }\n\n function processMethod(node, scope) {\n if (classState.isLoose && !node.decorators) {\n // use assignments instead of define properties for loose classes\n let { classRef } = classState;\n if (!node.static) {\n insertProtoAliasOnce();\n classRef = classState.protoAlias;\n }\n const methodName = t.memberExpression(\n t.cloneNode(classRef),\n node.key,\n node.computed || t.isLiteral(node.key),\n );\n\n let func = t.functionExpression(\n null,\n node.params,\n node.body,\n node.generator,\n node.async,\n );\n t.inherits(func, node);\n\n const key = t.toComputedKey(node, node.key);\n if (t.isStringLiteral(key)) {\n func = nameFunction({\n node: func,\n id: key,\n scope,\n });\n }\n\n const expr = t.expressionStatement(\n t.assignmentExpression(\"=\", methodName, func),\n );\n t.inheritsComments(expr, node);\n classState.body.push(expr);\n return true;\n }\n\n return false;\n }\n\n function insertProtoAliasOnce() {\n if (classState.protoAlias === null) {\n setState({ protoAlias: classState.scope.generateUidIdentifier(\"proto\") });\n const classProto = t.memberExpression(\n classState.classRef,\n t.identifier(\"prototype\"),\n );\n const protoDeclaration = t.variableDeclaration(\"var\", [\n t.variableDeclarator(classState.protoAlias, classProto),\n ]);\n\n classState.body.push(protoDeclaration);\n }\n }\n\n /**\n * Replace the constructor body of our class.\n */\n function pushConstructor(\n superReturns,\n method: { type: \"ClassMethod\" },\n path: NodePath,\n ) {\n // https://github.com/babel/babel/issues/1077\n if (path.scope.hasOwnBinding(classState.classRef.name)) {\n path.scope.rename(classState.classRef.name);\n }\n\n setState({\n userConstructorPath: path,\n userConstructor: method,\n hasConstructor: true,\n superReturns,\n });\n\n const { construct } = classState;\n\n t.inheritsComments(construct, method);\n\n construct.params = method.params;\n\n t.inherits(construct.body, method.body);\n construct.body.directives = method.body.directives;\n\n pushConstructorToBody();\n }\n\n function pushConstructorToBody() {\n if (classState.pushedConstructor) return;\n classState.pushedConstructor = true;\n\n // we haven't pushed any descriptors yet\n if (classState.hasInstanceDescriptors || classState.hasStaticDescriptors) {\n pushDescriptors();\n }\n\n classState.body.push(classState.construct);\n\n pushInheritsToBody();\n }\n\n /**\n * Push inherits helper to body.\n */\n function pushInheritsToBody() {\n if (!classState.isDerived || classState.pushedInherits) return;\n\n setState({ pushedInherits: true });\n\n // Unshift to ensure that the constructor inheritance is set up before\n // any properties can be assigned to the prototype.\n classState.body.unshift(\n t.expressionStatement(\n t.callExpression(\n classState.file.addHelper(\n classState.isLoose ? \"inheritsLoose\" : \"inherits\",\n ),\n [t.cloneNode(classState.classRef), t.cloneNode(classState.superName)],\n ),\n ),\n );\n }\n\n function setupClosureParamsArgs() {\n const { superName } = classState;\n const closureParams = [];\n const closureArgs = [];\n\n if (classState.isDerived) {\n const arg = classState.extendsNative\n ? t.callExpression(classState.file.addHelper(\"wrapNativeSuper\"), [\n t.cloneNode(superName),\n ])\n : t.cloneNode(superName);\n const param = classState.scope.generateUidIdentifierBasedOnNode(\n superName,\n );\n\n closureParams.push(param);\n closureArgs.push(arg);\n\n setState({ superName: t.cloneNode(param) });\n }\n\n return { closureParams, closureArgs };\n }\n\n function classTransformer(\n path: NodePath,\n file,\n builtinClasses: ReadonlySet,\n isLoose: boolean,\n ) {\n setState({\n parent: path.parent,\n scope: path.scope,\n node: path.node,\n path,\n file,\n isLoose,\n });\n\n setState({\n classId: classState.node.id,\n // this is the name of the binding that will **always** reference the class we've constructed\n classRef: classState.node.id\n ? t.identifier(classState.node.id.name)\n : classState.scope.generateUidIdentifier(\"class\"),\n superName: classState.node.superClass,\n isDerived: !!classState.node.superClass,\n constructorBody: t.blockStatement([]),\n });\n\n setState({\n extendsNative:\n classState.isDerived &&\n builtinClasses.has(classState.superName.name) &&\n !classState.scope.hasBinding(\n classState.superName.name,\n /* noGlobals */ true,\n ),\n });\n\n const { classRef, node, constructorBody } = classState;\n\n setState({\n construct: buildConstructor(classRef, constructorBody, node),\n });\n\n let { body } = classState;\n const { closureParams, closureArgs } = setupClosureParamsArgs();\n\n buildBody();\n\n // make sure this class isn't directly called (with A() instead new A())\n if (!classState.isLoose) {\n constructorBody.body.unshift(\n t.expressionStatement(\n t.callExpression(classState.file.addHelper(\"classCallCheck\"), [\n t.thisExpression(),\n t.cloneNode(classState.classRef),\n ]),\n ),\n );\n }\n\n body = body.concat(\n classState.staticPropBody.map(fn => fn(t.cloneNode(classState.classRef))),\n );\n\n const isStrict = path.isInStrictMode();\n let constructorOnly = classState.classId && body.length === 1;\n if (constructorOnly && !isStrict) {\n for (const param of classState.construct.params) {\n // It's illegal to put a use strict directive into the body of a function\n // with non-simple parameters for some reason. So, we have to use a strict\n // wrapper function.\n if (!t.isIdentifier(param)) {\n constructorOnly = false;\n break;\n }\n }\n }\n\n const directives = constructorOnly ? body[0].body.directives : [];\n if (!isStrict) {\n directives.push(t.directive(t.directiveLiteral(\"use strict\")));\n }\n\n if (constructorOnly) {\n // named class with only a constructor\n return t.toExpression(body[0]);\n }\n\n body.push(t.returnStatement(t.cloneNode(classState.classRef)));\n const container = t.arrowFunctionExpression(\n closureParams,\n t.blockStatement(body, directives),\n );\n return t.callExpression(container, closureArgs);\n }\n\n return classTransformer(path, file, builtinClasses, isLoose);\n}\n","// @flow\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport { types as t } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport globals from \"globals\";\nimport transformClass from \"./transformClass\";\n\nconst getBuiltinClasses = category =>\n Object.keys(globals[category]).filter(name => /^[A-Z]/.test(name));\n\nconst builtinClasses = new Set([\n ...getBuiltinClasses(\"builtin\"),\n ...getBuiltinClasses(\"browser\"),\n]);\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose } = options;\n\n // todo: investigate traversal requeueing\n const VISITED = Symbol();\n\n return {\n name: \"transform-classes\",\n\n visitor: {\n ExportDefaultDeclaration(path: NodePath) {\n if (!path.get(\"declaration\").isClassDeclaration()) return;\n splitExportDeclaration(path);\n },\n\n ClassDeclaration(path: NodePath) {\n const { node } = path;\n\n const ref = node.id || path.scope.generateUidIdentifier(\"class\");\n\n path.replaceWith(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(ref, t.toExpression(node)),\n ]),\n );\n },\n\n ClassExpression(path: NodePath, state: any) {\n const { node } = path;\n if (node[VISITED]) return;\n\n const inferred = nameFunction(path);\n if (inferred && inferred !== node) {\n path.replaceWith(inferred);\n return;\n }\n\n node[VISITED] = true;\n\n path.replaceWith(\n transformClass(path, state.file, builtinClasses, loose),\n );\n\n if (path.isCallExpression()) {\n annotateAsPure(path);\n if (path.get(\"callee\").isArrowFunctionExpression()) {\n path.get(\"callee\").arrowFunctionToExpression();\n }\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { template, types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose } = options;\n const pushComputedProps = loose\n ? pushComputedPropsLoose\n : pushComputedPropsSpec;\n\n const buildMutatorMapAssign = template(`\n MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};\n MUTATOR_MAP_REF[KEY].KIND = VALUE;\n `);\n\n function getValue(prop) {\n if (t.isObjectProperty(prop)) {\n return prop.value;\n } else if (t.isObjectMethod(prop)) {\n return t.functionExpression(\n null,\n prop.params,\n prop.body,\n prop.generator,\n prop.async,\n );\n }\n }\n\n function pushAssign(objId, prop, body) {\n if (prop.kind === \"get\" && prop.kind === \"set\") {\n pushMutatorDefine(objId, prop, body);\n } else {\n body.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.cloneNode(objId),\n prop.key,\n prop.computed || t.isLiteral(prop.key),\n ),\n getValue(prop),\n ),\n ),\n );\n }\n }\n\n function pushMutatorDefine({ body, getMutatorId, scope }, prop) {\n let key =\n !prop.computed && t.isIdentifier(prop.key)\n ? t.stringLiteral(prop.key.name)\n : prop.key;\n\n const maybeMemoise = scope.maybeGenerateMemoised(key);\n if (maybeMemoise) {\n body.push(\n t.expressionStatement(t.assignmentExpression(\"=\", maybeMemoise, key)),\n );\n key = maybeMemoise;\n }\n\n body.push(\n ...buildMutatorMapAssign({\n MUTATOR_MAP_REF: getMutatorId(),\n KEY: t.cloneNode(key),\n VALUE: getValue(prop),\n KIND: t.identifier(prop.kind),\n }),\n );\n }\n\n function pushComputedPropsLoose(info) {\n for (const prop of info.computedProps) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n pushMutatorDefine(info, prop);\n } else {\n pushAssign(t.cloneNode(info.objId), prop, info.body);\n }\n }\n }\n\n function pushComputedPropsSpec(info) {\n const { objId, body, computedProps, state } = info;\n\n for (const prop of computedProps) {\n const key = t.toComputedKey(prop);\n\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n pushMutatorDefine(info, prop);\n } else if (t.isStringLiteral(key, { value: \"__proto__\" })) {\n pushAssign(objId, prop, body);\n } else {\n if (computedProps.length === 1) {\n return t.callExpression(state.addHelper(\"defineProperty\"), [\n info.initPropExpression,\n key,\n getValue(prop),\n ]);\n } else {\n body.push(\n t.expressionStatement(\n t.callExpression(state.addHelper(\"defineProperty\"), [\n t.cloneNode(objId),\n key,\n getValue(prop),\n ]),\n ),\n );\n }\n }\n }\n }\n\n return {\n name: \"transform-computed-properties\",\n\n visitor: {\n ObjectExpression: {\n exit(path, state) {\n const { node, parent, scope } = path;\n let hasComputed = false;\n for (const prop of (node.properties: Array)) {\n hasComputed = prop.computed === true;\n if (hasComputed) break;\n }\n if (!hasComputed) return;\n\n // put all getters/setters into the first object expression as well as all initialisers up\n // to the first computed property\n\n const initProps = [];\n const computedProps = [];\n let foundComputed = false;\n\n for (const prop of node.properties) {\n if (prop.computed) {\n foundComputed = true;\n }\n\n if (foundComputed) {\n computedProps.push(prop);\n } else {\n initProps.push(prop);\n }\n }\n\n const objId = scope.generateUidIdentifierBasedOnNode(parent);\n const initPropExpression = t.objectExpression(initProps);\n const body = [];\n\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(objId, initPropExpression),\n ]),\n );\n\n let mutatorRef;\n\n const getMutatorId = function() {\n if (!mutatorRef) {\n mutatorRef = scope.generateUidIdentifier(\"mutatorMap\");\n\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(mutatorRef, t.objectExpression([])),\n ]),\n );\n }\n\n return t.cloneNode(mutatorRef);\n };\n\n const single = pushComputedProps({\n scope,\n objId,\n body,\n computedProps,\n initPropExpression,\n getMutatorId,\n state,\n });\n\n if (mutatorRef) {\n body.push(\n t.expressionStatement(\n t.callExpression(\n state.addHelper(\"defineEnumerableProperties\"),\n [t.cloneNode(objId), t.cloneNode(mutatorRef)],\n ),\n ),\n );\n }\n\n if (single) {\n path.replaceWith(single);\n } else {\n body.push(t.expressionStatement(t.cloneNode(objId)));\n path.replaceWithMultiple(body);\n }\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose = false, useBuiltIns = false } = options;\n\n if (typeof loose !== \"boolean\") {\n throw new Error(`.loose must be a boolean or undefined`);\n }\n\n const arrayOnlySpread = loose;\n\n function getExtendsHelper(file) {\n return useBuiltIns\n ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n : file.addHelper(\"extends\");\n }\n\n /**\n * Test if a VariableDeclaration's declarations contains any Patterns.\n */\n\n function variableDeclarationHasPattern(node) {\n for (const declar of (node.declarations: Array)) {\n if (t.isPattern(declar.id)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Test if an ArrayPattern's elements contain any RestElements.\n */\n\n function hasRest(pattern) {\n for (const elem of (pattern.elements: Array)) {\n if (t.isRestElement(elem)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Test if an ObjectPattern's elements contain any RestElements.\n */\n\n function hasObjectRest(pattern) {\n for (const elem of (pattern.properties: Array)) {\n if (t.isRestElement(elem)) {\n return true;\n }\n }\n return false;\n }\n\n const STOP_TRAVERSAL = {};\n\n // NOTE: This visitor is meant to be used via t.traverse\n const arrayUnpackVisitor = (node, ancestors, state) => {\n if (!ancestors.length) {\n // Top-level node: this is the array literal.\n return;\n }\n\n if (\n t.isIdentifier(node) &&\n t.isReferenced(node, ancestors[ancestors.length - 1]) &&\n state.bindings[node.name]\n ) {\n state.deopt = true;\n throw STOP_TRAVERSAL;\n }\n };\n\n class DestructuringTransformer {\n constructor(opts) {\n this.blockHoist = opts.blockHoist;\n this.operator = opts.operator;\n this.arrays = {};\n this.nodes = opts.nodes || [];\n this.scope = opts.scope;\n this.kind = opts.kind;\n this.arrayOnlySpread = opts.arrayOnlySpread;\n this.addHelper = opts.addHelper;\n }\n\n buildVariableAssignment(id, init) {\n let op = this.operator;\n if (t.isMemberExpression(id)) op = \"=\";\n\n let node;\n\n if (op) {\n node = t.expressionStatement(\n t.assignmentExpression(\n op,\n id,\n t.cloneNode(init) || this.scope.buildUndefinedNode(),\n ),\n );\n } else {\n node = t.variableDeclaration(this.kind, [\n t.variableDeclarator(id, t.cloneNode(init)),\n ]);\n }\n\n node._blockHoist = this.blockHoist;\n\n return node;\n }\n\n buildVariableDeclaration(id, init) {\n const declar = t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.cloneNode(id), t.cloneNode(init)),\n ]);\n declar._blockHoist = this.blockHoist;\n return declar;\n }\n\n push(id, _init) {\n const init = t.cloneNode(_init);\n if (t.isObjectPattern(id)) {\n this.pushObjectPattern(id, init);\n } else if (t.isArrayPattern(id)) {\n this.pushArrayPattern(id, init);\n } else if (t.isAssignmentPattern(id)) {\n this.pushAssignmentPattern(id, init);\n } else {\n this.nodes.push(this.buildVariableAssignment(id, init));\n }\n }\n\n toArray(node, count) {\n if (\n this.arrayOnlySpread ||\n (t.isIdentifier(node) && this.arrays[node.name])\n ) {\n return node;\n } else {\n return this.scope.toArray(node, count);\n }\n }\n\n pushAssignmentPattern({ left, right }, valueRef) {\n // we need to assign the current value of the assignment to avoid evaluating\n // it more than once\n const tempId = this.scope.generateUidIdentifierBasedOnNode(valueRef);\n\n this.nodes.push(this.buildVariableDeclaration(tempId, valueRef));\n\n const tempConditional = t.conditionalExpression(\n t.binaryExpression(\n \"===\",\n t.cloneNode(tempId),\n this.scope.buildUndefinedNode(),\n ),\n right,\n t.cloneNode(tempId),\n );\n\n if (t.isPattern(left)) {\n let patternId;\n let node;\n\n if (this.kind === \"const\") {\n patternId = this.scope.generateUidIdentifier(tempId.name);\n node = this.buildVariableDeclaration(patternId, tempConditional);\n } else {\n patternId = tempId;\n\n node = t.expressionStatement(\n t.assignmentExpression(\"=\", t.cloneNode(tempId), tempConditional),\n );\n }\n\n this.nodes.push(node);\n this.push(left, patternId);\n } else {\n this.nodes.push(this.buildVariableAssignment(left, tempConditional));\n }\n }\n\n pushObjectRest(pattern, objRef, spreadProp, spreadPropIndex) {\n // get all the keys that appear in this object before the current spread\n\n const keys = [];\n let allLiteral = true;\n\n for (let i = 0; i < pattern.properties.length; i++) {\n const prop = pattern.properties[i];\n\n // we've exceeded the index of the spread property to all properties to the\n // right need to be ignored\n if (i >= spreadPropIndex) break;\n\n // ignore other spread properties\n if (t.isRestElement(prop)) continue;\n\n const key = prop.key;\n if (t.isIdentifier(key) && !prop.computed) {\n keys.push(t.stringLiteral(key.name));\n } else if (t.isTemplateLiteral(prop.key)) {\n keys.push(t.cloneNode(prop.key));\n } else if (t.isLiteral(key)) {\n keys.push(t.stringLiteral(String(key.value)));\n } else {\n keys.push(t.cloneNode(key));\n allLiteral = false;\n }\n }\n\n let value;\n if (keys.length === 0) {\n value = t.callExpression(getExtendsHelper(this), [\n t.objectExpression([]),\n t.cloneNode(objRef),\n ]);\n } else {\n let keyExpression = t.arrayExpression(keys);\n\n if (!allLiteral) {\n keyExpression = t.callExpression(\n t.memberExpression(keyExpression, t.identifier(\"map\")),\n [this.addHelper(\"toPropertyKey\")],\n );\n }\n\n value = t.callExpression(\n this.addHelper(`objectWithoutProperties${loose ? \"Loose\" : \"\"}`),\n [t.cloneNode(objRef), keyExpression],\n );\n }\n\n this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value));\n }\n\n pushObjectProperty(prop, propRef) {\n if (t.isLiteral(prop.key)) prop.computed = true;\n\n const pattern = prop.value;\n const objRef = t.memberExpression(\n t.cloneNode(propRef),\n prop.key,\n prop.computed,\n );\n\n if (t.isPattern(pattern)) {\n this.push(pattern, objRef);\n } else {\n this.nodes.push(this.buildVariableAssignment(pattern, objRef));\n }\n }\n\n pushObjectPattern(pattern, objRef) {\n // https://github.com/babel/babel/issues/681\n\n if (!pattern.properties.length) {\n this.nodes.push(\n t.expressionStatement(\n t.callExpression(this.addHelper(\"objectDestructuringEmpty\"), [\n objRef,\n ]),\n ),\n );\n }\n\n // if we have more than one properties in this pattern and the objectRef is a\n // member expression then we need to assign it to a temporary variable so it's\n // only evaluated once\n\n if (pattern.properties.length > 1 && !this.scope.isStatic(objRef)) {\n const temp = this.scope.generateUidIdentifierBasedOnNode(objRef);\n this.nodes.push(this.buildVariableDeclaration(temp, objRef));\n objRef = temp;\n }\n\n // Replace impure computed key expressions if we have a rest parameter\n if (hasObjectRest(pattern)) {\n let copiedPattern;\n for (let i = 0; i < pattern.properties.length; i++) {\n const prop = pattern.properties[i];\n if (t.isRestElement(prop)) {\n break;\n }\n const key = prop.key;\n if (prop.computed && !this.scope.isPure(key)) {\n const name = this.scope.generateUidIdentifierBasedOnNode(key);\n this.nodes.push(this.buildVariableDeclaration(name, key));\n if (!copiedPattern) {\n copiedPattern = pattern = {\n ...pattern,\n properties: pattern.properties.slice(),\n };\n }\n copiedPattern.properties[i] = {\n ...copiedPattern.properties[i],\n key: name,\n };\n }\n }\n }\n //\n\n for (let i = 0; i < pattern.properties.length; i++) {\n const prop = pattern.properties[i];\n if (t.isRestElement(prop)) {\n this.pushObjectRest(pattern, objRef, prop, i);\n } else {\n this.pushObjectProperty(prop, objRef);\n }\n }\n }\n\n canUnpackArrayPattern(pattern, arr) {\n // not an array so there's no way we can deal with this\n if (!t.isArrayExpression(arr)) return false;\n\n // pattern has less elements than the array and doesn't have a rest so some\n // elements wont be evaluated\n if (pattern.elements.length > arr.elements.length) return;\n if (pattern.elements.length < arr.elements.length && !hasRest(pattern)) {\n return false;\n }\n\n for (const elem of (pattern.elements: Array)) {\n // deopt on holes\n if (!elem) return false;\n\n // deopt on member expressions as they may be included in the RHS\n if (t.isMemberExpression(elem)) return false;\n }\n\n for (const elem of (arr.elements: Array)) {\n // deopt on spread elements\n if (t.isSpreadElement(elem)) return false;\n\n // deopt call expressions as they might change values of LHS variables\n if (t.isCallExpression(elem)) return false;\n\n // deopt on member expressions as they may be getter/setters and have side-effects\n if (t.isMemberExpression(elem)) return false;\n }\n\n // deopt on reference to left side identifiers\n const bindings = t.getBindingIdentifiers(pattern);\n const state = { deopt: false, bindings };\n\n try {\n t.traverse(arr, arrayUnpackVisitor, state);\n } catch (e) {\n if (e !== STOP_TRAVERSAL) throw e;\n }\n\n return !state.deopt;\n }\n\n pushUnpackedArrayPattern(pattern, arr) {\n for (let i = 0; i < pattern.elements.length; i++) {\n const elem = pattern.elements[i];\n if (t.isRestElement(elem)) {\n this.push(elem.argument, t.arrayExpression(arr.elements.slice(i)));\n } else {\n this.push(elem, arr.elements[i]);\n }\n }\n }\n\n pushArrayPattern(pattern, arrayRef) {\n if (!pattern.elements) return;\n\n // optimise basic array destructuring of an array expression\n //\n // we can't do this to a pattern of unequal size to it's right hand\n // array expression as then there will be values that wont be evaluated\n //\n // eg: let [a, b] = [1, 2];\n\n if (this.canUnpackArrayPattern(pattern, arrayRef)) {\n return this.pushUnpackedArrayPattern(pattern, arrayRef);\n }\n\n // if we have a rest then we need all the elements so don't tell\n // `scope.toArray` to only get a certain amount\n\n const count = !hasRest(pattern) && pattern.elements.length;\n\n // so we need to ensure that the `arrayRef` is an array, `scope.toArray` will\n // return a locally bound identifier if it's been inferred to be an array,\n // otherwise it'll be a call to a helper that will ensure it's one\n\n const toArray = this.toArray(arrayRef, count);\n\n if (t.isIdentifier(toArray)) {\n // we've been given an identifier so it must have been inferred to be an\n // array\n arrayRef = toArray;\n } else {\n arrayRef = this.scope.generateUidIdentifierBasedOnNode(arrayRef);\n this.arrays[arrayRef.name] = true;\n this.nodes.push(this.buildVariableDeclaration(arrayRef, toArray));\n }\n\n //\n\n for (let i = 0; i < pattern.elements.length; i++) {\n let elem = pattern.elements[i];\n\n // hole\n if (!elem) continue;\n\n let elemRef;\n\n if (t.isRestElement(elem)) {\n elemRef = this.toArray(arrayRef);\n elemRef = t.callExpression(\n t.memberExpression(elemRef, t.identifier(\"slice\")),\n [t.numericLiteral(i)],\n );\n\n // set the element to the rest element argument since we've dealt with it\n // being a rest already\n elem = elem.argument;\n } else {\n elemRef = t.memberExpression(arrayRef, t.numericLiteral(i), true);\n }\n\n this.push(elem, elemRef);\n }\n }\n\n init(pattern, ref) {\n // trying to destructure a value that we can't evaluate more than once so we\n // need to save it to a variable\n\n if (!t.isArrayExpression(ref) && !t.isMemberExpression(ref)) {\n const memo = this.scope.maybeGenerateMemoised(ref, true);\n if (memo) {\n this.nodes.push(\n this.buildVariableDeclaration(memo, t.cloneNode(ref)),\n );\n ref = memo;\n }\n }\n\n //\n\n this.push(pattern, ref);\n\n return this.nodes;\n }\n }\n\n return {\n name: \"transform-destructuring\",\n\n visitor: {\n ExportNamedDeclaration(path) {\n const declaration = path.get(\"declaration\");\n if (!declaration.isVariableDeclaration()) return;\n if (!variableDeclarationHasPattern(declaration.node)) return;\n\n const specifiers = [];\n\n for (const name of Object.keys(path.getOuterBindingIdentifiers(path))) {\n specifiers.push(\n t.exportSpecifier(t.identifier(name), t.identifier(name)),\n );\n }\n\n // Split the declaration and export list into two declarations so that the variable\n // declaration can be split up later without needing to worry about not being a\n // top-level statement.\n path.replaceWith(declaration.node);\n path.insertAfter(t.exportNamedDeclaration(null, specifiers));\n },\n\n ForXStatement(path) {\n const { node, scope } = path;\n const left = node.left;\n\n if (t.isPattern(left)) {\n // for ({ length: k } in { abc: 3 });\n\n const temp = scope.generateUidIdentifier(\"ref\");\n\n node.left = t.variableDeclaration(\"var\", [\n t.variableDeclarator(temp),\n ]);\n\n path.ensureBlock();\n\n if (node.body.body.length === 0 && path.isCompletionRecord()) {\n node.body.body.unshift(\n t.expressionStatement(scope.buildUndefinedNode()),\n );\n }\n\n node.body.body.unshift(\n t.expressionStatement(t.assignmentExpression(\"=\", left, temp)),\n );\n\n return;\n }\n\n if (!t.isVariableDeclaration(left)) return;\n\n const pattern = left.declarations[0].id;\n if (!t.isPattern(pattern)) return;\n\n const key = scope.generateUidIdentifier(\"ref\");\n node.left = t.variableDeclaration(left.kind, [\n t.variableDeclarator(key, null),\n ]);\n\n const nodes = [];\n\n const destructuring = new DestructuringTransformer({\n kind: left.kind,\n scope: scope,\n nodes: nodes,\n arrayOnlySpread,\n addHelper: name => this.addHelper(name),\n });\n\n destructuring.init(pattern, key);\n\n path.ensureBlock();\n\n const block = node.body;\n block.body = nodes.concat(block.body);\n },\n\n CatchClause({ node, scope }) {\n const pattern = node.param;\n if (!t.isPattern(pattern)) return;\n\n const ref = scope.generateUidIdentifier(\"ref\");\n node.param = ref;\n\n const nodes = [];\n\n const destructuring = new DestructuringTransformer({\n kind: \"let\",\n scope: scope,\n nodes: nodes,\n arrayOnlySpread,\n addHelper: name => this.addHelper(name),\n });\n destructuring.init(pattern, ref);\n\n node.body.body = nodes.concat(node.body.body);\n },\n\n AssignmentExpression(path) {\n const { node, scope } = path;\n if (!t.isPattern(node.left)) return;\n\n const nodes = [];\n\n const destructuring = new DestructuringTransformer({\n operator: node.operator,\n scope: scope,\n nodes: nodes,\n arrayOnlySpread,\n addHelper: name => this.addHelper(name),\n });\n\n let ref;\n if (\n path.isCompletionRecord() ||\n !path.parentPath.isExpressionStatement()\n ) {\n ref = scope.generateUidIdentifierBasedOnNode(node.right, \"ref\");\n\n nodes.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(ref, node.right),\n ]),\n );\n\n if (t.isArrayExpression(node.right)) {\n destructuring.arrays[ref.name] = true;\n }\n }\n\n destructuring.init(node.left, ref || node.right);\n\n if (ref) {\n if (path.parentPath.isArrowFunctionExpression()) {\n path.replaceWith(t.blockStatement([]));\n nodes.push(t.returnStatement(t.cloneNode(ref)));\n } else {\n nodes.push(t.expressionStatement(t.cloneNode(ref)));\n }\n }\n\n path.replaceWithMultiple(nodes);\n },\n\n VariableDeclaration(path) {\n const { node, scope, parent } = path;\n if (t.isForXStatement(parent)) return;\n if (!parent || !path.container) return; // i don't know why this is necessary - TODO\n if (!variableDeclarationHasPattern(node)) return;\n\n const nodeKind = node.kind;\n const nodes = [];\n let declar;\n\n for (let i = 0; i < node.declarations.length; i++) {\n declar = node.declarations[i];\n\n const patternId = declar.init;\n const pattern = declar.id;\n\n const destructuring = new DestructuringTransformer({\n blockHoist: node._blockHoist,\n nodes: nodes,\n scope: scope,\n kind: node.kind,\n arrayOnlySpread,\n addHelper: name => this.addHelper(name),\n });\n\n if (t.isPattern(pattern)) {\n destructuring.init(pattern, patternId);\n\n if (+i !== node.declarations.length - 1) {\n // we aren't the last declarator so let's just make the\n // last transformed node inherit from us\n t.inherits(nodes[nodes.length - 1], declar);\n }\n } else {\n nodes.push(\n t.inherits(\n destructuring.buildVariableAssignment(\n declar.id,\n t.cloneNode(declar.init),\n ),\n declar,\n ),\n );\n }\n }\n\n let tail = null;\n const nodesOut = [];\n for (const node of nodes) {\n if (tail !== null && t.isVariableDeclaration(node)) {\n // Create a single compound declarations\n tail.declarations.push(...node.declarations);\n } else {\n // Make sure the original node kind is used for each compound declaration\n node.kind = nodeKind;\n nodesOut.push(node);\n tail = t.isVariableDeclaration(node) ? node : null;\n }\n }\n\n // Need to unmark the current binding to this var as a param, or other hoists\n // could be placed above this ref.\n // https://github.com/babel/babel/issues/4516\n for (const nodeOut of nodesOut) {\n if (!nodeOut.declarations) continue;\n for (const declaration of nodeOut.declarations) {\n const { name } = declaration.id;\n if (scope.bindings[name]) {\n scope.bindings[name].kind = nodeOut.kind;\n }\n }\n }\n\n if (nodesOut.length === 1) {\n path.replaceWith(nodesOut[0]);\n } else {\n path.replaceWithMultiple(nodesOut);\n }\n },\n },\n };\n});\n","/* eslint-disable @babel/development/plugin-name */\nimport { createRegExpFeaturePlugin } from \"@babel/helper-create-regexp-features-plugin\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return createRegExpFeaturePlugin({\n name: \"transform-dotall-regex\",\n feature: \"dotAllFlag\",\n });\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nfunction getName(key) {\n if (t.isIdentifier(key)) {\n return key.name;\n }\n return key.value.toString();\n}\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-duplicate-keys\",\n\n visitor: {\n ObjectExpression(path) {\n const { node } = path;\n const plainProps = node.properties.filter(\n prop => !t.isSpreadElement(prop) && !prop.computed,\n );\n\n // A property is a duplicate key if:\n // * the property is a data property, and is preceded by a data,\n // getter, or setter property of the same name.\n // * the property is a getter property, and is preceded by a data or\n // getter property of the same name.\n // * the property is a setter property, and is preceded by a data or\n // setter property of the same name.\n\n const alreadySeenData = Object.create(null);\n const alreadySeenGetters = Object.create(null);\n const alreadySeenSetters = Object.create(null);\n\n for (const prop of plainProps) {\n const name = getName(prop.key);\n let isDuplicate = false;\n switch (prop.kind) {\n case \"get\":\n if (alreadySeenData[name] || alreadySeenGetters[name]) {\n isDuplicate = true;\n }\n alreadySeenGetters[name] = true;\n break;\n case \"set\":\n if (alreadySeenData[name] || alreadySeenSetters[name]) {\n isDuplicate = true;\n }\n alreadySeenSetters[name] = true;\n break;\n default:\n if (\n alreadySeenData[name] ||\n alreadySeenGetters[name] ||\n alreadySeenSetters[name]\n ) {\n isDuplicate = true;\n }\n alreadySeenData[name] = true;\n }\n\n if (isDuplicate) {\n // Rely on the computed properties transform to split the property\n // assignment out of the object literal.\n prop.computed = true;\n prop.key = t.stringLiteral(name);\n }\n }\n },\n },\n };\n});\n","import type { Scope } from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\n\nfunction getObjRef(node, nodes, file, scope) {\n let ref;\n if (t.isSuper(node)) {\n // Super cannot be directly assigned so lets return it directly\n return node;\n } else if (t.isIdentifier(node)) {\n if (scope.hasBinding(node.name)) {\n // this variable is declared in scope so we can be 100% sure\n // that evaluating it multiple times wont trigger a getter\n // or something else\n return node;\n } else {\n // could possibly trigger a getter so we need to only evaluate\n // it once\n ref = node;\n }\n } else if (t.isMemberExpression(node)) {\n ref = node.object;\n\n if (t.isSuper(ref) || (t.isIdentifier(ref) && scope.hasBinding(ref.name))) {\n // the object reference that we need to save is locally declared\n // so as per the previous comment we can be 100% sure evaluating\n // it multiple times will be safe\n // Super cannot be directly assigned so lets return it also\n return ref;\n }\n } else {\n throw new Error(`We can't explode this node type ${node.type}`);\n }\n\n const temp = scope.generateUidIdentifierBasedOnNode(ref);\n scope.push({ id: temp });\n nodes.push(t.assignmentExpression(\"=\", t.cloneNode(temp), t.cloneNode(ref)));\n return temp;\n}\n\nfunction getPropRef(node, nodes, file, scope) {\n const prop = node.property;\n const key = t.toComputedKey(node, prop);\n if (t.isLiteral(key) && t.isPureish(key)) return key;\n\n const temp = scope.generateUidIdentifierBasedOnNode(prop);\n scope.push({ id: temp });\n nodes.push(t.assignmentExpression(\"=\", t.cloneNode(temp), t.cloneNode(prop)));\n return temp;\n}\n\nexport default function(\n node: Object,\n nodes: Array,\n file,\n scope: Scope,\n allowedSingleIdent?: boolean,\n): {\n uid: Object,\n ref: Object,\n} {\n let obj;\n if (t.isIdentifier(node) && allowedSingleIdent) {\n obj = node;\n } else {\n obj = getObjRef(node, nodes, file, scope);\n }\n\n let ref, uid;\n\n if (t.isIdentifier(node)) {\n ref = t.cloneNode(node);\n uid = obj;\n } else {\n const prop = getPropRef(node, nodes, file, scope);\n const computed = node.computed || t.isLiteral(prop);\n uid = t.memberExpression(t.cloneNode(obj), t.cloneNode(prop), computed);\n ref = t.memberExpression(t.cloneNode(obj), t.cloneNode(prop), computed);\n }\n\n return {\n uid: uid,\n ref: ref,\n };\n}\n","import explode from \"@babel/helper-explode-assignable-expression\";\nimport * as t from \"@babel/types\";\n\nexport default function(opts: { build: Function, operator: string }): Object {\n const { build, operator } = opts;\n\n return {\n AssignmentExpression(path) {\n const { node, scope } = path;\n if (node.operator !== operator + \"=\") return;\n\n const nodes = [];\n const exploded = explode(node.left, nodes, this, scope);\n nodes.push(\n t.assignmentExpression(\n \"=\",\n exploded.ref,\n build(exploded.uid, node.right),\n ),\n );\n path.replaceWith(t.sequenceExpression(nodes));\n },\n\n BinaryExpression(path) {\n const { node } = path;\n if (node.operator === operator) {\n path.replaceWith(build(node.left, node.right));\n }\n },\n };\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport build from \"@babel/helper-builder-binary-assignment-operator-visitor\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-exponentiation-operator\",\n\n visitor: build({\n operator: \"**\",\n\n build(left, right) {\n return t.callExpression(\n t.memberExpression(t.identifier(\"Math\"), t.identifier(\"pow\")),\n [left, right],\n );\n },\n }),\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxFlow from \"@babel/plugin-syntax-flow\";\nimport { types as t } from \"@babel/core\";\nimport generateCode from \"@babel/generator\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function commentFromString(comment) {\n return typeof comment === \"string\"\n ? { type: \"CommentBlock\", value: comment }\n : comment;\n }\n\n function attachComment({\n ofPath,\n toPath,\n where = \"trailing\",\n optional = false,\n comments = generateComment(ofPath, optional),\n keepType = false,\n }) {\n if (!toPath || !toPath.node) {\n toPath = ofPath.getPrevSibling();\n where = \"trailing\";\n }\n if (!toPath.node) {\n toPath = ofPath.getNextSibling();\n where = \"leading\";\n }\n if (!toPath.node) {\n toPath = ofPath.parentPath;\n where = \"inner\";\n }\n if (!Array.isArray(comments)) {\n comments = [comments];\n }\n comments = comments.map(commentFromString);\n if (!keepType && ofPath && ofPath.node) {\n // Removes the node at `ofPath` while conserving the comments attached\n // to it.\n const node = ofPath.node;\n const parent = ofPath.parentPath;\n const prev = ofPath.getPrevSibling();\n const next = ofPath.getNextSibling();\n const isSingleChild = !(prev.node || next.node);\n const leading = node.leadingComments;\n const trailing = node.trailingComments;\n\n if (isSingleChild && leading) {\n parent.addComments(\"inner\", leading);\n }\n toPath.addComments(where, comments);\n ofPath.remove();\n if (isSingleChild && trailing) {\n parent.addComments(\"inner\", trailing);\n }\n } else {\n toPath.addComments(where, comments);\n }\n }\n\n function wrapInFlowComment(path) {\n attachComment({\n ofPath: path,\n comments: generateComment(path, path.parent.optional),\n });\n }\n\n function generateComment(path, optional) {\n let comment = path\n .getSource()\n .replace(/\\*-\\//g, \"*-ESCAPED/\")\n .replace(/\\*\\//g, \"*-/\");\n if (optional) comment = \"?\" + comment;\n if (comment[0] !== \":\") comment = \":: \" + comment;\n return comment;\n }\n\n function isTypeImport(importKind) {\n return importKind === \"type\" || importKind === \"typeof\";\n }\n\n return {\n name: \"transform-flow-comments\",\n inherits: syntaxFlow,\n\n visitor: {\n TypeCastExpression(path) {\n const { node } = path;\n attachComment({\n ofPath: path.get(\"typeAnnotation\"),\n toPath: path.get(\"expression\"),\n keepType: true,\n });\n path.replaceWith(t.parenthesizedExpression(node.expression));\n },\n\n // support function a(b?) {}\n Identifier(path) {\n if (path.parentPath.isFlow()) return;\n const { node } = path;\n if (node.typeAnnotation) {\n attachComment({\n ofPath: path.get(\"typeAnnotation\"),\n toPath: path,\n optional: node.optional || node.typeAnnotation.optional,\n });\n if (node.optional) {\n node.optional = false;\n }\n } else if (node.optional) {\n attachComment({\n toPath: path,\n comments: \":: ?\",\n });\n node.optional = false;\n }\n },\n\n AssignmentPattern: {\n exit({ node }) {\n const { left } = node;\n if (left.optional) {\n left.optional = false;\n }\n },\n },\n\n // strip optional property from function params - facebook/fbjs#17\n Function(path) {\n if (path.isDeclareFunction()) return;\n const { node } = path;\n if (node.typeParameters) {\n attachComment({\n ofPath: path.get(\"typeParameters\"),\n toPath: path.get(\"id\"),\n optional: node.typeParameters.optional,\n });\n }\n if (node.returnType) {\n attachComment({\n ofPath: path.get(\"returnType\"),\n toPath: path.get(\"body\"),\n where: \"leading\",\n optional: node.returnType.typeAnnotation.optional,\n });\n }\n },\n\n // support for `class X { foo: string }` - #4622\n ClassProperty(path) {\n const { node } = path;\n if (!node.value) {\n wrapInFlowComment(path);\n } else if (node.typeAnnotation) {\n attachComment({\n ofPath: path.get(\"typeAnnotation\"),\n toPath: path.get(\"key\"),\n optional: node.typeAnnotation.optional,\n });\n }\n },\n\n // support `export type a = {}` - #8 Error: You passed path.replaceWith() a falsy node\n ExportNamedDeclaration(path) {\n const { node } = path;\n if (node.exportKind !== \"type\" && !t.isFlow(node.declaration)) {\n return;\n }\n wrapInFlowComment(path);\n },\n\n // support `import type A` and `import typeof A` #10\n ImportDeclaration(path) {\n const { node } = path;\n if (isTypeImport(node.importKind)) {\n wrapInFlowComment(path);\n return;\n }\n\n const typeSpecifiers = node.specifiers.filter(specifier =>\n isTypeImport(specifier.importKind),\n );\n\n const nonTypeSpecifiers = node.specifiers.filter(\n specifier => !isTypeImport(specifier.importKind),\n );\n node.specifiers = nonTypeSpecifiers;\n\n if (typeSpecifiers.length > 0) {\n const typeImportNode = t.cloneNode(node);\n typeImportNode.specifiers = typeSpecifiers;\n const comment = `:: ${generateCode(typeImportNode).code}`;\n\n if (nonTypeSpecifiers.length > 0) {\n attachComment({ toPath: path, comments: comment });\n } else {\n attachComment({ ofPath: path, comments: comment });\n }\n }\n },\n ObjectPattern(path) {\n const { node } = path;\n if (node.typeAnnotation) {\n attachComment({\n ofPath: path.get(\"typeAnnotation\"),\n toPath: path,\n optional: node.optional || node.typeAnnotation.optional,\n });\n }\n },\n\n Flow(path) {\n wrapInFlowComment(path);\n },\n\n Class(path) {\n const { node } = path;\n let comments = [];\n if (node.typeParameters) {\n const typeParameters = path.get(\"typeParameters\");\n comments.push(\n generateComment(typeParameters, node.typeParameters.optional),\n );\n const trailingComments = node.typeParameters.trailingComments;\n if (trailingComments) {\n comments.push(...trailingComments);\n }\n typeParameters.remove();\n }\n\n if (node.superClass) {\n if (comments.length > 0) {\n attachComment({\n toPath: path.get(\"id\"),\n comments: comments,\n });\n comments = [];\n }\n\n if (node.superTypeParameters) {\n const superTypeParameters = path.get(\"superTypeParameters\");\n comments.push(\n generateComment(\n superTypeParameters,\n superTypeParameters.node.optional,\n ),\n );\n superTypeParameters.remove();\n }\n }\n\n if (node.implements) {\n const impls = path.get(\"implements\");\n const comment =\n \"implements \" +\n impls\n .map(impl => generateComment(impl).replace(/^:: /, \"\"))\n .join(\", \");\n delete node[\"implements\"];\n\n if (comments.length === 1) {\n comments[0] += ` ${comment}`;\n } else {\n comments.push(`:: ${comment}`);\n }\n }\n\n if (comments.length > 0) {\n attachComment({\n toPath: path.get(\"body\"),\n where: \"leading\",\n comments: comments,\n });\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxFlow from \"@babel/plugin-syntax-flow\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n const FLOW_DIRECTIVE = /(@flow(\\s+(strict(-local)?|weak))?|@noflow)/;\n\n let skipStrip = false;\n\n return {\n name: \"transform-flow-strip-types\",\n inherits: syntaxFlow,\n\n visitor: {\n Program(\n path,\n {\n file: {\n ast: { comments },\n },\n opts,\n },\n ) {\n skipStrip = false;\n let directiveFound = false;\n\n if (comments) {\n for (const comment of (comments: Array)) {\n if (FLOW_DIRECTIVE.test(comment.value)) {\n directiveFound = true;\n\n // remove flow directive\n comment.value = comment.value.replace(FLOW_DIRECTIVE, \"\");\n\n // remove the comment completely if it only consists of whitespace and/or stars\n if (!comment.value.replace(/\\*/g, \"\").trim()) {\n comment.ignore = true;\n }\n }\n }\n }\n\n if (!directiveFound && opts.requireDirective) {\n skipStrip = true;\n }\n },\n ImportDeclaration(path) {\n if (skipStrip) return;\n if (!path.node.specifiers.length) return;\n\n let typeCount = 0;\n\n path.node.specifiers.forEach(({ importKind }) => {\n if (importKind === \"type\" || importKind === \"typeof\") {\n typeCount++;\n }\n });\n\n if (typeCount === path.node.specifiers.length) {\n path.remove();\n }\n },\n\n Flow(path) {\n if (skipStrip) {\n throw path.buildCodeFrameError(\n \"A @flow directive is required when using Flow annotations with \" +\n \"the `requireDirective` option.\",\n );\n }\n\n path.remove();\n },\n\n ClassProperty(path) {\n if (skipStrip) return;\n path.node.variance = null;\n path.node.typeAnnotation = null;\n if (!path.node.value) path.remove();\n },\n\n ClassPrivateProperty(path) {\n if (skipStrip) return;\n path.node.typeAnnotation = null;\n },\n\n Class(path) {\n if (skipStrip) return;\n path.node.implements = null;\n\n // We do this here instead of in a `ClassProperty` visitor because the class transform\n // would transform the class before we reached the class property.\n path.get(\"body.body\").forEach(child => {\n if (child.isClassProperty()) {\n child.node.typeAnnotation = null;\n if (!child.node.value) child.remove();\n }\n });\n },\n\n AssignmentPattern({ node }) {\n if (skipStrip) return;\n node.left.optional = false;\n },\n\n Function({ node }) {\n if (skipStrip) return;\n for (let i = 0; i < node.params.length; i++) {\n const param = node.params[i];\n param.optional = false;\n if (param.type === \"AssignmentPattern\") {\n param.left.optional = false;\n }\n }\n\n node.predicate = null;\n },\n\n TypeCastExpression(path) {\n if (skipStrip) return;\n let { node } = path;\n do {\n node = node.expression;\n } while (t.isTypeCastExpression(node));\n path.replaceWith(node);\n },\n\n CallExpression({ node }) {\n if (skipStrip) return;\n node.typeArguments = null;\n },\n\n OptionalCallExpression({ node }) {\n if (skipStrip) return;\n node.typeArguments = null;\n },\n\n NewExpression({ node }) {\n if (skipStrip) return;\n node.typeArguments = null;\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { template, types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose, assumeArray } = options;\n\n if (loose === true && assumeArray === true) {\n throw new Error(\n `The loose and assumeArray options cannot be used together in @babel/plugin-transform-for-of`,\n );\n }\n\n if (assumeArray) {\n return {\n name: \"transform-for-of\",\n\n visitor: {\n ForOfStatement(path) {\n const { scope } = path;\n const { left, right, body } = path.node;\n const i = scope.generateUidIdentifier(\"i\");\n let array = scope.maybeGenerateMemoised(right, true);\n\n const inits = [t.variableDeclarator(i, t.numericLiteral(0))];\n if (array) {\n inits.push(t.variableDeclarator(array, right));\n } else {\n array = right;\n }\n\n const item = t.memberExpression(\n t.cloneNode(array),\n t.cloneNode(i),\n true,\n );\n let assignment;\n if (t.isVariableDeclaration(left)) {\n assignment = left;\n assignment.declarations[0].init = item;\n } else {\n assignment = t.expressionStatement(\n t.assignmentExpression(\"=\", left, item),\n );\n }\n\n const block = t.toBlock(body);\n block.body.unshift(assignment);\n\n path.replaceWith(\n t.forStatement(\n t.variableDeclaration(\"let\", inits),\n t.binaryExpression(\n \"<\",\n t.cloneNode(i),\n t.memberExpression(t.cloneNode(array), t.identifier(\"length\")),\n ),\n t.updateExpression(\"++\", t.cloneNode(i)),\n block,\n ),\n );\n },\n },\n };\n }\n\n const pushComputedProps = loose\n ? pushComputedPropsLoose\n : pushComputedPropsSpec;\n\n const buildForOfArray = template(`\n for (var KEY = 0, NAME = ARR; KEY < NAME.length; KEY++) BODY;\n `);\n\n const buildForOfLoose = template(`\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n INTERMEDIATE;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n `);\n\n const buildForOf = template(`\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (\n var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY;\n !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done);\n ITERATOR_COMPLETION = true\n ) {}\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return != null) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n `);\n\n function _ForOfStatementArray(path) {\n const { node, scope } = path;\n\n const right = scope.generateUidIdentifierBasedOnNode(node.right, \"arr\");\n const iterationKey = scope.generateUidIdentifier(\"i\");\n\n let loop = buildForOfArray({\n BODY: node.body,\n KEY: iterationKey,\n NAME: right,\n ARR: node.right,\n });\n\n t.inherits(loop, node);\n t.ensureBlock(loop);\n\n const iterationValue = t.memberExpression(\n t.cloneNode(right),\n t.cloneNode(iterationKey),\n true,\n );\n\n const left = node.left;\n if (t.isVariableDeclaration(left)) {\n left.declarations[0].init = iterationValue;\n loop.body.body.unshift(left);\n } else {\n loop.body.body.unshift(\n t.expressionStatement(\n t.assignmentExpression(\"=\", left, iterationValue),\n ),\n );\n }\n\n if (path.parentPath.isLabeledStatement()) {\n loop = t.labeledStatement(path.parentPath.node.label, loop);\n }\n\n return [loop];\n }\n\n function replaceWithArray(path) {\n if (path.parentPath.isLabeledStatement()) {\n path.parentPath.replaceWithMultiple(_ForOfStatementArray(path));\n } else {\n path.replaceWithMultiple(_ForOfStatementArray(path));\n }\n }\n\n return {\n name: \"transform-for-of\",\n visitor: {\n ForOfStatement(path, state) {\n const right = path.get(\"right\");\n if (\n right.isArrayExpression() ||\n right.isGenericType(\"Array\") ||\n t.isArrayTypeAnnotation(right.getTypeAnnotation())\n ) {\n replaceWithArray(path);\n return;\n }\n\n const { node } = path;\n const build = pushComputedProps(path, state);\n const declar = build.declar;\n const loop = build.loop;\n const block = loop.body;\n\n // ensure that it's a block so we can take all its statements\n path.ensureBlock();\n\n // add the value declaration to the new loop body\n if (declar) {\n block.body.push(declar);\n }\n\n // push the rest of the original loop body onto our new body\n block.body = block.body.concat(node.body.body);\n\n t.inherits(loop, node);\n t.inherits(loop.body, node.body);\n\n if (build.replaceParent) {\n path.parentPath.replaceWithMultiple(build.node);\n path.remove();\n } else {\n path.replaceWithMultiple(build.node);\n }\n },\n },\n };\n\n function pushComputedPropsLoose(path, file) {\n const { node, scope, parent } = path;\n const { left } = node;\n let declar, id, intermediate;\n\n if (\n t.isIdentifier(left) ||\n t.isPattern(left) ||\n t.isMemberExpression(left)\n ) {\n // for (i of test), for ({ i } of test)\n id = left;\n intermediate = null;\n } else if (t.isVariableDeclaration(left)) {\n // for (let i of test)\n id = scope.generateUidIdentifier(\"ref\");\n declar = t.variableDeclaration(left.kind, [\n t.variableDeclarator(left.declarations[0].id, t.identifier(id.name)),\n ]);\n intermediate = t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(id.name)),\n ]);\n } else {\n throw file.buildCodeFrameError(\n left,\n `Unknown node type ${left.type} in ForStatement`,\n );\n }\n\n const iteratorKey = scope.generateUidIdentifier(\"iterator\");\n const isArrayKey = scope.generateUidIdentifier(\"isArray\");\n\n const loop = buildForOfLoose({\n LOOP_OBJECT: iteratorKey,\n IS_ARRAY: isArrayKey,\n OBJECT: node.right,\n INDEX: scope.generateUidIdentifier(\"i\"),\n ID: id,\n INTERMEDIATE: intermediate,\n });\n\n //\n const isLabeledParent = t.isLabeledStatement(parent);\n let labeled;\n\n if (isLabeledParent) {\n labeled = t.labeledStatement(parent.label, loop);\n }\n\n return {\n replaceParent: isLabeledParent,\n declar: declar,\n node: labeled || loop,\n loop: loop,\n };\n }\n\n function pushComputedPropsSpec(path, file) {\n const { node, scope, parent } = path;\n const left = node.left;\n let declar;\n\n const stepKey = scope.generateUid(\"step\");\n const stepValue = t.memberExpression(\n t.identifier(stepKey),\n t.identifier(\"value\"),\n );\n\n if (\n t.isIdentifier(left) ||\n t.isPattern(left) ||\n t.isMemberExpression(left)\n ) {\n // for (i of test), for ({ i } of test)\n declar = t.expressionStatement(\n t.assignmentExpression(\"=\", left, stepValue),\n );\n } else if (t.isVariableDeclaration(left)) {\n // for (let i of test)\n declar = t.variableDeclaration(left.kind, [\n t.variableDeclarator(left.declarations[0].id, stepValue),\n ]);\n } else {\n throw file.buildCodeFrameError(\n left,\n `Unknown node type ${left.type} in ForStatement`,\n );\n }\n\n const template = buildForOf({\n ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier(\"didIteratorError\"),\n ITERATOR_COMPLETION: scope.generateUidIdentifier(\n \"iteratorNormalCompletion\",\n ),\n ITERATOR_ERROR_KEY: scope.generateUidIdentifier(\"iteratorError\"),\n ITERATOR_KEY: scope.generateUidIdentifier(\"iterator\"),\n STEP_KEY: t.identifier(stepKey),\n OBJECT: node.right,\n });\n\n const isLabeledParent = t.isLabeledStatement(parent);\n\n const tryBody = template[3].block.body;\n const loop = tryBody[0];\n\n if (isLabeledParent) {\n tryBody[0] = t.labeledStatement(parent.label, loop);\n }\n\n //\n\n return {\n replaceParent: isLabeledParent,\n declar: declar,\n loop: loop,\n node: template,\n };\n }\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport nameFunction from \"@babel/helper-function-name\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-function-name\",\n\n visitor: {\n FunctionExpression: {\n exit(path) {\n if (path.key !== \"value\" && !path.parentPath.isObjectProperty()) {\n const replacement = nameFunction(path);\n if (replacement) path.replaceWith(replacement);\n }\n },\n },\n\n ObjectProperty(path) {\n const value = path.get(\"value\");\n if (value.isFunction()) {\n const newNode = nameFunction(value);\n if (newNode) value.replaceWith(newNode);\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-instanceof\",\n\n visitor: {\n BinaryExpression(path) {\n const { node } = path;\n if (node.operator === \"instanceof\") {\n const helper = this.addHelper(\"instanceof\");\n const isUnderHelper = path.findParent(path => {\n return (\n (path.isVariableDeclarator() && path.node.id === helper) ||\n (path.isFunctionDeclaration() &&\n path.node.id &&\n path.node.id.name === helper.name)\n );\n });\n\n if (isUnderHelper) {\n return;\n } else {\n path.replaceWith(t.callExpression(helper, [node.left, node.right]));\n }\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-jscript\",\n\n visitor: {\n FunctionExpression: {\n exit(path) {\n const { node } = path;\n if (!node.id) return;\n\n path.replaceWith(\n t.callExpression(\n t.functionExpression(\n null,\n [],\n t.blockStatement([\n t.toStatement(node),\n t.returnStatement(t.cloneNode(node.id)),\n ]),\n ),\n [],\n ),\n );\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-literals\",\n\n visitor: {\n NumericLiteral({ node }) {\n // number octal like 0b10 or 0o70\n if (node.extra && /^0[ob]/i.test(node.extra.raw)) {\n node.extra = undefined;\n }\n },\n\n StringLiteral({ node }) {\n // unicode escape\n if (node.extra && /\\\\[u]/gi.test(node.extra.raw)) {\n node.extra = undefined;\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-member-expression-literals\",\n\n visitor: {\n MemberExpression: {\n exit({ node }) {\n const prop = node.property;\n if (\n !node.computed &&\n t.isIdentifier(prop) &&\n !t.isValidES3Identifier(prop.name)\n ) {\n // foo.default -> foo[\"default\"]\n node.property = t.stringLiteral(prop.name);\n node.computed = true;\n }\n },\n },\n },\n };\n});\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","var baseSlice = require('./_baseSlice'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\nfunction chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n}\n\nmodule.exports = chunk;\n","export default function rewriteThis(programPath: NodePath) {\n // Rewrite \"this\" to be \"undefined\".\n programPath.traverse(rewriteThisVisitor);\n}\n\n/**\n * A visitor to walk the tree, rewriting all `this` references in the top-level scope to be\n * `undefined`.\n */\nconst rewriteThisVisitor = {\n ThisExpression(path) {\n path.replaceWith(path.scope.buildUndefinedNode());\n },\n Function(path) {\n if (!path.isArrowFunctionExpression()) path.skip();\n },\n ClassProperty(path) {\n path.skip();\n },\n ClassPrivateProperty(path) {\n path.skip();\n },\n};\n","import * as t from \"@babel/types\";\n\nexport default function simplifyAccess(path: NodePath, bindingNames) {\n path.traverse(simpleAssignmentVisitor, {\n scope: path.scope,\n bindingNames,\n seen: new WeakSet(),\n });\n}\n\nconst simpleAssignmentVisitor = {\n UpdateExpression: {\n exit(path) {\n const { scope, bindingNames } = this;\n\n const arg = path.get(\"argument\");\n if (!arg.isIdentifier()) return;\n const localName = arg.node.name;\n\n if (!bindingNames.has(localName)) return;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n if (\n path.parentPath.isExpressionStatement() &&\n !path.isCompletionRecord()\n ) {\n // ++i => (i += 1);\n const operator = path.node.operator == \"++\" ? \"+=\" : \"-=\";\n path.replaceWith(\n t.assignmentExpression(operator, arg.node, t.numericLiteral(1)),\n );\n } else if (path.node.prefix) {\n // ++i => (i = (+i) + 1);\n path.replaceWith(\n t.assignmentExpression(\n \"=\",\n t.identifier(localName),\n t.binaryExpression(\n path.node.operator[0],\n t.unaryExpression(\"+\", arg.node),\n t.numericLiteral(1),\n ),\n ),\n );\n } else {\n const old = path.scope.generateUidIdentifierBasedOnNode(\n arg.node,\n \"old\",\n );\n const varName = old.name;\n path.scope.push({ id: old });\n\n const binary = t.binaryExpression(\n path.node.operator[0],\n t.identifier(varName),\n t.numericLiteral(1),\n );\n\n // i++ => (_old = (+i), i = _old + 1, _old)\n path.replaceWith(\n t.sequenceExpression([\n t.assignmentExpression(\n \"=\",\n t.identifier(varName),\n t.unaryExpression(\"+\", arg.node),\n ),\n t.assignmentExpression(\"=\", t.cloneNode(arg.node), binary),\n t.identifier(varName),\n ]),\n );\n }\n },\n },\n\n AssignmentExpression: {\n exit(path) {\n const { scope, seen, bindingNames } = this;\n\n if (path.node.operator === \"=\") return;\n\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const left = path.get(\"left\");\n if (!left.isIdentifier()) return;\n\n // Simple update-assign foo += 1;\n // => exports.foo = (foo += 1);\n const localName = left.node.name;\n\n if (!bindingNames.has(localName)) return;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n path.node.right = t.binaryExpression(\n path.node.operator.slice(0, -1),\n t.cloneNode(path.node.left),\n path.node.right,\n );\n path.node.operator = \"=\";\n },\n },\n};\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\nimport template from \"@babel/template\";\nimport simplifyAccess from \"@babel/helper-simple-access\";\n\nimport type { ModuleMetadata } from \"./\";\n\nexport default function rewriteLiveReferences(\n programPath: NodePath,\n metadata: ModuleMetadata,\n) {\n const imported = new Map();\n const exported = new Map();\n const requeueInParent = path => {\n // Manualy re-queue `exports.default =` expressions so that the ES3\n // transform has an opportunity to convert them. Ideally this would\n // happen automatically from the replaceWith above. See #4140 for\n // more info.\n programPath.requeue(path);\n };\n\n for (const [source, data] of metadata.source) {\n for (const [localName, importName] of data.imports) {\n imported.set(localName, [source, importName, null]);\n }\n for (const localName of data.importsNamespace) {\n imported.set(localName, [source, null, localName]);\n }\n }\n\n for (const [local, data] of metadata.local) {\n let exportMeta = exported.get(local);\n if (!exportMeta) {\n exportMeta = [];\n exported.set(local, exportMeta);\n }\n\n exportMeta.push(...data.names);\n }\n\n // Rewrite initialization of bindings to update exports.\n programPath.traverse(rewriteBindingInitVisitor, {\n metadata,\n requeueInParent,\n scope: programPath.scope,\n exported, // local name => exported name list\n });\n\n simplifyAccess(\n programPath,\n // NOTE(logan): The 'Array.from' calls are to make this code with in loose mode.\n new Set([...Array.from(imported.keys()), ...Array.from(exported.keys())]),\n );\n\n // Rewrite reads/writes from imports and exports to have the correct behavior.\n programPath.traverse(rewriteReferencesVisitor, {\n seen: new WeakSet(),\n metadata,\n requeueInParent,\n scope: programPath.scope,\n imported, // local / import\n exported, // local name => exported name list\n buildImportReference: ([source, importName, localName], identNode) => {\n const meta = metadata.source.get(source);\n\n if (localName) {\n if (meta.lazy) identNode = t.callExpression(identNode, []);\n return identNode;\n }\n\n let namespace = t.identifier(meta.name);\n if (meta.lazy) namespace = t.callExpression(namespace, []);\n\n return t.memberExpression(namespace, t.identifier(importName));\n },\n });\n}\n\n/**\n * A visitor to inject export update statements during binding initialization.\n */\nconst rewriteBindingInitVisitor = {\n Scope(path) {\n path.skip();\n },\n ClassDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n const { id } = path.node;\n if (!id) throw new Error(\"Expected class to have a name\");\n const localName = id.name;\n\n const exportNames = exported.get(localName) || [];\n if (exportNames.length > 0) {\n const statement = t.expressionStatement(\n buildBindingExportAssignmentExpression(\n metadata,\n exportNames,\n t.identifier(localName),\n ),\n );\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n },\n VariableDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n Object.keys(path.getOuterBindingIdentifiers()).forEach(localName => {\n const exportNames = exported.get(localName) || [];\n\n if (exportNames.length > 0) {\n const statement = t.expressionStatement(\n buildBindingExportAssignmentExpression(\n metadata,\n exportNames,\n t.identifier(localName),\n ),\n );\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n });\n },\n};\n\nconst buildBindingExportAssignmentExpression = (\n metadata,\n exportNames,\n localExpr,\n) => {\n return (exportNames || []).reduce((expr, exportName) => {\n // class Foo {} export { Foo, Foo as Bar };\n // as\n // class Foo {} exports.Foo = exports.Bar = Foo;\n return t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.identifier(metadata.exportName),\n t.identifier(exportName),\n ),\n expr,\n );\n }, localExpr);\n};\n\nconst buildImportThrow = localName => {\n return template.expression.ast`\n (function() {\n throw new Error('\"' + '${localName}' + '\" is read-only.');\n })()\n `;\n};\n\nconst rewriteReferencesVisitor = {\n ReferencedIdentifier(path) {\n const {\n seen,\n buildImportReference,\n scope,\n imported,\n requeueInParent,\n } = this;\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const localName = path.node.name;\n\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = scope.getBinding(localName);\n\n // redeclared in this scope\n if (rootBinding !== localBinding) return;\n\n const importData = imported.get(localName);\n if (importData) {\n const ref = buildImportReference(importData, path.node);\n\n // Preserve the binding location so that sourcemaps are nicer.\n ref.loc = path.node.loc;\n\n if (\n (path.parentPath.isCallExpression({ callee: path.node }) ||\n path.parentPath.isOptionalCallExpression({ callee: path.node }) ||\n path.parentPath.isTaggedTemplateExpression({ tag: path.node })) &&\n t.isMemberExpression(ref)\n ) {\n path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref]));\n } else if (path.isJSXIdentifier() && t.isMemberExpression(ref)) {\n const { object, property } = ref;\n path.replaceWith(\n t.JSXMemberExpression(\n t.JSXIdentifier(object.name),\n t.JSXIdentifier(property.name),\n ),\n );\n } else {\n path.replaceWith(ref);\n }\n\n requeueInParent(path);\n\n // The path could have been replaced with an identifier that would\n // otherwise be re-visited, so we skip processing its children.\n path.skip();\n }\n },\n\n AssignmentExpression: {\n exit(path) {\n const {\n scope,\n seen,\n imported,\n exported,\n requeueInParent,\n buildImportReference,\n } = this;\n\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const left = path.get(\"left\");\n\n // No change needed\n if (left.isMemberExpression()) return;\n\n if (left.isIdentifier()) {\n // Simple update-assign foo += 1; export { foo };\n // => exports.foo = (foo += 1);\n const localName = left.node.name;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n const exportedNames = exported.get(localName);\n const importData = imported.get(localName);\n if (exportedNames?.length > 0 || importData) {\n assert(path.node.operator === \"=\", \"Path was not simplified\");\n\n const assignment = path.node;\n\n if (importData) {\n assignment.left = buildImportReference(importData, assignment.left);\n\n assignment.right = t.sequenceExpression([\n assignment.right,\n buildImportThrow(localName),\n ]);\n }\n\n path.replaceWith(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n assignment,\n ),\n );\n requeueInParent(path);\n }\n } else {\n const ids = left.getOuterBindingIdentifiers();\n const programScopeIds = Object.keys(ids).filter(\n localName =>\n scope.getBinding(localName) === path.scope.getBinding(localName),\n );\n const id = programScopeIds.find(localName => imported.has(localName));\n\n if (id) {\n path.node.right = t.sequenceExpression([\n path.node.right,\n buildImportThrow(id),\n ]);\n }\n\n // Complex ({a, b, c} = {}); export { a, c };\n // => ({a, b, c} = {}), (exports.a = a, exports.c = c);\n const items = [];\n programScopeIds.forEach(localName => {\n const exportedNames = exported.get(localName) || [];\n if (exportedNames.length > 0) {\n items.push(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.identifier(localName),\n ),\n );\n }\n });\n\n if (items.length > 0) {\n let node = t.sequenceExpression(items);\n if (path.parentPath.isExpressionStatement()) {\n node = t.expressionStatement(node);\n node._blockHoist = path.parentPath.node._blockHoist;\n }\n\n const statement = path.insertAfter(node)[0];\n requeueInParent(statement);\n }\n }\n },\n },\n};\n","import { basename, extname } from \"path\";\n\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\n\nexport type ModuleMetadata = {\n exportName: string,\n\n // The name of the variable that will reference an object containing export names.\n exportNameListName: null | string,\n\n hasExports: boolean,\n\n // Lookup from local binding to export information.\n local: Map,\n\n // Lookup of source file to source file metadata.\n source: Map,\n};\n\nexport type InteropType = \"default\" | \"namespace\" | \"none\";\n\nexport type SourceModuleMetadata = {\n // A unique variable name to use for this namespace object. Centralized for simplicity.\n name: string,\n\n loc: ?BabelNodeSourceLocation,\n\n interop: InteropType,\n\n // Local binding to reference from this source namespace. Key: Local name, value: Import name\n imports: Map,\n\n // Local names that reference namespace object.\n importsNamespace: Set,\n\n // Reexports to create for namespace. Key: Export name, value: Import name\n reexports: Map,\n\n // List of names to re-export namespace as.\n reexportNamespace: Set,\n\n // Tracks if the source should be re-exported.\n reexportAll: null | {\n loc: ?BabelNodeSourceLocation,\n },\n};\n\nexport type LocalExportMetadata = {\n name: Array, // names of exports\n kind: \"import\" | \"hoisted\" | \"block\" | \"var\",\n};\n\n/**\n * Check if the module has any exports that need handling.\n */\nexport function hasExports(metadata: ModuleMetadata) {\n return metadata.hasExports;\n}\n\n/**\n * Check if a given source is an anonymous import, e.g. \"import 'foo';\"\n */\nexport function isSideEffectImport(source: SourceModuleMetadata) {\n return (\n source.imports.size === 0 &&\n source.importsNamespace.size === 0 &&\n source.reexports.size === 0 &&\n source.reexportNamespace.size === 0 &&\n !source.reexportAll\n );\n}\n\n/**\n * Remove all imports and exports from the file, and return all metadata\n * needed to reconstruct the module's behavior.\n */\nexport default function normalizeModuleAndLoadMetadata(\n programPath: NodePath,\n exportName?: string,\n {\n noInterop = false,\n loose = false,\n lazy = false,\n esNamespaceOnly = false,\n } = {},\n): ModuleMetadata {\n if (!exportName) {\n exportName = programPath.scope.generateUidIdentifier(\"exports\").name;\n }\n\n nameAnonymousExports(programPath);\n\n const { local, source, hasExports } = getModuleMetadata(programPath, {\n loose,\n lazy,\n });\n\n removeModuleDeclarations(programPath);\n\n // Reuse the imported namespace name if there is one.\n for (const [, metadata] of source) {\n if (metadata.importsNamespace.size > 0) {\n // This is kind of gross. If we stop using `loose: true` we should\n // just make this destructuring assignment.\n metadata.name = metadata.importsNamespace.values().next().value;\n }\n\n if (noInterop) metadata.interop = \"none\";\n else if (esNamespaceOnly) {\n // Both the default and namespace interops pass through __esModule\n // objects, but the namespace interop is used to enable Babel's\n // destructuring-like interop behavior for normal CommonJS.\n // Since some tooling has started to remove that behavior, we expose\n // it as the `esNamespace` option.\n if (metadata.interop === \"namespace\") {\n metadata.interop = \"default\";\n }\n }\n }\n\n return {\n exportName,\n exportNameListName: null,\n hasExports,\n local,\n source,\n };\n}\n\n/**\n * Get metadata about the imports and exports present in this module.\n */\nfunction getModuleMetadata(\n programPath: NodePath,\n { loose, lazy }: { loose: boolean, lazy: boolean },\n) {\n const localData = getLocalExportMetadata(programPath, loose);\n\n const sourceData = new Map();\n const getData = sourceNode => {\n const source = sourceNode.value;\n\n let data = sourceData.get(source);\n if (!data) {\n data = {\n name: programPath.scope.generateUidIdentifier(\n basename(source, extname(source)),\n ).name,\n\n interop: \"none\",\n\n loc: null,\n\n // Data about the requested sources and names.\n imports: new Map(),\n importsNamespace: new Set(),\n\n // Metadata about data that is passed directly from source to export.\n reexports: new Map(),\n reexportNamespace: new Set(),\n reexportAll: null,\n\n lazy: false,\n };\n sourceData.set(source, data);\n }\n return data;\n };\n let hasExports = false;\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n const data = getData(child.node.source);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n if (spec.isImportDefaultSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, \"default\");\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, \"default\");\n });\n }\n } else if (spec.isImportNamespaceSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.importsNamespace.add(localName);\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexportNamespace.add(name);\n });\n }\n } else if (spec.isImportSpecifier()) {\n const importName = spec.get(\"imported\").node.name;\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, importName);\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, importName);\n });\n }\n }\n });\n } else if (child.isExportAllDeclaration()) {\n hasExports = true;\n const data = getData(child.node.source);\n if (!data.loc) data.loc = child.node.loc;\n\n data.reexportAll = {\n loc: child.node.loc,\n };\n } else if (child.isExportNamedDeclaration() && child.node.source) {\n hasExports = true;\n const data = getData(child.node.source);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n if (!spec.isExportSpecifier()) {\n throw spec.buildCodeFrameError(\"Unexpected export specifier type\");\n }\n const importName = spec.get(\"local\").node.name;\n const exportName = spec.get(\"exported\").node.name;\n\n data.reexports.set(exportName, importName);\n\n if (exportName === \"__esModule\") {\n throw exportName.buildCodeFrameError('Illegal export \"__esModule\".');\n }\n });\n } else if (\n child.isExportNamedDeclaration() ||\n child.isExportDefaultDeclaration()\n ) {\n hasExports = true;\n }\n });\n\n for (const metadata of sourceData.values()) {\n let needsDefault = false;\n let needsNamed = false;\n\n if (metadata.importsNamespace.size > 0) {\n needsDefault = true;\n needsNamed = true;\n }\n\n if (metadata.reexportAll) {\n needsNamed = true;\n }\n\n for (const importName of metadata.imports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n for (const importName of metadata.reexports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n\n if (needsDefault && needsNamed) {\n // TODO(logan): Using the namespace interop here is unfortunate. Revisit.\n metadata.interop = \"namespace\";\n } else if (needsDefault) {\n metadata.interop = \"default\";\n }\n }\n\n for (const [source, metadata] of sourceData) {\n if (\n lazy !== false &&\n !(isSideEffectImport(metadata) || metadata.reexportAll)\n ) {\n if (lazy === true) {\n // 'true' means that local relative files are eagerly loaded and\n // dependency modules are loaded lazily.\n metadata.lazy = !/\\./.test(source);\n } else if (Array.isArray(lazy)) {\n metadata.lazy = lazy.indexOf(source) !== -1;\n } else if (typeof lazy === \"function\") {\n metadata.lazy = lazy(source);\n } else {\n throw new Error(`.lazy must be a boolean, string array, or function`);\n }\n }\n }\n\n return {\n hasExports,\n local: localData,\n source: sourceData,\n };\n}\n\n/**\n * Get metadata about local variables that are exported.\n */\nfunction getLocalExportMetadata(\n programPath: NodePath,\n loose: boolean,\n): Map {\n const bindingKindLookup = new Map();\n\n programPath.get(\"body\").forEach(child => {\n let kind;\n if (child.isImportDeclaration()) {\n kind = \"import\";\n } else {\n if (child.isExportDefaultDeclaration()) child = child.get(\"declaration\");\n if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n child = child.get(\"declaration\");\n } else if (\n loose &&\n child.node.source &&\n child.get(\"source\").isStringLiteral()\n ) {\n child.node.specifiers.forEach(specifier => {\n bindingKindLookup.set(specifier.local.name, \"block\");\n });\n return;\n }\n }\n\n if (child.isFunctionDeclaration()) {\n kind = \"hoisted\";\n } else if (child.isClassDeclaration()) {\n kind = \"block\";\n } else if (child.isVariableDeclaration({ kind: \"var\" })) {\n kind = \"var\";\n } else if (child.isVariableDeclaration()) {\n kind = \"block\";\n } else {\n return;\n }\n }\n\n Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {\n bindingKindLookup.set(name, kind);\n });\n });\n\n const localMetadata = new Map();\n const getLocalMetadata = idPath => {\n const localName = idPath.node.name;\n let metadata = localMetadata.get(localName);\n\n if (!metadata) {\n const kind = bindingKindLookup.get(localName);\n\n if (kind === undefined) {\n throw idPath.buildCodeFrameError(\n `Exporting local \"${localName}\", which is not declared.`,\n );\n }\n\n metadata = {\n names: [],\n kind,\n };\n localMetadata.set(localName, metadata);\n }\n return metadata;\n };\n\n programPath.get(\"body\").forEach(child => {\n if (child.isExportNamedDeclaration() && (loose || !child.node.source)) {\n if (child.node.declaration) {\n const declaration = child.get(\"declaration\");\n const ids = declaration.getOuterBindingIdentifierPaths();\n Object.keys(ids).forEach(name => {\n if (name === \"__esModule\") {\n throw declaration.buildCodeFrameError(\n 'Illegal export \"__esModule\".',\n );\n }\n getLocalMetadata(ids[name]).names.push(name);\n });\n } else {\n child.get(\"specifiers\").forEach(spec => {\n const local = spec.get(\"local\");\n const exported = spec.get(\"exported\");\n\n if (exported.node.name === \"__esModule\") {\n throw exported.buildCodeFrameError('Illegal export \"__esModule\".');\n }\n getLocalMetadata(local).names.push(exported.node.name);\n });\n }\n } else if (child.isExportDefaultDeclaration()) {\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n getLocalMetadata(declaration.get(\"id\")).names.push(\"default\");\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n }\n });\n return localMetadata;\n}\n\n/**\n * Ensure that all exported values have local binding names.\n */\nfunction nameAnonymousExports(programPath: NodePath) {\n // Name anonymous exported locals.\n programPath.get(\"body\").forEach(child => {\n if (!child.isExportDefaultDeclaration()) return;\n splitExportDeclaration(child);\n });\n}\n\nfunction removeModuleDeclarations(programPath: NodePath) {\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n child.remove();\n } else if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n child.node.declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(child.node.declaration);\n } else {\n child.remove();\n }\n } else if (child.isExportDefaultDeclaration()) {\n // export default foo;\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(declaration);\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n } else if (child.isExportAllDeclaration()) {\n child.remove();\n }\n });\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\nimport template from \"@babel/template\";\nimport chunk from \"lodash/chunk\";\n\nimport { isModule } from \"@babel/helper-module-imports\";\n\nimport rewriteThis from \"./rewrite-this\";\nimport rewriteLiveReferences from \"./rewrite-live-references\";\nimport normalizeAndLoadModuleMetadata, {\n hasExports,\n isSideEffectImport,\n} from \"./normalize-and-load-metadata\";\n\nexport { hasExports, isSideEffectImport, isModule, rewriteThis };\n\n/**\n * Perform all of the generic ES6 module rewriting needed to handle initial\n * module processing. This function will rewrite the majority of the given\n * program to reference the modules described by the returned metadata,\n * and returns a list of statements for use when initializing the module.\n */\nexport function rewriteModuleStatementsAndPrepareHeader(\n path: NodePath,\n {\n exportName,\n strict,\n allowTopLevelThis,\n strictMode,\n loose,\n noInterop,\n lazy,\n esNamespaceOnly,\n },\n) {\n assert(isModule(path), \"Cannot process module statements in a script\");\n path.node.sourceType = \"script\";\n\n const meta = normalizeAndLoadModuleMetadata(path, exportName, {\n noInterop,\n loose,\n lazy,\n esNamespaceOnly,\n });\n\n if (!allowTopLevelThis) {\n rewriteThis(path);\n }\n\n rewriteLiveReferences(path, meta);\n\n if (strictMode !== false) {\n const hasStrict = path.node.directives.some(directive => {\n return directive.value.value === \"use strict\";\n });\n if (!hasStrict) {\n path.unshiftContainer(\n \"directives\",\n t.directive(t.directiveLiteral(\"use strict\")),\n );\n }\n }\n\n const headers = [];\n if (hasExports(meta) && !strict) {\n headers.push(buildESModuleHeader(meta, loose /* enumerable */));\n }\n\n const nameList = buildExportNameListDeclaration(path, meta);\n\n if (nameList) {\n meta.exportNameListName = nameList.name;\n headers.push(nameList.statement);\n }\n\n // Create all of the statically known named exports.\n headers.push(...buildExportInitializationStatements(path, meta, loose));\n\n return { meta, headers };\n}\n\n/**\n * Flag a set of statements as hoisted above all else so that module init\n * statements all run before user code.\n */\nexport function ensureStatementsHoisted(statements) {\n // Force all of the header fields to be at the top of the file.\n statements.forEach(header => {\n header._blockHoist = 3;\n });\n}\n\n/**\n * Given an expression for a standard import object, like \"require('foo')\",\n * wrap it in a call to the interop helpers based on the type.\n */\nexport function wrapInterop(\n programPath: NodePath,\n expr: Node,\n type: InteropType,\n): Node {\n if (type === \"none\") {\n return null;\n }\n\n let helper;\n if (type === \"default\") {\n helper = \"interopRequireDefault\";\n } else if (type === \"namespace\") {\n helper = \"interopRequireWildcard\";\n } else {\n throw new Error(`Unknown interop: ${type}`);\n }\n\n return t.callExpression(programPath.hub.addHelper(helper), [expr]);\n}\n\n/**\n * Create the runtime initialization statements for a given requested source.\n * These will initialize all of the runtime import/export logic that\n * can't be handled statically by the statements created by\n * buildExportInitializationStatements().\n */\nexport function buildNamespaceInitStatements(\n metadata: ModuleMetadata,\n sourceMetadata: SourceModuleMetadata,\n loose: boolean = false,\n) {\n const statements = [];\n\n let srcNamespace = t.identifier(sourceMetadata.name);\n if (sourceMetadata.lazy) srcNamespace = t.callExpression(srcNamespace, []);\n\n for (const localName of sourceMetadata.importsNamespace) {\n if (localName === sourceMetadata.name) continue;\n\n // Create and assign binding to namespace object\n statements.push(\n template.statement`var NAME = SOURCE;`({\n NAME: localName,\n SOURCE: t.cloneNode(srcNamespace),\n }),\n );\n }\n if (loose) {\n statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, loose));\n }\n for (const exportName of sourceMetadata.reexportNamespace) {\n // Assign export to namespace object.\n statements.push(\n (sourceMetadata.lazy\n ? template.statement`\n Object.defineProperty(EXPORTS, \"NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE;\n }\n });\n `\n : template.statement`EXPORTS.NAME = NAMESPACE;`)({\n EXPORTS: metadata.exportName,\n NAME: exportName,\n NAMESPACE: t.cloneNode(srcNamespace),\n }),\n );\n }\n if (sourceMetadata.reexportAll) {\n const statement = buildNamespaceReexport(\n metadata,\n t.cloneNode(srcNamespace),\n loose,\n );\n statement.loc = sourceMetadata.reexportAll.loc;\n\n // Iterate props creating getter for each prop.\n statements.push(statement);\n }\n return statements;\n}\n\nconst getTemplateForReexport = loose => {\n return loose\n ? template.statement`EXPORTS.EXPORT_NAME = NAMESPACE.IMPORT_NAME;`\n : template`\n Object.defineProperty(EXPORTS, \"EXPORT_NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE.IMPORT_NAME;\n },\n });\n `;\n};\n\nconst buildReexportsFromMeta = (meta, metadata, loose) => {\n const namespace = metadata.lazy\n ? t.callExpression(t.identifier(metadata.name), [])\n : t.identifier(metadata.name);\n\n const templateForCurrentMode = getTemplateForReexport(loose);\n return Array.from(metadata.reexports, ([exportName, importName]) =>\n templateForCurrentMode({\n EXPORTS: meta.exportName,\n EXPORT_NAME: exportName,\n NAMESPACE: t.cloneNode(namespace),\n IMPORT_NAME: importName,\n }),\n );\n};\n\n/**\n * Build an \"__esModule\" header statement setting the property on a given object.\n */\nfunction buildESModuleHeader(\n metadata: ModuleMetadata,\n enumerable: boolean = false,\n) {\n return (enumerable\n ? template.statement`\n EXPORTS.__esModule = true;\n `\n : template.statement`\n Object.defineProperty(EXPORTS, \"__esModule\", {\n value: true,\n });\n `)({ EXPORTS: metadata.exportName });\n}\n\n/**\n * Create a re-export initialization loop for a specific imported namespace.\n */\nfunction buildNamespaceReexport(metadata, namespace, loose) {\n return (loose\n ? template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n\n EXPORTS[key] = NAMESPACE[key];\n });\n `\n : template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n\n Object.defineProperty(EXPORTS, key, {\n enumerable: true,\n get: function() {\n return NAMESPACE[key];\n },\n });\n });\n `)({\n NAMESPACE: namespace,\n EXPORTS: metadata.exportName,\n VERIFY_NAME_LIST: metadata.exportNameListName\n ? template`\n if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;\n `({ EXPORTS_LIST: metadata.exportNameListName })\n : null,\n });\n}\n\n/**\n * Build a statement declaring a variable that contains all of the exported\n * variable names in an object so they can easily be referenced from an\n * export * from statement to check for conflicts.\n */\nfunction buildExportNameListDeclaration(\n programPath: NodePath,\n metadata: ModuleMetadata,\n) {\n const exportedVars = Object.create(null);\n for (const data of metadata.local.values()) {\n for (const name of data.names) {\n exportedVars[name] = true;\n }\n }\n\n let hasReexport = false;\n for (const data of metadata.source.values()) {\n for (const exportName of data.reexports.keys()) {\n exportedVars[exportName] = true;\n }\n for (const exportName of data.reexportNamespace) {\n exportedVars[exportName] = true;\n }\n\n hasReexport = hasReexport || data.reexportAll;\n }\n\n if (!hasReexport || Object.keys(exportedVars).length === 0) return null;\n\n const name = programPath.scope.generateUidIdentifier(\"exportNames\");\n\n delete exportedVars.default;\n\n return {\n name: name.name,\n statement: t.variableDeclaration(\"var\", [\n t.variableDeclarator(name, t.valueToNode(exportedVars)),\n ]),\n };\n}\n\n/**\n * Create a set of statements that will initialize all of the statically-known\n * export names with their expected values.\n */\nfunction buildExportInitializationStatements(\n programPath: NodePath,\n metadata: ModuleMetadata,\n loose: boolean = false,\n) {\n const initStatements = [];\n\n const exportNames = [];\n for (const [localName, data] of metadata.local) {\n if (data.kind === \"import\") {\n // No-open since these are explicitly set with the \"reexports\" block.\n } else if (data.kind === \"hoisted\") {\n initStatements.push(\n buildInitStatement(metadata, data.names, t.identifier(localName)),\n );\n } else {\n exportNames.push(...data.names);\n }\n }\n\n for (const data of metadata.source.values()) {\n if (!loose) {\n initStatements.push(...buildReexportsFromMeta(metadata, data, loose));\n }\n for (const exportName of data.reexportNamespace) {\n exportNames.push(exportName);\n }\n }\n\n initStatements.push(\n ...chunk(exportNames, 100).map(members => {\n return buildInitStatement(\n metadata,\n members,\n programPath.scope.buildUndefinedNode(),\n );\n }),\n );\n\n return initStatements;\n}\n\n/**\n * Given a set of export names, create a set of nested assignments to\n * initialize them all to a given expression.\n */\nfunction buildInitStatement(metadata, exportNames, initExpr) {\n return t.expressionStatement(\n exportNames.reduce(\n (acc, exportName) =>\n template.expression`EXPORTS.NAME = VALUE`({\n EXPORTS: metadata.exportName,\n NAME: exportName,\n VALUE: acc,\n }),\n initExpr,\n ),\n );\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getImportSource = getImportSource;\nexports.createDynamicImportTransform = createDynamicImportTransform;\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction getImportSource(t, callNode) {\n var importArguments = callNode.arguments;\n\n var _importArguments = _slicedToArray(importArguments, 1),\n importPath = _importArguments[0];\n\n var isString = t.isStringLiteral(importPath) || t.isTemplateLiteral(importPath);\n\n if (isString) {\n t.removeComments(importPath);\n return importPath;\n }\n\n return t.templateLiteral([t.templateElement({\n raw: '',\n cooked: ''\n }), t.templateElement({\n raw: '',\n cooked: ''\n }, true)], importArguments);\n}\n\nfunction createDynamicImportTransform(_ref) {\n var template = _ref.template,\n t = _ref.types;\n var buildImport = template('Promise.resolve().then(() => MODULE)');\n return function (context, path) {\n var requireCall = t.callExpression(t.identifier('require'), [getImportSource(t, path.parent)]);\n var _context$opts$noInter = context.opts.noInterop,\n noInterop = _context$opts$noInter === undefined ? false : _context$opts$noInter;\n var MODULE = noInterop === true ? requireCall : t.callExpression(context.addHelper('interopRequireWildcard'), [requireCall]);\n var newImport = buildImport({\n MODULE: MODULE\n });\n path.parentPath.replaceWith(newImport);\n };\n}","// Re-export lib/utils, so that consumers can import\n// babel-plugin-dynamic-import-node/utils instead of\n// babel-plugin-dynamic-import-node/lib/utils\n\n// eslint-disable-next-line import/no-unresolved\nmodule.exports = require('./lib/utils');\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport {\n isModule,\n rewriteModuleStatementsAndPrepareHeader,\n hasExports,\n isSideEffectImport,\n buildNamespaceInitStatements,\n ensureStatementsHoisted,\n wrapInterop,\n} from \"@babel/helper-module-transforms\";\nimport { template, types as t } from \"@babel/core\";\nimport { getImportSource } from \"babel-plugin-dynamic-import-node/utils\";\n\nconst buildWrapper = template(`\n define(MODULE_NAME, AMD_ARGUMENTS, function(IMPORT_NAMES) {\n })\n`);\n\nconst buildAnonymousWrapper = template(`\n define([\"require\"], function(REQUIRE) {\n })\n`);\n\nfunction injectWrapper(path, wrapper) {\n const { body, directives } = path.node;\n path.node.directives = [];\n path.node.body = [];\n const amdWrapper = path.pushContainer(\"body\", wrapper)[0];\n const amdFactory = amdWrapper\n .get(\"expression.arguments\")\n .filter(arg => arg.isFunctionExpression())[0]\n .get(\"body\");\n amdFactory.pushContainer(\"directives\", directives);\n amdFactory.pushContainer(\"body\", body);\n}\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose, allowTopLevelThis, strict, strictMode, noInterop } = options;\n return {\n name: \"transform-modules-amd\",\n\n pre() {\n this.file.set(\"@babel/plugin-transform-modules-*\", \"amd\");\n },\n\n visitor: {\n CallExpression(path, state) {\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) return;\n if (!path.get(\"callee\").isImport()) return;\n\n let { requireId, resolveId, rejectId } = state;\n if (!requireId) {\n requireId = path.scope.generateUidIdentifier(\"require\");\n state.requireId = requireId;\n }\n if (!resolveId || !rejectId) {\n resolveId = path.scope.generateUidIdentifier(\"resolve\");\n rejectId = path.scope.generateUidIdentifier(\"reject\");\n state.resolveId = resolveId;\n state.rejectId = rejectId;\n }\n\n let result = t.identifier(\"imported\");\n if (!noInterop) result = wrapInterop(path, result, \"namespace\");\n\n path.replaceWith(\n template.expression.ast`\n new Promise((${resolveId}, ${rejectId}) =>\n ${requireId}(\n [${getImportSource(t, path.node)}],\n imported => ${resolveId}(${result}),\n ${rejectId}\n )\n )`,\n );\n },\n\n Program: {\n exit(path, { requireId }) {\n if (!isModule(path)) {\n if (requireId) {\n injectWrapper(\n path,\n buildAnonymousWrapper({ REQUIRE: requireId }),\n );\n }\n return;\n }\n\n const amdArgs = [];\n const importNames = [];\n if (requireId) {\n amdArgs.push(t.stringLiteral(\"require\"));\n importNames.push(requireId);\n }\n\n let moduleName = this.getModuleName();\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(\n path,\n {\n loose,\n strict,\n strictMode,\n allowTopLevelThis,\n noInterop,\n },\n );\n\n if (hasExports(meta)) {\n amdArgs.push(t.stringLiteral(\"exports\"));\n\n importNames.push(t.identifier(meta.exportName));\n }\n\n for (const [source, metadata] of meta.source) {\n amdArgs.push(t.stringLiteral(source));\n importNames.push(t.identifier(metadata.name));\n\n if (!isSideEffectImport(metadata)) {\n const interop = wrapInterop(\n path,\n t.identifier(metadata.name),\n metadata.interop,\n );\n if (interop) {\n const header = t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.identifier(metadata.name),\n interop,\n ),\n );\n header.loc = metadata.loc;\n headers.push(header);\n }\n }\n\n headers.push(\n ...buildNamespaceInitStatements(meta, metadata, loose),\n );\n }\n\n ensureStatementsHoisted(headers);\n path.unshiftContainer(\"body\", headers);\n\n injectWrapper(\n path,\n buildWrapper({\n MODULE_NAME: moduleName,\n\n AMD_ARGUMENTS: t.arrayExpression(amdArgs),\n IMPORT_NAMES: importNames,\n }),\n );\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport {\n isModule,\n rewriteModuleStatementsAndPrepareHeader,\n isSideEffectImport,\n buildNamespaceInitStatements,\n ensureStatementsHoisted,\n wrapInterop,\n} from \"@babel/helper-module-transforms\";\nimport simplifyAccess from \"@babel/helper-simple-access\";\nimport { template, types as t } from \"@babel/core\";\n\nimport { createDynamicImportTransform } from \"babel-plugin-dynamic-import-node/utils\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const transformImportCall = createDynamicImportTransform(api);\n\n const {\n loose,\n\n // 'true' for non-mjs files to strictly have .default, instead of having\n // destructuring-like behavior for their properties.\n strictNamespace = false,\n\n // 'true' for mjs files to strictly have .default, instead of having\n // destructuring-like behavior for their properties.\n mjsStrictNamespace = true,\n allowTopLevelThis,\n strict,\n strictMode,\n noInterop,\n lazy = false,\n // Defaulting to 'true' for now. May change before 7.x major.\n allowCommonJSExports = true,\n } = options;\n\n if (\n typeof lazy !== \"boolean\" &&\n typeof lazy !== \"function\" &&\n (!Array.isArray(lazy) || !lazy.every(item => typeof item === \"string\"))\n ) {\n throw new Error(`.lazy must be a boolean, array of strings, or a function`);\n }\n\n if (typeof strictNamespace !== \"boolean\") {\n throw new Error(`.strictNamespace must be a boolean, or undefined`);\n }\n if (typeof mjsStrictNamespace !== \"boolean\") {\n throw new Error(`.mjsStrictNamespace must be a boolean, or undefined`);\n }\n\n const getAssertion = localName => template.expression.ast`\n (function(){\n throw new Error(\n \"The CommonJS '\" + \"${localName}\" + \"' variable is not available in ES6 modules.\" +\n \"Consider setting setting sourceType:script or sourceType:unambiguous in your \" +\n \"Babel config for this file.\");\n })()\n `;\n\n const moduleExportsVisitor = {\n ReferencedIdentifier(path) {\n const localName = path.node.name;\n if (localName !== \"module\" && localName !== \"exports\") return;\n\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = this.scope.getBinding(localName);\n\n if (\n // redeclared in this scope\n rootBinding !== localBinding ||\n (path.parentPath.isObjectProperty({ value: path.node }) &&\n path.parentPath.parentPath.isObjectPattern()) ||\n path.parentPath.isAssignmentExpression({ left: path.node }) ||\n path.isAssignmentExpression({ left: path.node })\n ) {\n return;\n }\n\n path.replaceWith(getAssertion(localName));\n },\n\n AssignmentExpression(path) {\n const left = path.get(\"left\");\n if (left.isIdentifier()) {\n const localName = path.node.name;\n if (localName !== \"module\" && localName !== \"exports\") return;\n\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = this.scope.getBinding(localName);\n\n // redeclared in this scope\n if (rootBinding !== localBinding) return;\n\n const right = path.get(\"right\");\n right.replaceWith(\n t.sequenceExpression([right.node, getAssertion(localName)]),\n );\n } else if (left.isPattern()) {\n const ids = left.getOuterBindingIdentifiers();\n const localName = Object.keys(ids).filter(localName => {\n if (localName !== \"module\" && localName !== \"exports\") return false;\n\n return (\n this.scope.getBinding(localName) ===\n path.scope.getBinding(localName)\n );\n })[0];\n\n if (localName) {\n const right = path.get(\"right\");\n right.replaceWith(\n t.sequenceExpression([right.node, getAssertion(localName)]),\n );\n }\n }\n },\n };\n\n return {\n name: \"transform-modules-commonjs\",\n\n pre() {\n this.file.set(\"@babel/plugin-transform-modules-*\", \"commonjs\");\n },\n\n visitor: {\n CallExpression(path) {\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) return;\n if (!path.get(\"callee\").isImport()) return;\n\n let { scope } = path;\n do {\n scope.rename(\"require\");\n } while ((scope = scope.parent));\n\n transformImportCall(this, path.get(\"callee\"));\n },\n\n Program: {\n exit(path, state) {\n if (!isModule(path)) return;\n\n // Rename the bindings auto-injected into the scope so there is no\n // risk of conflict between the bindings.\n path.scope.rename(\"exports\");\n path.scope.rename(\"module\");\n path.scope.rename(\"require\");\n path.scope.rename(\"__filename\");\n path.scope.rename(\"__dirname\");\n\n // Rewrite references to 'module' and 'exports' to throw exceptions.\n // These objects are specific to CommonJS and are not available in\n // real ES6 implementations.\n if (!allowCommonJSExports) {\n simplifyAccess(path, new Set([\"module\", \"exports\"]));\n path.traverse(moduleExportsVisitor, {\n scope: path.scope,\n });\n }\n\n let moduleName = this.getModuleName();\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(\n path,\n {\n exportName: \"exports\",\n loose,\n strict,\n strictMode,\n allowTopLevelThis,\n noInterop,\n lazy,\n esNamespaceOnly:\n typeof state.filename === \"string\" &&\n /\\.mjs$/.test(state.filename)\n ? mjsStrictNamespace\n : strictNamespace,\n },\n );\n\n for (const [source, metadata] of meta.source) {\n const loadExpr = t.callExpression(t.identifier(\"require\"), [\n t.stringLiteral(source),\n ]);\n\n let header;\n if (isSideEffectImport(metadata)) {\n if (metadata.lazy) throw new Error(\"Assertion failure\");\n\n header = t.expressionStatement(loadExpr);\n } else {\n const init =\n wrapInterop(path, loadExpr, metadata.interop) || loadExpr;\n\n if (metadata.lazy) {\n header = template.ast`\n function ${metadata.name}() {\n const data = ${init};\n ${metadata.name} = function(){ return data; };\n return data;\n }\n `;\n } else {\n header = template.ast`\n var ${metadata.name} = ${init};\n `;\n }\n }\n header.loc = metadata.loc;\n\n headers.push(header);\n headers.push(\n ...buildNamespaceInitStatements(meta, metadata, loose),\n );\n }\n\n ensureStatementsHoisted(headers);\n path.unshiftContainer(\"body\", headers);\n },\n },\n },\n };\n});\n","import * as t from \"@babel/types\";\n\nconst visitor = {\n Scope(path, state) {\n if (state.kind === \"let\") path.skip();\n },\n\n Function(path) {\n path.skip();\n },\n\n VariableDeclaration(path, state) {\n if (state.kind && path.node.kind !== state.kind) return;\n\n const nodes = [];\n\n const declarations: Array = path.get(\"declarations\");\n let firstId;\n\n for (const declar of declarations) {\n firstId = declar.node.id;\n\n if (declar.node.init) {\n nodes.push(\n t.expressionStatement(\n t.assignmentExpression(\"=\", declar.node.id, declar.node.init),\n ),\n );\n }\n\n for (const name of Object.keys(declar.getBindingIdentifiers())) {\n state.emit(t.identifier(name), name, declar.node.init !== null);\n }\n }\n\n // for (var i in test)\n if (path.parentPath.isFor({ left: path.node })) {\n path.replaceWith(firstId);\n } else {\n path.replaceWithMultiple(nodes);\n }\n },\n};\n\nexport default function(path, emit: Function, kind: \"var\" | \"let\" = \"var\") {\n path.traverse(visitor, { kind, emit });\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport hoistVariables from \"@babel/helper-hoist-variables\";\nimport { template, types as t } from \"@babel/core\";\nimport { getImportSource } from \"babel-plugin-dynamic-import-node/utils\";\nimport { rewriteThis } from \"@babel/helper-module-transforms\";\n\nconst buildTemplate = template(`\n SYSTEM_REGISTER(MODULE_NAME, SOURCES, function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n \"use strict\";\n BEFORE_BODY;\n return {\n setters: SETTERS,\n execute: function () {\n BODY;\n }\n };\n });\n`);\n\nconst buildExportAll = template(`\n for (var KEY in TARGET) {\n if (KEY !== \"default\" && KEY !== \"__esModule\") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n`);\n\nconst MISSING_PLUGIN_WARNING = `\\\nWARNING: Dynamic import() transformation must be enabled using the\n @babel/plugin-proposal-dynamic-import plugin. Babel 8 will\n no longer transform import() without using that plugin.\n`;\n\nfunction constructExportCall(\n path,\n exportIdent,\n exportNames,\n exportValues,\n exportStarTarget,\n) {\n const statements = [];\n if (exportNames.length === 1) {\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [\n t.stringLiteral(exportNames[0]),\n exportValues[0],\n ]),\n ),\n );\n } else if (!exportStarTarget) {\n const objectProperties = [];\n for (let i = 0; i < exportNames.length; i++) {\n const exportName = exportNames[i];\n const exportValue = exportValues[i];\n objectProperties.push(\n t.objectProperty(t.identifier(exportName), exportValue),\n );\n }\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [t.objectExpression(objectProperties)]),\n ),\n );\n } else {\n const exportObj = path.scope.generateUid(\"exportObj\");\n\n statements.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(exportObj), t.objectExpression([])),\n ]),\n );\n\n statements.push(\n buildExportAll({\n KEY: path.scope.generateUidIdentifier(\"key\"),\n EXPORT_OBJ: t.identifier(exportObj),\n TARGET: exportStarTarget,\n }),\n );\n\n for (let i = 0; i < exportNames.length; i++) {\n const exportName = exportNames[i];\n const exportValue = exportValues[i];\n\n statements.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.identifier(exportObj),\n t.identifier(exportName),\n ),\n exportValue,\n ),\n ),\n );\n }\n\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [t.identifier(exportObj)]),\n ),\n );\n }\n return statements;\n}\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { systemGlobal = \"System\", allowTopLevelThis = false } = options;\n const IGNORE_REASSIGNMENT_SYMBOL = Symbol();\n\n const reassignmentVisitor = {\n \"AssignmentExpression|UpdateExpression\"(path) {\n if (path.node[IGNORE_REASSIGNMENT_SYMBOL]) return;\n path.node[IGNORE_REASSIGNMENT_SYMBOL] = true;\n\n const arg = path.get(path.isAssignmentExpression() ? \"left\" : \"argument\");\n\n if (arg.isObjectPattern() || arg.isArrayPattern()) {\n const exprs = [path.node];\n for (const name of Object.keys(arg.getBindingIdentifiers())) {\n if (this.scope.getBinding(name) !== path.scope.getBinding(name)) {\n return;\n }\n const exportedNames = this.exports[name];\n if (!exportedNames) return;\n for (const exportedName of exportedNames) {\n exprs.push(\n this.buildCall(exportedName, t.identifier(name)).expression,\n );\n }\n }\n path.replaceWith(t.sequenceExpression(exprs));\n return;\n }\n\n if (!arg.isIdentifier()) return;\n\n const name = arg.node.name;\n\n // redeclared in this scope\n if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;\n\n const exportedNames = this.exports[name];\n if (!exportedNames) return;\n\n let node = path.node;\n\n // if it is a non-prefix update expression (x++ etc)\n // then we must replace with the expression (_export('x', x + 1), x++)\n // in order to ensure the same update expression value\n const isPostUpdateExpression = path.isUpdateExpression({ prefix: false });\n if (isPostUpdateExpression) {\n node = t.binaryExpression(\n node.operator[0],\n t.unaryExpression(\"+\", t.cloneNode(node.argument)),\n t.numericLiteral(1),\n );\n }\n\n for (const exportedName of exportedNames) {\n node = this.buildCall(exportedName, node).expression;\n }\n\n if (isPostUpdateExpression) {\n node = t.sequenceExpression([node, path.node]);\n }\n\n path.replaceWith(node);\n },\n };\n\n return {\n name: \"transform-modules-systemjs\",\n\n pre() {\n this.file.set(\"@babel/plugin-transform-modules-*\", \"systemjs\");\n },\n\n visitor: {\n CallExpression(path, state) {\n if (t.isImport(path.node.callee)) {\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) {\n console.warn(MISSING_PLUGIN_WARNING);\n }\n\n path.replaceWith(\n t.callExpression(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"import\"),\n ),\n [getImportSource(t, path.node)],\n ),\n );\n }\n },\n\n MetaProperty(path, state) {\n if (\n path.node.meta.name === \"import\" &&\n path.node.property.name === \"meta\"\n ) {\n path.replaceWith(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"meta\"),\n ),\n );\n }\n },\n\n ReferencedIdentifier(path, state) {\n if (\n path.node.name === \"__moduleName\" &&\n !path.scope.hasBinding(\"__moduleName\")\n ) {\n path.replaceWith(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"id\"),\n ),\n );\n }\n },\n\n Program: {\n enter(path, state) {\n state.contextIdent = path.scope.generateUid(\"context\");\n if (!allowTopLevelThis) {\n rewriteThis(path);\n }\n },\n exit(path, state) {\n const undefinedIdent = path.scope.buildUndefinedNode();\n const exportIdent = path.scope.generateUid(\"export\");\n const contextIdent = state.contextIdent;\n\n const exportMap = Object.create(null);\n const modules = [];\n\n let beforeBody = [];\n const setters = [];\n const sources = [];\n const variableIds = [];\n const removedPaths = [];\n\n function addExportName(key, val) {\n exportMap[key] = exportMap[key] || [];\n exportMap[key].push(val);\n }\n\n function pushModule(source, key, specifiers) {\n let module;\n modules.forEach(function(m) {\n if (m.key === source) {\n module = m;\n }\n });\n if (!module) {\n modules.push(\n (module = { key: source, imports: [], exports: [] }),\n );\n }\n module[key] = module[key].concat(specifiers);\n }\n\n function buildExportCall(name, val) {\n return t.expressionStatement(\n t.callExpression(t.identifier(exportIdent), [\n t.stringLiteral(name),\n val,\n ]),\n );\n }\n\n const exportNames = [];\n const exportValues = [];\n\n const body: Array = path.get(\"body\");\n\n for (const path of body) {\n if (path.isFunctionDeclaration()) {\n beforeBody.push(path.node);\n removedPaths.push(path);\n } else if (path.isClassDeclaration()) {\n variableIds.push(path.node.id);\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(path.node.id),\n t.toExpression(path.node),\n ),\n ),\n );\n } else if (path.isImportDeclaration()) {\n const source = path.node.source.value;\n pushModule(source, \"imports\", path.node.specifiers);\n for (const name of Object.keys(path.getBindingIdentifiers())) {\n path.scope.removeBinding(name);\n variableIds.push(t.identifier(name));\n }\n path.remove();\n } else if (path.isExportAllDeclaration()) {\n pushModule(path.node.source.value, \"exports\", path.node);\n path.remove();\n } else if (path.isExportDefaultDeclaration()) {\n const declar = path.get(\"declaration\");\n const id = declar.node.id;\n if (declar.isClassDeclaration()) {\n if (id) {\n exportNames.push(\"default\");\n exportValues.push(undefinedIdent);\n variableIds.push(id);\n addExportName(id.name, \"default\");\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(id),\n t.toExpression(declar.node),\n ),\n ),\n );\n } else {\n exportNames.push(\"default\");\n exportValues.push(t.toExpression(declar.node));\n removedPaths.push(path);\n }\n } else if (declar.isFunctionDeclaration()) {\n if (id) {\n beforeBody.push(declar.node);\n exportNames.push(\"default\");\n exportValues.push(t.cloneNode(id));\n addExportName(id.name, \"default\");\n } else {\n exportNames.push(\"default\");\n exportValues.push(t.toExpression(declar.node));\n }\n removedPaths.push(path);\n } else {\n path.replaceWith(buildExportCall(\"default\", declar.node));\n }\n } else if (path.isExportNamedDeclaration()) {\n const declar = path.get(\"declaration\");\n\n if (declar.node) {\n path.replaceWith(declar);\n\n if (path.isFunction()) {\n const node = declar.node;\n const name = node.id.name;\n addExportName(name, name);\n beforeBody.push(node);\n exportNames.push(name);\n exportValues.push(t.cloneNode(node.id));\n removedPaths.push(path);\n } else if (path.isClass()) {\n const name = declar.node.id.name;\n exportNames.push(name);\n exportValues.push(undefinedIdent);\n variableIds.push(declar.node.id);\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(declar.node.id),\n t.toExpression(declar.node),\n ),\n ),\n );\n addExportName(name, name);\n } else {\n for (const name of Object.keys(\n declar.getBindingIdentifiers(),\n )) {\n addExportName(name, name);\n }\n }\n } else {\n const specifiers = path.node.specifiers;\n if (specifiers && specifiers.length) {\n if (path.node.source) {\n pushModule(path.node.source.value, \"exports\", specifiers);\n path.remove();\n } else {\n const nodes = [];\n\n for (const specifier of specifiers) {\n const binding = path.scope.getBinding(\n specifier.local.name,\n );\n // hoisted function export\n if (\n binding &&\n t.isFunctionDeclaration(binding.path.node)\n ) {\n exportNames.push(specifier.exported.name);\n exportValues.push(t.cloneNode(specifier.local));\n }\n // only globals also exported this way\n else if (!binding) {\n nodes.push(\n buildExportCall(\n specifier.exported.name,\n specifier.local,\n ),\n );\n }\n addExportName(\n specifier.local.name,\n specifier.exported.name,\n );\n }\n\n path.replaceWithMultiple(nodes);\n }\n } else {\n path.remove();\n }\n }\n }\n }\n\n modules.forEach(function(specifiers) {\n let setterBody = [];\n const target = path.scope.generateUid(specifiers.key);\n\n for (let specifier of specifiers.imports) {\n if (t.isImportNamespaceSpecifier(specifier)) {\n setterBody.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n specifier.local,\n t.identifier(target),\n ),\n ),\n );\n } else if (t.isImportDefaultSpecifier(specifier)) {\n specifier = t.importSpecifier(\n specifier.local,\n t.identifier(\"default\"),\n );\n }\n\n if (t.isImportSpecifier(specifier)) {\n setterBody.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n specifier.local,\n t.memberExpression(\n t.identifier(target),\n specifier.imported,\n ),\n ),\n ),\n );\n }\n }\n\n if (specifiers.exports.length) {\n const exportNames = [];\n const exportValues = [];\n let hasExportStar = false;\n\n for (const node of specifiers.exports) {\n if (t.isExportAllDeclaration(node)) {\n hasExportStar = true;\n } else if (t.isExportSpecifier(node)) {\n exportNames.push(node.exported.name);\n exportValues.push(\n t.memberExpression(t.identifier(target), node.local),\n );\n } else {\n // todo\n }\n }\n\n setterBody = setterBody.concat(\n constructExportCall(\n path,\n t.identifier(exportIdent),\n exportNames,\n exportValues,\n hasExportStar ? t.identifier(target) : null,\n ),\n );\n }\n\n sources.push(t.stringLiteral(specifiers.key));\n setters.push(\n t.functionExpression(\n null,\n [t.identifier(target)],\n t.blockStatement(setterBody),\n ),\n );\n });\n\n let moduleName = this.getModuleName();\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n hoistVariables(\n path,\n (id, name, hasInit) => {\n variableIds.push(id);\n if (!hasInit) {\n exportNames.push(name);\n exportValues.push(undefinedIdent);\n }\n },\n null,\n );\n\n if (variableIds.length) {\n beforeBody.unshift(\n t.variableDeclaration(\n \"var\",\n variableIds.map(id => t.variableDeclarator(id)),\n ),\n );\n }\n\n if (exportNames.length) {\n beforeBody = beforeBody.concat(\n constructExportCall(\n path,\n t.identifier(exportIdent),\n exportNames,\n exportValues,\n null,\n ),\n );\n }\n\n path.traverse(reassignmentVisitor, {\n exports: exportMap,\n buildCall: buildExportCall,\n scope: path.scope,\n });\n\n for (const path of removedPaths) {\n path.remove();\n }\n\n path.node.body = [\n buildTemplate({\n SYSTEM_REGISTER: t.memberExpression(\n t.identifier(systemGlobal),\n t.identifier(\"register\"),\n ),\n BEFORE_BODY: beforeBody,\n MODULE_NAME: moduleName,\n SETTERS: t.arrayExpression(setters),\n SOURCES: t.arrayExpression(sources),\n BODY: path.node.body,\n EXPORT_IDENTIFIER: t.identifier(exportIdent),\n CONTEXT_IDENTIFIER: t.identifier(contextIdent),\n }),\n ];\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { basename, extname } from \"path\";\nimport {\n isModule,\n rewriteModuleStatementsAndPrepareHeader,\n hasExports,\n isSideEffectImport,\n buildNamespaceInitStatements,\n ensureStatementsHoisted,\n wrapInterop,\n} from \"@babel/helper-module-transforms\";\nimport { types as t, template } from \"@babel/core\";\n\nconst buildPrerequisiteAssignment = template(`\n GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}\n`);\n// Note: we avoid comparing typeof results with \"object\" or \"symbol\" otherwise\n// they will be processed by `transform-typeof-symbol`, which in return could\n// cause typeof helper used before declaration\nconst buildWrapper = template(`\n (function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(MODULE_NAME, AMD_ARGUMENTS, factory);\n } else if (typeof exports !== \"undefined\") {\n factory(COMMONJS_ARGUMENTS);\n } else {\n var mod = { exports: {} };\n factory(BROWSER_ARGUMENTS);\n\n GLOBAL_TO_ASSIGN;\n }\n })(\n typeof globalThis !== \"undefined\" ? globalThis\n : typeof self !== \"undefined\" ? self\n : this,\n function(IMPORT_NAMES) {\n })\n`);\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const {\n globals,\n exactGlobals,\n loose,\n allowTopLevelThis,\n strict,\n strictMode,\n noInterop,\n } = options;\n\n /**\n * Build the assignment statements that initialize the UMD global.\n */\n function buildBrowserInit(\n browserGlobals,\n exactGlobals,\n filename,\n moduleName,\n ) {\n const moduleNameOrBasename = moduleName\n ? moduleName.value\n : basename(filename, extname(filename));\n let globalToAssign = t.memberExpression(\n t.identifier(\"global\"),\n t.identifier(t.toIdentifier(moduleNameOrBasename)),\n );\n let initAssignments = [];\n\n if (exactGlobals) {\n const globalName = browserGlobals[moduleNameOrBasename];\n\n if (globalName) {\n initAssignments = [];\n\n const members = globalName.split(\".\");\n globalToAssign = members.slice(1).reduce((accum, curr) => {\n initAssignments.push(\n buildPrerequisiteAssignment({\n GLOBAL_REFERENCE: t.cloneNode(accum),\n }),\n );\n return t.memberExpression(accum, t.identifier(curr));\n }, t.memberExpression(t.identifier(\"global\"), t.identifier(members[0])));\n }\n }\n\n initAssignments.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n globalToAssign,\n t.memberExpression(t.identifier(\"mod\"), t.identifier(\"exports\")),\n ),\n ),\n );\n\n return initAssignments;\n }\n\n /**\n * Build the member expression that reads from a global for a given source.\n */\n function buildBrowserArg(browserGlobals, exactGlobals, source) {\n let memberExpression;\n if (exactGlobals) {\n const globalRef = browserGlobals[source];\n if (globalRef) {\n memberExpression = globalRef\n .split(\".\")\n .reduce(\n (accum, curr) => t.memberExpression(accum, t.identifier(curr)),\n t.identifier(\"global\"),\n );\n } else {\n memberExpression = t.memberExpression(\n t.identifier(\"global\"),\n t.identifier(t.toIdentifier(source)),\n );\n }\n } else {\n const requireName = basename(source, extname(source));\n const globalName = browserGlobals[requireName] || requireName;\n memberExpression = t.memberExpression(\n t.identifier(\"global\"),\n t.identifier(t.toIdentifier(globalName)),\n );\n }\n return memberExpression;\n }\n\n return {\n name: \"transform-modules-umd\",\n\n visitor: {\n Program: {\n exit(path) {\n if (!isModule(path)) return;\n\n const browserGlobals = globals || {};\n\n let moduleName = this.getModuleName();\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(\n path,\n {\n loose,\n strict,\n strictMode,\n allowTopLevelThis,\n noInterop,\n },\n );\n\n const amdArgs = [];\n const commonjsArgs = [];\n const browserArgs = [];\n const importNames = [];\n\n if (hasExports(meta)) {\n amdArgs.push(t.stringLiteral(\"exports\"));\n commonjsArgs.push(t.identifier(\"exports\"));\n browserArgs.push(\n t.memberExpression(t.identifier(\"mod\"), t.identifier(\"exports\")),\n );\n importNames.push(t.identifier(meta.exportName));\n }\n\n for (const [source, metadata] of meta.source) {\n amdArgs.push(t.stringLiteral(source));\n commonjsArgs.push(\n t.callExpression(t.identifier(\"require\"), [\n t.stringLiteral(source),\n ]),\n );\n browserArgs.push(\n buildBrowserArg(browserGlobals, exactGlobals, source),\n );\n importNames.push(t.identifier(metadata.name));\n\n if (!isSideEffectImport(metadata)) {\n const interop = wrapInterop(\n path,\n t.identifier(metadata.name),\n metadata.interop,\n );\n if (interop) {\n const header = t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.identifier(metadata.name),\n interop,\n ),\n );\n header.loc = meta.loc;\n headers.push(header);\n }\n }\n\n headers.push(\n ...buildNamespaceInitStatements(meta, metadata, loose),\n );\n }\n\n ensureStatementsHoisted(headers);\n path.unshiftContainer(\"body\", headers);\n\n const { body, directives } = path.node;\n path.node.directives = [];\n path.node.body = [];\n const umdWrapper = path.pushContainer(\"body\", [\n buildWrapper({\n MODULE_NAME: moduleName,\n\n AMD_ARGUMENTS: t.arrayExpression(amdArgs),\n COMMONJS_ARGUMENTS: commonjsArgs,\n BROWSER_ARGUMENTS: browserArgs,\n IMPORT_NAMES: importNames,\n\n GLOBAL_TO_ASSIGN: buildBrowserInit(\n browserGlobals,\n exactGlobals,\n this.filename || \"unknown\",\n moduleName,\n ),\n }),\n ])[0];\n const umdFactory = umdWrapper\n .get(\"expression.arguments\")[1]\n .get(\"body\");\n umdFactory.pushContainer(\"directives\", directives);\n umdFactory.pushContainer(\"body\", body);\n },\n },\n },\n };\n});\n","/* eslint-disable @babel/development/plugin-name */\nimport { createRegExpFeaturePlugin } from \"@babel/helper-create-regexp-features-plugin\";\n\nexport default function(core, options) {\n const { runtime = true } = options;\n if (typeof runtime !== \"boolean\") {\n throw new Error(\"The 'runtime' option must be boolean\");\n }\n\n return createRegExpFeaturePlugin({\n name: \"transform-named-capturing-groups-regex\",\n feature: \"namedCaptureGroups\",\n options: { runtime },\n });\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-new-target\",\n\n visitor: {\n MetaProperty(path) {\n const meta = path.get(\"meta\");\n const property = path.get(\"property\");\n const { scope } = path;\n\n if (\n meta.isIdentifier({ name: \"new\" }) &&\n property.isIdentifier({ name: \"target\" })\n ) {\n const func = path.findParent(path => {\n if (path.isClass()) return true;\n if (path.isFunction() && !path.isArrowFunctionExpression()) {\n if (path.isClassMethod({ kind: \"constructor\" })) {\n return false;\n }\n\n return true;\n }\n return false;\n });\n\n if (!func) {\n throw path.buildCodeFrameError(\n \"new.target must be under a (non-arrow) function or a class.\",\n );\n }\n\n const { node } = func;\n if (!node.id) {\n if (func.isMethod()) {\n path.replaceWith(scope.buildUndefinedNode());\n return;\n }\n\n node.id = scope.generateUidIdentifier(\"target\");\n }\n\n const constructor = t.memberExpression(\n t.thisExpression(),\n t.identifier(\"constructor\"),\n );\n\n if (func.isClass()) {\n path.replaceWith(constructor);\n return;\n }\n\n path.replaceWith(\n t.conditionalExpression(\n t.binaryExpression(\n \"instanceof\",\n t.thisExpression(),\n t.cloneNode(node.id),\n ),\n constructor,\n scope.buildUndefinedNode(),\n ),\n );\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-object-assign\",\n\n visitor: {\n CallExpression: function(path, file) {\n if (path.get(\"callee\").matchesPattern(\"Object.assign\")) {\n path.node.callee = file.addHelper(\"extends\");\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport { types as t } from \"@babel/core\";\n\nfunction replacePropertySuper(path, getObjectRef, file) {\n const replaceSupers = new ReplaceSupers({\n getObjectRef: getObjectRef,\n methodPath: path,\n file: file,\n });\n\n replaceSupers.replace();\n}\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-object-super\",\n\n visitor: {\n ObjectExpression(path, state) {\n let objectRef;\n const getObjectRef = () =>\n (objectRef = objectRef || path.scope.generateUidIdentifier(\"obj\"));\n\n path.get(\"properties\").forEach(propPath => {\n if (!propPath.isMethod()) return;\n\n replacePropertySuper(propPath, getObjectRef, state);\n });\n\n if (objectRef) {\n path.scope.push({ id: t.cloneNode(objectRef) });\n path.replaceWith(\n t.assignmentExpression(\"=\", t.cloneNode(objectRef), path.node),\n );\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-object-set-prototype-of-to-assign\",\n\n visitor: {\n CallExpression(path, file) {\n if (path.get(\"callee\").matchesPattern(\"Object.setPrototypeOf\")) {\n path.node.callee = file.addHelper(\"defaults\");\n }\n },\n },\n };\n});\n","import hoistVariables from \"@babel/helper-hoist-variables\";\nimport type { NodePath } from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\n\nconst visitor = {\n enter(path, state) {\n if (path.isThisExpression()) {\n state.foundThis = true;\n }\n\n if (path.isReferencedIdentifier({ name: \"arguments\" })) {\n state.foundArguments = true;\n }\n },\n\n Function(path) {\n path.skip();\n },\n};\n\nexport default function(path: NodePath, scope = path.scope) {\n const { node } = path;\n const container = t.functionExpression(\n null,\n [],\n node.body,\n node.generator,\n node.async,\n );\n\n let callee = container;\n let args = [];\n\n // todo: only hoist if necessary\n hoistVariables(path, id => scope.push({ id }));\n\n const state = {\n foundThis: false,\n foundArguments: false,\n };\n\n path.traverse(visitor, state);\n\n if (state.foundArguments || state.foundThis) {\n callee = t.memberExpression(container, t.identifier(\"apply\"));\n args = [];\n\n if (state.foundThis) {\n args.push(t.thisExpression());\n }\n\n if (state.foundArguments) {\n if (!state.foundThis) args.push(t.nullLiteral());\n args.push(t.identifier(\"arguments\"));\n }\n }\n\n let call = t.callExpression(callee, args);\n if (node.generator) call = t.yieldExpression(call, true);\n\n return t.returnStatement(call);\n}\n","import callDelegate from \"@babel/helper-call-delegate\";\nimport { template, types as t } from \"@babel/core\";\n\nconst buildDefaultParam = template(`\n let VARIABLE_NAME =\n arguments.length > ARGUMENT_KEY && arguments[ARGUMENT_KEY] !== undefined ?\n arguments[ARGUMENT_KEY]\n :\n DEFAULT_VALUE;\n`);\n\nconst buildLooseDefaultParam = template(`\n if (ASSIGNMENT_IDENTIFIER === UNDEFINED) {\n ASSIGNMENT_IDENTIFIER = DEFAULT_VALUE;\n }\n`);\n\nconst buildLooseDestructuredDefaultParam = template(`\n let ASSIGNMENT_IDENTIFIER = PARAMETER_NAME === UNDEFINED ? DEFAULT_VALUE : PARAMETER_NAME ;\n`);\n\nconst buildSafeArgumentsAccess = template(`\n let $0 = arguments.length > $1 ? arguments[$1] : undefined;\n`);\n\nfunction isSafeBinding(scope, node) {\n if (!scope.hasOwnBinding(node.name)) return true;\n const { kind } = scope.getOwnBinding(node.name);\n return kind === \"param\" || kind === \"local\";\n}\n\nconst iifeVisitor = {\n ReferencedIdentifier(path, state) {\n const { scope, node } = path;\n if (\n node.name === \"eval\" ||\n !isSafeBinding(scope, node) ||\n !isSafeBinding(state.scope, node)\n ) {\n state.iife = true;\n path.stop();\n }\n },\n\n Scope(path) {\n // different bindings\n path.skip();\n },\n};\n\nexport default function convertFunctionParams(path, loose) {\n const { node, scope } = path;\n\n const state = {\n iife: false,\n scope: scope,\n };\n\n const body = [];\n const params = path.get(\"params\");\n\n let firstOptionalIndex = null;\n\n for (let i = 0; i < params.length; i++) {\n const param = params[i];\n\n const paramIsAssignmentPattern = param.isAssignmentPattern();\n if (paramIsAssignmentPattern && (loose || node.kind === \"set\")) {\n const left = param.get(\"left\");\n const right = param.get(\"right\");\n\n const undefinedNode = scope.buildUndefinedNode();\n\n if (left.isIdentifier()) {\n body.push(\n buildLooseDefaultParam({\n ASSIGNMENT_IDENTIFIER: t.cloneNode(left.node),\n DEFAULT_VALUE: right.node,\n UNDEFINED: undefinedNode,\n }),\n );\n param.replaceWith(left.node);\n } else if (left.isObjectPattern() || left.isArrayPattern()) {\n const paramName = scope.generateUidIdentifier();\n body.push(\n buildLooseDestructuredDefaultParam({\n ASSIGNMENT_IDENTIFIER: left.node,\n DEFAULT_VALUE: right.node,\n PARAMETER_NAME: t.cloneNode(paramName),\n UNDEFINED: undefinedNode,\n }),\n );\n param.replaceWith(paramName);\n }\n } else if (paramIsAssignmentPattern) {\n if (firstOptionalIndex === null) firstOptionalIndex = i;\n\n const left = param.get(\"left\");\n const right = param.get(\"right\");\n\n if (!state.iife) {\n if (right.isIdentifier() && !isSafeBinding(scope, right.node)) {\n // the right hand side references a parameter\n state.iife = true;\n } else {\n right.traverse(iifeVisitor, state);\n }\n }\n\n const defNode = buildDefaultParam({\n VARIABLE_NAME: left.node,\n DEFAULT_VALUE: right.node,\n ARGUMENT_KEY: t.numericLiteral(i),\n });\n body.push(defNode);\n } else if (firstOptionalIndex !== null) {\n const defNode = buildSafeArgumentsAccess([\n param.node,\n t.numericLiteral(i),\n ]);\n body.push(defNode);\n } else if (param.isObjectPattern() || param.isArrayPattern()) {\n const uid = path.scope.generateUidIdentifier(\"ref\");\n\n const defNode = t.variableDeclaration(\"let\", [\n t.variableDeclarator(param.node, uid),\n ]);\n body.push(defNode);\n\n param.replaceWith(t.cloneNode(uid));\n }\n\n if (!state.iife && !param.isIdentifier()) {\n param.traverse(iifeVisitor, state);\n }\n }\n\n if (body.length === 0) return false;\n\n // we need to cut off all trailing parameters\n if (firstOptionalIndex !== null) {\n node.params = node.params.slice(0, firstOptionalIndex);\n }\n\n // ensure it's a block, useful for arrow functions\n path.ensureBlock();\n\n if (state.iife) {\n body.push(callDelegate(path, scope));\n path.set(\"body\", t.blockStatement(body));\n } else {\n path.get(\"body\").unshiftContainer(\"body\", body);\n }\n\n return true;\n}\n","import { template, types as t } from \"@babel/core\";\n\nconst buildRest = template(`\n for (var LEN = ARGUMENTS.length,\n ARRAY = new Array(ARRAY_LEN),\n KEY = START;\n KEY < LEN;\n KEY++) {\n ARRAY[ARRAY_KEY] = ARGUMENTS[KEY];\n }\n`);\n\nconst restIndex = template(`\n (INDEX < OFFSET || ARGUMENTS.length <= INDEX) ? undefined : ARGUMENTS[INDEX]\n`);\n\nconst restIndexImpure = template(`\n REF = INDEX, (REF < OFFSET || ARGUMENTS.length <= REF) ? undefined : ARGUMENTS[REF]\n`);\n\nconst restLength = template(`\n ARGUMENTS.length <= OFFSET ? 0 : ARGUMENTS.length - OFFSET\n`);\n\nfunction referencesRest(path, state) {\n if (path.node.name === state.name) {\n // Check rest parameter is not shadowed by a binding in another scope.\n return path.scope.bindingIdentifierEquals(state.name, state.outerBinding);\n }\n\n return false;\n}\n\nconst memberExpressionOptimisationVisitor = {\n Scope(path, state) {\n // check if this scope has a local binding that will shadow the rest parameter\n if (!path.scope.bindingIdentifierEquals(state.name, state.outerBinding)) {\n path.skip();\n }\n },\n\n Flow(path) {\n // Do not skip TypeCastExpressions as the contain valid non flow code\n if (path.isTypeCastExpression()) return;\n // don't touch reference in type annotations\n path.skip();\n },\n\n Function(path, state) {\n // Detect whether any reference to rest is contained in nested functions to\n // determine if deopt is necessary.\n const oldNoOptimise = state.noOptimise;\n state.noOptimise = true;\n path.traverse(memberExpressionOptimisationVisitor, state);\n state.noOptimise = oldNoOptimise;\n\n // Skip because optimizing references to rest would refer to the `arguments`\n // of the nested function.\n path.skip();\n },\n\n ReferencedIdentifier(path, state) {\n const { node } = path;\n\n // we can't guarantee the purity of arguments\n if (node.name === \"arguments\") {\n state.deopted = true;\n }\n\n // is this a referenced identifier and is it referencing the rest parameter?\n if (!referencesRest(path, state)) return;\n\n if (state.noOptimise) {\n state.deopted = true;\n } else {\n const { parentPath } = path;\n\n // Is this identifier the right hand side of a default parameter?\n if (parentPath.listKey === \"params\" && parentPath.key < state.offset) {\n return;\n }\n\n // ex: `args[0]`\n // ex: `args.whatever`\n if (parentPath.isMemberExpression({ object: node })) {\n const grandparentPath = parentPath.parentPath;\n\n const argsOptEligible =\n !state.deopted &&\n !(\n // ex: `args[0] = \"whatever\"`\n (\n (grandparentPath.isAssignmentExpression() &&\n parentPath.node === grandparentPath.node.left) ||\n // ex: `[args[0]] = [\"whatever\"]`\n grandparentPath.isLVal() ||\n // ex: `for (rest[0] in this)`\n // ex: `for (rest[0] of this)`\n grandparentPath.isForXStatement() ||\n // ex: `++args[0]`\n // ex: `args[0]--`\n grandparentPath.isUpdateExpression() ||\n // ex: `delete args[0]`\n grandparentPath.isUnaryExpression({ operator: \"delete\" }) ||\n // ex: `args[0]()`\n // ex: `new args[0]()`\n // ex: `new args[0]`\n ((grandparentPath.isCallExpression() ||\n grandparentPath.isNewExpression()) &&\n parentPath.node === grandparentPath.node.callee)\n )\n );\n\n if (argsOptEligible) {\n if (parentPath.node.computed) {\n // if we know that this member expression is referencing a number then\n // we can safely optimise it\n if (parentPath.get(\"property\").isBaseType(\"number\")) {\n state.candidates.push({ cause: \"indexGetter\", path });\n return;\n }\n } else if (parentPath.node.property.name === \"length\") {\n // args.length\n state.candidates.push({ cause: \"lengthGetter\", path });\n return;\n }\n }\n }\n\n // we can only do these optimizations if the rest variable would match\n // the arguments exactly\n // optimise single spread args in calls\n // ex: fn(...args)\n if (state.offset === 0 && parentPath.isSpreadElement()) {\n const call = parentPath.parentPath;\n if (call.isCallExpression() && call.node.arguments.length === 1) {\n state.candidates.push({ cause: \"argSpread\", path });\n return;\n }\n }\n\n state.references.push(path);\n }\n },\n\n /**\n * Deopt on use of a binding identifier with the same name as our rest param.\n *\n * See https://github.com/babel/babel/issues/2091\n */\n\n BindingIdentifier(path, state) {\n if (referencesRest(path, state)) {\n state.deopted = true;\n }\n },\n};\nfunction hasRest(node) {\n const length = node.params.length;\n return length > 0 && t.isRestElement(node.params[length - 1]);\n}\n\nfunction optimiseIndexGetter(path, argsId, offset) {\n const offsetLiteral = t.numericLiteral(offset);\n let index;\n\n if (t.isNumericLiteral(path.parent.property)) {\n index = t.numericLiteral(path.parent.property.value + offset);\n } else if (offset === 0) {\n // Avoid unnecessary '+ 0'\n index = path.parent.property;\n } else {\n index = t.binaryExpression(\n \"+\",\n path.parent.property,\n t.cloneNode(offsetLiteral),\n );\n }\n\n const { scope } = path;\n if (!scope.isPure(index)) {\n const temp = scope.generateUidIdentifierBasedOnNode(index);\n scope.push({ id: temp, kind: \"var\" });\n path.parentPath.replaceWith(\n restIndexImpure({\n ARGUMENTS: argsId,\n OFFSET: offsetLiteral,\n INDEX: index,\n REF: t.cloneNode(temp),\n }),\n );\n } else {\n const parentPath = path.parentPath;\n parentPath.replaceWith(\n restIndex({\n ARGUMENTS: argsId,\n OFFSET: offsetLiteral,\n INDEX: index,\n }),\n );\n\n // See if we can statically evaluate the first test (i.e. index < offset)\n // and optimize the AST accordingly.\n const offsetTestPath = parentPath.get(\"test\").get(\"left\");\n const valRes = offsetTestPath.evaluate();\n if (valRes.confident) {\n if (valRes.value === true) {\n parentPath.replaceWith(parentPath.scope.buildUndefinedNode());\n } else {\n parentPath.get(\"test\").replaceWith(parentPath.get(\"test\").get(\"right\"));\n }\n }\n }\n}\n\nfunction optimiseLengthGetter(path, argsId, offset) {\n if (offset) {\n path.parentPath.replaceWith(\n restLength({\n ARGUMENTS: argsId,\n OFFSET: t.numericLiteral(offset),\n }),\n );\n } else {\n path.replaceWith(argsId);\n }\n}\n\nexport default function convertFunctionRest(path) {\n const { node, scope } = path;\n if (!hasRest(node)) return false;\n\n let rest = node.params.pop().argument;\n\n const argsId = t.identifier(\"arguments\");\n\n if (t.isPattern(rest)) {\n const pattern = rest;\n rest = scope.generateUidIdentifier(\"ref\");\n\n const declar = t.variableDeclaration(\"let\", [\n t.variableDeclarator(pattern, rest),\n ]);\n node.body.body.unshift(declar);\n }\n\n // check and optimise for extremely common cases\n const state = {\n references: [],\n offset: node.params.length,\n\n argumentsNode: argsId,\n outerBinding: scope.getBindingIdentifier(rest.name),\n\n // candidate member expressions we could optimise if there are no other references\n candidates: [],\n\n // local rest binding name\n name: rest.name,\n\n /*\n It may be possible to optimize the output code in certain ways, such as\n not generating code to initialize an array (perhaps substituting direct\n references to arguments[i] or arguments.length for reads of the\n corresponding rest parameter property) or positioning the initialization\n code so that it may not have to execute depending on runtime conditions.\n\n This property tracks eligibility for optimization. \"deopted\" means give up\n and don't perform optimization. For example, when any of rest's elements /\n properties is assigned to at the top level, or referenced at all in a\n nested function.\n */\n deopted: false,\n };\n\n path.traverse(memberExpressionOptimisationVisitor, state);\n\n // There are only \"shorthand\" references\n if (!state.deopted && !state.references.length) {\n for (const { path, cause } of (state.candidates: Array)) {\n const clonedArgsId = t.cloneNode(argsId);\n switch (cause) {\n case \"indexGetter\":\n optimiseIndexGetter(path, clonedArgsId, state.offset);\n break;\n case \"lengthGetter\":\n optimiseLengthGetter(path, clonedArgsId, state.offset);\n break;\n default:\n path.replaceWith(clonedArgsId);\n }\n }\n return true;\n }\n\n state.references = state.references.concat(\n state.candidates.map(({ path }) => path),\n );\n\n const start = t.numericLiteral(node.params.length);\n const key = scope.generateUidIdentifier(\"key\");\n const len = scope.generateUidIdentifier(\"len\");\n\n let arrKey, arrLen;\n if (node.params.length) {\n // this method has additional params, so we need to subtract\n // the index of the current argument position from the\n // position in the array that we want to populate\n arrKey = t.binaryExpression(\"-\", t.cloneNode(key), t.cloneNode(start));\n\n // we need to work out the size of the array that we're\n // going to store all the rest parameters\n //\n // we need to add a check to avoid constructing the array\n // with <0 if there are less arguments than params as it'll\n // cause an error\n arrLen = t.conditionalExpression(\n t.binaryExpression(\">\", t.cloneNode(len), t.cloneNode(start)),\n t.binaryExpression(\"-\", t.cloneNode(len), t.cloneNode(start)),\n t.numericLiteral(0),\n );\n } else {\n arrKey = t.identifier(key.name);\n arrLen = t.identifier(len.name);\n }\n\n const loop = buildRest({\n ARGUMENTS: argsId,\n ARRAY_KEY: arrKey,\n ARRAY_LEN: arrLen,\n START: start,\n ARRAY: rest,\n KEY: key,\n LEN: len,\n });\n\n if (state.deopted) {\n node.body.body.unshift(loop);\n } else {\n let target = path\n .getEarliestCommonAncestorFrom(state.references)\n .getStatementParent();\n\n // don't perform the allocation inside a loop\n target.findParent(path => {\n if (path.isLoop()) {\n target = path;\n } else {\n // Stop crawling up if this is a function.\n return path.isFunction();\n }\n });\n\n target.insertBefore(loop);\n }\n\n return true;\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport convertFunctionParams from \"./params\";\nimport convertFunctionRest from \"./rest\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose } = options;\n return {\n name: \"transform-parameters\",\n\n visitor: {\n Function(path) {\n if (\n path.isArrowFunctionExpression() &&\n path\n .get(\"params\")\n .some(param => param.isRestElement() || param.isAssignmentPattern())\n ) {\n // default/rest visitors require access to `arguments`, so it cannot be an arrow\n path.arrowFunctionToExpression();\n }\n\n const convertedRest = convertFunctionRest(path);\n const convertedParams = convertFunctionParams(path, loose);\n\n if (convertedRest || convertedParams) {\n // Manually reprocess this scope to ensure that the moved params are updated.\n path.scope.crawl();\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-property-literals\",\n\n visitor: {\n ObjectProperty: {\n exit({ node }) {\n const key = node.key;\n if (\n !node.computed &&\n t.isIdentifier(key) &&\n !t.isValidES3Identifier(key.name)\n ) {\n // default: \"bar\" -> \"default\": \"bar\"\n node.key = t.stringLiteral(key.name);\n }\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport * as defineMap from \"@babel/helper-define-map\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-property-mutators\",\n\n visitor: {\n ObjectExpression(path, file) {\n const { node } = path;\n let hasAny = false;\n for (const prop of (node.properties: Array)) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n hasAny = true;\n break;\n }\n }\n if (!hasAny) return;\n\n const mutatorMap = {};\n\n node.properties = node.properties.filter(function(prop) {\n if (!prop.computed && (prop.kind === \"get\" || prop.kind === \"set\")) {\n defineMap.push(mutatorMap, prop, null, file);\n return false;\n } else {\n return true;\n }\n });\n\n path.replaceWith(\n t.callExpression(\n t.memberExpression(\n t.identifier(\"Object\"),\n t.identifier(\"defineProperties\"),\n ),\n [node, defineMap.toDefineObject(mutatorMap)],\n ),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport pull from \"lodash/pull\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function isProtoKey(node) {\n return t.isLiteral(t.toComputedKey(node, node.key), { value: \"__proto__\" });\n }\n\n function isProtoAssignmentExpression(node) {\n const left = node.left;\n return (\n t.isMemberExpression(left) &&\n t.isLiteral(t.toComputedKey(left, left.property), { value: \"__proto__\" })\n );\n }\n\n function buildDefaultsCallExpression(expr, ref, file) {\n return t.expressionStatement(\n t.callExpression(file.addHelper(\"defaults\"), [ref, expr.right]),\n );\n }\n\n return {\n name: \"transform-proto-to-assign\",\n\n visitor: {\n AssignmentExpression(path, file) {\n if (!isProtoAssignmentExpression(path.node)) return;\n\n const nodes = [];\n const left = path.node.left.object;\n const temp = path.scope.maybeGenerateMemoised(left);\n\n if (temp) {\n nodes.push(\n t.expressionStatement(t.assignmentExpression(\"=\", temp, left)),\n );\n }\n nodes.push(\n buildDefaultsCallExpression(\n path.node,\n t.cloneNode(temp || left),\n file,\n ),\n );\n if (temp) nodes.push(t.cloneNode(temp));\n\n path.replaceWithMultiple(nodes);\n },\n\n ExpressionStatement(path, file) {\n const expr = path.node.expression;\n if (!t.isAssignmentExpression(expr, { operator: \"=\" })) return;\n\n if (isProtoAssignmentExpression(expr)) {\n path.replaceWith(\n buildDefaultsCallExpression(expr, expr.left.object, file),\n );\n }\n },\n\n ObjectExpression(path, file) {\n let proto;\n const { node } = path;\n\n for (const prop of (node.properties: Array)) {\n if (isProtoKey(prop)) {\n proto = prop.value;\n pull(node.properties, prop);\n }\n }\n\n if (proto) {\n const args = [t.objectExpression([]), proto];\n if (node.properties.length) args.push(node);\n path.replaceWith(t.callExpression(file.addHelper(\"extends\"), args));\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { allowMutablePropsOnTags } = options;\n\n if (\n allowMutablePropsOnTags != null &&\n !Array.isArray(allowMutablePropsOnTags)\n ) {\n throw new Error(\n \".allowMutablePropsOnTags must be an array, null, or undefined.\",\n );\n }\n\n const HOISTED = new WeakSet();\n\n const immutabilityVisitor = {\n enter(path, state) {\n const stop = () => {\n state.isImmutable = false;\n path.stop();\n };\n\n if (path.isJSXClosingElement()) {\n path.skip();\n return;\n }\n\n // Elements with refs are not safe to hoist.\n if (\n path.isJSXIdentifier({ name: \"ref\" }) &&\n path.parentPath.isJSXAttribute({ name: path.node })\n ) {\n return stop();\n }\n\n // Ignore identifiers & JSX expressions.\n if (\n path.isJSXIdentifier() ||\n path.isIdentifier() ||\n path.isJSXMemberExpression()\n ) {\n return;\n }\n\n if (!path.isImmutable()) {\n // If it's not immutable, it may still be a pure expression, such as string concatenation.\n // It is still safe to hoist that, so long as its result is immutable.\n // If not, it is not safe to replace as mutable values (like objects) could be mutated after render.\n // https://github.com/facebook/react/issues/3226\n if (path.isPure()) {\n const expressionResult = path.evaluate();\n if (expressionResult.confident) {\n // We know the result; check its mutability.\n const { value } = expressionResult;\n const isMutable =\n (!state.mutablePropsAllowed &&\n value &&\n typeof value === \"object\") ||\n typeof value === \"function\";\n if (!isMutable) {\n // It evaluated to an immutable value, so we can hoist it.\n path.skip();\n return;\n }\n } else if (t.isIdentifier(expressionResult.deopt)) {\n // It's safe to hoist here if the deopt reason is an identifier (e.g. func param).\n // The hoister will take care of how high up it can be hoisted.\n return;\n }\n }\n stop();\n }\n },\n };\n\n return {\n name: \"transform-react-constant-elements\",\n\n visitor: {\n JSXElement(path) {\n if (HOISTED.has(path.node)) return;\n HOISTED.add(path.node);\n\n const state = { isImmutable: true };\n\n // This transform takes the option `allowMutablePropsOnTags`, which is an array\n // of JSX tags to allow mutable props (such as objects, functions) on. Use sparingly\n // and only on tags you know will never modify their own props.\n if (allowMutablePropsOnTags != null) {\n // Get the element's name. If it's a member expression, we use the last part of the path.\n // So the option [\"FormattedMessage\"] would match \"Intl.FormattedMessage\".\n let namePath = path.get(\"openingElement.name\");\n while (namePath.isJSXMemberExpression()) {\n namePath = namePath.get(\"property\");\n }\n\n const elementName = namePath.node.name;\n state.mutablePropsAllowed =\n allowMutablePropsOnTags.indexOf(elementName) > -1;\n }\n\n // Traverse all props passed to this element for immutability.\n path.traverse(immutabilityVisitor, state);\n\n if (state.isImmutable) {\n const hoisted = path.hoist();\n\n if (hoisted) {\n annotateAsPure(hoisted);\n }\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport path from \"path\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function addDisplayName(id, call) {\n const props = call.arguments[0].properties;\n let safe = true;\n\n for (let i = 0; i < props.length; i++) {\n const prop = props[i];\n const key = t.toComputedKey(prop);\n if (t.isLiteral(key, { value: \"displayName\" })) {\n safe = false;\n break;\n }\n }\n\n if (safe) {\n props.unshift(\n t.objectProperty(t.identifier(\"displayName\"), t.stringLiteral(id)),\n );\n }\n }\n\n const isCreateClassCallExpression = t.buildMatchMemberExpression(\n \"React.createClass\",\n );\n const isCreateClassAddon = callee => callee.name === \"createReactClass\";\n\n function isCreateClass(node) {\n if (!node || !t.isCallExpression(node)) return false;\n\n // not createReactClass nor React.createClass call member object\n if (\n !isCreateClassCallExpression(node.callee) &&\n !isCreateClassAddon(node.callee)\n ) {\n return false;\n }\n\n // no call arguments\n const args = node.arguments;\n if (args.length !== 1) return false;\n\n // first node arg is not an object\n const first = args[0];\n if (!t.isObjectExpression(first)) return false;\n\n return true;\n }\n\n return {\n name: \"transform-react-display-name\",\n\n visitor: {\n ExportDefaultDeclaration({ node }, state) {\n if (isCreateClass(node.declaration)) {\n const filename = state.filename || \"unknown\";\n\n let displayName = path.basename(filename, path.extname(filename));\n\n // ./{module name}/index.js\n if (displayName === \"index\") {\n displayName = path.basename(path.dirname(filename));\n }\n\n addDisplayName(displayName, node.declaration);\n }\n },\n\n CallExpression(path) {\n const { node } = path;\n if (!isCreateClass(node)) return;\n\n let id;\n\n // crawl up the ancestry looking for possible candidates for displayName inference\n path.find(function(path) {\n if (path.isAssignmentExpression()) {\n id = path.node.left;\n } else if (path.isObjectProperty()) {\n id = path.node.key;\n } else if (path.isVariableDeclarator()) {\n id = path.node.id;\n } else if (path.isStatement()) {\n // we've hit a statement, we should stop crawling up\n return true;\n }\n\n // we've got an id! no need to continue\n if (id) return true;\n });\n\n // ensure that we have an identifier we can inherit from\n if (!id) return;\n\n // foo.bar -> bar\n if (t.isMemberExpression(id)) {\n id = id.property;\n }\n\n // identifiers are the only thing we can reliably get a name from\n if (t.isIdentifier(id)) {\n addDisplayName(id.name, node);\n }\n },\n },\n };\n});\n","import esutils from \"esutils\";\nimport * as t from \"@babel/types\";\n\ntype ElementState = {\n tagExpr: Object, // tag node\n tagName: ?string, // raw string tag name\n args: Array, // array of call arguments\n call?: Object, // optional call property that can be set to override the call expression returned\n};\n\nexport default function(opts) {\n const visitor = {};\n\n visitor.JSXNamespacedName = function(path) {\n if (opts.throwIfNamespace) {\n throw path.buildCodeFrameError(\n `Namespace tags are not supported by default. React's JSX doesn't support namespace tags. \\\nYou can turn on the 'throwIfNamespace' flag to bypass this warning.`,\n );\n }\n };\n\n visitor.JSXSpreadChild = function(path) {\n throw path.buildCodeFrameError(\n \"Spread children are not supported in React.\",\n );\n };\n\n visitor.JSXElement = {\n exit(path, file) {\n const callExpr = buildElementCall(path, file);\n if (callExpr) {\n path.replaceWith(t.inherits(callExpr, path.node));\n }\n },\n };\n\n visitor.JSXFragment = {\n exit(path, file) {\n if (opts.compat) {\n throw path.buildCodeFrameError(\n \"Fragment tags are only supported in React 16 and up.\",\n );\n }\n const callExpr = buildFragmentCall(path, file);\n if (callExpr) {\n path.replaceWith(t.inherits(callExpr, path.node));\n }\n },\n };\n\n return visitor;\n\n function convertJSXIdentifier(node, parent) {\n if (t.isJSXIdentifier(node)) {\n if (node.name === \"this\" && t.isReferenced(node, parent)) {\n return t.thisExpression();\n } else if (esutils.keyword.isIdentifierNameES6(node.name)) {\n node.type = \"Identifier\";\n } else {\n return t.stringLiteral(node.name);\n }\n } else if (t.isJSXMemberExpression(node)) {\n return t.memberExpression(\n convertJSXIdentifier(node.object, node),\n convertJSXIdentifier(node.property, node),\n );\n } else if (t.isJSXNamespacedName(node)) {\n /**\n * If there is flag \"throwIfNamespace\"\n * print XMLNamespace like string literal\n */\n return t.stringLiteral(`${node.namespace.name}:${node.name.name}`);\n }\n\n return node;\n }\n\n function convertAttributeValue(node) {\n if (t.isJSXExpressionContainer(node)) {\n return node.expression;\n } else {\n return node;\n }\n }\n\n function convertAttribute(node) {\n const value = convertAttributeValue(node.value || t.booleanLiteral(true));\n\n if (t.isJSXSpreadAttribute(node)) {\n return t.spreadElement(node.argument);\n }\n\n if (t.isStringLiteral(value) && !t.isJSXExpressionContainer(node.value)) {\n value.value = value.value.replace(/\\n\\s+/g, \" \");\n\n // \"raw\" JSXText should not be used from a StringLiteral because it needs to be escaped.\n delete value.extra?.raw;\n }\n\n if (t.isJSXNamespacedName(node.name)) {\n node.name = t.stringLiteral(\n node.name.namespace.name + \":\" + node.name.name.name,\n );\n } else if (esutils.keyword.isIdentifierNameES6(node.name.name)) {\n node.name.type = \"Identifier\";\n } else {\n node.name = t.stringLiteral(node.name.name);\n }\n\n return t.inherits(t.objectProperty(node.name, value), node);\n }\n\n function buildElementCall(path, file) {\n if (opts.filter && !opts.filter(path.node, file)) return;\n\n const openingPath = path.get(\"openingElement\");\n openingPath.parent.children = t.react.buildChildren(openingPath.parent);\n\n const tagExpr = convertJSXIdentifier(\n openingPath.node.name,\n openingPath.node,\n );\n const args = [];\n\n let tagName;\n if (t.isIdentifier(tagExpr)) {\n tagName = tagExpr.name;\n } else if (t.isLiteral(tagExpr)) {\n tagName = tagExpr.value;\n }\n\n const state: ElementState = {\n tagExpr: tagExpr,\n tagName: tagName,\n args: args,\n };\n\n if (opts.pre) {\n opts.pre(state, file);\n }\n\n let attribs = openingPath.node.attributes;\n if (attribs.length) {\n attribs = buildOpeningElementAttributes(attribs, file);\n } else {\n attribs = t.nullLiteral();\n }\n\n args.push(attribs, ...path.node.children);\n\n if (opts.post) {\n opts.post(state, file);\n }\n\n return state.call || t.callExpression(state.callee, args);\n }\n\n function pushProps(_props, objs) {\n if (!_props.length) return _props;\n\n objs.push(t.objectExpression(_props));\n return [];\n }\n\n /**\n * The logic for this is quite terse. It's because we need to\n * support spread elements. We loop over all attributes,\n * breaking on spreads, we then push a new object containing\n * all prior attributes to an array for later processing.\n */\n\n function buildOpeningElementAttributes(attribs, file) {\n let _props = [];\n const objs = [];\n\n const { useSpread = false } = file.opts;\n if (typeof useSpread !== \"boolean\") {\n throw new Error(\n \"transform-react-jsx currently only accepts a boolean option for \" +\n \"useSpread (defaults to false)\",\n );\n }\n\n const useBuiltIns = file.opts.useBuiltIns || false;\n if (typeof useBuiltIns !== \"boolean\") {\n throw new Error(\n \"transform-react-jsx currently only accepts a boolean option for \" +\n \"useBuiltIns (defaults to false)\",\n );\n }\n\n if (useSpread && useBuiltIns) {\n throw new Error(\n \"transform-react-jsx currently only accepts useBuiltIns or useSpread \" +\n \"but not both\",\n );\n }\n\n if (useSpread) {\n const props = attribs.map(convertAttribute);\n return t.objectExpression(props);\n }\n\n while (attribs.length) {\n const prop = attribs.shift();\n if (t.isJSXSpreadAttribute(prop)) {\n _props = pushProps(_props, objs);\n objs.push(prop.argument);\n } else {\n _props.push(convertAttribute(prop));\n }\n }\n\n pushProps(_props, objs);\n\n if (objs.length === 1) {\n // only one object\n attribs = objs[0];\n } else {\n // looks like we have multiple objects\n if (!t.isObjectExpression(objs[0])) {\n objs.unshift(t.objectExpression([]));\n }\n\n const helper = useBuiltIns\n ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n : file.addHelper(\"extends\");\n\n // spread it\n attribs = t.callExpression(helper, objs);\n }\n\n return attribs;\n }\n\n function buildFragmentCall(path, file) {\n if (opts.filter && !opts.filter(path.node, file)) return;\n\n const openingPath = path.get(\"openingElement\");\n openingPath.parent.children = t.react.buildChildren(openingPath.parent);\n\n const args = [];\n const tagName = null;\n const tagExpr = file.get(\"jsxFragIdentifier\")();\n\n const state: ElementState = {\n tagExpr: tagExpr,\n tagName: tagName,\n args: args,\n };\n\n if (opts.pre) {\n opts.pre(state, file);\n }\n\n // no attributes are allowed with <> syntax\n args.push(t.nullLiteral(), ...path.node.children);\n\n if (opts.post) {\n opts.post(state, file);\n }\n\n file.set(\"usedFragment\", true);\n return state.call || t.callExpression(state.callee, args);\n }\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport helper from \"@babel/helper-builder-react-jsx\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function hasRefOrSpread(attrs) {\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (t.isJSXSpreadAttribute(attr)) return true;\n if (isJSXAttributeOfName(attr, \"ref\")) return true;\n }\n return false;\n }\n\n function isJSXAttributeOfName(attr, name) {\n return (\n t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { name: name })\n );\n }\n\n const visitor = helper({\n filter(node) {\n return (\n // Regular JSX nodes have an `openingElement`. JSX fragments, however, don't have an\n // `openingElement` which causes `node.openingElement.attributes` to throw.\n node.openingElement && !hasRefOrSpread(node.openingElement.attributes)\n );\n },\n pre(state) {\n const tagName = state.tagName;\n const args = state.args;\n if (t.react.isCompatTag(tagName)) {\n args.push(t.stringLiteral(tagName));\n } else {\n args.push(state.tagExpr);\n }\n },\n post(state, pass) {\n state.callee = pass.addHelper(\"jsx\");\n // NOTE: The arguments passed to the \"jsx\" helper are:\n // (element, props, key, ...children) or (element, props)\n // The argument generated by the helper are:\n // (element, { ...props, key }, ...children)\n\n const props = state.args[1];\n let hasKey = false;\n if (t.isObjectExpression(props)) {\n const keyIndex = props.properties.findIndex(prop =>\n t.isIdentifier(prop.key, { name: \"key\" }),\n );\n if (keyIndex > -1) {\n state.args.splice(2, 0, props.properties[keyIndex].value);\n props.properties.splice(keyIndex, 1);\n hasKey = true;\n }\n } else if (t.isNullLiteral(props)) {\n state.args.splice(1, 1, t.objectExpression([]));\n }\n\n if (!hasKey && state.args.length > 2) {\n state.args.splice(2, 0, t.unaryExpression(\"void\", t.numericLiteral(0)));\n }\n },\n });\n return {\n name: \"transform-react-inline-elements\",\n visitor,\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport jsx from \"@babel/plugin-syntax-jsx\";\nimport helper from \"@babel/helper-builder-react-jsx\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const THROW_IF_NAMESPACE =\n options.throwIfNamespace === undefined ? true : !!options.throwIfNamespace;\n\n const PRAGMA_DEFAULT = options.pragma || \"React.createElement\";\n const PRAGMA_FRAG_DEFAULT = options.pragmaFrag || \"React.Fragment\";\n\n const JSX_ANNOTATION_REGEX = /\\*?\\s*@jsx\\s+([^\\s]+)/;\n const JSX_FRAG_ANNOTATION_REGEX = /\\*?\\s*@jsxFrag\\s+([^\\s]+)/;\n\n // returns a closure that returns an identifier or memberExpression node\n // based on the given id\n const createIdentifierParser = (id: string) => () => {\n return id\n .split(\".\")\n .map(name => t.identifier(name))\n .reduce((object, property) => t.memberExpression(object, property));\n };\n\n const visitor = helper({\n pre(state) {\n const tagName = state.tagName;\n const args = state.args;\n if (t.react.isCompatTag(tagName)) {\n args.push(t.stringLiteral(tagName));\n } else {\n args.push(state.tagExpr);\n }\n },\n\n post(state, pass) {\n state.callee = pass.get(\"jsxIdentifier\")();\n },\n\n throwIfNamespace: THROW_IF_NAMESPACE,\n });\n\n visitor.Program = {\n enter(path, state) {\n const { file } = state;\n\n let pragma = PRAGMA_DEFAULT;\n let pragmaFrag = PRAGMA_FRAG_DEFAULT;\n let pragmaSet = !!options.pragma;\n let pragmaFragSet = !!options.pragmaFrag;\n\n if (file.ast.comments) {\n for (const comment of (file.ast.comments: Array)) {\n const jsxMatches = JSX_ANNOTATION_REGEX.exec(comment.value);\n if (jsxMatches) {\n pragma = jsxMatches[1];\n pragmaSet = true;\n }\n const jsxFragMatches = JSX_FRAG_ANNOTATION_REGEX.exec(comment.value);\n if (jsxFragMatches) {\n pragmaFrag = jsxFragMatches[1];\n pragmaFragSet = true;\n }\n }\n }\n\n state.set(\"jsxIdentifier\", createIdentifierParser(pragma));\n state.set(\"jsxFragIdentifier\", createIdentifierParser(pragmaFrag));\n state.set(\"usedFragment\", false);\n state.set(\"pragmaSet\", pragmaSet);\n state.set(\"pragmaFragSet\", pragmaFragSet);\n },\n exit(path, state) {\n if (\n state.get(\"pragmaSet\") &&\n state.get(\"usedFragment\") &&\n !state.get(\"pragmaFragSet\")\n ) {\n throw new Error(\n \"transform-react-jsx: pragma has been set but \" +\n \"pragmaFrag has not been set\",\n );\n }\n },\n };\n\n visitor.JSXAttribute = function(path) {\n if (t.isJSXElement(path.node.value)) {\n path.node.value = t.jsxExpressionContainer(path.node.value);\n }\n };\n\n return {\n name: \"transform-react-jsx\",\n inherits: jsx,\n visitor,\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport helper from \"@babel/helper-builder-react-jsx\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-react-jsx-compat\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"jsx\");\n },\n\n visitor: helper({\n pre(state) {\n state.callee = state.tagExpr;\n },\n\n post(state) {\n if (t.react.isCompatTag(state.tagName)) {\n state.call = t.callExpression(\n t.memberExpression(\n t.memberExpression(t.identifier(\"React\"), t.identifier(\"DOM\")),\n state.tagExpr,\n t.isLiteral(state.tagExpr),\n ),\n state.args,\n );\n }\n },\n compat: true,\n }),\n };\n});\n","/**\n * This adds a __self={this} JSX attribute to all JSX elements, which React will use\n * to generate some runtime warnings.\n *\n *\n * == JSX Literals ==\n *\n * \n *\n * becomes:\n *\n * \n */\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nconst TRACE_ID = \"__self\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n const visitor = {\n JSXOpeningElement({ node }) {\n const id = t.jsxIdentifier(TRACE_ID);\n const trace = t.thisExpression();\n\n node.attributes.push(t.jsxAttribute(id, t.jsxExpressionContainer(trace)));\n },\n };\n\n return {\n name: \"transform-react-jsx-self\",\n visitor,\n };\n});\n","/**\n * This adds {fileName, lineNumber} annotations to React component definitions\n * and to jsx tag literals.\n *\n *\n * == JSX Literals ==\n *\n * \n *\n * becomes:\n *\n * var __jsxFileName = 'this/file.js';\n * \n */\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nconst TRACE_ID = \"__source\";\nconst FILE_NAME_VAR = \"_jsxFileName\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function makeTrace(fileNameIdentifier, lineNumber) {\n const fileLineLiteral =\n lineNumber != null ? t.numericLiteral(lineNumber) : t.nullLiteral();\n const fileNameProperty = t.objectProperty(\n t.identifier(\"fileName\"),\n fileNameIdentifier,\n );\n const lineNumberProperty = t.objectProperty(\n t.identifier(\"lineNumber\"),\n fileLineLiteral,\n );\n return t.objectExpression([fileNameProperty, lineNumberProperty]);\n }\n\n const visitor = {\n JSXOpeningElement(path, state) {\n const id = t.jsxIdentifier(TRACE_ID);\n const location = path.container.openingElement.loc;\n if (!location) {\n // the element was generated and doesn't have location information\n return;\n }\n\n const attributes = path.container.openingElement.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const name = attributes[i].name;\n if (name && name.name === TRACE_ID) {\n // The __source attribute already exists\n return;\n }\n }\n\n if (!state.fileNameIdentifier) {\n const fileName = state.filename || \"\";\n\n const fileNameIdentifier = path.scope.generateUidIdentifier(\n FILE_NAME_VAR,\n );\n const scope = path.hub.getScope();\n if (scope) {\n scope.push({\n id: fileNameIdentifier,\n init: t.stringLiteral(fileName),\n });\n }\n state.fileNameIdentifier = fileNameIdentifier;\n }\n\n const trace = makeTrace(state.fileNameIdentifier, location.start.line);\n attributes.push(t.jsxAttribute(id, t.jsxExpressionContainer(trace)));\n },\n };\n\n return {\n name: \"transform-react-jsx-source\",\n visitor,\n };\n});\n","\"use strict\";\n\nexports.__esModule = true;\nexports.wrapWithTypes = wrapWithTypes;\nexports.getTypes = getTypes;\nexports.runtimeProperty = runtimeProperty;\nexports.isReference = isReference;\nexports.replaceWithOrRemove = replaceWithOrRemove;\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar currentTypes = null;\n\nfunction wrapWithTypes(types, fn) {\n return function () {\n var oldTypes = currentTypes;\n currentTypes = types;\n\n try {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return fn.apply(this, args);\n } finally {\n currentTypes = oldTypes;\n }\n };\n}\n\nfunction getTypes() {\n return currentTypes;\n}\n\nfunction runtimeProperty(name) {\n var t = getTypes();\n return t.memberExpression(t.identifier(\"regeneratorRuntime\"), t.identifier(name), false);\n}\n\nfunction isReference(path) {\n return path.isReferenced() || path.parentPath.isAssignmentExpression({\n left: path.node\n });\n}\n\nfunction replaceWithOrRemove(path, replacement) {\n if (replacement) {\n path.replaceWith(replacement);\n } else {\n path.remove();\n }\n}","\"use strict\";\n\nvar util = _interopRequireWildcard(require(\"./util\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar hasOwn = Object.prototype.hasOwnProperty; // The hoist function takes a FunctionExpression or FunctionDeclaration\n// and replaces any Declaration nodes in its body with assignments, then\n// returns a VariableDeclaration containing just the names of the removed\n// declarations.\n\nexports.hoist = function (funPath) {\n var t = util.getTypes();\n t.assertFunction(funPath.node);\n var vars = {};\n\n function varDeclToExpr(_ref, includeIdentifiers) {\n var vdec = _ref.node,\n scope = _ref.scope;\n t.assertVariableDeclaration(vdec); // TODO assert.equal(vdec.kind, \"var\");\n\n var exprs = [];\n vdec.declarations.forEach(function (dec) {\n // Note: We duplicate 'dec.id' here to ensure that the variable declaration IDs don't\n // have the same 'loc' value, since that can make sourcemaps and retainLines behave poorly.\n vars[dec.id.name] = t.identifier(dec.id.name); // Remove the binding, to avoid \"duplicate declaration\" errors when it will\n // be injected again.\n\n scope.removeBinding(dec.id.name);\n\n if (dec.init) {\n exprs.push(t.assignmentExpression(\"=\", dec.id, dec.init));\n } else if (includeIdentifiers) {\n exprs.push(dec.id);\n }\n });\n if (exprs.length === 0) return null;\n if (exprs.length === 1) return exprs[0];\n return t.sequenceExpression(exprs);\n }\n\n funPath.get(\"body\").traverse({\n VariableDeclaration: {\n exit: function exit(path) {\n var expr = varDeclToExpr(path, false);\n\n if (expr === null) {\n path.remove();\n } else {\n // We don't need to traverse this expression any further because\n // there can't be any new declarations inside an expression.\n util.replaceWithOrRemove(path, t.expressionStatement(expr));\n } // Since the original node has been either removed or replaced,\n // avoid traversing it any further.\n\n\n path.skip();\n }\n },\n ForStatement: function ForStatement(path) {\n var init = path.get(\"init\");\n\n if (init.isVariableDeclaration()) {\n util.replaceWithOrRemove(init, varDeclToExpr(init, false));\n }\n },\n ForXStatement: function ForXStatement(path) {\n var left = path.get(\"left\");\n\n if (left.isVariableDeclaration()) {\n util.replaceWithOrRemove(left, varDeclToExpr(left, true));\n }\n },\n FunctionDeclaration: function FunctionDeclaration(path) {\n var node = path.node;\n vars[node.id.name] = node.id;\n var assignment = t.expressionStatement(t.assignmentExpression(\"=\", t.clone(node.id), t.functionExpression(path.scope.generateUidIdentifierBasedOnNode(node), node.params, node.body, node.generator, node.expression)));\n\n if (path.parentPath.isBlockStatement()) {\n // Insert the assignment form before the first statement in the\n // enclosing block.\n path.parentPath.unshiftContainer(\"body\", assignment); // Remove the function declaration now that we've inserted the\n // equivalent assignment form at the beginning of the block.\n\n path.remove();\n } else {\n // If the parent node is not a block statement, then we can just\n // replace the declaration with the equivalent assignment form\n // without worrying about hoisting it.\n util.replaceWithOrRemove(path, assignment);\n } // Remove the binding, to avoid \"duplicate declaration\" errors when it will\n // be injected again.\n\n\n path.scope.removeBinding(node.id.name); // Don't hoist variables out of inner functions.\n\n path.skip();\n },\n FunctionExpression: function FunctionExpression(path) {\n // Don't descend into nested function expressions.\n path.skip();\n },\n ArrowFunctionExpression: function ArrowFunctionExpression(path) {\n // Don't descend into nested function expressions.\n path.skip();\n }\n });\n var paramNames = {};\n funPath.get(\"params\").forEach(function (paramPath) {\n var param = paramPath.node;\n\n if (t.isIdentifier(param)) {\n paramNames[param.name] = param;\n } else {// Variables declared by destructuring parameter patterns will be\n // harmlessly re-declared.\n }\n });\n var declarations = [];\n Object.keys(vars).forEach(function (name) {\n if (!hasOwn.call(paramNames, name)) {\n declarations.push(t.variableDeclarator(vars[name], null));\n }\n });\n\n if (declarations.length === 0) {\n return null; // Be sure to handle this case!\n }\n\n return t.variableDeclaration(\"var\", declarations);\n};","\"use strict\";\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar _emit = require(\"./emit\");\n\nvar _util = require(\"util\");\n\nvar _util2 = require(\"./util\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction Entry() {\n _assert[\"default\"].ok(this instanceof Entry);\n}\n\nfunction FunctionEntry(returnLoc) {\n Entry.call(this);\n (0, _util2.getTypes)().assertLiteral(returnLoc);\n this.returnLoc = returnLoc;\n}\n\n(0, _util.inherits)(FunctionEntry, Entry);\nexports.FunctionEntry = FunctionEntry;\n\nfunction LoopEntry(breakLoc, continueLoc, label) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(breakLoc);\n t.assertLiteral(continueLoc);\n\n if (label) {\n t.assertIdentifier(label);\n } else {\n label = null;\n }\n\n this.breakLoc = breakLoc;\n this.continueLoc = continueLoc;\n this.label = label;\n}\n\n(0, _util.inherits)(LoopEntry, Entry);\nexports.LoopEntry = LoopEntry;\n\nfunction SwitchEntry(breakLoc) {\n Entry.call(this);\n (0, _util2.getTypes)().assertLiteral(breakLoc);\n this.breakLoc = breakLoc;\n}\n\n(0, _util.inherits)(SwitchEntry, Entry);\nexports.SwitchEntry = SwitchEntry;\n\nfunction TryEntry(firstLoc, catchEntry, finallyEntry) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(firstLoc);\n\n if (catchEntry) {\n _assert[\"default\"].ok(catchEntry instanceof CatchEntry);\n } else {\n catchEntry = null;\n }\n\n if (finallyEntry) {\n _assert[\"default\"].ok(finallyEntry instanceof FinallyEntry);\n } else {\n finallyEntry = null;\n } // Have to have one or the other (or both).\n\n\n _assert[\"default\"].ok(catchEntry || finallyEntry);\n\n this.firstLoc = firstLoc;\n this.catchEntry = catchEntry;\n this.finallyEntry = finallyEntry;\n}\n\n(0, _util.inherits)(TryEntry, Entry);\nexports.TryEntry = TryEntry;\n\nfunction CatchEntry(firstLoc, paramId) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(firstLoc);\n t.assertIdentifier(paramId);\n this.firstLoc = firstLoc;\n this.paramId = paramId;\n}\n\n(0, _util.inherits)(CatchEntry, Entry);\nexports.CatchEntry = CatchEntry;\n\nfunction FinallyEntry(firstLoc, afterLoc) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(firstLoc);\n t.assertLiteral(afterLoc);\n this.firstLoc = firstLoc;\n this.afterLoc = afterLoc;\n}\n\n(0, _util.inherits)(FinallyEntry, Entry);\nexports.FinallyEntry = FinallyEntry;\n\nfunction LabeledEntry(breakLoc, label) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(breakLoc);\n t.assertIdentifier(label);\n this.breakLoc = breakLoc;\n this.label = label;\n}\n\n(0, _util.inherits)(LabeledEntry, Entry);\nexports.LabeledEntry = LabeledEntry;\n\nfunction LeapManager(emitter) {\n _assert[\"default\"].ok(this instanceof LeapManager);\n\n _assert[\"default\"].ok(emitter instanceof _emit.Emitter);\n\n this.emitter = emitter;\n this.entryStack = [new FunctionEntry(emitter.finalLoc)];\n}\n\nvar LMp = LeapManager.prototype;\nexports.LeapManager = LeapManager;\n\nLMp.withEntry = function (entry, callback) {\n _assert[\"default\"].ok(entry instanceof Entry);\n\n this.entryStack.push(entry);\n\n try {\n callback.call(this.emitter);\n } finally {\n var popped = this.entryStack.pop();\n\n _assert[\"default\"].strictEqual(popped, entry);\n }\n};\n\nLMp._findLeapLocation = function (property, label) {\n for (var i = this.entryStack.length - 1; i >= 0; --i) {\n var entry = this.entryStack[i];\n var loc = entry[property];\n\n if (loc) {\n if (label) {\n if (entry.label && entry.label.name === label.name) {\n return loc;\n }\n } else if (entry instanceof LabeledEntry) {// Ignore LabeledEntry entries unless we are actually breaking to\n // a label.\n } else {\n return loc;\n }\n }\n }\n\n return null;\n};\n\nLMp.getBreakLoc = function (label) {\n return this._findLeapLocation(\"breakLoc\", label);\n};\n\nLMp.getContinueLoc = function (label) {\n return this._findLeapLocation(\"continueLoc\", label);\n};","\"use strict\";\n\nvar originalObject = Object;\nvar originalDefProp = Object.defineProperty;\nvar originalCreate = Object.create;\n\nfunction defProp(obj, name, value) {\n if (originalDefProp) try {\n originalDefProp.call(originalObject, obj, name, { value: value });\n } catch (definePropertyIsBrokenInIE8) {\n obj[name] = value;\n } else {\n obj[name] = value;\n }\n}\n\n// For functions that will be invoked using .call or .apply, we need to\n// define those methods on the function objects themselves, rather than\n// inheriting them from Function.prototype, so that a malicious or clumsy\n// third party cannot interfere with the functionality of this module by\n// redefining Function.prototype.call or .apply.\nfunction makeSafeToCall(fun) {\n if (fun) {\n defProp(fun, \"call\", fun.call);\n defProp(fun, \"apply\", fun.apply);\n }\n return fun;\n}\n\nmakeSafeToCall(originalDefProp);\nmakeSafeToCall(originalCreate);\n\nvar hasOwn = makeSafeToCall(Object.prototype.hasOwnProperty);\nvar numToStr = makeSafeToCall(Number.prototype.toString);\nvar strSlice = makeSafeToCall(String.prototype.slice);\n\nvar cloner = function(){};\nfunction create(prototype) {\n if (originalCreate) {\n return originalCreate.call(originalObject, prototype);\n }\n cloner.prototype = prototype || null;\n return new cloner;\n}\n\nvar rand = Math.random;\nvar uniqueKeys = create(null);\n\nfunction makeUniqueKey() {\n // Collisions are highly unlikely, but this module is in the business of\n // making guarantees rather than safe bets.\n do var uniqueKey = internString(strSlice.call(numToStr.call(rand(), 36), 2));\n while (hasOwn.call(uniqueKeys, uniqueKey));\n return uniqueKeys[uniqueKey] = uniqueKey;\n}\n\nfunction internString(str) {\n var obj = {};\n obj[str] = true;\n return Object.keys(obj)[0];\n}\n\n// External users might find this function useful, but it is not necessary\n// for the typical use of this module.\nexports.makeUniqueKey = makeUniqueKey;\n\n// Object.getOwnPropertyNames is the only way to enumerate non-enumerable\n// properties, so if we wrap it to ignore our secret keys, there should be\n// no way (except guessing) to access those properties.\nvar originalGetOPNs = Object.getOwnPropertyNames;\nObject.getOwnPropertyNames = function getOwnPropertyNames(object) {\n for (var names = originalGetOPNs(object),\n src = 0,\n dst = 0,\n len = names.length;\n src < len;\n ++src) {\n if (!hasOwn.call(uniqueKeys, names[src])) {\n if (src > dst) {\n names[dst] = names[src];\n }\n ++dst;\n }\n }\n names.length = dst;\n return names;\n};\n\nfunction defaultCreatorFn(object) {\n return create(null);\n}\n\nfunction makeAccessor(secretCreatorFn) {\n var brand = makeUniqueKey();\n var passkey = create(null);\n\n secretCreatorFn = secretCreatorFn || defaultCreatorFn;\n\n function register(object) {\n var secret; // Created lazily.\n\n function vault(key, forget) {\n // Only code that has access to the passkey can retrieve (or forget)\n // the secret object.\n if (key === passkey) {\n return forget\n ? secret = null\n : secret || (secret = secretCreatorFn(object));\n }\n }\n\n defProp(object, brand, vault);\n }\n\n function accessor(object) {\n if (!hasOwn.call(object, brand))\n register(object);\n return object[brand](passkey);\n }\n\n accessor.forget = function(object) {\n if (hasOwn.call(object, brand))\n object[brand](passkey, true);\n };\n\n return accessor;\n}\n\nexports.makeAccessor = makeAccessor;\n","\"use strict\";\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar _util = require(\"./util.js\");\n\nvar _private = require(\"private\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar m = (0, _private.makeAccessor)();\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction makePredicate(propertyName, knownTypes) {\n function onlyChildren(node) {\n var t = (0, _util.getTypes)();\n t.assertNode(node); // Assume no side effects until we find out otherwise.\n\n var result = false;\n\n function check(child) {\n if (result) {// Do nothing.\n } else if (Array.isArray(child)) {\n child.some(check);\n } else if (t.isNode(child)) {\n _assert[\"default\"].strictEqual(result, false);\n\n result = predicate(child);\n }\n\n return result;\n }\n\n var keys = t.VISITOR_KEYS[node.type];\n\n if (keys) {\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var child = node[key];\n check(child);\n }\n }\n\n return result;\n }\n\n function predicate(node) {\n (0, _util.getTypes)().assertNode(node);\n var meta = m(node);\n if (hasOwn.call(meta, propertyName)) return meta[propertyName]; // Certain types are \"opaque,\" which means they have no side\n // effects or leaps and we don't care about their subexpressions.\n\n if (hasOwn.call(opaqueTypes, node.type)) return meta[propertyName] = false;\n if (hasOwn.call(knownTypes, node.type)) return meta[propertyName] = true;\n return meta[propertyName] = onlyChildren(node);\n }\n\n predicate.onlyChildren = onlyChildren;\n return predicate;\n}\n\nvar opaqueTypes = {\n FunctionExpression: true,\n ArrowFunctionExpression: true\n}; // These types potentially have side effects regardless of what side\n// effects their subexpressions have.\n\nvar sideEffectTypes = {\n CallExpression: true,\n // Anything could happen!\n ForInStatement: true,\n // Modifies the key variable.\n UnaryExpression: true,\n // Think delete.\n BinaryExpression: true,\n // Might invoke .toString() or .valueOf().\n AssignmentExpression: true,\n // Side-effecting by definition.\n UpdateExpression: true,\n // Updates are essentially assignments.\n NewExpression: true // Similar to CallExpression.\n\n}; // These types are the direct cause of all leaps in control flow.\n\nvar leapTypes = {\n YieldExpression: true,\n BreakStatement: true,\n ContinueStatement: true,\n ReturnStatement: true,\n ThrowStatement: true\n}; // All leap types are also side effect types.\n\nfor (var type in leapTypes) {\n if (hasOwn.call(leapTypes, type)) {\n sideEffectTypes[type] = leapTypes[type];\n }\n}\n\nexports.hasSideEffects = makePredicate(\"hasSideEffects\", sideEffectTypes);\nexports.containsLeap = makePredicate(\"containsLeap\", leapTypes);","\"use strict\";\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar leap = _interopRequireWildcard(require(\"./leap\"));\n\nvar meta = _interopRequireWildcard(require(\"./meta\"));\n\nvar util = _interopRequireWildcard(require(\"./util\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction Emitter(contextId) {\n _assert[\"default\"].ok(this instanceof Emitter);\n\n util.getTypes().assertIdentifier(contextId); // Used to generate unique temporary names.\n\n this.nextTempId = 0; // In order to make sure the context object does not collide with\n // anything in the local scope, we might have to rename it, so we\n // refer to it symbolically instead of just assuming that it will be\n // called \"context\".\n\n this.contextId = contextId; // An append-only list of Statements that grows each time this.emit is\n // called.\n\n this.listing = []; // A sparse array whose keys correspond to locations in this.listing\n // that have been marked as branch/jump targets.\n\n this.marked = [true];\n this.insertedLocs = new Set(); // The last location will be marked when this.getDispatchLoop is\n // called.\n\n this.finalLoc = this.loc(); // A list of all leap.TryEntry statements emitted.\n\n this.tryEntries = []; // Each time we evaluate the body of a loop, we tell this.leapManager\n // to enter a nested loop context that determines the meaning of break\n // and continue statements therein.\n\n this.leapManager = new leap.LeapManager(this);\n}\n\nvar Ep = Emitter.prototype;\nexports.Emitter = Emitter; // Offsets into this.listing that could be used as targets for branches or\n// jumps are represented as numeric Literal nodes. This representation has\n// the amazingly convenient benefit of allowing the exact value of the\n// location to be determined at any time, even after generating code that\n// refers to the location.\n\nEp.loc = function () {\n var l = util.getTypes().numericLiteral(-1);\n this.insertedLocs.add(l);\n return l;\n};\n\nEp.getInsertedLocs = function () {\n return this.insertedLocs;\n};\n\nEp.getContextId = function () {\n return util.getTypes().clone(this.contextId);\n}; // Sets the exact value of the given location to the offset of the next\n// Statement emitted.\n\n\nEp.mark = function (loc) {\n util.getTypes().assertLiteral(loc);\n var index = this.listing.length;\n\n if (loc.value === -1) {\n loc.value = index;\n } else {\n // Locations can be marked redundantly, but their values cannot change\n // once set the first time.\n _assert[\"default\"].strictEqual(loc.value, index);\n }\n\n this.marked[index] = true;\n return loc;\n};\n\nEp.emit = function (node) {\n var t = util.getTypes();\n\n if (t.isExpression(node)) {\n node = t.expressionStatement(node);\n }\n\n t.assertStatement(node);\n this.listing.push(node);\n}; // Shorthand for emitting assignment statements. This will come in handy\n// for assignments to temporary variables.\n\n\nEp.emitAssign = function (lhs, rhs) {\n this.emit(this.assign(lhs, rhs));\n return lhs;\n}; // Shorthand for an assignment statement.\n\n\nEp.assign = function (lhs, rhs) {\n var t = util.getTypes();\n return t.expressionStatement(t.assignmentExpression(\"=\", t.cloneDeep(lhs), rhs));\n}; // Convenience function for generating expressions like context.next,\n// context.sent, and context.rval.\n\n\nEp.contextProperty = function (name, computed) {\n var t = util.getTypes();\n return t.memberExpression(this.getContextId(), computed ? t.stringLiteral(name) : t.identifier(name), !!computed);\n}; // Shorthand for setting context.rval and jumping to `context.stop()`.\n\n\nEp.stop = function (rval) {\n if (rval) {\n this.setReturnValue(rval);\n }\n\n this.jump(this.finalLoc);\n};\n\nEp.setReturnValue = function (valuePath) {\n util.getTypes().assertExpression(valuePath.value);\n this.emitAssign(this.contextProperty(\"rval\"), this.explodeExpression(valuePath));\n};\n\nEp.clearPendingException = function (tryLoc, assignee) {\n var t = util.getTypes();\n t.assertLiteral(tryLoc);\n var catchCall = t.callExpression(this.contextProperty(\"catch\", true), [t.clone(tryLoc)]);\n\n if (assignee) {\n this.emitAssign(assignee, catchCall);\n } else {\n this.emit(catchCall);\n }\n}; // Emits code for an unconditional jump to the given location, even if the\n// exact value of the location is not yet known.\n\n\nEp.jump = function (toLoc) {\n this.emitAssign(this.contextProperty(\"next\"), toLoc);\n this.emit(util.getTypes().breakStatement());\n}; // Conditional jump.\n\n\nEp.jumpIf = function (test, toLoc) {\n var t = util.getTypes();\n t.assertExpression(test);\n t.assertLiteral(toLoc);\n this.emit(t.ifStatement(test, t.blockStatement([this.assign(this.contextProperty(\"next\"), toLoc), t.breakStatement()])));\n}; // Conditional jump, with the condition negated.\n\n\nEp.jumpIfNot = function (test, toLoc) {\n var t = util.getTypes();\n t.assertExpression(test);\n t.assertLiteral(toLoc);\n var negatedTest;\n\n if (t.isUnaryExpression(test) && test.operator === \"!\") {\n // Avoid double negation.\n negatedTest = test.argument;\n } else {\n negatedTest = t.unaryExpression(\"!\", test);\n }\n\n this.emit(t.ifStatement(negatedTest, t.blockStatement([this.assign(this.contextProperty(\"next\"), toLoc), t.breakStatement()])));\n}; // Returns a unique MemberExpression that can be used to store and\n// retrieve temporary values. Since the object of the member expression is\n// the context object, which is presumed to coexist peacefully with all\n// other local variables, and since we just increment `nextTempId`\n// monotonically, uniqueness is assured.\n\n\nEp.makeTempVar = function () {\n return this.contextProperty(\"t\" + this.nextTempId++);\n};\n\nEp.getContextFunction = function (id) {\n var t = util.getTypes();\n return t.functionExpression(id || null\n /*Anonymous*/\n , [this.getContextId()], t.blockStatement([this.getDispatchLoop()]), false, // Not a generator anymore!\n false // Nor an expression.\n );\n}; // Turns this.listing into a loop of the form\n//\n// while (1) switch (context.next) {\n// case 0:\n// ...\n// case n:\n// return context.stop();\n// }\n//\n// Each marked location in this.listing will correspond to one generated\n// case statement.\n\n\nEp.getDispatchLoop = function () {\n var self = this;\n var t = util.getTypes();\n var cases = [];\n var current; // If we encounter a break, continue, or return statement in a switch\n // case, we can skip the rest of the statements until the next case.\n\n var alreadyEnded = false;\n self.listing.forEach(function (stmt, i) {\n if (self.marked.hasOwnProperty(i)) {\n cases.push(t.switchCase(t.numericLiteral(i), current = []));\n alreadyEnded = false;\n }\n\n if (!alreadyEnded) {\n current.push(stmt);\n if (t.isCompletionStatement(stmt)) alreadyEnded = true;\n }\n }); // Now that we know how many statements there will be in this.listing,\n // we can finally resolve this.finalLoc.value.\n\n this.finalLoc.value = this.listing.length;\n cases.push(t.switchCase(this.finalLoc, [// Intentionally fall through to the \"end\" case...\n ]), // So that the runtime can jump to the final location without having\n // to know its offset, we provide the \"end\" case as a synonym.\n t.switchCase(t.stringLiteral(\"end\"), [// This will check/clear both context.thrown and context.rval.\n t.returnStatement(t.callExpression(this.contextProperty(\"stop\"), []))]));\n return t.whileStatement(t.numericLiteral(1), t.switchStatement(t.assignmentExpression(\"=\", this.contextProperty(\"prev\"), this.contextProperty(\"next\")), cases));\n};\n\nEp.getTryLocsList = function () {\n if (this.tryEntries.length === 0) {\n // To avoid adding a needless [] to the majority of runtime.wrap\n // argument lists, force the caller to handle this case specially.\n return null;\n }\n\n var t = util.getTypes();\n var lastLocValue = 0;\n return t.arrayExpression(this.tryEntries.map(function (tryEntry) {\n var thisLocValue = tryEntry.firstLoc.value;\n\n _assert[\"default\"].ok(thisLocValue >= lastLocValue, \"try entries out of order\");\n\n lastLocValue = thisLocValue;\n var ce = tryEntry.catchEntry;\n var fe = tryEntry.finallyEntry;\n var locs = [tryEntry.firstLoc, // The null here makes a hole in the array.\n ce ? ce.firstLoc : null];\n\n if (fe) {\n locs[2] = fe.firstLoc;\n locs[3] = fe.afterLoc;\n }\n\n return t.arrayExpression(locs.map(function (loc) {\n return loc && t.clone(loc);\n }));\n }));\n}; // All side effects must be realized in order.\n// If any subexpression harbors a leap, all subexpressions must be\n// neutered of side effects.\n// No destructive modification of AST nodes.\n\n\nEp.explode = function (path, ignoreResult) {\n var t = util.getTypes();\n var node = path.node;\n var self = this;\n t.assertNode(node);\n if (t.isDeclaration(node)) throw getDeclError(node);\n if (t.isStatement(node)) return self.explodeStatement(path);\n if (t.isExpression(node)) return self.explodeExpression(path, ignoreResult);\n\n switch (node.type) {\n case \"Program\":\n return path.get(\"body\").map(self.explodeStatement, self);\n\n case \"VariableDeclarator\":\n throw getDeclError(node);\n // These node types should be handled by their parent nodes\n // (ObjectExpression, SwitchStatement, and TryStatement, respectively).\n\n case \"Property\":\n case \"SwitchCase\":\n case \"CatchClause\":\n throw new Error(node.type + \" nodes should be handled by their parents\");\n\n default:\n throw new Error(\"unknown Node of type \" + JSON.stringify(node.type));\n }\n};\n\nfunction getDeclError(node) {\n return new Error(\"all declarations should have been transformed into \" + \"assignments before the Exploder began its work: \" + JSON.stringify(node));\n}\n\nEp.explodeStatement = function (path, labelId) {\n var t = util.getTypes();\n var stmt = path.node;\n var self = this;\n var before, after, head;\n t.assertStatement(stmt);\n\n if (labelId) {\n t.assertIdentifier(labelId);\n } else {\n labelId = null;\n } // Explode BlockStatement nodes even if they do not contain a yield,\n // because we don't want or need the curly braces.\n\n\n if (t.isBlockStatement(stmt)) {\n path.get(\"body\").forEach(function (path) {\n self.explodeStatement(path);\n });\n return;\n }\n\n if (!meta.containsLeap(stmt)) {\n // Technically we should be able to avoid emitting the statement\n // altogether if !meta.hasSideEffects(stmt), but that leads to\n // confusing generated code (for instance, `while (true) {}` just\n // disappears) and is probably a more appropriate job for a dedicated\n // dead code elimination pass.\n self.emit(stmt);\n return;\n }\n\n switch (stmt.type) {\n case \"ExpressionStatement\":\n self.explodeExpression(path.get(\"expression\"), true);\n break;\n\n case \"LabeledStatement\":\n after = this.loc(); // Did you know you can break from any labeled block statement or\n // control structure? Well, you can! Note: when a labeled loop is\n // encountered, the leap.LabeledEntry created here will immediately\n // enclose a leap.LoopEntry on the leap manager's stack, and both\n // entries will have the same label. Though this works just fine, it\n // may seem a bit redundant. In theory, we could check here to\n // determine if stmt knows how to handle its own label; for example,\n // stmt happens to be a WhileStatement and so we know it's going to\n // establish its own LoopEntry when we explode it (below). Then this\n // LabeledEntry would be unnecessary. Alternatively, we might be\n // tempted not to pass stmt.label down into self.explodeStatement,\n // because we've handled the label here, but that's a mistake because\n // labeled loops may contain labeled continue statements, which is not\n // something we can handle in this generic case. All in all, I think a\n // little redundancy greatly simplifies the logic of this case, since\n // it's clear that we handle all possible LabeledStatements correctly\n // here, regardless of whether they interact with the leap manager\n // themselves. Also remember that labels and break/continue-to-label\n // statements are rare, and all of this logic happens at transform\n // time, so it has no additional runtime cost.\n\n self.leapManager.withEntry(new leap.LabeledEntry(after, stmt.label), function () {\n self.explodeStatement(path.get(\"body\"), stmt.label);\n });\n self.mark(after);\n break;\n\n case \"WhileStatement\":\n before = this.loc();\n after = this.loc();\n self.mark(before);\n self.jumpIfNot(self.explodeExpression(path.get(\"test\")), after);\n self.leapManager.withEntry(new leap.LoopEntry(after, before, labelId), function () {\n self.explodeStatement(path.get(\"body\"));\n });\n self.jump(before);\n self.mark(after);\n break;\n\n case \"DoWhileStatement\":\n var first = this.loc();\n var test = this.loc();\n after = this.loc();\n self.mark(first);\n self.leapManager.withEntry(new leap.LoopEntry(after, test, labelId), function () {\n self.explode(path.get(\"body\"));\n });\n self.mark(test);\n self.jumpIf(self.explodeExpression(path.get(\"test\")), first);\n self.mark(after);\n break;\n\n case \"ForStatement\":\n head = this.loc();\n var update = this.loc();\n after = this.loc();\n\n if (stmt.init) {\n // We pass true here to indicate that if stmt.init is an expression\n // then we do not care about its result.\n self.explode(path.get(\"init\"), true);\n }\n\n self.mark(head);\n\n if (stmt.test) {\n self.jumpIfNot(self.explodeExpression(path.get(\"test\")), after);\n } else {// No test means continue unconditionally.\n }\n\n self.leapManager.withEntry(new leap.LoopEntry(after, update, labelId), function () {\n self.explodeStatement(path.get(\"body\"));\n });\n self.mark(update);\n\n if (stmt.update) {\n // We pass true here to indicate that if stmt.update is an\n // expression then we do not care about its result.\n self.explode(path.get(\"update\"), true);\n }\n\n self.jump(head);\n self.mark(after);\n break;\n\n case \"TypeCastExpression\":\n return self.explodeExpression(path.get(\"expression\"));\n\n case \"ForInStatement\":\n head = this.loc();\n after = this.loc();\n var keyIterNextFn = self.makeTempVar();\n self.emitAssign(keyIterNextFn, t.callExpression(util.runtimeProperty(\"keys\"), [self.explodeExpression(path.get(\"right\"))]));\n self.mark(head);\n var keyInfoTmpVar = self.makeTempVar();\n self.jumpIf(t.memberExpression(t.assignmentExpression(\"=\", keyInfoTmpVar, t.callExpression(t.cloneDeep(keyIterNextFn), [])), t.identifier(\"done\"), false), after);\n self.emitAssign(stmt.left, t.memberExpression(t.cloneDeep(keyInfoTmpVar), t.identifier(\"value\"), false));\n self.leapManager.withEntry(new leap.LoopEntry(after, head, labelId), function () {\n self.explodeStatement(path.get(\"body\"));\n });\n self.jump(head);\n self.mark(after);\n break;\n\n case \"BreakStatement\":\n self.emitAbruptCompletion({\n type: \"break\",\n target: self.leapManager.getBreakLoc(stmt.label)\n });\n break;\n\n case \"ContinueStatement\":\n self.emitAbruptCompletion({\n type: \"continue\",\n target: self.leapManager.getContinueLoc(stmt.label)\n });\n break;\n\n case \"SwitchStatement\":\n // Always save the discriminant into a temporary variable in case the\n // test expressions overwrite values like context.sent.\n var disc = self.emitAssign(self.makeTempVar(), self.explodeExpression(path.get(\"discriminant\")));\n after = this.loc();\n var defaultLoc = this.loc();\n var condition = defaultLoc;\n var caseLocs = []; // If there are no cases, .cases might be undefined.\n\n var cases = stmt.cases || [];\n\n for (var i = cases.length - 1; i >= 0; --i) {\n var c = cases[i];\n t.assertSwitchCase(c);\n\n if (c.test) {\n condition = t.conditionalExpression(t.binaryExpression(\"===\", t.cloneDeep(disc), c.test), caseLocs[i] = this.loc(), condition);\n } else {\n caseLocs[i] = defaultLoc;\n }\n }\n\n var discriminant = path.get(\"discriminant\");\n util.replaceWithOrRemove(discriminant, condition);\n self.jump(self.explodeExpression(discriminant));\n self.leapManager.withEntry(new leap.SwitchEntry(after), function () {\n path.get(\"cases\").forEach(function (casePath) {\n var i = casePath.key;\n self.mark(caseLocs[i]);\n casePath.get(\"consequent\").forEach(function (path) {\n self.explodeStatement(path);\n });\n });\n });\n self.mark(after);\n\n if (defaultLoc.value === -1) {\n self.mark(defaultLoc);\n\n _assert[\"default\"].strictEqual(after.value, defaultLoc.value);\n }\n\n break;\n\n case \"IfStatement\":\n var elseLoc = stmt.alternate && this.loc();\n after = this.loc();\n self.jumpIfNot(self.explodeExpression(path.get(\"test\")), elseLoc || after);\n self.explodeStatement(path.get(\"consequent\"));\n\n if (elseLoc) {\n self.jump(after);\n self.mark(elseLoc);\n self.explodeStatement(path.get(\"alternate\"));\n }\n\n self.mark(after);\n break;\n\n case \"ReturnStatement\":\n self.emitAbruptCompletion({\n type: \"return\",\n value: self.explodeExpression(path.get(\"argument\"))\n });\n break;\n\n case \"WithStatement\":\n throw new Error(\"WithStatement not supported in generator functions.\");\n\n case \"TryStatement\":\n after = this.loc();\n var handler = stmt.handler;\n var catchLoc = handler && this.loc();\n var catchEntry = catchLoc && new leap.CatchEntry(catchLoc, handler.param);\n var finallyLoc = stmt.finalizer && this.loc();\n var finallyEntry = finallyLoc && new leap.FinallyEntry(finallyLoc, after);\n var tryEntry = new leap.TryEntry(self.getUnmarkedCurrentLoc(), catchEntry, finallyEntry);\n self.tryEntries.push(tryEntry);\n self.updateContextPrevLoc(tryEntry.firstLoc);\n self.leapManager.withEntry(tryEntry, function () {\n self.explodeStatement(path.get(\"block\"));\n\n if (catchLoc) {\n if (finallyLoc) {\n // If we have both a catch block and a finally block, then\n // because we emit the catch block first, we need to jump over\n // it to the finally block.\n self.jump(finallyLoc);\n } else {\n // If there is no finally block, then we need to jump over the\n // catch block to the fall-through location.\n self.jump(after);\n }\n\n self.updateContextPrevLoc(self.mark(catchLoc));\n var bodyPath = path.get(\"handler.body\");\n var safeParam = self.makeTempVar();\n self.clearPendingException(tryEntry.firstLoc, safeParam);\n bodyPath.traverse(catchParamVisitor, {\n getSafeParam: function getSafeParam() {\n return t.cloneDeep(safeParam);\n },\n catchParamName: handler.param.name\n });\n self.leapManager.withEntry(catchEntry, function () {\n self.explodeStatement(bodyPath);\n });\n }\n\n if (finallyLoc) {\n self.updateContextPrevLoc(self.mark(finallyLoc));\n self.leapManager.withEntry(finallyEntry, function () {\n self.explodeStatement(path.get(\"finalizer\"));\n });\n self.emit(t.returnStatement(t.callExpression(self.contextProperty(\"finish\"), [finallyEntry.firstLoc])));\n }\n });\n self.mark(after);\n break;\n\n case \"ThrowStatement\":\n self.emit(t.throwStatement(self.explodeExpression(path.get(\"argument\"))));\n break;\n\n default:\n throw new Error(\"unknown Statement of type \" + JSON.stringify(stmt.type));\n }\n};\n\nvar catchParamVisitor = {\n Identifier: function Identifier(path, state) {\n if (path.node.name === state.catchParamName && util.isReference(path)) {\n util.replaceWithOrRemove(path, state.getSafeParam());\n }\n },\n Scope: function Scope(path, state) {\n if (path.scope.hasOwnBinding(state.catchParamName)) {\n // Don't descend into nested scopes that shadow the catch\n // parameter with their own declarations.\n path.skip();\n }\n }\n};\n\nEp.emitAbruptCompletion = function (record) {\n if (!isValidCompletion(record)) {\n _assert[\"default\"].ok(false, \"invalid completion record: \" + JSON.stringify(record));\n }\n\n _assert[\"default\"].notStrictEqual(record.type, \"normal\", \"normal completions are not abrupt\");\n\n var t = util.getTypes();\n var abruptArgs = [t.stringLiteral(record.type)];\n\n if (record.type === \"break\" || record.type === \"continue\") {\n t.assertLiteral(record.target);\n abruptArgs[1] = this.insertedLocs.has(record.target) ? record.target : t.cloneDeep(record.target);\n } else if (record.type === \"return\" || record.type === \"throw\") {\n if (record.value) {\n t.assertExpression(record.value);\n abruptArgs[1] = this.insertedLocs.has(record.value) ? record.value : t.cloneDeep(record.value);\n }\n }\n\n this.emit(t.returnStatement(t.callExpression(this.contextProperty(\"abrupt\"), abruptArgs)));\n};\n\nfunction isValidCompletion(record) {\n var type = record.type;\n\n if (type === \"normal\") {\n return !hasOwn.call(record, \"target\");\n }\n\n if (type === \"break\" || type === \"continue\") {\n return !hasOwn.call(record, \"value\") && util.getTypes().isLiteral(record.target);\n }\n\n if (type === \"return\" || type === \"throw\") {\n return hasOwn.call(record, \"value\") && !hasOwn.call(record, \"target\");\n }\n\n return false;\n} // Not all offsets into emitter.listing are potential jump targets. For\n// example, execution typically falls into the beginning of a try block\n// without jumping directly there. This method returns the current offset\n// without marking it, so that a switch case will not necessarily be\n// generated for this offset (I say \"not necessarily\" because the same\n// location might end up being marked in the process of emitting other\n// statements). There's no logical harm in marking such locations as jump\n// targets, but minimizing the number of switch cases keeps the generated\n// code shorter.\n\n\nEp.getUnmarkedCurrentLoc = function () {\n return util.getTypes().numericLiteral(this.listing.length);\n}; // The context.prev property takes the value of context.next whenever we\n// evaluate the switch statement discriminant, which is generally good\n// enough for tracking the last location we jumped to, but sometimes\n// context.prev needs to be more precise, such as when we fall\n// successfully out of a try block and into a finally block without\n// jumping. This method exists to update context.prev to the freshest\n// available location. If we were implementing a full interpreter, we\n// would know the location of the current instruction with complete\n// precision at all times, but we don't have that luxury here, as it would\n// be costly and verbose to set context.prev before every statement.\n\n\nEp.updateContextPrevLoc = function (loc) {\n var t = util.getTypes();\n\n if (loc) {\n t.assertLiteral(loc);\n\n if (loc.value === -1) {\n // If an uninitialized location literal was passed in, set its value\n // to the current this.listing.length.\n loc.value = this.listing.length;\n } else {\n // Otherwise assert that the location matches the current offset.\n _assert[\"default\"].strictEqual(loc.value, this.listing.length);\n }\n } else {\n loc = this.getUnmarkedCurrentLoc();\n } // Make sure context.prev is up to date in case we fell into this try\n // statement without jumping to it. TODO Consider avoiding this\n // assignment when we know control must have jumped here.\n\n\n this.emitAssign(this.contextProperty(\"prev\"), loc);\n};\n\nEp.explodeExpression = function (path, ignoreResult) {\n var t = util.getTypes();\n var expr = path.node;\n\n if (expr) {\n t.assertExpression(expr);\n } else {\n return expr;\n }\n\n var self = this;\n var result; // Used optionally by several cases below.\n\n var after;\n\n function finish(expr) {\n t.assertExpression(expr);\n\n if (ignoreResult) {\n self.emit(expr);\n } else {\n return expr;\n }\n } // If the expression does not contain a leap, then we either emit the\n // expression as a standalone statement or return it whole.\n\n\n if (!meta.containsLeap(expr)) {\n return finish(expr);\n } // If any child contains a leap (such as a yield or labeled continue or\n // break statement), then any sibling subexpressions will almost\n // certainly have to be exploded in order to maintain the order of their\n // side effects relative to the leaping child(ren).\n\n\n var hasLeapingChildren = meta.containsLeap.onlyChildren(expr); // In order to save the rest of explodeExpression from a combinatorial\n // trainwreck of special cases, explodeViaTempVar is responsible for\n // deciding when a subexpression needs to be \"exploded,\" which is my\n // very technical term for emitting the subexpression as an assignment\n // to a temporary variable and the substituting the temporary variable\n // for the original subexpression. Think of exploded view diagrams, not\n // Michael Bay movies. The point of exploding subexpressions is to\n // control the precise order in which the generated code realizes the\n // side effects of those subexpressions.\n\n function explodeViaTempVar(tempVar, childPath, ignoreChildResult) {\n _assert[\"default\"].ok(!ignoreChildResult || !tempVar, \"Ignoring the result of a child expression but forcing it to \" + \"be assigned to a temporary variable?\");\n\n var result = self.explodeExpression(childPath, ignoreChildResult);\n\n if (ignoreChildResult) {// Side effects already emitted above.\n } else if (tempVar || hasLeapingChildren && !t.isLiteral(result)) {\n // If tempVar was provided, then the result will always be assigned\n // to it, even if the result does not otherwise need to be assigned\n // to a temporary variable. When no tempVar is provided, we have\n // the flexibility to decide whether a temporary variable is really\n // necessary. Unfortunately, in general, a temporary variable is\n // required whenever any child contains a yield expression, since it\n // is difficult to prove (at all, let alone efficiently) whether\n // this result would evaluate to the same value before and after the\n // yield (see #206). One narrow case where we can prove it doesn't\n // matter (and thus we do not need a temporary variable) is when the\n // result in question is a Literal value.\n result = self.emitAssign(tempVar || self.makeTempVar(), result);\n }\n\n return result;\n } // If ignoreResult is true, then we must take full responsibility for\n // emitting the expression with all its side effects, and we should not\n // return a result.\n\n\n switch (expr.type) {\n case \"MemberExpression\":\n return finish(t.memberExpression(self.explodeExpression(path.get(\"object\")), expr.computed ? explodeViaTempVar(null, path.get(\"property\")) : expr.property, expr.computed));\n\n case \"CallExpression\":\n var calleePath = path.get(\"callee\");\n var argsPath = path.get(\"arguments\");\n var newCallee;\n var newArgs = [];\n var hasLeapingArgs = false;\n argsPath.forEach(function (argPath) {\n hasLeapingArgs = hasLeapingArgs || meta.containsLeap(argPath.node);\n });\n\n if (t.isMemberExpression(calleePath.node)) {\n if (hasLeapingArgs) {\n // If the arguments of the CallExpression contained any yield\n // expressions, then we need to be sure to evaluate the callee\n // before evaluating the arguments, but if the callee was a member\n // expression, then we must be careful that the object of the\n // member expression still gets bound to `this` for the call.\n var newObject = explodeViaTempVar( // Assign the exploded callee.object expression to a temporary\n // variable so that we can use it twice without reevaluating it.\n self.makeTempVar(), calleePath.get(\"object\"));\n var newProperty = calleePath.node.computed ? explodeViaTempVar(null, calleePath.get(\"property\")) : calleePath.node.property;\n newArgs.unshift(newObject);\n newCallee = t.memberExpression(t.memberExpression(t.cloneDeep(newObject), newProperty, calleePath.node.computed), t.identifier(\"call\"), false);\n } else {\n newCallee = self.explodeExpression(calleePath);\n }\n } else {\n newCallee = explodeViaTempVar(null, calleePath);\n\n if (t.isMemberExpression(newCallee)) {\n // If the callee was not previously a MemberExpression, then the\n // CallExpression was \"unqualified,\" meaning its `this` object\n // should be the global object. If the exploded expression has\n // become a MemberExpression (e.g. a context property, probably a\n // temporary variable), then we need to force it to be unqualified\n // by using the (0, object.property)(...) trick; otherwise, it\n // will receive the object of the MemberExpression as its `this`\n // object.\n newCallee = t.sequenceExpression([t.numericLiteral(0), t.cloneDeep(newCallee)]);\n }\n }\n\n argsPath.forEach(function (argPath) {\n newArgs.push(explodeViaTempVar(null, argPath));\n });\n return finish(t.callExpression(newCallee, newArgs.map(function (arg) {\n return t.cloneDeep(arg);\n })));\n\n case \"NewExpression\":\n return finish(t.newExpression(explodeViaTempVar(null, path.get(\"callee\")), path.get(\"arguments\").map(function (argPath) {\n return explodeViaTempVar(null, argPath);\n })));\n\n case \"ObjectExpression\":\n return finish(t.objectExpression(path.get(\"properties\").map(function (propPath) {\n if (propPath.isObjectProperty()) {\n return t.objectProperty(propPath.node.key, explodeViaTempVar(null, propPath.get(\"value\")), propPath.node.computed);\n } else {\n return propPath.node;\n }\n })));\n\n case \"ArrayExpression\":\n return finish(t.arrayExpression(path.get(\"elements\").map(function (elemPath) {\n return explodeViaTempVar(null, elemPath);\n })));\n\n case \"SequenceExpression\":\n var lastIndex = expr.expressions.length - 1;\n path.get(\"expressions\").forEach(function (exprPath) {\n if (exprPath.key === lastIndex) {\n result = self.explodeExpression(exprPath, ignoreResult);\n } else {\n self.explodeExpression(exprPath, true);\n }\n });\n return result;\n\n case \"LogicalExpression\":\n after = this.loc();\n\n if (!ignoreResult) {\n result = self.makeTempVar();\n }\n\n var left = explodeViaTempVar(result, path.get(\"left\"));\n\n if (expr.operator === \"&&\") {\n self.jumpIfNot(left, after);\n } else {\n _assert[\"default\"].strictEqual(expr.operator, \"||\");\n\n self.jumpIf(left, after);\n }\n\n explodeViaTempVar(result, path.get(\"right\"), ignoreResult);\n self.mark(after);\n return result;\n\n case \"ConditionalExpression\":\n var elseLoc = this.loc();\n after = this.loc();\n var test = self.explodeExpression(path.get(\"test\"));\n self.jumpIfNot(test, elseLoc);\n\n if (!ignoreResult) {\n result = self.makeTempVar();\n }\n\n explodeViaTempVar(result, path.get(\"consequent\"), ignoreResult);\n self.jump(after);\n self.mark(elseLoc);\n explodeViaTempVar(result, path.get(\"alternate\"), ignoreResult);\n self.mark(after);\n return result;\n\n case \"UnaryExpression\":\n return finish(t.unaryExpression(expr.operator, // Can't (and don't need to) break up the syntax of the argument.\n // Think about delete a[b].\n self.explodeExpression(path.get(\"argument\")), !!expr.prefix));\n\n case \"BinaryExpression\":\n return finish(t.binaryExpression(expr.operator, explodeViaTempVar(null, path.get(\"left\")), explodeViaTempVar(null, path.get(\"right\"))));\n\n case \"AssignmentExpression\":\n if (expr.operator === \"=\") {\n // If this is a simple assignment, the left hand side does not need\n // to be read before the right hand side is evaluated, so we can\n // avoid the more complicated logic below.\n return finish(t.assignmentExpression(expr.operator, self.explodeExpression(path.get(\"left\")), self.explodeExpression(path.get(\"right\"))));\n }\n\n var lhs = self.explodeExpression(path.get(\"left\"));\n var temp = self.emitAssign(self.makeTempVar(), lhs); // For example,\n //\n // x += yield y\n //\n // becomes\n //\n // context.t0 = x\n // x = context.t0 += yield y\n //\n // so that the left-hand side expression is read before the yield.\n // Fixes https://github.com/facebook/regenerator/issues/345.\n\n return finish(t.assignmentExpression(\"=\", t.cloneDeep(lhs), t.assignmentExpression(expr.operator, t.cloneDeep(temp), self.explodeExpression(path.get(\"right\")))));\n\n case \"UpdateExpression\":\n return finish(t.updateExpression(expr.operator, self.explodeExpression(path.get(\"argument\")), expr.prefix));\n\n case \"YieldExpression\":\n after = this.loc();\n var arg = expr.argument && self.explodeExpression(path.get(\"argument\"));\n\n if (arg && expr.delegate) {\n var _result = self.makeTempVar();\n\n var _ret = t.returnStatement(t.callExpression(self.contextProperty(\"delegateYield\"), [arg, t.stringLiteral(_result.property.name), after]));\n\n _ret.loc = expr.loc;\n self.emit(_ret);\n self.mark(after);\n return _result;\n }\n\n self.emitAssign(self.contextProperty(\"next\"), after);\n var ret = t.returnStatement(t.cloneDeep(arg) || null); // Preserve the `yield` location so that source mappings for the statements\n // link back to the yield properly.\n\n ret.loc = expr.loc;\n self.emit(ret);\n self.mark(after);\n return self.contextProperty(\"sent\");\n\n default:\n throw new Error(\"unknown Expression of type \" + JSON.stringify(expr.type));\n }\n};","\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = replaceShorthandObjectMethod;\n\nvar util = _interopRequireWildcard(require(\"./util\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n// this function converts a shorthand object generator method into a normal\n// (non-shorthand) object property which is a generator function expression. for\n// example, this:\n//\n// var foo = {\n// *bar(baz) { return 5; }\n// }\n//\n// should be replaced with:\n//\n// var foo = {\n// bar: function*(baz) { return 5; }\n// }\n//\n// to do this, it clones the parameter array and the body of the object generator\n// method into a new FunctionExpression.\n//\n// this method can be passed any Function AST node path, and it will return\n// either:\n// a) the path that was passed in (iff the path did not need to be replaced) or\n// b) the path of the new FunctionExpression that was created as a replacement\n// (iff the path did need to be replaced)\n//\n// In either case, though, the caller can count on the fact that the return value\n// is a Function AST node path.\n//\n// If this function is called with an AST node path that is not a Function (or with an\n// argument that isn't an AST node path), it will throw an error.\nfunction replaceShorthandObjectMethod(path) {\n var t = util.getTypes();\n\n if (!path.node || !t.isFunction(path.node)) {\n throw new Error(\"replaceShorthandObjectMethod can only be called on Function AST node paths.\");\n } // this function only replaces shorthand object methods (called ObjectMethod\n // in Babel-speak).\n\n\n if (!t.isObjectMethod(path.node)) {\n return path;\n } // this function only replaces generators.\n\n\n if (!path.node.generator) {\n return path;\n }\n\n var parameters = path.node.params.map(function (param) {\n return t.cloneDeep(param);\n });\n var functionExpression = t.functionExpression(null, // id\n parameters, // params\n t.cloneDeep(path.node.body), // body\n path.node.generator, path.node.async);\n util.replaceWithOrRemove(path, t.objectProperty(t.cloneDeep(path.node.key), // key\n functionExpression, //value\n path.node.computed, // computed\n false // shorthand\n )); // path now refers to the ObjectProperty AST node path, but we want to return a\n // Function AST node path for the function expression we created. we know that\n // the FunctionExpression we just created is the value of the ObjectProperty,\n // so return the \"value\" path off of this path.\n\n return path.get(\"value\");\n}","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\"use strict\";\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar _hoist = require(\"./hoist\");\n\nvar _emit = require(\"./emit\");\n\nvar _replaceShorthandObjectMethod = _interopRequireDefault(require(\"./replaceShorthandObjectMethod\"));\n\nvar util = _interopRequireWildcard(require(\"./util\"));\n\nvar _private = require(\"private\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nexports.getVisitor = function (_ref) {\n var t = _ref.types;\n return {\n Method: function Method(path, state) {\n var node = path.node;\n if (!shouldRegenerate(node, state)) return;\n var container = t.functionExpression(null, [], t.cloneNode(node.body, false), node.generator, node.async);\n path.get(\"body\").set(\"body\", [t.returnStatement(t.callExpression(container, []))]); // Regardless of whether or not the wrapped function is a an async method\n // or generator the outer function should not be\n\n node.async = false;\n node.generator = false; // Unwrap the wrapper IIFE's environment so super and this and such still work.\n\n path.get(\"body.body.0.argument.callee\").unwrapFunctionEnvironment();\n },\n Function: {\n exit: util.wrapWithTypes(t, function (path, state) {\n var node = path.node;\n if (!shouldRegenerate(node, state)) return; // if this is an ObjectMethod, we need to convert it to an ObjectProperty\n\n path = (0, _replaceShorthandObjectMethod[\"default\"])(path);\n node = path.node;\n var contextId = path.scope.generateUidIdentifier(\"context\");\n var argsId = path.scope.generateUidIdentifier(\"args\");\n path.ensureBlock();\n var bodyBlockPath = path.get(\"body\");\n\n if (node.async) {\n bodyBlockPath.traverse(awaitVisitor);\n }\n\n bodyBlockPath.traverse(functionSentVisitor, {\n context: contextId\n });\n var outerBody = [];\n var innerBody = [];\n bodyBlockPath.get(\"body\").forEach(function (childPath) {\n var node = childPath.node;\n\n if (t.isExpressionStatement(node) && t.isStringLiteral(node.expression)) {\n // Babylon represents directives like \"use strict\" as elements\n // of a bodyBlockPath.node.directives array, but they could just\n // as easily be represented (by other parsers) as traditional\n // string-literal-valued expression statements, so we need to\n // handle that here. (#248)\n outerBody.push(node);\n } else if (node && node._blockHoist != null) {\n outerBody.push(node);\n } else {\n innerBody.push(node);\n }\n });\n\n if (outerBody.length > 0) {\n // Only replace the inner body if we actually hoisted any statements\n // to the outer body.\n bodyBlockPath.node.body = innerBody;\n }\n\n var outerFnExpr = getOuterFnExpr(path); // Note that getOuterFnExpr has the side-effect of ensuring that the\n // function has a name (so node.id will always be an Identifier), even\n // if a temporary name has to be synthesized.\n\n t.assertIdentifier(node.id);\n var innerFnId = t.identifier(node.id.name + \"$\"); // Turn all declarations into vars, and replace the original\n // declarations with equivalent assignment expressions.\n\n var vars = (0, _hoist.hoist)(path);\n var context = {\n usesThis: false,\n usesArguments: false,\n getArgsId: function getArgsId() {\n return t.clone(argsId);\n }\n };\n path.traverse(argumentsThisVisitor, context);\n\n if (context.usesArguments) {\n vars = vars || t.variableDeclaration(\"var\", []);\n var argumentIdentifier = t.identifier(\"arguments\"); // we need to do this as otherwise arguments in arrow functions gets hoisted\n\n argumentIdentifier._shadowedFunctionLiteral = path;\n vars.declarations.push(t.variableDeclarator(t.clone(argsId), argumentIdentifier));\n }\n\n var emitter = new _emit.Emitter(contextId);\n emitter.explode(path.get(\"body\"));\n\n if (vars && vars.declarations.length > 0) {\n outerBody.push(vars);\n }\n\n var wrapArgs = [emitter.getContextFunction(innerFnId)];\n var tryLocsList = emitter.getTryLocsList();\n\n if (node.generator) {\n wrapArgs.push(outerFnExpr);\n } else if (context.usesThis || tryLocsList) {\n // Async functions that are not generators don't care about the\n // outer function because they don't need it to be marked and don't\n // inherit from its .prototype.\n wrapArgs.push(t.nullLiteral());\n }\n\n if (context.usesThis) {\n wrapArgs.push(t.thisExpression());\n } else if (tryLocsList) {\n wrapArgs.push(t.nullLiteral());\n }\n\n if (tryLocsList) {\n wrapArgs.push(tryLocsList);\n }\n\n var wrapCall = t.callExpression(util.runtimeProperty(node.async ? \"async\" : \"wrap\"), wrapArgs);\n outerBody.push(t.returnStatement(wrapCall));\n node.body = t.blockStatement(outerBody); // We injected a few new variable declarations (for every hoisted var),\n // so we need to add them to the scope.\n\n path.get(\"body.body\").forEach(function (p) {\n return p.scope.registerDeclaration(p);\n });\n var oldDirectives = bodyBlockPath.node.directives;\n\n if (oldDirectives) {\n // Babylon represents directives like \"use strict\" as elements of\n // a bodyBlockPath.node.directives array. (#248)\n node.body.directives = oldDirectives;\n }\n\n var wasGeneratorFunction = node.generator;\n\n if (wasGeneratorFunction) {\n node.generator = false;\n }\n\n if (node.async) {\n node.async = false;\n }\n\n if (wasGeneratorFunction && t.isExpression(node)) {\n util.replaceWithOrRemove(path, t.callExpression(util.runtimeProperty(\"mark\"), [node]));\n path.addComment(\"leading\", \"#__PURE__\");\n }\n\n var insertedLocs = emitter.getInsertedLocs();\n path.traverse({\n NumericLiteral: function NumericLiteral(path) {\n if (!insertedLocs.has(path.node)) {\n return;\n }\n\n path.replaceWith(t.numericLiteral(path.node.value));\n }\n }); // Generators are processed in 'exit' handlers so that regenerator only has to run on\n // an ES5 AST, but that means traversal will not pick up newly inserted references\n // to things like 'regeneratorRuntime'. To avoid this, we explicitly requeue.\n\n path.requeue();\n })\n }\n };\n}; // Check if a node should be transformed by regenerator\n\n\nfunction shouldRegenerate(node, state) {\n if (node.generator) {\n if (node.async) {\n // Async generator\n return state.opts.asyncGenerators !== false;\n } else {\n // Plain generator\n return state.opts.generators !== false;\n }\n } else if (node.async) {\n // Async function\n return state.opts.async !== false;\n } else {\n // Not a generator or async function.\n return false;\n }\n} // Given a NodePath for a Function, return an Expression node that can be\n// used to refer reliably to the function object from inside the function.\n// This expression is essentially a replacement for arguments.callee, with\n// the key advantage that it works in strict mode.\n\n\nfunction getOuterFnExpr(funPath) {\n var t = util.getTypes();\n var node = funPath.node;\n t.assertFunction(node);\n\n if (!node.id) {\n // Default-exported function declarations, and function expressions may not\n // have a name to reference, so we explicitly add one.\n node.id = funPath.scope.parent.generateUidIdentifier(\"callee\");\n }\n\n if (node.generator && // Non-generator functions don't need to be marked.\n t.isFunctionDeclaration(node)) {\n // Return the identifier returned by runtime.mark().\n return getMarkedFunctionId(funPath);\n }\n\n return t.clone(node.id);\n}\n\nvar getMarkInfo = (0, _private.makeAccessor)();\n\nfunction getMarkedFunctionId(funPath) {\n var t = util.getTypes();\n var node = funPath.node;\n t.assertIdentifier(node.id);\n var blockPath = funPath.findParent(function (path) {\n return path.isProgram() || path.isBlockStatement();\n });\n\n if (!blockPath) {\n return node.id;\n }\n\n var block = blockPath.node;\n\n _assert[\"default\"].ok(Array.isArray(block.body));\n\n var info = getMarkInfo(block);\n\n if (!info.decl) {\n info.decl = t.variableDeclaration(\"var\", []);\n blockPath.unshiftContainer(\"body\", info.decl);\n info.declPath = blockPath.get(\"body.0\");\n }\n\n _assert[\"default\"].strictEqual(info.declPath.node, info.decl); // Get a new unique identifier for our marked variable.\n\n\n var markedId = blockPath.scope.generateUidIdentifier(\"marked\");\n var markCallExp = t.callExpression(util.runtimeProperty(\"mark\"), [t.clone(node.id)]);\n var index = info.decl.declarations.push(t.variableDeclarator(markedId, markCallExp)) - 1;\n var markCallExpPath = info.declPath.get(\"declarations.\" + index + \".init\");\n\n _assert[\"default\"].strictEqual(markCallExpPath.node, markCallExp);\n\n markCallExpPath.addComment(\"leading\", \"#__PURE__\");\n return t.clone(markedId);\n}\n\nvar argumentsThisVisitor = {\n \"FunctionExpression|FunctionDeclaration|Method\": function FunctionExpressionFunctionDeclarationMethod(path) {\n path.skip();\n },\n Identifier: function Identifier(path, state) {\n if (path.node.name === \"arguments\" && util.isReference(path)) {\n util.replaceWithOrRemove(path, state.getArgsId());\n state.usesArguments = true;\n }\n },\n ThisExpression: function ThisExpression(path, state) {\n state.usesThis = true;\n }\n};\nvar functionSentVisitor = {\n MetaProperty: function MetaProperty(path) {\n var node = path.node;\n\n if (node.meta.name === \"function\" && node.property.name === \"sent\") {\n var t = util.getTypes();\n util.replaceWithOrRemove(path, t.memberExpression(t.clone(this.context), t.identifier(\"_sent\")));\n }\n }\n};\nvar awaitVisitor = {\n Function: function Function(path) {\n path.skip(); // Don't descend into nested function scopes.\n },\n AwaitExpression: function AwaitExpression(path) {\n var t = util.getTypes(); // Convert await expressions to yield expressions.\n\n var argument = path.node.argument; // Transforming `await x` to `yield regeneratorRuntime.awrap(x)`\n // causes the argument to be wrapped in such a way that the runtime\n // can distinguish between awaited and merely yielded values.\n\n util.replaceWithOrRemove(path, t.yieldExpression(t.callExpression(util.runtimeProperty(\"awrap\"), [argument]), false));\n }\n};","\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = _default;\n\nvar _visit = require(\"./visit\");\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction _default(context) {\n var plugin = {\n visitor: (0, _visit.getVisitor)(context)\n }; // Some presets manually call child presets, but fail to pass along the\n // context object. Out of an abundance of caution, we verify that it\n // exists first to avoid causing unnecessary breaking changes.\n\n var version = context && context.version; // The \"name\" property is not allowed in older versions of Babel (6.x)\n // and will cause the plugin validator to throw an exception.\n\n if (version && parseInt(version, 10) >= 7) {\n plugin.name = \"regenerator-transform\";\n }\n\n return plugin;\n}","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-reserved-words\",\n\n visitor: {\n \"BindingIdentifier|ReferencedIdentifier\"(path) {\n if (!t.isValidES3Identifier(path.node.name)) {\n path.scope.rename(path.node.name);\n }\n },\n },\n };\n});\n","module.exports = function () {\n // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi\n var origPrepareStackTrace = Error.prepareStackTrace;\n Error.prepareStackTrace = function (_, stack) { return stack; };\n var stack = (new Error()).stack;\n Error.prepareStackTrace = origPrepareStackTrace;\n return stack[2].getFileName();\n};\n","'use strict';\n\nvar isWindows = process.platform === 'win32';\n\n// Regex to split a windows path into three parts: [*, device, slash,\n// tail] windows-only\nvar splitDeviceRe =\n /^([a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?([\\\\\\/])?([\\s\\S]*?)$/;\n\n// Regex to split the tail part of the above into [*, dir, basename, ext]\nvar splitTailRe =\n /^([\\s\\S]*?)((?:\\.{1,2}|[^\\\\\\/]+?|)(\\.[^.\\/\\\\]*|))(?:[\\\\\\/]*)$/;\n\nvar win32 = {};\n\n// Function to split a filename into [root, dir, basename, ext]\nfunction win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}\n\nwin32.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = win32SplitPath(pathString);\n if (!allParts || allParts.length !== 4) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n return {\n root: allParts[0],\n dir: allParts[0] + allParts[1].slice(0, -1),\n base: allParts[2],\n ext: allParts[3],\n name: allParts[2].slice(0, allParts[2].length - allParts[3].length)\n };\n};\n\n\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar posix = {};\n\n\nfunction posixSplitPath(filename) {\n return splitPathRe.exec(filename).slice(1);\n}\n\n\nposix.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = posixSplitPath(pathString);\n if (!allParts || allParts.length !== 4) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n allParts[1] = allParts[1] || '';\n allParts[2] = allParts[2] || '';\n allParts[3] = allParts[3] || '';\n\n return {\n root: allParts[0],\n dir: allParts[0] + allParts[1].slice(0, -1),\n base: allParts[2],\n ext: allParts[3],\n name: allParts[2].slice(0, allParts[2].length - allParts[3].length)\n };\n};\n\n\nif (isWindows)\n module.exports = win32.parse;\nelse /* posix */\n module.exports = posix.parse;\n\nmodule.exports.posix = posix.parse;\nmodule.exports.win32 = win32.parse;\n","var path = require('path');\nvar parse = path.parse || require('path-parse');\n\nvar getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {\n var prefix = '/';\n if ((/^([A-Za-z]:)/).test(absoluteStart)) {\n prefix = '';\n } else if ((/^\\\\\\\\/).test(absoluteStart)) {\n prefix = '\\\\\\\\';\n }\n\n var paths = [absoluteStart];\n var parsed = parse(absoluteStart);\n while (parsed.dir !== paths[paths.length - 1]) {\n paths.push(parsed.dir);\n parsed = parse(parsed.dir);\n }\n\n return paths.reduce(function (dirs, aPath) {\n return dirs.concat(modules.map(function (moduleDir) {\n return path.resolve(prefix, aPath, moduleDir);\n }));\n }, []);\n};\n\nmodule.exports = function nodeModulesPaths(start, opts, request) {\n var modules = opts && opts.moduleDirectory\n ? [].concat(opts.moduleDirectory)\n : ['node_modules'];\n\n if (opts && typeof opts.paths === 'function') {\n return opts.paths(\n request,\n start,\n function () { return getNodeModulesDirs(start, modules); },\n opts\n );\n }\n\n var dirs = getNodeModulesDirs(start, modules);\n return opts && opts.paths ? dirs.concat(opts.paths) : dirs;\n};\n","module.exports = function (x, opts) {\n /**\n * This file is purposefully a passthrough. It's expected that third-party\n * environments will override it at runtime in order to inject special logic\n * into `resolve` (by manipulating the options). One such example is the PnP\n * code path in Yarn.\n */\n\n return opts || {};\n};\n","var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];\n\nfunction specifierIncluded(specifier) {\n var parts = specifier.split(' ');\n var op = parts.length > 1 ? parts[0] : '=';\n var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');\n\n for (var i = 0; i < 3; ++i) {\n var cur = Number(current[i] || 0);\n var ver = Number(versionParts[i] || 0);\n if (cur === ver) {\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n }\n if (op === '<') {\n return cur < ver;\n } else if (op === '>=') {\n return cur >= ver;\n } else {\n return false;\n }\n }\n return op === '>=';\n}\n\nfunction matchesRange(range) {\n var specifiers = range.split(/ ?&& ?/);\n if (specifiers.length === 0) { return false; }\n for (var i = 0; i < specifiers.length; ++i) {\n if (!specifierIncluded(specifiers[i])) { return false; }\n }\n return true;\n}\n\nfunction versionIncluded(specifierValue) {\n if (typeof specifierValue === 'boolean') { return specifierValue; }\n if (specifierValue && typeof specifierValue === 'object') {\n for (var i = 0; i < specifierValue.length; ++i) {\n if (matchesRange(specifierValue[i])) { return true; }\n }\n return false;\n }\n return matchesRange(specifierValue);\n}\n\nvar data = require('./core.json');\n\nvar core = {};\nfor (var mod in data) { // eslint-disable-line no-restricted-syntax\n if (Object.prototype.hasOwnProperty.call(data, mod)) {\n core[mod] = versionIncluded(data[mod]);\n }\n}\nmodule.exports = core;\n","var core = require('./core');\n\nmodule.exports = function isCore(x) {\n return Object.prototype.hasOwnProperty.call(core, x);\n};\n","var fs = require('fs');\nvar path = require('path');\nvar caller = require('./caller.js');\nvar nodeModulesPaths = require('./node-modules-paths.js');\nvar normalizeOptions = require('./normalize-options.js');\nvar isCore = require('./is-core');\n\nvar defaultIsFile = function isFile(file, cb) {\n fs.stat(file, function (err, stat) {\n if (!err) {\n return cb(null, stat.isFile() || stat.isFIFO());\n }\n if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);\n return cb(err);\n });\n};\n\nvar defaultIsDir = function isDirectory(dir, cb) {\n fs.stat(dir, function (err, stat) {\n if (!err) {\n return cb(null, stat.isDirectory());\n }\n if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);\n return cb(err);\n });\n};\n\nvar maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts, cb) {\n if (opts && opts.preserveSymlinks === false) {\n fs.realpath(x, function (realPathErr, realPath) {\n if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);\n else cb(null, realPathErr ? x : realPath);\n });\n } else {\n cb(null, x);\n }\n};\n\nmodule.exports = function resolve(x, options, callback) {\n var cb = callback;\n var opts = options;\n if (typeof options === 'function') {\n cb = opts;\n opts = {};\n }\n if (typeof x !== 'string') {\n var err = new TypeError('Path must be a string.');\n return process.nextTick(function () {\n cb(err);\n });\n }\n\n opts = normalizeOptions(x, opts);\n\n var isFile = opts.isFile || defaultIsFile;\n var isDirectory = opts.isDirectory || defaultIsDir;\n var readFile = opts.readFile || fs.readFile;\n\n var extensions = opts.extensions || ['.js'];\n var basedir = opts.basedir || path.dirname(caller());\n var parent = opts.filename || basedir;\n\n opts.paths = opts.paths || [];\n\n // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory\n var absoluteStart = path.resolve(basedir);\n\n maybeUnwrapSymlink(\n absoluteStart,\n opts,\n function (err, realStart) {\n if (err) cb(err);\n else init(realStart);\n }\n );\n\n var res;\n function init(basedir) {\n if ((/^(?:\\.\\.?(?:\\/|$)|\\/|([A-Za-z]:)?[/\\\\])/).test(x)) {\n res = path.resolve(basedir, x);\n if (x === '..' || x.slice(-1) === '/') res += '/';\n if ((/\\/$/).test(x) && res === basedir) {\n loadAsDirectory(res, opts.package, onfile);\n } else loadAsFile(res, opts.package, onfile);\n } else if (isCore(x)) {\n return cb(null, x);\n } else loadNodeModules(x, basedir, function (err, n, pkg) {\n if (err) cb(err);\n else if (n) {\n return maybeUnwrapSymlink(n, opts, function (err, realN) {\n if (err) {\n cb(err);\n } else {\n cb(null, realN, pkg);\n }\n });\n } else {\n var moduleError = new Error(\"Cannot find module '\" + x + \"' from '\" + parent + \"'\");\n moduleError.code = 'MODULE_NOT_FOUND';\n cb(moduleError);\n }\n });\n }\n\n function onfile(err, m, pkg) {\n if (err) cb(err);\n else if (m) cb(null, m, pkg);\n else loadAsDirectory(res, function (err, d, pkg) {\n if (err) cb(err);\n else if (d) {\n maybeUnwrapSymlink(d, opts, function (err, realD) {\n if (err) {\n cb(err);\n } else {\n cb(null, realD, pkg);\n }\n });\n } else {\n var moduleError = new Error(\"Cannot find module '\" + x + \"' from '\" + parent + \"'\");\n moduleError.code = 'MODULE_NOT_FOUND';\n cb(moduleError);\n }\n });\n }\n\n function loadAsFile(x, thePackage, callback) {\n var loadAsFilePackage = thePackage;\n var cb = callback;\n if (typeof loadAsFilePackage === 'function') {\n cb = loadAsFilePackage;\n loadAsFilePackage = undefined;\n }\n\n var exts = [''].concat(extensions);\n load(exts, x, loadAsFilePackage);\n\n function load(exts, x, loadPackage) {\n if (exts.length === 0) return cb(null, undefined, loadPackage);\n var file = x + exts[0];\n\n var pkg = loadPackage;\n if (pkg) onpkg(null, pkg);\n else loadpkg(path.dirname(file), onpkg);\n\n function onpkg(err, pkg_, dir) {\n pkg = pkg_;\n if (err) return cb(err);\n if (dir && pkg && opts.pathFilter) {\n var rfile = path.relative(dir, file);\n var rel = rfile.slice(0, rfile.length - exts[0].length);\n var r = opts.pathFilter(pkg, x, rel);\n if (r) return load(\n [''].concat(extensions.slice()),\n path.resolve(dir, r),\n pkg\n );\n }\n isFile(file, onex);\n }\n function onex(err, ex) {\n if (err) return cb(err);\n if (ex) return cb(null, file, pkg);\n load(exts.slice(1), x, pkg);\n }\n }\n }\n\n function loadpkg(dir, cb) {\n if (dir === '' || dir === '/') return cb(null);\n if (process.platform === 'win32' && (/^\\w:[/\\\\]*$/).test(dir)) {\n return cb(null);\n }\n if ((/[/\\\\]node_modules[/\\\\]*$/).test(dir)) return cb(null);\n\n maybeUnwrapSymlink(dir, opts, function (unwrapErr, pkgdir) {\n if (unwrapErr) return loadpkg(path.dirname(dir), cb);\n var pkgfile = path.join(pkgdir, 'package.json');\n isFile(pkgfile, function (err, ex) {\n // on err, ex is false\n if (!ex) return loadpkg(path.dirname(dir), cb);\n\n readFile(pkgfile, function (err, body) {\n if (err) cb(err);\n try { var pkg = JSON.parse(body); } catch (jsonErr) {}\n\n if (pkg && opts.packageFilter) {\n pkg = opts.packageFilter(pkg, pkgfile);\n }\n cb(null, pkg, dir);\n });\n });\n });\n }\n\n function loadAsDirectory(x, loadAsDirectoryPackage, callback) {\n var cb = callback;\n var fpkg = loadAsDirectoryPackage;\n if (typeof fpkg === 'function') {\n cb = fpkg;\n fpkg = opts.package;\n }\n\n maybeUnwrapSymlink(x, opts, function (unwrapErr, pkgdir) {\n if (unwrapErr) return cb(unwrapErr);\n var pkgfile = path.join(pkgdir, 'package.json');\n isFile(pkgfile, function (err, ex) {\n if (err) return cb(err);\n if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb);\n\n readFile(pkgfile, function (err, body) {\n if (err) return cb(err);\n try {\n var pkg = JSON.parse(body);\n } catch (jsonErr) {}\n\n if (pkg && opts.packageFilter) {\n pkg = opts.packageFilter(pkg, pkgfile);\n }\n\n if (pkg && pkg.main) {\n if (typeof pkg.main !== 'string') {\n var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');\n mainError.code = 'INVALID_PACKAGE_MAIN';\n return cb(mainError);\n }\n if (pkg.main === '.' || pkg.main === './') {\n pkg.main = 'index';\n }\n loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {\n if (err) return cb(err);\n if (m) return cb(null, m, pkg);\n if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb);\n\n var dir = path.resolve(x, pkg.main);\n loadAsDirectory(dir, pkg, function (err, n, pkg) {\n if (err) return cb(err);\n if (n) return cb(null, n, pkg);\n loadAsFile(path.join(x, 'index'), pkg, cb);\n });\n });\n return;\n }\n\n loadAsFile(path.join(x, '/index'), pkg, cb);\n });\n });\n });\n }\n\n function processDirs(cb, dirs) {\n if (dirs.length === 0) return cb(null, undefined);\n var dir = dirs[0];\n\n isDirectory(dir, isdir);\n\n function isdir(err, isdir) {\n if (err) return cb(err);\n if (!isdir) return processDirs(cb, dirs.slice(1));\n var file = path.join(dir, x);\n loadAsFile(file, opts.package, onfile);\n }\n\n function onfile(err, m, pkg) {\n if (err) return cb(err);\n if (m) return cb(null, m, pkg);\n loadAsDirectory(path.join(dir, x), opts.package, ondir);\n }\n\n function ondir(err, n, pkg) {\n if (err) return cb(err);\n if (n) return cb(null, n, pkg);\n processDirs(cb, dirs.slice(1));\n }\n }\n function loadNodeModules(x, start, cb) {\n processDirs(cb, nodeModulesPaths(start, opts, x));\n }\n};\n","var isCore = require('./is-core');\nvar fs = require('fs');\nvar path = require('path');\nvar caller = require('./caller.js');\nvar nodeModulesPaths = require('./node-modules-paths.js');\nvar normalizeOptions = require('./normalize-options.js');\n\nvar defaultIsFile = function isFile(file) {\n try {\n var stat = fs.statSync(file);\n } catch (e) {\n if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;\n throw e;\n }\n return stat.isFile() || stat.isFIFO();\n};\n\nvar defaultIsDir = function isDirectory(dir) {\n try {\n var stat = fs.statSync(dir);\n } catch (e) {\n if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;\n throw e;\n }\n return stat.isDirectory();\n};\n\nvar maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts) {\n if (opts && opts.preserveSymlinks === false) {\n try {\n return fs.realpathSync(x);\n } catch (realPathErr) {\n if (realPathErr.code !== 'ENOENT') {\n throw realPathErr;\n }\n }\n }\n return x;\n};\n\nmodule.exports = function (x, options) {\n if (typeof x !== 'string') {\n throw new TypeError('Path must be a string.');\n }\n var opts = normalizeOptions(x, options);\n\n var isFile = opts.isFile || defaultIsFile;\n var readFileSync = opts.readFileSync || fs.readFileSync;\n var isDirectory = opts.isDirectory || defaultIsDir;\n\n var extensions = opts.extensions || ['.js'];\n var basedir = opts.basedir || path.dirname(caller());\n var parent = opts.filename || basedir;\n\n opts.paths = opts.paths || [];\n\n // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory\n var absoluteStart = maybeUnwrapSymlink(path.resolve(basedir), opts);\n\n if ((/^(?:\\.\\.?(?:\\/|$)|\\/|([A-Za-z]:)?[/\\\\])/).test(x)) {\n var res = path.resolve(absoluteStart, x);\n if (x === '..' || x.slice(-1) === '/') res += '/';\n var m = loadAsFileSync(res) || loadAsDirectorySync(res);\n if (m) return maybeUnwrapSymlink(m, opts);\n } else if (isCore(x)) {\n return x;\n } else {\n var n = loadNodeModulesSync(x, absoluteStart);\n if (n) return maybeUnwrapSymlink(n, opts);\n }\n\n var err = new Error(\"Cannot find module '\" + x + \"' from '\" + parent + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n\n function loadAsFileSync(x) {\n var pkg = loadpkg(path.dirname(x));\n\n if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {\n var rfile = path.relative(pkg.dir, x);\n var r = opts.pathFilter(pkg.pkg, x, rfile);\n if (r) {\n x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign\n }\n }\n\n if (isFile(x)) {\n return x;\n }\n\n for (var i = 0; i < extensions.length; i++) {\n var file = x + extensions[i];\n if (isFile(file)) {\n return file;\n }\n }\n }\n\n function loadpkg(dir) {\n if (dir === '' || dir === '/') return;\n if (process.platform === 'win32' && (/^\\w:[/\\\\]*$/).test(dir)) {\n return;\n }\n if ((/[/\\\\]node_modules[/\\\\]*$/).test(dir)) return;\n\n var pkgfile = path.join(maybeUnwrapSymlink(dir, opts), 'package.json');\n\n if (!isFile(pkgfile)) {\n return loadpkg(path.dirname(dir));\n }\n\n var body = readFileSync(pkgfile);\n\n try {\n var pkg = JSON.parse(body);\n } catch (jsonErr) {}\n\n if (pkg && opts.packageFilter) {\n // v2 will pass pkgfile\n pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment\n }\n\n return { pkg: pkg, dir: dir };\n }\n\n function loadAsDirectorySync(x) {\n var pkgfile = path.join(maybeUnwrapSymlink(x, opts), '/package.json');\n if (isFile(pkgfile)) {\n try {\n var body = readFileSync(pkgfile, 'UTF8');\n var pkg = JSON.parse(body);\n } catch (e) {}\n\n if (pkg && opts.packageFilter) {\n // v2 will pass pkgfile\n pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment\n }\n\n if (pkg && pkg.main) {\n if (typeof pkg.main !== 'string') {\n var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');\n mainError.code = 'INVALID_PACKAGE_MAIN';\n throw mainError;\n }\n if (pkg.main === '.' || pkg.main === './') {\n pkg.main = 'index';\n }\n try {\n var m = loadAsFileSync(path.resolve(x, pkg.main));\n if (m) return m;\n var n = loadAsDirectorySync(path.resolve(x, pkg.main));\n if (n) return n;\n } catch (e) {}\n }\n }\n\n return loadAsFileSync(path.join(x, '/index'));\n }\n\n function loadNodeModulesSync(x, start) {\n var dirs = nodeModulesPaths(start, opts, x);\n for (var i = 0; i < dirs.length; i++) {\n var dir = dirs[i];\n if (isDirectory(dir)) {\n var m = loadAsFileSync(path.join(dir, '/', x));\n if (m) return m;\n var n = loadAsDirectorySync(path.join(dir, '/', x));\n if (n) return n;\n }\n }\n }\n};\n","var async = require('./lib/async');\nasync.core = require('./lib/core');\nasync.isCore = require('./lib/is-core');\nasync.sync = require('./lib/sync');\n\nexports = async;\nmodule.exports = async;\n","import semver from \"semver\";\nimport { types as t } from \"@babel/core\";\n\nexport function hasMinVersion(minVersion, runtimeVersion) {\n // If the range is unavailable, we're running the script during Babel's\n // build process, and we want to assume that all versions are satisfied so\n // that the built output will include all definitions.\n if (!runtimeVersion) return true;\n\n // semver.intersects() has some surprising behavior with comparing ranges\n // with preprelease versions. We add '^' to ensure that we are always\n // comparing ranges with ranges, which sidesteps this logic.\n // For example:\n //\n // semver.intersects(`<7.0.1`, \"7.0.0-beta.0\") // false - surprising\n // semver.intersects(`<7.0.1`, \"^7.0.0-beta.0\") // true - expected\n //\n // This is because the first falls back to\n //\n // semver.satisfies(\"7.0.0-beta.0\", `<7.0.1`) // false - surprising\n //\n // and this fails because a prerelease version can only satisfy a range\n // if it is a prerelease within the same major/minor/patch range.\n //\n // Note: If this is found to have issues, please also revisit the logic in\n // babel-core's availableHelper() API.\n if (semver.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`;\n\n return (\n !semver.intersects(`<${minVersion}`, runtimeVersion) &&\n !semver.intersects(`>=8.0.0`, runtimeVersion)\n );\n}\n\n// Note: We can't use NodePath#couldBeBaseType because it doesn't support arrays.\n// Even if we added support for arrays, this package needs to be compatible with\n// ^7.0.0 so we can't rely on it.\nexport function typeAnnotationToString(node) {\n switch (node.type) {\n case \"GenericTypeAnnotation\":\n if (t.isIdentifier(node.id, { name: \"Array\" })) return \"array\";\n break;\n case \"StringTypeAnnotation\":\n return \"string\";\n }\n}\n","import { hasMinVersion } from \"./helpers\";\n\nexport default runtimeVersion => {\n // Conditionally include 'Math' because it was not included in the 7.0.0\n // release of '@babel/runtime'. See issue https://github.com/babel/babel/pull/8616.\n const includeMathModule = hasMinVersion(\"7.0.1\", runtimeVersion);\n\n return {\n BuiltIns: {\n Symbol: { stable: true, path: \"symbol\" },\n Promise: { stable: true, path: \"promise\" },\n Map: { stable: true, path: \"map\" },\n WeakMap: { stable: true, path: \"weak-map\" },\n Set: { stable: true, path: \"set\" },\n WeakSet: { stable: true, path: \"weak-set\" },\n setImmediate: { stable: true, path: \"set-immediate\" },\n clearImmediate: { stable: true, path: \"clear-immediate\" },\n parseFloat: { stable: true, path: \"parse-float\" },\n parseInt: { stable: true, path: \"parse-int\" },\n },\n\n StaticProperties: {\n Array: {\n from: { stable: true, path: \"array/from\" },\n isArray: { stable: true, path: \"array/is-array\" },\n of: { stable: true, path: \"array/of\" },\n },\n\n JSON: {\n stringify: { stable: true, path: \"json/stringify\" },\n },\n\n Object: {\n assign: { stable: true, path: \"object/assign\" },\n create: { stable: true, path: \"object/create\" },\n defineProperties: { stable: true, path: \"object/define-properties\" },\n defineProperty: { stable: true, path: \"object/define-property\" },\n entries: { stable: true, path: \"object/entries\" },\n freeze: { stable: true, path: \"object/freeze\" },\n getOwnPropertyDescriptor: {\n stable: true,\n path: \"object/get-own-property-descriptor\",\n },\n getOwnPropertyDescriptors: {\n stable: true,\n path: \"object/get-own-property-descriptors\",\n },\n getOwnPropertyNames: {\n stable: true,\n path: \"object/get-own-property-names\",\n },\n getOwnPropertySymbols: {\n stable: true,\n path: \"object/get-own-property-symbols\",\n },\n getPrototypeOf: { stable: true, path: \"object/get-prototype-of\" },\n isExtensible: { stable: true, path: \"object/is-extensible\" },\n isFrozen: { stable: true, path: \"object/is-frozen\" },\n isSealed: { stable: true, path: \"object/is-sealed\" },\n is: { stable: true, path: \"object/is\" },\n keys: { stable: true, path: \"object/keys\" },\n preventExtensions: { stable: true, path: \"object/prevent-extensions\" },\n seal: { stable: true, path: \"object/seal\" },\n setPrototypeOf: { stable: true, path: \"object/set-prototype-of\" },\n values: { stable: true, path: \"object/values\" },\n },\n\n ...(includeMathModule\n ? {\n Math: {\n acosh: { stable: true, path: \"math/acosh\" },\n asinh: { stable: true, path: \"math/asinh\" },\n atanh: { stable: true, path: \"math/atanh\" },\n cbrt: { stable: true, path: \"math/cbrt\" },\n clz32: { stable: true, path: \"math/clz32\" },\n cosh: { stable: true, path: \"math/cosh\" },\n expm1: { stable: true, path: \"math/expm1\" },\n fround: { stable: true, path: \"math/fround\" },\n hypot: { stable: true, path: \"math/hypot\" },\n imul: { stable: true, path: \"math/imul\" },\n log10: { stable: true, path: \"math/log10\" },\n log1p: { stable: true, path: \"math/log1p\" },\n log2: { stable: true, path: \"math/log2\" },\n sign: { stable: true, path: \"math/sign\" },\n sinh: { stable: true, path: \"math/sinh\" },\n tanh: { stable: true, path: \"math/tanh\" },\n trunc: { stable: true, path: \"math/trunc\" },\n },\n }\n : {}),\n\n Symbol: {\n // FIXME: Disabled to work around zloirock/core-js#262.\n // asyncIterator: { stable: true, path: \"symbol/async-iterator\" },\n for: { stable: true, path: \"symbol/for\" },\n hasInstance: { stable: true, path: \"symbol/has-instance\" },\n isConcatSpreadable: {\n stable: true,\n path: \"symbol/is-concat-spreadable\",\n },\n iterator: { stable: true, path: \"symbol/iterator\" },\n keyFor: { stable: true, path: \"symbol/key-for\" },\n match: { stable: true, path: \"symbol/match\" },\n replace: { stable: true, path: \"symbol/replace\" },\n search: { stable: true, path: \"symbol/search\" },\n species: { stable: true, path: \"symbol/species\" },\n split: { stable: true, path: \"symbol/split\" },\n toPrimitive: { stable: true, path: \"symbol/to-primitive\" },\n toStringTag: { stable: true, path: \"symbol/to-string-tag\" },\n unscopables: { stable: true, path: \"symbol/unscopables\" },\n },\n\n String: {\n at: { stable: true, path: \"string/at\" },\n fromCodePoint: { stable: true, path: \"string/from-code-point\" },\n raw: { stable: true, path: \"string/raw\" },\n },\n\n Number: {\n EPSILON: { stable: true, path: \"number/epsilon\" },\n isFinite: { stable: true, path: \"number/is-finite\" },\n isInteger: { stable: true, path: \"number/is-integer\" },\n isNaN: { stable: true, path: \"number/is-nan\" },\n isSafeInteger: { stable: true, path: \"number/is-safe-integer\" },\n MAX_SAFE_INTEGER: { stable: true, path: \"number/max-safe-integer\" },\n MIN_SAFE_INTEGER: { stable: true, path: \"number/min-safe-integer\" },\n parseFloat: { stable: true, path: \"number/parse-float\" },\n parseInt: { stable: true, path: \"number/parse-int\" },\n },\n\n Reflect: {\n apply: { stable: true, path: \"reflect/apply\" },\n construct: { stable: true, path: \"reflect/construct\" },\n defineProperty: { stable: true, path: \"reflect/define-property\" },\n deleteProperty: { stable: true, path: \"reflect/delete-property\" },\n getOwnPropertyDescriptor: {\n stable: true,\n path: \"reflect/get-own-property-descriptor\",\n },\n getPrototypeOf: { stable: true, path: \"reflect/get-prototype-of\" },\n get: { stable: true, path: \"reflect/get\" },\n has: { stable: true, path: \"reflect/has\" },\n isExtensible: { stable: true, path: \"reflect/is-extensible\" },\n ownKeys: { stable: true, path: \"reflect/own-keys\" },\n preventExtensions: { stable: true, path: \"reflect/prevent-extensions\" },\n setPrototypeOf: { stable: true, path: \"reflect/set-prototype-of\" },\n set: { stable: true, path: \"reflect/set\" },\n },\n\n Date: {\n now: { stable: true, path: \"date/now\" },\n },\n },\n };\n};\n","export default () => {\n return {\n BuiltIns: {\n AggregateError: { stable: false, path: \"aggregate-error\" },\n Map: { stable: true, path: \"map\" },\n Observable: { stable: false, path: \"observable\" },\n Promise: { stable: true, path: \"promise\" },\n Set: { stable: true, path: \"set\" },\n Symbol: { stable: true, path: \"symbol\" },\n URL: { stable: true, path: \"url\" },\n URLSearchParams: { stable: true, path: \"url-search-params\" },\n WeakMap: { stable: true, path: \"weak-map\" },\n WeakSet: { stable: true, path: \"weak-set\" },\n clearImmediate: { stable: true, path: \"clear-immediate\" },\n compositeKey: { stable: false, path: \"composite-key\" },\n compositeSymbol: { stable: false, path: \"composite-symbol\" },\n globalThis: { stable: false, path: \"global-this\" },\n parseFloat: { stable: true, path: \"parse-float\" },\n parseInt: { stable: true, path: \"parse-int\" },\n queueMicrotask: { stable: true, path: \"queue-microtask\" },\n setImmediate: { stable: true, path: \"set-immediate\" },\n setInterval: { stable: true, path: \"set-interval\" },\n setTimeout: { stable: true, path: \"set-timeout\" },\n },\n\n StaticProperties: {\n Array: {\n from: { stable: true, path: \"array/from\" },\n isArray: { stable: true, path: \"array/is-array\" },\n of: { stable: true, path: \"array/of\" },\n },\n\n Date: {\n now: { stable: true, path: \"date/now\" },\n },\n\n JSON: {\n stringify: { stable: true, path: \"json/stringify\" },\n },\n\n Math: {\n DEG_PER_RAD: { stable: false, path: \"math/deg-per-rad\" },\n RAD_PER_DEG: { stable: false, path: \"math/rad-per-deg\" },\n acosh: { stable: true, path: \"math/acosh\" },\n asinh: { stable: true, path: \"math/asinh\" },\n atanh: { stable: true, path: \"math/atanh\" },\n cbrt: { stable: true, path: \"math/cbrt\" },\n clamp: { stable: false, path: \"math/clamp\" },\n clz32: { stable: true, path: \"math/clz32\" },\n cosh: { stable: true, path: \"math/cosh\" },\n degrees: { stable: false, path: \"math/degrees\" },\n expm1: { stable: true, path: \"math/expm1\" },\n fround: { stable: true, path: \"math/fround\" },\n fscale: { stable: false, path: \"math/fscale\" },\n hypot: { stable: true, path: \"math/hypot\" },\n iaddh: { stable: false, path: \"math/iaddh\" },\n imul: { stable: true, path: \"math/imul\" },\n imulh: { stable: false, path: \"math/imulh\" },\n isubh: { stable: false, path: \"math/isubh\" },\n log10: { stable: true, path: \"math/log10\" },\n log1p: { stable: true, path: \"math/log1p\" },\n log2: { stable: true, path: \"math/log2\" },\n radians: { stable: false, path: \"math/radians\" },\n scale: { stable: false, path: \"math/scale\" },\n seededPRNG: { stable: false, path: \"math/seeded-prng\" },\n sign: { stable: true, path: \"math/sign\" },\n signbit: { stable: false, path: \"math/signbit\" },\n sinh: { stable: true, path: \"math/sinh\" },\n tanh: { stable: true, path: \"math/tanh\" },\n trunc: { stable: true, path: \"math/trunc\" },\n umulh: { stable: false, path: \"math/umulh\" },\n },\n\n Number: {\n EPSILON: { stable: true, path: \"number/epsilon\" },\n MAX_SAFE_INTEGER: { stable: true, path: \"number/max-safe-integer\" },\n MIN_SAFE_INTEGER: { stable: true, path: \"number/min-safe-integer\" },\n fromString: { stable: false, path: \"number/from-string\" },\n isFinite: { stable: true, path: \"number/is-finite\" },\n isInteger: { stable: true, path: \"number/is-integer\" },\n isNaN: { stable: true, path: \"number/is-nan\" },\n isSafeInteger: { stable: true, path: \"number/is-safe-integer\" },\n parseFloat: { stable: true, path: \"number/parse-float\" },\n parseInt: { stable: true, path: \"number/parse-int\" },\n },\n\n Object: {\n assign: { stable: true, path: \"object/assign\" },\n create: { stable: true, path: \"object/create\" },\n defineProperties: { stable: true, path: \"object/define-properties\" },\n defineProperty: { stable: true, path: \"object/define-property\" },\n entries: { stable: true, path: \"object/entries\" },\n freeze: { stable: true, path: \"object/freeze\" },\n fromEntries: { stable: true, path: \"object/from-entries\" },\n getOwnPropertyDescriptor: {\n stable: true,\n path: \"object/get-own-property-descriptor\",\n },\n getOwnPropertyDescriptors: {\n stable: true,\n path: \"object/get-own-property-descriptors\",\n },\n getOwnPropertyNames: {\n stable: true,\n path: \"object/get-own-property-names\",\n },\n getOwnPropertySymbols: {\n stable: true,\n path: \"object/get-own-property-symbols\",\n },\n getPrototypeOf: { stable: true, path: \"object/get-prototype-of\" },\n isExtensible: { stable: true, path: \"object/is-extensible\" },\n isFrozen: { stable: true, path: \"object/is-frozen\" },\n isSealed: { stable: true, path: \"object/is-sealed\" },\n is: { stable: true, path: \"object/is\" },\n keys: { stable: true, path: \"object/keys\" },\n preventExtensions: { stable: true, path: \"object/prevent-extensions\" },\n seal: { stable: true, path: \"object/seal\" },\n setPrototypeOf: { stable: true, path: \"object/set-prototype-of\" },\n values: { stable: true, path: \"object/values\" },\n },\n\n Reflect: {\n apply: { stable: true, path: \"reflect/apply\" },\n construct: { stable: true, path: \"reflect/construct\" },\n defineMetadata: { stable: false, path: \"reflect/define-metadata\" },\n defineProperty: { stable: true, path: \"reflect/define-property\" },\n deleteMetadata: { stable: false, path: \"reflect/delete-metadata\" },\n deleteProperty: { stable: true, path: \"reflect/delete-property\" },\n getMetadata: { stable: false, path: \"reflect/get-metadata\" },\n getMetadataKeys: { stable: false, path: \"reflect/get-metadata-keys\" },\n getOwnMetadata: { stable: false, path: \"reflect/get-own-metadata\" },\n getOwnMetadataKeys: {\n stable: false,\n path: \"reflect/get-own-metadata-keys\",\n },\n getOwnPropertyDescriptor: {\n stable: true,\n path: \"reflect/get-own-property-descriptor\",\n },\n getPrototypeOf: { stable: true, path: \"reflect/get-prototype-of\" },\n get: { stable: true, path: \"reflect/get\" },\n has: { stable: true, path: \"reflect/has\" },\n hasMetadata: { stable: false, path: \"reflect/has-metadata\" },\n hasOwnMetadata: { stable: false, path: \"reflect/has-own-metadata\" },\n isExtensible: { stable: true, path: \"reflect/is-extensible\" },\n metadata: { stable: false, path: \"reflect/metadata\" },\n ownKeys: { stable: true, path: \"reflect/own-keys\" },\n preventExtensions: { stable: true, path: \"reflect/prevent-extensions\" },\n set: { stable: true, path: \"reflect/set\" },\n setPrototypeOf: { stable: true, path: \"reflect/set-prototype-of\" },\n },\n\n String: {\n fromCodePoint: { stable: true, path: \"string/from-code-point\" },\n raw: { stable: true, path: \"string/raw\" },\n },\n\n Symbol: {\n asyncIterator: { stable: true, path: \"symbol/async-iterator\" },\n dispose: { stable: false, path: \"symbol/dispose\" },\n for: { stable: true, path: \"symbol/for\" },\n hasInstance: { stable: true, path: \"symbol/has-instance\" },\n isConcatSpreadable: {\n stable: true,\n path: \"symbol/is-concat-spreadable\",\n },\n iterator: { stable: true, path: \"symbol/iterator\" },\n keyFor: { stable: true, path: \"symbol/key-for\" },\n match: { stable: true, path: \"symbol/match\" },\n observable: { stable: false, path: \"symbol/observable\" },\n patternMatch: { stable: false, path: \"symbol/pattern-match\" },\n replace: { stable: true, path: \"symbol/replace\" },\n search: { stable: true, path: \"symbol/search\" },\n species: { stable: true, path: \"symbol/species\" },\n split: { stable: true, path: \"symbol/split\" },\n toPrimitive: { stable: true, path: \"symbol/to-primitive\" },\n toStringTag: { stable: true, path: \"symbol/to-string-tag\" },\n unscopables: { stable: true, path: \"symbol/unscopables\" },\n },\n },\n\n // NOTE: You can specify the object types whose method needs to be polyfilled.\n // e.g. concat: { types: [\"array\"] }\n // See ./helpers.js@typeAnnotationToString for the supported types\n\n InstanceProperties: {\n at: { stable: false, path: \"at\" },\n bind: { stable: true, path: \"bind\" },\n codePointAt: { stable: true, path: \"code-point-at\" },\n codePoints: { stable: false, path: \"code-points\" },\n concat: { stable: true, path: \"concat\", types: [\"array\"] },\n copyWithin: { stable: true, path: \"copy-within\" },\n endsWith: { stable: true, path: \"ends-with\" },\n entries: { stable: true, path: \"entries\" },\n every: { stable: true, path: \"every\" },\n fill: { stable: true, path: \"fill\" },\n filter: { stable: true, path: \"filter\" },\n find: { stable: true, path: \"find\" },\n findIndex: { stable: true, path: \"find-index\" },\n flags: { stable: true, path: \"flags\" },\n flatMap: { stable: true, path: \"flat-map\" },\n flat: { stable: true, path: \"flat\" },\n forEach: { stable: true, path: \"for-each\" },\n includes: { stable: true, path: \"includes\" },\n indexOf: { stable: true, path: \"index-of\" },\n keys: { stable: true, path: \"keys\" },\n lastIndexOf: { stable: true, path: \"last-index-of\" },\n map: { stable: true, path: \"map\" },\n matchAll: { stable: false, path: \"match-all\" },\n padEnd: { stable: true, path: \"pad-end\" },\n padStart: { stable: true, path: \"pad-start\" },\n reduce: { stable: true, path: \"reduce\" },\n reduceRight: { stable: true, path: \"reduce-right\" },\n repeat: { stable: true, path: \"repeat\" },\n replaceAll: { stable: false, path: \"replace-all\" },\n reverse: { stable: true, path: \"reverse\" },\n slice: { stable: true, path: \"slice\" },\n some: { stable: true, path: \"some\" },\n sort: { stable: true, path: \"sort\" },\n splice: { stable: true, path: \"splice\" },\n startsWith: { stable: true, path: \"starts-with\" },\n trim: { stable: true, path: \"trim\" },\n trimEnd: { stable: true, path: \"trim-end\" },\n trimLeft: { stable: true, path: \"trim-left\" },\n trimRight: { stable: true, path: \"trim-right\" },\n trimStart: { stable: true, path: \"trim-start\" },\n values: { stable: true, path: \"values\" },\n },\n };\n};\n","import path from \"path\";\nimport resolve from \"resolve\";\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport { addDefault, isModule } from \"@babel/helper-module-imports\";\nimport { types as t } from \"@babel/core\";\n\nimport getCoreJS2Definitions from \"./runtime-corejs2-definitions\";\nimport getCoreJS3Definitions from \"./runtime-corejs3-definitions\";\nimport { typeAnnotationToString } from \"./helpers\";\n\nfunction resolveAbsoluteRuntime(moduleName: string, dirname: string) {\n try {\n return path.dirname(\n resolve.sync(`${moduleName}/package.json`, { basedir: dirname }),\n );\n } catch (err) {\n if (err.code !== \"MODULE_NOT_FOUND\") throw err;\n\n throw Object.assign(\n new Error(`Failed to resolve \"${moduleName}\" relative to \"${dirname}\"`),\n {\n code: \"BABEL_RUNTIME_NOT_FOUND\",\n runtime: moduleName,\n dirname,\n },\n );\n }\n}\n\nfunction supportsStaticESM(caller) {\n return !!(caller && caller.supportsStaticESM);\n}\n\nexport default declare((api, options, dirname) => {\n api.assertVersion(7);\n\n const {\n corejs,\n helpers: useRuntimeHelpers = true,\n regenerator: useRuntimeRegenerator = true,\n useESModules = false,\n version: runtimeVersion = \"7.0.0-beta.0\",\n absoluteRuntime = false,\n } = options;\n\n let proposals = false;\n let rawVersion;\n\n if (typeof corejs === \"object\" && corejs !== null) {\n rawVersion = corejs.version;\n proposals = Boolean(corejs.proposals);\n } else {\n rawVersion = corejs;\n }\n\n const corejsVersion = rawVersion ? Number(rawVersion) : false;\n\n if (![false, 2, 3].includes(corejsVersion)) {\n throw new Error(\n `The \\`core-js\\` version must be false, 2 or 3, but got ${JSON.stringify(\n rawVersion,\n )}.`,\n );\n }\n\n if (proposals && (!corejsVersion || corejsVersion < 3)) {\n throw new Error(\n \"The 'proposals' option is only supported when using 'corejs: 3'\",\n );\n }\n\n if (typeof useRuntimeRegenerator !== \"boolean\") {\n throw new Error(\n \"The 'regenerator' option must be undefined, or a boolean.\",\n );\n }\n\n if (typeof useRuntimeHelpers !== \"boolean\") {\n throw new Error(\"The 'helpers' option must be undefined, or a boolean.\");\n }\n\n if (typeof useESModules !== \"boolean\" && useESModules !== \"auto\") {\n throw new Error(\n \"The 'useESModules' option must be undefined, or a boolean, or 'auto'.\",\n );\n }\n\n if (\n typeof absoluteRuntime !== \"boolean\" &&\n typeof absoluteRuntime !== \"string\"\n ) {\n throw new Error(\n \"The 'absoluteRuntime' option must be undefined, a boolean, or a string.\",\n );\n }\n\n if (typeof runtimeVersion !== \"string\") {\n throw new Error(`The 'version' option must be a version string.`);\n }\n\n function has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n\n function hasMapping(methods, name) {\n return has(methods, name) && (proposals || methods[name].stable);\n }\n\n function hasStaticMapping(object, method) {\n return (\n has(StaticProperties, object) &&\n hasMapping(StaticProperties[object], method)\n );\n }\n\n function isNamespaced(path) {\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return false;\n return binding.path.isImportNamespaceSpecifier();\n }\n\n function maybeNeedsPolyfill(path, methods, name) {\n if (isNamespaced(path.get(\"object\"))) return false;\n if (!methods[name].types) return true;\n\n const typeAnnotation = path.get(\"object\").getTypeAnnotation();\n const type = typeAnnotationToString(typeAnnotation);\n if (!type) return true;\n\n return methods[name].types.some(name => name === type);\n }\n\n function resolvePropertyName(path, computed) {\n const { node } = path;\n if (!computed) return node.name;\n if (path.isStringLiteral()) return node.value;\n const result = path.evaluate();\n return result.value;\n }\n\n if (has(options, \"useBuiltIns\")) {\n if (options.useBuiltIns) {\n throw new Error(\n \"The 'useBuiltIns' option has been removed. The @babel/runtime \" +\n \"module now uses builtins by default.\",\n );\n } else {\n throw new Error(\n \"The 'useBuiltIns' option has been removed. Use the 'corejs'\" +\n \"option to polyfill with `core-js` via @babel/runtime.\",\n );\n }\n }\n\n if (has(options, \"polyfill\")) {\n if (options.polyfill === false) {\n throw new Error(\n \"The 'polyfill' option has been removed. The @babel/runtime \" +\n \"module now skips polyfilling by default.\",\n );\n } else {\n throw new Error(\n \"The 'polyfill' option has been removed. Use the 'corejs'\" +\n \"option to polyfill with `core-js` via @babel/runtime.\",\n );\n }\n }\n\n if (has(options, \"moduleName\")) {\n throw new Error(\n \"The 'moduleName' option has been removed. @babel/transform-runtime \" +\n \"no longer supports arbitrary runtimes. If you were using this to \" +\n \"set an absolute path for Babel's standard runtimes, please use the \" +\n \"'absoluteRuntime' option.\",\n );\n }\n\n const esModules =\n useESModules === \"auto\" ? api.caller(supportsStaticESM) : useESModules;\n\n const injectCoreJS2 = corejsVersion === 2;\n const injectCoreJS3 = corejsVersion === 3;\n const injectCoreJS = corejsVersion !== false;\n\n const moduleName = injectCoreJS3\n ? \"@babel/runtime-corejs3\"\n : injectCoreJS2\n ? \"@babel/runtime-corejs2\"\n : \"@babel/runtime\";\n\n const corejsRoot = injectCoreJS3 && !proposals ? \"core-js-stable\" : \"core-js\";\n\n const { BuiltIns, StaticProperties, InstanceProperties } = (injectCoreJS2\n ? getCoreJS2Definitions\n : getCoreJS3Definitions)(runtimeVersion);\n\n const HEADER_HELPERS = [\"interopRequireWildcard\", \"interopRequireDefault\"];\n\n let modulePath = moduleName;\n if (absoluteRuntime !== false) {\n modulePath = resolveAbsoluteRuntime(\n moduleName,\n path.resolve(dirname, absoluteRuntime === true ? \".\" : absoluteRuntime),\n );\n }\n\n return {\n name: \"transform-runtime\",\n\n pre(file) {\n if (useRuntimeHelpers) {\n file.set(\"helperGenerator\", name => {\n // If the helper didn't exist yet at the version given, we bail\n // out and let Babel either insert it directly, or throw an error\n // so that plugins can handle that case properly.\n if (\n file.availableHelper &&\n !file.availableHelper(name, runtimeVersion)\n ) {\n return;\n }\n\n const isInteropHelper = HEADER_HELPERS.indexOf(name) !== -1;\n\n // Explicitly set the CommonJS interop helpers to their reserve\n // blockHoist of 4 so they are guaranteed to exist\n // when other things used them to import.\n const blockHoist =\n isInteropHelper && !isModule(file.path) ? 4 : undefined;\n\n const helpersDir =\n esModules && file.path.node.sourceType === \"module\"\n ? \"helpers/esm\"\n : \"helpers\";\n\n return this.addDefaultImport(\n `${modulePath}/${helpersDir}/${name}`,\n name,\n blockHoist,\n );\n });\n }\n\n const cache = new Map();\n\n this.addDefaultImport = (source, nameHint, blockHoist) => {\n // If something on the page adds a helper when the file is an ES6\n // file, we can't reused the cached helper name after things have been\n // transformed because it has almost certainly been renamed.\n const cacheKey = isModule(file.path);\n const key = `${source}:${nameHint}:${cacheKey || \"\"}`;\n\n let cached = cache.get(key);\n if (cached) {\n cached = t.cloneNode(cached);\n } else {\n cached = addDefault(file.path, source, {\n importedInterop: \"uncompiled\",\n nameHint,\n blockHoist,\n });\n\n cache.set(key, cached);\n }\n return cached;\n };\n },\n\n visitor: {\n ReferencedIdentifier(path) {\n const { node, parent, scope } = path;\n const { name } = node;\n\n // transform `regeneratorRuntime`\n if (name === \"regeneratorRuntime\" && useRuntimeRegenerator) {\n path.replaceWith(\n this.addDefaultImport(\n `${modulePath}/regenerator`,\n \"regeneratorRuntime\",\n ),\n );\n return;\n }\n\n if (!injectCoreJS) return;\n\n if (t.isMemberExpression(parent)) return;\n if (!hasMapping(BuiltIns, name)) return;\n if (scope.getBindingIdentifier(name)) return;\n\n // transform global built-ins like `Symbol()`, `new Promise`\n path.replaceWith(\n this.addDefaultImport(\n `${modulePath}/${corejsRoot}/${BuiltIns[name].path}`,\n name,\n ),\n );\n },\n\n CallExpression(path) {\n if (!injectCoreJS) return;\n\n const { node } = path;\n const { callee } = node;\n\n if (!t.isMemberExpression(callee)) return;\n\n const { object } = callee;\n const propertyName = resolvePropertyName(\n path.get(\"callee.property\"),\n callee.computed,\n );\n\n // transform calling instance methods like `something.includes()`\n if (injectCoreJS3 && !hasStaticMapping(object.name, propertyName)) {\n if (\n hasMapping(InstanceProperties, propertyName) &&\n maybeNeedsPolyfill(\n path.get(\"callee\"),\n InstanceProperties,\n propertyName,\n )\n ) {\n let context1, context2;\n if (t.isIdentifier(object)) {\n context1 = object;\n context2 = t.cloneNode(object);\n } else {\n context1 = path.scope.generateDeclaredUidIdentifier(\"context\");\n context2 = t.assignmentExpression(\"=\", context1, object);\n }\n node.callee = t.memberExpression(\n t.callExpression(\n this.addDefaultImport(\n `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,\n `${propertyName}InstanceProperty`,\n ),\n [context2],\n ),\n t.identifier(\"call\"),\n );\n node.arguments.unshift(context1);\n return;\n }\n }\n // we can't compile this\n if (node.arguments.length) return;\n if (!callee.computed) return;\n if (!path.get(\"callee.property\").matchesPattern(\"Symbol.iterator\")) {\n return;\n }\n\n // transform `something[Symbol.iterator]()` to calling `getIterator(something)` helper\n path.replaceWith(\n t.callExpression(\n this.addDefaultImport(\n `${modulePath}/core-js/get-iterator`,\n \"getIterator\",\n ),\n [object],\n ),\n );\n },\n\n // transform `Symbol.iterator in something` to calling `isIterable(something)` helper\n BinaryExpression(path) {\n if (!injectCoreJS) return;\n if (path.node.operator !== \"in\") return;\n if (!path.get(\"left\").matchesPattern(\"Symbol.iterator\")) return;\n\n path.replaceWith(\n t.callExpression(\n this.addDefaultImport(\n `${modulePath}/core-js/is-iterable`,\n \"isIterable\",\n ),\n [path.node.right],\n ),\n );\n },\n\n // transform static built-ins methods like `Array.from`\n MemberExpression: {\n enter(path) {\n if (!injectCoreJS) return;\n if (!path.isReferenced()) return;\n\n const { node } = path;\n const { object } = node;\n\n if (!t.isReferenced(object, node)) return;\n\n // transform `something[Symbol.iterator]` to calling `getIteratorMethod(something)` helper\n if (\n !injectCoreJS2 &&\n node.computed &&\n path.get(\"property\").matchesPattern(\"Symbol.iterator\")\n ) {\n path.replaceWith(\n t.callExpression(\n this.addDefaultImport(\n `${moduleName}/core-js/get-iterator-method`,\n \"getIteratorMethod\",\n ),\n [object],\n ),\n );\n return;\n }\n\n const objectName = object.name;\n const propertyName = resolvePropertyName(\n path.get(\"property\"),\n node.computed,\n );\n // doesn't reference the global\n if (\n path.scope.getBindingIdentifier(objectName) ||\n !hasStaticMapping(objectName, propertyName)\n ) {\n // transform getting of instance methods like `method = something.includes`\n if (\n injectCoreJS3 &&\n hasMapping(InstanceProperties, propertyName) &&\n maybeNeedsPolyfill(path, InstanceProperties, propertyName)\n ) {\n path.replaceWith(\n t.callExpression(\n this.addDefaultImport(\n `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,\n `${propertyName}InstanceProperty`,\n ),\n [object],\n ),\n );\n }\n return;\n }\n\n path.replaceWith(\n this.addDefaultImport(\n `${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}`,\n `${objectName}$${propertyName}`,\n ),\n );\n },\n\n exit(path) {\n if (!injectCoreJS) return;\n if (!path.isReferenced()) return;\n if (path.node.computed) return;\n\n const { node } = path;\n const { object } = node;\n const { name } = object;\n\n if (!hasMapping(BuiltIns, name)) return;\n if (path.scope.getBindingIdentifier(name)) return;\n\n path.replaceWith(\n t.memberExpression(\n this.addDefaultImport(\n `${modulePath}/${corejsRoot}/${BuiltIns[name].path}`,\n name,\n ),\n node.property,\n ),\n );\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-shorthand-properties\",\n\n visitor: {\n ObjectMethod(path) {\n const { node } = path;\n if (node.kind === \"method\") {\n const func = t.functionExpression(\n null,\n node.params,\n node.body,\n node.generator,\n node.async,\n );\n func.returnType = node.returnType;\n\n path.replaceWith(t.objectProperty(node.key, func, node.computed));\n }\n },\n\n ObjectProperty({ node }) {\n if (node.shorthand) {\n node.shorthand = false;\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose } = options;\n\n function getSpreadLiteral(spread, scope) {\n if (loose && !t.isIdentifier(spread.argument, { name: \"arguments\" })) {\n return spread.argument;\n } else {\n return scope.toArray(spread.argument, true);\n }\n }\n\n function hasSpread(nodes) {\n for (let i = 0; i < nodes.length; i++) {\n if (t.isSpreadElement(nodes[i])) {\n return true;\n }\n }\n return false;\n }\n\n function push(_props, nodes) {\n if (!_props.length) return _props;\n nodes.push(t.arrayExpression(_props));\n return [];\n }\n\n function build(props: Array, scope) {\n const nodes = [];\n let _props = [];\n\n for (const prop of props) {\n if (t.isSpreadElement(prop)) {\n _props = push(_props, nodes);\n nodes.push(getSpreadLiteral(prop, scope));\n } else {\n _props.push(prop);\n }\n }\n\n push(_props, nodes);\n\n return nodes;\n }\n\n return {\n name: \"transform-spread\",\n\n visitor: {\n ArrayExpression(path) {\n const { node, scope } = path;\n const elements = node.elements;\n if (!hasSpread(elements)) return;\n\n const nodes = build(elements, scope);\n let first = nodes[0];\n\n // If there is only one element in the ArrayExpression and\n // the element was transformed (Array.prototype.slice.call or toConsumableArray)\n // we know that the transformed code already takes care of cloning the array.\n // So we can simply return that element.\n if (nodes.length === 1 && first !== elements[0].argument) {\n path.replaceWith(first);\n return;\n }\n\n // If the first element is a ArrayExpression we can directly call\n // concat on it.\n // `[..].concat(..)`\n // If not then we have to use `[].concat(arr)` and not `arr.concat`\n // because `arr` could be extended/modified (e.g. Immutable) and we do not know exactly\n // what concat would produce.\n if (!t.isArrayExpression(first)) {\n first = t.arrayExpression([]);\n } else {\n nodes.shift();\n }\n\n path.replaceWith(\n t.callExpression(\n t.memberExpression(first, t.identifier(\"concat\")),\n nodes,\n ),\n );\n },\n\n CallExpression(path) {\n const { node, scope } = path;\n\n const args = node.arguments;\n if (!hasSpread(args)) return;\n\n const calleePath = path.get(\"callee\");\n if (calleePath.isSuper()) return;\n\n let contextLiteral = scope.buildUndefinedNode();\n\n node.arguments = [];\n\n let nodes;\n if (args.length === 1 && args[0].argument.name === \"arguments\") {\n nodes = [args[0].argument];\n } else {\n nodes = build(args, scope);\n }\n\n const first = nodes.shift();\n if (nodes.length) {\n node.arguments.push(\n t.callExpression(\n t.memberExpression(first, t.identifier(\"concat\")),\n nodes,\n ),\n );\n } else {\n node.arguments.push(first);\n }\n\n const callee = node.callee;\n\n if (calleePath.isMemberExpression()) {\n const temp = scope.maybeGenerateMemoised(callee.object);\n if (temp) {\n callee.object = t.assignmentExpression(\"=\", temp, callee.object);\n contextLiteral = temp;\n } else {\n contextLiteral = t.cloneNode(callee.object);\n }\n t.appendToMemberExpression(callee, t.identifier(\"apply\"));\n } else {\n node.callee = t.memberExpression(node.callee, t.identifier(\"apply\"));\n }\n\n if (t.isSuper(contextLiteral)) {\n contextLiteral = t.thisExpression();\n }\n\n node.arguments.unshift(t.cloneNode(contextLiteral));\n },\n\n NewExpression(path) {\n const { node, scope } = path;\n let args = node.arguments;\n if (!hasSpread(args)) return;\n\n const nodes = build(args, scope);\n\n const first = nodes.shift();\n\n if (nodes.length) {\n args = t.callExpression(\n t.memberExpression(first, t.identifier(\"concat\")),\n nodes,\n );\n } else {\n args = first;\n }\n\n path.replaceWith(\n t.callExpression(path.hub.addHelper(\"construct\"), [\n node.callee,\n args,\n ]),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport * as regex from \"@babel/helper-regex\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-sticky-regex\",\n\n visitor: {\n RegExpLiteral(path) {\n const { node } = path;\n if (!regex.is(node, \"y\")) return;\n\n path.replaceWith(\n t.newExpression(t.identifier(\"RegExp\"), [\n t.stringLiteral(node.pattern),\n t.stringLiteral(node.flags),\n ]),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-strict-mode\",\n\n visitor: {\n Program(path) {\n const { node } = path;\n\n for (const directive of (node.directives: Array)) {\n if (directive.value.value === \"use strict\") return;\n }\n\n path.unshiftContainer(\n \"directives\",\n t.directive(t.directiveLiteral(\"use strict\")),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { template, types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n const { loose } = options;\n\n let helperName = \"taggedTemplateLiteral\";\n if (loose) helperName += \"Loose\";\n\n /**\n * This function groups the objects into multiple calls to `.concat()` in\n * order to preserve execution order of the primitive conversion, e.g.\n *\n * \"\".concat(obj.foo, \"foo\", obj2.foo, \"foo2\")\n *\n * would evaluate both member expressions _first_ then, `concat` will\n * convert each one to a primitive, whereas\n *\n * \"\".concat(obj.foo, \"foo\").concat(obj2.foo, \"foo2\")\n *\n * would evaluate the member, then convert it to a primitive, then evaluate\n * the second member and convert that one, which reflects the spec behavior\n * of template literals.\n */\n function buildConcatCallExpressions(items) {\n let avail = true;\n return items.reduce(function(left, right) {\n let canBeInserted = t.isLiteral(right);\n\n if (!canBeInserted && avail) {\n canBeInserted = true;\n avail = false;\n }\n if (canBeInserted && t.isCallExpression(left)) {\n left.arguments.push(right);\n return left;\n }\n return t.callExpression(\n t.memberExpression(left, t.identifier(\"concat\")),\n [right],\n );\n });\n }\n\n return {\n name: \"transform-template-literals\",\n\n visitor: {\n TaggedTemplateExpression(path) {\n const { node } = path;\n const { quasi } = node;\n\n const strings = [];\n const raws = [];\n\n // Flag variable to check if contents of strings and raw are equal\n let isStringsRawEqual = true;\n\n for (const elem of (quasi.quasis: Array)) {\n const { raw, cooked } = elem.value;\n const value =\n cooked == null\n ? path.scope.buildUndefinedNode()\n : t.stringLiteral(cooked);\n\n strings.push(value);\n raws.push(t.stringLiteral(raw));\n\n if (raw !== cooked) {\n // false even if one of raw and cooked are not equal\n isStringsRawEqual = false;\n }\n }\n\n const scope = path.scope.getProgramParent();\n const templateObject = scope.generateUidIdentifier(\"templateObject\");\n\n const helperId = this.addHelper(helperName);\n const callExpressionInput = [t.arrayExpression(strings)];\n\n // only add raw arrayExpression if there is any difference between raws and strings\n if (!isStringsRawEqual) {\n callExpressionInput.push(t.arrayExpression(raws));\n }\n\n const lazyLoad = template.ast`\n function ${templateObject}() {\n const data = ${t.callExpression(helperId, callExpressionInput)};\n ${templateObject} = function() { return data };\n return data;\n } \n `;\n\n scope.path.unshiftContainer(\"body\", lazyLoad);\n path.replaceWith(\n t.callExpression(node.tag, [\n t.callExpression(t.cloneNode(templateObject), []),\n ...quasi.expressions,\n ]),\n );\n },\n\n TemplateLiteral(path) {\n const nodes = [];\n const expressions = path.get(\"expressions\");\n\n let index = 0;\n for (const elem of (path.node.quasis: Array)) {\n if (elem.value.cooked) {\n nodes.push(t.stringLiteral(elem.value.cooked));\n }\n\n if (index < expressions.length) {\n const expr = expressions[index++];\n const node = expr.node;\n if (!t.isStringLiteral(node, { value: \"\" })) {\n nodes.push(node);\n }\n }\n }\n\n // since `+` is left-to-right associative\n // ensure the first node is a string if first/second isn't\n const considerSecondNode = !loose || !t.isStringLiteral(nodes[1]);\n if (!t.isStringLiteral(nodes[0]) && considerSecondNode) {\n nodes.unshift(t.stringLiteral(\"\"));\n }\n let root = nodes[0];\n\n if (loose) {\n for (let i = 1; i < nodes.length; i++) {\n root = t.binaryExpression(\"+\", root, nodes[i]);\n }\n } else if (nodes.length > 1) {\n root = buildConcatCallExpressions(nodes);\n }\n\n path.replaceWith(root);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-typeof-symbol\",\n\n visitor: {\n Scope({ scope }) {\n if (!scope.getBinding(\"Symbol\")) {\n return;\n }\n\n scope.rename(\"Symbol\");\n },\n\n UnaryExpression(path) {\n const { node, parent } = path;\n if (node.operator !== \"typeof\") return;\n\n if (\n path.parentPath.isBinaryExpression() &&\n t.EQUALITY_BINARY_OPERATORS.indexOf(parent.operator) >= 0\n ) {\n // optimise `typeof foo === \"string\"` since we can determine that they'll never\n // need to handle symbols\n const opposite = path.getOpposite();\n if (\n opposite.isLiteral() &&\n opposite.node.value !== \"symbol\" &&\n opposite.node.value !== \"object\"\n ) {\n return;\n }\n }\n\n const helper = this.addHelper(\"typeof\");\n const isUnderHelper = path.findParent(path => {\n return (\n (path.isVariableDeclarator() && path.node.id === helper) ||\n (path.isFunctionDeclaration() &&\n path.node.id &&\n path.node.id.name === helper.name)\n );\n });\n\n if (isUnderHelper) {\n return;\n }\n\n const call = t.callExpression(helper, [node.argument]);\n const arg = path.get(\"argument\");\n if (arg.isIdentifier() && !path.scope.hasBinding(arg.node.name, true)) {\n const unary = t.unaryExpression(\"typeof\", t.cloneNode(node.argument));\n path.replaceWith(\n t.conditionalExpression(\n t.binaryExpression(\"===\", unary, t.stringLiteral(\"undefined\")),\n t.stringLiteral(\"undefined\"),\n call,\n ),\n );\n } else {\n path.replaceWith(call);\n }\n },\n },\n };\n});\n","import assert from \"assert\";\nimport { template } from \"@babel/core\";\n\nexport default function transpileEnum(path, t) {\n const { node } = path;\n if (node.declare) {\n path.remove();\n return;\n }\n\n if (node.const) {\n throw path.buildCodeFrameError(\"'const' enums are not supported.\");\n }\n\n const name = node.id.name;\n const fill = enumFill(path, t, node.id);\n\n switch (path.parent.type) {\n case \"BlockStatement\":\n case \"ExportNamedDeclaration\":\n case \"Program\": {\n path.insertAfter(fill);\n if (seen(path.parentPath)) {\n path.remove();\n } else {\n const isGlobal = t.isProgram(path.parent); // && !path.parent.body.some(t.isModuleDeclaration);\n path.scope.registerDeclaration(\n path.replaceWith(makeVar(node.id, t, isGlobal ? \"var\" : \"let\"))[0],\n );\n }\n break;\n }\n\n default:\n throw new Error(`Unexpected enum parent '${path.parent.type}`);\n }\n\n function seen(parentPath: Path) {\n if (parentPath.isExportDeclaration()) {\n return seen(parentPath.parentPath);\n }\n\n if (parentPath.getData(name)) {\n return true;\n } else {\n parentPath.setData(name, true);\n return false;\n }\n }\n}\n\nfunction makeVar(id, t, kind): VariableDeclaration {\n return t.variableDeclaration(kind, [t.variableDeclarator(id)]);\n}\n\nconst buildEnumWrapper = template(`\n (function (ID) {\n ASSIGNMENTS;\n })(ID || (ID = {}));\n`);\n\nconst buildStringAssignment = template(`\n ENUM[\"NAME\"] = VALUE;\n`);\n\nconst buildNumericAssignment = template(`\n ENUM[ENUM[\"NAME\"] = VALUE] = \"NAME\";\n`);\n\nconst buildEnumMember = (isString, options) =>\n (isString ? buildStringAssignment : buildNumericAssignment)(options);\n\n/**\n * Generates the statement that fills in the variable declared by the enum.\n * `(function (E) { ... assignments ... })(E || (E = {}));`\n */\nfunction enumFill(path, t, id) {\n const x = translateEnumValues(path, t);\n const assignments = x.map(([memberName, memberValue]) =>\n buildEnumMember(t.isStringLiteral(memberValue), {\n ENUM: t.cloneNode(id),\n NAME: memberName,\n VALUE: memberValue,\n }),\n );\n\n return buildEnumWrapper({\n ID: t.cloneNode(id),\n ASSIGNMENTS: assignments,\n });\n}\n\n/**\n * Maps the name of an enum member to its value.\n * We keep track of the previous enum members so you can write code like:\n * enum E {\n * X = 1 << 0,\n * Y = 1 << 1,\n * Z = X | Y,\n * }\n */\ntype PreviousEnumMembers = { [name: string]: number | string };\n\nfunction translateEnumValues(path, t) {\n const seen: PreviousEnumMembers = Object.create(null);\n // Start at -1 so the first enum member is its increment, 0.\n let prev: number | typeof undefined = -1;\n return path.node.members.map(member => {\n const name = t.isIdentifier(member.id) ? member.id.name : member.id.value;\n const initializer = member.initializer;\n let value: Expression;\n if (initializer) {\n const constValue = evaluate(initializer, seen);\n if (constValue !== undefined) {\n seen[name] = constValue;\n if (typeof constValue === \"number\") {\n value = t.numericLiteral(constValue);\n prev = constValue;\n } else {\n assert(typeof constValue === \"string\");\n value = t.stringLiteral(constValue);\n prev = undefined;\n }\n } else {\n value = initializer;\n prev = undefined;\n }\n } else {\n if (prev !== undefined) {\n prev++;\n value = t.numericLiteral(prev);\n seen[name] = prev;\n } else {\n throw path.buildCodeFrameError(\"Enum member must have initializer.\");\n }\n }\n\n return [name, value];\n });\n}\n\n// Based on the TypeScript repository's `evalConstant` in `checker.ts`.\nfunction evaluate(\n expr,\n seen: PreviousEnumMembers,\n): number | string | typeof undefined {\n return evalConstant(expr);\n\n function evalConstant(expr): number | typeof undefined {\n switch (expr.type) {\n case \"StringLiteral\":\n return expr.value;\n case \"UnaryExpression\":\n return evalUnaryExpression(expr);\n case \"BinaryExpression\":\n return evalBinaryExpression(expr);\n case \"NumericLiteral\":\n return expr.value;\n case \"ParenthesizedExpression\":\n return evalConstant(expr.expression);\n case \"Identifier\":\n return seen[expr.name];\n case \"TemplateLiteral\":\n if (expr.quasis.length === 1) {\n return expr.quasis[0].value.cooked;\n }\n /* falls through */\n default:\n return undefined;\n }\n }\n\n function evalUnaryExpression({\n argument,\n operator,\n }): number | typeof undefined {\n const value = evalConstant(argument);\n if (value === undefined) {\n return undefined;\n }\n\n switch (operator) {\n case \"+\":\n return value;\n case \"-\":\n return -value;\n case \"~\":\n return ~value;\n default:\n return undefined;\n }\n }\n\n function evalBinaryExpression(expr): number | typeof undefined {\n const left = evalConstant(expr.left);\n if (left === undefined) {\n return undefined;\n }\n const right = evalConstant(expr.right);\n if (right === undefined) {\n return undefined;\n }\n\n switch (expr.operator) {\n case \"|\":\n return left | right;\n case \"&\":\n return left & right;\n case \">>\":\n return left >> right;\n case \">>>\":\n return left >>> right;\n case \"<<\":\n return left << right;\n case \"^\":\n return left ^ right;\n case \"*\":\n return left * right;\n case \"/\":\n return left / right;\n case \"+\":\n return left + right;\n case \"-\":\n return left - right;\n case \"%\":\n return left % right;\n default:\n return undefined;\n }\n }\n}\n","import { template } from \"@babel/core\";\n\nexport default function transpileNamespace(path, t, allowNamespaces) {\n if (path.node.declare || path.node.id.type === \"StringLiteral\") {\n path.remove();\n return;\n }\n\n if (!allowNamespaces) {\n throw path.hub.file.buildCodeFrameError(\n path.node.id,\n \"Namespace not marked type-only declare.\" +\n \" Non-declarative namespaces are only supported experimentally in Babel.\" +\n \" To enable and review caveats see:\" +\n \" https://babeljs.io/docs/en/babel-plugin-transform-typescript\",\n );\n }\n\n const name = path.node.id.name;\n const value = handleNested(path, t, t.cloneDeep(path.node));\n const bound = path.scope.hasOwnBinding(name);\n if (path.parent.type === \"ExportNamedDeclaration\") {\n if (!bound) {\n path.parentPath.insertAfter(value);\n path.replaceWith(getDeclaration(t, name));\n path.scope.registerDeclaration(path.parentPath);\n } else {\n path.parentPath.replaceWith(value);\n }\n } else if (bound) {\n path.replaceWith(value);\n } else {\n path.scope.registerDeclaration(\n path.replaceWithMultiple([getDeclaration(t, name), value])[0],\n );\n }\n}\n\nfunction getDeclaration(t, name) {\n return t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.identifier(name)),\n ]);\n}\n\nfunction getMemberExpression(t, name, itemName) {\n return t.memberExpression(t.identifier(name), t.identifier(itemName));\n}\n\nfunction handleNested(path, t, node, parentExport) {\n const names = new Set();\n const realName = node.id;\n const name = path.scope.generateUid(realName.name);\n const namespaceTopLevel = node.body.body;\n for (let i = 0; i < namespaceTopLevel.length; i++) {\n const subNode = namespaceTopLevel[i];\n\n // The first switch is mainly to detect name usage. Only export\n // declarations require further transformation.\n switch (subNode.type) {\n case \"TSModuleDeclaration\": {\n const transformed = handleNested(path, t, subNode);\n const moduleName = subNode.id.name;\n if (names.has(moduleName)) {\n namespaceTopLevel[i] = transformed;\n } else {\n names.add(moduleName);\n namespaceTopLevel.splice(\n i++,\n 1,\n getDeclaration(t, moduleName),\n transformed,\n );\n }\n continue;\n }\n case \"TSEnumDeclaration\":\n case \"FunctionDeclaration\":\n case \"ClassDeclaration\":\n names.add(subNode.id.name);\n continue;\n case \"VariableDeclaration\":\n for (const variable of subNode.declarations) {\n names.add(variable.id.name);\n }\n continue;\n default:\n // Neither named declaration nor export, continue to next item.\n continue;\n case \"ExportNamedDeclaration\":\n // Export declarations get parsed using the next switch.\n }\n\n // Transform the export declarations that occur inside of a namespace.\n switch (subNode.declaration.type) {\n case \"TSEnumDeclaration\":\n case \"FunctionDeclaration\":\n case \"ClassDeclaration\": {\n const itemName = subNode.declaration.id.name;\n names.add(itemName);\n namespaceTopLevel.splice(\n i++,\n 1,\n subNode.declaration,\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n getMemberExpression(t, name, itemName),\n t.identifier(itemName),\n ),\n ),\n );\n break;\n }\n case \"VariableDeclaration\":\n if (subNode.declaration.kind !== \"const\") {\n throw path.hub.file.buildCodeFrameError(\n subNode.declaration,\n \"Namespaces exporting non-const are not supported by Babel.\" +\n \" Change to const or see:\" +\n \" https://babeljs.io/docs/en/babel-plugin-transform-typescript\",\n );\n }\n for (const variable of subNode.declaration.declarations) {\n variable.init = t.assignmentExpression(\n \"=\",\n getMemberExpression(t, name, variable.id.name),\n variable.init,\n );\n }\n namespaceTopLevel[i] = subNode.declaration;\n break;\n case \"TSModuleDeclaration\": {\n const transformed = handleNested(\n path,\n t,\n subNode.declaration,\n t.identifier(name),\n );\n const moduleName = subNode.declaration.id.name;\n if (names.has(moduleName)) {\n namespaceTopLevel[i] = transformed;\n } else {\n names.add(moduleName);\n namespaceTopLevel.splice(\n i++,\n 1,\n getDeclaration(t, moduleName),\n transformed,\n );\n }\n }\n }\n }\n\n // {}\n let fallthroughValue = t.objectExpression([]);\n\n if (parentExport) {\n fallthroughValue = template.expression.ast`\n ${parentExport}.${realName} || (\n ${parentExport}.${realName} = ${fallthroughValue}\n )\n `;\n }\n\n return template.statement.ast`\n (function (${t.identifier(name)}) {\n ${namespaceTopLevel}\n })(${realName} || (${realName} = ${fallthroughValue}));\n `;\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxTypeScript from \"@babel/plugin-syntax-typescript\";\nimport { types as t, template } from \"@babel/core\";\nimport { injectInitialization } from \"@babel/helper-create-class-features-plugin\";\n\nimport transpileEnum from \"./enum\";\nimport transpileNamespace from \"./namespace\";\n\nfunction isInType(path) {\n switch (path.parent.type) {\n case \"TSTypeReference\":\n case \"TSQualifiedName\":\n case \"TSExpressionWithTypeArguments\":\n case \"TSTypeQuery\":\n return true;\n default:\n return false;\n }\n}\n\nconst PARSED_PARAMS = new WeakSet();\nconst GLOBAL_TYPES = new WeakMap();\n\nfunction isGlobalType(path, name) {\n const program = path.find(path => path.isProgram()).node;\n if (path.scope.hasOwnBinding(name)) return false;\n if (GLOBAL_TYPES.get(program).has(name)) return true;\n\n console.warn(\n `The exported identifier \"${name}\" is not declared in Babel's scope tracker\\n` +\n `as a JavaScript value binding, and \"@babel/plugin-transform-typescript\"\\n` +\n `never encountered it as a TypeScript type declaration.\\n` +\n `It will be treated as a JavaScript value.\\n\\n` +\n `This problem is likely caused by another plugin injecting\\n` +\n `\"${name}\" without registering it in the scope tracker. If you are the author\\n` +\n ` of that plugin, please use \"scope.registerDeclaration(declarationPath)\".`,\n );\n\n return false;\n}\n\nfunction registerGlobalType(programScope, name) {\n GLOBAL_TYPES.get(programScope.path.node).add(name);\n}\n\nexport default declare(\n (\n api,\n {\n jsxPragma = \"React\",\n allowNamespaces = false,\n allowDeclareFields = false,\n },\n ) => {\n api.assertVersion(7);\n\n const JSX_ANNOTATION_REGEX = /\\*?\\s*@jsx\\s+([^\\s]+)/;\n\n const classMemberVisitors = {\n field(path) {\n const { node } = path;\n\n if (!allowDeclareFields && node.declare) {\n throw path.buildCodeFrameError(\n `The 'declare' modifier is only allowed when the 'allowDeclareFields' option of ` +\n `@babel/plugin-transform-typescript or @babel/preset-typescript is enabled.`,\n );\n }\n if (node.definite || node.declare) {\n if (node.value) {\n throw path.buildCodeFrameError(\n `Definietly assigned fields and fields with the 'declare' modifier cannot` +\n ` be initialized here, but only in the constructor`,\n );\n }\n\n path.remove();\n } else if (!allowDeclareFields && !node.value && !node.decorators) {\n path.remove();\n }\n\n if (node.accessibility) node.accessibility = null;\n if (node.abstract) node.abstract = null;\n if (node.readonly) node.readonly = null;\n if (node.optional) node.optional = null;\n if (node.typeAnnotation) node.typeAnnotation = null;\n },\n method({ node }) {\n if (node.accessibility) node.accessibility = null;\n if (node.abstract) node.abstract = null;\n if (node.optional) node.optional = null;\n\n // Rest handled by Function visitor\n },\n constructor(path, classPath) {\n if (path.node.accessibility) path.node.accessibility = null;\n // Collects parameter properties so that we can add an assignment\n // for each of them in the constructor body\n //\n // We use a WeakSet to ensure an assignment for a parameter\n // property is only added once. This is necessary for cases like\n // using `transform-classes`, which causes this visitor to run\n // twice.\n const parameterProperties = [];\n for (const param of path.node.params) {\n if (\n param.type === \"TSParameterProperty\" &&\n !PARSED_PARAMS.has(param.parameter)\n ) {\n PARSED_PARAMS.add(param.parameter);\n parameterProperties.push(param.parameter);\n }\n }\n\n if (parameterProperties.length) {\n const assigns = parameterProperties.map(p => {\n let id;\n if (t.isIdentifier(p)) {\n id = p;\n } else if (t.isAssignmentPattern(p) && t.isIdentifier(p.left)) {\n id = p.left;\n } else {\n throw path.buildCodeFrameError(\n \"Parameter properties can not be destructuring patterns.\",\n );\n }\n\n return template.statement.ast`this.${id} = ${id}`;\n });\n\n injectInitialization(classPath, path, assigns);\n }\n },\n };\n\n return {\n name: \"transform-typescript\",\n inherits: syntaxTypeScript,\n\n visitor: {\n //\"Pattern\" alias doesn't include Identifier or RestElement.\n Pattern: visitPattern,\n Identifier: visitPattern,\n RestElement: visitPattern,\n\n Program(path, state) {\n const { file } = state;\n let fileJsxPragma = null;\n\n if (!GLOBAL_TYPES.has(path.node)) {\n GLOBAL_TYPES.set(path.node, new Set());\n }\n\n if (file.ast.comments) {\n for (const comment of (file.ast.comments: Array)) {\n const jsxMatches = JSX_ANNOTATION_REGEX.exec(comment.value);\n if (jsxMatches) {\n fileJsxPragma = jsxMatches[1];\n }\n }\n }\n\n // remove type imports\n for (let stmt of path.get(\"body\")) {\n if (t.isImportDeclaration(stmt)) {\n // Note: this will allow both `import { } from \"m\"` and `import \"m\";`.\n // In TypeScript, the former would be elided.\n if (stmt.node.specifiers.length === 0) {\n continue;\n }\n\n let allElided = true;\n const importsToRemove: Path[] = [];\n\n for (const specifier of stmt.node.specifiers) {\n const binding = stmt.scope.getBinding(specifier.local.name);\n\n // The binding may not exist if the import node was explicitly\n // injected by another plugin. Currently core does not do a good job\n // of keeping scope bindings synchronized with the AST. For now we\n // just bail if there is no binding, since chances are good that if\n // the import statement was injected then it wasn't a typescript type\n // import anyway.\n if (\n binding &&\n isImportTypeOnly({\n binding,\n programPath: path,\n jsxPragma: fileJsxPragma || jsxPragma,\n })\n ) {\n importsToRemove.push(binding.path);\n } else {\n allElided = false;\n }\n }\n\n if (allElided) {\n stmt.remove();\n } else {\n for (const importPath of importsToRemove) {\n importPath.remove();\n }\n }\n\n continue;\n }\n\n if (stmt.isExportDeclaration()) {\n stmt = stmt.get(\"declaration\");\n }\n\n if (stmt.isVariableDeclaration({ declare: true })) {\n for (const name of Object.keys(stmt.getBindingIdentifiers())) {\n registerGlobalType(path.scope, name);\n }\n } else if (\n stmt.isTSTypeAliasDeclaration() ||\n stmt.isTSDeclareFunction() ||\n stmt.isTSInterfaceDeclaration() ||\n stmt.isClassDeclaration({ declare: true }) ||\n stmt.isTSEnumDeclaration({ declare: true }) ||\n (stmt.isTSModuleDeclaration({ declare: true }) &&\n stmt.get(\"id\").isIdentifier())\n ) {\n registerGlobalType(path.scope, stmt.node.id.name);\n }\n }\n },\n\n ExportNamedDeclaration(path) {\n // remove export declaration if it's exporting only types\n if (\n !path.node.source &&\n path.node.specifiers.length > 0 &&\n path.node.specifiers.every(({ local }) =>\n isGlobalType(path, local.name),\n )\n ) {\n path.remove();\n }\n },\n\n ExportSpecifier(path) {\n // remove type exports\n if (!path.parent.source && isGlobalType(path, path.node.local.name)) {\n path.remove();\n }\n },\n\n ExportDefaultDeclaration(path) {\n // remove whole declaration if it's exporting a TS type\n if (\n t.isIdentifier(path.node.declaration) &&\n isGlobalType(path, path.node.declaration.name)\n ) {\n path.remove();\n }\n },\n\n TSDeclareFunction(path) {\n path.remove();\n },\n\n TSDeclareMethod(path) {\n path.remove();\n },\n\n VariableDeclaration(path) {\n if (path.node.declare) {\n path.remove();\n }\n },\n\n VariableDeclarator({ node }) {\n if (node.definite) node.definite = null;\n },\n\n TSIndexSignature(path) {\n path.remove();\n },\n\n ClassDeclaration(path) {\n const { node } = path;\n if (node.declare) {\n path.remove();\n return;\n }\n },\n\n Class(path) {\n const { node } = path;\n\n if (node.typeParameters) node.typeParameters = null;\n if (node.superTypeParameters) node.superTypeParameters = null;\n if (node.implements) node.implements = null;\n if (node.abstract) node.abstract = null;\n\n // Similar to the logic in `transform-flow-strip-types`, we need to\n // handle `TSParameterProperty` and `ClassProperty` here because the\n // class transform would transform the class, causing more specific\n // visitors to not run.\n path.get(\"body.body\").forEach(child => {\n if (child.isClassMethod()) {\n if (child.node.kind === \"constructor\") {\n classMemberVisitors.constructor(child, path);\n } else {\n classMemberVisitors.method(child, path);\n }\n } else if (child.isClassProperty()) {\n classMemberVisitors.field(child, path);\n }\n });\n },\n\n Function({ node }) {\n if (node.typeParameters) node.typeParameters = null;\n if (node.returnType) node.returnType = null;\n\n const p0 = node.params[0];\n if (p0 && t.isIdentifier(p0) && p0.name === \"this\") {\n node.params.shift();\n }\n\n // We replace `TSParameterProperty` here so that transforms that\n // rely on a `Function` visitor to deal with arguments, like\n // `transform-parameters`, work properly.\n node.params = node.params.map(p => {\n return p.type === \"TSParameterProperty\" ? p.parameter : p;\n });\n },\n\n TSModuleDeclaration(path) {\n transpileNamespace(path, t, allowNamespaces);\n },\n\n TSInterfaceDeclaration(path) {\n path.remove();\n },\n\n TSTypeAliasDeclaration(path) {\n path.remove();\n },\n\n TSEnumDeclaration(path) {\n transpileEnum(path, t);\n },\n\n TSImportEqualsDeclaration(path) {\n throw path.buildCodeFrameError(\n \"`import =` is not supported by @babel/plugin-transform-typescript\\n\" +\n \"Please consider using \" +\n \"`import from '';` alongside \" +\n \"Typescript's --allowSyntheticDefaultImports option.\",\n );\n },\n\n TSExportAssignment(path) {\n throw path.buildCodeFrameError(\n \"`export =` is not supported by @babel/plugin-transform-typescript\\n\" +\n \"Please consider using `export ;`.\",\n );\n },\n\n TSTypeAssertion(path) {\n path.replaceWith(path.node.expression);\n },\n\n TSAsExpression(path) {\n let { node } = path;\n do {\n node = node.expression;\n } while (t.isTSAsExpression(node));\n path.replaceWith(node);\n },\n\n TSNonNullExpression(path) {\n path.replaceWith(path.node.expression);\n },\n\n CallExpression(path) {\n path.node.typeParameters = null;\n },\n\n NewExpression(path) {\n path.node.typeParameters = null;\n },\n\n JSXOpeningElement(path) {\n path.node.typeParameters = null;\n },\n\n TaggedTemplateExpression(path) {\n path.node.typeParameters = null;\n },\n },\n };\n\n function visitPattern({ node }) {\n if (node.typeAnnotation) node.typeAnnotation = null;\n if (t.isIdentifier(node) && node.optional) node.optional = null;\n // 'access' and 'readonly' are only for parameter properties, so constructor visitor will handle them.\n }\n\n function isImportTypeOnly({ binding, programPath, jsxPragma }) {\n for (const path of binding.referencePaths) {\n if (!isInType(path)) {\n return false;\n }\n }\n\n if (binding.identifier.name !== jsxPragma) {\n return true;\n }\n\n // \"React\" or the JSX pragma is referenced as a value if there are any JSX elements in the code.\n let sourceFileHasJsx = false;\n programPath.traverse({\n JSXElement() {\n sourceFileHasJsx = true;\n },\n JSXFragment() {\n sourceFileHasJsx = true;\n },\n });\n return !sourceFileHasJsx;\n }\n },\n);\n","/* eslint-disable @babel/development/plugin-name */\nimport { createRegExpFeaturePlugin } from \"@babel/helper-create-regexp-features-plugin\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return createRegExpFeaturePlugin({\n name: \"transform-unicode-regex\",\n feature: \"unicodeFlag\",\n });\n});\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport externalHelpers from \"@babel/plugin-external-helpers\";\nimport syntaxAsyncGenerators from \"@babel/plugin-syntax-async-generators\";\nimport syntaxClassProperties from \"@babel/plugin-syntax-class-properties\";\nimport syntaxDecorators from \"@babel/plugin-syntax-decorators\";\nimport syntaxDoExpressions from \"@babel/plugin-syntax-do-expressions\";\nimport syntaxDynamicImport from \"@babel/plugin-syntax-dynamic-import\";\nimport syntaxExportDefaultFrom from \"@babel/plugin-syntax-export-default-from\";\nimport syntaxExportNamespaceFrom from \"@babel/plugin-syntax-export-namespace-from\";\nimport syntaxFlow from \"@babel/plugin-syntax-flow\";\nimport syntaxFunctionBind from \"@babel/plugin-syntax-function-bind\";\nimport syntaxFunctionSent from \"@babel/plugin-syntax-function-sent\";\nimport syntaxImportMeta from \"@babel/plugin-syntax-import-meta\";\nimport syntaxJsx from \"@babel/plugin-syntax-jsx\";\nimport syntaxObjectRestSpread from \"@babel/plugin-syntax-object-rest-spread\";\nimport syntaxOptionalCatchBinding from \"@babel/plugin-syntax-optional-catch-binding\";\nimport syntaxPipelineOperator from \"@babel/plugin-syntax-pipeline-operator\";\nimport syntaxTopLevelAwait from \"@babel/plugin-syntax-top-level-await\";\nimport syntaxTypescript from \"@babel/plugin-syntax-typescript\";\nimport proposalAsyncGeneratorFunctions from \"@babel/plugin-proposal-async-generator-functions\";\nimport proposalClassProperties from \"@babel/plugin-proposal-class-properties\";\nimport proposalDecorators from \"@babel/plugin-proposal-decorators\";\nimport proposalDoExpressions from \"@babel/plugin-proposal-do-expressions\";\nimport proposalDynamicImport from \"@babel/plugin-proposal-dynamic-import\";\nimport proposalExportDefaultFrom from \"@babel/plugin-proposal-export-default-from\";\nimport proposalExportNamespaceFrom from \"@babel/plugin-proposal-export-namespace-from\";\nimport proposalFunctionBind from \"@babel/plugin-proposal-function-bind\";\nimport proposalFunctionSent from \"@babel/plugin-proposal-function-sent\";\nimport proposalJsonStrings from \"@babel/plugin-proposal-json-strings\";\nimport proposalLogicalAssignmentOperators from \"@babel/plugin-proposal-logical-assignment-operators\";\nimport proposalNullishCoalescingOperator from \"@babel/plugin-proposal-nullish-coalescing-operator\";\nimport proposalNumericSeparator from \"@babel/plugin-proposal-numeric-separator\";\nimport proposalObjectRestSpread from \"@babel/plugin-proposal-object-rest-spread\";\nimport proposalOptionalCatchBinding from \"@babel/plugin-proposal-optional-catch-binding\";\nimport proposalOptionalChaining from \"@babel/plugin-proposal-optional-chaining\";\nimport proposalPipelineOperator from \"@babel/plugin-proposal-pipeline-operator\";\nimport proposalPrivateMethods from \"@babel/plugin-proposal-private-methods\";\nimport proposalThrowExpressions from \"@babel/plugin-proposal-throw-expressions\";\nimport proposalUnicodePropertyRegex from \"@babel/plugin-proposal-unicode-property-regex\";\nimport transformAsyncToGenerator from \"@babel/plugin-transform-async-to-generator\";\nimport transformArrowFunctions from \"@babel/plugin-transform-arrow-functions\";\nimport transformBlockScopedFunctions from \"@babel/plugin-transform-block-scoped-functions\";\nimport transformBlockScoping from \"@babel/plugin-transform-block-scoping\";\nimport transformClasses from \"@babel/plugin-transform-classes\";\nimport transformComputedProperties from \"@babel/plugin-transform-computed-properties\";\nimport transformDestructuring from \"@babel/plugin-transform-destructuring\";\nimport transformDotallRegex from \"@babel/plugin-transform-dotall-regex\";\nimport transformDuplicateKeys from \"@babel/plugin-transform-duplicate-keys\";\nimport transformExponentiationOperator from \"@babel/plugin-transform-exponentiation-operator\";\nimport transformFlowComments from \"@babel/plugin-transform-flow-comments\";\nimport transformFlowStripTypes from \"@babel/plugin-transform-flow-strip-types\";\nimport transformForOf from \"@babel/plugin-transform-for-of\";\nimport transformFunctionName from \"@babel/plugin-transform-function-name\";\nimport transformInstanceof from \"@babel/plugin-transform-instanceof\";\nimport transformJscript from \"@babel/plugin-transform-jscript\";\nimport transformLiterals from \"@babel/plugin-transform-literals\";\nimport transformMemberExpressionLiterals from \"@babel/plugin-transform-member-expression-literals\";\nimport transformModulesAmd from \"@babel/plugin-transform-modules-amd\";\nimport transformModulesCommonjs from \"@babel/plugin-transform-modules-commonjs\";\nimport transformModulesSystemjs from \"@babel/plugin-transform-modules-systemjs\";\nimport transformModulesUmd from \"@babel/plugin-transform-modules-umd\";\nimport transformNamedCapturingGroupsRegex from \"@babel/plugin-transform-named-capturing-groups-regex\";\nimport transformNewTarget from \"@babel/plugin-transform-new-target\";\nimport transformObjectAssign from \"@babel/plugin-transform-object-assign\";\nimport transformObjectSuper from \"@babel/plugin-transform-object-super\";\nimport transformObjectSetPrototypeOfToAssign from \"@babel/plugin-transform-object-set-prototype-of-to-assign\";\nimport transformParameters from \"@babel/plugin-transform-parameters\";\nimport transformPropertyLiterals from \"@babel/plugin-transform-property-literals\";\nimport transformPropertyMutators from \"@babel/plugin-transform-property-mutators\";\nimport transformProtoToAssign from \"@babel/plugin-transform-proto-to-assign\";\nimport transformReactConstantElements from \"@babel/plugin-transform-react-constant-elements\";\nimport transformReactDisplayName from \"@babel/plugin-transform-react-display-name\";\nimport transformReactInlineElements from \"@babel/plugin-transform-react-inline-elements\";\nimport transformReactJsx from \"@babel/plugin-transform-react-jsx\";\nimport transformReactJsxCompat from \"@babel/plugin-transform-react-jsx-compat\";\nimport transformReactJsxSelf from \"@babel/plugin-transform-react-jsx-self\";\nimport transformReactJsxSource from \"@babel/plugin-transform-react-jsx-source\";\nimport transformRegenerator from \"@babel/plugin-transform-regenerator\";\nimport transformReservedWords from \"@babel/plugin-transform-reserved-words\";\nimport transformRuntime from \"@babel/plugin-transform-runtime\";\nimport transformShorthandProperties from \"@babel/plugin-transform-shorthand-properties\";\nimport transformSpread from \"@babel/plugin-transform-spread\";\nimport transformStickyRegex from \"@babel/plugin-transform-sticky-regex\";\nimport transformStrictMode from \"@babel/plugin-transform-strict-mode\";\nimport transformTemplateLiterals from \"@babel/plugin-transform-template-literals\";\nimport transformTypeofSymbol from \"@babel/plugin-transform-typeof-symbol\";\nimport transformTypescript from \"@babel/plugin-transform-typescript\";\nimport transformUnicodeRegex from \"@babel/plugin-transform-unicode-regex\";\n\nexport {\n externalHelpers,\n syntaxAsyncGenerators,\n syntaxClassProperties,\n syntaxDecorators,\n syntaxDoExpressions,\n syntaxDynamicImport,\n syntaxExportDefaultFrom,\n syntaxExportNamespaceFrom,\n syntaxFlow,\n syntaxFunctionBind,\n syntaxFunctionSent,\n syntaxImportMeta,\n syntaxJsx,\n syntaxObjectRestSpread,\n syntaxOptionalCatchBinding,\n syntaxPipelineOperator,\n syntaxTopLevelAwait,\n syntaxTypescript,\n proposalAsyncGeneratorFunctions,\n proposalClassProperties,\n proposalDecorators,\n proposalDoExpressions,\n proposalDynamicImport,\n proposalExportDefaultFrom,\n proposalExportNamespaceFrom,\n proposalFunctionBind,\n proposalFunctionSent,\n proposalJsonStrings,\n proposalLogicalAssignmentOperators,\n proposalNullishCoalescingOperator,\n proposalNumericSeparator,\n proposalObjectRestSpread,\n proposalOptionalCatchBinding,\n proposalOptionalChaining,\n proposalPipelineOperator,\n proposalPrivateMethods,\n proposalThrowExpressions,\n proposalUnicodePropertyRegex,\n transformAsyncToGenerator,\n transformArrowFunctions,\n transformBlockScopedFunctions,\n transformBlockScoping,\n transformClasses,\n transformComputedProperties,\n transformDestructuring,\n transformDotallRegex,\n transformDuplicateKeys,\n transformExponentiationOperator,\n transformFlowComments,\n transformFlowStripTypes,\n transformForOf,\n transformFunctionName,\n transformInstanceof,\n transformJscript,\n transformLiterals,\n transformMemberExpressionLiterals,\n transformModulesAmd,\n transformModulesCommonjs,\n transformModulesSystemjs,\n transformModulesUmd,\n transformNamedCapturingGroupsRegex,\n transformNewTarget,\n transformObjectAssign,\n transformObjectSuper,\n transformObjectSetPrototypeOfToAssign,\n transformParameters,\n transformPropertyLiterals,\n transformPropertyMutators,\n transformProtoToAssign,\n transformReactConstantElements,\n transformReactDisplayName,\n transformReactInlineElements,\n transformReactJsx,\n transformReactJsxCompat,\n transformReactJsxSelf,\n transformReactJsxSource,\n transformRegenerator,\n transformReservedWords,\n transformRuntime,\n transformShorthandProperties,\n transformSpread,\n transformStickyRegex,\n transformStrictMode,\n transformTemplateLiterals,\n transformTypeofSymbol,\n transformTypescript,\n transformUnicodeRegex,\n};\n\nexport const all = {\n \"external-helpers\": externalHelpers,\n \"syntax-async-generators\": syntaxAsyncGenerators,\n \"syntax-class-properties\": syntaxClassProperties,\n \"syntax-decorators\": syntaxDecorators,\n \"syntax-do-expressions\": syntaxDoExpressions,\n \"syntax-dynamic-import\": syntaxDynamicImport,\n \"syntax-export-default-from\": syntaxExportDefaultFrom,\n \"syntax-export-namespace-from\": syntaxExportNamespaceFrom,\n \"syntax-flow\": syntaxFlow,\n \"syntax-function-bind\": syntaxFunctionBind,\n \"syntax-function-sent\": syntaxFunctionSent,\n \"syntax-import-meta\": syntaxImportMeta,\n \"syntax-jsx\": syntaxJsx,\n \"syntax-object-rest-spread\": syntaxObjectRestSpread,\n \"syntax-optional-catch-binding\": syntaxOptionalCatchBinding,\n \"syntax-pipeline-operator\": syntaxPipelineOperator,\n \"syntax-top-level-await\": syntaxTopLevelAwait,\n \"syntax-typescript\": syntaxTypescript,\n \"proposal-async-generator-functions\": proposalAsyncGeneratorFunctions,\n \"proposal-class-properties\": proposalClassProperties,\n \"proposal-decorators\": proposalDecorators,\n \"proposal-do-expressions\": proposalDoExpressions,\n \"proposal-dynamic-import\": proposalDynamicImport,\n \"proposal-export-default-from\": proposalExportDefaultFrom,\n \"proposal-export-namespace-from\": proposalExportNamespaceFrom,\n \"proposal-function-bind\": proposalFunctionBind,\n \"proposal-function-sent\": proposalFunctionSent,\n \"proposal-json-strings\": proposalJsonStrings,\n \"proposal-logical-assignment-operators\": proposalLogicalAssignmentOperators,\n \"proposal-nullish-coalescing-operator\": proposalNullishCoalescingOperator,\n \"proposal-numeric-separator\": proposalNumericSeparator,\n \"proposal-object-rest-spread\": proposalObjectRestSpread,\n \"proposal-optional-catch-binding\": proposalOptionalCatchBinding,\n \"proposal-optional-chaining\": proposalOptionalChaining,\n \"proposal-pipeline-operator\": proposalPipelineOperator,\n \"proposal-private-methods\": proposalPrivateMethods,\n \"proposal-throw-expressions\": proposalThrowExpressions,\n \"proposal-unicode-property-regex\": proposalUnicodePropertyRegex,\n \"transform-async-to-generator\": transformAsyncToGenerator,\n \"transform-arrow-functions\": transformArrowFunctions,\n \"transform-block-scoped-functions\": transformBlockScopedFunctions,\n \"transform-block-scoping\": transformBlockScoping,\n \"transform-classes\": transformClasses,\n \"transform-computed-properties\": transformComputedProperties,\n \"transform-destructuring\": transformDestructuring,\n \"transform-dotall-regex\": transformDotallRegex,\n \"transform-duplicate-keys\": transformDuplicateKeys,\n \"transform-exponentiation-operator\": transformExponentiationOperator,\n \"transform-flow-comments\": transformFlowComments,\n \"transform-flow-strip-types\": transformFlowStripTypes,\n \"transform-for-of\": transformForOf,\n \"transform-function-name\": transformFunctionName,\n \"transform-instanceof\": transformInstanceof,\n \"transform-jscript\": transformJscript,\n \"transform-literals\": transformLiterals,\n \"transform-member-expression-literals\": transformMemberExpressionLiterals,\n \"transform-modules-amd\": transformModulesAmd,\n \"transform-modules-commonjs\": transformModulesCommonjs,\n \"transform-modules-systemjs\": transformModulesSystemjs,\n \"transform-modules-umd\": transformModulesUmd,\n \"transform-named-capturing-groups-regex\": transformNamedCapturingGroupsRegex,\n \"transform-new-target\": transformNewTarget,\n \"transform-object-assign\": transformObjectAssign,\n \"transform-object-super\": transformObjectSuper,\n \"transform-object-set-prototype-of-to-assign\": transformObjectSetPrototypeOfToAssign,\n \"transform-parameters\": transformParameters,\n \"transform-property-literals\": transformPropertyLiterals,\n \"transform-property-mutators\": transformPropertyMutators,\n \"transform-proto-to-assign\": transformProtoToAssign,\n \"transform-react-constant-elements\": transformReactConstantElements,\n \"transform-react-display-name\": transformReactDisplayName,\n \"transform-react-inline-elements\": transformReactInlineElements,\n \"transform-react-jsx\": transformReactJsx,\n \"transform-react-jsx-compat\": transformReactJsxCompat,\n \"transform-react-jsx-self\": transformReactJsxSelf,\n \"transform-react-jsx-source\": transformReactJsxSource,\n \"transform-regenerator\": transformRegenerator,\n \"transform-reserved-words\": transformReservedWords,\n \"transform-runtime\": transformRuntime,\n \"transform-shorthand-properties\": transformShorthandProperties,\n \"transform-spread\": transformSpread,\n \"transform-sticky-regex\": transformStickyRegex,\n \"transform-strict-mode\": transformStrictMode,\n \"transform-template-literals\": transformTemplateLiterals,\n \"transform-typeof-symbol\": transformTypeofSymbol,\n \"transform-typescript\": transformTypescript,\n \"transform-unicode-regex\": transformUnicodeRegex,\n};\n","// @flow\nimport * as babelPlugins from \"./generated/plugins\";\n\nexport default (_: any, opts: Object): Object => {\n let loose = false;\n let modules = \"commonjs\";\n let spec = false;\n\n if (opts !== undefined) {\n if (opts.loose !== undefined) loose = opts.loose;\n if (opts.modules !== undefined) modules = opts.modules;\n if (opts.spec !== undefined) spec = opts.spec;\n }\n\n // be DRY\n const optsLoose = { loose };\n\n return {\n plugins: [\n [babelPlugins.transformTemplateLiterals, { loose, spec }],\n babelPlugins.transformLiterals,\n babelPlugins.transformFunctionName,\n [babelPlugins.transformArrowFunctions, { spec }],\n babelPlugins.transformBlockScopedFunctions,\n [babelPlugins.transformClasses, optsLoose],\n babelPlugins.transformObjectSuper,\n babelPlugins.transformShorthandProperties,\n babelPlugins.transformDuplicateKeys,\n [babelPlugins.transformComputedProperties, optsLoose],\n [babelPlugins.transformForOf, optsLoose],\n babelPlugins.transformStickyRegex,\n babelPlugins.transformUnicodeRegex,\n [babelPlugins.transformSpread, optsLoose],\n [babelPlugins.transformParameters, optsLoose],\n [babelPlugins.transformDestructuring, optsLoose],\n babelPlugins.transformBlockScoping,\n babelPlugins.transformTypeofSymbol,\n babelPlugins.transformInstanceof,\n (modules === \"commonjs\" || modules === \"cjs\") && [\n babelPlugins.transformModulesCommonjs,\n optsLoose,\n ],\n modules === \"systemjs\" && [\n babelPlugins.transformModulesSystemjs,\n optsLoose,\n ],\n modules === \"amd\" && [babelPlugins.transformModulesAmd, optsLoose],\n modules === \"umd\" && [babelPlugins.transformModulesUmd, optsLoose],\n [\n babelPlugins.transformRegenerator,\n { async: false, asyncGenerators: false },\n ],\n ].filter(Boolean), // filter out falsy values\n };\n};\n","// @flow\nimport * as babelPlugins from \"./generated/plugins\";\n\nexport default (_: any, opts: Object) => {\n let loose = false;\n\n if (opts !== undefined) {\n if (opts.loose !== undefined) loose = opts.loose;\n }\n\n return {\n plugins: [\n babelPlugins.syntaxDynamicImport,\n babelPlugins.syntaxImportMeta,\n [babelPlugins.proposalOptionalChaining, { loose }],\n [babelPlugins.proposalNullishCoalescingOperator, { loose }],\n [babelPlugins.proposalClassProperties, { loose }],\n babelPlugins.proposalJsonStrings,\n [babelPlugins.proposalPrivateMethods, { loose }],\n ],\n };\n};\n","// @flow\nimport presetStage3 from \"./preset-stage-3\";\nimport * as babelPlugins from \"./generated/plugins\";\n\nexport default (_: any, opts: Object = {}) => {\n const {\n loose = false,\n useBuiltIns = false,\n decoratorsLegacy = false,\n decoratorsBeforeExport,\n } = opts;\n\n return {\n presets: [[presetStage3, { loose, useBuiltIns }]],\n plugins: [\n [\n babelPlugins.proposalDecorators,\n { legacy: decoratorsLegacy, decoratorsBeforeExport },\n ],\n babelPlugins.proposalFunctionSent,\n babelPlugins.proposalExportNamespaceFrom,\n babelPlugins.proposalNumericSeparator,\n babelPlugins.proposalThrowExpressions,\n ],\n };\n};\n","// @flow\nimport presetStage2 from \"./preset-stage-2\";\nimport * as babelPlugins from \"./generated/plugins\";\n\nexport default (_: any, opts: Object = {}) => {\n const {\n loose = false,\n useBuiltIns = false,\n decoratorsLegacy = false,\n decoratorsBeforeExport,\n pipelineProposal = \"minimal\",\n } = opts;\n\n return {\n presets: [\n [\n presetStage2,\n { loose, useBuiltIns, decoratorsLegacy, decoratorsBeforeExport },\n ],\n ],\n plugins: [\n babelPlugins.proposalExportDefaultFrom,\n babelPlugins.proposalLogicalAssignmentOperators,\n [babelPlugins.proposalPipelineOperator, { proposal: pipelineProposal }],\n babelPlugins.proposalDoExpressions,\n ],\n };\n};\n","// @flow\nimport presetStage1 from \"./preset-stage-1\";\nimport { proposalFunctionBind } from \"./generated/plugins\";\n\nexport default (_: any, opts: Object = {}) => {\n const {\n loose = false,\n useBuiltIns = false,\n decoratorsLegacy = false,\n decoratorsBeforeExport,\n pipelineProposal = \"minimal\",\n } = opts;\n\n return {\n presets: [\n [\n presetStage1,\n {\n loose,\n useBuiltIns,\n decoratorsLegacy,\n decoratorsBeforeExport,\n pipelineProposal,\n },\n ],\n ],\n plugins: [proposalFunctionBind],\n };\n};\n","module.exports={A:\"ie\",B:\"edge\",C:\"firefox\",D:\"chrome\",E:\"safari\",F:\"opera\",G:\"ios_saf\",H:\"op_mini\",I:\"android\",J:\"bb\",K:\"op_mob\",L:\"and_chr\",M:\"and_ff\",N:\"ie_mob\",O:\"and_uc\",P:\"samsung\",Q:\"and_qq\",R:\"baidu\",S:\"kaios\"};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar browsers = exports.browsers = require('../../data/browsers');","module.exports={\"0\":\"56\",\"1\":\"57\",\"2\":\"58\",\"3\":\"60\",\"4\":\"62\",\"5\":\"63\",\"6\":\"64\",\"7\":\"11.1\",\"8\":\"68\",\"9\":\"12.1\",A:\"10\",B:\"11\",C:\"12\",D:\"7\",E:\"9\",F:\"4\",G:\"8\",H:\"6\",I:\"17\",J:\"18\",K:\"13\",L:\"15\",M:\"46\",N:\"16\",O:\"5\",P:\"19\",Q:\"20\",R:\"21\",S:\"22\",T:\"23\",U:\"24\",V:\"25\",W:\"26\",X:\"27\",Y:\"28\",Z:\"29\",a:\"30\",b:\"31\",c:\"32\",d:\"33\",e:\"34\",f:\"14\",g:\"36\",h:\"37\",i:\"38\",j:\"39\",k:\"40\",l:\"41\",m:\"42\",n:\"43\",o:\"44\",p:\"45\",q:\"76\",r:\"47\",s:\"48\",t:\"49\",u:\"50\",v:\"51\",w:\"52\",x:\"53\",y:\"54\",z:\"55\",AB:\"35\",BB:\"66\",CB:\"4.2-4.3\",DB:\"65\",EB:\"59\",FB:\"67\",GB:\"11.5\",HB:\"69\",IB:\"70\",JB:\"71\",KB:\"72\",LB:\"73\",MB:\"61\",NB:\"3\",OB:\"10.1\",PB:\"3.2\",QB:\"78\",RB:\"9.0-9.2\",SB:\"77\",TB:\"80\",UB:\"81\",VB:\"3.1\",WB:\"75\",XB:\"5.1\",YB:\"6.1\",ZB:\"7.1\",aB:\"9.1\",bB:\"74\",cB:\"3.6\",dB:\"3.5\",eB:\"TP\",fB:\"9.5-9.6\",gB:\"10.0-10.1\",hB:\"10.5\",iB:\"10.6\",jB:\"2\",kB:\"11.6\",lB:\"4.0-4.1\",mB:\"5.5\",nB:\"5.0-5.1\",oB:\"6.0-6.1\",pB:\"7.0-7.1\",qB:\"8.1-8.4\",rB:\"79\",sB:\"9.3\",tB:\"10.0-10.2\",uB:\"10.3\",vB:\"11.0-11.2\",wB:\"11.3-11.4\",xB:\"12.0-12.1\",yB:\"12.2-12.4\",zB:\"13.0-13.1\",\"0B\":\"13.2\",\"1B\":\"13.3\",\"2B\":\"all\",\"3B\":\"2.1\",\"4B\":\"2.2\",\"5B\":\"2.3\",\"6B\":\"4.1\",\"7B\":\"4.4\",\"8B\":\"4.4.3-4.4.4\",\"9B\":\"12.12\",AC:\"5.0-5.4\",BC:\"6.2-6.4\",CC:\"7.2-7.4\",DC:\"8.2\",EC:\"9.2\",FC:\"1.2\",GC:\"7.12\",HC:\"2.5\"};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar browserVersions = exports.browserVersions = require('../../data/browserVersions');","module.exports={A:{A:{H:0.0092277,D:0.0092277,G:0.110732,E:0.0415246,A:0.0369108,B:1.43029,mB:0.009298},B:\"ms\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"mB\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"\",\"\",\"\"],E:\"IE\",F:{mB:962323200,H:998870400,D:1161129600,G:1237420800,E:1300060800,A:1346716800,B:1381968000}},B:{A:{C:0.008806,K:0.008806,f:0.017612,L:0.017612,N:0.039627,I:0.149702,J:1.79642,q:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"q\",\"\",\"\"],E:\"Edge\",F:{C:1438128000,K:1447286400,f:1470096000,L:1491868800,N:1508198400,I:1525046400,J:1542067200,q:null},D:{C:\"ms\",K:\"ms\",f:\"ms\",L:\"ms\",N:\"ms\",I:\"ms\",J:\"ms\"}},C:{A:{\"0\":0.026418,\"1\":0.013209,\"2\":0.008806,\"3\":0.039627,\"4\":0.008806,\"5\":0.017612,\"6\":0.026418,\"8\":0.13209,jB:0.004827,NB:0.00487,F:0.00974,O:0.004879,H:0.020136,D:0.005725,G:0.004525,E:0.00533,A:0.004283,B:0.009042,C:0.004471,K:0.004486,f:0.00453,L:0.004465,N:0.004417,I:0.008922,J:0.004393,P:0.004443,Q:0.004283,R:0.008806,S:0.004393,T:0.004525,U:0.008786,V:0.004403,W:0.004317,X:0.004393,Y:0.004418,Z:0.008834,a:0.004403,b:0.008928,c:0.004471,d:0.008922,e:0.004707,AB:0.022015,g:0.004465,h:0.004783,i:0.008806,j:0.004783,k:0.00487,l:0.005029,m:0.0047,n:0.008806,o:0.008806,p:0.013209,M:0.004525,r:0.022015,s:0.030821,t:0.004403,u:0.013209,v:0.008806,w:0.145299,x:0.008806,y:0.013209,z:0.008806,EB:0.008806,MB:0.013209,DB:0.052836,BB:0.04403,FB:0.026418,HB:0.074851,IB:0.761719,JB:2.42605,KB:0.057239,LB:0,dB:0.008786,cB:0.00487},B:\"moz\",C:[\"\",\"\",\"\",\"jB\",\"NB\",\"dB\",\"cB\",\"F\",\"O\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"EB\",\"3\",\"MB\",\"4\",\"5\",\"6\",\"DB\",\"BB\",\"FB\",\"8\",\"HB\",\"IB\",\"JB\",\"KB\",\"LB\",\"\"],E:\"Firefox\",F:{\"0\":1506556800,\"1\":1510617600,\"2\":1516665600,\"3\":1525824000,\"4\":1536105600,\"5\":1540252800,\"6\":1544486400,\"8\":1562630400,jB:1161648000,NB:1213660800,dB:1246320000,cB:1264032000,F:1300752000,O:1308614400,H:1313452800,D:1317081600,G:1317081600,E:1320710400,A:1324339200,B:1327968000,C:1331596800,K:1335225600,f:1338854400,L:1342483200,N:1346112000,I:1349740800,J:1353628800,P:1357603200,Q:1361232000,R:1364860800,S:1368489600,T:1372118400,U:1375747200,V:1379376000,W:1386633600,X:1391472000,Y:1395100800,Z:1398729600,a:1402358400,b:1405987200,c:1409616000,d:1413244800,e:1417392000,AB:1421107200,g:1424736000,h:1428278400,i:1431475200,j:1435881600,k:1439251200,l:1442880000,m:1446508800,n:1450137600,o:1453852800,p:1457395200,M:1461628800,r:1465257600,s:1470096000,t:1474329600,u:1479168000,v:1485216000,w:1488844800,x:1492560000,y:1497312000,z:1502150400,EB:1520985600,MB:1529971200,DB:1548720000,BB:1552953600,FB:1558396800,HB:1567468800,IB:1571788800,JB:1575331200,KB:null,LB:null}},D:{A:{\"0\":0.035224,\"1\":0.066045,\"2\":0.030821,\"3\":0.030821,\"4\":0.030821,\"5\":0.277389,\"6\":0.017612,\"8\":0.061642,F:0.004706,O:0.004879,H:0.004879,D:0.005591,G:0.005591,E:0.005591,A:0.004534,B:0.004464,C:0.010424,K:0.004403,f:0.004706,L:0.015087,N:0.004393,I:0.004393,J:0.008652,P:0.004418,Q:0.004393,R:0.004317,S:0.004465,T:0.008786,U:0.008806,V:0.004461,W:0.004403,X:0.004326,Y:0.0047,Z:0.004461,a:0.004403,b:0.013209,c:0.004465,d:0.013209,e:0.008806,AB:0.008806,g:0.008806,h:0.004464,i:0.022015,j:0.004464,k:0.013209,l:0.008806,m:0.004403,n:0.017612,o:0.004465,p:0.004403,M:0.004403,r:0.008806,s:0.035224,t:0.515151,u:0.008806,v:0.013209,w:0.004403,x:0.022015,y:0.026418,z:0.04403,EB:0.017612,MB:0.035224,DB:0.052836,BB:0.035224,FB:0.066045,HB:0.184926,IB:0.149702,JB:0.198135,KB:0.206941,LB:0.184926,bB:0.224553,WB:0.268583,q:0.281792,SB:0.409479,QB:13.9971,rB:11.5006,TB:0.039627,UB:0.017612},B:\"webkit\",C:[\"F\",\"O\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"EB\",\"3\",\"MB\",\"4\",\"5\",\"6\",\"DB\",\"BB\",\"FB\",\"8\",\"HB\",\"IB\",\"JB\",\"KB\",\"LB\",\"bB\",\"WB\",\"q\",\"SB\",\"QB\",\"rB\",\"TB\",\"UB\"],E:\"Chrome\",F:{\"0\":1485302400,\"1\":1489017600,\"2\":1492560000,\"3\":1500940800,\"4\":1508198400,\"5\":1512518400,\"6\":1516752000,\"8\":1532390400,F:1264377600,O:1274745600,H:1283385600,D:1287619200,G:1291248000,E:1296777600,A:1299542400,B:1303862400,C:1307404800,K:1312243200,f:1316131200,L:1316131200,N:1319500800,I:1323734400,J:1328659200,P:1332892800,Q:1337040000,R:1340668800,S:1343692800,T:1348531200,U:1352246400,V:1357862400,W:1361404800,X:1364428800,Y:1369094400,Z:1374105600,a:1376956800,b:1384214400,c:1389657600,d:1392940800,e:1397001600,AB:1400544000,g:1405468800,h:1409011200,i:1412640000,j:1416268800,k:1421798400,l:1425513600,m:1429401600,n:1432080000,o:1437523200,p:1441152000,M:1444780800,r:1449014400,s:1453248000,t:1456963200,u:1460592000,v:1464134400,w:1469059200,x:1472601600,y:1476230400,z:1480550400,EB:1496707200,MB:1504569600,DB:1520294400,BB:1523923200,FB:1527552000,HB:1536019200,IB:1539648000,JB:1543968000,KB:1548720000,LB:1552348800,bB:1555977600,WB:1559606400,q:1564444800,SB:1568073600,QB:1571702400,rB:null,TB:null,UB:null}},E:{A:{\"7\":0.184926,\"9\":0.435897,F:0,O:0.004403,H:0.004349,D:0.004465,G:0.026418,E:0.013209,A:0.017612,B:0.039627,C:0.136493,K:2.29396,VB:0,PB:0.008692,XB:0.66045,YB:0.00456,ZB:0.004283,aB:0.035224,OB:0.096866,eB:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"VB\",\"PB\",\"F\",\"O\",\"XB\",\"H\",\"YB\",\"D\",\"ZB\",\"G\",\"E\",\"aB\",\"A\",\"OB\",\"B\",\"7\",\"C\",\"9\",\"K\",\"eB\",\"\",\"\"],E:\"Safari\",F:{\"7\":1522281600,\"9\":1553472000,VB:1205798400,PB:1226534400,F:1244419200,O:1275868800,XB:1311120000,H:1343174400,YB:1382400000,D:1382400000,ZB:1410998400,G:1413417600,E:1443657600,aB:1458518400,A:1474329600,OB:1490572800,B:1505779200,C:1537142400,K:1568851200,eB:null}},F:{A:{\"0\":0.008806,\"1\":0.008806,\"2\":0.013209,\"3\":0.004403,\"4\":0.004403,\"5\":0.013209,\"6\":0.070448,\"7\":0.006229,\"9\":0.008806,E:0.0082,B:0.016581,C:0.004317,L:0.00685,N:0.00685,I:0.00685,J:0.005014,P:0.006015,Q:0.004879,R:0.006597,S:0.006597,T:0.013434,U:0.006702,V:0.006015,W:0.005595,X:0.004393,Y:0.008652,Z:0.004879,a:0.004879,b:0.008806,c:0.005152,d:0.005014,e:0.009758,AB:0.004879,g:0.013209,h:0.004283,i:0.004367,j:0.004534,k:0.004367,l:0.004227,m:0.004418,n:0.009042,o:0.004227,p:0.004725,M:0.004417,r:0.008942,s:0.004707,t:0.004827,u:0.004707,v:0.004707,w:0.004326,x:0.008922,y:0.014349,z:0.004725,fB:0.00685,gB:0,hB:0.008392,iB:0.004706,GB:0.004879,kB:0.008786},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"E\",\"fB\",\"gB\",\"hB\",\"iB\",\"B\",\"7\",\"GB\",\"kB\",\"C\",\"9\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"\",\"\",\"\"],E:\"Opera\",F:{\"0\":1537833600,\"1\":1543363200,\"2\":1548201600,\"3\":1554768000,\"4\":1561593600,\"5\":1566259200,\"6\":1570406400,\"7\":1302566400,\"9\":1352073600,E:1150761600,fB:1223424000,gB:1251763200,hB:1267488000,iB:1277942400,B:1292457600,GB:1309219200,kB:1323129600,C:1323129600,L:1372723200,N:1377561600,I:1381104000,J:1386288000,P:1390867200,Q:1393891200,R:1399334400,S:1401753600,T:1405987200,U:1409616000,V:1413331200,W:1417132800,X:1422316800,Y:1425945600,Z:1430179200,a:1433808000,b:1438646400,c:1442448000,d:1445904000,e:1449100800,AB:1454371200,g:1457308800,h:1462320000,i:1465344000,j:1470096000,k:1474329600,l:1477267200,m:1481587200,n:1486425600,o:1490054400,p:1494374400,M:1498003200,r:1502236800,s:1506470400,t:1510099200,u:1515024000,v:1517961600,w:1521676800,x:1525910400,y:1530144000,z:1534982400},D:{\"7\":\"o\",\"9\":\"o\",E:\"o\",B:\"o\",C:\"o\",fB:\"o\",gB:\"o\",hB:\"o\",iB:\"o\",GB:\"o\",kB:\"o\"}},G:{A:{G:0.00128072,PB:0.00512289,lB:0.00256144,CB:0,nB:0.00768433,oB:0.00256144,pB:0.00896505,qB:0.0166494,RB:0.0153687,sB:0.162652,tB:0.0563518,uB:0.181862,vB:0.153687,wB:0.274074,xB:0.391901,yB:2.77404,zB:4.02787,\"0B\":1.83399,\"1B\":2.88931},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"PB\",\"lB\",\"CB\",\"nB\",\"oB\",\"pB\",\"G\",\"qB\",\"RB\",\"sB\",\"tB\",\"uB\",\"vB\",\"wB\",\"xB\",\"yB\",\"zB\",\"0B\",\"1B\",\"\",\"\"],E:\"iOS Safari\",F:{PB:1270252800,lB:1283904000,CB:1299628800,nB:1331078400,oB:1359331200,pB:1394409600,G:1410912000,qB:1413763200,RB:1442361600,sB:1458518400,tB:1473724800,uB:1490572800,vB:1505779200,wB:1522281600,xB:1537142400,yB:1553472000,zB:1568851200,\"0B\":1572220800,\"1B\":null}},H:{A:{\"2B\":1.16575},B:\"o\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"2B\",\"\",\"\",\"\"],E:\"Opera Mini\",F:{\"2B\":1426464000}},I:{A:{NB:0.000748894,F:0.00324521,q:0,\"3B\":0,\"4B\":0.000499263,\"5B\":0.000499263,\"6B\":0.00574152,CB:0.125565,\"7B\":0,\"8B\":0.0763872},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"3B\",\"4B\",\"5B\",\"NB\",\"F\",\"6B\",\"CB\",\"7B\",\"8B\",\"q\",\"\",\"\",\"\"],E:\"Android Browser\",F:{\"3B\":1256515200,\"4B\":1274313600,\"5B\":1291593600,NB:1298332800,F:1318896000,\"6B\":1341792000,CB:1374624000,\"7B\":1386547200,\"8B\":1401667200,q:1566777600}},J:{A:{D:0,A:0.011194},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"D\",\"A\",\"\",\"\",\"\"],E:\"Blackberry Browser\",F:{D:1325376000,A:1359504000}},K:{A:{\"7\":0,\"9\":0,A:0,B:0,C:0,M:0.0111391,GB:0},B:\"o\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"A\",\"B\",\"7\",\"GB\",\"C\",\"9\",\"M\",\"\",\"\",\"\"],E:\"Opera Mobile\",F:{\"7\":1314835200,\"9\":1349740800,A:1287100800,B:1300752000,GB:1318291200,C:1330300800,M:1474588800},D:{M:\"webkit\"}},L:{A:{QB:35.1619},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"QB\",\"\",\"\",\"\"],E:\"Chrome for Android\",F:{QB:1571702400}},M:{A:{\"8\":0.229477},B:\"moz\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"8\",\"\",\"\",\"\"],E:\"Firefox for Android\",F:{\"8\":1567468800}},N:{A:{A:0.0115934,B:0.050373},B:\"ms\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"A\",\"B\",\"\",\"\",\"\"],E:\"IE Mobile\",F:{A:1340150400,B:1353456000}},O:{A:{\"9B\":2.88246},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"9B\",\"\",\"\",\"\"],E:\"UC Browser for Android\",F:{\"9B\":1471392000},D:{\"9B\":\"webkit\"}},P:{A:{F:0.33211,AC:0.0311353,BC:0.0207569,CC:0.114163,DC:0.0415137,EC:0.321732,OB:2.72953},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"F\",\"AC\",\"BC\",\"CC\",\"DC\",\"EC\",\"OB\",\"\",\"\",\"\"],E:\"Samsung Internet\",F:{F:1461024000,AC:1481846400,BC:1509408000,CC:1528329600,DC:1546128000,EC:1554163200,OB:1567900800}},Q:{A:{FC:0.201492},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"FC\",\"\",\"\",\"\"],E:\"QQ Browser\",F:{FC:1483228800}},R:{A:{GC:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"GC\",\"\",\"\",\"\"],E:\"Baidu Browser\",F:{GC:1491004800}},S:{A:{HC:0.195895},B:\"moz\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"HC\",\"\",\"\",\"\"],E:\"KaiOS Browser\",F:{HC:1527811200}}};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.agents = undefined;\n\nvar _browsers = require('./browsers');\n\nvar _browserVersions = require('./browserVersions');\n\nvar agentsData = require('../../data/agents');\n\nfunction unpackBrowserVersions(versionsData) {\n return Object.keys(versionsData).reduce(function (usage, version) {\n usage[_browserVersions.browserVersions[version]] = versionsData[version];\n return usage;\n }, {});\n}\n\nvar agents = exports.agents = Object.keys(agentsData).reduce(function (map, key) {\n var versionsData = agentsData[key];\n map[_browsers.browsers[key]] = Object.keys(versionsData).reduce(function (data, entry) {\n if (entry === 'A') {\n data.usage_global = unpackBrowserVersions(versionsData[entry]);\n } else if (entry === 'C') {\n data.versions = versionsData[entry].reduce(function (list, version) {\n if (version === '') {\n list.push(null);\n } else {\n list.push(_browserVersions.browserVersions[version]);\n }\n return list;\n }, []);\n } else if (entry === 'D') {\n data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]);\n } else if (entry === 'E') {\n data.browser = versionsData[entry];\n } else if (entry === 'F') {\n data.release_date = Object.keys(versionsData[entry]).reduce(function (map, key) {\n map[_browserVersions.browserVersions[key]] = versionsData[entry][key];\n return map;\n }, {});\n } else {\n // entry is B\n data.prefix = versionsData[entry];\n }\n return data;\n }, {});\n return map;\n}, {});","module.exports = {\n\t\"8.0\": \"79\",\n\t\"7.1\": \"78\",\n\t\"7.0\": \"78\",\n\t\"6.1\": \"76\",\n\t\"6.0\": \"76\",\n\t\"5.0\": \"72\",\n\t\"4.2\": \"69\",\n\t\"4.1\": \"69\",\n\t\"4.0\": \"69\",\n\t\"3.1\": \"66\",\n\t\"3.0\": \"66\",\n\t\"2.1\": \"61\",\n\t\"2.0\": \"61\",\n\t\"1.8\": \"59\",\n\t\"1.7\": \"58\",\n\t\"1.6\": \"56\",\n\t\"1.5\": \"54\",\n\t\"1.4\": \"53\",\n\t\"1.3\": \"52\",\n\t\"1.2\": \"51\",\n\t\"1.1\": \"50\",\n\t\"1.0\": \"49\",\n\t\"0.37\": \"49\",\n\t\"0.36\": \"47\",\n\t\"0.35\": \"45\",\n\t\"0.34\": \"45\",\n\t\"0.33\": \"45\",\n\t\"0.32\": \"45\",\n\t\"0.31\": \"44\",\n\t\"0.30\": \"44\",\n\t\"0.29\": \"43\",\n\t\"0.28\": \"43\",\n\t\"0.27\": \"42\",\n\t\"0.26\": \"42\",\n\t\"0.25\": \"42\",\n\t\"0.24\": \"41\",\n\t\"0.23\": \"41\",\n\t\"0.22\": \"41\",\n\t\"0.21\": \"40\",\n\t\"0.20\": \"39\"\n};","function BrowserslistError (message) {\n this.name = 'BrowserslistError'\n this.message = message\n this.browserslist = true\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, BrowserslistError)\n }\n}\n\nBrowserslistError.prototype = Error.prototype\n\nmodule.exports = BrowserslistError\n","var BrowserslistError = require('./error')\n\nfunction noop () { }\n\nmodule.exports = {\n loadQueries: function loadQueries () {\n throw new BrowserslistError(\n 'Sharable configs are not supported in client-side build of Browserslist')\n },\n\n getStat: function getStat (opts) {\n return opts.stats\n },\n\n loadConfig: function loadConfig (opts) {\n if (opts.config) {\n throw new BrowserslistError(\n 'Browserslist config are not supported in client-side build')\n }\n },\n\n loadCountry: function loadCountry () {\n throw new BrowserslistError(\n 'Country statistics is not supported ' +\n 'in client-side build of Browserslist')\n },\n\n currentNode: function currentNode (resolve, context) {\n return resolve(['maintained node versions'], context)[0]\n },\n\n parseConfig: noop,\n\n readConfig: noop,\n\n findConfig: noop,\n\n clearCaches: noop,\n\n oldDataWarning: noop\n}\n","var jsReleases = require('node-releases/data/processed/envs.json')\nvar agents = require('caniuse-lite/dist/unpacker/agents').agents\nvar jsEOL = require('node-releases/data/release-schedule/release-schedule.json')\nvar path = require('path')\nvar e2c = require('electron-to-chromium/versions')\n\nvar BrowserslistError = require('./error')\nvar env = require('./node') // Will load browser.js in webpack\n\nvar YEAR = 365.259641 * 24 * 60 * 60 * 1000\nvar ANDROID_EVERGREEN_FIRST = 37\n\nvar QUERY_OR = 1\nvar QUERY_AND = 2\n\nfunction isVersionsMatch (versionA, versionB) {\n return (versionA + '.').indexOf(versionB + '.') === 0\n}\n\nfunction isEolReleased (name) {\n var version = name.slice(1)\n return jsReleases.some(function (i) {\n return isVersionsMatch(i.version, version)\n })\n}\n\nfunction normalize (versions) {\n return versions.filter(function (version) {\n return typeof version === 'string'\n })\n}\n\nfunction normalizeElectron (version) {\n var versionToUse = version\n if (version.split('.').length === 3) {\n versionToUse = version\n .split('.')\n .slice(0, -1)\n .join('.')\n }\n return versionToUse\n}\n\nfunction nameMapper (name) {\n return function mapName (version) {\n return name + ' ' + version\n }\n}\n\nfunction getMajor (version) {\n return parseInt(version.split('.')[0])\n}\n\nfunction getMajorVersions (released, number) {\n if (released.length === 0) return []\n var minimum = getMajor(released[released.length - 1]) - parseInt(number) + 1\n var selected = []\n for (var i = released.length - 1; i >= 0; i--) {\n if (minimum > getMajor(released[i])) break\n selected.unshift(released[i])\n }\n return selected\n}\n\nfunction uniq (array) {\n var filtered = []\n for (var i = 0; i < array.length; i++) {\n if (filtered.indexOf(array[i]) === -1) filtered.push(array[i])\n }\n return filtered\n}\n\n// Helpers\n\nfunction fillUsage (result, name, data) {\n for (var i in data) {\n result[name + ' ' + i] = data[i]\n }\n}\n\nfunction generateFilter (sign, version) {\n version = parseFloat(version)\n if (sign === '>') {\n return function (v) {\n return parseFloat(v) > version\n }\n } else if (sign === '>=') {\n return function (v) {\n return parseFloat(v) >= version\n }\n } else if (sign === '<') {\n return function (v) {\n return parseFloat(v) < version\n }\n } else {\n return function (v) {\n return parseFloat(v) <= version\n }\n }\n}\n\nfunction generateSemverFilter (sign, version) {\n version = version.split('.').map(parseSimpleInt)\n version[1] = version[1] || 0\n version[2] = version[2] || 0\n if (sign === '>') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(v, version) > 0\n }\n } else if (sign === '>=') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(v, version) >= 0\n }\n } else if (sign === '<') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(version, v) > 0\n }\n } else {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(version, v) >= 0\n }\n }\n}\n\nfunction parseSimpleInt (x) {\n return parseInt(x)\n}\n\nfunction compare (a, b) {\n if (a < b) return -1\n if (a > b) return +1\n return 0\n}\n\nfunction compareSemver (a, b) {\n return (\n compare(parseInt(a[0]), parseInt(b[0])) ||\n compare(parseInt(a[1] || '0'), parseInt(b[1] || '0')) ||\n compare(parseInt(a[2] || '0'), parseInt(b[2] || '0'))\n )\n}\n\nfunction resolveVersion (data, version) {\n if (data.versions.indexOf(version) !== -1) {\n return version\n } else if (browserslist.versionAliases[data.name][version]) {\n return browserslist.versionAliases[data.name][version]\n } else {\n return false\n }\n}\n\nfunction normalizeVersion (data, version) {\n var resolved = resolveVersion(data, version)\n if (resolved) {\n return resolved\n } else if (data.versions.length === 1) {\n return data.versions[0]\n } else {\n return false\n }\n}\n\nfunction filterByYear (since, context) {\n since = since / 1000\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var versions = Object.keys(data.releaseDate).filter(function (v) {\n return data.releaseDate[v] >= since\n })\n return selected.concat(versions.map(nameMapper(data.name)))\n }, [])\n}\n\nfunction cloneData (data) {\n return {\n name: data.name,\n versions: data.versions,\n released: data.released,\n releaseDate: data.releaseDate\n }\n}\n\nfunction byName (name, context) {\n name = name.toLowerCase()\n name = browserslist.aliases[name] || name\n if (context.mobileToDesktop && browserslist.desktopNames[name]) {\n var desktop = browserslist.data[browserslist.desktopNames[name]]\n if (name === 'android') {\n return normalizeAndroidData(cloneData(browserslist.data[name]), desktop)\n } else {\n var cloned = cloneData(desktop)\n cloned.name = name\n return cloned\n }\n }\n return browserslist.data[name]\n}\n\nfunction normalizeAndroidVersions (androidVersions, chromeVersions) {\n var firstEvergreen = ANDROID_EVERGREEN_FIRST\n var last = chromeVersions[chromeVersions.length - 1]\n return androidVersions\n .filter(function (version) { return /^(?:[2-4]\\.|[34]$)/.test(version) })\n .concat(chromeVersions.slice(firstEvergreen - last - 1))\n}\n\nfunction normalizeAndroidData (android, chrome) {\n android.released = normalizeAndroidVersions(android.released, chrome.released)\n android.versions = normalizeAndroidVersions(android.versions, chrome.versions)\n return android\n}\n\nfunction checkName (name, context) {\n var data = byName(name, context)\n if (!data) throw new BrowserslistError('Unknown browser ' + name)\n return data\n}\n\nfunction unknownQuery (query) {\n return new BrowserslistError(\n 'Unknown browser query `' + query + '`. ' +\n 'Maybe you are using old Browserslist or made typo in query.'\n )\n}\n\nfunction filterAndroid (list, versions, context) {\n if (context.mobileToDesktop) return list\n var released = browserslist.data.android.released\n var last = released[released.length - 1]\n var diff = last - ANDROID_EVERGREEN_FIRST - versions\n if (diff > 0) {\n return list.slice(-1)\n } else {\n return list.slice(diff - 1)\n }\n}\n\n/**\n * Resolves queries into a browser list.\n * @param {string|string[]} queries Queries to combine.\n * Either an array of queries or a long string of queries.\n * @param {object} [context] Optional arguments to\n * the select function in `queries`.\n * @returns {string[]} A list of browsers\n */\nfunction resolve (queries, context) {\n if (Array.isArray(queries)) {\n queries = flatten(queries.map(parse))\n } else {\n queries = parse(queries)\n }\n\n return queries.reduce(function (result, query, index) {\n var selection = query.queryString\n\n var isExclude = selection.indexOf('not ') === 0\n if (isExclude) {\n if (index === 0) {\n throw new BrowserslistError(\n 'Write any browsers query (for instance, `defaults`) ' +\n 'before `' + selection + '`')\n }\n selection = selection.slice(4)\n }\n\n for (var i = 0; i < QUERIES.length; i++) {\n var type = QUERIES[i]\n var match = selection.match(type.regexp)\n if (match) {\n var args = [context].concat(match.slice(1))\n var array = type.select.apply(browserslist, args).map(function (j) {\n var parts = j.split(' ')\n if (parts[1] === '0') {\n return parts[0] + ' ' + byName(parts[0], context).versions[0]\n } else {\n return j\n }\n })\n\n switch (query.type) {\n case QUERY_AND:\n if (isExclude) {\n return result.filter(function (j) {\n return array.indexOf(j) === -1\n })\n } else {\n return result.filter(function (j) {\n return array.indexOf(j) !== -1\n })\n }\n case QUERY_OR:\n default:\n if (isExclude) {\n var filter = { }\n array.forEach(function (j) {\n filter[j] = true\n })\n return result.filter(function (j) {\n return !filter[j]\n })\n }\n return result.concat(array)\n }\n }\n }\n\n throw unknownQuery(selection)\n }, [])\n}\n\nvar cache = { }\n\n/**\n * Return array of browsers by selection queries.\n *\n * @param {(string|string[])} [queries=browserslist.defaults] Browser queries.\n * @param {object} [opts] Options.\n * @param {string} [opts.path=\".\"] Path to processed file.\n * It will be used to find config files.\n * @param {string} [opts.env=\"production\"] Processing environment.\n * It will be used to take right\n * queries from config file.\n * @param {string} [opts.config] Path to config file with queries.\n * @param {object} [opts.stats] Custom browser usage statistics\n * for \"> 1% in my stats\" query.\n * @param {boolean} [opts.ignoreUnknownVersions=false] Do not throw on unknown\n * version in direct query.\n * @param {boolean} [opts.dangerousExtend] Disable security checks\n * for extend query.\n * @param {boolean} [opts.mobileToDesktop] Alias mobile browsers to the desktop\n * version when Can I Use doesn't have\n * data about the specified version.\n * @returns {string[]} Array with browser names in Can I Use.\n *\n * @example\n * browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8']\n */\nfunction browserslist (queries, opts) {\n if (typeof opts === 'undefined') opts = { }\n\n if (typeof opts.path === 'undefined') {\n opts.path = path.resolve ? path.resolve('.') : '.'\n }\n\n if (typeof queries === 'undefined' || queries === null) {\n var config = browserslist.loadConfig(opts)\n if (config) {\n queries = config\n } else {\n queries = browserslist.defaults\n }\n }\n\n if (!(typeof queries === 'string' || Array.isArray(queries))) {\n throw new BrowserslistError(\n 'Browser queries must be an array or string. Got ' + typeof queries + '.')\n }\n\n var context = {\n ignoreUnknownVersions: opts.ignoreUnknownVersions,\n dangerousExtend: opts.dangerousExtend,\n mobileToDesktop: opts.mobileToDesktop\n }\n\n env.oldDataWarning(browserslist.data)\n var stats = env.getStat(opts, browserslist.data)\n if (stats) {\n context.customUsage = { }\n for (var browser in stats) {\n fillUsage(context.customUsage, browser, stats[browser])\n }\n }\n\n var cacheKey = JSON.stringify([queries, context])\n if (cache[cacheKey]) return cache[cacheKey]\n\n var result = uniq(resolve(queries, context)).sort(function (name1, name2) {\n name1 = name1.split(' ')\n name2 = name2.split(' ')\n if (name1[0] === name2[0]) {\n // assumptions on caniuse data\n // 1) version ranges never overlaps\n // 2) if version is not a range, it never contains `-`\n var version1 = name1[1].split('-')[0]\n var version2 = name2[1].split('-')[0]\n return compareSemver(version2.split('.'), version1.split('.'))\n } else {\n return compare(name1[0], name2[0])\n }\n })\n if (!process.env.BROWSERSLIST_DISABLE_CACHE) {\n cache[cacheKey] = result\n }\n return result\n}\n\nfunction parse (queries) {\n var qs = []\n do {\n queries = doMatch(queries, qs)\n } while (queries)\n return qs\n}\n\nfunction doMatch (string, qs) {\n var or = /^(?:,\\s*|\\s+or\\s+)(.*)/i\n var and = /^\\s+and\\s+(.*)/i\n\n return find(string, function (parsed, n, max) {\n if (and.test(parsed)) {\n qs.unshift({ type: QUERY_AND, queryString: parsed.match(and)[1] })\n return true\n } else if (or.test(parsed)) {\n qs.unshift({ type: QUERY_OR, queryString: parsed.match(or)[1] })\n return true\n } else if (n === max) {\n qs.unshift({ type: QUERY_OR, queryString: parsed.trim() })\n return true\n }\n return false\n })\n}\n\nfunction find (string, predicate) {\n for (var n = 1, max = string.length; n <= max; n++) {\n var parsed = string.substr(-n, n)\n if (predicate(parsed, n, max)) {\n return string.slice(0, -n)\n }\n }\n return ''\n}\n\nfunction flatten (array) {\n if (!Array.isArray(array)) return [array]\n return array.reduce(function (a, b) {\n return a.concat(flatten(b))\n }, [])\n}\n\n// Will be filled by Can I Use data below\nbrowserslist.data = { }\nbrowserslist.usage = {\n global: { },\n custom: null\n}\n\n// Default browsers query\nbrowserslist.defaults = [\n '> 0.5%',\n 'last 2 versions',\n 'Firefox ESR',\n 'not dead'\n]\n\n// Browser names aliases\nbrowserslist.aliases = {\n fx: 'firefox',\n ff: 'firefox',\n ios: 'ios_saf',\n explorer: 'ie',\n blackberry: 'bb',\n explorermobile: 'ie_mob',\n operamini: 'op_mini',\n operamobile: 'op_mob',\n chromeandroid: 'and_chr',\n firefoxandroid: 'and_ff',\n ucandroid: 'and_uc',\n qqandroid: 'and_qq'\n}\n\n// Can I Use only provides a few versions for some browsers (e.g. and_chr).\n// Fallback to a similar browser for unknown versions\nbrowserslist.desktopNames = {\n and_chr: 'chrome',\n and_ff: 'firefox',\n ie_mob: 'ie',\n op_mob: 'opera',\n android: 'chrome' // has extra processing logic\n}\n\n// Aliases to work with joined versions like `ios_saf 7.0-7.1`\nbrowserslist.versionAliases = { }\n\nbrowserslist.clearCaches = env.clearCaches\nbrowserslist.parseConfig = env.parseConfig\nbrowserslist.readConfig = env.readConfig\nbrowserslist.findConfig = env.findConfig\nbrowserslist.loadConfig = env.loadConfig\n\n/**\n * Return browsers market coverage.\n *\n * @param {string[]} browsers Browsers names in Can I Use.\n * @param {string|object} [stats=\"global\"] Which statistics should be used.\n * Country code or custom statistics.\n * Pass `\"my stats\"` to load statistics\n * from Browserslist files.\n *\n * @return {number} Total market coverage for all selected browsers.\n *\n * @example\n * browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1\n */\nbrowserslist.coverage = function (browsers, stats) {\n var data\n if (typeof stats === 'undefined') {\n data = browserslist.usage.global\n } else if (stats === 'my stats') {\n var opts = {}\n opts.path = path.resolve ? path.resolve('.') : '.'\n var customStats = env.getStat(opts)\n if (!customStats) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n data = {}\n for (var browser in customStats) {\n fillUsage(data, browser, customStats[browser])\n }\n } else if (typeof stats === 'string') {\n if (stats.length > 2) {\n stats = stats.toLowerCase()\n } else {\n stats = stats.toUpperCase()\n }\n env.loadCountry(browserslist.usage, stats)\n data = browserslist.usage[stats]\n } else {\n if ('dataByBrowser' in stats) {\n stats = stats.dataByBrowser\n }\n data = { }\n for (var name in stats) {\n for (var version in stats[name]) {\n data[name + ' ' + version] = stats[name][version]\n }\n }\n }\n\n return browsers.reduce(function (all, i) {\n var usage = data[i]\n if (usage === undefined) {\n usage = data[i.replace(/ \\S+$/, ' 0')]\n }\n return all + (usage || 0)\n }, 0)\n}\n\nvar QUERIES = [\n {\n regexp: /^last\\s+(\\d+)\\s+major\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = getMajorVersions(data.released, versions)\n list = list.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = data.released.slice(-versions)\n list = list.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+electron\\s+major\\s+versions?$/i,\n select: function (context, versions) {\n var validVersions = getMajorVersions(Object.keys(e2c).reverse(), versions)\n return validVersions.map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+(\\w+)\\s+major\\s+versions?$/i,\n select: function (context, versions, name) {\n var data = checkName(name, context)\n var validVersions = getMajorVersions(data.released, versions)\n var list = validVersions.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return list\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+electron\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(e2c).reverse().slice(-versions).map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+(\\w+)\\s+versions?$/i,\n select: function (context, versions, name) {\n var data = checkName(name, context)\n var list = data.released.slice(-versions).map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return list\n }\n },\n {\n regexp: /^unreleased\\s+versions$/i,\n select: function (context) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = data.versions.filter(function (v) {\n return data.released.indexOf(v) === -1\n })\n list = list.map(nameMapper(data.name))\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^unreleased\\s+electron\\s+versions?$/i,\n select: function () {\n return []\n }\n },\n {\n regexp: /^unreleased\\s+(\\w+)\\s+versions?$/i,\n select: function (context, name) {\n var data = checkName(name, context)\n return data.versions.filter(function (v) {\n return data.released.indexOf(v) === -1\n }).map(nameMapper(data.name))\n }\n },\n {\n regexp: /^last\\s+(\\d*.?\\d+)\\s+years?$/i,\n select: function (context, years) {\n return filterByYear(Date.now() - YEAR * years, context)\n }\n },\n {\n regexp: /^since (\\d+)(?:-(\\d+))?(?:-(\\d+))?$/i,\n select: function (context, year, month, date) {\n year = parseInt(year)\n month = parseInt(month || '01') - 1\n date = parseInt(date || '01')\n return filterByYear(Date.UTC(year, month, date, 0, 0, 0), context)\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%$/,\n select: function (context, sign, popularity) {\n popularity = parseFloat(popularity)\n var usage = browserslist.usage.global\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+my\\s+stats$/,\n select: function (context, sign, popularity) {\n popularity = parseFloat(popularity)\n if (!context.customUsage) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n var usage = context.customUsage\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+(\\S+)\\s+stats$/,\n select: function (context, sign, popularity, name) {\n popularity = parseFloat(popularity)\n var stats = env.loadStat(context, name, browserslist.data)\n if (stats) {\n context.customUsage = { }\n for (var browser in stats) {\n fillUsage(context.customUsage, browser, stats[browser])\n }\n }\n if (!context.customUsage) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n var usage = context.customUsage\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+((alt-)?\\w\\w)$/,\n select: function (context, sign, popularity, place) {\n popularity = parseFloat(popularity)\n if (place.length === 2) {\n place = place.toUpperCase()\n } else {\n place = place.toLowerCase()\n }\n env.loadCountry(browserslist.usage, place)\n var usage = browserslist.usage[place]\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^cover\\s+(\\d*\\.?\\d+)%(\\s+in\\s+(my\\s+stats|(alt-)?\\w\\w))?$/,\n select: function (context, coverage, statMode) {\n coverage = parseFloat(coverage)\n var usage = browserslist.usage.global\n if (statMode) {\n if (statMode.match(/^\\s+in\\s+my\\s+stats$/)) {\n if (!context.customUsage) {\n throw new BrowserslistError(\n 'Custom usage statistics was not provided'\n )\n }\n usage = context.customUsage\n } else {\n var match = statMode.match(/\\s+in\\s+((alt-)?\\w\\w)/)\n var place = match[1]\n if (place.length === 2) {\n place = place.toUpperCase()\n } else {\n place = place.toLowerCase()\n }\n env.loadCountry(browserslist.usage, place)\n usage = browserslist.usage[place]\n }\n }\n var versions = Object.keys(usage).sort(function (a, b) {\n return usage[b] - usage[a]\n })\n var coveraged = 0\n var result = []\n var version\n for (var i = 0; i <= versions.length; i++) {\n version = versions[i]\n if (usage[version] === 0) break\n coveraged += usage[version]\n result.push(version)\n if (coveraged >= coverage) break\n }\n return result\n }\n },\n {\n regexp: /^electron\\s+([\\d.]+)\\s*-\\s*([\\d.]+)$/i,\n select: function (context, from, to) {\n var fromToUse = normalizeElectron(from)\n var toToUse = normalizeElectron(to)\n if (!e2c[fromToUse]) {\n throw new BrowserslistError('Unknown version ' + from + ' of electron')\n }\n if (!e2c[toToUse]) {\n throw new BrowserslistError('Unknown version ' + to + ' of electron')\n }\n from = parseFloat(from)\n to = parseFloat(to)\n return Object.keys(e2c).filter(function (i) {\n var parsed = parseFloat(i)\n return parsed >= from && parsed <= to\n }).map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^(\\w+)\\s+([\\d.]+)\\s*-\\s*([\\d.]+)$/i,\n select: function (context, name, from, to) {\n var data = checkName(name, context)\n from = parseFloat(normalizeVersion(data, from) || from)\n to = parseFloat(normalizeVersion(data, to) || to)\n function filter (v) {\n var parsed = parseFloat(v)\n return parsed >= from && parsed <= to\n }\n return data.released.filter(filter).map(nameMapper(data.name))\n }\n },\n {\n regexp: /^electron\\s*(>=?|<=?)\\s*([\\d.]+)$/i,\n select: function (context, sign, version) {\n var versionToUse = normalizeElectron(version)\n return Object.keys(e2c)\n .filter(generateFilter(sign, versionToUse))\n .map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^node\\s*(>=?|<=?)\\s*([\\d.]+)$/i,\n select: function (context, sign, version) {\n var nodeVersions = jsReleases.filter(function (i) {\n return i.name === 'nodejs'\n }).map(function (i) {\n return i.version\n })\n return nodeVersions\n .filter(generateSemverFilter(sign, version))\n .map(function (v) {\n return 'node ' + v\n })\n }\n },\n {\n regexp: /^(\\w+)\\s*(>=?|<=?)\\s*([\\d.]+)$/,\n select: function (context, name, sign, version) {\n var data = checkName(name, context)\n var alias = browserslist.versionAliases[data.name][version]\n if (alias) {\n version = alias\n }\n return data.released\n .filter(generateFilter(sign, version))\n .map(function (v) {\n return data.name + ' ' + v\n })\n }\n },\n {\n regexp: /^(firefox|ff|fx)\\s+esr$/i,\n select: function () {\n return ['firefox 68']\n }\n },\n {\n regexp: /(operamini|op_mini)\\s+all/i,\n select: function () {\n return ['op_mini all']\n }\n },\n {\n regexp: /^electron\\s+([\\d.]+)$/i,\n select: function (context, version) {\n var versionToUse = normalizeElectron(version)\n var chrome = e2c[versionToUse]\n if (!chrome) {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of electron')\n }\n return ['chrome ' + chrome]\n }\n },\n {\n regexp: /^node\\s+(\\d+(\\.\\d+)?(\\.\\d+)?)$/i,\n select: function (context, version) {\n var nodeReleases = jsReleases.filter(function (i) {\n return i.name === 'nodejs'\n })\n var matched = nodeReleases.filter(function (i) {\n return isVersionsMatch(i.version, version)\n })\n if (matched.length === 0) {\n if (context.ignoreUnknownVersions) {\n return []\n } else {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of Node.js')\n }\n }\n return ['node ' + matched[matched.length - 1].version]\n }\n },\n {\n regexp: /^current\\s+node$/i,\n select: function (context) {\n return [env.currentNode(resolve, context)]\n }\n },\n {\n regexp: /^maintained\\s+node\\s+versions$/i,\n select: function (context) {\n var now = Date.now()\n var queries = Object.keys(jsEOL).filter(function (key) {\n return now < Date.parse(jsEOL[key].end) &&\n now > Date.parse(jsEOL[key].start) &&\n isEolReleased(key)\n }).map(function (key) {\n return 'node ' + key.slice(1)\n })\n return resolve(queries, context)\n }\n },\n {\n regexp: /^phantomjs\\s+1.9$/i,\n select: function () {\n return ['safari 5']\n }\n },\n {\n regexp: /^phantomjs\\s+2.1$/i,\n select: function () {\n return ['safari 6']\n }\n },\n {\n regexp: /^(\\w+)\\s+(tp|[\\d.]+)$/i,\n select: function (context, name, version) {\n if (/^tp$/i.test(version)) version = 'TP'\n var data = checkName(name, context)\n var alias = normalizeVersion(data, version)\n if (alias) {\n version = alias\n } else {\n if (version.indexOf('.') === -1) {\n alias = version + '.0'\n } else {\n alias = version.replace(/\\.0$/, '')\n }\n alias = normalizeVersion(data, alias)\n if (alias) {\n version = alias\n } else if (context.ignoreUnknownVersions) {\n return []\n } else {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of ' + name)\n }\n }\n return [data.name + ' ' + version]\n }\n },\n {\n regexp: /^extends (.+)$/i,\n select: function (context, name) {\n return resolve(env.loadQueries(context, name), context)\n }\n },\n {\n regexp: /^defaults$/i,\n select: function (context) {\n return resolve(browserslist.defaults, context)\n }\n },\n {\n regexp: /^dead$/i,\n select: function (context) {\n var dead = [\n 'ie <= 10', 'ie_mob <= 10',\n 'bb <= 10',\n 'op_mob <= 12.1',\n 'samsung 4'\n ]\n return resolve(dead, context)\n }\n },\n {\n regexp: /^(\\w+)$/i,\n select: function (context, name) {\n if (byName(name, context)) {\n throw new BrowserslistError(\n 'Specify versions in Browserslist query for browser ' + name)\n } else {\n throw unknownQuery(name)\n }\n }\n }\n];\n\n// Get and convert Can I Use data\n\n(function () {\n for (var name in agents) {\n var browser = agents[name]\n browserslist.data[name] = {\n name: name,\n versions: normalize(agents[name].versions),\n released: normalize(agents[name].versions.slice(0, -3)),\n releaseDate: agents[name].release_date\n }\n fillUsage(browserslist.usage.global, name, browser.usage_global)\n\n browserslist.versionAliases[name] = { }\n for (var i = 0; i < browser.versions.length; i++) {\n var full = browser.versions[i]\n if (!full) continue\n\n if (full.indexOf('-') !== -1) {\n var interval = full.split('-')\n for (var j = 0; j < interval.length; j++) {\n browserslist.versionAliases[name][interval[j]] = full\n }\n }\n }\n }\n}())\n\nmodule.exports = browserslist\n","'use strict';\nconst array = [];\nconst charCodeCache = [];\n\nconst leven = (left, right) => {\n\tif (left === right) {\n\t\treturn 0;\n\t}\n\n\tconst swap = left;\n\n\t// Swapping the strings if `a` is longer than `b` so we know which one is the\n\t// shortest & which one is the longest\n\tif (left.length > right.length) {\n\t\tleft = right;\n\t\tright = swap;\n\t}\n\n\tlet leftLength = left.length;\n\tlet rightLength = right.length;\n\n\t// Performing suffix trimming:\n\t// We can linearly drop suffix common to both strings since they\n\t// don't increase distance at all\n\t// Note: `~-` is the bitwise way to perform a `- 1` operation\n\twhile (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {\n\t\tleftLength--;\n\t\trightLength--;\n\t}\n\n\t// Performing prefix trimming\n\t// We can linearly drop prefix common to both strings since they\n\t// don't increase distance at all\n\tlet start = 0;\n\n\twhile (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) {\n\t\tstart++;\n\t}\n\n\tleftLength -= start;\n\trightLength -= start;\n\n\tif (leftLength === 0) {\n\t\treturn rightLength;\n\t}\n\n\tlet bCharCode;\n\tlet result;\n\tlet temp;\n\tlet temp2;\n\tlet i = 0;\n\tlet j = 0;\n\n\twhile (i < leftLength) {\n\t\tcharCodeCache[i] = left.charCodeAt(start + i);\n\t\tarray[i] = ++i;\n\t}\n\n\twhile (j < rightLength) {\n\t\tbCharCode = right.charCodeAt(start + j);\n\t\ttemp = j++;\n\t\tresult = j;\n\n\t\tfor (i = 0; i < leftLength; i++) {\n\t\t\ttemp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;\n\t\t\ttemp = array[i];\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tresult = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;\n\t\t}\n\t}\n\n\treturn result;\n};\n\nmodule.exports = leven;\n// TODO: Remove this for the next major release\nmodule.exports.default = leven;\n","import leven from 'leven';\n\nexport default function levenArray(str, array) {\n let minLeven = Number.POSITIVE_INFINITY;\n let result = undefined;\n for(const item of array) {\n const distance = leven(str, item);\n if (distance < minLeven) {\n minLeven = distance;\n result = item;\n }\n }\n return result;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/native-modules.json\");\n","export const unreleasedLabels = {\n safari: \"tp\",\n};\n\nexport const browserNameMap = {\n and_chr: \"chrome\",\n and_ff: \"firefox\",\n android: \"android\",\n chrome: \"chrome\",\n edge: \"edge\",\n firefox: \"firefox\",\n ie: \"ie\",\n ie_mob: \"ie\",\n ios_saf: \"ios\",\n node: \"node\",\n op_mob: \"opera\",\n opera: \"opera\",\n safari: \"safari\",\n samsung: \"samsung\",\n};\n","// @flow\n\nimport invariant from \"invariant\";\nimport semver from \"semver\";\n\nimport { unreleasedLabels } from \"./targets\";\nimport type { Target, Targets } from \"./types\";\n\nconst versionRegExp = /^(\\d+|\\d+.\\d+)$/;\n\nexport function semverMin(first: ?string, second: string): string {\n return first && semver.lt(first, second) ? first : second;\n}\n\n// Convert version to a semver value.\n// 2.5 -> 2.5.0; 1 -> 1.0.0;\nexport function semverify(version: number | string): string {\n if (typeof version === \"string\" && semver.valid(version)) {\n return version;\n }\n\n invariant(\n typeof version === \"number\" ||\n (typeof version === \"string\" && versionRegExp.test(version)),\n `'${version}' is not a valid version`,\n );\n\n const split = version.toString().split(\".\");\n while (split.length < 3) {\n split.push(\"0\");\n }\n return split.join(\".\");\n}\n\nexport function isUnreleasedVersion(\n version: string | number,\n env: string,\n): boolean {\n const unreleasedLabel = unreleasedLabels[env];\n return (\n !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase()\n );\n}\n\nexport function getLowestUnreleased(a: string, b: string, env: string): string {\n const unreleasedLabel = unreleasedLabels[env];\n const hasUnreleased = [a, b].some(item => item === unreleasedLabel);\n if (hasUnreleased) {\n return a === hasUnreleased ? b : a || b;\n }\n return semverMin(a, b);\n}\n\nexport function getLowestImplementedVersion(\n plugin: Targets,\n environment: Target,\n): string {\n const result = plugin[environment];\n // When Android support data is absent, use Chrome data as fallback\n if (!result && environment === \"android\") {\n return plugin.chrome;\n }\n return result;\n}\n","// @flow\n\nexport const TargetNames = {\n esmodules: \"esmodules\",\n node: \"node\",\n browsers: \"browsers\",\n chrome: \"chrome\",\n opera: \"opera\",\n edge: \"edge\",\n firefox: \"firefox\",\n safari: \"safari\",\n ie: \"ie\",\n ios: \"ios\",\n android: \"android\",\n electron: \"electron\",\n samsung: \"samsung\",\n\n // deprecated\n uglify: \"uglify\",\n};\n","import semver from \"semver\";\nimport { unreleasedLabels } from \"./targets\";\n\nexport function prettifyVersion(version: string) {\n if (typeof version !== \"string\") {\n return version;\n }\n\n const parts = [semver.major(version)];\n const minor = semver.minor(version);\n const patch = semver.patch(version);\n\n if (minor || patch) {\n parts.push(minor);\n }\n\n if (patch) {\n parts.push(patch);\n }\n\n return parts.join(\".\");\n}\n\nexport function prettifyTargets(targets: Targets): Targets {\n return Object.keys(targets).reduce((results, target) => {\n let value = targets[target];\n\n const unreleasedLabel = unreleasedLabels[target];\n if (typeof value === \"string\" && unreleasedLabel !== value) {\n value = prettifyVersion(value);\n }\n\n results[target] = value;\n return results;\n }, {});\n}\n","// @flow\n\nimport semver from \"semver\";\nimport { prettifyVersion } from \"./pretty\";\nimport {\n semverify,\n isUnreleasedVersion,\n getLowestImplementedVersion,\n} from \"./utils\";\nimport type { Targets } from \"./types\";\n\nexport function getInclusionReasons(\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) {\n const minVersions = list[item] || {};\n\n return Object.keys(targetVersions).reduce((result, env) => {\n const minVersion = getLowestImplementedVersion(minVersions, env);\n const targetVersion = targetVersions[env];\n\n if (!minVersion) {\n result[env] = prettifyVersion(targetVersion);\n } else {\n const minIsUnreleased = isUnreleasedVersion(minVersion, env);\n const targetIsUnreleased = isUnreleasedVersion(targetVersion, env);\n\n if (\n !targetIsUnreleased &&\n (minIsUnreleased ||\n semver.lt(targetVersion.toString(), semverify(minVersion)))\n ) {\n result[env] = prettifyVersion(targetVersion);\n }\n }\n\n return result;\n }, {});\n}\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/plugins.json\");\n","// @flow\n\nimport semver from \"semver\";\n\nimport pluginsCompatData from \"@babel/compat-data/plugins\";\n\nimport type { Targets } from \"./types\";\nimport {\n getLowestImplementedVersion,\n isUnreleasedVersion,\n semverify,\n} from \"./utils\";\n\nexport function targetsSupported(target: Targets, support: Targets) {\n const targetEnvironments = Object.keys(target);\n\n if (targetEnvironments.length === 0) {\n return false;\n }\n\n const unsupportedEnvironments = targetEnvironments.filter(environment => {\n const lowestImplementedVersion = getLowestImplementedVersion(\n support,\n environment,\n );\n\n // Feature is not implemented in that environment\n if (!lowestImplementedVersion) {\n return true;\n }\n\n const lowestTargetedVersion = target[environment];\n\n // If targets has unreleased value as a lowest version, then don't require a plugin.\n if (isUnreleasedVersion(lowestTargetedVersion, environment)) {\n return false;\n }\n\n // Include plugin if it is supported in the unreleased environment, which wasn't specified in targets\n if (isUnreleasedVersion(lowestImplementedVersion, environment)) {\n return true;\n }\n\n if (!semver.valid(lowestTargetedVersion.toString())) {\n throw new Error(\n `Invalid version passed for target \"${environment}\": \"${lowestTargetedVersion}\". ` +\n \"Versions must be in semver format (major.minor.patch)\",\n );\n }\n\n return semver.gt(\n semverify(lowestImplementedVersion),\n lowestTargetedVersion.toString(),\n );\n });\n\n return unsupportedEnvironments.length === 0;\n}\n\nexport function isRequired(\n name: string,\n targets: Targets,\n {\n compatData = pluginsCompatData,\n includes,\n excludes,\n }: {\n compatData?: { [feature: string]: Targets },\n includes?: Set,\n excludes?: Set,\n } = {},\n) {\n if (excludes && excludes.has(name)) return false;\n if (includes && includes.has(name)) return true;\n return !targetsSupported(targets, compatData[name]);\n}\n\nexport default function filterItems(\n list: { [feature: string]: Targets },\n includes: Set,\n excludes: Set,\n targets: Targets,\n defaultIncludes: Array | null,\n defaultExcludes?: Array | null,\n pluginSyntaxMap?: Map,\n) {\n const result = new Set();\n const options = { compatData: list, includes, excludes };\n\n for (const item in list) {\n if (isRequired(item, targets, options)) {\n result.add(item);\n } else if (pluginSyntaxMap) {\n const shippedProposalsSyntax = pluginSyntaxMap.get(item);\n\n if (shippedProposalsSyntax) {\n result.add(shippedProposalsSyntax);\n }\n }\n }\n\n if (defaultIncludes) {\n defaultIncludes.forEach(item => !excludes.has(item) && result.add(item));\n }\n\n if (defaultExcludes) {\n defaultExcludes.forEach(item => !includes.has(item) && result.delete(item));\n }\n\n return result;\n}\n","// @flow\n\nimport browserslist from \"browserslist\";\nimport findSuggestion from \"levenary\";\nimport invariant from \"invariant\";\nimport browserModulesData from \"@babel/compat-data/native-modules\";\n\nimport {\n semverify,\n semverMin,\n isUnreleasedVersion,\n getLowestUnreleased,\n} from \"./utils\";\nimport { browserNameMap } from \"./targets\";\nimport { TargetNames } from \"./options\";\nimport type { Targets } from \"./types\";\n\nexport type { Targets };\n\nexport { prettifyTargets } from \"./pretty\";\nexport { getInclusionReasons } from \"./debug\";\nexport { default as filterItems, isRequired } from \"./filter-items\";\nexport { unreleasedLabels } from \"./targets\";\n\nconst browserslistDefaults = browserslist.defaults;\n\nconst validBrowserslistTargets = [\n ...Object.keys(browserslist.data),\n ...Object.keys(browserslist.aliases),\n];\n\nfunction objectToBrowserslist(object: Targets): Array {\n return Object.keys(object).reduce((list, targetName) => {\n if (validBrowserslistTargets.indexOf(targetName) >= 0) {\n const targetVersion = object[targetName];\n return list.concat(`${targetName} ${targetVersion}`);\n }\n return list;\n }, []);\n}\n\nfunction validateTargetNames(targets: Targets): void {\n const validTargets = Object.keys(TargetNames);\n for (const target in targets) {\n if (!TargetNames[target]) {\n throw new Error(\n `Invalid Option: '${target}' is not a valid target\n Maybe you meant to use '${findSuggestion(target, validTargets)}'?`,\n );\n }\n }\n}\n\nexport function isBrowsersQueryValid(\n browsers: string | Array | Targets,\n): boolean {\n return typeof browsers === \"string\" || Array.isArray(browsers);\n}\n\nfunction validateBrowsers(browsers) {\n invariant(\n typeof browsers === \"undefined\" || isBrowsersQueryValid(browsers),\n `Invalid Option: '${browsers}' is not a valid browserslist query`,\n );\n\n return browsers;\n}\n\nfunction mergeBrowsers(fromQuery: Targets, fromTarget: Targets) {\n return Object.keys(fromTarget).reduce((queryObj, targKey) => {\n if (targKey !== TargetNames.browsers) {\n queryObj[targKey] = fromTarget[targKey];\n }\n return queryObj;\n }, fromQuery);\n}\n\nfunction getLowestVersions(browsers: Array): Targets {\n return browsers.reduce((all: Object, browser: string): Object => {\n const [browserName, browserVersion] = browser.split(\" \");\n const normalizedBrowserName = browserNameMap[browserName];\n\n if (!normalizedBrowserName) {\n return all;\n }\n\n try {\n // Browser version can return as \"10.0-10.2\"\n const splitVersion = browserVersion.split(\"-\")[0].toLowerCase();\n const isSplitUnreleased = isUnreleasedVersion(splitVersion, browserName);\n\n if (!all[normalizedBrowserName]) {\n all[normalizedBrowserName] = isSplitUnreleased\n ? splitVersion\n : semverify(splitVersion);\n return all;\n }\n\n const version = all[normalizedBrowserName];\n const isUnreleased = isUnreleasedVersion(version, browserName);\n\n if (isUnreleased && isSplitUnreleased) {\n all[normalizedBrowserName] = getLowestUnreleased(\n version,\n splitVersion,\n browserName,\n );\n } else if (isUnreleased) {\n all[normalizedBrowserName] = semverify(splitVersion);\n } else if (!isUnreleased && !isSplitUnreleased) {\n const parsedBrowserVersion = semverify(splitVersion);\n\n all[normalizedBrowserName] = semverMin(version, parsedBrowserVersion);\n }\n } catch (e) {}\n\n return all;\n }, {});\n}\n\nfunction outputDecimalWarning(decimalTargets: Array): void {\n if (!decimalTargets || !decimalTargets.length) {\n return;\n }\n\n console.log(\"Warning, the following targets are using a decimal version:\");\n console.log(\"\");\n decimalTargets.forEach(({ target, value }) =>\n console.log(` ${target}: ${value}`),\n );\n console.log(\"\");\n console.log(\n \"We recommend using a string for minor/patch versions to avoid numbers like 6.10\",\n );\n console.log(\"getting parsed as 6.1, which can lead to unexpected behavior.\");\n console.log(\"\");\n}\n\nfunction semverifyTarget(target, value) {\n try {\n return semverify(value);\n } catch (error) {\n throw new Error(\n `Invalid Option: '${value}' is not a valid value for 'targets.${target}'.`,\n );\n }\n}\n\nconst targetParserMap = {\n __default(target, value) {\n const version = isUnreleasedVersion(value, target)\n ? value.toLowerCase()\n : semverifyTarget(target, value);\n return [target, version];\n },\n\n // Parse `node: true` and `node: \"current\"` to version\n node(target, value) {\n const parsed =\n value === true || value === \"current\"\n ? process.versions.node\n : semverifyTarget(target, value);\n return [target, parsed];\n },\n};\n\ntype ParsedResult = {\n targets: Targets,\n decimalWarnings: Array,\n};\n\nexport default function getTargets(\n targets: Object = {},\n options: Object = {},\n): Targets {\n const targetOpts: Targets = {};\n\n validateTargetNames(targets);\n\n // `esmodules` as a target indicates the specific set of browsers supporting ES Modules.\n // These values OVERRIDE the `browsers` field.\n if (targets.esmodules) {\n const supportsESModules = browserModulesData[\"es6.module\"];\n targets.browsers = Object.keys(supportsESModules)\n .map(browser => `${browser} ${supportsESModules[browser]}`)\n .join(\", \");\n }\n\n // Parse browsers target via browserslist\n const browsersquery = validateBrowsers(targets.browsers);\n\n const hasTargets = Object.keys(targets).length > 0;\n const shouldParseBrowsers = !!targets.browsers;\n const shouldSearchForConfig =\n !options.ignoreBrowserslistConfig && !hasTargets;\n\n if (shouldParseBrowsers || shouldSearchForConfig) {\n // If no targets are passed, we need to overwrite browserslist's defaults\n // so that we enable all transforms (acting like the now deprecated\n // preset-latest).\n //\n // Note, if browserslist resolves the config (ex. package.json), then usage\n // of `defaults` in queries will be different since we don't want to break\n // the behavior of \"no targets is the same as preset-latest\".\n if (!hasTargets) {\n browserslist.defaults = objectToBrowserslist(targets);\n }\n\n const browsers = browserslist(browsersquery, {\n path: options.configPath,\n mobileToDesktop: true,\n });\n\n const queryBrowsers = getLowestVersions(browsers);\n targets = mergeBrowsers(queryBrowsers, targets);\n\n // Reset browserslist defaults\n browserslist.defaults = browserslistDefaults;\n }\n\n // Parse remaining targets\n const parsed = Object.keys(targets)\n .filter(value => value !== TargetNames.esmodules)\n .sort()\n .reduce(\n (results: ParsedResult, target: string): ParsedResult => {\n if (target !== TargetNames.browsers) {\n const value = targets[target];\n\n // Warn when specifying minor/patch as a decimal\n if (typeof value === \"number\" && value % 1 !== 0) {\n results.decimalWarnings.push({ target, value });\n }\n\n // Check if we have a target parser?\n const parser = targetParserMap[target] || targetParserMap.__default;\n const [parsedTarget, parsedValue] = parser(target, value);\n\n if (parsedValue) {\n // Merge (lowest wins)\n results.targets[parsedTarget] = parsedValue;\n }\n }\n\n return results;\n },\n {\n targets: targetOpts,\n decimalWarnings: [],\n },\n );\n\n outputDecimalWarning(parsed.decimalWarnings);\n\n return parsed.targets;\n}\n","// @flow\n\nimport {\n getInclusionReasons,\n type Targets,\n} from \"@babel/helper-compilation-targets\";\n\nconst wordEnds = (size: number) => {\n return size > 1 ? \"s\" : \"\";\n};\n\n// Outputs a message that shows which target(s) caused an item to be included:\n// transform-foo { \"edge\":\"13\", \"firefox\":\"49\", \"ie\":\"10\" }\nexport const logPluginOrPolyfill = (\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) => {\n const filteredList = getInclusionReasons(item, targetVersions, list);\n\n const formattedTargets = JSON.stringify(filteredList)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n\n console.log(` ${item} ${formattedTargets}`);\n};\n\nexport const logEntryPolyfills = (\n polyfillName: string,\n importPolyfillIncluded: boolean,\n polyfills: Set,\n filename: string,\n polyfillTargets: Targets,\n allBuiltInsList: { [key: string]: Targets },\n) => {\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n if (!importPolyfillIncluded) {\n console.log(`\\n[${filename}] Import of ${polyfillName} was not found.`);\n return;\n }\n if (!polyfills.size) {\n console.log(\n `\\n[${filename}] Based on your targets, polyfills were not added.`,\n );\n return;\n }\n\n console.log(\n `\\n[${filename}] Replaced ${polyfillName} entries with the following polyfill${wordEnds(\n polyfills.size,\n )}:`,\n );\n for (const polyfill of polyfills) {\n logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);\n }\n};\n\nexport const logUsagePolyfills = (\n polyfills: Set,\n filename: string,\n polyfillTargets: Targets,\n allBuiltInsList: { [key: string]: Targets },\n) => {\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n if (!polyfills.size) {\n console.log(\n `\\n[${filename}] Based on your code and targets, core-js polyfills were not added.`,\n );\n return;\n }\n console.log(\n `\\n[${filename}] Added following core-js polyfill${wordEnds(\n polyfills.size,\n )}:`,\n );\n for (const polyfill of polyfills) {\n logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);\n }\n};\n","// @flow\n\nconst defaultExcludesForLooseMode = [\"transform-typeof-symbol\"];\n\nexport default function({ loose }: { loose: boolean }): null | string[] {\n return loose ? defaultExcludesForLooseMode : null;\n}\n","// @flow\n\nexport function removeUnnecessaryItems(\n items: Set,\n overlapping: { [name: string]: string[] },\n) {\n items.forEach(item => {\n // $FlowIgnore Flow doesn't support calls in optional chains\n overlapping[item]?.forEach(name => items.delete(name));\n });\n}\n","// @flow\n\nimport typeof AvailablePlugins from \"./available-plugins\";\n\nexport default ({\n auto: \"transform-modules-commonjs\",\n amd: \"transform-modules-amd\",\n commonjs: \"transform-modules-commonjs\",\n cjs: \"transform-modules-commonjs\",\n systemjs: \"transform-modules-systemjs\",\n umd: \"transform-modules-umd\",\n}: { [transform: string]: $Keys });\n","'use strict';\nconst array = [];\nconst charCodeCache = [];\n\nconst leven = (left, right) => {\n\tif (left === right) {\n\t\treturn 0;\n\t}\n\n\tconst swap = left;\n\n\t// Swapping the strings if `a` is longer than `b` so we know which one is the\n\t// shortest & which one is the longest\n\tif (left.length > right.length) {\n\t\tleft = right;\n\t\tright = swap;\n\t}\n\n\tlet leftLength = left.length;\n\tlet rightLength = right.length;\n\n\t// Performing suffix trimming:\n\t// We can linearly drop suffix common to both strings since they\n\t// don't increase distance at all\n\t// Note: `~-` is the bitwise way to perform a `- 1` operation\n\twhile (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {\n\t\tleftLength--;\n\t\trightLength--;\n\t}\n\n\t// Performing prefix trimming\n\t// We can linearly drop prefix common to both strings since they\n\t// don't increase distance at all\n\tlet start = 0;\n\n\twhile (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) {\n\t\tstart++;\n\t}\n\n\tleftLength -= start;\n\trightLength -= start;\n\n\tif (leftLength === 0) {\n\t\treturn rightLength;\n\t}\n\n\tlet bCharCode;\n\tlet result;\n\tlet temp;\n\tlet temp2;\n\tlet i = 0;\n\tlet j = 0;\n\n\twhile (i < leftLength) {\n\t\tcharCodeCache[i] = left.charCodeAt(start + i);\n\t\tarray[i] = ++i;\n\t}\n\n\twhile (j < rightLength) {\n\t\tbCharCode = right.charCodeAt(start + j);\n\t\ttemp = j++;\n\t\tresult = j;\n\n\t\tfor (i = 0; i < leftLength; i++) {\n\t\t\ttemp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;\n\t\t\ttemp = array[i];\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tresult = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;\n\t\t}\n\t}\n\n\treturn result;\n};\n\nmodule.exports = leven;\n// TODO: Remove this for the next major release\nmodule.exports.default = leven;\n","import leven from 'leven';\n\nexport default function levenArray(str, array) {\n let minLeven = Number.POSITIVE_INFINITY;\n let result = undefined;\n for(const item of array) {\n const distance = leven(str, item);\n if (distance < minLeven) {\n minLeven = distance;\n result = item;\n }\n }\n return result;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/corejs2-built-ins.json\");\n","// @flow\n\nexport const TopLevelOptions = {\n configPath: \"configPath\",\n corejs: \"corejs\",\n debug: \"debug\",\n exclude: \"exclude\",\n forceAllTransforms: \"forceAllTransforms\",\n ignoreBrowserslistConfig: \"ignoreBrowserslistConfig\",\n include: \"include\",\n loose: \"loose\",\n modules: \"modules\",\n shippedProposals: \"shippedProposals\",\n spec: \"spec\",\n targets: \"targets\",\n useBuiltIns: \"useBuiltIns\",\n};\n\nexport const ModulesOption = {\n false: false,\n auto: \"auto\",\n amd: \"amd\",\n commonjs: \"commonjs\",\n cjs: \"cjs\",\n systemjs: \"systemjs\",\n umd: \"umd\",\n};\n\nexport const UseBuiltInsOption = {\n false: false,\n entry: \"entry\",\n usage: \"usage\",\n};\n","// @flow\n\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport const defaultWebIncludes = [\n \"web.timers\",\n \"web.immediate\",\n \"web.dom.iterable\",\n];\n\nexport default function(targets: Targets): null | string[] {\n const targetNames = Object.keys(targets);\n const isAnyTarget = !targetNames.length;\n const isWebTarget = targetNames.some(name => name !== \"node\");\n\n return isAnyTarget || isWebTarget ? defaultWebIncludes : null;\n}\n","// @flow\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport findSuggestion from \"levenary\";\nimport invariant from \"invariant\";\nimport { coerce, SemVer } from \"semver\";\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport pluginsList from \"@babel/compat-data/plugins\";\nimport moduleTransformations from \"./module-transformations\";\nimport { TopLevelOptions, ModulesOption, UseBuiltInsOption } from \"./options\";\nimport { defaultWebIncludes } from \"./polyfills/corejs2/get-platform-specific-default\";\n\nimport type {\n BuiltInsOption,\n CorejsOption,\n ModuleOption,\n Options,\n PluginListItem,\n PluginListOption,\n} from \"./types\";\n\nconst validateTopLevelOptions = (options: Options) => {\n const validOptions = Object.keys(TopLevelOptions);\n\n for (const option in options) {\n if (!TopLevelOptions[option]) {\n throw new Error(\n `Invalid Option: ${option} is not a valid top-level option.\n Maybe you meant to use '${findSuggestion(option, validOptions)}'?`,\n );\n }\n }\n};\n\nconst allPluginsList = Object.keys(pluginsList);\n\n// NOTE: Since module plugins are handled seperatly compared to other plugins (via the \"modules\" option) it\n// should only be possible to exclude and not include module plugins, otherwise it's possible that preset-env\n// will add a module plugin twice.\nconst modulePlugins = [\n \"proposal-dynamic-import\",\n ...Object.keys(moduleTransformations).map(m => moduleTransformations[m]),\n];\n\nconst getValidIncludesAndExcludes = (\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) =>\n new Set([\n ...allPluginsList,\n ...(type === \"exclude\" ? modulePlugins : []),\n ...(corejs\n ? corejs == 2\n ? [...Object.keys(corejs2Polyfills), ...defaultWebIncludes]\n : Object.keys(corejs3Polyfills)\n : []),\n ]);\n\nconst pluginToRegExp = (plugin: PluginListItem) => {\n if (plugin instanceof RegExp) return plugin;\n try {\n return new RegExp(`^${normalizePluginName(plugin)}$`);\n } catch (e) {\n return null;\n }\n};\n\nconst selectPlugins = (\n regexp: RegExp | null,\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) =>\n Array.from(getValidIncludesAndExcludes(type, corejs)).filter(\n item => regexp instanceof RegExp && regexp.test(item),\n );\n\nconst flatten = (array: Array>): Array => [].concat(...array);\n\nconst expandIncludesAndExcludes = (\n plugins: PluginListOption = [],\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) => {\n if (plugins.length === 0) return [];\n\n const selectedPlugins = plugins.map(plugin =>\n selectPlugins(pluginToRegExp(plugin), type, corejs),\n );\n const invalidRegExpList = plugins.filter(\n (p, i) => selectedPlugins[i].length === 0,\n );\n\n invariant(\n invalidRegExpList.length === 0,\n `Invalid Option: The plugins/built-ins '${invalidRegExpList.join(\n \", \",\n )}' passed to the '${type}' option are not\n valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env`,\n );\n\n return flatten(selectedPlugins);\n};\n\nexport const normalizePluginName = (plugin: string) =>\n plugin.replace(/^(@babel\\/|babel-)(plugin-)?/, \"\");\n\nexport const checkDuplicateIncludeExcludes = (\n include: Array = [],\n exclude: Array = [],\n) => {\n const duplicates = include.filter(opt => exclude.indexOf(opt) >= 0);\n\n invariant(\n duplicates.length === 0,\n `Invalid Option: The plugins/built-ins '${duplicates.join(\n \", \",\n )}' were found in both the \"include\" and\n \"exclude\" options.`,\n );\n};\n\nconst normalizeTargets = targets => {\n // TODO: Allow to use only query or strings as a targets from next breaking change.\n if (typeof targets === \"string\" || Array.isArray(targets)) {\n return { browsers: targets };\n }\n return {\n ...targets,\n };\n};\n\nexport const validateConfigPathOption = (\n configPath: string = process.cwd(),\n) => {\n invariant(\n typeof configPath === \"string\",\n `Invalid Option: The configPath option '${configPath}' is invalid, only strings are allowed.`,\n );\n return configPath;\n};\n\nexport const validateBoolOption = (\n name: string,\n value?: boolean,\n defaultValue: boolean,\n) => {\n if (typeof value === \"undefined\") {\n value = defaultValue;\n }\n\n if (typeof value !== \"boolean\") {\n throw new Error(`Preset env: '${name}' option must be a boolean.`);\n }\n\n return value;\n};\n\nexport const validateIgnoreBrowserslistConfig = (\n ignoreBrowserslistConfig: boolean,\n) =>\n validateBoolOption(\n TopLevelOptions.ignoreBrowserslistConfig,\n ignoreBrowserslistConfig,\n false,\n );\n\nexport const validateModulesOption = (\n modulesOpt: ModuleOption = ModulesOption.auto,\n) => {\n invariant(\n ModulesOption[modulesOpt.toString()] ||\n ModulesOption[modulesOpt.toString()] === ModulesOption.false,\n `Invalid Option: The 'modules' option must be one of \\n` +\n ` - 'false' to indicate no module processing\\n` +\n ` - a specific module type: 'commonjs', 'amd', 'umd', 'systemjs'` +\n ` - 'auto' (default) which will automatically select 'false' if the current\\n` +\n ` process is known to support ES module syntax, or \"commonjs\" otherwise\\n`,\n );\n\n return modulesOpt;\n};\n\nexport const validateUseBuiltInsOption = (\n builtInsOpt: BuiltInsOption = false,\n) => {\n invariant(\n UseBuiltInsOption[builtInsOpt.toString()] ||\n UseBuiltInsOption[builtInsOpt.toString()] === UseBuiltInsOption.false,\n `Invalid Option: The 'useBuiltIns' option must be either\n 'false' (default) to indicate no polyfill,\n '\"entry\"' to indicate replacing the entry polyfill, or\n '\"usage\"' to import only used polyfills per file`,\n );\n\n return builtInsOpt;\n};\n\nexport type NormalizedCorejsOption = {\n proposals: boolean,\n version: typeof SemVer | null | false,\n};\n\nexport function normalizeCoreJSOption(\n corejs?: CorejsOption,\n useBuiltIns: BuiltInsOption,\n): NormalizedCorejsOption {\n let proposals = false;\n let rawVersion;\n\n if (useBuiltIns && corejs === undefined) {\n rawVersion = 2;\n console.warn(\n \"\\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a \" +\n \"core-js version. Currently, we assume version 2.x when no version \" +\n \"is passed. Since this default version will likely change in future \" +\n \"versions of Babel, we recommend explicitly setting the core-js version \" +\n \"you are using via the `corejs` option.\\n\" +\n \"\\nYou should also be sure that the version you pass to the `corejs` \" +\n \"option matches the version specified in your `package.json`'s \" +\n \"`dependencies` section. If it doesn't, you need to run one of the \" +\n \"following commands:\\n\\n\" +\n \" npm install --save core-js@2 npm install --save core-js@3\\n\" +\n \" yarn add core-js@2 yarn add core-js@3\\n\",\n );\n } else if (typeof corejs === \"object\" && corejs !== null) {\n rawVersion = corejs.version;\n proposals = Boolean(corejs.proposals);\n } else {\n rawVersion = corejs;\n }\n\n const version = rawVersion ? coerce(String(rawVersion)) : false;\n\n if (!useBuiltIns && version) {\n console.log(\n \"\\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\\n\",\n );\n }\n\n if (useBuiltIns && (!version || version.major < 2 || version.major > 3)) {\n throw new RangeError(\n \"Invalid Option: The version passed to `corejs` is invalid. Currently, \" +\n \"only core-js@2 and core-js@3 are supported.\",\n );\n }\n\n return { version, proposals };\n}\n\nexport default function normalizeOptions(opts: Options) {\n validateTopLevelOptions(opts);\n\n const useBuiltIns = validateUseBuiltInsOption(opts.useBuiltIns);\n\n const corejs = normalizeCoreJSOption(opts.corejs, useBuiltIns);\n\n const include = expandIncludesAndExcludes(\n opts.include,\n TopLevelOptions.include,\n !!corejs.version && corejs.version.major,\n );\n\n const exclude = expandIncludesAndExcludes(\n opts.exclude,\n TopLevelOptions.exclude,\n !!corejs.version && corejs.version.major,\n );\n\n checkDuplicateIncludeExcludes(include, exclude);\n\n const shippedProposals =\n validateBoolOption(\n TopLevelOptions.shippedProposals,\n opts.shippedProposals,\n false,\n ) || corejs.proposals;\n\n return {\n configPath: validateConfigPathOption(opts.configPath),\n corejs,\n debug: validateBoolOption(TopLevelOptions.debug, opts.debug, false),\n include,\n exclude,\n forceAllTransforms: validateBoolOption(\n TopLevelOptions.forceAllTransforms,\n opts.forceAllTransforms,\n false,\n ),\n ignoreBrowserslistConfig: validateIgnoreBrowserslistConfig(\n opts.ignoreBrowserslistConfig,\n ),\n loose: validateBoolOption(TopLevelOptions.loose, opts.loose, false),\n modules: validateModulesOption(opts.modules),\n shippedProposals,\n spec: validateBoolOption(TopLevelOptions.spec, opts.spec, false),\n targets: normalizeTargets(opts.targets),\n useBuiltIns: useBuiltIns,\n };\n}\n","/* eslint sort-keys: \"error\" */\n// These mappings represent the syntax proposals that have been\n// shipped by browsers, and are enabled by the `shippedProposals` option.\n\nconst proposalPlugins = {};\n\n// use intermediary object to enforce alphabetical key order\nconst pluginSyntaxObject = {\n \"proposal-async-generator-functions\": \"syntax-async-generators\",\n \"proposal-json-strings\": \"syntax-json-strings\",\n \"proposal-nullish-coalescing-operator\": \"syntax-nullish-coalescing-operator\",\n \"proposal-object-rest-spread\": \"syntax-object-rest-spread\",\n \"proposal-optional-catch-binding\": \"syntax-optional-catch-binding\",\n \"proposal-optional-chaining\": \"syntax-optional-chaining\",\n \"proposal-unicode-property-regex\": null,\n};\n\nconst pluginSyntaxEntries = Object.keys(pluginSyntaxObject).map(function (key) {\n return [key, pluginSyntaxObject[key]];\n});\n\nconst pluginSyntaxMap = new Map(pluginSyntaxEntries);\n\nmodule.exports = { pluginSyntaxMap, proposalPlugins };\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/overlapping-plugins.json\");\n","// @flow\n\ntype ObjectMap = { [name: string]: V };\n\nconst ArrayNatureIterators = [\n \"es6.object.to-string\",\n \"es6.array.iterator\",\n \"web.dom.iterable\",\n];\n\nconst CommonIterators = [\"es6.string.iterator\", ...ArrayNatureIterators];\n\nconst PromiseDependencies = [\"es6.object.to-string\", \"es6.promise\"];\n\nexport const BuiltIns: ObjectMap = {\n DataView: \"es6.typed.data-view\",\n Float32Array: \"es6.typed.float32-array\",\n Float64Array: \"es6.typed.float64-array\",\n Int8Array: \"es6.typed.int8-array\",\n Int16Array: \"es6.typed.int16-array\",\n Int32Array: \"es6.typed.int32-array\",\n Map: [\"es6.map\", ...CommonIterators],\n Number: \"es6.number.constructor\",\n Promise: PromiseDependencies,\n RegExp: [\"es6.regexp.constructor\"],\n Set: [\"es6.set\", ...CommonIterators],\n Symbol: [\"es6.symbol\", \"es7.symbol.async-iterator\"],\n Uint8Array: \"es6.typed.uint8-array\",\n Uint8ClampedArray: \"es6.typed.uint8-clamped-array\",\n Uint16Array: \"es6.typed.uint16-array\",\n Uint32Array: \"es6.typed.uint32-array\",\n WeakMap: [\"es6.weak-map\", ...CommonIterators],\n WeakSet: [\"es6.weak-set\", ...CommonIterators],\n};\n\nexport const InstanceProperties: ObjectMap = {\n __defineGetter__: [\"es7.object.define-getter\"],\n __defineSetter__: [\"es7.object.define-setter\"],\n __lookupGetter__: [\"es7.object.lookup-getter\"],\n __lookupSetter__: [\"es7.object.lookup-setter\"],\n anchor: [\"es6.string.anchor\"],\n big: [\"es6.string.big\"],\n bind: [\"es6.function.bind\"],\n blink: [\"es6.string.blink\"],\n bold: [\"es6.string.bold\"],\n codePointAt: [\"es6.string.code-point-at\"],\n copyWithin: [\"es6.array.copy-within\"],\n endsWith: [\"es6.string.ends-with\"],\n entries: ArrayNatureIterators,\n every: [\"es6.array.is-array\"],\n fill: [\"es6.array.fill\"],\n filter: [\"es6.array.filter\"],\n finally: [\"es7.promise.finally\", ...PromiseDependencies],\n find: [\"es6.array.find\"],\n findIndex: [\"es6.array.find-index\"],\n fixed: [\"es6.string.fixed\"],\n flags: [\"es6.regexp.flags\"],\n flatMap: [\"es7.array.flat-map\"],\n fontcolor: [\"es6.string.fontcolor\"],\n fontsize: [\"es6.string.fontsize\"],\n forEach: [\"es6.array.for-each\"],\n includes: [\"es6.string.includes\", \"es7.array.includes\"],\n indexOf: [\"es6.array.index-of\"],\n italics: [\"es6.string.italics\"],\n keys: ArrayNatureIterators,\n lastIndexOf: [\"es6.array.last-index-of\"],\n link: [\"es6.string.link\"],\n map: [\"es6.array.map\"],\n match: [\"es6.regexp.match\"],\n name: [\"es6.function.name\"],\n padStart: [\"es7.string.pad-start\"],\n padEnd: [\"es7.string.pad-end\"],\n reduce: [\"es6.array.reduce\"],\n reduceRight: [\"es6.array.reduce-right\"],\n repeat: [\"es6.string.repeat\"],\n replace: [\"es6.regexp.replace\"],\n search: [\"es6.regexp.search\"],\n slice: [\"es6.array.slice\"],\n small: [\"es6.string.small\"],\n some: [\"es6.array.some\"],\n sort: [\"es6.array.sort\"],\n split: [\"es6.regexp.split\"],\n startsWith: [\"es6.string.starts-with\"],\n strike: [\"es6.string.strike\"],\n sub: [\"es6.string.sub\"],\n sup: [\"es6.string.sup\"],\n toISOString: [\"es6.date.to-iso-string\"],\n toJSON: [\"es6.date.to-json\"],\n toString: [\n \"es6.object.to-string\",\n \"es6.date.to-string\",\n \"es6.regexp.to-string\",\n ],\n trim: [\"es6.string.trim\"],\n trimEnd: [\"es7.string.trim-right\"],\n trimLeft: [\"es7.string.trim-left\"],\n trimRight: [\"es7.string.trim-right\"],\n trimStart: [\"es7.string.trim-left\"],\n values: ArrayNatureIterators,\n};\n\nexport const StaticProperties: ObjectMap> = {\n Array: {\n from: [\"es6.array.from\", \"es6.string.iterator\"],\n isArray: \"es6.array.is-array\",\n of: \"es6.array.of\",\n },\n\n Date: {\n now: \"es6.date.now\",\n },\n\n Object: {\n assign: \"es6.object.assign\",\n create: \"es6.object.create\",\n defineProperty: \"es6.object.define-property\",\n defineProperties: \"es6.object.define-properties\",\n entries: \"es7.object.entries\",\n freeze: \"es6.object.freeze\",\n getOwnPropertyDescriptors: \"es7.object.get-own-property-descriptors\",\n getOwnPropertySymbols: \"es6.symbol\",\n is: \"es6.object.is\",\n isExtensible: \"es6.object.is-extensible\",\n isFrozen: \"es6.object.is-frozen\",\n isSealed: \"es6.object.is-sealed\",\n keys: \"es6.object.keys\",\n preventExtensions: \"es6.object.prevent-extensions\",\n seal: \"es6.object.seal\",\n setPrototypeOf: \"es6.object.set-prototype-of\",\n values: \"es7.object.values\",\n },\n\n Math: {\n acosh: \"es6.math.acosh\",\n asinh: \"es6.math.asinh\",\n atanh: \"es6.math.atanh\",\n cbrt: \"es6.math.cbrt\",\n clz32: \"es6.math.clz32\",\n cosh: \"es6.math.cosh\",\n expm1: \"es6.math.expm1\",\n fround: \"es6.math.fround\",\n hypot: \"es6.math.hypot\",\n imul: \"es6.math.imul\",\n log1p: \"es6.math.log1p\",\n log10: \"es6.math.log10\",\n log2: \"es6.math.log2\",\n sign: \"es6.math.sign\",\n sinh: \"es6.math.sinh\",\n tanh: \"es6.math.tanh\",\n trunc: \"es6.math.trunc\",\n },\n\n String: {\n fromCodePoint: \"es6.string.from-code-point\",\n raw: \"es6.string.raw\",\n },\n\n Number: {\n EPSILON: \"es6.number.epsilon\",\n MIN_SAFE_INTEGER: \"es6.number.min-safe-integer\",\n MAX_SAFE_INTEGER: \"es6.number.max-safe-integer\",\n isFinite: \"es6.number.is-finite\",\n isInteger: \"es6.number.is-integer\",\n isSafeInteger: \"es6.number.is-safe-integer\",\n isNaN: \"es6.number.is-nan\",\n parseFloat: \"es6.number.parse-float\",\n parseInt: \"es6.number.parse-int\",\n },\n\n Promise: {\n all: CommonIterators,\n race: CommonIterators,\n },\n\n Reflect: {\n apply: \"es6.reflect.apply\",\n construct: \"es6.reflect.construct\",\n defineProperty: \"es6.reflect.define-property\",\n deleteProperty: \"es6.reflect.delete-property\",\n get: \"es6.reflect.get\",\n getOwnPropertyDescriptor: \"es6.reflect.get-own-property-descriptor\",\n getPrototypeOf: \"es6.reflect.get-prototype-of\",\n has: \"es6.reflect.has\",\n isExtensible: \"es6.reflect.is-extensible\",\n ownKeys: \"es6.reflect.own-keys\",\n preventExtensions: \"es6.reflect.prevent-extensions\",\n set: \"es6.reflect.set\",\n setPrototypeOf: \"es6.reflect.set-prototype-of\",\n },\n};\n","// @flow\n\nimport * as t from \"@babel/types\";\nimport type { NodePath } from \"@babel/traverse\";\nimport { addSideEffect } from \"@babel/helper-module-imports\";\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport const has = Object.hasOwnProperty.call.bind(Object.hasOwnProperty);\n\nexport function getType(target: any): string {\n return Object.prototype.toString\n .call(target)\n .slice(8, -1)\n .toLowerCase();\n}\n\nexport function intersection(\n first: Set,\n second: Set,\n third: Set,\n): Set {\n const result = new Set();\n for (const el of first) {\n if (second.has(el) && third.has(el)) result.add(el);\n }\n return result;\n}\n\nexport function filterStageFromList(\n list: { [feature: string]: Targets },\n stageList: { [feature: string]: boolean },\n) {\n return Object.keys(list).reduce((result, item) => {\n if (!stageList[item]) {\n result[item] = list[item];\n }\n\n return result;\n }, {});\n}\n\nexport function getImportSource({ node }: NodePath) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath) {\n if (!t.isExpressionStatement(node)) return;\n const { expression } = node;\n const isRequire =\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee) &&\n expression.callee.name === \"require\" &&\n expression.arguments.length === 1 &&\n t.isStringLiteral(expression.arguments[0]);\n if (isRequire) return expression.arguments[0].value;\n}\n\nexport function isPolyfillSource(source: ?string): boolean {\n return source === \"@babel/polyfill\" || source === \"core-js\";\n}\n\nconst modulePathMap = {\n \"regenerator-runtime\": \"regenerator-runtime/runtime\",\n};\n\nexport function getModulePath(mod: string): string {\n return modulePathMap[mod] || `core-js/modules/${mod}`;\n}\n\nexport function createImport(path: NodePath, mod: string) {\n return addSideEffect(path, getModulePath(mod));\n}\n\nexport function isNamespaced(path: NodePath) {\n if (!path.node) return false;\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return false;\n return binding.path.isImportNamespaceSpecifier();\n}\n","// @flow\n\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport getPlatformSpecificDefaultFor from \"./get-platform-specific-default\";\nimport {\n BuiltIns,\n StaticProperties,\n InstanceProperties,\n} from \"./built-in-definitions\";\nimport {\n createImport,\n getType,\n has,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n isNamespaced,\n} from \"../../utils\";\nimport { logUsagePolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nconst NO_DIRECT_POLYFILL_IMPORT = `\n When setting \\`useBuiltIns: 'usage'\\`, polyfills are automatically imported when needed.\n Please remove the \\`import '@babel/polyfill'\\` call or use \\`useBuiltIns: 'entry'\\` instead.`;\n\nexport default function(\n { types: t }: { types: Object },\n { include, exclude, polyfillTargets, debug }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs2Polyfills,\n include,\n exclude,\n polyfillTargets,\n getPlatformSpecificDefaultFor(polyfillTargets),\n );\n\n const addAndRemovePolyfillImports = {\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n path.remove();\n }\n },\n\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n bodyPath.remove();\n }\n });\n },\n\n // Symbol()\n // new Promise\n ReferencedIdentifier({ node: { name }, parent, scope }: NodePath) {\n if (t.isMemberExpression(parent)) return;\n if (!has(BuiltIns, name)) return;\n if (scope.getBindingIdentifier(name)) return;\n\n const BuiltInDependencies = BuiltIns[name];\n this.addUnsupported(BuiltInDependencies);\n },\n\n // arr[Symbol.iterator]()\n CallExpression(path: NodePath) {\n // we can't compile this\n if (path.node.arguments.length) return;\n\n const callee = path.node.callee;\n\n if (!t.isMemberExpression(callee)) return;\n if (!callee.computed) return;\n if (!path.get(\"callee.property\").matchesPattern(\"Symbol.iterator\")) {\n return;\n }\n\n this.addImport(\"web.dom.iterable\");\n },\n\n // Symbol.iterator in arr\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n if (!path.get(\"left\").matchesPattern(\"Symbol.iterator\")) return;\n\n this.addImport(\"web.dom.iterable\");\n },\n\n // yield*\n YieldExpression(path: NodePath) {\n if (path.node.delegate) {\n this.addImport(\"web.dom.iterable\");\n }\n },\n\n // Array.from\n MemberExpression: {\n enter(path: NodePath) {\n const { node } = path;\n const { object, property } = node;\n\n // ignore namespace\n if (isNamespaced(path.get(\"object\"))) return;\n\n let evaluatedPropType = object.name;\n let propertyName = \"\";\n let instanceType = \"\";\n\n if (node.computed) {\n if (t.isStringLiteral(property)) {\n propertyName = property.value;\n } else {\n const result = path.get(\"property\").evaluate();\n if (result.confident && result.value) {\n propertyName = result.value;\n }\n }\n } else {\n propertyName = property.name;\n }\n\n if (path.scope.getBindingIdentifier(object.name)) {\n const result = path.get(\"object\").evaluate();\n if (result.value) {\n instanceType = getType(result.value);\n } else if (result.deopt && result.deopt.isIdentifier()) {\n evaluatedPropType = result.deopt.node.name;\n }\n }\n\n if (has(StaticProperties, evaluatedPropType)) {\n const BuiltInProperties = StaticProperties[evaluatedPropType];\n if (has(BuiltInProperties, propertyName)) {\n const StaticPropertyDependencies = BuiltInProperties[propertyName];\n this.addUnsupported(StaticPropertyDependencies);\n }\n }\n\n if (has(InstanceProperties, propertyName)) {\n let InstancePropertyDependencies = InstanceProperties[propertyName];\n if (instanceType) {\n InstancePropertyDependencies = InstancePropertyDependencies.filter(\n module => module.includes(instanceType),\n );\n }\n this.addUnsupported(InstancePropertyDependencies);\n }\n },\n\n // Symbol.match\n exit(path: NodePath) {\n const { name } = path.node.object;\n\n if (!has(BuiltIns, name)) return;\n if (path.scope.getBindingIdentifier(name)) return;\n\n const BuiltInDependencies = BuiltIns[name];\n this.addUnsupported(BuiltInDependencies);\n },\n },\n\n // var { repeat, startsWith } = String\n VariableDeclarator(path: NodePath) {\n const { node } = path;\n const { id, init } = node;\n\n if (!t.isObjectPattern(id)) return;\n\n // doesn't reference the global\n if (init && path.scope.getBindingIdentifier(init.name)) return;\n\n for (const { key } of id.properties) {\n if (\n !node.computed &&\n t.isIdentifier(key) &&\n has(InstanceProperties, key.name)\n ) {\n const InstancePropertyDependencies = InstanceProperties[key.name];\n this.addUnsupported(InstancePropertyDependencies);\n }\n }\n },\n };\n\n return {\n name: \"corejs2-usage\",\n pre({ path }: { path: NodePath }) {\n this.polyfillsSet = new Set();\n\n this.addImport = function(builtIn) {\n if (!this.polyfillsSet.has(builtIn)) {\n this.polyfillsSet.add(builtIn);\n createImport(path, builtIn);\n }\n };\n\n this.addUnsupported = function(builtIn) {\n const modules = Array.isArray(builtIn) ? builtIn : [builtIn];\n for (const module of modules) {\n if (polyfills.has(module)) {\n this.addImport(module);\n }\n }\n };\n },\n post() {\n if (debug) {\n logUsagePolyfills(\n this.polyfillsSet,\n this.file.opts.filename,\n polyfillTargets,\n corejs2Polyfills,\n );\n }\n },\n visitor: addAndRemovePolyfillImports,\n };\n}\n","// @flow\n\nexport default ([\"esnext.global-this\", \"esnext.string.match-all\"]: string[]);\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\nmodule.exports = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH,\n MAX_SAFE_INTEGER,\n MAX_SAFE_COMPONENT_LENGTH\n}\n","const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst createToken = (name, value, isGlobal) => {\n const index = R++\n debug(index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*')\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { re, t } = require('../internal/re')\n\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const {MAX_LENGTH} = require('../internal/constants')\nconst { re, t } = require('../internal/re')\nconst SemVer = require('../classes/semver')\n\nconst parse = (version, options) => {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n const r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst {re, t} = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null)\n return null\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","'use strict';\nconst cmp = require('semver/functions/cmp');\nconst semver = require('semver/functions/coerce');\n\nconst has = Function.call.bind({}.hasOwnProperty);\n\nfunction compare(a, operator, b) {\n return cmp(semver(a), operator, semver(b));\n}\n\nfunction intersection(list, order) {\n const set = list instanceof Set ? list : new Set(list);\n return order.filter(name => set.has(name));\n}\n\nfunction sortObjectByKey(object, fn) {\n return Object.keys(object).sort(fn).reduce((memo, key) => {\n memo[key] = object[key];\n return memo;\n }, {});\n}\n\nmodule.exports = {\n compare,\n has,\n intersection,\n semver,\n sortObjectByKey,\n};\n","'use strict';\nconst { compare, intersection, semver } = require('./helpers');\nconst modulesByVersions = require('./modules-by-versions');\nconst modules = require('./modules');\n\nmodule.exports = function (raw) {\n const corejs = semver(raw);\n if (corejs.major !== 3) {\n throw RangeError('This version of `core-js-compat` works only with `core-js@3`.');\n }\n const result = [];\n for (const version of Object.keys(modulesByVersions)) {\n if (compare(version, '<=', corejs)) {\n result.push(...modulesByVersions[version]);\n }\n }\n return intersection(result, modules);\n};\n","// @flow\n\ntype ObjectMap = { [name: string]: V };\n\nconst ArrayNatureIterators = [\n \"es.array.iterator\",\n \"web.dom-collections.iterator\",\n];\n\nexport const CommonIterators = [\"es.string.iterator\", ...ArrayNatureIterators];\n\nconst ArrayNatureIteratorsWithTag = [\n \"es.object.to-string\",\n ...ArrayNatureIterators,\n];\n\nconst CommonIteratorsWithTag = [\"es.object.to-string\", ...CommonIterators];\n\nconst TypedArrayDependencies = [\n \"es.typed-array.copy-within\",\n \"es.typed-array.every\",\n \"es.typed-array.fill\",\n \"es.typed-array.filter\",\n \"es.typed-array.find\",\n \"es.typed-array.find-index\",\n \"es.typed-array.for-each\",\n \"es.typed-array.includes\",\n \"es.typed-array.index-of\",\n \"es.typed-array.iterator\",\n \"es.typed-array.join\",\n \"es.typed-array.last-index-of\",\n \"es.typed-array.map\",\n \"es.typed-array.reduce\",\n \"es.typed-array.reduce-right\",\n \"es.typed-array.reverse\",\n \"es.typed-array.set\",\n \"es.typed-array.slice\",\n \"es.typed-array.some\",\n \"es.typed-array.sort\",\n \"es.typed-array.subarray\",\n \"es.typed-array.to-locale-string\",\n \"es.typed-array.to-string\",\n \"es.object.to-string\",\n \"es.array.iterator\",\n \"es.array-buffer.slice\",\n];\n\nconst TypedArrayStaticMethods = {\n from: \"es.typed-array.from\",\n of: \"es.typed-array.of\",\n};\n\nexport const PromiseDependencies = [\"es.promise\", \"es.object.to-string\"];\n\nconst PromiseDependenciesWithIterators = [\n ...PromiseDependencies,\n ...CommonIterators,\n];\n\nconst SymbolDependencies = [\n \"es.symbol\",\n \"es.symbol.description\",\n \"es.object.to-string\",\n];\n\nconst MapDependencies = [\n \"es.map\",\n \"esnext.map.delete-all\",\n \"esnext.map.every\",\n \"esnext.map.filter\",\n \"esnext.map.find\",\n \"esnext.map.find-key\",\n \"esnext.map.includes\",\n \"esnext.map.key-of\",\n \"esnext.map.map-keys\",\n \"esnext.map.map-values\",\n \"esnext.map.merge\",\n \"esnext.map.reduce\",\n \"esnext.map.some\",\n \"esnext.map.update\",\n ...CommonIteratorsWithTag,\n];\n\nconst SetDependencies = [\n \"es.set\",\n \"esnext.set.add-all\",\n \"esnext.set.delete-all\",\n \"esnext.set.difference\",\n \"esnext.set.every\",\n \"esnext.set.filter\",\n \"esnext.set.find\",\n \"esnext.set.intersection\",\n \"esnext.set.is-disjoint-from\",\n \"esnext.set.is-subset-of\",\n \"esnext.set.is-superset-of\",\n \"esnext.set.join\",\n \"esnext.set.map\",\n \"esnext.set.reduce\",\n \"esnext.set.some\",\n \"esnext.set.symmetric-difference\",\n \"esnext.set.union\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakMapDependencies = [\n \"es.weak-map\",\n \"esnext.weak-map.delete-all\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakSetDependencies = [\n \"es.weak-set\",\n \"esnext.weak-set.add-all\",\n \"esnext.weak-set.delete-all\",\n ...CommonIteratorsWithTag,\n];\n\nconst URLSearchParamsDependencies = [\"web.url\", ...CommonIteratorsWithTag];\n\nexport const BuiltIns: ObjectMap = {\n AggregateError: [\"esnext.aggregate-error\", ...CommonIterators],\n ArrayBuffer: [\n \"es.array-buffer.constructor\",\n \"es.array-buffer.slice\",\n \"es.object.to-string\",\n ],\n DataView: [\"es.data-view\", \"es.array-buffer.slice\", \"es.object.to-string\"],\n Date: [\"es.date.to-string\"],\n Float32Array: [\"es.typed-array.float32-array\", ...TypedArrayDependencies],\n Float64Array: [\"es.typed-array.float64-array\", ...TypedArrayDependencies],\n Int8Array: [\"es.typed-array.int8-array\", ...TypedArrayDependencies],\n Int16Array: [\"es.typed-array.int16-array\", ...TypedArrayDependencies],\n Int32Array: [\"es.typed-array.int32-array\", ...TypedArrayDependencies],\n Uint8Array: [\"es.typed-array.uint8-array\", ...TypedArrayDependencies],\n Uint8ClampedArray: [\n \"es.typed-array.uint8-clamped-array\",\n ...TypedArrayDependencies,\n ],\n Uint16Array: [\"es.typed-array.uint16-array\", ...TypedArrayDependencies],\n Uint32Array: [\"es.typed-array.uint32-array\", ...TypedArrayDependencies],\n Map: MapDependencies,\n Number: [\"es.number.constructor\"],\n Observable: [\n \"esnext.observable\",\n \"esnext.symbol.observable\",\n \"es.object.to-string\",\n ...CommonIteratorsWithTag,\n ],\n Promise: PromiseDependencies,\n RegExp: [\"es.regexp.constructor\", \"es.regexp.exec\", \"es.regexp.to-string\"],\n Set: SetDependencies,\n Symbol: SymbolDependencies,\n URL: [\"web.url\", ...URLSearchParamsDependencies],\n URLSearchParams: URLSearchParamsDependencies,\n WeakMap: WeakMapDependencies,\n WeakSet: WeakSetDependencies,\n clearImmediate: [\"web.immediate\"],\n compositeKey: [\"esnext.composite-key\"],\n compositeSymbol: [\"esnext.composite-symbol\", ...SymbolDependencies],\n fetch: PromiseDependencies,\n globalThis: [\"esnext.global-this\"],\n parseFloat: [\"es.parse-float\"],\n parseInt: [\"es.parse-int\"],\n queueMicrotask: [\"web.queue-microtask\"],\n setTimeout: [\"web.timers\"],\n setInterval: [\"web.timers\"],\n setImmediate: [\"web.immediate\"],\n};\n\nexport const InstanceProperties: ObjectMap = {\n at: [\"esnext.string.at\"],\n anchor: [\"es.string.anchor\"],\n big: [\"es.string.big\"],\n bind: [\"es.function.bind\"],\n blink: [\"es.string.blink\"],\n bold: [\"es.string.bold\"],\n codePointAt: [\"es.string.code-point-at\"],\n codePoints: [\"esnext.string.code-points\"],\n concat: [\"es.array.concat\"],\n copyWithin: [\"es.array.copy-within\"],\n description: [\"es.symbol\", \"es.symbol.description\"],\n endsWith: [\"es.string.ends-with\"],\n entries: ArrayNatureIteratorsWithTag,\n every: [\"es.array.every\"],\n exec: [\"es.regexp.exec\"],\n fill: [\"es.array.fill\"],\n filter: [\"es.array.filter\"],\n finally: [\"es.promise.finally\", ...PromiseDependencies],\n find: [\"es.array.find\"],\n findIndex: [\"es.array.find-index\"],\n fixed: [\"es.string.fixed\"],\n flags: [\"es.regexp.flags\"],\n flat: [\"es.array.flat\", \"es.array.unscopables.flat\"],\n flatMap: [\"es.array.flat-map\", \"es.array.unscopables.flat-map\"],\n fontcolor: [\"es.string.fontcolor\"],\n fontsize: [\"es.string.fontsize\"],\n forEach: [\"es.array.for-each\", \"web.dom-collections.for-each\"],\n includes: [\"es.array.includes\", \"es.string.includes\"],\n indexOf: [\"es.array.index-of\"],\n italics: [\"es.string.italics\"],\n join: [\"es.array.join\"],\n keys: ArrayNatureIteratorsWithTag,\n lastIndex: [\"esnext.array.last-index\"],\n lastIndexOf: [\"es.array.last-index-of\"],\n lastItem: [\"esnext.array.last-item\"],\n link: [\"es.string.link\"],\n match: [\"es.string.match\", \"es.regexp.exec\"],\n matchAll: [\"esnext.string.match-all\"],\n map: [\"es.array.map\"],\n name: [\"es.function.name\"],\n padEnd: [\"es.string.pad-end\"],\n padStart: [\"es.string.pad-start\"],\n reduce: [\"es.array.reduce\"],\n reduceRight: [\"es.array.reduce-right\"],\n repeat: [\"es.string.repeat\"],\n replace: [\"es.string.replace\", \"es.regexp.exec\"],\n replaceAll: [\"esnext.string.replace-all\"],\n reverse: [\"es.array.reverse\"],\n search: [\"es.string.search\", \"es.regexp.exec\"],\n slice: [\"es.array.slice\"],\n small: [\"es.string.small\"],\n some: [\"es.array.some\"],\n sort: [\"es.array.sort\"],\n splice: [\"es.array.splice\"],\n split: [\"es.string.split\", \"es.regexp.exec\"],\n startsWith: [\"es.string.starts-with\"],\n strike: [\"es.string.strike\"],\n sub: [\"es.string.sub\"],\n sup: [\"es.string.sup\"],\n toFixed: [\"es.number.to-fixed\"],\n toISOString: [\"es.date.to-iso-string\"],\n toJSON: [\"es.date.to-json\", \"web.url.to-json\"],\n toPrecision: [\"es.number.to-precision\"],\n toString: [\"es.object.to-string\", \"es.regexp.to-string\", \"es.date.to-string\"],\n trim: [\"es.string.trim\"],\n trimEnd: [\"es.string.trim-end\"],\n trimLeft: [\"es.string.trim-start\"],\n trimRight: [\"es.string.trim-end\"],\n trimStart: [\"es.string.trim-start\"],\n values: ArrayNatureIteratorsWithTag,\n __defineGetter__: [\"es.object.define-getter\"],\n __defineSetter__: [\"es.object.define-setter\"],\n __lookupGetter__: [\"es.object.lookup-getter\"],\n __lookupSetter__: [\"es.object.lookup-setter\"],\n};\n\nexport const StaticProperties: ObjectMap> = {\n Array: {\n from: [\"es.array.from\", \"es.string.iterator\"],\n isArray: [\"es.array.is-array\"],\n of: [\"es.array.of\"],\n },\n\n Date: {\n now: \"es.date.now\",\n },\n\n Object: {\n assign: \"es.object.assign\",\n create: \"es.object.create\",\n defineProperty: \"es.object.define-property\",\n defineProperties: \"es.object.define-properties\",\n entries: \"es.object.entries\",\n freeze: \"es.object.freeze\",\n fromEntries: [\"es.object.from-entries\", \"es.array.iterator\"],\n getOwnPropertyDescriptor: \"es.object.get-own-property-descriptor\",\n getOwnPropertyDescriptors: \"es.object.get-own-property-descriptors\",\n getOwnPropertyNames: \"es.object.get-own-property-names\",\n getOwnPropertySymbols: \"es.symbol\",\n getPrototypeOf: \"es.object.get-prototype-of\",\n is: \"es.object.is\",\n isExtensible: \"es.object.is-extensible\",\n isFrozen: \"es.object.is-frozen\",\n isSealed: \"es.object.is-sealed\",\n keys: \"es.object.keys\",\n preventExtensions: \"es.object.prevent-extensions\",\n seal: \"es.object.seal\",\n setPrototypeOf: \"es.object.set-prototype-of\",\n values: \"es.object.values\",\n },\n\n Math: {\n DEG_PER_RAD: \"esnext.math.deg-per-rad\",\n RAD_PER_DEG: \"esnext.math.rad-per-deg\",\n acosh: \"es.math.acosh\",\n asinh: \"es.math.asinh\",\n atanh: \"es.math.atanh\",\n cbrt: \"es.math.cbrt\",\n clamp: \"esnext.math.clamp\",\n clz32: \"es.math.clz32\",\n cosh: \"es.math.cosh\",\n degrees: \"esnext.math.degrees\",\n expm1: \"es.math.expm1\",\n fround: \"es.math.fround\",\n fscale: \"esnext.math.fscale\",\n hypot: \"es.math.hypot\",\n iaddh: \"esnext.math.iaddh\",\n imul: \"es.math.imul\",\n imulh: \"esnext.math.imulh\",\n isubh: \"esnext.math.isubh\",\n log1p: \"es.math.log1p\",\n log10: \"es.math.log10\",\n log2: \"es.math.log2\",\n radians: \"esnext.math.radians\",\n scale: \"esnext.math.scale\",\n seededPRNG: \"esnext.math.seeded-prng\",\n sign: \"es.math.sign\",\n signbit: \"esnext.math.signbit\",\n sinh: \"es.math.sinh\",\n tanh: \"es.math.tanh\",\n trunc: \"es.math.trunc\",\n umulh: \"esnext.math.umulh\",\n },\n\n String: {\n fromCodePoint: \"es.string.from-code-point\",\n raw: \"es.string.raw\",\n },\n\n Number: {\n EPSILON: \"es.number.epsilon\",\n MIN_SAFE_INTEGER: \"es.number.min-safe-integer\",\n MAX_SAFE_INTEGER: \"es.number.max-safe-integer\",\n fromString: \"esnext.number.from-string\",\n isFinite: \"es.number.is-finite\",\n isInteger: \"es.number.is-integer\",\n isSafeInteger: \"es.number.is-safe-integer\",\n isNaN: \"es.number.is-nan\",\n parseFloat: \"es.number.parse-float\",\n parseInt: \"es.number.parse-int\",\n },\n\n Map: {\n from: [\"esnext.map.from\", ...MapDependencies],\n groupBy: [\"esnext.map.group-by\", ...MapDependencies],\n keyBy: [\"esnext.map.key-by\", ...MapDependencies],\n of: [\"esnext.map.of\", ...MapDependencies],\n },\n\n Set: {\n from: [\"esnext.set.from\", ...SetDependencies],\n of: [\"esnext.set.of\", ...SetDependencies],\n },\n\n WeakMap: {\n from: [\"esnext.weak-map.from\", ...WeakMapDependencies],\n of: [\"esnext.weak-map.of\", ...WeakMapDependencies],\n },\n\n WeakSet: {\n from: [\"esnext.weak-set.from\", ...WeakSetDependencies],\n of: [\"esnext.weak-set.of\", ...WeakSetDependencies],\n },\n\n Promise: {\n all: PromiseDependenciesWithIterators,\n allSettled: [\n \"esnext.promise.all-settled\",\n ...PromiseDependenciesWithIterators,\n ],\n any: [\n \"esnext.promise.any\",\n \"esnext.aggregate-error\",\n ...PromiseDependenciesWithIterators,\n ],\n race: PromiseDependenciesWithIterators,\n try: [\"esnext.promise.try\", ...PromiseDependenciesWithIterators],\n },\n\n Reflect: {\n apply: \"es.reflect.apply\",\n construct: \"es.reflect.construct\",\n defineMetadata: \"esnext.reflect.define-metadata\",\n defineProperty: \"es.reflect.define-property\",\n deleteMetadata: \"esnext.reflect.delete-metadata\",\n deleteProperty: \"es.reflect.delete-property\",\n get: \"es.reflect.get\",\n getMetadata: \"esnext.reflect.get-metadata\",\n getMetadataKeys: \"esnext.reflect.get-metadata-keys\",\n getOwnMetadata: \"esnext.reflect.get-own-metadata\",\n getOwnMetadataKeys: \"esnext.reflect.get-own-metadata-keys\",\n getOwnPropertyDescriptor: \"es.reflect.get-own-property-descriptor\",\n getPrototypeOf: \"es.reflect.get-prototype-of\",\n has: \"es.reflect.has\",\n hasMetadata: \"esnext.reflect.has-metadata\",\n hasOwnMetadata: \"esnext.reflect.has-own-metadata\",\n isExtensible: \"es.reflect.is-extensible\",\n metadata: \"esnext.reflect.metadata\",\n ownKeys: \"es.reflect.own-keys\",\n preventExtensions: \"es.reflect.prevent-extensions\",\n set: \"es.reflect.set\",\n setPrototypeOf: \"es.reflect.set-prototype-of\",\n },\n\n Symbol: {\n asyncIterator: [\"es.symbol.async-iterator\"],\n dispose: [\"esnext.symbol.dispose\"],\n hasInstance: [\"es.symbol.has-instance\", \"es.function.has-instance\"],\n isConcatSpreadable: [\"es.symbol.is-concat-spreadable\", \"es.array.concat\"],\n iterator: [\"es.symbol.iterator\", ...CommonIteratorsWithTag],\n match: [\"es.symbol.match\", \"es.string.match\"],\n observable: [\"esnext.symbol.observable\"],\n patternMatch: [\"esnext.symbol.pattern-match\"],\n replace: [\"es.symbol.replace\", \"es.string.replace\"],\n search: [\"es.symbol.search\", \"es.string.search\"],\n species: [\"es.symbol.species\", \"es.array.species\"],\n split: [\"es.symbol.split\", \"es.string.split\"],\n toPrimitive: [\"es.symbol.to-primitive\", \"es.date.to-primitive\"],\n toStringTag: [\n \"es.symbol.to-string-tag\",\n \"es.object.to-string\",\n \"es.math.to-string-tag\",\n \"es.json.to-string-tag\",\n ],\n unscopables: [\"es.symbol.unscopables\"],\n },\n\n ArrayBuffer: {\n isView: [\"es.array-buffer.is-view\"],\n },\n\n Int8Array: TypedArrayStaticMethods,\n Uint8Array: TypedArrayStaticMethods,\n Uint8ClampedArray: TypedArrayStaticMethods,\n Int16Array: TypedArrayStaticMethods,\n Uint16Array: TypedArrayStaticMethods,\n Int32Array: TypedArrayStaticMethods,\n Uint32Array: TypedArrayStaticMethods,\n Float32Array: TypedArrayStaticMethods,\n Float64Array: TypedArrayStaticMethods,\n};\n\nexport const CommonInstanceDependencies = new Set([\n \"es.object.to-string\",\n \"es.object.define-getter\",\n \"es.object.define-setter\",\n \"es.object.lookup-getter\",\n \"es.object.lookup-setter\",\n \"es.regexp.exec\",\n]);\n\nexport const PossibleGlobalObjects = new Set([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n","// @flow\n\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport corejs3ShippedProposalsList from \"./shipped-proposals\";\nimport getModulesListForTargetVersion from \"core-js-compat/get-modules-list-for-target-version\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport {\n BuiltIns,\n StaticProperties,\n InstanceProperties,\n CommonIterators,\n CommonInstanceDependencies,\n PromiseDependencies,\n PossibleGlobalObjects,\n} from \"./built-in-definitions\";\nimport {\n createImport,\n getType,\n has,\n intersection,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n isNamespaced,\n} from \"../../utils\";\nimport { logUsagePolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nconst NO_DIRECT_POLYFILL_IMPORT = `\n When setting \\`useBuiltIns: 'usage'\\`, polyfills are automatically imported when needed.\n Please remove the direct import of \\`core-js\\` or use \\`useBuiltIns: 'entry'\\` instead.`;\n\nconst corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills)\n .filter(name => !name.startsWith(\"esnext.\"))\n .reduce((memo, key) => {\n memo[key] = corejs3Polyfills[key];\n return memo;\n }, {});\n\nconst corejs3PolyfillsWithShippedProposals = corejs3ShippedProposalsList.reduce(\n (memo, key) => {\n memo[key] = corejs3Polyfills[key];\n return memo;\n },\n { ...corejs3PolyfillsWithoutProposals },\n);\n\nexport default function(\n _: any,\n {\n corejs,\n include,\n exclude,\n polyfillTargets,\n proposals,\n shippedProposals,\n debug,\n }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n proposals\n ? corejs3Polyfills\n : shippedProposals\n ? corejs3PolyfillsWithShippedProposals\n : corejs3PolyfillsWithoutProposals,\n include,\n exclude,\n polyfillTargets,\n null,\n );\n\n const available = new Set(getModulesListForTargetVersion(corejs.version));\n\n function resolveKey(path, computed) {\n const { node, parent, scope } = path;\n if (path.isStringLiteral()) return node.value;\n const { name } = node;\n const isIdentifier = path.isIdentifier();\n if (isIdentifier && !(computed || parent.computed)) return name;\n if (!isIdentifier || scope.getBindingIdentifier(name)) {\n const { value } = path.evaluate();\n if (typeof value === \"string\") return value;\n }\n }\n\n function resolveSource(path) {\n const { node, scope } = path;\n let builtIn, instanceType;\n if (node) {\n builtIn = node.name;\n if (!path.isIdentifier() || scope.getBindingIdentifier(builtIn)) {\n const { deopt, value } = path.evaluate();\n if (value !== undefined) {\n instanceType = getType(value);\n } else if (deopt && deopt.isIdentifier()) {\n builtIn = deopt.node.name;\n }\n }\n }\n return { builtIn, instanceType, isNamespaced: isNamespaced(path) };\n }\n\n const addAndRemovePolyfillImports = {\n // import 'core-js'\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n path.remove();\n }\n },\n\n // require('core-js')\n Program: {\n enter(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n bodyPath.remove();\n }\n });\n },\n\n exit(path: NodePath) {\n const filtered = intersection(polyfills, this.polyfillsSet, available);\n const reversed = Array.from(filtered).reverse();\n\n for (const module of reversed) {\n // Program:exit could be called multiple times.\n // Avoid injecting the polyfills twice.\n if (!this.injectedPolyfills.has(module)) {\n createImport(path, module);\n }\n }\n\n filtered.forEach(module => this.injectedPolyfills.add(module));\n },\n },\n\n // import('something').then(...)\n Import() {\n this.addUnsupported(PromiseDependencies);\n },\n\n Function({ node }: NodePath) {\n // (async function () { }).finally(...)\n if (node.async) {\n this.addUnsupported(PromiseDependencies);\n }\n },\n\n // for-of, [a, b] = c\n \"ForOfStatement|ArrayPattern\"() {\n this.addUnsupported(CommonIterators);\n },\n\n // [...spread]\n SpreadElement({ parentPath }: NodePath) {\n if (!parentPath.isObjectExpression()) {\n this.addUnsupported(CommonIterators);\n }\n },\n\n // yield*\n YieldExpression({ node }: NodePath) {\n if (node.delegate) {\n this.addUnsupported(CommonIterators);\n }\n },\n\n // Symbol(), new Promise\n ReferencedIdentifier({ node: { name }, scope }: NodePath) {\n if (scope.getBindingIdentifier(name)) return;\n\n this.addBuiltInDependencies(name);\n },\n\n MemberExpression(path: NodePath) {\n const source = resolveSource(path.get(\"object\"));\n const key = resolveKey(path.get(\"property\"));\n\n // Object.entries\n // [1, 2, 3].entries\n this.addPropertyDependencies(source, key);\n },\n\n ObjectPattern(path: NodePath) {\n const { parentPath, parent, key } = path;\n let source;\n\n // const { keys, values } = Object\n if (parentPath.isVariableDeclarator()) {\n source = resolveSource(parentPath.get(\"init\"));\n // ({ keys, values } = Object)\n } else if (parentPath.isAssignmentExpression()) {\n source = resolveSource(parentPath.get(\"right\"));\n // !function ({ keys, values }) {...} (Object)\n // resolution does not work after properties transform :-(\n } else if (parentPath.isFunctionExpression()) {\n const grand = parentPath.parentPath;\n if (grand.isCallExpression() || grand.isNewExpression()) {\n if (grand.node.callee === parent) {\n source = resolveSource(grand.get(\"arguments\")[key]);\n }\n }\n }\n\n for (const property of path.get(\"properties\")) {\n if (property.isObjectProperty()) {\n const key = resolveKey(property.get(\"key\"));\n // const { keys, values } = Object\n // const { keys, values } = [1, 2, 3]\n this.addPropertyDependencies(source, key);\n }\n }\n },\n\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n\n const source = resolveSource(path.get(\"right\"));\n const key = resolveKey(path.get(\"left\"), true);\n\n // 'entries' in Object\n // 'entries' in [1, 2, 3]\n this.addPropertyDependencies(source, key);\n },\n };\n\n return {\n name: \"corejs3-usage\",\n pre() {\n this.injectedPolyfills = new Set();\n this.polyfillsSet = new Set();\n\n this.addUnsupported = function(builtIn) {\n const modules = Array.isArray(builtIn) ? builtIn : [builtIn];\n for (const module of modules) {\n this.polyfillsSet.add(module);\n }\n };\n\n this.addBuiltInDependencies = function(builtIn) {\n if (has(BuiltIns, builtIn)) {\n const BuiltInDependencies = BuiltIns[builtIn];\n this.addUnsupported(BuiltInDependencies);\n }\n };\n\n this.addPropertyDependencies = function(source = {}, key) {\n const { builtIn, instanceType, isNamespaced } = source;\n if (isNamespaced) return;\n if (PossibleGlobalObjects.has(builtIn)) {\n this.addBuiltInDependencies(key);\n } else if (has(StaticProperties, builtIn)) {\n const BuiltInProperties = StaticProperties[builtIn];\n if (has(BuiltInProperties, key)) {\n const StaticPropertyDependencies = BuiltInProperties[key];\n return this.addUnsupported(StaticPropertyDependencies);\n }\n }\n if (!has(InstanceProperties, key)) return;\n let InstancePropertyDependencies = InstanceProperties[key];\n if (instanceType) {\n InstancePropertyDependencies = InstancePropertyDependencies.filter(\n m => m.includes(instanceType) || CommonInstanceDependencies.has(m),\n );\n }\n this.addUnsupported(InstancePropertyDependencies);\n };\n },\n post() {\n if (debug) {\n logUsagePolyfills(\n this.injectedPolyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs3Polyfills,\n );\n }\n },\n visitor: addAndRemovePolyfillImports,\n };\n}\n","// @flow\n\nimport { createImport } from \"../../utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport default function() {\n return {\n name: \"regenerator-usage\",\n pre() {\n this.usesRegenerator = false;\n },\n visitor: {\n Function(path: NodePath) {\n const { node } = path;\n\n if (!this.usesRegenerator && (node.generator || node.async)) {\n this.usesRegenerator = true;\n createImport(path, \"regenerator-runtime\");\n }\n },\n },\n post() {\n if (this.opts.debug && this.usesRegenerator) {\n let filename = this.file.opts.filename;\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n console.log(\n `\\n[${filename}] Based on your code and targets, added regenerator-runtime.`,\n );\n }\n },\n };\n}\n","// @flow\n\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport getPlatformSpecificDefaultFor from \"./get-platform-specific-default\";\nimport {\n createImport,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n} from \"../../utils\";\nimport { logEntryPolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport default function(\n _: any,\n {\n include,\n exclude,\n polyfillTargets,\n regenerator,\n debug,\n }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs2Polyfills,\n include,\n exclude,\n polyfillTargets,\n getPlatformSpecificDefaultFor(polyfillTargets),\n );\n\n const isPolyfillImport = {\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n this.replaceBySeparateModulesImport(path);\n }\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n this.replaceBySeparateModulesImport(bodyPath);\n }\n });\n },\n };\n\n return {\n name: \"corejs2-entry\",\n visitor: isPolyfillImport,\n pre() {\n this.importPolyfillIncluded = false;\n\n this.replaceBySeparateModulesImport = function(path) {\n this.importPolyfillIncluded = true;\n\n if (regenerator) {\n createImport(path, \"regenerator-runtime\");\n }\n\n const modules = Array.from(polyfills).reverse();\n\n for (const module of modules) {\n createImport(path, module);\n }\n\n path.remove();\n };\n },\n post() {\n if (debug) {\n logEntryPolyfills(\n \"@babel/polyfill\",\n this.importPolyfillIncluded,\n polyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs2Polyfills,\n );\n }\n },\n };\n}\n","// @flow\n\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport corejsEntries from \"core-js-compat/entries\";\nimport getModulesListForTargetVersion from \"core-js-compat/get-modules-list-for-target-version\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport {\n has,\n intersection,\n createImport,\n getImportSource,\n getRequireSource,\n getModulePath,\n} from \"../../utils\";\nimport { logEntryPolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nfunction isBabelPolyfillSource(source) {\n return source === \"@babel/polyfill\" || source === \"babel-polyfill\";\n}\n\nfunction isCoreJSSource(source) {\n if (typeof source === \"string\") {\n source = source\n .replace(/\\\\/g, \"/\")\n .replace(/(\\/(index)?)?(\\.js)?$/i, \"\")\n .toLowerCase();\n }\n return has(corejsEntries, source) && corejsEntries[source];\n}\n\nconst BABEL_POLYFILL_DEPRECATION = `\n \\`@babel/polyfill\\` is deprecated. Please, use required parts of \\`core-js\\`\n and \\`regenerator-runtime/runtime\\` separately`;\n\nexport default function(\n _: any,\n { corejs, include, exclude, polyfillTargets, debug }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs3Polyfills,\n include,\n exclude,\n polyfillTargets,\n null,\n );\n\n const available = new Set(getModulesListForTargetVersion(corejs.version));\n\n function shouldReplace(source, modules) {\n if (!modules) return false;\n if (\n // Don't replace an import with itself to avoid an infinite loop\n modules.length === 1 &&\n polyfills.has(modules[0]) &&\n available.has(modules[0]) &&\n getModulePath(modules[0]) === source\n ) {\n return false;\n }\n return true;\n }\n\n const isPolyfillImport = {\n ImportDeclaration(path: NodePath) {\n const source = getImportSource(path);\n if (!source) return;\n if (isBabelPolyfillSource(source)) {\n console.warn(BABEL_POLYFILL_DEPRECATION);\n } else {\n const modules = isCoreJSSource(source);\n if (shouldReplace(source, modules)) {\n this.replaceBySeparateModulesImport(path, modules);\n }\n }\n },\n Program: {\n enter(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n const source = getRequireSource(bodyPath);\n if (!source) return;\n if (isBabelPolyfillSource(source)) {\n console.warn(BABEL_POLYFILL_DEPRECATION);\n } else {\n const modules = isCoreJSSource(source);\n if (shouldReplace(source, modules)) {\n this.replaceBySeparateModulesImport(bodyPath, modules);\n }\n }\n });\n },\n exit(path: NodePath) {\n const filtered = intersection(polyfills, this.polyfillsSet, available);\n const reversed = Array.from(filtered).reverse();\n\n for (const module of reversed) {\n // Program:exit could be called multiple times.\n // Avoid injecting the polyfills twice.\n if (!this.injectedPolyfills.has(module)) {\n createImport(path, module);\n }\n }\n\n filtered.forEach(module => this.injectedPolyfills.add(module));\n },\n },\n };\n\n return {\n name: \"corejs3-entry\",\n visitor: isPolyfillImport,\n pre() {\n this.injectedPolyfills = new Set();\n this.polyfillsSet = new Set();\n\n this.replaceBySeparateModulesImport = function(path, modules) {\n for (const module of modules) {\n this.polyfillsSet.add(module);\n }\n\n path.remove();\n };\n },\n post() {\n if (debug) {\n logEntryPolyfills(\n \"core-js\",\n this.injectedPolyfills.size > 0,\n this.injectedPolyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs3Polyfills,\n );\n }\n },\n };\n}\n","// @flow\n\nimport { getImportSource, getRequireSource } from \"../../utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nfunction isRegeneratorSource(source) {\n return source === \"regenerator-runtime/runtime\";\n}\n\nexport default function() {\n const visitor = {\n ImportDeclaration(path: NodePath) {\n if (isRegeneratorSource(getImportSource(path))) {\n this.regeneratorImportExcluded = true;\n path.remove();\n }\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isRegeneratorSource(getRequireSource(bodyPath))) {\n this.regeneratorImportExcluded = true;\n bodyPath.remove();\n }\n });\n },\n };\n\n return {\n name: \"regenerator-entry\",\n visitor,\n pre() {\n this.regeneratorImportExcluded = false;\n },\n post() {\n if (this.opts.debug && this.regeneratorImportExcluded) {\n let filename = this.file.opts.filename;\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n console.log(\n `\\n[${filename}] Based on your targets, regenerator-runtime import excluded.`,\n );\n }\n },\n };\n}\n","// @flow\n/* eslint sort-keys: \"error\" */\n\nimport syntaxAsyncGenerators from \"@babel/plugin-syntax-async-generators\";\nimport syntaxDynamicImport from \"@babel/plugin-syntax-dynamic-import\";\nimport syntaxJsonStrings from \"@babel/plugin-syntax-json-strings\";\nimport syntaxNullishCoalescingOperator from \"@babel/plugin-syntax-nullish-coalescing-operator\";\nimport syntaxObjectRestSpread from \"@babel/plugin-syntax-object-rest-spread\";\nimport syntaxOptionalCatchBinding from \"@babel/plugin-syntax-optional-catch-binding\";\nimport syntaxOptionalChaining from \"@babel/plugin-syntax-optional-chaining\";\nimport syntaxTopLevelAwait from \"@babel/plugin-syntax-top-level-await\";\nimport proposalAsyncGeneratorFunctions from \"@babel/plugin-proposal-async-generator-functions\";\nimport proposalDynamicImport from \"@babel/plugin-proposal-dynamic-import\";\nimport proposalJsonStrings from \"@babel/plugin-proposal-json-strings\";\nimport proposalNullishCoalescingOperator from \"@babel/plugin-proposal-nullish-coalescing-operator\";\nimport proposalObjectRestSpread from \"@babel/plugin-proposal-object-rest-spread\";\nimport proposalOptionalCatchBinding from \"@babel/plugin-proposal-optional-catch-binding\";\nimport proposalOptionalChaining from \"@babel/plugin-proposal-optional-chaining\";\nimport proposalUnicodePropertyRegex from \"@babel/plugin-proposal-unicode-property-regex\";\nimport transformAsyncToGenerator from \"@babel/plugin-transform-async-to-generator\";\nimport transformArrowFunctions from \"@babel/plugin-transform-arrow-functions\";\nimport transformBlockScopedFunctions from \"@babel/plugin-transform-block-scoped-functions\";\nimport transformBlockScoping from \"@babel/plugin-transform-block-scoping\";\nimport transformClasses from \"@babel/plugin-transform-classes\";\nimport transformComputedProperties from \"@babel/plugin-transform-computed-properties\";\nimport transformDestructuring from \"@babel/plugin-transform-destructuring\";\nimport transformDotallRegex from \"@babel/plugin-transform-dotall-regex\";\nimport transformDuplicateKeys from \"@babel/plugin-transform-duplicate-keys\";\nimport transformExponentialOperator from \"@babel/plugin-transform-exponentiation-operator\";\nimport transformForOf from \"@babel/plugin-transform-for-of\";\nimport transformFunctionName from \"@babel/plugin-transform-function-name\";\nimport transformLiterals from \"@babel/plugin-transform-literals\";\nimport transformMemberExpressionLiterals from \"@babel/plugin-transform-member-expression-literals\";\nimport transformModulesAmd from \"@babel/plugin-transform-modules-amd\";\nimport transformModulesCommonjs from \"@babel/plugin-transform-modules-commonjs\";\nimport transformModulesSystemjs from \"@babel/plugin-transform-modules-systemjs\";\nimport transformModulesUmd from \"@babel/plugin-transform-modules-umd\";\nimport transformNamedCapturingGroupsRegex from \"@babel/plugin-transform-named-capturing-groups-regex\";\nimport transformNewTarget from \"@babel/plugin-transform-new-target\";\nimport transformObjectSuper from \"@babel/plugin-transform-object-super\";\nimport transformParameters from \"@babel/plugin-transform-parameters\";\nimport transformPropertyLiterals from \"@babel/plugin-transform-property-literals\";\nimport transformRegenerator from \"@babel/plugin-transform-regenerator\";\nimport transformReservedWords from \"@babel/plugin-transform-reserved-words\";\nimport transformShorthandProperties from \"@babel/plugin-transform-shorthand-properties\";\nimport transformSpread from \"@babel/plugin-transform-spread\";\nimport transformStickyRegex from \"@babel/plugin-transform-sticky-regex\";\nimport transformTemplateLiterals from \"@babel/plugin-transform-template-literals\";\nimport transformTypeofSymbol from \"@babel/plugin-transform-typeof-symbol\";\nimport transformUnicodeRegex from \"@babel/plugin-transform-unicode-regex\";\n\nexport default {\n \"proposal-async-generator-functions\": proposalAsyncGeneratorFunctions,\n \"proposal-dynamic-import\": proposalDynamicImport,\n \"proposal-json-strings\": proposalJsonStrings,\n \"proposal-nullish-coalescing-operator\": proposalNullishCoalescingOperator,\n \"proposal-object-rest-spread\": proposalObjectRestSpread,\n \"proposal-optional-catch-binding\": proposalOptionalCatchBinding,\n \"proposal-optional-chaining\": proposalOptionalChaining,\n \"proposal-unicode-property-regex\": proposalUnicodePropertyRegex,\n \"syntax-async-generators\": syntaxAsyncGenerators,\n \"syntax-dynamic-import\": syntaxDynamicImport,\n \"syntax-json-strings\": syntaxJsonStrings,\n \"syntax-nullish-coalescing-operator\": syntaxNullishCoalescingOperator,\n \"syntax-object-rest-spread\": syntaxObjectRestSpread,\n \"syntax-optional-catch-binding\": syntaxOptionalCatchBinding,\n \"syntax-optional-chaining\": syntaxOptionalChaining,\n \"syntax-top-level-await\": syntaxTopLevelAwait,\n \"transform-arrow-functions\": transformArrowFunctions,\n \"transform-async-to-generator\": transformAsyncToGenerator,\n \"transform-block-scoped-functions\": transformBlockScopedFunctions,\n \"transform-block-scoping\": transformBlockScoping,\n \"transform-classes\": transformClasses,\n \"transform-computed-properties\": transformComputedProperties,\n \"transform-destructuring\": transformDestructuring,\n \"transform-dotall-regex\": transformDotallRegex,\n \"transform-duplicate-keys\": transformDuplicateKeys,\n \"transform-exponentiation-operator\": transformExponentialOperator,\n \"transform-for-of\": transformForOf,\n \"transform-function-name\": transformFunctionName,\n \"transform-literals\": transformLiterals,\n \"transform-member-expression-literals\": transformMemberExpressionLiterals,\n \"transform-modules-amd\": transformModulesAmd,\n \"transform-modules-commonjs\": transformModulesCommonjs,\n \"transform-modules-systemjs\": transformModulesSystemjs,\n \"transform-modules-umd\": transformModulesUmd,\n \"transform-named-capturing-groups-regex\": transformNamedCapturingGroupsRegex,\n \"transform-new-target\": transformNewTarget,\n \"transform-object-super\": transformObjectSuper,\n \"transform-parameters\": transformParameters,\n \"transform-property-literals\": transformPropertyLiterals,\n \"transform-regenerator\": transformRegenerator,\n \"transform-reserved-words\": transformReservedWords,\n \"transform-shorthand-properties\": transformShorthandProperties,\n \"transform-spread\": transformSpread,\n \"transform-sticky-regex\": transformStickyRegex,\n \"transform-template-literals\": transformTemplateLiterals,\n \"transform-typeof-symbol\": transformTypeofSymbol,\n \"transform-unicode-regex\": transformUnicodeRegex,\n};\n","//@flow\n\nimport { SemVer } from \"semver\";\nimport { logPluginOrPolyfill } from \"./debug\";\nimport getOptionSpecificExcludesFor from \"./get-option-specific-excludes\";\nimport { removeUnnecessaryItems } from \"./filter-items\";\nimport moduleTransformations from \"./module-transformations\";\nimport normalizeOptions from \"./normalize-options\";\nimport pluginList from \"@babel/compat-data/plugins\";\nimport { proposalPlugins, pluginSyntaxMap } from \"../data/shipped-proposals\";\nimport overlappingPlugins from \"@babel/compat-data/overlapping-plugins\";\n\nimport addCoreJS2UsagePlugin from \"./polyfills/corejs2/usage-plugin\";\nimport addCoreJS3UsagePlugin from \"./polyfills/corejs3/usage-plugin\";\nimport addRegeneratorUsagePlugin from \"./polyfills/regenerator/usage-plugin\";\nimport replaceCoreJS2EntryPlugin from \"./polyfills/corejs2/entry-plugin\";\nimport replaceCoreJS3EntryPlugin from \"./polyfills/corejs3/entry-plugin\";\nimport removeRegeneratorEntryPlugin from \"./polyfills/regenerator/entry-plugin\";\n\nimport getTargets, {\n prettifyTargets,\n filterItems,\n isRequired,\n type Targets,\n} from \"@babel/helper-compilation-targets\";\nimport availablePlugins from \"./available-plugins\";\nimport { filterStageFromList } from \"./utils\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nimport typeof ModuleTransformationsType from \"./module-transformations\";\nimport type { BuiltInsOption, ModuleOption } from \"./types\";\n\n// TODO: Remove in Babel 8\nexport function isPluginRequired(targets: Targets, support: Targets) {\n return isRequired(\"fake-name\", targets, {\n compatData: { \"fake-name\": support },\n });\n}\n\nconst pluginListWithoutProposals = filterStageFromList(\n pluginList,\n proposalPlugins,\n);\n\nconst getPlugin = (pluginName: string) => {\n const plugin = availablePlugins[pluginName];\n\n if (!plugin) {\n throw new Error(\n `Could not find plugin \"${pluginName}\". Ensure there is an entry in ./available-plugins.js for it.`,\n );\n }\n\n return plugin;\n};\n\nexport const transformIncludesAndExcludes = (opts: Array): Object => {\n return opts.reduce(\n (result, opt) => {\n const target = opt.match(/^(es|es6|es7|esnext|web)\\./)\n ? \"builtIns\"\n : \"plugins\";\n result[target].add(opt);\n return result;\n },\n {\n all: opts,\n plugins: new Set(),\n builtIns: new Set(),\n },\n );\n};\n\nexport const getModulesPluginNames = ({\n modules,\n transformations,\n shouldTransformESM,\n shouldTransformDynamicImport,\n shouldParseTopLevelAwait,\n}: {\n modules: ModuleOption,\n transformations: ModuleTransformationsType,\n shouldTransformESM: boolean,\n shouldTransformDynamicImport: boolean,\n shouldParseTopLevelAwait: boolean,\n}) => {\n const modulesPluginNames = [];\n if (modules !== false && transformations[modules]) {\n if (shouldTransformESM) {\n modulesPluginNames.push(transformations[modules]);\n }\n\n if (\n shouldTransformDynamicImport &&\n shouldTransformESM &&\n modules !== \"umd\"\n ) {\n modulesPluginNames.push(\"proposal-dynamic-import\");\n } else {\n if (shouldTransformDynamicImport) {\n console.warn(\n \"Dynamic import can only be supported when transforming ES modules\" +\n \" to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.\",\n );\n }\n modulesPluginNames.push(\"syntax-dynamic-import\");\n }\n } else {\n modulesPluginNames.push(\"syntax-dynamic-import\");\n }\n\n if (shouldParseTopLevelAwait) {\n modulesPluginNames.push(\"syntax-top-level-await\");\n }\n\n return modulesPluginNames;\n};\n\nexport const getPolyfillPlugins = ({\n useBuiltIns,\n corejs,\n polyfillTargets,\n include,\n exclude,\n proposals,\n shippedProposals,\n regenerator,\n debug,\n}: {\n useBuiltIns: BuiltInsOption,\n corejs: typeof SemVer | null | false,\n polyfillTargets: Targets,\n include: Set,\n exclude: Set,\n proposals: boolean,\n shippedProposals: boolean,\n regenerator: boolean,\n debug: boolean,\n}) => {\n const polyfillPlugins = [];\n if (useBuiltIns === \"usage\" || useBuiltIns === \"entry\") {\n const pluginOptions = {\n corejs,\n polyfillTargets,\n include,\n exclude,\n proposals,\n shippedProposals,\n regenerator,\n debug,\n };\n\n if (corejs) {\n if (useBuiltIns === \"usage\") {\n if (corejs.major === 2) {\n polyfillPlugins.push([addCoreJS2UsagePlugin, pluginOptions]);\n } else {\n polyfillPlugins.push([addCoreJS3UsagePlugin, pluginOptions]);\n }\n if (regenerator) {\n polyfillPlugins.push([addRegeneratorUsagePlugin, pluginOptions]);\n }\n } else {\n if (corejs.major === 2) {\n polyfillPlugins.push([replaceCoreJS2EntryPlugin, pluginOptions]);\n } else {\n polyfillPlugins.push([replaceCoreJS3EntryPlugin, pluginOptions]);\n if (!regenerator) {\n polyfillPlugins.push([removeRegeneratorEntryPlugin, pluginOptions]);\n }\n }\n }\n }\n }\n return polyfillPlugins;\n};\n\nfunction supportsStaticESM(caller) {\n return !!(caller && caller.supportsStaticESM);\n}\n\nfunction supportsDynamicImport(caller) {\n return !!(caller && caller.supportsDynamicImport);\n}\n\nfunction supportsTopLevelAwait(caller) {\n return !!(caller && caller.supportsTopLevelAwait);\n}\n\nexport default declare((api, opts) => {\n api.assertVersion(7);\n\n const {\n configPath,\n debug,\n exclude: optionsExclude,\n forceAllTransforms,\n ignoreBrowserslistConfig,\n include: optionsInclude,\n loose,\n modules,\n shippedProposals,\n spec,\n targets: optionsTargets,\n useBuiltIns,\n corejs: { version: corejs, proposals },\n } = normalizeOptions(opts);\n // TODO: remove this in next major\n let hasUglifyTarget = false;\n\n if (optionsTargets && optionsTargets.uglify) {\n hasUglifyTarget = true;\n delete optionsTargets.uglify;\n\n console.log(\"\");\n console.log(\"The uglify target has been deprecated. Set the top level\");\n console.log(\"option `forceAllTransforms: true` instead.\");\n console.log(\"\");\n }\n\n if (optionsTargets && optionsTargets.esmodules && optionsTargets.browsers) {\n console.log(\"\");\n console.log(\n \"@babel/preset-env: esmodules and browsers targets have been specified together.\",\n );\n console.log(\n `\\`browsers\\` target, \\`${optionsTargets.browsers}\\` will be ignored.`,\n );\n console.log(\"\");\n }\n\n const targets = getTargets(optionsTargets, {\n ignoreBrowserslistConfig,\n configPath,\n });\n const include = transformIncludesAndExcludes(optionsInclude);\n const exclude = transformIncludesAndExcludes(optionsExclude);\n\n const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;\n\n const modulesPluginNames = getModulesPluginNames({\n modules,\n transformations: moduleTransformations,\n // TODO: Remove the 'api.caller' check eventually. Just here to prevent\n // unnecessary breakage in the short term for users on older betas/RCs.\n shouldTransformESM:\n modules !== \"auto\" || !api.caller || !api.caller(supportsStaticESM),\n shouldTransformDynamicImport:\n modules !== \"auto\" || !api.caller || !api.caller(supportsDynamicImport),\n shouldParseTopLevelAwait: !api.caller || api.caller(supportsTopLevelAwait),\n });\n\n const pluginNames = filterItems(\n shippedProposals ? pluginList : pluginListWithoutProposals,\n include.plugins,\n exclude.plugins,\n transformTargets,\n modulesPluginNames,\n getOptionSpecificExcludesFor({ loose }),\n pluginSyntaxMap,\n );\n removeUnnecessaryItems(pluginNames, overlappingPlugins);\n\n const polyfillPlugins = getPolyfillPlugins({\n useBuiltIns,\n corejs,\n polyfillTargets: targets,\n include: include.builtIns,\n exclude: exclude.builtIns,\n proposals,\n shippedProposals,\n regenerator: pluginNames.has(\"transform-regenerator\"),\n debug,\n });\n\n const pluginUseBuiltIns = useBuiltIns !== false;\n const plugins = Array.from(pluginNames)\n .map(pluginName => [\n getPlugin(pluginName),\n { spec, loose, useBuiltIns: pluginUseBuiltIns },\n ])\n .concat(polyfillPlugins);\n\n if (debug) {\n console.log(\"@babel/preset-env: `DEBUG` option\");\n console.log(\"\\nUsing targets:\");\n console.log(JSON.stringify(prettifyTargets(targets), null, 2));\n console.log(`\\nUsing modules transform: ${modules.toString()}`);\n console.log(\"\\nUsing plugins:\");\n pluginNames.forEach(pluginName => {\n logPluginOrPolyfill(pluginName, targets, pluginList);\n });\n\n if (!useBuiltIns) {\n console.log(\n \"\\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.\",\n );\n } else {\n // NOTE: Polyfill plugins are outputting debug info internally\n console.log(`\\nUsing polyfills with \\`${useBuiltIns}\\` option:`);\n }\n }\n\n return { plugins };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport transformFlowStripTypes from \"@babel/plugin-transform-flow-strip-types\";\n\nexport default declare((api, { all }) => {\n api.assertVersion(7);\n\n return {\n plugins: [[transformFlowStripTypes, { all }]],\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport transformReactJSX from \"@babel/plugin-transform-react-jsx\";\nimport transformReactDisplayName from \"@babel/plugin-transform-react-display-name\";\nimport transformReactJSXSource from \"@babel/plugin-transform-react-jsx-source\";\nimport transformReactJSXSelf from \"@babel/plugin-transform-react-jsx-self\";\n\nexport default declare((api, opts) => {\n api.assertVersion(7);\n\n const pragma = opts.pragma || \"React.createElement\";\n const pragmaFrag = opts.pragmaFrag || \"React.Fragment\";\n const throwIfNamespace =\n opts.throwIfNamespace === undefined ? true : !!opts.throwIfNamespace;\n const development = !!opts.development;\n const useBuiltIns = !!opts.useBuiltIns;\n const { useSpread } = opts;\n\n if (typeof development !== \"boolean\") {\n throw new Error(\n \"@babel/preset-react 'development' option must be a boolean.\",\n );\n }\n\n return {\n plugins: [\n [\n transformReactJSX,\n { pragma, pragmaFrag, throwIfNamespace, useBuiltIns, useSpread },\n ],\n transformReactDisplayName,\n\n development && transformReactJSXSource,\n development && transformReactJSXSelf,\n ].filter(Boolean),\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport transformTypeScript from \"@babel/plugin-transform-typescript\";\n\nexport default declare(\n (\n api,\n {\n jsxPragma,\n allExtensions = false,\n isTSX = false,\n allowNamespaces,\n allowDeclareFields,\n },\n ) => {\n api.assertVersion(7);\n\n if (typeof allExtensions !== \"boolean\") {\n throw new Error(\".allExtensions must be a boolean, or undefined\");\n }\n\n if (typeof isTSX !== \"boolean\") {\n throw new Error(\".isTSX must be a boolean, or undefined\");\n }\n\n if (isTSX && !allExtensions) {\n throw new Error(\"isTSX:true requires allExtensions:true\");\n }\n\n const pluginOptions = isTSX => ({\n jsxPragma,\n isTSX,\n allowNamespaces,\n allowDeclareFields,\n });\n\n return {\n overrides: allExtensions\n ? [\n {\n plugins: [[transformTypeScript, pluginOptions(isTSX)]],\n },\n ]\n : [\n {\n // Only set 'test' if explicitly requested, since it requires that\n // Babel is being called`\n test: /\\.ts$/,\n plugins: [[transformTypeScript, pluginOptions(false)]],\n },\n {\n // Only set 'test' if explicitly requested, since it requires that\n // Babel is being called`\n test: /\\.tsx$/,\n plugins: [[transformTypeScript, pluginOptions(true)]],\n },\n ],\n };\n },\n);\n","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of the React source tree.\n */\n\nconst scriptTypes = [\"text/jsx\", \"text/babel\"];\n\nlet headEl;\nlet inlineScriptCount = 0;\n\n/**\n * Actually transform the code.\n */\nfunction transformCode(transformFn, script) {\n let source;\n if (script.url != null) {\n source = script.url;\n } else {\n source = \"Inline Babel script\";\n inlineScriptCount++;\n if (inlineScriptCount > 1) {\n source += \" (\" + inlineScriptCount + \")\";\n }\n }\n\n return transformFn(script.content, {\n filename: source,\n ...buildBabelOptions(script),\n }).code;\n}\n\n/**\n * Builds the Babel options for transforming the specified script, using some\n * sensible default presets and plugins if none were explicitly provided.\n */\nfunction buildBabelOptions(script) {\n return {\n presets: script.presets || [\"react\", \"es2015\"],\n plugins: script.plugins || [\n \"proposal-class-properties\",\n \"proposal-object-rest-spread\",\n \"transform-flow-strip-types\",\n ],\n sourceMaps: \"inline\",\n };\n}\n\n/**\n * Appends a script element at the end of the with the content of code,\n * after transforming it.\n */\nfunction run(transformFn, script) {\n const scriptEl = document.createElement(\"script\");\n scriptEl.text = transformCode(transformFn, script);\n headEl.appendChild(scriptEl);\n}\n\n/**\n * Load script from the provided url and pass the content to the callback.\n */\nfunction load(url, successCallback, errorCallback) {\n const xhr = new XMLHttpRequest();\n\n // async, however scripts will be executed in the order they are in the\n // DOM to mirror normal script loading.\n xhr.open(\"GET\", url, true);\n if (\"overrideMimeType\" in xhr) {\n xhr.overrideMimeType(\"text/plain\");\n }\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 0 || xhr.status === 200) {\n successCallback(xhr.responseText);\n } else {\n errorCallback();\n throw new Error(\"Could not load \" + url);\n }\n }\n };\n return xhr.send(null);\n}\n\n/**\n * Converts a comma-separated data attribute string into an array of values. If\n * the string is empty, returns an empty array. If the string is not defined,\n * returns null.\n */\nfunction getPluginsOrPresetsFromScript(script, attributeName) {\n const rawValue = script.getAttribute(attributeName);\n if (rawValue === \"\") {\n // Empty string means to not load ANY presets or plugins\n return [];\n }\n if (!rawValue) {\n // Any other falsy value (null, undefined) means we're not overriding this\n // setting, and should use the default.\n return null;\n }\n return rawValue.split(\",\").map(item => item.trim());\n}\n\n/**\n * Loop over provided script tags and get the content, via innerHTML if an\n * inline script, or by using XHR. Transforms are applied if needed. The scripts\n * are executed in the order they are found on the page.\n */\nfunction loadScripts(transformFn, scripts) {\n const result = [];\n const count = scripts.length;\n\n function check() {\n let script, i;\n\n for (i = 0; i < count; i++) {\n script = result[i];\n\n if (script.loaded && !script.executed) {\n script.executed = true;\n run(transformFn, script);\n } else if (!script.loaded && !script.error && !script.async) {\n break;\n }\n }\n }\n\n scripts.forEach((script, i) => {\n const scriptData = {\n // script.async is always true for non-JavaScript script tags\n async: script.hasAttribute(\"async\"),\n error: false,\n executed: false,\n plugins: getPluginsOrPresetsFromScript(script, \"data-plugins\"),\n presets: getPluginsOrPresetsFromScript(script, \"data-presets\"),\n };\n\n if (script.src) {\n result[i] = {\n ...scriptData,\n content: null,\n loaded: false,\n url: script.src,\n };\n\n load(\n script.src,\n content => {\n result[i].loaded = true;\n result[i].content = content;\n check();\n },\n () => {\n result[i].error = true;\n check();\n },\n );\n } else {\n result[i] = {\n ...scriptData,\n content: script.innerHTML,\n loaded: true,\n url: script.getAttribute(\"data-module\") || null,\n };\n }\n });\n\n check();\n}\n\n/**\n * Run script tags with type=\"text/jsx\".\n * @param {Array} scriptTags specify script tags to run, run all in the if not given\n */\nexport function runScripts(transformFn, scripts) {\n headEl = document.getElementsByTagName(\"head\")[0];\n if (!scripts) {\n scripts = document.getElementsByTagName(\"script\");\n }\n\n // Array.prototype.slice cannot be used on NodeList on IE8\n const jsxScripts = [];\n for (let i = 0; i < scripts.length; i++) {\n const script = scripts.item(i);\n // Support the old type=\"text/jsx;harmony=true\"\n const type = script.type.split(\";\")[0];\n if (scriptTypes.indexOf(type) !== -1) {\n jsxScripts.push(script);\n }\n }\n\n if (jsxScripts.length === 0) {\n return;\n }\n\n console.warn(\n \"You are using the in-browser Babel transformer. Be sure to precompile \" +\n \"your scripts for production - https://babeljs.io/docs/setup/\",\n );\n\n loadScripts(transformFn, jsxScripts);\n}\n","/**\n * Entry point for @babel/standalone. This wraps Babel's API in a version that's\n * friendlier for use in web browsers. It removes the automagical detection of\n * plugins, instead explicitly registering all the available plugins and\n * presets, and requiring custom ones to be registered through `registerPlugin`\n * and `registerPreset` respectively.\n * @flow\n */\n\n/* global VERSION */\n/* eslint-disable max-len */\n\nimport {\n transformFromAst as babelTransformFromAst,\n transform as babelTransform,\n buildExternalHelpers as babelBuildExternalHelpers,\n} from \"@babel/core\";\nimport { all } from \"./generated/plugins\";\nimport preset2015 from \"./preset-es2015\";\nimport presetStage0 from \"./preset-stage-0\";\nimport presetStage1 from \"./preset-stage-1\";\nimport presetStage2 from \"./preset-stage-2\";\nimport presetStage3 from \"./preset-stage-3\";\nimport presetEnv from \"@babel/preset-env\";\nimport presetFlow from \"@babel/preset-flow\";\nimport presetReact from \"@babel/preset-react\";\nimport presetTypescript from \"@babel/preset-typescript\";\n\nimport { runScripts } from \"./transformScriptTags\";\n\nconst isArray =\n Array.isArray ||\n (arg => Object.prototype.toString.call(arg) === \"[object Array]\");\n\n/**\n * Loads the given name (or [name, options] pair) from the given table object\n * holding the available presets or plugins.\n *\n * Returns undefined if the preset or plugin is not available; passes through\n * name unmodified if it (or the first element of the pair) is not a string.\n */\nfunction loadBuiltin(builtinTable, name) {\n if (isArray(name) && typeof name[0] === \"string\") {\n if (Object.prototype.hasOwnProperty.call(builtinTable, name[0])) {\n return [builtinTable[name[0]]].concat(name.slice(1));\n }\n return;\n } else if (typeof name === \"string\") {\n return builtinTable[name];\n }\n // Could be an actual preset/plugin module\n return name;\n}\n\n/**\n * Parses plugin names and presets from the specified options.\n */\nfunction processOptions(options) {\n // Parse preset names\n const presets = (options.presets || []).map(presetName => {\n const preset = loadBuiltin(availablePresets, presetName);\n\n if (preset) {\n // workaround for babel issue\n // at some point, babel copies the preset, losing the non-enumerable\n // buildPreset key; convert it into an enumerable key.\n if (\n isArray(preset) &&\n typeof preset[0] === \"object\" &&\n Object.prototype.hasOwnProperty.call(preset[0], \"buildPreset\")\n ) {\n preset[0] = { ...preset[0], buildPreset: preset[0].buildPreset };\n }\n } else {\n throw new Error(\n `Invalid preset specified in Babel options: \"${presetName}\"`,\n );\n }\n return preset;\n });\n\n // Parse plugin names\n const plugins = (options.plugins || []).map(pluginName => {\n const plugin = loadBuiltin(availablePlugins, pluginName);\n\n if (!plugin) {\n throw new Error(\n `Invalid plugin specified in Babel options: \"${pluginName}\"`,\n );\n }\n return plugin;\n });\n\n return {\n babelrc: false,\n ...options,\n presets,\n plugins,\n };\n}\n\nexport function transform(code: string, options: Object) {\n return babelTransform(code, processOptions(options));\n}\n\nexport function transformFromAst(ast: Object, code: string, options: Object) {\n return babelTransformFromAst(ast, code, processOptions(options));\n}\nexport const availablePlugins = {};\nexport const availablePresets = {};\nexport const buildExternalHelpers = babelBuildExternalHelpers;\n/**\n * Registers a named plugin for use with Babel.\n */\nexport function registerPlugin(name: string, plugin: Object | Function): void {\n if (Object.prototype.hasOwnProperty.call(availablePlugins, name)) {\n console.warn(\n `A plugin named \"${name}\" is already registered, it will be overridden`,\n );\n }\n availablePlugins[name] = plugin;\n}\n/**\n * Registers multiple plugins for use with Babel. `newPlugins` should be an object where the key\n * is the name of the plugin, and the value is the plugin itself.\n */\nexport function registerPlugins(newPlugins: {\n [string]: Object | Function,\n}): void {\n Object.keys(newPlugins).forEach(name =>\n registerPlugin(name, newPlugins[name]),\n );\n}\n\n/**\n * Registers a named preset for use with Babel.\n */\nexport function registerPreset(name: string, preset: Object | Function): void {\n if (Object.prototype.hasOwnProperty.call(availablePresets, name)) {\n if (name === \"env\") {\n console.warn(\n \"@babel/preset-env is now included in @babel/standalone, please remove @babel/preset-env-standalone\",\n );\n } else {\n console.warn(\n `A preset named \"${name}\" is already registered, it will be overridden`,\n );\n }\n }\n availablePresets[name] = preset;\n}\n/**\n * Registers multiple presets for use with Babel. `newPresets` should be an object where the key\n * is the name of the preset, and the value is the preset itself.\n */\nexport function registerPresets(newPresets: {\n [string]: Object | Function,\n}): void {\n Object.keys(newPresets).forEach(name =>\n registerPreset(name, newPresets[name]),\n );\n}\n\n// All the plugins we should bundle\n// Want to get rid of this long whitelist of plugins?\n// Wait! Please read https://github.com/babel/babel/pull/6177 first.\nregisterPlugins(all);\n\n// All the presets we should bundle\n// Want to get rid of this whitelist of presets?\n// Wait! Please read https://github.com/babel/babel/pull/6177 first.\nregisterPresets({\n env: presetEnv,\n es2015: preset2015,\n es2016: () => {\n return {\n plugins: [availablePlugins[\"transform-exponentiation-operator\"]],\n };\n },\n es2017: () => {\n return {\n plugins: [availablePlugins[\"transform-async-to-generator\"]],\n };\n },\n react: presetReact,\n \"stage-0\": presetStage0,\n \"stage-1\": presetStage1,\n \"stage-2\": presetStage2,\n \"stage-3\": presetStage3,\n \"es2015-loose\": {\n presets: [[preset2015, { loose: true }]],\n },\n // ES2015 preset with es2015-modules-commonjs removed\n \"es2015-no-commonjs\": {\n presets: [[preset2015, { modules: false }]],\n },\n typescript: presetTypescript,\n flow: presetFlow,\n});\n\n// $FlowIgnore\nexport const version = VERSION;\n\nfunction onDOMContentLoaded() {\n transformScriptTags();\n}\n\n// Listen for load event if we're in a browser and then kick off finding and\n// running of scripts with \"text/babel\" type.\nif (typeof window !== \"undefined\" && window && window.addEventListener) {\n window.addEventListener(\"DOMContentLoaded\", onDOMContentLoaded, false);\n}\n\n/**\n * Transform