@next-core/brick-utils 2.45.14 → 2.45.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.bundle.js","sources":["../src/loadScript.ts","../src/getTemplateDepsOfStoryboard.ts","../src/hasOwnProperty.ts","../src/asyncProcessStoryboard.ts","../src/computeRealRoutePath.ts","../src/createProviderClass.ts","../../../node_modules/tslib/tslib.es6.js","../../../node_modules/lower-case/dist.es2015/index.js","../../../node_modules/no-case/dist.es2015/index.js","../../../node_modules/dot-case/dist.es2015/index.js","../../../node_modules/param-case/dist.es2015/index.js","../../cook/dist/esm/ExecutionContext.js","../../cook/dist/esm/traverse.js","../../cook/dist/esm/context-free.js","../../cook/dist/esm/sanitize.js","../../cook/dist/esm/cook.js","../../../node_modules/@babel/parser/lib/index.js","../../cook/dist/esm/parse.js","../../cook/dist/esm/hasOwnProperty.js","../../cook/dist/esm/AnalysisContext.js","../../cook/dist/esm/precook.js","../../cook/dist/esm/lint.js","../../cook/dist/esm/precookFunction.js","../../cook/dist/esm/preevaluate.js","../src/cook/index.ts","../src/isObject.ts","../src/visitStoryboard.ts","../src/scanProcessorsInStoryboard.ts","../../storyboard/dist/esm/parseStoryboard.js","../../storyboard/dist/esm/traverseStoryboard.js","../src/scanStoryboard.ts","../src/getDllAndDepsOfStoryboard.ts","../../../node_modules/path-to-regexp/dist.es2015/index.js","../src/matchPath.ts","../src/restoreDynamicTemplates.ts","../src/scanBricksInStoryboard.ts","../src/scanPermissionActionsInStoryboard.ts","../src/scanAliasInStoryboard.ts","../src/scanI18NInStoryboard.ts","../src/scanAppInStoryboard.ts","../src/placeholder/interfaces.ts","../src/placeholder/lexical.ts","../src/placeholder/syntax.ts","../src/placeholder/compile.ts","../src/placeholder/index.ts","../src/resolveContextConcurrently.ts","../src/scanCustomApisInStoryboard.ts","../src/smartDisplayForEvaluableString.ts","../src/JsonStorage.ts","../src/builder/assertions.ts","../src/builder/normalizeBuilderNode.ts","../src/builder/normalizeMenu.ts","../src/deepFreeze.ts","../src/track.ts","../src/debounceByAnimationFrame.ts","../src/scanInstalledAppsInStoryboard.ts","../src/makeThrottledAggregation.ts","../src/removeDeadConditions.ts"],"sourcesContent":["const cache = new Map<string, Promise<string>>();\n\nexport function loadScript(src: string, prefix?: string): Promise<string>;\nexport function loadScript(src: string[], prefix?: string): Promise<string[]>;\nexport function loadScript(\n src: string | string[],\n prefix?: string\n): Promise<string | string[]> {\n if (Array.isArray(src)) {\n return Promise.all(\n src.map<Promise<string>>((item) => loadScript(item, prefix))\n );\n }\n const fixedSrc = prefix ? `${prefix}${src}` : src;\n if (cache.has(fixedSrc)) {\n return cache.get(fixedSrc);\n }\n const promise = new Promise<string>((resolve, reject) => {\n const end = (): void => {\n window.dispatchEvent(new CustomEvent(\"request.end\"));\n };\n const script = document.createElement(\"script\");\n script.src = fixedSrc;\n script.onload = () => {\n resolve(fixedSrc);\n end();\n };\n script.onerror = (e) => {\n reject(e);\n end();\n };\n const firstScript =\n document.currentScript || document.getElementsByTagName(\"script\")[0];\n firstScript.parentNode.insertBefore(script, firstScript);\n window.dispatchEvent(new CustomEvent(\"request.start\"));\n });\n cache.set(fixedSrc, promise);\n return promise;\n}\n\nconst prefetchCache = new Set<string>();\n\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ\nexport function prefetchScript(src: string | string[], prefix?: string): void {\n if (Array.isArray(src)) {\n for (const item of src) {\n prefetchScript(item, prefix);\n }\n return;\n }\n const fixedSrc = prefix ? `${prefix}${src}` : src;\n // Ignore scripts which already prefetched or loaded.\n if (prefetchCache.has(fixedSrc) || cache.has(fixedSrc)) {\n return;\n }\n prefetchCache.add(fixedSrc);\n const link = document.createElement(\"link\");\n link.rel = \"prefetch\";\n link.href = fixedSrc;\n document.head.appendChild(link);\n}\n","import {\n Storyboard,\n RouteConf,\n BrickConf,\n TemplatePackage,\n RouteConfOfBricks,\n} from \"@next-core/brick-types\";\nimport { uniq } from \"lodash\";\n\nexport function scanTemplatesInBrick(\n brickConf: BrickConf,\n collection: string[]\n): void {\n if (brickConf.template) {\n collection.push(brickConf.template);\n }\n if (brickConf.slots) {\n Object.values(brickConf.slots).forEach((slotConf) => {\n if (slotConf.type === \"bricks\") {\n scanTemplatesInBricks(slotConf.bricks, collection);\n } else {\n scanTemplatesInRoutes(slotConf.routes, collection);\n }\n });\n }\n if (Array.isArray(brickConf.internalUsedTemplates)) {\n brickConf.internalUsedTemplates.forEach((template) => {\n collection.push(template);\n });\n }\n}\n\nfunction scanTemplatesInBricks(\n bricks: BrickConf[],\n collection: string[]\n): void {\n if (Array.isArray(bricks)) {\n bricks.forEach((brickConf) => {\n scanTemplatesInBrick(brickConf, collection);\n });\n }\n}\n\nfunction scanTemplatesInRoutes(\n routes: RouteConf[],\n collection: string[]\n): void {\n if (Array.isArray(routes)) {\n routes.forEach((routeConf) => {\n if (routeConf.type === \"routes\") {\n scanTemplatesInRoutes(routeConf.routes, collection);\n } else {\n scanTemplatesInBricks(\n (routeConf as RouteConfOfBricks).bricks,\n collection\n );\n }\n const brickConf = routeConf.menu;\n if (brickConf && brickConf.type === \"brick\") {\n scanTemplatesInBrick(brickConf, collection);\n }\n });\n }\n}\n\nexport function scanTemplatesInStoryboard(\n storyboard: Storyboard,\n isUniq = true\n): string[] {\n const collection: string[] = [];\n scanTemplatesInRoutes(storyboard.routes, collection);\n return isUniq ? uniq(collection) : collection;\n}\n\nexport function getDepsOfTemplates(\n templates: string[],\n templatePackages: TemplatePackage[]\n): string[] {\n const templateMap: Map<string, TemplatePackage> = templatePackages.reduce(\n (m, item) => {\n if (/^templates\\/.*\\/dist\\/.*\\.js$/.test(item.filePath)) {\n const namespace = item.filePath.split(\"/\")[1];\n m.set(namespace, item);\n } else {\n // eslint-disable-next-line no-console\n console.error(\n `the file path of template is \\`${item.filePath}\\` and it is non-standard package path`\n );\n }\n return m;\n },\n new Map()\n );\n\n return templates.reduce((arr, template) => {\n const namespace = template.split(\".\")[0];\n const find = templateMap.get(namespace);\n if (find) {\n arr.push(find.filePath);\n } else {\n // eslint-disable-next-line no-console\n console.error(\n `the name of template is \\`${template}\\` and it don't match any template package`\n );\n }\n\n return arr;\n }, []);\n}\n\nexport function getTemplateDepsOfStoryboard(\n storyboard: Storyboard,\n templatePackages: TemplatePackage[]\n): string[] {\n return getDepsOfTemplates(\n scanTemplatesInStoryboard(storyboard),\n templatePackages\n );\n}\n","export function hasOwnProperty(\n object: object,\n property: string | number | symbol\n): boolean {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n","import { get, cloneDeep } from \"lodash\";\nimport {\n Storyboard,\n RouteConf,\n RuntimeBrickConf,\n BrickTemplateFactory,\n TemplateRegistry,\n TemplatePackage,\n RouteConfOfBricks,\n} from \"@next-core/brick-types\";\nimport { loadScript } from \"./loadScript\";\nimport { getDepsOfTemplates } from \"./getTemplateDepsOfStoryboard\";\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport async function asyncProcessBrick(\n brickConf: RuntimeBrickConf,\n templateRegistry: TemplateRegistry<BrickTemplateFactory>,\n templatePackages: TemplatePackage[]\n): Promise<void> {\n if (brickConf.template) {\n if (\n !brickConf.$$resolved &&\n get(brickConf, [\"lifeCycle\", \"useResolves\"], []).length > 0\n ) {\n // Leave these dynamic templates to `LocationContext::resolve()`.\n // Remember original params, since it maybe changed when resolving.\n brickConf.$$params = cloneDeep(brickConf.params);\n } else {\n let updatedBrickConf: Partial<RuntimeBrickConf> = brickConf;\n const processedTemplates: string[] = [];\n // If a template returns a template, keep on loading template,\n // until finally it returns a brick.\n while (updatedBrickConf.template) {\n // Forbid recursive templates.\n if (processedTemplates.includes(updatedBrickConf.template)) {\n throw new Error(\n `Recursive template found: ${updatedBrickConf.template}`\n );\n }\n processedTemplates.push(updatedBrickConf.template);\n\n if (!templateRegistry.has(updatedBrickConf.template)) {\n await loadScript(\n getDepsOfTemplates([updatedBrickConf.template], templatePackages),\n window.PUBLIC_ROOT\n );\n }\n if (templateRegistry.has(updatedBrickConf.template)) {\n updatedBrickConf = templateRegistry.get(updatedBrickConf.template)(\n updatedBrickConf.params\n );\n } else {\n updatedBrickConf = {\n brick: \"basic-bricks.page-error\",\n properties: {\n error: `Template not found: ${brickConf.template}`,\n },\n };\n }\n }\n // Cleanup brickConf and remember original data for restore.\n const { template, lifeCycle, $$params, params } = brickConf;\n const hasIf = hasOwnProperty(brickConf, \"if\");\n const rawIf = brickConf.if;\n Object.keys(brickConf).forEach((key) => {\n delete brickConf[key as keyof RuntimeBrickConf];\n });\n Object.assign(\n brickConf,\n updatedBrickConf,\n {\n $$template: template,\n $$params: $$params || cloneDeep(params),\n $$lifeCycle: lifeCycle,\n },\n hasIf ? { $$if: rawIf } : {}\n );\n }\n }\n if (brickConf.slots) {\n await Promise.all(\n Object.values(brickConf.slots).map(async (slotConf) => {\n if (slotConf.type === \"bricks\") {\n await asyncProcessBricks(\n slotConf.bricks,\n templateRegistry,\n templatePackages\n );\n } else {\n await asyncProcessRoutes(\n slotConf.routes,\n templateRegistry,\n templatePackages\n );\n }\n })\n );\n }\n}\n\nasync function asyncProcessBricks(\n bricks: RuntimeBrickConf[],\n templateRegistry: TemplateRegistry<BrickTemplateFactory>,\n templatePackages: TemplatePackage[]\n): Promise<void> {\n if (Array.isArray(bricks)) {\n await Promise.all(\n bricks.map(async (brickConf) => {\n await asyncProcessBrick(brickConf, templateRegistry, templatePackages);\n })\n );\n }\n}\n\nasync function asyncProcessRoutes(\n routes: RouteConf[],\n templateRegistry: TemplateRegistry<BrickTemplateFactory>,\n templatePackages: TemplatePackage[]\n): Promise<void> {\n if (Array.isArray(routes)) {\n await Promise.all(\n routes.map(async (routeConf) => {\n if (routeConf.type === \"routes\") {\n await asyncProcessRoutes(\n routeConf.routes,\n templateRegistry,\n templatePackages\n );\n } else {\n await asyncProcessBricks(\n (routeConf as RouteConfOfBricks).bricks,\n templateRegistry,\n templatePackages\n );\n }\n const menuBrickConf = routeConf.menu;\n if (menuBrickConf && menuBrickConf.type === \"brick\") {\n await asyncProcessBrick(\n menuBrickConf,\n templateRegistry,\n templatePackages\n );\n }\n })\n );\n }\n}\n\nexport async function asyncProcessStoryboard(\n storyboard: Storyboard,\n templateRegistry: TemplateRegistry<BrickTemplateFactory>,\n templatePackages: TemplatePackage[]\n): Promise<Storyboard> {\n await asyncProcessRoutes(\n storyboard.routes,\n templateRegistry,\n templatePackages\n );\n return storyboard;\n}\n","import { MicroApp } from \"@next-core/brick-types\";\n\nexport function computeRealRoutePath(\n path: string | string[],\n app: MicroApp\n): string | string[] {\n if (Array.isArray(path)) {\n // eslint-disable-next-line no-console\n console.warn(\"Set route's path to an array is deprecated\");\n return path.map((p) => computeRealRoutePath(p, app) as string);\n }\n if (typeof path !== \"string\") {\n return;\n }\n return path.replace(\"${APP.homepage}\", app?.homepage);\n}\n","import { set } from \"lodash\";\nimport { saveAs } from \"file-saver\";\n\ninterface ProviderElement<P extends unknown[], R> extends HTMLElement {\n args: P;\n\n updateArgs: (event: CustomEvent<Record<string, unknown>>) => void;\n\n updateArgsAndExecute: (\n event: CustomEvent<Record<string, unknown>>\n ) => Promise<R>;\n\n setArgs: (patch: Record<string, unknown>) => void;\n\n setArgsAndExecute: (patch: Record<string, unknown>) => Promise<R>;\n\n execute(): Promise<R>;\n\n executeWithArgs(...args: P): Promise<R>;\n\n saveAs(filename: string, ...args: P): Promise<void>;\n\n resolve(...args: P): R;\n}\n\nexport function createProviderClass<T extends unknown[], U>(\n api: (...args: T) => U\n): { new (): ProviderElement<T, U> } {\n return class extends HTMLElement {\n get $$typeof(): string {\n return \"provider\";\n }\n\n static get _dev_only_definedProperties(): string[] {\n return [\"args\"];\n }\n\n args = [] as T;\n\n updateArgs(event: CustomEvent<Record<string, unknown>>): void {\n if (!(event instanceof CustomEvent)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"`updateArgs/updateArgsAndExecute` is designed to receive an CustomEvent, if not, please use `setArgs/setArgsAndExecute` instead.\"\n );\n }\n this.setArgs(event.detail);\n }\n\n updateArgsAndExecute(\n event: CustomEvent<Record<string, unknown>>\n ): Promise<U> {\n this.updateArgs(event);\n return this.execute();\n }\n\n setArgs(patch: Record<string, unknown>): void {\n for (const [path, value] of Object.entries(patch)) {\n set(this.args, path, value);\n }\n }\n\n setArgsAndExecute(patch: Record<string, unknown>): Promise<U> {\n this.setArgs(patch);\n return this.execute();\n }\n\n execute(): Promise<U> {\n return this.executeWithArgs(...this.args);\n }\n\n async saveAs(filename: string, ...args: T): Promise<void> {\n const blob = await api(...args);\n saveAs((blob as unknown) as Blob, filename);\n }\n\n async executeWithArgs(...args: T): Promise<U> {\n try {\n const result = await api(...args);\n this.dispatchEvent(\n new CustomEvent(\"response.success\", {\n detail: result,\n })\n );\n return result;\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(\"response.error\", {\n detail: error,\n })\n );\n return Promise.reject(error);\n }\n }\n\n resolve(...args: T): U {\n return api(...args);\n }\n };\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nvar SUPPORTED_LOCALE = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"\\u0069\\u0307\",\n J: \"\\u006A\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"\\u0069\\u0307\\u0300\",\n Í: \"\\u0069\\u0307\\u0301\",\n Ĩ: \"\\u0069\\u0307\\u0303\",\n },\n },\n};\n/**\n * Localized lower case.\n */\nexport function localeLowerCase(str, locale) {\n var lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang)\n return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));\n return lowerCase(str);\n}\n/**\n * Lower case as a function.\n */\nexport function lowerCase(str) {\n return str.toLowerCase();\n}\n//# sourceMappingURL=index.js.map","import { lowerCase } from \"lower-case\";\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\nvar DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n// Remove all non-word characters.\nvar DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\nexport function noCase(input, options) {\n if (options === void 0) { options = {}; }\n var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? \" \" : _d;\n var result = replace(replace(input, splitRegexp, \"$1\\0$2\"), stripRegexp, \"\\0\");\n var start = 0;\n var end = result.length;\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\")\n start++;\n while (result.charAt(end - 1) === \"\\0\")\n end--;\n // Transform each token independently.\n return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n/**\n * Replace `re` in the input string with the replacement value.\n */\nfunction replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nexport function dotCase(input, options) {\n if (options === void 0) { options = {}; }\n return noCase(input, __assign({ delimiter: \".\" }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { dotCase } from \"dot-case\";\nexport function paramCase(input, options) {\n if (options === void 0) { options = {}; }\n return dotCase(input, __assign({ delimiter: \"-\" }, options));\n}\n//# sourceMappingURL=index.js.map","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n// https://tc39.es/ecma262/#sec-execution-contexts\nexport class ExecutionContext {\n constructor() {\n _defineProperty(this, \"VariableEnvironment\", void 0);\n _defineProperty(this, \"LexicalEnvironment\", void 0);\n _defineProperty(this, \"Function\", void 0);\n }\n}\n// https://tc39.es/ecma262/#sec-environment-records\nexport class EnvironmentRecord {\n constructor(outer) {\n _defineProperty(this, \"OuterEnv\", void 0);\n _defineProperty(this, \"bindingMap\", new Map());\n this.OuterEnv = outer;\n }\n HasBinding(name) {\n return this.bindingMap.has(name);\n }\n CreateMutableBinding(name, deletable) {\n // Assert: binding does not exist.\n this.bindingMap.set(name, {\n mutable: true,\n deletable\n });\n return NormalCompletion(undefined);\n }\n\n /**\n * Create an immutable binding.\n *\n * @param name - The binding name.\n * @param strict - For named function expressions, strict is false, otherwise it's true.\n * @returns CompletionRecord.\n */\n CreateImmutableBinding(name, strict) {\n // Assert: binding does not exist.\n this.bindingMap.set(name, {\n strict\n });\n return NormalCompletion(undefined);\n }\n InitializeBinding(name, value) {\n var binding = this.bindingMap.get(name);\n // Assert: binding exists and uninitialized.\n Object.assign(binding, {\n initialized: true,\n value\n });\n return NormalCompletion(undefined);\n }\n\n /**\n * Update a mutable binding value, including function declarations.\n *\n * @param name - The binding name.\n * @param value - The binding value.\n * @param strict - For functions, strict is always false, otherwise it depends on strict-mode.\n * @returns\n */\n SetMutableBinding(name, value, strict) {\n var binding = this.bindingMap.get(name);\n // Assert: binding exists.\n if (!binding.initialized) {\n throw new ReferenceError(\"\".concat(name, \" is not initialized\"));\n } else if (binding.mutable) {\n binding.value = value;\n } else {\n throw new TypeError(\"Assignment to constant variable\");\n }\n return NormalCompletion(undefined);\n }\n GetBindingValue(name, strict) {\n var binding = this.bindingMap.get(name);\n // Assert: binding exists.\n if (!binding.initialized) {\n throw new ReferenceError(\"\".concat(name, \" is not initialized\"));\n }\n return binding.value;\n }\n}\nexport class DeclarativeEnvironment extends EnvironmentRecord {}\nexport class FunctionEnvironment extends EnvironmentRecord {}\nexport var SourceNode = Symbol.for(\"SourceNode\");\nexport var FormalParameters = Symbol.for(\"FormalParameters\");\nexport var ECMAScriptCode = Symbol.for(\"ECMAScriptCode\");\nexport var Environment = Symbol.for(\"Environment\");\nexport var IsConstructor = Symbol.for(\"IsConstructor\");\n// https://tc39.es/ecma262/#sec-reference-record-specification-type\nexport class ReferenceRecord {\n /** Whether the reference is in strict mode. */\n\n constructor(base, referenceName, strict) {\n _defineProperty(this, \"Base\", void 0);\n _defineProperty(this, \"ReferenceName\", void 0);\n _defineProperty(this, \"Strict\", void 0);\n this.Base = base;\n this.ReferenceName = referenceName;\n this.Strict = strict;\n }\n}\n\n// https://tc39.es/ecma262/#sec-completion-record-specification-type\nexport class CompletionRecord {\n constructor(type, value) {\n _defineProperty(this, \"Type\", void 0);\n _defineProperty(this, \"Value\", void 0);\n this.Type = type;\n this.Value = value;\n }\n}\n// https://tc39.es/ecma262/#sec-normalcompletion\nexport function NormalCompletion(value) {\n return new CompletionRecord(\"normal\", value);\n}\nexport var Empty = Symbol(\"empty completion\");\n//# sourceMappingURL=ExecutionContext.js.map","export function collectBoundNames(root) {\n var names = new Set();\n var collect = node => {\n if (Array.isArray(node)) {\n for (var n of node) {\n collect(n);\n }\n } else if (node) {\n // `node` maybe `null` in some cases.\n switch (node.type) {\n case \"Identifier\":\n names.add(node.name);\n return;\n case \"VariableDeclaration\":\n return collect(node.declarations);\n case \"VariableDeclarator\":\n return collect(node.id);\n case \"ArrayPattern\":\n return collect(node.elements);\n case \"AssignmentPattern\":\n return collect(node.left);\n case \"ObjectPattern\":\n return collect(node.properties);\n case \"Property\":\n return collect(node.value);\n case \"RestElement\":\n return collect(node.argument);\n case \"FunctionDeclaration\":\n return collect(node.id);\n }\n }\n };\n collect(root);\n return Array.from(names);\n}\nexport function containsExpression(root) {\n var collect = node => {\n if (Array.isArray(node)) {\n return node.some(collect);\n } else if (node) {\n // `node` maybe `null` in some cases.\n switch (node.type) {\n case \"ArrayPattern\":\n return collect(node.elements);\n case \"AssignmentPattern\":\n return true;\n case \"ObjectPattern\":\n return collect(node.properties);\n case \"Property\":\n return node.computed || collect(node.value);\n case \"RestElement\":\n return collect(node.argument);\n }\n }\n };\n return collect(root);\n}\nexport function collectScopedDeclarations(root, options) {\n var declarations = [];\n var nextOptions = {\n var: options.var\n };\n var collect = (node, options) => {\n if (Array.isArray(node)) {\n for (var n of node) {\n collect(n, options);\n }\n } else if (node) {\n // `node` maybe `null` in some cases.\n switch (node.type) {\n case \"FunctionDeclaration\":\n // At the top level of a function, or script, function declarations are\n // treated like var declarations rather than like lexical declarations.\n // See https://tc39.es/ecma262/#sec-static-semantics-toplevellexicallydeclarednames\n if (Number(!options.var) ^ Number(options.topLevel)) {\n declarations.push(node);\n }\n return;\n case \"VariableDeclaration\":\n if (Number(!options.var) ^ Number(node.kind === \"var\")) {\n declarations.push(node);\n }\n return;\n case \"SwitchCase\":\n collect(node.consequent, nextOptions);\n return;\n case \"CatchClause\":\n collect(node.body, nextOptions);\n return;\n }\n if (options.var) {\n switch (node.type) {\n case \"BlockStatement\":\n collect(node.body, nextOptions);\n return;\n case \"IfStatement\":\n collect(node.consequent, nextOptions);\n collect(node.alternate, nextOptions);\n return;\n case \"DoWhileStatement\":\n case \"WhileStatement\":\n collect(node.body, nextOptions);\n return;\n case \"ForStatement\":\n collect(node.init, nextOptions);\n collect(node.body, nextOptions);\n return;\n case \"ForInStatement\":\n case \"ForOfStatement\":\n collect(node.left, nextOptions);\n collect(node.body, nextOptions);\n return;\n case \"SwitchStatement\":\n collect(node.cases, nextOptions);\n return;\n case \"TryStatement\":\n collect(node.block, nextOptions);\n collect(node.handler, nextOptions);\n collect(node.finalizer, nextOptions);\n return;\n }\n }\n }\n };\n collect(root, options);\n return declarations;\n}\n//# sourceMappingURL=traverse.js.map","import { CompletionRecord, Empty, EnvironmentRecord, NormalCompletion, ReferenceRecord } from \"./ExecutionContext\";\nimport { collectBoundNames } from \"./traverse\";\n\n// https://tc39.es/ecma262/#sec-ispropertyreference\nexport function IsPropertyReference(V) {\n return V.Base !== \"unresolvable\" && !(V.Base instanceof EnvironmentRecord);\n}\n\n// https://tc39.es/ecma262/#sec-initializereferencedbinding\nexport function InitializeReferencedBinding(V, W) {\n var base = V.Base;\n return base.InitializeBinding(V.ReferenceName, W);\n}\n\n// https://tc39.es/ecma262/#sec-copydataproperties\nexport function CopyDataProperties(target, source, excludedItems) {\n if (source === undefined || source === null) {\n return target;\n }\n var keys = Object.getOwnPropertyNames(source).concat(Object.getOwnPropertySymbols(source));\n for (var nextKey of keys) {\n if (!excludedItems.has(nextKey)) {\n var desc = Object.getOwnPropertyDescriptor(source, nextKey);\n if (desc !== null && desc !== void 0 && desc.enumerable) {\n target[nextKey] = source[nextKey];\n }\n }\n }\n return target;\n}\n\n// https://tc39.es/ecma262/#sec-runtime-semantics-fordeclarationbindinginstantiation\nexport function ForDeclarationBindingInstantiation(forDeclaration, env) {\n var isConst = forDeclaration.kind === \"const\";\n for (var name of collectBoundNames(forDeclaration)) {\n if (isConst) {\n env.CreateImmutableBinding(name, true);\n } else {\n env.CreateMutableBinding(name, false);\n }\n }\n}\n\n// https://tc39.es/ecma262/#sec-loopcontinues\nexport function LoopContinues(completion) {\n return completion.Type === \"normal\" || completion.Type == \"continue\";\n}\n\n// https://tc39.es/ecma262/#sec-updateempty\nexport function UpdateEmpty(completion, value) {\n if (completion.Value !== Empty) {\n return completion;\n }\n return new CompletionRecord(completion.Type, value);\n}\n\n// https://tc39.es/ecma262/#sec-getvalue\nexport function GetValue(V) {\n if (V instanceof CompletionRecord) {\n // Assert: V.Type is normal.\n V = V.Value;\n }\n if (!(V instanceof ReferenceRecord)) {\n return V;\n }\n if (V.Base === \"unresolvable\") {\n throw new ReferenceError(\"\".concat(V.ReferenceName, \" is not defined\"));\n }\n if (V.Base instanceof EnvironmentRecord) {\n var base = V.Base;\n return base.GetBindingValue(V.ReferenceName, V.Strict);\n }\n return V.Base[V.ReferenceName];\n}\n\n// https://tc39.es/ecma262/#sec-topropertykey\nexport function ToPropertyKey(arg) {\n if (typeof arg === \"symbol\") {\n return arg;\n }\n return String(arg);\n}\n\n// https://tc39.es/ecma262/#sec-getv\nexport function GetV(V, P) {\n return V[P];\n}\n\n// https://tc39.es/ecma262/#sec-putvalue\nexport function PutValue(V, W) {\n // Assert: V is a ReferenceRecord.\n if (V.Base === \"unresolvable\") {\n throw new ReferenceError(\"\".concat(V.ReferenceName, \" is not defined\"));\n }\n if (V.Base instanceof EnvironmentRecord) {\n return V.Base.SetMutableBinding(V.ReferenceName, W, V.Strict);\n }\n V.Base[V.ReferenceName] = W;\n return NormalCompletion(undefined);\n}\n\n// https://tc39.es/ecma262/#sec-createlistiteratorRecord\nexport function CreateListIteratorRecord(args) {\n if (!isIterable(args)) {\n throw new TypeError(\"\".concat(typeof args, \" is not iterable\"));\n }\n return args[Symbol.iterator]();\n}\n\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nexport function RequireObjectCoercible(arg) {\n if (arg === null || arg === undefined) {\n throw new TypeError(\"Cannot destructure properties of undefined or null\");\n }\n}\n\n// https://tc39.es/ecma262/#sec-getidentifierreference\nexport function GetIdentifierReference(env, name, strict) {\n if (!env) {\n return new ReferenceRecord(\"unresolvable\", name, strict);\n }\n if (env.HasBinding(name)) {\n return new ReferenceRecord(env, name, strict);\n }\n return GetIdentifierReference(env.OuterEnv, name, strict);\n}\n\n// https://tc39.es/ecma262/#sec-applystringornumericbinaryoperator\nexport function ApplyStringOrNumericBinaryOperator(leftValue, operator, rightValue) {\n switch (operator) {\n case \"+\":\n return leftValue + rightValue;\n case \"-\":\n return leftValue - rightValue;\n case \"/\":\n return leftValue / rightValue;\n case \"%\":\n return leftValue % rightValue;\n case \"*\":\n return leftValue * rightValue;\n case \"**\":\n return leftValue ** rightValue;\n case \"==\":\n return leftValue == rightValue;\n case \"===\":\n return leftValue === rightValue;\n case \"!=\":\n return leftValue != rightValue;\n case \"!==\":\n return leftValue !== rightValue;\n case \">\":\n return leftValue > rightValue;\n case \"<\":\n return leftValue < rightValue;\n case \">=\":\n return leftValue >= rightValue;\n case \"<=\":\n return leftValue <= rightValue;\n }\n throw new SyntaxError(\"Unsupported binary operator `\".concat(operator, \"`\"));\n}\n\n// https://tc39.es/ecma262/#sec-assignment-operators\nexport function ApplyStringOrNumericAssignment(leftValue, operator, rightValue) {\n switch (operator) {\n case \"+=\":\n case \"-=\":\n case \"*=\":\n case \"/=\":\n case \"%=\":\n case \"**=\":\n return ApplyStringOrNumericBinaryOperator(leftValue, operator.substr(0, operator.length - 1), rightValue);\n }\n throw new SyntaxError(\"Unsupported assignment operator `\".concat(operator, \"`\"));\n}\n\n// https://tc39.es/ecma262/#sec-unary-operators\nexport function ApplyUnaryOperator(target, operator) {\n switch (operator) {\n case \"!\":\n return !target;\n case \"+\":\n return +target;\n case \"-\":\n return -target;\n case \"void\":\n return undefined;\n }\n throw new SyntaxError(\"Unsupported unary operator `\".concat(operator, \"`\"));\n}\nexport function isIterable(cooked) {\n if (Array.isArray(cooked)) {\n return true;\n }\n if (cooked === null || cooked === undefined) {\n return false;\n }\n return typeof cooked[Symbol.iterator] === \"function\";\n}\n//# sourceMappingURL=context-free.js.map","// Ref https://github.com/tc39/proposal-global\n// In addition, the es6-shim had to switch from Function('return this')()\n// due to CSP concerns, such that the current check to handle browsers,\n// node, web workers, and frames is:\n// istanbul ignore next\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction getGlobal() {\n // the only reliable means to get the global object is\n // `Function('return this')()`\n // However, this causes CSP violations in Chrome apps.\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\n\n/**\n * There are chances to construct a `Function` from a string, etc.\n * ```\n * ((a,b)=>a[b])(()=>1, 'constructor')('console.log(`yo`)')()\n * ```\n */\nvar reservedObjects = new WeakSet([\n// `Function(\"...\")` is considered *extremely vulnerable*.\nFunction,\n// `Object.assign()` is considered vulnerable.\nObject,\n// `prototype` is considered vulnerable.\nFunction.prototype, Object.prototype,\n// Global `window` is considered vulnerable, too.\ngetGlobal()]);\nexport function sanitize(cooked) {\n // eslint-disable-next-line @typescript-eslint/ban-types\n if (reservedObjects.has(cooked)) {\n throw new TypeError(\"Cannot access reserved objects such as `Function`.\");\n }\n}\nvar allowedConstructors = new WeakSet([Array, Map, Set, URLSearchParams, WeakMap, WeakSet]);\nexport function isAllowedConstructor(constructor) {\n // `Date` maybe mocked when running tests for storyboard functions.\n return allowedConstructors.has(constructor) || constructor === Date;\n}\n//# sourceMappingURL=sanitize.js.map","import { ApplyStringOrNumericAssignment, CreateListIteratorRecord, ApplyStringOrNumericBinaryOperator, GetV, GetValue, InitializeReferencedBinding, IsPropertyReference, LoopContinues, PutValue, RequireObjectCoercible, ToPropertyKey, UpdateEmpty, ApplyUnaryOperator, GetIdentifierReference, ForDeclarationBindingInstantiation, CopyDataProperties } from \"./context-free\";\nimport { CompletionRecord, DeclarativeEnvironment, ECMAScriptCode, Empty, Environment, ExecutionContext, FormalParameters, FunctionEnvironment, IsConstructor, NormalCompletion, ReferenceRecord, SourceNode } from \"./ExecutionContext\";\nimport { sanitize, isAllowedConstructor } from \"./sanitize\";\nimport { collectBoundNames, collectScopedDeclarations, containsExpression } from \"./traverse\";\n/** For next-core internal usage only. */\nexport function cook(rootAst, codeSource) {\n var _hooks$beforeEvaluate3;\n var {\n rules,\n globalVariables = {},\n hooks = {}\n } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var expressionOnly = rootAst.type !== \"FunctionDeclaration\";\n var rootEnv = new DeclarativeEnvironment(null);\n var rootContext = new ExecutionContext();\n rootContext.VariableEnvironment = rootEnv;\n rootContext.LexicalEnvironment = rootEnv;\n var executionContextStack = [rootContext];\n for (var [key, value] of Object.entries(globalVariables)) {\n rootEnv.CreateImmutableBinding(key, true);\n rootEnv.InitializeBinding(key, value);\n }\n var TemplateMap = new WeakMap();\n\n // https://tc39.es/ecma262/#sec-gettemplateobject\n function GetTemplateObject(templateLiteral) {\n var memo = TemplateMap.get(templateLiteral);\n if (memo) {\n return memo;\n }\n var rawObj = templateLiteral.quasis.map(quasi => quasi.value.raw);\n var template = templateLiteral.quasis.map(quasi => quasi.value.cooked);\n Object.freeze(rawObj);\n Object.defineProperty(template, \"raw\", {\n value: rawObj,\n writable: false,\n enumerable: false,\n configurable: false\n });\n Object.freeze(template);\n TemplateMap.set(templateLiteral, template);\n return template;\n }\n function Evaluate(node, optionalChainRef) {\n var _hooks$beforeEvaluate, _hooks$beforeBranch, _hooks$beforeBranch2;\n (_hooks$beforeEvaluate = hooks.beforeEvaluate) === null || _hooks$beforeEvaluate === void 0 ? void 0 : _hooks$beforeEvaluate.call(hooks, node);\n // Expressions:\n switch (node.type) {\n case \"ArrayExpression\":\n {\n // https://tc39.es/ecma262/#sec-array-initializer\n var array = [];\n for (var element of node.elements) {\n if (!element) {\n array.length += 1;\n } else if (element.type === \"SpreadElement\") {\n var spreadValues = GetValue(Evaluate(element.argument));\n array.push(...spreadValues);\n } else {\n array.push(GetValue(Evaluate(element)));\n }\n }\n return NormalCompletion(array);\n }\n case \"ArrowFunctionExpression\":\n {\n // https://tc39.es/ecma262/#sec-arrow-function-definitions\n ThrowIfFunctionIsInvalid(node);\n var closure = InstantiateArrowFunctionExpression(node);\n return NormalCompletion(closure);\n }\n case \"BinaryExpression\":\n {\n var leftRef = Evaluate(node.left);\n var leftValue = GetValue(leftRef);\n var rightRef = Evaluate(node.right).Value;\n var rightValue = GetValue(rightRef);\n if (expressionOnly && node.operator === \"|>\") {\n // Minimal pipeline operator is supported only in expression-only mode.\n // See https://tc39.es/proposal-pipeline-operator\n // and https://github.com/tc39/proposal-pipeline-operator\n if (typeof rightValue !== \"function\") {\n var funcName = codeSource.substring(node.right.start, node.right.end);\n throw new TypeError(\"\".concat(funcName, \" is not a function\"));\n }\n var thisValue;\n if (rightRef instanceof ReferenceRecord) {\n if (IsPropertyReference(rightRef)) {\n thisValue = rightRef.Base;\n }\n }\n return NormalCompletion(rightValue.call(thisValue, leftValue));\n }\n // https://tc39.es/ecma262/#sec-additive-operators\n var result = ApplyStringOrNumericBinaryOperator(leftValue, node.operator, rightValue);\n return NormalCompletion(result);\n }\n case \"CallExpression\":\n {\n // https://tc39.es/ecma262/#sec-function-calls\n var ref = Evaluate(node.callee, optionalChainRef).Value;\n var func = GetValue(ref);\n if ((func === undefined || func === null) && (node.optional || optionalChainRef !== null && optionalChainRef !== void 0 && optionalChainRef.skipped)) {\n optionalChainRef.skipped = true;\n return NormalCompletion(undefined);\n }\n sanitize(func);\n return EvaluateCall(func, ref, node.arguments, node.callee);\n }\n case \"ChainExpression\":\n // https://tc39.es/ecma262/#sec-optional-chains\n return Evaluate(node.expression, {});\n case \"ConditionalExpression\":\n // https://tc39.es/ecma262/#sec-conditional-operator\n return NormalCompletion(GetValue(Evaluate(GetValue(Evaluate(node.test)) ? node.consequent : node.alternate)));\n case \"Identifier\":\n // https://tc39.es/ecma262/#sec-identifiers\n return NormalCompletion(ResolveBinding(node.name));\n case \"Literal\":\n {\n // https://tc39.es/ecma262/#sec-primary-expression-literals\n if (node.regex) {\n if (node.value === null) {\n // Invalid regular expression fails silently in @babel/parser.\n throw new SyntaxError(\"Invalid regular expression: \".concat(node.raw));\n }\n if (node.regex.flags.includes(\"u\")) {\n // Currently unicode flag is not fully supported across major browsers.\n throw new SyntaxError(\"Unsupported unicode flag in regular expression: \".concat(node.raw));\n }\n }\n return NormalCompletion(node.value);\n }\n case \"LogicalExpression\":\n {\n // https://tc39.es/ecma262/#sec-binary-logical-operators\n var _leftValue = GetValue(Evaluate(node.left));\n switch (node.operator) {\n case \"&&\":\n return NormalCompletion(_leftValue && GetValue(Evaluate(node.right)));\n case \"||\":\n return NormalCompletion(_leftValue || GetValue(Evaluate(node.right)));\n case \"??\":\n return NormalCompletion(_leftValue !== null && _leftValue !== void 0 ? _leftValue : GetValue(Evaluate(node.right)));\n // istanbul ignore next\n default:\n throw new SyntaxError( // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore never reach here.\n \"Unsupported logical operator '\".concat(node.operator, \"'\"));\n }\n }\n case \"MemberExpression\":\n {\n // https://tc39.es/ecma262/#sec-property-accessors\n var baseReference = Evaluate(node.object, optionalChainRef).Value;\n var baseValue = GetValue(baseReference);\n if ((baseValue === undefined || baseValue === null) && (node.optional || optionalChainRef !== null && optionalChainRef !== void 0 && optionalChainRef.skipped)) {\n optionalChainRef.skipped = true;\n return NormalCompletion(undefined);\n }\n sanitize(baseValue);\n var _result = node.computed ? EvaluatePropertyAccessWithExpressionKey(baseValue, node.property, true) : EvaluatePropertyAccessWithIdentifierKey(baseValue, node.property, true);\n sanitize(_result);\n return NormalCompletion(_result);\n }\n case \"NewExpression\":\n // https://tc39.es/ecma262/#sec-new-operator\n return EvaluateNew(node.callee, node.arguments);\n case \"ObjectExpression\":\n {\n // https://tc39.es/ecma262/#sec-object-initializer\n var object = {};\n for (var prop of node.properties) {\n if (prop.type === \"SpreadElement\") {\n var fromValue = GetValue(Evaluate(prop.argument));\n CopyDataProperties(object, fromValue, new Set());\n } else {\n if (prop.kind !== \"init\") {\n throw new SyntaxError(\"Unsupported object getter/setter\");\n }\n var propName = !prop.computed && prop.key.type === \"Identifier\" ? prop.key.name : EvaluateComputedPropertyName(prop.key);\n if (propName === \"__proto__\") {\n throw new TypeError(\"Setting '__proto__' property is not allowed\");\n }\n object[propName] = GetValue(Evaluate(prop.value));\n }\n }\n return NormalCompletion(object);\n }\n case \"SequenceExpression\":\n {\n // https://tc39.es/ecma262/#sec-comma-operator\n var _result2;\n for (var expr of node.expressions) {\n _result2 = NormalCompletion(GetValue(Evaluate(expr)));\n }\n return _result2;\n }\n case \"TemplateLiteral\":\n {\n // https://tc39.es/ecma262/#sec-template-literals\n var chunks = [node.quasis[0].value.cooked];\n var index = 0;\n for (var _expr of node.expressions) {\n var val = GetValue(Evaluate(_expr));\n chunks.push(String(val));\n chunks.push(node.quasis[index += 1].value.cooked);\n }\n return NormalCompletion(chunks.join(\"\"));\n }\n case \"TaggedTemplateExpression\":\n {\n // https://tc39.es/ecma262/#sec-tagged-templates\n var tagRef = Evaluate(node.tag).Value;\n var tagFunc = GetValue(tagRef);\n sanitize(tagFunc);\n return EvaluateCall(tagFunc, tagRef, node.quasi, node.tag);\n }\n case \"UnaryExpression\":\n {\n // https://tc39.es/ecma262/#sec-unary-operators\n var _ref = Evaluate(node.argument).Value;\n if (!expressionOnly && node.operator === \"delete\") {\n // Delete operator is supported only in function mode.\n if (!(_ref instanceof ReferenceRecord)) {\n return NormalCompletion(true);\n }\n // istanbul ignore else\n if (IsPropertyReference(_ref)) {\n var deleteStatus = delete _ref.Base[_ref.ReferenceName];\n return NormalCompletion(deleteStatus);\n }\n // Should never reach here in strict mode.\n }\n\n if (node.operator === \"typeof\") {\n if (_ref instanceof ReferenceRecord && _ref.Base === \"unresolvable\") {\n return NormalCompletion(\"undefined\");\n }\n return NormalCompletion(typeof GetValue(_ref));\n }\n return NormalCompletion(ApplyUnaryOperator(GetValue(_ref), node.operator));\n }\n }\n if (!expressionOnly) {\n // Statements and assignments:\n switch (node.type) {\n case \"AssignmentExpression\":\n {\n // https://tc39.es/ecma262/#sec-assignment-operators\n if (node.operator === \"=\") {\n if (!(node.left.type === \"ArrayPattern\" || node.left.type === \"ObjectPattern\")) {\n var _lref = Evaluate(node.left).Value;\n // Todo: IsAnonymousFunctionDefinition(lref)\n var _rref2 = Evaluate(node.right);\n var _rval2 = GetValue(_rref2);\n PutValue(_lref, _rval2);\n return NormalCompletion(_rval2);\n }\n var _rref = Evaluate(node.right);\n var _rval = GetValue(_rref);\n DestructuringAssignmentEvaluation(node.left, _rval);\n return NormalCompletion(_rval);\n }\n // Operators other than `=`.\n var lref = Evaluate(node.left).Value;\n var lval = GetValue(lref);\n var rref = Evaluate(node.right);\n var rval = GetValue(rref);\n var r = ApplyStringOrNumericAssignment(lval, node.operator, rval);\n PutValue(lref, r);\n return NormalCompletion(r);\n }\n case \"BlockStatement\":\n {\n // https://tc39.es/ecma262/#sec-block\n if (!node.body.length) {\n return NormalCompletion(Empty);\n }\n var oldEnv = getRunningContext().LexicalEnvironment;\n var blockEnv = new DeclarativeEnvironment(oldEnv);\n BlockDeclarationInstantiation(node.body, blockEnv);\n getRunningContext().LexicalEnvironment = blockEnv;\n var blockValue = EvaluateStatementList(node.body);\n getRunningContext().LexicalEnvironment = oldEnv;\n return blockValue;\n }\n case \"BreakStatement\":\n // https://tc39.es/ecma262/#sec-break-statement\n return new CompletionRecord(\"break\", Empty);\n case \"ContinueStatement\":\n // https://tc39.es/ecma262/#sec-continue-statement\n return new CompletionRecord(\"continue\", Empty);\n case \"EmptyStatement\":\n // https://tc39.es/ecma262/#sec-empty-statement\n return NormalCompletion(Empty);\n case \"DoWhileStatement\":\n // https://tc39.es/ecma262/#sec-do-while-statement\n return EvaluateBreakableStatement(DoWhileLoopEvaluation(node));\n case \"ExpressionStatement\":\n case \"TSAsExpression\":\n // https://tc39.es/ecma262/#sec-expression-statement\n return Evaluate(node.expression);\n case \"ForInStatement\":\n case \"ForOfStatement\":\n // https://tc39.es/ecma262/#sec-for-in-and-for-of-statements\n return EvaluateBreakableStatement(ForInOfLoopEvaluation(node));\n case \"ForStatement\":\n // https://tc39.es/ecma262/#sec-for-statement\n return EvaluateBreakableStatement(ForLoopEvaluation(node));\n case \"FunctionDeclaration\":\n // https://tc39.es/ecma262/#sec-function-definitions\n return NormalCompletion(Empty);\n case \"FunctionExpression\":\n // https://tc39.es/ecma262/#sec-function-defining-expressions\n ThrowIfFunctionIsInvalid(node);\n return NormalCompletion(InstantiateOrdinaryFunctionExpression(node));\n case \"IfStatement\":\n // https://tc39.es/ecma262/#sec-if-statement\n return GetValue(Evaluate(node.test)) ? ((_hooks$beforeBranch = hooks.beforeBranch) !== null && _hooks$beforeBranch !== void 0 && _hooks$beforeBranch.call(hooks, node, \"if\"), UpdateEmpty(Evaluate(node.consequent), undefined)) : ((_hooks$beforeBranch2 = hooks.beforeBranch) !== null && _hooks$beforeBranch2 !== void 0 && _hooks$beforeBranch2.call(hooks, node, \"else\"), node.alternate) ? UpdateEmpty(Evaluate(node.alternate), undefined) : NormalCompletion(undefined);\n case \"ReturnStatement\":\n {\n // https://tc39.es/ecma262/#sec-return-statement\n var v;\n if (node.argument) {\n var exprRef = Evaluate(node.argument);\n v = GetValue(exprRef);\n }\n return new CompletionRecord(\"return\", v);\n }\n case \"ThrowStatement\":\n // https://tc39.es/ecma262/#sec-throw-statement\n throw GetValue(Evaluate(node.argument));\n case \"UpdateExpression\":\n {\n // https://tc39.es/ecma262/#sec-update-expressions\n var lhs = Evaluate(node.argument).Value;\n var oldValue = Number(GetValue(lhs));\n var newValue = node.operator === \"++\" ? oldValue + 1 : oldValue - 1;\n PutValue(lhs, newValue);\n return NormalCompletion(node.prefix ? newValue : oldValue);\n }\n case \"SwitchCase\":\n return EvaluateStatementList(node.consequent);\n case \"SwitchStatement\":\n {\n // https://tc39.es/ecma262/#sec-switch-statement\n var _exprRef = Evaluate(node.discriminant);\n var switchValue = GetValue(_exprRef);\n var _oldEnv = getRunningContext().LexicalEnvironment;\n var _blockEnv = new DeclarativeEnvironment(_oldEnv);\n BlockDeclarationInstantiation(node.cases, _blockEnv);\n getRunningContext().LexicalEnvironment = _blockEnv;\n var R = CaseBlockEvaluation(node.cases, switchValue);\n getRunningContext().LexicalEnvironment = _oldEnv;\n return EvaluateBreakableStatement(R);\n }\n case \"TryStatement\":\n {\n // https://tc39.es/ecma262/#sec-try-statement\n var _R;\n try {\n _R = Evaluate(node.block);\n } catch (error) {\n if (node.handler) {\n var _hooks$beforeEvaluate2;\n (_hooks$beforeEvaluate2 = hooks.beforeEvaluate) === null || _hooks$beforeEvaluate2 === void 0 ? void 0 : _hooks$beforeEvaluate2.call(hooks, node.handler);\n _R = CatchClauseEvaluation(node.handler, error);\n } else {\n throw error;\n }\n } finally {\n if (node.finalizer) {\n var F = Evaluate(node.finalizer);\n if (F.Type !== \"normal\") {\n _R = F;\n }\n }\n }\n return _R;\n }\n case \"VariableDeclaration\":\n {\n // https://tc39.es/ecma262/#sec-declarations-and-the-variable-statement\n var _result3;\n for (var declarator of node.declarations) {\n if (!declarator.init) {\n // Assert: a declarator without init is always an identifier.\n if (node.kind === \"var\") {\n _result3 = NormalCompletion(Empty);\n } else {\n var _lhs = ResolveBinding(declarator.id.name);\n _result3 = InitializeReferencedBinding(_lhs, undefined);\n }\n } else if (declarator.id.type === \"Identifier\") {\n var bindingId = declarator.id.name;\n var _lhs2 = ResolveBinding(bindingId);\n // Todo: IsAnonymousFunctionDefinition(Initializer)\n var rhs = Evaluate(declarator.init);\n var _value = GetValue(rhs);\n _result3 = node.kind === \"var\" ? PutValue(_lhs2, _value) : InitializeReferencedBinding(_lhs2, _value);\n } else {\n var _rhs = Evaluate(declarator.init);\n var _rval3 = GetValue(_rhs);\n _result3 = BindingInitialization(declarator.id, _rval3, node.kind === \"var\" ? undefined : getRunningContext().LexicalEnvironment);\n }\n }\n return _result3;\n }\n case \"WhileStatement\":\n // https://tc39.es/ecma262/#sec-while-statement\n return EvaluateBreakableStatement(WhileLoopEvaluation(node));\n }\n }\n // eslint-disable-next-line no-console\n throw new SyntaxError(\"Unsupported node type `\".concat(node.type, \"`\"));\n }\n\n // https://tc39.es/ecma262/#sec-execution-contexts\n function getRunningContext() {\n return executionContextStack[executionContextStack.length - 1];\n }\n\n // https://tc39.es/ecma262/#sec-resolvebinding\n function ResolveBinding(name, env) {\n if (!env) {\n env = getRunningContext().LexicalEnvironment;\n }\n return GetIdentifierReference(env, name, true);\n }\n\n // Try statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-catchclauseevaluation\n function CatchClauseEvaluation(node, thrownValue) {\n var oldEnv = getRunningContext().LexicalEnvironment;\n var catchEnv = new DeclarativeEnvironment(oldEnv);\n for (var argName of collectBoundNames(node.param)) {\n catchEnv.CreateMutableBinding(argName, false);\n }\n getRunningContext().LexicalEnvironment = catchEnv;\n BindingInitialization(node.param, thrownValue, catchEnv);\n var B = Evaluate(node.body);\n getRunningContext().LexicalEnvironment = oldEnv;\n return B;\n }\n\n // Iteration statements and switch statements.\n // https://tc39.es/ecma262/#prod-BreakableStatement\n function EvaluateBreakableStatement(stmtResult) {\n return stmtResult.Type === \"break\" ? stmtResult.Value === Empty ? NormalCompletion(undefined) : NormalCompletion(stmtResult.Value) : stmtResult;\n }\n\n // Switch statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-caseblockevaluation\n function CaseBlockEvaluation(cases, input) {\n var V;\n var defaultCaseIndex = cases.findIndex(switchCase => !switchCase.test);\n var hasDefaultCase = defaultCaseIndex >= 0;\n var A = hasDefaultCase ? cases.slice(0, defaultCaseIndex) : cases;\n var found = false;\n for (var C of A) {\n if (!found) {\n found = CaseClauseIsSelected(C, input);\n }\n if (found) {\n var _R2 = Evaluate(C);\n if (_R2.Value !== Empty) {\n V = _R2.Value;\n }\n if (_R2.Type !== \"normal\") {\n return UpdateEmpty(_R2, V);\n }\n }\n }\n if (!hasDefaultCase) {\n return NormalCompletion(V);\n }\n var foundInB = false;\n var B = cases.slice(defaultCaseIndex + 1);\n if (!found) {\n for (var _C of B) {\n if (!foundInB) {\n foundInB = CaseClauseIsSelected(_C, input);\n }\n if (foundInB) {\n var _R3 = Evaluate(_C);\n if (_R3.Value !== Empty) {\n V = _R3.Value;\n }\n if (_R3.Type !== \"normal\") {\n return UpdateEmpty(_R3, V);\n }\n }\n }\n }\n if (foundInB) {\n return NormalCompletion(V);\n }\n var R = Evaluate(cases[defaultCaseIndex]);\n if (R.Value !== Empty) {\n V = R.Value;\n }\n if (R.Type !== \"normal\") {\n return UpdateEmpty(R, V);\n }\n\n // NOTE: The following is another complete iteration of the second CaseClauses.\n for (var _C2 of B) {\n var _R4 = Evaluate(_C2);\n if (_R4.Value !== Empty) {\n V = _R4.Value;\n }\n if (_R4.Type !== \"normal\") {\n return UpdateEmpty(_R4, V);\n }\n }\n return NormalCompletion(V);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-caseclauseisselected\n function CaseClauseIsSelected(C, input) {\n var clauseSelector = GetValue(Evaluate(C.test));\n return input === clauseSelector;\n }\n\n // While statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-whileloopevaluation\n function WhileLoopEvaluation(node) {\n var V;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var exprValue = GetValue(Evaluate(node.test));\n if (!exprValue) {\n return NormalCompletion(V);\n }\n var stmtResult = Evaluate(node.body);\n if (!LoopContinues(stmtResult)) {\n return UpdateEmpty(stmtResult, V);\n }\n if (stmtResult.Value !== Empty) {\n V = stmtResult.Value;\n }\n }\n }\n\n // Do-while Statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-dowhileloopevaluation\n function DoWhileLoopEvaluation(node) {\n var V;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var stmtResult = Evaluate(node.body);\n if (!LoopContinues(stmtResult)) {\n return UpdateEmpty(stmtResult, V);\n }\n if (stmtResult.Value !== Empty) {\n V = stmtResult.Value;\n }\n var exprValue = GetValue(Evaluate(node.test));\n if (!exprValue) {\n return NormalCompletion(V);\n }\n }\n }\n\n // For in/of statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-forinofloopevaluation\n function ForInOfLoopEvaluation(node) {\n var lhs = node.left;\n var isVariableDeclaration = lhs.type === \"VariableDeclaration\";\n var lhsKind = isVariableDeclaration ? lhs.kind === \"var\" ? \"varBinding\" : \"lexicalBinding\" : \"assignment\";\n var uninitializedBoundNames = lhsKind === \"lexicalBinding\" ? collectBoundNames(lhs) : [];\n var iterationKind = node.type === \"ForInStatement\" ? \"enumerate\" : \"iterate\";\n var keyResult = ForInOfHeadEvaluation(uninitializedBoundNames, node.right, iterationKind);\n if (keyResult.Type !== \"normal\") {\n // When enumerate, if the target is nil, a break completion will be returned.\n return keyResult;\n }\n return ForInOfBodyEvaluation(lhs, node.body, keyResult.Value, iterationKind, lhsKind);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-forinofheadevaluation\n function ForInOfHeadEvaluation(uninitializedBoundNames, expr, iterationKind) {\n var runningContext = getRunningContext();\n var oldEnv = runningContext.LexicalEnvironment;\n if (uninitializedBoundNames.length > 0) {\n var newEnv = new DeclarativeEnvironment(oldEnv);\n for (var name of uninitializedBoundNames) {\n newEnv.CreateMutableBinding(name, false);\n }\n runningContext.LexicalEnvironment = newEnv;\n }\n var exprRef = Evaluate(expr);\n runningContext.LexicalEnvironment = oldEnv;\n var exprValue = GetValue(exprRef);\n if (iterationKind === \"enumerate\") {\n if (exprValue === null || exprValue === undefined) {\n return new CompletionRecord(\"break\", Empty);\n }\n var _iterator = EnumerateObjectProperties(exprValue);\n return NormalCompletion(_iterator);\n }\n var iterator = CreateListIteratorRecord(exprValue);\n return NormalCompletion(iterator);\n }\n function ForInOfBodyEvaluation(node, stmt, iteratorRecord, iterationKind, lhsKind) {\n var lhs = lhsKind === \"assignment\" ? node : node.declarations[0].id;\n var oldEnv = getRunningContext().LexicalEnvironment;\n var V;\n // When `destructuring` is false,\n // For `node` whose `kind` is assignment:\n // `lhs` is an `Identifier` or a `MemberExpression`,\n // Otherwise:\n // `lhs` is an `Identifier`.\n var destructuring = lhs.type === \"ObjectPattern\" || lhs.type === \"ArrayPattern\";\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var {\n done,\n value: nextValue\n } = iteratorRecord.next();\n if (done) {\n return NormalCompletion(V);\n }\n var lhsRef = void 0;\n var iterationEnv = void 0;\n if (lhsKind === \"lexicalBinding\") {\n iterationEnv = new DeclarativeEnvironment(oldEnv);\n ForDeclarationBindingInstantiation(node, iterationEnv);\n getRunningContext().LexicalEnvironment = iterationEnv;\n if (!destructuring) {\n var [lhsName] = collectBoundNames(lhs);\n lhsRef = ResolveBinding(lhsName);\n }\n } else if (!destructuring) {\n lhsRef = Evaluate(lhs).Value;\n }\n destructuring ? lhsKind === \"assignment\" ? DestructuringAssignmentEvaluation(lhs, nextValue) : lhsKind === \"varBinding\" ? BindingInitialization(lhs, nextValue, undefined) : BindingInitialization(lhs, nextValue, iterationEnv) : lhsKind === \"lexicalBinding\" ? InitializeReferencedBinding(lhsRef, nextValue) : PutValue(lhsRef, nextValue);\n var result = Evaluate(stmt);\n getRunningContext().LexicalEnvironment = oldEnv;\n if (!LoopContinues(result)) {\n var status = UpdateEmpty(result, V);\n if (!(iterationKind === \"enumerate\" || iteratorRecord.return === undefined)) {\n // Perform *IteratorClose*\n // https://tc39.es/ecma262/#sec-iteratorclose\n var innerResult = iteratorRecord.return();\n if (!innerResult || ![\"object\", \"function\"].includes(typeof innerResult)) {\n throw new TypeError(\"Iterator result is not an object\");\n }\n }\n return status;\n }\n if (result.Value !== Empty) {\n V = result.Value;\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-enumerate-object-properties\n function* EnumerateObjectProperties(value) {\n for (var _key in value) {\n yield _key;\n }\n }\n\n // For statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-forloopevaluation\n function ForLoopEvaluation(node) {\n var _node$init;\n if (((_node$init = node.init) === null || _node$init === void 0 ? void 0 : _node$init.type) === \"VariableDeclaration\") {\n // `for (var … ; … ; … ) …`\n if (node.init.kind === \"var\") {\n Evaluate(node.init);\n return ForBodyEvaluation(node.test, node.update, node.body, []);\n }\n // `for (let/const … ; … ; … ) …`\n var oldEnv = getRunningContext().LexicalEnvironment;\n var loopEnv = new DeclarativeEnvironment(oldEnv);\n var isConst = node.init.kind === \"const\";\n var boundNames = collectBoundNames(node.init);\n for (var dn of boundNames) {\n if (isConst) {\n loopEnv.CreateImmutableBinding(dn, true);\n } else {\n loopEnv.CreateMutableBinding(dn, false);\n }\n }\n getRunningContext().LexicalEnvironment = loopEnv;\n Evaluate(node.init);\n var perIterationLets = isConst ? [] : Array.from(boundNames);\n var bodyResult = ForBodyEvaluation(node.test, node.update, node.body, perIterationLets);\n getRunningContext().LexicalEnvironment = oldEnv;\n return bodyResult;\n }\n // `for ( … ; … ; … ) …`\n if (node.init) {\n var exprRef = Evaluate(node.init);\n GetValue(exprRef);\n }\n return ForBodyEvaluation(node.test, node.update, node.body, []);\n }\n\n // https://tc39.es/ecma262/#sec-forbodyevaluation\n function ForBodyEvaluation(test, increment, stmt, perIterationBindings) {\n CreatePerIterationEnvironment(perIterationBindings);\n var V;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (test) {\n var testRef = Evaluate(test);\n var testValue = GetValue(testRef);\n if (!testValue) {\n return NormalCompletion(V);\n }\n }\n var result = Evaluate(stmt);\n if (!LoopContinues(result)) {\n return UpdateEmpty(result, V);\n }\n if (result.Value) {\n V = result.Value;\n }\n CreatePerIterationEnvironment(perIterationBindings);\n if (increment) {\n var incRef = Evaluate(increment);\n GetValue(incRef);\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-createperiterationenvironment\n function CreatePerIterationEnvironment(perIterationBindings) {\n if (perIterationBindings.length === 0) {\n return;\n }\n var lastIterationEnv = getRunningContext().LexicalEnvironment;\n var outer = lastIterationEnv.OuterEnv;\n var thisIterationEnv = new DeclarativeEnvironment(outer);\n for (var bn of perIterationBindings) {\n thisIterationEnv.CreateMutableBinding(bn, false);\n var lastValue = lastIterationEnv.GetBindingValue(bn, false);\n thisIterationEnv.InitializeBinding(bn, lastValue);\n }\n getRunningContext().LexicalEnvironment = thisIterationEnv;\n }\n\n // Destructuring assignments.\n // https://tc39.es/ecma262/#sec-runtime-semantics-destructuringassignmentevaluation\n function DestructuringAssignmentEvaluation(pattern, value) {\n if (pattern.type === \"ObjectPattern\") {\n RequireObjectCoercible(value);\n if (pattern.properties.length > 0) {\n PropertyDestructuringAssignmentEvaluation(pattern.properties, value);\n }\n return NormalCompletion(Empty);\n }\n var iteratorRecord = CreateListIteratorRecord(value);\n return IteratorDestructuringAssignmentEvaluation(pattern.elements, iteratorRecord);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-propertydestructuringassignmentevaluation\n function PropertyDestructuringAssignmentEvaluation(properties, value) {\n var excludedNames = new Set();\n for (var prop of properties) {\n if (prop.type === \"Property\") {\n var propName = !prop.computed && prop.key.type === \"Identifier\" ? prop.key.name : EvaluateComputedPropertyName(prop.key);\n var valueTarget = prop.value.type === \"AssignmentPattern\" ? prop.value.left : prop.value;\n if (valueTarget.type === \"Identifier\") {\n var lref = ResolveBinding(valueTarget.name);\n var v = GetV(value, propName);\n if (prop.value.type === \"AssignmentPattern\" && v === undefined) {\n // Todo(steve): check IsAnonymousFunctionDefinition(Initializer)\n var defaultValue = Evaluate(prop.value.right);\n v = GetValue(defaultValue);\n }\n PutValue(lref, v);\n excludedNames.add(propName);\n } else {\n KeyedDestructuringAssignmentEvaluation(prop.value, value, propName);\n excludedNames.add(propName);\n }\n } else {\n RestDestructuringAssignmentEvaluation(prop, value, excludedNames);\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-keyeddestructuringassignmentevaluation\n function KeyedDestructuringAssignmentEvaluation(node, value, propertyName) {\n var assignmentTarget = node.type === \"AssignmentPattern\" ? node.left : node;\n var isObjectOrArray = assignmentTarget.type === \"ArrayPattern\" || assignmentTarget.type === \"ObjectPattern\";\n var lref;\n if (!isObjectOrArray) {\n lref = Evaluate(assignmentTarget).Value;\n }\n var v = GetV(value, propertyName);\n var rhsValue;\n if (node.type === \"AssignmentPattern\" && v === undefined) {\n // Todo(steve): check IsAnonymousFunctionDefinition(Initializer)\n var defaultValue = Evaluate(node.right);\n rhsValue = GetValue(defaultValue);\n } else {\n rhsValue = v;\n }\n if (isObjectOrArray) {\n return DestructuringAssignmentEvaluation(assignmentTarget, rhsValue);\n }\n return PutValue(lref, rhsValue);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-restdestructuringassignmentevaluation\n function RestDestructuringAssignmentEvaluation(restProperty, value, excludedNames) {\n var lref = Evaluate(restProperty.argument).Value;\n var restObj = CopyDataProperties({}, value, excludedNames);\n return PutValue(lref, restObj);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-iteratordestructuringassignmentevaluation\n function IteratorDestructuringAssignmentEvaluation(elements, iteratorRecord) {\n var status = NormalCompletion(Empty);\n for (var element of elements) {\n if (!element) {\n iteratorRecord.next();\n status = NormalCompletion(Empty);\n continue;\n }\n var assignmentTarget = element.type === \"RestElement\" ? element.argument : element.type === \"AssignmentPattern\" ? element.left : element;\n var isObjectOrArray = assignmentTarget.type === \"ArrayPattern\" || assignmentTarget.type === \"ObjectPattern\";\n var lref = void 0;\n if (!isObjectOrArray) {\n lref = Evaluate(assignmentTarget).Value;\n }\n var v = void 0;\n if (element.type !== \"RestElement\") {\n var {\n done,\n value: nextValue\n } = iteratorRecord.next();\n var _value2 = done ? undefined : nextValue;\n if (element.type === \"AssignmentPattern\" && _value2 === undefined) {\n // Todo(steve): check IsAnonymousFunctionDefinition(Initializer)\n var defaultValue = Evaluate(element.right);\n v = GetValue(defaultValue);\n } else {\n v = _value2;\n }\n } else {\n // RestElement\n v = [];\n var n = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var {\n done: _done,\n value: _nextValue\n } = iteratorRecord.next();\n if (_done) {\n break;\n }\n v[n] = _nextValue;\n n++;\n }\n }\n if (isObjectOrArray) {\n status = DestructuringAssignmentEvaluation(assignmentTarget, v);\n } else {\n status = PutValue(lref, v);\n }\n }\n return status;\n }\n\n // Object expressions.\n // https://tc39.es/ecma262/#sec-evaluate-property-access-with-expression-key\n function EvaluatePropertyAccessWithExpressionKey(baseValue, expression, strict) {\n var propertyNameReference = Evaluate(expression);\n var propertyNameValue = GetValue(propertyNameReference);\n var propertyKey = ToPropertyKey(propertyNameValue);\n return new ReferenceRecord(baseValue, propertyKey, strict);\n }\n\n // https://tc39.es/ecma262/#sec-evaluate-property-access-with-identifier-key\n function EvaluatePropertyAccessWithIdentifierKey(baseValue, identifier, strict) {\n var propertyNameString = identifier.name;\n return new ReferenceRecord(baseValue, propertyNameString, strict);\n }\n\n // Block statements.\n // https://tc39.es/ecma262/#sec-blockdeclarationinstantiation\n function BlockDeclarationInstantiation(code, env) {\n var declarations = collectScopedDeclarations(code, {\n var: false,\n topLevel: false\n });\n for (var d of declarations) {\n var IsConstantDeclaration = d.type === \"VariableDeclaration\" && d.kind === \"const\";\n for (var dn of collectBoundNames(d)) {\n if (IsConstantDeclaration) {\n env.CreateImmutableBinding(dn, true);\n } else {\n env.CreateMutableBinding(dn, false);\n }\n }\n if (d.type === \"FunctionDeclaration\") {\n var [_fn] = collectBoundNames(d);\n var _fo = InstantiateFunctionObject(d, env);\n env.InitializeBinding(_fn, _fo);\n }\n }\n }\n\n // Function declarations and expressions.\n // https://tc39.es/ecma262/#sec-evaluatecall\n function EvaluateCall(func, ref, args, callee) {\n var thisValue;\n if (ref instanceof ReferenceRecord) {\n if (IsPropertyReference(ref)) {\n thisValue = ref.Base;\n }\n }\n var argList = ArgumentListEvaluation(args);\n if (typeof func !== \"function\") {\n var funcName = codeSource.substring(callee.start, callee.end);\n throw new TypeError(\"\".concat(funcName, \" is not a function\"));\n }\n var result = func.apply(thisValue, argList);\n sanitize(result);\n return NormalCompletion(result);\n }\n\n // https://tc39.es/ecma262/#sec-evaluatenew\n function EvaluateNew(constructExpr, args) {\n var ref = Evaluate(constructExpr);\n var constructor = GetValue(ref);\n var argList = ArgumentListEvaluation(args);\n if (typeof constructor !== \"function\" || constructor[IsConstructor] === false) {\n var constructorName = codeSource.substring(constructExpr.start, constructExpr.end);\n throw new TypeError(\"\".concat(constructorName, \" is not a constructor\"));\n }\n if (!isAllowedConstructor(constructor)) {\n var _constructorName = codeSource.substring(constructExpr.start, constructExpr.end);\n throw new TypeError(\"\".concat(_constructorName, \" is not an allowed constructor\"));\n }\n return NormalCompletion(new constructor(...argList));\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-argumentlistevaluation\n function ArgumentListEvaluation(args) {\n var array = [];\n if (Array.isArray(args)) {\n for (var arg of args) {\n if (arg.type === \"SpreadElement\") {\n var spreadValues = GetValue(Evaluate(arg.argument));\n array.push(...spreadValues);\n } else {\n array.push(GetValue(Evaluate(arg)));\n }\n }\n } else {\n array.push(GetTemplateObject(args));\n for (var expr of args.expressions) {\n array.push(GetValue(Evaluate(expr)));\n }\n }\n return array;\n }\n\n // https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n function CallFunction(closure, args) {\n var _hooks$beforeCall;\n (_hooks$beforeCall = hooks.beforeCall) === null || _hooks$beforeCall === void 0 ? void 0 : _hooks$beforeCall.call(hooks, closure[SourceNode]);\n PrepareForOrdinaryCall(closure);\n var result = OrdinaryCallEvaluateBody(closure, args);\n executionContextStack.pop();\n if (result.Type === \"return\") {\n return result.Value;\n }\n return undefined;\n }\n\n // https://tc39.es/ecma262/#sec-prepareforordinarycall\n function PrepareForOrdinaryCall(F) {\n var calleeContext = new ExecutionContext();\n calleeContext.Function = F;\n var localEnv = new FunctionEnvironment(F[Environment]);\n calleeContext.VariableEnvironment = localEnv;\n calleeContext.LexicalEnvironment = localEnv;\n executionContextStack.push(calleeContext);\n return calleeContext;\n }\n\n // https://tc39.es/ecma262/#sec-ordinarycallevaluatebody\n function OrdinaryCallEvaluateBody(F, args) {\n return EvaluateFunctionBody(F[ECMAScriptCode], F, args);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-evaluatefunctionbody\n function EvaluateFunctionBody(body, F, args) {\n FunctionDeclarationInstantiation(F, args);\n if (Array.isArray(body)) {\n return EvaluateStatementList(body);\n }\n return new CompletionRecord(\"return\", GetValue(Evaluate(body)));\n }\n\n // https://tc39.es/ecma262/#sec-block-runtime-semantics-evaluation\n function EvaluateStatementList(statements) {\n var result = NormalCompletion(Empty);\n for (var stmt of statements) {\n var s = Evaluate(stmt);\n if (s.Type !== \"normal\") {\n return s;\n }\n result = UpdateEmpty(result, s.Value);\n }\n return result;\n }\n\n // https://tc39.es/ecma262/#sec-functiondeclarationinstantiation\n function FunctionDeclarationInstantiation(func, args) {\n var calleeContext = getRunningContext();\n var code = func[ECMAScriptCode];\n var formals = func[FormalParameters];\n var parameterNames = collectBoundNames(formals);\n var hasParameterExpressions = containsExpression(formals);\n var varDeclarations = collectScopedDeclarations(code, {\n var: true,\n topLevel: true\n });\n var varNames = collectBoundNames(varDeclarations);\n\n // `functionNames` ∈ `varNames`\n // `functionsToInitialize` ≈ `functionNames`\n var functionNames = [];\n var functionsToInitialize = [];\n for (var i = varDeclarations.length - 1; i >= 0; i--) {\n var d = varDeclarations[i];\n if (d.type === \"FunctionDeclaration\") {\n ThrowIfFunctionIsInvalid(d);\n var [_fn2] = collectBoundNames(d);\n if (!functionNames.includes(_fn2)) {\n functionNames.unshift(_fn2);\n functionsToInitialize.unshift(d);\n }\n } else if (rules !== null && rules !== void 0 && rules.noVar) {\n throw new SyntaxError(\"Var declaration is not recommended, use `let` or `const` instead\");\n }\n }\n var env = calleeContext.LexicalEnvironment;\n for (var paramName of parameterNames) {\n // In strict mode, it's guaranteed no duplicate params exist.\n env.CreateMutableBinding(paramName, false);\n }\n var iteratorRecord = CreateListIteratorRecord(args);\n IteratorBindingInitialization(formals, iteratorRecord, env);\n var varEnv;\n if (!hasParameterExpressions) {\n // NOTE: Only a single Environment Record is needed for the parameters\n // and top-level vars.\n // `varNames` are unique.\n for (var n of varNames) {\n if (!parameterNames.includes(n)) {\n env.CreateMutableBinding(n, false);\n env.InitializeBinding(n, undefined);\n }\n }\n varEnv = env;\n } else {\n // NOTE: A separate Environment Record is needed to ensure that closures\n // created by expressions in the formal parameter list do not have\n // visibility of declarations in the function body.\n varEnv = new DeclarativeEnvironment(env);\n calleeContext.VariableEnvironment = varEnv;\n // `varNames` are unique.\n for (var _n of varNames) {\n varEnv.CreateMutableBinding(_n, false);\n var initialValue = void 0;\n if (parameterNames.includes(_n) && !functionNames.includes(_n)) {\n initialValue = env.GetBindingValue(_n, false);\n }\n varEnv.InitializeBinding(_n, initialValue);\n // NOTE: A var with the same name as a formal parameter initially has\n // the same value as the corresponding initialized parameter.\n }\n }\n\n var lexEnv = varEnv;\n calleeContext.LexicalEnvironment = lexEnv;\n var lexDeclarations = collectScopedDeclarations(code, {\n var: false,\n topLevel: true\n });\n for (var _d of lexDeclarations) {\n for (var dn of collectBoundNames(_d)) {\n // Only lexical VariableDeclaration here in top-level.\n if (_d.kind === \"const\") {\n lexEnv.CreateImmutableBinding(dn, true);\n } else {\n lexEnv.CreateMutableBinding(dn, false);\n }\n }\n }\n for (var f of functionsToInitialize) {\n var [_fn3] = collectBoundNames(f);\n var _fo2 = InstantiateFunctionObject(f, lexEnv);\n varEnv.SetMutableBinding(_fn3, _fo2, false);\n }\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-instantiatefunctionobject\n function InstantiateFunctionObject(func, scope) {\n return OrdinaryFunctionCreate(func, scope, true);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-instantiateordinaryfunctionexpression\n function InstantiateOrdinaryFunctionExpression(functionExpression) {\n var scope = getRunningContext().LexicalEnvironment;\n if (functionExpression.id) {\n var name = functionExpression.id.name;\n var funcEnv = new DeclarativeEnvironment(scope);\n funcEnv.CreateImmutableBinding(name, false);\n var closure = OrdinaryFunctionCreate(functionExpression, funcEnv, true);\n funcEnv.InitializeBinding(name, closure);\n return closure;\n } else {\n var _closure = OrdinaryFunctionCreate(functionExpression, scope, true);\n return _closure;\n }\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-instantiatearrowfunctionexpression\n function InstantiateArrowFunctionExpression(arrowFunction) {\n var scope = getRunningContext().LexicalEnvironment;\n var closure = OrdinaryFunctionCreate(arrowFunction, scope, false);\n return closure;\n }\n\n // https://tc39.es/ecma262/#sec-ordinaryfunctioncreate\n function OrdinaryFunctionCreate(sourceNode, scope, isConstructor) {\n var F = function () {\n // eslint-disable-next-line prefer-rest-params\n return CallFunction(F, arguments);\n };\n Object.defineProperties(F, {\n [SourceNode]: {\n value: sourceNode\n },\n [FormalParameters]: {\n value: sourceNode.params\n },\n [ECMAScriptCode]: {\n value: sourceNode.body.type === \"BlockStatement\" ? sourceNode.body.body : sourceNode.body\n },\n [Environment]: {\n value: scope\n },\n [IsConstructor]: {\n value: isConstructor\n }\n });\n return F;\n }\n\n // Patterns initialization.\n // https://tc39.es/ecma262/#sec-runtime-semantics-bindinginitialization\n function BindingInitialization(node, value, environment) {\n switch (node.type) {\n case \"Identifier\":\n return InitializeBoundName(node.name, value, environment);\n case \"ObjectPattern\":\n RequireObjectCoercible(value);\n return PropertyBindingInitialization(node.properties, value, environment);\n case \"ArrayPattern\":\n {\n var iteratorRecord = CreateListIteratorRecord(value);\n return IteratorBindingInitialization(node.elements, iteratorRecord, environment);\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-propertybindinginitialization\n function PropertyBindingInitialization(properties, value, environment) {\n var excludedNames = new Set();\n for (var prop of properties) {\n if (prop.type === \"RestElement\") {\n return RestBindingInitialization(prop, value, environment, excludedNames);\n }\n if (!prop.computed && prop.key.type === \"Identifier\") {\n KeyedBindingInitialization(prop.value, value, environment, prop.key.name);\n excludedNames.add(prop.key.name);\n } else {\n var P = EvaluateComputedPropertyName(prop.key);\n KeyedBindingInitialization(prop.value, value, environment, P);\n excludedNames.add(P);\n }\n }\n return NormalCompletion(Empty);\n }\n\n // https://tc39.es/ecma262/#prod-ComputedPropertyName\n function EvaluateComputedPropertyName(node) {\n var propName = GetValue(Evaluate(node));\n return ToPropertyKey(propName);\n }\n\n // https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-restbindinginitialization\n function RestBindingInitialization(restProperty, value, environment, excludedNames) {\n var lhs = ResolveBinding(restProperty.argument.name, environment);\n var restObj = CopyDataProperties({}, value, excludedNames);\n if (!environment) {\n return PutValue(lhs, restObj);\n }\n return InitializeReferencedBinding(lhs, restObj);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-iteratorbindinginitialization\n function IteratorBindingInitialization(elements, iteratorRecord, environment) {\n if (elements.length === 0) {\n return NormalCompletion(Empty);\n }\n var result;\n for (var _node of elements) {\n if (!_node) {\n // Elision element.\n iteratorRecord.next();\n result = NormalCompletion(Empty);\n } else if (_node.type === \"RestElement\") {\n // Rest element.\n if (_node.argument.type === \"Identifier\") {\n var lhs = ResolveBinding(_node.argument.name, environment);\n var A = [];\n var n = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var {\n done,\n value: _value3\n } = iteratorRecord.next();\n if (done) {\n result = environment ? InitializeReferencedBinding(lhs, A) : PutValue(lhs, A);\n break;\n }\n A[n] = _value3;\n n++;\n }\n } else {\n var _A = [];\n var _n2 = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var {\n done: _done2,\n value: _value4\n } = iteratorRecord.next();\n if (_done2) {\n result = BindingInitialization(_node.argument, _A, environment);\n break;\n }\n _A[_n2] = _value4;\n _n2++;\n }\n }\n } else {\n // Normal element.\n var bindingElement = _node.type === \"AssignmentPattern\" ? _node.left : _node;\n switch (bindingElement.type) {\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n {\n var v = void 0;\n var {\n done: _done3,\n value: _value5\n } = iteratorRecord.next();\n if (!_done3) {\n v = _value5;\n }\n if (_node.type === \"AssignmentPattern\" && v === undefined) {\n var defaultValue = Evaluate(_node.right);\n v = GetValue(defaultValue);\n }\n result = BindingInitialization(bindingElement, v, environment);\n break;\n }\n case \"Identifier\":\n {\n var bindingId = bindingElement.name;\n var _lhs3 = ResolveBinding(bindingId, environment);\n var _v = void 0;\n var {\n done: _done4,\n value: _value6\n } = iteratorRecord.next();\n if (!_done4) {\n _v = _value6;\n }\n if (_node.type === \"AssignmentPattern\" && _v === undefined) {\n // IsAnonymousFunctionDefinition(Initializer)\n var _defaultValue = Evaluate(_node.right);\n _v = GetValue(_defaultValue);\n }\n result = environment ? InitializeReferencedBinding(_lhs3, _v) : PutValue(_lhs3, _v);\n break;\n }\n }\n }\n }\n return result;\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization\n function KeyedBindingInitialization(node, value, environment, propertyName) {\n var isIdentifier = node.type === \"Identifier\" || node.type === \"AssignmentPattern\" && node.left.type === \"Identifier\";\n if (isIdentifier) {\n var bindingId = node.type === \"Identifier\" ? node.name : node.left.name;\n var lhs = ResolveBinding(bindingId, environment);\n var _v2 = GetV(value, propertyName);\n if (node.type === \"AssignmentPattern\" && _v2 === undefined) {\n // If IsAnonymousFunctionDefinition(Initializer)\n var defaultValue = Evaluate(node.right);\n _v2 = GetValue(defaultValue);\n }\n if (!environment) {\n return PutValue(lhs, _v2);\n }\n return InitializeReferencedBinding(lhs, _v2);\n }\n var v = GetV(value, propertyName);\n if (node.type === \"AssignmentPattern\" && v === undefined) {\n var _defaultValue2 = Evaluate(node.right);\n v = GetValue(_defaultValue2);\n }\n return BindingInitialization(node.type === \"AssignmentPattern\" ? node.left : node, v, environment);\n }\n\n // https://tc39.es/ecma262/#sec-initializeboundname\n function InitializeBoundName(name, value, environment) {\n // Assert: environment is always present.\n environment.InitializeBinding(name, value);\n return NormalCompletion(Empty);\n }\n function ThrowIfFunctionIsInvalid(func) {\n if (func.async || func.generator) {\n throw new SyntaxError(\"\".concat(func.async ? \"Async\" : \"Generator\", \" function is not allowed\"));\n }\n if (expressionOnly && !func.expression) {\n throw new SyntaxError(\"Only an `Expression` is allowed in `ArrowFunctionExpression`'s body\");\n }\n }\n if (expressionOnly) {\n return GetValue(Evaluate(rootAst));\n }\n (_hooks$beforeEvaluate3 = hooks.beforeEvaluate) === null || _hooks$beforeEvaluate3 === void 0 ? void 0 : _hooks$beforeEvaluate3.call(hooks, rootAst);\n ThrowIfFunctionIsInvalid(rootAst);\n var [fn] = collectBoundNames(rootAst);\n // Create an immutable binding for the root function.\n rootEnv.CreateImmutableBinding(fn, true);\n var fo = InstantiateFunctionObject(rootAst, rootEnv);\n rootEnv.InitializeBinding(fn, fo);\n return fo;\n}\n//# sourceMappingURL=cook.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\n\nclass Position {\n constructor(line, col, index) {\n this.line = void 0;\n this.column = void 0;\n this.index = void 0;\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\nclass SourceLocation {\n constructor(start, end) {\n this.start = void 0;\n this.end = void 0;\n this.filename = void 0;\n this.identifierName = void 0;\n this.start = start;\n this.end = end;\n }\n}\n\nfunction createPositionWithColumnOffset(position, columnOffset) {\n const {\n line,\n column,\n index\n } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n\nvar ParseErrorCode = {\n SyntaxError: \"BABEL_PARSER_SYNTAX_ERROR\",\n SourceTypeModuleError: \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\"\n};\nconst reflect = (keys, last = keys.length - 1) => ({\n get() {\n return keys.reduce((object, key) =>\n object[key], this);\n },\n set(value) {\n keys.reduce(\n (item, key, i) => i === last ? item[key] = value : item[key], this);\n }\n});\nconst instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === \"function\" ? {\n value: descriptor,\n enumerable: false\n} : typeof descriptor.reflect === \"string\" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split(\".\"))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({\n configurable: true\n}, descriptor)), Object.assign(new constructor(), properties));\n\nvar ModuleErrors = {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError\n }\n};\n\nconst NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\"\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\"\n};\nconst toNodeDescription = ({\n type,\n prefix\n}) => type === \"UpdateExpression\" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type];\n\nvar StandardErrors = {\n AccessorIsGenerator: ({\n kind\n }) => `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass: \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext: \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier: \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock: \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter: \"'await' is not allowed in async function parameters.\",\n AwaitNotInAsyncContext: \"'await' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions.\",\n BadGetterArity: \"A 'get' accesor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accesor must have exactly one formal parameter.\",\n BadSetterRestParameter: \"A 'set' accesor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField: \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorArgumentsOutsideParentheses: \"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.\",\n DecoratorBeforeExport: \"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.\",\n DecoratorConstructor: \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass: \"Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport: \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({\n exportName\n }) => `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName\n }) => `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier: \"'from' is not allowed as an identifier after 'export default'.\",\n ForInOfLoopInitializer: ({\n type\n }) => `'${type === \"ForInStatement\" ? \"for-in\" : \"for-of\"}' loop variable declaration may not have an initializer.`,\n ForInUsing: \"For-in loop may not start with 'using' declaration.\",\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext: \"Generators can only be declared at the top level or inside a block.\",\n IllegalBreakContinue: ({\n type\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n IllegalLanguageModeDirective: \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportBindingIsString: ({\n importName\n }) => `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArgumentTrailingComma: \"Trailing comma is disallowed inside import(...) arguments.\",\n ImportCallArity: ({\n maxArgumentCount\n }) => `\\`import()\\` requires exactly ${maxArgumentCount === 1 ? \"one argument\" : \"one or two arguments\"}.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault: \"A JSON module can only be imported with `default`.\",\n ImportReflectionHasAssertion: \"`import module x` cannot have assertions.\",\n ImportReflectionNotBinding: 'Only `import module x from \"./module\"` is valid.',\n IncompatibleRegExpUVFlags: \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({\n radix\n }) => `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({\n reservedWord\n }) => `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({\n identifierName\n }) => `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({\n ancestor\n }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({\n ancestor\n }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent: \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({\n unexpected\n }) => `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty: \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({\n labelName\n }) => `Label '${labelName}' is already declared.`,\n LetInLexicalBinding: \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment: \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({\n missingPlugin\n }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(\", \")}.`,\n MissingOneOfPlugins: ({\n missingPlugin\n }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical: \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType: \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue: \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({\n key\n }) => `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode\n }) => `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(16)}'.`,\n ModuleExportUndefined: ({\n localName\n }) => `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence: \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar: \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew: \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate: \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor: \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({\n identifierName\n }) => `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({\n identifierName\n }) => `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType: \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType: \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType: \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction: \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed: \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType: \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType: \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType: \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody: 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport: \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({\n keyword\n }) => `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator: \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration: \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget: \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator: \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({\n reservedWord\n }) => `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected\n }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${expected ? `, expected \"${expected}\"` : \"\"}`,\n UnexpectedTokenUnaryExponentiation: \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnexpectedUsingDeclaration: \"Using declaration cannot appear in the top level when source type is `script`.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport: \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport: \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport: \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName\n }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator: \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator: \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper: \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n UsingDeclarationHasBindingPattern: \"Using declaration cannot have destructuring patterns.\",\n VarRedeclaration: ({\n identifierName\n }) => `Identifier '${identifierName}' has already been declared.`,\n YieldBindingIdentifier: \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n ZeroDigitNumericSeparator: \"Numeric separator can not be used after leading 0.\"\n};\n\nvar StrictModeErrors = {\n StrictDelete: \"Deleting local variable in strict mode.\",\n StrictEvalArguments: ({\n referenceName\n }) => `Assigning to '${referenceName}' in strict mode.`,\n StrictEvalArgumentsBinding: ({\n bindingName\n }) => `Binding '${bindingName}' in strict mode.`,\n StrictFunction: \"In strict mode code, functions can only be declared at top level or inside a block.\",\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n StrictWith: \"'with' in strict mode.\"\n};\n\nconst UnparenthesizedPipeBodyDescriptions = new Set([\"ArrowFunctionExpression\", \"AssignmentExpression\", \"ConditionalExpression\", \"YieldExpression\"]);\nvar PipelineOperatorErrors = {\n PipeBodyIsTighter: \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound: \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({\n token\n }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused: \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({\n type\n }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type\n })}; please wrap it in parentheses.`,\n PipelineBodyNoArrow: 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression: \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression: \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused: \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed: \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.'\n};\n\nconst _excluded$1 = [\"toMessage\"],\n _excluded2$1 = [\"message\"];\nfunction toParseErrorConstructor(_ref) {\n let {\n toMessage\n } = _ref,\n properties = _objectWithoutPropertiesLoose(_ref, _excluded$1);\n return function constructor({\n loc,\n details\n }) {\n return instantiate(SyntaxError, Object.assign({}, properties, {\n loc\n }), {\n clone(overrides = {}) {\n const loc = overrides.loc || {};\n return constructor({\n loc: new Position(\"line\" in loc ? loc.line : this.loc.line, \"column\" in loc ? loc.column : this.loc.column, \"index\" in loc ? loc.index : this.loc.index),\n details: Object.assign({}, this.details, overrides.details)\n });\n },\n details: {\n value: details,\n enumerable: false\n },\n message: {\n get() {\n return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`;\n },\n set(value) {\n Object.defineProperty(this, \"message\", {\n value\n });\n }\n },\n pos: {\n reflect: \"loc.index\",\n enumerable: true\n },\n missingPlugin: \"missingPlugin\" in details && {\n reflect: \"details.missingPlugin\",\n enumerable: true\n }\n });\n };\n}\nfunction ParseErrorEnum(argument, syntaxPlugin) {\n if (Array.isArray(argument)) {\n return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n const ParseErrorConstructors = {};\n for (const reasonCode of Object.keys(argument)) {\n const template = argument[reasonCode];\n const _ref2 = typeof template === \"string\" ? {\n message: () => template\n } : typeof template === \"function\" ? {\n message: template\n } : template,\n {\n message\n } = _ref2,\n rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1);\n const toMessage = typeof message === \"string\" ? () => message : message;\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({\n code: ParseErrorCode.SyntaxError,\n reasonCode,\n toMessage\n }, syntaxPlugin ? {\n syntaxPlugin\n } : {}, rest));\n }\n return ParseErrorConstructors;\n}\nconst Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));\n\nconst {\n defineProperty\n} = Object;\nconst toUnenumerable = (object, key) => defineProperty(object, key, {\n enumerable: false,\n value: object[key]\n});\nfunction toESTreeLocation(node) {\n node.loc.start && toUnenumerable(node.loc.start, \"index\");\n node.loc.end && toUnenumerable(node.loc.end, \"index\");\n return node;\n}\nvar estree = (superClass => class ESTreeParserMixin extends superClass {\n parse() {\n const file = toESTreeLocation(super.parse());\n if (this.options.tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n return file;\n }\n\n parseRegExpLiteral({\n pattern,\n flags\n }) {\n let regex = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n }\n\n const node = this.estreeParseLiteral(regex);\n node.regex = {\n pattern,\n flags\n };\n return node;\n }\n\n parseBigIntLiteral(value) {\n let bigInt;\n try {\n bigInt = BigInt(value);\n } catch (_unused) {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n return node;\n }\n\n parseDecimalLiteral(value) {\n const decimal = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n return node;\n }\n estreeParseLiteral(value) {\n return this.parseLiteral(value, \"Literal\");\n }\n\n parseStringLiteral(value) {\n return this.estreeParseLiteral(value);\n }\n parseNumericLiteral(value) {\n return this.estreeParseLiteral(value);\n }\n\n parseNullLiteral() {\n return this.estreeParseLiteral(null);\n }\n parseBooleanLiteral(value) {\n return this.estreeParseLiteral(value);\n }\n\n directiveToStmt(directive) {\n const expression = directive.value;\n delete directive.value;\n expression.type = \"Literal\";\n expression.raw = expression.extra.raw;\n expression.value = expression.extra.expressionValue;\n const stmt = directive;\n stmt.type = \"ExpressionStatement\";\n stmt.expression = expression;\n stmt.directive = expression.extra.rawValue;\n delete expression.extra;\n return stmt;\n }\n\n initFunction(node, isAsync) {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n checkDeclaration(node) {\n if (node != null && this.isObjectProperty(node)) {\n this.checkDeclaration(node.value);\n } else {\n super.checkDeclaration(node);\n }\n }\n getObjectOrClassMethodParams(method) {\n return method.value.params;\n }\n isValidDirective(stmt) {\n var _stmt$expression$extr;\n return stmt.type === \"ExpressionStatement\" && stmt.expression.type === \"Literal\" && typeof stmt.expression.value === \"string\" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);\n }\n parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {\n super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse);\n const directiveStatements = node.directives.map(d => this.directiveToStmt(d));\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, \"ClassMethod\", true);\n if (method.typeParameters) {\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n parsePrivateName() {\n const node = super.parsePrivateName();\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n convertPrivateNameToPrivateIdentifier(node) {\n const name = super.getPrivateNameSV(node);\n node = node;\n delete node.id;\n node.name = name;\n node.type = \"PrivateIdentifier\";\n return node;\n }\n isPrivateName(node) {\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n getPrivateNameSV(node) {\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node);\n }\n }\n return node.name;\n }\n\n parseLiteral(value, type) {\n const node = super.parseLiteral(value, type);\n node.raw = node.extra.raw;\n delete node.extra;\n return node;\n }\n parseFunctionBody(node, allowExpression, isMethod = false) {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {\n let funcNode = this.startNode();\n funcNode.kind = node.kind;\n funcNode = super.parseMethod(\n funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n return this.finishNode(\n node, \"MethodDefinition\");\n }\n parseClassProperty(...args) {\n const propertyNode = super.parseClassProperty(...args);\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n return propertyNode;\n }\n parseClassPrivateProperty(...args) {\n const propertyNode = super.parseClassPrivateProperty(...args);\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n return propertyNode;\n }\n parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {\n const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);\n if (node) {\n node.type = \"Property\";\n if (node.kind === \"method\") {\n node.kind = \"init\";\n }\n node.shorthand = false;\n }\n return node;\n }\n parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {\n const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n return node;\n }\n isValidLVal(type, isUnparenthesizedInAssign, binding) {\n return type === \"Property\" ? \"value\" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n isAssignable(node, isBinding) {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n toAssignable(node, isLHS = false) {\n if (node != null && this.isObjectProperty(node)) {\n const {\n key,\n value\n } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n toAssignableObjectExpressionProp(prop, isLast, isLHS) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(Errors.PatternHasAccessor, {\n at: prop.key\n });\n } else if (prop.method) {\n this.raise(Errors.PatternHasMethod, {\n at: prop.key\n });\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n finishCallExpression(unfinished, optional) {\n const node = super.finishCallExpression(unfinished, optional);\n if (node.callee.type === \"Import\") {\n node.type = \"ImportExpression\";\n node.source = node.arguments[0];\n if (this.hasPlugin(\"importAssertions\")) {\n var _node$arguments$;\n node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null;\n }\n delete node.arguments;\n delete node.callee;\n }\n return node;\n }\n toReferencedArguments(node\n ) {\n if (node.type === \"ImportExpression\") {\n return;\n }\n super.toReferencedArguments(node);\n }\n parseExport(unfinished, decorators) {\n const exportStartLoc = this.state.lastTokStartLoc;\n const node = super.parseExport(unfinished, decorators);\n switch (node.type) {\n case \"ExportAllDeclaration\":\n node.exported = null;\n break;\n case \"ExportNamedDeclaration\":\n if (node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\") {\n node.type = \"ExportAllDeclaration\";\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n case \"ExportDefaultDeclaration\":\n {\n var _declaration$decorato;\n const {\n declaration\n } = node;\n if ((declaration == null ? void 0 : declaration.type) === \"ClassDeclaration\" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 &&\n declaration.start === node.start) {\n this.resetStartLocation(node,\n exportStartLoc);\n }\n }\n break;\n }\n return node;\n }\n parseSubscript(base, startLoc, noCalls, state) {\n const node = super.parseSubscript(base, startLoc, noCalls, state);\n if (state.optionalChainMember) {\n if (node.type === \"OptionalMemberExpression\" || node.type === \"OptionalCallExpression\") {\n node.type = node.type.substring(8);\n }\n\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (node.type === \"MemberExpression\" || node.type === \"CallExpression\") {\n node.optional = false;\n }\n return node;\n }\n hasPropertyAsPrivateName(node) {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n isOptionalChain(node) {\n return node.type === \"ChainExpression\";\n }\n\n isObjectProperty(node) {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n isObjectMethod(node) {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n finishNodeAt(node, type, endLoc) {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n resetStartLocation(node, startLoc) {\n super.resetStartLocation(node, startLoc);\n toESTreeLocation(node);\n }\n resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n});\n\nclass TokContext {\n constructor(token, preserveSpace) {\n this.token = void 0;\n this.preserveSpace = void 0;\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n}\nconst types = {\n brace: new TokContext(\"{\"),\n j_oTag: new TokContext(\"<tag\"),\n j_cTag: new TokContext(\"</tag\"),\n j_expr: new TokContext(\"<tag>...</tag>\", true)\n};\n\n{\n types.template = new TokContext(\"`\", true);\n}\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\nclass ExportedTokenType {\n constructor(label, conf = {}) {\n this.label = void 0;\n this.keyword = void 0;\n this.beforeExpr = void 0;\n this.startsExpr = void 0;\n this.rightAssociative = void 0;\n this.isLoop = void 0;\n this.isAssign = void 0;\n this.prefix = void 0;\n this.postfix = void 0;\n this.binop = void 0;\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n {\n this.updateContext = null;\n }\n }\n}\n\nconst keywords$1 = new Map();\nfunction createKeyword(name, options = {}) {\n options.keyword = name;\n const token = createToken(name, options);\n keywords$1.set(name, token);\n return token;\n}\nfunction createBinop(name, binop) {\n return createToken(name, {\n beforeExpr,\n binop\n });\n}\nlet tokenTypeCounter = -1;\nconst tokenTypes = [];\nconst tokenLabels = [];\nconst tokenBinops = [];\nconst tokenBeforeExprs = [];\nconst tokenStartsExprs = [];\nconst tokenPrefixes = [];\nfunction createToken(name, options = {}) {\n var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);\n tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);\n tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);\n tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);\n tokenTypes.push(new ExportedTokenType(name, options));\n return tokenTypeCounter;\n}\nfunction createKeywordLike(name, options = {}) {\n var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;\n ++tokenTypeCounter;\n keywords$1.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);\n tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);\n tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);\n tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false);\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n return tokenTypeCounter;\n}\n\nconst tt = {\n bracketL: createToken(\"[\", {\n beforeExpr,\n startsExpr\n }),\n bracketHashL: createToken(\"#[\", {\n beforeExpr,\n startsExpr\n }),\n bracketBarL: createToken(\"[|\", {\n beforeExpr,\n startsExpr\n }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", {\n beforeExpr,\n startsExpr\n }),\n braceBarL: createToken(\"{|\", {\n beforeExpr,\n startsExpr\n }),\n braceHashL: createToken(\"#{\", {\n beforeExpr,\n startsExpr\n }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", {\n beforeExpr,\n startsExpr\n }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", {\n beforeExpr\n }),\n semi: createToken(\";\", {\n beforeExpr\n }),\n colon: createToken(\":\", {\n beforeExpr\n }),\n doubleColon: createToken(\"::\", {\n beforeExpr\n }),\n dot: createToken(\".\"),\n question: createToken(\"?\", {\n beforeExpr\n }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", {\n beforeExpr\n }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", {\n beforeExpr\n }),\n backQuote: createToken(\"`\", {\n startsExpr\n }),\n dollarBraceL: createToken(\"${\", {\n beforeExpr,\n startsExpr\n }),\n templateTail: createToken(\"...`\", {\n startsExpr\n }),\n templateNonTail: createToken(\"...${\", {\n beforeExpr,\n startsExpr\n }),\n at: createToken(\"@\"),\n hash: createToken(\"#\", {\n startsExpr\n }),\n interpreterDirective: createToken(\"#!...\"),\n\n eq: createToken(\"=\", {\n beforeExpr,\n isAssign\n }),\n assign: createToken(\"_=\", {\n beforeExpr,\n isAssign\n }),\n slashAssign: createToken(\"_=\", {\n beforeExpr,\n isAssign\n }),\n xorAssign: createToken(\"_=\", {\n beforeExpr,\n isAssign\n }),\n moduloAssign: createToken(\"_=\", {\n beforeExpr,\n isAssign\n }),\n\n incDec: createToken(\"++/--\", {\n prefix,\n postfix,\n startsExpr\n }),\n bang: createToken(\"!\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n tilde: createToken(\"~\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n doubleCaret: createToken(\"^^\", {\n startsExpr\n }),\n doubleAt: createToken(\"@@\", {\n startsExpr\n }),\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\"</>/<=/>=\", 7),\n gt: createBinop(\"</>/<=/>=\", 7),\n relational: createBinop(\"</>/<=/>=\", 7),\n bitShift: createBinop(\"<</>>/>>>\", 8),\n bitShiftL: createBinop(\"<</>>/>>>\", 8),\n bitShiftR: createBinop(\"<</>>/>>>\", 8),\n plusMin: createToken(\"+/-\", {\n beforeExpr,\n binop: 9,\n prefix,\n startsExpr\n }),\n modulo: createToken(\"%\", {\n binop: 10,\n startsExpr\n }),\n star: createToken(\"*\", {\n binop: 10\n }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true\n }),\n _in: createKeyword(\"in\", {\n beforeExpr,\n binop: 7\n }),\n _instanceof: createKeyword(\"instanceof\", {\n beforeExpr,\n binop: 7\n }),\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", {\n beforeExpr\n }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", {\n beforeExpr\n }),\n _else: createKeyword(\"else\", {\n beforeExpr\n }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", {\n startsExpr\n }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", {\n beforeExpr\n }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", {\n beforeExpr,\n startsExpr\n }),\n _this: createKeyword(\"this\", {\n startsExpr\n }),\n _super: createKeyword(\"super\", {\n startsExpr\n }),\n _class: createKeyword(\"class\", {\n startsExpr\n }),\n _extends: createKeyword(\"extends\", {\n beforeExpr\n }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", {\n startsExpr\n }),\n _null: createKeyword(\"null\", {\n startsExpr\n }),\n _true: createKeyword(\"true\", {\n startsExpr\n }),\n _false: createKeyword(\"false\", {\n startsExpr\n }),\n _typeof: createKeyword(\"typeof\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _void: createKeyword(\"void\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _delete: createKeyword(\"delete\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _do: createKeyword(\"do\", {\n isLoop,\n beforeExpr\n }),\n _for: createKeyword(\"for\", {\n isLoop\n }),\n _while: createKeyword(\"while\", {\n isLoop\n }),\n\n _as: createKeywordLike(\"as\", {\n startsExpr\n }),\n _assert: createKeywordLike(\"assert\", {\n startsExpr\n }),\n _async: createKeywordLike(\"async\", {\n startsExpr\n }),\n _await: createKeywordLike(\"await\", {\n startsExpr\n }),\n _from: createKeywordLike(\"from\", {\n startsExpr\n }),\n _get: createKeywordLike(\"get\", {\n startsExpr\n }),\n _let: createKeywordLike(\"let\", {\n startsExpr\n }),\n _meta: createKeywordLike(\"meta\", {\n startsExpr\n }),\n _of: createKeywordLike(\"of\", {\n startsExpr\n }),\n _sent: createKeywordLike(\"sent\", {\n startsExpr\n }),\n _set: createKeywordLike(\"set\", {\n startsExpr\n }),\n _static: createKeywordLike(\"static\", {\n startsExpr\n }),\n _using: createKeywordLike(\"using\", {\n startsExpr\n }),\n _yield: createKeywordLike(\"yield\", {\n startsExpr\n }),\n _asserts: createKeywordLike(\"asserts\", {\n startsExpr\n }),\n _checks: createKeywordLike(\"checks\", {\n startsExpr\n }),\n _exports: createKeywordLike(\"exports\", {\n startsExpr\n }),\n _global: createKeywordLike(\"global\", {\n startsExpr\n }),\n _implements: createKeywordLike(\"implements\", {\n startsExpr\n }),\n _intrinsic: createKeywordLike(\"intrinsic\", {\n startsExpr\n }),\n _infer: createKeywordLike(\"infer\", {\n startsExpr\n }),\n _is: createKeywordLike(\"is\", {\n startsExpr\n }),\n _mixins: createKeywordLike(\"mixins\", {\n startsExpr\n }),\n _proto: createKeywordLike(\"proto\", {\n startsExpr\n }),\n _require: createKeywordLike(\"require\", {\n startsExpr\n }),\n _satisfies: createKeywordLike(\"satisfies\", {\n startsExpr\n }),\n _keyof: createKeywordLike(\"keyof\", {\n startsExpr\n }),\n _readonly: createKeywordLike(\"readonly\", {\n startsExpr\n }),\n _unique: createKeywordLike(\"unique\", {\n startsExpr\n }),\n _abstract: createKeywordLike(\"abstract\", {\n startsExpr\n }),\n _declare: createKeywordLike(\"declare\", {\n startsExpr\n }),\n _enum: createKeywordLike(\"enum\", {\n startsExpr\n }),\n _module: createKeywordLike(\"module\", {\n startsExpr\n }),\n _namespace: createKeywordLike(\"namespace\", {\n startsExpr\n }),\n _interface: createKeywordLike(\"interface\", {\n startsExpr\n }),\n _type: createKeywordLike(\"type\", {\n startsExpr\n }),\n _opaque: createKeywordLike(\"opaque\", {\n startsExpr\n }),\n name: createToken(\"name\", {\n startsExpr\n }),\n\n string: createToken(\"string\", {\n startsExpr\n }),\n num: createToken(\"num\", {\n startsExpr\n }),\n bigint: createToken(\"bigint\", {\n startsExpr\n }),\n decimal: createToken(\"decimal\", {\n startsExpr\n }),\n regexp: createToken(\"regexp\", {\n startsExpr\n }),\n privateName: createToken(\"#name\", {\n startsExpr\n }),\n eof: createToken(\"eof\"),\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", {\n beforeExpr: true\n }),\n jsxTagStart: createToken(\"jsxTagStart\", {\n startsExpr: true\n }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n placeholder: createToken(\"%%\", {\n startsExpr: true\n })\n};\nfunction tokenIsIdentifier(token) {\n return token >= 93 && token <= 130;\n}\nfunction tokenKeywordOrIdentifierIsKeyword(token) {\n return token <= 92;\n}\nfunction tokenIsKeywordOrIdentifier(token) {\n return token >= 58 && token <= 130;\n}\nfunction tokenIsLiteralPropertyName(token) {\n return token >= 58 && token <= 134;\n}\nfunction tokenComesBeforeExpression(token) {\n return tokenBeforeExprs[token];\n}\nfunction tokenCanStartExpression(token) {\n return tokenStartsExprs[token];\n}\nfunction tokenIsAssignment(token) {\n return token >= 29 && token <= 33;\n}\nfunction tokenIsFlowInterfaceOrTypeOrOpaque(token) {\n return token >= 127 && token <= 129;\n}\nfunction tokenIsLoop(token) {\n return token >= 90 && token <= 92;\n}\nfunction tokenIsKeyword(token) {\n return token >= 58 && token <= 92;\n}\nfunction tokenIsOperator(token) {\n return token >= 39 && token <= 59;\n}\nfunction tokenIsPostfix(token) {\n return token === 34;\n}\nfunction tokenIsPrefix(token) {\n return tokenPrefixes[token];\n}\nfunction tokenIsTSTypeOperator(token) {\n return token >= 119 && token <= 121;\n}\nfunction tokenIsTSDeclarationStart(token) {\n return token >= 122 && token <= 128;\n}\nfunction tokenLabelName(token) {\n return tokenLabels[token];\n}\nfunction tokenOperatorPrecedence(token) {\n return tokenBinops[token];\n}\nfunction tokenIsRightAssociative(token) {\n return token === 57;\n}\nfunction tokenIsTemplate(token) {\n return token >= 24 && token <= 25;\n}\nfunction getExportedToken(token) {\n return tokenTypes[token];\n}\n{\n tokenTypes[8].updateContext = context => {\n context.pop();\n };\n tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => {\n context.push(types.brace);\n };\n tokenTypes[22].updateContext = context => {\n if (context[context.length - 1] === types.template) {\n context.pop();\n } else {\n context.push(types.template);\n }\n };\n tokenTypes[140].updateContext = context => {\n context.push(types.j_expr, types.j_oTag);\n };\n}\n\nlet nonASCIIidentifierStartChars = \"\\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\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\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\\u0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\\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-\\u1711\\u171f-\\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-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\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-\\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-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\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-\\uab69\\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\";\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\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\\u0898-\\u089f\\u08ca-\\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\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\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\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\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-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\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\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\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\\ua82c\\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\";\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\nconst astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191];\nconst astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\nfunction isInAstralSet(code, set) {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\nfunction isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\nfunction isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}\n\nconst reservedWords = {\n keyword: [\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\"],\n strict: [\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\"],\n strictBind: [\"eval\", \"arguments\"]\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\nfunction isReservedWord(word, inModule) {\n return inModule && word === \"await\" || word === \"enum\";\n}\n\nfunction isStrictReservedWord(word, inModule) {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\nfunction isStrictBindOnlyReservedWord(word) {\n return reservedWordsStrictBindSet.has(word);\n}\n\nfunction isStrictBindReservedWord(word, inModule) {\n return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);\n}\nfunction isKeyword(word) {\n return keywords.has(word);\n}\n\nfunction isIteratorStart(current, next, next2) {\n return current === 64 && next === 64 && isIdentifierStart(next2);\n}\n\nconst reservedWordLikeSet = new Set([\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\",\n\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\",\n\"eval\", \"arguments\",\n\"enum\", \"await\"]);\nfunction canBeReservedWord(word) {\n return reservedWordLikeSet.has(word);\n}\n\nconst SCOPE_OTHER = 0b000000000,\n SCOPE_PROGRAM = 0b000000001,\n SCOPE_FUNCTION = 0b000000010,\n SCOPE_ARROW = 0b000000100,\n SCOPE_SIMPLE_CATCH = 0b000001000,\n SCOPE_SUPER = 0b000010000,\n SCOPE_DIRECT_SUPER = 0b000100000,\n SCOPE_CLASS = 0b001000000,\n SCOPE_STATIC_BLOCK = 0b010000000,\n SCOPE_TS_MODULE = 0b100000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_STATIC_BLOCK | SCOPE_TS_MODULE;\nconst BIND_KIND_VALUE = 0b000000000001,\n BIND_KIND_TYPE = 0b000000000010,\n BIND_SCOPE_VAR = 0b000000000100,\n BIND_SCOPE_LEXICAL = 0b000000001000,\n BIND_SCOPE_FUNCTION = 0b000000010000,\n BIND_FLAGS_NONE = 0b0000001000000,\n BIND_FLAGS_CLASS = 0b0000010000000,\n BIND_FLAGS_TS_ENUM = 0b0000100000000,\n BIND_FLAGS_TS_CONST_ENUM = 0b0001000000000,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b0010000000000,\n BIND_FLAGS_FLOW_DECLARE_FN = 0b0100000000000,\n BIND_FLAGS_TS_IMPORT = 0b1000000000000;\n\nconst BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE,\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_TS_TYPE_IMPORT = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_TS_IMPORT,\n BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;\nconst CLASS_ELEMENT_FLAG_STATIC = 0b100,\n CLASS_ELEMENT_KIND_GETTER = 0b010,\n CLASS_ELEMENT_KIND_SETTER = 0b001,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\nconst CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nclass Scope {\n\n constructor(flags) {\n this.var = new Set();\n this.lexical = new Set();\n this.functions = new Set();\n this.flags = flags;\n }\n}\n\nclass ScopeHandler {\n constructor(parser, inModule) {\n this.parser = void 0;\n this.scopeStack = [];\n this.inModule = void 0;\n this.undefinedExports = new Map();\n this.parser = parser;\n this.inModule = inModule;\n }\n get inTopLevel() {\n return (this.currentScope().flags & SCOPE_PROGRAM) > 0;\n }\n get inFunction() {\n return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0;\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1;; i--) {\n const {\n flags\n } = this.scopeStack[i];\n if (flags & SCOPE_STATIC_BLOCK) {\n return true;\n }\n if (flags & (SCOPE_VAR | SCOPE_CLASS)) {\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n createScope(flags) {\n return new Scope(flags);\n }\n enter(flags) {\n this.scopeStack.push(this.createScope(flags));\n }\n exit() {\n const scope = this.scopeStack.pop();\n return scope.flags;\n }\n\n treatFunctionsAsVarInScope(scope) {\n return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM);\n }\n declareName(name, bindingType, loc) {\n let scope = this.currentScope();\n if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n if (bindingType & BIND_SCOPE_FUNCTION) {\n scope.functions.add(name);\n } else {\n scope.lexical.add(name);\n }\n if (bindingType & BIND_SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BIND_SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n scope.var.add(name);\n this.maybeExportDefined(scope, name);\n if (scope.flags & SCOPE_VAR) break;\n }\n }\n if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n maybeExportDefined(scope, name) {\n if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n checkRedeclarationInScope(scope, name, bindingType, loc) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.parser.raise(Errors.VarRedeclaration, {\n at: loc,\n identifierName: name\n });\n }\n }\n isRedeclaredInScope(scope, name, bindingType) {\n if (!(bindingType & BIND_KIND_VALUE)) return false;\n if (bindingType & BIND_SCOPE_LEXICAL) {\n return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);\n }\n if (bindingType & BIND_SCOPE_FUNCTION) {\n return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);\n }\n return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);\n }\n checkLocalExport(id) {\n const {\n name\n } = id;\n const topLevelScope = this.scopeStack[0];\n if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) &&\n !topLevelScope.functions.has(name)) {\n this.undefinedExports.set(name, id.loc.start);\n }\n }\n currentScope() {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n currentVarScopeFlags() {\n for (let i = this.scopeStack.length - 1;; i--) {\n const {\n flags\n } = this.scopeStack[i];\n if (flags & SCOPE_VAR) {\n return flags;\n }\n }\n }\n\n currentThisScopeFlags() {\n for (let i = this.scopeStack.length - 1;; i--) {\n const {\n flags\n } = this.scopeStack[i];\n if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) {\n return flags;\n }\n }\n }\n}\n\nclass FlowScope extends Scope {\n constructor(...args) {\n super(...args);\n this.declareFunctions = new Set();\n }\n}\nclass FlowScopeHandler extends ScopeHandler {\n createScope(flags) {\n return new FlowScope(flags);\n }\n declareName(name, bindingType, loc) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n super.declareName(name, bindingType, loc);\n }\n isRedeclaredInScope(scope, name, bindingType) {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));\n }\n return false;\n }\n checkLocalExport(id) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n\nclass BaseParser {\n constructor() {\n this.sawUnambiguousESM = false;\n this.ambiguousScriptDifferentAst = false;\n }\n hasPlugin(pluginConfig) {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(pluginOptions)) {\n if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n getPluginOption(plugin, name) {\n var _this$plugins$get;\n return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name];\n }\n}\n\nfunction setTrailingComments(node, comments) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\nfunction setLeadingComments(node, comments) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\nfunction setInnerComments(node, comments) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\nfunction adjustInnerComments(node, elements, commentWS) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nclass CommentsParser extends BaseParser {\n addComment(comment) {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.comments.push(comment);\n }\n\n processComment(node) {\n const {\n commentStack\n } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n const {\n start: nodeStart\n } = node;\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n break;\n }\n }\n }\n\n finalizeComment(commentWS) {\n const {\n comments\n } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n const {\n containingNode: node,\n start: commentStart\n } = commentWS;\n if (this.input.charCodeAt(commentStart - 1) === 44) {\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default:\n {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n finalizeRemainingComments() {\n const {\n commentStack\n } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n resetPreviousNodeTrailingComments(node) {\n const {\n commentStack\n } = this.state;\n const {\n length\n } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n takeSurroundingComments(node, start, end) {\n const {\n commentStack\n } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n\nconst lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nconst lineBreakG = new RegExp(lineBreak.source, \"g\");\n\nfunction isNewLine(code) {\n switch (code) {\n case 10:\n case 13:\n case 8232:\n case 8233:\n return true;\n default:\n return false;\n }\n}\nconst skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\nconst skipWhiteSpaceInLine = /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/y;\n\nconst skipWhiteSpaceToLineBreak = new RegExp(\n\"(?=(\" +\nskipWhiteSpaceInLine.source + \"))\\\\1\" +\n/(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)/.source, \"y\");\n\nfunction isWhitespace(code) {\n switch (code) {\n case 0x0009:\n case 0x000b:\n case 0x000c:\n case 32:\n case 160:\n case 5760:\n case 0x2000:\n case 0x2001:\n case 0x2002:\n case 0x2003:\n case 0x2004:\n case 0x2005:\n case 0x2006:\n case 0x2007:\n case 0x2008:\n case 0x2009:\n case 0x200a:\n case 0x202f:\n case 0x205f:\n case 0x3000:\n case 0xfeff:\n return true;\n default:\n return false;\n }\n}\n\nclass State {\n constructor() {\n this.strict = void 0;\n this.curLine = void 0;\n this.lineStart = void 0;\n this.startLoc = void 0;\n this.endLoc = void 0;\n this.errors = [];\n this.potentialArrowAt = -1;\n this.noArrowAt = [];\n this.noArrowParamsConversionAt = [];\n this.maybeInArrowParameters = false;\n this.inType = false;\n this.noAnonFunctionType = false;\n this.hasFlowComment = false;\n this.isAmbientContext = false;\n this.inAbstractClass = false;\n this.inDisallowConditionalTypesContext = false;\n this.topicContext = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null\n };\n this.soloAwait = false;\n this.inFSharpPipelineDirectBody = false;\n this.labels = [];\n this.comments = [];\n this.commentStack = [];\n this.pos = 0;\n this.type = 137;\n this.value = null;\n this.start = 0;\n this.end = 0;\n this.lastTokEndLoc = null;\n this.lastTokStartLoc = null;\n this.lastTokStart = 0;\n this.context = [types.brace];\n this.canStartJSXElement = true;\n this.containsEsc = false;\n this.firstInvalidTemplateEscapePos = null;\n this.strictErrors = new Map();\n this.tokensLength = 0;\n }\n init({\n strictMode,\n sourceType,\n startLine,\n startColumn\n }) {\n this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === \"module\";\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);\n }\n curPosition() {\n return new Position(this.curLine, this.pos - this.lineStart, this.pos);\n }\n clone(skipArrays) {\n const state = new State();\n const keys = Object.keys(this);\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n let val = this[key];\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n state[key] = val;\n }\n return state;\n }\n}\n\nvar _isDigit = function isDigit(code) {\n return code >= 48 && code <= 57;\n};\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),\n hex: new Set([46, 88, 95, 120])\n};\nconst isAllowedNumericSeparatorSibling = {\n bin: ch => ch === 48 || ch === 49,\n oct: ch => ch >= 48 && ch <= 55,\n dec: ch => ch >= 48 && ch <= 57,\n hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102\n};\nfunction readStringContents(type, input, pos, lineStart, curLine, errors) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const {\n length\n } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === 92) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(input, pos, lineStart, curLine, type === \"template\", errors);\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = {\n pos,\n lineStart,\n curLine\n };\n } else {\n out += res.ch;\n }\n ({\n pos,\n lineStart,\n curLine\n } = res);\n chunkStart = pos;\n } else if (ch === 8232 || ch === 8233) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === 10 || ch === 13) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (ch === 13 && input.charCodeAt(pos) === 10) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc\n };\n}\nfunction isStringEnd(type, ch, input, pos) {\n if (type === \"template\") {\n return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;\n }\n return ch === (type === \"double\" ? 34 : 39);\n}\nfunction readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {\n const throwOnInvalid = !inTemplate;\n pos++;\n\n const res = ch => ({\n pos,\n ch,\n lineStart,\n curLine\n });\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case 110:\n return res(\"\\n\");\n case 114:\n return res(\"\\r\");\n case 120:\n {\n let code;\n ({\n code,\n pos\n } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case 117:\n {\n let code;\n ({\n code,\n pos\n } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case 116:\n return res(\"\\t\");\n case 98:\n return res(\"\\b\");\n case 118:\n return res(\"\\u000b\");\n case 102:\n return res(\"\\f\");\n case 13:\n if (input.charCodeAt(pos) === 10) {\n ++pos;\n }\n case 10:\n lineStart = pos;\n ++curLine;\n case 8232:\n case 8233:\n return res(\"\");\n case 56:\n case 57:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n default:\n if (ch >= 48 && ch <= 55) {\n const startPos = pos - 1;\n const match = input.slice(startPos, pos + 2).match(/^[0-7]+/);\n let octalStr = match[0];\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (octalStr !== \"0\" || next === 56 || next === 57) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n return res(String.fromCharCode(octal));\n }\n return res(String.fromCharCode(ch));\n }\n}\nfunction readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {\n const initialPos = pos;\n let n;\n ({\n n,\n pos\n } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return {\n code: n,\n pos\n };\n}\nfunction readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {\n const start = pos;\n const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;\n let invalid = false;\n let total = 0;\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n if (code === 95 && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n if (!allowNumSeparator) {\n if (bailOnError) return {\n n: null,\n pos\n };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {\n if (bailOnError) return {\n n: null,\n pos\n };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n ++pos;\n continue;\n }\n if (code >= 97) {\n val = code - 97 + 10;\n } else if (code >= 65) {\n val = code - 65 + 10;\n } else if (_isDigit(code)) {\n val = code - 48;\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n if (val <= 9 && bailOnError) {\n return {\n n: null,\n pos\n };\n } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || len != null && pos - start !== len || invalid) {\n return {\n n: null,\n pos\n };\n }\n return {\n n: total,\n pos\n };\n}\nfunction readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {\n const ch = input.charCodeAt(pos);\n let code;\n if (ch === 123) {\n ++pos;\n ({\n code,\n pos\n } = readHexChar(input, pos, lineStart, curLine, input.indexOf(\"}\", pos) - pos, true, throwOnInvalid, errors));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return {\n code: null,\n pos\n };\n }\n }\n } else {\n ({\n code,\n pos\n } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));\n }\n return {\n code,\n pos\n };\n}\n\nconst _excluded = [\"at\"],\n _excluded2 = [\"at\"];\nfunction buildPosition(pos, lineStart, curLine) {\n return new Position(curLine, pos - lineStart, pos);\n}\nconst VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]);\n\nclass Token {\n constructor(state) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n}\n\nclass Tokenizer extends CommentsParser {\n\n constructor(options, input) {\n super();\n this.isLookahead = void 0;\n this.tokens = [];\n this.errorHandlers_readInt = {\n invalidDigit: (pos, lineStart, curLine, radix) => {\n if (!this.options.errorRecovery) return false;\n this.raise(Errors.InvalidDigit, {\n at: buildPosition(pos, lineStart, curLine),\n radix\n });\n return true;\n },\n numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),\n unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator)\n };\n this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, {\n invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),\n invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint)\n });\n this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, {\n strictNumericEscape: (pos, lineStart, curLine) => {\n this.recordStrictModeErrors(Errors.StrictNumericEscape, {\n at: buildPosition(pos, lineStart, curLine)\n });\n },\n unterminated: (pos, lineStart, curLine) => {\n throw this.raise(Errors.UnterminatedString, {\n at: buildPosition(pos - 1, lineStart, curLine)\n });\n }\n });\n this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, {\n strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),\n unterminated: (pos, lineStart, curLine) => {\n throw this.raise(Errors.UnterminatedTemplate, {\n at: buildPosition(pos, lineStart, curLine)\n });\n }\n });\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n pushToken(token) {\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n next() {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type) {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n match(type) {\n return this.state.type === type;\n }\n\n createLookaheadState(state) {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition\n };\n }\n\n lookahead() {\n const old = this.state;\n this.state = this.createLookaheadState(old);\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n const curr = this.state;\n this.state = old;\n return curr;\n }\n nextTokenStart() {\n return this.nextTokenStartSince(this.state.pos);\n }\n nextTokenStartSince(pos) {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n lookaheadCharCode() {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n codePointAtPos(pos) {\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n setStrict(strict) {\n this.state.strict = strict;\n if (strict) {\n this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, {\n at\n }));\n this.state.strictErrors.clear();\n }\n }\n curContext() {\n return this.state.context[this.state.context.length - 1];\n }\n\n nextToken() {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(137);\n return;\n }\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n skipBlockComment(commentEnd) {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition()\n });\n }\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n if (this.isLookahead) return;\n\n const comment = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start,\n end: end + commentEnd.length,\n loc: new SourceLocation(startLoc, this.state.curPosition())\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n skipLineComment(startSkip) {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt(this.state.pos += startSkip);\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n if (this.isLookahead) return;\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n const comment = {\n type: \"CommentLine\",\n value,\n start,\n end,\n loc: new SourceLocation(startLoc, this.state.curPosition())\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipSpace() {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case 32:\n case 160:\n case 9:\n ++this.state.pos;\n break;\n case 13:\n if (this.input.charCodeAt(this.state.pos + 1) === 10) {\n ++this.state.pos;\n }\n case 10:\n case 8232:\n case 8233:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n case 47:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case 42:\n {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n case 47:\n {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n default:\n break loop;\n }\n break;\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (ch === 45 && !this.inModule) {\n const pos = this.state.pos;\n if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (ch === 60 && !this.inModule) {\n const pos = this.state.pos;\n if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {\n const comment = this.skipLineComment(4);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else {\n break loop;\n }\n }\n }\n if (comments.length > 0) {\n const end = this.state.pos;\n const commentWhitespace = {\n start: spaceStart,\n end,\n comments,\n leadingNode: null,\n trailingNode: null,\n containingNode: null\n };\n this.state.commentStack.push(commentWhitespace);\n }\n }\n\n finishToken(type, val) {\n this.state.end = this.state.pos;\n this.state.endLoc = this.state.curPosition();\n const prevType = this.state.type;\n this.state.type = type;\n this.state.value = val;\n if (!this.isLookahead) {\n this.updateContext(prevType);\n }\n }\n replaceToken(type) {\n this.state.type = type;\n this.updateContext();\n }\n\n readToken_numberSign() {\n if (this.state.pos === 0 && this.readToken_interpreter()) {\n return;\n }\n const nextPos = this.state.pos + 1;\n const next = this.codePointAtPos(nextPos);\n if (next >= 48 && next <= 57) {\n throw this.raise(Errors.UnexpectedDigitAfterHash, {\n at: this.state.curPosition()\n });\n }\n if (next === 123 || next === 91 && this.hasPlugin(\"recordAndTuple\")) {\n this.expectPlugin(\"recordAndTuple\");\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") === \"bar\") {\n throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, {\n at: this.state.curPosition()\n });\n }\n this.state.pos += 2;\n if (next === 123) {\n this.finishToken(7);\n } else {\n this.finishToken(1);\n }\n } else if (isIdentifierStart(next)) {\n ++this.state.pos;\n this.finishToken(136, this.readWord1(next));\n } else if (next === 92) {\n ++this.state.pos;\n this.finishToken(136, this.readWord1());\n } else {\n this.finishOp(27, 1);\n }\n }\n readToken_dot() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next >= 48 && next <= 57) {\n this.readNumber(true);\n return;\n }\n if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {\n this.state.pos += 3;\n this.finishToken(21);\n } else {\n ++this.state.pos;\n this.finishToken(16);\n }\n }\n readToken_slash() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === 61) {\n this.finishOp(31, 2);\n } else {\n this.finishOp(56, 1);\n }\n }\n readToken_interpreter() {\n if (this.state.pos !== 0 || this.length < 2) return false;\n let ch = this.input.charCodeAt(this.state.pos + 1);\n if (ch !== 33) return false;\n const start = this.state.pos;\n this.state.pos += 1;\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n const value = this.input.slice(start + 2, this.state.pos);\n this.finishToken(28, value);\n return true;\n }\n readToken_mult_modulo(code) {\n let type = code === 42 ? 55 : 54;\n let width = 1;\n let next = this.input.charCodeAt(this.state.pos + 1);\n\n if (code === 42 && next === 42) {\n width++;\n next = this.input.charCodeAt(this.state.pos + 2);\n type = 57;\n }\n\n if (next === 61 && !this.state.inType) {\n width++;\n type = code === 37 ? 33 : 30;\n }\n this.finishOp(type, width);\n }\n readToken_pipe_amp(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === code) {\n if (this.input.charCodeAt(this.state.pos + 2) === 61) {\n this.finishOp(30, 3);\n } else {\n this.finishOp(code === 124 ? 41 : 42, 2);\n }\n return;\n }\n if (code === 124) {\n if (next === 62) {\n this.finishOp(39, 2);\n return;\n }\n if (this.hasPlugin(\"recordAndTuple\") && next === 125) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, {\n at: this.state.curPosition()\n });\n }\n this.state.pos += 2;\n this.finishToken(9);\n return;\n }\n\n if (this.hasPlugin(\"recordAndTuple\") && next === 93) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, {\n at: this.state.curPosition()\n });\n }\n this.state.pos += 2;\n this.finishToken(4);\n return;\n }\n }\n if (next === 61) {\n this.finishOp(30, 2);\n return;\n }\n this.finishOp(code === 124 ? 43 : 45, 1);\n }\n readToken_caret() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === 61 && !this.state.inType) {\n this.finishOp(32, 2);\n }\n else if (next === 94 &&\n this.hasPlugin([\"pipelineOperator\", {\n proposal: \"hack\",\n topicToken: \"^^\"\n }])) {\n this.finishOp(37, 2);\n\n const lookaheadCh = this.input.codePointAt(this.state.pos);\n if (lookaheadCh === 94) {\n throw this.unexpected();\n }\n }\n else {\n this.finishOp(44, 1);\n }\n }\n readToken_atSign() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === 64 && this.hasPlugin([\"pipelineOperator\", {\n proposal: \"hack\",\n topicToken: \"@@\"\n }])) {\n this.finishOp(38, 2);\n }\n else {\n this.finishOp(26, 1);\n }\n }\n readToken_plus_min(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === code) {\n this.finishOp(34, 2);\n return;\n }\n if (next === 61) {\n this.finishOp(30, 2);\n } else {\n this.finishOp(53, 1);\n }\n }\n readToken_lt() {\n const {\n pos\n } = this.state;\n const next = this.input.charCodeAt(pos + 1);\n if (next === 60) {\n if (this.input.charCodeAt(pos + 2) === 61) {\n this.finishOp(30, 3);\n return;\n }\n this.finishOp(51, 2);\n return;\n }\n if (next === 61) {\n this.finishOp(49, 2);\n return;\n }\n this.finishOp(47, 1);\n }\n readToken_gt() {\n const {\n pos\n } = this.state;\n const next = this.input.charCodeAt(pos + 1);\n if (next === 62) {\n const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(pos + size) === 61) {\n this.finishOp(30, size + 1);\n return;\n }\n this.finishOp(52, size);\n return;\n }\n if (next === 61) {\n this.finishOp(49, 2);\n return;\n }\n this.finishOp(48, 1);\n }\n readToken_eq_excl(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === 61) {\n this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);\n return;\n }\n if (code === 61 && next === 62) {\n this.state.pos += 2;\n this.finishToken(19);\n return;\n }\n this.finishOp(code === 61 ? 29 : 35, 1);\n }\n readToken_question() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n const next2 = this.input.charCodeAt(this.state.pos + 2);\n if (next === 63) {\n if (next2 === 61) {\n this.finishOp(30, 3);\n } else {\n this.finishOp(40, 2);\n }\n } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {\n this.state.pos += 2;\n this.finishToken(18);\n } else {\n ++this.state.pos;\n this.finishToken(17);\n }\n }\n getTokenFromCode(code) {\n switch (code) {\n\n case 46:\n this.readToken_dot();\n return;\n\n case 40:\n ++this.state.pos;\n this.finishToken(10);\n return;\n case 41:\n ++this.state.pos;\n this.finishToken(11);\n return;\n case 59:\n ++this.state.pos;\n this.finishToken(13);\n return;\n case 44:\n ++this.state.pos;\n this.finishToken(12);\n return;\n case 91:\n if (this.hasPlugin(\"recordAndTuple\") && this.input.charCodeAt(this.state.pos + 1) === 124) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, {\n at: this.state.curPosition()\n });\n }\n\n this.state.pos += 2;\n this.finishToken(2);\n } else {\n ++this.state.pos;\n this.finishToken(0);\n }\n return;\n case 93:\n ++this.state.pos;\n this.finishToken(3);\n return;\n case 123:\n if (this.hasPlugin(\"recordAndTuple\") && this.input.charCodeAt(this.state.pos + 1) === 124) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, {\n at: this.state.curPosition()\n });\n }\n\n this.state.pos += 2;\n this.finishToken(6);\n } else {\n ++this.state.pos;\n this.finishToken(5);\n }\n return;\n case 125:\n ++this.state.pos;\n this.finishToken(8);\n return;\n case 58:\n if (this.hasPlugin(\"functionBind\") && this.input.charCodeAt(this.state.pos + 1) === 58) {\n this.finishOp(15, 2);\n } else {\n ++this.state.pos;\n this.finishToken(14);\n }\n return;\n case 63:\n this.readToken_question();\n return;\n case 96:\n this.readTemplateToken();\n return;\n case 48:\n {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === 120 || next === 88) {\n this.readRadixNumber(16);\n return;\n }\n if (next === 111 || next === 79) {\n this.readRadixNumber(8);\n return;\n }\n if (next === 98 || next === 66) {\n this.readRadixNumber(2);\n return;\n }\n }\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n this.readNumber(false);\n return;\n\n case 34:\n case 39:\n this.readString(code);\n return;\n\n case 47:\n this.readToken_slash();\n return;\n case 37:\n case 42:\n this.readToken_mult_modulo(code);\n return;\n case 124:\n case 38:\n this.readToken_pipe_amp(code);\n return;\n case 94:\n this.readToken_caret();\n return;\n case 43:\n case 45:\n this.readToken_plus_min(code);\n return;\n case 60:\n this.readToken_lt();\n return;\n case 62:\n this.readToken_gt();\n return;\n case 61:\n case 33:\n this.readToken_eq_excl(code);\n return;\n case 126:\n this.finishOp(36, 1);\n return;\n case 64:\n this.readToken_atSign();\n return;\n case 35:\n this.readToken_numberSign();\n return;\n case 92:\n this.readWord();\n return;\n default:\n if (isIdentifierStart(code)) {\n this.readWord(code);\n return;\n }\n }\n throw this.raise(Errors.InvalidOrUnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: String.fromCodePoint(code)\n });\n }\n finishOp(type, size) {\n const str = this.input.slice(this.state.pos, this.state.pos + size);\n this.state.pos += size;\n this.finishToken(type, str);\n }\n readRegexp() {\n const startLoc = this.state.startLoc;\n const start = this.state.start + 1;\n let escaped, inClass;\n let {\n pos\n } = this.state;\n for (;; ++pos) {\n if (pos >= this.length) {\n throw this.raise(Errors.UnterminatedRegExp, {\n at: createPositionWithColumnOffset(startLoc, 1)\n });\n }\n const ch = this.input.charCodeAt(pos);\n if (isNewLine(ch)) {\n throw this.raise(Errors.UnterminatedRegExp, {\n at: createPositionWithColumnOffset(startLoc, 1)\n });\n }\n if (escaped) {\n escaped = false;\n } else {\n if (ch === 91) {\n inClass = true;\n } else if (ch === 93 && inClass) {\n inClass = false;\n } else if (ch === 47 && !inClass) {\n break;\n }\n escaped = ch === 92;\n }\n }\n const content = this.input.slice(start, pos);\n ++pos;\n let mods = \"\";\n const nextPos = () =>\n createPositionWithColumnOffset(startLoc, pos + 2 - start);\n while (pos < this.length) {\n const cp = this.codePointAtPos(pos);\n const char = String.fromCharCode(cp);\n\n if (VALID_REGEX_FLAGS.has(cp)) {\n if (cp === 118) {\n this.expectPlugin(\"regexpUnicodeSets\", nextPos());\n if (mods.includes(\"u\")) {\n this.raise(Errors.IncompatibleRegExpUVFlags, {\n at: nextPos()\n });\n }\n } else if (cp === 117) {\n if (mods.includes(\"v\")) {\n this.raise(Errors.IncompatibleRegExpUVFlags, {\n at: nextPos()\n });\n }\n }\n if (mods.includes(char)) {\n this.raise(Errors.DuplicateRegExpFlags, {\n at: nextPos()\n });\n }\n } else if (isIdentifierChar(cp) || cp === 92) {\n this.raise(Errors.MalformedRegExpFlags, {\n at: nextPos()\n });\n } else {\n break;\n }\n ++pos;\n mods += char;\n }\n this.state.pos = pos;\n this.finishToken(135, {\n pattern: content,\n flags: mods\n });\n }\n\n readInt(radix, len, forceLen = false, allowNumSeparator = true) {\n const {\n n,\n pos\n } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false);\n this.state.pos = pos;\n return n;\n }\n readRadixNumber(radix) {\n const startLoc = this.state.curPosition();\n let isBigInt = false;\n this.state.pos += 2;\n const val = this.readInt(radix);\n if (val == null) {\n this.raise(Errors.InvalidDigit, {\n at: createPositionWithColumnOffset(startLoc, 2),\n radix\n });\n }\n const next = this.input.charCodeAt(this.state.pos);\n if (next === 110) {\n ++this.state.pos;\n isBigInt = true;\n } else if (next === 109) {\n throw this.raise(Errors.InvalidDecimal, {\n at: startLoc\n });\n }\n if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {\n throw this.raise(Errors.NumberIdentifier, {\n at: this.state.curPosition()\n });\n }\n if (isBigInt) {\n const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, \"\");\n this.finishToken(133, str);\n return;\n }\n this.finishToken(132, val);\n }\n\n readNumber(startsWithDot) {\n const start = this.state.pos;\n const startLoc = this.state.curPosition();\n let isFloat = false;\n let isBigInt = false;\n let isDecimal = false;\n let hasExponent = false;\n let isOctal = false;\n if (!startsWithDot && this.readInt(10) === null) {\n this.raise(Errors.InvalidNumber, {\n at: this.state.curPosition()\n });\n }\n const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;\n if (hasLeadingZero) {\n const integer = this.input.slice(start, this.state.pos);\n this.recordStrictModeErrors(Errors.StrictOctalLiteral, {\n at: startLoc\n });\n if (!this.state.strict) {\n const underscorePos = integer.indexOf(\"_\");\n if (underscorePos > 0) {\n this.raise(Errors.ZeroDigitNumericSeparator, {\n at: createPositionWithColumnOffset(startLoc, underscorePos)\n });\n }\n }\n isOctal = hasLeadingZero && !/[89]/.test(integer);\n }\n let next = this.input.charCodeAt(this.state.pos);\n if (next === 46 && !isOctal) {\n ++this.state.pos;\n this.readInt(10);\n isFloat = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n if ((next === 69 || next === 101) && !isOctal) {\n next = this.input.charCodeAt(++this.state.pos);\n if (next === 43 || next === 45) {\n ++this.state.pos;\n }\n if (this.readInt(10) === null) {\n this.raise(Errors.InvalidOrMissingExponent, {\n at: startLoc\n });\n }\n isFloat = true;\n hasExponent = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n if (next === 110) {\n if (isFloat || hasLeadingZero) {\n this.raise(Errors.InvalidBigIntLiteral, {\n at: startLoc\n });\n }\n ++this.state.pos;\n isBigInt = true;\n }\n if (next === 109) {\n this.expectPlugin(\"decimal\", this.state.curPosition());\n if (hasExponent || hasLeadingZero) {\n this.raise(Errors.InvalidDecimal, {\n at: startLoc\n });\n }\n ++this.state.pos;\n isDecimal = true;\n }\n if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {\n throw this.raise(Errors.NumberIdentifier, {\n at: this.state.curPosition()\n });\n }\n\n const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, \"\");\n if (isBigInt) {\n this.finishToken(133, str);\n return;\n }\n if (isDecimal) {\n this.finishToken(134, str);\n return;\n }\n const val = isOctal ? parseInt(str, 8) : parseFloat(str);\n this.finishToken(132, val);\n }\n\n readCodePoint(throwOnInvalid) {\n const {\n code,\n pos\n } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint);\n this.state.pos = pos;\n return code;\n }\n readString(quote) {\n const {\n str,\n pos,\n curLine,\n lineStart\n } = readStringContents(quote === 34 ? \"double\" : \"single\", this.input, this.state.pos + 1,\n this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);\n this.state.pos = pos + 1;\n this.state.lineStart = lineStart;\n this.state.curLine = curLine;\n this.finishToken(131, str);\n }\n\n readTemplateContinuation() {\n if (!this.match(8)) {\n this.unexpected(null, 8);\n }\n this.state.pos--;\n this.readTemplateToken();\n }\n\n readTemplateToken() {\n const opening = this.input[this.state.pos];\n const {\n str,\n firstInvalidLoc,\n pos,\n curLine,\n lineStart\n } = readStringContents(\"template\", this.input, this.state.pos + 1,\n this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);\n this.state.pos = pos + 1;\n this.state.lineStart = lineStart;\n this.state.curLine = curLine;\n if (firstInvalidLoc) {\n this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos);\n }\n if (this.input.codePointAt(pos) === 96) {\n this.finishToken(24, firstInvalidLoc ? null : opening + str + \"`\");\n } else {\n this.state.pos++;\n this.finishToken(25, firstInvalidLoc ? null : opening + str + \"${\");\n }\n }\n recordStrictModeErrors(toParseError, {\n at\n }) {\n const index = at.index;\n if (this.state.strict && !this.state.strictErrors.has(index)) {\n this.raise(toParseError, {\n at\n });\n } else {\n this.state.strictErrors.set(index, [toParseError, at]);\n }\n }\n\n readWord1(firstCode) {\n this.state.containsEsc = false;\n let word = \"\";\n const start = this.state.pos;\n let chunkStart = this.state.pos;\n if (firstCode !== undefined) {\n this.state.pos += firstCode <= 0xffff ? 1 : 2;\n }\n while (this.state.pos < this.length) {\n const ch = this.codePointAtPos(this.state.pos);\n if (isIdentifierChar(ch)) {\n this.state.pos += ch <= 0xffff ? 1 : 2;\n } else if (ch === 92) {\n this.state.containsEsc = true;\n word += this.input.slice(chunkStart, this.state.pos);\n const escStart = this.state.curPosition();\n const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;\n if (this.input.charCodeAt(++this.state.pos) !== 117) {\n this.raise(Errors.MissingUnicodeEscape, {\n at: this.state.curPosition()\n });\n chunkStart = this.state.pos - 1;\n continue;\n }\n ++this.state.pos;\n const esc = this.readCodePoint(true);\n if (esc !== null) {\n if (!identifierCheck(esc)) {\n this.raise(Errors.EscapedCharNotAnIdentifier, {\n at: escStart\n });\n }\n word += String.fromCodePoint(esc);\n }\n chunkStart = this.state.pos;\n } else {\n break;\n }\n }\n return word + this.input.slice(chunkStart, this.state.pos);\n }\n\n readWord(firstCode) {\n const word = this.readWord1(firstCode);\n const type = keywords$1.get(word);\n if (type !== undefined) {\n this.finishToken(type, tokenLabelName(type));\n } else {\n this.finishToken(130, word);\n }\n }\n checkKeywordEscapes() {\n const {\n type\n } = this.state;\n if (tokenIsKeyword(type) && this.state.containsEsc) {\n this.raise(Errors.InvalidEscapedReservedWord, {\n at: this.state.startLoc,\n reservedWord: tokenLabelName(type)\n });\n }\n }\n\n raise(toParseError, raiseProperties) {\n const {\n at\n } = raiseProperties,\n details = _objectWithoutPropertiesLoose(raiseProperties, _excluded);\n const loc = at instanceof Position ? at : at.loc.start;\n const error = toParseError({\n loc,\n details\n });\n if (!this.options.errorRecovery) throw error;\n if (!this.isLookahead) this.state.errors.push(error);\n return error;\n }\n\n raiseOverwrite(toParseError, raiseProperties) {\n const {\n at\n } = raiseProperties,\n details = _objectWithoutPropertiesLoose(raiseProperties, _excluded2);\n const loc = at instanceof Position ? at : at.loc.start;\n const pos = loc.index;\n const errors = this.state.errors;\n for (let i = errors.length - 1; i >= 0; i--) {\n const error = errors[i];\n if (error.loc.index === pos) {\n return errors[i] = toParseError({\n loc,\n details\n });\n }\n if (error.loc.index < pos) break;\n }\n return this.raise(toParseError, raiseProperties);\n }\n\n updateContext(prevType) {}\n\n unexpected(loc, type) {\n throw this.raise(Errors.UnexpectedToken, {\n expected: type ? tokenLabelName(type) : null,\n at: loc != null ? loc : this.state.startLoc\n });\n }\n expectPlugin(pluginName, loc) {\n if (this.hasPlugin(pluginName)) {\n return true;\n }\n throw this.raise(Errors.MissingPlugin, {\n at: loc != null ? loc : this.state.startLoc,\n missingPlugin: [pluginName]\n });\n }\n expectOnePlugin(pluginNames) {\n if (!pluginNames.some(name => this.hasPlugin(name))) {\n throw this.raise(Errors.MissingOneOfPlugins, {\n at: this.state.startLoc,\n missingPlugin: pluginNames\n });\n }\n }\n errorBuilder(error) {\n return (pos, lineStart, curLine) => {\n this.raise(error, {\n at: buildPosition(pos, lineStart, curLine)\n });\n };\n }\n}\n\nclass ClassScope {\n constructor() {\n this.privateNames = new Set();\n this.loneAccessors = new Map();\n this.undefinedPrivateNames = new Map();\n }\n}\nclass ClassScopeHandler {\n constructor(parser) {\n this.parser = void 0;\n this.stack = [];\n this.undefinedPrivateNames = new Map();\n this.parser = parser;\n }\n current() {\n return this.stack[this.stack.length - 1];\n }\n enter() {\n this.stack.push(new ClassScope());\n }\n exit() {\n const oldClassScope = this.stack.pop();\n\n const current = this.current();\n\n for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {\n if (current) {\n if (!current.undefinedPrivateNames.has(name)) {\n current.undefinedPrivateNames.set(name, loc);\n }\n } else {\n this.parser.raise(Errors.InvalidPrivateFieldResolution, {\n at: loc,\n identifierName: name\n });\n }\n }\n }\n declarePrivateName(name, elementType, loc) {\n const {\n privateNames,\n loneAccessors,\n undefinedPrivateNames\n } = this.current();\n let redefined = privateNames.has(name);\n if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {\n const accessor = redefined && loneAccessors.get(name);\n if (accessor) {\n const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;\n const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;\n const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;\n const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;\n\n redefined = oldKind === newKind || oldStatic !== newStatic;\n if (!redefined) loneAccessors.delete(name);\n } else if (!redefined) {\n loneAccessors.set(name, elementType);\n }\n }\n if (redefined) {\n this.parser.raise(Errors.PrivateNameRedeclaration, {\n at: loc,\n identifierName: name\n });\n }\n privateNames.add(name);\n undefinedPrivateNames.delete(name);\n }\n usePrivateName(name, loc) {\n let classScope;\n for (classScope of this.stack) {\n if (classScope.privateNames.has(name)) return;\n }\n if (classScope) {\n classScope.undefinedPrivateNames.set(name, loc);\n } else {\n this.parser.raise(Errors.InvalidPrivateFieldResolution, {\n at: loc,\n identifierName: name\n });\n }\n }\n}\n\nconst kExpression = 0,\n kMaybeArrowParameterDeclaration = 1,\n kMaybeAsyncArrowParameterDeclaration = 2,\n kParameterDeclaration = 3;\nclass ExpressionScope {\n constructor(type = kExpression) {\n this.type = void 0;\n this.type = type;\n }\n canBeArrowParameterDeclaration() {\n return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration;\n }\n isCertainlyParameterDeclaration() {\n return this.type === kParameterDeclaration;\n }\n}\nclass ArrowHeadParsingScope extends ExpressionScope {\n constructor(type) {\n super(type);\n this.declarationErrors = new Map();\n }\n recordDeclarationError(ParsingErrorClass, {\n at\n }) {\n const index = at.index;\n this.declarationErrors.set(index, [ParsingErrorClass, at]);\n }\n clearDeclarationError(index) {\n this.declarationErrors.delete(index);\n }\n iterateErrors(iterator) {\n this.declarationErrors.forEach(iterator);\n }\n}\nclass ExpressionScopeHandler {\n constructor(parser) {\n this.parser = void 0;\n this.stack = [new ExpressionScope()];\n this.parser = parser;\n }\n enter(scope) {\n this.stack.push(scope);\n }\n exit() {\n this.stack.pop();\n }\n\n recordParameterInitializerError(toParseError, {\n at: node\n }) {\n const origin = {\n at: node.loc.start\n };\n const {\n stack\n } = this;\n let i = stack.length - 1;\n let scope = stack[i];\n while (!scope.isCertainlyParameterDeclaration()) {\n if (scope.canBeArrowParameterDeclaration()) {\n scope.recordDeclarationError(toParseError, origin);\n } else {\n return;\n }\n scope = stack[--i];\n }\n this.parser.raise(toParseError, origin);\n }\n\n recordArrowParemeterBindingError(error, {\n at: node\n }) {\n const {\n stack\n } = this;\n const scope = stack[stack.length - 1];\n const origin = {\n at: node.loc.start\n };\n if (scope.isCertainlyParameterDeclaration()) {\n this.parser.raise(error, origin);\n } else if (scope.canBeArrowParameterDeclaration()) {\n scope.recordDeclarationError(error, origin);\n } else {\n return;\n }\n }\n\n recordAsyncArrowParametersError({\n at\n }) {\n const {\n stack\n } = this;\n let i = stack.length - 1;\n let scope = stack[i];\n while (scope.canBeArrowParameterDeclaration()) {\n if (scope.type === kMaybeAsyncArrowParameterDeclaration) {\n scope.recordDeclarationError(Errors.AwaitBindingIdentifier, {\n at\n });\n }\n scope = stack[--i];\n }\n }\n validateAsPattern() {\n const {\n stack\n } = this;\n const currentScope = stack[stack.length - 1];\n if (!currentScope.canBeArrowParameterDeclaration()) return;\n currentScope.iterateErrors(([toParseError, loc]) => {\n this.parser.raise(toParseError, {\n at: loc\n });\n let i = stack.length - 2;\n let scope = stack[i];\n while (scope.canBeArrowParameterDeclaration()) {\n scope.clearDeclarationError(loc.index);\n scope = stack[--i];\n }\n });\n }\n}\nfunction newParameterDeclarationScope() {\n return new ExpressionScope(kParameterDeclaration);\n}\nfunction newArrowHeadScope() {\n return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);\n}\nfunction newAsyncArrowScope() {\n return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);\n}\nfunction newExpressionScope() {\n return new ExpressionScope();\n}\n\nconst\n PARAM = 0b0000,\n PARAM_YIELD = 0b0001,\n PARAM_AWAIT = 0b0010,\n PARAM_RETURN = 0b0100,\n PARAM_IN = 0b1000;\n\nclass ProductionParameterHandler {\n constructor() {\n this.stacks = [];\n }\n enter(flags) {\n this.stacks.push(flags);\n }\n exit() {\n this.stacks.pop();\n }\n currentFlags() {\n return this.stacks[this.stacks.length - 1];\n }\n get hasAwait() {\n return (this.currentFlags() & PARAM_AWAIT) > 0;\n }\n get hasYield() {\n return (this.currentFlags() & PARAM_YIELD) > 0;\n }\n get hasReturn() {\n return (this.currentFlags() & PARAM_RETURN) > 0;\n }\n get hasIn() {\n return (this.currentFlags() & PARAM_IN) > 0;\n }\n}\nfunction functionFlags(isAsync, isGenerator) {\n return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);\n}\n\nclass UtilParser extends Tokenizer {\n\n addExtra(node, key, value, enumerable = true) {\n if (!node) return;\n const extra = node.extra = node.extra || {};\n if (enumerable) {\n extra[key] = value;\n } else {\n Object.defineProperty(extra, key, {\n enumerable,\n value\n });\n }\n }\n\n isContextual(token) {\n return this.state.type === token && !this.state.containsEsc;\n }\n isUnparsedContextual(nameStart, name) {\n const nameEnd = nameStart + name.length;\n if (this.input.slice(nameStart, nameEnd) === name) {\n const nextCh = this.input.charCodeAt(nameEnd);\n return !(isIdentifierChar(nextCh) ||\n (nextCh & 0xfc00) === 0xd800);\n }\n return false;\n }\n isLookaheadContextual(name) {\n const next = this.nextTokenStart();\n return this.isUnparsedContextual(next, name);\n }\n\n eatContextual(token) {\n if (this.isContextual(token)) {\n this.next();\n return true;\n }\n return false;\n }\n\n expectContextual(token, toParseError) {\n if (!this.eatContextual(token)) {\n if (toParseError != null) {\n throw this.raise(toParseError, {\n at: this.state.startLoc\n });\n }\n throw this.unexpected(null, token);\n }\n }\n\n canInsertSemicolon() {\n return this.match(137) || this.match(8) || this.hasPrecedingLineBreak();\n }\n hasPrecedingLineBreak() {\n return lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start));\n }\n hasFollowingLineBreak() {\n skipWhiteSpaceToLineBreak.lastIndex = this.state.end;\n return skipWhiteSpaceToLineBreak.test(this.input);\n }\n\n isLineTerminator() {\n return this.eat(13) || this.canInsertSemicolon();\n }\n\n semicolon(allowAsi = true) {\n if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;\n this.raise(Errors.MissingSemicolon, {\n at: this.state.lastTokEndLoc\n });\n }\n\n expect(type, loc) {\n this.eat(type) || this.unexpected(loc, type);\n }\n\n tryParse(fn, oldState = this.state.clone()) {\n const abortSignal = {\n node: null\n };\n try {\n const node = fn((node = null) => {\n abortSignal.node = node;\n throw abortSignal;\n });\n if (this.state.errors.length > oldState.errors.length) {\n const failState = this.state;\n this.state = oldState;\n this.state.tokensLength = failState.tokensLength;\n return {\n node,\n error: failState.errors[oldState.errors.length],\n thrown: false,\n aborted: false,\n failState\n };\n }\n return {\n node,\n error: null,\n thrown: false,\n aborted: false,\n failState: null\n };\n } catch (error) {\n const failState = this.state;\n this.state = oldState;\n if (error instanceof SyntaxError) {\n return {\n node: null,\n error,\n thrown: true,\n aborted: false,\n failState\n };\n }\n if (error === abortSignal) {\n return {\n node: abortSignal.node,\n error: null,\n thrown: false,\n aborted: true,\n failState\n };\n }\n throw error;\n }\n }\n checkExpressionErrors(refExpressionErrors, andThrow) {\n if (!refExpressionErrors) return false;\n const {\n shorthandAssignLoc,\n doubleProtoLoc,\n privateKeyLoc,\n optionalParametersLoc\n } = refExpressionErrors;\n const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc;\n if (!andThrow) {\n return hasErrors;\n }\n if (shorthandAssignLoc != null) {\n this.raise(Errors.InvalidCoverInitializedName, {\n at: shorthandAssignLoc\n });\n }\n if (doubleProtoLoc != null) {\n this.raise(Errors.DuplicateProto, {\n at: doubleProtoLoc\n });\n }\n if (privateKeyLoc != null) {\n this.raise(Errors.UnexpectedPrivateField, {\n at: privateKeyLoc\n });\n }\n if (optionalParametersLoc != null) {\n this.unexpected(optionalParametersLoc);\n }\n }\n\n isLiteralPropertyName() {\n return tokenIsLiteralPropertyName(this.state.type);\n }\n\n isPrivateName(node) {\n return node.type === \"PrivateName\";\n }\n\n getPrivateNameSV(node) {\n return node.id.name;\n }\n\n hasPropertyAsPrivateName(node) {\n return (node.type === \"MemberExpression\" || node.type === \"OptionalMemberExpression\") && this.isPrivateName(node.property);\n }\n isOptionalChain(node) {\n return node.type === \"OptionalMemberExpression\" || node.type === \"OptionalCallExpression\";\n }\n isObjectProperty(node) {\n return node.type === \"ObjectProperty\";\n }\n isObjectMethod(node) {\n return node.type === \"ObjectMethod\";\n }\n initializeScopes(inModule = this.options.sourceType === \"module\") {\n const oldLabels = this.state.labels;\n this.state.labels = [];\n const oldExportedIdentifiers = this.exportedIdentifiers;\n this.exportedIdentifiers = new Set();\n\n const oldInModule = this.inModule;\n this.inModule = inModule;\n const oldScope = this.scope;\n const ScopeHandler = this.getScopeHandler();\n this.scope = new ScopeHandler(this, inModule);\n const oldProdParam = this.prodParam;\n this.prodParam = new ProductionParameterHandler();\n const oldClassScope = this.classScope;\n this.classScope = new ClassScopeHandler(this);\n const oldExpressionScope = this.expressionScope;\n this.expressionScope = new ExpressionScopeHandler(this);\n return () => {\n this.state.labels = oldLabels;\n this.exportedIdentifiers = oldExportedIdentifiers;\n\n this.inModule = oldInModule;\n this.scope = oldScope;\n this.prodParam = oldProdParam;\n this.classScope = oldClassScope;\n this.expressionScope = oldExpressionScope;\n };\n }\n enterInitialScopes() {\n let paramFlags = PARAM;\n if (this.inModule) {\n paramFlags |= PARAM_AWAIT;\n }\n this.scope.enter(SCOPE_PROGRAM);\n this.prodParam.enter(paramFlags);\n }\n checkDestructuringPrivate(refExpressionErrors) {\n const {\n privateKeyLoc\n } = refExpressionErrors;\n if (privateKeyLoc !== null) {\n this.expectPlugin(\"destructuringPrivate\", privateKeyLoc);\n }\n }\n}\n\nclass ExpressionErrors {\n constructor() {\n this.shorthandAssignLoc = null;\n this.doubleProtoLoc = null;\n this.privateKeyLoc = null;\n this.optionalParametersLoc = null;\n }\n}\n\nclass Node {\n constructor(parser, pos, loc) {\n this.type = \"\";\n this.start = pos;\n this.end = 0;\n this.loc = new SourceLocation(loc);\n if (parser != null && parser.options.ranges) this.range = [pos, 0];\n if (parser != null && parser.filename) this.loc.filename = parser.filename;\n }\n}\nconst NodePrototype = Node.prototype;\n{\n NodePrototype.__clone = function () {\n const newNode = new Node(undefined, this.start, this.loc.start);\n const keys = Object.keys(this);\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n if (key !== \"leadingComments\" && key !== \"trailingComments\" && key !== \"innerComments\") {\n newNode[key] = this[key];\n }\n }\n return newNode;\n };\n}\nfunction clonePlaceholder(node) {\n return cloneIdentifier(node);\n}\nfunction cloneIdentifier(node) {\n const {\n type,\n start,\n end,\n loc,\n range,\n extra,\n name\n } = node;\n const cloned = Object.create(NodePrototype);\n cloned.type = type;\n cloned.start = start;\n cloned.end = end;\n cloned.loc = loc;\n cloned.range = range;\n cloned.extra = extra;\n cloned.name = name;\n if (type === \"Placeholder\") {\n cloned.expectedNode = node.expectedNode;\n }\n return cloned;\n}\nfunction cloneStringLiteral(node) {\n const {\n type,\n start,\n end,\n loc,\n range,\n extra\n } = node;\n if (type === \"Placeholder\") {\n return clonePlaceholder(node);\n }\n const cloned = Object.create(NodePrototype);\n cloned.type = type;\n cloned.start = start;\n cloned.end = end;\n cloned.loc = loc;\n cloned.range = range;\n if (node.raw !== undefined) {\n cloned.raw = node.raw;\n } else {\n cloned.extra = extra;\n }\n cloned.value = node.value;\n return cloned;\n}\nclass NodeUtils extends UtilParser {\n startNode() {\n return new Node(this, this.state.start, this.state.startLoc);\n }\n startNodeAt(loc) {\n return new Node(this, loc.index, loc);\n }\n\n startNodeAtNode(type) {\n return this.startNodeAt(type.loc.start);\n }\n\n finishNode(node, type) {\n return this.finishNodeAt(node, type, this.state.lastTokEndLoc);\n }\n\n finishNodeAt(node, type, endLoc) {\n node.type = type;\n node.end = endLoc.index;\n node.loc.end = endLoc;\n if (this.options.ranges) node.range[1] = endLoc.index;\n if (this.options.attachComment) this.processComment(node);\n return node;\n }\n resetStartLocation(node, startLoc) {\n node.start = startLoc.index;\n node.loc.start = startLoc;\n if (this.options.ranges) node.range[0] = startLoc.index;\n }\n resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {\n node.end = endLoc.index;\n node.loc.end = endLoc;\n if (this.options.ranges) node.range[1] = endLoc.index;\n }\n\n resetStartLocationFromNode(node, locationNode) {\n this.resetStartLocation(node, locationNode.loc.start);\n }\n}\n\nconst reservedTypes = new Set([\"_\", \"any\", \"bool\", \"boolean\", \"empty\", \"extends\", \"false\", \"interface\", \"mixed\", \"null\", \"number\", \"static\", \"string\", \"true\", \"typeof\", \"void\"]);\n\nconst FlowErrors = ParseErrorEnum`flow`({\n AmbiguousConditionalArrow: \"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.\",\n AmbiguousDeclareModuleKind: \"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.\",\n AssignReservedType: ({\n reservedType\n }) => `Cannot overwrite reserved type ${reservedType}.`,\n DeclareClassElement: \"The `declare` modifier can only appear on class fields.\",\n DeclareClassFieldInitializer: \"Initializers are not allowed in fields with the `declare` modifier.\",\n DuplicateDeclareModuleExports: \"Duplicate `declare module.exports` statement.\",\n EnumBooleanMemberNotInitialized: ({\n memberName,\n enumName\n }) => `Boolean enum members need to be initialized. Use either \\`${memberName} = true,\\` or \\`${memberName} = false,\\` in enum \\`${enumName}\\`.`,\n EnumDuplicateMemberName: ({\n memberName,\n enumName\n }) => `Enum member names need to be unique, but the name \\`${memberName}\\` has already been used before in enum \\`${enumName}\\`.`,\n EnumInconsistentMemberValues: ({\n enumName\n }) => `Enum \\`${enumName}\\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,\n EnumInvalidExplicitType: ({\n invalidEnumType,\n enumName\n }) => `Enum type \\`${invalidEnumType}\\` is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n EnumInvalidExplicitTypeUnknownSupplied: ({\n enumName\n }) => `Supplied enum type is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n EnumInvalidMemberInitializerPrimaryType: ({\n enumName,\n memberName,\n explicitType\n }) => `Enum \\`${enumName}\\` has type \\`${explicitType}\\`, so the initializer of \\`${memberName}\\` needs to be a ${explicitType} literal.`,\n EnumInvalidMemberInitializerSymbolType: ({\n enumName,\n memberName\n }) => `Symbol enum members cannot be initialized. Use \\`${memberName},\\` in enum \\`${enumName}\\`.`,\n EnumInvalidMemberInitializerUnknownType: ({\n enumName,\n memberName\n }) => `The enum member initializer for \\`${memberName}\\` needs to be a literal (either a boolean, number, or string) in enum \\`${enumName}\\`.`,\n EnumInvalidMemberName: ({\n enumName,\n memberName,\n suggestion\n }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \\`${memberName}\\`, consider using \\`${suggestion}\\`, in enum \\`${enumName}\\`.`,\n EnumNumberMemberNotInitialized: ({\n enumName,\n memberName\n }) => `Number enum members need to be initialized, e.g. \\`${memberName} = 1\\` in enum \\`${enumName}\\`.`,\n EnumStringMemberInconsistentlyInitailized: ({\n enumName\n }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \\`${enumName}\\`.`,\n GetterMayNotHaveThisParam: \"A getter cannot have a `this` parameter.\",\n ImportReflectionHasImportType: \"An `import module` declaration can not use `type` or `typeof` keyword.\",\n ImportTypeShorthandOnlyInPureImport: \"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.\",\n InexactInsideExact: \"Explicit inexact syntax cannot appear inside an explicit exact object type.\",\n InexactInsideNonObject: \"Explicit inexact syntax cannot appear in class or interface definitions.\",\n InexactVariance: \"Explicit inexact syntax cannot have variance.\",\n InvalidNonTypeImportInDeclareModule: \"Imports within a `declare module` body must always be `import type` or `import typeof`.\",\n MissingTypeParamDefault: \"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.\",\n NestedDeclareModule: \"`declare module` cannot be used inside another `declare module`.\",\n NestedFlowComment: \"Cannot have a flow comment inside another flow comment.\",\n PatternIsOptional: Object.assign({\n message: \"A binding pattern parameter cannot be optional in an implementation signature.\"\n }, {\n reasonCode: \"OptionalBindingPattern\"\n }),\n SetterMayNotHaveThisParam: \"A setter cannot have a `this` parameter.\",\n SpreadVariance: \"Spread properties cannot have variance.\",\n ThisParamAnnotationRequired: \"A type annotation is required for the `this` parameter.\",\n ThisParamBannedInConstructor: \"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.\",\n ThisParamMayNotBeOptional: \"The `this` parameter cannot be optional.\",\n ThisParamMustBeFirst: \"The `this` parameter must be the first function parameter.\",\n ThisParamNoDefault: \"The `this` parameter may not have a default value.\",\n TypeBeforeInitializer: \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.\",\n TypeCastInPattern: \"The type cast expression is expected to be wrapped with parenthesis.\",\n UnexpectedExplicitInexactInObject: \"Explicit inexact syntax must appear at the end of an inexact object.\",\n UnexpectedReservedType: ({\n reservedType\n }) => `Unexpected reserved type ${reservedType}.`,\n UnexpectedReservedUnderscore: \"`_` is only allowed as a type argument to call or new.\",\n UnexpectedSpaceBetweenModuloChecks: \"Spaces between `%` and `checks` are not allowed here.\",\n UnexpectedSpreadType: \"Spread operator cannot appear in class or interface definitions.\",\n UnexpectedSubtractionOperand: 'Unexpected token, expected \"number\" or \"bigint\".',\n UnexpectedTokenAfterTypeParameter: \"Expected an arrow function after this type parameter declaration.\",\n UnexpectedTypeParameterBeforeAsyncArrowFunction: \"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.\",\n UnsupportedDeclareExportKind: ({\n unsupportedExportKind,\n suggestion\n }) => `\\`declare export ${unsupportedExportKind}\\` is not supported. Use \\`${suggestion}\\` instead.`,\n UnsupportedStatementInDeclareModule: \"Only declares and type imports are allowed inside declare module.\",\n UnterminatedFlowComment: \"Unterminated flow-comment.\"\n});\n\nfunction isEsModuleType(bodyElement) {\n return bodyElement.type === \"DeclareExportAllDeclaration\" || bodyElement.type === \"DeclareExportDeclaration\" && (!bodyElement.declaration || bodyElement.declaration.type !== \"TypeAlias\" && bodyElement.declaration.type !== \"InterfaceDeclaration\");\n}\nfunction hasTypeImportKind(node) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n}\nfunction isMaybeDefaultImport(type) {\n return tokenIsKeywordOrIdentifier(type) && type !== 97;\n}\nconst exportSuggestions = {\n const: \"declare export var\",\n let: \"declare export var\",\n type: \"export type\",\n interface: \"export interface\"\n};\n\nfunction partition(list, test) {\n const list1 = [];\n const list2 = [];\n for (let i = 0; i < list.length; i++) {\n (test(list[i], i, list) ? list1 : list2).push(list[i]);\n }\n return [list1, list2];\n}\nconst FLOW_PRAGMA_REGEX = /\\*?\\s*@((?:no)?flow)\\b/;\n\nvar flow = (superClass => class FlowParserMixin extends superClass {\n constructor(...args) {\n super(...args);\n this.flowPragma = undefined;\n }\n getScopeHandler() {\n return FlowScopeHandler;\n }\n shouldParseTypes() {\n return this.getPluginOption(\"flow\", \"all\") || this.flowPragma === \"flow\";\n }\n shouldParseEnums() {\n return !!this.getPluginOption(\"flow\", \"enums\");\n }\n finishToken(type, val) {\n if (type !== 131 && type !== 13 && type !== 28) {\n if (this.flowPragma === undefined) {\n this.flowPragma = null;\n }\n }\n return super.finishToken(type, val);\n }\n addComment(comment) {\n if (this.flowPragma === undefined) {\n const matches = FLOW_PRAGMA_REGEX.exec(comment.value);\n if (!matches) ; else if (matches[1] === \"flow\") {\n this.flowPragma = \"flow\";\n } else if (matches[1] === \"noflow\") {\n this.flowPragma = \"noflow\";\n } else {\n throw new Error(\"Unexpected flow pragma\");\n }\n }\n return super.addComment(comment);\n }\n flowParseTypeInitialiser(tok) {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tok || 14);\n const type = this.flowParseType();\n this.state.inType = oldInType;\n return type;\n }\n flowParsePredicate() {\n const node = this.startNode();\n const moduloLoc = this.state.startLoc;\n this.next();\n this.expectContextual(108);\n if (this.state.lastTokStart > moduloLoc.index + 1) {\n this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, {\n at: moduloLoc\n });\n }\n if (this.eat(10)) {\n node.value = super.parseExpression();\n this.expect(11);\n return this.finishNode(node, \"DeclaredPredicate\");\n } else {\n return this.finishNode(node, \"InferredPredicate\");\n }\n }\n flowParseTypeAndPredicateInitialiser() {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(14);\n let type = null;\n let predicate = null;\n if (this.match(54)) {\n this.state.inType = oldInType;\n predicate = this.flowParsePredicate();\n } else {\n type = this.flowParseType();\n this.state.inType = oldInType;\n if (this.match(54)) {\n predicate = this.flowParsePredicate();\n }\n }\n return [type, predicate];\n }\n flowParseDeclareClass(node) {\n this.next();\n this.flowParseInterfaceish(node, true);\n return this.finishNode(node, \"DeclareClass\");\n }\n flowParseDeclareFunction(node) {\n this.next();\n const id = node.id = this.parseIdentifier();\n const typeNode = this.startNode();\n const typeContainer = this.startNode();\n if (this.match(47)) {\n typeNode.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n typeNode.typeParameters = null;\n }\n this.expect(10);\n const tmp = this.flowParseFunctionTypeParams();\n typeNode.params = tmp.params;\n typeNode.rest = tmp.rest;\n typeNode.this = tmp._this;\n this.expect(11);\n [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();\n typeContainer.typeAnnotation = this.finishNode(typeNode, \"FunctionTypeAnnotation\");\n id.typeAnnotation = this.finishNode(typeContainer, \"TypeAnnotation\");\n this.resetEndLocation(id);\n this.semicolon();\n this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.loc.start);\n return this.finishNode(node, \"DeclareFunction\");\n }\n flowParseDeclare(node, insideModule) {\n if (this.match(80)) {\n return this.flowParseDeclareClass(node);\n } else if (this.match(68)) {\n return this.flowParseDeclareFunction(node);\n } else if (this.match(74)) {\n return this.flowParseDeclareVariable(node);\n } else if (this.eatContextual(125)) {\n if (this.match(16)) {\n return this.flowParseDeclareModuleExports(node);\n } else {\n if (insideModule) {\n this.raise(FlowErrors.NestedDeclareModule, {\n at: this.state.lastTokStartLoc\n });\n }\n return this.flowParseDeclareModule(node);\n }\n } else if (this.isContextual(128)) {\n return this.flowParseDeclareTypeAlias(node);\n } else if (this.isContextual(129)) {\n return this.flowParseDeclareOpaqueType(node);\n } else if (this.isContextual(127)) {\n return this.flowParseDeclareInterface(node);\n } else if (this.match(82)) {\n return this.flowParseDeclareExportDeclaration(node, insideModule);\n } else {\n throw this.unexpected();\n }\n }\n flowParseDeclareVariable(node) {\n this.next();\n node.id = this.flowParseTypeAnnotatableIdentifier(true);\n this.scope.declareName(node.id.name, BIND_VAR, node.id.loc.start);\n this.semicolon();\n return this.finishNode(node, \"DeclareVariable\");\n }\n flowParseDeclareModule(node) {\n this.scope.enter(SCOPE_OTHER);\n if (this.match(131)) {\n node.id = super.parseExprAtom();\n } else {\n node.id = this.parseIdentifier();\n }\n const bodyNode = node.body = this.startNode();\n const body = bodyNode.body = [];\n this.expect(5);\n while (!this.match(8)) {\n let bodyNode = this.startNode();\n if (this.match(83)) {\n this.next();\n if (!this.isContextual(128) && !this.match(87)) {\n this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, {\n at: this.state.lastTokStartLoc\n });\n }\n super.parseImport(bodyNode);\n } else {\n this.expectContextual(123, FlowErrors.UnsupportedStatementInDeclareModule);\n bodyNode = this.flowParseDeclare(bodyNode, true);\n }\n body.push(bodyNode);\n }\n this.scope.exit();\n this.expect(8);\n this.finishNode(bodyNode, \"BlockStatement\");\n let kind = null;\n let hasModuleExport = false;\n body.forEach(bodyElement => {\n if (isEsModuleType(bodyElement)) {\n if (kind === \"CommonJS\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, {\n at: bodyElement\n });\n }\n kind = \"ES\";\n } else if (bodyElement.type === \"DeclareModuleExports\") {\n if (hasModuleExport) {\n this.raise(FlowErrors.DuplicateDeclareModuleExports, {\n at: bodyElement\n });\n }\n if (kind === \"ES\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, {\n at: bodyElement\n });\n }\n kind = \"CommonJS\";\n hasModuleExport = true;\n }\n });\n node.kind = kind || \"CommonJS\";\n return this.finishNode(node, \"DeclareModule\");\n }\n flowParseDeclareExportDeclaration(node, insideModule) {\n this.expect(82);\n if (this.eat(65)) {\n if (this.match(68) || this.match(80)) {\n node.declaration = this.flowParseDeclare(this.startNode());\n } else {\n node.declaration = this.flowParseType();\n this.semicolon();\n }\n node.default = true;\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else {\n if (this.match(75) || this.isLet() || (this.isContextual(128) || this.isContextual(127)) && !insideModule) {\n const label = this.state.value;\n throw this.raise(FlowErrors.UnsupportedDeclareExportKind, {\n at: this.state.startLoc,\n unsupportedExportKind: label,\n suggestion: exportSuggestions[label]\n });\n }\n if (this.match(74) ||\n this.match(68) ||\n this.match(80) ||\n this.isContextual(129)) {\n node.declaration = this.flowParseDeclare(this.startNode());\n node.default = false;\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else if (this.match(55) ||\n this.match(5) ||\n this.isContextual(127) ||\n this.isContextual(128) ||\n this.isContextual(129)) {\n node = this.parseExport(node, null);\n if (node.type === \"ExportNamedDeclaration\") {\n node.type = \"ExportDeclaration\";\n node.default = false;\n delete node.exportKind;\n }\n node.type = \"Declare\" + node.type;\n return node;\n }\n }\n throw this.unexpected();\n }\n flowParseDeclareModuleExports(node) {\n this.next();\n this.expectContextual(109);\n node.typeAnnotation = this.flowParseTypeAnnotation();\n this.semicolon();\n return this.finishNode(node, \"DeclareModuleExports\");\n }\n flowParseDeclareTypeAlias(node) {\n this.next();\n const finished = this.flowParseTypeAlias(node);\n finished.type = \"DeclareTypeAlias\";\n return finished;\n }\n flowParseDeclareOpaqueType(node) {\n this.next();\n const finished = this.flowParseOpaqueType(node, true);\n finished.type = \"DeclareOpaqueType\";\n return finished;\n }\n flowParseDeclareInterface(node) {\n this.next();\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"DeclareInterface\");\n }\n\n flowParseInterfaceish(node, isClass = false) {\n node.id = this.flowParseRestrictedIdentifier(!isClass, true);\n this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.loc.start);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n node.extends = [];\n node.implements = [];\n node.mixins = [];\n if (this.eat(81)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (!isClass && this.eat(12));\n }\n if (this.isContextual(115)) {\n this.next();\n do {\n node.mixins.push(this.flowParseInterfaceExtends());\n } while (this.eat(12));\n }\n if (this.isContextual(111)) {\n this.next();\n do {\n node.implements.push(this.flowParseInterfaceExtends());\n } while (this.eat(12));\n }\n node.body = this.flowParseObjectType({\n allowStatic: isClass,\n allowExact: false,\n allowSpread: false,\n allowProto: isClass,\n allowInexact: false\n });\n }\n flowParseInterfaceExtends() {\n const node = this.startNode();\n node.id = this.flowParseQualifiedTypeIdentifier();\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n return this.finishNode(node, \"InterfaceExtends\");\n }\n flowParseInterface(node) {\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"InterfaceDeclaration\");\n }\n checkNotUnderscore(word) {\n if (word === \"_\") {\n this.raise(FlowErrors.UnexpectedReservedUnderscore, {\n at: this.state.startLoc\n });\n }\n }\n checkReservedType(word, startLoc, declaration) {\n if (!reservedTypes.has(word)) return;\n this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, {\n at: startLoc,\n reservedType: word\n });\n }\n flowParseRestrictedIdentifier(liberal, declaration) {\n this.checkReservedType(this.state.value, this.state.startLoc, declaration);\n return this.parseIdentifier(liberal);\n }\n\n flowParseTypeAlias(node) {\n node.id = this.flowParseRestrictedIdentifier(false, true);\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n node.right = this.flowParseTypeInitialiser(29);\n this.semicolon();\n return this.finishNode(node, \"TypeAlias\");\n }\n flowParseOpaqueType(node, declare) {\n this.expectContextual(128);\n node.id = this.flowParseRestrictedIdentifier(true, true);\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.supertype = null;\n if (this.match(14)) {\n node.supertype = this.flowParseTypeInitialiser(14);\n }\n node.impltype = null;\n if (!declare) {\n node.impltype = this.flowParseTypeInitialiser(29);\n }\n this.semicolon();\n return this.finishNode(node, \"OpaqueType\");\n }\n\n flowParseTypeParameter(requireDefault = false) {\n const nodeStartLoc = this.state.startLoc;\n const node = this.startNode();\n const variance = this.flowParseVariance();\n const ident = this.flowParseTypeAnnotatableIdentifier();\n node.name = ident.name;\n node.variance = variance;\n node.bound = ident.typeAnnotation;\n if (this.match(29)) {\n this.eat(29);\n node.default = this.flowParseType();\n } else {\n if (requireDefault) {\n this.raise(FlowErrors.MissingTypeParamDefault, {\n at: nodeStartLoc\n });\n }\n }\n return this.finishNode(node, \"TypeParameter\");\n }\n flowParseTypeParameterDeclaration() {\n const oldInType = this.state.inType;\n const node = this.startNode();\n node.params = [];\n this.state.inType = true;\n\n if (this.match(47) || this.match(140)) {\n this.next();\n } else {\n this.unexpected();\n }\n let defaultRequired = false;\n do {\n const typeParameter = this.flowParseTypeParameter(defaultRequired);\n node.params.push(typeParameter);\n if (typeParameter.default) {\n defaultRequired = true;\n }\n if (!this.match(48)) {\n this.expect(12);\n }\n } while (!this.match(48));\n this.expect(48);\n this.state.inType = oldInType;\n return this.finishNode(node, \"TypeParameterDeclaration\");\n }\n flowParseTypeParameterInstantiation() {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n this.state.inType = true;\n this.expect(47);\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = false;\n while (!this.match(48)) {\n node.params.push(this.flowParseType());\n if (!this.match(48)) {\n this.expect(12);\n }\n }\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n this.expect(48);\n this.state.inType = oldInType;\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n flowParseTypeParameterInstantiationCallOrNew() {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n this.state.inType = true;\n this.expect(47);\n while (!this.match(48)) {\n node.params.push(this.flowParseTypeOrImplicitInstantiation());\n if (!this.match(48)) {\n this.expect(12);\n }\n }\n this.expect(48);\n this.state.inType = oldInType;\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n flowParseInterfaceType() {\n const node = this.startNode();\n this.expectContextual(127);\n node.extends = [];\n if (this.eat(81)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (this.eat(12));\n }\n node.body = this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: false,\n allowProto: false,\n allowInexact: false\n });\n return this.finishNode(node, \"InterfaceTypeAnnotation\");\n }\n flowParseObjectPropertyKey() {\n return this.match(132) || this.match(131) ? super.parseExprAtom() : this.parseIdentifier(true);\n }\n flowParseObjectTypeIndexer(node, isStatic, variance) {\n node.static = isStatic;\n\n if (this.lookahead().type === 14) {\n node.id = this.flowParseObjectPropertyKey();\n node.key = this.flowParseTypeInitialiser();\n } else {\n node.id = null;\n node.key = this.flowParseType();\n }\n this.expect(3);\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n return this.finishNode(node, \"ObjectTypeIndexer\");\n }\n flowParseObjectTypeInternalSlot(node, isStatic) {\n node.static = isStatic;\n node.id = this.flowParseObjectPropertyKey();\n this.expect(3);\n this.expect(3);\n if (this.match(47) || this.match(10)) {\n node.method = true;\n node.optional = false;\n node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start));\n } else {\n node.method = false;\n if (this.eat(17)) {\n node.optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n }\n return this.finishNode(node, \"ObjectTypeInternalSlot\");\n }\n flowParseObjectTypeMethodish(node) {\n node.params = [];\n node.rest = null;\n node.typeParameters = null;\n node.this = null;\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n this.expect(10);\n if (this.match(78)) {\n node.this = this.flowParseFunctionTypeParam(true);\n node.this.name = null;\n if (!this.match(11)) {\n this.expect(12);\n }\n }\n while (!this.match(11) && !this.match(21)) {\n node.params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(11)) {\n this.expect(12);\n }\n }\n if (this.eat(21)) {\n node.rest = this.flowParseFunctionTypeParam(false);\n }\n this.expect(11);\n node.returnType = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n flowParseObjectTypeCallProperty(node, isStatic) {\n const valueNode = this.startNode();\n node.static = isStatic;\n node.value = this.flowParseObjectTypeMethodish(valueNode);\n return this.finishNode(node, \"ObjectTypeCallProperty\");\n }\n flowParseObjectType({\n allowStatic,\n allowExact,\n allowSpread,\n allowProto,\n allowInexact\n }) {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const nodeStart = this.startNode();\n nodeStart.callProperties = [];\n nodeStart.properties = [];\n nodeStart.indexers = [];\n nodeStart.internalSlots = [];\n let endDelim;\n let exact;\n let inexact = false;\n if (allowExact && this.match(6)) {\n this.expect(6);\n endDelim = 9;\n exact = true;\n } else {\n this.expect(5);\n endDelim = 8;\n exact = false;\n }\n nodeStart.exact = exact;\n while (!this.match(endDelim)) {\n let isStatic = false;\n let protoStartLoc = null;\n let inexactStartLoc = null;\n const node = this.startNode();\n if (allowProto && this.isContextual(116)) {\n const lookahead = this.lookahead();\n if (lookahead.type !== 14 && lookahead.type !== 17) {\n this.next();\n protoStartLoc = this.state.startLoc;\n allowStatic = false;\n }\n }\n if (allowStatic && this.isContextual(104)) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== 14 && lookahead.type !== 17) {\n this.next();\n isStatic = true;\n }\n }\n const variance = this.flowParseVariance();\n if (this.eat(0)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (this.eat(0)) {\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));\n } else {\n nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));\n }\n } else if (this.match(10) || this.match(47)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));\n } else {\n let kind = \"init\";\n if (this.isContextual(98) || this.isContextual(103)) {\n const lookahead = this.lookahead();\n if (tokenIsLiteralPropertyName(lookahead.type)) {\n kind = this.state.value;\n this.next();\n }\n }\n const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);\n if (propOrInexact === null) {\n inexact = true;\n inexactStartLoc = this.state.lastTokStartLoc;\n } else {\n nodeStart.properties.push(propOrInexact);\n }\n }\n this.flowObjectTypeSemicolon();\n if (inexactStartLoc && !this.match(8) && !this.match(9)) {\n this.raise(FlowErrors.UnexpectedExplicitInexactInObject, {\n at: inexactStartLoc\n });\n }\n }\n this.expect(endDelim);\n\n if (allowSpread) {\n nodeStart.inexact = inexact;\n }\n const out = this.finishNode(nodeStart, \"ObjectTypeAnnotation\");\n this.state.inType = oldInType;\n return out;\n }\n flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) {\n if (this.eat(21)) {\n const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9);\n if (isInexactToken) {\n if (!allowSpread) {\n this.raise(FlowErrors.InexactInsideNonObject, {\n at: this.state.lastTokStartLoc\n });\n } else if (!allowInexact) {\n this.raise(FlowErrors.InexactInsideExact, {\n at: this.state.lastTokStartLoc\n });\n }\n if (variance) {\n this.raise(FlowErrors.InexactVariance, {\n at: variance\n });\n }\n return null;\n }\n if (!allowSpread) {\n this.raise(FlowErrors.UnexpectedSpreadType, {\n at: this.state.lastTokStartLoc\n });\n }\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.raise(FlowErrors.SpreadVariance, {\n at: variance\n });\n }\n node.argument = this.flowParseType();\n return this.finishNode(node, \"ObjectTypeSpreadProperty\");\n } else {\n node.key = this.flowParseObjectPropertyKey();\n node.static = isStatic;\n node.proto = protoStartLoc != null;\n node.kind = kind;\n let optional = false;\n if (this.match(47) || this.match(10)) {\n node.method = true;\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start));\n if (kind === \"get\" || kind === \"set\") {\n this.flowCheckGetterSetterParams(node);\n }\n if (!allowSpread && node.key.name === \"constructor\" && node.value.this) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, {\n at: node.value.this\n });\n }\n } else {\n if (kind !== \"init\") this.unexpected();\n node.method = false;\n if (this.eat(17)) {\n optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n }\n node.optional = optional;\n return this.finishNode(node, \"ObjectTypeProperty\");\n }\n }\n\n flowCheckGetterSetterParams(property) {\n const paramCount = property.kind === \"get\" ? 0 : 1;\n const length = property.value.params.length + (property.value.rest ? 1 : 0);\n if (property.value.this) {\n this.raise(property.kind === \"get\" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, {\n at: property.value.this\n });\n }\n if (length !== paramCount) {\n this.raise(property.kind === \"get\" ? Errors.BadGetterArity : Errors.BadSetterArity, {\n at: property\n });\n }\n if (property.kind === \"set\" && property.value.rest) {\n this.raise(Errors.BadSetterRestParameter, {\n at: property\n });\n }\n }\n flowObjectTypeSemicolon() {\n if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) {\n this.unexpected();\n }\n }\n flowParseQualifiedTypeIdentifier(startLoc, id) {\n var _startLoc;\n (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;\n let node = id || this.flowParseRestrictedIdentifier(true);\n while (this.eat(16)) {\n const node2 = this.startNodeAt(startLoc);\n node2.qualification = node;\n node2.id = this.flowParseRestrictedIdentifier(true);\n node = this.finishNode(node2, \"QualifiedTypeIdentifier\");\n }\n return node;\n }\n flowParseGenericType(startLoc, id) {\n const node = this.startNodeAt(startLoc);\n node.typeParameters = null;\n node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n }\n return this.finishNode(node, \"GenericTypeAnnotation\");\n }\n flowParseTypeofType() {\n const node = this.startNode();\n this.expect(87);\n node.argument = this.flowParsePrimaryType();\n return this.finishNode(node, \"TypeofTypeAnnotation\");\n }\n flowParseTupleType() {\n const node = this.startNode();\n node.types = [];\n this.expect(0);\n while (this.state.pos < this.length && !this.match(3)) {\n node.types.push(this.flowParseType());\n if (this.match(3)) break;\n this.expect(12);\n }\n this.expect(3);\n return this.finishNode(node, \"TupleTypeAnnotation\");\n }\n flowParseFunctionTypeParam(first) {\n let name = null;\n let optional = false;\n let typeAnnotation = null;\n const node = this.startNode();\n const lh = this.lookahead();\n const isThis = this.state.type === 78;\n if (lh.type === 14 || lh.type === 17) {\n if (isThis && !first) {\n this.raise(FlowErrors.ThisParamMustBeFirst, {\n at: node\n });\n }\n name = this.parseIdentifier(isThis);\n if (this.eat(17)) {\n optional = true;\n if (isThis) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, {\n at: node\n });\n }\n }\n typeAnnotation = this.flowParseTypeInitialiser();\n } else {\n typeAnnotation = this.flowParseType();\n }\n node.name = name;\n node.optional = optional;\n node.typeAnnotation = typeAnnotation;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n reinterpretTypeAsFunctionTypeParam(type) {\n const node = this.startNodeAt(type.loc.start);\n node.name = null;\n node.optional = false;\n node.typeAnnotation = type;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n flowParseFunctionTypeParams(params = []) {\n let rest = null;\n let _this = null;\n if (this.match(78)) {\n _this = this.flowParseFunctionTypeParam(true);\n _this.name = null;\n if (!this.match(11)) {\n this.expect(12);\n }\n }\n while (!this.match(11) && !this.match(21)) {\n params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(11)) {\n this.expect(12);\n }\n }\n if (this.eat(21)) {\n rest = this.flowParseFunctionTypeParam(false);\n }\n return {\n params,\n rest,\n _this\n };\n }\n flowIdentToTypeAnnotation(startLoc, node, id) {\n switch (id.name) {\n case \"any\":\n return this.finishNode(node, \"AnyTypeAnnotation\");\n case \"bool\":\n case \"boolean\":\n return this.finishNode(node, \"BooleanTypeAnnotation\");\n case \"mixed\":\n return this.finishNode(node, \"MixedTypeAnnotation\");\n case \"empty\":\n return this.finishNode(node, \"EmptyTypeAnnotation\");\n case \"number\":\n return this.finishNode(node, \"NumberTypeAnnotation\");\n case \"string\":\n return this.finishNode(node, \"StringTypeAnnotation\");\n case \"symbol\":\n return this.finishNode(node, \"SymbolTypeAnnotation\");\n default:\n this.checkNotUnderscore(id.name);\n return this.flowParseGenericType(startLoc, id);\n }\n }\n\n flowParsePrimaryType() {\n const startLoc = this.state.startLoc;\n const node = this.startNode();\n let tmp;\n let type;\n let isGroupedType = false;\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n switch (this.state.type) {\n case 5:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: true,\n allowProto: false,\n allowInexact: true\n });\n case 6:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: true,\n allowSpread: true,\n allowProto: false,\n allowInexact: false\n });\n case 0:\n this.state.noAnonFunctionType = false;\n type = this.flowParseTupleType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n return type;\n case 47:\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n this.expect(10);\n tmp = this.flowParseFunctionTypeParams();\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n this.expect(11);\n this.expect(19);\n node.returnType = this.flowParseType();\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n case 10:\n this.next();\n\n if (!this.match(11) && !this.match(21)) {\n if (tokenIsIdentifier(this.state.type) || this.match(78)) {\n const token = this.lookahead().type;\n isGroupedType = token !== 17 && token !== 14;\n } else {\n isGroupedType = true;\n }\n }\n if (isGroupedType) {\n this.state.noAnonFunctionType = false;\n type = this.flowParseType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) {\n this.expect(11);\n return type;\n } else {\n this.eat(12);\n }\n }\n if (type) {\n tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);\n } else {\n tmp = this.flowParseFunctionTypeParams();\n }\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n this.expect(11);\n this.expect(19);\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n case 131:\n return this.parseLiteral(this.state.value, \"StringLiteralTypeAnnotation\");\n case 85:\n case 86:\n node.value = this.match(85);\n this.next();\n return this.finishNode(node, \"BooleanLiteralTypeAnnotation\");\n case 53:\n if (this.state.value === \"-\") {\n this.next();\n if (this.match(132)) {\n return this.parseLiteralAtNode(-this.state.value, \"NumberLiteralTypeAnnotation\", node);\n }\n if (this.match(133)) {\n return this.parseLiteralAtNode(-this.state.value, \"BigIntLiteralTypeAnnotation\", node);\n }\n throw this.raise(FlowErrors.UnexpectedSubtractionOperand, {\n at: this.state.startLoc\n });\n }\n throw this.unexpected();\n case 132:\n return this.parseLiteral(this.state.value, \"NumberLiteralTypeAnnotation\");\n case 133:\n return this.parseLiteral(this.state.value, \"BigIntLiteralTypeAnnotation\");\n case 88:\n this.next();\n return this.finishNode(node, \"VoidTypeAnnotation\");\n case 84:\n this.next();\n return this.finishNode(node, \"NullLiteralTypeAnnotation\");\n case 78:\n this.next();\n return this.finishNode(node, \"ThisTypeAnnotation\");\n case 55:\n this.next();\n return this.finishNode(node, \"ExistsTypeAnnotation\");\n case 87:\n return this.flowParseTypeofType();\n default:\n if (tokenIsKeyword(this.state.type)) {\n const label = tokenLabelName(this.state.type);\n this.next();\n return super.createIdentifier(node, label);\n } else if (tokenIsIdentifier(this.state.type)) {\n if (this.isContextual(127)) {\n return this.flowParseInterfaceType();\n }\n return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier());\n }\n }\n throw this.unexpected();\n }\n flowParsePostfixType() {\n const startLoc = this.state.startLoc;\n let type = this.flowParsePrimaryType();\n let seenOptionalIndexedAccess = false;\n while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt(startLoc);\n const optional = this.eat(18);\n seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;\n this.expect(0);\n if (!optional && this.match(3)) {\n node.elementType = type;\n this.next();\n type = this.finishNode(node, \"ArrayTypeAnnotation\");\n } else {\n node.objectType = type;\n node.indexType = this.flowParseType();\n this.expect(3);\n if (seenOptionalIndexedAccess) {\n node.optional = optional;\n type = this.finishNode(\n node, \"OptionalIndexedAccessType\");\n } else {\n type = this.finishNode(\n node, \"IndexedAccessType\");\n }\n }\n }\n return type;\n }\n flowParsePrefixType() {\n const node = this.startNode();\n if (this.eat(17)) {\n node.typeAnnotation = this.flowParsePrefixType();\n return this.finishNode(node, \"NullableTypeAnnotation\");\n } else {\n return this.flowParsePostfixType();\n }\n }\n flowParseAnonFunctionWithoutParens() {\n const param = this.flowParsePrefixType();\n if (!this.state.noAnonFunctionType && this.eat(19)) {\n const node = this.startNodeAt(param.loc.start);\n node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];\n node.rest = null;\n node.this = null;\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n return param;\n }\n flowParseIntersectionType() {\n const node = this.startNode();\n this.eat(45);\n const type = this.flowParseAnonFunctionWithoutParens();\n node.types = [type];\n while (this.eat(45)) {\n node.types.push(this.flowParseAnonFunctionWithoutParens());\n }\n return node.types.length === 1 ? type : this.finishNode(node, \"IntersectionTypeAnnotation\");\n }\n flowParseUnionType() {\n const node = this.startNode();\n this.eat(43);\n const type = this.flowParseIntersectionType();\n node.types = [type];\n while (this.eat(43)) {\n node.types.push(this.flowParseIntersectionType());\n }\n return node.types.length === 1 ? type : this.finishNode(node, \"UnionTypeAnnotation\");\n }\n flowParseType() {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const type = this.flowParseUnionType();\n this.state.inType = oldInType;\n return type;\n }\n flowParseTypeOrImplicitInstantiation() {\n if (this.state.type === 130 && this.state.value === \"_\") {\n const startLoc = this.state.startLoc;\n const node = this.parseIdentifier();\n return this.flowParseGenericType(startLoc, node);\n } else {\n return this.flowParseType();\n }\n }\n flowParseTypeAnnotation() {\n const node = this.startNode();\n node.typeAnnotation = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"TypeAnnotation\");\n }\n flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {\n const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();\n if (this.match(14)) {\n ident.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(ident);\n }\n return ident;\n }\n typeCastToParameter(node) {\n node.expression.typeAnnotation = node.typeAnnotation;\n this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);\n return node.expression;\n }\n flowParseVariance() {\n let variance = null;\n if (this.match(53)) {\n variance = this.startNode();\n if (this.state.value === \"+\") {\n variance.kind = \"plus\";\n } else {\n variance.kind = \"minus\";\n }\n this.next();\n return this.finishNode(variance, \"Variance\");\n }\n return variance;\n }\n\n parseFunctionBody(node, allowExpressionBody, isMethod = false) {\n if (allowExpressionBody) {\n return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));\n }\n return super.parseFunctionBody(node, false, isMethod);\n }\n parseFunctionBodyAndFinish(node, type, isMethod = false) {\n if (this.match(14)) {\n const typeNode = this.startNode();\n [typeNode.typeAnnotation,\n node.predicate] = this.flowParseTypeAndPredicateInitialiser();\n node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, \"TypeAnnotation\") : null;\n }\n return super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n parseStatementLike(flags) {\n if (this.state.strict && this.isContextual(127)) {\n const lookahead = this.lookahead();\n if (tokenIsKeywordOrIdentifier(lookahead.type)) {\n const node = this.startNode();\n this.next();\n return this.flowParseInterface(node);\n }\n } else if (this.shouldParseEnums() && this.isContextual(124)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n const stmt = super.parseStatementLike(flags);\n if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {\n this.flowPragma = null;\n }\n return stmt;\n }\n\n parseExpressionStatement(node, expr, decorators) {\n if (expr.type === \"Identifier\") {\n if (expr.name === \"declare\") {\n if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) {\n return this.flowParseDeclare(node);\n }\n } else if (tokenIsIdentifier(this.state.type)) {\n if (expr.name === \"interface\") {\n return this.flowParseInterface(node);\n } else if (expr.name === \"type\") {\n return this.flowParseTypeAlias(node);\n } else if (expr.name === \"opaque\") {\n return this.flowParseOpaqueType(node, false);\n }\n }\n }\n return super.parseExpressionStatement(node, expr, decorators);\n }\n\n shouldParseExportDeclaration() {\n const {\n type\n } = this.state;\n if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) {\n return !this.state.containsEsc;\n }\n return super.shouldParseExportDeclaration();\n }\n isExportDefaultSpecifier() {\n const {\n type\n } = this.state;\n if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) {\n return this.state.containsEsc;\n }\n return super.isExportDefaultSpecifier();\n }\n parseExportDefaultExpression() {\n if (this.shouldParseEnums() && this.isContextual(124)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n return super.parseExportDefaultExpression();\n }\n parseConditional(expr, startLoc, refExpressionErrors) {\n if (!this.match(17)) return expr;\n if (this.state.maybeInArrowParameters) {\n const nextCh = this.lookaheadCharCode();\n if (nextCh === 44 ||\n nextCh === 61 ||\n nextCh === 58 ||\n nextCh === 41) {\n this.setOptionalParametersError(refExpressionErrors);\n return expr;\n }\n }\n this.expect(17);\n const state = this.state.clone();\n const originalNoArrowAt = this.state.noArrowAt;\n const node = this.startNodeAt(startLoc);\n let {\n consequent,\n failed\n } = this.tryParseConditionalConsequent();\n let [valid, invalid] = this.getArrowLikeExpressions(consequent);\n if (failed || invalid.length > 0) {\n const noArrowAt = [...originalNoArrowAt];\n if (invalid.length > 0) {\n this.state = state;\n this.state.noArrowAt = noArrowAt;\n for (let i = 0; i < invalid.length; i++) {\n noArrowAt.push(invalid[i].start);\n }\n ({\n consequent,\n failed\n } = this.tryParseConditionalConsequent());\n [valid, invalid] = this.getArrowLikeExpressions(consequent);\n }\n if (failed && valid.length > 1) {\n this.raise(FlowErrors.AmbiguousConditionalArrow, {\n at: state.startLoc\n });\n }\n if (failed && valid.length === 1) {\n this.state = state;\n noArrowAt.push(valid[0].start);\n this.state.noArrowAt = noArrowAt;\n ({\n consequent,\n failed\n } = this.tryParseConditionalConsequent());\n }\n }\n this.getArrowLikeExpressions(consequent, true);\n this.state.noArrowAt = originalNoArrowAt;\n this.expect(14);\n node.test = expr;\n node.consequent = consequent;\n node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined));\n return this.finishNode(node, \"ConditionalExpression\");\n }\n tryParseConditionalConsequent() {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n const consequent = this.parseMaybeAssignAllowIn();\n const failed = !this.match(14);\n this.state.noArrowParamsConversionAt.pop();\n return {\n consequent,\n failed\n };\n }\n\n getArrowLikeExpressions(node, disallowInvalid) {\n const stack = [node];\n const arrows = [];\n while (stack.length !== 0) {\n const node = stack.pop();\n if (node.type === \"ArrowFunctionExpression\") {\n if (node.typeParameters || !node.returnType) {\n this.finishArrowValidation(node);\n } else {\n arrows.push(node);\n }\n stack.push(node.body);\n } else if (node.type === \"ConditionalExpression\") {\n stack.push(node.consequent);\n stack.push(node.alternate);\n }\n }\n if (disallowInvalid) {\n arrows.forEach(node => this.finishArrowValidation(node));\n return [arrows, []];\n }\n return partition(arrows, node => node.params.every(param => this.isAssignable(param, true)));\n }\n finishArrowValidation(node) {\n var _node$extra;\n this.toAssignableList(\n node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false);\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n super.checkParams(node, false, true);\n this.scope.exit();\n }\n forwardNoArrowParamsConversionAt(node, parse) {\n let result;\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n result = parse();\n this.state.noArrowParamsConversionAt.pop();\n } else {\n result = parse();\n }\n return result;\n }\n parseParenItem(node, startLoc) {\n node = super.parseParenItem(node, startLoc);\n if (this.eat(17)) {\n node.optional = true;\n this.resetEndLocation(node);\n }\n if (this.match(14)) {\n const typeCastNode = this.startNodeAt(startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();\n return this.finishNode(typeCastNode, \"TypeCastExpression\");\n }\n return node;\n }\n assertModuleNodeAllowed(node) {\n if (node.type === \"ImportDeclaration\" && (node.importKind === \"type\" || node.importKind === \"typeof\") || node.type === \"ExportNamedDeclaration\" && node.exportKind === \"type\" || node.type === \"ExportAllDeclaration\" && node.exportKind === \"type\") {\n return;\n }\n super.assertModuleNodeAllowed(node);\n }\n parseExport(node, decorators) {\n const decl = super.parseExport(node, decorators);\n if (decl.type === \"ExportNamedDeclaration\" || decl.type === \"ExportAllDeclaration\") {\n decl.exportKind = decl.exportKind || \"value\";\n }\n return decl;\n }\n parseExportDeclaration(node) {\n if (this.isContextual(128)) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n if (this.match(5)) {\n node.specifiers = this.parseExportSpecifiers(true);\n super.parseExportFrom(node);\n return null;\n } else {\n return this.flowParseTypeAlias(declarationNode);\n }\n } else if (this.isContextual(129)) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseOpaqueType(declarationNode, false);\n } else if (this.isContextual(127)) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseInterface(declarationNode);\n } else if (this.shouldParseEnums() && this.isContextual(124)) {\n node.exportKind = \"value\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(declarationNode);\n } else {\n return super.parseExportDeclaration(node);\n }\n }\n eatExportStar(node) {\n if (super.eatExportStar(node)) return true;\n if (this.isContextual(128) && this.lookahead().type === 55) {\n node.exportKind = \"type\";\n this.next();\n this.next();\n return true;\n }\n return false;\n }\n maybeParseExportNamespaceSpecifier(node) {\n const {\n startLoc\n } = this.state;\n const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);\n if (hasNamespace && node.exportKind === \"type\") {\n this.unexpected(startLoc);\n }\n return hasNamespace;\n }\n parseClassId(node, isStatement, optionalId) {\n super.parseClassId(node, isStatement, optionalId);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n }\n parseClassMember(classBody, member, state) {\n const {\n startLoc\n } = this.state;\n if (this.isContextual(123)) {\n if (super.parseClassMemberFromModifier(classBody, member)) {\n return;\n }\n member.declare = true;\n }\n super.parseClassMember(classBody, member, state);\n if (member.declare) {\n if (member.type !== \"ClassProperty\" && member.type !== \"ClassPrivateProperty\" && member.type !== \"PropertyDefinition\") {\n this.raise(FlowErrors.DeclareClassElement, {\n at: startLoc\n });\n } else if (member.value) {\n this.raise(FlowErrors.DeclareClassFieldInitializer, {\n at: member.value\n });\n }\n }\n }\n isIterator(word) {\n return word === \"iterator\" || word === \"asyncIterator\";\n }\n readIterator() {\n const word = super.readWord1();\n const fullWord = \"@@\" + word;\n\n if (!this.isIterator(word) || !this.state.inType) {\n this.raise(Errors.InvalidIdentifier, {\n at: this.state.curPosition(),\n identifierName: fullWord\n });\n }\n this.finishToken(130, fullWord);\n }\n\n getTokenFromCode(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === 123 && next === 124) {\n return this.finishOp(6, 2);\n } else if (this.state.inType && (code === 62 || code === 60)) {\n return this.finishOp(code === 62 ? 48 : 47, 1);\n } else if (this.state.inType && code === 63) {\n if (next === 46) {\n return this.finishOp(18, 2);\n }\n return this.finishOp(17, 1);\n } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) {\n this.state.pos += 2;\n return this.readIterator();\n } else {\n return super.getTokenFromCode(code);\n }\n }\n isAssignable(node, isBinding) {\n if (node.type === \"TypeCastExpression\") {\n return this.isAssignable(node.expression, isBinding);\n } else {\n return super.isAssignable(node, isBinding);\n }\n }\n toAssignable(node, isLHS = false) {\n if (!isLHS && node.type === \"AssignmentExpression\" && node.left.type === \"TypeCastExpression\") {\n node.left = this.typeCastToParameter(node.left);\n }\n super.toAssignable(node, isLHS);\n }\n\n toAssignableList(exprList, trailingCommaLoc, isLHS) {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if ((expr == null ? void 0 : expr.type) === \"TypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n super.toAssignableList(exprList, trailingCommaLoc, isLHS);\n }\n\n toReferencedList(exprList, isParenthesizedExpr) {\n for (let i = 0; i < exprList.length; i++) {\n var _expr$extra;\n const expr = exprList[i];\n if (expr && expr.type === \"TypeCastExpression\" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {\n this.raise(FlowErrors.TypeCastInPattern, {\n at: expr.typeAnnotation\n });\n }\n }\n return exprList;\n }\n parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {\n const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);\n\n if (canBePattern && !this.state.maybeInArrowParameters) {\n this.toReferencedList(node.elements);\n }\n return node;\n }\n isValidLVal(type, isParenthesized, binding) {\n return type === \"TypeCastExpression\" || super.isValidLVal(type, isParenthesized, binding);\n }\n\n parseClassProperty(node) {\n if (this.match(14)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassProperty(node);\n }\n parseClassPrivateProperty(node) {\n if (this.match(14)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassPrivateProperty(node);\n }\n\n isClassMethod() {\n return this.match(47) || super.isClassMethod();\n }\n\n isClassProperty() {\n return this.match(14) || super.isClassProperty();\n }\n isNonstaticConstructor(method) {\n return !this.match(14) && super.isNonstaticConstructor(method);\n }\n\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n if (method.variance) {\n this.unexpected(method.variance.loc.start);\n }\n delete method.variance;\n if (this.match(47)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);\n if (method.params && isConstructor) {\n const params = method.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, {\n at: method\n });\n }\n } else if (\n method.type === \"MethodDefinition\" && isConstructor &&\n method.value.params) {\n const params = method.value.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, {\n at: method\n });\n }\n }\n }\n pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {\n if (method.variance) {\n this.unexpected(method.variance.loc.start);\n }\n delete method.variance;\n if (this.match(47)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n parseClassSuper(node) {\n super.parseClassSuper(node);\n if (node.superClass && this.match(47)) {\n node.superTypeParameters = this.flowParseTypeParameterInstantiation();\n }\n if (this.isContextual(111)) {\n this.next();\n const implemented = node.implements = [];\n do {\n const node = this.startNode();\n node.id = this.flowParseRestrictedIdentifier(true);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n implemented.push(this.finishNode(node, \"ClassImplements\"));\n } while (this.eat(12));\n }\n }\n checkGetterSetterParams(method) {\n super.checkGetterSetterParams(method);\n const params = this.getObjectOrClassMethodParams(method);\n if (params.length > 0) {\n const param = params[0];\n if (this.isThisParam(param) && method.kind === \"get\") {\n this.raise(FlowErrors.GetterMayNotHaveThisParam, {\n at: param\n });\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.SetterMayNotHaveThisParam, {\n at: param\n });\n }\n }\n }\n parsePropertyNamePrefixOperator(node) {\n node.variance = this.flowParseVariance();\n }\n\n parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {\n if (prop.variance) {\n this.unexpected(prop.variance.loc.start);\n }\n delete prop.variance;\n let typeParameters;\n\n if (this.match(47) && !isAccessor) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(10)) this.unexpected();\n }\n const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);\n\n if (typeParameters) {\n (result.value || result).typeParameters = typeParameters;\n }\n return result;\n }\n parseAssignableListItemTypes(param) {\n if (this.eat(17)) {\n if (param.type !== \"Identifier\") {\n this.raise(FlowErrors.PatternIsOptional, {\n at: param\n });\n }\n if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, {\n at: param\n });\n }\n param.optional = true;\n }\n if (this.match(14)) {\n param.typeAnnotation = this.flowParseTypeAnnotation();\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamAnnotationRequired, {\n at: param\n });\n }\n if (this.match(29) && this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamNoDefault, {\n at: param\n });\n }\n this.resetEndLocation(param);\n return param;\n }\n parseMaybeDefault(startLoc, left) {\n const node = super.parseMaybeDefault(startLoc, left);\n if (node.type === \"AssignmentPattern\" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {\n this.raise(FlowErrors.TypeBeforeInitializer, {\n at: node.typeAnnotation\n });\n }\n return node;\n }\n shouldParseDefaultImport(node) {\n if (!hasTypeImportKind(node)) {\n return super.shouldParseDefaultImport(node);\n }\n return isMaybeDefaultImport(this.state.type);\n }\n checkImportReflection(node) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(FlowErrors.ImportReflectionHasImportType, {\n at: node.specifiers[0].loc.start\n });\n }\n }\n parseImportSpecifierLocal(node, specifier, type) {\n specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n\n maybeParseDefaultImportSpecifier(node) {\n node.importKind = \"value\";\n let kind = null;\n if (this.match(87)) {\n kind = \"typeof\";\n } else if (this.isContextual(128)) {\n kind = \"type\";\n }\n if (kind) {\n const lh = this.lookahead();\n const {\n type\n } = lh;\n\n if (kind === \"type\" && type === 55) {\n this.unexpected(null, lh.type);\n }\n if (isMaybeDefaultImport(type) || type === 5 || type === 55) {\n this.next();\n node.importKind = kind;\n }\n }\n return super.maybeParseDefaultImportSpecifier(node);\n }\n\n parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport,\n isMaybeTypeOnly,\n bindingType) {\n const firstIdent = specifier.imported;\n let specifierTypeKind = null;\n if (firstIdent.type === \"Identifier\") {\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n }\n let isBinding = false;\n if (this.isContextual(93) && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = cloneIdentifier(as_ident);\n } else {\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else {\n if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) {\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n } else {\n if (importedIsString) {\n throw this.raise(Errors.ImportBindingIsString, {\n at: specifier,\n importName: firstIdent.value\n });\n }\n specifier.imported = firstIdent;\n specifier.importKind = null;\n }\n if (this.eatContextual(93)) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = cloneIdentifier(specifier.imported);\n }\n }\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n if (isInTypeOnlyImport && specifierIsTypeImport) {\n this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, {\n at: specifier\n });\n }\n if (isInTypeOnlyImport || specifierIsTypeImport) {\n this.checkReservedType(specifier.local.name, specifier.local.loc.start, true);\n }\n if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {\n this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true);\n }\n return this.finishImportSpecifier(specifier, \"ImportSpecifier\");\n }\n parseBindingAtom() {\n switch (this.state.type) {\n case 78:\n return this.parseIdentifier(true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n parseFunctionParams(node, allowModifiers) {\n const kind = node.kind;\n if (kind !== \"get\" && kind !== \"set\" && this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.parseFunctionParams(node, allowModifiers);\n }\n\n parseVarId(decl, kind) {\n super.parseVarId(decl, kind);\n if (this.match(14)) {\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id);\n }\n }\n\n parseAsyncArrowFromCallExpression(node, call) {\n if (this.match(14)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n shouldParseAsyncArrow() {\n return this.match(14) || super.shouldParseAsyncArrow();\n }\n\n parseMaybeAssign(refExpressionErrors, afterLeftParse) {\n var _jsx;\n let state = null;\n let jsx;\n if (this.hasPlugin(\"jsx\") && (this.match(140) || this.match(47))) {\n state = this.state.clone();\n jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);\n\n if (!jsx.error) return jsx.node;\n\n const {\n context\n } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === types.j_oTag || currentContext === types.j_expr) {\n context.pop();\n }\n }\n if ((_jsx = jsx) != null && _jsx.error || this.match(47)) {\n var _jsx2, _jsx3;\n state = state || this.state.clone();\n let typeParameters;\n const arrow = this.tryParse(abort => {\n var _arrowExpression$extr;\n typeParameters = this.flowParseTypeParameterDeclaration();\n const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => {\n const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n this.resetStartLocationFromNode(result, typeParameters);\n return result;\n });\n\n if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort();\n\n const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);\n if (expr.type !== \"ArrowFunctionExpression\") abort();\n expr.typeParameters = typeParameters;\n this.resetStartLocationFromNode(expr, typeParameters);\n return arrowExpression;\n }, state);\n let arrowExpression = null;\n if (arrow.node &&\n this.maybeUnwrapTypeCastExpression(arrow.node).type === \"ArrowFunctionExpression\") {\n if (!arrow.error && !arrow.aborted) {\n if (arrow.node.async) {\n this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, {\n at: typeParameters\n });\n }\n return arrow.node;\n }\n\n arrowExpression = arrow.node;\n }\n\n if ((_jsx2 = jsx) != null && _jsx2.node) {\n this.state = jsx.failState;\n return jsx.node;\n }\n if (arrowExpression) {\n this.state = arrow.failState;\n return arrowExpression;\n }\n if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n\n throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, {\n at: typeParameters\n });\n }\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n parseArrow(node) {\n if (this.match(14)) {\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n const typeNode = this.startNode();\n [typeNode.typeAnnotation,\n node.predicate] = this.flowParseTypeAndPredicateInitialiser();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(19)) this.unexpected();\n return typeNode;\n });\n if (result.thrown) return null;\n\n if (result.error) this.state = result.failState;\n\n node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, \"TypeAnnotation\") : null;\n }\n return super.parseArrow(node);\n }\n shouldParseArrow(params) {\n return this.match(14) || super.shouldParseArrow(params);\n }\n setArrowFunctionParameters(node, params) {\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n node.params = params;\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {\n if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n return;\n }\n\n for (let i = 0; i < node.params.length; i++) {\n if (this.isThisParam(node.params[i]) && i > 0) {\n this.raise(FlowErrors.ThisParamMustBeFirst, {\n at: node.params[i]\n });\n }\n }\n return super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);\n }\n parseParenAndDistinguishExpression(canBeArrow) {\n return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);\n }\n parseSubscripts(base, startLoc, noCalls) {\n if (base.type === \"Identifier\" && base.name === \"async\" && this.state.noArrowAt.indexOf(startLoc.index) !== -1) {\n this.next();\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.arguments = super.parseCallExpressionArguments(11, false);\n base = this.finishNode(node, \"CallExpression\");\n } else if (base.type === \"Identifier\" && base.name === \"async\" && this.match(47)) {\n const state = this.state.clone();\n const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state);\n\n if (!arrow.error && !arrow.aborted) return arrow.node;\n const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state);\n if (result.node && !result.error) return result.node;\n if (arrow.node) {\n this.state = arrow.failState;\n return arrow.node;\n }\n if (result.node) {\n this.state = result.failState;\n return result.node;\n }\n throw arrow.error || result.error;\n }\n return super.parseSubscripts(base, startLoc, noCalls);\n }\n parseSubscript(base, startLoc, noCalls, subscriptState) {\n if (this.match(18) && this.isLookaheadToken_lt()) {\n subscriptState.optionalChainMember = true;\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n this.next();\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.typeArguments = this.flowParseTypeParameterInstantiation();\n this.expect(10);\n node.arguments = this.parseCallExpressionArguments(11, false);\n node.optional = true;\n return this.finishCallExpression(node, true);\n } else if (!noCalls && this.shouldParseTypes() && this.match(47)) {\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n const result = this.tryParse(() => {\n node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(10);\n node.arguments = super.parseCallExpressionArguments(11, false);\n if (subscriptState.optionalChainMember) {\n node.optional = false;\n }\n return this.finishCallExpression(node, subscriptState.optionalChainMember);\n });\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n return super.parseSubscript(base, startLoc, noCalls, subscriptState);\n }\n parseNewCallee(node) {\n super.parseNewCallee(node);\n let targs = null;\n if (this.shouldParseTypes() && this.match(47)) {\n targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;\n }\n node.typeArguments = targs;\n }\n parseAsyncArrowWithTypeParameters(startLoc) {\n const node = this.startNodeAt(startLoc);\n this.parseFunctionParams(node);\n if (!this.parseArrow(node)) return;\n return super.parseArrowExpression(node, undefined, true);\n }\n readToken_mult_modulo(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === 42 && next === 47 && this.state.hasFlowComment) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n super.readToken_mult_modulo(code);\n }\n readToken_pipe_amp(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === 124 && next === 125) {\n this.finishOp(9, 2);\n return;\n }\n super.readToken_pipe_amp(code);\n }\n parseTopLevel(file, program) {\n const fileNode = super.parseTopLevel(file, program);\n if (this.state.hasFlowComment) {\n this.raise(FlowErrors.UnterminatedFlowComment, {\n at: this.state.curPosition()\n });\n }\n return fileNode;\n }\n skipBlockComment() {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n throw this.raise(FlowErrors.NestedFlowComment, {\n at: this.state.startLoc\n });\n }\n this.hasFlowCommentCompletion();\n const commentSkip = this.skipFlowComment();\n if (commentSkip) {\n this.state.pos += commentSkip;\n this.state.hasFlowComment = true;\n }\n return;\n }\n return super.skipBlockComment(this.state.hasFlowComment ? \"*-/\" : \"*/\");\n }\n skipFlowComment() {\n const {\n pos\n } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n while ([32, 9].includes(\n this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {\n shiftToFirstNonWhiteSpace++;\n }\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n if (ch2 === 58 && ch3 === 58) {\n return shiftToFirstNonWhiteSpace + 2;\n }\n\n if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === \"flow-include\") {\n return shiftToFirstNonWhiteSpace + 12;\n }\n\n if (ch2 === 58 && ch3 !== 58) {\n return shiftToFirstNonWhiteSpace;\n }\n\n return false;\n }\n hasFlowCommentCompletion() {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n if (end === -1) {\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition()\n });\n }\n }\n\n flowEnumErrorBooleanMemberNotInitialized(loc, {\n enumName,\n memberName\n }) {\n this.raise(FlowErrors.EnumBooleanMemberNotInitialized, {\n at: loc,\n memberName,\n enumName\n });\n }\n flowEnumErrorInvalidMemberInitializer(loc, enumContext) {\n return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === \"symbol\" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, Object.assign({\n at: loc\n }, enumContext));\n }\n flowEnumErrorNumberMemberNotInitialized(loc, {\n enumName,\n memberName\n }) {\n this.raise(FlowErrors.EnumNumberMemberNotInitialized, {\n at: loc,\n enumName,\n memberName\n });\n }\n flowEnumErrorStringMemberInconsistentlyInitailized(node, {\n enumName\n }) {\n this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, {\n at: node,\n enumName\n });\n }\n flowEnumMemberInit() {\n const startLoc = this.state.startLoc;\n const endOfInit = () => this.match(12) || this.match(8);\n switch (this.state.type) {\n case 132:\n {\n const literal = this.parseNumericLiteral(this.state.value);\n if (endOfInit()) {\n return {\n type: \"number\",\n loc: literal.loc.start,\n value: literal\n };\n }\n return {\n type: \"invalid\",\n loc: startLoc\n };\n }\n case 131:\n {\n const literal = this.parseStringLiteral(this.state.value);\n if (endOfInit()) {\n return {\n type: \"string\",\n loc: literal.loc.start,\n value: literal\n };\n }\n return {\n type: \"invalid\",\n loc: startLoc\n };\n }\n case 85:\n case 86:\n {\n const literal = this.parseBooleanLiteral(this.match(85));\n if (endOfInit()) {\n return {\n type: \"boolean\",\n loc: literal.loc.start,\n value: literal\n };\n }\n return {\n type: \"invalid\",\n loc: startLoc\n };\n }\n default:\n return {\n type: \"invalid\",\n loc: startLoc\n };\n }\n }\n flowEnumMemberRaw() {\n const loc = this.state.startLoc;\n const id = this.parseIdentifier(true);\n const init = this.eat(29) ? this.flowEnumMemberInit() : {\n type: \"none\",\n loc\n };\n return {\n id,\n init\n };\n }\n flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {\n const {\n explicitType\n } = context;\n if (explicitType === null) {\n return;\n }\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(loc, context);\n }\n }\n flowEnumMembers({\n enumName,\n explicitType\n }) {\n const seenNames = new Set();\n const members = {\n booleanMembers: [],\n numberMembers: [],\n stringMembers: [],\n defaultedMembers: []\n };\n let hasUnknownMembers = false;\n while (!this.match(8)) {\n if (this.eat(21)) {\n hasUnknownMembers = true;\n break;\n }\n const memberNode = this.startNode();\n const {\n id,\n init\n } = this.flowEnumMemberRaw();\n const memberName = id.name;\n if (memberName === \"\") {\n continue;\n }\n if (/^[a-z]/.test(memberName)) {\n this.raise(FlowErrors.EnumInvalidMemberName, {\n at: id,\n memberName,\n suggestion: memberName[0].toUpperCase() + memberName.slice(1),\n enumName\n });\n }\n if (seenNames.has(memberName)) {\n this.raise(FlowErrors.EnumDuplicateMemberName, {\n at: id,\n memberName,\n enumName\n });\n }\n seenNames.add(memberName);\n const context = {\n enumName,\n explicitType,\n memberName\n };\n memberNode.id = id;\n switch (init.type) {\n case \"boolean\":\n {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"boolean\");\n memberNode.init = init.value;\n members.booleanMembers.push(this.finishNode(memberNode, \"EnumBooleanMember\"));\n break;\n }\n case \"number\":\n {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(this.finishNode(memberNode, \"EnumNumberMember\"));\n break;\n }\n case \"string\":\n {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(this.finishNode(memberNode, \"EnumStringMember\"));\n break;\n }\n case \"invalid\":\n {\n throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);\n }\n case \"none\":\n {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context);\n break;\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);\n break;\n default:\n members.defaultedMembers.push(this.finishNode(memberNode, \"EnumDefaultedMember\"));\n }\n }\n }\n if (!this.match(8)) {\n this.expect(12);\n }\n }\n return {\n members,\n hasUnknownMembers\n };\n }\n flowEnumStringMembers(initializedMembers, defaultedMembers, {\n enumName\n }) {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (const member of initializedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {\n enumName\n });\n }\n return defaultedMembers;\n } else {\n for (const member of defaultedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {\n enumName\n });\n }\n return initializedMembers;\n }\n }\n flowEnumParseExplicitType({\n enumName\n }) {\n if (!this.eatContextual(101)) return null;\n if (!tokenIsIdentifier(this.state.type)) {\n throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, {\n at: this.state.startLoc,\n enumName\n });\n }\n const {\n value\n } = this.state;\n this.next();\n if (value !== \"boolean\" && value !== \"number\" && value !== \"string\" && value !== \"symbol\") {\n this.raise(FlowErrors.EnumInvalidExplicitType, {\n at: this.state.startLoc,\n enumName,\n invalidEnumType: value\n });\n }\n return value;\n }\n flowEnumBody(node, id) {\n const enumName = id.name;\n const nameLoc = id.loc.start;\n const explicitType = this.flowEnumParseExplicitType({\n enumName\n });\n this.expect(5);\n const {\n members,\n hasUnknownMembers\n } = this.flowEnumMembers({\n enumName,\n explicitType\n });\n node.hasUnknownMembers = hasUnknownMembers;\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumBooleanBody\");\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumNumberBody\");\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {\n enumName\n });\n this.expect(8);\n return this.finishNode(node, \"EnumStringBody\");\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumSymbolBody\");\n default:\n {\n const empty = () => {\n node.members = [];\n this.expect(8);\n return this.finishNode(node, \"EnumStringBody\");\n };\n node.explicitType = false;\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {\n enumName\n });\n this.expect(8);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name\n });\n }\n node.members = members.booleanMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name\n });\n }\n node.members = members.numberMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.raise(FlowErrors.EnumInconsistentMemberValues, {\n at: nameLoc,\n enumName\n });\n return empty();\n }\n }\n }\n }\n flowParseEnumDeclaration(node) {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), id);\n return this.finishNode(node, \"EnumDeclaration\");\n }\n\n isLookaheadToken_lt() {\n const next = this.nextTokenStart();\n if (this.input.charCodeAt(next) === 60) {\n const afterNext = this.input.charCodeAt(next + 1);\n return afterNext !== 60 && afterNext !== 61;\n }\n return false;\n }\n maybeUnwrapTypeCastExpression(node) {\n return node.type === \"TypeCastExpression\" ? node.expression : node;\n }\n});\n\nconst entities = {\n __proto__: null,\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\"\n};\n\nconst JsxErrors = ParseErrorEnum`jsx`({\n AttributeIsEmpty: \"JSX attributes must only be assigned a non-empty expression.\",\n MissingClosingTagElement: ({\n openingTagName\n }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`,\n MissingClosingTagFragment: \"Expected corresponding JSX closing tag for <>.\",\n UnexpectedSequenceExpression: \"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?\",\n UnexpectedToken: ({\n unexpected,\n HTMLEntity\n }) => `Unexpected token \\`${unexpected}\\`. Did you mean \\`${HTMLEntity}\\` or \\`{'${unexpected}'}\\`?`,\n UnsupportedJsxValue: \"JSX value should be either an expression or a quoted JSX text.\",\n UnterminatedJsxContent: \"Unterminated JSX contents.\",\n UnwrappedAdjacentJSXElements: \"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?\"\n});\n\nfunction isFragment(object) {\n return object ? object.type === \"JSXOpeningFragment\" || object.type === \"JSXClosingFragment\" : false;\n}\n\nfunction getQualifiedJSXName(object) {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n if (object.type === \"JSXMemberExpression\") {\n return getQualifiedJSXName(object.object) + \".\" + getQualifiedJSXName(object.property);\n }\n\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\nvar jsx = (superClass => class JSXParserMixin extends superClass {\n\n jsxReadToken() {\n let out = \"\";\n let chunkStart = this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(JsxErrors.UnterminatedJsxContent, {\n at: this.state.startLoc\n });\n }\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case 60:\n case 123:\n if (this.state.pos === this.state.start) {\n if (ch === 60 && this.state.canStartJSXElement) {\n ++this.state.pos;\n return this.finishToken(140);\n }\n return super.getTokenFromCode(ch);\n }\n out += this.input.slice(chunkStart, this.state.pos);\n return this.finishToken(139, out);\n case 38:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n case 62:\n case 125:\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n }\n jsxReadNewLine(normalizeCRLF) {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n return out;\n }\n jsxReadString(quote) {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(Errors.UnterminatedString, {\n at: this.state.startLoc\n });\n }\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n if (ch === 38) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n out += this.input.slice(chunkStart, this.state.pos++);\n return this.finishToken(131, out);\n }\n jsxReadEntity() {\n const startPos = ++this.state.pos;\n if (this.codePointAtPos(this.state.pos) === 35) {\n ++this.state.pos;\n let radix = 10;\n if (this.codePointAtPos(this.state.pos) === 120) {\n radix = 16;\n ++this.state.pos;\n }\n const codePoint = this.readInt(radix, undefined, false, \"bail\");\n if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) {\n ++this.state.pos;\n return String.fromCodePoint(codePoint);\n }\n } else {\n let count = 0;\n let semi = false;\n while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) == 59)) {\n ++this.state.pos;\n }\n if (semi) {\n const desc = this.input.slice(startPos, this.state.pos);\n const entity = entities[desc];\n ++this.state.pos;\n if (entity) {\n return entity;\n }\n }\n }\n\n this.state.pos = startPos;\n return \"&\";\n }\n\n jsxReadWord() {\n let ch;\n const start = this.state.pos;\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === 45);\n return this.finishToken(138, this.input.slice(start, this.state.pos));\n }\n\n jsxParseIdentifier() {\n const node = this.startNode();\n if (this.match(138)) {\n node.name = this.state.value;\n } else if (tokenIsKeyword(this.state.type)) {\n node.name = tokenLabelName(this.state.type);\n } else {\n this.unexpected();\n }\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n jsxParseNamespacedName() {\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(14)) return name;\n const node = this.startNodeAt(startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n jsxParseElementName() {\n const startLoc = this.state.startLoc;\n let node = this.jsxParseNamespacedName();\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n while (this.eat(16)) {\n const newNode = this.startNodeAt(startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n return node;\n }\n\n jsxParseAttributeValue() {\n let node;\n switch (this.state.type) {\n case 5:\n node = this.startNode();\n this.setContext(types.brace);\n this.next();\n node = this.jsxParseExpressionContainer(node, types.j_oTag);\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(JsxErrors.AttributeIsEmpty, {\n at: node\n });\n }\n return node;\n case 140:\n case 131:\n return this.parseExprAtom();\n default:\n throw this.raise(JsxErrors.UnsupportedJsxValue, {\n at: this.state.startLoc\n });\n }\n }\n\n jsxParseEmptyExpression() {\n const node = this.startNodeAt(this.state.lastTokEndLoc);\n return this.finishNodeAt(node, \"JSXEmptyExpression\", this.state.startLoc);\n }\n\n jsxParseSpreadChild(node) {\n this.next();\n node.expression = this.parseExpression();\n this.setContext(types.j_expr);\n this.state.canStartJSXElement = true;\n this.expect(8);\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n jsxParseExpressionContainer(node, previousContext) {\n if (this.match(8)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n const expression = this.parseExpression();\n node.expression = expression;\n }\n this.setContext(previousContext);\n this.state.canStartJSXElement = true;\n this.expect(8);\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n jsxParseAttribute() {\n const node = this.startNode();\n if (this.match(5)) {\n this.setContext(types.brace);\n this.next();\n this.expect(21);\n node.argument = this.parseMaybeAssignAllowIn();\n this.setContext(types.j_oTag);\n this.state.canStartJSXElement = true;\n this.expect(8);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(29) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n jsxParseOpeningElementAt(startLoc) {\n const node = this.startNodeAt(startLoc);\n if (this.eat(141)) {\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(node);\n }\n jsxParseOpeningElementAfterName(node) {\n const attributes = [];\n while (!this.match(56) && !this.match(141)) {\n attributes.push(this.jsxParseAttribute());\n }\n node.attributes = attributes;\n node.selfClosing = this.eat(56);\n this.expect(141);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n jsxParseClosingElementAt(startLoc) {\n const node = this.startNodeAt(startLoc);\n if (this.eat(141)) {\n return this.finishNode(node, \"JSXClosingFragment\");\n }\n node.name = this.jsxParseElementName();\n this.expect(141);\n return this.finishNode(node, \"JSXClosingElement\");\n }\n\n jsxParseElementAt(startLoc) {\n const node = this.startNodeAt(startLoc);\n const children = [];\n const openingElement = this.jsxParseOpeningElementAt(startLoc);\n let closingElement = null;\n if (!openingElement.selfClosing) {\n contents: for (;;) {\n switch (this.state.type) {\n case 140:\n startLoc = this.state.startLoc;\n this.next();\n if (this.eat(56)) {\n closingElement = this.jsxParseClosingElementAt(startLoc);\n break contents;\n }\n children.push(this.jsxParseElementAt(startLoc));\n break;\n case 139:\n children.push(this.parseExprAtom());\n break;\n case 5:\n {\n const node = this.startNode();\n this.setContext(types.brace);\n this.next();\n if (this.match(21)) {\n children.push(this.jsxParseSpreadChild(node));\n } else {\n children.push(this.jsxParseExpressionContainer(node, types.j_expr));\n }\n break;\n }\n default:\n throw this.unexpected();\n }\n }\n if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {\n this.raise(JsxErrors.MissingClosingTagFragment, {\n at: closingElement\n });\n } else if (!isFragment(openingElement) && isFragment(closingElement)) {\n this.raise(JsxErrors.MissingClosingTagElement, {\n at: closingElement,\n openingTagName: getQualifiedJSXName(openingElement.name)\n });\n } else if (!isFragment(openingElement) && !isFragment(closingElement)) {\n if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {\n this.raise(JsxErrors.MissingClosingTagElement, {\n at: closingElement,\n openingTagName: getQualifiedJSXName(openingElement.name)\n });\n }\n }\n }\n if (isFragment(openingElement)) {\n node.openingFragment = openingElement;\n node.closingFragment = closingElement;\n } else {\n node.openingElement = openingElement;\n node.closingElement = closingElement;\n }\n node.children = children;\n if (this.match(47)) {\n throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, {\n at: this.state.startLoc\n });\n }\n return isFragment(openingElement) ? this.finishNode(node, \"JSXFragment\") : this.finishNode(node, \"JSXElement\");\n }\n\n jsxParseElement() {\n const startLoc = this.state.startLoc;\n this.next();\n return this.jsxParseElementAt(startLoc);\n }\n setContext(newContext) {\n const {\n context\n } = this.state;\n context[context.length - 1] = newContext;\n }\n\n parseExprAtom(refExpressionErrors) {\n if (this.match(139)) {\n return this.parseLiteral(this.state.value, \"JSXText\");\n } else if (this.match(140)) {\n return this.jsxParseElement();\n } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) {\n this.replaceToken(140);\n return this.jsxParseElement();\n } else {\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n skipSpace() {\n const curContext = this.curContext();\n if (!curContext.preserveSpace) super.skipSpace();\n }\n getTokenFromCode(code) {\n const context = this.curContext();\n if (context === types.j_expr) {\n return this.jsxReadToken();\n }\n if (context === types.j_oTag || context === types.j_cTag) {\n if (isIdentifierStart(code)) {\n return this.jsxReadWord();\n }\n if (code === 62) {\n ++this.state.pos;\n return this.finishToken(141);\n }\n if ((code === 34 || code === 39) && context === types.j_oTag) {\n return this.jsxReadString(code);\n }\n }\n if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {\n ++this.state.pos;\n return this.finishToken(140);\n }\n return super.getTokenFromCode(code);\n }\n updateContext(prevType) {\n const {\n context,\n type\n } = this.state;\n if (type === 56 && prevType === 140) {\n context.splice(-2, 2, types.j_cTag);\n this.state.canStartJSXElement = false;\n } else if (type === 140) {\n context.push(types.j_oTag);\n } else if (type === 141) {\n const out = context[context.length - 1];\n if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) {\n context.pop();\n this.state.canStartJSXElement = context[context.length - 1] === types.j_expr;\n } else {\n this.setContext(types.j_expr);\n this.state.canStartJSXElement = true;\n }\n } else {\n this.state.canStartJSXElement = tokenComesBeforeExpression(type);\n }\n }\n});\n\nclass TypeScriptScope extends Scope {\n constructor(...args) {\n super(...args);\n this.types = new Set();\n this.enums = new Set();\n this.constEnums = new Set();\n this.classes = new Set();\n this.exportOnlyBindings = new Set();\n }\n}\n\nclass TypeScriptScopeHandler extends ScopeHandler {\n constructor(...args) {\n super(...args);\n this.importsStack = [];\n }\n createScope(flags) {\n this.importsStack.push(new Set());\n\n return new TypeScriptScope(flags);\n }\n enter(flags) {\n if (flags == SCOPE_TS_MODULE) {\n this.importsStack.push(new Set());\n }\n super.enter(flags);\n }\n exit() {\n const flags = super.exit();\n if (flags == SCOPE_TS_MODULE) {\n this.importsStack.pop();\n }\n return flags;\n }\n hasImport(name, allowShadow) {\n const len = this.importsStack.length;\n if (this.importsStack[len - 1].has(name)) {\n return true;\n }\n if (!allowShadow && len > 1) {\n for (let i = 0; i < len - 1; i++) {\n if (this.importsStack[i].has(name)) return true;\n }\n }\n return false;\n }\n declareName(name, bindingType, loc) {\n if (bindingType & BIND_FLAGS_TS_IMPORT) {\n if (this.hasImport(name, true)) {\n this.parser.raise(Errors.VarRedeclaration, {\n at: loc,\n identifierName: name\n });\n }\n this.importsStack[this.importsStack.length - 1].add(name);\n return;\n }\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.exportOnlyBindings.add(name);\n return;\n }\n super.declareName(name, bindingType, loc);\n if (bindingType & BIND_KIND_TYPE) {\n if (!(bindingType & BIND_KIND_VALUE)) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n }\n scope.types.add(name);\n }\n if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name);\n if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name);\n if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name);\n }\n isRedeclaredInScope(scope, name, bindingType) {\n if (scope.enums.has(name)) {\n if (bindingType & BIND_FLAGS_TS_ENUM) {\n const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);\n const wasConst = scope.constEnums.has(name);\n return isConst !== wasConst;\n }\n return true;\n }\n if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {\n if (scope.lexical.has(name)) {\n return !!(bindingType & BIND_KIND_VALUE);\n } else {\n return false;\n }\n }\n if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {\n return true;\n }\n return super.isRedeclaredInScope(scope, name, bindingType);\n }\n checkLocalExport(id) {\n const {\n name\n } = id;\n if (this.hasImport(name)) return;\n const len = this.scopeStack.length;\n for (let i = len - 1; i >= 0; i--) {\n const scope = this.scopeStack[i];\n if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return;\n }\n super.checkLocalExport(id);\n }\n}\n\nconst getOwn$1 = (object, key) => Object.hasOwnProperty.call(object, key) && object[key];\nfunction nonNull(x) {\n if (x == null) {\n throw new Error(`Unexpected ${x} value.`);\n }\n return x;\n}\nfunction assert(x) {\n if (!x) {\n throw new Error(\"Assert fail\");\n }\n}\nconst TSErrors = ParseErrorEnum`typescript`({\n AbstractMethodHasImplementation: ({\n methodName\n }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`,\n AbstractPropertyHasInitializer: ({\n propertyName\n }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,\n AccesorCannotDeclareThisParameter: \"'get' and 'set' accessors cannot declare 'this' parameters.\",\n AccesorCannotHaveTypeParameters: \"An accessor cannot have type parameters.\",\n ClassMethodHasDeclare: \"Class methods cannot have the 'declare' modifier.\",\n ClassMethodHasReadonly: \"Class methods cannot have the 'readonly' modifier.\",\n ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: \"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.\",\n ConstructorHasTypeParameters: \"Type parameters cannot appear on a constructor declaration.\",\n DeclareAccessor: ({\n kind\n }) => `'declare' is not allowed in ${kind}ters.`,\n DeclareClassFieldHasInitializer: \"Initializers are not allowed in ambient contexts.\",\n DeclareFunctionHasImplementation: \"An implementation cannot be declared in ambient contexts.\",\n DuplicateAccessibilityModifier:\n ({\n modifier\n }) => `Accessibility modifier already seen.`,\n DuplicateModifier: ({\n modifier\n }) => `Duplicate modifier: '${modifier}'.`,\n EmptyHeritageClauseType: ({\n token\n }) => `'${token}' list cannot be empty.`,\n EmptyTypeArguments: \"Type argument list cannot be empty.\",\n EmptyTypeParameters: \"Type parameter list cannot be empty.\",\n ExpectedAmbientAfterExportDeclare: \"'export declare' must be followed by an ambient declaration.\",\n ImportAliasHasImportType: \"An import alias can not use 'import type'.\",\n ImportReflectionHasImportType: \"An `import module` declaration can not use `type` modifier\",\n IncompatibleModifiers: ({\n modifiers\n }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`,\n IndexSignatureHasAbstract: \"Index signatures cannot have the 'abstract' modifier.\",\n IndexSignatureHasAccessibility: ({\n modifier\n }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`,\n IndexSignatureHasDeclare: \"Index signatures cannot have the 'declare' modifier.\",\n IndexSignatureHasOverride: \"'override' modifier cannot appear on an index signature.\",\n IndexSignatureHasStatic: \"Index signatures cannot have the 'static' modifier.\",\n InitializerNotAllowedInAmbientContext: \"Initializers are not allowed in ambient contexts.\",\n InvalidModifierOnTypeMember: ({\n modifier\n }) => `'${modifier}' modifier cannot appear on a type member.`,\n InvalidModifierOnTypeParameter: ({\n modifier\n }) => `'${modifier}' modifier cannot appear on a type parameter.`,\n InvalidModifierOnTypeParameterPositions: ({\n modifier\n }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`,\n InvalidModifiersOrder: ({\n orderedModifiers\n }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`,\n InvalidPropertyAccessAfterInstantiationExpression: \"Invalid property access after an instantiation expression. \" + \"You can either wrap the instantiation expression in parentheses, or delete the type arguments.\",\n InvalidTupleMemberLabel: \"Tuple members must be labeled with a simple identifier.\",\n MissingInterfaceName: \"'interface' declarations must be followed by an identifier.\",\n MixedLabeledAndUnlabeledElements: \"Tuple members must all have names or all not have names.\",\n NonAbstractClassHasAbstractMethod: \"Abstract methods can only appear within an abstract class.\",\n NonClassMethodPropertyHasAbstractModifer: \"'abstract' modifier can only appear on a class, method, or property declaration.\",\n OptionalTypeBeforeRequired: \"A required element cannot follow an optional element.\",\n OverrideNotInSubClass: \"This member cannot have an 'override' modifier because its containing class does not extend another class.\",\n PatternIsOptional: \"A binding pattern parameter cannot be optional in an implementation signature.\",\n PrivateElementHasAbstract: \"Private elements cannot have the 'abstract' modifier.\",\n PrivateElementHasAccessibility: ({\n modifier\n }) => `Private elements cannot have an accessibility modifier ('${modifier}').`,\n ReadonlyForMethodSignature: \"'readonly' modifier can only appear on a property declaration or index signature.\",\n ReservedArrowTypeParam: \"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.\",\n ReservedTypeAssertion: \"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.\",\n SetAccesorCannotHaveOptionalParameter: \"A 'set' accessor cannot have an optional parameter.\",\n SetAccesorCannotHaveRestParameter: \"A 'set' accessor cannot have rest parameter.\",\n SetAccesorCannotHaveReturnType: \"A 'set' accessor cannot have a return type annotation.\",\n SingleTypeParameterWithoutTrailingComma: ({\n typeParameterName\n }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`,\n StaticBlockCannotHaveModifier: \"Static class blocks cannot have any modifier.\",\n TypeAnnotationAfterAssign: \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.\",\n TypeImportCannotSpecifyDefaultAndNamed: \"A type-only import can specify a default import or named bindings, but not both.\",\n TypeModifierIsUsedInTypeExports: \"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.\",\n TypeModifierIsUsedInTypeImports: \"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.\",\n UnexpectedParameterModifier: \"A parameter property is only allowed in a constructor implementation.\",\n UnexpectedReadonly: \"'readonly' type modifier is only permitted on array and tuple literal types.\",\n UnexpectedTypeAnnotation: \"Did not expect a type annotation here.\",\n UnexpectedTypeCastInParameter: \"Unexpected type cast in parameter position.\",\n UnsupportedImportTypeArgument: \"Argument in a type import must be a string literal.\",\n UnsupportedParameterPropertyKind: \"A parameter property may not be declared using a binding pattern.\",\n UnsupportedSignatureParameterKind: ({\n type\n }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`\n});\n\nfunction keywordTypeFromName(value) {\n switch (value) {\n case \"any\":\n return \"TSAnyKeyword\";\n case \"boolean\":\n return \"TSBooleanKeyword\";\n case \"bigint\":\n return \"TSBigIntKeyword\";\n case \"never\":\n return \"TSNeverKeyword\";\n case \"number\":\n return \"TSNumberKeyword\";\n case \"object\":\n return \"TSObjectKeyword\";\n case \"string\":\n return \"TSStringKeyword\";\n case \"symbol\":\n return \"TSSymbolKeyword\";\n case \"undefined\":\n return \"TSUndefinedKeyword\";\n case \"unknown\":\n return \"TSUnknownKeyword\";\n default:\n return undefined;\n }\n}\nfunction tsIsAccessModifier(modifier) {\n return modifier === \"private\" || modifier === \"public\" || modifier === \"protected\";\n}\nfunction tsIsVarianceAnnotations(modifier) {\n return modifier === \"in\" || modifier === \"out\";\n}\nvar typescript = (superClass => class TypeScriptParserMixin extends superClass {\n getScopeHandler() {\n return TypeScriptScopeHandler;\n }\n tsIsIdentifier() {\n return tokenIsIdentifier(this.state.type);\n }\n tsTokenCanFollowModifier() {\n return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(136) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();\n }\n tsNextTokenCanFollowModifier() {\n this.next();\n return this.tsTokenCanFollowModifier();\n }\n\n tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {\n if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58) {\n return undefined;\n }\n const modifier = this.state.value;\n if (allowedModifiers.indexOf(modifier) !== -1) {\n if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {\n return undefined;\n }\n if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {\n return modifier;\n }\n }\n return undefined;\n }\n\n tsParseModifiers({\n modified,\n allowedModifiers,\n disallowedModifiers,\n stopOnStartOfClassStaticBlock,\n errorTemplate = TSErrors.InvalidModifierOnTypeMember\n }) {\n const enforceOrder = (loc, modifier, before, after) => {\n if (modifier === before && modified[after]) {\n this.raise(TSErrors.InvalidModifiersOrder, {\n at: loc,\n orderedModifiers: [before, after]\n });\n }\n };\n const incompatible = (loc, modifier, mod1, mod2) => {\n if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {\n this.raise(TSErrors.IncompatibleModifiers, {\n at: loc,\n modifiers: [mod1, mod2]\n });\n }\n };\n for (;;) {\n const {\n startLoc\n } = this.state;\n const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock);\n if (!modifier) break;\n if (tsIsAccessModifier(modifier)) {\n if (modified.accessibility) {\n this.raise(TSErrors.DuplicateAccessibilityModifier, {\n at: startLoc,\n modifier\n });\n } else {\n enforceOrder(startLoc, modifier, modifier, \"override\");\n enforceOrder(startLoc, modifier, modifier, \"static\");\n enforceOrder(startLoc, modifier, modifier, \"readonly\");\n modified.accessibility = modifier;\n }\n } else if (tsIsVarianceAnnotations(modifier)) {\n if (modified[modifier]) {\n this.raise(TSErrors.DuplicateModifier, {\n at: startLoc,\n modifier\n });\n }\n modified[modifier] = true;\n enforceOrder(startLoc, modifier, \"in\", \"out\");\n } else {\n if (Object.hasOwnProperty.call(modified, modifier)) {\n this.raise(TSErrors.DuplicateModifier, {\n at: startLoc,\n modifier\n });\n } else {\n enforceOrder(startLoc, modifier, \"static\", \"readonly\");\n enforceOrder(startLoc, modifier, \"static\", \"override\");\n enforceOrder(startLoc, modifier, \"override\", \"readonly\");\n enforceOrder(startLoc, modifier, \"abstract\", \"override\");\n incompatible(startLoc, modifier, \"declare\", \"override\");\n incompatible(startLoc, modifier, \"static\", \"abstract\");\n }\n modified[modifier] = true;\n }\n if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) {\n this.raise(errorTemplate, {\n at: startLoc,\n modifier\n });\n }\n }\n }\n tsIsListTerminator(kind) {\n switch (kind) {\n case \"EnumMembers\":\n case \"TypeMembers\":\n return this.match(8);\n case \"HeritageClauseElement\":\n return this.match(5);\n case \"TupleElementTypes\":\n return this.match(3);\n case \"TypeParametersOrArguments\":\n return this.match(48);\n }\n throw new Error(\"Unreachable\");\n }\n tsParseList(kind, parseElement) {\n const result = [];\n while (!this.tsIsListTerminator(kind)) {\n result.push(parseElement());\n }\n return result;\n }\n tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) {\n return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos));\n }\n\n tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) {\n const result = [];\n let trailingCommaPos = -1;\n for (;;) {\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n trailingCommaPos = -1;\n const element = parseElement();\n if (element == null) {\n return undefined;\n }\n result.push(element);\n if (this.eat(12)) {\n trailingCommaPos = this.state.lastTokStart;\n continue;\n }\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n if (expectSuccess) {\n this.expect(12);\n }\n return undefined;\n }\n if (refTrailingCommaPos) {\n refTrailingCommaPos.value = trailingCommaPos;\n }\n return result;\n }\n tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) {\n if (!skipFirstToken) {\n if (bracket) {\n this.expect(0);\n } else {\n this.expect(47);\n }\n }\n const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos);\n if (bracket) {\n this.expect(3);\n } else {\n this.expect(48);\n }\n return result;\n }\n tsParseImportType() {\n const node = this.startNode();\n this.expect(83);\n this.expect(10);\n if (!this.match(131)) {\n this.raise(TSErrors.UnsupportedImportTypeArgument, {\n at: this.state.startLoc\n });\n }\n\n node.argument = super.parseExprAtom();\n this.expect(11);\n if (this.eat(16)) {\n node.qualifier = this.tsParseEntityName();\n }\n if (this.match(47)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSImportType\");\n }\n tsParseEntityName(allowReservedWords = true) {\n let entity = this.parseIdentifier(allowReservedWords);\n while (this.eat(16)) {\n const node = this.startNodeAtNode(entity);\n node.left = entity;\n node.right = this.parseIdentifier(allowReservedWords);\n entity = this.finishNode(node, \"TSQualifiedName\");\n }\n return entity;\n }\n tsParseTypeReference() {\n const node = this.startNode();\n node.typeName = this.tsParseEntityName();\n if (!this.hasPrecedingLineBreak() && this.match(47)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeReference\");\n }\n tsParseThisTypePredicate(lhs) {\n this.next();\n const node = this.startNodeAtNode(lhs);\n node.parameterName = lhs;\n node.typeAnnotation = this.tsParseTypeAnnotation(false);\n node.asserts = false;\n return this.finishNode(node, \"TSTypePredicate\");\n }\n tsParseThisTypeNode() {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, \"TSThisType\");\n }\n tsParseTypeQuery() {\n const node = this.startNode();\n this.expect(87);\n if (this.match(83)) {\n node.exprName = this.tsParseImportType();\n } else {\n node.exprName = this.tsParseEntityName();\n }\n if (!this.hasPrecedingLineBreak() && this.match(47)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeQuery\");\n }\n tsParseInOutModifiers(node) {\n this.tsParseModifiers({\n modified: node,\n allowedModifiers: [\"in\", \"out\"],\n disallowedModifiers: [\"public\", \"private\", \"protected\", \"readonly\", \"declare\", \"abstract\", \"override\"],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameter\n });\n }\n\n tsParseNoneModifiers(node) {\n this.tsParseModifiers({\n modified: node,\n allowedModifiers: [],\n disallowedModifiers: [\"in\", \"out\"],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions\n });\n }\n tsParseTypeParameter(parseModifiers = this.tsParseNoneModifiers.bind(this)) {\n const node = this.startNode();\n parseModifiers(node);\n node.name = this.tsParseTypeParameterName();\n node.constraint = this.tsEatThenParseType(81);\n node.default = this.tsEatThenParseType(29);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n tsTryParseTypeParameters(parseModifiers) {\n if (this.match(47)) {\n return this.tsParseTypeParameters(parseModifiers);\n }\n }\n tsParseTypeParameters(parseModifiers) {\n const node = this.startNode();\n if (this.match(47) || this.match(140)) {\n this.next();\n } else {\n this.unexpected();\n }\n const refTrailingCommaPos = {\n value: -1\n };\n node.params = this.tsParseBracketedList(\"TypeParametersOrArguments\",\n this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);\n if (node.params.length === 0) {\n this.raise(TSErrors.EmptyTypeParameters, {\n at: node\n });\n }\n if (refTrailingCommaPos.value !== -1) {\n this.addExtra(node, \"trailingComma\", refTrailingCommaPos.value);\n }\n return this.finishNode(node, \"TSTypeParameterDeclaration\");\n }\n\n tsFillSignature(returnToken, signature) {\n const returnTokenRequired = returnToken === 19;\n\n const paramsKey = \"parameters\";\n const returnTypeKey = \"typeAnnotation\";\n signature.typeParameters = this.tsTryParseTypeParameters();\n this.expect(10);\n signature[paramsKey] = this.tsParseBindingListForSignature();\n if (returnTokenRequired) {\n signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n } else if (this.match(returnToken)) {\n signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n }\n }\n tsParseBindingListForSignature() {\n return super.parseBindingList(11, 41).map(pattern => {\n if (pattern.type !== \"Identifier\" && pattern.type !== \"RestElement\" && pattern.type !== \"ObjectPattern\" && pattern.type !== \"ArrayPattern\") {\n this.raise(TSErrors.UnsupportedSignatureParameterKind, {\n at: pattern,\n type: pattern.type\n });\n }\n return pattern;\n });\n }\n tsParseTypeMemberSemicolon() {\n if (!this.eat(12) && !this.isLineTerminator()) {\n this.expect(13);\n }\n }\n tsParseSignatureMember(kind, node) {\n this.tsFillSignature(14, node);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, kind);\n }\n tsIsUnambiguouslyIndexSignature() {\n this.next();\n if (tokenIsIdentifier(this.state.type)) {\n this.next();\n return this.match(14);\n }\n return false;\n }\n tsTryParseIndexSignature(node) {\n if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {\n return undefined;\n }\n this.expect(0);\n const id = this.parseIdentifier();\n id.typeAnnotation = this.tsParseTypeAnnotation();\n this.resetEndLocation(id);\n\n this.expect(3);\n node.parameters = [id];\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, \"TSIndexSignature\");\n }\n tsParsePropertyOrMethodSignature(node, readonly) {\n if (this.eat(17)) node.optional = true;\n const nodeAny = node;\n if (this.match(10) || this.match(47)) {\n if (readonly) {\n this.raise(TSErrors.ReadonlyForMethodSignature, {\n at: node\n });\n }\n const method = nodeAny;\n if (method.kind && this.match(47)) {\n this.raise(TSErrors.AccesorCannotHaveTypeParameters, {\n at: this.state.curPosition()\n });\n }\n this.tsFillSignature(14, method);\n this.tsParseTypeMemberSemicolon();\n const paramsKey = \"parameters\";\n const returnTypeKey = \"typeAnnotation\";\n if (method.kind === \"get\") {\n if (method[paramsKey].length > 0) {\n this.raise(Errors.BadGetterArity, {\n at: this.state.curPosition()\n });\n if (this.isThisParam(method[paramsKey][0])) {\n this.raise(TSErrors.AccesorCannotDeclareThisParameter, {\n at: this.state.curPosition()\n });\n }\n }\n } else if (method.kind === \"set\") {\n if (method[paramsKey].length !== 1) {\n this.raise(Errors.BadSetterArity, {\n at: this.state.curPosition()\n });\n } else {\n const firstParameter = method[paramsKey][0];\n if (this.isThisParam(firstParameter)) {\n this.raise(TSErrors.AccesorCannotDeclareThisParameter, {\n at: this.state.curPosition()\n });\n }\n if (firstParameter.type === \"Identifier\" && firstParameter.optional) {\n this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, {\n at: this.state.curPosition()\n });\n }\n if (firstParameter.type === \"RestElement\") {\n this.raise(TSErrors.SetAccesorCannotHaveRestParameter, {\n at: this.state.curPosition()\n });\n }\n }\n if (method[returnTypeKey]) {\n this.raise(TSErrors.SetAccesorCannotHaveReturnType, {\n at: method[returnTypeKey]\n });\n }\n } else {\n method.kind = \"method\";\n }\n return this.finishNode(method, \"TSMethodSignature\");\n } else {\n const property = nodeAny;\n if (readonly) property.readonly = true;\n const type = this.tsTryParseTypeAnnotation();\n if (type) property.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(property, \"TSPropertySignature\");\n }\n }\n tsParseTypeMember() {\n const node = this.startNode();\n if (this.match(10) || this.match(47)) {\n return this.tsParseSignatureMember(\"TSCallSignatureDeclaration\", node);\n }\n if (this.match(77)) {\n const id = this.startNode();\n this.next();\n if (this.match(10) || this.match(47)) {\n return this.tsParseSignatureMember(\"TSConstructSignatureDeclaration\", node);\n } else {\n node.key = this.createIdentifier(id, \"new\");\n return this.tsParsePropertyOrMethodSignature(node, false);\n }\n }\n this.tsParseModifiers({\n modified: node,\n allowedModifiers: [\"readonly\"],\n disallowedModifiers: [\"declare\", \"abstract\", \"private\", \"protected\", \"public\", \"static\", \"override\"]\n });\n const idx = this.tsTryParseIndexSignature(node);\n if (idx) {\n return idx;\n }\n super.parsePropertyName(node);\n if (!node.computed && node.key.type === \"Identifier\" && (node.key.name === \"get\" || node.key.name === \"set\") && this.tsTokenCanFollowModifier()) {\n node.kind = node.key.name;\n super.parsePropertyName(node);\n }\n return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);\n }\n tsParseTypeLiteral() {\n const node = this.startNode();\n node.members = this.tsParseObjectTypeMembers();\n return this.finishNode(node, \"TSTypeLiteral\");\n }\n tsParseObjectTypeMembers() {\n this.expect(5);\n const members = this.tsParseList(\"TypeMembers\", this.tsParseTypeMember.bind(this));\n this.expect(8);\n return members;\n }\n tsIsStartOfMappedType() {\n this.next();\n if (this.eat(53)) {\n return this.isContextual(120);\n }\n if (this.isContextual(120)) {\n this.next();\n }\n if (!this.match(0)) {\n return false;\n }\n this.next();\n if (!this.tsIsIdentifier()) {\n return false;\n }\n this.next();\n return this.match(58);\n }\n tsParseMappedTypeParameter() {\n const node = this.startNode();\n node.name = this.tsParseTypeParameterName();\n node.constraint = this.tsExpectThenParseType(58);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n tsParseMappedType() {\n const node = this.startNode();\n this.expect(5);\n if (this.match(53)) {\n node.readonly = this.state.value;\n this.next();\n this.expectContextual(120);\n } else if (this.eatContextual(120)) {\n node.readonly = true;\n }\n this.expect(0);\n node.typeParameter = this.tsParseMappedTypeParameter();\n node.nameType = this.eatContextual(93) ? this.tsParseType() : null;\n this.expect(3);\n if (this.match(53)) {\n node.optional = this.state.value;\n this.next();\n this.expect(17);\n } else if (this.eat(17)) {\n node.optional = true;\n }\n node.typeAnnotation = this.tsTryParseType();\n this.semicolon();\n this.expect(8);\n return this.finishNode(node, \"TSMappedType\");\n }\n tsParseTupleType() {\n const node = this.startNode();\n node.elementTypes = this.tsParseBracketedList(\"TupleElementTypes\", this.tsParseTupleElementType.bind(this), true, false);\n\n let seenOptionalElement = false;\n let labeledElements = null;\n node.elementTypes.forEach(elementNode => {\n var _labeledElements;\n const {\n type\n } = elementNode;\n if (seenOptionalElement && type !== \"TSRestType\" && type !== \"TSOptionalType\" && !(type === \"TSNamedTupleMember\" && elementNode.optional)) {\n this.raise(TSErrors.OptionalTypeBeforeRequired, {\n at: elementNode\n });\n }\n seenOptionalElement || (seenOptionalElement = type === \"TSNamedTupleMember\" && elementNode.optional || type === \"TSOptionalType\");\n\n let checkType = type;\n if (type === \"TSRestType\") {\n elementNode = elementNode.typeAnnotation;\n checkType = elementNode.type;\n }\n const isLabeled = checkType === \"TSNamedTupleMember\";\n (_labeledElements = labeledElements) != null ? _labeledElements : labeledElements = isLabeled;\n if (labeledElements !== isLabeled) {\n this.raise(TSErrors.MixedLabeledAndUnlabeledElements, {\n at: elementNode\n });\n }\n });\n return this.finishNode(node, \"TSTupleType\");\n }\n tsParseTupleElementType() {\n\n const {\n startLoc\n } = this.state;\n const rest = this.eat(21);\n let type = this.tsParseType();\n const optional = this.eat(17);\n const labeled = this.eat(14);\n if (labeled) {\n const labeledNode = this.startNodeAtNode(type);\n labeledNode.optional = optional;\n if (type.type === \"TSTypeReference\" && !type.typeParameters && type.typeName.type === \"Identifier\") {\n labeledNode.label = type.typeName;\n } else {\n this.raise(TSErrors.InvalidTupleMemberLabel, {\n at: type\n });\n labeledNode.label = type;\n }\n labeledNode.elementType = this.tsParseType();\n type = this.finishNode(labeledNode, \"TSNamedTupleMember\");\n } else if (optional) {\n const optionalTypeNode = this.startNodeAtNode(type);\n optionalTypeNode.typeAnnotation = type;\n type = this.finishNode(optionalTypeNode, \"TSOptionalType\");\n }\n if (rest) {\n const restNode = this.startNodeAt(startLoc);\n restNode.typeAnnotation = type;\n type = this.finishNode(restNode, \"TSRestType\");\n }\n return type;\n }\n tsParseParenthesizedType() {\n const node = this.startNode();\n this.expect(10);\n node.typeAnnotation = this.tsParseType();\n this.expect(11);\n return this.finishNode(node, \"TSParenthesizedType\");\n }\n tsParseFunctionOrConstructorType(type, abstract) {\n const node = this.startNode();\n if (type === \"TSConstructorType\") {\n node.abstract = !!abstract;\n if (abstract) this.next();\n this.next();\n }\n\n this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node));\n return this.finishNode(node, type);\n }\n tsParseLiteralTypeNode() {\n const node = this.startNode();\n node.literal = (() => {\n switch (this.state.type) {\n case 132:\n case 133:\n case 131:\n case 85:\n case 86:\n return super.parseExprAtom();\n default:\n throw this.unexpected();\n }\n })();\n return this.finishNode(node, \"TSLiteralType\");\n }\n tsParseTemplateLiteralType() {\n const node = this.startNode();\n node.literal = super.parseTemplate(false);\n return this.finishNode(node, \"TSLiteralType\");\n }\n parseTemplateSubstitution() {\n if (this.state.inType) return this.tsParseType();\n return super.parseTemplateSubstitution();\n }\n tsParseThisTypeOrThisTypePredicate() {\n const thisKeyword = this.tsParseThisTypeNode();\n if (this.isContextual(114) && !this.hasPrecedingLineBreak()) {\n return this.tsParseThisTypePredicate(thisKeyword);\n } else {\n return thisKeyword;\n }\n }\n tsParseNonArrayType() {\n switch (this.state.type) {\n case 131:\n case 132:\n case 133:\n case 85:\n case 86:\n return this.tsParseLiteralTypeNode();\n case 53:\n if (this.state.value === \"-\") {\n const node = this.startNode();\n const nextToken = this.lookahead();\n if (nextToken.type !== 132 && nextToken.type !== 133) {\n throw this.unexpected();\n }\n node.literal = this.parseMaybeUnary();\n return this.finishNode(node, \"TSLiteralType\");\n }\n break;\n case 78:\n return this.tsParseThisTypeOrThisTypePredicate();\n case 87:\n return this.tsParseTypeQuery();\n case 83:\n return this.tsParseImportType();\n case 5:\n return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();\n case 0:\n return this.tsParseTupleType();\n case 10:\n return this.tsParseParenthesizedType();\n case 25:\n case 24:\n return this.tsParseTemplateLiteralType();\n default:\n {\n const {\n type\n } = this.state;\n if (tokenIsIdentifier(type) || type === 88 || type === 84) {\n const nodeType = type === 88 ? \"TSVoidKeyword\" : type === 84 ? \"TSNullKeyword\" : keywordTypeFromName(this.state.value);\n if (nodeType !== undefined && this.lookaheadCharCode() !== 46) {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, nodeType);\n }\n return this.tsParseTypeReference();\n }\n }\n }\n throw this.unexpected();\n }\n tsParseArrayTypeOrHigher() {\n let type = this.tsParseNonArrayType();\n while (!this.hasPrecedingLineBreak() && this.eat(0)) {\n if (this.match(3)) {\n const node = this.startNodeAtNode(type);\n node.elementType = type;\n this.expect(3);\n type = this.finishNode(node, \"TSArrayType\");\n } else {\n const node = this.startNodeAtNode(type);\n node.objectType = type;\n node.indexType = this.tsParseType();\n this.expect(3);\n type = this.finishNode(node, \"TSIndexedAccessType\");\n }\n }\n return type;\n }\n tsParseTypeOperator() {\n const node = this.startNode();\n const operator = this.state.value;\n this.next();\n node.operator = operator;\n node.typeAnnotation = this.tsParseTypeOperatorOrHigher();\n if (operator === \"readonly\") {\n this.tsCheckTypeAnnotationForReadOnly(\n node);\n }\n return this.finishNode(node, \"TSTypeOperator\");\n }\n tsCheckTypeAnnotationForReadOnly(node) {\n switch (node.typeAnnotation.type) {\n case \"TSTupleType\":\n case \"TSArrayType\":\n return;\n default:\n this.raise(TSErrors.UnexpectedReadonly, {\n at: node\n });\n }\n }\n tsParseInferType() {\n const node = this.startNode();\n this.expectContextual(113);\n const typeParameter = this.startNode();\n typeParameter.name = this.tsParseTypeParameterName();\n typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType());\n node.typeParameter = this.finishNode(typeParameter, \"TSTypeParameter\");\n return this.finishNode(node, \"TSInferType\");\n }\n tsParseConstraintForInferType() {\n if (this.eat(81)) {\n const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType());\n if (this.state.inDisallowConditionalTypesContext || !this.match(17)) {\n return constraint;\n }\n }\n }\n tsParseTypeOperatorOrHigher() {\n const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;\n return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(113) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());\n }\n tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {\n const node = this.startNode();\n const hasLeadingOperator = this.eat(operator);\n const types = [];\n do {\n types.push(parseConstituentType());\n } while (this.eat(operator));\n if (types.length === 1 && !hasLeadingOperator) {\n return types[0];\n }\n node.types = types;\n return this.finishNode(node, kind);\n }\n tsParseIntersectionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\"TSIntersectionType\", this.tsParseTypeOperatorOrHigher.bind(this), 45);\n }\n tsParseUnionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\"TSUnionType\", this.tsParseIntersectionTypeOrHigher.bind(this), 43);\n }\n tsIsStartOfFunctionType() {\n if (this.match(47)) {\n return true;\n }\n return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));\n }\n tsSkipParameterStart() {\n if (tokenIsIdentifier(this.state.type) || this.match(78)) {\n this.next();\n return true;\n }\n if (this.match(5)) {\n const {\n errors\n } = this.state;\n const previousErrorCount = errors.length;\n try {\n this.parseObjectLike(8, true);\n return errors.length === previousErrorCount;\n } catch (_unused) {\n return false;\n }\n }\n if (this.match(0)) {\n this.next();\n const {\n errors\n } = this.state;\n const previousErrorCount = errors.length;\n try {\n super.parseBindingList(3, 93, true);\n return errors.length === previousErrorCount;\n } catch (_unused2) {\n return false;\n }\n }\n return false;\n }\n tsIsUnambiguouslyStartOfFunctionType() {\n this.next();\n if (this.match(11) || this.match(21)) {\n return true;\n }\n if (this.tsSkipParameterStart()) {\n if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) {\n return true;\n }\n if (this.match(11)) {\n this.next();\n if (this.match(19)) {\n return true;\n }\n }\n }\n return false;\n }\n tsParseTypeOrTypePredicateAnnotation(returnToken) {\n return this.tsInType(() => {\n const t = this.startNode();\n this.expect(returnToken);\n const node = this.startNode();\n const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));\n if (asserts && this.match(78)) {\n let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();\n if (thisTypePredicate.type === \"TSThisType\") {\n node.parameterName = thisTypePredicate;\n node.asserts = true;\n node.typeAnnotation = null;\n thisTypePredicate = this.finishNode(node, \"TSTypePredicate\");\n } else {\n this.resetStartLocationFromNode(thisTypePredicate, node);\n thisTypePredicate.asserts = true;\n }\n t.typeAnnotation = thisTypePredicate;\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));\n if (!typePredicateVariable) {\n if (!asserts) {\n return this.tsParseTypeAnnotation(false, t);\n }\n\n node.parameterName = this.parseIdentifier();\n node.asserts = asserts;\n node.typeAnnotation = null;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n const type = this.tsParseTypeAnnotation(false);\n node.parameterName = typePredicateVariable;\n node.typeAnnotation = type;\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n });\n }\n tsTryParseTypeOrTypePredicateAnnotation() {\n return this.match(14) ? this.tsParseTypeOrTypePredicateAnnotation(14) : undefined;\n }\n tsTryParseTypeAnnotation() {\n return this.match(14) ? this.tsParseTypeAnnotation() : undefined;\n }\n tsTryParseType() {\n return this.tsEatThenParseType(14);\n }\n tsParseTypePredicatePrefix() {\n const id = this.parseIdentifier();\n if (this.isContextual(114) && !this.hasPrecedingLineBreak()) {\n this.next();\n return id;\n }\n }\n tsParseTypePredicateAsserts() {\n if (this.state.type !== 107) {\n return false;\n }\n const containsEsc = this.state.containsEsc;\n this.next();\n if (!tokenIsIdentifier(this.state.type) && !this.match(78)) {\n return false;\n }\n if (containsEsc) {\n this.raise(Errors.InvalidEscapedReservedWord, {\n at: this.state.lastTokStartLoc,\n reservedWord: \"asserts\"\n });\n }\n return true;\n }\n tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {\n this.tsInType(() => {\n if (eatColon) this.expect(14);\n t.typeAnnotation = this.tsParseType();\n });\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n tsParseType() {\n assert(this.state.inType);\n const type = this.tsParseNonConditionalType();\n if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) {\n return type;\n }\n const node = this.startNodeAtNode(type);\n node.checkType = type;\n node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType());\n this.expect(17);\n node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());\n this.expect(14);\n node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());\n return this.finishNode(node, \"TSConditionalType\");\n }\n isAbstractConstructorSignature() {\n return this.isContextual(122) && this.lookahead().type === 77;\n }\n tsParseNonConditionalType() {\n if (this.tsIsStartOfFunctionType()) {\n return this.tsParseFunctionOrConstructorType(\"TSFunctionType\");\n }\n if (this.match(77)) {\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\");\n } else if (this.isAbstractConstructorSignature()) {\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\", true);\n }\n return this.tsParseUnionTypeOrHigher();\n }\n tsParseTypeAssertion() {\n if (this.getPluginOption(\"typescript\", \"disallowAmbiguousJSXLike\")) {\n this.raise(TSErrors.ReservedTypeAssertion, {\n at: this.state.startLoc\n });\n }\n const node = this.startNode();\n node.typeAnnotation = this.tsInType(() => {\n this.next();\n return this.match(75) ? this.tsParseTypeReference() : this.tsParseType();\n });\n this.expect(48);\n node.expression = this.parseMaybeUnary();\n return this.finishNode(node, \"TSTypeAssertion\");\n }\n tsParseHeritageClause(token) {\n const originalStartLoc = this.state.startLoc;\n const delimitedList = this.tsParseDelimitedList(\"HeritageClauseElement\", () => {\n const node = this.startNode();\n node.expression = this.tsParseEntityName();\n if (this.match(47)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSExpressionWithTypeArguments\");\n });\n if (!delimitedList.length) {\n this.raise(TSErrors.EmptyHeritageClauseType, {\n at: originalStartLoc,\n token\n });\n }\n return delimitedList;\n }\n tsParseInterfaceDeclaration(node, properties = {}) {\n if (this.hasFollowingLineBreak()) return null;\n this.expectContextual(127);\n if (properties.declare) node.declare = true;\n if (tokenIsIdentifier(this.state.type)) {\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_TS_INTERFACE);\n } else {\n node.id = null;\n this.raise(TSErrors.MissingInterfaceName, {\n at: this.state.startLoc\n });\n }\n node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));\n if (this.eat(81)) {\n node.extends = this.tsParseHeritageClause(\"extends\");\n }\n const body = this.startNode();\n body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));\n node.body = this.finishNode(body, \"TSInterfaceBody\");\n return this.finishNode(node, \"TSInterfaceDeclaration\");\n }\n tsParseTypeAliasDeclaration(node) {\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_TS_TYPE);\n node.typeAnnotation = this.tsInType(() => {\n node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));\n this.expect(29);\n if (this.isContextual(112) && this.lookahead().type !== 16) {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, \"TSIntrinsicKeyword\");\n }\n return this.tsParseType();\n });\n this.semicolon();\n return this.finishNode(node, \"TSTypeAliasDeclaration\");\n }\n tsInNoContext(cb) {\n const oldContext = this.state.context;\n this.state.context = [oldContext[0]];\n try {\n return cb();\n } finally {\n this.state.context = oldContext;\n }\n }\n\n tsInType(cb) {\n const oldInType = this.state.inType;\n this.state.inType = true;\n try {\n return cb();\n } finally {\n this.state.inType = oldInType;\n }\n }\n tsInDisallowConditionalTypesContext(cb) {\n const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;\n this.state.inDisallowConditionalTypesContext = true;\n try {\n return cb();\n } finally {\n this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n }\n }\n tsInAllowConditionalTypesContext(cb) {\n const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;\n this.state.inDisallowConditionalTypesContext = false;\n try {\n return cb();\n } finally {\n this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n }\n }\n tsEatThenParseType(token) {\n return !this.match(token) ? undefined : this.tsNextThenParseType();\n }\n tsExpectThenParseType(token) {\n return this.tsDoThenParseType(() => this.expect(token));\n }\n tsNextThenParseType() {\n return this.tsDoThenParseType(() => this.next());\n }\n tsDoThenParseType(cb) {\n return this.tsInType(() => {\n cb();\n return this.tsParseType();\n });\n }\n tsParseEnumMember() {\n const node = this.startNode();\n node.id = this.match(131) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);\n if (this.eat(29)) {\n node.initializer = super.parseMaybeAssignAllowIn();\n }\n return this.finishNode(node, \"TSEnumMember\");\n }\n tsParseEnumDeclaration(node, properties = {}) {\n if (properties.const) node.const = true;\n if (properties.declare) node.declare = true;\n this.expectContextual(124);\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, node.const ? BIND_TS_CONST_ENUM : BIND_TS_ENUM);\n this.expect(5);\n node.members = this.tsParseDelimitedList(\"EnumMembers\", this.tsParseEnumMember.bind(this));\n this.expect(8);\n return this.finishNode(node, \"TSEnumDeclaration\");\n }\n tsParseModuleBlock() {\n const node = this.startNode();\n this.scope.enter(SCOPE_OTHER);\n this.expect(5);\n super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8);\n this.scope.exit();\n return this.finishNode(node, \"TSModuleBlock\");\n }\n tsParseModuleOrNamespaceDeclaration(node, nested = false) {\n node.id = this.parseIdentifier();\n if (!nested) {\n this.checkIdentifier(node.id, BIND_TS_NAMESPACE);\n }\n if (this.eat(16)) {\n const inner = this.startNode();\n this.tsParseModuleOrNamespaceDeclaration(inner, true);\n node.body = inner;\n } else {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n }\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n tsParseAmbientExternalModuleDeclaration(node) {\n if (this.isContextual(110)) {\n node.global = true;\n node.id = this.parseIdentifier();\n } else if (this.match(131)) {\n node.id = super.parseStringLiteral(this.state.value);\n } else {\n this.unexpected();\n }\n if (this.match(5)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n } else {\n this.semicolon();\n }\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n tsParseImportEqualsDeclaration(node, isExport) {\n node.isExport = isExport || false;\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_FLAGS_TS_IMPORT);\n this.expect(29);\n const moduleReference = this.tsParseModuleReference();\n if (node.importKind === \"type\" && moduleReference.type !== \"TSExternalModuleReference\") {\n this.raise(TSErrors.ImportAliasHasImportType, {\n at: moduleReference\n });\n }\n node.moduleReference = moduleReference;\n this.semicolon();\n return this.finishNode(node, \"TSImportEqualsDeclaration\");\n }\n tsIsExternalModuleReference() {\n return this.isContextual(117) && this.lookaheadCharCode() === 40;\n }\n tsParseModuleReference() {\n return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);\n }\n tsParseExternalModuleReference() {\n const node = this.startNode();\n this.expectContextual(117);\n this.expect(10);\n if (!this.match(131)) {\n throw this.unexpected();\n }\n node.expression = super.parseExprAtom();\n this.expect(11);\n return this.finishNode(node, \"TSExternalModuleReference\");\n }\n\n tsLookAhead(f) {\n const state = this.state.clone();\n const res = f();\n this.state = state;\n return res;\n }\n tsTryParseAndCatch(f) {\n const result = this.tryParse(abort =>\n f() || abort());\n if (result.aborted || !result.node) return undefined;\n if (result.error) this.state = result.failState;\n return result.node;\n }\n tsTryParse(f) {\n const state = this.state.clone();\n const result = f();\n if (result !== undefined && result !== false) {\n return result;\n } else {\n this.state = state;\n return undefined;\n }\n }\n tsTryParseDeclare(nany) {\n if (this.isLineTerminator()) {\n return;\n }\n let starttype = this.state.type;\n let kind;\n if (this.isContextual(99)) {\n starttype = 74;\n kind = \"let\";\n }\n\n return this.tsInAmbientContext(() => {\n if (starttype === 68) {\n nany.declare = true;\n return super.parseFunctionStatement(nany, false, false);\n }\n if (starttype === 80) {\n nany.declare = true;\n return this.parseClass(nany, true, false);\n }\n if (starttype === 124) {\n return this.tsParseEnumDeclaration(nany, {\n declare: true\n });\n }\n if (starttype === 110) {\n return this.tsParseAmbientExternalModuleDeclaration(nany);\n }\n if (starttype === 75 || starttype === 74) {\n if (!this.match(75) || !this.isLookaheadContextual(\"enum\")) {\n nany.declare = true;\n return this.parseVarStatement(nany, kind || this.state.value, true);\n }\n\n this.expect(75);\n return this.tsParseEnumDeclaration(nany, {\n const: true,\n declare: true\n });\n }\n if (starttype === 127) {\n const result = this.tsParseInterfaceDeclaration(nany, {\n declare: true\n });\n if (result) return result;\n }\n if (tokenIsIdentifier(starttype)) {\n return this.tsParseDeclaration(nany, this.state.value, true, null);\n }\n });\n }\n\n tsTryParseExportDeclaration() {\n return this.tsParseDeclaration(this.startNode(), this.state.value, true, null);\n }\n tsParseExpressionStatement(node, expr, decorators) {\n switch (expr.name) {\n case \"declare\":\n {\n const declaration = this.tsTryParseDeclare(node);\n if (declaration) {\n declaration.declare = true;\n return declaration;\n }\n break;\n }\n case \"global\":\n if (this.match(5)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n const mod = node;\n mod.global = true;\n mod.id = expr;\n mod.body = this.tsParseModuleBlock();\n this.scope.exit();\n this.prodParam.exit();\n return this.finishNode(mod, \"TSModuleDeclaration\");\n }\n break;\n default:\n return this.tsParseDeclaration(node, expr.name, false, decorators);\n }\n }\n\n tsParseDeclaration(node, value, next, decorators) {\n switch (value) {\n case \"abstract\":\n if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {\n return this.tsParseAbstractDeclaration(node, decorators);\n }\n break;\n case \"module\":\n if (this.tsCheckLineTerminator(next)) {\n if (this.match(131)) {\n return this.tsParseAmbientExternalModuleDeclaration(node);\n } else if (tokenIsIdentifier(this.state.type)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n }\n break;\n case \"namespace\":\n if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n break;\n case \"type\":\n if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {\n return this.tsParseTypeAliasDeclaration(node);\n }\n break;\n }\n }\n tsCheckLineTerminator(next) {\n if (next) {\n if (this.hasFollowingLineBreak()) return false;\n this.next();\n return true;\n }\n return !this.isLineTerminator();\n }\n tsTryParseGenericAsyncArrowFunction(startLoc) {\n if (!this.match(47)) {\n return undefined;\n }\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = true;\n const res = this.tsTryParseAndCatch(() => {\n const node = this.startNodeAt(startLoc);\n node.typeParameters = this.tsParseTypeParameters();\n super.parseFunctionParams(node);\n node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();\n this.expect(19);\n return node;\n });\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n if (!res) {\n return undefined;\n }\n return super.parseArrowExpression(res, null, true);\n }\n\n tsParseTypeArgumentsInExpression() {\n if (this.reScan_lt() !== 47) {\n return undefined;\n }\n return this.tsParseTypeArguments();\n }\n tsParseTypeArguments() {\n const node = this.startNode();\n node.params = this.tsInType(() =>\n this.tsInNoContext(() => {\n this.expect(47);\n return this.tsParseDelimitedList(\"TypeParametersOrArguments\", this.tsParseType.bind(this));\n }));\n if (node.params.length === 0) {\n this.raise(TSErrors.EmptyTypeArguments, {\n at: node\n });\n }\n this.expect(48);\n return this.finishNode(node, \"TSTypeParameterInstantiation\");\n }\n tsIsDeclarationStart() {\n return tokenIsTSDeclarationStart(this.state.type);\n }\n\n isExportDefaultSpecifier() {\n if (this.tsIsDeclarationStart()) return false;\n return super.isExportDefaultSpecifier();\n }\n parseAssignableListItem(allowModifiers, decorators) {\n const startLoc = this.state.startLoc;\n let accessibility;\n let readonly = false;\n let override = false;\n if (allowModifiers !== undefined) {\n const modified = {};\n this.tsParseModifiers({\n modified,\n allowedModifiers: [\"public\", \"private\", \"protected\", \"override\", \"readonly\"]\n });\n accessibility = modified.accessibility;\n override = modified.override;\n readonly = modified.readonly;\n if (allowModifiers === false && (accessibility || readonly || override)) {\n this.raise(TSErrors.UnexpectedParameterModifier, {\n at: startLoc\n });\n }\n }\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left);\n const elt = this.parseMaybeDefault(left.loc.start, left);\n if (accessibility || readonly || override) {\n const pp = this.startNodeAt(startLoc);\n if (decorators.length) {\n pp.decorators = decorators;\n }\n if (accessibility) pp.accessibility = accessibility;\n if (readonly) pp.readonly = readonly;\n if (override) pp.override = override;\n if (elt.type !== \"Identifier\" && elt.type !== \"AssignmentPattern\") {\n this.raise(TSErrors.UnsupportedParameterPropertyKind, {\n at: pp\n });\n }\n pp.parameter = elt;\n return this.finishNode(pp, \"TSParameterProperty\");\n }\n if (decorators.length) {\n left.decorators = decorators;\n }\n return elt;\n }\n isSimpleParameter(node) {\n return node.type === \"TSParameterProperty\" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node);\n }\n parseFunctionBodyAndFinish(node, type, isMethod = false) {\n if (this.match(14)) {\n node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14);\n }\n const bodilessType = type === \"FunctionDeclaration\" ? \"TSDeclareFunction\" : type === \"ClassMethod\" || type === \"ClassPrivateMethod\" ? \"TSDeclareMethod\" : undefined;\n if (bodilessType && !this.match(5) && this.isLineTerminator()) {\n return this.finishNode(node, bodilessType);\n }\n if (bodilessType === \"TSDeclareFunction\" && this.state.isAmbientContext) {\n this.raise(TSErrors.DeclareFunctionHasImplementation, {\n at: node\n });\n if (node.declare) {\n return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);\n }\n }\n return super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n registerFunctionStatementId(node) {\n if (!node.body && node.id) {\n this.checkIdentifier(node.id, BIND_TS_AMBIENT);\n } else {\n super.registerFunctionStatementId(node);\n }\n }\n tsCheckForInvalidTypeCasts(items) {\n items.forEach(node => {\n if ((node == null ? void 0 : node.type) === \"TSTypeCastExpression\") {\n this.raise(TSErrors.UnexpectedTypeAnnotation, {\n at: node.typeAnnotation\n });\n }\n });\n }\n toReferencedList(exprList,\n isInParens) {\n this.tsCheckForInvalidTypeCasts(exprList);\n return exprList;\n }\n parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {\n const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);\n if (node.type === \"ArrayExpression\") {\n this.tsCheckForInvalidTypeCasts(node.elements);\n }\n return node;\n }\n parseSubscript(base, startLoc, noCalls, state) {\n if (!this.hasPrecedingLineBreak() && this.match(35)) {\n this.state.canStartJSXElement = false;\n this.next();\n const nonNullExpression = this.startNodeAt(startLoc);\n nonNullExpression.expression = base;\n return this.finishNode(nonNullExpression, \"TSNonNullExpression\");\n }\n let isOptionalCall = false;\n if (this.match(18) && this.lookaheadCharCode() === 60) {\n if (noCalls) {\n state.stop = true;\n return base;\n }\n state.optionalChainMember = isOptionalCall = true;\n this.next();\n }\n\n if (this.match(47) || this.match(51)) {\n let missingParenErrorLoc;\n const result = this.tsTryParseAndCatch(() => {\n if (!noCalls && this.atPossibleAsyncArrow(base)) {\n const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc);\n if (asyncArrowFn) {\n return asyncArrowFn;\n }\n }\n const typeArguments = this.tsParseTypeArgumentsInExpression();\n if (!typeArguments) return;\n if (isOptionalCall && !this.match(10)) {\n missingParenErrorLoc = this.state.curPosition();\n return;\n }\n if (tokenIsTemplate(this.state.type)) {\n const result = super.parseTaggedTemplateExpression(base, startLoc, state);\n result.typeParameters = typeArguments;\n return result;\n }\n if (!noCalls && this.eat(10)) {\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.arguments = this.parseCallExpressionArguments(11, false);\n\n this.tsCheckForInvalidTypeCasts(node.arguments);\n node.typeParameters = typeArguments;\n if (state.optionalChainMember) {\n node.optional = isOptionalCall;\n }\n return this.finishCallExpression(node, state.optionalChainMember);\n }\n const tokenType = this.state.type;\n if (\n tokenType === 48 ||\n tokenType === 52 ||\n tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {\n return;\n }\n const node = this.startNodeAt(startLoc);\n node.expression = base;\n node.typeParameters = typeArguments;\n return this.finishNode(node, \"TSInstantiationExpression\");\n });\n if (missingParenErrorLoc) {\n this.unexpected(missingParenErrorLoc, 10);\n }\n if (result) {\n if (result.type === \"TSInstantiationExpression\" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) {\n this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, {\n at: this.state.startLoc\n });\n }\n return result;\n }\n }\n return super.parseSubscript(base, startLoc, noCalls, state);\n }\n parseNewCallee(node) {\n var _callee$extra;\n super.parseNewCallee(node);\n const {\n callee\n } = node;\n if (callee.type === \"TSInstantiationExpression\" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) {\n node.typeParameters = callee.typeParameters;\n node.callee = callee.expression;\n }\n }\n parseExprOp(left, leftStartLoc, minPrec) {\n let isSatisfies;\n if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(118)))) {\n const node = this.startNodeAt(leftStartLoc);\n node.expression = left;\n node.typeAnnotation = this.tsInType(() => {\n this.next();\n if (this.match(75)) {\n if (isSatisfies) {\n this.raise(Errors.UnexpectedKeyword, {\n at: this.state.startLoc,\n keyword: \"const\"\n });\n }\n return this.tsParseTypeReference();\n }\n return this.tsParseType();\n });\n this.finishNode(node, isSatisfies ? \"TSSatisfiesExpression\" : \"TSAsExpression\");\n this.reScan_lt_gt();\n return this.parseExprOp(\n node, leftStartLoc, minPrec);\n }\n return super.parseExprOp(left, leftStartLoc, minPrec);\n }\n checkReservedWord(word, startLoc, checkKeywords, isBinding) {\n if (!this.state.isAmbientContext) {\n super.checkReservedWord(word, startLoc, checkKeywords, isBinding);\n }\n }\n checkImportReflection(node) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(TSErrors.ImportReflectionHasImportType, {\n at: node.specifiers[0].loc.start\n });\n }\n }\n\n checkDuplicateExports() {}\n parseImport(node) {\n node.importKind = \"value\";\n if (tokenIsIdentifier(this.state.type) || this.match(55) || this.match(5)) {\n let ahead = this.lookahead();\n if (this.isContextual(128) &&\n ahead.type !== 12 &&\n ahead.type !== 97 &&\n ahead.type !== 29) {\n node.importKind = \"type\";\n this.next();\n ahead = this.lookahead();\n }\n if (tokenIsIdentifier(this.state.type) && ahead.type === 29) {\n return this.tsParseImportEqualsDeclaration(node);\n }\n }\n const importNode = super.parseImport(node);\n\n if (importNode.importKind === \"type\" &&\n importNode.specifiers.length > 1 &&\n importNode.specifiers[0].type === \"ImportDefaultSpecifier\") {\n this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, {\n at: importNode\n });\n }\n return importNode;\n }\n parseExport(node, decorators) {\n if (this.match(83)) {\n this.next();\n if (this.isContextual(128) && this.lookaheadCharCode() !== 61) {\n node.importKind = \"type\";\n this.next();\n } else {\n node.importKind = \"value\";\n }\n return this.tsParseImportEqualsDeclaration(node, true);\n } else if (this.eat(29)) {\n const assign = node;\n assign.expression = super.parseExpression();\n this.semicolon();\n return this.finishNode(assign, \"TSExportAssignment\");\n } else if (this.eatContextual(93)) {\n const decl = node;\n this.expectContextual(126);\n decl.id = this.parseIdentifier();\n this.semicolon();\n return this.finishNode(decl, \"TSNamespaceExportDeclaration\");\n } else {\n if (this.isContextual(128) && this.lookahead().type === 5) {\n this.next();\n node.exportKind = \"type\";\n } else {\n node.exportKind = \"value\";\n }\n return super.parseExport(node, decorators);\n }\n }\n isAbstractClass() {\n return this.isContextual(122) && this.lookahead().type === 80;\n }\n parseExportDefaultExpression() {\n if (this.isAbstractClass()) {\n const cls = this.startNode();\n this.next();\n cls.abstract = true;\n return this.parseClass(cls, true, true);\n }\n\n if (this.match(127)) {\n const result = this.tsParseInterfaceDeclaration(this.startNode());\n if (result) return result;\n }\n return super.parseExportDefaultExpression();\n }\n parseVarStatement(node, kind, allowMissingInitializer = false) {\n const {\n isAmbientContext\n } = this.state;\n const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext);\n if (!isAmbientContext) return declaration;\n for (const {\n id,\n init\n } of declaration.declarations) {\n if (!init) continue;\n\n if (kind !== \"const\" || !!id.typeAnnotation) {\n this.raise(TSErrors.InitializerNotAllowedInAmbientContext, {\n at: init\n });\n } else if (init.type !== \"StringLiteral\" && init.type !== \"BooleanLiteral\" && init.type !== \"NumericLiteral\" && init.type !== \"BigIntLiteral\" && (init.type !== \"TemplateLiteral\" || init.expressions.length > 0) && !isPossiblyLiteralEnum(init)) {\n this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, {\n at: init\n });\n }\n }\n return declaration;\n }\n parseStatementContent(flags, decorators) {\n if (this.match(75) && this.isLookaheadContextual(\"enum\")) {\n const node = this.startNode();\n this.expect(75);\n return this.tsParseEnumDeclaration(node, {\n const: true\n });\n }\n if (this.isContextual(124)) {\n return this.tsParseEnumDeclaration(this.startNode());\n }\n if (this.isContextual(127)) {\n const result = this.tsParseInterfaceDeclaration(this.startNode());\n if (result) return result;\n }\n return super.parseStatementContent(flags, decorators);\n }\n parseAccessModifier() {\n return this.tsParseModifier([\"public\", \"protected\", \"private\"]);\n }\n tsHasSomeModifiers(member, modifiers) {\n return modifiers.some(modifier => {\n if (tsIsAccessModifier(modifier)) {\n return member.accessibility === modifier;\n }\n return !!member[modifier];\n });\n }\n tsIsStartOfStaticBlocks() {\n return this.isContextual(104) && this.lookaheadCharCode() === 123;\n }\n parseClassMember(classBody, member, state) {\n const modifiers = [\"declare\", \"private\", \"public\", \"protected\", \"override\", \"abstract\", \"readonly\", \"static\"];\n this.tsParseModifiers({\n modified: member,\n allowedModifiers: modifiers,\n disallowedModifiers: [\"in\", \"out\"],\n stopOnStartOfClassStaticBlock: true,\n errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions\n });\n const callParseClassMemberWithIsStatic = () => {\n if (this.tsIsStartOfStaticBlocks()) {\n this.next();\n this.next();\n if (this.tsHasSomeModifiers(member, modifiers)) {\n this.raise(TSErrors.StaticBlockCannotHaveModifier, {\n at: this.state.curPosition()\n });\n }\n super.parseClassStaticBlock(classBody, member);\n } else {\n this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static);\n }\n };\n if (member.declare) {\n this.tsInAmbientContext(callParseClassMemberWithIsStatic);\n } else {\n callParseClassMemberWithIsStatic();\n }\n }\n parseClassMemberWithIsStatic(classBody, member, state, isStatic) {\n const idx = this.tsTryParseIndexSignature(member);\n if (idx) {\n classBody.body.push(idx);\n if (member.abstract) {\n this.raise(TSErrors.IndexSignatureHasAbstract, {\n at: member\n });\n }\n if (member.accessibility) {\n this.raise(TSErrors.IndexSignatureHasAccessibility, {\n at: member,\n modifier: member.accessibility\n });\n }\n if (member.declare) {\n this.raise(TSErrors.IndexSignatureHasDeclare, {\n at: member\n });\n }\n if (member.override) {\n this.raise(TSErrors.IndexSignatureHasOverride, {\n at: member\n });\n }\n return;\n }\n if (!this.state.inAbstractClass && member.abstract) {\n this.raise(TSErrors.NonAbstractClassHasAbstractMethod, {\n at: member\n });\n }\n if (member.override) {\n if (!state.hadSuperClass) {\n this.raise(TSErrors.OverrideNotInSubClass, {\n at: member\n });\n }\n }\n\n super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n parsePostMemberNameModifiers(methodOrProp) {\n const optional = this.eat(17);\n if (optional) methodOrProp.optional = true;\n if (methodOrProp.readonly && this.match(10)) {\n this.raise(TSErrors.ClassMethodHasReadonly, {\n at: methodOrProp\n });\n }\n if (methodOrProp.declare && this.match(10)) {\n this.raise(TSErrors.ClassMethodHasDeclare, {\n at: methodOrProp\n });\n }\n }\n\n parseExpressionStatement(node, expr, decorators) {\n const decl = expr.type === \"Identifier\" ?\n this.tsParseExpressionStatement(node, expr, decorators) : undefined;\n return decl || super.parseExpressionStatement(node, expr, decorators);\n }\n\n shouldParseExportDeclaration() {\n if (this.tsIsDeclarationStart()) return true;\n return super.shouldParseExportDeclaration();\n }\n\n parseConditional(expr, startLoc, refExpressionErrors) {\n if (!this.state.maybeInArrowParameters || !this.match(17)) {\n return super.parseConditional(expr, startLoc, refExpressionErrors);\n }\n const result = this.tryParse(() => super.parseConditional(expr, startLoc));\n if (!result.node) {\n if (result.error) {\n super.setOptionalParametersError(refExpressionErrors, result.error);\n }\n return expr;\n }\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n parseParenItem(node, startLoc) {\n node = super.parseParenItem(node, startLoc);\n if (this.eat(17)) {\n node.optional = true;\n this.resetEndLocation(node);\n }\n if (this.match(14)) {\n const typeCastNode = this.startNodeAt(startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();\n return this.finishNode(typeCastNode, \"TSTypeCastExpression\");\n }\n return node;\n }\n parseExportDeclaration(node) {\n if (!this.state.isAmbientContext && this.isContextual(123)) {\n return this.tsInAmbientContext(() => this.parseExportDeclaration(node));\n }\n\n const startLoc = this.state.startLoc;\n const isDeclare = this.eatContextual(123);\n if (isDeclare && (this.isContextual(123) || !this.shouldParseExportDeclaration())) {\n throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, {\n at: this.state.startLoc\n });\n }\n const isIdentifier = tokenIsIdentifier(this.state.type);\n const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node);\n if (!declaration) return null;\n if (declaration.type === \"TSInterfaceDeclaration\" || declaration.type === \"TSTypeAliasDeclaration\" || isDeclare) {\n node.exportKind = \"type\";\n }\n if (isDeclare) {\n this.resetStartLocation(declaration, startLoc);\n declaration.declare = true;\n }\n return declaration;\n }\n parseClassId(node, isStatement, optionalId,\n bindingType) {\n if ((!isStatement || optionalId) && this.isContextual(111)) {\n return;\n }\n super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS);\n const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));\n if (typeParameters) node.typeParameters = typeParameters;\n }\n parseClassPropertyAnnotation(node) {\n if (!node.optional && this.eat(35)) {\n node.definite = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n }\n parseClassProperty(node) {\n this.parseClassPropertyAnnotation(node);\n if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) {\n this.raise(TSErrors.DeclareClassFieldHasInitializer, {\n at: this.state.startLoc\n });\n }\n if (node.abstract && this.match(29)) {\n const {\n key\n } = node;\n this.raise(TSErrors.AbstractPropertyHasInitializer, {\n at: this.state.startLoc,\n propertyName: key.type === \"Identifier\" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`\n });\n }\n return super.parseClassProperty(node);\n }\n parseClassPrivateProperty(node) {\n if (node.abstract) {\n this.raise(TSErrors.PrivateElementHasAbstract, {\n at: node\n });\n }\n\n if (node.accessibility) {\n this.raise(TSErrors.PrivateElementHasAccessibility, {\n at: node,\n modifier: node.accessibility\n });\n }\n this.parseClassPropertyAnnotation(node);\n return super.parseClassPrivateProperty(node);\n }\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters && isConstructor) {\n this.raise(TSErrors.ConstructorHasTypeParameters, {\n at: typeParameters\n });\n }\n\n const {\n declare = false,\n kind\n } = method;\n if (declare && (kind === \"get\" || kind === \"set\")) {\n this.raise(TSErrors.DeclareAccessor, {\n at: method,\n kind\n });\n }\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);\n }\n pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n declareClassPrivateMethodInScope(node, kind) {\n if (node.type === \"TSDeclareMethod\") return;\n if (node.type === \"MethodDefinition\" && !node.value.body) return;\n super.declareClassPrivateMethodInScope(node, kind);\n }\n parseClassSuper(node) {\n super.parseClassSuper(node);\n if (node.superClass && (this.match(47) || this.match(51))) {\n node.superTypeParameters = this.tsParseTypeArgumentsInExpression();\n }\n if (this.eatContextual(111)) {\n node.implements = this.tsParseHeritageClause(\"implements\");\n }\n }\n parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) prop.typeParameters = typeParameters;\n return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);\n }\n parseFunctionParams(node, allowModifiers) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n super.parseFunctionParams(node, allowModifiers);\n }\n\n parseVarId(decl, kind) {\n super.parseVarId(decl, kind);\n if (decl.id.type === \"Identifier\" && !this.hasPrecedingLineBreak() && this.eat(35)) {\n decl.definite = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) {\n decl.id.typeAnnotation = type;\n this.resetEndLocation(decl.id);\n }\n }\n\n parseAsyncArrowFromCallExpression(node, call) {\n if (this.match(14)) {\n node.returnType = this.tsParseTypeAnnotation();\n }\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n parseMaybeAssign(refExpressionErrors, afterLeftParse) {\n var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3;\n\n let state;\n let jsx;\n let typeCast;\n if (this.hasPlugin(\"jsx\") && (this.match(140) || this.match(47))) {\n state = this.state.clone();\n jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);\n\n if (!jsx.error) return jsx.node;\n\n const {\n context\n } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === types.j_oTag || currentContext === types.j_expr) {\n context.pop();\n }\n }\n if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) {\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n if (!state || state === this.state) state = this.state.clone();\n let typeParameters;\n const arrow = this.tryParse(abort => {\n var _expr$extra, _typeParameters;\n typeParameters = this.tsParseTypeParameters();\n const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n if (expr.type !== \"ArrowFunctionExpression\" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {\n abort();\n }\n\n if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {\n this.resetStartLocationFromNode(expr, typeParameters);\n }\n expr.typeParameters = typeParameters;\n return expr;\n }, state);\n\n if (!arrow.error && !arrow.aborted) {\n if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);\n return arrow.node;\n }\n if (!jsx) {\n assert(!this.hasPlugin(\"jsx\"));\n\n typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);\n if (!typeCast.error) return typeCast.node;\n }\n if ((_jsx2 = jsx) != null && _jsx2.node) {\n this.state = jsx.failState;\n return jsx.node;\n }\n if (arrow.node) {\n this.state = arrow.failState;\n if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);\n return arrow.node;\n }\n if ((_typeCast = typeCast) != null && _typeCast.node) {\n this.state = typeCast.failState;\n return typeCast.node;\n }\n if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n if ((_typeCast2 = typeCast) != null && _typeCast2.thrown) throw typeCast.error;\n throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error);\n }\n reportReservedArrowTypeParam(node) {\n var _node$extra;\n if (node.params.length === 1 && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption(\"typescript\", \"disallowAmbiguousJSXLike\")) {\n this.raise(TSErrors.ReservedArrowTypeParam, {\n at: node\n });\n }\n }\n\n parseMaybeUnary(refExpressionErrors, sawUnary) {\n if (!this.hasPlugin(\"jsx\") && this.match(47)) {\n return this.tsParseTypeAssertion();\n } else {\n return super.parseMaybeUnary(refExpressionErrors, sawUnary);\n }\n }\n parseArrow(node) {\n if (this.match(14)) {\n\n const result = this.tryParse(abort => {\n const returnType = this.tsParseTypeOrTypePredicateAnnotation(14);\n if (this.canInsertSemicolon() || !this.match(19)) abort();\n return returnType;\n });\n if (result.aborted) return;\n if (!result.thrown) {\n if (result.error) this.state = result.failState;\n node.returnType = result.node;\n }\n }\n return super.parseArrow(node);\n }\n\n parseAssignableListItemTypes(param) {\n if (this.eat(17)) {\n if (param.type !== \"Identifier\" && !this.state.isAmbientContext && !this.state.inType) {\n this.raise(TSErrors.PatternIsOptional, {\n at: param\n });\n }\n param.optional = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) param.typeAnnotation = type;\n this.resetEndLocation(param);\n return param;\n }\n isAssignable(node, isBinding) {\n switch (node.type) {\n case \"TSTypeCastExpression\":\n return this.isAssignable(node.expression, isBinding);\n case \"TSParameterProperty\":\n return true;\n default:\n return super.isAssignable(node, isBinding);\n }\n }\n toAssignable(node, isLHS = false) {\n switch (node.type) {\n case \"ParenthesizedExpression\":\n this.toAssignableParenthesizedExpression(node, isLHS);\n break;\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n if (isLHS) {\n this.expressionScope.recordArrowParemeterBindingError(TSErrors.UnexpectedTypeCastInParameter, {\n at: node\n });\n } else {\n this.raise(TSErrors.UnexpectedTypeCastInParameter, {\n at: node\n });\n }\n this.toAssignable(node.expression, isLHS);\n break;\n case \"AssignmentExpression\":\n if (!isLHS && node.left.type === \"TSTypeCastExpression\") {\n node.left = this.typeCastToParameter(node.left);\n }\n default:\n super.toAssignable(node, isLHS);\n }\n }\n toAssignableParenthesizedExpression(node, isLHS) {\n switch (node.expression.type) {\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isLHS);\n break;\n default:\n super.toAssignable(node, isLHS);\n }\n }\n checkToRestConversion(node, allowPattern) {\n switch (node.type) {\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSTypeAssertion\":\n case \"TSNonNullExpression\":\n this.checkToRestConversion(node.expression, false);\n break;\n default:\n super.checkToRestConversion(node, allowPattern);\n }\n }\n\n isValidLVal(type, isUnparenthesizedInAssign, binding) {\n return getOwn$1({\n TSTypeCastExpression: true,\n TSParameterProperty: \"parameter\",\n TSNonNullExpression: \"expression\",\n TSAsExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && [\"expression\", true],\n TSSatisfiesExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && [\"expression\", true],\n TSTypeAssertion: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && [\"expression\", true]\n }, type) || super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n parseBindingAtom() {\n switch (this.state.type) {\n case 78:\n return this.parseIdentifier(true);\n default:\n return super.parseBindingAtom();\n }\n }\n parseMaybeDecoratorArguments(expr) {\n if (this.match(47) || this.match(51)) {\n const typeArguments = this.tsParseTypeArgumentsInExpression();\n if (this.match(10)) {\n const call = super.parseMaybeDecoratorArguments(expr);\n call.typeParameters = typeArguments;\n return call;\n }\n this.unexpected(null, 10);\n }\n return super.parseMaybeDecoratorArguments(expr);\n }\n checkCommaAfterRest(close) {\n if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) {\n this.next();\n return false;\n } else {\n return super.checkCommaAfterRest(close);\n }\n }\n\n isClassMethod() {\n return this.match(47) || super.isClassMethod();\n }\n isClassProperty() {\n return this.match(35) || this.match(14) || super.isClassProperty();\n }\n parseMaybeDefault(startLoc, left) {\n const node = super.parseMaybeDefault(startLoc, left);\n if (node.type === \"AssignmentPattern\" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {\n this.raise(TSErrors.TypeAnnotationAfterAssign, {\n at: node.typeAnnotation\n });\n }\n return node;\n }\n\n getTokenFromCode(code) {\n if (this.state.inType) {\n if (code === 62) {\n return this.finishOp(48, 1);\n }\n if (code === 60) {\n return this.finishOp(47, 1);\n }\n }\n return super.getTokenFromCode(code);\n }\n\n reScan_lt_gt() {\n const {\n type\n } = this.state;\n if (type === 47) {\n this.state.pos -= 1;\n this.readToken_lt();\n } else if (type === 48) {\n this.state.pos -= 1;\n this.readToken_gt();\n }\n }\n reScan_lt() {\n const {\n type\n } = this.state;\n if (type === 51) {\n this.state.pos -= 2;\n this.finishOp(47, 1);\n return 47;\n }\n return type;\n }\n toAssignableList(exprList, trailingCommaLoc, isLHS) {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if ((expr == null ? void 0 : expr.type) === \"TSTypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n super.toAssignableList(exprList, trailingCommaLoc, isLHS);\n }\n typeCastToParameter(node) {\n node.expression.typeAnnotation = node.typeAnnotation;\n this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);\n return node.expression;\n }\n shouldParseArrow(params) {\n if (this.match(14)) {\n return params.every(expr => this.isAssignable(expr, true));\n }\n return super.shouldParseArrow(params);\n }\n shouldParseAsyncArrow() {\n return this.match(14) || super.shouldParseAsyncArrow();\n }\n canHaveLeadingDecorator() {\n return super.canHaveLeadingDecorator() || this.isAbstractClass();\n }\n jsxParseOpeningElementAfterName(node) {\n if (this.match(47) || this.match(51)) {\n const typeArguments = this.tsTryParseAndCatch(() =>\n this.tsParseTypeArgumentsInExpression());\n if (typeArguments) node.typeParameters = typeArguments;\n }\n return super.jsxParseOpeningElementAfterName(node);\n }\n getGetterSetterExpectedParamCount(method) {\n const baseCount = super.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n const firstParam = params[0];\n const hasContextParam = firstParam && this.isThisParam(firstParam);\n return hasContextParam ? baseCount + 1 : baseCount;\n }\n parseCatchClauseParam() {\n const param = super.parseCatchClauseParam();\n const type = this.tsTryParseTypeAnnotation();\n if (type) {\n param.typeAnnotation = type;\n this.resetEndLocation(param);\n }\n return param;\n }\n tsInAmbientContext(cb) {\n const oldIsAmbientContext = this.state.isAmbientContext;\n this.state.isAmbientContext = true;\n try {\n return cb();\n } finally {\n this.state.isAmbientContext = oldIsAmbientContext;\n }\n }\n parseClass(node, isStatement, optionalId) {\n const oldInAbstractClass = this.state.inAbstractClass;\n this.state.inAbstractClass = !!node.abstract;\n try {\n return super.parseClass(node, isStatement, optionalId);\n } finally {\n this.state.inAbstractClass = oldInAbstractClass;\n }\n }\n tsParseAbstractDeclaration(node, decorators) {\n if (this.match(80)) {\n node.abstract = true;\n return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));\n } else if (this.isContextual(127)) {\n\n if (!this.hasFollowingLineBreak()) {\n node.abstract = true;\n this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, {\n at: node\n });\n return this.tsParseInterfaceDeclaration(node);\n }\n } else {\n this.unexpected(null, 80);\n }\n }\n parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {\n const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);\n if (method.abstract) {\n const hasBody = this.hasPlugin(\"estree\") ?\n !!method.value.body : !!method.body;\n if (hasBody) {\n const {\n key\n } = method;\n this.raise(TSErrors.AbstractMethodHasImplementation, {\n at: method,\n methodName: key.type === \"Identifier\" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`\n });\n }\n }\n return method;\n }\n tsParseTypeParameterName() {\n const typeName = this.parseIdentifier();\n return typeName.name;\n }\n shouldParseAsAmbientContext() {\n return !!this.getPluginOption(\"typescript\", \"dts\");\n }\n parse() {\n if (this.shouldParseAsAmbientContext()) {\n this.state.isAmbientContext = true;\n }\n return super.parse();\n }\n getExpression() {\n if (this.shouldParseAsAmbientContext()) {\n this.state.isAmbientContext = true;\n }\n return super.getExpression();\n }\n parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {\n if (!isString && isMaybeTypeOnly) {\n this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport);\n return this.finishNode(node, \"ExportSpecifier\");\n }\n node.exportKind = \"value\";\n return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly);\n }\n parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly,\n bindingType) {\n if (!importedIsString && isMaybeTypeOnly) {\n this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport);\n return this.finishNode(specifier, \"ImportSpecifier\");\n }\n specifier.importKind = \"value\";\n return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT);\n }\n parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) {\n const leftOfAsKey = isImport ? \"imported\" : \"local\";\n const rightOfAsKey = isImport ? \"local\" : \"exported\";\n let leftOfAs = node[leftOfAsKey];\n let rightOfAs;\n let hasTypeSpecifier = false;\n let canParseAsKeyword = true;\n const loc = leftOfAs.loc.start;\n\n if (this.isContextual(93)) {\n const firstAs = this.parseIdentifier();\n if (this.isContextual(93)) {\n const secondAs = this.parseIdentifier();\n if (tokenIsKeywordOrIdentifier(this.state.type)) {\n hasTypeSpecifier = true;\n leftOfAs = firstAs;\n rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();\n canParseAsKeyword = false;\n } else {\n rightOfAs = secondAs;\n canParseAsKeyword = false;\n }\n } else if (tokenIsKeywordOrIdentifier(this.state.type)) {\n canParseAsKeyword = false;\n rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();\n } else {\n hasTypeSpecifier = true;\n leftOfAs = firstAs;\n }\n } else if (tokenIsKeywordOrIdentifier(this.state.type)) {\n hasTypeSpecifier = true;\n if (isImport) {\n leftOfAs = this.parseIdentifier(true);\n if (!this.isContextual(93)) {\n this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true);\n }\n } else {\n leftOfAs = this.parseModuleExportName();\n }\n }\n if (hasTypeSpecifier && isInTypeOnlyImportExport) {\n this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, {\n at: loc\n });\n }\n node[leftOfAsKey] = leftOfAs;\n node[rightOfAsKey] = rightOfAs;\n const kindKey = isImport ? \"importKind\" : \"exportKind\";\n node[kindKey] = hasTypeSpecifier ? \"type\" : \"value\";\n if (canParseAsKeyword && this.eatContextual(93)) {\n node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName();\n }\n if (!node[rightOfAsKey]) {\n node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]);\n }\n if (isImport) {\n this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT);\n }\n }\n});\nfunction isPossiblyLiteralEnum(expression) {\n if (expression.type !== \"MemberExpression\") return false;\n const {\n computed,\n property\n } = expression;\n if (computed && property.type !== \"StringLiteral\" && (property.type !== \"TemplateLiteral\" || property.expressions.length > 0)) {\n return false;\n }\n return isUncomputedMemberExpressionChain(expression.object);\n}\nfunction isUncomputedMemberExpressionChain(expression) {\n if (expression.type === \"Identifier\") return true;\n if (expression.type !== \"MemberExpression\") return false;\n if (expression.computed) return false;\n return isUncomputedMemberExpressionChain(expression.object);\n}\n\nconst PlaceholderErrors = ParseErrorEnum`placeholders`({\n ClassNameIsRequired: \"A class name is required.\",\n UnexpectedSpace: \"Unexpected space in placeholder.\"\n});\n\nvar placeholders = (superClass => class PlaceholdersParserMixin extends superClass {\n parsePlaceholder(expectedNode) {\n if (this.match(142)) {\n const node = this.startNode();\n this.next();\n this.assertNoSpace();\n\n node.name = super.parseIdentifier(true);\n this.assertNoSpace();\n this.expect(142);\n return this.finishPlaceholder(node, expectedNode);\n }\n }\n finishPlaceholder(node, expectedNode) {\n const isFinished = !!(node.expectedNode && node.type === \"Placeholder\");\n node.expectedNode = expectedNode;\n\n return isFinished ? node : this.finishNode(node, \"Placeholder\");\n }\n\n getTokenFromCode(code) {\n if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {\n return this.finishOp(142, 2);\n }\n return super.getTokenFromCode(code);\n }\n\n parseExprAtom(refExpressionErrors) {\n return this.parsePlaceholder(\"Expression\") || super.parseExprAtom(refExpressionErrors);\n }\n parseIdentifier(liberal) {\n return this.parsePlaceholder(\"Identifier\") || super.parseIdentifier(liberal);\n }\n checkReservedWord(word, startLoc, checkKeywords, isBinding) {\n if (word !== undefined) {\n super.checkReservedWord(word, startLoc, checkKeywords, isBinding);\n }\n }\n\n parseBindingAtom() {\n return this.parsePlaceholder(\"Pattern\") || super.parseBindingAtom();\n }\n isValidLVal(type, isParenthesized, binding) {\n return type === \"Placeholder\" || super.isValidLVal(type, isParenthesized, binding);\n }\n toAssignable(node, isLHS) {\n if (node && node.type === \"Placeholder\" && node.expectedNode === \"Expression\") {\n node.expectedNode = \"Pattern\";\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n chStartsBindingIdentifier(ch, pos) {\n if (super.chStartsBindingIdentifier(ch, pos)) {\n return true;\n }\n\n const nextToken = this.lookahead();\n if (nextToken.type === 142) {\n return true;\n }\n return false;\n }\n verifyBreakContinue(node, isBreak) {\n if (node.label && node.label.type === \"Placeholder\") return;\n super.verifyBreakContinue(node, isBreak);\n }\n\n parseExpressionStatement(node, expr) {\n if (expr.type !== \"Placeholder\" || expr.extra && expr.extra.parenthesized) {\n return super.parseExpressionStatement(node, expr);\n }\n if (this.match(14)) {\n const stmt = node;\n stmt.label = this.finishPlaceholder(expr, \"Identifier\");\n this.next();\n stmt.body = super.parseStatementOrFunctionDeclaration(false);\n return this.finishNode(stmt, \"LabeledStatement\");\n }\n this.semicolon();\n node.name = expr.name;\n return this.finishPlaceholder(node, \"Statement\");\n }\n parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) {\n return this.parsePlaceholder(\"BlockStatement\") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse);\n }\n parseFunctionId(requireId) {\n return this.parsePlaceholder(\"Identifier\") || super.parseFunctionId(requireId);\n }\n parseClass(node, isStatement, optionalId) {\n const type = isStatement ? \"ClassDeclaration\" : \"ClassExpression\";\n this.next();\n const oldStrict = this.state.strict;\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (placeholder) {\n if (this.match(81) || this.match(142) || this.match(5)) {\n node.id = placeholder;\n } else if (optionalId || !isStatement) {\n node.id = null;\n node.body = this.finishPlaceholder(placeholder, \"ClassBody\");\n return this.finishNode(node, type);\n } else {\n throw this.raise(PlaceholderErrors.ClassNameIsRequired, {\n at: this.state.startLoc\n });\n }\n } else {\n this.parseClassId(node, isStatement, optionalId);\n }\n super.parseClassSuper(node);\n node.body = this.parsePlaceholder(\"ClassBody\") || super.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, type);\n }\n parseExport(node, decorators) {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseExport(node, decorators);\n if (!this.isContextual(97) && !this.match(12)) {\n node.specifiers = [];\n node.source = null;\n node.declaration = this.finishPlaceholder(placeholder, \"Declaration\");\n return this.finishNode(node, \"ExportNamedDeclaration\");\n }\n\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = placeholder;\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n return super.parseExport(node, decorators);\n }\n isExportDefaultSpecifier() {\n if (this.match(65)) {\n const next = this.nextTokenStart();\n if (this.isUnparsedContextual(next, \"from\")) {\n if (this.input.startsWith(tokenLabelName(142), this.nextTokenStartSince(next + 4))) {\n return true;\n }\n }\n }\n return super.isExportDefaultSpecifier();\n }\n maybeParseExportDefaultSpecifier(node) {\n if (node.specifiers && node.specifiers.length > 0) {\n return true;\n }\n return super.maybeParseExportDefaultSpecifier(node);\n }\n checkExport(node) {\n const {\n specifiers\n } = node;\n if (specifiers != null && specifiers.length) {\n node.specifiers = specifiers.filter(\n node => node.exported.type === \"Placeholder\");\n }\n super.checkExport(node);\n node.specifiers = specifiers;\n }\n parseImport(node) {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseImport(node);\n node.specifiers = [];\n if (!this.isContextual(97) && !this.match(12)) {\n node.source = this.finishPlaceholder(placeholder, \"StringLiteral\");\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n const specifier = this.startNodeAtNode(placeholder);\n specifier.local = placeholder;\n node.specifiers.push(this.finishNode(specifier, \"ImportDefaultSpecifier\"));\n if (this.eat(12)) {\n const hasStarImport = this.maybeParseStarImportSpecifier(node);\n\n if (!hasStarImport) this.parseNamedImportSpecifiers(node);\n }\n this.expectContextual(97);\n node.source = this.parseImportSource();\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n parseImportSource() {\n\n return this.parsePlaceholder(\"StringLiteral\") || super.parseImportSource();\n }\n\n assertNoSpace() {\n if (this.state.start > this.state.lastTokEndLoc.index) {\n this.raise(PlaceholderErrors.UnexpectedSpace, {\n at: this.state.lastTokEndLoc\n });\n }\n }\n});\n\nvar v8intrinsic = (superClass => class V8IntrinsicMixin extends superClass {\n parseV8Intrinsic() {\n if (this.match(54)) {\n const v8IntrinsicStartLoc = this.state.startLoc;\n const node = this.startNode();\n this.next();\n if (tokenIsIdentifier(this.state.type)) {\n const name = this.parseIdentifierName();\n const identifier = this.createIdentifier(node, name);\n identifier.type = \"V8IntrinsicIdentifier\";\n if (this.match(10)) {\n return identifier;\n }\n }\n this.unexpected(v8IntrinsicStartLoc);\n }\n }\n\n parseExprAtom(refExpressionErrors) {\n return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors);\n }\n});\n\nfunction hasPlugin(plugins, expectedConfig) {\n const [expectedName, expectedOptions] = typeof expectedConfig === \"string\" ? [expectedConfig, {}] : expectedConfig;\n const expectedKeys = Object.keys(expectedOptions);\n const expectedOptionsIsEmpty = expectedKeys.length === 0;\n return plugins.some(p => {\n if (typeof p === \"string\") {\n return expectedOptionsIsEmpty && p === expectedName;\n } else {\n const [pluginName, pluginOptions] = p;\n if (pluginName !== expectedName) {\n return false;\n }\n for (const key of expectedKeys) {\n if (pluginOptions[key] !== expectedOptions[key]) {\n return false;\n }\n }\n return true;\n }\n });\n}\nfunction getPluginOption(plugins, name, option) {\n const plugin = plugins.find(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n if (plugin && Array.isArray(plugin) && plugin.length > 1) {\n return plugin[1][option];\n }\n return null;\n}\nconst PIPELINE_PROPOSALS = [\"minimal\", \"fsharp\", \"hack\", \"smart\"];\nconst TOPIC_TOKENS = [\"^^\", \"@@\", \"^\", \"%\", \"#\"];\nconst RECORD_AND_TUPLE_SYNTAX_TYPES = [\"hash\", \"bar\"];\nfunction validatePlugins(plugins) {\n if (hasPlugin(plugins, \"decorators\")) {\n if (hasPlugin(plugins, \"decorators-legacy\")) {\n throw new Error(\"Cannot use the decorators and decorators-legacy plugin together\");\n }\n const decoratorsBeforeExport = getPluginOption(plugins, \"decorators\", \"decoratorsBeforeExport\");\n if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n const allowCallParenthesized = getPluginOption(plugins, \"decorators\", \"allowCallParenthesized\");\n if (allowCallParenthesized != null && typeof allowCallParenthesized !== \"boolean\") {\n throw new Error(\"'allowCallParenthesized' must be a boolean.\");\n }\n }\n if (hasPlugin(plugins, \"flow\") && hasPlugin(plugins, \"typescript\")) {\n throw new Error(\"Cannot combine flow and typescript plugins.\");\n }\n if (hasPlugin(plugins, \"placeholders\") && hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine placeholders and v8intrinsic plugins.\");\n }\n if (hasPlugin(plugins, \"pipelineOperator\")) {\n const proposal = getPluginOption(plugins, \"pipelineOperator\", \"proposal\");\n if (!PIPELINE_PROPOSALS.includes(proposal)) {\n const proposalList = PIPELINE_PROPOSALS.map(p => `\"${p}\"`).join(\", \");\n throw new Error(`\"pipelineOperator\" requires \"proposal\" option whose value must be one of: ${proposalList}.`);\n }\n const tupleSyntaxIsHash = hasPlugin(plugins, [\"recordAndTuple\", {\n syntaxType: \"hash\"\n }]);\n if (proposal === \"hack\") {\n if (hasPlugin(plugins, \"placeholders\")) {\n throw new Error(\"Cannot combine placeholders plugin and Hack-style pipes.\");\n }\n if (hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine v8intrinsic plugin and Hack-style pipes.\");\n }\n const topicToken = getPluginOption(plugins, \"pipelineOperator\", \"topicToken\");\n if (!TOPIC_TOKENS.includes(topicToken)) {\n const tokenList = TOPIC_TOKENS.map(t => `\"${t}\"`).join(\", \");\n throw new Error(`\"pipelineOperator\" in \"proposal\": \"hack\" mode also requires a \"topicToken\" option whose value must be one of: ${tokenList}.`);\n }\n if (topicToken === \"#\" && tupleSyntaxIsHash) {\n throw new Error('Plugin conflict between `[\"pipelineOperator\", { proposal: \"hack\", topicToken: \"#\" }]` and `[\"recordAndtuple\", { syntaxType: \"hash\"}]`.');\n }\n } else if (proposal === \"smart\" && tupleSyntaxIsHash) {\n throw new Error('Plugin conflict between `[\"pipelineOperator\", { proposal: \"smart\" }]` and `[\"recordAndtuple\", { syntaxType: \"hash\"}]`.');\n }\n }\n if (hasPlugin(plugins, \"moduleAttributes\")) {\n {\n if (hasPlugin(plugins, \"importAssertions\")) {\n throw new Error(\"Cannot combine importAssertions and moduleAttributes plugins.\");\n }\n const moduleAttributesVersionPluginOption = getPluginOption(plugins, \"moduleAttributes\", \"version\");\n if (moduleAttributesVersionPluginOption !== \"may-2020\") {\n throw new Error(\"The 'moduleAttributes' plugin requires a 'version' option,\" + \" representing the last proposal update. Currently, the\" + \" only supported value is 'may-2020'.\");\n }\n }\n }\n if (hasPlugin(plugins, \"recordAndTuple\") && getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\") != null && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\"))) {\n throw new Error(\"The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: \" + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(\", \"));\n }\n if (hasPlugin(plugins, \"asyncDoExpressions\") && !hasPlugin(plugins, \"doExpressions\")) {\n const error = new Error(\"'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.\");\n error.missingPlugins = \"doExpressions\";\n throw error;\n }\n}\n\nconst mixinPlugins = {\n estree,\n jsx,\n flow,\n typescript,\n v8intrinsic,\n placeholders\n};\nconst mixinPluginNames = Object.keys(mixinPlugins);\n\nconst defaultOptions = {\n sourceType: \"script\",\n sourceFilename: undefined,\n startColumn: 0,\n startLine: 1,\n allowAwaitOutsideFunction: false,\n allowReturnOutsideFunction: false,\n allowImportExportEverywhere: false,\n allowSuperOutsideMethod: false,\n allowUndeclaredExports: false,\n plugins: [],\n strictMode: null,\n ranges: false,\n tokens: false,\n createParenthesizedExpressions: false,\n errorRecovery: false,\n attachComment: true\n};\n\nfunction getOptions(opts) {\n const options = {};\n for (const key of Object.keys(defaultOptions)) {\n options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];\n }\n return options;\n}\n\nconst getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key];\nconst unwrapParenthesizedExpression = node => {\n return node.type === \"ParenthesizedExpression\" ? unwrapParenthesizedExpression(node.expression) : node;\n};\nclass LValParser extends NodeUtils {\n\n toAssignable(node, isLHS = false) {\n var _node$extra, _node$extra3;\n let parenthesized = undefined;\n if (node.type === \"ParenthesizedExpression\" || (_node$extra = node.extra) != null && _node$extra.parenthesized) {\n parenthesized = unwrapParenthesizedExpression(node);\n if (isLHS) {\n if (parenthesized.type === \"Identifier\") {\n this.expressionScope.recordArrowParemeterBindingError(Errors.InvalidParenthesizedAssignment, {\n at: node\n });\n } else if (parenthesized.type !== \"MemberExpression\") {\n this.raise(Errors.InvalidParenthesizedAssignment, {\n at: node\n });\n }\n } else {\n this.raise(Errors.InvalidParenthesizedAssignment, {\n at: node\n });\n }\n }\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n break;\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\";\n for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {\n var _node$extra2;\n const prop = node.properties[i];\n const isLast = i === last;\n this.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n if (isLast && prop.type === \"RestElement\" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) {\n this.raise(Errors.RestTrailingComma, {\n at: node.extra.trailingCommaLoc\n });\n }\n }\n break;\n case \"ObjectProperty\":\n {\n const {\n key,\n value\n } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);\n }\n this.toAssignable(value, isLHS);\n break;\n }\n case \"SpreadElement\":\n {\n throw new Error(\"Internal @babel/parser error (this is a bug, please report it).\" + \" SpreadElement should be converted by .toAssignable's caller.\");\n }\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\";\n this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS);\n break;\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") {\n this.raise(Errors.MissingEqInAssignment, {\n at: node.left.loc.end\n });\n }\n node.type = \"AssignmentPattern\";\n delete node.operator;\n this.toAssignable(node.left, isLHS);\n break;\n case \"ParenthesizedExpression\":\n this.toAssignable(parenthesized, isLHS);\n break;\n }\n }\n\n toAssignableObjectExpressionProp(prop, isLast, isLHS) {\n if (prop.type === \"ObjectMethod\") {\n this.raise(prop.kind === \"get\" || prop.kind === \"set\" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, {\n at: prop.key\n });\n } else if (prop.type === \"SpreadElement\") {\n prop.type = \"RestElement\";\n const arg = prop.argument;\n this.checkToRestConversion(arg, false);\n this.toAssignable(arg, isLHS);\n if (!isLast) {\n this.raise(Errors.RestTrailingComma, {\n at: prop\n });\n }\n } else {\n this.toAssignable(prop, isLHS);\n }\n }\n\n toAssignableList(exprList, trailingCommaLoc, isLHS) {\n const end = exprList.length - 1;\n for (let i = 0; i <= end; i++) {\n const elt = exprList[i];\n if (!elt) continue;\n if (elt.type === \"SpreadElement\") {\n elt.type = \"RestElement\";\n const arg = elt.argument;\n this.checkToRestConversion(arg, true);\n this.toAssignable(arg, isLHS);\n } else {\n this.toAssignable(elt, isLHS);\n }\n if (elt.type === \"RestElement\") {\n if (i < end) {\n this.raise(Errors.RestTrailingComma, {\n at: elt\n });\n } else if (trailingCommaLoc) {\n this.raise(Errors.RestTrailingComma, {\n at: trailingCommaLoc\n });\n }\n }\n }\n }\n isAssignable(node, isBinding) {\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n return true;\n case \"ObjectExpression\":\n {\n const last = node.properties.length - 1;\n return node.properties.every((prop, i) => {\n return prop.type !== \"ObjectMethod\" && (i === last || prop.type !== \"SpreadElement\") && this.isAssignable(prop);\n });\n }\n case \"ObjectProperty\":\n return this.isAssignable(node.value);\n case \"SpreadElement\":\n return this.isAssignable(node.argument);\n case \"ArrayExpression\":\n return node.elements.every(element => element === null || this.isAssignable(element));\n case \"AssignmentExpression\":\n return node.operator === \"=\";\n case \"ParenthesizedExpression\":\n return this.isAssignable(node.expression);\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n return !isBinding;\n default:\n return false;\n }\n }\n\n toReferencedList(exprList,\n isParenthesizedExpr) {\n return exprList;\n }\n toReferencedListDeep(exprList, isParenthesizedExpr) {\n this.toReferencedList(exprList, isParenthesizedExpr);\n for (const expr of exprList) {\n if ((expr == null ? void 0 : expr.type) === \"ArrayExpression\") {\n this.toReferencedListDeep(expr.elements);\n }\n }\n }\n\n parseSpread(refExpressionErrors) {\n const node = this.startNode();\n this.next();\n node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined);\n return this.finishNode(node, \"SpreadElement\");\n }\n\n parseRestBinding() {\n const node = this.startNode();\n this.next();\n node.argument = this.parseBindingAtom();\n return this.finishNode(node, \"RestElement\");\n }\n\n parseBindingAtom() {\n switch (this.state.type) {\n case 0:\n {\n const node = this.startNode();\n this.next();\n node.elements = this.parseBindingList(3, 93, true);\n return this.finishNode(node, \"ArrayPattern\");\n }\n case 5:\n return this.parseObjectLike(8, true);\n }\n\n return this.parseIdentifier();\n }\n\n parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {\n const elts = [];\n let first = true;\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n }\n if (allowEmpty && this.match(12)) {\n elts.push(null);\n } else if (this.eat(close)) {\n break;\n } else if (this.match(21)) {\n elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));\n if (!this.checkCommaAfterRest(closeCharCode)) {\n this.expect(close);\n break;\n }\n } else {\n const decorators = [];\n if (this.match(26) && this.hasPlugin(\"decorators\")) {\n this.raise(Errors.UnsupportedParameterDecorator, {\n at: this.state.startLoc\n });\n }\n while (this.match(26)) {\n decorators.push(this.parseDecorator());\n }\n elts.push(this.parseAssignableListItem(allowModifiers, decorators));\n }\n }\n return elts;\n }\n\n parseBindingRestProperty(prop) {\n this.next();\n prop.argument = this.parseIdentifier();\n this.checkCommaAfterRest(125);\n return this.finishNode(prop, \"RestElement\");\n }\n\n parseBindingProperty() {\n const prop = this.startNode();\n const {\n type,\n startLoc\n } = this.state;\n if (type === 21) {\n return this.parseBindingRestProperty(prop);\n } else if (type === 136) {\n this.expectPlugin(\"destructuringPrivate\", startLoc);\n this.classScope.usePrivateName(this.state.value, startLoc);\n prop.key = this.parsePrivateName();\n } else {\n this.parsePropertyName(prop);\n }\n prop.method = false;\n return this.parseObjPropValue(prop, startLoc, false, false, true, false);\n }\n\n parseAssignableListItem(allowModifiers, decorators) {\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left);\n const elt = this.parseMaybeDefault(left.loc.start, left);\n if (decorators.length) {\n left.decorators = decorators;\n }\n return elt;\n }\n\n parseAssignableListItemTypes(param) {\n return param;\n }\n\n parseMaybeDefault(startLoc, left) {\n var _startLoc, _left;\n (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;\n left = (_left = left) != null ? _left : this.parseBindingAtom();\n if (!this.eat(29)) return left;\n const node = this.startNodeAt(startLoc);\n node.left = left;\n node.right = this.parseMaybeAssignAllowIn();\n return this.finishNode(node, \"AssignmentPattern\");\n }\n isValidLVal(type,\n isUnparenthesizedInAssign,\n binding) {\n return getOwn({\n AssignmentPattern: \"left\",\n RestElement: \"argument\",\n ObjectProperty: \"value\",\n ParenthesizedExpression: \"expression\",\n ArrayPattern: \"elements\",\n ObjectPattern: \"properties\"\n },\n type);\n }\n\n checkLVal(expression, {\n in: ancestor,\n binding = BIND_NONE,\n checkClashes = false,\n strictModeChanged = false,\n allowingSloppyLetBinding = !(binding & BIND_SCOPE_LEXICAL),\n hasParenthesizedAncestor = false\n }) {\n var _expression$extra;\n const type = expression.type;\n\n if (this.isObjectMethod(expression)) return;\n if (type === \"MemberExpression\") {\n if (binding !== BIND_NONE) {\n this.raise(Errors.InvalidPropertyBindingPattern, {\n at: expression\n });\n }\n return;\n }\n if (expression.type === \"Identifier\") {\n this.checkIdentifier(expression, binding, strictModeChanged, allowingSloppyLetBinding);\n const {\n name\n } = expression;\n if (checkClashes) {\n if (checkClashes.has(name)) {\n this.raise(Errors.ParamDupe, {\n at: expression\n });\n } else {\n checkClashes.add(name);\n }\n }\n return;\n }\n const validity = this.isValidLVal(expression.type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === \"AssignmentExpression\", binding);\n if (validity === true) return;\n if (validity === false) {\n const ParseErrorClass = binding === BIND_NONE ? Errors.InvalidLhs : Errors.InvalidLhsBinding;\n this.raise(ParseErrorClass, {\n at: expression,\n ancestor: ancestor.type === \"UpdateExpression\" ? {\n type: \"UpdateExpression\",\n prefix: ancestor.prefix\n } : {\n type: ancestor.type\n }\n });\n return;\n }\n const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === \"ParenthesizedExpression\"];\n const nextAncestor = expression.type === \"ArrayPattern\" || expression.type === \"ObjectPattern\" || expression.type === \"ParenthesizedExpression\" ? expression : ancestor;\n\n for (const child of [].concat(expression[key])) {\n if (child) {\n this.checkLVal(child, {\n in: nextAncestor,\n binding,\n checkClashes,\n allowingSloppyLetBinding,\n strictModeChanged,\n hasParenthesizedAncestor: isParenthesizedExpression\n });\n }\n }\n }\n checkIdentifier(at, bindingType, strictModeChanged = false, allowLetBinding = !(bindingType & BIND_SCOPE_LEXICAL)) {\n if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) {\n if (bindingType === BIND_NONE) {\n this.raise(Errors.StrictEvalArguments, {\n at,\n referenceName: at.name\n });\n } else {\n this.raise(Errors.StrictEvalArgumentsBinding, {\n at,\n bindingName: at.name\n });\n }\n }\n if (!allowLetBinding && at.name === \"let\") {\n this.raise(Errors.LetInLexicalBinding, {\n at\n });\n }\n if (!(bindingType & BIND_NONE)) {\n this.declareNameFromIdentifier(at, bindingType);\n }\n }\n declareNameFromIdentifier(identifier, binding) {\n this.scope.declareName(identifier.name, binding, identifier.loc.start);\n }\n checkToRestConversion(node, allowPattern) {\n switch (node.type) {\n case \"ParenthesizedExpression\":\n this.checkToRestConversion(node.expression, allowPattern);\n break;\n case \"Identifier\":\n case \"MemberExpression\":\n break;\n case \"ArrayExpression\":\n case \"ObjectExpression\":\n if (allowPattern) break;\n default:\n this.raise(Errors.InvalidRestAssignmentPattern, {\n at: node\n });\n }\n }\n checkCommaAfterRest(close) {\n if (!this.match(12)) {\n return false;\n }\n this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, {\n at: this.state.startLoc\n });\n return true;\n }\n}\n\nclass ExpressionParser extends LValParser {\n\n checkProto(prop, isRecord, protoRef, refExpressionErrors) {\n if (prop.type === \"SpreadElement\" || this.isObjectMethod(prop) || prop.computed ||\n prop.shorthand) {\n return;\n }\n const key = prop.key;\n const name = key.type === \"Identifier\" ? key.name : key.value;\n if (name === \"__proto__\") {\n if (isRecord) {\n this.raise(Errors.RecordNoProto, {\n at: key\n });\n return;\n }\n if (protoRef.used) {\n if (refExpressionErrors) {\n if (refExpressionErrors.doubleProtoLoc === null) {\n refExpressionErrors.doubleProtoLoc = key.loc.start;\n }\n } else {\n this.raise(Errors.DuplicateProto, {\n at: key\n });\n }\n }\n protoRef.used = true;\n }\n }\n shouldExitDescending(expr, potentialArrowAt) {\n return expr.type === \"ArrowFunctionExpression\" && expr.start === potentialArrowAt;\n }\n\n getExpression() {\n this.enterInitialScopes();\n this.nextToken();\n const expr = this.parseExpression();\n if (!this.match(137)) {\n this.unexpected();\n }\n this.finalizeRemainingComments();\n expr.comments = this.state.comments;\n expr.errors = this.state.errors;\n if (this.options.tokens) {\n expr.tokens = this.tokens;\n }\n return expr;\n }\n\n parseExpression(disallowIn, refExpressionErrors) {\n if (disallowIn) {\n return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));\n }\n return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));\n }\n\n parseExpressionBase(refExpressionErrors) {\n const startLoc = this.state.startLoc;\n const expr = this.parseMaybeAssign(refExpressionErrors);\n if (this.match(12)) {\n const node = this.startNodeAt(startLoc);\n node.expressions = [expr];\n while (this.eat(12)) {\n node.expressions.push(this.parseMaybeAssign(refExpressionErrors));\n }\n this.toReferencedList(node.expressions);\n return this.finishNode(node, \"SequenceExpression\");\n }\n return expr;\n }\n\n parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) {\n return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));\n }\n\n parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {\n return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));\n }\n\n setOptionalParametersError(refExpressionErrors, resultError) {\n var _resultError$loc;\n refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc;\n }\n\n parseMaybeAssign(refExpressionErrors, afterLeftParse) {\n const startLoc = this.state.startLoc;\n if (this.isContextual(106)) {\n if (this.prodParam.hasYield) {\n let left = this.parseYield();\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startLoc);\n }\n return left;\n }\n }\n let ownExpressionErrors;\n if (refExpressionErrors) {\n ownExpressionErrors = false;\n } else {\n refExpressionErrors = new ExpressionErrors();\n ownExpressionErrors = true;\n }\n const {\n type\n } = this.state;\n if (type === 10 || tokenIsIdentifier(type)) {\n this.state.potentialArrowAt = this.state.start;\n }\n let left = this.parseMaybeConditional(refExpressionErrors);\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startLoc);\n }\n if (tokenIsAssignment(this.state.type)) {\n const node = this.startNodeAt(startLoc);\n const operator = this.state.value;\n node.operator = operator;\n if (this.match(29)) {\n this.toAssignable(left, true);\n node.left = left;\n const startIndex = startLoc.index;\n if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) {\n refExpressionErrors.doubleProtoLoc = null;\n }\n\n if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) {\n refExpressionErrors.shorthandAssignLoc = null;\n }\n\n if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) {\n this.checkDestructuringPrivate(refExpressionErrors);\n refExpressionErrors.privateKeyLoc = null;\n }\n } else {\n node.left = left;\n }\n this.next();\n node.right = this.parseMaybeAssign();\n this.checkLVal(left, {\n in: this.finishNode(node, \"AssignmentExpression\")\n });\n return node;\n } else if (ownExpressionErrors) {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n return left;\n }\n\n parseMaybeConditional(refExpressionErrors) {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprOps(refExpressionErrors);\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n return this.parseConditional(expr, startLoc, refExpressionErrors);\n }\n parseConditional(expr, startLoc,\n refExpressionErrors) {\n if (this.eat(17)) {\n const node = this.startNodeAt(startLoc);\n node.test = expr;\n node.consequent = this.parseMaybeAssignAllowIn();\n this.expect(14);\n node.alternate = this.parseMaybeAssign();\n return this.finishNode(node, \"ConditionalExpression\");\n }\n return expr;\n }\n parseMaybeUnaryOrPrivate(refExpressionErrors) {\n return this.match(136) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);\n }\n\n parseExprOps(refExpressionErrors) {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n return this.parseExprOp(expr, startLoc, -1);\n }\n\n parseExprOp(left, leftStartLoc, minPrec) {\n if (this.isPrivateName(left)) {\n\n const value = this.getPrivateNameSV(left);\n if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {\n this.raise(Errors.PrivateInExpectedIn, {\n at: left,\n identifierName: value\n });\n }\n this.classScope.usePrivateName(value, left.loc.start);\n }\n const op = this.state.type;\n if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) {\n let prec = tokenOperatorPrecedence(op);\n if (prec > minPrec) {\n if (op === 39) {\n this.expectPlugin(\"pipelineOperator\");\n if (this.state.inFSharpPipelineDirectBody) {\n return left;\n }\n this.checkPipelineAtInfixOperator(left, leftStartLoc);\n }\n const node = this.startNodeAt(leftStartLoc);\n node.left = left;\n node.operator = this.state.value;\n const logical = op === 41 || op === 42;\n const coalesce = op === 40;\n if (coalesce) {\n prec = tokenOperatorPrecedence(42);\n }\n this.next();\n if (op === 39 && this.hasPlugin([\"pipelineOperator\", {\n proposal: \"minimal\"\n }])) {\n if (this.state.type === 96 && this.prodParam.hasAwait) {\n throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, {\n at: this.state.startLoc\n });\n }\n }\n node.right = this.parseExprOpRightExpr(op, prec);\n const finishedNode = this.finishNode(node, logical || coalesce ? \"LogicalExpression\" : \"BinaryExpression\");\n const nextOp = this.state.type;\n if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) {\n throw this.raise(Errors.MixingCoalesceWithLogical, {\n at: this.state.startLoc\n });\n }\n return this.parseExprOp(finishedNode, leftStartLoc, minPrec);\n }\n }\n return left;\n }\n\n parseExprOpRightExpr(op, prec) {\n const startLoc = this.state.startLoc;\n switch (op) {\n case 39:\n switch (this.getPluginOption(\"pipelineOperator\", \"proposal\")) {\n case \"hack\":\n return this.withTopicBindingContext(() => {\n return this.parseHackPipeBody();\n });\n case \"smart\":\n return this.withTopicBindingContext(() => {\n if (this.prodParam.hasYield && this.isContextual(106)) {\n throw this.raise(Errors.PipeBodyIsTighter, {\n at: this.state.startLoc\n });\n }\n return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc);\n });\n case \"fsharp\":\n return this.withSoloAwaitPermittingContext(() => {\n return this.parseFSharpPipelineBody(prec);\n });\n }\n\n default:\n return this.parseExprOpBaseRightExpr(op, prec);\n }\n }\n\n parseExprOpBaseRightExpr(op, prec) {\n const startLoc = this.state.startLoc;\n return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec);\n }\n parseHackPipeBody() {\n var _body$extra;\n const {\n startLoc\n } = this.state;\n const body = this.parseMaybeAssign();\n const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(\n body.type);\n\n if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {\n this.raise(Errors.PipeUnparenthesizedBody, {\n at: startLoc,\n type: body.type\n });\n }\n if (!this.topicReferenceWasUsedInCurrentContext()) {\n this.raise(Errors.PipeTopicUnused, {\n at: startLoc\n });\n }\n return body;\n }\n checkExponentialAfterUnary(node) {\n if (this.match(57)) {\n this.raise(Errors.UnexpectedTokenUnaryExponentiation, {\n at: node.argument\n });\n }\n }\n\n parseMaybeUnary(refExpressionErrors, sawUnary) {\n const startLoc = this.state.startLoc;\n const isAwait = this.isContextual(96);\n if (isAwait && this.isAwaitAllowed()) {\n this.next();\n const expr = this.parseAwait(startLoc);\n if (!sawUnary) this.checkExponentialAfterUnary(expr);\n return expr;\n }\n const update = this.match(34);\n const node = this.startNode();\n if (tokenIsPrefix(this.state.type)) {\n node.operator = this.state.value;\n node.prefix = true;\n if (this.match(72)) {\n this.expectPlugin(\"throwExpressions\");\n }\n const isDelete = this.match(89);\n this.next();\n node.argument = this.parseMaybeUnary(null, true);\n this.checkExpressionErrors(refExpressionErrors, true);\n if (this.state.strict && isDelete) {\n const arg = node.argument;\n if (arg.type === \"Identifier\") {\n this.raise(Errors.StrictDelete, {\n at: node\n });\n } else if (this.hasPropertyAsPrivateName(arg)) {\n this.raise(Errors.DeletePrivateField, {\n at: node\n });\n }\n }\n if (!update) {\n if (!sawUnary) {\n this.checkExponentialAfterUnary(node);\n }\n return this.finishNode(node, \"UnaryExpression\");\n }\n }\n const expr = this.parseUpdate(\n node, update, refExpressionErrors);\n if (isAwait) {\n const {\n type\n } = this.state;\n const startsExpr = this.hasPlugin(\"v8intrinsic\") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);\n if (startsExpr && !this.isAmbiguousAwait()) {\n this.raiseOverwrite(Errors.AwaitNotInAsyncContext, {\n at: startLoc\n });\n return this.parseAwait(startLoc);\n }\n }\n return expr;\n }\n\n parseUpdate(node, update, refExpressionErrors) {\n if (update) {\n const updateExpressionNode = node;\n this.checkLVal(updateExpressionNode.argument, {\n in: this.finishNode(updateExpressionNode, \"UpdateExpression\")\n });\n return node;\n }\n const startLoc = this.state.startLoc;\n let expr = this.parseExprSubscripts(refExpressionErrors);\n if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;\n while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt(startLoc);\n node.operator = this.state.value;\n node.prefix = false;\n node.argument = expr;\n this.next();\n this.checkLVal(expr, {\n in: expr = this.finishNode(node, \"UpdateExpression\")\n });\n }\n return expr;\n }\n\n parseExprSubscripts(refExpressionErrors) {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprAtom(refExpressionErrors);\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n return this.parseSubscripts(expr, startLoc);\n }\n parseSubscripts(base, startLoc, noCalls) {\n const state = {\n optionalChainMember: false,\n maybeAsyncArrow: this.atPossibleAsyncArrow(base),\n stop: false\n };\n do {\n base = this.parseSubscript(base, startLoc, noCalls, state);\n\n state.maybeAsyncArrow = false;\n } while (!state.stop);\n return base;\n }\n\n parseSubscript(base, startLoc, noCalls, state) {\n const {\n type\n } = this.state;\n if (!noCalls && type === 15) {\n return this.parseBind(base, startLoc, noCalls, state);\n } else if (tokenIsTemplate(type)) {\n return this.parseTaggedTemplateExpression(base, startLoc, state);\n }\n let optional = false;\n if (type === 18) {\n if (noCalls && this.lookaheadCharCode() === 40) {\n state.stop = true;\n return base;\n }\n state.optionalChainMember = optional = true;\n this.next();\n }\n if (!noCalls && this.match(10)) {\n return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional);\n } else {\n const computed = this.eat(0);\n if (computed || optional || this.eat(16)) {\n return this.parseMember(base, startLoc, state, computed, optional);\n } else {\n state.stop = true;\n return base;\n }\n }\n }\n\n parseMember(base, startLoc, state, computed, optional) {\n const node = this.startNodeAt(startLoc);\n node.object = base;\n node.computed = computed;\n if (computed) {\n node.property = this.parseExpression();\n this.expect(3);\n } else if (this.match(136)) {\n if (base.type === \"Super\") {\n this.raise(Errors.SuperPrivateField, {\n at: startLoc\n });\n }\n this.classScope.usePrivateName(this.state.value, this.state.startLoc);\n node.property = this.parsePrivateName();\n } else {\n node.property = this.parseIdentifier(true);\n }\n if (state.optionalChainMember) {\n node.optional = optional;\n return this.finishNode(node, \"OptionalMemberExpression\");\n } else {\n return this.finishNode(node, \"MemberExpression\");\n }\n }\n\n parseBind(base, startLoc, noCalls, state) {\n const node = this.startNodeAt(startLoc);\n node.object = base;\n this.next();\n node.callee = this.parseNoCallExpr();\n state.stop = true;\n return this.parseSubscripts(this.finishNode(node, \"BindExpression\"), startLoc, noCalls);\n }\n\n parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) {\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n let refExpressionErrors = null;\n this.state.maybeInArrowParameters = true;\n this.next();\n\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n const {\n maybeAsyncArrow,\n optionalChainMember\n } = state;\n if (maybeAsyncArrow) {\n this.expressionScope.enter(newAsyncArrowScope());\n refExpressionErrors = new ExpressionErrors();\n }\n if (optionalChainMember) {\n node.optional = optional;\n }\n if (optional) {\n node.arguments = this.parseCallExpressionArguments(11);\n } else {\n node.arguments = this.parseCallExpressionArguments(11, base.type === \"Import\", base.type !== \"Super\",\n node, refExpressionErrors);\n }\n let finishedNode = this.finishCallExpression(node, optionalChainMember);\n if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {\n state.stop = true;\n this.checkDestructuringPrivate(refExpressionErrors);\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode);\n } else {\n if (maybeAsyncArrow) {\n this.checkExpressionErrors(refExpressionErrors, true);\n this.expressionScope.exit();\n }\n this.toReferencedArguments(finishedNode);\n }\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return finishedNode;\n }\n toReferencedArguments(node, isParenthesizedExpr) {\n this.toReferencedListDeep(node.arguments, isParenthesizedExpr);\n }\n\n parseTaggedTemplateExpression(base, startLoc, state) {\n const node = this.startNodeAt(startLoc);\n node.tag = base;\n node.quasi = this.parseTemplate(true);\n if (state.optionalChainMember) {\n this.raise(Errors.OptionalChainingNoTemplate, {\n at: startLoc\n });\n }\n return this.finishNode(node, \"TaggedTemplateExpression\");\n }\n atPossibleAsyncArrow(base) {\n return base.type === \"Identifier\" && base.name === \"async\" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() &&\n base.end - base.start === 5 && base.start === this.state.potentialArrowAt;\n }\n finishCallExpression(node, optional) {\n if (node.callee.type === \"Import\") {\n if (node.arguments.length === 2) {\n {\n if (!this.hasPlugin(\"moduleAttributes\")) {\n this.expectPlugin(\"importAssertions\");\n }\n }\n }\n if (node.arguments.length === 0 || node.arguments.length > 2) {\n this.raise(Errors.ImportCallArity, {\n at: node,\n maxArgumentCount: this.hasPlugin(\"importAssertions\") || this.hasPlugin(\"moduleAttributes\") ? 2 : 1\n });\n } else {\n for (const arg of node.arguments) {\n if (arg.type === \"SpreadElement\") {\n this.raise(Errors.ImportCallSpreadArgument, {\n at: arg\n });\n }\n }\n }\n }\n return this.finishNode(node, optional ? \"OptionalCallExpression\" : \"CallExpression\");\n }\n parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) {\n const elts = [];\n let first = true;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n if (this.match(close)) {\n if (dynamicImport && !this.hasPlugin(\"importAssertions\") && !this.hasPlugin(\"moduleAttributes\")) {\n this.raise(Errors.ImportCallArgumentTrailingComma, {\n at: this.state.lastTokStartLoc\n });\n }\n if (nodeForExtra) {\n this.addTrailingCommaExtraToNode(nodeForExtra);\n }\n this.next();\n break;\n }\n }\n elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder));\n }\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return elts;\n }\n shouldParseAsyncArrow() {\n return this.match(19) && !this.canInsertSemicolon();\n }\n parseAsyncArrowFromCallExpression(node, call) {\n var _call$extra;\n this.resetPreviousNodeTrailingComments(call);\n this.expect(19);\n this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc);\n if (call.innerComments) {\n setInnerComments(node, call.innerComments);\n }\n if (call.callee.trailingComments) {\n setInnerComments(node, call.callee.trailingComments);\n }\n return node;\n }\n\n parseNoCallExpr() {\n const startLoc = this.state.startLoc;\n return this.parseSubscripts(this.parseExprAtom(), startLoc, true);\n }\n\n parseExprAtom(refExpressionErrors) {\n let node;\n let decorators = null;\n const {\n type\n } = this.state;\n switch (type) {\n case 79:\n return this.parseSuper();\n case 83:\n node = this.startNode();\n this.next();\n if (this.match(16)) {\n return this.parseImportMetaProperty(node);\n }\n if (!this.match(10)) {\n this.raise(Errors.UnsupportedImport, {\n at: this.state.lastTokStartLoc\n });\n }\n return this.finishNode(node, \"Import\");\n case 78:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"ThisExpression\");\n case 90:\n {\n return this.parseDo(this.startNode(), false);\n }\n case 56:\n case 31:\n {\n this.readRegexp();\n return this.parseRegExpLiteral(this.state.value);\n }\n case 132:\n return this.parseNumericLiteral(this.state.value);\n case 133:\n return this.parseBigIntLiteral(this.state.value);\n case 134:\n return this.parseDecimalLiteral(this.state.value);\n case 131:\n return this.parseStringLiteral(this.state.value);\n case 84:\n return this.parseNullLiteral();\n case 85:\n return this.parseBooleanLiteral(true);\n case 86:\n return this.parseBooleanLiteral(false);\n case 10:\n {\n const canBeArrow = this.state.potentialArrowAt === this.state.start;\n return this.parseParenAndDistinguishExpression(canBeArrow);\n }\n case 2:\n case 1:\n {\n return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true);\n }\n case 0:\n {\n return this.parseArrayLike(3, true, false, refExpressionErrors);\n }\n case 6:\n case 7:\n {\n return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true);\n }\n case 5:\n {\n return this.parseObjectLike(8, false, false, refExpressionErrors);\n }\n case 68:\n return this.parseFunctionOrFunctionSent();\n case 26:\n decorators = this.parseDecorators();\n case 80:\n return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false);\n case 77:\n return this.parseNewOrNewTarget();\n case 25:\n case 24:\n return this.parseTemplate(false);\n\n case 15:\n {\n node = this.startNode();\n this.next();\n node.object = null;\n const callee = node.callee = this.parseNoCallExpr();\n if (callee.type === \"MemberExpression\") {\n return this.finishNode(node, \"BindExpression\");\n } else {\n throw this.raise(Errors.UnsupportedBind, {\n at: callee\n });\n }\n }\n case 136:\n {\n this.raise(Errors.PrivateInExpectedIn, {\n at: this.state.startLoc,\n identifierName: this.state.value\n });\n return this.parsePrivateName();\n }\n case 33:\n {\n return this.parseTopicReferenceThenEqualsSign(54, \"%\");\n }\n case 32:\n {\n return this.parseTopicReferenceThenEqualsSign(44, \"^\");\n }\n case 37:\n case 38:\n {\n return this.parseTopicReference(\"hack\");\n }\n case 44:\n case 54:\n case 27:\n {\n const pipeProposal = this.getPluginOption(\"pipelineOperator\", \"proposal\");\n if (pipeProposal) {\n return this.parseTopicReference(pipeProposal);\n } else {\n throw this.unexpected();\n }\n }\n case 47:\n {\n const lookaheadCh = this.input.codePointAt(this.nextTokenStart());\n if (isIdentifierStart(lookaheadCh) ||\n lookaheadCh === 62) {\n this.expectOnePlugin([\"jsx\", \"flow\", \"typescript\"]);\n break;\n } else {\n throw this.unexpected();\n }\n }\n default:\n if (tokenIsIdentifier(type)) {\n if (this.isContextual(125) && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) {\n return this.parseModuleExpression();\n }\n const canBeArrow = this.state.potentialArrowAt === this.state.start;\n const containsEsc = this.state.containsEsc;\n const id = this.parseIdentifier();\n if (!containsEsc && id.name === \"async\" && !this.canInsertSemicolon()) {\n const {\n type\n } = this.state;\n if (type === 68) {\n this.resetPreviousNodeTrailingComments(id);\n this.next();\n return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));\n } else if (tokenIsIdentifier(type)) {\n if (this.lookaheadCharCode() === 61) {\n return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));\n } else {\n return id;\n }\n } else if (type === 90) {\n this.resetPreviousNodeTrailingComments(id);\n return this.parseDo(this.startNodeAtNode(id), true);\n }\n }\n if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) {\n this.next();\n return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);\n }\n return id;\n } else {\n throw this.unexpected();\n }\n }\n }\n\n parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) {\n const pipeProposal = this.getPluginOption(\"pipelineOperator\", \"proposal\");\n if (pipeProposal) {\n this.state.type = topicTokenType;\n this.state.value = topicTokenValue;\n this.state.pos--;\n this.state.end--;\n this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);\n return this.parseTopicReference(pipeProposal);\n } else {\n throw this.unexpected();\n }\n }\n\n parseTopicReference(pipeProposal) {\n const node = this.startNode();\n const startLoc = this.state.startLoc;\n const tokenType = this.state.type;\n\n this.next();\n\n return this.finishTopicReference(node, startLoc, pipeProposal, tokenType);\n }\n\n finishTopicReference(node, startLoc, pipeProposal, tokenType) {\n if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {\n\n const nodeType = pipeProposal === \"smart\" ? \"PipelinePrimaryTopicReference\" :\n \"TopicReference\";\n if (!this.topicReferenceIsAllowedInCurrentContext()) {\n this.raise(\n pipeProposal === \"smart\" ? Errors.PrimaryTopicNotAllowed :\n Errors.PipeTopicUnbound, {\n at: startLoc\n });\n }\n\n this.registerTopicReference();\n return this.finishNode(node, nodeType);\n } else {\n throw this.raise(Errors.PipeTopicUnconfiguredToken, {\n at: startLoc,\n token: tokenLabelName(tokenType)\n });\n }\n }\n\n testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) {\n switch (pipeProposal) {\n case \"hack\":\n {\n return this.hasPlugin([\"pipelineOperator\", {\n topicToken: tokenLabelName(tokenType)\n }]);\n }\n case \"smart\":\n return tokenType === 27;\n default:\n throw this.raise(Errors.PipeTopicRequiresHackPipes, {\n at: startLoc\n });\n }\n }\n\n parseAsyncArrowUnaryFunction(node) {\n this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));\n const params = [this.parseIdentifier()];\n this.prodParam.exit();\n if (this.hasPrecedingLineBreak()) {\n this.raise(Errors.LineTerminatorBeforeArrow, {\n at: this.state.curPosition()\n });\n }\n this.expect(19);\n return this.parseArrowExpression(node, params, true);\n }\n\n parseDo(node, isAsync) {\n this.expectPlugin(\"doExpressions\");\n if (isAsync) {\n this.expectPlugin(\"asyncDoExpressions\");\n }\n node.async = isAsync;\n this.next();\n const oldLabels = this.state.labels;\n this.state.labels = [];\n if (isAsync) {\n this.prodParam.enter(PARAM_AWAIT);\n node.body = this.parseBlock();\n this.prodParam.exit();\n } else {\n node.body = this.parseBlock();\n }\n this.state.labels = oldLabels;\n return this.finishNode(node, \"DoExpression\");\n }\n\n parseSuper() {\n const node = this.startNode();\n this.next();\n if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {\n this.raise(Errors.SuperNotAllowed, {\n at: node\n });\n } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {\n this.raise(Errors.UnexpectedSuper, {\n at: node\n });\n }\n if (!this.match(10) && !this.match(0) && !this.match(16)) {\n this.raise(Errors.UnsupportedSuper, {\n at: node\n });\n }\n return this.finishNode(node, \"Super\");\n }\n parsePrivateName() {\n const node = this.startNode();\n const id = this.startNodeAt(\n createPositionWithColumnOffset(this.state.startLoc, 1));\n const name = this.state.value;\n this.next();\n node.id = this.createIdentifier(id, name);\n return this.finishNode(node, \"PrivateName\");\n }\n parseFunctionOrFunctionSent() {\n const node = this.startNode();\n\n this.next();\n\n if (this.prodParam.hasYield && this.match(16)) {\n const meta = this.createIdentifier(this.startNodeAtNode(node), \"function\");\n this.next();\n if (this.match(102)) {\n this.expectPlugin(\"functionSent\");\n } else if (!this.hasPlugin(\"functionSent\")) {\n this.unexpected();\n }\n return this.parseMetaProperty(node, meta, \"sent\");\n }\n return this.parseFunction(node);\n }\n parseMetaProperty(node, meta, propertyName) {\n node.meta = meta;\n const containsEsc = this.state.containsEsc;\n node.property = this.parseIdentifier(true);\n if (node.property.name !== propertyName || containsEsc) {\n this.raise(Errors.UnsupportedMetaProperty, {\n at: node.property,\n target: meta.name,\n onlyValidPropertyName: propertyName\n });\n }\n return this.finishNode(node, \"MetaProperty\");\n }\n\n parseImportMetaProperty(node) {\n const id = this.createIdentifier(this.startNodeAtNode(node), \"import\");\n this.next();\n\n if (this.isContextual(100)) {\n if (!this.inModule) {\n this.raise(Errors.ImportMetaOutsideModule, {\n at: id\n });\n }\n this.sawUnambiguousESM = true;\n }\n return this.parseMetaProperty(node, id, \"meta\");\n }\n parseLiteralAtNode(value, type, node) {\n this.addExtra(node, \"rawValue\", value);\n this.addExtra(node, \"raw\", this.input.slice(node.start, this.state.end));\n node.value = value;\n this.next();\n return this.finishNode(node, type);\n }\n parseLiteral(value, type) {\n const node = this.startNode();\n return this.parseLiteralAtNode(value, type, node);\n }\n parseStringLiteral(value) {\n return this.parseLiteral(value, \"StringLiteral\");\n }\n parseNumericLiteral(value) {\n return this.parseLiteral(value, \"NumericLiteral\");\n }\n parseBigIntLiteral(value) {\n return this.parseLiteral(value, \"BigIntLiteral\");\n }\n parseDecimalLiteral(value) {\n return this.parseLiteral(value, \"DecimalLiteral\");\n }\n parseRegExpLiteral(value) {\n const node = this.parseLiteral(value.value, \"RegExpLiteral\");\n node.pattern = value.pattern;\n node.flags = value.flags;\n return node;\n }\n parseBooleanLiteral(value) {\n const node = this.startNode();\n node.value = value;\n this.next();\n return this.finishNode(node, \"BooleanLiteral\");\n }\n parseNullLiteral() {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, \"NullLiteral\");\n }\n\n parseParenAndDistinguishExpression(canBeArrow) {\n const startLoc = this.state.startLoc;\n let val;\n this.next();\n this.expressionScope.enter(newArrowHeadScope());\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.maybeInArrowParameters = true;\n this.state.inFSharpPipelineDirectBody = false;\n const innerStartLoc = this.state.startLoc;\n const exprList = [];\n const refExpressionErrors = new ExpressionErrors();\n let first = true;\n let spreadStartLoc;\n let optionalCommaStartLoc;\n while (!this.match(11)) {\n if (first) {\n first = false;\n } else {\n this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc);\n if (this.match(11)) {\n optionalCommaStartLoc = this.state.startLoc;\n break;\n }\n }\n if (this.match(21)) {\n const spreadNodeStartLoc = this.state.startLoc;\n spreadStartLoc = this.state.startLoc;\n exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc));\n if (!this.checkCommaAfterRest(41)) {\n break;\n }\n } else {\n exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem));\n }\n }\n const innerEndLoc = this.state.lastTokEndLoc;\n this.expect(11);\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n let arrowNode = this.startNodeAt(startLoc);\n if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {\n this.checkDestructuringPrivate(refExpressionErrors);\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n this.parseArrowExpression(arrowNode, exprList, false);\n return arrowNode;\n }\n this.expressionScope.exit();\n if (!exprList.length) {\n this.unexpected(this.state.lastTokStartLoc);\n }\n if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc);\n if (spreadStartLoc) this.unexpected(spreadStartLoc);\n this.checkExpressionErrors(refExpressionErrors, true);\n this.toReferencedListDeep(exprList, true);\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartLoc);\n val.expressions = exprList;\n this.finishNode(val, \"SequenceExpression\");\n this.resetEndLocation(val, innerEndLoc);\n } else {\n val = exprList[0];\n }\n return this.wrapParenthesis(startLoc,\n val);\n }\n wrapParenthesis(startLoc, expression) {\n if (!this.options.createParenthesizedExpressions) {\n this.addExtra(expression, \"parenthesized\", true);\n this.addExtra(expression, \"parenStart\", startLoc.index);\n this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index);\n return expression;\n }\n const parenExpression = this.startNodeAt(startLoc);\n parenExpression.expression = expression;\n return this.finishNode(parenExpression, \"ParenthesizedExpression\");\n }\n\n shouldParseArrow(params) {\n return !this.canInsertSemicolon();\n }\n parseArrow(node) {\n if (this.eat(19)) {\n return node;\n }\n }\n parseParenItem(node,\n startLoc) {\n return node;\n }\n parseNewOrNewTarget() {\n const node = this.startNode();\n this.next();\n if (this.match(16)) {\n const meta = this.createIdentifier(this.startNodeAtNode(node), \"new\");\n this.next();\n const metaProp = this.parseMetaProperty(node, meta, \"target\");\n if (!this.scope.inNonArrowFunction && !this.scope.inClass) {\n this.raise(Errors.UnexpectedNewTarget, {\n at: metaProp\n });\n }\n return metaProp;\n }\n return this.parseNew(node);\n }\n\n parseNew(node) {\n this.parseNewCallee(node);\n if (this.eat(10)) {\n const args = this.parseExprList(11);\n this.toReferencedList(args);\n node.arguments = args;\n } else {\n node.arguments = [];\n }\n return this.finishNode(node, \"NewExpression\");\n }\n parseNewCallee(node) {\n node.callee = this.parseNoCallExpr();\n if (node.callee.type === \"Import\") {\n this.raise(Errors.ImportCallNotNewExpression, {\n at: node.callee\n });\n } else if (this.isOptionalChain(node.callee)) {\n this.raise(Errors.OptionalChainingNoNew, {\n at: this.state.lastTokEndLoc\n });\n } else if (this.eat(18)) {\n this.raise(Errors.OptionalChainingNoNew, {\n at: this.state.startLoc\n });\n }\n }\n\n parseTemplateElement(isTagged) {\n const {\n start,\n startLoc,\n end,\n value\n } = this.state;\n const elemStart = start + 1;\n const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1));\n if (value === null) {\n if (!isTagged) {\n this.raise(Errors.InvalidEscapeSequenceTemplate, {\n at: createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)\n });\n }\n }\n const isTail = this.match(24);\n const endOffset = isTail ? -1 : -2;\n const elemEnd = end + endOffset;\n elem.value = {\n raw: this.input.slice(elemStart, elemEnd).replace(/\\r\\n?/g, \"\\n\"),\n cooked: value === null ? null : value.slice(1, endOffset)\n };\n elem.tail = isTail;\n this.next();\n const finishedNode = this.finishNode(elem, \"TemplateElement\");\n this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset));\n return finishedNode;\n }\n\n parseTemplate(isTagged) {\n const node = this.startNode();\n node.expressions = [];\n let curElt = this.parseTemplateElement(isTagged);\n node.quasis = [curElt];\n while (!curElt.tail) {\n node.expressions.push(this.parseTemplateSubstitution());\n this.readTemplateContinuation();\n node.quasis.push(curElt = this.parseTemplateElement(isTagged));\n }\n return this.finishNode(node, \"TemplateLiteral\");\n }\n\n parseTemplateSubstitution() {\n return this.parseExpression();\n }\n\n parseObjectLike(close, isPattern, isRecord, refExpressionErrors) {\n if (isRecord) {\n this.expectPlugin(\"recordAndTuple\");\n }\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const propHash = Object.create(null);\n let first = true;\n const node = this.startNode();\n node.properties = [];\n this.next();\n while (!this.match(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n if (this.match(close)) {\n this.addTrailingCommaExtraToNode(\n node);\n break;\n }\n }\n let prop;\n if (isPattern) {\n prop = this.parseBindingProperty();\n } else {\n prop = this.parsePropertyDefinition(refExpressionErrors);\n this.checkProto(prop, isRecord, propHash, refExpressionErrors);\n }\n if (isRecord && !this.isObjectProperty(prop) && prop.type !== \"SpreadElement\") {\n this.raise(Errors.InvalidRecordProperty, {\n at: prop\n });\n }\n\n if (prop.shorthand) {\n this.addExtra(prop, \"shorthand\", true);\n }\n\n node.properties.push(prop);\n }\n this.next();\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n let type = \"ObjectExpression\";\n if (isPattern) {\n type = \"ObjectPattern\";\n } else if (isRecord) {\n type = \"RecordExpression\";\n }\n return this.finishNode(node, type);\n }\n addTrailingCommaExtraToNode(node) {\n this.addExtra(node, \"trailingComma\", this.state.lastTokStart);\n this.addExtra(node, \"trailingCommaLoc\", this.state.lastTokStartLoc, false);\n }\n\n maybeAsyncOrAccessorProp(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && (this.isLiteralPropertyName() || this.match(0) || this.match(55));\n }\n\n parsePropertyDefinition(refExpressionErrors) {\n let decorators = [];\n if (this.match(26)) {\n if (this.hasPlugin(\"decorators\")) {\n this.raise(Errors.UnsupportedPropertyDecorator, {\n at: this.state.startLoc\n });\n }\n\n while (this.match(26)) {\n decorators.push(this.parseDecorator());\n }\n }\n const prop = this.startNode();\n let isAsync = false;\n let isAccessor = false;\n let startLoc;\n if (this.match(21)) {\n if (decorators.length) this.unexpected();\n return this.parseSpread();\n }\n if (decorators.length) {\n prop.decorators = decorators;\n decorators = [];\n }\n prop.method = false;\n if (refExpressionErrors) {\n startLoc = this.state.startLoc;\n }\n let isGenerator = this.eat(55);\n this.parsePropertyNamePrefixOperator(prop);\n const containsEsc = this.state.containsEsc;\n const key = this.parsePropertyName(prop, refExpressionErrors);\n if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {\n const keyName = key.name;\n if (keyName === \"async\" && !this.hasPrecedingLineBreak()) {\n isAsync = true;\n this.resetPreviousNodeTrailingComments(key);\n isGenerator = this.eat(55);\n this.parsePropertyName(prop);\n }\n if (keyName === \"get\" || keyName === \"set\") {\n isAccessor = true;\n this.resetPreviousNodeTrailingComments(key);\n prop.kind = keyName;\n if (this.match(55)) {\n isGenerator = true;\n this.raise(Errors.AccessorIsGenerator, {\n at: this.state.curPosition(),\n kind: keyName\n });\n this.next();\n }\n this.parsePropertyName(prop);\n }\n }\n return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors);\n }\n getGetterSetterExpectedParamCount(method) {\n return method.kind === \"get\" ? 0 : 1;\n }\n\n getObjectOrClassMethodParams(method) {\n return method.params;\n }\n\n checkGetterSetterParams(method) {\n var _params;\n const paramCount = this.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n if (params.length !== paramCount) {\n this.raise(method.kind === \"get\" ? Errors.BadGetterArity : Errors.BadSetterArity, {\n at: method\n });\n }\n if (method.kind === \"set\" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === \"RestElement\") {\n this.raise(Errors.BadSetterRestParameter, {\n at: method\n });\n }\n }\n\n parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {\n if (isAccessor) {\n const finishedProp = this.parseMethod(prop,\n isGenerator, false, false, false, \"ObjectMethod\");\n this.checkGetterSetterParams(finishedProp);\n return finishedProp;\n }\n if (isAsync || isGenerator || this.match(10)) {\n if (isPattern) this.unexpected();\n prop.kind = \"method\";\n prop.method = true;\n return this.parseMethod(prop, isGenerator, isAsync, false, false, \"ObjectMethod\");\n }\n }\n\n parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {\n prop.shorthand = false;\n if (this.eat(14)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors);\n return this.finishNode(prop, \"ObjectProperty\");\n }\n if (!prop.computed && prop.key.type === \"Identifier\") {\n this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false);\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));\n } else if (this.match(29)) {\n const shorthandAssignLoc = this.state.startLoc;\n if (refExpressionErrors != null) {\n if (refExpressionErrors.shorthandAssignLoc === null) {\n refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;\n }\n } else {\n this.raise(Errors.InvalidCoverInitializedName, {\n at: shorthandAssignLoc\n });\n }\n prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));\n } else {\n prop.value = cloneIdentifier(prop.key);\n }\n prop.shorthand = true;\n return this.finishNode(prop, \"ObjectProperty\");\n }\n }\n parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {\n const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);\n if (!node) this.unexpected();\n return node;\n }\n\n parsePropertyName(prop, refExpressionErrors) {\n if (this.eat(0)) {\n prop.computed = true;\n prop.key = this.parseMaybeAssignAllowIn();\n this.expect(3);\n } else {\n const {\n type,\n value\n } = this.state;\n let key;\n if (tokenIsKeywordOrIdentifier(type)) {\n key = this.parseIdentifier(true);\n } else {\n switch (type) {\n case 132:\n key = this.parseNumericLiteral(value);\n break;\n case 131:\n key = this.parseStringLiteral(value);\n break;\n case 133:\n key = this.parseBigIntLiteral(value);\n break;\n case 134:\n key = this.parseDecimalLiteral(value);\n break;\n case 136:\n {\n const privateKeyLoc = this.state.startLoc;\n if (refExpressionErrors != null) {\n if (refExpressionErrors.privateKeyLoc === null) {\n refExpressionErrors.privateKeyLoc = privateKeyLoc;\n }\n } else {\n this.raise(Errors.UnexpectedPrivateField, {\n at: privateKeyLoc\n });\n }\n key = this.parsePrivateName();\n break;\n }\n default:\n throw this.unexpected();\n }\n }\n prop.key = key;\n if (type !== 136) {\n prop.computed = false;\n }\n }\n return prop.key;\n }\n\n initFunction(node, isAsync) {\n node.id = null;\n node.generator = false;\n node.async = isAsync;\n }\n\n parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {\n this.initFunction(node, isAsync);\n node.generator = isGenerator;\n const allowModifiers = isConstructor;\n this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n this.parseFunctionParams(node, allowModifiers);\n const finishedNode = this.parseFunctionBodyAndFinish(node, type, true);\n this.prodParam.exit();\n this.scope.exit();\n return finishedNode;\n }\n\n parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {\n if (isTuple) {\n this.expectPlugin(\"recordAndTuple\");\n }\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const node = this.startNode();\n this.next();\n node.elements = this.parseExprList(close, !isTuple, refExpressionErrors,\n node);\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return this.finishNode(node, isTuple ? \"TupleExpression\" : \"ArrayExpression\");\n }\n\n parseArrowExpression(node, params, isAsync, trailingCommaLoc) {\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n let flags = functionFlags(isAsync, false);\n if (!this.match(5) && this.prodParam.hasIn) {\n flags |= PARAM_IN;\n }\n this.prodParam.enter(flags);\n this.initFunction(node, isAsync);\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n if (params) {\n this.state.maybeInArrowParameters = true;\n this.setArrowFunctionParameters(node, params, trailingCommaLoc);\n }\n this.state.maybeInArrowParameters = false;\n this.parseFunctionBody(node, true);\n this.prodParam.exit();\n this.scope.exit();\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return this.finishNode(node, \"ArrowFunctionExpression\");\n }\n setArrowFunctionParameters(node, params, trailingCommaLoc) {\n this.toAssignableList(params, trailingCommaLoc, false);\n node.params = params;\n }\n parseFunctionBodyAndFinish(node, type, isMethod = false) {\n this.parseFunctionBody(node, false, isMethod);\n return this.finishNode(node, type);\n }\n\n parseFunctionBody(node, allowExpression, isMethod = false) {\n const isExpression = allowExpression && !this.match(5);\n this.expressionScope.enter(newExpressionScope());\n if (isExpression) {\n node.body = this.parseMaybeAssign();\n this.checkParams(node, false, allowExpression, false);\n } else {\n const oldStrict = this.state.strict;\n const oldLabels = this.state.labels;\n this.state.labels = [];\n\n this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);\n node.body = this.parseBlock(true, false,\n hasStrictModeDirective => {\n const nonSimple = !this.isSimpleParamList(node.params);\n if (hasStrictModeDirective && nonSimple) {\n this.raise(Errors.IllegalLanguageModeDirective, {\n at:\n (node.kind === \"method\" || node.kind === \"constructor\") &&\n !!node.key ?\n node.key.loc.end : node\n });\n }\n const strictModeChanged = !oldStrict && this.state.strict;\n\n this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);\n\n if (this.state.strict && node.id) {\n this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged);\n }\n });\n this.prodParam.exit();\n this.state.labels = oldLabels;\n }\n this.expressionScope.exit();\n }\n isSimpleParameter(node) {\n return node.type === \"Identifier\";\n }\n isSimpleParamList(params) {\n for (let i = 0, len = params.length; i < len; i++) {\n if (!this.isSimpleParameter(params[i])) return false;\n }\n return true;\n }\n checkParams(node, allowDuplicates,\n isArrowFunction, strictModeChanged = true) {\n const checkClashes = !allowDuplicates && new Set();\n const formalParameters = {\n type: \"FormalParameters\"\n };\n for (const param of node.params) {\n this.checkLVal(param, {\n in: formalParameters,\n binding: BIND_VAR,\n checkClashes,\n strictModeChanged\n });\n }\n }\n\n parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {\n const elts = [];\n let first = true;\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n if (this.match(close)) {\n if (nodeForExtra) {\n this.addTrailingCommaExtraToNode(nodeForExtra);\n }\n this.next();\n break;\n }\n }\n elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));\n }\n return elts;\n }\n parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) {\n let elt;\n if (this.match(12)) {\n if (!allowEmpty) {\n this.raise(Errors.UnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: \",\"\n });\n }\n elt = null;\n } else if (this.match(21)) {\n const spreadNodeStartLoc = this.state.startLoc;\n elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc);\n } else if (this.match(17)) {\n this.expectPlugin(\"partialApplication\");\n if (!allowPlaceholder) {\n this.raise(Errors.UnexpectedArgumentPlaceholder, {\n at: this.state.startLoc\n });\n }\n const node = this.startNode();\n this.next();\n elt = this.finishNode(node, \"ArgumentPlaceholder\");\n } else {\n elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem);\n }\n return elt;\n }\n\n parseIdentifier(liberal) {\n const node = this.startNode();\n const name = this.parseIdentifierName(liberal);\n return this.createIdentifier(node, name);\n }\n createIdentifier(node, name) {\n node.name = name;\n node.loc.identifierName = name;\n return this.finishNode(node, \"Identifier\");\n }\n parseIdentifierName(liberal) {\n let name;\n const {\n startLoc,\n type\n } = this.state;\n if (tokenIsKeywordOrIdentifier(type)) {\n name = this.state.value;\n } else {\n throw this.unexpected();\n }\n const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type);\n if (liberal) {\n if (tokenIsKeyword) {\n this.replaceToken(130);\n }\n } else {\n this.checkReservedWord(name, startLoc, tokenIsKeyword, false);\n }\n this.next();\n return name;\n }\n checkReservedWord(word, startLoc, checkKeywords, isBinding) {\n if (word.length > 10) {\n return;\n }\n if (!canBeReservedWord(word)) {\n return;\n }\n if (word === \"yield\") {\n if (this.prodParam.hasYield) {\n this.raise(Errors.YieldBindingIdentifier, {\n at: startLoc\n });\n return;\n }\n } else if (word === \"await\") {\n if (this.prodParam.hasAwait) {\n this.raise(Errors.AwaitBindingIdentifier, {\n at: startLoc\n });\n return;\n }\n if (this.scope.inStaticBlock) {\n this.raise(Errors.AwaitBindingIdentifierInStaticBlock, {\n at: startLoc\n });\n return;\n }\n this.expressionScope.recordAsyncArrowParametersError({\n at: startLoc\n });\n } else if (word === \"arguments\") {\n if (this.scope.inClassAndNotInNonArrowFunction) {\n this.raise(Errors.ArgumentsInClass, {\n at: startLoc\n });\n return;\n }\n }\n if (checkKeywords && isKeyword(word)) {\n this.raise(Errors.UnexpectedKeyword, {\n at: startLoc,\n keyword: word\n });\n return;\n }\n const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;\n if (reservedTest(word, this.inModule)) {\n this.raise(Errors.UnexpectedReservedWord, {\n at: startLoc,\n reservedWord: word\n });\n }\n }\n isAwaitAllowed() {\n if (this.prodParam.hasAwait) return true;\n if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) {\n return true;\n }\n return false;\n }\n\n parseAwait(startLoc) {\n const node = this.startNodeAt(startLoc);\n this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, {\n at: node\n });\n if (this.eat(55)) {\n this.raise(Errors.ObsoleteAwaitStar, {\n at: node\n });\n }\n if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {\n if (this.isAmbiguousAwait()) {\n this.ambiguousScriptDifferentAst = true;\n } else {\n this.sawUnambiguousESM = true;\n }\n }\n if (!this.state.soloAwait) {\n node.argument = this.parseMaybeUnary(null, true);\n }\n return this.finishNode(node, \"AwaitExpression\");\n }\n isAmbiguousAwait() {\n if (this.hasPrecedingLineBreak()) return true;\n const {\n type\n } = this.state;\n return (\n type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 101 && !this.state.containsEsc ||\n type === 135 || type === 56 ||\n this.hasPlugin(\"v8intrinsic\") && type === 54\n );\n }\n\n parseYield() {\n const node = this.startNode();\n this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, {\n at: node\n });\n this.next();\n let delegating = false;\n let argument = null;\n if (!this.hasPrecedingLineBreak()) {\n delegating = this.eat(55);\n switch (this.state.type) {\n case 13:\n case 137:\n case 8:\n case 11:\n case 3:\n case 9:\n case 14:\n case 12:\n if (!delegating) break;\n default:\n argument = this.parseMaybeAssign();\n }\n }\n node.delegate = delegating;\n node.argument = argument;\n return this.finishNode(node, \"YieldExpression\");\n }\n\n checkPipelineAtInfixOperator(left, leftStartLoc) {\n if (this.hasPlugin([\"pipelineOperator\", {\n proposal: \"smart\"\n }])) {\n if (left.type === \"SequenceExpression\") {\n this.raise(Errors.PipelineHeadSequenceExpression, {\n at: leftStartLoc\n });\n }\n }\n }\n parseSmartPipelineBodyInStyle(childExpr, startLoc) {\n if (this.isSimpleReference(childExpr)) {\n const bodyNode = this.startNodeAt(startLoc);\n bodyNode.callee = childExpr;\n return this.finishNode(bodyNode, \"PipelineBareFunction\");\n } else {\n const bodyNode = this.startNodeAt(startLoc);\n this.checkSmartPipeTopicBodyEarlyErrors(startLoc);\n bodyNode.expression = childExpr;\n return this.finishNode(bodyNode, \"PipelineTopicExpression\");\n }\n }\n isSimpleReference(expression) {\n switch (expression.type) {\n case \"MemberExpression\":\n return !expression.computed && this.isSimpleReference(expression.object);\n case \"Identifier\":\n return true;\n default:\n return false;\n }\n }\n\n checkSmartPipeTopicBodyEarlyErrors(startLoc) {\n if (this.match(19)) {\n throw this.raise(Errors.PipelineBodyNoArrow, {\n at: this.state.startLoc\n });\n }\n\n if (!this.topicReferenceWasUsedInCurrentContext()) {\n this.raise(Errors.PipelineTopicUnused, {\n at: startLoc\n });\n }\n }\n\n withTopicBindingContext(callback) {\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n maxNumOfResolvableTopics: 1,\n maxTopicIndex: null\n };\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n }\n\n withSmartMixTopicForbiddingContext(callback) {\n if (this.hasPlugin([\"pipelineOperator\", {\n proposal: \"smart\"\n }])) {\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null\n };\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n } else {\n return callback();\n }\n }\n withSoloAwaitPermittingContext(callback) {\n const outerContextSoloAwaitState = this.state.soloAwait;\n this.state.soloAwait = true;\n try {\n return callback();\n } finally {\n this.state.soloAwait = outerContextSoloAwaitState;\n }\n }\n allowInAnd(callback) {\n const flags = this.prodParam.currentFlags();\n const prodParamToSet = PARAM_IN & ~flags;\n if (prodParamToSet) {\n this.prodParam.enter(flags | PARAM_IN);\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n return callback();\n }\n disallowInAnd(callback) {\n const flags = this.prodParam.currentFlags();\n const prodParamToClear = PARAM_IN & flags;\n if (prodParamToClear) {\n this.prodParam.enter(flags & ~PARAM_IN);\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n return callback();\n }\n\n registerTopicReference() {\n this.state.topicContext.maxTopicIndex = 0;\n }\n topicReferenceIsAllowedInCurrentContext() {\n return this.state.topicContext.maxNumOfResolvableTopics >= 1;\n }\n topicReferenceWasUsedInCurrentContext() {\n return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;\n }\n parseFSharpPipelineBody(prec) {\n const startLoc = this.state.startLoc;\n this.state.potentialArrowAt = this.state.start;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = true;\n const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec);\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return ret;\n }\n\n parseModuleExpression() {\n this.expectPlugin(\"moduleBlocks\");\n const node = this.startNode();\n this.next();\n if (!this.match(5)) {\n this.unexpected(null, 5);\n }\n const program = this.startNodeAt(this.state.endLoc);\n this.next();\n\n const revertScopes = this.initializeScopes(true);\n this.enterInitialScopes();\n try {\n node.body = this.parseProgram(program, 8, \"module\");\n } finally {\n revertScopes();\n }\n return this.finishNode(node, \"ModuleExpression\");\n }\n\n parsePropertyNamePrefixOperator(\n prop) {}\n}\n\nconst loopLabel = {\n kind: \"loop\"\n },\n switchLabel = {\n kind: \"switch\"\n };\nvar ParseFunctionFlag = {\n Expression: 0,\n Declaration: 1,\n HangingDeclaration: 2,\n NullableId: 4,\n Async: 8\n};\nvar ParseStatementFlag = {\n StatementOnly: 0,\n AllowImportExport: 1,\n AllowDeclaration: 2,\n AllowFunctionDeclaration: 4,\n AllowLabeledFunction: 8\n};\nconst loneSurrogate = /[\\uD800-\\uDFFF]/u;\nconst keywordRelationalOperator = /in(?:stanceof)?/y;\n\nfunction babel7CompatTokens(tokens, input) {\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n const {\n type\n } = token;\n if (typeof type === \"number\") {\n {\n if (type === 136) {\n const {\n loc,\n start,\n value,\n end\n } = token;\n const hashEndPos = start + 1;\n const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);\n tokens.splice(i, 1, new Token({\n type: getExportedToken(27),\n value: \"#\",\n start: start,\n end: hashEndPos,\n startLoc: loc.start,\n endLoc: hashEndLoc\n }), new Token({\n type: getExportedToken(130),\n value: value,\n start: hashEndPos,\n end: end,\n startLoc: hashEndLoc,\n endLoc: loc.end\n }));\n i++;\n continue;\n }\n if (tokenIsTemplate(type)) {\n const {\n loc,\n start,\n value,\n end\n } = token;\n const backquoteEnd = start + 1;\n const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);\n let startToken;\n if (input.charCodeAt(start) === 96) {\n startToken = new Token({\n type: getExportedToken(22),\n value: \"`\",\n start: start,\n end: backquoteEnd,\n startLoc: loc.start,\n endLoc: backquoteEndLoc\n });\n } else {\n startToken = new Token({\n type: getExportedToken(8),\n value: \"}\",\n start: start,\n end: backquoteEnd,\n startLoc: loc.start,\n endLoc: backquoteEndLoc\n });\n }\n let templateValue, templateElementEnd, templateElementEndLoc, endToken;\n if (type === 24) {\n templateElementEnd = end - 1;\n templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1);\n templateValue = value === null ? null : value.slice(1, -1);\n endToken = new Token({\n type: getExportedToken(22),\n value: \"`\",\n start: templateElementEnd,\n end: end,\n startLoc: templateElementEndLoc,\n endLoc: loc.end\n });\n } else {\n templateElementEnd = end - 2;\n templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2);\n templateValue = value === null ? null : value.slice(1, -2);\n endToken = new Token({\n type: getExportedToken(23),\n value: \"${\",\n start: templateElementEnd,\n end: end,\n startLoc: templateElementEndLoc,\n endLoc: loc.end\n });\n }\n tokens.splice(i, 1, startToken, new Token({\n type: getExportedToken(20),\n value: templateValue,\n start: backquoteEnd,\n end: templateElementEnd,\n startLoc: backquoteEndLoc,\n endLoc: templateElementEndLoc\n }), endToken);\n i += 2;\n continue;\n }\n }\n token.type = getExportedToken(type);\n }\n }\n return tokens;\n}\nclass StatementParser extends ExpressionParser {\n\n parseTopLevel(file, program) {\n file.program = this.parseProgram(program);\n file.comments = this.state.comments;\n if (this.options.tokens) {\n file.tokens = babel7CompatTokens(this.tokens, this.input);\n }\n return this.finishNode(file, \"File\");\n }\n parseProgram(program, end = 137, sourceType = this.options.sourceType) {\n program.sourceType = sourceType;\n program.interpreter = this.parseInterpreterDirective();\n this.parseBlockBody(program, true, true, end);\n if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {\n for (const [localName, at] of Array.from(this.scope.undefinedExports)) {\n this.raise(Errors.ModuleExportUndefined, {\n at,\n localName\n });\n }\n }\n let finishedProgram;\n if (end === 137) {\n finishedProgram = this.finishNode(program, \"Program\");\n } else {\n finishedProgram = this.finishNodeAt(program, \"Program\", createPositionWithColumnOffset(this.state.startLoc, -1));\n }\n return finishedProgram;\n }\n\n stmtToDirective(stmt) {\n const directive = stmt;\n directive.type = \"Directive\";\n directive.value = directive.expression;\n delete directive.expression;\n const directiveLiteral = directive.value;\n const expressionValue = directiveLiteral.value;\n const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end);\n const val = directiveLiteral.value = raw.slice(1, -1);\n\n this.addExtra(directiveLiteral, \"raw\", raw);\n this.addExtra(directiveLiteral, \"rawValue\", val);\n this.addExtra(directiveLiteral, \"expressionValue\", expressionValue);\n directiveLiteral.type = \"DirectiveLiteral\";\n return directive;\n }\n parseInterpreterDirective() {\n if (!this.match(28)) {\n return null;\n }\n const node = this.startNode();\n node.value = this.state.value;\n this.next();\n return this.finishNode(node, \"InterpreterDirective\");\n }\n isLet() {\n if (!this.isContextual(99)) {\n return false;\n }\n return this.hasFollowingBindingAtom();\n }\n chStartsBindingIdentifier(ch, pos) {\n if (isIdentifierStart(ch)) {\n keywordRelationalOperator.lastIndex = pos;\n if (keywordRelationalOperator.test(this.input)) {\n const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);\n if (!isIdentifierChar(endCh) && endCh !== 92) {\n return false;\n }\n }\n return true;\n } else if (ch === 92) {\n return true;\n } else {\n return false;\n }\n }\n chStartsBindingPattern(ch) {\n return ch === 91 || ch === 123;\n }\n\n hasFollowingBindingAtom() {\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next);\n }\n\n hasFollowingBindingIdentifier() {\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n return this.chStartsBindingIdentifier(nextCh, next);\n }\n startsUsingForOf() {\n const lookahead = this.lookahead();\n if (lookahead.type === 101 && !lookahead.containsEsc) {\n return false;\n } else {\n this.expectPlugin(\"explicitResourceManagement\");\n return true;\n }\n }\n\n parseModuleItem() {\n return this.parseStatementLike(ParseStatementFlag.AllowImportExport | ParseStatementFlag.AllowDeclaration | ParseStatementFlag.AllowFunctionDeclaration | ParseStatementFlag.AllowLabeledFunction);\n }\n\n parseStatementListItem() {\n return this.parseStatementLike(ParseStatementFlag.AllowDeclaration | ParseStatementFlag.AllowFunctionDeclaration | ParseStatementFlag.AllowLabeledFunction);\n }\n parseStatementOrFunctionDeclaration(disallowLabeledFunction) {\n return this.parseStatementLike(ParseStatementFlag.AllowFunctionDeclaration | (disallowLabeledFunction ? 0 : ParseStatementFlag.AllowLabeledFunction));\n }\n\n parseStatement() {\n return this.parseStatementLike(ParseStatementFlag.StatementOnly);\n }\n\n parseStatementLike(flags) {\n let decorators = null;\n if (this.match(26)) {\n decorators = this.parseDecorators(true);\n }\n return this.parseStatementContent(flags, decorators);\n }\n parseStatementContent(flags, decorators) {\n const starttype = this.state.type;\n const node = this.startNode();\n const allowDeclaration = !!(flags & ParseStatementFlag.AllowDeclaration);\n const allowFunctionDeclaration = !!(flags & ParseStatementFlag.AllowFunctionDeclaration);\n const topLevel = flags & ParseStatementFlag.AllowImportExport;\n\n switch (starttype) {\n case 60:\n return this.parseBreakContinueStatement(node, true);\n case 63:\n return this.parseBreakContinueStatement(node, false);\n case 64:\n return this.parseDebuggerStatement(node);\n case 90:\n return this.parseDoWhileStatement(node);\n case 91:\n return this.parseForStatement(node);\n case 68:\n if (this.lookaheadCharCode() === 46) break;\n if (!allowDeclaration) {\n if (this.state.strict) {\n this.raise(Errors.StrictFunction, {\n at: this.state.startLoc\n });\n } else if (!allowFunctionDeclaration) {\n this.raise(Errors.SloppyFunction, {\n at: this.state.startLoc\n });\n }\n }\n return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration);\n case 80:\n if (!allowDeclaration) this.unexpected();\n return this.parseClass(this.maybeTakeDecorators(decorators, node), true);\n case 69:\n return this.parseIfStatement(node);\n case 70:\n return this.parseReturnStatement(node);\n case 71:\n return this.parseSwitchStatement(node);\n case 72:\n return this.parseThrowStatement(node);\n case 73:\n return this.parseTryStatement(node);\n case 105:\n if (this.hasFollowingLineBreak() || this.state.containsEsc || !this.hasFollowingBindingIdentifier()) {\n break;\n }\n this.expectPlugin(\"explicitResourceManagement\");\n if (!this.scope.inModule && this.scope.inTopLevel) {\n this.raise(Errors.UnexpectedUsingDeclaration, {\n at: this.state.startLoc\n });\n } else if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: this.state.startLoc\n });\n }\n return this.parseVarStatement(node, \"using\");\n case 99:\n {\n if (this.state.containsEsc) {\n break;\n }\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n if (nextCh !== 91) {\n if (!allowDeclaration && this.hasFollowingLineBreak()) break;\n if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) {\n break;\n }\n }\n }\n case 75:\n {\n if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: this.state.startLoc\n });\n }\n }\n case 74:\n {\n const kind = this.state.value;\n return this.parseVarStatement(node, kind);\n }\n case 92:\n return this.parseWhileStatement(node);\n case 76:\n return this.parseWithStatement(node);\n case 5:\n return this.parseBlock();\n case 13:\n return this.parseEmptyStatement(node);\n case 83:\n {\n const nextTokenCharCode = this.lookaheadCharCode();\n if (nextTokenCharCode === 40 ||\n nextTokenCharCode === 46) {\n break;\n }\n }\n case 82:\n {\n if (!this.options.allowImportExportEverywhere && !topLevel) {\n this.raise(Errors.UnexpectedImportExport, {\n at: this.state.startLoc\n });\n }\n this.next();\n\n let result;\n if (starttype === 83) {\n result = this.parseImport(node);\n if (result.type === \"ImportDeclaration\" && (!result.importKind || result.importKind === \"value\")) {\n this.sawUnambiguousESM = true;\n }\n } else {\n result = this.parseExport(node, decorators);\n if (result.type === \"ExportNamedDeclaration\" && (!result.exportKind || result.exportKind === \"value\") || result.type === \"ExportAllDeclaration\" && (!result.exportKind || result.exportKind === \"value\") || result.type === \"ExportDefaultDeclaration\") {\n this.sawUnambiguousESM = true;\n }\n }\n this.assertModuleNodeAllowed(result);\n return result;\n }\n default:\n {\n if (this.isAsyncFunction()) {\n if (!allowDeclaration) {\n this.raise(Errors.AsyncFunctionInSingleStatementContext, {\n at: this.state.startLoc\n });\n }\n this.next();\n return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration);\n }\n }\n }\n\n const maybeName = this.state.value;\n const expr = this.parseExpression();\n if (tokenIsIdentifier(starttype) && expr.type === \"Identifier\" && this.eat(14)) {\n return this.parseLabeledStatement(node, maybeName,\n expr, flags);\n } else {\n return this.parseExpressionStatement(node, expr, decorators);\n }\n }\n assertModuleNodeAllowed(node) {\n if (!this.options.allowImportExportEverywhere && !this.inModule) {\n this.raise(Errors.ImportOutsideModule, {\n at: node\n });\n }\n }\n decoratorsEnabledBeforeExport() {\n if (this.hasPlugin(\"decorators-legacy\")) return true;\n return this.hasPlugin(\"decorators\") && !!this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\");\n }\n\n maybeTakeDecorators(maybeDecorators, classNode, exportNode) {\n if (maybeDecorators) {\n classNode.decorators = maybeDecorators;\n this.resetStartLocationFromNode(classNode, maybeDecorators[0]);\n if (exportNode) this.resetStartLocationFromNode(exportNode, classNode);\n }\n return classNode;\n }\n canHaveLeadingDecorator() {\n return this.match(80);\n }\n parseDecorators(allowExport) {\n const decorators = [];\n do {\n decorators.push(this.parseDecorator());\n } while (this.match(26));\n if (this.match(82)) {\n if (!allowExport) {\n this.unexpected();\n }\n if (!this.decoratorsEnabledBeforeExport()) {\n this.raise(Errors.DecoratorExportClass, {\n at: this.state.startLoc\n });\n }\n } else if (!this.canHaveLeadingDecorator()) {\n throw this.raise(Errors.UnexpectedLeadingDecorator, {\n at: this.state.startLoc\n });\n }\n return decorators;\n }\n parseDecorator() {\n this.expectOnePlugin([\"decorators\", \"decorators-legacy\"]);\n const node = this.startNode();\n this.next();\n if (this.hasPlugin(\"decorators\")) {\n const startLoc = this.state.startLoc;\n let expr;\n if (this.match(10)) {\n const startLoc = this.state.startLoc;\n this.next();\n expr = this.parseExpression();\n this.expect(11);\n expr = this.wrapParenthesis(startLoc, expr);\n const paramsStartLoc = this.state.startLoc;\n node.expression = this.parseMaybeDecoratorArguments(expr);\n if (this.getPluginOption(\"decorators\", \"allowCallParenthesized\") === false && node.expression !== expr) {\n this.raise(Errors.DecoratorArgumentsOutsideParentheses, {\n at: paramsStartLoc\n });\n }\n } else {\n expr = this.parseIdentifier(false);\n while (this.eat(16)) {\n const node = this.startNodeAt(startLoc);\n node.object = expr;\n if (this.match(136)) {\n this.classScope.usePrivateName(this.state.value, this.state.startLoc);\n node.property = this.parsePrivateName();\n } else {\n node.property = this.parseIdentifier(true);\n }\n node.computed = false;\n expr = this.finishNode(node, \"MemberExpression\");\n }\n node.expression = this.parseMaybeDecoratorArguments(expr);\n }\n } else {\n node.expression = this.parseExprSubscripts();\n }\n return this.finishNode(node, \"Decorator\");\n }\n parseMaybeDecoratorArguments(expr) {\n if (this.eat(10)) {\n const node = this.startNodeAtNode(expr);\n node.callee = expr;\n node.arguments = this.parseCallExpressionArguments(11, false);\n this.toReferencedList(node.arguments);\n return this.finishNode(node, \"CallExpression\");\n }\n return expr;\n }\n parseBreakContinueStatement(node, isBreak) {\n this.next();\n if (this.isLineTerminator()) {\n node.label = null;\n } else {\n node.label = this.parseIdentifier();\n this.semicolon();\n }\n this.verifyBreakContinue(node, isBreak);\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\");\n }\n verifyBreakContinue(node, isBreak) {\n let i;\n for (i = 0; i < this.state.labels.length; ++i) {\n const lab = this.state.labels[i];\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) break;\n if (node.label && isBreak) break;\n }\n }\n if (i === this.state.labels.length) {\n const type = isBreak ? \"BreakStatement\" : \"ContinueStatement\";\n this.raise(Errors.IllegalBreakContinue, {\n at: node,\n type\n });\n }\n }\n parseDebuggerStatement(node) {\n this.next();\n this.semicolon();\n return this.finishNode(node, \"DebuggerStatement\");\n }\n parseHeaderExpression() {\n this.expect(10);\n const val = this.parseExpression();\n this.expect(11);\n return val;\n }\n\n parseDoWhileStatement(node) {\n this.next();\n this.state.labels.push(loopLabel);\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n this.state.labels.pop();\n this.expect(92);\n node.test = this.parseHeaderExpression();\n this.eat(13);\n return this.finishNode(node, \"DoWhileStatement\");\n }\n\n parseForStatement(node) {\n this.next();\n this.state.labels.push(loopLabel);\n let awaitAt = null;\n if (this.isAwaitAllowed() && this.eatContextual(96)) {\n awaitAt = this.state.lastTokStartLoc;\n }\n this.scope.enter(SCOPE_OTHER);\n this.expect(10);\n if (this.match(13)) {\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node, null);\n }\n const startsWithLet = this.isContextual(99);\n const startsWithUsing = this.isContextual(105) && !this.hasFollowingLineBreak();\n const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || startsWithUsing && this.hasFollowingBindingIdentifier() && this.startsUsingForOf();\n if (this.match(74) || this.match(75) || isLetOrUsing) {\n const initNode = this.startNode();\n const kind = this.state.value;\n this.next();\n this.parseVar(initNode, true, kind);\n const init = this.finishNode(initNode, \"VariableDeclaration\");\n const isForIn = this.match(58);\n if (isForIn && startsWithUsing) {\n this.raise(Errors.ForInUsing, {\n at: init\n });\n }\n if ((isForIn || this.isContextual(101)) && init.declarations.length === 1) {\n return this.parseForIn(node, init, awaitAt);\n }\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node, init);\n }\n\n const startsWithAsync = this.isContextual(95);\n const refExpressionErrors = new ExpressionErrors();\n const init = this.parseExpression(true, refExpressionErrors);\n const isForOf = this.isContextual(101);\n if (isForOf) {\n if (startsWithLet) {\n this.raise(Errors.ForOfLet, {\n at: init\n });\n }\n if (\n awaitAt === null && startsWithAsync && init.type === \"Identifier\") {\n this.raise(Errors.ForOfAsync, {\n at: init\n });\n }\n }\n if (isForOf || this.match(58)) {\n this.checkDestructuringPrivate(refExpressionErrors);\n this.toAssignable(init, true);\n const type = isForOf ? \"ForOfStatement\" : \"ForInStatement\";\n this.checkLVal(init, {\n in: {\n type\n }\n });\n return this.parseForIn(node,\n init, awaitAt);\n } else {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node, init);\n }\n\n parseFunctionStatement(node, isAsync, isHangingDeclaration) {\n this.next();\n return this.parseFunction(node, ParseFunctionFlag.Declaration | (isHangingDeclaration ? ParseFunctionFlag.HangingDeclaration : 0) | (isAsync ? ParseFunctionFlag.Async : 0));\n }\n\n parseIfStatement(node) {\n this.next();\n node.test = this.parseHeaderExpression();\n node.consequent = this.parseStatementOrFunctionDeclaration(\n true);\n node.alternate = this.eat(66) ? this.parseStatementOrFunctionDeclaration(true) : null;\n return this.finishNode(node, \"IfStatement\");\n }\n parseReturnStatement(node) {\n if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {\n this.raise(Errors.IllegalReturn, {\n at: this.state.startLoc\n });\n }\n this.next();\n\n if (this.isLineTerminator()) {\n node.argument = null;\n } else {\n node.argument = this.parseExpression();\n this.semicolon();\n }\n return this.finishNode(node, \"ReturnStatement\");\n }\n\n parseSwitchStatement(node) {\n this.next();\n node.discriminant = this.parseHeaderExpression();\n const cases = node.cases = [];\n this.expect(5);\n this.state.labels.push(switchLabel);\n this.scope.enter(SCOPE_OTHER);\n\n let cur;\n for (let sawDefault; !this.match(8);) {\n if (this.match(61) || this.match(65)) {\n const isCase = this.match(61);\n if (cur) this.finishNode(cur, \"SwitchCase\");\n cases.push(cur = this.startNode());\n cur.consequent = [];\n this.next();\n if (isCase) {\n cur.test = this.parseExpression();\n } else {\n if (sawDefault) {\n this.raise(Errors.MultipleDefaultsInSwitch, {\n at: this.state.lastTokStartLoc\n });\n }\n sawDefault = true;\n cur.test = null;\n }\n this.expect(14);\n } else {\n if (cur) {\n cur.consequent.push(this.parseStatementListItem());\n } else {\n this.unexpected();\n }\n }\n }\n this.scope.exit();\n if (cur) this.finishNode(cur, \"SwitchCase\");\n this.next();\n this.state.labels.pop();\n return this.finishNode(node, \"SwitchStatement\");\n }\n parseThrowStatement(node) {\n this.next();\n if (this.hasPrecedingLineBreak()) {\n this.raise(Errors.NewlineAfterThrow, {\n at: this.state.lastTokEndLoc\n });\n }\n node.argument = this.parseExpression();\n this.semicolon();\n return this.finishNode(node, \"ThrowStatement\");\n }\n parseCatchClauseParam() {\n const param = this.parseBindingAtom();\n const simple = param.type === \"Identifier\";\n this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0);\n this.checkLVal(param, {\n in: {\n type: \"CatchClause\"\n },\n binding: BIND_LEXICAL,\n allowingSloppyLetBinding: true\n });\n return param;\n }\n parseTryStatement(node) {\n this.next();\n node.block = this.parseBlock();\n node.handler = null;\n if (this.match(62)) {\n const clause = this.startNode();\n this.next();\n if (this.match(10)) {\n this.expect(10);\n clause.param = this.parseCatchClauseParam();\n this.expect(11);\n } else {\n clause.param = null;\n this.scope.enter(SCOPE_OTHER);\n }\n\n clause.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseBlock(false, false));\n this.scope.exit();\n node.handler = this.finishNode(clause, \"CatchClause\");\n }\n node.finalizer = this.eat(67) ? this.parseBlock() : null;\n if (!node.handler && !node.finalizer) {\n this.raise(Errors.NoCatchOrFinally, {\n at: node\n });\n }\n return this.finishNode(node, \"TryStatement\");\n }\n\n parseVarStatement(node, kind, allowMissingInitializer = false) {\n this.next();\n this.parseVar(node, false, kind, allowMissingInitializer);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\");\n }\n\n parseWhileStatement(node) {\n this.next();\n node.test = this.parseHeaderExpression();\n this.state.labels.push(loopLabel);\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n this.state.labels.pop();\n return this.finishNode(node, \"WhileStatement\");\n }\n parseWithStatement(node) {\n if (this.state.strict) {\n this.raise(Errors.StrictWith, {\n at: this.state.startLoc\n });\n }\n this.next();\n node.object = this.parseHeaderExpression();\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n return this.finishNode(node, \"WithStatement\");\n }\n parseEmptyStatement(node) {\n this.next();\n return this.finishNode(node, \"EmptyStatement\");\n }\n\n parseLabeledStatement(node, maybeName, expr, flags) {\n for (const label of this.state.labels) {\n if (label.name === maybeName) {\n this.raise(Errors.LabelRedeclaration, {\n at: expr,\n labelName: maybeName\n });\n }\n }\n const kind = tokenIsLoop(this.state.type) ? \"loop\" : this.match(71) ? \"switch\" : null;\n for (let i = this.state.labels.length - 1; i >= 0; i--) {\n const label = this.state.labels[i];\n if (label.statementStart === node.start) {\n label.statementStart = this.state.start;\n label.kind = kind;\n } else {\n break;\n }\n }\n this.state.labels.push({\n name: maybeName,\n kind: kind,\n statementStart: this.state.start\n });\n node.body = flags & ParseStatementFlag.AllowLabeledFunction ? this.parseStatementOrFunctionDeclaration(false) : this.parseStatement();\n this.state.labels.pop();\n node.label = expr;\n return this.finishNode(node, \"LabeledStatement\");\n }\n parseExpressionStatement(node, expr,\n decorators) {\n node.expression = expr;\n this.semicolon();\n return this.finishNode(node, \"ExpressionStatement\");\n }\n\n parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {\n const node = this.startNode();\n if (allowDirectives) {\n this.state.strictErrors.clear();\n }\n this.expect(5);\n if (createNewLexicalScope) {\n this.scope.enter(SCOPE_OTHER);\n }\n this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse);\n if (createNewLexicalScope) {\n this.scope.exit();\n }\n return this.finishNode(node, \"BlockStatement\");\n }\n isValidDirective(stmt) {\n return stmt.type === \"ExpressionStatement\" && stmt.expression.type === \"StringLiteral\" && !stmt.expression.extra.parenthesized;\n }\n parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {\n const body = node.body = [];\n const directives = node.directives = [];\n this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);\n }\n\n parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {\n const oldStrict = this.state.strict;\n let hasStrictModeDirective = false;\n let parsedNonDirective = false;\n while (!this.match(end)) {\n const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem();\n if (directives && !parsedNonDirective) {\n if (this.isValidDirective(stmt)) {\n const directive = this.stmtToDirective(stmt);\n directives.push(directive);\n if (!hasStrictModeDirective && directive.value.value === \"use strict\") {\n hasStrictModeDirective = true;\n this.setStrict(true);\n }\n continue;\n }\n parsedNonDirective = true;\n this.state.strictErrors.clear();\n }\n body.push(stmt);\n }\n if (afterBlockParse) {\n afterBlockParse.call(this, hasStrictModeDirective);\n }\n if (!oldStrict) {\n this.setStrict(false);\n }\n this.next();\n }\n\n parseFor(node, init) {\n node.init = init;\n this.semicolon(false);\n node.test = this.match(13) ? null : this.parseExpression();\n this.semicolon(false);\n node.update = this.match(11) ? null : this.parseExpression();\n this.expect(11);\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n this.scope.exit();\n this.state.labels.pop();\n return this.finishNode(node, \"ForStatement\");\n }\n\n parseForIn(node, init, awaitAt) {\n const isForIn = this.match(58);\n this.next();\n if (isForIn) {\n if (awaitAt !== null) this.unexpected(awaitAt);\n } else {\n node.await = awaitAt !== null;\n }\n if (init.type === \"VariableDeclaration\" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== \"var\" || init.declarations[0].id.type !== \"Identifier\")) {\n this.raise(Errors.ForInOfLoopInitializer, {\n at: init,\n type: isForIn ? \"ForInStatement\" : \"ForOfStatement\"\n });\n }\n if (init.type === \"AssignmentPattern\") {\n this.raise(Errors.InvalidLhs, {\n at: init,\n ancestor: {\n type: \"ForStatement\"\n }\n });\n }\n node.left = init;\n node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();\n this.expect(11);\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n this.scope.exit();\n this.state.labels.pop();\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\");\n }\n\n parseVar(node, isFor, kind, allowMissingInitializer = false) {\n const declarations = node.declarations = [];\n node.kind = kind;\n for (;;) {\n const decl = this.startNode();\n this.parseVarId(decl, kind);\n decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();\n if (decl.init === null && !allowMissingInitializer) {\n if (decl.id.type !== \"Identifier\" && !(isFor && (this.match(58) || this.isContextual(101)))) {\n this.raise(Errors.DeclarationMissingInitializer, {\n at: this.state.lastTokEndLoc,\n kind: \"destructuring\"\n });\n } else if (kind === \"const\" && !(this.match(58) || this.isContextual(101))) {\n this.raise(Errors.DeclarationMissingInitializer, {\n at: this.state.lastTokEndLoc,\n kind: \"const\"\n });\n }\n }\n declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(12)) break;\n }\n return node;\n }\n parseVarId(decl, kind) {\n const id = this.parseBindingAtom();\n this.checkLVal(id, {\n in: {\n type: \"VariableDeclarator\"\n },\n binding: kind === \"var\" ? BIND_VAR : BIND_LEXICAL\n });\n decl.id = id;\n }\n\n parseAsyncFunctionExpression(node) {\n return this.parseFunction(node, ParseFunctionFlag.Async);\n }\n\n parseFunction(node, flags = ParseFunctionFlag.Expression) {\n const hangingDeclaration = flags & ParseFunctionFlag.HangingDeclaration;\n const isDeclaration = !!(flags & ParseFunctionFlag.Declaration);\n const requireId = isDeclaration && !(flags & ParseFunctionFlag.NullableId);\n const isAsync = !!(flags & ParseFunctionFlag.Async);\n this.initFunction(node, isAsync);\n if (this.match(55)) {\n if (hangingDeclaration) {\n this.raise(Errors.GeneratorInSingleStatementContext, {\n at: this.state.startLoc\n });\n }\n this.next();\n node.generator = true;\n }\n if (isDeclaration) {\n node.id = this.parseFunctionId(requireId);\n }\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = false;\n this.scope.enter(SCOPE_FUNCTION);\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n if (!isDeclaration) {\n node.id = this.parseFunctionId();\n }\n this.parseFunctionParams(node, false);\n\n this.withSmartMixTopicForbiddingContext(() => {\n this.parseFunctionBodyAndFinish(node, isDeclaration ? \"FunctionDeclaration\" : \"FunctionExpression\");\n });\n this.prodParam.exit();\n this.scope.exit();\n if (isDeclaration && !hangingDeclaration) {\n this.registerFunctionStatementId(node);\n }\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return node;\n }\n parseFunctionId(requireId) {\n return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null;\n }\n parseFunctionParams(node, allowModifiers) {\n this.expect(10);\n this.expressionScope.enter(newParameterDeclarationScope());\n node.params = this.parseBindingList(11, 41, false, allowModifiers);\n this.expressionScope.exit();\n }\n registerFunctionStatementId(node) {\n if (!node.id) return;\n\n this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.loc.start);\n }\n\n parseClass(node, isStatement, optionalId) {\n this.next();\n\n const oldStrict = this.state.strict;\n this.state.strict = true;\n this.parseClassId(node, isStatement, optionalId);\n this.parseClassSuper(node);\n node.body = this.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\");\n }\n isClassProperty() {\n return this.match(29) || this.match(13) || this.match(8);\n }\n isClassMethod() {\n return this.match(10);\n }\n isNonstaticConstructor(method) {\n return !method.computed && !method.static && (method.key.name === \"constructor\" ||\n method.key.value === \"constructor\");\n }\n\n parseClassBody(hadSuperClass, oldStrict) {\n this.classScope.enter();\n const state = {\n hadConstructor: false,\n hadSuperClass\n };\n let decorators = [];\n const classBody = this.startNode();\n classBody.body = [];\n this.expect(5);\n\n this.withSmartMixTopicForbiddingContext(() => {\n while (!this.match(8)) {\n if (this.eat(13)) {\n if (decorators.length > 0) {\n throw this.raise(Errors.DecoratorSemicolon, {\n at: this.state.lastTokEndLoc\n });\n }\n continue;\n }\n if (this.match(26)) {\n decorators.push(this.parseDecorator());\n continue;\n }\n const member = this.startNode();\n\n if (decorators.length) {\n member.decorators = decorators;\n this.resetStartLocationFromNode(member, decorators[0]);\n decorators = [];\n }\n this.parseClassMember(classBody, member, state);\n if (\n member.kind === \"constructor\" &&\n member.decorators &&\n member.decorators.length > 0) {\n this.raise(Errors.DecoratorConstructor, {\n at: member\n });\n }\n }\n });\n this.state.strict = oldStrict;\n this.next();\n\n if (decorators.length) {\n throw this.raise(Errors.TrailingDecorator, {\n at: this.state.startLoc\n });\n }\n this.classScope.exit();\n return this.finishNode(classBody, \"ClassBody\");\n }\n\n parseClassMemberFromModifier(classBody, member) {\n const key = this.parseIdentifier(true);\n\n if (this.isClassMethod()) {\n const method = member;\n\n method.kind = \"method\";\n method.computed = false;\n method.key = key;\n method.static = false;\n this.pushClassMethod(classBody, method, false, false, false, false);\n return true;\n } else if (this.isClassProperty()) {\n const prop = member;\n\n prop.computed = false;\n prop.key = key;\n prop.static = false;\n classBody.body.push(this.parseClassProperty(prop));\n return true;\n }\n this.resetPreviousNodeTrailingComments(key);\n return false;\n }\n parseClassMember(classBody, member, state) {\n const isStatic = this.isContextual(104);\n if (isStatic) {\n if (this.parseClassMemberFromModifier(classBody, member)) {\n return;\n }\n if (this.eat(5)) {\n this.parseClassStaticBlock(classBody, member);\n return;\n }\n }\n this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n parseClassMemberWithIsStatic(classBody, member, state, isStatic) {\n const publicMethod = member;\n const privateMethod = member;\n const publicProp = member;\n const privateProp = member;\n const accessorProp = member;\n const method = publicMethod;\n const publicMember = publicMethod;\n member.static = isStatic;\n this.parsePropertyNamePrefixOperator(member);\n if (this.eat(55)) {\n method.kind = \"method\";\n const isPrivateName = this.match(136);\n this.parseClassElementName(method);\n if (isPrivateName) {\n this.pushClassPrivateMethod(classBody, privateMethod, true, false);\n return;\n }\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsGenerator, {\n at: publicMethod.key\n });\n }\n this.pushClassMethod(classBody, publicMethod, true, false, false, false);\n return;\n }\n const isContextual = tokenIsIdentifier(this.state.type) && !this.state.containsEsc;\n const isPrivate = this.match(136);\n const key = this.parseClassElementName(member);\n const maybeQuestionTokenStartLoc = this.state.startLoc;\n this.parsePostMemberNameModifiers(publicMember);\n if (this.isClassMethod()) {\n method.kind = \"method\";\n if (isPrivate) {\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n return;\n }\n\n const isConstructor = this.isNonstaticConstructor(publicMethod);\n let allowsDirectSuper = false;\n if (isConstructor) {\n publicMethod.kind = \"constructor\";\n\n if (state.hadConstructor && !this.hasPlugin(\"typescript\")) {\n this.raise(Errors.DuplicateConstructor, {\n at: key\n });\n }\n if (isConstructor && this.hasPlugin(\"typescript\") && member.override) {\n this.raise(Errors.OverrideOnConstructor, {\n at: key\n });\n }\n state.hadConstructor = true;\n allowsDirectSuper = state.hadSuperClass;\n }\n this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);\n } else if (this.isClassProperty()) {\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else if (isContextual && key.name === \"async\" && !this.isLineTerminator()) {\n this.resetPreviousNodeTrailingComments(key);\n const isGenerator = this.eat(55);\n if (publicMember.optional) {\n this.unexpected(maybeQuestionTokenStartLoc);\n }\n method.kind = \"method\";\n const isPrivate = this.match(136);\n this.parseClassElementName(method);\n this.parsePostMemberNameModifiers(publicMember);\n if (isPrivate) {\n this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsAsync, {\n at: publicMethod.key\n });\n }\n this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);\n }\n } else if (isContextual && (key.name === \"get\" || key.name === \"set\") && !(this.match(55) && this.isLineTerminator())) {\n this.resetPreviousNodeTrailingComments(key);\n method.kind = key.name;\n const isPrivate = this.match(136);\n this.parseClassElementName(publicMethod);\n if (isPrivate) {\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsAccessor, {\n at: publicMethod.key\n });\n }\n this.pushClassMethod(classBody, publicMethod, false, false, false, false);\n }\n this.checkGetterSetterParams(publicMethod);\n } else if (isContextual && key.name === \"accessor\" && !this.isLineTerminator()) {\n this.expectPlugin(\"decoratorAutoAccessors\");\n this.resetPreviousNodeTrailingComments(key);\n\n const isPrivate = this.match(136);\n this.parseClassElementName(publicProp);\n this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);\n } else if (this.isLineTerminator()) {\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else {\n this.unexpected();\n }\n }\n\n parseClassElementName(member) {\n const {\n type,\n value\n } = this.state;\n if ((type === 130 || type === 131) && member.static && value === \"prototype\") {\n this.raise(Errors.StaticPrototype, {\n at: this.state.startLoc\n });\n }\n if (type === 136) {\n if (value === \"constructor\") {\n this.raise(Errors.ConstructorClassPrivateField, {\n at: this.state.startLoc\n });\n }\n const key = this.parsePrivateName();\n member.key = key;\n return key;\n }\n return this.parsePropertyName(member);\n }\n parseClassStaticBlock(classBody, member) {\n var _member$decorators;\n this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER);\n const oldLabels = this.state.labels;\n this.state.labels = [];\n this.prodParam.enter(PARAM);\n const body = member.body = [];\n this.parseBlockOrModuleBlockBody(body, undefined, false, 8);\n this.prodParam.exit();\n this.scope.exit();\n this.state.labels = oldLabels;\n classBody.body.push(this.finishNode(member, \"StaticBlock\"));\n if ((_member$decorators = member.decorators) != null && _member$decorators.length) {\n this.raise(Errors.DecoratorStaticBlock, {\n at: member\n });\n }\n }\n pushClassProperty(classBody, prop) {\n if (!prop.computed && (prop.key.name === \"constructor\" || prop.key.value === \"constructor\")) {\n this.raise(Errors.ConstructorClassField, {\n at: prop.key\n });\n }\n classBody.body.push(this.parseClassProperty(prop));\n }\n pushClassPrivateProperty(classBody, prop) {\n const node = this.parseClassPrivateProperty(prop);\n classBody.body.push(node);\n this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start);\n }\n pushClassAccessorProperty(classBody, prop, isPrivate) {\n if (!isPrivate && !prop.computed) {\n const key = prop.key;\n if (key.name === \"constructor\" || key.value === \"constructor\") {\n this.raise(Errors.ConstructorClassField, {\n at: key\n });\n }\n }\n const node = this.parseClassAccessorProperty(prop);\n classBody.body.push(node);\n if (isPrivate) {\n this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start);\n }\n }\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, \"ClassMethod\", true));\n }\n pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {\n const node = this.parseMethod(method, isGenerator, isAsync, false, false, \"ClassPrivateMethod\", true);\n classBody.body.push(node);\n const kind = node.kind === \"get\" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === \"set\" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER;\n this.declareClassPrivateMethodInScope(node, kind);\n }\n declareClassPrivateMethodInScope(node, kind) {\n this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start);\n }\n\n parsePostMemberNameModifiers(\n methodOrProp) {}\n\n parseClassPrivateProperty(node) {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassPrivateProperty\");\n }\n\n parseClassProperty(node) {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassProperty\");\n }\n parseClassAccessorProperty(node) {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassAccessorProperty\");\n }\n\n parseInitializer(node) {\n this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);\n this.expressionScope.enter(newExpressionScope());\n this.prodParam.enter(PARAM);\n node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null;\n this.expressionScope.exit();\n this.prodParam.exit();\n this.scope.exit();\n }\n parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) {\n if (tokenIsIdentifier(this.state.type)) {\n node.id = this.parseIdentifier();\n if (isStatement) {\n this.declareNameFromIdentifier(node.id, bindingType);\n }\n } else {\n if (optionalId || !isStatement) {\n node.id = null;\n } else {\n throw this.raise(Errors.MissingClassName, {\n at: this.state.startLoc\n });\n }\n }\n }\n\n parseClassSuper(node) {\n node.superClass = this.eat(81) ? this.parseExprSubscripts() : null;\n }\n\n parseExport(node, decorators) {\n const hasDefault = this.maybeParseExportDefaultSpecifier(\n node);\n const parseAfterDefault = !hasDefault || this.eat(12);\n const hasStar = parseAfterDefault && this.eatExportStar(\n node);\n const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(\n node);\n const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12));\n const isFromRequired = hasDefault || hasStar;\n if (hasStar && !hasNamespace) {\n if (hasDefault) this.unexpected();\n if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, {\n at: node\n });\n }\n this.parseExportFrom(node, true);\n return this.finishNode(node, \"ExportAllDeclaration\");\n }\n const hasSpecifiers = this.maybeParseExportNamedSpecifiers(\n node);\n if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {\n throw this.unexpected(null, 5);\n }\n let hasDeclaration;\n if (isFromRequired || hasSpecifiers) {\n hasDeclaration = false;\n if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, {\n at: node\n });\n }\n this.parseExportFrom(node, isFromRequired);\n } else {\n hasDeclaration = this.maybeParseExportDeclaration(node);\n }\n if (isFromRequired || hasSpecifiers || hasDeclaration) {\n var _node2$declaration;\n const node2 = node;\n this.checkExport(node2, true, false, !!node2.source);\n if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === \"ClassDeclaration\") {\n this.maybeTakeDecorators(decorators, node2.declaration, node2);\n } else if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, {\n at: node\n });\n }\n return this.finishNode(node2, \"ExportNamedDeclaration\");\n }\n if (this.eat(65)) {\n const node2 = node;\n const decl = this.parseExportDefaultExpression();\n node2.declaration = decl;\n if (decl.type === \"ClassDeclaration\") {\n this.maybeTakeDecorators(decorators, decl, node2);\n } else if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, {\n at: node\n });\n }\n this.checkExport(node2, true, true);\n return this.finishNode(node2, \"ExportDefaultDeclaration\");\n }\n throw this.unexpected(null, 5);\n }\n\n eatExportStar(node) {\n return this.eat(55);\n }\n maybeParseExportDefaultSpecifier(node) {\n if (this.isExportDefaultSpecifier()) {\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = this.parseIdentifier(true);\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n return true;\n }\n return false;\n }\n maybeParseExportNamespaceSpecifier(node) {\n if (this.isContextual(93)) {\n if (!node.specifiers) node.specifiers = [];\n const specifier = this.startNodeAt(this.state.lastTokStartLoc);\n this.next();\n specifier.exported = this.parseModuleExportName();\n node.specifiers.push(this.finishNode(specifier, \"ExportNamespaceSpecifier\"));\n return true;\n }\n return false;\n }\n maybeParseExportNamedSpecifiers(node) {\n if (this.match(5)) {\n if (!node.specifiers) node.specifiers = [];\n const isTypeExport = node.exportKind === \"type\";\n node.specifiers.push(...this.parseExportSpecifiers(isTypeExport));\n node.source = null;\n node.declaration = null;\n if (this.hasPlugin(\"importAssertions\")) {\n node.assertions = [];\n }\n return true;\n }\n return false;\n }\n maybeParseExportDeclaration(node) {\n if (this.shouldParseExportDeclaration()) {\n node.specifiers = [];\n node.source = null;\n if (this.hasPlugin(\"importAssertions\")) {\n node.assertions = [];\n }\n node.declaration = this.parseExportDeclaration(node);\n return true;\n }\n return false;\n }\n isAsyncFunction() {\n if (!this.isContextual(95)) return false;\n const next = this.nextTokenStart();\n return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, \"function\");\n }\n parseExportDefaultExpression() {\n const expr = this.startNode();\n if (this.match(68)) {\n this.next();\n return this.parseFunction(expr, ParseFunctionFlag.Declaration | ParseFunctionFlag.NullableId);\n } else if (this.isAsyncFunction()) {\n this.next();\n this.next();\n return this.parseFunction(expr, ParseFunctionFlag.Declaration | ParseFunctionFlag.NullableId | ParseFunctionFlag.Async);\n }\n if (this.match(80)) {\n return this.parseClass(expr, true, true);\n }\n if (this.match(26)) {\n if (this.hasPlugin(\"decorators\") && this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\")) {\n this.raise(Errors.DecoratorBeforeExport, {\n at: this.state.startLoc\n });\n }\n return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);\n }\n if (this.match(75) || this.match(74) || this.isLet()) {\n throw this.raise(Errors.UnsupportedDefaultExport, {\n at: this.state.startLoc\n });\n }\n const res = this.parseMaybeAssignAllowIn();\n this.semicolon();\n return res;\n }\n\n parseExportDeclaration(\n node) {\n if (this.match(80)) {\n const node = this.parseClass(this.startNode(), true, false);\n return node;\n }\n return this.parseStatementListItem();\n }\n isExportDefaultSpecifier() {\n const {\n type\n } = this.state;\n if (tokenIsIdentifier(type)) {\n if (type === 95 && !this.state.containsEsc || type === 99) {\n return false;\n }\n if ((type === 128 || type === 127) && !this.state.containsEsc) {\n const {\n type: nextType\n } = this.lookahead();\n if (tokenIsIdentifier(nextType) && nextType !== 97 || nextType === 5) {\n this.expectOnePlugin([\"flow\", \"typescript\"]);\n return false;\n }\n }\n } else if (!this.match(65)) {\n return false;\n }\n const next = this.nextTokenStart();\n const hasFrom = this.isUnparsedContextual(next, \"from\");\n if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) {\n return true;\n }\n if (this.match(65) && hasFrom) {\n const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));\n return nextAfterFrom === 34 || nextAfterFrom === 39;\n }\n return false;\n }\n parseExportFrom(node, expect) {\n if (this.eatContextual(97)) {\n node.source = this.parseImportSource();\n this.checkExport(node);\n const assertions = this.maybeParseImportAssertions();\n if (assertions) {\n node.assertions = assertions;\n this.checkJSONModuleImport(node);\n }\n } else if (expect) {\n this.unexpected();\n }\n this.semicolon();\n }\n shouldParseExportDeclaration() {\n const {\n type\n } = this.state;\n if (type === 26) {\n this.expectOnePlugin([\"decorators\", \"decorators-legacy\"]);\n if (this.hasPlugin(\"decorators\")) {\n if (this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\")) {\n throw this.raise(Errors.DecoratorBeforeExport, {\n at: this.state.startLoc\n });\n }\n return true;\n }\n }\n return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction();\n }\n checkExport(node, checkNames, isDefault, isFrom) {\n if (checkNames) {\n if (isDefault) {\n this.checkDuplicateExports(node, \"default\");\n if (this.hasPlugin(\"exportDefaultFrom\")) {\n var _declaration$extra;\n const declaration = node.declaration;\n if (declaration.type === \"Identifier\" && declaration.name === \"from\" && declaration.end - declaration.start === 4 &&\n !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {\n this.raise(Errors.ExportDefaultFromAsIdentifier, {\n at: declaration\n });\n }\n }\n } else if (node.specifiers && node.specifiers.length) {\n for (const specifier of node.specifiers) {\n const {\n exported\n } = specifier;\n const exportName = exported.type === \"Identifier\" ? exported.name : exported.value;\n this.checkDuplicateExports(specifier, exportName);\n if (!isFrom && specifier.local) {\n const {\n local\n } = specifier;\n if (local.type !== \"Identifier\") {\n this.raise(Errors.ExportBindingIsString, {\n at: specifier,\n localName: local.value,\n exportName\n });\n } else {\n this.checkReservedWord(local.name, local.loc.start, true, false);\n this.scope.checkLocalExport(local);\n }\n }\n }\n } else if (node.declaration) {\n if (node.declaration.type === \"FunctionDeclaration\" || node.declaration.type === \"ClassDeclaration\") {\n const id = node.declaration.id;\n if (!id) throw new Error(\"Assertion failure\");\n this.checkDuplicateExports(node, id.name);\n } else if (node.declaration.type === \"VariableDeclaration\") {\n for (const declaration of node.declaration.declarations) {\n this.checkDeclaration(declaration.id);\n }\n }\n }\n }\n }\n checkDeclaration(node) {\n if (node.type === \"Identifier\") {\n this.checkDuplicateExports(node, node.name);\n } else if (node.type === \"ObjectPattern\") {\n for (const prop of node.properties) {\n this.checkDeclaration(prop);\n }\n } else if (node.type === \"ArrayPattern\") {\n for (const elem of node.elements) {\n if (elem) {\n this.checkDeclaration(elem);\n }\n }\n } else if (node.type === \"ObjectProperty\") {\n this.checkDeclaration(node.value);\n } else if (node.type === \"RestElement\") {\n this.checkDeclaration(node.argument);\n } else if (node.type === \"AssignmentPattern\") {\n this.checkDeclaration(node.left);\n }\n }\n checkDuplicateExports(node, exportName) {\n if (this.exportedIdentifiers.has(exportName)) {\n if (exportName === \"default\") {\n this.raise(Errors.DuplicateDefaultExport, {\n at: node\n });\n } else {\n this.raise(Errors.DuplicateExport, {\n at: node,\n exportName\n });\n }\n }\n this.exportedIdentifiers.add(exportName);\n }\n\n parseExportSpecifiers(isInTypeExport) {\n const nodes = [];\n let first = true;\n\n this.expect(5);\n while (!this.eat(8)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n if (this.eat(8)) break;\n }\n const isMaybeTypeOnly = this.isContextual(128);\n const isString = this.match(131);\n const node = this.startNode();\n node.local = this.parseModuleExportName();\n nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));\n }\n return nodes;\n }\n parseExportSpecifier(node, isString,\n isInTypeExport, isMaybeTypeOnly\n ) {\n if (this.eatContextual(93)) {\n node.exported = this.parseModuleExportName();\n } else if (isString) {\n node.exported = cloneStringLiteral(node.local);\n } else if (!node.exported) {\n node.exported = cloneIdentifier(node.local);\n }\n return this.finishNode(node, \"ExportSpecifier\");\n }\n\n parseModuleExportName() {\n if (this.match(131)) {\n const result = this.parseStringLiteral(this.state.value);\n const surrogate = result.value.match(loneSurrogate);\n if (surrogate) {\n this.raise(Errors.ModuleExportNameHasLoneSurrogate, {\n at: result,\n surrogateCharCode: surrogate[0].charCodeAt(0)\n });\n }\n return result;\n }\n return this.parseIdentifier(true);\n }\n isJSONModuleImport(node) {\n if (node.assertions != null) {\n return node.assertions.some(({\n key,\n value\n }) => {\n return value.value === \"json\" && (key.type === \"Identifier\" ? key.name === \"type\" : key.value === \"type\");\n });\n }\n return false;\n }\n checkImportReflection(node) {\n if (node.module) {\n var _node$assertions;\n if (node.specifiers.length !== 1 || node.specifiers[0].type !== \"ImportDefaultSpecifier\") {\n this.raise(Errors.ImportReflectionNotBinding, {\n at: node.specifiers[0].loc.start\n });\n }\n if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) {\n this.raise(Errors.ImportReflectionHasAssertion, {\n at: node.specifiers[0].loc.start\n });\n }\n }\n }\n checkJSONModuleImport(node) {\n if (this.isJSONModuleImport(node) && node.type !== \"ExportAllDeclaration\") {\n const {\n specifiers\n } = node;\n if (specifiers != null) {\n const nonDefaultNamedSpecifier = specifiers.find(specifier => {\n let imported;\n if (specifier.type === \"ExportSpecifier\") {\n imported = specifier.local;\n } else if (specifier.type === \"ImportSpecifier\") {\n imported = specifier.imported;\n }\n if (imported !== undefined) {\n return imported.type === \"Identifier\" ? imported.name !== \"default\" : imported.value !== \"default\";\n }\n });\n if (nonDefaultNamedSpecifier !== undefined) {\n this.raise(Errors.ImportJSONBindingNotDefault, {\n at: nonDefaultNamedSpecifier.loc.start\n });\n }\n }\n }\n }\n parseMaybeImportReflection(node) {\n let isImportReflection = false;\n if (this.isContextual(125)) {\n const lookahead = this.lookahead();\n const nextType = lookahead.type;\n if (tokenIsIdentifier(nextType)) {\n if (nextType !== 97) {\n isImportReflection = true;\n } else {\n const nextNextTokenFirstChar = this.input.charCodeAt(this.nextTokenStartSince(lookahead.end));\n if (nextNextTokenFirstChar === 102) {\n isImportReflection = true;\n }\n }\n } else if (nextType !== 12) {\n isImportReflection = true;\n }\n }\n if (isImportReflection) {\n this.expectPlugin(\"importReflection\");\n this.next();\n node.module = true;\n } else if (this.hasPlugin(\"importReflection\")) {\n node.module = false;\n }\n }\n\n parseImport(node) {\n node.specifiers = [];\n if (!this.match(131)) {\n this.parseMaybeImportReflection(node);\n const hasDefault = this.maybeParseDefaultImportSpecifier(node);\n const parseNext = !hasDefault || this.eat(12);\n const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);\n if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);\n this.expectContextual(97);\n }\n node.source = this.parseImportSource();\n const assertions = this.maybeParseImportAssertions();\n if (assertions) {\n node.assertions = assertions;\n } else {\n const attributes = this.maybeParseModuleAttributes();\n if (attributes) {\n node.attributes = attributes;\n }\n }\n this.checkImportReflection(node);\n this.checkJSONModuleImport(node);\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n parseImportSource() {\n if (!this.match(131)) this.unexpected();\n return this.parseExprAtom();\n }\n\n shouldParseDefaultImport(node) {\n return tokenIsIdentifier(this.state.type);\n }\n parseImportSpecifierLocal(node, specifier, type) {\n specifier.local = this.parseIdentifier();\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n finishImportSpecifier(specifier, type, bindingType = BIND_LEXICAL) {\n this.checkLVal(specifier.local, {\n in: specifier,\n binding: bindingType\n });\n return this.finishNode(specifier, type);\n }\n\n parseAssertEntries() {\n const attrs = [];\n const attrNames = new Set();\n do {\n if (this.match(8)) {\n break;\n }\n const node = this.startNode();\n\n const keyName = this.state.value;\n if (attrNames.has(keyName)) {\n this.raise(Errors.ModuleAttributesWithDuplicateKeys, {\n at: this.state.startLoc,\n key: keyName\n });\n }\n attrNames.add(keyName);\n if (this.match(131)) {\n node.key = this.parseStringLiteral(keyName);\n } else {\n node.key = this.parseIdentifier(true);\n }\n this.expect(14);\n if (!this.match(131)) {\n throw this.raise(Errors.ModuleAttributeInvalidValue, {\n at: this.state.startLoc\n });\n }\n node.value = this.parseStringLiteral(this.state.value);\n attrs.push(this.finishNode(node, \"ImportAttribute\"));\n } while (this.eat(12));\n return attrs;\n }\n\n maybeParseModuleAttributes() {\n if (this.match(76) && !this.hasPrecedingLineBreak()) {\n this.expectPlugin(\"moduleAttributes\");\n this.next();\n } else {\n if (this.hasPlugin(\"moduleAttributes\")) return [];\n return null;\n }\n const attrs = [];\n const attributes = new Set();\n do {\n const node = this.startNode();\n node.key = this.parseIdentifier(true);\n if (node.key.name !== \"type\") {\n this.raise(Errors.ModuleAttributeDifferentFromType, {\n at: node.key\n });\n }\n if (attributes.has(node.key.name)) {\n this.raise(Errors.ModuleAttributesWithDuplicateKeys, {\n at: node.key,\n key: node.key.name\n });\n }\n attributes.add(node.key.name);\n this.expect(14);\n if (!this.match(131)) {\n throw this.raise(Errors.ModuleAttributeInvalidValue, {\n at: this.state.startLoc\n });\n }\n node.value = this.parseStringLiteral(this.state.value);\n this.finishNode(node, \"ImportAttribute\");\n attrs.push(node);\n } while (this.eat(12));\n return attrs;\n }\n maybeParseImportAssertions() {\n if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {\n this.expectPlugin(\"importAssertions\");\n this.next();\n } else {\n if (this.hasPlugin(\"importAssertions\")) return [];\n return null;\n }\n this.eat(5);\n const attrs = this.parseAssertEntries();\n this.eat(8);\n return attrs;\n }\n maybeParseDefaultImportSpecifier(node) {\n if (this.shouldParseDefaultImport(node)) {\n this.parseImportSpecifierLocal(node, this.startNode(), \"ImportDefaultSpecifier\");\n return true;\n }\n return false;\n }\n maybeParseStarImportSpecifier(node) {\n if (this.match(55)) {\n const specifier = this.startNode();\n this.next();\n this.expectContextual(93);\n this.parseImportSpecifierLocal(node, specifier, \"ImportNamespaceSpecifier\");\n return true;\n }\n return false;\n }\n parseNamedImportSpecifiers(node) {\n let first = true;\n this.expect(5);\n while (!this.eat(8)) {\n if (first) {\n first = false;\n } else {\n if (this.eat(14)) {\n throw this.raise(Errors.DestructureNamedImport, {\n at: this.state.startLoc\n });\n }\n this.expect(12);\n if (this.eat(8)) break;\n }\n const specifier = this.startNode();\n const importedIsString = this.match(131);\n const isMaybeTypeOnly = this.isContextual(128);\n specifier.imported = this.parseModuleExportName();\n const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === \"type\" || node.importKind === \"typeof\", isMaybeTypeOnly, undefined);\n node.specifiers.push(importSpecifier);\n }\n }\n\n parseImportSpecifier(specifier, importedIsString,\n isInTypeOnlyImport, isMaybeTypeOnly, bindingType\n ) {\n if (this.eatContextual(93)) {\n specifier.local = this.parseIdentifier();\n } else {\n const {\n imported\n } = specifier;\n if (importedIsString) {\n throw this.raise(Errors.ImportBindingIsString, {\n at: specifier,\n importName: imported.value\n });\n }\n this.checkReservedWord(imported.name, specifier.loc.start, true, true);\n if (!specifier.local) {\n specifier.local = cloneIdentifier(imported);\n }\n }\n return this.finishImportSpecifier(specifier, \"ImportSpecifier\", bindingType);\n }\n\n isThisParam(param) {\n return param.type === \"Identifier\" && param.name === \"this\";\n }\n}\n\nclass Parser extends StatementParser {\n\n constructor(options, input) {\n options = getOptions(options);\n super(options, input);\n this.options = options;\n this.initializeScopes();\n this.plugins = pluginsMap(this.options.plugins);\n this.filename = options.sourceFilename;\n }\n\n getScopeHandler() {\n return ScopeHandler;\n }\n parse() {\n this.enterInitialScopes();\n const file = this.startNode();\n const program = this.startNode();\n this.nextToken();\n file.errors = null;\n this.parseTopLevel(file, program);\n file.errors = this.state.errors;\n return file;\n }\n}\nfunction pluginsMap(plugins) {\n const pluginMap = new Map();\n for (const plugin of plugins) {\n const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];\n if (!pluginMap.has(name)) pluginMap.set(name, options || {});\n }\n return pluginMap;\n}\n\nfunction parse(input, options) {\n var _options;\n if (((_options = options) == null ? void 0 : _options.sourceType) === \"unambiguous\") {\n options = Object.assign({}, options);\n try {\n options.sourceType = \"module\";\n const parser = getParser(options, input);\n const ast = parser.parse();\n if (parser.sawUnambiguousESM) {\n return ast;\n }\n if (parser.ambiguousScriptDifferentAst) {\n try {\n options.sourceType = \"script\";\n return getParser(options, input).parse();\n } catch (_unused) {}\n } else {\n ast.program.sourceType = \"script\";\n }\n return ast;\n } catch (moduleError) {\n try {\n options.sourceType = \"script\";\n return getParser(options, input).parse();\n } catch (_unused2) {}\n throw moduleError;\n }\n } else {\n return getParser(options, input).parse();\n }\n}\nfunction parseExpression(input, options) {\n const parser = getParser(options, input);\n if (parser.options.strictMode) {\n parser.state.strict = true;\n }\n return parser.getExpression();\n}\nfunction generateExportedTokenTypes(internalTokenTypes) {\n const tokenTypes = {};\n for (const typeName of Object.keys(internalTokenTypes)) {\n tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]);\n }\n return tokenTypes;\n}\nconst tokTypes = generateExportedTokenTypes(tt);\nfunction getParser(options, input) {\n let cls = Parser;\n if (options != null && options.plugins) {\n validatePlugins(options.plugins);\n cls = getParserClass(options.plugins);\n }\n return new cls(options, input);\n}\nconst parserClassCache = {};\n\nfunction getParserClass(pluginsFromOptions) {\n const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name));\n const key = pluginList.join(\"/\");\n let cls = parserClassCache[key];\n if (!cls) {\n cls = Parser;\n for (const plugin of pluginList) {\n cls = mixinPlugins[plugin](cls);\n }\n parserClassCache[key] = cls;\n }\n return cls;\n}\n\nexports.parse = parse;\nexports.parseExpression = parseExpression;\nexports.tokTypes = tokTypes;\n//# sourceMappingURL=index.js.map\n","import { parse, parseExpression } from \"@babel/parser\";\nexport function parseAsEstreeExpression(source) {\n return parseExpression(source, {\n plugins: [\"estree\", [\"pipelineOperator\", {\n proposal: \"minimal\"\n }]],\n attachComment: false\n });\n}\nexport function parseAsEstree(source) {\n var {\n typescript\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var file = parse(source, {\n plugins: [\"estree\", typescript && \"typescript\"].filter(Boolean),\n strictMode: true,\n attachComment: false\n });\n var body = file.program.body;\n var jsNodes = typescript ? [] : body;\n if (typescript) {\n for (var node of body) {\n if (node.type.startsWith(\"TS\")) {\n if (/Enum|Import|Export/.test(node.type)) {\n throw new SyntaxError(\"Unsupported TypeScript syntax: \".concat(node.type));\n }\n } else {\n jsNodes.push(node);\n }\n }\n }\n if (jsNodes.length === 0) {\n throw new SyntaxError(\"Function declaration not found\");\n }\n if (jsNodes.length > 1 || jsNodes[0].type !== \"FunctionDeclaration\") {\n throw new SyntaxError(\"Expect a single function declaration at top level, but received: \".concat(jsNodes.map(node => \"\\\"\".concat(node.type, \"\\\"\")).join(\", \")));\n }\n return jsNodes[0];\n}\n/** For next-core internal or devtools usage only. */\nexport function parseForAnalysis(source) {\n var {\n typescript,\n tokens\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n try {\n return parse(source, {\n plugins: [\"estree\", typescript && \"typescript\"].filter(Boolean),\n strictMode: true,\n attachComment: false,\n // Allow export/import declarations to make analyser handle errors.\n sourceType: \"unambiguous\",\n tokens\n });\n } catch (e) {\n // Return no errors if parse failed.\n return null;\n }\n}\n//# sourceMappingURL=parse.js.map","export function hasOwnProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n//# sourceMappingURL=hasOwnProperty.js.map","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n// https://tc39.es/ecma262/#sec-execution-contexts\nexport class AnalysisContext {\n constructor() {\n _defineProperty(this, \"VariableEnvironment\", void 0);\n _defineProperty(this, \"LexicalEnvironment\", void 0);\n }\n}\n\n// https://tc39.es/ecma262/#sec-environment-records\nexport class AnalysisEnvironment {\n constructor(outer) {\n _defineProperty(this, \"OuterEnv\", void 0);\n _defineProperty(this, \"bindingSet\", new Set());\n this.OuterEnv = outer;\n }\n HasBinding(name) {\n return this.bindingSet.has(name);\n }\n CreateBinding(name) {\n this.bindingSet.add(name);\n }\n}\n//# sourceMappingURL=AnalysisContext.js.map","import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport { hasOwnProperty } from \"./hasOwnProperty\";\nimport { AnalysisContext, AnalysisEnvironment } from \"./AnalysisContext\";\nimport { collectBoundNames, collectScopedDeclarations, containsExpression } from \"./traverse\";\n/**\n * Analysis an AST of a storyboard function or an evaluation expression.\n *\n * @param rootAst - The root AST.\n * @param options - Analysis options.\n * @returns A set of global variables the root AST attempts to access.\n */\nexport function precook(rootAst) {\n var {\n expressionOnly,\n visitors,\n withParent,\n hooks = {}\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var attemptToVisitGlobals = new Set();\n var analysisContextStack = [];\n var rootEnv = new AnalysisEnvironment(null);\n var rootContext = new AnalysisContext();\n rootContext.VariableEnvironment = rootEnv;\n rootContext.LexicalEnvironment = rootEnv;\n analysisContextStack.push(rootContext);\n function getRunningContext() {\n return analysisContextStack[analysisContextStack.length - 1];\n }\n function visit(node) {\n if (hasOwnProperty(visitors, node.type)) {\n visitors[node.type](node);\n }\n }\n function EvaluateChildren(node, keys, parent) {\n for (var key of keys) {\n Evaluate(node[key], parent === null || parent === void 0 ? void 0 : parent.concat({\n node,\n key\n }));\n }\n }\n function Evaluate(node, parent) {\n if (Array.isArray(node)) {\n node.forEach((n, index) => {\n Evaluate(n, parent ? parent.slice(0, -1).concat(_objectSpread(_objectSpread({}, parent[parent.length - 1]), {}, {\n index\n })) : parent);\n });\n } else if (node) {\n var _hooks$beforeVisit, _hooks$beforeVisitUnk;\n // `node` maybe `null` in some cases.\n (_hooks$beforeVisit = hooks.beforeVisit) === null || _hooks$beforeVisit === void 0 ? void 0 : _hooks$beforeVisit.call(hooks, node, parent);\n visitors && visit(node);\n // Expressions:\n switch (node.type) {\n case \"Identifier\":\n if (!ResolveBinding(node.name)) {\n var _hooks$beforeVisitGlo;\n (_hooks$beforeVisitGlo = hooks.beforeVisitGlobal) === null || _hooks$beforeVisitGlo === void 0 ? void 0 : _hooks$beforeVisitGlo.call(hooks, node, parent);\n attemptToVisitGlobals.add(node.name);\n }\n return;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n EvaluateChildren(node, [\"elements\"], parent);\n return;\n case \"ArrowFunctionExpression\":\n {\n var env = getRunningContext().LexicalEnvironment;\n var closure = OrdinaryFunctionCreate(node, env);\n CallFunction(closure, parent);\n return;\n }\n case \"AssignmentPattern\":\n case \"BinaryExpression\":\n case \"LogicalExpression\":\n EvaluateChildren(node, [\"left\", \"right\"], parent);\n return;\n case \"CallExpression\":\n case \"NewExpression\":\n EvaluateChildren(node, [\"callee\", \"arguments\"], parent);\n return;\n case \"ChainExpression\":\n EvaluateChildren(node, [\"expression\"], parent);\n return;\n case \"ConditionalExpression\":\n EvaluateChildren(node, [\"test\", \"consequent\", \"alternate\"], parent);\n return;\n case \"MemberExpression\":\n EvaluateChildren(node, [\"object\"], parent);\n if (node.computed) {\n EvaluateChildren(node, [\"property\"], parent);\n }\n return;\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n EvaluateChildren(node, [\"properties\"], parent);\n return;\n case \"Property\":\n if (node.computed) {\n EvaluateChildren(node, [\"key\"], parent);\n }\n EvaluateChildren(node, [\"value\"], parent);\n return;\n case \"RestElement\":\n case \"SpreadElement\":\n case \"UnaryExpression\":\n EvaluateChildren(node, [\"argument\"], parent);\n return;\n case \"SequenceExpression\":\n case \"TemplateLiteral\":\n EvaluateChildren(node, [\"expressions\"], parent);\n return;\n case \"TaggedTemplateExpression\":\n EvaluateChildren(node, [\"tag\", \"quasi\"], parent);\n return;\n case \"Literal\":\n return;\n }\n if (!expressionOnly) {\n // Statements and assignments:\n switch (node.type) {\n case \"AssignmentExpression\":\n EvaluateChildren(node, [\"right\", \"left\"], parent);\n return;\n case \"BlockStatement\":\n {\n if (!node.body.length) {\n return;\n }\n var runningContext = getRunningContext();\n var oldEnv = runningContext.LexicalEnvironment;\n var blockEnv = new AnalysisEnvironment(oldEnv);\n BlockDeclarationInstantiation(node.body, blockEnv);\n runningContext.LexicalEnvironment = blockEnv;\n EvaluateChildren(node, [\"body\"], parent);\n runningContext.LexicalEnvironment = oldEnv;\n return;\n }\n case \"BreakStatement\":\n case \"ContinueStatement\":\n case \"EmptyStatement\":\n return;\n case \"CatchClause\":\n {\n var _runningContext = getRunningContext();\n var _oldEnv = _runningContext.LexicalEnvironment;\n var catchEnv = new AnalysisEnvironment(_oldEnv);\n BoundNamesInstantiation(node.param, catchEnv);\n _runningContext.LexicalEnvironment = catchEnv;\n EvaluateChildren(node, [\"param\", \"body\"], parent);\n _runningContext.LexicalEnvironment = _oldEnv;\n return;\n }\n case \"DoWhileStatement\":\n EvaluateChildren(node, [\"body\", \"test\"], parent);\n return;\n case \"ExpressionStatement\":\n case \"TSAsExpression\":\n EvaluateChildren(node, [\"expression\"], parent);\n return;\n case \"ForInStatement\":\n case \"ForOfStatement\":\n {\n // ForIn/OfHeadEvaluation\n var lexicalBinding = node.left.type === \"VariableDeclaration\" && node.left.kind !== \"var\";\n var _runningContext2 = getRunningContext();\n var _oldEnv2 = _runningContext2.LexicalEnvironment;\n if (lexicalBinding) {\n var newEnv = new AnalysisEnvironment(_oldEnv2);\n BoundNamesInstantiation(node.left, newEnv);\n _runningContext2.LexicalEnvironment = newEnv;\n }\n EvaluateChildren(node, [\"right\"], parent);\n _runningContext2.LexicalEnvironment = _oldEnv2;\n\n // ForIn/OfBodyEvaluation\n if (lexicalBinding) {\n var iterationEnv = new AnalysisEnvironment(_oldEnv2);\n BoundNamesInstantiation(node.left, iterationEnv);\n _runningContext2.LexicalEnvironment = iterationEnv;\n }\n EvaluateChildren(node, [\"left\", \"body\"], parent);\n _runningContext2.LexicalEnvironment = _oldEnv2;\n return;\n }\n case \"ForStatement\":\n {\n var _node$init;\n var _lexicalBinding = ((_node$init = node.init) === null || _node$init === void 0 ? void 0 : _node$init.type) === \"VariableDeclaration\" && node.init.kind !== \"var\";\n var _runningContext3 = getRunningContext();\n var _oldEnv3 = _runningContext3.LexicalEnvironment;\n if (_lexicalBinding) {\n var loopEnv = new AnalysisEnvironment(_oldEnv3);\n BoundNamesInstantiation(node.init, loopEnv);\n _runningContext3.LexicalEnvironment = loopEnv;\n }\n EvaluateChildren(node, [\"init\", \"test\", \"body\", \"update\"], parent);\n _runningContext3.LexicalEnvironment = _oldEnv3;\n return;\n }\n case \"FunctionDeclaration\":\n {\n var [fn] = collectBoundNames(node);\n var _env = getRunningContext().LexicalEnvironment;\n var fo = OrdinaryFunctionCreate(node, _env);\n _env.CreateBinding(fn);\n CallFunction(fo, parent);\n return;\n }\n case \"FunctionExpression\":\n {\n var _closure = InstantiateOrdinaryFunctionExpression(node);\n CallFunction(_closure, parent);\n return;\n }\n case \"IfStatement\":\n EvaluateChildren(node, [\"test\", \"consequent\", \"alternate\"], parent);\n return;\n case \"ReturnStatement\":\n case \"ThrowStatement\":\n case \"UpdateExpression\":\n EvaluateChildren(node, [\"argument\"], parent);\n return;\n case \"SwitchCase\":\n EvaluateChildren(node, [\"test\", \"consequent\"], parent);\n return;\n case \"SwitchStatement\":\n {\n EvaluateChildren(node, [\"discriminant\"], parent);\n var _runningContext4 = getRunningContext();\n var _oldEnv4 = _runningContext4.LexicalEnvironment;\n var _blockEnv = new AnalysisEnvironment(_oldEnv4);\n BlockDeclarationInstantiation(node.cases, _blockEnv);\n _runningContext4.LexicalEnvironment = _blockEnv;\n EvaluateChildren(node, [\"cases\"], parent);\n _runningContext4.LexicalEnvironment = _oldEnv4;\n return;\n }\n case \"TryStatement\":\n EvaluateChildren(node, [\"block\", \"handler\", \"finalizer\"], parent);\n return;\n case \"VariableDeclaration\":\n EvaluateChildren(node, [\"declarations\"], parent);\n return;\n case \"VariableDeclarator\":\n EvaluateChildren(node, [\"id\", \"init\"], parent);\n return;\n case \"WhileStatement\":\n EvaluateChildren(node, [\"test\", \"body\"], parent);\n return;\n }\n }\n var silent = (_hooks$beforeVisitUnk = hooks.beforeVisitUnknown) === null || _hooks$beforeVisitUnk === void 0 ? void 0 : _hooks$beforeVisitUnk.call(hooks, node, parent);\n if (!silent) {\n // eslint-disable-next-line no-console\n console.warn(\"Unsupported node type `\".concat(node.type, \"`\"));\n }\n }\n }\n function BoundNamesInstantiation(declarations, env) {\n for (var name of collectBoundNames(declarations)) {\n env.CreateBinding(name);\n }\n }\n function ResolveBinding(name) {\n var env = getRunningContext().LexicalEnvironment;\n return GetIdentifierReference(env, name);\n }\n function GetIdentifierReference(env, name) {\n return !!env && (env.HasBinding(name) || GetIdentifierReference(env.OuterEnv, name));\n }\n function BlockDeclarationInstantiation(code, env) {\n var declarations = collectScopedDeclarations(code, {\n var: false,\n topLevel: false\n });\n BoundNamesInstantiation(declarations, env);\n }\n function CallFunction(closure, parent) {\n PrepareOrdinaryCall(closure);\n FunctionDeclarationInstantiation(closure, parent);\n Evaluate(closure.ECMAScriptCode, parent === null || parent === void 0 ? void 0 : parent.concat({\n node: closure.Function,\n key: \"body\"\n }).concat(closure.Function.body.type === \"BlockStatement\" ? {\n node: closure.Function.body,\n key: \"body\"\n } : []));\n analysisContextStack.pop();\n }\n function PrepareOrdinaryCall(F) {\n var calleeContext = new AnalysisContext();\n var localEnv = new AnalysisEnvironment(F.Environment);\n calleeContext.VariableEnvironment = localEnv;\n calleeContext.LexicalEnvironment = localEnv;\n analysisContextStack.push(calleeContext);\n }\n function FunctionDeclarationInstantiation(func, parent) {\n var calleeContext = getRunningContext();\n var code = func.ECMAScriptCode;\n var formals = func.FormalParameters;\n var hasParameterExpressions = containsExpression(formals);\n var varDeclarations = collectScopedDeclarations(code, {\n var: true,\n topLevel: true\n });\n var varNames = collectBoundNames(varDeclarations);\n var env = calleeContext.LexicalEnvironment;\n BoundNamesInstantiation(formals, env);\n Evaluate(formals, parent === null || parent === void 0 ? void 0 : parent.concat({\n node: func.Function,\n key: \"params\"\n }));\n var varEnv;\n if (!hasParameterExpressions) {\n // NOTE: Only a single Environment Record is needed for the parameters\n // and top-level vars.\n for (var n of varNames) {\n env.CreateBinding(n);\n }\n varEnv = env;\n } else {\n // NOTE: A separate Environment Record is needed to ensure that closures\n // created by expressions in the formal parameter list do not have\n // visibility of declarations in the function body.\n varEnv = new AnalysisEnvironment(env);\n calleeContext.VariableEnvironment = varEnv;\n for (var _n of varNames) {\n varEnv.CreateBinding(_n);\n }\n }\n var lexEnv = varEnv;\n calleeContext.LexicalEnvironment = lexEnv;\n var lexDeclarations = collectScopedDeclarations(code, {\n var: false,\n topLevel: true\n });\n BoundNamesInstantiation(lexDeclarations, lexEnv);\n }\n function InstantiateOrdinaryFunctionExpression(functionExpression) {\n var scope = getRunningContext().LexicalEnvironment;\n if (!functionExpression.id) {\n return OrdinaryFunctionCreate(functionExpression, scope);\n }\n var name = functionExpression.id.name;\n var funcEnv = new AnalysisEnvironment(scope);\n funcEnv.CreateBinding(name);\n return OrdinaryFunctionCreate(functionExpression, funcEnv);\n }\n function OrdinaryFunctionCreate(func, scope) {\n return {\n Function: func,\n FormalParameters: func.params,\n ECMAScriptCode: func.body.type === \"BlockStatement\" ? func.body.body : func.body,\n Environment: scope\n };\n }\n Evaluate(rootAst, withParent ? [] : undefined);\n return attemptToVisitGlobals;\n}\n//# sourceMappingURL=precook.js.map","import { parseForAnalysis } from \"./parse\";\nimport { precook } from \"./precook\";\n/** For next-core internal or devtools usage only. */\nexport function lint(source) {\n var {\n typescript,\n rules\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var errors = [];\n var file = typeof source === \"string\" ? parseForAnalysis(source, {\n typescript\n }) : source;\n if (!file) {\n // Return no errors if parse failed.\n return errors;\n }\n var body = file.program.body;\n var jsNodes = typescript ? [] : body;\n if (typescript) {\n for (var node of body) {\n if (node.type.startsWith(\"TS\")) {\n if (/Enum|Import|Export/.test(node.type)) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Unsupported TypeScript syntax: `\".concat(node.type, \"`\"),\n loc: node.loc\n });\n }\n } else {\n jsNodes.push(node);\n }\n }\n }\n var func;\n for (var _node of jsNodes) {\n var isFunctionDeclaration = _node.type === \"FunctionDeclaration\";\n if (isFunctionDeclaration && !func) {\n func = _node;\n } else {\n errors.push({\n type: \"SyntaxError\",\n message: isFunctionDeclaration ? \"Expect a single function declaration\" : \"`\".concat(_node.type, \"` is not allowed in top level\"),\n loc: _node.loc\n });\n }\n }\n if (!func) {\n errors.unshift({\n type: \"SyntaxError\",\n message: \"Function declaration not found\",\n loc: {\n start: {\n line: 1,\n column: 0\n },\n end: {\n line: 1,\n column: 0\n }\n }\n });\n } else {\n precook(func, {\n hooks: {\n beforeVisit(node) {\n switch (node.type) {\n case \"ArrowFunctionExpression\":\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n if (node.async || node.generator) {\n errors.push({\n type: \"SyntaxError\",\n message: \"\".concat(node.async ? \"Async\" : \"Generator\", \" function is not allowed\"),\n loc: node.loc\n });\n }\n break;\n case \"Literal\":\n if (node.regex) {\n if (node.value === null) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Invalid regular expression\",\n loc: node.loc\n });\n } else if (node.regex.flags.includes(\"u\")) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Unsupported unicode flag in regular expression\",\n loc: node.loc\n });\n }\n }\n break;\n case \"ObjectExpression\":\n for (var prop of node.properties) {\n if (prop.type === \"Property\") {\n if (prop.kind !== \"init\") {\n errors.push({\n type: \"SyntaxError\",\n message: \"Unsupported object getter/setter property\",\n loc: prop.loc\n });\n } else if (!prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"__proto__\") {\n errors.push({\n type: \"TypeError\",\n message: \"Setting '__proto__' property is not allowed\",\n loc: prop.key.loc\n });\n }\n }\n }\n break;\n case \"VariableDeclaration\":\n if (node.kind === \"var\" && rules !== null && rules !== void 0 && rules.noVar) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Var declaration is not recommended, use `let` or `const` instead\",\n loc: {\n start: node.loc.start,\n end: {\n line: node.loc.start.line,\n // Only decorate the \"var\".\n column: node.loc.start.column + 3\n }\n }\n });\n }\n break;\n }\n },\n beforeVisitGlobal(node) {\n if (node.name === \"arguments\") {\n errors.push({\n type: \"SyntaxError\",\n message: \"Use the rest parameters instead of 'arguments'\",\n loc: node.loc\n });\n }\n },\n beforeVisitUnknown(node) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Unsupported syntax: `\".concat(node.type, \"`\"),\n loc: node.loc\n });\n return true;\n }\n }\n });\n }\n return errors;\n}\n//# sourceMappingURL=lint.js.map","import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"typescript\"];\nimport { parseAsEstree } from \"./parse\";\nimport { precook } from \"./precook\";\nexport function precookFunction(source) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n {\n typescript\n } = _ref,\n restOptions = _objectWithoutProperties(_ref, _excluded);\n var func = parseAsEstree(source, {\n typescript\n });\n var attemptToVisitGlobals = precook(func, restOptions);\n return {\n function: func,\n attemptToVisitGlobals\n };\n}\n//# sourceMappingURL=precookFunction.js.map","import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport { parseAsEstreeExpression } from \"./parse\";\nimport { precook } from \"./precook\";\n// `raw` should always be asserted by `isEvaluable`.\nexport function preevaluate(raw, options) {\n var fixes = [];\n var source = raw.replace(/^\\s*<%~?\\s|\\s%>\\s*$/g, m => {\n fixes.push(m);\n return \"\";\n });\n var expression = parseAsEstreeExpression(source);\n var attemptToVisitGlobals = precook(expression, _objectSpread(_objectSpread({}, options), {}, {\n expressionOnly: true\n }));\n return {\n expression,\n attemptToVisitGlobals,\n source,\n prefix: fixes[0],\n suffix: fixes[1]\n };\n}\nexport function isEvaluable(raw) {\n return /^\\s*<%~?\\s/.test(raw) && /\\s%>\\s*$/.test(raw);\n}\nexport function shouldAllowRecursiveEvaluations(raw) {\n return /^\\s*<%~\\s/.test(raw);\n}\n//# sourceMappingURL=preevaluate.js.map","// istanbul ignore file\nexport * from \"@next-core/cook\";\n\n/** @deprecated */\nexport const PrecookVisitor = new Proxy(Object.freeze({}), {\n get() {\n return noop;\n },\n});\n\n/** @deprecated */\nexport const PrecookFunctionVisitor = new Proxy(Object.freeze({}), {\n get() {\n return noop;\n },\n});\n\nfunction noop(): void {\n /* noop */\n}\n","// Ref https://github.com/lodash/lodash/blob/4.17.11/lodash.js#L11744\nexport function isObject(value: unknown): value is Record<string, any> {\n const type = typeof value;\n return value != null && (type == \"object\" || type == \"function\");\n}\n","import { StoryboardFunction } from \"@next-core/brick-types\";\nimport {\n precookFunction,\n PrecookHooks,\n isEvaluable,\n preevaluate,\n} from \"./cook\";\nimport { isObject } from \"./isObject\";\n\nexport function visitStoryboardFunctions(\n functions: StoryboardFunction[],\n beforeVisitGlobal: PrecookHooks[\"beforeVisitGlobal\"]\n): void {\n if (Array.isArray(functions)) {\n for (const fn of functions) {\n try {\n precookFunction(fn.source, {\n typescript: fn.typescript,\n withParent: true,\n hooks: { beforeVisitGlobal },\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(`Parse storyboard function \"${fn.name}\" failed:`, error);\n }\n }\n }\n}\n\ninterface VisitStoryboardExpressionsOptions {\n matchExpressionString: (v: string) => boolean;\n visitNonExpressionString?: (v: string) => unknown;\n visitObject?: (v: unknown[] | Record<string, unknown>) => unknown;\n}\n\nexport function visitStoryboardExpressions(\n data: unknown,\n beforeVisitGlobal: PrecookHooks[\"beforeVisitGlobal\"],\n // If `options` is a string, it means the *keyword*.\n options: string | VisitStoryboardExpressionsOptions\n): void {\n const memo = new WeakSet();\n const { matchExpressionString, visitNonExpressionString, visitObject } =\n typeof options === \"string\"\n ? ({\n matchExpressionString: (v: string) => v.includes(options),\n } as VisitStoryboardExpressionsOptions)\n : options;\n function visit(value: unknown): void {\n if (typeof value === \"string\") {\n if (matchExpressionString(value) && isEvaluable(value)) {\n try {\n preevaluate(value, {\n withParent: true,\n hooks: { beforeVisitGlobal },\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else {\n visitNonExpressionString?.(value);\n }\n } else if (isObject(value)) {\n // Avoid call stack overflow.\n if (memo.has(value)) {\n return;\n }\n memo.add(value);\n visitObject?.(value);\n for (const item of Array.isArray(value) ? value : Object.values(value)) {\n visit(item);\n }\n }\n }\n visit(data);\n}\n","import { uniq } from \"lodash\";\nimport { Storyboard } from \"@next-core/brick-types\";\nimport { PrecookHooks } from \"./cook\";\nimport { visitStoryboardExpressions } from \"./visitStoryboard\";\n\nconst PROCESSORS = \"PROCESSORS\";\n\nexport function scanProcessorsInStoryboard(\n storyboard: Storyboard,\n isUniq = true\n): string[] {\n return scanProcessorsInAny(\n [storyboard.routes, storyboard.meta?.customTemplates],\n isUniq\n );\n}\n\nexport function scanProcessorsInAny(data: unknown, isUniq = true): string[] {\n const collection: string[] = [];\n visitStoryboardExpressions(\n data,\n beforeVisitProcessorsFactory(collection),\n PROCESSORS\n );\n return isUniq ? uniq(collection) : collection;\n}\n\nfunction beforeVisitProcessorsFactory(\n collection: string[]\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitProcessors(node, parent): void {\n if (node.name === PROCESSORS) {\n const memberParent = parent[parent.length - 1];\n const outerMemberParent = parent[parent.length - 2];\n if (\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\" &&\n !memberParent.node.computed &&\n memberParent.node.property.type === \"Identifier\" &&\n outerMemberParent?.node.type === \"MemberExpression\" &&\n outerMemberParent.key === \"object\" &&\n !outerMemberParent.node.computed &&\n outerMemberParent.node.property.type === \"Identifier\"\n ) {\n collection.push(\n `${memberParent.node.property.name}.${outerMemberParent.node.property.name}`\n );\n }\n }\n };\n}\n","import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\n/** Parse storyboard as AST. */\nexport function parseStoryboard(storyboard) {\n var _storyboard$meta;\n return {\n type: \"Root\",\n raw: storyboard,\n routes: parseRoutes(storyboard.routes),\n templates: parseTemplates((_storyboard$meta = storyboard.meta) === null || _storyboard$meta === void 0 ? void 0 : _storyboard$meta.customTemplates)\n };\n}\n/** Parse storyboard routes as AST. */\nexport function parseRoutes(routes, options) {\n if (Array.isArray(routes)) {\n return routes.map(route => _objectSpread(_objectSpread({\n type: \"Route\",\n raw: route\n }, options !== null && options !== void 0 && options.routesOnly ? null : {\n context: parseContext(route.context),\n redirect: parseResolvable(route.redirect),\n menu: parseMenu(route.menu),\n providers: parseRouteProviders(route.providers),\n defineResolves: Array.isArray(route.defineResolves) ? route.defineResolves.map(item => parseResolvable(item)).filter(Boolean) : undefined\n }), {}, {\n children: route.type === \"routes\" ? parseRoutes(route.routes, options) : parseBricks(route.bricks, options)\n }));\n }\n return [];\n}\n\n/** Parse storyboard templates as AST. */\nexport function parseTemplates(templates) {\n if (Array.isArray(templates)) {\n return templates.map(parseTemplate);\n }\n return [];\n}\n\n/** Parse a storyboard template as AST. */\nexport function parseTemplate(tpl) {\n return {\n type: \"Template\",\n raw: tpl,\n bricks: parseBricks(tpl.bricks),\n context: parseContext(tpl.state)\n };\n}\nfunction parseBricks(bricks, options) {\n if (Array.isArray(bricks)) {\n return bricks.map(brick => parseBrick(brick, options));\n }\n return [];\n}\n\n/** Parse a storyboard brick as AST. */\nexport function parseBrick(brick, options) {\n return _objectSpread(_objectSpread({\n type: \"Brick\",\n raw: brick,\n isUseBrick: options === null || options === void 0 ? void 0 : options.isUseBrick\n }, options !== null && options !== void 0 && options.routesOnly ? null : _objectSpread(_objectSpread({\n if: parseCondition(brick.if),\n events: parseEvents(brick.events),\n lifeCycle: parseLifeCycles(brick.lifeCycle)\n }, parseBrickProperties(brick.properties)), {}, {\n context: parseContext(brick.context)\n })), {}, {\n children: parseSlots(brick.slots, options)\n });\n}\nfunction parseCondition(condition) {\n if (isObject(condition)) {\n return {\n type: \"ResolvableCondition\",\n resolve: parseResolvable(condition)\n };\n }\n return {\n type: \"LiteralCondition\"\n };\n}\nfunction parseBrickProperties(props) {\n var useBrick = [];\n var useBackend = [];\n function walkBrickProperties(value) {\n if (Array.isArray(value)) {\n for (var item of value) {\n walkBrickProperties(item);\n }\n } else if (isObject(value)) {\n if (value.useBrick || value.useBackend) {\n var _value$useBackend;\n if (value.useBrick) {\n useBrick.push({\n type: \"UseBrickEntry\",\n rawContainer: value,\n rawKey: \"useBrick\",\n children: parseBricks([].concat(value.useBrick), {\n isUseBrick: true\n })\n });\n }\n var provider = (_value$useBackend = value.useBackend) === null || _value$useBackend === void 0 ? void 0 : _value$useBackend.provider;\n if (typeof provider === \"string\") {\n useBackend.push({\n type: \"UseBackendEntry\",\n rawContainer: value,\n rawKey: \"useBackend\",\n children: [parseBrick({\n brick: provider\n })]\n });\n }\n } else {\n for (var _item of Object.values(value)) {\n walkBrickProperties(_item);\n }\n }\n }\n }\n walkBrickProperties(props);\n return {\n useBrick,\n useBackend\n };\n}\nfunction parseLifeCycles(lifeCycle) {\n if (isObject(lifeCycle)) {\n return Object.entries(lifeCycle).map(_ref => {\n var [name, conf] = _ref;\n switch (name) {\n case \"useResolves\":\n return {\n type: \"ResolveLifeCycle\",\n rawContainer: lifeCycle,\n rawKey: name,\n resolves: Array.isArray(conf) ? conf.map(item => parseResolvable(item, true)).filter(Boolean) : undefined\n };\n case \"onPageLoad\":\n case \"onPageLeave\":\n case \"onAnchorLoad\":\n case \"onAnchorUnload\":\n case \"onMessageClose\":\n case \"onBeforePageLoad\":\n case \"onBeforePageLeave\":\n case \"onMount\":\n case \"onUnmount\":\n case \"onMediaChange\":\n return {\n type: \"SimpleLifeCycle\",\n name,\n rawContainer: lifeCycle,\n rawKey: name,\n handlers: parseEventHandlers(conf)\n };\n case \"onMessage\":\n case \"onScrollIntoView\":\n return {\n type: \"ConditionalLifeCycle\",\n name,\n events: [].concat(conf).filter(Boolean).map(item => ({\n type: \"ConditionalEvent\",\n rawContainer: item,\n rawKey: \"handlers\",\n handlers: parseEventHandlers(item.handlers)\n }))\n };\n default:\n return {\n type: \"UnknownLifeCycle\"\n };\n }\n });\n }\n}\nfunction parseSlots(slots, options) {\n if (isObject(slots)) {\n return Object.entries(slots).map(_ref2 => {\n var [slot, conf] = _ref2;\n return {\n type: \"Slot\",\n raw: conf,\n slot,\n childrenType: conf.type === \"routes\" ? \"Route\" : \"Brick\",\n children: conf.type === \"routes\" ? parseRoutes(conf.routes, options) : parseBricks(conf.bricks, options)\n };\n });\n }\n return [];\n}\nfunction parseEvents(events) {\n if (isObject(events)) {\n return Object.entries(events).map(_ref3 => {\n var [eventType, handlers] = _ref3;\n return {\n type: \"Event\",\n rawContainer: events,\n rawKey: eventType,\n handlers: parseEventHandlers(handlers)\n };\n });\n }\n}\nfunction parseContext(contexts) {\n if (Array.isArray(contexts)) {\n return contexts.map(context => ({\n type: \"Context\",\n raw: context,\n resolve: parseResolvable(context.resolve),\n onChange: parseEventHandlers(context.onChange)\n }));\n }\n}\nfunction parseMenu(menu) {\n if (menu === false) {\n return {\n type: \"FalseMenu\"\n };\n }\n if (!menu) {\n return;\n }\n switch (menu.type) {\n case \"brick\":\n return {\n type: \"BrickMenu\",\n raw: menu,\n brick: parseBrick(menu)\n };\n case \"resolve\":\n return {\n type: \"ResolvableMenu\",\n resolve: parseResolvable(menu.resolve)\n };\n default:\n return {\n type: \"StaticMenu\"\n };\n }\n}\nfunction parseResolvable(resolve, isConditional) {\n if (isObject(resolve)) {\n return {\n type: \"Resolvable\",\n raw: resolve,\n isConditional\n };\n }\n}\nfunction parseEventHandlers(handlers) {\n return [].concat(handlers).filter(Boolean).map(handler => ({\n type: \"EventHandler\",\n callback: parseEventCallback(handler.callback),\n raw: handler\n }));\n}\nfunction parseEventCallback(callback) {\n if (isObject(callback)) {\n return Object.entries(callback).map(_ref4 => {\n var [callbackType, handlers] = _ref4;\n return {\n type: \"EventCallback\",\n rawContainer: callback,\n rawKey: callbackType,\n handlers: parseEventHandlers(handlers)\n };\n });\n }\n}\nfunction parseRouteProviders(providers) {\n if (Array.isArray(providers)) {\n return providers.map(provider => parseBrick(typeof provider === \"string\" ? {\n brick: provider\n } : provider));\n }\n}\n\n// Ref https://github.com/lodash/lodash/blob/4.17.11/lodash.js#L11744\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == \"object\" || type == \"function\");\n}\n//# sourceMappingURL=parseStoryboard.js.map","/** Traverse a storyboard AST. */\nexport function traverseStoryboard(ast, callback) {\n traverseNode(ast, callback, []);\n}\n\n/** Traverse any node(s) in storyboard AST. */\nexport function traverse(nodeOrNodes, callback) {\n if (Array.isArray(nodeOrNodes)) {\n traverseNodes(nodeOrNodes, callback, []);\n } else {\n traverseNode(nodeOrNodes, callback, []);\n }\n}\nfunction traverseNodes(nodes, callback, path) {\n if (!nodes) {\n return;\n }\n for (var _node of nodes) {\n traverseNode(_node, callback, path);\n }\n}\nfunction traverseNode(node, callback, path) {\n if (!node) {\n return;\n }\n callback(node, path);\n var childPath = path.concat(node);\n switch (node.type) {\n case \"Root\":\n traverseNodes(node.routes, callback, childPath);\n traverseNodes(node.templates, callback, childPath);\n break;\n case \"Route\":\n traverseNodes(node.context, callback, childPath);\n traverseNode(node.redirect, callback, childPath);\n traverseNode(node.menu, callback, childPath);\n traverseNodes(node.providers, callback, childPath);\n traverseNodes(node.defineResolves, callback, childPath);\n traverseNodes(node.children, callback, childPath);\n break;\n case \"Template\":\n traverseNodes(node.bricks, callback, childPath);\n traverseNodes(node.context, callback, childPath);\n break;\n case \"Brick\":\n traverseNode(node.if, callback, childPath);\n traverseNodes(node.events, callback, childPath);\n traverseNodes(node.lifeCycle, callback, childPath);\n traverseNodes(node.useBrick, callback, childPath);\n traverseNodes(node.useBackend, callback, childPath);\n traverseNodes(node.context, callback, childPath);\n traverseNodes(node.children, callback, childPath);\n break;\n case \"Slot\":\n case \"UseBrickEntry\":\n case \"UseBackendEntry\":\n traverseNodes(node.children, callback, childPath);\n break;\n case \"Context\":\n traverseNode(node.resolve, callback, childPath);\n traverseNodes(node.onChange, callback, childPath);\n break;\n case \"ResolvableCondition\":\n case \"ResolvableMenu\":\n traverseNode(node.resolve, callback, childPath);\n break;\n case \"ResolveLifeCycle\":\n traverseNodes(node.resolves, callback, childPath);\n break;\n case \"Event\":\n case \"EventCallback\":\n case \"SimpleLifeCycle\":\n case \"ConditionalEvent\":\n traverseNodes(node.handlers, callback, childPath);\n break;\n case \"EventHandler\":\n traverseNodes(node.callback, callback, childPath);\n break;\n case \"ConditionalLifeCycle\":\n traverseNodes(node.events, callback, childPath);\n break;\n case \"BrickMenu\":\n traverseNode(node.brick, callback, childPath);\n break;\n case \"Resolvable\":\n case \"FalseMenu\":\n case \"StaticMenu\":\n case \"UnknownLifeCycle\":\n case \"LiteralCondition\":\n break;\n default:\n // istanbul ignore if\n if (process.env.NODE_ENV === \"development\") {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n throw new Error(\"Unhandled storyboard node type: \".concat(node.type));\n }\n }\n}\n//# sourceMappingURL=traverseStoryboard.js.map","import type {\n Storyboard,\n BrickConf,\n CustomTemplate,\n UseProviderResolveConf,\n UseProviderEventHandler,\n} from \"@next-core/brick-types\";\nimport { isObject } from \"./isObject\";\nimport {\n type StoryboardNode,\n parseBrick,\n parseStoryboard,\n parseTemplates,\n traverse,\n} from \"@next-core/storyboard\";\nimport { StoryboardNodeRoot } from \".\";\n\nexport interface ScanBricksOptions {\n keepDuplicates?: boolean;\n ignoreBricksInUnusedCustomTemplates?: boolean;\n}\n\n/**\n * Scan bricks and custom apis in storyboard.\n *\n * @param storyboard - Storyboard.\n * @param options - If options is a boolean, it means `isUniq` or `de-duplicate`.\n */\nexport function scanStoryboard(\n storyboard: Storyboard,\n options: boolean | ScanBricksOptions = true\n): ReturnType<typeof scanStoryboardAst> {\n const ast = parseStoryboard(storyboard);\n return scanStoryboardAst(ast, options);\n}\n\n/**\n * Scan bricks and custom apis in storyboard.\n *\n * @param storyboard - Storyboard.\n * @param options - If options is a boolean, it means `isUniq` or `de-duplicate`.\n */\nexport function scanStoryboardAst(\n ast: StoryboardNodeRoot,\n options: boolean | ScanBricksOptions = true\n): { bricks: string[]; customApis: string[]; usedTemplates: string[] } {\n const { keepDuplicates, ignoreBricksInUnusedCustomTemplates } = isObject(\n options\n )\n ? options\n : ({\n keepDuplicates: !options,\n } as ScanBricksOptions);\n\n const selfDefined = new Set<string>([\"form-renderer.form-renderer\"]);\n let collection: Set<string> | string[];\n\n if (ignoreBricksInUnusedCustomTemplates) {\n collection = collect(ast.routes, keepDuplicates);\n if (Array.isArray(ast.templates)) {\n const tplMap = new Map<string, StoryboardNode>();\n for (const tpl of ast.templates) {\n tplMap.set((tpl.raw as CustomTemplate).name, tpl);\n }\n for (const item of collection) {\n const tpl = tplMap.get(item);\n if (tpl && !selfDefined.has(item)) {\n selfDefined.add(item);\n const collectionByTpl = collect(tpl);\n if (keepDuplicates) {\n (collection as string[]).push(item);\n (collection as string[]).push(...collectionByTpl);\n } else {\n (collection as Set<string>).add(item);\n for (const i of collectionByTpl) {\n (collection as Set<string>).add(i);\n }\n }\n }\n }\n }\n } else {\n collection = collect(ast, keepDuplicates, selfDefined);\n }\n\n if (keepDuplicates) {\n const bricks: string[] = [];\n const customApis: string[] = [];\n const usedTemplates: string[] = [];\n for (const item of collection) {\n if (item.includes(\"@\")) {\n customApis.push(item);\n } else {\n if (item.includes(\"-\")) {\n (selfDefined.has(item) ? usedTemplates : bricks).push(item);\n }\n }\n }\n return { bricks, customApis, usedTemplates };\n } else {\n const bricks = new Set<string>();\n const customApis = new Set<string>();\n const usedTemplates = new Set<string>();\n for (const item of collection) {\n if (item.includes(\"@\")) {\n customApis.add(item);\n } else {\n if (item.includes(\"-\")) {\n (selfDefined.has(item) ? usedTemplates : bricks).add(item);\n }\n }\n }\n return {\n bricks: [...bricks],\n customApis: [...customApis],\n usedTemplates: [...usedTemplates],\n };\n }\n}\n\nfunction collect(\n nodeOrNodes: StoryboardNode | StoryboardNode[],\n keepDuplicates?: boolean,\n definedTemplates?: Set<string>\n): Set<string> | string[] {\n let collection: Set<string> | string[];\n let add: (item: string) => void;\n if (keepDuplicates) {\n collection = [];\n add = (item) => {\n (collection as string[]).push(item);\n };\n } else {\n collection = new Set();\n add = (item) => {\n (collection as Set<string>).add(item);\n };\n }\n\n traverse(nodeOrNodes, (node) => {\n switch (node.type) {\n case \"Brick\":\n if (node.raw.brick) {\n add(node.raw.brick);\n }\n break;\n case \"Resolvable\": {\n const useProvider = (node.raw as UseProviderResolveConf)?.useProvider;\n if (useProvider) {\n add(useProvider);\n }\n break;\n }\n case \"EventHandler\": {\n const useProvider = (node.raw as UseProviderEventHandler)?.useProvider;\n if (useProvider) {\n add(useProvider);\n }\n break;\n }\n case \"Template\":\n definedTemplates?.add((node.raw as CustomTemplate).name);\n break;\n }\n });\n\n return collection;\n}\n\nexport function collectBricksInBrickConf(brickConf: BrickConf): string[] {\n const node = parseBrick(brickConf);\n return [...collect(node)];\n}\n\nexport function collectBricksByCustomTemplates(\n customTemplates: CustomTemplate[]\n): Map<string, string[]> {\n const collectionByTpl = new Map<string, string[]>();\n const templates = parseTemplates(customTemplates);\n for (const tpl of templates) {\n const collection = collect(tpl, false);\n collectionByTpl.set((tpl.raw as CustomTemplate).name, [...collection]);\n }\n return collectionByTpl;\n}\n","import { Storyboard, BrickPackage } from \"@next-core/brick-types\";\nimport { isEmpty } from \"lodash\";\nimport * as changeCase from \"change-case\";\nimport { scanProcessorsInAny } from \"./scanProcessorsInStoryboard\";\nimport { scanStoryboard, ScanBricksOptions } from \"./scanStoryboard\";\n\ninterface DllAndDeps {\n dll: string[];\n deps: string[];\n}\n\ninterface DllAndDepsAndBricks extends DllAndDeps {\n bricks: string[];\n}\n\nexport function getDllAndDepsOfStoryboard(\n storyboard: Storyboard,\n brickPackages: BrickPackage[],\n options?: ScanBricksOptions\n): DllAndDepsAndBricks {\n const { bricks, usedTemplates } = scanStoryboard(storyboard, options);\n const customTemplates = storyboard.meta?.customTemplates;\n return {\n ...getDllAndDepsByResource(\n {\n bricks,\n processors: scanProcessorsInAny([\n storyboard.routes,\n options?.ignoreBricksInUnusedCustomTemplates\n ? customTemplates?.filter((tpl) => usedTemplates.includes(tpl.name))\n : customTemplates,\n ]),\n },\n brickPackages\n ),\n bricks,\n };\n}\n\nfunction getBrickToPackageMap(\n brickPackages: BrickPackage[]\n): Map<string, BrickPackage> {\n if (isEmpty(brickPackages)) {\n return new Map();\n }\n\n return brickPackages.reduce((m, item) => {\n if (/^bricks\\/.*\\/dist\\/.*\\.js$/.test(item.filePath)) {\n const namespace = item.filePath.split(\"/\")[1];\n m.set(namespace, item);\n } else {\n // eslint-disable-next-line no-console\n console.error(`Unexpected brick package file path: \"${item.filePath}\"`);\n }\n\n return m;\n }, new Map());\n}\n\nexport function getDllAndDepsOfBricks(\n bricks: string[],\n brickPackages: BrickPackage[]\n): DllAndDeps {\n const dll = new Set<string>();\n const deps = new Set<string>();\n if (bricks.length > 0) {\n const brickMap = getBrickToPackageMap(brickPackages);\n bricks.forEach((brick) => {\n // ignore custom template\n // istanbul ignore else\n if (brick.includes(\".\")) {\n const namespace = brick.split(\".\")[0];\n const find = brickMap.get(namespace);\n if (find) {\n deps.add(find.filePath);\n if (find.dll) {\n for (const dllName of find.dll) {\n dll.add(dllName);\n }\n }\n } else {\n // eslint-disable-next-line no-console\n console.error(`Brick \\`${brick}\\` does not match any brick package`);\n }\n }\n });\n }\n const dllPath = window.DLL_PATH;\n return {\n dll: Array.from(dll).map((dllName) => dllPath[dllName]),\n deps: Array.from(deps),\n };\n}\n\ninterface StoryboardResource {\n bricks?: string[];\n processors?: string[];\n editorBricks?: string[];\n}\n\nexport function getDllAndDepsByResource(\n { bricks, processors, editorBricks }: StoryboardResource,\n brickPackages: BrickPackage[]\n): DllAndDeps {\n const dll = new Set<string>();\n const deps = new Set<string>();\n\n if (\n bricks?.length > 0 ||\n processors?.length > 0 ||\n editorBricks?.length > 0\n ) {\n const brickMap = getBrickToPackageMap(brickPackages);\n\n [...(bricks ?? []), ...(processors ?? [])].forEach((name) => {\n // ignore custom template\n // istanbul ignore else\n if (name.includes(\".\")) {\n let namespace = name.split(\".\")[0];\n const isProcessor = processors?.includes(name);\n\n // processor 是 camelCase 格式,转成 brick 的 param-case 格式,统一去判断\n if (isProcessor) {\n namespace = changeCase.paramCase(namespace);\n }\n const find = brickMap.get(namespace);\n if (find) {\n deps.add(find.filePath);\n\n if (find.dll) {\n for (const dllName of find.dll) {\n dll.add(dllName);\n }\n }\n } else {\n // eslint-disable-next-line no-console\n console.error(\n `${\n isProcessor ? \"Processor\" : \"Brick\"\n } \\`${name}\\` does not match any brick package`\n );\n }\n }\n });\n\n editorBricks?.forEach((editor) => {\n // ignore custom template editor\n // istanbul ignore else\n if (editor.includes(\".\")) {\n const namespace = editor.split(\".\")[0];\n const find = brickMap.get(namespace);\n // There maybe no `editorsJsFilePath`.\n if (find) {\n if (find.editorsJsFilePath) {\n deps.add(find.editorsJsFilePath);\n dll.add(\"editor-bricks-helper\");\n }\n } else {\n // eslint-disable-next-line no-console\n console.error(\n `Editor \\`${editor}\\` does not match any brick package`\n );\n }\n }\n });\n }\n\n const dllPath = window.DLL_PATH;\n return {\n dll: Array.from(dll).map((dllName) => dllPath[dllName]),\n deps: Array.from(deps),\n };\n}\n","/**\n * Tokenize input string.\n */\nfunction lexer(str) {\n var tokens = [];\n var i = 0;\n while (i < str.length) {\n var char = str[i];\n if (char === \"*\" || char === \"+\" || char === \"?\") {\n tokens.push({ type: \"MODIFIER\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"\\\\\") {\n tokens.push({ type: \"ESCAPED_CHAR\", index: i++, value: str[i++] });\n continue;\n }\n if (char === \"{\") {\n tokens.push({ type: \"OPEN\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"}\") {\n tokens.push({ type: \"CLOSE\", index: i, value: str[i++] });\n continue;\n }\n if (char === \":\") {\n var name = \"\";\n var j = i + 1;\n while (j < str.length) {\n var code = str.charCodeAt(j);\n if (\n // `0-9`\n (code >= 48 && code <= 57) ||\n // `A-Z`\n (code >= 65 && code <= 90) ||\n // `a-z`\n (code >= 97 && code <= 122) ||\n // `_`\n code === 95) {\n name += str[j++];\n continue;\n }\n break;\n }\n if (!name)\n throw new TypeError(\"Missing parameter name at \".concat(i));\n tokens.push({ type: \"NAME\", index: i, value: name });\n i = j;\n continue;\n }\n if (char === \"(\") {\n var count = 1;\n var pattern = \"\";\n var j = i + 1;\n if (str[j] === \"?\") {\n throw new TypeError(\"Pattern cannot start with \\\"?\\\" at \".concat(j));\n }\n while (j < str.length) {\n if (str[j] === \"\\\\\") {\n pattern += str[j++] + str[j++];\n continue;\n }\n if (str[j] === \")\") {\n count--;\n if (count === 0) {\n j++;\n break;\n }\n }\n else if (str[j] === \"(\") {\n count++;\n if (str[j + 1] !== \"?\") {\n throw new TypeError(\"Capturing groups are not allowed at \".concat(j));\n }\n }\n pattern += str[j++];\n }\n if (count)\n throw new TypeError(\"Unbalanced pattern at \".concat(i));\n if (!pattern)\n throw new TypeError(\"Missing pattern at \".concat(i));\n tokens.push({ type: \"PATTERN\", index: i, value: pattern });\n i = j;\n continue;\n }\n tokens.push({ type: \"CHAR\", index: i, value: str[i++] });\n }\n tokens.push({ type: \"END\", index: i, value: \"\" });\n return tokens;\n}\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str, options) {\n if (options === void 0) { options = {}; }\n var tokens = lexer(str);\n var _a = options.prefixes, prefixes = _a === void 0 ? \"./\" : _a;\n var defaultPattern = \"[^\".concat(escapeString(options.delimiter || \"/#?\"), \"]+?\");\n var result = [];\n var key = 0;\n var i = 0;\n var path = \"\";\n var tryConsume = function (type) {\n if (i < tokens.length && tokens[i].type === type)\n return tokens[i++].value;\n };\n var mustConsume = function (type) {\n var value = tryConsume(type);\n if (value !== undefined)\n return value;\n var _a = tokens[i], nextType = _a.type, index = _a.index;\n throw new TypeError(\"Unexpected \".concat(nextType, \" at \").concat(index, \", expected \").concat(type));\n };\n var consumeText = function () {\n var result = \"\";\n var value;\n while ((value = tryConsume(\"CHAR\") || tryConsume(\"ESCAPED_CHAR\"))) {\n result += value;\n }\n return result;\n };\n while (i < tokens.length) {\n var char = tryConsume(\"CHAR\");\n var name = tryConsume(\"NAME\");\n var pattern = tryConsume(\"PATTERN\");\n if (name || pattern) {\n var prefix = char || \"\";\n if (prefixes.indexOf(prefix) === -1) {\n path += prefix;\n prefix = \"\";\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n result.push({\n name: name || key++,\n prefix: prefix,\n suffix: \"\",\n pattern: pattern || defaultPattern,\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n var value = char || tryConsume(\"ESCAPED_CHAR\");\n if (value) {\n path += value;\n continue;\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n var open = tryConsume(\"OPEN\");\n if (open) {\n var prefix = consumeText();\n var name_1 = tryConsume(\"NAME\") || \"\";\n var pattern_1 = tryConsume(\"PATTERN\") || \"\";\n var suffix = consumeText();\n mustConsume(\"CLOSE\");\n result.push({\n name: name_1 || (pattern_1 ? key++ : \"\"),\n pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1,\n prefix: prefix,\n suffix: suffix,\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n mustConsume(\"END\");\n }\n return result;\n}\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile(str, options) {\n return tokensToFunction(parse(str, options), options);\n}\n/**\n * Expose a method for transforming tokens into the path function.\n */\nexport function tokensToFunction(tokens, options) {\n if (options === void 0) { options = {}; }\n var reFlags = flags(options);\n var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;\n // Compile all the tokens into regexps.\n var matches = tokens.map(function (token) {\n if (typeof token === \"object\") {\n return new RegExp(\"^(?:\".concat(token.pattern, \")$\"), reFlags);\n }\n });\n return function (data) {\n var path = \"\";\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n var value = data ? data[token.name] : undefined;\n var optional = token.modifier === \"?\" || token.modifier === \"*\";\n var repeat = token.modifier === \"*\" || token.modifier === \"+\";\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to not repeat, but got an array\"));\n }\n if (value.length === 0) {\n if (optional)\n continue;\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to not be empty\"));\n }\n for (var j = 0; j < value.length; j++) {\n var segment = encode(value[j], token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected all \\\"\".concat(token.name, \"\\\" to match \\\"\").concat(token.pattern, \"\\\", but got \\\"\").concat(segment, \"\\\"\"));\n }\n path += token.prefix + segment + token.suffix;\n }\n continue;\n }\n if (typeof value === \"string\" || typeof value === \"number\") {\n var segment = encode(String(value), token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to match \\\"\").concat(token.pattern, \"\\\", but got \\\"\").concat(segment, \"\\\"\"));\n }\n path += token.prefix + segment + token.suffix;\n continue;\n }\n if (optional)\n continue;\n var typeOfMessage = repeat ? \"an array\" : \"a string\";\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to be \").concat(typeOfMessage));\n }\n return path;\n };\n}\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nexport function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nexport function regexpToFunction(re, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a;\n return function (pathname) {\n var m = re.exec(pathname);\n if (!m)\n return false;\n var path = m[0], index = m.index;\n var params = Object.create(null);\n var _loop_1 = function (i) {\n if (m[i] === undefined)\n return \"continue\";\n var key = keys[i - 1];\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) {\n return decode(value, key);\n });\n }\n else {\n params[key.name] = decode(m[i], key);\n }\n };\n for (var i = 1; i < m.length; i++) {\n _loop_1(i);\n }\n return { path: path, index: index, params: params };\n };\n}\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path, keys) {\n if (!keys)\n return path;\n var groupsRegex = /\\((?:\\?<(.*?)>)?(?!\\?)/g;\n var index = 0;\n var execResult = groupsRegex.exec(path.source);\n while (execResult) {\n keys.push({\n // Use parenthesized substring match if available, index otherwise\n name: execResult[1] || index++,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\",\n });\n execResult = groupsRegex.exec(path.source);\n }\n return path;\n}\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(paths, keys, options) {\n var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; });\n return new RegExp(\"(?:\".concat(parts.join(\"|\"), \")\"), flags(options));\n}\n/**\n * Create a path regexp from string input.\n */\nfunction stringToRegexp(path, keys, options) {\n return tokensToRegexp(parse(path, options), keys, options);\n}\n/**\n * Expose a function for taking tokens and returning a RegExp.\n */\nexport function tokensToRegexp(tokens, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? \"/#?\" : _e, _f = options.endsWith, endsWith = _f === void 0 ? \"\" : _f;\n var endsWithRe = \"[\".concat(escapeString(endsWith), \"]|$\");\n var delimiterRe = \"[\".concat(escapeString(delimiter), \"]\");\n var route = start ? \"^\" : \"\";\n // Iterate over the tokens and create our regexp string.\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n if (typeof token === \"string\") {\n route += escapeString(encode(token));\n }\n else {\n var prefix = escapeString(encode(token.prefix));\n var suffix = escapeString(encode(token.suffix));\n if (token.pattern) {\n if (keys)\n keys.push(token);\n if (prefix || suffix) {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n var mod = token.modifier === \"*\" ? \"?\" : \"\";\n route += \"(?:\".concat(prefix, \"((?:\").concat(token.pattern, \")(?:\").concat(suffix).concat(prefix, \"(?:\").concat(token.pattern, \"))*)\").concat(suffix, \")\").concat(mod);\n }\n else {\n route += \"(?:\".concat(prefix, \"(\").concat(token.pattern, \")\").concat(suffix, \")\").concat(token.modifier);\n }\n }\n else {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n route += \"((?:\".concat(token.pattern, \")\").concat(token.modifier, \")\");\n }\n else {\n route += \"(\".concat(token.pattern, \")\").concat(token.modifier);\n }\n }\n }\n else {\n route += \"(?:\".concat(prefix).concat(suffix, \")\").concat(token.modifier);\n }\n }\n }\n if (end) {\n if (!strict)\n route += \"\".concat(delimiterRe, \"?\");\n route += !options.endsWith ? \"$\" : \"(?=\".concat(endsWithRe, \")\");\n }\n else {\n var endToken = tokens[tokens.length - 1];\n var isEndDelimited = typeof endToken === \"string\"\n ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1\n : endToken === undefined;\n if (!strict) {\n route += \"(?:\".concat(delimiterRe, \"(?=\").concat(endsWithRe, \"))?\");\n }\n if (!isEndDelimited) {\n route += \"(?=\".concat(delimiterRe, \"|\").concat(endsWithRe, \")\");\n }\n }\n return new RegExp(route, flags(options));\n}\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n */\nexport function pathToRegexp(path, keys, options) {\n if (path instanceof RegExp)\n return regexpToRegexp(path, keys);\n if (Array.isArray(path))\n return arrayToRegexp(path, keys, options);\n return stringToRegexp(path, keys, options);\n}\n//# sourceMappingURL=index.js.map","// Ref https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/matchPath.js\nimport { pathToRegexp, Key, compile } from \"path-to-regexp\";\nimport {\n CompileResult,\n CompileOptions,\n MatchOptions,\n MatchResult,\n MatchParams,\n PluginRuntimeContext,\n} from \"@next-core/brick-types\";\n\nexport type MatchPathOptions = MatchOptions &\n CompileOptions & {\n checkIf?: (context: PluginRuntimeContext) => boolean;\n getContext?: (match: any) => PluginRuntimeContext;\n };\n\nconst cache: Map<string, Map<string, CompileResult>> = new Map();\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path: string, options: CompileOptions): CompileResult {\n const cacheKey = `${options.end}${options.strict}${options.sensitive}`;\n if (!cache.has(cacheKey)) {\n cache.set(cacheKey, new Map());\n }\n const pathCache = cache.get(cacheKey);\n\n if (pathCache.has(path)) {\n return pathCache.get(path);\n }\n\n const keys: Key[] = [];\n const regexp = pathToRegexp(path, keys, options);\n const result = { regexp, keys };\n\n if (cacheCount < cacheLimit) {\n pathCache.set(path, result);\n cacheCount++;\n }\n\n return result;\n}\n\n/**\n * Public API for matching a URL pathname to a path.\n */\nexport function matchPath(\n pathname: string,\n options: MatchPathOptions\n): MatchResult {\n const {\n path: p,\n exact = false,\n strict = false,\n sensitive = true,\n checkIf,\n getContext,\n } = options;\n\n const paths = Array.isArray(p) ? p : [p];\n\n return paths.reduce<MatchResult>((matched, path) => {\n if (matched) {\n return matched;\n }\n const { regexp, keys } = compilePath(path, {\n end: exact,\n strict,\n sensitive,\n });\n const match = regexp.exec(pathname);\n\n if (!match) {\n return null;\n }\n\n const [url, ...values] = match;\n const isExact = pathname === url;\n\n if (exact && !isExact) {\n return null;\n }\n\n const initialParams: MatchParams = {};\n const result = {\n path, // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url, // the matched portion of the URL\n isExact, // whether or not we matched exactly\n params: keys.reduce((memo, key, index) => {\n memo[key.name] = values[index];\n return memo;\n }, initialParams),\n };\n\n if (checkIf && !checkIf(getContext(result))) {\n return null;\n }\n\n return result;\n }, null);\n}\n\nexport function toPath(path: string, pathParams: Record<string, any>): string {\n return compile(path)(pathParams);\n}\n","import { get } from \"lodash\";\nimport {\n Storyboard,\n RouteConf,\n RuntimeBrickConf,\n RouteConfOfBricks,\n} from \"@next-core/brick-types\";\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nfunction restoreDynamicTemplatesInBrick(brickConf: RuntimeBrickConf): void {\n if (get(brickConf, [\"$$lifeCycle\", \"useResolves\"], []).length > 0) {\n const { $$template, $$params, $$lifeCycle } = brickConf;\n const hasIf = hasOwnProperty(brickConf, \"$$if\");\n const rawIf = brickConf.$$if;\n Object.keys(brickConf).forEach((key) => {\n delete brickConf[key as keyof RuntimeBrickConf];\n });\n Object.assign(\n brickConf,\n {\n template: $$template,\n params: $$params,\n lifeCycle: $$lifeCycle,\n },\n hasIf ? { if: rawIf } : {}\n );\n }\n if (brickConf.slots) {\n Object.values(brickConf.slots).forEach((slotConf) => {\n if (slotConf.type === \"bricks\") {\n restoreDynamicTemplatesInBricks(slotConf.bricks);\n } else {\n restoreDynamicTemplatesInRoutes(slotConf.routes);\n }\n });\n }\n}\n\nfunction restoreDynamicTemplatesInBricks(bricks: RuntimeBrickConf[]): void {\n if (Array.isArray(bricks)) {\n bricks.forEach(restoreDynamicTemplatesInBrick);\n }\n}\n\nfunction restoreDynamicTemplatesInRoutes(routes: RouteConf[]): void {\n if (Array.isArray(routes)) {\n routes.forEach((routeConf) => {\n if (routeConf.type === \"routes\") {\n restoreDynamicTemplatesInRoutes(routeConf.routes);\n } else {\n restoreDynamicTemplatesInBricks(\n (routeConf as RouteConfOfBricks).bricks\n );\n }\n const menuBrickConf = routeConf.menu;\n if (menuBrickConf && menuBrickConf.type === \"brick\") {\n restoreDynamicTemplatesInBrick(menuBrickConf);\n }\n });\n }\n}\n\nexport function restoreDynamicTemplates(storyboard: Storyboard): void {\n restoreDynamicTemplatesInRoutes(storyboard.routes);\n}\n","import { Storyboard, BrickConf } from \"@next-core/brick-types\";\nimport {\n scanStoryboard,\n collectBricksInBrickConf,\n ScanBricksOptions,\n} from \"./scanStoryboard\";\n\n/**\n * Scan bricks in storyboard.\n *\n * @param storyboard - Storyboard.\n * @param options - If options is a boolean, it means `isUniq` or `de-duplicate`.\n * @param collectionOfCustomApi - You can pass an empty array to collect custom api.\n */\nexport function scanBricksInStoryboard(\n storyboard: Storyboard,\n options: boolean | ScanBricksOptions = true\n): string[] {\n return scanStoryboard(storyboard, options).bricks;\n}\n\nexport function scanBricksInBrickConf(brickConf: BrickConf): string[] {\n const collection = collectBricksInBrickConf(brickConf);\n const result = collection.filter(\n (item) => !item.includes(\"@\") && item.includes(\"-\")\n );\n return result;\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { EstreeLiteral } from \"@next-core/cook\";\nimport { PrecookHooks } from \"./cook\";\nimport {\n visitStoryboardExpressions,\n visitStoryboardFunctions,\n} from \"./visitStoryboard\";\n\nconst PERMISSIONS = \"PERMISSIONS\";\nconst check = \"check\";\n\nexport function scanPermissionActionsInStoryboard(\n storyboard: Storyboard\n): string[] {\n const collection = new Set<string>();\n const beforeVisitPermissions = beforeVisitPermissionsFactory(collection);\n const { customTemplates, functions } = storyboard.meta ?? {};\n visitStoryboardExpressions(\n [storyboard.routes, customTemplates],\n beforeVisitPermissions,\n PERMISSIONS\n );\n visitStoryboardFunctions(functions, beforeVisitPermissions);\n return Array.from(collection);\n}\n\nexport function scanPermissionActionsInAny(data: unknown): string[] {\n const collection = new Set<string>();\n visitStoryboardExpressions(\n data,\n beforeVisitPermissionsFactory(collection),\n PERMISSIONS\n );\n return Array.from(collection);\n}\n\nfunction beforeVisitPermissionsFactory(\n collection: Set<string>\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitPermissions(node, parent): void {\n if (node.name === PERMISSIONS) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if (\n callParent?.node.type === \"CallExpression\" &&\n callParent?.key === \"callee\" &&\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\" &&\n !memberParent.node.computed &&\n memberParent.node.property.type === \"Identifier\" &&\n memberParent.node.property.name === check\n ) {\n for (const arg of callParent.node\n .arguments as unknown as EstreeLiteral[]) {\n if (arg.type === \"Literal\" && typeof arg.value === \"string\") {\n collection.add(arg.value);\n }\n }\n }\n }\n };\n}\n","import type { Storyboard, RouteAliasMap } from \"@next-core/brick-types\";\nimport { parseRoutes, traverse } from \"@next-core/storyboard\";\n\nexport function scanRouteAliasInStoryboard(\n storyboard: Storyboard\n): RouteAliasMap {\n const collection: RouteAliasMap = new Map();\n const routes = parseRoutes(storyboard.routes, { routesOnly: true });\n\n traverse(routes, (node) => {\n if (node.type === \"Route\") {\n const alias = node.raw.alias;\n if (alias) {\n if (collection.has(alias)) {\n // eslint-disable-next-line no-console\n console.warn(`Duplicated route alias: ${alias}`);\n }\n collection.set(alias, {\n alias,\n path: node.raw.path,\n });\n }\n }\n });\n\n return collection;\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { EstreeLiteral } from \"@next-core/cook\";\nimport { PrecookHooks } from \"./cook\";\nimport {\n visitStoryboardExpressions,\n visitStoryboardFunctions,\n} from \"./visitStoryboard\";\n\nconst I18N = \"I18N\";\n\nexport function scanI18NInStoryboard(\n storyboard: Storyboard\n): Map<string, Set<string>> {\n const collection = new Map<string, Set<string>>();\n const beforeVisitI18n = beforeVisitI18nFactory(collection);\n // Notice: `menus` may contain evaluations of I18N too.\n const { customTemplates, menus, functions } = storyboard.meta ?? {};\n visitStoryboardExpressions(\n [storyboard.routes, customTemplates, menus],\n beforeVisitI18n,\n I18N\n );\n visitStoryboardFunctions(functions, beforeVisitI18n);\n return collection;\n}\n\nexport function scanI18NInAny(data: unknown): Map<string, Set<string>> {\n const collection = new Map<string, Set<string>>();\n visitStoryboardExpressions(data, beforeVisitI18nFactory(collection), I18N);\n return collection;\n}\n\nfunction beforeVisitI18nFactory(\n collection: Map<string, Set<string>>\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitI18n(node, parent): void {\n if (node.name === I18N) {\n const callParent = parent[parent.length - 1];\n if (\n callParent?.node.type === \"CallExpression\" &&\n callParent.key === \"callee\"\n ) {\n const [keyNode, defaultNode] = callParent.node\n .arguments as unknown as EstreeLiteral[];\n if (\n keyNode &&\n keyNode.type === \"Literal\" &&\n typeof keyNode.value === \"string\"\n ) {\n let valueSet = collection.get(keyNode.value);\n if (!valueSet) {\n valueSet = new Set();\n collection.set(keyNode.value, valueSet);\n }\n if (\n defaultNode &&\n defaultNode.type === \"Literal\" &&\n typeof defaultNode.value === \"string\"\n ) {\n valueSet.add(defaultNode.value);\n }\n }\n }\n }\n };\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { PrecookHooks } from \"./cook\";\nimport {\n visitStoryboardExpressions,\n visitStoryboardFunctions,\n} from \"./visitStoryboard\";\nimport { EstreeLiteral } from \"./cook\";\n\nconst APP = \"APP\";\nconst GET_MENUS = \"getMenu\";\n\nexport function scanAppGetMenuInStoryboard(storyboard: Storyboard): string[] {\n const collection = new Set<string>();\n const beforeVisitPermissions = beforeVisitAppFactory(collection);\n const { customTemplates, functions } = storyboard.meta ?? {};\n visitStoryboardExpressions(\n [storyboard.routes, customTemplates],\n beforeVisitPermissions,\n APP\n );\n visitStoryboardFunctions(functions, beforeVisitPermissions);\n return Array.from(collection);\n}\n\nexport function scanAppGetMenuInAny(data: unknown): string[] {\n const collection = new Set<string>();\n visitStoryboardExpressions(data, beforeVisitAppFactory(collection), APP);\n return Array.from(collection);\n}\n\nfunction beforeVisitAppFactory(\n collection: Set<string>\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitAPP(node, parent): void {\n if (node.name === APP) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if (\n callParent?.node.type === \"CallExpression\" &&\n callParent?.key === \"callee\" &&\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\" &&\n !memberParent.node.computed &&\n memberParent.node.property.type === \"Identifier\" &&\n memberParent.node.property.name === GET_MENUS\n ) {\n if (callParent.node.arguments.length === 1) {\n const menuId = (\n callParent.node.arguments as unknown as EstreeLiteral[]\n )[0];\n if (menuId.type === \"Literal\" && typeof menuId.value === \"string\") {\n collection.add(menuId.value);\n }\n }\n }\n }\n };\n}\n","import { Node, SourceLocation, PipeCall } from \"@next-core/pipes\";\n\nexport enum LexicalStatus {\n Initial,\n ExpectField,\n ExpectOptionalBeginDefault,\n ExpectDefaultValue,\n ExpectOptionalBeginPipe,\n ExpectPipeIdentifier,\n ExpectOptionalBeginPipeParameter,\n ExpectPipeParameter,\n ExpectPlaceholderEnd,\n}\n\nexport enum TokenType {\n Raw = \"Raw\",\n BeginPlaceHolder = \"BeginPlaceHolder\",\n Field = \"Field\",\n BeginDefault = \"BeginDefault\",\n LiteralString = \"LiteralString\",\n BeginPipe = \"BeginPipe\",\n PipeIdentifier = \"PipeIdentifier\",\n BeginPipeParameter = \"BeginPipeParameter\",\n EndPlaceHolder = \"EndPlaceHolder\",\n JsonValue = \"JsonValue\",\n}\n\nexport enum JsonValueType {\n Array,\n Object,\n String,\n Others,\n}\n\nexport interface LexicalContext {\n beginPlaceholder: RegExp;\n raw: string;\n cursor: number;\n status: LexicalStatus;\n tokens: Token[];\n}\n\nexport interface Token {\n type: TokenType;\n value?: any;\n loc?: SourceLocation;\n}\n\nexport interface InjectableString extends Node {\n type: \"InjectableString\";\n elements: (RawString | Placeholder)[];\n}\n\nexport interface RawString extends Node {\n type: \"RawString\";\n value: string;\n}\n\nexport interface Placeholder extends Node {\n type: \"Placeholder\";\n symbol: string;\n field: string;\n defaultValue: any;\n pipes: PipeCall[];\n}\n","import { escapeRegExp } from \"lodash\";\nimport {\n LexicalContext,\n LexicalStatus,\n Token,\n TokenType,\n JsonValueType,\n} from \"./interfaces\";\n\nexport function getRegExpOfPlaceholder(symbols: string | string[]): RegExp {\n return new RegExp(\n `(${([] as string[])\n .concat(symbols)\n .map((symbol) => escapeRegExp(symbol))\n .join(\"|\")})\\\\{`\n );\n}\n\nexport function tokenize(raw: string, symbols: string | string[]): Token[] {\n const context: LexicalContext = {\n beginPlaceholder: getRegExpOfPlaceholder(symbols),\n raw,\n cursor: 0,\n status: LexicalStatus.Initial,\n tokens: [],\n };\n while (context.cursor < raw.length) {\n switch (context.status) {\n case LexicalStatus.Initial:\n eatOptionalRawAndOptionalPlaceholderBegin(context);\n break;\n case LexicalStatus.ExpectField:\n eatWhitespace(context);\n eatField(context);\n break;\n case LexicalStatus.ExpectOptionalBeginDefault:\n eatWhitespace(context);\n eatOptionalDefault(context);\n break;\n case LexicalStatus.ExpectDefaultValue:\n eatWhitespace(context);\n eatDefaultValue(context);\n break;\n case LexicalStatus.ExpectOptionalBeginPipe:\n eatWhitespace(context);\n eatOptionalBeginPipe(context);\n break;\n case LexicalStatus.ExpectPipeIdentifier:\n eatWhitespace(context);\n eatPipeIdentifier(context);\n break;\n case LexicalStatus.ExpectOptionalBeginPipeParameter:\n eatWhitespace(context);\n eatOptionalBeginPipeParameter(context);\n break;\n case LexicalStatus.ExpectPipeParameter:\n eatWhitespace(context);\n eatPipeParameter(context);\n break;\n case LexicalStatus.ExpectPlaceholderEnd:\n eatWhitespace(context);\n eatPlaceholderEnd(context);\n break;\n }\n }\n if (context.status !== LexicalStatus.Initial) {\n throw new Error(\"Expected a placeholder end '}' at the end\");\n }\n return context.tokens;\n}\n\nfunction eatOptionalRawAndOptionalPlaceholderBegin(\n context: LexicalContext\n): void {\n const subRaw = getSubRaw(context);\n const matchedPlaceholder = subRaw.match(context.beginPlaceholder)?.[0];\n const subCursor = matchedPlaceholder\n ? subRaw.indexOf(matchedPlaceholder)\n : -1;\n if (\n subCursor >= 0 &&\n subRaw.charAt(subCursor + matchedPlaceholder.length) !== \"{\"\n ) {\n const nextCursor = context.cursor + subCursor;\n if (subCursor > 0) {\n context.tokens.push({\n type: TokenType.Raw,\n value: subRaw.substring(0, subCursor),\n });\n }\n context.tokens.push({\n type: TokenType.BeginPlaceHolder,\n loc: {\n start: nextCursor,\n end: nextCursor + matchedPlaceholder.length,\n },\n value: matchedPlaceholder.substring(0, matchedPlaceholder.length - 1),\n });\n context.cursor += subCursor + matchedPlaceholder.length;\n context.status = LexicalStatus.ExpectField;\n } else {\n context.tokens.push({\n type: TokenType.Raw,\n value: subRaw,\n });\n context.cursor = context.raw.length;\n }\n}\n\nfunction eatWhitespace(context: LexicalContext): void {\n context.cursor += getSubRaw(context).match(/^[ \\r\\n\\t]*/)[0].length;\n}\n\nfunction eatField(context: LexicalContext): void {\n // Only allow alphanumeric, `_`, `.`, `*`, `[`, `]`, `-` and other non-ascii.\n const [value] = getSubRaw(context).match(/^[\\w.*[\\]\\-\\u{80}-\\u{10FFFF}]*/u);\n context.tokens.push({\n type: TokenType.Field,\n value,\n });\n context.cursor += value.length;\n context.status = LexicalStatus.ExpectOptionalBeginDefault;\n}\n\nfunction eatOptionalDefault(context: LexicalContext): void {\n if (getSubRaw(context).charAt(0) === \"=\") {\n context.tokens.push({\n type: TokenType.BeginDefault,\n });\n context.cursor += 1;\n context.status = LexicalStatus.ExpectDefaultValue;\n } else {\n context.status = LexicalStatus.ExpectOptionalBeginPipe;\n }\n}\n\nfunction eatDefaultValue(context: LexicalContext): void {\n eatJsonValueOrLiteralString(context, LexicalStatus.ExpectOptionalBeginPipe);\n}\n\nfunction eatOptionalBeginPipe(context: LexicalContext): void {\n if (getSubRaw(context).charAt(0) === \"|\") {\n context.tokens.push({\n type: TokenType.BeginPipe,\n });\n context.cursor += 1;\n context.status = LexicalStatus.ExpectPipeIdentifier;\n } else {\n context.status = LexicalStatus.ExpectPlaceholderEnd;\n }\n}\n\nfunction eatPipeIdentifier(context: LexicalContext): void {\n const matches = getSubRaw(context).match(/^[a-zA-Z]\\w*/);\n if (!matches) {\n throw new Error(\n `Expected a pipe identifier at index ${\n context.cursor\n } near: ${JSON.stringify(context.raw.substring(context.cursor))}`\n );\n }\n const value = matches[0];\n context.tokens.push({\n type: TokenType.PipeIdentifier,\n value,\n });\n context.cursor += value.length;\n context.status = LexicalStatus.ExpectOptionalBeginPipeParameter;\n}\n\nfunction eatOptionalBeginPipeParameter(context: LexicalContext): void {\n if (getSubRaw(context).charAt(0) === \":\") {\n context.tokens.push({\n type: TokenType.BeginPipeParameter,\n });\n context.cursor += 1;\n context.status = LexicalStatus.ExpectPipeParameter;\n } else {\n context.status = LexicalStatus.ExpectOptionalBeginPipe;\n }\n}\n\nfunction eatPipeParameter(context: LexicalContext): void {\n eatJsonValueOrLiteralString(\n context,\n LexicalStatus.ExpectOptionalBeginPipeParameter\n );\n}\n\nfunction eatPlaceholderEnd(context: LexicalContext): void {\n if (getSubRaw(context).charAt(0) === \"}\") {\n context.tokens.push({\n type: TokenType.EndPlaceHolder,\n loc: {\n start: context.cursor,\n end: context.cursor + 1,\n },\n });\n context.cursor += 1;\n context.status = LexicalStatus.Initial;\n } else {\n throw new Error(\n `Expected a placeholder end '}' at index ${\n context.cursor\n } near: ${JSON.stringify(context.raw.substring(context.cursor))}`\n );\n }\n}\n\nconst jsonLiteralMap = new Map([\n [\"false\", false],\n [\"null\", null],\n [\"true\", true],\n]);\n\nfunction eatJsonValueOrLiteralString(\n context: LexicalContext,\n nextStatus: LexicalStatus\n): void {\n const subRaw = getSubRaw(context);\n if (\n /[0-9[{\"]/.test(subRaw.charAt(0)) ||\n /-[0-9]/.test(subRaw.substring(0, 2))\n ) {\n eatJsonValue(context, nextStatus);\n } else {\n // Accept any characters except controls and whitespace.\n // Only allow alphanumeric, `_`, `-` and other non-ascii.\n const [value] = getSubRaw(context).match(/^[\\w\\-\\u{80}-\\u{10FFFF}]*/u);\n\n if (jsonLiteralMap.has(value)) {\n context.tokens.push({\n type: TokenType.JsonValue,\n value: jsonLiteralMap.get(value),\n });\n } else {\n context.tokens.push({\n type: TokenType.LiteralString,\n value,\n });\n }\n\n context.cursor += value.length;\n context.status = nextStatus;\n }\n}\n\n// 我们不需要非常精确地在一段字符串中匹配出一段*完整合法的* JSON value,\n// 而只需要找到一段*可能是完整合法的* JSON value 即可,解析的工作交给 `JSON.parse()`。\n// 由于 JSON 中 object/array/string 的镜像起止符特性,我们尝试去完成这些符号匹配即可。\nfunction eatJsonValue(\n context: LexicalContext,\n nextStatus: LexicalStatus\n): void {\n const subRaw = getSubRaw(context);\n const firstChar = subRaw.charAt(0);\n const valueType: JsonValueType =\n firstChar === \"[\"\n ? JsonValueType.Array\n : firstChar === \"{\"\n ? JsonValueType.Object\n : firstChar === '\"'\n ? JsonValueType.String\n : JsonValueType.Others;\n\n let subCursor = 0;\n let objectBracesToMatch = 0;\n let arrayBracketsToMatch = 0;\n let stringQuotesToClose = false;\n let stringBackslashToEscape = false;\n let matched = false;\n\n while (subCursor < subRaw.length) {\n const char = subRaw.charAt(subCursor);\n if (stringBackslashToEscape) {\n stringBackslashToEscape = false;\n } else if (stringQuotesToClose) {\n if (char === '\"') {\n stringQuotesToClose = false;\n } else if (char === \"\\\\\") {\n stringBackslashToEscape = true;\n }\n } else {\n switch (char) {\n case \"[\":\n arrayBracketsToMatch += 1;\n break;\n case \"{\":\n objectBracesToMatch += 1;\n break;\n case \"]\":\n arrayBracketsToMatch -= 1;\n break;\n case \"}\":\n objectBracesToMatch -= 1;\n break;\n case '\"':\n stringQuotesToClose = true;\n break;\n }\n }\n\n subCursor += 1;\n\n switch (valueType) {\n case JsonValueType.Array:\n matched = !arrayBracketsToMatch;\n break;\n case JsonValueType.Object:\n matched = !objectBracesToMatch;\n break;\n case JsonValueType.String:\n matched = !stringQuotesToClose;\n break;\n default:\n // 对于其它类型,如果下一个字符不再是这些值类型可能的字符时,我们认为 JSON value 完成匹配。\n // 其它可能的值类型:number/boolean/null/undefined。\n matched =\n subCursor < subRaw.length &&\n /[^a-z0-9E.+-]/.test(subRaw.charAt(subCursor));\n }\n\n if (matched) {\n break;\n }\n }\n\n if (!matched) {\n throw new Error(\n `Failed to match a JSON value at index ${\n context.cursor\n } near: ${JSON.stringify(context.raw.substring(context.cursor))}`\n );\n }\n\n context.tokens.push({\n type: TokenType.JsonValue,\n value: JSON.parse(subRaw.substring(0, subCursor)),\n });\n context.cursor += subCursor;\n context.status = nextStatus;\n}\n\nfunction getSubRaw(context: LexicalContext): string {\n return context.raw.substring(context.cursor);\n}\n","import { PipeCall } from \"@next-core/pipes\";\nimport { tokenize } from \"./lexical\";\nimport { Token, TokenType, InjectableString, Placeholder } from \"./interfaces\";\n\nexport function parseInjectableString(\n raw: string,\n symbols: string | string[]\n): InjectableString {\n return parseTokens(tokenize(raw, symbols));\n}\n\nfunction parseTokens(tokens: Token[]): InjectableString {\n const tree: InjectableString = {\n type: \"InjectableString\",\n elements: [],\n };\n\n let token: Token;\n\n function optionalToken(type: TokenType): boolean {\n if (type === tokens[0].type) {\n token = tokens.shift();\n return true;\n }\n return false;\n }\n\n function acceptToken(type: TokenType | TokenType[]): void {\n token = tokens.shift();\n if (\n Array.isArray(type) ? !type.includes(token.type) : type !== token.type\n ) {\n throw new Error(`Expected token: ${type}, received token: ${token.type}`);\n }\n }\n\n while (tokens.length > 0) {\n if (optionalToken(TokenType.Raw)) {\n tree.elements.push({\n type: \"RawString\",\n value: token.value,\n });\n } else {\n acceptToken(TokenType.BeginPlaceHolder);\n const start = token.loc.start;\n const symbol = token.value;\n acceptToken(TokenType.Field);\n\n const placeholder: Placeholder = {\n type: \"Placeholder\",\n symbol,\n field: token.value,\n defaultValue: undefined,\n pipes: [],\n loc: {\n start,\n end: start,\n },\n };\n tree.elements.push(placeholder);\n\n if (optionalToken(TokenType.BeginDefault)) {\n acceptToken([TokenType.JsonValue, TokenType.LiteralString]);\n placeholder.defaultValue = token.value;\n }\n\n while (optionalToken(TokenType.BeginPipe)) {\n acceptToken(TokenType.PipeIdentifier);\n const pipe: PipeCall = {\n type: \"PipeCall\",\n identifier: token.value,\n parameters: [],\n };\n placeholder.pipes.push(pipe);\n\n while (optionalToken(TokenType.BeginPipeParameter)) {\n acceptToken([TokenType.JsonValue, TokenType.LiteralString]);\n pipe.parameters.push(token.value);\n }\n }\n\n acceptToken(TokenType.EndPlaceHolder);\n placeholder.loc.end = token.loc.end;\n }\n }\n\n return tree;\n}\n","import { get } from \"lodash\";\nimport {\n PluginRuntimeContext,\n StoryboardContextItem,\n} from \"@next-core/brick-types\";\nimport { processPipes } from \"@next-core/pipes\";\nimport { parseInjectableString } from \"./syntax\";\nimport { Placeholder } from \"./interfaces\";\nimport { getRegExpOfPlaceholder } from \"./lexical\";\n\nexport function transform(raw: string, data: any): any {\n return compile(raw, \"@\", data);\n}\n\nexport function inject(raw: string, context: PluginRuntimeContext): any {\n return compile(raw, \"$\", undefined, context);\n}\n\nexport function transformAndInject(\n raw: string,\n data: any,\n context: PluginRuntimeContext\n): any {\n return compile(raw, [\"@\", \"$\"], data, context);\n}\n\ntype CompileNode = (node: Placeholder) => any;\n\nfunction compile(\n raw: string,\n symbols: string | string[],\n data?: any,\n context?: PluginRuntimeContext\n): any {\n // const symbols = [\"@\", \"$\"];\n if (!isInjectable(raw, symbols)) {\n return raw;\n }\n\n const transformNode = transformNodeFactory(data);\n const injectNode = injectNodeFactory(context, raw);\n\n const tree = parseInjectableString(raw, symbols);\n const values = tree.elements.map((node) =>\n node.type === \"RawString\"\n ? node.value\n : node.symbol === \"$\"\n ? injectNode(node)\n : transformNode(node)\n );\n\n return reduceCompiledValues(values);\n}\n\nfunction reduceCompiledValues(values: any[]): any {\n // If the whole string is a placeholder, we should keep the original value.\n if (values.length === 1) {\n return values[0];\n }\n\n // If an element is `undefined`, `null` or an empty array `[]`, it is converted to an empty string.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join#Description\n return values.join(\"\");\n}\n\nfunction isInjectable(raw: string, symbols?: string | string[]): boolean {\n return getRegExpOfPlaceholder(symbols).test(raw);\n}\n\nfunction transformNodeFactory(data: any): CompileNode {\n return function transformNode(node: Placeholder): any {\n // If meet `@{}`, return `data`.\n let result = node.field ? get(data, node.field) : data;\n\n if (result === undefined) {\n result = node.defaultValue;\n }\n\n return processPipes(result, node.pipes);\n };\n}\n\nfunction injectNodeFactory(\n context: PluginRuntimeContext,\n raw: string\n): CompileNode {\n return function injectNode(node: Placeholder): any {\n const matches = node.field.match(\n /^(?:(QUERY(?:_ARRAY)?|EVENT|query|event|APP|HASH|ANCHOR|SYS|FLAGS|CTX)\\.)?(.+)$/\n );\n if (!matches) {\n // Keep the original raw partial when meet a unknown namespace.\n return raw.substring(node.loc.start, node.loc.end);\n }\n let [_full, namespace, subField] = matches;\n\n // Support namespace with no subfield such as `${ANCHOR}`.\n // But distinguish with match params. E.g. `${query}` is a match param.\n if (!namespace && /^[A-Z_]+$/.test(subField)) {\n namespace = subField;\n subField = \"*\";\n }\n\n let result;\n let anchor: string;\n const SimpleContextMap: Record<string, \"hash\" | \"sys\" | \"flags\"> = {\n HASH: \"hash\",\n SYS: \"sys\",\n FLAGS: \"flags\",\n };\n let contextItem: StoryboardContextItem;\n\n switch (namespace) {\n case \"QUERY\":\n case \"query\":\n if (subField === \"*\") {\n result = context.query;\n } else {\n result = context.query.has(subField)\n ? context.query.get(subField)\n : undefined;\n }\n break;\n case \"QUERY_ARRAY\":\n result = context.query.has(subField)\n ? context.query.getAll(subField)\n : undefined;\n break;\n case \"EVENT\":\n case \"event\":\n if (context.event === undefined) {\n // Keep the original raw partial when meet a `${EVENT}` in non-event context.\n return raw.substring(node.loc.start, node.loc.end);\n }\n result =\n subField === \"*\" ? context.event : get(context.event, subField);\n break;\n case \"APP\":\n result =\n subField === \"*\"\n ? context.overrideApp ?? context.app\n : get(context.overrideApp ?? context.app, subField);\n break;\n case \"HASH\":\n case \"SYS\":\n case \"FLAGS\":\n result =\n subField === \"*\"\n ? context[SimpleContextMap[namespace]]\n : get(context[SimpleContextMap[namespace]], subField);\n break;\n case \"ANCHOR\":\n anchor = context.hash ? context.hash.substr(1) : null;\n result = subField === \"*\" ? anchor : get(anchor, subField);\n break;\n case \"CTX\":\n contextItem = context.storyboardContext?.get(subField);\n if (contextItem) {\n result =\n contextItem.type === \"brick-property\"\n ? contextItem.brick.element?.[\n contextItem.prop as keyof HTMLElement\n ]\n : contextItem.value;\n }\n break;\n default:\n if (context.match) {\n result = context.match.params[subField];\n } else {\n // If the context is empty, return the original raw partial.\n return raw.substring(node.loc.start, node.loc.end);\n }\n }\n\n if (result === undefined) {\n result = node.defaultValue;\n }\n\n return processPipes(result, node.pipes);\n };\n}\n","import { utils } from \"@next-core/pipes\";\nexport { pipes } from \"@next-core/pipes\";\n\nexport { inject, transform, transformAndInject } from \"./compile\";\n\n// Keep compatibility of these exposed APIs.\nexport const {\n formatUnitValue: formatValue,\n convertUnitValueByPrecision: convertValueByPrecision,\n} = utils;\n","import { ContextConf } from \"@next-core/brick-types\";\nimport { PrecookHooks } from \"./cook\";\nimport { visitStoryboardExpressions } from \"./visitStoryboard\";\n\nexport async function resolveContextConcurrently(\n contextConfs: ContextConf[],\n resolveContext: (contextConf: ContextConf) => Promise<boolean>,\n keyword = \"CTX\"\n): Promise<void> {\n const dependencyMap = getDependencyMapOfContext(contextConfs, keyword);\n const pendingDeps = new Set<string>(\n Array.from(dependencyMap.keys()).map((contextConf) => contextConf.name)\n );\n const includesComputed = Array.from(dependencyMap.values()).some(\n (stats) => stats.includesComputed\n );\n const processed = new WeakSet<ContextConf>();\n\n const wrapResolve = async (contextConf: ContextConf): Promise<void> => {\n processed.add(contextConf);\n const resolved = await resolveContext(contextConf);\n dependencyMap.delete(contextConf);\n if (resolved) {\n if (!pendingDeps.delete(contextConf.name)) {\n throw new Error(`Duplicated context defined: ${contextConf.name}`);\n }\n }\n await scheduleNext();\n };\n\n let scheduleAsSerial = includesComputed;\n\n async function scheduleNext(): Promise<void> {\n const readyContexts = Array.from(dependencyMap.entries())\n .filter(predicateNextResolveFactory(pendingDeps, scheduleAsSerial))\n .map((entry) => entry[0])\n .filter((contextConf) => !processed.has(contextConf));\n await Promise.all(readyContexts.map(wrapResolve));\n }\n\n await scheduleNext();\n\n // If there are still contexts left, it implies one of these situations:\n // - Circular contexts.\n // Such as: a depends on b, while b depends on a.\n // - Related contexts are all ignored.\n // Such as: a depends on b,\n // while both them are ignore by a falsy result of `if`.\n if (dependencyMap.size > 0) {\n // This will throw if circular contexts detected.\n detectCircularContexts(dependencyMap, keyword);\n scheduleAsSerial = true;\n await scheduleNext();\n }\n}\n\nexport function syncResolveContextConcurrently(\n contextConfs: ContextConf[],\n resolveContext: (contextConf: ContextConf) => boolean,\n keyword = \"CTX\"\n): void {\n const dependencyMap = getDependencyMapOfContext(contextConfs, keyword);\n const pendingDeps = new Set<string>(\n Array.from(dependencyMap.keys()).map((contextConf) => contextConf.name)\n );\n const includesComputed = Array.from(dependencyMap.values()).some(\n (stats) => stats.includesComputed\n );\n\n let scheduleAsSerial = includesComputed;\n\n function scheduleNext(): void {\n const dep = Array.from(dependencyMap.entries()).find(\n predicateNextResolveFactory(pendingDeps, scheduleAsSerial)\n );\n if (dep) {\n const [contextConf] = dep;\n const resolved = resolveContext(contextConf);\n dependencyMap.delete(contextConf);\n if (resolved) {\n if (!pendingDeps.delete(contextConf.name)) {\n throw new Error(`Duplicated context defined: ${contextConf.name}`);\n }\n }\n scheduleNext();\n }\n }\n\n scheduleNext();\n\n // If there are still contexts left, it implies one of these situations:\n // - Circular contexts.\n // Such as: a depends on b, while b depends on a.\n // - Related contexts are all ignored.\n // Such as: a depends on b,\n // while both them are ignore by a falsy result of `if`.\n if (dependencyMap.size > 0) {\n // This will throw if circular contexts detected.\n detectCircularContexts(dependencyMap, keyword);\n scheduleAsSerial = true;\n scheduleNext();\n }\n}\n\nfunction predicateNextResolveFactory(\n pendingDeps: Set<string>,\n scheduleAsSerial: boolean\n): (entry: [ContextConf, ContextStatistics], index: number) => boolean {\n return (entry, index) =>\n // When contexts contain computed CTX accesses, it implies a dynamic dependency map.\n // So make them process sequentially, keep the same behavior as before.\n scheduleAsSerial\n ? index === 0\n : // A context is ready when it has no pending dependencies.\n !entry[1].dependencies.some((dep) => pendingDeps.has(dep));\n}\n\ninterface ContextStatistics {\n dependencies: string[];\n includesComputed: boolean;\n}\n\nexport function getDependencyMapOfContext(\n contextConfs: ContextConf[],\n keyword = \"CTX\"\n): Map<ContextConf, ContextStatistics> {\n const depsMap = new Map<ContextConf, ContextStatistics>();\n for (const contextConf of contextConfs) {\n const stats: ContextStatistics = {\n dependencies: [],\n includesComputed: false,\n };\n if (!contextConf.property) {\n visitStoryboardExpressions(\n [contextConf.if, contextConf.value, contextConf.resolve],\n beforeVisitContextFactory(stats, keyword),\n keyword\n );\n }\n depsMap.set(contextConf, stats);\n }\n return depsMap;\n}\n\nfunction beforeVisitContextFactory(\n stats: ContextStatistics,\n keyword: string\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitContext(node, parent): void {\n if (node.name === keyword) {\n const memberParent = parent[parent.length - 1];\n if (\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\"\n ) {\n const memberNode = memberParent.node;\n let dep: string;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n dep = memberNode.property.name;\n } else if (\n memberNode.computed &&\n (memberNode.property as any).type === \"Literal\" &&\n typeof (memberNode.property as any).value === \"string\"\n ) {\n dep = (memberNode.property as any).value;\n } else {\n stats.includesComputed = true;\n }\n if (dep !== undefined && !stats.dependencies.includes(dep)) {\n stats.dependencies.push(dep);\n }\n }\n }\n };\n}\n\nfunction detectCircularContexts(\n dependencyMap: Map<ContextConf, ContextStatistics>,\n keyword: string\n): void {\n const duplicatedMap = new Map(dependencyMap);\n const pendingDeps = new Set<string>(\n Array.from(duplicatedMap.keys()).map((contextConf) => contextConf.name)\n );\n const next = (): void => {\n let processedAtLeastOne = false;\n for (const [contextConf, stats] of duplicatedMap.entries()) {\n if (!stats.dependencies.some((dep) => pendingDeps.has(dep))) {\n duplicatedMap.delete(contextConf);\n pendingDeps.delete(contextConf.name);\n processedAtLeastOne = true;\n }\n }\n if (processedAtLeastOne) {\n next();\n }\n };\n next();\n\n if (duplicatedMap.size > 0) {\n throw new ReferenceError(\n `Circular ${keyword} detected: ${Array.from(duplicatedMap.keys())\n .map((contextConf) => contextConf.name)\n .join(\", \")}`\n );\n }\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { scanStoryboard, ScanBricksOptions } from \"./scanStoryboard\";\n\nexport interface CustomApiInfo {\n name: string;\n namespace: string;\n}\n\nexport function scanCustomApisInStoryboard(\n storyboard: Storyboard,\n options: boolean | ScanBricksOptions = true\n): string[] {\n return scanStoryboard(storyboard, options).customApis;\n}\n\nexport function mapCustomApisToNameAndNamespace(\n customApis: string[]\n): CustomApiInfo[] {\n return customApis.map((v) => {\n const [namespace, name] = v.split(\"@\");\n return {\n namespace,\n name,\n };\n });\n}\n","import { isEvaluable } from \"./cook\";\nimport { scanI18NInAny } from \"./scanI18NInStoryboard\";\n\n/**\n * Get smart display for a string property, which may be an evaluation.\n *\n * This is useful for brick editors to display specific property configurations.\n *\n * E.g., for a button brick editor, display it by\n * `smartDisplayForEvaluableString(btn.$$parsedProperties.buttonName, btn.alias, \"<% … %>\")`.\n *\n * @param rawString - Raw string value.\n * @param nonStringFallback - Fallback value if it's not a string.\n * @param unknownEvaluationFallback - Fallback value if it's an unknown evaluation.\n *\n * @returns\n *\n * Returns the nonStringFallback if the input is not a string and nonStringFallback presents.\n *\n * Or returns the raw input when nonStringFallback no presents.\n *\n * Returns the I18N default value (or key if no value found)\n * if it is an evaluation and contains one and only one I18N key.\n *\n * Or returns the unknownEvaluationFallback if it is an unknown evaluation string and\n * unknownEvaluationFallback presents.\n *\n * Or returns the raw input otherwise.\n */\nexport function smartDisplayForEvaluableString<T, U, V>(\n rawString: T,\n nonStringFallback?: U,\n unknownEvaluationFallback?: V\n): T | U | V | string {\n if (typeof rawString !== \"string\") {\n // Catch on `undefined` or `null`.\n if (nonStringFallback != undefined) {\n return nonStringFallback;\n }\n return rawString;\n }\n if (isEvaluable(rawString)) {\n const i18nData = scanI18NInAny(rawString);\n if (i18nData.size === 1) {\n const key = i18nData.keys().next().value as string;\n const valueSet = i18nData.get(key);\n return valueSet.size > 0\n ? (valueSet.values().next().value as string)\n : key;\n }\n // Catch on `undefined` or `null`.\n if (unknownEvaluationFallback != undefined) {\n return unknownEvaluationFallback;\n }\n }\n return rawString;\n}\n","// This is copied from\n// [@next-libs/storage](https://github.com/easyops-cn/next-libs/tree/master/libs/storage),\n// and the types is refined.\n// The usage of JsonStorage from @next-libs/storage should be deprecated,\n// and migrated to from @next-core/brick-utils.\nexport class JsonStorage<U = Record<string, unknown>> {\n constructor(\n private storage: Storage,\n private prefix: string = \"brick-next-\"\n ) {}\n\n setItem<T extends string & keyof U>(name: T, value: U[T]): void {\n this.storage.setItem(this.prefix + name, JSON.stringify(value));\n }\n\n getItem<T extends string & keyof U>(name: T): U[T] {\n return JSON.parse(this.storage.getItem(this.prefix + name)) as U[T];\n }\n\n removeItem<T extends string & keyof U>(name: T): void {\n return this.storage.removeItem(this.prefix + name);\n }\n\n clear(): void {\n return this.storage.clear();\n }\n}\n","import {\n BuilderBrickNode,\n BuilderCustomTemplateNode,\n BuilderRouteNode,\n BuilderRouteOrBrickNode,\n BuilderSnippetNode,\n} from \"@next-core/brick-types\";\n\nexport function isRouteNode(\n node: BuilderRouteOrBrickNode\n): node is BuilderRouteNode {\n switch (node.type) {\n case \"bricks\":\n case \"routes\":\n case \"redirect\":\n return true;\n default:\n return false;\n }\n}\n\nexport function isBrickNode(\n node: BuilderRouteOrBrickNode\n): node is BuilderBrickNode {\n switch (node.type) {\n case \"brick\":\n case \"provider\":\n case \"template\":\n return true;\n default:\n return false;\n }\n}\n\nexport function isCustomTemplateNode(\n node: BuilderRouteOrBrickNode\n): node is BuilderCustomTemplateNode {\n return node.type === \"custom-template\";\n}\n\nexport function isSnippetNode(\n node: BuilderRouteOrBrickNode\n): node is BuilderSnippetNode {\n return node.type === \"snippet\";\n}\n","import yaml from \"js-yaml\";\nimport { cloneDeep } from \"lodash\";\nimport {\n BrickConf,\n BuilderBrickNode,\n BuilderCustomTemplateNode,\n BuilderRouteNode,\n BuilderRouteOrBrickNode,\n BuilderSnippetNode,\n RouteConf,\n SeguesConf,\n} from \"@next-core/brick-types\";\nimport { isBrickNode, isRouteNode } from \"./assertions\";\n\nconst jsonFieldsInRoute = [\n \"menu\",\n \"providers\",\n \"segues\",\n \"defineResolves\",\n \"redirect\",\n \"analyticsData\",\n];\n\n// Fields stored as yaml string will be parsed when build & push.\nconst yamlFieldsInRoute = [\"permissionsPreCheck\", \"if\"];\n\nconst jsonFieldsInBrick = [\n \"properties\",\n \"events\",\n \"lifeCycle\",\n \"params\",\n \"if\",\n \"transform\",\n];\n\n// Fields stored as yaml string will be parsed when build & push.\nconst yamlFieldsInBrick = [\"permissionsPreCheck\", \"transformFrom\"];\n\n// Fields started with `_` will be removed by default.\nconst fieldsToRemoveInRoute = [\n \"appId\",\n \"children\",\n \"creator\",\n \"ctime\",\n \"id\",\n \"graphInfo\",\n \"modifier\",\n \"mountPoint\",\n \"mtime\",\n \"org\",\n \"parent\",\n \"sort\",\n \"name\",\n \"providersBak\",\n \"providers_bak\",\n \"previewSettings\",\n \"screenshot\",\n\n \"deleteAuthorizers\",\n \"readAuthorizers\",\n \"updateAuthorizers\",\n];\n\nconst fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat(\"type\", \"alias\");\n\n// Those fields can be disposed if value is null.\nconst disposableNullFields = [\n \"alias\",\n \"documentId\",\n \"hybrid\",\n \"bg\",\n \"context\",\n \"exports\",\n \"ref\",\n \"portal\",\n \"analyticsData\",\n];\n\nexport function normalizeBuilderNode(node: BuilderBrickNode): BrickConf;\nexport function normalizeBuilderNode(node: BuilderRouteNode): RouteConf;\nexport function normalizeBuilderNode(\n node: BuilderCustomTemplateNode | BuilderSnippetNode\n): null;\nexport function normalizeBuilderNode(\n node: BuilderRouteOrBrickNode\n): BrickConf | RouteConf | null;\nexport function normalizeBuilderNode(\n node: BuilderRouteOrBrickNode\n): BrickConf | RouteConf | null {\n if (isBrickNode(node)) {\n return normalize(\n node,\n fieldsToRemoveInBrick,\n jsonFieldsInBrick,\n yamlFieldsInBrick,\n \"brick\"\n ) as unknown as BrickConf;\n }\n if (isRouteNode(node)) {\n return normalize(\n node,\n fieldsToRemoveInRoute,\n jsonFieldsInRoute,\n yamlFieldsInRoute,\n \"route\"\n ) as unknown as RouteConf;\n }\n return null;\n}\n\nfunction normalize(\n node: BuilderRouteOrBrickNode,\n fieldsToRemove: string[],\n jsonFields: string[],\n yamlFields: string[],\n type: \"brick\" | \"route\"\n): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(node)\n // Remove unused fields from CMDB.\n // Consider fields started with `_` as unused.\n .filter(\n ([key, value]) =>\n !(\n key[0] === \"_\" ||\n fieldsToRemove.includes(key) ||\n (value === null && disposableNullFields.includes(key))\n )\n )\n // Parse specific fields.\n .map(([key, value]) => [\n key === \"instanceId\" ? \"iid\" : key,\n type === \"route\" && key === \"segues\"\n ? getCleanSegues(value as string)\n : jsonFields.includes(key)\n ? safeJsonParse(value as string)\n : yamlFields.includes(key)\n ? safeYamlParse(value as string)\n : cloneDeep(value),\n ])\n );\n}\n\n// Clear `segue._view` which is for development only.\nfunction getCleanSegues(string: string): SeguesConf {\n const segues = safeJsonParse(string);\n return (\n segues &&\n Object.fromEntries(\n Object.entries(segues).map(([id, segue]) => [\n id,\n segue && {\n target: segue.target,\n },\n ])\n )\n );\n}\n\nfunction safeJsonParse(value: string): unknown {\n if (!value) {\n return;\n }\n try {\n return JSON.parse(value);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"JSON.parse() failed\", value);\n }\n}\n\nfunction safeYamlParse(value: string): unknown {\n if (!value) {\n return;\n }\n try {\n const result = yaml.safeLoad(value, {\n schema: yaml.JSON_SCHEMA,\n json: true,\n });\n return result;\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Failed to parse yaml string\", value);\n }\n}\n","const fieldsToKeepInMenu = [\n \"menuId\",\n \"title\",\n \"icon\",\n \"titleDataSource\",\n \"defaultCollapsed\",\n \"defaultCollapsedBreakpoint\",\n \"link\",\n \"type\",\n \"injectMenuGroupId\",\n \"dynamicItems\",\n \"itemsResolve\",\n];\n\nconst fieldsToKeepInMenuItem = [\n \"text\",\n \"to\",\n \"href\",\n \"target\",\n \"icon\",\n \"exact\",\n \"key\",\n \"activeIncludes\",\n \"activeExcludes\",\n \"activeMatchSearch\",\n \"type\",\n \"sort\",\n \"defaultExpanded\",\n \"if\",\n \"groupId\",\n];\n\nexport interface MenuNode {\n items?: MenuItemNode[];\n [key: string]: unknown;\n}\n\nexport interface MenuItemNode {\n children?: MenuItemNode[];\n [key: string]: unknown;\n}\n\nexport function normalizeMenu(node: MenuNode): Record<string, unknown> {\n return {\n ...keep(node, fieldsToKeepInMenu),\n items: keepItems(node.items, fieldsToKeepInMenuItem),\n };\n}\n\nfunction keep(\n node: MenuNode | MenuItemNode,\n fieldsToKeep: string[]\n): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(node)\n // Keep certain fields from CMDB.\n .filter((item) => fieldsToKeep.includes(item[0]))\n );\n}\n\nfunction keepItems(\n nodes: MenuItemNode[],\n fieldsToKeep: string[]\n): Record<string, unknown>[] {\n return nodes?.map((node) => ({\n ...keep(node, fieldsToKeep),\n children: keepItems(node.children, fieldsToKeep),\n }));\n}\n","// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n\n/** @internal */\nexport function deepFreeze<T>(object: T): T {\n // Retrieve the property names defined on object\n const propNames = Object.getOwnPropertyNames(object);\n\n // Freeze properties before freezing self\n\n for (const name of propNames) {\n const value = (object as Record<string, unknown>)[name];\n\n if (value && typeof value === \"object\") {\n deepFreeze(value);\n }\n }\n\n return Object.freeze(object);\n}\n","import { PrecookHooks, preevaluate } from \"./cook\";\nimport { visitStoryboardExpressions } from \"./visitStoryboard\";\n\n/**\n * Get tracking CTX for an evaluable expression in `track context` mode.\n *\n * A `track context` mode is an evaluable expression which is a sequence expression\n * starting with the exact literal string expression of \"track context\".\n *\n * @param raw - A raw string, which must be checked by `isEvaluable` first.\n *\n * @returns\n *\n * Returns used CTXs if `track context` mode is enabled, or returns false if not enabled or\n * no CTX found.\n *\n * @example\n *\n * ```js\n * trackContext('<% \"track context\", [CTX.hello, CTX.world] %>');\n * // => [\"hello\", \"world\"]\n *\n * trackContext('<% [CTX.hello, CTX.world] %>');\n * // => false\n *\n * trackContext('<% \"track context\", DATA.any %>');\n * // => false\n * ```\n */\nexport function trackContext(raw: string): string[] | false {\n return track(raw, \"track context\", \"CTX\");\n}\n\nexport function trackState(raw: string): string[] | false {\n return track(raw, \"track state\", \"STATE\");\n}\n\nexport function trackFormState(raw: string): string[] | false {\n return track(raw, \"track formstate\", \"FORM_STATE\");\n}\n\nexport function trackUsedContext(data: unknown): string[] {\n return trackUsed(data, \"CTX\");\n}\n\nexport function trackUsedState(data: unknown): string[] {\n return trackUsed(data, \"STATE\");\n}\n\nfunction track(\n raw: string,\n trackText: string,\n variableName: string\n): string[] | false {\n if (raw.includes(trackText)) {\n const contexts = new Set<string>();\n const { expression } = preevaluate(raw, {\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitContextFactory(contexts, variableName),\n },\n });\n let trackCtxExp: any;\n if (\n expression.type === \"SequenceExpression\" &&\n (trackCtxExp = expression.expressions[0] as unknown) &&\n trackCtxExp.type === \"Literal\" &&\n trackCtxExp.value === trackText\n ) {\n if (contexts.size > 0) {\n return Array.from(contexts);\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n `You are using \"${trackText}\" but no \\`${variableName}\\` usage found in your expression: ${JSON.stringify(\n raw\n )}`\n );\n }\n }\n }\n return false;\n}\n\nfunction trackUsed(data: unknown, variableName: string): string[] {\n const contexts = new Set<string>();\n visitStoryboardExpressions(\n data,\n beforeVisitContextFactory(contexts, variableName),\n variableName\n );\n return Array.from(contexts);\n}\n\nfunction beforeVisitContextFactory(\n contexts: Set<string>,\n variableName: string\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitContext(node, parent): void {\n if (node.name === variableName) {\n const memberParent = parent[parent.length - 1];\n if (\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\"\n ) {\n const memberNode = memberParent.node;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n contexts.add(memberNode.property.name);\n } else if (\n memberNode.computed &&\n (memberNode.property as any).type === \"Literal\" &&\n typeof (memberNode.property as any).value === \"string\"\n ) {\n contexts.add((memberNode.property as any).value);\n }\n }\n }\n };\n}\n","import type { SimpleFunction } from \"@next-core/brick-types\";\n\n// The debounce function receives our function as a parameter\nexport function debounceByAnimationFrame<P extends unknown[]>(\n fn: SimpleFunction<P, void>\n): SimpleFunction<P, void> {\n // This holds the requestAnimationFrame reference, so we can cancel it if we wish\n let frame: number;\n\n // The debounce function returns a new function that can receive a variable number of arguments\n return (...params: P) => {\n // If the frame variable has been defined, clear it now, and queue for next frame\n if (frame) {\n cancelAnimationFrame(frame);\n }\n\n // Queue our function call for the next frame\n frame = requestAnimationFrame(() => {\n // Call our function and pass any params we received\n fn(...params);\n });\n };\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { EstreeLiteral } from \"@next-core/cook\";\nimport { PrecookHooks } from \"./cook\";\nimport {\n visitStoryboardExpressions,\n visitStoryboardFunctions,\n} from \"./visitStoryboard\";\n\nconst INSTALLED_APPS = \"INSTALLED_APPS\";\nconst has = \"has\";\n\nexport function scanInstalledAppsInStoryboard(\n storyboard: Storyboard\n): string[] {\n const collection = new Set<string>();\n const beforeVisitInstalledApps = beforeVisitInstalledAppsFactory(collection);\n const { customTemplates, functions, menus } = storyboard.meta ?? {};\n visitStoryboardExpressions(\n [storyboard.routes, customTemplates, menus],\n beforeVisitInstalledApps,\n INSTALLED_APPS\n );\n visitStoryboardFunctions(functions, beforeVisitInstalledApps);\n return Array.from(collection);\n}\n\nfunction beforeVisitInstalledAppsFactory(\n collection: Set<string>\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitPermissions(node, parent): void {\n if (node.name === INSTALLED_APPS) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if (\n callParent?.node.type === \"CallExpression\" &&\n callParent?.key === \"callee\" &&\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\" &&\n !memberParent.node.computed &&\n memberParent.node.property.type === \"Identifier\" &&\n memberParent.node.property.name === has\n ) {\n const args = callParent.node.arguments as unknown as EstreeLiteral[];\n if (\n args.length > 0 &&\n args[0].type === \"Literal\" &&\n typeof args[0].value === \"string\"\n ) {\n collection.add(args[0].value);\n }\n }\n }\n };\n}\n","const poolMap = new Map<string, Pool<unknown, unknown>>();\n\ninterface Pool<T, S> {\n current: Queue<T, S>;\n fullIds: Map<T, Promise<S>>;\n}\n\ninterface Queue<T, S> {\n // This promise is corresponding to the aggregatedIds below.\n promise: Promise<S>;\n aggregatedIds: Set<T>;\n}\n\nexport type ThrottledAggregation<T, R> = (id: T) => Promise<R>;\n\n/**\n * Make a throttled aggregation function.\n *\n * Note: the `id` should be a primitive value, typically a string or a number.\n * If the `id` must be an array or an object, encode it in JSON.\n *\n * @param namespace Should be unique for each purpose.\n * @param request Accept ids, fire request and return the promise.\n * @param select Select the specific data for a specific id in the aggregated result.\n * @param wait Throttle wait time in milliseconds, defaults to 100.\n */\nexport function makeThrottledAggregation<T extends string | number, S, R>(\n namespace: string,\n request: (ids: T[]) => Promise<S>,\n select: (result: S, id: T) => R,\n wait = 100\n): ThrottledAggregation<T, R> {\n // Each namespace share a pool.\n let pool = poolMap.get(namespace) as Pool<T, S>;\n if (!pool) {\n pool = {\n current: null,\n fullIds: new Map(),\n };\n poolMap.set(namespace, pool);\n }\n\n function enqueue(id: T): Queue<T, S> {\n const aggregatedIds = new Set<T>();\n aggregatedIds.add(id);\n const promise = new Promise<S>((resolve, reject) => {\n setTimeout(() => {\n pool.current = null;\n request([...aggregatedIds]).then(resolve, reject);\n }, wait);\n });\n return {\n promise,\n aggregatedIds,\n };\n }\n\n return function (id: T) {\n const cached = pool.fullIds.get(id);\n if (cached) {\n return cached.then((r) => select(r, id));\n }\n if (pool.current) {\n pool.current.aggregatedIds.add(id);\n } else {\n pool.current = enqueue(id);\n }\n const { promise } = pool.current;\n pool.fullIds.set(id, promise);\n return promise.then((r) => select(r, id));\n };\n}\n","import type {\n CustomTemplateConstructor,\n FeatureFlags,\n RuntimeStoryboard,\n} from \"@next-core/brick-types\";\nimport {\n cook,\n EstreeLiteral,\n EstreeNode,\n isEvaluable,\n preevaluate,\n} from \"@next-core/cook\";\nimport { remove } from \"lodash\";\nimport { hasOwnProperty } from \"./hasOwnProperty\";\nimport {\n parseStoryboard,\n parseTemplate,\n traverse,\n type StoryboardNode,\n} from \"@next-core/storyboard\";\n\nexport interface RemoveDeadConditionsOptions {\n constantFeatureFlags?: boolean;\n featureFlags?: FeatureFlags;\n}\n\ninterface ConditionalStoryboardNode {\n raw: {\n if?: string | boolean;\n };\n}\n\n/**\n * Remove dead conditions in storyboard like `if: '<% FLAGS[\"your-feature-flag\"] %>'` when\n * `FLAGS[\"your-feature-flag\"]` is falsy.\n */\nexport function removeDeadConditions(\n storyboard: RuntimeStoryboard,\n options?: RemoveDeadConditionsOptions\n): void {\n if (storyboard.$$deadConditionsRemoved) {\n return;\n }\n const ast = parseStoryboard(storyboard);\n removeDeadConditionsByAst(ast, options);\n storyboard.$$deadConditionsRemoved = true;\n}\n\nfunction removeDeadConditionsByAst(\n ast: StoryboardNode,\n options: RemoveDeadConditionsOptions\n): void {\n // First, we mark constant conditions.\n traverse(ast, (node) => {\n switch (node.type) {\n case \"Route\":\n case \"Brick\":\n case \"EventHandler\":\n case \"Context\":\n computeConstantCondition(node.raw, options);\n break;\n case \"Resolvable\":\n if (node.isConditional) {\n computeConstantCondition(node.raw, options);\n }\n break;\n }\n });\n\n // Then, we remove dead conditions accordingly.\n traverse(ast, (node) => {\n let rawContainer: any;\n let conditionalNodes: ConditionalStoryboardNode[];\n let rawKey: string;\n let deleteEmptyArray = false;\n\n switch (node.type) {\n case \"Root\":\n conditionalNodes = node.routes;\n rawContainer = node.raw;\n rawKey = \"routes\";\n break;\n case \"Template\":\n conditionalNodes = node.bricks as ConditionalStoryboardNode[];\n rawContainer = node.raw;\n rawKey = \"bricks\";\n break;\n case \"Route\":\n case \"Slot\":\n conditionalNodes = node.children as ConditionalStoryboardNode[];\n rawContainer = node.raw;\n rawKey = node.raw.type === \"routes\" ? \"routes\" : \"bricks\";\n break;\n case \"Event\":\n case \"EventCallback\":\n case \"SimpleLifeCycle\":\n case \"ConditionalEvent\":\n conditionalNodes = node.handlers;\n rawContainer = node.rawContainer;\n rawKey = node.rawKey;\n deleteEmptyArray = true;\n break;\n case \"ResolveLifeCycle\":\n conditionalNodes = node.resolves;\n rawContainer = node.rawContainer;\n rawKey = node.rawKey;\n deleteEmptyArray = true;\n break;\n case \"UseBrickEntry\":\n conditionalNodes = node.children as ConditionalStoryboardNode[];\n rawContainer = node.rawContainer;\n rawKey = node.rawKey;\n break;\n }\n\n shakeConditionalNodes(\n node,\n rawContainer,\n conditionalNodes,\n rawKey,\n deleteEmptyArray\n );\n\n // Remove unreachable context/state.\n deleteEmptyArray = false;\n switch (node.type) {\n case \"Route\":\n case \"Brick\":\n case \"Template\":\n rawContainer = node.raw;\n rawKey = node.type === \"Template\" ? \"state\" : \"context\";\n conditionalNodes = node.context;\n break;\n }\n\n shakeConditionalNodes(\n node,\n rawContainer,\n conditionalNodes,\n rawKey,\n deleteEmptyArray\n );\n });\n}\n\nfunction shakeConditionalNodes(\n node: StoryboardNode,\n rawContainer: any,\n conditionalNodes: ConditionalStoryboardNode[],\n rawKey: string,\n deleteEmptyArray?: boolean\n): void {\n const removedNodes = remove(\n conditionalNodes,\n (node) => node.raw.if === false\n );\n if (removedNodes.length > 0) {\n if (node.type === \"UseBrickEntry\" && !Array.isArray(rawContainer[rawKey])) {\n rawContainer[rawKey] = { brick: \"div\", if: false };\n } else if (deleteEmptyArray && conditionalNodes.length === 0) {\n delete rawContainer[rawKey];\n } else {\n rawContainer[rawKey] = conditionalNodes.map((node) => node.raw);\n }\n }\n}\n\n/**\n * Like `removeDeadConditions` but applied to a custom template.\n */\nexport function removeDeadConditionsInTpl(\n tplConstructor: CustomTemplateConstructor,\n options?: RemoveDeadConditionsOptions\n): void {\n const ast = parseTemplate(tplConstructor);\n removeDeadConditionsByAst(ast, options);\n}\n\nexport interface IfContainer {\n if?: unknown;\n}\n\nexport function computeConstantCondition(\n ifContainer: IfContainer,\n options: RemoveDeadConditionsOptions = {}\n): void {\n if (hasOwnProperty(ifContainer, \"if\")) {\n if (typeof ifContainer.if === \"string\" && isEvaluable(ifContainer.if)) {\n try {\n const { expression, attemptToVisitGlobals, source } = preevaluate(\n ifContainer.if\n );\n const { constantFeatureFlags, featureFlags } = options;\n let hasDynamicVariables = false;\n for (const item of attemptToVisitGlobals) {\n if (\n item !== \"undefined\" &&\n (!constantFeatureFlags || item !== \"FLAGS\")\n ) {\n hasDynamicVariables = true;\n break;\n }\n }\n if (hasDynamicVariables) {\n if (isConstantLogical(expression, false, options)) {\n if (process.env.NODE_ENV === \"development\") {\n // eslint-disable-next-line no-console\n console.warn(\"[removed dead if]:\", ifContainer.if, ifContainer);\n }\n ifContainer.if = false;\n }\n return;\n }\n const originalIf = ifContainer.if;\n const globalVariables: Record<string, unknown> = {\n undefined: undefined,\n };\n if (constantFeatureFlags) {\n globalVariables.FLAGS = featureFlags;\n }\n ifContainer.if = !!cook(expression, source, { globalVariables });\n if (\n process.env.NODE_ENV === \"development\" &&\n ifContainer.if === false\n ) {\n // eslint-disable-next-line no-console\n console.warn(\"[removed dead if]:\", originalIf, ifContainer);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else if (!ifContainer.if && ifContainer.if !== false) {\n // eslint-disable-next-line no-console\n console.warn(\n \"[potential dead if]:\",\n typeof ifContainer.if,\n ifContainer.if,\n ifContainer\n );\n }\n }\n}\n\n/**\n * We can safely remove the code for the following use cases,\n * even though they contain runtime variables such as CTX:\n *\n * - if: '<% false && CTX.any %>'\n * - if: '<% FLAGS[\"disabled\"] && CTX.any %>'\n * - if: '<% !FLAGS[\"enabled\"] && CTX.any %>'\n * - if: '<% !(FLAGS[\"enabled\"] || CTX.any) %>'\n *\n * Since these logics will always get a falsy result.\n *\n * Here we simply only consider these kinds of AST node:\n *\n * - LogicalExpression: with operator of '||' or '&&'\n * - UnaryExpression: with operator of '!'\n * - Literal: such as boolean/number/string/null/regex\n * - MemberExpression: of 'FLAGS[\"disabled\"]' or 'FLAGS.disabled'\n * - Identifier: of 'undefined'\n */\nfunction isConstantLogical(\n node: EstreeNode,\n expect: boolean,\n options: RemoveDeadConditionsOptions\n): boolean {\n const { constantFeatureFlags, featureFlags } = options;\n return node.type === \"LogicalExpression\"\n ? node.operator === (expect ? \"||\" : \"&&\") &&\n [node.left, node.right].some((item) =>\n isConstantLogical(item, expect, options)\n )\n : node.type === \"UnaryExpression\"\n ? node.operator === \"!\" &&\n isConstantLogical(node.argument, !expect, options)\n : (node as unknown as EstreeLiteral).type === \"Literal\"\n ? !!(node as unknown as EstreeLiteral).value === expect\n : node.type === \"Identifier\"\n ? node.name === \"undefined\"\n ? !expect\n : false\n : constantFeatureFlags &&\n node.type === \"MemberExpression\" &&\n node.object.type === \"Identifier\" &&\n node.object.name === \"FLAGS\" &&\n (node.computed\n ? (node.property as unknown as EstreeLiteral).type === \"Literal\" &&\n typeof (node.property as unknown as EstreeLiteral).value ===\n \"string\" &&\n !!featureFlags[\n (node.property as unknown as EstreeLiteral).value as string\n ] === expect\n : node.property.type === \"Identifier\" &&\n !!featureFlags[node.property.name] === expect);\n}\n"],"names":["cache","Map","loadScript","src","prefix","Array","isArray","Promise","all","map","item","fixedSrc","has","get","promise","resolve","reject","end","window","dispatchEvent","CustomEvent","script","document","createElement","onload","onerror","e","firstScript","currentScript","getElementsByTagName","parentNode","insertBefore","set","prefetchCache","Set","prefetchScript","add","link","rel","href","head","appendChild","scanTemplatesInBrick","brickConf","collection","template","push","slots","Object","values","forEach","slotConf","type","scanTemplatesInBricks","bricks","scanTemplatesInRoutes","routes","internalUsedTemplates","routeConf","menu","scanTemplatesInStoryboard","storyboard","isUniq","uniq","getDepsOfTemplates","templates","templatePackages","templateMap","reduce","m","test","filePath","namespace","split","console","error","arr","find","getTemplateDepsOfStoryboard","hasOwnProperty","object","property","prototype","call","asyncProcessBrick","_asyncToGenerator","templateRegistry","$$resolved","length","$$params","cloneDeep","params","updatedBrickConf","processedTemplates","includes","Error","PUBLIC_ROOT","brick","properties","lifeCycle","hasIf","rawIf","if","keys","key","assign","$$template","$$lifeCycle","$$if","asyncProcessBricks","asyncProcessRoutes","menuBrickConf","asyncProcessStoryboard","computeRealRoutePath","path","app","warn","p","replace","homepage","createProviderClass","api","HTMLElement","_defineProperty","$$typeof","_dev_only_definedProperties","updateArgs","event","setArgs","detail","updateArgsAndExecute","execute","patch","value","entries","args","setArgsAndExecute","executeWithArgs","saveAs","filename","blob","result","__assign","t","s","i","n","arguments","apply","lowerCase","str","toLowerCase","DEFAULT_SPLIT_REGEXP","DEFAULT_STRIP_REGEXP","noCase","input","options","splitRegexp","_b","stripRegexp","_c","transform","_d","delimiter","start","charAt","slice","join","re","RegExp","dotCase","paramCase","ExecutionContext","constructor","EnvironmentRecord","outer","OuterEnv","HasBinding","name","bindingMap","CreateMutableBinding","deletable","mutable","NormalCompletion","undefined","CreateImmutableBinding","strict","InitializeBinding","binding","initialized","SetMutableBinding","ReferenceError","TypeError","GetBindingValue","DeclarativeEnvironment","FunctionEnvironment","SourceNode","Symbol","for","FormalParameters","ECMAScriptCode","Environment","IsConstructor","ReferenceRecord","base","referenceName","Base","ReferenceName","Strict","CompletionRecord","Type","Value","Empty","collectBoundNames","root","names","collect","node","declarations","id","elements","left","argument","from","containsExpression","some","computed","collectScopedDeclarations","nextOptions","var","Number","topLevel","kind","consequent","body","alternate","init","cases","block","handler","finalizer","IsPropertyReference","V","InitializeReferencedBinding","W","CopyDataProperties","target","source","excludedItems","getOwnPropertyNames","concat","getOwnPropertySymbols","nextKey","desc","getOwnPropertyDescriptor","enumerable","ForDeclarationBindingInstantiation","forDeclaration","env","isConst","LoopContinues","completion","UpdateEmpty","GetValue","ToPropertyKey","arg","String","GetV","P","PutValue","CreateListIteratorRecord","isIterable","iterator","RequireObjectCoercible","GetIdentifierReference","ApplyStringOrNumericBinaryOperator","leftValue","operator","rightValue","SyntaxError","ApplyStringOrNumericAssignment","substr","ApplyUnaryOperator","cooked","getGlobal","self","global","reservedObjects","WeakSet","Function","sanitize","allowedConstructors","URLSearchParams","WeakMap","isAllowedConstructor","Date","cook","rootAst","codeSource","rules","globalVariables","hooks","expressionOnly","rootEnv","rootContext","VariableEnvironment","LexicalEnvironment","executionContextStack","TemplateMap","GetTemplateObject","templateLiteral","memo","rawObj","quasis","quasi","raw","freeze","defineProperty","writable","configurable","Evaluate","optionalChainRef","beforeEvaluate","_hooks$beforeEvaluate","array","element","spreadValues","ThrowIfFunctionIsInvalid","closure","InstantiateArrowFunctionExpression","leftRef","rightRef","right","funcName","substring","thisValue","ref","callee","func","optional","skipped","EvaluateCall","expression","ResolveBinding","regex","flags","baseReference","baseValue","EvaluatePropertyAccessWithExpressionKey","EvaluatePropertyAccessWithIdentifierKey","EvaluateNew","prop","fromValue","propName","EvaluateComputedPropertyName","expr","expressions","chunks","index","val","tagRef","tag","tagFunc","deleteStatus","lref","rref","rval","DestructuringAssignmentEvaluation","lval","r","oldEnv","getRunningContext","blockEnv","BlockDeclarationInstantiation","blockValue","EvaluateStatementList","EvaluateBreakableStatement","DoWhileLoopEvaluation","ForInOfLoopEvaluation","ForLoopEvaluation","InstantiateOrdinaryFunctionExpression","beforeBranch","_hooks$beforeBranch","_hooks$beforeBranch2","v","exprRef","lhs","oldValue","newValue","discriminant","switchValue","R","CaseBlockEvaluation","_hooks$beforeEvaluate2","CatchClauseEvaluation","F","declarator","bindingId","rhs","BindingInitialization","WhileLoopEvaluation","thrownValue","catchEnv","argName","param","B","stmtResult","defaultCaseIndex","findIndex","switchCase","hasDefaultCase","A","found","C","CaseClauseIsSelected","foundInB","clauseSelector","exprValue","isVariableDeclaration","lhsKind","uninitializedBoundNames","iterationKind","keyResult","ForInOfHeadEvaluation","ForInOfBodyEvaluation","runningContext","newEnv","EnumerateObjectProperties","stmt","iteratorRecord","destructuring","done","nextValue","next","lhsRef","iterationEnv","lhsName","status","return","innerResult","_node$init","ForBodyEvaluation","update","loopEnv","boundNames","dn","perIterationLets","bodyResult","increment","perIterationBindings","CreatePerIterationEnvironment","testRef","testValue","incRef","lastIterationEnv","thisIterationEnv","bn","lastValue","pattern","PropertyDestructuringAssignmentEvaluation","IteratorDestructuringAssignmentEvaluation","excludedNames","valueTarget","defaultValue","KeyedDestructuringAssignmentEvaluation","RestDestructuringAssignmentEvaluation","propertyName","assignmentTarget","isObjectOrArray","rhsValue","restProperty","restObj","propertyNameReference","propertyNameValue","propertyKey","identifier","propertyNameString","code","d","IsConstantDeclaration","fn","fo","InstantiateFunctionObject","argList","ArgumentListEvaluation","constructExpr","constructorName","CallFunction","beforeCall","_hooks$beforeCall","PrepareForOrdinaryCall","OrdinaryCallEvaluateBody","pop","calleeContext","localEnv","EvaluateFunctionBody","FunctionDeclarationInstantiation","statements","formals","parameterNames","hasParameterExpressions","varDeclarations","varNames","functionNames","functionsToInitialize","unshift","noVar","paramName","IteratorBindingInitialization","varEnv","initialValue","lexEnv","lexDeclarations","f","scope","OrdinaryFunctionCreate","functionExpression","funcEnv","arrowFunction","sourceNode","isConstructor","defineProperties","environment","InitializeBoundName","PropertyBindingInitialization","RestBindingInitialization","KeyedBindingInitialization","bindingElement","isIdentifier","async","generator","_hooks$beforeEvaluate3","Position","column","line","col","SourceLocation","identifierName","position","parseAsEstreeExpression","parseExpression","plugins","proposal","attachComment","parseAsEstree","typescript","file","parse","filter","Boolean","strictMode","program","jsNodes","startsWith","parseForAnalysis","tokens","sourceType","AnalysisContext","AnalysisEnvironment","bindingSet","CreateBinding","precook","visitors","withParent","attemptToVisitGlobals","analysisContextStack","visit","EvaluateChildren","parent","_objectSpread","beforeVisit","_hooks$beforeVisit","beforeVisitGlobal","_hooks$beforeVisitGlo","BoundNamesInstantiation","lexicalBinding","silent","beforeVisitUnknown","_hooks$beforeVisitUnk","PrepareOrdinaryCall","lint","errors","message","loc","isFunctionDeclaration","precookFunction","restOptions","_objectWithoutProperties","function","preevaluate","fixes","suffix","isEvaluable","shouldAllowRecursiveEvaluations","PrecookVisitor","Proxy","noop","PrecookFunctionVisitor","isObject","visitStoryboardFunctions","functions","visitStoryboardExpressions","data","matchExpressionString","visitNonExpressionString","visitObject","PROCESSORS","scanProcessorsInStoryboard","scanProcessorsInAny","meta","customTemplates","beforeVisitProcessorsFactory","beforeVisitProcessors","memberParent","outerMemberParent","parseStoryboard","parseRoutes","parseTemplates","_storyboard$meta","route","routesOnly","context","parseContext","redirect","parseResolvable","parseMenu","providers","parseRouteProviders","defineResolves","children","parseBricks","parseTemplate","tpl","state","parseBrick","isUseBrick","parseCondition","events","parseEvents","parseLifeCycles","parseBrickProperties","parseSlots","condition","props","useBrick","useBackend","walkBrickProperties","rawContainer","rawKey","provider","_value$useBackend","_ref","conf","resolves","handlers","parseEventHandlers","_ref2","slot","childrenType","_ref3","eventType","contexts","onChange","isConditional","callback","parseEventCallback","_ref4","callbackType","traverseStoryboard","ast","traverseNode","traverse","nodeOrNodes","traverseNodes","nodes","childPath","process","NODE_ENV","scanStoryboard","scanStoryboardAst","keepDuplicates","ignoreBricksInUnusedCustomTemplates","selfDefined","tplMap","collectionByTpl","customApis","usedTemplates","definedTemplates","useProvider","collectBricksInBrickConf","collectBricksByCustomTemplates","getDllAndDepsOfStoryboard","brickPackages","getDllAndDepsByResource","processors","getBrickToPackageMap","isEmpty","getDllAndDepsOfBricks","dll","deps","brickMap","dllName","dllPath","DLL_PATH","editorBricks","isProcessor","changeCase","editor","editorsJsFilePath","lexer","char","j","charCodeAt","count","prefixes","defaultPattern","escapeString","tryConsume","mustConsume","nextType","consumeText","indexOf","modifier","open","name_1","pattern_1","compile","tokensToFunction","reFlags","encode","x","validate","matches","token","repeat","segment","typeOfMessage","sensitive","regexpToRegexp","groupsRegex","execResult","exec","arrayToRegexp","paths","parts","stringToRegexp","tokensToRegexp","_e","_f","endsWith","endsWithRe","delimiterRe","tokens_1","_i","mod","endToken","isEndDelimited","pathToRegexp","cacheLimit","cacheCount","compilePath","cacheKey","pathCache","regexp","matchPath","pathname","exact","checkIf","getContext","matched","match","url","isExact","initialParams","toPath","pathParams","restoreDynamicTemplatesInBrick","restoreDynamicTemplatesInBricks","restoreDynamicTemplatesInRoutes","restoreDynamicTemplates","scanBricksInStoryboard","scanBricksInBrickConf","PERMISSIONS","check","scanPermissionActionsInStoryboard","beforeVisitPermissions","beforeVisitPermissionsFactory","scanPermissionActionsInAny","callParent","scanRouteAliasInStoryboard","alias","I18N","scanI18NInStoryboard","beforeVisitI18n","beforeVisitI18nFactory","menus","scanI18NInAny","keyNode","defaultNode","valueSet","APP","GET_MENUS","scanAppGetMenuInStoryboard","beforeVisitAppFactory","scanAppGetMenuInAny","beforeVisitAPP","menuId","LexicalStatus","TokenType","JsonValueType","getRegExpOfPlaceholder","symbols","symbol","escapeRegExp","tokenize","beginPlaceholder","cursor","Initial","eatOptionalRawAndOptionalPlaceholderBegin","ExpectField","eatWhitespace","eatField","ExpectOptionalBeginDefault","eatOptionalDefault","ExpectDefaultValue","eatDefaultValue","ExpectOptionalBeginPipe","eatOptionalBeginPipe","ExpectPipeIdentifier","eatPipeIdentifier","ExpectOptionalBeginPipeParameter","eatOptionalBeginPipeParameter","ExpectPipeParameter","eatPipeParameter","ExpectPlaceholderEnd","eatPlaceholderEnd","subRaw","getSubRaw","matchedPlaceholder","subCursor","nextCursor","Raw","BeginPlaceHolder","Field","BeginDefault","eatJsonValueOrLiteralString","BeginPipe","JSON","stringify","PipeIdentifier","BeginPipeParameter","EndPlaceHolder","jsonLiteralMap","nextStatus","eatJsonValue","JsonValue","LiteralString","firstChar","valueType","Others","objectBracesToMatch","arrayBracketsToMatch","stringQuotesToClose","stringBackslashToEscape","parseInjectableString","parseTokens","tree","optionalToken","shift","acceptToken","placeholder","field","pipes","pipe","parameters","inject","transformAndInject","isInjectable","transformNode","transformNodeFactory","injectNode","injectNodeFactory","reduceCompiledValues","processPipes","_full","subField","anchor","SimpleContextMap","HASH","SYS","FLAGS","contextItem","query","getAll","overrideApp","hash","storyboardContext","formatUnitValue","formatValue","convertUnitValueByPrecision","convertValueByPrecision","utils","resolveContextConcurrently","contextConfs","resolveContext","keyword","dependencyMap","getDependencyMapOfContext","pendingDeps","contextConf","includesComputed","stats","processed","wrapResolve","resolved","delete","scheduleNext","scheduleAsSerial","readyContexts","predicateNextResolveFactory","entry","size","detectCircularContexts","syncResolveContextConcurrently","dep","dependencies","depsMap","beforeVisitContextFactory","beforeVisitContext","memberNode","duplicatedMap","processedAtLeastOne","scanCustomApisInStoryboard","mapCustomApisToNameAndNamespace","smartDisplayForEvaluableString","rawString","nonStringFallback","unknownEvaluationFallback","i18nData","JsonStorage","storage","setItem","getItem","removeItem","clear","isRouteNode","isBrickNode","isCustomTemplateNode","isSnippetNode","jsonFieldsInRoute","yamlFieldsInRoute","jsonFieldsInBrick","yamlFieldsInBrick","fieldsToRemoveInRoute","fieldsToRemoveInBrick","disposableNullFields","normalizeBuilderNode","normalize","fieldsToRemove","jsonFields","yamlFields","fromEntries","getCleanSegues","safeJsonParse","safeYamlParse","string","segues","segue","yaml","safeLoad","schema","JSON_SCHEMA","json","fieldsToKeepInMenu","fieldsToKeepInMenuItem","normalizeMenu","keep","items","keepItems","fieldsToKeep","deepFreeze","propNames","trackContext","track","trackState","trackFormState","trackUsedContext","trackUsed","trackUsedState","trackText","variableName","trackCtxExp","debounceByAnimationFrame","frame","cancelAnimationFrame","requestAnimationFrame","INSTALLED_APPS","scanInstalledAppsInStoryboard","beforeVisitInstalledApps","beforeVisitInstalledAppsFactory","poolMap","makeThrottledAggregation","request","select","wait","pool","current","fullIds","enqueue","aggregatedIds","setTimeout","then","cached","removeDeadConditions","$$deadConditionsRemoved","removeDeadConditionsByAst","computeConstantCondition","conditionalNodes","deleteEmptyArray","shakeConditionalNodes","removedNodes","remove","removeDeadConditionsInTpl","tplConstructor","ifContainer","constantFeatureFlags","featureFlags","hasDynamicVariables","isConstantLogical","originalIf","expect"],"mappings":";;;;;;;;;;;;;;;EAAA,IAAMA,OAAK,GAAG,IAAIC,GAAG,EAA2B,CAAA;EAIzC,SAASC,UAAU,CACxBC,GAAsB,EACtBC,MAAe,EACa;EAC5B,EAAA,IAAIC,KAAK,CAACC,OAAO,CAACH,GAAG,CAAC,EAAE;EACtB,IAAA,OAAOI,OAAO,CAACC,GAAG,CAChBL,GAAG,CAACM,GAAG,CAAmBC,IAAI,IAAKR,UAAU,CAACQ,IAAI,EAAEN,MAAM,CAAC,CAAC,CAC7D,CAAA;EACH,GAAA;IACA,IAAMO,QAAQ,GAAGP,MAAM,GAAA,EAAA,CAAA,MAAA,CAAMA,MAAM,CAAGD,CAAAA,MAAAA,CAAAA,GAAG,IAAKA,GAAG,CAAA;EACjD,EAAA,IAAIH,OAAK,CAACY,GAAG,CAACD,QAAQ,CAAC,EAAE;EACvB,IAAA,OAAOX,OAAK,CAACa,GAAG,CAACF,QAAQ,CAAC,CAAA;EAC5B,GAAA;IACA,IAAMG,OAAO,GAAG,IAAIP,OAAO,CAAS,CAACQ,OAAO,EAAEC,MAAM,KAAK;MACvD,IAAMC,GAAG,GAAG,MAAY;QACtBC,MAAM,CAACC,aAAa,CAAC,IAAIC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;OACrD,CAAA;EACD,IAAA,IAAMC,MAAM,GAAGC,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC,CAAA;MAC/CF,MAAM,CAAClB,GAAG,GAAGQ,QAAQ,CAAA;MACrBU,MAAM,CAACG,MAAM,GAAG,MAAM;QACpBT,OAAO,CAACJ,QAAQ,CAAC,C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C88B,YAAY,CAACzyB,IAAI,CAACxI,QAAQ,CAACiG,IAAI,CAAC,KAAKo1B,MAAM,CAAC,CAAA;EACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.bundle.js","sources":["../src/loadScript.ts","../src/getTemplateDepsOfStoryboard.ts","../src/hasOwnProperty.ts","../src/asyncProcessStoryboard.ts","../src/computeRealRoutePath.ts","../src/createProviderClass.ts","../../../node_modules/tslib/tslib.es6.js","../../../node_modules/lower-case/dist.es2015/index.js","../../../node_modules/no-case/dist.es2015/index.js","../../../node_modules/dot-case/dist.es2015/index.js","../../../node_modules/param-case/dist.es2015/index.js","../../cook/dist/esm/ExecutionContext.js","../../cook/dist/esm/traverse.js","../../cook/dist/esm/context-free.js","../../cook/dist/esm/sanitize.js","../../cook/dist/esm/cook.js","../../../node_modules/@babel/parser/lib/index.js","../../cook/dist/esm/parse.js","../../cook/dist/esm/hasOwnProperty.js","../../cook/dist/esm/AnalysisContext.js","../../cook/dist/esm/precook.js","../../cook/dist/esm/lint.js","../../cook/dist/esm/precookFunction.js","../../cook/dist/esm/preevaluate.js","../src/cook/index.ts","../src/isObject.ts","../src/visitStoryboard.ts","../src/scanProcessorsInStoryboard.ts","../../storyboard/dist/esm/parseStoryboard.js","../../storyboard/dist/esm/traverseStoryboard.js","../src/scanStoryboard.ts","../src/getDllAndDepsOfStoryboard.ts","../../../node_modules/path-to-regexp/dist.es2015/index.js","../src/matchPath.ts","../src/restoreDynamicTemplates.ts","../src/scanBricksInStoryboard.ts","../src/scanPermissionActionsInStoryboard.ts","../src/scanAliasInStoryboard.ts","../src/scanI18NInStoryboard.ts","../src/scanAppInStoryboard.ts","../src/placeholder/interfaces.ts","../src/placeholder/lexical.ts","../src/placeholder/syntax.ts","../src/placeholder/compile.ts","../src/placeholder/index.ts","../src/resolveContextConcurrently.ts","../src/scanCustomApisInStoryboard.ts","../src/smartDisplayForEvaluableString.ts","../src/JsonStorage.ts","../src/builder/assertions.ts","../src/builder/normalizeBuilderNode.ts","../src/builder/normalizeMenu.ts","../src/deepFreeze.ts","../src/track.ts","../src/debounceByAnimationFrame.ts","../src/scanInstalledAppsInStoryboard.ts","../src/makeThrottledAggregation.ts","../src/removeDeadConditions.ts"],"sourcesContent":["const cache = new Map<string, Promise<string>>();\n\nexport function loadScript(src: string, prefix?: string): Promise<string>;\nexport function loadScript(src: string[], prefix?: string): Promise<string[]>;\nexport function loadScript(\n src: string | string[],\n prefix?: string\n): Promise<string | string[]> {\n if (Array.isArray(src)) {\n return Promise.all(\n src.map<Promise<string>>((item) => loadScript(item, prefix))\n );\n }\n const fixedSrc = prefix ? `${prefix}${src}` : src;\n if (cache.has(fixedSrc)) {\n return cache.get(fixedSrc);\n }\n const promise = new Promise<string>((resolve, reject) => {\n const end = (): void => {\n window.dispatchEvent(new CustomEvent(\"request.end\"));\n };\n const script = document.createElement(\"script\");\n script.src = fixedSrc;\n script.onload = () => {\n resolve(fixedSrc);\n end();\n };\n script.onerror = (e) => {\n reject(e);\n end();\n };\n const firstScript =\n document.currentScript || document.getElementsByTagName(\"script\")[0];\n firstScript.parentNode.insertBefore(script, firstScript);\n window.dispatchEvent(new CustomEvent(\"request.start\"));\n });\n cache.set(fixedSrc, promise);\n return promise;\n}\n\nconst prefetchCache = new Set<string>();\n\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ\nexport function prefetchScript(src: string | string[], prefix?: string): void {\n if (Array.isArray(src)) {\n for (const item of src) {\n prefetchScript(item, prefix);\n }\n return;\n }\n const fixedSrc = prefix ? `${prefix}${src}` : src;\n // Ignore scripts which already prefetched or loaded.\n if (prefetchCache.has(fixedSrc) || cache.has(fixedSrc)) {\n return;\n }\n prefetchCache.add(fixedSrc);\n const link = document.createElement(\"link\");\n link.rel = \"prefetch\";\n link.href = fixedSrc;\n document.head.appendChild(link);\n}\n","import {\n Storyboard,\n RouteConf,\n BrickConf,\n TemplatePackage,\n RouteConfOfBricks,\n} from \"@next-core/brick-types\";\nimport { uniq } from \"lodash\";\n\nexport function scanTemplatesInBrick(\n brickConf: BrickConf,\n collection: string[]\n): void {\n if (brickConf.template) {\n collection.push(brickConf.template);\n }\n if (brickConf.slots) {\n Object.values(brickConf.slots).forEach((slotConf) => {\n if (slotConf.type === \"bricks\") {\n scanTemplatesInBricks(slotConf.bricks, collection);\n } else {\n scanTemplatesInRoutes(slotConf.routes, collection);\n }\n });\n }\n if (Array.isArray(brickConf.internalUsedTemplates)) {\n brickConf.internalUsedTemplates.forEach((template) => {\n collection.push(template);\n });\n }\n}\n\nfunction scanTemplatesInBricks(\n bricks: BrickConf[],\n collection: string[]\n): void {\n if (Array.isArray(bricks)) {\n bricks.forEach((brickConf) => {\n scanTemplatesInBrick(brickConf, collection);\n });\n }\n}\n\nfunction scanTemplatesInRoutes(\n routes: RouteConf[],\n collection: string[]\n): void {\n if (Array.isArray(routes)) {\n routes.forEach((routeConf) => {\n if (routeConf.type === \"routes\") {\n scanTemplatesInRoutes(routeConf.routes, collection);\n } else {\n scanTemplatesInBricks(\n (routeConf as RouteConfOfBricks).bricks,\n collection\n );\n }\n const brickConf = routeConf.menu;\n if (brickConf && brickConf.type === \"brick\") {\n scanTemplatesInBrick(brickConf, collection);\n }\n });\n }\n}\n\nexport function scanTemplatesInStoryboard(\n storyboard: Storyboard,\n isUniq = true\n): string[] {\n const collection: string[] = [];\n scanTemplatesInRoutes(storyboard.routes, collection);\n return isUniq ? uniq(collection) : collection;\n}\n\nexport function getDepsOfTemplates(\n templates: string[],\n templatePackages: TemplatePackage[]\n): string[] {\n const templateMap: Map<string, TemplatePackage> = templatePackages.reduce(\n (m, item) => {\n if (/^templates\\/.*\\/dist\\/.*\\.js$/.test(item.filePath)) {\n const namespace = item.filePath.split(\"/\")[1];\n m.set(namespace, item);\n } else {\n // eslint-disable-next-line no-console\n console.error(\n `the file path of template is \\`${item.filePath}\\` and it is non-standard package path`\n );\n }\n return m;\n },\n new Map()\n );\n\n return templates.reduce((arr, template) => {\n const namespace = template.split(\".\")[0];\n const find = templateMap.get(namespace);\n if (find) {\n arr.push(find.filePath);\n } else {\n // eslint-disable-next-line no-console\n console.error(\n `the name of template is \\`${template}\\` and it don't match any template package`\n );\n }\n\n return arr;\n }, []);\n}\n\nexport function getTemplateDepsOfStoryboard(\n storyboard: Storyboard,\n templatePackages: TemplatePackage[]\n): string[] {\n return getDepsOfTemplates(\n scanTemplatesInStoryboard(storyboard),\n templatePackages\n );\n}\n","export function hasOwnProperty(\n object: object,\n property: string | number | symbol\n): boolean {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n","import { get, cloneDeep } from \"lodash\";\nimport {\n Storyboard,\n RouteConf,\n RuntimeBrickConf,\n BrickTemplateFactory,\n TemplateRegistry,\n TemplatePackage,\n RouteConfOfBricks,\n} from \"@next-core/brick-types\";\nimport { loadScript } from \"./loadScript\";\nimport { getDepsOfTemplates } from \"./getTemplateDepsOfStoryboard\";\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport async function asyncProcessBrick(\n brickConf: RuntimeBrickConf,\n templateRegistry: TemplateRegistry<BrickTemplateFactory>,\n templatePackages: TemplatePackage[]\n): Promise<void> {\n if (brickConf.template) {\n if (\n !brickConf.$$resolved &&\n get(brickConf, [\"lifeCycle\", \"useResolves\"], []).length > 0\n ) {\n // Leave these dynamic templates to `LocationContext::resolve()`.\n // Remember original params, since it maybe changed when resolving.\n brickConf.$$params = cloneDeep(brickConf.params);\n } else {\n let updatedBrickConf: Partial<RuntimeBrickConf> = brickConf;\n const processedTemplates: string[] = [];\n // If a template returns a template, keep on loading template,\n // until finally it returns a brick.\n while (updatedBrickConf.template) {\n // Forbid recursive templates.\n if (processedTemplates.includes(updatedBrickConf.template)) {\n throw new Error(\n `Recursive template found: ${updatedBrickConf.template}`\n );\n }\n processedTemplates.push(updatedBrickConf.template);\n\n if (!templateRegistry.has(updatedBrickConf.template)) {\n await loadScript(\n getDepsOfTemplates([updatedBrickConf.template], templatePackages),\n window.PUBLIC_ROOT\n );\n }\n if (templateRegistry.has(updatedBrickConf.template)) {\n updatedBrickConf = templateRegistry.get(updatedBrickConf.template)(\n updatedBrickConf.params\n );\n } else {\n updatedBrickConf = {\n brick: \"basic-bricks.page-error\",\n properties: {\n error: `Template not found: ${brickConf.template}`,\n },\n };\n }\n }\n // Cleanup brickConf and remember original data for restore.\n const { template, lifeCycle, $$params, params } = brickConf;\n const hasIf = hasOwnProperty(brickConf, \"if\");\n const rawIf = brickConf.if;\n Object.keys(brickConf).forEach((key) => {\n delete brickConf[key as keyof RuntimeBrickConf];\n });\n Object.assign(\n brickConf,\n updatedBrickConf,\n {\n $$template: template,\n $$params: $$params || cloneDeep(params),\n $$lifeCycle: lifeCycle,\n },\n hasIf ? { $$if: rawIf } : {}\n );\n }\n }\n if (brickConf.slots) {\n await Promise.all(\n Object.values(brickConf.slots).map(async (slotConf) => {\n if (slotConf.type === \"bricks\") {\n await asyncProcessBricks(\n slotConf.bricks,\n templateRegistry,\n templatePackages\n );\n } else {\n await asyncProcessRoutes(\n slotConf.routes,\n templateRegistry,\n templatePackages\n );\n }\n })\n );\n }\n}\n\nasync function asyncProcessBricks(\n bricks: RuntimeBrickConf[],\n templateRegistry: TemplateRegistry<BrickTemplateFactory>,\n templatePackages: TemplatePackage[]\n): Promise<void> {\n if (Array.isArray(bricks)) {\n await Promise.all(\n bricks.map(async (brickConf) => {\n await asyncProcessBrick(brickConf, templateRegistry, templatePackages);\n })\n );\n }\n}\n\nasync function asyncProcessRoutes(\n routes: RouteConf[],\n templateRegistry: TemplateRegistry<BrickTemplateFactory>,\n templatePackages: TemplatePackage[]\n): Promise<void> {\n if (Array.isArray(routes)) {\n await Promise.all(\n routes.map(async (routeConf) => {\n if (routeConf.type === \"routes\") {\n await asyncProcessRoutes(\n routeConf.routes,\n templateRegistry,\n templatePackages\n );\n } else {\n await asyncProcessBricks(\n (routeConf as RouteConfOfBricks).bricks,\n templateRegistry,\n templatePackages\n );\n }\n const menuBrickConf = routeConf.menu;\n if (menuBrickConf && menuBrickConf.type === \"brick\") {\n await asyncProcessBrick(\n menuBrickConf,\n templateRegistry,\n templatePackages\n );\n }\n })\n );\n }\n}\n\nexport async function asyncProcessStoryboard(\n storyboard: Storyboard,\n templateRegistry: TemplateRegistry<BrickTemplateFactory>,\n templatePackages: TemplatePackage[]\n): Promise<Storyboard> {\n await asyncProcessRoutes(\n storyboard.routes,\n templateRegistry,\n templatePackages\n );\n return storyboard;\n}\n","import { MicroApp } from \"@next-core/brick-types\";\n\nexport function computeRealRoutePath(\n path: string | string[],\n app: MicroApp\n): string | string[] {\n if (Array.isArray(path)) {\n // eslint-disable-next-line no-console\n console.warn(\"Set route's path to an array is deprecated\");\n return path.map((p) => computeRealRoutePath(p, app) as string);\n }\n if (typeof path !== \"string\") {\n return;\n }\n return path.replace(\"${APP.homepage}\", app?.homepage);\n}\n","import { set } from \"lodash\";\nimport { saveAs } from \"file-saver\";\n\ninterface ProviderElement<P extends unknown[], R> extends HTMLElement {\n args: P;\n\n updateArgs: (event: CustomEvent<Record<string, unknown>>) => void;\n\n updateArgsAndExecute: (\n event: CustomEvent<Record<string, unknown>>\n ) => Promise<R>;\n\n setArgs: (patch: Record<string, unknown>) => void;\n\n setArgsAndExecute: (patch: Record<string, unknown>) => Promise<R>;\n\n execute(): Promise<R>;\n\n executeWithArgs(...args: P): Promise<R>;\n\n saveAs(filename: string, ...args: P): Promise<void>;\n\n resolve(...args: P): R;\n}\n\nexport function createProviderClass<T extends unknown[], U>(\n api: (...args: T) => U\n): { new (): ProviderElement<T, U> } {\n return class extends HTMLElement {\n get $$typeof(): string {\n return \"provider\";\n }\n\n static get _dev_only_definedProperties(): string[] {\n return [\"args\"];\n }\n\n args = [] as T;\n\n updateArgs(event: CustomEvent<Record<string, unknown>>): void {\n if (!(event instanceof CustomEvent)) {\n // eslint-disable-next-line no-console\n console.warn(\n \"`updateArgs/updateArgsAndExecute` is designed to receive an CustomEvent, if not, please use `setArgs/setArgsAndExecute` instead.\"\n );\n }\n this.setArgs(event.detail);\n }\n\n updateArgsAndExecute(\n event: CustomEvent<Record<string, unknown>>\n ): Promise<U> {\n this.updateArgs(event);\n return this.execute();\n }\n\n setArgs(patch: Record<string, unknown>): void {\n for (const [path, value] of Object.entries(patch)) {\n set(this.args, path, value);\n }\n }\n\n setArgsAndExecute(patch: Record<string, unknown>): Promise<U> {\n this.setArgs(patch);\n return this.execute();\n }\n\n execute(): Promise<U> {\n return this.executeWithArgs(...this.args);\n }\n\n async saveAs(filename: string, ...args: T): Promise<void> {\n const blob = await api(...args);\n saveAs((blob as unknown) as Blob, filename);\n }\n\n async executeWithArgs(...args: T): Promise<U> {\n try {\n const result = await api(...args);\n this.dispatchEvent(\n new CustomEvent(\"response.success\", {\n detail: result,\n })\n );\n return result;\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(\"response.error\", {\n detail: error,\n })\n );\n return Promise.reject(error);\n }\n }\n\n resolve(...args: T): U {\n return api(...args);\n }\n };\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nvar SUPPORTED_LOCALE = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"\\u0069\\u0307\",\n J: \"\\u006A\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"\\u0069\\u0307\\u0300\",\n Í: \"\\u0069\\u0307\\u0301\",\n Ĩ: \"\\u0069\\u0307\\u0303\",\n },\n },\n};\n/**\n * Localized lower case.\n */\nexport function localeLowerCase(str, locale) {\n var lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang)\n return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));\n return lowerCase(str);\n}\n/**\n * Lower case as a function.\n */\nexport function lowerCase(str) {\n return str.toLowerCase();\n}\n//# sourceMappingURL=index.js.map","import { lowerCase } from \"lower-case\";\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\nvar DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n// Remove all non-word characters.\nvar DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\nexport function noCase(input, options) {\n if (options === void 0) { options = {}; }\n var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? \" \" : _d;\n var result = replace(replace(input, splitRegexp, \"$1\\0$2\"), stripRegexp, \"\\0\");\n var start = 0;\n var end = result.length;\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\")\n start++;\n while (result.charAt(end - 1) === \"\\0\")\n end--;\n // Transform each token independently.\n return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n/**\n * Replace `re` in the input string with the replacement value.\n */\nfunction replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nexport function dotCase(input, options) {\n if (options === void 0) { options = {}; }\n return noCase(input, __assign({ delimiter: \".\" }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { dotCase } from \"dot-case\";\nexport function paramCase(input, options) {\n if (options === void 0) { options = {}; }\n return dotCase(input, __assign({ delimiter: \"-\" }, options));\n}\n//# sourceMappingURL=index.js.map","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n// https://tc39.es/ecma262/#sec-execution-contexts\nexport class ExecutionContext {\n constructor() {\n _defineProperty(this, \"VariableEnvironment\", void 0);\n _defineProperty(this, \"LexicalEnvironment\", void 0);\n _defineProperty(this, \"Function\", void 0);\n }\n}\n// https://tc39.es/ecma262/#sec-environment-records\nexport class EnvironmentRecord {\n constructor(outer) {\n _defineProperty(this, \"OuterEnv\", void 0);\n _defineProperty(this, \"bindingMap\", new Map());\n this.OuterEnv = outer;\n }\n HasBinding(name) {\n return this.bindingMap.has(name);\n }\n CreateMutableBinding(name, deletable) {\n // Assert: binding does not exist.\n this.bindingMap.set(name, {\n mutable: true,\n deletable\n });\n return NormalCompletion(undefined);\n }\n\n /**\n * Create an immutable binding.\n *\n * @param name - The binding name.\n * @param strict - For named function expressions, strict is false, otherwise it's true.\n * @returns CompletionRecord.\n */\n CreateImmutableBinding(name, strict) {\n // Assert: binding does not exist.\n this.bindingMap.set(name, {\n strict\n });\n return NormalCompletion(undefined);\n }\n InitializeBinding(name, value) {\n var binding = this.bindingMap.get(name);\n // Assert: binding exists and uninitialized.\n Object.assign(binding, {\n initialized: true,\n value\n });\n return NormalCompletion(undefined);\n }\n\n /**\n * Update a mutable binding value, including function declarations.\n *\n * @param name - The binding name.\n * @param value - The binding value.\n * @param strict - For functions, strict is always false, otherwise it depends on strict-mode.\n * @returns\n */\n SetMutableBinding(name, value, strict) {\n var binding = this.bindingMap.get(name);\n // Assert: binding exists.\n if (!binding.initialized) {\n throw new ReferenceError(\"\".concat(name, \" is not initialized\"));\n } else if (binding.mutable) {\n binding.value = value;\n } else {\n throw new TypeError(\"Assignment to constant variable\");\n }\n return NormalCompletion(undefined);\n }\n GetBindingValue(name, strict) {\n var binding = this.bindingMap.get(name);\n // Assert: binding exists.\n if (!binding.initialized) {\n throw new ReferenceError(\"\".concat(name, \" is not initialized\"));\n }\n return binding.value;\n }\n}\nexport class DeclarativeEnvironment extends EnvironmentRecord {}\nexport class FunctionEnvironment extends EnvironmentRecord {}\nexport var SourceNode = Symbol.for(\"SourceNode\");\nexport var FormalParameters = Symbol.for(\"FormalParameters\");\nexport var ECMAScriptCode = Symbol.for(\"ECMAScriptCode\");\nexport var Environment = Symbol.for(\"Environment\");\nexport var IsConstructor = Symbol.for(\"IsConstructor\");\n// https://tc39.es/ecma262/#sec-reference-record-specification-type\nexport class ReferenceRecord {\n /** Whether the reference is in strict mode. */\n\n constructor(base, referenceName, strict) {\n _defineProperty(this, \"Base\", void 0);\n _defineProperty(this, \"ReferenceName\", void 0);\n _defineProperty(this, \"Strict\", void 0);\n this.Base = base;\n this.ReferenceName = referenceName;\n this.Strict = strict;\n }\n}\n\n// https://tc39.es/ecma262/#sec-completion-record-specification-type\nexport class CompletionRecord {\n constructor(type, value) {\n _defineProperty(this, \"Type\", void 0);\n _defineProperty(this, \"Value\", void 0);\n this.Type = type;\n this.Value = value;\n }\n}\n// https://tc39.es/ecma262/#sec-normalcompletion\nexport function NormalCompletion(value) {\n return new CompletionRecord(\"normal\", value);\n}\nexport var Empty = Symbol(\"empty completion\");\n//# sourceMappingURL=ExecutionContext.js.map","export function collectBoundNames(root) {\n var names = new Set();\n var collect = node => {\n if (Array.isArray(node)) {\n for (var n of node) {\n collect(n);\n }\n } else if (node) {\n // `node` maybe `null` in some cases.\n switch (node.type) {\n case \"Identifier\":\n names.add(node.name);\n return;\n case \"VariableDeclaration\":\n return collect(node.declarations);\n case \"VariableDeclarator\":\n return collect(node.id);\n case \"ArrayPattern\":\n return collect(node.elements);\n case \"AssignmentPattern\":\n return collect(node.left);\n case \"ObjectPattern\":\n return collect(node.properties);\n case \"Property\":\n return collect(node.value);\n case \"RestElement\":\n return collect(node.argument);\n case \"FunctionDeclaration\":\n return collect(node.id);\n }\n }\n };\n collect(root);\n return Array.from(names);\n}\nexport function containsExpression(root) {\n var collect = node => {\n if (Array.isArray(node)) {\n return node.some(collect);\n } else if (node) {\n // `node` maybe `null` in some cases.\n switch (node.type) {\n case \"ArrayPattern\":\n return collect(node.elements);\n case \"AssignmentPattern\":\n return true;\n case \"ObjectPattern\":\n return collect(node.properties);\n case \"Property\":\n return node.computed || collect(node.value);\n case \"RestElement\":\n return collect(node.argument);\n }\n }\n };\n return collect(root);\n}\nexport function collectScopedDeclarations(root, options) {\n var declarations = [];\n var nextOptions = {\n var: options.var\n };\n var collect = (node, options) => {\n if (Array.isArray(node)) {\n for (var n of node) {\n collect(n, options);\n }\n } else if (node) {\n // `node` maybe `null` in some cases.\n switch (node.type) {\n case \"FunctionDeclaration\":\n // At the top level of a function, or script, function declarations are\n // treated like var declarations rather than like lexical declarations.\n // See https://tc39.es/ecma262/#sec-static-semantics-toplevellexicallydeclarednames\n if (Number(!options.var) ^ Number(options.topLevel)) {\n declarations.push(node);\n }\n return;\n case \"VariableDeclaration\":\n if (Number(!options.var) ^ Number(node.kind === \"var\")) {\n declarations.push(node);\n }\n return;\n case \"SwitchCase\":\n collect(node.consequent, nextOptions);\n return;\n case \"CatchClause\":\n collect(node.body, nextOptions);\n return;\n }\n if (options.var) {\n switch (node.type) {\n case \"BlockStatement\":\n collect(node.body, nextOptions);\n return;\n case \"IfStatement\":\n collect(node.consequent, nextOptions);\n collect(node.alternate, nextOptions);\n return;\n case \"DoWhileStatement\":\n case \"WhileStatement\":\n collect(node.body, nextOptions);\n return;\n case \"ForStatement\":\n collect(node.init, nextOptions);\n collect(node.body, nextOptions);\n return;\n case \"ForInStatement\":\n case \"ForOfStatement\":\n collect(node.left, nextOptions);\n collect(node.body, nextOptions);\n return;\n case \"SwitchStatement\":\n collect(node.cases, nextOptions);\n return;\n case \"TryStatement\":\n collect(node.block, nextOptions);\n collect(node.handler, nextOptions);\n collect(node.finalizer, nextOptions);\n return;\n }\n }\n }\n };\n collect(root, options);\n return declarations;\n}\n//# sourceMappingURL=traverse.js.map","import { CompletionRecord, Empty, EnvironmentRecord, NormalCompletion, ReferenceRecord } from \"./ExecutionContext\";\nimport { collectBoundNames } from \"./traverse\";\n\n// https://tc39.es/ecma262/#sec-ispropertyreference\nexport function IsPropertyReference(V) {\n return V.Base !== \"unresolvable\" && !(V.Base instanceof EnvironmentRecord);\n}\n\n// https://tc39.es/ecma262/#sec-initializereferencedbinding\nexport function InitializeReferencedBinding(V, W) {\n var base = V.Base;\n return base.InitializeBinding(V.ReferenceName, W);\n}\n\n// https://tc39.es/ecma262/#sec-copydataproperties\nexport function CopyDataProperties(target, source, excludedItems) {\n if (source === undefined || source === null) {\n return target;\n }\n var keys = Object.getOwnPropertyNames(source).concat(Object.getOwnPropertySymbols(source));\n for (var nextKey of keys) {\n if (!excludedItems.has(nextKey)) {\n var desc = Object.getOwnPropertyDescriptor(source, nextKey);\n if (desc !== null && desc !== void 0 && desc.enumerable) {\n target[nextKey] = source[nextKey];\n }\n }\n }\n return target;\n}\n\n// https://tc39.es/ecma262/#sec-runtime-semantics-fordeclarationbindinginstantiation\nexport function ForDeclarationBindingInstantiation(forDeclaration, env) {\n var isConst = forDeclaration.kind === \"const\";\n for (var name of collectBoundNames(forDeclaration)) {\n if (isConst) {\n env.CreateImmutableBinding(name, true);\n } else {\n env.CreateMutableBinding(name, false);\n }\n }\n}\n\n// https://tc39.es/ecma262/#sec-loopcontinues\nexport function LoopContinues(completion) {\n return completion.Type === \"normal\" || completion.Type == \"continue\";\n}\n\n// https://tc39.es/ecma262/#sec-updateempty\nexport function UpdateEmpty(completion, value) {\n if (completion.Value !== Empty) {\n return completion;\n }\n return new CompletionRecord(completion.Type, value);\n}\n\n// https://tc39.es/ecma262/#sec-getvalue\nexport function GetValue(V) {\n if (V instanceof CompletionRecord) {\n // Assert: V.Type is normal.\n V = V.Value;\n }\n if (!(V instanceof ReferenceRecord)) {\n return V;\n }\n if (V.Base === \"unresolvable\") {\n throw new ReferenceError(\"\".concat(V.ReferenceName, \" is not defined\"));\n }\n if (V.Base instanceof EnvironmentRecord) {\n var base = V.Base;\n return base.GetBindingValue(V.ReferenceName, V.Strict);\n }\n return V.Base[V.ReferenceName];\n}\n\n// https://tc39.es/ecma262/#sec-topropertykey\nexport function ToPropertyKey(arg) {\n if (typeof arg === \"symbol\") {\n return arg;\n }\n return String(arg);\n}\n\n// https://tc39.es/ecma262/#sec-getv\nexport function GetV(V, P) {\n return V[P];\n}\n\n// https://tc39.es/ecma262/#sec-putvalue\nexport function PutValue(V, W) {\n // Assert: V is a ReferenceRecord.\n if (V.Base === \"unresolvable\") {\n throw new ReferenceError(\"\".concat(V.ReferenceName, \" is not defined\"));\n }\n if (V.Base instanceof EnvironmentRecord) {\n return V.Base.SetMutableBinding(V.ReferenceName, W, V.Strict);\n }\n V.Base[V.ReferenceName] = W;\n return NormalCompletion(undefined);\n}\n\n// https://tc39.es/ecma262/#sec-createlistiteratorRecord\nexport function CreateListIteratorRecord(args) {\n if (!isIterable(args)) {\n throw new TypeError(\"\".concat(typeof args, \" is not iterable\"));\n }\n return args[Symbol.iterator]();\n}\n\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nexport function RequireObjectCoercible(arg) {\n if (arg === null || arg === undefined) {\n throw new TypeError(\"Cannot destructure properties of undefined or null\");\n }\n}\n\n// https://tc39.es/ecma262/#sec-getidentifierreference\nexport function GetIdentifierReference(env, name, strict) {\n if (!env) {\n return new ReferenceRecord(\"unresolvable\", name, strict);\n }\n if (env.HasBinding(name)) {\n return new ReferenceRecord(env, name, strict);\n }\n return GetIdentifierReference(env.OuterEnv, name, strict);\n}\n\n// https://tc39.es/ecma262/#sec-applystringornumericbinaryoperator\nexport function ApplyStringOrNumericBinaryOperator(leftValue, operator, rightValue) {\n switch (operator) {\n case \"+\":\n return leftValue + rightValue;\n case \"-\":\n return leftValue - rightValue;\n case \"/\":\n return leftValue / rightValue;\n case \"%\":\n return leftValue % rightValue;\n case \"*\":\n return leftValue * rightValue;\n case \"**\":\n return leftValue ** rightValue;\n case \"==\":\n return leftValue == rightValue;\n case \"===\":\n return leftValue === rightValue;\n case \"!=\":\n return leftValue != rightValue;\n case \"!==\":\n return leftValue !== rightValue;\n case \">\":\n return leftValue > rightValue;\n case \"<\":\n return leftValue < rightValue;\n case \">=\":\n return leftValue >= rightValue;\n case \"<=\":\n return leftValue <= rightValue;\n }\n throw new SyntaxError(\"Unsupported binary operator `\".concat(operator, \"`\"));\n}\n\n// https://tc39.es/ecma262/#sec-assignment-operators\nexport function ApplyStringOrNumericAssignment(leftValue, operator, rightValue) {\n switch (operator) {\n case \"+=\":\n case \"-=\":\n case \"*=\":\n case \"/=\":\n case \"%=\":\n case \"**=\":\n return ApplyStringOrNumericBinaryOperator(leftValue, operator.substr(0, operator.length - 1), rightValue);\n }\n throw new SyntaxError(\"Unsupported assignment operator `\".concat(operator, \"`\"));\n}\n\n// https://tc39.es/ecma262/#sec-unary-operators\nexport function ApplyUnaryOperator(target, operator) {\n switch (operator) {\n case \"!\":\n return !target;\n case \"+\":\n return +target;\n case \"-\":\n return -target;\n case \"void\":\n return undefined;\n }\n throw new SyntaxError(\"Unsupported unary operator `\".concat(operator, \"`\"));\n}\nexport function isIterable(cooked) {\n if (Array.isArray(cooked)) {\n return true;\n }\n if (cooked === null || cooked === undefined) {\n return false;\n }\n return typeof cooked[Symbol.iterator] === \"function\";\n}\n//# sourceMappingURL=context-free.js.map","// Ref https://github.com/tc39/proposal-global\n// In addition, the es6-shim had to switch from Function('return this')()\n// due to CSP concerns, such that the current check to handle browsers,\n// node, web workers, and frames is:\n// istanbul ignore next\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction getGlobal() {\n // the only reliable means to get the global object is\n // `Function('return this')()`\n // However, this causes CSP violations in Chrome apps.\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\n\n/**\n * There are chances to construct a `Function` from a string, etc.\n * ```\n * ((a,b)=>a[b])(()=>1, 'constructor')('console.log(`yo`)')()\n * ```\n */\nvar reservedObjects = new WeakSet([\n// `Function(\"...\")` is considered *extremely vulnerable*.\nFunction,\n// `Object.assign()` is considered vulnerable.\nObject,\n// `prototype` is considered vulnerable.\nFunction.prototype, Object.prototype,\n// Global `window` is considered vulnerable, too.\ngetGlobal()]);\nexport function sanitize(cooked) {\n // eslint-disable-next-line @typescript-eslint/ban-types\n if (reservedObjects.has(cooked)) {\n throw new TypeError(\"Cannot access reserved objects such as `Function`.\");\n }\n}\nvar allowedConstructors = new WeakSet([Array, Map, Set, URLSearchParams, WeakMap, WeakSet]);\nexport function isAllowedConstructor(constructor) {\n // `Date` maybe mocked when running tests for storyboard functions.\n return allowedConstructors.has(constructor) || constructor === Date;\n}\n//# sourceMappingURL=sanitize.js.map","import { ApplyStringOrNumericAssignment, CreateListIteratorRecord, ApplyStringOrNumericBinaryOperator, GetV, GetValue, InitializeReferencedBinding, IsPropertyReference, LoopContinues, PutValue, RequireObjectCoercible, ToPropertyKey, UpdateEmpty, ApplyUnaryOperator, GetIdentifierReference, ForDeclarationBindingInstantiation, CopyDataProperties } from \"./context-free\";\nimport { CompletionRecord, DeclarativeEnvironment, ECMAScriptCode, Empty, Environment, ExecutionContext, FormalParameters, FunctionEnvironment, IsConstructor, NormalCompletion, ReferenceRecord, SourceNode } from \"./ExecutionContext\";\nimport { sanitize, isAllowedConstructor } from \"./sanitize\";\nimport { collectBoundNames, collectScopedDeclarations, containsExpression } from \"./traverse\";\n/** For next-core internal usage only. */\nexport function cook(rootAst, codeSource) {\n var _hooks$beforeEvaluate3;\n var {\n rules,\n globalVariables = {},\n hooks = {}\n } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var expressionOnly = rootAst.type !== \"FunctionDeclaration\";\n var rootEnv = new DeclarativeEnvironment(null);\n var rootContext = new ExecutionContext();\n rootContext.VariableEnvironment = rootEnv;\n rootContext.LexicalEnvironment = rootEnv;\n var executionContextStack = [rootContext];\n for (var [key, value] of Object.entries(globalVariables)) {\n rootEnv.CreateImmutableBinding(key, true);\n rootEnv.InitializeBinding(key, value);\n }\n var TemplateMap = new WeakMap();\n\n // https://tc39.es/ecma262/#sec-gettemplateobject\n function GetTemplateObject(templateLiteral) {\n var memo = TemplateMap.get(templateLiteral);\n if (memo) {\n return memo;\n }\n var rawObj = templateLiteral.quasis.map(quasi => quasi.value.raw);\n var template = templateLiteral.quasis.map(quasi => quasi.value.cooked);\n Object.freeze(rawObj);\n Object.defineProperty(template, \"raw\", {\n value: rawObj,\n writable: false,\n enumerable: false,\n configurable: false\n });\n Object.freeze(template);\n TemplateMap.set(templateLiteral, template);\n return template;\n }\n function Evaluate(node, optionalChainRef) {\n var _hooks$beforeEvaluate, _hooks$beforeBranch, _hooks$beforeBranch2;\n (_hooks$beforeEvaluate = hooks.beforeEvaluate) === null || _hooks$beforeEvaluate === void 0 ? void 0 : _hooks$beforeEvaluate.call(hooks, node);\n // Expressions:\n switch (node.type) {\n case \"ArrayExpression\":\n {\n // https://tc39.es/ecma262/#sec-array-initializer\n var array = [];\n for (var element of node.elements) {\n if (!element) {\n array.length += 1;\n } else if (element.type === \"SpreadElement\") {\n var spreadValues = GetValue(Evaluate(element.argument));\n array.push(...spreadValues);\n } else {\n array.push(GetValue(Evaluate(element)));\n }\n }\n return NormalCompletion(array);\n }\n case \"ArrowFunctionExpression\":\n {\n // https://tc39.es/ecma262/#sec-arrow-function-definitions\n ThrowIfFunctionIsInvalid(node);\n var closure = InstantiateArrowFunctionExpression(node);\n return NormalCompletion(closure);\n }\n case \"BinaryExpression\":\n {\n var leftRef = Evaluate(node.left);\n var leftValue = GetValue(leftRef);\n var rightRef = Evaluate(node.right).Value;\n var rightValue = GetValue(rightRef);\n if (expressionOnly && node.operator === \"|>\") {\n // Minimal pipeline operator is supported only in expression-only mode.\n // See https://tc39.es/proposal-pipeline-operator\n // and https://github.com/tc39/proposal-pipeline-operator\n if (typeof rightValue !== \"function\") {\n var funcName = codeSource.substring(node.right.start, node.right.end);\n throw new TypeError(\"\".concat(funcName, \" is not a function\"));\n }\n var thisValue;\n if (rightRef instanceof ReferenceRecord) {\n if (IsPropertyReference(rightRef)) {\n thisValue = rightRef.Base;\n }\n }\n return NormalCompletion(rightValue.call(thisValue, leftValue));\n }\n // https://tc39.es/ecma262/#sec-additive-operators\n var result = ApplyStringOrNumericBinaryOperator(leftValue, node.operator, rightValue);\n return NormalCompletion(result);\n }\n case \"CallExpression\":\n {\n // https://tc39.es/ecma262/#sec-function-calls\n var ref = Evaluate(node.callee, optionalChainRef).Value;\n var func = GetValue(ref);\n if ((func === undefined || func === null) && (node.optional || optionalChainRef !== null && optionalChainRef !== void 0 && optionalChainRef.skipped)) {\n optionalChainRef.skipped = true;\n return NormalCompletion(undefined);\n }\n sanitize(func);\n return EvaluateCall(func, ref, node.arguments, node.callee);\n }\n case \"ChainExpression\":\n // https://tc39.es/ecma262/#sec-optional-chains\n return Evaluate(node.expression, {});\n case \"ConditionalExpression\":\n // https://tc39.es/ecma262/#sec-conditional-operator\n return NormalCompletion(GetValue(Evaluate(GetValue(Evaluate(node.test)) ? node.consequent : node.alternate)));\n case \"Identifier\":\n // https://tc39.es/ecma262/#sec-identifiers\n return NormalCompletion(ResolveBinding(node.name));\n case \"Literal\":\n {\n // https://tc39.es/ecma262/#sec-primary-expression-literals\n if (node.regex) {\n if (node.value === null) {\n // Invalid regular expression fails silently in @babel/parser.\n throw new SyntaxError(\"Invalid regular expression: \".concat(node.raw));\n }\n if (node.regex.flags.includes(\"u\")) {\n // Currently unicode flag is not fully supported across major browsers.\n throw new SyntaxError(\"Unsupported unicode flag in regular expression: \".concat(node.raw));\n }\n }\n return NormalCompletion(node.value);\n }\n case \"LogicalExpression\":\n {\n // https://tc39.es/ecma262/#sec-binary-logical-operators\n var _leftValue = GetValue(Evaluate(node.left));\n switch (node.operator) {\n case \"&&\":\n return NormalCompletion(_leftValue && GetValue(Evaluate(node.right)));\n case \"||\":\n return NormalCompletion(_leftValue || GetValue(Evaluate(node.right)));\n case \"??\":\n return NormalCompletion(_leftValue !== null && _leftValue !== void 0 ? _leftValue : GetValue(Evaluate(node.right)));\n // istanbul ignore next\n default:\n throw new SyntaxError( // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore never reach here.\n \"Unsupported logical operator '\".concat(node.operator, \"'\"));\n }\n }\n case \"MemberExpression\":\n {\n // https://tc39.es/ecma262/#sec-property-accessors\n var baseReference = Evaluate(node.object, optionalChainRef).Value;\n var baseValue = GetValue(baseReference);\n if ((baseValue === undefined || baseValue === null) && (node.optional || optionalChainRef !== null && optionalChainRef !== void 0 && optionalChainRef.skipped)) {\n optionalChainRef.skipped = true;\n return NormalCompletion(undefined);\n }\n sanitize(baseValue);\n var _result = node.computed ? EvaluatePropertyAccessWithExpressionKey(baseValue, node.property, true) : EvaluatePropertyAccessWithIdentifierKey(baseValue, node.property, true);\n sanitize(_result);\n return NormalCompletion(_result);\n }\n case \"NewExpression\":\n // https://tc39.es/ecma262/#sec-new-operator\n return EvaluateNew(node.callee, node.arguments);\n case \"ObjectExpression\":\n {\n // https://tc39.es/ecma262/#sec-object-initializer\n var object = {};\n for (var prop of node.properties) {\n if (prop.type === \"SpreadElement\") {\n var fromValue = GetValue(Evaluate(prop.argument));\n CopyDataProperties(object, fromValue, new Set());\n } else {\n if (prop.kind !== \"init\") {\n throw new SyntaxError(\"Unsupported object getter/setter\");\n }\n var propName = !prop.computed && prop.key.type === \"Identifier\" ? prop.key.name : EvaluateComputedPropertyName(prop.key);\n if (propName === \"__proto__\") {\n throw new TypeError(\"Setting '__proto__' property is not allowed\");\n }\n object[propName] = GetValue(Evaluate(prop.value));\n }\n }\n return NormalCompletion(object);\n }\n case \"SequenceExpression\":\n {\n // https://tc39.es/ecma262/#sec-comma-operator\n var _result2;\n for (var expr of node.expressions) {\n _result2 = NormalCompletion(GetValue(Evaluate(expr)));\n }\n return _result2;\n }\n case \"TemplateLiteral\":\n {\n // https://tc39.es/ecma262/#sec-template-literals\n var chunks = [node.quasis[0].value.cooked];\n var index = 0;\n for (var _expr of node.expressions) {\n var val = GetValue(Evaluate(_expr));\n chunks.push(String(val));\n chunks.push(node.quasis[index += 1].value.cooked);\n }\n return NormalCompletion(chunks.join(\"\"));\n }\n case \"TaggedTemplateExpression\":\n {\n // https://tc39.es/ecma262/#sec-tagged-templates\n var tagRef = Evaluate(node.tag).Value;\n var tagFunc = GetValue(tagRef);\n sanitize(tagFunc);\n return EvaluateCall(tagFunc, tagRef, node.quasi, node.tag);\n }\n case \"UnaryExpression\":\n {\n // https://tc39.es/ecma262/#sec-unary-operators\n var _ref = Evaluate(node.argument).Value;\n if (!expressionOnly && node.operator === \"delete\") {\n // Delete operator is supported only in function mode.\n if (!(_ref instanceof ReferenceRecord)) {\n return NormalCompletion(true);\n }\n // istanbul ignore else\n if (IsPropertyReference(_ref)) {\n var deleteStatus = delete _ref.Base[_ref.ReferenceName];\n return NormalCompletion(deleteStatus);\n }\n // Should never reach here in strict mode.\n }\n\n if (node.operator === \"typeof\") {\n if (_ref instanceof ReferenceRecord && _ref.Base === \"unresolvable\") {\n return NormalCompletion(\"undefined\");\n }\n return NormalCompletion(typeof GetValue(_ref));\n }\n return NormalCompletion(ApplyUnaryOperator(GetValue(_ref), node.operator));\n }\n }\n if (!expressionOnly) {\n // Statements and assignments:\n switch (node.type) {\n case \"AssignmentExpression\":\n {\n // https://tc39.es/ecma262/#sec-assignment-operators\n if (node.operator === \"=\") {\n if (!(node.left.type === \"ArrayPattern\" || node.left.type === \"ObjectPattern\")) {\n var _lref = Evaluate(node.left).Value;\n // Todo: IsAnonymousFunctionDefinition(lref)\n var _rref2 = Evaluate(node.right);\n var _rval2 = GetValue(_rref2);\n PutValue(_lref, _rval2);\n return NormalCompletion(_rval2);\n }\n var _rref = Evaluate(node.right);\n var _rval = GetValue(_rref);\n DestructuringAssignmentEvaluation(node.left, _rval);\n return NormalCompletion(_rval);\n }\n // Operators other than `=`.\n var lref = Evaluate(node.left).Value;\n var lval = GetValue(lref);\n var rref = Evaluate(node.right);\n var rval = GetValue(rref);\n var r = ApplyStringOrNumericAssignment(lval, node.operator, rval);\n PutValue(lref, r);\n return NormalCompletion(r);\n }\n case \"BlockStatement\":\n {\n // https://tc39.es/ecma262/#sec-block\n if (!node.body.length) {\n return NormalCompletion(Empty);\n }\n var oldEnv = getRunningContext().LexicalEnvironment;\n var blockEnv = new DeclarativeEnvironment(oldEnv);\n BlockDeclarationInstantiation(node.body, blockEnv);\n getRunningContext().LexicalEnvironment = blockEnv;\n var blockValue = EvaluateStatementList(node.body);\n getRunningContext().LexicalEnvironment = oldEnv;\n return blockValue;\n }\n case \"BreakStatement\":\n // https://tc39.es/ecma262/#sec-break-statement\n return new CompletionRecord(\"break\", Empty);\n case \"ContinueStatement\":\n // https://tc39.es/ecma262/#sec-continue-statement\n return new CompletionRecord(\"continue\", Empty);\n case \"EmptyStatement\":\n // https://tc39.es/ecma262/#sec-empty-statement\n return NormalCompletion(Empty);\n case \"DoWhileStatement\":\n // https://tc39.es/ecma262/#sec-do-while-statement\n return EvaluateBreakableStatement(DoWhileLoopEvaluation(node));\n case \"ExpressionStatement\":\n case \"TSAsExpression\":\n // https://tc39.es/ecma262/#sec-expression-statement\n return Evaluate(node.expression);\n case \"ForInStatement\":\n case \"ForOfStatement\":\n // https://tc39.es/ecma262/#sec-for-in-and-for-of-statements\n return EvaluateBreakableStatement(ForInOfLoopEvaluation(node));\n case \"ForStatement\":\n // https://tc39.es/ecma262/#sec-for-statement\n return EvaluateBreakableStatement(ForLoopEvaluation(node));\n case \"FunctionDeclaration\":\n // https://tc39.es/ecma262/#sec-function-definitions\n return NormalCompletion(Empty);\n case \"FunctionExpression\":\n // https://tc39.es/ecma262/#sec-function-defining-expressions\n ThrowIfFunctionIsInvalid(node);\n return NormalCompletion(InstantiateOrdinaryFunctionExpression(node));\n case \"IfStatement\":\n // https://tc39.es/ecma262/#sec-if-statement\n return GetValue(Evaluate(node.test)) ? ((_hooks$beforeBranch = hooks.beforeBranch) !== null && _hooks$beforeBranch !== void 0 && _hooks$beforeBranch.call(hooks, node, \"if\"), UpdateEmpty(Evaluate(node.consequent), undefined)) : ((_hooks$beforeBranch2 = hooks.beforeBranch) !== null && _hooks$beforeBranch2 !== void 0 && _hooks$beforeBranch2.call(hooks, node, \"else\"), node.alternate) ? UpdateEmpty(Evaluate(node.alternate), undefined) : NormalCompletion(undefined);\n case \"ReturnStatement\":\n {\n // https://tc39.es/ecma262/#sec-return-statement\n var v;\n if (node.argument) {\n var exprRef = Evaluate(node.argument);\n v = GetValue(exprRef);\n }\n return new CompletionRecord(\"return\", v);\n }\n case \"ThrowStatement\":\n // https://tc39.es/ecma262/#sec-throw-statement\n throw GetValue(Evaluate(node.argument));\n case \"UpdateExpression\":\n {\n // https://tc39.es/ecma262/#sec-update-expressions\n var lhs = Evaluate(node.argument).Value;\n var oldValue = Number(GetValue(lhs));\n var newValue = node.operator === \"++\" ? oldValue + 1 : oldValue - 1;\n PutValue(lhs, newValue);\n return NormalCompletion(node.prefix ? newValue : oldValue);\n }\n case \"SwitchCase\":\n return EvaluateStatementList(node.consequent);\n case \"SwitchStatement\":\n {\n // https://tc39.es/ecma262/#sec-switch-statement\n var _exprRef = Evaluate(node.discriminant);\n var switchValue = GetValue(_exprRef);\n var _oldEnv = getRunningContext().LexicalEnvironment;\n var _blockEnv = new DeclarativeEnvironment(_oldEnv);\n BlockDeclarationInstantiation(node.cases, _blockEnv);\n getRunningContext().LexicalEnvironment = _blockEnv;\n var R = CaseBlockEvaluation(node.cases, switchValue);\n getRunningContext().LexicalEnvironment = _oldEnv;\n return EvaluateBreakableStatement(R);\n }\n case \"TryStatement\":\n {\n // https://tc39.es/ecma262/#sec-try-statement\n var _R;\n try {\n _R = Evaluate(node.block);\n } catch (error) {\n if (node.handler) {\n var _hooks$beforeEvaluate2;\n (_hooks$beforeEvaluate2 = hooks.beforeEvaluate) === null || _hooks$beforeEvaluate2 === void 0 ? void 0 : _hooks$beforeEvaluate2.call(hooks, node.handler);\n _R = CatchClauseEvaluation(node.handler, error);\n } else {\n throw error;\n }\n } finally {\n if (node.finalizer) {\n var F = Evaluate(node.finalizer);\n if (F.Type !== \"normal\") {\n _R = F;\n }\n }\n }\n return _R;\n }\n case \"VariableDeclaration\":\n {\n // https://tc39.es/ecma262/#sec-declarations-and-the-variable-statement\n var _result3;\n for (var declarator of node.declarations) {\n if (!declarator.init) {\n // Assert: a declarator without init is always an identifier.\n if (node.kind === \"var\") {\n _result3 = NormalCompletion(Empty);\n } else {\n var _lhs = ResolveBinding(declarator.id.name);\n _result3 = InitializeReferencedBinding(_lhs, undefined);\n }\n } else if (declarator.id.type === \"Identifier\") {\n var bindingId = declarator.id.name;\n var _lhs2 = ResolveBinding(bindingId);\n // Todo: IsAnonymousFunctionDefinition(Initializer)\n var rhs = Evaluate(declarator.init);\n var _value = GetValue(rhs);\n _result3 = node.kind === \"var\" ? PutValue(_lhs2, _value) : InitializeReferencedBinding(_lhs2, _value);\n } else {\n var _rhs = Evaluate(declarator.init);\n var _rval3 = GetValue(_rhs);\n _result3 = BindingInitialization(declarator.id, _rval3, node.kind === \"var\" ? undefined : getRunningContext().LexicalEnvironment);\n }\n }\n return _result3;\n }\n case \"WhileStatement\":\n // https://tc39.es/ecma262/#sec-while-statement\n return EvaluateBreakableStatement(WhileLoopEvaluation(node));\n }\n }\n // eslint-disable-next-line no-console\n throw new SyntaxError(\"Unsupported node type `\".concat(node.type, \"`\"));\n }\n\n // https://tc39.es/ecma262/#sec-execution-contexts\n function getRunningContext() {\n return executionContextStack[executionContextStack.length - 1];\n }\n\n // https://tc39.es/ecma262/#sec-resolvebinding\n function ResolveBinding(name, env) {\n if (!env) {\n env = getRunningContext().LexicalEnvironment;\n }\n return GetIdentifierReference(env, name, true);\n }\n\n // Try statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-catchclauseevaluation\n function CatchClauseEvaluation(node, thrownValue) {\n var oldEnv = getRunningContext().LexicalEnvironment;\n var catchEnv = new DeclarativeEnvironment(oldEnv);\n for (var argName of collectBoundNames(node.param)) {\n catchEnv.CreateMutableBinding(argName, false);\n }\n getRunningContext().LexicalEnvironment = catchEnv;\n BindingInitialization(node.param, thrownValue, catchEnv);\n var B = Evaluate(node.body);\n getRunningContext().LexicalEnvironment = oldEnv;\n return B;\n }\n\n // Iteration statements and switch statements.\n // https://tc39.es/ecma262/#prod-BreakableStatement\n function EvaluateBreakableStatement(stmtResult) {\n return stmtResult.Type === \"break\" ? stmtResult.Value === Empty ? NormalCompletion(undefined) : NormalCompletion(stmtResult.Value) : stmtResult;\n }\n\n // Switch statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-caseblockevaluation\n function CaseBlockEvaluation(cases, input) {\n var V;\n var defaultCaseIndex = cases.findIndex(switchCase => !switchCase.test);\n var hasDefaultCase = defaultCaseIndex >= 0;\n var A = hasDefaultCase ? cases.slice(0, defaultCaseIndex) : cases;\n var found = false;\n for (var C of A) {\n if (!found) {\n found = CaseClauseIsSelected(C, input);\n }\n if (found) {\n var _R2 = Evaluate(C);\n if (_R2.Value !== Empty) {\n V = _R2.Value;\n }\n if (_R2.Type !== \"normal\") {\n return UpdateEmpty(_R2, V);\n }\n }\n }\n if (!hasDefaultCase) {\n return NormalCompletion(V);\n }\n var foundInB = false;\n var B = cases.slice(defaultCaseIndex + 1);\n if (!found) {\n for (var _C of B) {\n if (!foundInB) {\n foundInB = CaseClauseIsSelected(_C, input);\n }\n if (foundInB) {\n var _R3 = Evaluate(_C);\n if (_R3.Value !== Empty) {\n V = _R3.Value;\n }\n if (_R3.Type !== \"normal\") {\n return UpdateEmpty(_R3, V);\n }\n }\n }\n }\n if (foundInB) {\n return NormalCompletion(V);\n }\n var R = Evaluate(cases[defaultCaseIndex]);\n if (R.Value !== Empty) {\n V = R.Value;\n }\n if (R.Type !== \"normal\") {\n return UpdateEmpty(R, V);\n }\n\n // NOTE: The following is another complete iteration of the second CaseClauses.\n for (var _C2 of B) {\n var _R4 = Evaluate(_C2);\n if (_R4.Value !== Empty) {\n V = _R4.Value;\n }\n if (_R4.Type !== \"normal\") {\n return UpdateEmpty(_R4, V);\n }\n }\n return NormalCompletion(V);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-caseclauseisselected\n function CaseClauseIsSelected(C, input) {\n var clauseSelector = GetValue(Evaluate(C.test));\n return input === clauseSelector;\n }\n\n // While statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-whileloopevaluation\n function WhileLoopEvaluation(node) {\n var V;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var exprValue = GetValue(Evaluate(node.test));\n if (!exprValue) {\n return NormalCompletion(V);\n }\n var stmtResult = Evaluate(node.body);\n if (!LoopContinues(stmtResult)) {\n return UpdateEmpty(stmtResult, V);\n }\n if (stmtResult.Value !== Empty) {\n V = stmtResult.Value;\n }\n }\n }\n\n // Do-while Statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-dowhileloopevaluation\n function DoWhileLoopEvaluation(node) {\n var V;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var stmtResult = Evaluate(node.body);\n if (!LoopContinues(stmtResult)) {\n return UpdateEmpty(stmtResult, V);\n }\n if (stmtResult.Value !== Empty) {\n V = stmtResult.Value;\n }\n var exprValue = GetValue(Evaluate(node.test));\n if (!exprValue) {\n return NormalCompletion(V);\n }\n }\n }\n\n // For in/of statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-forinofloopevaluation\n function ForInOfLoopEvaluation(node) {\n var lhs = node.left;\n var isVariableDeclaration = lhs.type === \"VariableDeclaration\";\n var lhsKind = isVariableDeclaration ? lhs.kind === \"var\" ? \"varBinding\" : \"lexicalBinding\" : \"assignment\";\n var uninitializedBoundNames = lhsKind === \"lexicalBinding\" ? collectBoundNames(lhs) : [];\n var iterationKind = node.type === \"ForInStatement\" ? \"enumerate\" : \"iterate\";\n var keyResult = ForInOfHeadEvaluation(uninitializedBoundNames, node.right, iterationKind);\n if (keyResult.Type !== \"normal\") {\n // When enumerate, if the target is nil, a break completion will be returned.\n return keyResult;\n }\n return ForInOfBodyEvaluation(lhs, node.body, keyResult.Value, iterationKind, lhsKind);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-forinofheadevaluation\n function ForInOfHeadEvaluation(uninitializedBoundNames, expr, iterationKind) {\n var runningContext = getRunningContext();\n var oldEnv = runningContext.LexicalEnvironment;\n if (uninitializedBoundNames.length > 0) {\n var newEnv = new DeclarativeEnvironment(oldEnv);\n for (var name of uninitializedBoundNames) {\n newEnv.CreateMutableBinding(name, false);\n }\n runningContext.LexicalEnvironment = newEnv;\n }\n var exprRef = Evaluate(expr);\n runningContext.LexicalEnvironment = oldEnv;\n var exprValue = GetValue(exprRef);\n if (iterationKind === \"enumerate\") {\n if (exprValue === null || exprValue === undefined) {\n return new CompletionRecord(\"break\", Empty);\n }\n var _iterator = EnumerateObjectProperties(exprValue);\n return NormalCompletion(_iterator);\n }\n var iterator = CreateListIteratorRecord(exprValue);\n return NormalCompletion(iterator);\n }\n function ForInOfBodyEvaluation(node, stmt, iteratorRecord, iterationKind, lhsKind) {\n var lhs = lhsKind === \"assignment\" ? node : node.declarations[0].id;\n var oldEnv = getRunningContext().LexicalEnvironment;\n var V;\n // When `destructuring` is false,\n // For `node` whose `kind` is assignment:\n // `lhs` is an `Identifier` or a `MemberExpression`,\n // Otherwise:\n // `lhs` is an `Identifier`.\n var destructuring = lhs.type === \"ObjectPattern\" || lhs.type === \"ArrayPattern\";\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var {\n done,\n value: nextValue\n } = iteratorRecord.next();\n if (done) {\n return NormalCompletion(V);\n }\n var lhsRef = void 0;\n var iterationEnv = void 0;\n if (lhsKind === \"lexicalBinding\") {\n iterationEnv = new DeclarativeEnvironment(oldEnv);\n ForDeclarationBindingInstantiation(node, iterationEnv);\n getRunningContext().LexicalEnvironment = iterationEnv;\n if (!destructuring) {\n var [lhsName] = collectBoundNames(lhs);\n lhsRef = ResolveBinding(lhsName);\n }\n } else if (!destructuring) {\n lhsRef = Evaluate(lhs).Value;\n }\n destructuring ? lhsKind === \"assignment\" ? DestructuringAssignmentEvaluation(lhs, nextValue) : lhsKind === \"varBinding\" ? BindingInitialization(lhs, nextValue, undefined) : BindingInitialization(lhs, nextValue, iterationEnv) : lhsKind === \"lexicalBinding\" ? InitializeReferencedBinding(lhsRef, nextValue) : PutValue(lhsRef, nextValue);\n var result = Evaluate(stmt);\n getRunningContext().LexicalEnvironment = oldEnv;\n if (!LoopContinues(result)) {\n var status = UpdateEmpty(result, V);\n if (!(iterationKind === \"enumerate\" || iteratorRecord.return === undefined)) {\n // Perform *IteratorClose*\n // https://tc39.es/ecma262/#sec-iteratorclose\n var innerResult = iteratorRecord.return();\n if (!innerResult || ![\"object\", \"function\"].includes(typeof innerResult)) {\n throw new TypeError(\"Iterator result is not an object\");\n }\n }\n return status;\n }\n if (result.Value !== Empty) {\n V = result.Value;\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-enumerate-object-properties\n function* EnumerateObjectProperties(value) {\n for (var _key in value) {\n yield _key;\n }\n }\n\n // For statements.\n // https://tc39.es/ecma262/#sec-runtime-semantics-forloopevaluation\n function ForLoopEvaluation(node) {\n var _node$init;\n if (((_node$init = node.init) === null || _node$init === void 0 ? void 0 : _node$init.type) === \"VariableDeclaration\") {\n // `for (var … ; … ; … ) …`\n if (node.init.kind === \"var\") {\n Evaluate(node.init);\n return ForBodyEvaluation(node.test, node.update, node.body, []);\n }\n // `for (let/const … ; … ; … ) …`\n var oldEnv = getRunningContext().LexicalEnvironment;\n var loopEnv = new DeclarativeEnvironment(oldEnv);\n var isConst = node.init.kind === \"const\";\n var boundNames = collectBoundNames(node.init);\n for (var dn of boundNames) {\n if (isConst) {\n loopEnv.CreateImmutableBinding(dn, true);\n } else {\n loopEnv.CreateMutableBinding(dn, false);\n }\n }\n getRunningContext().LexicalEnvironment = loopEnv;\n Evaluate(node.init);\n var perIterationLets = isConst ? [] : Array.from(boundNames);\n var bodyResult = ForBodyEvaluation(node.test, node.update, node.body, perIterationLets);\n getRunningContext().LexicalEnvironment = oldEnv;\n return bodyResult;\n }\n // `for ( … ; … ; … ) …`\n if (node.init) {\n var exprRef = Evaluate(node.init);\n GetValue(exprRef);\n }\n return ForBodyEvaluation(node.test, node.update, node.body, []);\n }\n\n // https://tc39.es/ecma262/#sec-forbodyevaluation\n function ForBodyEvaluation(test, increment, stmt, perIterationBindings) {\n CreatePerIterationEnvironment(perIterationBindings);\n var V;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (test) {\n var testRef = Evaluate(test);\n var testValue = GetValue(testRef);\n if (!testValue) {\n return NormalCompletion(V);\n }\n }\n var result = Evaluate(stmt);\n if (!LoopContinues(result)) {\n return UpdateEmpty(result, V);\n }\n if (result.Value) {\n V = result.Value;\n }\n CreatePerIterationEnvironment(perIterationBindings);\n if (increment) {\n var incRef = Evaluate(increment);\n GetValue(incRef);\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-createperiterationenvironment\n function CreatePerIterationEnvironment(perIterationBindings) {\n if (perIterationBindings.length === 0) {\n return;\n }\n var lastIterationEnv = getRunningContext().LexicalEnvironment;\n var outer = lastIterationEnv.OuterEnv;\n var thisIterationEnv = new DeclarativeEnvironment(outer);\n for (var bn of perIterationBindings) {\n thisIterationEnv.CreateMutableBinding(bn, false);\n var lastValue = lastIterationEnv.GetBindingValue(bn, false);\n thisIterationEnv.InitializeBinding(bn, lastValue);\n }\n getRunningContext().LexicalEnvironment = thisIterationEnv;\n }\n\n // Destructuring assignments.\n // https://tc39.es/ecma262/#sec-runtime-semantics-destructuringassignmentevaluation\n function DestructuringAssignmentEvaluation(pattern, value) {\n if (pattern.type === \"ObjectPattern\") {\n RequireObjectCoercible(value);\n if (pattern.properties.length > 0) {\n PropertyDestructuringAssignmentEvaluation(pattern.properties, value);\n }\n return NormalCompletion(Empty);\n }\n var iteratorRecord = CreateListIteratorRecord(value);\n return IteratorDestructuringAssignmentEvaluation(pattern.elements, iteratorRecord);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-propertydestructuringassignmentevaluation\n function PropertyDestructuringAssignmentEvaluation(properties, value) {\n var excludedNames = new Set();\n for (var prop of properties) {\n if (prop.type === \"Property\") {\n var propName = !prop.computed && prop.key.type === \"Identifier\" ? prop.key.name : EvaluateComputedPropertyName(prop.key);\n var valueTarget = prop.value.type === \"AssignmentPattern\" ? prop.value.left : prop.value;\n if (valueTarget.type === \"Identifier\") {\n var lref = ResolveBinding(valueTarget.name);\n var v = GetV(value, propName);\n if (prop.value.type === \"AssignmentPattern\" && v === undefined) {\n // Todo(steve): check IsAnonymousFunctionDefinition(Initializer)\n var defaultValue = Evaluate(prop.value.right);\n v = GetValue(defaultValue);\n }\n PutValue(lref, v);\n excludedNames.add(propName);\n } else {\n KeyedDestructuringAssignmentEvaluation(prop.value, value, propName);\n excludedNames.add(propName);\n }\n } else {\n RestDestructuringAssignmentEvaluation(prop, value, excludedNames);\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-keyeddestructuringassignmentevaluation\n function KeyedDestructuringAssignmentEvaluation(node, value, propertyName) {\n var assignmentTarget = node.type === \"AssignmentPattern\" ? node.left : node;\n var isObjectOrArray = assignmentTarget.type === \"ArrayPattern\" || assignmentTarget.type === \"ObjectPattern\";\n var lref;\n if (!isObjectOrArray) {\n lref = Evaluate(assignmentTarget).Value;\n }\n var v = GetV(value, propertyName);\n var rhsValue;\n if (node.type === \"AssignmentPattern\" && v === undefined) {\n // Todo(steve): check IsAnonymousFunctionDefinition(Initializer)\n var defaultValue = Evaluate(node.right);\n rhsValue = GetValue(defaultValue);\n } else {\n rhsValue = v;\n }\n if (isObjectOrArray) {\n return DestructuringAssignmentEvaluation(assignmentTarget, rhsValue);\n }\n return PutValue(lref, rhsValue);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-restdestructuringassignmentevaluation\n function RestDestructuringAssignmentEvaluation(restProperty, value, excludedNames) {\n var lref = Evaluate(restProperty.argument).Value;\n var restObj = CopyDataProperties({}, value, excludedNames);\n return PutValue(lref, restObj);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-iteratordestructuringassignmentevaluation\n function IteratorDestructuringAssignmentEvaluation(elements, iteratorRecord) {\n var status = NormalCompletion(Empty);\n for (var element of elements) {\n if (!element) {\n iteratorRecord.next();\n status = NormalCompletion(Empty);\n continue;\n }\n var assignmentTarget = element.type === \"RestElement\" ? element.argument : element.type === \"AssignmentPattern\" ? element.left : element;\n var isObjectOrArray = assignmentTarget.type === \"ArrayPattern\" || assignmentTarget.type === \"ObjectPattern\";\n var lref = void 0;\n if (!isObjectOrArray) {\n lref = Evaluate(assignmentTarget).Value;\n }\n var v = void 0;\n if (element.type !== \"RestElement\") {\n var {\n done,\n value: nextValue\n } = iteratorRecord.next();\n var _value2 = done ? undefined : nextValue;\n if (element.type === \"AssignmentPattern\" && _value2 === undefined) {\n // Todo(steve): check IsAnonymousFunctionDefinition(Initializer)\n var defaultValue = Evaluate(element.right);\n v = GetValue(defaultValue);\n } else {\n v = _value2;\n }\n } else {\n // RestElement\n v = [];\n var n = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var {\n done: _done,\n value: _nextValue\n } = iteratorRecord.next();\n if (_done) {\n break;\n }\n v[n] = _nextValue;\n n++;\n }\n }\n if (isObjectOrArray) {\n status = DestructuringAssignmentEvaluation(assignmentTarget, v);\n } else {\n status = PutValue(lref, v);\n }\n }\n return status;\n }\n\n // Object expressions.\n // https://tc39.es/ecma262/#sec-evaluate-property-access-with-expression-key\n function EvaluatePropertyAccessWithExpressionKey(baseValue, expression, strict) {\n var propertyNameReference = Evaluate(expression);\n var propertyNameValue = GetValue(propertyNameReference);\n var propertyKey = ToPropertyKey(propertyNameValue);\n return new ReferenceRecord(baseValue, propertyKey, strict);\n }\n\n // https://tc39.es/ecma262/#sec-evaluate-property-access-with-identifier-key\n function EvaluatePropertyAccessWithIdentifierKey(baseValue, identifier, strict) {\n var propertyNameString = identifier.name;\n return new ReferenceRecord(baseValue, propertyNameString, strict);\n }\n\n // Block statements.\n // https://tc39.es/ecma262/#sec-blockdeclarationinstantiation\n function BlockDeclarationInstantiation(code, env) {\n var declarations = collectScopedDeclarations(code, {\n var: false,\n topLevel: false\n });\n for (var d of declarations) {\n var IsConstantDeclaration = d.type === \"VariableDeclaration\" && d.kind === \"const\";\n for (var dn of collectBoundNames(d)) {\n if (IsConstantDeclaration) {\n env.CreateImmutableBinding(dn, true);\n } else {\n env.CreateMutableBinding(dn, false);\n }\n }\n if (d.type === \"FunctionDeclaration\") {\n var [_fn] = collectBoundNames(d);\n var _fo = InstantiateFunctionObject(d, env);\n env.InitializeBinding(_fn, _fo);\n }\n }\n }\n\n // Function declarations and expressions.\n // https://tc39.es/ecma262/#sec-evaluatecall\n function EvaluateCall(func, ref, args, callee) {\n var thisValue;\n if (ref instanceof ReferenceRecord) {\n if (IsPropertyReference(ref)) {\n thisValue = ref.Base;\n }\n }\n var argList = ArgumentListEvaluation(args);\n if (typeof func !== \"function\") {\n var funcName = codeSource.substring(callee.start, callee.end);\n throw new TypeError(\"\".concat(funcName, \" is not a function\"));\n }\n var result = func.apply(thisValue, argList);\n sanitize(result);\n return NormalCompletion(result);\n }\n\n // https://tc39.es/ecma262/#sec-evaluatenew\n function EvaluateNew(constructExpr, args) {\n var ref = Evaluate(constructExpr);\n var constructor = GetValue(ref);\n var argList = ArgumentListEvaluation(args);\n if (typeof constructor !== \"function\" || constructor[IsConstructor] === false) {\n var constructorName = codeSource.substring(constructExpr.start, constructExpr.end);\n throw new TypeError(\"\".concat(constructorName, \" is not a constructor\"));\n }\n if (!isAllowedConstructor(constructor)) {\n var _constructorName = codeSource.substring(constructExpr.start, constructExpr.end);\n throw new TypeError(\"\".concat(_constructorName, \" is not an allowed constructor\"));\n }\n return NormalCompletion(new constructor(...argList));\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-argumentlistevaluation\n function ArgumentListEvaluation(args) {\n var array = [];\n if (Array.isArray(args)) {\n for (var arg of args) {\n if (arg.type === \"SpreadElement\") {\n var spreadValues = GetValue(Evaluate(arg.argument));\n array.push(...spreadValues);\n } else {\n array.push(GetValue(Evaluate(arg)));\n }\n }\n } else {\n array.push(GetTemplateObject(args));\n for (var expr of args.expressions) {\n array.push(GetValue(Evaluate(expr)));\n }\n }\n return array;\n }\n\n // https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n function CallFunction(closure, args) {\n var _hooks$beforeCall;\n (_hooks$beforeCall = hooks.beforeCall) === null || _hooks$beforeCall === void 0 ? void 0 : _hooks$beforeCall.call(hooks, closure[SourceNode]);\n PrepareForOrdinaryCall(closure);\n var result = OrdinaryCallEvaluateBody(closure, args);\n executionContextStack.pop();\n if (result.Type === \"return\") {\n return result.Value;\n }\n return undefined;\n }\n\n // https://tc39.es/ecma262/#sec-prepareforordinarycall\n function PrepareForOrdinaryCall(F) {\n var calleeContext = new ExecutionContext();\n calleeContext.Function = F;\n var localEnv = new FunctionEnvironment(F[Environment]);\n calleeContext.VariableEnvironment = localEnv;\n calleeContext.LexicalEnvironment = localEnv;\n executionContextStack.push(calleeContext);\n return calleeContext;\n }\n\n // https://tc39.es/ecma262/#sec-ordinarycallevaluatebody\n function OrdinaryCallEvaluateBody(F, args) {\n return EvaluateFunctionBody(F[ECMAScriptCode], F, args);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-evaluatefunctionbody\n function EvaluateFunctionBody(body, F, args) {\n FunctionDeclarationInstantiation(F, args);\n if (Array.isArray(body)) {\n return EvaluateStatementList(body);\n }\n return new CompletionRecord(\"return\", GetValue(Evaluate(body)));\n }\n\n // https://tc39.es/ecma262/#sec-block-runtime-semantics-evaluation\n function EvaluateStatementList(statements) {\n var result = NormalCompletion(Empty);\n for (var stmt of statements) {\n var s = Evaluate(stmt);\n if (s.Type !== \"normal\") {\n return s;\n }\n result = UpdateEmpty(result, s.Value);\n }\n return result;\n }\n\n // https://tc39.es/ecma262/#sec-functiondeclarationinstantiation\n function FunctionDeclarationInstantiation(func, args) {\n var calleeContext = getRunningContext();\n var code = func[ECMAScriptCode];\n var formals = func[FormalParameters];\n var parameterNames = collectBoundNames(formals);\n var hasParameterExpressions = containsExpression(formals);\n var varDeclarations = collectScopedDeclarations(code, {\n var: true,\n topLevel: true\n });\n var varNames = collectBoundNames(varDeclarations);\n\n // `functionNames` ∈ `varNames`\n // `functionsToInitialize` ≈ `functionNames`\n var functionNames = [];\n var functionsToInitialize = [];\n for (var i = varDeclarations.length - 1; i >= 0; i--) {\n var d = varDeclarations[i];\n if (d.type === \"FunctionDeclaration\") {\n ThrowIfFunctionIsInvalid(d);\n var [_fn2] = collectBoundNames(d);\n if (!functionNames.includes(_fn2)) {\n functionNames.unshift(_fn2);\n functionsToInitialize.unshift(d);\n }\n } else if (rules !== null && rules !== void 0 && rules.noVar) {\n throw new SyntaxError(\"Var declaration is not recommended, use `let` or `const` instead\");\n }\n }\n var env = calleeContext.LexicalEnvironment;\n for (var paramName of parameterNames) {\n // In strict mode, it's guaranteed no duplicate params exist.\n env.CreateMutableBinding(paramName, false);\n }\n var iteratorRecord = CreateListIteratorRecord(args);\n IteratorBindingInitialization(formals, iteratorRecord, env);\n var varEnv;\n if (!hasParameterExpressions) {\n // NOTE: Only a single Environment Record is needed for the parameters\n // and top-level vars.\n // `varNames` are unique.\n for (var n of varNames) {\n if (!parameterNames.includes(n)) {\n env.CreateMutableBinding(n, false);\n env.InitializeBinding(n, undefined);\n }\n }\n varEnv = env;\n } else {\n // NOTE: A separate Environment Record is needed to ensure that closures\n // created by expressions in the formal parameter list do not have\n // visibility of declarations in the function body.\n varEnv = new DeclarativeEnvironment(env);\n calleeContext.VariableEnvironment = varEnv;\n // `varNames` are unique.\n for (var _n of varNames) {\n varEnv.CreateMutableBinding(_n, false);\n var initialValue = void 0;\n if (parameterNames.includes(_n) && !functionNames.includes(_n)) {\n initialValue = env.GetBindingValue(_n, false);\n }\n varEnv.InitializeBinding(_n, initialValue);\n // NOTE: A var with the same name as a formal parameter initially has\n // the same value as the corresponding initialized parameter.\n }\n }\n\n var lexEnv = varEnv;\n calleeContext.LexicalEnvironment = lexEnv;\n var lexDeclarations = collectScopedDeclarations(code, {\n var: false,\n topLevel: true\n });\n for (var _d of lexDeclarations) {\n for (var dn of collectBoundNames(_d)) {\n // Only lexical VariableDeclaration here in top-level.\n if (_d.kind === \"const\") {\n lexEnv.CreateImmutableBinding(dn, true);\n } else {\n lexEnv.CreateMutableBinding(dn, false);\n }\n }\n }\n for (var f of functionsToInitialize) {\n var [_fn3] = collectBoundNames(f);\n var _fo2 = InstantiateFunctionObject(f, lexEnv);\n varEnv.SetMutableBinding(_fn3, _fo2, false);\n }\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-instantiatefunctionobject\n function InstantiateFunctionObject(func, scope) {\n return OrdinaryFunctionCreate(func, scope, true);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-instantiateordinaryfunctionexpression\n function InstantiateOrdinaryFunctionExpression(functionExpression) {\n var scope = getRunningContext().LexicalEnvironment;\n if (functionExpression.id) {\n var name = functionExpression.id.name;\n var funcEnv = new DeclarativeEnvironment(scope);\n funcEnv.CreateImmutableBinding(name, false);\n var closure = OrdinaryFunctionCreate(functionExpression, funcEnv, true);\n funcEnv.InitializeBinding(name, closure);\n return closure;\n } else {\n var _closure = OrdinaryFunctionCreate(functionExpression, scope, true);\n return _closure;\n }\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-instantiatearrowfunctionexpression\n function InstantiateArrowFunctionExpression(arrowFunction) {\n var scope = getRunningContext().LexicalEnvironment;\n var closure = OrdinaryFunctionCreate(arrowFunction, scope, false);\n return closure;\n }\n\n // https://tc39.es/ecma262/#sec-ordinaryfunctioncreate\n function OrdinaryFunctionCreate(sourceNode, scope, isConstructor) {\n var F = function () {\n // eslint-disable-next-line prefer-rest-params\n return CallFunction(F, arguments);\n };\n Object.defineProperties(F, {\n [SourceNode]: {\n value: sourceNode\n },\n [FormalParameters]: {\n value: sourceNode.params\n },\n [ECMAScriptCode]: {\n value: sourceNode.body.type === \"BlockStatement\" ? sourceNode.body.body : sourceNode.body\n },\n [Environment]: {\n value: scope\n },\n [IsConstructor]: {\n value: isConstructor\n }\n });\n return F;\n }\n\n // Patterns initialization.\n // https://tc39.es/ecma262/#sec-runtime-semantics-bindinginitialization\n function BindingInitialization(node, value, environment) {\n switch (node.type) {\n case \"Identifier\":\n return InitializeBoundName(node.name, value, environment);\n case \"ObjectPattern\":\n RequireObjectCoercible(value);\n return PropertyBindingInitialization(node.properties, value, environment);\n case \"ArrayPattern\":\n {\n var iteratorRecord = CreateListIteratorRecord(value);\n return IteratorBindingInitialization(node.elements, iteratorRecord, environment);\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-propertybindinginitialization\n function PropertyBindingInitialization(properties, value, environment) {\n var excludedNames = new Set();\n for (var prop of properties) {\n if (prop.type === \"RestElement\") {\n return RestBindingInitialization(prop, value, environment, excludedNames);\n }\n if (!prop.computed && prop.key.type === \"Identifier\") {\n KeyedBindingInitialization(prop.value, value, environment, prop.key.name);\n excludedNames.add(prop.key.name);\n } else {\n var P = EvaluateComputedPropertyName(prop.key);\n KeyedBindingInitialization(prop.value, value, environment, P);\n excludedNames.add(P);\n }\n }\n return NormalCompletion(Empty);\n }\n\n // https://tc39.es/ecma262/#prod-ComputedPropertyName\n function EvaluateComputedPropertyName(node) {\n var propName = GetValue(Evaluate(node));\n return ToPropertyKey(propName);\n }\n\n // https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-restbindinginitialization\n function RestBindingInitialization(restProperty, value, environment, excludedNames) {\n var lhs = ResolveBinding(restProperty.argument.name, environment);\n var restObj = CopyDataProperties({}, value, excludedNames);\n if (!environment) {\n return PutValue(lhs, restObj);\n }\n return InitializeReferencedBinding(lhs, restObj);\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-iteratorbindinginitialization\n function IteratorBindingInitialization(elements, iteratorRecord, environment) {\n if (elements.length === 0) {\n return NormalCompletion(Empty);\n }\n var result;\n for (var _node of elements) {\n if (!_node) {\n // Elision element.\n iteratorRecord.next();\n result = NormalCompletion(Empty);\n } else if (_node.type === \"RestElement\") {\n // Rest element.\n if (_node.argument.type === \"Identifier\") {\n var lhs = ResolveBinding(_node.argument.name, environment);\n var A = [];\n var n = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var {\n done,\n value: _value3\n } = iteratorRecord.next();\n if (done) {\n result = environment ? InitializeReferencedBinding(lhs, A) : PutValue(lhs, A);\n break;\n }\n A[n] = _value3;\n n++;\n }\n } else {\n var _A = [];\n var _n2 = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n var {\n done: _done2,\n value: _value4\n } = iteratorRecord.next();\n if (_done2) {\n result = BindingInitialization(_node.argument, _A, environment);\n break;\n }\n _A[_n2] = _value4;\n _n2++;\n }\n }\n } else {\n // Normal element.\n var bindingElement = _node.type === \"AssignmentPattern\" ? _node.left : _node;\n switch (bindingElement.type) {\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n {\n var v = void 0;\n var {\n done: _done3,\n value: _value5\n } = iteratorRecord.next();\n if (!_done3) {\n v = _value5;\n }\n if (_node.type === \"AssignmentPattern\" && v === undefined) {\n var defaultValue = Evaluate(_node.right);\n v = GetValue(defaultValue);\n }\n result = BindingInitialization(bindingElement, v, environment);\n break;\n }\n case \"Identifier\":\n {\n var bindingId = bindingElement.name;\n var _lhs3 = ResolveBinding(bindingId, environment);\n var _v = void 0;\n var {\n done: _done4,\n value: _value6\n } = iteratorRecord.next();\n if (!_done4) {\n _v = _value6;\n }\n if (_node.type === \"AssignmentPattern\" && _v === undefined) {\n // IsAnonymousFunctionDefinition(Initializer)\n var _defaultValue = Evaluate(_node.right);\n _v = GetValue(_defaultValue);\n }\n result = environment ? InitializeReferencedBinding(_lhs3, _v) : PutValue(_lhs3, _v);\n break;\n }\n }\n }\n }\n return result;\n }\n\n // https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization\n function KeyedBindingInitialization(node, value, environment, propertyName) {\n var isIdentifier = node.type === \"Identifier\" || node.type === \"AssignmentPattern\" && node.left.type === \"Identifier\";\n if (isIdentifier) {\n var bindingId = node.type === \"Identifier\" ? node.name : node.left.name;\n var lhs = ResolveBinding(bindingId, environment);\n var _v2 = GetV(value, propertyName);\n if (node.type === \"AssignmentPattern\" && _v2 === undefined) {\n // If IsAnonymousFunctionDefinition(Initializer)\n var defaultValue = Evaluate(node.right);\n _v2 = GetValue(defaultValue);\n }\n if (!environment) {\n return PutValue(lhs, _v2);\n }\n return InitializeReferencedBinding(lhs, _v2);\n }\n var v = GetV(value, propertyName);\n if (node.type === \"AssignmentPattern\" && v === undefined) {\n var _defaultValue2 = Evaluate(node.right);\n v = GetValue(_defaultValue2);\n }\n return BindingInitialization(node.type === \"AssignmentPattern\" ? node.left : node, v, environment);\n }\n\n // https://tc39.es/ecma262/#sec-initializeboundname\n function InitializeBoundName(name, value, environment) {\n // Assert: environment is always present.\n environment.InitializeBinding(name, value);\n return NormalCompletion(Empty);\n }\n function ThrowIfFunctionIsInvalid(func) {\n if (func.async || func.generator) {\n throw new SyntaxError(\"\".concat(func.async ? \"Async\" : \"Generator\", \" function is not allowed\"));\n }\n if (expressionOnly && !func.expression) {\n throw new SyntaxError(\"Only an `Expression` is allowed in `ArrowFunctionExpression`'s body\");\n }\n }\n if (expressionOnly) {\n return GetValue(Evaluate(rootAst));\n }\n (_hooks$beforeEvaluate3 = hooks.beforeEvaluate) === null || _hooks$beforeEvaluate3 === void 0 ? void 0 : _hooks$beforeEvaluate3.call(hooks, rootAst);\n ThrowIfFunctionIsInvalid(rootAst);\n var [fn] = collectBoundNames(rootAst);\n // Create an immutable binding for the root function.\n rootEnv.CreateImmutableBinding(fn, true);\n var fo = InstantiateFunctionObject(rootAst, rootEnv);\n rootEnv.InitializeBinding(fn, fo);\n return fo;\n}\n//# sourceMappingURL=cook.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\n\nclass Position {\n constructor(line, col, index) {\n this.line = void 0;\n this.column = void 0;\n this.index = void 0;\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\nclass SourceLocation {\n constructor(start, end) {\n this.start = void 0;\n this.end = void 0;\n this.filename = void 0;\n this.identifierName = void 0;\n this.start = start;\n this.end = end;\n }\n}\n\nfunction createPositionWithColumnOffset(position, columnOffset) {\n const {\n line,\n column,\n index\n } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n\nvar ParseErrorCode = {\n SyntaxError: \"BABEL_PARSER_SYNTAX_ERROR\",\n SourceTypeModuleError: \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\"\n};\nconst reflect = (keys, last = keys.length - 1) => ({\n get() {\n return keys.reduce((object, key) =>\n object[key], this);\n },\n set(value) {\n keys.reduce(\n (item, key, i) => i === last ? item[key] = value : item[key], this);\n }\n});\nconst instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === \"function\" ? {\n value: descriptor,\n enumerable: false\n} : typeof descriptor.reflect === \"string\" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split(\".\"))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({\n configurable: true\n}, descriptor)), Object.assign(new constructor(), properties));\n\nvar ModuleErrors = {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError\n }\n};\n\nconst NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\"\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\"\n};\nconst toNodeDescription = ({\n type,\n prefix\n}) => type === \"UpdateExpression\" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type];\n\nvar StandardErrors = {\n AccessorIsGenerator: ({\n kind\n }) => `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass: \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext: \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier: \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock: \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter: \"'await' is not allowed in async function parameters.\",\n AwaitNotInAsyncContext: \"'await' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions.\",\n BadGetterArity: \"A 'get' accesor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accesor must have exactly one formal parameter.\",\n BadSetterRestParameter: \"A 'set' accesor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField: \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorArgumentsOutsideParentheses: \"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.\",\n DecoratorBeforeExport: \"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.\",\n DecoratorConstructor: \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass: \"Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport: \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({\n exportName\n }) => `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName\n }) => `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier: \"'from' is not allowed as an identifier after 'export default'.\",\n ForInOfLoopInitializer: ({\n type\n }) => `'${type === \"ForInStatement\" ? \"for-in\" : \"for-of\"}' loop variable declaration may not have an initializer.`,\n ForInUsing: \"For-in loop may not start with 'using' declaration.\",\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext: \"Generators can only be declared at the top level or inside a block.\",\n IllegalBreakContinue: ({\n type\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n IllegalLanguageModeDirective: \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportBindingIsString: ({\n importName\n }) => `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArgumentTrailingComma: \"Trailing comma is disallowed inside import(...) arguments.\",\n ImportCallArity: ({\n maxArgumentCount\n }) => `\\`import()\\` requires exactly ${maxArgumentCount === 1 ? \"one argument\" : \"one or two arguments\"}.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault: \"A JSON module can only be imported with `default`.\",\n ImportReflectionHasAssertion: \"`import module x` cannot have assertions.\",\n ImportReflectionNotBinding: 'Only `import module x from \"./module\"` is valid.',\n IncompatibleRegExpUVFlags: \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({\n radix\n }) => `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({\n reservedWord\n }) => `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({\n identifierName\n }) => `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({\n ancestor\n }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({\n ancestor\n }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent: \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({\n unexpected\n }) => `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty: \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({\n labelName\n }) => `Label '${labelName}' is already declared.`,\n LetInLexicalBinding: \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment: \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({\n missingPlugin\n }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(\", \")}.`,\n MissingOneOfPlugins: ({\n missingPlugin\n }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical: \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType: \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue: \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({\n key\n }) => `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode\n }) => `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(16)}'.`,\n ModuleExportUndefined: ({\n localName\n }) => `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence: \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar: \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew: \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate: \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor: \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({\n identifierName\n }) => `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({\n identifierName\n }) => `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType: \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType: \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType: \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction: \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed: \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType: \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType: \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType: \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody: 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport: \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({\n keyword\n }) => `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator: \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration: \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget: \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator: \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({\n reservedWord\n }) => `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected\n }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${expected ? `, expected \"${expected}\"` : \"\"}`,\n UnexpectedTokenUnaryExponentiation: \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnexpectedUsingDeclaration: \"Using declaration cannot appear in the top level when source type is `script`.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport: \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport: \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport: \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName\n }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator: \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator: \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper: \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n UsingDeclarationHasBindingPattern: \"Using declaration cannot have destructuring patterns.\",\n VarRedeclaration: ({\n identifierName\n }) => `Identifier '${identifierName}' has already been declared.`,\n YieldBindingIdentifier: \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n ZeroDigitNumericSeparator: \"Numeric separator can not be used after leading 0.\"\n};\n\nvar StrictModeErrors = {\n StrictDelete: \"Deleting local variable in strict mode.\",\n StrictEvalArguments: ({\n referenceName\n }) => `Assigning to '${referenceName}' in strict mode.`,\n StrictEvalArgumentsBinding: ({\n bindingName\n }) => `Binding '${bindingName}' in strict mode.`,\n StrictFunction: \"In strict mode code, functions can only be declared at top level or inside a block.\",\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n StrictWith: \"'with' in strict mode.\"\n};\n\nconst UnparenthesizedPipeBodyDescriptions = new Set([\"ArrowFunctionExpression\", \"AssignmentExpression\", \"ConditionalExpression\", \"YieldExpression\"]);\nvar PipelineOperatorErrors = {\n PipeBodyIsTighter: \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound: \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({\n token\n }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused: \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({\n type\n }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type\n })}; please wrap it in parentheses.`,\n PipelineBodyNoArrow: 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression: \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression: \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused: \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed: \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.'\n};\n\nconst _excluded$1 = [\"toMessage\"],\n _excluded2$1 = [\"message\"];\nfunction toParseErrorConstructor(_ref) {\n let {\n toMessage\n } = _ref,\n properties = _objectWithoutPropertiesLoose(_ref, _excluded$1);\n return function constructor({\n loc,\n details\n }) {\n return instantiate(SyntaxError, Object.assign({}, properties, {\n loc\n }), {\n clone(overrides = {}) {\n const loc = overrides.loc || {};\n return constructor({\n loc: new Position(\"line\" in loc ? loc.line : this.loc.line, \"column\" in loc ? loc.column : this.loc.column, \"index\" in loc ? loc.index : this.loc.index),\n details: Object.assign({}, this.details, overrides.details)\n });\n },\n details: {\n value: details,\n enumerable: false\n },\n message: {\n get() {\n return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`;\n },\n set(value) {\n Object.defineProperty(this, \"message\", {\n value\n });\n }\n },\n pos: {\n reflect: \"loc.index\",\n enumerable: true\n },\n missingPlugin: \"missingPlugin\" in details && {\n reflect: \"details.missingPlugin\",\n enumerable: true\n }\n });\n };\n}\nfunction ParseErrorEnum(argument, syntaxPlugin) {\n if (Array.isArray(argument)) {\n return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n const ParseErrorConstructors = {};\n for (const reasonCode of Object.keys(argument)) {\n const template = argument[reasonCode];\n const _ref2 = typeof template === \"string\" ? {\n message: () => template\n } : typeof template === \"function\" ? {\n message: template\n } : template,\n {\n message\n } = _ref2,\n rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1);\n const toMessage = typeof message === \"string\" ? () => message : message;\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({\n code: ParseErrorCode.SyntaxError,\n reasonCode,\n toMessage\n }, syntaxPlugin ? {\n syntaxPlugin\n } : {}, rest));\n }\n return ParseErrorConstructors;\n}\nconst Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));\n\nconst {\n defineProperty\n} = Object;\nconst toUnenumerable = (object, key) => defineProperty(object, key, {\n enumerable: false,\n value: object[key]\n});\nfunction toESTreeLocation(node) {\n node.loc.start && toUnenumerable(node.loc.start, \"index\");\n node.loc.end && toUnenumerable(node.loc.end, \"index\");\n return node;\n}\nvar estree = (superClass => class ESTreeParserMixin extends superClass {\n parse() {\n const file = toESTreeLocation(super.parse());\n if (this.options.tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n return file;\n }\n\n parseRegExpLiteral({\n pattern,\n flags\n }) {\n let regex = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n }\n\n const node = this.estreeParseLiteral(regex);\n node.regex = {\n pattern,\n flags\n };\n return node;\n }\n\n parseBigIntLiteral(value) {\n let bigInt;\n try {\n bigInt = BigInt(value);\n } catch (_unused) {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n return node;\n }\n\n parseDecimalLiteral(value) {\n const decimal = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n return node;\n }\n estreeParseLiteral(value) {\n return this.parseLiteral(value, \"Literal\");\n }\n\n parseStringLiteral(value) {\n return this.estreeParseLiteral(value);\n }\n parseNumericLiteral(value) {\n return this.estreeParseLiteral(value);\n }\n\n parseNullLiteral() {\n return this.estreeParseLiteral(null);\n }\n parseBooleanLiteral(value) {\n return this.estreeParseLiteral(value);\n }\n\n directiveToStmt(directive) {\n const expression = directive.value;\n delete directive.value;\n expression.type = \"Literal\";\n expression.raw = expression.extra.raw;\n expression.value = expression.extra.expressionValue;\n const stmt = directive;\n stmt.type = \"ExpressionStatement\";\n stmt.expression = expression;\n stmt.directive = expression.extra.rawValue;\n delete expression.extra;\n return stmt;\n }\n\n initFunction(node, isAsync) {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n checkDeclaration(node) {\n if (node != null && this.isObjectProperty(node)) {\n this.checkDeclaration(node.value);\n } else {\n super.checkDeclaration(node);\n }\n }\n getObjectOrClassMethodParams(method) {\n return method.value.params;\n }\n isValidDirective(stmt) {\n var _stmt$expression$extr;\n return stmt.type === \"ExpressionStatement\" && stmt.expression.type === \"Literal\" && typeof stmt.expression.value === \"string\" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);\n }\n parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {\n super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse);\n const directiveStatements = node.directives.map(d => this.directiveToStmt(d));\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, \"ClassMethod\", true);\n if (method.typeParameters) {\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n parsePrivateName() {\n const node = super.parsePrivateName();\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n convertPrivateNameToPrivateIdentifier(node) {\n const name = super.getPrivateNameSV(node);\n node = node;\n delete node.id;\n node.name = name;\n node.type = \"PrivateIdentifier\";\n return node;\n }\n isPrivateName(node) {\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n getPrivateNameSV(node) {\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node);\n }\n }\n return node.name;\n }\n\n parseLiteral(value, type) {\n const node = super.parseLiteral(value, type);\n node.raw = node.extra.raw;\n delete node.extra;\n return node;\n }\n parseFunctionBody(node, allowExpression, isMethod = false) {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {\n let funcNode = this.startNode();\n funcNode.kind = node.kind;\n funcNode = super.parseMethod(\n funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n return this.finishNode(\n node, \"MethodDefinition\");\n }\n parseClassProperty(...args) {\n const propertyNode = super.parseClassProperty(...args);\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n return propertyNode;\n }\n parseClassPrivateProperty(...args) {\n const propertyNode = super.parseClassPrivateProperty(...args);\n {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n return propertyNode;\n }\n parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {\n const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);\n if (node) {\n node.type = \"Property\";\n if (node.kind === \"method\") {\n node.kind = \"init\";\n }\n node.shorthand = false;\n }\n return node;\n }\n parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {\n const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n return node;\n }\n isValidLVal(type, isUnparenthesizedInAssign, binding) {\n return type === \"Property\" ? \"value\" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n isAssignable(node, isBinding) {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n toAssignable(node, isLHS = false) {\n if (node != null && this.isObjectProperty(node)) {\n const {\n key,\n value\n } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n toAssignableObjectExpressionProp(prop, isLast, isLHS) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(Errors.PatternHasAccessor, {\n at: prop.key\n });\n } else if (prop.method) {\n this.raise(Errors.PatternHasMethod, {\n at: prop.key\n });\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n finishCallExpression(unfinished, optional) {\n const node = super.finishCallExpression(unfinished, optional);\n if (node.callee.type === \"Import\") {\n node.type = \"ImportExpression\";\n node.source = node.arguments[0];\n if (this.hasPlugin(\"importAssertions\")) {\n var _node$arguments$;\n node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null;\n }\n delete node.arguments;\n delete node.callee;\n }\n return node;\n }\n toReferencedArguments(node\n ) {\n if (node.type === \"ImportExpression\") {\n return;\n }\n super.toReferencedArguments(node);\n }\n parseExport(unfinished, decorators) {\n const exportStartLoc = this.state.lastTokStartLoc;\n const node = super.parseExport(unfinished, decorators);\n switch (node.type) {\n case \"ExportAllDeclaration\":\n node.exported = null;\n break;\n case \"ExportNamedDeclaration\":\n if (node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\") {\n node.type = \"ExportAllDeclaration\";\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n case \"ExportDefaultDeclaration\":\n {\n var _declaration$decorato;\n const {\n declaration\n } = node;\n if ((declaration == null ? void 0 : declaration.type) === \"ClassDeclaration\" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 &&\n declaration.start === node.start) {\n this.resetStartLocation(node,\n exportStartLoc);\n }\n }\n break;\n }\n return node;\n }\n parseSubscript(base, startLoc, noCalls, state) {\n const node = super.parseSubscript(base, startLoc, noCalls, state);\n if (state.optionalChainMember) {\n if (node.type === \"OptionalMemberExpression\" || node.type === \"OptionalCallExpression\") {\n node.type = node.type.substring(8);\n }\n\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (node.type === \"MemberExpression\" || node.type === \"CallExpression\") {\n node.optional = false;\n }\n return node;\n }\n hasPropertyAsPrivateName(node) {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n isOptionalChain(node) {\n return node.type === \"ChainExpression\";\n }\n\n isObjectProperty(node) {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n isObjectMethod(node) {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n finishNodeAt(node, type, endLoc) {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n resetStartLocation(node, startLoc) {\n super.resetStartLocation(node, startLoc);\n toESTreeLocation(node);\n }\n resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n});\n\nclass TokContext {\n constructor(token, preserveSpace) {\n this.token = void 0;\n this.preserveSpace = void 0;\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n}\nconst types = {\n brace: new TokContext(\"{\"),\n j_oTag: new TokContext(\"<tag\"),\n j_cTag: new TokContext(\"</tag\"),\n j_expr: new TokContext(\"<tag>...</tag>\", true)\n};\n\n{\n types.template = new TokContext(\"`\", true);\n}\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\nclass ExportedTokenType {\n constructor(label, conf = {}) {\n this.label = void 0;\n this.keyword = void 0;\n this.beforeExpr = void 0;\n this.startsExpr = void 0;\n this.rightAssociative = void 0;\n this.isLoop = void 0;\n this.isAssign = void 0;\n this.prefix = void 0;\n this.postfix = void 0;\n this.binop = void 0;\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n {\n this.updateContext = null;\n }\n }\n}\n\nconst keywords$1 = new Map();\nfunction createKeyword(name, options = {}) {\n options.keyword = name;\n const token = createToken(name, options);\n keywords$1.set(name, token);\n return token;\n}\nfunction createBinop(name, binop) {\n return createToken(name, {\n beforeExpr,\n binop\n });\n}\nlet tokenTypeCounter = -1;\nconst tokenTypes = [];\nconst tokenLabels = [];\nconst tokenBinops = [];\nconst tokenBeforeExprs = [];\nconst tokenStartsExprs = [];\nconst tokenPrefixes = [];\nfunction createToken(name, options = {}) {\n var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);\n tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);\n tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);\n tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);\n tokenTypes.push(new ExportedTokenType(name, options));\n return tokenTypeCounter;\n}\nfunction createKeywordLike(name, options = {}) {\n var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;\n ++tokenTypeCounter;\n keywords$1.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);\n tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);\n tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);\n tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false);\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n return tokenTypeCounter;\n}\n\nconst tt = {\n bracketL: createToken(\"[\", {\n beforeExpr,\n startsExpr\n }),\n bracketHashL: createToken(\"#[\", {\n beforeExpr,\n startsExpr\n }),\n bracketBarL: createToken(\"[|\", {\n beforeExpr,\n startsExpr\n }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", {\n beforeExpr,\n startsExpr\n }),\n braceBarL: createToken(\"{|\", {\n beforeExpr,\n startsExpr\n }),\n braceHashL: createToken(\"#{\", {\n beforeExpr,\n startsExpr\n }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", {\n beforeExpr,\n startsExpr\n }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", {\n beforeExpr\n }),\n semi: createToken(\";\", {\n beforeExpr\n }),\n colon: createToken(\":\", {\n beforeExpr\n }),\n doubleColon: createToken(\"::\", {\n beforeExpr\n }),\n dot: createToken(\".\"),\n question: createToken(\"?\", {\n beforeExpr\n }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", {\n beforeExpr\n }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", {\n beforeExpr\n }),\n backQuote: createToken(\"`\", {\n startsExpr\n }),\n dollarBraceL: createToken(\"${\", {\n beforeExpr,\n startsExpr\n }),\n templateTail: createToken(\"...`\", {\n startsExpr\n }),\n templateNonTail: createToken(\"...${\", {\n beforeExpr,\n startsExpr\n }),\n at: createToken(\"@\"),\n hash: createToken(\"#\", {\n startsExpr\n }),\n interpreterDirective: createToken(\"#!...\"),\n\n eq: createToken(\"=\", {\n beforeExpr,\n isAssign\n }),\n assign: createToken(\"_=\", {\n beforeExpr,\n isAssign\n }),\n slashAssign: createToken(\"_=\", {\n beforeExpr,\n isAssign\n }),\n xorAssign: createToken(\"_=\", {\n beforeExpr,\n isAssign\n }),\n moduloAssign: createToken(\"_=\", {\n beforeExpr,\n isAssign\n }),\n\n incDec: createToken(\"++/--\", {\n prefix,\n postfix,\n startsExpr\n }),\n bang: createToken(\"!\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n tilde: createToken(\"~\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n doubleCaret: createToken(\"^^\", {\n startsExpr\n }),\n doubleAt: createToken(\"@@\", {\n startsExpr\n }),\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\"</>/<=/>=\", 7),\n gt: createBinop(\"</>/<=/>=\", 7),\n relational: createBinop(\"</>/<=/>=\", 7),\n bitShift: createBinop(\"<</>>/>>>\", 8),\n bitShiftL: createBinop(\"<</>>/>>>\", 8),\n bitShiftR: createBinop(\"<</>>/>>>\", 8),\n plusMin: createToken(\"+/-\", {\n beforeExpr,\n binop: 9,\n prefix,\n startsExpr\n }),\n modulo: createToken(\"%\", {\n binop: 10,\n startsExpr\n }),\n star: createToken(\"*\", {\n binop: 10\n }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true\n }),\n _in: createKeyword(\"in\", {\n beforeExpr,\n binop: 7\n }),\n _instanceof: createKeyword(\"instanceof\", {\n beforeExpr,\n binop: 7\n }),\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", {\n beforeExpr\n }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", {\n beforeExpr\n }),\n _else: createKeyword(\"else\", {\n beforeExpr\n }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", {\n startsExpr\n }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", {\n beforeExpr\n }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", {\n beforeExpr,\n startsExpr\n }),\n _this: createKeyword(\"this\", {\n startsExpr\n }),\n _super: createKeyword(\"super\", {\n startsExpr\n }),\n _class: createKeyword(\"class\", {\n startsExpr\n }),\n _extends: createKeyword(\"extends\", {\n beforeExpr\n }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", {\n startsExpr\n }),\n _null: createKeyword(\"null\", {\n startsExpr\n }),\n _true: createKeyword(\"true\", {\n startsExpr\n }),\n _false: createKeyword(\"false\", {\n startsExpr\n }),\n _typeof: createKeyword(\"typeof\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _void: createKeyword(\"void\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _delete: createKeyword(\"delete\", {\n beforeExpr,\n prefix,\n startsExpr\n }),\n _do: createKeyword(\"do\", {\n isLoop,\n beforeExpr\n }),\n _for: createKeyword(\"for\", {\n isLoop\n }),\n _while: createKeyword(\"while\", {\n isLoop\n }),\n\n _as: createKeywordLike(\"as\", {\n startsExpr\n }),\n _assert: createKeywordLike(\"assert\", {\n startsExpr\n }),\n _async: createKeywordLike(\"async\", {\n startsExpr\n }),\n _await: createKeywordLike(\"await\", {\n startsExpr\n }),\n _from: createKeywordLike(\"from\", {\n startsExpr\n }),\n _get: createKeywordLike(\"get\", {\n startsExpr\n }),\n _let: createKeywordLike(\"let\", {\n startsExpr\n }),\n _meta: createKeywordLike(\"meta\", {\n startsExpr\n }),\n _of: createKeywordLike(\"of\", {\n startsExpr\n }),\n _sent: createKeywordLike(\"sent\", {\n startsExpr\n }),\n _set: createKeywordLike(\"set\", {\n startsExpr\n }),\n _static: createKeywordLike(\"static\", {\n startsExpr\n }),\n _using: createKeywordLike(\"using\", {\n startsExpr\n }),\n _yield: createKeywordLike(\"yield\", {\n startsExpr\n }),\n _asserts: createKeywordLike(\"asserts\", {\n startsExpr\n }),\n _checks: createKeywordLike(\"checks\", {\n startsExpr\n }),\n _exports: createKeywordLike(\"exports\", {\n startsExpr\n }),\n _global: createKeywordLike(\"global\", {\n startsExpr\n }),\n _implements: createKeywordLike(\"implements\", {\n startsExpr\n }),\n _intrinsic: createKeywordLike(\"intrinsic\", {\n startsExpr\n }),\n _infer: createKeywordLike(\"infer\", {\n startsExpr\n }),\n _is: createKeywordLike(\"is\", {\n startsExpr\n }),\n _mixins: createKeywordLike(\"mixins\", {\n startsExpr\n }),\n _proto: createKeywordLike(\"proto\", {\n startsExpr\n }),\n _require: createKeywordLike(\"require\", {\n startsExpr\n }),\n _satisfies: createKeywordLike(\"satisfies\", {\n startsExpr\n }),\n _keyof: createKeywordLike(\"keyof\", {\n startsExpr\n }),\n _readonly: createKeywordLike(\"readonly\", {\n startsExpr\n }),\n _unique: createKeywordLike(\"unique\", {\n startsExpr\n }),\n _abstract: createKeywordLike(\"abstract\", {\n startsExpr\n }),\n _declare: createKeywordLike(\"declare\", {\n startsExpr\n }),\n _enum: createKeywordLike(\"enum\", {\n startsExpr\n }),\n _module: createKeywordLike(\"module\", {\n startsExpr\n }),\n _namespace: createKeywordLike(\"namespace\", {\n startsExpr\n }),\n _interface: createKeywordLike(\"interface\", {\n startsExpr\n }),\n _type: createKeywordLike(\"type\", {\n startsExpr\n }),\n _opaque: createKeywordLike(\"opaque\", {\n startsExpr\n }),\n name: createToken(\"name\", {\n startsExpr\n }),\n\n string: createToken(\"string\", {\n startsExpr\n }),\n num: createToken(\"num\", {\n startsExpr\n }),\n bigint: createToken(\"bigint\", {\n startsExpr\n }),\n decimal: createToken(\"decimal\", {\n startsExpr\n }),\n regexp: createToken(\"regexp\", {\n startsExpr\n }),\n privateName: createToken(\"#name\", {\n startsExpr\n }),\n eof: createToken(\"eof\"),\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", {\n beforeExpr: true\n }),\n jsxTagStart: createToken(\"jsxTagStart\", {\n startsExpr: true\n }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n placeholder: createToken(\"%%\", {\n startsExpr: true\n })\n};\nfunction tokenIsIdentifier(token) {\n return token >= 93 && token <= 130;\n}\nfunction tokenKeywordOrIdentifierIsKeyword(token) {\n return token <= 92;\n}\nfunction tokenIsKeywordOrIdentifier(token) {\n return token >= 58 && token <= 130;\n}\nfunction tokenIsLiteralPropertyName(token) {\n return token >= 58 && token <= 134;\n}\nfunction tokenComesBeforeExpression(token) {\n return tokenBeforeExprs[token];\n}\nfunction tokenCanStartExpression(token) {\n return tokenStartsExprs[token];\n}\nfunction tokenIsAssignment(token) {\n return token >= 29 && token <= 33;\n}\nfunction tokenIsFlowInterfaceOrTypeOrOpaque(token) {\n return token >= 127 && token <= 129;\n}\nfunction tokenIsLoop(token) {\n return token >= 90 && token <= 92;\n}\nfunction tokenIsKeyword(token) {\n return token >= 58 && token <= 92;\n}\nfunction tokenIsOperator(token) {\n return token >= 39 && token <= 59;\n}\nfunction tokenIsPostfix(token) {\n return token === 34;\n}\nfunction tokenIsPrefix(token) {\n return tokenPrefixes[token];\n}\nfunction tokenIsTSTypeOperator(token) {\n return token >= 119 && token <= 121;\n}\nfunction tokenIsTSDeclarationStart(token) {\n return token >= 122 && token <= 128;\n}\nfunction tokenLabelName(token) {\n return tokenLabels[token];\n}\nfunction tokenOperatorPrecedence(token) {\n return tokenBinops[token];\n}\nfunction tokenIsRightAssociative(token) {\n return token === 57;\n}\nfunction tokenIsTemplate(token) {\n return token >= 24 && token <= 25;\n}\nfunction getExportedToken(token) {\n return tokenTypes[token];\n}\n{\n tokenTypes[8].updateContext = context => {\n context.pop();\n };\n tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => {\n context.push(types.brace);\n };\n tokenTypes[22].updateContext = context => {\n if (context[context.length - 1] === types.template) {\n context.pop();\n } else {\n context.push(types.template);\n }\n };\n tokenTypes[140].updateContext = context => {\n context.push(types.j_expr, types.j_oTag);\n };\n}\n\nlet nonASCIIidentifierStartChars = \"\\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\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\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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\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-\\u1711\\u171f-\\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-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\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-\\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-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\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-\\uab69\\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\";\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\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\\u0898-\\u089f\\u08ca-\\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\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\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\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\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-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\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\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\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\\ua82c\\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\";\nconst nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nconst nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\nconst astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191];\nconst astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\nfunction isInAstralSet(code, set) {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\nfunction isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\nfunction isIdentifierChar(code) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code <= 90) return true;\n if (code < 97) return code === 95;\n if (code <= 122) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);\n}\n\nconst reservedWords = {\n keyword: [\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\"],\n strict: [\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\"],\n strictBind: [\"eval\", \"arguments\"]\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\nfunction isReservedWord(word, inModule) {\n return inModule && word === \"await\" || word === \"enum\";\n}\n\nfunction isStrictReservedWord(word, inModule) {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\nfunction isStrictBindOnlyReservedWord(word) {\n return reservedWordsStrictBindSet.has(word);\n}\n\nfunction isStrictBindReservedWord(word, inModule) {\n return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);\n}\nfunction isKeyword(word) {\n return keywords.has(word);\n}\n\nfunction isIteratorStart(current, next, next2) {\n return current === 64 && next === 64 && isIdentifierStart(next2);\n}\n\nconst reservedWordLikeSet = new Set([\"break\", \"case\", \"catch\", \"continue\", \"debugger\", \"default\", \"do\", \"else\", \"finally\", \"for\", \"function\", \"if\", \"return\", \"switch\", \"throw\", \"try\", \"var\", \"const\", \"while\", \"with\", \"new\", \"this\", \"super\", \"class\", \"extends\", \"export\", \"import\", \"null\", \"true\", \"false\", \"in\", \"instanceof\", \"typeof\", \"void\", \"delete\",\n\"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", \"yield\",\n\"eval\", \"arguments\",\n\"enum\", \"await\"]);\nfunction canBeReservedWord(word) {\n return reservedWordLikeSet.has(word);\n}\n\nconst SCOPE_OTHER = 0b000000000,\n SCOPE_PROGRAM = 0b000000001,\n SCOPE_FUNCTION = 0b000000010,\n SCOPE_ARROW = 0b000000100,\n SCOPE_SIMPLE_CATCH = 0b000001000,\n SCOPE_SUPER = 0b000010000,\n SCOPE_DIRECT_SUPER = 0b000100000,\n SCOPE_CLASS = 0b001000000,\n SCOPE_STATIC_BLOCK = 0b010000000,\n SCOPE_TS_MODULE = 0b100000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_STATIC_BLOCK | SCOPE_TS_MODULE;\nconst BIND_KIND_VALUE = 0b000000000001,\n BIND_KIND_TYPE = 0b000000000010,\n BIND_SCOPE_VAR = 0b000000000100,\n BIND_SCOPE_LEXICAL = 0b000000001000,\n BIND_SCOPE_FUNCTION = 0b000000010000,\n BIND_FLAGS_NONE = 0b0000001000000,\n BIND_FLAGS_CLASS = 0b0000010000000,\n BIND_FLAGS_TS_ENUM = 0b0000100000000,\n BIND_FLAGS_TS_CONST_ENUM = 0b0001000000000,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b0010000000000,\n BIND_FLAGS_FLOW_DECLARE_FN = 0b0100000000000,\n BIND_FLAGS_TS_IMPORT = 0b1000000000000;\n\nconst BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE,\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_TS_TYPE_IMPORT = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_TS_IMPORT,\n BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;\nconst CLASS_ELEMENT_FLAG_STATIC = 0b100,\n CLASS_ELEMENT_KIND_GETTER = 0b010,\n CLASS_ELEMENT_KIND_SETTER = 0b001,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\nconst CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nclass Scope {\n\n constructor(flags) {\n this.var = new Set();\n this.lexical = new Set();\n this.functions = new Set();\n this.flags = flags;\n }\n}\n\nclass ScopeHandler {\n constructor(parser, inModule) {\n this.parser = void 0;\n this.scopeStack = [];\n this.inModule = void 0;\n this.undefinedExports = new Map();\n this.parser = parser;\n this.inModule = inModule;\n }\n get inTopLevel() {\n return (this.currentScope().flags & SCOPE_PROGRAM) > 0;\n }\n get inFunction() {\n return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0;\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1;; i--) {\n const {\n flags\n } = this.scopeStack[i];\n if (flags & SCOPE_STATIC_BLOCK) {\n return true;\n }\n if (flags & (SCOPE_VAR | SCOPE_CLASS)) {\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n createScope(flags) {\n return new Scope(flags);\n }\n enter(flags) {\n this.scopeStack.push(this.createScope(flags));\n }\n exit() {\n const scope = this.scopeStack.pop();\n return scope.flags;\n }\n\n treatFunctionsAsVarInScope(scope) {\n return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM);\n }\n declareName(name, bindingType, loc) {\n let scope = this.currentScope();\n if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n if (bindingType & BIND_SCOPE_FUNCTION) {\n scope.functions.add(name);\n } else {\n scope.lexical.add(name);\n }\n if (bindingType & BIND_SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BIND_SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n scope.var.add(name);\n this.maybeExportDefined(scope, name);\n if (scope.flags & SCOPE_VAR) break;\n }\n }\n if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n maybeExportDefined(scope, name) {\n if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n checkRedeclarationInScope(scope, name, bindingType, loc) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.parser.raise(Errors.VarRedeclaration, {\n at: loc,\n identifierName: name\n });\n }\n }\n isRedeclaredInScope(scope, name, bindingType) {\n if (!(bindingType & BIND_KIND_VALUE)) return false;\n if (bindingType & BIND_SCOPE_LEXICAL) {\n return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);\n }\n if (bindingType & BIND_SCOPE_FUNCTION) {\n return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);\n }\n return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);\n }\n checkLocalExport(id) {\n const {\n name\n } = id;\n const topLevelScope = this.scopeStack[0];\n if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) &&\n !topLevelScope.functions.has(name)) {\n this.undefinedExports.set(name, id.loc.start);\n }\n }\n currentScope() {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n currentVarScopeFlags() {\n for (let i = this.scopeStack.length - 1;; i--) {\n const {\n flags\n } = this.scopeStack[i];\n if (flags & SCOPE_VAR) {\n return flags;\n }\n }\n }\n\n currentThisScopeFlags() {\n for (let i = this.scopeStack.length - 1;; i--) {\n const {\n flags\n } = this.scopeStack[i];\n if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) {\n return flags;\n }\n }\n }\n}\n\nclass FlowScope extends Scope {\n constructor(...args) {\n super(...args);\n this.declareFunctions = new Set();\n }\n}\nclass FlowScopeHandler extends ScopeHandler {\n createScope(flags) {\n return new FlowScope(flags);\n }\n declareName(name, bindingType, loc) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n super.declareName(name, bindingType, loc);\n }\n isRedeclaredInScope(scope, name, bindingType) {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));\n }\n return false;\n }\n checkLocalExport(id) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n\nclass BaseParser {\n constructor() {\n this.sawUnambiguousESM = false;\n this.ambiguousScriptDifferentAst = false;\n }\n hasPlugin(pluginConfig) {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(pluginOptions)) {\n if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n getPluginOption(plugin, name) {\n var _this$plugins$get;\n return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name];\n }\n}\n\nfunction setTrailingComments(node, comments) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\nfunction setLeadingComments(node, comments) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\nfunction setInnerComments(node, comments) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\nfunction adjustInnerComments(node, elements, commentWS) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nclass CommentsParser extends BaseParser {\n addComment(comment) {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.comments.push(comment);\n }\n\n processComment(node) {\n const {\n commentStack\n } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n const {\n start: nodeStart\n } = node;\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n break;\n }\n }\n }\n\n finalizeComment(commentWS) {\n const {\n comments\n } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n const {\n containingNode: node,\n start: commentStart\n } = commentWS;\n if (this.input.charCodeAt(commentStart - 1) === 44) {\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default:\n {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n finalizeRemainingComments() {\n const {\n commentStack\n } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n resetPreviousNodeTrailingComments(node) {\n const {\n commentStack\n } = this.state;\n const {\n length\n } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n takeSurroundingComments(node, start, end) {\n const {\n commentStack\n } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n\nconst lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nconst lineBreakG = new RegExp(lineBreak.source, \"g\");\n\nfunction isNewLine(code) {\n switch (code) {\n case 10:\n case 13:\n case 8232:\n case 8233:\n return true;\n default:\n return false;\n }\n}\nconst skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\nconst skipWhiteSpaceInLine = /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/y;\n\nconst skipWhiteSpaceToLineBreak = new RegExp(\n\"(?=(\" +\nskipWhiteSpaceInLine.source + \"))\\\\1\" +\n/(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)/.source, \"y\");\n\nfunction isWhitespace(code) {\n switch (code) {\n case 0x0009:\n case 0x000b:\n case 0x000c:\n case 32:\n case 160:\n case 5760:\n case 0x2000:\n case 0x2001:\n case 0x2002:\n case 0x2003:\n case 0x2004:\n case 0x2005:\n case 0x2006:\n case 0x2007:\n case 0x2008:\n case 0x2009:\n case 0x200a:\n case 0x202f:\n case 0x205f:\n case 0x3000:\n case 0xfeff:\n return true;\n default:\n return false;\n }\n}\n\nclass State {\n constructor() {\n this.strict = void 0;\n this.curLine = void 0;\n this.lineStart = void 0;\n this.startLoc = void 0;\n this.endLoc = void 0;\n this.errors = [];\n this.potentialArrowAt = -1;\n this.noArrowAt = [];\n this.noArrowParamsConversionAt = [];\n this.maybeInArrowParameters = false;\n this.inType = false;\n this.noAnonFunctionType = false;\n this.hasFlowComment = false;\n this.isAmbientContext = false;\n this.inAbstractClass = false;\n this.inDisallowConditionalTypesContext = false;\n this.topicContext = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null\n };\n this.soloAwait = false;\n this.inFSharpPipelineDirectBody = false;\n this.labels = [];\n this.comments = [];\n this.commentStack = [];\n this.pos = 0;\n this.type = 137;\n this.value = null;\n this.start = 0;\n this.end = 0;\n this.lastTokEndLoc = null;\n this.lastTokStartLoc = null;\n this.lastTokStart = 0;\n this.context = [types.brace];\n this.canStartJSXElement = true;\n this.containsEsc = false;\n this.firstInvalidTemplateEscapePos = null;\n this.strictErrors = new Map();\n this.tokensLength = 0;\n }\n init({\n strictMode,\n sourceType,\n startLine,\n startColumn\n }) {\n this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === \"module\";\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);\n }\n curPosition() {\n return new Position(this.curLine, this.pos - this.lineStart, this.pos);\n }\n clone(skipArrays) {\n const state = new State();\n const keys = Object.keys(this);\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n let val = this[key];\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n state[key] = val;\n }\n return state;\n }\n}\n\nvar _isDigit = function isDigit(code) {\n return code >= 48 && code <= 57;\n};\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),\n hex: new Set([46, 88, 95, 120])\n};\nconst isAllowedNumericSeparatorSibling = {\n bin: ch => ch === 48 || ch === 49,\n oct: ch => ch >= 48 && ch <= 55,\n dec: ch => ch >= 48 && ch <= 57,\n hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102\n};\nfunction readStringContents(type, input, pos, lineStart, curLine, errors) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const {\n length\n } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === 92) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(input, pos, lineStart, curLine, type === \"template\", errors);\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = {\n pos,\n lineStart,\n curLine\n };\n } else {\n out += res.ch;\n }\n ({\n pos,\n lineStart,\n curLine\n } = res);\n chunkStart = pos;\n } else if (ch === 8232 || ch === 8233) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === 10 || ch === 13) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (ch === 13 && input.charCodeAt(pos) === 10) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc\n };\n}\nfunction isStringEnd(type, ch, input, pos) {\n if (type === \"template\") {\n return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;\n }\n return ch === (type === \"double\" ? 34 : 39);\n}\nfunction readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {\n const throwOnInvalid = !inTemplate;\n pos++;\n\n const res = ch => ({\n pos,\n ch,\n lineStart,\n curLine\n });\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case 110:\n return res(\"\\n\");\n case 114:\n return res(\"\\r\");\n case 120:\n {\n let code;\n ({\n code,\n pos\n } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case 117:\n {\n let code;\n ({\n code,\n pos\n } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case 116:\n return res(\"\\t\");\n case 98:\n return res(\"\\b\");\n case 118:\n return res(\"\\u000b\");\n case 102:\n return res(\"\\f\");\n case 13:\n if (input.charCodeAt(pos) === 10) {\n ++pos;\n }\n case 10:\n lineStart = pos;\n ++curLine;\n case 8232:\n case 8233:\n return res(\"\");\n case 56:\n case 57:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n default:\n if (ch >= 48 && ch <= 55) {\n const startPos = pos - 1;\n const match = input.slice(startPos, pos + 2).match(/^[0-7]+/);\n let octalStr = match[0];\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (octalStr !== \"0\" || next === 56 || next === 57) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n return res(String.fromCharCode(octal));\n }\n return res(String.fromCharCode(ch));\n }\n}\nfunction readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {\n const initialPos = pos;\n let n;\n ({\n n,\n pos\n } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return {\n code: n,\n pos\n };\n}\nfunction readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {\n const start = pos;\n const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;\n let invalid = false;\n let total = 0;\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n if (code === 95 && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n if (!allowNumSeparator) {\n if (bailOnError) return {\n n: null,\n pos\n };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {\n if (bailOnError) return {\n n: null,\n pos\n };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n ++pos;\n continue;\n }\n if (code >= 97) {\n val = code - 97 + 10;\n } else if (code >= 65) {\n val = code - 65 + 10;\n } else if (_isDigit(code)) {\n val = code - 48;\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n if (val <= 9 && bailOnError) {\n return {\n n: null,\n pos\n };\n } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || len != null && pos - start !== len || invalid) {\n return {\n n: null,\n pos\n };\n }\n return {\n n: total,\n pos\n };\n}\nfunction readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {\n const ch = input.charCodeAt(pos);\n let code;\n if (ch === 123) {\n ++pos;\n ({\n code,\n pos\n } = readHexChar(input, pos, lineStart, curLine, input.indexOf(\"}\", pos) - pos, true, throwOnInvalid, errors));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return {\n code: null,\n pos\n };\n }\n }\n } else {\n ({\n code,\n pos\n } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));\n }\n return {\n code,\n pos\n };\n}\n\nconst _excluded = [\"at\"],\n _excluded2 = [\"at\"];\nfunction buildPosition(pos, lineStart, curLine) {\n return new Position(curLine, pos - lineStart, pos);\n}\nconst VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]);\n\nclass Token {\n constructor(state) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n}\n\nclass Tokenizer extends CommentsParser {\n\n constructor(options, input) {\n super();\n this.isLookahead = void 0;\n this.tokens = [];\n this.errorHandlers_readInt = {\n invalidDigit: (pos, lineStart, curLine, radix) => {\n if (!this.options.errorRecovery) return false;\n this.raise(Errors.InvalidDigit, {\n at: buildPosition(pos, lineStart, curLine),\n radix\n });\n return true;\n },\n numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),\n unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator)\n };\n this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, {\n invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),\n invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint)\n });\n this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, {\n strictNumericEscape: (pos, lineStart, curLine) => {\n this.recordStrictModeErrors(Errors.StrictNumericEscape, {\n at: buildPosition(pos, lineStart, curLine)\n });\n },\n unterminated: (pos, lineStart, curLine) => {\n throw this.raise(Errors.UnterminatedString, {\n at: buildPosition(pos - 1, lineStart, curLine)\n });\n }\n });\n this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, {\n strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),\n unterminated: (pos, lineStart, curLine) => {\n throw this.raise(Errors.UnterminatedTemplate, {\n at: buildPosition(pos, lineStart, curLine)\n });\n }\n });\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n pushToken(token) {\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n next() {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type) {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n match(type) {\n return this.state.type === type;\n }\n\n createLookaheadState(state) {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition\n };\n }\n\n lookahead() {\n const old = this.state;\n this.state = this.createLookaheadState(old);\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n const curr = this.state;\n this.state = old;\n return curr;\n }\n nextTokenStart() {\n return this.nextTokenStartSince(this.state.pos);\n }\n nextTokenStartSince(pos) {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n lookaheadCharCode() {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n codePointAtPos(pos) {\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n setStrict(strict) {\n this.state.strict = strict;\n if (strict) {\n this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, {\n at\n }));\n this.state.strictErrors.clear();\n }\n }\n curContext() {\n return this.state.context[this.state.context.length - 1];\n }\n\n nextToken() {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(137);\n return;\n }\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n skipBlockComment(commentEnd) {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition()\n });\n }\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n if (this.isLookahead) return;\n\n const comment = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start,\n end: end + commentEnd.length,\n loc: new SourceLocation(startLoc, this.state.curPosition())\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n skipLineComment(startSkip) {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt(this.state.pos += startSkip);\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n if (this.isLookahead) return;\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n const comment = {\n type: \"CommentLine\",\n value,\n start,\n end,\n loc: new SourceLocation(startLoc, this.state.curPosition())\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipSpace() {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case 32:\n case 160:\n case 9:\n ++this.state.pos;\n break;\n case 13:\n if (this.input.charCodeAt(this.state.pos + 1) === 10) {\n ++this.state.pos;\n }\n case 10:\n case 8232:\n case 8233:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n case 47:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case 42:\n {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n case 47:\n {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n default:\n break loop;\n }\n break;\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (ch === 45 && !this.inModule) {\n const pos = this.state.pos;\n if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (ch === 60 && !this.inModule) {\n const pos = this.state.pos;\n if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {\n const comment = this.skipLineComment(4);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else {\n break loop;\n }\n }\n }\n if (comments.length > 0) {\n const end = this.state.pos;\n const commentWhitespace = {\n start: spaceStart,\n end,\n comments,\n leadingNode: null,\n trailingNode: null,\n containingNode: null\n };\n this.state.commentStack.push(commentWhitespace);\n }\n }\n\n finishToken(type, val) {\n this.state.end = this.state.pos;\n this.state.endLoc = this.state.curPosition();\n const prevType = this.state.type;\n this.state.type = type;\n this.state.value = val;\n if (!this.isLookahead) {\n this.updateContext(prevType);\n }\n }\n replaceToken(type) {\n this.state.type = type;\n this.updateContext();\n }\n\n readToken_numberSign() {\n if (this.state.pos === 0 && this.readToken_interpreter()) {\n return;\n }\n const nextPos = this.state.pos + 1;\n const next = this.codePointAtPos(nextPos);\n if (next >= 48 && next <= 57) {\n throw this.raise(Errors.UnexpectedDigitAfterHash, {\n at: this.state.curPosition()\n });\n }\n if (next === 123 || next === 91 && this.hasPlugin(\"recordAndTuple\")) {\n this.expectPlugin(\"recordAndTuple\");\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") === \"bar\") {\n throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, {\n at: this.state.curPosition()\n });\n }\n this.state.pos += 2;\n if (next === 123) {\n this.finishToken(7);\n } else {\n this.finishToken(1);\n }\n } else if (isIdentifierStart(next)) {\n ++this.state.pos;\n this.finishToken(136, this.readWord1(next));\n } else if (next === 92) {\n ++this.state.pos;\n this.finishToken(136, this.readWord1());\n } else {\n this.finishOp(27, 1);\n }\n }\n readToken_dot() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next >= 48 && next <= 57) {\n this.readNumber(true);\n return;\n }\n if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {\n this.state.pos += 3;\n this.finishToken(21);\n } else {\n ++this.state.pos;\n this.finishToken(16);\n }\n }\n readToken_slash() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === 61) {\n this.finishOp(31, 2);\n } else {\n this.finishOp(56, 1);\n }\n }\n readToken_interpreter() {\n if (this.state.pos !== 0 || this.length < 2) return false;\n let ch = this.input.charCodeAt(this.state.pos + 1);\n if (ch !== 33) return false;\n const start = this.state.pos;\n this.state.pos += 1;\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n const value = this.input.slice(start + 2, this.state.pos);\n this.finishToken(28, value);\n return true;\n }\n readToken_mult_modulo(code) {\n let type = code === 42 ? 55 : 54;\n let width = 1;\n let next = this.input.charCodeAt(this.state.pos + 1);\n\n if (code === 42 && next === 42) {\n width++;\n next = this.input.charCodeAt(this.state.pos + 2);\n type = 57;\n }\n\n if (next === 61 && !this.state.inType) {\n width++;\n type = code === 37 ? 33 : 30;\n }\n this.finishOp(type, width);\n }\n readToken_pipe_amp(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === code) {\n if (this.input.charCodeAt(this.state.pos + 2) === 61) {\n this.finishOp(30, 3);\n } else {\n this.finishOp(code === 124 ? 41 : 42, 2);\n }\n return;\n }\n if (code === 124) {\n if (next === 62) {\n this.finishOp(39, 2);\n return;\n }\n if (this.hasPlugin(\"recordAndTuple\") && next === 125) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, {\n at: this.state.curPosition()\n });\n }\n this.state.pos += 2;\n this.finishToken(9);\n return;\n }\n\n if (this.hasPlugin(\"recordAndTuple\") && next === 93) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, {\n at: this.state.curPosition()\n });\n }\n this.state.pos += 2;\n this.finishToken(4);\n return;\n }\n }\n if (next === 61) {\n this.finishOp(30, 2);\n return;\n }\n this.finishOp(code === 124 ? 43 : 45, 1);\n }\n readToken_caret() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === 61 && !this.state.inType) {\n this.finishOp(32, 2);\n }\n else if (next === 94 &&\n this.hasPlugin([\"pipelineOperator\", {\n proposal: \"hack\",\n topicToken: \"^^\"\n }])) {\n this.finishOp(37, 2);\n\n const lookaheadCh = this.input.codePointAt(this.state.pos);\n if (lookaheadCh === 94) {\n throw this.unexpected();\n }\n }\n else {\n this.finishOp(44, 1);\n }\n }\n readToken_atSign() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === 64 && this.hasPlugin([\"pipelineOperator\", {\n proposal: \"hack\",\n topicToken: \"@@\"\n }])) {\n this.finishOp(38, 2);\n }\n else {\n this.finishOp(26, 1);\n }\n }\n readToken_plus_min(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === code) {\n this.finishOp(34, 2);\n return;\n }\n if (next === 61) {\n this.finishOp(30, 2);\n } else {\n this.finishOp(53, 1);\n }\n }\n readToken_lt() {\n const {\n pos\n } = this.state;\n const next = this.input.charCodeAt(pos + 1);\n if (next === 60) {\n if (this.input.charCodeAt(pos + 2) === 61) {\n this.finishOp(30, 3);\n return;\n }\n this.finishOp(51, 2);\n return;\n }\n if (next === 61) {\n this.finishOp(49, 2);\n return;\n }\n this.finishOp(47, 1);\n }\n readToken_gt() {\n const {\n pos\n } = this.state;\n const next = this.input.charCodeAt(pos + 1);\n if (next === 62) {\n const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(pos + size) === 61) {\n this.finishOp(30, size + 1);\n return;\n }\n this.finishOp(52, size);\n return;\n }\n if (next === 61) {\n this.finishOp(49, 2);\n return;\n }\n this.finishOp(48, 1);\n }\n readToken_eq_excl(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === 61) {\n this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);\n return;\n }\n if (code === 61 && next === 62) {\n this.state.pos += 2;\n this.finishToken(19);\n return;\n }\n this.finishOp(code === 61 ? 29 : 35, 1);\n }\n readToken_question() {\n const next = this.input.charCodeAt(this.state.pos + 1);\n const next2 = this.input.charCodeAt(this.state.pos + 2);\n if (next === 63) {\n if (next2 === 61) {\n this.finishOp(30, 3);\n } else {\n this.finishOp(40, 2);\n }\n } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {\n this.state.pos += 2;\n this.finishToken(18);\n } else {\n ++this.state.pos;\n this.finishToken(17);\n }\n }\n getTokenFromCode(code) {\n switch (code) {\n\n case 46:\n this.readToken_dot();\n return;\n\n case 40:\n ++this.state.pos;\n this.finishToken(10);\n return;\n case 41:\n ++this.state.pos;\n this.finishToken(11);\n return;\n case 59:\n ++this.state.pos;\n this.finishToken(13);\n return;\n case 44:\n ++this.state.pos;\n this.finishToken(12);\n return;\n case 91:\n if (this.hasPlugin(\"recordAndTuple\") && this.input.charCodeAt(this.state.pos + 1) === 124) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, {\n at: this.state.curPosition()\n });\n }\n\n this.state.pos += 2;\n this.finishToken(2);\n } else {\n ++this.state.pos;\n this.finishToken(0);\n }\n return;\n case 93:\n ++this.state.pos;\n this.finishToken(3);\n return;\n case 123:\n if (this.hasPlugin(\"recordAndTuple\") && this.input.charCodeAt(this.state.pos + 1) === 124) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, {\n at: this.state.curPosition()\n });\n }\n\n this.state.pos += 2;\n this.finishToken(6);\n } else {\n ++this.state.pos;\n this.finishToken(5);\n }\n return;\n case 125:\n ++this.state.pos;\n this.finishToken(8);\n return;\n case 58:\n if (this.hasPlugin(\"functionBind\") && this.input.charCodeAt(this.state.pos + 1) === 58) {\n this.finishOp(15, 2);\n } else {\n ++this.state.pos;\n this.finishToken(14);\n }\n return;\n case 63:\n this.readToken_question();\n return;\n case 96:\n this.readTemplateToken();\n return;\n case 48:\n {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === 120 || next === 88) {\n this.readRadixNumber(16);\n return;\n }\n if (next === 111 || next === 79) {\n this.readRadixNumber(8);\n return;\n }\n if (next === 98 || next === 66) {\n this.readRadixNumber(2);\n return;\n }\n }\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n this.readNumber(false);\n return;\n\n case 34:\n case 39:\n this.readString(code);\n return;\n\n case 47:\n this.readToken_slash();\n return;\n case 37:\n case 42:\n this.readToken_mult_modulo(code);\n return;\n case 124:\n case 38:\n this.readToken_pipe_amp(code);\n return;\n case 94:\n this.readToken_caret();\n return;\n case 43:\n case 45:\n this.readToken_plus_min(code);\n return;\n case 60:\n this.readToken_lt();\n return;\n case 62:\n this.readToken_gt();\n return;\n case 61:\n case 33:\n this.readToken_eq_excl(code);\n return;\n case 126:\n this.finishOp(36, 1);\n return;\n case 64:\n this.readToken_atSign();\n return;\n case 35:\n this.readToken_numberSign();\n return;\n case 92:\n this.readWord();\n return;\n default:\n if (isIdentifierStart(code)) {\n this.readWord(code);\n return;\n }\n }\n throw this.raise(Errors.InvalidOrUnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: String.fromCodePoint(code)\n });\n }\n finishOp(type, size) {\n const str = this.input.slice(this.state.pos, this.state.pos + size);\n this.state.pos += size;\n this.finishToken(type, str);\n }\n readRegexp() {\n const startLoc = this.state.startLoc;\n const start = this.state.start + 1;\n let escaped, inClass;\n let {\n pos\n } = this.state;\n for (;; ++pos) {\n if (pos >= this.length) {\n throw this.raise(Errors.UnterminatedRegExp, {\n at: createPositionWithColumnOffset(startLoc, 1)\n });\n }\n const ch = this.input.charCodeAt(pos);\n if (isNewLine(ch)) {\n throw this.raise(Errors.UnterminatedRegExp, {\n at: createPositionWithColumnOffset(startLoc, 1)\n });\n }\n if (escaped) {\n escaped = false;\n } else {\n if (ch === 91) {\n inClass = true;\n } else if (ch === 93 && inClass) {\n inClass = false;\n } else if (ch === 47 && !inClass) {\n break;\n }\n escaped = ch === 92;\n }\n }\n const content = this.input.slice(start, pos);\n ++pos;\n let mods = \"\";\n const nextPos = () =>\n createPositionWithColumnOffset(startLoc, pos + 2 - start);\n while (pos < this.length) {\n const cp = this.codePointAtPos(pos);\n const char = String.fromCharCode(cp);\n\n if (VALID_REGEX_FLAGS.has(cp)) {\n if (cp === 118) {\n this.expectPlugin(\"regexpUnicodeSets\", nextPos());\n if (mods.includes(\"u\")) {\n this.raise(Errors.IncompatibleRegExpUVFlags, {\n at: nextPos()\n });\n }\n } else if (cp === 117) {\n if (mods.includes(\"v\")) {\n this.raise(Errors.IncompatibleRegExpUVFlags, {\n at: nextPos()\n });\n }\n }\n if (mods.includes(char)) {\n this.raise(Errors.DuplicateRegExpFlags, {\n at: nextPos()\n });\n }\n } else if (isIdentifierChar(cp) || cp === 92) {\n this.raise(Errors.MalformedRegExpFlags, {\n at: nextPos()\n });\n } else {\n break;\n }\n ++pos;\n mods += char;\n }\n this.state.pos = pos;\n this.finishToken(135, {\n pattern: content,\n flags: mods\n });\n }\n\n readInt(radix, len, forceLen = false, allowNumSeparator = true) {\n const {\n n,\n pos\n } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false);\n this.state.pos = pos;\n return n;\n }\n readRadixNumber(radix) {\n const startLoc = this.state.curPosition();\n let isBigInt = false;\n this.state.pos += 2;\n const val = this.readInt(radix);\n if (val == null) {\n this.raise(Errors.InvalidDigit, {\n at: createPositionWithColumnOffset(startLoc, 2),\n radix\n });\n }\n const next = this.input.charCodeAt(this.state.pos);\n if (next === 110) {\n ++this.state.pos;\n isBigInt = true;\n } else if (next === 109) {\n throw this.raise(Errors.InvalidDecimal, {\n at: startLoc\n });\n }\n if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {\n throw this.raise(Errors.NumberIdentifier, {\n at: this.state.curPosition()\n });\n }\n if (isBigInt) {\n const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, \"\");\n this.finishToken(133, str);\n return;\n }\n this.finishToken(132, val);\n }\n\n readNumber(startsWithDot) {\n const start = this.state.pos;\n const startLoc = this.state.curPosition();\n let isFloat = false;\n let isBigInt = false;\n let isDecimal = false;\n let hasExponent = false;\n let isOctal = false;\n if (!startsWithDot && this.readInt(10) === null) {\n this.raise(Errors.InvalidNumber, {\n at: this.state.curPosition()\n });\n }\n const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;\n if (hasLeadingZero) {\n const integer = this.input.slice(start, this.state.pos);\n this.recordStrictModeErrors(Errors.StrictOctalLiteral, {\n at: startLoc\n });\n if (!this.state.strict) {\n const underscorePos = integer.indexOf(\"_\");\n if (underscorePos > 0) {\n this.raise(Errors.ZeroDigitNumericSeparator, {\n at: createPositionWithColumnOffset(startLoc, underscorePos)\n });\n }\n }\n isOctal = hasLeadingZero && !/[89]/.test(integer);\n }\n let next = this.input.charCodeAt(this.state.pos);\n if (next === 46 && !isOctal) {\n ++this.state.pos;\n this.readInt(10);\n isFloat = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n if ((next === 69 || next === 101) && !isOctal) {\n next = this.input.charCodeAt(++this.state.pos);\n if (next === 43 || next === 45) {\n ++this.state.pos;\n }\n if (this.readInt(10) === null) {\n this.raise(Errors.InvalidOrMissingExponent, {\n at: startLoc\n });\n }\n isFloat = true;\n hasExponent = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n if (next === 110) {\n if (isFloat || hasLeadingZero) {\n this.raise(Errors.InvalidBigIntLiteral, {\n at: startLoc\n });\n }\n ++this.state.pos;\n isBigInt = true;\n }\n if (next === 109) {\n this.expectPlugin(\"decimal\", this.state.curPosition());\n if (hasExponent || hasLeadingZero) {\n this.raise(Errors.InvalidDecimal, {\n at: startLoc\n });\n }\n ++this.state.pos;\n isDecimal = true;\n }\n if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {\n throw this.raise(Errors.NumberIdentifier, {\n at: this.state.curPosition()\n });\n }\n\n const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, \"\");\n if (isBigInt) {\n this.finishToken(133, str);\n return;\n }\n if (isDecimal) {\n this.finishToken(134, str);\n return;\n }\n const val = isOctal ? parseInt(str, 8) : parseFloat(str);\n this.finishToken(132, val);\n }\n\n readCodePoint(throwOnInvalid) {\n const {\n code,\n pos\n } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint);\n this.state.pos = pos;\n return code;\n }\n readString(quote) {\n const {\n str,\n pos,\n curLine,\n lineStart\n } = readStringContents(quote === 34 ? \"double\" : \"single\", this.input, this.state.pos + 1,\n this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);\n this.state.pos = pos + 1;\n this.state.lineStart = lineStart;\n this.state.curLine = curLine;\n this.finishToken(131, str);\n }\n\n readTemplateContinuation() {\n if (!this.match(8)) {\n this.unexpected(null, 8);\n }\n this.state.pos--;\n this.readTemplateToken();\n }\n\n readTemplateToken() {\n const opening = this.input[this.state.pos];\n const {\n str,\n firstInvalidLoc,\n pos,\n curLine,\n lineStart\n } = readStringContents(\"template\", this.input, this.state.pos + 1,\n this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);\n this.state.pos = pos + 1;\n this.state.lineStart = lineStart;\n this.state.curLine = curLine;\n if (firstInvalidLoc) {\n this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos);\n }\n if (this.input.codePointAt(pos) === 96) {\n this.finishToken(24, firstInvalidLoc ? null : opening + str + \"`\");\n } else {\n this.state.pos++;\n this.finishToken(25, firstInvalidLoc ? null : opening + str + \"${\");\n }\n }\n recordStrictModeErrors(toParseError, {\n at\n }) {\n const index = at.index;\n if (this.state.strict && !this.state.strictErrors.has(index)) {\n this.raise(toParseError, {\n at\n });\n } else {\n this.state.strictErrors.set(index, [toParseError, at]);\n }\n }\n\n readWord1(firstCode) {\n this.state.containsEsc = false;\n let word = \"\";\n const start = this.state.pos;\n let chunkStart = this.state.pos;\n if (firstCode !== undefined) {\n this.state.pos += firstCode <= 0xffff ? 1 : 2;\n }\n while (this.state.pos < this.length) {\n const ch = this.codePointAtPos(this.state.pos);\n if (isIdentifierChar(ch)) {\n this.state.pos += ch <= 0xffff ? 1 : 2;\n } else if (ch === 92) {\n this.state.containsEsc = true;\n word += this.input.slice(chunkStart, this.state.pos);\n const escStart = this.state.curPosition();\n const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;\n if (this.input.charCodeAt(++this.state.pos) !== 117) {\n this.raise(Errors.MissingUnicodeEscape, {\n at: this.state.curPosition()\n });\n chunkStart = this.state.pos - 1;\n continue;\n }\n ++this.state.pos;\n const esc = this.readCodePoint(true);\n if (esc !== null) {\n if (!identifierCheck(esc)) {\n this.raise(Errors.EscapedCharNotAnIdentifier, {\n at: escStart\n });\n }\n word += String.fromCodePoint(esc);\n }\n chunkStart = this.state.pos;\n } else {\n break;\n }\n }\n return word + this.input.slice(chunkStart, this.state.pos);\n }\n\n readWord(firstCode) {\n const word = this.readWord1(firstCode);\n const type = keywords$1.get(word);\n if (type !== undefined) {\n this.finishToken(type, tokenLabelName(type));\n } else {\n this.finishToken(130, word);\n }\n }\n checkKeywordEscapes() {\n const {\n type\n } = this.state;\n if (tokenIsKeyword(type) && this.state.containsEsc) {\n this.raise(Errors.InvalidEscapedReservedWord, {\n at: this.state.startLoc,\n reservedWord: tokenLabelName(type)\n });\n }\n }\n\n raise(toParseError, raiseProperties) {\n const {\n at\n } = raiseProperties,\n details = _objectWithoutPropertiesLoose(raiseProperties, _excluded);\n const loc = at instanceof Position ? at : at.loc.start;\n const error = toParseError({\n loc,\n details\n });\n if (!this.options.errorRecovery) throw error;\n if (!this.isLookahead) this.state.errors.push(error);\n return error;\n }\n\n raiseOverwrite(toParseError, raiseProperties) {\n const {\n at\n } = raiseProperties,\n details = _objectWithoutPropertiesLoose(raiseProperties, _excluded2);\n const loc = at instanceof Position ? at : at.loc.start;\n const pos = loc.index;\n const errors = this.state.errors;\n for (let i = errors.length - 1; i >= 0; i--) {\n const error = errors[i];\n if (error.loc.index === pos) {\n return errors[i] = toParseError({\n loc,\n details\n });\n }\n if (error.loc.index < pos) break;\n }\n return this.raise(toParseError, raiseProperties);\n }\n\n updateContext(prevType) {}\n\n unexpected(loc, type) {\n throw this.raise(Errors.UnexpectedToken, {\n expected: type ? tokenLabelName(type) : null,\n at: loc != null ? loc : this.state.startLoc\n });\n }\n expectPlugin(pluginName, loc) {\n if (this.hasPlugin(pluginName)) {\n return true;\n }\n throw this.raise(Errors.MissingPlugin, {\n at: loc != null ? loc : this.state.startLoc,\n missingPlugin: [pluginName]\n });\n }\n expectOnePlugin(pluginNames) {\n if (!pluginNames.some(name => this.hasPlugin(name))) {\n throw this.raise(Errors.MissingOneOfPlugins, {\n at: this.state.startLoc,\n missingPlugin: pluginNames\n });\n }\n }\n errorBuilder(error) {\n return (pos, lineStart, curLine) => {\n this.raise(error, {\n at: buildPosition(pos, lineStart, curLine)\n });\n };\n }\n}\n\nclass ClassScope {\n constructor() {\n this.privateNames = new Set();\n this.loneAccessors = new Map();\n this.undefinedPrivateNames = new Map();\n }\n}\nclass ClassScopeHandler {\n constructor(parser) {\n this.parser = void 0;\n this.stack = [];\n this.undefinedPrivateNames = new Map();\n this.parser = parser;\n }\n current() {\n return this.stack[this.stack.length - 1];\n }\n enter() {\n this.stack.push(new ClassScope());\n }\n exit() {\n const oldClassScope = this.stack.pop();\n\n const current = this.current();\n\n for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {\n if (current) {\n if (!current.undefinedPrivateNames.has(name)) {\n current.undefinedPrivateNames.set(name, loc);\n }\n } else {\n this.parser.raise(Errors.InvalidPrivateFieldResolution, {\n at: loc,\n identifierName: name\n });\n }\n }\n }\n declarePrivateName(name, elementType, loc) {\n const {\n privateNames,\n loneAccessors,\n undefinedPrivateNames\n } = this.current();\n let redefined = privateNames.has(name);\n if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {\n const accessor = redefined && loneAccessors.get(name);\n if (accessor) {\n const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;\n const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;\n const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;\n const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;\n\n redefined = oldKind === newKind || oldStatic !== newStatic;\n if (!redefined) loneAccessors.delete(name);\n } else if (!redefined) {\n loneAccessors.set(name, elementType);\n }\n }\n if (redefined) {\n this.parser.raise(Errors.PrivateNameRedeclaration, {\n at: loc,\n identifierName: name\n });\n }\n privateNames.add(name);\n undefinedPrivateNames.delete(name);\n }\n usePrivateName(name, loc) {\n let classScope;\n for (classScope of this.stack) {\n if (classScope.privateNames.has(name)) return;\n }\n if (classScope) {\n classScope.undefinedPrivateNames.set(name, loc);\n } else {\n this.parser.raise(Errors.InvalidPrivateFieldResolution, {\n at: loc,\n identifierName: name\n });\n }\n }\n}\n\nconst kExpression = 0,\n kMaybeArrowParameterDeclaration = 1,\n kMaybeAsyncArrowParameterDeclaration = 2,\n kParameterDeclaration = 3;\nclass ExpressionScope {\n constructor(type = kExpression) {\n this.type = void 0;\n this.type = type;\n }\n canBeArrowParameterDeclaration() {\n return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration;\n }\n isCertainlyParameterDeclaration() {\n return this.type === kParameterDeclaration;\n }\n}\nclass ArrowHeadParsingScope extends ExpressionScope {\n constructor(type) {\n super(type);\n this.declarationErrors = new Map();\n }\n recordDeclarationError(ParsingErrorClass, {\n at\n }) {\n const index = at.index;\n this.declarationErrors.set(index, [ParsingErrorClass, at]);\n }\n clearDeclarationError(index) {\n this.declarationErrors.delete(index);\n }\n iterateErrors(iterator) {\n this.declarationErrors.forEach(iterator);\n }\n}\nclass ExpressionScopeHandler {\n constructor(parser) {\n this.parser = void 0;\n this.stack = [new ExpressionScope()];\n this.parser = parser;\n }\n enter(scope) {\n this.stack.push(scope);\n }\n exit() {\n this.stack.pop();\n }\n\n recordParameterInitializerError(toParseError, {\n at: node\n }) {\n const origin = {\n at: node.loc.start\n };\n const {\n stack\n } = this;\n let i = stack.length - 1;\n let scope = stack[i];\n while (!scope.isCertainlyParameterDeclaration()) {\n if (scope.canBeArrowParameterDeclaration()) {\n scope.recordDeclarationError(toParseError, origin);\n } else {\n return;\n }\n scope = stack[--i];\n }\n this.parser.raise(toParseError, origin);\n }\n\n recordArrowParemeterBindingError(error, {\n at: node\n }) {\n const {\n stack\n } = this;\n const scope = stack[stack.length - 1];\n const origin = {\n at: node.loc.start\n };\n if (scope.isCertainlyParameterDeclaration()) {\n this.parser.raise(error, origin);\n } else if (scope.canBeArrowParameterDeclaration()) {\n scope.recordDeclarationError(error, origin);\n } else {\n return;\n }\n }\n\n recordAsyncArrowParametersError({\n at\n }) {\n const {\n stack\n } = this;\n let i = stack.length - 1;\n let scope = stack[i];\n while (scope.canBeArrowParameterDeclaration()) {\n if (scope.type === kMaybeAsyncArrowParameterDeclaration) {\n scope.recordDeclarationError(Errors.AwaitBindingIdentifier, {\n at\n });\n }\n scope = stack[--i];\n }\n }\n validateAsPattern() {\n const {\n stack\n } = this;\n const currentScope = stack[stack.length - 1];\n if (!currentScope.canBeArrowParameterDeclaration()) return;\n currentScope.iterateErrors(([toParseError, loc]) => {\n this.parser.raise(toParseError, {\n at: loc\n });\n let i = stack.length - 2;\n let scope = stack[i];\n while (scope.canBeArrowParameterDeclaration()) {\n scope.clearDeclarationError(loc.index);\n scope = stack[--i];\n }\n });\n }\n}\nfunction newParameterDeclarationScope() {\n return new ExpressionScope(kParameterDeclaration);\n}\nfunction newArrowHeadScope() {\n return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);\n}\nfunction newAsyncArrowScope() {\n return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);\n}\nfunction newExpressionScope() {\n return new ExpressionScope();\n}\n\nconst\n PARAM = 0b0000,\n PARAM_YIELD = 0b0001,\n PARAM_AWAIT = 0b0010,\n PARAM_RETURN = 0b0100,\n PARAM_IN = 0b1000;\n\nclass ProductionParameterHandler {\n constructor() {\n this.stacks = [];\n }\n enter(flags) {\n this.stacks.push(flags);\n }\n exit() {\n this.stacks.pop();\n }\n currentFlags() {\n return this.stacks[this.stacks.length - 1];\n }\n get hasAwait() {\n return (this.currentFlags() & PARAM_AWAIT) > 0;\n }\n get hasYield() {\n return (this.currentFlags() & PARAM_YIELD) > 0;\n }\n get hasReturn() {\n return (this.currentFlags() & PARAM_RETURN) > 0;\n }\n get hasIn() {\n return (this.currentFlags() & PARAM_IN) > 0;\n }\n}\nfunction functionFlags(isAsync, isGenerator) {\n return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);\n}\n\nclass UtilParser extends Tokenizer {\n\n addExtra(node, key, value, enumerable = true) {\n if (!node) return;\n const extra = node.extra = node.extra || {};\n if (enumerable) {\n extra[key] = value;\n } else {\n Object.defineProperty(extra, key, {\n enumerable,\n value\n });\n }\n }\n\n isContextual(token) {\n return this.state.type === token && !this.state.containsEsc;\n }\n isUnparsedContextual(nameStart, name) {\n const nameEnd = nameStart + name.length;\n if (this.input.slice(nameStart, nameEnd) === name) {\n const nextCh = this.input.charCodeAt(nameEnd);\n return !(isIdentifierChar(nextCh) ||\n (nextCh & 0xfc00) === 0xd800);\n }\n return false;\n }\n isLookaheadContextual(name) {\n const next = this.nextTokenStart();\n return this.isUnparsedContextual(next, name);\n }\n\n eatContextual(token) {\n if (this.isContextual(token)) {\n this.next();\n return true;\n }\n return false;\n }\n\n expectContextual(token, toParseError) {\n if (!this.eatContextual(token)) {\n if (toParseError != null) {\n throw this.raise(toParseError, {\n at: this.state.startLoc\n });\n }\n throw this.unexpected(null, token);\n }\n }\n\n canInsertSemicolon() {\n return this.match(137) || this.match(8) || this.hasPrecedingLineBreak();\n }\n hasPrecedingLineBreak() {\n return lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start));\n }\n hasFollowingLineBreak() {\n skipWhiteSpaceToLineBreak.lastIndex = this.state.end;\n return skipWhiteSpaceToLineBreak.test(this.input);\n }\n\n isLineTerminator() {\n return this.eat(13) || this.canInsertSemicolon();\n }\n\n semicolon(allowAsi = true) {\n if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;\n this.raise(Errors.MissingSemicolon, {\n at: this.state.lastTokEndLoc\n });\n }\n\n expect(type, loc) {\n this.eat(type) || this.unexpected(loc, type);\n }\n\n tryParse(fn, oldState = this.state.clone()) {\n const abortSignal = {\n node: null\n };\n try {\n const node = fn((node = null) => {\n abortSignal.node = node;\n throw abortSignal;\n });\n if (this.state.errors.length > oldState.errors.length) {\n const failState = this.state;\n this.state = oldState;\n this.state.tokensLength = failState.tokensLength;\n return {\n node,\n error: failState.errors[oldState.errors.length],\n thrown: false,\n aborted: false,\n failState\n };\n }\n return {\n node,\n error: null,\n thrown: false,\n aborted: false,\n failState: null\n };\n } catch (error) {\n const failState = this.state;\n this.state = oldState;\n if (error instanceof SyntaxError) {\n return {\n node: null,\n error,\n thrown: true,\n aborted: false,\n failState\n };\n }\n if (error === abortSignal) {\n return {\n node: abortSignal.node,\n error: null,\n thrown: false,\n aborted: true,\n failState\n };\n }\n throw error;\n }\n }\n checkExpressionErrors(refExpressionErrors, andThrow) {\n if (!refExpressionErrors) return false;\n const {\n shorthandAssignLoc,\n doubleProtoLoc,\n privateKeyLoc,\n optionalParametersLoc\n } = refExpressionErrors;\n const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc;\n if (!andThrow) {\n return hasErrors;\n }\n if (shorthandAssignLoc != null) {\n this.raise(Errors.InvalidCoverInitializedName, {\n at: shorthandAssignLoc\n });\n }\n if (doubleProtoLoc != null) {\n this.raise(Errors.DuplicateProto, {\n at: doubleProtoLoc\n });\n }\n if (privateKeyLoc != null) {\n this.raise(Errors.UnexpectedPrivateField, {\n at: privateKeyLoc\n });\n }\n if (optionalParametersLoc != null) {\n this.unexpected(optionalParametersLoc);\n }\n }\n\n isLiteralPropertyName() {\n return tokenIsLiteralPropertyName(this.state.type);\n }\n\n isPrivateName(node) {\n return node.type === \"PrivateName\";\n }\n\n getPrivateNameSV(node) {\n return node.id.name;\n }\n\n hasPropertyAsPrivateName(node) {\n return (node.type === \"MemberExpression\" || node.type === \"OptionalMemberExpression\") && this.isPrivateName(node.property);\n }\n isOptionalChain(node) {\n return node.type === \"OptionalMemberExpression\" || node.type === \"OptionalCallExpression\";\n }\n isObjectProperty(node) {\n return node.type === \"ObjectProperty\";\n }\n isObjectMethod(node) {\n return node.type === \"ObjectMethod\";\n }\n initializeScopes(inModule = this.options.sourceType === \"module\") {\n const oldLabels = this.state.labels;\n this.state.labels = [];\n const oldExportedIdentifiers = this.exportedIdentifiers;\n this.exportedIdentifiers = new Set();\n\n const oldInModule = this.inModule;\n this.inModule = inModule;\n const oldScope = this.scope;\n const ScopeHandler = this.getScopeHandler();\n this.scope = new ScopeHandler(this, inModule);\n const oldProdParam = this.prodParam;\n this.prodParam = new ProductionParameterHandler();\n const oldClassScope = this.classScope;\n this.classScope = new ClassScopeHandler(this);\n const oldExpressionScope = this.expressionScope;\n this.expressionScope = new ExpressionScopeHandler(this);\n return () => {\n this.state.labels = oldLabels;\n this.exportedIdentifiers = oldExportedIdentifiers;\n\n this.inModule = oldInModule;\n this.scope = oldScope;\n this.prodParam = oldProdParam;\n this.classScope = oldClassScope;\n this.expressionScope = oldExpressionScope;\n };\n }\n enterInitialScopes() {\n let paramFlags = PARAM;\n if (this.inModule) {\n paramFlags |= PARAM_AWAIT;\n }\n this.scope.enter(SCOPE_PROGRAM);\n this.prodParam.enter(paramFlags);\n }\n checkDestructuringPrivate(refExpressionErrors) {\n const {\n privateKeyLoc\n } = refExpressionErrors;\n if (privateKeyLoc !== null) {\n this.expectPlugin(\"destructuringPrivate\", privateKeyLoc);\n }\n }\n}\n\nclass ExpressionErrors {\n constructor() {\n this.shorthandAssignLoc = null;\n this.doubleProtoLoc = null;\n this.privateKeyLoc = null;\n this.optionalParametersLoc = null;\n }\n}\n\nclass Node {\n constructor(parser, pos, loc) {\n this.type = \"\";\n this.start = pos;\n this.end = 0;\n this.loc = new SourceLocation(loc);\n if (parser != null && parser.options.ranges) this.range = [pos, 0];\n if (parser != null && parser.filename) this.loc.filename = parser.filename;\n }\n}\nconst NodePrototype = Node.prototype;\n{\n NodePrototype.__clone = function () {\n const newNode = new Node(undefined, this.start, this.loc.start);\n const keys = Object.keys(this);\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n if (key !== \"leadingComments\" && key !== \"trailingComments\" && key !== \"innerComments\") {\n newNode[key] = this[key];\n }\n }\n return newNode;\n };\n}\nfunction clonePlaceholder(node) {\n return cloneIdentifier(node);\n}\nfunction cloneIdentifier(node) {\n const {\n type,\n start,\n end,\n loc,\n range,\n extra,\n name\n } = node;\n const cloned = Object.create(NodePrototype);\n cloned.type = type;\n cloned.start = start;\n cloned.end = end;\n cloned.loc = loc;\n cloned.range = range;\n cloned.extra = extra;\n cloned.name = name;\n if (type === \"Placeholder\") {\n cloned.expectedNode = node.expectedNode;\n }\n return cloned;\n}\nfunction cloneStringLiteral(node) {\n const {\n type,\n start,\n end,\n loc,\n range,\n extra\n } = node;\n if (type === \"Placeholder\") {\n return clonePlaceholder(node);\n }\n const cloned = Object.create(NodePrototype);\n cloned.type = type;\n cloned.start = start;\n cloned.end = end;\n cloned.loc = loc;\n cloned.range = range;\n if (node.raw !== undefined) {\n cloned.raw = node.raw;\n } else {\n cloned.extra = extra;\n }\n cloned.value = node.value;\n return cloned;\n}\nclass NodeUtils extends UtilParser {\n startNode() {\n return new Node(this, this.state.start, this.state.startLoc);\n }\n startNodeAt(loc) {\n return new Node(this, loc.index, loc);\n }\n\n startNodeAtNode(type) {\n return this.startNodeAt(type.loc.start);\n }\n\n finishNode(node, type) {\n return this.finishNodeAt(node, type, this.state.lastTokEndLoc);\n }\n\n finishNodeAt(node, type, endLoc) {\n node.type = type;\n node.end = endLoc.index;\n node.loc.end = endLoc;\n if (this.options.ranges) node.range[1] = endLoc.index;\n if (this.options.attachComment) this.processComment(node);\n return node;\n }\n resetStartLocation(node, startLoc) {\n node.start = startLoc.index;\n node.loc.start = startLoc;\n if (this.options.ranges) node.range[0] = startLoc.index;\n }\n resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {\n node.end = endLoc.index;\n node.loc.end = endLoc;\n if (this.options.ranges) node.range[1] = endLoc.index;\n }\n\n resetStartLocationFromNode(node, locationNode) {\n this.resetStartLocation(node, locationNode.loc.start);\n }\n}\n\nconst reservedTypes = new Set([\"_\", \"any\", \"bool\", \"boolean\", \"empty\", \"extends\", \"false\", \"interface\", \"mixed\", \"null\", \"number\", \"static\", \"string\", \"true\", \"typeof\", \"void\"]);\n\nconst FlowErrors = ParseErrorEnum`flow`({\n AmbiguousConditionalArrow: \"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.\",\n AmbiguousDeclareModuleKind: \"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.\",\n AssignReservedType: ({\n reservedType\n }) => `Cannot overwrite reserved type ${reservedType}.`,\n DeclareClassElement: \"The `declare` modifier can only appear on class fields.\",\n DeclareClassFieldInitializer: \"Initializers are not allowed in fields with the `declare` modifier.\",\n DuplicateDeclareModuleExports: \"Duplicate `declare module.exports` statement.\",\n EnumBooleanMemberNotInitialized: ({\n memberName,\n enumName\n }) => `Boolean enum members need to be initialized. Use either \\`${memberName} = true,\\` or \\`${memberName} = false,\\` in enum \\`${enumName}\\`.`,\n EnumDuplicateMemberName: ({\n memberName,\n enumName\n }) => `Enum member names need to be unique, but the name \\`${memberName}\\` has already been used before in enum \\`${enumName}\\`.`,\n EnumInconsistentMemberValues: ({\n enumName\n }) => `Enum \\`${enumName}\\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,\n EnumInvalidExplicitType: ({\n invalidEnumType,\n enumName\n }) => `Enum type \\`${invalidEnumType}\\` is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n EnumInvalidExplicitTypeUnknownSupplied: ({\n enumName\n }) => `Supplied enum type is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n EnumInvalidMemberInitializerPrimaryType: ({\n enumName,\n memberName,\n explicitType\n }) => `Enum \\`${enumName}\\` has type \\`${explicitType}\\`, so the initializer of \\`${memberName}\\` needs to be a ${explicitType} literal.`,\n EnumInvalidMemberInitializerSymbolType: ({\n enumName,\n memberName\n }) => `Symbol enum members cannot be initialized. Use \\`${memberName},\\` in enum \\`${enumName}\\`.`,\n EnumInvalidMemberInitializerUnknownType: ({\n enumName,\n memberName\n }) => `The enum member initializer for \\`${memberName}\\` needs to be a literal (either a boolean, number, or string) in enum \\`${enumName}\\`.`,\n EnumInvalidMemberName: ({\n enumName,\n memberName,\n suggestion\n }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \\`${memberName}\\`, consider using \\`${suggestion}\\`, in enum \\`${enumName}\\`.`,\n EnumNumberMemberNotInitialized: ({\n enumName,\n memberName\n }) => `Number enum members need to be initialized, e.g. \\`${memberName} = 1\\` in enum \\`${enumName}\\`.`,\n EnumStringMemberInconsistentlyInitailized: ({\n enumName\n }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \\`${enumName}\\`.`,\n GetterMayNotHaveThisParam: \"A getter cannot have a `this` parameter.\",\n ImportReflectionHasImportType: \"An `import module` declaration can not use `type` or `typeof` keyword.\",\n ImportTypeShorthandOnlyInPureImport: \"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.\",\n InexactInsideExact: \"Explicit inexact syntax cannot appear inside an explicit exact object type.\",\n InexactInsideNonObject: \"Explicit inexact syntax cannot appear in class or interface definitions.\",\n InexactVariance: \"Explicit inexact syntax cannot have variance.\",\n InvalidNonTypeImportInDeclareModule: \"Imports within a `declare module` body must always be `import type` or `import typeof`.\",\n MissingTypeParamDefault: \"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.\",\n NestedDeclareModule: \"`declare module` cannot be used inside another `declare module`.\",\n NestedFlowComment: \"Cannot have a flow comment inside another flow comment.\",\n PatternIsOptional: Object.assign({\n message: \"A binding pattern parameter cannot be optional in an implementation signature.\"\n }, {\n reasonCode: \"OptionalBindingPattern\"\n }),\n SetterMayNotHaveThisParam: \"A setter cannot have a `this` parameter.\",\n SpreadVariance: \"Spread properties cannot have variance.\",\n ThisParamAnnotationRequired: \"A type annotation is required for the `this` parameter.\",\n ThisParamBannedInConstructor: \"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.\",\n ThisParamMayNotBeOptional: \"The `this` parameter cannot be optional.\",\n ThisParamMustBeFirst: \"The `this` parameter must be the first function parameter.\",\n ThisParamNoDefault: \"The `this` parameter may not have a default value.\",\n TypeBeforeInitializer: \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.\",\n TypeCastInPattern: \"The type cast expression is expected to be wrapped with parenthesis.\",\n UnexpectedExplicitInexactInObject: \"Explicit inexact syntax must appear at the end of an inexact object.\",\n UnexpectedReservedType: ({\n reservedType\n }) => `Unexpected reserved type ${reservedType}.`,\n UnexpectedReservedUnderscore: \"`_` is only allowed as a type argument to call or new.\",\n UnexpectedSpaceBetweenModuloChecks: \"Spaces between `%` and `checks` are not allowed here.\",\n UnexpectedSpreadType: \"Spread operator cannot appear in class or interface definitions.\",\n UnexpectedSubtractionOperand: 'Unexpected token, expected \"number\" or \"bigint\".',\n UnexpectedTokenAfterTypeParameter: \"Expected an arrow function after this type parameter declaration.\",\n UnexpectedTypeParameterBeforeAsyncArrowFunction: \"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.\",\n UnsupportedDeclareExportKind: ({\n unsupportedExportKind,\n suggestion\n }) => `\\`declare export ${unsupportedExportKind}\\` is not supported. Use \\`${suggestion}\\` instead.`,\n UnsupportedStatementInDeclareModule: \"Only declares and type imports are allowed inside declare module.\",\n UnterminatedFlowComment: \"Unterminated flow-comment.\"\n});\n\nfunction isEsModuleType(bodyElement) {\n return bodyElement.type === \"DeclareExportAllDeclaration\" || bodyElement.type === \"DeclareExportDeclaration\" && (!bodyElement.declaration || bodyElement.declaration.type !== \"TypeAlias\" && bodyElement.declaration.type !== \"InterfaceDeclaration\");\n}\nfunction hasTypeImportKind(node) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n}\nfunction isMaybeDefaultImport(type) {\n return tokenIsKeywordOrIdentifier(type) && type !== 97;\n}\nconst exportSuggestions = {\n const: \"declare export var\",\n let: \"declare export var\",\n type: \"export type\",\n interface: \"export interface\"\n};\n\nfunction partition(list, test) {\n const list1 = [];\n const list2 = [];\n for (let i = 0; i < list.length; i++) {\n (test(list[i], i, list) ? list1 : list2).push(list[i]);\n }\n return [list1, list2];\n}\nconst FLOW_PRAGMA_REGEX = /\\*?\\s*@((?:no)?flow)\\b/;\n\nvar flow = (superClass => class FlowParserMixin extends superClass {\n constructor(...args) {\n super(...args);\n this.flowPragma = undefined;\n }\n getScopeHandler() {\n return FlowScopeHandler;\n }\n shouldParseTypes() {\n return this.getPluginOption(\"flow\", \"all\") || this.flowPragma === \"flow\";\n }\n shouldParseEnums() {\n return !!this.getPluginOption(\"flow\", \"enums\");\n }\n finishToken(type, val) {\n if (type !== 131 && type !== 13 && type !== 28) {\n if (this.flowPragma === undefined) {\n this.flowPragma = null;\n }\n }\n return super.finishToken(type, val);\n }\n addComment(comment) {\n if (this.flowPragma === undefined) {\n const matches = FLOW_PRAGMA_REGEX.exec(comment.value);\n if (!matches) ; else if (matches[1] === \"flow\") {\n this.flowPragma = \"flow\";\n } else if (matches[1] === \"noflow\") {\n this.flowPragma = \"noflow\";\n } else {\n throw new Error(\"Unexpected flow pragma\");\n }\n }\n return super.addComment(comment);\n }\n flowParseTypeInitialiser(tok) {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tok || 14);\n const type = this.flowParseType();\n this.state.inType = oldInType;\n return type;\n }\n flowParsePredicate() {\n const node = this.startNode();\n const moduloLoc = this.state.startLoc;\n this.next();\n this.expectContextual(108);\n if (this.state.lastTokStart > moduloLoc.index + 1) {\n this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, {\n at: moduloLoc\n });\n }\n if (this.eat(10)) {\n node.value = super.parseExpression();\n this.expect(11);\n return this.finishNode(node, \"DeclaredPredicate\");\n } else {\n return this.finishNode(node, \"InferredPredicate\");\n }\n }\n flowParseTypeAndPredicateInitialiser() {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(14);\n let type = null;\n let predicate = null;\n if (this.match(54)) {\n this.state.inType = oldInType;\n predicate = this.flowParsePredicate();\n } else {\n type = this.flowParseType();\n this.state.inType = oldInType;\n if (this.match(54)) {\n predicate = this.flowParsePredicate();\n }\n }\n return [type, predicate];\n }\n flowParseDeclareClass(node) {\n this.next();\n this.flowParseInterfaceish(node, true);\n return this.finishNode(node, \"DeclareClass\");\n }\n flowParseDeclareFunction(node) {\n this.next();\n const id = node.id = this.parseIdentifier();\n const typeNode = this.startNode();\n const typeContainer = this.startNode();\n if (this.match(47)) {\n typeNode.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n typeNode.typeParameters = null;\n }\n this.expect(10);\n const tmp = this.flowParseFunctionTypeParams();\n typeNode.params = tmp.params;\n typeNode.rest = tmp.rest;\n typeNode.this = tmp._this;\n this.expect(11);\n [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();\n typeContainer.typeAnnotation = this.finishNode(typeNode, \"FunctionTypeAnnotation\");\n id.typeAnnotation = this.finishNode(typeContainer, \"TypeAnnotation\");\n this.resetEndLocation(id);\n this.semicolon();\n this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.loc.start);\n return this.finishNode(node, \"DeclareFunction\");\n }\n flowParseDeclare(node, insideModule) {\n if (this.match(80)) {\n return this.flowParseDeclareClass(node);\n } else if (this.match(68)) {\n return this.flowParseDeclareFunction(node);\n } else if (this.match(74)) {\n return this.flowParseDeclareVariable(node);\n } else if (this.eatContextual(125)) {\n if (this.match(16)) {\n return this.flowParseDeclareModuleExports(node);\n } else {\n if (insideModule) {\n this.raise(FlowErrors.NestedDeclareModule, {\n at: this.state.lastTokStartLoc\n });\n }\n return this.flowParseDeclareModule(node);\n }\n } else if (this.isContextual(128)) {\n return this.flowParseDeclareTypeAlias(node);\n } else if (this.isContextual(129)) {\n return this.flowParseDeclareOpaqueType(node);\n } else if (this.isContextual(127)) {\n return this.flowParseDeclareInterface(node);\n } else if (this.match(82)) {\n return this.flowParseDeclareExportDeclaration(node, insideModule);\n } else {\n throw this.unexpected();\n }\n }\n flowParseDeclareVariable(node) {\n this.next();\n node.id = this.flowParseTypeAnnotatableIdentifier(true);\n this.scope.declareName(node.id.name, BIND_VAR, node.id.loc.start);\n this.semicolon();\n return this.finishNode(node, \"DeclareVariable\");\n }\n flowParseDeclareModule(node) {\n this.scope.enter(SCOPE_OTHER);\n if (this.match(131)) {\n node.id = super.parseExprAtom();\n } else {\n node.id = this.parseIdentifier();\n }\n const bodyNode = node.body = this.startNode();\n const body = bodyNode.body = [];\n this.expect(5);\n while (!this.match(8)) {\n let bodyNode = this.startNode();\n if (this.match(83)) {\n this.next();\n if (!this.isContextual(128) && !this.match(87)) {\n this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, {\n at: this.state.lastTokStartLoc\n });\n }\n super.parseImport(bodyNode);\n } else {\n this.expectContextual(123, FlowErrors.UnsupportedStatementInDeclareModule);\n bodyNode = this.flowParseDeclare(bodyNode, true);\n }\n body.push(bodyNode);\n }\n this.scope.exit();\n this.expect(8);\n this.finishNode(bodyNode, \"BlockStatement\");\n let kind = null;\n let hasModuleExport = false;\n body.forEach(bodyElement => {\n if (isEsModuleType(bodyElement)) {\n if (kind === \"CommonJS\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, {\n at: bodyElement\n });\n }\n kind = \"ES\";\n } else if (bodyElement.type === \"DeclareModuleExports\") {\n if (hasModuleExport) {\n this.raise(FlowErrors.DuplicateDeclareModuleExports, {\n at: bodyElement\n });\n }\n if (kind === \"ES\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, {\n at: bodyElement\n });\n }\n kind = \"CommonJS\";\n hasModuleExport = true;\n }\n });\n node.kind = kind || \"CommonJS\";\n return this.finishNode(node, \"DeclareModule\");\n }\n flowParseDeclareExportDeclaration(node, insideModule) {\n this.expect(82);\n if (this.eat(65)) {\n if (this.match(68) || this.match(80)) {\n node.declaration = this.flowParseDeclare(this.startNode());\n } else {\n node.declaration = this.flowParseType();\n this.semicolon();\n }\n node.default = true;\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else {\n if (this.match(75) || this.isLet() || (this.isContextual(128) || this.isContextual(127)) && !insideModule) {\n const label = this.state.value;\n throw this.raise(FlowErrors.UnsupportedDeclareExportKind, {\n at: this.state.startLoc,\n unsupportedExportKind: label,\n suggestion: exportSuggestions[label]\n });\n }\n if (this.match(74) ||\n this.match(68) ||\n this.match(80) ||\n this.isContextual(129)) {\n node.declaration = this.flowParseDeclare(this.startNode());\n node.default = false;\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else if (this.match(55) ||\n this.match(5) ||\n this.isContextual(127) ||\n this.isContextual(128) ||\n this.isContextual(129)) {\n node = this.parseExport(node, null);\n if (node.type === \"ExportNamedDeclaration\") {\n node.type = \"ExportDeclaration\";\n node.default = false;\n delete node.exportKind;\n }\n node.type = \"Declare\" + node.type;\n return node;\n }\n }\n throw this.unexpected();\n }\n flowParseDeclareModuleExports(node) {\n this.next();\n this.expectContextual(109);\n node.typeAnnotation = this.flowParseTypeAnnotation();\n this.semicolon();\n return this.finishNode(node, \"DeclareModuleExports\");\n }\n flowParseDeclareTypeAlias(node) {\n this.next();\n const finished = this.flowParseTypeAlias(node);\n finished.type = \"DeclareTypeAlias\";\n return finished;\n }\n flowParseDeclareOpaqueType(node) {\n this.next();\n const finished = this.flowParseOpaqueType(node, true);\n finished.type = \"DeclareOpaqueType\";\n return finished;\n }\n flowParseDeclareInterface(node) {\n this.next();\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"DeclareInterface\");\n }\n\n flowParseInterfaceish(node, isClass = false) {\n node.id = this.flowParseRestrictedIdentifier(!isClass, true);\n this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.loc.start);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n node.extends = [];\n node.implements = [];\n node.mixins = [];\n if (this.eat(81)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (!isClass && this.eat(12));\n }\n if (this.isContextual(115)) {\n this.next();\n do {\n node.mixins.push(this.flowParseInterfaceExtends());\n } while (this.eat(12));\n }\n if (this.isContextual(111)) {\n this.next();\n do {\n node.implements.push(this.flowParseInterfaceExtends());\n } while (this.eat(12));\n }\n node.body = this.flowParseObjectType({\n allowStatic: isClass,\n allowExact: false,\n allowSpread: false,\n allowProto: isClass,\n allowInexact: false\n });\n }\n flowParseInterfaceExtends() {\n const node = this.startNode();\n node.id = this.flowParseQualifiedTypeIdentifier();\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n return this.finishNode(node, \"InterfaceExtends\");\n }\n flowParseInterface(node) {\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"InterfaceDeclaration\");\n }\n checkNotUnderscore(word) {\n if (word === \"_\") {\n this.raise(FlowErrors.UnexpectedReservedUnderscore, {\n at: this.state.startLoc\n });\n }\n }\n checkReservedType(word, startLoc, declaration) {\n if (!reservedTypes.has(word)) return;\n this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, {\n at: startLoc,\n reservedType: word\n });\n }\n flowParseRestrictedIdentifier(liberal, declaration) {\n this.checkReservedType(this.state.value, this.state.startLoc, declaration);\n return this.parseIdentifier(liberal);\n }\n\n flowParseTypeAlias(node) {\n node.id = this.flowParseRestrictedIdentifier(false, true);\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n node.right = this.flowParseTypeInitialiser(29);\n this.semicolon();\n return this.finishNode(node, \"TypeAlias\");\n }\n flowParseOpaqueType(node, declare) {\n this.expectContextual(128);\n node.id = this.flowParseRestrictedIdentifier(true, true);\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.supertype = null;\n if (this.match(14)) {\n node.supertype = this.flowParseTypeInitialiser(14);\n }\n node.impltype = null;\n if (!declare) {\n node.impltype = this.flowParseTypeInitialiser(29);\n }\n this.semicolon();\n return this.finishNode(node, \"OpaqueType\");\n }\n\n flowParseTypeParameter(requireDefault = false) {\n const nodeStartLoc = this.state.startLoc;\n const node = this.startNode();\n const variance = this.flowParseVariance();\n const ident = this.flowParseTypeAnnotatableIdentifier();\n node.name = ident.name;\n node.variance = variance;\n node.bound = ident.typeAnnotation;\n if (this.match(29)) {\n this.eat(29);\n node.default = this.flowParseType();\n } else {\n if (requireDefault) {\n this.raise(FlowErrors.MissingTypeParamDefault, {\n at: nodeStartLoc\n });\n }\n }\n return this.finishNode(node, \"TypeParameter\");\n }\n flowParseTypeParameterDeclaration() {\n const oldInType = this.state.inType;\n const node = this.startNode();\n node.params = [];\n this.state.inType = true;\n\n if (this.match(47) || this.match(140)) {\n this.next();\n } else {\n this.unexpected();\n }\n let defaultRequired = false;\n do {\n const typeParameter = this.flowParseTypeParameter(defaultRequired);\n node.params.push(typeParameter);\n if (typeParameter.default) {\n defaultRequired = true;\n }\n if (!this.match(48)) {\n this.expect(12);\n }\n } while (!this.match(48));\n this.expect(48);\n this.state.inType = oldInType;\n return this.finishNode(node, \"TypeParameterDeclaration\");\n }\n flowParseTypeParameterInstantiation() {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n this.state.inType = true;\n this.expect(47);\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = false;\n while (!this.match(48)) {\n node.params.push(this.flowParseType());\n if (!this.match(48)) {\n this.expect(12);\n }\n }\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n this.expect(48);\n this.state.inType = oldInType;\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n flowParseTypeParameterInstantiationCallOrNew() {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n this.state.inType = true;\n this.expect(47);\n while (!this.match(48)) {\n node.params.push(this.flowParseTypeOrImplicitInstantiation());\n if (!this.match(48)) {\n this.expect(12);\n }\n }\n this.expect(48);\n this.state.inType = oldInType;\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n flowParseInterfaceType() {\n const node = this.startNode();\n this.expectContextual(127);\n node.extends = [];\n if (this.eat(81)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (this.eat(12));\n }\n node.body = this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: false,\n allowProto: false,\n allowInexact: false\n });\n return this.finishNode(node, \"InterfaceTypeAnnotation\");\n }\n flowParseObjectPropertyKey() {\n return this.match(132) || this.match(131) ? super.parseExprAtom() : this.parseIdentifier(true);\n }\n flowParseObjectTypeIndexer(node, isStatic, variance) {\n node.static = isStatic;\n\n if (this.lookahead().type === 14) {\n node.id = this.flowParseObjectPropertyKey();\n node.key = this.flowParseTypeInitialiser();\n } else {\n node.id = null;\n node.key = this.flowParseType();\n }\n this.expect(3);\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n return this.finishNode(node, \"ObjectTypeIndexer\");\n }\n flowParseObjectTypeInternalSlot(node, isStatic) {\n node.static = isStatic;\n node.id = this.flowParseObjectPropertyKey();\n this.expect(3);\n this.expect(3);\n if (this.match(47) || this.match(10)) {\n node.method = true;\n node.optional = false;\n node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start));\n } else {\n node.method = false;\n if (this.eat(17)) {\n node.optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n }\n return this.finishNode(node, \"ObjectTypeInternalSlot\");\n }\n flowParseObjectTypeMethodish(node) {\n node.params = [];\n node.rest = null;\n node.typeParameters = null;\n node.this = null;\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n this.expect(10);\n if (this.match(78)) {\n node.this = this.flowParseFunctionTypeParam(true);\n node.this.name = null;\n if (!this.match(11)) {\n this.expect(12);\n }\n }\n while (!this.match(11) && !this.match(21)) {\n node.params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(11)) {\n this.expect(12);\n }\n }\n if (this.eat(21)) {\n node.rest = this.flowParseFunctionTypeParam(false);\n }\n this.expect(11);\n node.returnType = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n flowParseObjectTypeCallProperty(node, isStatic) {\n const valueNode = this.startNode();\n node.static = isStatic;\n node.value = this.flowParseObjectTypeMethodish(valueNode);\n return this.finishNode(node, \"ObjectTypeCallProperty\");\n }\n flowParseObjectType({\n allowStatic,\n allowExact,\n allowSpread,\n allowProto,\n allowInexact\n }) {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const nodeStart = this.startNode();\n nodeStart.callProperties = [];\n nodeStart.properties = [];\n nodeStart.indexers = [];\n nodeStart.internalSlots = [];\n let endDelim;\n let exact;\n let inexact = false;\n if (allowExact && this.match(6)) {\n this.expect(6);\n endDelim = 9;\n exact = true;\n } else {\n this.expect(5);\n endDelim = 8;\n exact = false;\n }\n nodeStart.exact = exact;\n while (!this.match(endDelim)) {\n let isStatic = false;\n let protoStartLoc = null;\n let inexactStartLoc = null;\n const node = this.startNode();\n if (allowProto && this.isContextual(116)) {\n const lookahead = this.lookahead();\n if (lookahead.type !== 14 && lookahead.type !== 17) {\n this.next();\n protoStartLoc = this.state.startLoc;\n allowStatic = false;\n }\n }\n if (allowStatic && this.isContextual(104)) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== 14 && lookahead.type !== 17) {\n this.next();\n isStatic = true;\n }\n }\n const variance = this.flowParseVariance();\n if (this.eat(0)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (this.eat(0)) {\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));\n } else {\n nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));\n }\n } else if (this.match(10) || this.match(47)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));\n } else {\n let kind = \"init\";\n if (this.isContextual(98) || this.isContextual(103)) {\n const lookahead = this.lookahead();\n if (tokenIsLiteralPropertyName(lookahead.type)) {\n kind = this.state.value;\n this.next();\n }\n }\n const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);\n if (propOrInexact === null) {\n inexact = true;\n inexactStartLoc = this.state.lastTokStartLoc;\n } else {\n nodeStart.properties.push(propOrInexact);\n }\n }\n this.flowObjectTypeSemicolon();\n if (inexactStartLoc && !this.match(8) && !this.match(9)) {\n this.raise(FlowErrors.UnexpectedExplicitInexactInObject, {\n at: inexactStartLoc\n });\n }\n }\n this.expect(endDelim);\n\n if (allowSpread) {\n nodeStart.inexact = inexact;\n }\n const out = this.finishNode(nodeStart, \"ObjectTypeAnnotation\");\n this.state.inType = oldInType;\n return out;\n }\n flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) {\n if (this.eat(21)) {\n const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9);\n if (isInexactToken) {\n if (!allowSpread) {\n this.raise(FlowErrors.InexactInsideNonObject, {\n at: this.state.lastTokStartLoc\n });\n } else if (!allowInexact) {\n this.raise(FlowErrors.InexactInsideExact, {\n at: this.state.lastTokStartLoc\n });\n }\n if (variance) {\n this.raise(FlowErrors.InexactVariance, {\n at: variance\n });\n }\n return null;\n }\n if (!allowSpread) {\n this.raise(FlowErrors.UnexpectedSpreadType, {\n at: this.state.lastTokStartLoc\n });\n }\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.raise(FlowErrors.SpreadVariance, {\n at: variance\n });\n }\n node.argument = this.flowParseType();\n return this.finishNode(node, \"ObjectTypeSpreadProperty\");\n } else {\n node.key = this.flowParseObjectPropertyKey();\n node.static = isStatic;\n node.proto = protoStartLoc != null;\n node.kind = kind;\n let optional = false;\n if (this.match(47) || this.match(10)) {\n node.method = true;\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start));\n if (kind === \"get\" || kind === \"set\") {\n this.flowCheckGetterSetterParams(node);\n }\n if (!allowSpread && node.key.name === \"constructor\" && node.value.this) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, {\n at: node.value.this\n });\n }\n } else {\n if (kind !== \"init\") this.unexpected();\n node.method = false;\n if (this.eat(17)) {\n optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n }\n node.optional = optional;\n return this.finishNode(node, \"ObjectTypeProperty\");\n }\n }\n\n flowCheckGetterSetterParams(property) {\n const paramCount = property.kind === \"get\" ? 0 : 1;\n const length = property.value.params.length + (property.value.rest ? 1 : 0);\n if (property.value.this) {\n this.raise(property.kind === \"get\" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, {\n at: property.value.this\n });\n }\n if (length !== paramCount) {\n this.raise(property.kind === \"get\" ? Errors.BadGetterArity : Errors.BadSetterArity, {\n at: property\n });\n }\n if (property.kind === \"set\" && property.value.rest) {\n this.raise(Errors.BadSetterRestParameter, {\n at: property\n });\n }\n }\n flowObjectTypeSemicolon() {\n if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) {\n this.unexpected();\n }\n }\n flowParseQualifiedTypeIdentifier(startLoc, id) {\n var _startLoc;\n (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;\n let node = id || this.flowParseRestrictedIdentifier(true);\n while (this.eat(16)) {\n const node2 = this.startNodeAt(startLoc);\n node2.qualification = node;\n node2.id = this.flowParseRestrictedIdentifier(true);\n node = this.finishNode(node2, \"QualifiedTypeIdentifier\");\n }\n return node;\n }\n flowParseGenericType(startLoc, id) {\n const node = this.startNodeAt(startLoc);\n node.typeParameters = null;\n node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n }\n return this.finishNode(node, \"GenericTypeAnnotation\");\n }\n flowParseTypeofType() {\n const node = this.startNode();\n this.expect(87);\n node.argument = this.flowParsePrimaryType();\n return this.finishNode(node, \"TypeofTypeAnnotation\");\n }\n flowParseTupleType() {\n const node = this.startNode();\n node.types = [];\n this.expect(0);\n while (this.state.pos < this.length && !this.match(3)) {\n node.types.push(this.flowParseType());\n if (this.match(3)) break;\n this.expect(12);\n }\n this.expect(3);\n return this.finishNode(node, \"TupleTypeAnnotation\");\n }\n flowParseFunctionTypeParam(first) {\n let name = null;\n let optional = false;\n let typeAnnotation = null;\n const node = this.startNode();\n const lh = this.lookahead();\n const isThis = this.state.type === 78;\n if (lh.type === 14 || lh.type === 17) {\n if (isThis && !first) {\n this.raise(FlowErrors.ThisParamMustBeFirst, {\n at: node\n });\n }\n name = this.parseIdentifier(isThis);\n if (this.eat(17)) {\n optional = true;\n if (isThis) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, {\n at: node\n });\n }\n }\n typeAnnotation = this.flowParseTypeInitialiser();\n } else {\n typeAnnotation = this.flowParseType();\n }\n node.name = name;\n node.optional = optional;\n node.typeAnnotation = typeAnnotation;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n reinterpretTypeAsFunctionTypeParam(type) {\n const node = this.startNodeAt(type.loc.start);\n node.name = null;\n node.optional = false;\n node.typeAnnotation = type;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n flowParseFunctionTypeParams(params = []) {\n let rest = null;\n let _this = null;\n if (this.match(78)) {\n _this = this.flowParseFunctionTypeParam(true);\n _this.name = null;\n if (!this.match(11)) {\n this.expect(12);\n }\n }\n while (!this.match(11) && !this.match(21)) {\n params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(11)) {\n this.expect(12);\n }\n }\n if (this.eat(21)) {\n rest = this.flowParseFunctionTypeParam(false);\n }\n return {\n params,\n rest,\n _this\n };\n }\n flowIdentToTypeAnnotation(startLoc, node, id) {\n switch (id.name) {\n case \"any\":\n return this.finishNode(node, \"AnyTypeAnnotation\");\n case \"bool\":\n case \"boolean\":\n return this.finishNode(node, \"BooleanTypeAnnotation\");\n case \"mixed\":\n return this.finishNode(node, \"MixedTypeAnnotation\");\n case \"empty\":\n return this.finishNode(node, \"EmptyTypeAnnotation\");\n case \"number\":\n return this.finishNode(node, \"NumberTypeAnnotation\");\n case \"string\":\n return this.finishNode(node, \"StringTypeAnnotation\");\n case \"symbol\":\n return this.finishNode(node, \"SymbolTypeAnnotation\");\n default:\n this.checkNotUnderscore(id.name);\n return this.flowParseGenericType(startLoc, id);\n }\n }\n\n flowParsePrimaryType() {\n const startLoc = this.state.startLoc;\n const node = this.startNode();\n let tmp;\n let type;\n let isGroupedType = false;\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n switch (this.state.type) {\n case 5:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: true,\n allowProto: false,\n allowInexact: true\n });\n case 6:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: true,\n allowSpread: true,\n allowProto: false,\n allowInexact: false\n });\n case 0:\n this.state.noAnonFunctionType = false;\n type = this.flowParseTupleType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n return type;\n case 47:\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n this.expect(10);\n tmp = this.flowParseFunctionTypeParams();\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n this.expect(11);\n this.expect(19);\n node.returnType = this.flowParseType();\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n case 10:\n this.next();\n\n if (!this.match(11) && !this.match(21)) {\n if (tokenIsIdentifier(this.state.type) || this.match(78)) {\n const token = this.lookahead().type;\n isGroupedType = token !== 17 && token !== 14;\n } else {\n isGroupedType = true;\n }\n }\n if (isGroupedType) {\n this.state.noAnonFunctionType = false;\n type = this.flowParseType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) {\n this.expect(11);\n return type;\n } else {\n this.eat(12);\n }\n }\n if (type) {\n tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);\n } else {\n tmp = this.flowParseFunctionTypeParams();\n }\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n this.expect(11);\n this.expect(19);\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n case 131:\n return this.parseLiteral(this.state.value, \"StringLiteralTypeAnnotation\");\n case 85:\n case 86:\n node.value = this.match(85);\n this.next();\n return this.finishNode(node, \"BooleanLiteralTypeAnnotation\");\n case 53:\n if (this.state.value === \"-\") {\n this.next();\n if (this.match(132)) {\n return this.parseLiteralAtNode(-this.state.value, \"NumberLiteralTypeAnnotation\", node);\n }\n if (this.match(133)) {\n return this.parseLiteralAtNode(-this.state.value, \"BigIntLiteralTypeAnnotation\", node);\n }\n throw this.raise(FlowErrors.UnexpectedSubtractionOperand, {\n at: this.state.startLoc\n });\n }\n throw this.unexpected();\n case 132:\n return this.parseLiteral(this.state.value, \"NumberLiteralTypeAnnotation\");\n case 133:\n return this.parseLiteral(this.state.value, \"BigIntLiteralTypeAnnotation\");\n case 88:\n this.next();\n return this.finishNode(node, \"VoidTypeAnnotation\");\n case 84:\n this.next();\n return this.finishNode(node, \"NullLiteralTypeAnnotation\");\n case 78:\n this.next();\n return this.finishNode(node, \"ThisTypeAnnotation\");\n case 55:\n this.next();\n return this.finishNode(node, \"ExistsTypeAnnotation\");\n case 87:\n return this.flowParseTypeofType();\n default:\n if (tokenIsKeyword(this.state.type)) {\n const label = tokenLabelName(this.state.type);\n this.next();\n return super.createIdentifier(node, label);\n } else if (tokenIsIdentifier(this.state.type)) {\n if (this.isContextual(127)) {\n return this.flowParseInterfaceType();\n }\n return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier());\n }\n }\n throw this.unexpected();\n }\n flowParsePostfixType() {\n const startLoc = this.state.startLoc;\n let type = this.flowParsePrimaryType();\n let seenOptionalIndexedAccess = false;\n while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt(startLoc);\n const optional = this.eat(18);\n seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;\n this.expect(0);\n if (!optional && this.match(3)) {\n node.elementType = type;\n this.next();\n type = this.finishNode(node, \"ArrayTypeAnnotation\");\n } else {\n node.objectType = type;\n node.indexType = this.flowParseType();\n this.expect(3);\n if (seenOptionalIndexedAccess) {\n node.optional = optional;\n type = this.finishNode(\n node, \"OptionalIndexedAccessType\");\n } else {\n type = this.finishNode(\n node, \"IndexedAccessType\");\n }\n }\n }\n return type;\n }\n flowParsePrefixType() {\n const node = this.startNode();\n if (this.eat(17)) {\n node.typeAnnotation = this.flowParsePrefixType();\n return this.finishNode(node, \"NullableTypeAnnotation\");\n } else {\n return this.flowParsePostfixType();\n }\n }\n flowParseAnonFunctionWithoutParens() {\n const param = this.flowParsePrefixType();\n if (!this.state.noAnonFunctionType && this.eat(19)) {\n const node = this.startNodeAt(param.loc.start);\n node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];\n node.rest = null;\n node.this = null;\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n return param;\n }\n flowParseIntersectionType() {\n const node = this.startNode();\n this.eat(45);\n const type = this.flowParseAnonFunctionWithoutParens();\n node.types = [type];\n while (this.eat(45)) {\n node.types.push(this.flowParseAnonFunctionWithoutParens());\n }\n return node.types.length === 1 ? type : this.finishNode(node, \"IntersectionTypeAnnotation\");\n }\n flowParseUnionType() {\n const node = this.startNode();\n this.eat(43);\n const type = this.flowParseIntersectionType();\n node.types = [type];\n while (this.eat(43)) {\n node.types.push(this.flowParseIntersectionType());\n }\n return node.types.length === 1 ? type : this.finishNode(node, \"UnionTypeAnnotation\");\n }\n flowParseType() {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const type = this.flowParseUnionType();\n this.state.inType = oldInType;\n return type;\n }\n flowParseTypeOrImplicitInstantiation() {\n if (this.state.type === 130 && this.state.value === \"_\") {\n const startLoc = this.state.startLoc;\n const node = this.parseIdentifier();\n return this.flowParseGenericType(startLoc, node);\n } else {\n return this.flowParseType();\n }\n }\n flowParseTypeAnnotation() {\n const node = this.startNode();\n node.typeAnnotation = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"TypeAnnotation\");\n }\n flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {\n const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();\n if (this.match(14)) {\n ident.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(ident);\n }\n return ident;\n }\n typeCastToParameter(node) {\n node.expression.typeAnnotation = node.typeAnnotation;\n this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);\n return node.expression;\n }\n flowParseVariance() {\n let variance = null;\n if (this.match(53)) {\n variance = this.startNode();\n if (this.state.value === \"+\") {\n variance.kind = \"plus\";\n } else {\n variance.kind = \"minus\";\n }\n this.next();\n return this.finishNode(variance, \"Variance\");\n }\n return variance;\n }\n\n parseFunctionBody(node, allowExpressionBody, isMethod = false) {\n if (allowExpressionBody) {\n return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));\n }\n return super.parseFunctionBody(node, false, isMethod);\n }\n parseFunctionBodyAndFinish(node, type, isMethod = false) {\n if (this.match(14)) {\n const typeNode = this.startNode();\n [typeNode.typeAnnotation,\n node.predicate] = this.flowParseTypeAndPredicateInitialiser();\n node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, \"TypeAnnotation\") : null;\n }\n return super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n parseStatementLike(flags) {\n if (this.state.strict && this.isContextual(127)) {\n const lookahead = this.lookahead();\n if (tokenIsKeywordOrIdentifier(lookahead.type)) {\n const node = this.startNode();\n this.next();\n return this.flowParseInterface(node);\n }\n } else if (this.shouldParseEnums() && this.isContextual(124)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n const stmt = super.parseStatementLike(flags);\n if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {\n this.flowPragma = null;\n }\n return stmt;\n }\n\n parseExpressionStatement(node, expr, decorators) {\n if (expr.type === \"Identifier\") {\n if (expr.name === \"declare\") {\n if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) {\n return this.flowParseDeclare(node);\n }\n } else if (tokenIsIdentifier(this.state.type)) {\n if (expr.name === \"interface\") {\n return this.flowParseInterface(node);\n } else if (expr.name === \"type\") {\n return this.flowParseTypeAlias(node);\n } else if (expr.name === \"opaque\") {\n return this.flowParseOpaqueType(node, false);\n }\n }\n }\n return super.parseExpressionStatement(node, expr, decorators);\n }\n\n shouldParseExportDeclaration() {\n const {\n type\n } = this.state;\n if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) {\n return !this.state.containsEsc;\n }\n return super.shouldParseExportDeclaration();\n }\n isExportDefaultSpecifier() {\n const {\n type\n } = this.state;\n if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) {\n return this.state.containsEsc;\n }\n return super.isExportDefaultSpecifier();\n }\n parseExportDefaultExpression() {\n if (this.shouldParseEnums() && this.isContextual(124)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n return super.parseExportDefaultExpression();\n }\n parseConditional(expr, startLoc, refExpressionErrors) {\n if (!this.match(17)) return expr;\n if (this.state.maybeInArrowParameters) {\n const nextCh = this.lookaheadCharCode();\n if (nextCh === 44 ||\n nextCh === 61 ||\n nextCh === 58 ||\n nextCh === 41) {\n this.setOptionalParametersError(refExpressionErrors);\n return expr;\n }\n }\n this.expect(17);\n const state = this.state.clone();\n const originalNoArrowAt = this.state.noArrowAt;\n const node = this.startNodeAt(startLoc);\n let {\n consequent,\n failed\n } = this.tryParseConditionalConsequent();\n let [valid, invalid] = this.getArrowLikeExpressions(consequent);\n if (failed || invalid.length > 0) {\n const noArrowAt = [...originalNoArrowAt];\n if (invalid.length > 0) {\n this.state = state;\n this.state.noArrowAt = noArrowAt;\n for (let i = 0; i < invalid.length; i++) {\n noArrowAt.push(invalid[i].start);\n }\n ({\n consequent,\n failed\n } = this.tryParseConditionalConsequent());\n [valid, invalid] = this.getArrowLikeExpressions(consequent);\n }\n if (failed && valid.length > 1) {\n this.raise(FlowErrors.AmbiguousConditionalArrow, {\n at: state.startLoc\n });\n }\n if (failed && valid.length === 1) {\n this.state = state;\n noArrowAt.push(valid[0].start);\n this.state.noArrowAt = noArrowAt;\n ({\n consequent,\n failed\n } = this.tryParseConditionalConsequent());\n }\n }\n this.getArrowLikeExpressions(consequent, true);\n this.state.noArrowAt = originalNoArrowAt;\n this.expect(14);\n node.test = expr;\n node.consequent = consequent;\n node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined));\n return this.finishNode(node, \"ConditionalExpression\");\n }\n tryParseConditionalConsequent() {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n const consequent = this.parseMaybeAssignAllowIn();\n const failed = !this.match(14);\n this.state.noArrowParamsConversionAt.pop();\n return {\n consequent,\n failed\n };\n }\n\n getArrowLikeExpressions(node, disallowInvalid) {\n const stack = [node];\n const arrows = [];\n while (stack.length !== 0) {\n const node = stack.pop();\n if (node.type === \"ArrowFunctionExpression\") {\n if (node.typeParameters || !node.returnType) {\n this.finishArrowValidation(node);\n } else {\n arrows.push(node);\n }\n stack.push(node.body);\n } else if (node.type === \"ConditionalExpression\") {\n stack.push(node.consequent);\n stack.push(node.alternate);\n }\n }\n if (disallowInvalid) {\n arrows.forEach(node => this.finishArrowValidation(node));\n return [arrows, []];\n }\n return partition(arrows, node => node.params.every(param => this.isAssignable(param, true)));\n }\n finishArrowValidation(node) {\n var _node$extra;\n this.toAssignableList(\n node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false);\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n super.checkParams(node, false, true);\n this.scope.exit();\n }\n forwardNoArrowParamsConversionAt(node, parse) {\n let result;\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n result = parse();\n this.state.noArrowParamsConversionAt.pop();\n } else {\n result = parse();\n }\n return result;\n }\n parseParenItem(node, startLoc) {\n node = super.parseParenItem(node, startLoc);\n if (this.eat(17)) {\n node.optional = true;\n this.resetEndLocation(node);\n }\n if (this.match(14)) {\n const typeCastNode = this.startNodeAt(startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();\n return this.finishNode(typeCastNode, \"TypeCastExpression\");\n }\n return node;\n }\n assertModuleNodeAllowed(node) {\n if (node.type === \"ImportDeclaration\" && (node.importKind === \"type\" || node.importKind === \"typeof\") || node.type === \"ExportNamedDeclaration\" && node.exportKind === \"type\" || node.type === \"ExportAllDeclaration\" && node.exportKind === \"type\") {\n return;\n }\n super.assertModuleNodeAllowed(node);\n }\n parseExport(node, decorators) {\n const decl = super.parseExport(node, decorators);\n if (decl.type === \"ExportNamedDeclaration\" || decl.type === \"ExportAllDeclaration\") {\n decl.exportKind = decl.exportKind || \"value\";\n }\n return decl;\n }\n parseExportDeclaration(node) {\n if (this.isContextual(128)) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n if (this.match(5)) {\n node.specifiers = this.parseExportSpecifiers(true);\n super.parseExportFrom(node);\n return null;\n } else {\n return this.flowParseTypeAlias(declarationNode);\n }\n } else if (this.isContextual(129)) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseOpaqueType(declarationNode, false);\n } else if (this.isContextual(127)) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseInterface(declarationNode);\n } else if (this.shouldParseEnums() && this.isContextual(124)) {\n node.exportKind = \"value\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(declarationNode);\n } else {\n return super.parseExportDeclaration(node);\n }\n }\n eatExportStar(node) {\n if (super.eatExportStar(node)) return true;\n if (this.isContextual(128) && this.lookahead().type === 55) {\n node.exportKind = \"type\";\n this.next();\n this.next();\n return true;\n }\n return false;\n }\n maybeParseExportNamespaceSpecifier(node) {\n const {\n startLoc\n } = this.state;\n const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);\n if (hasNamespace && node.exportKind === \"type\") {\n this.unexpected(startLoc);\n }\n return hasNamespace;\n }\n parseClassId(node, isStatement, optionalId) {\n super.parseClassId(node, isStatement, optionalId);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n }\n parseClassMember(classBody, member, state) {\n const {\n startLoc\n } = this.state;\n if (this.isContextual(123)) {\n if (super.parseClassMemberFromModifier(classBody, member)) {\n return;\n }\n member.declare = true;\n }\n super.parseClassMember(classBody, member, state);\n if (member.declare) {\n if (member.type !== \"ClassProperty\" && member.type !== \"ClassPrivateProperty\" && member.type !== \"PropertyDefinition\") {\n this.raise(FlowErrors.DeclareClassElement, {\n at: startLoc\n });\n } else if (member.value) {\n this.raise(FlowErrors.DeclareClassFieldInitializer, {\n at: member.value\n });\n }\n }\n }\n isIterator(word) {\n return word === \"iterator\" || word === \"asyncIterator\";\n }\n readIterator() {\n const word = super.readWord1();\n const fullWord = \"@@\" + word;\n\n if (!this.isIterator(word) || !this.state.inType) {\n this.raise(Errors.InvalidIdentifier, {\n at: this.state.curPosition(),\n identifierName: fullWord\n });\n }\n this.finishToken(130, fullWord);\n }\n\n getTokenFromCode(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === 123 && next === 124) {\n return this.finishOp(6, 2);\n } else if (this.state.inType && (code === 62 || code === 60)) {\n return this.finishOp(code === 62 ? 48 : 47, 1);\n } else if (this.state.inType && code === 63) {\n if (next === 46) {\n return this.finishOp(18, 2);\n }\n return this.finishOp(17, 1);\n } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) {\n this.state.pos += 2;\n return this.readIterator();\n } else {\n return super.getTokenFromCode(code);\n }\n }\n isAssignable(node, isBinding) {\n if (node.type === \"TypeCastExpression\") {\n return this.isAssignable(node.expression, isBinding);\n } else {\n return super.isAssignable(node, isBinding);\n }\n }\n toAssignable(node, isLHS = false) {\n if (!isLHS && node.type === \"AssignmentExpression\" && node.left.type === \"TypeCastExpression\") {\n node.left = this.typeCastToParameter(node.left);\n }\n super.toAssignable(node, isLHS);\n }\n\n toAssignableList(exprList, trailingCommaLoc, isLHS) {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if ((expr == null ? void 0 : expr.type) === \"TypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n super.toAssignableList(exprList, trailingCommaLoc, isLHS);\n }\n\n toReferencedList(exprList, isParenthesizedExpr) {\n for (let i = 0; i < exprList.length; i++) {\n var _expr$extra;\n const expr = exprList[i];\n if (expr && expr.type === \"TypeCastExpression\" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {\n this.raise(FlowErrors.TypeCastInPattern, {\n at: expr.typeAnnotation\n });\n }\n }\n return exprList;\n }\n parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {\n const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);\n\n if (canBePattern && !this.state.maybeInArrowParameters) {\n this.toReferencedList(node.elements);\n }\n return node;\n }\n isValidLVal(type, isParenthesized, binding) {\n return type === \"TypeCastExpression\" || super.isValidLVal(type, isParenthesized, binding);\n }\n\n parseClassProperty(node) {\n if (this.match(14)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassProperty(node);\n }\n parseClassPrivateProperty(node) {\n if (this.match(14)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassPrivateProperty(node);\n }\n\n isClassMethod() {\n return this.match(47) || super.isClassMethod();\n }\n\n isClassProperty() {\n return this.match(14) || super.isClassProperty();\n }\n isNonstaticConstructor(method) {\n return !this.match(14) && super.isNonstaticConstructor(method);\n }\n\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n if (method.variance) {\n this.unexpected(method.variance.loc.start);\n }\n delete method.variance;\n if (this.match(47)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);\n if (method.params && isConstructor) {\n const params = method.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, {\n at: method\n });\n }\n } else if (\n method.type === \"MethodDefinition\" && isConstructor &&\n method.value.params) {\n const params = method.value.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, {\n at: method\n });\n }\n }\n }\n pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {\n if (method.variance) {\n this.unexpected(method.variance.loc.start);\n }\n delete method.variance;\n if (this.match(47)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n parseClassSuper(node) {\n super.parseClassSuper(node);\n if (node.superClass && this.match(47)) {\n node.superTypeParameters = this.flowParseTypeParameterInstantiation();\n }\n if (this.isContextual(111)) {\n this.next();\n const implemented = node.implements = [];\n do {\n const node = this.startNode();\n node.id = this.flowParseRestrictedIdentifier(true);\n if (this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n implemented.push(this.finishNode(node, \"ClassImplements\"));\n } while (this.eat(12));\n }\n }\n checkGetterSetterParams(method) {\n super.checkGetterSetterParams(method);\n const params = this.getObjectOrClassMethodParams(method);\n if (params.length > 0) {\n const param = params[0];\n if (this.isThisParam(param) && method.kind === \"get\") {\n this.raise(FlowErrors.GetterMayNotHaveThisParam, {\n at: param\n });\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.SetterMayNotHaveThisParam, {\n at: param\n });\n }\n }\n }\n parsePropertyNamePrefixOperator(node) {\n node.variance = this.flowParseVariance();\n }\n\n parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {\n if (prop.variance) {\n this.unexpected(prop.variance.loc.start);\n }\n delete prop.variance;\n let typeParameters;\n\n if (this.match(47) && !isAccessor) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(10)) this.unexpected();\n }\n const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);\n\n if (typeParameters) {\n (result.value || result).typeParameters = typeParameters;\n }\n return result;\n }\n parseAssignableListItemTypes(param) {\n if (this.eat(17)) {\n if (param.type !== \"Identifier\") {\n this.raise(FlowErrors.PatternIsOptional, {\n at: param\n });\n }\n if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, {\n at: param\n });\n }\n param.optional = true;\n }\n if (this.match(14)) {\n param.typeAnnotation = this.flowParseTypeAnnotation();\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamAnnotationRequired, {\n at: param\n });\n }\n if (this.match(29) && this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamNoDefault, {\n at: param\n });\n }\n this.resetEndLocation(param);\n return param;\n }\n parseMaybeDefault(startLoc, left) {\n const node = super.parseMaybeDefault(startLoc, left);\n if (node.type === \"AssignmentPattern\" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {\n this.raise(FlowErrors.TypeBeforeInitializer, {\n at: node.typeAnnotation\n });\n }\n return node;\n }\n shouldParseDefaultImport(node) {\n if (!hasTypeImportKind(node)) {\n return super.shouldParseDefaultImport(node);\n }\n return isMaybeDefaultImport(this.state.type);\n }\n checkImportReflection(node) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(FlowErrors.ImportReflectionHasImportType, {\n at: node.specifiers[0].loc.start\n });\n }\n }\n parseImportSpecifierLocal(node, specifier, type) {\n specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n\n maybeParseDefaultImportSpecifier(node) {\n node.importKind = \"value\";\n let kind = null;\n if (this.match(87)) {\n kind = \"typeof\";\n } else if (this.isContextual(128)) {\n kind = \"type\";\n }\n if (kind) {\n const lh = this.lookahead();\n const {\n type\n } = lh;\n\n if (kind === \"type\" && type === 55) {\n this.unexpected(null, lh.type);\n }\n if (isMaybeDefaultImport(type) || type === 5 || type === 55) {\n this.next();\n node.importKind = kind;\n }\n }\n return super.maybeParseDefaultImportSpecifier(node);\n }\n\n parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport,\n isMaybeTypeOnly,\n bindingType) {\n const firstIdent = specifier.imported;\n let specifierTypeKind = null;\n if (firstIdent.type === \"Identifier\") {\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n }\n let isBinding = false;\n if (this.isContextual(93) && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = cloneIdentifier(as_ident);\n } else {\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else {\n if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) {\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n } else {\n if (importedIsString) {\n throw this.raise(Errors.ImportBindingIsString, {\n at: specifier,\n importName: firstIdent.value\n });\n }\n specifier.imported = firstIdent;\n specifier.importKind = null;\n }\n if (this.eatContextual(93)) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = cloneIdentifier(specifier.imported);\n }\n }\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n if (isInTypeOnlyImport && specifierIsTypeImport) {\n this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, {\n at: specifier\n });\n }\n if (isInTypeOnlyImport || specifierIsTypeImport) {\n this.checkReservedType(specifier.local.name, specifier.local.loc.start, true);\n }\n if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {\n this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true);\n }\n return this.finishImportSpecifier(specifier, \"ImportSpecifier\");\n }\n parseBindingAtom() {\n switch (this.state.type) {\n case 78:\n return this.parseIdentifier(true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n parseFunctionParams(node, allowModifiers) {\n const kind = node.kind;\n if (kind !== \"get\" && kind !== \"set\" && this.match(47)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.parseFunctionParams(node, allowModifiers);\n }\n\n parseVarId(decl, kind) {\n super.parseVarId(decl, kind);\n if (this.match(14)) {\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id);\n }\n }\n\n parseAsyncArrowFromCallExpression(node, call) {\n if (this.match(14)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n shouldParseAsyncArrow() {\n return this.match(14) || super.shouldParseAsyncArrow();\n }\n\n parseMaybeAssign(refExpressionErrors, afterLeftParse) {\n var _jsx;\n let state = null;\n let jsx;\n if (this.hasPlugin(\"jsx\") && (this.match(140) || this.match(47))) {\n state = this.state.clone();\n jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);\n\n if (!jsx.error) return jsx.node;\n\n const {\n context\n } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === types.j_oTag || currentContext === types.j_expr) {\n context.pop();\n }\n }\n if ((_jsx = jsx) != null && _jsx.error || this.match(47)) {\n var _jsx2, _jsx3;\n state = state || this.state.clone();\n let typeParameters;\n const arrow = this.tryParse(abort => {\n var _arrowExpression$extr;\n typeParameters = this.flowParseTypeParameterDeclaration();\n const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => {\n const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n this.resetStartLocationFromNode(result, typeParameters);\n return result;\n });\n\n if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort();\n\n const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);\n if (expr.type !== \"ArrowFunctionExpression\") abort();\n expr.typeParameters = typeParameters;\n this.resetStartLocationFromNode(expr, typeParameters);\n return arrowExpression;\n }, state);\n let arrowExpression = null;\n if (arrow.node &&\n this.maybeUnwrapTypeCastExpression(arrow.node).type === \"ArrowFunctionExpression\") {\n if (!arrow.error && !arrow.aborted) {\n if (arrow.node.async) {\n this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, {\n at: typeParameters\n });\n }\n return arrow.node;\n }\n\n arrowExpression = arrow.node;\n }\n\n if ((_jsx2 = jsx) != null && _jsx2.node) {\n this.state = jsx.failState;\n return jsx.node;\n }\n if (arrowExpression) {\n this.state = arrow.failState;\n return arrowExpression;\n }\n if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n\n throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, {\n at: typeParameters\n });\n }\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n parseArrow(node) {\n if (this.match(14)) {\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n const typeNode = this.startNode();\n [typeNode.typeAnnotation,\n node.predicate] = this.flowParseTypeAndPredicateInitialiser();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(19)) this.unexpected();\n return typeNode;\n });\n if (result.thrown) return null;\n\n if (result.error) this.state = result.failState;\n\n node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, \"TypeAnnotation\") : null;\n }\n return super.parseArrow(node);\n }\n shouldParseArrow(params) {\n return this.match(14) || super.shouldParseArrow(params);\n }\n setArrowFunctionParameters(node, params) {\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n node.params = params;\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {\n if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n return;\n }\n\n for (let i = 0; i < node.params.length; i++) {\n if (this.isThisParam(node.params[i]) && i > 0) {\n this.raise(FlowErrors.ThisParamMustBeFirst, {\n at: node.params[i]\n });\n }\n }\n return super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);\n }\n parseParenAndDistinguishExpression(canBeArrow) {\n return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);\n }\n parseSubscripts(base, startLoc, noCalls) {\n if (base.type === \"Identifier\" && base.name === \"async\" && this.state.noArrowAt.indexOf(startLoc.index) !== -1) {\n this.next();\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.arguments = super.parseCallExpressionArguments(11, false);\n base = this.finishNode(node, \"CallExpression\");\n } else if (base.type === \"Identifier\" && base.name === \"async\" && this.match(47)) {\n const state = this.state.clone();\n const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state);\n\n if (!arrow.error && !arrow.aborted) return arrow.node;\n const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state);\n if (result.node && !result.error) return result.node;\n if (arrow.node) {\n this.state = arrow.failState;\n return arrow.node;\n }\n if (result.node) {\n this.state = result.failState;\n return result.node;\n }\n throw arrow.error || result.error;\n }\n return super.parseSubscripts(base, startLoc, noCalls);\n }\n parseSubscript(base, startLoc, noCalls, subscriptState) {\n if (this.match(18) && this.isLookaheadToken_lt()) {\n subscriptState.optionalChainMember = true;\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n this.next();\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.typeArguments = this.flowParseTypeParameterInstantiation();\n this.expect(10);\n node.arguments = this.parseCallExpressionArguments(11, false);\n node.optional = true;\n return this.finishCallExpression(node, true);\n } else if (!noCalls && this.shouldParseTypes() && this.match(47)) {\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n const result = this.tryParse(() => {\n node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(10);\n node.arguments = super.parseCallExpressionArguments(11, false);\n if (subscriptState.optionalChainMember) {\n node.optional = false;\n }\n return this.finishCallExpression(node, subscriptState.optionalChainMember);\n });\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n return super.parseSubscript(base, startLoc, noCalls, subscriptState);\n }\n parseNewCallee(node) {\n super.parseNewCallee(node);\n let targs = null;\n if (this.shouldParseTypes() && this.match(47)) {\n targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;\n }\n node.typeArguments = targs;\n }\n parseAsyncArrowWithTypeParameters(startLoc) {\n const node = this.startNodeAt(startLoc);\n this.parseFunctionParams(node);\n if (!this.parseArrow(node)) return;\n return super.parseArrowExpression(node, undefined, true);\n }\n readToken_mult_modulo(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === 42 && next === 47 && this.state.hasFlowComment) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n super.readToken_mult_modulo(code);\n }\n readToken_pipe_amp(code) {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === 124 && next === 125) {\n this.finishOp(9, 2);\n return;\n }\n super.readToken_pipe_amp(code);\n }\n parseTopLevel(file, program) {\n const fileNode = super.parseTopLevel(file, program);\n if (this.state.hasFlowComment) {\n this.raise(FlowErrors.UnterminatedFlowComment, {\n at: this.state.curPosition()\n });\n }\n return fileNode;\n }\n skipBlockComment() {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n throw this.raise(FlowErrors.NestedFlowComment, {\n at: this.state.startLoc\n });\n }\n this.hasFlowCommentCompletion();\n const commentSkip = this.skipFlowComment();\n if (commentSkip) {\n this.state.pos += commentSkip;\n this.state.hasFlowComment = true;\n }\n return;\n }\n return super.skipBlockComment(this.state.hasFlowComment ? \"*-/\" : \"*/\");\n }\n skipFlowComment() {\n const {\n pos\n } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n while ([32, 9].includes(\n this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {\n shiftToFirstNonWhiteSpace++;\n }\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n if (ch2 === 58 && ch3 === 58) {\n return shiftToFirstNonWhiteSpace + 2;\n }\n\n if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === \"flow-include\") {\n return shiftToFirstNonWhiteSpace + 12;\n }\n\n if (ch2 === 58 && ch3 !== 58) {\n return shiftToFirstNonWhiteSpace;\n }\n\n return false;\n }\n hasFlowCommentCompletion() {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n if (end === -1) {\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition()\n });\n }\n }\n\n flowEnumErrorBooleanMemberNotInitialized(loc, {\n enumName,\n memberName\n }) {\n this.raise(FlowErrors.EnumBooleanMemberNotInitialized, {\n at: loc,\n memberName,\n enumName\n });\n }\n flowEnumErrorInvalidMemberInitializer(loc, enumContext) {\n return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === \"symbol\" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, Object.assign({\n at: loc\n }, enumContext));\n }\n flowEnumErrorNumberMemberNotInitialized(loc, {\n enumName,\n memberName\n }) {\n this.raise(FlowErrors.EnumNumberMemberNotInitialized, {\n at: loc,\n enumName,\n memberName\n });\n }\n flowEnumErrorStringMemberInconsistentlyInitailized(node, {\n enumName\n }) {\n this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, {\n at: node,\n enumName\n });\n }\n flowEnumMemberInit() {\n const startLoc = this.state.startLoc;\n const endOfInit = () => this.match(12) || this.match(8);\n switch (this.state.type) {\n case 132:\n {\n const literal = this.parseNumericLiteral(this.state.value);\n if (endOfInit()) {\n return {\n type: \"number\",\n loc: literal.loc.start,\n value: literal\n };\n }\n return {\n type: \"invalid\",\n loc: startLoc\n };\n }\n case 131:\n {\n const literal = this.parseStringLiteral(this.state.value);\n if (endOfInit()) {\n return {\n type: \"string\",\n loc: literal.loc.start,\n value: literal\n };\n }\n return {\n type: \"invalid\",\n loc: startLoc\n };\n }\n case 85:\n case 86:\n {\n const literal = this.parseBooleanLiteral(this.match(85));\n if (endOfInit()) {\n return {\n type: \"boolean\",\n loc: literal.loc.start,\n value: literal\n };\n }\n return {\n type: \"invalid\",\n loc: startLoc\n };\n }\n default:\n return {\n type: \"invalid\",\n loc: startLoc\n };\n }\n }\n flowEnumMemberRaw() {\n const loc = this.state.startLoc;\n const id = this.parseIdentifier(true);\n const init = this.eat(29) ? this.flowEnumMemberInit() : {\n type: \"none\",\n loc\n };\n return {\n id,\n init\n };\n }\n flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {\n const {\n explicitType\n } = context;\n if (explicitType === null) {\n return;\n }\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(loc, context);\n }\n }\n flowEnumMembers({\n enumName,\n explicitType\n }) {\n const seenNames = new Set();\n const members = {\n booleanMembers: [],\n numberMembers: [],\n stringMembers: [],\n defaultedMembers: []\n };\n let hasUnknownMembers = false;\n while (!this.match(8)) {\n if (this.eat(21)) {\n hasUnknownMembers = true;\n break;\n }\n const memberNode = this.startNode();\n const {\n id,\n init\n } = this.flowEnumMemberRaw();\n const memberName = id.name;\n if (memberName === \"\") {\n continue;\n }\n if (/^[a-z]/.test(memberName)) {\n this.raise(FlowErrors.EnumInvalidMemberName, {\n at: id,\n memberName,\n suggestion: memberName[0].toUpperCase() + memberName.slice(1),\n enumName\n });\n }\n if (seenNames.has(memberName)) {\n this.raise(FlowErrors.EnumDuplicateMemberName, {\n at: id,\n memberName,\n enumName\n });\n }\n seenNames.add(memberName);\n const context = {\n enumName,\n explicitType,\n memberName\n };\n memberNode.id = id;\n switch (init.type) {\n case \"boolean\":\n {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"boolean\");\n memberNode.init = init.value;\n members.booleanMembers.push(this.finishNode(memberNode, \"EnumBooleanMember\"));\n break;\n }\n case \"number\":\n {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(this.finishNode(memberNode, \"EnumNumberMember\"));\n break;\n }\n case \"string\":\n {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(this.finishNode(memberNode, \"EnumStringMember\"));\n break;\n }\n case \"invalid\":\n {\n throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);\n }\n case \"none\":\n {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context);\n break;\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);\n break;\n default:\n members.defaultedMembers.push(this.finishNode(memberNode, \"EnumDefaultedMember\"));\n }\n }\n }\n if (!this.match(8)) {\n this.expect(12);\n }\n }\n return {\n members,\n hasUnknownMembers\n };\n }\n flowEnumStringMembers(initializedMembers, defaultedMembers, {\n enumName\n }) {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (const member of initializedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {\n enumName\n });\n }\n return defaultedMembers;\n } else {\n for (const member of defaultedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {\n enumName\n });\n }\n return initializedMembers;\n }\n }\n flowEnumParseExplicitType({\n enumName\n }) {\n if (!this.eatContextual(101)) return null;\n if (!tokenIsIdentifier(this.state.type)) {\n throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, {\n at: this.state.startLoc,\n enumName\n });\n }\n const {\n value\n } = this.state;\n this.next();\n if (value !== \"boolean\" && value !== \"number\" && value !== \"string\" && value !== \"symbol\") {\n this.raise(FlowErrors.EnumInvalidExplicitType, {\n at: this.state.startLoc,\n enumName,\n invalidEnumType: value\n });\n }\n return value;\n }\n flowEnumBody(node, id) {\n const enumName = id.name;\n const nameLoc = id.loc.start;\n const explicitType = this.flowEnumParseExplicitType({\n enumName\n });\n this.expect(5);\n const {\n members,\n hasUnknownMembers\n } = this.flowEnumMembers({\n enumName,\n explicitType\n });\n node.hasUnknownMembers = hasUnknownMembers;\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumBooleanBody\");\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumNumberBody\");\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {\n enumName\n });\n this.expect(8);\n return this.finishNode(node, \"EnumStringBody\");\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumSymbolBody\");\n default:\n {\n const empty = () => {\n node.members = [];\n this.expect(8);\n return this.finishNode(node, \"EnumStringBody\");\n };\n node.explicitType = false;\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {\n enumName\n });\n this.expect(8);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name\n });\n }\n node.members = members.booleanMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name\n });\n }\n node.members = members.numberMembers;\n this.expect(8);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.raise(FlowErrors.EnumInconsistentMemberValues, {\n at: nameLoc,\n enumName\n });\n return empty();\n }\n }\n }\n }\n flowParseEnumDeclaration(node) {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), id);\n return this.finishNode(node, \"EnumDeclaration\");\n }\n\n isLookaheadToken_lt() {\n const next = this.nextTokenStart();\n if (this.input.charCodeAt(next) === 60) {\n const afterNext = this.input.charCodeAt(next + 1);\n return afterNext !== 60 && afterNext !== 61;\n }\n return false;\n }\n maybeUnwrapTypeCastExpression(node) {\n return node.type === \"TypeCastExpression\" ? node.expression : node;\n }\n});\n\nconst entities = {\n __proto__: null,\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\"\n};\n\nconst JsxErrors = ParseErrorEnum`jsx`({\n AttributeIsEmpty: \"JSX attributes must only be assigned a non-empty expression.\",\n MissingClosingTagElement: ({\n openingTagName\n }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`,\n MissingClosingTagFragment: \"Expected corresponding JSX closing tag for <>.\",\n UnexpectedSequenceExpression: \"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?\",\n UnexpectedToken: ({\n unexpected,\n HTMLEntity\n }) => `Unexpected token \\`${unexpected}\\`. Did you mean \\`${HTMLEntity}\\` or \\`{'${unexpected}'}\\`?`,\n UnsupportedJsxValue: \"JSX value should be either an expression or a quoted JSX text.\",\n UnterminatedJsxContent: \"Unterminated JSX contents.\",\n UnwrappedAdjacentJSXElements: \"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?\"\n});\n\nfunction isFragment(object) {\n return object ? object.type === \"JSXOpeningFragment\" || object.type === \"JSXClosingFragment\" : false;\n}\n\nfunction getQualifiedJSXName(object) {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n if (object.type === \"JSXMemberExpression\") {\n return getQualifiedJSXName(object.object) + \".\" + getQualifiedJSXName(object.property);\n }\n\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\nvar jsx = (superClass => class JSXParserMixin extends superClass {\n\n jsxReadToken() {\n let out = \"\";\n let chunkStart = this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(JsxErrors.UnterminatedJsxContent, {\n at: this.state.startLoc\n });\n }\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case 60:\n case 123:\n if (this.state.pos === this.state.start) {\n if (ch === 60 && this.state.canStartJSXElement) {\n ++this.state.pos;\n return this.finishToken(140);\n }\n return super.getTokenFromCode(ch);\n }\n out += this.input.slice(chunkStart, this.state.pos);\n return this.finishToken(139, out);\n case 38:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n case 62:\n case 125:\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n }\n jsxReadNewLine(normalizeCRLF) {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n return out;\n }\n jsxReadString(quote) {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(Errors.UnterminatedString, {\n at: this.state.startLoc\n });\n }\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n if (ch === 38) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n out += this.input.slice(chunkStart, this.state.pos++);\n return this.finishToken(131, out);\n }\n jsxReadEntity() {\n const startPos = ++this.state.pos;\n if (this.codePointAtPos(this.state.pos) === 35) {\n ++this.state.pos;\n let radix = 10;\n if (this.codePointAtPos(this.state.pos) === 120) {\n radix = 16;\n ++this.state.pos;\n }\n const codePoint = this.readInt(radix, undefined, false, \"bail\");\n if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) {\n ++this.state.pos;\n return String.fromCodePoint(codePoint);\n }\n } else {\n let count = 0;\n let semi = false;\n while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) == 59)) {\n ++this.state.pos;\n }\n if (semi) {\n const desc = this.input.slice(startPos, this.state.pos);\n const entity = entities[desc];\n ++this.state.pos;\n if (entity) {\n return entity;\n }\n }\n }\n\n this.state.pos = startPos;\n return \"&\";\n }\n\n jsxReadWord() {\n let ch;\n const start = this.state.pos;\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === 45);\n return this.finishToken(138, this.input.slice(start, this.state.pos));\n }\n\n jsxParseIdentifier() {\n const node = this.startNode();\n if (this.match(138)) {\n node.name = this.state.value;\n } else if (tokenIsKeyword(this.state.type)) {\n node.name = tokenLabelName(this.state.type);\n } else {\n this.unexpected();\n }\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n jsxParseNamespacedName() {\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(14)) return name;\n const node = this.startNodeAt(startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n jsxParseElementName() {\n const startLoc = this.state.startLoc;\n let node = this.jsxParseNamespacedName();\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n while (this.eat(16)) {\n const newNode = this.startNodeAt(startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n return node;\n }\n\n jsxParseAttributeValue() {\n let node;\n switch (this.state.type) {\n case 5:\n node = this.startNode();\n this.setContext(types.brace);\n this.next();\n node = this.jsxParseExpressionContainer(node, types.j_oTag);\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(JsxErrors.AttributeIsEmpty, {\n at: node\n });\n }\n return node;\n case 140:\n case 131:\n return this.parseExprAtom();\n default:\n throw this.raise(JsxErrors.UnsupportedJsxValue, {\n at: this.state.startLoc\n });\n }\n }\n\n jsxParseEmptyExpression() {\n const node = this.startNodeAt(this.state.lastTokEndLoc);\n return this.finishNodeAt(node, \"JSXEmptyExpression\", this.state.startLoc);\n }\n\n jsxParseSpreadChild(node) {\n this.next();\n node.expression = this.parseExpression();\n this.setContext(types.j_expr);\n this.state.canStartJSXElement = true;\n this.expect(8);\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n jsxParseExpressionContainer(node, previousContext) {\n if (this.match(8)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n const expression = this.parseExpression();\n node.expression = expression;\n }\n this.setContext(previousContext);\n this.state.canStartJSXElement = true;\n this.expect(8);\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n jsxParseAttribute() {\n const node = this.startNode();\n if (this.match(5)) {\n this.setContext(types.brace);\n this.next();\n this.expect(21);\n node.argument = this.parseMaybeAssignAllowIn();\n this.setContext(types.j_oTag);\n this.state.canStartJSXElement = true;\n this.expect(8);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(29) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n jsxParseOpeningElementAt(startLoc) {\n const node = this.startNodeAt(startLoc);\n if (this.eat(141)) {\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(node);\n }\n jsxParseOpeningElementAfterName(node) {\n const attributes = [];\n while (!this.match(56) && !this.match(141)) {\n attributes.push(this.jsxParseAttribute());\n }\n node.attributes = attributes;\n node.selfClosing = this.eat(56);\n this.expect(141);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n jsxParseClosingElementAt(startLoc) {\n const node = this.startNodeAt(startLoc);\n if (this.eat(141)) {\n return this.finishNode(node, \"JSXClosingFragment\");\n }\n node.name = this.jsxParseElementName();\n this.expect(141);\n return this.finishNode(node, \"JSXClosingElement\");\n }\n\n jsxParseElementAt(startLoc) {\n const node = this.startNodeAt(startLoc);\n const children = [];\n const openingElement = this.jsxParseOpeningElementAt(startLoc);\n let closingElement = null;\n if (!openingElement.selfClosing) {\n contents: for (;;) {\n switch (this.state.type) {\n case 140:\n startLoc = this.state.startLoc;\n this.next();\n if (this.eat(56)) {\n closingElement = this.jsxParseClosingElementAt(startLoc);\n break contents;\n }\n children.push(this.jsxParseElementAt(startLoc));\n break;\n case 139:\n children.push(this.parseExprAtom());\n break;\n case 5:\n {\n const node = this.startNode();\n this.setContext(types.brace);\n this.next();\n if (this.match(21)) {\n children.push(this.jsxParseSpreadChild(node));\n } else {\n children.push(this.jsxParseExpressionContainer(node, types.j_expr));\n }\n break;\n }\n default:\n throw this.unexpected();\n }\n }\n if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {\n this.raise(JsxErrors.MissingClosingTagFragment, {\n at: closingElement\n });\n } else if (!isFragment(openingElement) && isFragment(closingElement)) {\n this.raise(JsxErrors.MissingClosingTagElement, {\n at: closingElement,\n openingTagName: getQualifiedJSXName(openingElement.name)\n });\n } else if (!isFragment(openingElement) && !isFragment(closingElement)) {\n if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {\n this.raise(JsxErrors.MissingClosingTagElement, {\n at: closingElement,\n openingTagName: getQualifiedJSXName(openingElement.name)\n });\n }\n }\n }\n if (isFragment(openingElement)) {\n node.openingFragment = openingElement;\n node.closingFragment = closingElement;\n } else {\n node.openingElement = openingElement;\n node.closingElement = closingElement;\n }\n node.children = children;\n if (this.match(47)) {\n throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, {\n at: this.state.startLoc\n });\n }\n return isFragment(openingElement) ? this.finishNode(node, \"JSXFragment\") : this.finishNode(node, \"JSXElement\");\n }\n\n jsxParseElement() {\n const startLoc = this.state.startLoc;\n this.next();\n return this.jsxParseElementAt(startLoc);\n }\n setContext(newContext) {\n const {\n context\n } = this.state;\n context[context.length - 1] = newContext;\n }\n\n parseExprAtom(refExpressionErrors) {\n if (this.match(139)) {\n return this.parseLiteral(this.state.value, \"JSXText\");\n } else if (this.match(140)) {\n return this.jsxParseElement();\n } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) {\n this.replaceToken(140);\n return this.jsxParseElement();\n } else {\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n skipSpace() {\n const curContext = this.curContext();\n if (!curContext.preserveSpace) super.skipSpace();\n }\n getTokenFromCode(code) {\n const context = this.curContext();\n if (context === types.j_expr) {\n return this.jsxReadToken();\n }\n if (context === types.j_oTag || context === types.j_cTag) {\n if (isIdentifierStart(code)) {\n return this.jsxReadWord();\n }\n if (code === 62) {\n ++this.state.pos;\n return this.finishToken(141);\n }\n if ((code === 34 || code === 39) && context === types.j_oTag) {\n return this.jsxReadString(code);\n }\n }\n if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {\n ++this.state.pos;\n return this.finishToken(140);\n }\n return super.getTokenFromCode(code);\n }\n updateContext(prevType) {\n const {\n context,\n type\n } = this.state;\n if (type === 56 && prevType === 140) {\n context.splice(-2, 2, types.j_cTag);\n this.state.canStartJSXElement = false;\n } else if (type === 140) {\n context.push(types.j_oTag);\n } else if (type === 141) {\n const out = context[context.length - 1];\n if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) {\n context.pop();\n this.state.canStartJSXElement = context[context.length - 1] === types.j_expr;\n } else {\n this.setContext(types.j_expr);\n this.state.canStartJSXElement = true;\n }\n } else {\n this.state.canStartJSXElement = tokenComesBeforeExpression(type);\n }\n }\n});\n\nclass TypeScriptScope extends Scope {\n constructor(...args) {\n super(...args);\n this.types = new Set();\n this.enums = new Set();\n this.constEnums = new Set();\n this.classes = new Set();\n this.exportOnlyBindings = new Set();\n }\n}\n\nclass TypeScriptScopeHandler extends ScopeHandler {\n constructor(...args) {\n super(...args);\n this.importsStack = [];\n }\n createScope(flags) {\n this.importsStack.push(new Set());\n\n return new TypeScriptScope(flags);\n }\n enter(flags) {\n if (flags == SCOPE_TS_MODULE) {\n this.importsStack.push(new Set());\n }\n super.enter(flags);\n }\n exit() {\n const flags = super.exit();\n if (flags == SCOPE_TS_MODULE) {\n this.importsStack.pop();\n }\n return flags;\n }\n hasImport(name, allowShadow) {\n const len = this.importsStack.length;\n if (this.importsStack[len - 1].has(name)) {\n return true;\n }\n if (!allowShadow && len > 1) {\n for (let i = 0; i < len - 1; i++) {\n if (this.importsStack[i].has(name)) return true;\n }\n }\n return false;\n }\n declareName(name, bindingType, loc) {\n if (bindingType & BIND_FLAGS_TS_IMPORT) {\n if (this.hasImport(name, true)) {\n this.parser.raise(Errors.VarRedeclaration, {\n at: loc,\n identifierName: name\n });\n }\n this.importsStack[this.importsStack.length - 1].add(name);\n return;\n }\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.exportOnlyBindings.add(name);\n return;\n }\n super.declareName(name, bindingType, loc);\n if (bindingType & BIND_KIND_TYPE) {\n if (!(bindingType & BIND_KIND_VALUE)) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n }\n scope.types.add(name);\n }\n if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name);\n if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name);\n if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name);\n }\n isRedeclaredInScope(scope, name, bindingType) {\n if (scope.enums.has(name)) {\n if (bindingType & BIND_FLAGS_TS_ENUM) {\n const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);\n const wasConst = scope.constEnums.has(name);\n return isConst !== wasConst;\n }\n return true;\n }\n if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {\n if (scope.lexical.has(name)) {\n return !!(bindingType & BIND_KIND_VALUE);\n } else {\n return false;\n }\n }\n if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {\n return true;\n }\n return super.isRedeclaredInScope(scope, name, bindingType);\n }\n checkLocalExport(id) {\n const {\n name\n } = id;\n if (this.hasImport(name)) return;\n const len = this.scopeStack.length;\n for (let i = len - 1; i >= 0; i--) {\n const scope = this.scopeStack[i];\n if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return;\n }\n super.checkLocalExport(id);\n }\n}\n\nconst getOwn$1 = (object, key) => Object.hasOwnProperty.call(object, key) && object[key];\nfunction nonNull(x) {\n if (x == null) {\n throw new Error(`Unexpected ${x} value.`);\n }\n return x;\n}\nfunction assert(x) {\n if (!x) {\n throw new Error(\"Assert fail\");\n }\n}\nconst TSErrors = ParseErrorEnum`typescript`({\n AbstractMethodHasImplementation: ({\n methodName\n }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`,\n AbstractPropertyHasInitializer: ({\n propertyName\n }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,\n AccesorCannotDeclareThisParameter: \"'get' and 'set' accessors cannot declare 'this' parameters.\",\n AccesorCannotHaveTypeParameters: \"An accessor cannot have type parameters.\",\n ClassMethodHasDeclare: \"Class methods cannot have the 'declare' modifier.\",\n ClassMethodHasReadonly: \"Class methods cannot have the 'readonly' modifier.\",\n ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: \"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.\",\n ConstructorHasTypeParameters: \"Type parameters cannot appear on a constructor declaration.\",\n DeclareAccessor: ({\n kind\n }) => `'declare' is not allowed in ${kind}ters.`,\n DeclareClassFieldHasInitializer: \"Initializers are not allowed in ambient contexts.\",\n DeclareFunctionHasImplementation: \"An implementation cannot be declared in ambient contexts.\",\n DuplicateAccessibilityModifier:\n ({\n modifier\n }) => `Accessibility modifier already seen.`,\n DuplicateModifier: ({\n modifier\n }) => `Duplicate modifier: '${modifier}'.`,\n EmptyHeritageClauseType: ({\n token\n }) => `'${token}' list cannot be empty.`,\n EmptyTypeArguments: \"Type argument list cannot be empty.\",\n EmptyTypeParameters: \"Type parameter list cannot be empty.\",\n ExpectedAmbientAfterExportDeclare: \"'export declare' must be followed by an ambient declaration.\",\n ImportAliasHasImportType: \"An import alias can not use 'import type'.\",\n ImportReflectionHasImportType: \"An `import module` declaration can not use `type` modifier\",\n IncompatibleModifiers: ({\n modifiers\n }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`,\n IndexSignatureHasAbstract: \"Index signatures cannot have the 'abstract' modifier.\",\n IndexSignatureHasAccessibility: ({\n modifier\n }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`,\n IndexSignatureHasDeclare: \"Index signatures cannot have the 'declare' modifier.\",\n IndexSignatureHasOverride: \"'override' modifier cannot appear on an index signature.\",\n IndexSignatureHasStatic: \"Index signatures cannot have the 'static' modifier.\",\n InitializerNotAllowedInAmbientContext: \"Initializers are not allowed in ambient contexts.\",\n InvalidModifierOnTypeMember: ({\n modifier\n }) => `'${modifier}' modifier cannot appear on a type member.`,\n InvalidModifierOnTypeParameter: ({\n modifier\n }) => `'${modifier}' modifier cannot appear on a type parameter.`,\n InvalidModifierOnTypeParameterPositions: ({\n modifier\n }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`,\n InvalidModifiersOrder: ({\n orderedModifiers\n }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`,\n InvalidPropertyAccessAfterInstantiationExpression: \"Invalid property access after an instantiation expression. \" + \"You can either wrap the instantiation expression in parentheses, or delete the type arguments.\",\n InvalidTupleMemberLabel: \"Tuple members must be labeled with a simple identifier.\",\n MissingInterfaceName: \"'interface' declarations must be followed by an identifier.\",\n MixedLabeledAndUnlabeledElements: \"Tuple members must all have names or all not have names.\",\n NonAbstractClassHasAbstractMethod: \"Abstract methods can only appear within an abstract class.\",\n NonClassMethodPropertyHasAbstractModifer: \"'abstract' modifier can only appear on a class, method, or property declaration.\",\n OptionalTypeBeforeRequired: \"A required element cannot follow an optional element.\",\n OverrideNotInSubClass: \"This member cannot have an 'override' modifier because its containing class does not extend another class.\",\n PatternIsOptional: \"A binding pattern parameter cannot be optional in an implementation signature.\",\n PrivateElementHasAbstract: \"Private elements cannot have the 'abstract' modifier.\",\n PrivateElementHasAccessibility: ({\n modifier\n }) => `Private elements cannot have an accessibility modifier ('${modifier}').`,\n ReadonlyForMethodSignature: \"'readonly' modifier can only appear on a property declaration or index signature.\",\n ReservedArrowTypeParam: \"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.\",\n ReservedTypeAssertion: \"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.\",\n SetAccesorCannotHaveOptionalParameter: \"A 'set' accessor cannot have an optional parameter.\",\n SetAccesorCannotHaveRestParameter: \"A 'set' accessor cannot have rest parameter.\",\n SetAccesorCannotHaveReturnType: \"A 'set' accessor cannot have a return type annotation.\",\n SingleTypeParameterWithoutTrailingComma: ({\n typeParameterName\n }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`,\n StaticBlockCannotHaveModifier: \"Static class blocks cannot have any modifier.\",\n TypeAnnotationAfterAssign: \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.\",\n TypeImportCannotSpecifyDefaultAndNamed: \"A type-only import can specify a default import or named bindings, but not both.\",\n TypeModifierIsUsedInTypeExports: \"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.\",\n TypeModifierIsUsedInTypeImports: \"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.\",\n UnexpectedParameterModifier: \"A parameter property is only allowed in a constructor implementation.\",\n UnexpectedReadonly: \"'readonly' type modifier is only permitted on array and tuple literal types.\",\n UnexpectedTypeAnnotation: \"Did not expect a type annotation here.\",\n UnexpectedTypeCastInParameter: \"Unexpected type cast in parameter position.\",\n UnsupportedImportTypeArgument: \"Argument in a type import must be a string literal.\",\n UnsupportedParameterPropertyKind: \"A parameter property may not be declared using a binding pattern.\",\n UnsupportedSignatureParameterKind: ({\n type\n }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`\n});\n\nfunction keywordTypeFromName(value) {\n switch (value) {\n case \"any\":\n return \"TSAnyKeyword\";\n case \"boolean\":\n return \"TSBooleanKeyword\";\n case \"bigint\":\n return \"TSBigIntKeyword\";\n case \"never\":\n return \"TSNeverKeyword\";\n case \"number\":\n return \"TSNumberKeyword\";\n case \"object\":\n return \"TSObjectKeyword\";\n case \"string\":\n return \"TSStringKeyword\";\n case \"symbol\":\n return \"TSSymbolKeyword\";\n case \"undefined\":\n return \"TSUndefinedKeyword\";\n case \"unknown\":\n return \"TSUnknownKeyword\";\n default:\n return undefined;\n }\n}\nfunction tsIsAccessModifier(modifier) {\n return modifier === \"private\" || modifier === \"public\" || modifier === \"protected\";\n}\nfunction tsIsVarianceAnnotations(modifier) {\n return modifier === \"in\" || modifier === \"out\";\n}\nvar typescript = (superClass => class TypeScriptParserMixin extends superClass {\n getScopeHandler() {\n return TypeScriptScopeHandler;\n }\n tsIsIdentifier() {\n return tokenIsIdentifier(this.state.type);\n }\n tsTokenCanFollowModifier() {\n return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(136) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();\n }\n tsNextTokenCanFollowModifier() {\n this.next();\n return this.tsTokenCanFollowModifier();\n }\n\n tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {\n if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58) {\n return undefined;\n }\n const modifier = this.state.value;\n if (allowedModifiers.indexOf(modifier) !== -1) {\n if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {\n return undefined;\n }\n if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {\n return modifier;\n }\n }\n return undefined;\n }\n\n tsParseModifiers({\n modified,\n allowedModifiers,\n disallowedModifiers,\n stopOnStartOfClassStaticBlock,\n errorTemplate = TSErrors.InvalidModifierOnTypeMember\n }) {\n const enforceOrder = (loc, modifier, before, after) => {\n if (modifier === before && modified[after]) {\n this.raise(TSErrors.InvalidModifiersOrder, {\n at: loc,\n orderedModifiers: [before, after]\n });\n }\n };\n const incompatible = (loc, modifier, mod1, mod2) => {\n if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {\n this.raise(TSErrors.IncompatibleModifiers, {\n at: loc,\n modifiers: [mod1, mod2]\n });\n }\n };\n for (;;) {\n const {\n startLoc\n } = this.state;\n const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock);\n if (!modifier) break;\n if (tsIsAccessModifier(modifier)) {\n if (modified.accessibility) {\n this.raise(TSErrors.DuplicateAccessibilityModifier, {\n at: startLoc,\n modifier\n });\n } else {\n enforceOrder(startLoc, modifier, modifier, \"override\");\n enforceOrder(startLoc, modifier, modifier, \"static\");\n enforceOrder(startLoc, modifier, modifier, \"readonly\");\n modified.accessibility = modifier;\n }\n } else if (tsIsVarianceAnnotations(modifier)) {\n if (modified[modifier]) {\n this.raise(TSErrors.DuplicateModifier, {\n at: startLoc,\n modifier\n });\n }\n modified[modifier] = true;\n enforceOrder(startLoc, modifier, \"in\", \"out\");\n } else {\n if (Object.hasOwnProperty.call(modified, modifier)) {\n this.raise(TSErrors.DuplicateModifier, {\n at: startLoc,\n modifier\n });\n } else {\n enforceOrder(startLoc, modifier, \"static\", \"readonly\");\n enforceOrder(startLoc, modifier, \"static\", \"override\");\n enforceOrder(startLoc, modifier, \"override\", \"readonly\");\n enforceOrder(startLoc, modifier, \"abstract\", \"override\");\n incompatible(startLoc, modifier, \"declare\", \"override\");\n incompatible(startLoc, modifier, \"static\", \"abstract\");\n }\n modified[modifier] = true;\n }\n if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) {\n this.raise(errorTemplate, {\n at: startLoc,\n modifier\n });\n }\n }\n }\n tsIsListTerminator(kind) {\n switch (kind) {\n case \"EnumMembers\":\n case \"TypeMembers\":\n return this.match(8);\n case \"HeritageClauseElement\":\n return this.match(5);\n case \"TupleElementTypes\":\n return this.match(3);\n case \"TypeParametersOrArguments\":\n return this.match(48);\n }\n throw new Error(\"Unreachable\");\n }\n tsParseList(kind, parseElement) {\n const result = [];\n while (!this.tsIsListTerminator(kind)) {\n result.push(parseElement());\n }\n return result;\n }\n tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) {\n return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos));\n }\n\n tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) {\n const result = [];\n let trailingCommaPos = -1;\n for (;;) {\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n trailingCommaPos = -1;\n const element = parseElement();\n if (element == null) {\n return undefined;\n }\n result.push(element);\n if (this.eat(12)) {\n trailingCommaPos = this.state.lastTokStart;\n continue;\n }\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n if (expectSuccess) {\n this.expect(12);\n }\n return undefined;\n }\n if (refTrailingCommaPos) {\n refTrailingCommaPos.value = trailingCommaPos;\n }\n return result;\n }\n tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) {\n if (!skipFirstToken) {\n if (bracket) {\n this.expect(0);\n } else {\n this.expect(47);\n }\n }\n const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos);\n if (bracket) {\n this.expect(3);\n } else {\n this.expect(48);\n }\n return result;\n }\n tsParseImportType() {\n const node = this.startNode();\n this.expect(83);\n this.expect(10);\n if (!this.match(131)) {\n this.raise(TSErrors.UnsupportedImportTypeArgument, {\n at: this.state.startLoc\n });\n }\n\n node.argument = super.parseExprAtom();\n this.expect(11);\n if (this.eat(16)) {\n node.qualifier = this.tsParseEntityName();\n }\n if (this.match(47)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSImportType\");\n }\n tsParseEntityName(allowReservedWords = true) {\n let entity = this.parseIdentifier(allowReservedWords);\n while (this.eat(16)) {\n const node = this.startNodeAtNode(entity);\n node.left = entity;\n node.right = this.parseIdentifier(allowReservedWords);\n entity = this.finishNode(node, \"TSQualifiedName\");\n }\n return entity;\n }\n tsParseTypeReference() {\n const node = this.startNode();\n node.typeName = this.tsParseEntityName();\n if (!this.hasPrecedingLineBreak() && this.match(47)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeReference\");\n }\n tsParseThisTypePredicate(lhs) {\n this.next();\n const node = this.startNodeAtNode(lhs);\n node.parameterName = lhs;\n node.typeAnnotation = this.tsParseTypeAnnotation(false);\n node.asserts = false;\n return this.finishNode(node, \"TSTypePredicate\");\n }\n tsParseThisTypeNode() {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, \"TSThisType\");\n }\n tsParseTypeQuery() {\n const node = this.startNode();\n this.expect(87);\n if (this.match(83)) {\n node.exprName = this.tsParseImportType();\n } else {\n node.exprName = this.tsParseEntityName();\n }\n if (!this.hasPrecedingLineBreak() && this.match(47)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeQuery\");\n }\n tsParseInOutModifiers(node) {\n this.tsParseModifiers({\n modified: node,\n allowedModifiers: [\"in\", \"out\"],\n disallowedModifiers: [\"public\", \"private\", \"protected\", \"readonly\", \"declare\", \"abstract\", \"override\"],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameter\n });\n }\n\n tsParseNoneModifiers(node) {\n this.tsParseModifiers({\n modified: node,\n allowedModifiers: [],\n disallowedModifiers: [\"in\", \"out\"],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions\n });\n }\n tsParseTypeParameter(parseModifiers = this.tsParseNoneModifiers.bind(this)) {\n const node = this.startNode();\n parseModifiers(node);\n node.name = this.tsParseTypeParameterName();\n node.constraint = this.tsEatThenParseType(81);\n node.default = this.tsEatThenParseType(29);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n tsTryParseTypeParameters(parseModifiers) {\n if (this.match(47)) {\n return this.tsParseTypeParameters(parseModifiers);\n }\n }\n tsParseTypeParameters(parseModifiers) {\n const node = this.startNode();\n if (this.match(47) || this.match(140)) {\n this.next();\n } else {\n this.unexpected();\n }\n const refTrailingCommaPos = {\n value: -1\n };\n node.params = this.tsParseBracketedList(\"TypeParametersOrArguments\",\n this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);\n if (node.params.length === 0) {\n this.raise(TSErrors.EmptyTypeParameters, {\n at: node\n });\n }\n if (refTrailingCommaPos.value !== -1) {\n this.addExtra(node, \"trailingComma\", refTrailingCommaPos.value);\n }\n return this.finishNode(node, \"TSTypeParameterDeclaration\");\n }\n\n tsFillSignature(returnToken, signature) {\n const returnTokenRequired = returnToken === 19;\n\n const paramsKey = \"parameters\";\n const returnTypeKey = \"typeAnnotation\";\n signature.typeParameters = this.tsTryParseTypeParameters();\n this.expect(10);\n signature[paramsKey] = this.tsParseBindingListForSignature();\n if (returnTokenRequired) {\n signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n } else if (this.match(returnToken)) {\n signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n }\n }\n tsParseBindingListForSignature() {\n return super.parseBindingList(11, 41).map(pattern => {\n if (pattern.type !== \"Identifier\" && pattern.type !== \"RestElement\" && pattern.type !== \"ObjectPattern\" && pattern.type !== \"ArrayPattern\") {\n this.raise(TSErrors.UnsupportedSignatureParameterKind, {\n at: pattern,\n type: pattern.type\n });\n }\n return pattern;\n });\n }\n tsParseTypeMemberSemicolon() {\n if (!this.eat(12) && !this.isLineTerminator()) {\n this.expect(13);\n }\n }\n tsParseSignatureMember(kind, node) {\n this.tsFillSignature(14, node);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, kind);\n }\n tsIsUnambiguouslyIndexSignature() {\n this.next();\n if (tokenIsIdentifier(this.state.type)) {\n this.next();\n return this.match(14);\n }\n return false;\n }\n tsTryParseIndexSignature(node) {\n if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {\n return undefined;\n }\n this.expect(0);\n const id = this.parseIdentifier();\n id.typeAnnotation = this.tsParseTypeAnnotation();\n this.resetEndLocation(id);\n\n this.expect(3);\n node.parameters = [id];\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, \"TSIndexSignature\");\n }\n tsParsePropertyOrMethodSignature(node, readonly) {\n if (this.eat(17)) node.optional = true;\n const nodeAny = node;\n if (this.match(10) || this.match(47)) {\n if (readonly) {\n this.raise(TSErrors.ReadonlyForMethodSignature, {\n at: node\n });\n }\n const method = nodeAny;\n if (method.kind && this.match(47)) {\n this.raise(TSErrors.AccesorCannotHaveTypeParameters, {\n at: this.state.curPosition()\n });\n }\n this.tsFillSignature(14, method);\n this.tsParseTypeMemberSemicolon();\n const paramsKey = \"parameters\";\n const returnTypeKey = \"typeAnnotation\";\n if (method.kind === \"get\") {\n if (method[paramsKey].length > 0) {\n this.raise(Errors.BadGetterArity, {\n at: this.state.curPosition()\n });\n if (this.isThisParam(method[paramsKey][0])) {\n this.raise(TSErrors.AccesorCannotDeclareThisParameter, {\n at: this.state.curPosition()\n });\n }\n }\n } else if (method.kind === \"set\") {\n if (method[paramsKey].length !== 1) {\n this.raise(Errors.BadSetterArity, {\n at: this.state.curPosition()\n });\n } else {\n const firstParameter = method[paramsKey][0];\n if (this.isThisParam(firstParameter)) {\n this.raise(TSErrors.AccesorCannotDeclareThisParameter, {\n at: this.state.curPosition()\n });\n }\n if (firstParameter.type === \"Identifier\" && firstParameter.optional) {\n this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, {\n at: this.state.curPosition()\n });\n }\n if (firstParameter.type === \"RestElement\") {\n this.raise(TSErrors.SetAccesorCannotHaveRestParameter, {\n at: this.state.curPosition()\n });\n }\n }\n if (method[returnTypeKey]) {\n this.raise(TSErrors.SetAccesorCannotHaveReturnType, {\n at: method[returnTypeKey]\n });\n }\n } else {\n method.kind = \"method\";\n }\n return this.finishNode(method, \"TSMethodSignature\");\n } else {\n const property = nodeAny;\n if (readonly) property.readonly = true;\n const type = this.tsTryParseTypeAnnotation();\n if (type) property.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(property, \"TSPropertySignature\");\n }\n }\n tsParseTypeMember() {\n const node = this.startNode();\n if (this.match(10) || this.match(47)) {\n return this.tsParseSignatureMember(\"TSCallSignatureDeclaration\", node);\n }\n if (this.match(77)) {\n const id = this.startNode();\n this.next();\n if (this.match(10) || this.match(47)) {\n return this.tsParseSignatureMember(\"TSConstructSignatureDeclaration\", node);\n } else {\n node.key = this.createIdentifier(id, \"new\");\n return this.tsParsePropertyOrMethodSignature(node, false);\n }\n }\n this.tsParseModifiers({\n modified: node,\n allowedModifiers: [\"readonly\"],\n disallowedModifiers: [\"declare\", \"abstract\", \"private\", \"protected\", \"public\", \"static\", \"override\"]\n });\n const idx = this.tsTryParseIndexSignature(node);\n if (idx) {\n return idx;\n }\n super.parsePropertyName(node);\n if (!node.computed && node.key.type === \"Identifier\" && (node.key.name === \"get\" || node.key.name === \"set\") && this.tsTokenCanFollowModifier()) {\n node.kind = node.key.name;\n super.parsePropertyName(node);\n }\n return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);\n }\n tsParseTypeLiteral() {\n const node = this.startNode();\n node.members = this.tsParseObjectTypeMembers();\n return this.finishNode(node, \"TSTypeLiteral\");\n }\n tsParseObjectTypeMembers() {\n this.expect(5);\n const members = this.tsParseList(\"TypeMembers\", this.tsParseTypeMember.bind(this));\n this.expect(8);\n return members;\n }\n tsIsStartOfMappedType() {\n this.next();\n if (this.eat(53)) {\n return this.isContextual(120);\n }\n if (this.isContextual(120)) {\n this.next();\n }\n if (!this.match(0)) {\n return false;\n }\n this.next();\n if (!this.tsIsIdentifier()) {\n return false;\n }\n this.next();\n return this.match(58);\n }\n tsParseMappedTypeParameter() {\n const node = this.startNode();\n node.name = this.tsParseTypeParameterName();\n node.constraint = this.tsExpectThenParseType(58);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n tsParseMappedType() {\n const node = this.startNode();\n this.expect(5);\n if (this.match(53)) {\n node.readonly = this.state.value;\n this.next();\n this.expectContextual(120);\n } else if (this.eatContextual(120)) {\n node.readonly = true;\n }\n this.expect(0);\n node.typeParameter = this.tsParseMappedTypeParameter();\n node.nameType = this.eatContextual(93) ? this.tsParseType() : null;\n this.expect(3);\n if (this.match(53)) {\n node.optional = this.state.value;\n this.next();\n this.expect(17);\n } else if (this.eat(17)) {\n node.optional = true;\n }\n node.typeAnnotation = this.tsTryParseType();\n this.semicolon();\n this.expect(8);\n return this.finishNode(node, \"TSMappedType\");\n }\n tsParseTupleType() {\n const node = this.startNode();\n node.elementTypes = this.tsParseBracketedList(\"TupleElementTypes\", this.tsParseTupleElementType.bind(this), true, false);\n\n let seenOptionalElement = false;\n let labeledElements = null;\n node.elementTypes.forEach(elementNode => {\n var _labeledElements;\n const {\n type\n } = elementNode;\n if (seenOptionalElement && type !== \"TSRestType\" && type !== \"TSOptionalType\" && !(type === \"TSNamedTupleMember\" && elementNode.optional)) {\n this.raise(TSErrors.OptionalTypeBeforeRequired, {\n at: elementNode\n });\n }\n seenOptionalElement || (seenOptionalElement = type === \"TSNamedTupleMember\" && elementNode.optional || type === \"TSOptionalType\");\n\n let checkType = type;\n if (type === \"TSRestType\") {\n elementNode = elementNode.typeAnnotation;\n checkType = elementNode.type;\n }\n const isLabeled = checkType === \"TSNamedTupleMember\";\n (_labeledElements = labeledElements) != null ? _labeledElements : labeledElements = isLabeled;\n if (labeledElements !== isLabeled) {\n this.raise(TSErrors.MixedLabeledAndUnlabeledElements, {\n at: elementNode\n });\n }\n });\n return this.finishNode(node, \"TSTupleType\");\n }\n tsParseTupleElementType() {\n\n const {\n startLoc\n } = this.state;\n const rest = this.eat(21);\n let type = this.tsParseType();\n const optional = this.eat(17);\n const labeled = this.eat(14);\n if (labeled) {\n const labeledNode = this.startNodeAtNode(type);\n labeledNode.optional = optional;\n if (type.type === \"TSTypeReference\" && !type.typeParameters && type.typeName.type === \"Identifier\") {\n labeledNode.label = type.typeName;\n } else {\n this.raise(TSErrors.InvalidTupleMemberLabel, {\n at: type\n });\n labeledNode.label = type;\n }\n labeledNode.elementType = this.tsParseType();\n type = this.finishNode(labeledNode, \"TSNamedTupleMember\");\n } else if (optional) {\n const optionalTypeNode = this.startNodeAtNode(type);\n optionalTypeNode.typeAnnotation = type;\n type = this.finishNode(optionalTypeNode, \"TSOptionalType\");\n }\n if (rest) {\n const restNode = this.startNodeAt(startLoc);\n restNode.typeAnnotation = type;\n type = this.finishNode(restNode, \"TSRestType\");\n }\n return type;\n }\n tsParseParenthesizedType() {\n const node = this.startNode();\n this.expect(10);\n node.typeAnnotation = this.tsParseType();\n this.expect(11);\n return this.finishNode(node, \"TSParenthesizedType\");\n }\n tsParseFunctionOrConstructorType(type, abstract) {\n const node = this.startNode();\n if (type === \"TSConstructorType\") {\n node.abstract = !!abstract;\n if (abstract) this.next();\n this.next();\n }\n\n this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node));\n return this.finishNode(node, type);\n }\n tsParseLiteralTypeNode() {\n const node = this.startNode();\n node.literal = (() => {\n switch (this.state.type) {\n case 132:\n case 133:\n case 131:\n case 85:\n case 86:\n return super.parseExprAtom();\n default:\n throw this.unexpected();\n }\n })();\n return this.finishNode(node, \"TSLiteralType\");\n }\n tsParseTemplateLiteralType() {\n const node = this.startNode();\n node.literal = super.parseTemplate(false);\n return this.finishNode(node, \"TSLiteralType\");\n }\n parseTemplateSubstitution() {\n if (this.state.inType) return this.tsParseType();\n return super.parseTemplateSubstitution();\n }\n tsParseThisTypeOrThisTypePredicate() {\n const thisKeyword = this.tsParseThisTypeNode();\n if (this.isContextual(114) && !this.hasPrecedingLineBreak()) {\n return this.tsParseThisTypePredicate(thisKeyword);\n } else {\n return thisKeyword;\n }\n }\n tsParseNonArrayType() {\n switch (this.state.type) {\n case 131:\n case 132:\n case 133:\n case 85:\n case 86:\n return this.tsParseLiteralTypeNode();\n case 53:\n if (this.state.value === \"-\") {\n const node = this.startNode();\n const nextToken = this.lookahead();\n if (nextToken.type !== 132 && nextToken.type !== 133) {\n throw this.unexpected();\n }\n node.literal = this.parseMaybeUnary();\n return this.finishNode(node, \"TSLiteralType\");\n }\n break;\n case 78:\n return this.tsParseThisTypeOrThisTypePredicate();\n case 87:\n return this.tsParseTypeQuery();\n case 83:\n return this.tsParseImportType();\n case 5:\n return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();\n case 0:\n return this.tsParseTupleType();\n case 10:\n return this.tsParseParenthesizedType();\n case 25:\n case 24:\n return this.tsParseTemplateLiteralType();\n default:\n {\n const {\n type\n } = this.state;\n if (tokenIsIdentifier(type) || type === 88 || type === 84) {\n const nodeType = type === 88 ? \"TSVoidKeyword\" : type === 84 ? \"TSNullKeyword\" : keywordTypeFromName(this.state.value);\n if (nodeType !== undefined && this.lookaheadCharCode() !== 46) {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, nodeType);\n }\n return this.tsParseTypeReference();\n }\n }\n }\n throw this.unexpected();\n }\n tsParseArrayTypeOrHigher() {\n let type = this.tsParseNonArrayType();\n while (!this.hasPrecedingLineBreak() && this.eat(0)) {\n if (this.match(3)) {\n const node = this.startNodeAtNode(type);\n node.elementType = type;\n this.expect(3);\n type = this.finishNode(node, \"TSArrayType\");\n } else {\n const node = this.startNodeAtNode(type);\n node.objectType = type;\n node.indexType = this.tsParseType();\n this.expect(3);\n type = this.finishNode(node, \"TSIndexedAccessType\");\n }\n }\n return type;\n }\n tsParseTypeOperator() {\n const node = this.startNode();\n const operator = this.state.value;\n this.next();\n node.operator = operator;\n node.typeAnnotation = this.tsParseTypeOperatorOrHigher();\n if (operator === \"readonly\") {\n this.tsCheckTypeAnnotationForReadOnly(\n node);\n }\n return this.finishNode(node, \"TSTypeOperator\");\n }\n tsCheckTypeAnnotationForReadOnly(node) {\n switch (node.typeAnnotation.type) {\n case \"TSTupleType\":\n case \"TSArrayType\":\n return;\n default:\n this.raise(TSErrors.UnexpectedReadonly, {\n at: node\n });\n }\n }\n tsParseInferType() {\n const node = this.startNode();\n this.expectContextual(113);\n const typeParameter = this.startNode();\n typeParameter.name = this.tsParseTypeParameterName();\n typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType());\n node.typeParameter = this.finishNode(typeParameter, \"TSTypeParameter\");\n return this.finishNode(node, \"TSInferType\");\n }\n tsParseConstraintForInferType() {\n if (this.eat(81)) {\n const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType());\n if (this.state.inDisallowConditionalTypesContext || !this.match(17)) {\n return constraint;\n }\n }\n }\n tsParseTypeOperatorOrHigher() {\n const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;\n return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(113) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());\n }\n tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {\n const node = this.startNode();\n const hasLeadingOperator = this.eat(operator);\n const types = [];\n do {\n types.push(parseConstituentType());\n } while (this.eat(operator));\n if (types.length === 1 && !hasLeadingOperator) {\n return types[0];\n }\n node.types = types;\n return this.finishNode(node, kind);\n }\n tsParseIntersectionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\"TSIntersectionType\", this.tsParseTypeOperatorOrHigher.bind(this), 45);\n }\n tsParseUnionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\"TSUnionType\", this.tsParseIntersectionTypeOrHigher.bind(this), 43);\n }\n tsIsStartOfFunctionType() {\n if (this.match(47)) {\n return true;\n }\n return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));\n }\n tsSkipParameterStart() {\n if (tokenIsIdentifier(this.state.type) || this.match(78)) {\n this.next();\n return true;\n }\n if (this.match(5)) {\n const {\n errors\n } = this.state;\n const previousErrorCount = errors.length;\n try {\n this.parseObjectLike(8, true);\n return errors.length === previousErrorCount;\n } catch (_unused) {\n return false;\n }\n }\n if (this.match(0)) {\n this.next();\n const {\n errors\n } = this.state;\n const previousErrorCount = errors.length;\n try {\n super.parseBindingList(3, 93, true);\n return errors.length === previousErrorCount;\n } catch (_unused2) {\n return false;\n }\n }\n return false;\n }\n tsIsUnambiguouslyStartOfFunctionType() {\n this.next();\n if (this.match(11) || this.match(21)) {\n return true;\n }\n if (this.tsSkipParameterStart()) {\n if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) {\n return true;\n }\n if (this.match(11)) {\n this.next();\n if (this.match(19)) {\n return true;\n }\n }\n }\n return false;\n }\n tsParseTypeOrTypePredicateAnnotation(returnToken) {\n return this.tsInType(() => {\n const t = this.startNode();\n this.expect(returnToken);\n const node = this.startNode();\n const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));\n if (asserts && this.match(78)) {\n let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();\n if (thisTypePredicate.type === \"TSThisType\") {\n node.parameterName = thisTypePredicate;\n node.asserts = true;\n node.typeAnnotation = null;\n thisTypePredicate = this.finishNode(node, \"TSTypePredicate\");\n } else {\n this.resetStartLocationFromNode(thisTypePredicate, node);\n thisTypePredicate.asserts = true;\n }\n t.typeAnnotation = thisTypePredicate;\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));\n if (!typePredicateVariable) {\n if (!asserts) {\n return this.tsParseTypeAnnotation(false, t);\n }\n\n node.parameterName = this.parseIdentifier();\n node.asserts = asserts;\n node.typeAnnotation = null;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n const type = this.tsParseTypeAnnotation(false);\n node.parameterName = typePredicateVariable;\n node.typeAnnotation = type;\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n });\n }\n tsTryParseTypeOrTypePredicateAnnotation() {\n return this.match(14) ? this.tsParseTypeOrTypePredicateAnnotation(14) : undefined;\n }\n tsTryParseTypeAnnotation() {\n return this.match(14) ? this.tsParseTypeAnnotation() : undefined;\n }\n tsTryParseType() {\n return this.tsEatThenParseType(14);\n }\n tsParseTypePredicatePrefix() {\n const id = this.parseIdentifier();\n if (this.isContextual(114) && !this.hasPrecedingLineBreak()) {\n this.next();\n return id;\n }\n }\n tsParseTypePredicateAsserts() {\n if (this.state.type !== 107) {\n return false;\n }\n const containsEsc = this.state.containsEsc;\n this.next();\n if (!tokenIsIdentifier(this.state.type) && !this.match(78)) {\n return false;\n }\n if (containsEsc) {\n this.raise(Errors.InvalidEscapedReservedWord, {\n at: this.state.lastTokStartLoc,\n reservedWord: \"asserts\"\n });\n }\n return true;\n }\n tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {\n this.tsInType(() => {\n if (eatColon) this.expect(14);\n t.typeAnnotation = this.tsParseType();\n });\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n tsParseType() {\n assert(this.state.inType);\n const type = this.tsParseNonConditionalType();\n if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) {\n return type;\n }\n const node = this.startNodeAtNode(type);\n node.checkType = type;\n node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType());\n this.expect(17);\n node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());\n this.expect(14);\n node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());\n return this.finishNode(node, \"TSConditionalType\");\n }\n isAbstractConstructorSignature() {\n return this.isContextual(122) && this.lookahead().type === 77;\n }\n tsParseNonConditionalType() {\n if (this.tsIsStartOfFunctionType()) {\n return this.tsParseFunctionOrConstructorType(\"TSFunctionType\");\n }\n if (this.match(77)) {\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\");\n } else if (this.isAbstractConstructorSignature()) {\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\", true);\n }\n return this.tsParseUnionTypeOrHigher();\n }\n tsParseTypeAssertion() {\n if (this.getPluginOption(\"typescript\", \"disallowAmbiguousJSXLike\")) {\n this.raise(TSErrors.ReservedTypeAssertion, {\n at: this.state.startLoc\n });\n }\n const node = this.startNode();\n node.typeAnnotation = this.tsInType(() => {\n this.next();\n return this.match(75) ? this.tsParseTypeReference() : this.tsParseType();\n });\n this.expect(48);\n node.expression = this.parseMaybeUnary();\n return this.finishNode(node, \"TSTypeAssertion\");\n }\n tsParseHeritageClause(token) {\n const originalStartLoc = this.state.startLoc;\n const delimitedList = this.tsParseDelimitedList(\"HeritageClauseElement\", () => {\n const node = this.startNode();\n node.expression = this.tsParseEntityName();\n if (this.match(47)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSExpressionWithTypeArguments\");\n });\n if (!delimitedList.length) {\n this.raise(TSErrors.EmptyHeritageClauseType, {\n at: originalStartLoc,\n token\n });\n }\n return delimitedList;\n }\n tsParseInterfaceDeclaration(node, properties = {}) {\n if (this.hasFollowingLineBreak()) return null;\n this.expectContextual(127);\n if (properties.declare) node.declare = true;\n if (tokenIsIdentifier(this.state.type)) {\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_TS_INTERFACE);\n } else {\n node.id = null;\n this.raise(TSErrors.MissingInterfaceName, {\n at: this.state.startLoc\n });\n }\n node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));\n if (this.eat(81)) {\n node.extends = this.tsParseHeritageClause(\"extends\");\n }\n const body = this.startNode();\n body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));\n node.body = this.finishNode(body, \"TSInterfaceBody\");\n return this.finishNode(node, \"TSInterfaceDeclaration\");\n }\n tsParseTypeAliasDeclaration(node) {\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_TS_TYPE);\n node.typeAnnotation = this.tsInType(() => {\n node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));\n this.expect(29);\n if (this.isContextual(112) && this.lookahead().type !== 16) {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, \"TSIntrinsicKeyword\");\n }\n return this.tsParseType();\n });\n this.semicolon();\n return this.finishNode(node, \"TSTypeAliasDeclaration\");\n }\n tsInNoContext(cb) {\n const oldContext = this.state.context;\n this.state.context = [oldContext[0]];\n try {\n return cb();\n } finally {\n this.state.context = oldContext;\n }\n }\n\n tsInType(cb) {\n const oldInType = this.state.inType;\n this.state.inType = true;\n try {\n return cb();\n } finally {\n this.state.inType = oldInType;\n }\n }\n tsInDisallowConditionalTypesContext(cb) {\n const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;\n this.state.inDisallowConditionalTypesContext = true;\n try {\n return cb();\n } finally {\n this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n }\n }\n tsInAllowConditionalTypesContext(cb) {\n const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;\n this.state.inDisallowConditionalTypesContext = false;\n try {\n return cb();\n } finally {\n this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n }\n }\n tsEatThenParseType(token) {\n return !this.match(token) ? undefined : this.tsNextThenParseType();\n }\n tsExpectThenParseType(token) {\n return this.tsDoThenParseType(() => this.expect(token));\n }\n tsNextThenParseType() {\n return this.tsDoThenParseType(() => this.next());\n }\n tsDoThenParseType(cb) {\n return this.tsInType(() => {\n cb();\n return this.tsParseType();\n });\n }\n tsParseEnumMember() {\n const node = this.startNode();\n node.id = this.match(131) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);\n if (this.eat(29)) {\n node.initializer = super.parseMaybeAssignAllowIn();\n }\n return this.finishNode(node, \"TSEnumMember\");\n }\n tsParseEnumDeclaration(node, properties = {}) {\n if (properties.const) node.const = true;\n if (properties.declare) node.declare = true;\n this.expectContextual(124);\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, node.const ? BIND_TS_CONST_ENUM : BIND_TS_ENUM);\n this.expect(5);\n node.members = this.tsParseDelimitedList(\"EnumMembers\", this.tsParseEnumMember.bind(this));\n this.expect(8);\n return this.finishNode(node, \"TSEnumDeclaration\");\n }\n tsParseModuleBlock() {\n const node = this.startNode();\n this.scope.enter(SCOPE_OTHER);\n this.expect(5);\n super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8);\n this.scope.exit();\n return this.finishNode(node, \"TSModuleBlock\");\n }\n tsParseModuleOrNamespaceDeclaration(node, nested = false) {\n node.id = this.parseIdentifier();\n if (!nested) {\n this.checkIdentifier(node.id, BIND_TS_NAMESPACE);\n }\n if (this.eat(16)) {\n const inner = this.startNode();\n this.tsParseModuleOrNamespaceDeclaration(inner, true);\n node.body = inner;\n } else {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n }\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n tsParseAmbientExternalModuleDeclaration(node) {\n if (this.isContextual(110)) {\n node.global = true;\n node.id = this.parseIdentifier();\n } else if (this.match(131)) {\n node.id = super.parseStringLiteral(this.state.value);\n } else {\n this.unexpected();\n }\n if (this.match(5)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n } else {\n this.semicolon();\n }\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n tsParseImportEqualsDeclaration(node, isExport) {\n node.isExport = isExport || false;\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_FLAGS_TS_IMPORT);\n this.expect(29);\n const moduleReference = this.tsParseModuleReference();\n if (node.importKind === \"type\" && moduleReference.type !== \"TSExternalModuleReference\") {\n this.raise(TSErrors.ImportAliasHasImportType, {\n at: moduleReference\n });\n }\n node.moduleReference = moduleReference;\n this.semicolon();\n return this.finishNode(node, \"TSImportEqualsDeclaration\");\n }\n tsIsExternalModuleReference() {\n return this.isContextual(117) && this.lookaheadCharCode() === 40;\n }\n tsParseModuleReference() {\n return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);\n }\n tsParseExternalModuleReference() {\n const node = this.startNode();\n this.expectContextual(117);\n this.expect(10);\n if (!this.match(131)) {\n throw this.unexpected();\n }\n node.expression = super.parseExprAtom();\n this.expect(11);\n return this.finishNode(node, \"TSExternalModuleReference\");\n }\n\n tsLookAhead(f) {\n const state = this.state.clone();\n const res = f();\n this.state = state;\n return res;\n }\n tsTryParseAndCatch(f) {\n const result = this.tryParse(abort =>\n f() || abort());\n if (result.aborted || !result.node) return undefined;\n if (result.error) this.state = result.failState;\n return result.node;\n }\n tsTryParse(f) {\n const state = this.state.clone();\n const result = f();\n if (result !== undefined && result !== false) {\n return result;\n } else {\n this.state = state;\n return undefined;\n }\n }\n tsTryParseDeclare(nany) {\n if (this.isLineTerminator()) {\n return;\n }\n let starttype = this.state.type;\n let kind;\n if (this.isContextual(99)) {\n starttype = 74;\n kind = \"let\";\n }\n\n return this.tsInAmbientContext(() => {\n if (starttype === 68) {\n nany.declare = true;\n return super.parseFunctionStatement(nany, false, false);\n }\n if (starttype === 80) {\n nany.declare = true;\n return this.parseClass(nany, true, false);\n }\n if (starttype === 124) {\n return this.tsParseEnumDeclaration(nany, {\n declare: true\n });\n }\n if (starttype === 110) {\n return this.tsParseAmbientExternalModuleDeclaration(nany);\n }\n if (starttype === 75 || starttype === 74) {\n if (!this.match(75) || !this.isLookaheadContextual(\"enum\")) {\n nany.declare = true;\n return this.parseVarStatement(nany, kind || this.state.value, true);\n }\n\n this.expect(75);\n return this.tsParseEnumDeclaration(nany, {\n const: true,\n declare: true\n });\n }\n if (starttype === 127) {\n const result = this.tsParseInterfaceDeclaration(nany, {\n declare: true\n });\n if (result) return result;\n }\n if (tokenIsIdentifier(starttype)) {\n return this.tsParseDeclaration(nany, this.state.value, true, null);\n }\n });\n }\n\n tsTryParseExportDeclaration() {\n return this.tsParseDeclaration(this.startNode(), this.state.value, true, null);\n }\n tsParseExpressionStatement(node, expr, decorators) {\n switch (expr.name) {\n case \"declare\":\n {\n const declaration = this.tsTryParseDeclare(node);\n if (declaration) {\n declaration.declare = true;\n return declaration;\n }\n break;\n }\n case \"global\":\n if (this.match(5)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n const mod = node;\n mod.global = true;\n mod.id = expr;\n mod.body = this.tsParseModuleBlock();\n this.scope.exit();\n this.prodParam.exit();\n return this.finishNode(mod, \"TSModuleDeclaration\");\n }\n break;\n default:\n return this.tsParseDeclaration(node, expr.name, false, decorators);\n }\n }\n\n tsParseDeclaration(node, value, next, decorators) {\n switch (value) {\n case \"abstract\":\n if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {\n return this.tsParseAbstractDeclaration(node, decorators);\n }\n break;\n case \"module\":\n if (this.tsCheckLineTerminator(next)) {\n if (this.match(131)) {\n return this.tsParseAmbientExternalModuleDeclaration(node);\n } else if (tokenIsIdentifier(this.state.type)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n }\n break;\n case \"namespace\":\n if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n break;\n case \"type\":\n if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {\n return this.tsParseTypeAliasDeclaration(node);\n }\n break;\n }\n }\n tsCheckLineTerminator(next) {\n if (next) {\n if (this.hasFollowingLineBreak()) return false;\n this.next();\n return true;\n }\n return !this.isLineTerminator();\n }\n tsTryParseGenericAsyncArrowFunction(startLoc) {\n if (!this.match(47)) {\n return undefined;\n }\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = true;\n const res = this.tsTryParseAndCatch(() => {\n const node = this.startNodeAt(startLoc);\n node.typeParameters = this.tsParseTypeParameters();\n super.parseFunctionParams(node);\n node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();\n this.expect(19);\n return node;\n });\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n if (!res) {\n return undefined;\n }\n return super.parseArrowExpression(res, null, true);\n }\n\n tsParseTypeArgumentsInExpression() {\n if (this.reScan_lt() !== 47) {\n return undefined;\n }\n return this.tsParseTypeArguments();\n }\n tsParseTypeArguments() {\n const node = this.startNode();\n node.params = this.tsInType(() =>\n this.tsInNoContext(() => {\n this.expect(47);\n return this.tsParseDelimitedList(\"TypeParametersOrArguments\", this.tsParseType.bind(this));\n }));\n if (node.params.length === 0) {\n this.raise(TSErrors.EmptyTypeArguments, {\n at: node\n });\n }\n this.expect(48);\n return this.finishNode(node, \"TSTypeParameterInstantiation\");\n }\n tsIsDeclarationStart() {\n return tokenIsTSDeclarationStart(this.state.type);\n }\n\n isExportDefaultSpecifier() {\n if (this.tsIsDeclarationStart()) return false;\n return super.isExportDefaultSpecifier();\n }\n parseAssignableListItem(allowModifiers, decorators) {\n const startLoc = this.state.startLoc;\n let accessibility;\n let readonly = false;\n let override = false;\n if (allowModifiers !== undefined) {\n const modified = {};\n this.tsParseModifiers({\n modified,\n allowedModifiers: [\"public\", \"private\", \"protected\", \"override\", \"readonly\"]\n });\n accessibility = modified.accessibility;\n override = modified.override;\n readonly = modified.readonly;\n if (allowModifiers === false && (accessibility || readonly || override)) {\n this.raise(TSErrors.UnexpectedParameterModifier, {\n at: startLoc\n });\n }\n }\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left);\n const elt = this.parseMaybeDefault(left.loc.start, left);\n if (accessibility || readonly || override) {\n const pp = this.startNodeAt(startLoc);\n if (decorators.length) {\n pp.decorators = decorators;\n }\n if (accessibility) pp.accessibility = accessibility;\n if (readonly) pp.readonly = readonly;\n if (override) pp.override = override;\n if (elt.type !== \"Identifier\" && elt.type !== \"AssignmentPattern\") {\n this.raise(TSErrors.UnsupportedParameterPropertyKind, {\n at: pp\n });\n }\n pp.parameter = elt;\n return this.finishNode(pp, \"TSParameterProperty\");\n }\n if (decorators.length) {\n left.decorators = decorators;\n }\n return elt;\n }\n isSimpleParameter(node) {\n return node.type === \"TSParameterProperty\" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node);\n }\n parseFunctionBodyAndFinish(node, type, isMethod = false) {\n if (this.match(14)) {\n node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14);\n }\n const bodilessType = type === \"FunctionDeclaration\" ? \"TSDeclareFunction\" : type === \"ClassMethod\" || type === \"ClassPrivateMethod\" ? \"TSDeclareMethod\" : undefined;\n if (bodilessType && !this.match(5) && this.isLineTerminator()) {\n return this.finishNode(node, bodilessType);\n }\n if (bodilessType === \"TSDeclareFunction\" && this.state.isAmbientContext) {\n this.raise(TSErrors.DeclareFunctionHasImplementation, {\n at: node\n });\n if (node.declare) {\n return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);\n }\n }\n return super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n registerFunctionStatementId(node) {\n if (!node.body && node.id) {\n this.checkIdentifier(node.id, BIND_TS_AMBIENT);\n } else {\n super.registerFunctionStatementId(node);\n }\n }\n tsCheckForInvalidTypeCasts(items) {\n items.forEach(node => {\n if ((node == null ? void 0 : node.type) === \"TSTypeCastExpression\") {\n this.raise(TSErrors.UnexpectedTypeAnnotation, {\n at: node.typeAnnotation\n });\n }\n });\n }\n toReferencedList(exprList,\n isInParens) {\n this.tsCheckForInvalidTypeCasts(exprList);\n return exprList;\n }\n parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {\n const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);\n if (node.type === \"ArrayExpression\") {\n this.tsCheckForInvalidTypeCasts(node.elements);\n }\n return node;\n }\n parseSubscript(base, startLoc, noCalls, state) {\n if (!this.hasPrecedingLineBreak() && this.match(35)) {\n this.state.canStartJSXElement = false;\n this.next();\n const nonNullExpression = this.startNodeAt(startLoc);\n nonNullExpression.expression = base;\n return this.finishNode(nonNullExpression, \"TSNonNullExpression\");\n }\n let isOptionalCall = false;\n if (this.match(18) && this.lookaheadCharCode() === 60) {\n if (noCalls) {\n state.stop = true;\n return base;\n }\n state.optionalChainMember = isOptionalCall = true;\n this.next();\n }\n\n if (this.match(47) || this.match(51)) {\n let missingParenErrorLoc;\n const result = this.tsTryParseAndCatch(() => {\n if (!noCalls && this.atPossibleAsyncArrow(base)) {\n const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc);\n if (asyncArrowFn) {\n return asyncArrowFn;\n }\n }\n const typeArguments = this.tsParseTypeArgumentsInExpression();\n if (!typeArguments) return;\n if (isOptionalCall && !this.match(10)) {\n missingParenErrorLoc = this.state.curPosition();\n return;\n }\n if (tokenIsTemplate(this.state.type)) {\n const result = super.parseTaggedTemplateExpression(base, startLoc, state);\n result.typeParameters = typeArguments;\n return result;\n }\n if (!noCalls && this.eat(10)) {\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.arguments = this.parseCallExpressionArguments(11, false);\n\n this.tsCheckForInvalidTypeCasts(node.arguments);\n node.typeParameters = typeArguments;\n if (state.optionalChainMember) {\n node.optional = isOptionalCall;\n }\n return this.finishCallExpression(node, state.optionalChainMember);\n }\n const tokenType = this.state.type;\n if (\n tokenType === 48 ||\n tokenType === 52 ||\n tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {\n return;\n }\n const node = this.startNodeAt(startLoc);\n node.expression = base;\n node.typeParameters = typeArguments;\n return this.finishNode(node, \"TSInstantiationExpression\");\n });\n if (missingParenErrorLoc) {\n this.unexpected(missingParenErrorLoc, 10);\n }\n if (result) {\n if (result.type === \"TSInstantiationExpression\" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) {\n this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, {\n at: this.state.startLoc\n });\n }\n return result;\n }\n }\n return super.parseSubscript(base, startLoc, noCalls, state);\n }\n parseNewCallee(node) {\n var _callee$extra;\n super.parseNewCallee(node);\n const {\n callee\n } = node;\n if (callee.type === \"TSInstantiationExpression\" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) {\n node.typeParameters = callee.typeParameters;\n node.callee = callee.expression;\n }\n }\n parseExprOp(left, leftStartLoc, minPrec) {\n let isSatisfies;\n if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(118)))) {\n const node = this.startNodeAt(leftStartLoc);\n node.expression = left;\n node.typeAnnotation = this.tsInType(() => {\n this.next();\n if (this.match(75)) {\n if (isSatisfies) {\n this.raise(Errors.UnexpectedKeyword, {\n at: this.state.startLoc,\n keyword: \"const\"\n });\n }\n return this.tsParseTypeReference();\n }\n return this.tsParseType();\n });\n this.finishNode(node, isSatisfies ? \"TSSatisfiesExpression\" : \"TSAsExpression\");\n this.reScan_lt_gt();\n return this.parseExprOp(\n node, leftStartLoc, minPrec);\n }\n return super.parseExprOp(left, leftStartLoc, minPrec);\n }\n checkReservedWord(word, startLoc, checkKeywords, isBinding) {\n if (!this.state.isAmbientContext) {\n super.checkReservedWord(word, startLoc, checkKeywords, isBinding);\n }\n }\n checkImportReflection(node) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(TSErrors.ImportReflectionHasImportType, {\n at: node.specifiers[0].loc.start\n });\n }\n }\n\n checkDuplicateExports() {}\n parseImport(node) {\n node.importKind = \"value\";\n if (tokenIsIdentifier(this.state.type) || this.match(55) || this.match(5)) {\n let ahead = this.lookahead();\n if (this.isContextual(128) &&\n ahead.type !== 12 &&\n ahead.type !== 97 &&\n ahead.type !== 29) {\n node.importKind = \"type\";\n this.next();\n ahead = this.lookahead();\n }\n if (tokenIsIdentifier(this.state.type) && ahead.type === 29) {\n return this.tsParseImportEqualsDeclaration(node);\n }\n }\n const importNode = super.parseImport(node);\n\n if (importNode.importKind === \"type\" &&\n importNode.specifiers.length > 1 &&\n importNode.specifiers[0].type === \"ImportDefaultSpecifier\") {\n this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, {\n at: importNode\n });\n }\n return importNode;\n }\n parseExport(node, decorators) {\n if (this.match(83)) {\n this.next();\n if (this.isContextual(128) && this.lookaheadCharCode() !== 61) {\n node.importKind = \"type\";\n this.next();\n } else {\n node.importKind = \"value\";\n }\n return this.tsParseImportEqualsDeclaration(node, true);\n } else if (this.eat(29)) {\n const assign = node;\n assign.expression = super.parseExpression();\n this.semicolon();\n return this.finishNode(assign, \"TSExportAssignment\");\n } else if (this.eatContextual(93)) {\n const decl = node;\n this.expectContextual(126);\n decl.id = this.parseIdentifier();\n this.semicolon();\n return this.finishNode(decl, \"TSNamespaceExportDeclaration\");\n } else {\n if (this.isContextual(128) && this.lookahead().type === 5) {\n this.next();\n node.exportKind = \"type\";\n } else {\n node.exportKind = \"value\";\n }\n return super.parseExport(node, decorators);\n }\n }\n isAbstractClass() {\n return this.isContextual(122) && this.lookahead().type === 80;\n }\n parseExportDefaultExpression() {\n if (this.isAbstractClass()) {\n const cls = this.startNode();\n this.next();\n cls.abstract = true;\n return this.parseClass(cls, true, true);\n }\n\n if (this.match(127)) {\n const result = this.tsParseInterfaceDeclaration(this.startNode());\n if (result) return result;\n }\n return super.parseExportDefaultExpression();\n }\n parseVarStatement(node, kind, allowMissingInitializer = false) {\n const {\n isAmbientContext\n } = this.state;\n const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext);\n if (!isAmbientContext) return declaration;\n for (const {\n id,\n init\n } of declaration.declarations) {\n if (!init) continue;\n\n if (kind !== \"const\" || !!id.typeAnnotation) {\n this.raise(TSErrors.InitializerNotAllowedInAmbientContext, {\n at: init\n });\n } else if (init.type !== \"StringLiteral\" && init.type !== \"BooleanLiteral\" && init.type !== \"NumericLiteral\" && init.type !== \"BigIntLiteral\" && (init.type !== \"TemplateLiteral\" || init.expressions.length > 0) && !isPossiblyLiteralEnum(init)) {\n this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, {\n at: init\n });\n }\n }\n return declaration;\n }\n parseStatementContent(flags, decorators) {\n if (this.match(75) && this.isLookaheadContextual(\"enum\")) {\n const node = this.startNode();\n this.expect(75);\n return this.tsParseEnumDeclaration(node, {\n const: true\n });\n }\n if (this.isContextual(124)) {\n return this.tsParseEnumDeclaration(this.startNode());\n }\n if (this.isContextual(127)) {\n const result = this.tsParseInterfaceDeclaration(this.startNode());\n if (result) return result;\n }\n return super.parseStatementContent(flags, decorators);\n }\n parseAccessModifier() {\n return this.tsParseModifier([\"public\", \"protected\", \"private\"]);\n }\n tsHasSomeModifiers(member, modifiers) {\n return modifiers.some(modifier => {\n if (tsIsAccessModifier(modifier)) {\n return member.accessibility === modifier;\n }\n return !!member[modifier];\n });\n }\n tsIsStartOfStaticBlocks() {\n return this.isContextual(104) && this.lookaheadCharCode() === 123;\n }\n parseClassMember(classBody, member, state) {\n const modifiers = [\"declare\", \"private\", \"public\", \"protected\", \"override\", \"abstract\", \"readonly\", \"static\"];\n this.tsParseModifiers({\n modified: member,\n allowedModifiers: modifiers,\n disallowedModifiers: [\"in\", \"out\"],\n stopOnStartOfClassStaticBlock: true,\n errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions\n });\n const callParseClassMemberWithIsStatic = () => {\n if (this.tsIsStartOfStaticBlocks()) {\n this.next();\n this.next();\n if (this.tsHasSomeModifiers(member, modifiers)) {\n this.raise(TSErrors.StaticBlockCannotHaveModifier, {\n at: this.state.curPosition()\n });\n }\n super.parseClassStaticBlock(classBody, member);\n } else {\n this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static);\n }\n };\n if (member.declare) {\n this.tsInAmbientContext(callParseClassMemberWithIsStatic);\n } else {\n callParseClassMemberWithIsStatic();\n }\n }\n parseClassMemberWithIsStatic(classBody, member, state, isStatic) {\n const idx = this.tsTryParseIndexSignature(member);\n if (idx) {\n classBody.body.push(idx);\n if (member.abstract) {\n this.raise(TSErrors.IndexSignatureHasAbstract, {\n at: member\n });\n }\n if (member.accessibility) {\n this.raise(TSErrors.IndexSignatureHasAccessibility, {\n at: member,\n modifier: member.accessibility\n });\n }\n if (member.declare) {\n this.raise(TSErrors.IndexSignatureHasDeclare, {\n at: member\n });\n }\n if (member.override) {\n this.raise(TSErrors.IndexSignatureHasOverride, {\n at: member\n });\n }\n return;\n }\n if (!this.state.inAbstractClass && member.abstract) {\n this.raise(TSErrors.NonAbstractClassHasAbstractMethod, {\n at: member\n });\n }\n if (member.override) {\n if (!state.hadSuperClass) {\n this.raise(TSErrors.OverrideNotInSubClass, {\n at: member\n });\n }\n }\n\n super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n parsePostMemberNameModifiers(methodOrProp) {\n const optional = this.eat(17);\n if (optional) methodOrProp.optional = true;\n if (methodOrProp.readonly && this.match(10)) {\n this.raise(TSErrors.ClassMethodHasReadonly, {\n at: methodOrProp\n });\n }\n if (methodOrProp.declare && this.match(10)) {\n this.raise(TSErrors.ClassMethodHasDeclare, {\n at: methodOrProp\n });\n }\n }\n\n parseExpressionStatement(node, expr, decorators) {\n const decl = expr.type === \"Identifier\" ?\n this.tsParseExpressionStatement(node, expr, decorators) : undefined;\n return decl || super.parseExpressionStatement(node, expr, decorators);\n }\n\n shouldParseExportDeclaration() {\n if (this.tsIsDeclarationStart()) return true;\n return super.shouldParseExportDeclaration();\n }\n\n parseConditional(expr, startLoc, refExpressionErrors) {\n if (!this.state.maybeInArrowParameters || !this.match(17)) {\n return super.parseConditional(expr, startLoc, refExpressionErrors);\n }\n const result = this.tryParse(() => super.parseConditional(expr, startLoc));\n if (!result.node) {\n if (result.error) {\n super.setOptionalParametersError(refExpressionErrors, result.error);\n }\n return expr;\n }\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n parseParenItem(node, startLoc) {\n node = super.parseParenItem(node, startLoc);\n if (this.eat(17)) {\n node.optional = true;\n this.resetEndLocation(node);\n }\n if (this.match(14)) {\n const typeCastNode = this.startNodeAt(startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();\n return this.finishNode(typeCastNode, \"TSTypeCastExpression\");\n }\n return node;\n }\n parseExportDeclaration(node) {\n if (!this.state.isAmbientContext && this.isContextual(123)) {\n return this.tsInAmbientContext(() => this.parseExportDeclaration(node));\n }\n\n const startLoc = this.state.startLoc;\n const isDeclare = this.eatContextual(123);\n if (isDeclare && (this.isContextual(123) || !this.shouldParseExportDeclaration())) {\n throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, {\n at: this.state.startLoc\n });\n }\n const isIdentifier = tokenIsIdentifier(this.state.type);\n const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node);\n if (!declaration) return null;\n if (declaration.type === \"TSInterfaceDeclaration\" || declaration.type === \"TSTypeAliasDeclaration\" || isDeclare) {\n node.exportKind = \"type\";\n }\n if (isDeclare) {\n this.resetStartLocation(declaration, startLoc);\n declaration.declare = true;\n }\n return declaration;\n }\n parseClassId(node, isStatement, optionalId,\n bindingType) {\n if ((!isStatement || optionalId) && this.isContextual(111)) {\n return;\n }\n super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS);\n const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));\n if (typeParameters) node.typeParameters = typeParameters;\n }\n parseClassPropertyAnnotation(node) {\n if (!node.optional && this.eat(35)) {\n node.definite = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n }\n parseClassProperty(node) {\n this.parseClassPropertyAnnotation(node);\n if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) {\n this.raise(TSErrors.DeclareClassFieldHasInitializer, {\n at: this.state.startLoc\n });\n }\n if (node.abstract && this.match(29)) {\n const {\n key\n } = node;\n this.raise(TSErrors.AbstractPropertyHasInitializer, {\n at: this.state.startLoc,\n propertyName: key.type === \"Identifier\" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`\n });\n }\n return super.parseClassProperty(node);\n }\n parseClassPrivateProperty(node) {\n if (node.abstract) {\n this.raise(TSErrors.PrivateElementHasAbstract, {\n at: node\n });\n }\n\n if (node.accessibility) {\n this.raise(TSErrors.PrivateElementHasAccessibility, {\n at: node,\n modifier: node.accessibility\n });\n }\n this.parseClassPropertyAnnotation(node);\n return super.parseClassPrivateProperty(node);\n }\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters && isConstructor) {\n this.raise(TSErrors.ConstructorHasTypeParameters, {\n at: typeParameters\n });\n }\n\n const {\n declare = false,\n kind\n } = method;\n if (declare && (kind === \"get\" || kind === \"set\")) {\n this.raise(TSErrors.DeclareAccessor, {\n at: method,\n kind\n });\n }\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);\n }\n pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n declareClassPrivateMethodInScope(node, kind) {\n if (node.type === \"TSDeclareMethod\") return;\n if (node.type === \"MethodDefinition\" && !node.value.body) return;\n super.declareClassPrivateMethodInScope(node, kind);\n }\n parseClassSuper(node) {\n super.parseClassSuper(node);\n if (node.superClass && (this.match(47) || this.match(51))) {\n node.superTypeParameters = this.tsParseTypeArgumentsInExpression();\n }\n if (this.eatContextual(111)) {\n node.implements = this.tsParseHeritageClause(\"implements\");\n }\n }\n parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) prop.typeParameters = typeParameters;\n return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);\n }\n parseFunctionParams(node, allowModifiers) {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n super.parseFunctionParams(node, allowModifiers);\n }\n\n parseVarId(decl, kind) {\n super.parseVarId(decl, kind);\n if (decl.id.type === \"Identifier\" && !this.hasPrecedingLineBreak() && this.eat(35)) {\n decl.definite = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) {\n decl.id.typeAnnotation = type;\n this.resetEndLocation(decl.id);\n }\n }\n\n parseAsyncArrowFromCallExpression(node, call) {\n if (this.match(14)) {\n node.returnType = this.tsParseTypeAnnotation();\n }\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n parseMaybeAssign(refExpressionErrors, afterLeftParse) {\n var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3;\n\n let state;\n let jsx;\n let typeCast;\n if (this.hasPlugin(\"jsx\") && (this.match(140) || this.match(47))) {\n state = this.state.clone();\n jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);\n\n if (!jsx.error) return jsx.node;\n\n const {\n context\n } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === types.j_oTag || currentContext === types.j_expr) {\n context.pop();\n }\n }\n if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) {\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n if (!state || state === this.state) state = this.state.clone();\n let typeParameters;\n const arrow = this.tryParse(abort => {\n var _expr$extra, _typeParameters;\n typeParameters = this.tsParseTypeParameters();\n const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n if (expr.type !== \"ArrowFunctionExpression\" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {\n abort();\n }\n\n if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {\n this.resetStartLocationFromNode(expr, typeParameters);\n }\n expr.typeParameters = typeParameters;\n return expr;\n }, state);\n\n if (!arrow.error && !arrow.aborted) {\n if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);\n return arrow.node;\n }\n if (!jsx) {\n assert(!this.hasPlugin(\"jsx\"));\n\n typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);\n if (!typeCast.error) return typeCast.node;\n }\n if ((_jsx2 = jsx) != null && _jsx2.node) {\n this.state = jsx.failState;\n return jsx.node;\n }\n if (arrow.node) {\n this.state = arrow.failState;\n if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);\n return arrow.node;\n }\n if ((_typeCast = typeCast) != null && _typeCast.node) {\n this.state = typeCast.failState;\n return typeCast.node;\n }\n if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n if ((_typeCast2 = typeCast) != null && _typeCast2.thrown) throw typeCast.error;\n throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error);\n }\n reportReservedArrowTypeParam(node) {\n var _node$extra;\n if (node.params.length === 1 && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption(\"typescript\", \"disallowAmbiguousJSXLike\")) {\n this.raise(TSErrors.ReservedArrowTypeParam, {\n at: node\n });\n }\n }\n\n parseMaybeUnary(refExpressionErrors, sawUnary) {\n if (!this.hasPlugin(\"jsx\") && this.match(47)) {\n return this.tsParseTypeAssertion();\n } else {\n return super.parseMaybeUnary(refExpressionErrors, sawUnary);\n }\n }\n parseArrow(node) {\n if (this.match(14)) {\n\n const result = this.tryParse(abort => {\n const returnType = this.tsParseTypeOrTypePredicateAnnotation(14);\n if (this.canInsertSemicolon() || !this.match(19)) abort();\n return returnType;\n });\n if (result.aborted) return;\n if (!result.thrown) {\n if (result.error) this.state = result.failState;\n node.returnType = result.node;\n }\n }\n return super.parseArrow(node);\n }\n\n parseAssignableListItemTypes(param) {\n if (this.eat(17)) {\n if (param.type !== \"Identifier\" && !this.state.isAmbientContext && !this.state.inType) {\n this.raise(TSErrors.PatternIsOptional, {\n at: param\n });\n }\n param.optional = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) param.typeAnnotation = type;\n this.resetEndLocation(param);\n return param;\n }\n isAssignable(node, isBinding) {\n switch (node.type) {\n case \"TSTypeCastExpression\":\n return this.isAssignable(node.expression, isBinding);\n case \"TSParameterProperty\":\n return true;\n default:\n return super.isAssignable(node, isBinding);\n }\n }\n toAssignable(node, isLHS = false) {\n switch (node.type) {\n case \"ParenthesizedExpression\":\n this.toAssignableParenthesizedExpression(node, isLHS);\n break;\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n if (isLHS) {\n this.expressionScope.recordArrowParemeterBindingError(TSErrors.UnexpectedTypeCastInParameter, {\n at: node\n });\n } else {\n this.raise(TSErrors.UnexpectedTypeCastInParameter, {\n at: node\n });\n }\n this.toAssignable(node.expression, isLHS);\n break;\n case \"AssignmentExpression\":\n if (!isLHS && node.left.type === \"TSTypeCastExpression\") {\n node.left = this.typeCastToParameter(node.left);\n }\n default:\n super.toAssignable(node, isLHS);\n }\n }\n toAssignableParenthesizedExpression(node, isLHS) {\n switch (node.expression.type) {\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isLHS);\n break;\n default:\n super.toAssignable(node, isLHS);\n }\n }\n checkToRestConversion(node, allowPattern) {\n switch (node.type) {\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSTypeAssertion\":\n case \"TSNonNullExpression\":\n this.checkToRestConversion(node.expression, false);\n break;\n default:\n super.checkToRestConversion(node, allowPattern);\n }\n }\n\n isValidLVal(type, isUnparenthesizedInAssign, binding) {\n return getOwn$1({\n TSTypeCastExpression: true,\n TSParameterProperty: \"parameter\",\n TSNonNullExpression: \"expression\",\n TSAsExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && [\"expression\", true],\n TSSatisfiesExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && [\"expression\", true],\n TSTypeAssertion: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && [\"expression\", true]\n }, type) || super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n parseBindingAtom() {\n switch (this.state.type) {\n case 78:\n return this.parseIdentifier(true);\n default:\n return super.parseBindingAtom();\n }\n }\n parseMaybeDecoratorArguments(expr) {\n if (this.match(47) || this.match(51)) {\n const typeArguments = this.tsParseTypeArgumentsInExpression();\n if (this.match(10)) {\n const call = super.parseMaybeDecoratorArguments(expr);\n call.typeParameters = typeArguments;\n return call;\n }\n this.unexpected(null, 10);\n }\n return super.parseMaybeDecoratorArguments(expr);\n }\n checkCommaAfterRest(close) {\n if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) {\n this.next();\n return false;\n } else {\n return super.checkCommaAfterRest(close);\n }\n }\n\n isClassMethod() {\n return this.match(47) || super.isClassMethod();\n }\n isClassProperty() {\n return this.match(35) || this.match(14) || super.isClassProperty();\n }\n parseMaybeDefault(startLoc, left) {\n const node = super.parseMaybeDefault(startLoc, left);\n if (node.type === \"AssignmentPattern\" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {\n this.raise(TSErrors.TypeAnnotationAfterAssign, {\n at: node.typeAnnotation\n });\n }\n return node;\n }\n\n getTokenFromCode(code) {\n if (this.state.inType) {\n if (code === 62) {\n return this.finishOp(48, 1);\n }\n if (code === 60) {\n return this.finishOp(47, 1);\n }\n }\n return super.getTokenFromCode(code);\n }\n\n reScan_lt_gt() {\n const {\n type\n } = this.state;\n if (type === 47) {\n this.state.pos -= 1;\n this.readToken_lt();\n } else if (type === 48) {\n this.state.pos -= 1;\n this.readToken_gt();\n }\n }\n reScan_lt() {\n const {\n type\n } = this.state;\n if (type === 51) {\n this.state.pos -= 2;\n this.finishOp(47, 1);\n return 47;\n }\n return type;\n }\n toAssignableList(exprList, trailingCommaLoc, isLHS) {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if ((expr == null ? void 0 : expr.type) === \"TSTypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n super.toAssignableList(exprList, trailingCommaLoc, isLHS);\n }\n typeCastToParameter(node) {\n node.expression.typeAnnotation = node.typeAnnotation;\n this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);\n return node.expression;\n }\n shouldParseArrow(params) {\n if (this.match(14)) {\n return params.every(expr => this.isAssignable(expr, true));\n }\n return super.shouldParseArrow(params);\n }\n shouldParseAsyncArrow() {\n return this.match(14) || super.shouldParseAsyncArrow();\n }\n canHaveLeadingDecorator() {\n return super.canHaveLeadingDecorator() || this.isAbstractClass();\n }\n jsxParseOpeningElementAfterName(node) {\n if (this.match(47) || this.match(51)) {\n const typeArguments = this.tsTryParseAndCatch(() =>\n this.tsParseTypeArgumentsInExpression());\n if (typeArguments) node.typeParameters = typeArguments;\n }\n return super.jsxParseOpeningElementAfterName(node);\n }\n getGetterSetterExpectedParamCount(method) {\n const baseCount = super.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n const firstParam = params[0];\n const hasContextParam = firstParam && this.isThisParam(firstParam);\n return hasContextParam ? baseCount + 1 : baseCount;\n }\n parseCatchClauseParam() {\n const param = super.parseCatchClauseParam();\n const type = this.tsTryParseTypeAnnotation();\n if (type) {\n param.typeAnnotation = type;\n this.resetEndLocation(param);\n }\n return param;\n }\n tsInAmbientContext(cb) {\n const oldIsAmbientContext = this.state.isAmbientContext;\n this.state.isAmbientContext = true;\n try {\n return cb();\n } finally {\n this.state.isAmbientContext = oldIsAmbientContext;\n }\n }\n parseClass(node, isStatement, optionalId) {\n const oldInAbstractClass = this.state.inAbstractClass;\n this.state.inAbstractClass = !!node.abstract;\n try {\n return super.parseClass(node, isStatement, optionalId);\n } finally {\n this.state.inAbstractClass = oldInAbstractClass;\n }\n }\n tsParseAbstractDeclaration(node, decorators) {\n if (this.match(80)) {\n node.abstract = true;\n return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));\n } else if (this.isContextual(127)) {\n\n if (!this.hasFollowingLineBreak()) {\n node.abstract = true;\n this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, {\n at: node\n });\n return this.tsParseInterfaceDeclaration(node);\n }\n } else {\n this.unexpected(null, 80);\n }\n }\n parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {\n const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);\n if (method.abstract) {\n const hasBody = this.hasPlugin(\"estree\") ?\n !!method.value.body : !!method.body;\n if (hasBody) {\n const {\n key\n } = method;\n this.raise(TSErrors.AbstractMethodHasImplementation, {\n at: method,\n methodName: key.type === \"Identifier\" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`\n });\n }\n }\n return method;\n }\n tsParseTypeParameterName() {\n const typeName = this.parseIdentifier();\n return typeName.name;\n }\n shouldParseAsAmbientContext() {\n return !!this.getPluginOption(\"typescript\", \"dts\");\n }\n parse() {\n if (this.shouldParseAsAmbientContext()) {\n this.state.isAmbientContext = true;\n }\n return super.parse();\n }\n getExpression() {\n if (this.shouldParseAsAmbientContext()) {\n this.state.isAmbientContext = true;\n }\n return super.getExpression();\n }\n parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {\n if (!isString && isMaybeTypeOnly) {\n this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport);\n return this.finishNode(node, \"ExportSpecifier\");\n }\n node.exportKind = \"value\";\n return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly);\n }\n parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly,\n bindingType) {\n if (!importedIsString && isMaybeTypeOnly) {\n this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport);\n return this.finishNode(specifier, \"ImportSpecifier\");\n }\n specifier.importKind = \"value\";\n return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT);\n }\n parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) {\n const leftOfAsKey = isImport ? \"imported\" : \"local\";\n const rightOfAsKey = isImport ? \"local\" : \"exported\";\n let leftOfAs = node[leftOfAsKey];\n let rightOfAs;\n let hasTypeSpecifier = false;\n let canParseAsKeyword = true;\n const loc = leftOfAs.loc.start;\n\n if (this.isContextual(93)) {\n const firstAs = this.parseIdentifier();\n if (this.isContextual(93)) {\n const secondAs = this.parseIdentifier();\n if (tokenIsKeywordOrIdentifier(this.state.type)) {\n hasTypeSpecifier = true;\n leftOfAs = firstAs;\n rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();\n canParseAsKeyword = false;\n } else {\n rightOfAs = secondAs;\n canParseAsKeyword = false;\n }\n } else if (tokenIsKeywordOrIdentifier(this.state.type)) {\n canParseAsKeyword = false;\n rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();\n } else {\n hasTypeSpecifier = true;\n leftOfAs = firstAs;\n }\n } else if (tokenIsKeywordOrIdentifier(this.state.type)) {\n hasTypeSpecifier = true;\n if (isImport) {\n leftOfAs = this.parseIdentifier(true);\n if (!this.isContextual(93)) {\n this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true);\n }\n } else {\n leftOfAs = this.parseModuleExportName();\n }\n }\n if (hasTypeSpecifier && isInTypeOnlyImportExport) {\n this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, {\n at: loc\n });\n }\n node[leftOfAsKey] = leftOfAs;\n node[rightOfAsKey] = rightOfAs;\n const kindKey = isImport ? \"importKind\" : \"exportKind\";\n node[kindKey] = hasTypeSpecifier ? \"type\" : \"value\";\n if (canParseAsKeyword && this.eatContextual(93)) {\n node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName();\n }\n if (!node[rightOfAsKey]) {\n node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]);\n }\n if (isImport) {\n this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT);\n }\n }\n});\nfunction isPossiblyLiteralEnum(expression) {\n if (expression.type !== \"MemberExpression\") return false;\n const {\n computed,\n property\n } = expression;\n if (computed && property.type !== \"StringLiteral\" && (property.type !== \"TemplateLiteral\" || property.expressions.length > 0)) {\n return false;\n }\n return isUncomputedMemberExpressionChain(expression.object);\n}\nfunction isUncomputedMemberExpressionChain(expression) {\n if (expression.type === \"Identifier\") return true;\n if (expression.type !== \"MemberExpression\") return false;\n if (expression.computed) return false;\n return isUncomputedMemberExpressionChain(expression.object);\n}\n\nconst PlaceholderErrors = ParseErrorEnum`placeholders`({\n ClassNameIsRequired: \"A class name is required.\",\n UnexpectedSpace: \"Unexpected space in placeholder.\"\n});\n\nvar placeholders = (superClass => class PlaceholdersParserMixin extends superClass {\n parsePlaceholder(expectedNode) {\n if (this.match(142)) {\n const node = this.startNode();\n this.next();\n this.assertNoSpace();\n\n node.name = super.parseIdentifier(true);\n this.assertNoSpace();\n this.expect(142);\n return this.finishPlaceholder(node, expectedNode);\n }\n }\n finishPlaceholder(node, expectedNode) {\n const isFinished = !!(node.expectedNode && node.type === \"Placeholder\");\n node.expectedNode = expectedNode;\n\n return isFinished ? node : this.finishNode(node, \"Placeholder\");\n }\n\n getTokenFromCode(code) {\n if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {\n return this.finishOp(142, 2);\n }\n return super.getTokenFromCode(code);\n }\n\n parseExprAtom(refExpressionErrors) {\n return this.parsePlaceholder(\"Expression\") || super.parseExprAtom(refExpressionErrors);\n }\n parseIdentifier(liberal) {\n return this.parsePlaceholder(\"Identifier\") || super.parseIdentifier(liberal);\n }\n checkReservedWord(word, startLoc, checkKeywords, isBinding) {\n if (word !== undefined) {\n super.checkReservedWord(word, startLoc, checkKeywords, isBinding);\n }\n }\n\n parseBindingAtom() {\n return this.parsePlaceholder(\"Pattern\") || super.parseBindingAtom();\n }\n isValidLVal(type, isParenthesized, binding) {\n return type === \"Placeholder\" || super.isValidLVal(type, isParenthesized, binding);\n }\n toAssignable(node, isLHS) {\n if (node && node.type === \"Placeholder\" && node.expectedNode === \"Expression\") {\n node.expectedNode = \"Pattern\";\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n chStartsBindingIdentifier(ch, pos) {\n if (super.chStartsBindingIdentifier(ch, pos)) {\n return true;\n }\n\n const nextToken = this.lookahead();\n if (nextToken.type === 142) {\n return true;\n }\n return false;\n }\n verifyBreakContinue(node, isBreak) {\n if (node.label && node.label.type === \"Placeholder\") return;\n super.verifyBreakContinue(node, isBreak);\n }\n\n parseExpressionStatement(node, expr) {\n if (expr.type !== \"Placeholder\" || expr.extra && expr.extra.parenthesized) {\n return super.parseExpressionStatement(node, expr);\n }\n if (this.match(14)) {\n const stmt = node;\n stmt.label = this.finishPlaceholder(expr, \"Identifier\");\n this.next();\n stmt.body = super.parseStatementOrFunctionDeclaration(false);\n return this.finishNode(stmt, \"LabeledStatement\");\n }\n this.semicolon();\n node.name = expr.name;\n return this.finishPlaceholder(node, \"Statement\");\n }\n parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) {\n return this.parsePlaceholder(\"BlockStatement\") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse);\n }\n parseFunctionId(requireId) {\n return this.parsePlaceholder(\"Identifier\") || super.parseFunctionId(requireId);\n }\n parseClass(node, isStatement, optionalId) {\n const type = isStatement ? \"ClassDeclaration\" : \"ClassExpression\";\n this.next();\n const oldStrict = this.state.strict;\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (placeholder) {\n if (this.match(81) || this.match(142) || this.match(5)) {\n node.id = placeholder;\n } else if (optionalId || !isStatement) {\n node.id = null;\n node.body = this.finishPlaceholder(placeholder, \"ClassBody\");\n return this.finishNode(node, type);\n } else {\n throw this.raise(PlaceholderErrors.ClassNameIsRequired, {\n at: this.state.startLoc\n });\n }\n } else {\n this.parseClassId(node, isStatement, optionalId);\n }\n super.parseClassSuper(node);\n node.body = this.parsePlaceholder(\"ClassBody\") || super.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, type);\n }\n parseExport(node, decorators) {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseExport(node, decorators);\n if (!this.isContextual(97) && !this.match(12)) {\n node.specifiers = [];\n node.source = null;\n node.declaration = this.finishPlaceholder(placeholder, \"Declaration\");\n return this.finishNode(node, \"ExportNamedDeclaration\");\n }\n\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = placeholder;\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n return super.parseExport(node, decorators);\n }\n isExportDefaultSpecifier() {\n if (this.match(65)) {\n const next = this.nextTokenStart();\n if (this.isUnparsedContextual(next, \"from\")) {\n if (this.input.startsWith(tokenLabelName(142), this.nextTokenStartSince(next + 4))) {\n return true;\n }\n }\n }\n return super.isExportDefaultSpecifier();\n }\n maybeParseExportDefaultSpecifier(node) {\n if (node.specifiers && node.specifiers.length > 0) {\n return true;\n }\n return super.maybeParseExportDefaultSpecifier(node);\n }\n checkExport(node) {\n const {\n specifiers\n } = node;\n if (specifiers != null && specifiers.length) {\n node.specifiers = specifiers.filter(\n node => node.exported.type === \"Placeholder\");\n }\n super.checkExport(node);\n node.specifiers = specifiers;\n }\n parseImport(node) {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseImport(node);\n node.specifiers = [];\n if (!this.isContextual(97) && !this.match(12)) {\n node.source = this.finishPlaceholder(placeholder, \"StringLiteral\");\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n const specifier = this.startNodeAtNode(placeholder);\n specifier.local = placeholder;\n node.specifiers.push(this.finishNode(specifier, \"ImportDefaultSpecifier\"));\n if (this.eat(12)) {\n const hasStarImport = this.maybeParseStarImportSpecifier(node);\n\n if (!hasStarImport) this.parseNamedImportSpecifiers(node);\n }\n this.expectContextual(97);\n node.source = this.parseImportSource();\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n parseImportSource() {\n\n return this.parsePlaceholder(\"StringLiteral\") || super.parseImportSource();\n }\n\n assertNoSpace() {\n if (this.state.start > this.state.lastTokEndLoc.index) {\n this.raise(PlaceholderErrors.UnexpectedSpace, {\n at: this.state.lastTokEndLoc\n });\n }\n }\n});\n\nvar v8intrinsic = (superClass => class V8IntrinsicMixin extends superClass {\n parseV8Intrinsic() {\n if (this.match(54)) {\n const v8IntrinsicStartLoc = this.state.startLoc;\n const node = this.startNode();\n this.next();\n if (tokenIsIdentifier(this.state.type)) {\n const name = this.parseIdentifierName();\n const identifier = this.createIdentifier(node, name);\n identifier.type = \"V8IntrinsicIdentifier\";\n if (this.match(10)) {\n return identifier;\n }\n }\n this.unexpected(v8IntrinsicStartLoc);\n }\n }\n\n parseExprAtom(refExpressionErrors) {\n return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors);\n }\n});\n\nfunction hasPlugin(plugins, expectedConfig) {\n const [expectedName, expectedOptions] = typeof expectedConfig === \"string\" ? [expectedConfig, {}] : expectedConfig;\n const expectedKeys = Object.keys(expectedOptions);\n const expectedOptionsIsEmpty = expectedKeys.length === 0;\n return plugins.some(p => {\n if (typeof p === \"string\") {\n return expectedOptionsIsEmpty && p === expectedName;\n } else {\n const [pluginName, pluginOptions] = p;\n if (pluginName !== expectedName) {\n return false;\n }\n for (const key of expectedKeys) {\n if (pluginOptions[key] !== expectedOptions[key]) {\n return false;\n }\n }\n return true;\n }\n });\n}\nfunction getPluginOption(plugins, name, option) {\n const plugin = plugins.find(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n if (plugin && Array.isArray(plugin) && plugin.length > 1) {\n return plugin[1][option];\n }\n return null;\n}\nconst PIPELINE_PROPOSALS = [\"minimal\", \"fsharp\", \"hack\", \"smart\"];\nconst TOPIC_TOKENS = [\"^^\", \"@@\", \"^\", \"%\", \"#\"];\nconst RECORD_AND_TUPLE_SYNTAX_TYPES = [\"hash\", \"bar\"];\nfunction validatePlugins(plugins) {\n if (hasPlugin(plugins, \"decorators\")) {\n if (hasPlugin(plugins, \"decorators-legacy\")) {\n throw new Error(\"Cannot use the decorators and decorators-legacy plugin together\");\n }\n const decoratorsBeforeExport = getPluginOption(plugins, \"decorators\", \"decoratorsBeforeExport\");\n if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n const allowCallParenthesized = getPluginOption(plugins, \"decorators\", \"allowCallParenthesized\");\n if (allowCallParenthesized != null && typeof allowCallParenthesized !== \"boolean\") {\n throw new Error(\"'allowCallParenthesized' must be a boolean.\");\n }\n }\n if (hasPlugin(plugins, \"flow\") && hasPlugin(plugins, \"typescript\")) {\n throw new Error(\"Cannot combine flow and typescript plugins.\");\n }\n if (hasPlugin(plugins, \"placeholders\") && hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine placeholders and v8intrinsic plugins.\");\n }\n if (hasPlugin(plugins, \"pipelineOperator\")) {\n const proposal = getPluginOption(plugins, \"pipelineOperator\", \"proposal\");\n if (!PIPELINE_PROPOSALS.includes(proposal)) {\n const proposalList = PIPELINE_PROPOSALS.map(p => `\"${p}\"`).join(\", \");\n throw new Error(`\"pipelineOperator\" requires \"proposal\" option whose value must be one of: ${proposalList}.`);\n }\n const tupleSyntaxIsHash = hasPlugin(plugins, [\"recordAndTuple\", {\n syntaxType: \"hash\"\n }]);\n if (proposal === \"hack\") {\n if (hasPlugin(plugins, \"placeholders\")) {\n throw new Error(\"Cannot combine placeholders plugin and Hack-style pipes.\");\n }\n if (hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine v8intrinsic plugin and Hack-style pipes.\");\n }\n const topicToken = getPluginOption(plugins, \"pipelineOperator\", \"topicToken\");\n if (!TOPIC_TOKENS.includes(topicToken)) {\n const tokenList = TOPIC_TOKENS.map(t => `\"${t}\"`).join(\", \");\n throw new Error(`\"pipelineOperator\" in \"proposal\": \"hack\" mode also requires a \"topicToken\" option whose value must be one of: ${tokenList}.`);\n }\n if (topicToken === \"#\" && tupleSyntaxIsHash) {\n throw new Error('Plugin conflict between `[\"pipelineOperator\", { proposal: \"hack\", topicToken: \"#\" }]` and `[\"recordAndtuple\", { syntaxType: \"hash\"}]`.');\n }\n } else if (proposal === \"smart\" && tupleSyntaxIsHash) {\n throw new Error('Plugin conflict between `[\"pipelineOperator\", { proposal: \"smart\" }]` and `[\"recordAndtuple\", { syntaxType: \"hash\"}]`.');\n }\n }\n if (hasPlugin(plugins, \"moduleAttributes\")) {\n {\n if (hasPlugin(plugins, \"importAssertions\")) {\n throw new Error(\"Cannot combine importAssertions and moduleAttributes plugins.\");\n }\n const moduleAttributesVersionPluginOption = getPluginOption(plugins, \"moduleAttributes\", \"version\");\n if (moduleAttributesVersionPluginOption !== \"may-2020\") {\n throw new Error(\"The 'moduleAttributes' plugin requires a 'version' option,\" + \" representing the last proposal update. Currently, the\" + \" only supported value is 'may-2020'.\");\n }\n }\n }\n if (hasPlugin(plugins, \"recordAndTuple\") && getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\") != null && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\"))) {\n throw new Error(\"The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: \" + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(\", \"));\n }\n if (hasPlugin(plugins, \"asyncDoExpressions\") && !hasPlugin(plugins, \"doExpressions\")) {\n const error = new Error(\"'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.\");\n error.missingPlugins = \"doExpressions\";\n throw error;\n }\n}\n\nconst mixinPlugins = {\n estree,\n jsx,\n flow,\n typescript,\n v8intrinsic,\n placeholders\n};\nconst mixinPluginNames = Object.keys(mixinPlugins);\n\nconst defaultOptions = {\n sourceType: \"script\",\n sourceFilename: undefined,\n startColumn: 0,\n startLine: 1,\n allowAwaitOutsideFunction: false,\n allowReturnOutsideFunction: false,\n allowImportExportEverywhere: false,\n allowSuperOutsideMethod: false,\n allowUndeclaredExports: false,\n plugins: [],\n strictMode: null,\n ranges: false,\n tokens: false,\n createParenthesizedExpressions: false,\n errorRecovery: false,\n attachComment: true\n};\n\nfunction getOptions(opts) {\n const options = {};\n for (const key of Object.keys(defaultOptions)) {\n options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];\n }\n return options;\n}\n\nconst getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key];\nconst unwrapParenthesizedExpression = node => {\n return node.type === \"ParenthesizedExpression\" ? unwrapParenthesizedExpression(node.expression) : node;\n};\nclass LValParser extends NodeUtils {\n\n toAssignable(node, isLHS = false) {\n var _node$extra, _node$extra3;\n let parenthesized = undefined;\n if (node.type === \"ParenthesizedExpression\" || (_node$extra = node.extra) != null && _node$extra.parenthesized) {\n parenthesized = unwrapParenthesizedExpression(node);\n if (isLHS) {\n if (parenthesized.type === \"Identifier\") {\n this.expressionScope.recordArrowParemeterBindingError(Errors.InvalidParenthesizedAssignment, {\n at: node\n });\n } else if (parenthesized.type !== \"MemberExpression\") {\n this.raise(Errors.InvalidParenthesizedAssignment, {\n at: node\n });\n }\n } else {\n this.raise(Errors.InvalidParenthesizedAssignment, {\n at: node\n });\n }\n }\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n break;\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\";\n for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {\n var _node$extra2;\n const prop = node.properties[i];\n const isLast = i === last;\n this.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n if (isLast && prop.type === \"RestElement\" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) {\n this.raise(Errors.RestTrailingComma, {\n at: node.extra.trailingCommaLoc\n });\n }\n }\n break;\n case \"ObjectProperty\":\n {\n const {\n key,\n value\n } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);\n }\n this.toAssignable(value, isLHS);\n break;\n }\n case \"SpreadElement\":\n {\n throw new Error(\"Internal @babel/parser error (this is a bug, please report it).\" + \" SpreadElement should be converted by .toAssignable's caller.\");\n }\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\";\n this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS);\n break;\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") {\n this.raise(Errors.MissingEqInAssignment, {\n at: node.left.loc.end\n });\n }\n node.type = \"AssignmentPattern\";\n delete node.operator;\n this.toAssignable(node.left, isLHS);\n break;\n case \"ParenthesizedExpression\":\n this.toAssignable(parenthesized, isLHS);\n break;\n }\n }\n\n toAssignableObjectExpressionProp(prop, isLast, isLHS) {\n if (prop.type === \"ObjectMethod\") {\n this.raise(prop.kind === \"get\" || prop.kind === \"set\" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, {\n at: prop.key\n });\n } else if (prop.type === \"SpreadElement\") {\n prop.type = \"RestElement\";\n const arg = prop.argument;\n this.checkToRestConversion(arg, false);\n this.toAssignable(arg, isLHS);\n if (!isLast) {\n this.raise(Errors.RestTrailingComma, {\n at: prop\n });\n }\n } else {\n this.toAssignable(prop, isLHS);\n }\n }\n\n toAssignableList(exprList, trailingCommaLoc, isLHS) {\n const end = exprList.length - 1;\n for (let i = 0; i <= end; i++) {\n const elt = exprList[i];\n if (!elt) continue;\n if (elt.type === \"SpreadElement\") {\n elt.type = \"RestElement\";\n const arg = elt.argument;\n this.checkToRestConversion(arg, true);\n this.toAssignable(arg, isLHS);\n } else {\n this.toAssignable(elt, isLHS);\n }\n if (elt.type === \"RestElement\") {\n if (i < end) {\n this.raise(Errors.RestTrailingComma, {\n at: elt\n });\n } else if (trailingCommaLoc) {\n this.raise(Errors.RestTrailingComma, {\n at: trailingCommaLoc\n });\n }\n }\n }\n }\n isAssignable(node, isBinding) {\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n return true;\n case \"ObjectExpression\":\n {\n const last = node.properties.length - 1;\n return node.properties.every((prop, i) => {\n return prop.type !== \"ObjectMethod\" && (i === last || prop.type !== \"SpreadElement\") && this.isAssignable(prop);\n });\n }\n case \"ObjectProperty\":\n return this.isAssignable(node.value);\n case \"SpreadElement\":\n return this.isAssignable(node.argument);\n case \"ArrayExpression\":\n return node.elements.every(element => element === null || this.isAssignable(element));\n case \"AssignmentExpression\":\n return node.operator === \"=\";\n case \"ParenthesizedExpression\":\n return this.isAssignable(node.expression);\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n return !isBinding;\n default:\n return false;\n }\n }\n\n toReferencedList(exprList,\n isParenthesizedExpr) {\n return exprList;\n }\n toReferencedListDeep(exprList, isParenthesizedExpr) {\n this.toReferencedList(exprList, isParenthesizedExpr);\n for (const expr of exprList) {\n if ((expr == null ? void 0 : expr.type) === \"ArrayExpression\") {\n this.toReferencedListDeep(expr.elements);\n }\n }\n }\n\n parseSpread(refExpressionErrors) {\n const node = this.startNode();\n this.next();\n node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined);\n return this.finishNode(node, \"SpreadElement\");\n }\n\n parseRestBinding() {\n const node = this.startNode();\n this.next();\n node.argument = this.parseBindingAtom();\n return this.finishNode(node, \"RestElement\");\n }\n\n parseBindingAtom() {\n switch (this.state.type) {\n case 0:\n {\n const node = this.startNode();\n this.next();\n node.elements = this.parseBindingList(3, 93, true);\n return this.finishNode(node, \"ArrayPattern\");\n }\n case 5:\n return this.parseObjectLike(8, true);\n }\n\n return this.parseIdentifier();\n }\n\n parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {\n const elts = [];\n let first = true;\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n }\n if (allowEmpty && this.match(12)) {\n elts.push(null);\n } else if (this.eat(close)) {\n break;\n } else if (this.match(21)) {\n elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));\n if (!this.checkCommaAfterRest(closeCharCode)) {\n this.expect(close);\n break;\n }\n } else {\n const decorators = [];\n if (this.match(26) && this.hasPlugin(\"decorators\")) {\n this.raise(Errors.UnsupportedParameterDecorator, {\n at: this.state.startLoc\n });\n }\n while (this.match(26)) {\n decorators.push(this.parseDecorator());\n }\n elts.push(this.parseAssignableListItem(allowModifiers, decorators));\n }\n }\n return elts;\n }\n\n parseBindingRestProperty(prop) {\n this.next();\n prop.argument = this.parseIdentifier();\n this.checkCommaAfterRest(125);\n return this.finishNode(prop, \"RestElement\");\n }\n\n parseBindingProperty() {\n const prop = this.startNode();\n const {\n type,\n startLoc\n } = this.state;\n if (type === 21) {\n return this.parseBindingRestProperty(prop);\n } else if (type === 136) {\n this.expectPlugin(\"destructuringPrivate\", startLoc);\n this.classScope.usePrivateName(this.state.value, startLoc);\n prop.key = this.parsePrivateName();\n } else {\n this.parsePropertyName(prop);\n }\n prop.method = false;\n return this.parseObjPropValue(prop, startLoc, false, false, true, false);\n }\n\n parseAssignableListItem(allowModifiers, decorators) {\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left);\n const elt = this.parseMaybeDefault(left.loc.start, left);\n if (decorators.length) {\n left.decorators = decorators;\n }\n return elt;\n }\n\n parseAssignableListItemTypes(param) {\n return param;\n }\n\n parseMaybeDefault(startLoc, left) {\n var _startLoc, _left;\n (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;\n left = (_left = left) != null ? _left : this.parseBindingAtom();\n if (!this.eat(29)) return left;\n const node = this.startNodeAt(startLoc);\n node.left = left;\n node.right = this.parseMaybeAssignAllowIn();\n return this.finishNode(node, \"AssignmentPattern\");\n }\n isValidLVal(type,\n isUnparenthesizedInAssign,\n binding) {\n return getOwn({\n AssignmentPattern: \"left\",\n RestElement: \"argument\",\n ObjectProperty: \"value\",\n ParenthesizedExpression: \"expression\",\n ArrayPattern: \"elements\",\n ObjectPattern: \"properties\"\n },\n type);\n }\n\n checkLVal(expression, {\n in: ancestor,\n binding = BIND_NONE,\n checkClashes = false,\n strictModeChanged = false,\n allowingSloppyLetBinding = !(binding & BIND_SCOPE_LEXICAL),\n hasParenthesizedAncestor = false\n }) {\n var _expression$extra;\n const type = expression.type;\n\n if (this.isObjectMethod(expression)) return;\n if (type === \"MemberExpression\") {\n if (binding !== BIND_NONE) {\n this.raise(Errors.InvalidPropertyBindingPattern, {\n at: expression\n });\n }\n return;\n }\n if (expression.type === \"Identifier\") {\n this.checkIdentifier(expression, binding, strictModeChanged, allowingSloppyLetBinding);\n const {\n name\n } = expression;\n if (checkClashes) {\n if (checkClashes.has(name)) {\n this.raise(Errors.ParamDupe, {\n at: expression\n });\n } else {\n checkClashes.add(name);\n }\n }\n return;\n }\n const validity = this.isValidLVal(expression.type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === \"AssignmentExpression\", binding);\n if (validity === true) return;\n if (validity === false) {\n const ParseErrorClass = binding === BIND_NONE ? Errors.InvalidLhs : Errors.InvalidLhsBinding;\n this.raise(ParseErrorClass, {\n at: expression,\n ancestor: ancestor.type === \"UpdateExpression\" ? {\n type: \"UpdateExpression\",\n prefix: ancestor.prefix\n } : {\n type: ancestor.type\n }\n });\n return;\n }\n const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === \"ParenthesizedExpression\"];\n const nextAncestor = expression.type === \"ArrayPattern\" || expression.type === \"ObjectPattern\" || expression.type === \"ParenthesizedExpression\" ? expression : ancestor;\n\n for (const child of [].concat(expression[key])) {\n if (child) {\n this.checkLVal(child, {\n in: nextAncestor,\n binding,\n checkClashes,\n allowingSloppyLetBinding,\n strictModeChanged,\n hasParenthesizedAncestor: isParenthesizedExpression\n });\n }\n }\n }\n checkIdentifier(at, bindingType, strictModeChanged = false, allowLetBinding = !(bindingType & BIND_SCOPE_LEXICAL)) {\n if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) {\n if (bindingType === BIND_NONE) {\n this.raise(Errors.StrictEvalArguments, {\n at,\n referenceName: at.name\n });\n } else {\n this.raise(Errors.StrictEvalArgumentsBinding, {\n at,\n bindingName: at.name\n });\n }\n }\n if (!allowLetBinding && at.name === \"let\") {\n this.raise(Errors.LetInLexicalBinding, {\n at\n });\n }\n if (!(bindingType & BIND_NONE)) {\n this.declareNameFromIdentifier(at, bindingType);\n }\n }\n declareNameFromIdentifier(identifier, binding) {\n this.scope.declareName(identifier.name, binding, identifier.loc.start);\n }\n checkToRestConversion(node, allowPattern) {\n switch (node.type) {\n case \"ParenthesizedExpression\":\n this.checkToRestConversion(node.expression, allowPattern);\n break;\n case \"Identifier\":\n case \"MemberExpression\":\n break;\n case \"ArrayExpression\":\n case \"ObjectExpression\":\n if (allowPattern) break;\n default:\n this.raise(Errors.InvalidRestAssignmentPattern, {\n at: node\n });\n }\n }\n checkCommaAfterRest(close) {\n if (!this.match(12)) {\n return false;\n }\n this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, {\n at: this.state.startLoc\n });\n return true;\n }\n}\n\nclass ExpressionParser extends LValParser {\n\n checkProto(prop, isRecord, protoRef, refExpressionErrors) {\n if (prop.type === \"SpreadElement\" || this.isObjectMethod(prop) || prop.computed ||\n prop.shorthand) {\n return;\n }\n const key = prop.key;\n const name = key.type === \"Identifier\" ? key.name : key.value;\n if (name === \"__proto__\") {\n if (isRecord) {\n this.raise(Errors.RecordNoProto, {\n at: key\n });\n return;\n }\n if (protoRef.used) {\n if (refExpressionErrors) {\n if (refExpressionErrors.doubleProtoLoc === null) {\n refExpressionErrors.doubleProtoLoc = key.loc.start;\n }\n } else {\n this.raise(Errors.DuplicateProto, {\n at: key\n });\n }\n }\n protoRef.used = true;\n }\n }\n shouldExitDescending(expr, potentialArrowAt) {\n return expr.type === \"ArrowFunctionExpression\" && expr.start === potentialArrowAt;\n }\n\n getExpression() {\n this.enterInitialScopes();\n this.nextToken();\n const expr = this.parseExpression();\n if (!this.match(137)) {\n this.unexpected();\n }\n this.finalizeRemainingComments();\n expr.comments = this.state.comments;\n expr.errors = this.state.errors;\n if (this.options.tokens) {\n expr.tokens = this.tokens;\n }\n return expr;\n }\n\n parseExpression(disallowIn, refExpressionErrors) {\n if (disallowIn) {\n return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));\n }\n return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));\n }\n\n parseExpressionBase(refExpressionErrors) {\n const startLoc = this.state.startLoc;\n const expr = this.parseMaybeAssign(refExpressionErrors);\n if (this.match(12)) {\n const node = this.startNodeAt(startLoc);\n node.expressions = [expr];\n while (this.eat(12)) {\n node.expressions.push(this.parseMaybeAssign(refExpressionErrors));\n }\n this.toReferencedList(node.expressions);\n return this.finishNode(node, \"SequenceExpression\");\n }\n return expr;\n }\n\n parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) {\n return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));\n }\n\n parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {\n return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));\n }\n\n setOptionalParametersError(refExpressionErrors, resultError) {\n var _resultError$loc;\n refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc;\n }\n\n parseMaybeAssign(refExpressionErrors, afterLeftParse) {\n const startLoc = this.state.startLoc;\n if (this.isContextual(106)) {\n if (this.prodParam.hasYield) {\n let left = this.parseYield();\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startLoc);\n }\n return left;\n }\n }\n let ownExpressionErrors;\n if (refExpressionErrors) {\n ownExpressionErrors = false;\n } else {\n refExpressionErrors = new ExpressionErrors();\n ownExpressionErrors = true;\n }\n const {\n type\n } = this.state;\n if (type === 10 || tokenIsIdentifier(type)) {\n this.state.potentialArrowAt = this.state.start;\n }\n let left = this.parseMaybeConditional(refExpressionErrors);\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startLoc);\n }\n if (tokenIsAssignment(this.state.type)) {\n const node = this.startNodeAt(startLoc);\n const operator = this.state.value;\n node.operator = operator;\n if (this.match(29)) {\n this.toAssignable(left, true);\n node.left = left;\n const startIndex = startLoc.index;\n if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) {\n refExpressionErrors.doubleProtoLoc = null;\n }\n\n if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) {\n refExpressionErrors.shorthandAssignLoc = null;\n }\n\n if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) {\n this.checkDestructuringPrivate(refExpressionErrors);\n refExpressionErrors.privateKeyLoc = null;\n }\n } else {\n node.left = left;\n }\n this.next();\n node.right = this.parseMaybeAssign();\n this.checkLVal(left, {\n in: this.finishNode(node, \"AssignmentExpression\")\n });\n return node;\n } else if (ownExpressionErrors) {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n return left;\n }\n\n parseMaybeConditional(refExpressionErrors) {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprOps(refExpressionErrors);\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n return this.parseConditional(expr, startLoc, refExpressionErrors);\n }\n parseConditional(expr, startLoc,\n refExpressionErrors) {\n if (this.eat(17)) {\n const node = this.startNodeAt(startLoc);\n node.test = expr;\n node.consequent = this.parseMaybeAssignAllowIn();\n this.expect(14);\n node.alternate = this.parseMaybeAssign();\n return this.finishNode(node, \"ConditionalExpression\");\n }\n return expr;\n }\n parseMaybeUnaryOrPrivate(refExpressionErrors) {\n return this.match(136) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);\n }\n\n parseExprOps(refExpressionErrors) {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n return this.parseExprOp(expr, startLoc, -1);\n }\n\n parseExprOp(left, leftStartLoc, minPrec) {\n if (this.isPrivateName(left)) {\n\n const value = this.getPrivateNameSV(left);\n if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {\n this.raise(Errors.PrivateInExpectedIn, {\n at: left,\n identifierName: value\n });\n }\n this.classScope.usePrivateName(value, left.loc.start);\n }\n const op = this.state.type;\n if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) {\n let prec = tokenOperatorPrecedence(op);\n if (prec > minPrec) {\n if (op === 39) {\n this.expectPlugin(\"pipelineOperator\");\n if (this.state.inFSharpPipelineDirectBody) {\n return left;\n }\n this.checkPipelineAtInfixOperator(left, leftStartLoc);\n }\n const node = this.startNodeAt(leftStartLoc);\n node.left = left;\n node.operator = this.state.value;\n const logical = op === 41 || op === 42;\n const coalesce = op === 40;\n if (coalesce) {\n prec = tokenOperatorPrecedence(42);\n }\n this.next();\n if (op === 39 && this.hasPlugin([\"pipelineOperator\", {\n proposal: \"minimal\"\n }])) {\n if (this.state.type === 96 && this.prodParam.hasAwait) {\n throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, {\n at: this.state.startLoc\n });\n }\n }\n node.right = this.parseExprOpRightExpr(op, prec);\n const finishedNode = this.finishNode(node, logical || coalesce ? \"LogicalExpression\" : \"BinaryExpression\");\n const nextOp = this.state.type;\n if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) {\n throw this.raise(Errors.MixingCoalesceWithLogical, {\n at: this.state.startLoc\n });\n }\n return this.parseExprOp(finishedNode, leftStartLoc, minPrec);\n }\n }\n return left;\n }\n\n parseExprOpRightExpr(op, prec) {\n const startLoc = this.state.startLoc;\n switch (op) {\n case 39:\n switch (this.getPluginOption(\"pipelineOperator\", \"proposal\")) {\n case \"hack\":\n return this.withTopicBindingContext(() => {\n return this.parseHackPipeBody();\n });\n case \"smart\":\n return this.withTopicBindingContext(() => {\n if (this.prodParam.hasYield && this.isContextual(106)) {\n throw this.raise(Errors.PipeBodyIsTighter, {\n at: this.state.startLoc\n });\n }\n return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc);\n });\n case \"fsharp\":\n return this.withSoloAwaitPermittingContext(() => {\n return this.parseFSharpPipelineBody(prec);\n });\n }\n\n default:\n return this.parseExprOpBaseRightExpr(op, prec);\n }\n }\n\n parseExprOpBaseRightExpr(op, prec) {\n const startLoc = this.state.startLoc;\n return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec);\n }\n parseHackPipeBody() {\n var _body$extra;\n const {\n startLoc\n } = this.state;\n const body = this.parseMaybeAssign();\n const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(\n body.type);\n\n if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {\n this.raise(Errors.PipeUnparenthesizedBody, {\n at: startLoc,\n type: body.type\n });\n }\n if (!this.topicReferenceWasUsedInCurrentContext()) {\n this.raise(Errors.PipeTopicUnused, {\n at: startLoc\n });\n }\n return body;\n }\n checkExponentialAfterUnary(node) {\n if (this.match(57)) {\n this.raise(Errors.UnexpectedTokenUnaryExponentiation, {\n at: node.argument\n });\n }\n }\n\n parseMaybeUnary(refExpressionErrors, sawUnary) {\n const startLoc = this.state.startLoc;\n const isAwait = this.isContextual(96);\n if (isAwait && this.isAwaitAllowed()) {\n this.next();\n const expr = this.parseAwait(startLoc);\n if (!sawUnary) this.checkExponentialAfterUnary(expr);\n return expr;\n }\n const update = this.match(34);\n const node = this.startNode();\n if (tokenIsPrefix(this.state.type)) {\n node.operator = this.state.value;\n node.prefix = true;\n if (this.match(72)) {\n this.expectPlugin(\"throwExpressions\");\n }\n const isDelete = this.match(89);\n this.next();\n node.argument = this.parseMaybeUnary(null, true);\n this.checkExpressionErrors(refExpressionErrors, true);\n if (this.state.strict && isDelete) {\n const arg = node.argument;\n if (arg.type === \"Identifier\") {\n this.raise(Errors.StrictDelete, {\n at: node\n });\n } else if (this.hasPropertyAsPrivateName(arg)) {\n this.raise(Errors.DeletePrivateField, {\n at: node\n });\n }\n }\n if (!update) {\n if (!sawUnary) {\n this.checkExponentialAfterUnary(node);\n }\n return this.finishNode(node, \"UnaryExpression\");\n }\n }\n const expr = this.parseUpdate(\n node, update, refExpressionErrors);\n if (isAwait) {\n const {\n type\n } = this.state;\n const startsExpr = this.hasPlugin(\"v8intrinsic\") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);\n if (startsExpr && !this.isAmbiguousAwait()) {\n this.raiseOverwrite(Errors.AwaitNotInAsyncContext, {\n at: startLoc\n });\n return this.parseAwait(startLoc);\n }\n }\n return expr;\n }\n\n parseUpdate(node, update, refExpressionErrors) {\n if (update) {\n const updateExpressionNode = node;\n this.checkLVal(updateExpressionNode.argument, {\n in: this.finishNode(updateExpressionNode, \"UpdateExpression\")\n });\n return node;\n }\n const startLoc = this.state.startLoc;\n let expr = this.parseExprSubscripts(refExpressionErrors);\n if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;\n while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt(startLoc);\n node.operator = this.state.value;\n node.prefix = false;\n node.argument = expr;\n this.next();\n this.checkLVal(expr, {\n in: expr = this.finishNode(node, \"UpdateExpression\")\n });\n }\n return expr;\n }\n\n parseExprSubscripts(refExpressionErrors) {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprAtom(refExpressionErrors);\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n return this.parseSubscripts(expr, startLoc);\n }\n parseSubscripts(base, startLoc, noCalls) {\n const state = {\n optionalChainMember: false,\n maybeAsyncArrow: this.atPossibleAsyncArrow(base),\n stop: false\n };\n do {\n base = this.parseSubscript(base, startLoc, noCalls, state);\n\n state.maybeAsyncArrow = false;\n } while (!state.stop);\n return base;\n }\n\n parseSubscript(base, startLoc, noCalls, state) {\n const {\n type\n } = this.state;\n if (!noCalls && type === 15) {\n return this.parseBind(base, startLoc, noCalls, state);\n } else if (tokenIsTemplate(type)) {\n return this.parseTaggedTemplateExpression(base, startLoc, state);\n }\n let optional = false;\n if (type === 18) {\n if (noCalls && this.lookaheadCharCode() === 40) {\n state.stop = true;\n return base;\n }\n state.optionalChainMember = optional = true;\n this.next();\n }\n if (!noCalls && this.match(10)) {\n return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional);\n } else {\n const computed = this.eat(0);\n if (computed || optional || this.eat(16)) {\n return this.parseMember(base, startLoc, state, computed, optional);\n } else {\n state.stop = true;\n return base;\n }\n }\n }\n\n parseMember(base, startLoc, state, computed, optional) {\n const node = this.startNodeAt(startLoc);\n node.object = base;\n node.computed = computed;\n if (computed) {\n node.property = this.parseExpression();\n this.expect(3);\n } else if (this.match(136)) {\n if (base.type === \"Super\") {\n this.raise(Errors.SuperPrivateField, {\n at: startLoc\n });\n }\n this.classScope.usePrivateName(this.state.value, this.state.startLoc);\n node.property = this.parsePrivateName();\n } else {\n node.property = this.parseIdentifier(true);\n }\n if (state.optionalChainMember) {\n node.optional = optional;\n return this.finishNode(node, \"OptionalMemberExpression\");\n } else {\n return this.finishNode(node, \"MemberExpression\");\n }\n }\n\n parseBind(base, startLoc, noCalls, state) {\n const node = this.startNodeAt(startLoc);\n node.object = base;\n this.next();\n node.callee = this.parseNoCallExpr();\n state.stop = true;\n return this.parseSubscripts(this.finishNode(node, \"BindExpression\"), startLoc, noCalls);\n }\n\n parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) {\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n let refExpressionErrors = null;\n this.state.maybeInArrowParameters = true;\n this.next();\n\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n const {\n maybeAsyncArrow,\n optionalChainMember\n } = state;\n if (maybeAsyncArrow) {\n this.expressionScope.enter(newAsyncArrowScope());\n refExpressionErrors = new ExpressionErrors();\n }\n if (optionalChainMember) {\n node.optional = optional;\n }\n if (optional) {\n node.arguments = this.parseCallExpressionArguments(11);\n } else {\n node.arguments = this.parseCallExpressionArguments(11, base.type === \"Import\", base.type !== \"Super\",\n node, refExpressionErrors);\n }\n let finishedNode = this.finishCallExpression(node, optionalChainMember);\n if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {\n state.stop = true;\n this.checkDestructuringPrivate(refExpressionErrors);\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode);\n } else {\n if (maybeAsyncArrow) {\n this.checkExpressionErrors(refExpressionErrors, true);\n this.expressionScope.exit();\n }\n this.toReferencedArguments(finishedNode);\n }\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return finishedNode;\n }\n toReferencedArguments(node, isParenthesizedExpr) {\n this.toReferencedListDeep(node.arguments, isParenthesizedExpr);\n }\n\n parseTaggedTemplateExpression(base, startLoc, state) {\n const node = this.startNodeAt(startLoc);\n node.tag = base;\n node.quasi = this.parseTemplate(true);\n if (state.optionalChainMember) {\n this.raise(Errors.OptionalChainingNoTemplate, {\n at: startLoc\n });\n }\n return this.finishNode(node, \"TaggedTemplateExpression\");\n }\n atPossibleAsyncArrow(base) {\n return base.type === \"Identifier\" && base.name === \"async\" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() &&\n base.end - base.start === 5 && base.start === this.state.potentialArrowAt;\n }\n finishCallExpression(node, optional) {\n if (node.callee.type === \"Import\") {\n if (node.arguments.length === 2) {\n {\n if (!this.hasPlugin(\"moduleAttributes\")) {\n this.expectPlugin(\"importAssertions\");\n }\n }\n }\n if (node.arguments.length === 0 || node.arguments.length > 2) {\n this.raise(Errors.ImportCallArity, {\n at: node,\n maxArgumentCount: this.hasPlugin(\"importAssertions\") || this.hasPlugin(\"moduleAttributes\") ? 2 : 1\n });\n } else {\n for (const arg of node.arguments) {\n if (arg.type === \"SpreadElement\") {\n this.raise(Errors.ImportCallSpreadArgument, {\n at: arg\n });\n }\n }\n }\n }\n return this.finishNode(node, optional ? \"OptionalCallExpression\" : \"CallExpression\");\n }\n parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) {\n const elts = [];\n let first = true;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n if (this.match(close)) {\n if (dynamicImport && !this.hasPlugin(\"importAssertions\") && !this.hasPlugin(\"moduleAttributes\")) {\n this.raise(Errors.ImportCallArgumentTrailingComma, {\n at: this.state.lastTokStartLoc\n });\n }\n if (nodeForExtra) {\n this.addTrailingCommaExtraToNode(nodeForExtra);\n }\n this.next();\n break;\n }\n }\n elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder));\n }\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return elts;\n }\n shouldParseAsyncArrow() {\n return this.match(19) && !this.canInsertSemicolon();\n }\n parseAsyncArrowFromCallExpression(node, call) {\n var _call$extra;\n this.resetPreviousNodeTrailingComments(call);\n this.expect(19);\n this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc);\n if (call.innerComments) {\n setInnerComments(node, call.innerComments);\n }\n if (call.callee.trailingComments) {\n setInnerComments(node, call.callee.trailingComments);\n }\n return node;\n }\n\n parseNoCallExpr() {\n const startLoc = this.state.startLoc;\n return this.parseSubscripts(this.parseExprAtom(), startLoc, true);\n }\n\n parseExprAtom(refExpressionErrors) {\n let node;\n let decorators = null;\n const {\n type\n } = this.state;\n switch (type) {\n case 79:\n return this.parseSuper();\n case 83:\n node = this.startNode();\n this.next();\n if (this.match(16)) {\n return this.parseImportMetaProperty(node);\n }\n if (!this.match(10)) {\n this.raise(Errors.UnsupportedImport, {\n at: this.state.lastTokStartLoc\n });\n }\n return this.finishNode(node, \"Import\");\n case 78:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"ThisExpression\");\n case 90:\n {\n return this.parseDo(this.startNode(), false);\n }\n case 56:\n case 31:\n {\n this.readRegexp();\n return this.parseRegExpLiteral(this.state.value);\n }\n case 132:\n return this.parseNumericLiteral(this.state.value);\n case 133:\n return this.parseBigIntLiteral(this.state.value);\n case 134:\n return this.parseDecimalLiteral(this.state.value);\n case 131:\n return this.parseStringLiteral(this.state.value);\n case 84:\n return this.parseNullLiteral();\n case 85:\n return this.parseBooleanLiteral(true);\n case 86:\n return this.parseBooleanLiteral(false);\n case 10:\n {\n const canBeArrow = this.state.potentialArrowAt === this.state.start;\n return this.parseParenAndDistinguishExpression(canBeArrow);\n }\n case 2:\n case 1:\n {\n return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true);\n }\n case 0:\n {\n return this.parseArrayLike(3, true, false, refExpressionErrors);\n }\n case 6:\n case 7:\n {\n return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true);\n }\n case 5:\n {\n return this.parseObjectLike(8, false, false, refExpressionErrors);\n }\n case 68:\n return this.parseFunctionOrFunctionSent();\n case 26:\n decorators = this.parseDecorators();\n case 80:\n return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false);\n case 77:\n return this.parseNewOrNewTarget();\n case 25:\n case 24:\n return this.parseTemplate(false);\n\n case 15:\n {\n node = this.startNode();\n this.next();\n node.object = null;\n const callee = node.callee = this.parseNoCallExpr();\n if (callee.type === \"MemberExpression\") {\n return this.finishNode(node, \"BindExpression\");\n } else {\n throw this.raise(Errors.UnsupportedBind, {\n at: callee\n });\n }\n }\n case 136:\n {\n this.raise(Errors.PrivateInExpectedIn, {\n at: this.state.startLoc,\n identifierName: this.state.value\n });\n return this.parsePrivateName();\n }\n case 33:\n {\n return this.parseTopicReferenceThenEqualsSign(54, \"%\");\n }\n case 32:\n {\n return this.parseTopicReferenceThenEqualsSign(44, \"^\");\n }\n case 37:\n case 38:\n {\n return this.parseTopicReference(\"hack\");\n }\n case 44:\n case 54:\n case 27:\n {\n const pipeProposal = this.getPluginOption(\"pipelineOperator\", \"proposal\");\n if (pipeProposal) {\n return this.parseTopicReference(pipeProposal);\n } else {\n throw this.unexpected();\n }\n }\n case 47:\n {\n const lookaheadCh = this.input.codePointAt(this.nextTokenStart());\n if (isIdentifierStart(lookaheadCh) ||\n lookaheadCh === 62) {\n this.expectOnePlugin([\"jsx\", \"flow\", \"typescript\"]);\n break;\n } else {\n throw this.unexpected();\n }\n }\n default:\n if (tokenIsIdentifier(type)) {\n if (this.isContextual(125) && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) {\n return this.parseModuleExpression();\n }\n const canBeArrow = this.state.potentialArrowAt === this.state.start;\n const containsEsc = this.state.containsEsc;\n const id = this.parseIdentifier();\n if (!containsEsc && id.name === \"async\" && !this.canInsertSemicolon()) {\n const {\n type\n } = this.state;\n if (type === 68) {\n this.resetPreviousNodeTrailingComments(id);\n this.next();\n return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));\n } else if (tokenIsIdentifier(type)) {\n if (this.lookaheadCharCode() === 61) {\n return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));\n } else {\n return id;\n }\n } else if (type === 90) {\n this.resetPreviousNodeTrailingComments(id);\n return this.parseDo(this.startNodeAtNode(id), true);\n }\n }\n if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) {\n this.next();\n return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);\n }\n return id;\n } else {\n throw this.unexpected();\n }\n }\n }\n\n parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) {\n const pipeProposal = this.getPluginOption(\"pipelineOperator\", \"proposal\");\n if (pipeProposal) {\n this.state.type = topicTokenType;\n this.state.value = topicTokenValue;\n this.state.pos--;\n this.state.end--;\n this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);\n return this.parseTopicReference(pipeProposal);\n } else {\n throw this.unexpected();\n }\n }\n\n parseTopicReference(pipeProposal) {\n const node = this.startNode();\n const startLoc = this.state.startLoc;\n const tokenType = this.state.type;\n\n this.next();\n\n return this.finishTopicReference(node, startLoc, pipeProposal, tokenType);\n }\n\n finishTopicReference(node, startLoc, pipeProposal, tokenType) {\n if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {\n\n const nodeType = pipeProposal === \"smart\" ? \"PipelinePrimaryTopicReference\" :\n \"TopicReference\";\n if (!this.topicReferenceIsAllowedInCurrentContext()) {\n this.raise(\n pipeProposal === \"smart\" ? Errors.PrimaryTopicNotAllowed :\n Errors.PipeTopicUnbound, {\n at: startLoc\n });\n }\n\n this.registerTopicReference();\n return this.finishNode(node, nodeType);\n } else {\n throw this.raise(Errors.PipeTopicUnconfiguredToken, {\n at: startLoc,\n token: tokenLabelName(tokenType)\n });\n }\n }\n\n testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) {\n switch (pipeProposal) {\n case \"hack\":\n {\n return this.hasPlugin([\"pipelineOperator\", {\n topicToken: tokenLabelName(tokenType)\n }]);\n }\n case \"smart\":\n return tokenType === 27;\n default:\n throw this.raise(Errors.PipeTopicRequiresHackPipes, {\n at: startLoc\n });\n }\n }\n\n parseAsyncArrowUnaryFunction(node) {\n this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));\n const params = [this.parseIdentifier()];\n this.prodParam.exit();\n if (this.hasPrecedingLineBreak()) {\n this.raise(Errors.LineTerminatorBeforeArrow, {\n at: this.state.curPosition()\n });\n }\n this.expect(19);\n return this.parseArrowExpression(node, params, true);\n }\n\n parseDo(node, isAsync) {\n this.expectPlugin(\"doExpressions\");\n if (isAsync) {\n this.expectPlugin(\"asyncDoExpressions\");\n }\n node.async = isAsync;\n this.next();\n const oldLabels = this.state.labels;\n this.state.labels = [];\n if (isAsync) {\n this.prodParam.enter(PARAM_AWAIT);\n node.body = this.parseBlock();\n this.prodParam.exit();\n } else {\n node.body = this.parseBlock();\n }\n this.state.labels = oldLabels;\n return this.finishNode(node, \"DoExpression\");\n }\n\n parseSuper() {\n const node = this.startNode();\n this.next();\n if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {\n this.raise(Errors.SuperNotAllowed, {\n at: node\n });\n } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {\n this.raise(Errors.UnexpectedSuper, {\n at: node\n });\n }\n if (!this.match(10) && !this.match(0) && !this.match(16)) {\n this.raise(Errors.UnsupportedSuper, {\n at: node\n });\n }\n return this.finishNode(node, \"Super\");\n }\n parsePrivateName() {\n const node = this.startNode();\n const id = this.startNodeAt(\n createPositionWithColumnOffset(this.state.startLoc, 1));\n const name = this.state.value;\n this.next();\n node.id = this.createIdentifier(id, name);\n return this.finishNode(node, \"PrivateName\");\n }\n parseFunctionOrFunctionSent() {\n const node = this.startNode();\n\n this.next();\n\n if (this.prodParam.hasYield && this.match(16)) {\n const meta = this.createIdentifier(this.startNodeAtNode(node), \"function\");\n this.next();\n if (this.match(102)) {\n this.expectPlugin(\"functionSent\");\n } else if (!this.hasPlugin(\"functionSent\")) {\n this.unexpected();\n }\n return this.parseMetaProperty(node, meta, \"sent\");\n }\n return this.parseFunction(node);\n }\n parseMetaProperty(node, meta, propertyName) {\n node.meta = meta;\n const containsEsc = this.state.containsEsc;\n node.property = this.parseIdentifier(true);\n if (node.property.name !== propertyName || containsEsc) {\n this.raise(Errors.UnsupportedMetaProperty, {\n at: node.property,\n target: meta.name,\n onlyValidPropertyName: propertyName\n });\n }\n return this.finishNode(node, \"MetaProperty\");\n }\n\n parseImportMetaProperty(node) {\n const id = this.createIdentifier(this.startNodeAtNode(node), \"import\");\n this.next();\n\n if (this.isContextual(100)) {\n if (!this.inModule) {\n this.raise(Errors.ImportMetaOutsideModule, {\n at: id\n });\n }\n this.sawUnambiguousESM = true;\n }\n return this.parseMetaProperty(node, id, \"meta\");\n }\n parseLiteralAtNode(value, type, node) {\n this.addExtra(node, \"rawValue\", value);\n this.addExtra(node, \"raw\", this.input.slice(node.start, this.state.end));\n node.value = value;\n this.next();\n return this.finishNode(node, type);\n }\n parseLiteral(value, type) {\n const node = this.startNode();\n return this.parseLiteralAtNode(value, type, node);\n }\n parseStringLiteral(value) {\n return this.parseLiteral(value, \"StringLiteral\");\n }\n parseNumericLiteral(value) {\n return this.parseLiteral(value, \"NumericLiteral\");\n }\n parseBigIntLiteral(value) {\n return this.parseLiteral(value, \"BigIntLiteral\");\n }\n parseDecimalLiteral(value) {\n return this.parseLiteral(value, \"DecimalLiteral\");\n }\n parseRegExpLiteral(value) {\n const node = this.parseLiteral(value.value, \"RegExpLiteral\");\n node.pattern = value.pattern;\n node.flags = value.flags;\n return node;\n }\n parseBooleanLiteral(value) {\n const node = this.startNode();\n node.value = value;\n this.next();\n return this.finishNode(node, \"BooleanLiteral\");\n }\n parseNullLiteral() {\n const node = this.startNode();\n this.next();\n return this.finishNode(node, \"NullLiteral\");\n }\n\n parseParenAndDistinguishExpression(canBeArrow) {\n const startLoc = this.state.startLoc;\n let val;\n this.next();\n this.expressionScope.enter(newArrowHeadScope());\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.maybeInArrowParameters = true;\n this.state.inFSharpPipelineDirectBody = false;\n const innerStartLoc = this.state.startLoc;\n const exprList = [];\n const refExpressionErrors = new ExpressionErrors();\n let first = true;\n let spreadStartLoc;\n let optionalCommaStartLoc;\n while (!this.match(11)) {\n if (first) {\n first = false;\n } else {\n this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc);\n if (this.match(11)) {\n optionalCommaStartLoc = this.state.startLoc;\n break;\n }\n }\n if (this.match(21)) {\n const spreadNodeStartLoc = this.state.startLoc;\n spreadStartLoc = this.state.startLoc;\n exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc));\n if (!this.checkCommaAfterRest(41)) {\n break;\n }\n } else {\n exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem));\n }\n }\n const innerEndLoc = this.state.lastTokEndLoc;\n this.expect(11);\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n let arrowNode = this.startNodeAt(startLoc);\n if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {\n this.checkDestructuringPrivate(refExpressionErrors);\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n this.parseArrowExpression(arrowNode, exprList, false);\n return arrowNode;\n }\n this.expressionScope.exit();\n if (!exprList.length) {\n this.unexpected(this.state.lastTokStartLoc);\n }\n if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc);\n if (spreadStartLoc) this.unexpected(spreadStartLoc);\n this.checkExpressionErrors(refExpressionErrors, true);\n this.toReferencedListDeep(exprList, true);\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartLoc);\n val.expressions = exprList;\n this.finishNode(val, \"SequenceExpression\");\n this.resetEndLocation(val, innerEndLoc);\n } else {\n val = exprList[0];\n }\n return this.wrapParenthesis(startLoc,\n val);\n }\n wrapParenthesis(startLoc, expression) {\n if (!this.options.createParenthesizedExpressions) {\n this.addExtra(expression, \"parenthesized\", true);\n this.addExtra(expression, \"parenStart\", startLoc.index);\n this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index);\n return expression;\n }\n const parenExpression = this.startNodeAt(startLoc);\n parenExpression.expression = expression;\n return this.finishNode(parenExpression, \"ParenthesizedExpression\");\n }\n\n shouldParseArrow(params) {\n return !this.canInsertSemicolon();\n }\n parseArrow(node) {\n if (this.eat(19)) {\n return node;\n }\n }\n parseParenItem(node,\n startLoc) {\n return node;\n }\n parseNewOrNewTarget() {\n const node = this.startNode();\n this.next();\n if (this.match(16)) {\n const meta = this.createIdentifier(this.startNodeAtNode(node), \"new\");\n this.next();\n const metaProp = this.parseMetaProperty(node, meta, \"target\");\n if (!this.scope.inNonArrowFunction && !this.scope.inClass) {\n this.raise(Errors.UnexpectedNewTarget, {\n at: metaProp\n });\n }\n return metaProp;\n }\n return this.parseNew(node);\n }\n\n parseNew(node) {\n this.parseNewCallee(node);\n if (this.eat(10)) {\n const args = this.parseExprList(11);\n this.toReferencedList(args);\n node.arguments = args;\n } else {\n node.arguments = [];\n }\n return this.finishNode(node, \"NewExpression\");\n }\n parseNewCallee(node) {\n node.callee = this.parseNoCallExpr();\n if (node.callee.type === \"Import\") {\n this.raise(Errors.ImportCallNotNewExpression, {\n at: node.callee\n });\n } else if (this.isOptionalChain(node.callee)) {\n this.raise(Errors.OptionalChainingNoNew, {\n at: this.state.lastTokEndLoc\n });\n } else if (this.eat(18)) {\n this.raise(Errors.OptionalChainingNoNew, {\n at: this.state.startLoc\n });\n }\n }\n\n parseTemplateElement(isTagged) {\n const {\n start,\n startLoc,\n end,\n value\n } = this.state;\n const elemStart = start + 1;\n const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1));\n if (value === null) {\n if (!isTagged) {\n this.raise(Errors.InvalidEscapeSequenceTemplate, {\n at: createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)\n });\n }\n }\n const isTail = this.match(24);\n const endOffset = isTail ? -1 : -2;\n const elemEnd = end + endOffset;\n elem.value = {\n raw: this.input.slice(elemStart, elemEnd).replace(/\\r\\n?/g, \"\\n\"),\n cooked: value === null ? null : value.slice(1, endOffset)\n };\n elem.tail = isTail;\n this.next();\n const finishedNode = this.finishNode(elem, \"TemplateElement\");\n this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset));\n return finishedNode;\n }\n\n parseTemplate(isTagged) {\n const node = this.startNode();\n node.expressions = [];\n let curElt = this.parseTemplateElement(isTagged);\n node.quasis = [curElt];\n while (!curElt.tail) {\n node.expressions.push(this.parseTemplateSubstitution());\n this.readTemplateContinuation();\n node.quasis.push(curElt = this.parseTemplateElement(isTagged));\n }\n return this.finishNode(node, \"TemplateLiteral\");\n }\n\n parseTemplateSubstitution() {\n return this.parseExpression();\n }\n\n parseObjectLike(close, isPattern, isRecord, refExpressionErrors) {\n if (isRecord) {\n this.expectPlugin(\"recordAndTuple\");\n }\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const propHash = Object.create(null);\n let first = true;\n const node = this.startNode();\n node.properties = [];\n this.next();\n while (!this.match(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n if (this.match(close)) {\n this.addTrailingCommaExtraToNode(\n node);\n break;\n }\n }\n let prop;\n if (isPattern) {\n prop = this.parseBindingProperty();\n } else {\n prop = this.parsePropertyDefinition(refExpressionErrors);\n this.checkProto(prop, isRecord, propHash, refExpressionErrors);\n }\n if (isRecord && !this.isObjectProperty(prop) && prop.type !== \"SpreadElement\") {\n this.raise(Errors.InvalidRecordProperty, {\n at: prop\n });\n }\n\n if (prop.shorthand) {\n this.addExtra(prop, \"shorthand\", true);\n }\n\n node.properties.push(prop);\n }\n this.next();\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n let type = \"ObjectExpression\";\n if (isPattern) {\n type = \"ObjectPattern\";\n } else if (isRecord) {\n type = \"RecordExpression\";\n }\n return this.finishNode(node, type);\n }\n addTrailingCommaExtraToNode(node) {\n this.addExtra(node, \"trailingComma\", this.state.lastTokStart);\n this.addExtra(node, \"trailingCommaLoc\", this.state.lastTokStartLoc, false);\n }\n\n maybeAsyncOrAccessorProp(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && (this.isLiteralPropertyName() || this.match(0) || this.match(55));\n }\n\n parsePropertyDefinition(refExpressionErrors) {\n let decorators = [];\n if (this.match(26)) {\n if (this.hasPlugin(\"decorators\")) {\n this.raise(Errors.UnsupportedPropertyDecorator, {\n at: this.state.startLoc\n });\n }\n\n while (this.match(26)) {\n decorators.push(this.parseDecorator());\n }\n }\n const prop = this.startNode();\n let isAsync = false;\n let isAccessor = false;\n let startLoc;\n if (this.match(21)) {\n if (decorators.length) this.unexpected();\n return this.parseSpread();\n }\n if (decorators.length) {\n prop.decorators = decorators;\n decorators = [];\n }\n prop.method = false;\n if (refExpressionErrors) {\n startLoc = this.state.startLoc;\n }\n let isGenerator = this.eat(55);\n this.parsePropertyNamePrefixOperator(prop);\n const containsEsc = this.state.containsEsc;\n const key = this.parsePropertyName(prop, refExpressionErrors);\n if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {\n const keyName = key.name;\n if (keyName === \"async\" && !this.hasPrecedingLineBreak()) {\n isAsync = true;\n this.resetPreviousNodeTrailingComments(key);\n isGenerator = this.eat(55);\n this.parsePropertyName(prop);\n }\n if (keyName === \"get\" || keyName === \"set\") {\n isAccessor = true;\n this.resetPreviousNodeTrailingComments(key);\n prop.kind = keyName;\n if (this.match(55)) {\n isGenerator = true;\n this.raise(Errors.AccessorIsGenerator, {\n at: this.state.curPosition(),\n kind: keyName\n });\n this.next();\n }\n this.parsePropertyName(prop);\n }\n }\n return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors);\n }\n getGetterSetterExpectedParamCount(method) {\n return method.kind === \"get\" ? 0 : 1;\n }\n\n getObjectOrClassMethodParams(method) {\n return method.params;\n }\n\n checkGetterSetterParams(method) {\n var _params;\n const paramCount = this.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n if (params.length !== paramCount) {\n this.raise(method.kind === \"get\" ? Errors.BadGetterArity : Errors.BadSetterArity, {\n at: method\n });\n }\n if (method.kind === \"set\" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === \"RestElement\") {\n this.raise(Errors.BadSetterRestParameter, {\n at: method\n });\n }\n }\n\n parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {\n if (isAccessor) {\n const finishedProp = this.parseMethod(prop,\n isGenerator, false, false, false, \"ObjectMethod\");\n this.checkGetterSetterParams(finishedProp);\n return finishedProp;\n }\n if (isAsync || isGenerator || this.match(10)) {\n if (isPattern) this.unexpected();\n prop.kind = \"method\";\n prop.method = true;\n return this.parseMethod(prop, isGenerator, isAsync, false, false, \"ObjectMethod\");\n }\n }\n\n parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {\n prop.shorthand = false;\n if (this.eat(14)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors);\n return this.finishNode(prop, \"ObjectProperty\");\n }\n if (!prop.computed && prop.key.type === \"Identifier\") {\n this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false);\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));\n } else if (this.match(29)) {\n const shorthandAssignLoc = this.state.startLoc;\n if (refExpressionErrors != null) {\n if (refExpressionErrors.shorthandAssignLoc === null) {\n refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;\n }\n } else {\n this.raise(Errors.InvalidCoverInitializedName, {\n at: shorthandAssignLoc\n });\n }\n prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key));\n } else {\n prop.value = cloneIdentifier(prop.key);\n }\n prop.shorthand = true;\n return this.finishNode(prop, \"ObjectProperty\");\n }\n }\n parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {\n const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);\n if (!node) this.unexpected();\n return node;\n }\n\n parsePropertyName(prop, refExpressionErrors) {\n if (this.eat(0)) {\n prop.computed = true;\n prop.key = this.parseMaybeAssignAllowIn();\n this.expect(3);\n } else {\n const {\n type,\n value\n } = this.state;\n let key;\n if (tokenIsKeywordOrIdentifier(type)) {\n key = this.parseIdentifier(true);\n } else {\n switch (type) {\n case 132:\n key = this.parseNumericLiteral(value);\n break;\n case 131:\n key = this.parseStringLiteral(value);\n break;\n case 133:\n key = this.parseBigIntLiteral(value);\n break;\n case 134:\n key = this.parseDecimalLiteral(value);\n break;\n case 136:\n {\n const privateKeyLoc = this.state.startLoc;\n if (refExpressionErrors != null) {\n if (refExpressionErrors.privateKeyLoc === null) {\n refExpressionErrors.privateKeyLoc = privateKeyLoc;\n }\n } else {\n this.raise(Errors.UnexpectedPrivateField, {\n at: privateKeyLoc\n });\n }\n key = this.parsePrivateName();\n break;\n }\n default:\n throw this.unexpected();\n }\n }\n prop.key = key;\n if (type !== 136) {\n prop.computed = false;\n }\n }\n return prop.key;\n }\n\n initFunction(node, isAsync) {\n node.id = null;\n node.generator = false;\n node.async = isAsync;\n }\n\n parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {\n this.initFunction(node, isAsync);\n node.generator = isGenerator;\n const allowModifiers = isConstructor;\n this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n this.parseFunctionParams(node, allowModifiers);\n const finishedNode = this.parseFunctionBodyAndFinish(node, type, true);\n this.prodParam.exit();\n this.scope.exit();\n return finishedNode;\n }\n\n parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {\n if (isTuple) {\n this.expectPlugin(\"recordAndTuple\");\n }\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const node = this.startNode();\n this.next();\n node.elements = this.parseExprList(close, !isTuple, refExpressionErrors,\n node);\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return this.finishNode(node, isTuple ? \"TupleExpression\" : \"ArrayExpression\");\n }\n\n parseArrowExpression(node, params, isAsync, trailingCommaLoc) {\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n let flags = functionFlags(isAsync, false);\n if (!this.match(5) && this.prodParam.hasIn) {\n flags |= PARAM_IN;\n }\n this.prodParam.enter(flags);\n this.initFunction(node, isAsync);\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n if (params) {\n this.state.maybeInArrowParameters = true;\n this.setArrowFunctionParameters(node, params, trailingCommaLoc);\n }\n this.state.maybeInArrowParameters = false;\n this.parseFunctionBody(node, true);\n this.prodParam.exit();\n this.scope.exit();\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return this.finishNode(node, \"ArrowFunctionExpression\");\n }\n setArrowFunctionParameters(node, params, trailingCommaLoc) {\n this.toAssignableList(params, trailingCommaLoc, false);\n node.params = params;\n }\n parseFunctionBodyAndFinish(node, type, isMethod = false) {\n this.parseFunctionBody(node, false, isMethod);\n return this.finishNode(node, type);\n }\n\n parseFunctionBody(node, allowExpression, isMethod = false) {\n const isExpression = allowExpression && !this.match(5);\n this.expressionScope.enter(newExpressionScope());\n if (isExpression) {\n node.body = this.parseMaybeAssign();\n this.checkParams(node, false, allowExpression, false);\n } else {\n const oldStrict = this.state.strict;\n const oldLabels = this.state.labels;\n this.state.labels = [];\n\n this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);\n node.body = this.parseBlock(true, false,\n hasStrictModeDirective => {\n const nonSimple = !this.isSimpleParamList(node.params);\n if (hasStrictModeDirective && nonSimple) {\n this.raise(Errors.IllegalLanguageModeDirective, {\n at:\n (node.kind === \"method\" || node.kind === \"constructor\") &&\n !!node.key ?\n node.key.loc.end : node\n });\n }\n const strictModeChanged = !oldStrict && this.state.strict;\n\n this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);\n\n if (this.state.strict && node.id) {\n this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged);\n }\n });\n this.prodParam.exit();\n this.state.labels = oldLabels;\n }\n this.expressionScope.exit();\n }\n isSimpleParameter(node) {\n return node.type === \"Identifier\";\n }\n isSimpleParamList(params) {\n for (let i = 0, len = params.length; i < len; i++) {\n if (!this.isSimpleParameter(params[i])) return false;\n }\n return true;\n }\n checkParams(node, allowDuplicates,\n isArrowFunction, strictModeChanged = true) {\n const checkClashes = !allowDuplicates && new Set();\n const formalParameters = {\n type: \"FormalParameters\"\n };\n for (const param of node.params) {\n this.checkLVal(param, {\n in: formalParameters,\n binding: BIND_VAR,\n checkClashes,\n strictModeChanged\n });\n }\n }\n\n parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {\n const elts = [];\n let first = true;\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n if (this.match(close)) {\n if (nodeForExtra) {\n this.addTrailingCommaExtraToNode(nodeForExtra);\n }\n this.next();\n break;\n }\n }\n elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));\n }\n return elts;\n }\n parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) {\n let elt;\n if (this.match(12)) {\n if (!allowEmpty) {\n this.raise(Errors.UnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: \",\"\n });\n }\n elt = null;\n } else if (this.match(21)) {\n const spreadNodeStartLoc = this.state.startLoc;\n elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc);\n } else if (this.match(17)) {\n this.expectPlugin(\"partialApplication\");\n if (!allowPlaceholder) {\n this.raise(Errors.UnexpectedArgumentPlaceholder, {\n at: this.state.startLoc\n });\n }\n const node = this.startNode();\n this.next();\n elt = this.finishNode(node, \"ArgumentPlaceholder\");\n } else {\n elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem);\n }\n return elt;\n }\n\n parseIdentifier(liberal) {\n const node = this.startNode();\n const name = this.parseIdentifierName(liberal);\n return this.createIdentifier(node, name);\n }\n createIdentifier(node, name) {\n node.name = name;\n node.loc.identifierName = name;\n return this.finishNode(node, \"Identifier\");\n }\n parseIdentifierName(liberal) {\n let name;\n const {\n startLoc,\n type\n } = this.state;\n if (tokenIsKeywordOrIdentifier(type)) {\n name = this.state.value;\n } else {\n throw this.unexpected();\n }\n const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type);\n if (liberal) {\n if (tokenIsKeyword) {\n this.replaceToken(130);\n }\n } else {\n this.checkReservedWord(name, startLoc, tokenIsKeyword, false);\n }\n this.next();\n return name;\n }\n checkReservedWord(word, startLoc, checkKeywords, isBinding) {\n if (word.length > 10) {\n return;\n }\n if (!canBeReservedWord(word)) {\n return;\n }\n if (word === \"yield\") {\n if (this.prodParam.hasYield) {\n this.raise(Errors.YieldBindingIdentifier, {\n at: startLoc\n });\n return;\n }\n } else if (word === \"await\") {\n if (this.prodParam.hasAwait) {\n this.raise(Errors.AwaitBindingIdentifier, {\n at: startLoc\n });\n return;\n }\n if (this.scope.inStaticBlock) {\n this.raise(Errors.AwaitBindingIdentifierInStaticBlock, {\n at: startLoc\n });\n return;\n }\n this.expressionScope.recordAsyncArrowParametersError({\n at: startLoc\n });\n } else if (word === \"arguments\") {\n if (this.scope.inClassAndNotInNonArrowFunction) {\n this.raise(Errors.ArgumentsInClass, {\n at: startLoc\n });\n return;\n }\n }\n if (checkKeywords && isKeyword(word)) {\n this.raise(Errors.UnexpectedKeyword, {\n at: startLoc,\n keyword: word\n });\n return;\n }\n const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;\n if (reservedTest(word, this.inModule)) {\n this.raise(Errors.UnexpectedReservedWord, {\n at: startLoc,\n reservedWord: word\n });\n }\n }\n isAwaitAllowed() {\n if (this.prodParam.hasAwait) return true;\n if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) {\n return true;\n }\n return false;\n }\n\n parseAwait(startLoc) {\n const node = this.startNodeAt(startLoc);\n this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, {\n at: node\n });\n if (this.eat(55)) {\n this.raise(Errors.ObsoleteAwaitStar, {\n at: node\n });\n }\n if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {\n if (this.isAmbiguousAwait()) {\n this.ambiguousScriptDifferentAst = true;\n } else {\n this.sawUnambiguousESM = true;\n }\n }\n if (!this.state.soloAwait) {\n node.argument = this.parseMaybeUnary(null, true);\n }\n return this.finishNode(node, \"AwaitExpression\");\n }\n isAmbiguousAwait() {\n if (this.hasPrecedingLineBreak()) return true;\n const {\n type\n } = this.state;\n return (\n type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 101 && !this.state.containsEsc ||\n type === 135 || type === 56 ||\n this.hasPlugin(\"v8intrinsic\") && type === 54\n );\n }\n\n parseYield() {\n const node = this.startNode();\n this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, {\n at: node\n });\n this.next();\n let delegating = false;\n let argument = null;\n if (!this.hasPrecedingLineBreak()) {\n delegating = this.eat(55);\n switch (this.state.type) {\n case 13:\n case 137:\n case 8:\n case 11:\n case 3:\n case 9:\n case 14:\n case 12:\n if (!delegating) break;\n default:\n argument = this.parseMaybeAssign();\n }\n }\n node.delegate = delegating;\n node.argument = argument;\n return this.finishNode(node, \"YieldExpression\");\n }\n\n checkPipelineAtInfixOperator(left, leftStartLoc) {\n if (this.hasPlugin([\"pipelineOperator\", {\n proposal: \"smart\"\n }])) {\n if (left.type === \"SequenceExpression\") {\n this.raise(Errors.PipelineHeadSequenceExpression, {\n at: leftStartLoc\n });\n }\n }\n }\n parseSmartPipelineBodyInStyle(childExpr, startLoc) {\n if (this.isSimpleReference(childExpr)) {\n const bodyNode = this.startNodeAt(startLoc);\n bodyNode.callee = childExpr;\n return this.finishNode(bodyNode, \"PipelineBareFunction\");\n } else {\n const bodyNode = this.startNodeAt(startLoc);\n this.checkSmartPipeTopicBodyEarlyErrors(startLoc);\n bodyNode.expression = childExpr;\n return this.finishNode(bodyNode, \"PipelineTopicExpression\");\n }\n }\n isSimpleReference(expression) {\n switch (expression.type) {\n case \"MemberExpression\":\n return !expression.computed && this.isSimpleReference(expression.object);\n case \"Identifier\":\n return true;\n default:\n return false;\n }\n }\n\n checkSmartPipeTopicBodyEarlyErrors(startLoc) {\n if (this.match(19)) {\n throw this.raise(Errors.PipelineBodyNoArrow, {\n at: this.state.startLoc\n });\n }\n\n if (!this.topicReferenceWasUsedInCurrentContext()) {\n this.raise(Errors.PipelineTopicUnused, {\n at: startLoc\n });\n }\n }\n\n withTopicBindingContext(callback) {\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n maxNumOfResolvableTopics: 1,\n maxTopicIndex: null\n };\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n }\n\n withSmartMixTopicForbiddingContext(callback) {\n if (this.hasPlugin([\"pipelineOperator\", {\n proposal: \"smart\"\n }])) {\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null\n };\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n } else {\n return callback();\n }\n }\n withSoloAwaitPermittingContext(callback) {\n const outerContextSoloAwaitState = this.state.soloAwait;\n this.state.soloAwait = true;\n try {\n return callback();\n } finally {\n this.state.soloAwait = outerContextSoloAwaitState;\n }\n }\n allowInAnd(callback) {\n const flags = this.prodParam.currentFlags();\n const prodParamToSet = PARAM_IN & ~flags;\n if (prodParamToSet) {\n this.prodParam.enter(flags | PARAM_IN);\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n return callback();\n }\n disallowInAnd(callback) {\n const flags = this.prodParam.currentFlags();\n const prodParamToClear = PARAM_IN & flags;\n if (prodParamToClear) {\n this.prodParam.enter(flags & ~PARAM_IN);\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n return callback();\n }\n\n registerTopicReference() {\n this.state.topicContext.maxTopicIndex = 0;\n }\n topicReferenceIsAllowedInCurrentContext() {\n return this.state.topicContext.maxNumOfResolvableTopics >= 1;\n }\n topicReferenceWasUsedInCurrentContext() {\n return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;\n }\n parseFSharpPipelineBody(prec) {\n const startLoc = this.state.startLoc;\n this.state.potentialArrowAt = this.state.start;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = true;\n const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec);\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return ret;\n }\n\n parseModuleExpression() {\n this.expectPlugin(\"moduleBlocks\");\n const node = this.startNode();\n this.next();\n if (!this.match(5)) {\n this.unexpected(null, 5);\n }\n const program = this.startNodeAt(this.state.endLoc);\n this.next();\n\n const revertScopes = this.initializeScopes(true);\n this.enterInitialScopes();\n try {\n node.body = this.parseProgram(program, 8, \"module\");\n } finally {\n revertScopes();\n }\n return this.finishNode(node, \"ModuleExpression\");\n }\n\n parsePropertyNamePrefixOperator(\n prop) {}\n}\n\nconst loopLabel = {\n kind: \"loop\"\n },\n switchLabel = {\n kind: \"switch\"\n };\nvar ParseFunctionFlag = {\n Expression: 0,\n Declaration: 1,\n HangingDeclaration: 2,\n NullableId: 4,\n Async: 8\n};\nvar ParseStatementFlag = {\n StatementOnly: 0,\n AllowImportExport: 1,\n AllowDeclaration: 2,\n AllowFunctionDeclaration: 4,\n AllowLabeledFunction: 8\n};\nconst loneSurrogate = /[\\uD800-\\uDFFF]/u;\nconst keywordRelationalOperator = /in(?:stanceof)?/y;\n\nfunction babel7CompatTokens(tokens, input) {\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n const {\n type\n } = token;\n if (typeof type === \"number\") {\n {\n if (type === 136) {\n const {\n loc,\n start,\n value,\n end\n } = token;\n const hashEndPos = start + 1;\n const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);\n tokens.splice(i, 1, new Token({\n type: getExportedToken(27),\n value: \"#\",\n start: start,\n end: hashEndPos,\n startLoc: loc.start,\n endLoc: hashEndLoc\n }), new Token({\n type: getExportedToken(130),\n value: value,\n start: hashEndPos,\n end: end,\n startLoc: hashEndLoc,\n endLoc: loc.end\n }));\n i++;\n continue;\n }\n if (tokenIsTemplate(type)) {\n const {\n loc,\n start,\n value,\n end\n } = token;\n const backquoteEnd = start + 1;\n const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);\n let startToken;\n if (input.charCodeAt(start) === 96) {\n startToken = new Token({\n type: getExportedToken(22),\n value: \"`\",\n start: start,\n end: backquoteEnd,\n startLoc: loc.start,\n endLoc: backquoteEndLoc\n });\n } else {\n startToken = new Token({\n type: getExportedToken(8),\n value: \"}\",\n start: start,\n end: backquoteEnd,\n startLoc: loc.start,\n endLoc: backquoteEndLoc\n });\n }\n let templateValue, templateElementEnd, templateElementEndLoc, endToken;\n if (type === 24) {\n templateElementEnd = end - 1;\n templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1);\n templateValue = value === null ? null : value.slice(1, -1);\n endToken = new Token({\n type: getExportedToken(22),\n value: \"`\",\n start: templateElementEnd,\n end: end,\n startLoc: templateElementEndLoc,\n endLoc: loc.end\n });\n } else {\n templateElementEnd = end - 2;\n templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2);\n templateValue = value === null ? null : value.slice(1, -2);\n endToken = new Token({\n type: getExportedToken(23),\n value: \"${\",\n start: templateElementEnd,\n end: end,\n startLoc: templateElementEndLoc,\n endLoc: loc.end\n });\n }\n tokens.splice(i, 1, startToken, new Token({\n type: getExportedToken(20),\n value: templateValue,\n start: backquoteEnd,\n end: templateElementEnd,\n startLoc: backquoteEndLoc,\n endLoc: templateElementEndLoc\n }), endToken);\n i += 2;\n continue;\n }\n }\n token.type = getExportedToken(type);\n }\n }\n return tokens;\n}\nclass StatementParser extends ExpressionParser {\n\n parseTopLevel(file, program) {\n file.program = this.parseProgram(program);\n file.comments = this.state.comments;\n if (this.options.tokens) {\n file.tokens = babel7CompatTokens(this.tokens, this.input);\n }\n return this.finishNode(file, \"File\");\n }\n parseProgram(program, end = 137, sourceType = this.options.sourceType) {\n program.sourceType = sourceType;\n program.interpreter = this.parseInterpreterDirective();\n this.parseBlockBody(program, true, true, end);\n if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {\n for (const [localName, at] of Array.from(this.scope.undefinedExports)) {\n this.raise(Errors.ModuleExportUndefined, {\n at,\n localName\n });\n }\n }\n let finishedProgram;\n if (end === 137) {\n finishedProgram = this.finishNode(program, \"Program\");\n } else {\n finishedProgram = this.finishNodeAt(program, \"Program\", createPositionWithColumnOffset(this.state.startLoc, -1));\n }\n return finishedProgram;\n }\n\n stmtToDirective(stmt) {\n const directive = stmt;\n directive.type = \"Directive\";\n directive.value = directive.expression;\n delete directive.expression;\n const directiveLiteral = directive.value;\n const expressionValue = directiveLiteral.value;\n const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end);\n const val = directiveLiteral.value = raw.slice(1, -1);\n\n this.addExtra(directiveLiteral, \"raw\", raw);\n this.addExtra(directiveLiteral, \"rawValue\", val);\n this.addExtra(directiveLiteral, \"expressionValue\", expressionValue);\n directiveLiteral.type = \"DirectiveLiteral\";\n return directive;\n }\n parseInterpreterDirective() {\n if (!this.match(28)) {\n return null;\n }\n const node = this.startNode();\n node.value = this.state.value;\n this.next();\n return this.finishNode(node, \"InterpreterDirective\");\n }\n isLet() {\n if (!this.isContextual(99)) {\n return false;\n }\n return this.hasFollowingBindingAtom();\n }\n chStartsBindingIdentifier(ch, pos) {\n if (isIdentifierStart(ch)) {\n keywordRelationalOperator.lastIndex = pos;\n if (keywordRelationalOperator.test(this.input)) {\n const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);\n if (!isIdentifierChar(endCh) && endCh !== 92) {\n return false;\n }\n }\n return true;\n } else if (ch === 92) {\n return true;\n } else {\n return false;\n }\n }\n chStartsBindingPattern(ch) {\n return ch === 91 || ch === 123;\n }\n\n hasFollowingBindingAtom() {\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next);\n }\n\n hasFollowingBindingIdentifier() {\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n return this.chStartsBindingIdentifier(nextCh, next);\n }\n startsUsingForOf() {\n const lookahead = this.lookahead();\n if (lookahead.type === 101 && !lookahead.containsEsc) {\n return false;\n } else {\n this.expectPlugin(\"explicitResourceManagement\");\n return true;\n }\n }\n\n parseModuleItem() {\n return this.parseStatementLike(ParseStatementFlag.AllowImportExport | ParseStatementFlag.AllowDeclaration | ParseStatementFlag.AllowFunctionDeclaration | ParseStatementFlag.AllowLabeledFunction);\n }\n\n parseStatementListItem() {\n return this.parseStatementLike(ParseStatementFlag.AllowDeclaration | ParseStatementFlag.AllowFunctionDeclaration | ParseStatementFlag.AllowLabeledFunction);\n }\n parseStatementOrFunctionDeclaration(disallowLabeledFunction) {\n return this.parseStatementLike(ParseStatementFlag.AllowFunctionDeclaration | (disallowLabeledFunction ? 0 : ParseStatementFlag.AllowLabeledFunction));\n }\n\n parseStatement() {\n return this.parseStatementLike(ParseStatementFlag.StatementOnly);\n }\n\n parseStatementLike(flags) {\n let decorators = null;\n if (this.match(26)) {\n decorators = this.parseDecorators(true);\n }\n return this.parseStatementContent(flags, decorators);\n }\n parseStatementContent(flags, decorators) {\n const starttype = this.state.type;\n const node = this.startNode();\n const allowDeclaration = !!(flags & ParseStatementFlag.AllowDeclaration);\n const allowFunctionDeclaration = !!(flags & ParseStatementFlag.AllowFunctionDeclaration);\n const topLevel = flags & ParseStatementFlag.AllowImportExport;\n\n switch (starttype) {\n case 60:\n return this.parseBreakContinueStatement(node, true);\n case 63:\n return this.parseBreakContinueStatement(node, false);\n case 64:\n return this.parseDebuggerStatement(node);\n case 90:\n return this.parseDoWhileStatement(node);\n case 91:\n return this.parseForStatement(node);\n case 68:\n if (this.lookaheadCharCode() === 46) break;\n if (!allowDeclaration) {\n if (this.state.strict) {\n this.raise(Errors.StrictFunction, {\n at: this.state.startLoc\n });\n } else if (!allowFunctionDeclaration) {\n this.raise(Errors.SloppyFunction, {\n at: this.state.startLoc\n });\n }\n }\n return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration);\n case 80:\n if (!allowDeclaration) this.unexpected();\n return this.parseClass(this.maybeTakeDecorators(decorators, node), true);\n case 69:\n return this.parseIfStatement(node);\n case 70:\n return this.parseReturnStatement(node);\n case 71:\n return this.parseSwitchStatement(node);\n case 72:\n return this.parseThrowStatement(node);\n case 73:\n return this.parseTryStatement(node);\n case 105:\n if (this.hasFollowingLineBreak() || this.state.containsEsc || !this.hasFollowingBindingIdentifier()) {\n break;\n }\n this.expectPlugin(\"explicitResourceManagement\");\n if (!this.scope.inModule && this.scope.inTopLevel) {\n this.raise(Errors.UnexpectedUsingDeclaration, {\n at: this.state.startLoc\n });\n } else if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: this.state.startLoc\n });\n }\n return this.parseVarStatement(node, \"using\");\n case 99:\n {\n if (this.state.containsEsc) {\n break;\n }\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n if (nextCh !== 91) {\n if (!allowDeclaration && this.hasFollowingLineBreak()) break;\n if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) {\n break;\n }\n }\n }\n case 75:\n {\n if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: this.state.startLoc\n });\n }\n }\n case 74:\n {\n const kind = this.state.value;\n return this.parseVarStatement(node, kind);\n }\n case 92:\n return this.parseWhileStatement(node);\n case 76:\n return this.parseWithStatement(node);\n case 5:\n return this.parseBlock();\n case 13:\n return this.parseEmptyStatement(node);\n case 83:\n {\n const nextTokenCharCode = this.lookaheadCharCode();\n if (nextTokenCharCode === 40 ||\n nextTokenCharCode === 46) {\n break;\n }\n }\n case 82:\n {\n if (!this.options.allowImportExportEverywhere && !topLevel) {\n this.raise(Errors.UnexpectedImportExport, {\n at: this.state.startLoc\n });\n }\n this.next();\n\n let result;\n if (starttype === 83) {\n result = this.parseImport(node);\n if (result.type === \"ImportDeclaration\" && (!result.importKind || result.importKind === \"value\")) {\n this.sawUnambiguousESM = true;\n }\n } else {\n result = this.parseExport(node, decorators);\n if (result.type === \"ExportNamedDeclaration\" && (!result.exportKind || result.exportKind === \"value\") || result.type === \"ExportAllDeclaration\" && (!result.exportKind || result.exportKind === \"value\") || result.type === \"ExportDefaultDeclaration\") {\n this.sawUnambiguousESM = true;\n }\n }\n this.assertModuleNodeAllowed(result);\n return result;\n }\n default:\n {\n if (this.isAsyncFunction()) {\n if (!allowDeclaration) {\n this.raise(Errors.AsyncFunctionInSingleStatementContext, {\n at: this.state.startLoc\n });\n }\n this.next();\n return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration);\n }\n }\n }\n\n const maybeName = this.state.value;\n const expr = this.parseExpression();\n if (tokenIsIdentifier(starttype) && expr.type === \"Identifier\" && this.eat(14)) {\n return this.parseLabeledStatement(node, maybeName,\n expr, flags);\n } else {\n return this.parseExpressionStatement(node, expr, decorators);\n }\n }\n assertModuleNodeAllowed(node) {\n if (!this.options.allowImportExportEverywhere && !this.inModule) {\n this.raise(Errors.ImportOutsideModule, {\n at: node\n });\n }\n }\n decoratorsEnabledBeforeExport() {\n if (this.hasPlugin(\"decorators-legacy\")) return true;\n return this.hasPlugin(\"decorators\") && !!this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\");\n }\n\n maybeTakeDecorators(maybeDecorators, classNode, exportNode) {\n if (maybeDecorators) {\n classNode.decorators = maybeDecorators;\n this.resetStartLocationFromNode(classNode, maybeDecorators[0]);\n if (exportNode) this.resetStartLocationFromNode(exportNode, classNode);\n }\n return classNode;\n }\n canHaveLeadingDecorator() {\n return this.match(80);\n }\n parseDecorators(allowExport) {\n const decorators = [];\n do {\n decorators.push(this.parseDecorator());\n } while (this.match(26));\n if (this.match(82)) {\n if (!allowExport) {\n this.unexpected();\n }\n if (!this.decoratorsEnabledBeforeExport()) {\n this.raise(Errors.DecoratorExportClass, {\n at: this.state.startLoc\n });\n }\n } else if (!this.canHaveLeadingDecorator()) {\n throw this.raise(Errors.UnexpectedLeadingDecorator, {\n at: this.state.startLoc\n });\n }\n return decorators;\n }\n parseDecorator() {\n this.expectOnePlugin([\"decorators\", \"decorators-legacy\"]);\n const node = this.startNode();\n this.next();\n if (this.hasPlugin(\"decorators\")) {\n const startLoc = this.state.startLoc;\n let expr;\n if (this.match(10)) {\n const startLoc = this.state.startLoc;\n this.next();\n expr = this.parseExpression();\n this.expect(11);\n expr = this.wrapParenthesis(startLoc, expr);\n const paramsStartLoc = this.state.startLoc;\n node.expression = this.parseMaybeDecoratorArguments(expr);\n if (this.getPluginOption(\"decorators\", \"allowCallParenthesized\") === false && node.expression !== expr) {\n this.raise(Errors.DecoratorArgumentsOutsideParentheses, {\n at: paramsStartLoc\n });\n }\n } else {\n expr = this.parseIdentifier(false);\n while (this.eat(16)) {\n const node = this.startNodeAt(startLoc);\n node.object = expr;\n if (this.match(136)) {\n this.classScope.usePrivateName(this.state.value, this.state.startLoc);\n node.property = this.parsePrivateName();\n } else {\n node.property = this.parseIdentifier(true);\n }\n node.computed = false;\n expr = this.finishNode(node, \"MemberExpression\");\n }\n node.expression = this.parseMaybeDecoratorArguments(expr);\n }\n } else {\n node.expression = this.parseExprSubscripts();\n }\n return this.finishNode(node, \"Decorator\");\n }\n parseMaybeDecoratorArguments(expr) {\n if (this.eat(10)) {\n const node = this.startNodeAtNode(expr);\n node.callee = expr;\n node.arguments = this.parseCallExpressionArguments(11, false);\n this.toReferencedList(node.arguments);\n return this.finishNode(node, \"CallExpression\");\n }\n return expr;\n }\n parseBreakContinueStatement(node, isBreak) {\n this.next();\n if (this.isLineTerminator()) {\n node.label = null;\n } else {\n node.label = this.parseIdentifier();\n this.semicolon();\n }\n this.verifyBreakContinue(node, isBreak);\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\");\n }\n verifyBreakContinue(node, isBreak) {\n let i;\n for (i = 0; i < this.state.labels.length; ++i) {\n const lab = this.state.labels[i];\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) break;\n if (node.label && isBreak) break;\n }\n }\n if (i === this.state.labels.length) {\n const type = isBreak ? \"BreakStatement\" : \"ContinueStatement\";\n this.raise(Errors.IllegalBreakContinue, {\n at: node,\n type\n });\n }\n }\n parseDebuggerStatement(node) {\n this.next();\n this.semicolon();\n return this.finishNode(node, \"DebuggerStatement\");\n }\n parseHeaderExpression() {\n this.expect(10);\n const val = this.parseExpression();\n this.expect(11);\n return val;\n }\n\n parseDoWhileStatement(node) {\n this.next();\n this.state.labels.push(loopLabel);\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n this.state.labels.pop();\n this.expect(92);\n node.test = this.parseHeaderExpression();\n this.eat(13);\n return this.finishNode(node, \"DoWhileStatement\");\n }\n\n parseForStatement(node) {\n this.next();\n this.state.labels.push(loopLabel);\n let awaitAt = null;\n if (this.isAwaitAllowed() && this.eatContextual(96)) {\n awaitAt = this.state.lastTokStartLoc;\n }\n this.scope.enter(SCOPE_OTHER);\n this.expect(10);\n if (this.match(13)) {\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node, null);\n }\n const startsWithLet = this.isContextual(99);\n const startsWithUsing = this.isContextual(105) && !this.hasFollowingLineBreak();\n const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || startsWithUsing && this.hasFollowingBindingIdentifier() && this.startsUsingForOf();\n if (this.match(74) || this.match(75) || isLetOrUsing) {\n const initNode = this.startNode();\n const kind = this.state.value;\n this.next();\n this.parseVar(initNode, true, kind);\n const init = this.finishNode(initNode, \"VariableDeclaration\");\n const isForIn = this.match(58);\n if (isForIn && startsWithUsing) {\n this.raise(Errors.ForInUsing, {\n at: init\n });\n }\n if ((isForIn || this.isContextual(101)) && init.declarations.length === 1) {\n return this.parseForIn(node, init, awaitAt);\n }\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node, init);\n }\n\n const startsWithAsync = this.isContextual(95);\n const refExpressionErrors = new ExpressionErrors();\n const init = this.parseExpression(true, refExpressionErrors);\n const isForOf = this.isContextual(101);\n if (isForOf) {\n if (startsWithLet) {\n this.raise(Errors.ForOfLet, {\n at: init\n });\n }\n if (\n awaitAt === null && startsWithAsync && init.type === \"Identifier\") {\n this.raise(Errors.ForOfAsync, {\n at: init\n });\n }\n }\n if (isForOf || this.match(58)) {\n this.checkDestructuringPrivate(refExpressionErrors);\n this.toAssignable(init, true);\n const type = isForOf ? \"ForOfStatement\" : \"ForInStatement\";\n this.checkLVal(init, {\n in: {\n type\n }\n });\n return this.parseForIn(node,\n init, awaitAt);\n } else {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node, init);\n }\n\n parseFunctionStatement(node, isAsync, isHangingDeclaration) {\n this.next();\n return this.parseFunction(node, ParseFunctionFlag.Declaration | (isHangingDeclaration ? ParseFunctionFlag.HangingDeclaration : 0) | (isAsync ? ParseFunctionFlag.Async : 0));\n }\n\n parseIfStatement(node) {\n this.next();\n node.test = this.parseHeaderExpression();\n node.consequent = this.parseStatementOrFunctionDeclaration(\n true);\n node.alternate = this.eat(66) ? this.parseStatementOrFunctionDeclaration(true) : null;\n return this.finishNode(node, \"IfStatement\");\n }\n parseReturnStatement(node) {\n if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {\n this.raise(Errors.IllegalReturn, {\n at: this.state.startLoc\n });\n }\n this.next();\n\n if (this.isLineTerminator()) {\n node.argument = null;\n } else {\n node.argument = this.parseExpression();\n this.semicolon();\n }\n return this.finishNode(node, \"ReturnStatement\");\n }\n\n parseSwitchStatement(node) {\n this.next();\n node.discriminant = this.parseHeaderExpression();\n const cases = node.cases = [];\n this.expect(5);\n this.state.labels.push(switchLabel);\n this.scope.enter(SCOPE_OTHER);\n\n let cur;\n for (let sawDefault; !this.match(8);) {\n if (this.match(61) || this.match(65)) {\n const isCase = this.match(61);\n if (cur) this.finishNode(cur, \"SwitchCase\");\n cases.push(cur = this.startNode());\n cur.consequent = [];\n this.next();\n if (isCase) {\n cur.test = this.parseExpression();\n } else {\n if (sawDefault) {\n this.raise(Errors.MultipleDefaultsInSwitch, {\n at: this.state.lastTokStartLoc\n });\n }\n sawDefault = true;\n cur.test = null;\n }\n this.expect(14);\n } else {\n if (cur) {\n cur.consequent.push(this.parseStatementListItem());\n } else {\n this.unexpected();\n }\n }\n }\n this.scope.exit();\n if (cur) this.finishNode(cur, \"SwitchCase\");\n this.next();\n this.state.labels.pop();\n return this.finishNode(node, \"SwitchStatement\");\n }\n parseThrowStatement(node) {\n this.next();\n if (this.hasPrecedingLineBreak()) {\n this.raise(Errors.NewlineAfterThrow, {\n at: this.state.lastTokEndLoc\n });\n }\n node.argument = this.parseExpression();\n this.semicolon();\n return this.finishNode(node, \"ThrowStatement\");\n }\n parseCatchClauseParam() {\n const param = this.parseBindingAtom();\n const simple = param.type === \"Identifier\";\n this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0);\n this.checkLVal(param, {\n in: {\n type: \"CatchClause\"\n },\n binding: BIND_LEXICAL,\n allowingSloppyLetBinding: true\n });\n return param;\n }\n parseTryStatement(node) {\n this.next();\n node.block = this.parseBlock();\n node.handler = null;\n if (this.match(62)) {\n const clause = this.startNode();\n this.next();\n if (this.match(10)) {\n this.expect(10);\n clause.param = this.parseCatchClauseParam();\n this.expect(11);\n } else {\n clause.param = null;\n this.scope.enter(SCOPE_OTHER);\n }\n\n clause.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseBlock(false, false));\n this.scope.exit();\n node.handler = this.finishNode(clause, \"CatchClause\");\n }\n node.finalizer = this.eat(67) ? this.parseBlock() : null;\n if (!node.handler && !node.finalizer) {\n this.raise(Errors.NoCatchOrFinally, {\n at: node\n });\n }\n return this.finishNode(node, \"TryStatement\");\n }\n\n parseVarStatement(node, kind, allowMissingInitializer = false) {\n this.next();\n this.parseVar(node, false, kind, allowMissingInitializer);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\");\n }\n\n parseWhileStatement(node) {\n this.next();\n node.test = this.parseHeaderExpression();\n this.state.labels.push(loopLabel);\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n this.state.labels.pop();\n return this.finishNode(node, \"WhileStatement\");\n }\n parseWithStatement(node) {\n if (this.state.strict) {\n this.raise(Errors.StrictWith, {\n at: this.state.startLoc\n });\n }\n this.next();\n node.object = this.parseHeaderExpression();\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n return this.finishNode(node, \"WithStatement\");\n }\n parseEmptyStatement(node) {\n this.next();\n return this.finishNode(node, \"EmptyStatement\");\n }\n\n parseLabeledStatement(node, maybeName, expr, flags) {\n for (const label of this.state.labels) {\n if (label.name === maybeName) {\n this.raise(Errors.LabelRedeclaration, {\n at: expr,\n labelName: maybeName\n });\n }\n }\n const kind = tokenIsLoop(this.state.type) ? \"loop\" : this.match(71) ? \"switch\" : null;\n for (let i = this.state.labels.length - 1; i >= 0; i--) {\n const label = this.state.labels[i];\n if (label.statementStart === node.start) {\n label.statementStart = this.state.start;\n label.kind = kind;\n } else {\n break;\n }\n }\n this.state.labels.push({\n name: maybeName,\n kind: kind,\n statementStart: this.state.start\n });\n node.body = flags & ParseStatementFlag.AllowLabeledFunction ? this.parseStatementOrFunctionDeclaration(false) : this.parseStatement();\n this.state.labels.pop();\n node.label = expr;\n return this.finishNode(node, \"LabeledStatement\");\n }\n parseExpressionStatement(node, expr,\n decorators) {\n node.expression = expr;\n this.semicolon();\n return this.finishNode(node, \"ExpressionStatement\");\n }\n\n parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {\n const node = this.startNode();\n if (allowDirectives) {\n this.state.strictErrors.clear();\n }\n this.expect(5);\n if (createNewLexicalScope) {\n this.scope.enter(SCOPE_OTHER);\n }\n this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse);\n if (createNewLexicalScope) {\n this.scope.exit();\n }\n return this.finishNode(node, \"BlockStatement\");\n }\n isValidDirective(stmt) {\n return stmt.type === \"ExpressionStatement\" && stmt.expression.type === \"StringLiteral\" && !stmt.expression.extra.parenthesized;\n }\n parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {\n const body = node.body = [];\n const directives = node.directives = [];\n this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);\n }\n\n parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {\n const oldStrict = this.state.strict;\n let hasStrictModeDirective = false;\n let parsedNonDirective = false;\n while (!this.match(end)) {\n const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem();\n if (directives && !parsedNonDirective) {\n if (this.isValidDirective(stmt)) {\n const directive = this.stmtToDirective(stmt);\n directives.push(directive);\n if (!hasStrictModeDirective && directive.value.value === \"use strict\") {\n hasStrictModeDirective = true;\n this.setStrict(true);\n }\n continue;\n }\n parsedNonDirective = true;\n this.state.strictErrors.clear();\n }\n body.push(stmt);\n }\n if (afterBlockParse) {\n afterBlockParse.call(this, hasStrictModeDirective);\n }\n if (!oldStrict) {\n this.setStrict(false);\n }\n this.next();\n }\n\n parseFor(node, init) {\n node.init = init;\n this.semicolon(false);\n node.test = this.match(13) ? null : this.parseExpression();\n this.semicolon(false);\n node.update = this.match(11) ? null : this.parseExpression();\n this.expect(11);\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n this.scope.exit();\n this.state.labels.pop();\n return this.finishNode(node, \"ForStatement\");\n }\n\n parseForIn(node, init, awaitAt) {\n const isForIn = this.match(58);\n this.next();\n if (isForIn) {\n if (awaitAt !== null) this.unexpected(awaitAt);\n } else {\n node.await = awaitAt !== null;\n }\n if (init.type === \"VariableDeclaration\" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== \"var\" || init.declarations[0].id.type !== \"Identifier\")) {\n this.raise(Errors.ForInOfLoopInitializer, {\n at: init,\n type: isForIn ? \"ForInStatement\" : \"ForOfStatement\"\n });\n }\n if (init.type === \"AssignmentPattern\") {\n this.raise(Errors.InvalidLhs, {\n at: init,\n ancestor: {\n type: \"ForStatement\"\n }\n });\n }\n node.left = init;\n node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();\n this.expect(11);\n\n node.body =\n this.withSmartMixTopicForbiddingContext(() =>\n this.parseStatement());\n this.scope.exit();\n this.state.labels.pop();\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\");\n }\n\n parseVar(node, isFor, kind, allowMissingInitializer = false) {\n const declarations = node.declarations = [];\n node.kind = kind;\n for (;;) {\n const decl = this.startNode();\n this.parseVarId(decl, kind);\n decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();\n if (decl.init === null && !allowMissingInitializer) {\n if (decl.id.type !== \"Identifier\" && !(isFor && (this.match(58) || this.isContextual(101)))) {\n this.raise(Errors.DeclarationMissingInitializer, {\n at: this.state.lastTokEndLoc,\n kind: \"destructuring\"\n });\n } else if (kind === \"const\" && !(this.match(58) || this.isContextual(101))) {\n this.raise(Errors.DeclarationMissingInitializer, {\n at: this.state.lastTokEndLoc,\n kind: \"const\"\n });\n }\n }\n declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(12)) break;\n }\n return node;\n }\n parseVarId(decl, kind) {\n const id = this.parseBindingAtom();\n this.checkLVal(id, {\n in: {\n type: \"VariableDeclarator\"\n },\n binding: kind === \"var\" ? BIND_VAR : BIND_LEXICAL\n });\n decl.id = id;\n }\n\n parseAsyncFunctionExpression(node) {\n return this.parseFunction(node, ParseFunctionFlag.Async);\n }\n\n parseFunction(node, flags = ParseFunctionFlag.Expression) {\n const hangingDeclaration = flags & ParseFunctionFlag.HangingDeclaration;\n const isDeclaration = !!(flags & ParseFunctionFlag.Declaration);\n const requireId = isDeclaration && !(flags & ParseFunctionFlag.NullableId);\n const isAsync = !!(flags & ParseFunctionFlag.Async);\n this.initFunction(node, isAsync);\n if (this.match(55)) {\n if (hangingDeclaration) {\n this.raise(Errors.GeneratorInSingleStatementContext, {\n at: this.state.startLoc\n });\n }\n this.next();\n node.generator = true;\n }\n if (isDeclaration) {\n node.id = this.parseFunctionId(requireId);\n }\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = false;\n this.scope.enter(SCOPE_FUNCTION);\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n if (!isDeclaration) {\n node.id = this.parseFunctionId();\n }\n this.parseFunctionParams(node, false);\n\n this.withSmartMixTopicForbiddingContext(() => {\n this.parseFunctionBodyAndFinish(node, isDeclaration ? \"FunctionDeclaration\" : \"FunctionExpression\");\n });\n this.prodParam.exit();\n this.scope.exit();\n if (isDeclaration && !hangingDeclaration) {\n this.registerFunctionStatementId(node);\n }\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return node;\n }\n parseFunctionId(requireId) {\n return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null;\n }\n parseFunctionParams(node, allowModifiers) {\n this.expect(10);\n this.expressionScope.enter(newParameterDeclarationScope());\n node.params = this.parseBindingList(11, 41, false, allowModifiers);\n this.expressionScope.exit();\n }\n registerFunctionStatementId(node) {\n if (!node.id) return;\n\n this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.loc.start);\n }\n\n parseClass(node, isStatement, optionalId) {\n this.next();\n\n const oldStrict = this.state.strict;\n this.state.strict = true;\n this.parseClassId(node, isStatement, optionalId);\n this.parseClassSuper(node);\n node.body = this.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\");\n }\n isClassProperty() {\n return this.match(29) || this.match(13) || this.match(8);\n }\n isClassMethod() {\n return this.match(10);\n }\n isNonstaticConstructor(method) {\n return !method.computed && !method.static && (method.key.name === \"constructor\" ||\n method.key.value === \"constructor\");\n }\n\n parseClassBody(hadSuperClass, oldStrict) {\n this.classScope.enter();\n const state = {\n hadConstructor: false,\n hadSuperClass\n };\n let decorators = [];\n const classBody = this.startNode();\n classBody.body = [];\n this.expect(5);\n\n this.withSmartMixTopicForbiddingContext(() => {\n while (!this.match(8)) {\n if (this.eat(13)) {\n if (decorators.length > 0) {\n throw this.raise(Errors.DecoratorSemicolon, {\n at: this.state.lastTokEndLoc\n });\n }\n continue;\n }\n if (this.match(26)) {\n decorators.push(this.parseDecorator());\n continue;\n }\n const member = this.startNode();\n\n if (decorators.length) {\n member.decorators = decorators;\n this.resetStartLocationFromNode(member, decorators[0]);\n decorators = [];\n }\n this.parseClassMember(classBody, member, state);\n if (\n member.kind === \"constructor\" &&\n member.decorators &&\n member.decorators.length > 0) {\n this.raise(Errors.DecoratorConstructor, {\n at: member\n });\n }\n }\n });\n this.state.strict = oldStrict;\n this.next();\n\n if (decorators.length) {\n throw this.raise(Errors.TrailingDecorator, {\n at: this.state.startLoc\n });\n }\n this.classScope.exit();\n return this.finishNode(classBody, \"ClassBody\");\n }\n\n parseClassMemberFromModifier(classBody, member) {\n const key = this.parseIdentifier(true);\n\n if (this.isClassMethod()) {\n const method = member;\n\n method.kind = \"method\";\n method.computed = false;\n method.key = key;\n method.static = false;\n this.pushClassMethod(classBody, method, false, false, false, false);\n return true;\n } else if (this.isClassProperty()) {\n const prop = member;\n\n prop.computed = false;\n prop.key = key;\n prop.static = false;\n classBody.body.push(this.parseClassProperty(prop));\n return true;\n }\n this.resetPreviousNodeTrailingComments(key);\n return false;\n }\n parseClassMember(classBody, member, state) {\n const isStatic = this.isContextual(104);\n if (isStatic) {\n if (this.parseClassMemberFromModifier(classBody, member)) {\n return;\n }\n if (this.eat(5)) {\n this.parseClassStaticBlock(classBody, member);\n return;\n }\n }\n this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n parseClassMemberWithIsStatic(classBody, member, state, isStatic) {\n const publicMethod = member;\n const privateMethod = member;\n const publicProp = member;\n const privateProp = member;\n const accessorProp = member;\n const method = publicMethod;\n const publicMember = publicMethod;\n member.static = isStatic;\n this.parsePropertyNamePrefixOperator(member);\n if (this.eat(55)) {\n method.kind = \"method\";\n const isPrivateName = this.match(136);\n this.parseClassElementName(method);\n if (isPrivateName) {\n this.pushClassPrivateMethod(classBody, privateMethod, true, false);\n return;\n }\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsGenerator, {\n at: publicMethod.key\n });\n }\n this.pushClassMethod(classBody, publicMethod, true, false, false, false);\n return;\n }\n const isContextual = tokenIsIdentifier(this.state.type) && !this.state.containsEsc;\n const isPrivate = this.match(136);\n const key = this.parseClassElementName(member);\n const maybeQuestionTokenStartLoc = this.state.startLoc;\n this.parsePostMemberNameModifiers(publicMember);\n if (this.isClassMethod()) {\n method.kind = \"method\";\n if (isPrivate) {\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n return;\n }\n\n const isConstructor = this.isNonstaticConstructor(publicMethod);\n let allowsDirectSuper = false;\n if (isConstructor) {\n publicMethod.kind = \"constructor\";\n\n if (state.hadConstructor && !this.hasPlugin(\"typescript\")) {\n this.raise(Errors.DuplicateConstructor, {\n at: key\n });\n }\n if (isConstructor && this.hasPlugin(\"typescript\") && member.override) {\n this.raise(Errors.OverrideOnConstructor, {\n at: key\n });\n }\n state.hadConstructor = true;\n allowsDirectSuper = state.hadSuperClass;\n }\n this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);\n } else if (this.isClassProperty()) {\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else if (isContextual && key.name === \"async\" && !this.isLineTerminator()) {\n this.resetPreviousNodeTrailingComments(key);\n const isGenerator = this.eat(55);\n if (publicMember.optional) {\n this.unexpected(maybeQuestionTokenStartLoc);\n }\n method.kind = \"method\";\n const isPrivate = this.match(136);\n this.parseClassElementName(method);\n this.parsePostMemberNameModifiers(publicMember);\n if (isPrivate) {\n this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsAsync, {\n at: publicMethod.key\n });\n }\n this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);\n }\n } else if (isContextual && (key.name === \"get\" || key.name === \"set\") && !(this.match(55) && this.isLineTerminator())) {\n this.resetPreviousNodeTrailingComments(key);\n method.kind = key.name;\n const isPrivate = this.match(136);\n this.parseClassElementName(publicMethod);\n if (isPrivate) {\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsAccessor, {\n at: publicMethod.key\n });\n }\n this.pushClassMethod(classBody, publicMethod, false, false, false, false);\n }\n this.checkGetterSetterParams(publicMethod);\n } else if (isContextual && key.name === \"accessor\" && !this.isLineTerminator()) {\n this.expectPlugin(\"decoratorAutoAccessors\");\n this.resetPreviousNodeTrailingComments(key);\n\n const isPrivate = this.match(136);\n this.parseClassElementName(publicProp);\n this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);\n } else if (this.isLineTerminator()) {\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else {\n this.unexpected();\n }\n }\n\n parseClassElementName(member) {\n const {\n type,\n value\n } = this.state;\n if ((type === 130 || type === 131) && member.static && value === \"prototype\") {\n this.raise(Errors.StaticPrototype, {\n at: this.state.startLoc\n });\n }\n if (type === 136) {\n if (value === \"constructor\") {\n this.raise(Errors.ConstructorClassPrivateField, {\n at: this.state.startLoc\n });\n }\n const key = this.parsePrivateName();\n member.key = key;\n return key;\n }\n return this.parsePropertyName(member);\n }\n parseClassStaticBlock(classBody, member) {\n var _member$decorators;\n this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER);\n const oldLabels = this.state.labels;\n this.state.labels = [];\n this.prodParam.enter(PARAM);\n const body = member.body = [];\n this.parseBlockOrModuleBlockBody(body, undefined, false, 8);\n this.prodParam.exit();\n this.scope.exit();\n this.state.labels = oldLabels;\n classBody.body.push(this.finishNode(member, \"StaticBlock\"));\n if ((_member$decorators = member.decorators) != null && _member$decorators.length) {\n this.raise(Errors.DecoratorStaticBlock, {\n at: member\n });\n }\n }\n pushClassProperty(classBody, prop) {\n if (!prop.computed && (prop.key.name === \"constructor\" || prop.key.value === \"constructor\")) {\n this.raise(Errors.ConstructorClassField, {\n at: prop.key\n });\n }\n classBody.body.push(this.parseClassProperty(prop));\n }\n pushClassPrivateProperty(classBody, prop) {\n const node = this.parseClassPrivateProperty(prop);\n classBody.body.push(node);\n this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start);\n }\n pushClassAccessorProperty(classBody, prop, isPrivate) {\n if (!isPrivate && !prop.computed) {\n const key = prop.key;\n if (key.name === \"constructor\" || key.value === \"constructor\") {\n this.raise(Errors.ConstructorClassField, {\n at: key\n });\n }\n }\n const node = this.parseClassAccessorProperty(prop);\n classBody.body.push(node);\n if (isPrivate) {\n this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start);\n }\n }\n pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {\n classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, \"ClassMethod\", true));\n }\n pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {\n const node = this.parseMethod(method, isGenerator, isAsync, false, false, \"ClassPrivateMethod\", true);\n classBody.body.push(node);\n const kind = node.kind === \"get\" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === \"set\" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER;\n this.declareClassPrivateMethodInScope(node, kind);\n }\n declareClassPrivateMethodInScope(node, kind) {\n this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start);\n }\n\n parsePostMemberNameModifiers(\n methodOrProp) {}\n\n parseClassPrivateProperty(node) {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassPrivateProperty\");\n }\n\n parseClassProperty(node) {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassProperty\");\n }\n parseClassAccessorProperty(node) {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassAccessorProperty\");\n }\n\n parseInitializer(node) {\n this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);\n this.expressionScope.enter(newExpressionScope());\n this.prodParam.enter(PARAM);\n node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null;\n this.expressionScope.exit();\n this.prodParam.exit();\n this.scope.exit();\n }\n parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) {\n if (tokenIsIdentifier(this.state.type)) {\n node.id = this.parseIdentifier();\n if (isStatement) {\n this.declareNameFromIdentifier(node.id, bindingType);\n }\n } else {\n if (optionalId || !isStatement) {\n node.id = null;\n } else {\n throw this.raise(Errors.MissingClassName, {\n at: this.state.startLoc\n });\n }\n }\n }\n\n parseClassSuper(node) {\n node.superClass = this.eat(81) ? this.parseExprSubscripts() : null;\n }\n\n parseExport(node, decorators) {\n const hasDefault = this.maybeParseExportDefaultSpecifier(\n node);\n const parseAfterDefault = !hasDefault || this.eat(12);\n const hasStar = parseAfterDefault && this.eatExportStar(\n node);\n const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(\n node);\n const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12));\n const isFromRequired = hasDefault || hasStar;\n if (hasStar && !hasNamespace) {\n if (hasDefault) this.unexpected();\n if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, {\n at: node\n });\n }\n this.parseExportFrom(node, true);\n return this.finishNode(node, \"ExportAllDeclaration\");\n }\n const hasSpecifiers = this.maybeParseExportNamedSpecifiers(\n node);\n if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {\n throw this.unexpected(null, 5);\n }\n let hasDeclaration;\n if (isFromRequired || hasSpecifiers) {\n hasDeclaration = false;\n if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, {\n at: node\n });\n }\n this.parseExportFrom(node, isFromRequired);\n } else {\n hasDeclaration = this.maybeParseExportDeclaration(node);\n }\n if (isFromRequired || hasSpecifiers || hasDeclaration) {\n var _node2$declaration;\n const node2 = node;\n this.checkExport(node2, true, false, !!node2.source);\n if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === \"ClassDeclaration\") {\n this.maybeTakeDecorators(decorators, node2.declaration, node2);\n } else if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, {\n at: node\n });\n }\n return this.finishNode(node2, \"ExportNamedDeclaration\");\n }\n if (this.eat(65)) {\n const node2 = node;\n const decl = this.parseExportDefaultExpression();\n node2.declaration = decl;\n if (decl.type === \"ClassDeclaration\") {\n this.maybeTakeDecorators(decorators, decl, node2);\n } else if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, {\n at: node\n });\n }\n this.checkExport(node2, true, true);\n return this.finishNode(node2, \"ExportDefaultDeclaration\");\n }\n throw this.unexpected(null, 5);\n }\n\n eatExportStar(node) {\n return this.eat(55);\n }\n maybeParseExportDefaultSpecifier(node) {\n if (this.isExportDefaultSpecifier()) {\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = this.parseIdentifier(true);\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n return true;\n }\n return false;\n }\n maybeParseExportNamespaceSpecifier(node) {\n if (this.isContextual(93)) {\n if (!node.specifiers) node.specifiers = [];\n const specifier = this.startNodeAt(this.state.lastTokStartLoc);\n this.next();\n specifier.exported = this.parseModuleExportName();\n node.specifiers.push(this.finishNode(specifier, \"ExportNamespaceSpecifier\"));\n return true;\n }\n return false;\n }\n maybeParseExportNamedSpecifiers(node) {\n if (this.match(5)) {\n if (!node.specifiers) node.specifiers = [];\n const isTypeExport = node.exportKind === \"type\";\n node.specifiers.push(...this.parseExportSpecifiers(isTypeExport));\n node.source = null;\n node.declaration = null;\n if (this.hasPlugin(\"importAssertions\")) {\n node.assertions = [];\n }\n return true;\n }\n return false;\n }\n maybeParseExportDeclaration(node) {\n if (this.shouldParseExportDeclaration()) {\n node.specifiers = [];\n node.source = null;\n if (this.hasPlugin(\"importAssertions\")) {\n node.assertions = [];\n }\n node.declaration = this.parseExportDeclaration(node);\n return true;\n }\n return false;\n }\n isAsyncFunction() {\n if (!this.isContextual(95)) return false;\n const next = this.nextTokenStart();\n return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, \"function\");\n }\n parseExportDefaultExpression() {\n const expr = this.startNode();\n if (this.match(68)) {\n this.next();\n return this.parseFunction(expr, ParseFunctionFlag.Declaration | ParseFunctionFlag.NullableId);\n } else if (this.isAsyncFunction()) {\n this.next();\n this.next();\n return this.parseFunction(expr, ParseFunctionFlag.Declaration | ParseFunctionFlag.NullableId | ParseFunctionFlag.Async);\n }\n if (this.match(80)) {\n return this.parseClass(expr, true, true);\n }\n if (this.match(26)) {\n if (this.hasPlugin(\"decorators\") && this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\")) {\n this.raise(Errors.DecoratorBeforeExport, {\n at: this.state.startLoc\n });\n }\n return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);\n }\n if (this.match(75) || this.match(74) || this.isLet()) {\n throw this.raise(Errors.UnsupportedDefaultExport, {\n at: this.state.startLoc\n });\n }\n const res = this.parseMaybeAssignAllowIn();\n this.semicolon();\n return res;\n }\n\n parseExportDeclaration(\n node) {\n if (this.match(80)) {\n const node = this.parseClass(this.startNode(), true, false);\n return node;\n }\n return this.parseStatementListItem();\n }\n isExportDefaultSpecifier() {\n const {\n type\n } = this.state;\n if (tokenIsIdentifier(type)) {\n if (type === 95 && !this.state.containsEsc || type === 99) {\n return false;\n }\n if ((type === 128 || type === 127) && !this.state.containsEsc) {\n const {\n type: nextType\n } = this.lookahead();\n if (tokenIsIdentifier(nextType) && nextType !== 97 || nextType === 5) {\n this.expectOnePlugin([\"flow\", \"typescript\"]);\n return false;\n }\n }\n } else if (!this.match(65)) {\n return false;\n }\n const next = this.nextTokenStart();\n const hasFrom = this.isUnparsedContextual(next, \"from\");\n if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) {\n return true;\n }\n if (this.match(65) && hasFrom) {\n const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));\n return nextAfterFrom === 34 || nextAfterFrom === 39;\n }\n return false;\n }\n parseExportFrom(node, expect) {\n if (this.eatContextual(97)) {\n node.source = this.parseImportSource();\n this.checkExport(node);\n const assertions = this.maybeParseImportAssertions();\n if (assertions) {\n node.assertions = assertions;\n this.checkJSONModuleImport(node);\n }\n } else if (expect) {\n this.unexpected();\n }\n this.semicolon();\n }\n shouldParseExportDeclaration() {\n const {\n type\n } = this.state;\n if (type === 26) {\n this.expectOnePlugin([\"decorators\", \"decorators-legacy\"]);\n if (this.hasPlugin(\"decorators\")) {\n if (this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\")) {\n throw this.raise(Errors.DecoratorBeforeExport, {\n at: this.state.startLoc\n });\n }\n return true;\n }\n }\n return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction();\n }\n checkExport(node, checkNames, isDefault, isFrom) {\n if (checkNames) {\n if (isDefault) {\n this.checkDuplicateExports(node, \"default\");\n if (this.hasPlugin(\"exportDefaultFrom\")) {\n var _declaration$extra;\n const declaration = node.declaration;\n if (declaration.type === \"Identifier\" && declaration.name === \"from\" && declaration.end - declaration.start === 4 &&\n !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {\n this.raise(Errors.ExportDefaultFromAsIdentifier, {\n at: declaration\n });\n }\n }\n } else if (node.specifiers && node.specifiers.length) {\n for (const specifier of node.specifiers) {\n const {\n exported\n } = specifier;\n const exportName = exported.type === \"Identifier\" ? exported.name : exported.value;\n this.checkDuplicateExports(specifier, exportName);\n if (!isFrom && specifier.local) {\n const {\n local\n } = specifier;\n if (local.type !== \"Identifier\") {\n this.raise(Errors.ExportBindingIsString, {\n at: specifier,\n localName: local.value,\n exportName\n });\n } else {\n this.checkReservedWord(local.name, local.loc.start, true, false);\n this.scope.checkLocalExport(local);\n }\n }\n }\n } else if (node.declaration) {\n if (node.declaration.type === \"FunctionDeclaration\" || node.declaration.type === \"ClassDeclaration\") {\n const id = node.declaration.id;\n if (!id) throw new Error(\"Assertion failure\");\n this.checkDuplicateExports(node, id.name);\n } else if (node.declaration.type === \"VariableDeclaration\") {\n for (const declaration of node.declaration.declarations) {\n this.checkDeclaration(declaration.id);\n }\n }\n }\n }\n }\n checkDeclaration(node) {\n if (node.type === \"Identifier\") {\n this.checkDuplicateExports(node, node.name);\n } else if (node.type === \"ObjectPattern\") {\n for (const prop of node.properties) {\n this.checkDeclaration(prop);\n }\n } else if (node.type === \"ArrayPattern\") {\n for (const elem of node.elements) {\n if (elem) {\n this.checkDeclaration(elem);\n }\n }\n } else if (node.type === \"ObjectProperty\") {\n this.checkDeclaration(node.value);\n } else if (node.type === \"RestElement\") {\n this.checkDeclaration(node.argument);\n } else if (node.type === \"AssignmentPattern\") {\n this.checkDeclaration(node.left);\n }\n }\n checkDuplicateExports(node, exportName) {\n if (this.exportedIdentifiers.has(exportName)) {\n if (exportName === \"default\") {\n this.raise(Errors.DuplicateDefaultExport, {\n at: node\n });\n } else {\n this.raise(Errors.DuplicateExport, {\n at: node,\n exportName\n });\n }\n }\n this.exportedIdentifiers.add(exportName);\n }\n\n parseExportSpecifiers(isInTypeExport) {\n const nodes = [];\n let first = true;\n\n this.expect(5);\n while (!this.eat(8)) {\n if (first) {\n first = false;\n } else {\n this.expect(12);\n if (this.eat(8)) break;\n }\n const isMaybeTypeOnly = this.isContextual(128);\n const isString = this.match(131);\n const node = this.startNode();\n node.local = this.parseModuleExportName();\n nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));\n }\n return nodes;\n }\n parseExportSpecifier(node, isString,\n isInTypeExport, isMaybeTypeOnly\n ) {\n if (this.eatContextual(93)) {\n node.exported = this.parseModuleExportName();\n } else if (isString) {\n node.exported = cloneStringLiteral(node.local);\n } else if (!node.exported) {\n node.exported = cloneIdentifier(node.local);\n }\n return this.finishNode(node, \"ExportSpecifier\");\n }\n\n parseModuleExportName() {\n if (this.match(131)) {\n const result = this.parseStringLiteral(this.state.value);\n const surrogate = result.value.match(loneSurrogate);\n if (surrogate) {\n this.raise(Errors.ModuleExportNameHasLoneSurrogate, {\n at: result,\n surrogateCharCode: surrogate[0].charCodeAt(0)\n });\n }\n return result;\n }\n return this.parseIdentifier(true);\n }\n isJSONModuleImport(node) {\n if (node.assertions != null) {\n return node.assertions.some(({\n key,\n value\n }) => {\n return value.value === \"json\" && (key.type === \"Identifier\" ? key.name === \"type\" : key.value === \"type\");\n });\n }\n return false;\n }\n checkImportReflection(node) {\n if (node.module) {\n var _node$assertions;\n if (node.specifiers.length !== 1 || node.specifiers[0].type !== \"ImportDefaultSpecifier\") {\n this.raise(Errors.ImportReflectionNotBinding, {\n at: node.specifiers[0].loc.start\n });\n }\n if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) {\n this.raise(Errors.ImportReflectionHasAssertion, {\n at: node.specifiers[0].loc.start\n });\n }\n }\n }\n checkJSONModuleImport(node) {\n if (this.isJSONModuleImport(node) && node.type !== \"ExportAllDeclaration\") {\n const {\n specifiers\n } = node;\n if (specifiers != null) {\n const nonDefaultNamedSpecifier = specifiers.find(specifier => {\n let imported;\n if (specifier.type === \"ExportSpecifier\") {\n imported = specifier.local;\n } else if (specifier.type === \"ImportSpecifier\") {\n imported = specifier.imported;\n }\n if (imported !== undefined) {\n return imported.type === \"Identifier\" ? imported.name !== \"default\" : imported.value !== \"default\";\n }\n });\n if (nonDefaultNamedSpecifier !== undefined) {\n this.raise(Errors.ImportJSONBindingNotDefault, {\n at: nonDefaultNamedSpecifier.loc.start\n });\n }\n }\n }\n }\n parseMaybeImportReflection(node) {\n let isImportReflection = false;\n if (this.isContextual(125)) {\n const lookahead = this.lookahead();\n const nextType = lookahead.type;\n if (tokenIsIdentifier(nextType)) {\n if (nextType !== 97) {\n isImportReflection = true;\n } else {\n const nextNextTokenFirstChar = this.input.charCodeAt(this.nextTokenStartSince(lookahead.end));\n if (nextNextTokenFirstChar === 102) {\n isImportReflection = true;\n }\n }\n } else if (nextType !== 12) {\n isImportReflection = true;\n }\n }\n if (isImportReflection) {\n this.expectPlugin(\"importReflection\");\n this.next();\n node.module = true;\n } else if (this.hasPlugin(\"importReflection\")) {\n node.module = false;\n }\n }\n\n parseImport(node) {\n node.specifiers = [];\n if (!this.match(131)) {\n this.parseMaybeImportReflection(node);\n const hasDefault = this.maybeParseDefaultImportSpecifier(node);\n const parseNext = !hasDefault || this.eat(12);\n const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);\n if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);\n this.expectContextual(97);\n }\n node.source = this.parseImportSource();\n const assertions = this.maybeParseImportAssertions();\n if (assertions) {\n node.assertions = assertions;\n } else {\n const attributes = this.maybeParseModuleAttributes();\n if (attributes) {\n node.attributes = attributes;\n }\n }\n this.checkImportReflection(node);\n this.checkJSONModuleImport(node);\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n parseImportSource() {\n if (!this.match(131)) this.unexpected();\n return this.parseExprAtom();\n }\n\n shouldParseDefaultImport(node) {\n return tokenIsIdentifier(this.state.type);\n }\n parseImportSpecifierLocal(node, specifier, type) {\n specifier.local = this.parseIdentifier();\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n finishImportSpecifier(specifier, type, bindingType = BIND_LEXICAL) {\n this.checkLVal(specifier.local, {\n in: specifier,\n binding: bindingType\n });\n return this.finishNode(specifier, type);\n }\n\n parseAssertEntries() {\n const attrs = [];\n const attrNames = new Set();\n do {\n if (this.match(8)) {\n break;\n }\n const node = this.startNode();\n\n const keyName = this.state.value;\n if (attrNames.has(keyName)) {\n this.raise(Errors.ModuleAttributesWithDuplicateKeys, {\n at: this.state.startLoc,\n key: keyName\n });\n }\n attrNames.add(keyName);\n if (this.match(131)) {\n node.key = this.parseStringLiteral(keyName);\n } else {\n node.key = this.parseIdentifier(true);\n }\n this.expect(14);\n if (!this.match(131)) {\n throw this.raise(Errors.ModuleAttributeInvalidValue, {\n at: this.state.startLoc\n });\n }\n node.value = this.parseStringLiteral(this.state.value);\n attrs.push(this.finishNode(node, \"ImportAttribute\"));\n } while (this.eat(12));\n return attrs;\n }\n\n maybeParseModuleAttributes() {\n if (this.match(76) && !this.hasPrecedingLineBreak()) {\n this.expectPlugin(\"moduleAttributes\");\n this.next();\n } else {\n if (this.hasPlugin(\"moduleAttributes\")) return [];\n return null;\n }\n const attrs = [];\n const attributes = new Set();\n do {\n const node = this.startNode();\n node.key = this.parseIdentifier(true);\n if (node.key.name !== \"type\") {\n this.raise(Errors.ModuleAttributeDifferentFromType, {\n at: node.key\n });\n }\n if (attributes.has(node.key.name)) {\n this.raise(Errors.ModuleAttributesWithDuplicateKeys, {\n at: node.key,\n key: node.key.name\n });\n }\n attributes.add(node.key.name);\n this.expect(14);\n if (!this.match(131)) {\n throw this.raise(Errors.ModuleAttributeInvalidValue, {\n at: this.state.startLoc\n });\n }\n node.value = this.parseStringLiteral(this.state.value);\n this.finishNode(node, \"ImportAttribute\");\n attrs.push(node);\n } while (this.eat(12));\n return attrs;\n }\n maybeParseImportAssertions() {\n if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {\n this.expectPlugin(\"importAssertions\");\n this.next();\n } else {\n if (this.hasPlugin(\"importAssertions\")) return [];\n return null;\n }\n this.eat(5);\n const attrs = this.parseAssertEntries();\n this.eat(8);\n return attrs;\n }\n maybeParseDefaultImportSpecifier(node) {\n if (this.shouldParseDefaultImport(node)) {\n this.parseImportSpecifierLocal(node, this.startNode(), \"ImportDefaultSpecifier\");\n return true;\n }\n return false;\n }\n maybeParseStarImportSpecifier(node) {\n if (this.match(55)) {\n const specifier = this.startNode();\n this.next();\n this.expectContextual(93);\n this.parseImportSpecifierLocal(node, specifier, \"ImportNamespaceSpecifier\");\n return true;\n }\n return false;\n }\n parseNamedImportSpecifiers(node) {\n let first = true;\n this.expect(5);\n while (!this.eat(8)) {\n if (first) {\n first = false;\n } else {\n if (this.eat(14)) {\n throw this.raise(Errors.DestructureNamedImport, {\n at: this.state.startLoc\n });\n }\n this.expect(12);\n if (this.eat(8)) break;\n }\n const specifier = this.startNode();\n const importedIsString = this.match(131);\n const isMaybeTypeOnly = this.isContextual(128);\n specifier.imported = this.parseModuleExportName();\n const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === \"type\" || node.importKind === \"typeof\", isMaybeTypeOnly, undefined);\n node.specifiers.push(importSpecifier);\n }\n }\n\n parseImportSpecifier(specifier, importedIsString,\n isInTypeOnlyImport, isMaybeTypeOnly, bindingType\n ) {\n if (this.eatContextual(93)) {\n specifier.local = this.parseIdentifier();\n } else {\n const {\n imported\n } = specifier;\n if (importedIsString) {\n throw this.raise(Errors.ImportBindingIsString, {\n at: specifier,\n importName: imported.value\n });\n }\n this.checkReservedWord(imported.name, specifier.loc.start, true, true);\n if (!specifier.local) {\n specifier.local = cloneIdentifier(imported);\n }\n }\n return this.finishImportSpecifier(specifier, \"ImportSpecifier\", bindingType);\n }\n\n isThisParam(param) {\n return param.type === \"Identifier\" && param.name === \"this\";\n }\n}\n\nclass Parser extends StatementParser {\n\n constructor(options, input) {\n options = getOptions(options);\n super(options, input);\n this.options = options;\n this.initializeScopes();\n this.plugins = pluginsMap(this.options.plugins);\n this.filename = options.sourceFilename;\n }\n\n getScopeHandler() {\n return ScopeHandler;\n }\n parse() {\n this.enterInitialScopes();\n const file = this.startNode();\n const program = this.startNode();\n this.nextToken();\n file.errors = null;\n this.parseTopLevel(file, program);\n file.errors = this.state.errors;\n return file;\n }\n}\nfunction pluginsMap(plugins) {\n const pluginMap = new Map();\n for (const plugin of plugins) {\n const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];\n if (!pluginMap.has(name)) pluginMap.set(name, options || {});\n }\n return pluginMap;\n}\n\nfunction parse(input, options) {\n var _options;\n if (((_options = options) == null ? void 0 : _options.sourceType) === \"unambiguous\") {\n options = Object.assign({}, options);\n try {\n options.sourceType = \"module\";\n const parser = getParser(options, input);\n const ast = parser.parse();\n if (parser.sawUnambiguousESM) {\n return ast;\n }\n if (parser.ambiguousScriptDifferentAst) {\n try {\n options.sourceType = \"script\";\n return getParser(options, input).parse();\n } catch (_unused) {}\n } else {\n ast.program.sourceType = \"script\";\n }\n return ast;\n } catch (moduleError) {\n try {\n options.sourceType = \"script\";\n return getParser(options, input).parse();\n } catch (_unused2) {}\n throw moduleError;\n }\n } else {\n return getParser(options, input).parse();\n }\n}\nfunction parseExpression(input, options) {\n const parser = getParser(options, input);\n if (parser.options.strictMode) {\n parser.state.strict = true;\n }\n return parser.getExpression();\n}\nfunction generateExportedTokenTypes(internalTokenTypes) {\n const tokenTypes = {};\n for (const typeName of Object.keys(internalTokenTypes)) {\n tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]);\n }\n return tokenTypes;\n}\nconst tokTypes = generateExportedTokenTypes(tt);\nfunction getParser(options, input) {\n let cls = Parser;\n if (options != null && options.plugins) {\n validatePlugins(options.plugins);\n cls = getParserClass(options.plugins);\n }\n return new cls(options, input);\n}\nconst parserClassCache = {};\n\nfunction getParserClass(pluginsFromOptions) {\n const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name));\n const key = pluginList.join(\"/\");\n let cls = parserClassCache[key];\n if (!cls) {\n cls = Parser;\n for (const plugin of pluginList) {\n cls = mixinPlugins[plugin](cls);\n }\n parserClassCache[key] = cls;\n }\n return cls;\n}\n\nexports.parse = parse;\nexports.parseExpression = parseExpression;\nexports.tokTypes = tokTypes;\n//# sourceMappingURL=index.js.map\n","import { parse, parseExpression } from \"@babel/parser\";\nexport function parseAsEstreeExpression(source) {\n return parseExpression(source, {\n plugins: [\"estree\", [\"pipelineOperator\", {\n proposal: \"minimal\"\n }]],\n attachComment: false\n });\n}\nexport function parseAsEstree(source) {\n var {\n typescript\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var file = parse(source, {\n plugins: [\"estree\", typescript && \"typescript\"].filter(Boolean),\n strictMode: true,\n attachComment: false\n });\n var body = file.program.body;\n var jsNodes = typescript ? [] : body;\n if (typescript) {\n for (var node of body) {\n if (node.type.startsWith(\"TS\")) {\n if (/Enum|Import|Export/.test(node.type)) {\n throw new SyntaxError(\"Unsupported TypeScript syntax: \".concat(node.type));\n }\n } else {\n jsNodes.push(node);\n }\n }\n }\n if (jsNodes.length === 0) {\n throw new SyntaxError(\"Function declaration not found\");\n }\n if (jsNodes.length > 1 || jsNodes[0].type !== \"FunctionDeclaration\") {\n throw new SyntaxError(\"Expect a single function declaration at top level, but received: \".concat(jsNodes.map(node => \"\\\"\".concat(node.type, \"\\\"\")).join(\", \")));\n }\n return jsNodes[0];\n}\n/** For next-core internal or devtools usage only. */\nexport function parseForAnalysis(source) {\n var {\n typescript,\n tokens\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n try {\n return parse(source, {\n plugins: [\"estree\", typescript && \"typescript\"].filter(Boolean),\n strictMode: true,\n attachComment: false,\n // Allow export/import declarations to make analyser handle errors.\n sourceType: \"unambiguous\",\n tokens\n });\n } catch (e) {\n // Return no errors if parse failed.\n return null;\n }\n}\n//# sourceMappingURL=parse.js.map","export function hasOwnProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n//# sourceMappingURL=hasOwnProperty.js.map","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n// https://tc39.es/ecma262/#sec-execution-contexts\nexport class AnalysisContext {\n constructor() {\n _defineProperty(this, \"VariableEnvironment\", void 0);\n _defineProperty(this, \"LexicalEnvironment\", void 0);\n }\n}\n\n// https://tc39.es/ecma262/#sec-environment-records\nexport class AnalysisEnvironment {\n constructor(outer) {\n _defineProperty(this, \"OuterEnv\", void 0);\n _defineProperty(this, \"bindingSet\", new Set());\n this.OuterEnv = outer;\n }\n HasBinding(name) {\n return this.bindingSet.has(name);\n }\n CreateBinding(name) {\n this.bindingSet.add(name);\n }\n}\n//# sourceMappingURL=AnalysisContext.js.map","import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport { hasOwnProperty } from \"./hasOwnProperty\";\nimport { AnalysisContext, AnalysisEnvironment } from \"./AnalysisContext\";\nimport { collectBoundNames, collectScopedDeclarations, containsExpression } from \"./traverse\";\n/**\n * Analysis an AST of a storyboard function or an evaluation expression.\n *\n * @param rootAst - The root AST.\n * @param options - Analysis options.\n * @returns A set of global variables the root AST attempts to access.\n */\nexport function precook(rootAst) {\n var {\n expressionOnly,\n visitors,\n withParent,\n hooks = {}\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var attemptToVisitGlobals = new Set();\n var analysisContextStack = [];\n var rootEnv = new AnalysisEnvironment(null);\n var rootContext = new AnalysisContext();\n rootContext.VariableEnvironment = rootEnv;\n rootContext.LexicalEnvironment = rootEnv;\n analysisContextStack.push(rootContext);\n function getRunningContext() {\n return analysisContextStack[analysisContextStack.length - 1];\n }\n function visit(node) {\n if (hasOwnProperty(visitors, node.type)) {\n visitors[node.type](node);\n }\n }\n function EvaluateChildren(node, keys, parent) {\n for (var key of keys) {\n Evaluate(node[key], parent === null || parent === void 0 ? void 0 : parent.concat({\n node,\n key\n }));\n }\n }\n function Evaluate(node, parent) {\n if (Array.isArray(node)) {\n node.forEach((n, index) => {\n Evaluate(n, parent ? parent.slice(0, -1).concat(_objectSpread(_objectSpread({}, parent[parent.length - 1]), {}, {\n index\n })) : parent);\n });\n } else if (node) {\n var _hooks$beforeVisit, _hooks$beforeVisitUnk;\n // `node` maybe `null` in some cases.\n (_hooks$beforeVisit = hooks.beforeVisit) === null || _hooks$beforeVisit === void 0 ? void 0 : _hooks$beforeVisit.call(hooks, node, parent);\n visitors && visit(node);\n // Expressions:\n switch (node.type) {\n case \"Identifier\":\n if (!ResolveBinding(node.name)) {\n var _hooks$beforeVisitGlo;\n (_hooks$beforeVisitGlo = hooks.beforeVisitGlobal) === null || _hooks$beforeVisitGlo === void 0 ? void 0 : _hooks$beforeVisitGlo.call(hooks, node, parent);\n attemptToVisitGlobals.add(node.name);\n }\n return;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n EvaluateChildren(node, [\"elements\"], parent);\n return;\n case \"ArrowFunctionExpression\":\n {\n var env = getRunningContext().LexicalEnvironment;\n var closure = OrdinaryFunctionCreate(node, env);\n CallFunction(closure, parent);\n return;\n }\n case \"AssignmentPattern\":\n case \"BinaryExpression\":\n case \"LogicalExpression\":\n EvaluateChildren(node, [\"left\", \"right\"], parent);\n return;\n case \"CallExpression\":\n case \"NewExpression\":\n EvaluateChildren(node, [\"callee\", \"arguments\"], parent);\n return;\n case \"ChainExpression\":\n EvaluateChildren(node, [\"expression\"], parent);\n return;\n case \"ConditionalExpression\":\n EvaluateChildren(node, [\"test\", \"consequent\", \"alternate\"], parent);\n return;\n case \"MemberExpression\":\n EvaluateChildren(node, [\"object\"], parent);\n if (node.computed) {\n EvaluateChildren(node, [\"property\"], parent);\n }\n return;\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n EvaluateChildren(node, [\"properties\"], parent);\n return;\n case \"Property\":\n if (node.computed) {\n EvaluateChildren(node, [\"key\"], parent);\n }\n EvaluateChildren(node, [\"value\"], parent);\n return;\n case \"RestElement\":\n case \"SpreadElement\":\n case \"UnaryExpression\":\n EvaluateChildren(node, [\"argument\"], parent);\n return;\n case \"SequenceExpression\":\n case \"TemplateLiteral\":\n EvaluateChildren(node, [\"expressions\"], parent);\n return;\n case \"TaggedTemplateExpression\":\n EvaluateChildren(node, [\"tag\", \"quasi\"], parent);\n return;\n case \"Literal\":\n return;\n }\n if (!expressionOnly) {\n // Statements and assignments:\n switch (node.type) {\n case \"AssignmentExpression\":\n EvaluateChildren(node, [\"right\", \"left\"], parent);\n return;\n case \"BlockStatement\":\n {\n if (!node.body.length) {\n return;\n }\n var runningContext = getRunningContext();\n var oldEnv = runningContext.LexicalEnvironment;\n var blockEnv = new AnalysisEnvironment(oldEnv);\n BlockDeclarationInstantiation(node.body, blockEnv);\n runningContext.LexicalEnvironment = blockEnv;\n EvaluateChildren(node, [\"body\"], parent);\n runningContext.LexicalEnvironment = oldEnv;\n return;\n }\n case \"BreakStatement\":\n case \"ContinueStatement\":\n case \"EmptyStatement\":\n return;\n case \"CatchClause\":\n {\n var _runningContext = getRunningContext();\n var _oldEnv = _runningContext.LexicalEnvironment;\n var catchEnv = new AnalysisEnvironment(_oldEnv);\n BoundNamesInstantiation(node.param, catchEnv);\n _runningContext.LexicalEnvironment = catchEnv;\n EvaluateChildren(node, [\"param\", \"body\"], parent);\n _runningContext.LexicalEnvironment = _oldEnv;\n return;\n }\n case \"DoWhileStatement\":\n EvaluateChildren(node, [\"body\", \"test\"], parent);\n return;\n case \"ExpressionStatement\":\n case \"TSAsExpression\":\n EvaluateChildren(node, [\"expression\"], parent);\n return;\n case \"ForInStatement\":\n case \"ForOfStatement\":\n {\n // ForIn/OfHeadEvaluation\n var lexicalBinding = node.left.type === \"VariableDeclaration\" && node.left.kind !== \"var\";\n var _runningContext2 = getRunningContext();\n var _oldEnv2 = _runningContext2.LexicalEnvironment;\n if (lexicalBinding) {\n var newEnv = new AnalysisEnvironment(_oldEnv2);\n BoundNamesInstantiation(node.left, newEnv);\n _runningContext2.LexicalEnvironment = newEnv;\n }\n EvaluateChildren(node, [\"right\"], parent);\n _runningContext2.LexicalEnvironment = _oldEnv2;\n\n // ForIn/OfBodyEvaluation\n if (lexicalBinding) {\n var iterationEnv = new AnalysisEnvironment(_oldEnv2);\n BoundNamesInstantiation(node.left, iterationEnv);\n _runningContext2.LexicalEnvironment = iterationEnv;\n }\n EvaluateChildren(node, [\"left\", \"body\"], parent);\n _runningContext2.LexicalEnvironment = _oldEnv2;\n return;\n }\n case \"ForStatement\":\n {\n var _node$init;\n var _lexicalBinding = ((_node$init = node.init) === null || _node$init === void 0 ? void 0 : _node$init.type) === \"VariableDeclaration\" && node.init.kind !== \"var\";\n var _runningContext3 = getRunningContext();\n var _oldEnv3 = _runningContext3.LexicalEnvironment;\n if (_lexicalBinding) {\n var loopEnv = new AnalysisEnvironment(_oldEnv3);\n BoundNamesInstantiation(node.init, loopEnv);\n _runningContext3.LexicalEnvironment = loopEnv;\n }\n EvaluateChildren(node, [\"init\", \"test\", \"body\", \"update\"], parent);\n _runningContext3.LexicalEnvironment = _oldEnv3;\n return;\n }\n case \"FunctionDeclaration\":\n {\n var [fn] = collectBoundNames(node);\n var _env = getRunningContext().LexicalEnvironment;\n var fo = OrdinaryFunctionCreate(node, _env);\n _env.CreateBinding(fn);\n CallFunction(fo, parent);\n return;\n }\n case \"FunctionExpression\":\n {\n var _closure = InstantiateOrdinaryFunctionExpression(node);\n CallFunction(_closure, parent);\n return;\n }\n case \"IfStatement\":\n EvaluateChildren(node, [\"test\", \"consequent\", \"alternate\"], parent);\n return;\n case \"ReturnStatement\":\n case \"ThrowStatement\":\n case \"UpdateExpression\":\n EvaluateChildren(node, [\"argument\"], parent);\n return;\n case \"SwitchCase\":\n EvaluateChildren(node, [\"test\", \"consequent\"], parent);\n return;\n case \"SwitchStatement\":\n {\n EvaluateChildren(node, [\"discriminant\"], parent);\n var _runningContext4 = getRunningContext();\n var _oldEnv4 = _runningContext4.LexicalEnvironment;\n var _blockEnv = new AnalysisEnvironment(_oldEnv4);\n BlockDeclarationInstantiation(node.cases, _blockEnv);\n _runningContext4.LexicalEnvironment = _blockEnv;\n EvaluateChildren(node, [\"cases\"], parent);\n _runningContext4.LexicalEnvironment = _oldEnv4;\n return;\n }\n case \"TryStatement\":\n EvaluateChildren(node, [\"block\", \"handler\", \"finalizer\"], parent);\n return;\n case \"VariableDeclaration\":\n EvaluateChildren(node, [\"declarations\"], parent);\n return;\n case \"VariableDeclarator\":\n EvaluateChildren(node, [\"id\", \"init\"], parent);\n return;\n case \"WhileStatement\":\n EvaluateChildren(node, [\"test\", \"body\"], parent);\n return;\n }\n }\n var silent = (_hooks$beforeVisitUnk = hooks.beforeVisitUnknown) === null || _hooks$beforeVisitUnk === void 0 ? void 0 : _hooks$beforeVisitUnk.call(hooks, node, parent);\n if (!silent) {\n // eslint-disable-next-line no-console\n console.warn(\"Unsupported node type `\".concat(node.type, \"`\"));\n }\n }\n }\n function BoundNamesInstantiation(declarations, env) {\n for (var name of collectBoundNames(declarations)) {\n env.CreateBinding(name);\n }\n }\n function ResolveBinding(name) {\n var env = getRunningContext().LexicalEnvironment;\n return GetIdentifierReference(env, name);\n }\n function GetIdentifierReference(env, name) {\n return !!env && (env.HasBinding(name) || GetIdentifierReference(env.OuterEnv, name));\n }\n function BlockDeclarationInstantiation(code, env) {\n var declarations = collectScopedDeclarations(code, {\n var: false,\n topLevel: false\n });\n BoundNamesInstantiation(declarations, env);\n }\n function CallFunction(closure, parent) {\n PrepareOrdinaryCall(closure);\n FunctionDeclarationInstantiation(closure, parent);\n Evaluate(closure.ECMAScriptCode, parent === null || parent === void 0 ? void 0 : parent.concat({\n node: closure.Function,\n key: \"body\"\n }).concat(closure.Function.body.type === \"BlockStatement\" ? {\n node: closure.Function.body,\n key: \"body\"\n } : []));\n analysisContextStack.pop();\n }\n function PrepareOrdinaryCall(F) {\n var calleeContext = new AnalysisContext();\n var localEnv = new AnalysisEnvironment(F.Environment);\n calleeContext.VariableEnvironment = localEnv;\n calleeContext.LexicalEnvironment = localEnv;\n analysisContextStack.push(calleeContext);\n }\n function FunctionDeclarationInstantiation(func, parent) {\n var calleeContext = getRunningContext();\n var code = func.ECMAScriptCode;\n var formals = func.FormalParameters;\n var hasParameterExpressions = containsExpression(formals);\n var varDeclarations = collectScopedDeclarations(code, {\n var: true,\n topLevel: true\n });\n var varNames = collectBoundNames(varDeclarations);\n var env = calleeContext.LexicalEnvironment;\n BoundNamesInstantiation(formals, env);\n Evaluate(formals, parent === null || parent === void 0 ? void 0 : parent.concat({\n node: func.Function,\n key: \"params\"\n }));\n var varEnv;\n if (!hasParameterExpressions) {\n // NOTE: Only a single Environment Record is needed for the parameters\n // and top-level vars.\n for (var n of varNames) {\n env.CreateBinding(n);\n }\n varEnv = env;\n } else {\n // NOTE: A separate Environment Record is needed to ensure that closures\n // created by expressions in the formal parameter list do not have\n // visibility of declarations in the function body.\n varEnv = new AnalysisEnvironment(env);\n calleeContext.VariableEnvironment = varEnv;\n for (var _n of varNames) {\n varEnv.CreateBinding(_n);\n }\n }\n var lexEnv = varEnv;\n calleeContext.LexicalEnvironment = lexEnv;\n var lexDeclarations = collectScopedDeclarations(code, {\n var: false,\n topLevel: true\n });\n BoundNamesInstantiation(lexDeclarations, lexEnv);\n }\n function InstantiateOrdinaryFunctionExpression(functionExpression) {\n var scope = getRunningContext().LexicalEnvironment;\n if (!functionExpression.id) {\n return OrdinaryFunctionCreate(functionExpression, scope);\n }\n var name = functionExpression.id.name;\n var funcEnv = new AnalysisEnvironment(scope);\n funcEnv.CreateBinding(name);\n return OrdinaryFunctionCreate(functionExpression, funcEnv);\n }\n function OrdinaryFunctionCreate(func, scope) {\n return {\n Function: func,\n FormalParameters: func.params,\n ECMAScriptCode: func.body.type === \"BlockStatement\" ? func.body.body : func.body,\n Environment: scope\n };\n }\n Evaluate(rootAst, withParent ? [] : undefined);\n return attemptToVisitGlobals;\n}\n//# sourceMappingURL=precook.js.map","import { parseForAnalysis } from \"./parse\";\nimport { precook } from \"./precook\";\n/** For next-core internal or devtools usage only. */\nexport function lint(source) {\n var {\n typescript,\n rules\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var errors = [];\n var file = typeof source === \"string\" ? parseForAnalysis(source, {\n typescript\n }) : source;\n if (!file) {\n // Return no errors if parse failed.\n return errors;\n }\n var body = file.program.body;\n var jsNodes = typescript ? [] : body;\n if (typescript) {\n for (var node of body) {\n if (node.type.startsWith(\"TS\")) {\n if (/Enum|Import|Export/.test(node.type)) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Unsupported TypeScript syntax: `\".concat(node.type, \"`\"),\n loc: node.loc\n });\n }\n } else {\n jsNodes.push(node);\n }\n }\n }\n var func;\n for (var _node of jsNodes) {\n var isFunctionDeclaration = _node.type === \"FunctionDeclaration\";\n if (isFunctionDeclaration && !func) {\n func = _node;\n } else {\n errors.push({\n type: \"SyntaxError\",\n message: isFunctionDeclaration ? \"Expect a single function declaration\" : \"`\".concat(_node.type, \"` is not allowed in top level\"),\n loc: _node.loc\n });\n }\n }\n if (!func) {\n errors.unshift({\n type: \"SyntaxError\",\n message: \"Function declaration not found\",\n loc: {\n start: {\n line: 1,\n column: 0\n },\n end: {\n line: 1,\n column: 0\n }\n }\n });\n } else {\n precook(func, {\n hooks: {\n beforeVisit(node) {\n switch (node.type) {\n case \"ArrowFunctionExpression\":\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n if (node.async || node.generator) {\n errors.push({\n type: \"SyntaxError\",\n message: \"\".concat(node.async ? \"Async\" : \"Generator\", \" function is not allowed\"),\n loc: node.loc\n });\n }\n break;\n case \"Literal\":\n if (node.regex) {\n if (node.value === null) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Invalid regular expression\",\n loc: node.loc\n });\n } else if (node.regex.flags.includes(\"u\")) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Unsupported unicode flag in regular expression\",\n loc: node.loc\n });\n }\n }\n break;\n case \"ObjectExpression\":\n for (var prop of node.properties) {\n if (prop.type === \"Property\") {\n if (prop.kind !== \"init\") {\n errors.push({\n type: \"SyntaxError\",\n message: \"Unsupported object getter/setter property\",\n loc: prop.loc\n });\n } else if (!prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"__proto__\") {\n errors.push({\n type: \"TypeError\",\n message: \"Setting '__proto__' property is not allowed\",\n loc: prop.key.loc\n });\n }\n }\n }\n break;\n case \"VariableDeclaration\":\n if (node.kind === \"var\" && rules !== null && rules !== void 0 && rules.noVar) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Var declaration is not recommended, use `let` or `const` instead\",\n loc: {\n start: node.loc.start,\n end: {\n line: node.loc.start.line,\n // Only decorate the \"var\".\n column: node.loc.start.column + 3\n }\n }\n });\n }\n break;\n }\n },\n beforeVisitGlobal(node) {\n if (node.name === \"arguments\") {\n errors.push({\n type: \"SyntaxError\",\n message: \"Use the rest parameters instead of 'arguments'\",\n loc: node.loc\n });\n }\n },\n beforeVisitUnknown(node) {\n errors.push({\n type: \"SyntaxError\",\n message: \"Unsupported syntax: `\".concat(node.type, \"`\"),\n loc: node.loc\n });\n return true;\n }\n }\n });\n }\n return errors;\n}\n//# sourceMappingURL=lint.js.map","import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"typescript\"];\nimport { parseAsEstree } from \"./parse\";\nimport { precook } from \"./precook\";\nexport function precookFunction(source) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n {\n typescript\n } = _ref,\n restOptions = _objectWithoutProperties(_ref, _excluded);\n var func = parseAsEstree(source, {\n typescript\n });\n var attemptToVisitGlobals = precook(func, restOptions);\n return {\n function: func,\n attemptToVisitGlobals\n };\n}\n//# sourceMappingURL=precookFunction.js.map","import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport { parseAsEstreeExpression } from \"./parse\";\nimport { precook } from \"./precook\";\n// `raw` should always be asserted by `isEvaluable`.\nexport function preevaluate(raw, options) {\n var fixes = [];\n var source = raw.replace(/^\\s*<%~?\\s|\\s%>\\s*$/g, m => {\n fixes.push(m);\n return \"\";\n });\n var expression = parseAsEstreeExpression(source);\n var attemptToVisitGlobals = precook(expression, _objectSpread(_objectSpread({}, options), {}, {\n expressionOnly: true\n }));\n return {\n expression,\n attemptToVisitGlobals,\n source,\n prefix: fixes[0],\n suffix: fixes[1]\n };\n}\nexport function isEvaluable(raw) {\n return /^\\s*<%~?\\s/.test(raw) && /\\s%>\\s*$/.test(raw);\n}\nexport function shouldAllowRecursiveEvaluations(raw) {\n return /^\\s*<%~\\s/.test(raw);\n}\n//# sourceMappingURL=preevaluate.js.map","// istanbul ignore file\nexport * from \"@next-core/cook\";\n\n/** @deprecated */\nexport const PrecookVisitor = new Proxy(Object.freeze({}), {\n get() {\n return noop;\n },\n});\n\n/** @deprecated */\nexport const PrecookFunctionVisitor = new Proxy(Object.freeze({}), {\n get() {\n return noop;\n },\n});\n\nfunction noop(): void {\n /* noop */\n}\n","// Ref https://github.com/lodash/lodash/blob/4.17.11/lodash.js#L11744\nexport function isObject(value: unknown): value is Record<string, any> {\n const type = typeof value;\n return value != null && (type == \"object\" || type == \"function\");\n}\n","import { StoryboardFunction } from \"@next-core/brick-types\";\nimport {\n precookFunction,\n PrecookHooks,\n isEvaluable,\n preevaluate,\n} from \"./cook\";\nimport { isObject } from \"./isObject\";\n\nexport function visitStoryboardFunctions(\n functions: StoryboardFunction[],\n beforeVisitGlobal: PrecookHooks[\"beforeVisitGlobal\"]\n): void {\n if (Array.isArray(functions)) {\n for (const fn of functions) {\n try {\n precookFunction(fn.source, {\n typescript: fn.typescript,\n withParent: true,\n hooks: { beforeVisitGlobal },\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(`Parse storyboard function \"${fn.name}\" failed:`, error);\n }\n }\n }\n}\n\ninterface VisitStoryboardExpressionsOptions {\n matchExpressionString: (v: string) => boolean;\n visitNonExpressionString?: (v: string) => unknown;\n visitObject?: (v: unknown[] | Record<string, unknown>) => unknown;\n}\n\nexport function visitStoryboardExpressions(\n data: unknown,\n beforeVisitGlobal: PrecookHooks[\"beforeVisitGlobal\"],\n // If `options` is a string, it means the *keyword*.\n options: string | VisitStoryboardExpressionsOptions\n): void {\n const memo = new WeakSet();\n const { matchExpressionString, visitNonExpressionString, visitObject } =\n typeof options === \"string\"\n ? ({\n matchExpressionString: (v: string) => v.includes(options),\n } as VisitStoryboardExpressionsOptions)\n : options;\n function visit(value: unknown): void {\n if (typeof value === \"string\") {\n if (matchExpressionString(value) && isEvaluable(value)) {\n try {\n preevaluate(value, {\n withParent: true,\n hooks: { beforeVisitGlobal },\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else {\n visitNonExpressionString?.(value);\n }\n } else if (isObject(value)) {\n // Avoid call stack overflow.\n if (memo.has(value)) {\n return;\n }\n memo.add(value);\n visitObject?.(value);\n for (const item of Array.isArray(value) ? value : Object.values(value)) {\n visit(item);\n }\n }\n }\n visit(data);\n}\n","import { uniq } from \"lodash\";\nimport { Storyboard } from \"@next-core/brick-types\";\nimport { PrecookHooks } from \"./cook\";\nimport { visitStoryboardExpressions } from \"./visitStoryboard\";\n\nconst PROCESSORS = \"PROCESSORS\";\n\nexport function scanProcessorsInStoryboard(\n storyboard: Storyboard,\n isUniq = true\n): string[] {\n return scanProcessorsInAny(\n [storyboard.routes, storyboard.meta?.customTemplates],\n isUniq\n );\n}\n\nexport function scanProcessorsInAny(data: unknown, isUniq = true): string[] {\n const collection: string[] = [];\n visitStoryboardExpressions(\n data,\n beforeVisitProcessorsFactory(collection),\n PROCESSORS\n );\n return isUniq ? uniq(collection) : collection;\n}\n\nfunction beforeVisitProcessorsFactory(\n collection: string[]\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitProcessors(node, parent): void {\n if (node.name === PROCESSORS) {\n const memberParent = parent[parent.length - 1];\n const outerMemberParent = parent[parent.length - 2];\n if (\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\" &&\n !memberParent.node.computed &&\n memberParent.node.property.type === \"Identifier\" &&\n outerMemberParent?.node.type === \"MemberExpression\" &&\n outerMemberParent.key === \"object\" &&\n !outerMemberParent.node.computed &&\n outerMemberParent.node.property.type === \"Identifier\"\n ) {\n collection.push(\n `${memberParent.node.property.name}.${outerMemberParent.node.property.name}`\n );\n }\n }\n };\n}\n","import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\n/** Parse storyboard as AST. */\nexport function parseStoryboard(storyboard) {\n var _storyboard$meta;\n return {\n type: \"Root\",\n raw: storyboard,\n routes: parseRoutes(storyboard.routes),\n templates: parseTemplates((_storyboard$meta = storyboard.meta) === null || _storyboard$meta === void 0 ? void 0 : _storyboard$meta.customTemplates)\n };\n}\n/** Parse storyboard routes as AST. */\nexport function parseRoutes(routes, options) {\n if (Array.isArray(routes)) {\n return routes.map(route => _objectSpread(_objectSpread({\n type: \"Route\",\n raw: route\n }, options !== null && options !== void 0 && options.routesOnly ? null : {\n context: parseContext(route.context),\n redirect: parseResolvable(route.redirect),\n menu: parseMenu(route.menu),\n providers: parseRouteProviders(route.providers),\n defineResolves: Array.isArray(route.defineResolves) ? route.defineResolves.map(item => parseResolvable(item)).filter(Boolean) : undefined\n }), {}, {\n children: route.type === \"routes\" ? parseRoutes(route.routes, options) : parseBricks(route.bricks, options)\n }));\n }\n return [];\n}\n\n/** Parse storyboard templates as AST. */\nexport function parseTemplates(templates) {\n if (Array.isArray(templates)) {\n return templates.map(parseTemplate);\n }\n return [];\n}\n\n/** Parse a storyboard template as AST. */\nexport function parseTemplate(tpl) {\n return {\n type: \"Template\",\n raw: tpl,\n bricks: parseBricks(tpl.bricks),\n context: parseContext(tpl.state)\n };\n}\nfunction parseBricks(bricks, options) {\n if (Array.isArray(bricks)) {\n return bricks.map(brick => parseBrick(brick, options));\n }\n return [];\n}\n\n/** Parse a storyboard brick as AST. */\nexport function parseBrick(brick, options) {\n return _objectSpread(_objectSpread({\n type: \"Brick\",\n raw: brick,\n isUseBrick: options === null || options === void 0 ? void 0 : options.isUseBrick\n }, options !== null && options !== void 0 && options.routesOnly ? null : _objectSpread(_objectSpread({\n if: parseCondition(brick.if),\n events: parseEvents(brick.events),\n lifeCycle: parseLifeCycles(brick.lifeCycle)\n }, parseBrickProperties(brick.properties)), {}, {\n context: parseContext(brick.context)\n })), {}, {\n children: parseSlots(brick.slots, options)\n });\n}\nfunction parseCondition(condition) {\n if (isObject(condition)) {\n return {\n type: \"ResolvableCondition\",\n resolve: parseResolvable(condition)\n };\n }\n return {\n type: \"LiteralCondition\"\n };\n}\nfunction parseBrickProperties(props) {\n var useBrick = [];\n var useBackend = [];\n function walkBrickProperties(value) {\n if (Array.isArray(value)) {\n for (var item of value) {\n walkBrickProperties(item);\n }\n } else if (isObject(value)) {\n if (value.useBrick || value.useBackend) {\n var _value$useBackend;\n if (value.useBrick) {\n useBrick.push({\n type: \"UseBrickEntry\",\n rawContainer: value,\n rawKey: \"useBrick\",\n children: parseBricks([].concat(value.useBrick), {\n isUseBrick: true\n })\n });\n }\n var provider = (_value$useBackend = value.useBackend) === null || _value$useBackend === void 0 ? void 0 : _value$useBackend.provider;\n if (typeof provider === \"string\") {\n useBackend.push({\n type: \"UseBackendEntry\",\n rawContainer: value,\n rawKey: \"useBackend\",\n children: [parseBrick({\n brick: provider\n })]\n });\n }\n } else {\n for (var _item of Object.values(value)) {\n walkBrickProperties(_item);\n }\n }\n }\n }\n walkBrickProperties(props);\n return {\n useBrick,\n useBackend\n };\n}\nfunction parseLifeCycles(lifeCycle) {\n if (isObject(lifeCycle)) {\n return Object.entries(lifeCycle).map(_ref => {\n var [name, conf] = _ref;\n switch (name) {\n case \"useResolves\":\n return {\n type: \"ResolveLifeCycle\",\n rawContainer: lifeCycle,\n rawKey: name,\n resolves: Array.isArray(conf) ? conf.map(item => parseResolvable(item, true)).filter(Boolean) : undefined\n };\n case \"onPageLoad\":\n case \"onPageLeave\":\n case \"onAnchorLoad\":\n case \"onAnchorUnload\":\n case \"onMessageClose\":\n case \"onBeforePageLoad\":\n case \"onBeforePageLeave\":\n case \"onMount\":\n case \"onUnmount\":\n case \"onMediaChange\":\n return {\n type: \"SimpleLifeCycle\",\n name,\n rawContainer: lifeCycle,\n rawKey: name,\n handlers: parseEventHandlers(conf)\n };\n case \"onMessage\":\n case \"onScrollIntoView\":\n return {\n type: \"ConditionalLifeCycle\",\n name,\n events: [].concat(conf).filter(Boolean).map(item => ({\n type: \"ConditionalEvent\",\n rawContainer: item,\n rawKey: \"handlers\",\n handlers: parseEventHandlers(item.handlers)\n }))\n };\n default:\n return {\n type: \"UnknownLifeCycle\"\n };\n }\n });\n }\n}\nfunction parseSlots(slots, options) {\n if (isObject(slots)) {\n return Object.entries(slots).map(_ref2 => {\n var [slot, conf] = _ref2;\n return {\n type: \"Slot\",\n raw: conf,\n slot,\n childrenType: conf.type === \"routes\" ? \"Route\" : \"Brick\",\n children: conf.type === \"routes\" ? parseRoutes(conf.routes, options) : parseBricks(conf.bricks, options)\n };\n });\n }\n return [];\n}\nfunction parseEvents(events) {\n if (isObject(events)) {\n return Object.entries(events).map(_ref3 => {\n var [eventType, handlers] = _ref3;\n return {\n type: \"Event\",\n rawContainer: events,\n rawKey: eventType,\n handlers: parseEventHandlers(handlers)\n };\n });\n }\n}\nfunction parseContext(contexts) {\n if (Array.isArray(contexts)) {\n return contexts.map(context => ({\n type: \"Context\",\n raw: context,\n resolve: parseResolvable(context.resolve),\n onChange: parseEventHandlers(context.onChange)\n }));\n }\n}\nfunction parseMenu(menu) {\n if (menu === false) {\n return {\n type: \"FalseMenu\"\n };\n }\n if (!menu) {\n return;\n }\n switch (menu.type) {\n case \"brick\":\n return {\n type: \"BrickMenu\",\n raw: menu,\n brick: parseBrick(menu)\n };\n case \"resolve\":\n return {\n type: \"ResolvableMenu\",\n resolve: parseResolvable(menu.resolve)\n };\n default:\n return {\n type: \"StaticMenu\"\n };\n }\n}\nfunction parseResolvable(resolve, isConditional) {\n if (isObject(resolve)) {\n return {\n type: \"Resolvable\",\n raw: resolve,\n isConditional\n };\n }\n}\nfunction parseEventHandlers(handlers) {\n return [].concat(handlers).filter(Boolean).map(handler => ({\n type: \"EventHandler\",\n callback: parseEventCallback(handler.callback),\n raw: handler\n }));\n}\nfunction parseEventCallback(callback) {\n if (isObject(callback)) {\n return Object.entries(callback).map(_ref4 => {\n var [callbackType, handlers] = _ref4;\n return {\n type: \"EventCallback\",\n rawContainer: callback,\n rawKey: callbackType,\n handlers: parseEventHandlers(handlers)\n };\n });\n }\n}\nfunction parseRouteProviders(providers) {\n if (Array.isArray(providers)) {\n return providers.map(provider => parseBrick(typeof provider === \"string\" ? {\n brick: provider\n } : provider));\n }\n}\n\n// Ref https://github.com/lodash/lodash/blob/4.17.11/lodash.js#L11744\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == \"object\" || type == \"function\");\n}\n//# sourceMappingURL=parseStoryboard.js.map","/** Traverse a storyboard AST. */\nexport function traverseStoryboard(ast, callback) {\n traverseNode(ast, callback, []);\n}\n\n/** Traverse any node(s) in storyboard AST. */\nexport function traverse(nodeOrNodes, callback) {\n if (Array.isArray(nodeOrNodes)) {\n traverseNodes(nodeOrNodes, callback, []);\n } else {\n traverseNode(nodeOrNodes, callback, []);\n }\n}\nfunction traverseNodes(nodes, callback, path) {\n if (!nodes) {\n return;\n }\n for (var _node of nodes) {\n traverseNode(_node, callback, path);\n }\n}\nfunction traverseNode(node, callback, path) {\n if (!node) {\n return;\n }\n callback(node, path);\n var childPath = path.concat(node);\n switch (node.type) {\n case \"Root\":\n traverseNodes(node.routes, callback, childPath);\n traverseNodes(node.templates, callback, childPath);\n break;\n case \"Route\":\n traverseNodes(node.context, callback, childPath);\n traverseNode(node.redirect, callback, childPath);\n traverseNode(node.menu, callback, childPath);\n traverseNodes(node.providers, callback, childPath);\n traverseNodes(node.defineResolves, callback, childPath);\n traverseNodes(node.children, callback, childPath);\n break;\n case \"Template\":\n traverseNodes(node.bricks, callback, childPath);\n traverseNodes(node.context, callback, childPath);\n break;\n case \"Brick\":\n traverseNode(node.if, callback, childPath);\n traverseNodes(node.events, callback, childPath);\n traverseNodes(node.lifeCycle, callback, childPath);\n traverseNodes(node.useBrick, callback, childPath);\n traverseNodes(node.useBackend, callback, childPath);\n traverseNodes(node.context, callback, childPath);\n traverseNodes(node.children, callback, childPath);\n break;\n case \"Slot\":\n case \"UseBrickEntry\":\n case \"UseBackendEntry\":\n traverseNodes(node.children, callback, childPath);\n break;\n case \"Context\":\n traverseNode(node.resolve, callback, childPath);\n traverseNodes(node.onChange, callback, childPath);\n break;\n case \"ResolvableCondition\":\n case \"ResolvableMenu\":\n traverseNode(node.resolve, callback, childPath);\n break;\n case \"ResolveLifeCycle\":\n traverseNodes(node.resolves, callback, childPath);\n break;\n case \"Event\":\n case \"EventCallback\":\n case \"SimpleLifeCycle\":\n case \"ConditionalEvent\":\n traverseNodes(node.handlers, callback, childPath);\n break;\n case \"EventHandler\":\n traverseNodes(node.callback, callback, childPath);\n break;\n case \"ConditionalLifeCycle\":\n traverseNodes(node.events, callback, childPath);\n break;\n case \"BrickMenu\":\n traverseNode(node.brick, callback, childPath);\n break;\n case \"Resolvable\":\n case \"FalseMenu\":\n case \"StaticMenu\":\n case \"UnknownLifeCycle\":\n case \"LiteralCondition\":\n break;\n default:\n // istanbul ignore if\n if (process.env.NODE_ENV === \"development\") {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n throw new Error(\"Unhandled storyboard node type: \".concat(node.type));\n }\n }\n}\n//# sourceMappingURL=traverseStoryboard.js.map","import type {\n Storyboard,\n BrickConf,\n CustomTemplate,\n UseProviderResolveConf,\n UseProviderEventHandler,\n} from \"@next-core/brick-types\";\nimport { isObject } from \"./isObject\";\nimport {\n type StoryboardNode,\n parseBrick,\n parseStoryboard,\n parseTemplates,\n traverse,\n} from \"@next-core/storyboard\";\nimport { StoryboardNodeRoot } from \".\";\n\nexport interface ScanBricksOptions {\n keepDuplicates?: boolean;\n ignoreBricksInUnusedCustomTemplates?: boolean;\n}\n\n/**\n * Scan bricks and custom apis in storyboard.\n *\n * @param storyboard - Storyboard.\n * @param options - If options is a boolean, it means `isUniq` or `de-duplicate`.\n */\nexport function scanStoryboard(\n storyboard: Storyboard,\n options: boolean | ScanBricksOptions = true\n): ReturnType<typeof scanStoryboardAst> {\n const ast = parseStoryboard(storyboard);\n return scanStoryboardAst(ast, options);\n}\n\n/**\n * Scan bricks and custom apis in storyboard.\n *\n * @param storyboard - Storyboard.\n * @param options - If options is a boolean, it means `isUniq` or `de-duplicate`.\n */\nexport function scanStoryboardAst(\n ast: StoryboardNodeRoot,\n options: boolean | ScanBricksOptions = true\n): { bricks: string[]; customApis: string[]; usedTemplates: string[] } {\n const { keepDuplicates, ignoreBricksInUnusedCustomTemplates } = isObject(\n options\n )\n ? options\n : ({\n keepDuplicates: !options,\n } as ScanBricksOptions);\n\n const selfDefined = new Set<string>([\"form-renderer.form-renderer\"]);\n let collection: Set<string> | string[];\n\n if (ignoreBricksInUnusedCustomTemplates) {\n collection = collect(ast.routes, keepDuplicates);\n if (Array.isArray(ast.templates)) {\n const tplMap = new Map<string, StoryboardNode>();\n for (const tpl of ast.templates) {\n tplMap.set((tpl.raw as CustomTemplate).name, tpl);\n }\n for (const item of collection) {\n const tpl = tplMap.get(item);\n if (tpl && !selfDefined.has(item)) {\n selfDefined.add(item);\n const collectionByTpl = collect(tpl);\n if (keepDuplicates) {\n (collection as string[]).push(item);\n (collection as string[]).push(...collectionByTpl);\n } else {\n (collection as Set<string>).add(item);\n for (const i of collectionByTpl) {\n (collection as Set<string>).add(i);\n }\n }\n }\n }\n }\n } else {\n collection = collect(ast, keepDuplicates, selfDefined);\n }\n\n if (keepDuplicates) {\n const bricks: string[] = [];\n const customApis: string[] = [];\n const usedTemplates: string[] = [];\n for (const item of collection) {\n if (item.includes(\"@\")) {\n customApis.push(item);\n } else {\n if (item.includes(\"-\")) {\n (selfDefined.has(item) ? usedTemplates : bricks).push(item);\n }\n }\n }\n return { bricks, customApis, usedTemplates };\n } else {\n const bricks = new Set<string>();\n const customApis = new Set<string>();\n const usedTemplates = new Set<string>();\n for (const item of collection) {\n if (item.includes(\"@\")) {\n customApis.add(item);\n } else {\n if (item.includes(\"-\")) {\n (selfDefined.has(item) ? usedTemplates : bricks).add(item);\n }\n }\n }\n return {\n bricks: [...bricks],\n customApis: [...customApis],\n usedTemplates: [...usedTemplates],\n };\n }\n}\n\nfunction collect(\n nodeOrNodes: StoryboardNode | StoryboardNode[],\n keepDuplicates?: boolean,\n definedTemplates?: Set<string>\n): Set<string> | string[] {\n let collection: Set<string> | string[];\n let add: (item: string) => void;\n if (keepDuplicates) {\n collection = [];\n add = (item) => {\n (collection as string[]).push(item);\n };\n } else {\n collection = new Set();\n add = (item) => {\n (collection as Set<string>).add(item);\n };\n }\n\n traverse(nodeOrNodes, (node) => {\n switch (node.type) {\n case \"Brick\":\n if (node.raw.brick) {\n add(node.raw.brick);\n }\n break;\n case \"Resolvable\": {\n const useProvider = (node.raw as UseProviderResolveConf)?.useProvider;\n if (useProvider) {\n add(useProvider);\n }\n break;\n }\n case \"EventHandler\": {\n const useProvider = (node.raw as UseProviderEventHandler)?.useProvider;\n if (useProvider) {\n add(useProvider);\n }\n break;\n }\n case \"Template\":\n definedTemplates?.add((node.raw as CustomTemplate).name);\n break;\n }\n });\n\n return collection;\n}\n\nexport function collectBricksInBrickConf(brickConf: BrickConf): string[] {\n const node = parseBrick(brickConf);\n return [...collect(node)];\n}\n\nexport function collectBricksByCustomTemplates(\n customTemplates: CustomTemplate[]\n): Map<string, string[]> {\n const collectionByTpl = new Map<string, string[]>();\n const templates = parseTemplates(customTemplates);\n for (const tpl of templates) {\n const collection = collect(tpl, false);\n collectionByTpl.set((tpl.raw as CustomTemplate).name, [...collection]);\n }\n return collectionByTpl;\n}\n","import { Storyboard, BrickPackage } from \"@next-core/brick-types\";\nimport { isEmpty } from \"lodash\";\nimport * as changeCase from \"change-case\";\nimport { scanProcessorsInAny } from \"./scanProcessorsInStoryboard\";\nimport { scanStoryboard, ScanBricksOptions } from \"./scanStoryboard\";\n\ninterface DllAndDeps {\n dll: string[];\n deps: string[];\n}\n\ninterface DllAndDepsAndBricks extends DllAndDeps {\n bricks: string[];\n byProcessors: DllAndDeps;\n}\n\nexport function getDllAndDepsOfStoryboard(\n storyboard: Storyboard,\n brickPackages: BrickPackage[],\n options?: ScanBricksOptions\n): DllAndDepsAndBricks {\n const { bricks, usedTemplates } = scanStoryboard(storyboard, options);\n const customTemplates = storyboard.meta?.customTemplates;\n const processors = scanProcessorsInAny([\n storyboard.routes,\n options?.ignoreBricksInUnusedCustomTemplates\n ? customTemplates?.filter((tpl) => usedTemplates.includes(tpl.name))\n : customTemplates,\n ]);\n return {\n ...getDllAndDepsByResource(\n {\n bricks,\n processors,\n },\n brickPackages\n ),\n byProcessors: getDllAndDepsByResource({ processors }, brickPackages),\n bricks,\n };\n}\n\nfunction getBrickToPackageMap(\n brickPackages: BrickPackage[]\n): Map<string, BrickPackage> {\n if (isEmpty(brickPackages)) {\n return new Map();\n }\n\n return brickPackages.reduce((m, item) => {\n if (/^bricks\\/.*\\/dist\\/.*\\.js$/.test(item.filePath)) {\n const namespace = item.filePath.split(\"/\")[1];\n m.set(namespace, item);\n } else {\n // eslint-disable-next-line no-console\n console.error(`Unexpected brick package file path: \"${item.filePath}\"`);\n }\n\n return m;\n }, new Map());\n}\n\nexport function getDllAndDepsOfBricks(\n bricks: string[],\n brickPackages: BrickPackage[]\n): DllAndDeps {\n const dll = new Set<string>();\n const deps = new Set<string>();\n if (bricks.length > 0) {\n const brickMap = getBrickToPackageMap(brickPackages);\n bricks.forEach((brick) => {\n // ignore custom template\n // istanbul ignore else\n if (brick.includes(\".\")) {\n const namespace = brick.split(\".\")[0];\n const find = brickMap.get(namespace);\n if (find) {\n deps.add(find.filePath);\n if (find.dll) {\n for (const dllName of find.dll) {\n dll.add(dllName);\n }\n }\n } else {\n // eslint-disable-next-line no-console\n console.error(`Brick \\`${brick}\\` does not match any brick package`);\n }\n }\n });\n }\n const dllPath = window.DLL_PATH;\n return {\n dll: Array.from(dll).map((dllName) => dllPath[dllName]),\n deps: Array.from(deps),\n };\n}\n\ninterface StoryboardResource {\n bricks?: string[];\n processors?: string[];\n editorBricks?: string[];\n}\n\nexport function getDllAndDepsByResource(\n { bricks, processors, editorBricks }: StoryboardResource,\n brickPackages: BrickPackage[]\n): DllAndDeps {\n const dll = new Set<string>();\n const deps = new Set<string>();\n\n if (\n bricks?.length > 0 ||\n processors?.length > 0 ||\n editorBricks?.length > 0\n ) {\n const brickMap = getBrickToPackageMap(brickPackages);\n\n [...(bricks ?? []), ...(processors ?? [])].forEach((name) => {\n // ignore custom template\n // istanbul ignore else\n if (name.includes(\".\")) {\n let namespace = name.split(\".\")[0];\n const isProcessor = processors?.includes(name);\n\n // processor 是 camelCase 格式,转成 brick 的 param-case 格式,统一去判断\n if (isProcessor) {\n namespace = changeCase.paramCase(namespace);\n }\n const find = brickMap.get(namespace);\n if (find) {\n deps.add(find.filePath);\n\n if (find.dll) {\n for (const dllName of find.dll) {\n dll.add(dllName);\n }\n }\n } else {\n // eslint-disable-next-line no-console\n console.error(\n `${\n isProcessor ? \"Processor\" : \"Brick\"\n } \\`${name}\\` does not match any brick package`\n );\n }\n }\n });\n\n editorBricks?.forEach((editor) => {\n // ignore custom template editor\n // istanbul ignore else\n if (editor.includes(\".\")) {\n const namespace = editor.split(\".\")[0];\n const find = brickMap.get(namespace);\n // There maybe no `editorsJsFilePath`.\n if (find) {\n if (find.editorsJsFilePath) {\n deps.add(find.editorsJsFilePath);\n dll.add(\"editor-bricks-helper\");\n }\n } else {\n // eslint-disable-next-line no-console\n console.error(\n `Editor \\`${editor}\\` does not match any brick package`\n );\n }\n }\n });\n }\n\n const dllPath = window.DLL_PATH;\n return {\n dll: Array.from(dll).map((dllName) => dllPath[dllName]),\n deps: Array.from(deps),\n };\n}\n","/**\n * Tokenize input string.\n */\nfunction lexer(str) {\n var tokens = [];\n var i = 0;\n while (i < str.length) {\n var char = str[i];\n if (char === \"*\" || char === \"+\" || char === \"?\") {\n tokens.push({ type: \"MODIFIER\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"\\\\\") {\n tokens.push({ type: \"ESCAPED_CHAR\", index: i++, value: str[i++] });\n continue;\n }\n if (char === \"{\") {\n tokens.push({ type: \"OPEN\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"}\") {\n tokens.push({ type: \"CLOSE\", index: i, value: str[i++] });\n continue;\n }\n if (char === \":\") {\n var name = \"\";\n var j = i + 1;\n while (j < str.length) {\n var code = str.charCodeAt(j);\n if (\n // `0-9`\n (code >= 48 && code <= 57) ||\n // `A-Z`\n (code >= 65 && code <= 90) ||\n // `a-z`\n (code >= 97 && code <= 122) ||\n // `_`\n code === 95) {\n name += str[j++];\n continue;\n }\n break;\n }\n if (!name)\n throw new TypeError(\"Missing parameter name at \".concat(i));\n tokens.push({ type: \"NAME\", index: i, value: name });\n i = j;\n continue;\n }\n if (char === \"(\") {\n var count = 1;\n var pattern = \"\";\n var j = i + 1;\n if (str[j] === \"?\") {\n throw new TypeError(\"Pattern cannot start with \\\"?\\\" at \".concat(j));\n }\n while (j < str.length) {\n if (str[j] === \"\\\\\") {\n pattern += str[j++] + str[j++];\n continue;\n }\n if (str[j] === \")\") {\n count--;\n if (count === 0) {\n j++;\n break;\n }\n }\n else if (str[j] === \"(\") {\n count++;\n if (str[j + 1] !== \"?\") {\n throw new TypeError(\"Capturing groups are not allowed at \".concat(j));\n }\n }\n pattern += str[j++];\n }\n if (count)\n throw new TypeError(\"Unbalanced pattern at \".concat(i));\n if (!pattern)\n throw new TypeError(\"Missing pattern at \".concat(i));\n tokens.push({ type: \"PATTERN\", index: i, value: pattern });\n i = j;\n continue;\n }\n tokens.push({ type: \"CHAR\", index: i, value: str[i++] });\n }\n tokens.push({ type: \"END\", index: i, value: \"\" });\n return tokens;\n}\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str, options) {\n if (options === void 0) { options = {}; }\n var tokens = lexer(str);\n var _a = options.prefixes, prefixes = _a === void 0 ? \"./\" : _a;\n var defaultPattern = \"[^\".concat(escapeString(options.delimiter || \"/#?\"), \"]+?\");\n var result = [];\n var key = 0;\n var i = 0;\n var path = \"\";\n var tryConsume = function (type) {\n if (i < tokens.length && tokens[i].type === type)\n return tokens[i++].value;\n };\n var mustConsume = function (type) {\n var value = tryConsume(type);\n if (value !== undefined)\n return value;\n var _a = tokens[i], nextType = _a.type, index = _a.index;\n throw new TypeError(\"Unexpected \".concat(nextType, \" at \").concat(index, \", expected \").concat(type));\n };\n var consumeText = function () {\n var result = \"\";\n var value;\n while ((value = tryConsume(\"CHAR\") || tryConsume(\"ESCAPED_CHAR\"))) {\n result += value;\n }\n return result;\n };\n while (i < tokens.length) {\n var char = tryConsume(\"CHAR\");\n var name = tryConsume(\"NAME\");\n var pattern = tryConsume(\"PATTERN\");\n if (name || pattern) {\n var prefix = char || \"\";\n if (prefixes.indexOf(prefix) === -1) {\n path += prefix;\n prefix = \"\";\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n result.push({\n name: name || key++,\n prefix: prefix,\n suffix: \"\",\n pattern: pattern || defaultPattern,\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n var value = char || tryConsume(\"ESCAPED_CHAR\");\n if (value) {\n path += value;\n continue;\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n var open = tryConsume(\"OPEN\");\n if (open) {\n var prefix = consumeText();\n var name_1 = tryConsume(\"NAME\") || \"\";\n var pattern_1 = tryConsume(\"PATTERN\") || \"\";\n var suffix = consumeText();\n mustConsume(\"CLOSE\");\n result.push({\n name: name_1 || (pattern_1 ? key++ : \"\"),\n pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1,\n prefix: prefix,\n suffix: suffix,\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n mustConsume(\"END\");\n }\n return result;\n}\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile(str, options) {\n return tokensToFunction(parse(str, options), options);\n}\n/**\n * Expose a method for transforming tokens into the path function.\n */\nexport function tokensToFunction(tokens, options) {\n if (options === void 0) { options = {}; }\n var reFlags = flags(options);\n var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;\n // Compile all the tokens into regexps.\n var matches = tokens.map(function (token) {\n if (typeof token === \"object\") {\n return new RegExp(\"^(?:\".concat(token.pattern, \")$\"), reFlags);\n }\n });\n return function (data) {\n var path = \"\";\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n var value = data ? data[token.name] : undefined;\n var optional = token.modifier === \"?\" || token.modifier === \"*\";\n var repeat = token.modifier === \"*\" || token.modifier === \"+\";\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to not repeat, but got an array\"));\n }\n if (value.length === 0) {\n if (optional)\n continue;\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to not be empty\"));\n }\n for (var j = 0; j < value.length; j++) {\n var segment = encode(value[j], token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected all \\\"\".concat(token.name, \"\\\" to match \\\"\").concat(token.pattern, \"\\\", but got \\\"\").concat(segment, \"\\\"\"));\n }\n path += token.prefix + segment + token.suffix;\n }\n continue;\n }\n if (typeof value === \"string\" || typeof value === \"number\") {\n var segment = encode(String(value), token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to match \\\"\").concat(token.pattern, \"\\\", but got \\\"\").concat(segment, \"\\\"\"));\n }\n path += token.prefix + segment + token.suffix;\n continue;\n }\n if (optional)\n continue;\n var typeOfMessage = repeat ? \"an array\" : \"a string\";\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to be \").concat(typeOfMessage));\n }\n return path;\n };\n}\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nexport function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nexport function regexpToFunction(re, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a;\n return function (pathname) {\n var m = re.exec(pathname);\n if (!m)\n return false;\n var path = m[0], index = m.index;\n var params = Object.create(null);\n var _loop_1 = function (i) {\n if (m[i] === undefined)\n return \"continue\";\n var key = keys[i - 1];\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) {\n return decode(value, key);\n });\n }\n else {\n params[key.name] = decode(m[i], key);\n }\n };\n for (var i = 1; i < m.length; i++) {\n _loop_1(i);\n }\n return { path: path, index: index, params: params };\n };\n}\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path, keys) {\n if (!keys)\n return path;\n var groupsRegex = /\\((?:\\?<(.*?)>)?(?!\\?)/g;\n var index = 0;\n var execResult = groupsRegex.exec(path.source);\n while (execResult) {\n keys.push({\n // Use parenthesized substring match if available, index otherwise\n name: execResult[1] || index++,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\",\n });\n execResult = groupsRegex.exec(path.source);\n }\n return path;\n}\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(paths, keys, options) {\n var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; });\n return new RegExp(\"(?:\".concat(parts.join(\"|\"), \")\"), flags(options));\n}\n/**\n * Create a path regexp from string input.\n */\nfunction stringToRegexp(path, keys, options) {\n return tokensToRegexp(parse(path, options), keys, options);\n}\n/**\n * Expose a function for taking tokens and returning a RegExp.\n */\nexport function tokensToRegexp(tokens, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? \"/#?\" : _e, _f = options.endsWith, endsWith = _f === void 0 ? \"\" : _f;\n var endsWithRe = \"[\".concat(escapeString(endsWith), \"]|$\");\n var delimiterRe = \"[\".concat(escapeString(delimiter), \"]\");\n var route = start ? \"^\" : \"\";\n // Iterate over the tokens and create our regexp string.\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n if (typeof token === \"string\") {\n route += escapeString(encode(token));\n }\n else {\n var prefix = escapeString(encode(token.prefix));\n var suffix = escapeString(encode(token.suffix));\n if (token.pattern) {\n if (keys)\n keys.push(token);\n if (prefix || suffix) {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n var mod = token.modifier === \"*\" ? \"?\" : \"\";\n route += \"(?:\".concat(prefix, \"((?:\").concat(token.pattern, \")(?:\").concat(suffix).concat(prefix, \"(?:\").concat(token.pattern, \"))*)\").concat(suffix, \")\").concat(mod);\n }\n else {\n route += \"(?:\".concat(prefix, \"(\").concat(token.pattern, \")\").concat(suffix, \")\").concat(token.modifier);\n }\n }\n else {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n route += \"((?:\".concat(token.pattern, \")\").concat(token.modifier, \")\");\n }\n else {\n route += \"(\".concat(token.pattern, \")\").concat(token.modifier);\n }\n }\n }\n else {\n route += \"(?:\".concat(prefix).concat(suffix, \")\").concat(token.modifier);\n }\n }\n }\n if (end) {\n if (!strict)\n route += \"\".concat(delimiterRe, \"?\");\n route += !options.endsWith ? \"$\" : \"(?=\".concat(endsWithRe, \")\");\n }\n else {\n var endToken = tokens[tokens.length - 1];\n var isEndDelimited = typeof endToken === \"string\"\n ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1\n : endToken === undefined;\n if (!strict) {\n route += \"(?:\".concat(delimiterRe, \"(?=\").concat(endsWithRe, \"))?\");\n }\n if (!isEndDelimited) {\n route += \"(?=\".concat(delimiterRe, \"|\").concat(endsWithRe, \")\");\n }\n }\n return new RegExp(route, flags(options));\n}\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n */\nexport function pathToRegexp(path, keys, options) {\n if (path instanceof RegExp)\n return regexpToRegexp(path, keys);\n if (Array.isArray(path))\n return arrayToRegexp(path, keys, options);\n return stringToRegexp(path, keys, options);\n}\n//# sourceMappingURL=index.js.map","// Ref https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/matchPath.js\nimport { pathToRegexp, Key, compile } from \"path-to-regexp\";\nimport {\n CompileResult,\n CompileOptions,\n MatchOptions,\n MatchResult,\n MatchParams,\n PluginRuntimeContext,\n} from \"@next-core/brick-types\";\n\nexport type MatchPathOptions = MatchOptions &\n CompileOptions & {\n checkIf?: (context: PluginRuntimeContext) => boolean;\n getContext?: (match: any) => PluginRuntimeContext;\n };\n\nconst cache: Map<string, Map<string, CompileResult>> = new Map();\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path: string, options: CompileOptions): CompileResult {\n const cacheKey = `${options.end}${options.strict}${options.sensitive}`;\n if (!cache.has(cacheKey)) {\n cache.set(cacheKey, new Map());\n }\n const pathCache = cache.get(cacheKey);\n\n if (pathCache.has(path)) {\n return pathCache.get(path);\n }\n\n const keys: Key[] = [];\n const regexp = pathToRegexp(path, keys, options);\n const result = { regexp, keys };\n\n if (cacheCount < cacheLimit) {\n pathCache.set(path, result);\n cacheCount++;\n }\n\n return result;\n}\n\n/**\n * Public API for matching a URL pathname to a path.\n */\nexport function matchPath(\n pathname: string,\n options: MatchPathOptions\n): MatchResult {\n const {\n path: p,\n exact = false,\n strict = false,\n sensitive = true,\n checkIf,\n getContext,\n } = options;\n\n const paths = Array.isArray(p) ? p : [p];\n\n return paths.reduce<MatchResult>((matched, path) => {\n if (matched) {\n return matched;\n }\n const { regexp, keys } = compilePath(path, {\n end: exact,\n strict,\n sensitive,\n });\n const match = regexp.exec(pathname);\n\n if (!match) {\n return null;\n }\n\n const [url, ...values] = match;\n const isExact = pathname === url;\n\n if (exact && !isExact) {\n return null;\n }\n\n const initialParams: MatchParams = {};\n const result = {\n path, // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url, // the matched portion of the URL\n isExact, // whether or not we matched exactly\n params: keys.reduce((memo, key, index) => {\n memo[key.name] = values[index];\n return memo;\n }, initialParams),\n };\n\n if (checkIf && !checkIf(getContext(result))) {\n return null;\n }\n\n return result;\n }, null);\n}\n\nexport function toPath(path: string, pathParams: Record<string, any>): string {\n return compile(path)(pathParams);\n}\n","import { get } from \"lodash\";\nimport {\n Storyboard,\n RouteConf,\n RuntimeBrickConf,\n RouteConfOfBricks,\n} from \"@next-core/brick-types\";\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nfunction restoreDynamicTemplatesInBrick(brickConf: RuntimeBrickConf): void {\n if (get(brickConf, [\"$$lifeCycle\", \"useResolves\"], []).length > 0) {\n const { $$template, $$params, $$lifeCycle } = brickConf;\n const hasIf = hasOwnProperty(brickConf, \"$$if\");\n const rawIf = brickConf.$$if;\n Object.keys(brickConf).forEach((key) => {\n delete brickConf[key as keyof RuntimeBrickConf];\n });\n Object.assign(\n brickConf,\n {\n template: $$template,\n params: $$params,\n lifeCycle: $$lifeCycle,\n },\n hasIf ? { if: rawIf } : {}\n );\n }\n if (brickConf.slots) {\n Object.values(brickConf.slots).forEach((slotConf) => {\n if (slotConf.type === \"bricks\") {\n restoreDynamicTemplatesInBricks(slotConf.bricks);\n } else {\n restoreDynamicTemplatesInRoutes(slotConf.routes);\n }\n });\n }\n}\n\nfunction restoreDynamicTemplatesInBricks(bricks: RuntimeBrickConf[]): void {\n if (Array.isArray(bricks)) {\n bricks.forEach(restoreDynamicTemplatesInBrick);\n }\n}\n\nfunction restoreDynamicTemplatesInRoutes(routes: RouteConf[]): void {\n if (Array.isArray(routes)) {\n routes.forEach((routeConf) => {\n if (routeConf.type === \"routes\") {\n restoreDynamicTemplatesInRoutes(routeConf.routes);\n } else {\n restoreDynamicTemplatesInBricks(\n (routeConf as RouteConfOfBricks).bricks\n );\n }\n const menuBrickConf = routeConf.menu;\n if (menuBrickConf && menuBrickConf.type === \"brick\") {\n restoreDynamicTemplatesInBrick(menuBrickConf);\n }\n });\n }\n}\n\nexport function restoreDynamicTemplates(storyboard: Storyboard): void {\n restoreDynamicTemplatesInRoutes(storyboard.routes);\n}\n","import { Storyboard, BrickConf } from \"@next-core/brick-types\";\nimport {\n scanStoryboard,\n collectBricksInBrickConf,\n ScanBricksOptions,\n} from \"./scanStoryboard\";\n\n/**\n * Scan bricks in storyboard.\n *\n * @param storyboard - Storyboard.\n * @param options - If options is a boolean, it means `isUniq` or `de-duplicate`.\n * @param collectionOfCustomApi - You can pass an empty array to collect custom api.\n */\nexport function scanBricksInStoryboard(\n storyboard: Storyboard,\n options: boolean | ScanBricksOptions = true\n): string[] {\n return scanStoryboard(storyboard, options).bricks;\n}\n\nexport function scanBricksInBrickConf(brickConf: BrickConf): string[] {\n const collection = collectBricksInBrickConf(brickConf);\n const result = collection.filter(\n (item) => !item.includes(\"@\") && item.includes(\"-\")\n );\n return result;\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { EstreeLiteral } from \"@next-core/cook\";\nimport { PrecookHooks } from \"./cook\";\nimport {\n visitStoryboardExpressions,\n visitStoryboardFunctions,\n} from \"./visitStoryboard\";\n\nconst PERMISSIONS = \"PERMISSIONS\";\nconst check = \"check\";\n\nexport function scanPermissionActionsInStoryboard(\n storyboard: Storyboard\n): string[] {\n const collection = new Set<string>();\n const beforeVisitPermissions = beforeVisitPermissionsFactory(collection);\n const { customTemplates, functions } = storyboard.meta ?? {};\n visitStoryboardExpressions(\n [storyboard.routes, customTemplates],\n beforeVisitPermissions,\n PERMISSIONS\n );\n visitStoryboardFunctions(functions, beforeVisitPermissions);\n return Array.from(collection);\n}\n\nexport function scanPermissionActionsInAny(data: unknown): string[] {\n const collection = new Set<string>();\n visitStoryboardExpressions(\n data,\n beforeVisitPermissionsFactory(collection),\n PERMISSIONS\n );\n return Array.from(collection);\n}\n\nfunction beforeVisitPermissionsFactory(\n collection: Set<string>\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitPermissions(node, parent): void {\n if (node.name === PERMISSIONS) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if (\n callParent?.node.type === \"CallExpression\" &&\n callParent?.key === \"callee\" &&\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\" &&\n !memberParent.node.computed &&\n memberParent.node.property.type === \"Identifier\" &&\n memberParent.node.property.name === check\n ) {\n for (const arg of callParent.node\n .arguments as unknown as EstreeLiteral[]) {\n if (arg.type === \"Literal\" && typeof arg.value === \"string\") {\n collection.add(arg.value);\n }\n }\n }\n }\n };\n}\n","import type { Storyboard, RouteAliasMap } from \"@next-core/brick-types\";\nimport { parseRoutes, traverse } from \"@next-core/storyboard\";\n\nexport function scanRouteAliasInStoryboard(\n storyboard: Storyboard\n): RouteAliasMap {\n const collection: RouteAliasMap = new Map();\n const routes = parseRoutes(storyboard.routes, { routesOnly: true });\n\n traverse(routes, (node) => {\n if (node.type === \"Route\") {\n const alias = node.raw.alias;\n if (alias) {\n if (collection.has(alias)) {\n // eslint-disable-next-line no-console\n console.warn(`Duplicated route alias: ${alias}`);\n }\n collection.set(alias, {\n alias,\n path: node.raw.path,\n });\n }\n }\n });\n\n return collection;\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { EstreeLiteral } from \"@next-core/cook\";\nimport { PrecookHooks } from \"./cook\";\nimport {\n visitStoryboardExpressions,\n visitStoryboardFunctions,\n} from \"./visitStoryboard\";\n\nconst I18N = \"I18N\";\n\nexport function scanI18NInStoryboard(\n storyboard: Storyboard\n): Map<string, Set<string>> {\n const collection = new Map<string, Set<string>>();\n const beforeVisitI18n = beforeVisitI18nFactory(collection);\n // Notice: `menus` may contain evaluations of I18N too.\n const { customTemplates, menus, functions } = storyboard.meta ?? {};\n visitStoryboardExpressions(\n [storyboard.routes, customTemplates, menus],\n beforeVisitI18n,\n I18N\n );\n visitStoryboardFunctions(functions, beforeVisitI18n);\n return collection;\n}\n\nexport function scanI18NInAny(data: unknown): Map<string, Set<string>> {\n const collection = new Map<string, Set<string>>();\n visitStoryboardExpressions(data, beforeVisitI18nFactory(collection), I18N);\n return collection;\n}\n\nfunction beforeVisitI18nFactory(\n collection: Map<string, Set<string>>\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitI18n(node, parent): void {\n if (node.name === I18N) {\n const callParent = parent[parent.length - 1];\n if (\n callParent?.node.type === \"CallExpression\" &&\n callParent.key === \"callee\"\n ) {\n const [keyNode, defaultNode] = callParent.node\n .arguments as unknown as EstreeLiteral[];\n if (\n keyNode &&\n keyNode.type === \"Literal\" &&\n typeof keyNode.value === \"string\"\n ) {\n let valueSet = collection.get(keyNode.value);\n if (!valueSet) {\n valueSet = new Set();\n collection.set(keyNode.value, valueSet);\n }\n if (\n defaultNode &&\n defaultNode.type === \"Literal\" &&\n typeof defaultNode.value === \"string\"\n ) {\n valueSet.add(defaultNode.value);\n }\n }\n }\n }\n };\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { PrecookHooks } from \"./cook\";\nimport {\n visitStoryboardExpressions,\n visitStoryboardFunctions,\n} from \"./visitStoryboard\";\nimport { EstreeLiteral } from \"./cook\";\n\nconst APP = \"APP\";\nconst GET_MENUS = \"getMenu\";\n\nexport function scanAppGetMenuInStoryboard(storyboard: Storyboard): string[] {\n const collection = new Set<string>();\n const beforeVisitPermissions = beforeVisitAppFactory(collection);\n const { customTemplates, functions } = storyboard.meta ?? {};\n visitStoryboardExpressions(\n [storyboard.routes, customTemplates],\n beforeVisitPermissions,\n APP\n );\n visitStoryboardFunctions(functions, beforeVisitPermissions);\n return Array.from(collection);\n}\n\nexport function scanAppGetMenuInAny(data: unknown): string[] {\n const collection = new Set<string>();\n visitStoryboardExpressions(data, beforeVisitAppFactory(collection), APP);\n return Array.from(collection);\n}\n\nfunction beforeVisitAppFactory(\n collection: Set<string>\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitAPP(node, parent): void {\n if (node.name === APP) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if (\n callParent?.node.type === \"CallExpression\" &&\n callParent?.key === \"callee\" &&\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\" &&\n !memberParent.node.computed &&\n memberParent.node.property.type === \"Identifier\" &&\n memberParent.node.property.name === GET_MENUS\n ) {\n if (callParent.node.arguments.length === 1) {\n const menuId = (\n callParent.node.arguments as unknown as EstreeLiteral[]\n )[0];\n if (menuId.type === \"Literal\" && typeof menuId.value === \"string\") {\n collection.add(menuId.value);\n }\n }\n }\n }\n };\n}\n","import { Node, SourceLocation, PipeCall } from \"@next-core/pipes\";\n\nexport enum LexicalStatus {\n Initial,\n ExpectField,\n ExpectOptionalBeginDefault,\n ExpectDefaultValue,\n ExpectOptionalBeginPipe,\n ExpectPipeIdentifier,\n ExpectOptionalBeginPipeParameter,\n ExpectPipeParameter,\n ExpectPlaceholderEnd,\n}\n\nexport enum TokenType {\n Raw = \"Raw\",\n BeginPlaceHolder = \"BeginPlaceHolder\",\n Field = \"Field\",\n BeginDefault = \"BeginDefault\",\n LiteralString = \"LiteralString\",\n BeginPipe = \"BeginPipe\",\n PipeIdentifier = \"PipeIdentifier\",\n BeginPipeParameter = \"BeginPipeParameter\",\n EndPlaceHolder = \"EndPlaceHolder\",\n JsonValue = \"JsonValue\",\n}\n\nexport enum JsonValueType {\n Array,\n Object,\n String,\n Others,\n}\n\nexport interface LexicalContext {\n beginPlaceholder: RegExp;\n raw: string;\n cursor: number;\n status: LexicalStatus;\n tokens: Token[];\n}\n\nexport interface Token {\n type: TokenType;\n value?: any;\n loc?: SourceLocation;\n}\n\nexport interface InjectableString extends Node {\n type: \"InjectableString\";\n elements: (RawString | Placeholder)[];\n}\n\nexport interface RawString extends Node {\n type: \"RawString\";\n value: string;\n}\n\nexport interface Placeholder extends Node {\n type: \"Placeholder\";\n symbol: string;\n field: string;\n defaultValue: any;\n pipes: PipeCall[];\n}\n","import { escapeRegExp } from \"lodash\";\nimport {\n LexicalContext,\n LexicalStatus,\n Token,\n TokenType,\n JsonValueType,\n} from \"./interfaces\";\n\nexport function getRegExpOfPlaceholder(symbols: string | string[]): RegExp {\n return new RegExp(\n `(${([] as string[])\n .concat(symbols)\n .map((symbol) => escapeRegExp(symbol))\n .join(\"|\")})\\\\{`\n );\n}\n\nexport function tokenize(raw: string, symbols: string | string[]): Token[] {\n const context: LexicalContext = {\n beginPlaceholder: getRegExpOfPlaceholder(symbols),\n raw,\n cursor: 0,\n status: LexicalStatus.Initial,\n tokens: [],\n };\n while (context.cursor < raw.length) {\n switch (context.status) {\n case LexicalStatus.Initial:\n eatOptionalRawAndOptionalPlaceholderBegin(context);\n break;\n case LexicalStatus.ExpectField:\n eatWhitespace(context);\n eatField(context);\n break;\n case LexicalStatus.ExpectOptionalBeginDefault:\n eatWhitespace(context);\n eatOptionalDefault(context);\n break;\n case LexicalStatus.ExpectDefaultValue:\n eatWhitespace(context);\n eatDefaultValue(context);\n break;\n case LexicalStatus.ExpectOptionalBeginPipe:\n eatWhitespace(context);\n eatOptionalBeginPipe(context);\n break;\n case LexicalStatus.ExpectPipeIdentifier:\n eatWhitespace(context);\n eatPipeIdentifier(context);\n break;\n case LexicalStatus.ExpectOptionalBeginPipeParameter:\n eatWhitespace(context);\n eatOptionalBeginPipeParameter(context);\n break;\n case LexicalStatus.ExpectPipeParameter:\n eatWhitespace(context);\n eatPipeParameter(context);\n break;\n case LexicalStatus.ExpectPlaceholderEnd:\n eatWhitespace(context);\n eatPlaceholderEnd(context);\n break;\n }\n }\n if (context.status !== LexicalStatus.Initial) {\n throw new Error(\"Expected a placeholder end '}' at the end\");\n }\n return context.tokens;\n}\n\nfunction eatOptionalRawAndOptionalPlaceholderBegin(\n context: LexicalContext\n): void {\n const subRaw = getSubRaw(context);\n const matchedPlaceholder = subRaw.match(context.beginPlaceholder)?.[0];\n const subCursor = matchedPlaceholder\n ? subRaw.indexOf(matchedPlaceholder)\n : -1;\n if (\n subCursor >= 0 &&\n subRaw.charAt(subCursor + matchedPlaceholder.length) !== \"{\"\n ) {\n const nextCursor = context.cursor + subCursor;\n if (subCursor > 0) {\n context.tokens.push({\n type: TokenType.Raw,\n value: subRaw.substring(0, subCursor),\n });\n }\n context.tokens.push({\n type: TokenType.BeginPlaceHolder,\n loc: {\n start: nextCursor,\n end: nextCursor + matchedPlaceholder.length,\n },\n value: matchedPlaceholder.substring(0, matchedPlaceholder.length - 1),\n });\n context.cursor += subCursor + matchedPlaceholder.length;\n context.status = LexicalStatus.ExpectField;\n } else {\n context.tokens.push({\n type: TokenType.Raw,\n value: subRaw,\n });\n context.cursor = context.raw.length;\n }\n}\n\nfunction eatWhitespace(context: LexicalContext): void {\n context.cursor += getSubRaw(context).match(/^[ \\r\\n\\t]*/)[0].length;\n}\n\nfunction eatField(context: LexicalContext): void {\n // Only allow alphanumeric, `_`, `.`, `*`, `[`, `]`, `-` and other non-ascii.\n const [value] = getSubRaw(context).match(/^[\\w.*[\\]\\-\\u{80}-\\u{10FFFF}]*/u);\n context.tokens.push({\n type: TokenType.Field,\n value,\n });\n context.cursor += value.length;\n context.status = LexicalStatus.ExpectOptionalBeginDefault;\n}\n\nfunction eatOptionalDefault(context: LexicalContext): void {\n if (getSubRaw(context).charAt(0) === \"=\") {\n context.tokens.push({\n type: TokenType.BeginDefault,\n });\n context.cursor += 1;\n context.status = LexicalStatus.ExpectDefaultValue;\n } else {\n context.status = LexicalStatus.ExpectOptionalBeginPipe;\n }\n}\n\nfunction eatDefaultValue(context: LexicalContext): void {\n eatJsonValueOrLiteralString(context, LexicalStatus.ExpectOptionalBeginPipe);\n}\n\nfunction eatOptionalBeginPipe(context: LexicalContext): void {\n if (getSubRaw(context).charAt(0) === \"|\") {\n context.tokens.push({\n type: TokenType.BeginPipe,\n });\n context.cursor += 1;\n context.status = LexicalStatus.ExpectPipeIdentifier;\n } else {\n context.status = LexicalStatus.ExpectPlaceholderEnd;\n }\n}\n\nfunction eatPipeIdentifier(context: LexicalContext): void {\n const matches = getSubRaw(context).match(/^[a-zA-Z]\\w*/);\n if (!matches) {\n throw new Error(\n `Expected a pipe identifier at index ${\n context.cursor\n } near: ${JSON.stringify(context.raw.substring(context.cursor))}`\n );\n }\n const value = matches[0];\n context.tokens.push({\n type: TokenType.PipeIdentifier,\n value,\n });\n context.cursor += value.length;\n context.status = LexicalStatus.ExpectOptionalBeginPipeParameter;\n}\n\nfunction eatOptionalBeginPipeParameter(context: LexicalContext): void {\n if (getSubRaw(context).charAt(0) === \":\") {\n context.tokens.push({\n type: TokenType.BeginPipeParameter,\n });\n context.cursor += 1;\n context.status = LexicalStatus.ExpectPipeParameter;\n } else {\n context.status = LexicalStatus.ExpectOptionalBeginPipe;\n }\n}\n\nfunction eatPipeParameter(context: LexicalContext): void {\n eatJsonValueOrLiteralString(\n context,\n LexicalStatus.ExpectOptionalBeginPipeParameter\n );\n}\n\nfunction eatPlaceholderEnd(context: LexicalContext): void {\n if (getSubRaw(context).charAt(0) === \"}\") {\n context.tokens.push({\n type: TokenType.EndPlaceHolder,\n loc: {\n start: context.cursor,\n end: context.cursor + 1,\n },\n });\n context.cursor += 1;\n context.status = LexicalStatus.Initial;\n } else {\n throw new Error(\n `Expected a placeholder end '}' at index ${\n context.cursor\n } near: ${JSON.stringify(context.raw.substring(context.cursor))}`\n );\n }\n}\n\nconst jsonLiteralMap = new Map([\n [\"false\", false],\n [\"null\", null],\n [\"true\", true],\n]);\n\nfunction eatJsonValueOrLiteralString(\n context: LexicalContext,\n nextStatus: LexicalStatus\n): void {\n const subRaw = getSubRaw(context);\n if (\n /[0-9[{\"]/.test(subRaw.charAt(0)) ||\n /-[0-9]/.test(subRaw.substring(0, 2))\n ) {\n eatJsonValue(context, nextStatus);\n } else {\n // Accept any characters except controls and whitespace.\n // Only allow alphanumeric, `_`, `-` and other non-ascii.\n const [value] = getSubRaw(context).match(/^[\\w\\-\\u{80}-\\u{10FFFF}]*/u);\n\n if (jsonLiteralMap.has(value)) {\n context.tokens.push({\n type: TokenType.JsonValue,\n value: jsonLiteralMap.get(value),\n });\n } else {\n context.tokens.push({\n type: TokenType.LiteralString,\n value,\n });\n }\n\n context.cursor += value.length;\n context.status = nextStatus;\n }\n}\n\n// 我们不需要非常精确地在一段字符串中匹配出一段*完整合法的* JSON value,\n// 而只需要找到一段*可能是完整合法的* JSON value 即可,解析的工作交给 `JSON.parse()`。\n// 由于 JSON 中 object/array/string 的镜像起止符特性,我们尝试去完成这些符号匹配即可。\nfunction eatJsonValue(\n context: LexicalContext,\n nextStatus: LexicalStatus\n): void {\n const subRaw = getSubRaw(context);\n const firstChar = subRaw.charAt(0);\n const valueType: JsonValueType =\n firstChar === \"[\"\n ? JsonValueType.Array\n : firstChar === \"{\"\n ? JsonValueType.Object\n : firstChar === '\"'\n ? JsonValueType.String\n : JsonValueType.Others;\n\n let subCursor = 0;\n let objectBracesToMatch = 0;\n let arrayBracketsToMatch = 0;\n let stringQuotesToClose = false;\n let stringBackslashToEscape = false;\n let matched = false;\n\n while (subCursor < subRaw.length) {\n const char = subRaw.charAt(subCursor);\n if (stringBackslashToEscape) {\n stringBackslashToEscape = false;\n } else if (stringQuotesToClose) {\n if (char === '\"') {\n stringQuotesToClose = false;\n } else if (char === \"\\\\\") {\n stringBackslashToEscape = true;\n }\n } else {\n switch (char) {\n case \"[\":\n arrayBracketsToMatch += 1;\n break;\n case \"{\":\n objectBracesToMatch += 1;\n break;\n case \"]\":\n arrayBracketsToMatch -= 1;\n break;\n case \"}\":\n objectBracesToMatch -= 1;\n break;\n case '\"':\n stringQuotesToClose = true;\n break;\n }\n }\n\n subCursor += 1;\n\n switch (valueType) {\n case JsonValueType.Array:\n matched = !arrayBracketsToMatch;\n break;\n case JsonValueType.Object:\n matched = !objectBracesToMatch;\n break;\n case JsonValueType.String:\n matched = !stringQuotesToClose;\n break;\n default:\n // 对于其它类型,如果下一个字符不再是这些值类型可能的字符时,我们认为 JSON value 完成匹配。\n // 其它可能的值类型:number/boolean/null/undefined。\n matched =\n subCursor < subRaw.length &&\n /[^a-z0-9E.+-]/.test(subRaw.charAt(subCursor));\n }\n\n if (matched) {\n break;\n }\n }\n\n if (!matched) {\n throw new Error(\n `Failed to match a JSON value at index ${\n context.cursor\n } near: ${JSON.stringify(context.raw.substring(context.cursor))}`\n );\n }\n\n context.tokens.push({\n type: TokenType.JsonValue,\n value: JSON.parse(subRaw.substring(0, subCursor)),\n });\n context.cursor += subCursor;\n context.status = nextStatus;\n}\n\nfunction getSubRaw(context: LexicalContext): string {\n return context.raw.substring(context.cursor);\n}\n","import { PipeCall } from \"@next-core/pipes\";\nimport { tokenize } from \"./lexical\";\nimport { Token, TokenType, InjectableString, Placeholder } from \"./interfaces\";\n\nexport function parseInjectableString(\n raw: string,\n symbols: string | string[]\n): InjectableString {\n return parseTokens(tokenize(raw, symbols));\n}\n\nfunction parseTokens(tokens: Token[]): InjectableString {\n const tree: InjectableString = {\n type: \"InjectableString\",\n elements: [],\n };\n\n let token: Token;\n\n function optionalToken(type: TokenType): boolean {\n if (type === tokens[0].type) {\n token = tokens.shift();\n return true;\n }\n return false;\n }\n\n function acceptToken(type: TokenType | TokenType[]): void {\n token = tokens.shift();\n if (\n Array.isArray(type) ? !type.includes(token.type) : type !== token.type\n ) {\n throw new Error(`Expected token: ${type}, received token: ${token.type}`);\n }\n }\n\n while (tokens.length > 0) {\n if (optionalToken(TokenType.Raw)) {\n tree.elements.push({\n type: \"RawString\",\n value: token.value,\n });\n } else {\n acceptToken(TokenType.BeginPlaceHolder);\n const start = token.loc.start;\n const symbol = token.value;\n acceptToken(TokenType.Field);\n\n const placeholder: Placeholder = {\n type: \"Placeholder\",\n symbol,\n field: token.value,\n defaultValue: undefined,\n pipes: [],\n loc: {\n start,\n end: start,\n },\n };\n tree.elements.push(placeholder);\n\n if (optionalToken(TokenType.BeginDefault)) {\n acceptToken([TokenType.JsonValue, TokenType.LiteralString]);\n placeholder.defaultValue = token.value;\n }\n\n while (optionalToken(TokenType.BeginPipe)) {\n acceptToken(TokenType.PipeIdentifier);\n const pipe: PipeCall = {\n type: \"PipeCall\",\n identifier: token.value,\n parameters: [],\n };\n placeholder.pipes.push(pipe);\n\n while (optionalToken(TokenType.BeginPipeParameter)) {\n acceptToken([TokenType.JsonValue, TokenType.LiteralString]);\n pipe.parameters.push(token.value);\n }\n }\n\n acceptToken(TokenType.EndPlaceHolder);\n placeholder.loc.end = token.loc.end;\n }\n }\n\n return tree;\n}\n","import { get } from \"lodash\";\nimport {\n PluginRuntimeContext,\n StoryboardContextItem,\n} from \"@next-core/brick-types\";\nimport { processPipes } from \"@next-core/pipes\";\nimport { parseInjectableString } from \"./syntax\";\nimport { Placeholder } from \"./interfaces\";\nimport { getRegExpOfPlaceholder } from \"./lexical\";\n\nexport function transform(raw: string, data: any): any {\n return compile(raw, \"@\", data);\n}\n\nexport function inject(raw: string, context: PluginRuntimeContext): any {\n return compile(raw, \"$\", undefined, context);\n}\n\nexport function transformAndInject(\n raw: string,\n data: any,\n context: PluginRuntimeContext\n): any {\n return compile(raw, [\"@\", \"$\"], data, context);\n}\n\ntype CompileNode = (node: Placeholder) => any;\n\nfunction compile(\n raw: string,\n symbols: string | string[],\n data?: any,\n context?: PluginRuntimeContext\n): any {\n // const symbols = [\"@\", \"$\"];\n if (!isInjectable(raw, symbols)) {\n return raw;\n }\n\n const transformNode = transformNodeFactory(data);\n const injectNode = injectNodeFactory(context, raw);\n\n const tree = parseInjectableString(raw, symbols);\n const values = tree.elements.map((node) =>\n node.type === \"RawString\"\n ? node.value\n : node.symbol === \"$\"\n ? injectNode(node)\n : transformNode(node)\n );\n\n return reduceCompiledValues(values);\n}\n\nfunction reduceCompiledValues(values: any[]): any {\n // If the whole string is a placeholder, we should keep the original value.\n if (values.length === 1) {\n return values[0];\n }\n\n // If an element is `undefined`, `null` or an empty array `[]`, it is converted to an empty string.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join#Description\n return values.join(\"\");\n}\n\nfunction isInjectable(raw: string, symbols?: string | string[]): boolean {\n return getRegExpOfPlaceholder(symbols).test(raw);\n}\n\nfunction transformNodeFactory(data: any): CompileNode {\n return function transformNode(node: Placeholder): any {\n // If meet `@{}`, return `data`.\n let result = node.field ? get(data, node.field) : data;\n\n if (result === undefined) {\n result = node.defaultValue;\n }\n\n return processPipes(result, node.pipes);\n };\n}\n\nfunction injectNodeFactory(\n context: PluginRuntimeContext,\n raw: string\n): CompileNode {\n return function injectNode(node: Placeholder): any {\n const matches = node.field.match(\n /^(?:(QUERY(?:_ARRAY)?|EVENT|query|event|APP|HASH|ANCHOR|SYS|FLAGS|CTX)\\.)?(.+)$/\n );\n if (!matches) {\n // Keep the original raw partial when meet a unknown namespace.\n return raw.substring(node.loc.start, node.loc.end);\n }\n let [_full, namespace, subField] = matches;\n\n // Support namespace with no subfield such as `${ANCHOR}`.\n // But distinguish with match params. E.g. `${query}` is a match param.\n if (!namespace && /^[A-Z_]+$/.test(subField)) {\n namespace = subField;\n subField = \"*\";\n }\n\n let result;\n let anchor: string;\n const SimpleContextMap: Record<string, \"hash\" | \"sys\" | \"flags\"> = {\n HASH: \"hash\",\n SYS: \"sys\",\n FLAGS: \"flags\",\n };\n let contextItem: StoryboardContextItem;\n\n switch (namespace) {\n case \"QUERY\":\n case \"query\":\n if (subField === \"*\") {\n result = context.query;\n } else {\n result = context.query.has(subField)\n ? context.query.get(subField)\n : undefined;\n }\n break;\n case \"QUERY_ARRAY\":\n result = context.query.has(subField)\n ? context.query.getAll(subField)\n : undefined;\n break;\n case \"EVENT\":\n case \"event\":\n if (context.event === undefined) {\n // Keep the original raw partial when meet a `${EVENT}` in non-event context.\n return raw.substring(node.loc.start, node.loc.end);\n }\n result =\n subField === \"*\" ? context.event : get(context.event, subField);\n break;\n case \"APP\":\n result =\n subField === \"*\"\n ? context.overrideApp ?? context.app\n : get(context.overrideApp ?? context.app, subField);\n break;\n case \"HASH\":\n case \"SYS\":\n case \"FLAGS\":\n result =\n subField === \"*\"\n ? context[SimpleContextMap[namespace]]\n : get(context[SimpleContextMap[namespace]], subField);\n break;\n case \"ANCHOR\":\n anchor = context.hash ? context.hash.substr(1) : null;\n result = subField === \"*\" ? anchor : get(anchor, subField);\n break;\n case \"CTX\":\n contextItem = context.storyboardContext?.get(subField);\n if (contextItem) {\n result =\n contextItem.type === \"brick-property\"\n ? contextItem.brick.element?.[\n contextItem.prop as keyof HTMLElement\n ]\n : contextItem.value;\n }\n break;\n default:\n if (context.match) {\n result = context.match.params[subField];\n } else {\n // If the context is empty, return the original raw partial.\n return raw.substring(node.loc.start, node.loc.end);\n }\n }\n\n if (result === undefined) {\n result = node.defaultValue;\n }\n\n return processPipes(result, node.pipes);\n };\n}\n","import { utils } from \"@next-core/pipes\";\nexport { pipes } from \"@next-core/pipes\";\n\nexport { inject, transform, transformAndInject } from \"./compile\";\n\n// Keep compatibility of these exposed APIs.\nexport const {\n formatUnitValue: formatValue,\n convertUnitValueByPrecision: convertValueByPrecision,\n} = utils;\n","import { ContextConf } from \"@next-core/brick-types\";\nimport { PrecookHooks } from \"./cook\";\nimport { visitStoryboardExpressions } from \"./visitStoryboard\";\n\nexport async function resolveContextConcurrently(\n contextConfs: ContextConf[],\n resolveContext: (contextConf: ContextConf) => Promise<boolean>,\n keyword = \"CTX\"\n): Promise<void> {\n const dependencyMap = getDependencyMapOfContext(contextConfs, keyword);\n const pendingDeps = new Set<string>(\n Array.from(dependencyMap.keys()).map((contextConf) => contextConf.name)\n );\n const includesComputed = Array.from(dependencyMap.values()).some(\n (stats) => stats.includesComputed\n );\n const processed = new WeakSet<ContextConf>();\n\n const wrapResolve = async (contextConf: ContextConf): Promise<void> => {\n processed.add(contextConf);\n const resolved = await resolveContext(contextConf);\n dependencyMap.delete(contextConf);\n if (resolved) {\n if (!pendingDeps.delete(contextConf.name)) {\n throw new Error(`Duplicated context defined: ${contextConf.name}`);\n }\n }\n await scheduleNext();\n };\n\n let scheduleAsSerial = includesComputed;\n\n async function scheduleNext(): Promise<void> {\n const readyContexts = Array.from(dependencyMap.entries())\n .filter(predicateNextResolveFactory(pendingDeps, scheduleAsSerial))\n .map((entry) => entry[0])\n .filter((contextConf) => !processed.has(contextConf));\n await Promise.all(readyContexts.map(wrapResolve));\n }\n\n await scheduleNext();\n\n // If there are still contexts left, it implies one of these situations:\n // - Circular contexts.\n // Such as: a depends on b, while b depends on a.\n // - Related contexts are all ignored.\n // Such as: a depends on b,\n // while both them are ignore by a falsy result of `if`.\n if (dependencyMap.size > 0) {\n // This will throw if circular contexts detected.\n detectCircularContexts(dependencyMap, keyword);\n scheduleAsSerial = true;\n await scheduleNext();\n }\n}\n\nexport function syncResolveContextConcurrently(\n contextConfs: ContextConf[],\n resolveContext: (contextConf: ContextConf) => boolean,\n keyword = \"CTX\"\n): void {\n const dependencyMap = getDependencyMapOfContext(contextConfs, keyword);\n const pendingDeps = new Set<string>(\n Array.from(dependencyMap.keys()).map((contextConf) => contextConf.name)\n );\n const includesComputed = Array.from(dependencyMap.values()).some(\n (stats) => stats.includesComputed\n );\n\n let scheduleAsSerial = includesComputed;\n\n function scheduleNext(): void {\n const dep = Array.from(dependencyMap.entries()).find(\n predicateNextResolveFactory(pendingDeps, scheduleAsSerial)\n );\n if (dep) {\n const [contextConf] = dep;\n const resolved = resolveContext(contextConf);\n dependencyMap.delete(contextConf);\n if (resolved) {\n if (!pendingDeps.delete(contextConf.name)) {\n throw new Error(`Duplicated context defined: ${contextConf.name}`);\n }\n }\n scheduleNext();\n }\n }\n\n scheduleNext();\n\n // If there are still contexts left, it implies one of these situations:\n // - Circular contexts.\n // Such as: a depends on b, while b depends on a.\n // - Related contexts are all ignored.\n // Such as: a depends on b,\n // while both them are ignore by a falsy result of `if`.\n if (dependencyMap.size > 0) {\n // This will throw if circular contexts detected.\n detectCircularContexts(dependencyMap, keyword);\n scheduleAsSerial = true;\n scheduleNext();\n }\n}\n\nfunction predicateNextResolveFactory(\n pendingDeps: Set<string>,\n scheduleAsSerial: boolean\n): (entry: [ContextConf, ContextStatistics], index: number) => boolean {\n return (entry, index) =>\n // When contexts contain computed CTX accesses, it implies a dynamic dependency map.\n // So make them process sequentially, keep the same behavior as before.\n scheduleAsSerial\n ? index === 0\n : // A context is ready when it has no pending dependencies.\n !entry[1].dependencies.some((dep) => pendingDeps.has(dep));\n}\n\ninterface ContextStatistics {\n dependencies: string[];\n includesComputed: boolean;\n}\n\nexport function getDependencyMapOfContext(\n contextConfs: ContextConf[],\n keyword = \"CTX\"\n): Map<ContextConf, ContextStatistics> {\n const depsMap = new Map<ContextConf, ContextStatistics>();\n for (const contextConf of contextConfs) {\n const stats: ContextStatistics = {\n dependencies: [],\n includesComputed: false,\n };\n if (!contextConf.property) {\n visitStoryboardExpressions(\n [contextConf.if, contextConf.value, contextConf.resolve],\n beforeVisitContextFactory(stats, keyword),\n keyword\n );\n }\n depsMap.set(contextConf, stats);\n }\n return depsMap;\n}\n\nfunction beforeVisitContextFactory(\n stats: ContextStatistics,\n keyword: string\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitContext(node, parent): void {\n if (node.name === keyword) {\n const memberParent = parent[parent.length - 1];\n if (\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\"\n ) {\n const memberNode = memberParent.node;\n let dep: string;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n dep = memberNode.property.name;\n } else if (\n memberNode.computed &&\n (memberNode.property as any).type === \"Literal\" &&\n typeof (memberNode.property as any).value === \"string\"\n ) {\n dep = (memberNode.property as any).value;\n } else {\n stats.includesComputed = true;\n }\n if (dep !== undefined && !stats.dependencies.includes(dep)) {\n stats.dependencies.push(dep);\n }\n }\n }\n };\n}\n\nfunction detectCircularContexts(\n dependencyMap: Map<ContextConf, ContextStatistics>,\n keyword: string\n): void {\n const duplicatedMap = new Map(dependencyMap);\n const pendingDeps = new Set<string>(\n Array.from(duplicatedMap.keys()).map((contextConf) => contextConf.name)\n );\n const next = (): void => {\n let processedAtLeastOne = false;\n for (const [contextConf, stats] of duplicatedMap.entries()) {\n if (!stats.dependencies.some((dep) => pendingDeps.has(dep))) {\n duplicatedMap.delete(contextConf);\n pendingDeps.delete(contextConf.name);\n processedAtLeastOne = true;\n }\n }\n if (processedAtLeastOne) {\n next();\n }\n };\n next();\n\n if (duplicatedMap.size > 0) {\n throw new ReferenceError(\n `Circular ${keyword} detected: ${Array.from(duplicatedMap.keys())\n .map((contextConf) => contextConf.name)\n .join(\", \")}`\n );\n }\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { scanStoryboard, ScanBricksOptions } from \"./scanStoryboard\";\n\nexport interface CustomApiInfo {\n name: string;\n namespace: string;\n}\n\nexport function scanCustomApisInStoryboard(\n storyboard: Storyboard,\n options: boolean | ScanBricksOptions = true\n): string[] {\n return scanStoryboard(storyboard, options).customApis;\n}\n\nexport function mapCustomApisToNameAndNamespace(\n customApis: string[]\n): CustomApiInfo[] {\n return customApis.map((v) => {\n const [namespace, name] = v.split(\"@\");\n return {\n namespace,\n name,\n };\n });\n}\n","import { isEvaluable } from \"./cook\";\nimport { scanI18NInAny } from \"./scanI18NInStoryboard\";\n\n/**\n * Get smart display for a string property, which may be an evaluation.\n *\n * This is useful for brick editors to display specific property configurations.\n *\n * E.g., for a button brick editor, display it by\n * `smartDisplayForEvaluableString(btn.$$parsedProperties.buttonName, btn.alias, \"<% … %>\")`.\n *\n * @param rawString - Raw string value.\n * @param nonStringFallback - Fallback value if it's not a string.\n * @param unknownEvaluationFallback - Fallback value if it's an unknown evaluation.\n *\n * @returns\n *\n * Returns the nonStringFallback if the input is not a string and nonStringFallback presents.\n *\n * Or returns the raw input when nonStringFallback no presents.\n *\n * Returns the I18N default value (or key if no value found)\n * if it is an evaluation and contains one and only one I18N key.\n *\n * Or returns the unknownEvaluationFallback if it is an unknown evaluation string and\n * unknownEvaluationFallback presents.\n *\n * Or returns the raw input otherwise.\n */\nexport function smartDisplayForEvaluableString<T, U, V>(\n rawString: T,\n nonStringFallback?: U,\n unknownEvaluationFallback?: V\n): T | U | V | string {\n if (typeof rawString !== \"string\") {\n // Catch on `undefined` or `null`.\n if (nonStringFallback != undefined) {\n return nonStringFallback;\n }\n return rawString;\n }\n if (isEvaluable(rawString)) {\n const i18nData = scanI18NInAny(rawString);\n if (i18nData.size === 1) {\n const key = i18nData.keys().next().value as string;\n const valueSet = i18nData.get(key);\n return valueSet.size > 0\n ? (valueSet.values().next().value as string)\n : key;\n }\n // Catch on `undefined` or `null`.\n if (unknownEvaluationFallback != undefined) {\n return unknownEvaluationFallback;\n }\n }\n return rawString;\n}\n","// This is copied from\n// [@next-libs/storage](https://github.com/easyops-cn/next-libs/tree/master/libs/storage),\n// and the types is refined.\n// The usage of JsonStorage from @next-libs/storage should be deprecated,\n// and migrated to from @next-core/brick-utils.\nexport class JsonStorage<U = Record<string, unknown>> {\n constructor(\n private storage: Storage,\n private prefix: string = \"brick-next-\"\n ) {}\n\n setItem<T extends string & keyof U>(name: T, value: U[T]): void {\n this.storage.setItem(this.prefix + name, JSON.stringify(value));\n }\n\n getItem<T extends string & keyof U>(name: T): U[T] {\n return JSON.parse(this.storage.getItem(this.prefix + name)) as U[T];\n }\n\n removeItem<T extends string & keyof U>(name: T): void {\n return this.storage.removeItem(this.prefix + name);\n }\n\n clear(): void {\n return this.storage.clear();\n }\n}\n","import {\n BuilderBrickNode,\n BuilderCustomTemplateNode,\n BuilderRouteNode,\n BuilderRouteOrBrickNode,\n BuilderSnippetNode,\n} from \"@next-core/brick-types\";\n\nexport function isRouteNode(\n node: BuilderRouteOrBrickNode\n): node is BuilderRouteNode {\n switch (node.type) {\n case \"bricks\":\n case \"routes\":\n case \"redirect\":\n return true;\n default:\n return false;\n }\n}\n\nexport function isBrickNode(\n node: BuilderRouteOrBrickNode\n): node is BuilderBrickNode {\n switch (node.type) {\n case \"brick\":\n case \"provider\":\n case \"template\":\n return true;\n default:\n return false;\n }\n}\n\nexport function isCustomTemplateNode(\n node: BuilderRouteOrBrickNode\n): node is BuilderCustomTemplateNode {\n return node.type === \"custom-template\";\n}\n\nexport function isSnippetNode(\n node: BuilderRouteOrBrickNode\n): node is BuilderSnippetNode {\n return node.type === \"snippet\";\n}\n","import yaml from \"js-yaml\";\nimport { cloneDeep } from \"lodash\";\nimport {\n BrickConf,\n BuilderBrickNode,\n BuilderCustomTemplateNode,\n BuilderRouteNode,\n BuilderRouteOrBrickNode,\n BuilderSnippetNode,\n RouteConf,\n SeguesConf,\n} from \"@next-core/brick-types\";\nimport { isBrickNode, isRouteNode } from \"./assertions\";\n\nconst jsonFieldsInRoute = [\n \"menu\",\n \"providers\",\n \"segues\",\n \"defineResolves\",\n \"redirect\",\n \"analyticsData\",\n];\n\n// Fields stored as yaml string will be parsed when build & push.\nconst yamlFieldsInRoute = [\"permissionsPreCheck\", \"if\"];\n\nconst jsonFieldsInBrick = [\n \"properties\",\n \"events\",\n \"lifeCycle\",\n \"params\",\n \"if\",\n \"transform\",\n];\n\n// Fields stored as yaml string will be parsed when build & push.\nconst yamlFieldsInBrick = [\"permissionsPreCheck\", \"transformFrom\"];\n\n// Fields started with `_` will be removed by default.\nconst fieldsToRemoveInRoute = [\n \"appId\",\n \"children\",\n \"creator\",\n \"ctime\",\n \"id\",\n \"graphInfo\",\n \"modifier\",\n \"mountPoint\",\n \"mtime\",\n \"org\",\n \"parent\",\n \"sort\",\n \"name\",\n \"providersBak\",\n \"providers_bak\",\n \"previewSettings\",\n \"screenshot\",\n\n \"deleteAuthorizers\",\n \"readAuthorizers\",\n \"updateAuthorizers\",\n];\n\nconst fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat(\"type\", \"alias\");\n\n// Those fields can be disposed if value is null.\nconst disposableNullFields = [\n \"alias\",\n \"documentId\",\n \"hybrid\",\n \"bg\",\n \"context\",\n \"exports\",\n \"ref\",\n \"portal\",\n \"analyticsData\",\n];\n\nexport function normalizeBuilderNode(node: BuilderBrickNode): BrickConf;\nexport function normalizeBuilderNode(node: BuilderRouteNode): RouteConf;\nexport function normalizeBuilderNode(\n node: BuilderCustomTemplateNode | BuilderSnippetNode\n): null;\nexport function normalizeBuilderNode(\n node: BuilderRouteOrBrickNode\n): BrickConf | RouteConf | null;\nexport function normalizeBuilderNode(\n node: BuilderRouteOrBrickNode\n): BrickConf | RouteConf | null {\n if (isBrickNode(node)) {\n return normalize(\n node,\n fieldsToRemoveInBrick,\n jsonFieldsInBrick,\n yamlFieldsInBrick,\n \"brick\"\n ) as unknown as BrickConf;\n }\n if (isRouteNode(node)) {\n return normalize(\n node,\n fieldsToRemoveInRoute,\n jsonFieldsInRoute,\n yamlFieldsInRoute,\n \"route\"\n ) as unknown as RouteConf;\n }\n return null;\n}\n\nfunction normalize(\n node: BuilderRouteOrBrickNode,\n fieldsToRemove: string[],\n jsonFields: string[],\n yamlFields: string[],\n type: \"brick\" | \"route\"\n): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(node)\n // Remove unused fields from CMDB.\n // Consider fields started with `_` as unused.\n .filter(\n ([key, value]) =>\n !(\n key[0] === \"_\" ||\n fieldsToRemove.includes(key) ||\n (value === null && disposableNullFields.includes(key))\n )\n )\n // Parse specific fields.\n .map(([key, value]) => [\n key === \"instanceId\" ? \"iid\" : key,\n type === \"route\" && key === \"segues\"\n ? getCleanSegues(value as string)\n : jsonFields.includes(key)\n ? safeJsonParse(value as string)\n : yamlFields.includes(key)\n ? safeYamlParse(value as string)\n : cloneDeep(value),\n ])\n );\n}\n\n// Clear `segue._view` which is for development only.\nfunction getCleanSegues(string: string): SeguesConf {\n const segues = safeJsonParse(string);\n return (\n segues &&\n Object.fromEntries(\n Object.entries(segues).map(([id, segue]) => [\n id,\n segue && {\n target: segue.target,\n },\n ])\n )\n );\n}\n\nfunction safeJsonParse(value: string): unknown {\n if (!value) {\n return;\n }\n try {\n return JSON.parse(value);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"JSON.parse() failed\", value);\n }\n}\n\nfunction safeYamlParse(value: string): unknown {\n if (!value) {\n return;\n }\n try {\n const result = yaml.safeLoad(value, {\n schema: yaml.JSON_SCHEMA,\n json: true,\n });\n return result;\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Failed to parse yaml string\", value);\n }\n}\n","const fieldsToKeepInMenu = [\n \"menuId\",\n \"title\",\n \"icon\",\n \"titleDataSource\",\n \"defaultCollapsed\",\n \"defaultCollapsedBreakpoint\",\n \"link\",\n \"type\",\n \"injectMenuGroupId\",\n \"dynamicItems\",\n \"itemsResolve\",\n];\n\nconst fieldsToKeepInMenuItem = [\n \"text\",\n \"to\",\n \"href\",\n \"target\",\n \"icon\",\n \"exact\",\n \"key\",\n \"activeIncludes\",\n \"activeExcludes\",\n \"activeMatchSearch\",\n \"type\",\n \"sort\",\n \"defaultExpanded\",\n \"if\",\n \"groupId\",\n];\n\nexport interface MenuNode {\n items?: MenuItemNode[];\n [key: string]: unknown;\n}\n\nexport interface MenuItemNode {\n children?: MenuItemNode[];\n [key: string]: unknown;\n}\n\nexport function normalizeMenu(node: MenuNode): Record<string, unknown> {\n return {\n ...keep(node, fieldsToKeepInMenu),\n items: keepItems(node.items, fieldsToKeepInMenuItem),\n };\n}\n\nfunction keep(\n node: MenuNode | MenuItemNode,\n fieldsToKeep: string[]\n): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(node)\n // Keep certain fields from CMDB.\n .filter((item) => fieldsToKeep.includes(item[0]))\n );\n}\n\nfunction keepItems(\n nodes: MenuItemNode[],\n fieldsToKeep: string[]\n): Record<string, unknown>[] {\n return nodes?.map((node) => ({\n ...keep(node, fieldsToKeep),\n children: keepItems(node.children, fieldsToKeep),\n }));\n}\n","// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n\n/** @internal */\nexport function deepFreeze<T>(object: T): T {\n // Retrieve the property names defined on object\n const propNames = Object.getOwnPropertyNames(object);\n\n // Freeze properties before freezing self\n\n for (const name of propNames) {\n const value = (object as Record<string, unknown>)[name];\n\n if (value && typeof value === \"object\") {\n deepFreeze(value);\n }\n }\n\n return Object.freeze(object);\n}\n","import { PrecookHooks, preevaluate } from \"./cook\";\nimport { visitStoryboardExpressions } from \"./visitStoryboard\";\n\n/**\n * Get tracking CTX for an evaluable expression in `track context` mode.\n *\n * A `track context` mode is an evaluable expression which is a sequence expression\n * starting with the exact literal string expression of \"track context\".\n *\n * @param raw - A raw string, which must be checked by `isEvaluable` first.\n *\n * @returns\n *\n * Returns used CTXs if `track context` mode is enabled, or returns false if not enabled or\n * no CTX found.\n *\n * @example\n *\n * ```js\n * trackContext('<% \"track context\", [CTX.hello, CTX.world] %>');\n * // => [\"hello\", \"world\"]\n *\n * trackContext('<% [CTX.hello, CTX.world] %>');\n * // => false\n *\n * trackContext('<% \"track context\", DATA.any %>');\n * // => false\n * ```\n */\nexport function trackContext(raw: string): string[] | false {\n return track(raw, \"track context\", \"CTX\");\n}\n\nexport function trackState(raw: string): string[] | false {\n return track(raw, \"track state\", \"STATE\");\n}\n\nexport function trackFormState(raw: string): string[] | false {\n return track(raw, \"track formstate\", \"FORM_STATE\");\n}\n\nexport function trackUsedContext(data: unknown): string[] {\n return trackUsed(data, \"CTX\");\n}\n\nexport function trackUsedState(data: unknown): string[] {\n return trackUsed(data, \"STATE\");\n}\n\nfunction track(\n raw: string,\n trackText: string,\n variableName: string\n): string[] | false {\n if (raw.includes(trackText)) {\n const contexts = new Set<string>();\n const { expression } = preevaluate(raw, {\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitContextFactory(contexts, variableName),\n },\n });\n let trackCtxExp: any;\n if (\n expression.type === \"SequenceExpression\" &&\n (trackCtxExp = expression.expressions[0] as unknown) &&\n trackCtxExp.type === \"Literal\" &&\n trackCtxExp.value === trackText\n ) {\n if (contexts.size > 0) {\n return Array.from(contexts);\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n `You are using \"${trackText}\" but no \\`${variableName}\\` usage found in your expression: ${JSON.stringify(\n raw\n )}`\n );\n }\n }\n }\n return false;\n}\n\nfunction trackUsed(data: unknown, variableName: string): string[] {\n const contexts = new Set<string>();\n visitStoryboardExpressions(\n data,\n beforeVisitContextFactory(contexts, variableName),\n variableName\n );\n return Array.from(contexts);\n}\n\nfunction beforeVisitContextFactory(\n contexts: Set<string>,\n variableName: string\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitContext(node, parent): void {\n if (node.name === variableName) {\n const memberParent = parent[parent.length - 1];\n if (\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\"\n ) {\n const memberNode = memberParent.node;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n contexts.add(memberNode.property.name);\n } else if (\n memberNode.computed &&\n (memberNode.property as any).type === \"Literal\" &&\n typeof (memberNode.property as any).value === \"string\"\n ) {\n contexts.add((memberNode.property as any).value);\n }\n }\n }\n };\n}\n","import type { SimpleFunction } from \"@next-core/brick-types\";\n\n// The debounce function receives our function as a parameter\nexport function debounceByAnimationFrame<P extends unknown[]>(\n fn: SimpleFunction<P, void>\n): SimpleFunction<P, void> {\n // This holds the requestAnimationFrame reference, so we can cancel it if we wish\n let frame: number;\n\n // The debounce function returns a new function that can receive a variable number of arguments\n return (...params: P) => {\n // If the frame variable has been defined, clear it now, and queue for next frame\n if (frame) {\n cancelAnimationFrame(frame);\n }\n\n // Queue our function call for the next frame\n frame = requestAnimationFrame(() => {\n // Call our function and pass any params we received\n fn(...params);\n });\n };\n}\n","import { Storyboard } from \"@next-core/brick-types\";\nimport { EstreeLiteral } from \"@next-core/cook\";\nimport { PrecookHooks } from \"./cook\";\nimport {\n visitStoryboardExpressions,\n visitStoryboardFunctions,\n} from \"./visitStoryboard\";\n\nconst INSTALLED_APPS = \"INSTALLED_APPS\";\nconst has = \"has\";\n\nexport function scanInstalledAppsInStoryboard(\n storyboard: Storyboard\n): string[] {\n const collection = new Set<string>();\n const beforeVisitInstalledApps = beforeVisitInstalledAppsFactory(collection);\n const { customTemplates, functions, menus } = storyboard.meta ?? {};\n visitStoryboardExpressions(\n [storyboard.routes, customTemplates, menus],\n beforeVisitInstalledApps,\n INSTALLED_APPS\n );\n visitStoryboardFunctions(functions, beforeVisitInstalledApps);\n return Array.from(collection);\n}\n\nfunction beforeVisitInstalledAppsFactory(\n collection: Set<string>\n): PrecookHooks[\"beforeVisitGlobal\"] {\n return function beforeVisitPermissions(node, parent): void {\n if (node.name === INSTALLED_APPS) {\n const memberParent = parent[parent.length - 1];\n const callParent = parent[parent.length - 2];\n if (\n callParent?.node.type === \"CallExpression\" &&\n callParent?.key === \"callee\" &&\n memberParent?.node.type === \"MemberExpression\" &&\n memberParent.key === \"object\" &&\n !memberParent.node.computed &&\n memberParent.node.property.type === \"Identifier\" &&\n memberParent.node.property.name === has\n ) {\n const args = callParent.node.arguments as unknown as EstreeLiteral[];\n if (\n args.length > 0 &&\n args[0].type === \"Literal\" &&\n typeof args[0].value === \"string\"\n ) {\n collection.add(args[0].value);\n }\n }\n }\n };\n}\n","const poolMap = new Map<string, Pool<unknown, unknown>>();\n\ninterface Pool<T, S> {\n current: Queue<T, S>;\n fullIds: Map<T, Promise<S>>;\n}\n\ninterface Queue<T, S> {\n // This promise is corresponding to the aggregatedIds below.\n promise: Promise<S>;\n aggregatedIds: Set<T>;\n}\n\nexport type ThrottledAggregation<T, R> = (id: T) => Promise<R>;\n\n/**\n * Make a throttled aggregation function.\n *\n * Note: the `id` should be a primitive value, typically a string or a number.\n * If the `id` must be an array or an object, encode it in JSON.\n *\n * @param namespace Should be unique for each purpose.\n * @param request Accept ids, fire request and return the promise.\n * @param select Select the specific data for a specific id in the aggregated result.\n * @param wait Throttle wait time in milliseconds, defaults to 100.\n */\nexport function makeThrottledAggregation<T extends string | number, S, R>(\n namespace: string,\n request: (ids: T[]) => Promise<S>,\n select: (result: S, id: T) => R,\n wait = 100\n): ThrottledAggregation<T, R> {\n // Each namespace share a pool.\n let pool = poolMap.get(namespace) as Pool<T, S>;\n if (!pool) {\n pool = {\n current: null,\n fullIds: new Map(),\n };\n poolMap.set(namespace, pool);\n }\n\n function enqueue(id: T): Queue<T, S> {\n const aggregatedIds = new Set<T>();\n aggregatedIds.add(id);\n const promise = new Promise<S>((resolve, reject) => {\n setTimeout(() => {\n pool.current = null;\n request([...aggregatedIds]).then(resolve, reject);\n }, wait);\n });\n return {\n promise,\n aggregatedIds,\n };\n }\n\n return function (id: T) {\n const cached = pool.fullIds.get(id);\n if (cached) {\n return cached.then((r) => select(r, id));\n }\n if (pool.current) {\n pool.current.aggregatedIds.add(id);\n } else {\n pool.current = enqueue(id);\n }\n const { promise } = pool.current;\n pool.fullIds.set(id, promise);\n return promise.then((r) => select(r, id));\n };\n}\n","import type {\n CustomTemplateConstructor,\n FeatureFlags,\n RuntimeStoryboard,\n} from \"@next-core/brick-types\";\nimport {\n cook,\n EstreeLiteral,\n EstreeNode,\n isEvaluable,\n preevaluate,\n} from \"@next-core/cook\";\nimport { remove } from \"lodash\";\nimport { hasOwnProperty } from \"./hasOwnProperty\";\nimport {\n parseStoryboard,\n parseTemplate,\n traverse,\n type StoryboardNode,\n} from \"@next-core/storyboard\";\n\nexport interface RemoveDeadConditionsOptions {\n constantFeatureFlags?: boolean;\n featureFlags?: FeatureFlags;\n}\n\ninterface ConditionalStoryboardNode {\n raw: {\n if?: string | boolean;\n };\n}\n\n/**\n * Remove dead conditions in storyboard like `if: '<% FLAGS[\"your-feature-flag\"] %>'` when\n * `FLAGS[\"your-feature-flag\"]` is falsy.\n */\nexport function removeDeadConditions(\n storyboard: RuntimeStoryboard,\n options?: RemoveDeadConditionsOptions\n): void {\n if (storyboard.$$deadConditionsRemoved) {\n return;\n }\n const ast = parseStoryboard(storyboard);\n removeDeadConditionsByAst(ast, options);\n storyboard.$$deadConditionsRemoved = true;\n}\n\nfunction removeDeadConditionsByAst(\n ast: StoryboardNode,\n options: RemoveDeadConditionsOptions\n): void {\n // First, we mark constant conditions.\n traverse(ast, (node) => {\n switch (node.type) {\n case \"Route\":\n case \"Brick\":\n case \"EventHandler\":\n case \"Context\":\n computeConstantCondition(node.raw, options);\n break;\n case \"Resolvable\":\n if (node.isConditional) {\n computeConstantCondition(node.raw, options);\n }\n break;\n }\n });\n\n // Then, we remove dead conditions accordingly.\n traverse(ast, (node) => {\n let rawContainer: any;\n let conditionalNodes: ConditionalStoryboardNode[];\n let rawKey: string;\n let deleteEmptyArray = false;\n\n switch (node.type) {\n case \"Root\":\n conditionalNodes = node.routes;\n rawContainer = node.raw;\n rawKey = \"routes\";\n break;\n case \"Template\":\n conditionalNodes = node.bricks as ConditionalStoryboardNode[];\n rawContainer = node.raw;\n rawKey = \"bricks\";\n break;\n case \"Route\":\n case \"Slot\":\n conditionalNodes = node.children as ConditionalStoryboardNode[];\n rawContainer = node.raw;\n rawKey = node.raw.type === \"routes\" ? \"routes\" : \"bricks\";\n break;\n case \"Event\":\n case \"EventCallback\":\n case \"SimpleLifeCycle\":\n case \"ConditionalEvent\":\n conditionalNodes = node.handlers;\n rawContainer = node.rawContainer;\n rawKey = node.rawKey;\n deleteEmptyArray = true;\n break;\n case \"ResolveLifeCycle\":\n conditionalNodes = node.resolves;\n rawContainer = node.rawContainer;\n rawKey = node.rawKey;\n deleteEmptyArray = true;\n break;\n case \"UseBrickEntry\":\n conditionalNodes = node.children as ConditionalStoryboardNode[];\n rawContainer = node.rawContainer;\n rawKey = node.rawKey;\n break;\n }\n\n shakeConditionalNodes(\n node,\n rawContainer,\n conditionalNodes,\n rawKey,\n deleteEmptyArray\n );\n\n // Remove unreachable context/state.\n deleteEmptyArray = false;\n switch (node.type) {\n case \"Route\":\n case \"Brick\":\n case \"Template\":\n rawContainer = node.raw;\n rawKey = node.type === \"Template\" ? \"state\" : \"context\";\n conditionalNodes = node.context;\n break;\n }\n\n shakeConditionalNodes(\n node,\n rawContainer,\n conditionalNodes,\n rawKey,\n deleteEmptyArray\n );\n });\n}\n\nfunction shakeConditionalNodes(\n node: StoryboardNode,\n rawContainer: any,\n conditionalNodes: ConditionalStoryboardNode[],\n rawKey: string,\n deleteEmptyArray?: boolean\n): void {\n const removedNodes = remove(\n conditionalNodes,\n (node) => node.raw.if === false\n );\n if (removedNodes.length > 0) {\n if (node.type === \"UseBrickEntry\" && !Array.isArray(rawContainer[rawKey])) {\n rawContainer[rawKey] = { brick: \"div\", if: false };\n } else if (deleteEmptyArray && conditionalNodes.length === 0) {\n delete rawContainer[rawKey];\n } else {\n rawContainer[rawKey] = conditionalNodes.map((node) => node.raw);\n }\n }\n}\n\n/**\n * Like `removeDeadConditions` but applied to a custom template.\n */\nexport function removeDeadConditionsInTpl(\n tplConstructor: CustomTemplateConstructor,\n options?: RemoveDeadConditionsOptions\n): void {\n const ast = parseTemplate(tplConstructor);\n removeDeadConditionsByAst(ast, options);\n}\n\nexport interface IfContainer {\n if?: unknown;\n}\n\nexport function computeConstantCondition(\n ifContainer: IfContainer,\n options: RemoveDeadConditionsOptions = {}\n): void {\n if (hasOwnProperty(ifContainer, \"if\")) {\n if (typeof ifContainer.if === \"string\" && isEvaluable(ifContainer.if)) {\n try {\n const { expression, attemptToVisitGlobals, source } = preevaluate(\n ifContainer.if\n );\n const { constantFeatureFlags, featureFlags } = options;\n let hasDynamicVariables = false;\n for (const item of attemptToVisitGlobals) {\n if (\n item !== \"undefined\" &&\n (!constantFeatureFlags || item !== \"FLAGS\")\n ) {\n hasDynamicVariables = true;\n break;\n }\n }\n if (hasDynamicVariables) {\n if (isConstantLogical(expression, false, options)) {\n if (process.env.NODE_ENV === \"development\") {\n // eslint-disable-next-line no-console\n console.warn(\"[removed dead if]:\", ifContainer.if, ifContainer);\n }\n ifContainer.if = false;\n }\n return;\n }\n const originalIf = ifContainer.if;\n const globalVariables: Record<string, unknown> = {\n undefined: undefined,\n };\n if (constantFeatureFlags) {\n globalVariables.FLAGS = featureFlags;\n }\n ifContainer.if = !!cook(expression, source, { globalVariables });\n if (\n process.env.NODE_ENV === \"development\" &&\n ifContainer.if === false\n ) {\n // eslint-disable-next-line no-console\n console.warn(\"[removed dead if]:\", originalIf, ifContainer);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else if (!ifContainer.if && ifContainer.if !== false) {\n // eslint-disable-next-line no-console\n console.warn(\n \"[potential dead if]:\",\n typeof ifContainer.if,\n ifContainer.if,\n ifContainer\n );\n }\n }\n}\n\n/**\n * We can safely remove the code for the following use cases,\n * even though they contain runtime variables such as CTX:\n *\n * - if: '<% false && CTX.any %>'\n * - if: '<% FLAGS[\"disabled\"] && CTX.any %>'\n * - if: '<% !FLAGS[\"enabled\"] && CTX.any %>'\n * - if: '<% !(FLAGS[\"enabled\"] || CTX.any) %>'\n *\n * Since these logics will always get a falsy result.\n *\n * Here we simply only consider these kinds of AST node:\n *\n * - LogicalExpression: with operator of '||' or '&&'\n * - UnaryExpression: with operator of '!'\n * - Literal: such as boolean/number/string/null/regex\n * - MemberExpression: of 'FLAGS[\"disabled\"]' or 'FLAGS.disabled'\n * - Identifier: of 'undefined'\n */\nfunction isConstantLogical(\n node: EstreeNode,\n expect: boolean,\n options: RemoveDeadConditionsOptions\n): boolean {\n const { constantFeatureFlags, featureFlags } = options;\n return node.type === \"LogicalExpression\"\n ? node.operator === (expect ? \"||\" : \"&&\") &&\n [node.left, node.right].some((item) =>\n isConstantLogical(item, expect, options)\n )\n : node.type === \"UnaryExpression\"\n ? node.operator === \"!\" &&\n isConstantLogical(node.argument, !expect, options)\n : (node as unknown as EstreeLiteral).type === \"Literal\"\n ? !!(node as unknown as EstreeLiteral).value === expect\n : node.type === \"Identifier\"\n ? node.name === \"undefined\"\n ? !expect\n : false\n : constantFeatureFlags &&\n node.type === \"MemberExpression\" &&\n node.object.type === \"Identifier\" &&\n node.object.name === \"FLAGS\" &&\n (node.computed\n ? (node.property as unknown as EstreeLiteral).type === \"Literal\" &&\n typeof (node.property as unknown as EstreeLiteral).value ===\n \"string\" &&\n !!featureFlags[\n (node.property as unknown as EstreeLiteral).value as string\n ] === expect\n : node.property.type === \"Identifier\" &&\n !!featureFlags[node.property.name] === expect);\n}\n"],"names":["cache","Map","loadScript","src","prefix","Array","isArray","Promise","all","map","item","fixedSrc","has","get","promise","resolve","reject","end","window","dispatchEvent","CustomEvent","script","document","createElement","onload","onerror","e","firstScript","currentScript","getElementsByTagName","parentNode","insertBefore","set","prefetchCache","Set","prefetchScript","add","link","rel","href","head","appendChild","scanTemplatesInBrick","brickConf","collection","template","push","slots","Object","values","forEach","slotConf","type","scanTemplatesInBricks","bricks","scanTemplatesInRoutes","routes","internalUsedTemplates","routeConf","menu","scanTemplatesInStoryboard","storyboard","isUniq","uniq","getDepsOfTemplates","templates","templatePackages","templateMap","reduce","m","test","filePath","namespace","split","console","error","arr","find","getTemplateDepsOfStoryboard","hasOwnProperty","object","property","prototype","call","asyncProcessBrick","_asyncToGenerator","templateRegistry","$$resolved","length","$$params","cloneDeep","params","updatedBrickConf","processedTemplates","includes","Error","PUBLIC_ROOT","brick","properties","lifeCycle","hasIf","rawIf","if","keys","key","assign","$$template","$$lifeCycle","$$if","asyncProcessBricks","asyncProcessRoutes","menuBrickConf","asyncProcessStoryboard","computeRealRoutePath","path","app","warn","p","replace","homepage","createProviderClass","api","HTMLElement","_defineProperty","$$typeof","_dev_only_definedProperties","updateArgs","event","setArgs","detail","updateArgsAndExecute","execute","patch","value","entries","args","setArgsAndExecute","executeWithArgs","saveAs","filename","blob","result","__assign","t","s","i","n","arguments","apply","lowerCase","str","toLowerCase","DEFAULT_SPLIT_REGEXP","DEFAULT_STRIP_REGEXP","noCase","input","options","splitRegexp","_b","stripRegexp","_c","transform","_d","delimiter","start","charAt","slice","join","re","RegExp","dotCase","paramCase","ExecutionContext","constructor","EnvironmentRecord","outer","OuterEnv","HasBinding","name","bindingMap","CreateMutableBinding","deletable","mutable","NormalCompletion","undefined","CreateImmutableBinding","strict","InitializeBinding","binding","initialized","SetMutableBinding","ReferenceError","TypeError","GetBindingValue","DeclarativeEnvironment","FunctionEnvironment","SourceNode","Symbol","for","FormalParameters","ECMAScriptCode","Environment","IsConstructor","ReferenceRecord","base","referenceName","Base","ReferenceName","Strict","CompletionRecord","Type","Value","Empty","collectBoundNames","root","names","collect","node","declarations","id","elements","left","argument","from","containsExpression","some","computed","collectScopedDeclarations","nextOptions","var","Number","topLevel","kind","consequent","body","alternate","init","cases","block","handler","finalizer","IsPropertyReference","V","InitializeReferencedBinding","W","CopyDataProperties","target","source","excludedItems","getOwnPropertyNames","concat","getOwnPropertySymbols","nextKey","desc","getOwnPropertyDescriptor","enumerable","ForDeclarationBindingInstantiation","forDeclaration","env","isConst","LoopContinues","completion","UpdateEmpty","GetValue","ToPropertyKey","arg","String","GetV","P","PutValue","CreateListIteratorRecord","isIterable","iterator","RequireObjectCoercible","GetIdentifierReference","ApplyStringOrNumericBinaryOperator","leftValue","operator","rightValue","SyntaxError","ApplyStringOrNumericAssignment","substr","ApplyUnaryOperator","cooked","getGlobal","self","global","reservedObjects","WeakSet","Function","sanitize","allowedConstructors","URLSearchParams","WeakMap","isAllowedConstructor","Date","cook","rootAst","codeSource","rules","globalVariables","hooks","expressionOnly","rootEnv","rootContext","VariableEnvironment","LexicalEnvironment","executionContextStack","TemplateMap","GetTemplateObject","templateLiteral","memo","rawObj","quasis","quasi","raw","freeze","defineProperty","writable","configurable","Evaluate","optionalChainRef","beforeEvaluate","_hooks$beforeEvaluate","array","element","spreadValues","ThrowIfFunctionIsInvalid","closure","InstantiateArrowFunctionExpression","leftRef","rightRef","right","funcName","substring","thisValue","ref","callee","func","optional","skipped","EvaluateCall","expression","ResolveBinding","regex","flags","baseReference","baseValue","EvaluatePropertyAccessWithExpressionKey","EvaluatePropertyAccessWithIdentifierKey","EvaluateNew","prop","fromValue","propName","EvaluateComputedPropertyName","expr","expressions","chunks","index","val","tagRef","tag","tagFunc","deleteStatus","lref","rref","rval","DestructuringAssignmentEvaluation","lval","r","oldEnv","getRunningContext","blockEnv","BlockDeclarationInstantiation","blockValue","EvaluateStatementList","EvaluateBreakableStatement","DoWhileLoopEvaluation","ForInOfLoopEvaluation","ForLoopEvaluation","InstantiateOrdinaryFunctionExpression","beforeBranch","_hooks$beforeBranch","_hooks$beforeBranch2","v","exprRef","lhs","oldValue","newValue","discriminant","switchValue","R","CaseBlockEvaluation","_hooks$beforeEvaluate2","CatchClauseEvaluation","F","declarator","bindingId","rhs","BindingInitialization","WhileLoopEvaluation","thrownValue","catchEnv","argName","param","B","stmtResult","defaultCaseIndex","findIndex","switchCase","hasDefaultCase","A","found","C","CaseClauseIsSelected","foundInB","clauseSelector","exprValue","isVariableDeclaration","lhsKind","uninitializedBoundNames","iterationKind","keyResult","ForInOfHeadEvaluation","ForInOfBodyEvaluation","runningContext","newEnv","EnumerateObjectProperties","stmt","iteratorRecord","destructuring","done","nextValue","next","lhsRef","iterationEnv","lhsName","status","return","innerResult","_node$init","ForBodyEvaluation","update","loopEnv","boundNames","dn","perIterationLets","bodyResult","increment","perIterationBindings","CreatePerIterationEnvironment","testRef","testValue","incRef","lastIterationEnv","thisIterationEnv","bn","lastValue","pattern","PropertyDestructuringAssignmentEvaluation","IteratorDestructuringAssignmentEvaluation","excludedNames","valueTarget","defaultValue","KeyedDestructuringAssignmentEvaluation","RestDestructuringAssignmentEvaluation","propertyName","assignmentTarget","isObjectOrArray","rhsValue","restProperty","restObj","propertyNameReference","propertyNameValue","propertyKey","identifier","propertyNameString","code","d","IsConstantDeclaration","fn","fo","InstantiateFunctionObject","argList","ArgumentListEvaluation","constructExpr","constructorName","CallFunction","beforeCall","_hooks$beforeCall","PrepareForOrdinaryCall","OrdinaryCallEvaluateBody","pop","calleeContext","localEnv","EvaluateFunctionBody","FunctionDeclarationInstantiation","statements","formals","parameterNames","hasParameterExpressions","varDeclarations","varNames","functionNames","functionsToInitialize","unshift","noVar","paramName","IteratorBindingInitialization","varEnv","initialValue","lexEnv","lexDeclarations","f","scope","OrdinaryFunctionCreate","functionExpression","funcEnv","arrowFunction","sourceNode","isConstructor","defineProperties","environment","InitializeBoundName","PropertyBindingInitialization","RestBindingInitialization","KeyedBindingInitialization","bindingElement","isIdentifier","async","generator","_hooks$beforeEvaluate3","Position","column","line","col","SourceLocation","identifierName","position","parseAsEstreeExpression","parseExpression","plugins","proposal","attachComment","parseAsEstree","typescript","file","parse","filter","Boolean","strictMode","program","jsNodes","startsWith","parseForAnalysis","tokens","sourceType","AnalysisContext","AnalysisEnvironment","bindingSet","CreateBinding","precook","visitors","withParent","attemptToVisitGlobals","analysisContextStack","visit","EvaluateChildren","parent","_objectSpread","beforeVisit","_hooks$beforeVisit","beforeVisitGlobal","_hooks$beforeVisitGlo","BoundNamesInstantiation","lexicalBinding","silent","beforeVisitUnknown","_hooks$beforeVisitUnk","PrepareOrdinaryCall","lint","errors","message","loc","isFunctionDeclaration","precookFunction","restOptions","_objectWithoutProperties","function","preevaluate","fixes","suffix","isEvaluable","shouldAllowRecursiveEvaluations","PrecookVisitor","Proxy","noop","PrecookFunctionVisitor","isObject","visitStoryboardFunctions","functions","visitStoryboardExpressions","data","matchExpressionString","visitNonExpressionString","visitObject","PROCESSORS","scanProcessorsInStoryboard","scanProcessorsInAny","meta","customTemplates","beforeVisitProcessorsFactory","beforeVisitProcessors","memberParent","outerMemberParent","parseStoryboard","parseRoutes","parseTemplates","_storyboard$meta","route","routesOnly","context","parseContext","redirect","parseResolvable","parseMenu","providers","parseRouteProviders","defineResolves","children","parseBricks","parseTemplate","tpl","state","parseBrick","isUseBrick","parseCondition","events","parseEvents","parseLifeCycles","parseBrickProperties","parseSlots","condition","props","useBrick","useBackend","walkBrickProperties","rawContainer","rawKey","provider","_value$useBackend","_ref","conf","resolves","handlers","parseEventHandlers","_ref2","slot","childrenType","_ref3","eventType","contexts","onChange","isConditional","callback","parseEventCallback","_ref4","callbackType","traverseStoryboard","ast","traverseNode","traverse","nodeOrNodes","traverseNodes","nodes","childPath","process","NODE_ENV","scanStoryboard","scanStoryboardAst","keepDuplicates","ignoreBricksInUnusedCustomTemplates","selfDefined","tplMap","collectionByTpl","customApis","usedTemplates","definedTemplates","useProvider","collectBricksInBrickConf","collectBricksByCustomTemplates","getDllAndDepsOfStoryboard","brickPackages","processors","getDllAndDepsByResource","byProcessors","getBrickToPackageMap","isEmpty","getDllAndDepsOfBricks","dll","deps","brickMap","dllName","dllPath","DLL_PATH","editorBricks","isProcessor","changeCase","editor","editorsJsFilePath","lexer","char","j","charCodeAt","count","prefixes","defaultPattern","escapeString","tryConsume","mustConsume","nextType","consumeText","indexOf","modifier","open","name_1","pattern_1","compile","tokensToFunction","reFlags","encode","x","validate","matches","token","repeat","segment","typeOfMessage","sensitive","regexpToRegexp","groupsRegex","execResult","exec","arrayToRegexp","paths","parts","stringToRegexp","tokensToRegexp","_e","_f","endsWith","endsWithRe","delimiterRe","tokens_1","_i","mod","endToken","isEndDelimited","pathToRegexp","cacheLimit","cacheCount","compilePath","cacheKey","pathCache","regexp","matchPath","pathname","exact","checkIf","getContext","matched","match","url","isExact","initialParams","toPath","pathParams","restoreDynamicTemplatesInBrick","restoreDynamicTemplatesInBricks","restoreDynamicTemplatesInRoutes","restoreDynamicTemplates","scanBricksInStoryboard","scanBricksInBrickConf","PERMISSIONS","check","scanPermissionActionsInStoryboard","beforeVisitPermissions","beforeVisitPermissionsFactory","scanPermissionActionsInAny","callParent","scanRouteAliasInStoryboard","alias","I18N","scanI18NInStoryboard","beforeVisitI18n","beforeVisitI18nFactory","menus","scanI18NInAny","keyNode","defaultNode","valueSet","APP","GET_MENUS","scanAppGetMenuInStoryboard","beforeVisitAppFactory","scanAppGetMenuInAny","beforeVisitAPP","menuId","LexicalStatus","TokenType","JsonValueType","getRegExpOfPlaceholder","symbols","symbol","escapeRegExp","tokenize","beginPlaceholder","cursor","Initial","eatOptionalRawAndOptionalPlaceholderBegin","ExpectField","eatWhitespace","eatField","ExpectOptionalBeginDefault","eatOptionalDefault","ExpectDefaultValue","eatDefaultValue","ExpectOptionalBeginPipe","eatOptionalBeginPipe","ExpectPipeIdentifier","eatPipeIdentifier","ExpectOptionalBeginPipeParameter","eatOptionalBeginPipeParameter","ExpectPipeParameter","eatPipeParameter","ExpectPlaceholderEnd","eatPlaceholderEnd","subRaw","getSubRaw","matchedPlaceholder","subCursor","nextCursor","Raw","BeginPlaceHolder","Field","BeginDefault","eatJsonValueOrLiteralString","BeginPipe","JSON","stringify","PipeIdentifier","BeginPipeParameter","EndPlaceHolder","jsonLiteralMap","nextStatus","eatJsonValue","JsonValue","LiteralString","firstChar","valueType","Others","objectBracesToMatch","arrayBracketsToMatch","stringQuotesToClose","stringBackslashToEscape","parseInjectableString","parseTokens","tree","optionalToken","shift","acceptToken","placeholder","field","pipes","pipe","parameters","inject","transformAndInject","isInjectable","transformNode","transformNodeFactory","injectNode","injectNodeFactory","reduceCompiledValues","processPipes","_full","subField","anchor","SimpleContextMap","HASH","SYS","FLAGS","contextItem","query","getAll","overrideApp","hash","storyboardContext","formatUnitValue","formatValue","convertUnitValueByPrecision","convertValueByPrecision","utils","resolveContextConcurrently","contextConfs","resolveContext","keyword","dependencyMap","getDependencyMapOfContext","pendingDeps","contextConf","includesComputed","stats","processed","wrapResolve","resolved","delete","scheduleNext","scheduleAsSerial","readyContexts","predicateNextResolveFactory","entry","size","detectCircularContexts","syncResolveContextConcurrently","dep","dependencies","depsMap","beforeVisitContextFactory","beforeVisitContext","memberNode","duplicatedMap","processedAtLeastOne","scanCustomApisInStoryboard","mapCustomApisToNameAndNamespace","smartDisplayForEvaluableString","rawString","nonStringFallback","unknownEvaluationFallback","i18nData","JsonStorage","storage","setItem","getItem","removeItem","clear","isRouteNode","isBrickNode","isCustomTemplateNode","isSnippetNode","jsonFieldsInRoute","yamlFieldsInRoute","jsonFieldsInBrick","yamlFieldsInBrick","fieldsToRemoveInRoute","fieldsToRemoveInBrick","disposableNullFields","normalizeBuilderNode","normalize","fieldsToRemove","jsonFields","yamlFields","fromEntries","getCleanSegues","safeJsonParse","safeYamlParse","string","segues","segue","yaml","safeLoad","schema","JSON_SCHEMA","json","fieldsToKeepInMenu","fieldsToKeepInMenuItem","normalizeMenu","keep","items","keepItems","fieldsToKeep","deepFreeze","propNames","trackContext","track","trackState","trackFormState","trackUsedContext","trackUsed","trackUsedState","trackText","variableName","trackCtxExp","debounceByAnimationFrame","frame","cancelAnimationFrame","requestAnimationFrame","INSTALLED_APPS","scanInstalledAppsInStoryboard","beforeVisitInstalledApps","beforeVisitInstalledAppsFactory","poolMap","makeThrottledAggregation","request","select","wait","pool","current","fullIds","enqueue","aggregatedIds","setTimeout","then","cached","removeDeadConditions","$$deadConditionsRemoved","removeDeadConditionsByAst","computeConstantCondition","conditionalNodes","deleteEmptyArray","shakeConditionalNodes","removedNodes","remove","removeDeadConditionsInTpl","tplConstructor","ifContainer","constantFeatureFlags","featureFlags","hasDynamicVariables","isConstantLogical","originalIf","expect"],"mappings":";;;;;;;;;;;;;;;EAAA,IAAMA,OAAK,GAAG,IAAIC,GAAG,EAA2B,CAAA;EAIzC,SAASC,UAAU,CACxBC,GAAsB,EACtBC,MAAe,EACa;EAC5B,EAAA,IAAIC,KAAK,CAACC,OAAO,CAACH,GAAG,CAAC,EAAE;EACtB,IAAA,OAAOI,OAAO,CAACC,GAAG,CAChBL,GAAG,CAACM,GAAG,CAAmBC,IAAI,IAAKR,UAAU,CAACQ,IAAI,EAAEN,MAAM,CAAC,CAAC,CAC7D,CAAA;EACH,GAAA;IACA,IAAMO,QAAQ,GAAGP,MAAM,GAAA,EAAA,CAAA,MAAA,CAAMA,MAAM,CAAGD,CAAAA,MAAAA,CAAAA,GAAG,IAAKA,GAAG,CAAA;EACjD,EAAA,IAAIH,OAAK,CAACY,GAAG,CAACD,QAAQ,CAAC,EAAE;EACvB,IAAA,OAAOX,OAAK,CAACa,GAAG,CAACF,QAAQ,CAAC,CAAA;EAC5B,GAAA;IACA,IAAMG,OAAO,GAAG,IAAIP,OAAO,CAAS,CAACQ,OAAO,EAAEC,MAAM,KAAK;MACvD,IAAMC,GAAG,GAAG,MAAY;QACtBC,MAAM,CAACC,aAAa,CAAC,IAAIC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;OACrD,CAAA;EACD,IAAA,IAAMC,MAAM,GAAGC,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC,CAAA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