];
+ if (lodash.isFunction(originalMethod)) {
+ const p = originalMethod.apply(instance, args);
+ if (key === opts.destroyMethod) {
+ return p.then(async () => {
+ await worker.terminate();
+ });
+ }
+ return p;
+ }
+ return originalMethod;
+ };
+ },
+ });
+ }
+ } as unknown as T;
+}
+
+export interface CreateApiParserOptions {
+ /**
+ * The full file name (absolute path) of the file where `parseWorker` is located
+ */
+ filename: string;
+ /**
+ * Parsing class working in worker_thead
+ */
+ worker: S;
+ /**
+ * Main thread side work, mainly to detect file changes
+ */
+ parseOptions?: C;
+}
+
+export interface BaseApiParserOptions {
+ entryFile: string;
+ resolveDir: string;
+}
+
+/**
+ * Can be used to override apiParser
+ * @param options
+ * @returns A function that returns a Parser instance
+ * @example
+ * ```ts
+ * interface ParserOptions extends BaseApiParserOptions {
+ * // other props...
+ * }
+ * const Parser = createApiParser({
+ * filename: __filename,
+ * worker: (class {
+ * constructor(opts: ParserOptions) {}
+ * patch () {}
+ * async parse () {
+ * return {
+ * components: {},
+ * functions: {}
+ * };
+ * }
+ * async destroy () {}
+ * }),
+ * parserOptions: {
+ * handleWatcher(watcher, { parse, patch }) {
+ * return watcher.on('all', (ev, file) => {
+ * // You can perform patch and parse operations based on file changes.
+ * // patch will transfer the corresponding file to the parseWorker,
+ * // and parse will instruct the parseWorker to parse according to updated files.
+ * });
+ * },
+ * },
+ * });
+ * ```
+ */
+export function createApiParser<
+ P extends new (...args: ConstructorParameters) => InstanceType
&
+ LanguageMetaParser,
+>(options: CreateApiParserOptions
>>) {
+ const { filename, worker, parseOptions } = options;
+ const ParserClass = createRemoteClass(filename, worker);
+ return (...args: ConstructorParameters
) =>
+ new BaseAtomAssetsParser({
+ ...(args as any[])?.[0],
+ parser: new ParserClass(...args),
+ ...parseOptions,
+ });
+}
diff --git a/src/client/pages/Demo/index.ts b/src/client/pages/Demo/index.ts
index ef6b1563d2..4c714e3b3a 100644
--- a/src/client/pages/Demo/index.ts
+++ b/src/client/pages/Demo/index.ts
@@ -1,16 +1,26 @@
-import { useDemo, useLiveDemo, useParams } from 'dumi';
-import { createElement, useEffect, type FC } from 'react';
+import { useDemo, useLiveDemo, useParams, useRenderer } from 'dumi';
+import { ComponentType, createElement, useEffect, type FC } from 'react';
import './index.less';
const DemoRenderPage: FC = () => {
const { id } = useParams();
- const { component } = useDemo(id!) || {};
+ const demo = useDemo(id!);
+
+ const canvasRef = useRenderer(demo!);
+
+ const { component, renderOpts } = demo || {};
+
const {
node: liveDemoNode,
- error: liveDemoError,
setSource,
+ error: liveDemoError,
} = useLiveDemo(id!);
- const finalNode = liveDemoNode || (component && createElement(component));
+
+ const finalNode =
+ liveDemoNode ||
+ (renderOpts?.renderer
+ ? createElement('div', { ref: canvasRef })
+ : component && createElement(component as ComponentType));
// listen message event for setSource
useEffect(() => {
diff --git a/src/client/theme-api/DumiDemo/index.tsx b/src/client/theme-api/DumiDemo/index.tsx
index d2bb348537..c30e969f19 100644
--- a/src/client/theme-api/DumiDemo/index.tsx
+++ b/src/client/theme-api/DumiDemo/index.tsx
@@ -1,9 +1,10 @@
import { SP_ROUTE_PREFIX } from '@/constants';
import { useAppData, useDemo, useSiteData } from 'dumi';
-import React, { createElement, type FC } from 'react';
+import React, { ComponentType, createElement, type FC } from 'react';
import type { IPreviewerProps } from '../types';
import Previewer from 'dumi/theme/builtins/Previewer';
+import { useRenderer } from '../useRenderer';
import DemoErrorBoundary from './DemoErrorBoundary';
export interface IDumiDemoProps {
@@ -17,14 +18,24 @@ export interface IDumiDemoProps {
const InternalDumiDemo = (props: IDumiDemoProps) => {
const { historyType } = useSiteData();
const { basename } = useAppData();
- const { component, asset } = useDemo(props.demo.id)!;
+ const id = props.demo.id;
+ const demo = useDemo(id)!;
+ const { component, asset, renderOpts } = demo;
+
+ const canvasRef = useRenderer(Object.assign(demo, { id }));
// hide debug demo in production
if (process.env.NODE_ENV === 'production' && props.previewerProps.debug)
return null;
const demoNode = (
- {createElement(component)}
+
+ {renderOpts?.renderer ? (
+
+ ) : (
+ createElement(component as ComponentType)
+ )}
+
);
if (props.demo.inline) {
diff --git a/src/client/theme-api/context.ts b/src/client/theme-api/context.ts
index 176db2e477..fbcf21cef1 100644
--- a/src/client/theme-api/context.ts
+++ b/src/client/theme-api/context.ts
@@ -3,7 +3,7 @@ import type { AtomComponentAsset } from 'dumi-assets-types';
import { createContext, useContext } from 'react';
import type { IDemoData, ILocalesConfig, IThemeConfig } from './types';
-interface ISiteContext {
+export interface ISiteContext {
pkg: Partial>;
historyType: 'browser' | 'hash' | 'memory';
entryExports: Record;
diff --git a/src/client/theme-api/index.ts b/src/client/theme-api/index.ts
index 6f3a20fe01..0db8649e4b 100644
--- a/src/client/theme-api/index.ts
+++ b/src/client/theme-api/index.ts
@@ -25,12 +25,13 @@ export { DumiPage } from './DumiPage';
export { useSiteData } from './context';
export { openCodeSandbox } from './openCodeSandbox';
export { openStackBlitz } from './openStackBlitz';
-export type { IPreviewerProps } from './types';
+export type { IDemoCancelableFn, IPreviewerProps } from './types';
export { useAtomAssets } from './useAtomAssets';
export { useLiveDemo } from './useLiveDemo';
export { useLocale } from './useLocale';
export { useNavData } from './useNavData';
export { usePrefersColor } from './usePrefersColor';
+export { useRenderer } from './useRenderer';
export { useRouteMeta } from './useRouteMeta';
export { useFullSidebarData, useSidebarData } from './useSidebarData';
export { useSiteSearch } from './useSiteSearch';
diff --git a/src/client/theme-api/types.ts b/src/client/theme-api/types.ts
index b2d24bf8e3..ae3d98c612 100644
--- a/src/client/theme-api/types.ts
+++ b/src/client/theme-api/types.ts
@@ -1,5 +1,5 @@
import type { ExampleBlockAsset } from 'dumi-assets-types';
-import type { ComponentType, ReactNode } from 'react';
+import type { ComponentType as ReactComponentType, ReactNode } from 'react';
export interface IPreviewerProps {
/**
@@ -129,9 +129,9 @@ export interface IRouteMeta {
title?: string;
titleIntlId?: string;
components: {
- default: ComponentType;
- Extra: ComponentType;
- Action: ComponentType;
+ default: ReactComponentType;
+ Extra: ReactComponentType;
+ Action: ReactComponentType;
};
meta: {
frontmatter: Omit<
@@ -237,13 +237,24 @@ export type IRoutesById = Record<
}
>;
+export type AgnosticComponentModule = { default?: any; [key: string]: any };
+
+export type AgnosticComponentType =
+ | Promise
+ | AgnosticComponentModule;
+
export type IDemoCompileFn = (
code: string,
opts: { filename: string },
) => Promise;
+export type IDemoCancelableFn = (
+ canvas: HTMLElement,
+ component: AgnosticComponentModule,
+) => (() => void) | Promise<() => void>;
+
export type IDemoData = {
- component: ComponentType;
+ component: ReactComponentType | AgnosticComponentType;
asset: IPreviewerProps['asset'];
routeId: string;
context?: Record;
@@ -252,5 +263,6 @@ export type IDemoData = {
* provide a runtime compile function for compile demo code for live preview
*/
compile?: IDemoCompileFn;
+ renderer?: IDemoCancelableFn;
};
};
diff --git a/src/client/theme-api/useLiveDemo.ts b/src/client/theme-api/useLiveDemo.ts
index f1aeb4f9ed..b3f6e1b38c 100644
--- a/src/client/theme-api/useLiveDemo.ts
+++ b/src/client/theme-api/useLiveDemo.ts
@@ -10,18 +10,49 @@ import {
type RefObject,
} from 'react';
import DemoErrorBoundary from './DumiDemo/DemoErrorBoundary';
+import type { AgnosticComponentType } from './types';
+import { useRenderer } from './useRenderer';
const THROTTLE_WAIT = 500;
+type CommonJSContext = {
+ module: any;
+ exports: {
+ default?: any;
+ };
+ require: any;
+};
+
+function evalCommonJS(
+ js: string,
+ { module, exports, require }: CommonJSContext,
+) {
+ new Function('module', 'exports', 'require', js)(module, exports, require);
+}
+
export const useLiveDemo = (
id: string,
opts?: { containerRef?: RefObject; iframe?: boolean },
) => {
- const { context, asset, renderOpts } = useDemo(id)!;
+ const demo = useDemo(id)!;
const [loading, setLoading] = useState(false);
const loadingTimer = useRef();
const taskToken = useRef();
+
+ const { context = {}, asset, renderOpts } = demo;
+ const [component, setComponent] = useState();
+ const ref = useRenderer(
+ component
+ ? {
+ id,
+ ...demo,
+ component,
+ }
+ : Object.assign(demo, { id }),
+ );
+
const [demoNode, setDemoNode] = useState();
+
const [error, setError] = useState(null);
const setSource = useCallback(
throttle(
@@ -35,6 +66,11 @@ export const useLiveDemo = (
THROTTLE_WAIT - 1,
);
+ function resetLoadingStatus() {
+ clearTimeout(loadingTimer.current);
+ setLoading(false);
+ }
+
if (opts?.iframe && opts?.containerRef?.current) {
const iframeWindow =
opts.containerRef.current.querySelector('iframe')!.contentWindow!;
@@ -67,31 +103,59 @@ export const useLiveDemo = (
if (v in context!) return context![v];
throw new Error(`Cannot find module: ${v}`);
};
- const exports: { default?: ComponentType } = {};
- const module = { exports };
+
const token = (taskToken.current = Math.random());
let entryFileCode = source[entryFileName];
+ if (renderOpts?.compile) {
+ try {
+ entryFileCode = await renderOpts.compile(entryFileCode, {
+ filename: entryFileName,
+ });
+ } catch (error: any) {
+ setError(error);
+ resetLoadingStatus();
+ return;
+ }
+ }
+
+ if (renderOpts?.renderer && renderOpts?.compile) {
+ try {
+ const exports: AgnosticComponentType = {};
+ const module = { exports };
+ evalCommonJS(entryFileCode, {
+ exports,
+ module,
+ require,
+ });
+ setComponent(exports);
+ setDemoNode(createElement('div', { ref }));
+ setError(null);
+ } catch (err: any) {
+ setError(err);
+ }
+ resetLoadingStatus();
+ return;
+ }
+
try {
// load renderToStaticMarkup in async way
const renderToStaticMarkupDeferred = import(
'react-dom/server'
).then(({ renderToStaticMarkup }) => renderToStaticMarkup);
- // compile entry file code
- entryFileCode = await renderOpts!.compile!(entryFileCode, {
- filename: entryFileName,
- });
-
// skip current task if another task is running
if (token !== taskToken.current) return;
+ const exports: { default?: ComponentType } = {};
+ const module = { exports };
+
// initial component with fake runtime
- new Function('module', 'exports', 'require', entryFileCode)(
- module,
+ evalCommonJS(entryFileCode, {
exports,
+ module,
require,
- );
+ });
const newDemoNode = createElement(
DemoErrorBoundary,
@@ -116,10 +180,7 @@ export const useLiveDemo = (
setError(err);
}
}
-
- // reset loading status
- clearTimeout(loadingTimer.current);
- setLoading(false);
+ resetLoadingStatus();
},
THROTTLE_WAIT,
{ leading: true },
diff --git a/src/client/theme-api/useRenderer.ts b/src/client/theme-api/useRenderer.ts
new file mode 100644
index 0000000000..2ba978c62c
--- /dev/null
+++ b/src/client/theme-api/useRenderer.ts
@@ -0,0 +1,52 @@
+import { useEffect, useRef } from 'react';
+import type { AgnosticComponentModule, IDemoData } from './types';
+
+// maintain all the mounted instance
+const map = new Map();
+
+export const useRenderer = ({
+ id,
+ component,
+ renderOpts,
+}: IDemoData & { id: string }) => {
+ const canvasRef = useRef(null);
+ const teardownRef = useRef(() => {});
+
+ const prevComponent = useRef(component);
+
+ // forcibly destroyed
+ if (prevComponent.current !== component) {
+ const teardown = map.get(id);
+ teardown?.();
+ prevComponent.current = component;
+ }
+
+ const renderer = renderOpts?.renderer;
+
+ useEffect(() => {
+ async function resolveRender() {
+ if (!canvasRef.current || !renderer || !component) return;
+ if (map.get(id)) return;
+
+ map.set(id, () => {});
+ let module: AgnosticComponentModule =
+ component instanceof Promise ? await component : component;
+ module = module.default ?? module;
+
+ const teardown = await renderer(canvasRef.current, module);
+
+ // remove instance when react component is unmounted
+ teardownRef.current = function () {
+ teardown();
+ map.delete(id);
+ };
+ map.set(id, teardownRef.current);
+ }
+
+ resolveRender();
+ }, [canvasRef.current, component, renderer]);
+
+ useEffect(() => () => teardownRef.current(), []);
+
+ return canvasRef;
+};
diff --git a/src/client/theme-default/builtins/API/index.tsx b/src/client/theme-default/builtins/API/index.tsx
index 1ae50d29c0..9b6a50abcb 100644
--- a/src/client/theme-default/builtins/API/index.tsx
+++ b/src/client/theme-default/builtins/API/index.tsx
@@ -81,7 +81,12 @@ const HANDLERS = {
.map(
(signature: any) =>
`${signature.isAsync ? 'async ' : ''}(${signature.arguments
- .map((arg: any) => `${arg.key}: ${this.toString(arg)}`)
+ .map(
+ (arg: any) =>
+ `${arg.key}${arg.hasQuestionToken ? '?' : ''}: ${this.toString(
+ arg,
+ )}`,
+ )
.join(', ')}) => ${this.toString(signature.returnType)}`,
)
.join(' | ');
@@ -121,7 +126,10 @@ const APIType: FC = (prop) => {
return {type}
;
};
-const API: FC<{ id?: string }> = (props) => {
+const API: FC<{
+ id?: string;
+ type?: 'props' | 'events' | 'slots' | 'methods';
+}> = (props) => {
const { frontmatter } = useRouteMeta();
const { components } = useAtomAssets();
const id = props.id || frontmatter.atomId;
@@ -131,6 +139,15 @@ const API: FC<{ id?: string }> = (props) => {
const definition = components?.[id];
+ let properties: Record = {};
+
+ let type = (props.type || 'props').toLowerCase();
+
+ if (definition) {
+ let key = `${type}Config` as 'propsConfig';
+ properties = definition[key]?.properties || {};
+ }
+
return (
@@ -139,19 +156,21 @@ const API: FC<{ id?: string }> = (props) => {
{intl.formatMessage({ id: 'api.component.name' })} |
{intl.formatMessage({ id: 'api.component.description' })} |
{intl.formatMessage({ id: 'api.component.type' })} |
- {intl.formatMessage({ id: 'api.component.default' })} |
+ {props.type === 'props' && (
+ {intl.formatMessage({ id: 'api.component.default' })} |
+ )}
- {definition && definition.propsConfig?.properties ? (
- Object.entries(definition.propsConfig.properties).map(
- ([name, prop]) => (
-
- {name} |
- {prop.description || '--'} |
-
-
- |
+ {Object.keys(properties).length ? (
+ Object.entries(properties).map(([name, prop]) => (
+
+ {name} |
+ {prop.description || '--'} |
+
+
+ |
+ {props.type === 'props' && (
{definition.propsConfig.required?.includes(name)
@@ -159,9 +178,9 @@ const API: FC<{ id?: string }> = (props) => {
: JSON.stringify(prop.default) || '--'}
|
-
- ),
- )
+ )}
+
+ ))
) : (
diff --git a/src/client/theme-default/builtins/Previewer/index.less b/src/client/theme-default/builtins/Previewer/index.less
index a835f9f4b8..74743e02c0 100644
--- a/src/client/theme-default/builtins/Previewer/index.less
+++ b/src/client/theme-default/builtins/Previewer/index.less
@@ -136,6 +136,7 @@
text-overflow: ellipsis;
background: lighten(@c-error, 51%);
box-sizing: border-box;
+ overflow: hidden;
@{dark-selector} & {
@color: lighten(desaturate(@c-error, 20%), 5%);
diff --git a/src/client/theme-default/builtins/Previewer/index.tsx b/src/client/theme-default/builtins/Previewer/index.tsx
index d5683baccf..1e86740f18 100644
--- a/src/client/theme-default/builtins/Previewer/index.tsx
+++ b/src/client/theme-default/builtins/Previewer/index.tsx
@@ -9,6 +9,7 @@ const Previewer: FC = (props) => {
const demoContainer = useRef(null);
const { hash } = useLocation();
const link = `#${props.asset.id}`;
+
const {
node: liveDemoNode,
error: liveDemoError,
diff --git a/src/client/theme-default/builtins/SourceCode/index.tsx b/src/client/theme-default/builtins/SourceCode/index.tsx
index efd907dad5..ca538fa30c 100644
--- a/src/client/theme-default/builtins/SourceCode/index.tsx
+++ b/src/client/theme-default/builtins/SourceCode/index.tsx
@@ -20,6 +20,7 @@ import './index.less';
const SIMILAR_DSL: Record = {
acss: 'css',
axml: 'markup',
+ vue: 'markup',
};
interface SourceCodeProps {
diff --git a/src/constants.ts b/src/constants.ts
index fccbffae05..8edc8b3210 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -28,4 +28,15 @@ export const VERSION_2_LEVEL_NAV = '^2.2.0';
export const VERSION_2_DEPRECATE_SOFT_BREAKS = '^2.2.0';
+export const DEFAULT_DEMO_MODULE_EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx'];
+
+export const DEFAULT_DEMO_PLAIN_TEXT_EXTENSIONS = [
+ '.css',
+ '.less',
+ '.sass',
+ '.scss',
+ '.styl',
+ '.json',
+];
+
export const FS_CACHE_DIR = 'node_modules/.cache/dumi';
diff --git a/src/features/compile/index.ts b/src/features/compile/index.ts
index e93ef64d5c..98d78dcd9a 100644
--- a/src/features/compile/index.ts
+++ b/src/features/compile/index.ts
@@ -185,7 +185,6 @@ export default (api: IApi) => {
},
]);
}
-
return memo;
});
};
diff --git a/src/features/parser.ts b/src/features/parser.ts
index 9574f9dbc9..f7866d387f 100644
--- a/src/features/parser.ts
+++ b/src/features/parser.ts
@@ -1,7 +1,7 @@
-import type AtomAssetsParser from '@/assetParsers/atom';
-import type { IApi } from '@/types';
+import type { AtomAssetsParser, IApi } from '@/types';
import { lodash } from '@umijs/utils';
import assert from 'assert';
+import { BaseAtomAssetsParser } from '../assetParsers/BaseParser';
import { ATOMS_META_PATH } from './meta';
type IParsedAtomAssets = Awaited>;
@@ -83,16 +83,19 @@ export default (api: IApi) => {
// because `onStart` will be called before any commands
// and `onCheckPkgJson` only be called in dev and build
api.onCheckPkgJSON(async () => {
+ if (api.service.atomParser instanceof BaseAtomAssetsParser) return;
const {
- default: AtomAssetsParser,
+ default: ReactAtomAssetsParser,
}: typeof import('@/assetParsers/atom') = require('@/assetParsers/atom');
- api.service.atomParser = new AtomAssetsParser({
+ const apiParser = api.config.apiParser || {};
+
+ api.service.atomParser = new ReactAtomAssetsParser({
entryFile: api.config.resolve.entryFile!,
resolveDir: api.cwd,
- unpkgHost: api.config.apiParser!.unpkgHost,
- resolveFilter: api.config.apiParser!.resolveFilter,
- parseOptions: api.config.apiParser!.parseOptions,
+ unpkgHost: apiParser.unpkgHost,
+ resolveFilter: apiParser.resolveFilter,
+ parseOptions: apiParser.parseOptions,
});
});
diff --git a/src/index.ts b/src/index.ts
index d88a56d9c2..3870cf250b 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,5 +1,10 @@
-import type { IDumiUserConfig } from '@/types';
-
+import type {
+ AtomAssetsParser,
+ AtomAssetsParserResult,
+ IDumiTechStack,
+ IDumiTechStackRuntimeOpts,
+ IDumiUserConfig,
+} from '@/types';
let unistUtilVisit: typeof import('unist-util-visit');
// workaround to export pure esm package in cjs
@@ -8,5 +13,14 @@ let unistUtilVisit: typeof import('unist-util-visit');
})();
export * from 'umi';
-export { unistUtilVisit };
+export * from './assetParsers/BaseParser';
+export * from './assetParsers/utils';
+export { getProjectRoot } from './utils';
+export {
+ unistUtilVisit,
+ IDumiTechStack,
+ IDumiTechStackRuntimeOpts,
+ AtomAssetsParser,
+ AtomAssetsParserResult,
+};
export const defineConfig = (config: IDumiUserConfig) => config;
diff --git a/src/loaders/markdown/index.ts b/src/loaders/markdown/index.ts
index 97259c4474..65ef0c75c0 100644
--- a/src/loaders/markdown/index.ts
+++ b/src/loaders/markdown/index.ts
@@ -124,7 +124,11 @@ function emitDemo(
export const demos = {
{{#demos}}
'{{{id}}}': {
+ id: "{{{id}}}",
+ {{#component}}
component: {{{component}}},
+ {{/component}}
+ renderOpts: {{{renderRenderOpts}}},
asset: {{{renderAsset}}},
context: {{{renderContext}}},
renderOpts: {{{renderRenderOpts}}},
@@ -183,16 +187,32 @@ export const demos = {
renderRenderOpts: function renderRenderOpts(
this: NonNullable[0],
) {
- if (!('renderOpts' in this) || !this.renderOpts.compilePath) {
+ if (!('renderOpts' in this)) {
return 'undefined';
}
+ const renderOpts = this.renderOpts;
+ const propertyArray: string[] = [];
- return `{
+ if (renderOpts.compilePath) {
+ propertyArray.push(`
compile: async (...args) => {
return (await import('${winPath(
- this.renderOpts.compilePath,
+ renderOpts.compilePath,
)}')).default(...args);
- },
+ },`);
+ }
+
+ if (renderOpts.rendererPath) {
+ propertyArray.push(`
+ renderer: (await import('${winPath(
+ renderOpts.rendererPath,
+ )}')).default,`);
+ }
+
+ if (propertyArray.length === 0) return 'undefined';
+
+ return `{
+ ${propertyArray.join('\n')}
}`;
},
},
@@ -265,7 +285,7 @@ function emit(this: any, opts: IMdLoaderOptions, ret: IMdTransformerResult) {
case 'text':
return emitText.call(this, opts, ret);
default:
- return emitDefault.call(this, opts, ret);
+ return emitDefault.call(this, opts as IMdLoaderDefaultModeOptions, ret);
}
}
diff --git a/src/loaders/markdown/transformer/index.ts b/src/loaders/markdown/transformer/index.ts
index 217610db8b..1dfb11090b 100644
--- a/src/loaders/markdown/transformer/index.ts
+++ b/src/loaders/markdown/transformer/index.ts
@@ -1,13 +1,8 @@
import type { IParsedBlockAsset } from '@/assetParsers/block';
import type { ILocalesConfig, IRouteMeta } from '@/client/theme-api/types';
import { VERSION_2_DEPRECATE_SOFT_BREAKS } from '@/constants';
-import type {
- IApi,
- IDumiConfig,
- IDumiTechStack,
- IDumiTechStackRuntimeOpts,
-} from '@/types';
-import enhancedResolve from 'enhanced-resolve';
+import type { IApi, IDumiConfig, IDumiTechStack } from '@/types';
+import enhancedResolve, { type ResolveOptions } from 'enhanced-resolve';
import type { IRoute } from 'umi';
import { semver } from 'umi/plugin-utils';
import type { Plugin, Processor } from 'unified';
@@ -48,11 +43,20 @@ declare module 'vfile' {
component: string;
asset: IParsedBlockAsset['asset'];
resolveMap: IParsedBlockAsset['resolveMap'];
- renderOpts: Pick;
+ renderOpts: {
+ type?: string;
+ rendererPath?: string;
+ compilePath?: string;
+ };
}
| {
id: string;
component: string;
+ renderOpts: {
+ type?: string;
+ rendererPath?: string;
+ compilePath?: string; // only for fix type
+ };
}
)[];
texts: IRouteMeta['texts'];
@@ -127,7 +131,10 @@ export default async (raw: string, opts: IMdTransformerOptions) => {
const resolver = enhancedResolve.create.sync({
mainFields: ['browser', 'module', 'main'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
- alias: opts.alias,
+ // Common conditionName needs to be configured,
+ // otherwise some common library paths cannot be parsed, such as vue, pinia, etc.
+ conditionNames: ['import', 'require', 'default', 'browser', 'node'],
+ alias: opts.alias as ResolveOptions['alias'],
});
const fileLocale = opts.locales.find((locale) =>
opts.fileAbsPath.endsWith(`.${locale.id}.md`),
diff --git a/src/loaders/markdown/transformer/rehypeDemo.ts b/src/loaders/markdown/transformer/rehypeDemo.ts
index a24f43ad35..a5b3d1f479 100644
--- a/src/loaders/markdown/transformer/rehypeDemo.ts
+++ b/src/loaders/markdown/transformer/rehypeDemo.ts
@@ -247,9 +247,14 @@ export default function rehypeDemo(
? [vFile.data.frontmatter!.atomId]
: [],
fileAbsPath: '',
+ lang: (codeNode.data?.lang as string) || 'tsx',
entryPointCode: codeType === 'external' ? undefined : codeValue,
resolver: opts.resolver,
+ techStack,
};
+
+ const runtimeOpts = techStack.runtimeOpts;
+
const previewerProps: IDumiDemoProps['previewerProps'] = {};
let component = '';
@@ -275,9 +280,16 @@ export default function rehypeDemo(
localId,
vFile.data.frontmatter!.atomId,
);
- component = `React.memo(React.lazy(() => import( /* webpackChunkName: "${chunkName}" */ '${winPath(
+ const importChunk = `import( /* webpackChunkName: "${chunkName}" */ '${winPath(
parseOpts.fileAbsPath,
- )}?techStack=${techStack.name}')))`;
+ )}?techStack=${techStack.name}')`;
+
+ if (runtimeOpts?.rendererPath) {
+ component = `(async () => ${importChunk})()`;
+ } else {
+ component = `React.memo(React.lazy(() => ${importChunk}))`;
+ }
+
// use code value as title
// TODO: force checking
if (codeValue) codeNode.properties!.title = codeValue;
@@ -291,7 +303,10 @@ export default function rehypeDemo(
// pass a fake entry point for code block demo
// and pass the real code via `entryPointCode` option
- parseOpts.fileAbsPath = opts.fileAbsPath.replace('.md', '.tsx');
+ parseOpts.fileAbsPath = opts.fileAbsPath.replace(
+ '.md',
+ `.${parseOpts.lang}`,
+ );
parseOpts.id = getCodeId(
opts.cwd,
opts.fileLocaleLessPath,
@@ -372,6 +387,9 @@ export default function rehypeDemo(
// TODO: special id for inline demo
id: asset.id,
component,
+ renderOpts: {
+ rendererPath: runtimeOpts?.rendererPath,
+ },
};
}
@@ -429,7 +447,8 @@ export default function rehypeDemo(
)
: resolveMap,
renderOpts: {
- compilePath: techStack.runtimeOpts?.compilePath,
+ rendererPath: runtimeOpts?.rendererPath,
+ compilePath: runtimeOpts?.compilePath,
},
};
},
diff --git a/src/techStacks/react.ts b/src/techStacks/react.ts
index 69dc9b460a..12b92f68f9 100644
--- a/src/techStacks/react.ts
+++ b/src/techStacks/react.ts
@@ -1,5 +1,5 @@
import type { IDumiTechStack } from '@/types';
-import { transformSync } from '@swc/core';
+import { wrapDemoWithFn } from './utils';
export default class ReactTechStack implements IDumiTechStack {
name = 'react';
@@ -15,36 +15,15 @@ export default class ReactTechStack implements IDumiTechStack {
transformCode(...[raw, opts]: Parameters) {
if (opts.type === 'code-block') {
const isTSX = opts.fileAbsPath.endsWith('.tsx');
- const { code } = transformSync(raw, {
+ const code = wrapDemoWithFn(raw, {
filename: opts.fileAbsPath,
- jsc: {
- parser: {
- syntax: isTSX ? 'typescript' : 'ecmascript',
- [isTSX ? 'tsx' : 'jsx']: true,
- },
- target: 'es2022',
- experimental: {
- cacheRoot: 'node_modules/.cache/swc',
- plugins: [
- [
- require.resolve(
- '../../compiled/crates/swc_plugin_react_demo.wasm',
- ),
- {},
- ],
- ],
- },
- },
- module: {
- type: 'es6',
+ parserConfig: {
+ syntax: isTSX ? 'typescript' : 'ecmascript',
+ [isTSX ? 'tsx' : 'jsx']: true,
},
});
-
- return `React.memo(React.lazy(async () => {
-${code}
-}))`;
+ return `React.memo(React.lazy(${code}))`;
}
-
return raw;
}
}
diff --git a/src/techStacks/utils.ts b/src/techStacks/utils.ts
new file mode 100644
index 0000000000..1a1dc0eb48
--- /dev/null
+++ b/src/techStacks/utils.ts
@@ -0,0 +1,61 @@
+import type { ParserConfig } from '@swc/core';
+import { transformSync } from '@swc/core';
+
+export {
+ IDumiTechStack,
+ IDumiTechStackOnBlockLoadArgs,
+ IDumiTechStackOnBlockLoadResult,
+ IDumiTechStackRuntimeOpts,
+} from '../types';
+
+/**
+ * for frameworks like vue , we need to extract the JS fragments in their scripts
+ * @param htmlLike HTML, vue and other html-like files are available
+ * @returns js/ts code
+ */
+export function extractScript(htmlLike: string) {
+ const htmlScriptReg = /',
+ );
+ const metaSnapshots: Record = {};
+ const host = new Proxy>(
+ {
+ getScriptFileNames: () => {
+ const names = _host.getScriptFileNames();
+ return [
+ ...names,
+ ...names.map(getMetaFileName),
+ globalComponentName,
+ getMetaFileName(globalComponentName),
+ ];
+ },
+ getScriptSnapshot: (fileName) => {
+ if (isMetaFileName(fileName)) {
+ if (!metaSnapshots[fileName]) {
+ metaSnapshots[fileName] = ts.ScriptSnapshot.fromString(
+ getMetaScriptContent(fileName, vueCompilerOptions.target),
+ );
+ }
+ return metaSnapshots[fileName];
+ } else if (fileName === globalComponentName) {
+ return globalComponentSnapshot;
+ } else {
+ return _host.getScriptSnapshot(fileName);
+ }
+ },
+ },
+ {
+ get(target, prop) {
+ if (prop in target) {
+ return target[prop as keyof typeof target];
+ }
+ return _host[prop as keyof typeof _host];
+ },
+ },
+ ) as TypeScriptLanguageHost;
+ const vueLanguages = ts
+ ? [
+ createVueLanguage(
+ ts,
+ host.getCompilationSettings() as ts.CompilerOptions,
+ vueCompilerOptions,
+ ),
+ ]
+ : [];
+ const core = createLanguageContext(host, vueLanguages);
+ // @ts-ignore
+ const tsLsHost = createLanguageServiceHost(core, ts, ts.sys, undefined);
+ // @ts-ignore
+ const tsLs = ts.createLanguageService(tsLsHost);
+ // @ts-ignore
+ decorateLanguageService(core.virtualFiles, tsLs, false);
+
+ if (checkerOptions.forceUseTs) {
+ const getScriptKind = tsLsHost.getScriptKind;
+ tsLsHost.getScriptKind = (fileName) => {
+ if (fileName.endsWith('.vue.js')) {
+ return ts.ScriptKind.TS;
+ }
+ if (fileName.endsWith('.vue.jsx')) {
+ return ts.ScriptKind.TSX;
+ }
+ return getScriptKind!(fileName);
+ };
+ }
+
+ return {
+ core,
+ tsLs,
+ host,
+ };
+}
diff --git a/suites/dumi-vue-meta/src/checker/helpers.ts b/suites/dumi-vue-meta/src/checker/helpers.ts
new file mode 100644
index 0000000000..b2b81a425a
--- /dev/null
+++ b/suites/dumi-vue-meta/src/checker/helpers.ts
@@ -0,0 +1,359 @@
+import type { VueCompilerOptions, VueFile } from '@vue/language-core';
+import { parseScriptSetupRanges } from '@vue/language-core';
+import type ts from 'typescript/lib/tsserverlibrary';
+import { code as typeHelpersCode } from 'vue-component-type-helpers';
+import { getNodeOfSymbol } from '../utils';
+
+export function isMetaFileName(fileName: string) {
+ return fileName.endsWith('.meta.ts');
+}
+
+export function getMetaFileName(fileName: string) {
+ return (
+ (fileName.endsWith('.vue')
+ ? fileName
+ : fileName.substring(0, fileName.lastIndexOf('.'))) + '.meta.ts'
+ );
+}
+
+export function getMetaScriptContent(fileName: string, target: number) {
+ const from = fileName.substring(0, fileName.length - '.meta.ts'.length);
+ let code = `
+import * as Components from '${from}';
+export default {} as { [K in keyof typeof Components]: ComponentMeta; };
+
+export type * from '${from}';
+
+interface ComponentMeta {
+ type: ComponentType;
+ props: ComponentProps;
+ emit: ComponentEmit;
+ slots: ${target < 3 ? 'Vue2ComponentSlots' : 'ComponentSlots'};
+ exposed: ComponentExposed;
+};
+
+${typeHelpersCode}
+`.trim();
+ return code;
+}
+
+export function getExports(
+ ts: typeof import('typescript/lib/tsserverlibrary'),
+ program: ts.Program,
+ typeChecker: ts.TypeChecker,
+ componentPath: string,
+ exportedType: boolean = false,
+) {
+ const sourceFile = program?.getSourceFile(getMetaFileName(componentPath));
+ if (!sourceFile) {
+ throw `Could not find main source file of ${componentPath}`;
+ }
+
+ const moduleSymbol = typeChecker.getSymbolAtLocation(sourceFile);
+ if (!moduleSymbol) {
+ throw `Could not find module symbol of ${componentPath}`;
+ }
+
+ const exportedSymbols = typeChecker.getExportsOfModule(moduleSymbol);
+
+ let symbolNode: ts.Expression | undefined;
+ let exportedTypes: ts.Type[] = [];
+
+ for (const symbol of exportedSymbols) {
+ const [declaration] = symbol.getDeclarations() ?? [];
+
+ if (ts.isExportAssignment(declaration)) {
+ symbolNode = declaration.expression;
+ }
+
+ if (
+ exportedType &&
+ (ts.isTypeOnlyImportOrExportDeclaration(declaration) ||
+ ts.isTypeAliasDeclaration(declaration) ||
+ ts.isInterfaceDeclaration(declaration))
+ ) {
+ const type = typeChecker.getDeclaredTypeOfSymbol(symbol);
+ exportedTypes.push(type);
+ }
+ }
+
+ if (!symbolNode) {
+ throw 'Could not find symbol node';
+ }
+
+ const exportDefaultType = typeChecker.getTypeAtLocation(symbolNode);
+ const exports = exportDefaultType.getProperties();
+
+ return {
+ symbolNode,
+ exports,
+ exportedTypes,
+ };
+}
+
+export function resolveDefaultOptionExpression(
+ _default: ts.Expression,
+ ts: typeof import('typescript/lib/tsserverlibrary'),
+) {
+ if (ts.isArrowFunction(_default)) {
+ if (ts.isBlock(_default.body)) {
+ return _default; // TODO
+ } else if (ts.isParenthesizedExpression(_default.body)) {
+ return _default.body.expression;
+ } else {
+ return _default.body;
+ }
+ }
+ return _default;
+}
+
+export function resolvePropsOption(
+ ast: ts.SourceFile,
+ props: ts.ObjectLiteralExpression,
+ printer: ts.Printer | undefined,
+ ts: typeof import('typescript/lib/tsserverlibrary'),
+) {
+ const result: Record = {};
+
+ for (const prop of props.properties) {
+ if (ts.isPropertyAssignment(prop)) {
+ const name = prop.name?.getText(ast);
+ if (ts.isObjectLiteralExpression(prop.initializer)) {
+ const defaultProp = prop.initializer.properties.find(
+ (p) =>
+ ts.isPropertyAssignment(p) && p.name.getText(ast) === 'default',
+ ) as ts.PropertyAssignment | undefined;
+ const requiredProp = prop.initializer.properties.find(
+ (p) =>
+ ts.isPropertyAssignment(p) && p.name.getText(ast) === 'required',
+ ) as ts.PropertyAssignment | undefined;
+
+ result[name] = {};
+
+ if (requiredProp) {
+ const exp = requiredProp.initializer.getText(ast);
+ result[name].required = exp === 'true';
+ }
+ if (defaultProp) {
+ const expNode = resolveDefaultOptionExpression(
+ (defaultProp as any).initializer,
+ ts,
+ );
+ const expText =
+ printer?.printNode(ts.EmitHint.Expression, expNode, ast) ??
+ expNode.getText(ast);
+ result[name].default = expText;
+ }
+ }
+ }
+ }
+
+ return result;
+}
+
+export function readTsComponentDefaultProps(
+ lang: string,
+ tsFileText: string,
+ exportName: string,
+ printer: ts.Printer | undefined,
+ ts: typeof import('typescript/lib/tsserverlibrary'),
+) {
+ const ast = ts.createSourceFile(
+ '/tmp.' + lang,
+ tsFileText,
+ ts.ScriptTarget.Latest,
+ );
+
+ function getComponentNode() {
+ let result: ts.Node | undefined;
+
+ if (exportName === 'default') {
+ ast.forEachChild((child) => {
+ if (ts.isExportAssignment(child)) {
+ result = child.expression;
+ }
+ });
+ } else {
+ ast.forEachChild((child) => {
+ if (
+ ts.isVariableStatement(child) &&
+ child.modifiers?.some(
+ (mod) => mod.kind === ts.SyntaxKind.ExportKeyword,
+ )
+ ) {
+ for (const dec of child.declarationList.declarations) {
+ if (dec.name.getText(ast) === exportName) {
+ result = dec.initializer;
+ }
+ }
+ }
+ });
+ }
+
+ return result;
+ }
+
+ function getComponentOptionsNode() {
+ const component = getComponentNode();
+
+ if (component) {
+ // export default { ... }
+ if (ts.isObjectLiteralExpression(component)) {
+ return component;
+ }
+ // export default defineComponent({ ... })
+ // export default Vue.extend({ ... })
+ else if (ts.isCallExpression(component)) {
+ if (component.arguments.length) {
+ const arg = component.arguments[0];
+ if (ts.isObjectLiteralExpression(arg)) {
+ return arg;
+ }
+ }
+ }
+ }
+ }
+
+ function getPropsNode() {
+ const options = getComponentOptionsNode();
+ const props = options?.properties.find(
+ (prop) => prop.name?.getText(ast) === 'props',
+ );
+ if (props && ts.isPropertyAssignment(props)) {
+ if (ts.isObjectLiteralExpression(props.initializer)) {
+ return props.initializer;
+ }
+ }
+ }
+
+ const props = getPropsNode();
+
+ if (props) {
+ return resolvePropsOption(ast, props, printer, ts);
+ }
+
+ return {};
+}
+
+export function readVueComponentDefaultProps(
+ vueSourceFile: VueFile,
+ printer: ts.Printer | undefined,
+ ts: typeof import('typescript/lib/tsserverlibrary'),
+ vueCompilerOptions: VueCompilerOptions,
+) {
+ let result: Record = {};
+
+ function findObjectLiteralExpression(node: ts.Node) {
+ if (ts.isObjectLiteralExpression(node)) {
+ return node;
+ }
+ let result: ts.ObjectLiteralExpression | undefined;
+ node.forEachChild((child) => {
+ if (!result) {
+ result = findObjectLiteralExpression(child);
+ }
+ });
+ return result;
+ }
+
+ function scriptSetupWorker() {
+ const descriptor = vueSourceFile.sfc;
+ const scriptSetupRanges = descriptor.scriptSetupAst
+ ? parseScriptSetupRanges(
+ ts,
+ descriptor.scriptSetupAst,
+ vueCompilerOptions,
+ )
+ : undefined;
+
+ if (descriptor.scriptSetup && scriptSetupRanges?.props.withDefaults?.arg) {
+ const defaultsText = descriptor.scriptSetup.content.substring(
+ scriptSetupRanges.props.withDefaults.arg.start,
+ scriptSetupRanges.props.withDefaults.arg.end,
+ );
+ const ast = ts.createSourceFile(
+ '/tmp.' + descriptor.scriptSetup.lang,
+ '(' + defaultsText + ')',
+ ts.ScriptTarget.Latest,
+ );
+ const obj = findObjectLiteralExpression(ast);
+
+ if (obj) {
+ for (const prop of obj.properties) {
+ if (ts.isPropertyAssignment(prop)) {
+ const name = prop.name.getText(ast);
+ const expNode = resolveDefaultOptionExpression(
+ prop.initializer,
+ ts,
+ );
+ const expText =
+ printer?.printNode(ts.EmitHint.Expression, expNode, ast) ??
+ expNode.getText(ast);
+
+ result[name] = {
+ default: expText,
+ };
+ }
+ }
+ }
+ } else if (descriptor.scriptSetup && scriptSetupRanges?.props.define?.arg) {
+ const defaultsText = descriptor.scriptSetup.content.substring(
+ scriptSetupRanges.props.define.arg.start,
+ scriptSetupRanges.props.define.arg.end,
+ );
+ const ast = ts.createSourceFile(
+ '/tmp.' + descriptor.scriptSetup.lang,
+ '(' + defaultsText + ')',
+ ts.ScriptTarget.Latest,
+ );
+ const obj = findObjectLiteralExpression(ast);
+
+ if (obj) {
+ result = {
+ ...result,
+ ...resolvePropsOption(ast, obj, printer, ts),
+ };
+ }
+ }
+ }
+
+ function scriptWorker() {
+ const descriptor = vueSourceFile.sfc;
+
+ if (descriptor.script) {
+ const scriptResult = readTsComponentDefaultProps(
+ descriptor.script.lang,
+ descriptor.script.content,
+ 'default',
+ printer,
+ ts,
+ );
+ for (const [key, value] of Object.entries(scriptResult)) {
+ result[key] = value;
+ }
+ }
+ }
+
+ scriptSetupWorker();
+ scriptWorker();
+
+ return result;
+}
+
+export function isFunctionalVueComponent(
+ typeChecker: ts.TypeChecker,
+ symbol: ts.Symbol,
+) {
+ const node = getNodeOfSymbol(symbol);
+ if (node) {
+ const type = typeChecker.getTypeAtLocation(node);
+ const signatures = type.getCallSignatures();
+ if (!signatures || !signatures.length) return false;
+ const returnType = signatures[0].getReturnType();
+ const baseType = returnType.getBaseTypes();
+ if (baseType?.length) {
+ return baseType[0].getSymbol()?.escapedName === 'VNode';
+ }
+ }
+ return false;
+}
diff --git a/suites/dumi-vue-meta/src/checker/index.ts b/suites/dumi-vue-meta/src/checker/index.ts
new file mode 100644
index 0000000000..f425b7f883
--- /dev/null
+++ b/suites/dumi-vue-meta/src/checker/index.ts
@@ -0,0 +1,2 @@
+export * from './Project';
+export * from './TypeCheckService';
diff --git a/suites/dumi-vue-meta/src/dumiTransfomer.ts b/suites/dumi-vue-meta/src/dumiTransfomer.ts
new file mode 100644
index 0000000000..2a6e4ef5fa
--- /dev/null
+++ b/suites/dumi-vue-meta/src/dumiTransfomer.ts
@@ -0,0 +1,211 @@
+import { AtomComponentAsset } from 'dumi-assets-types';
+import {
+ FunctionPropertySchema,
+ ObjectPropertySchema,
+ PropertySchema,
+} from 'dumi-assets-types/typings/atom/props';
+import { TypeMap } from 'dumi-assets-types/typings/atom/props/types';
+import type {
+ ComponentLibraryMeta,
+ ComponentMeta,
+ EventMeta,
+ MetaTransformer,
+ PropertyMeta,
+ PropertyMetaSchema,
+ SlotMeta,
+} from './types';
+import { PropertyMetaKind } from './types';
+import { BasicTypes } from './utils';
+
+function getPropertySchema(schema: PropertySchema | string) {
+ if (typeof schema === 'string') {
+ return {
+ type: schema as keyof TypeMap,
+ };
+ }
+ return schema;
+}
+
+export const dumiTransfomer: MetaTransformer<
+ Record
+> = (meta: ComponentLibraryMeta) => {
+ const referencedTypes = meta.types;
+ const cachedTypes: Record = {};
+
+ function createPropertySchema(prop: PropertyMeta | EventMeta | SlotMeta) {
+ const partialProp: Partial = {
+ title: prop.name,
+ description: prop.description,
+ tags: prop.tags,
+ };
+ let tagDef = prop?.tags?.default;
+ let def: string | undefined;
+ if (tagDef?.length) {
+ def = tagDef[0];
+ } else if (prop.default !== undefined) {
+ def = prop.default;
+ }
+
+ if (def) {
+ try {
+ partialProp.default = JSON.parse(def.replaceAll("'", '"'));
+ } catch (error) {}
+ }
+
+ const desc = prop?.tags?.['description'];
+ if (desc?.length) {
+ partialProp.description = desc.join('\n');
+ }
+ return {
+ ...partialProp,
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ ...getPropertySchema(transformSchema(prop.schema)),
+ };
+ }
+
+ function transformSchema(
+ schema: PropertyMetaSchema,
+ ): PropertySchema | string {
+ // It may not need to be checked, or it may be a basic type
+ if (typeof schema === 'string') {
+ const basicType = BasicTypes[schema];
+ if (basicType) {
+ return {
+ type: basicType as any,
+ };
+ }
+ return { type: schema as any };
+ }
+ switch (schema.kind) {
+ case PropertyMetaKind.REF: {
+ const cachedType = cachedTypes[schema.ref];
+ if (cachedType) {
+ return cachedType;
+ }
+ const type = transformSchema(referencedTypes[schema.ref]);
+ cachedTypes[schema.ref] = type;
+ return type;
+ }
+ case PropertyMetaKind.LITERAL:
+ return {
+ const: schema.value,
+ };
+ case PropertyMetaKind.BASIC:
+ return {
+ type: schema.type as any,
+ };
+ case PropertyMetaKind.ENUM:
+ return {
+ oneOf: (schema.schema || []).map((item) =>
+ getPropertySchema(transformSchema(item)),
+ ),
+ };
+ case PropertyMetaKind.ARRAY:
+ return {
+ type: 'array',
+ items: schema.schema?.length
+ ? getPropertySchema(transformSchema(schema.schema[0]))
+ : undefined,
+ };
+ case PropertyMetaKind.OBJECT: {
+ const required: string[] = [];
+ const meta = {
+ type: 'object',
+ properties: Object.entries(schema.schema || {}).reduce(
+ (acc, [name, prop]) => {
+ if (prop.required) {
+ required.push(prop.name);
+ }
+ acc[name] = createPropertySchema(prop);
+ return acc;
+ },
+ {} as Record,
+ ),
+ } as ObjectPropertySchema;
+ meta.required = required;
+ return meta;
+ }
+ case PropertyMetaKind.FUNC: {
+ const functionSchema = schema.schema!;
+ return {
+ type: 'function',
+ signature: {
+ isAsync: functionSchema.isAsync,
+ arguments: functionSchema.arguments.map((arg) => ({
+ key: arg.key,
+ hasQuestionToken: !arg.required,
+ type: arg.type,
+ })),
+ returnType: transformSchema(functionSchema.returnType),
+ },
+ } as FunctionPropertySchema;
+ }
+ case PropertyMetaKind.UNKNOWN:
+ return schema.type;
+ }
+ }
+
+ function transformComponent(component: ComponentMeta) {
+ const { props, events, slots, exposed } = component;
+ const eventsFromProps: Record = {};
+ const required: string[] = [];
+ const properties = props.reduce((acc, prop) => {
+ if (prop.required) {
+ required.push(prop.name);
+ }
+ const match = prop.name.match(/^on([A-Z].*)$/);
+ if (match) {
+ // Discard excluded event prop
+ if (prop.schema.kind === PropertyMetaKind.UNKNOWN) {
+ return acc;
+ }
+ const eventName = match[1].toLowerCase();
+ Object.assign(prop, { name: eventName });
+ eventsFromProps[eventName] = createPropertySchema(prop);
+ } else {
+ acc[prop.name] = createPropertySchema(prop);
+ }
+ return acc;
+ }, {} as Record);
+
+ const asset: AtomComponentAsset = {
+ type: 'COMPONENT',
+ propsConfig: {
+ type: 'object',
+ properties,
+ },
+ slotsConfig: {
+ type: 'object',
+ properties: slots.reduce((acc, slot) => {
+ acc[slot.name] = createPropertySchema(slot);
+ return acc;
+ }, {} as Record),
+ },
+ eventsConfig: {
+ type: 'object',
+ properties: events.reduce((acc, event) => {
+ if (acc[event.name] === undefined) {
+ acc[event.name] = createPropertySchema(event);
+ }
+ return acc;
+ }, eventsFromProps),
+ },
+ methodsConfig: {
+ type: 'object',
+ properties: exposed.reduce((acc, method) => {
+ acc[method.name] = createPropertySchema(method);
+ return acc;
+ }, {} as Record),
+ },
+ id: component.name,
+ title: component.name,
+ };
+ asset.propsConfig.required = required;
+ return asset;
+ }
+
+ return Object.entries(meta.components).reduce((result, [name, component]) => {
+ result[name] = transformComponent(component);
+ return result;
+ }, {} as Record);
+};
diff --git a/suites/dumi-vue-meta/src/index.ts b/suites/dumi-vue-meta/src/index.ts
new file mode 100644
index 0000000000..d4c980ca0a
--- /dev/null
+++ b/suites/dumi-vue-meta/src/index.ts
@@ -0,0 +1,120 @@
+import {
+ createParsedCommandLine,
+ createParsedCommandLineByJson,
+} from '@vue/language-core';
+import fs from 'fs';
+import process from 'process';
+import * as path from 'typesafe-path/posix';
+import { Project, TypeCheckService } from './checker';
+import type { MetaCheckerOptions } from './types';
+import { getPosixPath } from './utils';
+
+export * from './checker';
+export * from './dumiTransfomer';
+export { vueTypesSchemaResolver } from './schemaResolver/custom';
+export * from './types';
+export { createRef } from './utils';
+
+export type ComponentMetaChecker = typeof TypeCheckService;
+
+export interface CheckerProjectJsonOptions {
+ root: string;
+ json: any;
+ checkerOptions?: MetaCheckerOptions;
+ ts?: typeof import('typescript/lib/tsserverlibrary');
+}
+
+/**
+ * Create component metadata checker through json configuration
+ */
+export function createProjectByJson(options: CheckerProjectJsonOptions) {
+ const {
+ root,
+ json,
+ checkerOptions = {},
+ ts = require('typescript'),
+ } = options;
+ const rootPath = getPosixPath(root);
+ return new Project(
+ () => createParsedCommandLineByJson(ts, ts.sys, root, json),
+ ts,
+ checkerOptions,
+ rootPath,
+ path.join(rootPath, 'jsconfig.json.global.vue' as path.PosixPath),
+ );
+}
+
+export interface CheckerProjectOptions {
+ tsconfigPath: string;
+ checkerOptions?: MetaCheckerOptions;
+ ts?: typeof import('typescript/lib/tsserverlibrary');
+}
+
+const defaultTsConfig = {
+ compilerOptions: {
+ baseUrl: './',
+ strict: true,
+ declaration: true,
+ skipLibCheck: true,
+ esModuleInterop: true,
+ resolveJsonModule: true,
+ jsx: 'preserve',
+ jsxImportSource: 'vue',
+ strictNullChecks: false,
+ paths: {
+ '@/*': ['src/*'],
+ },
+ },
+ include: ['src/**/*', 'docs/**/*'],
+};
+
+/**
+ * Create a meta checker for Vue project
+ * @param optionsOrRootPath You can pass in the project root directory or specific configuration.
+ * @example
+ * ```ts
+ * import { createProject } from '@dumijs/vue-meta';
+ * // Manually pass in the tsconfig.json path
+ * createProject({
+ * tsconfigPath: '/tsconfig.json',
+ * checkerOptions: {},
+ * });
+ * ```
+ * If no parameters are passed in, tsconfig.json in the current workspace will be read.
+ * ```ts
+ * import { createProject } from '@dumijs/vue-meta';
+ * createProject();
+ * ```
+ */
+export function createProject(
+ options?: CheckerProjectOptions | string,
+): Project {
+ if (typeof options === 'string' || !options) {
+ const rootPath = options ?? process.cwd();
+ try {
+ const tryPath = path.join(
+ getPosixPath(rootPath),
+ getPosixPath('tsconfig.json'),
+ );
+ fs.accessSync(tryPath, fs.constants.R_OK);
+ return createProject({ tsconfigPath: tryPath });
+ } catch (error) {} // ignore error
+ return createProjectByJson({
+ root: rootPath,
+ json: defaultTsConfig,
+ });
+ }
+ const {
+ tsconfigPath,
+ checkerOptions = {},
+ ts = require('typescript'),
+ } = options;
+ const tsconfig = getPosixPath(tsconfigPath);
+ return new Project(
+ () => createParsedCommandLine(ts, ts.sys, tsconfigPath),
+ ts,
+ checkerOptions,
+ path.dirname(tsconfig),
+ tsconfig + '.global.vue',
+ );
+}
diff --git a/suites/dumi-vue-meta/src/schemaResolver/custom/index.ts b/suites/dumi-vue-meta/src/schemaResolver/custom/index.ts
new file mode 100644
index 0000000000..f2a6b87028
--- /dev/null
+++ b/suites/dumi-vue-meta/src/schemaResolver/custom/index.ts
@@ -0,0 +1,2 @@
+export * from './vueOption';
+export * from './vueTypes';
diff --git a/suites/dumi-vue-meta/src/schemaResolver/custom/vueOption.ts b/suites/dumi-vue-meta/src/schemaResolver/custom/vueOption.ts
new file mode 100644
index 0000000000..7f7898b07c
--- /dev/null
+++ b/suites/dumi-vue-meta/src/schemaResolver/custom/vueOption.ts
@@ -0,0 +1,26 @@
+import type { CustomSchemaResolver, PropertyMeta } from '../../types';
+import { getNodeOfSymbol } from '../../utils';
+
+export const vueOptionSchemaResolver: CustomSchemaResolver = (
+ meta,
+ { ts, targetNode, targetType },
+) => {
+ if (!targetNode || !targetType) return meta;
+
+ const requiredSymbol = targetType.getProperty('required');
+ const requiredNode = getNodeOfSymbol(requiredSymbol);
+ if (requiredNode && ts.isPropertyAssignment(requiredNode)) {
+ if (requiredNode.initializer.kind === ts.SyntaxKind.TrueKeyword) {
+ meta.required = true;
+ } else if (requiredNode.initializer.kind === ts.SyntaxKind.FalseKeyword) {
+ meta.required = false;
+ }
+ }
+ const defaultSymbol = targetType.getProperty('default');
+ const defaultNode = getNodeOfSymbol(defaultSymbol);
+ // If default is a function, it is too complicated. Users can set it by @default.
+ if (defaultNode && ts.isPropertyAssignment(defaultNode)) {
+ meta.default = defaultNode.initializer.getText();
+ }
+ return meta;
+};
diff --git a/suites/dumi-vue-meta/src/schemaResolver/custom/vueTypes.ts b/suites/dumi-vue-meta/src/schemaResolver/custom/vueTypes.ts
new file mode 100644
index 0000000000..a54349cc2b
--- /dev/null
+++ b/suites/dumi-vue-meta/src/schemaResolver/custom/vueTypes.ts
@@ -0,0 +1,47 @@
+import type ts from 'typescript';
+import type { CustomSchemaResolver, PropertyMeta } from '../../types';
+import { createNodeVisitor } from '../../utils';
+
+/**
+ * A custom schema resolver for [vue-types](https://github.com/dwightjack/vue-types)
+ * used to identify isRequired, def and other methods
+ */
+export const vueTypesSchemaResolver: CustomSchemaResolver = (
+ meta,
+ { ts, typeChecker, targetNode, targetType },
+) => {
+ if (!targetNode || !targetType) return meta;
+
+ const typeString = typeChecker.typeToString(targetType);
+ const visit = createNodeVisitor(ts);
+ if (typeString.match(/vuetype\w*def/i)) {
+ // TODO: get flow node https://stackoverflow.com/questions/69461435/typescript-ast-how-to-get-the-asserted-type
+ if (ts.isPropertyAssignment(targetNode)) {
+ const requiredNode = visit(targetNode.initializer, (cnode) => {
+ return (
+ ts.isIdentifier(cnode) &&
+ cnode.escapedText === 'isRequired' &&
+ ts.isPropertyAccessExpression(cnode.parent)
+ );
+ });
+ if (requiredNode) meta.required = true;
+ const defNode = visit(
+ targetNode.initializer,
+ (cnode) => {
+ return (
+ ts.isCallExpression(cnode) &&
+ ts.isPropertyAccessExpression(cnode.expression) &&
+ cnode.expression.name.escapedText === 'def'
+ );
+ },
+ );
+ if (defNode) {
+ const argNode = defNode.arguments[0];
+ if (!ts.isFunctionExpression(argNode)) {
+ meta.default = argNode.getText();
+ }
+ }
+ }
+ }
+ return meta;
+};
diff --git a/suites/dumi-vue-meta/src/schemaResolver/index.ts b/suites/dumi-vue-meta/src/schemaResolver/index.ts
new file mode 100644
index 0000000000..e4e79b4c7c
--- /dev/null
+++ b/suites/dumi-vue-meta/src/schemaResolver/index.ts
@@ -0,0 +1,420 @@
+import type ts from 'typescript/lib/tsserverlibrary';
+import {
+ CustomSchemaResolver,
+ EventMeta,
+ ExposeMeta,
+ MetaCheckerOptions,
+ PropertyMeta,
+ PropertyMetaKind,
+ PropertyMetaSchema,
+} from '../types';
+import {
+ BasicTypes,
+ createRef,
+ getJsDocTags,
+ getNodeOfSymbol,
+ getNodeOfType,
+ getSignatureArgsMeta,
+ getTypeOfSignature,
+ hasQuestionToken,
+ isPromiseLike,
+ reducer,
+ signatureTypeToString,
+} from '../utils';
+import { vueOptionSchemaResolver } from './custom';
+
+export class SchemaResolver {
+ private schemaCache = new WeakMap();
+ private schemaOptions!: MetaCheckerOptions['schema'];
+
+ /**
+ * Used to store all declared interfaces or types
+ */
+ private readonly types: Record = {};
+ private readonly typeCache = new WeakMap();
+
+ constructor(
+ private typeChecker: ts.TypeChecker,
+ private symbolNode: ts.Expression,
+ options: MetaCheckerOptions,
+ private ts: typeof import('typescript/lib/tsserverlibrary'),
+ ) {
+ this.schemaOptions = Object.assign(
+ {
+ exclude: /node_modules/,
+ ignoreTypeArgs: false,
+ },
+ options.schema,
+ );
+ }
+
+ /**
+ * resolve types ahead of time
+ */
+ public preResolve(types: ts.Type[]) {
+ types.forEach((type) => {
+ this.resolveSchema(type);
+ });
+ }
+
+ private setType(
+ type: string,
+ fileName: string,
+ subtype: ts.Type,
+ schema: PropertyMetaSchema,
+ ) {
+ const key = createRef(type, fileName);
+ this.types[key] = schema;
+ this.typeCache.set(subtype, key);
+ return key;
+ }
+
+ public getSchemaByRef(ref: string) {
+ return this.types[ref];
+ }
+
+ public getRefByType(type: ts.Type) {
+ return this.typeCache.get(type);
+ }
+
+ public getSchemaByType(type: ts.Type) {
+ const ref = this.getRefByType(type);
+ if (ref) {
+ return this.getSchemaByRef(ref);
+ }
+ }
+
+ public getTypes() {
+ return this.types;
+ }
+
+ private shouldIgnore(subtype: ts.Type) {
+ const name = this.typeChecker.typeToString(subtype);
+ const schemaOptions = this.schemaOptions;
+
+ if (!schemaOptions) return false;
+ let node: ts.Declaration | undefined;
+ if (schemaOptions.exclude && (node = getNodeOfType(subtype))) {
+ const excludePaths =
+ schemaOptions.exclude instanceof Array
+ ? schemaOptions.exclude
+ : [schemaOptions.exclude];
+ for (const pathPattern of excludePaths) {
+ const fileName = node.getSourceFile().fileName;
+ if (typeof pathPattern === 'string') {
+ return fileName === pathPattern;
+ } else if (pathPattern instanceof RegExp) {
+ return pathPattern.test(fileName);
+ } else if (pathPattern instanceof Function) {
+ return pathPattern(fileName);
+ }
+ }
+ }
+
+ for (const item of schemaOptions.ignore ?? []) {
+ if (typeof item === 'function') {
+ const result = item(name, subtype, this.typeChecker);
+ if (typeof result === 'boolean') return result;
+ } else if (name === item) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private createSignatureMetaSchema(
+ call: ts.Signature,
+ subtype?: ts.Type,
+ ): PropertyMetaSchema {
+ const { typeChecker, ts } = this;
+ const returnType = call.getReturnType();
+ call.getDeclaration();
+ return {
+ kind: PropertyMetaKind.FUNC,
+ type: typeChecker.typeToString(
+ subtype || getTypeOfSignature(typeChecker, call),
+ ),
+ schema: {
+ isAsync: isPromiseLike(returnType),
+ returnType: this.resolveSchema(returnType),
+ arguments: call.parameters.map((param) => {
+ const argType = typeChecker.getTypeAtLocation(
+ getNodeOfSymbol(param) as ts.Node,
+ );
+ return {
+ key: param.name,
+ type: typeChecker.typeToString(argType),
+ schema: this.resolveSchema(argType),
+ required: !hasQuestionToken(ts, param),
+ };
+ }),
+ },
+ };
+ }
+
+ private resolveExactSchema(subtype: ts.Type): PropertyMetaSchema {
+ const { typeChecker, ts, resolveSchema } = this;
+
+ const type = typeChecker.typeToString(subtype);
+
+ if (BasicTypes[type]) {
+ return {
+ kind: PropertyMetaKind.BASIC,
+ type,
+ };
+ } else if (subtype.isLiteral()) {
+ const primitiveType = typeChecker.getBaseTypeOfLiteralType(subtype);
+ return {
+ kind: PropertyMetaKind.LITERAL,
+ type: typeChecker.typeToString(primitiveType),
+ value: type,
+ };
+ } else if (subtype.isUnion()) {
+ return {
+ kind: PropertyMetaKind.ENUM,
+ type,
+ schema: subtype.types.map(resolveSchema.bind(this)),
+ };
+ }
+
+ // @ts-ignore - typescript internal, isArrayLikeType exists
+ else if (typeChecker.isArrayLikeType(subtype)) {
+ return {
+ kind: PropertyMetaKind.ARRAY,
+ type,
+ schema: typeChecker
+ .getTypeArguments(subtype as ts.TypeReference)
+ .map(resolveSchema.bind(this)),
+ };
+ } else if (
+ subtype.getCallSignatures().length === 0 &&
+ (subtype.isClassOrInterface() ||
+ subtype.isIntersection() ||
+ (subtype as ts.ObjectType).objectFlags & ts.ObjectFlags.Anonymous)
+ ) {
+ return {
+ kind: PropertyMetaKind.OBJECT,
+ type,
+ schema: subtype
+ .getProperties()
+ .map((prop) => this.resolveNestedProperties(prop, true))
+ .reduce(reducer, {}),
+ };
+ } else if (subtype.getCallSignatures().length >= 1) {
+ // There may be multiple signatures, but we only take the first one
+ const signature = subtype.getCallSignatures()[0];
+ return this.createSignatureMetaSchema(signature);
+ }
+
+ return {
+ kind: PropertyMetaKind.UNKNOWN,
+ type,
+ };
+ }
+
+ private resolveUnknownSchema(subtype: ts.Type): PropertyMetaSchema {
+ const { typeChecker, resolveSchema, schemaOptions } = this;
+ const type = typeChecker.typeToString(subtype);
+ if (!schemaOptions?.ignoreTypeArgs) {
+ // Obtaining type parameters
+ // Although some types do not need to be check themselves,
+ // their type parameters still need to be checked.
+ let typeArgs = typeChecker.getTypeArguments(subtype as ts.TypeReference);
+ if (typeArgs.length) {
+ return {
+ kind: typeChecker.isArrayLikeType(subtype)
+ ? PropertyMetaKind.ARRAY
+ : PropertyMetaKind.UNKNOWN,
+ type,
+ schema: typeArgs.map(resolveSchema.bind(this)),
+ };
+ }
+ }
+
+ if (BasicTypes[type]) {
+ return {
+ kind: PropertyMetaKind.BASIC,
+ type,
+ };
+ }
+
+ return {
+ kind: PropertyMetaKind.UNKNOWN,
+ type,
+ };
+ }
+
+ public resolveSchema(subtype: ts.Type): PropertyMetaSchema {
+ const ref = this.getRefByType(subtype);
+ if (ref) return { ref, kind: PropertyMetaKind.REF };
+
+ const cachedSchema = this.schemaCache.get(subtype);
+ if (cachedSchema) {
+ return cachedSchema;
+ }
+
+ const { ts, typeChecker } = this;
+ const type = typeChecker.typeToString(subtype);
+ const node = getNodeOfType(subtype);
+
+ let schema: PropertyMetaSchema;
+
+ if (this.shouldIgnore(subtype)) {
+ schema = this.resolveUnknownSchema(subtype);
+ } else {
+ schema = this.resolveExactSchema(subtype);
+ // Remove basic types and unknown types
+ if (
+ node &&
+ !BasicTypes[type] &&
+ schema.kind !== PropertyMetaKind.UNKNOWN &&
+ (ts.isTypeOnlyImportOrExportDeclaration(node) ||
+ ts.isTypeAliasDeclaration(node) ||
+ ts.isInterfaceDeclaration(node))
+ ) {
+ const fileName = node.getSourceFile().fileName;
+ Object.assign(schema, { fileName });
+ const ref = this.setType(type, fileName, subtype, schema);
+ return { ref, kind: PropertyMetaKind.REF };
+ }
+ }
+
+ this.schemaCache.set(subtype, schema);
+
+ return schema;
+ }
+
+ // `normal` means whether it is a normal prop. If it is false, it is a prop of the vue instance.
+ public resolveNestedProperties(prop: ts.Symbol, normal = false) {
+ const { ts, typeChecker, symbolNode } = this;
+ const schemaOptions = this.schemaOptions!;
+ const subtype = typeChecker.getTypeOfSymbolAtLocation(prop, symbolNode!);
+
+ const originalMeta = {
+ name: prop.getEscapedName().toString(),
+ description: ts.displayPartsToString(
+ prop.getDocumentationComment(typeChecker),
+ ),
+ required: !(prop.flags & ts.SymbolFlags.Optional),
+ tags: getJsDocTags(ts, typeChecker, prop),
+ type: typeChecker.typeToString(subtype),
+ } as Partial;
+
+ if (normal) {
+ originalMeta.schema = this.resolveSchema(subtype);
+ return originalMeta as PropertyMeta;
+ }
+
+ const { customResovlers } = schemaOptions;
+
+ const resolvers: CustomSchemaResolver[] = [
+ vueOptionSchemaResolver,
+ ];
+
+ if (customResovlers?.length) {
+ resolvers.push(...customResovlers);
+ }
+
+ originalMeta.global = false;
+
+ const targetNode = getNodeOfSymbol(prop);
+ let targetType: ts.Type | undefined;
+
+ if (targetNode && ts.isPropertyAssignment(targetNode)) {
+ targetType = typeChecker.getTypeAtLocation(targetNode.initializer);
+ } else if (targetNode && ts.isShorthandPropertyAssignment(targetNode)) {
+ targetType = typeChecker.getTypeAtLocation(targetNode);
+ }
+
+ const options = {
+ ts,
+ typeChecker,
+ schemaOptions,
+ prop,
+ symbolNode,
+ targetNode,
+ targetType,
+ };
+
+ const meta = resolvers.reduce((originMeta, resolver) => {
+ return resolver(originMeta, options);
+ }, originalMeta);
+
+ meta.schema = this.resolveSchema(subtype);
+ return meta as PropertyMeta;
+ }
+
+ public resolveSlotProperties(prop: ts.Symbol) {
+ const { typeChecker, symbolNode, ts } = this;
+ const propType = typeChecker.getNonNullableType(
+ typeChecker.getTypeOfSymbolAtLocation(prop, symbolNode!),
+ );
+ const signatures = propType.getCallSignatures();
+ const paramType = signatures?.at(0)?.parameters?.at(0);
+ let subtype = paramType
+ ? typeChecker.getTypeOfSymbolAtLocation(paramType, symbolNode!)
+ : propType;
+
+ subtype = subtype.getNumberIndexType() ?? subtype;
+
+ return {
+ name: prop.getName(),
+ type: typeChecker.typeToString(subtype),
+ tags: getJsDocTags(ts, typeChecker, prop),
+ description: ts.displayPartsToString(
+ prop.getDocumentationComment(typeChecker),
+ ),
+ schema: this.resolveSchema(subtype),
+ };
+ }
+
+ public resolveEventSignature(call: ts.Signature): EventMeta {
+ const { symbolNode, typeChecker } = this;
+ const subtype = typeChecker.getTypeOfSymbolAtLocation(
+ call.parameters[1],
+ symbolNode!,
+ );
+ const returnType = call.getReturnType();
+ const typeString = signatureTypeToString(
+ typeChecker,
+ (subtype as ts.TypeReference).target as ts.TupleType,
+ returnType,
+ );
+
+ return {
+ name: (
+ typeChecker.getTypeOfSymbolAtLocation(
+ call.parameters[0],
+ symbolNode!,
+ ) as ts.StringLiteralType
+ ).value,
+ type: typeString,
+ schema: {
+ kind: PropertyMetaKind.FUNC,
+ type: typeString,
+ schema: {
+ isAsync: isPromiseLike(returnType),
+ returnType: this.resolveSchema(returnType),
+ arguments: getSignatureArgsMeta(typeChecker, subtype, (node) =>
+ this.resolveSchema(typeChecker.getTypeAtLocation(node)),
+ ),
+ },
+ },
+ };
+ }
+
+ public resolveExposedProperties(expose: ts.Symbol): ExposeMeta {
+ const { symbolNode, typeChecker, ts } = this;
+ const subtype = typeChecker.getTypeOfSymbolAtLocation(expose, symbolNode!);
+ return {
+ name: expose.getName(),
+ type: typeChecker.typeToString(subtype),
+ tags: getJsDocTags(ts, typeChecker, expose),
+ description: ts.displayPartsToString(
+ expose.getDocumentationComment(typeChecker),
+ ),
+ schema: this.resolveSchema(subtype),
+ };
+ }
+}
diff --git a/suites/dumi-vue-meta/src/types.ts b/suites/dumi-vue-meta/src/types.ts
new file mode 100644
index 0000000000..c9f0d0d414
--- /dev/null
+++ b/suites/dumi-vue-meta/src/types.ts
@@ -0,0 +1,261 @@
+import type ts from 'typescript/lib/tsserverlibrary';
+
+export interface Declaration {
+ file: string;
+ range: [number, number];
+}
+
+/**
+ * Metadata of single component
+ */
+export interface ComponentMeta {
+ name: string;
+ type: TypeMeta;
+ props: PropertyMeta[];
+ events: EventMeta[];
+ slots: SlotMeta[];
+ exposed: ExposeMeta[];
+}
+
+export type ComponentItemMeta =
+ | PropertyMeta
+ | EventMeta
+ | SlotMeta
+ | ExposeMeta;
+
+export interface SingleComponentMeta {
+ component: ComponentMeta;
+ types: Record;
+}
+
+/**
+ * Component library metadata
+ */
+export interface ComponentLibraryMeta {
+ /**
+ * Metadata of all components
+ */
+ components: Record;
+ /**
+ * All exported common types will be stored here to facilitate reference by other types.
+ */
+ types: Record;
+}
+
+/**
+ * Meta information transformer
+ * used to transform standard component library metadata into another format of metadata
+ */
+export type MetaTransformer = (meta: ComponentLibraryMeta) => T;
+
+/**
+ * custom schema resolver
+ */
+export type CustomSchemaResolver = (
+ originMeta: Partial,
+ options: {
+ ts: typeof import('typescript/lib/tsserverlibrary');
+ typeChecker: ts.TypeChecker;
+ symbolNode: ts.Expression;
+ prop: ts.Symbol;
+ targetNode?: ts.Declaration;
+ targetType?: ts.Type;
+ schemaOptions: MetaCheckerSchemaOptions;
+ },
+) => Partial;
+
+export enum TypeMeta {
+ Unknown = 0,
+ Class = 1,
+ Function = 2,
+}
+
+export type JsDocTagMeta = Record;
+
+export interface PropertyMeta {
+ type: string;
+ name: string;
+ default?: string;
+ description: string;
+ global: boolean;
+ required: boolean;
+ tags: JsDocTagMeta;
+ schema: PropertyMetaSchema;
+}
+
+export interface EventMeta {
+ name: string;
+ type: string;
+ description?: string;
+ default?: string;
+ tags?: JsDocTagMeta;
+ schema: PropertyMetaSchema;
+}
+
+export interface SlotMeta {
+ type: string;
+ name: string;
+ default?: string;
+ description: string;
+ tags: JsDocTagMeta;
+ schema: PropertyMetaSchema;
+}
+
+export interface ExposeMeta {
+ type: string;
+ name: string;
+ description: string;
+ tags: JsDocTagMeta;
+ schema: PropertyMetaSchema;
+}
+
+export enum PropertyMetaKind {
+ LITERAL = 'literal',
+ BASIC = 'basic',
+ ENUM = 'enum',
+ ARRAY = 'array',
+ FUNC = 'function',
+ OBJECT = 'object',
+ UNKNOWN = 'unknown',
+ REF = 'ref',
+}
+
+/**
+ * Signature metadata description
+ */
+export interface SignatureMetaSchema {
+ /**
+ * Indicates that the method can be awaited
+ */
+ isAsync: boolean;
+ /**
+ * Return type meta
+ */
+ returnType: PropertyMetaSchema;
+ /**
+ * Function parameter meta
+ */
+ arguments: {
+ key: string;
+ type: string;
+ required: boolean;
+ schema?: PropertyMetaSchema;
+ }[];
+}
+
+export type LiteralPropertyMetaSchema = {
+ kind: PropertyMetaKind.LITERAL;
+ type: string;
+ value: string;
+};
+export type BasicPropertyMetaSchema = {
+ kind: PropertyMetaKind.BASIC;
+ type: string;
+};
+export type EnumPropertyMetaSchema = {
+ kind: PropertyMetaKind.ENUM;
+ type: string;
+ schema?: PropertyMetaSchema[];
+ ref?: string;
+};
+export type ArrayPropertyMetaSchema = {
+ kind: PropertyMetaKind.ARRAY;
+ type: string;
+ schema?: PropertyMetaSchema[];
+ ref?: string;
+};
+export type FuncPropertyMetaSchema = {
+ kind: PropertyMetaKind.FUNC;
+ type: string;
+ schema?: SignatureMetaSchema;
+ ref?: string;
+};
+export type ObjectPropertyMetaSchema = {
+ kind: PropertyMetaKind.OBJECT;
+ type: string;
+ schema?: Record;
+ ref?: string;
+};
+/**
+ * Note: The unknown type is mainly used to carry types that are not parsed themselves,
+ * but whose type parameters need to be checked.
+ */
+export type UnknownPropertyMetaSchema = {
+ kind: PropertyMetaKind.UNKNOWN;
+ type: string;
+ schema?: PropertyMetaSchema[];
+ ref?: string;
+};
+/**
+ * This type is just a placeholder, it points to other types
+ */
+export type RefPropertyMetaSchema = { kind: PropertyMetaKind.REF; ref: string };
+
+/**
+ * Note: The `ref` prop is designed for schema flattening.
+ * Type declarations in the project will be uniformly placed in a Map,
+ * and its key is the hash value calculated from the file where the declaration is located and the declaration name.
+ * So you can use `ref` to find the corresponding schema in the Map
+ */
+export type PropertyMetaSchema =
+ | LiteralPropertyMetaSchema
+ | BasicPropertyMetaSchema
+ | EnumPropertyMetaSchema
+ | ArrayPropertyMetaSchema
+ | FuncPropertyMetaSchema
+ | ObjectPropertyMetaSchema
+ | UnknownPropertyMetaSchema
+ | RefPropertyMetaSchema;
+
+/**
+ * Schema resolver options
+ */
+export type MetaCheckerSchemaOptions = {
+ /**
+ * By default, type resolution in node_module will be abandoned.
+ */
+ exclude?: string | RegExp | (string | RegExp)[] | ((name: string) => boolean);
+ /**
+ * A list of type names to be ignored in expending in schema.
+ * Can be functions to ignore types dynamically.
+ */
+ ignore?: (
+ | string
+ | ((
+ name: string,
+ type: ts.Type,
+ typeChecker: ts.TypeChecker,
+ ) => boolean | void | undefined | null)
+ )[];
+ /**
+ * In addition to ignoring the type itself, whether to ignore the type parameters it carries.
+ * By default, the type parameters it carries will be parsed.
+ * For example, `Promise<{ a: string }>`, if you use option`exclude` or `ignore` to ignore `Promise`,
+ * `{ a: string }` will still be parsed by default.
+ */
+ ignoreTypeArgs?: boolean;
+
+ /**
+ * Customized schema resolvers for some special props definition methods, such as `vue-types`
+ */
+ customResovlers?: CustomSchemaResolver[];
+};
+
+/**
+ * Checker Options
+ */
+export interface MetaCheckerOptions {
+ schema?: MetaCheckerSchemaOptions;
+ forceUseTs?: boolean;
+ printer?: ts.PrinterOptions;
+ /**
+ * Whether to filter global props, the default is true
+ * If it is true, global props in vue, such as key and ref, will be filtered out
+ */
+ filterGlobalProps?: boolean;
+ /**
+ * Whether to enable filtering for exposed attributes, the default is true
+ * If true, only methods or properties identified by `@exposed/@expose` will be exposed in jsx
+ */
+ filterExposed?: boolean;
+}
diff --git a/suites/dumi-vue-meta/src/utils.ts b/suites/dumi-vue-meta/src/utils.ts
new file mode 100644
index 0000000000..e21862d293
--- /dev/null
+++ b/suites/dumi-vue-meta/src/utils.ts
@@ -0,0 +1,153 @@
+import { createHash } from 'crypto';
+import * as path from 'typesafe-path/posix';
+import type ts from 'typescript/lib/tsserverlibrary';
+import { PropertyMetaSchema, SignatureMetaSchema } from './types';
+
+export function createNodeVisitor(
+ ts: typeof import('typescript/lib/tsserverlibrary'),
+) {
+ return function visitNode(
+ node: ts.Node,
+ predicate: (node: ts.Node) => boolean,
+ ): T | undefined {
+ if (predicate(node)) {
+ return node as T;
+ }
+ return ts.forEachChild(node, (cnode: ts.Node) => {
+ return visitNode(cnode, predicate);
+ });
+ };
+}
+
+export function getNodeOfSymbol(symbol?: ts.Symbol) {
+ if (symbol?.declarations?.length) {
+ return symbol.declarations[0];
+ }
+}
+
+export function getNodeOfType(type: ts.Type) {
+ const symbol = type.aliasSymbol ?? type.symbol;
+ return getNodeOfSymbol(symbol);
+}
+
+export function getJsDocTags(
+ ts: typeof import('typescript/lib/tsserverlibrary'),
+ typeChecker: ts.TypeChecker,
+ prop: ts.Symbol | ts.Signature,
+) {
+ return prop.getJsDocTags(typeChecker).reduce((doc, tag) => {
+ if (!doc[tag.name]) {
+ doc[tag.name] = [];
+ }
+ doc[tag.name].push(
+ tag.text !== undefined ? ts.displayPartsToString(tag.text) : '',
+ );
+ return doc;
+ }, {} as Record);
+}
+
+export function reducer(acc: any, cur: any) {
+ acc[cur.name] = cur;
+ return acc;
+}
+
+export function hasQuestionToken(
+ ts: typeof import('typescript/lib/tsserverlibrary'),
+ prop: ts.Symbol,
+) {
+ return prop.valueDeclaration
+ ? ts.isParameter(prop.valueDeclaration) ||
+ ts.isNamedTupleMember(prop.valueDeclaration)
+ ? !!prop.valueDeclaration.questionToken
+ : false
+ : false;
+}
+
+export function getTypeOfSignature(
+ typeChecker: ts.TypeChecker,
+ call: ts.Signature,
+) {
+ const node = call.getDeclaration();
+ return typeChecker.getTypeAtLocation(node);
+}
+
+export function isPromiseLike(type: ts.Type) {
+ const symbol = type.getSymbol();
+ return symbol?.members?.has('then' as ts.__String) || false;
+}
+
+export function getSignatureArgsMeta(
+ typeChecker: ts.TypeChecker,
+ subtype: ts.Type,
+ argTypeTransform?: (
+ node: ts.NamedTupleMember | ts.ParameterDeclaration,
+ ) => PropertyMetaSchema,
+) {
+ const target = (subtype as ts.TypeReference).target;
+ if (!target) return [];
+ const labeledElementDeclarations = (target as ts.TupleType)
+ .labeledElementDeclarations;
+ if (!labeledElementDeclarations) return [];
+ const args: SignatureMetaSchema['arguments'] = [];
+ labeledElementDeclarations.forEach((node) => {
+ if (!node) return;
+ args.push({
+ key: node.name.getText(),
+ required: !node.questionToken,
+ type: typeChecker.typeToString(typeChecker.getTypeAtLocation(node)),
+ schema: argTypeTransform && argTypeTransform(node),
+ });
+ });
+ return args;
+}
+
+export function signatureTypeToString(
+ typeChecker: ts.TypeChecker,
+ args: ts.TupleType,
+ returnType: ts.Type,
+) {
+ const labeledElementDeclarations = args.labeledElementDeclarations || [];
+
+ const argStringArray = labeledElementDeclarations.reduce((acc, node) => {
+ if (!node) return acc;
+ const typeString = typeChecker.typeToString(
+ typeChecker.getTypeAtLocation(node),
+ );
+ const questionToken = !!node.questionToken ? '?' : '';
+ acc.push(`${node.name.getText()}${questionToken}: ${typeString}`);
+ return acc;
+ }, [] as string[]);
+
+ return `(${argStringArray.join(',')}) => ${typeChecker.typeToString(
+ returnType,
+ )}`;
+}
+
+export const BasicTypes: Record = {
+ string: 'string',
+ number: 'number',
+ boolean: 'boolean',
+ bigint: 'bigint',
+ symbol: 'symbol',
+ null: 'null',
+ undefined: 'undefined',
+ void: 'void',
+ any: 'any',
+ unknown: 'unknown',
+ never: 'never',
+};
+
+export function createRef(type: string, fileName: string) {
+ const hash = createHash('md5');
+ hash.update(`${fileName}///${type}`);
+ return hash.digest('hex');
+}
+
+const windowsPathReg = /\\/g;
+
+export function getPosixPath(anyPath: string) {
+ return (anyPath as path.OsPath).replace(
+ windowsPathReg,
+ '/',
+ ) as path.PosixPath;
+}
diff --git a/suites/dumi-vue-meta/tests/.eslintrc.js b/suites/dumi-vue-meta/tests/.eslintrc.js
new file mode 100644
index 0000000000..3f23a8f616
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/.eslintrc.js
@@ -0,0 +1,13 @@
+module.exports = {
+ root: true,
+ parser: 'vue-eslint-parser',
+ parserOptions: {
+ parser: '@typescript-eslint/parser',
+ sourceType: 'module',
+ ecmaVersion: 2020,
+ ecmaFeatures: {
+ jsx: true,
+ },
+ },
+ rules: {},
+};
diff --git a/suites/dumi-vue-meta/tests/__snapshots__/index.test.ts.snap b/suites/dumi-vue-meta/tests/__snapshots__/index.test.ts.snap
new file mode 100644
index 0000000000..d2a2ab7f90
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/__snapshots__/index.test.ts.snap
@@ -0,0 +1,447 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`sfc: single Vue component meta > emits/events > event signature meta should be same as normal methods 1`] = `
+{
+ "name": "change",
+ "schema": {
+ "kind": "function",
+ "schema": {
+ "arguments": [
+ {
+ "key": "payload",
+ "required": true,
+ "schema": {
+ "kind": "object",
+ "schema": {
+ "name": {
+ "description": "",
+ "name": "name",
+ "required": true,
+ "schema": {
+ "kind": "basic",
+ "type": "string",
+ },
+ "tags": {},
+ "type": "string",
+ },
+ },
+ "type": "{ name: string; }",
+ },
+ "type": "{ name: string; }",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "kind": "basic",
+ "type": "void",
+ },
+ },
+ "type": "(payload: { name: string; }) => void",
+ },
+ "type": "(payload: { name: string; }) => void",
+}
+`;
+
+exports[`sfc: single Vue component meta > emits/events > events defined via defineEmits 1`] = `
+{
+ "name": "click",
+ "schema": {
+ "kind": "function",
+ "schema": {
+ "arguments": [
+ {
+ "key": "event",
+ "required": true,
+ "schema": {
+ "kind": "unknown",
+ "type": "MouseEvent",
+ },
+ "type": "MouseEvent",
+ },
+ {
+ "key": "extra",
+ "required": false,
+ "schema": {
+ "kind": "basic",
+ "type": "string",
+ },
+ "type": "string",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "kind": "basic",
+ "type": "void",
+ },
+ },
+ "type": "(event: MouseEvent,extra?: string) => void",
+ },
+ "type": "(event: MouseEvent,extra?: string) => void",
+}
+`;
+
+exports[`sfc: single Vue component meta > expose api > ref api 1`] = `
+{
+ "description": "",
+ "name": "focus",
+ "schema": {
+ "kind": "function",
+ "schema": {
+ "arguments": [],
+ "isAsync": false,
+ "returnType": {
+ "kind": "basic",
+ "type": "void",
+ },
+ },
+ "type": "() => void",
+ },
+ "tags": {
+ "description": [
+ "The signature of the expose api should be obtained from here",
+ ],
+ "exposed": [
+ "",
+ ],
+ },
+ "type": "() => void",
+}
+`;
+
+exports[`sfc: single Vue component meta > slots > scoped slots 1`] = `
+{
+ "description": "item",
+ "name": "item",
+ "schema": {
+ "kind": "object",
+ "schema": {
+ "extra": {
+ "description": "",
+ "name": "extra",
+ "required": false,
+ "schema": {
+ "kind": "basic",
+ "type": "boolean",
+ },
+ "tags": {},
+ "type": "boolean",
+ },
+ "list": {
+ "description": "",
+ "name": "list",
+ "required": true,
+ "schema": {
+ "kind": "array",
+ "schema": [
+ {
+ "kind": "basic",
+ "type": "string",
+ },
+ ],
+ "type": "string[]",
+ },
+ "tags": {},
+ "type": "string[]",
+ },
+ },
+ "type": "{ list: string[]; extra?: boolean; }",
+ },
+ "tags": {},
+ "type": "{ list: string[]; extra?: boolean; }",
+}
+`;
+
+exports[`sfc-alias: single Vue component meta > emits/events > event signature meta should be same as normal methods 1`] = `
+{
+ "name": "change",
+ "schema": {
+ "kind": "function",
+ "schema": {
+ "arguments": [
+ {
+ "key": "payload",
+ "required": true,
+ "schema": {
+ "kind": "object",
+ "schema": {
+ "name": {
+ "description": "",
+ "name": "name",
+ "required": true,
+ "schema": {
+ "kind": "basic",
+ "type": "string",
+ },
+ "tags": {},
+ "type": "string",
+ },
+ },
+ "type": "{ name: string; }",
+ },
+ "type": "{ name: string; }",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "kind": "basic",
+ "type": "void",
+ },
+ },
+ "type": "(payload: { name: string; }) => void",
+ },
+ "type": "(payload: { name: string; }) => void",
+}
+`;
+
+exports[`sfc-alias: single Vue component meta > emits/events > events defined via defineEmits 1`] = `
+{
+ "name": "click",
+ "schema": {
+ "kind": "function",
+ "schema": {
+ "arguments": [
+ {
+ "key": "event",
+ "required": true,
+ "schema": {
+ "kind": "unknown",
+ "type": "MouseEvent",
+ },
+ "type": "MouseEvent",
+ },
+ {
+ "key": "extra",
+ "required": false,
+ "schema": {
+ "kind": "basic",
+ "type": "string",
+ },
+ "type": "string",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "kind": "basic",
+ "type": "void",
+ },
+ },
+ "type": "(event: MouseEvent,extra?: string) => void",
+ },
+ "type": "(event: MouseEvent,extra?: string) => void",
+}
+`;
+
+exports[`sfc-alias: single Vue component meta > expose api > ref api 1`] = `
+{
+ "description": "",
+ "name": "focus",
+ "schema": {
+ "kind": "function",
+ "schema": {
+ "arguments": [],
+ "isAsync": false,
+ "returnType": {
+ "kind": "basic",
+ "type": "void",
+ },
+ },
+ "type": "() => void",
+ },
+ "tags": {
+ "description": [
+ "The signature of the expose api should be obtained from here",
+ ],
+ "exposed": [
+ "",
+ ],
+ },
+ "type": "() => void",
+}
+`;
+
+exports[`sfc-alias: single Vue component meta > slots > scoped slots 1`] = `
+{
+ "description": "item",
+ "name": "item",
+ "schema": {
+ "kind": "object",
+ "schema": {
+ "extra": {
+ "description": "",
+ "name": "extra",
+ "required": false,
+ "schema": {
+ "kind": "basic",
+ "type": "boolean",
+ },
+ "tags": {},
+ "type": "boolean",
+ },
+ "list": {
+ "description": "",
+ "name": "list",
+ "required": true,
+ "schema": {
+ "kind": "array",
+ "schema": [
+ {
+ "kind": "basic",
+ "type": "string",
+ },
+ ],
+ "type": "string[]",
+ },
+ "tags": {},
+ "type": "string[]",
+ },
+ },
+ "type": "{ list: string[]; extra?: boolean; }",
+ },
+ "tags": {},
+ "type": "{ list: string[]; extra?: boolean; }",
+}
+`;
+
+exports[`tsx: single Vue component meta > emits/events > event signature meta should be same as normal methods 1`] = `
+{
+ "name": "change",
+ "schema": {
+ "kind": "function",
+ "schema": {
+ "arguments": [
+ {
+ "key": "payload",
+ "required": false,
+ "schema": {
+ "kind": "object",
+ "schema": {
+ "name": {
+ "description": "",
+ "name": "name",
+ "required": true,
+ "schema": {
+ "kind": "basic",
+ "type": "string",
+ },
+ "tags": {},
+ "type": "string",
+ },
+ },
+ "type": "{ name: string; }",
+ },
+ "type": "{ name: string; }",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "kind": "basic",
+ "type": "void",
+ },
+ },
+ "type": "(payload?: { name: string; }) => void",
+ },
+ "type": "(payload?: { name: string; }) => void",
+}
+`;
+
+exports[`tsx: single Vue component meta > expose api > ref api 1`] = `
+{
+ "description": "The signature of the expose api should be obtained from here",
+ "name": "focus",
+ "schema": {
+ "kind": "function",
+ "schema": {
+ "arguments": [],
+ "isAsync": false,
+ "returnType": {
+ "kind": "basic",
+ "type": "void",
+ },
+ },
+ "type": "() => void",
+ },
+ "tags": {
+ "exposed": [
+ "",
+ ],
+ },
+ "type": "() => void",
+}
+`;
+
+exports[`tsx: single Vue component meta > props > events in props 1`] = `
+{
+ "kind": "function",
+ "schema": {
+ "arguments": [
+ {
+ "key": "e",
+ "required": true,
+ "schema": {
+ "kind": "unknown",
+ "type": "MouseEvent",
+ },
+ "type": "MouseEvent",
+ },
+ {
+ "key": "extra",
+ "required": false,
+ "schema": {
+ "kind": "basic",
+ "type": "string",
+ },
+ "type": "string",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "kind": "basic",
+ "type": "void",
+ },
+ },
+ "type": "(e: MouseEvent, extra?: string) => void",
+}
+`;
+
+exports[`tsx: single Vue component meta > slots > scoped slots 1`] = `
+{
+ "description": "item",
+ "name": "item",
+ "schema": {
+ "kind": "object",
+ "schema": {
+ "extra": {
+ "description": "",
+ "name": "extra",
+ "required": false,
+ "schema": {
+ "kind": "basic",
+ "type": "boolean",
+ },
+ "tags": {},
+ "type": "boolean",
+ },
+ "list": {
+ "description": "",
+ "name": "list",
+ "required": true,
+ "schema": {
+ "kind": "array",
+ "schema": [
+ {
+ "kind": "basic",
+ "type": "string",
+ },
+ ],
+ "type": "string[]",
+ },
+ "tags": {},
+ "type": "string[]",
+ },
+ },
+ "type": "{ list: string[]; extra?: boolean; }",
+ },
+ "tags": {},
+ "type": "{ list: string[]; extra?: boolean; }",
+}
+`;
diff --git a/suites/dumi-vue-meta/tests/__snapshots__/transformer.test.ts.snap b/suites/dumi-vue-meta/tests/__snapshots__/transformer.test.ts.snap
new file mode 100644
index 0000000000..f8214938cb
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/__snapshots__/transformer.test.ts.snap
@@ -0,0 +1,639 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`dumi-assets-types transformer 1`] = `
+{
+ "Foo": {
+ "eventsConfig": {
+ "properties": {
+ "change": {
+ "description": undefined,
+ "signature": {
+ "arguments": [
+ {
+ "hasQuestionToken": true,
+ "key": "payload",
+ "type": "{ name: string; }",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "type": "void",
+ },
+ },
+ "tags": undefined,
+ "title": "change",
+ "type": "function",
+ },
+ "click": {
+ "description": "click event",
+ "signature": {
+ "arguments": [
+ {
+ "hasQuestionToken": false,
+ "key": "e",
+ "type": "MouseEvent",
+ },
+ {
+ "hasQuestionToken": true,
+ "key": "extra",
+ "type": "string",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "type": "void",
+ },
+ },
+ "tags": {},
+ "title": "click",
+ "type": "function",
+ },
+ "confirm": {
+ "description": "",
+ "signature": {
+ "arguments": [
+ {
+ "hasQuestionToken": false,
+ "key": "output",
+ "type": "{ children: any[]; }",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "type": "void",
+ },
+ },
+ "tags": {},
+ "title": "confirm",
+ "type": "function",
+ },
+ },
+ "type": "object",
+ },
+ "id": "Foo",
+ "methodsConfig": {
+ "properties": {
+ "count": {
+ "description": "",
+ "tags": {
+ "exposed": [
+ "",
+ ],
+ },
+ "title": "count",
+ "type": "number",
+ },
+ "focus": {
+ "description": "The signature of the expose api should be obtained from here",
+ "signature": {
+ "arguments": [],
+ "isAsync": false,
+ "returnType": {
+ "type": "void",
+ },
+ },
+ "tags": {
+ "exposed": [
+ "",
+ ],
+ },
+ "title": "focus",
+ "type": "function",
+ },
+ },
+ "type": "object",
+ },
+ "propsConfig": {
+ "properties": {
+ "a": {
+ "default": [],
+ "description": "",
+ "items": {
+ "properties": {
+ "a": {
+ "description": "",
+ "properties": {
+ "id": {
+ "description": "",
+ "tags": {},
+ "title": "id",
+ "type": "string",
+ },
+ },
+ "required": [
+ "id",
+ ],
+ "tags": {},
+ "title": "a",
+ "type": "object",
+ },
+ },
+ "required": [
+ "a",
+ ],
+ "type": "object",
+ },
+ "tags": {},
+ "title": "a",
+ "type": "array",
+ },
+ "b": {
+ "default": {},
+ "description": "",
+ "properties": {
+ "c": {
+ "description": "",
+ "tags": {},
+ "title": "c",
+ "type": "string",
+ },
+ },
+ "required": [],
+ "tags": {
+ "default": [
+ "{}",
+ ],
+ },
+ "title": "b",
+ "type": "object",
+ },
+ "c": {
+ "description": "",
+ "oneOf": [
+ {
+ "const": "\\"1\\"",
+ },
+ {
+ "const": "\\"2\\"",
+ },
+ {
+ "const": "\\"3\\"",
+ },
+ ],
+ "tags": {},
+ "title": "c",
+ },
+ "d": {
+ "default": 1,
+ "description": "",
+ "tags": {},
+ "title": "d",
+ "type": "number",
+ },
+ "dom": {
+ "default": null,
+ "description": "",
+ "tags": {},
+ "title": "dom",
+ "type": "HTMLElement",
+ },
+ "e": {
+ "description": "",
+ "oneOf": [
+ {
+ "properties": {
+ "a": {
+ "description": "",
+ "properties": {
+ "id": {
+ "description": "",
+ "tags": {},
+ "title": "id",
+ "type": "string",
+ },
+ },
+ "required": [
+ "id",
+ ],
+ "tags": {},
+ "title": "a",
+ "type": "object",
+ },
+ },
+ "required": [
+ "a",
+ ],
+ "type": "object",
+ },
+ {
+ "const": "1",
+ },
+ ],
+ "tags": {},
+ "title": "e",
+ },
+ "func": {
+ "description": "",
+ "signature": {
+ "arguments": [
+ {
+ "hasQuestionToken": false,
+ "key": "args",
+ "type": "PromiseArgs",
+ },
+ ],
+ "isAsync": true,
+ "returnType": "Promise<{ type?: string; }>",
+ },
+ "tags": {},
+ "title": "func",
+ "type": "function",
+ },
+ "order": {
+ "default": 0,
+ "description": "顺序",
+ "tags": {
+ "description": [
+ "顺序",
+ ],
+ },
+ "title": "order",
+ "type": "number",
+ },
+ "title": {
+ "default": "",
+ "description": "标题",
+ "tags": {
+ "default": [
+ "''",
+ ],
+ "description": [
+ "标题",
+ ],
+ },
+ "title": "title",
+ "type": "string",
+ },
+ },
+ "required": [
+ "b",
+ "title",
+ "order",
+ "a",
+ ],
+ "type": "object",
+ },
+ "slotsConfig": {
+ "properties": {
+ "icon": {
+ "description": "icon",
+ "tags": {
+ "description": [
+ "icon",
+ ],
+ },
+ "title": "icon",
+ "type": "any",
+ },
+ "item": {
+ "description": "item",
+ "properties": {
+ "extra": {
+ "description": "",
+ "tags": {},
+ "title": "extra",
+ "type": "boolean",
+ },
+ "list": {
+ "description": "",
+ "items": {
+ "type": "string",
+ },
+ "tags": {},
+ "title": "list",
+ "type": "array",
+ },
+ },
+ "required": [
+ "list",
+ ],
+ "tags": {},
+ "title": "item",
+ "type": "object",
+ },
+ },
+ "type": "object",
+ },
+ "title": "Foo",
+ "type": "COMPONENT",
+ },
+ "FooSfc": {
+ "eventsConfig": {
+ "properties": {
+ "change": {
+ "description": undefined,
+ "signature": {
+ "arguments": [
+ {
+ "hasQuestionToken": false,
+ "key": "payload",
+ "type": "{ name: string; }",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "type": "void",
+ },
+ },
+ "tags": undefined,
+ "title": "change",
+ "type": "function",
+ },
+ "click": {
+ "description": undefined,
+ "signature": {
+ "arguments": [
+ {
+ "hasQuestionToken": false,
+ "key": "event",
+ "type": "MouseEvent",
+ },
+ {
+ "hasQuestionToken": true,
+ "key": "extra",
+ "type": "string",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "type": "void",
+ },
+ },
+ "tags": undefined,
+ "title": "click",
+ "type": "function",
+ },
+ "confirm": {
+ "description": "",
+ "signature": {
+ "arguments": [
+ {
+ "hasQuestionToken": false,
+ "key": "output",
+ "type": "{ children: any[]; }",
+ },
+ ],
+ "isAsync": false,
+ "returnType": {
+ "type": "void",
+ },
+ },
+ "tags": {},
+ "title": "confirm",
+ "type": "function",
+ },
+ },
+ "type": "object",
+ },
+ "id": "FooSfc",
+ "methodsConfig": {
+ "properties": {
+ "count": {
+ "description": "",
+ "tags": {
+ "exposed": [
+ "",
+ ],
+ },
+ "title": "count",
+ "type": "number",
+ },
+ "focus": {
+ "description": "The signature of the expose api should be obtained from here",
+ "signature": {
+ "arguments": [],
+ "isAsync": false,
+ "returnType": {
+ "type": "void",
+ },
+ },
+ "tags": {
+ "description": [
+ "The signature of the expose api should be obtained from here",
+ ],
+ "exposed": [
+ "",
+ ],
+ },
+ "title": "focus",
+ "type": "function",
+ },
+ },
+ "type": "object",
+ },
+ "propsConfig": {
+ "properties": {
+ "a": {
+ "default": [],
+ "description": "",
+ "items": {
+ "properties": {
+ "a": {
+ "description": "",
+ "properties": {
+ "id": {
+ "description": "",
+ "tags": {},
+ "title": "id",
+ "type": "string",
+ },
+ },
+ "required": [
+ "id",
+ ],
+ "tags": {},
+ "title": "a",
+ "type": "object",
+ },
+ },
+ "required": [
+ "a",
+ ],
+ "type": "object",
+ },
+ "tags": {},
+ "title": "a",
+ "type": "array",
+ },
+ "b": {
+ "default": {},
+ "description": "",
+ "properties": {
+ "c": {
+ "description": "",
+ "tags": {},
+ "title": "c",
+ "type": "string",
+ },
+ },
+ "required": [],
+ "tags": {
+ "default": [
+ "{}",
+ ],
+ },
+ "title": "b",
+ "type": "object",
+ },
+ "c": {
+ "description": "",
+ "oneOf": [
+ {
+ "const": "\\"1\\"",
+ },
+ {
+ "const": "\\"2\\"",
+ },
+ {
+ "const": "\\"3\\"",
+ },
+ ],
+ "tags": {},
+ "title": "c",
+ },
+ "d": {
+ "default": 1,
+ "description": "",
+ "tags": {},
+ "title": "d",
+ "type": "number",
+ },
+ "dom": {
+ "default": null,
+ "description": "",
+ "tags": {},
+ "title": "dom",
+ "type": "HTMLElement",
+ },
+ "e": {
+ "description": "",
+ "oneOf": [
+ {
+ "properties": {
+ "a": {
+ "description": "",
+ "properties": {
+ "id": {
+ "description": "",
+ "tags": {},
+ "title": "id",
+ "type": "string",
+ },
+ },
+ "required": [
+ "id",
+ ],
+ "tags": {},
+ "title": "a",
+ "type": "object",
+ },
+ },
+ "required": [
+ "a",
+ ],
+ "type": "object",
+ },
+ {
+ "const": "1",
+ },
+ ],
+ "tags": {},
+ "title": "e",
+ },
+ "func": {
+ "description": "",
+ "signature": {
+ "arguments": [
+ {
+ "hasQuestionToken": false,
+ "key": "args",
+ "type": "PromiseArgs",
+ },
+ ],
+ "isAsync": true,
+ "returnType": "Promise<{ type?: string; }>",
+ },
+ "tags": {},
+ "title": "func",
+ "type": "function",
+ },
+ "order": {
+ "default": 0,
+ "description": "顺序",
+ "tags": {
+ "description": [
+ "顺序",
+ ],
+ },
+ "title": "order",
+ "type": "number",
+ },
+ "title": {
+ "default": "",
+ "description": "标题",
+ "tags": {
+ "default": [
+ "''",
+ ],
+ "description": [
+ "标题",
+ ],
+ },
+ "title": "title",
+ "type": "string",
+ },
+ },
+ "required": [
+ "b",
+ "title",
+ "order",
+ "a",
+ ],
+ "type": "object",
+ },
+ "slotsConfig": {
+ "properties": {
+ "icon": {
+ "description": "icon",
+ "tags": {
+ "description": [
+ "icon",
+ ],
+ },
+ "title": "icon",
+ "type": "any",
+ },
+ "item": {
+ "description": "item",
+ "properties": {
+ "extra": {
+ "description": "",
+ "tags": {},
+ "title": "extra",
+ "type": "boolean",
+ },
+ "list": {
+ "description": "",
+ "items": {
+ "type": "string",
+ },
+ "tags": {},
+ "title": "list",
+ "type": "array",
+ },
+ },
+ "required": [
+ "list",
+ ],
+ "tags": {},
+ "title": "item",
+ "type": "object",
+ },
+ },
+ "type": "object",
+ },
+ "title": "FooSfc",
+ "type": "COMPONENT",
+ },
+}
+`;
diff --git a/suites/dumi-vue-meta/tests/fixtures/externalProps.ts b/suites/dumi-vue-meta/tests/fixtures/externalProps.ts
new file mode 100644
index 0000000000..a2da7c8ad0
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/externalProps.ts
@@ -0,0 +1,17 @@
+import { PropType } from 'vue';
+import { object, oneOf } from 'vue-types';
+
+export const order = {
+ type: Number,
+ required: true,
+ default: 0,
+};
+
+export const baseProps = {
+ /**
+ * @default {}
+ */
+ b: object<{ c?: string }>().def({}).isRequired,
+ c: String as PropType<'1' | '2' | '3'>,
+ d: oneOf([1, 2, 3]).def(1),
+};
diff --git a/suites/dumi-vue-meta/tests/fixtures/index.ts b/suites/dumi-vue-meta/tests/fixtures/index.ts
new file mode 100644
index 0000000000..44ecf8d5e1
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/index.ts
@@ -0,0 +1,6 @@
+export { default as FooSfc } from './sfc/foo.vue';
+export * from './tsx/index';
+
+export function fooFunc(a: string) {
+ return a;
+}
diff --git a/suites/dumi-vue-meta/tests/fixtures/props.ts b/suites/dumi-vue-meta/tests/fixtures/props.ts
new file mode 100644
index 0000000000..9215d50a46
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/props.ts
@@ -0,0 +1,59 @@
+import { PropType } from 'vue';
+import { baseProps, order } from './externalProps';
+
+export interface AItem {
+ id: string;
+}
+
+export interface A {
+ a: AItem;
+}
+
+export type JSXComponent = Component & {
+ new (): ExposedApi;
+};
+
+export type PromiseArgs = {
+ args: string[];
+};
+
+export const fooProps = {
+ /**
+ * @description 标题
+ * @default ''
+ */
+ title: {
+ type: String,
+ required: true,
+ default: '标题',
+ },
+ /**
+ * @description 顺序
+ */
+ order,
+ a: {
+ type: Array,
+ required: true,
+ default: [],
+ },
+ ...baseProps,
+ e: [Object, Number] as PropType,
+ onConfirm: Function as PropType<(output: { children: any[] }) => void>,
+ dom: {
+ type: Object as PropType,
+ default: null,
+ },
+ func: Function as PropType<(args: PromiseArgs) => Promise<{ type?: string }>>,
+};
+
+export type FooSlotsType = {
+ /**
+ * icon
+ * @description icon
+ */
+ icon?: any;
+ /**
+ * item
+ */
+ item?: { list: string[]; extra?: boolean };
+};
diff --git a/suites/dumi-vue-meta/tests/fixtures/sfc-alias/foo.vue b/suites/dumi-vue-meta/tests/fixtures/sfc-alias/foo.vue
new file mode 100644
index 0000000000..914611967b
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/sfc-alias/foo.vue
@@ -0,0 +1,65 @@
+
+
+ {{props.a}}
+ {{slots?.icon}}
+ {{slots?.item({ list: [], extra: true })}}
+
+
+
+
diff --git a/suites/dumi-vue-meta/tests/fixtures/sfc-alias/index.ts b/suites/dumi-vue-meta/tests/fixtures/sfc-alias/index.ts
new file mode 100644
index 0000000000..8beac8a391
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/sfc-alias/index.ts
@@ -0,0 +1 @@
+export { default as Foo } from './foo.vue';
diff --git a/suites/dumi-vue-meta/tests/fixtures/sfc/foo.vue b/suites/dumi-vue-meta/tests/fixtures/sfc/foo.vue
new file mode 100644
index 0000000000..6e79aa2414
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/sfc/foo.vue
@@ -0,0 +1,67 @@
+
+
+ {{props.a}}
+ {{slots?.icon}}
+ {{slots?.item({ list: [], extra: true })}}
+
+
+
+
diff --git a/suites/dumi-vue-meta/tests/fixtures/sfc/index.ts b/suites/dumi-vue-meta/tests/fixtures/sfc/index.ts
new file mode 100644
index 0000000000..8beac8a391
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/sfc/index.ts
@@ -0,0 +1 @@
+export { default as Foo } from './foo.vue';
diff --git a/suites/dumi-vue-meta/tests/fixtures/tsconfig.json b/suites/dumi-vue-meta/tests/fixtures/tsconfig.json
new file mode 100644
index 0000000000..10019c14cb
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ "compilerOptions": {
+ "declaration": true,
+ "skipLibCheck": true,
+ "esModuleInterop": true,
+ "baseUrl": "./",
+ "jsx": "preserve",
+ "jsxImportSource": "vue"
+ },
+ "include": ["**/*"]
+}
diff --git a/suites/dumi-vue-meta/tests/fixtures/tsx/foo.tsx b/suites/dumi-vue-meta/tests/fixtures/tsx/foo.tsx
new file mode 100644
index 0000000000..9cd4760907
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/tsx/foo.tsx
@@ -0,0 +1,65 @@
+import { PropType, SlotsType, defineComponent, ref, shallowRef } from 'vue';
+import { FooSlotsType, JSXComponent, fooProps } from '../props';
+
+const Foo = defineComponent({
+ name: 'Foo',
+ props: {
+ ...fooProps,
+ /**
+ * click event
+ */
+ onClick: Function as PropType<(e: MouseEvent, extra?: string) => void>,
+ },
+ slots: Object as SlotsType,
+ emits: {
+ click(e: MouseEvent, extra?: string) {
+ return !!e.target && !!extra;
+ },
+ change(payload?: { name: string }) {
+ return !!payload.name;
+ },
+ },
+ expose: ['focus', 'count'],
+ setup(props, { expose, emit, slots }) {
+ const rootRef = shallowRef(null);
+ const publicCount = ref(0);
+ const focus = () => {
+ rootRef.value?.focus();
+ };
+ expose({
+ focus,
+ count: publicCount,
+ });
+
+ function handleClick(e: MouseEvent) {
+ emit('click', e, 'extra');
+ }
+ function handleChange() {
+ emit('change', {
+ name: 'change',
+ });
+ }
+ return () => (
+
+ {props.a}
+ {slots?.icon}
+ {slots?.item({ list: [], extra: true })}
+
+ );
+ },
+});
+
+export default Foo as JSXComponent<
+ typeof Foo,
+ {
+ /**
+ * The signature of the expose api should be obtained from here
+ * @exposed
+ */
+ focus: () => void;
+ /**
+ * @exposed
+ */
+ count: number;
+ }
+>;
diff --git a/suites/dumi-vue-meta/tests/fixtures/tsx/index.ts b/suites/dumi-vue-meta/tests/fixtures/tsx/index.ts
new file mode 100644
index 0000000000..fb5cc1391c
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/fixtures/tsx/index.ts
@@ -0,0 +1,2 @@
+export type { A, AItem, PromiseArgs } from '../props';
+export { default as Foo } from './foo';
diff --git a/suites/dumi-vue-meta/tests/index.test.ts b/suites/dumi-vue-meta/tests/index.test.ts
new file mode 100644
index 0000000000..1b3aea1b13
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/index.test.ts
@@ -0,0 +1,203 @@
+import path from 'path';
+import { afterAll, describe, expect, test } from 'vitest';
+import type {
+ EnumPropertyMetaSchema,
+ MetaCheckerOptions,
+ PropertyMeta,
+} from '../src/index';
+import { createProject, vueTypesSchemaResolver } from '../src/index';
+import { toRecord } from './utils';
+
+const checkerOptions: MetaCheckerOptions = {
+ forceUseTs: true,
+ printer: { newLine: 1 },
+ schema: {
+ customResovlers: [vueTypesSchemaResolver],
+ },
+};
+
+const project = createProject({
+ tsconfigPath: path.resolve(__dirname, 'fixtures/tsconfig.json'),
+ checkerOptions,
+});
+
+function testFeatures(kind: 'tsx' | 'sfc' | 'sfc-alias') {
+ describe(`${kind}: single Vue component meta`, () => {
+ const componentPath = path.resolve(__dirname, `fixtures/${kind}/index.ts`);
+ describe('props', () => {
+ const { component } = project.service.getComponentMeta(
+ componentPath,
+ 'Foo',
+ );
+ const propMap = toRecord(component.props);
+
+ test('option props', () => {
+ const titleProp = propMap['title'];
+ expect(titleProp).toMatchObject({
+ required: true,
+ default: "'标题'",
+ type: 'string',
+ tags: { default: ["''"] },
+ });
+ });
+
+ test('prop referenced by assignment', () => {
+ const orderProp = propMap['order'];
+ expect(orderProp).toMatchObject({
+ required: true,
+ default: '0',
+ type: 'number',
+ });
+ });
+
+ test('props using PropType type assertions', () => {
+ const eProp = propMap['e'] as PropertyMeta;
+ expect(eProp).toMatchObject({
+ required: false,
+ type: 'A | 1',
+ });
+ expect(
+ (eProp.schema as EnumPropertyMetaSchema).schema?.[1],
+ ).toMatchObject({
+ type: 'number',
+ kind: 'literal',
+ value: '1',
+ });
+ });
+
+ test('external reference destructuring assignment', () => {
+ const cProp = propMap['c'];
+ expect(cProp).toMatchObject({
+ type: '"1" | "2" | "3"',
+ schema: {
+ schema: [
+ {
+ kind: 'literal',
+ type: 'string',
+ value: '"1"',
+ },
+ {
+ kind: 'literal',
+ type: 'string',
+ value: '"2"',
+ },
+ {
+ kind: 'literal',
+ type: 'string',
+ value: '"3"',
+ },
+ ],
+ },
+ });
+ });
+
+ // ExtractPropTypes cannot infer the type of vue-types
+ test.skipIf(kind === 'sfc-alias')('using vue-types', () => {
+ const bProp = propMap['b'];
+ expect(bProp).toMatchObject({
+ type: '{ c?: string; }',
+ required: true,
+ default: '{}',
+ });
+ const dProp = propMap['d'];
+ expect(dProp).toMatchObject({
+ type: 'number',
+ required: false,
+ default: '1',
+ });
+ });
+
+ test('events in props', () => {
+ const onClick = propMap['onClick'];
+ if (kind === 'tsx') {
+ expect(onClick.schema).matchSnapshot();
+ expect(onClick.description).toBe('click event');
+ } else {
+ // Although we do not define it in `defineProps` when writing the component,
+ // we can still handle events through the onClick prop when using this component.
+ // This is because vue will pass the events in defineEmits into props when processing.
+ // So we can still extract onClick from the props metadata,
+ // but since this is generated through `@vue/runtime-core`
+ // and is within the exclude range, we can treat it as `unknown`
+ // When processing the transformer, pay attention to which signature of the same attribute from props and events is better.
+ expect(onClick).toMatchObject({
+ schema: {
+ kind: 'unknown',
+ },
+ });
+ }
+ });
+
+ test(`async functions`, () => {
+ const promiseFunc = propMap['func'];
+ expect(promiseFunc.schema).toMatchObject({
+ schema: { isAsync: true },
+ });
+ });
+
+ test('dom type', () => {
+ const dom = propMap['dom'];
+ expect(dom).toMatchObject({
+ schema: {
+ kind: 'unknown',
+ type: 'HTMLElement',
+ },
+ default: 'null',
+ });
+ });
+ });
+
+ describe('emits/events', () => {
+ const { component } = project.service.getComponentMeta(
+ componentPath,
+ 'Foo',
+ );
+ const eventMap = toRecord(component.events);
+ test('event signature meta should be same as normal methods', () => {
+ expect(eventMap['change']).matchSnapshot();
+ });
+
+ test.skipIf(kind === 'tsx')('events defined via defineEmits', () => {
+ expect(eventMap['click']).matchSnapshot();
+ });
+ });
+
+ describe('slots', () => {
+ const { component } = project.service.getComponentMeta(
+ componentPath,
+ 'Foo',
+ );
+ const slotMap = toRecord(component.slots);
+
+ test('normal slots', () => {
+ expect(slotMap['icon'].type).toBe('any');
+ });
+
+ test('scoped slots', () => {
+ expect(slotMap['item']).matchSnapshot();
+ });
+ });
+
+ describe('expose api', () => {
+ const { component } = project.service.getComponentMeta(
+ componentPath,
+ 'Foo',
+ );
+ const exposed = toRecord(component.exposed);
+ test('ref api', () => {
+ expect(exposed['count']).toMatchObject({
+ type: 'number',
+ });
+ expect(exposed['focus']).matchSnapshot();
+ });
+ });
+ });
+}
+
+testFeatures('tsx');
+testFeatures('sfc');
+testFeatures('sfc-alias');
+
+afterAll(() => {
+ project.close();
+});
diff --git a/suites/dumi-vue-meta/tests/project.test.ts b/suites/dumi-vue-meta/tests/project.test.ts
new file mode 100644
index 0000000000..fb839106f7
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/project.test.ts
@@ -0,0 +1,68 @@
+import path from 'path';
+import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest';
+import { Project, createProject } from '../src/index';
+
+const fixturesPath = path.resolve(__dirname, './fixtures');
+const entry = path.resolve(__dirname, 'fixtures/index.ts');
+
+describe('project file manipulation', () => {
+ // TODO: should use vitual filesystem, and should mock partial filesystem
+ let project!: Project;
+
+ beforeAll(() => {
+ project = createProject({
+ tsconfigPath: path.resolve(fixturesPath, './tsconfig.json'),
+ });
+ });
+ test('patchFiles', () => {
+ const tsxPath = path.resolve(fixturesPath, './tsx/index.ts');
+
+ project.patchFiles([
+ {
+ action: 'remove',
+ fileName: tsxPath,
+ },
+ {
+ action: 'update',
+ fileName: entry,
+ text: `
+import { defineComponent } from 'vue';
+export { default as FooSfc } from './sfc/foo.vue';
+export const Button = defineComponent({
+ name: 'MyButton',
+ props: {
+ type: String,
+ },
+ setup() {
+ return () => (
+
+ );
+ },
+});
+`,
+ },
+ ]);
+
+ const meta = project.service.getComponentLibraryMeta(entry);
+
+ expect(meta.components['Button']).toBeDefined();
+ expect(meta.components['Foo']).toBeUndefined();
+ });
+
+ afterAll(() => {
+ project.close();
+ });
+});
+
+describe('create project api', () => {
+ let project!: Project;
+
+ test('create with RootPath', () => {
+ project = createProject(fixturesPath);
+ expect(project.service.getExportNames(entry)).toContain('Foo');
+ });
+
+ afterEach(() => {
+ project.close();
+ });
+});
diff --git a/suites/dumi-vue-meta/tests/transformer.test.ts b/suites/dumi-vue-meta/tests/transformer.test.ts
new file mode 100644
index 0000000000..8da5611292
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/transformer.test.ts
@@ -0,0 +1,29 @@
+import path from 'path';
+import { afterAll, expect, test } from 'vitest';
+import type { MetaCheckerOptions } from '../src/index';
+import {
+ createProject,
+ dumiTransfomer,
+ vueTypesSchemaResolver,
+} from '../src/index';
+
+const checkerOptions: MetaCheckerOptions = {
+ schema: {
+ customResovlers: [vueTypesSchemaResolver],
+ },
+};
+
+const project = createProject({
+ tsconfigPath: path.resolve(__dirname, 'fixtures/tsconfig.json'),
+ checkerOptions,
+});
+
+test('dumi-assets-types transformer', () => {
+ const entry = path.resolve(__dirname, 'fixtures/index.ts');
+ const meta = project.service.getComponentLibraryMeta(entry, dumiTransfomer);
+ expect(meta).toMatchSnapshot();
+});
+
+afterAll(() => {
+ project.close();
+});
diff --git a/suites/dumi-vue-meta/tests/utils.ts b/suites/dumi-vue-meta/tests/utils.ts
new file mode 100644
index 0000000000..09ab2a2e3d
--- /dev/null
+++ b/suites/dumi-vue-meta/tests/utils.ts
@@ -0,0 +1,8 @@
+import { ComponentItemMeta } from '../src';
+
+export function toRecord(metaArr: ComponentItemMeta[]) {
+ return metaArr.reduce((acc, prop) => {
+ acc[prop.name] = prop;
+ return acc;
+ }, {} as Record);
+}
diff --git a/suites/dumi-vue-meta/tsconfig.json b/suites/dumi-vue-meta/tsconfig.json
new file mode 100644
index 0000000000..640ae717bb
--- /dev/null
+++ b/suites/dumi-vue-meta/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compilerOptions": {
+ "target": "ES2021",
+ "module": "NodeNext",
+ "strict": true,
+ "declaration": true,
+ "skipLibCheck": true,
+ "esModuleInterop": true,
+ "baseUrl": "./"
+ },
+ "include": ["**/*"],
+ "exclude": ["tests/fixtures"]
+}
diff --git a/suites/preset-vue/.fatherrc.ts b/suites/preset-vue/.fatherrc.ts
new file mode 100644
index 0000000000..1495903049
--- /dev/null
+++ b/suites/preset-vue/.fatherrc.ts
@@ -0,0 +1,13 @@
+import { defineConfig } from 'father';
+
+export default defineConfig({
+ cjs: {
+ output: 'dist',
+ ignores: ['src/vue/runtime/**'],
+ },
+ prebundle: {
+ deps: {
+ '@vue/babel-plugin-jsx': { dts: false },
+ },
+ },
+});
diff --git a/suites/preset-vue/.gitignore b/suites/preset-vue/.gitignore
new file mode 100644
index 0000000000..a802896def
--- /dev/null
+++ b/suites/preset-vue/.gitignore
@@ -0,0 +1,4 @@
+/node_modules
+/dist
+.DS_Store
+metafile-*.json
diff --git a/suites/preset-vue/README.md b/suites/preset-vue/README.md
new file mode 100644
index 0000000000..3f55788cb7
--- /dev/null
+++ b/suites/preset-vue/README.md
@@ -0,0 +1,53 @@
+# @dumijs/preset-vue
+
+dumi Vue3 tech stack support
+
+## Features
+
+- [x] Supports both Single File Component and JSX/TSX
+- [x] Inline demo and external demo support
+- [x] Support CodeSandbox and StackBlitz preview
+- [x] Webpack processing
+- [x] API Table support
+- [x] Support live demo
+
+## Install
+
+```
+npm i @dumijs/preset-vue
+```
+
+## Options
+
+### checkOptions
+
+Vue component metadata parsing options
+
+For example, the following configuration can make the `InternalType` type skip parsing
+
+```js
+vue: {
+ checkerOptions: {
+ schema: { ignore: ['InternalType'] }
+ },
+},
+```
+
+For details, please refer to :point_right: [`MetaCheckerOptions`](../dumi-vue-meta/README.md#metacheckeroptions)
+
+### tsconfigPath
+
+The tsconfig used by the checker, the default value is `/tsconfig.json`
+
+### compiler
+
+The live demo requires a browser-side compiler, so @babel/standalone needs to be loaded. We provide the `babelStandaloneCDN` option to change its loading address. The default url is
+`https://cdn.bootcdn.net/ajax/libs/babel-standalone/7.22.17/babel.min.js`
+
+```js
+vue: {
+ compiler: {
+ babelStandaloneCDN: 'https://cdn.bootcdn.net/ajax/libs/babel-standalone/7.22.17/babel.min.js'
+ },
+},
+```
diff --git a/suites/preset-vue/compiled/@vue/babel-plugin-jsx/index.js b/suites/preset-vue/compiled/@vue/babel-plugin-jsx/index.js
new file mode 100644
index 0000000000..594a88454c
--- /dev/null
+++ b/suites/preset-vue/compiled/@vue/babel-plugin-jsx/index.js
@@ -0,0 +1,33114 @@
+(function () {
+ var e = {
+ 831: function (e, t, r) {
+ 'use strict';
+ var s = Object.create;
+ var i = Object.defineProperty;
+ var n = Object.defineProperties;
+ var a = Object.getOwnPropertyDescriptor;
+ var o = Object.getOwnPropertyDescriptors;
+ var l = Object.getOwnPropertyNames;
+ var c = Object.getOwnPropertySymbols;
+ var p = Object.getPrototypeOf;
+ var u = Object.prototype.hasOwnProperty;
+ var d = Object.prototype.propertyIsEnumerable;
+ var __defNormalProp = (e, t, r) =>
+ t in e
+ ? i(e, t, {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: r,
+ })
+ : (e[t] = r);
+ var __spreadValues = (e, t) => {
+ for (var r in t || (t = {}))
+ if (u.call(t, r)) __defNormalProp(e, r, t[r]);
+ if (c)
+ for (var r of c(t)) {
+ if (d.call(t, r)) __defNormalProp(e, r, t[r]);
+ }
+ return e;
+ };
+ var __spreadProps = (e, t) => n(e, o(t));
+ var __export = (e, t) => {
+ for (var r in t) i(e, r, { get: t[r], enumerable: true });
+ };
+ var __copyProps = (e, t, r, s) => {
+ if ((t && typeof t === 'object') || typeof t === 'function') {
+ for (let n of l(t))
+ if (!u.call(e, n) && n !== r)
+ i(e, n, {
+ get: () => t[n],
+ enumerable: !(s = a(t, n)) || s.enumerable,
+ });
+ }
+ return e;
+ };
+ var __toESM = (e, t, r) => (
+ (r = e != null ? s(p(e)) : {}),
+ __copyProps(
+ t || !e || !e.__esModule
+ ? i(r, 'default', { value: e, enumerable: true })
+ : r,
+ e,
+ )
+ );
+ var __toCommonJS = (e) =>
+ __copyProps(i({}, '__esModule', { value: true }), e);
+ var f = {};
+ __export(f, { default: () => src_default });
+ e.exports = __toCommonJS(f);
+ var h = __toESM(r(4739));
+ var y = __toESM(r(8063));
+ var m = __toESM(r(4435));
+ var T = r(2408);
+ var S = __toESM(r(4739));
+ var x = r(2408);
+ var b = __toESM(r(4739));
+ var E = __toESM(r(5346));
+ var P = __toESM(r(7860));
+ var g = ((e) => {
+ e[(e['STABLE'] = 1)] = 'STABLE';
+ e[(e['DYNAMIC'] = 2)] = 'DYNAMIC';
+ e[(e['FORWARDED'] = 3)] = 'FORWARDED';
+ return e;
+ })(g || {});
+ var A = g;
+ var v = 'Fragment';
+ var I = 'KeepAlive';
+ var createIdentifier = (e, t) => e.get(t)();
+ var isDirective = (e) =>
+ e.startsWith('v-') ||
+ (e.startsWith('v') && e.length >= 2 && e[1] >= 'A' && e[1] <= 'Z');
+ var shouldTransformedToSlots = (e) =>
+ !(e.match(RegExp(`^_?${v}\\d*$`)) || e === I);
+ var checkIsComponent = (e, t) => {
+ var r, s;
+ const i = e.get('name');
+ if (i.isJSXMemberExpression()) {
+ return shouldTransformedToSlots(i.node.property.name);
+ }
+ const n = i.node.name;
+ return (
+ !((s = (r = t.opts).isCustomElement) == null
+ ? void 0
+ : s.call(r, n)) &&
+ shouldTransformedToSlots(n) &&
+ !E.default.includes(n) &&
+ !P.default.includes(n)
+ );
+ };
+ var transformJSXMemberExpression = (e) => {
+ const t = e.node.object;
+ const r = e.node.property;
+ const s = b.isJSXMemberExpression(t)
+ ? transformJSXMemberExpression(e.get('object'))
+ : b.isJSXIdentifier(t)
+ ? b.identifier(t.name)
+ : b.nullLiteral();
+ const i = b.identifier(r.name);
+ return b.memberExpression(s, i);
+ };
+ var getTag = (e, t) => {
+ var r, s;
+ const i = e.get('openingElement').get('name');
+ if (i.isJSXIdentifier()) {
+ const { name: n } = i.node;
+ if (!E.default.includes(n) && !P.default.includes(n)) {
+ return n === v
+ ? createIdentifier(t, v)
+ : e.scope.hasBinding(n)
+ ? b.identifier(n)
+ : (
+ (s = (r = t.opts).isCustomElement) == null
+ ? void 0
+ : s.call(r, n)
+ )
+ ? b.stringLiteral(n)
+ : b.callExpression(createIdentifier(t, 'resolveComponent'), [
+ b.stringLiteral(n),
+ ]);
+ }
+ return b.stringLiteral(n);
+ }
+ if (i.isJSXMemberExpression()) {
+ return transformJSXMemberExpression(i);
+ }
+ throw new Error(`getTag: ${i.type} is not supported`);
+ };
+ var getJSXAttributeName = (e) => {
+ const t = e.node.name;
+ if (b.isJSXIdentifier(t)) {
+ return t.name;
+ }
+ return `${t.namespace.name}:${t.name.name}`;
+ };
+ var transformJSXText = (e) => {
+ const t = transformText(e.node.value);
+ return t !== '' ? b.stringLiteral(t) : null;
+ };
+ var transformText = (e) => {
+ const t = e.split(/\r\n|\n|\r/);
+ let r = 0;
+ for (let e = 0; e < t.length; e++) {
+ if (t[e].match(/[^ \t]/)) {
+ r = e;
+ }
+ }
+ let s = '';
+ for (let e = 0; e < t.length; e++) {
+ const i = t[e];
+ const n = e === 0;
+ const a = e === t.length - 1;
+ const o = e === r;
+ let l = i.replace(/\t/g, ' ');
+ if (!n) {
+ l = l.replace(/^[ ]+/, '');
+ }
+ if (!a) {
+ l = l.replace(/[ ]+$/, '');
+ }
+ if (l) {
+ if (!o) {
+ l += ' ';
+ }
+ s += l;
+ }
+ }
+ return s;
+ };
+ var transformJSXExpressionContainer = (e) => e.get('expression').node;
+ var transformJSXSpreadChild = (e) =>
+ b.spreadElement(e.get('expression').node);
+ var walksScope = (e, t, r) => {
+ if (e.scope.hasBinding(t) && e.parentPath) {
+ if (b.isJSXElement(e.parentPath.node)) {
+ e.parentPath.setData('slotFlag', r);
+ }
+ walksScope(e.parentPath, t, r);
+ }
+ };
+ var buildIIFE = (e, t) => {
+ const { parentPath: r } = e;
+ if (r.isAssignmentExpression()) {
+ const { left: s } = r.node;
+ if (b.isIdentifier(s)) {
+ return t.map((t) => {
+ if (b.isIdentifier(t) && t.name === s.name) {
+ const s = e.scope.generateUidIdentifier(t.name);
+ r.insertBefore(
+ b.variableDeclaration('const', [
+ b.variableDeclarator(
+ s,
+ b.callExpression(
+ b.functionExpression(
+ null,
+ [],
+ b.blockStatement([b.returnStatement(t)]),
+ ),
+ [],
+ ),
+ ),
+ ]),
+ );
+ return s;
+ }
+ return t;
+ });
+ }
+ }
+ return t;
+ };
+ var w = /^on[^a-z]/;
+ var isOn = (e) => w.test(e);
+ var mergeAsArray = (e, t) => {
+ if (b.isArrayExpression(e.value)) {
+ e.value.elements.push(t.value);
+ } else {
+ e.value = b.arrayExpression([e.value, t.value]);
+ }
+ };
+ var dedupeProperties = (e = [], t) => {
+ if (!t) {
+ return e;
+ }
+ const r = new Map();
+ const s = [];
+ e.forEach((e) => {
+ if (b.isStringLiteral(e.key)) {
+ const { value: t } = e.key;
+ const i = r.get(t);
+ if (i) {
+ if (t === 'style' || t === 'class' || t.startsWith('on')) {
+ mergeAsArray(i, e);
+ }
+ } else {
+ r.set(t, e);
+ s.push(e);
+ }
+ } else {
+ s.push(e);
+ }
+ });
+ return s;
+ };
+ var isConstant = (e) => {
+ if (b.isIdentifier(e)) {
+ return e.name === 'undefined';
+ }
+ if (b.isArrayExpression(e)) {
+ const { elements: t } = e;
+ return t.every((e) => e && isConstant(e));
+ }
+ if (b.isObjectExpression(e)) {
+ return e.properties.every((e) => isConstant(e.value));
+ }
+ if (b.isLiteral(e)) {
+ return true;
+ }
+ return false;
+ };
+ var transformJSXSpreadAttribute = (e, t, r, s) => {
+ const i = t.get('argument');
+ const n = b.isObjectExpression(i.node) ? i.node.properties : void 0;
+ if (!n) {
+ if (i.isIdentifier()) {
+ walksScope(e, i.node.name, A.DYNAMIC);
+ }
+ s.push(r ? i.node : b.spreadElement(i.node));
+ } else if (r) {
+ s.push(b.objectExpression(n));
+ } else {
+ s.push(...n);
+ }
+ };
+ var N = __toESM(r(4739));
+ var getType = (e) => {
+ const t = e.get('attributes').find((e) => {
+ if (!e.isJSXAttribute()) {
+ return false;
+ }
+ return (
+ e.get('name').isJSXIdentifier() &&
+ e.get('name').node.name === 'type'
+ );
+ });
+ return t ? t.get('value').node : null;
+ };
+ var parseModifiers = (e) =>
+ N.isArrayExpression(e)
+ ? e.elements
+ .map((e) => (N.isStringLiteral(e) ? e.value : ''))
+ .filter(Boolean)
+ : [];
+ var parseDirectives = (e) => {
+ var t, r;
+ const { path: s, value: i, state: n, tag: a, isComponent: o } = e;
+ const l = [];
+ const c = [];
+ const p = [];
+ let u;
+ let d;
+ let f;
+ if ('namespace' in s.node.name) {
+ [u, d] = e.name.split(':');
+ u = s.node.name.namespace.name;
+ d = s.node.name.name.name;
+ f = d.split('_').slice(1);
+ } else {
+ const t = e.name.split('_');
+ u = t.shift() || '';
+ f = t;
+ }
+ u = u
+ .replace(/^v/, '')
+ .replace(/^-/, '')
+ .replace(/^\S/, (e) => e.toLowerCase());
+ if (d) {
+ l.push(N.stringLiteral(d));
+ }
+ const h = u === 'models';
+ const y = u === 'model';
+ if (y && !s.get('value').isJSXExpressionContainer()) {
+ throw new Error('You have to use JSX Expression inside your v-model');
+ }
+ if (h && !o) {
+ throw new Error('v-models can only use in custom components');
+ }
+ const m = !['html', 'text', 'model', 'models'].includes(u) || (y && !o);
+ let T = f;
+ if (N.isArrayExpression(i)) {
+ const e = h ? i.elements : [i];
+ e.forEach((e) => {
+ if (h && !N.isArrayExpression(e)) {
+ throw new Error(
+ 'You should pass a Two-dimensional Arrays to v-models',
+ );
+ }
+ const { elements: t } = e;
+ const [r, s, i] = t;
+ if (s && !N.isArrayExpression(s) && !N.isSpreadElement(s)) {
+ l.push(s);
+ T = parseModifiers(i);
+ } else if (N.isArrayExpression(s)) {
+ if (!m) {
+ l.push(N.nullLiteral());
+ }
+ T = parseModifiers(s);
+ } else if (!m) {
+ l.push(N.nullLiteral());
+ }
+ p.push(new Set(T));
+ c.push(r);
+ });
+ } else if (y && !m) {
+ l.push(N.nullLiteral());
+ p.push(new Set(f));
+ } else {
+ p.push(new Set(f));
+ }
+ return {
+ directiveName: u,
+ modifiers: p,
+ values: c.length ? c : [i],
+ args: l,
+ directive: m
+ ? [
+ resolveDirective(s, n, a, u),
+ c[0] || i,
+ ((t = p[0]) == null ? void 0 : t.size)
+ ? l[0] || N.unaryExpression('void', N.numericLiteral(0), true)
+ : l[0],
+ !!((r = p[0]) == null ? void 0 : r.size) &&
+ N.objectExpression(
+ [...p[0]].map((e) =>
+ N.objectProperty(N.identifier(e), N.booleanLiteral(true)),
+ ),
+ ),
+ ].filter(Boolean)
+ : void 0,
+ };
+ };
+ var resolveDirective = (e, t, r, s) => {
+ if (s === 'show') {
+ return createIdentifier(t, 'vShow');
+ }
+ if (s === 'model') {
+ let s;
+ const i = getType(e.parentPath);
+ switch (r.value) {
+ case 'select':
+ s = createIdentifier(t, 'vModelSelect');
+ break;
+ case 'textarea':
+ s = createIdentifier(t, 'vModelText');
+ break;
+ default:
+ if (N.isStringLiteral(i) || !i) {
+ switch (i == null ? void 0 : i.value) {
+ case 'checkbox':
+ s = createIdentifier(t, 'vModelCheckbox');
+ break;
+ case 'radio':
+ s = createIdentifier(t, 'vModelRadio');
+ break;
+ default:
+ s = createIdentifier(t, 'vModelText');
+ }
+ } else {
+ s = createIdentifier(t, 'vModelDynamic');
+ }
+ }
+ return s;
+ }
+ return N.callExpression(createIdentifier(t, 'resolveDirective'), [
+ N.stringLiteral(s),
+ ]);
+ };
+ var O = parseDirectives;
+ var C = /^xlink([A-Z])/;
+ var getJSXAttributeValue = (e, t) => {
+ const r = e.get('value');
+ if (r.isJSXElement()) {
+ return transformJSXElement(r, t);
+ }
+ if (r.isStringLiteral()) {
+ return S.stringLiteral(transformText(r.node.value));
+ }
+ if (r.isJSXExpressionContainer()) {
+ return transformJSXExpressionContainer(r);
+ }
+ return null;
+ };
+ var buildProps = (e, t) => {
+ const r = getTag(e, t);
+ const s = checkIsComponent(e.get('openingElement'), t);
+ const i = e.get('openingElement').get('attributes');
+ const n = [];
+ const a = new Set();
+ let o = null;
+ let l = 0;
+ if (i.length === 0) {
+ return {
+ tag: r,
+ isComponent: s,
+ slots: o,
+ props: S.nullLiteral(),
+ directives: n,
+ patchFlag: l,
+ dynamicPropNames: a,
+ };
+ }
+ let c = [];
+ let p = false;
+ let u = false;
+ let d = false;
+ let f = false;
+ let h = false;
+ const y = [];
+ const { mergeProps: m = true } = t.opts;
+ i.forEach((i) => {
+ if (i.isJSXAttribute()) {
+ let l = getJSXAttributeName(i);
+ const m = getJSXAttributeValue(i, t);
+ if (!isConstant(m) || l === 'ref') {
+ if (
+ !s &&
+ isOn(l) &&
+ l.toLowerCase() !== 'onclick' &&
+ l !== 'onUpdate:modelValue'
+ ) {
+ f = true;
+ }
+ if (l === 'ref') {
+ p = true;
+ } else if (l === 'class' && !s) {
+ u = true;
+ } else if (l === 'style' && !s) {
+ d = true;
+ } else if (l !== 'key' && !isDirective(l) && l !== 'on') {
+ a.add(l);
+ }
+ }
+ if (t.opts.transformOn && (l === 'on' || l === 'nativeOn')) {
+ if (!t.get('transformOn')) {
+ t.set(
+ 'transformOn',
+ (0, x.addDefault)(e, '@vue/babel-helper-vue-transform-on', {
+ nameHint: '_transformOn',
+ }),
+ );
+ }
+ y.push(
+ S.callExpression(t.get('transformOn'), [
+ m || S.booleanLiteral(true),
+ ]),
+ );
+ return;
+ }
+ if (isDirective(l)) {
+ const {
+ directive: e,
+ modifiers: p,
+ values: u,
+ args: d,
+ directiveName: f,
+ } = O({
+ tag: r,
+ isComponent: s,
+ name: l,
+ path: i,
+ state: t,
+ value: m,
+ });
+ if (f === 'slots') {
+ o = m;
+ return;
+ }
+ if (e) {
+ n.push(S.arrayExpression(e));
+ } else if (f === 'html') {
+ c.push(S.objectProperty(S.stringLiteral('innerHTML'), u[0]));
+ a.add('innerHTML');
+ } else if (f === 'text') {
+ c.push(S.objectProperty(S.stringLiteral('textContent'), u[0]));
+ a.add('textContent');
+ }
+ if (['models', 'model'].includes(f)) {
+ u.forEach((t, r) => {
+ var s;
+ const i = d[r];
+ const n = i && !S.isStringLiteral(i) && !S.isNullLiteral(i);
+ if (!e) {
+ c.push(
+ S.objectProperty(
+ S.isNullLiteral(i) ? S.stringLiteral('modelValue') : i,
+ t,
+ n,
+ ),
+ );
+ if (!n) {
+ a.add((i == null ? void 0 : i.value) || 'modelValue');
+ }
+ if ((s = p[r]) == null ? void 0 : s.size) {
+ c.push(
+ S.objectProperty(
+ n
+ ? S.binaryExpression(
+ '+',
+ i,
+ S.stringLiteral('Modifiers'),
+ )
+ : S.stringLiteral(
+ `${
+ (i == null ? void 0 : i.value) || 'model'
+ }Modifiers`,
+ ),
+ S.objectExpression(
+ [...p[r]].map((e) =>
+ S.objectProperty(
+ S.stringLiteral(e),
+ S.booleanLiteral(true),
+ ),
+ ),
+ ),
+ n,
+ ),
+ );
+ }
+ }
+ const o = n
+ ? S.binaryExpression('+', S.stringLiteral('onUpdate'), i)
+ : S.stringLiteral(
+ `onUpdate:${
+ (i == null ? void 0 : i.value) || 'modelValue'
+ }`,
+ );
+ c.push(
+ S.objectProperty(
+ o,
+ S.arrowFunctionExpression(
+ [S.identifier('$event')],
+ S.assignmentExpression('=', t, S.identifier('$event')),
+ ),
+ n,
+ ),
+ );
+ if (!n) {
+ a.add(o.value);
+ } else {
+ h = true;
+ }
+ });
+ }
+ } else {
+ if (l.match(C)) {
+ l = l.replace(C, (e, t) => `xlink:${t.toLowerCase()}`);
+ }
+ c.push(
+ S.objectProperty(
+ S.stringLiteral(l),
+ m || S.booleanLiteral(true),
+ ),
+ );
+ }
+ } else {
+ if (c.length && m) {
+ y.push(S.objectExpression(dedupeProperties(c, m)));
+ c = [];
+ }
+ h = true;
+ transformJSXSpreadAttribute(e, i, m, m ? y : c);
+ }
+ });
+ if (h) {
+ l |= 16;
+ } else {
+ if (u) {
+ l |= 2;
+ }
+ if (d) {
+ l |= 4;
+ }
+ if (a.size) {
+ l |= 8;
+ }
+ if (f) {
+ l |= 32;
+ }
+ }
+ if ((l === 0 || l === 32) && (p || n.length > 0)) {
+ l |= 512;
+ }
+ let T = S.nullLiteral();
+ if (y.length) {
+ if (c.length) {
+ y.push(S.objectExpression(dedupeProperties(c, m)));
+ }
+ if (y.length > 1) {
+ T = S.callExpression(createIdentifier(t, 'mergeProps'), y);
+ } else {
+ T = y[0];
+ }
+ } else if (c.length) {
+ if (c.length === 1 && S.isSpreadElement(c[0])) {
+ T = c[0].argument;
+ } else {
+ T = S.objectExpression(dedupeProperties(c, m));
+ }
+ }
+ return {
+ tag: r,
+ props: T,
+ isComponent: s,
+ slots: o,
+ directives: n,
+ patchFlag: l,
+ dynamicPropNames: a,
+ };
+ };
+ var getChildren = (e, t) =>
+ e
+ .map((e) => {
+ if (e.isJSXText()) {
+ const r = transformJSXText(e);
+ if (r) {
+ return S.callExpression(
+ createIdentifier(t, 'createTextVNode'),
+ [r],
+ );
+ }
+ return r;
+ }
+ if (e.isJSXExpressionContainer()) {
+ const t = transformJSXExpressionContainer(e);
+ if (S.isIdentifier(t)) {
+ const { name: r } = t;
+ const { referencePaths: s = [] } = e.scope.getBinding(r) || {};
+ s.forEach((e) => {
+ walksScope(e, r, A.DYNAMIC);
+ });
+ }
+ return t;
+ }
+ if (e.isJSXSpreadChild()) {
+ return transformJSXSpreadChild(e);
+ }
+ if (e.isCallExpression()) {
+ return e.node;
+ }
+ if (e.isJSXElement()) {
+ return transformJSXElement(e, t);
+ }
+ throw new Error(`getChildren: ${e.type} is not supported`);
+ })
+ .filter((e) => e != null && !S.isJSXEmptyExpression(e));
+ var transformJSXElement = (e, t) => {
+ const r = getChildren(e.get('children'), t);
+ const {
+ tag: s,
+ props: i,
+ isComponent: n,
+ directives: a,
+ patchFlag: o,
+ dynamicPropNames: l,
+ slots: c,
+ } = buildProps(e, t);
+ const { optimize: p = false } = t.opts;
+ const u = e.getData('slotFlag') || A.STABLE;
+ let d;
+ if (r.length > 1 || c) {
+ d = n
+ ? r.length
+ ? S.objectExpression(
+ [
+ !!r.length &&
+ S.objectProperty(
+ S.identifier('default'),
+ S.arrowFunctionExpression(
+ [],
+ S.arrayExpression(buildIIFE(e, r)),
+ ),
+ ),
+ ...(c
+ ? S.isObjectExpression(c)
+ ? c.properties
+ : [S.spreadElement(c)]
+ : []),
+ p &&
+ S.objectProperty(S.identifier('_'), S.numericLiteral(u)),
+ ].filter(Boolean),
+ )
+ : c
+ : S.arrayExpression(r);
+ } else if (r.length === 1) {
+ const { enableObjectSlots: s = true } = t.opts;
+ const i = r[0];
+ const a = S.objectExpression(
+ [
+ S.objectProperty(
+ S.identifier('default'),
+ S.arrowFunctionExpression(
+ [],
+ S.arrayExpression(buildIIFE(e, [i])),
+ ),
+ ),
+ p && S.objectProperty(S.identifier('_'), S.numericLiteral(u)),
+ ].filter(Boolean),
+ );
+ if (S.isIdentifier(i) && n) {
+ d = s
+ ? S.conditionalExpression(
+ S.callExpression(
+ t.get('@vue/babel-plugin-jsx/runtimeIsSlot')(),
+ [i],
+ ),
+ i,
+ a,
+ )
+ : a;
+ } else if (S.isCallExpression(i) && i.loc && n) {
+ if (s) {
+ const { scope: r } = e;
+ const s = r.generateUidIdentifier('slot');
+ if (r) {
+ r.push({ id: s, kind: 'let' });
+ }
+ const n = S.objectExpression(
+ [
+ S.objectProperty(
+ S.identifier('default'),
+ S.arrowFunctionExpression(
+ [],
+ S.arrayExpression(buildIIFE(e, [s])),
+ ),
+ ),
+ p && S.objectProperty(S.identifier('_'), S.numericLiteral(u)),
+ ].filter(Boolean),
+ );
+ const a = S.assignmentExpression('=', s, i);
+ const o = S.callExpression(
+ t.get('@vue/babel-plugin-jsx/runtimeIsSlot')(),
+ [a],
+ );
+ d = S.conditionalExpression(o, s, n);
+ } else {
+ d = a;
+ }
+ } else if (
+ S.isFunctionExpression(i) ||
+ S.isArrowFunctionExpression(i)
+ ) {
+ d = S.objectExpression([
+ S.objectProperty(S.identifier('default'), i),
+ ]);
+ } else if (S.isObjectExpression(i)) {
+ d = S.objectExpression(
+ [
+ ...i.properties,
+ p && S.objectProperty(S.identifier('_'), S.numericLiteral(u)),
+ ].filter(Boolean),
+ );
+ } else {
+ d = n
+ ? S.objectExpression([
+ S.objectProperty(
+ S.identifier('default'),
+ S.arrowFunctionExpression([], S.arrayExpression([i])),
+ ),
+ ])
+ : S.arrayExpression([i]);
+ }
+ }
+ const f = S.callExpression(
+ createIdentifier(t, 'createVNode'),
+ [
+ s,
+ i,
+ d || S.nullLiteral(),
+ !!o && p && S.numericLiteral(o),
+ !!l.size &&
+ p &&
+ S.arrayExpression([...l.keys()].map((e) => S.stringLiteral(e))),
+ ].filter(Boolean),
+ );
+ if (!a.length) {
+ return f;
+ }
+ return S.callExpression(createIdentifier(t, 'withDirectives'), [
+ f,
+ S.arrayExpression(a),
+ ]);
+ };
+ var D = {
+ JSXElement: {
+ exit(e, t) {
+ e.replaceWith(transformJSXElement(e, t));
+ },
+ },
+ };
+ var k = __toESM(r(4739));
+ var transformFragment = (e, t) => {
+ const r = e.get('children') || [];
+ return k.jsxElement(
+ k.jsxOpeningElement(t, []),
+ k.jsxClosingElement(t),
+ r.map(({ node: e }) => e),
+ false,
+ );
+ };
+ var L = {
+ JSXFragment: {
+ enter(e, t) {
+ const r = createIdentifier(t, v);
+ e.replaceWith(
+ transformFragment(
+ e,
+ k.isIdentifier(r)
+ ? k.jsxIdentifier(r.name)
+ : k.jsxMemberExpression(
+ k.jsxIdentifier(r.object.name),
+ k.jsxIdentifier(r.property.name),
+ ),
+ ),
+ );
+ },
+ },
+ };
+ var hasJSX = (e) => {
+ let t = false;
+ e.traverse({
+ JSXElement(e) {
+ t = true;
+ e.stop();
+ },
+ JSXFragment(e) {
+ t = true;
+ e.stop();
+ },
+ });
+ return t;
+ };
+ var M = /\*?\s*@jsx\s+([^\s]+)/;
+ var src_default = ({ types: e }) => ({
+ name: 'babel-plugin-jsx',
+ inherits: m.default,
+ visitor: __spreadProps(__spreadValues(__spreadValues({}, D), L), {
+ Program: {
+ enter(t, r) {
+ if (hasJSX(t)) {
+ const s = [
+ 'createVNode',
+ 'Fragment',
+ 'resolveComponent',
+ 'withDirectives',
+ 'vShow',
+ 'vModelSelect',
+ 'vModelText',
+ 'vModelCheckbox',
+ 'vModelRadio',
+ 'vModelText',
+ 'vModelDynamic',
+ 'resolveDirective',
+ 'mergeProps',
+ 'createTextVNode',
+ 'isVNode',
+ ];
+ if ((0, T.isModule)(t)) {
+ const i = {};
+ s.forEach((s) => {
+ r.set(s, () => {
+ if (i[s]) {
+ return e.cloneNode(i[s]);
+ }
+ const r = (0, T.addNamed)(t, s, 'vue', {
+ ensureLiveReference: true,
+ });
+ i[s] = r;
+ return r;
+ });
+ });
+ const { enableObjectSlots: n = true } = r.opts;
+ if (n) {
+ r.set('@vue/babel-plugin-jsx/runtimeIsSlot', () => {
+ if (i.runtimeIsSlot) {
+ return i.runtimeIsSlot;
+ }
+ const { name: e } = r.get('isVNode')();
+ const s = t.scope.generateUidIdentifier('isSlot');
+ const n = y.default.ast`
+ function ${s.name}(s) {
+ return typeof s === 'function' || (Object.prototype.toString.call(s) === '[object Object]' && !${e}(s));
+ }
+ `;
+ const a = t
+ .get('body')
+ .filter((e) => e.isImportDeclaration())
+ .pop();
+ if (a) {
+ a.insertAfter(n);
+ }
+ i.runtimeIsSlot = s;
+ return s;
+ });
+ }
+ } else {
+ let e;
+ s.forEach((s) => {
+ r.set(s, () => {
+ if (!e) {
+ e = (0, T.addNamespace)(t, 'vue', {
+ ensureLiveReference: true,
+ });
+ }
+ return h.memberExpression(e, h.identifier(s));
+ });
+ });
+ const i = {};
+ const { enableObjectSlots: n = true } = r.opts;
+ if (n) {
+ r.set('@vue/babel-plugin-jsx/runtimeIsSlot', () => {
+ if (i.runtimeIsSlot) {
+ return i.runtimeIsSlot;
+ }
+ const s = t.scope.generateUidIdentifier('isSlot');
+ const { object: n } = r.get('isVNode')();
+ const a = y.default.ast`
+ function ${s.name}(s) {
+ return typeof s === 'function' || (Object.prototype.toString.call(s) === '[object Object]' && !${n.name}.isVNode(s));
+ }
+ `;
+ const o = t.get('body');
+ const l = o
+ .filter(
+ (t) =>
+ t.isVariableDeclaration() &&
+ t.node.declarations.some((t) => {
+ var r;
+ return (
+ ((r = t.id) == null ? void 0 : r.name) ===
+ e.name
+ );
+ }),
+ )
+ .pop();
+ if (l) {
+ l.insertAfter(a);
+ }
+ return s;
+ });
+ }
+ }
+ const {
+ opts: { pragma: i = '' },
+ file: n,
+ } = r;
+ if (i) {
+ r.set('createVNode', () => h.identifier(i));
+ }
+ if (n.ast.comments) {
+ for (const e of n.ast.comments) {
+ const t = M.exec(e.value);
+ if (t) {
+ r.set('createVNode', () => h.identifier(t[1]));
+ }
+ }
+ }
+ }
+ },
+ exit(e) {
+ const t = e.get('body');
+ const r = new Map();
+ t.filter(
+ (e) =>
+ h.isImportDeclaration(e.node) &&
+ e.node.source.value === 'vue',
+ ).forEach((e) => {
+ const { specifiers: t } = e.node;
+ let s = false;
+ t.forEach((e) => {
+ if (
+ !e.loc &&
+ h.isImportSpecifier(e) &&
+ h.isIdentifier(e.imported)
+ ) {
+ r.set(e.imported.name, e);
+ s = true;
+ }
+ });
+ if (s) {
+ e.remove();
+ }
+ });
+ const s = [...r.keys()].map((e) => r.get(e));
+ if (s.length) {
+ e.unshiftContainer(
+ 'body',
+ h.importDeclaration(s, h.stringLiteral('vue')),
+ );
+ }
+ },
+ },
+ }),
+ });
+ },
+ 4571: function (e, t, r) {
+ 'use strict';
+ e = r.nmd(e);
+ const s = r(6755);
+ const wrapAnsi16 = (e, t) =>
+ function () {
+ const r = e.apply(s, arguments);
+ return `[${r + t}m`;
+ };
+ const wrapAnsi256 = (e, t) =>
+ function () {
+ const r = e.apply(s, arguments);
+ return `[${38 + t};5;${r}m`;
+ };
+ const wrapAnsi16m = (e, t) =>
+ function () {
+ const r = e.apply(s, arguments);
+ return `[${38 + t};2;${r[0]};${r[1]};${r[2]}m`;
+ };
+ function assembleStyles() {
+ const e = new Map();
+ const t = {
+ modifier: {
+ reset: [0, 0],
+ bold: [1, 22],
+ dim: [2, 22],
+ italic: [3, 23],
+ underline: [4, 24],
+ inverse: [7, 27],
+ hidden: [8, 28],
+ strikethrough: [9, 29],
+ },
+ color: {
+ black: [30, 39],
+ red: [31, 39],
+ green: [32, 39],
+ yellow: [33, 39],
+ blue: [34, 39],
+ magenta: [35, 39],
+ cyan: [36, 39],
+ white: [37, 39],
+ gray: [90, 39],
+ redBright: [91, 39],
+ greenBright: [92, 39],
+ yellowBright: [93, 39],
+ blueBright: [94, 39],
+ magentaBright: [95, 39],
+ cyanBright: [96, 39],
+ whiteBright: [97, 39],
+ },
+ bgColor: {
+ bgBlack: [40, 49],
+ bgRed: [41, 49],
+ bgGreen: [42, 49],
+ bgYellow: [43, 49],
+ bgBlue: [44, 49],
+ bgMagenta: [45, 49],
+ bgCyan: [46, 49],
+ bgWhite: [47, 49],
+ bgBlackBright: [100, 49],
+ bgRedBright: [101, 49],
+ bgGreenBright: [102, 49],
+ bgYellowBright: [103, 49],
+ bgBlueBright: [104, 49],
+ bgMagentaBright: [105, 49],
+ bgCyanBright: [106, 49],
+ bgWhiteBright: [107, 49],
+ },
+ };
+ t.color.grey = t.color.gray;
+ for (const r of Object.keys(t)) {
+ const s = t[r];
+ for (const r of Object.keys(s)) {
+ const i = s[r];
+ t[r] = { open: `[${i[0]}m`, close: `[${i[1]}m` };
+ s[r] = t[r];
+ e.set(i[0], i[1]);
+ }
+ Object.defineProperty(t, r, { value: s, enumerable: false });
+ Object.defineProperty(t, 'codes', { value: e, enumerable: false });
+ }
+ const ansi2ansi = (e) => e;
+ const rgb2rgb = (e, t, r) => [e, t, r];
+ t.color.close = '[39m';
+ t.bgColor.close = '[49m';
+ t.color.ansi = { ansi: wrapAnsi16(ansi2ansi, 0) };
+ t.color.ansi256 = { ansi256: wrapAnsi256(ansi2ansi, 0) };
+ t.color.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 0) };
+ t.bgColor.ansi = { ansi: wrapAnsi16(ansi2ansi, 10) };
+ t.bgColor.ansi256 = { ansi256: wrapAnsi256(ansi2ansi, 10) };
+ t.bgColor.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 10) };
+ for (let e of Object.keys(s)) {
+ if (typeof s[e] !== 'object') {
+ continue;
+ }
+ const r = s[e];
+ if (e === 'ansi16') {
+ e = 'ansi';
+ }
+ if ('ansi16' in r) {
+ t.color.ansi[e] = wrapAnsi16(r.ansi16, 0);
+ t.bgColor.ansi[e] = wrapAnsi16(r.ansi16, 10);
+ }
+ if ('ansi256' in r) {
+ t.color.ansi256[e] = wrapAnsi256(r.ansi256, 0);
+ t.bgColor.ansi256[e] = wrapAnsi256(r.ansi256, 10);
+ }
+ if ('rgb' in r) {
+ t.color.ansi16m[e] = wrapAnsi16m(r.rgb, 0);
+ t.bgColor.ansi16m[e] = wrapAnsi16m(r.rgb, 10);
+ }
+ }
+ return t;
+ }
+ Object.defineProperty(e, 'exports', {
+ enumerable: true,
+ get: assembleStyles,
+ });
+ },
+ 6673: function (e, t, r) {
+ 'use strict';
+ const s = r(4434);
+ const i = r(4571);
+ const n = r(2332).stdout;
+ const a = r(1956);
+ const o =
+ process.platform === 'win32' &&
+ !(process.env.TERM || '').toLowerCase().startsWith('xterm');
+ const l = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
+ const c = new Set(['gray']);
+ const p = Object.create(null);
+ function applyOptions(e, t) {
+ t = t || {};
+ const r = n ? n.level : 0;
+ e.level = t.level === undefined ? r : t.level;
+ e.enabled = 'enabled' in t ? t.enabled : e.level > 0;
+ }
+ function Chalk(e) {
+ if (!this || !(this instanceof Chalk) || this.template) {
+ const t = {};
+ applyOptions(t, e);
+ t.template = function () {
+ const e = [].slice.call(arguments);
+ return chalkTag.apply(null, [t.template].concat(e));
+ };
+ Object.setPrototypeOf(t, Chalk.prototype);
+ Object.setPrototypeOf(t.template, t);
+ t.template.constructor = Chalk;
+ return t.template;
+ }
+ applyOptions(this, e);
+ }
+ if (o) {
+ i.blue.open = '[94m';
+ }
+ for (const e of Object.keys(i)) {
+ i[e].closeRe = new RegExp(s(i[e].close), 'g');
+ p[e] = {
+ get() {
+ const t = i[e];
+ return build.call(
+ this,
+ this._styles ? this._styles.concat(t) : [t],
+ this._empty,
+ e,
+ );
+ },
+ };
+ }
+ p.visible = {
+ get() {
+ return build.call(this, this._styles || [], true, 'visible');
+ },
+ };
+ i.color.closeRe = new RegExp(s(i.color.close), 'g');
+ for (const e of Object.keys(i.color.ansi)) {
+ if (c.has(e)) {
+ continue;
+ }
+ p[e] = {
+ get() {
+ const t = this.level;
+ return function () {
+ const r = i.color[l[t]][e].apply(null, arguments);
+ const s = {
+ open: r,
+ close: i.color.close,
+ closeRe: i.color.closeRe,
+ };
+ return build.call(
+ this,
+ this._styles ? this._styles.concat(s) : [s],
+ this._empty,
+ e,
+ );
+ };
+ },
+ };
+ }
+ i.bgColor.closeRe = new RegExp(s(i.bgColor.close), 'g');
+ for (const e of Object.keys(i.bgColor.ansi)) {
+ if (c.has(e)) {
+ continue;
+ }
+ const t = 'bg' + e[0].toUpperCase() + e.slice(1);
+ p[t] = {
+ get() {
+ const t = this.level;
+ return function () {
+ const r = i.bgColor[l[t]][e].apply(null, arguments);
+ const s = {
+ open: r,
+ close: i.bgColor.close,
+ closeRe: i.bgColor.closeRe,
+ };
+ return build.call(
+ this,
+ this._styles ? this._styles.concat(s) : [s],
+ this._empty,
+ e,
+ );
+ };
+ },
+ };
+ }
+ const u = Object.defineProperties(() => {}, p);
+ function build(e, t, r) {
+ const builder = function () {
+ return applyStyle.apply(builder, arguments);
+ };
+ builder._styles = e;
+ builder._empty = t;
+ const s = this;
+ Object.defineProperty(builder, 'level', {
+ enumerable: true,
+ get() {
+ return s.level;
+ },
+ set(e) {
+ s.level = e;
+ },
+ });
+ Object.defineProperty(builder, 'enabled', {
+ enumerable: true,
+ get() {
+ return s.enabled;
+ },
+ set(e) {
+ s.enabled = e;
+ },
+ });
+ builder.hasGrey = this.hasGrey || r === 'gray' || r === 'grey';
+ builder.__proto__ = u;
+ return builder;
+ }
+ function applyStyle() {
+ const e = arguments;
+ const t = e.length;
+ let r = String(arguments[0]);
+ if (t === 0) {
+ return '';
+ }
+ if (t > 1) {
+ for (let s = 1; s < t; s++) {
+ r += ' ' + e[s];
+ }
+ }
+ if (!this.enabled || this.level <= 0 || !r) {
+ return this._empty ? '' : r;
+ }
+ const s = i.dim.open;
+ if (o && this.hasGrey) {
+ i.dim.open = '';
+ }
+ for (const e of this._styles.slice().reverse()) {
+ r = e.open + r.replace(e.closeRe, e.open) + e.close;
+ r = r.replace(/\r?\n/g, `${e.close}$&${e.open}`);
+ }
+ i.dim.open = s;
+ return r;
+ }
+ function chalkTag(e, t) {
+ if (!Array.isArray(t)) {
+ return [].slice.call(arguments, 1).join(' ');
+ }
+ const r = [].slice.call(arguments, 2);
+ const s = [t.raw[0]];
+ for (let e = 1; e < t.length; e++) {
+ s.push(String(r[e - 1]).replace(/[{}\\]/g, '\\$&'));
+ s.push(String(t.raw[e]));
+ }
+ return a(e, s.join(''));
+ }
+ Object.defineProperties(Chalk.prototype, p);
+ e.exports = Chalk();
+ e.exports.supportsColor = n;
+ e.exports['default'] = e.exports;
+ },
+ 1956: function (e) {
+ 'use strict';
+ const t =
+ /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
+ const r = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
+ const s = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
+ const i = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
+ const n = new Map([
+ ['n', '\n'],
+ ['r', '\r'],
+ ['t', '\t'],
+ ['b', '\b'],
+ ['f', '\f'],
+ ['v', '\v'],
+ ['0', '\0'],
+ ['\\', '\\'],
+ ['e', ''],
+ ['a', ''],
+ ]);
+ function unescape(e) {
+ if (
+ (e[0] === 'u' && e.length === 5) ||
+ (e[0] === 'x' && e.length === 3)
+ ) {
+ return String.fromCharCode(parseInt(e.slice(1), 16));
+ }
+ return n.get(e) || e;
+ }
+ function parseArguments(e, t) {
+ const r = [];
+ const n = t.trim().split(/\s*,\s*/g);
+ let a;
+ for (const t of n) {
+ if (!isNaN(t)) {
+ r.push(Number(t));
+ } else if ((a = t.match(s))) {
+ r.push(a[2].replace(i, (e, t, r) => (t ? unescape(t) : r)));
+ } else {
+ throw new Error(
+ `Invalid Chalk template style argument: ${t} (in style '${e}')`,
+ );
+ }
+ }
+ return r;
+ }
+ function parseStyle(e) {
+ r.lastIndex = 0;
+ const t = [];
+ let s;
+ while ((s = r.exec(e)) !== null) {
+ const e = s[1];
+ if (s[2]) {
+ const r = parseArguments(e, s[2]);
+ t.push([e].concat(r));
+ } else {
+ t.push([e]);
+ }
+ }
+ return t;
+ }
+ function buildStyle(e, t) {
+ const r = {};
+ for (const e of t) {
+ for (const t of e.styles) {
+ r[t[0]] = e.inverse ? null : t.slice(1);
+ }
+ }
+ let s = e;
+ for (const e of Object.keys(r)) {
+ if (Array.isArray(r[e])) {
+ if (!(e in s)) {
+ throw new Error(`Unknown Chalk style: ${e}`);
+ }
+ if (r[e].length > 0) {
+ s = s[e].apply(s, r[e]);
+ } else {
+ s = s[e];
+ }
+ }
+ }
+ return s;
+ }
+ e.exports = (e, r) => {
+ const s = [];
+ const i = [];
+ let n = [];
+ r.replace(t, (t, r, a, o, l, c) => {
+ if (r) {
+ n.push(unescape(r));
+ } else if (o) {
+ const t = n.join('');
+ n = [];
+ i.push(s.length === 0 ? t : buildStyle(e, s)(t));
+ s.push({ inverse: a, styles: parseStyle(o) });
+ } else if (l) {
+ if (s.length === 0) {
+ throw new Error('Found extraneous } in Chalk template literal');
+ }
+ i.push(buildStyle(e, s)(n.join('')));
+ n = [];
+ s.pop();
+ } else {
+ n.push(c);
+ }
+ });
+ i.push(n.join(''));
+ if (s.length > 0) {
+ const e = `Chalk template literal is missing ${
+ s.length
+ } closing bracket${s.length === 1 ? '' : 's'} (\`}\`)`;
+ throw new Error(e);
+ }
+ return i.join('');
+ };
+ },
+ 4461: function (e, t, r) {
+ var s = r(391);
+ var i = {};
+ for (var n in s) {
+ if (s.hasOwnProperty(n)) {
+ i[s[n]] = n;
+ }
+ }
+ var a = (e.exports = {
+ rgb: { channels: 3, labels: 'rgb' },
+ hsl: { channels: 3, labels: 'hsl' },
+ hsv: { channels: 3, labels: 'hsv' },
+ hwb: { channels: 3, labels: 'hwb' },
+ cmyk: { channels: 4, labels: 'cmyk' },
+ xyz: { channels: 3, labels: 'xyz' },
+ lab: { channels: 3, labels: 'lab' },
+ lch: { channels: 3, labels: 'lch' },
+ hex: { channels: 1, labels: ['hex'] },
+ keyword: { channels: 1, labels: ['keyword'] },
+ ansi16: { channels: 1, labels: ['ansi16'] },
+ ansi256: { channels: 1, labels: ['ansi256'] },
+ hcg: { channels: 3, labels: ['h', 'c', 'g'] },
+ apple: { channels: 3, labels: ['r16', 'g16', 'b16'] },
+ gray: { channels: 1, labels: ['gray'] },
+ });
+ for (var o in a) {
+ if (a.hasOwnProperty(o)) {
+ if (!('channels' in a[o])) {
+ throw new Error('missing channels property: ' + o);
+ }
+ if (!('labels' in a[o])) {
+ throw new Error('missing channel labels property: ' + o);
+ }
+ if (a[o].labels.length !== a[o].channels) {
+ throw new Error('channel and label counts mismatch: ' + o);
+ }
+ var l = a[o].channels;
+ var c = a[o].labels;
+ delete a[o].channels;
+ delete a[o].labels;
+ Object.defineProperty(a[o], 'channels', { value: l });
+ Object.defineProperty(a[o], 'labels', { value: c });
+ }
+ }
+ a.rgb.hsl = function (e) {
+ var t = e[0] / 255;
+ var r = e[1] / 255;
+ var s = e[2] / 255;
+ var i = Math.min(t, r, s);
+ var n = Math.max(t, r, s);
+ var a = n - i;
+ var o;
+ var l;
+ var c;
+ if (n === i) {
+ o = 0;
+ } else if (t === n) {
+ o = (r - s) / a;
+ } else if (r === n) {
+ o = 2 + (s - t) / a;
+ } else if (s === n) {
+ o = 4 + (t - r) / a;
+ }
+ o = Math.min(o * 60, 360);
+ if (o < 0) {
+ o += 360;
+ }
+ c = (i + n) / 2;
+ if (n === i) {
+ l = 0;
+ } else if (c <= 0.5) {
+ l = a / (n + i);
+ } else {
+ l = a / (2 - n - i);
+ }
+ return [o, l * 100, c * 100];
+ };
+ a.rgb.hsv = function (e) {
+ var t;
+ var r;
+ var s;
+ var i;
+ var n;
+ var a = e[0] / 255;
+ var o = e[1] / 255;
+ var l = e[2] / 255;
+ var c = Math.max(a, o, l);
+ var p = c - Math.min(a, o, l);
+ var diffc = function (e) {
+ return (c - e) / 6 / p + 1 / 2;
+ };
+ if (p === 0) {
+ i = n = 0;
+ } else {
+ n = p / c;
+ t = diffc(a);
+ r = diffc(o);
+ s = diffc(l);
+ if (a === c) {
+ i = s - r;
+ } else if (o === c) {
+ i = 1 / 3 + t - s;
+ } else if (l === c) {
+ i = 2 / 3 + r - t;
+ }
+ if (i < 0) {
+ i += 1;
+ } else if (i > 1) {
+ i -= 1;
+ }
+ }
+ return [i * 360, n * 100, c * 100];
+ };
+ a.rgb.hwb = function (e) {
+ var t = e[0];
+ var r = e[1];
+ var s = e[2];
+ var i = a.rgb.hsl(e)[0];
+ var n = (1 / 255) * Math.min(t, Math.min(r, s));
+ s = 1 - (1 / 255) * Math.max(t, Math.max(r, s));
+ return [i, n * 100, s * 100];
+ };
+ a.rgb.cmyk = function (e) {
+ var t = e[0] / 255;
+ var r = e[1] / 255;
+ var s = e[2] / 255;
+ var i;
+ var n;
+ var a;
+ var o;
+ o = Math.min(1 - t, 1 - r, 1 - s);
+ i = (1 - t - o) / (1 - o) || 0;
+ n = (1 - r - o) / (1 - o) || 0;
+ a = (1 - s - o) / (1 - o) || 0;
+ return [i * 100, n * 100, a * 100, o * 100];
+ };
+ function comparativeDistance(e, t) {
+ return (
+ Math.pow(e[0] - t[0], 2) +
+ Math.pow(e[1] - t[1], 2) +
+ Math.pow(e[2] - t[2], 2)
+ );
+ }
+ a.rgb.keyword = function (e) {
+ var t = i[e];
+ if (t) {
+ return t;
+ }
+ var r = Infinity;
+ var n;
+ for (var a in s) {
+ if (s.hasOwnProperty(a)) {
+ var o = s[a];
+ var l = comparativeDistance(e, o);
+ if (l < r) {
+ r = l;
+ n = a;
+ }
+ }
+ }
+ return n;
+ };
+ a.keyword.rgb = function (e) {
+ return s[e];
+ };
+ a.rgb.xyz = function (e) {
+ var t = e[0] / 255;
+ var r = e[1] / 255;
+ var s = e[2] / 255;
+ t = t > 0.04045 ? Math.pow((t + 0.055) / 1.055, 2.4) : t / 12.92;
+ r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
+ s = s > 0.04045 ? Math.pow((s + 0.055) / 1.055, 2.4) : s / 12.92;
+ var i = t * 0.4124 + r * 0.3576 + s * 0.1805;
+ var n = t * 0.2126 + r * 0.7152 + s * 0.0722;
+ var a = t * 0.0193 + r * 0.1192 + s * 0.9505;
+ return [i * 100, n * 100, a * 100];
+ };
+ a.rgb.lab = function (e) {
+ var t = a.rgb.xyz(e);
+ var r = t[0];
+ var s = t[1];
+ var i = t[2];
+ var n;
+ var o;
+ var l;
+ r /= 95.047;
+ s /= 100;
+ i /= 108.883;
+ r = r > 0.008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116;
+ s = s > 0.008856 ? Math.pow(s, 1 / 3) : 7.787 * s + 16 / 116;
+ i = i > 0.008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116;
+ n = 116 * s - 16;
+ o = 500 * (r - s);
+ l = 200 * (s - i);
+ return [n, o, l];
+ };
+ a.hsl.rgb = function (e) {
+ var t = e[0] / 360;
+ var r = e[1] / 100;
+ var s = e[2] / 100;
+ var i;
+ var n;
+ var a;
+ var o;
+ var l;
+ if (r === 0) {
+ l = s * 255;
+ return [l, l, l];
+ }
+ if (s < 0.5) {
+ n = s * (1 + r);
+ } else {
+ n = s + r - s * r;
+ }
+ i = 2 * s - n;
+ o = [0, 0, 0];
+ for (var c = 0; c < 3; c++) {
+ a = t + (1 / 3) * -(c - 1);
+ if (a < 0) {
+ a++;
+ }
+ if (a > 1) {
+ a--;
+ }
+ if (6 * a < 1) {
+ l = i + (n - i) * 6 * a;
+ } else if (2 * a < 1) {
+ l = n;
+ } else if (3 * a < 2) {
+ l = i + (n - i) * (2 / 3 - a) * 6;
+ } else {
+ l = i;
+ }
+ o[c] = l * 255;
+ }
+ return o;
+ };
+ a.hsl.hsv = function (e) {
+ var t = e[0];
+ var r = e[1] / 100;
+ var s = e[2] / 100;
+ var i = r;
+ var n = Math.max(s, 0.01);
+ var a;
+ var o;
+ s *= 2;
+ r *= s <= 1 ? s : 2 - s;
+ i *= n <= 1 ? n : 2 - n;
+ o = (s + r) / 2;
+ a = s === 0 ? (2 * i) / (n + i) : (2 * r) / (s + r);
+ return [t, a * 100, o * 100];
+ };
+ a.hsv.rgb = function (e) {
+ var t = e[0] / 60;
+ var r = e[1] / 100;
+ var s = e[2] / 100;
+ var i = Math.floor(t) % 6;
+ var n = t - Math.floor(t);
+ var a = 255 * s * (1 - r);
+ var o = 255 * s * (1 - r * n);
+ var l = 255 * s * (1 - r * (1 - n));
+ s *= 255;
+ switch (i) {
+ case 0:
+ return [s, l, a];
+ case 1:
+ return [o, s, a];
+ case 2:
+ return [a, s, l];
+ case 3:
+ return [a, o, s];
+ case 4:
+ return [l, a, s];
+ case 5:
+ return [s, a, o];
+ }
+ };
+ a.hsv.hsl = function (e) {
+ var t = e[0];
+ var r = e[1] / 100;
+ var s = e[2] / 100;
+ var i = Math.max(s, 0.01);
+ var n;
+ var a;
+ var o;
+ o = (2 - r) * s;
+ n = (2 - r) * i;
+ a = r * i;
+ a /= n <= 1 ? n : 2 - n;
+ a = a || 0;
+ o /= 2;
+ return [t, a * 100, o * 100];
+ };
+ a.hwb.rgb = function (e) {
+ var t = e[0] / 360;
+ var r = e[1] / 100;
+ var s = e[2] / 100;
+ var i = r + s;
+ var n;
+ var a;
+ var o;
+ var l;
+ if (i > 1) {
+ r /= i;
+ s /= i;
+ }
+ n = Math.floor(6 * t);
+ a = 1 - s;
+ o = 6 * t - n;
+ if ((n & 1) !== 0) {
+ o = 1 - o;
+ }
+ l = r + o * (a - r);
+ var c;
+ var p;
+ var u;
+ switch (n) {
+ default:
+ case 6:
+ case 0:
+ c = a;
+ p = l;
+ u = r;
+ break;
+ case 1:
+ c = l;
+ p = a;
+ u = r;
+ break;
+ case 2:
+ c = r;
+ p = a;
+ u = l;
+ break;
+ case 3:
+ c = r;
+ p = l;
+ u = a;
+ break;
+ case 4:
+ c = l;
+ p = r;
+ u = a;
+ break;
+ case 5:
+ c = a;
+ p = r;
+ u = l;
+ break;
+ }
+ return [c * 255, p * 255, u * 255];
+ };
+ a.cmyk.rgb = function (e) {
+ var t = e[0] / 100;
+ var r = e[1] / 100;
+ var s = e[2] / 100;
+ var i = e[3] / 100;
+ var n;
+ var a;
+ var o;
+ n = 1 - Math.min(1, t * (1 - i) + i);
+ a = 1 - Math.min(1, r * (1 - i) + i);
+ o = 1 - Math.min(1, s * (1 - i) + i);
+ return [n * 255, a * 255, o * 255];
+ };
+ a.xyz.rgb = function (e) {
+ var t = e[0] / 100;
+ var r = e[1] / 100;
+ var s = e[2] / 100;
+ var i;
+ var n;
+ var a;
+ i = t * 3.2406 + r * -1.5372 + s * -0.4986;
+ n = t * -0.9689 + r * 1.8758 + s * 0.0415;
+ a = t * 0.0557 + r * -0.204 + s * 1.057;
+ i = i > 0.0031308 ? 1.055 * Math.pow(i, 1 / 2.4) - 0.055 : i * 12.92;
+ n = n > 0.0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - 0.055 : n * 12.92;
+ a = a > 0.0031308 ? 1.055 * Math.pow(a, 1 / 2.4) - 0.055 : a * 12.92;
+ i = Math.min(Math.max(0, i), 1);
+ n = Math.min(Math.max(0, n), 1);
+ a = Math.min(Math.max(0, a), 1);
+ return [i * 255, n * 255, a * 255];
+ };
+ a.xyz.lab = function (e) {
+ var t = e[0];
+ var r = e[1];
+ var s = e[2];
+ var i;
+ var n;
+ var a;
+ t /= 95.047;
+ r /= 100;
+ s /= 108.883;
+ t = t > 0.008856 ? Math.pow(t, 1 / 3) : 7.787 * t + 16 / 116;
+ r = r > 0.008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116;
+ s = s > 0.008856 ? Math.pow(s, 1 / 3) : 7.787 * s + 16 / 116;
+ i = 116 * r - 16;
+ n = 500 * (t - r);
+ a = 200 * (r - s);
+ return [i, n, a];
+ };
+ a.lab.xyz = function (e) {
+ var t = e[0];
+ var r = e[1];
+ var s = e[2];
+ var i;
+ var n;
+ var a;
+ n = (t + 16) / 116;
+ i = r / 500 + n;
+ a = n - s / 200;
+ var o = Math.pow(n, 3);
+ var l = Math.pow(i, 3);
+ var c = Math.pow(a, 3);
+ n = o > 0.008856 ? o : (n - 16 / 116) / 7.787;
+ i = l > 0.008856 ? l : (i - 16 / 116) / 7.787;
+ a = c > 0.008856 ? c : (a - 16 / 116) / 7.787;
+ i *= 95.047;
+ n *= 100;
+ a *= 108.883;
+ return [i, n, a];
+ };
+ a.lab.lch = function (e) {
+ var t = e[0];
+ var r = e[1];
+ var s = e[2];
+ var i;
+ var n;
+ var a;
+ i = Math.atan2(s, r);
+ n = (i * 360) / 2 / Math.PI;
+ if (n < 0) {
+ n += 360;
+ }
+ a = Math.sqrt(r * r + s * s);
+ return [t, a, n];
+ };
+ a.lch.lab = function (e) {
+ var t = e[0];
+ var r = e[1];
+ var s = e[2];
+ var i;
+ var n;
+ var a;
+ a = (s / 360) * 2 * Math.PI;
+ i = r * Math.cos(a);
+ n = r * Math.sin(a);
+ return [t, i, n];
+ };
+ a.rgb.ansi16 = function (e) {
+ var t = e[0];
+ var r = e[1];
+ var s = e[2];
+ var i = 1 in arguments ? arguments[1] : a.rgb.hsv(e)[2];
+ i = Math.round(i / 50);
+ if (i === 0) {
+ return 30;
+ }
+ var n =
+ 30 +
+ ((Math.round(s / 255) << 2) |
+ (Math.round(r / 255) << 1) |
+ Math.round(t / 255));
+ if (i === 2) {
+ n += 60;
+ }
+ return n;
+ };
+ a.hsv.ansi16 = function (e) {
+ return a.rgb.ansi16(a.hsv.rgb(e), e[2]);
+ };
+ a.rgb.ansi256 = function (e) {
+ var t = e[0];
+ var r = e[1];
+ var s = e[2];
+ if (t === r && r === s) {
+ if (t < 8) {
+ return 16;
+ }
+ if (t > 248) {
+ return 231;
+ }
+ return Math.round(((t - 8) / 247) * 24) + 232;
+ }
+ var i =
+ 16 +
+ 36 * Math.round((t / 255) * 5) +
+ 6 * Math.round((r / 255) * 5) +
+ Math.round((s / 255) * 5);
+ return i;
+ };
+ a.ansi16.rgb = function (e) {
+ var t = e % 10;
+ if (t === 0 || t === 7) {
+ if (e > 50) {
+ t += 3.5;
+ }
+ t = (t / 10.5) * 255;
+ return [t, t, t];
+ }
+ var r = (~~(e > 50) + 1) * 0.5;
+ var s = (t & 1) * r * 255;
+ var i = ((t >> 1) & 1) * r * 255;
+ var n = ((t >> 2) & 1) * r * 255;
+ return [s, i, n];
+ };
+ a.ansi256.rgb = function (e) {
+ if (e >= 232) {
+ var t = (e - 232) * 10 + 8;
+ return [t, t, t];
+ }
+ e -= 16;
+ var r;
+ var s = (Math.floor(e / 36) / 5) * 255;
+ var i = (Math.floor((r = e % 36) / 6) / 5) * 255;
+ var n = ((r % 6) / 5) * 255;
+ return [s, i, n];
+ };
+ a.rgb.hex = function (e) {
+ var t =
+ ((Math.round(e[0]) & 255) << 16) +
+ ((Math.round(e[1]) & 255) << 8) +
+ (Math.round(e[2]) & 255);
+ var r = t.toString(16).toUpperCase();
+ return '000000'.substring(r.length) + r;
+ };
+ a.hex.rgb = function (e) {
+ var t = e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
+ if (!t) {
+ return [0, 0, 0];
+ }
+ var r = t[0];
+ if (t[0].length === 3) {
+ r = r
+ .split('')
+ .map(function (e) {
+ return e + e;
+ })
+ .join('');
+ }
+ var s = parseInt(r, 16);
+ var i = (s >> 16) & 255;
+ var n = (s >> 8) & 255;
+ var a = s & 255;
+ return [i, n, a];
+ };
+ a.rgb.hcg = function (e) {
+ var t = e[0] / 255;
+ var r = e[1] / 255;
+ var s = e[2] / 255;
+ var i = Math.max(Math.max(t, r), s);
+ var n = Math.min(Math.min(t, r), s);
+ var a = i - n;
+ var o;
+ var l;
+ if (a < 1) {
+ o = n / (1 - a);
+ } else {
+ o = 0;
+ }
+ if (a <= 0) {
+ l = 0;
+ } else if (i === t) {
+ l = ((r - s) / a) % 6;
+ } else if (i === r) {
+ l = 2 + (s - t) / a;
+ } else {
+ l = 4 + (t - r) / a + 4;
+ }
+ l /= 6;
+ l %= 1;
+ return [l * 360, a * 100, o * 100];
+ };
+ a.hsl.hcg = function (e) {
+ var t = e[1] / 100;
+ var r = e[2] / 100;
+ var s = 1;
+ var i = 0;
+ if (r < 0.5) {
+ s = 2 * t * r;
+ } else {
+ s = 2 * t * (1 - r);
+ }
+ if (s < 1) {
+ i = (r - 0.5 * s) / (1 - s);
+ }
+ return [e[0], s * 100, i * 100];
+ };
+ a.hsv.hcg = function (e) {
+ var t = e[1] / 100;
+ var r = e[2] / 100;
+ var s = t * r;
+ var i = 0;
+ if (s < 1) {
+ i = (r - s) / (1 - s);
+ }
+ return [e[0], s * 100, i * 100];
+ };
+ a.hcg.rgb = function (e) {
+ var t = e[0] / 360;
+ var r = e[1] / 100;
+ var s = e[2] / 100;
+ if (r === 0) {
+ return [s * 255, s * 255, s * 255];
+ }
+ var i = [0, 0, 0];
+ var n = (t % 1) * 6;
+ var a = n % 1;
+ var o = 1 - a;
+ var l = 0;
+ switch (Math.floor(n)) {
+ case 0:
+ i[0] = 1;
+ i[1] = a;
+ i[2] = 0;
+ break;
+ case 1:
+ i[0] = o;
+ i[1] = 1;
+ i[2] = 0;
+ break;
+ case 2:
+ i[0] = 0;
+ i[1] = 1;
+ i[2] = a;
+ break;
+ case 3:
+ i[0] = 0;
+ i[1] = o;
+ i[2] = 1;
+ break;
+ case 4:
+ i[0] = a;
+ i[1] = 0;
+ i[2] = 1;
+ break;
+ default:
+ i[0] = 1;
+ i[1] = 0;
+ i[2] = o;
+ }
+ l = (1 - r) * s;
+ return [
+ (r * i[0] + l) * 255,
+ (r * i[1] + l) * 255,
+ (r * i[2] + l) * 255,
+ ];
+ };
+ a.hcg.hsv = function (e) {
+ var t = e[1] / 100;
+ var r = e[2] / 100;
+ var s = t + r * (1 - t);
+ var i = 0;
+ if (s > 0) {
+ i = t / s;
+ }
+ return [e[0], i * 100, s * 100];
+ };
+ a.hcg.hsl = function (e) {
+ var t = e[1] / 100;
+ var r = e[2] / 100;
+ var s = r * (1 - t) + 0.5 * t;
+ var i = 0;
+ if (s > 0 && s < 0.5) {
+ i = t / (2 * s);
+ } else if (s >= 0.5 && s < 1) {
+ i = t / (2 * (1 - s));
+ }
+ return [e[0], i * 100, s * 100];
+ };
+ a.hcg.hwb = function (e) {
+ var t = e[1] / 100;
+ var r = e[2] / 100;
+ var s = t + r * (1 - t);
+ return [e[0], (s - t) * 100, (1 - s) * 100];
+ };
+ a.hwb.hcg = function (e) {
+ var t = e[1] / 100;
+ var r = e[2] / 100;
+ var s = 1 - r;
+ var i = s - t;
+ var n = 0;
+ if (i < 1) {
+ n = (s - i) / (1 - i);
+ }
+ return [e[0], i * 100, n * 100];
+ };
+ a.apple.rgb = function (e) {
+ return [
+ (e[0] / 65535) * 255,
+ (e[1] / 65535) * 255,
+ (e[2] / 65535) * 255,
+ ];
+ };
+ a.rgb.apple = function (e) {
+ return [
+ (e[0] / 255) * 65535,
+ (e[1] / 255) * 65535,
+ (e[2] / 255) * 65535,
+ ];
+ };
+ a.gray.rgb = function (e) {
+ return [(e[0] / 100) * 255, (e[0] / 100) * 255, (e[0] / 100) * 255];
+ };
+ a.gray.hsl = a.gray.hsv = function (e) {
+ return [0, 0, e[0]];
+ };
+ a.gray.hwb = function (e) {
+ return [0, 100, e[0]];
+ };
+ a.gray.cmyk = function (e) {
+ return [0, 0, 0, e[0]];
+ };
+ a.gray.lab = function (e) {
+ return [e[0], 0, 0];
+ };
+ a.gray.hex = function (e) {
+ var t = Math.round((e[0] / 100) * 255) & 255;
+ var r = (t << 16) + (t << 8) + t;
+ var s = r.toString(16).toUpperCase();
+ return '000000'.substring(s.length) + s;
+ };
+ a.rgb.gray = function (e) {
+ var t = (e[0] + e[1] + e[2]) / 3;
+ return [(t / 255) * 100];
+ };
+ },
+ 6755: function (e, t, r) {
+ var s = r(4461);
+ var i = r(1974);
+ var n = {};
+ var a = Object.keys(s);
+ function wrapRaw(e) {
+ var wrappedFn = function (t) {
+ if (t === undefined || t === null) {
+ return t;
+ }
+ if (arguments.length > 1) {
+ t = Array.prototype.slice.call(arguments);
+ }
+ return e(t);
+ };
+ if ('conversion' in e) {
+ wrappedFn.conversion = e.conversion;
+ }
+ return wrappedFn;
+ }
+ function wrapRounded(e) {
+ var wrappedFn = function (t) {
+ if (t === undefined || t === null) {
+ return t;
+ }
+ if (arguments.length > 1) {
+ t = Array.prototype.slice.call(arguments);
+ }
+ var r = e(t);
+ if (typeof r === 'object') {
+ for (var s = r.length, i = 0; i < s; i++) {
+ r[i] = Math.round(r[i]);
+ }
+ }
+ return r;
+ };
+ if ('conversion' in e) {
+ wrappedFn.conversion = e.conversion;
+ }
+ return wrappedFn;
+ }
+ a.forEach(function (e) {
+ n[e] = {};
+ Object.defineProperty(n[e], 'channels', { value: s[e].channels });
+ Object.defineProperty(n[e], 'labels', { value: s[e].labels });
+ var t = i(e);
+ var r = Object.keys(t);
+ r.forEach(function (r) {
+ var s = t[r];
+ n[e][r] = wrapRounded(s);
+ n[e][r].raw = wrapRaw(s);
+ });
+ });
+ e.exports = n;
+ },
+ 1974: function (e, t, r) {
+ var s = r(4461);
+ function buildGraph() {
+ var e = {};
+ var t = Object.keys(s);
+ for (var r = t.length, i = 0; i < r; i++) {
+ e[t[i]] = { distance: -1, parent: null };
+ }
+ return e;
+ }
+ function deriveBFS(e) {
+ var t = buildGraph();
+ var r = [e];
+ t[e].distance = 0;
+ while (r.length) {
+ var i = r.pop();
+ var n = Object.keys(s[i]);
+ for (var a = n.length, o = 0; o < a; o++) {
+ var l = n[o];
+ var c = t[l];
+ if (c.distance === -1) {
+ c.distance = t[i].distance + 1;
+ c.parent = i;
+ r.unshift(l);
+ }
+ }
+ }
+ return t;
+ }
+ function link(e, t) {
+ return function (r) {
+ return t(e(r));
+ };
+ }
+ function wrapConversion(e, t) {
+ var r = [t[e].parent, e];
+ var i = s[t[e].parent][e];
+ var n = t[e].parent;
+ while (t[n].parent) {
+ r.unshift(t[n].parent);
+ i = link(s[t[n].parent][n], i);
+ n = t[n].parent;
+ }
+ i.conversion = r;
+ return i;
+ }
+ e.exports = function (e) {
+ var t = deriveBFS(e);
+ var r = {};
+ var s = Object.keys(t);
+ for (var i = s.length, n = 0; n < i; n++) {
+ var a = s[n];
+ var o = t[a];
+ if (o.parent === null) {
+ continue;
+ }
+ r[a] = wrapConversion(a, t);
+ }
+ return r;
+ };
+ },
+ 391: function (e) {
+ 'use strict';
+ e.exports = {
+ aliceblue: [240, 248, 255],
+ antiquewhite: [250, 235, 215],
+ aqua: [0, 255, 255],
+ aquamarine: [127, 255, 212],
+ azure: [240, 255, 255],
+ beige: [245, 245, 220],
+ bisque: [255, 228, 196],
+ black: [0, 0, 0],
+ blanchedalmond: [255, 235, 205],
+ blue: [0, 0, 255],
+ blueviolet: [138, 43, 226],
+ brown: [165, 42, 42],
+ burlywood: [222, 184, 135],
+ cadetblue: [95, 158, 160],
+ chartreuse: [127, 255, 0],
+ chocolate: [210, 105, 30],
+ coral: [255, 127, 80],
+ cornflowerblue: [100, 149, 237],
+ cornsilk: [255, 248, 220],
+ crimson: [220, 20, 60],
+ cyan: [0, 255, 255],
+ darkblue: [0, 0, 139],
+ darkcyan: [0, 139, 139],
+ darkgoldenrod: [184, 134, 11],
+ darkgray: [169, 169, 169],
+ darkgreen: [0, 100, 0],
+ darkgrey: [169, 169, 169],
+ darkkhaki: [189, 183, 107],
+ darkmagenta: [139, 0, 139],
+ darkolivegreen: [85, 107, 47],
+ darkorange: [255, 140, 0],
+ darkorchid: [153, 50, 204],
+ darkred: [139, 0, 0],
+ darksalmon: [233, 150, 122],
+ darkseagreen: [143, 188, 143],
+ darkslateblue: [72, 61, 139],
+ darkslategray: [47, 79, 79],
+ darkslategrey: [47, 79, 79],
+ darkturquoise: [0, 206, 209],
+ darkviolet: [148, 0, 211],
+ deeppink: [255, 20, 147],
+ deepskyblue: [0, 191, 255],
+ dimgray: [105, 105, 105],
+ dimgrey: [105, 105, 105],
+ dodgerblue: [30, 144, 255],
+ firebrick: [178, 34, 34],
+ floralwhite: [255, 250, 240],
+ forestgreen: [34, 139, 34],
+ fuchsia: [255, 0, 255],
+ gainsboro: [220, 220, 220],
+ ghostwhite: [248, 248, 255],
+ gold: [255, 215, 0],
+ goldenrod: [218, 165, 32],
+ gray: [128, 128, 128],
+ green: [0, 128, 0],
+ greenyellow: [173, 255, 47],
+ grey: [128, 128, 128],
+ honeydew: [240, 255, 240],
+ hotpink: [255, 105, 180],
+ indianred: [205, 92, 92],
+ indigo: [75, 0, 130],
+ ivory: [255, 255, 240],
+ khaki: [240, 230, 140],
+ lavender: [230, 230, 250],
+ lavenderblush: [255, 240, 245],
+ lawngreen: [124, 252, 0],
+ lemonchiffon: [255, 250, 205],
+ lightblue: [173, 216, 230],
+ lightcoral: [240, 128, 128],
+ lightcyan: [224, 255, 255],
+ lightgoldenrodyellow: [250, 250, 210],
+ lightgray: [211, 211, 211],
+ lightgreen: [144, 238, 144],
+ lightgrey: [211, 211, 211],
+ lightpink: [255, 182, 193],
+ lightsalmon: [255, 160, 122],
+ lightseagreen: [32, 178, 170],
+ lightskyblue: [135, 206, 250],
+ lightslategray: [119, 136, 153],
+ lightslategrey: [119, 136, 153],
+ lightsteelblue: [176, 196, 222],
+ lightyellow: [255, 255, 224],
+ lime: [0, 255, 0],
+ limegreen: [50, 205, 50],
+ linen: [250, 240, 230],
+ magenta: [255, 0, 255],
+ maroon: [128, 0, 0],
+ mediumaquamarine: [102, 205, 170],
+ mediumblue: [0, 0, 205],
+ mediumorchid: [186, 85, 211],
+ mediumpurple: [147, 112, 219],
+ mediumseagreen: [60, 179, 113],
+ mediumslateblue: [123, 104, 238],
+ mediumspringgreen: [0, 250, 154],
+ mediumturquoise: [72, 209, 204],
+ mediumvioletred: [199, 21, 133],
+ midnightblue: [25, 25, 112],
+ mintcream: [245, 255, 250],
+ mistyrose: [255, 228, 225],
+ moccasin: [255, 228, 181],
+ navajowhite: [255, 222, 173],
+ navy: [0, 0, 128],
+ oldlace: [253, 245, 230],
+ olive: [128, 128, 0],
+ olivedrab: [107, 142, 35],
+ orange: [255, 165, 0],
+ orangered: [255, 69, 0],
+ orchid: [218, 112, 214],
+ palegoldenrod: [238, 232, 170],
+ palegreen: [152, 251, 152],
+ paleturquoise: [175, 238, 238],
+ palevioletred: [219, 112, 147],
+ papayawhip: [255, 239, 213],
+ peachpuff: [255, 218, 185],
+ peru: [205, 133, 63],
+ pink: [255, 192, 203],
+ plum: [221, 160, 221],
+ powderblue: [176, 224, 230],
+ purple: [128, 0, 128],
+ rebeccapurple: [102, 51, 153],
+ red: [255, 0, 0],
+ rosybrown: [188, 143, 143],
+ royalblue: [65, 105, 225],
+ saddlebrown: [139, 69, 19],
+ salmon: [250, 128, 114],
+ sandybrown: [244, 164, 96],
+ seagreen: [46, 139, 87],
+ seashell: [255, 245, 238],
+ sienna: [160, 82, 45],
+ silver: [192, 192, 192],
+ skyblue: [135, 206, 235],
+ slateblue: [106, 90, 205],
+ slategray: [112, 128, 144],
+ slategrey: [112, 128, 144],
+ snow: [255, 250, 250],
+ springgreen: [0, 255, 127],
+ steelblue: [70, 130, 180],
+ tan: [210, 180, 140],
+ teal: [0, 128, 128],
+ thistle: [216, 191, 216],
+ tomato: [255, 99, 71],
+ turquoise: [64, 224, 208],
+ violet: [238, 130, 238],
+ wheat: [245, 222, 179],
+ white: [255, 255, 255],
+ whitesmoke: [245, 245, 245],
+ yellow: [255, 255, 0],
+ yellowgreen: [154, 205, 50],
+ };
+ },
+ 4434: function (e) {
+ 'use strict';
+ var t = /[|\\{}()[\]^$+*?.]/g;
+ e.exports = function (e) {
+ if (typeof e !== 'string') {
+ throw new TypeError('Expected a string');
+ }
+ return e.replace(t, '\\$&');
+ };
+ },
+ 419: function (e) {
+ 'use strict';
+ e.exports = (e, t) => {
+ t = t || process.argv;
+ const r = e.startsWith('-') ? '' : e.length === 1 ? '-' : '--';
+ const s = t.indexOf(r + e);
+ const i = t.indexOf('--');
+ return s !== -1 && (i === -1 ? true : s < i);
+ };
+ },
+ 5346: function (e, t, r) {
+ 'use strict';
+ e.exports = r(5633);
+ },
+ 8629: function (e, t) {
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] =
+ /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
+ t.matchToToken = function (e) {
+ var t = { type: 'invalid', value: e[0], closed: undefined };
+ if (e[1]) (t.type = 'string'), (t.closed = !!(e[3] || e[4]));
+ else if (e[5]) t.type = 'comment';
+ else if (e[6]) (t.type = 'comment'), (t.closed = !!e[7]);
+ else if (e[8]) t.type = 'regex';
+ else if (e[9]) t.type = 'number';
+ else if (e[10]) t.type = 'name';
+ else if (e[11]) t.type = 'punctuator';
+ else if (e[12]) t.type = 'whitespace';
+ return t;
+ };
+ },
+ 2332: function (e, t, r) {
+ 'use strict';
+ const s = r(2037);
+ const i = r(419);
+ const n = process.env;
+ let a;
+ if (i('no-color') || i('no-colors') || i('color=false')) {
+ a = false;
+ } else if (
+ i('color') ||
+ i('colors') ||
+ i('color=true') ||
+ i('color=always')
+ ) {
+ a = true;
+ }
+ if ('FORCE_COLOR' in n) {
+ a = n.FORCE_COLOR.length === 0 || parseInt(n.FORCE_COLOR, 10) !== 0;
+ }
+ function translateLevel(e) {
+ if (e === 0) {
+ return false;
+ }
+ return { level: e, hasBasic: true, has256: e >= 2, has16m: e >= 3 };
+ }
+ function supportsColor(e) {
+ if (a === false) {
+ return 0;
+ }
+ if (i('color=16m') || i('color=full') || i('color=truecolor')) {
+ return 3;
+ }
+ if (i('color=256')) {
+ return 2;
+ }
+ if (e && !e.isTTY && a !== true) {
+ return 0;
+ }
+ const t = a ? 1 : 0;
+ if (process.platform === 'win32') {
+ const e = s.release().split('.');
+ if (
+ Number(process.versions.node.split('.')[0]) >= 8 &&
+ Number(e[0]) >= 10 &&
+ Number(e[2]) >= 10586
+ ) {
+ return Number(e[2]) >= 14931 ? 3 : 2;
+ }
+ return 1;
+ }
+ if ('CI' in n) {
+ if (
+ ['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(
+ (e) => e in n,
+ ) ||
+ n.CI_NAME === 'codeship'
+ ) {
+ return 1;
+ }
+ return t;
+ }
+ if ('TEAMCITY_VERSION' in n) {
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)
+ ? 1
+ : 0;
+ }
+ if (n.COLORTERM === 'truecolor') {
+ return 3;
+ }
+ if ('TERM_PROGRAM' in n) {
+ const e = parseInt((n.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+ switch (n.TERM_PROGRAM) {
+ case 'iTerm.app':
+ return e >= 3 ? 3 : 2;
+ case 'Apple_Terminal':
+ return 2;
+ }
+ }
+ if (/-256(color)?$/i.test(n.TERM)) {
+ return 2;
+ }
+ if (
+ /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(
+ n.TERM,
+ )
+ ) {
+ return 1;
+ }
+ if ('COLORTERM' in n) {
+ return 1;
+ }
+ if (n.TERM === 'dumb') {
+ return t;
+ }
+ return t;
+ }
+ function getSupportLevel(e) {
+ const t = supportsColor(e);
+ return translateLevel(t);
+ }
+ e.exports = {
+ supportsColor: getSupportLevel,
+ stdout: getSupportLevel(process.stdout),
+ stderr: getSupportLevel(process.stderr),
+ };
+ },
+ 7860: function (e, t, r) {
+ e.exports = r(7188);
+ },
+ 6802: function (e) {
+ 'use strict';
+ let t = null;
+ function FastObject(e) {
+ if (t !== null && typeof t.property) {
+ const e = t;
+ t = FastObject.prototype = null;
+ return e;
+ }
+ t = FastObject.prototype = e == null ? Object.create(null) : e;
+ return new FastObject();
+ }
+ FastObject();
+ e.exports = function toFastproperties(e) {
+ return FastObject(e);
+ };
+ },
+ 9491: function (e) {
+ 'use strict';
+ e.exports = require('assert');
+ },
+ 2037: function (e) {
+ 'use strict';
+ e.exports = require('os');
+ },
+ 8135: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.codeFrameColumns = codeFrameColumns;
+ t['default'] = _default;
+ var s = r(9912);
+ var i = _interopRequireWildcard(r(6673), true);
+ function _getRequireWildcardCache(e) {
+ if (typeof WeakMap !== 'function') return null;
+ var t = new WeakMap();
+ var r = new WeakMap();
+ return (_getRequireWildcardCache = function (e) {
+ return e ? r : t;
+ })(e);
+ }
+ function _interopRequireWildcard(e, t) {
+ if (!t && e && e.__esModule) {
+ return e;
+ }
+ if (e === null || (typeof e !== 'object' && typeof e !== 'function')) {
+ return { default: e };
+ }
+ var r = _getRequireWildcardCache(t);
+ if (r && r.has(e)) {
+ return r.get(e);
+ }
+ var s = {};
+ var i = Object.defineProperty && Object.getOwnPropertyDescriptor;
+ for (var n in e) {
+ if (n !== 'default' && Object.prototype.hasOwnProperty.call(e, n)) {
+ var a = i ? Object.getOwnPropertyDescriptor(e, n) : null;
+ if (a && (a.get || a.set)) {
+ Object.defineProperty(s, n, a);
+ } else {
+ s[n] = e[n];
+ }
+ }
+ }
+ s.default = e;
+ if (r) {
+ r.set(e, s);
+ }
+ return s;
+ }
+ let n = undefined;
+ function getChalk(e) {
+ if (e) {
+ var t;
+ (t = n) != null
+ ? t
+ : (n = new i.default.constructor({ enabled: true, level: 1 }));
+ return n;
+ }
+ return i.default;
+ }
+ let a = false;
+ function getDefs(e) {
+ return { gutter: e.grey, marker: e.red.bold, message: e.red.bold };
+ }
+ const o = /\r\n|[\n\r\u2028\u2029]/;
+ function getMarkerLines(e, t, r) {
+ const s = Object.assign({ column: 0, line: -1 }, e.start);
+ const i = Object.assign({}, s, e.end);
+ const { linesAbove: n = 2, linesBelow: a = 3 } = r || {};
+ const o = s.line;
+ const l = s.column;
+ const c = i.line;
+ const p = i.column;
+ let u = Math.max(o - (n + 1), 0);
+ let d = Math.min(t.length, c + a);
+ if (o === -1) {
+ u = 0;
+ }
+ if (c === -1) {
+ d = t.length;
+ }
+ const f = c - o;
+ const h = {};
+ if (f) {
+ for (let e = 0; e <= f; e++) {
+ const r = e + o;
+ if (!l) {
+ h[r] = true;
+ } else if (e === 0) {
+ const e = t[r - 1].length;
+ h[r] = [l, e - l + 1];
+ } else if (e === f) {
+ h[r] = [0, p];
+ } else {
+ const s = t[r - e].length;
+ h[r] = [0, s];
+ }
+ }
+ } else {
+ if (l === p) {
+ if (l) {
+ h[o] = [l, 0];
+ } else {
+ h[o] = true;
+ }
+ } else {
+ h[o] = [l, p - l];
+ }
+ }
+ return { start: u, end: d, markerLines: h };
+ }
+ function codeFrameColumns(e, t, r = {}) {
+ const i =
+ (r.highlightCode || r.forceColor) && (0, s.shouldHighlight)(r);
+ const n = getChalk(r.forceColor);
+ const a = getDefs(n);
+ const maybeHighlight = (e, t) => (i ? e(t) : t);
+ const l = e.split(o);
+ const { start: c, end: p, markerLines: u } = getMarkerLines(t, l, r);
+ const d = t.start && typeof t.start.column === 'number';
+ const f = String(p).length;
+ const h = i ? (0, s.default)(e, r) : e;
+ let y = h
+ .split(o, p)
+ .slice(c, p)
+ .map((e, t) => {
+ const s = c + 1 + t;
+ const i = ` ${s}`.slice(-f);
+ const n = ` ${i} |`;
+ const o = u[s];
+ const l = !u[s + 1];
+ if (o) {
+ let t = '';
+ if (Array.isArray(o)) {
+ const s = e
+ .slice(0, Math.max(o[0] - 1, 0))
+ .replace(/[^\t]/g, ' ');
+ const i = o[1] || 1;
+ t = [
+ '\n ',
+ maybeHighlight(a.gutter, n.replace(/\d/g, ' ')),
+ ' ',
+ s,
+ maybeHighlight(a.marker, '^').repeat(i),
+ ].join('');
+ if (l && r.message) {
+ t += ' ' + maybeHighlight(a.message, r.message);
+ }
+ }
+ return [
+ maybeHighlight(a.marker, '>'),
+ maybeHighlight(a.gutter, n),
+ e.length > 0 ? ` ${e}` : '',
+ t,
+ ].join('');
+ } else {
+ return ` ${maybeHighlight(a.gutter, n)}${
+ e.length > 0 ? ` ${e}` : ''
+ }`;
+ }
+ })
+ .join('\n');
+ if (r.message && !d) {
+ y = `${' '.repeat(f + 1)}${r.message}\n${y}`;
+ }
+ if (i) {
+ return n.reset(y);
+ } else {
+ return y;
+ }
+ }
+ function _default(e, t, r, s = {}) {
+ if (!a) {
+ a = true;
+ const e =
+ 'Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.';
+ if (process.emitWarning) {
+ process.emitWarning(e, 'DeprecationWarning');
+ } else {
+ const t = new Error(e);
+ t.name = 'DeprecationWarning';
+ console.warn(new Error(e));
+ }
+ }
+ r = Math.max(r, 0);
+ const i = { start: { column: r, line: t } };
+ return codeFrameColumns(e, i, s);
+ }
+ },
+ 4079: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = void 0;
+ var s = r(9491);
+ var i = r(4739);
+ const {
+ callExpression: n,
+ cloneNode: a,
+ expressionStatement: o,
+ identifier: l,
+ importDeclaration: c,
+ importDefaultSpecifier: p,
+ importNamespaceSpecifier: u,
+ importSpecifier: d,
+ memberExpression: f,
+ stringLiteral: h,
+ variableDeclaration: y,
+ variableDeclarator: m,
+ } = i;
+ class ImportBuilder {
+ constructor(e, t, r) {
+ this._statements = [];
+ this._resultName = null;
+ this._importedSource = void 0;
+ this._scope = t;
+ this._hub = r;
+ this._importedSource = e;
+ }
+ done() {
+ return { statements: this._statements, resultName: this._resultName };
+ }
+ import() {
+ this._statements.push(c([], h(this._importedSource)));
+ return this;
+ }
+ require() {
+ this._statements.push(o(n(l('require'), [h(this._importedSource)])));
+ return this;
+ }
+ namespace(e = 'namespace') {
+ const t = this._scope.generateUidIdentifier(e);
+ const r = this._statements[this._statements.length - 1];
+ s(r.type === 'ImportDeclaration');
+ s(r.specifiers.length === 0);
+ r.specifiers = [u(t)];
+ this._resultName = a(t);
+ return this;
+ }
+ default(e) {
+ const t = this._scope.generateUidIdentifier(e);
+ const r = this._statements[this._statements.length - 1];
+ s(r.type === 'ImportDeclaration');
+ s(r.specifiers.length === 0);
+ r.specifiers = [p(t)];
+ this._resultName = a(t);
+ return this;
+ }
+ named(e, t) {
+ if (t === 'default') return this.default(e);
+ const r = this._scope.generateUidIdentifier(e);
+ const i = this._statements[this._statements.length - 1];
+ s(i.type === 'ImportDeclaration');
+ s(i.specifiers.length === 0);
+ i.specifiers = [d(r, l(t))];
+ this._resultName = a(r);
+ return this;
+ }
+ var(e) {
+ const t = this._scope.generateUidIdentifier(e);
+ let r = this._statements[this._statements.length - 1];
+ if (r.type !== 'ExpressionStatement') {
+ s(this._resultName);
+ r = o(this._resultName);
+ this._statements.push(r);
+ }
+ this._statements[this._statements.length - 1] = y('var', [
+ m(t, r.expression),
+ ]);
+ this._resultName = a(t);
+ return this;
+ }
+ defaultInterop() {
+ return this._interop(this._hub.addHelper('interopRequireDefault'));
+ }
+ wildcardInterop() {
+ return this._interop(this._hub.addHelper('interopRequireWildcard'));
+ }
+ _interop(e) {
+ const t = this._statements[this._statements.length - 1];
+ if (t.type === 'ExpressionStatement') {
+ t.expression = n(e, [t.expression]);
+ } else if (t.type === 'VariableDeclaration') {
+ s(t.declarations.length === 1);
+ t.declarations[0].init = n(e, [t.declarations[0].init]);
+ } else {
+ s.fail('Unexpected type.');
+ }
+ return this;
+ }
+ prop(e) {
+ const t = this._statements[this._statements.length - 1];
+ if (t.type === 'ExpressionStatement') {
+ t.expression = f(t.expression, l(e));
+ } else if (t.type === 'VariableDeclaration') {
+ s(t.declarations.length === 1);
+ t.declarations[0].init = f(t.declarations[0].init, l(e));
+ } else {
+ s.fail('Unexpected type:' + t.type);
+ }
+ return this;
+ }
+ read(e) {
+ this._resultName = f(this._resultName, l(e));
+ }
+ }
+ t['default'] = ImportBuilder;
+ },
+ 2378: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = void 0;
+ var s = r(9491);
+ var i = r(4739);
+ var n = r(4079);
+ var a = r(9898);
+ const { numericLiteral: o, sequenceExpression: l } = i;
+ class ImportInjector {
+ constructor(e, t, r) {
+ this._defaultOpts = {
+ importedSource: null,
+ importedType: 'commonjs',
+ importedInterop: 'babel',
+ importingInterop: 'babel',
+ ensureLiveReference: false,
+ ensureNoContext: false,
+ importPosition: 'before',
+ };
+ const s = e.find((e) => e.isProgram());
+ this._programPath = s;
+ this._programScope = s.scope;
+ this._hub = s.hub;
+ this._defaultOpts = this._applyDefaults(t, r, true);
+ }
+ addDefault(e, t) {
+ return this.addNamed('default', e, t);
+ }
+ addNamed(e, t, r) {
+ s(typeof e === 'string');
+ return this._generateImport(this._applyDefaults(t, r), e);
+ }
+ addNamespace(e, t) {
+ return this._generateImport(this._applyDefaults(e, t), null);
+ }
+ addSideEffect(e, t) {
+ return this._generateImport(this._applyDefaults(e, t), void 0);
+ }
+ _applyDefaults(e, t, r = false) {
+ let i;
+ if (typeof e === 'string') {
+ i = Object.assign({}, this._defaultOpts, { importedSource: e }, t);
+ } else {
+ s(!t, 'Unexpected secondary arguments.');
+ i = Object.assign({}, this._defaultOpts, e);
+ }
+ if (!r && t) {
+ if (t.nameHint !== undefined) i.nameHint = t.nameHint;
+ if (t.blockHoist !== undefined) i.blockHoist = t.blockHoist;
+ }
+ return i;
+ }
+ _generateImport(e, t) {
+ const r = t === 'default';
+ const s = !!t && !r;
+ const i = t === null;
+ const {
+ importedSource: c,
+ importedType: p,
+ importedInterop: u,
+ importingInterop: d,
+ ensureLiveReference: f,
+ ensureNoContext: h,
+ nameHint: y,
+ importPosition: m,
+ blockHoist: T,
+ } = e;
+ let S = y || t;
+ const x = (0, a.default)(this._programPath);
+ const b = x && d === 'node';
+ const E = x && d === 'babel';
+ if (m === 'after' && !x) {
+ throw new Error(
+ `"importPosition": "after" is only supported in modules`,
+ );
+ }
+ const P = new n.default(c, this._programScope, this._hub);
+ if (p === 'es6') {
+ if (!b && !E) {
+ throw new Error('Cannot import an ES6 module from CommonJS');
+ }
+ P.import();
+ if (i) {
+ P.namespace(y || c);
+ } else if (r || s) {
+ P.named(S, t);
+ }
+ } else if (p !== 'commonjs') {
+ throw new Error(`Unexpected interopType "${p}"`);
+ } else if (u === 'babel') {
+ if (b) {
+ S = S !== 'default' ? S : c;
+ const e = `${c}$es6Default`;
+ P.import();
+ if (i) {
+ P.default(e)
+ .var(S || c)
+ .wildcardInterop();
+ } else if (r) {
+ if (f) {
+ P.default(e)
+ .var(S || c)
+ .defaultInterop()
+ .read('default');
+ } else {
+ P.default(e).var(S).defaultInterop().prop(t);
+ }
+ } else if (s) {
+ P.default(e).read(t);
+ }
+ } else if (E) {
+ P.import();
+ if (i) {
+ P.namespace(S || c);
+ } else if (r || s) {
+ P.named(S, t);
+ }
+ } else {
+ P.require();
+ if (i) {
+ P.var(S || c).wildcardInterop();
+ } else if ((r || s) && f) {
+ if (r) {
+ S = S !== 'default' ? S : c;
+ P.var(S).read(t);
+ P.defaultInterop();
+ } else {
+ P.var(c).read(t);
+ }
+ } else if (r) {
+ P.var(S).defaultInterop().prop(t);
+ } else if (s) {
+ P.var(S).prop(t);
+ }
+ }
+ } else if (u === 'compiled') {
+ if (b) {
+ P.import();
+ if (i) {
+ P.default(S || c);
+ } else if (r || s) {
+ P.default(c).read(S);
+ }
+ } else if (E) {
+ P.import();
+ if (i) {
+ P.namespace(S || c);
+ } else if (r || s) {
+ P.named(S, t);
+ }
+ } else {
+ P.require();
+ if (i) {
+ P.var(S || c);
+ } else if (r || s) {
+ if (f) {
+ P.var(c).read(S);
+ } else {
+ P.prop(t).var(S);
+ }
+ }
+ }
+ } else if (u === 'uncompiled') {
+ if (r && f) {
+ throw new Error('No live reference for commonjs default');
+ }
+ if (b) {
+ P.import();
+ if (i) {
+ P.default(S || c);
+ } else if (r) {
+ P.default(S);
+ } else if (s) {
+ P.default(c).read(S);
+ }
+ } else if (E) {
+ P.import();
+ if (i) {
+ P.default(S || c);
+ } else if (r) {
+ P.default(S);
+ } else if (s) {
+ P.named(S, t);
+ }
+ } else {
+ P.require();
+ if (i) {
+ P.var(S || c);
+ } else if (r) {
+ P.var(S);
+ } else if (s) {
+ if (f) {
+ P.var(c).read(S);
+ } else {
+ P.var(S).prop(t);
+ }
+ }
+ }
+ } else {
+ throw new Error(`Unknown importedInterop "${u}".`);
+ }
+ const { statements: g, resultName: A } = P.done();
+ this._insertStatements(g, m, T);
+ if ((r || s) && h && A.type !== 'Identifier') {
+ return l([o(0), A]);
+ }
+ return A;
+ }
+ _insertStatements(e, t = 'before', r = 3) {
+ const s = this._programPath.get('body');
+ if (t === 'after') {
+ for (let t = s.length - 1; t >= 0; t--) {
+ if (s[t].isImportDeclaration()) {
+ s[t].insertAfter(e);
+ return;
+ }
+ }
+ } else {
+ e.forEach((e) => {
+ e._blockHoist = r;
+ });
+ const t = s.find((e) => {
+ const t = e.node._blockHoist;
+ return Number.isFinite(t) && t < 4;
+ });
+ if (t) {
+ t.insertBefore(e);
+ return;
+ }
+ }
+ this._programPath.unshiftContainer('body', e);
+ }
+ }
+ t['default'] = ImportInjector;
+ },
+ 2408: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ Object.defineProperty(t, 'ImportInjector', {
+ enumerable: true,
+ get: function () {
+ return s.default;
+ },
+ });
+ t.addDefault = addDefault;
+ t.addNamed = addNamed;
+ t.addNamespace = addNamespace;
+ t.addSideEffect = addSideEffect;
+ Object.defineProperty(t, 'isModule', {
+ enumerable: true,
+ get: function () {
+ return i.default;
+ },
+ });
+ var s = r(2378);
+ var i = r(9898);
+ function addDefault(e, t, r) {
+ return new s.default(e).addDefault(t, r);
+ }
+ function addNamed(e, t, r, i) {
+ return new s.default(e).addNamed(t, r, i);
+ }
+ function addNamespace(e, t, r) {
+ return new s.default(e).addNamespace(t, r);
+ }
+ function addSideEffect(e, t, r) {
+ return new s.default(e).addSideEffect(t, r);
+ }
+ },
+ 9898: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isModule;
+ function isModule(e) {
+ return e.node.sourceType === 'module';
+ }
+ },
+ 6028: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.declare = declare;
+ t.declarePreset = void 0;
+ const r = {
+ assertVersion: (e) => (t) => {
+ throwVersionError(t, e.version);
+ },
+ };
+ {
+ Object.assign(r, {
+ targets: () => () => ({}),
+ assumption: () => () => undefined,
+ });
+ }
+ function declare(e) {
+ return (t, s, i) => {
+ var n;
+ let a;
+ for (const e of Object.keys(r)) {
+ var o;
+ if (t[e]) continue;
+ (o = a) != null ? o : (a = copyApiObject(t));
+ a[e] = r[e](a);
+ }
+ return e((n = a) != null ? n : t, s || {}, i);
+ };
+ }
+ const s = declare;
+ t.declarePreset = s;
+ function copyApiObject(e) {
+ let t = null;
+ if (typeof e.version === 'string' && /^7\./.test(e.version)) {
+ t = Object.getPrototypeOf(e);
+ if (
+ t &&
+ (!has(t, 'version') ||
+ !has(t, 'transform') ||
+ !has(t, 'template') ||
+ !has(t, 'types'))
+ ) {
+ t = null;
+ }
+ }
+ return Object.assign({}, t, e);
+ }
+ function has(e, t) {
+ return Object.prototype.hasOwnProperty.call(e, t);
+ }
+ function throwVersionError(e, t) {
+ if (typeof e === 'number') {
+ if (!Number.isInteger(e)) {
+ throw new Error('Expected string or integer value.');
+ }
+ e = `^${e}.0.0-0`;
+ }
+ if (typeof e !== 'string') {
+ throw new Error('Expected string or integer value.');
+ }
+ const r = Error.stackTraceLimit;
+ if (typeof r === 'number' && r < 25) {
+ Error.stackTraceLimit = 25;
+ }
+ let s;
+ if (t.slice(0, 2) === '7.') {
+ s = new Error(
+ `Requires Babel "^7.0.0-beta.41", but was loaded with "${t}". ` +
+ `You'll need to update your @babel/core version.`,
+ );
+ } else {
+ s = new Error(
+ `Requires Babel "${e}", but was loaded with "${t}". ` +
+ `If you are sure you have a compatible version of @babel/core, ` +
+ `it is likely that something in your build process is loading the ` +
+ `wrong version. Inspect the stack trace of this error to look for ` +
+ `the first entry that doesn't mention "@babel/core" or "babel-core" ` +
+ `to see what is calling Babel.`,
+ );
+ }
+ if (typeof r === 'number') {
+ Error.stackTraceLimit = r;
+ }
+ throw Object.assign(s, {
+ code: 'BABEL_VERSION_UNSUPPORTED',
+ version: t,
+ range: e,
+ });
+ }
+ },
+ 2776: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.readCodePoint = readCodePoint;
+ t.readInt = readInt;
+ t.readStringContents = readStringContents;
+ var r = function isDigit(e) {
+ return e >= 48 && e <= 57;
+ };
+ const s = {
+ decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
+ hex: new Set([46, 88, 95, 120]),
+ };
+ const i = {
+ bin: (e) => e === 48 || e === 49,
+ oct: (e) => e >= 48 && e <= 55,
+ dec: (e) => e >= 48 && e <= 57,
+ hex: (e) =>
+ (e >= 48 && e <= 57) || (e >= 65 && e <= 70) || (e >= 97 && e <= 102),
+ };
+ function readStringContents(e, t, r, s, i, n) {
+ const a = r;
+ const o = s;
+ const l = i;
+ let c = '';
+ let p = null;
+ let u = r;
+ const { length: d } = t;
+ for (;;) {
+ if (r >= d) {
+ n.unterminated(a, o, l);
+ c += t.slice(u, r);
+ break;
+ }
+ const f = t.charCodeAt(r);
+ if (isStringEnd(e, f, t, r)) {
+ c += t.slice(u, r);
+ break;
+ }
+ if (f === 92) {
+ c += t.slice(u, r);
+ const a = readEscapedChar(t, r, s, i, e === 'template', n);
+ if (a.ch === null && !p) {
+ p = { pos: r, lineStart: s, curLine: i };
+ } else {
+ c += a.ch;
+ }
+ ({ pos: r, lineStart: s, curLine: i } = a);
+ u = r;
+ } else if (f === 8232 || f === 8233) {
+ ++r;
+ ++i;
+ s = r;
+ } else if (f === 10 || f === 13) {
+ if (e === 'template') {
+ c += t.slice(u, r) + '\n';
+ ++r;
+ if (f === 13 && t.charCodeAt(r) === 10) {
+ ++r;
+ }
+ ++i;
+ u = s = r;
+ } else {
+ n.unterminated(a, o, l);
+ }
+ } else {
+ ++r;
+ }
+ }
+ return {
+ pos: r,
+ str: c,
+ firstInvalidLoc: p,
+ lineStart: s,
+ curLine: i,
+ containsInvalid: !!p,
+ };
+ }
+ function isStringEnd(e, t, r, s) {
+ if (e === 'template') {
+ return t === 96 || (t === 36 && r.charCodeAt(s + 1) === 123);
+ }
+ return t === (e === 'double' ? 34 : 39);
+ }
+ function readEscapedChar(e, t, r, s, i, n) {
+ const a = !i;
+ t++;
+ const res = (e) => ({ pos: t, ch: e, lineStart: r, curLine: s });
+ const o = e.charCodeAt(t++);
+ switch (o) {
+ case 110:
+ return res('\n');
+ case 114:
+ return res('\r');
+ case 120: {
+ let i;
+ ({ code: i, pos: t } = readHexChar(e, t, r, s, 2, false, a, n));
+ return res(i === null ? null : String.fromCharCode(i));
+ }
+ case 117: {
+ let i;
+ ({ code: i, pos: t } = readCodePoint(e, t, r, s, a, n));
+ return res(i === null ? null : String.fromCodePoint(i));
+ }
+ case 116:
+ return res('\t');
+ case 98:
+ return res('\b');
+ case 118:
+ return res('\v');
+ case 102:
+ return res('\f');
+ case 13:
+ if (e.charCodeAt(t) === 10) {
+ ++t;
+ }
+ case 10:
+ r = t;
+ ++s;
+ case 8232:
+ case 8233:
+ return res('');
+ case 56:
+ case 57:
+ if (i) {
+ return res(null);
+ } else {
+ n.strictNumericEscape(t - 1, r, s);
+ }
+ default:
+ if (o >= 48 && o <= 55) {
+ const a = t - 1;
+ const o = e.slice(a, t + 2).match(/^[0-7]+/);
+ let l = o[0];
+ let c = parseInt(l, 8);
+ if (c > 255) {
+ l = l.slice(0, -1);
+ c = parseInt(l, 8);
+ }
+ t += l.length - 1;
+ const p = e.charCodeAt(t);
+ if (l !== '0' || p === 56 || p === 57) {
+ if (i) {
+ return res(null);
+ } else {
+ n.strictNumericEscape(a, r, s);
+ }
+ }
+ return res(String.fromCharCode(c));
+ }
+ return res(String.fromCharCode(o));
+ }
+ }
+ function readHexChar(e, t, r, s, i, n, a, o) {
+ const l = t;
+ let c;
+ ({ n: c, pos: t } = readInt(e, t, r, s, 16, i, n, false, o, !a));
+ if (c === null) {
+ if (a) {
+ o.invalidEscapeSequence(l, r, s);
+ } else {
+ t = l - 1;
+ }
+ }
+ return { code: c, pos: t };
+ }
+ function readInt(e, t, n, a, o, l, c, p, u, d) {
+ const f = t;
+ const h = o === 16 ? s.hex : s.decBinOct;
+ const y = o === 16 ? i.hex : o === 10 ? i.dec : o === 8 ? i.oct : i.bin;
+ let m = false;
+ let T = 0;
+ for (let s = 0, i = l == null ? Infinity : l; s < i; ++s) {
+ const s = e.charCodeAt(t);
+ let i;
+ if (s === 95 && p !== 'bail') {
+ const r = e.charCodeAt(t - 1);
+ const s = e.charCodeAt(t + 1);
+ if (!p) {
+ if (d) return { n: null, pos: t };
+ u.numericSeparatorInEscapeSequence(t, n, a);
+ } else if (Number.isNaN(s) || !y(s) || h.has(r) || h.has(s)) {
+ if (d) return { n: null, pos: t };
+ u.unexpectedNumericSeparator(t, n, a);
+ }
+ ++t;
+ continue;
+ }
+ if (s >= 97) {
+ i = s - 97 + 10;
+ } else if (s >= 65) {
+ i = s - 65 + 10;
+ } else if (r(s)) {
+ i = s - 48;
+ } else {
+ i = Infinity;
+ }
+ if (i >= o) {
+ if (i <= 9 && d) {
+ return { n: null, pos: t };
+ } else if (i <= 9 && u.invalidDigit(t, n, a, o)) {
+ i = 0;
+ } else if (c) {
+ i = 0;
+ m = true;
+ } else {
+ break;
+ }
+ }
+ ++t;
+ T = T * o + i;
+ }
+ if (t === f || (l != null && t - f !== l) || m) {
+ return { n: null, pos: t };
+ }
+ return { n: T, pos: t };
+ }
+ function readCodePoint(e, t, r, s, i, n) {
+ const a = e.charCodeAt(t);
+ let o;
+ if (a === 123) {
+ ++t;
+ ({ code: o, pos: t } = readHexChar(
+ e,
+ t,
+ r,
+ s,
+ e.indexOf('}', t) - t,
+ true,
+ i,
+ n,
+ ));
+ ++t;
+ if (o !== null && o > 1114111) {
+ if (i) {
+ n.invalidCodePoint(t, r, s);
+ } else {
+ return { code: null, pos: t };
+ }
+ }
+ } else {
+ ({ code: o, pos: t } = readHexChar(e, t, r, s, 4, false, i, n));
+ }
+ return { code: o, pos: t };
+ }
+ },
+ 5704: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.isIdentifierChar = isIdentifierChar;
+ t.isIdentifierName = isIdentifierName;
+ t.isIdentifierStart = isIdentifierStart;
+ let r =
+ 'ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ';
+ let s =
+ '·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・';
+ const i = new RegExp('[' + r + ']');
+ const n = new RegExp('[' + r + s + ']');
+ r = s = null;
+ const a = [
+ 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, 16, 621,
+ 2467, 541, 1507, 4938, 6, 4191,
+ ];
+ const o = [
+ 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,
+ ];
+ function isInAstralSet(e, t) {
+ let r = 65536;
+ for (let s = 0, i = t.length; s < i; s += 2) {
+ r += t[s];
+ if (r > e) return false;
+ r += t[s + 1];
+ if (r >= e) return true;
+ }
+ return false;
+ }
+ function isIdentifierStart(e) {
+ if (e < 65) return e === 36;
+ if (e <= 90) return true;
+ if (e < 97) return e === 95;
+ if (e <= 122) return true;
+ if (e <= 65535) {
+ return e >= 170 && i.test(String.fromCharCode(e));
+ }
+ return isInAstralSet(e, a);
+ }
+ function isIdentifierChar(e) {
+ if (e < 48) return e === 36;
+ if (e < 58) return true;
+ if (e < 65) return false;
+ if (e <= 90) return true;
+ if (e < 97) return e === 95;
+ if (e <= 122) return true;
+ if (e <= 65535) {
+ return e >= 170 && n.test(String.fromCharCode(e));
+ }
+ return isInAstralSet(e, a) || isInAstralSet(e, o);
+ }
+ function isIdentifierName(e) {
+ let t = true;
+ for (let r = 0; r < e.length; r++) {
+ let s = e.charCodeAt(r);
+ if ((s & 64512) === 55296 && r + 1 < e.length) {
+ const t = e.charCodeAt(++r);
+ if ((t & 64512) === 56320) {
+ s = 65536 + ((s & 1023) << 10) + (t & 1023);
+ }
+ }
+ if (t) {
+ t = false;
+ if (!isIdentifierStart(s)) {
+ return false;
+ }
+ } else if (!isIdentifierChar(s)) {
+ return false;
+ }
+ }
+ return !t;
+ }
+ },
+ 3442: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ Object.defineProperty(t, 'isIdentifierChar', {
+ enumerable: true,
+ get: function () {
+ return s.isIdentifierChar;
+ },
+ });
+ Object.defineProperty(t, 'isIdentifierName', {
+ enumerable: true,
+ get: function () {
+ return s.isIdentifierName;
+ },
+ });
+ Object.defineProperty(t, 'isIdentifierStart', {
+ enumerable: true,
+ get: function () {
+ return s.isIdentifierStart;
+ },
+ });
+ Object.defineProperty(t, 'isKeyword', {
+ enumerable: true,
+ get: function () {
+ return i.isKeyword;
+ },
+ });
+ Object.defineProperty(t, 'isReservedWord', {
+ enumerable: true,
+ get: function () {
+ return i.isReservedWord;
+ },
+ });
+ Object.defineProperty(t, 'isStrictBindOnlyReservedWord', {
+ enumerable: true,
+ get: function () {
+ return i.isStrictBindOnlyReservedWord;
+ },
+ });
+ Object.defineProperty(t, 'isStrictBindReservedWord', {
+ enumerable: true,
+ get: function () {
+ return i.isStrictBindReservedWord;
+ },
+ });
+ Object.defineProperty(t, 'isStrictReservedWord', {
+ enumerable: true,
+ get: function () {
+ return i.isStrictReservedWord;
+ },
+ });
+ var s = r(5704);
+ var i = r(5810);
+ },
+ 5810: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.isKeyword = isKeyword;
+ t.isReservedWord = isReservedWord;
+ t.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
+ t.isStrictBindReservedWord = isStrictBindReservedWord;
+ t.isStrictReservedWord = isStrictReservedWord;
+ const r = {
+ 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',
+ ],
+ strict: [
+ 'implements',
+ 'interface',
+ 'let',
+ 'package',
+ 'private',
+ 'protected',
+ 'public',
+ 'static',
+ 'yield',
+ ],
+ strictBind: ['eval', 'arguments'],
+ };
+ const s = new Set(r.keyword);
+ const i = new Set(r.strict);
+ const n = new Set(r.strictBind);
+ function isReservedWord(e, t) {
+ return (t && e === 'await') || e === 'enum';
+ }
+ function isStrictReservedWord(e, t) {
+ return isReservedWord(e, t) || i.has(e);
+ }
+ function isStrictBindOnlyReservedWord(e) {
+ return n.has(e);
+ }
+ function isStrictBindReservedWord(e, t) {
+ return isStrictReservedWord(e, t) || isStrictBindOnlyReservedWord(e);
+ }
+ function isKeyword(e) {
+ return s.has(e);
+ }
+ },
+ 9912: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = highlight;
+ t.shouldHighlight = shouldHighlight;
+ var s = r(8629);
+ var i = r(3442);
+ var n = _interopRequireWildcard(r(6673), true);
+ function _getRequireWildcardCache(e) {
+ if (typeof WeakMap !== 'function') return null;
+ var t = new WeakMap();
+ var r = new WeakMap();
+ return (_getRequireWildcardCache = function (e) {
+ return e ? r : t;
+ })(e);
+ }
+ function _interopRequireWildcard(e, t) {
+ if (!t && e && e.__esModule) {
+ return e;
+ }
+ if (e === null || (typeof e !== 'object' && typeof e !== 'function')) {
+ return { default: e };
+ }
+ var r = _getRequireWildcardCache(t);
+ if (r && r.has(e)) {
+ return r.get(e);
+ }
+ var s = {};
+ var i = Object.defineProperty && Object.getOwnPropertyDescriptor;
+ for (var n in e) {
+ if (n !== 'default' && Object.prototype.hasOwnProperty.call(e, n)) {
+ var a = i ? Object.getOwnPropertyDescriptor(e, n) : null;
+ if (a && (a.get || a.set)) {
+ Object.defineProperty(s, n, a);
+ } else {
+ s[n] = e[n];
+ }
+ }
+ }
+ s.default = e;
+ if (r) {
+ r.set(e, s);
+ }
+ return s;
+ }
+ const a = new Set(['as', 'async', 'from', 'get', 'of', 'set']);
+ function getDefs(e) {
+ return {
+ keyword: e.cyan,
+ capitalized: e.yellow,
+ jsxIdentifier: e.yellow,
+ punctuator: e.yellow,
+ number: e.magenta,
+ string: e.green,
+ regex: e.magenta,
+ comment: e.grey,
+ invalid: e.white.bgRed.bold,
+ };
+ }
+ const o = /\r\n|[\n\r\u2028\u2029]/;
+ const l = /^[()[\]{}]$/;
+ let c;
+ {
+ const e = /^[a-z][\w-]*$/i;
+ const getTokenType = function (t, r, s) {
+ if (t.type === 'name') {
+ if (
+ (0, i.isKeyword)(t.value) ||
+ (0, i.isStrictReservedWord)(t.value, true) ||
+ a.has(t.value)
+ ) {
+ return 'keyword';
+ }
+ if (
+ e.test(t.value) &&
+ (s[r - 1] === '<' || s.slice(r - 2, r) == '')
+ ) {
+ return 'jsxIdentifier';
+ }
+ if (t.value[0] !== t.value[0].toLowerCase()) {
+ return 'capitalized';
+ }
+ }
+ if (t.type === 'punctuator' && l.test(t.value)) {
+ return 'bracket';
+ }
+ if (t.type === 'invalid' && (t.value === '@' || t.value === '#')) {
+ return 'punctuator';
+ }
+ return t.type;
+ };
+ c = function* (e) {
+ let t;
+ while ((t = s.default.exec(e))) {
+ const r = s.matchToToken(t);
+ yield { type: getTokenType(r, t.index, e), value: r.value };
+ }
+ };
+ }
+ function highlightTokens(e, t) {
+ let r = '';
+ for (const { type: s, value: i } of c(t)) {
+ const t = e[s];
+ if (t) {
+ r += i
+ .split(o)
+ .map((e) => t(e))
+ .join('\n');
+ } else {
+ r += i;
+ }
+ }
+ return r;
+ }
+ function shouldHighlight(e) {
+ return n.default.level > 0 || e.forceColor;
+ }
+ let p = undefined;
+ function getChalk(e) {
+ if (e) {
+ var t;
+ (t = p) != null
+ ? t
+ : (p = new n.default.constructor({ enabled: true, level: 1 }));
+ return p;
+ }
+ return n.default;
+ }
+ {
+ t.getChalk = (e) => getChalk(e.forceColor);
+ }
+ function highlight(e, t = {}) {
+ if (e !== '' && shouldHighlight(t)) {
+ const r = getDefs(getChalk(t.forceColor));
+ return highlightTokens(r, e);
+ } else {
+ return e;
+ }
+ }
+ },
+ 3033: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ function _objectWithoutPropertiesLoose(e, t) {
+ if (e == null) return {};
+ var r = {};
+ var s = Object.keys(e);
+ var i, n;
+ for (n = 0; n < s.length; n++) {
+ i = s[n];
+ if (t.indexOf(i) >= 0) continue;
+ r[i] = e[i];
+ }
+ return r;
+ }
+ class Position {
+ constructor(e, t, r) {
+ this.line = void 0;
+ this.column = void 0;
+ this.index = void 0;
+ this.line = e;
+ this.column = t;
+ this.index = r;
+ }
+ }
+ class SourceLocation {
+ constructor(e, t) {
+ this.start = void 0;
+ this.end = void 0;
+ this.filename = void 0;
+ this.identifierName = void 0;
+ this.start = e;
+ this.end = t;
+ }
+ }
+ function createPositionWithColumnOffset(e, t) {
+ const { line: r, column: s, index: i } = e;
+ return new Position(r, s + t, i + t);
+ }
+ const r = 'BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED';
+ var s = {
+ ImportMetaOutsideModule: {
+ message: `import.meta may appear only with 'sourceType: "module"'`,
+ code: r,
+ },
+ ImportOutsideModule: {
+ message: `'import' and 'export' may appear only with 'sourceType: "module"'`,
+ code: r,
+ },
+ };
+ const i = {
+ ArrayPattern: 'array destructuring pattern',
+ AssignmentExpression: 'assignment expression',
+ AssignmentPattern: 'assignment expression',
+ ArrowFunctionExpression: 'arrow function expression',
+ ConditionalExpression: 'conditional expression',
+ CatchClause: 'catch clause',
+ ForOfStatement: 'for-of statement',
+ ForInStatement: 'for-in statement',
+ ForStatement: 'for-loop',
+ FormalParameters: 'function parameter list',
+ Identifier: 'identifier',
+ ImportSpecifier: 'import specifier',
+ ImportDefaultSpecifier: 'import default specifier',
+ ImportNamespaceSpecifier: 'import namespace specifier',
+ ObjectPattern: 'object destructuring pattern',
+ ParenthesizedExpression: 'parenthesized expression',
+ RestElement: 'rest element',
+ UpdateExpression: {
+ true: 'prefix operation',
+ false: 'postfix operation',
+ },
+ VariableDeclarator: 'variable declaration',
+ YieldExpression: 'yield expression',
+ };
+ const toNodeDescription = ({ type: e, prefix: t }) =>
+ e === 'UpdateExpression' ? i.UpdateExpression[String(t)] : i[e];
+ var n = {
+ AccessorIsGenerator: ({ kind: e }) =>
+ `A ${e}ter cannot be a generator.`,
+ ArgumentsInClass:
+ "'arguments' is only allowed in functions and class methods.",
+ AsyncFunctionInSingleStatementContext:
+ 'Async functions can only be declared at the top level or inside a block.',
+ AwaitBindingIdentifier:
+ "Can not use 'await' as identifier inside an async function.",
+ AwaitBindingIdentifierInStaticBlock:
+ "Can not use 'await' as identifier inside a static block.",
+ AwaitExpressionFormalParameter:
+ "'await' is not allowed in async function parameters.",
+ AwaitUsingNotInAsyncContext:
+ "'await using' is only allowed within async functions and at the top levels of modules.",
+ AwaitNotInAsyncContext:
+ "'await' is only allowed within async functions and at the top levels of modules.",
+ AwaitNotInAsyncFunction:
+ "'await' is only allowed within async functions.",
+ BadGetterArity: "A 'get' accessor must not have any formal parameters.",
+ BadSetterArity:
+ "A 'set' accessor must have exactly one formal parameter.",
+ BadSetterRestParameter:
+ "A 'set' accessor function argument must not be a rest parameter.",
+ ConstructorClassField:
+ "Classes may not have a field named 'constructor'.",
+ ConstructorClassPrivateField:
+ "Classes may not have a private field named '#constructor'.",
+ ConstructorIsAccessor: 'Class constructor may not be an accessor.',
+ ConstructorIsAsync: "Constructor can't be an async function.",
+ ConstructorIsGenerator: "Constructor can't be a generator.",
+ DeclarationMissingInitializer: ({ kind: e }) =>
+ `Missing initializer in ${e} declaration.`,
+ DecoratorArgumentsOutsideParentheses:
+ "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",
+ DecoratorBeforeExport:
+ "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",
+ DecoratorsBeforeAfterExport:
+ "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",
+ DecoratorConstructor:
+ "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
+ DecoratorExportClass:
+ "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",
+ DecoratorSemicolon: 'Decorators must not be followed by a semicolon.',
+ DecoratorStaticBlock: "Decorators can't be used with a static block.",
+ DeferImportRequiresNamespace:
+ 'Only `import defer * as x from "./module"` is valid.',
+ DeletePrivateField: 'Deleting a private field is not allowed.',
+ DestructureNamedImport:
+ 'ES2015 named imports do not destructure. Use another statement for destructuring after the import.',
+ DuplicateConstructor: 'Duplicate constructor in the same class.',
+ DuplicateDefaultExport: 'Only one default export allowed per module.',
+ DuplicateExport: ({ exportName: e }) =>
+ `\`${e}\` has already been exported. Exported identifiers must be unique.`,
+ DuplicateProto: 'Redefinition of __proto__ property.',
+ DuplicateRegExpFlags: 'Duplicate regular expression flag.',
+ DynamicImportPhaseRequiresImportExpressions: ({ phase: e }) =>
+ `'import.${e}(...)' can only be parsed when using the 'createImportExpressions' option.`,
+ ElementAfterRest: 'Rest element must be last element.',
+ EscapedCharNotAnIdentifier: 'Invalid Unicode escape.',
+ ExportBindingIsString: ({ localName: e, exportName: t }) =>
+ `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,
+ ExportDefaultFromAsIdentifier:
+ "'from' is not allowed as an identifier after 'export default'.",
+ ForInOfLoopInitializer: ({ type: e }) =>
+ `'${
+ e === 'ForInStatement' ? 'for-in' : 'for-of'
+ }' loop variable declaration may not have an initializer.`,
+ ForInUsing: "For-in loop may not start with 'using' declaration.",
+ ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
+ ForOfLet:
+ "The left-hand side of a for-of loop may not start with 'let'.",
+ GeneratorInSingleStatementContext:
+ 'Generators can only be declared at the top level or inside a block.',
+ IllegalBreakContinue: ({ type: e }) =>
+ `Unsyntactic ${e === 'BreakStatement' ? 'break' : 'continue'}.`,
+ IllegalLanguageModeDirective:
+ "Illegal 'use strict' directive in function with non-simple parameter list.",
+ IllegalReturn: "'return' outside of function.",
+ ImportAttributesUseAssert:
+ 'The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.',
+ ImportBindingIsString: ({ importName: e }) =>
+ `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${e}" as foo }\`?`,
+ ImportCallArgumentTrailingComma:
+ 'Trailing comma is disallowed inside import(...) arguments.',
+ ImportCallArity: ({ maxArgumentCount: e }) =>
+ `\`import()\` requires exactly ${
+ e === 1 ? 'one argument' : 'one or two arguments'
+ }.`,
+ ImportCallNotNewExpression: 'Cannot use new with import(...).',
+ ImportCallSpreadArgument: '`...` is not allowed in `import()`.',
+ ImportJSONBindingNotDefault:
+ 'A JSON module can only be imported with `default`.',
+ ImportReflectionHasAssertion:
+ '`import module x` cannot have assertions.',
+ ImportReflectionNotBinding:
+ 'Only `import module x from "./module"` is valid.',
+ IncompatibleRegExpUVFlags:
+ "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
+ InvalidBigIntLiteral: 'Invalid BigIntLiteral.',
+ InvalidCodePoint: 'Code point out of bounds.',
+ InvalidCoverInitializedName: 'Invalid shorthand property initializer.',
+ InvalidDecimal: 'Invalid decimal.',
+ InvalidDigit: ({ radix: e }) => `Expected number in radix ${e}.`,
+ InvalidEscapeSequence: 'Bad character escape sequence.',
+ InvalidEscapeSequenceTemplate: 'Invalid escape sequence in template.',
+ InvalidEscapedReservedWord: ({ reservedWord: e }) =>
+ `Escape sequence in keyword ${e}.`,
+ InvalidIdentifier: ({ identifierName: e }) =>
+ `Invalid identifier ${e}.`,
+ InvalidLhs: ({ ancestor: e }) =>
+ `Invalid left-hand side in ${toNodeDescription(e)}.`,
+ InvalidLhsBinding: ({ ancestor: e }) =>
+ `Binding invalid left-hand side in ${toNodeDescription(e)}.`,
+ InvalidLhsOptionalChaining: ({ ancestor: e }) =>
+ `Invalid optional chaining in the left-hand side of ${toNodeDescription(
+ e,
+ )}.`,
+ InvalidNumber: 'Invalid number.',
+ InvalidOrMissingExponent:
+ "Floating-point numbers require a valid exponent after the 'e'.",
+ InvalidOrUnexpectedToken: ({ unexpected: e }) =>
+ `Unexpected character '${e}'.`,
+ InvalidParenthesizedAssignment:
+ 'Invalid parenthesized assignment pattern.',
+ InvalidPrivateFieldResolution: ({ identifierName: e }) =>
+ `Private name #${e} is not defined.`,
+ InvalidPropertyBindingPattern: 'Binding member expression.',
+ InvalidRecordProperty:
+ 'Only properties and spread elements are allowed in record definitions.',
+ InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
+ LabelRedeclaration: ({ labelName: e }) =>
+ `Label '${e}' is already declared.`,
+ LetInLexicalBinding: "'let' is disallowed as a lexically bound name.",
+ LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
+ MalformedRegExpFlags: 'Invalid regular expression flag.',
+ MissingClassName: 'A class name is required.',
+ MissingEqInAssignment:
+ "Only '=' operator can be used for specifying default value.",
+ MissingSemicolon: 'Missing semicolon.',
+ MissingPlugin: ({ missingPlugin: e }) =>
+ `This experimental syntax requires enabling the parser plugin: ${e
+ .map((e) => JSON.stringify(e))
+ .join(', ')}.`,
+ MissingOneOfPlugins: ({ missingPlugin: e }) =>
+ `This experimental syntax requires enabling one of the following parser plugin(s): ${e
+ .map((e) => JSON.stringify(e))
+ .join(', ')}.`,
+ MissingUnicodeEscape: 'Expecting Unicode escape sequence \\uXXXX.',
+ MixingCoalesceWithLogical:
+ 'Nullish coalescing operator(??) requires parens when mixing with logical operators.',
+ ModuleAttributeDifferentFromType:
+ 'The only accepted module attribute is `type`.',
+ ModuleAttributeInvalidValue:
+ 'Only string literals are allowed as module attribute values.',
+ ModuleAttributesWithDuplicateKeys: ({ key: e }) =>
+ `Duplicate key "${e}" is not allowed in module attributes.`,
+ ModuleExportNameHasLoneSurrogate: ({ surrogateCharCode: e }) =>
+ `An export name cannot include a lone surrogate, found '\\u${e.toString(
+ 16,
+ )}'.`,
+ ModuleExportUndefined: ({ localName: e }) =>
+ `Export '${e}' is not defined.`,
+ MultipleDefaultsInSwitch: 'Multiple default clauses.',
+ NewlineAfterThrow: 'Illegal newline after throw.',
+ NoCatchOrFinally: 'Missing catch or finally clause.',
+ NumberIdentifier: 'Identifier directly after number.',
+ NumericSeparatorInEscapeSequence:
+ 'Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.',
+ ObsoleteAwaitStar:
+ "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
+ OptionalChainingNoNew:
+ 'Constructors in/after an Optional Chain are not allowed.',
+ OptionalChainingNoTemplate:
+ 'Tagged Template Literals are not allowed in optionalChain.',
+ OverrideOnConstructor:
+ "'override' modifier cannot appear on a constructor declaration.",
+ ParamDupe: 'Argument name clash.',
+ PatternHasAccessor: "Object pattern can't contain getter or setter.",
+ PatternHasMethod: "Object pattern can't contain methods.",
+ PrivateInExpectedIn: ({ identifierName: e }) =>
+ `Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,
+ PrivateNameRedeclaration: ({ identifierName: e }) =>
+ `Duplicate private name #${e}.`,
+ RecordExpressionBarIncorrectEndSyntaxType:
+ "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionBarIncorrectStartSyntaxType:
+ "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ RecordExpressionHashIncorrectStartSyntaxType:
+ "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ RecordNoProto: "'__proto__' is not allowed in Record expressions.",
+ RestTrailingComma: 'Unexpected trailing comma after rest element.',
+ SloppyFunction:
+ 'In non-strict mode code, functions can only be declared at top level or inside a block.',
+ SloppyFunctionAnnexB:
+ 'In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.',
+ SourcePhaseImportRequiresDefault:
+ 'Only `import source x from "./module"` is valid.',
+ StaticPrototype:
+ 'Classes may not have static property named prototype.',
+ 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?",
+ SuperPrivateField: "Private fields can't be accessed on super.",
+ TrailingDecorator: 'Decorators must be attached to a class element.',
+ TupleExpressionBarIncorrectEndSyntaxType:
+ "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionBarIncorrectStartSyntaxType:
+ "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
+ TupleExpressionHashIncorrectStartSyntaxType:
+ "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
+ UnexpectedArgumentPlaceholder: 'Unexpected argument placeholder.',
+ UnexpectedAwaitAfterPipelineBody:
+ 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
+ UnexpectedDigitAfterHash: 'Unexpected digit after hash token.',
+ UnexpectedImportExport:
+ "'import' and 'export' may only appear at the top level.",
+ UnexpectedKeyword: ({ keyword: e }) => `Unexpected keyword '${e}'.`,
+ UnexpectedLeadingDecorator:
+ 'Leading decorators must be attached to a class declaration.',
+ UnexpectedLexicalDeclaration:
+ 'Lexical declaration cannot appear in a single-statement context.',
+ UnexpectedNewTarget:
+ '`new.target` can only be used in functions or class properties.',
+ UnexpectedNumericSeparator:
+ 'A numeric separator is only allowed between two digits.',
+ UnexpectedPrivateField: 'Unexpected private name.',
+ UnexpectedReservedWord: ({ reservedWord: e }) =>
+ `Unexpected reserved word '${e}'.`,
+ UnexpectedSuper:
+ "'super' is only allowed in object methods and classes.",
+ UnexpectedToken: ({ expected: e, unexpected: t }) =>
+ `Unexpected token${t ? ` '${t}'.` : ''}${
+ e ? `, expected "${e}"` : ''
+ }`,
+ UnexpectedTokenUnaryExponentiation:
+ 'Illegal expression. Wrap left hand side or entire exponentiation in parentheses.',
+ UnexpectedUsingDeclaration:
+ 'Using declaration cannot appear in the top level when source type is `script`.',
+ UnsupportedBind: 'Binding should be performed on object property.',
+ UnsupportedDecoratorExport:
+ 'A decorated export must export a class declaration.',
+ UnsupportedDefaultExport:
+ 'Only expressions, functions or classes are allowed as the `default` export.',
+ UnsupportedImport:
+ '`import` can only be used in `import()` or `import.meta`.',
+ UnsupportedMetaProperty: ({ target: e, onlyValidPropertyName: t }) =>
+ `The only valid meta property for ${e} is ${e}.${t}.`,
+ UnsupportedParameterDecorator:
+ 'Decorators cannot be used to decorate parameters.',
+ UnsupportedPropertyDecorator:
+ 'Decorators cannot be used to decorate object literal properties.',
+ UnsupportedSuper:
+ "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
+ UnterminatedComment: 'Unterminated comment.',
+ UnterminatedRegExp: 'Unterminated regular expression.',
+ UnterminatedString: 'Unterminated string constant.',
+ UnterminatedTemplate: 'Unterminated template.',
+ UsingDeclarationHasBindingPattern:
+ 'Using declaration cannot have destructuring patterns.',
+ VarRedeclaration: ({ identifierName: e }) =>
+ `Identifier '${e}' has already been declared.`,
+ YieldBindingIdentifier:
+ "Can not use 'yield' as identifier inside a generator.",
+ YieldInParameter:
+ 'Yield expression is not allowed in formal parameters.',
+ ZeroDigitNumericSeparator:
+ 'Numeric separator can not be used after leading 0.',
+ };
+ var a = {
+ StrictDelete: 'Deleting local variable in strict mode.',
+ StrictEvalArguments: ({ referenceName: e }) =>
+ `Assigning to '${e}' in strict mode.`,
+ StrictEvalArgumentsBinding: ({ bindingName: e }) =>
+ `Binding '${e}' in strict mode.`,
+ StrictFunction:
+ 'In strict mode code, functions can only be declared at top level or inside a block.',
+ StrictNumericEscape:
+ "The only valid numeric escape in strict mode is '\\0'.",
+ StrictOctalLiteral:
+ 'Legacy octal literals are not allowed in strict mode.',
+ StrictWith: "'with' in strict mode.",
+ };
+ const o = new Set([
+ 'ArrowFunctionExpression',
+ 'AssignmentExpression',
+ 'ConditionalExpression',
+ 'YieldExpression',
+ ]);
+ var l = {
+ PipeBodyIsTighter:
+ 'Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.',
+ PipeTopicRequiresHackPipes:
+ 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
+ PipeTopicUnbound:
+ 'Topic reference is unbound; it must be inside a pipe body.',
+ PipeTopicUnconfiguredToken: ({ token: e }) =>
+ `Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,
+ PipeTopicUnused:
+ 'Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.',
+ PipeUnparenthesizedBody: ({ type: e }) =>
+ `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription(
+ { type: e },
+ )}; please wrap it in parentheses.`,
+ PipelineBodyNoArrow:
+ 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
+ PipelineBodySequenceExpression:
+ 'Pipeline body may not be a comma-separated sequence expression.',
+ PipelineHeadSequenceExpression:
+ 'Pipeline head should not be a comma-separated sequence expression.',
+ PipelineTopicUnused:
+ 'Pipeline is in topic style but does not use topic reference.',
+ PrimaryTopicNotAllowed:
+ 'Topic reference was used in a lexical context without topic binding.',
+ PrimaryTopicRequiresSmartPipeline:
+ 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
+ };
+ const c = ['toMessage'],
+ p = ['message'];
+ function defineHidden(e, t, r) {
+ Object.defineProperty(e, t, {
+ enumerable: false,
+ configurable: true,
+ value: r,
+ });
+ }
+ function toParseErrorConstructor(e) {
+ let { toMessage: t } = e,
+ r = _objectWithoutPropertiesLoose(e, c);
+ return function constructor({ loc: e, details: s }) {
+ const i = new SyntaxError();
+ Object.assign(i, r, { loc: e, pos: e.index });
+ if ('missingPlugin' in s) {
+ Object.assign(i, { missingPlugin: s.missingPlugin });
+ }
+ defineHidden(i, 'clone', function clone(t = {}) {
+ var r;
+ const {
+ line: i,
+ column: n,
+ index: a,
+ } = (r = t.loc) != null ? r : e;
+ return constructor({
+ loc: new Position(i, n, a),
+ details: Object.assign({}, s, t.details),
+ });
+ });
+ defineHidden(i, 'details', s);
+ Object.defineProperty(i, 'message', {
+ configurable: true,
+ get() {
+ const r = `${t(s)} (${e.line}:${e.column})`;
+ this.message = r;
+ return r;
+ },
+ set(e) {
+ Object.defineProperty(this, 'message', {
+ value: e,
+ writable: true,
+ });
+ },
+ });
+ return i;
+ };
+ }
+ function ParseErrorEnum(e, t) {
+ if (Array.isArray(e)) {
+ return (t) => ParseErrorEnum(t, e[0]);
+ }
+ const r = {};
+ for (const s of Object.keys(e)) {
+ const i = e[s];
+ const n =
+ typeof i === 'string'
+ ? { message: () => i }
+ : typeof i === 'function'
+ ? { message: i }
+ : i,
+ { message: a } = n,
+ o = _objectWithoutPropertiesLoose(n, p);
+ const l = typeof a === 'string' ? () => a : a;
+ r[s] = toParseErrorConstructor(
+ Object.assign(
+ {
+ code: 'BABEL_PARSER_SYNTAX_ERROR',
+ reasonCode: s,
+ toMessage: l,
+ },
+ t ? { syntaxPlugin: t } : {},
+ o,
+ ),
+ );
+ }
+ return r;
+ }
+ const u = Object.assign(
+ {},
+ ParseErrorEnum(s),
+ ParseErrorEnum(n),
+ ParseErrorEnum(a),
+ ParseErrorEnum`pipelineOperator`(l),
+ );
+ const { defineProperty: d } = Object;
+ const toUnenumerable = (e, t) =>
+ d(e, t, { enumerable: false, value: e[t] });
+ function toESTreeLocation(e) {
+ e.loc.start && toUnenumerable(e.loc.start, 'index');
+ e.loc.end && toUnenumerable(e.loc.end, 'index');
+ return e;
+ }
+ var estree = (e) =>
+ class ESTreeParserMixin extends e {
+ parse() {
+ const e = toESTreeLocation(super.parse());
+ if (this.options.tokens) {
+ e.tokens = e.tokens.map(toESTreeLocation);
+ }
+ return e;
+ }
+ parseRegExpLiteral({ pattern: e, flags: t }) {
+ let r = null;
+ try {
+ r = new RegExp(e, t);
+ } catch (e) {}
+ const s = this.estreeParseLiteral(r);
+ s.regex = { pattern: e, flags: t };
+ return s;
+ }
+ parseBigIntLiteral(e) {
+ let t;
+ try {
+ t = BigInt(e);
+ } catch (e) {
+ t = null;
+ }
+ const r = this.estreeParseLiteral(t);
+ r.bigint = String(r.value || e);
+ return r;
+ }
+ parseDecimalLiteral(e) {
+ const t = null;
+ const r = this.estreeParseLiteral(t);
+ r.decimal = String(r.value || e);
+ return r;
+ }
+ estreeParseLiteral(e) {
+ return this.parseLiteral(e, 'Literal');
+ }
+ parseStringLiteral(e) {
+ return this.estreeParseLiteral(e);
+ }
+ parseNumericLiteral(e) {
+ return this.estreeParseLiteral(e);
+ }
+ parseNullLiteral() {
+ return this.estreeParseLiteral(null);
+ }
+ parseBooleanLiteral(e) {
+ return this.estreeParseLiteral(e);
+ }
+ directiveToStmt(e) {
+ const t = e.value;
+ delete e.value;
+ t.type = 'Literal';
+ t.raw = t.extra.raw;
+ t.value = t.extra.expressionValue;
+ const r = e;
+ r.type = 'ExpressionStatement';
+ r.expression = t;
+ r.directive = t.extra.rawValue;
+ delete t.extra;
+ return r;
+ }
+ initFunction(e, t) {
+ super.initFunction(e, t);
+ e.expression = false;
+ }
+ checkDeclaration(e) {
+ if (e != null && this.isObjectProperty(e)) {
+ this.checkDeclaration(e.value);
+ } else {
+ super.checkDeclaration(e);
+ }
+ }
+ getObjectOrClassMethodParams(e) {
+ return e.value.params;
+ }
+ isValidDirective(e) {
+ var t;
+ return (
+ e.type === 'ExpressionStatement' &&
+ e.expression.type === 'Literal' &&
+ typeof e.expression.value === 'string' &&
+ !((t = e.expression.extra) != null && t.parenthesized)
+ );
+ }
+ parseBlockBody(e, t, r, s, i) {
+ super.parseBlockBody(e, t, r, s, i);
+ const n = e.directives.map((e) => this.directiveToStmt(e));
+ e.body = n.concat(e.body);
+ delete e.directives;
+ }
+ pushClassMethod(e, t, r, s, i, n) {
+ this.parseMethod(t, r, s, i, n, 'ClassMethod', true);
+ if (t.typeParameters) {
+ t.value.typeParameters = t.typeParameters;
+ delete t.typeParameters;
+ }
+ e.body.push(t);
+ }
+ parsePrivateName() {
+ const e = super.parsePrivateName();
+ {
+ if (!this.getPluginOption('estree', 'classFeatures')) {
+ return e;
+ }
+ }
+ return this.convertPrivateNameToPrivateIdentifier(e);
+ }
+ convertPrivateNameToPrivateIdentifier(e) {
+ const t = super.getPrivateNameSV(e);
+ e = e;
+ delete e.id;
+ e.name = t;
+ e.type = 'PrivateIdentifier';
+ return e;
+ }
+ isPrivateName(e) {
+ {
+ if (!this.getPluginOption('estree', 'classFeatures')) {
+ return super.isPrivateName(e);
+ }
+ }
+ return e.type === 'PrivateIdentifier';
+ }
+ getPrivateNameSV(e) {
+ {
+ if (!this.getPluginOption('estree', 'classFeatures')) {
+ return super.getPrivateNameSV(e);
+ }
+ }
+ return e.name;
+ }
+ parseLiteral(e, t) {
+ const r = super.parseLiteral(e, t);
+ r.raw = r.extra.raw;
+ delete r.extra;
+ return r;
+ }
+ parseFunctionBody(e, t, r = false) {
+ super.parseFunctionBody(e, t, r);
+ e.expression = e.body.type !== 'BlockStatement';
+ }
+ parseMethod(e, t, r, s, i, n, a = false) {
+ let o = this.startNode();
+ o.kind = e.kind;
+ o = super.parseMethod(o, t, r, s, i, n, a);
+ o.type = 'FunctionExpression';
+ delete o.kind;
+ e.value = o;
+ if (n === 'ClassPrivateMethod') {
+ e.computed = false;
+ }
+ return this.finishNode(e, 'MethodDefinition');
+ }
+ parseClassProperty(...e) {
+ const t = super.parseClassProperty(...e);
+ {
+ if (!this.getPluginOption('estree', 'classFeatures')) {
+ return t;
+ }
+ }
+ t.type = 'PropertyDefinition';
+ return t;
+ }
+ parseClassPrivateProperty(...e) {
+ const t = super.parseClassPrivateProperty(...e);
+ {
+ if (!this.getPluginOption('estree', 'classFeatures')) {
+ return t;
+ }
+ }
+ t.type = 'PropertyDefinition';
+ t.computed = false;
+ return t;
+ }
+ parseObjectMethod(e, t, r, s, i) {
+ const n = super.parseObjectMethod(e, t, r, s, i);
+ if (n) {
+ n.type = 'Property';
+ if (n.kind === 'method') {
+ n.kind = 'init';
+ }
+ n.shorthand = false;
+ }
+ return n;
+ }
+ parseObjectProperty(e, t, r, s) {
+ const i = super.parseObjectProperty(e, t, r, s);
+ if (i) {
+ i.kind = 'init';
+ i.type = 'Property';
+ }
+ return i;
+ }
+ isValidLVal(e, t, r) {
+ return e === 'Property' ? 'value' : super.isValidLVal(e, t, r);
+ }
+ isAssignable(e, t) {
+ if (e != null && this.isObjectProperty(e)) {
+ return this.isAssignable(e.value, t);
+ }
+ return super.isAssignable(e, t);
+ }
+ toAssignable(e, t = false) {
+ if (e != null && this.isObjectProperty(e)) {
+ const { key: r, value: s } = e;
+ if (this.isPrivateName(r)) {
+ this.classScope.usePrivateName(
+ this.getPrivateNameSV(r),
+ r.loc.start,
+ );
+ }
+ this.toAssignable(s, t);
+ } else {
+ super.toAssignable(e, t);
+ }
+ }
+ toAssignableObjectExpressionProp(e, t, r) {
+ if (e.kind === 'get' || e.kind === 'set') {
+ this.raise(u.PatternHasAccessor, { at: e.key });
+ } else if (e.method) {
+ this.raise(u.PatternHasMethod, { at: e.key });
+ } else {
+ super.toAssignableObjectExpressionProp(e, t, r);
+ }
+ }
+ finishCallExpression(e, t) {
+ const r = super.finishCallExpression(e, t);
+ if (r.callee.type === 'Import') {
+ r.type = 'ImportExpression';
+ r.source = r.arguments[0];
+ if (
+ this.hasPlugin('importAttributes') ||
+ this.hasPlugin('importAssertions')
+ ) {
+ var s, i;
+ r.options = (s = r.arguments[1]) != null ? s : null;
+ r.attributes = (i = r.arguments[1]) != null ? i : null;
+ }
+ delete r.arguments;
+ delete r.callee;
+ }
+ return r;
+ }
+ toReferencedArguments(e) {
+ if (e.type === 'ImportExpression') {
+ return;
+ }
+ super.toReferencedArguments(e);
+ }
+ parseExport(e, t) {
+ const r = this.state.lastTokStartLoc;
+ const s = super.parseExport(e, t);
+ switch (s.type) {
+ case 'ExportAllDeclaration':
+ s.exported = null;
+ break;
+ case 'ExportNamedDeclaration':
+ if (
+ s.specifiers.length === 1 &&
+ s.specifiers[0].type === 'ExportNamespaceSpecifier'
+ ) {
+ s.type = 'ExportAllDeclaration';
+ s.exported = s.specifiers[0].exported;
+ delete s.specifiers;
+ }
+ case 'ExportDefaultDeclaration':
+ {
+ var i;
+ const { declaration: e } = s;
+ if (
+ (e == null ? void 0 : e.type) === 'ClassDeclaration' &&
+ ((i = e.decorators) == null ? void 0 : i.length) > 0 &&
+ e.start === s.start
+ ) {
+ this.resetStartLocation(s, r);
+ }
+ }
+ break;
+ }
+ return s;
+ }
+ parseSubscript(e, t, r, s) {
+ const i = super.parseSubscript(e, t, r, s);
+ if (s.optionalChainMember) {
+ if (
+ i.type === 'OptionalMemberExpression' ||
+ i.type === 'OptionalCallExpression'
+ ) {
+ i.type = i.type.substring(8);
+ }
+ if (s.stop) {
+ const e = this.startNodeAtNode(i);
+ e.expression = i;
+ return this.finishNode(e, 'ChainExpression');
+ }
+ } else if (
+ i.type === 'MemberExpression' ||
+ i.type === 'CallExpression'
+ ) {
+ i.optional = false;
+ }
+ return i;
+ }
+ isOptionalMemberExpression(e) {
+ if (e.type === 'ChainExpression') {
+ return e.expression.type === 'MemberExpression';
+ }
+ return super.isOptionalMemberExpression(e);
+ }
+ hasPropertyAsPrivateName(e) {
+ if (e.type === 'ChainExpression') {
+ e = e.expression;
+ }
+ return super.hasPropertyAsPrivateName(e);
+ }
+ isObjectProperty(e) {
+ return e.type === 'Property' && e.kind === 'init' && !e.method;
+ }
+ isObjectMethod(e) {
+ return e.method || e.kind === 'get' || e.kind === 'set';
+ }
+ finishNodeAt(e, t, r) {
+ return toESTreeLocation(super.finishNodeAt(e, t, r));
+ }
+ resetStartLocation(e, t) {
+ super.resetStartLocation(e, t);
+ toESTreeLocation(e);
+ }
+ resetEndLocation(e, t = this.state.lastTokEndLoc) {
+ super.resetEndLocation(e, t);
+ toESTreeLocation(e);
+ }
+ };
+ class TokContext {
+ constructor(e, t) {
+ this.token = void 0;
+ this.preserveSpace = void 0;
+ this.token = e;
+ this.preserveSpace = !!t;
+ }
+ }
+ const f = {
+ brace: new TokContext('{'),
+ j_oTag: new TokContext('...', true),
+ };
+ {
+ f.template = new TokContext('`', true);
+ }
+ const h = true;
+ const y = true;
+ const m = true;
+ const T = true;
+ const S = true;
+ const x = true;
+ class ExportedTokenType {
+ constructor(e, t = {}) {
+ this.label = void 0;
+ this.keyword = void 0;
+ this.beforeExpr = void 0;
+ this.startsExpr = void 0;
+ this.rightAssociative = void 0;
+ this.isLoop = void 0;
+ this.isAssign = void 0;
+ this.prefix = void 0;
+ this.postfix = void 0;
+ this.binop = void 0;
+ this.label = e;
+ this.keyword = t.keyword;
+ this.beforeExpr = !!t.beforeExpr;
+ this.startsExpr = !!t.startsExpr;
+ this.rightAssociative = !!t.rightAssociative;
+ this.isLoop = !!t.isLoop;
+ this.isAssign = !!t.isAssign;
+ this.prefix = !!t.prefix;
+ this.postfix = !!t.postfix;
+ this.binop = t.binop != null ? t.binop : null;
+ {
+ this.updateContext = null;
+ }
+ }
+ }
+ const b = new Map();
+ function createKeyword(e, t = {}) {
+ t.keyword = e;
+ const r = createToken(e, t);
+ b.set(e, r);
+ return r;
+ }
+ function createBinop(e, t) {
+ return createToken(e, { beforeExpr: h, binop: t });
+ }
+ let E = -1;
+ const P = [];
+ const g = [];
+ const A = [];
+ const v = [];
+ const I = [];
+ const w = [];
+ function createToken(e, t = {}) {
+ var r, s, i, n;
+ ++E;
+ g.push(e);
+ A.push((r = t.binop) != null ? r : -1);
+ v.push((s = t.beforeExpr) != null ? s : false);
+ I.push((i = t.startsExpr) != null ? i : false);
+ w.push((n = t.prefix) != null ? n : false);
+ P.push(new ExportedTokenType(e, t));
+ return E;
+ }
+ function createKeywordLike(e, t = {}) {
+ var r, s, i, n;
+ ++E;
+ b.set(e, E);
+ g.push(e);
+ A.push((r = t.binop) != null ? r : -1);
+ v.push((s = t.beforeExpr) != null ? s : false);
+ I.push((i = t.startsExpr) != null ? i : false);
+ w.push((n = t.prefix) != null ? n : false);
+ P.push(new ExportedTokenType('name', t));
+ return E;
+ }
+ const N = {
+ bracketL: createToken('[', { beforeExpr: h, startsExpr: y }),
+ bracketHashL: createToken('#[', { beforeExpr: h, startsExpr: y }),
+ bracketBarL: createToken('[|', { beforeExpr: h, startsExpr: y }),
+ bracketR: createToken(']'),
+ bracketBarR: createToken('|]'),
+ braceL: createToken('{', { beforeExpr: h, startsExpr: y }),
+ braceBarL: createToken('{|', { beforeExpr: h, startsExpr: y }),
+ braceHashL: createToken('#{', { beforeExpr: h, startsExpr: y }),
+ braceR: createToken('}'),
+ braceBarR: createToken('|}'),
+ parenL: createToken('(', { beforeExpr: h, startsExpr: y }),
+ parenR: createToken(')'),
+ comma: createToken(',', { beforeExpr: h }),
+ semi: createToken(';', { beforeExpr: h }),
+ colon: createToken(':', { beforeExpr: h }),
+ doubleColon: createToken('::', { beforeExpr: h }),
+ dot: createToken('.'),
+ question: createToken('?', { beforeExpr: h }),
+ questionDot: createToken('?.'),
+ arrow: createToken('=>', { beforeExpr: h }),
+ template: createToken('template'),
+ ellipsis: createToken('...', { beforeExpr: h }),
+ backQuote: createToken('`', { startsExpr: y }),
+ dollarBraceL: createToken('${', { beforeExpr: h, startsExpr: y }),
+ templateTail: createToken('...`', { startsExpr: y }),
+ templateNonTail: createToken('...${', { beforeExpr: h, startsExpr: y }),
+ at: createToken('@'),
+ hash: createToken('#', { startsExpr: y }),
+ interpreterDirective: createToken('#!...'),
+ eq: createToken('=', { beforeExpr: h, isAssign: T }),
+ assign: createToken('_=', { beforeExpr: h, isAssign: T }),
+ slashAssign: createToken('_=', { beforeExpr: h, isAssign: T }),
+ xorAssign: createToken('_=', { beforeExpr: h, isAssign: T }),
+ moduloAssign: createToken('_=', { beforeExpr: h, isAssign: T }),
+ incDec: createToken('++/--', { prefix: S, postfix: x, startsExpr: y }),
+ bang: createToken('!', { beforeExpr: h, prefix: S, startsExpr: y }),
+ tilde: createToken('~', { beforeExpr: h, prefix: S, startsExpr: y }),
+ doubleCaret: createToken('^^', { startsExpr: y }),
+ doubleAt: createToken('@@', { startsExpr: y }),
+ pipeline: createBinop('|>', 0),
+ nullishCoalescing: createBinop('??', 1),
+ logicalOR: createBinop('||', 1),
+ logicalAND: createBinop('&&', 2),
+ bitwiseOR: createBinop('|', 3),
+ bitwiseXOR: createBinop('^', 4),
+ bitwiseAND: createBinop('&', 5),
+ equality: createBinop('==/!=/===/!==', 6),
+ lt: createBinop('>/<=/>=', 7),
+ gt: createBinop('>/<=/>=', 7),
+ relational: createBinop('>/<=/>=', 7),
+ bitShift: createBinop('<>>/>>>', 8),
+ bitShiftL: createBinop('<>>/>>>', 8),
+ bitShiftR: createBinop('<>>/>>>', 8),
+ plusMin: createToken('+/-', {
+ beforeExpr: h,
+ binop: 9,
+ prefix: S,
+ startsExpr: y,
+ }),
+ modulo: createToken('%', { binop: 10, startsExpr: y }),
+ star: createToken('*', { binop: 10 }),
+ slash: createBinop('/', 10),
+ exponent: createToken('**', {
+ beforeExpr: h,
+ binop: 11,
+ rightAssociative: true,
+ }),
+ _in: createKeyword('in', { beforeExpr: h, binop: 7 }),
+ _instanceof: createKeyword('instanceof', { beforeExpr: h, binop: 7 }),
+ _break: createKeyword('break'),
+ _case: createKeyword('case', { beforeExpr: h }),
+ _catch: createKeyword('catch'),
+ _continue: createKeyword('continue'),
+ _debugger: createKeyword('debugger'),
+ _default: createKeyword('default', { beforeExpr: h }),
+ _else: createKeyword('else', { beforeExpr: h }),
+ _finally: createKeyword('finally'),
+ _function: createKeyword('function', { startsExpr: y }),
+ _if: createKeyword('if'),
+ _return: createKeyword('return', { beforeExpr: h }),
+ _switch: createKeyword('switch'),
+ _throw: createKeyword('throw', {
+ beforeExpr: h,
+ prefix: S,
+ startsExpr: y,
+ }),
+ _try: createKeyword('try'),
+ _var: createKeyword('var'),
+ _const: createKeyword('const'),
+ _with: createKeyword('with'),
+ _new: createKeyword('new', { beforeExpr: h, startsExpr: y }),
+ _this: createKeyword('this', { startsExpr: y }),
+ _super: createKeyword('super', { startsExpr: y }),
+ _class: createKeyword('class', { startsExpr: y }),
+ _extends: createKeyword('extends', { beforeExpr: h }),
+ _export: createKeyword('export'),
+ _import: createKeyword('import', { startsExpr: y }),
+ _null: createKeyword('null', { startsExpr: y }),
+ _true: createKeyword('true', { startsExpr: y }),
+ _false: createKeyword('false', { startsExpr: y }),
+ _typeof: createKeyword('typeof', {
+ beforeExpr: h,
+ prefix: S,
+ startsExpr: y,
+ }),
+ _void: createKeyword('void', {
+ beforeExpr: h,
+ prefix: S,
+ startsExpr: y,
+ }),
+ _delete: createKeyword('delete', {
+ beforeExpr: h,
+ prefix: S,
+ startsExpr: y,
+ }),
+ _do: createKeyword('do', { isLoop: m, beforeExpr: h }),
+ _for: createKeyword('for', { isLoop: m }),
+ _while: createKeyword('while', { isLoop: m }),
+ _as: createKeywordLike('as', { startsExpr: y }),
+ _assert: createKeywordLike('assert', { startsExpr: y }),
+ _async: createKeywordLike('async', { startsExpr: y }),
+ _await: createKeywordLike('await', { startsExpr: y }),
+ _defer: createKeywordLike('defer', { startsExpr: y }),
+ _from: createKeywordLike('from', { startsExpr: y }),
+ _get: createKeywordLike('get', { startsExpr: y }),
+ _let: createKeywordLike('let', { startsExpr: y }),
+ _meta: createKeywordLike('meta', { startsExpr: y }),
+ _of: createKeywordLike('of', { startsExpr: y }),
+ _sent: createKeywordLike('sent', { startsExpr: y }),
+ _set: createKeywordLike('set', { startsExpr: y }),
+ _source: createKeywordLike('source', { startsExpr: y }),
+ _static: createKeywordLike('static', { startsExpr: y }),
+ _using: createKeywordLike('using', { startsExpr: y }),
+ _yield: createKeywordLike('yield', { startsExpr: y }),
+ _asserts: createKeywordLike('asserts', { startsExpr: y }),
+ _checks: createKeywordLike('checks', { startsExpr: y }),
+ _exports: createKeywordLike('exports', { startsExpr: y }),
+ _global: createKeywordLike('global', { startsExpr: y }),
+ _implements: createKeywordLike('implements', { startsExpr: y }),
+ _intrinsic: createKeywordLike('intrinsic', { startsExpr: y }),
+ _infer: createKeywordLike('infer', { startsExpr: y }),
+ _is: createKeywordLike('is', { startsExpr: y }),
+ _mixins: createKeywordLike('mixins', { startsExpr: y }),
+ _proto: createKeywordLike('proto', { startsExpr: y }),
+ _require: createKeywordLike('require', { startsExpr: y }),
+ _satisfies: createKeywordLike('satisfies', { startsExpr: y }),
+ _keyof: createKeywordLike('keyof', { startsExpr: y }),
+ _readonly: createKeywordLike('readonly', { startsExpr: y }),
+ _unique: createKeywordLike('unique', { startsExpr: y }),
+ _abstract: createKeywordLike('abstract', { startsExpr: y }),
+ _declare: createKeywordLike('declare', { startsExpr: y }),
+ _enum: createKeywordLike('enum', { startsExpr: y }),
+ _module: createKeywordLike('module', { startsExpr: y }),
+ _namespace: createKeywordLike('namespace', { startsExpr: y }),
+ _interface: createKeywordLike('interface', { startsExpr: y }),
+ _type: createKeywordLike('type', { startsExpr: y }),
+ _opaque: createKeywordLike('opaque', { startsExpr: y }),
+ name: createToken('name', { startsExpr: y }),
+ string: createToken('string', { startsExpr: y }),
+ num: createToken('num', { startsExpr: y }),
+ bigint: createToken('bigint', { startsExpr: y }),
+ decimal: createToken('decimal', { startsExpr: y }),
+ regexp: createToken('regexp', { startsExpr: y }),
+ privateName: createToken('#name', { startsExpr: y }),
+ eof: createToken('eof'),
+ jsxName: createToken('jsxName'),
+ jsxText: createToken('jsxText', { beforeExpr: true }),
+ jsxTagStart: createToken('jsxTagStart', { startsExpr: true }),
+ jsxTagEnd: createToken('jsxTagEnd'),
+ placeholder: createToken('%%', { startsExpr: true }),
+ };
+ function tokenIsIdentifier(e) {
+ return e >= 93 && e <= 132;
+ }
+ function tokenKeywordOrIdentifierIsKeyword(e) {
+ return e <= 92;
+ }
+ function tokenIsKeywordOrIdentifier(e) {
+ return e >= 58 && e <= 132;
+ }
+ function tokenIsLiteralPropertyName(e) {
+ return e >= 58 && e <= 136;
+ }
+ function tokenComesBeforeExpression(e) {
+ return v[e];
+ }
+ function tokenCanStartExpression(e) {
+ return I[e];
+ }
+ function tokenIsAssignment(e) {
+ return e >= 29 && e <= 33;
+ }
+ function tokenIsFlowInterfaceOrTypeOrOpaque(e) {
+ return e >= 129 && e <= 131;
+ }
+ function tokenIsLoop(e) {
+ return e >= 90 && e <= 92;
+ }
+ function tokenIsKeyword(e) {
+ return e >= 58 && e <= 92;
+ }
+ function tokenIsOperator(e) {
+ return e >= 39 && e <= 59;
+ }
+ function tokenIsPostfix(e) {
+ return e === 34;
+ }
+ function tokenIsPrefix(e) {
+ return w[e];
+ }
+ function tokenIsTSTypeOperator(e) {
+ return e >= 121 && e <= 123;
+ }
+ function tokenIsTSDeclarationStart(e) {
+ return e >= 124 && e <= 130;
+ }
+ function tokenLabelName(e) {
+ return g[e];
+ }
+ function tokenOperatorPrecedence(e) {
+ return A[e];
+ }
+ function tokenIsRightAssociative(e) {
+ return e === 57;
+ }
+ function tokenIsTemplate(e) {
+ return e >= 24 && e <= 25;
+ }
+ function getExportedToken(e) {
+ return P[e];
+ }
+ {
+ P[8].updateContext = (e) => {
+ e.pop();
+ };
+ P[5].updateContext =
+ P[7].updateContext =
+ P[23].updateContext =
+ (e) => {
+ e.push(f.brace);
+ };
+ P[22].updateContext = (e) => {
+ if (e[e.length - 1] === f.template) {
+ e.pop();
+ } else {
+ e.push(f.template);
+ }
+ };
+ P[142].updateContext = (e) => {
+ e.push(f.j_expr, f.j_oTag);
+ };
+ }
+ let O =
+ 'ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ';
+ let C =
+ '·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・';
+ const D = new RegExp('[' + O + ']');
+ const k = new RegExp('[' + O + C + ']');
+ O = C = null;
+ const L = [
+ 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, 16, 621,
+ 2467, 541, 1507, 4938, 6, 4191,
+ ];
+ const M = [
+ 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,
+ ];
+ function isInAstralSet(e, t) {
+ let r = 65536;
+ for (let s = 0, i = t.length; s < i; s += 2) {
+ r += t[s];
+ if (r > e) return false;
+ r += t[s + 1];
+ if (r >= e) return true;
+ }
+ return false;
+ }
+ function isIdentifierStart(e) {
+ if (e < 65) return e === 36;
+ if (e <= 90) return true;
+ if (e < 97) return e === 95;
+ if (e <= 122) return true;
+ if (e <= 65535) {
+ return e >= 170 && D.test(String.fromCharCode(e));
+ }
+ return isInAstralSet(e, L);
+ }
+ function isIdentifierChar(e) {
+ if (e < 48) return e === 36;
+ if (e < 58) return true;
+ if (e < 65) return false;
+ if (e <= 90) return true;
+ if (e < 97) return e === 95;
+ if (e <= 122) return true;
+ if (e <= 65535) {
+ return e >= 170 && k.test(String.fromCharCode(e));
+ }
+ return isInAstralSet(e, L) || isInAstralSet(e, M);
+ }
+ const j = {
+ 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',
+ ],
+ strict: [
+ 'implements',
+ 'interface',
+ 'let',
+ 'package',
+ 'private',
+ 'protected',
+ 'public',
+ 'static',
+ 'yield',
+ ],
+ strictBind: ['eval', 'arguments'],
+ };
+ const B = new Set(j.keyword);
+ const F = new Set(j.strict);
+ const _ = new Set(j.strictBind);
+ function isReservedWord(e, t) {
+ return (t && e === 'await') || e === 'enum';
+ }
+ function isStrictReservedWord(e, t) {
+ return isReservedWord(e, t) || F.has(e);
+ }
+ function isStrictBindOnlyReservedWord(e) {
+ return _.has(e);
+ }
+ function isStrictBindReservedWord(e, t) {
+ return isStrictReservedWord(e, t) || isStrictBindOnlyReservedWord(e);
+ }
+ function isKeyword(e) {
+ return B.has(e);
+ }
+ function isIteratorStart(e, t, r) {
+ return e === 64 && t === 64 && isIdentifierStart(r);
+ }
+ const R = 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',
+ 'implements',
+ 'interface',
+ 'let',
+ 'package',
+ 'private',
+ 'protected',
+ 'public',
+ 'static',
+ 'yield',
+ 'eval',
+ 'arguments',
+ 'enum',
+ 'await',
+ ]);
+ function canBeReservedWord(e) {
+ return R.has(e);
+ }
+ class Scope {
+ constructor(e) {
+ this.var = new Set();
+ this.lexical = new Set();
+ this.functions = new Set();
+ this.flags = e;
+ }
+ }
+ class ScopeHandler {
+ constructor(e, t) {
+ this.parser = void 0;
+ this.scopeStack = [];
+ this.inModule = void 0;
+ this.undefinedExports = new Map();
+ this.parser = e;
+ this.inModule = t;
+ }
+ get inTopLevel() {
+ return (this.currentScope().flags & 1) > 0;
+ }
+ get inFunction() {
+ return (this.currentVarScopeFlags() & 2) > 0;
+ }
+ get allowSuper() {
+ return (this.currentThisScopeFlags() & 16) > 0;
+ }
+ get allowDirectSuper() {
+ return (this.currentThisScopeFlags() & 32) > 0;
+ }
+ get inClass() {
+ return (this.currentThisScopeFlags() & 64) > 0;
+ }
+ get inClassAndNotInNonArrowFunction() {
+ const e = this.currentThisScopeFlags();
+ return (e & 64) > 0 && (e & 2) === 0;
+ }
+ get inStaticBlock() {
+ for (let e = this.scopeStack.length - 1; ; e--) {
+ const { flags: t } = this.scopeStack[e];
+ if (t & 128) {
+ return true;
+ }
+ if (t & (387 | 64)) {
+ return false;
+ }
+ }
+ }
+ get inNonArrowFunction() {
+ return (this.currentThisScopeFlags() & 2) > 0;
+ }
+ get treatFunctionsAsVar() {
+ return this.treatFunctionsAsVarInScope(this.currentScope());
+ }
+ createScope(e) {
+ return new Scope(e);
+ }
+ enter(e) {
+ this.scopeStack.push(this.createScope(e));
+ }
+ exit() {
+ const e = this.scopeStack.pop();
+ return e.flags;
+ }
+ treatFunctionsAsVarInScope(e) {
+ return !!(
+ e.flags & (2 | 128) ||
+ (!this.parser.inModule && e.flags & 1)
+ );
+ }
+ declareName(e, t, r) {
+ let s = this.currentScope();
+ if (t & 8 || t & 16) {
+ this.checkRedeclarationInScope(s, e, t, r);
+ if (t & 16) {
+ s.functions.add(e);
+ } else {
+ s.lexical.add(e);
+ }
+ if (t & 8) {
+ this.maybeExportDefined(s, e);
+ }
+ } else if (t & 4) {
+ for (let i = this.scopeStack.length - 1; i >= 0; --i) {
+ s = this.scopeStack[i];
+ this.checkRedeclarationInScope(s, e, t, r);
+ s.var.add(e);
+ this.maybeExportDefined(s, e);
+ if (s.flags & 387) break;
+ }
+ }
+ if (this.parser.inModule && s.flags & 1) {
+ this.undefinedExports.delete(e);
+ }
+ }
+ maybeExportDefined(e, t) {
+ if (this.parser.inModule && e.flags & 1) {
+ this.undefinedExports.delete(t);
+ }
+ }
+ checkRedeclarationInScope(e, t, r, s) {
+ if (this.isRedeclaredInScope(e, t, r)) {
+ this.parser.raise(u.VarRedeclaration, { at: s, identifierName: t });
+ }
+ }
+ isRedeclaredInScope(e, t, r) {
+ if (!(r & 1)) return false;
+ if (r & 8) {
+ return e.lexical.has(t) || e.functions.has(t) || e.var.has(t);
+ }
+ if (r & 16) {
+ return (
+ e.lexical.has(t) ||
+ (!this.treatFunctionsAsVarInScope(e) && e.var.has(t))
+ );
+ }
+ return (
+ (e.lexical.has(t) &&
+ !(e.flags & 8 && e.lexical.values().next().value === t)) ||
+ (!this.treatFunctionsAsVarInScope(e) && e.functions.has(t))
+ );
+ }
+ checkLocalExport(e) {
+ const { name: t } = e;
+ const r = this.scopeStack[0];
+ if (!r.lexical.has(t) && !r.var.has(t) && !r.functions.has(t)) {
+ this.undefinedExports.set(t, e.loc.start);
+ }
+ }
+ currentScope() {
+ return this.scopeStack[this.scopeStack.length - 1];
+ }
+ currentVarScopeFlags() {
+ for (let e = this.scopeStack.length - 1; ; e--) {
+ const { flags: t } = this.scopeStack[e];
+ if (t & 387) {
+ return t;
+ }
+ }
+ }
+ currentThisScopeFlags() {
+ for (let e = this.scopeStack.length - 1; ; e--) {
+ const { flags: t } = this.scopeStack[e];
+ if (t & (387 | 64) && !(t & 4)) {
+ return t;
+ }
+ }
+ }
+ }
+ class FlowScope extends Scope {
+ constructor(...e) {
+ super(...e);
+ this.declareFunctions = new Set();
+ }
+ }
+ class FlowScopeHandler extends ScopeHandler {
+ createScope(e) {
+ return new FlowScope(e);
+ }
+ declareName(e, t, r) {
+ const s = this.currentScope();
+ if (t & 2048) {
+ this.checkRedeclarationInScope(s, e, t, r);
+ this.maybeExportDefined(s, e);
+ s.declareFunctions.add(e);
+ return;
+ }
+ super.declareName(e, t, r);
+ }
+ isRedeclaredInScope(e, t, r) {
+ if (super.isRedeclaredInScope(e, t, r)) return true;
+ if (r & 2048) {
+ return (
+ !e.declareFunctions.has(t) &&
+ (e.lexical.has(t) || e.functions.has(t))
+ );
+ }
+ return false;
+ }
+ checkLocalExport(e) {
+ if (!this.scopeStack[0].declareFunctions.has(e.name)) {
+ super.checkLocalExport(e);
+ }
+ }
+ }
+ class BaseParser {
+ constructor() {
+ this.sawUnambiguousESM = false;
+ this.ambiguousScriptDifferentAst = false;
+ }
+ hasPlugin(e) {
+ if (typeof e === 'string') {
+ return this.plugins.has(e);
+ } else {
+ const [t, r] = e;
+ if (!this.hasPlugin(t)) {
+ return false;
+ }
+ const s = this.plugins.get(t);
+ for (const e of Object.keys(r)) {
+ if ((s == null ? void 0 : s[e]) !== r[e]) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ getPluginOption(e, t) {
+ var r;
+ return (r = this.plugins.get(e)) == null ? void 0 : r[t];
+ }
+ }
+ function setTrailingComments(e, t) {
+ if (e.trailingComments === undefined) {
+ e.trailingComments = t;
+ } else {
+ e.trailingComments.unshift(...t);
+ }
+ }
+ function setLeadingComments(e, t) {
+ if (e.leadingComments === undefined) {
+ e.leadingComments = t;
+ } else {
+ e.leadingComments.unshift(...t);
+ }
+ }
+ function setInnerComments(e, t) {
+ if (e.innerComments === undefined) {
+ e.innerComments = t;
+ } else {
+ e.innerComments.unshift(...t);
+ }
+ }
+ function adjustInnerComments(e, t, r) {
+ let s = null;
+ let i = t.length;
+ while (s === null && i > 0) {
+ s = t[--i];
+ }
+ if (s === null || s.start > r.start) {
+ setInnerComments(e, r.comments);
+ } else {
+ setTrailingComments(s, r.comments);
+ }
+ }
+ class CommentsParser extends BaseParser {
+ addComment(e) {
+ if (this.filename) e.loc.filename = this.filename;
+ this.state.comments.push(e);
+ }
+ processComment(e) {
+ const { commentStack: t } = this.state;
+ const r = t.length;
+ if (r === 0) return;
+ let s = r - 1;
+ const i = t[s];
+ if (i.start === e.end) {
+ i.leadingNode = e;
+ s--;
+ }
+ const { start: n } = e;
+ for (; s >= 0; s--) {
+ const r = t[s];
+ const i = r.end;
+ if (i > n) {
+ r.containingNode = e;
+ this.finalizeComment(r);
+ t.splice(s, 1);
+ } else {
+ if (i === n) {
+ r.trailingNode = e;
+ }
+ break;
+ }
+ }
+ }
+ finalizeComment(e) {
+ const { comments: t } = e;
+ if (e.leadingNode !== null || e.trailingNode !== null) {
+ if (e.leadingNode !== null) {
+ setTrailingComments(e.leadingNode, t);
+ }
+ if (e.trailingNode !== null) {
+ setLeadingComments(e.trailingNode, t);
+ }
+ } else {
+ const { containingNode: r, start: s } = e;
+ if (this.input.charCodeAt(s - 1) === 44) {
+ switch (r.type) {
+ case 'ObjectExpression':
+ case 'ObjectPattern':
+ case 'RecordExpression':
+ adjustInnerComments(r, r.properties, e);
+ break;
+ case 'CallExpression':
+ case 'OptionalCallExpression':
+ adjustInnerComments(r, r.arguments, e);
+ break;
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'ArrowFunctionExpression':
+ case 'ObjectMethod':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ adjustInnerComments(r, r.params, e);
+ break;
+ case 'ArrayExpression':
+ case 'ArrayPattern':
+ case 'TupleExpression':
+ adjustInnerComments(r, r.elements, e);
+ break;
+ case 'ExportNamedDeclaration':
+ case 'ImportDeclaration':
+ adjustInnerComments(r, r.specifiers, e);
+ break;
+ default: {
+ setInnerComments(r, t);
+ }
+ }
+ } else {
+ setInnerComments(r, t);
+ }
+ }
+ }
+ finalizeRemainingComments() {
+ const { commentStack: e } = this.state;
+ for (let t = e.length - 1; t >= 0; t--) {
+ this.finalizeComment(e[t]);
+ }
+ this.state.commentStack = [];
+ }
+ resetPreviousNodeTrailingComments(e) {
+ const { commentStack: t } = this.state;
+ const { length: r } = t;
+ if (r === 0) return;
+ const s = t[r - 1];
+ if (s.leadingNode === e) {
+ s.leadingNode = null;
+ }
+ }
+ resetPreviousIdentifierLeadingComments(e) {
+ const { commentStack: t } = this.state;
+ const { length: r } = t;
+ if (r === 0) return;
+ if (t[r - 1].trailingNode === e) {
+ t[r - 1].trailingNode = null;
+ } else if (r >= 2 && t[r - 2].trailingNode === e) {
+ t[r - 2].trailingNode = null;
+ }
+ }
+ takeSurroundingComments(e, t, r) {
+ const { commentStack: s } = this.state;
+ const i = s.length;
+ if (i === 0) return;
+ let n = i - 1;
+ for (; n >= 0; n--) {
+ const i = s[n];
+ const a = i.end;
+ const o = i.start;
+ if (o === r) {
+ i.leadingNode = e;
+ } else if (a === t) {
+ i.trailingNode = e;
+ } else if (a < t) {
+ break;
+ }
+ }
+ }
+ }
+ const K = /\r\n?|[\n\u2028\u2029]/;
+ const U = new RegExp(K.source, 'g');
+ function isNewLine(e) {
+ switch (e) {
+ case 10:
+ case 13:
+ case 8232:
+ case 8233:
+ return true;
+ default:
+ return false;
+ }
+ }
+ const V = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+ const X = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;
+ const J = new RegExp(
+ '(?=(' +
+ X.source +
+ '))\\1' +
+ /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,
+ 'y',
+ );
+ function isWhitespace(e) {
+ switch (e) {
+ case 9:
+ case 11:
+ case 12:
+ case 32:
+ case 160:
+ case 5760:
+ case 8192:
+ case 8193:
+ case 8194:
+ case 8195:
+ case 8196:
+ case 8197:
+ case 8198:
+ case 8199:
+ case 8200:
+ case 8201:
+ case 8202:
+ case 8239:
+ case 8287:
+ case 12288:
+ case 65279:
+ return true;
+ default:
+ return false;
+ }
+ }
+ class State {
+ constructor() {
+ this.strict = void 0;
+ this.curLine = void 0;
+ this.lineStart = void 0;
+ this.startLoc = void 0;
+ this.endLoc = void 0;
+ this.errors = [];
+ this.potentialArrowAt = -1;
+ this.noArrowAt = [];
+ this.noArrowParamsConversionAt = [];
+ this.maybeInArrowParameters = false;
+ this.inType = false;
+ this.noAnonFunctionType = false;
+ this.hasFlowComment = false;
+ this.isAmbientContext = false;
+ this.inAbstractClass = false;
+ this.inDisallowConditionalTypesContext = false;
+ this.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null,
+ };
+ this.soloAwait = false;
+ this.inFSharpPipelineDirectBody = false;
+ this.labels = [];
+ this.comments = [];
+ this.commentStack = [];
+ this.pos = 0;
+ this.type = 139;
+ this.value = null;
+ this.start = 0;
+ this.end = 0;
+ this.lastTokEndLoc = null;
+ this.lastTokStartLoc = null;
+ this.lastTokStart = 0;
+ this.context = [f.brace];
+ this.canStartJSXElement = true;
+ this.containsEsc = false;
+ this.firstInvalidTemplateEscapePos = null;
+ this.strictErrors = new Map();
+ this.tokensLength = 0;
+ }
+ init({ strictMode: e, sourceType: t, startLine: r, startColumn: s }) {
+ this.strict =
+ e === false ? false : e === true ? true : t === 'module';
+ this.curLine = r;
+ this.lineStart = -s;
+ this.startLoc = this.endLoc = new Position(r, s, 0);
+ }
+ curPosition() {
+ return new Position(
+ this.curLine,
+ this.pos - this.lineStart,
+ this.pos,
+ );
+ }
+ clone(e) {
+ const t = new State();
+ const r = Object.keys(this);
+ for (let s = 0, i = r.length; s < i; s++) {
+ const i = r[s];
+ let n = this[i];
+ if (!e && Array.isArray(n)) {
+ n = n.slice();
+ }
+ t[i] = n;
+ }
+ return t;
+ }
+ }
+ var Y = function isDigit(e) {
+ return e >= 48 && e <= 57;
+ };
+ const W = {
+ decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
+ hex: new Set([46, 88, 95, 120]),
+ };
+ const q = {
+ bin: (e) => e === 48 || e === 49,
+ oct: (e) => e >= 48 && e <= 55,
+ dec: (e) => e >= 48 && e <= 57,
+ hex: (e) =>
+ (e >= 48 && e <= 57) || (e >= 65 && e <= 70) || (e >= 97 && e <= 102),
+ };
+ function readStringContents(e, t, r, s, i, n) {
+ const a = r;
+ const o = s;
+ const l = i;
+ let c = '';
+ let p = null;
+ let u = r;
+ const { length: d } = t;
+ for (;;) {
+ if (r >= d) {
+ n.unterminated(a, o, l);
+ c += t.slice(u, r);
+ break;
+ }
+ const f = t.charCodeAt(r);
+ if (isStringEnd(e, f, t, r)) {
+ c += t.slice(u, r);
+ break;
+ }
+ if (f === 92) {
+ c += t.slice(u, r);
+ const a = readEscapedChar(t, r, s, i, e === 'template', n);
+ if (a.ch === null && !p) {
+ p = { pos: r, lineStart: s, curLine: i };
+ } else {
+ c += a.ch;
+ }
+ ({ pos: r, lineStart: s, curLine: i } = a);
+ u = r;
+ } else if (f === 8232 || f === 8233) {
+ ++r;
+ ++i;
+ s = r;
+ } else if (f === 10 || f === 13) {
+ if (e === 'template') {
+ c += t.slice(u, r) + '\n';
+ ++r;
+ if (f === 13 && t.charCodeAt(r) === 10) {
+ ++r;
+ }
+ ++i;
+ u = s = r;
+ } else {
+ n.unterminated(a, o, l);
+ }
+ } else {
+ ++r;
+ }
+ }
+ return {
+ pos: r,
+ str: c,
+ firstInvalidLoc: p,
+ lineStart: s,
+ curLine: i,
+ containsInvalid: !!p,
+ };
+ }
+ function isStringEnd(e, t, r, s) {
+ if (e === 'template') {
+ return t === 96 || (t === 36 && r.charCodeAt(s + 1) === 123);
+ }
+ return t === (e === 'double' ? 34 : 39);
+ }
+ function readEscapedChar(e, t, r, s, i, n) {
+ const a = !i;
+ t++;
+ const res = (e) => ({ pos: t, ch: e, lineStart: r, curLine: s });
+ const o = e.charCodeAt(t++);
+ switch (o) {
+ case 110:
+ return res('\n');
+ case 114:
+ return res('\r');
+ case 120: {
+ let i;
+ ({ code: i, pos: t } = readHexChar(e, t, r, s, 2, false, a, n));
+ return res(i === null ? null : String.fromCharCode(i));
+ }
+ case 117: {
+ let i;
+ ({ code: i, pos: t } = readCodePoint(e, t, r, s, a, n));
+ return res(i === null ? null : String.fromCodePoint(i));
+ }
+ case 116:
+ return res('\t');
+ case 98:
+ return res('\b');
+ case 118:
+ return res('\v');
+ case 102:
+ return res('\f');
+ case 13:
+ if (e.charCodeAt(t) === 10) {
+ ++t;
+ }
+ case 10:
+ r = t;
+ ++s;
+ case 8232:
+ case 8233:
+ return res('');
+ case 56:
+ case 57:
+ if (i) {
+ return res(null);
+ } else {
+ n.strictNumericEscape(t - 1, r, s);
+ }
+ default:
+ if (o >= 48 && o <= 55) {
+ const a = t - 1;
+ const o = e.slice(a, t + 2).match(/^[0-7]+/);
+ let l = o[0];
+ let c = parseInt(l, 8);
+ if (c > 255) {
+ l = l.slice(0, -1);
+ c = parseInt(l, 8);
+ }
+ t += l.length - 1;
+ const p = e.charCodeAt(t);
+ if (l !== '0' || p === 56 || p === 57) {
+ if (i) {
+ return res(null);
+ } else {
+ n.strictNumericEscape(a, r, s);
+ }
+ }
+ return res(String.fromCharCode(c));
+ }
+ return res(String.fromCharCode(o));
+ }
+ }
+ function readHexChar(e, t, r, s, i, n, a, o) {
+ const l = t;
+ let c;
+ ({ n: c, pos: t } = readInt(e, t, r, s, 16, i, n, false, o, !a));
+ if (c === null) {
+ if (a) {
+ o.invalidEscapeSequence(l, r, s);
+ } else {
+ t = l - 1;
+ }
+ }
+ return { code: c, pos: t };
+ }
+ function readInt(e, t, r, s, i, n, a, o, l, c) {
+ const p = t;
+ const u = i === 16 ? W.hex : W.decBinOct;
+ const d = i === 16 ? q.hex : i === 10 ? q.dec : i === 8 ? q.oct : q.bin;
+ let f = false;
+ let h = 0;
+ for (let p = 0, y = n == null ? Infinity : n; p < y; ++p) {
+ const n = e.charCodeAt(t);
+ let p;
+ if (n === 95 && o !== 'bail') {
+ const i = e.charCodeAt(t - 1);
+ const n = e.charCodeAt(t + 1);
+ if (!o) {
+ if (c) return { n: null, pos: t };
+ l.numericSeparatorInEscapeSequence(t, r, s);
+ } else if (Number.isNaN(n) || !d(n) || u.has(i) || u.has(n)) {
+ if (c) return { n: null, pos: t };
+ l.unexpectedNumericSeparator(t, r, s);
+ }
+ ++t;
+ continue;
+ }
+ if (n >= 97) {
+ p = n - 97 + 10;
+ } else if (n >= 65) {
+ p = n - 65 + 10;
+ } else if (Y(n)) {
+ p = n - 48;
+ } else {
+ p = Infinity;
+ }
+ if (p >= i) {
+ if (p <= 9 && c) {
+ return { n: null, pos: t };
+ } else if (p <= 9 && l.invalidDigit(t, r, s, i)) {
+ p = 0;
+ } else if (a) {
+ p = 0;
+ f = true;
+ } else {
+ break;
+ }
+ }
+ ++t;
+ h = h * i + p;
+ }
+ if (t === p || (n != null && t - p !== n) || f) {
+ return { n: null, pos: t };
+ }
+ return { n: h, pos: t };
+ }
+ function readCodePoint(e, t, r, s, i, n) {
+ const a = e.charCodeAt(t);
+ let o;
+ if (a === 123) {
+ ++t;
+ ({ code: o, pos: t } = readHexChar(
+ e,
+ t,
+ r,
+ s,
+ e.indexOf('}', t) - t,
+ true,
+ i,
+ n,
+ ));
+ ++t;
+ if (o !== null && o > 1114111) {
+ if (i) {
+ n.invalidCodePoint(t, r, s);
+ } else {
+ return { code: null, pos: t };
+ }
+ }
+ } else {
+ ({ code: o, pos: t } = readHexChar(e, t, r, s, 4, false, i, n));
+ }
+ return { code: o, pos: t };
+ }
+ const $ = ['at'],
+ z = ['at'];
+ function buildPosition(e, t, r) {
+ return new Position(r, e - t, e);
+ }
+ const H = new Set([103, 109, 115, 105, 121, 117, 100, 118]);
+ class Token {
+ constructor(e) {
+ this.type = e.type;
+ this.value = e.value;
+ this.start = e.start;
+ this.end = e.end;
+ this.loc = new SourceLocation(e.startLoc, e.endLoc);
+ }
+ }
+ class Tokenizer extends CommentsParser {
+ constructor(e, t) {
+ super();
+ this.isLookahead = void 0;
+ this.tokens = [];
+ this.errorHandlers_readInt = {
+ invalidDigit: (e, t, r, s) => {
+ if (!this.options.errorRecovery) return false;
+ this.raise(u.InvalidDigit, {
+ at: buildPosition(e, t, r),
+ radix: s,
+ });
+ return true;
+ },
+ numericSeparatorInEscapeSequence: this.errorBuilder(
+ u.NumericSeparatorInEscapeSequence,
+ ),
+ unexpectedNumericSeparator: this.errorBuilder(
+ u.UnexpectedNumericSeparator,
+ ),
+ };
+ this.errorHandlers_readCodePoint = Object.assign(
+ {},
+ this.errorHandlers_readInt,
+ {
+ invalidEscapeSequence: this.errorBuilder(u.InvalidEscapeSequence),
+ invalidCodePoint: this.errorBuilder(u.InvalidCodePoint),
+ },
+ );
+ this.errorHandlers_readStringContents_string = Object.assign(
+ {},
+ this.errorHandlers_readCodePoint,
+ {
+ strictNumericEscape: (e, t, r) => {
+ this.recordStrictModeErrors(u.StrictNumericEscape, {
+ at: buildPosition(e, t, r),
+ });
+ },
+ unterminated: (e, t, r) => {
+ throw this.raise(u.UnterminatedString, {
+ at: buildPosition(e - 1, t, r),
+ });
+ },
+ },
+ );
+ this.errorHandlers_readStringContents_template = Object.assign(
+ {},
+ this.errorHandlers_readCodePoint,
+ {
+ strictNumericEscape: this.errorBuilder(u.StrictNumericEscape),
+ unterminated: (e, t, r) => {
+ throw this.raise(u.UnterminatedTemplate, {
+ at: buildPosition(e, t, r),
+ });
+ },
+ },
+ );
+ this.state = new State();
+ this.state.init(e);
+ this.input = t;
+ this.length = t.length;
+ this.isLookahead = false;
+ }
+ pushToken(e) {
+ this.tokens.length = this.state.tokensLength;
+ this.tokens.push(e);
+ ++this.state.tokensLength;
+ }
+ next() {
+ this.checkKeywordEscapes();
+ if (this.options.tokens) {
+ this.pushToken(new Token(this.state));
+ }
+ this.state.lastTokStart = this.state.start;
+ this.state.lastTokEndLoc = this.state.endLoc;
+ this.state.lastTokStartLoc = this.state.startLoc;
+ this.nextToken();
+ }
+ eat(e) {
+ if (this.match(e)) {
+ this.next();
+ return true;
+ } else {
+ return false;
+ }
+ }
+ match(e) {
+ return this.state.type === e;
+ }
+ createLookaheadState(e) {
+ return {
+ pos: e.pos,
+ value: null,
+ type: e.type,
+ start: e.start,
+ end: e.end,
+ context: [this.curContext()],
+ inType: e.inType,
+ startLoc: e.startLoc,
+ lastTokEndLoc: e.lastTokEndLoc,
+ curLine: e.curLine,
+ lineStart: e.lineStart,
+ curPosition: e.curPosition,
+ };
+ }
+ lookahead() {
+ const e = this.state;
+ this.state = this.createLookaheadState(e);
+ this.isLookahead = true;
+ this.nextToken();
+ this.isLookahead = false;
+ const t = this.state;
+ this.state = e;
+ return t;
+ }
+ nextTokenStart() {
+ return this.nextTokenStartSince(this.state.pos);
+ }
+ nextTokenStartSince(e) {
+ V.lastIndex = e;
+ return V.test(this.input) ? V.lastIndex : e;
+ }
+ lookaheadCharCode() {
+ return this.input.charCodeAt(this.nextTokenStart());
+ }
+ nextTokenInLineStart() {
+ return this.nextTokenInLineStartSince(this.state.pos);
+ }
+ nextTokenInLineStartSince(e) {
+ X.lastIndex = e;
+ return X.test(this.input) ? X.lastIndex : e;
+ }
+ lookaheadInLineCharCode() {
+ return this.input.charCodeAt(this.nextTokenInLineStart());
+ }
+ codePointAtPos(e) {
+ let t = this.input.charCodeAt(e);
+ if ((t & 64512) === 55296 && ++e < this.input.length) {
+ const r = this.input.charCodeAt(e);
+ if ((r & 64512) === 56320) {
+ t = 65536 + ((t & 1023) << 10) + (r & 1023);
+ }
+ }
+ return t;
+ }
+ setStrict(e) {
+ this.state.strict = e;
+ if (e) {
+ this.state.strictErrors.forEach(([e, t]) =>
+ this.raise(e, { at: t }),
+ );
+ this.state.strictErrors.clear();
+ }
+ }
+ curContext() {
+ return this.state.context[this.state.context.length - 1];
+ }
+ nextToken() {
+ this.skipSpace();
+ this.state.start = this.state.pos;
+ if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
+ if (this.state.pos >= this.length) {
+ this.finishToken(139);
+ return;
+ }
+ this.getTokenFromCode(this.codePointAtPos(this.state.pos));
+ }
+ skipBlockComment(e) {
+ let t;
+ if (!this.isLookahead) t = this.state.curPosition();
+ const r = this.state.pos;
+ const s = this.input.indexOf(e, r + 2);
+ if (s === -1) {
+ throw this.raise(u.UnterminatedComment, {
+ at: this.state.curPosition(),
+ });
+ }
+ this.state.pos = s + e.length;
+ U.lastIndex = r + 2;
+ while (U.test(this.input) && U.lastIndex <= s) {
+ ++this.state.curLine;
+ this.state.lineStart = U.lastIndex;
+ }
+ if (this.isLookahead) return;
+ const i = {
+ type: 'CommentBlock',
+ value: this.input.slice(r + 2, s),
+ start: r,
+ end: s + e.length,
+ loc: new SourceLocation(t, this.state.curPosition()),
+ };
+ if (this.options.tokens) this.pushToken(i);
+ return i;
+ }
+ skipLineComment(e) {
+ const t = this.state.pos;
+ let r;
+ if (!this.isLookahead) r = this.state.curPosition();
+ let s = this.input.charCodeAt((this.state.pos += e));
+ if (this.state.pos < this.length) {
+ while (!isNewLine(s) && ++this.state.pos < this.length) {
+ s = this.input.charCodeAt(this.state.pos);
+ }
+ }
+ if (this.isLookahead) return;
+ const i = this.state.pos;
+ const n = this.input.slice(t + e, i);
+ const a = {
+ type: 'CommentLine',
+ value: n,
+ start: t,
+ end: i,
+ loc: new SourceLocation(r, this.state.curPosition()),
+ };
+ if (this.options.tokens) this.pushToken(a);
+ return a;
+ }
+ skipSpace() {
+ const e = this.state.pos;
+ const t = [];
+ e: while (this.state.pos < this.length) {
+ const r = this.input.charCodeAt(this.state.pos);
+ switch (r) {
+ case 32:
+ case 160:
+ case 9:
+ ++this.state.pos;
+ break;
+ case 13:
+ if (this.input.charCodeAt(this.state.pos + 1) === 10) {
+ ++this.state.pos;
+ }
+ case 10:
+ case 8232:
+ case 8233:
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ break;
+ case 47:
+ switch (this.input.charCodeAt(this.state.pos + 1)) {
+ case 42: {
+ const e = this.skipBlockComment('*/');
+ if (e !== undefined) {
+ this.addComment(e);
+ if (this.options.attachComment) t.push(e);
+ }
+ break;
+ }
+ case 47: {
+ const e = this.skipLineComment(2);
+ if (e !== undefined) {
+ this.addComment(e);
+ if (this.options.attachComment) t.push(e);
+ }
+ break;
+ }
+ default:
+ break e;
+ }
+ break;
+ default:
+ if (isWhitespace(r)) {
+ ++this.state.pos;
+ } else if (r === 45 && !this.inModule && this.options.annexB) {
+ const r = this.state.pos;
+ if (
+ this.input.charCodeAt(r + 1) === 45 &&
+ this.input.charCodeAt(r + 2) === 62 &&
+ (e === 0 || this.state.lineStart > e)
+ ) {
+ const e = this.skipLineComment(3);
+ if (e !== undefined) {
+ this.addComment(e);
+ if (this.options.attachComment) t.push(e);
+ }
+ } else {
+ break e;
+ }
+ } else if (r === 60 && !this.inModule && this.options.annexB) {
+ const e = this.state.pos;
+ if (
+ this.input.charCodeAt(e + 1) === 33 &&
+ this.input.charCodeAt(e + 2) === 45 &&
+ this.input.charCodeAt(e + 3) === 45
+ ) {
+ const e = this.skipLineComment(4);
+ if (e !== undefined) {
+ this.addComment(e);
+ if (this.options.attachComment) t.push(e);
+ }
+ } else {
+ break e;
+ }
+ } else {
+ break e;
+ }
+ }
+ }
+ if (t.length > 0) {
+ const r = this.state.pos;
+ const s = {
+ start: e,
+ end: r,
+ comments: t,
+ leadingNode: null,
+ trailingNode: null,
+ containingNode: null,
+ };
+ this.state.commentStack.push(s);
+ }
+ }
+ finishToken(e, t) {
+ this.state.end = this.state.pos;
+ this.state.endLoc = this.state.curPosition();
+ const r = this.state.type;
+ this.state.type = e;
+ this.state.value = t;
+ if (!this.isLookahead) {
+ this.updateContext(r);
+ }
+ }
+ replaceToken(e) {
+ this.state.type = e;
+ this.updateContext();
+ }
+ readToken_numberSign() {
+ if (this.state.pos === 0 && this.readToken_interpreter()) {
+ return;
+ }
+ const e = this.state.pos + 1;
+ const t = this.codePointAtPos(e);
+ if (t >= 48 && t <= 57) {
+ throw this.raise(u.UnexpectedDigitAfterHash, {
+ at: this.state.curPosition(),
+ });
+ }
+ if (t === 123 || (t === 91 && this.hasPlugin('recordAndTuple'))) {
+ this.expectPlugin('recordAndTuple');
+ if (
+ this.getPluginOption('recordAndTuple', 'syntaxType') === 'bar'
+ ) {
+ throw this.raise(
+ t === 123
+ ? u.RecordExpressionHashIncorrectStartSyntaxType
+ : u.TupleExpressionHashIncorrectStartSyntaxType,
+ { at: this.state.curPosition() },
+ );
+ }
+ this.state.pos += 2;
+ if (t === 123) {
+ this.finishToken(7);
+ } else {
+ this.finishToken(1);
+ }
+ } else if (isIdentifierStart(t)) {
+ ++this.state.pos;
+ this.finishToken(138, this.readWord1(t));
+ } else if (t === 92) {
+ ++this.state.pos;
+ this.finishToken(138, this.readWord1());
+ } else {
+ this.finishOp(27, 1);
+ }
+ }
+ readToken_dot() {
+ const e = this.input.charCodeAt(this.state.pos + 1);
+ if (e >= 48 && e <= 57) {
+ this.readNumber(true);
+ return;
+ }
+ if (e === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
+ this.state.pos += 3;
+ this.finishToken(21);
+ } else {
+ ++this.state.pos;
+ this.finishToken(16);
+ }
+ }
+ readToken_slash() {
+ const e = this.input.charCodeAt(this.state.pos + 1);
+ if (e === 61) {
+ this.finishOp(31, 2);
+ } else {
+ this.finishOp(56, 1);
+ }
+ }
+ readToken_interpreter() {
+ if (this.state.pos !== 0 || this.length < 2) return false;
+ let e = this.input.charCodeAt(this.state.pos + 1);
+ if (e !== 33) return false;
+ const t = this.state.pos;
+ this.state.pos += 1;
+ while (!isNewLine(e) && ++this.state.pos < this.length) {
+ e = this.input.charCodeAt(this.state.pos);
+ }
+ const r = this.input.slice(t + 2, this.state.pos);
+ this.finishToken(28, r);
+ return true;
+ }
+ readToken_mult_modulo(e) {
+ let t = e === 42 ? 55 : 54;
+ let r = 1;
+ let s = this.input.charCodeAt(this.state.pos + 1);
+ if (e === 42 && s === 42) {
+ r++;
+ s = this.input.charCodeAt(this.state.pos + 2);
+ t = 57;
+ }
+ if (s === 61 && !this.state.inType) {
+ r++;
+ t = e === 37 ? 33 : 30;
+ }
+ this.finishOp(t, r);
+ }
+ readToken_pipe_amp(e) {
+ const t = this.input.charCodeAt(this.state.pos + 1);
+ if (t === e) {
+ if (this.input.charCodeAt(this.state.pos + 2) === 61) {
+ this.finishOp(30, 3);
+ } else {
+ this.finishOp(e === 124 ? 41 : 42, 2);
+ }
+ return;
+ }
+ if (e === 124) {
+ if (t === 62) {
+ this.finishOp(39, 2);
+ return;
+ }
+ if (this.hasPlugin('recordAndTuple') && t === 125) {
+ if (
+ this.getPluginOption('recordAndTuple', 'syntaxType') !== 'bar'
+ ) {
+ throw this.raise(u.RecordExpressionBarIncorrectEndSyntaxType, {
+ at: this.state.curPosition(),
+ });
+ }
+ this.state.pos += 2;
+ this.finishToken(9);
+ return;
+ }
+ if (this.hasPlugin('recordAndTuple') && t === 93) {
+ if (
+ this.getPluginOption('recordAndTuple', 'syntaxType') !== 'bar'
+ ) {
+ throw this.raise(u.TupleExpressionBarIncorrectEndSyntaxType, {
+ at: this.state.curPosition(),
+ });
+ }
+ this.state.pos += 2;
+ this.finishToken(4);
+ return;
+ }
+ }
+ if (t === 61) {
+ this.finishOp(30, 2);
+ return;
+ }
+ this.finishOp(e === 124 ? 43 : 45, 1);
+ }
+ readToken_caret() {
+ const e = this.input.charCodeAt(this.state.pos + 1);
+ if (e === 61 && !this.state.inType) {
+ this.finishOp(32, 2);
+ } else if (
+ e === 94 &&
+ this.hasPlugin([
+ 'pipelineOperator',
+ { proposal: 'hack', topicToken: '^^' },
+ ])
+ ) {
+ this.finishOp(37, 2);
+ const e = this.input.codePointAt(this.state.pos);
+ if (e === 94) {
+ this.unexpected();
+ }
+ } else {
+ this.finishOp(44, 1);
+ }
+ }
+ readToken_atSign() {
+ const e = this.input.charCodeAt(this.state.pos + 1);
+ if (
+ e === 64 &&
+ this.hasPlugin([
+ 'pipelineOperator',
+ { proposal: 'hack', topicToken: '@@' },
+ ])
+ ) {
+ this.finishOp(38, 2);
+ } else {
+ this.finishOp(26, 1);
+ }
+ }
+ readToken_plus_min(e) {
+ const t = this.input.charCodeAt(this.state.pos + 1);
+ if (t === e) {
+ this.finishOp(34, 2);
+ return;
+ }
+ if (t === 61) {
+ this.finishOp(30, 2);
+ } else {
+ this.finishOp(53, 1);
+ }
+ }
+ readToken_lt() {
+ const { pos: e } = this.state;
+ const t = this.input.charCodeAt(e + 1);
+ if (t === 60) {
+ if (this.input.charCodeAt(e + 2) === 61) {
+ this.finishOp(30, 3);
+ return;
+ }
+ this.finishOp(51, 2);
+ return;
+ }
+ if (t === 61) {
+ this.finishOp(49, 2);
+ return;
+ }
+ this.finishOp(47, 1);
+ }
+ readToken_gt() {
+ const { pos: e } = this.state;
+ const t = this.input.charCodeAt(e + 1);
+ if (t === 62) {
+ const t = this.input.charCodeAt(e + 2) === 62 ? 3 : 2;
+ if (this.input.charCodeAt(e + t) === 61) {
+ this.finishOp(30, t + 1);
+ return;
+ }
+ this.finishOp(52, t);
+ return;
+ }
+ if (t === 61) {
+ this.finishOp(49, 2);
+ return;
+ }
+ this.finishOp(48, 1);
+ }
+ readToken_eq_excl(e) {
+ const t = this.input.charCodeAt(this.state.pos + 1);
+ if (t === 61) {
+ this.finishOp(
+ 46,
+ this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2,
+ );
+ return;
+ }
+ if (e === 61 && t === 62) {
+ this.state.pos += 2;
+ this.finishToken(19);
+ return;
+ }
+ this.finishOp(e === 61 ? 29 : 35, 1);
+ }
+ readToken_question() {
+ const e = this.input.charCodeAt(this.state.pos + 1);
+ const t = this.input.charCodeAt(this.state.pos + 2);
+ if (e === 63) {
+ if (t === 61) {
+ this.finishOp(30, 3);
+ } else {
+ this.finishOp(40, 2);
+ }
+ } else if (e === 46 && !(t >= 48 && t <= 57)) {
+ this.state.pos += 2;
+ this.finishToken(18);
+ } else {
+ ++this.state.pos;
+ this.finishToken(17);
+ }
+ }
+ getTokenFromCode(e) {
+ switch (e) {
+ case 46:
+ this.readToken_dot();
+ return;
+ case 40:
+ ++this.state.pos;
+ this.finishToken(10);
+ return;
+ case 41:
+ ++this.state.pos;
+ this.finishToken(11);
+ return;
+ case 59:
+ ++this.state.pos;
+ this.finishToken(13);
+ return;
+ case 44:
+ ++this.state.pos;
+ this.finishToken(12);
+ return;
+ case 91:
+ if (
+ this.hasPlugin('recordAndTuple') &&
+ this.input.charCodeAt(this.state.pos + 1) === 124
+ ) {
+ if (
+ this.getPluginOption('recordAndTuple', 'syntaxType') !== 'bar'
+ ) {
+ throw this.raise(
+ u.TupleExpressionBarIncorrectStartSyntaxType,
+ { at: this.state.curPosition() },
+ );
+ }
+ this.state.pos += 2;
+ this.finishToken(2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(0);
+ }
+ return;
+ case 93:
+ ++this.state.pos;
+ this.finishToken(3);
+ return;
+ case 123:
+ if (
+ this.hasPlugin('recordAndTuple') &&
+ this.input.charCodeAt(this.state.pos + 1) === 124
+ ) {
+ if (
+ this.getPluginOption('recordAndTuple', 'syntaxType') !== 'bar'
+ ) {
+ throw this.raise(
+ u.RecordExpressionBarIncorrectStartSyntaxType,
+ { at: this.state.curPosition() },
+ );
+ }
+ this.state.pos += 2;
+ this.finishToken(6);
+ } else {
+ ++this.state.pos;
+ this.finishToken(5);
+ }
+ return;
+ case 125:
+ ++this.state.pos;
+ this.finishToken(8);
+ return;
+ case 58:
+ if (
+ this.hasPlugin('functionBind') &&
+ this.input.charCodeAt(this.state.pos + 1) === 58
+ ) {
+ this.finishOp(15, 2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(14);
+ }
+ return;
+ case 63:
+ this.readToken_question();
+ return;
+ case 96:
+ this.readTemplateToken();
+ return;
+ case 48: {
+ const e = this.input.charCodeAt(this.state.pos + 1);
+ if (e === 120 || e === 88) {
+ this.readRadixNumber(16);
+ return;
+ }
+ if (e === 111 || e === 79) {
+ this.readRadixNumber(8);
+ return;
+ }
+ if (e === 98 || e === 66) {
+ this.readRadixNumber(2);
+ return;
+ }
+ }
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ this.readNumber(false);
+ return;
+ case 34:
+ case 39:
+ this.readString(e);
+ return;
+ case 47:
+ this.readToken_slash();
+ return;
+ case 37:
+ case 42:
+ this.readToken_mult_modulo(e);
+ return;
+ case 124:
+ case 38:
+ this.readToken_pipe_amp(e);
+ return;
+ case 94:
+ this.readToken_caret();
+ return;
+ case 43:
+ case 45:
+ this.readToken_plus_min(e);
+ return;
+ case 60:
+ this.readToken_lt();
+ return;
+ case 62:
+ this.readToken_gt();
+ return;
+ case 61:
+ case 33:
+ this.readToken_eq_excl(e);
+ return;
+ case 126:
+ this.finishOp(36, 1);
+ return;
+ case 64:
+ this.readToken_atSign();
+ return;
+ case 35:
+ this.readToken_numberSign();
+ return;
+ case 92:
+ this.readWord();
+ return;
+ default:
+ if (isIdentifierStart(e)) {
+ this.readWord(e);
+ return;
+ }
+ }
+ throw this.raise(u.InvalidOrUnexpectedToken, {
+ at: this.state.curPosition(),
+ unexpected: String.fromCodePoint(e),
+ });
+ }
+ finishOp(e, t) {
+ const r = this.input.slice(this.state.pos, this.state.pos + t);
+ this.state.pos += t;
+ this.finishToken(e, r);
+ }
+ readRegexp() {
+ const e = this.state.startLoc;
+ const t = this.state.start + 1;
+ let r, s;
+ let { pos: i } = this.state;
+ for (; ; ++i) {
+ if (i >= this.length) {
+ throw this.raise(u.UnterminatedRegExp, {
+ at: createPositionWithColumnOffset(e, 1),
+ });
+ }
+ const t = this.input.charCodeAt(i);
+ if (isNewLine(t)) {
+ throw this.raise(u.UnterminatedRegExp, {
+ at: createPositionWithColumnOffset(e, 1),
+ });
+ }
+ if (r) {
+ r = false;
+ } else {
+ if (t === 91) {
+ s = true;
+ } else if (t === 93 && s) {
+ s = false;
+ } else if (t === 47 && !s) {
+ break;
+ }
+ r = t === 92;
+ }
+ }
+ const n = this.input.slice(t, i);
+ ++i;
+ let a = '';
+ const nextPos = () => createPositionWithColumnOffset(e, i + 2 - t);
+ while (i < this.length) {
+ const e = this.codePointAtPos(i);
+ const t = String.fromCharCode(e);
+ if (H.has(e)) {
+ if (e === 118) {
+ if (a.includes('u')) {
+ this.raise(u.IncompatibleRegExpUVFlags, { at: nextPos() });
+ }
+ } else if (e === 117) {
+ if (a.includes('v')) {
+ this.raise(u.IncompatibleRegExpUVFlags, { at: nextPos() });
+ }
+ }
+ if (a.includes(t)) {
+ this.raise(u.DuplicateRegExpFlags, { at: nextPos() });
+ }
+ } else if (isIdentifierChar(e) || e === 92) {
+ this.raise(u.MalformedRegExpFlags, { at: nextPos() });
+ } else {
+ break;
+ }
+ ++i;
+ a += t;
+ }
+ this.state.pos = i;
+ this.finishToken(137, { pattern: n, flags: a });
+ }
+ readInt(e, t, r = false, s = true) {
+ const { n: i, pos: n } = readInt(
+ this.input,
+ this.state.pos,
+ this.state.lineStart,
+ this.state.curLine,
+ e,
+ t,
+ r,
+ s,
+ this.errorHandlers_readInt,
+ false,
+ );
+ this.state.pos = n;
+ return i;
+ }
+ readRadixNumber(e) {
+ const t = this.state.curPosition();
+ let r = false;
+ this.state.pos += 2;
+ const s = this.readInt(e);
+ if (s == null) {
+ this.raise(u.InvalidDigit, {
+ at: createPositionWithColumnOffset(t, 2),
+ radix: e,
+ });
+ }
+ const i = this.input.charCodeAt(this.state.pos);
+ if (i === 110) {
+ ++this.state.pos;
+ r = true;
+ } else if (i === 109) {
+ throw this.raise(u.InvalidDecimal, { at: t });
+ }
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(u.NumberIdentifier, {
+ at: this.state.curPosition(),
+ });
+ }
+ if (r) {
+ const e = this.input
+ .slice(t.index, this.state.pos)
+ .replace(/[_n]/g, '');
+ this.finishToken(135, e);
+ return;
+ }
+ this.finishToken(134, s);
+ }
+ readNumber(e) {
+ const t = this.state.pos;
+ const r = this.state.curPosition();
+ let s = false;
+ let i = false;
+ let n = false;
+ let a = false;
+ let o = false;
+ if (!e && this.readInt(10) === null) {
+ this.raise(u.InvalidNumber, { at: this.state.curPosition() });
+ }
+ const l = this.state.pos - t >= 2 && this.input.charCodeAt(t) === 48;
+ if (l) {
+ const e = this.input.slice(t, this.state.pos);
+ this.recordStrictModeErrors(u.StrictOctalLiteral, { at: r });
+ if (!this.state.strict) {
+ const t = e.indexOf('_');
+ if (t > 0) {
+ this.raise(u.ZeroDigitNumericSeparator, {
+ at: createPositionWithColumnOffset(r, t),
+ });
+ }
+ }
+ o = l && !/[89]/.test(e);
+ }
+ let c = this.input.charCodeAt(this.state.pos);
+ if (c === 46 && !o) {
+ ++this.state.pos;
+ this.readInt(10);
+ s = true;
+ c = this.input.charCodeAt(this.state.pos);
+ }
+ if ((c === 69 || c === 101) && !o) {
+ c = this.input.charCodeAt(++this.state.pos);
+ if (c === 43 || c === 45) {
+ ++this.state.pos;
+ }
+ if (this.readInt(10) === null) {
+ this.raise(u.InvalidOrMissingExponent, { at: r });
+ }
+ s = true;
+ a = true;
+ c = this.input.charCodeAt(this.state.pos);
+ }
+ if (c === 110) {
+ if (s || l) {
+ this.raise(u.InvalidBigIntLiteral, { at: r });
+ }
+ ++this.state.pos;
+ i = true;
+ }
+ if (c === 109) {
+ this.expectPlugin('decimal', this.state.curPosition());
+ if (a || l) {
+ this.raise(u.InvalidDecimal, { at: r });
+ }
+ ++this.state.pos;
+ n = true;
+ }
+ if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
+ throw this.raise(u.NumberIdentifier, {
+ at: this.state.curPosition(),
+ });
+ }
+ const p = this.input.slice(t, this.state.pos).replace(/[_mn]/g, '');
+ if (i) {
+ this.finishToken(135, p);
+ return;
+ }
+ if (n) {
+ this.finishToken(136, p);
+ return;
+ }
+ const d = o ? parseInt(p, 8) : parseFloat(p);
+ this.finishToken(134, d);
+ }
+ readCodePoint(e) {
+ const { code: t, pos: r } = readCodePoint(
+ this.input,
+ this.state.pos,
+ this.state.lineStart,
+ this.state.curLine,
+ e,
+ this.errorHandlers_readCodePoint,
+ );
+ this.state.pos = r;
+ return t;
+ }
+ readString(e) {
+ const {
+ str: t,
+ pos: r,
+ curLine: s,
+ lineStart: i,
+ } = readStringContents(
+ e === 34 ? 'double' : 'single',
+ this.input,
+ this.state.pos + 1,
+ this.state.lineStart,
+ this.state.curLine,
+ this.errorHandlers_readStringContents_string,
+ );
+ this.state.pos = r + 1;
+ this.state.lineStart = i;
+ this.state.curLine = s;
+ this.finishToken(133, t);
+ }
+ readTemplateContinuation() {
+ if (!this.match(8)) {
+ this.unexpected(null, 8);
+ }
+ this.state.pos--;
+ this.readTemplateToken();
+ }
+ readTemplateToken() {
+ const e = this.input[this.state.pos];
+ const {
+ str: t,
+ firstInvalidLoc: r,
+ pos: s,
+ curLine: i,
+ lineStart: n,
+ } = readStringContents(
+ 'template',
+ this.input,
+ this.state.pos + 1,
+ this.state.lineStart,
+ this.state.curLine,
+ this.errorHandlers_readStringContents_template,
+ );
+ this.state.pos = s + 1;
+ this.state.lineStart = n;
+ this.state.curLine = i;
+ if (r) {
+ this.state.firstInvalidTemplateEscapePos = new Position(
+ r.curLine,
+ r.pos - r.lineStart,
+ r.pos,
+ );
+ }
+ if (this.input.codePointAt(s) === 96) {
+ this.finishToken(24, r ? null : e + t + '`');
+ } else {
+ this.state.pos++;
+ this.finishToken(25, r ? null : e + t + '${');
+ }
+ }
+ recordStrictModeErrors(e, { at: t }) {
+ const r = t.index;
+ if (this.state.strict && !this.state.strictErrors.has(r)) {
+ this.raise(e, { at: t });
+ } else {
+ this.state.strictErrors.set(r, [e, t]);
+ }
+ }
+ readWord1(e) {
+ this.state.containsEsc = false;
+ let t = '';
+ const r = this.state.pos;
+ let s = this.state.pos;
+ if (e !== undefined) {
+ this.state.pos += e <= 65535 ? 1 : 2;
+ }
+ while (this.state.pos < this.length) {
+ const e = this.codePointAtPos(this.state.pos);
+ if (isIdentifierChar(e)) {
+ this.state.pos += e <= 65535 ? 1 : 2;
+ } else if (e === 92) {
+ this.state.containsEsc = true;
+ t += this.input.slice(s, this.state.pos);
+ const e = this.state.curPosition();
+ const i =
+ this.state.pos === r ? isIdentifierStart : isIdentifierChar;
+ if (this.input.charCodeAt(++this.state.pos) !== 117) {
+ this.raise(u.MissingUnicodeEscape, {
+ at: this.state.curPosition(),
+ });
+ s = this.state.pos - 1;
+ continue;
+ }
+ ++this.state.pos;
+ const n = this.readCodePoint(true);
+ if (n !== null) {
+ if (!i(n)) {
+ this.raise(u.EscapedCharNotAnIdentifier, { at: e });
+ }
+ t += String.fromCodePoint(n);
+ }
+ s = this.state.pos;
+ } else {
+ break;
+ }
+ }
+ return t + this.input.slice(s, this.state.pos);
+ }
+ readWord(e) {
+ const t = this.readWord1(e);
+ const r = b.get(t);
+ if (r !== undefined) {
+ this.finishToken(r, tokenLabelName(r));
+ } else {
+ this.finishToken(132, t);
+ }
+ }
+ checkKeywordEscapes() {
+ const { type: e } = this.state;
+ if (tokenIsKeyword(e) && this.state.containsEsc) {
+ this.raise(u.InvalidEscapedReservedWord, {
+ at: this.state.startLoc,
+ reservedWord: tokenLabelName(e),
+ });
+ }
+ }
+ raise(e, t) {
+ const { at: r } = t,
+ s = _objectWithoutPropertiesLoose(t, $);
+ const i = r instanceof Position ? r : r.loc.start;
+ const n = e({ loc: i, details: s });
+ if (!this.options.errorRecovery) throw n;
+ if (!this.isLookahead) this.state.errors.push(n);
+ return n;
+ }
+ raiseOverwrite(e, t) {
+ const { at: r } = t,
+ s = _objectWithoutPropertiesLoose(t, z);
+ const i = r instanceof Position ? r : r.loc.start;
+ const n = i.index;
+ const a = this.state.errors;
+ for (let t = a.length - 1; t >= 0; t--) {
+ const r = a[t];
+ if (r.loc.index === n) {
+ return (a[t] = e({ loc: i, details: s }));
+ }
+ if (r.loc.index < n) break;
+ }
+ return this.raise(e, t);
+ }
+ updateContext(e) {}
+ unexpected(e, t) {
+ throw this.raise(u.UnexpectedToken, {
+ expected: t ? tokenLabelName(t) : null,
+ at: e != null ? e : this.state.startLoc,
+ });
+ }
+ expectPlugin(e, t) {
+ if (this.hasPlugin(e)) {
+ return true;
+ }
+ throw this.raise(u.MissingPlugin, {
+ at: t != null ? t : this.state.startLoc,
+ missingPlugin: [e],
+ });
+ }
+ expectOnePlugin(e) {
+ if (!e.some((e) => this.hasPlugin(e))) {
+ throw this.raise(u.MissingOneOfPlugins, {
+ at: this.state.startLoc,
+ missingPlugin: e,
+ });
+ }
+ }
+ errorBuilder(e) {
+ return (t, r, s) => {
+ this.raise(e, { at: buildPosition(t, r, s) });
+ };
+ }
+ }
+ class ClassScope {
+ constructor() {
+ this.privateNames = new Set();
+ this.loneAccessors = new Map();
+ this.undefinedPrivateNames = new Map();
+ }
+ }
+ class ClassScopeHandler {
+ constructor(e) {
+ this.parser = void 0;
+ this.stack = [];
+ this.undefinedPrivateNames = new Map();
+ this.parser = e;
+ }
+ current() {
+ return this.stack[this.stack.length - 1];
+ }
+ enter() {
+ this.stack.push(new ClassScope());
+ }
+ exit() {
+ const e = this.stack.pop();
+ const t = this.current();
+ for (const [r, s] of Array.from(e.undefinedPrivateNames)) {
+ if (t) {
+ if (!t.undefinedPrivateNames.has(r)) {
+ t.undefinedPrivateNames.set(r, s);
+ }
+ } else {
+ this.parser.raise(u.InvalidPrivateFieldResolution, {
+ at: s,
+ identifierName: r,
+ });
+ }
+ }
+ }
+ declarePrivateName(e, t, r) {
+ const {
+ privateNames: s,
+ loneAccessors: i,
+ undefinedPrivateNames: n,
+ } = this.current();
+ let a = s.has(e);
+ if (t & 3) {
+ const r = a && i.get(e);
+ if (r) {
+ const s = r & 4;
+ const n = t & 4;
+ const o = r & 3;
+ const l = t & 3;
+ a = o === l || s !== n;
+ if (!a) i.delete(e);
+ } else if (!a) {
+ i.set(e, t);
+ }
+ }
+ if (a) {
+ this.parser.raise(u.PrivateNameRedeclaration, {
+ at: r,
+ identifierName: e,
+ });
+ }
+ s.add(e);
+ n.delete(e);
+ }
+ usePrivateName(e, t) {
+ let r;
+ for (r of this.stack) {
+ if (r.privateNames.has(e)) return;
+ }
+ if (r) {
+ r.undefinedPrivateNames.set(e, t);
+ } else {
+ this.parser.raise(u.InvalidPrivateFieldResolution, {
+ at: t,
+ identifierName: e,
+ });
+ }
+ }
+ }
+ class ExpressionScope {
+ constructor(e = 0) {
+ this.type = e;
+ }
+ canBeArrowParameterDeclaration() {
+ return this.type === 2 || this.type === 1;
+ }
+ isCertainlyParameterDeclaration() {
+ return this.type === 3;
+ }
+ }
+ class ArrowHeadParsingScope extends ExpressionScope {
+ constructor(e) {
+ super(e);
+ this.declarationErrors = new Map();
+ }
+ recordDeclarationError(e, { at: t }) {
+ const r = t.index;
+ this.declarationErrors.set(r, [e, t]);
+ }
+ clearDeclarationError(e) {
+ this.declarationErrors.delete(e);
+ }
+ iterateErrors(e) {
+ this.declarationErrors.forEach(e);
+ }
+ }
+ class ExpressionScopeHandler {
+ constructor(e) {
+ this.parser = void 0;
+ this.stack = [new ExpressionScope()];
+ this.parser = e;
+ }
+ enter(e) {
+ this.stack.push(e);
+ }
+ exit() {
+ this.stack.pop();
+ }
+ recordParameterInitializerError(e, { at: t }) {
+ const r = { at: t.loc.start };
+ const { stack: s } = this;
+ let i = s.length - 1;
+ let n = s[i];
+ while (!n.isCertainlyParameterDeclaration()) {
+ if (n.canBeArrowParameterDeclaration()) {
+ n.recordDeclarationError(e, r);
+ } else {
+ return;
+ }
+ n = s[--i];
+ }
+ this.parser.raise(e, r);
+ }
+ recordArrowParameterBindingError(e, { at: t }) {
+ const { stack: r } = this;
+ const s = r[r.length - 1];
+ const i = { at: t.loc.start };
+ if (s.isCertainlyParameterDeclaration()) {
+ this.parser.raise(e, i);
+ } else if (s.canBeArrowParameterDeclaration()) {
+ s.recordDeclarationError(e, i);
+ } else {
+ return;
+ }
+ }
+ recordAsyncArrowParametersError({ at: e }) {
+ const { stack: t } = this;
+ let r = t.length - 1;
+ let s = t[r];
+ while (s.canBeArrowParameterDeclaration()) {
+ if (s.type === 2) {
+ s.recordDeclarationError(u.AwaitBindingIdentifier, { at: e });
+ }
+ s = t[--r];
+ }
+ }
+ validateAsPattern() {
+ const { stack: e } = this;
+ const t = e[e.length - 1];
+ if (!t.canBeArrowParameterDeclaration()) return;
+ t.iterateErrors(([t, r]) => {
+ this.parser.raise(t, { at: r });
+ let s = e.length - 2;
+ let i = e[s];
+ while (i.canBeArrowParameterDeclaration()) {
+ i.clearDeclarationError(r.index);
+ i = e[--s];
+ }
+ });
+ }
+ }
+ function newParameterDeclarationScope() {
+ return new ExpressionScope(3);
+ }
+ function newArrowHeadScope() {
+ return new ArrowHeadParsingScope(1);
+ }
+ function newAsyncArrowScope() {
+ return new ArrowHeadParsingScope(2);
+ }
+ function newExpressionScope() {
+ return new ExpressionScope();
+ }
+ class ProductionParameterHandler {
+ constructor() {
+ this.stacks = [];
+ }
+ enter(e) {
+ this.stacks.push(e);
+ }
+ exit() {
+ this.stacks.pop();
+ }
+ currentFlags() {
+ return this.stacks[this.stacks.length - 1];
+ }
+ get hasAwait() {
+ return (this.currentFlags() & 2) > 0;
+ }
+ get hasYield() {
+ return (this.currentFlags() & 1) > 0;
+ }
+ get hasReturn() {
+ return (this.currentFlags() & 4) > 0;
+ }
+ get hasIn() {
+ return (this.currentFlags() & 8) > 0;
+ }
+ }
+ function functionFlags(e, t) {
+ return (e ? 2 : 0) | (t ? 1 : 0);
+ }
+ class UtilParser extends Tokenizer {
+ addExtra(e, t, r, s = true) {
+ if (!e) return;
+ const i = (e.extra = e.extra || {});
+ if (s) {
+ i[t] = r;
+ } else {
+ Object.defineProperty(i, t, { enumerable: s, value: r });
+ }
+ }
+ isContextual(e) {
+ return this.state.type === e && !this.state.containsEsc;
+ }
+ isUnparsedContextual(e, t) {
+ const r = e + t.length;
+ if (this.input.slice(e, r) === t) {
+ const e = this.input.charCodeAt(r);
+ return !(isIdentifierChar(e) || (e & 64512) === 55296);
+ }
+ return false;
+ }
+ isLookaheadContextual(e) {
+ const t = this.nextTokenStart();
+ return this.isUnparsedContextual(t, e);
+ }
+ eatContextual(e) {
+ if (this.isContextual(e)) {
+ this.next();
+ return true;
+ }
+ return false;
+ }
+ expectContextual(e, t) {
+ if (!this.eatContextual(e)) {
+ if (t != null) {
+ throw this.raise(t, { at: this.state.startLoc });
+ }
+ this.unexpected(null, e);
+ }
+ }
+ canInsertSemicolon() {
+ return (
+ this.match(139) || this.match(8) || this.hasPrecedingLineBreak()
+ );
+ }
+ hasPrecedingLineBreak() {
+ return K.test(
+ this.input.slice(this.state.lastTokEndLoc.index, this.state.start),
+ );
+ }
+ hasFollowingLineBreak() {
+ J.lastIndex = this.state.end;
+ return J.test(this.input);
+ }
+ isLineTerminator() {
+ return this.eat(13) || this.canInsertSemicolon();
+ }
+ semicolon(e = true) {
+ if (e ? this.isLineTerminator() : this.eat(13)) return;
+ this.raise(u.MissingSemicolon, { at: this.state.lastTokEndLoc });
+ }
+ expect(e, t) {
+ this.eat(e) || this.unexpected(t, e);
+ }
+ tryParse(e, t = this.state.clone()) {
+ const r = { node: null };
+ try {
+ const s = e((e = null) => {
+ r.node = e;
+ throw r;
+ });
+ if (this.state.errors.length > t.errors.length) {
+ const e = this.state;
+ this.state = t;
+ this.state.tokensLength = e.tokensLength;
+ return {
+ node: s,
+ error: e.errors[t.errors.length],
+ thrown: false,
+ aborted: false,
+ failState: e,
+ };
+ }
+ return {
+ node: s,
+ error: null,
+ thrown: false,
+ aborted: false,
+ failState: null,
+ };
+ } catch (e) {
+ const s = this.state;
+ this.state = t;
+ if (e instanceof SyntaxError) {
+ return {
+ node: null,
+ error: e,
+ thrown: true,
+ aborted: false,
+ failState: s,
+ };
+ }
+ if (e === r) {
+ return {
+ node: r.node,
+ error: null,
+ thrown: false,
+ aborted: true,
+ failState: s,
+ };
+ }
+ throw e;
+ }
+ }
+ checkExpressionErrors(e, t) {
+ if (!e) return false;
+ const {
+ shorthandAssignLoc: r,
+ doubleProtoLoc: s,
+ privateKeyLoc: i,
+ optionalParametersLoc: n,
+ } = e;
+ const a = !!r || !!s || !!n || !!i;
+ if (!t) {
+ return a;
+ }
+ if (r != null) {
+ this.raise(u.InvalidCoverInitializedName, { at: r });
+ }
+ if (s != null) {
+ this.raise(u.DuplicateProto, { at: s });
+ }
+ if (i != null) {
+ this.raise(u.UnexpectedPrivateField, { at: i });
+ }
+ if (n != null) {
+ this.unexpected(n);
+ }
+ }
+ isLiteralPropertyName() {
+ return tokenIsLiteralPropertyName(this.state.type);
+ }
+ isPrivateName(e) {
+ return e.type === 'PrivateName';
+ }
+ getPrivateNameSV(e) {
+ return e.id.name;
+ }
+ hasPropertyAsPrivateName(e) {
+ return (
+ (e.type === 'MemberExpression' ||
+ e.type === 'OptionalMemberExpression') &&
+ this.isPrivateName(e.property)
+ );
+ }
+ isObjectProperty(e) {
+ return e.type === 'ObjectProperty';
+ }
+ isObjectMethod(e) {
+ return e.type === 'ObjectMethod';
+ }
+ initializeScopes(e = this.options.sourceType === 'module') {
+ const t = this.state.labels;
+ this.state.labels = [];
+ const r = this.exportedIdentifiers;
+ this.exportedIdentifiers = new Set();
+ const s = this.inModule;
+ this.inModule = e;
+ const i = this.scope;
+ const n = this.getScopeHandler();
+ this.scope = new n(this, e);
+ const a = this.prodParam;
+ this.prodParam = new ProductionParameterHandler();
+ const o = this.classScope;
+ this.classScope = new ClassScopeHandler(this);
+ const l = this.expressionScope;
+ this.expressionScope = new ExpressionScopeHandler(this);
+ return () => {
+ this.state.labels = t;
+ this.exportedIdentifiers = r;
+ this.inModule = s;
+ this.scope = i;
+ this.prodParam = a;
+ this.classScope = o;
+ this.expressionScope = l;
+ };
+ }
+ enterInitialScopes() {
+ let e = 0;
+ if (this.inModule) {
+ e |= 2;
+ }
+ this.scope.enter(1);
+ this.prodParam.enter(e);
+ }
+ checkDestructuringPrivate(e) {
+ const { privateKeyLoc: t } = e;
+ if (t !== null) {
+ this.expectPlugin('destructuringPrivate', t);
+ }
+ }
+ }
+ class ExpressionErrors {
+ constructor() {
+ this.shorthandAssignLoc = null;
+ this.doubleProtoLoc = null;
+ this.privateKeyLoc = null;
+ this.optionalParametersLoc = null;
+ }
+ }
+ class Node {
+ constructor(e, t, r) {
+ this.type = '';
+ this.start = t;
+ this.end = 0;
+ this.loc = new SourceLocation(r);
+ if (e != null && e.options.ranges) this.range = [t, 0];
+ if (e != null && e.filename) this.loc.filename = e.filename;
+ }
+ }
+ const G = Node.prototype;
+ {
+ G.__clone = function () {
+ const e = new Node(undefined, this.start, this.loc.start);
+ const t = Object.keys(this);
+ for (let r = 0, s = t.length; r < s; r++) {
+ const s = t[r];
+ if (
+ s !== 'leadingComments' &&
+ s !== 'trailingComments' &&
+ s !== 'innerComments'
+ ) {
+ e[s] = this[s];
+ }
+ }
+ return e;
+ };
+ }
+ function clonePlaceholder(e) {
+ return cloneIdentifier(e);
+ }
+ function cloneIdentifier(e) {
+ const {
+ type: t,
+ start: r,
+ end: s,
+ loc: i,
+ range: n,
+ extra: a,
+ name: o,
+ } = e;
+ const l = Object.create(G);
+ l.type = t;
+ l.start = r;
+ l.end = s;
+ l.loc = i;
+ l.range = n;
+ l.extra = a;
+ l.name = o;
+ if (t === 'Placeholder') {
+ l.expectedNode = e.expectedNode;
+ }
+ return l;
+ }
+ function cloneStringLiteral(e) {
+ const { type: t, start: r, end: s, loc: i, range: n, extra: a } = e;
+ if (t === 'Placeholder') {
+ return clonePlaceholder(e);
+ }
+ const o = Object.create(G);
+ o.type = t;
+ o.start = r;
+ o.end = s;
+ o.loc = i;
+ o.range = n;
+ if (e.raw !== undefined) {
+ o.raw = e.raw;
+ } else {
+ o.extra = a;
+ }
+ o.value = e.value;
+ return o;
+ }
+ class NodeUtils extends UtilParser {
+ startNode() {
+ return new Node(this, this.state.start, this.state.startLoc);
+ }
+ startNodeAt(e) {
+ return new Node(this, e.index, e);
+ }
+ startNodeAtNode(e) {
+ return this.startNodeAt(e.loc.start);
+ }
+ finishNode(e, t) {
+ return this.finishNodeAt(e, t, this.state.lastTokEndLoc);
+ }
+ finishNodeAt(e, t, r) {
+ e.type = t;
+ e.end = r.index;
+ e.loc.end = r;
+ if (this.options.ranges) e.range[1] = r.index;
+ if (this.options.attachComment) this.processComment(e);
+ return e;
+ }
+ resetStartLocation(e, t) {
+ e.start = t.index;
+ e.loc.start = t;
+ if (this.options.ranges) e.range[0] = t.index;
+ }
+ resetEndLocation(e, t = this.state.lastTokEndLoc) {
+ e.end = t.index;
+ e.loc.end = t;
+ if (this.options.ranges) e.range[1] = t.index;
+ }
+ resetStartLocationFromNode(e, t) {
+ this.resetStartLocation(e, t.loc.start);
+ }
+ }
+ const Q = new Set([
+ '_',
+ 'any',
+ 'bool',
+ 'boolean',
+ 'empty',
+ 'extends',
+ 'false',
+ 'interface',
+ 'mixed',
+ 'null',
+ 'number',
+ 'static',
+ 'string',
+ 'true',
+ 'typeof',
+ 'void',
+ ]);
+ const Z = ParseErrorEnum`flow`({
+ AmbiguousConditionalArrow:
+ 'Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.',
+ 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.',
+ AssignReservedType: ({ reservedType: e }) =>
+ `Cannot overwrite reserved type ${e}.`,
+ DeclareClassElement:
+ 'The `declare` modifier can only appear on class fields.',
+ DeclareClassFieldInitializer:
+ 'Initializers are not allowed in fields with the `declare` modifier.',
+ DuplicateDeclareModuleExports:
+ 'Duplicate `declare module.exports` statement.',
+ EnumBooleanMemberNotInitialized: ({ memberName: e, enumName: t }) =>
+ `Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,
+ EnumDuplicateMemberName: ({ memberName: e, enumName: t }) =>
+ `Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,
+ EnumInconsistentMemberValues: ({ enumName: e }) =>
+ `Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,
+ EnumInvalidExplicitType: ({ invalidEnumType: e, enumName: t }) =>
+ `Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,
+ EnumInvalidExplicitTypeUnknownSupplied: ({ enumName: e }) =>
+ `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,
+ EnumInvalidMemberInitializerPrimaryType: ({
+ enumName: e,
+ memberName: t,
+ explicitType: r,
+ }) =>
+ `Enum \`${e}\` has type \`${r}\`, so the initializer of \`${t}\` needs to be a ${r} literal.`,
+ EnumInvalidMemberInitializerSymbolType: ({
+ enumName: e,
+ memberName: t,
+ }) =>
+ `Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,
+ EnumInvalidMemberInitializerUnknownType: ({
+ enumName: e,
+ memberName: t,
+ }) =>
+ `The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,
+ EnumInvalidMemberName: ({
+ enumName: e,
+ memberName: t,
+ suggestion: r,
+ }) =>
+ `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${r}\`, in enum \`${e}\`.`,
+ EnumNumberMemberNotInitialized: ({ enumName: e, memberName: t }) =>
+ `Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,
+ EnumStringMemberInconsistentlyInitialized: ({ enumName: e }) =>
+ `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,
+ GetterMayNotHaveThisParam: 'A getter cannot have a `this` parameter.',
+ ImportReflectionHasImportType:
+ 'An `import module` declaration can not use `type` or `typeof` keyword.',
+ 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.',
+ InexactInsideExact:
+ 'Explicit inexact syntax cannot appear inside an explicit exact object type.',
+ InexactInsideNonObject:
+ 'Explicit inexact syntax cannot appear in class or interface definitions.',
+ InexactVariance: 'Explicit inexact syntax cannot have variance.',
+ InvalidNonTypeImportInDeclareModule:
+ 'Imports within a `declare module` body must always be `import type` or `import typeof`.',
+ MissingTypeParamDefault:
+ 'Type parameter declaration needs a default, since a preceding type parameter declaration has a default.',
+ NestedDeclareModule:
+ '`declare module` cannot be used inside another `declare module`.',
+ NestedFlowComment:
+ 'Cannot have a flow comment inside another flow comment.',
+ PatternIsOptional: Object.assign(
+ {
+ message:
+ 'A binding pattern parameter cannot be optional in an implementation signature.',
+ },
+ { reasonCode: 'OptionalBindingPattern' },
+ ),
+ SetterMayNotHaveThisParam: 'A setter cannot have a `this` parameter.',
+ SpreadVariance: 'Spread properties cannot have variance.',
+ ThisParamAnnotationRequired:
+ 'A type annotation is required for the `this` parameter.',
+ ThisParamBannedInConstructor:
+ "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",
+ ThisParamMayNotBeOptional: 'The `this` parameter cannot be optional.',
+ ThisParamMustBeFirst:
+ 'The `this` parameter must be the first function parameter.',
+ ThisParamNoDefault:
+ 'The `this` parameter may not have a default value.',
+ TypeBeforeInitializer:
+ 'Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.',
+ TypeCastInPattern:
+ 'The type cast expression is expected to be wrapped with parenthesis.',
+ UnexpectedExplicitInexactInObject:
+ 'Explicit inexact syntax must appear at the end of an inexact object.',
+ UnexpectedReservedType: ({ reservedType: e }) =>
+ `Unexpected reserved type ${e}.`,
+ UnexpectedReservedUnderscore:
+ '`_` is only allowed as a type argument to call or new.',
+ UnexpectedSpaceBetweenModuloChecks:
+ 'Spaces between `%` and `checks` are not allowed here.',
+ UnexpectedSpreadType:
+ 'Spread operator cannot appear in class or interface definitions.',
+ UnexpectedSubtractionOperand:
+ 'Unexpected token, expected "number" or "bigint".',
+ UnexpectedTokenAfterTypeParameter:
+ 'Expected an arrow function after this type parameter declaration.',
+ UnexpectedTypeParameterBeforeAsyncArrowFunction:
+ 'Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.',
+ UnsupportedDeclareExportKind: ({
+ unsupportedExportKind: e,
+ suggestion: t,
+ }) => `\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,
+ UnsupportedStatementInDeclareModule:
+ 'Only declares and type imports are allowed inside declare module.',
+ UnterminatedFlowComment: 'Unterminated flow-comment.',
+ });
+ function isEsModuleType(e) {
+ return (
+ e.type === 'DeclareExportAllDeclaration' ||
+ (e.type === 'DeclareExportDeclaration' &&
+ (!e.declaration ||
+ (e.declaration.type !== 'TypeAlias' &&
+ e.declaration.type !== 'InterfaceDeclaration')))
+ );
+ }
+ function hasTypeImportKind(e) {
+ return e.importKind === 'type' || e.importKind === 'typeof';
+ }
+ const ee = {
+ const: 'declare export var',
+ let: 'declare export var',
+ type: 'export type',
+ interface: 'export interface',
+ };
+ function partition(e, t) {
+ const r = [];
+ const s = [];
+ for (let i = 0; i < e.length; i++) {
+ (t(e[i], i, e) ? r : s).push(e[i]);
+ }
+ return [r, s];
+ }
+ const te = /\*?\s*@((?:no)?flow)\b/;
+ var flow = (e) =>
+ class FlowParserMixin extends e {
+ constructor(...e) {
+ super(...e);
+ this.flowPragma = undefined;
+ }
+ getScopeHandler() {
+ return FlowScopeHandler;
+ }
+ shouldParseTypes() {
+ return (
+ this.getPluginOption('flow', 'all') || this.flowPragma === 'flow'
+ );
+ }
+ shouldParseEnums() {
+ return !!this.getPluginOption('flow', 'enums');
+ }
+ finishToken(e, t) {
+ if (e !== 133 && e !== 13 && e !== 28) {
+ if (this.flowPragma === undefined) {
+ this.flowPragma = null;
+ }
+ }
+ super.finishToken(e, t);
+ }
+ addComment(e) {
+ if (this.flowPragma === undefined) {
+ const t = te.exec(e.value);
+ if (!t);
+ else if (t[1] === 'flow') {
+ this.flowPragma = 'flow';
+ } else if (t[1] === 'noflow') {
+ this.flowPragma = 'noflow';
+ } else {
+ throw new Error('Unexpected flow pragma');
+ }
+ }
+ super.addComment(e);
+ }
+ flowParseTypeInitialiser(e) {
+ const t = this.state.inType;
+ this.state.inType = true;
+ this.expect(e || 14);
+ const r = this.flowParseType();
+ this.state.inType = t;
+ return r;
+ }
+ flowParsePredicate() {
+ const e = this.startNode();
+ const t = this.state.startLoc;
+ this.next();
+ this.expectContextual(110);
+ if (this.state.lastTokStart > t.index + 1) {
+ this.raise(Z.UnexpectedSpaceBetweenModuloChecks, { at: t });
+ }
+ if (this.eat(10)) {
+ e.value = super.parseExpression();
+ this.expect(11);
+ return this.finishNode(e, 'DeclaredPredicate');
+ } else {
+ return this.finishNode(e, 'InferredPredicate');
+ }
+ }
+ flowParseTypeAndPredicateInitialiser() {
+ const e = this.state.inType;
+ this.state.inType = true;
+ this.expect(14);
+ let t = null;
+ let r = null;
+ if (this.match(54)) {
+ this.state.inType = e;
+ r = this.flowParsePredicate();
+ } else {
+ t = this.flowParseType();
+ this.state.inType = e;
+ if (this.match(54)) {
+ r = this.flowParsePredicate();
+ }
+ }
+ return [t, r];
+ }
+ flowParseDeclareClass(e) {
+ this.next();
+ this.flowParseInterfaceish(e, true);
+ return this.finishNode(e, 'DeclareClass');
+ }
+ flowParseDeclareFunction(e) {
+ this.next();
+ const t = (e.id = this.parseIdentifier());
+ const r = this.startNode();
+ const s = this.startNode();
+ if (this.match(47)) {
+ r.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ r.typeParameters = null;
+ }
+ this.expect(10);
+ const i = this.flowParseFunctionTypeParams();
+ r.params = i.params;
+ r.rest = i.rest;
+ r.this = i._this;
+ this.expect(11);
+ [r.returnType, e.predicate] =
+ this.flowParseTypeAndPredicateInitialiser();
+ s.typeAnnotation = this.finishNode(r, 'FunctionTypeAnnotation');
+ t.typeAnnotation = this.finishNode(s, 'TypeAnnotation');
+ this.resetEndLocation(t);
+ this.semicolon();
+ this.scope.declareName(e.id.name, 2048, e.id.loc.start);
+ return this.finishNode(e, 'DeclareFunction');
+ }
+ flowParseDeclare(e, t) {
+ if (this.match(80)) {
+ return this.flowParseDeclareClass(e);
+ } else if (this.match(68)) {
+ return this.flowParseDeclareFunction(e);
+ } else if (this.match(74)) {
+ return this.flowParseDeclareVariable(e);
+ } else if (this.eatContextual(127)) {
+ if (this.match(16)) {
+ return this.flowParseDeclareModuleExports(e);
+ } else {
+ if (t) {
+ this.raise(Z.NestedDeclareModule, {
+ at: this.state.lastTokStartLoc,
+ });
+ }
+ return this.flowParseDeclareModule(e);
+ }
+ } else if (this.isContextual(130)) {
+ return this.flowParseDeclareTypeAlias(e);
+ } else if (this.isContextual(131)) {
+ return this.flowParseDeclareOpaqueType(e);
+ } else if (this.isContextual(129)) {
+ return this.flowParseDeclareInterface(e);
+ } else if (this.match(82)) {
+ return this.flowParseDeclareExportDeclaration(e, t);
+ } else {
+ this.unexpected();
+ }
+ }
+ flowParseDeclareVariable(e) {
+ this.next();
+ e.id = this.flowParseTypeAnnotatableIdentifier(true);
+ this.scope.declareName(e.id.name, 5, e.id.loc.start);
+ this.semicolon();
+ return this.finishNode(e, 'DeclareVariable');
+ }
+ flowParseDeclareModule(e) {
+ this.scope.enter(0);
+ if (this.match(133)) {
+ e.id = super.parseExprAtom();
+ } else {
+ e.id = this.parseIdentifier();
+ }
+ const t = (e.body = this.startNode());
+ const r = (t.body = []);
+ this.expect(5);
+ while (!this.match(8)) {
+ let e = this.startNode();
+ if (this.match(83)) {
+ this.next();
+ if (!this.isContextual(130) && !this.match(87)) {
+ this.raise(Z.InvalidNonTypeImportInDeclareModule, {
+ at: this.state.lastTokStartLoc,
+ });
+ }
+ super.parseImport(e);
+ } else {
+ this.expectContextual(
+ 125,
+ Z.UnsupportedStatementInDeclareModule,
+ );
+ e = this.flowParseDeclare(e, true);
+ }
+ r.push(e);
+ }
+ this.scope.exit();
+ this.expect(8);
+ this.finishNode(t, 'BlockStatement');
+ let s = null;
+ let i = false;
+ r.forEach((e) => {
+ if (isEsModuleType(e)) {
+ if (s === 'CommonJS') {
+ this.raise(Z.AmbiguousDeclareModuleKind, { at: e });
+ }
+ s = 'ES';
+ } else if (e.type === 'DeclareModuleExports') {
+ if (i) {
+ this.raise(Z.DuplicateDeclareModuleExports, { at: e });
+ }
+ if (s === 'ES') {
+ this.raise(Z.AmbiguousDeclareModuleKind, { at: e });
+ }
+ s = 'CommonJS';
+ i = true;
+ }
+ });
+ e.kind = s || 'CommonJS';
+ return this.finishNode(e, 'DeclareModule');
+ }
+ flowParseDeclareExportDeclaration(e, t) {
+ this.expect(82);
+ if (this.eat(65)) {
+ if (this.match(68) || this.match(80)) {
+ e.declaration = this.flowParseDeclare(this.startNode());
+ } else {
+ e.declaration = this.flowParseType();
+ this.semicolon();
+ }
+ e.default = true;
+ return this.finishNode(e, 'DeclareExportDeclaration');
+ } else {
+ if (
+ this.match(75) ||
+ this.isLet() ||
+ ((this.isContextual(130) || this.isContextual(129)) && !t)
+ ) {
+ const e = this.state.value;
+ throw this.raise(Z.UnsupportedDeclareExportKind, {
+ at: this.state.startLoc,
+ unsupportedExportKind: e,
+ suggestion: ee[e],
+ });
+ }
+ if (
+ this.match(74) ||
+ this.match(68) ||
+ this.match(80) ||
+ this.isContextual(131)
+ ) {
+ e.declaration = this.flowParseDeclare(this.startNode());
+ e.default = false;
+ return this.finishNode(e, 'DeclareExportDeclaration');
+ } else if (
+ this.match(55) ||
+ this.match(5) ||
+ this.isContextual(129) ||
+ this.isContextual(130) ||
+ this.isContextual(131)
+ ) {
+ e = this.parseExport(e, null);
+ if (e.type === 'ExportNamedDeclaration') {
+ e.type = 'ExportDeclaration';
+ e.default = false;
+ delete e.exportKind;
+ }
+ e.type = 'Declare' + e.type;
+ return e;
+ }
+ }
+ this.unexpected();
+ }
+ flowParseDeclareModuleExports(e) {
+ this.next();
+ this.expectContextual(111);
+ e.typeAnnotation = this.flowParseTypeAnnotation();
+ this.semicolon();
+ return this.finishNode(e, 'DeclareModuleExports');
+ }
+ flowParseDeclareTypeAlias(e) {
+ this.next();
+ const t = this.flowParseTypeAlias(e);
+ t.type = 'DeclareTypeAlias';
+ return t;
+ }
+ flowParseDeclareOpaqueType(e) {
+ this.next();
+ const t = this.flowParseOpaqueType(e, true);
+ t.type = 'DeclareOpaqueType';
+ return t;
+ }
+ flowParseDeclareInterface(e) {
+ this.next();
+ this.flowParseInterfaceish(e, false);
+ return this.finishNode(e, 'DeclareInterface');
+ }
+ flowParseInterfaceish(e, t) {
+ e.id = this.flowParseRestrictedIdentifier(!t, true);
+ this.scope.declareName(e.id.name, t ? 17 : 8201, e.id.loc.start);
+ if (this.match(47)) {
+ e.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ e.typeParameters = null;
+ }
+ e.extends = [];
+ if (this.eat(81)) {
+ do {
+ e.extends.push(this.flowParseInterfaceExtends());
+ } while (!t && this.eat(12));
+ }
+ if (t) {
+ e.implements = [];
+ e.mixins = [];
+ if (this.eatContextual(117)) {
+ do {
+ e.mixins.push(this.flowParseInterfaceExtends());
+ } while (this.eat(12));
+ }
+ if (this.eatContextual(113)) {
+ do {
+ e.implements.push(this.flowParseInterfaceExtends());
+ } while (this.eat(12));
+ }
+ }
+ e.body = this.flowParseObjectType({
+ allowStatic: t,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: t,
+ allowInexact: false,
+ });
+ }
+ flowParseInterfaceExtends() {
+ const e = this.startNode();
+ e.id = this.flowParseQualifiedTypeIdentifier();
+ if (this.match(47)) {
+ e.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ e.typeParameters = null;
+ }
+ return this.finishNode(e, 'InterfaceExtends');
+ }
+ flowParseInterface(e) {
+ this.flowParseInterfaceish(e, false);
+ return this.finishNode(e, 'InterfaceDeclaration');
+ }
+ checkNotUnderscore(e) {
+ if (e === '_') {
+ this.raise(Z.UnexpectedReservedUnderscore, {
+ at: this.state.startLoc,
+ });
+ }
+ }
+ checkReservedType(e, t, r) {
+ if (!Q.has(e)) return;
+ this.raise(r ? Z.AssignReservedType : Z.UnexpectedReservedType, {
+ at: t,
+ reservedType: e,
+ });
+ }
+ flowParseRestrictedIdentifier(e, t) {
+ this.checkReservedType(this.state.value, this.state.startLoc, t);
+ return this.parseIdentifier(e);
+ }
+ flowParseTypeAlias(e) {
+ e.id = this.flowParseRestrictedIdentifier(false, true);
+ this.scope.declareName(e.id.name, 8201, e.id.loc.start);
+ if (this.match(47)) {
+ e.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ e.typeParameters = null;
+ }
+ e.right = this.flowParseTypeInitialiser(29);
+ this.semicolon();
+ return this.finishNode(e, 'TypeAlias');
+ }
+ flowParseOpaqueType(e, t) {
+ this.expectContextual(130);
+ e.id = this.flowParseRestrictedIdentifier(true, true);
+ this.scope.declareName(e.id.name, 8201, e.id.loc.start);
+ if (this.match(47)) {
+ e.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ e.typeParameters = null;
+ }
+ e.supertype = null;
+ if (this.match(14)) {
+ e.supertype = this.flowParseTypeInitialiser(14);
+ }
+ e.impltype = null;
+ if (!t) {
+ e.impltype = this.flowParseTypeInitialiser(29);
+ }
+ this.semicolon();
+ return this.finishNode(e, 'OpaqueType');
+ }
+ flowParseTypeParameter(e = false) {
+ const t = this.state.startLoc;
+ const r = this.startNode();
+ const s = this.flowParseVariance();
+ const i = this.flowParseTypeAnnotatableIdentifier();
+ r.name = i.name;
+ r.variance = s;
+ r.bound = i.typeAnnotation;
+ if (this.match(29)) {
+ this.eat(29);
+ r.default = this.flowParseType();
+ } else {
+ if (e) {
+ this.raise(Z.MissingTypeParamDefault, { at: t });
+ }
+ }
+ return this.finishNode(r, 'TypeParameter');
+ }
+ flowParseTypeParameterDeclaration() {
+ const e = this.state.inType;
+ const t = this.startNode();
+ t.params = [];
+ this.state.inType = true;
+ if (this.match(47) || this.match(142)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+ let r = false;
+ do {
+ const e = this.flowParseTypeParameter(r);
+ t.params.push(e);
+ if (e.default) {
+ r = true;
+ }
+ if (!this.match(48)) {
+ this.expect(12);
+ }
+ } while (!this.match(48));
+ this.expect(48);
+ this.state.inType = e;
+ return this.finishNode(t, 'TypeParameterDeclaration');
+ }
+ flowParseTypeParameterInstantiation() {
+ const e = this.startNode();
+ const t = this.state.inType;
+ e.params = [];
+ this.state.inType = true;
+ this.expect(47);
+ const r = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = false;
+ while (!this.match(48)) {
+ e.params.push(this.flowParseType());
+ if (!this.match(48)) {
+ this.expect(12);
+ }
+ }
+ this.state.noAnonFunctionType = r;
+ this.expect(48);
+ this.state.inType = t;
+ return this.finishNode(e, 'TypeParameterInstantiation');
+ }
+ flowParseTypeParameterInstantiationCallOrNew() {
+ const e = this.startNode();
+ const t = this.state.inType;
+ e.params = [];
+ this.state.inType = true;
+ this.expect(47);
+ while (!this.match(48)) {
+ e.params.push(this.flowParseTypeOrImplicitInstantiation());
+ if (!this.match(48)) {
+ this.expect(12);
+ }
+ }
+ this.expect(48);
+ this.state.inType = t;
+ return this.finishNode(e, 'TypeParameterInstantiation');
+ }
+ flowParseInterfaceType() {
+ const e = this.startNode();
+ this.expectContextual(129);
+ e.extends = [];
+ if (this.eat(81)) {
+ do {
+ e.extends.push(this.flowParseInterfaceExtends());
+ } while (this.eat(12));
+ }
+ e.body = this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: false,
+ allowInexact: false,
+ });
+ return this.finishNode(e, 'InterfaceTypeAnnotation');
+ }
+ flowParseObjectPropertyKey() {
+ return this.match(134) || this.match(133)
+ ? super.parseExprAtom()
+ : this.parseIdentifier(true);
+ }
+ flowParseObjectTypeIndexer(e, t, r) {
+ e.static = t;
+ if (this.lookahead().type === 14) {
+ e.id = this.flowParseObjectPropertyKey();
+ e.key = this.flowParseTypeInitialiser();
+ } else {
+ e.id = null;
+ e.key = this.flowParseType();
+ }
+ this.expect(3);
+ e.value = this.flowParseTypeInitialiser();
+ e.variance = r;
+ return this.finishNode(e, 'ObjectTypeIndexer');
+ }
+ flowParseObjectTypeInternalSlot(e, t) {
+ e.static = t;
+ e.id = this.flowParseObjectPropertyKey();
+ this.expect(3);
+ this.expect(3);
+ if (this.match(47) || this.match(10)) {
+ e.method = true;
+ e.optional = false;
+ e.value = this.flowParseObjectTypeMethodish(
+ this.startNodeAt(e.loc.start),
+ );
+ } else {
+ e.method = false;
+ if (this.eat(17)) {
+ e.optional = true;
+ }
+ e.value = this.flowParseTypeInitialiser();
+ }
+ return this.finishNode(e, 'ObjectTypeInternalSlot');
+ }
+ flowParseObjectTypeMethodish(e) {
+ e.params = [];
+ e.rest = null;
+ e.typeParameters = null;
+ e.this = null;
+ if (this.match(47)) {
+ e.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ this.expect(10);
+ if (this.match(78)) {
+ e.this = this.flowParseFunctionTypeParam(true);
+ e.this.name = null;
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+ while (!this.match(11) && !this.match(21)) {
+ e.params.push(this.flowParseFunctionTypeParam(false));
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+ if (this.eat(21)) {
+ e.rest = this.flowParseFunctionTypeParam(false);
+ }
+ this.expect(11);
+ e.returnType = this.flowParseTypeInitialiser();
+ return this.finishNode(e, 'FunctionTypeAnnotation');
+ }
+ flowParseObjectTypeCallProperty(e, t) {
+ const r = this.startNode();
+ e.static = t;
+ e.value = this.flowParseObjectTypeMethodish(r);
+ return this.finishNode(e, 'ObjectTypeCallProperty');
+ }
+ flowParseObjectType({
+ allowStatic: e,
+ allowExact: t,
+ allowSpread: r,
+ allowProto: s,
+ allowInexact: i,
+ }) {
+ const n = this.state.inType;
+ this.state.inType = true;
+ const a = this.startNode();
+ a.callProperties = [];
+ a.properties = [];
+ a.indexers = [];
+ a.internalSlots = [];
+ let o;
+ let l;
+ let c = false;
+ if (t && this.match(6)) {
+ this.expect(6);
+ o = 9;
+ l = true;
+ } else {
+ this.expect(5);
+ o = 8;
+ l = false;
+ }
+ a.exact = l;
+ while (!this.match(o)) {
+ let t = false;
+ let n = null;
+ let o = null;
+ const p = this.startNode();
+ if (s && this.isContextual(118)) {
+ const t = this.lookahead();
+ if (t.type !== 14 && t.type !== 17) {
+ this.next();
+ n = this.state.startLoc;
+ e = false;
+ }
+ }
+ if (e && this.isContextual(106)) {
+ const e = this.lookahead();
+ if (e.type !== 14 && e.type !== 17) {
+ this.next();
+ t = true;
+ }
+ }
+ const u = this.flowParseVariance();
+ if (this.eat(0)) {
+ if (n != null) {
+ this.unexpected(n);
+ }
+ if (this.eat(0)) {
+ if (u) {
+ this.unexpected(u.loc.start);
+ }
+ a.internalSlots.push(
+ this.flowParseObjectTypeInternalSlot(p, t),
+ );
+ } else {
+ a.indexers.push(this.flowParseObjectTypeIndexer(p, t, u));
+ }
+ } else if (this.match(10) || this.match(47)) {
+ if (n != null) {
+ this.unexpected(n);
+ }
+ if (u) {
+ this.unexpected(u.loc.start);
+ }
+ a.callProperties.push(
+ this.flowParseObjectTypeCallProperty(p, t),
+ );
+ } else {
+ let e = 'init';
+ if (this.isContextual(99) || this.isContextual(104)) {
+ const t = this.lookahead();
+ if (tokenIsLiteralPropertyName(t.type)) {
+ e = this.state.value;
+ this.next();
+ }
+ }
+ const s = this.flowParseObjectTypeProperty(
+ p,
+ t,
+ n,
+ u,
+ e,
+ r,
+ i != null ? i : !l,
+ );
+ if (s === null) {
+ c = true;
+ o = this.state.lastTokStartLoc;
+ } else {
+ a.properties.push(s);
+ }
+ }
+ this.flowObjectTypeSemicolon();
+ if (o && !this.match(8) && !this.match(9)) {
+ this.raise(Z.UnexpectedExplicitInexactInObject, { at: o });
+ }
+ }
+ this.expect(o);
+ if (r) {
+ a.inexact = c;
+ }
+ const p = this.finishNode(a, 'ObjectTypeAnnotation');
+ this.state.inType = n;
+ return p;
+ }
+ flowParseObjectTypeProperty(e, t, r, s, i, n, a) {
+ if (this.eat(21)) {
+ const t =
+ this.match(12) ||
+ this.match(13) ||
+ this.match(8) ||
+ this.match(9);
+ if (t) {
+ if (!n) {
+ this.raise(Z.InexactInsideNonObject, {
+ at: this.state.lastTokStartLoc,
+ });
+ } else if (!a) {
+ this.raise(Z.InexactInsideExact, {
+ at: this.state.lastTokStartLoc,
+ });
+ }
+ if (s) {
+ this.raise(Z.InexactVariance, { at: s });
+ }
+ return null;
+ }
+ if (!n) {
+ this.raise(Z.UnexpectedSpreadType, {
+ at: this.state.lastTokStartLoc,
+ });
+ }
+ if (r != null) {
+ this.unexpected(r);
+ }
+ if (s) {
+ this.raise(Z.SpreadVariance, { at: s });
+ }
+ e.argument = this.flowParseType();
+ return this.finishNode(e, 'ObjectTypeSpreadProperty');
+ } else {
+ e.key = this.flowParseObjectPropertyKey();
+ e.static = t;
+ e.proto = r != null;
+ e.kind = i;
+ let a = false;
+ if (this.match(47) || this.match(10)) {
+ e.method = true;
+ if (r != null) {
+ this.unexpected(r);
+ }
+ if (s) {
+ this.unexpected(s.loc.start);
+ }
+ e.value = this.flowParseObjectTypeMethodish(
+ this.startNodeAt(e.loc.start),
+ );
+ if (i === 'get' || i === 'set') {
+ this.flowCheckGetterSetterParams(e);
+ }
+ if (!n && e.key.name === 'constructor' && e.value.this) {
+ this.raise(Z.ThisParamBannedInConstructor, {
+ at: e.value.this,
+ });
+ }
+ } else {
+ if (i !== 'init') this.unexpected();
+ e.method = false;
+ if (this.eat(17)) {
+ a = true;
+ }
+ e.value = this.flowParseTypeInitialiser();
+ e.variance = s;
+ }
+ e.optional = a;
+ return this.finishNode(e, 'ObjectTypeProperty');
+ }
+ }
+ flowCheckGetterSetterParams(e) {
+ const t = e.kind === 'get' ? 0 : 1;
+ const r = e.value.params.length + (e.value.rest ? 1 : 0);
+ if (e.value.this) {
+ this.raise(
+ e.kind === 'get'
+ ? Z.GetterMayNotHaveThisParam
+ : Z.SetterMayNotHaveThisParam,
+ { at: e.value.this },
+ );
+ }
+ if (r !== t) {
+ this.raise(
+ e.kind === 'get' ? u.BadGetterArity : u.BadSetterArity,
+ { at: e },
+ );
+ }
+ if (e.kind === 'set' && e.value.rest) {
+ this.raise(u.BadSetterRestParameter, { at: e });
+ }
+ }
+ flowObjectTypeSemicolon() {
+ if (
+ !this.eat(13) &&
+ !this.eat(12) &&
+ !this.match(8) &&
+ !this.match(9)
+ ) {
+ this.unexpected();
+ }
+ }
+ flowParseQualifiedTypeIdentifier(e, t) {
+ var r;
+ (r = e) != null ? r : (e = this.state.startLoc);
+ let s = t || this.flowParseRestrictedIdentifier(true);
+ while (this.eat(16)) {
+ const t = this.startNodeAt(e);
+ t.qualification = s;
+ t.id = this.flowParseRestrictedIdentifier(true);
+ s = this.finishNode(t, 'QualifiedTypeIdentifier');
+ }
+ return s;
+ }
+ flowParseGenericType(e, t) {
+ const r = this.startNodeAt(e);
+ r.typeParameters = null;
+ r.id = this.flowParseQualifiedTypeIdentifier(e, t);
+ if (this.match(47)) {
+ r.typeParameters = this.flowParseTypeParameterInstantiation();
+ }
+ return this.finishNode(r, 'GenericTypeAnnotation');
+ }
+ flowParseTypeofType() {
+ const e = this.startNode();
+ this.expect(87);
+ e.argument = this.flowParsePrimaryType();
+ return this.finishNode(e, 'TypeofTypeAnnotation');
+ }
+ flowParseTupleType() {
+ const e = this.startNode();
+ e.types = [];
+ this.expect(0);
+ while (this.state.pos < this.length && !this.match(3)) {
+ e.types.push(this.flowParseType());
+ if (this.match(3)) break;
+ this.expect(12);
+ }
+ this.expect(3);
+ return this.finishNode(e, 'TupleTypeAnnotation');
+ }
+ flowParseFunctionTypeParam(e) {
+ let t = null;
+ let r = false;
+ let s = null;
+ const i = this.startNode();
+ const n = this.lookahead();
+ const a = this.state.type === 78;
+ if (n.type === 14 || n.type === 17) {
+ if (a && !e) {
+ this.raise(Z.ThisParamMustBeFirst, { at: i });
+ }
+ t = this.parseIdentifier(a);
+ if (this.eat(17)) {
+ r = true;
+ if (a) {
+ this.raise(Z.ThisParamMayNotBeOptional, { at: i });
+ }
+ }
+ s = this.flowParseTypeInitialiser();
+ } else {
+ s = this.flowParseType();
+ }
+ i.name = t;
+ i.optional = r;
+ i.typeAnnotation = s;
+ return this.finishNode(i, 'FunctionTypeParam');
+ }
+ reinterpretTypeAsFunctionTypeParam(e) {
+ const t = this.startNodeAt(e.loc.start);
+ t.name = null;
+ t.optional = false;
+ t.typeAnnotation = e;
+ return this.finishNode(t, 'FunctionTypeParam');
+ }
+ flowParseFunctionTypeParams(e = []) {
+ let t = null;
+ let r = null;
+ if (this.match(78)) {
+ r = this.flowParseFunctionTypeParam(true);
+ r.name = null;
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+ while (!this.match(11) && !this.match(21)) {
+ e.push(this.flowParseFunctionTypeParam(false));
+ if (!this.match(11)) {
+ this.expect(12);
+ }
+ }
+ if (this.eat(21)) {
+ t = this.flowParseFunctionTypeParam(false);
+ }
+ return { params: e, rest: t, _this: r };
+ }
+ flowIdentToTypeAnnotation(e, t, r) {
+ switch (r.name) {
+ case 'any':
+ return this.finishNode(t, 'AnyTypeAnnotation');
+ case 'bool':
+ case 'boolean':
+ return this.finishNode(t, 'BooleanTypeAnnotation');
+ case 'mixed':
+ return this.finishNode(t, 'MixedTypeAnnotation');
+ case 'empty':
+ return this.finishNode(t, 'EmptyTypeAnnotation');
+ case 'number':
+ return this.finishNode(t, 'NumberTypeAnnotation');
+ case 'string':
+ return this.finishNode(t, 'StringTypeAnnotation');
+ case 'symbol':
+ return this.finishNode(t, 'SymbolTypeAnnotation');
+ default:
+ this.checkNotUnderscore(r.name);
+ return this.flowParseGenericType(e, r);
+ }
+ }
+ flowParsePrimaryType() {
+ const e = this.state.startLoc;
+ const t = this.startNode();
+ let r;
+ let s;
+ let i = false;
+ const n = this.state.noAnonFunctionType;
+ switch (this.state.type) {
+ case 5:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: true,
+ });
+ case 6:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: true,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: false,
+ });
+ case 0:
+ this.state.noAnonFunctionType = false;
+ s = this.flowParseTupleType();
+ this.state.noAnonFunctionType = n;
+ return s;
+ case 47:
+ t.typeParameters = this.flowParseTypeParameterDeclaration();
+ this.expect(10);
+ r = this.flowParseFunctionTypeParams();
+ t.params = r.params;
+ t.rest = r.rest;
+ t.this = r._this;
+ this.expect(11);
+ this.expect(19);
+ t.returnType = this.flowParseType();
+ return this.finishNode(t, 'FunctionTypeAnnotation');
+ case 10:
+ this.next();
+ if (!this.match(11) && !this.match(21)) {
+ if (tokenIsIdentifier(this.state.type) || this.match(78)) {
+ const e = this.lookahead().type;
+ i = e !== 17 && e !== 14;
+ } else {
+ i = true;
+ }
+ }
+ if (i) {
+ this.state.noAnonFunctionType = false;
+ s = this.flowParseType();
+ this.state.noAnonFunctionType = n;
+ if (
+ this.state.noAnonFunctionType ||
+ !(
+ this.match(12) ||
+ (this.match(11) && this.lookahead().type === 19)
+ )
+ ) {
+ this.expect(11);
+ return s;
+ } else {
+ this.eat(12);
+ }
+ }
+ if (s) {
+ r = this.flowParseFunctionTypeParams([
+ this.reinterpretTypeAsFunctionTypeParam(s),
+ ]);
+ } else {
+ r = this.flowParseFunctionTypeParams();
+ }
+ t.params = r.params;
+ t.rest = r.rest;
+ t.this = r._this;
+ this.expect(11);
+ this.expect(19);
+ t.returnType = this.flowParseType();
+ t.typeParameters = null;
+ return this.finishNode(t, 'FunctionTypeAnnotation');
+ case 133:
+ return this.parseLiteral(
+ this.state.value,
+ 'StringLiteralTypeAnnotation',
+ );
+ case 85:
+ case 86:
+ t.value = this.match(85);
+ this.next();
+ return this.finishNode(t, 'BooleanLiteralTypeAnnotation');
+ case 53:
+ if (this.state.value === '-') {
+ this.next();
+ if (this.match(134)) {
+ return this.parseLiteralAtNode(
+ -this.state.value,
+ 'NumberLiteralTypeAnnotation',
+ t,
+ );
+ }
+ if (this.match(135)) {
+ return this.parseLiteralAtNode(
+ -this.state.value,
+ 'BigIntLiteralTypeAnnotation',
+ t,
+ );
+ }
+ throw this.raise(Z.UnexpectedSubtractionOperand, {
+ at: this.state.startLoc,
+ });
+ }
+ this.unexpected();
+ return;
+ case 134:
+ return this.parseLiteral(
+ this.state.value,
+ 'NumberLiteralTypeAnnotation',
+ );
+ case 135:
+ return this.parseLiteral(
+ this.state.value,
+ 'BigIntLiteralTypeAnnotation',
+ );
+ case 88:
+ this.next();
+ return this.finishNode(t, 'VoidTypeAnnotation');
+ case 84:
+ this.next();
+ return this.finishNode(t, 'NullLiteralTypeAnnotation');
+ case 78:
+ this.next();
+ return this.finishNode(t, 'ThisTypeAnnotation');
+ case 55:
+ this.next();
+ return this.finishNode(t, 'ExistsTypeAnnotation');
+ case 87:
+ return this.flowParseTypeofType();
+ default:
+ if (tokenIsKeyword(this.state.type)) {
+ const e = tokenLabelName(this.state.type);
+ this.next();
+ return super.createIdentifier(t, e);
+ } else if (tokenIsIdentifier(this.state.type)) {
+ if (this.isContextual(129)) {
+ return this.flowParseInterfaceType();
+ }
+ return this.flowIdentToTypeAnnotation(
+ e,
+ t,
+ this.parseIdentifier(),
+ );
+ }
+ }
+ this.unexpected();
+ }
+ flowParsePostfixType() {
+ const e = this.state.startLoc;
+ let t = this.flowParsePrimaryType();
+ let r = false;
+ while (
+ (this.match(0) || this.match(18)) &&
+ !this.canInsertSemicolon()
+ ) {
+ const s = this.startNodeAt(e);
+ const i = this.eat(18);
+ r = r || i;
+ this.expect(0);
+ if (!i && this.match(3)) {
+ s.elementType = t;
+ this.next();
+ t = this.finishNode(s, 'ArrayTypeAnnotation');
+ } else {
+ s.objectType = t;
+ s.indexType = this.flowParseType();
+ this.expect(3);
+ if (r) {
+ s.optional = i;
+ t = this.finishNode(s, 'OptionalIndexedAccessType');
+ } else {
+ t = this.finishNode(s, 'IndexedAccessType');
+ }
+ }
+ }
+ return t;
+ }
+ flowParsePrefixType() {
+ const e = this.startNode();
+ if (this.eat(17)) {
+ e.typeAnnotation = this.flowParsePrefixType();
+ return this.finishNode(e, 'NullableTypeAnnotation');
+ } else {
+ return this.flowParsePostfixType();
+ }
+ }
+ flowParseAnonFunctionWithoutParens() {
+ const e = this.flowParsePrefixType();
+ if (!this.state.noAnonFunctionType && this.eat(19)) {
+ const t = this.startNodeAt(e.loc.start);
+ t.params = [this.reinterpretTypeAsFunctionTypeParam(e)];
+ t.rest = null;
+ t.this = null;
+ t.returnType = this.flowParseType();
+ t.typeParameters = null;
+ return this.finishNode(t, 'FunctionTypeAnnotation');
+ }
+ return e;
+ }
+ flowParseIntersectionType() {
+ const e = this.startNode();
+ this.eat(45);
+ const t = this.flowParseAnonFunctionWithoutParens();
+ e.types = [t];
+ while (this.eat(45)) {
+ e.types.push(this.flowParseAnonFunctionWithoutParens());
+ }
+ return e.types.length === 1
+ ? t
+ : this.finishNode(e, 'IntersectionTypeAnnotation');
+ }
+ flowParseUnionType() {
+ const e = this.startNode();
+ this.eat(43);
+ const t = this.flowParseIntersectionType();
+ e.types = [t];
+ while (this.eat(43)) {
+ e.types.push(this.flowParseIntersectionType());
+ }
+ return e.types.length === 1
+ ? t
+ : this.finishNode(e, 'UnionTypeAnnotation');
+ }
+ flowParseType() {
+ const e = this.state.inType;
+ this.state.inType = true;
+ const t = this.flowParseUnionType();
+ this.state.inType = e;
+ return t;
+ }
+ flowParseTypeOrImplicitInstantiation() {
+ if (this.state.type === 132 && this.state.value === '_') {
+ const e = this.state.startLoc;
+ const t = this.parseIdentifier();
+ return this.flowParseGenericType(e, t);
+ } else {
+ return this.flowParseType();
+ }
+ }
+ flowParseTypeAnnotation() {
+ const e = this.startNode();
+ e.typeAnnotation = this.flowParseTypeInitialiser();
+ return this.finishNode(e, 'TypeAnnotation');
+ }
+ flowParseTypeAnnotatableIdentifier(e) {
+ const t = e
+ ? this.parseIdentifier()
+ : this.flowParseRestrictedIdentifier();
+ if (this.match(14)) {
+ t.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(t);
+ }
+ return t;
+ }
+ typeCastToParameter(e) {
+ e.expression.typeAnnotation = e.typeAnnotation;
+ this.resetEndLocation(e.expression, e.typeAnnotation.loc.end);
+ return e.expression;
+ }
+ flowParseVariance() {
+ let e = null;
+ if (this.match(53)) {
+ e = this.startNode();
+ if (this.state.value === '+') {
+ e.kind = 'plus';
+ } else {
+ e.kind = 'minus';
+ }
+ this.next();
+ return this.finishNode(e, 'Variance');
+ }
+ return e;
+ }
+ parseFunctionBody(e, t, r = false) {
+ if (t) {
+ this.forwardNoArrowParamsConversionAt(e, () =>
+ super.parseFunctionBody(e, true, r),
+ );
+ return;
+ }
+ super.parseFunctionBody(e, false, r);
+ }
+ parseFunctionBodyAndFinish(e, t, r = false) {
+ if (this.match(14)) {
+ const t = this.startNode();
+ [t.typeAnnotation, e.predicate] =
+ this.flowParseTypeAndPredicateInitialiser();
+ e.returnType = t.typeAnnotation
+ ? this.finishNode(t, 'TypeAnnotation')
+ : null;
+ }
+ return super.parseFunctionBodyAndFinish(e, t, r);
+ }
+ parseStatementLike(e) {
+ if (this.state.strict && this.isContextual(129)) {
+ const e = this.lookahead();
+ if (tokenIsKeywordOrIdentifier(e.type)) {
+ const e = this.startNode();
+ this.next();
+ return this.flowParseInterface(e);
+ }
+ } else if (this.shouldParseEnums() && this.isContextual(126)) {
+ const e = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(e);
+ }
+ const t = super.parseStatementLike(e);
+ if (this.flowPragma === undefined && !this.isValidDirective(t)) {
+ this.flowPragma = null;
+ }
+ return t;
+ }
+ parseExpressionStatement(e, t, r) {
+ if (t.type === 'Identifier') {
+ if (t.name === 'declare') {
+ if (
+ this.match(80) ||
+ tokenIsIdentifier(this.state.type) ||
+ this.match(68) ||
+ this.match(74) ||
+ this.match(82)
+ ) {
+ return this.flowParseDeclare(e);
+ }
+ } else if (tokenIsIdentifier(this.state.type)) {
+ if (t.name === 'interface') {
+ return this.flowParseInterface(e);
+ } else if (t.name === 'type') {
+ return this.flowParseTypeAlias(e);
+ } else if (t.name === 'opaque') {
+ return this.flowParseOpaqueType(e, false);
+ }
+ }
+ }
+ return super.parseExpressionStatement(e, t, r);
+ }
+ shouldParseExportDeclaration() {
+ const { type: e } = this.state;
+ if (
+ tokenIsFlowInterfaceOrTypeOrOpaque(e) ||
+ (this.shouldParseEnums() && e === 126)
+ ) {
+ return !this.state.containsEsc;
+ }
+ return super.shouldParseExportDeclaration();
+ }
+ isExportDefaultSpecifier() {
+ const { type: e } = this.state;
+ if (
+ tokenIsFlowInterfaceOrTypeOrOpaque(e) ||
+ (this.shouldParseEnums() && e === 126)
+ ) {
+ return this.state.containsEsc;
+ }
+ return super.isExportDefaultSpecifier();
+ }
+ parseExportDefaultExpression() {
+ if (this.shouldParseEnums() && this.isContextual(126)) {
+ const e = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(e);
+ }
+ return super.parseExportDefaultExpression();
+ }
+ parseConditional(e, t, r) {
+ if (!this.match(17)) return e;
+ if (this.state.maybeInArrowParameters) {
+ const t = this.lookaheadCharCode();
+ if (t === 44 || t === 61 || t === 58 || t === 41) {
+ this.setOptionalParametersError(r);
+ return e;
+ }
+ }
+ this.expect(17);
+ const s = this.state.clone();
+ const i = this.state.noArrowAt;
+ const n = this.startNodeAt(t);
+ let { consequent: a, failed: o } =
+ this.tryParseConditionalConsequent();
+ let [l, c] = this.getArrowLikeExpressions(a);
+ if (o || c.length > 0) {
+ const e = [...i];
+ if (c.length > 0) {
+ this.state = s;
+ this.state.noArrowAt = e;
+ for (let t = 0; t < c.length; t++) {
+ e.push(c[t].start);
+ }
+ ({ consequent: a, failed: o } =
+ this.tryParseConditionalConsequent());
+ [l, c] = this.getArrowLikeExpressions(a);
+ }
+ if (o && l.length > 1) {
+ this.raise(Z.AmbiguousConditionalArrow, { at: s.startLoc });
+ }
+ if (o && l.length === 1) {
+ this.state = s;
+ e.push(l[0].start);
+ this.state.noArrowAt = e;
+ ({ consequent: a, failed: o } =
+ this.tryParseConditionalConsequent());
+ }
+ }
+ this.getArrowLikeExpressions(a, true);
+ this.state.noArrowAt = i;
+ this.expect(14);
+ n.test = e;
+ n.consequent = a;
+ n.alternate = this.forwardNoArrowParamsConversionAt(n, () =>
+ this.parseMaybeAssign(undefined, undefined),
+ );
+ return this.finishNode(n, 'ConditionalExpression');
+ }
+ tryParseConditionalConsequent() {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ const e = this.parseMaybeAssignAllowIn();
+ const t = !this.match(14);
+ this.state.noArrowParamsConversionAt.pop();
+ return { consequent: e, failed: t };
+ }
+ getArrowLikeExpressions(e, t) {
+ const r = [e];
+ const s = [];
+ while (r.length !== 0) {
+ const e = r.pop();
+ if (e.type === 'ArrowFunctionExpression') {
+ if (e.typeParameters || !e.returnType) {
+ this.finishArrowValidation(e);
+ } else {
+ s.push(e);
+ }
+ r.push(e.body);
+ } else if (e.type === 'ConditionalExpression') {
+ r.push(e.consequent);
+ r.push(e.alternate);
+ }
+ }
+ if (t) {
+ s.forEach((e) => this.finishArrowValidation(e));
+ return [s, []];
+ }
+ return partition(s, (e) =>
+ e.params.every((e) => this.isAssignable(e, true)),
+ );
+ }
+ finishArrowValidation(e) {
+ var t;
+ this.toAssignableList(
+ e.params,
+ (t = e.extra) == null ? void 0 : t.trailingCommaLoc,
+ false,
+ );
+ this.scope.enter(2 | 4);
+ super.checkParams(e, false, true);
+ this.scope.exit();
+ }
+ forwardNoArrowParamsConversionAt(e, t) {
+ let r;
+ if (this.state.noArrowParamsConversionAt.indexOf(e.start) !== -1) {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ r = t();
+ this.state.noArrowParamsConversionAt.pop();
+ } else {
+ r = t();
+ }
+ return r;
+ }
+ parseParenItem(e, t) {
+ e = super.parseParenItem(e, t);
+ if (this.eat(17)) {
+ e.optional = true;
+ this.resetEndLocation(e);
+ }
+ if (this.match(14)) {
+ const r = this.startNodeAt(t);
+ r.expression = e;
+ r.typeAnnotation = this.flowParseTypeAnnotation();
+ return this.finishNode(r, 'TypeCastExpression');
+ }
+ return e;
+ }
+ assertModuleNodeAllowed(e) {
+ if (
+ (e.type === 'ImportDeclaration' &&
+ (e.importKind === 'type' || e.importKind === 'typeof')) ||
+ (e.type === 'ExportNamedDeclaration' &&
+ e.exportKind === 'type') ||
+ (e.type === 'ExportAllDeclaration' && e.exportKind === 'type')
+ ) {
+ return;
+ }
+ super.assertModuleNodeAllowed(e);
+ }
+ parseExportDeclaration(e) {
+ if (this.isContextual(130)) {
+ e.exportKind = 'type';
+ const t = this.startNode();
+ this.next();
+ if (this.match(5)) {
+ e.specifiers = this.parseExportSpecifiers(true);
+ super.parseExportFrom(e);
+ return null;
+ } else {
+ return this.flowParseTypeAlias(t);
+ }
+ } else if (this.isContextual(131)) {
+ e.exportKind = 'type';
+ const t = this.startNode();
+ this.next();
+ return this.flowParseOpaqueType(t, false);
+ } else if (this.isContextual(129)) {
+ e.exportKind = 'type';
+ const t = this.startNode();
+ this.next();
+ return this.flowParseInterface(t);
+ } else if (this.shouldParseEnums() && this.isContextual(126)) {
+ e.exportKind = 'value';
+ const t = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(t);
+ } else {
+ return super.parseExportDeclaration(e);
+ }
+ }
+ eatExportStar(e) {
+ if (super.eatExportStar(e)) return true;
+ if (this.isContextual(130) && this.lookahead().type === 55) {
+ e.exportKind = 'type';
+ this.next();
+ this.next();
+ return true;
+ }
+ return false;
+ }
+ maybeParseExportNamespaceSpecifier(e) {
+ const { startLoc: t } = this.state;
+ const r = super.maybeParseExportNamespaceSpecifier(e);
+ if (r && e.exportKind === 'type') {
+ this.unexpected(t);
+ }
+ return r;
+ }
+ parseClassId(e, t, r) {
+ super.parseClassId(e, t, r);
+ if (this.match(47)) {
+ e.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ }
+ parseClassMember(e, t, r) {
+ const { startLoc: s } = this.state;
+ if (this.isContextual(125)) {
+ if (super.parseClassMemberFromModifier(e, t)) {
+ return;
+ }
+ t.declare = true;
+ }
+ super.parseClassMember(e, t, r);
+ if (t.declare) {
+ if (
+ t.type !== 'ClassProperty' &&
+ t.type !== 'ClassPrivateProperty' &&
+ t.type !== 'PropertyDefinition'
+ ) {
+ this.raise(Z.DeclareClassElement, { at: s });
+ } else if (t.value) {
+ this.raise(Z.DeclareClassFieldInitializer, { at: t.value });
+ }
+ }
+ }
+ isIterator(e) {
+ return e === 'iterator' || e === 'asyncIterator';
+ }
+ readIterator() {
+ const e = super.readWord1();
+ const t = '@@' + e;
+ if (!this.isIterator(e) || !this.state.inType) {
+ this.raise(u.InvalidIdentifier, {
+ at: this.state.curPosition(),
+ identifierName: t,
+ });
+ }
+ this.finishToken(132, t);
+ }
+ getTokenFromCode(e) {
+ const t = this.input.charCodeAt(this.state.pos + 1);
+ if (e === 123 && t === 124) {
+ this.finishOp(6, 2);
+ } else if (this.state.inType && (e === 62 || e === 60)) {
+ this.finishOp(e === 62 ? 48 : 47, 1);
+ } else if (this.state.inType && e === 63) {
+ if (t === 46) {
+ this.finishOp(18, 2);
+ } else {
+ this.finishOp(17, 1);
+ }
+ } else if (
+ isIteratorStart(e, t, this.input.charCodeAt(this.state.pos + 2))
+ ) {
+ this.state.pos += 2;
+ this.readIterator();
+ } else {
+ super.getTokenFromCode(e);
+ }
+ }
+ isAssignable(e, t) {
+ if (e.type === 'TypeCastExpression') {
+ return this.isAssignable(e.expression, t);
+ } else {
+ return super.isAssignable(e, t);
+ }
+ }
+ toAssignable(e, t = false) {
+ if (
+ !t &&
+ e.type === 'AssignmentExpression' &&
+ e.left.type === 'TypeCastExpression'
+ ) {
+ e.left = this.typeCastToParameter(e.left);
+ }
+ super.toAssignable(e, t);
+ }
+ toAssignableList(e, t, r) {
+ for (let t = 0; t < e.length; t++) {
+ const r = e[t];
+ if ((r == null ? void 0 : r.type) === 'TypeCastExpression') {
+ e[t] = this.typeCastToParameter(r);
+ }
+ }
+ super.toAssignableList(e, t, r);
+ }
+ toReferencedList(e, t) {
+ for (let s = 0; s < e.length; s++) {
+ var r;
+ const i = e[s];
+ if (
+ i &&
+ i.type === 'TypeCastExpression' &&
+ !((r = i.extra) != null && r.parenthesized) &&
+ (e.length > 1 || !t)
+ ) {
+ this.raise(Z.TypeCastInPattern, { at: i.typeAnnotation });
+ }
+ }
+ return e;
+ }
+ parseArrayLike(e, t, r, s) {
+ const i = super.parseArrayLike(e, t, r, s);
+ if (t && !this.state.maybeInArrowParameters) {
+ this.toReferencedList(i.elements);
+ }
+ return i;
+ }
+ isValidLVal(e, t, r) {
+ return e === 'TypeCastExpression' || super.isValidLVal(e, t, r);
+ }
+ parseClassProperty(e) {
+ if (this.match(14)) {
+ e.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+ return super.parseClassProperty(e);
+ }
+ parseClassPrivateProperty(e) {
+ if (this.match(14)) {
+ e.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+ return super.parseClassPrivateProperty(e);
+ }
+ isClassMethod() {
+ return this.match(47) || super.isClassMethod();
+ }
+ isClassProperty() {
+ return this.match(14) || super.isClassProperty();
+ }
+ isNonstaticConstructor(e) {
+ return !this.match(14) && super.isNonstaticConstructor(e);
+ }
+ pushClassMethod(e, t, r, s, i, n) {
+ if (t.variance) {
+ this.unexpected(t.variance.loc.start);
+ }
+ delete t.variance;
+ if (this.match(47)) {
+ t.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ super.pushClassMethod(e, t, r, s, i, n);
+ if (t.params && i) {
+ const e = t.params;
+ if (e.length > 0 && this.isThisParam(e[0])) {
+ this.raise(Z.ThisParamBannedInConstructor, { at: t });
+ }
+ } else if (t.type === 'MethodDefinition' && i && t.value.params) {
+ const e = t.value.params;
+ if (e.length > 0 && this.isThisParam(e[0])) {
+ this.raise(Z.ThisParamBannedInConstructor, { at: t });
+ }
+ }
+ }
+ pushClassPrivateMethod(e, t, r, s) {
+ if (t.variance) {
+ this.unexpected(t.variance.loc.start);
+ }
+ delete t.variance;
+ if (this.match(47)) {
+ t.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ super.pushClassPrivateMethod(e, t, r, s);
+ }
+ parseClassSuper(e) {
+ super.parseClassSuper(e);
+ if (e.superClass && this.match(47)) {
+ e.superTypeParameters =
+ this.flowParseTypeParameterInstantiation();
+ }
+ if (this.isContextual(113)) {
+ this.next();
+ const t = (e.implements = []);
+ do {
+ const e = this.startNode();
+ e.id = this.flowParseRestrictedIdentifier(true);
+ if (this.match(47)) {
+ e.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ e.typeParameters = null;
+ }
+ t.push(this.finishNode(e, 'ClassImplements'));
+ } while (this.eat(12));
+ }
+ }
+ checkGetterSetterParams(e) {
+ super.checkGetterSetterParams(e);
+ const t = this.getObjectOrClassMethodParams(e);
+ if (t.length > 0) {
+ const r = t[0];
+ if (this.isThisParam(r) && e.kind === 'get') {
+ this.raise(Z.GetterMayNotHaveThisParam, { at: r });
+ } else if (this.isThisParam(r)) {
+ this.raise(Z.SetterMayNotHaveThisParam, { at: r });
+ }
+ }
+ }
+ parsePropertyNamePrefixOperator(e) {
+ e.variance = this.flowParseVariance();
+ }
+ parseObjPropValue(e, t, r, s, i, n, a) {
+ if (e.variance) {
+ this.unexpected(e.variance.loc.start);
+ }
+ delete e.variance;
+ let o;
+ if (this.match(47) && !n) {
+ o = this.flowParseTypeParameterDeclaration();
+ if (!this.match(10)) this.unexpected();
+ }
+ const l = super.parseObjPropValue(e, t, r, s, i, n, a);
+ if (o) {
+ (l.value || l).typeParameters = o;
+ }
+ return l;
+ }
+ parseAssignableListItemTypes(e) {
+ if (this.eat(17)) {
+ if (e.type !== 'Identifier') {
+ this.raise(Z.PatternIsOptional, { at: e });
+ }
+ if (this.isThisParam(e)) {
+ this.raise(Z.ThisParamMayNotBeOptional, { at: e });
+ }
+ e.optional = true;
+ }
+ if (this.match(14)) {
+ e.typeAnnotation = this.flowParseTypeAnnotation();
+ } else if (this.isThisParam(e)) {
+ this.raise(Z.ThisParamAnnotationRequired, { at: e });
+ }
+ if (this.match(29) && this.isThisParam(e)) {
+ this.raise(Z.ThisParamNoDefault, { at: e });
+ }
+ this.resetEndLocation(e);
+ return e;
+ }
+ parseMaybeDefault(e, t) {
+ const r = super.parseMaybeDefault(e, t);
+ if (
+ r.type === 'AssignmentPattern' &&
+ r.typeAnnotation &&
+ r.right.start < r.typeAnnotation.start
+ ) {
+ this.raise(Z.TypeBeforeInitializer, { at: r.typeAnnotation });
+ }
+ return r;
+ }
+ checkImportReflection(e) {
+ super.checkImportReflection(e);
+ if (e.module && e.importKind !== 'value') {
+ this.raise(Z.ImportReflectionHasImportType, {
+ at: e.specifiers[0].loc.start,
+ });
+ }
+ }
+ parseImportSpecifierLocal(e, t, r) {
+ t.local = hasTypeImportKind(e)
+ ? this.flowParseRestrictedIdentifier(true, true)
+ : this.parseIdentifier();
+ e.specifiers.push(this.finishImportSpecifier(t, r));
+ }
+ isPotentialImportPhase(e) {
+ if (super.isPotentialImportPhase(e)) return true;
+ if (this.isContextual(130)) {
+ if (!e) return true;
+ const t = this.lookaheadCharCode();
+ return t === 123 || t === 42;
+ }
+ return !e && this.isContextual(87);
+ }
+ applyImportPhase(e, t, r, s) {
+ super.applyImportPhase(e, t, r, s);
+ if (t) {
+ if (!r && this.match(65)) {
+ return;
+ }
+ e.exportKind = r === 'type' ? r : 'value';
+ } else {
+ if (r === 'type' && this.match(55)) this.unexpected();
+ e.importKind = r === 'type' || r === 'typeof' ? r : 'value';
+ }
+ }
+ parseImportSpecifier(e, t, r, s, i) {
+ const n = e.imported;
+ let a = null;
+ if (n.type === 'Identifier') {
+ if (n.name === 'type') {
+ a = 'type';
+ } else if (n.name === 'typeof') {
+ a = 'typeof';
+ }
+ }
+ let o = false;
+ if (this.isContextual(93) && !this.isLookaheadContextual('as')) {
+ const t = this.parseIdentifier(true);
+ if (a !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {
+ e.imported = t;
+ e.importKind = a;
+ e.local = cloneIdentifier(t);
+ } else {
+ e.imported = n;
+ e.importKind = null;
+ e.local = this.parseIdentifier();
+ }
+ } else {
+ if (a !== null && tokenIsKeywordOrIdentifier(this.state.type)) {
+ e.imported = this.parseIdentifier(true);
+ e.importKind = a;
+ } else {
+ if (t) {
+ throw this.raise(u.ImportBindingIsString, {
+ at: e,
+ importName: n.value,
+ });
+ }
+ e.imported = n;
+ e.importKind = null;
+ }
+ if (this.eatContextual(93)) {
+ e.local = this.parseIdentifier();
+ } else {
+ o = true;
+ e.local = cloneIdentifier(e.imported);
+ }
+ }
+ const l = hasTypeImportKind(e);
+ if (r && l) {
+ this.raise(Z.ImportTypeShorthandOnlyInPureImport, { at: e });
+ }
+ if (r || l) {
+ this.checkReservedType(e.local.name, e.local.loc.start, true);
+ }
+ if (o && !r && !l) {
+ this.checkReservedWord(e.local.name, e.loc.start, true, true);
+ }
+ return this.finishImportSpecifier(e, 'ImportSpecifier');
+ }
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 78:
+ return this.parseIdentifier(true);
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+ parseFunctionParams(e, t) {
+ const r = e.kind;
+ if (r !== 'get' && r !== 'set' && this.match(47)) {
+ e.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ super.parseFunctionParams(e, t);
+ }
+ parseVarId(e, t) {
+ super.parseVarId(e, t);
+ if (this.match(14)) {
+ e.id.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(e.id);
+ }
+ }
+ parseAsyncArrowFromCallExpression(e, t) {
+ if (this.match(14)) {
+ const t = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ e.returnType = this.flowParseTypeAnnotation();
+ this.state.noAnonFunctionType = t;
+ }
+ return super.parseAsyncArrowFromCallExpression(e, t);
+ }
+ shouldParseAsyncArrow() {
+ return this.match(14) || super.shouldParseAsyncArrow();
+ }
+ parseMaybeAssign(e, t) {
+ var r;
+ let s = null;
+ let i;
+ if (this.hasPlugin('jsx') && (this.match(142) || this.match(47))) {
+ s = this.state.clone();
+ i = this.tryParse(() => super.parseMaybeAssign(e, t), s);
+ if (!i.error) return i.node;
+ const { context: r } = this.state;
+ const n = r[r.length - 1];
+ if (n === f.j_oTag || n === f.j_expr) {
+ r.pop();
+ }
+ }
+ if (((r = i) != null && r.error) || this.match(47)) {
+ var n, a;
+ s = s || this.state.clone();
+ let r;
+ const o = this.tryParse((s) => {
+ var i;
+ r = this.flowParseTypeParameterDeclaration();
+ const n = this.forwardNoArrowParamsConversionAt(r, () => {
+ const s = super.parseMaybeAssign(e, t);
+ this.resetStartLocationFromNode(s, r);
+ return s;
+ });
+ if ((i = n.extra) != null && i.parenthesized) s();
+ const a = this.maybeUnwrapTypeCastExpression(n);
+ if (a.type !== 'ArrowFunctionExpression') s();
+ a.typeParameters = r;
+ this.resetStartLocationFromNode(a, r);
+ return n;
+ }, s);
+ let l = null;
+ if (
+ o.node &&
+ this.maybeUnwrapTypeCastExpression(o.node).type ===
+ 'ArrowFunctionExpression'
+ ) {
+ if (!o.error && !o.aborted) {
+ if (o.node.async) {
+ this.raise(
+ Z.UnexpectedTypeParameterBeforeAsyncArrowFunction,
+ { at: r },
+ );
+ }
+ return o.node;
+ }
+ l = o.node;
+ }
+ if ((n = i) != null && n.node) {
+ this.state = i.failState;
+ return i.node;
+ }
+ if (l) {
+ this.state = o.failState;
+ return l;
+ }
+ if ((a = i) != null && a.thrown) throw i.error;
+ if (o.thrown) throw o.error;
+ throw this.raise(Z.UnexpectedTokenAfterTypeParameter, { at: r });
+ }
+ return super.parseMaybeAssign(e, t);
+ }
+ parseArrow(e) {
+ if (this.match(14)) {
+ const t = this.tryParse(() => {
+ const t = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ const r = this.startNode();
+ [r.typeAnnotation, e.predicate] =
+ this.flowParseTypeAndPredicateInitialiser();
+ this.state.noAnonFunctionType = t;
+ if (this.canInsertSemicolon()) this.unexpected();
+ if (!this.match(19)) this.unexpected();
+ return r;
+ });
+ if (t.thrown) return null;
+ if (t.error) this.state = t.failState;
+ e.returnType = t.node.typeAnnotation
+ ? this.finishNode(t.node, 'TypeAnnotation')
+ : null;
+ }
+ return super.parseArrow(e);
+ }
+ shouldParseArrow(e) {
+ return this.match(14) || super.shouldParseArrow(e);
+ }
+ setArrowFunctionParameters(e, t) {
+ if (this.state.noArrowParamsConversionAt.indexOf(e.start) !== -1) {
+ e.params = t;
+ } else {
+ super.setArrowFunctionParameters(e, t);
+ }
+ }
+ checkParams(e, t, r, s = true) {
+ if (
+ r &&
+ this.state.noArrowParamsConversionAt.indexOf(e.start) !== -1
+ ) {
+ return;
+ }
+ for (let t = 0; t < e.params.length; t++) {
+ if (this.isThisParam(e.params[t]) && t > 0) {
+ this.raise(Z.ThisParamMustBeFirst, { at: e.params[t] });
+ }
+ }
+ super.checkParams(e, t, r, s);
+ }
+ parseParenAndDistinguishExpression(e) {
+ return super.parseParenAndDistinguishExpression(
+ e && this.state.noArrowAt.indexOf(this.state.start) === -1,
+ );
+ }
+ parseSubscripts(e, t, r) {
+ if (
+ e.type === 'Identifier' &&
+ e.name === 'async' &&
+ this.state.noArrowAt.indexOf(t.index) !== -1
+ ) {
+ this.next();
+ const r = this.startNodeAt(t);
+ r.callee = e;
+ r.arguments = super.parseCallExpressionArguments(11, false);
+ e = this.finishNode(r, 'CallExpression');
+ } else if (
+ e.type === 'Identifier' &&
+ e.name === 'async' &&
+ this.match(47)
+ ) {
+ const s = this.state.clone();
+ const i = this.tryParse(
+ (e) => this.parseAsyncArrowWithTypeParameters(t) || e(),
+ s,
+ );
+ if (!i.error && !i.aborted) return i.node;
+ const n = this.tryParse(() => super.parseSubscripts(e, t, r), s);
+ if (n.node && !n.error) return n.node;
+ if (i.node) {
+ this.state = i.failState;
+ return i.node;
+ }
+ if (n.node) {
+ this.state = n.failState;
+ return n.node;
+ }
+ throw i.error || n.error;
+ }
+ return super.parseSubscripts(e, t, r);
+ }
+ parseSubscript(e, t, r, s) {
+ if (this.match(18) && this.isLookaheadToken_lt()) {
+ s.optionalChainMember = true;
+ if (r) {
+ s.stop = true;
+ return e;
+ }
+ this.next();
+ const i = this.startNodeAt(t);
+ i.callee = e;
+ i.typeArguments = this.flowParseTypeParameterInstantiation();
+ this.expect(10);
+ i.arguments = this.parseCallExpressionArguments(11, false);
+ i.optional = true;
+ return this.finishCallExpression(i, true);
+ } else if (!r && this.shouldParseTypes() && this.match(47)) {
+ const r = this.startNodeAt(t);
+ r.callee = e;
+ const i = this.tryParse(() => {
+ r.typeArguments =
+ this.flowParseTypeParameterInstantiationCallOrNew();
+ this.expect(10);
+ r.arguments = super.parseCallExpressionArguments(11, false);
+ if (s.optionalChainMember) {
+ r.optional = false;
+ }
+ return this.finishCallExpression(r, s.optionalChainMember);
+ });
+ if (i.node) {
+ if (i.error) this.state = i.failState;
+ return i.node;
+ }
+ }
+ return super.parseSubscript(e, t, r, s);
+ }
+ parseNewCallee(e) {
+ super.parseNewCallee(e);
+ let t = null;
+ if (this.shouldParseTypes() && this.match(47)) {
+ t = this.tryParse(() =>
+ this.flowParseTypeParameterInstantiationCallOrNew(),
+ ).node;
+ }
+ e.typeArguments = t;
+ }
+ parseAsyncArrowWithTypeParameters(e) {
+ const t = this.startNodeAt(e);
+ this.parseFunctionParams(t, false);
+ if (!this.parseArrow(t)) return;
+ return super.parseArrowExpression(t, undefined, true);
+ }
+ readToken_mult_modulo(e) {
+ const t = this.input.charCodeAt(this.state.pos + 1);
+ if (e === 42 && t === 47 && this.state.hasFlowComment) {
+ this.state.hasFlowComment = false;
+ this.state.pos += 2;
+ this.nextToken();
+ return;
+ }
+ super.readToken_mult_modulo(e);
+ }
+ readToken_pipe_amp(e) {
+ const t = this.input.charCodeAt(this.state.pos + 1);
+ if (e === 124 && t === 125) {
+ this.finishOp(9, 2);
+ return;
+ }
+ super.readToken_pipe_amp(e);
+ }
+ parseTopLevel(e, t) {
+ const r = super.parseTopLevel(e, t);
+ if (this.state.hasFlowComment) {
+ this.raise(Z.UnterminatedFlowComment, {
+ at: this.state.curPosition(),
+ });
+ }
+ return r;
+ }
+ skipBlockComment() {
+ if (this.hasPlugin('flowComments') && this.skipFlowComment()) {
+ if (this.state.hasFlowComment) {
+ throw this.raise(Z.NestedFlowComment, {
+ at: this.state.startLoc,
+ });
+ }
+ this.hasFlowCommentCompletion();
+ const e = this.skipFlowComment();
+ if (e) {
+ this.state.pos += e;
+ this.state.hasFlowComment = true;
+ }
+ return;
+ }
+ return super.skipBlockComment(
+ this.state.hasFlowComment ? '*-/' : '*/',
+ );
+ }
+ skipFlowComment() {
+ const { pos: e } = this.state;
+ let t = 2;
+ while ([32, 9].includes(this.input.charCodeAt(e + t))) {
+ t++;
+ }
+ const r = this.input.charCodeAt(t + e);
+ const s = this.input.charCodeAt(t + e + 1);
+ if (r === 58 && s === 58) {
+ return t + 2;
+ }
+ if (this.input.slice(t + e, t + e + 12) === 'flow-include') {
+ return t + 12;
+ }
+ if (r === 58 && s !== 58) {
+ return t;
+ }
+ return false;
+ }
+ hasFlowCommentCompletion() {
+ const e = this.input.indexOf('*/', this.state.pos);
+ if (e === -1) {
+ throw this.raise(u.UnterminatedComment, {
+ at: this.state.curPosition(),
+ });
+ }
+ }
+ flowEnumErrorBooleanMemberNotInitialized(
+ e,
+ { enumName: t, memberName: r },
+ ) {
+ this.raise(Z.EnumBooleanMemberNotInitialized, {
+ at: e,
+ memberName: r,
+ enumName: t,
+ });
+ }
+ flowEnumErrorInvalidMemberInitializer(e, t) {
+ return this.raise(
+ !t.explicitType
+ ? Z.EnumInvalidMemberInitializerUnknownType
+ : t.explicitType === 'symbol'
+ ? Z.EnumInvalidMemberInitializerSymbolType
+ : Z.EnumInvalidMemberInitializerPrimaryType,
+ Object.assign({ at: e }, t),
+ );
+ }
+ flowEnumErrorNumberMemberNotInitialized(
+ e,
+ { enumName: t, memberName: r },
+ ) {
+ this.raise(Z.EnumNumberMemberNotInitialized, {
+ at: e,
+ enumName: t,
+ memberName: r,
+ });
+ }
+ flowEnumErrorStringMemberInconsistentlyInitialized(
+ e,
+ { enumName: t },
+ ) {
+ this.raise(Z.EnumStringMemberInconsistentlyInitialized, {
+ at: e,
+ enumName: t,
+ });
+ }
+ flowEnumMemberInit() {
+ const e = this.state.startLoc;
+ const endOfInit = () => this.match(12) || this.match(8);
+ switch (this.state.type) {
+ case 134: {
+ const t = this.parseNumericLiteral(this.state.value);
+ if (endOfInit()) {
+ return { type: 'number', loc: t.loc.start, value: t };
+ }
+ return { type: 'invalid', loc: e };
+ }
+ case 133: {
+ const t = this.parseStringLiteral(this.state.value);
+ if (endOfInit()) {
+ return { type: 'string', loc: t.loc.start, value: t };
+ }
+ return { type: 'invalid', loc: e };
+ }
+ case 85:
+ case 86: {
+ const t = this.parseBooleanLiteral(this.match(85));
+ if (endOfInit()) {
+ return { type: 'boolean', loc: t.loc.start, value: t };
+ }
+ return { type: 'invalid', loc: e };
+ }
+ default:
+ return { type: 'invalid', loc: e };
+ }
+ }
+ flowEnumMemberRaw() {
+ const e = this.state.startLoc;
+ const t = this.parseIdentifier(true);
+ const r = this.eat(29)
+ ? this.flowEnumMemberInit()
+ : { type: 'none', loc: e };
+ return { id: t, init: r };
+ }
+ flowEnumCheckExplicitTypeMismatch(e, t, r) {
+ const { explicitType: s } = t;
+ if (s === null) {
+ return;
+ }
+ if (s !== r) {
+ this.flowEnumErrorInvalidMemberInitializer(e, t);
+ }
+ }
+ flowEnumMembers({ enumName: e, explicitType: t }) {
+ const r = new Set();
+ const s = {
+ booleanMembers: [],
+ numberMembers: [],
+ stringMembers: [],
+ defaultedMembers: [],
+ };
+ let i = false;
+ while (!this.match(8)) {
+ if (this.eat(21)) {
+ i = true;
+ break;
+ }
+ const n = this.startNode();
+ const { id: a, init: o } = this.flowEnumMemberRaw();
+ const l = a.name;
+ if (l === '') {
+ continue;
+ }
+ if (/^[a-z]/.test(l)) {
+ this.raise(Z.EnumInvalidMemberName, {
+ at: a,
+ memberName: l,
+ suggestion: l[0].toUpperCase() + l.slice(1),
+ enumName: e,
+ });
+ }
+ if (r.has(l)) {
+ this.raise(Z.EnumDuplicateMemberName, {
+ at: a,
+ memberName: l,
+ enumName: e,
+ });
+ }
+ r.add(l);
+ const c = { enumName: e, explicitType: t, memberName: l };
+ n.id = a;
+ switch (o.type) {
+ case 'boolean': {
+ this.flowEnumCheckExplicitTypeMismatch(o.loc, c, 'boolean');
+ n.init = o.value;
+ s.booleanMembers.push(
+ this.finishNode(n, 'EnumBooleanMember'),
+ );
+ break;
+ }
+ case 'number': {
+ this.flowEnumCheckExplicitTypeMismatch(o.loc, c, 'number');
+ n.init = o.value;
+ s.numberMembers.push(this.finishNode(n, 'EnumNumberMember'));
+ break;
+ }
+ case 'string': {
+ this.flowEnumCheckExplicitTypeMismatch(o.loc, c, 'string');
+ n.init = o.value;
+ s.stringMembers.push(this.finishNode(n, 'EnumStringMember'));
+ break;
+ }
+ case 'invalid': {
+ throw this.flowEnumErrorInvalidMemberInitializer(o.loc, c);
+ }
+ case 'none': {
+ switch (t) {
+ case 'boolean':
+ this.flowEnumErrorBooleanMemberNotInitialized(o.loc, c);
+ break;
+ case 'number':
+ this.flowEnumErrorNumberMemberNotInitialized(o.loc, c);
+ break;
+ default:
+ s.defaultedMembers.push(
+ this.finishNode(n, 'EnumDefaultedMember'),
+ );
+ }
+ }
+ }
+ if (!this.match(8)) {
+ this.expect(12);
+ }
+ }
+ return { members: s, hasUnknownMembers: i };
+ }
+ flowEnumStringMembers(e, t, { enumName: r }) {
+ if (e.length === 0) {
+ return t;
+ } else if (t.length === 0) {
+ return e;
+ } else if (t.length > e.length) {
+ for (const t of e) {
+ this.flowEnumErrorStringMemberInconsistentlyInitialized(t, {
+ enumName: r,
+ });
+ }
+ return t;
+ } else {
+ for (const e of t) {
+ this.flowEnumErrorStringMemberInconsistentlyInitialized(e, {
+ enumName: r,
+ });
+ }
+ return e;
+ }
+ }
+ flowEnumParseExplicitType({ enumName: e }) {
+ if (!this.eatContextual(102)) return null;
+ if (!tokenIsIdentifier(this.state.type)) {
+ throw this.raise(Z.EnumInvalidExplicitTypeUnknownSupplied, {
+ at: this.state.startLoc,
+ enumName: e,
+ });
+ }
+ const { value: t } = this.state;
+ this.next();
+ if (
+ t !== 'boolean' &&
+ t !== 'number' &&
+ t !== 'string' &&
+ t !== 'symbol'
+ ) {
+ this.raise(Z.EnumInvalidExplicitType, {
+ at: this.state.startLoc,
+ enumName: e,
+ invalidEnumType: t,
+ });
+ }
+ return t;
+ }
+ flowEnumBody(e, t) {
+ const r = t.name;
+ const s = t.loc.start;
+ const i = this.flowEnumParseExplicitType({ enumName: r });
+ this.expect(5);
+ const { members: n, hasUnknownMembers: a } = this.flowEnumMembers({
+ enumName: r,
+ explicitType: i,
+ });
+ e.hasUnknownMembers = a;
+ switch (i) {
+ case 'boolean':
+ e.explicitType = true;
+ e.members = n.booleanMembers;
+ this.expect(8);
+ return this.finishNode(e, 'EnumBooleanBody');
+ case 'number':
+ e.explicitType = true;
+ e.members = n.numberMembers;
+ this.expect(8);
+ return this.finishNode(e, 'EnumNumberBody');
+ case 'string':
+ e.explicitType = true;
+ e.members = this.flowEnumStringMembers(
+ n.stringMembers,
+ n.defaultedMembers,
+ { enumName: r },
+ );
+ this.expect(8);
+ return this.finishNode(e, 'EnumStringBody');
+ case 'symbol':
+ e.members = n.defaultedMembers;
+ this.expect(8);
+ return this.finishNode(e, 'EnumSymbolBody');
+ default: {
+ const empty = () => {
+ e.members = [];
+ this.expect(8);
+ return this.finishNode(e, 'EnumStringBody');
+ };
+ e.explicitType = false;
+ const t = n.booleanMembers.length;
+ const i = n.numberMembers.length;
+ const a = n.stringMembers.length;
+ const o = n.defaultedMembers.length;
+ if (!t && !i && !a && !o) {
+ return empty();
+ } else if (!t && !i) {
+ e.members = this.flowEnumStringMembers(
+ n.stringMembers,
+ n.defaultedMembers,
+ { enumName: r },
+ );
+ this.expect(8);
+ return this.finishNode(e, 'EnumStringBody');
+ } else if (!i && !a && t >= o) {
+ for (const e of n.defaultedMembers) {
+ this.flowEnumErrorBooleanMemberNotInitialized(e.loc.start, {
+ enumName: r,
+ memberName: e.id.name,
+ });
+ }
+ e.members = n.booleanMembers;
+ this.expect(8);
+ return this.finishNode(e, 'EnumBooleanBody');
+ } else if (!t && !a && i >= o) {
+ for (const e of n.defaultedMembers) {
+ this.flowEnumErrorNumberMemberNotInitialized(e.loc.start, {
+ enumName: r,
+ memberName: e.id.name,
+ });
+ }
+ e.members = n.numberMembers;
+ this.expect(8);
+ return this.finishNode(e, 'EnumNumberBody');
+ } else {
+ this.raise(Z.EnumInconsistentMemberValues, {
+ at: s,
+ enumName: r,
+ });
+ return empty();
+ }
+ }
+ }
+ }
+ flowParseEnumDeclaration(e) {
+ const t = this.parseIdentifier();
+ e.id = t;
+ e.body = this.flowEnumBody(this.startNode(), t);
+ return this.finishNode(e, 'EnumDeclaration');
+ }
+ isLookaheadToken_lt() {
+ const e = this.nextTokenStart();
+ if (this.input.charCodeAt(e) === 60) {
+ const t = this.input.charCodeAt(e + 1);
+ return t !== 60 && t !== 61;
+ }
+ return false;
+ }
+ maybeUnwrapTypeCastExpression(e) {
+ return e.type === 'TypeCastExpression' ? e.expression : e;
+ }
+ };
+ const re = {
+ __proto__: null,
+ quot: '"',
+ amp: '&',
+ apos: "'",
+ lt: '<',
+ gt: '>',
+ nbsp: ' ',
+ iexcl: '¡',
+ cent: '¢',
+ pound: '£',
+ curren: '¤',
+ yen: '¥',
+ brvbar: '¦',
+ sect: '§',
+ uml: '¨',
+ copy: '©',
+ ordf: 'ª',
+ laquo: '«',
+ not: '¬',
+ shy: '',
+ reg: '®',
+ macr: '¯',
+ deg: '°',
+ plusmn: '±',
+ sup2: '²',
+ sup3: '³',
+ acute: '´',
+ micro: 'µ',
+ para: '¶',
+ middot: '·',
+ cedil: '¸',
+ sup1: '¹',
+ ordm: 'º',
+ raquo: '»',
+ frac14: '¼',
+ frac12: '½',
+ frac34: '¾',
+ iquest: '¿',
+ Agrave: 'À',
+ Aacute: 'Á',
+ Acirc: 'Â',
+ Atilde: 'Ã',
+ Auml: 'Ä',
+ Aring: 'Å',
+ AElig: 'Æ',
+ Ccedil: 'Ç',
+ Egrave: 'È',
+ Eacute: 'É',
+ Ecirc: 'Ê',
+ Euml: 'Ë',
+ Igrave: 'Ì',
+ Iacute: 'Í',
+ Icirc: 'Î',
+ Iuml: 'Ï',
+ ETH: 'Ð',
+ Ntilde: 'Ñ',
+ Ograve: 'Ò',
+ Oacute: 'Ó',
+ Ocirc: 'Ô',
+ Otilde: 'Õ',
+ Ouml: 'Ö',
+ times: '×',
+ Oslash: 'Ø',
+ Ugrave: 'Ù',
+ Uacute: 'Ú',
+ Ucirc: 'Û',
+ Uuml: 'Ü',
+ Yacute: 'Ý',
+ THORN: 'Þ',
+ szlig: 'ß',
+ agrave: 'à',
+ aacute: 'á',
+ acirc: 'â',
+ atilde: 'ã',
+ auml: 'ä',
+ aring: 'å',
+ aelig: 'æ',
+ ccedil: 'ç',
+ egrave: 'è',
+ eacute: 'é',
+ ecirc: 'ê',
+ euml: 'ë',
+ igrave: 'ì',
+ iacute: 'í',
+ icirc: 'î',
+ iuml: 'ï',
+ eth: 'ð',
+ ntilde: 'ñ',
+ ograve: 'ò',
+ oacute: 'ó',
+ ocirc: 'ô',
+ otilde: 'õ',
+ ouml: 'ö',
+ divide: '÷',
+ oslash: 'ø',
+ ugrave: 'ù',
+ uacute: 'ú',
+ ucirc: 'û',
+ uuml: 'ü',
+ yacute: 'ý',
+ thorn: 'þ',
+ yuml: 'ÿ',
+ OElig: 'Œ',
+ oelig: 'œ',
+ Scaron: 'Š',
+ scaron: 'š',
+ Yuml: 'Ÿ',
+ fnof: 'ƒ',
+ circ: 'ˆ',
+ tilde: '˜',
+ Alpha: 'Α',
+ Beta: 'Β',
+ Gamma: 'Γ',
+ Delta: 'Δ',
+ Epsilon: 'Ε',
+ Zeta: 'Ζ',
+ Eta: 'Η',
+ Theta: 'Θ',
+ Iota: 'Ι',
+ Kappa: 'Κ',
+ Lambda: 'Λ',
+ Mu: 'Μ',
+ Nu: 'Ν',
+ Xi: 'Ξ',
+ Omicron: 'Ο',
+ Pi: 'Π',
+ Rho: 'Ρ',
+ Sigma: 'Σ',
+ Tau: 'Τ',
+ Upsilon: 'Υ',
+ Phi: 'Φ',
+ Chi: 'Χ',
+ Psi: 'Ψ',
+ Omega: 'Ω',
+ alpha: 'α',
+ beta: 'β',
+ gamma: 'γ',
+ delta: 'δ',
+ epsilon: 'ε',
+ zeta: 'ζ',
+ eta: 'η',
+ theta: 'θ',
+ iota: 'ι',
+ kappa: 'κ',
+ lambda: 'λ',
+ mu: 'μ',
+ nu: 'ν',
+ xi: 'ξ',
+ omicron: 'ο',
+ pi: 'π',
+ rho: 'ρ',
+ sigmaf: 'ς',
+ sigma: 'σ',
+ tau: 'τ',
+ upsilon: 'υ',
+ phi: 'φ',
+ chi: 'χ',
+ psi: 'ψ',
+ omega: 'ω',
+ thetasym: 'ϑ',
+ upsih: 'ϒ',
+ piv: 'ϖ',
+ ensp: ' ',
+ emsp: ' ',
+ thinsp: ' ',
+ zwnj: '',
+ zwj: '',
+ lrm: '',
+ rlm: '',
+ ndash: '–',
+ mdash: '—',
+ lsquo: '‘',
+ rsquo: '’',
+ sbquo: '‚',
+ ldquo: '“',
+ rdquo: '”',
+ bdquo: '„',
+ dagger: '†',
+ Dagger: '‡',
+ bull: '•',
+ hellip: '…',
+ permil: '‰',
+ prime: '′',
+ Prime: '″',
+ lsaquo: '‹',
+ rsaquo: '›',
+ oline: '‾',
+ frasl: '⁄',
+ euro: '€',
+ image: 'ℑ',
+ weierp: '℘',
+ real: 'ℜ',
+ trade: '™',
+ alefsym: 'ℵ',
+ larr: '←',
+ uarr: '↑',
+ rarr: '→',
+ darr: '↓',
+ harr: '↔',
+ crarr: '↵',
+ lArr: '⇐',
+ uArr: '⇑',
+ rArr: '⇒',
+ dArr: '⇓',
+ hArr: '⇔',
+ forall: '∀',
+ part: '∂',
+ exist: '∃',
+ empty: '∅',
+ nabla: '∇',
+ isin: '∈',
+ notin: '∉',
+ ni: '∋',
+ prod: '∏',
+ sum: '∑',
+ minus: '−',
+ lowast: '∗',
+ radic: '√',
+ prop: '∝',
+ infin: '∞',
+ ang: '∠',
+ and: '∧',
+ or: '∨',
+ cap: '∩',
+ cup: '∪',
+ int: '∫',
+ there4: '∴',
+ sim: '∼',
+ cong: '≅',
+ asymp: '≈',
+ ne: '≠',
+ equiv: '≡',
+ le: '≤',
+ ge: '≥',
+ sub: '⊂',
+ sup: '⊃',
+ nsub: '⊄',
+ sube: '⊆',
+ supe: '⊇',
+ oplus: '⊕',
+ otimes: '⊗',
+ perp: '⊥',
+ sdot: '⋅',
+ lceil: '⌈',
+ rceil: '⌉',
+ lfloor: '⌊',
+ rfloor: '⌋',
+ lang: '〈',
+ rang: '〉',
+ loz: '◊',
+ spades: '♠',
+ clubs: '♣',
+ hearts: '♥',
+ diams: '♦',
+ };
+ const se = ParseErrorEnum`jsx`({
+ AttributeIsEmpty:
+ 'JSX attributes must only be assigned a non-empty expression.',
+ MissingClosingTagElement: ({ openingTagName: e }) =>
+ `Expected corresponding JSX closing tag for <${e}>.`,
+ MissingClosingTagFragment:
+ 'Expected corresponding JSX closing tag for <>.',
+ UnexpectedSequenceExpression:
+ 'Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?',
+ UnexpectedToken: ({ unexpected: e, HTMLEntity: t }) =>
+ `Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,
+ UnsupportedJsxValue:
+ 'JSX value should be either an expression or a quoted JSX text.',
+ UnterminatedJsxContent: 'Unterminated JSX contents.',
+ UnwrappedAdjacentJSXElements:
+ 'Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...>?',
+ });
+ function isFragment(e) {
+ return e
+ ? e.type === 'JSXOpeningFragment' || e.type === 'JSXClosingFragment'
+ : false;
+ }
+ function getQualifiedJSXName(e) {
+ if (e.type === 'JSXIdentifier') {
+ return e.name;
+ }
+ if (e.type === 'JSXNamespacedName') {
+ return e.namespace.name + ':' + e.name.name;
+ }
+ if (e.type === 'JSXMemberExpression') {
+ return (
+ getQualifiedJSXName(e.object) +
+ '.' +
+ getQualifiedJSXName(e.property)
+ );
+ }
+ throw new Error('Node had unexpected type: ' + e.type);
+ }
+ var jsx = (e) =>
+ class JSXParserMixin extends e {
+ jsxReadToken() {
+ let e = '';
+ let t = this.state.pos;
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(se.UnterminatedJsxContent, {
+ at: this.state.startLoc,
+ });
+ }
+ const r = this.input.charCodeAt(this.state.pos);
+ switch (r) {
+ case 60:
+ case 123:
+ if (this.state.pos === this.state.start) {
+ if (r === 60 && this.state.canStartJSXElement) {
+ ++this.state.pos;
+ this.finishToken(142);
+ } else {
+ super.getTokenFromCode(r);
+ }
+ return;
+ }
+ e += this.input.slice(t, this.state.pos);
+ this.finishToken(141, e);
+ return;
+ case 38:
+ e += this.input.slice(t, this.state.pos);
+ e += this.jsxReadEntity();
+ t = this.state.pos;
+ break;
+ case 62:
+ case 125:
+ default:
+ if (isNewLine(r)) {
+ e += this.input.slice(t, this.state.pos);
+ e += this.jsxReadNewLine(true);
+ t = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+ }
+ }
+ jsxReadNewLine(e) {
+ const t = this.input.charCodeAt(this.state.pos);
+ let r;
+ ++this.state.pos;
+ if (t === 13 && this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ r = e ? '\n' : '\r\n';
+ } else {
+ r = String.fromCharCode(t);
+ }
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ return r;
+ }
+ jsxReadString(e) {
+ let t = '';
+ let r = ++this.state.pos;
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(u.UnterminatedString, {
+ at: this.state.startLoc,
+ });
+ }
+ const s = this.input.charCodeAt(this.state.pos);
+ if (s === e) break;
+ if (s === 38) {
+ t += this.input.slice(r, this.state.pos);
+ t += this.jsxReadEntity();
+ r = this.state.pos;
+ } else if (isNewLine(s)) {
+ t += this.input.slice(r, this.state.pos);
+ t += this.jsxReadNewLine(false);
+ r = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+ t += this.input.slice(r, this.state.pos++);
+ this.finishToken(133, t);
+ }
+ jsxReadEntity() {
+ const e = ++this.state.pos;
+ if (this.codePointAtPos(this.state.pos) === 35) {
+ ++this.state.pos;
+ let e = 10;
+ if (this.codePointAtPos(this.state.pos) === 120) {
+ e = 16;
+ ++this.state.pos;
+ }
+ const t = this.readInt(e, undefined, false, 'bail');
+ if (t !== null && this.codePointAtPos(this.state.pos) === 59) {
+ ++this.state.pos;
+ return String.fromCodePoint(t);
+ }
+ } else {
+ let t = 0;
+ let r = false;
+ while (
+ t++ < 10 &&
+ this.state.pos < this.length &&
+ !(r = this.codePointAtPos(this.state.pos) == 59)
+ ) {
+ ++this.state.pos;
+ }
+ if (r) {
+ const t = this.input.slice(e, this.state.pos);
+ const r = re[t];
+ ++this.state.pos;
+ if (r) {
+ return r;
+ }
+ }
+ }
+ this.state.pos = e;
+ return '&';
+ }
+ jsxReadWord() {
+ let e;
+ const t = this.state.pos;
+ do {
+ e = this.input.charCodeAt(++this.state.pos);
+ } while (isIdentifierChar(e) || e === 45);
+ this.finishToken(140, this.input.slice(t, this.state.pos));
+ }
+ jsxParseIdentifier() {
+ const e = this.startNode();
+ if (this.match(140)) {
+ e.name = this.state.value;
+ } else if (tokenIsKeyword(this.state.type)) {
+ e.name = tokenLabelName(this.state.type);
+ } else {
+ this.unexpected();
+ }
+ this.next();
+ return this.finishNode(e, 'JSXIdentifier');
+ }
+ jsxParseNamespacedName() {
+ const e = this.state.startLoc;
+ const t = this.jsxParseIdentifier();
+ if (!this.eat(14)) return t;
+ const r = this.startNodeAt(e);
+ r.namespace = t;
+ r.name = this.jsxParseIdentifier();
+ return this.finishNode(r, 'JSXNamespacedName');
+ }
+ jsxParseElementName() {
+ const e = this.state.startLoc;
+ let t = this.jsxParseNamespacedName();
+ if (t.type === 'JSXNamespacedName') {
+ return t;
+ }
+ while (this.eat(16)) {
+ const r = this.startNodeAt(e);
+ r.object = t;
+ r.property = this.jsxParseIdentifier();
+ t = this.finishNode(r, 'JSXMemberExpression');
+ }
+ return t;
+ }
+ jsxParseAttributeValue() {
+ let e;
+ switch (this.state.type) {
+ case 5:
+ e = this.startNode();
+ this.setContext(f.brace);
+ this.next();
+ e = this.jsxParseExpressionContainer(e, f.j_oTag);
+ if (e.expression.type === 'JSXEmptyExpression') {
+ this.raise(se.AttributeIsEmpty, { at: e });
+ }
+ return e;
+ case 142:
+ case 133:
+ return this.parseExprAtom();
+ default:
+ throw this.raise(se.UnsupportedJsxValue, {
+ at: this.state.startLoc,
+ });
+ }
+ }
+ jsxParseEmptyExpression() {
+ const e = this.startNodeAt(this.state.lastTokEndLoc);
+ return this.finishNodeAt(
+ e,
+ 'JSXEmptyExpression',
+ this.state.startLoc,
+ );
+ }
+ jsxParseSpreadChild(e) {
+ this.next();
+ e.expression = this.parseExpression();
+ this.setContext(f.j_expr);
+ this.state.canStartJSXElement = true;
+ this.expect(8);
+ return this.finishNode(e, 'JSXSpreadChild');
+ }
+ jsxParseExpressionContainer(e, t) {
+ if (this.match(8)) {
+ e.expression = this.jsxParseEmptyExpression();
+ } else {
+ const t = this.parseExpression();
+ e.expression = t;
+ }
+ this.setContext(t);
+ this.state.canStartJSXElement = true;
+ this.expect(8);
+ return this.finishNode(e, 'JSXExpressionContainer');
+ }
+ jsxParseAttribute() {
+ const e = this.startNode();
+ if (this.match(5)) {
+ this.setContext(f.brace);
+ this.next();
+ this.expect(21);
+ e.argument = this.parseMaybeAssignAllowIn();
+ this.setContext(f.j_oTag);
+ this.state.canStartJSXElement = true;
+ this.expect(8);
+ return this.finishNode(e, 'JSXSpreadAttribute');
+ }
+ e.name = this.jsxParseNamespacedName();
+ e.value = this.eat(29) ? this.jsxParseAttributeValue() : null;
+ return this.finishNode(e, 'JSXAttribute');
+ }
+ jsxParseOpeningElementAt(e) {
+ const t = this.startNodeAt(e);
+ if (this.eat(143)) {
+ return this.finishNode(t, 'JSXOpeningFragment');
+ }
+ t.name = this.jsxParseElementName();
+ return this.jsxParseOpeningElementAfterName(t);
+ }
+ jsxParseOpeningElementAfterName(e) {
+ const t = [];
+ while (!this.match(56) && !this.match(143)) {
+ t.push(this.jsxParseAttribute());
+ }
+ e.attributes = t;
+ e.selfClosing = this.eat(56);
+ this.expect(143);
+ return this.finishNode(e, 'JSXOpeningElement');
+ }
+ jsxParseClosingElementAt(e) {
+ const t = this.startNodeAt(e);
+ if (this.eat(143)) {
+ return this.finishNode(t, 'JSXClosingFragment');
+ }
+ t.name = this.jsxParseElementName();
+ this.expect(143);
+ return this.finishNode(t, 'JSXClosingElement');
+ }
+ jsxParseElementAt(e) {
+ const t = this.startNodeAt(e);
+ const r = [];
+ const s = this.jsxParseOpeningElementAt(e);
+ let i = null;
+ if (!s.selfClosing) {
+ e: for (;;) {
+ switch (this.state.type) {
+ case 142:
+ e = this.state.startLoc;
+ this.next();
+ if (this.eat(56)) {
+ i = this.jsxParseClosingElementAt(e);
+ break e;
+ }
+ r.push(this.jsxParseElementAt(e));
+ break;
+ case 141:
+ r.push(this.parseExprAtom());
+ break;
+ case 5: {
+ const e = this.startNode();
+ this.setContext(f.brace);
+ this.next();
+ if (this.match(21)) {
+ r.push(this.jsxParseSpreadChild(e));
+ } else {
+ r.push(this.jsxParseExpressionContainer(e, f.j_expr));
+ }
+ break;
+ }
+ default:
+ this.unexpected();
+ }
+ }
+ if (isFragment(s) && !isFragment(i) && i !== null) {
+ this.raise(se.MissingClosingTagFragment, { at: i });
+ } else if (!isFragment(s) && isFragment(i)) {
+ this.raise(se.MissingClosingTagElement, {
+ at: i,
+ openingTagName: getQualifiedJSXName(s.name),
+ });
+ } else if (!isFragment(s) && !isFragment(i)) {
+ if (
+ getQualifiedJSXName(i.name) !== getQualifiedJSXName(s.name)
+ ) {
+ this.raise(se.MissingClosingTagElement, {
+ at: i,
+ openingTagName: getQualifiedJSXName(s.name),
+ });
+ }
+ }
+ }
+ if (isFragment(s)) {
+ t.openingFragment = s;
+ t.closingFragment = i;
+ } else {
+ t.openingElement = s;
+ t.closingElement = i;
+ }
+ t.children = r;
+ if (this.match(47)) {
+ throw this.raise(se.UnwrappedAdjacentJSXElements, {
+ at: this.state.startLoc,
+ });
+ }
+ return isFragment(s)
+ ? this.finishNode(t, 'JSXFragment')
+ : this.finishNode(t, 'JSXElement');
+ }
+ jsxParseElement() {
+ const e = this.state.startLoc;
+ this.next();
+ return this.jsxParseElementAt(e);
+ }
+ setContext(e) {
+ const { context: t } = this.state;
+ t[t.length - 1] = e;
+ }
+ parseExprAtom(e) {
+ if (this.match(141)) {
+ return this.parseLiteral(this.state.value, 'JSXText');
+ } else if (this.match(142)) {
+ return this.jsxParseElement();
+ } else if (
+ this.match(47) &&
+ this.input.charCodeAt(this.state.pos) !== 33
+ ) {
+ this.replaceToken(142);
+ return this.jsxParseElement();
+ } else {
+ return super.parseExprAtom(e);
+ }
+ }
+ skipSpace() {
+ const e = this.curContext();
+ if (!e.preserveSpace) super.skipSpace();
+ }
+ getTokenFromCode(e) {
+ const t = this.curContext();
+ if (t === f.j_expr) {
+ this.jsxReadToken();
+ return;
+ }
+ if (t === f.j_oTag || t === f.j_cTag) {
+ if (isIdentifierStart(e)) {
+ this.jsxReadWord();
+ return;
+ }
+ if (e === 62) {
+ ++this.state.pos;
+ this.finishToken(143);
+ return;
+ }
+ if ((e === 34 || e === 39) && t === f.j_oTag) {
+ this.jsxReadString(e);
+ return;
+ }
+ }
+ if (
+ e === 60 &&
+ this.state.canStartJSXElement &&
+ this.input.charCodeAt(this.state.pos + 1) !== 33
+ ) {
+ ++this.state.pos;
+ this.finishToken(142);
+ return;
+ }
+ super.getTokenFromCode(e);
+ }
+ updateContext(e) {
+ const { context: t, type: r } = this.state;
+ if (r === 56 && e === 142) {
+ t.splice(-2, 2, f.j_cTag);
+ this.state.canStartJSXElement = false;
+ } else if (r === 142) {
+ t.push(f.j_oTag);
+ } else if (r === 143) {
+ const r = t[t.length - 1];
+ if ((r === f.j_oTag && e === 56) || r === f.j_cTag) {
+ t.pop();
+ this.state.canStartJSXElement = t[t.length - 1] === f.j_expr;
+ } else {
+ this.setContext(f.j_expr);
+ this.state.canStartJSXElement = true;
+ }
+ } else {
+ this.state.canStartJSXElement = tokenComesBeforeExpression(r);
+ }
+ }
+ };
+ class TypeScriptScope extends Scope {
+ constructor(...e) {
+ super(...e);
+ this.types = new Set();
+ this.enums = new Set();
+ this.constEnums = new Set();
+ this.classes = new Set();
+ this.exportOnlyBindings = new Set();
+ }
+ }
+ class TypeScriptScopeHandler extends ScopeHandler {
+ constructor(...e) {
+ super(...e);
+ this.importsStack = [];
+ }
+ createScope(e) {
+ this.importsStack.push(new Set());
+ return new TypeScriptScope(e);
+ }
+ enter(e) {
+ if (e == 256) {
+ this.importsStack.push(new Set());
+ }
+ super.enter(e);
+ }
+ exit() {
+ const e = super.exit();
+ if (e == 256) {
+ this.importsStack.pop();
+ }
+ return e;
+ }
+ hasImport(e, t) {
+ const r = this.importsStack.length;
+ if (this.importsStack[r - 1].has(e)) {
+ return true;
+ }
+ if (!t && r > 1) {
+ for (let t = 0; t < r - 1; t++) {
+ if (this.importsStack[t].has(e)) return true;
+ }
+ }
+ return false;
+ }
+ declareName(e, t, r) {
+ if (t & 4096) {
+ if (this.hasImport(e, true)) {
+ this.parser.raise(u.VarRedeclaration, {
+ at: r,
+ identifierName: e,
+ });
+ }
+ this.importsStack[this.importsStack.length - 1].add(e);
+ return;
+ }
+ const s = this.currentScope();
+ if (t & 1024) {
+ this.maybeExportDefined(s, e);
+ s.exportOnlyBindings.add(e);
+ return;
+ }
+ super.declareName(e, t, r);
+ if (t & 2) {
+ if (!(t & 1)) {
+ this.checkRedeclarationInScope(s, e, t, r);
+ this.maybeExportDefined(s, e);
+ }
+ s.types.add(e);
+ }
+ if (t & 256) s.enums.add(e);
+ if (t & 512) {
+ s.constEnums.add(e);
+ }
+ if (t & 128) s.classes.add(e);
+ }
+ isRedeclaredInScope(e, t, r) {
+ if (e.enums.has(t)) {
+ if (r & 256) {
+ const s = !!(r & 512);
+ const i = e.constEnums.has(t);
+ return s !== i;
+ }
+ return true;
+ }
+ if (r & 128 && e.classes.has(t)) {
+ if (e.lexical.has(t)) {
+ return !!(r & 1);
+ } else {
+ return false;
+ }
+ }
+ if (r & 2 && e.types.has(t)) {
+ return true;
+ }
+ return super.isRedeclaredInScope(e, t, r);
+ }
+ checkLocalExport(e) {
+ const { name: t } = e;
+ if (this.hasImport(t)) return;
+ const r = this.scopeStack.length;
+ for (let e = r - 1; e >= 0; e--) {
+ const r = this.scopeStack[e];
+ if (r.types.has(t) || r.exportOnlyBindings.has(t)) return;
+ }
+ super.checkLocalExport(e);
+ }
+ }
+ const getOwn$1 = (e, t) => Object.hasOwnProperty.call(e, t) && e[t];
+ const unwrapParenthesizedExpression = (e) =>
+ e.type === 'ParenthesizedExpression'
+ ? unwrapParenthesizedExpression(e.expression)
+ : e;
+ class LValParser extends NodeUtils {
+ toAssignable(e, t = false) {
+ var r, s;
+ let i = undefined;
+ if (
+ e.type === 'ParenthesizedExpression' ||
+ ((r = e.extra) != null && r.parenthesized)
+ ) {
+ i = unwrapParenthesizedExpression(e);
+ if (t) {
+ if (i.type === 'Identifier') {
+ this.expressionScope.recordArrowParameterBindingError(
+ u.InvalidParenthesizedAssignment,
+ { at: e },
+ );
+ } else if (
+ i.type !== 'MemberExpression' &&
+ !this.isOptionalMemberExpression(i)
+ ) {
+ this.raise(u.InvalidParenthesizedAssignment, { at: e });
+ }
+ } else {
+ this.raise(u.InvalidParenthesizedAssignment, { at: e });
+ }
+ }
+ switch (e.type) {
+ case 'Identifier':
+ case 'ObjectPattern':
+ case 'ArrayPattern':
+ case 'AssignmentPattern':
+ case 'RestElement':
+ break;
+ case 'ObjectExpression':
+ e.type = 'ObjectPattern';
+ for (let r = 0, s = e.properties.length, i = s - 1; r < s; r++) {
+ var n;
+ const s = e.properties[r];
+ const a = r === i;
+ this.toAssignableObjectExpressionProp(s, a, t);
+ if (
+ a &&
+ s.type === 'RestElement' &&
+ (n = e.extra) != null &&
+ n.trailingCommaLoc
+ ) {
+ this.raise(u.RestTrailingComma, {
+ at: e.extra.trailingCommaLoc,
+ });
+ }
+ }
+ break;
+ case 'ObjectProperty': {
+ const { key: r, value: s } = e;
+ if (this.isPrivateName(r)) {
+ this.classScope.usePrivateName(
+ this.getPrivateNameSV(r),
+ r.loc.start,
+ );
+ }
+ this.toAssignable(s, t);
+ break;
+ }
+ case 'SpreadElement': {
+ throw new Error(
+ 'Internal @babel/parser error (this is a bug, please report it).' +
+ " SpreadElement should be converted by .toAssignable's caller.",
+ );
+ }
+ case 'ArrayExpression':
+ e.type = 'ArrayPattern';
+ this.toAssignableList(
+ e.elements,
+ (s = e.extra) == null ? void 0 : s.trailingCommaLoc,
+ t,
+ );
+ break;
+ case 'AssignmentExpression':
+ if (e.operator !== '=') {
+ this.raise(u.MissingEqInAssignment, { at: e.left.loc.end });
+ }
+ e.type = 'AssignmentPattern';
+ delete e.operator;
+ this.toAssignable(e.left, t);
+ break;
+ case 'ParenthesizedExpression':
+ this.toAssignable(i, t);
+ break;
+ }
+ }
+ toAssignableObjectExpressionProp(e, t, r) {
+ if (e.type === 'ObjectMethod') {
+ this.raise(
+ e.kind === 'get' || e.kind === 'set'
+ ? u.PatternHasAccessor
+ : u.PatternHasMethod,
+ { at: e.key },
+ );
+ } else if (e.type === 'SpreadElement') {
+ e.type = 'RestElement';
+ const s = e.argument;
+ this.checkToRestConversion(s, false);
+ this.toAssignable(s, r);
+ if (!t) {
+ this.raise(u.RestTrailingComma, { at: e });
+ }
+ } else {
+ this.toAssignable(e, r);
+ }
+ }
+ toAssignableList(e, t, r) {
+ const s = e.length - 1;
+ for (let i = 0; i <= s; i++) {
+ const n = e[i];
+ if (!n) continue;
+ if (n.type === 'SpreadElement') {
+ n.type = 'RestElement';
+ const e = n.argument;
+ this.checkToRestConversion(e, true);
+ this.toAssignable(e, r);
+ } else {
+ this.toAssignable(n, r);
+ }
+ if (n.type === 'RestElement') {
+ if (i < s) {
+ this.raise(u.RestTrailingComma, { at: n });
+ } else if (t) {
+ this.raise(u.RestTrailingComma, { at: t });
+ }
+ }
+ }
+ }
+ isAssignable(e, t) {
+ switch (e.type) {
+ case 'Identifier':
+ case 'ObjectPattern':
+ case 'ArrayPattern':
+ case 'AssignmentPattern':
+ case 'RestElement':
+ return true;
+ case 'ObjectExpression': {
+ const t = e.properties.length - 1;
+ return e.properties.every(
+ (e, r) =>
+ e.type !== 'ObjectMethod' &&
+ (r === t || e.type !== 'SpreadElement') &&
+ this.isAssignable(e),
+ );
+ }
+ case 'ObjectProperty':
+ return this.isAssignable(e.value);
+ case 'SpreadElement':
+ return this.isAssignable(e.argument);
+ case 'ArrayExpression':
+ return e.elements.every(
+ (e) => e === null || this.isAssignable(e),
+ );
+ case 'AssignmentExpression':
+ return e.operator === '=';
+ case 'ParenthesizedExpression':
+ return this.isAssignable(e.expression);
+ case 'MemberExpression':
+ case 'OptionalMemberExpression':
+ return !t;
+ default:
+ return false;
+ }
+ }
+ toReferencedList(e, t) {
+ return e;
+ }
+ toReferencedListDeep(e, t) {
+ this.toReferencedList(e, t);
+ for (const t of e) {
+ if ((t == null ? void 0 : t.type) === 'ArrayExpression') {
+ this.toReferencedListDeep(t.elements);
+ }
+ }
+ }
+ parseSpread(e) {
+ const t = this.startNode();
+ this.next();
+ t.argument = this.parseMaybeAssignAllowIn(e, undefined);
+ return this.finishNode(t, 'SpreadElement');
+ }
+ parseRestBinding() {
+ const e = this.startNode();
+ this.next();
+ e.argument = this.parseBindingAtom();
+ return this.finishNode(e, 'RestElement');
+ }
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case 0: {
+ const e = this.startNode();
+ this.next();
+ e.elements = this.parseBindingList(3, 93, 1);
+ return this.finishNode(e, 'ArrayPattern');
+ }
+ case 5:
+ return this.parseObjectLike(8, true);
+ }
+ return this.parseIdentifier();
+ }
+ parseBindingList(e, t, r) {
+ const s = r & 1;
+ const i = [];
+ let n = true;
+ while (!this.eat(e)) {
+ if (n) {
+ n = false;
+ } else {
+ this.expect(12);
+ }
+ if (s && this.match(12)) {
+ i.push(null);
+ } else if (this.eat(e)) {
+ break;
+ } else if (this.match(21)) {
+ i.push(
+ this.parseAssignableListItemTypes(this.parseRestBinding(), r),
+ );
+ if (!this.checkCommaAfterRest(t)) {
+ this.expect(e);
+ break;
+ }
+ } else {
+ const e = [];
+ if (this.match(26) && this.hasPlugin('decorators')) {
+ this.raise(u.UnsupportedParameterDecorator, {
+ at: this.state.startLoc,
+ });
+ }
+ while (this.match(26)) {
+ e.push(this.parseDecorator());
+ }
+ i.push(this.parseAssignableListItem(r, e));
+ }
+ }
+ return i;
+ }
+ parseBindingRestProperty(e) {
+ this.next();
+ e.argument = this.parseIdentifier();
+ this.checkCommaAfterRest(125);
+ return this.finishNode(e, 'RestElement');
+ }
+ parseBindingProperty() {
+ const e = this.startNode();
+ const { type: t, startLoc: r } = this.state;
+ if (t === 21) {
+ return this.parseBindingRestProperty(e);
+ } else if (t === 138) {
+ this.expectPlugin('destructuringPrivate', r);
+ this.classScope.usePrivateName(this.state.value, r);
+ e.key = this.parsePrivateName();
+ } else {
+ this.parsePropertyName(e);
+ }
+ e.method = false;
+ return this.parseObjPropValue(e, r, false, false, true, false);
+ }
+ parseAssignableListItem(e, t) {
+ const r = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(r, e);
+ const s = this.parseMaybeDefault(r.loc.start, r);
+ if (t.length) {
+ r.decorators = t;
+ }
+ return s;
+ }
+ parseAssignableListItemTypes(e, t) {
+ return e;
+ }
+ parseMaybeDefault(e, t) {
+ var r, s;
+ (r = e) != null ? r : (e = this.state.startLoc);
+ t = (s = t) != null ? s : this.parseBindingAtom();
+ if (!this.eat(29)) return t;
+ const i = this.startNodeAt(e);
+ i.left = t;
+ i.right = this.parseMaybeAssignAllowIn();
+ return this.finishNode(i, 'AssignmentPattern');
+ }
+ isValidLVal(e, t, r) {
+ return getOwn$1(
+ {
+ AssignmentPattern: 'left',
+ RestElement: 'argument',
+ ObjectProperty: 'value',
+ ParenthesizedExpression: 'expression',
+ ArrayPattern: 'elements',
+ ObjectPattern: 'properties',
+ },
+ e,
+ );
+ }
+ isOptionalMemberExpression(e) {
+ return e.type === 'OptionalMemberExpression';
+ }
+ checkLVal(
+ e,
+ {
+ in: t,
+ binding: r = 64,
+ checkClashes: s = false,
+ strictModeChanged: i = false,
+ hasParenthesizedAncestor: n = false,
+ },
+ ) {
+ var a;
+ const o = e.type;
+ if (this.isObjectMethod(e)) return;
+ const l = this.isOptionalMemberExpression(e);
+ if (l || o === 'MemberExpression') {
+ if (l) {
+ this.expectPlugin('optionalChainingAssign', e.loc.start);
+ if (t.type !== 'AssignmentExpression') {
+ this.raise(u.InvalidLhsOptionalChaining, {
+ at: e,
+ ancestor: t,
+ });
+ }
+ }
+ if (r !== 64) {
+ this.raise(u.InvalidPropertyBindingPattern, { at: e });
+ }
+ return;
+ }
+ if (o === 'Identifier') {
+ this.checkIdentifier(e, r, i);
+ const { name: t } = e;
+ if (s) {
+ if (s.has(t)) {
+ this.raise(u.ParamDupe, { at: e });
+ } else {
+ s.add(t);
+ }
+ }
+ return;
+ }
+ const c = this.isValidLVal(
+ o,
+ !(n || ((a = e.extra) != null && a.parenthesized)) &&
+ t.type === 'AssignmentExpression',
+ r,
+ );
+ if (c === true) return;
+ if (c === false) {
+ const s = r === 64 ? u.InvalidLhs : u.InvalidLhsBinding;
+ this.raise(s, { at: e, ancestor: t });
+ return;
+ }
+ const [p, d] = Array.isArray(c)
+ ? c
+ : [c, o === 'ParenthesizedExpression'];
+ const f =
+ o === 'ArrayPattern' || o === 'ObjectPattern' ? { type: o } : t;
+ for (const t of [].concat(e[p])) {
+ if (t) {
+ this.checkLVal(t, {
+ in: f,
+ binding: r,
+ checkClashes: s,
+ strictModeChanged: i,
+ hasParenthesizedAncestor: d,
+ });
+ }
+ }
+ }
+ checkIdentifier(e, t, r = false) {
+ if (
+ this.state.strict &&
+ (r
+ ? isStrictBindReservedWord(e.name, this.inModule)
+ : isStrictBindOnlyReservedWord(e.name))
+ ) {
+ if (t === 64) {
+ this.raise(u.StrictEvalArguments, {
+ at: e,
+ referenceName: e.name,
+ });
+ } else {
+ this.raise(u.StrictEvalArgumentsBinding, {
+ at: e,
+ bindingName: e.name,
+ });
+ }
+ }
+ if (t & 8192 && e.name === 'let') {
+ this.raise(u.LetInLexicalBinding, { at: e });
+ }
+ if (!(t & 64)) {
+ this.declareNameFromIdentifier(e, t);
+ }
+ }
+ declareNameFromIdentifier(e, t) {
+ this.scope.declareName(e.name, t, e.loc.start);
+ }
+ checkToRestConversion(e, t) {
+ switch (e.type) {
+ case 'ParenthesizedExpression':
+ this.checkToRestConversion(e.expression, t);
+ break;
+ case 'Identifier':
+ case 'MemberExpression':
+ break;
+ case 'ArrayExpression':
+ case 'ObjectExpression':
+ if (t) break;
+ default:
+ this.raise(u.InvalidRestAssignmentPattern, { at: e });
+ }
+ }
+ checkCommaAfterRest(e) {
+ if (!this.match(12)) {
+ return false;
+ }
+ this.raise(
+ this.lookaheadCharCode() === e
+ ? u.RestTrailingComma
+ : u.ElementAfterRest,
+ { at: this.state.startLoc },
+ );
+ return true;
+ }
+ }
+ const getOwn = (e, t) => Object.hasOwnProperty.call(e, t) && e[t];
+ function nonNull(e) {
+ if (e == null) {
+ throw new Error(`Unexpected ${e} value.`);
+ }
+ return e;
+ }
+ function assert(e) {
+ if (!e) {
+ throw new Error('Assert fail');
+ }
+ }
+ const ie = ParseErrorEnum`typescript`({
+ AbstractMethodHasImplementation: ({ methodName: e }) =>
+ `Method '${e}' cannot have an implementation because it is marked abstract.`,
+ AbstractPropertyHasInitializer: ({ propertyName: e }) =>
+ `Property '${e}' cannot have an initializer because it is marked abstract.`,
+ AccesorCannotDeclareThisParameter:
+ "'get' and 'set' accessors cannot declare 'this' parameters.",
+ AccesorCannotHaveTypeParameters:
+ 'An accessor cannot have type parameters.',
+ AccessorCannotBeOptional:
+ "An 'accessor' property cannot be declared optional.",
+ ClassMethodHasDeclare:
+ "Class methods cannot have the 'declare' modifier.",
+ ClassMethodHasReadonly:
+ "Class methods cannot have the 'readonly' modifier.",
+ ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:
+ "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
+ ConstructorHasTypeParameters:
+ 'Type parameters cannot appear on a constructor declaration.',
+ DeclareAccessor: ({ kind: e }) =>
+ `'declare' is not allowed in ${e}ters.`,
+ DeclareClassFieldHasInitializer:
+ 'Initializers are not allowed in ambient contexts.',
+ DeclareFunctionHasImplementation:
+ 'An implementation cannot be declared in ambient contexts.',
+ DuplicateAccessibilityModifier: ({ modifier: e }) =>
+ `Accessibility modifier already seen.`,
+ DuplicateModifier: ({ modifier: e }) => `Duplicate modifier: '${e}'.`,
+ EmptyHeritageClauseType: ({ token: e }) =>
+ `'${e}' list cannot be empty.`,
+ EmptyTypeArguments: 'Type argument list cannot be empty.',
+ EmptyTypeParameters: 'Type parameter list cannot be empty.',
+ ExpectedAmbientAfterExportDeclare:
+ "'export declare' must be followed by an ambient declaration.",
+ ImportAliasHasImportType: "An import alias can not use 'import type'.",
+ ImportReflectionHasImportType:
+ 'An `import module` declaration can not use `type` modifier',
+ IncompatibleModifiers: ({ modifiers: e }) =>
+ `'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,
+ IndexSignatureHasAbstract:
+ "Index signatures cannot have the 'abstract' modifier.",
+ IndexSignatureHasAccessibility: ({ modifier: e }) =>
+ `Index signatures cannot have an accessibility modifier ('${e}').`,
+ IndexSignatureHasDeclare:
+ "Index signatures cannot have the 'declare' modifier.",
+ IndexSignatureHasOverride:
+ "'override' modifier cannot appear on an index signature.",
+ IndexSignatureHasStatic:
+ "Index signatures cannot have the 'static' modifier.",
+ InitializerNotAllowedInAmbientContext:
+ 'Initializers are not allowed in ambient contexts.',
+ InvalidModifierOnTypeMember: ({ modifier: e }) =>
+ `'${e}' modifier cannot appear on a type member.`,
+ InvalidModifierOnTypeParameter: ({ modifier: e }) =>
+ `'${e}' modifier cannot appear on a type parameter.`,
+ InvalidModifierOnTypeParameterPositions: ({ modifier: e }) =>
+ `'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,
+ InvalidModifiersOrder: ({ orderedModifiers: e }) =>
+ `'${e[0]}' modifier must precede '${e[1]}' modifier.`,
+ InvalidPropertyAccessAfterInstantiationExpression:
+ 'Invalid property access after an instantiation expression. ' +
+ 'You can either wrap the instantiation expression in parentheses, or delete the type arguments.',
+ InvalidTupleMemberLabel:
+ 'Tuple members must be labeled with a simple identifier.',
+ MissingInterfaceName:
+ "'interface' declarations must be followed by an identifier.",
+ NonAbstractClassHasAbstractMethod:
+ 'Abstract methods can only appear within an abstract class.',
+ NonClassMethodPropertyHasAbstractModifer:
+ "'abstract' modifier can only appear on a class, method, or property declaration.",
+ OptionalTypeBeforeRequired:
+ 'A required element cannot follow an optional element.',
+ OverrideNotInSubClass:
+ "This member cannot have an 'override' modifier because its containing class does not extend another class.",
+ PatternIsOptional:
+ 'A binding pattern parameter cannot be optional in an implementation signature.',
+ PrivateElementHasAbstract:
+ "Private elements cannot have the 'abstract' modifier.",
+ PrivateElementHasAccessibility: ({ modifier: e }) =>
+ `Private elements cannot have an accessibility modifier ('${e}').`,
+ ReadonlyForMethodSignature:
+ "'readonly' modifier can only appear on a property declaration or index signature.",
+ ReservedArrowTypeParam:
+ 'This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.',
+ ReservedTypeAssertion:
+ 'This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.',
+ SetAccesorCannotHaveOptionalParameter:
+ "A 'set' accessor cannot have an optional parameter.",
+ SetAccesorCannotHaveRestParameter:
+ "A 'set' accessor cannot have rest parameter.",
+ SetAccesorCannotHaveReturnType:
+ "A 'set' accessor cannot have a return type annotation.",
+ SingleTypeParameterWithoutTrailingComma: ({ typeParameterName: e }) =>
+ `Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,
+ StaticBlockCannotHaveModifier:
+ 'Static class blocks cannot have any modifier.',
+ TupleOptionalAfterType:
+ 'A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).',
+ TypeAnnotationAfterAssign:
+ 'Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.',
+ TypeImportCannotSpecifyDefaultAndNamed:
+ 'A type-only import can specify a default import or named bindings, but not both.',
+ TypeModifierIsUsedInTypeExports:
+ "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",
+ TypeModifierIsUsedInTypeImports:
+ "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",
+ UnexpectedParameterModifier:
+ 'A parameter property is only allowed in a constructor implementation.',
+ UnexpectedReadonly:
+ "'readonly' type modifier is only permitted on array and tuple literal types.",
+ UnexpectedTypeAnnotation: 'Did not expect a type annotation here.',
+ UnexpectedTypeCastInParameter:
+ 'Unexpected type cast in parameter position.',
+ UnsupportedImportTypeArgument:
+ 'Argument in a type import must be a string literal.',
+ UnsupportedParameterPropertyKind:
+ 'A parameter property may not be declared using a binding pattern.',
+ UnsupportedSignatureParameterKind: ({ type: e }) =>
+ `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,
+ });
+ function keywordTypeFromName(e) {
+ switch (e) {
+ case 'any':
+ return 'TSAnyKeyword';
+ case 'boolean':
+ return 'TSBooleanKeyword';
+ case 'bigint':
+ return 'TSBigIntKeyword';
+ case 'never':
+ return 'TSNeverKeyword';
+ case 'number':
+ return 'TSNumberKeyword';
+ case 'object':
+ return 'TSObjectKeyword';
+ case 'string':
+ return 'TSStringKeyword';
+ case 'symbol':
+ return 'TSSymbolKeyword';
+ case 'undefined':
+ return 'TSUndefinedKeyword';
+ case 'unknown':
+ return 'TSUnknownKeyword';
+ default:
+ return undefined;
+ }
+ }
+ function tsIsAccessModifier(e) {
+ return e === 'private' || e === 'public' || e === 'protected';
+ }
+ function tsIsVarianceAnnotations(e) {
+ return e === 'in' || e === 'out';
+ }
+ var typescript = (e) =>
+ class TypeScriptParserMixin extends e {
+ constructor(...e) {
+ super(...e);
+ this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, {
+ allowedModifiers: ['in', 'out'],
+ disallowedModifiers: [
+ 'const',
+ 'public',
+ 'private',
+ 'protected',
+ 'readonly',
+ 'declare',
+ 'abstract',
+ 'override',
+ ],
+ errorTemplate: ie.InvalidModifierOnTypeParameter,
+ });
+ this.tsParseConstModifier = this.tsParseModifiers.bind(this, {
+ allowedModifiers: ['const'],
+ disallowedModifiers: ['in', 'out'],
+ errorTemplate: ie.InvalidModifierOnTypeParameterPositions,
+ });
+ this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {
+ allowedModifiers: ['in', 'out', 'const'],
+ disallowedModifiers: [
+ 'public',
+ 'private',
+ 'protected',
+ 'readonly',
+ 'declare',
+ 'abstract',
+ 'override',
+ ],
+ errorTemplate: ie.InvalidModifierOnTypeParameter,
+ });
+ }
+ getScopeHandler() {
+ return TypeScriptScopeHandler;
+ }
+ tsIsIdentifier() {
+ return tokenIsIdentifier(this.state.type);
+ }
+ tsTokenCanFollowModifier() {
+ return (
+ (this.match(0) ||
+ this.match(5) ||
+ this.match(55) ||
+ this.match(21) ||
+ this.match(138) ||
+ this.isLiteralPropertyName()) &&
+ !this.hasPrecedingLineBreak()
+ );
+ }
+ tsNextTokenCanFollowModifier() {
+ this.next();
+ return this.tsTokenCanFollowModifier();
+ }
+ tsParseModifier(e, t) {
+ if (
+ !tokenIsIdentifier(this.state.type) &&
+ this.state.type !== 58 &&
+ this.state.type !== 75
+ ) {
+ return undefined;
+ }
+ const r = this.state.value;
+ if (e.indexOf(r) !== -1) {
+ if (t && this.tsIsStartOfStaticBlocks()) {
+ return undefined;
+ }
+ if (
+ this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))
+ ) {
+ return r;
+ }
+ }
+ return undefined;
+ }
+ tsParseModifiers(
+ {
+ allowedModifiers: e,
+ disallowedModifiers: t,
+ stopOnStartOfClassStaticBlock: r,
+ errorTemplate: s = ie.InvalidModifierOnTypeMember,
+ },
+ i,
+ ) {
+ const enforceOrder = (e, t, r, s) => {
+ if (t === r && i[s]) {
+ this.raise(ie.InvalidModifiersOrder, {
+ at: e,
+ orderedModifiers: [r, s],
+ });
+ }
+ };
+ const incompatible = (e, t, r, s) => {
+ if ((i[r] && t === s) || (i[s] && t === r)) {
+ this.raise(ie.IncompatibleModifiers, {
+ at: e,
+ modifiers: [r, s],
+ });
+ }
+ };
+ for (;;) {
+ const { startLoc: n } = this.state;
+ const a = this.tsParseModifier(e.concat(t != null ? t : []), r);
+ if (!a) break;
+ if (tsIsAccessModifier(a)) {
+ if (i.accessibility) {
+ this.raise(ie.DuplicateAccessibilityModifier, {
+ at: n,
+ modifier: a,
+ });
+ } else {
+ enforceOrder(n, a, a, 'override');
+ enforceOrder(n, a, a, 'static');
+ enforceOrder(n, a, a, 'readonly');
+ i.accessibility = a;
+ }
+ } else if (tsIsVarianceAnnotations(a)) {
+ if (i[a]) {
+ this.raise(ie.DuplicateModifier, { at: n, modifier: a });
+ }
+ i[a] = true;
+ enforceOrder(n, a, 'in', 'out');
+ } else {
+ if (Object.hasOwnProperty.call(i, a)) {
+ this.raise(ie.DuplicateModifier, { at: n, modifier: a });
+ } else {
+ enforceOrder(n, a, 'static', 'readonly');
+ enforceOrder(n, a, 'static', 'override');
+ enforceOrder(n, a, 'override', 'readonly');
+ enforceOrder(n, a, 'abstract', 'override');
+ incompatible(n, a, 'declare', 'override');
+ incompatible(n, a, 'static', 'abstract');
+ }
+ i[a] = true;
+ }
+ if (t != null && t.includes(a)) {
+ this.raise(s, { at: n, modifier: a });
+ }
+ }
+ }
+ tsIsListTerminator(e) {
+ switch (e) {
+ case 'EnumMembers':
+ case 'TypeMembers':
+ return this.match(8);
+ case 'HeritageClauseElement':
+ return this.match(5);
+ case 'TupleElementTypes':
+ return this.match(3);
+ case 'TypeParametersOrArguments':
+ return this.match(48);
+ }
+ }
+ tsParseList(e, t) {
+ const r = [];
+ while (!this.tsIsListTerminator(e)) {
+ r.push(t());
+ }
+ return r;
+ }
+ tsParseDelimitedList(e, t, r) {
+ return nonNull(this.tsParseDelimitedListWorker(e, t, true, r));
+ }
+ tsParseDelimitedListWorker(e, t, r, s) {
+ const i = [];
+ let n = -1;
+ for (;;) {
+ if (this.tsIsListTerminator(e)) {
+ break;
+ }
+ n = -1;
+ const s = t();
+ if (s == null) {
+ return undefined;
+ }
+ i.push(s);
+ if (this.eat(12)) {
+ n = this.state.lastTokStart;
+ continue;
+ }
+ if (this.tsIsListTerminator(e)) {
+ break;
+ }
+ if (r) {
+ this.expect(12);
+ }
+ return undefined;
+ }
+ if (s) {
+ s.value = n;
+ }
+ return i;
+ }
+ tsParseBracketedList(e, t, r, s, i) {
+ if (!s) {
+ if (r) {
+ this.expect(0);
+ } else {
+ this.expect(47);
+ }
+ }
+ const n = this.tsParseDelimitedList(e, t, i);
+ if (r) {
+ this.expect(3);
+ } else {
+ this.expect(48);
+ }
+ return n;
+ }
+ tsParseImportType() {
+ const e = this.startNode();
+ this.expect(83);
+ this.expect(10);
+ if (!this.match(133)) {
+ this.raise(ie.UnsupportedImportTypeArgument, {
+ at: this.state.startLoc,
+ });
+ }
+ e.argument = super.parseExprAtom();
+ this.expect(11);
+ if (this.eat(16)) {
+ e.qualifier = this.tsParseEntityName();
+ }
+ if (this.match(47)) {
+ e.typeParameters = this.tsParseTypeArguments();
+ }
+ return this.finishNode(e, 'TSImportType');
+ }
+ tsParseEntityName(e = true) {
+ let t = this.parseIdentifier(e);
+ while (this.eat(16)) {
+ const r = this.startNodeAtNode(t);
+ r.left = t;
+ r.right = this.parseIdentifier(e);
+ t = this.finishNode(r, 'TSQualifiedName');
+ }
+ return t;
+ }
+ tsParseTypeReference() {
+ const e = this.startNode();
+ e.typeName = this.tsParseEntityName();
+ if (!this.hasPrecedingLineBreak() && this.match(47)) {
+ e.typeParameters = this.tsParseTypeArguments();
+ }
+ return this.finishNode(e, 'TSTypeReference');
+ }
+ tsParseThisTypePredicate(e) {
+ this.next();
+ const t = this.startNodeAtNode(e);
+ t.parameterName = e;
+ t.typeAnnotation = this.tsParseTypeAnnotation(false);
+ t.asserts = false;
+ return this.finishNode(t, 'TSTypePredicate');
+ }
+ tsParseThisTypeNode() {
+ const e = this.startNode();
+ this.next();
+ return this.finishNode(e, 'TSThisType');
+ }
+ tsParseTypeQuery() {
+ const e = this.startNode();
+ this.expect(87);
+ if (this.match(83)) {
+ e.exprName = this.tsParseImportType();
+ } else {
+ e.exprName = this.tsParseEntityName();
+ }
+ if (!this.hasPrecedingLineBreak() && this.match(47)) {
+ e.typeParameters = this.tsParseTypeArguments();
+ }
+ return this.finishNode(e, 'TSTypeQuery');
+ }
+ tsParseTypeParameter(e) {
+ const t = this.startNode();
+ e(t);
+ t.name = this.tsParseTypeParameterName();
+ t.constraint = this.tsEatThenParseType(81);
+ t.default = this.tsEatThenParseType(29);
+ return this.finishNode(t, 'TSTypeParameter');
+ }
+ tsTryParseTypeParameters(e) {
+ if (this.match(47)) {
+ return this.tsParseTypeParameters(e);
+ }
+ }
+ tsParseTypeParameters(e) {
+ const t = this.startNode();
+ if (this.match(47) || this.match(142)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+ const r = { value: -1 };
+ t.params = this.tsParseBracketedList(
+ 'TypeParametersOrArguments',
+ this.tsParseTypeParameter.bind(this, e),
+ false,
+ true,
+ r,
+ );
+ if (t.params.length === 0) {
+ this.raise(ie.EmptyTypeParameters, { at: t });
+ }
+ if (r.value !== -1) {
+ this.addExtra(t, 'trailingComma', r.value);
+ }
+ return this.finishNode(t, 'TSTypeParameterDeclaration');
+ }
+ tsFillSignature(e, t) {
+ const r = e === 19;
+ const s = 'parameters';
+ const i = 'typeAnnotation';
+ t.typeParameters = this.tsTryParseTypeParameters(
+ this.tsParseConstModifier,
+ );
+ this.expect(10);
+ t[s] = this.tsParseBindingListForSignature();
+ if (r) {
+ t[i] = this.tsParseTypeOrTypePredicateAnnotation(e);
+ } else if (this.match(e)) {
+ t[i] = this.tsParseTypeOrTypePredicateAnnotation(e);
+ }
+ }
+ tsParseBindingListForSignature() {
+ const e = super.parseBindingList(11, 41, 2);
+ for (const t of e) {
+ const { type: e } = t;
+ if (e === 'AssignmentPattern' || e === 'TSParameterProperty') {
+ this.raise(ie.UnsupportedSignatureParameterKind, {
+ at: t,
+ type: e,
+ });
+ }
+ }
+ return e;
+ }
+ tsParseTypeMemberSemicolon() {
+ if (!this.eat(12) && !this.isLineTerminator()) {
+ this.expect(13);
+ }
+ }
+ tsParseSignatureMember(e, t) {
+ this.tsFillSignature(14, t);
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(t, e);
+ }
+ tsIsUnambiguouslyIndexSignature() {
+ this.next();
+ if (tokenIsIdentifier(this.state.type)) {
+ this.next();
+ return this.match(14);
+ }
+ return false;
+ }
+ tsTryParseIndexSignature(e) {
+ if (
+ !(
+ this.match(0) &&
+ this.tsLookAhead(
+ this.tsIsUnambiguouslyIndexSignature.bind(this),
+ )
+ )
+ ) {
+ return;
+ }
+ this.expect(0);
+ const t = this.parseIdentifier();
+ t.typeAnnotation = this.tsParseTypeAnnotation();
+ this.resetEndLocation(t);
+ this.expect(3);
+ e.parameters = [t];
+ const r = this.tsTryParseTypeAnnotation();
+ if (r) e.typeAnnotation = r;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(e, 'TSIndexSignature');
+ }
+ tsParsePropertyOrMethodSignature(e, t) {
+ if (this.eat(17)) e.optional = true;
+ const r = e;
+ if (this.match(10) || this.match(47)) {
+ if (t) {
+ this.raise(ie.ReadonlyForMethodSignature, { at: e });
+ }
+ const s = r;
+ if (s.kind && this.match(47)) {
+ this.raise(ie.AccesorCannotHaveTypeParameters, {
+ at: this.state.curPosition(),
+ });
+ }
+ this.tsFillSignature(14, s);
+ this.tsParseTypeMemberSemicolon();
+ const i = 'parameters';
+ const n = 'typeAnnotation';
+ if (s.kind === 'get') {
+ if (s[i].length > 0) {
+ this.raise(u.BadGetterArity, {
+ at: this.state.curPosition(),
+ });
+ if (this.isThisParam(s[i][0])) {
+ this.raise(ie.AccesorCannotDeclareThisParameter, {
+ at: this.state.curPosition(),
+ });
+ }
+ }
+ } else if (s.kind === 'set') {
+ if (s[i].length !== 1) {
+ this.raise(u.BadSetterArity, {
+ at: this.state.curPosition(),
+ });
+ } else {
+ const e = s[i][0];
+ if (this.isThisParam(e)) {
+ this.raise(ie.AccesorCannotDeclareThisParameter, {
+ at: this.state.curPosition(),
+ });
+ }
+ if (e.type === 'Identifier' && e.optional) {
+ this.raise(ie.SetAccesorCannotHaveOptionalParameter, {
+ at: this.state.curPosition(),
+ });
+ }
+ if (e.type === 'RestElement') {
+ this.raise(ie.SetAccesorCannotHaveRestParameter, {
+ at: this.state.curPosition(),
+ });
+ }
+ }
+ if (s[n]) {
+ this.raise(ie.SetAccesorCannotHaveReturnType, { at: s[n] });
+ }
+ } else {
+ s.kind = 'method';
+ }
+ return this.finishNode(s, 'TSMethodSignature');
+ } else {
+ const e = r;
+ if (t) e.readonly = true;
+ const s = this.tsTryParseTypeAnnotation();
+ if (s) e.typeAnnotation = s;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(e, 'TSPropertySignature');
+ }
+ }
+ tsParseTypeMember() {
+ const e = this.startNode();
+ if (this.match(10) || this.match(47)) {
+ return this.tsParseSignatureMember(
+ 'TSCallSignatureDeclaration',
+ e,
+ );
+ }
+ if (this.match(77)) {
+ const t = this.startNode();
+ this.next();
+ if (this.match(10) || this.match(47)) {
+ return this.tsParseSignatureMember(
+ 'TSConstructSignatureDeclaration',
+ e,
+ );
+ } else {
+ e.key = this.createIdentifier(t, 'new');
+ return this.tsParsePropertyOrMethodSignature(e, false);
+ }
+ }
+ this.tsParseModifiers(
+ {
+ allowedModifiers: ['readonly'],
+ disallowedModifiers: [
+ 'declare',
+ 'abstract',
+ 'private',
+ 'protected',
+ 'public',
+ 'static',
+ 'override',
+ ],
+ },
+ e,
+ );
+ const t = this.tsTryParseIndexSignature(e);
+ if (t) {
+ return t;
+ }
+ super.parsePropertyName(e);
+ if (
+ !e.computed &&
+ e.key.type === 'Identifier' &&
+ (e.key.name === 'get' || e.key.name === 'set') &&
+ this.tsTokenCanFollowModifier()
+ ) {
+ e.kind = e.key.name;
+ super.parsePropertyName(e);
+ }
+ return this.tsParsePropertyOrMethodSignature(e, !!e.readonly);
+ }
+ tsParseTypeLiteral() {
+ const e = this.startNode();
+ e.members = this.tsParseObjectTypeMembers();
+ return this.finishNode(e, 'TSTypeLiteral');
+ }
+ tsParseObjectTypeMembers() {
+ this.expect(5);
+ const e = this.tsParseList(
+ 'TypeMembers',
+ this.tsParseTypeMember.bind(this),
+ );
+ this.expect(8);
+ return e;
+ }
+ tsIsStartOfMappedType() {
+ this.next();
+ if (this.eat(53)) {
+ return this.isContextual(122);
+ }
+ if (this.isContextual(122)) {
+ this.next();
+ }
+ if (!this.match(0)) {
+ return false;
+ }
+ this.next();
+ if (!this.tsIsIdentifier()) {
+ return false;
+ }
+ this.next();
+ return this.match(58);
+ }
+ tsParseMappedTypeParameter() {
+ const e = this.startNode();
+ e.name = this.tsParseTypeParameterName();
+ e.constraint = this.tsExpectThenParseType(58);
+ return this.finishNode(e, 'TSTypeParameter');
+ }
+ tsParseMappedType() {
+ const e = this.startNode();
+ this.expect(5);
+ if (this.match(53)) {
+ e.readonly = this.state.value;
+ this.next();
+ this.expectContextual(122);
+ } else if (this.eatContextual(122)) {
+ e.readonly = true;
+ }
+ this.expect(0);
+ e.typeParameter = this.tsParseMappedTypeParameter();
+ e.nameType = this.eatContextual(93) ? this.tsParseType() : null;
+ this.expect(3);
+ if (this.match(53)) {
+ e.optional = this.state.value;
+ this.next();
+ this.expect(17);
+ } else if (this.eat(17)) {
+ e.optional = true;
+ }
+ e.typeAnnotation = this.tsTryParseType();
+ this.semicolon();
+ this.expect(8);
+ return this.finishNode(e, 'TSMappedType');
+ }
+ tsParseTupleType() {
+ const e = this.startNode();
+ e.elementTypes = this.tsParseBracketedList(
+ 'TupleElementTypes',
+ this.tsParseTupleElementType.bind(this),
+ true,
+ false,
+ );
+ let t = false;
+ e.elementTypes.forEach((e) => {
+ const { type: r } = e;
+ if (
+ t &&
+ r !== 'TSRestType' &&
+ r !== 'TSOptionalType' &&
+ !(r === 'TSNamedTupleMember' && e.optional)
+ ) {
+ this.raise(ie.OptionalTypeBeforeRequired, { at: e });
+ }
+ t ||
+ (t =
+ (r === 'TSNamedTupleMember' && e.optional) ||
+ r === 'TSOptionalType');
+ });
+ return this.finishNode(e, 'TSTupleType');
+ }
+ tsParseTupleElementType() {
+ const { startLoc: e } = this.state;
+ const t = this.eat(21);
+ let r;
+ let s;
+ let i;
+ let n;
+ const a = tokenIsKeywordOrIdentifier(this.state.type);
+ const o = a ? this.lookaheadCharCode() : null;
+ if (o === 58) {
+ r = true;
+ i = false;
+ s = this.parseIdentifier(true);
+ this.expect(14);
+ n = this.tsParseType();
+ } else if (o === 63) {
+ i = true;
+ const e = this.state.startLoc;
+ const t = this.state.value;
+ const a = this.tsParseNonArrayType();
+ if (this.lookaheadCharCode() === 58) {
+ r = true;
+ s = this.createIdentifier(this.startNodeAt(e), t);
+ this.expect(17);
+ this.expect(14);
+ n = this.tsParseType();
+ } else {
+ r = false;
+ n = a;
+ this.expect(17);
+ }
+ } else {
+ n = this.tsParseType();
+ i = this.eat(17);
+ r = this.eat(14);
+ }
+ if (r) {
+ let e;
+ if (s) {
+ e = this.startNodeAtNode(s);
+ e.optional = i;
+ e.label = s;
+ e.elementType = n;
+ if (this.eat(17)) {
+ e.optional = true;
+ this.raise(ie.TupleOptionalAfterType, {
+ at: this.state.lastTokStartLoc,
+ });
+ }
+ } else {
+ e = this.startNodeAtNode(n);
+ e.optional = i;
+ this.raise(ie.InvalidTupleMemberLabel, { at: n });
+ e.label = n;
+ e.elementType = this.tsParseType();
+ }
+ n = this.finishNode(e, 'TSNamedTupleMember');
+ } else if (i) {
+ const e = this.startNodeAtNode(n);
+ e.typeAnnotation = n;
+ n = this.finishNode(e, 'TSOptionalType');
+ }
+ if (t) {
+ const t = this.startNodeAt(e);
+ t.typeAnnotation = n;
+ n = this.finishNode(t, 'TSRestType');
+ }
+ return n;
+ }
+ tsParseParenthesizedType() {
+ const e = this.startNode();
+ this.expect(10);
+ e.typeAnnotation = this.tsParseType();
+ this.expect(11);
+ return this.finishNode(e, 'TSParenthesizedType');
+ }
+ tsParseFunctionOrConstructorType(e, t) {
+ const r = this.startNode();
+ if (e === 'TSConstructorType') {
+ r.abstract = !!t;
+ if (t) this.next();
+ this.next();
+ }
+ this.tsInAllowConditionalTypesContext(() =>
+ this.tsFillSignature(19, r),
+ );
+ return this.finishNode(r, e);
+ }
+ tsParseLiteralTypeNode() {
+ const e = this.startNode();
+ switch (this.state.type) {
+ case 134:
+ case 135:
+ case 133:
+ case 85:
+ case 86:
+ e.literal = super.parseExprAtom();
+ break;
+ default:
+ this.unexpected();
+ }
+ return this.finishNode(e, 'TSLiteralType');
+ }
+ tsParseTemplateLiteralType() {
+ const e = this.startNode();
+ e.literal = super.parseTemplate(false);
+ return this.finishNode(e, 'TSLiteralType');
+ }
+ parseTemplateSubstitution() {
+ if (this.state.inType) return this.tsParseType();
+ return super.parseTemplateSubstitution();
+ }
+ tsParseThisTypeOrThisTypePredicate() {
+ const e = this.tsParseThisTypeNode();
+ if (this.isContextual(116) && !this.hasPrecedingLineBreak()) {
+ return this.tsParseThisTypePredicate(e);
+ } else {
+ return e;
+ }
+ }
+ tsParseNonArrayType() {
+ switch (this.state.type) {
+ case 133:
+ case 134:
+ case 135:
+ case 85:
+ case 86:
+ return this.tsParseLiteralTypeNode();
+ case 53:
+ if (this.state.value === '-') {
+ const e = this.startNode();
+ const t = this.lookahead();
+ if (t.type !== 134 && t.type !== 135) {
+ this.unexpected();
+ }
+ e.literal = this.parseMaybeUnary();
+ return this.finishNode(e, 'TSLiteralType');
+ }
+ break;
+ case 78:
+ return this.tsParseThisTypeOrThisTypePredicate();
+ case 87:
+ return this.tsParseTypeQuery();
+ case 83:
+ return this.tsParseImportType();
+ case 5:
+ return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))
+ ? this.tsParseMappedType()
+ : this.tsParseTypeLiteral();
+ case 0:
+ return this.tsParseTupleType();
+ case 10:
+ return this.tsParseParenthesizedType();
+ case 25:
+ case 24:
+ return this.tsParseTemplateLiteralType();
+ default: {
+ const { type: e } = this.state;
+ if (tokenIsIdentifier(e) || e === 88 || e === 84) {
+ const t =
+ e === 88
+ ? 'TSVoidKeyword'
+ : e === 84
+ ? 'TSNullKeyword'
+ : keywordTypeFromName(this.state.value);
+ if (t !== undefined && this.lookaheadCharCode() !== 46) {
+ const e = this.startNode();
+ this.next();
+ return this.finishNode(e, t);
+ }
+ return this.tsParseTypeReference();
+ }
+ }
+ }
+ this.unexpected();
+ }
+ tsParseArrayTypeOrHigher() {
+ let e = this.tsParseNonArrayType();
+ while (!this.hasPrecedingLineBreak() && this.eat(0)) {
+ if (this.match(3)) {
+ const t = this.startNodeAtNode(e);
+ t.elementType = e;
+ this.expect(3);
+ e = this.finishNode(t, 'TSArrayType');
+ } else {
+ const t = this.startNodeAtNode(e);
+ t.objectType = e;
+ t.indexType = this.tsParseType();
+ this.expect(3);
+ e = this.finishNode(t, 'TSIndexedAccessType');
+ }
+ }
+ return e;
+ }
+ tsParseTypeOperator() {
+ const e = this.startNode();
+ const t = this.state.value;
+ this.next();
+ e.operator = t;
+ e.typeAnnotation = this.tsParseTypeOperatorOrHigher();
+ if (t === 'readonly') {
+ this.tsCheckTypeAnnotationForReadOnly(e);
+ }
+ return this.finishNode(e, 'TSTypeOperator');
+ }
+ tsCheckTypeAnnotationForReadOnly(e) {
+ switch (e.typeAnnotation.type) {
+ case 'TSTupleType':
+ case 'TSArrayType':
+ return;
+ default:
+ this.raise(ie.UnexpectedReadonly, { at: e });
+ }
+ }
+ tsParseInferType() {
+ const e = this.startNode();
+ this.expectContextual(115);
+ const t = this.startNode();
+ t.name = this.tsParseTypeParameterName();
+ t.constraint = this.tsTryParse(() =>
+ this.tsParseConstraintForInferType(),
+ );
+ e.typeParameter = this.finishNode(t, 'TSTypeParameter');
+ return this.finishNode(e, 'TSInferType');
+ }
+ tsParseConstraintForInferType() {
+ if (this.eat(81)) {
+ const e = this.tsInDisallowConditionalTypesContext(() =>
+ this.tsParseType(),
+ );
+ if (
+ this.state.inDisallowConditionalTypesContext ||
+ !this.match(17)
+ ) {
+ return e;
+ }
+ }
+ }
+ tsParseTypeOperatorOrHigher() {
+ const e =
+ tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;
+ return e
+ ? this.tsParseTypeOperator()
+ : this.isContextual(115)
+ ? this.tsParseInferType()
+ : this.tsInAllowConditionalTypesContext(() =>
+ this.tsParseArrayTypeOrHigher(),
+ );
+ }
+ tsParseUnionOrIntersectionType(e, t, r) {
+ const s = this.startNode();
+ const i = this.eat(r);
+ const n = [];
+ do {
+ n.push(t());
+ } while (this.eat(r));
+ if (n.length === 1 && !i) {
+ return n[0];
+ }
+ s.types = n;
+ return this.finishNode(s, e);
+ }
+ tsParseIntersectionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType(
+ 'TSIntersectionType',
+ this.tsParseTypeOperatorOrHigher.bind(this),
+ 45,
+ );
+ }
+ tsParseUnionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType(
+ 'TSUnionType',
+ this.tsParseIntersectionTypeOrHigher.bind(this),
+ 43,
+ );
+ }
+ tsIsStartOfFunctionType() {
+ if (this.match(47)) {
+ return true;
+ }
+ return (
+ this.match(10) &&
+ this.tsLookAhead(
+ this.tsIsUnambiguouslyStartOfFunctionType.bind(this),
+ )
+ );
+ }
+ tsSkipParameterStart() {
+ if (tokenIsIdentifier(this.state.type) || this.match(78)) {
+ this.next();
+ return true;
+ }
+ if (this.match(5)) {
+ const { errors: e } = this.state;
+ const t = e.length;
+ try {
+ this.parseObjectLike(8, true);
+ return e.length === t;
+ } catch (e) {
+ return false;
+ }
+ }
+ if (this.match(0)) {
+ this.next();
+ const { errors: e } = this.state;
+ const t = e.length;
+ try {
+ super.parseBindingList(3, 93, 1);
+ return e.length === t;
+ } catch (e) {
+ return false;
+ }
+ }
+ return false;
+ }
+ tsIsUnambiguouslyStartOfFunctionType() {
+ this.next();
+ if (this.match(11) || this.match(21)) {
+ return true;
+ }
+ if (this.tsSkipParameterStart()) {
+ if (
+ this.match(14) ||
+ this.match(12) ||
+ this.match(17) ||
+ this.match(29)
+ ) {
+ return true;
+ }
+ if (this.match(11)) {
+ this.next();
+ if (this.match(19)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ tsParseTypeOrTypePredicateAnnotation(e) {
+ return this.tsInType(() => {
+ const t = this.startNode();
+ this.expect(e);
+ const r = this.startNode();
+ const s = !!this.tsTryParse(
+ this.tsParseTypePredicateAsserts.bind(this),
+ );
+ if (s && this.match(78)) {
+ let e = this.tsParseThisTypeOrThisTypePredicate();
+ if (e.type === 'TSThisType') {
+ r.parameterName = e;
+ r.asserts = true;
+ r.typeAnnotation = null;
+ e = this.finishNode(r, 'TSTypePredicate');
+ } else {
+ this.resetStartLocationFromNode(e, r);
+ e.asserts = true;
+ }
+ t.typeAnnotation = e;
+ return this.finishNode(t, 'TSTypeAnnotation');
+ }
+ const i =
+ this.tsIsIdentifier() &&
+ this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
+ if (!i) {
+ if (!s) {
+ return this.tsParseTypeAnnotation(false, t);
+ }
+ r.parameterName = this.parseIdentifier();
+ r.asserts = s;
+ r.typeAnnotation = null;
+ t.typeAnnotation = this.finishNode(r, 'TSTypePredicate');
+ return this.finishNode(t, 'TSTypeAnnotation');
+ }
+ const n = this.tsParseTypeAnnotation(false);
+ r.parameterName = i;
+ r.typeAnnotation = n;
+ r.asserts = s;
+ t.typeAnnotation = this.finishNode(r, 'TSTypePredicate');
+ return this.finishNode(t, 'TSTypeAnnotation');
+ });
+ }
+ tsTryParseTypeOrTypePredicateAnnotation() {
+ if (this.match(14)) {
+ return this.tsParseTypeOrTypePredicateAnnotation(14);
+ }
+ }
+ tsTryParseTypeAnnotation() {
+ if (this.match(14)) {
+ return this.tsParseTypeAnnotation();
+ }
+ }
+ tsTryParseType() {
+ return this.tsEatThenParseType(14);
+ }
+ tsParseTypePredicatePrefix() {
+ const e = this.parseIdentifier();
+ if (this.isContextual(116) && !this.hasPrecedingLineBreak()) {
+ this.next();
+ return e;
+ }
+ }
+ tsParseTypePredicateAsserts() {
+ if (this.state.type !== 109) {
+ return false;
+ }
+ const e = this.state.containsEsc;
+ this.next();
+ if (!tokenIsIdentifier(this.state.type) && !this.match(78)) {
+ return false;
+ }
+ if (e) {
+ this.raise(u.InvalidEscapedReservedWord, {
+ at: this.state.lastTokStartLoc,
+ reservedWord: 'asserts',
+ });
+ }
+ return true;
+ }
+ tsParseTypeAnnotation(e = true, t = this.startNode()) {
+ this.tsInType(() => {
+ if (e) this.expect(14);
+ t.typeAnnotation = this.tsParseType();
+ });
+ return this.finishNode(t, 'TSTypeAnnotation');
+ }
+ tsParseType() {
+ assert(this.state.inType);
+ const e = this.tsParseNonConditionalType();
+ if (
+ this.state.inDisallowConditionalTypesContext ||
+ this.hasPrecedingLineBreak() ||
+ !this.eat(81)
+ ) {
+ return e;
+ }
+ const t = this.startNodeAtNode(e);
+ t.checkType = e;
+ t.extendsType = this.tsInDisallowConditionalTypesContext(() =>
+ this.tsParseNonConditionalType(),
+ );
+ this.expect(17);
+ t.trueType = this.tsInAllowConditionalTypesContext(() =>
+ this.tsParseType(),
+ );
+ this.expect(14);
+ t.falseType = this.tsInAllowConditionalTypesContext(() =>
+ this.tsParseType(),
+ );
+ return this.finishNode(t, 'TSConditionalType');
+ }
+ isAbstractConstructorSignature() {
+ return this.isContextual(124) && this.lookahead().type === 77;
+ }
+ tsParseNonConditionalType() {
+ if (this.tsIsStartOfFunctionType()) {
+ return this.tsParseFunctionOrConstructorType('TSFunctionType');
+ }
+ if (this.match(77)) {
+ return this.tsParseFunctionOrConstructorType('TSConstructorType');
+ } else if (this.isAbstractConstructorSignature()) {
+ return this.tsParseFunctionOrConstructorType(
+ 'TSConstructorType',
+ true,
+ );
+ }
+ return this.tsParseUnionTypeOrHigher();
+ }
+ tsParseTypeAssertion() {
+ if (
+ this.getPluginOption('typescript', 'disallowAmbiguousJSXLike')
+ ) {
+ this.raise(ie.ReservedTypeAssertion, { at: this.state.startLoc });
+ }
+ const e = this.startNode();
+ e.typeAnnotation = this.tsInType(() => {
+ this.next();
+ return this.match(75)
+ ? this.tsParseTypeReference()
+ : this.tsParseType();
+ });
+ this.expect(48);
+ e.expression = this.parseMaybeUnary();
+ return this.finishNode(e, 'TSTypeAssertion');
+ }
+ tsParseHeritageClause(e) {
+ const t = this.state.startLoc;
+ const r = this.tsParseDelimitedList('HeritageClauseElement', () => {
+ const e = this.startNode();
+ e.expression = this.tsParseEntityName();
+ if (this.match(47)) {
+ e.typeParameters = this.tsParseTypeArguments();
+ }
+ return this.finishNode(e, 'TSExpressionWithTypeArguments');
+ });
+ if (!r.length) {
+ this.raise(ie.EmptyHeritageClauseType, { at: t, token: e });
+ }
+ return r;
+ }
+ tsParseInterfaceDeclaration(e, t = {}) {
+ if (this.hasFollowingLineBreak()) return null;
+ this.expectContextual(129);
+ if (t.declare) e.declare = true;
+ if (tokenIsIdentifier(this.state.type)) {
+ e.id = this.parseIdentifier();
+ this.checkIdentifier(e.id, 130);
+ } else {
+ e.id = null;
+ this.raise(ie.MissingInterfaceName, { at: this.state.startLoc });
+ }
+ e.typeParameters = this.tsTryParseTypeParameters(
+ this.tsParseInOutConstModifiers,
+ );
+ if (this.eat(81)) {
+ e.extends = this.tsParseHeritageClause('extends');
+ }
+ const r = this.startNode();
+ r.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
+ e.body = this.finishNode(r, 'TSInterfaceBody');
+ return this.finishNode(e, 'TSInterfaceDeclaration');
+ }
+ tsParseTypeAliasDeclaration(e) {
+ e.id = this.parseIdentifier();
+ this.checkIdentifier(e.id, 2);
+ e.typeAnnotation = this.tsInType(() => {
+ e.typeParameters = this.tsTryParseTypeParameters(
+ this.tsParseInOutModifiers,
+ );
+ this.expect(29);
+ if (this.isContextual(114) && this.lookahead().type !== 16) {
+ const e = this.startNode();
+ this.next();
+ return this.finishNode(e, 'TSIntrinsicKeyword');
+ }
+ return this.tsParseType();
+ });
+ this.semicolon();
+ return this.finishNode(e, 'TSTypeAliasDeclaration');
+ }
+ tsInNoContext(e) {
+ const t = this.state.context;
+ this.state.context = [t[0]];
+ try {
+ return e();
+ } finally {
+ this.state.context = t;
+ }
+ }
+ tsInType(e) {
+ const t = this.state.inType;
+ this.state.inType = true;
+ try {
+ return e();
+ } finally {
+ this.state.inType = t;
+ }
+ }
+ tsInDisallowConditionalTypesContext(e) {
+ const t = this.state.inDisallowConditionalTypesContext;
+ this.state.inDisallowConditionalTypesContext = true;
+ try {
+ return e();
+ } finally {
+ this.state.inDisallowConditionalTypesContext = t;
+ }
+ }
+ tsInAllowConditionalTypesContext(e) {
+ const t = this.state.inDisallowConditionalTypesContext;
+ this.state.inDisallowConditionalTypesContext = false;
+ try {
+ return e();
+ } finally {
+ this.state.inDisallowConditionalTypesContext = t;
+ }
+ }
+ tsEatThenParseType(e) {
+ if (this.match(e)) {
+ return this.tsNextThenParseType();
+ }
+ }
+ tsExpectThenParseType(e) {
+ return this.tsInType(() => {
+ this.expect(e);
+ return this.tsParseType();
+ });
+ }
+ tsNextThenParseType() {
+ return this.tsInType(() => {
+ this.next();
+ return this.tsParseType();
+ });
+ }
+ tsParseEnumMember() {
+ const e = this.startNode();
+ e.id = this.match(133)
+ ? super.parseStringLiteral(this.state.value)
+ : this.parseIdentifier(true);
+ if (this.eat(29)) {
+ e.initializer = super.parseMaybeAssignAllowIn();
+ }
+ return this.finishNode(e, 'TSEnumMember');
+ }
+ tsParseEnumDeclaration(e, t = {}) {
+ if (t.const) e.const = true;
+ if (t.declare) e.declare = true;
+ this.expectContextual(126);
+ e.id = this.parseIdentifier();
+ this.checkIdentifier(e.id, e.const ? 8971 : 8459);
+ this.expect(5);
+ e.members = this.tsParseDelimitedList(
+ 'EnumMembers',
+ this.tsParseEnumMember.bind(this),
+ );
+ this.expect(8);
+ return this.finishNode(e, 'TSEnumDeclaration');
+ }
+ tsParseModuleBlock() {
+ const e = this.startNode();
+ this.scope.enter(0);
+ this.expect(5);
+ super.parseBlockOrModuleBlockBody(
+ (e.body = []),
+ undefined,
+ true,
+ 8,
+ );
+ this.scope.exit();
+ return this.finishNode(e, 'TSModuleBlock');
+ }
+ tsParseModuleOrNamespaceDeclaration(e, t = false) {
+ e.id = this.parseIdentifier();
+ if (!t) {
+ this.checkIdentifier(e.id, 1024);
+ }
+ if (this.eat(16)) {
+ const t = this.startNode();
+ this.tsParseModuleOrNamespaceDeclaration(t, true);
+ e.body = t;
+ } else {
+ this.scope.enter(256);
+ this.prodParam.enter(0);
+ e.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+ return this.finishNode(e, 'TSModuleDeclaration');
+ }
+ tsParseAmbientExternalModuleDeclaration(e) {
+ if (this.isContextual(112)) {
+ e.global = true;
+ e.id = this.parseIdentifier();
+ } else if (this.match(133)) {
+ e.id = super.parseStringLiteral(this.state.value);
+ } else {
+ this.unexpected();
+ }
+ if (this.match(5)) {
+ this.scope.enter(256);
+ this.prodParam.enter(0);
+ e.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ } else {
+ this.semicolon();
+ }
+ return this.finishNode(e, 'TSModuleDeclaration');
+ }
+ tsParseImportEqualsDeclaration(e, t, r) {
+ e.isExport = r || false;
+ e.id = t || this.parseIdentifier();
+ this.checkIdentifier(e.id, 4096);
+ this.expect(29);
+ const s = this.tsParseModuleReference();
+ if (
+ e.importKind === 'type' &&
+ s.type !== 'TSExternalModuleReference'
+ ) {
+ this.raise(ie.ImportAliasHasImportType, { at: s });
+ }
+ e.moduleReference = s;
+ this.semicolon();
+ return this.finishNode(e, 'TSImportEqualsDeclaration');
+ }
+ tsIsExternalModuleReference() {
+ return this.isContextual(119) && this.lookaheadCharCode() === 40;
+ }
+ tsParseModuleReference() {
+ return this.tsIsExternalModuleReference()
+ ? this.tsParseExternalModuleReference()
+ : this.tsParseEntityName(false);
+ }
+ tsParseExternalModuleReference() {
+ const e = this.startNode();
+ this.expectContextual(119);
+ this.expect(10);
+ if (!this.match(133)) {
+ this.unexpected();
+ }
+ e.expression = super.parseExprAtom();
+ this.expect(11);
+ this.sawUnambiguousESM = true;
+ return this.finishNode(e, 'TSExternalModuleReference');
+ }
+ tsLookAhead(e) {
+ const t = this.state.clone();
+ const r = e();
+ this.state = t;
+ return r;
+ }
+ tsTryParseAndCatch(e) {
+ const t = this.tryParse((t) => e() || t());
+ if (t.aborted || !t.node) return;
+ if (t.error) this.state = t.failState;
+ return t.node;
+ }
+ tsTryParse(e) {
+ const t = this.state.clone();
+ const r = e();
+ if (r !== undefined && r !== false) {
+ return r;
+ }
+ this.state = t;
+ }
+ tsTryParseDeclare(e) {
+ if (this.isLineTerminator()) {
+ return;
+ }
+ let t = this.state.type;
+ let r;
+ if (this.isContextual(100)) {
+ t = 74;
+ r = 'let';
+ }
+ return this.tsInAmbientContext(() => {
+ switch (t) {
+ case 68:
+ e.declare = true;
+ return super.parseFunctionStatement(e, false, false);
+ case 80:
+ e.declare = true;
+ return this.parseClass(e, true, false);
+ case 126:
+ return this.tsParseEnumDeclaration(e, { declare: true });
+ case 112:
+ return this.tsParseAmbientExternalModuleDeclaration(e);
+ case 75:
+ case 74:
+ if (!this.match(75) || !this.isLookaheadContextual('enum')) {
+ e.declare = true;
+ return this.parseVarStatement(
+ e,
+ r || this.state.value,
+ true,
+ );
+ }
+ this.expect(75);
+ return this.tsParseEnumDeclaration(e, {
+ const: true,
+ declare: true,
+ });
+ case 129: {
+ const t = this.tsParseInterfaceDeclaration(e, {
+ declare: true,
+ });
+ if (t) return t;
+ }
+ default:
+ if (tokenIsIdentifier(t)) {
+ return this.tsParseDeclaration(
+ e,
+ this.state.value,
+ true,
+ null,
+ );
+ }
+ }
+ });
+ }
+ tsTryParseExportDeclaration() {
+ return this.tsParseDeclaration(
+ this.startNode(),
+ this.state.value,
+ true,
+ null,
+ );
+ }
+ tsParseExpressionStatement(e, t, r) {
+ switch (t.name) {
+ case 'declare': {
+ const t = this.tsTryParseDeclare(e);
+ if (t) {
+ t.declare = true;
+ }
+ return t;
+ }
+ case 'global':
+ if (this.match(5)) {
+ this.scope.enter(256);
+ this.prodParam.enter(0);
+ const r = e;
+ r.global = true;
+ r.id = t;
+ r.body = this.tsParseModuleBlock();
+ this.scope.exit();
+ this.prodParam.exit();
+ return this.finishNode(r, 'TSModuleDeclaration');
+ }
+ break;
+ default:
+ return this.tsParseDeclaration(e, t.name, false, r);
+ }
+ }
+ tsParseDeclaration(e, t, r, s) {
+ switch (t) {
+ case 'abstract':
+ if (
+ this.tsCheckLineTerminator(r) &&
+ (this.match(80) || tokenIsIdentifier(this.state.type))
+ ) {
+ return this.tsParseAbstractDeclaration(e, s);
+ }
+ break;
+ case 'module':
+ if (this.tsCheckLineTerminator(r)) {
+ if (this.match(133)) {
+ return this.tsParseAmbientExternalModuleDeclaration(e);
+ } else if (tokenIsIdentifier(this.state.type)) {
+ return this.tsParseModuleOrNamespaceDeclaration(e);
+ }
+ }
+ break;
+ case 'namespace':
+ if (
+ this.tsCheckLineTerminator(r) &&
+ tokenIsIdentifier(this.state.type)
+ ) {
+ return this.tsParseModuleOrNamespaceDeclaration(e);
+ }
+ break;
+ case 'type':
+ if (
+ this.tsCheckLineTerminator(r) &&
+ tokenIsIdentifier(this.state.type)
+ ) {
+ return this.tsParseTypeAliasDeclaration(e);
+ }
+ break;
+ }
+ }
+ tsCheckLineTerminator(e) {
+ if (e) {
+ if (this.hasFollowingLineBreak()) return false;
+ this.next();
+ return true;
+ }
+ return !this.isLineTerminator();
+ }
+ tsTryParseGenericAsyncArrowFunction(e) {
+ if (!this.match(47)) return;
+ const t = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = true;
+ const r = this.tsTryParseAndCatch(() => {
+ const t = this.startNodeAt(e);
+ t.typeParameters = this.tsParseTypeParameters(
+ this.tsParseConstModifier,
+ );
+ super.parseFunctionParams(t);
+ t.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
+ this.expect(19);
+ return t;
+ });
+ this.state.maybeInArrowParameters = t;
+ if (!r) return;
+ return super.parseArrowExpression(r, null, true);
+ }
+ tsParseTypeArgumentsInExpression() {
+ if (this.reScan_lt() !== 47) return;
+ return this.tsParseTypeArguments();
+ }
+ tsParseTypeArguments() {
+ const e = this.startNode();
+ e.params = this.tsInType(() =>
+ this.tsInNoContext(() => {
+ this.expect(47);
+ return this.tsParseDelimitedList(
+ 'TypeParametersOrArguments',
+ this.tsParseType.bind(this),
+ );
+ }),
+ );
+ if (e.params.length === 0) {
+ this.raise(ie.EmptyTypeArguments, { at: e });
+ } else if (!this.state.inType && this.curContext() === f.brace) {
+ this.reScan_lt_gt();
+ }
+ this.expect(48);
+ return this.finishNode(e, 'TSTypeParameterInstantiation');
+ }
+ tsIsDeclarationStart() {
+ return tokenIsTSDeclarationStart(this.state.type);
+ }
+ isExportDefaultSpecifier() {
+ if (this.tsIsDeclarationStart()) return false;
+ return super.isExportDefaultSpecifier();
+ }
+ parseAssignableListItem(e, t) {
+ const r = this.state.startLoc;
+ const s = {};
+ this.tsParseModifiers(
+ {
+ allowedModifiers: [
+ 'public',
+ 'private',
+ 'protected',
+ 'override',
+ 'readonly',
+ ],
+ },
+ s,
+ );
+ const i = s.accessibility;
+ const n = s.override;
+ const a = s.readonly;
+ if (!(e & 4) && (i || a || n)) {
+ this.raise(ie.UnexpectedParameterModifier, { at: r });
+ }
+ const o = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(o, e);
+ const l = this.parseMaybeDefault(o.loc.start, o);
+ if (i || a || n) {
+ const e = this.startNodeAt(r);
+ if (t.length) {
+ e.decorators = t;
+ }
+ if (i) e.accessibility = i;
+ if (a) e.readonly = a;
+ if (n) e.override = n;
+ if (l.type !== 'Identifier' && l.type !== 'AssignmentPattern') {
+ this.raise(ie.UnsupportedParameterPropertyKind, { at: e });
+ }
+ e.parameter = l;
+ return this.finishNode(e, 'TSParameterProperty');
+ }
+ if (t.length) {
+ o.decorators = t;
+ }
+ return l;
+ }
+ isSimpleParameter(e) {
+ return (
+ (e.type === 'TSParameterProperty' &&
+ super.isSimpleParameter(e.parameter)) ||
+ super.isSimpleParameter(e)
+ );
+ }
+ tsDisallowOptionalPattern(e) {
+ for (const t of e.params) {
+ if (
+ t.type !== 'Identifier' &&
+ t.optional &&
+ !this.state.isAmbientContext
+ ) {
+ this.raise(ie.PatternIsOptional, { at: t });
+ }
+ }
+ }
+ setArrowFunctionParameters(e, t, r) {
+ super.setArrowFunctionParameters(e, t, r);
+ this.tsDisallowOptionalPattern(e);
+ }
+ parseFunctionBodyAndFinish(e, t, r = false) {
+ if (this.match(14)) {
+ e.returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
+ }
+ const s =
+ t === 'FunctionDeclaration'
+ ? 'TSDeclareFunction'
+ : t === 'ClassMethod' || t === 'ClassPrivateMethod'
+ ? 'TSDeclareMethod'
+ : undefined;
+ if (s && !this.match(5) && this.isLineTerminator()) {
+ return this.finishNode(e, s);
+ }
+ if (s === 'TSDeclareFunction' && this.state.isAmbientContext) {
+ this.raise(ie.DeclareFunctionHasImplementation, { at: e });
+ if (e.declare) {
+ return super.parseFunctionBodyAndFinish(e, s, r);
+ }
+ }
+ this.tsDisallowOptionalPattern(e);
+ return super.parseFunctionBodyAndFinish(e, t, r);
+ }
+ registerFunctionStatementId(e) {
+ if (!e.body && e.id) {
+ this.checkIdentifier(e.id, 1024);
+ } else {
+ super.registerFunctionStatementId(e);
+ }
+ }
+ tsCheckForInvalidTypeCasts(e) {
+ e.forEach((e) => {
+ if ((e == null ? void 0 : e.type) === 'TSTypeCastExpression') {
+ this.raise(ie.UnexpectedTypeAnnotation, {
+ at: e.typeAnnotation,
+ });
+ }
+ });
+ }
+ toReferencedList(e, t) {
+ this.tsCheckForInvalidTypeCasts(e);
+ return e;
+ }
+ parseArrayLike(e, t, r, s) {
+ const i = super.parseArrayLike(e, t, r, s);
+ if (i.type === 'ArrayExpression') {
+ this.tsCheckForInvalidTypeCasts(i.elements);
+ }
+ return i;
+ }
+ parseSubscript(e, t, r, s) {
+ if (!this.hasPrecedingLineBreak() && this.match(35)) {
+ this.state.canStartJSXElement = false;
+ this.next();
+ const r = this.startNodeAt(t);
+ r.expression = e;
+ return this.finishNode(r, 'TSNonNullExpression');
+ }
+ let i = false;
+ if (this.match(18) && this.lookaheadCharCode() === 60) {
+ if (r) {
+ s.stop = true;
+ return e;
+ }
+ s.optionalChainMember = i = true;
+ this.next();
+ }
+ if (this.match(47) || this.match(51)) {
+ let n;
+ const a = this.tsTryParseAndCatch(() => {
+ if (!r && this.atPossibleAsyncArrow(e)) {
+ const e = this.tsTryParseGenericAsyncArrowFunction(t);
+ if (e) {
+ return e;
+ }
+ }
+ const a = this.tsParseTypeArgumentsInExpression();
+ if (!a) return;
+ if (i && !this.match(10)) {
+ n = this.state.curPosition();
+ return;
+ }
+ if (tokenIsTemplate(this.state.type)) {
+ const r = super.parseTaggedTemplateExpression(e, t, s);
+ r.typeParameters = a;
+ return r;
+ }
+ if (!r && this.eat(10)) {
+ const r = this.startNodeAt(t);
+ r.callee = e;
+ r.arguments = this.parseCallExpressionArguments(11, false);
+ this.tsCheckForInvalidTypeCasts(r.arguments);
+ r.typeParameters = a;
+ if (s.optionalChainMember) {
+ r.optional = i;
+ }
+ return this.finishCallExpression(r, s.optionalChainMember);
+ }
+ const o = this.state.type;
+ if (
+ o === 48 ||
+ o === 52 ||
+ (o !== 10 &&
+ tokenCanStartExpression(o) &&
+ !this.hasPrecedingLineBreak())
+ ) {
+ return;
+ }
+ const l = this.startNodeAt(t);
+ l.expression = e;
+ l.typeParameters = a;
+ return this.finishNode(l, 'TSInstantiationExpression');
+ });
+ if (n) {
+ this.unexpected(n, 10);
+ }
+ if (a) {
+ if (
+ a.type === 'TSInstantiationExpression' &&
+ (this.match(16) ||
+ (this.match(18) && this.lookaheadCharCode() !== 40))
+ ) {
+ this.raise(
+ ie.InvalidPropertyAccessAfterInstantiationExpression,
+ { at: this.state.startLoc },
+ );
+ }
+ return a;
+ }
+ }
+ return super.parseSubscript(e, t, r, s);
+ }
+ parseNewCallee(e) {
+ var t;
+ super.parseNewCallee(e);
+ const { callee: r } = e;
+ if (
+ r.type === 'TSInstantiationExpression' &&
+ !((t = r.extra) != null && t.parenthesized)
+ ) {
+ e.typeParameters = r.typeParameters;
+ e.callee = r.expression;
+ }
+ }
+ parseExprOp(e, t, r) {
+ let s;
+ if (
+ tokenOperatorPrecedence(58) > r &&
+ !this.hasPrecedingLineBreak() &&
+ (this.isContextual(93) || (s = this.isContextual(120)))
+ ) {
+ const i = this.startNodeAt(t);
+ i.expression = e;
+ i.typeAnnotation = this.tsInType(() => {
+ this.next();
+ if (this.match(75)) {
+ if (s) {
+ this.raise(u.UnexpectedKeyword, {
+ at: this.state.startLoc,
+ keyword: 'const',
+ });
+ }
+ return this.tsParseTypeReference();
+ }
+ return this.tsParseType();
+ });
+ this.finishNode(
+ i,
+ s ? 'TSSatisfiesExpression' : 'TSAsExpression',
+ );
+ this.reScan_lt_gt();
+ return this.parseExprOp(i, t, r);
+ }
+ return super.parseExprOp(e, t, r);
+ }
+ checkReservedWord(e, t, r, s) {
+ if (!this.state.isAmbientContext) {
+ super.checkReservedWord(e, t, r, s);
+ }
+ }
+ checkImportReflection(e) {
+ super.checkImportReflection(e);
+ if (e.module && e.importKind !== 'value') {
+ this.raise(ie.ImportReflectionHasImportType, {
+ at: e.specifiers[0].loc.start,
+ });
+ }
+ }
+ checkDuplicateExports() {}
+ isPotentialImportPhase(e) {
+ if (super.isPotentialImportPhase(e)) return true;
+ if (this.isContextual(130)) {
+ const t = this.lookaheadCharCode();
+ return e ? t === 123 || t === 42 : t !== 61;
+ }
+ return !e && this.isContextual(87);
+ }
+ applyImportPhase(e, t, r, s) {
+ super.applyImportPhase(e, t, r, s);
+ if (t) {
+ e.exportKind = r === 'type' ? 'type' : 'value';
+ } else {
+ e.importKind = r === 'type' || r === 'typeof' ? r : 'value';
+ }
+ }
+ parseImport(e) {
+ if (this.match(133)) {
+ e.importKind = 'value';
+ return super.parseImport(e);
+ }
+ let t;
+ if (
+ tokenIsIdentifier(this.state.type) &&
+ this.lookaheadCharCode() === 61
+ ) {
+ e.importKind = 'value';
+ return this.tsParseImportEqualsDeclaration(e);
+ } else if (this.isContextual(130)) {
+ const r = this.parseMaybeImportPhase(e, false);
+ if (this.lookaheadCharCode() === 61) {
+ return this.tsParseImportEqualsDeclaration(e, r);
+ } else {
+ t = super.parseImportSpecifiersAndAfter(e, r);
+ }
+ } else {
+ t = super.parseImport(e);
+ }
+ if (
+ t.importKind === 'type' &&
+ t.specifiers.length > 1 &&
+ t.specifiers[0].type === 'ImportDefaultSpecifier'
+ ) {
+ this.raise(ie.TypeImportCannotSpecifyDefaultAndNamed, { at: t });
+ }
+ return t;
+ }
+ parseExport(e, t) {
+ if (this.match(83)) {
+ this.next();
+ let t = null;
+ if (
+ this.isContextual(130) &&
+ this.isPotentialImportPhase(false)
+ ) {
+ t = this.parseMaybeImportPhase(e, false);
+ } else {
+ e.importKind = 'value';
+ }
+ return this.tsParseImportEqualsDeclaration(e, t, true);
+ } else if (this.eat(29)) {
+ const t = e;
+ t.expression = super.parseExpression();
+ this.semicolon();
+ this.sawUnambiguousESM = true;
+ return this.finishNode(t, 'TSExportAssignment');
+ } else if (this.eatContextual(93)) {
+ const t = e;
+ this.expectContextual(128);
+ t.id = this.parseIdentifier();
+ this.semicolon();
+ return this.finishNode(t, 'TSNamespaceExportDeclaration');
+ } else {
+ return super.parseExport(e, t);
+ }
+ }
+ isAbstractClass() {
+ return this.isContextual(124) && this.lookahead().type === 80;
+ }
+ parseExportDefaultExpression() {
+ if (this.isAbstractClass()) {
+ const e = this.startNode();
+ this.next();
+ e.abstract = true;
+ return this.parseClass(e, true, true);
+ }
+ if (this.match(129)) {
+ const e = this.tsParseInterfaceDeclaration(this.startNode());
+ if (e) return e;
+ }
+ return super.parseExportDefaultExpression();
+ }
+ parseVarStatement(e, t, r = false) {
+ const { isAmbientContext: s } = this.state;
+ const i = super.parseVarStatement(e, t, r || s);
+ if (!s) return i;
+ for (const { id: e, init: r } of i.declarations) {
+ if (!r) continue;
+ if (t !== 'const' || !!e.typeAnnotation) {
+ this.raise(ie.InitializerNotAllowedInAmbientContext, { at: r });
+ } else if (
+ !isValidAmbientConstInitializer(r, this.hasPlugin('estree'))
+ ) {
+ this.raise(
+ ie.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
+ { at: r },
+ );
+ }
+ }
+ return i;
+ }
+ parseStatementContent(e, t) {
+ if (this.match(75) && this.isLookaheadContextual('enum')) {
+ const e = this.startNode();
+ this.expect(75);
+ return this.tsParseEnumDeclaration(e, { const: true });
+ }
+ if (this.isContextual(126)) {
+ return this.tsParseEnumDeclaration(this.startNode());
+ }
+ if (this.isContextual(129)) {
+ const e = this.tsParseInterfaceDeclaration(this.startNode());
+ if (e) return e;
+ }
+ return super.parseStatementContent(e, t);
+ }
+ parseAccessModifier() {
+ return this.tsParseModifier(['public', 'protected', 'private']);
+ }
+ tsHasSomeModifiers(e, t) {
+ return t.some((t) => {
+ if (tsIsAccessModifier(t)) {
+ return e.accessibility === t;
+ }
+ return !!e[t];
+ });
+ }
+ tsIsStartOfStaticBlocks() {
+ return this.isContextual(106) && this.lookaheadCharCode() === 123;
+ }
+ parseClassMember(e, t, r) {
+ const s = [
+ 'declare',
+ 'private',
+ 'public',
+ 'protected',
+ 'override',
+ 'abstract',
+ 'readonly',
+ 'static',
+ ];
+ this.tsParseModifiers(
+ {
+ allowedModifiers: s,
+ disallowedModifiers: ['in', 'out'],
+ stopOnStartOfClassStaticBlock: true,
+ errorTemplate: ie.InvalidModifierOnTypeParameterPositions,
+ },
+ t,
+ );
+ const callParseClassMemberWithIsStatic = () => {
+ if (this.tsIsStartOfStaticBlocks()) {
+ this.next();
+ this.next();
+ if (this.tsHasSomeModifiers(t, s)) {
+ this.raise(ie.StaticBlockCannotHaveModifier, {
+ at: this.state.curPosition(),
+ });
+ }
+ super.parseClassStaticBlock(e, t);
+ } else {
+ this.parseClassMemberWithIsStatic(e, t, r, !!t.static);
+ }
+ };
+ if (t.declare) {
+ this.tsInAmbientContext(callParseClassMemberWithIsStatic);
+ } else {
+ callParseClassMemberWithIsStatic();
+ }
+ }
+ parseClassMemberWithIsStatic(e, t, r, s) {
+ const i = this.tsTryParseIndexSignature(t);
+ if (i) {
+ e.body.push(i);
+ if (t.abstract) {
+ this.raise(ie.IndexSignatureHasAbstract, { at: t });
+ }
+ if (t.accessibility) {
+ this.raise(ie.IndexSignatureHasAccessibility, {
+ at: t,
+ modifier: t.accessibility,
+ });
+ }
+ if (t.declare) {
+ this.raise(ie.IndexSignatureHasDeclare, { at: t });
+ }
+ if (t.override) {
+ this.raise(ie.IndexSignatureHasOverride, { at: t });
+ }
+ return;
+ }
+ if (!this.state.inAbstractClass && t.abstract) {
+ this.raise(ie.NonAbstractClassHasAbstractMethod, { at: t });
+ }
+ if (t.override) {
+ if (!r.hadSuperClass) {
+ this.raise(ie.OverrideNotInSubClass, { at: t });
+ }
+ }
+ super.parseClassMemberWithIsStatic(e, t, r, s);
+ }
+ parsePostMemberNameModifiers(e) {
+ const t = this.eat(17);
+ if (t) e.optional = true;
+ if (e.readonly && this.match(10)) {
+ this.raise(ie.ClassMethodHasReadonly, { at: e });
+ }
+ if (e.declare && this.match(10)) {
+ this.raise(ie.ClassMethodHasDeclare, { at: e });
+ }
+ }
+ parseExpressionStatement(e, t, r) {
+ const s =
+ t.type === 'Identifier'
+ ? this.tsParseExpressionStatement(e, t, r)
+ : undefined;
+ return s || super.parseExpressionStatement(e, t, r);
+ }
+ shouldParseExportDeclaration() {
+ if (this.tsIsDeclarationStart()) return true;
+ return super.shouldParseExportDeclaration();
+ }
+ parseConditional(e, t, r) {
+ if (!this.state.maybeInArrowParameters || !this.match(17)) {
+ return super.parseConditional(e, t, r);
+ }
+ const s = this.tryParse(() => super.parseConditional(e, t));
+ if (!s.node) {
+ if (s.error) {
+ super.setOptionalParametersError(r, s.error);
+ }
+ return e;
+ }
+ if (s.error) this.state = s.failState;
+ return s.node;
+ }
+ parseParenItem(e, t) {
+ e = super.parseParenItem(e, t);
+ if (this.eat(17)) {
+ e.optional = true;
+ this.resetEndLocation(e);
+ }
+ if (this.match(14)) {
+ const r = this.startNodeAt(t);
+ r.expression = e;
+ r.typeAnnotation = this.tsParseTypeAnnotation();
+ return this.finishNode(r, 'TSTypeCastExpression');
+ }
+ return e;
+ }
+ parseExportDeclaration(e) {
+ if (!this.state.isAmbientContext && this.isContextual(125)) {
+ return this.tsInAmbientContext(() =>
+ this.parseExportDeclaration(e),
+ );
+ }
+ const t = this.state.startLoc;
+ const r = this.eatContextual(125);
+ if (
+ r &&
+ (this.isContextual(125) || !this.shouldParseExportDeclaration())
+ ) {
+ throw this.raise(ie.ExpectedAmbientAfterExportDeclare, {
+ at: this.state.startLoc,
+ });
+ }
+ const s = tokenIsIdentifier(this.state.type);
+ const i =
+ (s && this.tsTryParseExportDeclaration()) ||
+ super.parseExportDeclaration(e);
+ if (!i) return null;
+ if (
+ i.type === 'TSInterfaceDeclaration' ||
+ i.type === 'TSTypeAliasDeclaration' ||
+ r
+ ) {
+ e.exportKind = 'type';
+ }
+ if (r) {
+ this.resetStartLocation(i, t);
+ i.declare = true;
+ }
+ return i;
+ }
+ parseClassId(e, t, r, s) {
+ if ((!t || r) && this.isContextual(113)) {
+ return;
+ }
+ super.parseClassId(e, t, r, e.declare ? 1024 : 8331);
+ const i = this.tsTryParseTypeParameters(
+ this.tsParseInOutConstModifiers,
+ );
+ if (i) e.typeParameters = i;
+ }
+ parseClassPropertyAnnotation(e) {
+ if (!e.optional) {
+ if (this.eat(35)) {
+ e.definite = true;
+ } else if (this.eat(17)) {
+ e.optional = true;
+ }
+ }
+ const t = this.tsTryParseTypeAnnotation();
+ if (t) e.typeAnnotation = t;
+ }
+ parseClassProperty(e) {
+ this.parseClassPropertyAnnotation(e);
+ if (
+ this.state.isAmbientContext &&
+ !(e.readonly && !e.typeAnnotation) &&
+ this.match(29)
+ ) {
+ this.raise(ie.DeclareClassFieldHasInitializer, {
+ at: this.state.startLoc,
+ });
+ }
+ if (e.abstract && this.match(29)) {
+ const { key: t } = e;
+ this.raise(ie.AbstractPropertyHasInitializer, {
+ at: this.state.startLoc,
+ propertyName:
+ t.type === 'Identifier' && !e.computed
+ ? t.name
+ : `[${this.input.slice(t.start, t.end)}]`,
+ });
+ }
+ return super.parseClassProperty(e);
+ }
+ parseClassPrivateProperty(e) {
+ if (e.abstract) {
+ this.raise(ie.PrivateElementHasAbstract, { at: e });
+ }
+ if (e.accessibility) {
+ this.raise(ie.PrivateElementHasAccessibility, {
+ at: e,
+ modifier: e.accessibility,
+ });
+ }
+ this.parseClassPropertyAnnotation(e);
+ return super.parseClassPrivateProperty(e);
+ }
+ parseClassAccessorProperty(e) {
+ this.parseClassPropertyAnnotation(e);
+ if (e.optional) {
+ this.raise(ie.AccessorCannotBeOptional, { at: e });
+ }
+ return super.parseClassAccessorProperty(e);
+ }
+ pushClassMethod(e, t, r, s, i, n) {
+ const a = this.tsTryParseTypeParameters(this.tsParseConstModifier);
+ if (a && i) {
+ this.raise(ie.ConstructorHasTypeParameters, { at: a });
+ }
+ const { declare: o = false, kind: l } = t;
+ if (o && (l === 'get' || l === 'set')) {
+ this.raise(ie.DeclareAccessor, { at: t, kind: l });
+ }
+ if (a) t.typeParameters = a;
+ super.pushClassMethod(e, t, r, s, i, n);
+ }
+ pushClassPrivateMethod(e, t, r, s) {
+ const i = this.tsTryParseTypeParameters(this.tsParseConstModifier);
+ if (i) t.typeParameters = i;
+ super.pushClassPrivateMethod(e, t, r, s);
+ }
+ declareClassPrivateMethodInScope(e, t) {
+ if (e.type === 'TSDeclareMethod') return;
+ if (e.type === 'MethodDefinition' && !e.value.body) return;
+ super.declareClassPrivateMethodInScope(e, t);
+ }
+ parseClassSuper(e) {
+ super.parseClassSuper(e);
+ if (e.superClass && (this.match(47) || this.match(51))) {
+ e.superTypeParameters = this.tsParseTypeArgumentsInExpression();
+ }
+ if (this.eatContextual(113)) {
+ e.implements = this.tsParseHeritageClause('implements');
+ }
+ }
+ parseObjPropValue(e, t, r, s, i, n, a) {
+ const o = this.tsTryParseTypeParameters(this.tsParseConstModifier);
+ if (o) e.typeParameters = o;
+ return super.parseObjPropValue(e, t, r, s, i, n, a);
+ }
+ parseFunctionParams(e, t) {
+ const r = this.tsTryParseTypeParameters(this.tsParseConstModifier);
+ if (r) e.typeParameters = r;
+ super.parseFunctionParams(e, t);
+ }
+ parseVarId(e, t) {
+ super.parseVarId(e, t);
+ if (
+ e.id.type === 'Identifier' &&
+ !this.hasPrecedingLineBreak() &&
+ this.eat(35)
+ ) {
+ e.definite = true;
+ }
+ const r = this.tsTryParseTypeAnnotation();
+ if (r) {
+ e.id.typeAnnotation = r;
+ this.resetEndLocation(e.id);
+ }
+ }
+ parseAsyncArrowFromCallExpression(e, t) {
+ if (this.match(14)) {
+ e.returnType = this.tsParseTypeAnnotation();
+ }
+ return super.parseAsyncArrowFromCallExpression(e, t);
+ }
+ parseMaybeAssign(e, t) {
+ var r, s, i, n, a;
+ let o;
+ let l;
+ let c;
+ if (this.hasPlugin('jsx') && (this.match(142) || this.match(47))) {
+ o = this.state.clone();
+ l = this.tryParse(() => super.parseMaybeAssign(e, t), o);
+ if (!l.error) return l.node;
+ const { context: r } = this.state;
+ const s = r[r.length - 1];
+ if (s === f.j_oTag || s === f.j_expr) {
+ r.pop();
+ }
+ }
+ if (!((r = l) != null && r.error) && !this.match(47)) {
+ return super.parseMaybeAssign(e, t);
+ }
+ if (!o || o === this.state) o = this.state.clone();
+ let p;
+ const u = this.tryParse((r) => {
+ var s, i;
+ p = this.tsParseTypeParameters(this.tsParseConstModifier);
+ const n = super.parseMaybeAssign(e, t);
+ if (
+ n.type !== 'ArrowFunctionExpression' ||
+ ((s = n.extra) != null && s.parenthesized)
+ ) {
+ r();
+ }
+ if (((i = p) == null ? void 0 : i.params.length) !== 0) {
+ this.resetStartLocationFromNode(n, p);
+ }
+ n.typeParameters = p;
+ return n;
+ }, o);
+ if (!u.error && !u.aborted) {
+ if (p) this.reportReservedArrowTypeParam(p);
+ return u.node;
+ }
+ if (!l) {
+ assert(!this.hasPlugin('jsx'));
+ c = this.tryParse(() => super.parseMaybeAssign(e, t), o);
+ if (!c.error) return c.node;
+ }
+ if ((s = l) != null && s.node) {
+ this.state = l.failState;
+ return l.node;
+ }
+ if (u.node) {
+ this.state = u.failState;
+ if (p) this.reportReservedArrowTypeParam(p);
+ return u.node;
+ }
+ if ((i = c) != null && i.node) {
+ this.state = c.failState;
+ return c.node;
+ }
+ throw (
+ ((n = l) == null ? void 0 : n.error) ||
+ u.error ||
+ ((a = c) == null ? void 0 : a.error)
+ );
+ }
+ reportReservedArrowTypeParam(e) {
+ var t;
+ if (
+ e.params.length === 1 &&
+ !e.params[0].constraint &&
+ !((t = e.extra) != null && t.trailingComma) &&
+ this.getPluginOption('typescript', 'disallowAmbiguousJSXLike')
+ ) {
+ this.raise(ie.ReservedArrowTypeParam, { at: e });
+ }
+ }
+ parseMaybeUnary(e, t) {
+ if (!this.hasPlugin('jsx') && this.match(47)) {
+ return this.tsParseTypeAssertion();
+ }
+ return super.parseMaybeUnary(e, t);
+ }
+ parseArrow(e) {
+ if (this.match(14)) {
+ const t = this.tryParse((e) => {
+ const t = this.tsParseTypeOrTypePredicateAnnotation(14);
+ if (this.canInsertSemicolon() || !this.match(19)) e();
+ return t;
+ });
+ if (t.aborted) return;
+ if (!t.thrown) {
+ if (t.error) this.state = t.failState;
+ e.returnType = t.node;
+ }
+ }
+ return super.parseArrow(e);
+ }
+ parseAssignableListItemTypes(e, t) {
+ if (!(t & 2)) return e;
+ if (this.eat(17)) {
+ e.optional = true;
+ }
+ const r = this.tsTryParseTypeAnnotation();
+ if (r) e.typeAnnotation = r;
+ this.resetEndLocation(e);
+ return e;
+ }
+ isAssignable(e, t) {
+ switch (e.type) {
+ case 'TSTypeCastExpression':
+ return this.isAssignable(e.expression, t);
+ case 'TSParameterProperty':
+ return true;
+ default:
+ return super.isAssignable(e, t);
+ }
+ }
+ toAssignable(e, t = false) {
+ switch (e.type) {
+ case 'ParenthesizedExpression':
+ this.toAssignableParenthesizedExpression(e, t);
+ break;
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSNonNullExpression':
+ case 'TSTypeAssertion':
+ if (t) {
+ this.expressionScope.recordArrowParameterBindingError(
+ ie.UnexpectedTypeCastInParameter,
+ { at: e },
+ );
+ } else {
+ this.raise(ie.UnexpectedTypeCastInParameter, { at: e });
+ }
+ this.toAssignable(e.expression, t);
+ break;
+ case 'AssignmentExpression':
+ if (!t && e.left.type === 'TSTypeCastExpression') {
+ e.left = this.typeCastToParameter(e.left);
+ }
+ default:
+ super.toAssignable(e, t);
+ }
+ }
+ toAssignableParenthesizedExpression(e, t) {
+ switch (e.expression.type) {
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSNonNullExpression':
+ case 'TSTypeAssertion':
+ case 'ParenthesizedExpression':
+ this.toAssignable(e.expression, t);
+ break;
+ default:
+ super.toAssignable(e, t);
+ }
+ }
+ checkToRestConversion(e, t) {
+ switch (e.type) {
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSTypeAssertion':
+ case 'TSNonNullExpression':
+ this.checkToRestConversion(e.expression, false);
+ break;
+ default:
+ super.checkToRestConversion(e, t);
+ }
+ }
+ isValidLVal(e, t, r) {
+ return (
+ getOwn(
+ {
+ TSTypeCastExpression: true,
+ TSParameterProperty: 'parameter',
+ TSNonNullExpression: 'expression',
+ TSAsExpression: (r !== 64 || !t) && ['expression', true],
+ TSSatisfiesExpression: (r !== 64 || !t) && [
+ 'expression',
+ true,
+ ],
+ TSTypeAssertion: (r !== 64 || !t) && ['expression', true],
+ },
+ e,
+ ) || super.isValidLVal(e, t, r)
+ );
+ }
+ parseBindingAtom() {
+ if (this.state.type === 78) {
+ return this.parseIdentifier(true);
+ }
+ return super.parseBindingAtom();
+ }
+ parseMaybeDecoratorArguments(e) {
+ if (this.match(47) || this.match(51)) {
+ const t = this.tsParseTypeArgumentsInExpression();
+ if (this.match(10)) {
+ const r = super.parseMaybeDecoratorArguments(e);
+ r.typeParameters = t;
+ return r;
+ }
+ this.unexpected(null, 10);
+ }
+ return super.parseMaybeDecoratorArguments(e);
+ }
+ checkCommaAfterRest(e) {
+ if (
+ this.state.isAmbientContext &&
+ this.match(12) &&
+ this.lookaheadCharCode() === e
+ ) {
+ this.next();
+ return false;
+ }
+ return super.checkCommaAfterRest(e);
+ }
+ isClassMethod() {
+ return this.match(47) || super.isClassMethod();
+ }
+ isClassProperty() {
+ return this.match(35) || this.match(14) || super.isClassProperty();
+ }
+ parseMaybeDefault(e, t) {
+ const r = super.parseMaybeDefault(e, t);
+ if (
+ r.type === 'AssignmentPattern' &&
+ r.typeAnnotation &&
+ r.right.start < r.typeAnnotation.start
+ ) {
+ this.raise(ie.TypeAnnotationAfterAssign, {
+ at: r.typeAnnotation,
+ });
+ }
+ return r;
+ }
+ getTokenFromCode(e) {
+ if (this.state.inType) {
+ if (e === 62) {
+ this.finishOp(48, 1);
+ return;
+ }
+ if (e === 60) {
+ this.finishOp(47, 1);
+ return;
+ }
+ }
+ super.getTokenFromCode(e);
+ }
+ reScan_lt_gt() {
+ const { type: e } = this.state;
+ if (e === 47) {
+ this.state.pos -= 1;
+ this.readToken_lt();
+ } else if (e === 48) {
+ this.state.pos -= 1;
+ this.readToken_gt();
+ }
+ }
+ reScan_lt() {
+ const { type: e } = this.state;
+ if (e === 51) {
+ this.state.pos -= 2;
+ this.finishOp(47, 1);
+ return 47;
+ }
+ return e;
+ }
+ toAssignableList(e, t, r) {
+ for (let t = 0; t < e.length; t++) {
+ const r = e[t];
+ if ((r == null ? void 0 : r.type) === 'TSTypeCastExpression') {
+ e[t] = this.typeCastToParameter(r);
+ }
+ }
+ super.toAssignableList(e, t, r);
+ }
+ typeCastToParameter(e) {
+ e.expression.typeAnnotation = e.typeAnnotation;
+ this.resetEndLocation(e.expression, e.typeAnnotation.loc.end);
+ return e.expression;
+ }
+ shouldParseArrow(e) {
+ if (this.match(14)) {
+ return e.every((e) => this.isAssignable(e, true));
+ }
+ return super.shouldParseArrow(e);
+ }
+ shouldParseAsyncArrow() {
+ return this.match(14) || super.shouldParseAsyncArrow();
+ }
+ canHaveLeadingDecorator() {
+ return super.canHaveLeadingDecorator() || this.isAbstractClass();
+ }
+ jsxParseOpeningElementAfterName(e) {
+ if (this.match(47) || this.match(51)) {
+ const t = this.tsTryParseAndCatch(() =>
+ this.tsParseTypeArgumentsInExpression(),
+ );
+ if (t) e.typeParameters = t;
+ }
+ return super.jsxParseOpeningElementAfterName(e);
+ }
+ getGetterSetterExpectedParamCount(e) {
+ const t = super.getGetterSetterExpectedParamCount(e);
+ const r = this.getObjectOrClassMethodParams(e);
+ const s = r[0];
+ const i = s && this.isThisParam(s);
+ return i ? t + 1 : t;
+ }
+ parseCatchClauseParam() {
+ const e = super.parseCatchClauseParam();
+ const t = this.tsTryParseTypeAnnotation();
+ if (t) {
+ e.typeAnnotation = t;
+ this.resetEndLocation(e);
+ }
+ return e;
+ }
+ tsInAmbientContext(e) {
+ const t = this.state.isAmbientContext;
+ this.state.isAmbientContext = true;
+ try {
+ return e();
+ } finally {
+ this.state.isAmbientContext = t;
+ }
+ }
+ parseClass(e, t, r) {
+ const s = this.state.inAbstractClass;
+ this.state.inAbstractClass = !!e.abstract;
+ try {
+ return super.parseClass(e, t, r);
+ } finally {
+ this.state.inAbstractClass = s;
+ }
+ }
+ tsParseAbstractDeclaration(e, t) {
+ if (this.match(80)) {
+ e.abstract = true;
+ return this.maybeTakeDecorators(
+ t,
+ this.parseClass(e, true, false),
+ );
+ } else if (this.isContextual(129)) {
+ if (!this.hasFollowingLineBreak()) {
+ e.abstract = true;
+ this.raise(ie.NonClassMethodPropertyHasAbstractModifer, {
+ at: e,
+ });
+ return this.tsParseInterfaceDeclaration(e);
+ }
+ } else {
+ this.unexpected(null, 80);
+ }
+ }
+ parseMethod(e, t, r, s, i, n, a) {
+ const o = super.parseMethod(e, t, r, s, i, n, a);
+ if (o.abstract) {
+ const e = this.hasPlugin('estree') ? !!o.value.body : !!o.body;
+ if (e) {
+ const { key: e } = o;
+ this.raise(ie.AbstractMethodHasImplementation, {
+ at: o,
+ methodName:
+ e.type === 'Identifier' && !o.computed
+ ? e.name
+ : `[${this.input.slice(e.start, e.end)}]`,
+ });
+ }
+ }
+ return o;
+ }
+ tsParseTypeParameterName() {
+ const e = this.parseIdentifier();
+ return e.name;
+ }
+ shouldParseAsAmbientContext() {
+ return !!this.getPluginOption('typescript', 'dts');
+ }
+ parse() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+ return super.parse();
+ }
+ getExpression() {
+ if (this.shouldParseAsAmbientContext()) {
+ this.state.isAmbientContext = true;
+ }
+ return super.getExpression();
+ }
+ parseExportSpecifier(e, t, r, s) {
+ if (!t && s) {
+ this.parseTypeOnlyImportExportSpecifier(e, false, r);
+ return this.finishNode(e, 'ExportSpecifier');
+ }
+ e.exportKind = 'value';
+ return super.parseExportSpecifier(e, t, r, s);
+ }
+ parseImportSpecifier(e, t, r, s, i) {
+ if (!t && s) {
+ this.parseTypeOnlyImportExportSpecifier(e, true, r);
+ return this.finishNode(e, 'ImportSpecifier');
+ }
+ e.importKind = 'value';
+ return super.parseImportSpecifier(e, t, r, s, r ? 4098 : 4096);
+ }
+ parseTypeOnlyImportExportSpecifier(e, t, r) {
+ const s = t ? 'imported' : 'local';
+ const i = t ? 'local' : 'exported';
+ let n = e[s];
+ let a;
+ let o = false;
+ let l = true;
+ const c = n.loc.start;
+ if (this.isContextual(93)) {
+ const e = this.parseIdentifier();
+ if (this.isContextual(93)) {
+ const r = this.parseIdentifier();
+ if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ o = true;
+ n = e;
+ a = t ? this.parseIdentifier() : this.parseModuleExportName();
+ l = false;
+ } else {
+ a = r;
+ l = false;
+ }
+ } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ l = false;
+ a = t ? this.parseIdentifier() : this.parseModuleExportName();
+ } else {
+ o = true;
+ n = e;
+ }
+ } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ o = true;
+ if (t) {
+ n = this.parseIdentifier(true);
+ if (!this.isContextual(93)) {
+ this.checkReservedWord(n.name, n.loc.start, true, true);
+ }
+ } else {
+ n = this.parseModuleExportName();
+ }
+ }
+ if (o && r) {
+ this.raise(
+ t
+ ? ie.TypeModifierIsUsedInTypeImports
+ : ie.TypeModifierIsUsedInTypeExports,
+ { at: c },
+ );
+ }
+ e[s] = n;
+ e[i] = a;
+ const p = t ? 'importKind' : 'exportKind';
+ e[p] = o ? 'type' : 'value';
+ if (l && this.eatContextual(93)) {
+ e[i] = t ? this.parseIdentifier() : this.parseModuleExportName();
+ }
+ if (!e[i]) {
+ e[i] = cloneIdentifier(e[s]);
+ }
+ if (t) {
+ this.checkIdentifier(e[i], o ? 4098 : 4096);
+ }
+ }
+ };
+ function isPossiblyLiteralEnum(e) {
+ if (e.type !== 'MemberExpression') return false;
+ const { computed: t, property: r } = e;
+ if (
+ t &&
+ r.type !== 'StringLiteral' &&
+ (r.type !== 'TemplateLiteral' || r.expressions.length > 0)
+ ) {
+ return false;
+ }
+ return isUncomputedMemberExpressionChain(e.object);
+ }
+ function isValidAmbientConstInitializer(e, t) {
+ var r;
+ const { type: s } = e;
+ if ((r = e.extra) != null && r.parenthesized) {
+ return false;
+ }
+ if (t) {
+ if (s === 'Literal') {
+ const { value: t } = e;
+ if (typeof t === 'string' || typeof t === 'boolean') {
+ return true;
+ }
+ }
+ } else {
+ if (s === 'StringLiteral' || s === 'BooleanLiteral') {
+ return true;
+ }
+ }
+ if (isNumber(e, t) || isNegativeNumber(e, t)) {
+ return true;
+ }
+ if (s === 'TemplateLiteral' && e.expressions.length === 0) {
+ return true;
+ }
+ if (isPossiblyLiteralEnum(e)) {
+ return true;
+ }
+ return false;
+ }
+ function isNumber(e, t) {
+ if (t) {
+ return (
+ e.type === 'Literal' &&
+ (typeof e.value === 'number' || 'bigint' in e)
+ );
+ }
+ return e.type === 'NumericLiteral' || e.type === 'BigIntLiteral';
+ }
+ function isNegativeNumber(e, t) {
+ if (e.type === 'UnaryExpression') {
+ const { operator: r, argument: s } = e;
+ if (r === '-' && isNumber(s, t)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ function isUncomputedMemberExpressionChain(e) {
+ if (e.type === 'Identifier') return true;
+ if (e.type !== 'MemberExpression' || e.computed) {
+ return false;
+ }
+ return isUncomputedMemberExpressionChain(e.object);
+ }
+ const ne = ParseErrorEnum`placeholders`({
+ ClassNameIsRequired: 'A class name is required.',
+ UnexpectedSpace: 'Unexpected space in placeholder.',
+ });
+ var placeholders = (e) =>
+ class PlaceholdersParserMixin extends e {
+ parsePlaceholder(e) {
+ if (this.match(144)) {
+ const t = this.startNode();
+ this.next();
+ this.assertNoSpace();
+ t.name = super.parseIdentifier(true);
+ this.assertNoSpace();
+ this.expect(144);
+ return this.finishPlaceholder(t, e);
+ }
+ }
+ finishPlaceholder(e, t) {
+ const r = !!(e.expectedNode && e.type === 'Placeholder');
+ e.expectedNode = t;
+ return r ? e : this.finishNode(e, 'Placeholder');
+ }
+ getTokenFromCode(e) {
+ if (e === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
+ this.finishOp(144, 2);
+ } else {
+ super.getTokenFromCode(e);
+ }
+ }
+ parseExprAtom(e) {
+ return (
+ this.parsePlaceholder('Expression') || super.parseExprAtom(e)
+ );
+ }
+ parseIdentifier(e) {
+ return (
+ this.parsePlaceholder('Identifier') || super.parseIdentifier(e)
+ );
+ }
+ checkReservedWord(e, t, r, s) {
+ if (e !== undefined) {
+ super.checkReservedWord(e, t, r, s);
+ }
+ }
+ parseBindingAtom() {
+ return this.parsePlaceholder('Pattern') || super.parseBindingAtom();
+ }
+ isValidLVal(e, t, r) {
+ return e === 'Placeholder' || super.isValidLVal(e, t, r);
+ }
+ toAssignable(e, t) {
+ if (
+ e &&
+ e.type === 'Placeholder' &&
+ e.expectedNode === 'Expression'
+ ) {
+ e.expectedNode = 'Pattern';
+ } else {
+ super.toAssignable(e, t);
+ }
+ }
+ chStartsBindingIdentifier(e, t) {
+ if (super.chStartsBindingIdentifier(e, t)) {
+ return true;
+ }
+ const r = this.lookahead();
+ if (r.type === 144) {
+ return true;
+ }
+ return false;
+ }
+ verifyBreakContinue(e, t) {
+ if (e.label && e.label.type === 'Placeholder') return;
+ super.verifyBreakContinue(e, t);
+ }
+ parseExpressionStatement(e, t) {
+ var r;
+ if (
+ t.type !== 'Placeholder' ||
+ ((r = t.extra) != null && r.parenthesized)
+ ) {
+ return super.parseExpressionStatement(e, t);
+ }
+ if (this.match(14)) {
+ const r = e;
+ r.label = this.finishPlaceholder(t, 'Identifier');
+ this.next();
+ r.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration();
+ return this.finishNode(r, 'LabeledStatement');
+ }
+ this.semicolon();
+ e.name = t.name;
+ return this.finishPlaceholder(e, 'Statement');
+ }
+ parseBlock(e, t, r) {
+ return (
+ this.parsePlaceholder('BlockStatement') ||
+ super.parseBlock(e, t, r)
+ );
+ }
+ parseFunctionId(e) {
+ return (
+ this.parsePlaceholder('Identifier') || super.parseFunctionId(e)
+ );
+ }
+ parseClass(e, t, r) {
+ const s = t ? 'ClassDeclaration' : 'ClassExpression';
+ this.next();
+ const i = this.state.strict;
+ const n = this.parsePlaceholder('Identifier');
+ if (n) {
+ if (this.match(81) || this.match(144) || this.match(5)) {
+ e.id = n;
+ } else if (r || !t) {
+ e.id = null;
+ e.body = this.finishPlaceholder(n, 'ClassBody');
+ return this.finishNode(e, s);
+ } else {
+ throw this.raise(ne.ClassNameIsRequired, {
+ at: this.state.startLoc,
+ });
+ }
+ } else {
+ this.parseClassId(e, t, r);
+ }
+ super.parseClassSuper(e);
+ e.body =
+ this.parsePlaceholder('ClassBody') ||
+ super.parseClassBody(!!e.superClass, i);
+ return this.finishNode(e, s);
+ }
+ parseExport(e, t) {
+ const r = this.parsePlaceholder('Identifier');
+ if (!r) return super.parseExport(e, t);
+ if (!this.isContextual(98) && !this.match(12)) {
+ e.specifiers = [];
+ e.source = null;
+ e.declaration = this.finishPlaceholder(r, 'Declaration');
+ return this.finishNode(e, 'ExportNamedDeclaration');
+ }
+ this.expectPlugin('exportDefaultFrom');
+ const s = this.startNode();
+ s.exported = r;
+ e.specifiers = [this.finishNode(s, 'ExportDefaultSpecifier')];
+ return super.parseExport(e, t);
+ }
+ isExportDefaultSpecifier() {
+ if (this.match(65)) {
+ const e = this.nextTokenStart();
+ if (this.isUnparsedContextual(e, 'from')) {
+ if (
+ this.input.startsWith(
+ tokenLabelName(144),
+ this.nextTokenStartSince(e + 4),
+ )
+ ) {
+ return true;
+ }
+ }
+ }
+ return super.isExportDefaultSpecifier();
+ }
+ maybeParseExportDefaultSpecifier(e, t) {
+ var r;
+ if ((r = e.specifiers) != null && r.length) {
+ return true;
+ }
+ return super.maybeParseExportDefaultSpecifier(e, t);
+ }
+ checkExport(e) {
+ const { specifiers: t } = e;
+ if (t != null && t.length) {
+ e.specifiers = t.filter((e) => e.exported.type === 'Placeholder');
+ }
+ super.checkExport(e);
+ e.specifiers = t;
+ }
+ parseImport(e) {
+ const t = this.parsePlaceholder('Identifier');
+ if (!t) return super.parseImport(e);
+ e.specifiers = [];
+ if (!this.isContextual(98) && !this.match(12)) {
+ e.source = this.finishPlaceholder(t, 'StringLiteral');
+ this.semicolon();
+ return this.finishNode(e, 'ImportDeclaration');
+ }
+ const r = this.startNodeAtNode(t);
+ r.local = t;
+ e.specifiers.push(this.finishNode(r, 'ImportDefaultSpecifier'));
+ if (this.eat(12)) {
+ const t = this.maybeParseStarImportSpecifier(e);
+ if (!t) this.parseNamedImportSpecifiers(e);
+ }
+ this.expectContextual(98);
+ e.source = this.parseImportSource();
+ this.semicolon();
+ return this.finishNode(e, 'ImportDeclaration');
+ }
+ parseImportSource() {
+ return (
+ this.parsePlaceholder('StringLiteral') ||
+ super.parseImportSource()
+ );
+ }
+ assertNoSpace() {
+ if (this.state.start > this.state.lastTokEndLoc.index) {
+ this.raise(ne.UnexpectedSpace, { at: this.state.lastTokEndLoc });
+ }
+ }
+ };
+ var v8intrinsic = (e) =>
+ class V8IntrinsicMixin extends e {
+ parseV8Intrinsic() {
+ if (this.match(54)) {
+ const e = this.state.startLoc;
+ const t = this.startNode();
+ this.next();
+ if (tokenIsIdentifier(this.state.type)) {
+ const e = this.parseIdentifierName();
+ const r = this.createIdentifier(t, e);
+ r.type = 'V8IntrinsicIdentifier';
+ if (this.match(10)) {
+ return r;
+ }
+ }
+ this.unexpected(e);
+ }
+ }
+ parseExprAtom(e) {
+ return this.parseV8Intrinsic() || super.parseExprAtom(e);
+ }
+ };
+ function hasPlugin(e, t) {
+ const [r, s] = typeof t === 'string' ? [t, {}] : t;
+ const i = Object.keys(s);
+ const n = i.length === 0;
+ return e.some((e) => {
+ if (typeof e === 'string') {
+ return n && e === r;
+ } else {
+ const [t, n] = e;
+ if (t !== r) {
+ return false;
+ }
+ for (const e of i) {
+ if (n[e] !== s[e]) {
+ return false;
+ }
+ }
+ return true;
+ }
+ });
+ }
+ function getPluginOption(e, t, r) {
+ const s = e.find((e) => {
+ if (Array.isArray(e)) {
+ return e[0] === t;
+ } else {
+ return e === t;
+ }
+ });
+ if (s && Array.isArray(s) && s.length > 1) {
+ return s[1][r];
+ }
+ return null;
+ }
+ const ae = ['minimal', 'fsharp', 'hack', 'smart'];
+ const oe = ['^^', '@@', '^', '%', '#'];
+ const le = ['hash', 'bar'];
+ function validatePlugins(e) {
+ if (hasPlugin(e, 'decorators')) {
+ if (hasPlugin(e, 'decorators-legacy')) {
+ throw new Error(
+ 'Cannot use the decorators and decorators-legacy plugin together',
+ );
+ }
+ const t = getPluginOption(e, 'decorators', 'decoratorsBeforeExport');
+ if (t != null && typeof t !== 'boolean') {
+ throw new Error(
+ "'decoratorsBeforeExport' must be a boolean, if specified.",
+ );
+ }
+ const r = getPluginOption(e, 'decorators', 'allowCallParenthesized');
+ if (r != null && typeof r !== 'boolean') {
+ throw new Error("'allowCallParenthesized' must be a boolean.");
+ }
+ }
+ if (hasPlugin(e, 'flow') && hasPlugin(e, 'typescript')) {
+ throw new Error('Cannot combine flow and typescript plugins.');
+ }
+ if (hasPlugin(e, 'placeholders') && hasPlugin(e, 'v8intrinsic')) {
+ throw new Error(
+ 'Cannot combine placeholders and v8intrinsic plugins.',
+ );
+ }
+ if (hasPlugin(e, 'pipelineOperator')) {
+ const t = getPluginOption(e, 'pipelineOperator', 'proposal');
+ if (!ae.includes(t)) {
+ const e = ae.map((e) => `"${e}"`).join(', ');
+ throw new Error(
+ `"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`,
+ );
+ }
+ const r = hasPlugin(e, ['recordAndTuple', { syntaxType: 'hash' }]);
+ if (t === 'hack') {
+ if (hasPlugin(e, 'placeholders')) {
+ throw new Error(
+ 'Cannot combine placeholders plugin and Hack-style pipes.',
+ );
+ }
+ if (hasPlugin(e, 'v8intrinsic')) {
+ throw new Error(
+ 'Cannot combine v8intrinsic plugin and Hack-style pipes.',
+ );
+ }
+ const t = getPluginOption(e, 'pipelineOperator', 'topicToken');
+ if (!oe.includes(t)) {
+ const e = oe.map((e) => `"${e}"`).join(', ');
+ throw new Error(
+ `"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`,
+ );
+ }
+ if (t === '#' && r) {
+ throw new Error(
+ 'Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.',
+ );
+ }
+ } else if (t === 'smart' && r) {
+ throw new Error(
+ 'Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.',
+ );
+ }
+ }
+ if (hasPlugin(e, 'moduleAttributes')) {
+ {
+ if (
+ hasPlugin(e, 'importAssertions') ||
+ hasPlugin(e, 'importAttributes')
+ ) {
+ throw new Error(
+ 'Cannot combine importAssertions, importAttributes and moduleAttributes plugins.',
+ );
+ }
+ const t = getPluginOption(e, 'moduleAttributes', 'version');
+ if (t !== 'may-2020') {
+ throw new Error(
+ "The 'moduleAttributes' plugin requires a 'version' option," +
+ ' representing the last proposal update. Currently, the' +
+ " only supported value is 'may-2020'.",
+ );
+ }
+ }
+ }
+ if (
+ hasPlugin(e, 'importAssertions') &&
+ hasPlugin(e, 'importAttributes')
+ ) {
+ throw new Error(
+ 'Cannot combine importAssertions and importAttributes plugins.',
+ );
+ }
+ if (
+ hasPlugin(e, 'recordAndTuple') &&
+ getPluginOption(e, 'recordAndTuple', 'syntaxType') != null &&
+ !le.includes(getPluginOption(e, 'recordAndTuple', 'syntaxType'))
+ ) {
+ throw new Error(
+ "The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " +
+ le.map((e) => `'${e}'`).join(', '),
+ );
+ }
+ if (
+ hasPlugin(e, 'asyncDoExpressions') &&
+ !hasPlugin(e, 'doExpressions')
+ ) {
+ const e = new Error(
+ "'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.",
+ );
+ e.missingPlugins = 'doExpressions';
+ throw e;
+ }
+ if (
+ hasPlugin(e, 'optionalChainingAssign') &&
+ getPluginOption(e, 'optionalChainingAssign', 'version') !== '2023-07'
+ ) {
+ throw new Error(
+ "The 'optionalChainingAssign' plugin requires a 'version' option," +
+ ' representing the last proposal update. Currently, the' +
+ " only supported value is '2023-07'.",
+ );
+ }
+ }
+ const ce = {
+ estree: estree,
+ jsx: jsx,
+ flow: flow,
+ typescript: typescript,
+ v8intrinsic: v8intrinsic,
+ placeholders: placeholders,
+ };
+ const pe = Object.keys(ce);
+ const ue = {
+ sourceType: 'script',
+ sourceFilename: undefined,
+ startColumn: 0,
+ startLine: 1,
+ allowAwaitOutsideFunction: false,
+ allowReturnOutsideFunction: false,
+ allowNewTargetOutsideFunction: false,
+ allowImportExportEverywhere: false,
+ allowSuperOutsideMethod: false,
+ allowUndeclaredExports: false,
+ plugins: [],
+ strictMode: null,
+ ranges: false,
+ tokens: false,
+ createImportExpressions: false,
+ createParenthesizedExpressions: false,
+ errorRecovery: false,
+ attachComment: true,
+ annexB: true,
+ };
+ function getOptions(e) {
+ if (e == null) {
+ return Object.assign({}, ue);
+ }
+ if (e.annexB != null && e.annexB !== false) {
+ throw new Error('The `annexB` option can only be set to `false`.');
+ }
+ const t = {};
+ for (const s of Object.keys(ue)) {
+ var r;
+ t[s] = (r = e[s]) != null ? r : ue[s];
+ }
+ return t;
+ }
+ class ExpressionParser extends LValParser {
+ checkProto(e, t, r, s) {
+ if (
+ e.type === 'SpreadElement' ||
+ this.isObjectMethod(e) ||
+ e.computed ||
+ e.shorthand
+ ) {
+ return;
+ }
+ const i = e.key;
+ const n = i.type === 'Identifier' ? i.name : i.value;
+ if (n === '__proto__') {
+ if (t) {
+ this.raise(u.RecordNoProto, { at: i });
+ return;
+ }
+ if (r.used) {
+ if (s) {
+ if (s.doubleProtoLoc === null) {
+ s.doubleProtoLoc = i.loc.start;
+ }
+ } else {
+ this.raise(u.DuplicateProto, { at: i });
+ }
+ }
+ r.used = true;
+ }
+ }
+ shouldExitDescending(e, t) {
+ return e.type === 'ArrowFunctionExpression' && e.start === t;
+ }
+ getExpression() {
+ this.enterInitialScopes();
+ this.nextToken();
+ const e = this.parseExpression();
+ if (!this.match(139)) {
+ this.unexpected();
+ }
+ this.finalizeRemainingComments();
+ e.comments = this.state.comments;
+ e.errors = this.state.errors;
+ if (this.options.tokens) {
+ e.tokens = this.tokens;
+ }
+ return e;
+ }
+ parseExpression(e, t) {
+ if (e) {
+ return this.disallowInAnd(() => this.parseExpressionBase(t));
+ }
+ return this.allowInAnd(() => this.parseExpressionBase(t));
+ }
+ parseExpressionBase(e) {
+ const t = this.state.startLoc;
+ const r = this.parseMaybeAssign(e);
+ if (this.match(12)) {
+ const s = this.startNodeAt(t);
+ s.expressions = [r];
+ while (this.eat(12)) {
+ s.expressions.push(this.parseMaybeAssign(e));
+ }
+ this.toReferencedList(s.expressions);
+ return this.finishNode(s, 'SequenceExpression');
+ }
+ return r;
+ }
+ parseMaybeAssignDisallowIn(e, t) {
+ return this.disallowInAnd(() => this.parseMaybeAssign(e, t));
+ }
+ parseMaybeAssignAllowIn(e, t) {
+ return this.allowInAnd(() => this.parseMaybeAssign(e, t));
+ }
+ setOptionalParametersError(e, t) {
+ var r;
+ e.optionalParametersLoc =
+ (r = t == null ? void 0 : t.loc) != null ? r : this.state.startLoc;
+ }
+ parseMaybeAssign(e, t) {
+ const r = this.state.startLoc;
+ if (this.isContextual(108)) {
+ if (this.prodParam.hasYield) {
+ let e = this.parseYield();
+ if (t) {
+ e = t.call(this, e, r);
+ }
+ return e;
+ }
+ }
+ let s;
+ if (e) {
+ s = false;
+ } else {
+ e = new ExpressionErrors();
+ s = true;
+ }
+ const { type: i } = this.state;
+ if (i === 10 || tokenIsIdentifier(i)) {
+ this.state.potentialArrowAt = this.state.start;
+ }
+ let n = this.parseMaybeConditional(e);
+ if (t) {
+ n = t.call(this, n, r);
+ }
+ if (tokenIsAssignment(this.state.type)) {
+ const t = this.startNodeAt(r);
+ const s = this.state.value;
+ t.operator = s;
+ if (this.match(29)) {
+ this.toAssignable(n, true);
+ t.left = n;
+ const s = r.index;
+ if (e.doubleProtoLoc != null && e.doubleProtoLoc.index >= s) {
+ e.doubleProtoLoc = null;
+ }
+ if (
+ e.shorthandAssignLoc != null &&
+ e.shorthandAssignLoc.index >= s
+ ) {
+ e.shorthandAssignLoc = null;
+ }
+ if (e.privateKeyLoc != null && e.privateKeyLoc.index >= s) {
+ this.checkDestructuringPrivate(e);
+ e.privateKeyLoc = null;
+ }
+ } else {
+ t.left = n;
+ }
+ this.next();
+ t.right = this.parseMaybeAssign();
+ this.checkLVal(n, {
+ in: this.finishNode(t, 'AssignmentExpression'),
+ });
+ return t;
+ } else if (s) {
+ this.checkExpressionErrors(e, true);
+ }
+ return n;
+ }
+ parseMaybeConditional(e) {
+ const t = this.state.startLoc;
+ const r = this.state.potentialArrowAt;
+ const s = this.parseExprOps(e);
+ if (this.shouldExitDescending(s, r)) {
+ return s;
+ }
+ return this.parseConditional(s, t, e);
+ }
+ parseConditional(e, t, r) {
+ if (this.eat(17)) {
+ const r = this.startNodeAt(t);
+ r.test = e;
+ r.consequent = this.parseMaybeAssignAllowIn();
+ this.expect(14);
+ r.alternate = this.parseMaybeAssign();
+ return this.finishNode(r, 'ConditionalExpression');
+ }
+ return e;
+ }
+ parseMaybeUnaryOrPrivate(e) {
+ return this.match(138)
+ ? this.parsePrivateName()
+ : this.parseMaybeUnary(e);
+ }
+ parseExprOps(e) {
+ const t = this.state.startLoc;
+ const r = this.state.potentialArrowAt;
+ const s = this.parseMaybeUnaryOrPrivate(e);
+ if (this.shouldExitDescending(s, r)) {
+ return s;
+ }
+ return this.parseExprOp(s, t, -1);
+ }
+ parseExprOp(e, t, r) {
+ if (this.isPrivateName(e)) {
+ const t = this.getPrivateNameSV(e);
+ if (
+ r >= tokenOperatorPrecedence(58) ||
+ !this.prodParam.hasIn ||
+ !this.match(58)
+ ) {
+ this.raise(u.PrivateInExpectedIn, { at: e, identifierName: t });
+ }
+ this.classScope.usePrivateName(t, e.loc.start);
+ }
+ const s = this.state.type;
+ if (tokenIsOperator(s) && (this.prodParam.hasIn || !this.match(58))) {
+ let i = tokenOperatorPrecedence(s);
+ if (i > r) {
+ if (s === 39) {
+ this.expectPlugin('pipelineOperator');
+ if (this.state.inFSharpPipelineDirectBody) {
+ return e;
+ }
+ this.checkPipelineAtInfixOperator(e, t);
+ }
+ const n = this.startNodeAt(t);
+ n.left = e;
+ n.operator = this.state.value;
+ const a = s === 41 || s === 42;
+ const o = s === 40;
+ if (o) {
+ i = tokenOperatorPrecedence(42);
+ }
+ this.next();
+ if (
+ s === 39 &&
+ this.hasPlugin(['pipelineOperator', { proposal: 'minimal' }])
+ ) {
+ if (this.state.type === 96 && this.prodParam.hasAwait) {
+ throw this.raise(u.UnexpectedAwaitAfterPipelineBody, {
+ at: this.state.startLoc,
+ });
+ }
+ }
+ n.right = this.parseExprOpRightExpr(s, i);
+ const l = this.finishNode(
+ n,
+ a || o ? 'LogicalExpression' : 'BinaryExpression',
+ );
+ const c = this.state.type;
+ if ((o && (c === 41 || c === 42)) || (a && c === 40)) {
+ throw this.raise(u.MixingCoalesceWithLogical, {
+ at: this.state.startLoc,
+ });
+ }
+ return this.parseExprOp(l, t, r);
+ }
+ }
+ return e;
+ }
+ parseExprOpRightExpr(e, t) {
+ const r = this.state.startLoc;
+ switch (e) {
+ case 39:
+ switch (this.getPluginOption('pipelineOperator', 'proposal')) {
+ case 'hack':
+ return this.withTopicBindingContext(() =>
+ this.parseHackPipeBody(),
+ );
+ case 'smart':
+ return this.withTopicBindingContext(() => {
+ if (this.prodParam.hasYield && this.isContextual(108)) {
+ throw this.raise(u.PipeBodyIsTighter, {
+ at: this.state.startLoc,
+ });
+ }
+ return this.parseSmartPipelineBodyInStyle(
+ this.parseExprOpBaseRightExpr(e, t),
+ r,
+ );
+ });
+ case 'fsharp':
+ return this.withSoloAwaitPermittingContext(() =>
+ this.parseFSharpPipelineBody(t),
+ );
+ }
+ default:
+ return this.parseExprOpBaseRightExpr(e, t);
+ }
+ }
+ parseExprOpBaseRightExpr(e, t) {
+ const r = this.state.startLoc;
+ return this.parseExprOp(
+ this.parseMaybeUnaryOrPrivate(),
+ r,
+ tokenIsRightAssociative(e) ? t - 1 : t,
+ );
+ }
+ parseHackPipeBody() {
+ var e;
+ const { startLoc: t } = this.state;
+ const r = this.parseMaybeAssign();
+ const s = o.has(r.type);
+ if (s && !((e = r.extra) != null && e.parenthesized)) {
+ this.raise(u.PipeUnparenthesizedBody, { at: t, type: r.type });
+ }
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(u.PipeTopicUnused, { at: t });
+ }
+ return r;
+ }
+ checkExponentialAfterUnary(e) {
+ if (this.match(57)) {
+ this.raise(u.UnexpectedTokenUnaryExponentiation, {
+ at: e.argument,
+ });
+ }
+ }
+ parseMaybeUnary(e, t) {
+ const r = this.state.startLoc;
+ const s = this.isContextual(96);
+ if (s && this.isAwaitAllowed()) {
+ this.next();
+ const e = this.parseAwait(r);
+ if (!t) this.checkExponentialAfterUnary(e);
+ return e;
+ }
+ const i = this.match(34);
+ const n = this.startNode();
+ if (tokenIsPrefix(this.state.type)) {
+ n.operator = this.state.value;
+ n.prefix = true;
+ if (this.match(72)) {
+ this.expectPlugin('throwExpressions');
+ }
+ const r = this.match(89);
+ this.next();
+ n.argument = this.parseMaybeUnary(null, true);
+ this.checkExpressionErrors(e, true);
+ if (this.state.strict && r) {
+ const e = n.argument;
+ if (e.type === 'Identifier') {
+ this.raise(u.StrictDelete, { at: n });
+ } else if (this.hasPropertyAsPrivateName(e)) {
+ this.raise(u.DeletePrivateField, { at: n });
+ }
+ }
+ if (!i) {
+ if (!t) {
+ this.checkExponentialAfterUnary(n);
+ }
+ return this.finishNode(n, 'UnaryExpression');
+ }
+ }
+ const a = this.parseUpdate(n, i, e);
+ if (s) {
+ const { type: e } = this.state;
+ const t = this.hasPlugin('v8intrinsic')
+ ? tokenCanStartExpression(e)
+ : tokenCanStartExpression(e) && !this.match(54);
+ if (t && !this.isAmbiguousAwait()) {
+ this.raiseOverwrite(u.AwaitNotInAsyncContext, { at: r });
+ return this.parseAwait(r);
+ }
+ }
+ return a;
+ }
+ parseUpdate(e, t, r) {
+ if (t) {
+ const t = e;
+ this.checkLVal(t.argument, {
+ in: this.finishNode(t, 'UpdateExpression'),
+ });
+ return e;
+ }
+ const s = this.state.startLoc;
+ let i = this.parseExprSubscripts(r);
+ if (this.checkExpressionErrors(r, false)) return i;
+ while (
+ tokenIsPostfix(this.state.type) &&
+ !this.canInsertSemicolon()
+ ) {
+ const e = this.startNodeAt(s);
+ e.operator = this.state.value;
+ e.prefix = false;
+ e.argument = i;
+ this.next();
+ this.checkLVal(i, {
+ in: (i = this.finishNode(e, 'UpdateExpression')),
+ });
+ }
+ return i;
+ }
+ parseExprSubscripts(e) {
+ const t = this.state.startLoc;
+ const r = this.state.potentialArrowAt;
+ const s = this.parseExprAtom(e);
+ if (this.shouldExitDescending(s, r)) {
+ return s;
+ }
+ return this.parseSubscripts(s, t);
+ }
+ parseSubscripts(e, t, r) {
+ const s = {
+ optionalChainMember: false,
+ maybeAsyncArrow: this.atPossibleAsyncArrow(e),
+ stop: false,
+ };
+ do {
+ e = this.parseSubscript(e, t, r, s);
+ s.maybeAsyncArrow = false;
+ } while (!s.stop);
+ return e;
+ }
+ parseSubscript(e, t, r, s) {
+ const { type: i } = this.state;
+ if (!r && i === 15) {
+ return this.parseBind(e, t, r, s);
+ } else if (tokenIsTemplate(i)) {
+ return this.parseTaggedTemplateExpression(e, t, s);
+ }
+ let n = false;
+ if (i === 18) {
+ if (r) {
+ this.raise(u.OptionalChainingNoNew, { at: this.state.startLoc });
+ if (this.lookaheadCharCode() === 40) {
+ s.stop = true;
+ return e;
+ }
+ }
+ s.optionalChainMember = n = true;
+ this.next();
+ }
+ if (!r && this.match(10)) {
+ return this.parseCoverCallAndAsyncArrowHead(e, t, s, n);
+ } else {
+ const r = this.eat(0);
+ if (r || n || this.eat(16)) {
+ return this.parseMember(e, t, s, r, n);
+ } else {
+ s.stop = true;
+ return e;
+ }
+ }
+ }
+ parseMember(e, t, r, s, i) {
+ const n = this.startNodeAt(t);
+ n.object = e;
+ n.computed = s;
+ if (s) {
+ n.property = this.parseExpression();
+ this.expect(3);
+ } else if (this.match(138)) {
+ if (e.type === 'Super') {
+ this.raise(u.SuperPrivateField, { at: t });
+ }
+ this.classScope.usePrivateName(
+ this.state.value,
+ this.state.startLoc,
+ );
+ n.property = this.parsePrivateName();
+ } else {
+ n.property = this.parseIdentifier(true);
+ }
+ if (r.optionalChainMember) {
+ n.optional = i;
+ return this.finishNode(n, 'OptionalMemberExpression');
+ } else {
+ return this.finishNode(n, 'MemberExpression');
+ }
+ }
+ parseBind(e, t, r, s) {
+ const i = this.startNodeAt(t);
+ i.object = e;
+ this.next();
+ i.callee = this.parseNoCallExpr();
+ s.stop = true;
+ return this.parseSubscripts(
+ this.finishNode(i, 'BindExpression'),
+ t,
+ r,
+ );
+ }
+ parseCoverCallAndAsyncArrowHead(e, t, r, s) {
+ const i = this.state.maybeInArrowParameters;
+ let n = null;
+ this.state.maybeInArrowParameters = true;
+ this.next();
+ const a = this.startNodeAt(t);
+ a.callee = e;
+ const { maybeAsyncArrow: o, optionalChainMember: l } = r;
+ if (o) {
+ this.expressionScope.enter(newAsyncArrowScope());
+ n = new ExpressionErrors();
+ }
+ if (l) {
+ a.optional = s;
+ }
+ if (s) {
+ a.arguments = this.parseCallExpressionArguments(11);
+ } else {
+ a.arguments = this.parseCallExpressionArguments(
+ 11,
+ e.type === 'Import',
+ e.type !== 'Super',
+ a,
+ n,
+ );
+ }
+ let c = this.finishCallExpression(a, l);
+ if (o && this.shouldParseAsyncArrow() && !s) {
+ r.stop = true;
+ this.checkDestructuringPrivate(n);
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ c = this.parseAsyncArrowFromCallExpression(this.startNodeAt(t), c);
+ } else {
+ if (o) {
+ this.checkExpressionErrors(n, true);
+ this.expressionScope.exit();
+ }
+ this.toReferencedArguments(c);
+ }
+ this.state.maybeInArrowParameters = i;
+ return c;
+ }
+ toReferencedArguments(e, t) {
+ this.toReferencedListDeep(e.arguments, t);
+ }
+ parseTaggedTemplateExpression(e, t, r) {
+ const s = this.startNodeAt(t);
+ s.tag = e;
+ s.quasi = this.parseTemplate(true);
+ if (r.optionalChainMember) {
+ this.raise(u.OptionalChainingNoTemplate, { at: t });
+ }
+ return this.finishNode(s, 'TaggedTemplateExpression');
+ }
+ atPossibleAsyncArrow(e) {
+ return (
+ e.type === 'Identifier' &&
+ e.name === 'async' &&
+ this.state.lastTokEndLoc.index === e.end &&
+ !this.canInsertSemicolon() &&
+ e.end - e.start === 5 &&
+ e.start === this.state.potentialArrowAt
+ );
+ }
+ expectImportAttributesPlugin() {
+ if (!this.hasPlugin('importAssertions')) {
+ this.expectPlugin('importAttributes');
+ }
+ }
+ finishCallExpression(e, t) {
+ if (e.callee.type === 'Import') {
+ if (e.arguments.length === 2) {
+ {
+ if (!this.hasPlugin('moduleAttributes')) {
+ this.expectImportAttributesPlugin();
+ }
+ }
+ }
+ if (e.arguments.length === 0 || e.arguments.length > 2) {
+ this.raise(u.ImportCallArity, {
+ at: e,
+ maxArgumentCount:
+ this.hasPlugin('importAttributes') ||
+ this.hasPlugin('importAssertions') ||
+ this.hasPlugin('moduleAttributes')
+ ? 2
+ : 1,
+ });
+ } else {
+ for (const t of e.arguments) {
+ if (t.type === 'SpreadElement') {
+ this.raise(u.ImportCallSpreadArgument, { at: t });
+ }
+ }
+ }
+ }
+ return this.finishNode(
+ e,
+ t ? 'OptionalCallExpression' : 'CallExpression',
+ );
+ }
+ parseCallExpressionArguments(e, t, r, s, i) {
+ const n = [];
+ let a = true;
+ const o = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ while (!this.eat(e)) {
+ if (a) {
+ a = false;
+ } else {
+ this.expect(12);
+ if (this.match(e)) {
+ if (
+ t &&
+ !this.hasPlugin('importAttributes') &&
+ !this.hasPlugin('importAssertions') &&
+ !this.hasPlugin('moduleAttributes')
+ ) {
+ this.raise(u.ImportCallArgumentTrailingComma, {
+ at: this.state.lastTokStartLoc,
+ });
+ }
+ if (s) {
+ this.addTrailingCommaExtraToNode(s);
+ }
+ this.next();
+ break;
+ }
+ }
+ n.push(this.parseExprListItem(false, i, r));
+ }
+ this.state.inFSharpPipelineDirectBody = o;
+ return n;
+ }
+ shouldParseAsyncArrow() {
+ return this.match(19) && !this.canInsertSemicolon();
+ }
+ parseAsyncArrowFromCallExpression(e, t) {
+ var r;
+ this.resetPreviousNodeTrailingComments(t);
+ this.expect(19);
+ this.parseArrowExpression(
+ e,
+ t.arguments,
+ true,
+ (r = t.extra) == null ? void 0 : r.trailingCommaLoc,
+ );
+ if (t.innerComments) {
+ setInnerComments(e, t.innerComments);
+ }
+ if (t.callee.trailingComments) {
+ setInnerComments(e, t.callee.trailingComments);
+ }
+ return e;
+ }
+ parseNoCallExpr() {
+ const e = this.state.startLoc;
+ return this.parseSubscripts(this.parseExprAtom(), e, true);
+ }
+ parseExprAtom(e) {
+ let t;
+ let r = null;
+ const { type: s } = this.state;
+ switch (s) {
+ case 79:
+ return this.parseSuper();
+ case 83:
+ t = this.startNode();
+ this.next();
+ if (this.match(16)) {
+ return this.parseImportMetaProperty(t);
+ }
+ if (this.match(10)) {
+ if (this.options.createImportExpressions) {
+ return this.parseImportCall(t);
+ } else {
+ return this.finishNode(t, 'Import');
+ }
+ } else {
+ this.raise(u.UnsupportedImport, {
+ at: this.state.lastTokStartLoc,
+ });
+ return this.finishNode(t, 'Import');
+ }
+ case 78:
+ t = this.startNode();
+ this.next();
+ return this.finishNode(t, 'ThisExpression');
+ case 90: {
+ return this.parseDo(this.startNode(), false);
+ }
+ case 56:
+ case 31: {
+ this.readRegexp();
+ return this.parseRegExpLiteral(this.state.value);
+ }
+ case 134:
+ return this.parseNumericLiteral(this.state.value);
+ case 135:
+ return this.parseBigIntLiteral(this.state.value);
+ case 136:
+ return this.parseDecimalLiteral(this.state.value);
+ case 133:
+ return this.parseStringLiteral(this.state.value);
+ case 84:
+ return this.parseNullLiteral();
+ case 85:
+ return this.parseBooleanLiteral(true);
+ case 86:
+ return this.parseBooleanLiteral(false);
+ case 10: {
+ const e = this.state.potentialArrowAt === this.state.start;
+ return this.parseParenAndDistinguishExpression(e);
+ }
+ case 2:
+ case 1: {
+ return this.parseArrayLike(
+ this.state.type === 2 ? 4 : 3,
+ false,
+ true,
+ );
+ }
+ case 0: {
+ return this.parseArrayLike(3, true, false, e);
+ }
+ case 6:
+ case 7: {
+ return this.parseObjectLike(
+ this.state.type === 6 ? 9 : 8,
+ false,
+ true,
+ );
+ }
+ case 5: {
+ return this.parseObjectLike(8, false, false, e);
+ }
+ case 68:
+ return this.parseFunctionOrFunctionSent();
+ case 26:
+ r = this.parseDecorators();
+ case 80:
+ return this.parseClass(
+ this.maybeTakeDecorators(r, this.startNode()),
+ false,
+ );
+ case 77:
+ return this.parseNewOrNewTarget();
+ case 25:
+ case 24:
+ return this.parseTemplate(false);
+ case 15: {
+ t = this.startNode();
+ this.next();
+ t.object = null;
+ const e = (t.callee = this.parseNoCallExpr());
+ if (e.type === 'MemberExpression') {
+ return this.finishNode(t, 'BindExpression');
+ } else {
+ throw this.raise(u.UnsupportedBind, { at: e });
+ }
+ }
+ case 138: {
+ this.raise(u.PrivateInExpectedIn, {
+ at: this.state.startLoc,
+ identifierName: this.state.value,
+ });
+ return this.parsePrivateName();
+ }
+ case 33: {
+ return this.parseTopicReferenceThenEqualsSign(54, '%');
+ }
+ case 32: {
+ return this.parseTopicReferenceThenEqualsSign(44, '^');
+ }
+ case 37:
+ case 38: {
+ return this.parseTopicReference('hack');
+ }
+ case 44:
+ case 54:
+ case 27: {
+ const e = this.getPluginOption('pipelineOperator', 'proposal');
+ if (e) {
+ return this.parseTopicReference(e);
+ }
+ this.unexpected();
+ break;
+ }
+ case 47: {
+ const e = this.input.codePointAt(this.nextTokenStart());
+ if (isIdentifierStart(e) || e === 62) {
+ this.expectOnePlugin(['jsx', 'flow', 'typescript']);
+ } else {
+ this.unexpected();
+ }
+ break;
+ }
+ default:
+ if (tokenIsIdentifier(s)) {
+ if (
+ this.isContextual(127) &&
+ this.lookaheadInLineCharCode() === 123
+ ) {
+ return this.parseModuleExpression();
+ }
+ const e = this.state.potentialArrowAt === this.state.start;
+ const t = this.state.containsEsc;
+ const r = this.parseIdentifier();
+ if (!t && r.name === 'async' && !this.canInsertSemicolon()) {
+ const { type: e } = this.state;
+ if (e === 68) {
+ this.resetPreviousNodeTrailingComments(r);
+ this.next();
+ return this.parseAsyncFunctionExpression(
+ this.startNodeAtNode(r),
+ );
+ } else if (tokenIsIdentifier(e)) {
+ if (this.lookaheadCharCode() === 61) {
+ return this.parseAsyncArrowUnaryFunction(
+ this.startNodeAtNode(r),
+ );
+ } else {
+ return r;
+ }
+ } else if (e === 90) {
+ this.resetPreviousNodeTrailingComments(r);
+ return this.parseDo(this.startNodeAtNode(r), true);
+ }
+ }
+ if (e && this.match(19) && !this.canInsertSemicolon()) {
+ this.next();
+ return this.parseArrowExpression(
+ this.startNodeAtNode(r),
+ [r],
+ false,
+ );
+ }
+ return r;
+ } else {
+ this.unexpected();
+ }
+ }
+ }
+ parseTopicReferenceThenEqualsSign(e, t) {
+ const r = this.getPluginOption('pipelineOperator', 'proposal');
+ if (r) {
+ this.state.type = e;
+ this.state.value = t;
+ this.state.pos--;
+ this.state.end--;
+ this.state.endLoc = createPositionWithColumnOffset(
+ this.state.endLoc,
+ -1,
+ );
+ return this.parseTopicReference(r);
+ } else {
+ this.unexpected();
+ }
+ }
+ parseTopicReference(e) {
+ const t = this.startNode();
+ const r = this.state.startLoc;
+ const s = this.state.type;
+ this.next();
+ return this.finishTopicReference(t, r, e, s);
+ }
+ finishTopicReference(e, t, r, s) {
+ if (this.testTopicReferenceConfiguration(r, t, s)) {
+ const s =
+ r === 'smart'
+ ? 'PipelinePrimaryTopicReference'
+ : 'TopicReference';
+ if (!this.topicReferenceIsAllowedInCurrentContext()) {
+ this.raise(
+ r === 'smart' ? u.PrimaryTopicNotAllowed : u.PipeTopicUnbound,
+ { at: t },
+ );
+ }
+ this.registerTopicReference();
+ return this.finishNode(e, s);
+ } else {
+ throw this.raise(u.PipeTopicUnconfiguredToken, {
+ at: t,
+ token: tokenLabelName(s),
+ });
+ }
+ }
+ testTopicReferenceConfiguration(e, t, r) {
+ switch (e) {
+ case 'hack': {
+ return this.hasPlugin([
+ 'pipelineOperator',
+ { topicToken: tokenLabelName(r) },
+ ]);
+ }
+ case 'smart':
+ return r === 27;
+ default:
+ throw this.raise(u.PipeTopicRequiresHackPipes, { at: t });
+ }
+ }
+ parseAsyncArrowUnaryFunction(e) {
+ this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));
+ const t = [this.parseIdentifier()];
+ this.prodParam.exit();
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(u.LineTerminatorBeforeArrow, {
+ at: this.state.curPosition(),
+ });
+ }
+ this.expect(19);
+ return this.parseArrowExpression(e, t, true);
+ }
+ parseDo(e, t) {
+ this.expectPlugin('doExpressions');
+ if (t) {
+ this.expectPlugin('asyncDoExpressions');
+ }
+ e.async = t;
+ this.next();
+ const r = this.state.labels;
+ this.state.labels = [];
+ if (t) {
+ this.prodParam.enter(2);
+ e.body = this.parseBlock();
+ this.prodParam.exit();
+ } else {
+ e.body = this.parseBlock();
+ }
+ this.state.labels = r;
+ return this.finishNode(e, 'DoExpression');
+ }
+ parseSuper() {
+ const e = this.startNode();
+ this.next();
+ if (
+ this.match(10) &&
+ !this.scope.allowDirectSuper &&
+ !this.options.allowSuperOutsideMethod
+ ) {
+ this.raise(u.SuperNotAllowed, { at: e });
+ } else if (
+ !this.scope.allowSuper &&
+ !this.options.allowSuperOutsideMethod
+ ) {
+ this.raise(u.UnexpectedSuper, { at: e });
+ }
+ if (!this.match(10) && !this.match(0) && !this.match(16)) {
+ this.raise(u.UnsupportedSuper, { at: e });
+ }
+ return this.finishNode(e, 'Super');
+ }
+ parsePrivateName() {
+ const e = this.startNode();
+ const t = this.startNodeAt(
+ createPositionWithColumnOffset(this.state.startLoc, 1),
+ );
+ const r = this.state.value;
+ this.next();
+ e.id = this.createIdentifier(t, r);
+ return this.finishNode(e, 'PrivateName');
+ }
+ parseFunctionOrFunctionSent() {
+ const e = this.startNode();
+ this.next();
+ if (this.prodParam.hasYield && this.match(16)) {
+ const t = this.createIdentifier(
+ this.startNodeAtNode(e),
+ 'function',
+ );
+ this.next();
+ if (this.match(103)) {
+ this.expectPlugin('functionSent');
+ } else if (!this.hasPlugin('functionSent')) {
+ this.unexpected();
+ }
+ return this.parseMetaProperty(e, t, 'sent');
+ }
+ return this.parseFunction(e);
+ }
+ parseMetaProperty(e, t, r) {
+ e.meta = t;
+ const s = this.state.containsEsc;
+ e.property = this.parseIdentifier(true);
+ if (e.property.name !== r || s) {
+ this.raise(u.UnsupportedMetaProperty, {
+ at: e.property,
+ target: t.name,
+ onlyValidPropertyName: r,
+ });
+ }
+ return this.finishNode(e, 'MetaProperty');
+ }
+ parseImportMetaProperty(e) {
+ const t = this.createIdentifier(this.startNodeAtNode(e), 'import');
+ this.next();
+ if (this.isContextual(101)) {
+ if (!this.inModule) {
+ this.raise(u.ImportMetaOutsideModule, { at: t });
+ }
+ this.sawUnambiguousESM = true;
+ } else if (this.isContextual(105) || this.isContextual(97)) {
+ const t = this.isContextual(105);
+ if (!t) this.unexpected();
+ this.expectPlugin(
+ t ? 'sourcePhaseImports' : 'deferredImportEvaluation',
+ );
+ if (!this.options.createImportExpressions) {
+ throw this.raise(u.DynamicImportPhaseRequiresImportExpressions, {
+ at: this.state.startLoc,
+ phase: this.state.value,
+ });
+ }
+ this.next();
+ e.phase = t ? 'source' : 'defer';
+ return this.parseImportCall(e);
+ }
+ return this.parseMetaProperty(e, t, 'meta');
+ }
+ parseLiteralAtNode(e, t, r) {
+ this.addExtra(r, 'rawValue', e);
+ this.addExtra(r, 'raw', this.input.slice(r.start, this.state.end));
+ r.value = e;
+ this.next();
+ return this.finishNode(r, t);
+ }
+ parseLiteral(e, t) {
+ const r = this.startNode();
+ return this.parseLiteralAtNode(e, t, r);
+ }
+ parseStringLiteral(e) {
+ return this.parseLiteral(e, 'StringLiteral');
+ }
+ parseNumericLiteral(e) {
+ return this.parseLiteral(e, 'NumericLiteral');
+ }
+ parseBigIntLiteral(e) {
+ return this.parseLiteral(e, 'BigIntLiteral');
+ }
+ parseDecimalLiteral(e) {
+ return this.parseLiteral(e, 'DecimalLiteral');
+ }
+ parseRegExpLiteral(e) {
+ const t = this.parseLiteral(e.value, 'RegExpLiteral');
+ t.pattern = e.pattern;
+ t.flags = e.flags;
+ return t;
+ }
+ parseBooleanLiteral(e) {
+ const t = this.startNode();
+ t.value = e;
+ this.next();
+ return this.finishNode(t, 'BooleanLiteral');
+ }
+ parseNullLiteral() {
+ const e = this.startNode();
+ this.next();
+ return this.finishNode(e, 'NullLiteral');
+ }
+ parseParenAndDistinguishExpression(e) {
+ const t = this.state.startLoc;
+ let r;
+ this.next();
+ this.expressionScope.enter(newArrowHeadScope());
+ const s = this.state.maybeInArrowParameters;
+ const i = this.state.inFSharpPipelineDirectBody;
+ this.state.maybeInArrowParameters = true;
+ this.state.inFSharpPipelineDirectBody = false;
+ const n = this.state.startLoc;
+ const a = [];
+ const o = new ExpressionErrors();
+ let l = true;
+ let c;
+ let p;
+ while (!this.match(11)) {
+ if (l) {
+ l = false;
+ } else {
+ this.expect(
+ 12,
+ o.optionalParametersLoc === null
+ ? null
+ : o.optionalParametersLoc,
+ );
+ if (this.match(11)) {
+ p = this.state.startLoc;
+ break;
+ }
+ }
+ if (this.match(21)) {
+ const e = this.state.startLoc;
+ c = this.state.startLoc;
+ a.push(this.parseParenItem(this.parseRestBinding(), e));
+ if (!this.checkCommaAfterRest(41)) {
+ break;
+ }
+ } else {
+ a.push(this.parseMaybeAssignAllowIn(o, this.parseParenItem));
+ }
+ }
+ const u = this.state.lastTokEndLoc;
+ this.expect(11);
+ this.state.maybeInArrowParameters = s;
+ this.state.inFSharpPipelineDirectBody = i;
+ let d = this.startNodeAt(t);
+ if (e && this.shouldParseArrow(a) && (d = this.parseArrow(d))) {
+ this.checkDestructuringPrivate(o);
+ this.expressionScope.validateAsPattern();
+ this.expressionScope.exit();
+ this.parseArrowExpression(d, a, false);
+ return d;
+ }
+ this.expressionScope.exit();
+ if (!a.length) {
+ this.unexpected(this.state.lastTokStartLoc);
+ }
+ if (p) this.unexpected(p);
+ if (c) this.unexpected(c);
+ this.checkExpressionErrors(o, true);
+ this.toReferencedListDeep(a, true);
+ if (a.length > 1) {
+ r = this.startNodeAt(n);
+ r.expressions = a;
+ this.finishNode(r, 'SequenceExpression');
+ this.resetEndLocation(r, u);
+ } else {
+ r = a[0];
+ }
+ return this.wrapParenthesis(t, r);
+ }
+ wrapParenthesis(e, t) {
+ if (!this.options.createParenthesizedExpressions) {
+ this.addExtra(t, 'parenthesized', true);
+ this.addExtra(t, 'parenStart', e.index);
+ this.takeSurroundingComments(
+ t,
+ e.index,
+ this.state.lastTokEndLoc.index,
+ );
+ return t;
+ }
+ const r = this.startNodeAt(e);
+ r.expression = t;
+ return this.finishNode(r, 'ParenthesizedExpression');
+ }
+ shouldParseArrow(e) {
+ return !this.canInsertSemicolon();
+ }
+ parseArrow(e) {
+ if (this.eat(19)) {
+ return e;
+ }
+ }
+ parseParenItem(e, t) {
+ return e;
+ }
+ parseNewOrNewTarget() {
+ const e = this.startNode();
+ this.next();
+ if (this.match(16)) {
+ const t = this.createIdentifier(this.startNodeAtNode(e), 'new');
+ this.next();
+ const r = this.parseMetaProperty(e, t, 'target');
+ if (
+ !this.scope.inNonArrowFunction &&
+ !this.scope.inClass &&
+ !this.options.allowNewTargetOutsideFunction
+ ) {
+ this.raise(u.UnexpectedNewTarget, { at: r });
+ }
+ return r;
+ }
+ return this.parseNew(e);
+ }
+ parseNew(e) {
+ this.parseNewCallee(e);
+ if (this.eat(10)) {
+ const t = this.parseExprList(11);
+ this.toReferencedList(t);
+ e.arguments = t;
+ } else {
+ e.arguments = [];
+ }
+ return this.finishNode(e, 'NewExpression');
+ }
+ parseNewCallee(e) {
+ const t = this.match(83);
+ const r = this.parseNoCallExpr();
+ e.callee = r;
+ if (t && (r.type === 'Import' || r.type === 'ImportExpression')) {
+ this.raise(u.ImportCallNotNewExpression, { at: r });
+ }
+ }
+ parseTemplateElement(e) {
+ const { start: t, startLoc: r, end: s, value: i } = this.state;
+ const n = t + 1;
+ const a = this.startNodeAt(createPositionWithColumnOffset(r, 1));
+ if (i === null) {
+ if (!e) {
+ this.raise(u.InvalidEscapeSequenceTemplate, {
+ at: createPositionWithColumnOffset(
+ this.state.firstInvalidTemplateEscapePos,
+ 1,
+ ),
+ });
+ }
+ }
+ const o = this.match(24);
+ const l = o ? -1 : -2;
+ const c = s + l;
+ a.value = {
+ raw: this.input.slice(n, c).replace(/\r\n?/g, '\n'),
+ cooked: i === null ? null : i.slice(1, l),
+ };
+ a.tail = o;
+ this.next();
+ const p = this.finishNode(a, 'TemplateElement');
+ this.resetEndLocation(
+ p,
+ createPositionWithColumnOffset(this.state.lastTokEndLoc, l),
+ );
+ return p;
+ }
+ parseTemplate(e) {
+ const t = this.startNode();
+ t.expressions = [];
+ let r = this.parseTemplateElement(e);
+ t.quasis = [r];
+ while (!r.tail) {
+ t.expressions.push(this.parseTemplateSubstitution());
+ this.readTemplateContinuation();
+ t.quasis.push((r = this.parseTemplateElement(e)));
+ }
+ return this.finishNode(t, 'TemplateLiteral');
+ }
+ parseTemplateSubstitution() {
+ return this.parseExpression();
+ }
+ parseObjectLike(e, t, r, s) {
+ if (r) {
+ this.expectPlugin('recordAndTuple');
+ }
+ const i = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const n = Object.create(null);
+ let a = true;
+ const o = this.startNode();
+ o.properties = [];
+ this.next();
+ while (!this.match(e)) {
+ if (a) {
+ a = false;
+ } else {
+ this.expect(12);
+ if (this.match(e)) {
+ this.addTrailingCommaExtraToNode(o);
+ break;
+ }
+ }
+ let i;
+ if (t) {
+ i = this.parseBindingProperty();
+ } else {
+ i = this.parsePropertyDefinition(s);
+ this.checkProto(i, r, n, s);
+ }
+ if (r && !this.isObjectProperty(i) && i.type !== 'SpreadElement') {
+ this.raise(u.InvalidRecordProperty, { at: i });
+ }
+ if (i.shorthand) {
+ this.addExtra(i, 'shorthand', true);
+ }
+ o.properties.push(i);
+ }
+ this.next();
+ this.state.inFSharpPipelineDirectBody = i;
+ let l = 'ObjectExpression';
+ if (t) {
+ l = 'ObjectPattern';
+ } else if (r) {
+ l = 'RecordExpression';
+ }
+ return this.finishNode(o, l);
+ }
+ addTrailingCommaExtraToNode(e) {
+ this.addExtra(e, 'trailingComma', this.state.lastTokStart);
+ this.addExtra(
+ e,
+ 'trailingCommaLoc',
+ this.state.lastTokStartLoc,
+ false,
+ );
+ }
+ maybeAsyncOrAccessorProp(e) {
+ return (
+ !e.computed &&
+ e.key.type === 'Identifier' &&
+ (this.isLiteralPropertyName() || this.match(0) || this.match(55))
+ );
+ }
+ parsePropertyDefinition(e) {
+ let t = [];
+ if (this.match(26)) {
+ if (this.hasPlugin('decorators')) {
+ this.raise(u.UnsupportedPropertyDecorator, {
+ at: this.state.startLoc,
+ });
+ }
+ while (this.match(26)) {
+ t.push(this.parseDecorator());
+ }
+ }
+ const r = this.startNode();
+ let s = false;
+ let i = false;
+ let n;
+ if (this.match(21)) {
+ if (t.length) this.unexpected();
+ return this.parseSpread();
+ }
+ if (t.length) {
+ r.decorators = t;
+ t = [];
+ }
+ r.method = false;
+ if (e) {
+ n = this.state.startLoc;
+ }
+ let a = this.eat(55);
+ this.parsePropertyNamePrefixOperator(r);
+ const o = this.state.containsEsc;
+ const l = this.parsePropertyName(r, e);
+ if (!a && !o && this.maybeAsyncOrAccessorProp(r)) {
+ const e = l.name;
+ if (e === 'async' && !this.hasPrecedingLineBreak()) {
+ s = true;
+ this.resetPreviousNodeTrailingComments(l);
+ a = this.eat(55);
+ this.parsePropertyName(r);
+ }
+ if (e === 'get' || e === 'set') {
+ i = true;
+ this.resetPreviousNodeTrailingComments(l);
+ r.kind = e;
+ if (this.match(55)) {
+ a = true;
+ this.raise(u.AccessorIsGenerator, {
+ at: this.state.curPosition(),
+ kind: e,
+ });
+ this.next();
+ }
+ this.parsePropertyName(r);
+ }
+ }
+ return this.parseObjPropValue(r, n, a, s, false, i, e);
+ }
+ getGetterSetterExpectedParamCount(e) {
+ return e.kind === 'get' ? 0 : 1;
+ }
+ getObjectOrClassMethodParams(e) {
+ return e.params;
+ }
+ checkGetterSetterParams(e) {
+ var t;
+ const r = this.getGetterSetterExpectedParamCount(e);
+ const s = this.getObjectOrClassMethodParams(e);
+ if (s.length !== r) {
+ this.raise(e.kind === 'get' ? u.BadGetterArity : u.BadSetterArity, {
+ at: e,
+ });
+ }
+ if (
+ e.kind === 'set' &&
+ ((t = s[s.length - 1]) == null ? void 0 : t.type) === 'RestElement'
+ ) {
+ this.raise(u.BadSetterRestParameter, { at: e });
+ }
+ }
+ parseObjectMethod(e, t, r, s, i) {
+ if (i) {
+ const r = this.parseMethod(
+ e,
+ t,
+ false,
+ false,
+ false,
+ 'ObjectMethod',
+ );
+ this.checkGetterSetterParams(r);
+ return r;
+ }
+ if (r || t || this.match(10)) {
+ if (s) this.unexpected();
+ e.kind = 'method';
+ e.method = true;
+ return this.parseMethod(e, t, r, false, false, 'ObjectMethod');
+ }
+ }
+ parseObjectProperty(e, t, r, s) {
+ e.shorthand = false;
+ if (this.eat(14)) {
+ e.value = r
+ ? this.parseMaybeDefault(this.state.startLoc)
+ : this.parseMaybeAssignAllowIn(s);
+ return this.finishNode(e, 'ObjectProperty');
+ }
+ if (!e.computed && e.key.type === 'Identifier') {
+ this.checkReservedWord(e.key.name, e.key.loc.start, true, false);
+ if (r) {
+ e.value = this.parseMaybeDefault(t, cloneIdentifier(e.key));
+ } else if (this.match(29)) {
+ const r = this.state.startLoc;
+ if (s != null) {
+ if (s.shorthandAssignLoc === null) {
+ s.shorthandAssignLoc = r;
+ }
+ } else {
+ this.raise(u.InvalidCoverInitializedName, { at: r });
+ }
+ e.value = this.parseMaybeDefault(t, cloneIdentifier(e.key));
+ } else {
+ e.value = cloneIdentifier(e.key);
+ }
+ e.shorthand = true;
+ return this.finishNode(e, 'ObjectProperty');
+ }
+ }
+ parseObjPropValue(e, t, r, s, i, n, a) {
+ const o =
+ this.parseObjectMethod(e, r, s, i, n) ||
+ this.parseObjectProperty(e, t, i, a);
+ if (!o) this.unexpected();
+ return o;
+ }
+ parsePropertyName(e, t) {
+ if (this.eat(0)) {
+ e.computed = true;
+ e.key = this.parseMaybeAssignAllowIn();
+ this.expect(3);
+ } else {
+ const { type: r, value: s } = this.state;
+ let i;
+ if (tokenIsKeywordOrIdentifier(r)) {
+ i = this.parseIdentifier(true);
+ } else {
+ switch (r) {
+ case 134:
+ i = this.parseNumericLiteral(s);
+ break;
+ case 133:
+ i = this.parseStringLiteral(s);
+ break;
+ case 135:
+ i = this.parseBigIntLiteral(s);
+ break;
+ case 136:
+ i = this.parseDecimalLiteral(s);
+ break;
+ case 138: {
+ const e = this.state.startLoc;
+ if (t != null) {
+ if (t.privateKeyLoc === null) {
+ t.privateKeyLoc = e;
+ }
+ } else {
+ this.raise(u.UnexpectedPrivateField, { at: e });
+ }
+ i = this.parsePrivateName();
+ break;
+ }
+ default:
+ this.unexpected();
+ }
+ }
+ e.key = i;
+ if (r !== 138) {
+ e.computed = false;
+ }
+ }
+ return e.key;
+ }
+ initFunction(e, t) {
+ e.id = null;
+ e.generator = false;
+ e.async = t;
+ }
+ parseMethod(e, t, r, s, i, n, a = false) {
+ this.initFunction(e, r);
+ e.generator = t;
+ this.scope.enter(2 | 16 | (a ? 64 : 0) | (i ? 32 : 0));
+ this.prodParam.enter(functionFlags(r, e.generator));
+ this.parseFunctionParams(e, s);
+ const o = this.parseFunctionBodyAndFinish(e, n, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ return o;
+ }
+ parseArrayLike(e, t, r, s) {
+ if (r) {
+ this.expectPlugin('recordAndTuple');
+ }
+ const i = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const n = this.startNode();
+ this.next();
+ n.elements = this.parseExprList(e, !r, s, n);
+ this.state.inFSharpPipelineDirectBody = i;
+ return this.finishNode(n, r ? 'TupleExpression' : 'ArrayExpression');
+ }
+ parseArrowExpression(e, t, r, s) {
+ this.scope.enter(2 | 4);
+ let i = functionFlags(r, false);
+ if (!this.match(5) && this.prodParam.hasIn) {
+ i |= 8;
+ }
+ this.prodParam.enter(i);
+ this.initFunction(e, r);
+ const n = this.state.maybeInArrowParameters;
+ if (t) {
+ this.state.maybeInArrowParameters = true;
+ this.setArrowFunctionParameters(e, t, s);
+ }
+ this.state.maybeInArrowParameters = false;
+ this.parseFunctionBody(e, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.maybeInArrowParameters = n;
+ return this.finishNode(e, 'ArrowFunctionExpression');
+ }
+ setArrowFunctionParameters(e, t, r) {
+ this.toAssignableList(t, r, false);
+ e.params = t;
+ }
+ parseFunctionBodyAndFinish(e, t, r = false) {
+ this.parseFunctionBody(e, false, r);
+ return this.finishNode(e, t);
+ }
+ parseFunctionBody(e, t, r = false) {
+ const s = t && !this.match(5);
+ this.expressionScope.enter(newExpressionScope());
+ if (s) {
+ e.body = this.parseMaybeAssign();
+ this.checkParams(e, false, t, false);
+ } else {
+ const s = this.state.strict;
+ const i = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(this.prodParam.currentFlags() | 4);
+ e.body = this.parseBlock(true, false, (i) => {
+ const n = !this.isSimpleParamList(e.params);
+ if (i && n) {
+ this.raise(u.IllegalLanguageModeDirective, {
+ at:
+ (e.kind === 'method' || e.kind === 'constructor') && !!e.key
+ ? e.key.loc.end
+ : e,
+ });
+ }
+ const a = !s && this.state.strict;
+ this.checkParams(e, !this.state.strict && !t && !r && !n, t, a);
+ if (this.state.strict && e.id) {
+ this.checkIdentifier(e.id, 65, a);
+ }
+ });
+ this.prodParam.exit();
+ this.state.labels = i;
+ }
+ this.expressionScope.exit();
+ }
+ isSimpleParameter(e) {
+ return e.type === 'Identifier';
+ }
+ isSimpleParamList(e) {
+ for (let t = 0, r = e.length; t < r; t++) {
+ if (!this.isSimpleParameter(e[t])) return false;
+ }
+ return true;
+ }
+ checkParams(e, t, r, s = true) {
+ const i = !t && new Set();
+ const n = { type: 'FormalParameters' };
+ for (const t of e.params) {
+ this.checkLVal(t, {
+ in: n,
+ binding: 5,
+ checkClashes: i,
+ strictModeChanged: s,
+ });
+ }
+ }
+ parseExprList(e, t, r, s) {
+ const i = [];
+ let n = true;
+ while (!this.eat(e)) {
+ if (n) {
+ n = false;
+ } else {
+ this.expect(12);
+ if (this.match(e)) {
+ if (s) {
+ this.addTrailingCommaExtraToNode(s);
+ }
+ this.next();
+ break;
+ }
+ }
+ i.push(this.parseExprListItem(t, r));
+ }
+ return i;
+ }
+ parseExprListItem(e, t, r) {
+ let s;
+ if (this.match(12)) {
+ if (!e) {
+ this.raise(u.UnexpectedToken, {
+ at: this.state.curPosition(),
+ unexpected: ',',
+ });
+ }
+ s = null;
+ } else if (this.match(21)) {
+ const e = this.state.startLoc;
+ s = this.parseParenItem(this.parseSpread(t), e);
+ } else if (this.match(17)) {
+ this.expectPlugin('partialApplication');
+ if (!r) {
+ this.raise(u.UnexpectedArgumentPlaceholder, {
+ at: this.state.startLoc,
+ });
+ }
+ const e = this.startNode();
+ this.next();
+ s = this.finishNode(e, 'ArgumentPlaceholder');
+ } else {
+ s = this.parseMaybeAssignAllowIn(t, this.parseParenItem);
+ }
+ return s;
+ }
+ parseIdentifier(e) {
+ const t = this.startNode();
+ const r = this.parseIdentifierName(e);
+ return this.createIdentifier(t, r);
+ }
+ createIdentifier(e, t) {
+ e.name = t;
+ e.loc.identifierName = t;
+ return this.finishNode(e, 'Identifier');
+ }
+ parseIdentifierName(e) {
+ let t;
+ const { startLoc: r, type: s } = this.state;
+ if (tokenIsKeywordOrIdentifier(s)) {
+ t = this.state.value;
+ } else {
+ this.unexpected();
+ }
+ const i = tokenKeywordOrIdentifierIsKeyword(s);
+ if (e) {
+ if (i) {
+ this.replaceToken(132);
+ }
+ } else {
+ this.checkReservedWord(t, r, i, false);
+ }
+ this.next();
+ return t;
+ }
+ checkReservedWord(e, t, r, s) {
+ if (e.length > 10) {
+ return;
+ }
+ if (!canBeReservedWord(e)) {
+ return;
+ }
+ if (r && isKeyword(e)) {
+ this.raise(u.UnexpectedKeyword, { at: t, keyword: e });
+ return;
+ }
+ const i = !this.state.strict
+ ? isReservedWord
+ : s
+ ? isStrictBindReservedWord
+ : isStrictReservedWord;
+ if (i(e, this.inModule)) {
+ this.raise(u.UnexpectedReservedWord, { at: t, reservedWord: e });
+ return;
+ } else if (e === 'yield') {
+ if (this.prodParam.hasYield) {
+ this.raise(u.YieldBindingIdentifier, { at: t });
+ return;
+ }
+ } else if (e === 'await') {
+ if (this.prodParam.hasAwait) {
+ this.raise(u.AwaitBindingIdentifier, { at: t });
+ return;
+ }
+ if (this.scope.inStaticBlock) {
+ this.raise(u.AwaitBindingIdentifierInStaticBlock, { at: t });
+ return;
+ }
+ this.expressionScope.recordAsyncArrowParametersError({ at: t });
+ } else if (e === 'arguments') {
+ if (this.scope.inClassAndNotInNonArrowFunction) {
+ this.raise(u.ArgumentsInClass, { at: t });
+ return;
+ }
+ }
+ }
+ isAwaitAllowed() {
+ if (this.prodParam.hasAwait) return true;
+ if (
+ this.options.allowAwaitOutsideFunction &&
+ !this.scope.inFunction
+ ) {
+ return true;
+ }
+ return false;
+ }
+ parseAwait(e) {
+ const t = this.startNodeAt(e);
+ this.expressionScope.recordParameterInitializerError(
+ u.AwaitExpressionFormalParameter,
+ { at: t },
+ );
+ if (this.eat(55)) {
+ this.raise(u.ObsoleteAwaitStar, { at: t });
+ }
+ if (
+ !this.scope.inFunction &&
+ !this.options.allowAwaitOutsideFunction
+ ) {
+ if (this.isAmbiguousAwait()) {
+ this.ambiguousScriptDifferentAst = true;
+ } else {
+ this.sawUnambiguousESM = true;
+ }
+ }
+ if (!this.state.soloAwait) {
+ t.argument = this.parseMaybeUnary(null, true);
+ }
+ return this.finishNode(t, 'AwaitExpression');
+ }
+ isAmbiguousAwait() {
+ if (this.hasPrecedingLineBreak()) return true;
+ const { type: e } = this.state;
+ return (
+ e === 53 ||
+ e === 10 ||
+ e === 0 ||
+ tokenIsTemplate(e) ||
+ (e === 102 && !this.state.containsEsc) ||
+ e === 137 ||
+ e === 56 ||
+ (this.hasPlugin('v8intrinsic') && e === 54)
+ );
+ }
+ parseYield() {
+ const e = this.startNode();
+ this.expressionScope.recordParameterInitializerError(
+ u.YieldInParameter,
+ { at: e },
+ );
+ this.next();
+ let t = false;
+ let r = null;
+ if (!this.hasPrecedingLineBreak()) {
+ t = this.eat(55);
+ switch (this.state.type) {
+ case 13:
+ case 139:
+ case 8:
+ case 11:
+ case 3:
+ case 9:
+ case 14:
+ case 12:
+ if (!t) break;
+ default:
+ r = this.parseMaybeAssign();
+ }
+ }
+ e.delegate = t;
+ e.argument = r;
+ return this.finishNode(e, 'YieldExpression');
+ }
+ parseImportCall(e) {
+ this.next();
+ e.source = this.parseMaybeAssignAllowIn();
+ if (
+ this.hasPlugin('importAttributes') ||
+ this.hasPlugin('importAssertions')
+ ) {
+ e.options = null;
+ }
+ if (this.eat(12)) {
+ this.expectImportAttributesPlugin();
+ if (!this.match(11)) {
+ e.options = this.parseMaybeAssignAllowIn();
+ this.eat(12);
+ }
+ }
+ this.expect(11);
+ return this.finishNode(e, 'ImportExpression');
+ }
+ checkPipelineAtInfixOperator(e, t) {
+ if (this.hasPlugin(['pipelineOperator', { proposal: 'smart' }])) {
+ if (e.type === 'SequenceExpression') {
+ this.raise(u.PipelineHeadSequenceExpression, { at: t });
+ }
+ }
+ }
+ parseSmartPipelineBodyInStyle(e, t) {
+ if (this.isSimpleReference(e)) {
+ const r = this.startNodeAt(t);
+ r.callee = e;
+ return this.finishNode(r, 'PipelineBareFunction');
+ } else {
+ const r = this.startNodeAt(t);
+ this.checkSmartPipeTopicBodyEarlyErrors(t);
+ r.expression = e;
+ return this.finishNode(r, 'PipelineTopicExpression');
+ }
+ }
+ isSimpleReference(e) {
+ switch (e.type) {
+ case 'MemberExpression':
+ return !e.computed && this.isSimpleReference(e.object);
+ case 'Identifier':
+ return true;
+ default:
+ return false;
+ }
+ }
+ checkSmartPipeTopicBodyEarlyErrors(e) {
+ if (this.match(19)) {
+ throw this.raise(u.PipelineBodyNoArrow, {
+ at: this.state.startLoc,
+ });
+ }
+ if (!this.topicReferenceWasUsedInCurrentContext()) {
+ this.raise(u.PipelineTopicUnused, { at: e });
+ }
+ }
+ withTopicBindingContext(e) {
+ const t = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 1,
+ maxTopicIndex: null,
+ };
+ try {
+ return e();
+ } finally {
+ this.state.topicContext = t;
+ }
+ }
+ withSmartMixTopicForbiddingContext(e) {
+ if (this.hasPlugin(['pipelineOperator', { proposal: 'smart' }])) {
+ const t = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null,
+ };
+ try {
+ return e();
+ } finally {
+ this.state.topicContext = t;
+ }
+ } else {
+ return e();
+ }
+ }
+ withSoloAwaitPermittingContext(e) {
+ const t = this.state.soloAwait;
+ this.state.soloAwait = true;
+ try {
+ return e();
+ } finally {
+ this.state.soloAwait = t;
+ }
+ }
+ allowInAnd(e) {
+ const t = this.prodParam.currentFlags();
+ const r = 8 & ~t;
+ if (r) {
+ this.prodParam.enter(t | 8);
+ try {
+ return e();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+ return e();
+ }
+ disallowInAnd(e) {
+ const t = this.prodParam.currentFlags();
+ const r = 8 & t;
+ if (r) {
+ this.prodParam.enter(t & ~8);
+ try {
+ return e();
+ } finally {
+ this.prodParam.exit();
+ }
+ }
+ return e();
+ }
+ registerTopicReference() {
+ this.state.topicContext.maxTopicIndex = 0;
+ }
+ topicReferenceIsAllowedInCurrentContext() {
+ return this.state.topicContext.maxNumOfResolvableTopics >= 1;
+ }
+ topicReferenceWasUsedInCurrentContext() {
+ return (
+ this.state.topicContext.maxTopicIndex != null &&
+ this.state.topicContext.maxTopicIndex >= 0
+ );
+ }
+ parseFSharpPipelineBody(e) {
+ const t = this.state.startLoc;
+ this.state.potentialArrowAt = this.state.start;
+ const r = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = true;
+ const s = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), t, e);
+ this.state.inFSharpPipelineDirectBody = r;
+ return s;
+ }
+ parseModuleExpression() {
+ this.expectPlugin('moduleBlocks');
+ const e = this.startNode();
+ this.next();
+ if (!this.match(5)) {
+ this.unexpected(null, 5);
+ }
+ const t = this.startNodeAt(this.state.endLoc);
+ this.next();
+ const r = this.initializeScopes(true);
+ this.enterInitialScopes();
+ try {
+ e.body = this.parseProgram(t, 8, 'module');
+ } finally {
+ r();
+ }
+ return this.finishNode(e, 'ModuleExpression');
+ }
+ parsePropertyNamePrefixOperator(e) {}
+ }
+ const de = { kind: 'loop' },
+ fe = { kind: 'switch' };
+ const he = /[\uD800-\uDFFF]/u;
+ const ye = /in(?:stanceof)?/y;
+ function babel7CompatTokens(e, t) {
+ for (let r = 0; r < e.length; r++) {
+ const s = e[r];
+ const { type: i } = s;
+ if (typeof i === 'number') {
+ {
+ if (i === 138) {
+ const { loc: t, start: i, value: n, end: a } = s;
+ const o = i + 1;
+ const l = createPositionWithColumnOffset(t.start, 1);
+ e.splice(
+ r,
+ 1,
+ new Token({
+ type: getExportedToken(27),
+ value: '#',
+ start: i,
+ end: o,
+ startLoc: t.start,
+ endLoc: l,
+ }),
+ new Token({
+ type: getExportedToken(132),
+ value: n,
+ start: o,
+ end: a,
+ startLoc: l,
+ endLoc: t.end,
+ }),
+ );
+ r++;
+ continue;
+ }
+ if (tokenIsTemplate(i)) {
+ const { loc: n, start: a, value: o, end: l } = s;
+ const c = a + 1;
+ const p = createPositionWithColumnOffset(n.start, 1);
+ let u;
+ if (t.charCodeAt(a) === 96) {
+ u = new Token({
+ type: getExportedToken(22),
+ value: '`',
+ start: a,
+ end: c,
+ startLoc: n.start,
+ endLoc: p,
+ });
+ } else {
+ u = new Token({
+ type: getExportedToken(8),
+ value: '}',
+ start: a,
+ end: c,
+ startLoc: n.start,
+ endLoc: p,
+ });
+ }
+ let d, f, h, y;
+ if (i === 24) {
+ f = l - 1;
+ h = createPositionWithColumnOffset(n.end, -1);
+ d = o === null ? null : o.slice(1, -1);
+ y = new Token({
+ type: getExportedToken(22),
+ value: '`',
+ start: f,
+ end: l,
+ startLoc: h,
+ endLoc: n.end,
+ });
+ } else {
+ f = l - 2;
+ h = createPositionWithColumnOffset(n.end, -2);
+ d = o === null ? null : o.slice(1, -2);
+ y = new Token({
+ type: getExportedToken(23),
+ value: '${',
+ start: f,
+ end: l,
+ startLoc: h,
+ endLoc: n.end,
+ });
+ }
+ e.splice(
+ r,
+ 1,
+ u,
+ new Token({
+ type: getExportedToken(20),
+ value: d,
+ start: c,
+ end: f,
+ startLoc: p,
+ endLoc: h,
+ }),
+ y,
+ );
+ r += 2;
+ continue;
+ }
+ }
+ s.type = getExportedToken(i);
+ }
+ }
+ return e;
+ }
+ class StatementParser extends ExpressionParser {
+ parseTopLevel(e, t) {
+ e.program = this.parseProgram(t);
+ e.comments = this.state.comments;
+ if (this.options.tokens) {
+ e.tokens = babel7CompatTokens(this.tokens, this.input);
+ }
+ return this.finishNode(e, 'File');
+ }
+ parseProgram(e, t = 139, r = this.options.sourceType) {
+ e.sourceType = r;
+ e.interpreter = this.parseInterpreterDirective();
+ this.parseBlockBody(e, true, true, t);
+ if (
+ this.inModule &&
+ !this.options.allowUndeclaredExports &&
+ this.scope.undefinedExports.size > 0
+ ) {
+ for (const [e, t] of Array.from(this.scope.undefinedExports)) {
+ this.raise(u.ModuleExportUndefined, { at: t, localName: e });
+ }
+ }
+ let s;
+ if (t === 139) {
+ s = this.finishNode(e, 'Program');
+ } else {
+ s = this.finishNodeAt(
+ e,
+ 'Program',
+ createPositionWithColumnOffset(this.state.startLoc, -1),
+ );
+ }
+ return s;
+ }
+ stmtToDirective(e) {
+ const t = e;
+ t.type = 'Directive';
+ t.value = t.expression;
+ delete t.expression;
+ const r = t.value;
+ const s = r.value;
+ const i = this.input.slice(r.start, r.end);
+ const n = (r.value = i.slice(1, -1));
+ this.addExtra(r, 'raw', i);
+ this.addExtra(r, 'rawValue', n);
+ this.addExtra(r, 'expressionValue', s);
+ r.type = 'DirectiveLiteral';
+ return t;
+ }
+ parseInterpreterDirective() {
+ if (!this.match(28)) {
+ return null;
+ }
+ const e = this.startNode();
+ e.value = this.state.value;
+ this.next();
+ return this.finishNode(e, 'InterpreterDirective');
+ }
+ isLet() {
+ if (!this.isContextual(100)) {
+ return false;
+ }
+ return this.hasFollowingBindingAtom();
+ }
+ chStartsBindingIdentifier(e, t) {
+ if (isIdentifierStart(e)) {
+ ye.lastIndex = t;
+ if (ye.test(this.input)) {
+ const e = this.codePointAtPos(ye.lastIndex);
+ if (!isIdentifierChar(e) && e !== 92) {
+ return false;
+ }
+ }
+ return true;
+ } else if (e === 92) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ chStartsBindingPattern(e) {
+ return e === 91 || e === 123;
+ }
+ hasFollowingBindingAtom() {
+ const e = this.nextTokenStart();
+ const t = this.codePointAtPos(e);
+ return (
+ this.chStartsBindingPattern(t) ||
+ this.chStartsBindingIdentifier(t, e)
+ );
+ }
+ hasInLineFollowingBindingIdentifier() {
+ const e = this.nextTokenInLineStart();
+ const t = this.codePointAtPos(e);
+ return this.chStartsBindingIdentifier(t, e);
+ }
+ startsUsingForOf() {
+ const { type: e, containsEsc: t } = this.lookahead();
+ if (e === 102 && !t) {
+ return false;
+ } else if (tokenIsIdentifier(e) && !this.hasFollowingLineBreak()) {
+ this.expectPlugin('explicitResourceManagement');
+ return true;
+ }
+ }
+ startsAwaitUsing() {
+ let e = this.nextTokenInLineStart();
+ if (this.isUnparsedContextual(e, 'using')) {
+ e = this.nextTokenInLineStartSince(e + 5);
+ const t = this.codePointAtPos(e);
+ if (this.chStartsBindingIdentifier(t, e)) {
+ this.expectPlugin('explicitResourceManagement');
+ return true;
+ }
+ }
+ return false;
+ }
+ parseModuleItem() {
+ return this.parseStatementLike(1 | 2 | 4 | 8);
+ }
+ parseStatementListItem() {
+ return this.parseStatementLike(
+ 2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8),
+ );
+ }
+ parseStatementOrSloppyAnnexBFunctionDeclaration(e = false) {
+ let t = 0;
+ if (this.options.annexB && !this.state.strict) {
+ t |= 4;
+ if (e) {
+ t |= 8;
+ }
+ }
+ return this.parseStatementLike(t);
+ }
+ parseStatement() {
+ return this.parseStatementLike(0);
+ }
+ parseStatementLike(e) {
+ let t = null;
+ if (this.match(26)) {
+ t = this.parseDecorators(true);
+ }
+ return this.parseStatementContent(e, t);
+ }
+ parseStatementContent(e, t) {
+ const r = this.state.type;
+ const s = this.startNode();
+ const i = !!(e & 2);
+ const n = !!(e & 4);
+ const a = e & 1;
+ switch (r) {
+ case 60:
+ return this.parseBreakContinueStatement(s, true);
+ case 63:
+ return this.parseBreakContinueStatement(s, false);
+ case 64:
+ return this.parseDebuggerStatement(s);
+ case 90:
+ return this.parseDoWhileStatement(s);
+ case 91:
+ return this.parseForStatement(s);
+ case 68:
+ if (this.lookaheadCharCode() === 46) break;
+ if (!n) {
+ this.raise(
+ this.state.strict
+ ? u.StrictFunction
+ : this.options.annexB
+ ? u.SloppyFunctionAnnexB
+ : u.SloppyFunction,
+ { at: this.state.startLoc },
+ );
+ }
+ return this.parseFunctionStatement(s, false, !i && n);
+ case 80:
+ if (!i) this.unexpected();
+ return this.parseClass(this.maybeTakeDecorators(t, s), true);
+ case 69:
+ return this.parseIfStatement(s);
+ case 70:
+ return this.parseReturnStatement(s);
+ case 71:
+ return this.parseSwitchStatement(s);
+ case 72:
+ return this.parseThrowStatement(s);
+ case 73:
+ return this.parseTryStatement(s);
+ case 96:
+ if (!this.state.containsEsc && this.startsAwaitUsing()) {
+ if (!this.isAwaitAllowed()) {
+ this.raise(u.AwaitUsingNotInAsyncContext, { at: s });
+ } else if (!i) {
+ this.raise(u.UnexpectedLexicalDeclaration, { at: s });
+ }
+ this.next();
+ return this.parseVarStatement(s, 'await using');
+ }
+ break;
+ case 107:
+ if (
+ this.state.containsEsc ||
+ !this.hasInLineFollowingBindingIdentifier()
+ ) {
+ break;
+ }
+ this.expectPlugin('explicitResourceManagement');
+ if (!this.scope.inModule && this.scope.inTopLevel) {
+ this.raise(u.UnexpectedUsingDeclaration, {
+ at: this.state.startLoc,
+ });
+ } else if (!i) {
+ this.raise(u.UnexpectedLexicalDeclaration, {
+ at: this.state.startLoc,
+ });
+ }
+ return this.parseVarStatement(s, 'using');
+ case 100: {
+ if (this.state.containsEsc) {
+ break;
+ }
+ const e = this.nextTokenStart();
+ const t = this.codePointAtPos(e);
+ if (t !== 91) {
+ if (!i && this.hasFollowingLineBreak()) break;
+ if (!this.chStartsBindingIdentifier(t, e) && t !== 123) {
+ break;
+ }
+ }
+ }
+ case 75: {
+ if (!i) {
+ this.raise(u.UnexpectedLexicalDeclaration, {
+ at: this.state.startLoc,
+ });
+ }
+ }
+ case 74: {
+ const e = this.state.value;
+ return this.parseVarStatement(s, e);
+ }
+ case 92:
+ return this.parseWhileStatement(s);
+ case 76:
+ return this.parseWithStatement(s);
+ case 5:
+ return this.parseBlock();
+ case 13:
+ return this.parseEmptyStatement(s);
+ case 83: {
+ const e = this.lookaheadCharCode();
+ if (e === 40 || e === 46) {
+ break;
+ }
+ }
+ case 82: {
+ if (!this.options.allowImportExportEverywhere && !a) {
+ this.raise(u.UnexpectedImportExport, {
+ at: this.state.startLoc,
+ });
+ }
+ this.next();
+ let e;
+ if (r === 83) {
+ e = this.parseImport(s);
+ if (
+ e.type === 'ImportDeclaration' &&
+ (!e.importKind || e.importKind === 'value')
+ ) {
+ this.sawUnambiguousESM = true;
+ }
+ } else {
+ e = this.parseExport(s, t);
+ if (
+ (e.type === 'ExportNamedDeclaration' &&
+ (!e.exportKind || e.exportKind === 'value')) ||
+ (e.type === 'ExportAllDeclaration' &&
+ (!e.exportKind || e.exportKind === 'value')) ||
+ e.type === 'ExportDefaultDeclaration'
+ ) {
+ this.sawUnambiguousESM = true;
+ }
+ }
+ this.assertModuleNodeAllowed(e);
+ return e;
+ }
+ default: {
+ if (this.isAsyncFunction()) {
+ if (!i) {
+ this.raise(u.AsyncFunctionInSingleStatementContext, {
+ at: this.state.startLoc,
+ });
+ }
+ this.next();
+ return this.parseFunctionStatement(s, true, !i && n);
+ }
+ }
+ }
+ const o = this.state.value;
+ const l = this.parseExpression();
+ if (tokenIsIdentifier(r) && l.type === 'Identifier' && this.eat(14)) {
+ return this.parseLabeledStatement(s, o, l, e);
+ } else {
+ return this.parseExpressionStatement(s, l, t);
+ }
+ }
+ assertModuleNodeAllowed(e) {
+ if (!this.options.allowImportExportEverywhere && !this.inModule) {
+ this.raise(u.ImportOutsideModule, { at: e });
+ }
+ }
+ decoratorsEnabledBeforeExport() {
+ if (this.hasPlugin('decorators-legacy')) return true;
+ return (
+ this.hasPlugin('decorators') &&
+ this.getPluginOption('decorators', 'decoratorsBeforeExport') !==
+ false
+ );
+ }
+ maybeTakeDecorators(e, t, r) {
+ if (e) {
+ if (t.decorators && t.decorators.length > 0) {
+ if (
+ typeof this.getPluginOption(
+ 'decorators',
+ 'decoratorsBeforeExport',
+ ) !== 'boolean'
+ ) {
+ this.raise(u.DecoratorsBeforeAfterExport, {
+ at: t.decorators[0],
+ });
+ }
+ t.decorators.unshift(...e);
+ } else {
+ t.decorators = e;
+ }
+ this.resetStartLocationFromNode(t, e[0]);
+ if (r) this.resetStartLocationFromNode(r, t);
+ }
+ return t;
+ }
+ canHaveLeadingDecorator() {
+ return this.match(80);
+ }
+ parseDecorators(e) {
+ const t = [];
+ do {
+ t.push(this.parseDecorator());
+ } while (this.match(26));
+ if (this.match(82)) {
+ if (!e) {
+ this.unexpected();
+ }
+ if (!this.decoratorsEnabledBeforeExport()) {
+ this.raise(u.DecoratorExportClass, { at: this.state.startLoc });
+ }
+ } else if (!this.canHaveLeadingDecorator()) {
+ throw this.raise(u.UnexpectedLeadingDecorator, {
+ at: this.state.startLoc,
+ });
+ }
+ return t;
+ }
+ parseDecorator() {
+ this.expectOnePlugin(['decorators', 'decorators-legacy']);
+ const e = this.startNode();
+ this.next();
+ if (this.hasPlugin('decorators')) {
+ const t = this.state.startLoc;
+ let r;
+ if (this.match(10)) {
+ const t = this.state.startLoc;
+ this.next();
+ r = this.parseExpression();
+ this.expect(11);
+ r = this.wrapParenthesis(t, r);
+ const s = this.state.startLoc;
+ e.expression = this.parseMaybeDecoratorArguments(r);
+ if (
+ this.getPluginOption('decorators', 'allowCallParenthesized') ===
+ false &&
+ e.expression !== r
+ ) {
+ this.raise(u.DecoratorArgumentsOutsideParentheses, { at: s });
+ }
+ } else {
+ r = this.parseIdentifier(false);
+ while (this.eat(16)) {
+ const e = this.startNodeAt(t);
+ e.object = r;
+ if (this.match(138)) {
+ this.classScope.usePrivateName(
+ this.state.value,
+ this.state.startLoc,
+ );
+ e.property = this.parsePrivateName();
+ } else {
+ e.property = this.parseIdentifier(true);
+ }
+ e.computed = false;
+ r = this.finishNode(e, 'MemberExpression');
+ }
+ e.expression = this.parseMaybeDecoratorArguments(r);
+ }
+ } else {
+ e.expression = this.parseExprSubscripts();
+ }
+ return this.finishNode(e, 'Decorator');
+ }
+ parseMaybeDecoratorArguments(e) {
+ if (this.eat(10)) {
+ const t = this.startNodeAtNode(e);
+ t.callee = e;
+ t.arguments = this.parseCallExpressionArguments(11, false);
+ this.toReferencedList(t.arguments);
+ return this.finishNode(t, 'CallExpression');
+ }
+ return e;
+ }
+ parseBreakContinueStatement(e, t) {
+ this.next();
+ if (this.isLineTerminator()) {
+ e.label = null;
+ } else {
+ e.label = this.parseIdentifier();
+ this.semicolon();
+ }
+ this.verifyBreakContinue(e, t);
+ return this.finishNode(e, t ? 'BreakStatement' : 'ContinueStatement');
+ }
+ verifyBreakContinue(e, t) {
+ let r;
+ for (r = 0; r < this.state.labels.length; ++r) {
+ const s = this.state.labels[r];
+ if (e.label == null || s.name === e.label.name) {
+ if (s.kind != null && (t || s.kind === 'loop')) break;
+ if (e.label && t) break;
+ }
+ }
+ if (r === this.state.labels.length) {
+ const r = t ? 'BreakStatement' : 'ContinueStatement';
+ this.raise(u.IllegalBreakContinue, { at: e, type: r });
+ }
+ }
+ parseDebuggerStatement(e) {
+ this.next();
+ this.semicolon();
+ return this.finishNode(e, 'DebuggerStatement');
+ }
+ parseHeaderExpression() {
+ this.expect(10);
+ const e = this.parseExpression();
+ this.expect(11);
+ return e;
+ }
+ parseDoWhileStatement(e) {
+ this.next();
+ this.state.labels.push(de);
+ e.body = this.withSmartMixTopicForbiddingContext(() =>
+ this.parseStatement(),
+ );
+ this.state.labels.pop();
+ this.expect(92);
+ e.test = this.parseHeaderExpression();
+ this.eat(13);
+ return this.finishNode(e, 'DoWhileStatement');
+ }
+ parseForStatement(e) {
+ this.next();
+ this.state.labels.push(de);
+ let t = null;
+ if (this.isAwaitAllowed() && this.eatContextual(96)) {
+ t = this.state.lastTokStartLoc;
+ }
+ this.scope.enter(0);
+ this.expect(10);
+ if (this.match(13)) {
+ if (t !== null) {
+ this.unexpected(t);
+ }
+ return this.parseFor(e, null);
+ }
+ const r = this.isContextual(100);
+ {
+ const s = this.isContextual(96) && this.startsAwaitUsing();
+ const i = s || (this.isContextual(107) && this.startsUsingForOf());
+ const n = (r && this.hasFollowingBindingAtom()) || i;
+ if (this.match(74) || this.match(75) || n) {
+ const r = this.startNode();
+ let n;
+ if (s) {
+ n = 'await using';
+ if (!this.isAwaitAllowed()) {
+ this.raise(u.AwaitUsingNotInAsyncContext, {
+ at: this.state.startLoc,
+ });
+ }
+ this.next();
+ } else {
+ n = this.state.value;
+ }
+ this.next();
+ this.parseVar(r, true, n);
+ const a = this.finishNode(r, 'VariableDeclaration');
+ const o = this.match(58);
+ if (o && i) {
+ this.raise(u.ForInUsing, { at: a });
+ }
+ if (
+ (o || this.isContextual(102)) &&
+ a.declarations.length === 1
+ ) {
+ return this.parseForIn(e, a, t);
+ }
+ if (t !== null) {
+ this.unexpected(t);
+ }
+ return this.parseFor(e, a);
+ }
+ }
+ const s = this.isContextual(95);
+ const i = new ExpressionErrors();
+ const n = this.parseExpression(true, i);
+ const a = this.isContextual(102);
+ if (a) {
+ if (r) {
+ this.raise(u.ForOfLet, { at: n });
+ }
+ if (t === null && s && n.type === 'Identifier') {
+ this.raise(u.ForOfAsync, { at: n });
+ }
+ }
+ if (a || this.match(58)) {
+ this.checkDestructuringPrivate(i);
+ this.toAssignable(n, true);
+ const r = a ? 'ForOfStatement' : 'ForInStatement';
+ this.checkLVal(n, { in: { type: r } });
+ return this.parseForIn(e, n, t);
+ } else {
+ this.checkExpressionErrors(i, true);
+ }
+ if (t !== null) {
+ this.unexpected(t);
+ }
+ return this.parseFor(e, n);
+ }
+ parseFunctionStatement(e, t, r) {
+ this.next();
+ return this.parseFunction(e, 1 | (r ? 2 : 0) | (t ? 8 : 0));
+ }
+ parseIfStatement(e) {
+ this.next();
+ e.test = this.parseHeaderExpression();
+ e.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration();
+ e.alternate = this.eat(66)
+ ? this.parseStatementOrSloppyAnnexBFunctionDeclaration()
+ : null;
+ return this.finishNode(e, 'IfStatement');
+ }
+ parseReturnStatement(e) {
+ if (
+ !this.prodParam.hasReturn &&
+ !this.options.allowReturnOutsideFunction
+ ) {
+ this.raise(u.IllegalReturn, { at: this.state.startLoc });
+ }
+ this.next();
+ if (this.isLineTerminator()) {
+ e.argument = null;
+ } else {
+ e.argument = this.parseExpression();
+ this.semicolon();
+ }
+ return this.finishNode(e, 'ReturnStatement');
+ }
+ parseSwitchStatement(e) {
+ this.next();
+ e.discriminant = this.parseHeaderExpression();
+ const t = (e.cases = []);
+ this.expect(5);
+ this.state.labels.push(fe);
+ this.scope.enter(0);
+ let r;
+ for (let e; !this.match(8); ) {
+ if (this.match(61) || this.match(65)) {
+ const s = this.match(61);
+ if (r) this.finishNode(r, 'SwitchCase');
+ t.push((r = this.startNode()));
+ r.consequent = [];
+ this.next();
+ if (s) {
+ r.test = this.parseExpression();
+ } else {
+ if (e) {
+ this.raise(u.MultipleDefaultsInSwitch, {
+ at: this.state.lastTokStartLoc,
+ });
+ }
+ e = true;
+ r.test = null;
+ }
+ this.expect(14);
+ } else {
+ if (r) {
+ r.consequent.push(this.parseStatementListItem());
+ } else {
+ this.unexpected();
+ }
+ }
+ }
+ this.scope.exit();
+ if (r) this.finishNode(r, 'SwitchCase');
+ this.next();
+ this.state.labels.pop();
+ return this.finishNode(e, 'SwitchStatement');
+ }
+ parseThrowStatement(e) {
+ this.next();
+ if (this.hasPrecedingLineBreak()) {
+ this.raise(u.NewlineAfterThrow, { at: this.state.lastTokEndLoc });
+ }
+ e.argument = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(e, 'ThrowStatement');
+ }
+ parseCatchClauseParam() {
+ const e = this.parseBindingAtom();
+ this.scope.enter(
+ this.options.annexB && e.type === 'Identifier' ? 8 : 0,
+ );
+ this.checkLVal(e, { in: { type: 'CatchClause' }, binding: 9 });
+ return e;
+ }
+ parseTryStatement(e) {
+ this.next();
+ e.block = this.parseBlock();
+ e.handler = null;
+ if (this.match(62)) {
+ const t = this.startNode();
+ this.next();
+ if (this.match(10)) {
+ this.expect(10);
+ t.param = this.parseCatchClauseParam();
+ this.expect(11);
+ } else {
+ t.param = null;
+ this.scope.enter(0);
+ }
+ t.body = this.withSmartMixTopicForbiddingContext(() =>
+ this.parseBlock(false, false),
+ );
+ this.scope.exit();
+ e.handler = this.finishNode(t, 'CatchClause');
+ }
+ e.finalizer = this.eat(67) ? this.parseBlock() : null;
+ if (!e.handler && !e.finalizer) {
+ this.raise(u.NoCatchOrFinally, { at: e });
+ }
+ return this.finishNode(e, 'TryStatement');
+ }
+ parseVarStatement(e, t, r = false) {
+ this.next();
+ this.parseVar(e, false, t, r);
+ this.semicolon();
+ return this.finishNode(e, 'VariableDeclaration');
+ }
+ parseWhileStatement(e) {
+ this.next();
+ e.test = this.parseHeaderExpression();
+ this.state.labels.push(de);
+ e.body = this.withSmartMixTopicForbiddingContext(() =>
+ this.parseStatement(),
+ );
+ this.state.labels.pop();
+ return this.finishNode(e, 'WhileStatement');
+ }
+ parseWithStatement(e) {
+ if (this.state.strict) {
+ this.raise(u.StrictWith, { at: this.state.startLoc });
+ }
+ this.next();
+ e.object = this.parseHeaderExpression();
+ e.body = this.withSmartMixTopicForbiddingContext(() =>
+ this.parseStatement(),
+ );
+ return this.finishNode(e, 'WithStatement');
+ }
+ parseEmptyStatement(e) {
+ this.next();
+ return this.finishNode(e, 'EmptyStatement');
+ }
+ parseLabeledStatement(e, t, r, s) {
+ for (const e of this.state.labels) {
+ if (e.name === t) {
+ this.raise(u.LabelRedeclaration, { at: r, labelName: t });
+ }
+ }
+ const i = tokenIsLoop(this.state.type)
+ ? 'loop'
+ : this.match(71)
+ ? 'switch'
+ : null;
+ for (let t = this.state.labels.length - 1; t >= 0; t--) {
+ const r = this.state.labels[t];
+ if (r.statementStart === e.start) {
+ r.statementStart = this.state.start;
+ r.kind = i;
+ } else {
+ break;
+ }
+ }
+ this.state.labels.push({
+ name: t,
+ kind: i,
+ statementStart: this.state.start,
+ });
+ e.body =
+ s & 8
+ ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true)
+ : this.parseStatement();
+ this.state.labels.pop();
+ e.label = r;
+ return this.finishNode(e, 'LabeledStatement');
+ }
+ parseExpressionStatement(e, t, r) {
+ e.expression = t;
+ this.semicolon();
+ return this.finishNode(e, 'ExpressionStatement');
+ }
+ parseBlock(e = false, t = true, r) {
+ const s = this.startNode();
+ if (e) {
+ this.state.strictErrors.clear();
+ }
+ this.expect(5);
+ if (t) {
+ this.scope.enter(0);
+ }
+ this.parseBlockBody(s, e, false, 8, r);
+ if (t) {
+ this.scope.exit();
+ }
+ return this.finishNode(s, 'BlockStatement');
+ }
+ isValidDirective(e) {
+ return (
+ e.type === 'ExpressionStatement' &&
+ e.expression.type === 'StringLiteral' &&
+ !e.expression.extra.parenthesized
+ );
+ }
+ parseBlockBody(e, t, r, s, i) {
+ const n = (e.body = []);
+ const a = (e.directives = []);
+ this.parseBlockOrModuleBlockBody(n, t ? a : undefined, r, s, i);
+ }
+ parseBlockOrModuleBlockBody(e, t, r, s, i) {
+ const n = this.state.strict;
+ let a = false;
+ let o = false;
+ while (!this.match(s)) {
+ const s = r
+ ? this.parseModuleItem()
+ : this.parseStatementListItem();
+ if (t && !o) {
+ if (this.isValidDirective(s)) {
+ const e = this.stmtToDirective(s);
+ t.push(e);
+ if (!a && e.value.value === 'use strict') {
+ a = true;
+ this.setStrict(true);
+ }
+ continue;
+ }
+ o = true;
+ this.state.strictErrors.clear();
+ }
+ e.push(s);
+ }
+ i == null || i.call(this, a);
+ if (!n) {
+ this.setStrict(false);
+ }
+ this.next();
+ }
+ parseFor(e, t) {
+ e.init = t;
+ this.semicolon(false);
+ e.test = this.match(13) ? null : this.parseExpression();
+ this.semicolon(false);
+ e.update = this.match(11) ? null : this.parseExpression();
+ this.expect(11);
+ e.body = this.withSmartMixTopicForbiddingContext(() =>
+ this.parseStatement(),
+ );
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(e, 'ForStatement');
+ }
+ parseForIn(e, t, r) {
+ const s = this.match(58);
+ this.next();
+ if (s) {
+ if (r !== null) this.unexpected(r);
+ } else {
+ e.await = r !== null;
+ }
+ if (
+ t.type === 'VariableDeclaration' &&
+ t.declarations[0].init != null &&
+ (!s ||
+ !this.options.annexB ||
+ this.state.strict ||
+ t.kind !== 'var' ||
+ t.declarations[0].id.type !== 'Identifier')
+ ) {
+ this.raise(u.ForInOfLoopInitializer, {
+ at: t,
+ type: s ? 'ForInStatement' : 'ForOfStatement',
+ });
+ }
+ if (t.type === 'AssignmentPattern') {
+ this.raise(u.InvalidLhs, {
+ at: t,
+ ancestor: { type: 'ForStatement' },
+ });
+ }
+ e.left = t;
+ e.right = s ? this.parseExpression() : this.parseMaybeAssignAllowIn();
+ this.expect(11);
+ e.body = this.withSmartMixTopicForbiddingContext(() =>
+ this.parseStatement(),
+ );
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(e, s ? 'ForInStatement' : 'ForOfStatement');
+ }
+ parseVar(e, t, r, s = false) {
+ const i = (e.declarations = []);
+ e.kind = r;
+ for (;;) {
+ const e = this.startNode();
+ this.parseVarId(e, r);
+ e.init = !this.eat(29)
+ ? null
+ : t
+ ? this.parseMaybeAssignDisallowIn()
+ : this.parseMaybeAssignAllowIn();
+ if (e.init === null && !s) {
+ if (
+ e.id.type !== 'Identifier' &&
+ !(t && (this.match(58) || this.isContextual(102)))
+ ) {
+ this.raise(u.DeclarationMissingInitializer, {
+ at: this.state.lastTokEndLoc,
+ kind: 'destructuring',
+ });
+ } else if (
+ r === 'const' &&
+ !(this.match(58) || this.isContextual(102))
+ ) {
+ this.raise(u.DeclarationMissingInitializer, {
+ at: this.state.lastTokEndLoc,
+ kind: 'const',
+ });
+ }
+ }
+ i.push(this.finishNode(e, 'VariableDeclarator'));
+ if (!this.eat(12)) break;
+ }
+ return e;
+ }
+ parseVarId(e, t) {
+ const r = this.parseBindingAtom();
+ this.checkLVal(r, {
+ in: { type: 'VariableDeclarator' },
+ binding: t === 'var' ? 5 : 8201,
+ });
+ e.id = r;
+ }
+ parseAsyncFunctionExpression(e) {
+ return this.parseFunction(e, 8);
+ }
+ parseFunction(e, t = 0) {
+ const r = t & 2;
+ const s = !!(t & 1);
+ const i = s && !(t & 4);
+ const n = !!(t & 8);
+ this.initFunction(e, n);
+ if (this.match(55)) {
+ if (r) {
+ this.raise(u.GeneratorInSingleStatementContext, {
+ at: this.state.startLoc,
+ });
+ }
+ this.next();
+ e.generator = true;
+ }
+ if (s) {
+ e.id = this.parseFunctionId(i);
+ }
+ const a = this.state.maybeInArrowParameters;
+ this.state.maybeInArrowParameters = false;
+ this.scope.enter(2);
+ this.prodParam.enter(functionFlags(n, e.generator));
+ if (!s) {
+ e.id = this.parseFunctionId();
+ }
+ this.parseFunctionParams(e, false);
+ this.withSmartMixTopicForbiddingContext(() => {
+ this.parseFunctionBodyAndFinish(
+ e,
+ s ? 'FunctionDeclaration' : 'FunctionExpression',
+ );
+ });
+ this.prodParam.exit();
+ this.scope.exit();
+ if (s && !r) {
+ this.registerFunctionStatementId(e);
+ }
+ this.state.maybeInArrowParameters = a;
+ return e;
+ }
+ parseFunctionId(e) {
+ return e || tokenIsIdentifier(this.state.type)
+ ? this.parseIdentifier()
+ : null;
+ }
+ parseFunctionParams(e, t) {
+ this.expect(10);
+ this.expressionScope.enter(newParameterDeclarationScope());
+ e.params = this.parseBindingList(11, 41, 2 | (t ? 4 : 0));
+ this.expressionScope.exit();
+ }
+ registerFunctionStatementId(e) {
+ if (!e.id) return;
+ this.scope.declareName(
+ e.id.name,
+ !this.options.annexB || this.state.strict || e.generator || e.async
+ ? this.scope.treatFunctionsAsVar
+ ? 5
+ : 8201
+ : 17,
+ e.id.loc.start,
+ );
+ }
+ parseClass(e, t, r) {
+ this.next();
+ const s = this.state.strict;
+ this.state.strict = true;
+ this.parseClassId(e, t, r);
+ this.parseClassSuper(e);
+ e.body = this.parseClassBody(!!e.superClass, s);
+ return this.finishNode(e, t ? 'ClassDeclaration' : 'ClassExpression');
+ }
+ isClassProperty() {
+ return this.match(29) || this.match(13) || this.match(8);
+ }
+ isClassMethod() {
+ return this.match(10);
+ }
+ isNonstaticConstructor(e) {
+ return (
+ !e.computed &&
+ !e.static &&
+ (e.key.name === 'constructor' || e.key.value === 'constructor')
+ );
+ }
+ parseClassBody(e, t) {
+ this.classScope.enter();
+ const r = { hadConstructor: false, hadSuperClass: e };
+ let s = [];
+ const i = this.startNode();
+ i.body = [];
+ this.expect(5);
+ this.withSmartMixTopicForbiddingContext(() => {
+ while (!this.match(8)) {
+ if (this.eat(13)) {
+ if (s.length > 0) {
+ throw this.raise(u.DecoratorSemicolon, {
+ at: this.state.lastTokEndLoc,
+ });
+ }
+ continue;
+ }
+ if (this.match(26)) {
+ s.push(this.parseDecorator());
+ continue;
+ }
+ const e = this.startNode();
+ if (s.length) {
+ e.decorators = s;
+ this.resetStartLocationFromNode(e, s[0]);
+ s = [];
+ }
+ this.parseClassMember(i, e, r);
+ if (
+ e.kind === 'constructor' &&
+ e.decorators &&
+ e.decorators.length > 0
+ ) {
+ this.raise(u.DecoratorConstructor, { at: e });
+ }
+ }
+ });
+ this.state.strict = t;
+ this.next();
+ if (s.length) {
+ throw this.raise(u.TrailingDecorator, { at: this.state.startLoc });
+ }
+ this.classScope.exit();
+ return this.finishNode(i, 'ClassBody');
+ }
+ parseClassMemberFromModifier(e, t) {
+ const r = this.parseIdentifier(true);
+ if (this.isClassMethod()) {
+ const s = t;
+ s.kind = 'method';
+ s.computed = false;
+ s.key = r;
+ s.static = false;
+ this.pushClassMethod(e, s, false, false, false, false);
+ return true;
+ } else if (this.isClassProperty()) {
+ const s = t;
+ s.computed = false;
+ s.key = r;
+ s.static = false;
+ e.body.push(this.parseClassProperty(s));
+ return true;
+ }
+ this.resetPreviousNodeTrailingComments(r);
+ return false;
+ }
+ parseClassMember(e, t, r) {
+ const s = this.isContextual(106);
+ if (s) {
+ if (this.parseClassMemberFromModifier(e, t)) {
+ return;
+ }
+ if (this.eat(5)) {
+ this.parseClassStaticBlock(e, t);
+ return;
+ }
+ }
+ this.parseClassMemberWithIsStatic(e, t, r, s);
+ }
+ parseClassMemberWithIsStatic(e, t, r, s) {
+ const i = t;
+ const n = t;
+ const a = t;
+ const o = t;
+ const l = t;
+ const c = i;
+ const p = i;
+ t.static = s;
+ this.parsePropertyNamePrefixOperator(t);
+ if (this.eat(55)) {
+ c.kind = 'method';
+ const t = this.match(138);
+ this.parseClassElementName(c);
+ if (t) {
+ this.pushClassPrivateMethod(e, n, true, false);
+ return;
+ }
+ if (this.isNonstaticConstructor(i)) {
+ this.raise(u.ConstructorIsGenerator, { at: i.key });
+ }
+ this.pushClassMethod(e, i, true, false, false, false);
+ return;
+ }
+ const d =
+ tokenIsIdentifier(this.state.type) && !this.state.containsEsc;
+ const f = this.match(138);
+ const h = this.parseClassElementName(t);
+ const y = this.state.startLoc;
+ this.parsePostMemberNameModifiers(p);
+ if (this.isClassMethod()) {
+ c.kind = 'method';
+ if (f) {
+ this.pushClassPrivateMethod(e, n, false, false);
+ return;
+ }
+ const s = this.isNonstaticConstructor(i);
+ let a = false;
+ if (s) {
+ i.kind = 'constructor';
+ if (r.hadConstructor && !this.hasPlugin('typescript')) {
+ this.raise(u.DuplicateConstructor, { at: h });
+ }
+ if (s && this.hasPlugin('typescript') && t.override) {
+ this.raise(u.OverrideOnConstructor, { at: h });
+ }
+ r.hadConstructor = true;
+ a = r.hadSuperClass;
+ }
+ this.pushClassMethod(e, i, false, false, s, a);
+ } else if (this.isClassProperty()) {
+ if (f) {
+ this.pushClassPrivateProperty(e, o);
+ } else {
+ this.pushClassProperty(e, a);
+ }
+ } else if (d && h.name === 'async' && !this.isLineTerminator()) {
+ this.resetPreviousNodeTrailingComments(h);
+ const t = this.eat(55);
+ if (p.optional) {
+ this.unexpected(y);
+ }
+ c.kind = 'method';
+ const r = this.match(138);
+ this.parseClassElementName(c);
+ this.parsePostMemberNameModifiers(p);
+ if (r) {
+ this.pushClassPrivateMethod(e, n, t, true);
+ } else {
+ if (this.isNonstaticConstructor(i)) {
+ this.raise(u.ConstructorIsAsync, { at: i.key });
+ }
+ this.pushClassMethod(e, i, t, true, false, false);
+ }
+ } else if (
+ d &&
+ (h.name === 'get' || h.name === 'set') &&
+ !(this.match(55) && this.isLineTerminator())
+ ) {
+ this.resetPreviousNodeTrailingComments(h);
+ c.kind = h.name;
+ const t = this.match(138);
+ this.parseClassElementName(i);
+ if (t) {
+ this.pushClassPrivateMethod(e, n, false, false);
+ } else {
+ if (this.isNonstaticConstructor(i)) {
+ this.raise(u.ConstructorIsAccessor, { at: i.key });
+ }
+ this.pushClassMethod(e, i, false, false, false, false);
+ }
+ this.checkGetterSetterParams(i);
+ } else if (d && h.name === 'accessor' && !this.isLineTerminator()) {
+ this.expectPlugin('decoratorAutoAccessors');
+ this.resetPreviousNodeTrailingComments(h);
+ const t = this.match(138);
+ this.parseClassElementName(a);
+ this.pushClassAccessorProperty(e, l, t);
+ } else if (this.isLineTerminator()) {
+ if (f) {
+ this.pushClassPrivateProperty(e, o);
+ } else {
+ this.pushClassProperty(e, a);
+ }
+ } else {
+ this.unexpected();
+ }
+ }
+ parseClassElementName(e) {
+ const { type: t, value: r } = this.state;
+ if ((t === 132 || t === 133) && e.static && r === 'prototype') {
+ this.raise(u.StaticPrototype, { at: this.state.startLoc });
+ }
+ if (t === 138) {
+ if (r === 'constructor') {
+ this.raise(u.ConstructorClassPrivateField, {
+ at: this.state.startLoc,
+ });
+ }
+ const t = this.parsePrivateName();
+ e.key = t;
+ return t;
+ }
+ return this.parsePropertyName(e);
+ }
+ parseClassStaticBlock(e, t) {
+ var r;
+ this.scope.enter(64 | 128 | 16);
+ const s = this.state.labels;
+ this.state.labels = [];
+ this.prodParam.enter(0);
+ const i = (t.body = []);
+ this.parseBlockOrModuleBlockBody(i, undefined, false, 8);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.labels = s;
+ e.body.push(this.finishNode(t, 'StaticBlock'));
+ if ((r = t.decorators) != null && r.length) {
+ this.raise(u.DecoratorStaticBlock, { at: t });
+ }
+ }
+ pushClassProperty(e, t) {
+ if (
+ !t.computed &&
+ (t.key.name === 'constructor' || t.key.value === 'constructor')
+ ) {
+ this.raise(u.ConstructorClassField, { at: t.key });
+ }
+ e.body.push(this.parseClassProperty(t));
+ }
+ pushClassPrivateProperty(e, t) {
+ const r = this.parseClassPrivateProperty(t);
+ e.body.push(r);
+ this.classScope.declarePrivateName(
+ this.getPrivateNameSV(r.key),
+ 0,
+ r.key.loc.start,
+ );
+ }
+ pushClassAccessorProperty(e, t, r) {
+ if (!r && !t.computed) {
+ const e = t.key;
+ if (e.name === 'constructor' || e.value === 'constructor') {
+ this.raise(u.ConstructorClassField, { at: e });
+ }
+ }
+ const s = this.parseClassAccessorProperty(t);
+ e.body.push(s);
+ if (r) {
+ this.classScope.declarePrivateName(
+ this.getPrivateNameSV(s.key),
+ 0,
+ s.key.loc.start,
+ );
+ }
+ }
+ pushClassMethod(e, t, r, s, i, n) {
+ e.body.push(this.parseMethod(t, r, s, i, n, 'ClassMethod', true));
+ }
+ pushClassPrivateMethod(e, t, r, s) {
+ const i = this.parseMethod(
+ t,
+ r,
+ s,
+ false,
+ false,
+ 'ClassPrivateMethod',
+ true,
+ );
+ e.body.push(i);
+ const n =
+ i.kind === 'get'
+ ? i.static
+ ? 6
+ : 2
+ : i.kind === 'set'
+ ? i.static
+ ? 5
+ : 1
+ : 0;
+ this.declareClassPrivateMethodInScope(i, n);
+ }
+ declareClassPrivateMethodInScope(e, t) {
+ this.classScope.declarePrivateName(
+ this.getPrivateNameSV(e.key),
+ t,
+ e.key.loc.start,
+ );
+ }
+ parsePostMemberNameModifiers(e) {}
+ parseClassPrivateProperty(e) {
+ this.parseInitializer(e);
+ this.semicolon();
+ return this.finishNode(e, 'ClassPrivateProperty');
+ }
+ parseClassProperty(e) {
+ this.parseInitializer(e);
+ this.semicolon();
+ return this.finishNode(e, 'ClassProperty');
+ }
+ parseClassAccessorProperty(e) {
+ this.parseInitializer(e);
+ this.semicolon();
+ return this.finishNode(e, 'ClassAccessorProperty');
+ }
+ parseInitializer(e) {
+ this.scope.enter(64 | 16);
+ this.expressionScope.enter(newExpressionScope());
+ this.prodParam.enter(0);
+ e.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null;
+ this.expressionScope.exit();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+ parseClassId(e, t, r, s = 8331) {
+ if (tokenIsIdentifier(this.state.type)) {
+ e.id = this.parseIdentifier();
+ if (t) {
+ this.declareNameFromIdentifier(e.id, s);
+ }
+ } else {
+ if (r || !t) {
+ e.id = null;
+ } else {
+ throw this.raise(u.MissingClassName, { at: this.state.startLoc });
+ }
+ }
+ }
+ parseClassSuper(e) {
+ e.superClass = this.eat(81) ? this.parseExprSubscripts() : null;
+ }
+ parseExport(e, t) {
+ const r = this.parseMaybeImportPhase(e, true);
+ const s = this.maybeParseExportDefaultSpecifier(e, r);
+ const i = !s || this.eat(12);
+ const n = i && this.eatExportStar(e);
+ const a = n && this.maybeParseExportNamespaceSpecifier(e);
+ const o = i && (!a || this.eat(12));
+ const l = s || n;
+ if (n && !a) {
+ if (s) this.unexpected();
+ if (t) {
+ throw this.raise(u.UnsupportedDecoratorExport, { at: e });
+ }
+ this.parseExportFrom(e, true);
+ return this.finishNode(e, 'ExportAllDeclaration');
+ }
+ const c = this.maybeParseExportNamedSpecifiers(e);
+ if (s && i && !n && !c) {
+ this.unexpected(null, 5);
+ }
+ if (a && o) {
+ this.unexpected(null, 98);
+ }
+ let p;
+ if (l || c) {
+ p = false;
+ if (t) {
+ throw this.raise(u.UnsupportedDecoratorExport, { at: e });
+ }
+ this.parseExportFrom(e, l);
+ } else {
+ p = this.maybeParseExportDeclaration(e);
+ }
+ if (l || c || p) {
+ var d;
+ const r = e;
+ this.checkExport(r, true, false, !!r.source);
+ if (
+ ((d = r.declaration) == null ? void 0 : d.type) ===
+ 'ClassDeclaration'
+ ) {
+ this.maybeTakeDecorators(t, r.declaration, r);
+ } else if (t) {
+ throw this.raise(u.UnsupportedDecoratorExport, { at: e });
+ }
+ return this.finishNode(r, 'ExportNamedDeclaration');
+ }
+ if (this.eat(65)) {
+ const r = e;
+ const s = this.parseExportDefaultExpression();
+ r.declaration = s;
+ if (s.type === 'ClassDeclaration') {
+ this.maybeTakeDecorators(t, s, r);
+ } else if (t) {
+ throw this.raise(u.UnsupportedDecoratorExport, { at: e });
+ }
+ this.checkExport(r, true, true);
+ return this.finishNode(r, 'ExportDefaultDeclaration');
+ }
+ this.unexpected(null, 5);
+ }
+ eatExportStar(e) {
+ return this.eat(55);
+ }
+ maybeParseExportDefaultSpecifier(e, t) {
+ if (t || this.isExportDefaultSpecifier()) {
+ this.expectPlugin(
+ 'exportDefaultFrom',
+ t == null ? void 0 : t.loc.start,
+ );
+ const r = t || this.parseIdentifier(true);
+ const s = this.startNodeAtNode(r);
+ s.exported = r;
+ e.specifiers = [this.finishNode(s, 'ExportDefaultSpecifier')];
+ return true;
+ }
+ return false;
+ }
+ maybeParseExportNamespaceSpecifier(e) {
+ if (this.isContextual(93)) {
+ if (!e.specifiers) e.specifiers = [];
+ const t = this.startNodeAt(this.state.lastTokStartLoc);
+ this.next();
+ t.exported = this.parseModuleExportName();
+ e.specifiers.push(this.finishNode(t, 'ExportNamespaceSpecifier'));
+ return true;
+ }
+ return false;
+ }
+ maybeParseExportNamedSpecifiers(e) {
+ if (this.match(5)) {
+ if (!e.specifiers) e.specifiers = [];
+ const t = e.exportKind === 'type';
+ e.specifiers.push(...this.parseExportSpecifiers(t));
+ e.source = null;
+ e.declaration = null;
+ if (this.hasPlugin('importAssertions')) {
+ e.assertions = [];
+ }
+ return true;
+ }
+ return false;
+ }
+ maybeParseExportDeclaration(e) {
+ if (this.shouldParseExportDeclaration()) {
+ e.specifiers = [];
+ e.source = null;
+ if (this.hasPlugin('importAssertions')) {
+ e.assertions = [];
+ }
+ e.declaration = this.parseExportDeclaration(e);
+ return true;
+ }
+ return false;
+ }
+ isAsyncFunction() {
+ if (!this.isContextual(95)) return false;
+ const e = this.nextTokenInLineStart();
+ return this.isUnparsedContextual(e, 'function');
+ }
+ parseExportDefaultExpression() {
+ const e = this.startNode();
+ if (this.match(68)) {
+ this.next();
+ return this.parseFunction(e, 1 | 4);
+ } else if (this.isAsyncFunction()) {
+ this.next();
+ this.next();
+ return this.parseFunction(e, 1 | 4 | 8);
+ }
+ if (this.match(80)) {
+ return this.parseClass(e, true, true);
+ }
+ if (this.match(26)) {
+ if (
+ this.hasPlugin('decorators') &&
+ this.getPluginOption('decorators', 'decoratorsBeforeExport') ===
+ true
+ ) {
+ this.raise(u.DecoratorBeforeExport, { at: this.state.startLoc });
+ }
+ return this.parseClass(
+ this.maybeTakeDecorators(
+ this.parseDecorators(false),
+ this.startNode(),
+ ),
+ true,
+ true,
+ );
+ }
+ if (this.match(75) || this.match(74) || this.isLet()) {
+ throw this.raise(u.UnsupportedDefaultExport, {
+ at: this.state.startLoc,
+ });
+ }
+ const t = this.parseMaybeAssignAllowIn();
+ this.semicolon();
+ return t;
+ }
+ parseExportDeclaration(e) {
+ if (this.match(80)) {
+ const e = this.parseClass(this.startNode(), true, false);
+ return e;
+ }
+ return this.parseStatementListItem();
+ }
+ isExportDefaultSpecifier() {
+ const { type: e } = this.state;
+ if (tokenIsIdentifier(e)) {
+ if ((e === 95 && !this.state.containsEsc) || e === 100) {
+ return false;
+ }
+ if ((e === 130 || e === 129) && !this.state.containsEsc) {
+ const { type: e } = this.lookahead();
+ if ((tokenIsIdentifier(e) && e !== 98) || e === 5) {
+ this.expectOnePlugin(['flow', 'typescript']);
+ return false;
+ }
+ }
+ } else if (!this.match(65)) {
+ return false;
+ }
+ const t = this.nextTokenStart();
+ const r = this.isUnparsedContextual(t, 'from');
+ if (
+ this.input.charCodeAt(t) === 44 ||
+ (tokenIsIdentifier(this.state.type) && r)
+ ) {
+ return true;
+ }
+ if (this.match(65) && r) {
+ const e = this.input.charCodeAt(this.nextTokenStartSince(t + 4));
+ return e === 34 || e === 39;
+ }
+ return false;
+ }
+ parseExportFrom(e, t) {
+ if (this.eatContextual(98)) {
+ e.source = this.parseImportSource();
+ this.checkExport(e);
+ this.maybeParseImportAttributes(e);
+ this.checkJSONModuleImport(e);
+ } else if (t) {
+ this.unexpected();
+ }
+ this.semicolon();
+ }
+ shouldParseExportDeclaration() {
+ const { type: e } = this.state;
+ if (e === 26) {
+ this.expectOnePlugin(['decorators', 'decorators-legacy']);
+ if (this.hasPlugin('decorators')) {
+ if (
+ this.getPluginOption('decorators', 'decoratorsBeforeExport') ===
+ true
+ ) {
+ this.raise(u.DecoratorBeforeExport, {
+ at: this.state.startLoc,
+ });
+ }
+ return true;
+ }
+ }
+ return (
+ e === 74 ||
+ e === 75 ||
+ e === 68 ||
+ e === 80 ||
+ this.isLet() ||
+ this.isAsyncFunction()
+ );
+ }
+ checkExport(e, t, r, s) {
+ if (t) {
+ var i;
+ if (r) {
+ this.checkDuplicateExports(e, 'default');
+ if (this.hasPlugin('exportDefaultFrom')) {
+ var n;
+ const t = e.declaration;
+ if (
+ t.type === 'Identifier' &&
+ t.name === 'from' &&
+ t.end - t.start === 4 &&
+ !((n = t.extra) != null && n.parenthesized)
+ ) {
+ this.raise(u.ExportDefaultFromAsIdentifier, { at: t });
+ }
+ }
+ } else if ((i = e.specifiers) != null && i.length) {
+ for (const t of e.specifiers) {
+ const { exported: e } = t;
+ const r = e.type === 'Identifier' ? e.name : e.value;
+ this.checkDuplicateExports(t, r);
+ if (!s && t.local) {
+ const { local: e } = t;
+ if (e.type !== 'Identifier') {
+ this.raise(u.ExportBindingIsString, {
+ at: t,
+ localName: e.value,
+ exportName: r,
+ });
+ } else {
+ this.checkReservedWord(e.name, e.loc.start, true, false);
+ this.scope.checkLocalExport(e);
+ }
+ }
+ }
+ } else if (e.declaration) {
+ if (
+ e.declaration.type === 'FunctionDeclaration' ||
+ e.declaration.type === 'ClassDeclaration'
+ ) {
+ const t = e.declaration.id;
+ if (!t) throw new Error('Assertion failure');
+ this.checkDuplicateExports(e, t.name);
+ } else if (e.declaration.type === 'VariableDeclaration') {
+ for (const t of e.declaration.declarations) {
+ this.checkDeclaration(t.id);
+ }
+ }
+ }
+ }
+ }
+ checkDeclaration(e) {
+ if (e.type === 'Identifier') {
+ this.checkDuplicateExports(e, e.name);
+ } else if (e.type === 'ObjectPattern') {
+ for (const t of e.properties) {
+ this.checkDeclaration(t);
+ }
+ } else if (e.type === 'ArrayPattern') {
+ for (const t of e.elements) {
+ if (t) {
+ this.checkDeclaration(t);
+ }
+ }
+ } else if (e.type === 'ObjectProperty') {
+ this.checkDeclaration(e.value);
+ } else if (e.type === 'RestElement') {
+ this.checkDeclaration(e.argument);
+ } else if (e.type === 'AssignmentPattern') {
+ this.checkDeclaration(e.left);
+ }
+ }
+ checkDuplicateExports(e, t) {
+ if (this.exportedIdentifiers.has(t)) {
+ if (t === 'default') {
+ this.raise(u.DuplicateDefaultExport, { at: e });
+ } else {
+ this.raise(u.DuplicateExport, { at: e, exportName: t });
+ }
+ }
+ this.exportedIdentifiers.add(t);
+ }
+ parseExportSpecifiers(e) {
+ const t = [];
+ let r = true;
+ this.expect(5);
+ while (!this.eat(8)) {
+ if (r) {
+ r = false;
+ } else {
+ this.expect(12);
+ if (this.eat(8)) break;
+ }
+ const s = this.isContextual(130);
+ const i = this.match(133);
+ const n = this.startNode();
+ n.local = this.parseModuleExportName();
+ t.push(this.parseExportSpecifier(n, i, e, s));
+ }
+ return t;
+ }
+ parseExportSpecifier(e, t, r, s) {
+ if (this.eatContextual(93)) {
+ e.exported = this.parseModuleExportName();
+ } else if (t) {
+ e.exported = cloneStringLiteral(e.local);
+ } else if (!e.exported) {
+ e.exported = cloneIdentifier(e.local);
+ }
+ return this.finishNode(e, 'ExportSpecifier');
+ }
+ parseModuleExportName() {
+ if (this.match(133)) {
+ const e = this.parseStringLiteral(this.state.value);
+ const t = e.value.match(he);
+ if (t) {
+ this.raise(u.ModuleExportNameHasLoneSurrogate, {
+ at: e,
+ surrogateCharCode: t[0].charCodeAt(0),
+ });
+ }
+ return e;
+ }
+ return this.parseIdentifier(true);
+ }
+ isJSONModuleImport(e) {
+ if (e.assertions != null) {
+ return e.assertions.some(
+ ({ key: e, value: t }) =>
+ t.value === 'json' &&
+ (e.type === 'Identifier'
+ ? e.name === 'type'
+ : e.value === 'type'),
+ );
+ }
+ return false;
+ }
+ checkImportReflection(e) {
+ const { specifiers: t } = e;
+ const r = t.length === 1 ? t[0].type : null;
+ if (e.phase === 'source') {
+ if (r !== 'ImportDefaultSpecifier') {
+ this.raise(u.SourcePhaseImportRequiresDefault, {
+ at: t[0].loc.start,
+ });
+ }
+ } else if (e.phase === 'defer') {
+ if (r !== 'ImportNamespaceSpecifier') {
+ this.raise(u.DeferImportRequiresNamespace, {
+ at: t[0].loc.start,
+ });
+ }
+ } else if (e.module) {
+ var s;
+ if (r !== 'ImportDefaultSpecifier') {
+ this.raise(u.ImportReflectionNotBinding, { at: t[0].loc.start });
+ }
+ if (((s = e.assertions) == null ? void 0 : s.length) > 0) {
+ this.raise(u.ImportReflectionHasAssertion, {
+ at: e.specifiers[0].loc.start,
+ });
+ }
+ }
+ }
+ checkJSONModuleImport(e) {
+ if (this.isJSONModuleImport(e) && e.type !== 'ExportAllDeclaration') {
+ const { specifiers: t } = e;
+ if (t != null) {
+ const e = t.find((e) => {
+ let t;
+ if (e.type === 'ExportSpecifier') {
+ t = e.local;
+ } else if (e.type === 'ImportSpecifier') {
+ t = e.imported;
+ }
+ if (t !== undefined) {
+ return t.type === 'Identifier'
+ ? t.name !== 'default'
+ : t.value !== 'default';
+ }
+ });
+ if (e !== undefined) {
+ this.raise(u.ImportJSONBindingNotDefault, { at: e.loc.start });
+ }
+ }
+ }
+ }
+ isPotentialImportPhase(e) {
+ if (e) return false;
+ return (
+ this.isContextual(105) ||
+ this.isContextual(97) ||
+ this.isContextual(127)
+ );
+ }
+ applyImportPhase(e, t, r, s) {
+ if (t) {
+ return;
+ }
+ if (r === 'module') {
+ this.expectPlugin('importReflection', s);
+ e.module = true;
+ } else if (this.hasPlugin('importReflection')) {
+ e.module = false;
+ }
+ if (r === 'source') {
+ this.expectPlugin('sourcePhaseImports', s);
+ e.phase = 'source';
+ } else if (r === 'defer') {
+ this.expectPlugin('deferredImportEvaluation', s);
+ e.phase = 'defer';
+ } else if (this.hasPlugin('sourcePhaseImports')) {
+ e.phase = null;
+ }
+ }
+ parseMaybeImportPhase(e, t) {
+ if (!this.isPotentialImportPhase(t)) {
+ this.applyImportPhase(e, t, null);
+ return null;
+ }
+ const r = this.parseIdentifier(true);
+ const { type: s } = this.state;
+ const i = tokenIsKeywordOrIdentifier(s)
+ ? s !== 98 || this.lookaheadCharCode() === 102
+ : s !== 12;
+ if (i) {
+ this.resetPreviousIdentifierLeadingComments(r);
+ this.applyImportPhase(e, t, r.name, r.loc.start);
+ return null;
+ } else {
+ this.applyImportPhase(e, t, null);
+ return r;
+ }
+ }
+ isPrecedingIdImportPhase(e) {
+ const { type: t } = this.state;
+ return tokenIsIdentifier(t)
+ ? t !== 98 || this.lookaheadCharCode() === 102
+ : t !== 12;
+ }
+ parseImport(e) {
+ if (this.match(133)) {
+ return this.parseImportSourceAndAttributes(e);
+ }
+ return this.parseImportSpecifiersAndAfter(
+ e,
+ this.parseMaybeImportPhase(e, false),
+ );
+ }
+ parseImportSpecifiersAndAfter(e, t) {
+ e.specifiers = [];
+ const r = this.maybeParseDefaultImportSpecifier(e, t);
+ const s = !r || this.eat(12);
+ const i = s && this.maybeParseStarImportSpecifier(e);
+ if (s && !i) this.parseNamedImportSpecifiers(e);
+ this.expectContextual(98);
+ return this.parseImportSourceAndAttributes(e);
+ }
+ parseImportSourceAndAttributes(e) {
+ var t;
+ (t = e.specifiers) != null ? t : (e.specifiers = []);
+ e.source = this.parseImportSource();
+ this.maybeParseImportAttributes(e);
+ this.checkImportReflection(e);
+ this.checkJSONModuleImport(e);
+ this.semicolon();
+ return this.finishNode(e, 'ImportDeclaration');
+ }
+ parseImportSource() {
+ if (!this.match(133)) this.unexpected();
+ return this.parseExprAtom();
+ }
+ parseImportSpecifierLocal(e, t, r) {
+ t.local = this.parseIdentifier();
+ e.specifiers.push(this.finishImportSpecifier(t, r));
+ }
+ finishImportSpecifier(e, t, r = 8201) {
+ this.checkLVal(e.local, { in: { type: t }, binding: r });
+ return this.finishNode(e, t);
+ }
+ parseImportAttributes() {
+ this.expect(5);
+ const e = [];
+ const t = new Set();
+ do {
+ if (this.match(8)) {
+ break;
+ }
+ const r = this.startNode();
+ const s = this.state.value;
+ if (t.has(s)) {
+ this.raise(u.ModuleAttributesWithDuplicateKeys, {
+ at: this.state.startLoc,
+ key: s,
+ });
+ }
+ t.add(s);
+ if (this.match(133)) {
+ r.key = this.parseStringLiteral(s);
+ } else {
+ r.key = this.parseIdentifier(true);
+ }
+ this.expect(14);
+ if (!this.match(133)) {
+ throw this.raise(u.ModuleAttributeInvalidValue, {
+ at: this.state.startLoc,
+ });
+ }
+ r.value = this.parseStringLiteral(this.state.value);
+ e.push(this.finishNode(r, 'ImportAttribute'));
+ } while (this.eat(12));
+ this.expect(8);
+ return e;
+ }
+ parseModuleAttributes() {
+ const e = [];
+ const t = new Set();
+ do {
+ const r = this.startNode();
+ r.key = this.parseIdentifier(true);
+ if (r.key.name !== 'type') {
+ this.raise(u.ModuleAttributeDifferentFromType, { at: r.key });
+ }
+ if (t.has(r.key.name)) {
+ this.raise(u.ModuleAttributesWithDuplicateKeys, {
+ at: r.key,
+ key: r.key.name,
+ });
+ }
+ t.add(r.key.name);
+ this.expect(14);
+ if (!this.match(133)) {
+ throw this.raise(u.ModuleAttributeInvalidValue, {
+ at: this.state.startLoc,
+ });
+ }
+ r.value = this.parseStringLiteral(this.state.value);
+ e.push(this.finishNode(r, 'ImportAttribute'));
+ } while (this.eat(12));
+ return e;
+ }
+ maybeParseImportAttributes(e) {
+ let t;
+ let r = false;
+ if (this.match(76)) {
+ if (
+ this.hasPrecedingLineBreak() &&
+ this.lookaheadCharCode() === 40
+ ) {
+ return;
+ }
+ this.next();
+ {
+ if (this.hasPlugin('moduleAttributes')) {
+ t = this.parseModuleAttributes();
+ } else {
+ this.expectImportAttributesPlugin();
+ t = this.parseImportAttributes();
+ }
+ }
+ r = true;
+ } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
+ if (this.hasPlugin('importAttributes')) {
+ if (
+ this.getPluginOption(
+ 'importAttributes',
+ 'deprecatedAssertSyntax',
+ ) !== true
+ ) {
+ this.raise(u.ImportAttributesUseAssert, {
+ at: this.state.startLoc,
+ });
+ }
+ this.addExtra(e, 'deprecatedAssertSyntax', true);
+ } else {
+ this.expectOnePlugin(['importAttributes', 'importAssertions']);
+ }
+ this.next();
+ t = this.parseImportAttributes();
+ } else if (
+ this.hasPlugin('importAttributes') ||
+ this.hasPlugin('importAssertions')
+ ) {
+ t = [];
+ } else {
+ if (this.hasPlugin('moduleAttributes')) {
+ t = [];
+ } else return;
+ }
+ if (!r && this.hasPlugin('importAssertions')) {
+ e.assertions = t;
+ } else {
+ e.attributes = t;
+ }
+ }
+ maybeParseDefaultImportSpecifier(e, t) {
+ if (t) {
+ const r = this.startNodeAtNode(t);
+ r.local = t;
+ e.specifiers.push(
+ this.finishImportSpecifier(r, 'ImportDefaultSpecifier'),
+ );
+ return true;
+ } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
+ this.parseImportSpecifierLocal(
+ e,
+ this.startNode(),
+ 'ImportDefaultSpecifier',
+ );
+ return true;
+ }
+ return false;
+ }
+ maybeParseStarImportSpecifier(e) {
+ if (this.match(55)) {
+ const t = this.startNode();
+ this.next();
+ this.expectContextual(93);
+ this.parseImportSpecifierLocal(e, t, 'ImportNamespaceSpecifier');
+ return true;
+ }
+ return false;
+ }
+ parseNamedImportSpecifiers(e) {
+ let t = true;
+ this.expect(5);
+ while (!this.eat(8)) {
+ if (t) {
+ t = false;
+ } else {
+ if (this.eat(14)) {
+ throw this.raise(u.DestructureNamedImport, {
+ at: this.state.startLoc,
+ });
+ }
+ this.expect(12);
+ if (this.eat(8)) break;
+ }
+ const r = this.startNode();
+ const s = this.match(133);
+ const i = this.isContextual(130);
+ r.imported = this.parseModuleExportName();
+ const n = this.parseImportSpecifier(
+ r,
+ s,
+ e.importKind === 'type' || e.importKind === 'typeof',
+ i,
+ undefined,
+ );
+ e.specifiers.push(n);
+ }
+ }
+ parseImportSpecifier(e, t, r, s, i) {
+ if (this.eatContextual(93)) {
+ e.local = this.parseIdentifier();
+ } else {
+ const { imported: r } = e;
+ if (t) {
+ throw this.raise(u.ImportBindingIsString, {
+ at: e,
+ importName: r.value,
+ });
+ }
+ this.checkReservedWord(r.name, e.loc.start, true, true);
+ if (!e.local) {
+ e.local = cloneIdentifier(r);
+ }
+ }
+ return this.finishImportSpecifier(e, 'ImportSpecifier', i);
+ }
+ isThisParam(e) {
+ return e.type === 'Identifier' && e.name === 'this';
+ }
+ }
+ class Parser extends StatementParser {
+ constructor(e, t) {
+ e = getOptions(e);
+ super(e, t);
+ this.options = e;
+ this.initializeScopes();
+ this.plugins = pluginsMap(this.options.plugins);
+ this.filename = e.sourceFilename;
+ }
+ getScopeHandler() {
+ return ScopeHandler;
+ }
+ parse() {
+ this.enterInitialScopes();
+ const e = this.startNode();
+ const t = this.startNode();
+ this.nextToken();
+ e.errors = null;
+ this.parseTopLevel(e, t);
+ e.errors = this.state.errors;
+ return e;
+ }
+ }
+ function pluginsMap(e) {
+ const t = new Map();
+ for (const r of e) {
+ const [e, s] = Array.isArray(r) ? r : [r, {}];
+ if (!t.has(e)) t.set(e, s || {});
+ }
+ return t;
+ }
+ function parse(e, t) {
+ var r;
+ if (((r = t) == null ? void 0 : r.sourceType) === 'unambiguous') {
+ t = Object.assign({}, t);
+ try {
+ t.sourceType = 'module';
+ const r = getParser(t, e);
+ const s = r.parse();
+ if (r.sawUnambiguousESM) {
+ return s;
+ }
+ if (r.ambiguousScriptDifferentAst) {
+ try {
+ t.sourceType = 'script';
+ return getParser(t, e).parse();
+ } catch (e) {}
+ } else {
+ s.program.sourceType = 'script';
+ }
+ return s;
+ } catch (r) {
+ try {
+ t.sourceType = 'script';
+ return getParser(t, e).parse();
+ } catch (e) {}
+ throw r;
+ }
+ } else {
+ return getParser(t, e).parse();
+ }
+ }
+ function parseExpression(e, t) {
+ const r = getParser(t, e);
+ if (r.options.strictMode) {
+ r.state.strict = true;
+ }
+ return r.getExpression();
+ }
+ function generateExportedTokenTypes(e) {
+ const t = {};
+ for (const r of Object.keys(e)) {
+ t[r] = getExportedToken(e[r]);
+ }
+ return t;
+ }
+ const me = generateExportedTokenTypes(N);
+ function getParser(e, t) {
+ let r = Parser;
+ if (e != null && e.plugins) {
+ validatePlugins(e.plugins);
+ r = getParserClass(e.plugins);
+ }
+ return new r(e, t);
+ }
+ const Te = {};
+ function getParserClass(e) {
+ const t = pe.filter((t) => hasPlugin(e, t));
+ const r = t.join('/');
+ let s = Te[r];
+ if (!s) {
+ s = Parser;
+ for (const e of t) {
+ s = ce[e](s);
+ }
+ Te[r] = s;
+ }
+ return s;
+ }
+ t.parse = parse;
+ t.parseExpression = parseExpression;
+ t.tokTypes = me;
+ },
+ 4435: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = void 0;
+ var s = r(6028);
+ var i = (t['default'] = (0, s.declare)((e) => {
+ e.assertVersion(7);
+ return {
+ name: 'syntax-jsx',
+ manipulateOptions(e, t) {
+ {
+ if (
+ t.plugins.some(
+ (e) => (Array.isArray(e) ? e[0] : e) === 'typescript',
+ )
+ ) {
+ return;
+ }
+ }
+ t.plugins.push('jsx');
+ },
+ };
+ }));
+ },
+ 6435: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = createTemplateBuilder;
+ var s = r(9541);
+ var i = r(5435);
+ var n = r(1527);
+ const a = (0, s.validate)({ placeholderPattern: false });
+ function createTemplateBuilder(e, t) {
+ const r = new WeakMap();
+ const o = new WeakMap();
+ const l = t || (0, s.validate)(null);
+ return Object.assign(
+ (t, ...a) => {
+ if (typeof t === 'string') {
+ if (a.length > 1) throw new Error('Unexpected extra params.');
+ return extendedTrace(
+ (0, i.default)(e, t, (0, s.merge)(l, (0, s.validate)(a[0]))),
+ );
+ } else if (Array.isArray(t)) {
+ let s = r.get(t);
+ if (!s) {
+ s = (0, n.default)(e, t, l);
+ r.set(t, s);
+ }
+ return extendedTrace(s(a));
+ } else if (typeof t === 'object' && t) {
+ if (a.length > 0) throw new Error('Unexpected extra params.');
+ return createTemplateBuilder(
+ e,
+ (0, s.merge)(l, (0, s.validate)(t)),
+ );
+ }
+ throw new Error(`Unexpected template param ${typeof t}`);
+ },
+ {
+ ast: (t, ...r) => {
+ if (typeof t === 'string') {
+ if (r.length > 1) throw new Error('Unexpected extra params.');
+ return (0, i.default)(
+ e,
+ t,
+ (0, s.merge)((0, s.merge)(l, (0, s.validate)(r[0])), a),
+ )();
+ } else if (Array.isArray(t)) {
+ let i = o.get(t);
+ if (!i) {
+ i = (0, n.default)(e, t, (0, s.merge)(l, a));
+ o.set(t, i);
+ }
+ return i(r)();
+ }
+ throw new Error(`Unexpected template param ${typeof t}`);
+ },
+ },
+ );
+ }
+ function extendedTrace(e) {
+ let t = '';
+ try {
+ throw new Error();
+ } catch (e) {
+ if (e.stack) {
+ t = e.stack.split('\n').slice(3).join('\n');
+ }
+ }
+ return (r) => {
+ try {
+ return e(r);
+ } catch (e) {
+ e.stack += `\n =============\n${t}`;
+ throw e;
+ }
+ };
+ }
+ },
+ 3499: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.statements = t.statement = t.smart = t.program = t.expression = void 0;
+ var s = r(4739);
+ const { assertExpressionStatement: i } = s;
+ function makeStatementFormatter(e) {
+ return {
+ code: (e) => `/* @babel/template */;\n${e}`,
+ validate: () => {},
+ unwrap: (t) => e(t.program.body.slice(1)),
+ };
+ }
+ const n = makeStatementFormatter((e) => {
+ if (e.length > 1) {
+ return e;
+ } else {
+ return e[0];
+ }
+ });
+ t.smart = n;
+ const a = makeStatementFormatter((e) => e);
+ t.statements = a;
+ const o = makeStatementFormatter((e) => {
+ if (e.length === 0) {
+ throw new Error('Found nothing to return.');
+ }
+ if (e.length > 1) {
+ throw new Error('Found multiple statements but wanted one');
+ }
+ return e[0];
+ });
+ t.statement = o;
+ const l = {
+ code: (e) => `(\n${e}\n)`,
+ validate: (e) => {
+ if (e.program.body.length > 1) {
+ throw new Error('Found multiple statements but wanted one');
+ }
+ if (l.unwrap(e).start === 0) {
+ throw new Error('Parse result included parens.');
+ }
+ },
+ unwrap: ({ program: e }) => {
+ const [t] = e.body;
+ i(t);
+ return t.expression;
+ },
+ };
+ t.expression = l;
+ const c = {
+ code: (e) => e,
+ validate: () => {},
+ unwrap: (e) => e.program,
+ };
+ t.program = c;
+ },
+ 8063: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.statements =
+ t.statement =
+ t.smart =
+ t.program =
+ t.expression =
+ t['default'] =
+ void 0;
+ var s = r(3499);
+ var i = r(6435);
+ const n = (0, i.default)(s.smart);
+ t.smart = n;
+ const a = (0, i.default)(s.statement);
+ t.statement = a;
+ const o = (0, i.default)(s.statements);
+ t.statements = o;
+ const l = (0, i.default)(s.expression);
+ t.expression = l;
+ const c = (0, i.default)(s.program);
+ t.program = c;
+ var p = Object.assign(n.bind(undefined), {
+ smart: n,
+ statement: a,
+ statements: o,
+ expression: l,
+ program: c,
+ ast: n.ast,
+ });
+ t['default'] = p;
+ },
+ 1527: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = literalTemplate;
+ var s = r(9541);
+ var i = r(6340);
+ var n = r(7839);
+ function literalTemplate(e, t, r) {
+ const { metadata: i, names: a } = buildLiteralData(e, t, r);
+ return (t) => {
+ const r = {};
+ t.forEach((e, t) => {
+ r[a[t]] = e;
+ });
+ return (t) => {
+ const a = (0, s.normalizeReplacements)(t);
+ if (a) {
+ Object.keys(a).forEach((e) => {
+ if (Object.prototype.hasOwnProperty.call(r, e)) {
+ throw new Error('Unexpected replacement overlap.');
+ }
+ });
+ }
+ return e.unwrap((0, n.default)(i, a ? Object.assign(a, r) : r));
+ };
+ };
+ }
+ function buildLiteralData(e, t, r) {
+ let s = 'BABEL_TPL$';
+ const n = t.join('');
+ do {
+ s = '$$' + s;
+ } while (n.includes(s));
+ const { names: a, code: o } = buildTemplateCode(t, s);
+ const l = (0, i.default)(e, e.code(o), {
+ parser: r.parser,
+ placeholderWhitelist: new Set(
+ a.concat(
+ r.placeholderWhitelist ? Array.from(r.placeholderWhitelist) : [],
+ ),
+ ),
+ placeholderPattern: r.placeholderPattern,
+ preserveComments: r.preserveComments,
+ syntacticPlaceholders: r.syntacticPlaceholders,
+ });
+ return { metadata: l, names: a };
+ }
+ function buildTemplateCode(e, t) {
+ const r = [];
+ let s = e[0];
+ for (let i = 1; i < e.length; i++) {
+ const n = `${t}${i - 1}`;
+ r.push(n);
+ s += n + e[i];
+ }
+ return { names: r, code: s };
+ }
+ },
+ 9541: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.merge = merge;
+ t.normalizeReplacements = normalizeReplacements;
+ t.validate = validate;
+ const r = [
+ 'placeholderWhitelist',
+ 'placeholderPattern',
+ 'preserveComments',
+ 'syntacticPlaceholders',
+ ];
+ function _objectWithoutPropertiesLoose(e, t) {
+ if (e == null) return {};
+ var r = {};
+ var s = Object.keys(e);
+ var i, n;
+ for (n = 0; n < s.length; n++) {
+ i = s[n];
+ if (t.indexOf(i) >= 0) continue;
+ r[i] = e[i];
+ }
+ return r;
+ }
+ function merge(e, t) {
+ const {
+ placeholderWhitelist: r = e.placeholderWhitelist,
+ placeholderPattern: s = e.placeholderPattern,
+ preserveComments: i = e.preserveComments,
+ syntacticPlaceholders: n = e.syntacticPlaceholders,
+ } = t;
+ return {
+ parser: Object.assign({}, e.parser, t.parser),
+ placeholderWhitelist: r,
+ placeholderPattern: s,
+ preserveComments: i,
+ syntacticPlaceholders: n,
+ };
+ }
+ function validate(e) {
+ if (e != null && typeof e !== 'object') {
+ throw new Error('Unknown template options.');
+ }
+ const t = e || {},
+ {
+ placeholderWhitelist: s,
+ placeholderPattern: i,
+ preserveComments: n,
+ syntacticPlaceholders: a,
+ } = t,
+ o = _objectWithoutPropertiesLoose(t, r);
+ if (s != null && !(s instanceof Set)) {
+ throw new Error(
+ "'.placeholderWhitelist' must be a Set, null, or undefined",
+ );
+ }
+ if (i != null && !(i instanceof RegExp) && i !== false) {
+ throw new Error(
+ "'.placeholderPattern' must be a RegExp, false, null, or undefined",
+ );
+ }
+ if (n != null && typeof n !== 'boolean') {
+ throw new Error(
+ "'.preserveComments' must be a boolean, null, or undefined",
+ );
+ }
+ if (a != null && typeof a !== 'boolean') {
+ throw new Error(
+ "'.syntacticPlaceholders' must be a boolean, null, or undefined",
+ );
+ }
+ if (a === true && (s != null || i != null)) {
+ throw new Error(
+ "'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" +
+ " with '.syntacticPlaceholders: true'",
+ );
+ }
+ return {
+ parser: o,
+ placeholderWhitelist: s || undefined,
+ placeholderPattern: i == null ? undefined : i,
+ preserveComments: n == null ? undefined : n,
+ syntacticPlaceholders: a == null ? undefined : a,
+ };
+ }
+ function normalizeReplacements(e) {
+ if (Array.isArray(e)) {
+ return e.reduce((e, t, r) => {
+ e['$' + r] = t;
+ return e;
+ }, {});
+ } else if (typeof e === 'object' || e == null) {
+ return e || undefined;
+ }
+ throw new Error(
+ 'Template replacements must be an array, object, null, or undefined',
+ );
+ }
+ },
+ 6340: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = parseAndBuildMetadata;
+ var s = r(4739);
+ var i = r(3033);
+ var n = r(8135);
+ const {
+ isCallExpression: a,
+ isExpressionStatement: o,
+ isFunction: l,
+ isIdentifier: c,
+ isJSXIdentifier: p,
+ isNewExpression: u,
+ isPlaceholder: d,
+ isStatement: f,
+ isStringLiteral: h,
+ removePropertiesDeep: y,
+ traverse: m,
+ } = s;
+ const T = /^[_$A-Z0-9]+$/;
+ function parseAndBuildMetadata(e, t, r) {
+ const {
+ placeholderWhitelist: s,
+ placeholderPattern: i,
+ preserveComments: n,
+ syntacticPlaceholders: a,
+ } = r;
+ const o = parseWithCodeFrame(t, r.parser, a);
+ y(o, { preserveComments: n });
+ e.validate(o);
+ const l = {
+ syntactic: { placeholders: [], placeholderNames: new Set() },
+ legacy: { placeholders: [], placeholderNames: new Set() },
+ placeholderWhitelist: s,
+ placeholderPattern: i,
+ syntacticPlaceholders: a,
+ };
+ m(o, placeholderVisitorHandler, l);
+ return Object.assign(
+ { ast: o },
+ l.syntactic.placeholders.length ? l.syntactic : l.legacy,
+ );
+ }
+ function placeholderVisitorHandler(e, t, r) {
+ var s;
+ let i;
+ let n = r.syntactic.placeholders.length > 0;
+ if (d(e)) {
+ if (r.syntacticPlaceholders === false) {
+ throw new Error(
+ "%%foo%%-style placeholders can't be used when " +
+ "'.syntacticPlaceholders' is false.",
+ );
+ }
+ i = e.name.name;
+ n = true;
+ } else if (n || r.syntacticPlaceholders) {
+ return;
+ } else if (c(e) || p(e)) {
+ i = e.name;
+ } else if (h(e)) {
+ i = e.value;
+ } else {
+ return;
+ }
+ if (
+ n &&
+ (r.placeholderPattern != null || r.placeholderWhitelist != null)
+ ) {
+ throw new Error(
+ "'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" +
+ " with '.syntacticPlaceholders: true'",
+ );
+ }
+ if (
+ !n &&
+ (r.placeholderPattern === false ||
+ !(r.placeholderPattern || T).test(i)) &&
+ !((s = r.placeholderWhitelist) != null && s.has(i))
+ ) {
+ return;
+ }
+ t = t.slice();
+ const { node: y, key: m } = t[t.length - 1];
+ let S;
+ if (h(e) || d(e, { expectedNode: 'StringLiteral' })) {
+ S = 'string';
+ } else if (
+ (u(y) && m === 'arguments') ||
+ (a(y) && m === 'arguments') ||
+ (l(y) && m === 'params')
+ ) {
+ S = 'param';
+ } else if (o(y) && !d(e)) {
+ S = 'statement';
+ t = t.slice(0, -1);
+ } else if (f(e) && d(e)) {
+ S = 'statement';
+ } else {
+ S = 'other';
+ }
+ const { placeholders: x, placeholderNames: b } = !n
+ ? r.legacy
+ : r.syntactic;
+ x.push({
+ name: i,
+ type: S,
+ resolve: (e) => resolveAncestors(e, t),
+ isDuplicate: b.has(i),
+ });
+ b.add(i);
+ }
+ function resolveAncestors(e, t) {
+ let r = e;
+ for (let e = 0; e < t.length - 1; e++) {
+ const { key: s, index: i } = t[e];
+ if (i === undefined) {
+ r = r[s];
+ } else {
+ r = r[s][i];
+ }
+ }
+ const { key: s, index: i } = t[t.length - 1];
+ return { parent: r, key: s, index: i };
+ }
+ function parseWithCodeFrame(e, t, r) {
+ const s = (t.plugins || []).slice();
+ if (r !== false) {
+ s.push('placeholders');
+ }
+ t = Object.assign(
+ {
+ allowReturnOutsideFunction: true,
+ allowSuperOutsideMethod: true,
+ sourceType: 'module',
+ },
+ t,
+ { plugins: s },
+ );
+ try {
+ return (0, i.parse)(e, t);
+ } catch (t) {
+ const r = t.loc;
+ if (r) {
+ t.message += '\n' + (0, n.codeFrameColumns)(e, { start: r });
+ t.code = 'BABEL_TEMPLATE_PARSE_ERROR';
+ }
+ throw t;
+ }
+ }
+ },
+ 7839: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = populatePlaceholders;
+ var s = r(4739);
+ const {
+ blockStatement: i,
+ cloneNode: n,
+ emptyStatement: a,
+ expressionStatement: o,
+ identifier: l,
+ isStatement: c,
+ isStringLiteral: p,
+ stringLiteral: u,
+ validate: d,
+ } = s;
+ function populatePlaceholders(e, t) {
+ const r = n(e.ast);
+ if (t) {
+ e.placeholders.forEach((e) => {
+ if (!Object.prototype.hasOwnProperty.call(t, e.name)) {
+ const t = e.name;
+ throw new Error(
+ `Error: No substitution given for "${t}". If this is not meant to be a\n placeholder you may want to consider passing one of the following options to @babel/template:\n - { placeholderPattern: false, placeholderWhitelist: new Set(['${t}'])}\n - { placeholderPattern: /^${t}$/ }`,
+ );
+ }
+ });
+ Object.keys(t).forEach((t) => {
+ if (!e.placeholderNames.has(t)) {
+ throw new Error(`Unknown substitution "${t}" given`);
+ }
+ });
+ }
+ e.placeholders
+ .slice()
+ .reverse()
+ .forEach((e) => {
+ try {
+ applyReplacement(e, r, (t && t[e.name]) || null);
+ } catch (t) {
+ t.message = `@babel/template placeholder "${e.name}": ${t.message}`;
+ throw t;
+ }
+ });
+ return r;
+ }
+ function applyReplacement(e, t, r) {
+ if (e.isDuplicate) {
+ if (Array.isArray(r)) {
+ r = r.map((e) => n(e));
+ } else if (typeof r === 'object') {
+ r = n(r);
+ }
+ }
+ const { parent: s, key: f, index: h } = e.resolve(t);
+ if (e.type === 'string') {
+ if (typeof r === 'string') {
+ r = u(r);
+ }
+ if (!r || !p(r)) {
+ throw new Error('Expected string substitution');
+ }
+ } else if (e.type === 'statement') {
+ if (h === undefined) {
+ if (!r) {
+ r = a();
+ } else if (Array.isArray(r)) {
+ r = i(r);
+ } else if (typeof r === 'string') {
+ r = o(l(r));
+ } else if (!c(r)) {
+ r = o(r);
+ }
+ } else {
+ if (r && !Array.isArray(r)) {
+ if (typeof r === 'string') {
+ r = l(r);
+ }
+ if (!c(r)) {
+ r = o(r);
+ }
+ }
+ }
+ } else if (e.type === 'param') {
+ if (typeof r === 'string') {
+ r = l(r);
+ }
+ if (h === undefined) throw new Error('Assertion failure.');
+ } else {
+ if (typeof r === 'string') {
+ r = l(r);
+ }
+ if (Array.isArray(r)) {
+ throw new Error('Cannot replace single expression with an array.');
+ }
+ }
+ if (h === undefined) {
+ d(s, f, r);
+ s[f] = r;
+ } else {
+ const t = s[f].slice();
+ if (e.type === 'statement' || e.type === 'param') {
+ if (r == null) {
+ t.splice(h, 1);
+ } else if (Array.isArray(r)) {
+ t.splice(h, 1, ...r);
+ } else {
+ t[h] = r;
+ }
+ } else {
+ t[h] = r;
+ }
+ d(s, f, t);
+ s[f] = t;
+ }
+ }
+ },
+ 5435: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = stringTemplate;
+ var s = r(9541);
+ var i = r(6340);
+ var n = r(7839);
+ function stringTemplate(e, t, r) {
+ t = e.code(t);
+ let a;
+ return (o) => {
+ const l = (0, s.normalizeReplacements)(o);
+ if (!a) a = (0, i.default)(e, t, r);
+ return e.unwrap((0, n.default)(a, l));
+ };
+ }
+ },
+ 4632: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = assertNode;
+ var s = r(6516);
+ function assertNode(e) {
+ if (!(0, s.default)(e)) {
+ var t;
+ const r =
+ (t = e == null ? void 0 : e.type) != null ? t : JSON.stringify(e);
+ throw new TypeError(`Not a valid node of type "${r}"`);
+ }
+ }
+ },
+ 3701: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.assertAccessor = assertAccessor;
+ t.assertAnyTypeAnnotation = assertAnyTypeAnnotation;
+ t.assertArgumentPlaceholder = assertArgumentPlaceholder;
+ t.assertArrayExpression = assertArrayExpression;
+ t.assertArrayPattern = assertArrayPattern;
+ t.assertArrayTypeAnnotation = assertArrayTypeAnnotation;
+ t.assertArrowFunctionExpression = assertArrowFunctionExpression;
+ t.assertAssignmentExpression = assertAssignmentExpression;
+ t.assertAssignmentPattern = assertAssignmentPattern;
+ t.assertAwaitExpression = assertAwaitExpression;
+ t.assertBigIntLiteral = assertBigIntLiteral;
+ t.assertBinary = assertBinary;
+ t.assertBinaryExpression = assertBinaryExpression;
+ t.assertBindExpression = assertBindExpression;
+ t.assertBlock = assertBlock;
+ t.assertBlockParent = assertBlockParent;
+ t.assertBlockStatement = assertBlockStatement;
+ t.assertBooleanLiteral = assertBooleanLiteral;
+ t.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation;
+ t.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation;
+ t.assertBreakStatement = assertBreakStatement;
+ t.assertCallExpression = assertCallExpression;
+ t.assertCatchClause = assertCatchClause;
+ t.assertClass = assertClass;
+ t.assertClassAccessorProperty = assertClassAccessorProperty;
+ t.assertClassBody = assertClassBody;
+ t.assertClassDeclaration = assertClassDeclaration;
+ t.assertClassExpression = assertClassExpression;
+ t.assertClassImplements = assertClassImplements;
+ t.assertClassMethod = assertClassMethod;
+ t.assertClassPrivateMethod = assertClassPrivateMethod;
+ t.assertClassPrivateProperty = assertClassPrivateProperty;
+ t.assertClassProperty = assertClassProperty;
+ t.assertCompletionStatement = assertCompletionStatement;
+ t.assertConditional = assertConditional;
+ t.assertConditionalExpression = assertConditionalExpression;
+ t.assertContinueStatement = assertContinueStatement;
+ t.assertDebuggerStatement = assertDebuggerStatement;
+ t.assertDecimalLiteral = assertDecimalLiteral;
+ t.assertDeclaration = assertDeclaration;
+ t.assertDeclareClass = assertDeclareClass;
+ t.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration;
+ t.assertDeclareExportDeclaration = assertDeclareExportDeclaration;
+ t.assertDeclareFunction = assertDeclareFunction;
+ t.assertDeclareInterface = assertDeclareInterface;
+ t.assertDeclareModule = assertDeclareModule;
+ t.assertDeclareModuleExports = assertDeclareModuleExports;
+ t.assertDeclareOpaqueType = assertDeclareOpaqueType;
+ t.assertDeclareTypeAlias = assertDeclareTypeAlias;
+ t.assertDeclareVariable = assertDeclareVariable;
+ t.assertDeclaredPredicate = assertDeclaredPredicate;
+ t.assertDecorator = assertDecorator;
+ t.assertDirective = assertDirective;
+ t.assertDirectiveLiteral = assertDirectiveLiteral;
+ t.assertDoExpression = assertDoExpression;
+ t.assertDoWhileStatement = assertDoWhileStatement;
+ t.assertEmptyStatement = assertEmptyStatement;
+ t.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation;
+ t.assertEnumBody = assertEnumBody;
+ t.assertEnumBooleanBody = assertEnumBooleanBody;
+ t.assertEnumBooleanMember = assertEnumBooleanMember;
+ t.assertEnumDeclaration = assertEnumDeclaration;
+ t.assertEnumDefaultedMember = assertEnumDefaultedMember;
+ t.assertEnumMember = assertEnumMember;
+ t.assertEnumNumberBody = assertEnumNumberBody;
+ t.assertEnumNumberMember = assertEnumNumberMember;
+ t.assertEnumStringBody = assertEnumStringBody;
+ t.assertEnumStringMember = assertEnumStringMember;
+ t.assertEnumSymbolBody = assertEnumSymbolBody;
+ t.assertExistsTypeAnnotation = assertExistsTypeAnnotation;
+ t.assertExportAllDeclaration = assertExportAllDeclaration;
+ t.assertExportDeclaration = assertExportDeclaration;
+ t.assertExportDefaultDeclaration = assertExportDefaultDeclaration;
+ t.assertExportDefaultSpecifier = assertExportDefaultSpecifier;
+ t.assertExportNamedDeclaration = assertExportNamedDeclaration;
+ t.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;
+ t.assertExportSpecifier = assertExportSpecifier;
+ t.assertExpression = assertExpression;
+ t.assertExpressionStatement = assertExpressionStatement;
+ t.assertExpressionWrapper = assertExpressionWrapper;
+ t.assertFile = assertFile;
+ t.assertFlow = assertFlow;
+ t.assertFlowBaseAnnotation = assertFlowBaseAnnotation;
+ t.assertFlowDeclaration = assertFlowDeclaration;
+ t.assertFlowPredicate = assertFlowPredicate;
+ t.assertFlowType = assertFlowType;
+ t.assertFor = assertFor;
+ t.assertForInStatement = assertForInStatement;
+ t.assertForOfStatement = assertForOfStatement;
+ t.assertForStatement = assertForStatement;
+ t.assertForXStatement = assertForXStatement;
+ t.assertFunction = assertFunction;
+ t.assertFunctionDeclaration = assertFunctionDeclaration;
+ t.assertFunctionExpression = assertFunctionExpression;
+ t.assertFunctionParent = assertFunctionParent;
+ t.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation;
+ t.assertFunctionTypeParam = assertFunctionTypeParam;
+ t.assertGenericTypeAnnotation = assertGenericTypeAnnotation;
+ t.assertIdentifier = assertIdentifier;
+ t.assertIfStatement = assertIfStatement;
+ t.assertImmutable = assertImmutable;
+ t.assertImport = assertImport;
+ t.assertImportAttribute = assertImportAttribute;
+ t.assertImportDeclaration = assertImportDeclaration;
+ t.assertImportDefaultSpecifier = assertImportDefaultSpecifier;
+ t.assertImportExpression = assertImportExpression;
+ t.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier;
+ t.assertImportOrExportDeclaration = assertImportOrExportDeclaration;
+ t.assertImportSpecifier = assertImportSpecifier;
+ t.assertIndexedAccessType = assertIndexedAccessType;
+ t.assertInferredPredicate = assertInferredPredicate;
+ t.assertInterfaceDeclaration = assertInterfaceDeclaration;
+ t.assertInterfaceExtends = assertInterfaceExtends;
+ t.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation;
+ t.assertInterpreterDirective = assertInterpreterDirective;
+ t.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation;
+ t.assertJSX = assertJSX;
+ t.assertJSXAttribute = assertJSXAttribute;
+ t.assertJSXClosingElement = assertJSXClosingElement;
+ t.assertJSXClosingFragment = assertJSXClosingFragment;
+ t.assertJSXElement = assertJSXElement;
+ t.assertJSXEmptyExpression = assertJSXEmptyExpression;
+ t.assertJSXExpressionContainer = assertJSXExpressionContainer;
+ t.assertJSXFragment = assertJSXFragment;
+ t.assertJSXIdentifier = assertJSXIdentifier;
+ t.assertJSXMemberExpression = assertJSXMemberExpression;
+ t.assertJSXNamespacedName = assertJSXNamespacedName;
+ t.assertJSXOpeningElement = assertJSXOpeningElement;
+ t.assertJSXOpeningFragment = assertJSXOpeningFragment;
+ t.assertJSXSpreadAttribute = assertJSXSpreadAttribute;
+ t.assertJSXSpreadChild = assertJSXSpreadChild;
+ t.assertJSXText = assertJSXText;
+ t.assertLVal = assertLVal;
+ t.assertLabeledStatement = assertLabeledStatement;
+ t.assertLiteral = assertLiteral;
+ t.assertLogicalExpression = assertLogicalExpression;
+ t.assertLoop = assertLoop;
+ t.assertMemberExpression = assertMemberExpression;
+ t.assertMetaProperty = assertMetaProperty;
+ t.assertMethod = assertMethod;
+ t.assertMiscellaneous = assertMiscellaneous;
+ t.assertMixedTypeAnnotation = assertMixedTypeAnnotation;
+ t.assertModuleDeclaration = assertModuleDeclaration;
+ t.assertModuleExpression = assertModuleExpression;
+ t.assertModuleSpecifier = assertModuleSpecifier;
+ t.assertNewExpression = assertNewExpression;
+ t.assertNoop = assertNoop;
+ t.assertNullLiteral = assertNullLiteral;
+ t.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation;
+ t.assertNullableTypeAnnotation = assertNullableTypeAnnotation;
+ t.assertNumberLiteral = assertNumberLiteral;
+ t.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation;
+ t.assertNumberTypeAnnotation = assertNumberTypeAnnotation;
+ t.assertNumericLiteral = assertNumericLiteral;
+ t.assertObjectExpression = assertObjectExpression;
+ t.assertObjectMember = assertObjectMember;
+ t.assertObjectMethod = assertObjectMethod;
+ t.assertObjectPattern = assertObjectPattern;
+ t.assertObjectProperty = assertObjectProperty;
+ t.assertObjectTypeAnnotation = assertObjectTypeAnnotation;
+ t.assertObjectTypeCallProperty = assertObjectTypeCallProperty;
+ t.assertObjectTypeIndexer = assertObjectTypeIndexer;
+ t.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot;
+ t.assertObjectTypeProperty = assertObjectTypeProperty;
+ t.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty;
+ t.assertOpaqueType = assertOpaqueType;
+ t.assertOptionalCallExpression = assertOptionalCallExpression;
+ t.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType;
+ t.assertOptionalMemberExpression = assertOptionalMemberExpression;
+ t.assertParenthesizedExpression = assertParenthesizedExpression;
+ t.assertPattern = assertPattern;
+ t.assertPatternLike = assertPatternLike;
+ t.assertPipelineBareFunction = assertPipelineBareFunction;
+ t.assertPipelinePrimaryTopicReference =
+ assertPipelinePrimaryTopicReference;
+ t.assertPipelineTopicExpression = assertPipelineTopicExpression;
+ t.assertPlaceholder = assertPlaceholder;
+ t.assertPrivate = assertPrivate;
+ t.assertPrivateName = assertPrivateName;
+ t.assertProgram = assertProgram;
+ t.assertProperty = assertProperty;
+ t.assertPureish = assertPureish;
+ t.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier;
+ t.assertRecordExpression = assertRecordExpression;
+ t.assertRegExpLiteral = assertRegExpLiteral;
+ t.assertRegexLiteral = assertRegexLiteral;
+ t.assertRestElement = assertRestElement;
+ t.assertRestProperty = assertRestProperty;
+ t.assertReturnStatement = assertReturnStatement;
+ t.assertScopable = assertScopable;
+ t.assertSequenceExpression = assertSequenceExpression;
+ t.assertSpreadElement = assertSpreadElement;
+ t.assertSpreadProperty = assertSpreadProperty;
+ t.assertStandardized = assertStandardized;
+ t.assertStatement = assertStatement;
+ t.assertStaticBlock = assertStaticBlock;
+ t.assertStringLiteral = assertStringLiteral;
+ t.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation;
+ t.assertStringTypeAnnotation = assertStringTypeAnnotation;
+ t.assertSuper = assertSuper;
+ t.assertSwitchCase = assertSwitchCase;
+ t.assertSwitchStatement = assertSwitchStatement;
+ t.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;
+ t.assertTSAnyKeyword = assertTSAnyKeyword;
+ t.assertTSArrayType = assertTSArrayType;
+ t.assertTSAsExpression = assertTSAsExpression;
+ t.assertTSBaseType = assertTSBaseType;
+ t.assertTSBigIntKeyword = assertTSBigIntKeyword;
+ t.assertTSBooleanKeyword = assertTSBooleanKeyword;
+ t.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration;
+ t.assertTSConditionalType = assertTSConditionalType;
+ t.assertTSConstructSignatureDeclaration =
+ assertTSConstructSignatureDeclaration;
+ t.assertTSConstructorType = assertTSConstructorType;
+ t.assertTSDeclareFunction = assertTSDeclareFunction;
+ t.assertTSDeclareMethod = assertTSDeclareMethod;
+ t.assertTSEntityName = assertTSEntityName;
+ t.assertTSEnumDeclaration = assertTSEnumDeclaration;
+ t.assertTSEnumMember = assertTSEnumMember;
+ t.assertTSExportAssignment = assertTSExportAssignment;
+ t.assertTSExpressionWithTypeArguments =
+ assertTSExpressionWithTypeArguments;
+ t.assertTSExternalModuleReference = assertTSExternalModuleReference;
+ t.assertTSFunctionType = assertTSFunctionType;
+ t.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration;
+ t.assertTSImportType = assertTSImportType;
+ t.assertTSIndexSignature = assertTSIndexSignature;
+ t.assertTSIndexedAccessType = assertTSIndexedAccessType;
+ t.assertTSInferType = assertTSInferType;
+ t.assertTSInstantiationExpression = assertTSInstantiationExpression;
+ t.assertTSInterfaceBody = assertTSInterfaceBody;
+ t.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration;
+ t.assertTSIntersectionType = assertTSIntersectionType;
+ t.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword;
+ t.assertTSLiteralType = assertTSLiteralType;
+ t.assertTSMappedType = assertTSMappedType;
+ t.assertTSMethodSignature = assertTSMethodSignature;
+ t.assertTSModuleBlock = assertTSModuleBlock;
+ t.assertTSModuleDeclaration = assertTSModuleDeclaration;
+ t.assertTSNamedTupleMember = assertTSNamedTupleMember;
+ t.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration;
+ t.assertTSNeverKeyword = assertTSNeverKeyword;
+ t.assertTSNonNullExpression = assertTSNonNullExpression;
+ t.assertTSNullKeyword = assertTSNullKeyword;
+ t.assertTSNumberKeyword = assertTSNumberKeyword;
+ t.assertTSObjectKeyword = assertTSObjectKeyword;
+ t.assertTSOptionalType = assertTSOptionalType;
+ t.assertTSParameterProperty = assertTSParameterProperty;
+ t.assertTSParenthesizedType = assertTSParenthesizedType;
+ t.assertTSPropertySignature = assertTSPropertySignature;
+ t.assertTSQualifiedName = assertTSQualifiedName;
+ t.assertTSRestType = assertTSRestType;
+ t.assertTSSatisfiesExpression = assertTSSatisfiesExpression;
+ t.assertTSStringKeyword = assertTSStringKeyword;
+ t.assertTSSymbolKeyword = assertTSSymbolKeyword;
+ t.assertTSThisType = assertTSThisType;
+ t.assertTSTupleType = assertTSTupleType;
+ t.assertTSType = assertTSType;
+ t.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration;
+ t.assertTSTypeAnnotation = assertTSTypeAnnotation;
+ t.assertTSTypeAssertion = assertTSTypeAssertion;
+ t.assertTSTypeElement = assertTSTypeElement;
+ t.assertTSTypeLiteral = assertTSTypeLiteral;
+ t.assertTSTypeOperator = assertTSTypeOperator;
+ t.assertTSTypeParameter = assertTSTypeParameter;
+ t.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration;
+ t.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation;
+ t.assertTSTypePredicate = assertTSTypePredicate;
+ t.assertTSTypeQuery = assertTSTypeQuery;
+ t.assertTSTypeReference = assertTSTypeReference;
+ t.assertTSUndefinedKeyword = assertTSUndefinedKeyword;
+ t.assertTSUnionType = assertTSUnionType;
+ t.assertTSUnknownKeyword = assertTSUnknownKeyword;
+ t.assertTSVoidKeyword = assertTSVoidKeyword;
+ t.assertTaggedTemplateExpression = assertTaggedTemplateExpression;
+ t.assertTemplateElement = assertTemplateElement;
+ t.assertTemplateLiteral = assertTemplateLiteral;
+ t.assertTerminatorless = assertTerminatorless;
+ t.assertThisExpression = assertThisExpression;
+ t.assertThisTypeAnnotation = assertThisTypeAnnotation;
+ t.assertThrowStatement = assertThrowStatement;
+ t.assertTopicReference = assertTopicReference;
+ t.assertTryStatement = assertTryStatement;
+ t.assertTupleExpression = assertTupleExpression;
+ t.assertTupleTypeAnnotation = assertTupleTypeAnnotation;
+ t.assertTypeAlias = assertTypeAlias;
+ t.assertTypeAnnotation = assertTypeAnnotation;
+ t.assertTypeCastExpression = assertTypeCastExpression;
+ t.assertTypeParameter = assertTypeParameter;
+ t.assertTypeParameterDeclaration = assertTypeParameterDeclaration;
+ t.assertTypeParameterInstantiation = assertTypeParameterInstantiation;
+ t.assertTypeScript = assertTypeScript;
+ t.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation;
+ t.assertUnaryExpression = assertUnaryExpression;
+ t.assertUnaryLike = assertUnaryLike;
+ t.assertUnionTypeAnnotation = assertUnionTypeAnnotation;
+ t.assertUpdateExpression = assertUpdateExpression;
+ t.assertUserWhitespacable = assertUserWhitespacable;
+ t.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;
+ t.assertVariableDeclaration = assertVariableDeclaration;
+ t.assertVariableDeclarator = assertVariableDeclarator;
+ t.assertVariance = assertVariance;
+ t.assertVoidTypeAnnotation = assertVoidTypeAnnotation;
+ t.assertWhile = assertWhile;
+ t.assertWhileStatement = assertWhileStatement;
+ t.assertWithStatement = assertWithStatement;
+ t.assertYieldExpression = assertYieldExpression;
+ var s = r(3685);
+ var i = r(8418);
+ function assert(e, t, r) {
+ if (!(0, s.default)(e, t, r)) {
+ throw new Error(
+ `Expected type "${e}" with option ${JSON.stringify(r)}, ` +
+ `but instead got "${t.type}".`,
+ );
+ }
+ }
+ function assertArrayExpression(e, t) {
+ assert('ArrayExpression', e, t);
+ }
+ function assertAssignmentExpression(e, t) {
+ assert('AssignmentExpression', e, t);
+ }
+ function assertBinaryExpression(e, t) {
+ assert('BinaryExpression', e, t);
+ }
+ function assertInterpreterDirective(e, t) {
+ assert('InterpreterDirective', e, t);
+ }
+ function assertDirective(e, t) {
+ assert('Directive', e, t);
+ }
+ function assertDirectiveLiteral(e, t) {
+ assert('DirectiveLiteral', e, t);
+ }
+ function assertBlockStatement(e, t) {
+ assert('BlockStatement', e, t);
+ }
+ function assertBreakStatement(e, t) {
+ assert('BreakStatement', e, t);
+ }
+ function assertCallExpression(e, t) {
+ assert('CallExpression', e, t);
+ }
+ function assertCatchClause(e, t) {
+ assert('CatchClause', e, t);
+ }
+ function assertConditionalExpression(e, t) {
+ assert('ConditionalExpression', e, t);
+ }
+ function assertContinueStatement(e, t) {
+ assert('ContinueStatement', e, t);
+ }
+ function assertDebuggerStatement(e, t) {
+ assert('DebuggerStatement', e, t);
+ }
+ function assertDoWhileStatement(e, t) {
+ assert('DoWhileStatement', e, t);
+ }
+ function assertEmptyStatement(e, t) {
+ assert('EmptyStatement', e, t);
+ }
+ function assertExpressionStatement(e, t) {
+ assert('ExpressionStatement', e, t);
+ }
+ function assertFile(e, t) {
+ assert('File', e, t);
+ }
+ function assertForInStatement(e, t) {
+ assert('ForInStatement', e, t);
+ }
+ function assertForStatement(e, t) {
+ assert('ForStatement', e, t);
+ }
+ function assertFunctionDeclaration(e, t) {
+ assert('FunctionDeclaration', e, t);
+ }
+ function assertFunctionExpression(e, t) {
+ assert('FunctionExpression', e, t);
+ }
+ function assertIdentifier(e, t) {
+ assert('Identifier', e, t);
+ }
+ function assertIfStatement(e, t) {
+ assert('IfStatement', e, t);
+ }
+ function assertLabeledStatement(e, t) {
+ assert('LabeledStatement', e, t);
+ }
+ function assertStringLiteral(e, t) {
+ assert('StringLiteral', e, t);
+ }
+ function assertNumericLiteral(e, t) {
+ assert('NumericLiteral', e, t);
+ }
+ function assertNullLiteral(e, t) {
+ assert('NullLiteral', e, t);
+ }
+ function assertBooleanLiteral(e, t) {
+ assert('BooleanLiteral', e, t);
+ }
+ function assertRegExpLiteral(e, t) {
+ assert('RegExpLiteral', e, t);
+ }
+ function assertLogicalExpression(e, t) {
+ assert('LogicalExpression', e, t);
+ }
+ function assertMemberExpression(e, t) {
+ assert('MemberExpression', e, t);
+ }
+ function assertNewExpression(e, t) {
+ assert('NewExpression', e, t);
+ }
+ function assertProgram(e, t) {
+ assert('Program', e, t);
+ }
+ function assertObjectExpression(e, t) {
+ assert('ObjectExpression', e, t);
+ }
+ function assertObjectMethod(e, t) {
+ assert('ObjectMethod', e, t);
+ }
+ function assertObjectProperty(e, t) {
+ assert('ObjectProperty', e, t);
+ }
+ function assertRestElement(e, t) {
+ assert('RestElement', e, t);
+ }
+ function assertReturnStatement(e, t) {
+ assert('ReturnStatement', e, t);
+ }
+ function assertSequenceExpression(e, t) {
+ assert('SequenceExpression', e, t);
+ }
+ function assertParenthesizedExpression(e, t) {
+ assert('ParenthesizedExpression', e, t);
+ }
+ function assertSwitchCase(e, t) {
+ assert('SwitchCase', e, t);
+ }
+ function assertSwitchStatement(e, t) {
+ assert('SwitchStatement', e, t);
+ }
+ function assertThisExpression(e, t) {
+ assert('ThisExpression', e, t);
+ }
+ function assertThrowStatement(e, t) {
+ assert('ThrowStatement', e, t);
+ }
+ function assertTryStatement(e, t) {
+ assert('TryStatement', e, t);
+ }
+ function assertUnaryExpression(e, t) {
+ assert('UnaryExpression', e, t);
+ }
+ function assertUpdateExpression(e, t) {
+ assert('UpdateExpression', e, t);
+ }
+ function assertVariableDeclaration(e, t) {
+ assert('VariableDeclaration', e, t);
+ }
+ function assertVariableDeclarator(e, t) {
+ assert('VariableDeclarator', e, t);
+ }
+ function assertWhileStatement(e, t) {
+ assert('WhileStatement', e, t);
+ }
+ function assertWithStatement(e, t) {
+ assert('WithStatement', e, t);
+ }
+ function assertAssignmentPattern(e, t) {
+ assert('AssignmentPattern', e, t);
+ }
+ function assertArrayPattern(e, t) {
+ assert('ArrayPattern', e, t);
+ }
+ function assertArrowFunctionExpression(e, t) {
+ assert('ArrowFunctionExpression', e, t);
+ }
+ function assertClassBody(e, t) {
+ assert('ClassBody', e, t);
+ }
+ function assertClassExpression(e, t) {
+ assert('ClassExpression', e, t);
+ }
+ function assertClassDeclaration(e, t) {
+ assert('ClassDeclaration', e, t);
+ }
+ function assertExportAllDeclaration(e, t) {
+ assert('ExportAllDeclaration', e, t);
+ }
+ function assertExportDefaultDeclaration(e, t) {
+ assert('ExportDefaultDeclaration', e, t);
+ }
+ function assertExportNamedDeclaration(e, t) {
+ assert('ExportNamedDeclaration', e, t);
+ }
+ function assertExportSpecifier(e, t) {
+ assert('ExportSpecifier', e, t);
+ }
+ function assertForOfStatement(e, t) {
+ assert('ForOfStatement', e, t);
+ }
+ function assertImportDeclaration(e, t) {
+ assert('ImportDeclaration', e, t);
+ }
+ function assertImportDefaultSpecifier(e, t) {
+ assert('ImportDefaultSpecifier', e, t);
+ }
+ function assertImportNamespaceSpecifier(e, t) {
+ assert('ImportNamespaceSpecifier', e, t);
+ }
+ function assertImportSpecifier(e, t) {
+ assert('ImportSpecifier', e, t);
+ }
+ function assertImportExpression(e, t) {
+ assert('ImportExpression', e, t);
+ }
+ function assertMetaProperty(e, t) {
+ assert('MetaProperty', e, t);
+ }
+ function assertClassMethod(e, t) {
+ assert('ClassMethod', e, t);
+ }
+ function assertObjectPattern(e, t) {
+ assert('ObjectPattern', e, t);
+ }
+ function assertSpreadElement(e, t) {
+ assert('SpreadElement', e, t);
+ }
+ function assertSuper(e, t) {
+ assert('Super', e, t);
+ }
+ function assertTaggedTemplateExpression(e, t) {
+ assert('TaggedTemplateExpression', e, t);
+ }
+ function assertTemplateElement(e, t) {
+ assert('TemplateElement', e, t);
+ }
+ function assertTemplateLiteral(e, t) {
+ assert('TemplateLiteral', e, t);
+ }
+ function assertYieldExpression(e, t) {
+ assert('YieldExpression', e, t);
+ }
+ function assertAwaitExpression(e, t) {
+ assert('AwaitExpression', e, t);
+ }
+ function assertImport(e, t) {
+ assert('Import', e, t);
+ }
+ function assertBigIntLiteral(e, t) {
+ assert('BigIntLiteral', e, t);
+ }
+ function assertExportNamespaceSpecifier(e, t) {
+ assert('ExportNamespaceSpecifier', e, t);
+ }
+ function assertOptionalMemberExpression(e, t) {
+ assert('OptionalMemberExpression', e, t);
+ }
+ function assertOptionalCallExpression(e, t) {
+ assert('OptionalCallExpression', e, t);
+ }
+ function assertClassProperty(e, t) {
+ assert('ClassProperty', e, t);
+ }
+ function assertClassAccessorProperty(e, t) {
+ assert('ClassAccessorProperty', e, t);
+ }
+ function assertClassPrivateProperty(e, t) {
+ assert('ClassPrivateProperty', e, t);
+ }
+ function assertClassPrivateMethod(e, t) {
+ assert('ClassPrivateMethod', e, t);
+ }
+ function assertPrivateName(e, t) {
+ assert('PrivateName', e, t);
+ }
+ function assertStaticBlock(e, t) {
+ assert('StaticBlock', e, t);
+ }
+ function assertAnyTypeAnnotation(e, t) {
+ assert('AnyTypeAnnotation', e, t);
+ }
+ function assertArrayTypeAnnotation(e, t) {
+ assert('ArrayTypeAnnotation', e, t);
+ }
+ function assertBooleanTypeAnnotation(e, t) {
+ assert('BooleanTypeAnnotation', e, t);
+ }
+ function assertBooleanLiteralTypeAnnotation(e, t) {
+ assert('BooleanLiteralTypeAnnotation', e, t);
+ }
+ function assertNullLiteralTypeAnnotation(e, t) {
+ assert('NullLiteralTypeAnnotation', e, t);
+ }
+ function assertClassImplements(e, t) {
+ assert('ClassImplements', e, t);
+ }
+ function assertDeclareClass(e, t) {
+ assert('DeclareClass', e, t);
+ }
+ function assertDeclareFunction(e, t) {
+ assert('DeclareFunction', e, t);
+ }
+ function assertDeclareInterface(e, t) {
+ assert('DeclareInterface', e, t);
+ }
+ function assertDeclareModule(e, t) {
+ assert('DeclareModule', e, t);
+ }
+ function assertDeclareModuleExports(e, t) {
+ assert('DeclareModuleExports', e, t);
+ }
+ function assertDeclareTypeAlias(e, t) {
+ assert('DeclareTypeAlias', e, t);
+ }
+ function assertDeclareOpaqueType(e, t) {
+ assert('DeclareOpaqueType', e, t);
+ }
+ function assertDeclareVariable(e, t) {
+ assert('DeclareVariable', e, t);
+ }
+ function assertDeclareExportDeclaration(e, t) {
+ assert('DeclareExportDeclaration', e, t);
+ }
+ function assertDeclareExportAllDeclaration(e, t) {
+ assert('DeclareExportAllDeclaration', e, t);
+ }
+ function assertDeclaredPredicate(e, t) {
+ assert('DeclaredPredicate', e, t);
+ }
+ function assertExistsTypeAnnotation(e, t) {
+ assert('ExistsTypeAnnotation', e, t);
+ }
+ function assertFunctionTypeAnnotation(e, t) {
+ assert('FunctionTypeAnnotation', e, t);
+ }
+ function assertFunctionTypeParam(e, t) {
+ assert('FunctionTypeParam', e, t);
+ }
+ function assertGenericTypeAnnotation(e, t) {
+ assert('GenericTypeAnnotation', e, t);
+ }
+ function assertInferredPredicate(e, t) {
+ assert('InferredPredicate', e, t);
+ }
+ function assertInterfaceExtends(e, t) {
+ assert('InterfaceExtends', e, t);
+ }
+ function assertInterfaceDeclaration(e, t) {
+ assert('InterfaceDeclaration', e, t);
+ }
+ function assertInterfaceTypeAnnotation(e, t) {
+ assert('InterfaceTypeAnnotation', e, t);
+ }
+ function assertIntersectionTypeAnnotation(e, t) {
+ assert('IntersectionTypeAnnotation', e, t);
+ }
+ function assertMixedTypeAnnotation(e, t) {
+ assert('MixedTypeAnnotation', e, t);
+ }
+ function assertEmptyTypeAnnotation(e, t) {
+ assert('EmptyTypeAnnotation', e, t);
+ }
+ function assertNullableTypeAnnotation(e, t) {
+ assert('NullableTypeAnnotation', e, t);
+ }
+ function assertNumberLiteralTypeAnnotation(e, t) {
+ assert('NumberLiteralTypeAnnotation', e, t);
+ }
+ function assertNumberTypeAnnotation(e, t) {
+ assert('NumberTypeAnnotation', e, t);
+ }
+ function assertObjectTypeAnnotation(e, t) {
+ assert('ObjectTypeAnnotation', e, t);
+ }
+ function assertObjectTypeInternalSlot(e, t) {
+ assert('ObjectTypeInternalSlot', e, t);
+ }
+ function assertObjectTypeCallProperty(e, t) {
+ assert('ObjectTypeCallProperty', e, t);
+ }
+ function assertObjectTypeIndexer(e, t) {
+ assert('ObjectTypeIndexer', e, t);
+ }
+ function assertObjectTypeProperty(e, t) {
+ assert('ObjectTypeProperty', e, t);
+ }
+ function assertObjectTypeSpreadProperty(e, t) {
+ assert('ObjectTypeSpreadProperty', e, t);
+ }
+ function assertOpaqueType(e, t) {
+ assert('OpaqueType', e, t);
+ }
+ function assertQualifiedTypeIdentifier(e, t) {
+ assert('QualifiedTypeIdentifier', e, t);
+ }
+ function assertStringLiteralTypeAnnotation(e, t) {
+ assert('StringLiteralTypeAnnotation', e, t);
+ }
+ function assertStringTypeAnnotation(e, t) {
+ assert('StringTypeAnnotation', e, t);
+ }
+ function assertSymbolTypeAnnotation(e, t) {
+ assert('SymbolTypeAnnotation', e, t);
+ }
+ function assertThisTypeAnnotation(e, t) {
+ assert('ThisTypeAnnotation', e, t);
+ }
+ function assertTupleTypeAnnotation(e, t) {
+ assert('TupleTypeAnnotation', e, t);
+ }
+ function assertTypeofTypeAnnotation(e, t) {
+ assert('TypeofTypeAnnotation', e, t);
+ }
+ function assertTypeAlias(e, t) {
+ assert('TypeAlias', e, t);
+ }
+ function assertTypeAnnotation(e, t) {
+ assert('TypeAnnotation', e, t);
+ }
+ function assertTypeCastExpression(e, t) {
+ assert('TypeCastExpression', e, t);
+ }
+ function assertTypeParameter(e, t) {
+ assert('TypeParameter', e, t);
+ }
+ function assertTypeParameterDeclaration(e, t) {
+ assert('TypeParameterDeclaration', e, t);
+ }
+ function assertTypeParameterInstantiation(e, t) {
+ assert('TypeParameterInstantiation', e, t);
+ }
+ function assertUnionTypeAnnotation(e, t) {
+ assert('UnionTypeAnnotation', e, t);
+ }
+ function assertVariance(e, t) {
+ assert('Variance', e, t);
+ }
+ function assertVoidTypeAnnotation(e, t) {
+ assert('VoidTypeAnnotation', e, t);
+ }
+ function assertEnumDeclaration(e, t) {
+ assert('EnumDeclaration', e, t);
+ }
+ function assertEnumBooleanBody(e, t) {
+ assert('EnumBooleanBody', e, t);
+ }
+ function assertEnumNumberBody(e, t) {
+ assert('EnumNumberBody', e, t);
+ }
+ function assertEnumStringBody(e, t) {
+ assert('EnumStringBody', e, t);
+ }
+ function assertEnumSymbolBody(e, t) {
+ assert('EnumSymbolBody', e, t);
+ }
+ function assertEnumBooleanMember(e, t) {
+ assert('EnumBooleanMember', e, t);
+ }
+ function assertEnumNumberMember(e, t) {
+ assert('EnumNumberMember', e, t);
+ }
+ function assertEnumStringMember(e, t) {
+ assert('EnumStringMember', e, t);
+ }
+ function assertEnumDefaultedMember(e, t) {
+ assert('EnumDefaultedMember', e, t);
+ }
+ function assertIndexedAccessType(e, t) {
+ assert('IndexedAccessType', e, t);
+ }
+ function assertOptionalIndexedAccessType(e, t) {
+ assert('OptionalIndexedAccessType', e, t);
+ }
+ function assertJSXAttribute(e, t) {
+ assert('JSXAttribute', e, t);
+ }
+ function assertJSXClosingElement(e, t) {
+ assert('JSXClosingElement', e, t);
+ }
+ function assertJSXElement(e, t) {
+ assert('JSXElement', e, t);
+ }
+ function assertJSXEmptyExpression(e, t) {
+ assert('JSXEmptyExpression', e, t);
+ }
+ function assertJSXExpressionContainer(e, t) {
+ assert('JSXExpressionContainer', e, t);
+ }
+ function assertJSXSpreadChild(e, t) {
+ assert('JSXSpreadChild', e, t);
+ }
+ function assertJSXIdentifier(e, t) {
+ assert('JSXIdentifier', e, t);
+ }
+ function assertJSXMemberExpression(e, t) {
+ assert('JSXMemberExpression', e, t);
+ }
+ function assertJSXNamespacedName(e, t) {
+ assert('JSXNamespacedName', e, t);
+ }
+ function assertJSXOpeningElement(e, t) {
+ assert('JSXOpeningElement', e, t);
+ }
+ function assertJSXSpreadAttribute(e, t) {
+ assert('JSXSpreadAttribute', e, t);
+ }
+ function assertJSXText(e, t) {
+ assert('JSXText', e, t);
+ }
+ function assertJSXFragment(e, t) {
+ assert('JSXFragment', e, t);
+ }
+ function assertJSXOpeningFragment(e, t) {
+ assert('JSXOpeningFragment', e, t);
+ }
+ function assertJSXClosingFragment(e, t) {
+ assert('JSXClosingFragment', e, t);
+ }
+ function assertNoop(e, t) {
+ assert('Noop', e, t);
+ }
+ function assertPlaceholder(e, t) {
+ assert('Placeholder', e, t);
+ }
+ function assertV8IntrinsicIdentifier(e, t) {
+ assert('V8IntrinsicIdentifier', e, t);
+ }
+ function assertArgumentPlaceholder(e, t) {
+ assert('ArgumentPlaceholder', e, t);
+ }
+ function assertBindExpression(e, t) {
+ assert('BindExpression', e, t);
+ }
+ function assertImportAttribute(e, t) {
+ assert('ImportAttribute', e, t);
+ }
+ function assertDecorator(e, t) {
+ assert('Decorator', e, t);
+ }
+ function assertDoExpression(e, t) {
+ assert('DoExpression', e, t);
+ }
+ function assertExportDefaultSpecifier(e, t) {
+ assert('ExportDefaultSpecifier', e, t);
+ }
+ function assertRecordExpression(e, t) {
+ assert('RecordExpression', e, t);
+ }
+ function assertTupleExpression(e, t) {
+ assert('TupleExpression', e, t);
+ }
+ function assertDecimalLiteral(e, t) {
+ assert('DecimalLiteral', e, t);
+ }
+ function assertModuleExpression(e, t) {
+ assert('ModuleExpression', e, t);
+ }
+ function assertTopicReference(e, t) {
+ assert('TopicReference', e, t);
+ }
+ function assertPipelineTopicExpression(e, t) {
+ assert('PipelineTopicExpression', e, t);
+ }
+ function assertPipelineBareFunction(e, t) {
+ assert('PipelineBareFunction', e, t);
+ }
+ function assertPipelinePrimaryTopicReference(e, t) {
+ assert('PipelinePrimaryTopicReference', e, t);
+ }
+ function assertTSParameterProperty(e, t) {
+ assert('TSParameterProperty', e, t);
+ }
+ function assertTSDeclareFunction(e, t) {
+ assert('TSDeclareFunction', e, t);
+ }
+ function assertTSDeclareMethod(e, t) {
+ assert('TSDeclareMethod', e, t);
+ }
+ function assertTSQualifiedName(e, t) {
+ assert('TSQualifiedName', e, t);
+ }
+ function assertTSCallSignatureDeclaration(e, t) {
+ assert('TSCallSignatureDeclaration', e, t);
+ }
+ function assertTSConstructSignatureDeclaration(e, t) {
+ assert('TSConstructSignatureDeclaration', e, t);
+ }
+ function assertTSPropertySignature(e, t) {
+ assert('TSPropertySignature', e, t);
+ }
+ function assertTSMethodSignature(e, t) {
+ assert('TSMethodSignature', e, t);
+ }
+ function assertTSIndexSignature(e, t) {
+ assert('TSIndexSignature', e, t);
+ }
+ function assertTSAnyKeyword(e, t) {
+ assert('TSAnyKeyword', e, t);
+ }
+ function assertTSBooleanKeyword(e, t) {
+ assert('TSBooleanKeyword', e, t);
+ }
+ function assertTSBigIntKeyword(e, t) {
+ assert('TSBigIntKeyword', e, t);
+ }
+ function assertTSIntrinsicKeyword(e, t) {
+ assert('TSIntrinsicKeyword', e, t);
+ }
+ function assertTSNeverKeyword(e, t) {
+ assert('TSNeverKeyword', e, t);
+ }
+ function assertTSNullKeyword(e, t) {
+ assert('TSNullKeyword', e, t);
+ }
+ function assertTSNumberKeyword(e, t) {
+ assert('TSNumberKeyword', e, t);
+ }
+ function assertTSObjectKeyword(e, t) {
+ assert('TSObjectKeyword', e, t);
+ }
+ function assertTSStringKeyword(e, t) {
+ assert('TSStringKeyword', e, t);
+ }
+ function assertTSSymbolKeyword(e, t) {
+ assert('TSSymbolKeyword', e, t);
+ }
+ function assertTSUndefinedKeyword(e, t) {
+ assert('TSUndefinedKeyword', e, t);
+ }
+ function assertTSUnknownKeyword(e, t) {
+ assert('TSUnknownKeyword', e, t);
+ }
+ function assertTSVoidKeyword(e, t) {
+ assert('TSVoidKeyword', e, t);
+ }
+ function assertTSThisType(e, t) {
+ assert('TSThisType', e, t);
+ }
+ function assertTSFunctionType(e, t) {
+ assert('TSFunctionType', e, t);
+ }
+ function assertTSConstructorType(e, t) {
+ assert('TSConstructorType', e, t);
+ }
+ function assertTSTypeReference(e, t) {
+ assert('TSTypeReference', e, t);
+ }
+ function assertTSTypePredicate(e, t) {
+ assert('TSTypePredicate', e, t);
+ }
+ function assertTSTypeQuery(e, t) {
+ assert('TSTypeQuery', e, t);
+ }
+ function assertTSTypeLiteral(e, t) {
+ assert('TSTypeLiteral', e, t);
+ }
+ function assertTSArrayType(e, t) {
+ assert('TSArrayType', e, t);
+ }
+ function assertTSTupleType(e, t) {
+ assert('TSTupleType', e, t);
+ }
+ function assertTSOptionalType(e, t) {
+ assert('TSOptionalType', e, t);
+ }
+ function assertTSRestType(e, t) {
+ assert('TSRestType', e, t);
+ }
+ function assertTSNamedTupleMember(e, t) {
+ assert('TSNamedTupleMember', e, t);
+ }
+ function assertTSUnionType(e, t) {
+ assert('TSUnionType', e, t);
+ }
+ function assertTSIntersectionType(e, t) {
+ assert('TSIntersectionType', e, t);
+ }
+ function assertTSConditionalType(e, t) {
+ assert('TSConditionalType', e, t);
+ }
+ function assertTSInferType(e, t) {
+ assert('TSInferType', e, t);
+ }
+ function assertTSParenthesizedType(e, t) {
+ assert('TSParenthesizedType', e, t);
+ }
+ function assertTSTypeOperator(e, t) {
+ assert('TSTypeOperator', e, t);
+ }
+ function assertTSIndexedAccessType(e, t) {
+ assert('TSIndexedAccessType', e, t);
+ }
+ function assertTSMappedType(e, t) {
+ assert('TSMappedType', e, t);
+ }
+ function assertTSLiteralType(e, t) {
+ assert('TSLiteralType', e, t);
+ }
+ function assertTSExpressionWithTypeArguments(e, t) {
+ assert('TSExpressionWithTypeArguments', e, t);
+ }
+ function assertTSInterfaceDeclaration(e, t) {
+ assert('TSInterfaceDeclaration', e, t);
+ }
+ function assertTSInterfaceBody(e, t) {
+ assert('TSInterfaceBody', e, t);
+ }
+ function assertTSTypeAliasDeclaration(e, t) {
+ assert('TSTypeAliasDeclaration', e, t);
+ }
+ function assertTSInstantiationExpression(e, t) {
+ assert('TSInstantiationExpression', e, t);
+ }
+ function assertTSAsExpression(e, t) {
+ assert('TSAsExpression', e, t);
+ }
+ function assertTSSatisfiesExpression(e, t) {
+ assert('TSSatisfiesExpression', e, t);
+ }
+ function assertTSTypeAssertion(e, t) {
+ assert('TSTypeAssertion', e, t);
+ }
+ function assertTSEnumDeclaration(e, t) {
+ assert('TSEnumDeclaration', e, t);
+ }
+ function assertTSEnumMember(e, t) {
+ assert('TSEnumMember', e, t);
+ }
+ function assertTSModuleDeclaration(e, t) {
+ assert('TSModuleDeclaration', e, t);
+ }
+ function assertTSModuleBlock(e, t) {
+ assert('TSModuleBlock', e, t);
+ }
+ function assertTSImportType(e, t) {
+ assert('TSImportType', e, t);
+ }
+ function assertTSImportEqualsDeclaration(e, t) {
+ assert('TSImportEqualsDeclaration', e, t);
+ }
+ function assertTSExternalModuleReference(e, t) {
+ assert('TSExternalModuleReference', e, t);
+ }
+ function assertTSNonNullExpression(e, t) {
+ assert('TSNonNullExpression', e, t);
+ }
+ function assertTSExportAssignment(e, t) {
+ assert('TSExportAssignment', e, t);
+ }
+ function assertTSNamespaceExportDeclaration(e, t) {
+ assert('TSNamespaceExportDeclaration', e, t);
+ }
+ function assertTSTypeAnnotation(e, t) {
+ assert('TSTypeAnnotation', e, t);
+ }
+ function assertTSTypeParameterInstantiation(e, t) {
+ assert('TSTypeParameterInstantiation', e, t);
+ }
+ function assertTSTypeParameterDeclaration(e, t) {
+ assert('TSTypeParameterDeclaration', e, t);
+ }
+ function assertTSTypeParameter(e, t) {
+ assert('TSTypeParameter', e, t);
+ }
+ function assertStandardized(e, t) {
+ assert('Standardized', e, t);
+ }
+ function assertExpression(e, t) {
+ assert('Expression', e, t);
+ }
+ function assertBinary(e, t) {
+ assert('Binary', e, t);
+ }
+ function assertScopable(e, t) {
+ assert('Scopable', e, t);
+ }
+ function assertBlockParent(e, t) {
+ assert('BlockParent', e, t);
+ }
+ function assertBlock(e, t) {
+ assert('Block', e, t);
+ }
+ function assertStatement(e, t) {
+ assert('Statement', e, t);
+ }
+ function assertTerminatorless(e, t) {
+ assert('Terminatorless', e, t);
+ }
+ function assertCompletionStatement(e, t) {
+ assert('CompletionStatement', e, t);
+ }
+ function assertConditional(e, t) {
+ assert('Conditional', e, t);
+ }
+ function assertLoop(e, t) {
+ assert('Loop', e, t);
+ }
+ function assertWhile(e, t) {
+ assert('While', e, t);
+ }
+ function assertExpressionWrapper(e, t) {
+ assert('ExpressionWrapper', e, t);
+ }
+ function assertFor(e, t) {
+ assert('For', e, t);
+ }
+ function assertForXStatement(e, t) {
+ assert('ForXStatement', e, t);
+ }
+ function assertFunction(e, t) {
+ assert('Function', e, t);
+ }
+ function assertFunctionParent(e, t) {
+ assert('FunctionParent', e, t);
+ }
+ function assertPureish(e, t) {
+ assert('Pureish', e, t);
+ }
+ function assertDeclaration(e, t) {
+ assert('Declaration', e, t);
+ }
+ function assertPatternLike(e, t) {
+ assert('PatternLike', e, t);
+ }
+ function assertLVal(e, t) {
+ assert('LVal', e, t);
+ }
+ function assertTSEntityName(e, t) {
+ assert('TSEntityName', e, t);
+ }
+ function assertLiteral(e, t) {
+ assert('Literal', e, t);
+ }
+ function assertImmutable(e, t) {
+ assert('Immutable', e, t);
+ }
+ function assertUserWhitespacable(e, t) {
+ assert('UserWhitespacable', e, t);
+ }
+ function assertMethod(e, t) {
+ assert('Method', e, t);
+ }
+ function assertObjectMember(e, t) {
+ assert('ObjectMember', e, t);
+ }
+ function assertProperty(e, t) {
+ assert('Property', e, t);
+ }
+ function assertUnaryLike(e, t) {
+ assert('UnaryLike', e, t);
+ }
+ function assertPattern(e, t) {
+ assert('Pattern', e, t);
+ }
+ function assertClass(e, t) {
+ assert('Class', e, t);
+ }
+ function assertImportOrExportDeclaration(e, t) {
+ assert('ImportOrExportDeclaration', e, t);
+ }
+ function assertExportDeclaration(e, t) {
+ assert('ExportDeclaration', e, t);
+ }
+ function assertModuleSpecifier(e, t) {
+ assert('ModuleSpecifier', e, t);
+ }
+ function assertAccessor(e, t) {
+ assert('Accessor', e, t);
+ }
+ function assertPrivate(e, t) {
+ assert('Private', e, t);
+ }
+ function assertFlow(e, t) {
+ assert('Flow', e, t);
+ }
+ function assertFlowType(e, t) {
+ assert('FlowType', e, t);
+ }
+ function assertFlowBaseAnnotation(e, t) {
+ assert('FlowBaseAnnotation', e, t);
+ }
+ function assertFlowDeclaration(e, t) {
+ assert('FlowDeclaration', e, t);
+ }
+ function assertFlowPredicate(e, t) {
+ assert('FlowPredicate', e, t);
+ }
+ function assertEnumBody(e, t) {
+ assert('EnumBody', e, t);
+ }
+ function assertEnumMember(e, t) {
+ assert('EnumMember', e, t);
+ }
+ function assertJSX(e, t) {
+ assert('JSX', e, t);
+ }
+ function assertMiscellaneous(e, t) {
+ assert('Miscellaneous', e, t);
+ }
+ function assertTypeScript(e, t) {
+ assert('TypeScript', e, t);
+ }
+ function assertTSTypeElement(e, t) {
+ assert('TSTypeElement', e, t);
+ }
+ function assertTSType(e, t) {
+ assert('TSType', e, t);
+ }
+ function assertTSBaseType(e, t) {
+ assert('TSBaseType', e, t);
+ }
+ function assertNumberLiteral(e, t) {
+ (0, i.default)('assertNumberLiteral', 'assertNumericLiteral');
+ assert('NumberLiteral', e, t);
+ }
+ function assertRegexLiteral(e, t) {
+ (0, i.default)('assertRegexLiteral', 'assertRegExpLiteral');
+ assert('RegexLiteral', e, t);
+ }
+ function assertRestProperty(e, t) {
+ (0, i.default)('assertRestProperty', 'assertRestElement');
+ assert('RestProperty', e, t);
+ }
+ function assertSpreadProperty(e, t) {
+ (0, i.default)('assertSpreadProperty', 'assertSpreadElement');
+ assert('SpreadProperty', e, t);
+ }
+ function assertModuleDeclaration(e, t) {
+ (0, i.default)(
+ 'assertModuleDeclaration',
+ 'assertImportOrExportDeclaration',
+ );
+ assert('ModuleDeclaration', e, t);
+ }
+ },
+ 2814: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = createFlowUnionType;
+ var s = r(397);
+ var i = r(3864);
+ function createFlowUnionType(e) {
+ const t = (0, i.default)(e);
+ if (t.length === 1) {
+ return t[0];
+ } else {
+ return (0, s.unionTypeAnnotation)(t);
+ }
+ }
+ },
+ 8276: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = void 0;
+ var s = r(397);
+ var i = (t['default'] = createTypeAnnotationBasedOnTypeof);
+ function createTypeAnnotationBasedOnTypeof(e) {
+ switch (e) {
+ case 'string':
+ return (0, s.stringTypeAnnotation)();
+ case 'number':
+ return (0, s.numberTypeAnnotation)();
+ case 'undefined':
+ return (0, s.voidTypeAnnotation)();
+ case 'boolean':
+ return (0, s.booleanTypeAnnotation)();
+ case 'function':
+ return (0, s.genericTypeAnnotation)((0, s.identifier)('Function'));
+ case 'object':
+ return (0, s.genericTypeAnnotation)((0, s.identifier)('Object'));
+ case 'symbol':
+ return (0, s.genericTypeAnnotation)((0, s.identifier)('Symbol'));
+ case 'bigint':
+ return (0, s.anyTypeAnnotation)();
+ }
+ throw new Error('Invalid typeof value: ' + e);
+ }
+ },
+ 397: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.anyTypeAnnotation = anyTypeAnnotation;
+ t.argumentPlaceholder = argumentPlaceholder;
+ t.arrayExpression = arrayExpression;
+ t.arrayPattern = arrayPattern;
+ t.arrayTypeAnnotation = arrayTypeAnnotation;
+ t.arrowFunctionExpression = arrowFunctionExpression;
+ t.assignmentExpression = assignmentExpression;
+ t.assignmentPattern = assignmentPattern;
+ t.awaitExpression = awaitExpression;
+ t.bigIntLiteral = bigIntLiteral;
+ t.binaryExpression = binaryExpression;
+ t.bindExpression = bindExpression;
+ t.blockStatement = blockStatement;
+ t.booleanLiteral = booleanLiteral;
+ t.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation;
+ t.booleanTypeAnnotation = booleanTypeAnnotation;
+ t.breakStatement = breakStatement;
+ t.callExpression = callExpression;
+ t.catchClause = catchClause;
+ t.classAccessorProperty = classAccessorProperty;
+ t.classBody = classBody;
+ t.classDeclaration = classDeclaration;
+ t.classExpression = classExpression;
+ t.classImplements = classImplements;
+ t.classMethod = classMethod;
+ t.classPrivateMethod = classPrivateMethod;
+ t.classPrivateProperty = classPrivateProperty;
+ t.classProperty = classProperty;
+ t.conditionalExpression = conditionalExpression;
+ t.continueStatement = continueStatement;
+ t.debuggerStatement = debuggerStatement;
+ t.decimalLiteral = decimalLiteral;
+ t.declareClass = declareClass;
+ t.declareExportAllDeclaration = declareExportAllDeclaration;
+ t.declareExportDeclaration = declareExportDeclaration;
+ t.declareFunction = declareFunction;
+ t.declareInterface = declareInterface;
+ t.declareModule = declareModule;
+ t.declareModuleExports = declareModuleExports;
+ t.declareOpaqueType = declareOpaqueType;
+ t.declareTypeAlias = declareTypeAlias;
+ t.declareVariable = declareVariable;
+ t.declaredPredicate = declaredPredicate;
+ t.decorator = decorator;
+ t.directive = directive;
+ t.directiveLiteral = directiveLiteral;
+ t.doExpression = doExpression;
+ t.doWhileStatement = doWhileStatement;
+ t.emptyStatement = emptyStatement;
+ t.emptyTypeAnnotation = emptyTypeAnnotation;
+ t.enumBooleanBody = enumBooleanBody;
+ t.enumBooleanMember = enumBooleanMember;
+ t.enumDeclaration = enumDeclaration;
+ t.enumDefaultedMember = enumDefaultedMember;
+ t.enumNumberBody = enumNumberBody;
+ t.enumNumberMember = enumNumberMember;
+ t.enumStringBody = enumStringBody;
+ t.enumStringMember = enumStringMember;
+ t.enumSymbolBody = enumSymbolBody;
+ t.existsTypeAnnotation = existsTypeAnnotation;
+ t.exportAllDeclaration = exportAllDeclaration;
+ t.exportDefaultDeclaration = exportDefaultDeclaration;
+ t.exportDefaultSpecifier = exportDefaultSpecifier;
+ t.exportNamedDeclaration = exportNamedDeclaration;
+ t.exportNamespaceSpecifier = exportNamespaceSpecifier;
+ t.exportSpecifier = exportSpecifier;
+ t.expressionStatement = expressionStatement;
+ t.file = file;
+ t.forInStatement = forInStatement;
+ t.forOfStatement = forOfStatement;
+ t.forStatement = forStatement;
+ t.functionDeclaration = functionDeclaration;
+ t.functionExpression = functionExpression;
+ t.functionTypeAnnotation = functionTypeAnnotation;
+ t.functionTypeParam = functionTypeParam;
+ t.genericTypeAnnotation = genericTypeAnnotation;
+ t.identifier = identifier;
+ t.ifStatement = ifStatement;
+ t['import'] = _import;
+ t.importAttribute = importAttribute;
+ t.importDeclaration = importDeclaration;
+ t.importDefaultSpecifier = importDefaultSpecifier;
+ t.importExpression = importExpression;
+ t.importNamespaceSpecifier = importNamespaceSpecifier;
+ t.importSpecifier = importSpecifier;
+ t.indexedAccessType = indexedAccessType;
+ t.inferredPredicate = inferredPredicate;
+ t.interfaceDeclaration = interfaceDeclaration;
+ t.interfaceExtends = interfaceExtends;
+ t.interfaceTypeAnnotation = interfaceTypeAnnotation;
+ t.interpreterDirective = interpreterDirective;
+ t.intersectionTypeAnnotation = intersectionTypeAnnotation;
+ t.jSXAttribute = t.jsxAttribute = jsxAttribute;
+ t.jSXClosingElement = t.jsxClosingElement = jsxClosingElement;
+ t.jSXClosingFragment = t.jsxClosingFragment = jsxClosingFragment;
+ t.jSXElement = t.jsxElement = jsxElement;
+ t.jSXEmptyExpression = t.jsxEmptyExpression = jsxEmptyExpression;
+ t.jSXExpressionContainer = t.jsxExpressionContainer =
+ jsxExpressionContainer;
+ t.jSXFragment = t.jsxFragment = jsxFragment;
+ t.jSXIdentifier = t.jsxIdentifier = jsxIdentifier;
+ t.jSXMemberExpression = t.jsxMemberExpression = jsxMemberExpression;
+ t.jSXNamespacedName = t.jsxNamespacedName = jsxNamespacedName;
+ t.jSXOpeningElement = t.jsxOpeningElement = jsxOpeningElement;
+ t.jSXOpeningFragment = t.jsxOpeningFragment = jsxOpeningFragment;
+ t.jSXSpreadAttribute = t.jsxSpreadAttribute = jsxSpreadAttribute;
+ t.jSXSpreadChild = t.jsxSpreadChild = jsxSpreadChild;
+ t.jSXText = t.jsxText = jsxText;
+ t.labeledStatement = labeledStatement;
+ t.logicalExpression = logicalExpression;
+ t.memberExpression = memberExpression;
+ t.metaProperty = metaProperty;
+ t.mixedTypeAnnotation = mixedTypeAnnotation;
+ t.moduleExpression = moduleExpression;
+ t.newExpression = newExpression;
+ t.noop = noop;
+ t.nullLiteral = nullLiteral;
+ t.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation;
+ t.nullableTypeAnnotation = nullableTypeAnnotation;
+ t.numberLiteral = NumberLiteral;
+ t.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation;
+ t.numberTypeAnnotation = numberTypeAnnotation;
+ t.numericLiteral = numericLiteral;
+ t.objectExpression = objectExpression;
+ t.objectMethod = objectMethod;
+ t.objectPattern = objectPattern;
+ t.objectProperty = objectProperty;
+ t.objectTypeAnnotation = objectTypeAnnotation;
+ t.objectTypeCallProperty = objectTypeCallProperty;
+ t.objectTypeIndexer = objectTypeIndexer;
+ t.objectTypeInternalSlot = objectTypeInternalSlot;
+ t.objectTypeProperty = objectTypeProperty;
+ t.objectTypeSpreadProperty = objectTypeSpreadProperty;
+ t.opaqueType = opaqueType;
+ t.optionalCallExpression = optionalCallExpression;
+ t.optionalIndexedAccessType = optionalIndexedAccessType;
+ t.optionalMemberExpression = optionalMemberExpression;
+ t.parenthesizedExpression = parenthesizedExpression;
+ t.pipelineBareFunction = pipelineBareFunction;
+ t.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference;
+ t.pipelineTopicExpression = pipelineTopicExpression;
+ t.placeholder = placeholder;
+ t.privateName = privateName;
+ t.program = program;
+ t.qualifiedTypeIdentifier = qualifiedTypeIdentifier;
+ t.recordExpression = recordExpression;
+ t.regExpLiteral = regExpLiteral;
+ t.regexLiteral = RegexLiteral;
+ t.restElement = restElement;
+ t.restProperty = RestProperty;
+ t.returnStatement = returnStatement;
+ t.sequenceExpression = sequenceExpression;
+ t.spreadElement = spreadElement;
+ t.spreadProperty = SpreadProperty;
+ t.staticBlock = staticBlock;
+ t.stringLiteral = stringLiteral;
+ t.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation;
+ t.stringTypeAnnotation = stringTypeAnnotation;
+ t['super'] = _super;
+ t.switchCase = switchCase;
+ t.switchStatement = switchStatement;
+ t.symbolTypeAnnotation = symbolTypeAnnotation;
+ t.taggedTemplateExpression = taggedTemplateExpression;
+ t.templateElement = templateElement;
+ t.templateLiteral = templateLiteral;
+ t.thisExpression = thisExpression;
+ t.thisTypeAnnotation = thisTypeAnnotation;
+ t.throwStatement = throwStatement;
+ t.topicReference = topicReference;
+ t.tryStatement = tryStatement;
+ t.tSAnyKeyword = t.tsAnyKeyword = tsAnyKeyword;
+ t.tSArrayType = t.tsArrayType = tsArrayType;
+ t.tSAsExpression = t.tsAsExpression = tsAsExpression;
+ t.tSBigIntKeyword = t.tsBigIntKeyword = tsBigIntKeyword;
+ t.tSBooleanKeyword = t.tsBooleanKeyword = tsBooleanKeyword;
+ t.tSCallSignatureDeclaration = t.tsCallSignatureDeclaration =
+ tsCallSignatureDeclaration;
+ t.tSConditionalType = t.tsConditionalType = tsConditionalType;
+ t.tSConstructSignatureDeclaration = t.tsConstructSignatureDeclaration =
+ tsConstructSignatureDeclaration;
+ t.tSConstructorType = t.tsConstructorType = tsConstructorType;
+ t.tSDeclareFunction = t.tsDeclareFunction = tsDeclareFunction;
+ t.tSDeclareMethod = t.tsDeclareMethod = tsDeclareMethod;
+ t.tSEnumDeclaration = t.tsEnumDeclaration = tsEnumDeclaration;
+ t.tSEnumMember = t.tsEnumMember = tsEnumMember;
+ t.tSExportAssignment = t.tsExportAssignment = tsExportAssignment;
+ t.tSExpressionWithTypeArguments = t.tsExpressionWithTypeArguments =
+ tsExpressionWithTypeArguments;
+ t.tSExternalModuleReference = t.tsExternalModuleReference =
+ tsExternalModuleReference;
+ t.tSFunctionType = t.tsFunctionType = tsFunctionType;
+ t.tSImportEqualsDeclaration = t.tsImportEqualsDeclaration =
+ tsImportEqualsDeclaration;
+ t.tSImportType = t.tsImportType = tsImportType;
+ t.tSIndexSignature = t.tsIndexSignature = tsIndexSignature;
+ t.tSIndexedAccessType = t.tsIndexedAccessType = tsIndexedAccessType;
+ t.tSInferType = t.tsInferType = tsInferType;
+ t.tSInstantiationExpression = t.tsInstantiationExpression =
+ tsInstantiationExpression;
+ t.tSInterfaceBody = t.tsInterfaceBody = tsInterfaceBody;
+ t.tSInterfaceDeclaration = t.tsInterfaceDeclaration =
+ tsInterfaceDeclaration;
+ t.tSIntersectionType = t.tsIntersectionType = tsIntersectionType;
+ t.tSIntrinsicKeyword = t.tsIntrinsicKeyword = tsIntrinsicKeyword;
+ t.tSLiteralType = t.tsLiteralType = tsLiteralType;
+ t.tSMappedType = t.tsMappedType = tsMappedType;
+ t.tSMethodSignature = t.tsMethodSignature = tsMethodSignature;
+ t.tSModuleBlock = t.tsModuleBlock = tsModuleBlock;
+ t.tSModuleDeclaration = t.tsModuleDeclaration = tsModuleDeclaration;
+ t.tSNamedTupleMember = t.tsNamedTupleMember = tsNamedTupleMember;
+ t.tSNamespaceExportDeclaration = t.tsNamespaceExportDeclaration =
+ tsNamespaceExportDeclaration;
+ t.tSNeverKeyword = t.tsNeverKeyword = tsNeverKeyword;
+ t.tSNonNullExpression = t.tsNonNullExpression = tsNonNullExpression;
+ t.tSNullKeyword = t.tsNullKeyword = tsNullKeyword;
+ t.tSNumberKeyword = t.tsNumberKeyword = tsNumberKeyword;
+ t.tSObjectKeyword = t.tsObjectKeyword = tsObjectKeyword;
+ t.tSOptionalType = t.tsOptionalType = tsOptionalType;
+ t.tSParameterProperty = t.tsParameterProperty = tsParameterProperty;
+ t.tSParenthesizedType = t.tsParenthesizedType = tsParenthesizedType;
+ t.tSPropertySignature = t.tsPropertySignature = tsPropertySignature;
+ t.tSQualifiedName = t.tsQualifiedName = tsQualifiedName;
+ t.tSRestType = t.tsRestType = tsRestType;
+ t.tSSatisfiesExpression = t.tsSatisfiesExpression = tsSatisfiesExpression;
+ t.tSStringKeyword = t.tsStringKeyword = tsStringKeyword;
+ t.tSSymbolKeyword = t.tsSymbolKeyword = tsSymbolKeyword;
+ t.tSThisType = t.tsThisType = tsThisType;
+ t.tSTupleType = t.tsTupleType = tsTupleType;
+ t.tSTypeAliasDeclaration = t.tsTypeAliasDeclaration =
+ tsTypeAliasDeclaration;
+ t.tSTypeAnnotation = t.tsTypeAnnotation = tsTypeAnnotation;
+ t.tSTypeAssertion = t.tsTypeAssertion = tsTypeAssertion;
+ t.tSTypeLiteral = t.tsTypeLiteral = tsTypeLiteral;
+ t.tSTypeOperator = t.tsTypeOperator = tsTypeOperator;
+ t.tSTypeParameter = t.tsTypeParameter = tsTypeParameter;
+ t.tSTypeParameterDeclaration = t.tsTypeParameterDeclaration =
+ tsTypeParameterDeclaration;
+ t.tSTypeParameterInstantiation = t.tsTypeParameterInstantiation =
+ tsTypeParameterInstantiation;
+ t.tSTypePredicate = t.tsTypePredicate = tsTypePredicate;
+ t.tSTypeQuery = t.tsTypeQuery = tsTypeQuery;
+ t.tSTypeReference = t.tsTypeReference = tsTypeReference;
+ t.tSUndefinedKeyword = t.tsUndefinedKeyword = tsUndefinedKeyword;
+ t.tSUnionType = t.tsUnionType = tsUnionType;
+ t.tSUnknownKeyword = t.tsUnknownKeyword = tsUnknownKeyword;
+ t.tSVoidKeyword = t.tsVoidKeyword = tsVoidKeyword;
+ t.tupleExpression = tupleExpression;
+ t.tupleTypeAnnotation = tupleTypeAnnotation;
+ t.typeAlias = typeAlias;
+ t.typeAnnotation = typeAnnotation;
+ t.typeCastExpression = typeCastExpression;
+ t.typeParameter = typeParameter;
+ t.typeParameterDeclaration = typeParameterDeclaration;
+ t.typeParameterInstantiation = typeParameterInstantiation;
+ t.typeofTypeAnnotation = typeofTypeAnnotation;
+ t.unaryExpression = unaryExpression;
+ t.unionTypeAnnotation = unionTypeAnnotation;
+ t.updateExpression = updateExpression;
+ t.v8IntrinsicIdentifier = v8IntrinsicIdentifier;
+ t.variableDeclaration = variableDeclaration;
+ t.variableDeclarator = variableDeclarator;
+ t.variance = variance;
+ t.voidTypeAnnotation = voidTypeAnnotation;
+ t.whileStatement = whileStatement;
+ t.withStatement = withStatement;
+ t.yieldExpression = yieldExpression;
+ var s = r(9836);
+ var i = r(8418);
+ function arrayExpression(e = []) {
+ return (0, s.default)({ type: 'ArrayExpression', elements: e });
+ }
+ function assignmentExpression(e, t, r) {
+ return (0, s.default)({
+ type: 'AssignmentExpression',
+ operator: e,
+ left: t,
+ right: r,
+ });
+ }
+ function binaryExpression(e, t, r) {
+ return (0, s.default)({
+ type: 'BinaryExpression',
+ operator: e,
+ left: t,
+ right: r,
+ });
+ }
+ function interpreterDirective(e) {
+ return (0, s.default)({ type: 'InterpreterDirective', value: e });
+ }
+ function directive(e) {
+ return (0, s.default)({ type: 'Directive', value: e });
+ }
+ function directiveLiteral(e) {
+ return (0, s.default)({ type: 'DirectiveLiteral', value: e });
+ }
+ function blockStatement(e, t = []) {
+ return (0, s.default)({
+ type: 'BlockStatement',
+ body: e,
+ directives: t,
+ });
+ }
+ function breakStatement(e = null) {
+ return (0, s.default)({ type: 'BreakStatement', label: e });
+ }
+ function callExpression(e, t) {
+ return (0, s.default)({
+ type: 'CallExpression',
+ callee: e,
+ arguments: t,
+ });
+ }
+ function catchClause(e = null, t) {
+ return (0, s.default)({ type: 'CatchClause', param: e, body: t });
+ }
+ function conditionalExpression(e, t, r) {
+ return (0, s.default)({
+ type: 'ConditionalExpression',
+ test: e,
+ consequent: t,
+ alternate: r,
+ });
+ }
+ function continueStatement(e = null) {
+ return (0, s.default)({ type: 'ContinueStatement', label: e });
+ }
+ function debuggerStatement() {
+ return { type: 'DebuggerStatement' };
+ }
+ function doWhileStatement(e, t) {
+ return (0, s.default)({ type: 'DoWhileStatement', test: e, body: t });
+ }
+ function emptyStatement() {
+ return { type: 'EmptyStatement' };
+ }
+ function expressionStatement(e) {
+ return (0, s.default)({ type: 'ExpressionStatement', expression: e });
+ }
+ function file(e, t = null, r = null) {
+ return (0, s.default)({
+ type: 'File',
+ program: e,
+ comments: t,
+ tokens: r,
+ });
+ }
+ function forInStatement(e, t, r) {
+ return (0, s.default)({
+ type: 'ForInStatement',
+ left: e,
+ right: t,
+ body: r,
+ });
+ }
+ function forStatement(e = null, t = null, r = null, i) {
+ return (0, s.default)({
+ type: 'ForStatement',
+ init: e,
+ test: t,
+ update: r,
+ body: i,
+ });
+ }
+ function functionDeclaration(e = null, t, r, i = false, n = false) {
+ return (0, s.default)({
+ type: 'FunctionDeclaration',
+ id: e,
+ params: t,
+ body: r,
+ generator: i,
+ async: n,
+ });
+ }
+ function functionExpression(e = null, t, r, i = false, n = false) {
+ return (0, s.default)({
+ type: 'FunctionExpression',
+ id: e,
+ params: t,
+ body: r,
+ generator: i,
+ async: n,
+ });
+ }
+ function identifier(e) {
+ return (0, s.default)({ type: 'Identifier', name: e });
+ }
+ function ifStatement(e, t, r = null) {
+ return (0, s.default)({
+ type: 'IfStatement',
+ test: e,
+ consequent: t,
+ alternate: r,
+ });
+ }
+ function labeledStatement(e, t) {
+ return (0, s.default)({ type: 'LabeledStatement', label: e, body: t });
+ }
+ function stringLiteral(e) {
+ return (0, s.default)({ type: 'StringLiteral', value: e });
+ }
+ function numericLiteral(e) {
+ return (0, s.default)({ type: 'NumericLiteral', value: e });
+ }
+ function nullLiteral() {
+ return { type: 'NullLiteral' };
+ }
+ function booleanLiteral(e) {
+ return (0, s.default)({ type: 'BooleanLiteral', value: e });
+ }
+ function regExpLiteral(e, t = '') {
+ return (0, s.default)({ type: 'RegExpLiteral', pattern: e, flags: t });
+ }
+ function logicalExpression(e, t, r) {
+ return (0, s.default)({
+ type: 'LogicalExpression',
+ operator: e,
+ left: t,
+ right: r,
+ });
+ }
+ function memberExpression(e, t, r = false, i = null) {
+ return (0, s.default)({
+ type: 'MemberExpression',
+ object: e,
+ property: t,
+ computed: r,
+ optional: i,
+ });
+ }
+ function newExpression(e, t) {
+ return (0, s.default)({
+ type: 'NewExpression',
+ callee: e,
+ arguments: t,
+ });
+ }
+ function program(e, t = [], r = 'script', i = null) {
+ return (0, s.default)({
+ type: 'Program',
+ body: e,
+ directives: t,
+ sourceType: r,
+ interpreter: i,
+ sourceFile: null,
+ });
+ }
+ function objectExpression(e) {
+ return (0, s.default)({ type: 'ObjectExpression', properties: e });
+ }
+ function objectMethod(
+ e = 'method',
+ t,
+ r,
+ i,
+ n = false,
+ a = false,
+ o = false,
+ ) {
+ return (0, s.default)({
+ type: 'ObjectMethod',
+ kind: e,
+ key: t,
+ params: r,
+ body: i,
+ computed: n,
+ generator: a,
+ async: o,
+ });
+ }
+ function objectProperty(e, t, r = false, i = false, n = null) {
+ return (0, s.default)({
+ type: 'ObjectProperty',
+ key: e,
+ value: t,
+ computed: r,
+ shorthand: i,
+ decorators: n,
+ });
+ }
+ function restElement(e) {
+ return (0, s.default)({ type: 'RestElement', argument: e });
+ }
+ function returnStatement(e = null) {
+ return (0, s.default)({ type: 'ReturnStatement', argument: e });
+ }
+ function sequenceExpression(e) {
+ return (0, s.default)({ type: 'SequenceExpression', expressions: e });
+ }
+ function parenthesizedExpression(e) {
+ return (0, s.default)({
+ type: 'ParenthesizedExpression',
+ expression: e,
+ });
+ }
+ function switchCase(e = null, t) {
+ return (0, s.default)({ type: 'SwitchCase', test: e, consequent: t });
+ }
+ function switchStatement(e, t) {
+ return (0, s.default)({
+ type: 'SwitchStatement',
+ discriminant: e,
+ cases: t,
+ });
+ }
+ function thisExpression() {
+ return { type: 'ThisExpression' };
+ }
+ function throwStatement(e) {
+ return (0, s.default)({ type: 'ThrowStatement', argument: e });
+ }
+ function tryStatement(e, t = null, r = null) {
+ return (0, s.default)({
+ type: 'TryStatement',
+ block: e,
+ handler: t,
+ finalizer: r,
+ });
+ }
+ function unaryExpression(e, t, r = true) {
+ return (0, s.default)({
+ type: 'UnaryExpression',
+ operator: e,
+ argument: t,
+ prefix: r,
+ });
+ }
+ function updateExpression(e, t, r = false) {
+ return (0, s.default)({
+ type: 'UpdateExpression',
+ operator: e,
+ argument: t,
+ prefix: r,
+ });
+ }
+ function variableDeclaration(e, t) {
+ return (0, s.default)({
+ type: 'VariableDeclaration',
+ kind: e,
+ declarations: t,
+ });
+ }
+ function variableDeclarator(e, t = null) {
+ return (0, s.default)({ type: 'VariableDeclarator', id: e, init: t });
+ }
+ function whileStatement(e, t) {
+ return (0, s.default)({ type: 'WhileStatement', test: e, body: t });
+ }
+ function withStatement(e, t) {
+ return (0, s.default)({ type: 'WithStatement', object: e, body: t });
+ }
+ function assignmentPattern(e, t) {
+ return (0, s.default)({ type: 'AssignmentPattern', left: e, right: t });
+ }
+ function arrayPattern(e) {
+ return (0, s.default)({ type: 'ArrayPattern', elements: e });
+ }
+ function arrowFunctionExpression(e, t, r = false) {
+ return (0, s.default)({
+ type: 'ArrowFunctionExpression',
+ params: e,
+ body: t,
+ async: r,
+ expression: null,
+ });
+ }
+ function classBody(e) {
+ return (0, s.default)({ type: 'ClassBody', body: e });
+ }
+ function classExpression(e = null, t = null, r, i = null) {
+ return (0, s.default)({
+ type: 'ClassExpression',
+ id: e,
+ superClass: t,
+ body: r,
+ decorators: i,
+ });
+ }
+ function classDeclaration(e = null, t = null, r, i = null) {
+ return (0, s.default)({
+ type: 'ClassDeclaration',
+ id: e,
+ superClass: t,
+ body: r,
+ decorators: i,
+ });
+ }
+ function exportAllDeclaration(e) {
+ return (0, s.default)({ type: 'ExportAllDeclaration', source: e });
+ }
+ function exportDefaultDeclaration(e) {
+ return (0, s.default)({
+ type: 'ExportDefaultDeclaration',
+ declaration: e,
+ });
+ }
+ function exportNamedDeclaration(e = null, t = [], r = null) {
+ return (0, s.default)({
+ type: 'ExportNamedDeclaration',
+ declaration: e,
+ specifiers: t,
+ source: r,
+ });
+ }
+ function exportSpecifier(e, t) {
+ return (0, s.default)({
+ type: 'ExportSpecifier',
+ local: e,
+ exported: t,
+ });
+ }
+ function forOfStatement(e, t, r, i = false) {
+ return (0, s.default)({
+ type: 'ForOfStatement',
+ left: e,
+ right: t,
+ body: r,
+ await: i,
+ });
+ }
+ function importDeclaration(e, t) {
+ return (0, s.default)({
+ type: 'ImportDeclaration',
+ specifiers: e,
+ source: t,
+ });
+ }
+ function importDefaultSpecifier(e) {
+ return (0, s.default)({ type: 'ImportDefaultSpecifier', local: e });
+ }
+ function importNamespaceSpecifier(e) {
+ return (0, s.default)({ type: 'ImportNamespaceSpecifier', local: e });
+ }
+ function importSpecifier(e, t) {
+ return (0, s.default)({
+ type: 'ImportSpecifier',
+ local: e,
+ imported: t,
+ });
+ }
+ function importExpression(e, t = null) {
+ return (0, s.default)({
+ type: 'ImportExpression',
+ source: e,
+ options: t,
+ });
+ }
+ function metaProperty(e, t) {
+ return (0, s.default)({ type: 'MetaProperty', meta: e, property: t });
+ }
+ function classMethod(
+ e = 'method',
+ t,
+ r,
+ i,
+ n = false,
+ a = false,
+ o = false,
+ l = false,
+ ) {
+ return (0, s.default)({
+ type: 'ClassMethod',
+ kind: e,
+ key: t,
+ params: r,
+ body: i,
+ computed: n,
+ static: a,
+ generator: o,
+ async: l,
+ });
+ }
+ function objectPattern(e) {
+ return (0, s.default)({ type: 'ObjectPattern', properties: e });
+ }
+ function spreadElement(e) {
+ return (0, s.default)({ type: 'SpreadElement', argument: e });
+ }
+ function _super() {
+ return { type: 'Super' };
+ }
+ function taggedTemplateExpression(e, t) {
+ return (0, s.default)({
+ type: 'TaggedTemplateExpression',
+ tag: e,
+ quasi: t,
+ });
+ }
+ function templateElement(e, t = false) {
+ return (0, s.default)({ type: 'TemplateElement', value: e, tail: t });
+ }
+ function templateLiteral(e, t) {
+ return (0, s.default)({
+ type: 'TemplateLiteral',
+ quasis: e,
+ expressions: t,
+ });
+ }
+ function yieldExpression(e = null, t = false) {
+ return (0, s.default)({
+ type: 'YieldExpression',
+ argument: e,
+ delegate: t,
+ });
+ }
+ function awaitExpression(e) {
+ return (0, s.default)({ type: 'AwaitExpression', argument: e });
+ }
+ function _import() {
+ return { type: 'Import' };
+ }
+ function bigIntLiteral(e) {
+ return (0, s.default)({ type: 'BigIntLiteral', value: e });
+ }
+ function exportNamespaceSpecifier(e) {
+ return (0, s.default)({
+ type: 'ExportNamespaceSpecifier',
+ exported: e,
+ });
+ }
+ function optionalMemberExpression(e, t, r = false, i) {
+ return (0, s.default)({
+ type: 'OptionalMemberExpression',
+ object: e,
+ property: t,
+ computed: r,
+ optional: i,
+ });
+ }
+ function optionalCallExpression(e, t, r) {
+ return (0, s.default)({
+ type: 'OptionalCallExpression',
+ callee: e,
+ arguments: t,
+ optional: r,
+ });
+ }
+ function classProperty(
+ e,
+ t = null,
+ r = null,
+ i = null,
+ n = false,
+ a = false,
+ ) {
+ return (0, s.default)({
+ type: 'ClassProperty',
+ key: e,
+ value: t,
+ typeAnnotation: r,
+ decorators: i,
+ computed: n,
+ static: a,
+ });
+ }
+ function classAccessorProperty(
+ e,
+ t = null,
+ r = null,
+ i = null,
+ n = false,
+ a = false,
+ ) {
+ return (0, s.default)({
+ type: 'ClassAccessorProperty',
+ key: e,
+ value: t,
+ typeAnnotation: r,
+ decorators: i,
+ computed: n,
+ static: a,
+ });
+ }
+ function classPrivateProperty(e, t = null, r = null, i = false) {
+ return (0, s.default)({
+ type: 'ClassPrivateProperty',
+ key: e,
+ value: t,
+ decorators: r,
+ static: i,
+ });
+ }
+ function classPrivateMethod(e = 'method', t, r, i, n = false) {
+ return (0, s.default)({
+ type: 'ClassPrivateMethod',
+ kind: e,
+ key: t,
+ params: r,
+ body: i,
+ static: n,
+ });
+ }
+ function privateName(e) {
+ return (0, s.default)({ type: 'PrivateName', id: e });
+ }
+ function staticBlock(e) {
+ return (0, s.default)({ type: 'StaticBlock', body: e });
+ }
+ function anyTypeAnnotation() {
+ return { type: 'AnyTypeAnnotation' };
+ }
+ function arrayTypeAnnotation(e) {
+ return (0, s.default)({ type: 'ArrayTypeAnnotation', elementType: e });
+ }
+ function booleanTypeAnnotation() {
+ return { type: 'BooleanTypeAnnotation' };
+ }
+ function booleanLiteralTypeAnnotation(e) {
+ return (0, s.default)({
+ type: 'BooleanLiteralTypeAnnotation',
+ value: e,
+ });
+ }
+ function nullLiteralTypeAnnotation() {
+ return { type: 'NullLiteralTypeAnnotation' };
+ }
+ function classImplements(e, t = null) {
+ return (0, s.default)({
+ type: 'ClassImplements',
+ id: e,
+ typeParameters: t,
+ });
+ }
+ function declareClass(e, t = null, r = null, i) {
+ return (0, s.default)({
+ type: 'DeclareClass',
+ id: e,
+ typeParameters: t,
+ extends: r,
+ body: i,
+ });
+ }
+ function declareFunction(e) {
+ return (0, s.default)({ type: 'DeclareFunction', id: e });
+ }
+ function declareInterface(e, t = null, r = null, i) {
+ return (0, s.default)({
+ type: 'DeclareInterface',
+ id: e,
+ typeParameters: t,
+ extends: r,
+ body: i,
+ });
+ }
+ function declareModule(e, t, r = null) {
+ return (0, s.default)({
+ type: 'DeclareModule',
+ id: e,
+ body: t,
+ kind: r,
+ });
+ }
+ function declareModuleExports(e) {
+ return (0, s.default)({
+ type: 'DeclareModuleExports',
+ typeAnnotation: e,
+ });
+ }
+ function declareTypeAlias(e, t = null, r) {
+ return (0, s.default)({
+ type: 'DeclareTypeAlias',
+ id: e,
+ typeParameters: t,
+ right: r,
+ });
+ }
+ function declareOpaqueType(e, t = null, r = null) {
+ return (0, s.default)({
+ type: 'DeclareOpaqueType',
+ id: e,
+ typeParameters: t,
+ supertype: r,
+ });
+ }
+ function declareVariable(e) {
+ return (0, s.default)({ type: 'DeclareVariable', id: e });
+ }
+ function declareExportDeclaration(e = null, t = null, r = null) {
+ return (0, s.default)({
+ type: 'DeclareExportDeclaration',
+ declaration: e,
+ specifiers: t,
+ source: r,
+ });
+ }
+ function declareExportAllDeclaration(e) {
+ return (0, s.default)({
+ type: 'DeclareExportAllDeclaration',
+ source: e,
+ });
+ }
+ function declaredPredicate(e) {
+ return (0, s.default)({ type: 'DeclaredPredicate', value: e });
+ }
+ function existsTypeAnnotation() {
+ return { type: 'ExistsTypeAnnotation' };
+ }
+ function functionTypeAnnotation(e = null, t, r = null, i) {
+ return (0, s.default)({
+ type: 'FunctionTypeAnnotation',
+ typeParameters: e,
+ params: t,
+ rest: r,
+ returnType: i,
+ });
+ }
+ function functionTypeParam(e = null, t) {
+ return (0, s.default)({
+ type: 'FunctionTypeParam',
+ name: e,
+ typeAnnotation: t,
+ });
+ }
+ function genericTypeAnnotation(e, t = null) {
+ return (0, s.default)({
+ type: 'GenericTypeAnnotation',
+ id: e,
+ typeParameters: t,
+ });
+ }
+ function inferredPredicate() {
+ return { type: 'InferredPredicate' };
+ }
+ function interfaceExtends(e, t = null) {
+ return (0, s.default)({
+ type: 'InterfaceExtends',
+ id: e,
+ typeParameters: t,
+ });
+ }
+ function interfaceDeclaration(e, t = null, r = null, i) {
+ return (0, s.default)({
+ type: 'InterfaceDeclaration',
+ id: e,
+ typeParameters: t,
+ extends: r,
+ body: i,
+ });
+ }
+ function interfaceTypeAnnotation(e = null, t) {
+ return (0, s.default)({
+ type: 'InterfaceTypeAnnotation',
+ extends: e,
+ body: t,
+ });
+ }
+ function intersectionTypeAnnotation(e) {
+ return (0, s.default)({ type: 'IntersectionTypeAnnotation', types: e });
+ }
+ function mixedTypeAnnotation() {
+ return { type: 'MixedTypeAnnotation' };
+ }
+ function emptyTypeAnnotation() {
+ return { type: 'EmptyTypeAnnotation' };
+ }
+ function nullableTypeAnnotation(e) {
+ return (0, s.default)({
+ type: 'NullableTypeAnnotation',
+ typeAnnotation: e,
+ });
+ }
+ function numberLiteralTypeAnnotation(e) {
+ return (0, s.default)({
+ type: 'NumberLiteralTypeAnnotation',
+ value: e,
+ });
+ }
+ function numberTypeAnnotation() {
+ return { type: 'NumberTypeAnnotation' };
+ }
+ function objectTypeAnnotation(e, t = [], r = [], i = [], n = false) {
+ return (0, s.default)({
+ type: 'ObjectTypeAnnotation',
+ properties: e,
+ indexers: t,
+ callProperties: r,
+ internalSlots: i,
+ exact: n,
+ });
+ }
+ function objectTypeInternalSlot(e, t, r, i, n) {
+ return (0, s.default)({
+ type: 'ObjectTypeInternalSlot',
+ id: e,
+ value: t,
+ optional: r,
+ static: i,
+ method: n,
+ });
+ }
+ function objectTypeCallProperty(e) {
+ return (0, s.default)({
+ type: 'ObjectTypeCallProperty',
+ value: e,
+ static: null,
+ });
+ }
+ function objectTypeIndexer(e = null, t, r, i = null) {
+ return (0, s.default)({
+ type: 'ObjectTypeIndexer',
+ id: e,
+ key: t,
+ value: r,
+ variance: i,
+ static: null,
+ });
+ }
+ function objectTypeProperty(e, t, r = null) {
+ return (0, s.default)({
+ type: 'ObjectTypeProperty',
+ key: e,
+ value: t,
+ variance: r,
+ kind: null,
+ method: null,
+ optional: null,
+ proto: null,
+ static: null,
+ });
+ }
+ function objectTypeSpreadProperty(e) {
+ return (0, s.default)({
+ type: 'ObjectTypeSpreadProperty',
+ argument: e,
+ });
+ }
+ function opaqueType(e, t = null, r = null, i) {
+ return (0, s.default)({
+ type: 'OpaqueType',
+ id: e,
+ typeParameters: t,
+ supertype: r,
+ impltype: i,
+ });
+ }
+ function qualifiedTypeIdentifier(e, t) {
+ return (0, s.default)({
+ type: 'QualifiedTypeIdentifier',
+ id: e,
+ qualification: t,
+ });
+ }
+ function stringLiteralTypeAnnotation(e) {
+ return (0, s.default)({
+ type: 'StringLiteralTypeAnnotation',
+ value: e,
+ });
+ }
+ function stringTypeAnnotation() {
+ return { type: 'StringTypeAnnotation' };
+ }
+ function symbolTypeAnnotation() {
+ return { type: 'SymbolTypeAnnotation' };
+ }
+ function thisTypeAnnotation() {
+ return { type: 'ThisTypeAnnotation' };
+ }
+ function tupleTypeAnnotation(e) {
+ return (0, s.default)({ type: 'TupleTypeAnnotation', types: e });
+ }
+ function typeofTypeAnnotation(e) {
+ return (0, s.default)({ type: 'TypeofTypeAnnotation', argument: e });
+ }
+ function typeAlias(e, t = null, r) {
+ return (0, s.default)({
+ type: 'TypeAlias',
+ id: e,
+ typeParameters: t,
+ right: r,
+ });
+ }
+ function typeAnnotation(e) {
+ return (0, s.default)({ type: 'TypeAnnotation', typeAnnotation: e });
+ }
+ function typeCastExpression(e, t) {
+ return (0, s.default)({
+ type: 'TypeCastExpression',
+ expression: e,
+ typeAnnotation: t,
+ });
+ }
+ function typeParameter(e = null, t = null, r = null) {
+ return (0, s.default)({
+ type: 'TypeParameter',
+ bound: e,
+ default: t,
+ variance: r,
+ name: null,
+ });
+ }
+ function typeParameterDeclaration(e) {
+ return (0, s.default)({ type: 'TypeParameterDeclaration', params: e });
+ }
+ function typeParameterInstantiation(e) {
+ return (0, s.default)({
+ type: 'TypeParameterInstantiation',
+ params: e,
+ });
+ }
+ function unionTypeAnnotation(e) {
+ return (0, s.default)({ type: 'UnionTypeAnnotation', types: e });
+ }
+ function variance(e) {
+ return (0, s.default)({ type: 'Variance', kind: e });
+ }
+ function voidTypeAnnotation() {
+ return { type: 'VoidTypeAnnotation' };
+ }
+ function enumDeclaration(e, t) {
+ return (0, s.default)({ type: 'EnumDeclaration', id: e, body: t });
+ }
+ function enumBooleanBody(e) {
+ return (0, s.default)({
+ type: 'EnumBooleanBody',
+ members: e,
+ explicitType: null,
+ hasUnknownMembers: null,
+ });
+ }
+ function enumNumberBody(e) {
+ return (0, s.default)({
+ type: 'EnumNumberBody',
+ members: e,
+ explicitType: null,
+ hasUnknownMembers: null,
+ });
+ }
+ function enumStringBody(e) {
+ return (0, s.default)({
+ type: 'EnumStringBody',
+ members: e,
+ explicitType: null,
+ hasUnknownMembers: null,
+ });
+ }
+ function enumSymbolBody(e) {
+ return (0, s.default)({
+ type: 'EnumSymbolBody',
+ members: e,
+ hasUnknownMembers: null,
+ });
+ }
+ function enumBooleanMember(e) {
+ return (0, s.default)({ type: 'EnumBooleanMember', id: e, init: null });
+ }
+ function enumNumberMember(e, t) {
+ return (0, s.default)({ type: 'EnumNumberMember', id: e, init: t });
+ }
+ function enumStringMember(e, t) {
+ return (0, s.default)({ type: 'EnumStringMember', id: e, init: t });
+ }
+ function enumDefaultedMember(e) {
+ return (0, s.default)({ type: 'EnumDefaultedMember', id: e });
+ }
+ function indexedAccessType(e, t) {
+ return (0, s.default)({
+ type: 'IndexedAccessType',
+ objectType: e,
+ indexType: t,
+ });
+ }
+ function optionalIndexedAccessType(e, t) {
+ return (0, s.default)({
+ type: 'OptionalIndexedAccessType',
+ objectType: e,
+ indexType: t,
+ optional: null,
+ });
+ }
+ function jsxAttribute(e, t = null) {
+ return (0, s.default)({ type: 'JSXAttribute', name: e, value: t });
+ }
+ function jsxClosingElement(e) {
+ return (0, s.default)({ type: 'JSXClosingElement', name: e });
+ }
+ function jsxElement(e, t = null, r, i = null) {
+ return (0, s.default)({
+ type: 'JSXElement',
+ openingElement: e,
+ closingElement: t,
+ children: r,
+ selfClosing: i,
+ });
+ }
+ function jsxEmptyExpression() {
+ return { type: 'JSXEmptyExpression' };
+ }
+ function jsxExpressionContainer(e) {
+ return (0, s.default)({
+ type: 'JSXExpressionContainer',
+ expression: e,
+ });
+ }
+ function jsxSpreadChild(e) {
+ return (0, s.default)({ type: 'JSXSpreadChild', expression: e });
+ }
+ function jsxIdentifier(e) {
+ return (0, s.default)({ type: 'JSXIdentifier', name: e });
+ }
+ function jsxMemberExpression(e, t) {
+ return (0, s.default)({
+ type: 'JSXMemberExpression',
+ object: e,
+ property: t,
+ });
+ }
+ function jsxNamespacedName(e, t) {
+ return (0, s.default)({
+ type: 'JSXNamespacedName',
+ namespace: e,
+ name: t,
+ });
+ }
+ function jsxOpeningElement(e, t, r = false) {
+ return (0, s.default)({
+ type: 'JSXOpeningElement',
+ name: e,
+ attributes: t,
+ selfClosing: r,
+ });
+ }
+ function jsxSpreadAttribute(e) {
+ return (0, s.default)({ type: 'JSXSpreadAttribute', argument: e });
+ }
+ function jsxText(e) {
+ return (0, s.default)({ type: 'JSXText', value: e });
+ }
+ function jsxFragment(e, t, r) {
+ return (0, s.default)({
+ type: 'JSXFragment',
+ openingFragment: e,
+ closingFragment: t,
+ children: r,
+ });
+ }
+ function jsxOpeningFragment() {
+ return { type: 'JSXOpeningFragment' };
+ }
+ function jsxClosingFragment() {
+ return { type: 'JSXClosingFragment' };
+ }
+ function noop() {
+ return { type: 'Noop' };
+ }
+ function placeholder(e, t) {
+ return (0, s.default)({
+ type: 'Placeholder',
+ expectedNode: e,
+ name: t,
+ });
+ }
+ function v8IntrinsicIdentifier(e) {
+ return (0, s.default)({ type: 'V8IntrinsicIdentifier', name: e });
+ }
+ function argumentPlaceholder() {
+ return { type: 'ArgumentPlaceholder' };
+ }
+ function bindExpression(e, t) {
+ return (0, s.default)({ type: 'BindExpression', object: e, callee: t });
+ }
+ function importAttribute(e, t) {
+ return (0, s.default)({ type: 'ImportAttribute', key: e, value: t });
+ }
+ function decorator(e) {
+ return (0, s.default)({ type: 'Decorator', expression: e });
+ }
+ function doExpression(e, t = false) {
+ return (0, s.default)({ type: 'DoExpression', body: e, async: t });
+ }
+ function exportDefaultSpecifier(e) {
+ return (0, s.default)({ type: 'ExportDefaultSpecifier', exported: e });
+ }
+ function recordExpression(e) {
+ return (0, s.default)({ type: 'RecordExpression', properties: e });
+ }
+ function tupleExpression(e = []) {
+ return (0, s.default)({ type: 'TupleExpression', elements: e });
+ }
+ function decimalLiteral(e) {
+ return (0, s.default)({ type: 'DecimalLiteral', value: e });
+ }
+ function moduleExpression(e) {
+ return (0, s.default)({ type: 'ModuleExpression', body: e });
+ }
+ function topicReference() {
+ return { type: 'TopicReference' };
+ }
+ function pipelineTopicExpression(e) {
+ return (0, s.default)({
+ type: 'PipelineTopicExpression',
+ expression: e,
+ });
+ }
+ function pipelineBareFunction(e) {
+ return (0, s.default)({ type: 'PipelineBareFunction', callee: e });
+ }
+ function pipelinePrimaryTopicReference() {
+ return { type: 'PipelinePrimaryTopicReference' };
+ }
+ function tsParameterProperty(e) {
+ return (0, s.default)({ type: 'TSParameterProperty', parameter: e });
+ }
+ function tsDeclareFunction(e = null, t = null, r, i = null) {
+ return (0, s.default)({
+ type: 'TSDeclareFunction',
+ id: e,
+ typeParameters: t,
+ params: r,
+ returnType: i,
+ });
+ }
+ function tsDeclareMethod(e = null, t, r = null, i, n = null) {
+ return (0, s.default)({
+ type: 'TSDeclareMethod',
+ decorators: e,
+ key: t,
+ typeParameters: r,
+ params: i,
+ returnType: n,
+ });
+ }
+ function tsQualifiedName(e, t) {
+ return (0, s.default)({ type: 'TSQualifiedName', left: e, right: t });
+ }
+ function tsCallSignatureDeclaration(e = null, t, r = null) {
+ return (0, s.default)({
+ type: 'TSCallSignatureDeclaration',
+ typeParameters: e,
+ parameters: t,
+ typeAnnotation: r,
+ });
+ }
+ function tsConstructSignatureDeclaration(e = null, t, r = null) {
+ return (0, s.default)({
+ type: 'TSConstructSignatureDeclaration',
+ typeParameters: e,
+ parameters: t,
+ typeAnnotation: r,
+ });
+ }
+ function tsPropertySignature(e, t = null, r = null) {
+ return (0, s.default)({
+ type: 'TSPropertySignature',
+ key: e,
+ typeAnnotation: t,
+ initializer: r,
+ kind: null,
+ });
+ }
+ function tsMethodSignature(e, t = null, r, i = null) {
+ return (0, s.default)({
+ type: 'TSMethodSignature',
+ key: e,
+ typeParameters: t,
+ parameters: r,
+ typeAnnotation: i,
+ kind: null,
+ });
+ }
+ function tsIndexSignature(e, t = null) {
+ return (0, s.default)({
+ type: 'TSIndexSignature',
+ parameters: e,
+ typeAnnotation: t,
+ });
+ }
+ function tsAnyKeyword() {
+ return { type: 'TSAnyKeyword' };
+ }
+ function tsBooleanKeyword() {
+ return { type: 'TSBooleanKeyword' };
+ }
+ function tsBigIntKeyword() {
+ return { type: 'TSBigIntKeyword' };
+ }
+ function tsIntrinsicKeyword() {
+ return { type: 'TSIntrinsicKeyword' };
+ }
+ function tsNeverKeyword() {
+ return { type: 'TSNeverKeyword' };
+ }
+ function tsNullKeyword() {
+ return { type: 'TSNullKeyword' };
+ }
+ function tsNumberKeyword() {
+ return { type: 'TSNumberKeyword' };
+ }
+ function tsObjectKeyword() {
+ return { type: 'TSObjectKeyword' };
+ }
+ function tsStringKeyword() {
+ return { type: 'TSStringKeyword' };
+ }
+ function tsSymbolKeyword() {
+ return { type: 'TSSymbolKeyword' };
+ }
+ function tsUndefinedKeyword() {
+ return { type: 'TSUndefinedKeyword' };
+ }
+ function tsUnknownKeyword() {
+ return { type: 'TSUnknownKeyword' };
+ }
+ function tsVoidKeyword() {
+ return { type: 'TSVoidKeyword' };
+ }
+ function tsThisType() {
+ return { type: 'TSThisType' };
+ }
+ function tsFunctionType(e = null, t, r = null) {
+ return (0, s.default)({
+ type: 'TSFunctionType',
+ typeParameters: e,
+ parameters: t,
+ typeAnnotation: r,
+ });
+ }
+ function tsConstructorType(e = null, t, r = null) {
+ return (0, s.default)({
+ type: 'TSConstructorType',
+ typeParameters: e,
+ parameters: t,
+ typeAnnotation: r,
+ });
+ }
+ function tsTypeReference(e, t = null) {
+ return (0, s.default)({
+ type: 'TSTypeReference',
+ typeName: e,
+ typeParameters: t,
+ });
+ }
+ function tsTypePredicate(e, t = null, r = null) {
+ return (0, s.default)({
+ type: 'TSTypePredicate',
+ parameterName: e,
+ typeAnnotation: t,
+ asserts: r,
+ });
+ }
+ function tsTypeQuery(e, t = null) {
+ return (0, s.default)({
+ type: 'TSTypeQuery',
+ exprName: e,
+ typeParameters: t,
+ });
+ }
+ function tsTypeLiteral(e) {
+ return (0, s.default)({ type: 'TSTypeLiteral', members: e });
+ }
+ function tsArrayType(e) {
+ return (0, s.default)({ type: 'TSArrayType', elementType: e });
+ }
+ function tsTupleType(e) {
+ return (0, s.default)({ type: 'TSTupleType', elementTypes: e });
+ }
+ function tsOptionalType(e) {
+ return (0, s.default)({ type: 'TSOptionalType', typeAnnotation: e });
+ }
+ function tsRestType(e) {
+ return (0, s.default)({ type: 'TSRestType', typeAnnotation: e });
+ }
+ function tsNamedTupleMember(e, t, r = false) {
+ return (0, s.default)({
+ type: 'TSNamedTupleMember',
+ label: e,
+ elementType: t,
+ optional: r,
+ });
+ }
+ function tsUnionType(e) {
+ return (0, s.default)({ type: 'TSUnionType', types: e });
+ }
+ function tsIntersectionType(e) {
+ return (0, s.default)({ type: 'TSIntersectionType', types: e });
+ }
+ function tsConditionalType(e, t, r, i) {
+ return (0, s.default)({
+ type: 'TSConditionalType',
+ checkType: e,
+ extendsType: t,
+ trueType: r,
+ falseType: i,
+ });
+ }
+ function tsInferType(e) {
+ return (0, s.default)({ type: 'TSInferType', typeParameter: e });
+ }
+ function tsParenthesizedType(e) {
+ return (0, s.default)({
+ type: 'TSParenthesizedType',
+ typeAnnotation: e,
+ });
+ }
+ function tsTypeOperator(e) {
+ return (0, s.default)({
+ type: 'TSTypeOperator',
+ typeAnnotation: e,
+ operator: null,
+ });
+ }
+ function tsIndexedAccessType(e, t) {
+ return (0, s.default)({
+ type: 'TSIndexedAccessType',
+ objectType: e,
+ indexType: t,
+ });
+ }
+ function tsMappedType(e, t = null, r = null) {
+ return (0, s.default)({
+ type: 'TSMappedType',
+ typeParameter: e,
+ typeAnnotation: t,
+ nameType: r,
+ });
+ }
+ function tsLiteralType(e) {
+ return (0, s.default)({ type: 'TSLiteralType', literal: e });
+ }
+ function tsExpressionWithTypeArguments(e, t = null) {
+ return (0, s.default)({
+ type: 'TSExpressionWithTypeArguments',
+ expression: e,
+ typeParameters: t,
+ });
+ }
+ function tsInterfaceDeclaration(e, t = null, r = null, i) {
+ return (0, s.default)({
+ type: 'TSInterfaceDeclaration',
+ id: e,
+ typeParameters: t,
+ extends: r,
+ body: i,
+ });
+ }
+ function tsInterfaceBody(e) {
+ return (0, s.default)({ type: 'TSInterfaceBody', body: e });
+ }
+ function tsTypeAliasDeclaration(e, t = null, r) {
+ return (0, s.default)({
+ type: 'TSTypeAliasDeclaration',
+ id: e,
+ typeParameters: t,
+ typeAnnotation: r,
+ });
+ }
+ function tsInstantiationExpression(e, t = null) {
+ return (0, s.default)({
+ type: 'TSInstantiationExpression',
+ expression: e,
+ typeParameters: t,
+ });
+ }
+ function tsAsExpression(e, t) {
+ return (0, s.default)({
+ type: 'TSAsExpression',
+ expression: e,
+ typeAnnotation: t,
+ });
+ }
+ function tsSatisfiesExpression(e, t) {
+ return (0, s.default)({
+ type: 'TSSatisfiesExpression',
+ expression: e,
+ typeAnnotation: t,
+ });
+ }
+ function tsTypeAssertion(e, t) {
+ return (0, s.default)({
+ type: 'TSTypeAssertion',
+ typeAnnotation: e,
+ expression: t,
+ });
+ }
+ function tsEnumDeclaration(e, t) {
+ return (0, s.default)({ type: 'TSEnumDeclaration', id: e, members: t });
+ }
+ function tsEnumMember(e, t = null) {
+ return (0, s.default)({ type: 'TSEnumMember', id: e, initializer: t });
+ }
+ function tsModuleDeclaration(e, t) {
+ return (0, s.default)({ type: 'TSModuleDeclaration', id: e, body: t });
+ }
+ function tsModuleBlock(e) {
+ return (0, s.default)({ type: 'TSModuleBlock', body: e });
+ }
+ function tsImportType(e, t = null, r = null) {
+ return (0, s.default)({
+ type: 'TSImportType',
+ argument: e,
+ qualifier: t,
+ typeParameters: r,
+ });
+ }
+ function tsImportEqualsDeclaration(e, t) {
+ return (0, s.default)({
+ type: 'TSImportEqualsDeclaration',
+ id: e,
+ moduleReference: t,
+ isExport: null,
+ });
+ }
+ function tsExternalModuleReference(e) {
+ return (0, s.default)({
+ type: 'TSExternalModuleReference',
+ expression: e,
+ });
+ }
+ function tsNonNullExpression(e) {
+ return (0, s.default)({ type: 'TSNonNullExpression', expression: e });
+ }
+ function tsExportAssignment(e) {
+ return (0, s.default)({ type: 'TSExportAssignment', expression: e });
+ }
+ function tsNamespaceExportDeclaration(e) {
+ return (0, s.default)({ type: 'TSNamespaceExportDeclaration', id: e });
+ }
+ function tsTypeAnnotation(e) {
+ return (0, s.default)({ type: 'TSTypeAnnotation', typeAnnotation: e });
+ }
+ function tsTypeParameterInstantiation(e) {
+ return (0, s.default)({
+ type: 'TSTypeParameterInstantiation',
+ params: e,
+ });
+ }
+ function tsTypeParameterDeclaration(e) {
+ return (0, s.default)({
+ type: 'TSTypeParameterDeclaration',
+ params: e,
+ });
+ }
+ function tsTypeParameter(e = null, t = null, r) {
+ return (0, s.default)({
+ type: 'TSTypeParameter',
+ constraint: e,
+ default: t,
+ name: r,
+ });
+ }
+ function NumberLiteral(e) {
+ (0, i.default)('NumberLiteral', 'NumericLiteral', 'The node type ');
+ return numericLiteral(e);
+ }
+ function RegexLiteral(e, t = '') {
+ (0, i.default)('RegexLiteral', 'RegExpLiteral', 'The node type ');
+ return regExpLiteral(e, t);
+ }
+ function RestProperty(e) {
+ (0, i.default)('RestProperty', 'RestElement', 'The node type ');
+ return restElement(e);
+ }
+ function SpreadProperty(e) {
+ (0, i.default)('SpreadProperty', 'SpreadElement', 'The node type ');
+ return spreadElement(e);
+ }
+ },
+ 6503: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ Object.defineProperty(t, 'AnyTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.anyTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'ArgumentPlaceholder', {
+ enumerable: true,
+ get: function () {
+ return s.argumentPlaceholder;
+ },
+ });
+ Object.defineProperty(t, 'ArrayExpression', {
+ enumerable: true,
+ get: function () {
+ return s.arrayExpression;
+ },
+ });
+ Object.defineProperty(t, 'ArrayPattern', {
+ enumerable: true,
+ get: function () {
+ return s.arrayPattern;
+ },
+ });
+ Object.defineProperty(t, 'ArrayTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.arrayTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'ArrowFunctionExpression', {
+ enumerable: true,
+ get: function () {
+ return s.arrowFunctionExpression;
+ },
+ });
+ Object.defineProperty(t, 'AssignmentExpression', {
+ enumerable: true,
+ get: function () {
+ return s.assignmentExpression;
+ },
+ });
+ Object.defineProperty(t, 'AssignmentPattern', {
+ enumerable: true,
+ get: function () {
+ return s.assignmentPattern;
+ },
+ });
+ Object.defineProperty(t, 'AwaitExpression', {
+ enumerable: true,
+ get: function () {
+ return s.awaitExpression;
+ },
+ });
+ Object.defineProperty(t, 'BigIntLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.bigIntLiteral;
+ },
+ });
+ Object.defineProperty(t, 'BinaryExpression', {
+ enumerable: true,
+ get: function () {
+ return s.binaryExpression;
+ },
+ });
+ Object.defineProperty(t, 'BindExpression', {
+ enumerable: true,
+ get: function () {
+ return s.bindExpression;
+ },
+ });
+ Object.defineProperty(t, 'BlockStatement', {
+ enumerable: true,
+ get: function () {
+ return s.blockStatement;
+ },
+ });
+ Object.defineProperty(t, 'BooleanLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.booleanLiteral;
+ },
+ });
+ Object.defineProperty(t, 'BooleanLiteralTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.booleanLiteralTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'BooleanTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.booleanTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'BreakStatement', {
+ enumerable: true,
+ get: function () {
+ return s.breakStatement;
+ },
+ });
+ Object.defineProperty(t, 'CallExpression', {
+ enumerable: true,
+ get: function () {
+ return s.callExpression;
+ },
+ });
+ Object.defineProperty(t, 'CatchClause', {
+ enumerable: true,
+ get: function () {
+ return s.catchClause;
+ },
+ });
+ Object.defineProperty(t, 'ClassAccessorProperty', {
+ enumerable: true,
+ get: function () {
+ return s.classAccessorProperty;
+ },
+ });
+ Object.defineProperty(t, 'ClassBody', {
+ enumerable: true,
+ get: function () {
+ return s.classBody;
+ },
+ });
+ Object.defineProperty(t, 'ClassDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.classDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'ClassExpression', {
+ enumerable: true,
+ get: function () {
+ return s.classExpression;
+ },
+ });
+ Object.defineProperty(t, 'ClassImplements', {
+ enumerable: true,
+ get: function () {
+ return s.classImplements;
+ },
+ });
+ Object.defineProperty(t, 'ClassMethod', {
+ enumerable: true,
+ get: function () {
+ return s.classMethod;
+ },
+ });
+ Object.defineProperty(t, 'ClassPrivateMethod', {
+ enumerable: true,
+ get: function () {
+ return s.classPrivateMethod;
+ },
+ });
+ Object.defineProperty(t, 'ClassPrivateProperty', {
+ enumerable: true,
+ get: function () {
+ return s.classPrivateProperty;
+ },
+ });
+ Object.defineProperty(t, 'ClassProperty', {
+ enumerable: true,
+ get: function () {
+ return s.classProperty;
+ },
+ });
+ Object.defineProperty(t, 'ConditionalExpression', {
+ enumerable: true,
+ get: function () {
+ return s.conditionalExpression;
+ },
+ });
+ Object.defineProperty(t, 'ContinueStatement', {
+ enumerable: true,
+ get: function () {
+ return s.continueStatement;
+ },
+ });
+ Object.defineProperty(t, 'DebuggerStatement', {
+ enumerable: true,
+ get: function () {
+ return s.debuggerStatement;
+ },
+ });
+ Object.defineProperty(t, 'DecimalLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.decimalLiteral;
+ },
+ });
+ Object.defineProperty(t, 'DeclareClass', {
+ enumerable: true,
+ get: function () {
+ return s.declareClass;
+ },
+ });
+ Object.defineProperty(t, 'DeclareExportAllDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.declareExportAllDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'DeclareExportDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.declareExportDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'DeclareFunction', {
+ enumerable: true,
+ get: function () {
+ return s.declareFunction;
+ },
+ });
+ Object.defineProperty(t, 'DeclareInterface', {
+ enumerable: true,
+ get: function () {
+ return s.declareInterface;
+ },
+ });
+ Object.defineProperty(t, 'DeclareModule', {
+ enumerable: true,
+ get: function () {
+ return s.declareModule;
+ },
+ });
+ Object.defineProperty(t, 'DeclareModuleExports', {
+ enumerable: true,
+ get: function () {
+ return s.declareModuleExports;
+ },
+ });
+ Object.defineProperty(t, 'DeclareOpaqueType', {
+ enumerable: true,
+ get: function () {
+ return s.declareOpaqueType;
+ },
+ });
+ Object.defineProperty(t, 'DeclareTypeAlias', {
+ enumerable: true,
+ get: function () {
+ return s.declareTypeAlias;
+ },
+ });
+ Object.defineProperty(t, 'DeclareVariable', {
+ enumerable: true,
+ get: function () {
+ return s.declareVariable;
+ },
+ });
+ Object.defineProperty(t, 'DeclaredPredicate', {
+ enumerable: true,
+ get: function () {
+ return s.declaredPredicate;
+ },
+ });
+ Object.defineProperty(t, 'Decorator', {
+ enumerable: true,
+ get: function () {
+ return s.decorator;
+ },
+ });
+ Object.defineProperty(t, 'Directive', {
+ enumerable: true,
+ get: function () {
+ return s.directive;
+ },
+ });
+ Object.defineProperty(t, 'DirectiveLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.directiveLiteral;
+ },
+ });
+ Object.defineProperty(t, 'DoExpression', {
+ enumerable: true,
+ get: function () {
+ return s.doExpression;
+ },
+ });
+ Object.defineProperty(t, 'DoWhileStatement', {
+ enumerable: true,
+ get: function () {
+ return s.doWhileStatement;
+ },
+ });
+ Object.defineProperty(t, 'EmptyStatement', {
+ enumerable: true,
+ get: function () {
+ return s.emptyStatement;
+ },
+ });
+ Object.defineProperty(t, 'EmptyTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.emptyTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'EnumBooleanBody', {
+ enumerable: true,
+ get: function () {
+ return s.enumBooleanBody;
+ },
+ });
+ Object.defineProperty(t, 'EnumBooleanMember', {
+ enumerable: true,
+ get: function () {
+ return s.enumBooleanMember;
+ },
+ });
+ Object.defineProperty(t, 'EnumDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.enumDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'EnumDefaultedMember', {
+ enumerable: true,
+ get: function () {
+ return s.enumDefaultedMember;
+ },
+ });
+ Object.defineProperty(t, 'EnumNumberBody', {
+ enumerable: true,
+ get: function () {
+ return s.enumNumberBody;
+ },
+ });
+ Object.defineProperty(t, 'EnumNumberMember', {
+ enumerable: true,
+ get: function () {
+ return s.enumNumberMember;
+ },
+ });
+ Object.defineProperty(t, 'EnumStringBody', {
+ enumerable: true,
+ get: function () {
+ return s.enumStringBody;
+ },
+ });
+ Object.defineProperty(t, 'EnumStringMember', {
+ enumerable: true,
+ get: function () {
+ return s.enumStringMember;
+ },
+ });
+ Object.defineProperty(t, 'EnumSymbolBody', {
+ enumerable: true,
+ get: function () {
+ return s.enumSymbolBody;
+ },
+ });
+ Object.defineProperty(t, 'ExistsTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.existsTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'ExportAllDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.exportAllDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'ExportDefaultDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.exportDefaultDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'ExportDefaultSpecifier', {
+ enumerable: true,
+ get: function () {
+ return s.exportDefaultSpecifier;
+ },
+ });
+ Object.defineProperty(t, 'ExportNamedDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.exportNamedDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'ExportNamespaceSpecifier', {
+ enumerable: true,
+ get: function () {
+ return s.exportNamespaceSpecifier;
+ },
+ });
+ Object.defineProperty(t, 'ExportSpecifier', {
+ enumerable: true,
+ get: function () {
+ return s.exportSpecifier;
+ },
+ });
+ Object.defineProperty(t, 'ExpressionStatement', {
+ enumerable: true,
+ get: function () {
+ return s.expressionStatement;
+ },
+ });
+ Object.defineProperty(t, 'File', {
+ enumerable: true,
+ get: function () {
+ return s.file;
+ },
+ });
+ Object.defineProperty(t, 'ForInStatement', {
+ enumerable: true,
+ get: function () {
+ return s.forInStatement;
+ },
+ });
+ Object.defineProperty(t, 'ForOfStatement', {
+ enumerable: true,
+ get: function () {
+ return s.forOfStatement;
+ },
+ });
+ Object.defineProperty(t, 'ForStatement', {
+ enumerable: true,
+ get: function () {
+ return s.forStatement;
+ },
+ });
+ Object.defineProperty(t, 'FunctionDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.functionDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'FunctionExpression', {
+ enumerable: true,
+ get: function () {
+ return s.functionExpression;
+ },
+ });
+ Object.defineProperty(t, 'FunctionTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.functionTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'FunctionTypeParam', {
+ enumerable: true,
+ get: function () {
+ return s.functionTypeParam;
+ },
+ });
+ Object.defineProperty(t, 'GenericTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.genericTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'Identifier', {
+ enumerable: true,
+ get: function () {
+ return s.identifier;
+ },
+ });
+ Object.defineProperty(t, 'IfStatement', {
+ enumerable: true,
+ get: function () {
+ return s.ifStatement;
+ },
+ });
+ Object.defineProperty(t, 'Import', {
+ enumerable: true,
+ get: function () {
+ return s.import;
+ },
+ });
+ Object.defineProperty(t, 'ImportAttribute', {
+ enumerable: true,
+ get: function () {
+ return s.importAttribute;
+ },
+ });
+ Object.defineProperty(t, 'ImportDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.importDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'ImportDefaultSpecifier', {
+ enumerable: true,
+ get: function () {
+ return s.importDefaultSpecifier;
+ },
+ });
+ Object.defineProperty(t, 'ImportExpression', {
+ enumerable: true,
+ get: function () {
+ return s.importExpression;
+ },
+ });
+ Object.defineProperty(t, 'ImportNamespaceSpecifier', {
+ enumerable: true,
+ get: function () {
+ return s.importNamespaceSpecifier;
+ },
+ });
+ Object.defineProperty(t, 'ImportSpecifier', {
+ enumerable: true,
+ get: function () {
+ return s.importSpecifier;
+ },
+ });
+ Object.defineProperty(t, 'IndexedAccessType', {
+ enumerable: true,
+ get: function () {
+ return s.indexedAccessType;
+ },
+ });
+ Object.defineProperty(t, 'InferredPredicate', {
+ enumerable: true,
+ get: function () {
+ return s.inferredPredicate;
+ },
+ });
+ Object.defineProperty(t, 'InterfaceDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.interfaceDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'InterfaceExtends', {
+ enumerable: true,
+ get: function () {
+ return s.interfaceExtends;
+ },
+ });
+ Object.defineProperty(t, 'InterfaceTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.interfaceTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'InterpreterDirective', {
+ enumerable: true,
+ get: function () {
+ return s.interpreterDirective;
+ },
+ });
+ Object.defineProperty(t, 'IntersectionTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.intersectionTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'JSXAttribute', {
+ enumerable: true,
+ get: function () {
+ return s.jsxAttribute;
+ },
+ });
+ Object.defineProperty(t, 'JSXClosingElement', {
+ enumerable: true,
+ get: function () {
+ return s.jsxClosingElement;
+ },
+ });
+ Object.defineProperty(t, 'JSXClosingFragment', {
+ enumerable: true,
+ get: function () {
+ return s.jsxClosingFragment;
+ },
+ });
+ Object.defineProperty(t, 'JSXElement', {
+ enumerable: true,
+ get: function () {
+ return s.jsxElement;
+ },
+ });
+ Object.defineProperty(t, 'JSXEmptyExpression', {
+ enumerable: true,
+ get: function () {
+ return s.jsxEmptyExpression;
+ },
+ });
+ Object.defineProperty(t, 'JSXExpressionContainer', {
+ enumerable: true,
+ get: function () {
+ return s.jsxExpressionContainer;
+ },
+ });
+ Object.defineProperty(t, 'JSXFragment', {
+ enumerable: true,
+ get: function () {
+ return s.jsxFragment;
+ },
+ });
+ Object.defineProperty(t, 'JSXIdentifier', {
+ enumerable: true,
+ get: function () {
+ return s.jsxIdentifier;
+ },
+ });
+ Object.defineProperty(t, 'JSXMemberExpression', {
+ enumerable: true,
+ get: function () {
+ return s.jsxMemberExpression;
+ },
+ });
+ Object.defineProperty(t, 'JSXNamespacedName', {
+ enumerable: true,
+ get: function () {
+ return s.jsxNamespacedName;
+ },
+ });
+ Object.defineProperty(t, 'JSXOpeningElement', {
+ enumerable: true,
+ get: function () {
+ return s.jsxOpeningElement;
+ },
+ });
+ Object.defineProperty(t, 'JSXOpeningFragment', {
+ enumerable: true,
+ get: function () {
+ return s.jsxOpeningFragment;
+ },
+ });
+ Object.defineProperty(t, 'JSXSpreadAttribute', {
+ enumerable: true,
+ get: function () {
+ return s.jsxSpreadAttribute;
+ },
+ });
+ Object.defineProperty(t, 'JSXSpreadChild', {
+ enumerable: true,
+ get: function () {
+ return s.jsxSpreadChild;
+ },
+ });
+ Object.defineProperty(t, 'JSXText', {
+ enumerable: true,
+ get: function () {
+ return s.jsxText;
+ },
+ });
+ Object.defineProperty(t, 'LabeledStatement', {
+ enumerable: true,
+ get: function () {
+ return s.labeledStatement;
+ },
+ });
+ Object.defineProperty(t, 'LogicalExpression', {
+ enumerable: true,
+ get: function () {
+ return s.logicalExpression;
+ },
+ });
+ Object.defineProperty(t, 'MemberExpression', {
+ enumerable: true,
+ get: function () {
+ return s.memberExpression;
+ },
+ });
+ Object.defineProperty(t, 'MetaProperty', {
+ enumerable: true,
+ get: function () {
+ return s.metaProperty;
+ },
+ });
+ Object.defineProperty(t, 'MixedTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.mixedTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'ModuleExpression', {
+ enumerable: true,
+ get: function () {
+ return s.moduleExpression;
+ },
+ });
+ Object.defineProperty(t, 'NewExpression', {
+ enumerable: true,
+ get: function () {
+ return s.newExpression;
+ },
+ });
+ Object.defineProperty(t, 'Noop', {
+ enumerable: true,
+ get: function () {
+ return s.noop;
+ },
+ });
+ Object.defineProperty(t, 'NullLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.nullLiteral;
+ },
+ });
+ Object.defineProperty(t, 'NullLiteralTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.nullLiteralTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'NullableTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.nullableTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'NumberLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.numberLiteral;
+ },
+ });
+ Object.defineProperty(t, 'NumberLiteralTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.numberLiteralTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'NumberTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.numberTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'NumericLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.numericLiteral;
+ },
+ });
+ Object.defineProperty(t, 'ObjectExpression', {
+ enumerable: true,
+ get: function () {
+ return s.objectExpression;
+ },
+ });
+ Object.defineProperty(t, 'ObjectMethod', {
+ enumerable: true,
+ get: function () {
+ return s.objectMethod;
+ },
+ });
+ Object.defineProperty(t, 'ObjectPattern', {
+ enumerable: true,
+ get: function () {
+ return s.objectPattern;
+ },
+ });
+ Object.defineProperty(t, 'ObjectProperty', {
+ enumerable: true,
+ get: function () {
+ return s.objectProperty;
+ },
+ });
+ Object.defineProperty(t, 'ObjectTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.objectTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'ObjectTypeCallProperty', {
+ enumerable: true,
+ get: function () {
+ return s.objectTypeCallProperty;
+ },
+ });
+ Object.defineProperty(t, 'ObjectTypeIndexer', {
+ enumerable: true,
+ get: function () {
+ return s.objectTypeIndexer;
+ },
+ });
+ Object.defineProperty(t, 'ObjectTypeInternalSlot', {
+ enumerable: true,
+ get: function () {
+ return s.objectTypeInternalSlot;
+ },
+ });
+ Object.defineProperty(t, 'ObjectTypeProperty', {
+ enumerable: true,
+ get: function () {
+ return s.objectTypeProperty;
+ },
+ });
+ Object.defineProperty(t, 'ObjectTypeSpreadProperty', {
+ enumerable: true,
+ get: function () {
+ return s.objectTypeSpreadProperty;
+ },
+ });
+ Object.defineProperty(t, 'OpaqueType', {
+ enumerable: true,
+ get: function () {
+ return s.opaqueType;
+ },
+ });
+ Object.defineProperty(t, 'OptionalCallExpression', {
+ enumerable: true,
+ get: function () {
+ return s.optionalCallExpression;
+ },
+ });
+ Object.defineProperty(t, 'OptionalIndexedAccessType', {
+ enumerable: true,
+ get: function () {
+ return s.optionalIndexedAccessType;
+ },
+ });
+ Object.defineProperty(t, 'OptionalMemberExpression', {
+ enumerable: true,
+ get: function () {
+ return s.optionalMemberExpression;
+ },
+ });
+ Object.defineProperty(t, 'ParenthesizedExpression', {
+ enumerable: true,
+ get: function () {
+ return s.parenthesizedExpression;
+ },
+ });
+ Object.defineProperty(t, 'PipelineBareFunction', {
+ enumerable: true,
+ get: function () {
+ return s.pipelineBareFunction;
+ },
+ });
+ Object.defineProperty(t, 'PipelinePrimaryTopicReference', {
+ enumerable: true,
+ get: function () {
+ return s.pipelinePrimaryTopicReference;
+ },
+ });
+ Object.defineProperty(t, 'PipelineTopicExpression', {
+ enumerable: true,
+ get: function () {
+ return s.pipelineTopicExpression;
+ },
+ });
+ Object.defineProperty(t, 'Placeholder', {
+ enumerable: true,
+ get: function () {
+ return s.placeholder;
+ },
+ });
+ Object.defineProperty(t, 'PrivateName', {
+ enumerable: true,
+ get: function () {
+ return s.privateName;
+ },
+ });
+ Object.defineProperty(t, 'Program', {
+ enumerable: true,
+ get: function () {
+ return s.program;
+ },
+ });
+ Object.defineProperty(t, 'QualifiedTypeIdentifier', {
+ enumerable: true,
+ get: function () {
+ return s.qualifiedTypeIdentifier;
+ },
+ });
+ Object.defineProperty(t, 'RecordExpression', {
+ enumerable: true,
+ get: function () {
+ return s.recordExpression;
+ },
+ });
+ Object.defineProperty(t, 'RegExpLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.regExpLiteral;
+ },
+ });
+ Object.defineProperty(t, 'RegexLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.regexLiteral;
+ },
+ });
+ Object.defineProperty(t, 'RestElement', {
+ enumerable: true,
+ get: function () {
+ return s.restElement;
+ },
+ });
+ Object.defineProperty(t, 'RestProperty', {
+ enumerable: true,
+ get: function () {
+ return s.restProperty;
+ },
+ });
+ Object.defineProperty(t, 'ReturnStatement', {
+ enumerable: true,
+ get: function () {
+ return s.returnStatement;
+ },
+ });
+ Object.defineProperty(t, 'SequenceExpression', {
+ enumerable: true,
+ get: function () {
+ return s.sequenceExpression;
+ },
+ });
+ Object.defineProperty(t, 'SpreadElement', {
+ enumerable: true,
+ get: function () {
+ return s.spreadElement;
+ },
+ });
+ Object.defineProperty(t, 'SpreadProperty', {
+ enumerable: true,
+ get: function () {
+ return s.spreadProperty;
+ },
+ });
+ Object.defineProperty(t, 'StaticBlock', {
+ enumerable: true,
+ get: function () {
+ return s.staticBlock;
+ },
+ });
+ Object.defineProperty(t, 'StringLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.stringLiteral;
+ },
+ });
+ Object.defineProperty(t, 'StringLiteralTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.stringLiteralTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'StringTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.stringTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'Super', {
+ enumerable: true,
+ get: function () {
+ return s.super;
+ },
+ });
+ Object.defineProperty(t, 'SwitchCase', {
+ enumerable: true,
+ get: function () {
+ return s.switchCase;
+ },
+ });
+ Object.defineProperty(t, 'SwitchStatement', {
+ enumerable: true,
+ get: function () {
+ return s.switchStatement;
+ },
+ });
+ Object.defineProperty(t, 'SymbolTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.symbolTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'TSAnyKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsAnyKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSArrayType', {
+ enumerable: true,
+ get: function () {
+ return s.tsArrayType;
+ },
+ });
+ Object.defineProperty(t, 'TSAsExpression', {
+ enumerable: true,
+ get: function () {
+ return s.tsAsExpression;
+ },
+ });
+ Object.defineProperty(t, 'TSBigIntKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsBigIntKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSBooleanKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsBooleanKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSCallSignatureDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.tsCallSignatureDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TSConditionalType', {
+ enumerable: true,
+ get: function () {
+ return s.tsConditionalType;
+ },
+ });
+ Object.defineProperty(t, 'TSConstructSignatureDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.tsConstructSignatureDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TSConstructorType', {
+ enumerable: true,
+ get: function () {
+ return s.tsConstructorType;
+ },
+ });
+ Object.defineProperty(t, 'TSDeclareFunction', {
+ enumerable: true,
+ get: function () {
+ return s.tsDeclareFunction;
+ },
+ });
+ Object.defineProperty(t, 'TSDeclareMethod', {
+ enumerable: true,
+ get: function () {
+ return s.tsDeclareMethod;
+ },
+ });
+ Object.defineProperty(t, 'TSEnumDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.tsEnumDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TSEnumMember', {
+ enumerable: true,
+ get: function () {
+ return s.tsEnumMember;
+ },
+ });
+ Object.defineProperty(t, 'TSExportAssignment', {
+ enumerable: true,
+ get: function () {
+ return s.tsExportAssignment;
+ },
+ });
+ Object.defineProperty(t, 'TSExpressionWithTypeArguments', {
+ enumerable: true,
+ get: function () {
+ return s.tsExpressionWithTypeArguments;
+ },
+ });
+ Object.defineProperty(t, 'TSExternalModuleReference', {
+ enumerable: true,
+ get: function () {
+ return s.tsExternalModuleReference;
+ },
+ });
+ Object.defineProperty(t, 'TSFunctionType', {
+ enumerable: true,
+ get: function () {
+ return s.tsFunctionType;
+ },
+ });
+ Object.defineProperty(t, 'TSImportEqualsDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.tsImportEqualsDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TSImportType', {
+ enumerable: true,
+ get: function () {
+ return s.tsImportType;
+ },
+ });
+ Object.defineProperty(t, 'TSIndexSignature', {
+ enumerable: true,
+ get: function () {
+ return s.tsIndexSignature;
+ },
+ });
+ Object.defineProperty(t, 'TSIndexedAccessType', {
+ enumerable: true,
+ get: function () {
+ return s.tsIndexedAccessType;
+ },
+ });
+ Object.defineProperty(t, 'TSInferType', {
+ enumerable: true,
+ get: function () {
+ return s.tsInferType;
+ },
+ });
+ Object.defineProperty(t, 'TSInstantiationExpression', {
+ enumerable: true,
+ get: function () {
+ return s.tsInstantiationExpression;
+ },
+ });
+ Object.defineProperty(t, 'TSInterfaceBody', {
+ enumerable: true,
+ get: function () {
+ return s.tsInterfaceBody;
+ },
+ });
+ Object.defineProperty(t, 'TSInterfaceDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.tsInterfaceDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TSIntersectionType', {
+ enumerable: true,
+ get: function () {
+ return s.tsIntersectionType;
+ },
+ });
+ Object.defineProperty(t, 'TSIntrinsicKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsIntrinsicKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSLiteralType', {
+ enumerable: true,
+ get: function () {
+ return s.tsLiteralType;
+ },
+ });
+ Object.defineProperty(t, 'TSMappedType', {
+ enumerable: true,
+ get: function () {
+ return s.tsMappedType;
+ },
+ });
+ Object.defineProperty(t, 'TSMethodSignature', {
+ enumerable: true,
+ get: function () {
+ return s.tsMethodSignature;
+ },
+ });
+ Object.defineProperty(t, 'TSModuleBlock', {
+ enumerable: true,
+ get: function () {
+ return s.tsModuleBlock;
+ },
+ });
+ Object.defineProperty(t, 'TSModuleDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.tsModuleDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TSNamedTupleMember', {
+ enumerable: true,
+ get: function () {
+ return s.tsNamedTupleMember;
+ },
+ });
+ Object.defineProperty(t, 'TSNamespaceExportDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.tsNamespaceExportDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TSNeverKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsNeverKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSNonNullExpression', {
+ enumerable: true,
+ get: function () {
+ return s.tsNonNullExpression;
+ },
+ });
+ Object.defineProperty(t, 'TSNullKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsNullKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSNumberKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsNumberKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSObjectKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsObjectKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSOptionalType', {
+ enumerable: true,
+ get: function () {
+ return s.tsOptionalType;
+ },
+ });
+ Object.defineProperty(t, 'TSParameterProperty', {
+ enumerable: true,
+ get: function () {
+ return s.tsParameterProperty;
+ },
+ });
+ Object.defineProperty(t, 'TSParenthesizedType', {
+ enumerable: true,
+ get: function () {
+ return s.tsParenthesizedType;
+ },
+ });
+ Object.defineProperty(t, 'TSPropertySignature', {
+ enumerable: true,
+ get: function () {
+ return s.tsPropertySignature;
+ },
+ });
+ Object.defineProperty(t, 'TSQualifiedName', {
+ enumerable: true,
+ get: function () {
+ return s.tsQualifiedName;
+ },
+ });
+ Object.defineProperty(t, 'TSRestType', {
+ enumerable: true,
+ get: function () {
+ return s.tsRestType;
+ },
+ });
+ Object.defineProperty(t, 'TSSatisfiesExpression', {
+ enumerable: true,
+ get: function () {
+ return s.tsSatisfiesExpression;
+ },
+ });
+ Object.defineProperty(t, 'TSStringKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsStringKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSSymbolKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsSymbolKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSThisType', {
+ enumerable: true,
+ get: function () {
+ return s.tsThisType;
+ },
+ });
+ Object.defineProperty(t, 'TSTupleType', {
+ enumerable: true,
+ get: function () {
+ return s.tsTupleType;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeAliasDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeAliasDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeAssertion', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeAssertion;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeLiteral;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeOperator', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeOperator;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeParameter', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeParameter;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeParameterDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeParameterDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeParameterInstantiation', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeParameterInstantiation;
+ },
+ });
+ Object.defineProperty(t, 'TSTypePredicate', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypePredicate;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeQuery', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeQuery;
+ },
+ });
+ Object.defineProperty(t, 'TSTypeReference', {
+ enumerable: true,
+ get: function () {
+ return s.tsTypeReference;
+ },
+ });
+ Object.defineProperty(t, 'TSUndefinedKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsUndefinedKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSUnionType', {
+ enumerable: true,
+ get: function () {
+ return s.tsUnionType;
+ },
+ });
+ Object.defineProperty(t, 'TSUnknownKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsUnknownKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TSVoidKeyword', {
+ enumerable: true,
+ get: function () {
+ return s.tsVoidKeyword;
+ },
+ });
+ Object.defineProperty(t, 'TaggedTemplateExpression', {
+ enumerable: true,
+ get: function () {
+ return s.taggedTemplateExpression;
+ },
+ });
+ Object.defineProperty(t, 'TemplateElement', {
+ enumerable: true,
+ get: function () {
+ return s.templateElement;
+ },
+ });
+ Object.defineProperty(t, 'TemplateLiteral', {
+ enumerable: true,
+ get: function () {
+ return s.templateLiteral;
+ },
+ });
+ Object.defineProperty(t, 'ThisExpression', {
+ enumerable: true,
+ get: function () {
+ return s.thisExpression;
+ },
+ });
+ Object.defineProperty(t, 'ThisTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.thisTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'ThrowStatement', {
+ enumerable: true,
+ get: function () {
+ return s.throwStatement;
+ },
+ });
+ Object.defineProperty(t, 'TopicReference', {
+ enumerable: true,
+ get: function () {
+ return s.topicReference;
+ },
+ });
+ Object.defineProperty(t, 'TryStatement', {
+ enumerable: true,
+ get: function () {
+ return s.tryStatement;
+ },
+ });
+ Object.defineProperty(t, 'TupleExpression', {
+ enumerable: true,
+ get: function () {
+ return s.tupleExpression;
+ },
+ });
+ Object.defineProperty(t, 'TupleTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.tupleTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'TypeAlias', {
+ enumerable: true,
+ get: function () {
+ return s.typeAlias;
+ },
+ });
+ Object.defineProperty(t, 'TypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.typeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'TypeCastExpression', {
+ enumerable: true,
+ get: function () {
+ return s.typeCastExpression;
+ },
+ });
+ Object.defineProperty(t, 'TypeParameter', {
+ enumerable: true,
+ get: function () {
+ return s.typeParameter;
+ },
+ });
+ Object.defineProperty(t, 'TypeParameterDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.typeParameterDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'TypeParameterInstantiation', {
+ enumerable: true,
+ get: function () {
+ return s.typeParameterInstantiation;
+ },
+ });
+ Object.defineProperty(t, 'TypeofTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.typeofTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'UnaryExpression', {
+ enumerable: true,
+ get: function () {
+ return s.unaryExpression;
+ },
+ });
+ Object.defineProperty(t, 'UnionTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.unionTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'UpdateExpression', {
+ enumerable: true,
+ get: function () {
+ return s.updateExpression;
+ },
+ });
+ Object.defineProperty(t, 'V8IntrinsicIdentifier', {
+ enumerable: true,
+ get: function () {
+ return s.v8IntrinsicIdentifier;
+ },
+ });
+ Object.defineProperty(t, 'VariableDeclaration', {
+ enumerable: true,
+ get: function () {
+ return s.variableDeclaration;
+ },
+ });
+ Object.defineProperty(t, 'VariableDeclarator', {
+ enumerable: true,
+ get: function () {
+ return s.variableDeclarator;
+ },
+ });
+ Object.defineProperty(t, 'Variance', {
+ enumerable: true,
+ get: function () {
+ return s.variance;
+ },
+ });
+ Object.defineProperty(t, 'VoidTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return s.voidTypeAnnotation;
+ },
+ });
+ Object.defineProperty(t, 'WhileStatement', {
+ enumerable: true,
+ get: function () {
+ return s.whileStatement;
+ },
+ });
+ Object.defineProperty(t, 'WithStatement', {
+ enumerable: true,
+ get: function () {
+ return s.withStatement;
+ },
+ });
+ Object.defineProperty(t, 'YieldExpression', {
+ enumerable: true,
+ get: function () {
+ return s.yieldExpression;
+ },
+ });
+ var s = r(397);
+ },
+ 5673: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.buildUndefinedNode = buildUndefinedNode;
+ var s = r(397);
+ function buildUndefinedNode() {
+ return (0, s.unaryExpression)('void', (0, s.numericLiteral)(0), true);
+ }
+ },
+ 3718: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = buildChildren;
+ var s = r(6428);
+ var i = r(485);
+ function buildChildren(e) {
+ const t = [];
+ for (let r = 0; r < e.children.length; r++) {
+ let n = e.children[r];
+ if ((0, s.isJSXText)(n)) {
+ (0, i.default)(n, t);
+ continue;
+ }
+ if ((0, s.isJSXExpressionContainer)(n)) n = n.expression;
+ if ((0, s.isJSXEmptyExpression)(n)) continue;
+ t.push(n);
+ }
+ return t;
+ }
+ },
+ 1094: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = createTSUnionType;
+ var s = r(397);
+ var i = r(2832);
+ var n = r(6428);
+ function createTSUnionType(e) {
+ const t = e.map((e) =>
+ (0, n.isTSTypeAnnotation)(e) ? e.typeAnnotation : e,
+ );
+ const r = (0, i.default)(t);
+ if (r.length === 1) {
+ return r[0];
+ } else {
+ return (0, s.tsUnionType)(r);
+ }
+ }
+ },
+ 9836: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = validateNode;
+ var s = r(7159);
+ var i = r(4739);
+ function validateNode(e) {
+ const t = i.BUILDER_KEYS[e.type];
+ for (const r of t) {
+ (0, s.default)(e, r, e[r]);
+ }
+ return e;
+ }
+ },
+ 9906: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = clone;
+ var s = r(7421);
+ function clone(e) {
+ return (0, s.default)(e, false);
+ }
+ },
+ 6719: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = cloneDeep;
+ var s = r(7421);
+ function cloneDeep(e) {
+ return (0, s.default)(e);
+ }
+ },
+ 6489: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = cloneDeepWithoutLoc;
+ var s = r(7421);
+ function cloneDeepWithoutLoc(e) {
+ return (0, s.default)(e, true, true);
+ }
+ },
+ 7421: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = cloneNode;
+ var s = r(7405);
+ var i = r(6428);
+ const n = Function.call.bind(Object.prototype.hasOwnProperty);
+ function cloneIfNode(e, t, r, s) {
+ if (e && typeof e.type === 'string') {
+ return cloneNodeInternal(e, t, r, s);
+ }
+ return e;
+ }
+ function cloneIfNodeOrArray(e, t, r, s) {
+ if (Array.isArray(e)) {
+ return e.map((e) => cloneIfNode(e, t, r, s));
+ }
+ return cloneIfNode(e, t, r, s);
+ }
+ function cloneNode(e, t = true, r = false) {
+ return cloneNodeInternal(e, t, r, new Map());
+ }
+ function cloneNodeInternal(e, t = true, r = false, a) {
+ if (!e) return e;
+ const { type: o } = e;
+ const l = { type: e.type };
+ if ((0, i.isIdentifier)(e)) {
+ l.name = e.name;
+ if (n(e, 'optional') && typeof e.optional === 'boolean') {
+ l.optional = e.optional;
+ }
+ if (n(e, 'typeAnnotation')) {
+ l.typeAnnotation = t
+ ? cloneIfNodeOrArray(e.typeAnnotation, true, r, a)
+ : e.typeAnnotation;
+ }
+ } else if (!n(s.NODE_FIELDS, o)) {
+ throw new Error(`Unknown node type: "${o}"`);
+ } else {
+ for (const c of Object.keys(s.NODE_FIELDS[o])) {
+ if (n(e, c)) {
+ if (t) {
+ l[c] =
+ (0, i.isFile)(e) && c === 'comments'
+ ? maybeCloneComments(e.comments, t, r, a)
+ : cloneIfNodeOrArray(e[c], true, r, a);
+ } else {
+ l[c] = e[c];
+ }
+ }
+ }
+ }
+ if (n(e, 'loc')) {
+ if (r) {
+ l.loc = null;
+ } else {
+ l.loc = e.loc;
+ }
+ }
+ if (n(e, 'leadingComments')) {
+ l.leadingComments = maybeCloneComments(e.leadingComments, t, r, a);
+ }
+ if (n(e, 'innerComments')) {
+ l.innerComments = maybeCloneComments(e.innerComments, t, r, a);
+ }
+ if (n(e, 'trailingComments')) {
+ l.trailingComments = maybeCloneComments(e.trailingComments, t, r, a);
+ }
+ if (n(e, 'extra')) {
+ l.extra = Object.assign({}, e.extra);
+ }
+ return l;
+ }
+ function maybeCloneComments(e, t, r, s) {
+ if (!e || !t) {
+ return e;
+ }
+ return e.map((e) => {
+ const t = s.get(e);
+ if (t) return t;
+ const { type: i, value: n, loc: a } = e;
+ const o = { type: i, value: n, loc: a };
+ if (r) {
+ o.loc = null;
+ }
+ s.set(e, o);
+ return o;
+ });
+ }
+ },
+ 1260: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = cloneWithoutLoc;
+ var s = r(7421);
+ function cloneWithoutLoc(e) {
+ return (0, s.default)(e, false, true);
+ }
+ },
+ 2227: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = addComment;
+ var s = r(9534);
+ function addComment(e, t, r, i) {
+ return (0, s.default)(e, t, [
+ { type: i ? 'CommentLine' : 'CommentBlock', value: r },
+ ]);
+ }
+ },
+ 9534: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = addComments;
+ function addComments(e, t, r) {
+ if (!r || !e) return e;
+ const s = `${t}Comments`;
+ if (e[s]) {
+ if (t === 'leading') {
+ e[s] = r.concat(e[s]);
+ } else {
+ e[s].push(...r);
+ }
+ } else {
+ e[s] = r;
+ }
+ return e;
+ }
+ },
+ 8898: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = inheritInnerComments;
+ var s = r(778);
+ function inheritInnerComments(e, t) {
+ (0, s.default)('innerComments', e, t);
+ }
+ },
+ 5689: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = inheritLeadingComments;
+ var s = r(778);
+ function inheritLeadingComments(e, t) {
+ (0, s.default)('leadingComments', e, t);
+ }
+ },
+ 3146: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = inheritTrailingComments;
+ var s = r(778);
+ function inheritTrailingComments(e, t) {
+ (0, s.default)('trailingComments', e, t);
+ }
+ },
+ 8237: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = inheritsComments;
+ var s = r(3146);
+ var i = r(5689);
+ var n = r(8898);
+ function inheritsComments(e, t) {
+ (0, s.default)(e, t);
+ (0, i.default)(e, t);
+ (0, n.default)(e, t);
+ return e;
+ }
+ },
+ 6267: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = removeComments;
+ var s = r(1227);
+ function removeComments(e) {
+ s.COMMENT_KEYS.forEach((t) => {
+ e[t] = null;
+ });
+ return e;
+ }
+ },
+ 8178: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.WHILE_TYPES =
+ t.USERWHITESPACABLE_TYPES =
+ t.UNARYLIKE_TYPES =
+ t.TYPESCRIPT_TYPES =
+ t.TSTYPE_TYPES =
+ t.TSTYPEELEMENT_TYPES =
+ t.TSENTITYNAME_TYPES =
+ t.TSBASETYPE_TYPES =
+ t.TERMINATORLESS_TYPES =
+ t.STATEMENT_TYPES =
+ t.STANDARDIZED_TYPES =
+ t.SCOPABLE_TYPES =
+ t.PUREISH_TYPES =
+ t.PROPERTY_TYPES =
+ t.PRIVATE_TYPES =
+ t.PATTERN_TYPES =
+ t.PATTERNLIKE_TYPES =
+ t.OBJECTMEMBER_TYPES =
+ t.MODULESPECIFIER_TYPES =
+ t.MODULEDECLARATION_TYPES =
+ t.MISCELLANEOUS_TYPES =
+ t.METHOD_TYPES =
+ t.LVAL_TYPES =
+ t.LOOP_TYPES =
+ t.LITERAL_TYPES =
+ t.JSX_TYPES =
+ t.IMPORTOREXPORTDECLARATION_TYPES =
+ t.IMMUTABLE_TYPES =
+ t.FUNCTION_TYPES =
+ t.FUNCTIONPARENT_TYPES =
+ t.FOR_TYPES =
+ t.FORXSTATEMENT_TYPES =
+ t.FLOW_TYPES =
+ t.FLOWTYPE_TYPES =
+ t.FLOWPREDICATE_TYPES =
+ t.FLOWDECLARATION_TYPES =
+ t.FLOWBASEANNOTATION_TYPES =
+ t.EXPRESSION_TYPES =
+ t.EXPRESSIONWRAPPER_TYPES =
+ t.EXPORTDECLARATION_TYPES =
+ t.ENUMMEMBER_TYPES =
+ t.ENUMBODY_TYPES =
+ t.DECLARATION_TYPES =
+ t.CONDITIONAL_TYPES =
+ t.COMPLETIONSTATEMENT_TYPES =
+ t.CLASS_TYPES =
+ t.BLOCK_TYPES =
+ t.BLOCKPARENT_TYPES =
+ t.BINARY_TYPES =
+ t.ACCESSOR_TYPES =
+ void 0;
+ var s = r(7405);
+ const i = (t.STANDARDIZED_TYPES = s.FLIPPED_ALIAS_KEYS['Standardized']);
+ const n = (t.EXPRESSION_TYPES = s.FLIPPED_ALIAS_KEYS['Expression']);
+ const a = (t.BINARY_TYPES = s.FLIPPED_ALIAS_KEYS['Binary']);
+ const o = (t.SCOPABLE_TYPES = s.FLIPPED_ALIAS_KEYS['Scopable']);
+ const l = (t.BLOCKPARENT_TYPES = s.FLIPPED_ALIAS_KEYS['BlockParent']);
+ const c = (t.BLOCK_TYPES = s.FLIPPED_ALIAS_KEYS['Block']);
+ const p = (t.STATEMENT_TYPES = s.FLIPPED_ALIAS_KEYS['Statement']);
+ const u = (t.TERMINATORLESS_TYPES =
+ s.FLIPPED_ALIAS_KEYS['Terminatorless']);
+ const d = (t.COMPLETIONSTATEMENT_TYPES =
+ s.FLIPPED_ALIAS_KEYS['CompletionStatement']);
+ const f = (t.CONDITIONAL_TYPES = s.FLIPPED_ALIAS_KEYS['Conditional']);
+ const h = (t.LOOP_TYPES = s.FLIPPED_ALIAS_KEYS['Loop']);
+ const y = (t.WHILE_TYPES = s.FLIPPED_ALIAS_KEYS['While']);
+ const m = (t.EXPRESSIONWRAPPER_TYPES =
+ s.FLIPPED_ALIAS_KEYS['ExpressionWrapper']);
+ const T = (t.FOR_TYPES = s.FLIPPED_ALIAS_KEYS['For']);
+ const S = (t.FORXSTATEMENT_TYPES = s.FLIPPED_ALIAS_KEYS['ForXStatement']);
+ const x = (t.FUNCTION_TYPES = s.FLIPPED_ALIAS_KEYS['Function']);
+ const b = (t.FUNCTIONPARENT_TYPES =
+ s.FLIPPED_ALIAS_KEYS['FunctionParent']);
+ const E = (t.PUREISH_TYPES = s.FLIPPED_ALIAS_KEYS['Pureish']);
+ const P = (t.DECLARATION_TYPES = s.FLIPPED_ALIAS_KEYS['Declaration']);
+ const g = (t.PATTERNLIKE_TYPES = s.FLIPPED_ALIAS_KEYS['PatternLike']);
+ const A = (t.LVAL_TYPES = s.FLIPPED_ALIAS_KEYS['LVal']);
+ const v = (t.TSENTITYNAME_TYPES = s.FLIPPED_ALIAS_KEYS['TSEntityName']);
+ const I = (t.LITERAL_TYPES = s.FLIPPED_ALIAS_KEYS['Literal']);
+ const w = (t.IMMUTABLE_TYPES = s.FLIPPED_ALIAS_KEYS['Immutable']);
+ const N = (t.USERWHITESPACABLE_TYPES =
+ s.FLIPPED_ALIAS_KEYS['UserWhitespacable']);
+ const O = (t.METHOD_TYPES = s.FLIPPED_ALIAS_KEYS['Method']);
+ const C = (t.OBJECTMEMBER_TYPES = s.FLIPPED_ALIAS_KEYS['ObjectMember']);
+ const D = (t.PROPERTY_TYPES = s.FLIPPED_ALIAS_KEYS['Property']);
+ const k = (t.UNARYLIKE_TYPES = s.FLIPPED_ALIAS_KEYS['UnaryLike']);
+ const L = (t.PATTERN_TYPES = s.FLIPPED_ALIAS_KEYS['Pattern']);
+ const M = (t.CLASS_TYPES = s.FLIPPED_ALIAS_KEYS['Class']);
+ const j = (t.IMPORTOREXPORTDECLARATION_TYPES =
+ s.FLIPPED_ALIAS_KEYS['ImportOrExportDeclaration']);
+ const B = (t.EXPORTDECLARATION_TYPES =
+ s.FLIPPED_ALIAS_KEYS['ExportDeclaration']);
+ const F = (t.MODULESPECIFIER_TYPES =
+ s.FLIPPED_ALIAS_KEYS['ModuleSpecifier']);
+ const _ = (t.ACCESSOR_TYPES = s.FLIPPED_ALIAS_KEYS['Accessor']);
+ const R = (t.PRIVATE_TYPES = s.FLIPPED_ALIAS_KEYS['Private']);
+ const K = (t.FLOW_TYPES = s.FLIPPED_ALIAS_KEYS['Flow']);
+ const U = (t.FLOWTYPE_TYPES = s.FLIPPED_ALIAS_KEYS['FlowType']);
+ const V = (t.FLOWBASEANNOTATION_TYPES =
+ s.FLIPPED_ALIAS_KEYS['FlowBaseAnnotation']);
+ const X = (t.FLOWDECLARATION_TYPES =
+ s.FLIPPED_ALIAS_KEYS['FlowDeclaration']);
+ const J = (t.FLOWPREDICATE_TYPES = s.FLIPPED_ALIAS_KEYS['FlowPredicate']);
+ const Y = (t.ENUMBODY_TYPES = s.FLIPPED_ALIAS_KEYS['EnumBody']);
+ const W = (t.ENUMMEMBER_TYPES = s.FLIPPED_ALIAS_KEYS['EnumMember']);
+ const q = (t.JSX_TYPES = s.FLIPPED_ALIAS_KEYS['JSX']);
+ const $ = (t.MISCELLANEOUS_TYPES = s.FLIPPED_ALIAS_KEYS['Miscellaneous']);
+ const z = (t.TYPESCRIPT_TYPES = s.FLIPPED_ALIAS_KEYS['TypeScript']);
+ const H = (t.TSTYPEELEMENT_TYPES = s.FLIPPED_ALIAS_KEYS['TSTypeElement']);
+ const G = (t.TSTYPE_TYPES = s.FLIPPED_ALIAS_KEYS['TSType']);
+ const Q = (t.TSBASETYPE_TYPES = s.FLIPPED_ALIAS_KEYS['TSBaseType']);
+ const Z = (t.MODULEDECLARATION_TYPES = j);
+ },
+ 1227: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.UPDATE_OPERATORS =
+ t.UNARY_OPERATORS =
+ t.STRING_UNARY_OPERATORS =
+ t.STATEMENT_OR_BLOCK_KEYS =
+ t.NUMBER_UNARY_OPERATORS =
+ t.NUMBER_BINARY_OPERATORS =
+ t.NOT_LOCAL_BINDING =
+ t.LOGICAL_OPERATORS =
+ t.INHERIT_KEYS =
+ t.FOR_INIT_KEYS =
+ t.FLATTENABLE_KEYS =
+ t.EQUALITY_BINARY_OPERATORS =
+ t.COMPARISON_BINARY_OPERATORS =
+ t.COMMENT_KEYS =
+ t.BOOLEAN_UNARY_OPERATORS =
+ t.BOOLEAN_NUMBER_BINARY_OPERATORS =
+ t.BOOLEAN_BINARY_OPERATORS =
+ t.BLOCK_SCOPED_SYMBOL =
+ t.BINARY_OPERATORS =
+ t.ASSIGNMENT_OPERATORS =
+ void 0;
+ const r = (t.STATEMENT_OR_BLOCK_KEYS = [
+ 'consequent',
+ 'body',
+ 'alternate',
+ ]);
+ const s = (t.FLATTENABLE_KEYS = ['body', 'expressions']);
+ const i = (t.FOR_INIT_KEYS = ['left', 'init']);
+ const n = (t.COMMENT_KEYS = [
+ 'leadingComments',
+ 'trailingComments',
+ 'innerComments',
+ ]);
+ const a = (t.LOGICAL_OPERATORS = ['||', '&&', '??']);
+ const o = (t.UPDATE_OPERATORS = ['++', '--']);
+ const l = (t.BOOLEAN_NUMBER_BINARY_OPERATORS = ['>', '<', '>=', '<=']);
+ const c = (t.EQUALITY_BINARY_OPERATORS = ['==', '===', '!=', '!==']);
+ const p = (t.COMPARISON_BINARY_OPERATORS = [...c, 'in', 'instanceof']);
+ const u = (t.BOOLEAN_BINARY_OPERATORS = [...p, ...l]);
+ const d = (t.NUMBER_BINARY_OPERATORS = [
+ '-',
+ '/',
+ '%',
+ '*',
+ '**',
+ '&',
+ '|',
+ '>>',
+ '>>>',
+ '<<',
+ '^',
+ ]);
+ const f = (t.BINARY_OPERATORS = ['+', ...d, ...u, '|>']);
+ const h = (t.ASSIGNMENT_OPERATORS = [
+ '=',
+ '+=',
+ ...d.map((e) => e + '='),
+ ...a.map((e) => e + '='),
+ ]);
+ const y = (t.BOOLEAN_UNARY_OPERATORS = ['delete', '!']);
+ const m = (t.NUMBER_UNARY_OPERATORS = ['+', '-', '~']);
+ const T = (t.STRING_UNARY_OPERATORS = ['typeof']);
+ const S = (t.UNARY_OPERATORS = ['void', 'throw', ...y, ...m, ...T]);
+ const x = (t.INHERIT_KEYS = {
+ optional: ['typeAnnotation', 'typeParameters', 'returnType'],
+ force: ['start', 'loc', 'end'],
+ });
+ const b = (t.BLOCK_SCOPED_SYMBOL = Symbol.for(
+ 'var used to be block scoped',
+ ));
+ const E = (t.NOT_LOCAL_BINDING = Symbol.for(
+ 'should not be considered a local binding',
+ ));
+ },
+ 7158: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = ensureBlock;
+ var s = r(5013);
+ function ensureBlock(e, t = 'body') {
+ const r = (0, s.default)(e[t], e);
+ e[t] = r;
+ return r;
+ }
+ },
+ 1357: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = gatherSequenceExpressions;
+ var s = r(6675);
+ var i = r(6428);
+ var n = r(397);
+ var a = r(7421);
+ function gatherSequenceExpressions(e, t, r) {
+ const o = [];
+ let l = true;
+ for (const c of e) {
+ if (!(0, i.isEmptyStatement)(c)) {
+ l = false;
+ }
+ if ((0, i.isExpression)(c)) {
+ o.push(c);
+ } else if ((0, i.isExpressionStatement)(c)) {
+ o.push(c.expression);
+ } else if ((0, i.isVariableDeclaration)(c)) {
+ if (c.kind !== 'var') return;
+ for (const e of c.declarations) {
+ const t = (0, s.default)(e);
+ for (const e of Object.keys(t)) {
+ r.push({ kind: c.kind, id: (0, a.default)(t[e]) });
+ }
+ if (e.init) {
+ o.push((0, n.assignmentExpression)('=', e.id, e.init));
+ }
+ }
+ l = true;
+ } else if ((0, i.isIfStatement)(c)) {
+ const e = c.consequent
+ ? gatherSequenceExpressions([c.consequent], t, r)
+ : t.buildUndefinedNode();
+ const s = c.alternate
+ ? gatherSequenceExpressions([c.alternate], t, r)
+ : t.buildUndefinedNode();
+ if (!e || !s) return;
+ o.push((0, n.conditionalExpression)(c.test, e, s));
+ } else if ((0, i.isBlockStatement)(c)) {
+ const e = gatherSequenceExpressions(c.body, t, r);
+ if (!e) return;
+ o.push(e);
+ } else if ((0, i.isEmptyStatement)(c)) {
+ if (e.indexOf(c) === 0) {
+ l = true;
+ }
+ } else {
+ return;
+ }
+ }
+ if (l) {
+ o.push(t.buildUndefinedNode());
+ }
+ if (o.length === 1) {
+ return o[0];
+ } else {
+ return (0, n.sequenceExpression)(o);
+ }
+ }
+ },
+ 5999: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = toBindingIdentifierName;
+ var s = r(1868);
+ function toBindingIdentifierName(e) {
+ e = (0, s.default)(e);
+ if (e === 'eval' || e === 'arguments') e = '_' + e;
+ return e;
+ }
+ },
+ 5013: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = toBlock;
+ var s = r(6428);
+ var i = r(397);
+ function toBlock(e, t) {
+ if ((0, s.isBlockStatement)(e)) {
+ return e;
+ }
+ let r = [];
+ if ((0, s.isEmptyStatement)(e)) {
+ r = [];
+ } else {
+ if (!(0, s.isStatement)(e)) {
+ if ((0, s.isFunction)(t)) {
+ e = (0, i.returnStatement)(e);
+ } else {
+ e = (0, i.expressionStatement)(e);
+ }
+ }
+ r = [e];
+ }
+ return (0, i.blockStatement)(r);
+ }
+ },
+ 3317: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = toComputedKey;
+ var s = r(6428);
+ var i = r(397);
+ function toComputedKey(e, t = e.key || e.property) {
+ if (!e.computed && (0, s.isIdentifier)(t))
+ t = (0, i.stringLiteral)(t.name);
+ return t;
+ }
+ },
+ 9132: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = void 0;
+ var s = r(6428);
+ var i = (t['default'] = toExpression);
+ function toExpression(e) {
+ if ((0, s.isExpressionStatement)(e)) {
+ e = e.expression;
+ }
+ if ((0, s.isExpression)(e)) {
+ return e;
+ }
+ if ((0, s.isClass)(e)) {
+ e.type = 'ClassExpression';
+ } else if ((0, s.isFunction)(e)) {
+ e.type = 'FunctionExpression';
+ }
+ if (!(0, s.isExpression)(e)) {
+ throw new Error(`cannot turn ${e.type} to an expression`);
+ }
+ return e;
+ }
+ },
+ 1868: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = toIdentifier;
+ var s = r(9994);
+ var i = r(3442);
+ function toIdentifier(e) {
+ e = e + '';
+ let t = '';
+ for (const r of e) {
+ t += (0, i.isIdentifierChar)(r.codePointAt(0)) ? r : '-';
+ }
+ t = t.replace(/^[-0-9]+/, '');
+ t = t.replace(/[-\s]+(.)?/g, function (e, t) {
+ return t ? t.toUpperCase() : '';
+ });
+ if (!(0, s.default)(t)) {
+ t = `_${t}`;
+ }
+ return t || '_';
+ }
+ },
+ 1873: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = toKeyAlias;
+ var s = r(6428);
+ var i = r(7421);
+ var n = r(2735);
+ function toKeyAlias(e, t = e.key) {
+ let r;
+ if (e.kind === 'method') {
+ return toKeyAlias.increment() + '';
+ } else if ((0, s.isIdentifier)(t)) {
+ r = t.name;
+ } else if ((0, s.isStringLiteral)(t)) {
+ r = JSON.stringify(t.value);
+ } else {
+ r = JSON.stringify((0, n.default)((0, i.default)(t)));
+ }
+ if (e.computed) {
+ r = `[${r}]`;
+ }
+ if (e.static) {
+ r = `static:${r}`;
+ }
+ return r;
+ }
+ toKeyAlias.uid = 0;
+ toKeyAlias.increment = function () {
+ if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
+ return (toKeyAlias.uid = 0);
+ } else {
+ return toKeyAlias.uid++;
+ }
+ };
+ },
+ 6906: function (e, t, r) {
+ 'use strict';
+ var s;
+ s = { value: true };
+ t['default'] = toSequenceExpression;
+ var i = r(1357);
+ function toSequenceExpression(e, t) {
+ if (!(e != null && e.length)) return;
+ const r = [];
+ const s = (0, i.default)(e, t, r);
+ if (!s) return;
+ for (const e of r) {
+ t.push(e);
+ }
+ return s;
+ }
+ },
+ 4570: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = void 0;
+ var s = r(6428);
+ var i = r(397);
+ var n = (t['default'] = toStatement);
+ function toStatement(e, t) {
+ if ((0, s.isStatement)(e)) {
+ return e;
+ }
+ let r = false;
+ let n;
+ if ((0, s.isClass)(e)) {
+ r = true;
+ n = 'ClassDeclaration';
+ } else if ((0, s.isFunction)(e)) {
+ r = true;
+ n = 'FunctionDeclaration';
+ } else if ((0, s.isAssignmentExpression)(e)) {
+ return (0, i.expressionStatement)(e);
+ }
+ if (r && !e.id) {
+ n = false;
+ }
+ if (!n) {
+ if (t) {
+ return false;
+ } else {
+ throw new Error(`cannot turn ${e.type} to a statement`);
+ }
+ }
+ e.type = n;
+ return e;
+ }
+ },
+ 1382: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = void 0;
+ var s = r(9994);
+ var i = r(397);
+ var n = (t['default'] = valueToNode);
+ const a = Function.call.bind(Object.prototype.toString);
+ function isRegExp(e) {
+ return a(e) === '[object RegExp]';
+ }
+ function isPlainObject(e) {
+ if (
+ typeof e !== 'object' ||
+ e === null ||
+ Object.prototype.toString.call(e) !== '[object Object]'
+ ) {
+ return false;
+ }
+ const t = Object.getPrototypeOf(e);
+ return t === null || Object.getPrototypeOf(t) === null;
+ }
+ function valueToNode(e) {
+ if (e === undefined) {
+ return (0, i.identifier)('undefined');
+ }
+ if (e === true || e === false) {
+ return (0, i.booleanLiteral)(e);
+ }
+ if (e === null) {
+ return (0, i.nullLiteral)();
+ }
+ if (typeof e === 'string') {
+ return (0, i.stringLiteral)(e);
+ }
+ if (typeof e === 'number') {
+ let t;
+ if (Number.isFinite(e)) {
+ t = (0, i.numericLiteral)(Math.abs(e));
+ } else {
+ let r;
+ if (Number.isNaN(e)) {
+ r = (0, i.numericLiteral)(0);
+ } else {
+ r = (0, i.numericLiteral)(1);
+ }
+ t = (0, i.binaryExpression)('/', r, (0, i.numericLiteral)(0));
+ }
+ if (e < 0 || Object.is(e, -0)) {
+ t = (0, i.unaryExpression)('-', t);
+ }
+ return t;
+ }
+ if (isRegExp(e)) {
+ const t = e.source;
+ const r = e.toString().match(/\/([a-z]+|)$/)[1];
+ return (0, i.regExpLiteral)(t, r);
+ }
+ if (Array.isArray(e)) {
+ return (0, i.arrayExpression)(e.map(valueToNode));
+ }
+ if (isPlainObject(e)) {
+ const t = [];
+ for (const r of Object.keys(e)) {
+ let n;
+ if ((0, s.default)(r)) {
+ n = (0, i.identifier)(r);
+ } else {
+ n = (0, i.stringLiteral)(r);
+ }
+ t.push((0, i.objectProperty)(n, valueToNode(e[r])));
+ }
+ return (0, i.objectExpression)(t);
+ }
+ throw new Error("don't know how to turn this value into a node");
+ }
+ },
+ 5967: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.patternLikeCommon =
+ t.functionTypeAnnotationCommon =
+ t.functionDeclarationCommon =
+ t.functionCommon =
+ t.classMethodOrPropertyCommon =
+ t.classMethodOrDeclareMethodCommon =
+ void 0;
+ var s = r(3685);
+ var i = r(9994);
+ var n = r(3442);
+ var a = r(2776);
+ var o = r(1227);
+ var l = r(1903);
+ const c = (0, l.defineAliasedType)('Standardized');
+ c('ArrayExpression', {
+ fields: {
+ elements: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeOrValueType)(
+ 'null',
+ 'Expression',
+ 'SpreadElement',
+ ),
+ ),
+ ),
+ default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined,
+ },
+ },
+ visitor: ['elements'],
+ aliases: ['Expression'],
+ });
+ c('AssignmentExpression', {
+ fields: {
+ operator: {
+ validate: (function () {
+ if (!process.env.BABEL_TYPES_8_BREAKING) {
+ return (0, l.assertValueType)('string');
+ }
+ const e = (0, l.assertOneOf)(...o.ASSIGNMENT_OPERATORS);
+ const t = (0, l.assertOneOf)('=');
+ return function (r, i, n) {
+ const a = (0, s.default)('Pattern', r.left) ? t : e;
+ a(r, i, n);
+ };
+ })(),
+ },
+ left: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING
+ ? (0, l.assertNodeType)('LVal', 'OptionalMemberExpression')
+ : (0, l.assertNodeType)(
+ 'Identifier',
+ 'MemberExpression',
+ 'OptionalMemberExpression',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression',
+ ),
+ },
+ right: { validate: (0, l.assertNodeType)('Expression') },
+ },
+ builder: ['operator', 'left', 'right'],
+ visitor: ['left', 'right'],
+ aliases: ['Expression'],
+ });
+ c('BinaryExpression', {
+ builder: ['operator', 'left', 'right'],
+ fields: {
+ operator: { validate: (0, l.assertOneOf)(...o.BINARY_OPERATORS) },
+ left: {
+ validate: (function () {
+ const e = (0, l.assertNodeType)('Expression');
+ const t = (0, l.assertNodeType)('Expression', 'PrivateName');
+ const r = Object.assign(
+ function (r, s, i) {
+ const n = r.operator === 'in' ? t : e;
+ n(r, s, i);
+ },
+ { oneOfNodeTypes: ['Expression', 'PrivateName'] },
+ );
+ return r;
+ })(),
+ },
+ right: { validate: (0, l.assertNodeType)('Expression') },
+ },
+ visitor: ['left', 'right'],
+ aliases: ['Binary', 'Expression'],
+ });
+ c('InterpreterDirective', {
+ builder: ['value'],
+ fields: { value: { validate: (0, l.assertValueType)('string') } },
+ });
+ c('Directive', {
+ visitor: ['value'],
+ fields: {
+ value: { validate: (0, l.assertNodeType)('DirectiveLiteral') },
+ },
+ });
+ c('DirectiveLiteral', {
+ builder: ['value'],
+ fields: { value: { validate: (0, l.assertValueType)('string') } },
+ });
+ c('BlockStatement', {
+ builder: ['body', 'directives'],
+ visitor: ['directives', 'body'],
+ fields: {
+ directives: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Directive')),
+ ),
+ default: [],
+ },
+ body: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Statement')),
+ ),
+ },
+ },
+ aliases: ['Scopable', 'BlockParent', 'Block', 'Statement'],
+ });
+ c('BreakStatement', {
+ visitor: ['label'],
+ fields: {
+ label: {
+ validate: (0, l.assertNodeType)('Identifier'),
+ optional: true,
+ },
+ },
+ aliases: ['Statement', 'Terminatorless', 'CompletionStatement'],
+ });
+ c('CallExpression', {
+ visitor: ['callee', 'arguments', 'typeParameters', 'typeArguments'],
+ builder: ['callee', 'arguments'],
+ aliases: ['Expression'],
+ fields: Object.assign(
+ {
+ callee: {
+ validate: (0, l.assertNodeType)(
+ 'Expression',
+ 'Super',
+ 'V8IntrinsicIdentifier',
+ ),
+ },
+ arguments: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)(
+ 'Expression',
+ 'SpreadElement',
+ 'JSXNamespacedName',
+ 'ArgumentPlaceholder',
+ ),
+ ),
+ ),
+ },
+ },
+ !process.env.BABEL_TYPES_8_BREAKING
+ ? {
+ optional: {
+ validate: (0, l.assertOneOf)(true, false),
+ optional: true,
+ },
+ }
+ : {},
+ {
+ typeArguments: {
+ validate: (0, l.assertNodeType)('TypeParameterInstantiation'),
+ optional: true,
+ },
+ typeParameters: {
+ validate: (0, l.assertNodeType)('TSTypeParameterInstantiation'),
+ optional: true,
+ },
+ },
+ ),
+ });
+ c('CatchClause', {
+ visitor: ['param', 'body'],
+ fields: {
+ param: {
+ validate: (0, l.assertNodeType)(
+ 'Identifier',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ ),
+ optional: true,
+ },
+ body: { validate: (0, l.assertNodeType)('BlockStatement') },
+ },
+ aliases: ['Scopable', 'BlockParent'],
+ });
+ c('ConditionalExpression', {
+ visitor: ['test', 'consequent', 'alternate'],
+ fields: {
+ test: { validate: (0, l.assertNodeType)('Expression') },
+ consequent: { validate: (0, l.assertNodeType)('Expression') },
+ alternate: { validate: (0, l.assertNodeType)('Expression') },
+ },
+ aliases: ['Expression', 'Conditional'],
+ });
+ c('ContinueStatement', {
+ visitor: ['label'],
+ fields: {
+ label: {
+ validate: (0, l.assertNodeType)('Identifier'),
+ optional: true,
+ },
+ },
+ aliases: ['Statement', 'Terminatorless', 'CompletionStatement'],
+ });
+ c('DebuggerStatement', { aliases: ['Statement'] });
+ c('DoWhileStatement', {
+ visitor: ['test', 'body'],
+ fields: {
+ test: { validate: (0, l.assertNodeType)('Expression') },
+ body: { validate: (0, l.assertNodeType)('Statement') },
+ },
+ aliases: ['Statement', 'BlockParent', 'Loop', 'While', 'Scopable'],
+ });
+ c('EmptyStatement', { aliases: ['Statement'] });
+ c('ExpressionStatement', {
+ visitor: ['expression'],
+ fields: {
+ expression: { validate: (0, l.assertNodeType)('Expression') },
+ },
+ aliases: ['Statement', 'ExpressionWrapper'],
+ });
+ c('File', {
+ builder: ['program', 'comments', 'tokens'],
+ visitor: ['program'],
+ fields: {
+ program: { validate: (0, l.assertNodeType)('Program') },
+ comments: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING
+ ? Object.assign(() => {}, {
+ each: { oneOfNodeTypes: ['CommentBlock', 'CommentLine'] },
+ })
+ : (0, l.assertEach)(
+ (0, l.assertNodeType)('CommentBlock', 'CommentLine'),
+ ),
+ optional: true,
+ },
+ tokens: {
+ validate: (0, l.assertEach)(
+ Object.assign(() => {}, { type: 'any' }),
+ ),
+ optional: true,
+ },
+ },
+ });
+ c('ForInStatement', {
+ visitor: ['left', 'right', 'body'],
+ aliases: [
+ 'Scopable',
+ 'Statement',
+ 'For',
+ 'BlockParent',
+ 'Loop',
+ 'ForXStatement',
+ ],
+ fields: {
+ left: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING
+ ? (0, l.assertNodeType)('VariableDeclaration', 'LVal')
+ : (0, l.assertNodeType)(
+ 'VariableDeclaration',
+ 'Identifier',
+ 'MemberExpression',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression',
+ ),
+ },
+ right: { validate: (0, l.assertNodeType)('Expression') },
+ body: { validate: (0, l.assertNodeType)('Statement') },
+ },
+ });
+ c('ForStatement', {
+ visitor: ['init', 'test', 'update', 'body'],
+ aliases: ['Scopable', 'Statement', 'For', 'BlockParent', 'Loop'],
+ fields: {
+ init: {
+ validate: (0, l.assertNodeType)(
+ 'VariableDeclaration',
+ 'Expression',
+ ),
+ optional: true,
+ },
+ test: {
+ validate: (0, l.assertNodeType)('Expression'),
+ optional: true,
+ },
+ update: {
+ validate: (0, l.assertNodeType)('Expression'),
+ optional: true,
+ },
+ body: { validate: (0, l.assertNodeType)('Statement') },
+ },
+ });
+ const functionCommon = () => ({
+ params: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)('Identifier', 'Pattern', 'RestElement'),
+ ),
+ ),
+ },
+ generator: { default: false },
+ async: { default: false },
+ });
+ t.functionCommon = functionCommon;
+ const functionTypeAnnotationCommon = () => ({
+ returnType: {
+ validate: (0, l.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop',
+ ),
+ optional: true,
+ },
+ typeParameters: {
+ validate: (0, l.assertNodeType)(
+ 'TypeParameterDeclaration',
+ 'TSTypeParameterDeclaration',
+ 'Noop',
+ ),
+ optional: true,
+ },
+ });
+ t.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
+ const functionDeclarationCommon = () =>
+ Object.assign({}, functionCommon(), {
+ declare: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ id: { validate: (0, l.assertNodeType)('Identifier'), optional: true },
+ });
+ t.functionDeclarationCommon = functionDeclarationCommon;
+ c('FunctionDeclaration', {
+ builder: ['id', 'params', 'body', 'generator', 'async'],
+ visitor: ['id', 'params', 'body', 'returnType', 'typeParameters'],
+ fields: Object.assign(
+ {},
+ functionDeclarationCommon(),
+ functionTypeAnnotationCommon(),
+ {
+ body: { validate: (0, l.assertNodeType)('BlockStatement') },
+ predicate: {
+ validate: (0, l.assertNodeType)(
+ 'DeclaredPredicate',
+ 'InferredPredicate',
+ ),
+ optional: true,
+ },
+ },
+ ),
+ aliases: [
+ 'Scopable',
+ 'Function',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Statement',
+ 'Pureish',
+ 'Declaration',
+ ],
+ validate: (function () {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return () => {};
+ const e = (0, l.assertNodeType)('Identifier');
+ return function (t, r, i) {
+ if (!(0, s.default)('ExportDefaultDeclaration', t)) {
+ e(i, 'id', i.id);
+ }
+ };
+ })(),
+ });
+ c('FunctionExpression', {
+ inherits: 'FunctionDeclaration',
+ aliases: [
+ 'Scopable',
+ 'Function',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Expression',
+ 'Pureish',
+ ],
+ fields: Object.assign(
+ {},
+ functionCommon(),
+ functionTypeAnnotationCommon(),
+ {
+ id: {
+ validate: (0, l.assertNodeType)('Identifier'),
+ optional: true,
+ },
+ body: { validate: (0, l.assertNodeType)('BlockStatement') },
+ predicate: {
+ validate: (0, l.assertNodeType)(
+ 'DeclaredPredicate',
+ 'InferredPredicate',
+ ),
+ optional: true,
+ },
+ },
+ ),
+ });
+ const patternLikeCommon = () => ({
+ typeAnnotation: {
+ validate: (0, l.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop',
+ ),
+ optional: true,
+ },
+ optional: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ });
+ t.patternLikeCommon = patternLikeCommon;
+ c('Identifier', {
+ builder: ['name'],
+ visitor: ['typeAnnotation', 'decorators'],
+ aliases: ['Expression', 'PatternLike', 'LVal', 'TSEntityName'],
+ fields: Object.assign({}, patternLikeCommon(), {
+ name: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('string'),
+ Object.assign(
+ function (e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (!(0, i.default)(r, false)) {
+ throw new TypeError(
+ `"${r}" is not a valid identifier name`,
+ );
+ }
+ },
+ { type: 'string' },
+ ),
+ ),
+ },
+ }),
+ validate(e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ const i = /\.(\w+)$/.exec(t);
+ if (!i) return;
+ const [, a] = i;
+ const o = { computed: false };
+ if (a === 'property') {
+ if ((0, s.default)('MemberExpression', e, o)) return;
+ if ((0, s.default)('OptionalMemberExpression', e, o)) return;
+ } else if (a === 'key') {
+ if ((0, s.default)('Property', e, o)) return;
+ if ((0, s.default)('Method', e, o)) return;
+ } else if (a === 'exported') {
+ if ((0, s.default)('ExportSpecifier', e)) return;
+ } else if (a === 'imported') {
+ if ((0, s.default)('ImportSpecifier', e, { imported: r })) return;
+ } else if (a === 'meta') {
+ if ((0, s.default)('MetaProperty', e, { meta: r })) return;
+ }
+ if (
+ ((0, n.isKeyword)(r.name) ||
+ (0, n.isReservedWord)(r.name, false)) &&
+ r.name !== 'this'
+ ) {
+ throw new TypeError(`"${r.name}" is not a valid identifier`);
+ }
+ },
+ });
+ c('IfStatement', {
+ visitor: ['test', 'consequent', 'alternate'],
+ aliases: ['Statement', 'Conditional'],
+ fields: {
+ test: { validate: (0, l.assertNodeType)('Expression') },
+ consequent: { validate: (0, l.assertNodeType)('Statement') },
+ alternate: {
+ optional: true,
+ validate: (0, l.assertNodeType)('Statement'),
+ },
+ },
+ });
+ c('LabeledStatement', {
+ visitor: ['label', 'body'],
+ aliases: ['Statement'],
+ fields: {
+ label: { validate: (0, l.assertNodeType)('Identifier') },
+ body: { validate: (0, l.assertNodeType)('Statement') },
+ },
+ });
+ c('StringLiteral', {
+ builder: ['value'],
+ fields: { value: { validate: (0, l.assertValueType)('string') } },
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ });
+ c('NumericLiteral', {
+ builder: ['value'],
+ deprecatedAlias: 'NumberLiteral',
+ fields: {
+ value: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('number'),
+ Object.assign(
+ function (e, t, r) {
+ if (1 / r < 0 || !Number.isFinite(r)) {
+ const e = new Error(
+ 'NumericLiterals must be non-negative finite numbers. ' +
+ `You can use t.valueToNode(${r}) instead.`,
+ );
+ {
+ }
+ }
+ },
+ { type: 'number' },
+ ),
+ ),
+ },
+ },
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ });
+ c('NullLiteral', {
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ });
+ c('BooleanLiteral', {
+ builder: ['value'],
+ fields: { value: { validate: (0, l.assertValueType)('boolean') } },
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ });
+ c('RegExpLiteral', {
+ builder: ['pattern', 'flags'],
+ deprecatedAlias: 'RegexLiteral',
+ aliases: ['Expression', 'Pureish', 'Literal'],
+ fields: {
+ pattern: { validate: (0, l.assertValueType)('string') },
+ flags: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('string'),
+ Object.assign(
+ function (e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ const s = /[^gimsuy]/.exec(r);
+ if (s) {
+ throw new TypeError(`"${s[0]}" is not a valid RegExp flag`);
+ }
+ },
+ { type: 'string' },
+ ),
+ ),
+ default: '',
+ },
+ },
+ });
+ c('LogicalExpression', {
+ builder: ['operator', 'left', 'right'],
+ visitor: ['left', 'right'],
+ aliases: ['Binary', 'Expression'],
+ fields: {
+ operator: { validate: (0, l.assertOneOf)(...o.LOGICAL_OPERATORS) },
+ left: { validate: (0, l.assertNodeType)('Expression') },
+ right: { validate: (0, l.assertNodeType)('Expression') },
+ },
+ });
+ c('MemberExpression', {
+ builder: [
+ 'object',
+ 'property',
+ 'computed',
+ ...(!process.env.BABEL_TYPES_8_BREAKING ? ['optional'] : []),
+ ],
+ visitor: ['object', 'property'],
+ aliases: ['Expression', 'LVal'],
+ fields: Object.assign(
+ {
+ object: { validate: (0, l.assertNodeType)('Expression', 'Super') },
+ property: {
+ validate: (function () {
+ const e = (0, l.assertNodeType)('Identifier', 'PrivateName');
+ const t = (0, l.assertNodeType)('Expression');
+ const validator = function (r, s, i) {
+ const n = r.computed ? t : e;
+ n(r, s, i);
+ };
+ validator.oneOfNodeTypes = [
+ 'Expression',
+ 'Identifier',
+ 'PrivateName',
+ ];
+ return validator;
+ })(),
+ },
+ computed: { default: false },
+ },
+ !process.env.BABEL_TYPES_8_BREAKING
+ ? {
+ optional: {
+ validate: (0, l.assertOneOf)(true, false),
+ optional: true,
+ },
+ }
+ : {},
+ ),
+ });
+ c('NewExpression', { inherits: 'CallExpression' });
+ c('Program', {
+ visitor: ['directives', 'body'],
+ builder: ['body', 'directives', 'sourceType', 'interpreter'],
+ fields: {
+ sourceFile: { validate: (0, l.assertValueType)('string') },
+ sourceType: {
+ validate: (0, l.assertOneOf)('script', 'module'),
+ default: 'script',
+ },
+ interpreter: {
+ validate: (0, l.assertNodeType)('InterpreterDirective'),
+ default: null,
+ optional: true,
+ },
+ directives: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Directive')),
+ ),
+ default: [],
+ },
+ body: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Statement')),
+ ),
+ },
+ },
+ aliases: ['Scopable', 'BlockParent', 'Block'],
+ });
+ c('ObjectExpression', {
+ visitor: ['properties'],
+ aliases: ['Expression'],
+ fields: {
+ properties: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)(
+ 'ObjectMethod',
+ 'ObjectProperty',
+ 'SpreadElement',
+ ),
+ ),
+ ),
+ },
+ },
+ });
+ c('ObjectMethod', {
+ builder: [
+ 'kind',
+ 'key',
+ 'params',
+ 'body',
+ 'computed',
+ 'generator',
+ 'async',
+ ],
+ fields: Object.assign(
+ {},
+ functionCommon(),
+ functionTypeAnnotationCommon(),
+ {
+ kind: Object.assign(
+ { validate: (0, l.assertOneOf)('method', 'get', 'set') },
+ !process.env.BABEL_TYPES_8_BREAKING ? { default: 'method' } : {},
+ ),
+ computed: { default: false },
+ key: {
+ validate: (function () {
+ const e = (0, l.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ );
+ const t = (0, l.assertNodeType)('Expression');
+ const validator = function (r, s, i) {
+ const n = r.computed ? t : e;
+ n(r, s, i);
+ };
+ validator.oneOfNodeTypes = [
+ 'Expression',
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ ];
+ return validator;
+ })(),
+ },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ body: { validate: (0, l.assertNodeType)('BlockStatement') },
+ },
+ ),
+ visitor: [
+ 'key',
+ 'params',
+ 'body',
+ 'decorators',
+ 'returnType',
+ 'typeParameters',
+ ],
+ aliases: [
+ 'UserWhitespacable',
+ 'Function',
+ 'Scopable',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Method',
+ 'ObjectMember',
+ ],
+ });
+ c('ObjectProperty', {
+ builder: [
+ 'key',
+ 'value',
+ 'computed',
+ 'shorthand',
+ ...(!process.env.BABEL_TYPES_8_BREAKING ? ['decorators'] : []),
+ ],
+ fields: {
+ computed: { default: false },
+ key: {
+ validate: (function () {
+ const e = (0, l.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'DecimalLiteral',
+ 'PrivateName',
+ );
+ const t = (0, l.assertNodeType)('Expression');
+ const r = Object.assign(
+ function (r, s, i) {
+ const n = r.computed ? t : e;
+ n(r, s, i);
+ },
+ {
+ oneOfNodeTypes: [
+ 'Expression',
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'DecimalLiteral',
+ 'PrivateName',
+ ],
+ },
+ );
+ return r;
+ })(),
+ },
+ value: {
+ validate: (0, l.assertNodeType)('Expression', 'PatternLike'),
+ },
+ shorthand: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('boolean'),
+ Object.assign(
+ function (e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (r && e.computed) {
+ throw new TypeError(
+ 'Property shorthand of ObjectProperty cannot be true if computed is true',
+ );
+ }
+ },
+ { type: 'boolean' },
+ ),
+ function (e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (r && !(0, s.default)('Identifier', e.key)) {
+ throw new TypeError(
+ 'Property shorthand of ObjectProperty cannot be true if key is not an Identifier',
+ );
+ }
+ },
+ ),
+ default: false,
+ },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ },
+ visitor: ['key', 'value', 'decorators'],
+ aliases: ['UserWhitespacable', 'Property', 'ObjectMember'],
+ validate: (function () {
+ const e = (0, l.assertNodeType)(
+ 'Identifier',
+ 'Pattern',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSNonNullExpression',
+ 'TSTypeAssertion',
+ );
+ const t = (0, l.assertNodeType)('Expression');
+ return function (r, i, n) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ const a = (0, s.default)('ObjectPattern', r) ? e : t;
+ a(n, 'value', n.value);
+ };
+ })(),
+ });
+ c('RestElement', {
+ visitor: ['argument', 'typeAnnotation'],
+ builder: ['argument'],
+ aliases: ['LVal', 'PatternLike'],
+ deprecatedAlias: 'RestProperty',
+ fields: Object.assign({}, patternLikeCommon(), {
+ argument: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING
+ ? (0, l.assertNodeType)('LVal')
+ : (0, l.assertNodeType)(
+ 'Identifier',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ 'MemberExpression',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression',
+ ),
+ },
+ }),
+ validate(e, t) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ const r = /(\w+)\[(\d+)\]/.exec(t);
+ if (!r) throw new Error('Internal Babel error: malformed key.');
+ const [, s, i] = r;
+ if (e[s].length > +i + 1) {
+ throw new TypeError(`RestElement must be last element of ${s}`);
+ }
+ },
+ });
+ c('ReturnStatement', {
+ visitor: ['argument'],
+ aliases: ['Statement', 'Terminatorless', 'CompletionStatement'],
+ fields: {
+ argument: {
+ validate: (0, l.assertNodeType)('Expression'),
+ optional: true,
+ },
+ },
+ });
+ c('SequenceExpression', {
+ visitor: ['expressions'],
+ fields: {
+ expressions: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Expression')),
+ ),
+ },
+ },
+ aliases: ['Expression'],
+ });
+ c('ParenthesizedExpression', {
+ visitor: ['expression'],
+ aliases: ['Expression', 'ExpressionWrapper'],
+ fields: {
+ expression: { validate: (0, l.assertNodeType)('Expression') },
+ },
+ });
+ c('SwitchCase', {
+ visitor: ['test', 'consequent'],
+ fields: {
+ test: {
+ validate: (0, l.assertNodeType)('Expression'),
+ optional: true,
+ },
+ consequent: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Statement')),
+ ),
+ },
+ },
+ });
+ c('SwitchStatement', {
+ visitor: ['discriminant', 'cases'],
+ aliases: ['Statement', 'BlockParent', 'Scopable'],
+ fields: {
+ discriminant: { validate: (0, l.assertNodeType)('Expression') },
+ cases: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('SwitchCase')),
+ ),
+ },
+ },
+ });
+ c('ThisExpression', { aliases: ['Expression'] });
+ c('ThrowStatement', {
+ visitor: ['argument'],
+ aliases: ['Statement', 'Terminatorless', 'CompletionStatement'],
+ fields: { argument: { validate: (0, l.assertNodeType)('Expression') } },
+ });
+ c('TryStatement', {
+ visitor: ['block', 'handler', 'finalizer'],
+ aliases: ['Statement'],
+ fields: {
+ block: {
+ validate: (0, l.chain)(
+ (0, l.assertNodeType)('BlockStatement'),
+ Object.assign(
+ function (e) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (!e.handler && !e.finalizer) {
+ throw new TypeError(
+ 'TryStatement expects either a handler or finalizer, or both',
+ );
+ }
+ },
+ { oneOfNodeTypes: ['BlockStatement'] },
+ ),
+ ),
+ },
+ handler: {
+ optional: true,
+ validate: (0, l.assertNodeType)('CatchClause'),
+ },
+ finalizer: {
+ optional: true,
+ validate: (0, l.assertNodeType)('BlockStatement'),
+ },
+ },
+ });
+ c('UnaryExpression', {
+ builder: ['operator', 'argument', 'prefix'],
+ fields: {
+ prefix: { default: true },
+ argument: { validate: (0, l.assertNodeType)('Expression') },
+ operator: { validate: (0, l.assertOneOf)(...o.UNARY_OPERATORS) },
+ },
+ visitor: ['argument'],
+ aliases: ['UnaryLike', 'Expression'],
+ });
+ c('UpdateExpression', {
+ builder: ['operator', 'argument', 'prefix'],
+ fields: {
+ prefix: { default: false },
+ argument: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING
+ ? (0, l.assertNodeType)('Expression')
+ : (0, l.assertNodeType)('Identifier', 'MemberExpression'),
+ },
+ operator: { validate: (0, l.assertOneOf)(...o.UPDATE_OPERATORS) },
+ },
+ visitor: ['argument'],
+ aliases: ['Expression'],
+ });
+ c('VariableDeclaration', {
+ builder: ['kind', 'declarations'],
+ visitor: ['declarations'],
+ aliases: ['Statement', 'Declaration'],
+ fields: {
+ declare: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ kind: {
+ validate: (0, l.assertOneOf)(
+ 'var',
+ 'let',
+ 'const',
+ 'using',
+ 'await using',
+ ),
+ },
+ declarations: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('VariableDeclarator')),
+ ),
+ },
+ },
+ validate(e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (!(0, s.default)('ForXStatement', e, { left: r })) return;
+ if (r.declarations.length !== 1) {
+ throw new TypeError(
+ `Exactly one VariableDeclarator is required in the VariableDeclaration of a ${e.type}`,
+ );
+ }
+ },
+ });
+ c('VariableDeclarator', {
+ visitor: ['id', 'init'],
+ fields: {
+ id: {
+ validate: (function () {
+ if (!process.env.BABEL_TYPES_8_BREAKING) {
+ return (0, l.assertNodeType)('LVal');
+ }
+ const e = (0, l.assertNodeType)(
+ 'Identifier',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ );
+ const t = (0, l.assertNodeType)('Identifier');
+ return function (r, s, i) {
+ const n = r.init ? e : t;
+ n(r, s, i);
+ };
+ })(),
+ },
+ definite: {
+ optional: true,
+ validate: (0, l.assertValueType)('boolean'),
+ },
+ init: {
+ optional: true,
+ validate: (0, l.assertNodeType)('Expression'),
+ },
+ },
+ });
+ c('WhileStatement', {
+ visitor: ['test', 'body'],
+ aliases: ['Statement', 'BlockParent', 'Loop', 'While', 'Scopable'],
+ fields: {
+ test: { validate: (0, l.assertNodeType)('Expression') },
+ body: { validate: (0, l.assertNodeType)('Statement') },
+ },
+ });
+ c('WithStatement', {
+ visitor: ['object', 'body'],
+ aliases: ['Statement'],
+ fields: {
+ object: { validate: (0, l.assertNodeType)('Expression') },
+ body: { validate: (0, l.assertNodeType)('Statement') },
+ },
+ });
+ c('AssignmentPattern', {
+ visitor: ['left', 'right', 'decorators'],
+ builder: ['left', 'right'],
+ aliases: ['Pattern', 'PatternLike', 'LVal'],
+ fields: Object.assign({}, patternLikeCommon(), {
+ left: {
+ validate: (0, l.assertNodeType)(
+ 'Identifier',
+ 'ObjectPattern',
+ 'ArrayPattern',
+ 'MemberExpression',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression',
+ ),
+ },
+ right: { validate: (0, l.assertNodeType)('Expression') },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ }),
+ });
+ c('ArrayPattern', {
+ visitor: ['elements', 'typeAnnotation'],
+ builder: ['elements'],
+ aliases: ['Pattern', 'PatternLike', 'LVal'],
+ fields: Object.assign({}, patternLikeCommon(), {
+ elements: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeOrValueType)('null', 'PatternLike', 'LVal'),
+ ),
+ ),
+ },
+ }),
+ });
+ c('ArrowFunctionExpression', {
+ builder: ['params', 'body', 'async'],
+ visitor: ['params', 'body', 'returnType', 'typeParameters'],
+ aliases: [
+ 'Scopable',
+ 'Function',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Expression',
+ 'Pureish',
+ ],
+ fields: Object.assign(
+ {},
+ functionCommon(),
+ functionTypeAnnotationCommon(),
+ {
+ expression: { validate: (0, l.assertValueType)('boolean') },
+ body: {
+ validate: (0, l.assertNodeType)('BlockStatement', 'Expression'),
+ },
+ predicate: {
+ validate: (0, l.assertNodeType)(
+ 'DeclaredPredicate',
+ 'InferredPredicate',
+ ),
+ optional: true,
+ },
+ },
+ ),
+ });
+ c('ClassBody', {
+ visitor: ['body'],
+ fields: {
+ body: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)(
+ 'ClassMethod',
+ 'ClassPrivateMethod',
+ 'ClassProperty',
+ 'ClassPrivateProperty',
+ 'ClassAccessorProperty',
+ 'TSDeclareMethod',
+ 'TSIndexSignature',
+ 'StaticBlock',
+ ),
+ ),
+ ),
+ },
+ },
+ });
+ c('ClassExpression', {
+ builder: ['id', 'superClass', 'body', 'decorators'],
+ visitor: [
+ 'id',
+ 'body',
+ 'superClass',
+ 'mixins',
+ 'typeParameters',
+ 'superTypeParameters',
+ 'implements',
+ 'decorators',
+ ],
+ aliases: ['Scopable', 'Class', 'Expression'],
+ fields: {
+ id: { validate: (0, l.assertNodeType)('Identifier'), optional: true },
+ typeParameters: {
+ validate: (0, l.assertNodeType)(
+ 'TypeParameterDeclaration',
+ 'TSTypeParameterDeclaration',
+ 'Noop',
+ ),
+ optional: true,
+ },
+ body: { validate: (0, l.assertNodeType)('ClassBody') },
+ superClass: {
+ optional: true,
+ validate: (0, l.assertNodeType)('Expression'),
+ },
+ superTypeParameters: {
+ validate: (0, l.assertNodeType)(
+ 'TypeParameterInstantiation',
+ 'TSTypeParameterInstantiation',
+ ),
+ optional: true,
+ },
+ implements: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)(
+ 'TSExpressionWithTypeArguments',
+ 'ClassImplements',
+ ),
+ ),
+ ),
+ optional: true,
+ },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ mixins: {
+ validate: (0, l.assertNodeType)('InterfaceExtends'),
+ optional: true,
+ },
+ },
+ });
+ c('ClassDeclaration', {
+ inherits: 'ClassExpression',
+ aliases: ['Scopable', 'Class', 'Statement', 'Declaration'],
+ fields: {
+ id: { validate: (0, l.assertNodeType)('Identifier'), optional: true },
+ typeParameters: {
+ validate: (0, l.assertNodeType)(
+ 'TypeParameterDeclaration',
+ 'TSTypeParameterDeclaration',
+ 'Noop',
+ ),
+ optional: true,
+ },
+ body: { validate: (0, l.assertNodeType)('ClassBody') },
+ superClass: {
+ optional: true,
+ validate: (0, l.assertNodeType)('Expression'),
+ },
+ superTypeParameters: {
+ validate: (0, l.assertNodeType)(
+ 'TypeParameterInstantiation',
+ 'TSTypeParameterInstantiation',
+ ),
+ optional: true,
+ },
+ implements: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)(
+ 'TSExpressionWithTypeArguments',
+ 'ClassImplements',
+ ),
+ ),
+ ),
+ optional: true,
+ },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ mixins: {
+ validate: (0, l.assertNodeType)('InterfaceExtends'),
+ optional: true,
+ },
+ declare: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ abstract: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ },
+ validate: (function () {
+ const e = (0, l.assertNodeType)('Identifier');
+ return function (t, r, i) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (!(0, s.default)('ExportDefaultDeclaration', t)) {
+ e(i, 'id', i.id);
+ }
+ };
+ })(),
+ });
+ c('ExportAllDeclaration', {
+ builder: ['source'],
+ visitor: ['source', 'attributes', 'assertions'],
+ aliases: [
+ 'Statement',
+ 'Declaration',
+ 'ImportOrExportDeclaration',
+ 'ExportDeclaration',
+ ],
+ fields: {
+ source: { validate: (0, l.assertNodeType)('StringLiteral') },
+ exportKind: (0, l.validateOptional)(
+ (0, l.assertOneOf)('type', 'value'),
+ ),
+ attributes: {
+ optional: true,
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('ImportAttribute')),
+ ),
+ },
+ assertions: {
+ optional: true,
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('ImportAttribute')),
+ ),
+ },
+ },
+ });
+ c('ExportDefaultDeclaration', {
+ visitor: ['declaration'],
+ aliases: [
+ 'Statement',
+ 'Declaration',
+ 'ImportOrExportDeclaration',
+ 'ExportDeclaration',
+ ],
+ fields: {
+ declaration: {
+ validate: (0, l.assertNodeType)(
+ 'TSDeclareFunction',
+ 'FunctionDeclaration',
+ 'ClassDeclaration',
+ 'Expression',
+ ),
+ },
+ exportKind: (0, l.validateOptional)((0, l.assertOneOf)('value')),
+ },
+ });
+ c('ExportNamedDeclaration', {
+ builder: ['declaration', 'specifiers', 'source'],
+ visitor: [
+ 'declaration',
+ 'specifiers',
+ 'source',
+ 'attributes',
+ 'assertions',
+ ],
+ aliases: [
+ 'Statement',
+ 'Declaration',
+ 'ImportOrExportDeclaration',
+ 'ExportDeclaration',
+ ],
+ fields: {
+ declaration: {
+ optional: true,
+ validate: (0, l.chain)(
+ (0, l.assertNodeType)('Declaration'),
+ Object.assign(
+ function (e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (r && e.specifiers.length) {
+ throw new TypeError(
+ 'Only declaration or specifiers is allowed on ExportNamedDeclaration',
+ );
+ }
+ },
+ { oneOfNodeTypes: ['Declaration'] },
+ ),
+ function (e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (r && e.source) {
+ throw new TypeError(
+ 'Cannot export a declaration from a source',
+ );
+ }
+ },
+ ),
+ },
+ attributes: {
+ optional: true,
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('ImportAttribute')),
+ ),
+ },
+ assertions: {
+ optional: true,
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('ImportAttribute')),
+ ),
+ },
+ specifiers: {
+ default: [],
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (function () {
+ const e = (0, l.assertNodeType)(
+ 'ExportSpecifier',
+ 'ExportDefaultSpecifier',
+ 'ExportNamespaceSpecifier',
+ );
+ const t = (0, l.assertNodeType)('ExportSpecifier');
+ if (!process.env.BABEL_TYPES_8_BREAKING) return e;
+ return function (r, s, i) {
+ const n = r.source ? e : t;
+ n(r, s, i);
+ };
+ })(),
+ ),
+ ),
+ },
+ source: {
+ validate: (0, l.assertNodeType)('StringLiteral'),
+ optional: true,
+ },
+ exportKind: (0, l.validateOptional)(
+ (0, l.assertOneOf)('type', 'value'),
+ ),
+ },
+ });
+ c('ExportSpecifier', {
+ visitor: ['local', 'exported'],
+ aliases: ['ModuleSpecifier'],
+ fields: {
+ local: { validate: (0, l.assertNodeType)('Identifier') },
+ exported: {
+ validate: (0, l.assertNodeType)('Identifier', 'StringLiteral'),
+ },
+ exportKind: {
+ validate: (0, l.assertOneOf)('type', 'value'),
+ optional: true,
+ },
+ },
+ });
+ c('ForOfStatement', {
+ visitor: ['left', 'right', 'body'],
+ builder: ['left', 'right', 'body', 'await'],
+ aliases: [
+ 'Scopable',
+ 'Statement',
+ 'For',
+ 'BlockParent',
+ 'Loop',
+ 'ForXStatement',
+ ],
+ fields: {
+ left: {
+ validate: (function () {
+ if (!process.env.BABEL_TYPES_8_BREAKING) {
+ return (0, l.assertNodeType)('VariableDeclaration', 'LVal');
+ }
+ const e = (0, l.assertNodeType)('VariableDeclaration');
+ const t = (0, l.assertNodeType)(
+ 'Identifier',
+ 'MemberExpression',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression',
+ );
+ return function (r, i, n) {
+ if ((0, s.default)('VariableDeclaration', n)) {
+ e(r, i, n);
+ } else {
+ t(r, i, n);
+ }
+ };
+ })(),
+ },
+ right: { validate: (0, l.assertNodeType)('Expression') },
+ body: { validate: (0, l.assertNodeType)('Statement') },
+ await: { default: false },
+ },
+ });
+ c('ImportDeclaration', {
+ builder: ['specifiers', 'source'],
+ visitor: ['specifiers', 'source', 'attributes', 'assertions'],
+ aliases: ['Statement', 'Declaration', 'ImportOrExportDeclaration'],
+ fields: {
+ attributes: {
+ optional: true,
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('ImportAttribute')),
+ ),
+ },
+ assertions: {
+ optional: true,
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('ImportAttribute')),
+ ),
+ },
+ module: {
+ optional: true,
+ validate: (0, l.assertValueType)('boolean'),
+ },
+ phase: {
+ default: null,
+ validate: (0, l.assertOneOf)('source', 'defer'),
+ },
+ specifiers: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)(
+ 'ImportSpecifier',
+ 'ImportDefaultSpecifier',
+ 'ImportNamespaceSpecifier',
+ ),
+ ),
+ ),
+ },
+ source: { validate: (0, l.assertNodeType)('StringLiteral') },
+ importKind: {
+ validate: (0, l.assertOneOf)('type', 'typeof', 'value'),
+ optional: true,
+ },
+ },
+ });
+ c('ImportDefaultSpecifier', {
+ visitor: ['local'],
+ aliases: ['ModuleSpecifier'],
+ fields: { local: { validate: (0, l.assertNodeType)('Identifier') } },
+ });
+ c('ImportNamespaceSpecifier', {
+ visitor: ['local'],
+ aliases: ['ModuleSpecifier'],
+ fields: { local: { validate: (0, l.assertNodeType)('Identifier') } },
+ });
+ c('ImportSpecifier', {
+ visitor: ['local', 'imported'],
+ aliases: ['ModuleSpecifier'],
+ fields: {
+ local: { validate: (0, l.assertNodeType)('Identifier') },
+ imported: {
+ validate: (0, l.assertNodeType)('Identifier', 'StringLiteral'),
+ },
+ importKind: {
+ validate: (0, l.assertOneOf)('type', 'typeof', 'value'),
+ optional: true,
+ },
+ },
+ });
+ c('ImportExpression', {
+ visitor: ['source', 'options'],
+ aliases: ['Expression'],
+ fields: {
+ phase: {
+ default: null,
+ validate: (0, l.assertOneOf)('source', 'defer'),
+ },
+ source: { validate: (0, l.assertNodeType)('Expression') },
+ options: {
+ validate: (0, l.assertNodeType)('Expression'),
+ optional: true,
+ },
+ },
+ });
+ c('MetaProperty', {
+ visitor: ['meta', 'property'],
+ aliases: ['Expression'],
+ fields: {
+ meta: {
+ validate: (0, l.chain)(
+ (0, l.assertNodeType)('Identifier'),
+ Object.assign(
+ function (e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ let i;
+ switch (r.name) {
+ case 'function':
+ i = 'sent';
+ break;
+ case 'new':
+ i = 'target';
+ break;
+ case 'import':
+ i = 'meta';
+ break;
+ }
+ if (!(0, s.default)('Identifier', e.property, { name: i })) {
+ throw new TypeError('Unrecognised MetaProperty');
+ }
+ },
+ { oneOfNodeTypes: ['Identifier'] },
+ ),
+ ),
+ },
+ property: { validate: (0, l.assertNodeType)('Identifier') },
+ },
+ });
+ const classMethodOrPropertyCommon = () => ({
+ abstract: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ accessibility: {
+ validate: (0, l.assertOneOf)('public', 'private', 'protected'),
+ optional: true,
+ },
+ static: { default: false },
+ override: { default: false },
+ computed: { default: false },
+ optional: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ key: {
+ validate: (0, l.chain)(
+ (function () {
+ const e = (0, l.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ );
+ const t = (0, l.assertNodeType)('Expression');
+ return function (r, s, i) {
+ const n = r.computed ? t : e;
+ n(r, s, i);
+ };
+ })(),
+ (0, l.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'Expression',
+ ),
+ ),
+ },
+ });
+ t.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
+ const classMethodOrDeclareMethodCommon = () =>
+ Object.assign({}, functionCommon(), classMethodOrPropertyCommon(), {
+ params: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)(
+ 'Identifier',
+ 'Pattern',
+ 'RestElement',
+ 'TSParameterProperty',
+ ),
+ ),
+ ),
+ },
+ kind: {
+ validate: (0, l.assertOneOf)('get', 'set', 'method', 'constructor'),
+ default: 'method',
+ },
+ access: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('string'),
+ (0, l.assertOneOf)('public', 'private', 'protected'),
+ ),
+ optional: true,
+ },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ });
+ t.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
+ c('ClassMethod', {
+ aliases: [
+ 'Function',
+ 'Scopable',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Method',
+ ],
+ builder: [
+ 'kind',
+ 'key',
+ 'params',
+ 'body',
+ 'computed',
+ 'static',
+ 'generator',
+ 'async',
+ ],
+ visitor: [
+ 'key',
+ 'params',
+ 'body',
+ 'decorators',
+ 'returnType',
+ 'typeParameters',
+ ],
+ fields: Object.assign(
+ {},
+ classMethodOrDeclareMethodCommon(),
+ functionTypeAnnotationCommon(),
+ { body: { validate: (0, l.assertNodeType)('BlockStatement') } },
+ ),
+ });
+ c('ObjectPattern', {
+ visitor: ['properties', 'typeAnnotation', 'decorators'],
+ builder: ['properties'],
+ aliases: ['Pattern', 'PatternLike', 'LVal'],
+ fields: Object.assign({}, patternLikeCommon(), {
+ properties: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)('RestElement', 'ObjectProperty'),
+ ),
+ ),
+ },
+ }),
+ });
+ c('SpreadElement', {
+ visitor: ['argument'],
+ aliases: ['UnaryLike'],
+ deprecatedAlias: 'SpreadProperty',
+ fields: { argument: { validate: (0, l.assertNodeType)('Expression') } },
+ });
+ c('Super', { aliases: ['Expression'] });
+ c('TaggedTemplateExpression', {
+ visitor: ['tag', 'quasi', 'typeParameters'],
+ builder: ['tag', 'quasi'],
+ aliases: ['Expression'],
+ fields: {
+ tag: { validate: (0, l.assertNodeType)('Expression') },
+ quasi: { validate: (0, l.assertNodeType)('TemplateLiteral') },
+ typeParameters: {
+ validate: (0, l.assertNodeType)(
+ 'TypeParameterInstantiation',
+ 'TSTypeParameterInstantiation',
+ ),
+ optional: true,
+ },
+ },
+ });
+ c('TemplateElement', {
+ builder: ['value', 'tail'],
+ fields: {
+ value: {
+ validate: (0, l.chain)(
+ (0, l.assertShape)({
+ raw: { validate: (0, l.assertValueType)('string') },
+ cooked: {
+ validate: (0, l.assertValueType)('string'),
+ optional: true,
+ },
+ }),
+ function templateElementCookedValidator(e) {
+ const t = e.value.raw;
+ let r = false;
+ const error = () => {
+ throw new Error('Internal @babel/types error.');
+ };
+ const { str: s, firstInvalidLoc: i } = (0,
+ a.readStringContents)('template', t, 0, 0, 0, {
+ unterminated() {
+ r = true;
+ },
+ strictNumericEscape: error,
+ invalidEscapeSequence: error,
+ numericSeparatorInEscapeSequence: error,
+ unexpectedNumericSeparator: error,
+ invalidDigit: error,
+ invalidCodePoint: error,
+ });
+ if (!r) throw new Error('Invalid raw');
+ e.value.cooked = i ? null : s;
+ },
+ ),
+ },
+ tail: { default: false },
+ },
+ });
+ c('TemplateLiteral', {
+ visitor: ['quasis', 'expressions'],
+ aliases: ['Expression', 'Literal'],
+ fields: {
+ quasis: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('TemplateElement')),
+ ),
+ },
+ expressions: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Expression', 'TSType')),
+ function (e, t, r) {
+ if (e.quasis.length !== r.length + 1) {
+ throw new TypeError(
+ `Number of ${
+ e.type
+ } quasis should be exactly one more than the number of expressions.\nExpected ${
+ r.length + 1
+ } quasis but got ${e.quasis.length}`,
+ );
+ }
+ },
+ ),
+ },
+ },
+ });
+ c('YieldExpression', {
+ builder: ['argument', 'delegate'],
+ visitor: ['argument'],
+ aliases: ['Expression', 'Terminatorless'],
+ fields: {
+ delegate: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('boolean'),
+ Object.assign(
+ function (e, t, r) {
+ if (!process.env.BABEL_TYPES_8_BREAKING) return;
+ if (r && !e.argument) {
+ throw new TypeError(
+ 'Property delegate of YieldExpression cannot be true if there is no argument',
+ );
+ }
+ },
+ { type: 'boolean' },
+ ),
+ ),
+ default: false,
+ },
+ argument: {
+ optional: true,
+ validate: (0, l.assertNodeType)('Expression'),
+ },
+ },
+ });
+ c('AwaitExpression', {
+ builder: ['argument'],
+ visitor: ['argument'],
+ aliases: ['Expression', 'Terminatorless'],
+ fields: { argument: { validate: (0, l.assertNodeType)('Expression') } },
+ });
+ c('Import', { aliases: ['Expression'] });
+ c('BigIntLiteral', {
+ builder: ['value'],
+ fields: { value: { validate: (0, l.assertValueType)('string') } },
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ });
+ c('ExportNamespaceSpecifier', {
+ visitor: ['exported'],
+ aliases: ['ModuleSpecifier'],
+ fields: { exported: { validate: (0, l.assertNodeType)('Identifier') } },
+ });
+ c('OptionalMemberExpression', {
+ builder: ['object', 'property', 'computed', 'optional'],
+ visitor: ['object', 'property'],
+ aliases: ['Expression'],
+ fields: {
+ object: { validate: (0, l.assertNodeType)('Expression') },
+ property: {
+ validate: (function () {
+ const e = (0, l.assertNodeType)('Identifier');
+ const t = (0, l.assertNodeType)('Expression');
+ const r = Object.assign(
+ function (r, s, i) {
+ const n = r.computed ? t : e;
+ n(r, s, i);
+ },
+ { oneOfNodeTypes: ['Expression', 'Identifier'] },
+ );
+ return r;
+ })(),
+ },
+ computed: { default: false },
+ optional: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING
+ ? (0, l.assertValueType)('boolean')
+ : (0, l.chain)(
+ (0, l.assertValueType)('boolean'),
+ (0, l.assertOptionalChainStart)(),
+ ),
+ },
+ },
+ });
+ c('OptionalCallExpression', {
+ visitor: ['callee', 'arguments', 'typeParameters', 'typeArguments'],
+ builder: ['callee', 'arguments', 'optional'],
+ aliases: ['Expression'],
+ fields: {
+ callee: { validate: (0, l.assertNodeType)('Expression') },
+ arguments: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)(
+ (0, l.assertNodeType)(
+ 'Expression',
+ 'SpreadElement',
+ 'JSXNamespacedName',
+ 'ArgumentPlaceholder',
+ ),
+ ),
+ ),
+ },
+ optional: {
+ validate: !process.env.BABEL_TYPES_8_BREAKING
+ ? (0, l.assertValueType)('boolean')
+ : (0, l.chain)(
+ (0, l.assertValueType)('boolean'),
+ (0, l.assertOptionalChainStart)(),
+ ),
+ },
+ typeArguments: {
+ validate: (0, l.assertNodeType)('TypeParameterInstantiation'),
+ optional: true,
+ },
+ typeParameters: {
+ validate: (0, l.assertNodeType)('TSTypeParameterInstantiation'),
+ optional: true,
+ },
+ },
+ });
+ c('ClassProperty', {
+ visitor: ['key', 'value', 'typeAnnotation', 'decorators'],
+ builder: [
+ 'key',
+ 'value',
+ 'typeAnnotation',
+ 'decorators',
+ 'computed',
+ 'static',
+ ],
+ aliases: ['Property'],
+ fields: Object.assign({}, classMethodOrPropertyCommon(), {
+ value: {
+ validate: (0, l.assertNodeType)('Expression'),
+ optional: true,
+ },
+ definite: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ typeAnnotation: {
+ validate: (0, l.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop',
+ ),
+ optional: true,
+ },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ readonly: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ declare: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ variance: {
+ validate: (0, l.assertNodeType)('Variance'),
+ optional: true,
+ },
+ }),
+ });
+ c('ClassAccessorProperty', {
+ visitor: ['key', 'value', 'typeAnnotation', 'decorators'],
+ builder: [
+ 'key',
+ 'value',
+ 'typeAnnotation',
+ 'decorators',
+ 'computed',
+ 'static',
+ ],
+ aliases: ['Property', 'Accessor'],
+ fields: Object.assign({}, classMethodOrPropertyCommon(), {
+ key: {
+ validate: (0, l.chain)(
+ (function () {
+ const e = (0, l.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'PrivateName',
+ );
+ const t = (0, l.assertNodeType)('Expression');
+ return function (r, s, i) {
+ const n = r.computed ? t : e;
+ n(r, s, i);
+ };
+ })(),
+ (0, l.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'Expression',
+ 'PrivateName',
+ ),
+ ),
+ },
+ value: {
+ validate: (0, l.assertNodeType)('Expression'),
+ optional: true,
+ },
+ definite: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ typeAnnotation: {
+ validate: (0, l.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop',
+ ),
+ optional: true,
+ },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ readonly: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ declare: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ variance: {
+ validate: (0, l.assertNodeType)('Variance'),
+ optional: true,
+ },
+ }),
+ });
+ c('ClassPrivateProperty', {
+ visitor: ['key', 'value', 'decorators', 'typeAnnotation'],
+ builder: ['key', 'value', 'decorators', 'static'],
+ aliases: ['Property', 'Private'],
+ fields: {
+ key: { validate: (0, l.assertNodeType)('PrivateName') },
+ value: {
+ validate: (0, l.assertNodeType)('Expression'),
+ optional: true,
+ },
+ typeAnnotation: {
+ validate: (0, l.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop',
+ ),
+ optional: true,
+ },
+ decorators: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ static: {
+ validate: (0, l.assertValueType)('boolean'),
+ default: false,
+ },
+ readonly: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ definite: {
+ validate: (0, l.assertValueType)('boolean'),
+ optional: true,
+ },
+ variance: {
+ validate: (0, l.assertNodeType)('Variance'),
+ optional: true,
+ },
+ },
+ });
+ c('ClassPrivateMethod', {
+ builder: ['kind', 'key', 'params', 'body', 'static'],
+ visitor: [
+ 'key',
+ 'params',
+ 'body',
+ 'decorators',
+ 'returnType',
+ 'typeParameters',
+ ],
+ aliases: [
+ 'Function',
+ 'Scopable',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Method',
+ 'Private',
+ ],
+ fields: Object.assign(
+ {},
+ classMethodOrDeclareMethodCommon(),
+ functionTypeAnnotationCommon(),
+ {
+ kind: {
+ validate: (0, l.assertOneOf)('get', 'set', 'method'),
+ default: 'method',
+ },
+ key: { validate: (0, l.assertNodeType)('PrivateName') },
+ body: { validate: (0, l.assertNodeType)('BlockStatement') },
+ },
+ ),
+ });
+ c('PrivateName', {
+ visitor: ['id'],
+ aliases: ['Private'],
+ fields: { id: { validate: (0, l.assertNodeType)('Identifier') } },
+ });
+ c('StaticBlock', {
+ visitor: ['body'],
+ fields: {
+ body: {
+ validate: (0, l.chain)(
+ (0, l.assertValueType)('array'),
+ (0, l.assertEach)((0, l.assertNodeType)('Statement')),
+ ),
+ },
+ },
+ aliases: ['Scopable', 'BlockParent', 'FunctionParent'],
+ });
+ },
+ 1875: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.DEPRECATED_ALIASES = void 0;
+ const r = (t.DEPRECATED_ALIASES = {
+ ModuleDeclaration: 'ImportOrExportDeclaration',
+ });
+ },
+ 5035: function (e, t, r) {
+ 'use strict';
+ var s = r(1903);
+ (0, s.default)('ArgumentPlaceholder', {});
+ (0, s.default)('BindExpression', {
+ visitor: ['object', 'callee'],
+ aliases: ['Expression'],
+ fields: !process.env.BABEL_TYPES_8_BREAKING
+ ? {
+ object: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ['Expression'],
+ }),
+ },
+ callee: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ['Expression'],
+ }),
+ },
+ }
+ : {
+ object: { validate: (0, s.assertNodeType)('Expression') },
+ callee: { validate: (0, s.assertNodeType)('Expression') },
+ },
+ });
+ (0, s.default)('ImportAttribute', {
+ visitor: ['key', 'value'],
+ fields: {
+ key: {
+ validate: (0, s.assertNodeType)('Identifier', 'StringLiteral'),
+ },
+ value: { validate: (0, s.assertNodeType)('StringLiteral') },
+ },
+ });
+ (0, s.default)('Decorator', {
+ visitor: ['expression'],
+ fields: {
+ expression: { validate: (0, s.assertNodeType)('Expression') },
+ },
+ });
+ (0, s.default)('DoExpression', {
+ visitor: ['body'],
+ builder: ['body', 'async'],
+ aliases: ['Expression'],
+ fields: {
+ body: { validate: (0, s.assertNodeType)('BlockStatement') },
+ async: {
+ validate: (0, s.assertValueType)('boolean'),
+ default: false,
+ },
+ },
+ });
+ (0, s.default)('ExportDefaultSpecifier', {
+ visitor: ['exported'],
+ aliases: ['ModuleSpecifier'],
+ fields: { exported: { validate: (0, s.assertNodeType)('Identifier') } },
+ });
+ (0, s.default)('RecordExpression', {
+ visitor: ['properties'],
+ aliases: ['Expression'],
+ fields: {
+ properties: {
+ validate: (0, s.chain)(
+ (0, s.assertValueType)('array'),
+ (0, s.assertEach)(
+ (0, s.assertNodeType)('ObjectProperty', 'SpreadElement'),
+ ),
+ ),
+ },
+ },
+ });
+ (0, s.default)('TupleExpression', {
+ fields: {
+ elements: {
+ validate: (0, s.chain)(
+ (0, s.assertValueType)('array'),
+ (0, s.assertEach)(
+ (0, s.assertNodeType)('Expression', 'SpreadElement'),
+ ),
+ ),
+ default: [],
+ },
+ },
+ visitor: ['elements'],
+ aliases: ['Expression'],
+ });
+ (0, s.default)('DecimalLiteral', {
+ builder: ['value'],
+ fields: { value: { validate: (0, s.assertValueType)('string') } },
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ });
+ (0, s.default)('ModuleExpression', {
+ visitor: ['body'],
+ fields: { body: { validate: (0, s.assertNodeType)('Program') } },
+ aliases: ['Expression'],
+ });
+ (0, s.default)('TopicReference', { aliases: ['Expression'] });
+ (0, s.default)('PipelineTopicExpression', {
+ builder: ['expression'],
+ visitor: ['expression'],
+ fields: {
+ expression: { validate: (0, s.assertNodeType)('Expression') },
+ },
+ aliases: ['Expression'],
+ });
+ (0, s.default)('PipelineBareFunction', {
+ builder: ['callee'],
+ visitor: ['callee'],
+ fields: { callee: { validate: (0, s.assertNodeType)('Expression') } },
+ aliases: ['Expression'],
+ });
+ (0, s.default)('PipelinePrimaryTopicReference', {
+ aliases: ['Expression'],
+ });
+ },
+ 7069: function (e, t, r) {
+ 'use strict';
+ var s = r(1903);
+ const i = (0, s.defineAliasedType)('Flow');
+ const defineInterfaceishType = (e) => {
+ const t = e === 'DeclareClass';
+ i(e, {
+ builder: ['id', 'typeParameters', 'extends', 'body'],
+ visitor: [
+ 'id',
+ 'typeParameters',
+ 'extends',
+ ...(t ? ['mixins', 'implements'] : []),
+ 'body',
+ ],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: Object.assign(
+ {
+ id: (0, s.validateType)('Identifier'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TypeParameterDeclaration',
+ ),
+ extends: (0, s.validateOptional)(
+ (0, s.arrayOfType)('InterfaceExtends'),
+ ),
+ },
+ t
+ ? {
+ mixins: (0, s.validateOptional)(
+ (0, s.arrayOfType)('InterfaceExtends'),
+ ),
+ implements: (0, s.validateOptional)(
+ (0, s.arrayOfType)('ClassImplements'),
+ ),
+ }
+ : {},
+ { body: (0, s.validateType)('ObjectTypeAnnotation') },
+ ),
+ });
+ };
+ i('AnyTypeAnnotation', { aliases: ['FlowType', 'FlowBaseAnnotation'] });
+ i('ArrayTypeAnnotation', {
+ visitor: ['elementType'],
+ aliases: ['FlowType'],
+ fields: { elementType: (0, s.validateType)('FlowType') },
+ });
+ i('BooleanTypeAnnotation', {
+ aliases: ['FlowType', 'FlowBaseAnnotation'],
+ });
+ i('BooleanLiteralTypeAnnotation', {
+ builder: ['value'],
+ aliases: ['FlowType'],
+ fields: { value: (0, s.validate)((0, s.assertValueType)('boolean')) },
+ });
+ i('NullLiteralTypeAnnotation', {
+ aliases: ['FlowType', 'FlowBaseAnnotation'],
+ });
+ i('ClassImplements', {
+ visitor: ['id', 'typeParameters'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TypeParameterInstantiation',
+ ),
+ },
+ });
+ defineInterfaceishType('DeclareClass');
+ i('DeclareFunction', {
+ visitor: ['id'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ predicate: (0, s.validateOptionalType)('DeclaredPredicate'),
+ },
+ });
+ defineInterfaceishType('DeclareInterface');
+ i('DeclareModule', {
+ builder: ['id', 'body', 'kind'],
+ visitor: ['id', 'body'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, s.validateType)(['Identifier', 'StringLiteral']),
+ body: (0, s.validateType)('BlockStatement'),
+ kind: (0, s.validateOptional)((0, s.assertOneOf)('CommonJS', 'ES')),
+ },
+ });
+ i('DeclareModuleExports', {
+ visitor: ['typeAnnotation'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: { typeAnnotation: (0, s.validateType)('TypeAnnotation') },
+ });
+ i('DeclareTypeAlias', {
+ visitor: ['id', 'typeParameters', 'right'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TypeParameterDeclaration',
+ ),
+ right: (0, s.validateType)('FlowType'),
+ },
+ });
+ i('DeclareOpaqueType', {
+ visitor: ['id', 'typeParameters', 'supertype'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TypeParameterDeclaration',
+ ),
+ supertype: (0, s.validateOptionalType)('FlowType'),
+ impltype: (0, s.validateOptionalType)('FlowType'),
+ },
+ });
+ i('DeclareVariable', {
+ visitor: ['id'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: { id: (0, s.validateType)('Identifier') },
+ });
+ i('DeclareExportDeclaration', {
+ visitor: ['declaration', 'specifiers', 'source'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ declaration: (0, s.validateOptionalType)('Flow'),
+ specifiers: (0, s.validateOptional)(
+ (0, s.arrayOfType)(['ExportSpecifier', 'ExportNamespaceSpecifier']),
+ ),
+ source: (0, s.validateOptionalType)('StringLiteral'),
+ default: (0, s.validateOptional)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('DeclareExportAllDeclaration', {
+ visitor: ['source'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ source: (0, s.validateType)('StringLiteral'),
+ exportKind: (0, s.validateOptional)(
+ (0, s.assertOneOf)('type', 'value'),
+ ),
+ },
+ });
+ i('DeclaredPredicate', {
+ visitor: ['value'],
+ aliases: ['FlowPredicate'],
+ fields: { value: (0, s.validateType)('Flow') },
+ });
+ i('ExistsTypeAnnotation', { aliases: ['FlowType'] });
+ i('FunctionTypeAnnotation', {
+ visitor: ['typeParameters', 'params', 'rest', 'returnType'],
+ aliases: ['FlowType'],
+ fields: {
+ typeParameters: (0, s.validateOptionalType)(
+ 'TypeParameterDeclaration',
+ ),
+ params: (0, s.validate)((0, s.arrayOfType)('FunctionTypeParam')),
+ rest: (0, s.validateOptionalType)('FunctionTypeParam'),
+ this: (0, s.validateOptionalType)('FunctionTypeParam'),
+ returnType: (0, s.validateType)('FlowType'),
+ },
+ });
+ i('FunctionTypeParam', {
+ visitor: ['name', 'typeAnnotation'],
+ fields: {
+ name: (0, s.validateOptionalType)('Identifier'),
+ typeAnnotation: (0, s.validateType)('FlowType'),
+ optional: (0, s.validateOptional)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('GenericTypeAnnotation', {
+ visitor: ['id', 'typeParameters'],
+ aliases: ['FlowType'],
+ fields: {
+ id: (0, s.validateType)(['Identifier', 'QualifiedTypeIdentifier']),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TypeParameterInstantiation',
+ ),
+ },
+ });
+ i('InferredPredicate', { aliases: ['FlowPredicate'] });
+ i('InterfaceExtends', {
+ visitor: ['id', 'typeParameters'],
+ fields: {
+ id: (0, s.validateType)(['Identifier', 'QualifiedTypeIdentifier']),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TypeParameterInstantiation',
+ ),
+ },
+ });
+ defineInterfaceishType('InterfaceDeclaration');
+ i('InterfaceTypeAnnotation', {
+ visitor: ['extends', 'body'],
+ aliases: ['FlowType'],
+ fields: {
+ extends: (0, s.validateOptional)(
+ (0, s.arrayOfType)('InterfaceExtends'),
+ ),
+ body: (0, s.validateType)('ObjectTypeAnnotation'),
+ },
+ });
+ i('IntersectionTypeAnnotation', {
+ visitor: ['types'],
+ aliases: ['FlowType'],
+ fields: { types: (0, s.validate)((0, s.arrayOfType)('FlowType')) },
+ });
+ i('MixedTypeAnnotation', { aliases: ['FlowType', 'FlowBaseAnnotation'] });
+ i('EmptyTypeAnnotation', { aliases: ['FlowType', 'FlowBaseAnnotation'] });
+ i('NullableTypeAnnotation', {
+ visitor: ['typeAnnotation'],
+ aliases: ['FlowType'],
+ fields: { typeAnnotation: (0, s.validateType)('FlowType') },
+ });
+ i('NumberLiteralTypeAnnotation', {
+ builder: ['value'],
+ aliases: ['FlowType'],
+ fields: { value: (0, s.validate)((0, s.assertValueType)('number')) },
+ });
+ i('NumberTypeAnnotation', {
+ aliases: ['FlowType', 'FlowBaseAnnotation'],
+ });
+ i('ObjectTypeAnnotation', {
+ visitor: ['properties', 'indexers', 'callProperties', 'internalSlots'],
+ aliases: ['FlowType'],
+ builder: [
+ 'properties',
+ 'indexers',
+ 'callProperties',
+ 'internalSlots',
+ 'exact',
+ ],
+ fields: {
+ properties: (0, s.validate)(
+ (0, s.arrayOfType)([
+ 'ObjectTypeProperty',
+ 'ObjectTypeSpreadProperty',
+ ]),
+ ),
+ indexers: {
+ validate: (0, s.arrayOfType)('ObjectTypeIndexer'),
+ optional: true,
+ default: [],
+ },
+ callProperties: {
+ validate: (0, s.arrayOfType)('ObjectTypeCallProperty'),
+ optional: true,
+ default: [],
+ },
+ internalSlots: {
+ validate: (0, s.arrayOfType)('ObjectTypeInternalSlot'),
+ optional: true,
+ default: [],
+ },
+ exact: {
+ validate: (0, s.assertValueType)('boolean'),
+ default: false,
+ },
+ inexact: (0, s.validateOptional)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('ObjectTypeInternalSlot', {
+ visitor: ['id', 'value', 'optional', 'static', 'method'],
+ aliases: ['UserWhitespacable'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ value: (0, s.validateType)('FlowType'),
+ optional: (0, s.validate)((0, s.assertValueType)('boolean')),
+ static: (0, s.validate)((0, s.assertValueType)('boolean')),
+ method: (0, s.validate)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('ObjectTypeCallProperty', {
+ visitor: ['value'],
+ aliases: ['UserWhitespacable'],
+ fields: {
+ value: (0, s.validateType)('FlowType'),
+ static: (0, s.validate)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('ObjectTypeIndexer', {
+ visitor: ['id', 'key', 'value', 'variance'],
+ aliases: ['UserWhitespacable'],
+ fields: {
+ id: (0, s.validateOptionalType)('Identifier'),
+ key: (0, s.validateType)('FlowType'),
+ value: (0, s.validateType)('FlowType'),
+ static: (0, s.validate)((0, s.assertValueType)('boolean')),
+ variance: (0, s.validateOptionalType)('Variance'),
+ },
+ });
+ i('ObjectTypeProperty', {
+ visitor: ['key', 'value', 'variance'],
+ aliases: ['UserWhitespacable'],
+ fields: {
+ key: (0, s.validateType)(['Identifier', 'StringLiteral']),
+ value: (0, s.validateType)('FlowType'),
+ kind: (0, s.validate)((0, s.assertOneOf)('init', 'get', 'set')),
+ static: (0, s.validate)((0, s.assertValueType)('boolean')),
+ proto: (0, s.validate)((0, s.assertValueType)('boolean')),
+ optional: (0, s.validate)((0, s.assertValueType)('boolean')),
+ variance: (0, s.validateOptionalType)('Variance'),
+ method: (0, s.validate)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('ObjectTypeSpreadProperty', {
+ visitor: ['argument'],
+ aliases: ['UserWhitespacable'],
+ fields: { argument: (0, s.validateType)('FlowType') },
+ });
+ i('OpaqueType', {
+ visitor: ['id', 'typeParameters', 'supertype', 'impltype'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TypeParameterDeclaration',
+ ),
+ supertype: (0, s.validateOptionalType)('FlowType'),
+ impltype: (0, s.validateType)('FlowType'),
+ },
+ });
+ i('QualifiedTypeIdentifier', {
+ visitor: ['id', 'qualification'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ qualification: (0, s.validateType)([
+ 'Identifier',
+ 'QualifiedTypeIdentifier',
+ ]),
+ },
+ });
+ i('StringLiteralTypeAnnotation', {
+ builder: ['value'],
+ aliases: ['FlowType'],
+ fields: { value: (0, s.validate)((0, s.assertValueType)('string')) },
+ });
+ i('StringTypeAnnotation', {
+ aliases: ['FlowType', 'FlowBaseAnnotation'],
+ });
+ i('SymbolTypeAnnotation', {
+ aliases: ['FlowType', 'FlowBaseAnnotation'],
+ });
+ i('ThisTypeAnnotation', { aliases: ['FlowType', 'FlowBaseAnnotation'] });
+ i('TupleTypeAnnotation', {
+ visitor: ['types'],
+ aliases: ['FlowType'],
+ fields: { types: (0, s.validate)((0, s.arrayOfType)('FlowType')) },
+ });
+ i('TypeofTypeAnnotation', {
+ visitor: ['argument'],
+ aliases: ['FlowType'],
+ fields: { argument: (0, s.validateType)('FlowType') },
+ });
+ i('TypeAlias', {
+ visitor: ['id', 'typeParameters', 'right'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TypeParameterDeclaration',
+ ),
+ right: (0, s.validateType)('FlowType'),
+ },
+ });
+ i('TypeAnnotation', {
+ visitor: ['typeAnnotation'],
+ fields: { typeAnnotation: (0, s.validateType)('FlowType') },
+ });
+ i('TypeCastExpression', {
+ visitor: ['expression', 'typeAnnotation'],
+ aliases: ['ExpressionWrapper', 'Expression'],
+ fields: {
+ expression: (0, s.validateType)('Expression'),
+ typeAnnotation: (0, s.validateType)('TypeAnnotation'),
+ },
+ });
+ i('TypeParameter', {
+ visitor: ['bound', 'default', 'variance'],
+ fields: {
+ name: (0, s.validate)((0, s.assertValueType)('string')),
+ bound: (0, s.validateOptionalType)('TypeAnnotation'),
+ default: (0, s.validateOptionalType)('FlowType'),
+ variance: (0, s.validateOptionalType)('Variance'),
+ },
+ });
+ i('TypeParameterDeclaration', {
+ visitor: ['params'],
+ fields: {
+ params: (0, s.validate)((0, s.arrayOfType)('TypeParameter')),
+ },
+ });
+ i('TypeParameterInstantiation', {
+ visitor: ['params'],
+ fields: { params: (0, s.validate)((0, s.arrayOfType)('FlowType')) },
+ });
+ i('UnionTypeAnnotation', {
+ visitor: ['types'],
+ aliases: ['FlowType'],
+ fields: { types: (0, s.validate)((0, s.arrayOfType)('FlowType')) },
+ });
+ i('Variance', {
+ builder: ['kind'],
+ fields: { kind: (0, s.validate)((0, s.assertOneOf)('minus', 'plus')) },
+ });
+ i('VoidTypeAnnotation', { aliases: ['FlowType', 'FlowBaseAnnotation'] });
+ i('EnumDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'body'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ body: (0, s.validateType)([
+ 'EnumBooleanBody',
+ 'EnumNumberBody',
+ 'EnumStringBody',
+ 'EnumSymbolBody',
+ ]),
+ },
+ });
+ i('EnumBooleanBody', {
+ aliases: ['EnumBody'],
+ visitor: ['members'],
+ fields: {
+ explicitType: (0, s.validate)((0, s.assertValueType)('boolean')),
+ members: (0, s.validateArrayOfType)('EnumBooleanMember'),
+ hasUnknownMembers: (0, s.validate)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('EnumNumberBody', {
+ aliases: ['EnumBody'],
+ visitor: ['members'],
+ fields: {
+ explicitType: (0, s.validate)((0, s.assertValueType)('boolean')),
+ members: (0, s.validateArrayOfType)('EnumNumberMember'),
+ hasUnknownMembers: (0, s.validate)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('EnumStringBody', {
+ aliases: ['EnumBody'],
+ visitor: ['members'],
+ fields: {
+ explicitType: (0, s.validate)((0, s.assertValueType)('boolean')),
+ members: (0, s.validateArrayOfType)([
+ 'EnumStringMember',
+ 'EnumDefaultedMember',
+ ]),
+ hasUnknownMembers: (0, s.validate)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('EnumSymbolBody', {
+ aliases: ['EnumBody'],
+ visitor: ['members'],
+ fields: {
+ members: (0, s.validateArrayOfType)('EnumDefaultedMember'),
+ hasUnknownMembers: (0, s.validate)((0, s.assertValueType)('boolean')),
+ },
+ });
+ i('EnumBooleanMember', {
+ aliases: ['EnumMember'],
+ visitor: ['id'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ init: (0, s.validateType)('BooleanLiteral'),
+ },
+ });
+ i('EnumNumberMember', {
+ aliases: ['EnumMember'],
+ visitor: ['id', 'init'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ init: (0, s.validateType)('NumericLiteral'),
+ },
+ });
+ i('EnumStringMember', {
+ aliases: ['EnumMember'],
+ visitor: ['id', 'init'],
+ fields: {
+ id: (0, s.validateType)('Identifier'),
+ init: (0, s.validateType)('StringLiteral'),
+ },
+ });
+ i('EnumDefaultedMember', {
+ aliases: ['EnumMember'],
+ visitor: ['id'],
+ fields: { id: (0, s.validateType)('Identifier') },
+ });
+ i('IndexedAccessType', {
+ visitor: ['objectType', 'indexType'],
+ aliases: ['FlowType'],
+ fields: {
+ objectType: (0, s.validateType)('FlowType'),
+ indexType: (0, s.validateType)('FlowType'),
+ },
+ });
+ i('OptionalIndexedAccessType', {
+ visitor: ['objectType', 'indexType'],
+ aliases: ['FlowType'],
+ fields: {
+ objectType: (0, s.validateType)('FlowType'),
+ indexType: (0, s.validateType)('FlowType'),
+ optional: (0, s.validate)((0, s.assertValueType)('boolean')),
+ },
+ });
+ },
+ 7405: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ Object.defineProperty(t, 'ALIAS_KEYS', {
+ enumerable: true,
+ get: function () {
+ return i.ALIAS_KEYS;
+ },
+ });
+ Object.defineProperty(t, 'BUILDER_KEYS', {
+ enumerable: true,
+ get: function () {
+ return i.BUILDER_KEYS;
+ },
+ });
+ Object.defineProperty(t, 'DEPRECATED_ALIASES', {
+ enumerable: true,
+ get: function () {
+ return a.DEPRECATED_ALIASES;
+ },
+ });
+ Object.defineProperty(t, 'DEPRECATED_KEYS', {
+ enumerable: true,
+ get: function () {
+ return i.DEPRECATED_KEYS;
+ },
+ });
+ Object.defineProperty(t, 'FLIPPED_ALIAS_KEYS', {
+ enumerable: true,
+ get: function () {
+ return i.FLIPPED_ALIAS_KEYS;
+ },
+ });
+ Object.defineProperty(t, 'NODE_FIELDS', {
+ enumerable: true,
+ get: function () {
+ return i.NODE_FIELDS;
+ },
+ });
+ Object.defineProperty(t, 'NODE_PARENT_VALIDATIONS', {
+ enumerable: true,
+ get: function () {
+ return i.NODE_PARENT_VALIDATIONS;
+ },
+ });
+ Object.defineProperty(t, 'PLACEHOLDERS', {
+ enumerable: true,
+ get: function () {
+ return n.PLACEHOLDERS;
+ },
+ });
+ Object.defineProperty(t, 'PLACEHOLDERS_ALIAS', {
+ enumerable: true,
+ get: function () {
+ return n.PLACEHOLDERS_ALIAS;
+ },
+ });
+ Object.defineProperty(t, 'PLACEHOLDERS_FLIPPED_ALIAS', {
+ enumerable: true,
+ get: function () {
+ return n.PLACEHOLDERS_FLIPPED_ALIAS;
+ },
+ });
+ t.TYPES = void 0;
+ Object.defineProperty(t, 'VISITOR_KEYS', {
+ enumerable: true,
+ get: function () {
+ return i.VISITOR_KEYS;
+ },
+ });
+ var s = r(6802);
+ r(5967);
+ r(7069);
+ r(4746);
+ r(6742);
+ r(5035);
+ r(4488);
+ var i = r(1903);
+ var n = r(1141);
+ var a = r(1875);
+ Object.keys(a.DEPRECATED_ALIASES).forEach((e) => {
+ i.FLIPPED_ALIAS_KEYS[e] = i.FLIPPED_ALIAS_KEYS[a.DEPRECATED_ALIASES[e]];
+ });
+ s(i.VISITOR_KEYS);
+ s(i.ALIAS_KEYS);
+ s(i.FLIPPED_ALIAS_KEYS);
+ s(i.NODE_FIELDS);
+ s(i.BUILDER_KEYS);
+ s(i.DEPRECATED_KEYS);
+ s(n.PLACEHOLDERS_ALIAS);
+ s(n.PLACEHOLDERS_FLIPPED_ALIAS);
+ const o = (t.TYPES = [].concat(
+ Object.keys(i.VISITOR_KEYS),
+ Object.keys(i.FLIPPED_ALIAS_KEYS),
+ Object.keys(i.DEPRECATED_KEYS),
+ ));
+ },
+ 4746: function (e, t, r) {
+ 'use strict';
+ var s = r(1903);
+ const i = (0, s.defineAliasedType)('JSX');
+ i('JSXAttribute', {
+ visitor: ['name', 'value'],
+ aliases: ['Immutable'],
+ fields: {
+ name: {
+ validate: (0, s.assertNodeType)(
+ 'JSXIdentifier',
+ 'JSXNamespacedName',
+ ),
+ },
+ value: {
+ optional: true,
+ validate: (0, s.assertNodeType)(
+ 'JSXElement',
+ 'JSXFragment',
+ 'StringLiteral',
+ 'JSXExpressionContainer',
+ ),
+ },
+ },
+ });
+ i('JSXClosingElement', {
+ visitor: ['name'],
+ aliases: ['Immutable'],
+ fields: {
+ name: {
+ validate: (0, s.assertNodeType)(
+ 'JSXIdentifier',
+ 'JSXMemberExpression',
+ 'JSXNamespacedName',
+ ),
+ },
+ },
+ });
+ i('JSXElement', {
+ builder: [
+ 'openingElement',
+ 'closingElement',
+ 'children',
+ 'selfClosing',
+ ],
+ visitor: ['openingElement', 'children', 'closingElement'],
+ aliases: ['Immutable', 'Expression'],
+ fields: Object.assign(
+ {
+ openingElement: {
+ validate: (0, s.assertNodeType)('JSXOpeningElement'),
+ },
+ closingElement: {
+ optional: true,
+ validate: (0, s.assertNodeType)('JSXClosingElement'),
+ },
+ children: {
+ validate: (0, s.chain)(
+ (0, s.assertValueType)('array'),
+ (0, s.assertEach)(
+ (0, s.assertNodeType)(
+ 'JSXText',
+ 'JSXExpressionContainer',
+ 'JSXSpreadChild',
+ 'JSXElement',
+ 'JSXFragment',
+ ),
+ ),
+ ),
+ },
+ },
+ {
+ selfClosing: {
+ validate: (0, s.assertValueType)('boolean'),
+ optional: true,
+ },
+ },
+ ),
+ });
+ i('JSXEmptyExpression', {});
+ i('JSXExpressionContainer', {
+ visitor: ['expression'],
+ aliases: ['Immutable'],
+ fields: {
+ expression: {
+ validate: (0, s.assertNodeType)('Expression', 'JSXEmptyExpression'),
+ },
+ },
+ });
+ i('JSXSpreadChild', {
+ visitor: ['expression'],
+ aliases: ['Immutable'],
+ fields: {
+ expression: { validate: (0, s.assertNodeType)('Expression') },
+ },
+ });
+ i('JSXIdentifier', {
+ builder: ['name'],
+ fields: { name: { validate: (0, s.assertValueType)('string') } },
+ });
+ i('JSXMemberExpression', {
+ visitor: ['object', 'property'],
+ fields: {
+ object: {
+ validate: (0, s.assertNodeType)(
+ 'JSXMemberExpression',
+ 'JSXIdentifier',
+ ),
+ },
+ property: { validate: (0, s.assertNodeType)('JSXIdentifier') },
+ },
+ });
+ i('JSXNamespacedName', {
+ visitor: ['namespace', 'name'],
+ fields: {
+ namespace: { validate: (0, s.assertNodeType)('JSXIdentifier') },
+ name: { validate: (0, s.assertNodeType)('JSXIdentifier') },
+ },
+ });
+ i('JSXOpeningElement', {
+ builder: ['name', 'attributes', 'selfClosing'],
+ visitor: ['name', 'attributes'],
+ aliases: ['Immutable'],
+ fields: {
+ name: {
+ validate: (0, s.assertNodeType)(
+ 'JSXIdentifier',
+ 'JSXMemberExpression',
+ 'JSXNamespacedName',
+ ),
+ },
+ selfClosing: { default: false },
+ attributes: {
+ validate: (0, s.chain)(
+ (0, s.assertValueType)('array'),
+ (0, s.assertEach)(
+ (0, s.assertNodeType)('JSXAttribute', 'JSXSpreadAttribute'),
+ ),
+ ),
+ },
+ typeParameters: {
+ validate: (0, s.assertNodeType)(
+ 'TypeParameterInstantiation',
+ 'TSTypeParameterInstantiation',
+ ),
+ optional: true,
+ },
+ },
+ });
+ i('JSXSpreadAttribute', {
+ visitor: ['argument'],
+ fields: { argument: { validate: (0, s.assertNodeType)('Expression') } },
+ });
+ i('JSXText', {
+ aliases: ['Immutable'],
+ builder: ['value'],
+ fields: { value: { validate: (0, s.assertValueType)('string') } },
+ });
+ i('JSXFragment', {
+ builder: ['openingFragment', 'closingFragment', 'children'],
+ visitor: ['openingFragment', 'children', 'closingFragment'],
+ aliases: ['Immutable', 'Expression'],
+ fields: {
+ openingFragment: {
+ validate: (0, s.assertNodeType)('JSXOpeningFragment'),
+ },
+ closingFragment: {
+ validate: (0, s.assertNodeType)('JSXClosingFragment'),
+ },
+ children: {
+ validate: (0, s.chain)(
+ (0, s.assertValueType)('array'),
+ (0, s.assertEach)(
+ (0, s.assertNodeType)(
+ 'JSXText',
+ 'JSXExpressionContainer',
+ 'JSXSpreadChild',
+ 'JSXElement',
+ 'JSXFragment',
+ ),
+ ),
+ ),
+ },
+ },
+ });
+ i('JSXOpeningFragment', { aliases: ['Immutable'] });
+ i('JSXClosingFragment', { aliases: ['Immutable'] });
+ },
+ 6742: function (e, t, r) {
+ 'use strict';
+ var s = r(1903);
+ var i = r(1141);
+ const n = (0, s.defineAliasedType)('Miscellaneous');
+ {
+ n('Noop', { visitor: [] });
+ }
+ n('Placeholder', {
+ visitor: [],
+ builder: ['expectedNode', 'name'],
+ fields: {
+ name: { validate: (0, s.assertNodeType)('Identifier') },
+ expectedNode: { validate: (0, s.assertOneOf)(...i.PLACEHOLDERS) },
+ },
+ });
+ n('V8IntrinsicIdentifier', {
+ builder: ['name'],
+ fields: { name: { validate: (0, s.assertValueType)('string') } },
+ });
+ },
+ 1141: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.PLACEHOLDERS_FLIPPED_ALIAS =
+ t.PLACEHOLDERS_ALIAS =
+ t.PLACEHOLDERS =
+ void 0;
+ var s = r(1903);
+ const i = (t.PLACEHOLDERS = [
+ 'Identifier',
+ 'StringLiteral',
+ 'Expression',
+ 'Statement',
+ 'Declaration',
+ 'BlockStatement',
+ 'ClassBody',
+ 'Pattern',
+ ]);
+ const n = (t.PLACEHOLDERS_ALIAS = {
+ Declaration: ['Statement'],
+ Pattern: ['PatternLike', 'LVal'],
+ });
+ for (const e of i) {
+ const t = s.ALIAS_KEYS[e];
+ if (t != null && t.length) n[e] = t;
+ }
+ const a = (t.PLACEHOLDERS_FLIPPED_ALIAS = {});
+ Object.keys(n).forEach((e) => {
+ n[e].forEach((t) => {
+ if (!Object.hasOwnProperty.call(a, t)) {
+ a[t] = [];
+ }
+ a[t].push(e);
+ });
+ });
+ },
+ 4488: function (e, t, r) {
+ 'use strict';
+ var s = r(1903);
+ var i = r(5967);
+ var n = r(3685);
+ const a = (0, s.defineAliasedType)('TypeScript');
+ const o = (0, s.assertValueType)('boolean');
+ const tSFunctionTypeAnnotationCommon = () => ({
+ returnType: {
+ validate: (0, s.assertNodeType)('TSTypeAnnotation', 'Noop'),
+ optional: true,
+ },
+ typeParameters: {
+ validate: (0, s.assertNodeType)('TSTypeParameterDeclaration', 'Noop'),
+ optional: true,
+ },
+ });
+ a('TSParameterProperty', {
+ aliases: ['LVal'],
+ visitor: ['parameter'],
+ fields: {
+ accessibility: {
+ validate: (0, s.assertOneOf)('public', 'private', 'protected'),
+ optional: true,
+ },
+ readonly: {
+ validate: (0, s.assertValueType)('boolean'),
+ optional: true,
+ },
+ parameter: {
+ validate: (0, s.assertNodeType)('Identifier', 'AssignmentPattern'),
+ },
+ override: {
+ validate: (0, s.assertValueType)('boolean'),
+ optional: true,
+ },
+ decorators: {
+ validate: (0, s.chain)(
+ (0, s.assertValueType)('array'),
+ (0, s.assertEach)((0, s.assertNodeType)('Decorator')),
+ ),
+ optional: true,
+ },
+ },
+ });
+ a('TSDeclareFunction', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'typeParameters', 'params', 'returnType'],
+ fields: Object.assign(
+ {},
+ (0, i.functionDeclarationCommon)(),
+ tSFunctionTypeAnnotationCommon(),
+ ),
+ });
+ a('TSDeclareMethod', {
+ visitor: [
+ 'decorators',
+ 'key',
+ 'typeParameters',
+ 'params',
+ 'returnType',
+ ],
+ fields: Object.assign(
+ {},
+ (0, i.classMethodOrDeclareMethodCommon)(),
+ tSFunctionTypeAnnotationCommon(),
+ ),
+ });
+ a('TSQualifiedName', {
+ aliases: ['TSEntityName'],
+ visitor: ['left', 'right'],
+ fields: {
+ left: (0, s.validateType)('TSEntityName'),
+ right: (0, s.validateType)('Identifier'),
+ },
+ });
+ const signatureDeclarationCommon = () => ({
+ typeParameters: (0, s.validateOptionalType)(
+ 'TSTypeParameterDeclaration',
+ ),
+ ['parameters']: (0, s.validateArrayOfType)([
+ 'ArrayPattern',
+ 'Identifier',
+ 'ObjectPattern',
+ 'RestElement',
+ ]),
+ ['typeAnnotation']: (0, s.validateOptionalType)('TSTypeAnnotation'),
+ });
+ const l = {
+ aliases: ['TSTypeElement'],
+ visitor: ['typeParameters', 'parameters', 'typeAnnotation'],
+ fields: signatureDeclarationCommon(),
+ };
+ a('TSCallSignatureDeclaration', l);
+ a('TSConstructSignatureDeclaration', l);
+ const namedTypeElementCommon = () => ({
+ key: (0, s.validateType)('Expression'),
+ computed: { default: false },
+ optional: (0, s.validateOptional)(o),
+ });
+ a('TSPropertySignature', {
+ aliases: ['TSTypeElement'],
+ visitor: ['key', 'typeAnnotation', 'initializer'],
+ fields: Object.assign({}, namedTypeElementCommon(), {
+ readonly: (0, s.validateOptional)(o),
+ typeAnnotation: (0, s.validateOptionalType)('TSTypeAnnotation'),
+ initializer: (0, s.validateOptionalType)('Expression'),
+ kind: { validate: (0, s.assertOneOf)('get', 'set') },
+ }),
+ });
+ a('TSMethodSignature', {
+ aliases: ['TSTypeElement'],
+ visitor: ['key', 'typeParameters', 'parameters', 'typeAnnotation'],
+ fields: Object.assign(
+ {},
+ signatureDeclarationCommon(),
+ namedTypeElementCommon(),
+ { kind: { validate: (0, s.assertOneOf)('method', 'get', 'set') } },
+ ),
+ });
+ a('TSIndexSignature', {
+ aliases: ['TSTypeElement'],
+ visitor: ['parameters', 'typeAnnotation'],
+ fields: {
+ readonly: (0, s.validateOptional)(o),
+ static: (0, s.validateOptional)(o),
+ parameters: (0, s.validateArrayOfType)('Identifier'),
+ typeAnnotation: (0, s.validateOptionalType)('TSTypeAnnotation'),
+ },
+ });
+ const c = [
+ 'TSAnyKeyword',
+ 'TSBooleanKeyword',
+ 'TSBigIntKeyword',
+ 'TSIntrinsicKeyword',
+ 'TSNeverKeyword',
+ 'TSNullKeyword',
+ 'TSNumberKeyword',
+ 'TSObjectKeyword',
+ 'TSStringKeyword',
+ 'TSSymbolKeyword',
+ 'TSUndefinedKeyword',
+ 'TSUnknownKeyword',
+ 'TSVoidKeyword',
+ ];
+ for (const e of c) {
+ a(e, { aliases: ['TSType', 'TSBaseType'], visitor: [], fields: {} });
+ }
+ a('TSThisType', {
+ aliases: ['TSType', 'TSBaseType'],
+ visitor: [],
+ fields: {},
+ });
+ const p = {
+ aliases: ['TSType'],
+ visitor: ['typeParameters', 'parameters', 'typeAnnotation'],
+ };
+ a(
+ 'TSFunctionType',
+ Object.assign({}, p, { fields: signatureDeclarationCommon() }),
+ );
+ a(
+ 'TSConstructorType',
+ Object.assign({}, p, {
+ fields: Object.assign({}, signatureDeclarationCommon(), {
+ abstract: (0, s.validateOptional)(o),
+ }),
+ }),
+ );
+ a('TSTypeReference', {
+ aliases: ['TSType'],
+ visitor: ['typeName', 'typeParameters'],
+ fields: {
+ typeName: (0, s.validateType)('TSEntityName'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TSTypeParameterInstantiation',
+ ),
+ },
+ });
+ a('TSTypePredicate', {
+ aliases: ['TSType'],
+ visitor: ['parameterName', 'typeAnnotation'],
+ builder: ['parameterName', 'typeAnnotation', 'asserts'],
+ fields: {
+ parameterName: (0, s.validateType)(['Identifier', 'TSThisType']),
+ typeAnnotation: (0, s.validateOptionalType)('TSTypeAnnotation'),
+ asserts: (0, s.validateOptional)(o),
+ },
+ });
+ a('TSTypeQuery', {
+ aliases: ['TSType'],
+ visitor: ['exprName', 'typeParameters'],
+ fields: {
+ exprName: (0, s.validateType)(['TSEntityName', 'TSImportType']),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TSTypeParameterInstantiation',
+ ),
+ },
+ });
+ a('TSTypeLiteral', {
+ aliases: ['TSType'],
+ visitor: ['members'],
+ fields: { members: (0, s.validateArrayOfType)('TSTypeElement') },
+ });
+ a('TSArrayType', {
+ aliases: ['TSType'],
+ visitor: ['elementType'],
+ fields: { elementType: (0, s.validateType)('TSType') },
+ });
+ a('TSTupleType', {
+ aliases: ['TSType'],
+ visitor: ['elementTypes'],
+ fields: {
+ elementTypes: (0, s.validateArrayOfType)([
+ 'TSType',
+ 'TSNamedTupleMember',
+ ]),
+ },
+ });
+ a('TSOptionalType', {
+ aliases: ['TSType'],
+ visitor: ['typeAnnotation'],
+ fields: { typeAnnotation: (0, s.validateType)('TSType') },
+ });
+ a('TSRestType', {
+ aliases: ['TSType'],
+ visitor: ['typeAnnotation'],
+ fields: { typeAnnotation: (0, s.validateType)('TSType') },
+ });
+ a('TSNamedTupleMember', {
+ visitor: ['label', 'elementType'],
+ builder: ['label', 'elementType', 'optional'],
+ fields: {
+ label: (0, s.validateType)('Identifier'),
+ optional: { validate: o, default: false },
+ elementType: (0, s.validateType)('TSType'),
+ },
+ });
+ const u = {
+ aliases: ['TSType'],
+ visitor: ['types'],
+ fields: { types: (0, s.validateArrayOfType)('TSType') },
+ };
+ a('TSUnionType', u);
+ a('TSIntersectionType', u);
+ a('TSConditionalType', {
+ aliases: ['TSType'],
+ visitor: ['checkType', 'extendsType', 'trueType', 'falseType'],
+ fields: {
+ checkType: (0, s.validateType)('TSType'),
+ extendsType: (0, s.validateType)('TSType'),
+ trueType: (0, s.validateType)('TSType'),
+ falseType: (0, s.validateType)('TSType'),
+ },
+ });
+ a('TSInferType', {
+ aliases: ['TSType'],
+ visitor: ['typeParameter'],
+ fields: { typeParameter: (0, s.validateType)('TSTypeParameter') },
+ });
+ a('TSParenthesizedType', {
+ aliases: ['TSType'],
+ visitor: ['typeAnnotation'],
+ fields: { typeAnnotation: (0, s.validateType)('TSType') },
+ });
+ a('TSTypeOperator', {
+ aliases: ['TSType'],
+ visitor: ['typeAnnotation'],
+ fields: {
+ operator: (0, s.validate)((0, s.assertValueType)('string')),
+ typeAnnotation: (0, s.validateType)('TSType'),
+ },
+ });
+ a('TSIndexedAccessType', {
+ aliases: ['TSType'],
+ visitor: ['objectType', 'indexType'],
+ fields: {
+ objectType: (0, s.validateType)('TSType'),
+ indexType: (0, s.validateType)('TSType'),
+ },
+ });
+ a('TSMappedType', {
+ aliases: ['TSType'],
+ visitor: ['typeParameter', 'typeAnnotation', 'nameType'],
+ fields: {
+ readonly: (0, s.validateOptional)(
+ (0, s.assertOneOf)(true, false, '+', '-'),
+ ),
+ typeParameter: (0, s.validateType)('TSTypeParameter'),
+ optional: (0, s.validateOptional)(
+ (0, s.assertOneOf)(true, false, '+', '-'),
+ ),
+ typeAnnotation: (0, s.validateOptionalType)('TSType'),
+ nameType: (0, s.validateOptionalType)('TSType'),
+ },
+ });
+ a('TSLiteralType', {
+ aliases: ['TSType', 'TSBaseType'],
+ visitor: ['literal'],
+ fields: {
+ literal: {
+ validate: (function () {
+ const e = (0, s.assertNodeType)(
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ );
+ const t = (0, s.assertOneOf)('-');
+ const r = (0, s.assertNodeType)(
+ 'NumericLiteral',
+ 'StringLiteral',
+ 'BooleanLiteral',
+ 'BigIntLiteral',
+ 'TemplateLiteral',
+ );
+ function validator(s, i, a) {
+ if ((0, n.default)('UnaryExpression', a)) {
+ t(a, 'operator', a.operator);
+ e(a, 'argument', a.argument);
+ } else {
+ r(s, i, a);
+ }
+ }
+ validator.oneOfNodeTypes = [
+ 'NumericLiteral',
+ 'StringLiteral',
+ 'BooleanLiteral',
+ 'BigIntLiteral',
+ 'TemplateLiteral',
+ 'UnaryExpression',
+ ];
+ return validator;
+ })(),
+ },
+ },
+ });
+ a('TSExpressionWithTypeArguments', {
+ aliases: ['TSType'],
+ visitor: ['expression', 'typeParameters'],
+ fields: {
+ expression: (0, s.validateType)('TSEntityName'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TSTypeParameterInstantiation',
+ ),
+ },
+ });
+ a('TSInterfaceDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'typeParameters', 'extends', 'body'],
+ fields: {
+ declare: (0, s.validateOptional)(o),
+ id: (0, s.validateType)('Identifier'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TSTypeParameterDeclaration',
+ ),
+ extends: (0, s.validateOptional)(
+ (0, s.arrayOfType)('TSExpressionWithTypeArguments'),
+ ),
+ body: (0, s.validateType)('TSInterfaceBody'),
+ },
+ });
+ a('TSInterfaceBody', {
+ visitor: ['body'],
+ fields: { body: (0, s.validateArrayOfType)('TSTypeElement') },
+ });
+ a('TSTypeAliasDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'typeParameters', 'typeAnnotation'],
+ fields: {
+ declare: (0, s.validateOptional)(o),
+ id: (0, s.validateType)('Identifier'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TSTypeParameterDeclaration',
+ ),
+ typeAnnotation: (0, s.validateType)('TSType'),
+ },
+ });
+ a('TSInstantiationExpression', {
+ aliases: ['Expression'],
+ visitor: ['expression', 'typeParameters'],
+ fields: {
+ expression: (0, s.validateType)('Expression'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TSTypeParameterInstantiation',
+ ),
+ },
+ });
+ const d = {
+ aliases: ['Expression', 'LVal', 'PatternLike'],
+ visitor: ['expression', 'typeAnnotation'],
+ fields: {
+ expression: (0, s.validateType)('Expression'),
+ typeAnnotation: (0, s.validateType)('TSType'),
+ },
+ };
+ a('TSAsExpression', d);
+ a('TSSatisfiesExpression', d);
+ a('TSTypeAssertion', {
+ aliases: ['Expression', 'LVal', 'PatternLike'],
+ visitor: ['typeAnnotation', 'expression'],
+ fields: {
+ typeAnnotation: (0, s.validateType)('TSType'),
+ expression: (0, s.validateType)('Expression'),
+ },
+ });
+ a('TSEnumDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'members'],
+ fields: {
+ declare: (0, s.validateOptional)(o),
+ const: (0, s.validateOptional)(o),
+ id: (0, s.validateType)('Identifier'),
+ members: (0, s.validateArrayOfType)('TSEnumMember'),
+ initializer: (0, s.validateOptionalType)('Expression'),
+ },
+ });
+ a('TSEnumMember', {
+ visitor: ['id', 'initializer'],
+ fields: {
+ id: (0, s.validateType)(['Identifier', 'StringLiteral']),
+ initializer: (0, s.validateOptionalType)('Expression'),
+ },
+ });
+ a('TSModuleDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'body'],
+ fields: {
+ declare: (0, s.validateOptional)(o),
+ global: (0, s.validateOptional)(o),
+ id: (0, s.validateType)(['Identifier', 'StringLiteral']),
+ body: (0, s.validateType)(['TSModuleBlock', 'TSModuleDeclaration']),
+ },
+ });
+ a('TSModuleBlock', {
+ aliases: ['Scopable', 'Block', 'BlockParent', 'FunctionParent'],
+ visitor: ['body'],
+ fields: { body: (0, s.validateArrayOfType)('Statement') },
+ });
+ a('TSImportType', {
+ aliases: ['TSType'],
+ visitor: ['argument', 'qualifier', 'typeParameters'],
+ fields: {
+ argument: (0, s.validateType)('StringLiteral'),
+ qualifier: (0, s.validateOptionalType)('TSEntityName'),
+ typeParameters: (0, s.validateOptionalType)(
+ 'TSTypeParameterInstantiation',
+ ),
+ },
+ });
+ a('TSImportEqualsDeclaration', {
+ aliases: ['Statement'],
+ visitor: ['id', 'moduleReference'],
+ fields: {
+ isExport: (0, s.validate)(o),
+ id: (0, s.validateType)('Identifier'),
+ moduleReference: (0, s.validateType)([
+ 'TSEntityName',
+ 'TSExternalModuleReference',
+ ]),
+ importKind: {
+ validate: (0, s.assertOneOf)('type', 'value'),
+ optional: true,
+ },
+ },
+ });
+ a('TSExternalModuleReference', {
+ visitor: ['expression'],
+ fields: { expression: (0, s.validateType)('StringLiteral') },
+ });
+ a('TSNonNullExpression', {
+ aliases: ['Expression', 'LVal', 'PatternLike'],
+ visitor: ['expression'],
+ fields: { expression: (0, s.validateType)('Expression') },
+ });
+ a('TSExportAssignment', {
+ aliases: ['Statement'],
+ visitor: ['expression'],
+ fields: { expression: (0, s.validateType)('Expression') },
+ });
+ a('TSNamespaceExportDeclaration', {
+ aliases: ['Statement'],
+ visitor: ['id'],
+ fields: { id: (0, s.validateType)('Identifier') },
+ });
+ a('TSTypeAnnotation', {
+ visitor: ['typeAnnotation'],
+ fields: {
+ typeAnnotation: { validate: (0, s.assertNodeType)('TSType') },
+ },
+ });
+ a('TSTypeParameterInstantiation', {
+ visitor: ['params'],
+ fields: {
+ params: {
+ validate: (0, s.chain)(
+ (0, s.assertValueType)('array'),
+ (0, s.assertEach)((0, s.assertNodeType)('TSType')),
+ ),
+ },
+ },
+ });
+ a('TSTypeParameterDeclaration', {
+ visitor: ['params'],
+ fields: {
+ params: {
+ validate: (0, s.chain)(
+ (0, s.assertValueType)('array'),
+ (0, s.assertEach)((0, s.assertNodeType)('TSTypeParameter')),
+ ),
+ },
+ },
+ });
+ a('TSTypeParameter', {
+ builder: ['constraint', 'default', 'name'],
+ visitor: ['constraint', 'default'],
+ fields: {
+ name: { validate: (0, s.assertValueType)('string') },
+ in: { validate: (0, s.assertValueType)('boolean'), optional: true },
+ out: { validate: (0, s.assertValueType)('boolean'), optional: true },
+ const: {
+ validate: (0, s.assertValueType)('boolean'),
+ optional: true,
+ },
+ constraint: {
+ validate: (0, s.assertNodeType)('TSType'),
+ optional: true,
+ },
+ default: {
+ validate: (0, s.assertNodeType)('TSType'),
+ optional: true,
+ },
+ },
+ });
+ },
+ 1903: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.VISITOR_KEYS =
+ t.NODE_PARENT_VALIDATIONS =
+ t.NODE_FIELDS =
+ t.FLIPPED_ALIAS_KEYS =
+ t.DEPRECATED_KEYS =
+ t.BUILDER_KEYS =
+ t.ALIAS_KEYS =
+ void 0;
+ t.arrayOf = arrayOf;
+ t.arrayOfType = arrayOfType;
+ t.assertEach = assertEach;
+ t.assertNodeOrValueType = assertNodeOrValueType;
+ t.assertNodeType = assertNodeType;
+ t.assertOneOf = assertOneOf;
+ t.assertOptionalChainStart = assertOptionalChainStart;
+ t.assertShape = assertShape;
+ t.assertValueType = assertValueType;
+ t.chain = chain;
+ t['default'] = defineType;
+ t.defineAliasedType = defineAliasedType;
+ t.typeIs = typeIs;
+ t.validate = validate;
+ t.validateArrayOfType = validateArrayOfType;
+ t.validateOptional = validateOptional;
+ t.validateOptionalType = validateOptionalType;
+ t.validateType = validateType;
+ var s = r(3685);
+ var i = r(7159);
+ const n = (t.VISITOR_KEYS = {});
+ const a = (t.ALIAS_KEYS = {});
+ const o = (t.FLIPPED_ALIAS_KEYS = {});
+ const l = (t.NODE_FIELDS = {});
+ const c = (t.BUILDER_KEYS = {});
+ const p = (t.DEPRECATED_KEYS = {});
+ const u = (t.NODE_PARENT_VALIDATIONS = {});
+ function getType(e) {
+ if (Array.isArray(e)) {
+ return 'array';
+ } else if (e === null) {
+ return 'null';
+ } else {
+ return typeof e;
+ }
+ }
+ function validate(e) {
+ return { validate: e };
+ }
+ function typeIs(e) {
+ return typeof e === 'string' ? assertNodeType(e) : assertNodeType(...e);
+ }
+ function validateType(e) {
+ return validate(typeIs(e));
+ }
+ function validateOptional(e) {
+ return { validate: e, optional: true };
+ }
+ function validateOptionalType(e) {
+ return { validate: typeIs(e), optional: true };
+ }
+ function arrayOf(e) {
+ return chain(assertValueType('array'), assertEach(e));
+ }
+ function arrayOfType(e) {
+ return arrayOf(typeIs(e));
+ }
+ function validateArrayOfType(e) {
+ return validate(arrayOfType(e));
+ }
+ function assertEach(e) {
+ function validator(t, r, s) {
+ if (!Array.isArray(s)) return;
+ for (let n = 0; n < s.length; n++) {
+ const a = `${r}[${n}]`;
+ const o = s[n];
+ e(t, a, o);
+ if (process.env.BABEL_TYPES_8_BREAKING)
+ (0, i.validateChild)(t, a, o);
+ }
+ }
+ validator.each = e;
+ return validator;
+ }
+ function assertOneOf(...e) {
+ function validate(t, r, s) {
+ if (e.indexOf(s) < 0) {
+ throw new TypeError(
+ `Property ${r} expected value to be one of ${JSON.stringify(
+ e,
+ )} but got ${JSON.stringify(s)}`,
+ );
+ }
+ }
+ validate.oneOf = e;
+ return validate;
+ }
+ function assertNodeType(...e) {
+ function validate(t, r, n) {
+ for (const a of e) {
+ if ((0, s.default)(a, n)) {
+ (0, i.validateChild)(t, r, n);
+ return;
+ }
+ }
+ throw new TypeError(
+ `Property ${r} of ${
+ t.type
+ } expected node to be of a type ${JSON.stringify(
+ e,
+ )} but instead got ${JSON.stringify(n == null ? void 0 : n.type)}`,
+ );
+ }
+ validate.oneOfNodeTypes = e;
+ return validate;
+ }
+ function assertNodeOrValueType(...e) {
+ function validate(t, r, n) {
+ for (const a of e) {
+ if (getType(n) === a || (0, s.default)(a, n)) {
+ (0, i.validateChild)(t, r, n);
+ return;
+ }
+ }
+ throw new TypeError(
+ `Property ${r} of ${
+ t.type
+ } expected node to be of a type ${JSON.stringify(
+ e,
+ )} but instead got ${JSON.stringify(n == null ? void 0 : n.type)}`,
+ );
+ }
+ validate.oneOfNodeOrValueTypes = e;
+ return validate;
+ }
+ function assertValueType(e) {
+ function validate(t, r, s) {
+ const i = getType(s) === e;
+ if (!i) {
+ throw new TypeError(
+ `Property ${r} expected type of ${e} but got ${getType(s)}`,
+ );
+ }
+ }
+ validate.type = e;
+ return validate;
+ }
+ function assertShape(e) {
+ function validate(t, r, s) {
+ const n = [];
+ for (const r of Object.keys(e)) {
+ try {
+ (0, i.validateField)(t, r, s[r], e[r]);
+ } catch (e) {
+ if (e instanceof TypeError) {
+ n.push(e.message);
+ continue;
+ }
+ throw e;
+ }
+ }
+ if (n.length) {
+ throw new TypeError(
+ `Property ${r} of ${
+ t.type
+ } expected to have the following:\n${n.join('\n')}`,
+ );
+ }
+ }
+ validate.shapeOf = e;
+ return validate;
+ }
+ function assertOptionalChainStart() {
+ function validate(e) {
+ var t;
+ let r = e;
+ while (e) {
+ const { type: e } = r;
+ if (e === 'OptionalCallExpression') {
+ if (r.optional) return;
+ r = r.callee;
+ continue;
+ }
+ if (e === 'OptionalMemberExpression') {
+ if (r.optional) return;
+ r = r.object;
+ continue;
+ }
+ break;
+ }
+ throw new TypeError(
+ `Non-optional ${
+ e.type
+ } must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${
+ (t = r) == null ? void 0 : t.type
+ }`,
+ );
+ }
+ return validate;
+ }
+ function chain(...e) {
+ function validate(...t) {
+ for (const r of e) {
+ r(...t);
+ }
+ }
+ validate.chainOf = e;
+ if (
+ e.length >= 2 &&
+ 'type' in e[0] &&
+ e[0].type === 'array' &&
+ !('each' in e[1])
+ ) {
+ throw new Error(
+ `An assertValueType("array") validator can only be followed by an assertEach(...) validator.`,
+ );
+ }
+ return validate;
+ }
+ const d = [
+ 'aliases',
+ 'builder',
+ 'deprecatedAlias',
+ 'fields',
+ 'inherits',
+ 'visitor',
+ 'validate',
+ ];
+ const f = ['default', 'optional', 'deprecated', 'validate'];
+ const h = {};
+ function defineAliasedType(...e) {
+ return (t, r = {}) => {
+ let s = r.aliases;
+ if (!s) {
+ var i, n;
+ if (r.inherits)
+ s = (i = h[r.inherits].aliases) == null ? void 0 : i.slice();
+ (n = s) != null ? n : (s = []);
+ r.aliases = s;
+ }
+ const a = e.filter((e) => !s.includes(e));
+ s.unshift(...a);
+ defineType(t, r);
+ };
+ }
+ function defineType(e, t = {}) {
+ const r = (t.inherits && h[t.inherits]) || {};
+ let s = t.fields;
+ if (!s) {
+ s = {};
+ if (r.fields) {
+ const e = Object.getOwnPropertyNames(r.fields);
+ for (const t of e) {
+ const e = r.fields[t];
+ const i = e.default;
+ if (
+ Array.isArray(i) ? i.length > 0 : i && typeof i === 'object'
+ ) {
+ throw new Error(
+ 'field defaults can only be primitives or empty arrays currently',
+ );
+ }
+ s[t] = {
+ default: Array.isArray(i) ? [] : i,
+ optional: e.optional,
+ deprecated: e.deprecated,
+ validate: e.validate,
+ };
+ }
+ }
+ }
+ const i = t.visitor || r.visitor || [];
+ const y = t.aliases || r.aliases || [];
+ const m = t.builder || r.builder || t.visitor || [];
+ for (const r of Object.keys(t)) {
+ if (d.indexOf(r) === -1) {
+ throw new Error(`Unknown type option "${r}" on ${e}`);
+ }
+ }
+ if (t.deprecatedAlias) {
+ p[t.deprecatedAlias] = e;
+ }
+ for (const e of i.concat(m)) {
+ s[e] = s[e] || {};
+ }
+ for (const t of Object.keys(s)) {
+ const r = s[t];
+ if (r.default !== undefined && m.indexOf(t) === -1) {
+ r.optional = true;
+ }
+ if (r.default === undefined) {
+ r.default = null;
+ } else if (!r.validate && r.default != null) {
+ r.validate = assertValueType(getType(r.default));
+ }
+ for (const s of Object.keys(r)) {
+ if (f.indexOf(s) === -1) {
+ throw new Error(`Unknown field key "${s}" on ${e}.${t}`);
+ }
+ }
+ }
+ n[e] = t.visitor = i;
+ c[e] = t.builder = m;
+ l[e] = t.fields = s;
+ a[e] = t.aliases = y;
+ y.forEach((t) => {
+ o[t] = o[t] || [];
+ o[t].push(e);
+ });
+ if (t.validate) {
+ u[e] = t.validate;
+ }
+ h[e] = t;
+ }
+ },
+ 4739: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ var s = {
+ react: true,
+ assertNode: true,
+ createTypeAnnotationBasedOnTypeof: true,
+ createUnionTypeAnnotation: true,
+ createFlowUnionType: true,
+ createTSUnionType: true,
+ cloneNode: true,
+ clone: true,
+ cloneDeep: true,
+ cloneDeepWithoutLoc: true,
+ cloneWithoutLoc: true,
+ addComment: true,
+ addComments: true,
+ inheritInnerComments: true,
+ inheritLeadingComments: true,
+ inheritsComments: true,
+ inheritTrailingComments: true,
+ removeComments: true,
+ ensureBlock: true,
+ toBindingIdentifierName: true,
+ toBlock: true,
+ toComputedKey: true,
+ toExpression: true,
+ toIdentifier: true,
+ toKeyAlias: true,
+ toStatement: true,
+ valueToNode: true,
+ appendToMemberExpression: true,
+ inherits: true,
+ prependToMemberExpression: true,
+ removeProperties: true,
+ removePropertiesDeep: true,
+ removeTypeDuplicates: true,
+ getBindingIdentifiers: true,
+ getOuterBindingIdentifiers: true,
+ traverse: true,
+ traverseFast: true,
+ shallowEqual: true,
+ is: true,
+ isBinding: true,
+ isBlockScoped: true,
+ isImmutable: true,
+ isLet: true,
+ isNode: true,
+ isNodesEquivalent: true,
+ isPlaceholderType: true,
+ isReferenced: true,
+ isScope: true,
+ isSpecifierDefault: true,
+ isType: true,
+ isValidES3Identifier: true,
+ isValidIdentifier: true,
+ isVar: true,
+ matchesPattern: true,
+ validate: true,
+ buildMatchMemberExpression: true,
+ __internal__deprecationWarning: true,
+ };
+ Object.defineProperty(t, '__internal__deprecationWarning', {
+ enumerable: true,
+ get: function () {
+ return ye.default;
+ },
+ });
+ Object.defineProperty(t, 'addComment', {
+ enumerable: true,
+ get: function () {
+ return b.default;
+ },
+ });
+ Object.defineProperty(t, 'addComments', {
+ enumerable: true,
+ get: function () {
+ return E.default;
+ },
+ });
+ Object.defineProperty(t, 'appendToMemberExpression', {
+ enumerable: true,
+ get: function () {
+ return R.default;
+ },
+ });
+ Object.defineProperty(t, 'assertNode', {
+ enumerable: true,
+ get: function () {
+ return o.default;
+ },
+ });
+ Object.defineProperty(t, 'buildMatchMemberExpression', {
+ enumerable: true,
+ get: function () {
+ return fe.default;
+ },
+ });
+ Object.defineProperty(t, 'clone', {
+ enumerable: true,
+ get: function () {
+ return m.default;
+ },
+ });
+ Object.defineProperty(t, 'cloneDeep', {
+ enumerable: true,
+ get: function () {
+ return T.default;
+ },
+ });
+ Object.defineProperty(t, 'cloneDeepWithoutLoc', {
+ enumerable: true,
+ get: function () {
+ return S.default;
+ },
+ });
+ Object.defineProperty(t, 'cloneNode', {
+ enumerable: true,
+ get: function () {
+ return y.default;
+ },
+ });
+ Object.defineProperty(t, 'cloneWithoutLoc', {
+ enumerable: true,
+ get: function () {
+ return x.default;
+ },
+ });
+ Object.defineProperty(t, 'createFlowUnionType', {
+ enumerable: true,
+ get: function () {
+ return p.default;
+ },
+ });
+ Object.defineProperty(t, 'createTSUnionType', {
+ enumerable: true,
+ get: function () {
+ return u.default;
+ },
+ });
+ Object.defineProperty(t, 'createTypeAnnotationBasedOnTypeof', {
+ enumerable: true,
+ get: function () {
+ return c.default;
+ },
+ });
+ Object.defineProperty(t, 'createUnionTypeAnnotation', {
+ enumerable: true,
+ get: function () {
+ return p.default;
+ },
+ });
+ Object.defineProperty(t, 'ensureBlock', {
+ enumerable: true,
+ get: function () {
+ return O.default;
+ },
+ });
+ Object.defineProperty(t, 'getBindingIdentifiers', {
+ enumerable: true,
+ get: function () {
+ return Y.default;
+ },
+ });
+ Object.defineProperty(t, 'getOuterBindingIdentifiers', {
+ enumerable: true,
+ get: function () {
+ return W.default;
+ },
+ });
+ Object.defineProperty(t, 'inheritInnerComments', {
+ enumerable: true,
+ get: function () {
+ return P.default;
+ },
+ });
+ Object.defineProperty(t, 'inheritLeadingComments', {
+ enumerable: true,
+ get: function () {
+ return g.default;
+ },
+ });
+ Object.defineProperty(t, 'inheritTrailingComments', {
+ enumerable: true,
+ get: function () {
+ return v.default;
+ },
+ });
+ Object.defineProperty(t, 'inherits', {
+ enumerable: true,
+ get: function () {
+ return K.default;
+ },
+ });
+ Object.defineProperty(t, 'inheritsComments', {
+ enumerable: true,
+ get: function () {
+ return A.default;
+ },
+ });
+ Object.defineProperty(t, 'is', {
+ enumerable: true,
+ get: function () {
+ return H.default;
+ },
+ });
+ Object.defineProperty(t, 'isBinding', {
+ enumerable: true,
+ get: function () {
+ return G.default;
+ },
+ });
+ Object.defineProperty(t, 'isBlockScoped', {
+ enumerable: true,
+ get: function () {
+ return Q.default;
+ },
+ });
+ Object.defineProperty(t, 'isImmutable', {
+ enumerable: true,
+ get: function () {
+ return Z.default;
+ },
+ });
+ Object.defineProperty(t, 'isLet', {
+ enumerable: true,
+ get: function () {
+ return ee.default;
+ },
+ });
+ Object.defineProperty(t, 'isNode', {
+ enumerable: true,
+ get: function () {
+ return te.default;
+ },
+ });
+ Object.defineProperty(t, 'isNodesEquivalent', {
+ enumerable: true,
+ get: function () {
+ return re.default;
+ },
+ });
+ Object.defineProperty(t, 'isPlaceholderType', {
+ enumerable: true,
+ get: function () {
+ return se.default;
+ },
+ });
+ Object.defineProperty(t, 'isReferenced', {
+ enumerable: true,
+ get: function () {
+ return ie.default;
+ },
+ });
+ Object.defineProperty(t, 'isScope', {
+ enumerable: true,
+ get: function () {
+ return ne.default;
+ },
+ });
+ Object.defineProperty(t, 'isSpecifierDefault', {
+ enumerable: true,
+ get: function () {
+ return ae.default;
+ },
+ });
+ Object.defineProperty(t, 'isType', {
+ enumerable: true,
+ get: function () {
+ return oe.default;
+ },
+ });
+ Object.defineProperty(t, 'isValidES3Identifier', {
+ enumerable: true,
+ get: function () {
+ return le.default;
+ },
+ });
+ Object.defineProperty(t, 'isValidIdentifier', {
+ enumerable: true,
+ get: function () {
+ return ce.default;
+ },
+ });
+ Object.defineProperty(t, 'isVar', {
+ enumerable: true,
+ get: function () {
+ return pe.default;
+ },
+ });
+ Object.defineProperty(t, 'matchesPattern', {
+ enumerable: true,
+ get: function () {
+ return ue.default;
+ },
+ });
+ Object.defineProperty(t, 'prependToMemberExpression', {
+ enumerable: true,
+ get: function () {
+ return U.default;
+ },
+ });
+ t.react = void 0;
+ Object.defineProperty(t, 'removeComments', {
+ enumerable: true,
+ get: function () {
+ return I.default;
+ },
+ });
+ Object.defineProperty(t, 'removeProperties', {
+ enumerable: true,
+ get: function () {
+ return V.default;
+ },
+ });
+ Object.defineProperty(t, 'removePropertiesDeep', {
+ enumerable: true,
+ get: function () {
+ return X.default;
+ },
+ });
+ Object.defineProperty(t, 'removeTypeDuplicates', {
+ enumerable: true,
+ get: function () {
+ return J.default;
+ },
+ });
+ Object.defineProperty(t, 'shallowEqual', {
+ enumerable: true,
+ get: function () {
+ return z.default;
+ },
+ });
+ Object.defineProperty(t, 'toBindingIdentifierName', {
+ enumerable: true,
+ get: function () {
+ return C.default;
+ },
+ });
+ Object.defineProperty(t, 'toBlock', {
+ enumerable: true,
+ get: function () {
+ return D.default;
+ },
+ });
+ Object.defineProperty(t, 'toComputedKey', {
+ enumerable: true,
+ get: function () {
+ return k.default;
+ },
+ });
+ Object.defineProperty(t, 'toExpression', {
+ enumerable: true,
+ get: function () {
+ return L.default;
+ },
+ });
+ Object.defineProperty(t, 'toIdentifier', {
+ enumerable: true,
+ get: function () {
+ return M.default;
+ },
+ });
+ Object.defineProperty(t, 'toKeyAlias', {
+ enumerable: true,
+ get: function () {
+ return j.default;
+ },
+ });
+ Object.defineProperty(t, 'toStatement', {
+ enumerable: true,
+ get: function () {
+ return B.default;
+ },
+ });
+ Object.defineProperty(t, 'traverse', {
+ enumerable: true,
+ get: function () {
+ return q.default;
+ },
+ });
+ Object.defineProperty(t, 'traverseFast', {
+ enumerable: true,
+ get: function () {
+ return $.default;
+ },
+ });
+ Object.defineProperty(t, 'validate', {
+ enumerable: true,
+ get: function () {
+ return de.default;
+ },
+ });
+ Object.defineProperty(t, 'valueToNode', {
+ enumerable: true,
+ get: function () {
+ return F.default;
+ },
+ });
+ var i = r(835);
+ var n = r(9482);
+ var a = r(3718);
+ var o = r(4632);
+ var l = r(3701);
+ Object.keys(l).forEach(function (e) {
+ if (e === 'default' || e === '__esModule') return;
+ if (Object.prototype.hasOwnProperty.call(s, e)) return;
+ if (e in t && t[e] === l[e]) return;
+ Object.defineProperty(t, e, {
+ enumerable: true,
+ get: function () {
+ return l[e];
+ },
+ });
+ });
+ var c = r(8276);
+ var p = r(2814);
+ var u = r(1094);
+ var d = r(397);
+ Object.keys(d).forEach(function (e) {
+ if (e === 'default' || e === '__esModule') return;
+ if (Object.prototype.hasOwnProperty.call(s, e)) return;
+ if (e in t && t[e] === d[e]) return;
+ Object.defineProperty(t, e, {
+ enumerable: true,
+ get: function () {
+ return d[e];
+ },
+ });
+ });
+ var f = r(6503);
+ Object.keys(f).forEach(function (e) {
+ if (e === 'default' || e === '__esModule') return;
+ if (Object.prototype.hasOwnProperty.call(s, e)) return;
+ if (e in t && t[e] === f[e]) return;
+ Object.defineProperty(t, e, {
+ enumerable: true,
+ get: function () {
+ return f[e];
+ },
+ });
+ });
+ var h = r(5673);
+ Object.keys(h).forEach(function (e) {
+ if (e === 'default' || e === '__esModule') return;
+ if (Object.prototype.hasOwnProperty.call(s, e)) return;
+ if (e in t && t[e] === h[e]) return;
+ Object.defineProperty(t, e, {
+ enumerable: true,
+ get: function () {
+ return h[e];
+ },
+ });
+ });
+ var y = r(7421);
+ var m = r(9906);
+ var T = r(6719);
+ var S = r(6489);
+ var x = r(1260);
+ var b = r(2227);
+ var E = r(9534);
+ var P = r(8898);
+ var g = r(5689);
+ var A = r(8237);
+ var v = r(3146);
+ var I = r(6267);
+ var w = r(8178);
+ Object.keys(w).forEach(function (e) {
+ if (e === 'default' || e === '__esModule') return;
+ if (Object.prototype.hasOwnProperty.call(s, e)) return;
+ if (e in t && t[e] === w[e]) return;
+ Object.defineProperty(t, e, {
+ enumerable: true,
+ get: function () {
+ return w[e];
+ },
+ });
+ });
+ var N = r(1227);
+ Object.keys(N).forEach(function (e) {
+ if (e === 'default' || e === '__esModule') return;
+ if (Object.prototype.hasOwnProperty.call(s, e)) return;
+ if (e in t && t[e] === N[e]) return;
+ Object.defineProperty(t, e, {
+ enumerable: true,
+ get: function () {
+ return N[e];
+ },
+ });
+ });
+ var O = r(7158);
+ var C = r(5999);
+ var D = r(5013);
+ var k = r(3317);
+ var L = r(9132);
+ var M = r(1868);
+ var j = r(1873);
+ var B = r(4570);
+ var F = r(1382);
+ var _ = r(7405);
+ Object.keys(_).forEach(function (e) {
+ if (e === 'default' || e === '__esModule') return;
+ if (Object.prototype.hasOwnProperty.call(s, e)) return;
+ if (e in t && t[e] === _[e]) return;
+ Object.defineProperty(t, e, {
+ enumerable: true,
+ get: function () {
+ return _[e];
+ },
+ });
+ });
+ var R = r(8490);
+ var K = r(2710);
+ var U = r(6409);
+ var V = r(316);
+ var X = r(2735);
+ var J = r(3864);
+ var Y = r(6675);
+ var W = r(9852);
+ var q = r(954);
+ Object.keys(q).forEach(function (e) {
+ if (e === 'default' || e === '__esModule') return;
+ if (Object.prototype.hasOwnProperty.call(s, e)) return;
+ if (e in t && t[e] === q[e]) return;
+ Object.defineProperty(t, e, {
+ enumerable: true,
+ get: function () {
+ return q[e];
+ },
+ });
+ });
+ var $ = r(9370);
+ var z = r(79);
+ var H = r(3685);
+ var G = r(8731);
+ var Q = r(2821);
+ var Z = r(5456);
+ var ee = r(9552);
+ var te = r(6516);
+ var re = r(1840);
+ var se = r(6937);
+ var ie = r(7391);
+ var ne = r(7910);
+ var ae = r(9003);
+ var oe = r(1009);
+ var le = r(5563);
+ var ce = r(9994);
+ var pe = r(7407);
+ var ue = r(3794);
+ var de = r(7159);
+ var fe = r(5659);
+ var he = r(6428);
+ Object.keys(he).forEach(function (e) {
+ if (e === 'default' || e === '__esModule') return;
+ if (Object.prototype.hasOwnProperty.call(s, e)) return;
+ if (e in t && t[e] === he[e]) return;
+ Object.defineProperty(t, e, {
+ enumerable: true,
+ get: function () {
+ return he[e];
+ },
+ });
+ });
+ var ye = r(8418);
+ const me = (t.react = {
+ isReactComponent: i.default,
+ isCompatTag: n.default,
+ buildChildren: a.default,
+ });
+ {
+ t.toSequenceExpression = r(6906)['default'];
+ }
+ },
+ 8490: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = appendToMemberExpression;
+ var s = r(397);
+ function appendToMemberExpression(e, t, r = false) {
+ e.object = (0, s.memberExpression)(e.object, e.property, e.computed);
+ e.property = t;
+ e.computed = !!r;
+ return e;
+ }
+ },
+ 3864: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = removeTypeDuplicates;
+ var s = r(6428);
+ function getQualifiedName(e) {
+ return (0, s.isIdentifier)(e)
+ ? e.name
+ : `${e.id.name}.${getQualifiedName(e.qualification)}`;
+ }
+ function removeTypeDuplicates(e) {
+ const t = Array.from(e);
+ const r = new Map();
+ const i = new Map();
+ const n = new Set();
+ const a = [];
+ for (let e = 0; e < t.length; e++) {
+ const o = t[e];
+ if (!o) continue;
+ if (a.indexOf(o) >= 0) {
+ continue;
+ }
+ if ((0, s.isAnyTypeAnnotation)(o)) {
+ return [o];
+ }
+ if ((0, s.isFlowBaseAnnotation)(o)) {
+ i.set(o.type, o);
+ continue;
+ }
+ if ((0, s.isUnionTypeAnnotation)(o)) {
+ if (!n.has(o.types)) {
+ t.push(...o.types);
+ n.add(o.types);
+ }
+ continue;
+ }
+ if ((0, s.isGenericTypeAnnotation)(o)) {
+ const e = getQualifiedName(o.id);
+ if (r.has(e)) {
+ let t = r.get(e);
+ if (t.typeParameters) {
+ if (o.typeParameters) {
+ t.typeParameters.params.push(...o.typeParameters.params);
+ t.typeParameters.params = removeTypeDuplicates(
+ t.typeParameters.params,
+ );
+ }
+ } else {
+ t = o.typeParameters;
+ }
+ } else {
+ r.set(e, o);
+ }
+ continue;
+ }
+ a.push(o);
+ }
+ for (const [, e] of i) {
+ a.push(e);
+ }
+ for (const [, e] of r) {
+ a.push(e);
+ }
+ return a;
+ }
+ },
+ 2710: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = inherits;
+ var s = r(1227);
+ var i = r(8237);
+ function inherits(e, t) {
+ if (!e || !t) return e;
+ for (const r of s.INHERIT_KEYS.optional) {
+ if (e[r] == null) {
+ e[r] = t[r];
+ }
+ }
+ for (const r of Object.keys(t)) {
+ if (r[0] === '_' && r !== '__clone') {
+ e[r] = t[r];
+ }
+ }
+ for (const r of s.INHERIT_KEYS.force) {
+ e[r] = t[r];
+ }
+ (0, i.default)(e, t);
+ return e;
+ }
+ },
+ 6409: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = prependToMemberExpression;
+ var s = r(397);
+ var i = r(4739);
+ function prependToMemberExpression(e, t) {
+ if ((0, i.isSuper)(e.object)) {
+ throw new Error(
+ 'Cannot prepend node to super property access (`super.foo`).',
+ );
+ }
+ e.object = (0, s.memberExpression)(t, e.object);
+ return e;
+ }
+ },
+ 316: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = removeProperties;
+ var s = r(1227);
+ const i = ['tokens', 'start', 'end', 'loc', 'raw', 'rawValue'];
+ const n = [...s.COMMENT_KEYS, 'comments', ...i];
+ function removeProperties(e, t = {}) {
+ const r = t.preserveComments ? i : n;
+ for (const t of r) {
+ if (e[t] != null) e[t] = undefined;
+ }
+ for (const t of Object.keys(e)) {
+ if (t[0] === '_' && e[t] != null) e[t] = undefined;
+ }
+ const s = Object.getOwnPropertySymbols(e);
+ for (const t of s) {
+ e[t] = null;
+ }
+ }
+ },
+ 2735: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = removePropertiesDeep;
+ var s = r(9370);
+ var i = r(316);
+ function removePropertiesDeep(e, t) {
+ (0, s.default)(e, i.default, t);
+ return e;
+ }
+ },
+ 2832: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = removeTypeDuplicates;
+ var s = r(6428);
+ function getQualifiedName(e) {
+ return (0, s.isIdentifier)(e)
+ ? e.name
+ : `${e.right.name}.${getQualifiedName(e.left)}`;
+ }
+ function removeTypeDuplicates(e) {
+ const t = Array.from(e);
+ const r = new Map();
+ const i = new Map();
+ const n = new Set();
+ const a = [];
+ for (let e = 0; e < t.length; e++) {
+ const o = t[e];
+ if (!o) continue;
+ if (a.indexOf(o) >= 0) {
+ continue;
+ }
+ if ((0, s.isTSAnyKeyword)(o)) {
+ return [o];
+ }
+ if ((0, s.isTSBaseType)(o)) {
+ i.set(o.type, o);
+ continue;
+ }
+ if ((0, s.isTSUnionType)(o)) {
+ if (!n.has(o.types)) {
+ t.push(...o.types);
+ n.add(o.types);
+ }
+ continue;
+ }
+ if ((0, s.isTSTypeReference)(o) && o.typeParameters) {
+ const e = getQualifiedName(o.typeName);
+ if (r.has(e)) {
+ let t = r.get(e);
+ if (t.typeParameters) {
+ if (o.typeParameters) {
+ t.typeParameters.params.push(...o.typeParameters.params);
+ t.typeParameters.params = removeTypeDuplicates(
+ t.typeParameters.params,
+ );
+ }
+ } else {
+ t = o.typeParameters;
+ }
+ } else {
+ r.set(e, o);
+ }
+ continue;
+ }
+ a.push(o);
+ }
+ for (const [, e] of i) {
+ a.push(e);
+ }
+ for (const [, e] of r) {
+ a.push(e);
+ }
+ return a;
+ }
+ },
+ 6675: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = getBindingIdentifiers;
+ var s = r(6428);
+ function getBindingIdentifiers(e, t, r) {
+ const i = [].concat(e);
+ const n = Object.create(null);
+ while (i.length) {
+ const e = i.shift();
+ if (!e) continue;
+ const a = getBindingIdentifiers.keys[e.type];
+ if ((0, s.isIdentifier)(e)) {
+ if (t) {
+ const t = (n[e.name] = n[e.name] || []);
+ t.push(e);
+ } else {
+ n[e.name] = e;
+ }
+ continue;
+ }
+ if (
+ (0, s.isExportDeclaration)(e) &&
+ !(0, s.isExportAllDeclaration)(e)
+ ) {
+ if ((0, s.isDeclaration)(e.declaration)) {
+ i.push(e.declaration);
+ }
+ continue;
+ }
+ if (r) {
+ if ((0, s.isFunctionDeclaration)(e)) {
+ i.push(e.id);
+ continue;
+ }
+ if ((0, s.isFunctionExpression)(e)) {
+ continue;
+ }
+ }
+ if (a) {
+ for (let t = 0; t < a.length; t++) {
+ const r = a[t];
+ const s = e[r];
+ if (s) {
+ Array.isArray(s) ? i.push(...s) : i.push(s);
+ }
+ }
+ }
+ }
+ return n;
+ }
+ getBindingIdentifiers.keys = {
+ DeclareClass: ['id'],
+ DeclareFunction: ['id'],
+ DeclareModule: ['id'],
+ DeclareVariable: ['id'],
+ DeclareInterface: ['id'],
+ DeclareTypeAlias: ['id'],
+ DeclareOpaqueType: ['id'],
+ InterfaceDeclaration: ['id'],
+ TypeAlias: ['id'],
+ OpaqueType: ['id'],
+ CatchClause: ['param'],
+ LabeledStatement: ['label'],
+ UnaryExpression: ['argument'],
+ AssignmentExpression: ['left'],
+ ImportSpecifier: ['local'],
+ ImportNamespaceSpecifier: ['local'],
+ ImportDefaultSpecifier: ['local'],
+ ImportDeclaration: ['specifiers'],
+ ExportSpecifier: ['exported'],
+ ExportNamespaceSpecifier: ['exported'],
+ ExportDefaultSpecifier: ['exported'],
+ FunctionDeclaration: ['id', 'params'],
+ FunctionExpression: ['id', 'params'],
+ ArrowFunctionExpression: ['params'],
+ ObjectMethod: ['params'],
+ ClassMethod: ['params'],
+ ClassPrivateMethod: ['params'],
+ ForInStatement: ['left'],
+ ForOfStatement: ['left'],
+ ClassDeclaration: ['id'],
+ ClassExpression: ['id'],
+ RestElement: ['argument'],
+ UpdateExpression: ['argument'],
+ ObjectProperty: ['value'],
+ AssignmentPattern: ['left'],
+ ArrayPattern: ['elements'],
+ ObjectPattern: ['properties'],
+ VariableDeclaration: ['declarations'],
+ VariableDeclarator: ['id'],
+ };
+ },
+ 9852: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = void 0;
+ var s = r(6675);
+ var i = (t['default'] = getOuterBindingIdentifiers);
+ function getOuterBindingIdentifiers(e, t) {
+ return (0, s.default)(e, t, true);
+ }
+ },
+ 954: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = traverse;
+ var s = r(7405);
+ function traverse(e, t, r) {
+ if (typeof t === 'function') {
+ t = { enter: t };
+ }
+ const { enter: s, exit: i } = t;
+ traverseSimpleImpl(e, s, i, r, []);
+ }
+ function traverseSimpleImpl(e, t, r, i, n) {
+ const a = s.VISITOR_KEYS[e.type];
+ if (!a) return;
+ if (t) t(e, n, i);
+ for (const s of a) {
+ const a = e[s];
+ if (Array.isArray(a)) {
+ for (let o = 0; o < a.length; o++) {
+ const l = a[o];
+ if (!l) continue;
+ n.push({ node: e, key: s, index: o });
+ traverseSimpleImpl(l, t, r, i, n);
+ n.pop();
+ }
+ } else if (a) {
+ n.push({ node: e, key: s });
+ traverseSimpleImpl(a, t, r, i, n);
+ n.pop();
+ }
+ }
+ if (r) r(e, n, i);
+ }
+ },
+ 9370: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = traverseFast;
+ var s = r(7405);
+ function traverseFast(e, t, r) {
+ if (!e) return;
+ const i = s.VISITOR_KEYS[e.type];
+ if (!i) return;
+ r = r || {};
+ t(e, r);
+ for (const s of i) {
+ const i = e[s];
+ if (Array.isArray(i)) {
+ for (const e of i) {
+ traverseFast(e, t, r);
+ }
+ } else {
+ traverseFast(i, t, r);
+ }
+ }
+ }
+ },
+ 8418: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = deprecationWarning;
+ const r = new Set();
+ function deprecationWarning(e, t, s = '') {
+ if (r.has(e)) return;
+ r.add(e);
+ const { internal: i, trace: n } = captureShortStackTrace(1, 2);
+ if (i) {
+ return;
+ }
+ console.warn(
+ `${s}\`${e}\` has been deprecated, please migrate to \`${t}\`\n${n}`,
+ );
+ }
+ function captureShortStackTrace(e, t) {
+ const { stackTraceLimit: r, prepareStackTrace: s } = Error;
+ let i;
+ Error.stackTraceLimit = 1 + e + t;
+ Error.prepareStackTrace = function (e, t) {
+ i = t;
+ };
+ new Error().stack;
+ Error.stackTraceLimit = r;
+ Error.prepareStackTrace = s;
+ if (!i) return { internal: false, trace: '' };
+ const n = i.slice(1 + e, 1 + e + t);
+ return {
+ internal: /[\\/]@babel[\\/]/.test(n[1].getFileName()),
+ trace: n.map((e) => ` at ${e}`).join('\n'),
+ };
+ }
+ },
+ 778: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = inherit;
+ function inherit(e, t, r) {
+ if (t && r) {
+ t[e] = Array.from(new Set([].concat(t[e], r[e]).filter(Boolean)));
+ }
+ }
+ },
+ 485: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = cleanJSXElementLiteralChild;
+ var s = r(397);
+ var i = r(4739);
+ function cleanJSXElementLiteralChild(e, t) {
+ const r = e.value.split(/\r\n|\n|\r/);
+ let n = 0;
+ for (let e = 0; e < r.length; e++) {
+ if (r[e].match(/[^ \t]/)) {
+ n = e;
+ }
+ }
+ let a = '';
+ for (let e = 0; e < r.length; e++) {
+ const t = r[e];
+ const s = e === 0;
+ const i = e === r.length - 1;
+ const o = e === n;
+ let l = t.replace(/\t/g, ' ');
+ if (!s) {
+ l = l.replace(/^[ ]+/, '');
+ }
+ if (!i) {
+ l = l.replace(/[ ]+$/, '');
+ }
+ if (l) {
+ if (!o) {
+ l += ' ';
+ }
+ a += l;
+ }
+ }
+ if (a) t.push((0, i.inherits)((0, s.stringLiteral)(a), e));
+ }
+ },
+ 79: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = shallowEqual;
+ function shallowEqual(e, t) {
+ const r = Object.keys(t);
+ for (const s of r) {
+ if (e[s] !== t[s]) {
+ return false;
+ }
+ }
+ return true;
+ }
+ },
+ 5659: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = buildMatchMemberExpression;
+ var s = r(3794);
+ function buildMatchMemberExpression(e, t) {
+ const r = e.split('.');
+ return (e) => (0, s.default)(e, r, t);
+ }
+ },
+ 6428: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t.isAccessor = isAccessor;
+ t.isAnyTypeAnnotation = isAnyTypeAnnotation;
+ t.isArgumentPlaceholder = isArgumentPlaceholder;
+ t.isArrayExpression = isArrayExpression;
+ t.isArrayPattern = isArrayPattern;
+ t.isArrayTypeAnnotation = isArrayTypeAnnotation;
+ t.isArrowFunctionExpression = isArrowFunctionExpression;
+ t.isAssignmentExpression = isAssignmentExpression;
+ t.isAssignmentPattern = isAssignmentPattern;
+ t.isAwaitExpression = isAwaitExpression;
+ t.isBigIntLiteral = isBigIntLiteral;
+ t.isBinary = isBinary;
+ t.isBinaryExpression = isBinaryExpression;
+ t.isBindExpression = isBindExpression;
+ t.isBlock = isBlock;
+ t.isBlockParent = isBlockParent;
+ t.isBlockStatement = isBlockStatement;
+ t.isBooleanLiteral = isBooleanLiteral;
+ t.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;
+ t.isBooleanTypeAnnotation = isBooleanTypeAnnotation;
+ t.isBreakStatement = isBreakStatement;
+ t.isCallExpression = isCallExpression;
+ t.isCatchClause = isCatchClause;
+ t.isClass = isClass;
+ t.isClassAccessorProperty = isClassAccessorProperty;
+ t.isClassBody = isClassBody;
+ t.isClassDeclaration = isClassDeclaration;
+ t.isClassExpression = isClassExpression;
+ t.isClassImplements = isClassImplements;
+ t.isClassMethod = isClassMethod;
+ t.isClassPrivateMethod = isClassPrivateMethod;
+ t.isClassPrivateProperty = isClassPrivateProperty;
+ t.isClassProperty = isClassProperty;
+ t.isCompletionStatement = isCompletionStatement;
+ t.isConditional = isConditional;
+ t.isConditionalExpression = isConditionalExpression;
+ t.isContinueStatement = isContinueStatement;
+ t.isDebuggerStatement = isDebuggerStatement;
+ t.isDecimalLiteral = isDecimalLiteral;
+ t.isDeclaration = isDeclaration;
+ t.isDeclareClass = isDeclareClass;
+ t.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;
+ t.isDeclareExportDeclaration = isDeclareExportDeclaration;
+ t.isDeclareFunction = isDeclareFunction;
+ t.isDeclareInterface = isDeclareInterface;
+ t.isDeclareModule = isDeclareModule;
+ t.isDeclareModuleExports = isDeclareModuleExports;
+ t.isDeclareOpaqueType = isDeclareOpaqueType;
+ t.isDeclareTypeAlias = isDeclareTypeAlias;
+ t.isDeclareVariable = isDeclareVariable;
+ t.isDeclaredPredicate = isDeclaredPredicate;
+ t.isDecorator = isDecorator;
+ t.isDirective = isDirective;
+ t.isDirectiveLiteral = isDirectiveLiteral;
+ t.isDoExpression = isDoExpression;
+ t.isDoWhileStatement = isDoWhileStatement;
+ t.isEmptyStatement = isEmptyStatement;
+ t.isEmptyTypeAnnotation = isEmptyTypeAnnotation;
+ t.isEnumBody = isEnumBody;
+ t.isEnumBooleanBody = isEnumBooleanBody;
+ t.isEnumBooleanMember = isEnumBooleanMember;
+ t.isEnumDeclaration = isEnumDeclaration;
+ t.isEnumDefaultedMember = isEnumDefaultedMember;
+ t.isEnumMember = isEnumMember;
+ t.isEnumNumberBody = isEnumNumberBody;
+ t.isEnumNumberMember = isEnumNumberMember;
+ t.isEnumStringBody = isEnumStringBody;
+ t.isEnumStringMember = isEnumStringMember;
+ t.isEnumSymbolBody = isEnumSymbolBody;
+ t.isExistsTypeAnnotation = isExistsTypeAnnotation;
+ t.isExportAllDeclaration = isExportAllDeclaration;
+ t.isExportDeclaration = isExportDeclaration;
+ t.isExportDefaultDeclaration = isExportDefaultDeclaration;
+ t.isExportDefaultSpecifier = isExportDefaultSpecifier;
+ t.isExportNamedDeclaration = isExportNamedDeclaration;
+ t.isExportNamespaceSpecifier = isExportNamespaceSpecifier;
+ t.isExportSpecifier = isExportSpecifier;
+ t.isExpression = isExpression;
+ t.isExpressionStatement = isExpressionStatement;
+ t.isExpressionWrapper = isExpressionWrapper;
+ t.isFile = isFile;
+ t.isFlow = isFlow;
+ t.isFlowBaseAnnotation = isFlowBaseAnnotation;
+ t.isFlowDeclaration = isFlowDeclaration;
+ t.isFlowPredicate = isFlowPredicate;
+ t.isFlowType = isFlowType;
+ t.isFor = isFor;
+ t.isForInStatement = isForInStatement;
+ t.isForOfStatement = isForOfStatement;
+ t.isForStatement = isForStatement;
+ t.isForXStatement = isForXStatement;
+ t.isFunction = isFunction;
+ t.isFunctionDeclaration = isFunctionDeclaration;
+ t.isFunctionExpression = isFunctionExpression;
+ t.isFunctionParent = isFunctionParent;
+ t.isFunctionTypeAnnotation = isFunctionTypeAnnotation;
+ t.isFunctionTypeParam = isFunctionTypeParam;
+ t.isGenericTypeAnnotation = isGenericTypeAnnotation;
+ t.isIdentifier = isIdentifier;
+ t.isIfStatement = isIfStatement;
+ t.isImmutable = isImmutable;
+ t.isImport = isImport;
+ t.isImportAttribute = isImportAttribute;
+ t.isImportDeclaration = isImportDeclaration;
+ t.isImportDefaultSpecifier = isImportDefaultSpecifier;
+ t.isImportExpression = isImportExpression;
+ t.isImportNamespaceSpecifier = isImportNamespaceSpecifier;
+ t.isImportOrExportDeclaration = isImportOrExportDeclaration;
+ t.isImportSpecifier = isImportSpecifier;
+ t.isIndexedAccessType = isIndexedAccessType;
+ t.isInferredPredicate = isInferredPredicate;
+ t.isInterfaceDeclaration = isInterfaceDeclaration;
+ t.isInterfaceExtends = isInterfaceExtends;
+ t.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;
+ t.isInterpreterDirective = isInterpreterDirective;
+ t.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;
+ t.isJSX = isJSX;
+ t.isJSXAttribute = isJSXAttribute;
+ t.isJSXClosingElement = isJSXClosingElement;
+ t.isJSXClosingFragment = isJSXClosingFragment;
+ t.isJSXElement = isJSXElement;
+ t.isJSXEmptyExpression = isJSXEmptyExpression;
+ t.isJSXExpressionContainer = isJSXExpressionContainer;
+ t.isJSXFragment = isJSXFragment;
+ t.isJSXIdentifier = isJSXIdentifier;
+ t.isJSXMemberExpression = isJSXMemberExpression;
+ t.isJSXNamespacedName = isJSXNamespacedName;
+ t.isJSXOpeningElement = isJSXOpeningElement;
+ t.isJSXOpeningFragment = isJSXOpeningFragment;
+ t.isJSXSpreadAttribute = isJSXSpreadAttribute;
+ t.isJSXSpreadChild = isJSXSpreadChild;
+ t.isJSXText = isJSXText;
+ t.isLVal = isLVal;
+ t.isLabeledStatement = isLabeledStatement;
+ t.isLiteral = isLiteral;
+ t.isLogicalExpression = isLogicalExpression;
+ t.isLoop = isLoop;
+ t.isMemberExpression = isMemberExpression;
+ t.isMetaProperty = isMetaProperty;
+ t.isMethod = isMethod;
+ t.isMiscellaneous = isMiscellaneous;
+ t.isMixedTypeAnnotation = isMixedTypeAnnotation;
+ t.isModuleDeclaration = isModuleDeclaration;
+ t.isModuleExpression = isModuleExpression;
+ t.isModuleSpecifier = isModuleSpecifier;
+ t.isNewExpression = isNewExpression;
+ t.isNoop = isNoop;
+ t.isNullLiteral = isNullLiteral;
+ t.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
+ t.isNullableTypeAnnotation = isNullableTypeAnnotation;
+ t.isNumberLiteral = isNumberLiteral;
+ t.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;
+ t.isNumberTypeAnnotation = isNumberTypeAnnotation;
+ t.isNumericLiteral = isNumericLiteral;
+ t.isObjectExpression = isObjectExpression;
+ t.isObjectMember = isObjectMember;
+ t.isObjectMethod = isObjectMethod;
+ t.isObjectPattern = isObjectPattern;
+ t.isObjectProperty = isObjectProperty;
+ t.isObjectTypeAnnotation = isObjectTypeAnnotation;
+ t.isObjectTypeCallProperty = isObjectTypeCallProperty;
+ t.isObjectTypeIndexer = isObjectTypeIndexer;
+ t.isObjectTypeInternalSlot = isObjectTypeInternalSlot;
+ t.isObjectTypeProperty = isObjectTypeProperty;
+ t.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;
+ t.isOpaqueType = isOpaqueType;
+ t.isOptionalCallExpression = isOptionalCallExpression;
+ t.isOptionalIndexedAccessType = isOptionalIndexedAccessType;
+ t.isOptionalMemberExpression = isOptionalMemberExpression;
+ t.isParenthesizedExpression = isParenthesizedExpression;
+ t.isPattern = isPattern;
+ t.isPatternLike = isPatternLike;
+ t.isPipelineBareFunction = isPipelineBareFunction;
+ t.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;
+ t.isPipelineTopicExpression = isPipelineTopicExpression;
+ t.isPlaceholder = isPlaceholder;
+ t.isPrivate = isPrivate;
+ t.isPrivateName = isPrivateName;
+ t.isProgram = isProgram;
+ t.isProperty = isProperty;
+ t.isPureish = isPureish;
+ t.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
+ t.isRecordExpression = isRecordExpression;
+ t.isRegExpLiteral = isRegExpLiteral;
+ t.isRegexLiteral = isRegexLiteral;
+ t.isRestElement = isRestElement;
+ t.isRestProperty = isRestProperty;
+ t.isReturnStatement = isReturnStatement;
+ t.isScopable = isScopable;
+ t.isSequenceExpression = isSequenceExpression;
+ t.isSpreadElement = isSpreadElement;
+ t.isSpreadProperty = isSpreadProperty;
+ t.isStandardized = isStandardized;
+ t.isStatement = isStatement;
+ t.isStaticBlock = isStaticBlock;
+ t.isStringLiteral = isStringLiteral;
+ t.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;
+ t.isStringTypeAnnotation = isStringTypeAnnotation;
+ t.isSuper = isSuper;
+ t.isSwitchCase = isSwitchCase;
+ t.isSwitchStatement = isSwitchStatement;
+ t.isSymbolTypeAnnotation = isSymbolTypeAnnotation;
+ t.isTSAnyKeyword = isTSAnyKeyword;
+ t.isTSArrayType = isTSArrayType;
+ t.isTSAsExpression = isTSAsExpression;
+ t.isTSBaseType = isTSBaseType;
+ t.isTSBigIntKeyword = isTSBigIntKeyword;
+ t.isTSBooleanKeyword = isTSBooleanKeyword;
+ t.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;
+ t.isTSConditionalType = isTSConditionalType;
+ t.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;
+ t.isTSConstructorType = isTSConstructorType;
+ t.isTSDeclareFunction = isTSDeclareFunction;
+ t.isTSDeclareMethod = isTSDeclareMethod;
+ t.isTSEntityName = isTSEntityName;
+ t.isTSEnumDeclaration = isTSEnumDeclaration;
+ t.isTSEnumMember = isTSEnumMember;
+ t.isTSExportAssignment = isTSExportAssignment;
+ t.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;
+ t.isTSExternalModuleReference = isTSExternalModuleReference;
+ t.isTSFunctionType = isTSFunctionType;
+ t.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;
+ t.isTSImportType = isTSImportType;
+ t.isTSIndexSignature = isTSIndexSignature;
+ t.isTSIndexedAccessType = isTSIndexedAccessType;
+ t.isTSInferType = isTSInferType;
+ t.isTSInstantiationExpression = isTSInstantiationExpression;
+ t.isTSInterfaceBody = isTSInterfaceBody;
+ t.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
+ t.isTSIntersectionType = isTSIntersectionType;
+ t.isTSIntrinsicKeyword = isTSIntrinsicKeyword;
+ t.isTSLiteralType = isTSLiteralType;
+ t.isTSMappedType = isTSMappedType;
+ t.isTSMethodSignature = isTSMethodSignature;
+ t.isTSModuleBlock = isTSModuleBlock;
+ t.isTSModuleDeclaration = isTSModuleDeclaration;
+ t.isTSNamedTupleMember = isTSNamedTupleMember;
+ t.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;
+ t.isTSNeverKeyword = isTSNeverKeyword;
+ t.isTSNonNullExpression = isTSNonNullExpression;
+ t.isTSNullKeyword = isTSNullKeyword;
+ t.isTSNumberKeyword = isTSNumberKeyword;
+ t.isTSObjectKeyword = isTSObjectKeyword;
+ t.isTSOptionalType = isTSOptionalType;
+ t.isTSParameterProperty = isTSParameterProperty;
+ t.isTSParenthesizedType = isTSParenthesizedType;
+ t.isTSPropertySignature = isTSPropertySignature;
+ t.isTSQualifiedName = isTSQualifiedName;
+ t.isTSRestType = isTSRestType;
+ t.isTSSatisfiesExpression = isTSSatisfiesExpression;
+ t.isTSStringKeyword = isTSStringKeyword;
+ t.isTSSymbolKeyword = isTSSymbolKeyword;
+ t.isTSThisType = isTSThisType;
+ t.isTSTupleType = isTSTupleType;
+ t.isTSType = isTSType;
+ t.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
+ t.isTSTypeAnnotation = isTSTypeAnnotation;
+ t.isTSTypeAssertion = isTSTypeAssertion;
+ t.isTSTypeElement = isTSTypeElement;
+ t.isTSTypeLiteral = isTSTypeLiteral;
+ t.isTSTypeOperator = isTSTypeOperator;
+ t.isTSTypeParameter = isTSTypeParameter;
+ t.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;
+ t.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;
+ t.isTSTypePredicate = isTSTypePredicate;
+ t.isTSTypeQuery = isTSTypeQuery;
+ t.isTSTypeReference = isTSTypeReference;
+ t.isTSUndefinedKeyword = isTSUndefinedKeyword;
+ t.isTSUnionType = isTSUnionType;
+ t.isTSUnknownKeyword = isTSUnknownKeyword;
+ t.isTSVoidKeyword = isTSVoidKeyword;
+ t.isTaggedTemplateExpression = isTaggedTemplateExpression;
+ t.isTemplateElement = isTemplateElement;
+ t.isTemplateLiteral = isTemplateLiteral;
+ t.isTerminatorless = isTerminatorless;
+ t.isThisExpression = isThisExpression;
+ t.isThisTypeAnnotation = isThisTypeAnnotation;
+ t.isThrowStatement = isThrowStatement;
+ t.isTopicReference = isTopicReference;
+ t.isTryStatement = isTryStatement;
+ t.isTupleExpression = isTupleExpression;
+ t.isTupleTypeAnnotation = isTupleTypeAnnotation;
+ t.isTypeAlias = isTypeAlias;
+ t.isTypeAnnotation = isTypeAnnotation;
+ t.isTypeCastExpression = isTypeCastExpression;
+ t.isTypeParameter = isTypeParameter;
+ t.isTypeParameterDeclaration = isTypeParameterDeclaration;
+ t.isTypeParameterInstantiation = isTypeParameterInstantiation;
+ t.isTypeScript = isTypeScript;
+ t.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
+ t.isUnaryExpression = isUnaryExpression;
+ t.isUnaryLike = isUnaryLike;
+ t.isUnionTypeAnnotation = isUnionTypeAnnotation;
+ t.isUpdateExpression = isUpdateExpression;
+ t.isUserWhitespacable = isUserWhitespacable;
+ t.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;
+ t.isVariableDeclaration = isVariableDeclaration;
+ t.isVariableDeclarator = isVariableDeclarator;
+ t.isVariance = isVariance;
+ t.isVoidTypeAnnotation = isVoidTypeAnnotation;
+ t.isWhile = isWhile;
+ t.isWhileStatement = isWhileStatement;
+ t.isWithStatement = isWithStatement;
+ t.isYieldExpression = isYieldExpression;
+ var s = r(79);
+ var i = r(8418);
+ function isArrayExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ArrayExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isAssignmentExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'AssignmentExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBinaryExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'BinaryExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isInterpreterDirective(e, t) {
+ if (!e) return false;
+ if (e.type !== 'InterpreterDirective') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDirective(e, t) {
+ if (!e) return false;
+ if (e.type !== 'Directive') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDirectiveLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DirectiveLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBlockStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'BlockStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBreakStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'BreakStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isCallExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'CallExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isCatchClause(e, t) {
+ if (!e) return false;
+ if (e.type !== 'CatchClause') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isConditionalExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ConditionalExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isContinueStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ContinueStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDebuggerStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DebuggerStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDoWhileStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DoWhileStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEmptyStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EmptyStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExpressionStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ExpressionStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFile(e, t) {
+ if (!e) return false;
+ if (e.type !== 'File') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isForInStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ForInStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isForStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ForStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFunctionDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'FunctionDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFunctionExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'FunctionExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isIdentifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'Identifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isIfStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'IfStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isLabeledStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'LabeledStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isStringLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'StringLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isNumericLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'NumericLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isNullLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'NullLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBooleanLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'BooleanLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isRegExpLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'RegExpLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isLogicalExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'LogicalExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isMemberExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'MemberExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isNewExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'NewExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isProgram(e, t) {
+ if (!e) return false;
+ if (e.type !== 'Program') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectMethod(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectMethod') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectProperty(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isRestElement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'RestElement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isReturnStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ReturnStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isSequenceExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'SequenceExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isParenthesizedExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ParenthesizedExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isSwitchCase(e, t) {
+ if (!e) return false;
+ if (e.type !== 'SwitchCase') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isSwitchStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'SwitchStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isThisExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ThisExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isThrowStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ThrowStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTryStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TryStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isUnaryExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'UnaryExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isUpdateExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'UpdateExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isVariableDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'VariableDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isVariableDeclarator(e, t) {
+ if (!e) return false;
+ if (e.type !== 'VariableDeclarator') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isWhileStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'WhileStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isWithStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'WithStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isAssignmentPattern(e, t) {
+ if (!e) return false;
+ if (e.type !== 'AssignmentPattern') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isArrayPattern(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ArrayPattern') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isArrowFunctionExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ArrowFunctionExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClassBody(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ClassBody') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClassExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ClassExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClassDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ClassDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExportAllDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ExportAllDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExportDefaultDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ExportDefaultDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExportNamedDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ExportNamedDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExportSpecifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ExportSpecifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isForOfStatement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ForOfStatement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isImportDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ImportDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isImportDefaultSpecifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ImportDefaultSpecifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isImportNamespaceSpecifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ImportNamespaceSpecifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isImportSpecifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ImportSpecifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isImportExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ImportExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isMetaProperty(e, t) {
+ if (!e) return false;
+ if (e.type !== 'MetaProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClassMethod(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ClassMethod') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectPattern(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectPattern') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isSpreadElement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'SpreadElement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isSuper(e, t) {
+ if (!e) return false;
+ if (e.type !== 'Super') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTaggedTemplateExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TaggedTemplateExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTemplateElement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TemplateElement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTemplateLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TemplateLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isYieldExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'YieldExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isAwaitExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'AwaitExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isImport(e, t) {
+ if (!e) return false;
+ if (e.type !== 'Import') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBigIntLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'BigIntLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExportNamespaceSpecifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ExportNamespaceSpecifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isOptionalMemberExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'OptionalMemberExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isOptionalCallExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'OptionalCallExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClassProperty(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ClassProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClassAccessorProperty(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ClassAccessorProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClassPrivateProperty(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ClassPrivateProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClassPrivateMethod(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ClassPrivateMethod') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isPrivateName(e, t) {
+ if (!e) return false;
+ if (e.type !== 'PrivateName') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isStaticBlock(e, t) {
+ if (!e) return false;
+ if (e.type !== 'StaticBlock') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isAnyTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'AnyTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isArrayTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ArrayTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBooleanTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'BooleanTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBooleanLiteralTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'BooleanLiteralTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isNullLiteralTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'NullLiteralTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClassImplements(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ClassImplements') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareClass(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareClass') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareFunction(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareFunction') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareInterface(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareInterface') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareModule(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareModule') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareModuleExports(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareModuleExports') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareTypeAlias(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareTypeAlias') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareOpaqueType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareOpaqueType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareVariable(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareVariable') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareExportDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareExportDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclareExportAllDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclareExportAllDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclaredPredicate(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DeclaredPredicate') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExistsTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ExistsTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFunctionTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'FunctionTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFunctionTypeParam(e, t) {
+ if (!e) return false;
+ if (e.type !== 'FunctionTypeParam') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isGenericTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'GenericTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isInferredPredicate(e, t) {
+ if (!e) return false;
+ if (e.type !== 'InferredPredicate') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isInterfaceExtends(e, t) {
+ if (!e) return false;
+ if (e.type !== 'InterfaceExtends') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isInterfaceDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'InterfaceDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isInterfaceTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'InterfaceTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isIntersectionTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'IntersectionTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isMixedTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'MixedTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEmptyTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EmptyTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isNullableTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'NullableTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isNumberLiteralTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'NumberLiteralTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isNumberTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'NumberTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectTypeInternalSlot(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectTypeInternalSlot') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectTypeCallProperty(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectTypeCallProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectTypeIndexer(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectTypeIndexer') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectTypeProperty(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectTypeProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectTypeSpreadProperty(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ObjectTypeSpreadProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isOpaqueType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'OpaqueType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isQualifiedTypeIdentifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'QualifiedTypeIdentifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isStringLiteralTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'StringLiteralTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isStringTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'StringTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isSymbolTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'SymbolTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isThisTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ThisTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTupleTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TupleTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTypeofTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TypeofTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTypeAlias(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TypeAlias') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTypeCastExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TypeCastExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTypeParameter(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TypeParameter') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTypeParameterDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TypeParameterDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTypeParameterInstantiation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TypeParameterInstantiation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isUnionTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'UnionTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isVariance(e, t) {
+ if (!e) return false;
+ if (e.type !== 'Variance') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isVoidTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'VoidTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EnumDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumBooleanBody(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EnumBooleanBody') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumNumberBody(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EnumNumberBody') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumStringBody(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EnumStringBody') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumSymbolBody(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EnumSymbolBody') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumBooleanMember(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EnumBooleanMember') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumNumberMember(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EnumNumberMember') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumStringMember(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EnumStringMember') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumDefaultedMember(e, t) {
+ if (!e) return false;
+ if (e.type !== 'EnumDefaultedMember') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isIndexedAccessType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'IndexedAccessType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isOptionalIndexedAccessType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'OptionalIndexedAccessType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXAttribute(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXAttribute') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXClosingElement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXClosingElement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXElement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXElement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXEmptyExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXEmptyExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXExpressionContainer(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXExpressionContainer') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXSpreadChild(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXSpreadChild') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXIdentifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXIdentifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXMemberExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXMemberExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXNamespacedName(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXNamespacedName') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXOpeningElement(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXOpeningElement') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXSpreadAttribute(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXSpreadAttribute') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXText(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXText') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXFragment(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXFragment') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXOpeningFragment(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXOpeningFragment') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSXClosingFragment(e, t) {
+ if (!e) return false;
+ if (e.type !== 'JSXClosingFragment') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isNoop(e, t) {
+ if (!e) return false;
+ if (e.type !== 'Noop') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isPlaceholder(e, t) {
+ if (!e) return false;
+ if (e.type !== 'Placeholder') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isV8IntrinsicIdentifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'V8IntrinsicIdentifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isArgumentPlaceholder(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ArgumentPlaceholder') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBindExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'BindExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isImportAttribute(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ImportAttribute') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDecorator(e, t) {
+ if (!e) return false;
+ if (e.type !== 'Decorator') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDoExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DoExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExportDefaultSpecifier(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ExportDefaultSpecifier') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isRecordExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'RecordExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTupleExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TupleExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDecimalLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'DecimalLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isModuleExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'ModuleExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTopicReference(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TopicReference') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isPipelineTopicExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'PipelineTopicExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isPipelineBareFunction(e, t) {
+ if (!e) return false;
+ if (e.type !== 'PipelineBareFunction') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isPipelinePrimaryTopicReference(e, t) {
+ if (!e) return false;
+ if (e.type !== 'PipelinePrimaryTopicReference') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSParameterProperty(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSParameterProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSDeclareFunction(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSDeclareFunction') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSDeclareMethod(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSDeclareMethod') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSQualifiedName(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSQualifiedName') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSCallSignatureDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSCallSignatureDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSConstructSignatureDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSConstructSignatureDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSPropertySignature(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSPropertySignature') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSMethodSignature(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSMethodSignature') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSIndexSignature(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSIndexSignature') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSAnyKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSAnyKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSBooleanKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSBooleanKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSBigIntKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSBigIntKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSIntrinsicKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSIntrinsicKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSNeverKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSNeverKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSNullKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSNullKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSNumberKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSNumberKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSObjectKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSObjectKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSStringKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSStringKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSSymbolKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSSymbolKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSUndefinedKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSUndefinedKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSUnknownKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSUnknownKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSVoidKeyword(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSVoidKeyword') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSThisType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSThisType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSFunctionType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSFunctionType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSConstructorType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSConstructorType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeReference(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeReference') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypePredicate(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypePredicate') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeQuery(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeQuery') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeLiteral(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSArrayType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSArrayType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTupleType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTupleType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSOptionalType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSOptionalType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSRestType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSRestType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSNamedTupleMember(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSNamedTupleMember') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSUnionType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSUnionType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSIntersectionType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSIntersectionType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSConditionalType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSConditionalType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSInferType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSInferType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSParenthesizedType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSParenthesizedType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeOperator(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeOperator') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSIndexedAccessType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSIndexedAccessType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSMappedType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSMappedType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSLiteralType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSLiteralType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSExpressionWithTypeArguments(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSExpressionWithTypeArguments') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSInterfaceDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSInterfaceDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSInterfaceBody(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSInterfaceBody') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeAliasDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeAliasDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSInstantiationExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSInstantiationExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSAsExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSAsExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSSatisfiesExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSSatisfiesExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeAssertion(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeAssertion') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSEnumDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSEnumDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSEnumMember(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSEnumMember') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSModuleDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSModuleDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSModuleBlock(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSModuleBlock') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSImportType(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSImportType') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSImportEqualsDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSImportEqualsDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSExternalModuleReference(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSExternalModuleReference') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSNonNullExpression(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSNonNullExpression') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSExportAssignment(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSExportAssignment') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSNamespaceExportDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSNamespaceExportDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeAnnotation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeAnnotation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeParameterInstantiation(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeParameterInstantiation') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeParameterDeclaration(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeParameterDeclaration') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeParameter(e, t) {
+ if (!e) return false;
+ if (e.type !== 'TSTypeParameter') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isStandardized(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ArrayExpression':
+ case 'AssignmentExpression':
+ case 'BinaryExpression':
+ case 'InterpreterDirective':
+ case 'Directive':
+ case 'DirectiveLiteral':
+ case 'BlockStatement':
+ case 'BreakStatement':
+ case 'CallExpression':
+ case 'CatchClause':
+ case 'ConditionalExpression':
+ case 'ContinueStatement':
+ case 'DebuggerStatement':
+ case 'DoWhileStatement':
+ case 'EmptyStatement':
+ case 'ExpressionStatement':
+ case 'File':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'Identifier':
+ case 'IfStatement':
+ case 'LabeledStatement':
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'RegExpLiteral':
+ case 'LogicalExpression':
+ case 'MemberExpression':
+ case 'NewExpression':
+ case 'Program':
+ case 'ObjectExpression':
+ case 'ObjectMethod':
+ case 'ObjectProperty':
+ case 'RestElement':
+ case 'ReturnStatement':
+ case 'SequenceExpression':
+ case 'ParenthesizedExpression':
+ case 'SwitchCase':
+ case 'SwitchStatement':
+ case 'ThisExpression':
+ case 'ThrowStatement':
+ case 'TryStatement':
+ case 'UnaryExpression':
+ case 'UpdateExpression':
+ case 'VariableDeclaration':
+ case 'VariableDeclarator':
+ case 'WhileStatement':
+ case 'WithStatement':
+ case 'AssignmentPattern':
+ case 'ArrayPattern':
+ case 'ArrowFunctionExpression':
+ case 'ClassBody':
+ case 'ClassExpression':
+ case 'ClassDeclaration':
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ case 'ExportSpecifier':
+ case 'ForOfStatement':
+ case 'ImportDeclaration':
+ case 'ImportDefaultSpecifier':
+ case 'ImportNamespaceSpecifier':
+ case 'ImportSpecifier':
+ case 'ImportExpression':
+ case 'MetaProperty':
+ case 'ClassMethod':
+ case 'ObjectPattern':
+ case 'SpreadElement':
+ case 'Super':
+ case 'TaggedTemplateExpression':
+ case 'TemplateElement':
+ case 'TemplateLiteral':
+ case 'YieldExpression':
+ case 'AwaitExpression':
+ case 'Import':
+ case 'BigIntLiteral':
+ case 'ExportNamespaceSpecifier':
+ case 'OptionalMemberExpression':
+ case 'OptionalCallExpression':
+ case 'ClassProperty':
+ case 'ClassAccessorProperty':
+ case 'ClassPrivateProperty':
+ case 'ClassPrivateMethod':
+ case 'PrivateName':
+ case 'StaticBlock':
+ break;
+ case 'Placeholder':
+ switch (e.expectedNode) {
+ case 'Identifier':
+ case 'StringLiteral':
+ case 'BlockStatement':
+ case 'ClassBody':
+ break;
+ default:
+ return false;
+ }
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExpression(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ArrayExpression':
+ case 'AssignmentExpression':
+ case 'BinaryExpression':
+ case 'CallExpression':
+ case 'ConditionalExpression':
+ case 'FunctionExpression':
+ case 'Identifier':
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'RegExpLiteral':
+ case 'LogicalExpression':
+ case 'MemberExpression':
+ case 'NewExpression':
+ case 'ObjectExpression':
+ case 'SequenceExpression':
+ case 'ParenthesizedExpression':
+ case 'ThisExpression':
+ case 'UnaryExpression':
+ case 'UpdateExpression':
+ case 'ArrowFunctionExpression':
+ case 'ClassExpression':
+ case 'ImportExpression':
+ case 'MetaProperty':
+ case 'Super':
+ case 'TaggedTemplateExpression':
+ case 'TemplateLiteral':
+ case 'YieldExpression':
+ case 'AwaitExpression':
+ case 'Import':
+ case 'BigIntLiteral':
+ case 'OptionalMemberExpression':
+ case 'OptionalCallExpression':
+ case 'TypeCastExpression':
+ case 'JSXElement':
+ case 'JSXFragment':
+ case 'BindExpression':
+ case 'DoExpression':
+ case 'RecordExpression':
+ case 'TupleExpression':
+ case 'DecimalLiteral':
+ case 'ModuleExpression':
+ case 'TopicReference':
+ case 'PipelineTopicExpression':
+ case 'PipelineBareFunction':
+ case 'PipelinePrimaryTopicReference':
+ case 'TSInstantiationExpression':
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSTypeAssertion':
+ case 'TSNonNullExpression':
+ break;
+ case 'Placeholder':
+ switch (e.expectedNode) {
+ case 'Expression':
+ case 'Identifier':
+ case 'StringLiteral':
+ break;
+ default:
+ return false;
+ }
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBinary(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'BinaryExpression':
+ case 'LogicalExpression':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isScopable(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'BlockStatement':
+ case 'CatchClause':
+ case 'DoWhileStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'Program':
+ case 'ObjectMethod':
+ case 'SwitchStatement':
+ case 'WhileStatement':
+ case 'ArrowFunctionExpression':
+ case 'ClassExpression':
+ case 'ClassDeclaration':
+ case 'ForOfStatement':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ case 'StaticBlock':
+ case 'TSModuleBlock':
+ break;
+ case 'Placeholder':
+ if (e.expectedNode === 'BlockStatement') break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBlockParent(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'BlockStatement':
+ case 'CatchClause':
+ case 'DoWhileStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'Program':
+ case 'ObjectMethod':
+ case 'SwitchStatement':
+ case 'WhileStatement':
+ case 'ArrowFunctionExpression':
+ case 'ForOfStatement':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ case 'StaticBlock':
+ case 'TSModuleBlock':
+ break;
+ case 'Placeholder':
+ if (e.expectedNode === 'BlockStatement') break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isBlock(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'BlockStatement':
+ case 'Program':
+ case 'TSModuleBlock':
+ break;
+ case 'Placeholder':
+ if (e.expectedNode === 'BlockStatement') break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isStatement(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'BlockStatement':
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ case 'DebuggerStatement':
+ case 'DoWhileStatement':
+ case 'EmptyStatement':
+ case 'ExpressionStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'FunctionDeclaration':
+ case 'IfStatement':
+ case 'LabeledStatement':
+ case 'ReturnStatement':
+ case 'SwitchStatement':
+ case 'ThrowStatement':
+ case 'TryStatement':
+ case 'VariableDeclaration':
+ case 'WhileStatement':
+ case 'WithStatement':
+ case 'ClassDeclaration':
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ case 'ForOfStatement':
+ case 'ImportDeclaration':
+ case 'DeclareClass':
+ case 'DeclareFunction':
+ case 'DeclareInterface':
+ case 'DeclareModule':
+ case 'DeclareModuleExports':
+ case 'DeclareTypeAlias':
+ case 'DeclareOpaqueType':
+ case 'DeclareVariable':
+ case 'DeclareExportDeclaration':
+ case 'DeclareExportAllDeclaration':
+ case 'InterfaceDeclaration':
+ case 'OpaqueType':
+ case 'TypeAlias':
+ case 'EnumDeclaration':
+ case 'TSDeclareFunction':
+ case 'TSInterfaceDeclaration':
+ case 'TSTypeAliasDeclaration':
+ case 'TSEnumDeclaration':
+ case 'TSModuleDeclaration':
+ case 'TSImportEqualsDeclaration':
+ case 'TSExportAssignment':
+ case 'TSNamespaceExportDeclaration':
+ break;
+ case 'Placeholder':
+ switch (e.expectedNode) {
+ case 'Statement':
+ case 'Declaration':
+ case 'BlockStatement':
+ break;
+ default:
+ return false;
+ }
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTerminatorless(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ case 'ReturnStatement':
+ case 'ThrowStatement':
+ case 'YieldExpression':
+ case 'AwaitExpression':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isCompletionStatement(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ case 'ReturnStatement':
+ case 'ThrowStatement':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isConditional(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ConditionalExpression':
+ case 'IfStatement':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isLoop(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'DoWhileStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'WhileStatement':
+ case 'ForOfStatement':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isWhile(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'DoWhileStatement':
+ case 'WhileStatement':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExpressionWrapper(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ExpressionStatement':
+ case 'ParenthesizedExpression':
+ case 'TypeCastExpression':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFor(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'ForOfStatement':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isForXStatement(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ForInStatement':
+ case 'ForOfStatement':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFunction(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'ObjectMethod':
+ case 'ArrowFunctionExpression':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFunctionParent(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'ObjectMethod':
+ case 'ArrowFunctionExpression':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ case 'StaticBlock':
+ case 'TSModuleBlock':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isPureish(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'RegExpLiteral':
+ case 'ArrowFunctionExpression':
+ case 'BigIntLiteral':
+ case 'DecimalLiteral':
+ break;
+ case 'Placeholder':
+ if (e.expectedNode === 'StringLiteral') break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isDeclaration(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'FunctionDeclaration':
+ case 'VariableDeclaration':
+ case 'ClassDeclaration':
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ case 'ImportDeclaration':
+ case 'DeclareClass':
+ case 'DeclareFunction':
+ case 'DeclareInterface':
+ case 'DeclareModule':
+ case 'DeclareModuleExports':
+ case 'DeclareTypeAlias':
+ case 'DeclareOpaqueType':
+ case 'DeclareVariable':
+ case 'DeclareExportDeclaration':
+ case 'DeclareExportAllDeclaration':
+ case 'InterfaceDeclaration':
+ case 'OpaqueType':
+ case 'TypeAlias':
+ case 'EnumDeclaration':
+ case 'TSDeclareFunction':
+ case 'TSInterfaceDeclaration':
+ case 'TSTypeAliasDeclaration':
+ case 'TSEnumDeclaration':
+ case 'TSModuleDeclaration':
+ break;
+ case 'Placeholder':
+ if (e.expectedNode === 'Declaration') break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isPatternLike(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'Identifier':
+ case 'RestElement':
+ case 'AssignmentPattern':
+ case 'ArrayPattern':
+ case 'ObjectPattern':
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSTypeAssertion':
+ case 'TSNonNullExpression':
+ break;
+ case 'Placeholder':
+ switch (e.expectedNode) {
+ case 'Pattern':
+ case 'Identifier':
+ break;
+ default:
+ return false;
+ }
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isLVal(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'Identifier':
+ case 'MemberExpression':
+ case 'RestElement':
+ case 'AssignmentPattern':
+ case 'ArrayPattern':
+ case 'ObjectPattern':
+ case 'TSParameterProperty':
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSTypeAssertion':
+ case 'TSNonNullExpression':
+ break;
+ case 'Placeholder':
+ switch (e.expectedNode) {
+ case 'Pattern':
+ case 'Identifier':
+ break;
+ default:
+ return false;
+ }
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSEntityName(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'Identifier':
+ case 'TSQualifiedName':
+ break;
+ case 'Placeholder':
+ if (e.expectedNode === 'Identifier') break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isLiteral(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'RegExpLiteral':
+ case 'TemplateLiteral':
+ case 'BigIntLiteral':
+ case 'DecimalLiteral':
+ break;
+ case 'Placeholder':
+ if (e.expectedNode === 'StringLiteral') break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isImmutable(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'BigIntLiteral':
+ case 'JSXAttribute':
+ case 'JSXClosingElement':
+ case 'JSXElement':
+ case 'JSXExpressionContainer':
+ case 'JSXSpreadChild':
+ case 'JSXOpeningElement':
+ case 'JSXText':
+ case 'JSXFragment':
+ case 'JSXOpeningFragment':
+ case 'JSXClosingFragment':
+ case 'DecimalLiteral':
+ break;
+ case 'Placeholder':
+ if (e.expectedNode === 'StringLiteral') break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isUserWhitespacable(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ObjectMethod':
+ case 'ObjectProperty':
+ case 'ObjectTypeInternalSlot':
+ case 'ObjectTypeCallProperty':
+ case 'ObjectTypeIndexer':
+ case 'ObjectTypeProperty':
+ case 'ObjectTypeSpreadProperty':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isMethod(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ObjectMethod':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isObjectMember(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ObjectMethod':
+ case 'ObjectProperty':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isProperty(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ObjectProperty':
+ case 'ClassProperty':
+ case 'ClassAccessorProperty':
+ case 'ClassPrivateProperty':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isUnaryLike(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'UnaryExpression':
+ case 'SpreadElement':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isPattern(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'AssignmentPattern':
+ case 'ArrayPattern':
+ case 'ObjectPattern':
+ break;
+ case 'Placeholder':
+ if (e.expectedNode === 'Pattern') break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isClass(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ClassExpression':
+ case 'ClassDeclaration':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isImportOrExportDeclaration(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ case 'ImportDeclaration':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isExportDeclaration(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isModuleSpecifier(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ExportSpecifier':
+ case 'ImportDefaultSpecifier':
+ case 'ImportNamespaceSpecifier':
+ case 'ImportSpecifier':
+ case 'ExportNamespaceSpecifier':
+ case 'ExportDefaultSpecifier':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isAccessor(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ClassAccessorProperty':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isPrivate(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'ClassPrivateProperty':
+ case 'ClassPrivateMethod':
+ case 'PrivateName':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFlow(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'AnyTypeAnnotation':
+ case 'ArrayTypeAnnotation':
+ case 'BooleanTypeAnnotation':
+ case 'BooleanLiteralTypeAnnotation':
+ case 'NullLiteralTypeAnnotation':
+ case 'ClassImplements':
+ case 'DeclareClass':
+ case 'DeclareFunction':
+ case 'DeclareInterface':
+ case 'DeclareModule':
+ case 'DeclareModuleExports':
+ case 'DeclareTypeAlias':
+ case 'DeclareOpaqueType':
+ case 'DeclareVariable':
+ case 'DeclareExportDeclaration':
+ case 'DeclareExportAllDeclaration':
+ case 'DeclaredPredicate':
+ case 'ExistsTypeAnnotation':
+ case 'FunctionTypeAnnotation':
+ case 'FunctionTypeParam':
+ case 'GenericTypeAnnotation':
+ case 'InferredPredicate':
+ case 'InterfaceExtends':
+ case 'InterfaceDeclaration':
+ case 'InterfaceTypeAnnotation':
+ case 'IntersectionTypeAnnotation':
+ case 'MixedTypeAnnotation':
+ case 'EmptyTypeAnnotation':
+ case 'NullableTypeAnnotation':
+ case 'NumberLiteralTypeAnnotation':
+ case 'NumberTypeAnnotation':
+ case 'ObjectTypeAnnotation':
+ case 'ObjectTypeInternalSlot':
+ case 'ObjectTypeCallProperty':
+ case 'ObjectTypeIndexer':
+ case 'ObjectTypeProperty':
+ case 'ObjectTypeSpreadProperty':
+ case 'OpaqueType':
+ case 'QualifiedTypeIdentifier':
+ case 'StringLiteralTypeAnnotation':
+ case 'StringTypeAnnotation':
+ case 'SymbolTypeAnnotation':
+ case 'ThisTypeAnnotation':
+ case 'TupleTypeAnnotation':
+ case 'TypeofTypeAnnotation':
+ case 'TypeAlias':
+ case 'TypeAnnotation':
+ case 'TypeCastExpression':
+ case 'TypeParameter':
+ case 'TypeParameterDeclaration':
+ case 'TypeParameterInstantiation':
+ case 'UnionTypeAnnotation':
+ case 'Variance':
+ case 'VoidTypeAnnotation':
+ case 'EnumDeclaration':
+ case 'EnumBooleanBody':
+ case 'EnumNumberBody':
+ case 'EnumStringBody':
+ case 'EnumSymbolBody':
+ case 'EnumBooleanMember':
+ case 'EnumNumberMember':
+ case 'EnumStringMember':
+ case 'EnumDefaultedMember':
+ case 'IndexedAccessType':
+ case 'OptionalIndexedAccessType':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFlowType(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'AnyTypeAnnotation':
+ case 'ArrayTypeAnnotation':
+ case 'BooleanTypeAnnotation':
+ case 'BooleanLiteralTypeAnnotation':
+ case 'NullLiteralTypeAnnotation':
+ case 'ExistsTypeAnnotation':
+ case 'FunctionTypeAnnotation':
+ case 'GenericTypeAnnotation':
+ case 'InterfaceTypeAnnotation':
+ case 'IntersectionTypeAnnotation':
+ case 'MixedTypeAnnotation':
+ case 'EmptyTypeAnnotation':
+ case 'NullableTypeAnnotation':
+ case 'NumberLiteralTypeAnnotation':
+ case 'NumberTypeAnnotation':
+ case 'ObjectTypeAnnotation':
+ case 'StringLiteralTypeAnnotation':
+ case 'StringTypeAnnotation':
+ case 'SymbolTypeAnnotation':
+ case 'ThisTypeAnnotation':
+ case 'TupleTypeAnnotation':
+ case 'TypeofTypeAnnotation':
+ case 'UnionTypeAnnotation':
+ case 'VoidTypeAnnotation':
+ case 'IndexedAccessType':
+ case 'OptionalIndexedAccessType':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFlowBaseAnnotation(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'AnyTypeAnnotation':
+ case 'BooleanTypeAnnotation':
+ case 'NullLiteralTypeAnnotation':
+ case 'MixedTypeAnnotation':
+ case 'EmptyTypeAnnotation':
+ case 'NumberTypeAnnotation':
+ case 'StringTypeAnnotation':
+ case 'SymbolTypeAnnotation':
+ case 'ThisTypeAnnotation':
+ case 'VoidTypeAnnotation':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFlowDeclaration(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'DeclareClass':
+ case 'DeclareFunction':
+ case 'DeclareInterface':
+ case 'DeclareModule':
+ case 'DeclareModuleExports':
+ case 'DeclareTypeAlias':
+ case 'DeclareOpaqueType':
+ case 'DeclareVariable':
+ case 'DeclareExportDeclaration':
+ case 'DeclareExportAllDeclaration':
+ case 'InterfaceDeclaration':
+ case 'OpaqueType':
+ case 'TypeAlias':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isFlowPredicate(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'DeclaredPredicate':
+ case 'InferredPredicate':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumBody(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'EnumBooleanBody':
+ case 'EnumNumberBody':
+ case 'EnumStringBody':
+ case 'EnumSymbolBody':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isEnumMember(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'EnumBooleanMember':
+ case 'EnumNumberMember':
+ case 'EnumStringMember':
+ case 'EnumDefaultedMember':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isJSX(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'JSXAttribute':
+ case 'JSXClosingElement':
+ case 'JSXElement':
+ case 'JSXEmptyExpression':
+ case 'JSXExpressionContainer':
+ case 'JSXSpreadChild':
+ case 'JSXIdentifier':
+ case 'JSXMemberExpression':
+ case 'JSXNamespacedName':
+ case 'JSXOpeningElement':
+ case 'JSXSpreadAttribute':
+ case 'JSXText':
+ case 'JSXFragment':
+ case 'JSXOpeningFragment':
+ case 'JSXClosingFragment':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isMiscellaneous(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'Noop':
+ case 'Placeholder':
+ case 'V8IntrinsicIdentifier':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTypeScript(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'TSParameterProperty':
+ case 'TSDeclareFunction':
+ case 'TSDeclareMethod':
+ case 'TSQualifiedName':
+ case 'TSCallSignatureDeclaration':
+ case 'TSConstructSignatureDeclaration':
+ case 'TSPropertySignature':
+ case 'TSMethodSignature':
+ case 'TSIndexSignature':
+ case 'TSAnyKeyword':
+ case 'TSBooleanKeyword':
+ case 'TSBigIntKeyword':
+ case 'TSIntrinsicKeyword':
+ case 'TSNeverKeyword':
+ case 'TSNullKeyword':
+ case 'TSNumberKeyword':
+ case 'TSObjectKeyword':
+ case 'TSStringKeyword':
+ case 'TSSymbolKeyword':
+ case 'TSUndefinedKeyword':
+ case 'TSUnknownKeyword':
+ case 'TSVoidKeyword':
+ case 'TSThisType':
+ case 'TSFunctionType':
+ case 'TSConstructorType':
+ case 'TSTypeReference':
+ case 'TSTypePredicate':
+ case 'TSTypeQuery':
+ case 'TSTypeLiteral':
+ case 'TSArrayType':
+ case 'TSTupleType':
+ case 'TSOptionalType':
+ case 'TSRestType':
+ case 'TSNamedTupleMember':
+ case 'TSUnionType':
+ case 'TSIntersectionType':
+ case 'TSConditionalType':
+ case 'TSInferType':
+ case 'TSParenthesizedType':
+ case 'TSTypeOperator':
+ case 'TSIndexedAccessType':
+ case 'TSMappedType':
+ case 'TSLiteralType':
+ case 'TSExpressionWithTypeArguments':
+ case 'TSInterfaceDeclaration':
+ case 'TSInterfaceBody':
+ case 'TSTypeAliasDeclaration':
+ case 'TSInstantiationExpression':
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSTypeAssertion':
+ case 'TSEnumDeclaration':
+ case 'TSEnumMember':
+ case 'TSModuleDeclaration':
+ case 'TSModuleBlock':
+ case 'TSImportType':
+ case 'TSImportEqualsDeclaration':
+ case 'TSExternalModuleReference':
+ case 'TSNonNullExpression':
+ case 'TSExportAssignment':
+ case 'TSNamespaceExportDeclaration':
+ case 'TSTypeAnnotation':
+ case 'TSTypeParameterInstantiation':
+ case 'TSTypeParameterDeclaration':
+ case 'TSTypeParameter':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSTypeElement(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'TSCallSignatureDeclaration':
+ case 'TSConstructSignatureDeclaration':
+ case 'TSPropertySignature':
+ case 'TSMethodSignature':
+ case 'TSIndexSignature':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSType(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'TSAnyKeyword':
+ case 'TSBooleanKeyword':
+ case 'TSBigIntKeyword':
+ case 'TSIntrinsicKeyword':
+ case 'TSNeverKeyword':
+ case 'TSNullKeyword':
+ case 'TSNumberKeyword':
+ case 'TSObjectKeyword':
+ case 'TSStringKeyword':
+ case 'TSSymbolKeyword':
+ case 'TSUndefinedKeyword':
+ case 'TSUnknownKeyword':
+ case 'TSVoidKeyword':
+ case 'TSThisType':
+ case 'TSFunctionType':
+ case 'TSConstructorType':
+ case 'TSTypeReference':
+ case 'TSTypePredicate':
+ case 'TSTypeQuery':
+ case 'TSTypeLiteral':
+ case 'TSArrayType':
+ case 'TSTupleType':
+ case 'TSOptionalType':
+ case 'TSRestType':
+ case 'TSUnionType':
+ case 'TSIntersectionType':
+ case 'TSConditionalType':
+ case 'TSInferType':
+ case 'TSParenthesizedType':
+ case 'TSTypeOperator':
+ case 'TSIndexedAccessType':
+ case 'TSMappedType':
+ case 'TSLiteralType':
+ case 'TSExpressionWithTypeArguments':
+ case 'TSImportType':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isTSBaseType(e, t) {
+ if (!e) return false;
+ switch (e.type) {
+ case 'TSAnyKeyword':
+ case 'TSBooleanKeyword':
+ case 'TSBigIntKeyword':
+ case 'TSIntrinsicKeyword':
+ case 'TSNeverKeyword':
+ case 'TSNullKeyword':
+ case 'TSNumberKeyword':
+ case 'TSObjectKeyword':
+ case 'TSStringKeyword':
+ case 'TSSymbolKeyword':
+ case 'TSUndefinedKeyword':
+ case 'TSUnknownKeyword':
+ case 'TSVoidKeyword':
+ case 'TSThisType':
+ case 'TSLiteralType':
+ break;
+ default:
+ return false;
+ }
+ return t == null || (0, s.default)(e, t);
+ }
+ function isNumberLiteral(e, t) {
+ (0, i.default)('isNumberLiteral', 'isNumericLiteral');
+ if (!e) return false;
+ if (e.type !== 'NumberLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isRegexLiteral(e, t) {
+ (0, i.default)('isRegexLiteral', 'isRegExpLiteral');
+ if (!e) return false;
+ if (e.type !== 'RegexLiteral') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isRestProperty(e, t) {
+ (0, i.default)('isRestProperty', 'isRestElement');
+ if (!e) return false;
+ if (e.type !== 'RestProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isSpreadProperty(e, t) {
+ (0, i.default)('isSpreadProperty', 'isSpreadElement');
+ if (!e) return false;
+ if (e.type !== 'SpreadProperty') return false;
+ return t == null || (0, s.default)(e, t);
+ }
+ function isModuleDeclaration(e, t) {
+ (0, i.default)('isModuleDeclaration', 'isImportOrExportDeclaration');
+ return isImportOrExportDeclaration(e, t);
+ }
+ },
+ 3685: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = is;
+ var s = r(79);
+ var i = r(1009);
+ var n = r(6937);
+ var a = r(7405);
+ function is(e, t, r) {
+ if (!t) return false;
+ const o = (0, i.default)(t.type, e);
+ if (!o) {
+ if (!r && t.type === 'Placeholder' && e in a.FLIPPED_ALIAS_KEYS) {
+ return (0, n.default)(t.expectedNode, e);
+ }
+ return false;
+ }
+ if (typeof r === 'undefined') {
+ return true;
+ } else {
+ return (0, s.default)(t, r);
+ }
+ }
+ },
+ 8731: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isBinding;
+ var s = r(6675);
+ function isBinding(e, t, r) {
+ if (
+ r &&
+ e.type === 'Identifier' &&
+ t.type === 'ObjectProperty' &&
+ r.type === 'ObjectExpression'
+ ) {
+ return false;
+ }
+ const i = s.default.keys[t.type];
+ if (i) {
+ for (let r = 0; r < i.length; r++) {
+ const s = i[r];
+ const n = t[s];
+ if (Array.isArray(n)) {
+ if (n.indexOf(e) >= 0) return true;
+ } else {
+ if (n === e) return true;
+ }
+ }
+ }
+ return false;
+ }
+ },
+ 2821: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isBlockScoped;
+ var s = r(6428);
+ var i = r(9552);
+ function isBlockScoped(e) {
+ return (
+ (0, s.isFunctionDeclaration)(e) ||
+ (0, s.isClassDeclaration)(e) ||
+ (0, i.default)(e)
+ );
+ }
+ },
+ 5456: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isImmutable;
+ var s = r(1009);
+ var i = r(6428);
+ function isImmutable(e) {
+ if ((0, s.default)(e.type, 'Immutable')) return true;
+ if ((0, i.isIdentifier)(e)) {
+ if (e.name === 'undefined') {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return false;
+ }
+ },
+ 9552: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isLet;
+ var s = r(6428);
+ var i = r(1227);
+ function isLet(e) {
+ return (
+ (0, s.isVariableDeclaration)(e) &&
+ (e.kind !== 'var' || e[i.BLOCK_SCOPED_SYMBOL])
+ );
+ }
+ },
+ 6516: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isNode;
+ var s = r(7405);
+ function isNode(e) {
+ return !!(e && s.VISITOR_KEYS[e.type]);
+ }
+ },
+ 1840: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isNodesEquivalent;
+ var s = r(7405);
+ function isNodesEquivalent(e, t) {
+ if (
+ typeof e !== 'object' ||
+ typeof t !== 'object' ||
+ e == null ||
+ t == null
+ ) {
+ return e === t;
+ }
+ if (e.type !== t.type) {
+ return false;
+ }
+ const r = Object.keys(s.NODE_FIELDS[e.type] || e.type);
+ const i = s.VISITOR_KEYS[e.type];
+ for (const s of r) {
+ const r = e[s];
+ const n = t[s];
+ if (typeof r !== typeof n) {
+ return false;
+ }
+ if (r == null && n == null) {
+ continue;
+ } else if (r == null || n == null) {
+ return false;
+ }
+ if (Array.isArray(r)) {
+ if (!Array.isArray(n)) {
+ return false;
+ }
+ if (r.length !== n.length) {
+ return false;
+ }
+ for (let e = 0; e < r.length; e++) {
+ if (!isNodesEquivalent(r[e], n[e])) {
+ return false;
+ }
+ }
+ continue;
+ }
+ if (typeof r === 'object' && !(i != null && i.includes(s))) {
+ for (const e of Object.keys(r)) {
+ if (r[e] !== n[e]) {
+ return false;
+ }
+ }
+ continue;
+ }
+ if (!isNodesEquivalent(r, n)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ },
+ 6937: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isPlaceholderType;
+ var s = r(7405);
+ function isPlaceholderType(e, t) {
+ if (e === t) return true;
+ const r = s.PLACEHOLDERS_ALIAS[e];
+ if (r) {
+ for (const e of r) {
+ if (t === e) return true;
+ }
+ }
+ return false;
+ }
+ },
+ 7391: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isReferenced;
+ function isReferenced(e, t, r) {
+ switch (t.type) {
+ case 'MemberExpression':
+ case 'OptionalMemberExpression':
+ if (t.property === e) {
+ return !!t.computed;
+ }
+ return t.object === e;
+ case 'JSXMemberExpression':
+ return t.object === e;
+ case 'VariableDeclarator':
+ return t.init === e;
+ case 'ArrowFunctionExpression':
+ return t.body === e;
+ case 'PrivateName':
+ return false;
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ case 'ObjectMethod':
+ if (t.key === e) {
+ return !!t.computed;
+ }
+ return false;
+ case 'ObjectProperty':
+ if (t.key === e) {
+ return !!t.computed;
+ }
+ return !r || r.type !== 'ObjectPattern';
+ case 'ClassProperty':
+ case 'ClassAccessorProperty':
+ if (t.key === e) {
+ return !!t.computed;
+ }
+ return true;
+ case 'ClassPrivateProperty':
+ return t.key !== e;
+ case 'ClassDeclaration':
+ case 'ClassExpression':
+ return t.superClass === e;
+ case 'AssignmentExpression':
+ return t.right === e;
+ case 'AssignmentPattern':
+ return t.right === e;
+ case 'LabeledStatement':
+ return false;
+ case 'CatchClause':
+ return false;
+ case 'RestElement':
+ return false;
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ return false;
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ return false;
+ case 'ExportNamespaceSpecifier':
+ case 'ExportDefaultSpecifier':
+ return false;
+ case 'ExportSpecifier':
+ if (r != null && r.source) {
+ return false;
+ }
+ return t.local === e;
+ case 'ImportDefaultSpecifier':
+ case 'ImportNamespaceSpecifier':
+ case 'ImportSpecifier':
+ return false;
+ case 'ImportAttribute':
+ return false;
+ case 'JSXAttribute':
+ return false;
+ case 'ObjectPattern':
+ case 'ArrayPattern':
+ return false;
+ case 'MetaProperty':
+ return false;
+ case 'ObjectTypeProperty':
+ return t.key !== e;
+ case 'TSEnumMember':
+ return t.id !== e;
+ case 'TSPropertySignature':
+ if (t.key === e) {
+ return !!t.computed;
+ }
+ return true;
+ }
+ return true;
+ }
+ },
+ 7910: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isScope;
+ var s = r(6428);
+ function isScope(e, t) {
+ if (
+ (0, s.isBlockStatement)(e) &&
+ ((0, s.isFunction)(t) || (0, s.isCatchClause)(t))
+ ) {
+ return false;
+ }
+ if (
+ (0, s.isPattern)(e) &&
+ ((0, s.isFunction)(t) || (0, s.isCatchClause)(t))
+ ) {
+ return true;
+ }
+ return (0, s.isScopable)(e);
+ }
+ },
+ 9003: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isSpecifierDefault;
+ var s = r(6428);
+ function isSpecifierDefault(e) {
+ return (
+ (0, s.isImportDefaultSpecifier)(e) ||
+ (0, s.isIdentifier)(e.imported || e.exported, { name: 'default' })
+ );
+ }
+ },
+ 1009: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isType;
+ var s = r(7405);
+ function isType(e, t) {
+ if (e === t) return true;
+ if (e == null) return false;
+ if (s.ALIAS_KEYS[t]) return false;
+ const r = s.FLIPPED_ALIAS_KEYS[t];
+ if (r) {
+ if (r[0] === e) return true;
+ for (const t of r) {
+ if (e === t) return true;
+ }
+ }
+ return false;
+ }
+ },
+ 5563: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isValidES3Identifier;
+ var s = r(9994);
+ const i = new Set([
+ 'abstract',
+ 'boolean',
+ 'byte',
+ 'char',
+ 'double',
+ 'enum',
+ 'final',
+ 'float',
+ 'goto',
+ 'implements',
+ 'int',
+ 'interface',
+ 'long',
+ 'native',
+ 'package',
+ 'private',
+ 'protected',
+ 'public',
+ 'short',
+ 'static',
+ 'synchronized',
+ 'throws',
+ 'transient',
+ 'volatile',
+ ]);
+ function isValidES3Identifier(e) {
+ return (0, s.default)(e) && !i.has(e);
+ }
+ },
+ 9994: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isValidIdentifier;
+ var s = r(3442);
+ function isValidIdentifier(e, t = true) {
+ if (typeof e !== 'string') return false;
+ if (t) {
+ if ((0, s.isKeyword)(e) || (0, s.isStrictReservedWord)(e, true)) {
+ return false;
+ }
+ }
+ return (0, s.isIdentifierName)(e);
+ }
+ },
+ 7407: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isVar;
+ var s = r(6428);
+ var i = r(1227);
+ function isVar(e) {
+ return (
+ (0, s.isVariableDeclaration)(e, { kind: 'var' }) &&
+ !e[i.BLOCK_SCOPED_SYMBOL]
+ );
+ }
+ },
+ 3794: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = matchesPattern;
+ var s = r(6428);
+ function matchesPattern(e, t, r) {
+ if (!(0, s.isMemberExpression)(e)) return false;
+ const i = Array.isArray(t) ? t : t.split('.');
+ const n = [];
+ let a;
+ for (a = e; (0, s.isMemberExpression)(a); a = a.object) {
+ n.push(a.property);
+ }
+ n.push(a);
+ if (n.length < i.length) return false;
+ if (!r && n.length > i.length) return false;
+ for (let e = 0, t = n.length - 1; e < i.length; e++, t--) {
+ const r = n[t];
+ let a;
+ if ((0, s.isIdentifier)(r)) {
+ a = r.name;
+ } else if ((0, s.isStringLiteral)(r)) {
+ a = r.value;
+ } else if ((0, s.isThisExpression)(r)) {
+ a = 'this';
+ } else {
+ return false;
+ }
+ if (i[e] !== a) return false;
+ }
+ return true;
+ }
+ },
+ 9482: function (e, t) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = isCompatTag;
+ function isCompatTag(e) {
+ return !!e && /^[a-z]/.test(e);
+ }
+ },
+ 835: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = void 0;
+ var s = r(5659);
+ const i = (0, s.default)('React.Component');
+ var n = (t['default'] = i);
+ },
+ 7159: function (e, t, r) {
+ 'use strict';
+ Object.defineProperty(t, '__esModule', { value: true });
+ t['default'] = validate;
+ t.validateChild = validateChild;
+ t.validateField = validateField;
+ var s = r(7405);
+ function validate(e, t, r) {
+ if (!e) return;
+ const i = s.NODE_FIELDS[e.type];
+ if (!i) return;
+ const n = i[t];
+ validateField(e, t, r, n);
+ validateChild(e, t, r);
+ }
+ function validateField(e, t, r, s) {
+ if (!(s != null && s.validate)) return;
+ if (s.optional && r == null) return;
+ s.validate(e, t, r);
+ }
+ function validateChild(e, t, r) {
+ if (r == null) return;
+ const i = s.NODE_PARENT_VALIDATIONS[r.type];
+ if (!i) return;
+ i(e, t, r);
+ }
+ },
+ 5633: function (e) {
+ 'use strict';
+ e.exports = JSON.parse(
+ '["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]',
+ );
+ },
+ 7188: function (e) {
+ 'use strict';
+ e.exports = JSON.parse(
+ '["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"]',
+ );
+ },
+ };
+ var t = {};
+ function __nccwpck_require__(r) {
+ var s = t[r];
+ if (s !== undefined) {
+ return s.exports;
+ }
+ var i = (t[r] = { id: r, loaded: false, exports: {} });
+ var n = true;
+ try {
+ e[r](i, i.exports, __nccwpck_require__);
+ n = false;
+ } finally {
+ if (n) delete t[r];
+ }
+ i.loaded = true;
+ return i.exports;
+ }
+ !(function () {
+ __nccwpck_require__.nmd = function (e) {
+ e.paths = [];
+ if (!e.children) e.children = [];
+ return e;
+ };
+ })();
+ if (typeof __nccwpck_require__ !== 'undefined')
+ __nccwpck_require__.ab = __dirname + '/';
+ var r = __nccwpck_require__(831);
+ module.exports = r;
+})();
diff --git a/suites/preset-vue/compiled/@vue/babel-plugin-jsx/package.json b/suites/preset-vue/compiled/@vue/babel-plugin-jsx/package.json
new file mode 100644
index 0000000000..61aea58c85
--- /dev/null
+++ b/suites/preset-vue/compiled/@vue/babel-plugin-jsx/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@vue/babel-plugin-jsx",
+ "version": "1.1.5",
+ "license": "MIT",
+ "author": "Amour1688 ",
+ "_lastModified": "2024-01-07T08:42:45.781Z"
+}
diff --git a/suites/preset-vue/lib/compiler.mjs b/suites/preset-vue/lib/compiler.mjs
new file mode 100644
index 0000000000..029c67b5da
--- /dev/null
+++ b/suites/preset-vue/lib/compiler.mjs
@@ -0,0 +1,74 @@
+import { parse, compileScript, rewriteDefault, compileTemplate, compileStyle } from 'vue/compiler-sfc';
+import * as Td from '@babel/standalone';
+
+var Sd=Object.create;var ko=Object.defineProperty;var xd=Object.getOwnPropertyDescriptor;var Pd=Object.getOwnPropertyNames;var Ed=Object.getPrototypeOf,gd=Object.prototype.hasOwnProperty;var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ad=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Pd(e))!gd.call(t,s)&&s!==r&&ko(t,s,{get:()=>e[s],enumerable:!(i=xd(e,s))||i.enumerable});return t};var Ce=(t,e,r)=>(r=t!=null?Sd(Ed(t)):{},Ad(e||!t||!t.__esModule?ko(r,"default",{value:t,enumerable:!0}):r,t));var Dr=A(Xi=>{Object.defineProperty(Xi,"__esModule",{value:!0});Xi.default=vd;function vd(t,e){let r=Object.keys(e);for(let i of r)if(t[i]!==e[i])return !1;return !0}});var Vt=A(Ji=>{Object.defineProperty(Ji,"__esModule",{value:!0});Ji.default=Id;var _o=new Set;function Id(t,e,r=""){if(_o.has(t))return;_o.add(t);let{internal:i,trace:s}=wd(1,2);i||console.warn(`${r}\`${t}\` has been deprecated, please migrate to \`${e}\`
+${s}`);}function wd(t,e){let{stackTraceLimit:r,prepareStackTrace:i}=Error,s;if(Error.stackTraceLimit=1+t+e,Error.prepareStackTrace=function(n,o){s=o;},new Error().stack,Error.stackTraceLimit=r,Error.prepareStackTrace=i,!s)return {internal:!1,trace:""};let a=s.slice(1+t,1+t+e);return {internal:/[\\/]@babel[\\/]/.test(a[1].getFileName()),trace:a.map(n=>` at ${n}`).join(`
+`)}}});var le=A(d=>{Object.defineProperty(d,"__esModule",{value:!0});d.isAccessor=qT;d.isAnyTypeAnnotation=ly;d.isArgumentPlaceholder=Bm;d.isArrayExpression=Od;d.isArrayPattern=Ih;d.isArrayTypeAnnotation=uy;d.isArrowFunctionExpression=wh;d.isAssignmentExpression=Nd;d.isAssignmentPattern=vh;d.isAwaitExpression=Hh;d.isBigIntLiteral=Qh;d.isBinary=cT;d.isBinaryExpression=Cd;d.isBindExpression=Fm;d.isBlock=dT;d.isBlockParent=fT;d.isBlockStatement=_d;d.isBooleanLiteral=th;d.isBooleanLiteralTypeAnnotation=py;d.isBooleanTypeAnnotation=cy;d.isBreakStatement=Md;d.isCallExpression=jd;d.isCatchClause=Bd;d.isClass=FT;d.isClassAccessorProperty=iy;d.isClassBody=Oh;d.isClassDeclaration=Ch;d.isClassExpression=Nh;d.isClassImplements=dy;d.isClassMethod=Kh;d.isClassPrivateMethod=ay;d.isClassPrivateProperty=sy;d.isClassProperty=ry;d.isCompletionStatement=mT;d.isConditional=TT;d.isConditionalExpression=Fd;d.isContinueStatement=Rd;d.isDebuggerStatement=Ud;d.isDecimalLiteral=Xm;d.isDeclaration=IT;d.isDeclareClass=hy;d.isDeclareExportAllDeclaration=gy;d.isDeclareExportDeclaration=Ey;d.isDeclareFunction=yy;d.isDeclareInterface=my;d.isDeclareModule=Ty;d.isDeclareModuleExports=by;d.isDeclareOpaqueType=xy;d.isDeclareTypeAlias=Sy;d.isDeclareVariable=Py;d.isDeclaredPredicate=Ay;d.isDecorator=Um;d.isDirective=Ld;d.isDirectiveLiteral=kd;d.isDoExpression=qm;d.isDoWhileStatement=qd;d.isEmptyStatement=Kd;d.isEmptyTypeAnnotation=My;d.isEnumBody=WT;d.isEnumBooleanBody=um;d.isEnumBooleanMember=dm;d.isEnumDeclaration=lm;d.isEnumDefaultedMember=mm;d.isEnumMember=zT;d.isEnumNumberBody=cm;d.isEnumNumberMember=hm;d.isEnumStringBody=pm;d.isEnumStringMember=ym;d.isEnumSymbolBody=fm;d.isExistsTypeAnnotation=vy;d.isExportAllDeclaration=Dh;d.isExportDeclaration=RT;d.isExportDefaultDeclaration=Lh;d.isExportDefaultSpecifier=Km;d.isExportNamedDeclaration=kh;d.isExportNamespaceSpecifier=Zh;d.isExportSpecifier=_h;d.isExpression=uT;d.isExpressionStatement=Vd;d.isExpressionWrapper=xT;d.isFile=Yd;d.isFlow=VT;d.isFlowBaseAnnotation=XT;d.isFlowDeclaration=JT;d.isFlowPredicate=$T;d.isFlowType=YT;d.isFor=PT;d.isForInStatement=Xd;d.isForOfStatement=Mh;d.isForStatement=Jd;d.isForXStatement=ET;d.isFunction=gT;d.isFunctionDeclaration=$d;d.isFunctionExpression=Wd;d.isFunctionParent=AT;d.isFunctionTypeAnnotation=Iy;d.isFunctionTypeParam=wy;d.isGenericTypeAnnotation=Oy;d.isIdentifier=zd;d.isIfStatement=Hd;d.isImmutable=DT;d.isImport=Gh;d.isImportAttribute=Rm;d.isImportDeclaration=jh;d.isImportDefaultSpecifier=Bh;d.isImportExpression=Uh;d.isImportNamespaceSpecifier=Fh;d.isImportOrExportDeclaration=Mo;d.isImportSpecifier=Rh;d.isIndexedAccessType=Tm;d.isInferredPredicate=Ny;d.isInterfaceDeclaration=Dy;d.isInterfaceExtends=Cy;d.isInterfaceTypeAnnotation=Ly;d.isInterpreterDirective=Dd;d.isIntersectionTypeAnnotation=ky;d.isJSX=HT;d.isJSXAttribute=Sm;d.isJSXClosingElement=xm;d.isJSXClosingFragment=km;d.isJSXElement=Pm;d.isJSXEmptyExpression=Em;d.isJSXExpressionContainer=gm;d.isJSXFragment=Dm;d.isJSXIdentifier=vm;d.isJSXMemberExpression=Im;d.isJSXNamespacedName=wm;d.isJSXOpeningElement=Om;d.isJSXOpeningFragment=Lm;d.isJSXSpreadAttribute=Nm;d.isJSXSpreadChild=Am;d.isJSXText=Cm;d.isLVal=OT;d.isLabeledStatement=Gd;d.isLiteral=CT;d.isLogicalExpression=ih;d.isLoop=bT;d.isMemberExpression=sh;d.isMetaProperty=qh;d.isMethod=kT;d.isMiscellaneous=GT;d.isMixedTypeAnnotation=_y;d.isModuleDeclaration=nb;d.isModuleExpression=Jm;d.isModuleSpecifier=UT;d.isNewExpression=ah;d.isNoop=_m;d.isNullLiteral=eh;d.isNullLiteralTypeAnnotation=fy;d.isNullableTypeAnnotation=jy;d.isNumberLiteral=rb;d.isNumberLiteralTypeAnnotation=By;d.isNumberTypeAnnotation=Fy;d.isNumericLiteral=Zd;d.isObjectExpression=oh;d.isObjectMember=_T;d.isObjectMethod=lh;d.isObjectPattern=Vh;d.isObjectProperty=uh;d.isObjectTypeAnnotation=Ry;d.isObjectTypeCallProperty=qy;d.isObjectTypeIndexer=Ky;d.isObjectTypeInternalSlot=Uy;d.isObjectTypeProperty=Vy;d.isObjectTypeSpreadProperty=Yy;d.isOpaqueType=Xy;d.isOptionalCallExpression=ty;d.isOptionalIndexedAccessType=bm;d.isOptionalMemberExpression=ey;d.isParenthesizedExpression=dh;d.isPattern=BT;d.isPatternLike=wT;d.isPipelineBareFunction=zm;d.isPipelinePrimaryTopicReference=Hm;d.isPipelineTopicExpression=Wm;d.isPlaceholder=Mm;d.isPrivate=KT;d.isPrivateName=ny;d.isProgram=nh;d.isProperty=MT;d.isPureish=vT;d.isQualifiedTypeIdentifier=Jy;d.isRecordExpression=Vm;d.isRegExpLiteral=rh;d.isRegexLiteral=ib;d.isRestElement=ch;d.isRestProperty=sb;d.isReturnStatement=ph;d.isScopable=pT;d.isSequenceExpression=fh;d.isSpreadElement=Yh;d.isSpreadProperty=ab;d.isStandardized=lT;d.isStatement=hT;d.isStaticBlock=oy;d.isStringLiteral=Qd;d.isStringLiteralTypeAnnotation=$y;d.isStringTypeAnnotation=Wy;d.isSuper=Xh;d.isSwitchCase=hh;d.isSwitchStatement=yh;d.isSymbolTypeAnnotation=zy;d.isTSAnyKeyword=n0;d.isTSArrayType=I0;d.isTSAsExpression=X0;d.isTSBaseType=tb;d.isTSBigIntKeyword=l0;d.isTSBooleanKeyword=o0;d.isTSCallSignatureDeclaration=t0;d.isTSConditionalType=k0;d.isTSConstructSignatureDeclaration=r0;d.isTSConstructorType=P0;d.isTSDeclareFunction=Qm;d.isTSDeclareMethod=Zm;d.isTSEntityName=NT;d.isTSEnumDeclaration=W0;d.isTSEnumMember=z0;d.isTSExportAssignment=rT;d.isTSExpressionWithTypeArguments=U0;d.isTSExternalModuleReference=eT;d.isTSFunctionType=x0;d.isTSImportEqualsDeclaration=Z0;d.isTSImportType=Q0;d.isTSIndexSignature=a0;d.isTSIndexedAccessType=B0;d.isTSInferType=_0;d.isTSInstantiationExpression=Y0;d.isTSInterfaceBody=K0;d.isTSInterfaceDeclaration=q0;d.isTSIntersectionType=L0;d.isTSIntrinsicKeyword=u0;d.isTSLiteralType=R0;d.isTSMappedType=F0;d.isTSMethodSignature=s0;d.isTSModuleBlock=G0;d.isTSModuleDeclaration=H0;d.isTSNamedTupleMember=C0;d.isTSNamespaceExportDeclaration=iT;d.isTSNeverKeyword=c0;d.isTSNonNullExpression=tT;d.isTSNullKeyword=p0;d.isTSNumberKeyword=f0;d.isTSObjectKeyword=d0;d.isTSOptionalType=O0;d.isTSParameterProperty=Gm;d.isTSParenthesizedType=M0;d.isTSPropertySignature=i0;d.isTSQualifiedName=e0;d.isTSRestType=N0;d.isTSSatisfiesExpression=J0;d.isTSStringKeyword=h0;d.isTSSymbolKeyword=y0;d.isTSThisType=S0;d.isTSTupleType=w0;d.isTSType=eb;d.isTSTypeAliasDeclaration=V0;d.isTSTypeAnnotation=sT;d.isTSTypeAssertion=$0;d.isTSTypeElement=ZT;d.isTSTypeLiteral=v0;d.isTSTypeOperator=j0;d.isTSTypeParameter=oT;d.isTSTypeParameterDeclaration=nT;d.isTSTypeParameterInstantiation=aT;d.isTSTypePredicate=g0;d.isTSTypeQuery=A0;d.isTSTypeReference=E0;d.isTSUndefinedKeyword=m0;d.isTSUnionType=D0;d.isTSUnknownKeyword=T0;d.isTSVoidKeyword=b0;d.isTaggedTemplateExpression=Jh;d.isTemplateElement=$h;d.isTemplateLiteral=Wh;d.isTerminatorless=yT;d.isThisExpression=mh;d.isThisTypeAnnotation=Hy;d.isThrowStatement=Th;d.isTopicReference=$m;d.isTryStatement=bh;d.isTupleExpression=Ym;d.isTupleTypeAnnotation=Gy;d.isTypeAlias=Zy;d.isTypeAnnotation=em;d.isTypeCastExpression=tm;d.isTypeParameter=rm;d.isTypeParameterDeclaration=im;d.isTypeParameterInstantiation=sm;d.isTypeScript=QT;d.isTypeofTypeAnnotation=Qy;d.isUnaryExpression=Sh;d.isUnaryLike=jT;d.isUnionTypeAnnotation=am;d.isUpdateExpression=xh;d.isUserWhitespacable=LT;d.isV8IntrinsicIdentifier=jm;d.isVariableDeclaration=Ph;d.isVariableDeclarator=Eh;d.isVariance=nm;d.isVoidTypeAnnotation=om;d.isWhile=ST;d.isWhileStatement=gh;d.isWithStatement=Ah;d.isYieldExpression=zh;var m=Dr(),Yt=Vt();function Od(t,e){return !t||t.type!=="ArrayExpression"?!1:e==null||(0, m.default)(t,e)}function Nd(t,e){return !t||t.type!=="AssignmentExpression"?!1:e==null||(0, m.default)(t,e)}function Cd(t,e){return !t||t.type!=="BinaryExpression"?!1:e==null||(0, m.default)(t,e)}function Dd(t,e){return !t||t.type!=="InterpreterDirective"?!1:e==null||(0, m.default)(t,e)}function Ld(t,e){return !t||t.type!=="Directive"?!1:e==null||(0, m.default)(t,e)}function kd(t,e){return !t||t.type!=="DirectiveLiteral"?!1:e==null||(0, m.default)(t,e)}function _d(t,e){return !t||t.type!=="BlockStatement"?!1:e==null||(0, m.default)(t,e)}function Md(t,e){return !t||t.type!=="BreakStatement"?!1:e==null||(0, m.default)(t,e)}function jd(t,e){return !t||t.type!=="CallExpression"?!1:e==null||(0, m.default)(t,e)}function Bd(t,e){return !t||t.type!=="CatchClause"?!1:e==null||(0, m.default)(t,e)}function Fd(t,e){return !t||t.type!=="ConditionalExpression"?!1:e==null||(0, m.default)(t,e)}function Rd(t,e){return !t||t.type!=="ContinueStatement"?!1:e==null||(0, m.default)(t,e)}function Ud(t,e){return !t||t.type!=="DebuggerStatement"?!1:e==null||(0, m.default)(t,e)}function qd(t,e){return !t||t.type!=="DoWhileStatement"?!1:e==null||(0, m.default)(t,e)}function Kd(t,e){return !t||t.type!=="EmptyStatement"?!1:e==null||(0, m.default)(t,e)}function Vd(t,e){return !t||t.type!=="ExpressionStatement"?!1:e==null||(0, m.default)(t,e)}function Yd(t,e){return !t||t.type!=="File"?!1:e==null||(0, m.default)(t,e)}function Xd(t,e){return !t||t.type!=="ForInStatement"?!1:e==null||(0, m.default)(t,e)}function Jd(t,e){return !t||t.type!=="ForStatement"?!1:e==null||(0, m.default)(t,e)}function $d(t,e){return !t||t.type!=="FunctionDeclaration"?!1:e==null||(0, m.default)(t,e)}function Wd(t,e){return !t||t.type!=="FunctionExpression"?!1:e==null||(0, m.default)(t,e)}function zd(t,e){return !t||t.type!=="Identifier"?!1:e==null||(0, m.default)(t,e)}function Hd(t,e){return !t||t.type!=="IfStatement"?!1:e==null||(0, m.default)(t,e)}function Gd(t,e){return !t||t.type!=="LabeledStatement"?!1:e==null||(0, m.default)(t,e)}function Qd(t,e){return !t||t.type!=="StringLiteral"?!1:e==null||(0, m.default)(t,e)}function Zd(t,e){return !t||t.type!=="NumericLiteral"?!1:e==null||(0, m.default)(t,e)}function eh(t,e){return !t||t.type!=="NullLiteral"?!1:e==null||(0, m.default)(t,e)}function th(t,e){return !t||t.type!=="BooleanLiteral"?!1:e==null||(0, m.default)(t,e)}function rh(t,e){return !t||t.type!=="RegExpLiteral"?!1:e==null||(0, m.default)(t,e)}function ih(t,e){return !t||t.type!=="LogicalExpression"?!1:e==null||(0, m.default)(t,e)}function sh(t,e){return !t||t.type!=="MemberExpression"?!1:e==null||(0, m.default)(t,e)}function ah(t,e){return !t||t.type!=="NewExpression"?!1:e==null||(0, m.default)(t,e)}function nh(t,e){return !t||t.type!=="Program"?!1:e==null||(0, m.default)(t,e)}function oh(t,e){return !t||t.type!=="ObjectExpression"?!1:e==null||(0, m.default)(t,e)}function lh(t,e){return !t||t.type!=="ObjectMethod"?!1:e==null||(0, m.default)(t,e)}function uh(t,e){return !t||t.type!=="ObjectProperty"?!1:e==null||(0, m.default)(t,e)}function ch(t,e){return !t||t.type!=="RestElement"?!1:e==null||(0, m.default)(t,e)}function ph(t,e){return !t||t.type!=="ReturnStatement"?!1:e==null||(0, m.default)(t,e)}function fh(t,e){return !t||t.type!=="SequenceExpression"?!1:e==null||(0, m.default)(t,e)}function dh(t,e){return !t||t.type!=="ParenthesizedExpression"?!1:e==null||(0, m.default)(t,e)}function hh(t,e){return !t||t.type!=="SwitchCase"?!1:e==null||(0, m.default)(t,e)}function yh(t,e){return !t||t.type!=="SwitchStatement"?!1:e==null||(0, m.default)(t,e)}function mh(t,e){return !t||t.type!=="ThisExpression"?!1:e==null||(0, m.default)(t,e)}function Th(t,e){return !t||t.type!=="ThrowStatement"?!1:e==null||(0, m.default)(t,e)}function bh(t,e){return !t||t.type!=="TryStatement"?!1:e==null||(0, m.default)(t,e)}function Sh(t,e){return !t||t.type!=="UnaryExpression"?!1:e==null||(0, m.default)(t,e)}function xh(t,e){return !t||t.type!=="UpdateExpression"?!1:e==null||(0, m.default)(t,e)}function Ph(t,e){return !t||t.type!=="VariableDeclaration"?!1:e==null||(0, m.default)(t,e)}function Eh(t,e){return !t||t.type!=="VariableDeclarator"?!1:e==null||(0, m.default)(t,e)}function gh(t,e){return !t||t.type!=="WhileStatement"?!1:e==null||(0, m.default)(t,e)}function Ah(t,e){return !t||t.type!=="WithStatement"?!1:e==null||(0, m.default)(t,e)}function vh(t,e){return !t||t.type!=="AssignmentPattern"?!1:e==null||(0, m.default)(t,e)}function Ih(t,e){return !t||t.type!=="ArrayPattern"?!1:e==null||(0, m.default)(t,e)}function wh(t,e){return !t||t.type!=="ArrowFunctionExpression"?!1:e==null||(0, m.default)(t,e)}function Oh(t,e){return !t||t.type!=="ClassBody"?!1:e==null||(0, m.default)(t,e)}function Nh(t,e){return !t||t.type!=="ClassExpression"?!1:e==null||(0, m.default)(t,e)}function Ch(t,e){return !t||t.type!=="ClassDeclaration"?!1:e==null||(0, m.default)(t,e)}function Dh(t,e){return !t||t.type!=="ExportAllDeclaration"?!1:e==null||(0, m.default)(t,e)}function Lh(t,e){return !t||t.type!=="ExportDefaultDeclaration"?!1:e==null||(0, m.default)(t,e)}function kh(t,e){return !t||t.type!=="ExportNamedDeclaration"?!1:e==null||(0, m.default)(t,e)}function _h(t,e){return !t||t.type!=="ExportSpecifier"?!1:e==null||(0, m.default)(t,e)}function Mh(t,e){return !t||t.type!=="ForOfStatement"?!1:e==null||(0, m.default)(t,e)}function jh(t,e){return !t||t.type!=="ImportDeclaration"?!1:e==null||(0, m.default)(t,e)}function Bh(t,e){return !t||t.type!=="ImportDefaultSpecifier"?!1:e==null||(0, m.default)(t,e)}function Fh(t,e){return !t||t.type!=="ImportNamespaceSpecifier"?!1:e==null||(0, m.default)(t,e)}function Rh(t,e){return !t||t.type!=="ImportSpecifier"?!1:e==null||(0, m.default)(t,e)}function Uh(t,e){return !t||t.type!=="ImportExpression"?!1:e==null||(0, m.default)(t,e)}function qh(t,e){return !t||t.type!=="MetaProperty"?!1:e==null||(0, m.default)(t,e)}function Kh(t,e){return !t||t.type!=="ClassMethod"?!1:e==null||(0, m.default)(t,e)}function Vh(t,e){return !t||t.type!=="ObjectPattern"?!1:e==null||(0, m.default)(t,e)}function Yh(t,e){return !t||t.type!=="SpreadElement"?!1:e==null||(0, m.default)(t,e)}function Xh(t,e){return !t||t.type!=="Super"?!1:e==null||(0, m.default)(t,e)}function Jh(t,e){return !t||t.type!=="TaggedTemplateExpression"?!1:e==null||(0, m.default)(t,e)}function $h(t,e){return !t||t.type!=="TemplateElement"?!1:e==null||(0, m.default)(t,e)}function Wh(t,e){return !t||t.type!=="TemplateLiteral"?!1:e==null||(0, m.default)(t,e)}function zh(t,e){return !t||t.type!=="YieldExpression"?!1:e==null||(0, m.default)(t,e)}function Hh(t,e){return !t||t.type!=="AwaitExpression"?!1:e==null||(0, m.default)(t,e)}function Gh(t,e){return !t||t.type!=="Import"?!1:e==null||(0, m.default)(t,e)}function Qh(t,e){return !t||t.type!=="BigIntLiteral"?!1:e==null||(0, m.default)(t,e)}function Zh(t,e){return !t||t.type!=="ExportNamespaceSpecifier"?!1:e==null||(0, m.default)(t,e)}function ey(t,e){return !t||t.type!=="OptionalMemberExpression"?!1:e==null||(0, m.default)(t,e)}function ty(t,e){return !t||t.type!=="OptionalCallExpression"?!1:e==null||(0, m.default)(t,e)}function ry(t,e){return !t||t.type!=="ClassProperty"?!1:e==null||(0, m.default)(t,e)}function iy(t,e){return !t||t.type!=="ClassAccessorProperty"?!1:e==null||(0, m.default)(t,e)}function sy(t,e){return !t||t.type!=="ClassPrivateProperty"?!1:e==null||(0, m.default)(t,e)}function ay(t,e){return !t||t.type!=="ClassPrivateMethod"?!1:e==null||(0, m.default)(t,e)}function ny(t,e){return !t||t.type!=="PrivateName"?!1:e==null||(0, m.default)(t,e)}function oy(t,e){return !t||t.type!=="StaticBlock"?!1:e==null||(0, m.default)(t,e)}function ly(t,e){return !t||t.type!=="AnyTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function uy(t,e){return !t||t.type!=="ArrayTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function cy(t,e){return !t||t.type!=="BooleanTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function py(t,e){return !t||t.type!=="BooleanLiteralTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function fy(t,e){return !t||t.type!=="NullLiteralTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function dy(t,e){return !t||t.type!=="ClassImplements"?!1:e==null||(0, m.default)(t,e)}function hy(t,e){return !t||t.type!=="DeclareClass"?!1:e==null||(0, m.default)(t,e)}function yy(t,e){return !t||t.type!=="DeclareFunction"?!1:e==null||(0, m.default)(t,e)}function my(t,e){return !t||t.type!=="DeclareInterface"?!1:e==null||(0, m.default)(t,e)}function Ty(t,e){return !t||t.type!=="DeclareModule"?!1:e==null||(0, m.default)(t,e)}function by(t,e){return !t||t.type!=="DeclareModuleExports"?!1:e==null||(0, m.default)(t,e)}function Sy(t,e){return !t||t.type!=="DeclareTypeAlias"?!1:e==null||(0, m.default)(t,e)}function xy(t,e){return !t||t.type!=="DeclareOpaqueType"?!1:e==null||(0, m.default)(t,e)}function Py(t,e){return !t||t.type!=="DeclareVariable"?!1:e==null||(0, m.default)(t,e)}function Ey(t,e){return !t||t.type!=="DeclareExportDeclaration"?!1:e==null||(0, m.default)(t,e)}function gy(t,e){return !t||t.type!=="DeclareExportAllDeclaration"?!1:e==null||(0, m.default)(t,e)}function Ay(t,e){return !t||t.type!=="DeclaredPredicate"?!1:e==null||(0, m.default)(t,e)}function vy(t,e){return !t||t.type!=="ExistsTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Iy(t,e){return !t||t.type!=="FunctionTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function wy(t,e){return !t||t.type!=="FunctionTypeParam"?!1:e==null||(0, m.default)(t,e)}function Oy(t,e){return !t||t.type!=="GenericTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Ny(t,e){return !t||t.type!=="InferredPredicate"?!1:e==null||(0, m.default)(t,e)}function Cy(t,e){return !t||t.type!=="InterfaceExtends"?!1:e==null||(0, m.default)(t,e)}function Dy(t,e){return !t||t.type!=="InterfaceDeclaration"?!1:e==null||(0, m.default)(t,e)}function Ly(t,e){return !t||t.type!=="InterfaceTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function ky(t,e){return !t||t.type!=="IntersectionTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function _y(t,e){return !t||t.type!=="MixedTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function My(t,e){return !t||t.type!=="EmptyTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function jy(t,e){return !t||t.type!=="NullableTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function By(t,e){return !t||t.type!=="NumberLiteralTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Fy(t,e){return !t||t.type!=="NumberTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Ry(t,e){return !t||t.type!=="ObjectTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Uy(t,e){return !t||t.type!=="ObjectTypeInternalSlot"?!1:e==null||(0, m.default)(t,e)}function qy(t,e){return !t||t.type!=="ObjectTypeCallProperty"?!1:e==null||(0, m.default)(t,e)}function Ky(t,e){return !t||t.type!=="ObjectTypeIndexer"?!1:e==null||(0, m.default)(t,e)}function Vy(t,e){return !t||t.type!=="ObjectTypeProperty"?!1:e==null||(0, m.default)(t,e)}function Yy(t,e){return !t||t.type!=="ObjectTypeSpreadProperty"?!1:e==null||(0, m.default)(t,e)}function Xy(t,e){return !t||t.type!=="OpaqueType"?!1:e==null||(0, m.default)(t,e)}function Jy(t,e){return !t||t.type!=="QualifiedTypeIdentifier"?!1:e==null||(0, m.default)(t,e)}function $y(t,e){return !t||t.type!=="StringLiteralTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Wy(t,e){return !t||t.type!=="StringTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function zy(t,e){return !t||t.type!=="SymbolTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Hy(t,e){return !t||t.type!=="ThisTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Gy(t,e){return !t||t.type!=="TupleTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Qy(t,e){return !t||t.type!=="TypeofTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function Zy(t,e){return !t||t.type!=="TypeAlias"?!1:e==null||(0, m.default)(t,e)}function em(t,e){return !t||t.type!=="TypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function tm(t,e){return !t||t.type!=="TypeCastExpression"?!1:e==null||(0, m.default)(t,e)}function rm(t,e){return !t||t.type!=="TypeParameter"?!1:e==null||(0, m.default)(t,e)}function im(t,e){return !t||t.type!=="TypeParameterDeclaration"?!1:e==null||(0, m.default)(t,e)}function sm(t,e){return !t||t.type!=="TypeParameterInstantiation"?!1:e==null||(0, m.default)(t,e)}function am(t,e){return !t||t.type!=="UnionTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function nm(t,e){return !t||t.type!=="Variance"?!1:e==null||(0, m.default)(t,e)}function om(t,e){return !t||t.type!=="VoidTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function lm(t,e){return !t||t.type!=="EnumDeclaration"?!1:e==null||(0, m.default)(t,e)}function um(t,e){return !t||t.type!=="EnumBooleanBody"?!1:e==null||(0, m.default)(t,e)}function cm(t,e){return !t||t.type!=="EnumNumberBody"?!1:e==null||(0, m.default)(t,e)}function pm(t,e){return !t||t.type!=="EnumStringBody"?!1:e==null||(0, m.default)(t,e)}function fm(t,e){return !t||t.type!=="EnumSymbolBody"?!1:e==null||(0, m.default)(t,e)}function dm(t,e){return !t||t.type!=="EnumBooleanMember"?!1:e==null||(0, m.default)(t,e)}function hm(t,e){return !t||t.type!=="EnumNumberMember"?!1:e==null||(0, m.default)(t,e)}function ym(t,e){return !t||t.type!=="EnumStringMember"?!1:e==null||(0, m.default)(t,e)}function mm(t,e){return !t||t.type!=="EnumDefaultedMember"?!1:e==null||(0, m.default)(t,e)}function Tm(t,e){return !t||t.type!=="IndexedAccessType"?!1:e==null||(0, m.default)(t,e)}function bm(t,e){return !t||t.type!=="OptionalIndexedAccessType"?!1:e==null||(0, m.default)(t,e)}function Sm(t,e){return !t||t.type!=="JSXAttribute"?!1:e==null||(0, m.default)(t,e)}function xm(t,e){return !t||t.type!=="JSXClosingElement"?!1:e==null||(0, m.default)(t,e)}function Pm(t,e){return !t||t.type!=="JSXElement"?!1:e==null||(0, m.default)(t,e)}function Em(t,e){return !t||t.type!=="JSXEmptyExpression"?!1:e==null||(0, m.default)(t,e)}function gm(t,e){return !t||t.type!=="JSXExpressionContainer"?!1:e==null||(0, m.default)(t,e)}function Am(t,e){return !t||t.type!=="JSXSpreadChild"?!1:e==null||(0, m.default)(t,e)}function vm(t,e){return !t||t.type!=="JSXIdentifier"?!1:e==null||(0, m.default)(t,e)}function Im(t,e){return !t||t.type!=="JSXMemberExpression"?!1:e==null||(0, m.default)(t,e)}function wm(t,e){return !t||t.type!=="JSXNamespacedName"?!1:e==null||(0, m.default)(t,e)}function Om(t,e){return !t||t.type!=="JSXOpeningElement"?!1:e==null||(0, m.default)(t,e)}function Nm(t,e){return !t||t.type!=="JSXSpreadAttribute"?!1:e==null||(0, m.default)(t,e)}function Cm(t,e){return !t||t.type!=="JSXText"?!1:e==null||(0, m.default)(t,e)}function Dm(t,e){return !t||t.type!=="JSXFragment"?!1:e==null||(0, m.default)(t,e)}function Lm(t,e){return !t||t.type!=="JSXOpeningFragment"?!1:e==null||(0, m.default)(t,e)}function km(t,e){return !t||t.type!=="JSXClosingFragment"?!1:e==null||(0, m.default)(t,e)}function _m(t,e){return !t||t.type!=="Noop"?!1:e==null||(0, m.default)(t,e)}function Mm(t,e){return !t||t.type!=="Placeholder"?!1:e==null||(0, m.default)(t,e)}function jm(t,e){return !t||t.type!=="V8IntrinsicIdentifier"?!1:e==null||(0, m.default)(t,e)}function Bm(t,e){return !t||t.type!=="ArgumentPlaceholder"?!1:e==null||(0, m.default)(t,e)}function Fm(t,e){return !t||t.type!=="BindExpression"?!1:e==null||(0, m.default)(t,e)}function Rm(t,e){return !t||t.type!=="ImportAttribute"?!1:e==null||(0, m.default)(t,e)}function Um(t,e){return !t||t.type!=="Decorator"?!1:e==null||(0, m.default)(t,e)}function qm(t,e){return !t||t.type!=="DoExpression"?!1:e==null||(0, m.default)(t,e)}function Km(t,e){return !t||t.type!=="ExportDefaultSpecifier"?!1:e==null||(0, m.default)(t,e)}function Vm(t,e){return !t||t.type!=="RecordExpression"?!1:e==null||(0, m.default)(t,e)}function Ym(t,e){return !t||t.type!=="TupleExpression"?!1:e==null||(0, m.default)(t,e)}function Xm(t,e){return !t||t.type!=="DecimalLiteral"?!1:e==null||(0, m.default)(t,e)}function Jm(t,e){return !t||t.type!=="ModuleExpression"?!1:e==null||(0, m.default)(t,e)}function $m(t,e){return !t||t.type!=="TopicReference"?!1:e==null||(0, m.default)(t,e)}function Wm(t,e){return !t||t.type!=="PipelineTopicExpression"?!1:e==null||(0, m.default)(t,e)}function zm(t,e){return !t||t.type!=="PipelineBareFunction"?!1:e==null||(0, m.default)(t,e)}function Hm(t,e){return !t||t.type!=="PipelinePrimaryTopicReference"?!1:e==null||(0, m.default)(t,e)}function Gm(t,e){return !t||t.type!=="TSParameterProperty"?!1:e==null||(0, m.default)(t,e)}function Qm(t,e){return !t||t.type!=="TSDeclareFunction"?!1:e==null||(0, m.default)(t,e)}function Zm(t,e){return !t||t.type!=="TSDeclareMethod"?!1:e==null||(0, m.default)(t,e)}function e0(t,e){return !t||t.type!=="TSQualifiedName"?!1:e==null||(0, m.default)(t,e)}function t0(t,e){return !t||t.type!=="TSCallSignatureDeclaration"?!1:e==null||(0, m.default)(t,e)}function r0(t,e){return !t||t.type!=="TSConstructSignatureDeclaration"?!1:e==null||(0, m.default)(t,e)}function i0(t,e){return !t||t.type!=="TSPropertySignature"?!1:e==null||(0, m.default)(t,e)}function s0(t,e){return !t||t.type!=="TSMethodSignature"?!1:e==null||(0, m.default)(t,e)}function a0(t,e){return !t||t.type!=="TSIndexSignature"?!1:e==null||(0, m.default)(t,e)}function n0(t,e){return !t||t.type!=="TSAnyKeyword"?!1:e==null||(0, m.default)(t,e)}function o0(t,e){return !t||t.type!=="TSBooleanKeyword"?!1:e==null||(0, m.default)(t,e)}function l0(t,e){return !t||t.type!=="TSBigIntKeyword"?!1:e==null||(0, m.default)(t,e)}function u0(t,e){return !t||t.type!=="TSIntrinsicKeyword"?!1:e==null||(0, m.default)(t,e)}function c0(t,e){return !t||t.type!=="TSNeverKeyword"?!1:e==null||(0, m.default)(t,e)}function p0(t,e){return !t||t.type!=="TSNullKeyword"?!1:e==null||(0, m.default)(t,e)}function f0(t,e){return !t||t.type!=="TSNumberKeyword"?!1:e==null||(0, m.default)(t,e)}function d0(t,e){return !t||t.type!=="TSObjectKeyword"?!1:e==null||(0, m.default)(t,e)}function h0(t,e){return !t||t.type!=="TSStringKeyword"?!1:e==null||(0, m.default)(t,e)}function y0(t,e){return !t||t.type!=="TSSymbolKeyword"?!1:e==null||(0, m.default)(t,e)}function m0(t,e){return !t||t.type!=="TSUndefinedKeyword"?!1:e==null||(0, m.default)(t,e)}function T0(t,e){return !t||t.type!=="TSUnknownKeyword"?!1:e==null||(0, m.default)(t,e)}function b0(t,e){return !t||t.type!=="TSVoidKeyword"?!1:e==null||(0, m.default)(t,e)}function S0(t,e){return !t||t.type!=="TSThisType"?!1:e==null||(0, m.default)(t,e)}function x0(t,e){return !t||t.type!=="TSFunctionType"?!1:e==null||(0, m.default)(t,e)}function P0(t,e){return !t||t.type!=="TSConstructorType"?!1:e==null||(0, m.default)(t,e)}function E0(t,e){return !t||t.type!=="TSTypeReference"?!1:e==null||(0, m.default)(t,e)}function g0(t,e){return !t||t.type!=="TSTypePredicate"?!1:e==null||(0, m.default)(t,e)}function A0(t,e){return !t||t.type!=="TSTypeQuery"?!1:e==null||(0, m.default)(t,e)}function v0(t,e){return !t||t.type!=="TSTypeLiteral"?!1:e==null||(0, m.default)(t,e)}function I0(t,e){return !t||t.type!=="TSArrayType"?!1:e==null||(0, m.default)(t,e)}function w0(t,e){return !t||t.type!=="TSTupleType"?!1:e==null||(0, m.default)(t,e)}function O0(t,e){return !t||t.type!=="TSOptionalType"?!1:e==null||(0, m.default)(t,e)}function N0(t,e){return !t||t.type!=="TSRestType"?!1:e==null||(0, m.default)(t,e)}function C0(t,e){return !t||t.type!=="TSNamedTupleMember"?!1:e==null||(0, m.default)(t,e)}function D0(t,e){return !t||t.type!=="TSUnionType"?!1:e==null||(0, m.default)(t,e)}function L0(t,e){return !t||t.type!=="TSIntersectionType"?!1:e==null||(0, m.default)(t,e)}function k0(t,e){return !t||t.type!=="TSConditionalType"?!1:e==null||(0, m.default)(t,e)}function _0(t,e){return !t||t.type!=="TSInferType"?!1:e==null||(0, m.default)(t,e)}function M0(t,e){return !t||t.type!=="TSParenthesizedType"?!1:e==null||(0, m.default)(t,e)}function j0(t,e){return !t||t.type!=="TSTypeOperator"?!1:e==null||(0, m.default)(t,e)}function B0(t,e){return !t||t.type!=="TSIndexedAccessType"?!1:e==null||(0, m.default)(t,e)}function F0(t,e){return !t||t.type!=="TSMappedType"?!1:e==null||(0, m.default)(t,e)}function R0(t,e){return !t||t.type!=="TSLiteralType"?!1:e==null||(0, m.default)(t,e)}function U0(t,e){return !t||t.type!=="TSExpressionWithTypeArguments"?!1:e==null||(0, m.default)(t,e)}function q0(t,e){return !t||t.type!=="TSInterfaceDeclaration"?!1:e==null||(0, m.default)(t,e)}function K0(t,e){return !t||t.type!=="TSInterfaceBody"?!1:e==null||(0, m.default)(t,e)}function V0(t,e){return !t||t.type!=="TSTypeAliasDeclaration"?!1:e==null||(0, m.default)(t,e)}function Y0(t,e){return !t||t.type!=="TSInstantiationExpression"?!1:e==null||(0, m.default)(t,e)}function X0(t,e){return !t||t.type!=="TSAsExpression"?!1:e==null||(0, m.default)(t,e)}function J0(t,e){return !t||t.type!=="TSSatisfiesExpression"?!1:e==null||(0, m.default)(t,e)}function $0(t,e){return !t||t.type!=="TSTypeAssertion"?!1:e==null||(0, m.default)(t,e)}function W0(t,e){return !t||t.type!=="TSEnumDeclaration"?!1:e==null||(0, m.default)(t,e)}function z0(t,e){return !t||t.type!=="TSEnumMember"?!1:e==null||(0, m.default)(t,e)}function H0(t,e){return !t||t.type!=="TSModuleDeclaration"?!1:e==null||(0, m.default)(t,e)}function G0(t,e){return !t||t.type!=="TSModuleBlock"?!1:e==null||(0, m.default)(t,e)}function Q0(t,e){return !t||t.type!=="TSImportType"?!1:e==null||(0, m.default)(t,e)}function Z0(t,e){return !t||t.type!=="TSImportEqualsDeclaration"?!1:e==null||(0, m.default)(t,e)}function eT(t,e){return !t||t.type!=="TSExternalModuleReference"?!1:e==null||(0, m.default)(t,e)}function tT(t,e){return !t||t.type!=="TSNonNullExpression"?!1:e==null||(0, m.default)(t,e)}function rT(t,e){return !t||t.type!=="TSExportAssignment"?!1:e==null||(0, m.default)(t,e)}function iT(t,e){return !t||t.type!=="TSNamespaceExportDeclaration"?!1:e==null||(0, m.default)(t,e)}function sT(t,e){return !t||t.type!=="TSTypeAnnotation"?!1:e==null||(0, m.default)(t,e)}function aT(t,e){return !t||t.type!=="TSTypeParameterInstantiation"?!1:e==null||(0, m.default)(t,e)}function nT(t,e){return !t||t.type!=="TSTypeParameterDeclaration"?!1:e==null||(0, m.default)(t,e)}function oT(t,e){return !t||t.type!=="TSTypeParameter"?!1:e==null||(0, m.default)(t,e)}function lT(t,e){if(!t)return !1;switch(t.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"InterpreterDirective":case"Directive":case"DirectiveLiteral":case"BlockStatement":case"BreakStatement":case"CallExpression":case"CatchClause":case"ConditionalExpression":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"File":case"ForInStatement":case"ForStatement":case"FunctionDeclaration":case"FunctionExpression":case"Identifier":case"IfStatement":case"LabeledStatement":case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"RegExpLiteral":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"Program":case"ObjectExpression":case"ObjectMethod":case"ObjectProperty":case"RestElement":case"ReturnStatement":case"SequenceExpression":case"ParenthesizedExpression":case"SwitchCase":case"SwitchStatement":case"ThisExpression":case"ThrowStatement":case"TryStatement":case"UnaryExpression":case"UpdateExpression":case"VariableDeclaration":case"VariableDeclarator":case"WhileStatement":case"WithStatement":case"AssignmentPattern":case"ArrayPattern":case"ArrowFunctionExpression":case"ClassBody":case"ClassExpression":case"ClassDeclaration":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportSpecifier":case"ForOfStatement":case"ImportDeclaration":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":case"ImportExpression":case"MetaProperty":case"ClassMethod":case"ObjectPattern":case"SpreadElement":case"Super":case"TaggedTemplateExpression":case"TemplateElement":case"TemplateLiteral":case"YieldExpression":case"AwaitExpression":case"Import":case"BigIntLiteral":case"ExportNamespaceSpecifier":case"OptionalMemberExpression":case"OptionalCallExpression":case"ClassProperty":case"ClassAccessorProperty":case"ClassPrivateProperty":case"ClassPrivateMethod":case"PrivateName":case"StaticBlock":break;case"Placeholder":switch(t.expectedNode){case"Identifier":case"StringLiteral":case"BlockStatement":case"ClassBody":break;default:return !1}break;default:return !1}return e==null||(0, m.default)(t,e)}function uT(t,e){if(!t)return !1;switch(t.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"RegExpLiteral":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ParenthesizedExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":case"ArrowFunctionExpression":case"ClassExpression":case"ImportExpression":case"MetaProperty":case"Super":case"TaggedTemplateExpression":case"TemplateLiteral":case"YieldExpression":case"AwaitExpression":case"Import":case"BigIntLiteral":case"OptionalMemberExpression":case"OptionalCallExpression":case"TypeCastExpression":case"JSXElement":case"JSXFragment":case"BindExpression":case"DoExpression":case"RecordExpression":case"TupleExpression":case"DecimalLiteral":case"ModuleExpression":case"TopicReference":case"PipelineTopicExpression":case"PipelineBareFunction":case"PipelinePrimaryTopicReference":case"TSInstantiationExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":break;case"Placeholder":switch(t.expectedNode){case"Expression":case"Identifier":case"StringLiteral":break;default:return !1}break;default:return !1}return e==null||(0, m.default)(t,e)}function cT(t,e){if(!t)return !1;switch(t.type){case"BinaryExpression":case"LogicalExpression":break;default:return !1}return e==null||(0, m.default)(t,e)}function pT(t,e){if(!t)return !1;switch(t.type){case"BlockStatement":case"CatchClause":case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"FunctionDeclaration":case"FunctionExpression":case"Program":case"ObjectMethod":case"SwitchStatement":case"WhileStatement":case"ArrowFunctionExpression":case"ClassExpression":case"ClassDeclaration":case"ForOfStatement":case"ClassMethod":case"ClassPrivateMethod":case"StaticBlock":case"TSModuleBlock":break;case"Placeholder":if(t.expectedNode==="BlockStatement")break;default:return !1}return e==null||(0, m.default)(t,e)}function fT(t,e){if(!t)return !1;switch(t.type){case"BlockStatement":case"CatchClause":case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"FunctionDeclaration":case"FunctionExpression":case"Program":case"ObjectMethod":case"SwitchStatement":case"WhileStatement":case"ArrowFunctionExpression":case"ForOfStatement":case"ClassMethod":case"ClassPrivateMethod":case"StaticBlock":case"TSModuleBlock":break;case"Placeholder":if(t.expectedNode==="BlockStatement")break;default:return !1}return e==null||(0, m.default)(t,e)}function dT(t,e){if(!t)return !1;switch(t.type){case"BlockStatement":case"Program":case"TSModuleBlock":break;case"Placeholder":if(t.expectedNode==="BlockStatement")break;default:return !1}return e==null||(0, m.default)(t,e)}function hT(t,e){if(!t)return !1;switch(t.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"FunctionDeclaration":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":case"ClassDeclaration":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ForOfStatement":case"ImportDeclaration":case"DeclareClass":case"DeclareFunction":case"DeclareInterface":case"DeclareModule":case"DeclareModuleExports":case"DeclareTypeAlias":case"DeclareOpaqueType":case"DeclareVariable":case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":case"InterfaceDeclaration":case"OpaqueType":case"TypeAlias":case"EnumDeclaration":case"TSDeclareFunction":case"TSInterfaceDeclaration":case"TSTypeAliasDeclaration":case"TSEnumDeclaration":case"TSModuleDeclaration":case"TSImportEqualsDeclaration":case"TSExportAssignment":case"TSNamespaceExportDeclaration":break;case"Placeholder":switch(t.expectedNode){case"Statement":case"Declaration":case"BlockStatement":break;default:return !1}break;default:return !1}return e==null||(0, m.default)(t,e)}function yT(t,e){if(!t)return !1;switch(t.type){case"BreakStatement":case"ContinueStatement":case"ReturnStatement":case"ThrowStatement":case"YieldExpression":case"AwaitExpression":break;default:return !1}return e==null||(0, m.default)(t,e)}function mT(t,e){if(!t)return !1;switch(t.type){case"BreakStatement":case"ContinueStatement":case"ReturnStatement":case"ThrowStatement":break;default:return !1}return e==null||(0, m.default)(t,e)}function TT(t,e){if(!t)return !1;switch(t.type){case"ConditionalExpression":case"IfStatement":break;default:return !1}return e==null||(0, m.default)(t,e)}function bT(t,e){if(!t)return !1;switch(t.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":case"ForOfStatement":break;default:return !1}return e==null||(0, m.default)(t,e)}function ST(t,e){if(!t)return !1;switch(t.type){case"DoWhileStatement":case"WhileStatement":break;default:return !1}return e==null||(0, m.default)(t,e)}function xT(t,e){if(!t)return !1;switch(t.type){case"ExpressionStatement":case"ParenthesizedExpression":case"TypeCastExpression":break;default:return !1}return e==null||(0, m.default)(t,e)}function PT(t,e){if(!t)return !1;switch(t.type){case"ForInStatement":case"ForStatement":case"ForOfStatement":break;default:return !1}return e==null||(0, m.default)(t,e)}function ET(t,e){if(!t)return !1;switch(t.type){case"ForInStatement":case"ForOfStatement":break;default:return !1}return e==null||(0, m.default)(t,e)}function gT(t,e){if(!t)return !1;switch(t.type){case"FunctionDeclaration":case"FunctionExpression":case"ObjectMethod":case"ArrowFunctionExpression":case"ClassMethod":case"ClassPrivateMethod":break;default:return !1}return e==null||(0, m.default)(t,e)}function AT(t,e){if(!t)return !1;switch(t.type){case"FunctionDeclaration":case"FunctionExpression":case"ObjectMethod":case"ArrowFunctionExpression":case"ClassMethod":case"ClassPrivateMethod":case"StaticBlock":case"TSModuleBlock":break;default:return !1}return e==null||(0, m.default)(t,e)}function vT(t,e){if(!t)return !1;switch(t.type){case"FunctionDeclaration":case"FunctionExpression":case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"RegExpLiteral":case"ArrowFunctionExpression":case"BigIntLiteral":case"DecimalLiteral":break;case"Placeholder":if(t.expectedNode==="StringLiteral")break;default:return !1}return e==null||(0, m.default)(t,e)}function IT(t,e){if(!t)return !1;switch(t.type){case"FunctionDeclaration":case"VariableDeclaration":case"ClassDeclaration":case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ImportDeclaration":case"DeclareClass":case"DeclareFunction":case"DeclareInterface":case"DeclareModule":case"DeclareModuleExports":case"DeclareTypeAlias":case"DeclareOpaqueType":case"DeclareVariable":case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":case"InterfaceDeclaration":case"OpaqueType":case"TypeAlias":case"EnumDeclaration":case"TSDeclareFunction":case"TSInterfaceDeclaration":case"TSTypeAliasDeclaration":case"TSEnumDeclaration":case"TSModuleDeclaration":break;case"Placeholder":if(t.expectedNode==="Declaration")break;default:return !1}return e==null||(0, m.default)(t,e)}function wT(t,e){if(!t)return !1;switch(t.type){case"Identifier":case"RestElement":case"AssignmentPattern":case"ArrayPattern":case"ObjectPattern":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":break;case"Placeholder":switch(t.expectedNode){case"Pattern":case"Identifier":break;default:return !1}break;default:return !1}return e==null||(0, m.default)(t,e)}function OT(t,e){if(!t)return !1;switch(t.type){case"Identifier":case"MemberExpression":case"RestElement":case"AssignmentPattern":case"ArrayPattern":case"ObjectPattern":case"TSParameterProperty":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":break;case"Placeholder":switch(t.expectedNode){case"Pattern":case"Identifier":break;default:return !1}break;default:return !1}return e==null||(0, m.default)(t,e)}function NT(t,e){if(!t)return !1;switch(t.type){case"Identifier":case"TSQualifiedName":break;case"Placeholder":if(t.expectedNode==="Identifier")break;default:return !1}return e==null||(0, m.default)(t,e)}function CT(t,e){if(!t)return !1;switch(t.type){case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"RegExpLiteral":case"TemplateLiteral":case"BigIntLiteral":case"DecimalLiteral":break;case"Placeholder":if(t.expectedNode==="StringLiteral")break;default:return !1}return e==null||(0, m.default)(t,e)}function DT(t,e){if(!t)return !1;switch(t.type){case"StringLiteral":case"NumericLiteral":case"NullLiteral":case"BooleanLiteral":case"BigIntLiteral":case"JSXAttribute":case"JSXClosingElement":case"JSXElement":case"JSXExpressionContainer":case"JSXSpreadChild":case"JSXOpeningElement":case"JSXText":case"JSXFragment":case"JSXOpeningFragment":case"JSXClosingFragment":case"DecimalLiteral":break;case"Placeholder":if(t.expectedNode==="StringLiteral")break;default:return !1}return e==null||(0, m.default)(t,e)}function LT(t,e){if(!t)return !1;switch(t.type){case"ObjectMethod":case"ObjectProperty":case"ObjectTypeInternalSlot":case"ObjectTypeCallProperty":case"ObjectTypeIndexer":case"ObjectTypeProperty":case"ObjectTypeSpreadProperty":break;default:return !1}return e==null||(0, m.default)(t,e)}function kT(t,e){if(!t)return !1;switch(t.type){case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":break;default:return !1}return e==null||(0, m.default)(t,e)}function _T(t,e){if(!t)return !1;switch(t.type){case"ObjectMethod":case"ObjectProperty":break;default:return !1}return e==null||(0, m.default)(t,e)}function MT(t,e){if(!t)return !1;switch(t.type){case"ObjectProperty":case"ClassProperty":case"ClassAccessorProperty":case"ClassPrivateProperty":break;default:return !1}return e==null||(0, m.default)(t,e)}function jT(t,e){if(!t)return !1;switch(t.type){case"UnaryExpression":case"SpreadElement":break;default:return !1}return e==null||(0, m.default)(t,e)}function BT(t,e){if(!t)return !1;switch(t.type){case"AssignmentPattern":case"ArrayPattern":case"ObjectPattern":break;case"Placeholder":if(t.expectedNode==="Pattern")break;default:return !1}return e==null||(0, m.default)(t,e)}function FT(t,e){if(!t)return !1;switch(t.type){case"ClassExpression":case"ClassDeclaration":break;default:return !1}return e==null||(0, m.default)(t,e)}function Mo(t,e){if(!t)return !1;switch(t.type){case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ImportDeclaration":break;default:return !1}return e==null||(0, m.default)(t,e)}function RT(t,e){if(!t)return !1;switch(t.type){case"ExportAllDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":break;default:return !1}return e==null||(0, m.default)(t,e)}function UT(t,e){if(!t)return !1;switch(t.type){case"ExportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":break;default:return !1}return e==null||(0, m.default)(t,e)}function qT(t,e){if(!t)return !1;switch(t.type){case"ClassAccessorProperty":break;default:return !1}return e==null||(0, m.default)(t,e)}function KT(t,e){if(!t)return !1;switch(t.type){case"ClassPrivateProperty":case"ClassPrivateMethod":case"PrivateName":break;default:return !1}return e==null||(0, m.default)(t,e)}function VT(t,e){if(!t)return !1;switch(t.type){case"AnyTypeAnnotation":case"ArrayTypeAnnotation":case"BooleanTypeAnnotation":case"BooleanLiteralTypeAnnotation":case"NullLiteralTypeAnnotation":case"ClassImplements":case"DeclareClass":case"DeclareFunction":case"DeclareInterface":case"DeclareModule":case"DeclareModuleExports":case"DeclareTypeAlias":case"DeclareOpaqueType":case"DeclareVariable":case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":case"DeclaredPredicate":case"ExistsTypeAnnotation":case"FunctionTypeAnnotation":case"FunctionTypeParam":case"GenericTypeAnnotation":case"InferredPredicate":case"InterfaceExtends":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":case"IntersectionTypeAnnotation":case"MixedTypeAnnotation":case"EmptyTypeAnnotation":case"NullableTypeAnnotation":case"NumberLiteralTypeAnnotation":case"NumberTypeAnnotation":case"ObjectTypeAnnotation":case"ObjectTypeInternalSlot":case"ObjectTypeCallProperty":case"ObjectTypeIndexer":case"ObjectTypeProperty":case"ObjectTypeSpreadProperty":case"OpaqueType":case"QualifiedTypeIdentifier":case"StringLiteralTypeAnnotation":case"StringTypeAnnotation":case"SymbolTypeAnnotation":case"ThisTypeAnnotation":case"TupleTypeAnnotation":case"TypeofTypeAnnotation":case"TypeAlias":case"TypeAnnotation":case"TypeCastExpression":case"TypeParameter":case"TypeParameterDeclaration":case"TypeParameterInstantiation":case"UnionTypeAnnotation":case"Variance":case"VoidTypeAnnotation":case"EnumDeclaration":case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":case"EnumDefaultedMember":case"IndexedAccessType":case"OptionalIndexedAccessType":break;default:return !1}return e==null||(0, m.default)(t,e)}function YT(t,e){if(!t)return !1;switch(t.type){case"AnyTypeAnnotation":case"ArrayTypeAnnotation":case"BooleanTypeAnnotation":case"BooleanLiteralTypeAnnotation":case"NullLiteralTypeAnnotation":case"ExistsTypeAnnotation":case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"InterfaceTypeAnnotation":case"IntersectionTypeAnnotation":case"MixedTypeAnnotation":case"EmptyTypeAnnotation":case"NullableTypeAnnotation":case"NumberLiteralTypeAnnotation":case"NumberTypeAnnotation":case"ObjectTypeAnnotation":case"StringLiteralTypeAnnotation":case"StringTypeAnnotation":case"SymbolTypeAnnotation":case"ThisTypeAnnotation":case"TupleTypeAnnotation":case"TypeofTypeAnnotation":case"UnionTypeAnnotation":case"VoidTypeAnnotation":case"IndexedAccessType":case"OptionalIndexedAccessType":break;default:return !1}return e==null||(0, m.default)(t,e)}function XT(t,e){if(!t)return !1;switch(t.type){case"AnyTypeAnnotation":case"BooleanTypeAnnotation":case"NullLiteralTypeAnnotation":case"MixedTypeAnnotation":case"EmptyTypeAnnotation":case"NumberTypeAnnotation":case"StringTypeAnnotation":case"SymbolTypeAnnotation":case"ThisTypeAnnotation":case"VoidTypeAnnotation":break;default:return !1}return e==null||(0, m.default)(t,e)}function JT(t,e){if(!t)return !1;switch(t.type){case"DeclareClass":case"DeclareFunction":case"DeclareInterface":case"DeclareModule":case"DeclareModuleExports":case"DeclareTypeAlias":case"DeclareOpaqueType":case"DeclareVariable":case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":case"InterfaceDeclaration":case"OpaqueType":case"TypeAlias":break;default:return !1}return e==null||(0, m.default)(t,e)}function $T(t,e){if(!t)return !1;switch(t.type){case"DeclaredPredicate":case"InferredPredicate":break;default:return !1}return e==null||(0, m.default)(t,e)}function WT(t,e){if(!t)return !1;switch(t.type){case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":break;default:return !1}return e==null||(0, m.default)(t,e)}function zT(t,e){if(!t)return !1;switch(t.type){case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":case"EnumDefaultedMember":break;default:return !1}return e==null||(0, m.default)(t,e)}function HT(t,e){if(!t)return !1;switch(t.type){case"JSXAttribute":case"JSXClosingElement":case"JSXElement":case"JSXEmptyExpression":case"JSXExpressionContainer":case"JSXSpreadChild":case"JSXIdentifier":case"JSXMemberExpression":case"JSXNamespacedName":case"JSXOpeningElement":case"JSXSpreadAttribute":case"JSXText":case"JSXFragment":case"JSXOpeningFragment":case"JSXClosingFragment":break;default:return !1}return e==null||(0, m.default)(t,e)}function GT(t,e){if(!t)return !1;switch(t.type){case"Noop":case"Placeholder":case"V8IntrinsicIdentifier":break;default:return !1}return e==null||(0, m.default)(t,e)}function QT(t,e){if(!t)return !1;switch(t.type){case"TSParameterProperty":case"TSDeclareFunction":case"TSDeclareMethod":case"TSQualifiedName":case"TSCallSignatureDeclaration":case"TSConstructSignatureDeclaration":case"TSPropertySignature":case"TSMethodSignature":case"TSIndexSignature":case"TSAnyKeyword":case"TSBooleanKeyword":case"TSBigIntKeyword":case"TSIntrinsicKeyword":case"TSNeverKeyword":case"TSNullKeyword":case"TSNumberKeyword":case"TSObjectKeyword":case"TSStringKeyword":case"TSSymbolKeyword":case"TSUndefinedKeyword":case"TSUnknownKeyword":case"TSVoidKeyword":case"TSThisType":case"TSFunctionType":case"TSConstructorType":case"TSTypeReference":case"TSTypePredicate":case"TSTypeQuery":case"TSTypeLiteral":case"TSArrayType":case"TSTupleType":case"TSOptionalType":case"TSRestType":case"TSNamedTupleMember":case"TSUnionType":case"TSIntersectionType":case"TSConditionalType":case"TSInferType":case"TSParenthesizedType":case"TSTypeOperator":case"TSIndexedAccessType":case"TSMappedType":case"TSLiteralType":case"TSExpressionWithTypeArguments":case"TSInterfaceDeclaration":case"TSInterfaceBody":case"TSTypeAliasDeclaration":case"TSInstantiationExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSEnumDeclaration":case"TSEnumMember":case"TSModuleDeclaration":case"TSModuleBlock":case"TSImportType":case"TSImportEqualsDeclaration":case"TSExternalModuleReference":case"TSNonNullExpression":case"TSExportAssignment":case"TSNamespaceExportDeclaration":case"TSTypeAnnotation":case"TSTypeParameterInstantiation":case"TSTypeParameterDeclaration":case"TSTypeParameter":break;default:return !1}return e==null||(0, m.default)(t,e)}function ZT(t,e){if(!t)return !1;switch(t.type){case"TSCallSignatureDeclaration":case"TSConstructSignatureDeclaration":case"TSPropertySignature":case"TSMethodSignature":case"TSIndexSignature":break;default:return !1}return e==null||(0, m.default)(t,e)}function eb(t,e){if(!t)return !1;switch(t.type){case"TSAnyKeyword":case"TSBooleanKeyword":case"TSBigIntKeyword":case"TSIntrinsicKeyword":case"TSNeverKeyword":case"TSNullKeyword":case"TSNumberKeyword":case"TSObjectKeyword":case"TSStringKeyword":case"TSSymbolKeyword":case"TSUndefinedKeyword":case"TSUnknownKeyword":case"TSVoidKeyword":case"TSThisType":case"TSFunctionType":case"TSConstructorType":case"TSTypeReference":case"TSTypePredicate":case"TSTypeQuery":case"TSTypeLiteral":case"TSArrayType":case"TSTupleType":case"TSOptionalType":case"TSRestType":case"TSUnionType":case"TSIntersectionType":case"TSConditionalType":case"TSInferType":case"TSParenthesizedType":case"TSTypeOperator":case"TSIndexedAccessType":case"TSMappedType":case"TSLiteralType":case"TSExpressionWithTypeArguments":case"TSImportType":break;default:return !1}return e==null||(0, m.default)(t,e)}function tb(t,e){if(!t)return !1;switch(t.type){case"TSAnyKeyword":case"TSBooleanKeyword":case"TSBigIntKeyword":case"TSIntrinsicKeyword":case"TSNeverKeyword":case"TSNullKeyword":case"TSNumberKeyword":case"TSObjectKeyword":case"TSStringKeyword":case"TSSymbolKeyword":case"TSUndefinedKeyword":case"TSUnknownKeyword":case"TSVoidKeyword":case"TSThisType":case"TSLiteralType":break;default:return !1}return e==null||(0, m.default)(t,e)}function rb(t,e){return (0, Yt.default)("isNumberLiteral","isNumericLiteral"),!t||t.type!=="NumberLiteral"?!1:e==null||(0, m.default)(t,e)}function ib(t,e){return (0, Yt.default)("isRegexLiteral","isRegExpLiteral"),!t||t.type!=="RegexLiteral"?!1:e==null||(0, m.default)(t,e)}function sb(t,e){return (0, Yt.default)("isRestProperty","isRestElement"),!t||t.type!=="RestProperty"?!1:e==null||(0, m.default)(t,e)}function ab(t,e){return (0, Yt.default)("isSpreadProperty","isSpreadElement"),!t||t.type!=="SpreadProperty"?!1:e==null||(0, m.default)(t,e)}function nb(t,e){return (0, Yt.default)("isModuleDeclaration","isImportOrExportDeclaration"),Mo(t,e)}});var Wi=A($i=>{Object.defineProperty($i,"__esModule",{value:!0});$i.default=ob;var Xt=le();function ob(t,e,r){if(!(0, Xt.isMemberExpression)(t))return !1;let i=Array.isArray(e)?e:e.split("."),s=[],a;for(a=t;(0, Xt.isMemberExpression)(a);a=a.object)s.push(a.property);if(s.push(a),s.lengthi.length)return !1;for(let n=0,o=s.length-1;n{Object.defineProperty(zi,"__esModule",{value:!0});zi.default=ub;var lb=Wi();function ub(t,e){let r=t.split(".");return i=>(0, lb.default)(i,r,e)}});var jo=A(Lr=>{Object.defineProperty(Lr,"__esModule",{value:!0});Lr.default=void 0;var cb=Hi(),pb=(0, cb.default)("React.Component");Lr.default=pb;});var Bo=A(Gi=>{Object.defineProperty(Gi,"__esModule",{value:!0});Gi.default=fb;function fb(t){return !!t&&/^[a-z]/.test(t)}});var Ro=A((F_,Fo)=>{var Jt=null;function $t(t){if(Jt!==null&&typeof Jt.property){let e=Jt;return Jt=$t.prototype=null,e}return Jt=$t.prototype=t??Object.create(null),new $t}$t();Fo.exports=function(e){return $t(e)};});var kr=A(Qi=>{Object.defineProperty(Qi,"__esModule",{value:!0});Qi.default=db;var Uo=De();function db(t,e){if(t===e)return !0;if(t==null||Uo.ALIAS_KEYS[e])return !1;let r=Uo.FLIPPED_ALIAS_KEYS[e];if(r){if(r[0]===t)return !0;for(let i of r)if(t===i)return !0}return !1}});var es=A(Zi=>{Object.defineProperty(Zi,"__esModule",{value:!0});Zi.default=yb;var hb=De();function yb(t,e){if(t===e)return !0;let r=hb.PLACEHOLDERS_ALIAS[t];if(r){for(let i of r)if(e===i)return !0}return !1}});var Et=A(ts=>{Object.defineProperty(ts,"__esModule",{value:!0});ts.default=xb;var mb=Dr(),Tb=kr(),bb=es(),Sb=De();function xb(t,e,r){return e?(0, Tb.default)(e.type,t)?typeof r>"u"?!0:(0, mb.default)(e,r):!r&&e.type==="Placeholder"&&t in Sb.FLIPPED_ALIAS_KEYS?(0, bb.default)(e.expectedNode,t):!1:!1}});var Xo=A(Wt=>{Object.defineProperty(Wt,"__esModule",{value:!0});Wt.isIdentifierChar=Yo;Wt.isIdentifierName=Ab;Wt.isIdentifierStart=Vo;var is="\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\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\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",qo="\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\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\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\uFF65",Pb=new RegExp("["+is+"]"),Eb=new RegExp("["+is+qo+"]");is=qo=null;var Ko=[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,16,621,2467,541,1507,4938,6,4191],gb=[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];function rs(t,e){let r=65536;for(let i=0,s=e.length;it)return !1;if(r+=e[i+1],r>=t)return !0}return !1}function Vo(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Pb.test(String.fromCharCode(t)):rs(t,Ko)}function Yo(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Eb.test(String.fromCharCode(t)):rs(t,Ko)||rs(t,gb)}function Ab(t){let e=!0;for(let r=0;r{Object.defineProperty(pt,"__esModule",{value:!0});pt.isKeyword=Nb;pt.isReservedWord=Jo;pt.isStrictBindOnlyReservedWord=Wo;pt.isStrictBindReservedWord=Ob;pt.isStrictReservedWord=$o;var ss={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"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},vb=new Set(ss.keyword),Ib=new Set(ss.strict),wb=new Set(ss.strictBind);function Jo(t,e){return e&&t==="await"||t==="enum"}function $o(t,e){return Jo(t,e)||Ib.has(t)}function Wo(t){return wb.has(t)}function Ob(t,e){return $o(t,e)||Wo(t)}function Nb(t){return vb.has(t)}});var Ht=A(Be=>{Object.defineProperty(Be,"__esModule",{value:!0});Object.defineProperty(Be,"isIdentifierChar",{enumerable:!0,get:function(){return as.isIdentifierChar}});Object.defineProperty(Be,"isIdentifierName",{enumerable:!0,get:function(){return as.isIdentifierName}});Object.defineProperty(Be,"isIdentifierStart",{enumerable:!0,get:function(){return as.isIdentifierStart}});Object.defineProperty(Be,"isKeyword",{enumerable:!0,get:function(){return zt.isKeyword}});Object.defineProperty(Be,"isReservedWord",{enumerable:!0,get:function(){return zt.isReservedWord}});Object.defineProperty(Be,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return zt.isStrictBindOnlyReservedWord}});Object.defineProperty(Be,"isStrictBindReservedWord",{enumerable:!0,get:function(){return zt.isStrictBindReservedWord}});Object.defineProperty(Be,"isStrictReservedWord",{enumerable:!0,get:function(){return zt.isStrictReservedWord}});var as=Xo(),zt=zo();});var gt=A(os=>{Object.defineProperty(os,"__esModule",{value:!0});os.default=Cb;var ns=Ht();function Cb(t,e=!0){return typeof t!="string"||e&&((0, ns.isKeyword)(t)||(0, ns.isStrictReservedWord)(t,!0))?!1:(0, ns.isIdentifierName)(t)}});var Zo=A(Gt=>{Object.defineProperty(Gt,"__esModule",{value:!0});Gt.readCodePoint=Qo;Gt.readInt=Go;Gt.readStringContents=Lb;var Db=function(e){return e>=48&&e<=57},Ho={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},_r={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function Lb(t,e,r,i,s,a){let n=r,o=i,l=s,u="",p=null,S=r,{length:E}=e;for(;;){if(r>=E){a.unterminated(n,o,l),u+=e.slice(S,r);break}let v=e.charCodeAt(r);if(kb(t,v,e,r)){u+=e.slice(S,r);break}if(v===92){u+=e.slice(S,r);let I=_b(e,r,i,s,t==="template",a);I.ch===null&&!p?p={pos:r,lineStart:i,curLine:s}:u+=I.ch,{pos:r,lineStart:i,curLine:s}=I,S=r;}else v===8232||v===8233?(++r,++s,i=r):v===10||v===13?t==="template"?(u+=e.slice(S,r)+`
+`,++r,v===13&&e.charCodeAt(r)===10&&++r,++s,S=i=r):a.unterminated(n,o,l):++r;}return {pos:r,str:u,firstInvalidLoc:p,lineStart:i,curLine:s,containsInvalid:!!p}}function kb(t,e,r,i){return t==="template"?e===96||e===36&&r.charCodeAt(i+1)===123:e===(t==="double"?34:39)}function _b(t,e,r,i,s,a){let n=!s;e++;let o=u=>({pos:e,ch:u,lineStart:r,curLine:i}),l=t.charCodeAt(e++);switch(l){case 110:return o(`
+`);case 114:return o("\r");case 120:{let u;return {code:u,pos:e}=ls(t,e,r,i,2,!1,n,a),o(u===null?null:String.fromCharCode(u))}case 117:{let u;return {code:u,pos:e}=Qo(t,e,r,i,n,a),o(u===null?null:String.fromCodePoint(u))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:t.charCodeAt(e)===10&&++e;case 10:r=e,++i;case 8232:case 8233:return o("");case 56:case 57:if(s)return o(null);a.strictNumericEscape(e-1,r,i);default:if(l>=48&&l<=55){let u=e-1,S=t.slice(u,e+2).match(/^[0-7]+/)[0],E=parseInt(S,8);E>255&&(S=S.slice(0,-1),E=parseInt(S,8)),e+=S.length-1;let v=t.charCodeAt(e);if(S!=="0"||v===56||v===57){if(s)return o(null);a.strictNumericEscape(u,r,i);}return o(String.fromCharCode(E))}return o(String.fromCharCode(l))}}function ls(t,e,r,i,s,a,n,o){let l=e,u;return {n:u,pos:e}=Go(t,e,r,i,16,s,a,!1,o,!n),u===null&&(n?o.invalidEscapeSequence(l,r,i):e=l-1),{code:u,pos:e}}function Go(t,e,r,i,s,a,n,o,l,u){let p=e,S=s===16?Ho.hex:Ho.decBinOct,E=s===16?_r.hex:s===10?_r.dec:s===8?_r.oct:_r.bin,v=!1,I=0;for(let N=0,M=a??1/0;N=97?R=j-97+10:j>=65?R=j-65+10:Db(j)?R=j-48:R=1/0,R>=s){if(R<=9&&u)return {n:null,pos:e};if(R<=9&&l.invalidDigit(e,r,i,s))R=0;else if(n)R=0,v=!0;else break}++e,I=I*s+R;}return e===p||a!=null&&e-p!==a||v?{n:null,pos:e}:{n:I,pos:e}}function Qo(t,e,r,i,s,a){let n=t.charCodeAt(e),o;if(n===123){if(++e,{code:o,pos:e}=ls(t,e,r,i,t.indexOf("}",e)-e,!0,s,a),++e,o!==null&&o>1114111)if(s)a.invalidCodePoint(e,r,i);else return {code:null,pos:e}}else ({code:o,pos:e}=ls(t,e,r,i,4,!1,s,a));return {code:o,pos:e}}});var Ge=A(J=>{Object.defineProperty(J,"__esModule",{value:!0});J.UPDATE_OPERATORS=J.UNARY_OPERATORS=J.STRING_UNARY_OPERATORS=J.STATEMENT_OR_BLOCK_KEYS=J.NUMBER_UNARY_OPERATORS=J.NUMBER_BINARY_OPERATORS=J.NOT_LOCAL_BINDING=J.LOGICAL_OPERATORS=J.INHERIT_KEYS=J.FOR_INIT_KEYS=J.FLATTENABLE_KEYS=J.EQUALITY_BINARY_OPERATORS=J.COMPARISON_BINARY_OPERATORS=J.COMMENT_KEYS=J.BOOLEAN_UNARY_OPERATORS=J.BOOLEAN_NUMBER_BINARY_OPERATORS=J.BOOLEAN_BINARY_OPERATORS=J.BLOCK_SCOPED_SYMBOL=J.BINARY_OPERATORS=J.ASSIGNMENT_OPERATORS=void 0;J.STATEMENT_OR_BLOCK_KEYS=["consequent","body","alternate"];J.FLATTENABLE_KEYS=["body","expressions"];J.FOR_INIT_KEYS=["left","init"];J.COMMENT_KEYS=["leadingComments","trailingComments","innerComments"];var Mb=J.LOGICAL_OPERATORS=["||","&&","??"];J.UPDATE_OPERATORS=["++","--"];var jb=J.BOOLEAN_NUMBER_BINARY_OPERATORS=[">","<",">=","<="],Bb=J.EQUALITY_BINARY_OPERATORS=["==","===","!=","!=="],Fb=J.COMPARISON_BINARY_OPERATORS=[...Bb,"in","instanceof"],Rb=J.BOOLEAN_BINARY_OPERATORS=[...Fb,...jb],el=J.NUMBER_BINARY_OPERATORS=["-","/","%","*","**","&","|",">>",">>>","<<","^"];J.BINARY_OPERATORS=["+",...el,...Rb,"|>"];J.ASSIGNMENT_OPERATORS=["=","+=",...el.map(t=>t+"="),...Mb.map(t=>t+"=")];var Ub=J.BOOLEAN_UNARY_OPERATORS=["delete","!"],qb=J.NUMBER_UNARY_OPERATORS=["+","-","~"],Kb=J.STRING_UNARY_OPERATORS=["typeof"];J.UNARY_OPERATORS=["void","throw",...Ub,...qb,...Kb];J.INHERIT_KEYS={optional:["typeAnnotation","typeParameters","returnType"],force:["start","loc","end"]};J.BLOCK_SCOPED_SYMBOL=Symbol.for("var used to be block scoped");J.NOT_LOCAL_BINDING=Symbol.for("should not be considered a local binding");});var qe=A(Q=>{Object.defineProperty(Q,"__esModule",{value:!0});Q.VISITOR_KEYS=Q.NODE_PARENT_VALIDATIONS=Q.NODE_FIELDS=Q.FLIPPED_ALIAS_KEYS=Q.DEPRECATED_KEYS=Q.BUILDER_KEYS=Q.ALIAS_KEYS=void 0;Q.arrayOf=rl;Q.arrayOfType=il;Q.assertEach=sl;Q.assertNodeOrValueType=eS;Q.assertNodeType=cs;Q.assertOneOf=Zb;Q.assertOptionalChainStart=rS;Q.assertShape=tS;Q.assertValueType=ds;Q.chain=al;Q.default=nl;Q.defineAliasedType=aS;Q.typeIs=Br;Q.validate=fs;Q.validateArrayOfType=Qb;Q.validateOptional=Hb;Q.validateOptionalType=Gb;Q.validateType=zb;var tl=Et(),jr=Fr(),Vb=Q.VISITOR_KEYS={},Yb=Q.ALIAS_KEYS={},us=Q.FLIPPED_ALIAS_KEYS={},Xb=Q.NODE_FIELDS={},Jb=Q.BUILDER_KEYS={},$b=Q.DEPRECATED_KEYS={},Wb=Q.NODE_PARENT_VALIDATIONS={};function Mr(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function fs(t){return {validate:t}}function Br(t){return typeof t=="string"?cs(t):cs(...t)}function zb(t){return fs(Br(t))}function Hb(t){return {validate:t,optional:!0}}function Gb(t){return {validate:Br(t),optional:!0}}function rl(t){return al(ds("array"),sl(t))}function il(t){return rl(Br(t))}function Qb(t){return fs(il(t))}function sl(t){function e(r,i,s){if(Array.isArray(s))for(let a=0;a=2&&"type"in t[0]&&t[0].type==="array"&&!("each"in t[1]))throw new Error('An assertValueType("array") validator can only be followed by an assertEach(...) validator.');return e}var iS=["aliases","builder","deprecatedAlias","fields","inherits","visitor","validate"],sS=["default","optional","deprecated","validate"],ps={};function aS(...t){return (e,r={})=>{let i=r.aliases;if(!i){var s;r.inherits&&(i=(s=ps[r.inherits].aliases)==null?void 0:s.slice()),(i)!=null||(i=[]),r.aliases=i;}let n=t.filter(o=>!i.includes(o));i.unshift(...n),nl(e,r);}}function nl(t,e={}){let r=e.inherits&&ps[e.inherits]||{},i=e.fields;if(!i&&(i={},r.fields)){let o=Object.getOwnPropertyNames(r.fields);for(let l of o){let u=r.fields[l],p=u.default;if(Array.isArray(p)?p.length>0:p&&typeof p=="object")throw new Error("field defaults can only be primitives or empty arrays currently");i[l]={default:Array.isArray(p)?[]:p,optional:u.optional,deprecated:u.deprecated,validate:u.validate};}}let s=e.visitor||r.visitor||[],a=e.aliases||r.aliases||[],n=e.builder||r.builder||e.visitor||[];for(let o of Object.keys(e))if(iS.indexOf(o)===-1)throw new Error(`Unknown type option "${o}" on ${t}`);e.deprecatedAlias&&($b[e.deprecatedAlias]=t);for(let o of s.concat(n))i[o]=i[o]||{};for(let o of Object.keys(i)){let l=i[o];l.default!==void 0&&n.indexOf(o)===-1&&(l.optional=!0),l.default===void 0?l.default=null:!l.validate&&l.default!=null&&(l.validate=ds(Mr(l.default)));for(let u of Object.keys(l))if(sS.indexOf(u)===-1)throw new Error(`Unknown field key "${u}" on ${t}.${o}`)}Vb[t]=e.visitor=s,Jb[t]=e.builder=n,Xb[t]=e.fields=i,Yb[t]=e.aliases=a,a.forEach(o=>{us[o]=us[o]||[],us[o].push(t);}),e.validate&&(Wb[t]=e.validate),ps[t]=e;}});var ys=A(ge=>{Object.defineProperty(ge,"__esModule",{value:!0});ge.patternLikeCommon=ge.functionTypeAnnotationCommon=ge.functionDeclarationCommon=ge.functionCommon=ge.classMethodOrPropertyCommon=ge.classMethodOrDeclareMethodCommon=void 0;var ye=Et(),nS=gt(),ol=Ht(),oS=Zo(),Qt=Ge(),c=qe(),D=(0, c.defineAliasedType)("Standardized");D("ArrayExpression",{fields:{elements:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeOrValueType)("null","Expression","SpreadElement"))),default:process.env.BABEL_TYPES_8_BREAKING?void 0:[]}},visitor:["elements"],aliases:["Expression"]});D("AssignmentExpression",{fields:{operator:{validate:function(){if(!process.env.BABEL_TYPES_8_BREAKING)return (0, c.assertValueType)("string");let t=(0, c.assertOneOf)(...Qt.ASSIGNMENT_OPERATORS),e=(0, c.assertOneOf)("=");return function(r,i,s){((0, ye.default)("Pattern",r.left)?e:t)(r,i,s);}}()},left:{validate:process.env.BABEL_TYPES_8_BREAKING?(0, c.assertNodeType)("Identifier","MemberExpression","OptionalMemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0, c.assertNodeType)("LVal","OptionalMemberExpression")},right:{validate:(0, c.assertNodeType)("Expression")}},builder:["operator","left","right"],visitor:["left","right"],aliases:["Expression"]});D("BinaryExpression",{builder:["operator","left","right"],fields:{operator:{validate:(0, c.assertOneOf)(...Qt.BINARY_OPERATORS)},left:{validate:function(){let t=(0, c.assertNodeType)("Expression"),e=(0, c.assertNodeType)("Expression","PrivateName");return Object.assign(function(i,s,a){(i.operator==="in"?e:t)(i,s,a);},{oneOfNodeTypes:["Expression","PrivateName"]})}()},right:{validate:(0, c.assertNodeType)("Expression")}},visitor:["left","right"],aliases:["Binary","Expression"]});D("InterpreterDirective",{builder:["value"],fields:{value:{validate:(0, c.assertValueType)("string")}}});D("Directive",{visitor:["value"],fields:{value:{validate:(0, c.assertNodeType)("DirectiveLiteral")}}});D("DirectiveLiteral",{builder:["value"],fields:{value:{validate:(0, c.assertValueType)("string")}}});D("BlockStatement",{builder:["body","directives"],visitor:["directives","body"],fields:{directives:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Directive"))),default:[]},body:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","Statement"]});D("BreakStatement",{visitor:["label"],fields:{label:{validate:(0, c.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]});D("CallExpression",{visitor:["callee","arguments","typeParameters","typeArguments"],builder:["callee","arguments"],aliases:["Expression"],fields:Object.assign({callee:{validate:(0, c.assertNodeType)("Expression","Super","V8IntrinsicIdentifier")},arguments:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Expression","SpreadElement","JSXNamespacedName","ArgumentPlaceholder")))}},process.env.BABEL_TYPES_8_BREAKING?{}:{optional:{validate:(0, c.assertOneOf)(!0,!1),optional:!0}},{typeArguments:{validate:(0, c.assertNodeType)("TypeParameterInstantiation"),optional:!0},typeParameters:{validate:(0, c.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}})});D("CatchClause",{visitor:["param","body"],fields:{param:{validate:(0, c.assertNodeType)("Identifier","ArrayPattern","ObjectPattern"),optional:!0},body:{validate:(0, c.assertNodeType)("BlockStatement")}},aliases:["Scopable","BlockParent"]});D("ConditionalExpression",{visitor:["test","consequent","alternate"],fields:{test:{validate:(0, c.assertNodeType)("Expression")},consequent:{validate:(0, c.assertNodeType)("Expression")},alternate:{validate:(0, c.assertNodeType)("Expression")}},aliases:["Expression","Conditional"]});D("ContinueStatement",{visitor:["label"],fields:{label:{validate:(0, c.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]});D("DebuggerStatement",{aliases:["Statement"]});D("DoWhileStatement",{visitor:["test","body"],fields:{test:{validate:(0, c.assertNodeType)("Expression")},body:{validate:(0, c.assertNodeType)("Statement")}},aliases:["Statement","BlockParent","Loop","While","Scopable"]});D("EmptyStatement",{aliases:["Statement"]});D("ExpressionStatement",{visitor:["expression"],fields:{expression:{validate:(0, c.assertNodeType)("Expression")}},aliases:["Statement","ExpressionWrapper"]});D("File",{builder:["program","comments","tokens"],visitor:["program"],fields:{program:{validate:(0, c.assertNodeType)("Program")},comments:{validate:process.env.BABEL_TYPES_8_BREAKING?(0, c.assertEach)((0, c.assertNodeType)("CommentBlock","CommentLine")):Object.assign(()=>{},{each:{oneOfNodeTypes:["CommentBlock","CommentLine"]}}),optional:!0},tokens:{validate:(0, c.assertEach)(Object.assign(()=>{},{type:"any"})),optional:!0}}});D("ForInStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:process.env.BABEL_TYPES_8_BREAKING?(0, c.assertNodeType)("VariableDeclaration","Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0, c.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0, c.assertNodeType)("Expression")},body:{validate:(0, c.assertNodeType)("Statement")}}});D("ForStatement",{visitor:["init","test","update","body"],aliases:["Scopable","Statement","For","BlockParent","Loop"],fields:{init:{validate:(0, c.assertNodeType)("VariableDeclaration","Expression"),optional:!0},test:{validate:(0, c.assertNodeType)("Expression"),optional:!0},update:{validate:(0, c.assertNodeType)("Expression"),optional:!0},body:{validate:(0, c.assertNodeType)("Statement")}}});var At=()=>({params:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Identifier","Pattern","RestElement")))},generator:{default:!1},async:{default:!1}});ge.functionCommon=At;var ft=()=>({returnType:{validate:(0, c.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},typeParameters:{validate:(0, c.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0}});ge.functionTypeAnnotationCommon=ft;var ll=()=>Object.assign({},At(),{declare:{validate:(0, c.assertValueType)("boolean"),optional:!0},id:{validate:(0, c.assertNodeType)("Identifier"),optional:!0}});ge.functionDeclarationCommon=ll;D("FunctionDeclaration",{builder:["id","params","body","generator","async"],visitor:["id","params","body","returnType","typeParameters"],fields:Object.assign({},ll(),ft(),{body:{validate:(0, c.assertNodeType)("BlockStatement")},predicate:{validate:(0, c.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}}),aliases:["Scopable","Function","BlockParent","FunctionParent","Statement","Pureish","Declaration"],validate:function(){if(!process.env.BABEL_TYPES_8_BREAKING)return ()=>{};let t=(0, c.assertNodeType)("Identifier");return function(e,r,i){(0, ye.default)("ExportDefaultDeclaration",e)||t(i,"id",i.id);}}()});D("FunctionExpression",{inherits:"FunctionDeclaration",aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:Object.assign({},At(),ft(),{id:{validate:(0, c.assertNodeType)("Identifier"),optional:!0},body:{validate:(0, c.assertNodeType)("BlockStatement")},predicate:{validate:(0, c.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}})});var vt=()=>({typeAnnotation:{validate:(0, c.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},optional:{validate:(0, c.assertValueType)("boolean"),optional:!0},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0}});ge.patternLikeCommon=vt;D("Identifier",{builder:["name"],visitor:["typeAnnotation","decorators"],aliases:["Expression","PatternLike","LVal","TSEntityName"],fields:Object.assign({},vt(),{name:{validate:(0, c.chain)((0, c.assertValueType)("string"),Object.assign(function(t,e,r){if(process.env.BABEL_TYPES_8_BREAKING&&!(0, nS.default)(r,!1))throw new TypeError(`"${r}" is not a valid identifier name`)},{type:"string"}))}}),validate(t,e,r){if(!process.env.BABEL_TYPES_8_BREAKING)return;let i=/\.(\w+)$/.exec(e);if(!i)return;let[,s]=i,a={computed:!1};if(s==="property"){if((0, ye.default)("MemberExpression",t,a)||(0, ye.default)("OptionalMemberExpression",t,a))return}else if(s==="key"){if((0, ye.default)("Property",t,a)||(0, ye.default)("Method",t,a))return}else if(s==="exported"){if((0, ye.default)("ExportSpecifier",t))return}else if(s==="imported"){if((0, ye.default)("ImportSpecifier",t,{imported:r}))return}else if(s==="meta"&&(0, ye.default)("MetaProperty",t,{meta:r}))return;if(((0, ol.isKeyword)(r.name)||(0, ol.isReservedWord)(r.name,!1))&&r.name!=="this")throw new TypeError(`"${r.name}" is not a valid identifier`)}});D("IfStatement",{visitor:["test","consequent","alternate"],aliases:["Statement","Conditional"],fields:{test:{validate:(0, c.assertNodeType)("Expression")},consequent:{validate:(0, c.assertNodeType)("Statement")},alternate:{optional:!0,validate:(0, c.assertNodeType)("Statement")}}});D("LabeledStatement",{visitor:["label","body"],aliases:["Statement"],fields:{label:{validate:(0, c.assertNodeType)("Identifier")},body:{validate:(0, c.assertNodeType)("Statement")}}});D("StringLiteral",{builder:["value"],fields:{value:{validate:(0, c.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]});D("NumericLiteral",{builder:["value"],deprecatedAlias:"NumberLiteral",fields:{value:{validate:(0, c.chain)((0, c.assertValueType)("number"),Object.assign(function(t,e,r){},{type:"number"}))}},aliases:["Expression","Pureish","Literal","Immutable"]});D("NullLiteral",{aliases:["Expression","Pureish","Literal","Immutable"]});D("BooleanLiteral",{builder:["value"],fields:{value:{validate:(0, c.assertValueType)("boolean")}},aliases:["Expression","Pureish","Literal","Immutable"]});D("RegExpLiteral",{builder:["pattern","flags"],deprecatedAlias:"RegexLiteral",aliases:["Expression","Pureish","Literal"],fields:{pattern:{validate:(0, c.assertValueType)("string")},flags:{validate:(0, c.chain)((0, c.assertValueType)("string"),Object.assign(function(t,e,r){if(!process.env.BABEL_TYPES_8_BREAKING)return;let i=/[^gimsuy]/.exec(r);if(i)throw new TypeError(`"${i[0]}" is not a valid RegExp flag`)},{type:"string"})),default:""}}});D("LogicalExpression",{builder:["operator","left","right"],visitor:["left","right"],aliases:["Binary","Expression"],fields:{operator:{validate:(0, c.assertOneOf)(...Qt.LOGICAL_OPERATORS)},left:{validate:(0, c.assertNodeType)("Expression")},right:{validate:(0, c.assertNodeType)("Expression")}}});D("MemberExpression",{builder:["object","property","computed",...process.env.BABEL_TYPES_8_BREAKING?[]:["optional"]],visitor:["object","property"],aliases:["Expression","LVal"],fields:Object.assign({object:{validate:(0, c.assertNodeType)("Expression","Super")},property:{validate:function(){let t=(0, c.assertNodeType)("Identifier","PrivateName"),e=(0, c.assertNodeType)("Expression"),r=function(i,s,a){(i.computed?e:t)(i,s,a);};return r.oneOfNodeTypes=["Expression","Identifier","PrivateName"],r}()},computed:{default:!1}},process.env.BABEL_TYPES_8_BREAKING?{}:{optional:{validate:(0, c.assertOneOf)(!0,!1),optional:!0}})});D("NewExpression",{inherits:"CallExpression"});D("Program",{visitor:["directives","body"],builder:["body","directives","sourceType","interpreter"],fields:{sourceFile:{validate:(0, c.assertValueType)("string")},sourceType:{validate:(0, c.assertOneOf)("script","module"),default:"script"},interpreter:{validate:(0, c.assertNodeType)("InterpreterDirective"),default:null,optional:!0},directives:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Directive"))),default:[]},body:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block"]});D("ObjectExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("ObjectMethod","ObjectProperty","SpreadElement")))}}});D("ObjectMethod",{builder:["kind","key","params","body","computed","generator","async"],fields:Object.assign({},At(),ft(),{kind:Object.assign({validate:(0, c.assertOneOf)("method","get","set")},process.env.BABEL_TYPES_8_BREAKING?{}:{default:"method"}),computed:{default:!1},key:{validate:function(){let t=(0, c.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral"),e=(0, c.assertNodeType)("Expression"),r=function(i,s,a){(i.computed?e:t)(i,s,a);};return r.oneOfNodeTypes=["Expression","Identifier","StringLiteral","NumericLiteral","BigIntLiteral"],r}()},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0},body:{validate:(0, c.assertNodeType)("BlockStatement")}}),visitor:["key","params","body","decorators","returnType","typeParameters"],aliases:["UserWhitespacable","Function","Scopable","BlockParent","FunctionParent","Method","ObjectMember"]});D("ObjectProperty",{builder:["key","value","computed","shorthand",...process.env.BABEL_TYPES_8_BREAKING?[]:["decorators"]],fields:{computed:{default:!1},key:{validate:function(){let t=(0, c.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName"),e=(0, c.assertNodeType)("Expression");return Object.assign(function(i,s,a){(i.computed?e:t)(i,s,a);},{oneOfNodeTypes:["Expression","Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName"]})}()},value:{validate:(0, c.assertNodeType)("Expression","PatternLike")},shorthand:{validate:(0, c.chain)((0, c.assertValueType)("boolean"),Object.assign(function(t,e,r){if(process.env.BABEL_TYPES_8_BREAKING&&r&&t.computed)throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true")},{type:"boolean"}),function(t,e,r){if(process.env.BABEL_TYPES_8_BREAKING&&r&&!(0, ye.default)("Identifier",t.key))throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier")}),default:!1},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0}},visitor:["key","value","decorators"],aliases:["UserWhitespacable","Property","ObjectMember"],validate:function(){let t=(0, c.assertNodeType)("Identifier","Pattern","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"),e=(0, c.assertNodeType)("Expression");return function(r,i,s){if(!process.env.BABEL_TYPES_8_BREAKING)return;((0, ye.default)("ObjectPattern",r)?t:e)(s,"value",s.value);}}()});D("RestElement",{visitor:["argument","typeAnnotation"],builder:["argument"],aliases:["LVal","PatternLike"],deprecatedAlias:"RestProperty",fields:Object.assign({},vt(),{argument:{validate:process.env.BABEL_TYPES_8_BREAKING?(0, c.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0, c.assertNodeType)("LVal")}}),validate(t,e){if(!process.env.BABEL_TYPES_8_BREAKING)return;let r=/(\w+)\[(\d+)\]/.exec(e);if(!r)throw new Error("Internal Babel error: malformed key.");let[,i,s]=r;if(t[i].length>+s+1)throw new TypeError(`RestElement must be last element of ${i}`)}});D("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0, c.assertNodeType)("Expression"),optional:!0}}});D("SequenceExpression",{visitor:["expressions"],fields:{expressions:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Expression")))}},aliases:["Expression"]});D("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:(0, c.assertNodeType)("Expression")}}});D("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:(0, c.assertNodeType)("Expression"),optional:!0},consequent:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Statement")))}}});D("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:(0, c.assertNodeType)("Expression")},cases:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("SwitchCase")))}}});D("ThisExpression",{aliases:["Expression"]});D("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0, c.assertNodeType)("Expression")}}});D("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{block:{validate:(0, c.chain)((0, c.assertNodeType)("BlockStatement"),Object.assign(function(t){if(process.env.BABEL_TYPES_8_BREAKING&&!t.handler&&!t.finalizer)throw new TypeError("TryStatement expects either a handler or finalizer, or both")},{oneOfNodeTypes:["BlockStatement"]}))},handler:{optional:!0,validate:(0, c.assertNodeType)("CatchClause")},finalizer:{optional:!0,validate:(0, c.assertNodeType)("BlockStatement")}}});D("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:(0, c.assertNodeType)("Expression")},operator:{validate:(0, c.assertOneOf)(...Qt.UNARY_OPERATORS)}},visitor:["argument"],aliases:["UnaryLike","Expression"]});D("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:process.env.BABEL_TYPES_8_BREAKING?(0, c.assertNodeType)("Identifier","MemberExpression"):(0, c.assertNodeType)("Expression")},operator:{validate:(0, c.assertOneOf)(...Qt.UPDATE_OPERATORS)}},visitor:["argument"],aliases:["Expression"]});D("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{declare:{validate:(0, c.assertValueType)("boolean"),optional:!0},kind:{validate:(0, c.assertOneOf)("var","let","const","using","await using")},declarations:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("VariableDeclarator")))}},validate(t,e,r){if(process.env.BABEL_TYPES_8_BREAKING&&(0, ye.default)("ForXStatement",t,{left:r})&&r.declarations.length!==1)throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${t.type}`)}});D("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:function(){if(!process.env.BABEL_TYPES_8_BREAKING)return (0, c.assertNodeType)("LVal");let t=(0, c.assertNodeType)("Identifier","ArrayPattern","ObjectPattern"),e=(0, c.assertNodeType)("Identifier");return function(r,i,s){(r.init?t:e)(r,i,s);}}()},definite:{optional:!0,validate:(0, c.assertValueType)("boolean")},init:{optional:!0,validate:(0, c.assertNodeType)("Expression")}}});D("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:(0, c.assertNodeType)("Expression")},body:{validate:(0, c.assertNodeType)("Statement")}}});D("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{validate:(0, c.assertNodeType)("Expression")},body:{validate:(0, c.assertNodeType)("Statement")}}});D("AssignmentPattern",{visitor:["left","right","decorators"],builder:["left","right"],aliases:["Pattern","PatternLike","LVal"],fields:Object.assign({},vt(),{left:{validate:(0, c.assertNodeType)("Identifier","ObjectPattern","ArrayPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression")},right:{validate:(0, c.assertNodeType)("Expression")},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0}})});D("ArrayPattern",{visitor:["elements","typeAnnotation"],builder:["elements"],aliases:["Pattern","PatternLike","LVal"],fields:Object.assign({},vt(),{elements:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeOrValueType)("null","PatternLike","LVal")))}})});D("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["params","body","returnType","typeParameters"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:Object.assign({},At(),ft(),{expression:{validate:(0, c.assertValueType)("boolean")},body:{validate:(0, c.assertNodeType)("BlockStatement","Expression")},predicate:{validate:(0, c.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}})});D("ClassBody",{visitor:["body"],fields:{body:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("ClassMethod","ClassPrivateMethod","ClassProperty","ClassPrivateProperty","ClassAccessorProperty","TSDeclareMethod","TSIndexSignature","StaticBlock")))}}});D("ClassExpression",{builder:["id","superClass","body","decorators"],visitor:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],aliases:["Scopable","Class","Expression"],fields:{id:{validate:(0, c.assertNodeType)("Identifier"),optional:!0},typeParameters:{validate:(0, c.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:(0, c.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0, c.assertNodeType)("Expression")},superTypeParameters:{validate:(0, c.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("TSExpressionWithTypeArguments","ClassImplements"))),optional:!0},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0},mixins:{validate:(0, c.assertNodeType)("InterfaceExtends"),optional:!0}}});D("ClassDeclaration",{inherits:"ClassExpression",aliases:["Scopable","Class","Statement","Declaration"],fields:{id:{validate:(0, c.assertNodeType)("Identifier"),optional:!0},typeParameters:{validate:(0, c.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:(0, c.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0, c.assertNodeType)("Expression")},superTypeParameters:{validate:(0, c.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("TSExpressionWithTypeArguments","ClassImplements"))),optional:!0},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0},mixins:{validate:(0, c.assertNodeType)("InterfaceExtends"),optional:!0},declare:{validate:(0, c.assertValueType)("boolean"),optional:!0},abstract:{validate:(0, c.assertValueType)("boolean"),optional:!0}},validate:function(){let t=(0, c.assertNodeType)("Identifier");return function(e,r,i){process.env.BABEL_TYPES_8_BREAKING&&((0, ye.default)("ExportDefaultDeclaration",e)||t(i,"id",i.id));}}()});D("ExportAllDeclaration",{builder:["source"],visitor:["source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:{source:{validate:(0, c.assertNodeType)("StringLiteral")},exportKind:(0, c.validateOptional)((0, c.assertOneOf)("type","value")),attributes:{optional:!0,validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("ImportAttribute")))},assertions:{optional:!0,validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("ImportAttribute")))}}});D("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0, c.assertNodeType)("TSDeclareFunction","FunctionDeclaration","ClassDeclaration","Expression")},exportKind:(0, c.validateOptional)((0, c.assertOneOf)("value"))}});D("ExportNamedDeclaration",{builder:["declaration","specifiers","source"],visitor:["declaration","specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:{declaration:{optional:!0,validate:(0, c.chain)((0, c.assertNodeType)("Declaration"),Object.assign(function(t,e,r){if(process.env.BABEL_TYPES_8_BREAKING&&r&&t.specifiers.length)throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration")},{oneOfNodeTypes:["Declaration"]}),function(t,e,r){if(process.env.BABEL_TYPES_8_BREAKING&&r&&t.source)throw new TypeError("Cannot export a declaration from a source")})},attributes:{optional:!0,validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("ImportAttribute")))},assertions:{optional:!0,validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("ImportAttribute")))},specifiers:{default:[],validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)(function(){let t=(0, c.assertNodeType)("ExportSpecifier","ExportDefaultSpecifier","ExportNamespaceSpecifier"),e=(0, c.assertNodeType)("ExportSpecifier");return process.env.BABEL_TYPES_8_BREAKING?function(r,i,s){(r.source?t:e)(r,i,s);}:t}()))},source:{validate:(0, c.assertNodeType)("StringLiteral"),optional:!0},exportKind:(0, c.validateOptional)((0, c.assertOneOf)("type","value"))}});D("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0, c.assertNodeType)("Identifier")},exported:{validate:(0, c.assertNodeType)("Identifier","StringLiteral")},exportKind:{validate:(0, c.assertOneOf)("type","value"),optional:!0}}});D("ForOfStatement",{visitor:["left","right","body"],builder:["left","right","body","await"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:function(){if(!process.env.BABEL_TYPES_8_BREAKING)return (0, c.assertNodeType)("VariableDeclaration","LVal");let t=(0, c.assertNodeType)("VariableDeclaration"),e=(0, c.assertNodeType)("Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression");return function(r,i,s){(0, ye.default)("VariableDeclaration",s)?t(r,i,s):e(r,i,s);}}()},right:{validate:(0, c.assertNodeType)("Expression")},body:{validate:(0, c.assertNodeType)("Statement")},await:{default:!1}}});D("ImportDeclaration",{builder:["specifiers","source"],visitor:["specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration"],fields:{attributes:{optional:!0,validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("ImportAttribute")))},assertions:{optional:!0,validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("ImportAttribute")))},module:{optional:!0,validate:(0, c.assertValueType)("boolean")},phase:{default:null,validate:(0, c.assertOneOf)("source","defer")},specifiers:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier")))},source:{validate:(0, c.assertNodeType)("StringLiteral")},importKind:{validate:(0, c.assertOneOf)("type","typeof","value"),optional:!0}}});D("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0, c.assertNodeType)("Identifier")}}});D("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0, c.assertNodeType)("Identifier")}}});D("ImportSpecifier",{visitor:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0, c.assertNodeType)("Identifier")},imported:{validate:(0, c.assertNodeType)("Identifier","StringLiteral")},importKind:{validate:(0, c.assertOneOf)("type","typeof","value"),optional:!0}}});D("ImportExpression",{visitor:["source","options"],aliases:["Expression"],fields:{phase:{default:null,validate:(0, c.assertOneOf)("source","defer")},source:{validate:(0, c.assertNodeType)("Expression")},options:{validate:(0, c.assertNodeType)("Expression"),optional:!0}}});D("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:(0, c.chain)((0, c.assertNodeType)("Identifier"),Object.assign(function(t,e,r){if(!process.env.BABEL_TYPES_8_BREAKING)return;let i;switch(r.name){case"function":i="sent";break;case"new":i="target";break;case"import":i="meta";break}if(!(0, ye.default)("Identifier",t.property,{name:i}))throw new TypeError("Unrecognised MetaProperty")},{oneOfNodeTypes:["Identifier"]}))},property:{validate:(0, c.assertNodeType)("Identifier")}}});var Rr=()=>({abstract:{validate:(0, c.assertValueType)("boolean"),optional:!0},accessibility:{validate:(0, c.assertOneOf)("public","private","protected"),optional:!0},static:{default:!1},override:{default:!1},computed:{default:!1},optional:{validate:(0, c.assertValueType)("boolean"),optional:!0},key:{validate:(0, c.chain)(function(){let t=(0, c.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral"),e=(0, c.assertNodeType)("Expression");return function(r,i,s){(r.computed?e:t)(r,i,s);}}(),(0, c.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression"))}});ge.classMethodOrPropertyCommon=Rr;var hs=()=>Object.assign({},At(),Rr(),{params:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Identifier","Pattern","RestElement","TSParameterProperty")))},kind:{validate:(0, c.assertOneOf)("get","set","method","constructor"),default:"method"},access:{validate:(0, c.chain)((0, c.assertValueType)("string"),(0, c.assertOneOf)("public","private","protected")),optional:!0},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0}});ge.classMethodOrDeclareMethodCommon=hs;D("ClassMethod",{aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static","generator","async"],visitor:["key","params","body","decorators","returnType","typeParameters"],fields:Object.assign({},hs(),ft(),{body:{validate:(0, c.assertNodeType)("BlockStatement")}})});D("ObjectPattern",{visitor:["properties","typeAnnotation","decorators"],builder:["properties"],aliases:["Pattern","PatternLike","LVal"],fields:Object.assign({},vt(),{properties:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("RestElement","ObjectProperty")))}})});D("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],deprecatedAlias:"SpreadProperty",fields:{argument:{validate:(0, c.assertNodeType)("Expression")}}});D("Super",{aliases:["Expression"]});D("TaggedTemplateExpression",{visitor:["tag","quasi","typeParameters"],builder:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:(0, c.assertNodeType)("Expression")},quasi:{validate:(0, c.assertNodeType)("TemplateLiteral")},typeParameters:{validate:(0, c.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0}}});D("TemplateElement",{builder:["value","tail"],fields:{value:{validate:(0, c.chain)((0, c.assertShape)({raw:{validate:(0, c.assertValueType)("string")},cooked:{validate:(0, c.assertValueType)("string"),optional:!0}}),function(e){let r=e.value.raw,i=!1,s=()=>{throw new Error("Internal @babel/types error.")},{str:a,firstInvalidLoc:n}=(0, oS.readStringContents)("template",r,0,0,0,{unterminated(){i=!0;},strictNumericEscape:s,invalidEscapeSequence:s,numericSeparatorInEscapeSequence:s,unexpectedNumericSeparator:s,invalidDigit:s,invalidCodePoint:s});if(!i)throw new Error("Invalid raw");e.value.cooked=n?null:a;})},tail:{default:!1}}});D("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("TemplateElement")))},expressions:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Expression","TSType")),function(t,e,r){if(t.quasis.length!==r.length+1)throw new TypeError(`Number of ${t.type} quasis should be exactly one more than the number of expressions.
+Expected ${r.length+1} quasis but got ${t.quasis.length}`)})}}});D("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:(0, c.chain)((0, c.assertValueType)("boolean"),Object.assign(function(t,e,r){if(process.env.BABEL_TYPES_8_BREAKING&&r&&!t.argument)throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument")},{type:"boolean"})),default:!1},argument:{optional:!0,validate:(0, c.assertNodeType)("Expression")}}});D("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0, c.assertNodeType)("Expression")}}});D("Import",{aliases:["Expression"]});D("BigIntLiteral",{builder:["value"],fields:{value:{validate:(0, c.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]});D("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0, c.assertNodeType)("Identifier")}}});D("OptionalMemberExpression",{builder:["object","property","computed","optional"],visitor:["object","property"],aliases:["Expression"],fields:{object:{validate:(0, c.assertNodeType)("Expression")},property:{validate:function(){let t=(0, c.assertNodeType)("Identifier"),e=(0, c.assertNodeType)("Expression");return Object.assign(function(i,s,a){(i.computed?e:t)(i,s,a);},{oneOfNodeTypes:["Expression","Identifier"]})}()},computed:{default:!1},optional:{validate:process.env.BABEL_TYPES_8_BREAKING?(0, c.chain)((0, c.assertValueType)("boolean"),(0, c.assertOptionalChainStart)()):(0, c.assertValueType)("boolean")}}});D("OptionalCallExpression",{visitor:["callee","arguments","typeParameters","typeArguments"],builder:["callee","arguments","optional"],aliases:["Expression"],fields:{callee:{validate:(0, c.assertNodeType)("Expression")},arguments:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Expression","SpreadElement","JSXNamespacedName","ArgumentPlaceholder")))},optional:{validate:process.env.BABEL_TYPES_8_BREAKING?(0, c.chain)((0, c.assertValueType)("boolean"),(0, c.assertOptionalChainStart)()):(0, c.assertValueType)("boolean")},typeArguments:{validate:(0, c.assertNodeType)("TypeParameterInstantiation"),optional:!0},typeParameters:{validate:(0, c.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}}});D("ClassProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property"],fields:Object.assign({},Rr(),{value:{validate:(0, c.assertNodeType)("Expression"),optional:!0},definite:{validate:(0, c.assertValueType)("boolean"),optional:!0},typeAnnotation:{validate:(0, c.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0},readonly:{validate:(0, c.assertValueType)("boolean"),optional:!0},declare:{validate:(0, c.assertValueType)("boolean"),optional:!0},variance:{validate:(0, c.assertNodeType)("Variance"),optional:!0}})});D("ClassAccessorProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property","Accessor"],fields:Object.assign({},Rr(),{key:{validate:(0, c.chain)(function(){let t=(0, c.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","PrivateName"),e=(0, c.assertNodeType)("Expression");return function(r,i,s){(r.computed?e:t)(r,i,s);}}(),(0, c.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression","PrivateName"))},value:{validate:(0, c.assertNodeType)("Expression"),optional:!0},definite:{validate:(0, c.assertValueType)("boolean"),optional:!0},typeAnnotation:{validate:(0, c.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0},readonly:{validate:(0, c.assertValueType)("boolean"),optional:!0},declare:{validate:(0, c.assertValueType)("boolean"),optional:!0},variance:{validate:(0, c.assertNodeType)("Variance"),optional:!0}})});D("ClassPrivateProperty",{visitor:["key","value","decorators","typeAnnotation"],builder:["key","value","decorators","static"],aliases:["Property","Private"],fields:{key:{validate:(0, c.assertNodeType)("PrivateName")},value:{validate:(0, c.assertNodeType)("Expression"),optional:!0},typeAnnotation:{validate:(0, c.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Decorator"))),optional:!0},static:{validate:(0, c.assertValueType)("boolean"),default:!1},readonly:{validate:(0, c.assertValueType)("boolean"),optional:!0},definite:{validate:(0, c.assertValueType)("boolean"),optional:!0},variance:{validate:(0, c.assertNodeType)("Variance"),optional:!0}}});D("ClassPrivateMethod",{builder:["kind","key","params","body","static"],visitor:["key","params","body","decorators","returnType","typeParameters"],aliases:["Function","Scopable","BlockParent","FunctionParent","Method","Private"],fields:Object.assign({},hs(),ft(),{kind:{validate:(0, c.assertOneOf)("get","set","method"),default:"method"},key:{validate:(0, c.assertNodeType)("PrivateName")},body:{validate:(0, c.assertNodeType)("BlockStatement")}})});D("PrivateName",{visitor:["id"],aliases:["Private"],fields:{id:{validate:(0, c.assertNodeType)("Identifier")}}});D("StaticBlock",{visitor:["body"],fields:{body:{validate:(0, c.chain)((0, c.assertValueType)("array"),(0, c.assertEach)((0, c.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","FunctionParent"]});});var ul=A(()=>{var g=qe(),F=(0, g.defineAliasedType)("Flow"),ms=t=>{let e=t==="DeclareClass";F(t,{builder:["id","typeParameters","extends","body"],visitor:["id","typeParameters","extends",...e?["mixins","implements"]:[],"body"],aliases:["FlowDeclaration","Statement","Declaration"],fields:Object.assign({id:(0, g.validateType)("Identifier"),typeParameters:(0, g.validateOptionalType)("TypeParameterDeclaration"),extends:(0, g.validateOptional)((0, g.arrayOfType)("InterfaceExtends"))},e?{mixins:(0, g.validateOptional)((0, g.arrayOfType)("InterfaceExtends")),implements:(0, g.validateOptional)((0, g.arrayOfType)("ClassImplements"))}:{},{body:(0, g.validateType)("ObjectTypeAnnotation")})});};F("AnyTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["FlowType"],fields:{elementType:(0, g.validateType)("FlowType")}});F("BooleanTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("BooleanLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:(0, g.validate)((0, g.assertValueType)("boolean"))}});F("NullLiteralTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("ClassImplements",{visitor:["id","typeParameters"],fields:{id:(0, g.validateType)("Identifier"),typeParameters:(0, g.validateOptionalType)("TypeParameterInstantiation")}});ms("DeclareClass");F("DeclareFunction",{visitor:["id"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0, g.validateType)("Identifier"),predicate:(0, g.validateOptionalType)("DeclaredPredicate")}});ms("DeclareInterface");F("DeclareModule",{builder:["id","body","kind"],visitor:["id","body"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0, g.validateType)(["Identifier","StringLiteral"]),body:(0, g.validateType)("BlockStatement"),kind:(0, g.validateOptional)((0, g.assertOneOf)("CommonJS","ES"))}});F("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{typeAnnotation:(0, g.validateType)("TypeAnnotation")}});F("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0, g.validateType)("Identifier"),typeParameters:(0, g.validateOptionalType)("TypeParameterDeclaration"),right:(0, g.validateType)("FlowType")}});F("DeclareOpaqueType",{visitor:["id","typeParameters","supertype"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0, g.validateType)("Identifier"),typeParameters:(0, g.validateOptionalType)("TypeParameterDeclaration"),supertype:(0, g.validateOptionalType)("FlowType"),impltype:(0, g.validateOptionalType)("FlowType")}});F("DeclareVariable",{visitor:["id"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0, g.validateType)("Identifier")}});F("DeclareExportDeclaration",{visitor:["declaration","specifiers","source"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{declaration:(0, g.validateOptionalType)("Flow"),specifiers:(0, g.validateOptional)((0, g.arrayOfType)(["ExportSpecifier","ExportNamespaceSpecifier"])),source:(0, g.validateOptionalType)("StringLiteral"),default:(0, g.validateOptional)((0, g.assertValueType)("boolean"))}});F("DeclareExportAllDeclaration",{visitor:["source"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{source:(0, g.validateType)("StringLiteral"),exportKind:(0, g.validateOptional)((0, g.assertOneOf)("type","value"))}});F("DeclaredPredicate",{visitor:["value"],aliases:["FlowPredicate"],fields:{value:(0, g.validateType)("Flow")}});F("ExistsTypeAnnotation",{aliases:["FlowType"]});F("FunctionTypeAnnotation",{visitor:["typeParameters","params","rest","returnType"],aliases:["FlowType"],fields:{typeParameters:(0, g.validateOptionalType)("TypeParameterDeclaration"),params:(0, g.validate)((0, g.arrayOfType)("FunctionTypeParam")),rest:(0, g.validateOptionalType)("FunctionTypeParam"),this:(0, g.validateOptionalType)("FunctionTypeParam"),returnType:(0, g.validateType)("FlowType")}});F("FunctionTypeParam",{visitor:["name","typeAnnotation"],fields:{name:(0, g.validateOptionalType)("Identifier"),typeAnnotation:(0, g.validateType)("FlowType"),optional:(0, g.validateOptional)((0, g.assertValueType)("boolean"))}});F("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["FlowType"],fields:{id:(0, g.validateType)(["Identifier","QualifiedTypeIdentifier"]),typeParameters:(0, g.validateOptionalType)("TypeParameterInstantiation")}});F("InferredPredicate",{aliases:["FlowPredicate"]});F("InterfaceExtends",{visitor:["id","typeParameters"],fields:{id:(0, g.validateType)(["Identifier","QualifiedTypeIdentifier"]),typeParameters:(0, g.validateOptionalType)("TypeParameterInstantiation")}});ms("InterfaceDeclaration");F("InterfaceTypeAnnotation",{visitor:["extends","body"],aliases:["FlowType"],fields:{extends:(0, g.validateOptional)((0, g.arrayOfType)("InterfaceExtends")),body:(0, g.validateType)("ObjectTypeAnnotation")}});F("IntersectionTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:(0, g.validate)((0, g.arrayOfType)("FlowType"))}});F("MixedTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("EmptyTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["FlowType"],fields:{typeAnnotation:(0, g.validateType)("FlowType")}});F("NumberLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:(0, g.validate)((0, g.assertValueType)("number"))}});F("NumberTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties","internalSlots"],aliases:["FlowType"],builder:["properties","indexers","callProperties","internalSlots","exact"],fields:{properties:(0, g.validate)((0, g.arrayOfType)(["ObjectTypeProperty","ObjectTypeSpreadProperty"])),indexers:{validate:(0, g.arrayOfType)("ObjectTypeIndexer"),optional:!0,default:[]},callProperties:{validate:(0, g.arrayOfType)("ObjectTypeCallProperty"),optional:!0,default:[]},internalSlots:{validate:(0, g.arrayOfType)("ObjectTypeInternalSlot"),optional:!0,default:[]},exact:{validate:(0, g.assertValueType)("boolean"),default:!1},inexact:(0, g.validateOptional)((0, g.assertValueType)("boolean"))}});F("ObjectTypeInternalSlot",{visitor:["id","value","optional","static","method"],aliases:["UserWhitespacable"],fields:{id:(0, g.validateType)("Identifier"),value:(0, g.validateType)("FlowType"),optional:(0, g.validate)((0, g.assertValueType)("boolean")),static:(0, g.validate)((0, g.assertValueType)("boolean")),method:(0, g.validate)((0, g.assertValueType)("boolean"))}});F("ObjectTypeCallProperty",{visitor:["value"],aliases:["UserWhitespacable"],fields:{value:(0, g.validateType)("FlowType"),static:(0, g.validate)((0, g.assertValueType)("boolean"))}});F("ObjectTypeIndexer",{visitor:["id","key","value","variance"],aliases:["UserWhitespacable"],fields:{id:(0, g.validateOptionalType)("Identifier"),key:(0, g.validateType)("FlowType"),value:(0, g.validateType)("FlowType"),static:(0, g.validate)((0, g.assertValueType)("boolean")),variance:(0, g.validateOptionalType)("Variance")}});F("ObjectTypeProperty",{visitor:["key","value","variance"],aliases:["UserWhitespacable"],fields:{key:(0, g.validateType)(["Identifier","StringLiteral"]),value:(0, g.validateType)("FlowType"),kind:(0, g.validate)((0, g.assertOneOf)("init","get","set")),static:(0, g.validate)((0, g.assertValueType)("boolean")),proto:(0, g.validate)((0, g.assertValueType)("boolean")),optional:(0, g.validate)((0, g.assertValueType)("boolean")),variance:(0, g.validateOptionalType)("Variance"),method:(0, g.validate)((0, g.assertValueType)("boolean"))}});F("ObjectTypeSpreadProperty",{visitor:["argument"],aliases:["UserWhitespacable"],fields:{argument:(0, g.validateType)("FlowType")}});F("OpaqueType",{visitor:["id","typeParameters","supertype","impltype"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0, g.validateType)("Identifier"),typeParameters:(0, g.validateOptionalType)("TypeParameterDeclaration"),supertype:(0, g.validateOptionalType)("FlowType"),impltype:(0, g.validateType)("FlowType")}});F("QualifiedTypeIdentifier",{visitor:["id","qualification"],fields:{id:(0, g.validateType)("Identifier"),qualification:(0, g.validateType)(["Identifier","QualifiedTypeIdentifier"])}});F("StringLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:(0, g.validate)((0, g.assertValueType)("string"))}});F("StringTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("SymbolTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("ThisTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("TupleTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:(0, g.validate)((0, g.arrayOfType)("FlowType"))}});F("TypeofTypeAnnotation",{visitor:["argument"],aliases:["FlowType"],fields:{argument:(0, g.validateType)("FlowType")}});F("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0, g.validateType)("Identifier"),typeParameters:(0, g.validateOptionalType)("TypeParameterDeclaration"),right:(0, g.validateType)("FlowType")}});F("TypeAnnotation",{visitor:["typeAnnotation"],fields:{typeAnnotation:(0, g.validateType)("FlowType")}});F("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["ExpressionWrapper","Expression"],fields:{expression:(0, g.validateType)("Expression"),typeAnnotation:(0, g.validateType)("TypeAnnotation")}});F("TypeParameter",{visitor:["bound","default","variance"],fields:{name:(0, g.validate)((0, g.assertValueType)("string")),bound:(0, g.validateOptionalType)("TypeAnnotation"),default:(0, g.validateOptionalType)("FlowType"),variance:(0, g.validateOptionalType)("Variance")}});F("TypeParameterDeclaration",{visitor:["params"],fields:{params:(0, g.validate)((0, g.arrayOfType)("TypeParameter"))}});F("TypeParameterInstantiation",{visitor:["params"],fields:{params:(0, g.validate)((0, g.arrayOfType)("FlowType"))}});F("UnionTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:(0, g.validate)((0, g.arrayOfType)("FlowType"))}});F("Variance",{builder:["kind"],fields:{kind:(0, g.validate)((0, g.assertOneOf)("minus","plus"))}});F("VoidTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});F("EnumDeclaration",{aliases:["Statement","Declaration"],visitor:["id","body"],fields:{id:(0, g.validateType)("Identifier"),body:(0, g.validateType)(["EnumBooleanBody","EnumNumberBody","EnumStringBody","EnumSymbolBody"])}});F("EnumBooleanBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:(0, g.validate)((0, g.assertValueType)("boolean")),members:(0, g.validateArrayOfType)("EnumBooleanMember"),hasUnknownMembers:(0, g.validate)((0, g.assertValueType)("boolean"))}});F("EnumNumberBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:(0, g.validate)((0, g.assertValueType)("boolean")),members:(0, g.validateArrayOfType)("EnumNumberMember"),hasUnknownMembers:(0, g.validate)((0, g.assertValueType)("boolean"))}});F("EnumStringBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:(0, g.validate)((0, g.assertValueType)("boolean")),members:(0, g.validateArrayOfType)(["EnumStringMember","EnumDefaultedMember"]),hasUnknownMembers:(0, g.validate)((0, g.assertValueType)("boolean"))}});F("EnumSymbolBody",{aliases:["EnumBody"],visitor:["members"],fields:{members:(0, g.validateArrayOfType)("EnumDefaultedMember"),hasUnknownMembers:(0, g.validate)((0, g.assertValueType)("boolean"))}});F("EnumBooleanMember",{aliases:["EnumMember"],visitor:["id"],fields:{id:(0, g.validateType)("Identifier"),init:(0, g.validateType)("BooleanLiteral")}});F("EnumNumberMember",{aliases:["EnumMember"],visitor:["id","init"],fields:{id:(0, g.validateType)("Identifier"),init:(0, g.validateType)("NumericLiteral")}});F("EnumStringMember",{aliases:["EnumMember"],visitor:["id","init"],fields:{id:(0, g.validateType)("Identifier"),init:(0, g.validateType)("StringLiteral")}});F("EnumDefaultedMember",{aliases:["EnumMember"],visitor:["id"],fields:{id:(0, g.validateType)("Identifier")}});F("IndexedAccessType",{visitor:["objectType","indexType"],aliases:["FlowType"],fields:{objectType:(0, g.validateType)("FlowType"),indexType:(0, g.validateType)("FlowType")}});F("OptionalIndexedAccessType",{visitor:["objectType","indexType"],aliases:["FlowType"],fields:{objectType:(0, g.validateType)("FlowType"),indexType:(0, g.validateType)("FlowType"),optional:(0, g.validate)((0, g.assertValueType)("boolean"))}});});var cl=A(()=>{var ee=qe(),me=(0, ee.defineAliasedType)("JSX");me("JSXAttribute",{visitor:["name","value"],aliases:["Immutable"],fields:{name:{validate:(0, ee.assertNodeType)("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:(0, ee.assertNodeType)("JSXElement","JSXFragment","StringLiteral","JSXExpressionContainer")}}});me("JSXClosingElement",{visitor:["name"],aliases:["Immutable"],fields:{name:{validate:(0, ee.assertNodeType)("JSXIdentifier","JSXMemberExpression","JSXNamespacedName")}}});me("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["Immutable","Expression"],fields:Object.assign({openingElement:{validate:(0, ee.assertNodeType)("JSXOpeningElement")},closingElement:{optional:!0,validate:(0, ee.assertNodeType)("JSXClosingElement")},children:{validate:(0, ee.chain)((0, ee.assertValueType)("array"),(0, ee.assertEach)((0, ee.assertNodeType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")))}},{selfClosing:{validate:(0, ee.assertValueType)("boolean"),optional:!0}})});me("JSXEmptyExpression",{});me("JSXExpressionContainer",{visitor:["expression"],aliases:["Immutable"],fields:{expression:{validate:(0, ee.assertNodeType)("Expression","JSXEmptyExpression")}}});me("JSXSpreadChild",{visitor:["expression"],aliases:["Immutable"],fields:{expression:{validate:(0, ee.assertNodeType)("Expression")}}});me("JSXIdentifier",{builder:["name"],fields:{name:{validate:(0, ee.assertValueType)("string")}}});me("JSXMemberExpression",{visitor:["object","property"],fields:{object:{validate:(0, ee.assertNodeType)("JSXMemberExpression","JSXIdentifier")},property:{validate:(0, ee.assertNodeType)("JSXIdentifier")}}});me("JSXNamespacedName",{visitor:["namespace","name"],fields:{namespace:{validate:(0, ee.assertNodeType)("JSXIdentifier")},name:{validate:(0, ee.assertNodeType)("JSXIdentifier")}}});me("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","attributes"],aliases:["Immutable"],fields:{name:{validate:(0, ee.assertNodeType)("JSXIdentifier","JSXMemberExpression","JSXNamespacedName")},selfClosing:{default:!1},attributes:{validate:(0, ee.chain)((0, ee.assertValueType)("array"),(0, ee.assertEach)((0, ee.assertNodeType)("JSXAttribute","JSXSpreadAttribute")))},typeParameters:{validate:(0, ee.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0}}});me("JSXSpreadAttribute",{visitor:["argument"],fields:{argument:{validate:(0, ee.assertNodeType)("Expression")}}});me("JSXText",{aliases:["Immutable"],builder:["value"],fields:{value:{validate:(0, ee.assertValueType)("string")}}});me("JSXFragment",{builder:["openingFragment","closingFragment","children"],visitor:["openingFragment","children","closingFragment"],aliases:["Immutable","Expression"],fields:{openingFragment:{validate:(0, ee.assertNodeType)("JSXOpeningFragment")},closingFragment:{validate:(0, ee.assertNodeType)("JSXClosingFragment")},children:{validate:(0, ee.chain)((0, ee.assertValueType)("array"),(0, ee.assertEach)((0, ee.assertNodeType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")))}}});me("JSXOpeningFragment",{aliases:["Immutable"]});me("JSXClosingFragment",{aliases:["Immutable"]});});var Ss=A(Qe=>{Object.defineProperty(Qe,"__esModule",{value:!0});Qe.PLACEHOLDERS_FLIPPED_ALIAS=Qe.PLACEHOLDERS_ALIAS=Qe.PLACEHOLDERS=void 0;var lS=qe(),uS=Qe.PLACEHOLDERS=["Identifier","StringLiteral","Expression","Statement","Declaration","BlockStatement","ClassBody","Pattern"],bs=Qe.PLACEHOLDERS_ALIAS={Declaration:["Statement"],Pattern:["PatternLike","LVal"]};for(let t of uS){let e=lS.ALIAS_KEYS[t];e!=null&&e.length&&(bs[t]=e);}var Ts=Qe.PLACEHOLDERS_FLIPPED_ALIAS={};Object.keys(bs).forEach(t=>{bs[t].forEach(e=>{Object.hasOwnProperty.call(Ts,e)||(Ts[e]=[]),Ts[e].push(t);});});});var pl=A(()=>{var Ur=qe(),cS=Ss(),xs=(0, Ur.defineAliasedType)("Miscellaneous");xs("Noop",{visitor:[]});xs("Placeholder",{visitor:[],builder:["expectedNode","name"],fields:{name:{validate:(0, Ur.assertNodeType)("Identifier")},expectedNode:{validate:(0, Ur.assertOneOf)(...cS.PLACEHOLDERS)}}});xs("V8IntrinsicIdentifier",{builder:["name"],fields:{name:{validate:(0, Ur.assertValueType)("string")}}});});var fl=A(()=>{var Z=qe();(0, Z.default)("ArgumentPlaceholder",{});(0, Z.default)("BindExpression",{visitor:["object","callee"],aliases:["Expression"],fields:process.env.BABEL_TYPES_8_BREAKING?{object:{validate:(0, Z.assertNodeType)("Expression")},callee:{validate:(0, Z.assertNodeType)("Expression")}}:{object:{validate:Object.assign(()=>{},{oneOfNodeTypes:["Expression"]})},callee:{validate:Object.assign(()=>{},{oneOfNodeTypes:["Expression"]})}}});(0, Z.default)("ImportAttribute",{visitor:["key","value"],fields:{key:{validate:(0, Z.assertNodeType)("Identifier","StringLiteral")},value:{validate:(0, Z.assertNodeType)("StringLiteral")}}});(0, Z.default)("Decorator",{visitor:["expression"],fields:{expression:{validate:(0, Z.assertNodeType)("Expression")}}});(0, Z.default)("DoExpression",{visitor:["body"],builder:["body","async"],aliases:["Expression"],fields:{body:{validate:(0, Z.assertNodeType)("BlockStatement")},async:{validate:(0, Z.assertValueType)("boolean"),default:!1}}});(0, Z.default)("ExportDefaultSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0, Z.assertNodeType)("Identifier")}}});(0, Z.default)("RecordExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:{validate:(0, Z.chain)((0, Z.assertValueType)("array"),(0, Z.assertEach)((0, Z.assertNodeType)("ObjectProperty","SpreadElement")))}}});(0, Z.default)("TupleExpression",{fields:{elements:{validate:(0, Z.chain)((0, Z.assertValueType)("array"),(0, Z.assertEach)((0, Z.assertNodeType)("Expression","SpreadElement"))),default:[]}},visitor:["elements"],aliases:["Expression"]});(0, Z.default)("DecimalLiteral",{builder:["value"],fields:{value:{validate:(0, Z.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]});(0, Z.default)("ModuleExpression",{visitor:["body"],fields:{body:{validate:(0, Z.assertNodeType)("Program")}},aliases:["Expression"]});(0, Z.default)("TopicReference",{aliases:["Expression"]});(0, Z.default)("PipelineTopicExpression",{builder:["expression"],visitor:["expression"],fields:{expression:{validate:(0, Z.assertNodeType)("Expression")}},aliases:["Expression"]});(0, Z.default)("PipelineBareFunction",{builder:["callee"],visitor:["callee"],fields:{callee:{validate:(0, Z.assertNodeType)("Expression")}},aliases:["Expression"]});(0, Z.default)("PipelinePrimaryTopicReference",{aliases:["Expression"]});});var xl=A(()=>{var O=qe(),dl=ys(),pS=Et(),Y=(0, O.defineAliasedType)("TypeScript"),Ae=(0, O.assertValueType)("boolean"),hl=()=>({returnType:{validate:(0, O.assertNodeType)("TSTypeAnnotation","Noop"),optional:!0},typeParameters:{validate:(0, O.assertNodeType)("TSTypeParameterDeclaration","Noop"),optional:!0}});Y("TSParameterProperty",{aliases:["LVal"],visitor:["parameter"],fields:{accessibility:{validate:(0, O.assertOneOf)("public","private","protected"),optional:!0},readonly:{validate:(0, O.assertValueType)("boolean"),optional:!0},parameter:{validate:(0, O.assertNodeType)("Identifier","AssignmentPattern")},override:{validate:(0, O.assertValueType)("boolean"),optional:!0},decorators:{validate:(0, O.chain)((0, O.assertValueType)("array"),(0, O.assertEach)((0, O.assertNodeType)("Decorator"))),optional:!0}}});Y("TSDeclareFunction",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","params","returnType"],fields:Object.assign({},(0, dl.functionDeclarationCommon)(),hl())});Y("TSDeclareMethod",{visitor:["decorators","key","typeParameters","params","returnType"],fields:Object.assign({},(0, dl.classMethodOrDeclareMethodCommon)(),hl())});Y("TSQualifiedName",{aliases:["TSEntityName"],visitor:["left","right"],fields:{left:(0, O.validateType)("TSEntityName"),right:(0, O.validateType)("Identifier")}});var qr=()=>({typeParameters:(0, O.validateOptionalType)("TSTypeParameterDeclaration"),parameters:(0, O.validateArrayOfType)(["ArrayPattern","Identifier","ObjectPattern","RestElement"]),typeAnnotation:(0, O.validateOptionalType)("TSTypeAnnotation")}),yl={aliases:["TSTypeElement"],visitor:["typeParameters","parameters","typeAnnotation"],fields:qr()};Y("TSCallSignatureDeclaration",yl);Y("TSConstructSignatureDeclaration",yl);var ml=()=>({key:(0, O.validateType)("Expression"),computed:{default:!1},optional:(0, O.validateOptional)(Ae)});Y("TSPropertySignature",{aliases:["TSTypeElement"],visitor:["key","typeAnnotation"],fields:Object.assign({},ml(),{readonly:(0, O.validateOptional)(Ae),typeAnnotation:(0, O.validateOptionalType)("TSTypeAnnotation"),kind:{validate:(0, O.assertOneOf)("get","set")}})});Y("TSMethodSignature",{aliases:["TSTypeElement"],visitor:["key","typeParameters","parameters","typeAnnotation"],fields:Object.assign({},qr(),ml(),{kind:{validate:(0, O.assertOneOf)("method","get","set")}})});Y("TSIndexSignature",{aliases:["TSTypeElement"],visitor:["parameters","typeAnnotation"],fields:{readonly:(0, O.validateOptional)(Ae),static:(0, O.validateOptional)(Ae),parameters:(0, O.validateArrayOfType)("Identifier"),typeAnnotation:(0, O.validateOptionalType)("TSTypeAnnotation")}});var fS=["TSAnyKeyword","TSBooleanKeyword","TSBigIntKeyword","TSIntrinsicKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"];for(let t of fS)Y(t,{aliases:["TSType","TSBaseType"],visitor:[],fields:{}});Y("TSThisType",{aliases:["TSType","TSBaseType"],visitor:[],fields:{}});var Tl={aliases:["TSType"],visitor:["typeParameters","parameters","typeAnnotation"]};Y("TSFunctionType",Object.assign({},Tl,{fields:qr()}));Y("TSConstructorType",Object.assign({},Tl,{fields:Object.assign({},qr(),{abstract:(0, O.validateOptional)(Ae)})}));Y("TSTypeReference",{aliases:["TSType"],visitor:["typeName","typeParameters"],fields:{typeName:(0, O.validateType)("TSEntityName"),typeParameters:(0, O.validateOptionalType)("TSTypeParameterInstantiation")}});Y("TSTypePredicate",{aliases:["TSType"],visitor:["parameterName","typeAnnotation"],builder:["parameterName","typeAnnotation","asserts"],fields:{parameterName:(0, O.validateType)(["Identifier","TSThisType"]),typeAnnotation:(0, O.validateOptionalType)("TSTypeAnnotation"),asserts:(0, O.validateOptional)(Ae)}});Y("TSTypeQuery",{aliases:["TSType"],visitor:["exprName","typeParameters"],fields:{exprName:(0, O.validateType)(["TSEntityName","TSImportType"]),typeParameters:(0, O.validateOptionalType)("TSTypeParameterInstantiation")}});Y("TSTypeLiteral",{aliases:["TSType"],visitor:["members"],fields:{members:(0, O.validateArrayOfType)("TSTypeElement")}});Y("TSArrayType",{aliases:["TSType"],visitor:["elementType"],fields:{elementType:(0, O.validateType)("TSType")}});Y("TSTupleType",{aliases:["TSType"],visitor:["elementTypes"],fields:{elementTypes:(0, O.validateArrayOfType)(["TSType","TSNamedTupleMember"])}});Y("TSOptionalType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0, O.validateType)("TSType")}});Y("TSRestType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0, O.validateType)("TSType")}});Y("TSNamedTupleMember",{visitor:["label","elementType"],builder:["label","elementType","optional"],fields:{label:(0, O.validateType)("Identifier"),optional:{validate:Ae,default:!1},elementType:(0, O.validateType)("TSType")}});var bl={aliases:["TSType"],visitor:["types"],fields:{types:(0, O.validateArrayOfType)("TSType")}};Y("TSUnionType",bl);Y("TSIntersectionType",bl);Y("TSConditionalType",{aliases:["TSType"],visitor:["checkType","extendsType","trueType","falseType"],fields:{checkType:(0, O.validateType)("TSType"),extendsType:(0, O.validateType)("TSType"),trueType:(0, O.validateType)("TSType"),falseType:(0, O.validateType)("TSType")}});Y("TSInferType",{aliases:["TSType"],visitor:["typeParameter"],fields:{typeParameter:(0, O.validateType)("TSTypeParameter")}});Y("TSParenthesizedType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0, O.validateType)("TSType")}});Y("TSTypeOperator",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{operator:(0, O.validate)((0, O.assertValueType)("string")),typeAnnotation:(0, O.validateType)("TSType")}});Y("TSIndexedAccessType",{aliases:["TSType"],visitor:["objectType","indexType"],fields:{objectType:(0, O.validateType)("TSType"),indexType:(0, O.validateType)("TSType")}});Y("TSMappedType",{aliases:["TSType"],visitor:["typeParameter","typeAnnotation","nameType"],fields:{readonly:(0, O.validateOptional)((0, O.assertOneOf)(!0,!1,"+","-")),typeParameter:(0, O.validateType)("TSTypeParameter"),optional:(0, O.validateOptional)((0, O.assertOneOf)(!0,!1,"+","-")),typeAnnotation:(0, O.validateOptionalType)("TSType"),nameType:(0, O.validateOptionalType)("TSType")}});Y("TSLiteralType",{aliases:["TSType","TSBaseType"],visitor:["literal"],fields:{literal:{validate:function(){let t=(0, O.assertNodeType)("NumericLiteral","BigIntLiteral"),e=(0, O.assertOneOf)("-"),r=(0, O.assertNodeType)("NumericLiteral","StringLiteral","BooleanLiteral","BigIntLiteral","TemplateLiteral");function i(s,a,n){(0, pS.default)("UnaryExpression",n)?(e(n,"operator",n.operator),t(n,"argument",n.argument)):r(s,a,n);}return i.oneOfNodeTypes=["NumericLiteral","StringLiteral","BooleanLiteral","BigIntLiteral","TemplateLiteral","UnaryExpression"],i}()}}});Y("TSExpressionWithTypeArguments",{aliases:["TSType"],visitor:["expression","typeParameters"],fields:{expression:(0, O.validateType)("TSEntityName"),typeParameters:(0, O.validateOptionalType)("TSTypeParameterInstantiation")}});Y("TSInterfaceDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","extends","body"],fields:{declare:(0, O.validateOptional)(Ae),id:(0, O.validateType)("Identifier"),typeParameters:(0, O.validateOptionalType)("TSTypeParameterDeclaration"),extends:(0, O.validateOptional)((0, O.arrayOfType)("TSExpressionWithTypeArguments")),body:(0, O.validateType)("TSInterfaceBody")}});Y("TSInterfaceBody",{visitor:["body"],fields:{body:(0, O.validateArrayOfType)("TSTypeElement")}});Y("TSTypeAliasDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","typeAnnotation"],fields:{declare:(0, O.validateOptional)(Ae),id:(0, O.validateType)("Identifier"),typeParameters:(0, O.validateOptionalType)("TSTypeParameterDeclaration"),typeAnnotation:(0, O.validateType)("TSType")}});Y("TSInstantiationExpression",{aliases:["Expression"],visitor:["expression","typeParameters"],fields:{expression:(0, O.validateType)("Expression"),typeParameters:(0, O.validateOptionalType)("TSTypeParameterInstantiation")}});var Sl={aliases:["Expression","LVal","PatternLike"],visitor:["expression","typeAnnotation"],fields:{expression:(0, O.validateType)("Expression"),typeAnnotation:(0, O.validateType)("TSType")}};Y("TSAsExpression",Sl);Y("TSSatisfiesExpression",Sl);Y("TSTypeAssertion",{aliases:["Expression","LVal","PatternLike"],visitor:["typeAnnotation","expression"],fields:{typeAnnotation:(0, O.validateType)("TSType"),expression:(0, O.validateType)("Expression")}});Y("TSEnumDeclaration",{aliases:["Statement","Declaration"],visitor:["id","members"],fields:{declare:(0, O.validateOptional)(Ae),const:(0, O.validateOptional)(Ae),id:(0, O.validateType)("Identifier"),members:(0, O.validateArrayOfType)("TSEnumMember"),initializer:(0, O.validateOptionalType)("Expression")}});Y("TSEnumMember",{visitor:["id","initializer"],fields:{id:(0, O.validateType)(["Identifier","StringLiteral"]),initializer:(0, O.validateOptionalType)("Expression")}});Y("TSModuleDeclaration",{aliases:["Statement","Declaration"],visitor:["id","body"],fields:{declare:(0, O.validateOptional)(Ae),global:(0, O.validateOptional)(Ae),id:(0, O.validateType)(["Identifier","StringLiteral"]),body:(0, O.validateType)(["TSModuleBlock","TSModuleDeclaration"])}});Y("TSModuleBlock",{aliases:["Scopable","Block","BlockParent","FunctionParent"],visitor:["body"],fields:{body:(0, O.validateArrayOfType)("Statement")}});Y("TSImportType",{aliases:["TSType"],visitor:["argument","qualifier","typeParameters"],fields:{argument:(0, O.validateType)("StringLiteral"),qualifier:(0, O.validateOptionalType)("TSEntityName"),typeParameters:(0, O.validateOptionalType)("TSTypeParameterInstantiation")}});Y("TSImportEqualsDeclaration",{aliases:["Statement"],visitor:["id","moduleReference"],fields:{isExport:(0, O.validate)(Ae),id:(0, O.validateType)("Identifier"),moduleReference:(0, O.validateType)(["TSEntityName","TSExternalModuleReference"]),importKind:{validate:(0, O.assertOneOf)("type","value"),optional:!0}}});Y("TSExternalModuleReference",{visitor:["expression"],fields:{expression:(0, O.validateType)("StringLiteral")}});Y("TSNonNullExpression",{aliases:["Expression","LVal","PatternLike"],visitor:["expression"],fields:{expression:(0, O.validateType)("Expression")}});Y("TSExportAssignment",{aliases:["Statement"],visitor:["expression"],fields:{expression:(0, O.validateType)("Expression")}});Y("TSNamespaceExportDeclaration",{aliases:["Statement"],visitor:["id"],fields:{id:(0, O.validateType)("Identifier")}});Y("TSTypeAnnotation",{visitor:["typeAnnotation"],fields:{typeAnnotation:{validate:(0, O.assertNodeType)("TSType")}}});Y("TSTypeParameterInstantiation",{visitor:["params"],fields:{params:{validate:(0, O.chain)((0, O.assertValueType)("array"),(0, O.assertEach)((0, O.assertNodeType)("TSType")))}}});Y("TSTypeParameterDeclaration",{visitor:["params"],fields:{params:{validate:(0, O.chain)((0, O.assertValueType)("array"),(0, O.assertEach)((0, O.assertNodeType)("TSTypeParameter")))}}});Y("TSTypeParameter",{builder:["constraint","default","name"],visitor:["constraint","default"],fields:{name:{validate:(0, O.assertValueType)("string")},in:{validate:(0, O.assertValueType)("boolean"),optional:!0},out:{validate:(0, O.assertValueType)("boolean"),optional:!0},const:{validate:(0, O.assertValueType)("boolean"),optional:!0},constraint:{validate:(0, O.assertNodeType)("TSType"),optional:!0},default:{validate:(0, O.assertNodeType)("TSType"),optional:!0}}});});var Pl=A(Kr=>{Object.defineProperty(Kr,"__esModule",{value:!0});Kr.DEPRECATED_ALIASES=void 0;Kr.DEPRECATED_ALIASES={ModuleDeclaration:"ImportOrExportDeclaration"};});var De=A(Te=>{Object.defineProperty(Te,"__esModule",{value:!0});Object.defineProperty(Te,"ALIAS_KEYS",{enumerable:!0,get:function(){return pe.ALIAS_KEYS}});Object.defineProperty(Te,"BUILDER_KEYS",{enumerable:!0,get:function(){return pe.BUILDER_KEYS}});Object.defineProperty(Te,"DEPRECATED_ALIASES",{enumerable:!0,get:function(){return Ps.DEPRECATED_ALIASES}});Object.defineProperty(Te,"DEPRECATED_KEYS",{enumerable:!0,get:function(){return pe.DEPRECATED_KEYS}});Object.defineProperty(Te,"FLIPPED_ALIAS_KEYS",{enumerable:!0,get:function(){return pe.FLIPPED_ALIAS_KEYS}});Object.defineProperty(Te,"NODE_FIELDS",{enumerable:!0,get:function(){return pe.NODE_FIELDS}});Object.defineProperty(Te,"NODE_PARENT_VALIDATIONS",{enumerable:!0,get:function(){return pe.NODE_PARENT_VALIDATIONS}});Object.defineProperty(Te,"PLACEHOLDERS",{enumerable:!0,get:function(){return Zt.PLACEHOLDERS}});Object.defineProperty(Te,"PLACEHOLDERS_ALIAS",{enumerable:!0,get:function(){return Zt.PLACEHOLDERS_ALIAS}});Object.defineProperty(Te,"PLACEHOLDERS_FLIPPED_ALIAS",{enumerable:!0,get:function(){return Zt.PLACEHOLDERS_FLIPPED_ALIAS}});Te.TYPES=void 0;Object.defineProperty(Te,"VISITOR_KEYS",{enumerable:!0,get:function(){return pe.VISITOR_KEYS}});var Ze=Ro();ys();ul();cl();pl();fl();xl();var pe=qe(),Zt=Ss(),Ps=Pl();Object.keys(Ps.DEPRECATED_ALIASES).forEach(t=>{pe.FLIPPED_ALIAS_KEYS[t]=pe.FLIPPED_ALIAS_KEYS[Ps.DEPRECATED_ALIASES[t]];});Ze(pe.VISITOR_KEYS);Ze(pe.ALIAS_KEYS);Ze(pe.FLIPPED_ALIAS_KEYS);Ze(pe.NODE_FIELDS);Ze(pe.BUILDER_KEYS);Ze(pe.DEPRECATED_KEYS);Ze(Zt.PLACEHOLDERS_ALIAS);Ze(Zt.PLACEHOLDERS_FLIPPED_ALIAS);Te.TYPES=[].concat(Object.keys(pe.VISITOR_KEYS),Object.keys(pe.FLIPPED_ALIAS_KEYS),Object.keys(pe.DEPRECATED_KEYS));});var Fr=A(er=>{Object.defineProperty(er,"__esModule",{value:!0});er.default=dS;er.validateChild=Al;er.validateField=gl;var El=De();function dS(t,e,r){if(!t)return;let i=El.NODE_FIELDS[t.type];if(!i)return;let s=i[e];gl(t,e,r,s),Al(t,e,r);}function gl(t,e,r,i){i!=null&&i.validate&&(i.optional&&r==null||i.validate(t,e,r));}function Al(t,e,r){if(r==null)return;let i=El.NODE_PARENT_VALIDATIONS[r.type];i&&i(t,e,r);}});var vl=A(Es=>{Object.defineProperty(Es,"__esModule",{value:!0});Es.default=mS;var hS=Fr(),yS=ve();function mS(t){let e=yS.BUILDER_KEYS[t.type];for(let r of e)(0, hS.default)(t,r,t[r]);return t}});var be=A(f=>{Object.defineProperty(f,"__esModule",{value:!0});f.anyTypeAnnotation=$x;f.argumentPlaceholder=EE;f.arrayExpression=TS;f.arrayPattern=fx;f.arrayTypeAnnotation=Wx;f.arrowFunctionExpression=dx;f.assignmentExpression=bS;f.assignmentPattern=px;f.awaitExpression=Mx;f.bigIntLiteral=Bx;f.binaryExpression=SS;f.bindExpression=gE;f.blockStatement=gS;f.booleanLiteral=VS;f.booleanLiteralTypeAnnotation=Hx;f.booleanTypeAnnotation=zx;f.breakStatement=AS;f.callExpression=vS;f.catchClause=IS;f.classAccessorProperty=Kx;f.classBody=hx;f.classDeclaration=mx;f.classExpression=yx;f.classImplements=Qx;f.classMethod=Ox;f.classPrivateMethod=Yx;f.classPrivateProperty=Vx;f.classProperty=qx;f.conditionalExpression=wS;f.continueStatement=OS;f.debuggerStatement=NS;f.decimalLiteral=CE;f.declareClass=Zx;f.declareExportAllDeclaration=lP;f.declareExportDeclaration=oP;f.declareFunction=eP;f.declareInterface=tP;f.declareModule=rP;f.declareModuleExports=iP;f.declareOpaqueType=aP;f.declareTypeAlias=sP;f.declareVariable=nP;f.declaredPredicate=uP;f.decorator=vE;f.directive=PS;f.directiveLiteral=ES;f.doExpression=IE;f.doWhileStatement=CS;f.emptyStatement=DS;f.emptyTypeAnnotation=xP;f.enumBooleanBody=WP;f.enumBooleanMember=QP;f.enumDeclaration=$P;f.enumDefaultedMember=tE;f.enumNumberBody=zP;f.enumNumberMember=ZP;f.enumStringBody=HP;f.enumStringMember=eE;f.enumSymbolBody=GP;f.existsTypeAnnotation=cP;f.exportAllDeclaration=Tx;f.exportDefaultDeclaration=bx;f.exportDefaultSpecifier=wE;f.exportNamedDeclaration=Sx;f.exportNamespaceSpecifier=Fx;f.exportSpecifier=xx;f.expressionStatement=LS;f.file=kS;f.forInStatement=_S;f.forOfStatement=Px;f.forStatement=MS;f.functionDeclaration=jS;f.functionExpression=BS;f.functionTypeAnnotation=pP;f.functionTypeParam=fP;f.genericTypeAnnotation=dP;f.identifier=FS;f.ifStatement=RS;f.import=jx;f.importAttribute=AE;f.importDeclaration=Ex;f.importDefaultSpecifier=gx;f.importExpression=Ix;f.importNamespaceSpecifier=Ax;f.importSpecifier=vx;f.indexedAccessType=rE;f.inferredPredicate=hP;f.interfaceDeclaration=mP;f.interfaceExtends=yP;f.interfaceTypeAnnotation=TP;f.interpreterDirective=xS;f.intersectionTypeAnnotation=bP;f.jSXAttribute=f.jsxAttribute=sE;f.jSXClosingElement=f.jsxClosingElement=aE;f.jSXClosingFragment=f.jsxClosingFragment=bE;f.jSXElement=f.jsxElement=nE;f.jSXEmptyExpression=f.jsxEmptyExpression=oE;f.jSXExpressionContainer=f.jsxExpressionContainer=lE;f.jSXFragment=f.jsxFragment=mE;f.jSXIdentifier=f.jsxIdentifier=cE;f.jSXMemberExpression=f.jsxMemberExpression=pE;f.jSXNamespacedName=f.jsxNamespacedName=fE;f.jSXOpeningElement=f.jsxOpeningElement=dE;f.jSXOpeningFragment=f.jsxOpeningFragment=TE;f.jSXSpreadAttribute=f.jsxSpreadAttribute=hE;f.jSXSpreadChild=f.jsxSpreadChild=uE;f.jSXText=f.jsxText=yE;f.labeledStatement=US;f.logicalExpression=YS;f.memberExpression=XS;f.metaProperty=wx;f.mixedTypeAnnotation=SP;f.moduleExpression=DE;f.newExpression=JS;f.noop=SE;f.nullLiteral=KS;f.nullLiteralTypeAnnotation=Gx;f.nullableTypeAnnotation=PP;f.numberLiteral=$g;f.numberLiteralTypeAnnotation=EP;f.numberTypeAnnotation=gP;f.numericLiteral=Il;f.objectExpression=WS;f.objectMethod=zS;f.objectPattern=Nx;f.objectProperty=HS;f.objectTypeAnnotation=AP;f.objectTypeCallProperty=IP;f.objectTypeIndexer=wP;f.objectTypeInternalSlot=vP;f.objectTypeProperty=OP;f.objectTypeSpreadProperty=NP;f.opaqueType=CP;f.optionalCallExpression=Ux;f.optionalIndexedAccessType=iE;f.optionalMemberExpression=Rx;f.parenthesizedExpression=ZS;f.pipelineBareFunction=_E;f.pipelinePrimaryTopicReference=ME;f.pipelineTopicExpression=kE;f.placeholder=xE;f.privateName=Xx;f.program=$S;f.qualifiedTypeIdentifier=DP;f.recordExpression=OE;f.regExpLiteral=wl;f.regexLiteral=Wg;f.restElement=Ol;f.restProperty=zg;f.returnStatement=GS;f.sequenceExpression=QS;f.spreadElement=Nl;f.spreadProperty=Hg;f.staticBlock=Jx;f.stringLiteral=qS;f.stringLiteralTypeAnnotation=LP;f.stringTypeAnnotation=kP;f.super=Cx;f.switchCase=ex;f.switchStatement=tx;f.symbolTypeAnnotation=_P;f.taggedTemplateExpression=Dx;f.templateElement=Lx;f.templateLiteral=kx;f.thisExpression=rx;f.thisTypeAnnotation=MP;f.throwStatement=ix;f.topicReference=LE;f.tryStatement=sx;f.tSAnyKeyword=f.tsAnyKeyword=XE;f.tSArrayType=f.tsArrayType=pg;f.tSAsExpression=f.tsAsExpression=Cg;f.tSBigIntKeyword=f.tsBigIntKeyword=$E;f.tSBooleanKeyword=f.tsBooleanKeyword=JE;f.tSCallSignatureDeclaration=f.tsCallSignatureDeclaration=UE;f.tSConditionalType=f.tsConditionalType=bg;f.tSConstructSignatureDeclaration=f.tsConstructSignatureDeclaration=qE;f.tSConstructorType=f.tsConstructorType=ng;f.tSDeclareFunction=f.tsDeclareFunction=BE;f.tSDeclareMethod=f.tsDeclareMethod=FE;f.tSEnumDeclaration=f.tsEnumDeclaration=kg;f.tSEnumMember=f.tsEnumMember=_g;f.tSExportAssignment=f.tsExportAssignment=qg;f.tSExpressionWithTypeArguments=f.tsExpressionWithTypeArguments=vg;f.tSExternalModuleReference=f.tsExternalModuleReference=Rg;f.tSFunctionType=f.tsFunctionType=ag;f.tSImportEqualsDeclaration=f.tsImportEqualsDeclaration=Fg;f.tSImportType=f.tsImportType=Bg;f.tSIndexSignature=f.tsIndexSignature=YE;f.tSIndexedAccessType=f.tsIndexedAccessType=Eg;f.tSInferType=f.tsInferType=Sg;f.tSInstantiationExpression=f.tsInstantiationExpression=Ng;f.tSInterfaceBody=f.tsInterfaceBody=wg;f.tSInterfaceDeclaration=f.tsInterfaceDeclaration=Ig;f.tSIntersectionType=f.tsIntersectionType=Tg;f.tSIntrinsicKeyword=f.tsIntrinsicKeyword=WE;f.tSLiteralType=f.tsLiteralType=Ag;f.tSMappedType=f.tsMappedType=gg;f.tSMethodSignature=f.tsMethodSignature=VE;f.tSModuleBlock=f.tsModuleBlock=jg;f.tSModuleDeclaration=f.tsModuleDeclaration=Mg;f.tSNamedTupleMember=f.tsNamedTupleMember=yg;f.tSNamespaceExportDeclaration=f.tsNamespaceExportDeclaration=Kg;f.tSNeverKeyword=f.tsNeverKeyword=zE;f.tSNonNullExpression=f.tsNonNullExpression=Ug;f.tSNullKeyword=f.tsNullKeyword=HE;f.tSNumberKeyword=f.tsNumberKeyword=GE;f.tSObjectKeyword=f.tsObjectKeyword=QE;f.tSOptionalType=f.tsOptionalType=dg;f.tSParameterProperty=f.tsParameterProperty=jE;f.tSParenthesizedType=f.tsParenthesizedType=xg;f.tSPropertySignature=f.tsPropertySignature=KE;f.tSQualifiedName=f.tsQualifiedName=RE;f.tSRestType=f.tsRestType=hg;f.tSSatisfiesExpression=f.tsSatisfiesExpression=Dg;f.tSStringKeyword=f.tsStringKeyword=ZE;f.tSSymbolKeyword=f.tsSymbolKeyword=eg;f.tSThisType=f.tsThisType=sg;f.tSTupleType=f.tsTupleType=fg;f.tSTypeAliasDeclaration=f.tsTypeAliasDeclaration=Og;f.tSTypeAnnotation=f.tsTypeAnnotation=Vg;f.tSTypeAssertion=f.tsTypeAssertion=Lg;f.tSTypeLiteral=f.tsTypeLiteral=cg;f.tSTypeOperator=f.tsTypeOperator=Pg;f.tSTypeParameter=f.tsTypeParameter=Jg;f.tSTypeParameterDeclaration=f.tsTypeParameterDeclaration=Xg;f.tSTypeParameterInstantiation=f.tsTypeParameterInstantiation=Yg;f.tSTypePredicate=f.tsTypePredicate=lg;f.tSTypeQuery=f.tsTypeQuery=ug;f.tSTypeReference=f.tsTypeReference=og;f.tSUndefinedKeyword=f.tsUndefinedKeyword=tg;f.tSUnionType=f.tsUnionType=mg;f.tSUnknownKeyword=f.tsUnknownKeyword=rg;f.tSVoidKeyword=f.tsVoidKeyword=ig;f.tupleExpression=NE;f.tupleTypeAnnotation=jP;f.typeAlias=FP;f.typeAnnotation=RP;f.typeCastExpression=UP;f.typeParameter=qP;f.typeParameterDeclaration=KP;f.typeParameterInstantiation=VP;f.typeofTypeAnnotation=BP;f.unaryExpression=ax;f.unionTypeAnnotation=YP;f.updateExpression=nx;f.v8IntrinsicIdentifier=PE;f.variableDeclaration=ox;f.variableDeclarator=lx;f.variance=XP;f.voidTypeAnnotation=JP;f.whileStatement=ux;f.withStatement=cx;f.yieldExpression=_x;var P=vl(),Vr=Vt();function TS(t=[]){return (0, P.default)({type:"ArrayExpression",elements:t})}function bS(t,e,r){return (0, P.default)({type:"AssignmentExpression",operator:t,left:e,right:r})}function SS(t,e,r){return (0, P.default)({type:"BinaryExpression",operator:t,left:e,right:r})}function xS(t){return (0, P.default)({type:"InterpreterDirective",value:t})}function PS(t){return (0, P.default)({type:"Directive",value:t})}function ES(t){return (0, P.default)({type:"DirectiveLiteral",value:t})}function gS(t,e=[]){return (0, P.default)({type:"BlockStatement",body:t,directives:e})}function AS(t=null){return (0, P.default)({type:"BreakStatement",label:t})}function vS(t,e){return (0, P.default)({type:"CallExpression",callee:t,arguments:e})}function IS(t=null,e){return (0, P.default)({type:"CatchClause",param:t,body:e})}function wS(t,e,r){return (0, P.default)({type:"ConditionalExpression",test:t,consequent:e,alternate:r})}function OS(t=null){return (0, P.default)({type:"ContinueStatement",label:t})}function NS(){return {type:"DebuggerStatement"}}function CS(t,e){return (0, P.default)({type:"DoWhileStatement",test:t,body:e})}function DS(){return {type:"EmptyStatement"}}function LS(t){return (0, P.default)({type:"ExpressionStatement",expression:t})}function kS(t,e=null,r=null){return (0, P.default)({type:"File",program:t,comments:e,tokens:r})}function _S(t,e,r){return (0, P.default)({type:"ForInStatement",left:t,right:e,body:r})}function MS(t=null,e=null,r=null,i){return (0, P.default)({type:"ForStatement",init:t,test:e,update:r,body:i})}function jS(t=null,e,r,i=!1,s=!1){return (0, P.default)({type:"FunctionDeclaration",id:t,params:e,body:r,generator:i,async:s})}function BS(t=null,e,r,i=!1,s=!1){return (0, P.default)({type:"FunctionExpression",id:t,params:e,body:r,generator:i,async:s})}function FS(t){return (0, P.default)({type:"Identifier",name:t})}function RS(t,e,r=null){return (0, P.default)({type:"IfStatement",test:t,consequent:e,alternate:r})}function US(t,e){return (0, P.default)({type:"LabeledStatement",label:t,body:e})}function qS(t){return (0, P.default)({type:"StringLiteral",value:t})}function Il(t){return (0, P.default)({type:"NumericLiteral",value:t})}function KS(){return {type:"NullLiteral"}}function VS(t){return (0, P.default)({type:"BooleanLiteral",value:t})}function wl(t,e=""){return (0, P.default)({type:"RegExpLiteral",pattern:t,flags:e})}function YS(t,e,r){return (0, P.default)({type:"LogicalExpression",operator:t,left:e,right:r})}function XS(t,e,r=!1,i=null){return (0, P.default)({type:"MemberExpression",object:t,property:e,computed:r,optional:i})}function JS(t,e){return (0, P.default)({type:"NewExpression",callee:t,arguments:e})}function $S(t,e=[],r="script",i=null){return (0, P.default)({type:"Program",body:t,directives:e,sourceType:r,interpreter:i,sourceFile:null})}function WS(t){return (0, P.default)({type:"ObjectExpression",properties:t})}function zS(t="method",e,r,i,s=!1,a=!1,n=!1){return (0, P.default)({type:"ObjectMethod",kind:t,key:e,params:r,body:i,computed:s,generator:a,async:n})}function HS(t,e,r=!1,i=!1,s=null){return (0, P.default)({type:"ObjectProperty",key:t,value:e,computed:r,shorthand:i,decorators:s})}function Ol(t){return (0, P.default)({type:"RestElement",argument:t})}function GS(t=null){return (0, P.default)({type:"ReturnStatement",argument:t})}function QS(t){return (0, P.default)({type:"SequenceExpression",expressions:t})}function ZS(t){return (0, P.default)({type:"ParenthesizedExpression",expression:t})}function ex(t=null,e){return (0, P.default)({type:"SwitchCase",test:t,consequent:e})}function tx(t,e){return (0, P.default)({type:"SwitchStatement",discriminant:t,cases:e})}function rx(){return {type:"ThisExpression"}}function ix(t){return (0, P.default)({type:"ThrowStatement",argument:t})}function sx(t,e=null,r=null){return (0, P.default)({type:"TryStatement",block:t,handler:e,finalizer:r})}function ax(t,e,r=!0){return (0, P.default)({type:"UnaryExpression",operator:t,argument:e,prefix:r})}function nx(t,e,r=!1){return (0, P.default)({type:"UpdateExpression",operator:t,argument:e,prefix:r})}function ox(t,e){return (0, P.default)({type:"VariableDeclaration",kind:t,declarations:e})}function lx(t,e=null){return (0, P.default)({type:"VariableDeclarator",id:t,init:e})}function ux(t,e){return (0, P.default)({type:"WhileStatement",test:t,body:e})}function cx(t,e){return (0, P.default)({type:"WithStatement",object:t,body:e})}function px(t,e){return (0, P.default)({type:"AssignmentPattern",left:t,right:e})}function fx(t){return (0, P.default)({type:"ArrayPattern",elements:t})}function dx(t,e,r=!1){return (0, P.default)({type:"ArrowFunctionExpression",params:t,body:e,async:r,expression:null})}function hx(t){return (0, P.default)({type:"ClassBody",body:t})}function yx(t=null,e=null,r,i=null){return (0, P.default)({type:"ClassExpression",id:t,superClass:e,body:r,decorators:i})}function mx(t=null,e=null,r,i=null){return (0, P.default)({type:"ClassDeclaration",id:t,superClass:e,body:r,decorators:i})}function Tx(t){return (0, P.default)({type:"ExportAllDeclaration",source:t})}function bx(t){return (0, P.default)({type:"ExportDefaultDeclaration",declaration:t})}function Sx(t=null,e=[],r=null){return (0, P.default)({type:"ExportNamedDeclaration",declaration:t,specifiers:e,source:r})}function xx(t,e){return (0, P.default)({type:"ExportSpecifier",local:t,exported:e})}function Px(t,e,r,i=!1){return (0, P.default)({type:"ForOfStatement",left:t,right:e,body:r,await:i})}function Ex(t,e){return (0, P.default)({type:"ImportDeclaration",specifiers:t,source:e})}function gx(t){return (0, P.default)({type:"ImportDefaultSpecifier",local:t})}function Ax(t){return (0, P.default)({type:"ImportNamespaceSpecifier",local:t})}function vx(t,e){return (0, P.default)({type:"ImportSpecifier",local:t,imported:e})}function Ix(t,e=null){return (0, P.default)({type:"ImportExpression",source:t,options:e})}function wx(t,e){return (0, P.default)({type:"MetaProperty",meta:t,property:e})}function Ox(t="method",e,r,i,s=!1,a=!1,n=!1,o=!1){return (0, P.default)({type:"ClassMethod",kind:t,key:e,params:r,body:i,computed:s,static:a,generator:n,async:o})}function Nx(t){return (0, P.default)({type:"ObjectPattern",properties:t})}function Nl(t){return (0, P.default)({type:"SpreadElement",argument:t})}function Cx(){return {type:"Super"}}function Dx(t,e){return (0, P.default)({type:"TaggedTemplateExpression",tag:t,quasi:e})}function Lx(t,e=!1){return (0, P.default)({type:"TemplateElement",value:t,tail:e})}function kx(t,e){return (0, P.default)({type:"TemplateLiteral",quasis:t,expressions:e})}function _x(t=null,e=!1){return (0, P.default)({type:"YieldExpression",argument:t,delegate:e})}function Mx(t){return (0, P.default)({type:"AwaitExpression",argument:t})}function jx(){return {type:"Import"}}function Bx(t){return (0, P.default)({type:"BigIntLiteral",value:t})}function Fx(t){return (0, P.default)({type:"ExportNamespaceSpecifier",exported:t})}function Rx(t,e,r=!1,i){return (0, P.default)({type:"OptionalMemberExpression",object:t,property:e,computed:r,optional:i})}function Ux(t,e,r){return (0, P.default)({type:"OptionalCallExpression",callee:t,arguments:e,optional:r})}function qx(t,e=null,r=null,i=null,s=!1,a=!1){return (0, P.default)({type:"ClassProperty",key:t,value:e,typeAnnotation:r,decorators:i,computed:s,static:a})}function Kx(t,e=null,r=null,i=null,s=!1,a=!1){return (0, P.default)({type:"ClassAccessorProperty",key:t,value:e,typeAnnotation:r,decorators:i,computed:s,static:a})}function Vx(t,e=null,r=null,i=!1){return (0, P.default)({type:"ClassPrivateProperty",key:t,value:e,decorators:r,static:i})}function Yx(t="method",e,r,i,s=!1){return (0, P.default)({type:"ClassPrivateMethod",kind:t,key:e,params:r,body:i,static:s})}function Xx(t){return (0, P.default)({type:"PrivateName",id:t})}function Jx(t){return (0, P.default)({type:"StaticBlock",body:t})}function $x(){return {type:"AnyTypeAnnotation"}}function Wx(t){return (0, P.default)({type:"ArrayTypeAnnotation",elementType:t})}function zx(){return {type:"BooleanTypeAnnotation"}}function Hx(t){return (0, P.default)({type:"BooleanLiteralTypeAnnotation",value:t})}function Gx(){return {type:"NullLiteralTypeAnnotation"}}function Qx(t,e=null){return (0, P.default)({type:"ClassImplements",id:t,typeParameters:e})}function Zx(t,e=null,r=null,i){return (0, P.default)({type:"DeclareClass",id:t,typeParameters:e,extends:r,body:i})}function eP(t){return (0, P.default)({type:"DeclareFunction",id:t})}function tP(t,e=null,r=null,i){return (0, P.default)({type:"DeclareInterface",id:t,typeParameters:e,extends:r,body:i})}function rP(t,e,r=null){return (0, P.default)({type:"DeclareModule",id:t,body:e,kind:r})}function iP(t){return (0, P.default)({type:"DeclareModuleExports",typeAnnotation:t})}function sP(t,e=null,r){return (0, P.default)({type:"DeclareTypeAlias",id:t,typeParameters:e,right:r})}function aP(t,e=null,r=null){return (0, P.default)({type:"DeclareOpaqueType",id:t,typeParameters:e,supertype:r})}function nP(t){return (0, P.default)({type:"DeclareVariable",id:t})}function oP(t=null,e=null,r=null){return (0, P.default)({type:"DeclareExportDeclaration",declaration:t,specifiers:e,source:r})}function lP(t){return (0, P.default)({type:"DeclareExportAllDeclaration",source:t})}function uP(t){return (0, P.default)({type:"DeclaredPredicate",value:t})}function cP(){return {type:"ExistsTypeAnnotation"}}function pP(t=null,e,r=null,i){return (0, P.default)({type:"FunctionTypeAnnotation",typeParameters:t,params:e,rest:r,returnType:i})}function fP(t=null,e){return (0, P.default)({type:"FunctionTypeParam",name:t,typeAnnotation:e})}function dP(t,e=null){return (0, P.default)({type:"GenericTypeAnnotation",id:t,typeParameters:e})}function hP(){return {type:"InferredPredicate"}}function yP(t,e=null){return (0, P.default)({type:"InterfaceExtends",id:t,typeParameters:e})}function mP(t,e=null,r=null,i){return (0, P.default)({type:"InterfaceDeclaration",id:t,typeParameters:e,extends:r,body:i})}function TP(t=null,e){return (0, P.default)({type:"InterfaceTypeAnnotation",extends:t,body:e})}function bP(t){return (0, P.default)({type:"IntersectionTypeAnnotation",types:t})}function SP(){return {type:"MixedTypeAnnotation"}}function xP(){return {type:"EmptyTypeAnnotation"}}function PP(t){return (0, P.default)({type:"NullableTypeAnnotation",typeAnnotation:t})}function EP(t){return (0, P.default)({type:"NumberLiteralTypeAnnotation",value:t})}function gP(){return {type:"NumberTypeAnnotation"}}function AP(t,e=[],r=[],i=[],s=!1){return (0, P.default)({type:"ObjectTypeAnnotation",properties:t,indexers:e,callProperties:r,internalSlots:i,exact:s})}function vP(t,e,r,i,s){return (0, P.default)({type:"ObjectTypeInternalSlot",id:t,value:e,optional:r,static:i,method:s})}function IP(t){return (0, P.default)({type:"ObjectTypeCallProperty",value:t,static:null})}function wP(t=null,e,r,i=null){return (0, P.default)({type:"ObjectTypeIndexer",id:t,key:e,value:r,variance:i,static:null})}function OP(t,e,r=null){return (0, P.default)({type:"ObjectTypeProperty",key:t,value:e,variance:r,kind:null,method:null,optional:null,proto:null,static:null})}function NP(t){return (0, P.default)({type:"ObjectTypeSpreadProperty",argument:t})}function CP(t,e=null,r=null,i){return (0, P.default)({type:"OpaqueType",id:t,typeParameters:e,supertype:r,impltype:i})}function DP(t,e){return (0, P.default)({type:"QualifiedTypeIdentifier",id:t,qualification:e})}function LP(t){return (0, P.default)({type:"StringLiteralTypeAnnotation",value:t})}function kP(){return {type:"StringTypeAnnotation"}}function _P(){return {type:"SymbolTypeAnnotation"}}function MP(){return {type:"ThisTypeAnnotation"}}function jP(t){return (0, P.default)({type:"TupleTypeAnnotation",types:t})}function BP(t){return (0, P.default)({type:"TypeofTypeAnnotation",argument:t})}function FP(t,e=null,r){return (0, P.default)({type:"TypeAlias",id:t,typeParameters:e,right:r})}function RP(t){return (0, P.default)({type:"TypeAnnotation",typeAnnotation:t})}function UP(t,e){return (0, P.default)({type:"TypeCastExpression",expression:t,typeAnnotation:e})}function qP(t=null,e=null,r=null){return (0, P.default)({type:"TypeParameter",bound:t,default:e,variance:r,name:null})}function KP(t){return (0, P.default)({type:"TypeParameterDeclaration",params:t})}function VP(t){return (0, P.default)({type:"TypeParameterInstantiation",params:t})}function YP(t){return (0, P.default)({type:"UnionTypeAnnotation",types:t})}function XP(t){return (0, P.default)({type:"Variance",kind:t})}function JP(){return {type:"VoidTypeAnnotation"}}function $P(t,e){return (0, P.default)({type:"EnumDeclaration",id:t,body:e})}function WP(t){return (0, P.default)({type:"EnumBooleanBody",members:t,explicitType:null,hasUnknownMembers:null})}function zP(t){return (0, P.default)({type:"EnumNumberBody",members:t,explicitType:null,hasUnknownMembers:null})}function HP(t){return (0, P.default)({type:"EnumStringBody",members:t,explicitType:null,hasUnknownMembers:null})}function GP(t){return (0, P.default)({type:"EnumSymbolBody",members:t,hasUnknownMembers:null})}function QP(t){return (0, P.default)({type:"EnumBooleanMember",id:t,init:null})}function ZP(t,e){return (0, P.default)({type:"EnumNumberMember",id:t,init:e})}function eE(t,e){return (0, P.default)({type:"EnumStringMember",id:t,init:e})}function tE(t){return (0, P.default)({type:"EnumDefaultedMember",id:t})}function rE(t,e){return (0, P.default)({type:"IndexedAccessType",objectType:t,indexType:e})}function iE(t,e){return (0, P.default)({type:"OptionalIndexedAccessType",objectType:t,indexType:e,optional:null})}function sE(t,e=null){return (0, P.default)({type:"JSXAttribute",name:t,value:e})}function aE(t){return (0, P.default)({type:"JSXClosingElement",name:t})}function nE(t,e=null,r,i=null){return (0, P.default)({type:"JSXElement",openingElement:t,closingElement:e,children:r,selfClosing:i})}function oE(){return {type:"JSXEmptyExpression"}}function lE(t){return (0, P.default)({type:"JSXExpressionContainer",expression:t})}function uE(t){return (0, P.default)({type:"JSXSpreadChild",expression:t})}function cE(t){return (0, P.default)({type:"JSXIdentifier",name:t})}function pE(t,e){return (0, P.default)({type:"JSXMemberExpression",object:t,property:e})}function fE(t,e){return (0, P.default)({type:"JSXNamespacedName",namespace:t,name:e})}function dE(t,e,r=!1){return (0, P.default)({type:"JSXOpeningElement",name:t,attributes:e,selfClosing:r})}function hE(t){return (0, P.default)({type:"JSXSpreadAttribute",argument:t})}function yE(t){return (0, P.default)({type:"JSXText",value:t})}function mE(t,e,r){return (0, P.default)({type:"JSXFragment",openingFragment:t,closingFragment:e,children:r})}function TE(){return {type:"JSXOpeningFragment"}}function bE(){return {type:"JSXClosingFragment"}}function SE(){return {type:"Noop"}}function xE(t,e){return (0, P.default)({type:"Placeholder",expectedNode:t,name:e})}function PE(t){return (0, P.default)({type:"V8IntrinsicIdentifier",name:t})}function EE(){return {type:"ArgumentPlaceholder"}}function gE(t,e){return (0, P.default)({type:"BindExpression",object:t,callee:e})}function AE(t,e){return (0, P.default)({type:"ImportAttribute",key:t,value:e})}function vE(t){return (0, P.default)({type:"Decorator",expression:t})}function IE(t,e=!1){return (0, P.default)({type:"DoExpression",body:t,async:e})}function wE(t){return (0, P.default)({type:"ExportDefaultSpecifier",exported:t})}function OE(t){return (0, P.default)({type:"RecordExpression",properties:t})}function NE(t=[]){return (0, P.default)({type:"TupleExpression",elements:t})}function CE(t){return (0, P.default)({type:"DecimalLiteral",value:t})}function DE(t){return (0, P.default)({type:"ModuleExpression",body:t})}function LE(){return {type:"TopicReference"}}function kE(t){return (0, P.default)({type:"PipelineTopicExpression",expression:t})}function _E(t){return (0, P.default)({type:"PipelineBareFunction",callee:t})}function ME(){return {type:"PipelinePrimaryTopicReference"}}function jE(t){return (0, P.default)({type:"TSParameterProperty",parameter:t})}function BE(t=null,e=null,r,i=null){return (0, P.default)({type:"TSDeclareFunction",id:t,typeParameters:e,params:r,returnType:i})}function FE(t=null,e,r=null,i,s=null){return (0, P.default)({type:"TSDeclareMethod",decorators:t,key:e,typeParameters:r,params:i,returnType:s})}function RE(t,e){return (0, P.default)({type:"TSQualifiedName",left:t,right:e})}function UE(t=null,e,r=null){return (0, P.default)({type:"TSCallSignatureDeclaration",typeParameters:t,parameters:e,typeAnnotation:r})}function qE(t=null,e,r=null){return (0, P.default)({type:"TSConstructSignatureDeclaration",typeParameters:t,parameters:e,typeAnnotation:r})}function KE(t,e=null){return (0, P.default)({type:"TSPropertySignature",key:t,typeAnnotation:e,kind:null})}function VE(t,e=null,r,i=null){return (0, P.default)({type:"TSMethodSignature",key:t,typeParameters:e,parameters:r,typeAnnotation:i,kind:null})}function YE(t,e=null){return (0, P.default)({type:"TSIndexSignature",parameters:t,typeAnnotation:e})}function XE(){return {type:"TSAnyKeyword"}}function JE(){return {type:"TSBooleanKeyword"}}function $E(){return {type:"TSBigIntKeyword"}}function WE(){return {type:"TSIntrinsicKeyword"}}function zE(){return {type:"TSNeverKeyword"}}function HE(){return {type:"TSNullKeyword"}}function GE(){return {type:"TSNumberKeyword"}}function QE(){return {type:"TSObjectKeyword"}}function ZE(){return {type:"TSStringKeyword"}}function eg(){return {type:"TSSymbolKeyword"}}function tg(){return {type:"TSUndefinedKeyword"}}function rg(){return {type:"TSUnknownKeyword"}}function ig(){return {type:"TSVoidKeyword"}}function sg(){return {type:"TSThisType"}}function ag(t=null,e,r=null){return (0, P.default)({type:"TSFunctionType",typeParameters:t,parameters:e,typeAnnotation:r})}function ng(t=null,e,r=null){return (0, P.default)({type:"TSConstructorType",typeParameters:t,parameters:e,typeAnnotation:r})}function og(t,e=null){return (0, P.default)({type:"TSTypeReference",typeName:t,typeParameters:e})}function lg(t,e=null,r=null){return (0, P.default)({type:"TSTypePredicate",parameterName:t,typeAnnotation:e,asserts:r})}function ug(t,e=null){return (0, P.default)({type:"TSTypeQuery",exprName:t,typeParameters:e})}function cg(t){return (0, P.default)({type:"TSTypeLiteral",members:t})}function pg(t){return (0, P.default)({type:"TSArrayType",elementType:t})}function fg(t){return (0, P.default)({type:"TSTupleType",elementTypes:t})}function dg(t){return (0, P.default)({type:"TSOptionalType",typeAnnotation:t})}function hg(t){return (0, P.default)({type:"TSRestType",typeAnnotation:t})}function yg(t,e,r=!1){return (0, P.default)({type:"TSNamedTupleMember",label:t,elementType:e,optional:r})}function mg(t){return (0, P.default)({type:"TSUnionType",types:t})}function Tg(t){return (0, P.default)({type:"TSIntersectionType",types:t})}function bg(t,e,r,i){return (0, P.default)({type:"TSConditionalType",checkType:t,extendsType:e,trueType:r,falseType:i})}function Sg(t){return (0, P.default)({type:"TSInferType",typeParameter:t})}function xg(t){return (0, P.default)({type:"TSParenthesizedType",typeAnnotation:t})}function Pg(t){return (0, P.default)({type:"TSTypeOperator",typeAnnotation:t,operator:null})}function Eg(t,e){return (0, P.default)({type:"TSIndexedAccessType",objectType:t,indexType:e})}function gg(t,e=null,r=null){return (0, P.default)({type:"TSMappedType",typeParameter:t,typeAnnotation:e,nameType:r})}function Ag(t){return (0, P.default)({type:"TSLiteralType",literal:t})}function vg(t,e=null){return (0, P.default)({type:"TSExpressionWithTypeArguments",expression:t,typeParameters:e})}function Ig(t,e=null,r=null,i){return (0, P.default)({type:"TSInterfaceDeclaration",id:t,typeParameters:e,extends:r,body:i})}function wg(t){return (0, P.default)({type:"TSInterfaceBody",body:t})}function Og(t,e=null,r){return (0, P.default)({type:"TSTypeAliasDeclaration",id:t,typeParameters:e,typeAnnotation:r})}function Ng(t,e=null){return (0, P.default)({type:"TSInstantiationExpression",expression:t,typeParameters:e})}function Cg(t,e){return (0, P.default)({type:"TSAsExpression",expression:t,typeAnnotation:e})}function Dg(t,e){return (0, P.default)({type:"TSSatisfiesExpression",expression:t,typeAnnotation:e})}function Lg(t,e){return (0, P.default)({type:"TSTypeAssertion",typeAnnotation:t,expression:e})}function kg(t,e){return (0, P.default)({type:"TSEnumDeclaration",id:t,members:e})}function _g(t,e=null){return (0, P.default)({type:"TSEnumMember",id:t,initializer:e})}function Mg(t,e){return (0, P.default)({type:"TSModuleDeclaration",id:t,body:e})}function jg(t){return (0, P.default)({type:"TSModuleBlock",body:t})}function Bg(t,e=null,r=null){return (0, P.default)({type:"TSImportType",argument:t,qualifier:e,typeParameters:r})}function Fg(t,e){return (0, P.default)({type:"TSImportEqualsDeclaration",id:t,moduleReference:e,isExport:null})}function Rg(t){return (0, P.default)({type:"TSExternalModuleReference",expression:t})}function Ug(t){return (0, P.default)({type:"TSNonNullExpression",expression:t})}function qg(t){return (0, P.default)({type:"TSExportAssignment",expression:t})}function Kg(t){return (0, P.default)({type:"TSNamespaceExportDeclaration",id:t})}function Vg(t){return (0, P.default)({type:"TSTypeAnnotation",typeAnnotation:t})}function Yg(t){return (0, P.default)({type:"TSTypeParameterInstantiation",params:t})}function Xg(t){return (0, P.default)({type:"TSTypeParameterDeclaration",params:t})}function Jg(t=null,e=null,r){return (0, P.default)({type:"TSTypeParameter",constraint:t,default:e,name:r})}function $g(t){return (0, Vr.default)("NumberLiteral","NumericLiteral","The node type "),Il(t)}function Wg(t,e=""){return (0, Vr.default)("RegexLiteral","RegExpLiteral","The node type "),wl(t,e)}function zg(t){return (0, Vr.default)("RestProperty","RestElement","The node type "),Ol(t)}function Hg(t){return (0, Vr.default)("SpreadProperty","SpreadElement","The node type "),Nl(t)}});var Cl=A(gs=>{Object.defineProperty(gs,"__esModule",{value:!0});gs.default=Zg;var Gg=be(),Qg=ve();function Zg(t,e){let r=t.value.split(/\r\n|\n|\r/),i=0;for(let a=0;a{Object.defineProperty(vs,"__esModule",{value:!0});vs.default=tA;var As=le(),eA=Cl();function tA(t){let e=[];for(let r=0;r{Object.defineProperty(Is,"__esModule",{value:!0});Is.default=iA;var rA=De();function iA(t){return !!(t&&rA.VISITOR_KEYS[t.type])}});var Ll=A(Os=>{Object.defineProperty(Os,"__esModule",{value:!0});Os.default=aA;var sA=ws();function aA(t){if(!(0, sA.default)(t)){var e;let r=(e=t?.type)!=null?e:JSON.stringify(t);throw new TypeError(`Not a valid node of type "${r}"`)}}});var kl=A(h=>{Object.defineProperty(h,"__esModule",{value:!0});h.assertAccessor=PO;h.assertAnyTypeAnnotation=qv;h.assertArgumentPlaceholder=mI;h.assertArrayExpression=oA;h.assertArrayPattern=av;h.assertArrayTypeAnnotation=Kv;h.assertArrowFunctionExpression=nv;h.assertAssignmentExpression=lA;h.assertAssignmentPattern=sv;h.assertAwaitExpression=Nv;h.assertBigIntLiteral=Dv;h.assertBinary=Vw;h.assertBinaryExpression=uA;h.assertBindExpression=TI;h.assertBlock=Jw;h.assertBlockParent=Xw;h.assertBlockStatement=dA;h.assertBooleanLiteral=_A;h.assertBooleanLiteralTypeAnnotation=Yv;h.assertBooleanTypeAnnotation=Vv;h.assertBreakStatement=hA;h.assertCallExpression=yA;h.assertCatchClause=mA;h.assertClass=TO;h.assertClassAccessorProperty=jv;h.assertClassBody=ov;h.assertClassDeclaration=uv;h.assertClassExpression=lv;h.assertClassImplements=Jv;h.assertClassMethod=Pv;h.assertClassPrivateMethod=Fv;h.assertClassPrivateProperty=Bv;h.assertClassProperty=Mv;h.assertCompletionStatement=zw;h.assertConditional=Hw;h.assertConditionalExpression=TA;h.assertContinueStatement=bA;h.assertDebuggerStatement=SA;h.assertDecimalLiteral=AI;h.assertDeclaration=aO;h.assertDeclareClass=$v;h.assertDeclareExportAllDeclaration=r1;h.assertDeclareExportDeclaration=t1;h.assertDeclareFunction=Wv;h.assertDeclareInterface=zv;h.assertDeclareModule=Hv;h.assertDeclareModuleExports=Gv;h.assertDeclareOpaqueType=Zv;h.assertDeclareTypeAlias=Qv;h.assertDeclareVariable=e1;h.assertDeclaredPredicate=i1;h.assertDecorator=SI;h.assertDirective=pA;h.assertDirectiveLiteral=fA;h.assertDoExpression=xI;h.assertDoWhileStatement=xA;h.assertEmptyStatement=PA;h.assertEmptyTypeAnnotation=h1;h.assertEnumBody=OO;h.assertEnumBooleanBody=K1;h.assertEnumBooleanMember=J1;h.assertEnumDeclaration=q1;h.assertEnumDefaultedMember=z1;h.assertEnumMember=NO;h.assertEnumNumberBody=V1;h.assertEnumNumberMember=$1;h.assertEnumStringBody=Y1;h.assertEnumStringMember=W1;h.assertEnumSymbolBody=X1;h.assertExistsTypeAnnotation=s1;h.assertExportAllDeclaration=cv;h.assertExportDeclaration=SO;h.assertExportDefaultDeclaration=pv;h.assertExportDefaultSpecifier=PI;h.assertExportNamedDeclaration=fv;h.assertExportNamespaceSpecifier=Lv;h.assertExportSpecifier=dv;h.assertExpression=Kw;h.assertExpressionStatement=EA;h.assertExpressionWrapper=Zw;h.assertFile=gA;h.assertFlow=gO;h.assertFlowBaseAnnotation=vO;h.assertFlowDeclaration=IO;h.assertFlowPredicate=wO;h.assertFlowType=AO;h.assertFor=eO;h.assertForInStatement=AA;h.assertForOfStatement=hv;h.assertForStatement=vA;h.assertForXStatement=tO;h.assertFunction=rO;h.assertFunctionDeclaration=IA;h.assertFunctionExpression=wA;h.assertFunctionParent=iO;h.assertFunctionTypeAnnotation=a1;h.assertFunctionTypeParam=n1;h.assertGenericTypeAnnotation=o1;h.assertIdentifier=OA;h.assertIfStatement=NA;h.assertImmutable=cO;h.assertImport=Cv;h.assertImportAttribute=bI;h.assertImportDeclaration=yv;h.assertImportDefaultSpecifier=mv;h.assertImportExpression=Sv;h.assertImportNamespaceSpecifier=Tv;h.assertImportOrExportDeclaration=bO;h.assertImportSpecifier=bv;h.assertIndexedAccessType=H1;h.assertInferredPredicate=l1;h.assertInterfaceDeclaration=c1;h.assertInterfaceExtends=u1;h.assertInterfaceTypeAnnotation=p1;h.assertInterpreterDirective=cA;h.assertIntersectionTypeAnnotation=f1;h.assertJSX=CO;h.assertJSXAttribute=Q1;h.assertJSXClosingElement=Z1;h.assertJSXClosingFragment=fI;h.assertJSXElement=eI;h.assertJSXEmptyExpression=tI;h.assertJSXExpressionContainer=rI;h.assertJSXFragment=cI;h.assertJSXIdentifier=sI;h.assertJSXMemberExpression=aI;h.assertJSXNamespacedName=nI;h.assertJSXOpeningElement=oI;h.assertJSXOpeningFragment=pI;h.assertJSXSpreadAttribute=lI;h.assertJSXSpreadChild=iI;h.assertJSXText=uI;h.assertLVal=oO;h.assertLabeledStatement=CA;h.assertLiteral=uO;h.assertLogicalExpression=jA;h.assertLoop=Gw;h.assertMemberExpression=BA;h.assertMetaProperty=xv;h.assertMethod=fO;h.assertMiscellaneous=DO;h.assertMixedTypeAnnotation=d1;h.assertModuleDeclaration=UO;h.assertModuleExpression=vI;h.assertModuleSpecifier=xO;h.assertNewExpression=FA;h.assertNoop=dI;h.assertNullLiteral=kA;h.assertNullLiteralTypeAnnotation=Xv;h.assertNullableTypeAnnotation=y1;h.assertNumberLiteral=jO;h.assertNumberLiteralTypeAnnotation=m1;h.assertNumberTypeAnnotation=T1;h.assertNumericLiteral=LA;h.assertObjectExpression=UA;h.assertObjectMember=dO;h.assertObjectMethod=qA;h.assertObjectPattern=Ev;h.assertObjectProperty=KA;h.assertObjectTypeAnnotation=b1;h.assertObjectTypeCallProperty=x1;h.assertObjectTypeIndexer=P1;h.assertObjectTypeInternalSlot=S1;h.assertObjectTypeProperty=E1;h.assertObjectTypeSpreadProperty=g1;h.assertOpaqueType=A1;h.assertOptionalCallExpression=_v;h.assertOptionalIndexedAccessType=G1;h.assertOptionalMemberExpression=kv;h.assertParenthesizedExpression=JA;h.assertPattern=mO;h.assertPatternLike=nO;h.assertPipelineBareFunction=OI;h.assertPipelinePrimaryTopicReference=NI;h.assertPipelineTopicExpression=wI;h.assertPlaceholder=hI;h.assertPrivate=EO;h.assertPrivateName=Rv;h.assertProgram=RA;h.assertProperty=hO;h.assertPureish=sO;h.assertQualifiedTypeIdentifier=v1;h.assertRecordExpression=EI;h.assertRegExpLiteral=MA;h.assertRegexLiteral=BO;h.assertRestElement=VA;h.assertRestProperty=FO;h.assertReturnStatement=YA;h.assertScopable=Yw;h.assertSequenceExpression=XA;h.assertSpreadElement=gv;h.assertSpreadProperty=RO;h.assertStandardized=qw;h.assertStatement=$w;h.assertStaticBlock=Uv;h.assertStringLiteral=DA;h.assertStringLiteralTypeAnnotation=I1;h.assertStringTypeAnnotation=w1;h.assertSuper=Av;h.assertSwitchCase=$A;h.assertSwitchStatement=WA;h.assertSymbolTypeAnnotation=O1;h.assertTSAnyKeyword=RI;h.assertTSArrayType=aw;h.assertTSAsExpression=Aw;h.assertTSBaseType=MO;h.assertTSBigIntKeyword=qI;h.assertTSBooleanKeyword=UI;h.assertTSCallSignatureDeclaration=_I;h.assertTSConditionalType=fw;h.assertTSConstructSignatureDeclaration=MI;h.assertTSConstructorType=ew;h.assertTSDeclareFunction=DI;h.assertTSDeclareMethod=LI;h.assertTSEntityName=lO;h.assertTSEnumDeclaration=ww;h.assertTSEnumMember=Ow;h.assertTSExportAssignment=Mw;h.assertTSExpressionWithTypeArguments=Sw;h.assertTSExternalModuleReference=kw;h.assertTSFunctionType=ZI;h.assertTSImportEqualsDeclaration=Lw;h.assertTSImportType=Dw;h.assertTSIndexSignature=FI;h.assertTSIndexedAccessType=mw;h.assertTSInferType=dw;h.assertTSInstantiationExpression=gw;h.assertTSInterfaceBody=Pw;h.assertTSInterfaceDeclaration=xw;h.assertTSIntersectionType=pw;h.assertTSIntrinsicKeyword=KI;h.assertTSLiteralType=bw;h.assertTSMappedType=Tw;h.assertTSMethodSignature=BI;h.assertTSModuleBlock=Cw;h.assertTSModuleDeclaration=Nw;h.assertTSNamedTupleMember=uw;h.assertTSNamespaceExportDeclaration=jw;h.assertTSNeverKeyword=VI;h.assertTSNonNullExpression=_w;h.assertTSNullKeyword=YI;h.assertTSNumberKeyword=XI;h.assertTSObjectKeyword=JI;h.assertTSOptionalType=ow;h.assertTSParameterProperty=CI;h.assertTSParenthesizedType=hw;h.assertTSPropertySignature=jI;h.assertTSQualifiedName=kI;h.assertTSRestType=lw;h.assertTSSatisfiesExpression=vw;h.assertTSStringKeyword=$I;h.assertTSSymbolKeyword=WI;h.assertTSThisType=QI;h.assertTSTupleType=nw;h.assertTSType=_O;h.assertTSTypeAliasDeclaration=Ew;h.assertTSTypeAnnotation=Bw;h.assertTSTypeAssertion=Iw;h.assertTSTypeElement=kO;h.assertTSTypeLiteral=sw;h.assertTSTypeOperator=yw;h.assertTSTypeParameter=Uw;h.assertTSTypeParameterDeclaration=Rw;h.assertTSTypeParameterInstantiation=Fw;h.assertTSTypePredicate=rw;h.assertTSTypeQuery=iw;h.assertTSTypeReference=tw;h.assertTSUndefinedKeyword=zI;h.assertTSUnionType=cw;h.assertTSUnknownKeyword=HI;h.assertTSVoidKeyword=GI;h.assertTaggedTemplateExpression=vv;h.assertTemplateElement=Iv;h.assertTemplateLiteral=wv;h.assertTerminatorless=Ww;h.assertThisExpression=zA;h.assertThisTypeAnnotation=N1;h.assertThrowStatement=HA;h.assertTopicReference=II;h.assertTryStatement=GA;h.assertTupleExpression=gI;h.assertTupleTypeAnnotation=C1;h.assertTypeAlias=L1;h.assertTypeAnnotation=k1;h.assertTypeCastExpression=_1;h.assertTypeParameter=M1;h.assertTypeParameterDeclaration=j1;h.assertTypeParameterInstantiation=B1;h.assertTypeScript=LO;h.assertTypeofTypeAnnotation=D1;h.assertUnaryExpression=QA;h.assertUnaryLike=yO;h.assertUnionTypeAnnotation=F1;h.assertUpdateExpression=ZA;h.assertUserWhitespacable=pO;h.assertV8IntrinsicIdentifier=yI;h.assertVariableDeclaration=ev;h.assertVariableDeclarator=tv;h.assertVariance=R1;h.assertVoidTypeAnnotation=U1;h.assertWhile=Qw;h.assertWhileStatement=rv;h.assertWithStatement=iv;h.assertYieldExpression=Ov;var nA=Et(),tr=Vt();function y(t,e,r){if(!(0, nA.default)(t,e,r))throw new Error(`Expected type "${t}" with option ${JSON.stringify(r)}, but instead got "${e.type}".`)}function oA(t,e){y("ArrayExpression",t,e);}function lA(t,e){y("AssignmentExpression",t,e);}function uA(t,e){y("BinaryExpression",t,e);}function cA(t,e){y("InterpreterDirective",t,e);}function pA(t,e){y("Directive",t,e);}function fA(t,e){y("DirectiveLiteral",t,e);}function dA(t,e){y("BlockStatement",t,e);}function hA(t,e){y("BreakStatement",t,e);}function yA(t,e){y("CallExpression",t,e);}function mA(t,e){y("CatchClause",t,e);}function TA(t,e){y("ConditionalExpression",t,e);}function bA(t,e){y("ContinueStatement",t,e);}function SA(t,e){y("DebuggerStatement",t,e);}function xA(t,e){y("DoWhileStatement",t,e);}function PA(t,e){y("EmptyStatement",t,e);}function EA(t,e){y("ExpressionStatement",t,e);}function gA(t,e){y("File",t,e);}function AA(t,e){y("ForInStatement",t,e);}function vA(t,e){y("ForStatement",t,e);}function IA(t,e){y("FunctionDeclaration",t,e);}function wA(t,e){y("FunctionExpression",t,e);}function OA(t,e){y("Identifier",t,e);}function NA(t,e){y("IfStatement",t,e);}function CA(t,e){y("LabeledStatement",t,e);}function DA(t,e){y("StringLiteral",t,e);}function LA(t,e){y("NumericLiteral",t,e);}function kA(t,e){y("NullLiteral",t,e);}function _A(t,e){y("BooleanLiteral",t,e);}function MA(t,e){y("RegExpLiteral",t,e);}function jA(t,e){y("LogicalExpression",t,e);}function BA(t,e){y("MemberExpression",t,e);}function FA(t,e){y("NewExpression",t,e);}function RA(t,e){y("Program",t,e);}function UA(t,e){y("ObjectExpression",t,e);}function qA(t,e){y("ObjectMethod",t,e);}function KA(t,e){y("ObjectProperty",t,e);}function VA(t,e){y("RestElement",t,e);}function YA(t,e){y("ReturnStatement",t,e);}function XA(t,e){y("SequenceExpression",t,e);}function JA(t,e){y("ParenthesizedExpression",t,e);}function $A(t,e){y("SwitchCase",t,e);}function WA(t,e){y("SwitchStatement",t,e);}function zA(t,e){y("ThisExpression",t,e);}function HA(t,e){y("ThrowStatement",t,e);}function GA(t,e){y("TryStatement",t,e);}function QA(t,e){y("UnaryExpression",t,e);}function ZA(t,e){y("UpdateExpression",t,e);}function ev(t,e){y("VariableDeclaration",t,e);}function tv(t,e){y("VariableDeclarator",t,e);}function rv(t,e){y("WhileStatement",t,e);}function iv(t,e){y("WithStatement",t,e);}function sv(t,e){y("AssignmentPattern",t,e);}function av(t,e){y("ArrayPattern",t,e);}function nv(t,e){y("ArrowFunctionExpression",t,e);}function ov(t,e){y("ClassBody",t,e);}function lv(t,e){y("ClassExpression",t,e);}function uv(t,e){y("ClassDeclaration",t,e);}function cv(t,e){y("ExportAllDeclaration",t,e);}function pv(t,e){y("ExportDefaultDeclaration",t,e);}function fv(t,e){y("ExportNamedDeclaration",t,e);}function dv(t,e){y("ExportSpecifier",t,e);}function hv(t,e){y("ForOfStatement",t,e);}function yv(t,e){y("ImportDeclaration",t,e);}function mv(t,e){y("ImportDefaultSpecifier",t,e);}function Tv(t,e){y("ImportNamespaceSpecifier",t,e);}function bv(t,e){y("ImportSpecifier",t,e);}function Sv(t,e){y("ImportExpression",t,e);}function xv(t,e){y("MetaProperty",t,e);}function Pv(t,e){y("ClassMethod",t,e);}function Ev(t,e){y("ObjectPattern",t,e);}function gv(t,e){y("SpreadElement",t,e);}function Av(t,e){y("Super",t,e);}function vv(t,e){y("TaggedTemplateExpression",t,e);}function Iv(t,e){y("TemplateElement",t,e);}function wv(t,e){y("TemplateLiteral",t,e);}function Ov(t,e){y("YieldExpression",t,e);}function Nv(t,e){y("AwaitExpression",t,e);}function Cv(t,e){y("Import",t,e);}function Dv(t,e){y("BigIntLiteral",t,e);}function Lv(t,e){y("ExportNamespaceSpecifier",t,e);}function kv(t,e){y("OptionalMemberExpression",t,e);}function _v(t,e){y("OptionalCallExpression",t,e);}function Mv(t,e){y("ClassProperty",t,e);}function jv(t,e){y("ClassAccessorProperty",t,e);}function Bv(t,e){y("ClassPrivateProperty",t,e);}function Fv(t,e){y("ClassPrivateMethod",t,e);}function Rv(t,e){y("PrivateName",t,e);}function Uv(t,e){y("StaticBlock",t,e);}function qv(t,e){y("AnyTypeAnnotation",t,e);}function Kv(t,e){y("ArrayTypeAnnotation",t,e);}function Vv(t,e){y("BooleanTypeAnnotation",t,e);}function Yv(t,e){y("BooleanLiteralTypeAnnotation",t,e);}function Xv(t,e){y("NullLiteralTypeAnnotation",t,e);}function Jv(t,e){y("ClassImplements",t,e);}function $v(t,e){y("DeclareClass",t,e);}function Wv(t,e){y("DeclareFunction",t,e);}function zv(t,e){y("DeclareInterface",t,e);}function Hv(t,e){y("DeclareModule",t,e);}function Gv(t,e){y("DeclareModuleExports",t,e);}function Qv(t,e){y("DeclareTypeAlias",t,e);}function Zv(t,e){y("DeclareOpaqueType",t,e);}function e1(t,e){y("DeclareVariable",t,e);}function t1(t,e){y("DeclareExportDeclaration",t,e);}function r1(t,e){y("DeclareExportAllDeclaration",t,e);}function i1(t,e){y("DeclaredPredicate",t,e);}function s1(t,e){y("ExistsTypeAnnotation",t,e);}function a1(t,e){y("FunctionTypeAnnotation",t,e);}function n1(t,e){y("FunctionTypeParam",t,e);}function o1(t,e){y("GenericTypeAnnotation",t,e);}function l1(t,e){y("InferredPredicate",t,e);}function u1(t,e){y("InterfaceExtends",t,e);}function c1(t,e){y("InterfaceDeclaration",t,e);}function p1(t,e){y("InterfaceTypeAnnotation",t,e);}function f1(t,e){y("IntersectionTypeAnnotation",t,e);}function d1(t,e){y("MixedTypeAnnotation",t,e);}function h1(t,e){y("EmptyTypeAnnotation",t,e);}function y1(t,e){y("NullableTypeAnnotation",t,e);}function m1(t,e){y("NumberLiteralTypeAnnotation",t,e);}function T1(t,e){y("NumberTypeAnnotation",t,e);}function b1(t,e){y("ObjectTypeAnnotation",t,e);}function S1(t,e){y("ObjectTypeInternalSlot",t,e);}function x1(t,e){y("ObjectTypeCallProperty",t,e);}function P1(t,e){y("ObjectTypeIndexer",t,e);}function E1(t,e){y("ObjectTypeProperty",t,e);}function g1(t,e){y("ObjectTypeSpreadProperty",t,e);}function A1(t,e){y("OpaqueType",t,e);}function v1(t,e){y("QualifiedTypeIdentifier",t,e);}function I1(t,e){y("StringLiteralTypeAnnotation",t,e);}function w1(t,e){y("StringTypeAnnotation",t,e);}function O1(t,e){y("SymbolTypeAnnotation",t,e);}function N1(t,e){y("ThisTypeAnnotation",t,e);}function C1(t,e){y("TupleTypeAnnotation",t,e);}function D1(t,e){y("TypeofTypeAnnotation",t,e);}function L1(t,e){y("TypeAlias",t,e);}function k1(t,e){y("TypeAnnotation",t,e);}function _1(t,e){y("TypeCastExpression",t,e);}function M1(t,e){y("TypeParameter",t,e);}function j1(t,e){y("TypeParameterDeclaration",t,e);}function B1(t,e){y("TypeParameterInstantiation",t,e);}function F1(t,e){y("UnionTypeAnnotation",t,e);}function R1(t,e){y("Variance",t,e);}function U1(t,e){y("VoidTypeAnnotation",t,e);}function q1(t,e){y("EnumDeclaration",t,e);}function K1(t,e){y("EnumBooleanBody",t,e);}function V1(t,e){y("EnumNumberBody",t,e);}function Y1(t,e){y("EnumStringBody",t,e);}function X1(t,e){y("EnumSymbolBody",t,e);}function J1(t,e){y("EnumBooleanMember",t,e);}function $1(t,e){y("EnumNumberMember",t,e);}function W1(t,e){y("EnumStringMember",t,e);}function z1(t,e){y("EnumDefaultedMember",t,e);}function H1(t,e){y("IndexedAccessType",t,e);}function G1(t,e){y("OptionalIndexedAccessType",t,e);}function Q1(t,e){y("JSXAttribute",t,e);}function Z1(t,e){y("JSXClosingElement",t,e);}function eI(t,e){y("JSXElement",t,e);}function tI(t,e){y("JSXEmptyExpression",t,e);}function rI(t,e){y("JSXExpressionContainer",t,e);}function iI(t,e){y("JSXSpreadChild",t,e);}function sI(t,e){y("JSXIdentifier",t,e);}function aI(t,e){y("JSXMemberExpression",t,e);}function nI(t,e){y("JSXNamespacedName",t,e);}function oI(t,e){y("JSXOpeningElement",t,e);}function lI(t,e){y("JSXSpreadAttribute",t,e);}function uI(t,e){y("JSXText",t,e);}function cI(t,e){y("JSXFragment",t,e);}function pI(t,e){y("JSXOpeningFragment",t,e);}function fI(t,e){y("JSXClosingFragment",t,e);}function dI(t,e){y("Noop",t,e);}function hI(t,e){y("Placeholder",t,e);}function yI(t,e){y("V8IntrinsicIdentifier",t,e);}function mI(t,e){y("ArgumentPlaceholder",t,e);}function TI(t,e){y("BindExpression",t,e);}function bI(t,e){y("ImportAttribute",t,e);}function SI(t,e){y("Decorator",t,e);}function xI(t,e){y("DoExpression",t,e);}function PI(t,e){y("ExportDefaultSpecifier",t,e);}function EI(t,e){y("RecordExpression",t,e);}function gI(t,e){y("TupleExpression",t,e);}function AI(t,e){y("DecimalLiteral",t,e);}function vI(t,e){y("ModuleExpression",t,e);}function II(t,e){y("TopicReference",t,e);}function wI(t,e){y("PipelineTopicExpression",t,e);}function OI(t,e){y("PipelineBareFunction",t,e);}function NI(t,e){y("PipelinePrimaryTopicReference",t,e);}function CI(t,e){y("TSParameterProperty",t,e);}function DI(t,e){y("TSDeclareFunction",t,e);}function LI(t,e){y("TSDeclareMethod",t,e);}function kI(t,e){y("TSQualifiedName",t,e);}function _I(t,e){y("TSCallSignatureDeclaration",t,e);}function MI(t,e){y("TSConstructSignatureDeclaration",t,e);}function jI(t,e){y("TSPropertySignature",t,e);}function BI(t,e){y("TSMethodSignature",t,e);}function FI(t,e){y("TSIndexSignature",t,e);}function RI(t,e){y("TSAnyKeyword",t,e);}function UI(t,e){y("TSBooleanKeyword",t,e);}function qI(t,e){y("TSBigIntKeyword",t,e);}function KI(t,e){y("TSIntrinsicKeyword",t,e);}function VI(t,e){y("TSNeverKeyword",t,e);}function YI(t,e){y("TSNullKeyword",t,e);}function XI(t,e){y("TSNumberKeyword",t,e);}function JI(t,e){y("TSObjectKeyword",t,e);}function $I(t,e){y("TSStringKeyword",t,e);}function WI(t,e){y("TSSymbolKeyword",t,e);}function zI(t,e){y("TSUndefinedKeyword",t,e);}function HI(t,e){y("TSUnknownKeyword",t,e);}function GI(t,e){y("TSVoidKeyword",t,e);}function QI(t,e){y("TSThisType",t,e);}function ZI(t,e){y("TSFunctionType",t,e);}function ew(t,e){y("TSConstructorType",t,e);}function tw(t,e){y("TSTypeReference",t,e);}function rw(t,e){y("TSTypePredicate",t,e);}function iw(t,e){y("TSTypeQuery",t,e);}function sw(t,e){y("TSTypeLiteral",t,e);}function aw(t,e){y("TSArrayType",t,e);}function nw(t,e){y("TSTupleType",t,e);}function ow(t,e){y("TSOptionalType",t,e);}function lw(t,e){y("TSRestType",t,e);}function uw(t,e){y("TSNamedTupleMember",t,e);}function cw(t,e){y("TSUnionType",t,e);}function pw(t,e){y("TSIntersectionType",t,e);}function fw(t,e){y("TSConditionalType",t,e);}function dw(t,e){y("TSInferType",t,e);}function hw(t,e){y("TSParenthesizedType",t,e);}function yw(t,e){y("TSTypeOperator",t,e);}function mw(t,e){y("TSIndexedAccessType",t,e);}function Tw(t,e){y("TSMappedType",t,e);}function bw(t,e){y("TSLiteralType",t,e);}function Sw(t,e){y("TSExpressionWithTypeArguments",t,e);}function xw(t,e){y("TSInterfaceDeclaration",t,e);}function Pw(t,e){y("TSInterfaceBody",t,e);}function Ew(t,e){y("TSTypeAliasDeclaration",t,e);}function gw(t,e){y("TSInstantiationExpression",t,e);}function Aw(t,e){y("TSAsExpression",t,e);}function vw(t,e){y("TSSatisfiesExpression",t,e);}function Iw(t,e){y("TSTypeAssertion",t,e);}function ww(t,e){y("TSEnumDeclaration",t,e);}function Ow(t,e){y("TSEnumMember",t,e);}function Nw(t,e){y("TSModuleDeclaration",t,e);}function Cw(t,e){y("TSModuleBlock",t,e);}function Dw(t,e){y("TSImportType",t,e);}function Lw(t,e){y("TSImportEqualsDeclaration",t,e);}function kw(t,e){y("TSExternalModuleReference",t,e);}function _w(t,e){y("TSNonNullExpression",t,e);}function Mw(t,e){y("TSExportAssignment",t,e);}function jw(t,e){y("TSNamespaceExportDeclaration",t,e);}function Bw(t,e){y("TSTypeAnnotation",t,e);}function Fw(t,e){y("TSTypeParameterInstantiation",t,e);}function Rw(t,e){y("TSTypeParameterDeclaration",t,e);}function Uw(t,e){y("TSTypeParameter",t,e);}function qw(t,e){y("Standardized",t,e);}function Kw(t,e){y("Expression",t,e);}function Vw(t,e){y("Binary",t,e);}function Yw(t,e){y("Scopable",t,e);}function Xw(t,e){y("BlockParent",t,e);}function Jw(t,e){y("Block",t,e);}function $w(t,e){y("Statement",t,e);}function Ww(t,e){y("Terminatorless",t,e);}function zw(t,e){y("CompletionStatement",t,e);}function Hw(t,e){y("Conditional",t,e);}function Gw(t,e){y("Loop",t,e);}function Qw(t,e){y("While",t,e);}function Zw(t,e){y("ExpressionWrapper",t,e);}function eO(t,e){y("For",t,e);}function tO(t,e){y("ForXStatement",t,e);}function rO(t,e){y("Function",t,e);}function iO(t,e){y("FunctionParent",t,e);}function sO(t,e){y("Pureish",t,e);}function aO(t,e){y("Declaration",t,e);}function nO(t,e){y("PatternLike",t,e);}function oO(t,e){y("LVal",t,e);}function lO(t,e){y("TSEntityName",t,e);}function uO(t,e){y("Literal",t,e);}function cO(t,e){y("Immutable",t,e);}function pO(t,e){y("UserWhitespacable",t,e);}function fO(t,e){y("Method",t,e);}function dO(t,e){y("ObjectMember",t,e);}function hO(t,e){y("Property",t,e);}function yO(t,e){y("UnaryLike",t,e);}function mO(t,e){y("Pattern",t,e);}function TO(t,e){y("Class",t,e);}function bO(t,e){y("ImportOrExportDeclaration",t,e);}function SO(t,e){y("ExportDeclaration",t,e);}function xO(t,e){y("ModuleSpecifier",t,e);}function PO(t,e){y("Accessor",t,e);}function EO(t,e){y("Private",t,e);}function gO(t,e){y("Flow",t,e);}function AO(t,e){y("FlowType",t,e);}function vO(t,e){y("FlowBaseAnnotation",t,e);}function IO(t,e){y("FlowDeclaration",t,e);}function wO(t,e){y("FlowPredicate",t,e);}function OO(t,e){y("EnumBody",t,e);}function NO(t,e){y("EnumMember",t,e);}function CO(t,e){y("JSX",t,e);}function DO(t,e){y("Miscellaneous",t,e);}function LO(t,e){y("TypeScript",t,e);}function kO(t,e){y("TSTypeElement",t,e);}function _O(t,e){y("TSType",t,e);}function MO(t,e){y("TSBaseType",t,e);}function jO(t,e){(0, tr.default)("assertNumberLiteral","assertNumericLiteral"),y("NumberLiteral",t,e);}function BO(t,e){(0, tr.default)("assertRegexLiteral","assertRegExpLiteral"),y("RegexLiteral",t,e);}function FO(t,e){(0, tr.default)("assertRestProperty","assertRestElement"),y("RestProperty",t,e);}function RO(t,e){(0, tr.default)("assertSpreadProperty","assertSpreadElement"),y("SpreadProperty",t,e);}function UO(t,e){(0, tr.default)("assertModuleDeclaration","assertImportOrExportDeclaration"),y("ModuleDeclaration",t,e);}});var _l=A(Yr=>{Object.defineProperty(Yr,"__esModule",{value:!0});Yr.default=void 0;var ke=be();Yr.default=qO;function qO(t){switch(t){case"string":return (0, ke.stringTypeAnnotation)();case"number":return (0, ke.numberTypeAnnotation)();case"undefined":return (0, ke.voidTypeAnnotation)();case"boolean":return (0, ke.booleanTypeAnnotation)();case"function":return (0, ke.genericTypeAnnotation)((0, ke.identifier)("Function"));case"object":return (0, ke.genericTypeAnnotation)((0, ke.identifier)("Object"));case"symbol":return (0, ke.genericTypeAnnotation)((0, ke.identifier)("Symbol"));case"bigint":return (0, ke.anyTypeAnnotation)()}throw new Error("Invalid typeof value: "+t)}});var Cs=A(Ns=>{Object.defineProperty(Ns,"__esModule",{value:!0});Ns.default=jl;var rr=le();function Ml(t){return (0, rr.isIdentifier)(t)?t.name:`${t.id.name}.${Ml(t.qualification)}`}function jl(t){let e=Array.from(t),r=new Map,i=new Map,s=new Set,a=[];for(let n=0;n=0)){if((0, rr.isAnyTypeAnnotation)(o))return [o];if((0, rr.isFlowBaseAnnotation)(o)){i.set(o.type,o);continue}if((0, rr.isUnionTypeAnnotation)(o)){s.has(o.types)||(e.push(...o.types),s.add(o.types));continue}if((0, rr.isGenericTypeAnnotation)(o)){let l=Ml(o.id);if(r.has(l)){let u=r.get(l);u.typeParameters?o.typeParameters&&(u.typeParameters.params.push(...o.typeParameters.params),u.typeParameters.params=jl(u.typeParameters.params)):u=o.typeParameters;}else r.set(l,o);continue}a.push(o);}}for(let[,n]of i)a.push(n);for(let[,n]of r)a.push(n);return a}});var Bl=A(Ds=>{Object.defineProperty(Ds,"__esModule",{value:!0});Ds.default=YO;var KO=be(),VO=Cs();function YO(t){let e=(0, VO.default)(t);return e.length===1?e[0]:(0, KO.unionTypeAnnotation)(e)}});var Ul=A(Ls=>{Object.defineProperty(Ls,"__esModule",{value:!0});Ls.default=Rl;var ir=le();function Fl(t){return (0, ir.isIdentifier)(t)?t.name:`${t.right.name}.${Fl(t.left)}`}function Rl(t){let e=Array.from(t),r=new Map,i=new Map,s=new Set,a=[];for(let n=0;n=0)){if((0, ir.isTSAnyKeyword)(o))return [o];if((0, ir.isTSBaseType)(o)){i.set(o.type,o);continue}if((0, ir.isTSUnionType)(o)){s.has(o.types)||(e.push(...o.types),s.add(o.types));continue}if((0, ir.isTSTypeReference)(o)&&o.typeParameters){let l=Fl(o.typeName);if(r.has(l)){let u=r.get(l);u.typeParameters?o.typeParameters&&(u.typeParameters.params.push(...o.typeParameters.params),u.typeParameters.params=Rl(u.typeParameters.params)):u=o.typeParameters;}else r.set(l,o);continue}a.push(o);}}for(let[,n]of i)a.push(n);for(let[,n]of r)a.push(n);return a}});var ql=A(ks=>{Object.defineProperty(ks,"__esModule",{value:!0});ks.default=WO;var XO=be(),JO=Ul(),$O=le();function WO(t){let e=t.map(i=>(0, $O.isTSTypeAnnotation)(i)?i.typeAnnotation:i),r=(0, JO.default)(e);return r.length===1?r[0]:(0, XO.tsUnionType)(r)}});var Kl=A(T=>{Object.defineProperty(T,"__esModule",{value:!0});Object.defineProperty(T,"AnyTypeAnnotation",{enumerable:!0,get:function(){return b.anyTypeAnnotation}});Object.defineProperty(T,"ArgumentPlaceholder",{enumerable:!0,get:function(){return b.argumentPlaceholder}});Object.defineProperty(T,"ArrayExpression",{enumerable:!0,get:function(){return b.arrayExpression}});Object.defineProperty(T,"ArrayPattern",{enumerable:!0,get:function(){return b.arrayPattern}});Object.defineProperty(T,"ArrayTypeAnnotation",{enumerable:!0,get:function(){return b.arrayTypeAnnotation}});Object.defineProperty(T,"ArrowFunctionExpression",{enumerable:!0,get:function(){return b.arrowFunctionExpression}});Object.defineProperty(T,"AssignmentExpression",{enumerable:!0,get:function(){return b.assignmentExpression}});Object.defineProperty(T,"AssignmentPattern",{enumerable:!0,get:function(){return b.assignmentPattern}});Object.defineProperty(T,"AwaitExpression",{enumerable:!0,get:function(){return b.awaitExpression}});Object.defineProperty(T,"BigIntLiteral",{enumerable:!0,get:function(){return b.bigIntLiteral}});Object.defineProperty(T,"BinaryExpression",{enumerable:!0,get:function(){return b.binaryExpression}});Object.defineProperty(T,"BindExpression",{enumerable:!0,get:function(){return b.bindExpression}});Object.defineProperty(T,"BlockStatement",{enumerable:!0,get:function(){return b.blockStatement}});Object.defineProperty(T,"BooleanLiteral",{enumerable:!0,get:function(){return b.booleanLiteral}});Object.defineProperty(T,"BooleanLiteralTypeAnnotation",{enumerable:!0,get:function(){return b.booleanLiteralTypeAnnotation}});Object.defineProperty(T,"BooleanTypeAnnotation",{enumerable:!0,get:function(){return b.booleanTypeAnnotation}});Object.defineProperty(T,"BreakStatement",{enumerable:!0,get:function(){return b.breakStatement}});Object.defineProperty(T,"CallExpression",{enumerable:!0,get:function(){return b.callExpression}});Object.defineProperty(T,"CatchClause",{enumerable:!0,get:function(){return b.catchClause}});Object.defineProperty(T,"ClassAccessorProperty",{enumerable:!0,get:function(){return b.classAccessorProperty}});Object.defineProperty(T,"ClassBody",{enumerable:!0,get:function(){return b.classBody}});Object.defineProperty(T,"ClassDeclaration",{enumerable:!0,get:function(){return b.classDeclaration}});Object.defineProperty(T,"ClassExpression",{enumerable:!0,get:function(){return b.classExpression}});Object.defineProperty(T,"ClassImplements",{enumerable:!0,get:function(){return b.classImplements}});Object.defineProperty(T,"ClassMethod",{enumerable:!0,get:function(){return b.classMethod}});Object.defineProperty(T,"ClassPrivateMethod",{enumerable:!0,get:function(){return b.classPrivateMethod}});Object.defineProperty(T,"ClassPrivateProperty",{enumerable:!0,get:function(){return b.classPrivateProperty}});Object.defineProperty(T,"ClassProperty",{enumerable:!0,get:function(){return b.classProperty}});Object.defineProperty(T,"ConditionalExpression",{enumerable:!0,get:function(){return b.conditionalExpression}});Object.defineProperty(T,"ContinueStatement",{enumerable:!0,get:function(){return b.continueStatement}});Object.defineProperty(T,"DebuggerStatement",{enumerable:!0,get:function(){return b.debuggerStatement}});Object.defineProperty(T,"DecimalLiteral",{enumerable:!0,get:function(){return b.decimalLiteral}});Object.defineProperty(T,"DeclareClass",{enumerable:!0,get:function(){return b.declareClass}});Object.defineProperty(T,"DeclareExportAllDeclaration",{enumerable:!0,get:function(){return b.declareExportAllDeclaration}});Object.defineProperty(T,"DeclareExportDeclaration",{enumerable:!0,get:function(){return b.declareExportDeclaration}});Object.defineProperty(T,"DeclareFunction",{enumerable:!0,get:function(){return b.declareFunction}});Object.defineProperty(T,"DeclareInterface",{enumerable:!0,get:function(){return b.declareInterface}});Object.defineProperty(T,"DeclareModule",{enumerable:!0,get:function(){return b.declareModule}});Object.defineProperty(T,"DeclareModuleExports",{enumerable:!0,get:function(){return b.declareModuleExports}});Object.defineProperty(T,"DeclareOpaqueType",{enumerable:!0,get:function(){return b.declareOpaqueType}});Object.defineProperty(T,"DeclareTypeAlias",{enumerable:!0,get:function(){return b.declareTypeAlias}});Object.defineProperty(T,"DeclareVariable",{enumerable:!0,get:function(){return b.declareVariable}});Object.defineProperty(T,"DeclaredPredicate",{enumerable:!0,get:function(){return b.declaredPredicate}});Object.defineProperty(T,"Decorator",{enumerable:!0,get:function(){return b.decorator}});Object.defineProperty(T,"Directive",{enumerable:!0,get:function(){return b.directive}});Object.defineProperty(T,"DirectiveLiteral",{enumerable:!0,get:function(){return b.directiveLiteral}});Object.defineProperty(T,"DoExpression",{enumerable:!0,get:function(){return b.doExpression}});Object.defineProperty(T,"DoWhileStatement",{enumerable:!0,get:function(){return b.doWhileStatement}});Object.defineProperty(T,"EmptyStatement",{enumerable:!0,get:function(){return b.emptyStatement}});Object.defineProperty(T,"EmptyTypeAnnotation",{enumerable:!0,get:function(){return b.emptyTypeAnnotation}});Object.defineProperty(T,"EnumBooleanBody",{enumerable:!0,get:function(){return b.enumBooleanBody}});Object.defineProperty(T,"EnumBooleanMember",{enumerable:!0,get:function(){return b.enumBooleanMember}});Object.defineProperty(T,"EnumDeclaration",{enumerable:!0,get:function(){return b.enumDeclaration}});Object.defineProperty(T,"EnumDefaultedMember",{enumerable:!0,get:function(){return b.enumDefaultedMember}});Object.defineProperty(T,"EnumNumberBody",{enumerable:!0,get:function(){return b.enumNumberBody}});Object.defineProperty(T,"EnumNumberMember",{enumerable:!0,get:function(){return b.enumNumberMember}});Object.defineProperty(T,"EnumStringBody",{enumerable:!0,get:function(){return b.enumStringBody}});Object.defineProperty(T,"EnumStringMember",{enumerable:!0,get:function(){return b.enumStringMember}});Object.defineProperty(T,"EnumSymbolBody",{enumerable:!0,get:function(){return b.enumSymbolBody}});Object.defineProperty(T,"ExistsTypeAnnotation",{enumerable:!0,get:function(){return b.existsTypeAnnotation}});Object.defineProperty(T,"ExportAllDeclaration",{enumerable:!0,get:function(){return b.exportAllDeclaration}});Object.defineProperty(T,"ExportDefaultDeclaration",{enumerable:!0,get:function(){return b.exportDefaultDeclaration}});Object.defineProperty(T,"ExportDefaultSpecifier",{enumerable:!0,get:function(){return b.exportDefaultSpecifier}});Object.defineProperty(T,"ExportNamedDeclaration",{enumerable:!0,get:function(){return b.exportNamedDeclaration}});Object.defineProperty(T,"ExportNamespaceSpecifier",{enumerable:!0,get:function(){return b.exportNamespaceSpecifier}});Object.defineProperty(T,"ExportSpecifier",{enumerable:!0,get:function(){return b.exportSpecifier}});Object.defineProperty(T,"ExpressionStatement",{enumerable:!0,get:function(){return b.expressionStatement}});Object.defineProperty(T,"File",{enumerable:!0,get:function(){return b.file}});Object.defineProperty(T,"ForInStatement",{enumerable:!0,get:function(){return b.forInStatement}});Object.defineProperty(T,"ForOfStatement",{enumerable:!0,get:function(){return b.forOfStatement}});Object.defineProperty(T,"ForStatement",{enumerable:!0,get:function(){return b.forStatement}});Object.defineProperty(T,"FunctionDeclaration",{enumerable:!0,get:function(){return b.functionDeclaration}});Object.defineProperty(T,"FunctionExpression",{enumerable:!0,get:function(){return b.functionExpression}});Object.defineProperty(T,"FunctionTypeAnnotation",{enumerable:!0,get:function(){return b.functionTypeAnnotation}});Object.defineProperty(T,"FunctionTypeParam",{enumerable:!0,get:function(){return b.functionTypeParam}});Object.defineProperty(T,"GenericTypeAnnotation",{enumerable:!0,get:function(){return b.genericTypeAnnotation}});Object.defineProperty(T,"Identifier",{enumerable:!0,get:function(){return b.identifier}});Object.defineProperty(T,"IfStatement",{enumerable:!0,get:function(){return b.ifStatement}});Object.defineProperty(T,"Import",{enumerable:!0,get:function(){return b.import}});Object.defineProperty(T,"ImportAttribute",{enumerable:!0,get:function(){return b.importAttribute}});Object.defineProperty(T,"ImportDeclaration",{enumerable:!0,get:function(){return b.importDeclaration}});Object.defineProperty(T,"ImportDefaultSpecifier",{enumerable:!0,get:function(){return b.importDefaultSpecifier}});Object.defineProperty(T,"ImportExpression",{enumerable:!0,get:function(){return b.importExpression}});Object.defineProperty(T,"ImportNamespaceSpecifier",{enumerable:!0,get:function(){return b.importNamespaceSpecifier}});Object.defineProperty(T,"ImportSpecifier",{enumerable:!0,get:function(){return b.importSpecifier}});Object.defineProperty(T,"IndexedAccessType",{enumerable:!0,get:function(){return b.indexedAccessType}});Object.defineProperty(T,"InferredPredicate",{enumerable:!0,get:function(){return b.inferredPredicate}});Object.defineProperty(T,"InterfaceDeclaration",{enumerable:!0,get:function(){return b.interfaceDeclaration}});Object.defineProperty(T,"InterfaceExtends",{enumerable:!0,get:function(){return b.interfaceExtends}});Object.defineProperty(T,"InterfaceTypeAnnotation",{enumerable:!0,get:function(){return b.interfaceTypeAnnotation}});Object.defineProperty(T,"InterpreterDirective",{enumerable:!0,get:function(){return b.interpreterDirective}});Object.defineProperty(T,"IntersectionTypeAnnotation",{enumerable:!0,get:function(){return b.intersectionTypeAnnotation}});Object.defineProperty(T,"JSXAttribute",{enumerable:!0,get:function(){return b.jsxAttribute}});Object.defineProperty(T,"JSXClosingElement",{enumerable:!0,get:function(){return b.jsxClosingElement}});Object.defineProperty(T,"JSXClosingFragment",{enumerable:!0,get:function(){return b.jsxClosingFragment}});Object.defineProperty(T,"JSXElement",{enumerable:!0,get:function(){return b.jsxElement}});Object.defineProperty(T,"JSXEmptyExpression",{enumerable:!0,get:function(){return b.jsxEmptyExpression}});Object.defineProperty(T,"JSXExpressionContainer",{enumerable:!0,get:function(){return b.jsxExpressionContainer}});Object.defineProperty(T,"JSXFragment",{enumerable:!0,get:function(){return b.jsxFragment}});Object.defineProperty(T,"JSXIdentifier",{enumerable:!0,get:function(){return b.jsxIdentifier}});Object.defineProperty(T,"JSXMemberExpression",{enumerable:!0,get:function(){return b.jsxMemberExpression}});Object.defineProperty(T,"JSXNamespacedName",{enumerable:!0,get:function(){return b.jsxNamespacedName}});Object.defineProperty(T,"JSXOpeningElement",{enumerable:!0,get:function(){return b.jsxOpeningElement}});Object.defineProperty(T,"JSXOpeningFragment",{enumerable:!0,get:function(){return b.jsxOpeningFragment}});Object.defineProperty(T,"JSXSpreadAttribute",{enumerable:!0,get:function(){return b.jsxSpreadAttribute}});Object.defineProperty(T,"JSXSpreadChild",{enumerable:!0,get:function(){return b.jsxSpreadChild}});Object.defineProperty(T,"JSXText",{enumerable:!0,get:function(){return b.jsxText}});Object.defineProperty(T,"LabeledStatement",{enumerable:!0,get:function(){return b.labeledStatement}});Object.defineProperty(T,"LogicalExpression",{enumerable:!0,get:function(){return b.logicalExpression}});Object.defineProperty(T,"MemberExpression",{enumerable:!0,get:function(){return b.memberExpression}});Object.defineProperty(T,"MetaProperty",{enumerable:!0,get:function(){return b.metaProperty}});Object.defineProperty(T,"MixedTypeAnnotation",{enumerable:!0,get:function(){return b.mixedTypeAnnotation}});Object.defineProperty(T,"ModuleExpression",{enumerable:!0,get:function(){return b.moduleExpression}});Object.defineProperty(T,"NewExpression",{enumerable:!0,get:function(){return b.newExpression}});Object.defineProperty(T,"Noop",{enumerable:!0,get:function(){return b.noop}});Object.defineProperty(T,"NullLiteral",{enumerable:!0,get:function(){return b.nullLiteral}});Object.defineProperty(T,"NullLiteralTypeAnnotation",{enumerable:!0,get:function(){return b.nullLiteralTypeAnnotation}});Object.defineProperty(T,"NullableTypeAnnotation",{enumerable:!0,get:function(){return b.nullableTypeAnnotation}});Object.defineProperty(T,"NumberLiteral",{enumerable:!0,get:function(){return b.numberLiteral}});Object.defineProperty(T,"NumberLiteralTypeAnnotation",{enumerable:!0,get:function(){return b.numberLiteralTypeAnnotation}});Object.defineProperty(T,"NumberTypeAnnotation",{enumerable:!0,get:function(){return b.numberTypeAnnotation}});Object.defineProperty(T,"NumericLiteral",{enumerable:!0,get:function(){return b.numericLiteral}});Object.defineProperty(T,"ObjectExpression",{enumerable:!0,get:function(){return b.objectExpression}});Object.defineProperty(T,"ObjectMethod",{enumerable:!0,get:function(){return b.objectMethod}});Object.defineProperty(T,"ObjectPattern",{enumerable:!0,get:function(){return b.objectPattern}});Object.defineProperty(T,"ObjectProperty",{enumerable:!0,get:function(){return b.objectProperty}});Object.defineProperty(T,"ObjectTypeAnnotation",{enumerable:!0,get:function(){return b.objectTypeAnnotation}});Object.defineProperty(T,"ObjectTypeCallProperty",{enumerable:!0,get:function(){return b.objectTypeCallProperty}});Object.defineProperty(T,"ObjectTypeIndexer",{enumerable:!0,get:function(){return b.objectTypeIndexer}});Object.defineProperty(T,"ObjectTypeInternalSlot",{enumerable:!0,get:function(){return b.objectTypeInternalSlot}});Object.defineProperty(T,"ObjectTypeProperty",{enumerable:!0,get:function(){return b.objectTypeProperty}});Object.defineProperty(T,"ObjectTypeSpreadProperty",{enumerable:!0,get:function(){return b.objectTypeSpreadProperty}});Object.defineProperty(T,"OpaqueType",{enumerable:!0,get:function(){return b.opaqueType}});Object.defineProperty(T,"OptionalCallExpression",{enumerable:!0,get:function(){return b.optionalCallExpression}});Object.defineProperty(T,"OptionalIndexedAccessType",{enumerable:!0,get:function(){return b.optionalIndexedAccessType}});Object.defineProperty(T,"OptionalMemberExpression",{enumerable:!0,get:function(){return b.optionalMemberExpression}});Object.defineProperty(T,"ParenthesizedExpression",{enumerable:!0,get:function(){return b.parenthesizedExpression}});Object.defineProperty(T,"PipelineBareFunction",{enumerable:!0,get:function(){return b.pipelineBareFunction}});Object.defineProperty(T,"PipelinePrimaryTopicReference",{enumerable:!0,get:function(){return b.pipelinePrimaryTopicReference}});Object.defineProperty(T,"PipelineTopicExpression",{enumerable:!0,get:function(){return b.pipelineTopicExpression}});Object.defineProperty(T,"Placeholder",{enumerable:!0,get:function(){return b.placeholder}});Object.defineProperty(T,"PrivateName",{enumerable:!0,get:function(){return b.privateName}});Object.defineProperty(T,"Program",{enumerable:!0,get:function(){return b.program}});Object.defineProperty(T,"QualifiedTypeIdentifier",{enumerable:!0,get:function(){return b.qualifiedTypeIdentifier}});Object.defineProperty(T,"RecordExpression",{enumerable:!0,get:function(){return b.recordExpression}});Object.defineProperty(T,"RegExpLiteral",{enumerable:!0,get:function(){return b.regExpLiteral}});Object.defineProperty(T,"RegexLiteral",{enumerable:!0,get:function(){return b.regexLiteral}});Object.defineProperty(T,"RestElement",{enumerable:!0,get:function(){return b.restElement}});Object.defineProperty(T,"RestProperty",{enumerable:!0,get:function(){return b.restProperty}});Object.defineProperty(T,"ReturnStatement",{enumerable:!0,get:function(){return b.returnStatement}});Object.defineProperty(T,"SequenceExpression",{enumerable:!0,get:function(){return b.sequenceExpression}});Object.defineProperty(T,"SpreadElement",{enumerable:!0,get:function(){return b.spreadElement}});Object.defineProperty(T,"SpreadProperty",{enumerable:!0,get:function(){return b.spreadProperty}});Object.defineProperty(T,"StaticBlock",{enumerable:!0,get:function(){return b.staticBlock}});Object.defineProperty(T,"StringLiteral",{enumerable:!0,get:function(){return b.stringLiteral}});Object.defineProperty(T,"StringLiteralTypeAnnotation",{enumerable:!0,get:function(){return b.stringLiteralTypeAnnotation}});Object.defineProperty(T,"StringTypeAnnotation",{enumerable:!0,get:function(){return b.stringTypeAnnotation}});Object.defineProperty(T,"Super",{enumerable:!0,get:function(){return b.super}});Object.defineProperty(T,"SwitchCase",{enumerable:!0,get:function(){return b.switchCase}});Object.defineProperty(T,"SwitchStatement",{enumerable:!0,get:function(){return b.switchStatement}});Object.defineProperty(T,"SymbolTypeAnnotation",{enumerable:!0,get:function(){return b.symbolTypeAnnotation}});Object.defineProperty(T,"TSAnyKeyword",{enumerable:!0,get:function(){return b.tsAnyKeyword}});Object.defineProperty(T,"TSArrayType",{enumerable:!0,get:function(){return b.tsArrayType}});Object.defineProperty(T,"TSAsExpression",{enumerable:!0,get:function(){return b.tsAsExpression}});Object.defineProperty(T,"TSBigIntKeyword",{enumerable:!0,get:function(){return b.tsBigIntKeyword}});Object.defineProperty(T,"TSBooleanKeyword",{enumerable:!0,get:function(){return b.tsBooleanKeyword}});Object.defineProperty(T,"TSCallSignatureDeclaration",{enumerable:!0,get:function(){return b.tsCallSignatureDeclaration}});Object.defineProperty(T,"TSConditionalType",{enumerable:!0,get:function(){return b.tsConditionalType}});Object.defineProperty(T,"TSConstructSignatureDeclaration",{enumerable:!0,get:function(){return b.tsConstructSignatureDeclaration}});Object.defineProperty(T,"TSConstructorType",{enumerable:!0,get:function(){return b.tsConstructorType}});Object.defineProperty(T,"TSDeclareFunction",{enumerable:!0,get:function(){return b.tsDeclareFunction}});Object.defineProperty(T,"TSDeclareMethod",{enumerable:!0,get:function(){return b.tsDeclareMethod}});Object.defineProperty(T,"TSEnumDeclaration",{enumerable:!0,get:function(){return b.tsEnumDeclaration}});Object.defineProperty(T,"TSEnumMember",{enumerable:!0,get:function(){return b.tsEnumMember}});Object.defineProperty(T,"TSExportAssignment",{enumerable:!0,get:function(){return b.tsExportAssignment}});Object.defineProperty(T,"TSExpressionWithTypeArguments",{enumerable:!0,get:function(){return b.tsExpressionWithTypeArguments}});Object.defineProperty(T,"TSExternalModuleReference",{enumerable:!0,get:function(){return b.tsExternalModuleReference}});Object.defineProperty(T,"TSFunctionType",{enumerable:!0,get:function(){return b.tsFunctionType}});Object.defineProperty(T,"TSImportEqualsDeclaration",{enumerable:!0,get:function(){return b.tsImportEqualsDeclaration}});Object.defineProperty(T,"TSImportType",{enumerable:!0,get:function(){return b.tsImportType}});Object.defineProperty(T,"TSIndexSignature",{enumerable:!0,get:function(){return b.tsIndexSignature}});Object.defineProperty(T,"TSIndexedAccessType",{enumerable:!0,get:function(){return b.tsIndexedAccessType}});Object.defineProperty(T,"TSInferType",{enumerable:!0,get:function(){return b.tsInferType}});Object.defineProperty(T,"TSInstantiationExpression",{enumerable:!0,get:function(){return b.tsInstantiationExpression}});Object.defineProperty(T,"TSInterfaceBody",{enumerable:!0,get:function(){return b.tsInterfaceBody}});Object.defineProperty(T,"TSInterfaceDeclaration",{enumerable:!0,get:function(){return b.tsInterfaceDeclaration}});Object.defineProperty(T,"TSIntersectionType",{enumerable:!0,get:function(){return b.tsIntersectionType}});Object.defineProperty(T,"TSIntrinsicKeyword",{enumerable:!0,get:function(){return b.tsIntrinsicKeyword}});Object.defineProperty(T,"TSLiteralType",{enumerable:!0,get:function(){return b.tsLiteralType}});Object.defineProperty(T,"TSMappedType",{enumerable:!0,get:function(){return b.tsMappedType}});Object.defineProperty(T,"TSMethodSignature",{enumerable:!0,get:function(){return b.tsMethodSignature}});Object.defineProperty(T,"TSModuleBlock",{enumerable:!0,get:function(){return b.tsModuleBlock}});Object.defineProperty(T,"TSModuleDeclaration",{enumerable:!0,get:function(){return b.tsModuleDeclaration}});Object.defineProperty(T,"TSNamedTupleMember",{enumerable:!0,get:function(){return b.tsNamedTupleMember}});Object.defineProperty(T,"TSNamespaceExportDeclaration",{enumerable:!0,get:function(){return b.tsNamespaceExportDeclaration}});Object.defineProperty(T,"TSNeverKeyword",{enumerable:!0,get:function(){return b.tsNeverKeyword}});Object.defineProperty(T,"TSNonNullExpression",{enumerable:!0,get:function(){return b.tsNonNullExpression}});Object.defineProperty(T,"TSNullKeyword",{enumerable:!0,get:function(){return b.tsNullKeyword}});Object.defineProperty(T,"TSNumberKeyword",{enumerable:!0,get:function(){return b.tsNumberKeyword}});Object.defineProperty(T,"TSObjectKeyword",{enumerable:!0,get:function(){return b.tsObjectKeyword}});Object.defineProperty(T,"TSOptionalType",{enumerable:!0,get:function(){return b.tsOptionalType}});Object.defineProperty(T,"TSParameterProperty",{enumerable:!0,get:function(){return b.tsParameterProperty}});Object.defineProperty(T,"TSParenthesizedType",{enumerable:!0,get:function(){return b.tsParenthesizedType}});Object.defineProperty(T,"TSPropertySignature",{enumerable:!0,get:function(){return b.tsPropertySignature}});Object.defineProperty(T,"TSQualifiedName",{enumerable:!0,get:function(){return b.tsQualifiedName}});Object.defineProperty(T,"TSRestType",{enumerable:!0,get:function(){return b.tsRestType}});Object.defineProperty(T,"TSSatisfiesExpression",{enumerable:!0,get:function(){return b.tsSatisfiesExpression}});Object.defineProperty(T,"TSStringKeyword",{enumerable:!0,get:function(){return b.tsStringKeyword}});Object.defineProperty(T,"TSSymbolKeyword",{enumerable:!0,get:function(){return b.tsSymbolKeyword}});Object.defineProperty(T,"TSThisType",{enumerable:!0,get:function(){return b.tsThisType}});Object.defineProperty(T,"TSTupleType",{enumerable:!0,get:function(){return b.tsTupleType}});Object.defineProperty(T,"TSTypeAliasDeclaration",{enumerable:!0,get:function(){return b.tsTypeAliasDeclaration}});Object.defineProperty(T,"TSTypeAnnotation",{enumerable:!0,get:function(){return b.tsTypeAnnotation}});Object.defineProperty(T,"TSTypeAssertion",{enumerable:!0,get:function(){return b.tsTypeAssertion}});Object.defineProperty(T,"TSTypeLiteral",{enumerable:!0,get:function(){return b.tsTypeLiteral}});Object.defineProperty(T,"TSTypeOperator",{enumerable:!0,get:function(){return b.tsTypeOperator}});Object.defineProperty(T,"TSTypeParameter",{enumerable:!0,get:function(){return b.tsTypeParameter}});Object.defineProperty(T,"TSTypeParameterDeclaration",{enumerable:!0,get:function(){return b.tsTypeParameterDeclaration}});Object.defineProperty(T,"TSTypeParameterInstantiation",{enumerable:!0,get:function(){return b.tsTypeParameterInstantiation}});Object.defineProperty(T,"TSTypePredicate",{enumerable:!0,get:function(){return b.tsTypePredicate}});Object.defineProperty(T,"TSTypeQuery",{enumerable:!0,get:function(){return b.tsTypeQuery}});Object.defineProperty(T,"TSTypeReference",{enumerable:!0,get:function(){return b.tsTypeReference}});Object.defineProperty(T,"TSUndefinedKeyword",{enumerable:!0,get:function(){return b.tsUndefinedKeyword}});Object.defineProperty(T,"TSUnionType",{enumerable:!0,get:function(){return b.tsUnionType}});Object.defineProperty(T,"TSUnknownKeyword",{enumerable:!0,get:function(){return b.tsUnknownKeyword}});Object.defineProperty(T,"TSVoidKeyword",{enumerable:!0,get:function(){return b.tsVoidKeyword}});Object.defineProperty(T,"TaggedTemplateExpression",{enumerable:!0,get:function(){return b.taggedTemplateExpression}});Object.defineProperty(T,"TemplateElement",{enumerable:!0,get:function(){return b.templateElement}});Object.defineProperty(T,"TemplateLiteral",{enumerable:!0,get:function(){return b.templateLiteral}});Object.defineProperty(T,"ThisExpression",{enumerable:!0,get:function(){return b.thisExpression}});Object.defineProperty(T,"ThisTypeAnnotation",{enumerable:!0,get:function(){return b.thisTypeAnnotation}});Object.defineProperty(T,"ThrowStatement",{enumerable:!0,get:function(){return b.throwStatement}});Object.defineProperty(T,"TopicReference",{enumerable:!0,get:function(){return b.topicReference}});Object.defineProperty(T,"TryStatement",{enumerable:!0,get:function(){return b.tryStatement}});Object.defineProperty(T,"TupleExpression",{enumerable:!0,get:function(){return b.tupleExpression}});Object.defineProperty(T,"TupleTypeAnnotation",{enumerable:!0,get:function(){return b.tupleTypeAnnotation}});Object.defineProperty(T,"TypeAlias",{enumerable:!0,get:function(){return b.typeAlias}});Object.defineProperty(T,"TypeAnnotation",{enumerable:!0,get:function(){return b.typeAnnotation}});Object.defineProperty(T,"TypeCastExpression",{enumerable:!0,get:function(){return b.typeCastExpression}});Object.defineProperty(T,"TypeParameter",{enumerable:!0,get:function(){return b.typeParameter}});Object.defineProperty(T,"TypeParameterDeclaration",{enumerable:!0,get:function(){return b.typeParameterDeclaration}});Object.defineProperty(T,"TypeParameterInstantiation",{enumerable:!0,get:function(){return b.typeParameterInstantiation}});Object.defineProperty(T,"TypeofTypeAnnotation",{enumerable:!0,get:function(){return b.typeofTypeAnnotation}});Object.defineProperty(T,"UnaryExpression",{enumerable:!0,get:function(){return b.unaryExpression}});Object.defineProperty(T,"UnionTypeAnnotation",{enumerable:!0,get:function(){return b.unionTypeAnnotation}});Object.defineProperty(T,"UpdateExpression",{enumerable:!0,get:function(){return b.updateExpression}});Object.defineProperty(T,"V8IntrinsicIdentifier",{enumerable:!0,get:function(){return b.v8IntrinsicIdentifier}});Object.defineProperty(T,"VariableDeclaration",{enumerable:!0,get:function(){return b.variableDeclaration}});Object.defineProperty(T,"VariableDeclarator",{enumerable:!0,get:function(){return b.variableDeclarator}});Object.defineProperty(T,"Variance",{enumerable:!0,get:function(){return b.variance}});Object.defineProperty(T,"VoidTypeAnnotation",{enumerable:!0,get:function(){return b.voidTypeAnnotation}});Object.defineProperty(T,"WhileStatement",{enumerable:!0,get:function(){return b.whileStatement}});Object.defineProperty(T,"WithStatement",{enumerable:!0,get:function(){return b.withStatement}});Object.defineProperty(T,"YieldExpression",{enumerable:!0,get:function(){return b.yieldExpression}});var b=be();});var Yl=A(_s=>{Object.defineProperty(_s,"__esModule",{value:!0});_s.buildUndefinedNode=zO;var Vl=be();function zO(){return (0, Vl.unaryExpression)("void",(0, Vl.numericLiteral)(0),!0)}});var et=A(Ms=>{Object.defineProperty(Ms,"__esModule",{value:!0});Ms.default=HO;var Xl=De(),Jl=le(),Ke=Function.call.bind(Object.prototype.hasOwnProperty);function $l(t,e,r,i){return t&&typeof t.type=="string"?zl(t,e,r,i):t}function Wl(t,e,r,i){return Array.isArray(t)?t.map(s=>$l(s,e,r,i)):$l(t,e,r,i)}function HO(t,e=!0,r=!1){return zl(t,e,r,new Map)}function zl(t,e=!0,r=!1,i){if(!t)return t;let{type:s}=t,a={type:t.type};if((0, Jl.isIdentifier)(t))a.name=t.name,Ke(t,"optional")&&typeof t.optional=="boolean"&&(a.optional=t.optional),Ke(t,"typeAnnotation")&&(a.typeAnnotation=e?Wl(t.typeAnnotation,!0,r,i):t.typeAnnotation);else if(Ke(Xl.NODE_FIELDS,s))for(let n of Object.keys(Xl.NODE_FIELDS[s]))Ke(t,n)&&(e?a[n]=(0, Jl.isFile)(t)&&n==="comments"?Xr(t.comments,e,r,i):Wl(t[n],!0,r,i):a[n]=t[n]);else throw new Error(`Unknown node type: "${s}"`);return Ke(t,"loc")&&(r?a.loc=null:a.loc=t.loc),Ke(t,"leadingComments")&&(a.leadingComments=Xr(t.leadingComments,e,r,i)),Ke(t,"innerComments")&&(a.innerComments=Xr(t.innerComments,e,r,i)),Ke(t,"trailingComments")&&(a.trailingComments=Xr(t.trailingComments,e,r,i)),Ke(t,"extra")&&(a.extra=Object.assign({},t.extra)),a}function Xr(t,e,r,i){return !t||!e?t:t.map(s=>{let a=i.get(s);if(a)return a;let{type:n,value:o,loc:l}=s,u={type:n,value:o,loc:l};return r&&(u.loc=null),i.set(s,u),u})}});var Hl=A(js=>{Object.defineProperty(js,"__esModule",{value:!0});js.default=QO;var GO=et();function QO(t){return (0, GO.default)(t,!1)}});var Gl=A(Bs=>{Object.defineProperty(Bs,"__esModule",{value:!0});Bs.default=eN;var ZO=et();function eN(t){return (0, ZO.default)(t)}});var Ql=A(Fs=>{Object.defineProperty(Fs,"__esModule",{value:!0});Fs.default=rN;var tN=et();function rN(t){return (0, tN.default)(t,!0,!0)}});var Zl=A(Rs=>{Object.defineProperty(Rs,"__esModule",{value:!0});Rs.default=sN;var iN=et();function sN(t){return (0, iN.default)(t,!1,!0)}});var qs=A(Us=>{Object.defineProperty(Us,"__esModule",{value:!0});Us.default=aN;function aN(t,e,r){if(!r||!t)return t;let i=`${e}Comments`;return t[i]?e==="leading"?t[i]=r.concat(t[i]):t[i].push(...r):t[i]=r,t}});var eu=A(Ks=>{Object.defineProperty(Ks,"__esModule",{value:!0});Ks.default=oN;var nN=qs();function oN(t,e,r,i){return (0, nN.default)(t,e,[{type:i?"CommentLine":"CommentBlock",value:r}])}});var Jr=A(Vs=>{Object.defineProperty(Vs,"__esModule",{value:!0});Vs.default=lN;function lN(t,e,r){e&&r&&(e[t]=Array.from(new Set([].concat(e[t],r[t]).filter(Boolean))));}});var Xs=A(Ys=>{Object.defineProperty(Ys,"__esModule",{value:!0});Ys.default=cN;var uN=Jr();function cN(t,e){(0, uN.default)("innerComments",t,e);}});var $s=A(Js=>{Object.defineProperty(Js,"__esModule",{value:!0});Js.default=fN;var pN=Jr();function fN(t,e){(0, pN.default)("leadingComments",t,e);}});var zs=A(Ws=>{Object.defineProperty(Ws,"__esModule",{value:!0});Ws.default=hN;var dN=Jr();function hN(t,e){(0, dN.default)("trailingComments",t,e);}});var Gs=A(Hs=>{Object.defineProperty(Hs,"__esModule",{value:!0});Hs.default=bN;var yN=zs(),mN=$s(),TN=Xs();function bN(t,e){return (0, yN.default)(t,e),(0, mN.default)(t,e),(0, TN.default)(t,e),t}});var tu=A(Qs=>{Object.defineProperty(Qs,"__esModule",{value:!0});Qs.default=xN;var SN=Ge();function xN(t){return SN.COMMENT_KEYS.forEach(e=>{t[e]=null;}),t}});var ru=A(C=>{Object.defineProperty(C,"__esModule",{value:!0});C.WHILE_TYPES=C.USERWHITESPACABLE_TYPES=C.UNARYLIKE_TYPES=C.TYPESCRIPT_TYPES=C.TSTYPE_TYPES=C.TSTYPEELEMENT_TYPES=C.TSENTITYNAME_TYPES=C.TSBASETYPE_TYPES=C.TERMINATORLESS_TYPES=C.STATEMENT_TYPES=C.STANDARDIZED_TYPES=C.SCOPABLE_TYPES=C.PUREISH_TYPES=C.PROPERTY_TYPES=C.PRIVATE_TYPES=C.PATTERN_TYPES=C.PATTERNLIKE_TYPES=C.OBJECTMEMBER_TYPES=C.MODULESPECIFIER_TYPES=C.MODULEDECLARATION_TYPES=C.MISCELLANEOUS_TYPES=C.METHOD_TYPES=C.LVAL_TYPES=C.LOOP_TYPES=C.LITERAL_TYPES=C.JSX_TYPES=C.IMPORTOREXPORTDECLARATION_TYPES=C.IMMUTABLE_TYPES=C.FUNCTION_TYPES=C.FUNCTIONPARENT_TYPES=C.FOR_TYPES=C.FORXSTATEMENT_TYPES=C.FLOW_TYPES=C.FLOWTYPE_TYPES=C.FLOWPREDICATE_TYPES=C.FLOWDECLARATION_TYPES=C.FLOWBASEANNOTATION_TYPES=C.EXPRESSION_TYPES=C.EXPRESSIONWRAPPER_TYPES=C.EXPORTDECLARATION_TYPES=C.ENUMMEMBER_TYPES=C.ENUMBODY_TYPES=C.DECLARATION_TYPES=C.CONDITIONAL_TYPES=C.COMPLETIONSTATEMENT_TYPES=C.CLASS_TYPES=C.BLOCK_TYPES=C.BLOCKPARENT_TYPES=C.BINARY_TYPES=C.ACCESSOR_TYPES=void 0;var X=De();C.STANDARDIZED_TYPES=X.FLIPPED_ALIAS_KEYS.Standardized;C.EXPRESSION_TYPES=X.FLIPPED_ALIAS_KEYS.Expression;C.BINARY_TYPES=X.FLIPPED_ALIAS_KEYS.Binary;C.SCOPABLE_TYPES=X.FLIPPED_ALIAS_KEYS.Scopable;C.BLOCKPARENT_TYPES=X.FLIPPED_ALIAS_KEYS.BlockParent;C.BLOCK_TYPES=X.FLIPPED_ALIAS_KEYS.Block;C.STATEMENT_TYPES=X.FLIPPED_ALIAS_KEYS.Statement;C.TERMINATORLESS_TYPES=X.FLIPPED_ALIAS_KEYS.Terminatorless;C.COMPLETIONSTATEMENT_TYPES=X.FLIPPED_ALIAS_KEYS.CompletionStatement;C.CONDITIONAL_TYPES=X.FLIPPED_ALIAS_KEYS.Conditional;C.LOOP_TYPES=X.FLIPPED_ALIAS_KEYS.Loop;C.WHILE_TYPES=X.FLIPPED_ALIAS_KEYS.While;C.EXPRESSIONWRAPPER_TYPES=X.FLIPPED_ALIAS_KEYS.ExpressionWrapper;C.FOR_TYPES=X.FLIPPED_ALIAS_KEYS.For;C.FORXSTATEMENT_TYPES=X.FLIPPED_ALIAS_KEYS.ForXStatement;C.FUNCTION_TYPES=X.FLIPPED_ALIAS_KEYS.Function;C.FUNCTIONPARENT_TYPES=X.FLIPPED_ALIAS_KEYS.FunctionParent;C.PUREISH_TYPES=X.FLIPPED_ALIAS_KEYS.Pureish;C.DECLARATION_TYPES=X.FLIPPED_ALIAS_KEYS.Declaration;C.PATTERNLIKE_TYPES=X.FLIPPED_ALIAS_KEYS.PatternLike;C.LVAL_TYPES=X.FLIPPED_ALIAS_KEYS.LVal;C.TSENTITYNAME_TYPES=X.FLIPPED_ALIAS_KEYS.TSEntityName;C.LITERAL_TYPES=X.FLIPPED_ALIAS_KEYS.Literal;C.IMMUTABLE_TYPES=X.FLIPPED_ALIAS_KEYS.Immutable;C.USERWHITESPACABLE_TYPES=X.FLIPPED_ALIAS_KEYS.UserWhitespacable;C.METHOD_TYPES=X.FLIPPED_ALIAS_KEYS.Method;C.OBJECTMEMBER_TYPES=X.FLIPPED_ALIAS_KEYS.ObjectMember;C.PROPERTY_TYPES=X.FLIPPED_ALIAS_KEYS.Property;C.UNARYLIKE_TYPES=X.FLIPPED_ALIAS_KEYS.UnaryLike;C.PATTERN_TYPES=X.FLIPPED_ALIAS_KEYS.Pattern;C.CLASS_TYPES=X.FLIPPED_ALIAS_KEYS.Class;var PN=C.IMPORTOREXPORTDECLARATION_TYPES=X.FLIPPED_ALIAS_KEYS.ImportOrExportDeclaration;C.EXPORTDECLARATION_TYPES=X.FLIPPED_ALIAS_KEYS.ExportDeclaration;C.MODULESPECIFIER_TYPES=X.FLIPPED_ALIAS_KEYS.ModuleSpecifier;C.ACCESSOR_TYPES=X.FLIPPED_ALIAS_KEYS.Accessor;C.PRIVATE_TYPES=X.FLIPPED_ALIAS_KEYS.Private;C.FLOW_TYPES=X.FLIPPED_ALIAS_KEYS.Flow;C.FLOWTYPE_TYPES=X.FLIPPED_ALIAS_KEYS.FlowType;C.FLOWBASEANNOTATION_TYPES=X.FLIPPED_ALIAS_KEYS.FlowBaseAnnotation;C.FLOWDECLARATION_TYPES=X.FLIPPED_ALIAS_KEYS.FlowDeclaration;C.FLOWPREDICATE_TYPES=X.FLIPPED_ALIAS_KEYS.FlowPredicate;C.ENUMBODY_TYPES=X.FLIPPED_ALIAS_KEYS.EnumBody;C.ENUMMEMBER_TYPES=X.FLIPPED_ALIAS_KEYS.EnumMember;C.JSX_TYPES=X.FLIPPED_ALIAS_KEYS.JSX;C.MISCELLANEOUS_TYPES=X.FLIPPED_ALIAS_KEYS.Miscellaneous;C.TYPESCRIPT_TYPES=X.FLIPPED_ALIAS_KEYS.TypeScript;C.TSTYPEELEMENT_TYPES=X.FLIPPED_ALIAS_KEYS.TSTypeElement;C.TSTYPE_TYPES=X.FLIPPED_ALIAS_KEYS.TSType;C.TSBASETYPE_TYPES=X.FLIPPED_ALIAS_KEYS.TSBaseType;C.MODULEDECLARATION_TYPES=PN;});var ta=A(ea=>{Object.defineProperty(ea,"__esModule",{value:!0});ea.default=EN;var $r=le(),Zs=be();function EN(t,e){if((0, $r.isBlockStatement)(t))return t;let r=[];return (0, $r.isEmptyStatement)(t)?r=[]:((0, $r.isStatement)(t)||((0, $r.isFunction)(e)?t=(0, Zs.returnStatement)(t):t=(0, Zs.expressionStatement)(t)),r=[t]),(0, Zs.blockStatement)(r)}});var iu=A(ra=>{Object.defineProperty(ra,"__esModule",{value:!0});ra.default=AN;var gN=ta();function AN(t,e="body"){let r=(0, gN.default)(t[e],t);return t[e]=r,r}});var sa=A(ia=>{Object.defineProperty(ia,"__esModule",{value:!0});ia.default=wN;var vN=gt(),IN=Ht();function wN(t){t=t+"";let e="";for(let r of t)e+=(0, IN.isIdentifierChar)(r.codePointAt(0))?r:"-";return e=e.replace(/^[-0-9]+/,""),e=e.replace(/[-\s]+(.)?/g,function(r,i){return i?i.toUpperCase():""}),(0, vN.default)(e)||(e=`_${e}`),e||"_"}});var su=A(aa=>{Object.defineProperty(aa,"__esModule",{value:!0});aa.default=NN;var ON=sa();function NN(t){return t=(0, ON.default)(t),(t==="eval"||t==="arguments")&&(t="_"+t),t}});var au=A(na=>{Object.defineProperty(na,"__esModule",{value:!0});na.default=LN;var CN=le(),DN=be();function LN(t,e=t.key||t.property){return !t.computed&&(0, CN.isIdentifier)(e)&&(e=(0, DN.stringLiteral)(e.name)),e}});var nu=A(Wr=>{Object.defineProperty(Wr,"__esModule",{value:!0});Wr.default=void 0;var sr=le();Wr.default=kN;function kN(t){if((0, sr.isExpressionStatement)(t)&&(t=t.expression),(0, sr.isExpression)(t))return t;if((0, sr.isClass)(t)?t.type="ClassExpression":(0, sr.isFunction)(t)&&(t.type="FunctionExpression"),!(0, sr.isExpression)(t))throw new Error(`cannot turn ${t.type} to an expression`);return t}});var ua=A(la=>{Object.defineProperty(la,"__esModule",{value:!0});la.default=oa;var _N=De();function oa(t,e,r){if(!t)return;let i=_N.VISITOR_KEYS[t.type];if(i){r=r||{},e(t,r);for(let s of i){let a=t[s];if(Array.isArray(a))for(let n of a)oa(n,e,r);else oa(a,e,r);}}}});var pa=A(ca=>{Object.defineProperty(ca,"__esModule",{value:!0});ca.default=BN;var MN=Ge(),ou=["tokens","start","end","loc","raw","rawValue"],jN=[...MN.COMMENT_KEYS,"comments",...ou];function BN(t,e={}){let r=e.preserveComments?ou:jN;for(let s of r)t[s]!=null&&(t[s]=void 0);for(let s of Object.keys(t))s[0]==="_"&&t[s]!=null&&(t[s]=void 0);let i=Object.getOwnPropertySymbols(t);for(let s of i)t[s]=null;}});var da=A(fa=>{Object.defineProperty(fa,"__esModule",{value:!0});fa.default=UN;var FN=ua(),RN=pa();function UN(t,e){return (0, FN.default)(t,RN.default,e),t}});var uu=A(ha=>{Object.defineProperty(ha,"__esModule",{value:!0});ha.default=dt;var lu=le(),qN=et(),KN=da();function dt(t,e=t.key){let r;return t.kind==="method"?dt.increment()+"":((0, lu.isIdentifier)(e)?r=e.name:(0, lu.isStringLiteral)(e)?r=JSON.stringify(e.value):r=JSON.stringify((0, KN.default)((0, qN.default)(e))),t.computed&&(r=`[${r}]`),t.static&&(r=`static:${r}`),r)}dt.uid=0;dt.increment=function(){return dt.uid>=Number.MAX_SAFE_INTEGER?dt.uid=0:dt.uid++};});var cu=A(Hr=>{Object.defineProperty(Hr,"__esModule",{value:!0});Hr.default=void 0;var zr=le(),VN=be();Hr.default=YN;function YN(t,e){if((0, zr.isStatement)(t))return t;let r=!1,i;if((0, zr.isClass)(t))r=!0,i="ClassDeclaration";else if((0, zr.isFunction)(t))r=!0,i="FunctionDeclaration";else if((0, zr.isAssignmentExpression)(t))return (0, VN.expressionStatement)(t);if(r&&!t.id&&(i=!1),!i){if(e)return !1;throw new Error(`cannot turn ${t.type} to a statement`)}return t.type=i,t}});var pu=A(Gr=>{Object.defineProperty(Gr,"__esModule",{value:!0});Gr.default=void 0;var XN=gt(),de=be();Gr.default=ya;var JN=Function.call.bind(Object.prototype.toString);function $N(t){return JN(t)==="[object RegExp]"}function WN(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return !1;let e=Object.getPrototypeOf(t);return e===null||Object.getPrototypeOf(e)===null}function ya(t){if(t===void 0)return (0, de.identifier)("undefined");if(t===!0||t===!1)return (0, de.booleanLiteral)(t);if(t===null)return (0, de.nullLiteral)();if(typeof t=="string")return (0, de.stringLiteral)(t);if(typeof t=="number"){let e;if(Number.isFinite(t))e=(0, de.numericLiteral)(Math.abs(t));else {let r;Number.isNaN(t)?r=(0, de.numericLiteral)(0):r=(0, de.numericLiteral)(1),e=(0, de.binaryExpression)("/",r,(0, de.numericLiteral)(0));}return (t<0||Object.is(t,-0))&&(e=(0, de.unaryExpression)("-",e)),e}if($N(t)){let e=t.source,r=t.toString().match(/\/([a-z]+|)$/)[1];return (0, de.regExpLiteral)(e,r)}if(Array.isArray(t))return (0, de.arrayExpression)(t.map(ya));if(WN(t)){let e=[];for(let r of Object.keys(t)){let i;(0, XN.default)(r)?i=(0, de.identifier)(r):i=(0, de.stringLiteral)(r),e.push((0, de.objectProperty)(i,ya(t[r])));}return (0, de.objectExpression)(e)}throw new Error("don't know how to turn this value into a node")}});var fu=A(ma=>{Object.defineProperty(ma,"__esModule",{value:!0});ma.default=HN;var zN=be();function HN(t,e,r=!1){return t.object=(0, zN.memberExpression)(t.object,t.property,t.computed),t.property=e,t.computed=!!r,t}});var hu=A(Ta=>{Object.defineProperty(Ta,"__esModule",{value:!0});Ta.default=QN;var du=Ge(),GN=Gs();function QN(t,e){if(!t||!e)return t;for(let r of du.INHERIT_KEYS.optional)t[r]==null&&(t[r]=e[r]);for(let r of Object.keys(e))r[0]==="_"&&r!=="__clone"&&(t[r]=e[r]);for(let r of du.INHERIT_KEYS.force)t[r]=e[r];return (0, GN.default)(t,e),t}});var yu=A(ba=>{Object.defineProperty(ba,"__esModule",{value:!0});ba.default=t2;var ZN=be(),e2=ve();function t2(t,e){if((0, e2.isSuper)(t.object))throw new Error("Cannot prepend node to super property access (`super.foo`).");return t.object=(0, ZN.memberExpression)(e,t.object),t}});var ar=A(xa=>{Object.defineProperty(xa,"__esModule",{value:!0});xa.default=Sa;var tt=le();function Sa(t,e,r,i){let s=[].concat(t),a=Object.create(null);for(;s.length;){let n=s.shift();if(!n||i&&((0, tt.isAssignmentExpression)(n)||(0, tt.isUnaryExpression)(n)))continue;let o=Sa.keys[n.type];if((0, tt.isIdentifier)(n)){e?(a[n.name]=a[n.name]||[]).push(n):a[n.name]=n;continue}if((0, tt.isExportDeclaration)(n)&&!(0, tt.isExportAllDeclaration)(n)){(0, tt.isDeclaration)(n.declaration)&&s.push(n.declaration);continue}if(r){if((0, tt.isFunctionDeclaration)(n)){s.push(n.id);continue}if((0, tt.isFunctionExpression)(n))continue}if(o)for(let l=0;l{Object.defineProperty(Qr,"__esModule",{value:!0});Qr.default=void 0;var r2=ar();Qr.default=i2;function i2(t,e){return (0, r2.default)(t,e,!0)}});var Tu=A(Ea=>{Object.defineProperty(Ea,"__esModule",{value:!0});Ea.default=a2;var s2=De();function a2(t,e,r){typeof e=="function"&&(e={enter:e});let{enter:i,exit:s}=e;Pa(t,i,s,r,[]);}function Pa(t,e,r,i,s){let a=s2.VISITOR_KEYS[t.type];if(a){e&&e(t,s,i);for(let n of a){let o=t[n];if(Array.isArray(o))for(let l=0;l{Object.defineProperty(ga,"__esModule",{value:!0});ga.default=o2;var n2=ar();function o2(t,e,r){if(r&&t.type==="Identifier"&&e.type==="ObjectProperty"&&r.type==="ObjectExpression")return !1;let i=n2.default.keys[e.type];if(i)for(let s=0;s=0)return !0}else if(n===t)return !0}return !1}});var va=A(Aa=>{Object.defineProperty(Aa,"__esModule",{value:!0});Aa.default=c2;var l2=le(),u2=Ge();function c2(t){return (0, l2.isVariableDeclaration)(t)&&(t.kind!=="var"||t[u2.BLOCK_SCOPED_SYMBOL])}});var xu=A(Ia=>{Object.defineProperty(Ia,"__esModule",{value:!0});Ia.default=f2;var Su=le(),p2=va();function f2(t){return (0, Su.isFunctionDeclaration)(t)||(0, Su.isClassDeclaration)(t)||(0, p2.default)(t)}});var Pu=A(wa=>{Object.defineProperty(wa,"__esModule",{value:!0});wa.default=y2;var d2=kr(),h2=le();function y2(t){return (0, d2.default)(t.type,"Immutable")?!0:(0, h2.isIdentifier)(t)?t.name==="undefined":!1}});var gu=A(Na=>{Object.defineProperty(Na,"__esModule",{value:!0});Na.default=Oa;var Eu=De();function Oa(t,e){if(typeof t!="object"||typeof e!="object"||t==null||e==null)return t===e;if(t.type!==e.type)return !1;let r=Object.keys(Eu.NODE_FIELDS[t.type]||t.type),i=Eu.VISITOR_KEYS[t.type];for(let s of r){let a=t[s],n=e[s];if(typeof a!=typeof n)return !1;if(!(a==null&&n==null)){if(a==null||n==null)return !1;if(Array.isArray(a)){if(!Array.isArray(n)||a.length!==n.length)return !1;for(let o=0;o{Object.defineProperty(Ca,"__esModule",{value:!0});Ca.default=m2;function m2(t,e,r){switch(e.type){case"MemberExpression":case"OptionalMemberExpression":return e.property===t?!!e.computed:e.object===t;case"JSXMemberExpression":return e.object===t;case"VariableDeclarator":return e.init===t;case"ArrowFunctionExpression":return e.body===t;case"PrivateName":return !1;case"ClassMethod":case"ClassPrivateMethod":case"ObjectMethod":return e.key===t?!!e.computed:!1;case"ObjectProperty":return e.key===t?!!e.computed:!r||r.type!=="ObjectPattern";case"ClassProperty":case"ClassAccessorProperty":return e.key===t?!!e.computed:!0;case"ClassPrivateProperty":return e.key!==t;case"ClassDeclaration":case"ClassExpression":return e.superClass===t;case"AssignmentExpression":return e.right===t;case"AssignmentPattern":return e.right===t;case"LabeledStatement":return !1;case"CatchClause":return !1;case"RestElement":return !1;case"BreakStatement":case"ContinueStatement":return !1;case"FunctionDeclaration":case"FunctionExpression":return !1;case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":return !1;case"ExportSpecifier":return r!=null&&r.source?!1:e.local===t;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":return !1;case"ImportAttribute":return !1;case"JSXAttribute":return !1;case"ObjectPattern":case"ArrayPattern":return !1;case"MetaProperty":return !1;case"ObjectTypeProperty":return e.key!==t;case"TSEnumMember":return e.id!==t;case"TSPropertySignature":return e.key===t?!!e.computed:!0}return !0}});var vu=A(Da=>{Object.defineProperty(Da,"__esModule",{value:!0});Da.default=T2;var ht=le();function T2(t,e){return (0, ht.isBlockStatement)(t)&&((0, ht.isFunction)(e)||(0, ht.isCatchClause)(e))?!1:(0, ht.isPattern)(t)&&((0, ht.isFunction)(e)||(0, ht.isCatchClause)(e))?!0:(0, ht.isScopable)(t)}});var wu=A(La=>{Object.defineProperty(La,"__esModule",{value:!0});La.default=b2;var Iu=le();function b2(t){return (0, Iu.isImportDefaultSpecifier)(t)||(0, Iu.isIdentifier)(t.imported||t.exported,{name:"default"})}});var Ou=A(ka=>{Object.defineProperty(ka,"__esModule",{value:!0});ka.default=P2;var S2=gt(),x2=new Set(["abstract","boolean","byte","char","double","enum","final","float","goto","implements","int","interface","long","native","package","private","protected","public","short","static","synchronized","throws","transient","volatile"]);function P2(t){return (0, S2.default)(t)&&!x2.has(t)}});var Nu=A(_a=>{Object.defineProperty(_a,"__esModule",{value:!0});_a.default=A2;var E2=le(),g2=Ge();function A2(t){return (0, E2.isVariableDeclaration)(t,{kind:"var"})&&!t[g2.BLOCK_SCOPED_SYMBOL]}});var Cu=A(ja=>{Object.defineProperty(ja,"__esModule",{value:!0});ja.default=Zr;var v2=ar(),yt=le(),Ma=be(),I2=et();function Zr(t,e,r){let i=[],s=!0;for(let a of t)if((0, yt.isEmptyStatement)(a)||(s=!1),(0, yt.isExpression)(a))i.push(a);else if((0, yt.isExpressionStatement)(a))i.push(a.expression);else if((0, yt.isVariableDeclaration)(a)){if(a.kind!=="var")return;for(let n of a.declarations){let o=(0, v2.default)(n);for(let l of Object.keys(o))r.push({kind:a.kind,id:(0, I2.default)(o[l])});n.init&&i.push((0, Ma.assignmentExpression)("=",n.id,n.init));}s=!0;}else if((0, yt.isIfStatement)(a)){let n=a.consequent?Zr([a.consequent],e,r):e.buildUndefinedNode(),o=a.alternate?Zr([a.alternate],e,r):e.buildUndefinedNode();if(!n||!o)return;i.push((0, Ma.conditionalExpression)(a.test,n,o));}else if((0, yt.isBlockStatement)(a)){let n=Zr(a.body,e,r);if(!n)return;i.push(n);}else if((0, yt.isEmptyStatement)(a))t.indexOf(a)===0&&(s=!0);else return;return s&&i.push(e.buildUndefinedNode()),i.length===1?i[0]:(0, Ma.sequenceExpression)(i)}});var Du=A(Ba=>{Object.defineProperty(Ba,"__esModule",{value:!0});Ba.default=O2;var w2=Cu();function O2(t,e){if(!(t!=null&&t.length))return;let r=[],i=(0, w2.default)(t,e,r);if(i){for(let s of r)e.push(s);return i}}});var ve=A(L=>{Object.defineProperty(L,"__esModule",{value:!0});var Ve={react:!0,assertNode:!0,createTypeAnnotationBasedOnTypeof:!0,createUnionTypeAnnotation:!0,createFlowUnionType:!0,createTSUnionType:!0,cloneNode:!0,clone:!0,cloneDeep:!0,cloneDeepWithoutLoc:!0,cloneWithoutLoc:!0,addComment:!0,addComments:!0,inheritInnerComments:!0,inheritLeadingComments:!0,inheritsComments:!0,inheritTrailingComments:!0,removeComments:!0,ensureBlock:!0,toBindingIdentifierName:!0,toBlock:!0,toComputedKey:!0,toExpression:!0,toIdentifier:!0,toKeyAlias:!0,toStatement:!0,valueToNode:!0,appendToMemberExpression:!0,inherits:!0,prependToMemberExpression:!0,removeProperties:!0,removePropertiesDeep:!0,removeTypeDuplicates:!0,getBindingIdentifiers:!0,getOuterBindingIdentifiers:!0,traverse:!0,traverseFast:!0,shallowEqual:!0,is:!0,isBinding:!0,isBlockScoped:!0,isImmutable:!0,isLet:!0,isNode:!0,isNodesEquivalent:!0,isPlaceholderType:!0,isReferenced:!0,isScope:!0,isSpecifierDefault:!0,isType:!0,isValidES3Identifier:!0,isValidIdentifier:!0,isVar:!0,matchesPattern:!0,validate:!0,buildMatchMemberExpression:!0,__internal__deprecationWarning:!0};Object.defineProperty(L,"__internal__deprecationWarning",{enumerable:!0,get:function(){return CC.default}});Object.defineProperty(L,"addComment",{enumerable:!0,get:function(){return U2.default}});Object.defineProperty(L,"addComments",{enumerable:!0,get:function(){return q2.default}});Object.defineProperty(L,"appendToMemberExpression",{enumerable:!0,get:function(){return rC.default}});Object.defineProperty(L,"assertNode",{enumerable:!0,get:function(){return L2.default}});Object.defineProperty(L,"buildMatchMemberExpression",{enumerable:!0,get:function(){return NC.default}});Object.defineProperty(L,"clone",{enumerable:!0,get:function(){return j2.default}});Object.defineProperty(L,"cloneDeep",{enumerable:!0,get:function(){return B2.default}});Object.defineProperty(L,"cloneDeepWithoutLoc",{enumerable:!0,get:function(){return F2.default}});Object.defineProperty(L,"cloneNode",{enumerable:!0,get:function(){return M2.default}});Object.defineProperty(L,"cloneWithoutLoc",{enumerable:!0,get:function(){return R2.default}});Object.defineProperty(L,"createFlowUnionType",{enumerable:!0,get:function(){return Lu.default}});Object.defineProperty(L,"createTSUnionType",{enumerable:!0,get:function(){return _2.default}});Object.defineProperty(L,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return k2.default}});Object.defineProperty(L,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return Lu.default}});Object.defineProperty(L,"ensureBlock",{enumerable:!0,get:function(){return $2.default}});Object.defineProperty(L,"getBindingIdentifiers",{enumerable:!0,get:function(){return lC.default}});Object.defineProperty(L,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return uC.default}});Object.defineProperty(L,"inheritInnerComments",{enumerable:!0,get:function(){return K2.default}});Object.defineProperty(L,"inheritLeadingComments",{enumerable:!0,get:function(){return V2.default}});Object.defineProperty(L,"inheritTrailingComments",{enumerable:!0,get:function(){return X2.default}});Object.defineProperty(L,"inherits",{enumerable:!0,get:function(){return iC.default}});Object.defineProperty(L,"inheritsComments",{enumerable:!0,get:function(){return Y2.default}});Object.defineProperty(L,"is",{enumerable:!0,get:function(){return fC.default}});Object.defineProperty(L,"isBinding",{enumerable:!0,get:function(){return dC.default}});Object.defineProperty(L,"isBlockScoped",{enumerable:!0,get:function(){return hC.default}});Object.defineProperty(L,"isImmutable",{enumerable:!0,get:function(){return yC.default}});Object.defineProperty(L,"isLet",{enumerable:!0,get:function(){return mC.default}});Object.defineProperty(L,"isNode",{enumerable:!0,get:function(){return TC.default}});Object.defineProperty(L,"isNodesEquivalent",{enumerable:!0,get:function(){return bC.default}});Object.defineProperty(L,"isPlaceholderType",{enumerable:!0,get:function(){return SC.default}});Object.defineProperty(L,"isReferenced",{enumerable:!0,get:function(){return xC.default}});Object.defineProperty(L,"isScope",{enumerable:!0,get:function(){return PC.default}});Object.defineProperty(L,"isSpecifierDefault",{enumerable:!0,get:function(){return EC.default}});Object.defineProperty(L,"isType",{enumerable:!0,get:function(){return gC.default}});Object.defineProperty(L,"isValidES3Identifier",{enumerable:!0,get:function(){return AC.default}});Object.defineProperty(L,"isValidIdentifier",{enumerable:!0,get:function(){return vC.default}});Object.defineProperty(L,"isVar",{enumerable:!0,get:function(){return IC.default}});Object.defineProperty(L,"matchesPattern",{enumerable:!0,get:function(){return wC.default}});Object.defineProperty(L,"prependToMemberExpression",{enumerable:!0,get:function(){return sC.default}});L.react=void 0;Object.defineProperty(L,"removeComments",{enumerable:!0,get:function(){return J2.default}});Object.defineProperty(L,"removeProperties",{enumerable:!0,get:function(){return aC.default}});Object.defineProperty(L,"removePropertiesDeep",{enumerable:!0,get:function(){return nC.default}});Object.defineProperty(L,"removeTypeDuplicates",{enumerable:!0,get:function(){return oC.default}});Object.defineProperty(L,"shallowEqual",{enumerable:!0,get:function(){return pC.default}});Object.defineProperty(L,"toBindingIdentifierName",{enumerable:!0,get:function(){return W2.default}});Object.defineProperty(L,"toBlock",{enumerable:!0,get:function(){return z2.default}});Object.defineProperty(L,"toComputedKey",{enumerable:!0,get:function(){return H2.default}});Object.defineProperty(L,"toExpression",{enumerable:!0,get:function(){return G2.default}});Object.defineProperty(L,"toIdentifier",{enumerable:!0,get:function(){return Q2.default}});Object.defineProperty(L,"toKeyAlias",{enumerable:!0,get:function(){return Z2.default}});Object.defineProperty(L,"toStatement",{enumerable:!0,get:function(){return eC.default}});Object.defineProperty(L,"traverse",{enumerable:!0,get:function(){return ei.default}});Object.defineProperty(L,"traverseFast",{enumerable:!0,get:function(){return cC.default}});Object.defineProperty(L,"validate",{enumerable:!0,get:function(){return OC.default}});Object.defineProperty(L,"valueToNode",{enumerable:!0,get:function(){return tC.default}});var N2=jo(),C2=Bo(),D2=Dl(),L2=Ll(),Fa=kl();Object.keys(Fa).forEach(function(t){t==="default"||t==="__esModule"||Object.prototype.hasOwnProperty.call(Ve,t)||t in L&&L[t]===Fa[t]||Object.defineProperty(L,t,{enumerable:!0,get:function(){return Fa[t]}});});var k2=_l(),Lu=Bl(),_2=ql(),Ra=be();Object.keys(Ra).forEach(function(t){t==="default"||t==="__esModule"||Object.prototype.hasOwnProperty.call(Ve,t)||t in L&&L[t]===Ra[t]||Object.defineProperty(L,t,{enumerable:!0,get:function(){return Ra[t]}});});var Ua=Kl();Object.keys(Ua).forEach(function(t){t==="default"||t==="__esModule"||Object.prototype.hasOwnProperty.call(Ve,t)||t in L&&L[t]===Ua[t]||Object.defineProperty(L,t,{enumerable:!0,get:function(){return Ua[t]}});});var qa=Yl();Object.keys(qa).forEach(function(t){t==="default"||t==="__esModule"||Object.prototype.hasOwnProperty.call(Ve,t)||t in L&&L[t]===qa[t]||Object.defineProperty(L,t,{enumerable:!0,get:function(){return qa[t]}});});var M2=et(),j2=Hl(),B2=Gl(),F2=Ql(),R2=Zl(),U2=eu(),q2=qs(),K2=Xs(),V2=$s(),Y2=Gs(),X2=zs(),J2=tu(),Ka=ru();Object.keys(Ka).forEach(function(t){t==="default"||t==="__esModule"||Object.prototype.hasOwnProperty.call(Ve,t)||t in L&&L[t]===Ka[t]||Object.defineProperty(L,t,{enumerable:!0,get:function(){return Ka[t]}});});var Va=Ge();Object.keys(Va).forEach(function(t){t==="default"||t==="__esModule"||Object.prototype.hasOwnProperty.call(Ve,t)||t in L&&L[t]===Va[t]||Object.defineProperty(L,t,{enumerable:!0,get:function(){return Va[t]}});});var $2=iu(),W2=su(),z2=ta(),H2=au(),G2=nu(),Q2=sa(),Z2=uu(),eC=cu(),tC=pu(),Ya=De();Object.keys(Ya).forEach(function(t){t==="default"||t==="__esModule"||Object.prototype.hasOwnProperty.call(Ve,t)||t in L&&L[t]===Ya[t]||Object.defineProperty(L,t,{enumerable:!0,get:function(){return Ya[t]}});});var rC=fu(),iC=hu(),sC=yu(),aC=pa(),nC=da(),oC=Cs(),lC=ar(),uC=mu(),ei=Tu();Object.keys(ei).forEach(function(t){t==="default"||t==="__esModule"||Object.prototype.hasOwnProperty.call(Ve,t)||t in L&&L[t]===ei[t]||Object.defineProperty(L,t,{enumerable:!0,get:function(){return ei[t]}});});var cC=ua(),pC=Dr(),fC=Et(),dC=bu(),hC=xu(),yC=Pu(),mC=va(),TC=ws(),bC=gu(),SC=es(),xC=Au(),PC=vu(),EC=wu(),gC=kr(),AC=Ou(),vC=gt(),IC=Nu(),wC=Wi(),OC=Fr(),NC=Hi(),Xa=le();Object.keys(Xa).forEach(function(t){t==="default"||t==="__esModule"||Object.prototype.hasOwnProperty.call(Ve,t)||t in L&&L[t]===Xa[t]||Object.defineProperty(L,t,{enumerable:!0,get:function(){return Xa[t]}});});var CC=Vt();L.react={isReactComponent:N2.default,isCompatTag:C2.default,buildChildren:D2.default};L.toSequenceExpression=Du().default;});var _u=A(Le=>{Object.defineProperty(Le,"__esModule",{value:!0});Le.statements=Le.statement=Le.smart=Le.program=Le.expression=void 0;var DC=ve(),{assertExpressionStatement:LC}=DC;function Ja(t){return {code:e=>`/* @babel/template */;
+${e}`,validate:()=>{},unwrap:e=>t(e.program.body.slice(1))}}var kC=Ja(t=>t.length>1?t:t[0]);Le.smart=kC;var _C=Ja(t=>t);Le.statements=_C;var MC=Ja(t=>{if(t.length===0)throw new Error("Found nothing to return.");if(t.length>1)throw new Error("Found multiple statements but wanted one");return t[0]});Le.statement=MC;var ku={code:t=>`(
+${t}
+)`,validate:t=>{if(t.program.body.length>1)throw new Error("Found multiple statements but wanted one");if(ku.unwrap(t).start===0)throw new Error("Parse result included parens.")},unwrap:({program:t})=>{let[e]=t.body;return LC(e),e.expression}};Le.expression=ku;var jC={code:t=>t,validate:()=>{},unwrap:t=>t.program};Le.program=jC;});var ti=A(nr=>{Object.defineProperty(nr,"__esModule",{value:!0});nr.merge=RC;nr.normalizeReplacements=qC;nr.validate=UC;var BC=["placeholderWhitelist","placeholderPattern","preserveComments","syntacticPlaceholders"];function FC(t,e){if(t==null)return {};var r={},i=Object.keys(t),s,a;for(a=0;a=0)&&(r[s]=t[s]);return r}function RC(t,e){let{placeholderWhitelist:r=t.placeholderWhitelist,placeholderPattern:i=t.placeholderPattern,preserveComments:s=t.preserveComments,syntacticPlaceholders:a=t.syntacticPlaceholders}=e;return {parser:Object.assign({},t.parser,e.parser),placeholderWhitelist:r,placeholderPattern:i,preserveComments:s,syntacticPlaceholders:a}}function UC(t){if(t!=null&&typeof t!="object")throw new Error("Unknown template options.");let e=t||{},{placeholderWhitelist:r,placeholderPattern:i,preserveComments:s,syntacticPlaceholders:a}=e,n=FC(e,BC);if(r!=null&&!(r instanceof Set))throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");if(i!=null&&!(i instanceof RegExp)&&i!==!1)throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");if(s!=null&&typeof s!="boolean")throw new Error("'.preserveComments' must be a boolean, null, or undefined");if(a!=null&&typeof a!="boolean")throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined");if(a===!0&&(r!=null||i!=null))throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible with '.syntacticPlaceholders: true'");return {parser:n,placeholderWhitelist:r||void 0,placeholderPattern:i??void 0,preserveComments:s??void 0,syntacticPlaceholders:a??void 0}}function qC(t){if(Array.isArray(t))return t.reduce((e,r,i)=>(e["$"+i]=r,e),{});if(typeof t=="object"||t==null)return t||void 0;throw new Error("Template replacements must be an array, object, null, or undefined")}});var dc=A(Tr=>{Object.defineProperty(Tr,"__esModule",{value:!0});function li(t,e){if(t==null)return {};var r={},i=Object.keys(t),s,a;for(a=0;a=0)&&(r[s]=t[s]);return r}var Re=class{constructor(e,r,i){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=r,this.index=i;}},Nt=class{constructor(e,r){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=r;}};function xe(t,e){let{line:r,column:i,index:s}=t;return new Re(r,i+e,s+e)}var Mu="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",KC={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Mu},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Mu}},ju={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},si=({type:t,prefix:e})=>t==="UpdateExpression"?ju.UpdateExpression[String(e)]:ju[t],VC={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
+- Did you mean \`export { '${t}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:t})=>`Unsyntactic ${t==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding.
+- Did you mean \`import { "${t}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:t})=>`\`import()\` requires exactly ${t===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${si(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${si(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${si(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:t})=>`Label '${t}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",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?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:t})=>`Unexpected keyword '${t}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${t?`, expected "${t}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:t,onlyValidPropertyName:e})=>`The only valid meta property for ${t} is ${t}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:t})=>`Identifier '${t}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},YC={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},XC=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),JC={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${si({type:t})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'},$C=["toMessage"],WC=["message"];function Bu(t,e,r){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,value:r});}function zC(t){let{toMessage:e}=t,r=li(t,$C);return function i({loc:s,details:a}){let n=new SyntaxError;return Object.assign(n,r,{loc:s,pos:s.index}),"missingPlugin"in a&&Object.assign(n,{missingPlugin:a.missingPlugin}),Bu(n,"clone",function(l={}){var u;let{line:p,column:S,index:E}=(u=l.loc)!=null?u:s;return i({loc:new Re(p,S,E),details:Object.assign({},a,l.details)})}),Bu(n,"details",a),Object.defineProperty(n,"message",{configurable:!0,get(){let o=`${e(a)} (${s.line}:${s.column})`;return this.message=o,o},set(o){Object.defineProperty(this,"message",{value:o,writable:!0});}}),n}}function $e(t,e){if(Array.isArray(t))return i=>$e(i,t[0]);let r={};for(let i of Object.keys(t)){let s=t[i],a=typeof s=="string"?{message:()=>s}:typeof s=="function"?{message:s}:s,{message:n}=a,o=li(a,WC),l=typeof n=="string"?()=>n:n;r[i]=zC(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:i,toMessage:l},e?{syntaxPlugin:e}:{},o));}return r}var x=Object.assign({},$e(KC),$e(VC),$e(YC),$e`pipelineOperator`(JC)),{defineProperty:HC}=Object,Fu=(t,e)=>HC(t,e,{enumerable:!1,value:t[e]});function or(t){return t.loc.start&&Fu(t.loc.start,"index"),t.loc.end&&Fu(t.loc.end,"index"),t}var GC=t=>class extends t{parse(){let r=or(super.parse());return this.options.tokens&&(r.tokens=r.tokens.map(or)),r}parseRegExpLiteral({pattern:r,flags:i}){let s=null;try{s=new RegExp(r,i);}catch{}let a=this.estreeParseLiteral(s);return a.regex={pattern:r,flags:i},a}parseBigIntLiteral(r){let i;try{i=BigInt(r);}catch{i=null;}let s=this.estreeParseLiteral(i);return s.bigint=String(s.value||r),s}parseDecimalLiteral(r){let s=this.estreeParseLiteral(null);return s.decimal=String(s.value||r),s}estreeParseLiteral(r){return this.parseLiteral(r,"Literal")}parseStringLiteral(r){return this.estreeParseLiteral(r)}parseNumericLiteral(r){return this.estreeParseLiteral(r)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(r){return this.estreeParseLiteral(r)}directiveToStmt(r){let i=r.value;delete r.value,i.type="Literal",i.raw=i.extra.raw,i.value=i.extra.expressionValue;let s=r;return s.type="ExpressionStatement",s.expression=i,s.directive=i.extra.rawValue,delete i.extra,s}initFunction(r,i){super.initFunction(r,i),r.expression=!1;}checkDeclaration(r){r!=null&&this.isObjectProperty(r)?this.checkDeclaration(r.value):super.checkDeclaration(r);}getObjectOrClassMethodParams(r){return r.value.params}isValidDirective(r){var i;return r.type==="ExpressionStatement"&&r.expression.type==="Literal"&&typeof r.expression.value=="string"&&!((i=r.expression.extra)!=null&&i.parenthesized)}parseBlockBody(r,i,s,a,n){super.parseBlockBody(r,i,s,a,n);let o=r.directives.map(l=>this.directiveToStmt(l));r.body=o.concat(r.body),delete r.directives;}pushClassMethod(r,i,s,a,n,o){this.parseMethod(i,s,a,n,o,"ClassMethod",!0),i.typeParameters&&(i.value.typeParameters=i.typeParameters,delete i.typeParameters),r.body.push(i);}parsePrivateName(){let r=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(r):r}convertPrivateNameToPrivateIdentifier(r){let i=super.getPrivateNameSV(r);return r=r,delete r.id,r.name=i,r.type="PrivateIdentifier",r}isPrivateName(r){return this.getPluginOption("estree","classFeatures")?r.type==="PrivateIdentifier":super.isPrivateName(r)}getPrivateNameSV(r){return this.getPluginOption("estree","classFeatures")?r.name:super.getPrivateNameSV(r)}parseLiteral(r,i){let s=super.parseLiteral(r,i);return s.raw=s.extra.raw,delete s.extra,s}parseFunctionBody(r,i,s=!1){super.parseFunctionBody(r,i,s),r.expression=r.body.type!=="BlockStatement";}parseMethod(r,i,s,a,n,o,l=!1){let u=this.startNode();return u.kind=r.kind,u=super.parseMethod(u,i,s,a,n,o,l),u.type="FunctionExpression",delete u.kind,r.value=u,o==="ClassPrivateMethod"&&(r.computed=!1),this.finishNode(r,"MethodDefinition")}parseClassProperty(...r){let i=super.parseClassProperty(...r);return this.getPluginOption("estree","classFeatures")&&(i.type="PropertyDefinition"),i}parseClassPrivateProperty(...r){let i=super.parseClassPrivateProperty(...r);return this.getPluginOption("estree","classFeatures")&&(i.type="PropertyDefinition",i.computed=!1),i}parseObjectMethod(r,i,s,a,n){let o=super.parseObjectMethod(r,i,s,a,n);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(r,i,s,a){let n=super.parseObjectProperty(r,i,s,a);return n&&(n.kind="init",n.type="Property"),n}isValidLVal(r,i,s){return r==="Property"?"value":super.isValidLVal(r,i,s)}isAssignable(r,i){return r!=null&&this.isObjectProperty(r)?this.isAssignable(r.value,i):super.isAssignable(r,i)}toAssignable(r,i=!1){if(r!=null&&this.isObjectProperty(r)){let{key:s,value:a}=r;this.isPrivateName(s)&&this.classScope.usePrivateName(this.getPrivateNameSV(s),s.loc.start),this.toAssignable(a,i);}else super.toAssignable(r,i);}toAssignableObjectExpressionProp(r,i,s){r.kind==="get"||r.kind==="set"?this.raise(x.PatternHasAccessor,{at:r.key}):r.method?this.raise(x.PatternHasMethod,{at:r.key}):super.toAssignableObjectExpressionProp(r,i,s);}finishCallExpression(r,i){let s=super.finishCallExpression(r,i);if(s.callee.type==="Import"){if(s.type="ImportExpression",s.source=s.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var a,n;s.options=(a=s.arguments[1])!=null?a:null,s.attributes=(n=s.arguments[1])!=null?n:null;}delete s.arguments,delete s.callee;}return s}toReferencedArguments(r){r.type!=="ImportExpression"&&super.toReferencedArguments(r);}parseExport(r,i){let s=this.state.lastTokStartLoc,a=super.parseExport(r,i);switch(a.type){case"ExportAllDeclaration":a.exported=null;break;case"ExportNamedDeclaration":a.specifiers.length===1&&a.specifiers[0].type==="ExportNamespaceSpecifier"&&(a.type="ExportAllDeclaration",a.exported=a.specifiers[0].exported,delete a.specifiers);case"ExportDefaultDeclaration":{var n;let{declaration:o}=a;o?.type==="ClassDeclaration"&&((n=o.decorators)==null?void 0:n.length)>0&&o.start===a.start&&this.resetStartLocation(a,s);}break}return a}parseSubscript(r,i,s,a){let n=super.parseSubscript(r,i,s,a);if(a.optionalChainMember){if((n.type==="OptionalMemberExpression"||n.type==="OptionalCallExpression")&&(n.type=n.type.substring(8)),a.stop){let o=this.startNodeAtNode(n);return o.expression=n,this.finishNode(o,"ChainExpression")}}else (n.type==="MemberExpression"||n.type==="CallExpression")&&(n.optional=!1);return n}isOptionalMemberExpression(r){return r.type==="ChainExpression"?r.expression.type==="MemberExpression":super.isOptionalMemberExpression(r)}hasPropertyAsPrivateName(r){return r.type==="ChainExpression"&&(r=r.expression),super.hasPropertyAsPrivateName(r)}isObjectProperty(r){return r.type==="Property"&&r.kind==="init"&&!r.method}isObjectMethod(r){return r.method||r.kind==="get"||r.kind==="set"}finishNodeAt(r,i,s){return or(super.finishNodeAt(r,i,s))}resetStartLocation(r,i){super.resetStartLocation(r,i),or(r);}resetEndLocation(r,i=this.state.lastTokEndLoc){super.resetEndLocation(r,i),or(r);}},Tt=class{constructor(e,r){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!r;}},ae={brace:new Tt("{"),j_oTag:new Tt("...",!0)};ae.template=new Tt("`",!0);var z=!0,_=!0,$a=!0,lr=!0,rt=!0,QC=!0,ui=class{constructor(e,r={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=e,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop!=null?r.binop:null,this.updateContext=null;}},Sn=new Map;function G(t,e={}){e.keyword=t;let r=q(t,e);return Sn.set(t,r),r}function Se(t,e){return q(t,{beforeExpr:z,binop:e})}var fr=-1,Xe=[],xn=[],Pn=[],En=[],gn=[],An=[];function q(t,e={}){var r,i,s,a;return ++fr,xn.push(t),Pn.push((r=e.binop)!=null?r:-1),En.push((i=e.beforeExpr)!=null?i:!1),gn.push((s=e.startsExpr)!=null?s:!1),An.push((a=e.prefix)!=null?a:!1),Xe.push(new ui(t,e)),fr}function W(t,e={}){var r,i,s,a;return ++fr,Sn.set(t,fr),xn.push(t),Pn.push((r=e.binop)!=null?r:-1),En.push((i=e.beforeExpr)!=null?i:!1),gn.push((s=e.startsExpr)!=null?s:!1),An.push((a=e.prefix)!=null?a:!1),Xe.push(new ui("name",e)),fr}var ZC={bracketL:q("[",{beforeExpr:z,startsExpr:_}),bracketHashL:q("#[",{beforeExpr:z,startsExpr:_}),bracketBarL:q("[|",{beforeExpr:z,startsExpr:_}),bracketR:q("]"),bracketBarR:q("|]"),braceL:q("{",{beforeExpr:z,startsExpr:_}),braceBarL:q("{|",{beforeExpr:z,startsExpr:_}),braceHashL:q("#{",{beforeExpr:z,startsExpr:_}),braceR:q("}"),braceBarR:q("|}"),parenL:q("(",{beforeExpr:z,startsExpr:_}),parenR:q(")"),comma:q(",",{beforeExpr:z}),semi:q(";",{beforeExpr:z}),colon:q(":",{beforeExpr:z}),doubleColon:q("::",{beforeExpr:z}),dot:q("."),question:q("?",{beforeExpr:z}),questionDot:q("?."),arrow:q("=>",{beforeExpr:z}),template:q("template"),ellipsis:q("...",{beforeExpr:z}),backQuote:q("`",{startsExpr:_}),dollarBraceL:q("${",{beforeExpr:z,startsExpr:_}),templateTail:q("...`",{startsExpr:_}),templateNonTail:q("...${",{beforeExpr:z,startsExpr:_}),at:q("@"),hash:q("#",{startsExpr:_}),interpreterDirective:q("#!..."),eq:q("=",{beforeExpr:z,isAssign:lr}),assign:q("_=",{beforeExpr:z,isAssign:lr}),slashAssign:q("_=",{beforeExpr:z,isAssign:lr}),xorAssign:q("_=",{beforeExpr:z,isAssign:lr}),moduloAssign:q("_=",{beforeExpr:z,isAssign:lr}),incDec:q("++/--",{prefix:rt,postfix:QC,startsExpr:_}),bang:q("!",{beforeExpr:z,prefix:rt,startsExpr:_}),tilde:q("~",{beforeExpr:z,prefix:rt,startsExpr:_}),doubleCaret:q("^^",{startsExpr:_}),doubleAt:q("@@",{startsExpr:_}),pipeline:Se("|>",0),nullishCoalescing:Se("??",1),logicalOR:Se("||",1),logicalAND:Se("&&",2),bitwiseOR:Se("|",3),bitwiseXOR:Se("^",4),bitwiseAND:Se("&",5),equality:Se("==/!=/===/!==",6),lt:Se(">/<=/>=",7),gt:Se(">/<=/>=",7),relational:Se(">/<=/>=",7),bitShift:Se("<>>/>>>",8),bitShiftL:Se("<>>/>>>",8),bitShiftR:Se("<>>/>>>",8),plusMin:q("+/-",{beforeExpr:z,binop:9,prefix:rt,startsExpr:_}),modulo:q("%",{binop:10,startsExpr:_}),star:q("*",{binop:10}),slash:Se("/",10),exponent:q("**",{beforeExpr:z,binop:11,rightAssociative:!0}),_in:G("in",{beforeExpr:z,binop:7}),_instanceof:G("instanceof",{beforeExpr:z,binop:7}),_break:G("break"),_case:G("case",{beforeExpr:z}),_catch:G("catch"),_continue:G("continue"),_debugger:G("debugger"),_default:G("default",{beforeExpr:z}),_else:G("else",{beforeExpr:z}),_finally:G("finally"),_function:G("function",{startsExpr:_}),_if:G("if"),_return:G("return",{beforeExpr:z}),_switch:G("switch"),_throw:G("throw",{beforeExpr:z,prefix:rt,startsExpr:_}),_try:G("try"),_var:G("var"),_const:G("const"),_with:G("with"),_new:G("new",{beforeExpr:z,startsExpr:_}),_this:G("this",{startsExpr:_}),_super:G("super",{startsExpr:_}),_class:G("class",{startsExpr:_}),_extends:G("extends",{beforeExpr:z}),_export:G("export"),_import:G("import",{startsExpr:_}),_null:G("null",{startsExpr:_}),_true:G("true",{startsExpr:_}),_false:G("false",{startsExpr:_}),_typeof:G("typeof",{beforeExpr:z,prefix:rt,startsExpr:_}),_void:G("void",{beforeExpr:z,prefix:rt,startsExpr:_}),_delete:G("delete",{beforeExpr:z,prefix:rt,startsExpr:_}),_do:G("do",{isLoop:$a,beforeExpr:z}),_for:G("for",{isLoop:$a}),_while:G("while",{isLoop:$a}),_as:W("as",{startsExpr:_}),_assert:W("assert",{startsExpr:_}),_async:W("async",{startsExpr:_}),_await:W("await",{startsExpr:_}),_defer:W("defer",{startsExpr:_}),_from:W("from",{startsExpr:_}),_get:W("get",{startsExpr:_}),_let:W("let",{startsExpr:_}),_meta:W("meta",{startsExpr:_}),_of:W("of",{startsExpr:_}),_sent:W("sent",{startsExpr:_}),_set:W("set",{startsExpr:_}),_source:W("source",{startsExpr:_}),_static:W("static",{startsExpr:_}),_using:W("using",{startsExpr:_}),_yield:W("yield",{startsExpr:_}),_asserts:W("asserts",{startsExpr:_}),_checks:W("checks",{startsExpr:_}),_exports:W("exports",{startsExpr:_}),_global:W("global",{startsExpr:_}),_implements:W("implements",{startsExpr:_}),_intrinsic:W("intrinsic",{startsExpr:_}),_infer:W("infer",{startsExpr:_}),_is:W("is",{startsExpr:_}),_mixins:W("mixins",{startsExpr:_}),_proto:W("proto",{startsExpr:_}),_require:W("require",{startsExpr:_}),_satisfies:W("satisfies",{startsExpr:_}),_keyof:W("keyof",{startsExpr:_}),_readonly:W("readonly",{startsExpr:_}),_unique:W("unique",{startsExpr:_}),_abstract:W("abstract",{startsExpr:_}),_declare:W("declare",{startsExpr:_}),_enum:W("enum",{startsExpr:_}),_module:W("module",{startsExpr:_}),_namespace:W("namespace",{startsExpr:_}),_interface:W("interface",{startsExpr:_}),_type:W("type",{startsExpr:_}),_opaque:W("opaque",{startsExpr:_}),name:q("name",{startsExpr:_}),string:q("string",{startsExpr:_}),num:q("num",{startsExpr:_}),bigint:q("bigint",{startsExpr:_}),decimal:q("decimal",{startsExpr:_}),regexp:q("regexp",{startsExpr:_}),privateName:q("#name",{startsExpr:_}),eof:q("eof"),jsxName:q("jsxName"),jsxText:q("jsxText",{beforeExpr:!0}),jsxTagStart:q("jsxTagStart",{startsExpr:!0}),jsxTagEnd:q("jsxTagEnd"),placeholder:q("%%",{startsExpr:!0})};function te(t){return t>=93&&t<=132}function eD(t){return t<=92}function _e(t){return t>=58&&t<=132}function Gu(t){return t>=58&&t<=136}function tD(t){return En[t]}function Qa(t){return gn[t]}function rD(t){return t>=29&&t<=33}function Ru(t){return t>=129&&t<=131}function iD(t){return t>=90&&t<=92}function vn(t){return t>=58&&t<=92}function sD(t){return t>=39&&t<=59}function aD(t){return t===34}function nD(t){return An[t]}function oD(t){return t>=121&&t<=123}function lD(t){return t>=124&&t<=130}function at(t){return xn[t]}function ai(t){return Pn[t]}function uD(t){return t===57}function ci(t){return t>=24&&t<=25}function Ye(t){return Xe[t]}Xe[8].updateContext=t=>{t.pop();},Xe[5].updateContext=Xe[7].updateContext=Xe[23].updateContext=t=>{t.push(ae.brace);},Xe[22].updateContext=t=>{t[t.length-1]===ae.template?t.pop():t.push(ae.template);},Xe[142].updateContext=t=>{t.push(ae.j_expr,ae.j_oTag);};var In="\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\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\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",Qu="\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\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\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\uFF65",cD=new RegExp("["+In+"]"),pD=new RegExp("["+In+Qu+"]");In=Qu=null;var Zu=[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,16,621,2467,541,1507,4938,6,4191],fD=[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];function Za(t,e){let r=65536;for(let i=0,s=e.length;it)return !1;if(r+=e[i+1],r>=t)return !0}return !1}function Je(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&cD.test(String.fromCharCode(t)):Za(t,Zu)}function wt(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&pD.test(String.fromCharCode(t)):Za(t,Zu)||Za(t,fD)}var wn={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"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},dD=new Set(wn.keyword),hD=new Set(wn.strict),yD=new Set(wn.strictBind);function ec(t,e){return e&&t==="await"||t==="enum"}function tc(t,e){return ec(t,e)||hD.has(t)}function rc(t){return yD.has(t)}function ic(t,e){return tc(t,e)||rc(t)}function mD(t){return dD.has(t)}function TD(t,e,r){return t===64&&e===64&&Je(r)}var bD=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","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function SD(t){return bD.has(t)}var hr=class{constructor(e){this.var=new Set,this.lexical=new Set,this.functions=new Set,this.flags=e;}},yr=class{constructor(e,r){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=e,this.inModule=r;}get inTopLevel(){return (this.currentScope().flags&1)>0}get inFunction(){return (this.currentVarScopeFlags()&2)>0}get allowSuper(){return (this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return (this.currentThisScopeFlags()&32)>0}get inClass(){return (this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return (e&64)>0&&(e&2)===0}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:r}=this.scopeStack[e];if(r&128)return !0;if(r&451)return !1}}get inNonArrowFunction(){return (this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new hr(e)}enter(e){this.scopeStack.push(this.createScope(e));}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return !!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,r,i){let s=this.currentScope();if(r&8||r&16)this.checkRedeclarationInScope(s,e,r,i),r&16?s.functions.add(e):s.lexical.add(e),r&8&&this.maybeExportDefined(s,e);else if(r&4)for(let a=this.scopeStack.length-1;a>=0&&(s=this.scopeStack[a],this.checkRedeclarationInScope(s,e,r,i),s.var.add(e),this.maybeExportDefined(s,e),!(s.flags&387));--a);this.parser.inModule&&s.flags&1&&this.undefinedExports.delete(e);}maybeExportDefined(e,r){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(r);}checkRedeclarationInScope(e,r,i,s){this.isRedeclaredInScope(e,r,i)&&this.parser.raise(x.VarRedeclaration,{at:s,identifierName:r});}isRedeclaredInScope(e,r,i){return i&1?i&8?e.lexical.has(r)||e.functions.has(r)||e.var.has(r):i&16?e.lexical.has(r)||!this.treatFunctionsAsVarInScope(e)&&e.var.has(r):e.lexical.has(r)&&!(e.flags&8&&e.lexical.values().next().value===r)||!this.treatFunctionsAsVarInScope(e)&&e.functions.has(r):!1}checkLocalExport(e){let{name:r}=e,i=this.scopeStack[0];!i.lexical.has(r)&&!i.var.has(r)&&!i.functions.has(r)&&this.undefinedExports.set(r,e.loc.start);}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:r}=this.scopeStack[e];if(r&387)return r}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:r}=this.scopeStack[e];if(r&451&&!(r&4))return r}}},en=class extends hr{constructor(...e){super(...e),this.declareFunctions=new Set;}},tn=class extends yr{createScope(e){return new en(e)}declareName(e,r,i){let s=this.currentScope();if(r&2048){this.checkRedeclarationInScope(s,e,r,i),this.maybeExportDefined(s,e),s.declareFunctions.add(e);return}super.declareName(e,r,i);}isRedeclaredInScope(e,r,i){return super.isRedeclaredInScope(e,r,i)?!0:i&2048?!e.declareFunctions.has(r)&&(e.lexical.has(r)||e.functions.has(r)):!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e);}},rn=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1;}hasPlugin(e){if(typeof e=="string")return this.plugins.has(e);{let[r,i]=e;if(!this.hasPlugin(r))return !1;let s=this.plugins.get(r);for(let a of Object.keys(i))if(s?.[a]!==i[a])return !1;return !0}}getPluginOption(e,r){var i;return (i=this.plugins.get(e))==null?void 0:i[r]}};function sc(t,e){t.trailingComments===void 0?t.trailingComments=e:t.trailingComments.unshift(...e);}function xD(t,e){t.leadingComments===void 0?t.leadingComments=e:t.leadingComments.unshift(...e);}function mr(t,e){t.innerComments===void 0?t.innerComments=e:t.innerComments.unshift(...e);}function ur(t,e,r){let i=null,s=e.length;for(;i===null&&s>0;)i=e[--s];i===null||i.start>r.start?mr(t,r.comments):sc(i,r.comments);}var sn=class extends rn{addComment(e){this.filename&&(e.loc.filename=this.filename),this.state.comments.push(e);}processComment(e){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let s=i-1,a=r[s];a.start===e.end&&(a.leadingNode=e,s--);let{start:n}=e;for(;s>=0;s--){let o=r[s],l=o.end;if(l>n)o.containingNode=e,this.finalizeComment(o),r.splice(s,1);else {l===n&&(o.trailingNode=e);break}}}finalizeComment(e){let{comments:r}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&sc(e.leadingNode,r),e.trailingNode!==null&&xD(e.trailingNode,r);else {let{containingNode:i,start:s}=e;if(this.input.charCodeAt(s-1)===44)switch(i.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":ur(i,i.properties,e);break;case"CallExpression":case"OptionalCallExpression":ur(i,i.arguments,e);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":ur(i,i.params,e);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":ur(i,i.elements,e);break;case"ExportNamedDeclaration":case"ImportDeclaration":ur(i,i.specifiers,e);break;default:mr(i,r);}else mr(i,r);}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let r=e.length-1;r>=0;r--)this.finalizeComment(e[r]);this.state.commentStack=[];}resetPreviousNodeTrailingComments(e){let{commentStack:r}=this.state,{length:i}=r;if(i===0)return;let s=r[i-1];s.leadingNode===e&&(s.leadingNode=null);}resetPreviousIdentifierLeadingComments(e){let{commentStack:r}=this.state,{length:i}=r;i!==0&&(r[i-1].trailingNode===e?r[i-1].trailingNode=null:i>=2&&r[i-2].trailingNode===e&&(r[i-2].trailingNode=null));}takeSurroundingComments(e,r,i){let{commentStack:s}=this.state,a=s.length;if(a===0)return;let n=a-1;for(;n>=0;n--){let o=s[n],l=o.end;if(o.start===i)o.leadingNode=e;else if(l===r)o.trailingNode=e;else if(l=48&&e<=57},qu={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},ii={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function Ku(t,e,r,i,s,a){let n=r,o=i,l=s,u="",p=null,S=r,{length:E}=e;for(;;){if(r>=E){a.unterminated(n,o,l),u+=e.slice(S,r);break}let v=e.charCodeAt(r);if(gD(t,v,e,r)){u+=e.slice(S,r);break}if(v===92){u+=e.slice(S,r);let I=AD(e,r,i,s,t==="template",a);I.ch===null&&!p?p={pos:r,lineStart:i,curLine:s}:u+=I.ch,{pos:r,lineStart:i,curLine:s}=I,S=r;}else v===8232||v===8233?(++r,++s,i=r):v===10||v===13?t==="template"?(u+=e.slice(S,r)+`
+`,++r,v===13&&e.charCodeAt(r)===10&&++r,++s,S=i=r):a.unterminated(n,o,l):++r;}return {pos:r,str:u,firstInvalidLoc:p,lineStart:i,curLine:s,containsInvalid:!!p}}function gD(t,e,r,i){return t==="template"?e===96||e===36&&r.charCodeAt(i+1)===123:e===(t==="double"?34:39)}function AD(t,e,r,i,s,a){let n=!s;e++;let o=u=>({pos:e,ch:u,lineStart:r,curLine:i}),l=t.charCodeAt(e++);switch(l){case 110:return o(`
+`);case 114:return o("\r");case 120:{let u;return {code:u,pos:e}=nn(t,e,r,i,2,!1,n,a),o(u===null?null:String.fromCharCode(u))}case 117:{let u;return {code:u,pos:e}=oc(t,e,r,i,n,a),o(u===null?null:String.fromCodePoint(u))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:t.charCodeAt(e)===10&&++e;case 10:r=e,++i;case 8232:case 8233:return o("");case 56:case 57:if(s)return o(null);a.strictNumericEscape(e-1,r,i);default:if(l>=48&&l<=55){let u=e-1,S=t.slice(u,e+2).match(/^[0-7]+/)[0],E=parseInt(S,8);E>255&&(S=S.slice(0,-1),E=parseInt(S,8)),e+=S.length-1;let v=t.charCodeAt(e);if(S!=="0"||v===56||v===57){if(s)return o(null);a.strictNumericEscape(u,r,i);}return o(String.fromCharCode(E))}return o(String.fromCharCode(l))}}function nn(t,e,r,i,s,a,n,o){let l=e,u;return {n:u,pos:e}=nc(t,e,r,i,16,s,a,!1,o,!n),u===null&&(n?o.invalidEscapeSequence(l,r,i):e=l-1),{code:u,pos:e}}function nc(t,e,r,i,s,a,n,o,l,u){let p=e,S=s===16?qu.hex:qu.decBinOct,E=s===16?ii.hex:s===10?ii.dec:s===8?ii.oct:ii.bin,v=!1,I=0;for(let N=0,M=a??1/0;N=97?R=j-97+10:j>=65?R=j-65+10:ED(j)?R=j-48:R=1/0,R>=s){if(R<=9&&u)return {n:null,pos:e};if(R<=9&&l.invalidDigit(e,r,i,s))R=0;else if(n)R=0,v=!0;else break}++e,I=I*s+R;}return e===p||a!=null&&e-p!==a||v?{n:null,pos:e}:{n:I,pos:e}}function oc(t,e,r,i,s,a){let n=t.charCodeAt(e),o;if(n===123){if(++e,{code:o,pos:e}=nn(t,e,r,i,t.indexOf("}",e)-e,!0,s,a),++e,o!==null&&o>1114111)if(s)a.invalidCodePoint(e,r,i);else return {code:null,pos:e}}else ({code:o,pos:e}=nn(t,e,r,i,4,!1,s,a));return {code:o,pos:e}}var vD=["at"],ID=["at"];function cr(t,e,r){return new Re(r,t-e,t)}var wD=new Set([103,109,115,105,121,117,100,118]),Fe=class{constructor(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,this.loc=new Nt(e.startLoc,e.endLoc);}},on=class extends sn{constructor(e,r){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(i,s,a,n)=>this.options.errorRecovery?(this.raise(x.InvalidDigit,{at:cr(i,s,a),radix:n}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(x.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(x.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(x.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(x.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(i,s,a)=>{this.recordStrictModeErrors(x.StrictNumericEscape,{at:cr(i,s,a)});},unterminated:(i,s,a)=>{throw this.raise(x.UnterminatedString,{at:cr(i-1,s,a)})}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(x.StrictNumericEscape),unterminated:(i,s,a)=>{throw this.raise(x.UnterminatedTemplate,{at:cr(i,s,a)})}}),this.state=new an,this.state.init(e),this.input=r,this.length=r.length,this.isLookahead=!1;}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength;}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new Fe(this.state)),this.state.lastTokStart=this.state.start,this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken();}eat(e){return this.match(e)?(this.next(),!0):!1}match(e){return this.state.type===e}createLookaheadState(e){return {pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){let e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let r=this.state;return this.state=e,r}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return Wa.lastIndex=e,Wa.test(this.input)?Wa.lastIndex:e}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return ni.lastIndex=e,ni.test(this.input)?ni.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let r=this.input.charCodeAt(e);if((r&64512)===55296&&++ethis.raise(r,{at:i})),this.state.strictErrors.clear());}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(139);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos));}skipBlockComment(e){let r;this.isLookahead||(r=this.state.curPosition());let i=this.state.pos,s=this.input.indexOf(e,i+2);if(s===-1)throw this.raise(x.UnterminatedComment,{at:this.state.curPosition()});for(this.state.pos=s+e.length,ri.lastIndex=i+2;ri.test(this.input)&&ri.lastIndex<=s;)++this.state.curLine,this.state.lineStart=ri.lastIndex;if(this.isLookahead)return;let a={type:"CommentBlock",value:this.input.slice(i+2,s),start:i,end:s+e.length,loc:new Nt(r,this.state.curPosition())};return this.options.tokens&&this.pushToken(a),a}skipLineComment(e){let r=this.state.pos,i;this.isLookahead||(i=this.state.curPosition());let s=this.input.charCodeAt(this.state.pos+=e);if(this.state.pose)){let a=this.skipLineComment(3);a!==void 0&&(this.addComment(a),this.options.attachComment&&r.push(a));}else break e}else if(i===60&&!this.inModule&&this.options.annexB){let s=this.state.pos;if(this.input.charCodeAt(s+1)===33&&this.input.charCodeAt(s+2)===45&&this.input.charCodeAt(s+3)===45){let a=this.skipLineComment(4);a!==void 0&&(this.addComment(a),this.options.attachComment&&r.push(a));}else break e}else break e}}if(r.length>0){let i=this.state.pos,s={start:e,end:i,comments:r,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(s);}}finishToken(e,r){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let i=this.state.type;this.state.type=e,this.state.value=r,this.isLookahead||this.updateContext(i);}replaceToken(e){this.state.type=e,this.updateContext();}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let e=this.state.pos+1,r=this.codePointAtPos(e);if(r>=48&&r<=57)throw this.raise(x.UnexpectedDigitAfterHash,{at:this.state.curPosition()});if(r===123||r===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(r===123?x.RecordExpressionHashIncorrectStartSyntaxType:x.TupleExpressionHashIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,r===123?this.finishToken(7):this.finishToken(1);}else Je(r)?(++this.state.pos,this.finishToken(138,this.readWord1(r))):r===92?(++this.state.pos,this.finishToken(138,this.readWord1())):this.finishOp(27,1);}readToken_dot(){let e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57){this.readNumber(!0);return}e===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16));}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1);}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return !1;let e=this.input.charCodeAt(this.state.pos+1);if(e!==33)return !1;let r=this.state.pos;for(this.state.pos+=1;!dr(e)&&++this.state.pos=48&&r<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17));}getTokenFromCode(e){switch(e){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(x.TupleExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(2);}else ++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(x.RecordExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(6);}else ++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let r=this.input.charCodeAt(this.state.pos+1);if(r===120||r===88){this.readRadixNumber(16);return}if(r===111||r===79){this.readRadixNumber(8);return}if(r===98||r===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(e);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(e);return;case 124:case 38:this.readToken_pipe_amp(e);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(e);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(e);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(Je(e)){this.readWord(e);return}}throw this.raise(x.InvalidOrUnexpectedToken,{at:this.state.curPosition(),unexpected:String.fromCodePoint(e)})}finishOp(e,r){let i=this.input.slice(this.state.pos,this.state.pos+r);this.state.pos+=r,this.finishToken(e,i);}readRegexp(){let e=this.state.startLoc,r=this.state.start+1,i,s,{pos:a}=this.state;for(;;++a){if(a>=this.length)throw this.raise(x.UnterminatedRegExp,{at:xe(e,1)});let u=this.input.charCodeAt(a);if(dr(u))throw this.raise(x.UnterminatedRegExp,{at:xe(e,1)});if(i)i=!1;else {if(u===91)s=!0;else if(u===93&&s)s=!1;else if(u===47&&!s)break;i=u===92;}}let n=this.input.slice(r,a);++a;let o="",l=()=>xe(e,a+2-r);for(;a=2&&this.input.charCodeAt(r)===48;if(u){let v=this.input.slice(r,this.state.pos);if(this.recordStrictModeErrors(x.StrictOctalLiteral,{at:i}),!this.state.strict){let I=v.indexOf("_");I>0&&this.raise(x.ZeroDigitNumericSeparator,{at:xe(i,I)});}l=u&&!/[89]/.test(v);}let p=this.input.charCodeAt(this.state.pos);if(p===46&&!l&&(++this.state.pos,this.readInt(10),s=!0,p=this.input.charCodeAt(this.state.pos)),(p===69||p===101)&&!l&&(p=this.input.charCodeAt(++this.state.pos),(p===43||p===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(x.InvalidOrMissingExponent,{at:i}),s=!0,o=!0,p=this.input.charCodeAt(this.state.pos)),p===110&&((s||u)&&this.raise(x.InvalidBigIntLiteral,{at:i}),++this.state.pos,a=!0),p===109&&(this.expectPlugin("decimal",this.state.curPosition()),(o||u)&&this.raise(x.InvalidDecimal,{at:i}),++this.state.pos,n=!0),Je(this.codePointAtPos(this.state.pos)))throw this.raise(x.NumberIdentifier,{at:this.state.curPosition()});let S=this.input.slice(r,this.state.pos).replace(/[_mn]/g,"");if(a){this.finishToken(135,S);return}if(n){this.finishToken(136,S);return}let E=l?parseInt(S,8):parseFloat(S);this.finishToken(134,E);}readCodePoint(e){let{code:r,pos:i}=oc(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=i,r}readString(e){let{str:r,pos:i,curLine:s,lineStart:a}=Ku(e===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=i+1,this.state.lineStart=a,this.state.curLine=s,this.finishToken(133,r);}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken();}readTemplateToken(){let e=this.input[this.state.pos],{str:r,firstInvalidLoc:i,pos:s,curLine:a,lineStart:n}=Ku("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=s+1,this.state.lineStart=n,this.state.curLine=a,i&&(this.state.firstInvalidTemplateEscapePos=new Re(i.curLine,i.pos-i.lineStart,i.pos)),this.input.codePointAt(s)===96?this.finishToken(24,i?null:e+r+"`"):(this.state.pos++,this.finishToken(25,i?null:e+r+"${"));}recordStrictModeErrors(e,{at:r}){let i=r.index;this.state.strict&&!this.state.strictErrors.has(i)?this.raise(e,{at:r}):this.state.strictErrors.set(i,[e,r]);}readWord1(e){this.state.containsEsc=!1;let r="",i=this.state.pos,s=this.state.pos;for(e!==void 0&&(this.state.pos+=e<=65535?1:2);this.state.pos=0;l--){let u=o[l];if(u.loc.index===n)return o[l]=e({loc:a,details:s});if(u.loc.indexthis.hasPlugin(r)))throw this.raise(x.MissingOneOfPlugins,{at:this.state.startLoc,missingPlugin:e})}errorBuilder(e){return (r,i,s)=>{this.raise(e,{at:cr(r,i,s)});}}},ln=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map;}},un=class{constructor(e){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=e;}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new ln);}exit(){let e=this.stack.pop(),r=this.current();for(let[i,s]of Array.from(e.undefinedPrivateNames))r?r.undefinedPrivateNames.has(i)||r.undefinedPrivateNames.set(i,s):this.parser.raise(x.InvalidPrivateFieldResolution,{at:s,identifierName:i});}declarePrivateName(e,r,i){let{privateNames:s,loneAccessors:a,undefinedPrivateNames:n}=this.current(),o=s.has(e);if(r&3){let l=o&&a.get(e);if(l){let u=l&4,p=r&4,S=l&3,E=r&3;o=S===E||u!==p,o||a.delete(e);}else o||a.set(e,r);}o&&this.parser.raise(x.PrivateNameRedeclaration,{at:i,identifierName:e}),s.add(e),n.delete(e);}usePrivateName(e,r){let i;for(i of this.stack)if(i.privateNames.has(e))return;i?i.undefinedPrivateNames.set(e,r):this.parser.raise(x.InvalidPrivateFieldResolution,{at:r,identifierName:e});}},Ct=class{constructor(e=0){this.type=e;}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},pi=class extends Ct{constructor(e){super(e),this.declarationErrors=new Map;}recordDeclarationError(e,{at:r}){let i=r.index;this.declarationErrors.set(i,[e,r]);}clearDeclarationError(e){this.declarationErrors.delete(e);}iterateErrors(e){this.declarationErrors.forEach(e);}},cn=class{constructor(e){this.parser=void 0,this.stack=[new Ct],this.parser=e;}enter(e){this.stack.push(e);}exit(){this.stack.pop();}recordParameterInitializerError(e,{at:r}){let i={at:r.loc.start},{stack:s}=this,a=s.length-1,n=s[a];for(;!n.isCertainlyParameterDeclaration();){if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(e,i);else return;n=s[--a];}this.parser.raise(e,i);}recordArrowParameterBindingError(e,{at:r}){let{stack:i}=this,s=i[i.length-1],a={at:r.loc.start};if(s.isCertainlyParameterDeclaration())this.parser.raise(e,a);else if(s.canBeArrowParameterDeclaration())s.recordDeclarationError(e,a);else return}recordAsyncArrowParametersError({at:e}){let{stack:r}=this,i=r.length-1,s=r[i];for(;s.canBeArrowParameterDeclaration();)s.type===2&&s.recordDeclarationError(x.AwaitBindingIdentifier,{at:e}),s=r[--i];}validateAsPattern(){let{stack:e}=this,r=e[e.length-1];r.canBeArrowParameterDeclaration()&&r.iterateErrors(([i,s])=>{this.parser.raise(i,{at:s});let a=e.length-2,n=e[a];for(;n.canBeArrowParameterDeclaration();)n.clearDeclarationError(s.index),n=e[--a];});}};function OD(){return new Ct(3)}function ND(){return new pi(1)}function CD(){return new pi(2)}function lc(){return new Ct}var pn=class{constructor(){this.stacks=[];}enter(e){this.stacks.push(e);}exit(){this.stacks.pop();}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return (this.currentFlags()&2)>0}get hasYield(){return (this.currentFlags()&1)>0}get hasReturn(){return (this.currentFlags()&4)>0}get hasIn(){return (this.currentFlags()&8)>0}};function oi(t,e){return (t?2:0)|(e?1:0)}var fn=class extends on{addExtra(e,r,i,s=!0){if(!e)return;let a=e.extra=e.extra||{};s?a[r]=i:Object.defineProperty(a,r,{enumerable:s,value:i});}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,r){let i=e+r.length;if(this.input.slice(e,i)===r){let s=this.input.charCodeAt(i);return !(wt(s)||(s&64512)===55296)}return !1}isLookaheadContextual(e){let r=this.nextTokenStart();return this.isUnparsedContextual(r,e)}eatContextual(e){return this.isContextual(e)?(this.next(),!0):!1}expectContextual(e,r){if(!this.eatContextual(e)){if(r!=null)throw this.raise(r,{at:this.state.startLoc});this.unexpected(null,e);}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return ac.test(this.input.slice(this.state.lastTokEndLoc.index,this.state.start))}hasFollowingLineBreak(){return Uu.lastIndex=this.state.end,Uu.test(this.input)}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(13))||this.raise(x.MissingSemicolon,{at:this.state.lastTokEndLoc});}expect(e,r){this.eat(e)||this.unexpected(r,e);}tryParse(e,r=this.state.clone()){let i={node:null};try{let s=e((a=null)=>{throw i.node=a,i});if(this.state.errors.length>r.errors.length){let a=this.state;return this.state=r,this.state.tokensLength=a.tokensLength,{node:s,error:a.errors[r.errors.length],thrown:!1,aborted:!1,failState:a}}return {node:s,error:null,thrown:!1,aborted:!1,failState:null}}catch(s){let a=this.state;if(this.state=r,s instanceof SyntaxError)return {node:null,error:s,thrown:!0,aborted:!1,failState:a};if(s===i)return {node:i.node,error:null,thrown:!1,aborted:!0,failState:a};throw s}}checkExpressionErrors(e,r){if(!e)return !1;let{shorthandAssignLoc:i,doubleProtoLoc:s,privateKeyLoc:a,optionalParametersLoc:n}=e,o=!!i||!!s||!!n||!!a;if(!r)return o;i!=null&&this.raise(x.InvalidCoverInitializedName,{at:i}),s!=null&&this.raise(x.DuplicateProto,{at:s}),a!=null&&this.raise(x.UnexpectedPrivateField,{at:a}),n!=null&&this.unexpected(n);}isLiteralPropertyName(){return Gu(this.state.type)}isPrivateName(e){return e.type==="PrivateName"}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return (e.type==="MemberExpression"||e.type==="OptionalMemberExpression")&&this.isPrivateName(e.property)}isObjectProperty(e){return e.type==="ObjectProperty"}isObjectMethod(e){return e.type==="ObjectMethod"}initializeScopes(e=this.options.sourceType==="module"){let r=this.state.labels;this.state.labels=[];let i=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let s=this.inModule;this.inModule=e;let a=this.scope,n=this.getScopeHandler();this.scope=new n(this,e);let o=this.prodParam;this.prodParam=new pn;let l=this.classScope;this.classScope=new un(this);let u=this.expressionScope;return this.expressionScope=new cn(this),()=>{this.state.labels=r,this.exportedIdentifiers=i,this.inModule=s,this.scope=a,this.prodParam=o,this.classScope=l,this.expressionScope=u;}}enterInitialScopes(){let e=0;this.inModule&&(e|=2),this.scope.enter(1),this.prodParam.enter(e);}checkDestructuringPrivate(e){let{privateKeyLoc:r}=e;r!==null&&this.expectPlugin("destructuringPrivate",r);}},Ot=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null;}},Dt=class{constructor(e,r,i){this.type="",this.start=r,this.end=0,this.loc=new Nt(i),e!=null&&e.options.ranges&&(this.range=[r,0]),e!=null&&e.filename&&(this.loc.filename=e.filename);}},On=Dt.prototype;On.__clone=function(){let t=new Dt(void 0,this.start,this.loc.start),e=Object.keys(this);for(let r=0,i=e.length;r`Cannot overwrite reserved type ${t}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:t,enumName:e})=>`Boolean enum members need to be initialized. Use either \`${t} = true,\` or \`${t} = false,\` in enum \`${e}\`.`,EnumDuplicateMemberName:({memberName:t,enumName:e})=>`Enum member names need to be unique, but the name \`${t}\` has already been used before in enum \`${e}\`.`,EnumInconsistentMemberValues:({enumName:t})=>`Enum \`${t}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:t,enumName:e})=>`Enum type \`${t}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:t})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:t,memberName:e,explicitType:r})=>`Enum \`${t}\` has type \`${r}\`, so the initializer of \`${e}\` needs to be a ${r} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:t,memberName:e})=>`Symbol enum members cannot be initialized. Use \`${e},\` in enum \`${t}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:t,memberName:e})=>`The enum member initializer for \`${e}\` needs to be a literal (either a boolean, number, or string) in enum \`${t}\`.`,EnumInvalidMemberName:({enumName:t,memberName:e,suggestion:r})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${e}\`, consider using \`${r}\`, in enum \`${t}\`.`,EnumNumberMemberNotInitialized:({enumName:t,memberName:e})=>`Number enum members need to be initialized, e.g. \`${e} = 1\` in enum \`${t}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:t})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${t}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",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.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:t})=>`Unexpected reserved type ${t}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:t,suggestion:e})=>`\`declare export ${t}\` is not supported. Use \`${e}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function _D(t){return t.type==="DeclareExportAllDeclaration"||t.type==="DeclareExportDeclaration"&&(!t.declaration||t.declaration.type!=="TypeAlias"&&t.declaration.type!=="InterfaceDeclaration")}function Vu(t){return t.importKind==="type"||t.importKind==="typeof"}var MD={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function jD(t,e){let r=[],i=[];for(let s=0;sclass extends t{constructor(...r){super(...r),this.flowPragma=void 0;}getScopeHandler(){return tn}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}shouldParseEnums(){return !!this.getPluginOption("flow","enums")}finishToken(r,i){r!==133&&r!==13&&r!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(r,i);}addComment(r){if(this.flowPragma===void 0){let i=BD.exec(r.value);if(i)if(i[1]==="flow")this.flowPragma="flow";else if(i[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(r);}flowParseTypeInitialiser(r){let i=this.state.inType;this.state.inType=!0,this.expect(r||14);let s=this.flowParseType();return this.state.inType=i,s}flowParsePredicate(){let r=this.startNode(),i=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStart>i.index+1&&this.raise(K.UnexpectedSpaceBetweenModuloChecks,{at:i}),this.eat(10)?(r.value=super.parseExpression(),this.expect(11),this.finishNode(r,"DeclaredPredicate")):this.finishNode(r,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let r=this.state.inType;this.state.inType=!0,this.expect(14);let i=null,s=null;return this.match(54)?(this.state.inType=r,s=this.flowParsePredicate()):(i=this.flowParseType(),this.state.inType=r,this.match(54)&&(s=this.flowParsePredicate())),[i,s]}flowParseDeclareClass(r){return this.next(),this.flowParseInterfaceish(r,!0),this.finishNode(r,"DeclareClass")}flowParseDeclareFunction(r){this.next();let i=r.id=this.parseIdentifier(),s=this.startNode(),a=this.startNode();this.match(47)?s.typeParameters=this.flowParseTypeParameterDeclaration():s.typeParameters=null,this.expect(10);let n=this.flowParseFunctionTypeParams();return s.params=n.params,s.rest=n.rest,s.this=n._this,this.expect(11),[s.returnType,r.predicate]=this.flowParseTypeAndPredicateInitialiser(),a.typeAnnotation=this.finishNode(s,"FunctionTypeAnnotation"),i.typeAnnotation=this.finishNode(a,"TypeAnnotation"),this.resetEndLocation(i),this.semicolon(),this.scope.declareName(r.id.name,2048,r.id.loc.start),this.finishNode(r,"DeclareFunction")}flowParseDeclare(r,i){if(this.match(80))return this.flowParseDeclareClass(r);if(this.match(68))return this.flowParseDeclareFunction(r);if(this.match(74))return this.flowParseDeclareVariable(r);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(r):(i&&this.raise(K.NestedDeclareModule,{at:this.state.lastTokStartLoc}),this.flowParseDeclareModule(r));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(r);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(r);if(this.isContextual(129))return this.flowParseDeclareInterface(r);if(this.match(82))return this.flowParseDeclareExportDeclaration(r,i);this.unexpected();}flowParseDeclareVariable(r){return this.next(),r.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(r.id.name,5,r.id.loc.start),this.semicolon(),this.finishNode(r,"DeclareVariable")}flowParseDeclareModule(r){this.scope.enter(0),this.match(133)?r.id=super.parseExprAtom():r.id=this.parseIdentifier();let i=r.body=this.startNode(),s=i.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(K.InvalidNonTypeImportInDeclareModule,{at:this.state.lastTokStartLoc}),super.parseImport(o)):(this.expectContextual(125,K.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),s.push(o);}this.scope.exit(),this.expect(8),this.finishNode(i,"BlockStatement");let a=null,n=!1;return s.forEach(o=>{_D(o)?(a==="CommonJS"&&this.raise(K.AmbiguousDeclareModuleKind,{at:o}),a="ES"):o.type==="DeclareModuleExports"&&(n&&this.raise(K.DuplicateDeclareModuleExports,{at:o}),a==="ES"&&this.raise(K.AmbiguousDeclareModuleKind,{at:o}),a="CommonJS",n=!0);}),r.kind=a||"CommonJS",this.finishNode(r,"DeclareModule")}flowParseDeclareExportDeclaration(r,i){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?r.declaration=this.flowParseDeclare(this.startNode()):(r.declaration=this.flowParseType(),this.semicolon()),r.default=!0,this.finishNode(r,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!i){let s=this.state.value;throw this.raise(K.UnsupportedDeclareExportKind,{at:this.state.startLoc,unsupportedExportKind:s,suggestion:MD[s]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return r.declaration=this.flowParseDeclare(this.startNode()),r.default=!1,this.finishNode(r,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return r=this.parseExport(r,null),r.type==="ExportNamedDeclaration"&&(r.type="ExportDeclaration",r.default=!1,delete r.exportKind),r.type="Declare"+r.type,r;this.unexpected();}flowParseDeclareModuleExports(r){return this.next(),this.expectContextual(111),r.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(r,"DeclareModuleExports")}flowParseDeclareTypeAlias(r){this.next();let i=this.flowParseTypeAlias(r);return i.type="DeclareTypeAlias",i}flowParseDeclareOpaqueType(r){this.next();let i=this.flowParseOpaqueType(r,!0);return i.type="DeclareOpaqueType",i}flowParseDeclareInterface(r){return this.next(),this.flowParseInterfaceish(r,!1),this.finishNode(r,"DeclareInterface")}flowParseInterfaceish(r,i){if(r.id=this.flowParseRestrictedIdentifier(!i,!0),this.scope.declareName(r.id.name,i?17:8201,r.id.loc.start),this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,r.extends=[],this.eat(81))do r.extends.push(this.flowParseInterfaceExtends());while(!i&&this.eat(12));if(i){if(r.implements=[],r.mixins=[],this.eatContextual(117))do r.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do r.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}r.body=this.flowParseObjectType({allowStatic:i,allowExact:!1,allowSpread:!1,allowProto:i,allowInexact:!1});}flowParseInterfaceExtends(){let r=this.startNode();return r.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,this.finishNode(r,"InterfaceExtends")}flowParseInterface(r){return this.flowParseInterfaceish(r,!1),this.finishNode(r,"InterfaceDeclaration")}checkNotUnderscore(r){r==="_"&&this.raise(K.UnexpectedReservedUnderscore,{at:this.state.startLoc});}checkReservedType(r,i,s){kD.has(r)&&this.raise(s?K.AssignReservedType:K.UnexpectedReservedType,{at:i,reservedType:r});}flowParseRestrictedIdentifier(r,i){return this.checkReservedType(this.state.value,this.state.startLoc,i),this.parseIdentifier(r)}flowParseTypeAlias(r){return r.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(r.id.name,8201,r.id.loc.start),this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,r.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(r,"TypeAlias")}flowParseOpaqueType(r,i){return this.expectContextual(130),r.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(r.id.name,8201,r.id.loc.start),this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,r.supertype=null,this.match(14)&&(r.supertype=this.flowParseTypeInitialiser(14)),r.impltype=null,i||(r.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(r,"OpaqueType")}flowParseTypeParameter(r=!1){let i=this.state.startLoc,s=this.startNode(),a=this.flowParseVariance(),n=this.flowParseTypeAnnotatableIdentifier();return s.name=n.name,s.variance=a,s.bound=n.typeAnnotation,this.match(29)?(this.eat(29),s.default=this.flowParseType()):r&&this.raise(K.MissingTypeParamDefault,{at:i}),this.finishNode(s,"TypeParameter")}flowParseTypeParameterDeclaration(){let r=this.state.inType,i=this.startNode();i.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let s=!1;do{let a=this.flowParseTypeParameter(s);i.params.push(a),a.default&&(s=!0),this.match(48)||this.expect(12);}while(!this.match(48));return this.expect(48),this.state.inType=r,this.finishNode(i,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let r=this.startNode(),i=this.state.inType;r.params=[],this.state.inType=!0,this.expect(47);let s=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)r.params.push(this.flowParseType()),this.match(48)||this.expect(12);return this.state.noAnonFunctionType=s,this.expect(48),this.state.inType=i,this.finishNode(r,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let r=this.startNode(),i=this.state.inType;for(r.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)r.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=i,this.finishNode(r,"TypeParameterInstantiation")}flowParseInterfaceType(){let r=this.startNode();if(this.expectContextual(129),r.extends=[],this.eat(81))do r.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return r.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(r,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(134)||this.match(133)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(r,i,s){return r.static=i,this.lookahead().type===14?(r.id=this.flowParseObjectPropertyKey(),r.key=this.flowParseTypeInitialiser()):(r.id=null,r.key=this.flowParseType()),this.expect(3),r.value=this.flowParseTypeInitialiser(),r.variance=s,this.finishNode(r,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(r,i){return r.static=i,r.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(r.method=!0,r.optional=!1,r.value=this.flowParseObjectTypeMethodish(this.startNodeAt(r.loc.start))):(r.method=!1,this.eat(17)&&(r.optional=!0),r.value=this.flowParseTypeInitialiser()),this.finishNode(r,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(r){for(r.params=[],r.rest=null,r.typeParameters=null,r.this=null,this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(r.this=this.flowParseFunctionTypeParam(!0),r.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)r.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(r.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),r.returnType=this.flowParseTypeInitialiser(),this.finishNode(r,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(r,i){let s=this.startNode();return r.static=i,r.value=this.flowParseObjectTypeMethodish(s),this.finishNode(r,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:r,allowExact:i,allowSpread:s,allowProto:a,allowInexact:n}){let o=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let u,p,S=!1;for(i&&this.match(6)?(this.expect(6),u=9,p=!0):(this.expect(5),u=8,p=!1),l.exact=p;!this.match(u);){let v=!1,I=null,N=null,M=this.startNode();if(a&&this.isContextual(118)){let R=this.lookahead();R.type!==14&&R.type!==17&&(this.next(),I=this.state.startLoc,r=!1);}if(r&&this.isContextual(106)){let R=this.lookahead();R.type!==14&&R.type!==17&&(this.next(),v=!0);}let j=this.flowParseVariance();if(this.eat(0))I!=null&&this.unexpected(I),this.eat(0)?(j&&this.unexpected(j.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(M,v))):l.indexers.push(this.flowParseObjectTypeIndexer(M,v,j));else if(this.match(10)||this.match(47))I!=null&&this.unexpected(I),j&&this.unexpected(j.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(M,v));else {let R="init";if(this.isContextual(99)||this.isContextual(104)){let $=this.lookahead();Gu($.type)&&(R=this.state.value,this.next());}let k=this.flowParseObjectTypeProperty(M,v,I,j,R,s,n??!p);k===null?(S=!0,N=this.state.lastTokStartLoc):l.properties.push(k);}this.flowObjectTypeSemicolon(),N&&!this.match(8)&&!this.match(9)&&this.raise(K.UnexpectedExplicitInexactInObject,{at:N});}this.expect(u),s&&(l.inexact=S);let E=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,E}flowParseObjectTypeProperty(r,i,s,a,n,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(K.InexactInsideExact,{at:this.state.lastTokStartLoc}):this.raise(K.InexactInsideNonObject,{at:this.state.lastTokStartLoc}),a&&this.raise(K.InexactVariance,{at:a}),null):(o||this.raise(K.UnexpectedSpreadType,{at:this.state.lastTokStartLoc}),s!=null&&this.unexpected(s),a&&this.raise(K.SpreadVariance,{at:a}),r.argument=this.flowParseType(),this.finishNode(r,"ObjectTypeSpreadProperty"));{r.key=this.flowParseObjectPropertyKey(),r.static=i,r.proto=s!=null,r.kind=n;let u=!1;return this.match(47)||this.match(10)?(r.method=!0,s!=null&&this.unexpected(s),a&&this.unexpected(a.loc.start),r.value=this.flowParseObjectTypeMethodish(this.startNodeAt(r.loc.start)),(n==="get"||n==="set")&&this.flowCheckGetterSetterParams(r),!o&&r.key.name==="constructor"&&r.value.this&&this.raise(K.ThisParamBannedInConstructor,{at:r.value.this})):(n!=="init"&&this.unexpected(),r.method=!1,this.eat(17)&&(u=!0),r.value=this.flowParseTypeInitialiser(),r.variance=a),r.optional=u,this.finishNode(r,"ObjectTypeProperty")}}flowCheckGetterSetterParams(r){let i=r.kind==="get"?0:1,s=r.value.params.length+(r.value.rest?1:0);r.value.this&&this.raise(r.kind==="get"?K.GetterMayNotHaveThisParam:K.SetterMayNotHaveThisParam,{at:r.value.this}),s!==i&&this.raise(r.kind==="get"?x.BadGetterArity:x.BadSetterArity,{at:r}),r.kind==="set"&&r.value.rest&&this.raise(x.BadSetterRestParameter,{at:r});}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected();}flowParseQualifiedTypeIdentifier(r,i){(r)!=null||(r=this.state.startLoc);let a=i||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let n=this.startNodeAt(r);n.qualification=a,n.id=this.flowParseRestrictedIdentifier(!0),a=this.finishNode(n,"QualifiedTypeIdentifier");}return a}flowParseGenericType(r,i){let s=this.startNodeAt(r);return s.typeParameters=null,s.id=this.flowParseQualifiedTypeIdentifier(r,i),this.match(47)&&(s.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(s,"GenericTypeAnnotation")}flowParseTypeofType(){let r=this.startNode();return this.expect(87),r.argument=this.flowParsePrimaryType(),this.finishNode(r,"TypeofTypeAnnotation")}flowParseTupleType(){let r=this.startNode();for(r.types=[],this.expect(0);this.state.possuper.parseFunctionBody(r,!0,s));return}super.parseFunctionBody(r,!1,s);}parseFunctionBodyAndFinish(r,i,s=!1){if(this.match(14)){let a=this.startNode();[a.typeAnnotation,r.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.returnType=a.typeAnnotation?this.finishNode(a,"TypeAnnotation"):null;}return super.parseFunctionBodyAndFinish(r,i,s)}parseStatementLike(r){if(this.state.strict&&this.isContextual(129)){let s=this.lookahead();if(_e(s.type)){let a=this.startNode();return this.next(),this.flowParseInterface(a)}}else if(this.shouldParseEnums()&&this.isContextual(126)){let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}let i=super.parseStatementLike(r);return this.flowPragma===void 0&&!this.isValidDirective(i)&&(this.flowPragma=null),i}parseExpressionStatement(r,i,s){if(i.type==="Identifier"){if(i.name==="declare"){if(this.match(80)||te(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(r)}else if(te(this.state.type)){if(i.name==="interface")return this.flowParseInterface(r);if(i.name==="type")return this.flowParseTypeAlias(r);if(i.name==="opaque")return this.flowParseOpaqueType(r,!1)}}return super.parseExpressionStatement(r,i,s)}shouldParseExportDeclaration(){let{type:r}=this.state;return Ru(r)||this.shouldParseEnums()&&r===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:r}=this.state;return Ru(r)||this.shouldParseEnums()&&r===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.shouldParseEnums()&&this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}return super.parseExportDefaultExpression()}parseConditional(r,i,s){if(!this.match(17))return r;if(this.state.maybeInArrowParameters){let E=this.lookaheadCharCode();if(E===44||E===61||E===58||E===41)return this.setOptionalParametersError(s),r}this.expect(17);let a=this.state.clone(),n=this.state.noArrowAt,o=this.startNodeAt(i),{consequent:l,failed:u}=this.tryParseConditionalConsequent(),[p,S]=this.getArrowLikeExpressions(l);if(u||S.length>0){let E=[...n];if(S.length>0){this.state=a,this.state.noArrowAt=E;for(let v=0;v1&&this.raise(K.AmbiguousConditionalArrow,{at:a.startLoc}),u&&p.length===1&&(this.state=a,E.push(p[0].start),this.state.noArrowAt=E,{consequent:l,failed:u}=this.tryParseConditionalConsequent());}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=n,this.expect(14),o.test=r,o.consequent=l,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let r=this.parseMaybeAssignAllowIn(),i=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:r,failed:i}}getArrowLikeExpressions(r,i){let s=[r],a=[];for(;s.length!==0;){let n=s.pop();n.type==="ArrowFunctionExpression"?(n.typeParameters||!n.returnType?this.finishArrowValidation(n):a.push(n),s.push(n.body)):n.type==="ConditionalExpression"&&(s.push(n.consequent),s.push(n.alternate));}return i?(a.forEach(n=>this.finishArrowValidation(n)),[a,[]]):jD(a,n=>n.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(r){var i;this.toAssignableList(r.params,(i=r.extra)==null?void 0:i.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(r,!1,!0),this.scope.exit();}forwardNoArrowParamsConversionAt(r,i){let s;return this.state.noArrowParamsConversionAt.indexOf(r.start)!==-1?(this.state.noArrowParamsConversionAt.push(this.state.start),s=i(),this.state.noArrowParamsConversionAt.pop()):s=i(),s}parseParenItem(r,i){if(r=super.parseParenItem(r,i),this.eat(17)&&(r.optional=!0,this.resetEndLocation(r)),this.match(14)){let s=this.startNodeAt(i);return s.expression=r,s.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(s,"TypeCastExpression")}return r}assertModuleNodeAllowed(r){r.type==="ImportDeclaration"&&(r.importKind==="type"||r.importKind==="typeof")||r.type==="ExportNamedDeclaration"&&r.exportKind==="type"||r.type==="ExportAllDeclaration"&&r.exportKind==="type"||super.assertModuleNodeAllowed(r);}parseExportDeclaration(r){if(this.isContextual(130)){r.exportKind="type";let i=this.startNode();return this.next(),this.match(5)?(r.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(r),null):this.flowParseTypeAlias(i)}else if(this.isContextual(131)){r.exportKind="type";let i=this.startNode();return this.next(),this.flowParseOpaqueType(i,!1)}else if(this.isContextual(129)){r.exportKind="type";let i=this.startNode();return this.next(),this.flowParseInterface(i)}else if(this.shouldParseEnums()&&this.isContextual(126)){r.exportKind="value";let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}else return super.parseExportDeclaration(r)}eatExportStar(r){return super.eatExportStar(r)?!0:this.isContextual(130)&&this.lookahead().type===55?(r.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(r){let{startLoc:i}=this.state,s=super.maybeParseExportNamespaceSpecifier(r);return s&&r.exportKind==="type"&&this.unexpected(i),s}parseClassId(r,i,s){super.parseClassId(r,i,s),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration());}parseClassMember(r,i,s){let{startLoc:a}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(r,i))return;i.declare=!0;}super.parseClassMember(r,i,s),i.declare&&(i.type!=="ClassProperty"&&i.type!=="ClassPrivateProperty"&&i.type!=="PropertyDefinition"?this.raise(K.DeclareClassElement,{at:a}):i.value&&this.raise(K.DeclareClassFieldInitializer,{at:i.value}));}isIterator(r){return r==="iterator"||r==="asyncIterator"}readIterator(){let r=super.readWord1(),i="@@"+r;(!this.isIterator(r)||!this.state.inType)&&this.raise(x.InvalidIdentifier,{at:this.state.curPosition(),identifierName:i}),this.finishToken(132,i);}getTokenFromCode(r){let i=this.input.charCodeAt(this.state.pos+1);r===123&&i===124?this.finishOp(6,2):this.state.inType&&(r===62||r===60)?this.finishOp(r===62?48:47,1):this.state.inType&&r===63?i===46?this.finishOp(18,2):this.finishOp(17,1):TD(r,i,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(r);}isAssignable(r,i){return r.type==="TypeCastExpression"?this.isAssignable(r.expression,i):super.isAssignable(r,i)}toAssignable(r,i=!1){!i&&r.type==="AssignmentExpression"&&r.left.type==="TypeCastExpression"&&(r.left=this.typeCastToParameter(r.left)),super.toAssignable(r,i);}toAssignableList(r,i,s){for(let a=0;a1||!i)&&this.raise(K.TypeCastInPattern,{at:n.typeAnnotation});}return r}parseArrayLike(r,i,s,a){let n=super.parseArrayLike(r,i,s,a);return i&&!this.state.maybeInArrowParameters&&this.toReferencedList(n.elements),n}isValidLVal(r,i,s){return r==="TypeCastExpression"||super.isValidLVal(r,i,s)}parseClassProperty(r){return this.match(14)&&(r.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(r)}parseClassPrivateProperty(r){return this.match(14)&&(r.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(r)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(r){return !this.match(14)&&super.isNonstaticConstructor(r)}pushClassMethod(r,i,s,a,n,o){if(i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(r,i,s,a,n,o),i.params&&n){let l=i.params;l.length>0&&this.isThisParam(l[0])&&this.raise(K.ThisParamBannedInConstructor,{at:i});}else if(i.type==="MethodDefinition"&&n&&i.value.params){let l=i.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(K.ThisParamBannedInConstructor,{at:i});}}pushClassPrivateMethod(r,i,s,a){i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(r,i,s,a);}parseClassSuper(r){if(super.parseClassSuper(r),r.superClass&&this.match(47)&&(r.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();let i=r.implements=[];do{let s=this.startNode();s.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?s.typeParameters=this.flowParseTypeParameterInstantiation():s.typeParameters=null,i.push(this.finishNode(s,"ClassImplements"));}while(this.eat(12))}}checkGetterSetterParams(r){super.checkGetterSetterParams(r);let i=this.getObjectOrClassMethodParams(r);if(i.length>0){let s=i[0];this.isThisParam(s)&&r.kind==="get"?this.raise(K.GetterMayNotHaveThisParam,{at:s}):this.isThisParam(s)&&this.raise(K.SetterMayNotHaveThisParam,{at:s});}}parsePropertyNamePrefixOperator(r){r.variance=this.flowParseVariance();}parseObjPropValue(r,i,s,a,n,o,l){r.variance&&this.unexpected(r.variance.loc.start),delete r.variance;let u;this.match(47)&&!o&&(u=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let p=super.parseObjPropValue(r,i,s,a,n,o,l);return u&&((p.value||p).typeParameters=u),p}parseAssignableListItemTypes(r){return this.eat(17)&&(r.type!=="Identifier"&&this.raise(K.PatternIsOptional,{at:r}),this.isThisParam(r)&&this.raise(K.ThisParamMayNotBeOptional,{at:r}),r.optional=!0),this.match(14)?r.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(r)&&this.raise(K.ThisParamAnnotationRequired,{at:r}),this.match(29)&&this.isThisParam(r)&&this.raise(K.ThisParamNoDefault,{at:r}),this.resetEndLocation(r),r}parseMaybeDefault(r,i){let s=super.parseMaybeDefault(r,i);return s.type==="AssignmentPattern"&&s.typeAnnotation&&s.right.startsuper.parseMaybeAssign(r,i),a),!n.error)return n.node;let{context:u}=this.state,p=u[u.length-1];(p===ae.j_oTag||p===ae.j_expr)&&u.pop();}if((s=n)!=null&&s.error||this.match(47)){var o,l;a=a||this.state.clone();let u,p=this.tryParse(E=>{var v;u=this.flowParseTypeParameterDeclaration();let I=this.forwardNoArrowParamsConversionAt(u,()=>{let M=super.parseMaybeAssign(r,i);return this.resetStartLocationFromNode(M,u),M});(v=I.extra)!=null&&v.parenthesized&&E();let N=this.maybeUnwrapTypeCastExpression(I);return N.type!=="ArrowFunctionExpression"&&E(),N.typeParameters=u,this.resetStartLocationFromNode(N,u),I},a),S=null;if(p.node&&this.maybeUnwrapTypeCastExpression(p.node).type==="ArrowFunctionExpression"){if(!p.error&&!p.aborted)return p.node.async&&this.raise(K.UnexpectedTypeParameterBeforeAsyncArrowFunction,{at:u}),p.node;S=p.node;}if((o=n)!=null&&o.node)return this.state=n.failState,n.node;if(S)return this.state=p.failState,S;throw (l=n)!=null&&l.thrown?n.error:p.thrown?p.error:this.raise(K.UnexpectedTokenAfterTypeParameter,{at:u})}return super.parseMaybeAssign(r,i)}parseArrow(r){if(this.match(14)){let i=this.tryParse(()=>{let s=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let a=this.startNode();return [a.typeAnnotation,r.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=s,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),a});if(i.thrown)return null;i.error&&(this.state=i.failState),r.returnType=i.node.typeAnnotation?this.finishNode(i.node,"TypeAnnotation"):null;}return super.parseArrow(r)}shouldParseArrow(r){return this.match(14)||super.shouldParseArrow(r)}setArrowFunctionParameters(r,i){this.state.noArrowParamsConversionAt.indexOf(r.start)!==-1?r.params=i:super.setArrowFunctionParameters(r,i);}checkParams(r,i,s,a=!0){if(!(s&&this.state.noArrowParamsConversionAt.indexOf(r.start)!==-1)){for(let n=0;n0&&this.raise(K.ThisParamMustBeFirst,{at:r.params[n]});super.checkParams(r,i,s,a);}}parseParenAndDistinguishExpression(r){return super.parseParenAndDistinguishExpression(r&&this.state.noArrowAt.indexOf(this.state.start)===-1)}parseSubscripts(r,i,s){if(r.type==="Identifier"&&r.name==="async"&&this.state.noArrowAt.indexOf(i.index)!==-1){this.next();let a=this.startNodeAt(i);a.callee=r,a.arguments=super.parseCallExpressionArguments(11,!1),r=this.finishNode(a,"CallExpression");}else if(r.type==="Identifier"&&r.name==="async"&&this.match(47)){let a=this.state.clone(),n=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(i)||l(),a);if(!n.error&&!n.aborted)return n.node;let o=this.tryParse(()=>super.parseSubscripts(r,i,s),a);if(o.node&&!o.error)return o.node;if(n.node)return this.state=n.failState,n.node;if(o.node)return this.state=o.failState,o.node;throw n.error||o.error}return super.parseSubscripts(r,i,s)}parseSubscript(r,i,s,a){if(this.match(18)&&this.isLookaheadToken_lt()){if(a.optionalChainMember=!0,s)return a.stop=!0,r;this.next();let n=this.startNodeAt(i);return n.callee=r,n.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),n.arguments=this.parseCallExpressionArguments(11,!1),n.optional=!0,this.finishCallExpression(n,!0)}else if(!s&&this.shouldParseTypes()&&this.match(47)){let n=this.startNodeAt(i);n.callee=r;let o=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),n.arguments=super.parseCallExpressionArguments(11,!1),a.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,a.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(r,i,s,a)}parseNewCallee(r){super.parseNewCallee(r);let i=null;this.shouldParseTypes()&&this.match(47)&&(i=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),r.typeArguments=i;}parseAsyncArrowWithTypeParameters(r){let i=this.startNodeAt(r);if(this.parseFunctionParams(i,!1),!!this.parseArrow(i))return super.parseArrowExpression(i,void 0,!0)}readToken_mult_modulo(r){let i=this.input.charCodeAt(this.state.pos+1);if(r===42&&i===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(r);}readToken_pipe_amp(r){let i=this.input.charCodeAt(this.state.pos+1);if(r===124&&i===125){this.finishOp(9,2);return}super.readToken_pipe_amp(r);}parseTopLevel(r,i){let s=super.parseTopLevel(r,i);return this.state.hasFlowComment&&this.raise(K.UnterminatedFlowComment,{at:this.state.curPosition()}),s}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(K.NestedFlowComment,{at:this.state.startLoc});this.hasFlowCommentCompletion();let r=this.skipFlowComment();r&&(this.state.pos+=r,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:r}=this.state,i=2;for(;[32,9].includes(this.input.charCodeAt(r+i));)i++;let s=this.input.charCodeAt(i+r),a=this.input.charCodeAt(i+r+1);return s===58&&a===58?i+2:this.input.slice(i+r,i+r+12)==="flow-include"?i+12:s===58&&a!==58?i:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(x.UnterminatedComment,{at:this.state.curPosition()})}flowEnumErrorBooleanMemberNotInitialized(r,{enumName:i,memberName:s}){this.raise(K.EnumBooleanMemberNotInitialized,{at:r,memberName:s,enumName:i});}flowEnumErrorInvalidMemberInitializer(r,i){return this.raise(i.explicitType?i.explicitType==="symbol"?K.EnumInvalidMemberInitializerSymbolType:K.EnumInvalidMemberInitializerPrimaryType:K.EnumInvalidMemberInitializerUnknownType,Object.assign({at:r},i))}flowEnumErrorNumberMemberNotInitialized(r,{enumName:i,memberName:s}){this.raise(K.EnumNumberMemberNotInitialized,{at:r,enumName:i,memberName:s});}flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:i}){this.raise(K.EnumStringMemberInconsistentlyInitialized,{at:r,enumName:i});}flowEnumMemberInit(){let r=this.state.startLoc,i=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{let s=this.parseNumericLiteral(this.state.value);return i()?{type:"number",loc:s.loc.start,value:s}:{type:"invalid",loc:r}}case 133:{let s=this.parseStringLiteral(this.state.value);return i()?{type:"string",loc:s.loc.start,value:s}:{type:"invalid",loc:r}}case 85:case 86:{let s=this.parseBooleanLiteral(this.match(85));return i()?{type:"boolean",loc:s.loc.start,value:s}:{type:"invalid",loc:r}}default:return {type:"invalid",loc:r}}}flowEnumMemberRaw(){let r=this.state.startLoc,i=this.parseIdentifier(!0),s=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:r};return {id:i,init:s}}flowEnumCheckExplicitTypeMismatch(r,i,s){let{explicitType:a}=i;a!==null&&a!==s&&this.flowEnumErrorInvalidMemberInitializer(r,i);}flowEnumMembers({enumName:r,explicitType:i}){let s=new Set,a={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},n=!1;for(;!this.match(8);){if(this.eat(21)){n=!0;break}let o=this.startNode(),{id:l,init:u}=this.flowEnumMemberRaw(),p=l.name;if(p==="")continue;/^[a-z]/.test(p)&&this.raise(K.EnumInvalidMemberName,{at:l,memberName:p,suggestion:p[0].toUpperCase()+p.slice(1),enumName:r}),s.has(p)&&this.raise(K.EnumDuplicateMemberName,{at:l,memberName:p,enumName:r}),s.add(p);let S={enumName:r,explicitType:i,memberName:p};switch(o.id=l,u.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(u.loc,S,"boolean"),o.init=u.value,a.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(u.loc,S,"number"),o.init=u.value,a.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(u.loc,S,"string"),o.init=u.value,a.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(u.loc,S);case"none":switch(i){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(u.loc,S);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(u.loc,S);break;default:a.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"));}}this.match(8)||this.expect(12);}return {members:a,hasUnknownMembers:n}}flowEnumStringMembers(r,i,{enumName:s}){if(r.length===0)return i;if(i.length===0)return r;if(i.length>r.length){for(let a of r)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:s});return i}else {for(let a of i)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:s});return r}}flowEnumParseExplicitType({enumName:r}){if(!this.eatContextual(102))return null;if(!te(this.state.type))throw this.raise(K.EnumInvalidExplicitTypeUnknownSupplied,{at:this.state.startLoc,enumName:r});let{value:i}=this.state;return this.next(),i!=="boolean"&&i!=="number"&&i!=="string"&&i!=="symbol"&&this.raise(K.EnumInvalidExplicitType,{at:this.state.startLoc,enumName:r,invalidEnumType:i}),i}flowEnumBody(r,i){let s=i.name,a=i.loc.start,n=this.flowEnumParseExplicitType({enumName:s});this.expect(5);let{members:o,hasUnknownMembers:l}=this.flowEnumMembers({enumName:s,explicitType:n});switch(r.hasUnknownMembers=l,n){case"boolean":return r.explicitType=!0,r.members=o.booleanMembers,this.expect(8),this.finishNode(r,"EnumBooleanBody");case"number":return r.explicitType=!0,r.members=o.numberMembers,this.expect(8),this.finishNode(r,"EnumNumberBody");case"string":return r.explicitType=!0,r.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:s}),this.expect(8),this.finishNode(r,"EnumStringBody");case"symbol":return r.members=o.defaultedMembers,this.expect(8),this.finishNode(r,"EnumSymbolBody");default:{let u=()=>(r.members=[],this.expect(8),this.finishNode(r,"EnumStringBody"));r.explicitType=!1;let p=o.booleanMembers.length,S=o.numberMembers.length,E=o.stringMembers.length,v=o.defaultedMembers.length;if(!p&&!S&&!E&&!v)return u();if(!p&&!S)return r.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:s}),this.expect(8),this.finishNode(r,"EnumStringBody");if(!S&&!E&&p>=v){for(let I of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(I.loc.start,{enumName:s,memberName:I.id.name});return r.members=o.booleanMembers,this.expect(8),this.finishNode(r,"EnumBooleanBody")}else if(!p&&!E&&S>=v){for(let I of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(I.loc.start,{enumName:s,memberName:I.id.name});return r.members=o.numberMembers,this.expect(8),this.finishNode(r,"EnumNumberBody")}else return this.raise(K.EnumInconsistentMemberValues,{at:a,enumName:s}),u()}}}flowParseEnumDeclaration(r){let i=this.parseIdentifier();return r.id=i,r.body=this.flowEnumBody(this.startNode(),i),this.finishNode(r,"EnumDeclaration")}isLookaheadToken_lt(){let r=this.nextTokenStart();if(this.input.charCodeAt(r)===60){let i=this.input.charCodeAt(r+1);return i!==60&&i!==61}return !1}maybeUnwrapTypeCastExpression(r){return r.type==="TypeCastExpression"?r.expression:r}},RD={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},mt=$e`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:t})=>`Expected corresponding JSX closing tag for <${t}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:t,HTMLEntity:e})=>`Unexpected token \`${t}\`. Did you mean \`${e}\` or \`{'${t}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...>?"});function it(t){return t?t.type==="JSXOpeningFragment"||t.type==="JSXClosingFragment":!1}function It(t){if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return It(t.object)+"."+It(t.property);throw new Error("Node had unexpected type: "+t.type)}var UD=t=>class extends t{jsxReadToken(){let r="",i=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(mt.UnterminatedJsxContent,{at:this.state.startLoc});let s=this.input.charCodeAt(this.state.pos);switch(s){case 60:case 123:if(this.state.pos===this.state.start){s===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(142)):super.getTokenFromCode(s);return}r+=this.input.slice(i,this.state.pos),this.finishToken(141,r);return;case 38:r+=this.input.slice(i,this.state.pos),r+=this.jsxReadEntity(),i=this.state.pos;break;case 62:case 125:default:dr(s)?(r+=this.input.slice(i,this.state.pos),r+=this.jsxReadNewLine(!0),i=this.state.pos):++this.state.pos;}}}jsxReadNewLine(r){let i=this.input.charCodeAt(this.state.pos),s;return ++this.state.pos,i===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,s=r?`
+`:`\r
+`):s=String.fromCharCode(i),++this.state.curLine,this.state.lineStart=this.state.pos,s}jsxReadString(r){let i="",s=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(x.UnterminatedString,{at:this.state.startLoc});let a=this.input.charCodeAt(this.state.pos);if(a===r)break;a===38?(i+=this.input.slice(s,this.state.pos),i+=this.jsxReadEntity(),s=this.state.pos):dr(a)?(i+=this.input.slice(s,this.state.pos),i+=this.jsxReadNewLine(!1),s=this.state.pos):++this.state.pos;}i+=this.input.slice(s,this.state.pos++),this.finishToken(133,i);}jsxReadEntity(){let r=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let i=10;this.codePointAtPos(this.state.pos)===120&&(i=16,++this.state.pos);let s=this.readInt(i,void 0,!1,"bail");if(s!==null&&this.codePointAtPos(this.state.pos)===59)return ++this.state.pos,String.fromCodePoint(s)}else {let i=0,s=!1;for(;i++<10&&this.state.pos1){for(let s=0;s=0;s--){let a=this.scopeStack[s];if(a.types.has(r)||a.exportOnlyBindings.has(r))return}super.checkLocalExport(e);}},qD=(t,e)=>Object.hasOwnProperty.call(t,e)&&t[e],uc=t=>t.type==="ParenthesizedExpression"?uc(t.expression):t,mn=class extends dn{toAssignable(e,r=!1){var i,s;let a;switch((e.type==="ParenthesizedExpression"||(i=e.extra)!=null&&i.parenthesized)&&(a=uc(e),r?a.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(x.InvalidParenthesizedAssignment,{at:e}):a.type!=="MemberExpression"&&!this.isOptionalMemberExpression(a)&&this.raise(x.InvalidParenthesizedAssignment,{at:e}):this.raise(x.InvalidParenthesizedAssignment,{at:e})),e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern";for(let o=0,l=e.properties.length,u=l-1;os.type!=="ObjectMethod"&&(a===i||s.type!=="SpreadElement")&&this.isAssignable(s))}case"ObjectProperty":return this.isAssignable(e.value);case"SpreadElement":return this.isAssignable(e.argument);case"ArrayExpression":return e.elements.every(i=>i===null||this.isAssignable(i));case"AssignmentExpression":return e.operator==="=";case"ParenthesizedExpression":return this.isAssignable(e.expression);case"MemberExpression":case"OptionalMemberExpression":return !r;default:return !1}}toReferencedList(e,r){return e}toReferencedListDeep(e,r){this.toReferencedList(e,r);for(let i of e)i?.type==="ArrayExpression"&&this.toReferencedListDeep(i.elements);}parseSpread(e){let r=this.startNode();return this.next(),r.argument=this.parseMaybeAssignAllowIn(e,void 0),this.finishNode(r,"SpreadElement")}parseRestBinding(){let e=this.startNode();return this.next(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let e=this.startNode();return this.next(),e.elements=this.parseBindingList(3,93,1),this.finishNode(e,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(e,r,i){let s=i&1,a=[],n=!0;for(;!this.eat(e);)if(n?n=!1:this.expect(12),s&&this.match(12))a.push(null);else {if(this.eat(e))break;if(this.match(21)){if(a.push(this.parseAssignableListItemTypes(this.parseRestBinding(),i)),!this.checkCommaAfterRest(r)){this.expect(e);break}}else {let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(x.UnsupportedParameterDecorator,{at:this.state.startLoc});this.match(26);)o.push(this.parseDecorator());a.push(this.parseAssignableListItem(i,o));}}return a}parseBindingRestProperty(e){return this.next(),e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,"RestElement")}parseBindingProperty(){let e=this.startNode(),{type:r,startLoc:i}=this.state;return r===21?this.parseBindingRestProperty(e):(r===138?(this.expectPlugin("destructuringPrivate",i),this.classScope.usePrivateName(this.state.value,i),e.key=this.parsePrivateName()):this.parsePropertyName(e),e.method=!1,this.parseObjPropValue(e,i,!1,!1,!0,!1))}parseAssignableListItem(e,r){let i=this.parseMaybeDefault();this.parseAssignableListItemTypes(i,e);let s=this.parseMaybeDefault(i.loc.start,i);return r.length&&(i.decorators=r),s}parseAssignableListItemTypes(e,r){return e}parseMaybeDefault(e,r){var s;if((e)!=null||(e=this.state.startLoc),r=(s=r)!=null?s:this.parseBindingAtom(),!this.eat(29))return r;let a=this.startNodeAt(e);return a.left=r,a.right=this.parseMaybeAssignAllowIn(),this.finishNode(a,"AssignmentPattern")}isValidLVal(e,r,i){return qD({AssignmentPattern:"left",RestElement:"argument",ObjectProperty:"value",ParenthesizedExpression:"expression",ArrayPattern:"elements",ObjectPattern:"properties"},e)}isOptionalMemberExpression(e){return e.type==="OptionalMemberExpression"}checkLVal(e,{in:r,binding:i=64,checkClashes:s=!1,strictModeChanged:a=!1,hasParenthesizedAncestor:n=!1}){var o;let l=e.type;if(this.isObjectMethod(e))return;let u=this.isOptionalMemberExpression(e);if(u||l==="MemberExpression"){u&&(this.expectPlugin("optionalChainingAssign",e.loc.start),r.type!=="AssignmentExpression"&&this.raise(x.InvalidLhsOptionalChaining,{at:e,ancestor:r})),i!==64&&this.raise(x.InvalidPropertyBindingPattern,{at:e});return}if(l==="Identifier"){this.checkIdentifier(e,i,a);let{name:I}=e;s&&(s.has(I)?this.raise(x.ParamDupe,{at:e}):s.add(I));return}let p=this.isValidLVal(l,!(n||(o=e.extra)!=null&&o.parenthesized)&&r.type==="AssignmentExpression",i);if(p===!0)return;if(p===!1){let I=i===64?x.InvalidLhs:x.InvalidLhsBinding;this.raise(I,{at:e,ancestor:r});return}let[S,E]=Array.isArray(p)?p:[p,l==="ParenthesizedExpression"],v=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:r;for(let I of [].concat(e[S]))I&&this.checkLVal(I,{in:v,binding:i,checkClashes:s,strictModeChanged:a,hasParenthesizedAncestor:E});}checkIdentifier(e,r,i=!1){this.state.strict&&(i?ic(e.name,this.inModule):rc(e.name))&&(r===64?this.raise(x.StrictEvalArguments,{at:e,referenceName:e.name}):this.raise(x.StrictEvalArgumentsBinding,{at:e,bindingName:e.name})),r&8192&&e.name==="let"&&this.raise(x.LetInLexicalBinding,{at:e}),r&64||this.declareNameFromIdentifier(e,r);}declareNameFromIdentifier(e,r){this.scope.declareName(e.name,r,e.loc.start);}checkToRestConversion(e,r){switch(e.type){case"ParenthesizedExpression":this.checkToRestConversion(e.expression,r);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(r)break;default:this.raise(x.InvalidRestAssignmentPattern,{at:e});}}checkCommaAfterRest(e){return this.match(12)?(this.raise(this.lookaheadCharCode()===e?x.RestTrailingComma:x.ElementAfterRest,{at:this.state.startLoc}),!0):!1}},KD=(t,e)=>Object.hasOwnProperty.call(t,e)&&t[e];function VD(t){if(t==null)throw new Error(`Unexpected ${t} value.`);return t}function Yu(t){if(!t)throw new Error("Assert fail")}var B=$e`typescript`({AbstractMethodHasImplementation:({methodName:t})=>`Method '${t}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:t})=>`Property '${t}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:t})=>`'declare' is not allowed in ${t}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:t})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:t})=>`Duplicate modifier: '${t}'.`,EmptyHeritageClauseType:({token:t})=>`'${t}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:t})=>`'${t[0]}' modifier cannot be used with '${t[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:t})=>`Index signatures cannot have an accessibility modifier ('${t}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:t})=>`'${t}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:t})=>`'${t}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:t})=>`'${t}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:t})=>`'${t[0]}' modifier must precede '${t[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:t})=>`Private elements cannot have an accessibility modifier ('${t}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:t})=>`Single type parameter ${t} should have a trailing comma. Example usage: <${t},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:t})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${t}.`});function YD(t){switch(t){case"any":return "TSAnyKeyword";case"boolean":return "TSBooleanKeyword";case"bigint":return "TSBigIntKeyword";case"never":return "TSNeverKeyword";case"number":return "TSNumberKeyword";case"object":return "TSObjectKeyword";case"string":return "TSStringKeyword";case"symbol":return "TSSymbolKeyword";case"undefined":return "TSUndefinedKeyword";case"unknown":return "TSUnknownKeyword";default:return}}function Xu(t){return t==="private"||t==="public"||t==="protected"}function XD(t){return t==="in"||t==="out"}var JD=t=>class extends t{constructor(...r){super(...r),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:B.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:B.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:B.InvalidModifierOnTypeParameter});}getScopeHandler(){return yn}tsIsIdentifier(){return te(this.state.type)}tsTokenCanFollowModifier(){return (this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(138)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(),this.tsTokenCanFollowModifier()}tsParseModifier(r,i){if(!te(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let s=this.state.value;if(r.indexOf(s)!==-1){if(i&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return s}}tsParseModifiers({allowedModifiers:r,disallowedModifiers:i,stopOnStartOfClassStaticBlock:s,errorTemplate:a=B.InvalidModifierOnTypeMember},n){let o=(u,p,S,E)=>{p===S&&n[E]&&this.raise(B.InvalidModifiersOrder,{at:u,orderedModifiers:[S,E]});},l=(u,p,S,E)=>{(n[S]&&p===E||n[E]&&p===S)&&this.raise(B.IncompatibleModifiers,{at:u,modifiers:[S,E]});};for(;;){let{startLoc:u}=this.state,p=this.tsParseModifier(r.concat(i??[]),s);if(!p)break;Xu(p)?n.accessibility?this.raise(B.DuplicateAccessibilityModifier,{at:u,modifier:p}):(o(u,p,p,"override"),o(u,p,p,"static"),o(u,p,p,"readonly"),n.accessibility=p):XD(p)?(n[p]&&this.raise(B.DuplicateModifier,{at:u,modifier:p}),n[p]=!0,o(u,p,"in","out")):(Object.hasOwnProperty.call(n,p)?this.raise(B.DuplicateModifier,{at:u,modifier:p}):(o(u,p,"static","readonly"),o(u,p,"static","override"),o(u,p,"override","readonly"),o(u,p,"abstract","override"),l(u,p,"declare","override"),l(u,p,"static","abstract")),n[p]=!0),i!=null&&i.includes(p)&&this.raise(a,{at:u,modifier:p});}}tsIsListTerminator(r){switch(r){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(r,i){let s=[];for(;!this.tsIsListTerminator(r);)s.push(i());return s}tsParseDelimitedList(r,i,s){return VD(this.tsParseDelimitedListWorker(r,i,!0,s))}tsParseDelimitedListWorker(r,i,s,a){let n=[],o=-1;for(;!this.tsIsListTerminator(r);){o=-1;let l=i();if(l==null)return;if(n.push(l),this.eat(12)){o=this.state.lastTokStart;continue}if(this.tsIsListTerminator(r))break;s&&this.expect(12);return}return a&&(a.value=o),n}tsParseBracketedList(r,i,s,a,n){a||(s?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(r,i,n);return s?this.expect(3):this.expect(48),o}tsParseImportType(){let r=this.startNode();return this.expect(83),this.expect(10),this.match(133)||this.raise(B.UnsupportedImportTypeArgument,{at:this.state.startLoc}),r.argument=super.parseExprAtom(),this.expect(11),this.eat(16)&&(r.qualifier=this.tsParseEntityName()),this.match(47)&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSImportType")}tsParseEntityName(r=!0){let i=this.parseIdentifier(r);for(;this.eat(16);){let s=this.startNodeAtNode(i);s.left=i,s.right=this.parseIdentifier(r),i=this.finishNode(s,"TSQualifiedName");}return i}tsParseTypeReference(){let r=this.startNode();return r.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSTypeReference")}tsParseThisTypePredicate(r){this.next();let i=this.startNodeAtNode(r);return i.parameterName=r,i.typeAnnotation=this.tsParseTypeAnnotation(!1),i.asserts=!1,this.finishNode(i,"TSTypePredicate")}tsParseThisTypeNode(){let r=this.startNode();return this.next(),this.finishNode(r,"TSThisType")}tsParseTypeQuery(){let r=this.startNode();return this.expect(87),this.match(83)?r.exprName=this.tsParseImportType():r.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSTypeQuery")}tsParseTypeParameter(r){let i=this.startNode();return r(i),i.name=this.tsParseTypeParameterName(),i.constraint=this.tsEatThenParseType(81),i.default=this.tsEatThenParseType(29),this.finishNode(i,"TSTypeParameter")}tsTryParseTypeParameters(r){if(this.match(47))return this.tsParseTypeParameters(r)}tsParseTypeParameters(r){let i=this.startNode();this.match(47)||this.match(142)?this.next():this.unexpected();let s={value:-1};return i.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,r),!1,!0,s),i.params.length===0&&this.raise(B.EmptyTypeParameters,{at:i}),s.value!==-1&&this.addExtra(i,"trailingComma",s.value),this.finishNode(i,"TSTypeParameterDeclaration")}tsFillSignature(r,i){let s=r===19,a="parameters",n="typeAnnotation";i.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),i[a]=this.tsParseBindingListForSignature(),s?i[n]=this.tsParseTypeOrTypePredicateAnnotation(r):this.match(r)&&(i[n]=this.tsParseTypeOrTypePredicateAnnotation(r));}tsParseBindingListForSignature(){let r=super.parseBindingList(11,41,2);for(let i of r){let{type:s}=i;(s==="AssignmentPattern"||s==="TSParameterProperty")&&this.raise(B.UnsupportedSignatureParameterKind,{at:i,type:s});}return r}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13);}tsParseSignatureMember(r,i){return this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon(),this.finishNode(i,r)}tsIsUnambiguouslyIndexSignature(){return this.next(),te(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(r){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let i=this.parseIdentifier();i.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(i),this.expect(3),r.parameters=[i];let s=this.tsTryParseTypeAnnotation();return s&&(r.typeAnnotation=s),this.tsParseTypeMemberSemicolon(),this.finishNode(r,"TSIndexSignature")}tsParsePropertyOrMethodSignature(r,i){this.eat(17)&&(r.optional=!0);let s=r;if(this.match(10)||this.match(47)){i&&this.raise(B.ReadonlyForMethodSignature,{at:r});let a=s;a.kind&&this.match(47)&&this.raise(B.AccesorCannotHaveTypeParameters,{at:this.state.curPosition()}),this.tsFillSignature(14,a),this.tsParseTypeMemberSemicolon();let n="parameters",o="typeAnnotation";if(a.kind==="get")a[n].length>0&&(this.raise(x.BadGetterArity,{at:this.state.curPosition()}),this.isThisParam(a[n][0])&&this.raise(B.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}));else if(a.kind==="set"){if(a[n].length!==1)this.raise(x.BadSetterArity,{at:this.state.curPosition()});else {let l=a[n][0];this.isThisParam(l)&&this.raise(B.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}),l.type==="Identifier"&&l.optional&&this.raise(B.SetAccesorCannotHaveOptionalParameter,{at:this.state.curPosition()}),l.type==="RestElement"&&this.raise(B.SetAccesorCannotHaveRestParameter,{at:this.state.curPosition()});}a[o]&&this.raise(B.SetAccesorCannotHaveReturnType,{at:a[o]});}else a.kind="method";return this.finishNode(a,"TSMethodSignature")}else {let a=s;i&&(a.readonly=!0);let n=this.tsTryParseTypeAnnotation();return n&&(a.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(a,"TSPropertySignature")}}tsParseTypeMember(){let r=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",r);if(this.match(77)){let s=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",r):(r.key=this.createIdentifier(s,"new"),this.tsParsePropertyOrMethodSignature(r,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},r);let i=this.tsTryParseIndexSignature(r);return i||(super.parsePropertyName(r),!r.computed&&r.key.type==="Identifier"&&(r.key.name==="get"||r.key.name==="set")&&this.tsTokenCanFollowModifier()&&(r.kind=r.key.name,super.parsePropertyName(r)),this.tsParsePropertyOrMethodSignature(r,!!r.readonly))}tsParseTypeLiteral(){let r=this.startNode();return r.members=this.tsParseObjectTypeMembers(),this.finishNode(r,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let r=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),r}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedTypeParameter(){let r=this.startNode();return r.name=this.tsParseTypeParameterName(),r.constraint=this.tsExpectThenParseType(58),this.finishNode(r,"TSTypeParameter")}tsParseMappedType(){let r=this.startNode();return this.expect(5),this.match(53)?(r.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(r.readonly=!0),this.expect(0),r.typeParameter=this.tsParseMappedTypeParameter(),r.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(r.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(r.optional=!0),r.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(r,"TSMappedType")}tsParseTupleType(){let r=this.startNode();r.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let i=!1;return r.elementTypes.forEach(s=>{let{type:a}=s;i&&a!=="TSRestType"&&a!=="TSOptionalType"&&!(a==="TSNamedTupleMember"&&s.optional)&&this.raise(B.OptionalTypeBeforeRequired,{at:s}),i||(i=a==="TSNamedTupleMember"&&s.optional||a==="TSOptionalType");}),this.finishNode(r,"TSTupleType")}tsParseTupleElementType(){let{startLoc:r}=this.state,i=this.eat(21),s,a,n,o,u=_e(this.state.type)?this.lookaheadCharCode():null;if(u===58)s=!0,n=!1,a=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(u===63){n=!0;let p=this.state.startLoc,S=this.state.value,E=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(s=!0,a=this.createIdentifier(this.startNodeAt(p),S),this.expect(17),this.expect(14),o=this.tsParseType()):(s=!1,o=E,this.expect(17));}else o=this.tsParseType(),n=this.eat(17),s=this.eat(14);if(s){let p;a?(p=this.startNodeAtNode(a),p.optional=n,p.label=a,p.elementType=o,this.eat(17)&&(p.optional=!0,this.raise(B.TupleOptionalAfterType,{at:this.state.lastTokStartLoc}))):(p=this.startNodeAtNode(o),p.optional=n,this.raise(B.InvalidTupleMemberLabel,{at:o}),p.label=o,p.elementType=this.tsParseType()),o=this.finishNode(p,"TSNamedTupleMember");}else if(n){let p=this.startNodeAtNode(o);p.typeAnnotation=o,o=this.finishNode(p,"TSOptionalType");}if(i){let p=this.startNodeAt(r);p.typeAnnotation=o,o=this.finishNode(p,"TSRestType");}return o}tsParseParenthesizedType(){let r=this.startNode();return this.expect(10),r.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(r,"TSParenthesizedType")}tsParseFunctionOrConstructorType(r,i){let s=this.startNode();return r==="TSConstructorType"&&(s.abstract=!!i,i&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,s)),this.finishNode(s,r)}tsParseLiteralTypeNode(){let r=this.startNode();switch(this.state.type){case 134:case 135:case 133:case 85:case 86:r.literal=super.parseExprAtom();break;default:this.unexpected();}return this.finishNode(r,"TSLiteralType")}tsParseTemplateLiteralType(){let r=this.startNode();return r.literal=super.parseTemplate(!1),this.finishNode(r,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let r=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(r):r}tsParseNonArrayType(){switch(this.state.type){case 133:case 134:case 135:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let r=this.startNode(),i=this.lookahead();return i.type!==134&&i.type!==135&&this.unexpected(),r.literal=this.parseMaybeUnary(),this.finishNode(r,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:r}=this.state;if(te(r)||r===88||r===84){let i=r===88?"TSVoidKeyword":r===84?"TSNullKeyword":YD(this.state.value);if(i!==void 0&&this.lookaheadCharCode()!==46){let s=this.startNode();return this.next(),this.finishNode(s,i)}return this.tsParseTypeReference()}}}this.unexpected();}tsParseArrayTypeOrHigher(){let r=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAtNode(r);i.elementType=r,this.expect(3),r=this.finishNode(i,"TSArrayType");}else {let i=this.startNodeAtNode(r);i.objectType=r,i.indexType=this.tsParseType(),this.expect(3),r=this.finishNode(i,"TSIndexedAccessType");}return r}tsParseTypeOperator(){let r=this.startNode(),i=this.state.value;return this.next(),r.operator=i,r.typeAnnotation=this.tsParseTypeOperatorOrHigher(),i==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(r),this.finishNode(r,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(r){switch(r.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(B.UnexpectedReadonly,{at:r});}}tsParseInferType(){let r=this.startNode();this.expectContextual(115);let i=this.startNode();return i.name=this.tsParseTypeParameterName(),i.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),r.typeParameter=this.finishNode(i,"TSTypeParameter"),this.finishNode(r,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let r=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return r}}tsParseTypeOperatorOrHigher(){return oD(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(r,i,s){let a=this.startNode(),n=this.eat(s),o=[];do o.push(i());while(this.eat(s));return o.length===1&&!n?o[0]:(a.types=o,this.finishNode(a,r))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(te(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:r}=this.state,i=r.length;try{return this.parseObjectLike(8,!0),r.length===i}catch{return !1}}if(this.match(0)){this.next();let{errors:r}=this.state,i=r.length;try{return super.parseBindingList(3,93,1),r.length===i}catch{return !1}}return !1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(r){return this.tsInType(()=>{let i=this.startNode();this.expect(r);let s=this.startNode(),a=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(a&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(s.parameterName=l,s.asserts=!0,s.typeAnnotation=null,l=this.finishNode(s,"TSTypePredicate")):(this.resetStartLocationFromNode(l,s),l.asserts=!0),i.typeAnnotation=l,this.finishNode(i,"TSTypeAnnotation")}let n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return a?(s.parameterName=this.parseIdentifier(),s.asserts=a,s.typeAnnotation=null,i.typeAnnotation=this.finishNode(s,"TSTypePredicate"),this.finishNode(i,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,i);let o=this.tsParseTypeAnnotation(!1);return s.parameterName=n,s.typeAnnotation=o,s.asserts=a,i.typeAnnotation=this.finishNode(s,"TSTypePredicate"),this.finishNode(i,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let r=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),r}tsParseTypePredicateAsserts(){if(this.state.type!==109)return !1;let r=this.state.containsEsc;return this.next(),!te(this.state.type)&&!this.match(78)?!1:(r&&this.raise(x.InvalidEscapedReservedWord,{at:this.state.lastTokStartLoc,reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(r=!0,i=this.startNode()){return this.tsInType(()=>{r&&this.expect(14),i.typeAnnotation=this.tsParseType();}),this.finishNode(i,"TSTypeAnnotation")}tsParseType(){Yu(this.state.inType);let r=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return r;let i=this.startNodeAtNode(r);return i.checkType=r,i.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),i.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),i.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(i,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(B.ReservedTypeAssertion,{at:this.state.startLoc});let r=this.startNode();return r.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),r.expression=this.parseMaybeUnary(),this.finishNode(r,"TSTypeAssertion")}tsParseHeritageClause(r){let i=this.state.startLoc,s=this.tsParseDelimitedList("HeritageClauseElement",()=>{let a=this.startNode();return a.expression=this.tsParseEntityName(),this.match(47)&&(a.typeParameters=this.tsParseTypeArguments()),this.finishNode(a,"TSExpressionWithTypeArguments")});return s.length||this.raise(B.EmptyHeritageClauseType,{at:i,token:r}),s}tsParseInterfaceDeclaration(r,i={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),i.declare&&(r.declare=!0),te(this.state.type)?(r.id=this.parseIdentifier(),this.checkIdentifier(r.id,130)):(r.id=null,this.raise(B.MissingInterfaceName,{at:this.state.startLoc})),r.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(r.extends=this.tsParseHeritageClause("extends"));let s=this.startNode();return s.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),r.body=this.finishNode(s,"TSInterfaceBody"),this.finishNode(r,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(r){return r.id=this.parseIdentifier(),this.checkIdentifier(r.id,2),r.typeAnnotation=this.tsInType(()=>{if(r.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let i=this.startNode();return this.next(),this.finishNode(i,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(r,"TSTypeAliasDeclaration")}tsInNoContext(r){let i=this.state.context;this.state.context=[i[0]];try{return r()}finally{this.state.context=i;}}tsInType(r){let i=this.state.inType;this.state.inType=!0;try{return r()}finally{this.state.inType=i;}}tsInDisallowConditionalTypesContext(r){let i=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return r()}finally{this.state.inDisallowConditionalTypesContext=i;}}tsInAllowConditionalTypesContext(r){let i=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return r()}finally{this.state.inDisallowConditionalTypesContext=i;}}tsEatThenParseType(r){if(this.match(r))return this.tsNextThenParseType()}tsExpectThenParseType(r){return this.tsInType(()=>(this.expect(r),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let r=this.startNode();return r.id=this.match(133)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(r.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(r,"TSEnumMember")}tsParseEnumDeclaration(r,i={}){return i.const&&(r.const=!0),i.declare&&(r.declare=!0),this.expectContextual(126),r.id=this.parseIdentifier(),this.checkIdentifier(r.id,r.const?8971:8459),this.expect(5),r.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(r,"TSEnumDeclaration")}tsParseModuleBlock(){let r=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(r.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(r,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(r,i=!1){if(r.id=this.parseIdentifier(),i||this.checkIdentifier(r.id,1024),this.eat(16)){let s=this.startNode();this.tsParseModuleOrNamespaceDeclaration(s,!0),r.body=s;}else this.scope.enter(256),this.prodParam.enter(0),r.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(r,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(r){return this.isContextual(112)?(r.global=!0,r.id=this.parseIdentifier()):this.match(133)?r.id=super.parseStringLiteral(this.state.value):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),r.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(r,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(r,i,s){r.isExport=s||!1,r.id=i||this.parseIdentifier(),this.checkIdentifier(r.id,4096),this.expect(29);let a=this.tsParseModuleReference();return r.importKind==="type"&&a.type!=="TSExternalModuleReference"&&this.raise(B.ImportAliasHasImportType,{at:a}),r.moduleReference=a,this.semicolon(),this.finishNode(r,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){let r=this.startNode();return this.expectContextual(119),this.expect(10),this.match(133)||this.unexpected(),r.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExternalModuleReference")}tsLookAhead(r){let i=this.state.clone(),s=r();return this.state=i,s}tsTryParseAndCatch(r){let i=this.tryParse(s=>r()||s());if(!(i.aborted||!i.node))return i.error&&(this.state=i.failState),i.node}tsTryParse(r){let i=this.state.clone(),s=r();if(s!==void 0&&s!==!1)return s;this.state=i;}tsTryParseDeclare(r){if(this.isLineTerminator())return;let i=this.state.type,s;return this.isContextual(100)&&(i=74,s="let"),this.tsInAmbientContext(()=>{switch(i){case 68:return r.declare=!0,super.parseFunctionStatement(r,!1,!1);case 80:return r.declare=!0,this.parseClass(r,!0,!1);case 126:return this.tsParseEnumDeclaration(r,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(r);case 75:case 74:return !this.match(75)||!this.isLookaheadContextual("enum")?(r.declare=!0,this.parseVarStatement(r,s||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(r,{const:!0,declare:!0}));case 129:{let a=this.tsParseInterfaceDeclaration(r,{declare:!0});if(a)return a}default:if(te(i))return this.tsParseDeclaration(r,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(r,i,s){switch(i.name){case"declare":{let a=this.tsTryParseDeclare(r);return a&&(a.declare=!0),a}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let a=r;return a.global=!0,a.id=i,a.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(a,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(r,i.name,!1,s)}}tsParseDeclaration(r,i,s,a){switch(i){case"abstract":if(this.tsCheckLineTerminator(s)&&(this.match(80)||te(this.state.type)))return this.tsParseAbstractDeclaration(r,a);break;case"module":if(this.tsCheckLineTerminator(s)){if(this.match(133))return this.tsParseAmbientExternalModuleDeclaration(r);if(te(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(r)}break;case"namespace":if(this.tsCheckLineTerminator(s)&&te(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(r);break;case"type":if(this.tsCheckLineTerminator(s)&&te(this.state.type))return this.tsParseTypeAliasDeclaration(r);break}}tsCheckLineTerminator(r){return r?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(r){if(!this.match(47))return;let i=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let s=this.tsTryParseAndCatch(()=>{let a=this.startNodeAt(r);return a.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(a),a.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),a});if(this.state.maybeInArrowParameters=i,!!s)return super.parseArrowExpression(s,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let r=this.startNode();return r.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),r.params.length===0?this.raise(B.EmptyTypeArguments,{at:r}):!this.state.inType&&this.curContext()===ae.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(r,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return lD(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(r,i){let s=this.state.startLoc,a={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},a);let n=a.accessibility,o=a.override,l=a.readonly;!(r&4)&&(n||l||o)&&this.raise(B.UnexpectedParameterModifier,{at:s});let u=this.parseMaybeDefault();this.parseAssignableListItemTypes(u,r);let p=this.parseMaybeDefault(u.loc.start,u);if(n||l||o){let S=this.startNodeAt(s);return i.length&&(S.decorators=i),n&&(S.accessibility=n),l&&(S.readonly=l),o&&(S.override=o),p.type!=="Identifier"&&p.type!=="AssignmentPattern"&&this.raise(B.UnsupportedParameterPropertyKind,{at:S}),S.parameter=p,this.finishNode(S,"TSParameterProperty")}return i.length&&(u.decorators=i),p}isSimpleParameter(r){return r.type==="TSParameterProperty"&&super.isSimpleParameter(r.parameter)||super.isSimpleParameter(r)}tsDisallowOptionalPattern(r){for(let i of r.params)i.type!=="Identifier"&&i.optional&&!this.state.isAmbientContext&&this.raise(B.PatternIsOptional,{at:i});}setArrowFunctionParameters(r,i,s){super.setArrowFunctionParameters(r,i,s),this.tsDisallowOptionalPattern(r);}parseFunctionBodyAndFinish(r,i,s=!1){this.match(14)&&(r.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let a=i==="FunctionDeclaration"?"TSDeclareFunction":i==="ClassMethod"||i==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return a&&!this.match(5)&&this.isLineTerminator()?this.finishNode(r,a):a==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(B.DeclareFunctionHasImplementation,{at:r}),r.declare)?super.parseFunctionBodyAndFinish(r,a,s):(this.tsDisallowOptionalPattern(r),super.parseFunctionBodyAndFinish(r,i,s))}registerFunctionStatementId(r){!r.body&&r.id?this.checkIdentifier(r.id,1024):super.registerFunctionStatementId(r);}tsCheckForInvalidTypeCasts(r){r.forEach(i=>{i?.type==="TSTypeCastExpression"&&this.raise(B.UnexpectedTypeAnnotation,{at:i.typeAnnotation});});}toReferencedList(r,i){return this.tsCheckForInvalidTypeCasts(r),r}parseArrayLike(r,i,s,a){let n=super.parseArrayLike(r,i,s,a);return n.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(r,i,s,a){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(i);return o.expression=r,this.finishNode(o,"TSNonNullExpression")}let n=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(s)return a.stop=!0,r;a.optionalChainMember=n=!0,this.next();}if(this.match(47)||this.match(51)){let o,l=this.tsTryParseAndCatch(()=>{if(!s&&this.atPossibleAsyncArrow(r)){let E=this.tsTryParseGenericAsyncArrowFunction(i);if(E)return E}let u=this.tsParseTypeArgumentsInExpression();if(!u)return;if(n&&!this.match(10)){o=this.state.curPosition();return}if(ci(this.state.type)){let E=super.parseTaggedTemplateExpression(r,i,a);return E.typeParameters=u,E}if(!s&&this.eat(10)){let E=this.startNodeAt(i);return E.callee=r,E.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(E.arguments),E.typeParameters=u,a.optionalChainMember&&(E.optional=n),this.finishCallExpression(E,a.optionalChainMember)}let p=this.state.type;if(p===48||p===52||p!==10&&Qa(p)&&!this.hasPrecedingLineBreak())return;let S=this.startNodeAt(i);return S.expression=r,S.typeParameters=u,this.finishNode(S,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(B.InvalidPropertyAccessAfterInstantiationExpression,{at:this.state.startLoc}),l}return super.parseSubscript(r,i,s,a)}parseNewCallee(r){var i;super.parseNewCallee(r);let{callee:s}=r;s.type==="TSInstantiationExpression"&&!((i=s.extra)!=null&&i.parenthesized)&&(r.typeParameters=s.typeParameters,r.callee=s.expression);}parseExprOp(r,i,s){let a;if(ai(58)>s&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(a=this.isContextual(120)))){let n=this.startNodeAt(i);return n.expression=r,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(a&&this.raise(x.UnexpectedKeyword,{at:this.state.startLoc,keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(n,a?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(n,i,s)}return super.parseExprOp(r,i,s)}checkReservedWord(r,i,s,a){this.state.isAmbientContext||super.checkReservedWord(r,i,s,a);}checkImportReflection(r){super.checkImportReflection(r),r.module&&r.importKind!=="value"&&this.raise(B.ImportReflectionHasImportType,{at:r.specifiers[0].loc.start});}checkDuplicateExports(){}isPotentialImportPhase(r){if(super.isPotentialImportPhase(r))return !0;if(this.isContextual(130)){let i=this.lookaheadCharCode();return r?i===123||i===42:i!==61}return !r&&this.isContextual(87)}applyImportPhase(r,i,s,a){super.applyImportPhase(r,i,s,a),i?r.exportKind=s==="type"?"type":"value":r.importKind=s==="type"||s==="typeof"?s:"value";}parseImport(r){if(this.match(133))return r.importKind="value",super.parseImport(r);let i;if(te(this.state.type)&&this.lookaheadCharCode()===61)return r.importKind="value",this.tsParseImportEqualsDeclaration(r);if(this.isContextual(130)){let s=this.parseMaybeImportPhase(r,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(r,s);i=super.parseImportSpecifiersAndAfter(r,s);}else i=super.parseImport(r);return i.importKind==="type"&&i.specifiers.length>1&&i.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(B.TypeImportCannotSpecifyDefaultAndNamed,{at:i}),i}parseExport(r,i){if(this.match(83)){this.next();let s=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?s=this.parseMaybeImportPhase(r,!1):r.importKind="value",this.tsParseImportEqualsDeclaration(r,s,!0)}else if(this.eat(29)){let s=r;return s.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(s,"TSExportAssignment")}else if(this.eatContextual(93)){let s=r;return this.expectContextual(128),s.id=this.parseIdentifier(),this.semicolon(),this.finishNode(s,"TSNamespaceExportDeclaration")}else return super.parseExport(r,i)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let r=this.startNode();return this.next(),r.abstract=!0,this.parseClass(r,!0,!0)}if(this.match(129)){let r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r}return super.parseExportDefaultExpression()}parseVarStatement(r,i,s=!1){let{isAmbientContext:a}=this.state,n=super.parseVarStatement(r,i,s||a);if(!a)return n;for(let{id:o,init:l}of n.declarations)l&&(i!=="const"||o.typeAnnotation?this.raise(B.InitializerNotAllowedInAmbientContext,{at:l}):WD(l,this.hasPlugin("estree"))||this.raise(B.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,{at:l}));return n}parseStatementContent(r,i){if(this.match(75)&&this.isLookaheadContextual("enum")){let s=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(s,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let s=this.tsParseInterfaceDeclaration(this.startNode());if(s)return s}return super.parseStatementContent(r,i)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(r,i){return i.some(s=>Xu(s)?r.accessibility===s:!!r[s])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(r,i,s){let a=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:a,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:B.InvalidModifierOnTypeParameterPositions},i);let n=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(i,a)&&this.raise(B.StaticBlockCannotHaveModifier,{at:this.state.curPosition()}),super.parseClassStaticBlock(r,i)):this.parseClassMemberWithIsStatic(r,i,s,!!i.static);};i.declare?this.tsInAmbientContext(n):n();}parseClassMemberWithIsStatic(r,i,s,a){let n=this.tsTryParseIndexSignature(i);if(n){r.body.push(n),i.abstract&&this.raise(B.IndexSignatureHasAbstract,{at:i}),i.accessibility&&this.raise(B.IndexSignatureHasAccessibility,{at:i,modifier:i.accessibility}),i.declare&&this.raise(B.IndexSignatureHasDeclare,{at:i}),i.override&&this.raise(B.IndexSignatureHasOverride,{at:i});return}!this.state.inAbstractClass&&i.abstract&&this.raise(B.NonAbstractClassHasAbstractMethod,{at:i}),i.override&&(s.hadSuperClass||this.raise(B.OverrideNotInSubClass,{at:i})),super.parseClassMemberWithIsStatic(r,i,s,a);}parsePostMemberNameModifiers(r){this.eat(17)&&(r.optional=!0),r.readonly&&this.match(10)&&this.raise(B.ClassMethodHasReadonly,{at:r}),r.declare&&this.match(10)&&this.raise(B.ClassMethodHasDeclare,{at:r});}parseExpressionStatement(r,i,s){return (i.type==="Identifier"?this.tsParseExpressionStatement(r,i,s):void 0)||super.parseExpressionStatement(r,i,s)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(r,i,s){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(r,i,s);let a=this.tryParse(()=>super.parseConditional(r,i));return a.node?(a.error&&(this.state=a.failState),a.node):(a.error&&super.setOptionalParametersError(s,a.error),r)}parseParenItem(r,i){if(r=super.parseParenItem(r,i),this.eat(17)&&(r.optional=!0,this.resetEndLocation(r)),this.match(14)){let s=this.startNodeAt(i);return s.expression=r,s.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(s,"TSTypeCastExpression")}return r}parseExportDeclaration(r){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(r));let i=this.state.startLoc,s=this.eatContextual(125);if(s&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(B.ExpectedAmbientAfterExportDeclare,{at:this.state.startLoc});let n=te(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(r);return n?((n.type==="TSInterfaceDeclaration"||n.type==="TSTypeAliasDeclaration"||s)&&(r.exportKind="type"),s&&(this.resetStartLocation(n,i),n.declare=!0),n):null}parseClassId(r,i,s,a){if((!i||s)&&this.isContextual(113))return;super.parseClassId(r,i,s,r.declare?1024:8331);let n=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);n&&(r.typeParameters=n);}parseClassPropertyAnnotation(r){r.optional||(this.eat(35)?r.definite=!0:this.eat(17)&&(r.optional=!0));let i=this.tsTryParseTypeAnnotation();i&&(r.typeAnnotation=i);}parseClassProperty(r){if(this.parseClassPropertyAnnotation(r),this.state.isAmbientContext&&!(r.readonly&&!r.typeAnnotation)&&this.match(29)&&this.raise(B.DeclareClassFieldHasInitializer,{at:this.state.startLoc}),r.abstract&&this.match(29)){let{key:i}=r;this.raise(B.AbstractPropertyHasInitializer,{at:this.state.startLoc,propertyName:i.type==="Identifier"&&!r.computed?i.name:`[${this.input.slice(i.start,i.end)}]`});}return super.parseClassProperty(r)}parseClassPrivateProperty(r){return r.abstract&&this.raise(B.PrivateElementHasAbstract,{at:r}),r.accessibility&&this.raise(B.PrivateElementHasAccessibility,{at:r,modifier:r.accessibility}),this.parseClassPropertyAnnotation(r),super.parseClassPrivateProperty(r)}parseClassAccessorProperty(r){return this.parseClassPropertyAnnotation(r),r.optional&&this.raise(B.AccessorCannotBeOptional,{at:r}),super.parseClassAccessorProperty(r)}pushClassMethod(r,i,s,a,n,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&n&&this.raise(B.ConstructorHasTypeParameters,{at:l});let{declare:u=!1,kind:p}=i;u&&(p==="get"||p==="set")&&this.raise(B.DeclareAccessor,{at:i,kind:p}),l&&(i.typeParameters=l),super.pushClassMethod(r,i,s,a,n,o);}pushClassPrivateMethod(r,i,s,a){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(i.typeParameters=n),super.pushClassPrivateMethod(r,i,s,a);}declareClassPrivateMethodInScope(r,i){r.type!=="TSDeclareMethod"&&(r.type==="MethodDefinition"&&!r.value.body||super.declareClassPrivateMethodInScope(r,i));}parseClassSuper(r){super.parseClassSuper(r),r.superClass&&(this.match(47)||this.match(51))&&(r.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(r.implements=this.tsParseHeritageClause("implements"));}parseObjPropValue(r,i,s,a,n,o,l){let u=this.tsTryParseTypeParameters(this.tsParseConstModifier);return u&&(r.typeParameters=u),super.parseObjPropValue(r,i,s,a,n,o,l)}parseFunctionParams(r,i){let s=this.tsTryParseTypeParameters(this.tsParseConstModifier);s&&(r.typeParameters=s),super.parseFunctionParams(r,i);}parseVarId(r,i){super.parseVarId(r,i),r.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(r.definite=!0);let s=this.tsTryParseTypeAnnotation();s&&(r.id.typeAnnotation=s,this.resetEndLocation(r.id));}parseAsyncArrowFromCallExpression(r,i){return this.match(14)&&(r.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(r,i)}parseMaybeAssign(r,i){var s,a,n,o,l;let u,p,S;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(u=this.state.clone(),p=this.tryParse(()=>super.parseMaybeAssign(r,i),u),!p.error)return p.node;let{context:I}=this.state,N=I[I.length-1];(N===ae.j_oTag||N===ae.j_expr)&&I.pop();}if(!((s=p)!=null&&s.error)&&!this.match(47))return super.parseMaybeAssign(r,i);(!u||u===this.state)&&(u=this.state.clone());let E,v=this.tryParse(I=>{var N,M;E=this.tsParseTypeParameters(this.tsParseConstModifier);let j=super.parseMaybeAssign(r,i);return (j.type!=="ArrowFunctionExpression"||(N=j.extra)!=null&&N.parenthesized)&&I(),((M=E)==null?void 0:M.params.length)!==0&&this.resetStartLocationFromNode(j,E),j.typeParameters=E,j},u);if(!v.error&&!v.aborted)return E&&this.reportReservedArrowTypeParam(E),v.node;if(!p&&(Yu(!this.hasPlugin("jsx")),S=this.tryParse(()=>super.parseMaybeAssign(r,i),u),!S.error))return S.node;if((a=p)!=null&&a.node)return this.state=p.failState,p.node;if(v.node)return this.state=v.failState,E&&this.reportReservedArrowTypeParam(E),v.node;if((n=S)!=null&&n.node)return this.state=S.failState,S.node;throw ((o=p)==null?void 0:o.error)||v.error||((l=S)==null?void 0:l.error)}reportReservedArrowTypeParam(r){var i;r.params.length===1&&!r.params[0].constraint&&!((i=r.extra)!=null&&i.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(B.ReservedArrowTypeParam,{at:r});}parseMaybeUnary(r,i){return !this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(r,i)}parseArrow(r){if(this.match(14)){let i=this.tryParse(s=>{let a=this.tsParseTypeOrTypePredicateAnnotation(14);return (this.canInsertSemicolon()||!this.match(19))&&s(),a});if(i.aborted)return;i.thrown||(i.error&&(this.state=i.failState),r.returnType=i.node);}return super.parseArrow(r)}parseAssignableListItemTypes(r,i){if(!(i&2))return r;this.eat(17)&&(r.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(r.typeAnnotation=s),this.resetEndLocation(r),r}isAssignable(r,i){switch(r.type){case"TSTypeCastExpression":return this.isAssignable(r.expression,i);case"TSParameterProperty":return !0;default:return super.isAssignable(r,i)}}toAssignable(r,i=!1){switch(r.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(r,i);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":i?this.expressionScope.recordArrowParameterBindingError(B.UnexpectedTypeCastInParameter,{at:r}):this.raise(B.UnexpectedTypeCastInParameter,{at:r}),this.toAssignable(r.expression,i);break;case"AssignmentExpression":!i&&r.left.type==="TSTypeCastExpression"&&(r.left=this.typeCastToParameter(r.left));default:super.toAssignable(r,i);}}toAssignableParenthesizedExpression(r,i){switch(r.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(r.expression,i);break;default:super.toAssignable(r,i);}}checkToRestConversion(r,i){switch(r.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(r.expression,!1);break;default:super.checkToRestConversion(r,i);}}isValidLVal(r,i,s){return KD({TSTypeCastExpression:!0,TSParameterProperty:"parameter",TSNonNullExpression:"expression",TSAsExpression:(s!==64||!i)&&["expression",!0],TSSatisfiesExpression:(s!==64||!i)&&["expression",!0],TSTypeAssertion:(s!==64||!i)&&["expression",!0]},r)||super.isValidLVal(r,i,s)}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(r){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let s=super.parseMaybeDecoratorArguments(r);return s.typeParameters=i,s}this.unexpected(null,10);}return super.parseMaybeDecoratorArguments(r)}checkCommaAfterRest(r){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===r?(this.next(),!1):super.checkCommaAfterRest(r)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(r,i){let s=super.parseMaybeDefault(r,i);return s.type==="AssignmentPattern"&&s.typeAnnotation&&s.right.startthis.isAssignable(i,!0)):super.shouldParseArrow(r)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(r){if(this.match(47)||this.match(51)){let i=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());i&&(r.typeParameters=i);}return super.jsxParseOpeningElementAfterName(r)}getGetterSetterExpectedParamCount(r){let i=super.getGetterSetterExpectedParamCount(r),a=this.getObjectOrClassMethodParams(r)[0];return a&&this.isThisParam(a)?i+1:i}parseCatchClauseParam(){let r=super.parseCatchClauseParam(),i=this.tsTryParseTypeAnnotation();return i&&(r.typeAnnotation=i,this.resetEndLocation(r)),r}tsInAmbientContext(r){let i=this.state.isAmbientContext;this.state.isAmbientContext=!0;try{return r()}finally{this.state.isAmbientContext=i;}}parseClass(r,i,s){let a=this.state.inAbstractClass;this.state.inAbstractClass=!!r.abstract;try{return super.parseClass(r,i,s)}finally{this.state.inAbstractClass=a;}}tsParseAbstractDeclaration(r,i){if(this.match(80))return r.abstract=!0,this.maybeTakeDecorators(i,this.parseClass(r,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return r.abstract=!0,this.raise(B.NonClassMethodPropertyHasAbstractModifer,{at:r}),this.tsParseInterfaceDeclaration(r)}else this.unexpected(null,80);}parseMethod(r,i,s,a,n,o,l){let u=super.parseMethod(r,i,s,a,n,o,l);if(u.abstract&&(this.hasPlugin("estree")?!!u.value.body:!!u.body)){let{key:S}=u;this.raise(B.AbstractMethodHasImplementation,{at:u,methodName:S.type==="Identifier"&&!u.computed?S.name:`[${this.input.slice(S.start,S.end)}]`});}return u}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return !!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(r,i,s,a){return !i&&a?(this.parseTypeOnlyImportExportSpecifier(r,!1,s),this.finishNode(r,"ExportSpecifier")):(r.exportKind="value",super.parseExportSpecifier(r,i,s,a))}parseImportSpecifier(r,i,s,a,n){return !i&&a?(this.parseTypeOnlyImportExportSpecifier(r,!0,s),this.finishNode(r,"ImportSpecifier")):(r.importKind="value",super.parseImportSpecifier(r,i,s,a,s?4098:4096))}parseTypeOnlyImportExportSpecifier(r,i,s){let a=i?"imported":"local",n=i?"local":"exported",o=r[a],l,u=!1,p=!0,S=o.loc.start;if(this.isContextual(93)){let v=this.parseIdentifier();if(this.isContextual(93)){let I=this.parseIdentifier();_e(this.state.type)?(u=!0,o=v,l=i?this.parseIdentifier():this.parseModuleExportName(),p=!1):(l=I,p=!1);}else _e(this.state.type)?(p=!1,l=i?this.parseIdentifier():this.parseModuleExportName()):(u=!0,o=v);}else _e(this.state.type)&&(u=!0,i?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());u&&s&&this.raise(i?B.TypeModifierIsUsedInTypeImports:B.TypeModifierIsUsedInTypeExports,{at:S}),r[a]=o,r[n]=l;let E=i?"importKind":"exportKind";r[E]=u?"type":"value",p&&this.eatContextual(93)&&(r[n]=i?this.parseIdentifier():this.parseModuleExportName()),r[n]||(r[n]=We(r[a])),i&&this.checkIdentifier(r[n],u?4098:4096);}};function $D(t){if(t.type!=="MemberExpression")return !1;let{computed:e,property:r}=t;return e&&r.type!=="StringLiteral"&&(r.type!=="TemplateLiteral"||r.expressions.length>0)?!1:pc(t.object)}function WD(t,e){var r;let{type:i}=t;if((r=t.extra)!=null&&r.parenthesized)return !1;if(e){if(i==="Literal"){let{value:s}=t;if(typeof s=="string"||typeof s=="boolean")return !0}}else if(i==="StringLiteral"||i==="BooleanLiteral")return !0;return !!(cc(t,e)||zD(t,e)||i==="TemplateLiteral"&&t.expressions.length===0||$D(t))}function cc(t,e){return e?t.type==="Literal"&&(typeof t.value=="number"||"bigint"in t):t.type==="NumericLiteral"||t.type==="BigIntLiteral"}function zD(t,e){if(t.type==="UnaryExpression"){let{operator:r,argument:i}=t;if(r==="-"&&cc(i,e))return !0}return !1}function pc(t){return t.type==="Identifier"?!0:t.type!=="MemberExpression"||t.computed?!1:pc(t.object)}var Ju=$e`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),HD=t=>class extends t{parsePlaceholder(r){if(this.match(144)){let i=this.startNode();return this.next(),this.assertNoSpace(),i.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(144),this.finishPlaceholder(i,r)}}finishPlaceholder(r,i){let s=!!(r.expectedNode&&r.type==="Placeholder");return r.expectedNode=i,s?r:this.finishNode(r,"Placeholder")}getTokenFromCode(r){r===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(144,2):super.getTokenFromCode(r);}parseExprAtom(r){return this.parsePlaceholder("Expression")||super.parseExprAtom(r)}parseIdentifier(r){return this.parsePlaceholder("Identifier")||super.parseIdentifier(r)}checkReservedWord(r,i,s,a){r!==void 0&&super.checkReservedWord(r,i,s,a);}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(r,i,s){return r==="Placeholder"||super.isValidLVal(r,i,s)}toAssignable(r,i){r&&r.type==="Placeholder"&&r.expectedNode==="Expression"?r.expectedNode="Pattern":super.toAssignable(r,i);}chStartsBindingIdentifier(r,i){return !!(super.chStartsBindingIdentifier(r,i)||this.lookahead().type===144)}verifyBreakContinue(r,i){r.label&&r.label.type==="Placeholder"||super.verifyBreakContinue(r,i);}parseExpressionStatement(r,i){var s;if(i.type!=="Placeholder"||(s=i.extra)!=null&&s.parenthesized)return super.parseExpressionStatement(r,i);if(this.match(14)){let a=r;return a.label=this.finishPlaceholder(i,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}return this.semicolon(),r.name=i.name,this.finishPlaceholder(r,"Statement")}parseBlock(r,i,s){return this.parsePlaceholder("BlockStatement")||super.parseBlock(r,i,s)}parseFunctionId(r){return this.parsePlaceholder("Identifier")||super.parseFunctionId(r)}parseClass(r,i,s){let a=i?"ClassDeclaration":"ClassExpression";this.next();let n=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(144)||this.match(5))r.id=o;else {if(s||!i)return r.id=null,r.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(r,a);throw this.raise(Ju.ClassNameIsRequired,{at:this.state.startLoc})}else this.parseClassId(r,i,s);return super.parseClassSuper(r),r.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!r.superClass,n),this.finishNode(r,a)}parseExport(r,i){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseExport(r,i);if(!this.isContextual(98)&&!this.match(12))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(s,"Declaration"),this.finishNode(r,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=s,r.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(r,i)}isExportDefaultSpecifier(){if(this.match(65)){let r=this.nextTokenStart();if(this.isUnparsedContextual(r,"from")&&this.input.startsWith(at(144),this.nextTokenStartSince(r+4)))return !0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(r,i){var s;return (s=r.specifiers)!=null&&s.length?!0:super.maybeParseExportDefaultSpecifier(r,i)}checkExport(r){let{specifiers:i}=r;i!=null&&i.length&&(r.specifiers=i.filter(s=>s.exported.type==="Placeholder")),super.checkExport(r),r.specifiers=i;}parseImport(r){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseImport(r);if(r.specifiers=[],!this.isContextual(98)&&!this.match(12))return r.source=this.finishPlaceholder(i,"StringLiteral"),this.semicolon(),this.finishNode(r,"ImportDeclaration");let s=this.startNodeAtNode(i);return s.local=i,r.specifiers.push(this.finishNode(s,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(r)||this.parseNamedImportSpecifiers(r)),this.expectContextual(98),r.source=this.parseImportSource(),this.semicolon(),this.finishNode(r,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.state.lastTokEndLoc.index&&this.raise(Ju.UnexpectedSpace,{at:this.state.lastTokEndLoc});}},GD=t=>class extends t{parseV8Intrinsic(){if(this.match(54)){let r=this.state.startLoc,i=this.startNode();if(this.next(),te(this.state.type)){let s=this.parseIdentifierName(),a=this.createIdentifier(i,s);if(a.type="V8IntrinsicIdentifier",this.match(10))return a}this.unexpected(r);}}parseExprAtom(r){return this.parseV8Intrinsic()||super.parseExprAtom(r)}};function ue(t,e){let[r,i]=typeof e=="string"?[e,{}]:e,s=Object.keys(i),a=s.length===0;return t.some(n=>{if(typeof n=="string")return a&&n===r;{let[o,l]=n;if(o!==r)return !1;for(let u of s)if(l[u]!==i[u])return !1;return !0}})}function st(t,e,r){let i=t.find(s=>Array.isArray(s)?s[0]===e:s===e);return i&&Array.isArray(i)&&i.length>1?i[1][r]:null}var $u=["minimal","fsharp","hack","smart"],Wu=["^^","@@","^","%","#"],zu=["hash","bar"];function QD(t){if(ue(t,"decorators")){if(ue(t,"decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let e=st(t,"decorators","decoratorsBeforeExport");if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let r=st(t,"decorators","allowCallParenthesized");if(r!=null&&typeof r!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(ue(t,"flow")&&ue(t,"typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(ue(t,"placeholders")&&ue(t,"v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(ue(t,"pipelineOperator")){let e=st(t,"pipelineOperator","proposal");if(!$u.includes(e)){let i=$u.map(s=>`"${s}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}let r=ue(t,["recordAndTuple",{syntaxType:"hash"}]);if(e==="hack"){if(ue(t,"placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(ue(t,"v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=st(t,"pipelineOperator","topicToken");if(!Wu.includes(i)){let s=Wu.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${s}.`)}if(i==="#"&&r)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}else if(e==="smart"&&r)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}if(ue(t,"moduleAttributes")){if(ue(t,"importAssertions")||ue(t,"importAttributes"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if(st(t,"moduleAttributes","version")!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(ue(t,"importAssertions")&&ue(t,"importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(ue(t,"recordAndTuple")&&st(t,"recordAndTuple","syntaxType")!=null&&!zu.includes(st(t,"recordAndTuple","syntaxType")))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+zu.map(e=>`'${e}'`).join(", "));if(ue(t,"asyncDoExpressions")&&!ue(t,"doExpressions")){let e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(ue(t,"optionalChainingAssign")&&st(t,"optionalChainingAssign","version")!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var fc={estree:GC,jsx:UD,flow:FD,typescript:JD,v8intrinsic:GD,placeholders:HD},ZD=Object.keys(fc),za={sourceType:"script",sourceFilename:void 0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};function eL(t){if(t==null)return Object.assign({},za);if(t.annexB!=null&&t.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let e={};for(let i of Object.keys(za)){var r;e[i]=(r=t[i])!=null?r:za[i];}return e}var Tn=class extends mn{checkProto(e,r,i,s){if(e.type==="SpreadElement"||this.isObjectMethod(e)||e.computed||e.shorthand)return;let a=e.key;if((a.type==="Identifier"?a.name:a.value)==="__proto__"){if(r){this.raise(x.RecordNoProto,{at:a});return}i.used&&(s?s.doubleProtoLoc===null&&(s.doubleProtoLoc=a.loc.start):this.raise(x.DuplicateProto,{at:a})),i.used=!0;}}shouldExitDescending(e,r){return e.type==="ArrowFunctionExpression"&&e.start===r}getExpression(){this.enterInitialScopes(),this.nextToken();let e=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),e.comments=this.state.comments,e.errors=this.state.errors,this.options.tokens&&(e.tokens=this.tokens),e}parseExpression(e,r){return e?this.disallowInAnd(()=>this.parseExpressionBase(r)):this.allowInAnd(()=>this.parseExpressionBase(r))}parseExpressionBase(e){let r=this.state.startLoc,i=this.parseMaybeAssign(e);if(this.match(12)){let s=this.startNodeAt(r);for(s.expressions=[i];this.eat(12);)s.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(s.expressions),this.finishNode(s,"SequenceExpression")}return i}parseMaybeAssignDisallowIn(e,r){return this.disallowInAnd(()=>this.parseMaybeAssign(e,r))}parseMaybeAssignAllowIn(e,r){return this.allowInAnd(()=>this.parseMaybeAssign(e,r))}setOptionalParametersError(e,r){var i;e.optionalParametersLoc=(i=r?.loc)!=null?i:this.state.startLoc;}parseMaybeAssign(e,r){let i=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return r&&(o=r.call(this,o,i)),o}let s;e?s=!1:(e=new Ot,s=!0);let{type:a}=this.state;(a===10||te(a))&&(this.state.potentialArrowAt=this.state.start);let n=this.parseMaybeConditional(e);if(r&&(n=r.call(this,n,i)),rD(this.state.type)){let o=this.startNodeAt(i),l=this.state.value;if(o.operator=l,this.match(29)){this.toAssignable(n,!0),o.left=n;let u=i.index;e.doubleProtoLoc!=null&&e.doubleProtoLoc.index>=u&&(e.doubleProtoLoc=null),e.shorthandAssignLoc!=null&&e.shorthandAssignLoc.index>=u&&(e.shorthandAssignLoc=null),e.privateKeyLoc!=null&&e.privateKeyLoc.index>=u&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null);}else o.left=n;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(n,{in:this.finishNode(o,"AssignmentExpression")}),o}else s&&this.checkExpressionErrors(e,!0);return n}parseMaybeConditional(e){let r=this.state.startLoc,i=this.state.potentialArrowAt,s=this.parseExprOps(e);return this.shouldExitDescending(s,i)?s:this.parseConditional(s,r,e)}parseConditional(e,r,i){if(this.eat(17)){let s=this.startNodeAt(r);return s.test=e,s.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),s.alternate=this.parseMaybeAssign(),this.finishNode(s,"ConditionalExpression")}return e}parseMaybeUnaryOrPrivate(e){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){let r=this.state.startLoc,i=this.state.potentialArrowAt,s=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(s,i)?s:this.parseExprOp(s,r,-1)}parseExprOp(e,r,i){if(this.isPrivateName(e)){let a=this.getPrivateNameSV(e);(i>=ai(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(x.PrivateInExpectedIn,{at:e,identifierName:a}),this.classScope.usePrivateName(a,e.loc.start);}let s=this.state.type;if(sD(s)&&(this.prodParam.hasIn||!this.match(58))){let a=ai(s);if(a>i){if(s===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return e;this.checkPipelineAtInfixOperator(e,r);}let n=this.startNodeAt(r);n.left=e,n.operator=this.state.value;let o=s===41||s===42,l=s===40;if(l&&(a=ai(42)),this.next(),s===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(x.UnexpectedAwaitAfterPipelineBody,{at:this.state.startLoc});n.right=this.parseExprOpRightExpr(s,a);let u=this.finishNode(n,o||l?"LogicalExpression":"BinaryExpression"),p=this.state.type;if(l&&(p===41||p===42)||o&&p===40)throw this.raise(x.MixingCoalesceWithLogical,{at:this.state.startLoc});return this.parseExprOp(u,r,i)}}return e}parseExprOpRightExpr(e,r){let i=this.state.startLoc;switch(e){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"smart":return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(x.PipeBodyIsTighter,{at:this.state.startLoc});return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(e,r),i)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(r))}default:return this.parseExprOpBaseRightExpr(e,r)}}parseExprOpBaseRightExpr(e,r){let i=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),i,uD(e)?r-1:r)}parseHackPipeBody(){var e;let{startLoc:r}=this.state,i=this.parseMaybeAssign();return XC.has(i.type)&&!((e=i.extra)!=null&&e.parenthesized)&&this.raise(x.PipeUnparenthesizedBody,{at:r,type:i.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(x.PipeTopicUnused,{at:r}),i}checkExponentialAfterUnary(e){this.match(57)&&this.raise(x.UnexpectedTokenUnaryExponentiation,{at:e.argument});}parseMaybeUnary(e,r){let i=this.state.startLoc,s=this.isContextual(96);if(s&&this.isAwaitAllowed()){this.next();let l=this.parseAwait(i);return r||this.checkExponentialAfterUnary(l),l}let a=this.match(34),n=this.startNode();if(nD(this.state.type)){n.operator=this.state.value,n.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&l){let u=n.argument;u.type==="Identifier"?this.raise(x.StrictDelete,{at:n}):this.hasPropertyAsPrivateName(u)&&this.raise(x.DeletePrivateField,{at:n});}if(!a)return r||this.checkExponentialAfterUnary(n),this.finishNode(n,"UnaryExpression")}let o=this.parseUpdate(n,a,e);if(s){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Qa(l):Qa(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(x.AwaitNotInAsyncContext,{at:i}),this.parseAwait(i)}return o}parseUpdate(e,r,i){if(r){let n=e;return this.checkLVal(n.argument,{in:this.finishNode(n,"UpdateExpression")}),e}let s=this.state.startLoc,a=this.parseExprSubscripts(i);if(this.checkExpressionErrors(i,!1))return a;for(;aD(this.state.type)&&!this.canInsertSemicolon();){let n=this.startNodeAt(s);n.operator=this.state.value,n.prefix=!1,n.argument=a,this.next(),this.checkLVal(a,{in:a=this.finishNode(n,"UpdateExpression")});}return a}parseExprSubscripts(e){let r=this.state.startLoc,i=this.state.potentialArrowAt,s=this.parseExprAtom(e);return this.shouldExitDescending(s,i)?s:this.parseSubscripts(s,r)}parseSubscripts(e,r,i){let s={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do e=this.parseSubscript(e,r,i,s),s.maybeAsyncArrow=!1;while(!s.stop);return e}parseSubscript(e,r,i,s){let{type:a}=this.state;if(!i&&a===15)return this.parseBind(e,r,i,s);if(ci(a))return this.parseTaggedTemplateExpression(e,r,s);let n=!1;if(a===18){if(i&&(this.raise(x.OptionalChainingNoNew,{at:this.state.startLoc}),this.lookaheadCharCode()===40))return s.stop=!0,e;s.optionalChainMember=n=!0,this.next();}if(!i&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(e,r,s,n);{let o=this.eat(0);return o||n||this.eat(16)?this.parseMember(e,r,s,o,n):(s.stop=!0,e)}}parseMember(e,r,i,s,a){let n=this.startNodeAt(r);return n.object=e,n.computed=s,s?(n.property=this.parseExpression(),this.expect(3)):this.match(138)?(e.type==="Super"&&this.raise(x.SuperPrivateField,{at:r}),this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),i.optionalChainMember?(n.optional=a,this.finishNode(n,"OptionalMemberExpression")):this.finishNode(n,"MemberExpression")}parseBind(e,r,i,s){let a=this.startNodeAt(r);return a.object=e,this.next(),a.callee=this.parseNoCallExpr(),s.stop=!0,this.parseSubscripts(this.finishNode(a,"BindExpression"),r,i)}parseCoverCallAndAsyncArrowHead(e,r,i,s){let a=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(r);o.callee=e;let{maybeAsyncArrow:l,optionalChainMember:u}=i;l&&(this.expressionScope.enter(CD()),n=new Ot),u&&(o.optional=s),s?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,e.type==="Import",e.type!=="Super",o,n);let p=this.finishCallExpression(o,u);return l&&this.shouldParseAsyncArrow()&&!s?(i.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),p=this.parseAsyncArrowFromCallExpression(this.startNodeAt(r),p)):(l&&(this.checkExpressionErrors(n,!0),this.expressionScope.exit()),this.toReferencedArguments(p)),this.state.maybeInArrowParameters=a,p}toReferencedArguments(e,r){this.toReferencedListDeep(e.arguments,r);}parseTaggedTemplateExpression(e,r,i){let s=this.startNodeAt(r);return s.tag=e,s.quasi=this.parseTemplate(!0),i.optionalChainMember&&this.raise(x.OptionalChainingNoTemplate,{at:r}),this.finishNode(s,"TaggedTemplateExpression")}atPossibleAsyncArrow(e){return e.type==="Identifier"&&e.name==="async"&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&e.start===this.state.potentialArrowAt}expectImportAttributesPlugin(){this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes");}finishCallExpression(e,r){if(e.callee.type==="Import")if(e.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.expectImportAttributesPlugin()),e.arguments.length===0||e.arguments.length>2)this.raise(x.ImportCallArity,{at:e,maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let i of e.arguments)i.type==="SpreadElement"&&this.raise(x.ImportCallSpreadArgument,{at:i});return this.finishNode(e,r?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(e,r,i,s,a){let n=[],o=!0,l=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(e);){if(o)o=!1;else if(this.expect(12),this.match(e)){r&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(x.ImportCallArgumentTrailingComma,{at:this.state.lastTokStartLoc}),s&&this.addTrailingCommaExtraToNode(s),this.next();break}n.push(this.parseExprListItem(!1,a,i));}return this.state.inFSharpPipelineDirectBody=l,n}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,r){var i;return this.resetPreviousNodeTrailingComments(r),this.expect(19),this.parseArrowExpression(e,r.arguments,!0,(i=r.extra)==null?void 0:i.trailingCommaLoc),r.innerComments&&mr(e,r.innerComments),r.callee.trailingComments&&mr(e,r.callee.trailingComments),e}parseNoCallExpr(){let e=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,!0)}parseExprAtom(e){let r,i=null,{type:s}=this.state;switch(s){case 79:return this.parseSuper();case 83:return r=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(r):this.match(10)?this.options.createImportExpressions?this.parseImportCall(r):this.finishNode(r,"Import"):(this.raise(x.UnsupportedImport,{at:this.state.lastTokStartLoc}),this.finishNode(r,"Import"));case 78:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 134:return this.parseNumericLiteral(this.state.value);case 135:return this.parseBigIntLiteral(this.state.value);case 136:return this.parseDecimalLiteral(this.state.value);case 133:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let a=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(a)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,e);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,e);case 68:return this.parseFunctionOrFunctionSent();case 26:i=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(i,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{r=this.startNode(),this.next(),r.object=null;let a=r.callee=this.parseNoCallExpr();if(a.type==="MemberExpression")return this.finishNode(r,"BindExpression");throw this.raise(x.UnsupportedBind,{at:a})}case 138:return this.raise(x.PrivateInExpectedIn,{at:this.state.startLoc,identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let a=this.getPluginOption("pipelineOperator","proposal");if(a)return this.parseTopicReference(a);this.unexpected();break}case 47:{let a=this.input.codePointAt(this.nextTokenStart());Je(a)||a===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(te(s)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let a=this.state.potentialArrowAt===this.state.start,n=this.state.containsEsc,o=this.parseIdentifier();if(!n&&o.name==="async"&&!this.canInsertSemicolon()){let{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(te(l))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(l===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return a&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected();}}parseTopicReferenceThenEqualsSign(e,r){let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.state.type=e,this.state.value=r,this.state.pos--,this.state.end--,this.state.endLoc=xe(this.state.endLoc,-1),this.parseTopicReference(i);this.unexpected();}parseTopicReference(e){let r=this.startNode(),i=this.state.startLoc,s=this.state.type;return this.next(),this.finishTopicReference(r,i,e,s)}finishTopicReference(e,r,i,s){if(this.testTopicReferenceConfiguration(i,r,s)){let a=i==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(i==="smart"?x.PrimaryTopicNotAllowed:x.PipeTopicUnbound,{at:r}),this.registerTopicReference(),this.finishNode(e,a)}else throw this.raise(x.PipeTopicUnconfiguredToken,{at:r,token:at(s)})}testTopicReferenceConfiguration(e,r,i){switch(e){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:at(i)}]);case"smart":return i===27;default:throw this.raise(x.PipeTopicRequiresHackPipes,{at:r})}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(oi(!0,this.prodParam.hasYield));let r=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(x.LineTerminatorBeforeArrow,{at:this.state.curPosition()}),this.expect(19),this.parseArrowExpression(e,r,!0)}parseDo(e,r){this.expectPlugin("doExpressions"),r&&this.expectPlugin("asyncDoExpressions"),e.async=r,this.next();let i=this.state.labels;return this.state.labels=[],r?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=i,this.finishNode(e,"DoExpression")}parseSuper(){let e=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(x.SuperNotAllowed,{at:e}):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(x.UnexpectedSuper,{at:e}),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(x.UnsupportedSuper,{at:e}),this.finishNode(e,"Super")}parsePrivateName(){let e=this.startNode(),r=this.startNodeAt(xe(this.state.startLoc,1)),i=this.state.value;return this.next(),e.id=this.createIdentifier(r,i),this.finishNode(e,"PrivateName")}parseFunctionOrFunctionSent(){let e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let r=this.createIdentifier(this.startNodeAtNode(e),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(e,r,"sent")}return this.parseFunction(e)}parseMetaProperty(e,r,i){e.meta=r;let s=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==i||s)&&this.raise(x.UnsupportedMetaProperty,{at:e.property,target:r.name,onlyValidPropertyName:i}),this.finishNode(e,"MetaProperty")}parseImportMetaProperty(e){let r=this.createIdentifier(this.startNodeAtNode(e),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(x.ImportMetaOutsideModule,{at:r}),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let i=this.isContextual(105);if(i||this.unexpected(),this.expectPlugin(i?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(x.DynamicImportPhaseRequiresImportExpressions,{at:this.state.startLoc,phase:this.state.value});return this.next(),e.phase=i?"source":"defer",this.parseImportCall(e)}return this.parseMetaProperty(e,r,"meta")}parseLiteralAtNode(e,r,i){return this.addExtra(i,"rawValue",e),this.addExtra(i,"raw",this.input.slice(i.start,this.state.end)),i.value=e,this.next(),this.finishNode(i,r)}parseLiteral(e,r){let i=this.startNode();return this.parseLiteralAtNode(e,r,i)}parseStringLiteral(e){return this.parseLiteral(e,"StringLiteral")}parseNumericLiteral(e){return this.parseLiteral(e,"NumericLiteral")}parseBigIntLiteral(e){return this.parseLiteral(e,"BigIntLiteral")}parseDecimalLiteral(e){return this.parseLiteral(e,"DecimalLiteral")}parseRegExpLiteral(e){let r=this.parseLiteral(e.value,"RegExpLiteral");return r.pattern=e.pattern,r.flags=e.flags,r}parseBooleanLiteral(e){let r=this.startNode();return r.value=e,this.next(),this.finishNode(r,"BooleanLiteral")}parseNullLiteral(){let e=this.startNode();return this.next(),this.finishNode(e,"NullLiteral")}parseParenAndDistinguishExpression(e){let r=this.state.startLoc,i;this.next(),this.expressionScope.enter(ND());let s=this.state.maybeInArrowParameters,a=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n=this.state.startLoc,o=[],l=new Ot,u=!0,p,S;for(;!this.match(11);){if(u)u=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){S=this.state.startLoc;break}if(this.match(21)){let I=this.state.startLoc;if(p=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),I)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem));}let E=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=s,this.state.inFSharpPipelineDirectBody=a;let v=this.startNodeAt(r);return e&&this.shouldParseArrow(o)&&(v=this.parseArrow(v))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(v,o,!1),v):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),S&&this.unexpected(S),p&&this.unexpected(p),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(i=this.startNodeAt(n),i.expressions=o,this.finishNode(i,"SequenceExpression"),this.resetEndLocation(i,E)):i=o[0],this.wrapParenthesis(r,i))}wrapParenthesis(e,r){if(!this.options.createParenthesizedExpressions)return this.addExtra(r,"parenthesized",!0),this.addExtra(r,"parenStart",e.index),this.takeSurroundingComments(r,e.index,this.state.lastTokEndLoc.index),r;let i=this.startNodeAt(e);return i.expression=r,this.finishNode(i,"ParenthesizedExpression")}shouldParseArrow(e){return !this.canInsertSemicolon()}parseArrow(e){if(this.eat(19))return e}parseParenItem(e,r){return e}parseNewOrNewTarget(){let e=this.startNode();if(this.next(),this.match(16)){let r=this.createIdentifier(this.startNodeAtNode(e),"new");this.next();let i=this.parseMetaProperty(e,r,"target");return !this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(x.UnexpectedNewTarget,{at:i}),i}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(10)){let r=this.parseExprList(11);this.toReferencedList(r),e.arguments=r;}else e.arguments=[];return this.finishNode(e,"NewExpression")}parseNewCallee(e){let r=this.match(83),i=this.parseNoCallExpr();e.callee=i,r&&(i.type==="Import"||i.type==="ImportExpression")&&this.raise(x.ImportCallNotNewExpression,{at:i});}parseTemplateElement(e){let{start:r,startLoc:i,end:s,value:a}=this.state,n=r+1,o=this.startNodeAt(xe(i,1));a===null&&(e||this.raise(x.InvalidEscapeSequenceTemplate,{at:xe(this.state.firstInvalidTemplateEscapePos,1)}));let l=this.match(24),u=l?-1:-2,p=s+u;o.value={raw:this.input.slice(n,p).replace(/\r\n?/g,`
+`),cooked:a===null?null:a.slice(1,u)},o.tail=l,this.next();let S=this.finishNode(o,"TemplateElement");return this.resetEndLocation(S,xe(this.state.lastTokEndLoc,u)),S}parseTemplate(e){let r=this.startNode();r.expressions=[];let i=this.parseTemplateElement(e);for(r.quasis=[i];!i.tail;)r.expressions.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.quasis.push(i=this.parseTemplateElement(e));return this.finishNode(r,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,r,i,s){i&&this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=Object.create(null),o=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(e);){if(o)o=!1;else if(this.expect(12),this.match(e)){this.addTrailingCommaExtraToNode(l);break}let p;r?p=this.parseBindingProperty():(p=this.parsePropertyDefinition(s),this.checkProto(p,i,n,s)),i&&!this.isObjectProperty(p)&&p.type!=="SpreadElement"&&this.raise(x.InvalidRecordProperty,{at:p}),p.shorthand&&this.addExtra(p,"shorthand",!0),l.properties.push(p);}this.next(),this.state.inFSharpPipelineDirectBody=a;let u="ObjectExpression";return r?u="ObjectPattern":i&&(u="RecordExpression"),this.finishNode(l,u)}addTrailingCommaExtraToNode(e){this.addExtra(e,"trailingComma",this.state.lastTokStart),this.addExtra(e,"trailingCommaLoc",this.state.lastTokStartLoc,!1);}maybeAsyncOrAccessorProp(e){return !e.computed&&e.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(e){let r=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(x.UnsupportedPropertyDecorator,{at:this.state.startLoc});this.match(26);)r.push(this.parseDecorator());let i=this.startNode(),s=!1,a=!1,n;if(this.match(21))return r.length&&this.unexpected(),this.parseSpread();r.length&&(i.decorators=r,r=[]),i.method=!1,e&&(n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(i);let l=this.state.containsEsc,u=this.parsePropertyName(i,e);if(!o&&!l&&this.maybeAsyncOrAccessorProp(i)){let p=u.name;p==="async"&&!this.hasPrecedingLineBreak()&&(s=!0,this.resetPreviousNodeTrailingComments(u),o=this.eat(55),this.parsePropertyName(i)),(p==="get"||p==="set")&&(a=!0,this.resetPreviousNodeTrailingComments(u),i.kind=p,this.match(55)&&(o=!0,this.raise(x.AccessorIsGenerator,{at:this.state.curPosition(),kind:p}),this.next()),this.parsePropertyName(i));}return this.parseObjPropValue(i,n,o,s,!1,a,e)}getGetterSetterExpectedParamCount(e){return e.kind==="get"?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){var r;let i=this.getGetterSetterExpectedParamCount(e),s=this.getObjectOrClassMethodParams(e);s.length!==i&&this.raise(e.kind==="get"?x.BadGetterArity:x.BadSetterArity,{at:e}),e.kind==="set"&&((r=s[s.length-1])==null?void 0:r.type)==="RestElement"&&this.raise(x.BadSetterRestParameter,{at:e});}parseObjectMethod(e,r,i,s,a){if(a){let n=this.parseMethod(e,r,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(i||r||this.match(10))return s&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,r,i,!1,!1,"ObjectMethod")}parseObjectProperty(e,r,i,s){if(e.shorthand=!1,this.eat(14))return e.value=i?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(s),this.finishNode(e,"ObjectProperty");if(!e.computed&&e.key.type==="Identifier"){if(this.checkReservedWord(e.key.name,e.key.loc.start,!0,!1),i)e.value=this.parseMaybeDefault(r,We(e.key));else if(this.match(29)){let a=this.state.startLoc;s!=null?s.shorthandAssignLoc===null&&(s.shorthandAssignLoc=a):this.raise(x.InvalidCoverInitializedName,{at:a}),e.value=this.parseMaybeDefault(r,We(e.key));}else e.value=We(e.key);return e.shorthand=!0,this.finishNode(e,"ObjectProperty")}}parseObjPropValue(e,r,i,s,a,n,o){let l=this.parseObjectMethod(e,i,s,a,n)||this.parseObjectProperty(e,r,a,o);return l||this.unexpected(),l}parsePropertyName(e,r){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(3);else {let{type:i,value:s}=this.state,a;if(_e(i))a=this.parseIdentifier(!0);else switch(i){case 134:a=this.parseNumericLiteral(s);break;case 133:a=this.parseStringLiteral(s);break;case 135:a=this.parseBigIntLiteral(s);break;case 136:a=this.parseDecimalLiteral(s);break;case 138:{let n=this.state.startLoc;r!=null?r.privateKeyLoc===null&&(r.privateKeyLoc=n):this.raise(x.UnexpectedPrivateField,{at:n}),a=this.parsePrivateName();break}default:this.unexpected();}e.key=a,i!==138&&(e.computed=!1);}return e.key}initFunction(e,r){e.id=null,e.generator=!1,e.async=r;}parseMethod(e,r,i,s,a,n,o=!1){this.initFunction(e,i),e.generator=r,this.scope.enter(18|(o?64:0)|(a?32:0)),this.prodParam.enter(oi(i,e.generator)),this.parseFunctionParams(e,s);let l=this.parseFunctionBodyAndFinish(e,n,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(e,r,i,s){i&&this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=this.startNode();return this.next(),n.elements=this.parseExprList(e,!i,s,n),this.state.inFSharpPipelineDirectBody=a,this.finishNode(n,i?"TupleExpression":"ArrayExpression")}parseArrowExpression(e,r,i,s){this.scope.enter(6);let a=oi(i,!1);!this.match(5)&&this.prodParam.hasIn&&(a|=8),this.prodParam.enter(a),this.initFunction(e,i);let n=this.state.maybeInArrowParameters;return r&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(e,r,s)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,this.finishNode(e,"ArrowFunctionExpression")}setArrowFunctionParameters(e,r,i){this.toAssignableList(r,i,!1),e.params=r;}parseFunctionBodyAndFinish(e,r,i=!1){return this.parseFunctionBody(e,!1,i),this.finishNode(e,r)}parseFunctionBody(e,r,i=!1){let s=r&&!this.match(5);if(this.expressionScope.enter(lc()),s)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,r,!1);else {let a=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),e.body=this.parseBlock(!0,!1,o=>{let l=!this.isSimpleParamList(e.params);o&&l&&this.raise(x.IllegalLanguageModeDirective,{at:(e.kind==="method"||e.kind==="constructor")&&e.key?e.key.loc.end:e});let u=!a&&this.state.strict;this.checkParams(e,!this.state.strict&&!r&&!i&&!l,r,u),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,u);}),this.prodParam.exit(),this.state.labels=n;}this.expressionScope.exit();}isSimpleParameter(e){return e.type==="Identifier"}isSimpleParamList(e){for(let r=0,i=e.length;r10||!SD(e))return;if(i&&mD(e)){this.raise(x.UnexpectedKeyword,{at:r,keyword:e});return}if((this.state.strict?s?ic:tc:ec)(e,this.inModule)){this.raise(x.UnexpectedReservedWord,{at:r,reservedWord:e});return}else if(e==="yield"){if(this.prodParam.hasYield){this.raise(x.YieldBindingIdentifier,{at:r});return}}else if(e==="await"){if(this.prodParam.hasAwait){this.raise(x.AwaitBindingIdentifier,{at:r});return}if(this.scope.inStaticBlock){this.raise(x.AwaitBindingIdentifierInStaticBlock,{at:r});return}this.expressionScope.recordAsyncArrowParametersError({at:r});}else if(e==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(x.ArgumentsInClass,{at:r});return}}isAwaitAllowed(){return !!(this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction)}parseAwait(e){let r=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(x.AwaitExpressionFormalParameter,{at:r}),this.eat(55)&&this.raise(x.ObsoleteAwaitStar,{at:r}),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(r.argument=this.parseMaybeUnary(null,!0)),this.finishNode(r,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return !0;let{type:e}=this.state;return e===53||e===10||e===0||ci(e)||e===102&&!this.state.containsEsc||e===137||e===56||this.hasPlugin("v8intrinsic")&&e===54}parseYield(){let e=this.startNode();this.expressionScope.recordParameterInitializerError(x.YieldInParameter,{at:e}),this.next();let r=!1,i=null;if(!this.hasPrecedingLineBreak())switch(r=this.eat(55),this.state.type){case 13:case 139:case 8:case 11:case 3:case 9:case 14:case 12:if(!r)break;default:i=this.parseMaybeAssign();}return e.delegate=r,e.argument=i,this.finishNode(e,"YieldExpression")}parseImportCall(e){return this.next(),e.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(e.options=null),this.eat(12)&&(this.expectImportAttributesPlugin(),this.match(11)||(e.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(e,"ImportExpression")}checkPipelineAtInfixOperator(e,r){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&e.type==="SequenceExpression"&&this.raise(x.PipelineHeadSequenceExpression,{at:r});}parseSmartPipelineBodyInStyle(e,r){if(this.isSimpleReference(e)){let i=this.startNodeAt(r);return i.callee=e,this.finishNode(i,"PipelineBareFunction")}else {let i=this.startNodeAt(r);return this.checkSmartPipeTopicBodyEarlyErrors(r),i.expression=e,this.finishNode(i,"PipelineTopicExpression")}}isSimpleReference(e){switch(e.type){case"MemberExpression":return !e.computed&&this.isSimpleReference(e.object);case"Identifier":return !0;default:return !1}}checkSmartPipeTopicBodyEarlyErrors(e){if(this.match(19))throw this.raise(x.PipelineBodyNoArrow,{at:this.state.startLoc});this.topicReferenceWasUsedInCurrentContext()||this.raise(x.PipelineTopicUnused,{at:e});}withTopicBindingContext(e){let r=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=r;}}withSmartMixTopicForbiddingContext(e){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let r=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return e()}finally{this.state.topicContext=r;}}else return e()}withSoloAwaitPermittingContext(e){let r=this.state.soloAwait;this.state.soloAwait=!0;try{return e()}finally{this.state.soloAwait=r;}}allowInAnd(e){let r=this.prodParam.currentFlags();if(8&~r){this.prodParam.enter(r|8);try{return e()}finally{this.prodParam.exit();}}return e()}disallowInAnd(e){let r=this.prodParam.currentFlags();if(8&r){this.prodParam.enter(r&-9);try{return e()}finally{this.prodParam.exit();}}return e()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0;}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(e){let r=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let s=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),r,e);return this.state.inFSharpPipelineDirectBody=i,s}parseModuleExpression(){this.expectPlugin("moduleBlocks");let e=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let r=this.startNodeAt(this.state.endLoc);this.next();let i=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(r,8,"module");}finally{i();}return this.finishNode(e,"ModuleExpression")}parsePropertyNamePrefixOperator(e){}},Ha={kind:"loop"},tL={kind:"switch"},rL=/[\uD800-\uDFFF]/u,Ga=/in(?:stanceof)?/y;function iL(t,e){for(let r=0;r0)for(let[a,n]of Array.from(this.scope.undefinedExports))this.raise(x.ModuleExportUndefined,{at:n,localName:a});let s;return r===139?s=this.finishNode(e,"Program"):s=this.finishNodeAt(e,"Program",xe(this.state.startLoc,-1)),s}stmtToDirective(e){let r=e;r.type="Directive",r.value=r.expression,delete r.expression;let i=r.value,s=i.value,a=this.input.slice(i.start,i.end),n=i.value=a.slice(1,-1);return this.addExtra(i,"raw",a),this.addExtra(i,"rawValue",n),this.addExtra(i,"expressionValue",s),i.type="DirectiveLiteral",r}parseInterpreterDirective(){if(!this.match(28))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(e,r){if(Je(e)){if(Ga.lastIndex=r,Ga.test(this.input)){let i=this.codePointAtPos(Ga.lastIndex);if(!wt(i)&&i!==92)return !1}return !0}else return e===92}chStartsBindingPattern(e){return e===91||e===123}hasFollowingBindingAtom(){let e=this.nextTokenStart(),r=this.codePointAtPos(e);return this.chStartsBindingPattern(r)||this.chStartsBindingIdentifier(r,e)}hasInLineFollowingBindingIdentifier(){let e=this.nextTokenInLineStart(),r=this.codePointAtPos(e);return this.chStartsBindingIdentifier(r,e)}startsUsingForOf(){let{type:e,containsEsc:r}=this.lookahead();if(e===102&&!r)return !1;if(te(e)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,"using")){e=this.nextTokenInLineStartSince(e+5);let r=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(r,e))return this.expectPlugin("explicitResourceManagement"),!0}return !1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let r=0;return this.options.annexB&&!this.state.strict&&(r|=4,e&&(r|=8)),this.parseStatementLike(r)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let r=null;return this.match(26)&&(r=this.parseDecorators(!0)),this.parseStatementContent(e,r)}parseStatementContent(e,r){let i=this.state.type,s=this.startNode(),a=!!(e&2),n=!!(e&4),o=e&1;switch(i){case 60:return this.parseBreakContinueStatement(s,!0);case 63:return this.parseBreakContinueStatement(s,!1);case 64:return this.parseDebuggerStatement(s);case 90:return this.parseDoWhileStatement(s);case 91:return this.parseForStatement(s);case 68:if(this.lookaheadCharCode()===46)break;return n||this.raise(this.state.strict?x.StrictFunction:this.options.annexB?x.SloppyFunctionAnnexB:x.SloppyFunction,{at:this.state.startLoc}),this.parseFunctionStatement(s,!1,!a&&n);case 80:return a||this.unexpected(),this.parseClass(this.maybeTakeDecorators(r,s),!0);case 69:return this.parseIfStatement(s);case 70:return this.parseReturnStatement(s);case 71:return this.parseSwitchStatement(s);case 72:return this.parseThrowStatement(s);case 73:return this.parseTryStatement(s);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.isAwaitAllowed()?a||this.raise(x.UnexpectedLexicalDeclaration,{at:s}):this.raise(x.AwaitUsingNotInAsyncContext,{at:s}),this.next(),this.parseVarStatement(s,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifier())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(x.UnexpectedUsingDeclaration,{at:this.state.startLoc}):a||this.raise(x.UnexpectedLexicalDeclaration,{at:this.state.startLoc}),this.parseVarStatement(s,"using");case 100:{if(this.state.containsEsc)break;let p=this.nextTokenStart(),S=this.codePointAtPos(p);if(S!==91&&(!a&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(S,p)&&S!==123))break}case 75:a||this.raise(x.UnexpectedLexicalDeclaration,{at:this.state.startLoc});case 74:{let p=this.state.value;return this.parseVarStatement(s,p)}case 92:return this.parseWhileStatement(s);case 76:return this.parseWithStatement(s);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(s);case 83:{let p=this.lookaheadCharCode();if(p===40||p===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(x.UnexpectedImportExport,{at:this.state.startLoc}),this.next();let p;return i===83?(p=this.parseImport(s),p.type==="ImportDeclaration"&&(!p.importKind||p.importKind==="value")&&(this.sawUnambiguousESM=!0)):(p=this.parseExport(s,r),(p.type==="ExportNamedDeclaration"&&(!p.exportKind||p.exportKind==="value")||p.type==="ExportAllDeclaration"&&(!p.exportKind||p.exportKind==="value")||p.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(p),p}default:if(this.isAsyncFunction())return a||this.raise(x.AsyncFunctionInSingleStatementContext,{at:this.state.startLoc}),this.next(),this.parseFunctionStatement(s,!0,!a&&n)}let l=this.state.value,u=this.parseExpression();return te(i)&&u.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(s,l,u,e):this.parseExpressionStatement(s,u,r)}assertModuleNodeAllowed(e){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(x.ImportOutsideModule,{at:e});}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(e,r,i){return e&&(r.decorators&&r.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(x.DecoratorsBeforeAfterExport,{at:r.decorators[0]}),r.decorators.unshift(...e)):r.decorators=e,this.resetStartLocationFromNode(r,e[0]),i&&this.resetStartLocationFromNode(i,r)),r}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(e){let r=[];do r.push(this.parseDecorator());while(this.match(26));if(this.match(82))e||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(x.DecoratorExportClass,{at:this.state.startLoc});else if(!this.canHaveLeadingDecorator())throw this.raise(x.UnexpectedLeadingDecorator,{at:this.state.startLoc});return r}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let e=this.startNode();if(this.next(),this.hasPlugin("decorators")){let r=this.state.startLoc,i;if(this.match(10)){let s=this.state.startLoc;this.next(),i=this.parseExpression(),this.expect(11),i=this.wrapParenthesis(s,i);let a=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&e.expression!==i&&this.raise(x.DecoratorArgumentsOutsideParentheses,{at:a});}else {for(i=this.parseIdentifier(!1);this.eat(16);){let s=this.startNodeAt(r);s.object=i,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),s.property=this.parsePrivateName()):s.property=this.parseIdentifier(!0),s.computed=!1,i=this.finishNode(s,"MemberExpression");}e.expression=this.parseMaybeDecoratorArguments(i);}}else e.expression=this.parseExprSubscripts();return this.finishNode(e,"Decorator")}parseMaybeDecoratorArguments(e){if(this.eat(10)){let r=this.startNodeAtNode(e);return r.callee=e,r.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(r.arguments),this.finishNode(r,"CallExpression")}return e}parseBreakContinueStatement(e,r){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,r),this.finishNode(e,r?"BreakStatement":"ContinueStatement")}verifyBreakContinue(e,r){let i;for(i=0;ithis.parseStatement()),this.state.labels.pop(),this.expect(92),e.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(e,"DoWhileStatement")}parseForStatement(e){this.next(),this.state.labels.push(Ha);let r=null;if(this.isAwaitAllowed()&&this.eatContextual(96)&&(r=this.state.lastTokStartLoc),this.scope.enter(0),this.expect(10),this.match(13))return r!==null&&this.unexpected(r),this.parseFor(e,null);let i=this.isContextual(100);{let l=this.isContextual(96)&&this.startsAwaitUsing(),u=l||this.isContextual(107)&&this.startsUsingForOf(),p=i&&this.hasFollowingBindingAtom()||u;if(this.match(74)||this.match(75)||p){let S=this.startNode(),E;l?(E="await using",this.isAwaitAllowed()||this.raise(x.AwaitUsingNotInAsyncContext,{at:this.state.startLoc}),this.next()):E=this.state.value,this.next(),this.parseVar(S,!0,E);let v=this.finishNode(S,"VariableDeclaration"),I=this.match(58);return I&&u&&this.raise(x.ForInUsing,{at:v}),(I||this.isContextual(102))&&v.declarations.length===1?this.parseForIn(e,v,r):(r!==null&&this.unexpected(r),this.parseFor(e,v))}}let s=this.isContextual(95),a=new Ot,n=this.parseExpression(!0,a),o=this.isContextual(102);if(o&&(i&&this.raise(x.ForOfLet,{at:n}),r===null&&s&&n.type==="Identifier"&&this.raise(x.ForOfAsync,{at:n})),o||this.match(58)){this.checkDestructuringPrivate(a),this.toAssignable(n,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{in:{type:l}}),this.parseForIn(e,n,r)}else this.checkExpressionErrors(a,!0);return r!==null&&this.unexpected(r),this.parseFor(e,n)}parseFunctionStatement(e,r,i){return this.next(),this.parseFunction(e,1|(i?2:0)|(r?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,"IfStatement")}parseReturnStatement(e){return !this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(x.IllegalReturn,{at:this.state.startLoc}),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let r=e.cases=[];this.expect(5),this.state.labels.push(tL),this.scope.enter(0);let i;for(let s;!this.match(8);)if(this.match(61)||this.match(65)){let a=this.match(61);i&&this.finishNode(i,"SwitchCase"),r.push(i=this.startNode()),i.consequent=[],this.next(),a?i.test=this.parseExpression():(s&&this.raise(x.MultipleDefaultsInSwitch,{at:this.state.lastTokStartLoc}),s=!0,i.test=null),this.expect(14);}else i?i.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),i&&this.finishNode(i,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(e,"SwitchStatement")}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(x.NewlineAfterThrow,{at:this.state.lastTokEndLoc}),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&e.type==="Identifier"?8:0),this.checkLVal(e,{in:{type:"CatchClause"},binding:9}),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(62)){let r=this.startNode();this.next(),this.match(10)?(this.expect(10),r.param=this.parseCatchClauseParam(),this.expect(11)):(r.param=null,this.scope.enter(0)),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),e.handler=this.finishNode(r,"CatchClause");}return e.finalizer=this.eat(67)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(x.NoCatchOrFinally,{at:e}),this.finishNode(e,"TryStatement")}parseVarStatement(e,r,i=!1){return this.next(),this.parseVar(e,!1,r,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(Ha),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(e,"WhileStatement")}parseWithStatement(e){return this.state.strict&&this.raise(x.StrictWith,{at:this.state.startLoc}),this.next(),e.object=this.parseHeaderExpression(),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(e,"WithStatement")}parseEmptyStatement(e){return this.next(),this.finishNode(e,"EmptyStatement")}parseLabeledStatement(e,r,i,s){for(let n of this.state.labels)n.name===r&&this.raise(x.LabelRedeclaration,{at:i,labelName:r});let a=iD(this.state.type)?"loop":this.match(71)?"switch":null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===e.start)o.statementStart=this.state.start,o.kind=a;else break}return this.state.labels.push({name:r,kind:a,statementStart:this.state.start}),e.body=s&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")}parseExpressionStatement(e,r,i){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")}parseBlock(e=!1,r=!0,i){let s=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(5),r&&this.scope.enter(0),this.parseBlockBody(s,e,!1,8,i),r&&this.scope.exit(),this.finishNode(s,"BlockStatement")}isValidDirective(e){return e.type==="ExpressionStatement"&&e.expression.type==="StringLiteral"&&!e.expression.extra.parenthesized}parseBlockBody(e,r,i,s,a){let n=e.body=[],o=e.directives=[];this.parseBlockOrModuleBlockBody(n,r?o:void 0,i,s,a);}parseBlockOrModuleBlockBody(e,r,i,s,a){let n=this.state.strict,o=!1,l=!1;for(;!this.match(s);){let u=i?this.parseModuleItem():this.parseStatementListItem();if(r&&!l){if(this.isValidDirective(u)){let p=this.stmtToDirective(u);r.push(p),!o&&p.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear();}e.push(u);}a?.call(this,o),n||this.setStrict(!1),this.next();}parseFor(e,r){return e.init=r,this.semicolon(!1),e.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(11)?null:this.parseExpression(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,"ForStatement")}parseForIn(e,r,i){let s=this.match(58);return this.next(),s?i!==null&&this.unexpected(i):e.await=i!==null,r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!s||!this.options.annexB||this.state.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(x.ForInOfLoopInitializer,{at:r,type:s?"ForInStatement":"ForOfStatement"}),r.type==="AssignmentPattern"&&this.raise(x.InvalidLhs,{at:r,ancestor:{type:"ForStatement"}}),e.left=r,e.right=s?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")}parseVar(e,r,i,s=!1){let a=e.declarations=[];for(e.kind=i;;){let n=this.startNode();if(this.parseVarId(n,i),n.init=this.eat(29)?r?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,n.init===null&&!s&&(n.id.type!=="Identifier"&&!(r&&(this.match(58)||this.isContextual(102)))?this.raise(x.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"destructuring"}):i==="const"&&!(this.match(58)||this.isContextual(102))&&this.raise(x.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"const"})),a.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return e}parseVarId(e,r){let i=this.parseBindingAtom();this.checkLVal(i,{in:{type:"VariableDeclarator"},binding:r==="var"?5:8201}),e.id=i;}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,r=0){let i=r&2,s=!!(r&1),a=s&&!(r&4),n=!!(r&8);this.initFunction(e,n),this.match(55)&&(i&&this.raise(x.GeneratorInSingleStatementContext,{at:this.state.startLoc}),this.next(),e.generator=!0),s&&(e.id=this.parseFunctionId(a));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(oi(n,e.generator)),s||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(e,s?"FunctionDeclaration":"FunctionExpression");}),this.prodParam.exit(),this.scope.exit(),s&&!i&&this.registerFunctionStatementId(e),this.state.maybeInArrowParameters=o,e}parseFunctionId(e){return e||te(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,r){this.expect(10),this.expressionScope.enter(OD()),e.params=this.parseBindingList(11,41,2|(r?4:0)),this.expressionScope.exit();}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.loc.start);}parseClass(e,r,i){this.next();let s=this.state.strict;return this.state.strict=!0,this.parseClassId(e,r,i),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,s),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}isNonstaticConstructor(e){return !e.computed&&!e.static&&(e.key.name==="constructor"||e.key.value==="constructor")}parseClassBody(e,r){this.classScope.enter();let i={hadConstructor:!1,hadSuperClass:e},s=[],a=this.startNode();if(a.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(s.length>0)throw this.raise(x.DecoratorSemicolon,{at:this.state.lastTokEndLoc});continue}if(this.match(26)){s.push(this.parseDecorator());continue}let n=this.startNode();s.length&&(n.decorators=s,this.resetStartLocationFromNode(n,s[0]),s=[]),this.parseClassMember(a,n,i),n.kind==="constructor"&&n.decorators&&n.decorators.length>0&&this.raise(x.DecoratorConstructor,{at:n});}}),this.state.strict=r,this.next(),s.length)throw this.raise(x.TrailingDecorator,{at:this.state.startLoc});return this.classScope.exit(),this.finishNode(a,"ClassBody")}parseClassMemberFromModifier(e,r){let i=this.parseIdentifier(!0);if(this.isClassMethod()){let s=r;return s.kind="method",s.computed=!1,s.key=i,s.static=!1,this.pushClassMethod(e,s,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let s=r;return s.computed=!1,s.key=i,s.static=!1,e.body.push(this.parseClassProperty(s)),!0}return this.resetPreviousNodeTrailingComments(i),!1}parseClassMember(e,r,i){let s=this.isContextual(106);if(s){if(this.parseClassMemberFromModifier(e,r))return;if(this.eat(5)){this.parseClassStaticBlock(e,r);return}}this.parseClassMemberWithIsStatic(e,r,i,s);}parseClassMemberWithIsStatic(e,r,i,s){let a=r,n=r,o=r,l=r,u=r,p=a,S=a;if(r.static=s,this.parsePropertyNamePrefixOperator(r),this.eat(55)){p.kind="method";let M=this.match(138);if(this.parseClassElementName(p),M){this.pushClassPrivateMethod(e,n,!0,!1);return}this.isNonstaticConstructor(a)&&this.raise(x.ConstructorIsGenerator,{at:a.key}),this.pushClassMethod(e,a,!0,!1,!1,!1);return}let E=te(this.state.type)&&!this.state.containsEsc,v=this.match(138),I=this.parseClassElementName(r),N=this.state.startLoc;if(this.parsePostMemberNameModifiers(S),this.isClassMethod()){if(p.kind="method",v){this.pushClassPrivateMethod(e,n,!1,!1);return}let M=this.isNonstaticConstructor(a),j=!1;M&&(a.kind="constructor",i.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(x.DuplicateConstructor,{at:I}),M&&this.hasPlugin("typescript")&&r.override&&this.raise(x.OverrideOnConstructor,{at:I}),i.hadConstructor=!0,j=i.hadSuperClass),this.pushClassMethod(e,a,!1,!1,M,j);}else if(this.isClassProperty())v?this.pushClassPrivateProperty(e,l):this.pushClassProperty(e,o);else if(E&&I.name==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(I);let M=this.eat(55);S.optional&&this.unexpected(N),p.kind="method";let j=this.match(138);this.parseClassElementName(p),this.parsePostMemberNameModifiers(S),j?this.pushClassPrivateMethod(e,n,M,!0):(this.isNonstaticConstructor(a)&&this.raise(x.ConstructorIsAsync,{at:a.key}),this.pushClassMethod(e,a,M,!0,!1,!1));}else if(E&&(I.name==="get"||I.name==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(I),p.kind=I.name;let M=this.match(138);this.parseClassElementName(a),M?this.pushClassPrivateMethod(e,n,!1,!1):(this.isNonstaticConstructor(a)&&this.raise(x.ConstructorIsAccessor,{at:a.key}),this.pushClassMethod(e,a,!1,!1,!1,!1)),this.checkGetterSetterParams(a);}else if(E&&I.name==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(I);let M=this.match(138);this.parseClassElementName(o),this.pushClassAccessorProperty(e,u,M);}else this.isLineTerminator()?v?this.pushClassPrivateProperty(e,l):this.pushClassProperty(e,o):this.unexpected();}parseClassElementName(e){let{type:r,value:i}=this.state;if((r===132||r===133)&&e.static&&i==="prototype"&&this.raise(x.StaticPrototype,{at:this.state.startLoc}),r===138){i==="constructor"&&this.raise(x.ConstructorClassPrivateField,{at:this.state.startLoc});let s=this.parsePrivateName();return e.key=s,s}return this.parsePropertyName(e)}parseClassStaticBlock(e,r){var i;this.scope.enter(208);let s=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let a=r.body=[];this.parseBlockOrModuleBlockBody(a,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=s,e.body.push(this.finishNode(r,"StaticBlock")),(i=r.decorators)!=null&&i.length&&this.raise(x.DecoratorStaticBlock,{at:r});}pushClassProperty(e,r){!r.computed&&(r.key.name==="constructor"||r.key.value==="constructor")&&this.raise(x.ConstructorClassField,{at:r.key}),e.body.push(this.parseClassProperty(r));}pushClassPrivateProperty(e,r){let i=this.parseClassPrivateProperty(r);e.body.push(i),this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start);}pushClassAccessorProperty(e,r,i){if(!i&&!r.computed){let a=r.key;(a.name==="constructor"||a.value==="constructor")&&this.raise(x.ConstructorClassField,{at:a});}let s=this.parseClassAccessorProperty(r);e.body.push(s),i&&this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start);}pushClassMethod(e,r,i,s,a,n){e.body.push(this.parseMethod(r,i,s,a,n,"ClassMethod",!0));}pushClassPrivateMethod(e,r,i,s){let a=this.parseMethod(r,i,s,!1,!1,"ClassPrivateMethod",!0);e.body.push(a);let n=a.kind==="get"?a.static?6:2:a.kind==="set"?a.static?5:1:0;this.declareClassPrivateMethodInScope(a,n);}declareClassPrivateMethodInScope(e,r){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),r,e.key.loc.start);}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassPrivateProperty")}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassProperty")}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,"ClassAccessorProperty")}parseInitializer(e){this.scope.enter(80),this.expressionScope.enter(lc()),this.prodParam.enter(0),e.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit();}parseClassId(e,r,i,s=8331){if(te(this.state.type))e.id=this.parseIdentifier(),r&&this.declareNameFromIdentifier(e.id,s);else if(i||!r)e.id=null;else throw this.raise(x.MissingClassName,{at:this.state.startLoc})}parseClassSuper(e){e.superClass=this.eat(81)?this.parseExprSubscripts():null;}parseExport(e,r){let i=this.parseMaybeImportPhase(e,!0),s=this.maybeParseExportDefaultSpecifier(e,i),a=!s||this.eat(12),n=a&&this.eatExportStar(e),o=n&&this.maybeParseExportNamespaceSpecifier(e),l=a&&(!o||this.eat(12)),u=s||n;if(n&&!o){if(s&&this.unexpected(),r)throw this.raise(x.UnsupportedDecoratorExport,{at:e});return this.parseExportFrom(e,!0),this.finishNode(e,"ExportAllDeclaration")}let p=this.maybeParseExportNamedSpecifiers(e);s&&a&&!n&&!p&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let S;if(u||p){if(S=!1,r)throw this.raise(x.UnsupportedDecoratorExport,{at:e});this.parseExportFrom(e,u);}else S=this.maybeParseExportDeclaration(e);if(u||p||S){var E;let v=e;if(this.checkExport(v,!0,!1,!!v.source),((E=v.declaration)==null?void 0:E.type)==="ClassDeclaration")this.maybeTakeDecorators(r,v.declaration,v);else if(r)throw this.raise(x.UnsupportedDecoratorExport,{at:e});return this.finishNode(v,"ExportNamedDeclaration")}if(this.eat(65)){let v=e,I=this.parseExportDefaultExpression();if(v.declaration=I,I.type==="ClassDeclaration")this.maybeTakeDecorators(r,I,v);else if(r)throw this.raise(x.UnsupportedDecoratorExport,{at:e});return this.checkExport(v,!0,!0),this.finishNode(v,"ExportDefaultDeclaration")}this.unexpected(null,5);}eatExportStar(e){return this.eat(55)}maybeParseExportDefaultSpecifier(e,r){if(r||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",r?.loc.start);let i=r||this.parseIdentifier(!0),s=this.startNodeAtNode(i);return s.exported=i,e.specifiers=[this.finishNode(s,"ExportDefaultSpecifier")],!0}return !1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(93)){e.specifiers||(e.specifiers=[]);let r=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),r.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(r,"ExportNamespaceSpecifier")),!0}return !1}maybeParseExportNamedSpecifiers(e){if(this.match(5)){e.specifiers||(e.specifiers=[]);let r=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(r)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return !1}maybeParseExportDeclaration(e){return this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),e.declaration=this.parseExportDeclaration(e),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return !1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,"function")}parseExportDefaultExpression(){let e=this.startNode();if(this.match(68))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(80))return this.parseClass(e,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(x.DecoratorBeforeExport,{at:this.state.startLoc}),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(x.UnsupportedDefaultExport,{at:this.state.startLoc});let r=this.parseMaybeAssignAllowIn();return this.semicolon(),r}parseExportDeclaration(e){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(te(e)){if(e===95&&!this.state.containsEsc||e===100)return !1;if((e===130||e===129)&&!this.state.containsEsc){let{type:s}=this.lookahead();if(te(s)&&s!==98||s===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return !1;let r=this.nextTokenStart(),i=this.isUnparsedContextual(r,"from");if(this.input.charCodeAt(r)===44||te(this.state.type)&&i)return !0;if(this.match(65)&&i){let s=this.input.charCodeAt(this.nextTokenStartSince(r+4));return s===34||s===39}return !1}parseExportFrom(e,r){this.eatContextual(98)?(e.source=this.parseImportSource(),this.checkExport(e),this.maybeParseImportAttributes(e),this.checkJSONModuleImport(e)):r&&this.unexpected(),this.semicolon();}shouldParseExportDeclaration(){let{type:e}=this.state;return e===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(x.DecoratorBeforeExport,{at:this.state.startLoc}),!0):e===74||e===75||e===68||e===80||this.isLet()||this.isAsyncFunction()}checkExport(e,r,i,s){if(r){var a;if(i){if(this.checkDuplicateExports(e,"default"),this.hasPlugin("exportDefaultFrom")){var n;let o=e.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((n=o.extra)!=null&&n.parenthesized)&&this.raise(x.ExportDefaultFromAsIdentifier,{at:o});}}else if((a=e.specifiers)!=null&&a.length)for(let o of e.specifiers){let{exported:l}=o,u=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,u),!s&&o.local){let{local:p}=o;p.type!=="Identifier"?this.raise(x.ExportBindingIsString,{at:o,localName:p.value,exportName:u}):(this.checkReservedWord(p.name,p.loc.start,!0,!1),this.scope.checkLocalExport(p));}}else if(e.declaration){if(e.declaration.type==="FunctionDeclaration"||e.declaration.type==="ClassDeclaration"){let o=e.declaration.id;if(!o)throw new Error("Assertion failure");this.checkDuplicateExports(e,o.name);}else if(e.declaration.type==="VariableDeclaration")for(let o of e.declaration.declarations)this.checkDeclaration(o.id);}}}checkDeclaration(e){if(e.type==="Identifier")this.checkDuplicateExports(e,e.name);else if(e.type==="ObjectPattern")for(let r of e.properties)this.checkDeclaration(r);else if(e.type==="ArrayPattern")for(let r of e.elements)r&&this.checkDeclaration(r);else e.type==="ObjectProperty"?this.checkDeclaration(e.value):e.type==="RestElement"?this.checkDeclaration(e.argument):e.type==="AssignmentPattern"&&this.checkDeclaration(e.left);}checkDuplicateExports(e,r){this.exportedIdentifiers.has(r)&&(r==="default"?this.raise(x.DuplicateDefaultExport,{at:e}):this.raise(x.DuplicateExport,{at:e,exportName:r})),this.exportedIdentifiers.add(r);}parseExportSpecifiers(e){let r=[],i=!0;for(this.expect(5);!this.eat(8);){if(i)i=!1;else if(this.expect(12),this.eat(8))break;let s=this.isContextual(130),a=this.match(133),n=this.startNode();n.local=this.parseModuleExportName(),r.push(this.parseExportSpecifier(n,a,e,s));}return r}parseExportSpecifier(e,r,i,s){return this.eatContextual(93)?e.exported=this.parseModuleExportName():r?e.exported=LD(e.local):e.exported||(e.exported=We(e.local)),this.finishNode(e,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){let e=this.parseStringLiteral(this.state.value),r=e.value.match(rL);return r&&this.raise(x.ModuleExportNameHasLoneSurrogate,{at:e,surrogateCharCode:r[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}isJSONModuleImport(e){return e.assertions!=null?e.assertions.some(({key:r,value:i})=>i.value==="json"&&(r.type==="Identifier"?r.name==="type":r.value==="type")):!1}checkImportReflection(e){let{specifiers:r}=e,i=r.length===1?r[0].type:null;if(e.phase==="source")i!=="ImportDefaultSpecifier"&&this.raise(x.SourcePhaseImportRequiresDefault,{at:r[0].loc.start});else if(e.phase==="defer")i!=="ImportNamespaceSpecifier"&&this.raise(x.DeferImportRequiresNamespace,{at:r[0].loc.start});else if(e.module){var s;i!=="ImportDefaultSpecifier"&&this.raise(x.ImportReflectionNotBinding,{at:r[0].loc.start}),((s=e.assertions)==null?void 0:s.length)>0&&this.raise(x.ImportReflectionHasAssertion,{at:e.specifiers[0].loc.start});}}checkJSONModuleImport(e){if(this.isJSONModuleImport(e)&&e.type!=="ExportAllDeclaration"){let{specifiers:r}=e;if(r!=null){let i=r.find(s=>{let a;if(s.type==="ExportSpecifier"?a=s.local:s.type==="ImportSpecifier"&&(a=s.imported),a!==void 0)return a.type==="Identifier"?a.name!=="default":a.value!=="default"});i!==void 0&&this.raise(x.ImportJSONBindingNotDefault,{at:i.loc.start});}}}isPotentialImportPhase(e){return e?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(e,r,i,s){r||(i==="module"?(this.expectPlugin("importReflection",s),e.module=!0):this.hasPlugin("importReflection")&&(e.module=!1),i==="source"?(this.expectPlugin("sourcePhaseImports",s),e.phase="source"):i==="defer"?(this.expectPlugin("deferredImportEvaluation",s),e.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(e.phase=null));}parseMaybeImportPhase(e,r){if(!this.isPotentialImportPhase(r))return this.applyImportPhase(e,r,null),null;let i=this.parseIdentifier(!0),{type:s}=this.state;return (_e(s)?s!==98||this.lookaheadCharCode()===102:s!==12)?(this.resetPreviousIdentifierLeadingComments(i),this.applyImportPhase(e,r,i.name,i.loc.start),null):(this.applyImportPhase(e,r,null),i)}isPrecedingIdImportPhase(e){let{type:r}=this.state;return te(r)?r!==98||this.lookaheadCharCode()===102:r!==12}parseImport(e){return this.match(133)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,r){e.specifiers=[];let s=!this.maybeParseDefaultImportSpecifier(e,r)||this.eat(12),a=s&&this.maybeParseStarImportSpecifier(e);return s&&!a&&this.parseNamedImportSpecifiers(e),this.expectContextual(98),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){return (e.specifiers)!=null||(e.specifiers=[]),e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportReflection(e),this.checkJSONModuleImport(e),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,r,i){r.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(r,i));}finishImportSpecifier(e,r,i=8201){return this.checkLVal(e.local,{in:{type:r},binding:i}),this.finishNode(e,r)}parseImportAttributes(){this.expect(5);let e=[],r=new Set;do{if(this.match(8))break;let i=this.startNode(),s=this.state.value;if(r.has(s)&&this.raise(x.ModuleAttributesWithDuplicateKeys,{at:this.state.startLoc,key:s}),r.add(s),this.match(133)?i.key=this.parseStringLiteral(s):i.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(x.ModuleAttributeInvalidValue,{at:this.state.startLoc});i.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(i,"ImportAttribute"));}while(this.eat(12));return this.expect(8),e}parseModuleAttributes(){let e=[],r=new Set;do{let i=this.startNode();if(i.key=this.parseIdentifier(!0),i.key.name!=="type"&&this.raise(x.ModuleAttributeDifferentFromType,{at:i.key}),r.has(i.key.name)&&this.raise(x.ModuleAttributesWithDuplicateKeys,{at:i.key,key:i.key.name}),r.add(i.key.name),this.expect(14),!this.match(133))throw this.raise(x.ModuleAttributeInvalidValue,{at:this.state.startLoc});i.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(i,"ImportAttribute"));}while(this.eat(12));return e}maybeParseImportAttributes(e){let r,i=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?r=this.parseModuleAttributes():(this.expectImportAttributesPlugin(),r=this.parseImportAttributes()),i=!0;}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(x.ImportAttributesUseAssert,{at:this.state.startLoc}),this.addExtra(e,"deprecatedAssertSyntax",!0)):this.expectOnePlugin(["importAttributes","importAssertions"]),this.next(),r=this.parseImportAttributes();else if(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))r=[];else if(this.hasPlugin("moduleAttributes"))r=[];else return;!i&&this.hasPlugin("importAssertions")?e.assertions=r:e.attributes=r;}maybeParseDefaultImportSpecifier(e,r){if(r){let i=this.startNodeAtNode(r);return i.local=r,e.specifiers.push(this.finishImportSpecifier(i,"ImportDefaultSpecifier")),!0}else if(_e(this.state.type))return this.parseImportSpecifierLocal(e,this.startNode(),"ImportDefaultSpecifier"),!0;return !1}maybeParseStarImportSpecifier(e){if(this.match(55)){let r=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(e,r,"ImportNamespaceSpecifier"),!0}return !1}parseNamedImportSpecifiers(e){let r=!0;for(this.expect(5);!this.eat(8);){if(r)r=!1;else {if(this.eat(14))throw this.raise(x.DestructureNamedImport,{at:this.state.startLoc});if(this.expect(12),this.eat(8))break}let i=this.startNode(),s=this.match(133),a=this.isContextual(130);i.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(i,s,e.importKind==="type"||e.importKind==="typeof",a,void 0);e.specifiers.push(n);}}parseImportSpecifier(e,r,i,s,a){if(this.eatContextual(93))e.local=this.parseIdentifier();else {let{imported:n}=e;if(r)throw this.raise(x.ImportBindingIsString,{at:e,importName:n.value});this.checkReservedWord(n.name,e.loc.start,!0,!0),e.local||(e.local=We(n));}return this.finishImportSpecifier(e,"ImportSpecifier",a)}isThisParam(e){return e.type==="Identifier"&&e.name==="this"}},fi=class extends bn{constructor(e,r){e=eL(e),super(e,r),this.options=e,this.initializeScopes(),this.plugins=sL(this.options.plugins),this.filename=e.sourceFilename;}getScopeHandler(){return yr}parse(){this.enterInitialScopes();let e=this.startNode(),r=this.startNode();return this.nextToken(),e.errors=null,this.parseTopLevel(e,r),e.errors=this.state.errors,e}};function sL(t){let e=new Map;for(let r of t){let[i,s]=Array.isArray(r)?r:[r,{}];e.has(i)||e.set(i,s||{});}return e}function aL(t,e){var r;if(((r=e)==null?void 0:r.sourceType)==="unambiguous"){e=Object.assign({},e);try{e.sourceType="module";let i=pr(e,t),s=i.parse();if(i.sawUnambiguousESM)return s;if(i.ambiguousScriptDifferentAst)try{return e.sourceType="script",pr(e,t).parse()}catch{}else s.program.sourceType="script";return s}catch(i){try{return e.sourceType="script",pr(e,t).parse()}catch{}throw i}}else return pr(e,t).parse()}function nL(t,e){let r=pr(e,t);return r.options.strictMode&&(r.state.strict=!0),r.getExpression()}function oL(t){let e={};for(let r of Object.keys(t))e[r]=Ye(t[r]);return e}var lL=oL(ZC);function pr(t,e){let r=fi;return t!=null&&t.plugins&&(QD(t.plugins),r=uL(t.plugins)),new r(t,e)}var Hu={};function uL(t){let e=ZD.filter(s=>ue(t,s)),r=e.join("/"),i=Hu[r];if(!i){i=fi;for(let s of e)i=fc[s](i);Hu[r]=i;}return i}Tr.parse=aL;Tr.parseExpression=nL;Tr.tokTypes=lL;});var hc=A(di=>{Object.defineProperty(di,"__esModule",{value:!0});di.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;di.matchToToken=function(t){var e={type:"invalid",value:t[0],closed:void 0};return t[1]?(e.type="string",e.closed=!!(t[3]||t[4])):t[5]?e.type="comment":t[6]?(e.type="comment",e.closed=!!t[7]):t[8]?e.type="regex":t[9]?e.type="number":t[10]?e.type="name":t[11]?e.type="punctuator":t[12]&&(e.type="whitespace"),e};});var mc=A((R5,yc)=>{var cL=/[|\\{}()[\]^$+*?.]/g;yc.exports=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(cL,"\\$&")};});var bc=A((U5,Tc)=>{Tc.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};});var Nn=A((q5,Ec)=>{var bt=bc(),Pc={};for(hi in bt)bt.hasOwnProperty(hi)&&(Pc[bt[hi]]=hi);var hi,U=Ec.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(Pe in U)if(U.hasOwnProperty(Pe)){if(!("channels"in U[Pe]))throw new Error("missing channels property: "+Pe);if(!("labels"in U[Pe]))throw new Error("missing channel labels property: "+Pe);if(U[Pe].labels.length!==U[Pe].channels)throw new Error("channel and label counts mismatch: "+Pe);Sc=U[Pe].channels,xc=U[Pe].labels,delete U[Pe].channels,delete U[Pe].labels,Object.defineProperty(U[Pe],"channels",{value:Sc}),Object.defineProperty(U[Pe],"labels",{value:xc});}var Sc,xc,Pe;U.rgb.hsl=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,s=Math.min(e,r,i),a=Math.max(e,r,i),n=a-s,o,l,u;return a===s?o=0:e===a?o=(r-i)/n:r===a?o=2+(i-e)/n:i===a&&(o=4+(e-r)/n),o=Math.min(o*60,360),o<0&&(o+=360),u=(s+a)/2,a===s?l=0:u<=.5?l=n/(a+s):l=n/(2-a-s),[o,l*100,u*100]};U.rgb.hsv=function(t){var e,r,i,s,a,n=t[0]/255,o=t[1]/255,l=t[2]/255,u=Math.max(n,o,l),p=u-Math.min(n,o,l),S=function(E){return (u-E)/6/p+1/2};return p===0?s=a=0:(a=p/u,e=S(n),r=S(o),i=S(l),n===u?s=i-r:o===u?s=1/3+e-i:l===u&&(s=2/3+r-e),s<0?s+=1:s>1&&(s-=1)),[s*360,a*100,u*100]};U.rgb.hwb=function(t){var e=t[0],r=t[1],i=t[2],s=U.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(r,i));return i=1-1/255*Math.max(e,Math.max(r,i)),[s,a*100,i*100]};U.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,s,a,n,o;return o=Math.min(1-e,1-r,1-i),s=(1-e-o)/(1-o)||0,a=(1-r-o)/(1-o)||0,n=(1-i-o)/(1-o)||0,[s*100,a*100,n*100,o*100]};function pL(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}U.rgb.keyword=function(t){var e=Pc[t];if(e)return e;var r=1/0,i;for(var s in bt)if(bt.hasOwnProperty(s)){var a=bt[s],n=pL(t,a);n.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var s=e*.4124+r*.3576+i*.1805,a=e*.2126+r*.7152+i*.0722,n=e*.0193+r*.1192+i*.9505;return [s*100,a*100,n*100]};U.rgb.lab=function(t){var e=U.rgb.xyz(t),r=e[0],i=e[1],s=e[2],a,n,o;return r/=95.047,i/=100,s/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,a=116*i-16,n=500*(r-i),o=200*(i-s),[a,n,o]};U.hsl.rgb=function(t){var e=t[0]/360,r=t[1]/100,i=t[2]/100,s,a,n,o,l;if(r===0)return l=i*255,[l,l,l];i<.5?a=i*(1+r):a=i+r-i*r,s=2*i-a,o=[0,0,0];for(var u=0;u<3;u++)n=e+1/3*-(u-1),n<0&&n++,n>1&&n--,6*n<1?l=s+(a-s)*6*n:2*n<1?l=a:3*n<2?l=s+(a-s)*(2/3-n)*6:l=s,o[u]=l*255;return o};U.hsl.hsv=function(t){var e=t[0],r=t[1]/100,i=t[2]/100,s=r,a=Math.max(i,.01),n,o;return i*=2,r*=i<=1?i:2-i,s*=a<=1?a:2-a,o=(i+r)/2,n=i===0?2*s/(a+s):2*r/(i+r),[e,n*100,o*100]};U.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,i=t[2]/100,s=Math.floor(e)%6,a=e-Math.floor(e),n=255*i*(1-r),o=255*i*(1-r*a),l=255*i*(1-r*(1-a));switch(i*=255,s){case 0:return [i,l,n];case 1:return [o,i,n];case 2:return [n,i,l];case 3:return [n,o,i];case 4:return [l,n,i];case 5:return [i,n,o]}};U.hsv.hsl=function(t){var e=t[0],r=t[1]/100,i=t[2]/100,s=Math.max(i,.01),a,n,o;return o=(2-r)*i,a=(2-r)*s,n=r*s,n/=a<=1?a:2-a,n=n||0,o/=2,[e,n*100,o*100]};U.hwb.rgb=function(t){var e=t[0]/360,r=t[1]/100,i=t[2]/100,s=r+i,a,n,o,l;s>1&&(r/=s,i/=s),a=Math.floor(6*e),n=1-i,o=6*e-a,a&1&&(o=1-o),l=r+o*(n-r);var u,p,S;switch(a){default:case 6:case 0:u=n,p=l,S=r;break;case 1:u=l,p=n,S=r;break;case 2:u=r,p=n,S=l;break;case 3:u=r,p=l,S=n;break;case 4:u=l,p=r,S=n;break;case 5:u=n,p=r,S=l;break}return [u*255,p*255,S*255]};U.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,i=t[2]/100,s=t[3]/100,a,n,o;return a=1-Math.min(1,e*(1-s)+s),n=1-Math.min(1,r*(1-s)+s),o=1-Math.min(1,i*(1-s)+s),[a*255,n*255,o*255]};U.xyz.rgb=function(t){var e=t[0]/100,r=t[1]/100,i=t[2]/100,s,a,n;return s=e*3.2406+r*-1.5372+i*-.4986,a=e*-.9689+r*1.8758+i*.0415,n=e*.0557+r*-.204+i*1.057,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*12.92,s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),n=Math.min(Math.max(0,n),1),[s*255,a*255,n*255]};U.xyz.lab=function(t){var e=t[0],r=t[1],i=t[2],s,a,n;return e/=95.047,r/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,s=116*r-16,a=500*(e-r),n=200*(r-i),[s,a,n]};U.lab.xyz=function(t){var e=t[0],r=t[1],i=t[2],s,a,n;a=(e+16)/116,s=r/500+a,n=a-i/200;var o=Math.pow(a,3),l=Math.pow(s,3),u=Math.pow(n,3);return a=o>.008856?o:(a-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,n=u>.008856?u:(n-16/116)/7.787,s*=95.047,a*=100,n*=108.883,[s,a,n]};U.lab.lch=function(t){var e=t[0],r=t[1],i=t[2],s,a,n;return s=Math.atan2(i,r),a=s*360/2/Math.PI,a<0&&(a+=360),n=Math.sqrt(r*r+i*i),[e,n,a]};U.lch.lab=function(t){var e=t[0],r=t[1],i=t[2],s,a,n;return n=i/360*2*Math.PI,s=r*Math.cos(n),a=r*Math.sin(n),[e,s,a]};U.rgb.ansi16=function(t){var e=t[0],r=t[1],i=t[2],s=1 in arguments?arguments[1]:U.rgb.hsv(t)[2];if(s=Math.round(s/50),s===0)return 30;var a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return s===2&&(a+=60),a};U.hsv.ansi16=function(t){return U.rgb.ansi16(U.hsv.rgb(t),t[2])};U.rgb.ansi256=function(t){var e=t[0],r=t[1],i=t[2];if(e===r&&r===i)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var s=16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5);return s};U.ansi16.rgb=function(t){var e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var r=(~~(t>50)+1)*.5,i=(e&1)*r*255,s=(e>>1&1)*r*255,a=(e>>2&1)*r*255;return [i,s,a]};U.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return [e,e,e]}t-=16;var r,i=Math.floor(t/36)/5*255,s=Math.floor((r=t%36)/6)/5*255,a=r%6/5*255;return [i,s,a]};U.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),r=e.toString(16).toUpperCase();return "000000".substring(r.length)+r};U.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return [0,0,0];var r=e[0];e[0].length===3&&(r=r.split("").map(function(o){return o+o}).join(""));var i=parseInt(r,16),s=i>>16&255,a=i>>8&255,n=i&255;return [s,a,n]};U.rgb.hcg=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,s=Math.max(Math.max(e,r),i),a=Math.min(Math.min(e,r),i),n=s-a,o,l;return n<1?o=a/(1-n):o=0,n<=0?l=0:s===e?l=(r-i)/n%6:s===r?l=2+(i-e)/n:l=4+(e-r)/n+4,l/=6,l%=1,[l*360,n*100,o*100]};U.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,i=1,s=0;return r<.5?i=2*e*r:i=2*e*(1-r),i<1&&(s=(r-.5*i)/(1-i)),[t[0],i*100,s*100]};U.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,i=e*r,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};U.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,i=t[2]/100;if(r===0)return [i*255,i*255,i*255];var s=[0,0,0],a=e%1*6,n=a%1,o=1-n,l=0;switch(Math.floor(a)){case 0:s[0]=1,s[1]=n,s[2]=0;break;case 1:s[0]=o,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=n;break;case 3:s[0]=0,s[1]=o,s[2]=1;break;case 4:s[0]=n,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=o;}return l=(1-r)*i,[(r*s[0]+l)*255,(r*s[1]+l)*255,(r*s[2]+l)*255]};U.hcg.hsv=function(t){var e=t[1]/100,r=t[2]/100,i=e+r*(1-e),s=0;return i>0&&(s=e/i),[t[0],s*100,i*100]};U.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100,i=r*(1-e)+.5*e,s=0;return i>0&&i<.5?s=e/(2*i):i>=.5&&i<1&&(s=e/(2*(1-i))),[t[0],s*100,i*100]};U.hcg.hwb=function(t){var e=t[1]/100,r=t[2]/100,i=e+r*(1-e);return [t[0],(i-e)*100,(1-i)*100]};U.hwb.hcg=function(t){var e=t[1]/100,r=t[2]/100,i=1-r,s=i-e,a=0;return s<1&&(a=(i-s)/(1-s)),[t[0],s*100,a*100]};U.apple.rgb=function(t){return [t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};U.rgb.apple=function(t){return [t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};U.gray.rgb=function(t){return [t[0]/100*255,t[0]/100*255,t[0]/100*255]};U.gray.hsl=U.gray.hsv=function(t){return [0,0,t[0]]};U.gray.hwb=function(t){return [0,100,t[0]]};U.gray.cmyk=function(t){return [0,0,0,t[0]]};U.gray.lab=function(t){return [t[0],0,0]};U.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,r=(e<<16)+(e<<8)+e,i=r.toString(16).toUpperCase();return "000000".substring(i.length)+i};U.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return [e/255*100]};});var Ac=A((K5,gc)=>{var yi=Nn();function fL(){for(var t={},e=Object.keys(yi),r=e.length,i=0;i{var Cn=Nn(),mL=Ac(),Lt={},TL=Object.keys(Cn);function bL(t){var e=function(r){return r==null?r:(arguments.length>1&&(r=Array.prototype.slice.call(arguments)),t(r))};return "conversion"in t&&(e.conversion=t.conversion),e}function SL(t){var e=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var i=t(r);if(typeof i=="object")for(var s=i.length,a=0;a{var kt=Ic(),mi=(t,e)=>function(){return `\x1B[${t.apply(kt,arguments)+e}m`},Ti=(t,e)=>function(){let r=t.apply(kt,arguments);return `\x1B[${38+e};5;${r}m`},bi=(t,e)=>function(){let r=t.apply(kt,arguments);return `\x1B[${38+e};2;${r[0]};${r[1]};${r[2]}m`};function xL(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.grey=e.color.gray;for(let s of Object.keys(e)){let a=e[s];for(let n of Object.keys(a)){let o=a[n];e[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},a[n]=e[n],t.set(o[0],o[1]);}Object.defineProperty(e,s,{value:a,enumerable:!1}),Object.defineProperty(e,"codes",{value:t,enumerable:!1});}let r=s=>s,i=(s,a,n)=>[s,a,n];e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi={ansi:mi(r,0)},e.color.ansi256={ansi256:Ti(r,0)},e.color.ansi16m={rgb:bi(i,0)},e.bgColor.ansi={ansi:mi(r,10)},e.bgColor.ansi256={ansi256:Ti(r,10)},e.bgColor.ansi16m={rgb:bi(i,10)};for(let s of Object.keys(kt)){if(typeof kt[s]!="object")continue;let a=kt[s];s==="ansi16"&&(s="ansi"),"ansi16"in a&&(e.color.ansi[s]=mi(a.ansi16,0),e.bgColor.ansi[s]=mi(a.ansi16,10)),"ansi256"in a&&(e.color.ansi256[s]=Ti(a.ansi256,0),e.bgColor.ansi256[s]=Ti(a.ansi256,10)),"rgb"in a&&(e.color.ansi16m[s]=bi(a.rgb,0),e.bgColor.ansi16m[s]=bi(a.rgb,10));}return e}Object.defineProperty(wc,"exports",{enumerable:!0,get:xL});});var Cc=A((X5,Nc)=>{Nc.exports={stdout:!1,stderr:!1};});var Mc=A((J5,_c)=>{var PL=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Dc=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,EL=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,gL=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,AL=new Map([["n",`
+`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function kc(t){return t[0]==="u"&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):AL.get(t)||t}function vL(t,e){let r=[],i=e.trim().split(/\s*,\s*/g),s;for(let a of i)if(!isNaN(a))r.push(Number(a));else if(s=a.match(EL))r.push(s[2].replace(gL,(n,o,l)=>o?kc(o):l));else throw new Error(`Invalid Chalk template style argument: ${a} (in style '${t}')`);return r}function IL(t){Dc.lastIndex=0;let e=[],r;for(;(r=Dc.exec(t))!==null;){let i=r[1];if(r[2]){let s=vL(i,r[2]);e.push([i].concat(s));}else e.push([i]);}return e}function Lc(t,e){let r={};for(let s of e)for(let a of s.styles)r[a[0]]=s.inverse?null:a.slice(1);let i=t;for(let s of Object.keys(r))if(Array.isArray(r[s])){if(!(s in i))throw new Error(`Unknown Chalk style: ${s}`);r[s].length>0?i=i[s].apply(i,r[s]):i=i[s];}return i}_c.exports=(t,e)=>{let r=[],i=[],s=[];if(e.replace(PL,(a,n,o,l,u,p)=>{if(n)s.push(kc(n));else if(l){let S=s.join("");s=[],i.push(r.length===0?S:Lc(t,r)(S)),r.push({inverse:o,styles:IL(l)});}else if(u){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(Lc(t,r)(s.join(""))),s=[],r.pop();}else s.push(p);}),i.push(s.join("")),r.length>0){let a=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(a)}return i.join("")};});var kn=A(($5,Sr)=>{var Ln=mc(),ce=Oc(),Dn=Cc().stdout,wL=Mc(),Bc=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),Fc=["ansi","ansi","ansi256","ansi16m"],Rc=new Set(["gray"]),_t=Object.create(null);function jc(t,e){e=e||{};let r=Dn?Dn.level:0;t.level=e.level===void 0?r:e.level,t.enabled="enabled"in e?e.enabled:t.level>0;}function br(t){if(!this||!(this instanceof br)||this.template){let e={};return jc(e,t),e.template=function(){let r=[].slice.call(arguments);return CL.apply(null,[e.template].concat(r))},Object.setPrototypeOf(e,br.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=br,e.template}jc(this,t);}Bc&&(ce.blue.open="\x1B[94m");for(let t of Object.keys(ce))ce[t].closeRe=new RegExp(Ln(ce[t].close),"g"),_t[t]={get(){let e=ce[t];return Si.call(this,this._styles?this._styles.concat(e):[e],this._empty,t)}};_t.visible={get(){return Si.call(this,this._styles||[],!0,"visible")}};ce.color.closeRe=new RegExp(Ln(ce.color.close),"g");for(let t of Object.keys(ce.color.ansi))Rc.has(t)||(_t[t]={get(){let e=this.level;return function(){let i={open:ce.color[Fc[e]][t].apply(null,arguments),close:ce.color.close,closeRe:ce.color.closeRe};return Si.call(this,this._styles?this._styles.concat(i):[i],this._empty,t)}}});ce.bgColor.closeRe=new RegExp(Ln(ce.bgColor.close),"g");for(let t of Object.keys(ce.bgColor.ansi)){if(Rc.has(t))continue;let e="bg"+t[0].toUpperCase()+t.slice(1);_t[e]={get(){let r=this.level;return function(){let s={open:ce.bgColor[Fc[r]][t].apply(null,arguments),close:ce.bgColor.close,closeRe:ce.bgColor.closeRe};return Si.call(this,this._styles?this._styles.concat(s):[s],this._empty,t)}}};}var OL=Object.defineProperties(()=>{},_t);function Si(t,e,r){let i=function(){return NL.apply(i,arguments)};i._styles=t,i._empty=e;let s=this;return Object.defineProperty(i,"level",{enumerable:!0,get(){return s.level},set(a){s.level=a;}}),Object.defineProperty(i,"enabled",{enumerable:!0,get(){return s.enabled},set(a){s.enabled=a;}}),i.hasGrey=this.hasGrey||r==="gray"||r==="grey",i.__proto__=OL,i}function NL(){let t=arguments,e=t.length,r=String(arguments[0]);if(e===0)return "";if(e>1)for(let s=1;s{Object.defineProperty(xr,"__esModule",{value:!0});xr.default=BL;xr.shouldHighlight=Yc;var Uc=hc(),qc=Ht(),Mn=DL(kn(),!0);function Kc(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return (Kc=function(i){return i?r:e})(t)}function DL(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return {default:t};var r=Kc(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var n=s?Object.getOwnPropertyDescriptor(t,a):null;n&&(n.get||n.set)?Object.defineProperty(i,a,n):i[a]=t[a];}return i.default=t,r&&r.set(t,i),i}var LL=new Set(["as","async","from","get","of","set"]);function kL(t){return {keyword:t.cyan,capitalized:t.yellow,jsxIdentifier:t.yellow,punctuator:t.yellow,number:t.magenta,string:t.green,regex:t.magenta,comment:t.grey,invalid:t.white.bgRed.bold}}var _L=/\r\n|[\n\r\u2028\u2029]/,ML=/^[()[\]{}]$/,Vc;{let t=/^[a-z][\w-]*$/i,e=function(r,i,s){if(r.type==="name"){if((0, qc.isKeyword)(r.value)||(0, qc.isStrictReservedWord)(r.value,!0)||LL.has(r.value))return "keyword";if(t.test(r.value)&&(s[i-1]==="<"||s.slice(i-2,i)==""))return "jsxIdentifier";if(r.value[0]!==r.value[0].toLowerCase())return "capitalized"}return r.type==="punctuator"&&ML.test(r.value)?"bracket":r.type==="invalid"&&(r.value==="@"||r.value==="#")?"punctuator":r.type};Vc=function*(r){let i;for(;i=Uc.default.exec(r);){let s=Uc.matchToToken(i);yield {type:e(s,i.index,r),value:s.value};}};}function jL(t,e){let r="";for(let{type:i,value:s}of Vc(e)){let a=t[i];a?r+=s.split(_L).map(n=>a(n)).join(`
+`):r+=s;}return r}function Yc(t){return Mn.default.level>0||t.forceColor}var _n;function Xc(t){if(t){return (_n)!=null||(_n=new Mn.default.constructor({enabled:!0,level:1})),_n}return Mn.default}xr.getChalk=t=>Xc(t.forceColor);function BL(t,e={}){if(t!==""&&Yc(e)){let r=kL(Xc(e.forceColor));return jL(r,t)}else return t}});var Zc=A(xi=>{Object.defineProperty(xi,"__esModule",{value:!0});xi.codeFrameColumns=Qc;xi.default=KL;var $c=Jc(),Wc=FL(kn(),!0);function Gc(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return (Gc=function(i){return i?r:e})(t)}function FL(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return {default:t};var r=Gc(e);if(r&&r.has(t))return r.get(t);var i={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var n=s?Object.getOwnPropertyDescriptor(t,a):null;n&&(n.get||n.set)?Object.defineProperty(i,a,n):i[a]=t[a];}return i.default=t,r&&r.set(t,i),i}var jn;function RL(t){if(t){return (jn)!=null||(jn=new Wc.default.constructor({enabled:!0,level:1})),jn}return Wc.default}var zc=!1;function UL(t){return {gutter:t.grey,marker:t.red.bold,message:t.red.bold}}var Hc=/\r\n|[\n\r\u2028\u2029]/;function qL(t,e,r){let i=Object.assign({column:0,line:-1},t.start),s=Object.assign({},i,t.end),{linesAbove:a=2,linesBelow:n=3}=r||{},o=i.line,l=i.column,u=s.line,p=s.column,S=Math.max(o-(a+1),0),E=Math.min(e.length,u+n);o===-1&&(S=0),u===-1&&(E=e.length);let v=u-o,I={};if(v)for(let N=0;N<=v;N++){let M=N+o;if(!l)I[M]=!0;else if(N===0){let j=e[M-1].length;I[M]=[l,j-l+1];}else if(N===v)I[M]=[0,p];else {let j=e[M-N].length;I[M]=[0,j];}}else l===p?l?I[o]=[l,0]:I[o]=!0:I[o]=[l,p-l];return {start:S,end:E,markerLines:I}}function Qc(t,e,r={}){let i=(r.highlightCode||r.forceColor)&&(0, $c.shouldHighlight)(r),s=RL(r.forceColor),a=UL(s),n=(N,M)=>i?N(M):M,o=t.split(Hc),{start:l,end:u,markerLines:p}=qL(e,o,r),S=e.start&&typeof e.start.column=="number",E=String(u).length,I=(i?(0, $c.default)(t,r):t).split(Hc,u).slice(l,u).map((N,M)=>{let j=l+1+M,k=` ${` ${j}`.slice(-E)} |`,$=p[j],oe=!p[j+1];if($){let ne="";if(Array.isArray($)){let ut=N.slice(0,Math.max($[0]-1,0)).replace(/[^\t]/g," "),Vi=$[1]||1;ne=[`
+ `,n(a.gutter,k.replace(/\d/g," "))," ",ut,n(a.marker,"^").repeat(Vi)].join(""),oe&&r.message&&(ne+=" "+n(a.message,r.message));}return [n(a.marker,">"),n(a.gutter,k),N.length>0?` ${N}`:"",ne].join("")}else return ` ${n(a.gutter,k)}${N.length>0?` ${N}`:""}`}).join(`
+`);return r.message&&!S&&(I=`${" ".repeat(E+1)}${r.message}
+${I}`),i?s.reset(I):I}function KL(t,e,r,i={}){if(!zc){zc=!0;let a="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(a,"DeprecationWarning");else {let n=new Error(a);n.name="DeprecationWarning",console.warn(new Error(a));}}return r=Math.max(r,0),Qc(t,{start:{column:r,line:e}},i)}});var Fn=A(Bn=>{Object.defineProperty(Bn,"__esModule",{value:!0});Bn.default=r3;var VL=ve(),YL=dc(),XL=Zc(),{isCallExpression:JL,isExpressionStatement:$L,isFunction:WL,isIdentifier:zL,isJSXIdentifier:HL,isNewExpression:GL,isPlaceholder:Pi,isStatement:QL,isStringLiteral:ep,removePropertiesDeep:ZL,traverse:e3}=VL,t3=/^[_$A-Z0-9]+$/;function r3(t,e,r){let{placeholderWhitelist:i,placeholderPattern:s,preserveComments:a,syntacticPlaceholders:n}=r,o=a3(e,r.parser,n);ZL(o,{preserveComments:a}),t.validate(o);let l={syntactic:{placeholders:[],placeholderNames:new Set},legacy:{placeholders:[],placeholderNames:new Set},placeholderWhitelist:i,placeholderPattern:s,syntacticPlaceholders:n};return e3(o,i3,l),Object.assign({ast:o},l.syntactic.placeholders.length?l.syntactic:l.legacy)}function i3(t,e,r){var i;let s,a=r.syntactic.placeholders.length>0;if(Pi(t)){if(r.syntacticPlaceholders===!1)throw new Error("%%foo%%-style placeholders can't be used when '.syntacticPlaceholders' is false.");s=t.name.name,a=!0;}else {if(a||r.syntacticPlaceholders)return;if(zL(t)||HL(t))s=t.name;else if(ep(t))s=t.value;else return}if(a&&(r.placeholderPattern!=null||r.placeholderWhitelist!=null))throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible with '.syntacticPlaceholders: true'");if(!a&&(r.placeholderPattern===!1||!(r.placeholderPattern||t3).test(s))&&!((i=r.placeholderWhitelist)!=null&&i.has(s)))return;e=e.slice();let{node:n,key:o}=e[e.length-1],l;ep(t)||Pi(t,{expectedNode:"StringLiteral"})?l="string":GL(n)&&o==="arguments"||JL(n)&&o==="arguments"||WL(n)&&o==="params"?l="param":$L(n)&&!Pi(t)?(l="statement",e=e.slice(0,-1)):QL(t)&&Pi(t)?l="statement":l="other";let{placeholders:u,placeholderNames:p}=a?r.syntactic:r.legacy;u.push({name:s,type:l,resolve:S=>s3(S,e),isDuplicate:p.has(s)}),p.add(s);}function s3(t,e){let r=t;for(let a=0;a{Object.defineProperty(qn,"__esModule",{value:!0});qn.default=p3;var n3=ve(),{blockStatement:o3,cloneNode:Un,emptyStatement:l3,expressionStatement:Rn,identifier:Ei,isStatement:tp,isStringLiteral:u3,stringLiteral:c3,validate:rp}=n3;function p3(t,e){let r=Un(t.ast);return e&&(t.placeholders.forEach(i=>{if(!Object.prototype.hasOwnProperty.call(e,i.name)){let s=i.name;throw new Error(`Error: No substitution given for "${s}". If this is not meant to be a
+ placeholder you may want to consider passing one of the following options to @babel/template:
+ - { placeholderPattern: false, placeholderWhitelist: new Set(['${s}'])}
+ - { placeholderPattern: /^${s}$/ }`)}}),Object.keys(e).forEach(i=>{if(!t.placeholderNames.has(i))throw new Error(`Unknown substitution "${i}" given`)})),t.placeholders.slice().reverse().forEach(i=>{try{f3(i,r,e&&e[i.name]||null);}catch(s){throw s.message=`@babel/template placeholder "${i.name}": ${s.message}`,s}}),r}function f3(t,e,r){t.isDuplicate&&(Array.isArray(r)?r=r.map(n=>Un(n)):typeof r=="object"&&(r=Un(r)));let{parent:i,key:s,index:a}=t.resolve(e);if(t.type==="string"){if(typeof r=="string"&&(r=c3(r)),!r||!u3(r))throw new Error("Expected string substitution")}else if(t.type==="statement")a===void 0?r?Array.isArray(r)?r=o3(r):typeof r=="string"?r=Rn(Ei(r)):tp(r)||(r=Rn(r)):r=l3():r&&!Array.isArray(r)&&(typeof r=="string"&&(r=Ei(r)),tp(r)||(r=Rn(r)));else if(t.type==="param"){if(typeof r=="string"&&(r=Ei(r)),a===void 0)throw new Error("Assertion failure.")}else if(typeof r=="string"&&(r=Ei(r)),Array.isArray(r))throw new Error("Cannot replace single expression with an array.");if(a===void 0)rp(i,s,r),i[s]=r;else {let n=i[s].slice();t.type==="statement"||t.type==="param"?r==null?n.splice(a,1):Array.isArray(r)?n.splice(a,1,...r):n[a]=r:n[a]=r,rp(i,s,n),i[s]=n;}}});var ip=A(Vn=>{Object.defineProperty(Vn,"__esModule",{value:!0});Vn.default=m3;var d3=ti(),h3=Fn(),y3=Kn();function m3(t,e,r){e=t.code(e);let i;return s=>{let a=(0, d3.normalizeReplacements)(s);return i||(i=(0, h3.default)(t,e,r)),t.unwrap((0, y3.default)(i,a))}}});var sp=A(Yn=>{Object.defineProperty(Yn,"__esModule",{value:!0});Yn.default=x3;var T3=ti(),b3=Fn(),S3=Kn();function x3(t,e,r){let{metadata:i,names:s}=P3(t,e,r);return a=>{let n={};return a.forEach((o,l)=>{n[s[l]]=o;}),o=>{let l=(0, T3.normalizeReplacements)(o);return l&&Object.keys(l).forEach(u=>{if(Object.prototype.hasOwnProperty.call(n,u))throw new Error("Unexpected replacement overlap.")}),t.unwrap((0, S3.default)(i,l?Object.assign(l,n):n))}}}function P3(t,e,r){let i="BABEL_TPL$",s=e.join("");do i="$$"+i;while(s.includes(i));let{names:a,code:n}=E3(e,i);return {metadata:(0, b3.default)(t,t.code(n),{parser:r.parser,placeholderWhitelist:new Set(a.concat(r.placeholderWhitelist?Array.from(r.placeholderWhitelist):[])),placeholderPattern:r.placeholderPattern,preserveComments:r.preserveComments,syntacticPlaceholders:r.syntacticPlaceholders}),names:a}}function E3(t,e){let r=[],i=t[0];for(let s=1;s{Object.defineProperty(Xn,"__esModule",{value:!0});Xn.default=up;var Ue=ti(),ap=ip(),np=sp(),op=(0, Ue.validate)({placeholderPattern:!1});function up(t,e){let r=new WeakMap,i=new WeakMap,s=e||(0, Ue.validate)(null);return Object.assign((a,...n)=>{if(typeof a=="string"){if(n.length>1)throw new Error("Unexpected extra params.");return lp((0,ap.default)(t,a,(0,Ue.merge)(s,(0,Ue.validate)(n[0]))))}else if(Array.isArray(a)){let o=r.get(a);return o||(o=(0, np.default)(t,a,s),r.set(a,o)),lp(o(n))}else if(typeof a=="object"&&a){if(n.length>0)throw new Error("Unexpected extra params.");return up(t,(0, Ue.merge)(s,(0, Ue.validate)(a)))}throw new Error(`Unexpected template param ${typeof a}`)},{ast:(a,...n)=>{if(typeof a=="string"){if(n.length>1)throw new Error("Unexpected extra params.");return (0, ap.default)(t,a,(0, Ue.merge)((0, Ue.merge)(s,(0, Ue.validate)(n[0])),op))()}else if(Array.isArray(a)){let o=i.get(a);return o||(o=(0, np.default)(t,a,(0, Ue.merge)(s,op)),i.set(a,o)),o(n)()}throw new Error(`Unexpected template param ${typeof a}`)}})}function lp(t){let e="";try{throw new Error}catch(r){r.stack&&(e=r.stack.split(`
+`).slice(3).join(`
+`));}return r=>{try{return t(r)}catch(i){throw i.stack+=`
+ =============
+${e}`,i}}}});var yp=A(Ie=>{Object.defineProperty(Ie,"__esModule",{value:!0});Ie.statements=Ie.statement=Ie.smart=Ie.program=Ie.expression=Ie.default=void 0;var Pr=_u(),Er=cp(),gi=(0, Er.default)(Pr.smart);Ie.smart=gi;var pp=(0, Er.default)(Pr.statement);Ie.statement=pp;var fp=(0, Er.default)(Pr.statements);Ie.statements=fp;var dp=(0, Er.default)(Pr.expression);Ie.expression=dp;var hp=(0, Er.default)(Pr.program);Ie.program=hp;var g3=Object.assign(gi.bind(void 0),{smart:gi,statement:pp,statements:fp,expression:dp,program:hp,ast:gi.ast});Ie.default=g3;});var Tp=A(gr=>{Object.defineProperty(gr,"__esModule",{value:!0});gr.declare=mp;gr.declarePreset=void 0;var Jn={assertVersion:t=>e=>{I3(e,t.version);}};Object.assign(Jn,{targets:()=>()=>({}),assumption:()=>()=>{}});function mp(t){return (e,r,i)=>{var s;let a;for(let o of Object.keys(Jn)){e[o]||((a)!=null||(a=v3(e)),a[o]=Jn[o](a));}return t((s=a)!=null?s:e,r||{},i)}}var A3=mp;gr.declarePreset=A3;function v3(t){let e=null;return typeof t.version=="string"&&/^7\./.test(t.version)&&(e=Object.getPrototypeOf(t),e&&(!Ai(e,"version")||!Ai(e,"transform")||!Ai(e,"template")||!Ai(e,"types"))&&(e=null)),Object.assign({},e,t)}function Ai(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function I3(t,e){if(typeof t=="number"){if(!Number.isInteger(t))throw new Error("Expected string or integer value.");t=`^${t}.0.0-0`;}if(typeof t!="string")throw new Error("Expected string or integer value.");let r=Error.stackTraceLimit;typeof r=="number"&&r<25&&(Error.stackTraceLimit=25);let i;throw e.slice(0,2)==="7."?i=new Error(`Requires Babel "^7.0.0-beta.41", but was loaded with "${e}". You'll need to update your @babel/core version.`):i=new Error(`Requires Babel "${t}", but was loaded with "${e}". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.`),typeof r=="number"&&(Error.stackTraceLimit=r),Object.assign(i,{code:"BABEL_VERSION_UNSUPPORTED",version:e,range:t})}});var bp=A(vi=>{Object.defineProperty(vi,"__esModule",{value:!0});vi.default=void 0;var w3=Tp();vi.default=(0, w3.declare)(t=>(t.assertVersion(7),{name:"syntax-jsx",manipulateOptions(e,r){r.plugins.some(i=>(Array.isArray(i)?i[0]:i)==="typescript")||r.plugins.push("jsx");}}));});var $n=A((aB,xp)=>{var Sp=Object.prototype.toString;xp.exports=function(e){var r=Sp.call(e),i=r==="[object Arguments]";return i||(i=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Sp.call(e.callee)==="[object Function]"),i};});var Np=A((nB,Op)=>{var wp;Object.keys||(Ar=Object.prototype.hasOwnProperty,Wn=Object.prototype.toString,Pp=$n(),zn=Object.prototype.propertyIsEnumerable,Ep=!zn.call({toString:null},"toString"),gp=zn.call(function(){},"prototype"),vr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ii=function(t){var e=t.constructor;return e&&e.prototype===t},Ap={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},vp=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!Ap["$"+t]&&Ar.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{Ii(window[t]);}catch{return !0}}catch{return !0}return !1}(),Ip=function(t){if(typeof window>"u"||!vp)return Ii(t);try{return Ii(t)}catch{return !1}},wp=function(e){var r=e!==null&&typeof e=="object",i=Wn.call(e)==="[object Function]",s=Pp(e),a=r&&Wn.call(e)==="[object String]",n=[];if(!r&&!i&&!s)throw new TypeError("Object.keys called on a non-object");var o=gp&&i;if(a&&e.length>0&&!Ar.call(e,0))for(var l=0;l0)for(var u=0;u{var O3=Array.prototype.slice,N3=$n(),Cp=Object.keys,wi=Cp?function(e){return Cp(e)}:Np(),Dp=Object.keys;wi.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(i){return N3(i)?Dp(O3.call(i)):Dp(i)});}else Object.keys=wi;return Object.keys||wi};Lp.exports=wi;});var Hn=A((lB,_p)=>{_p.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return !1;var s=42;e[r]=s;for(r in e)return !1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return !1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var n=Object.getOwnPropertyDescriptor(e,r);if(n.value!==s||n.enumerable!==!0)return !1}return !0};});var Bp=A((uB,jp)=>{var Mp=typeof Symbol<"u"&&Symbol,C3=Hn();jp.exports=function(){return typeof Mp!="function"||typeof Symbol!="function"||typeof Mp("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:C3()};});var Up=A((cB,Rp)=>{var Fp={foo:{}},D3=Object;Rp.exports=function(){return {__proto__:Fp}.foo===Fp.foo&&!({__proto__:null}instanceof D3)};});var Kp=A((pB,qp)=>{var L3="Function.prototype.bind called on incompatible ",Gn=Array.prototype.slice,k3=Object.prototype.toString,_3="[object Function]";qp.exports=function(e){var r=this;if(typeof r!="function"||k3.call(r)!==_3)throw new TypeError(L3+r);for(var i=Gn.call(arguments,1),s,a=function(){if(this instanceof s){var p=r.apply(this,i.concat(Gn.call(arguments)));return Object(p)===p?p:this}else return r.apply(e,i.concat(Gn.call(arguments)))},n=Math.max(0,r.length-i.length),o=[],l=0;l{var M3=Kp();Vp.exports=Function.prototype.bind||M3;});var Xp=A((dB,Yp)=>{var j3=Oi();Yp.exports=j3.call(Function.call,Object.prototype.hasOwnProperty);});var eo=A((hB,Hp)=>{var H,Ft=SyntaxError,zp=Function,Bt=TypeError,Qn=function(t){try{return zp('"use strict"; return ('+t+").constructor;")()}catch{}},St=Object.getOwnPropertyDescriptor;if(St)try{St({},"");}catch{St=null;}var Zn=function(){throw new Bt},B3=St?function(){try{return arguments.callee,Zn}catch{try{return St(arguments,"callee").get}catch{return Zn}}}():Zn,Mt=Bp()(),F3=Up()(),fe=Object.getPrototypeOf||(F3?function(t){return t.__proto__}:null),jt={},R3=typeof Uint8Array>"u"||!fe?H:fe(Uint8Array),xt={"%AggregateError%":typeof AggregateError>"u"?H:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?H:ArrayBuffer,"%ArrayIteratorPrototype%":Mt&&fe?fe([][Symbol.iterator]()):H,"%AsyncFromSyncIteratorPrototype%":H,"%AsyncFunction%":jt,"%AsyncGenerator%":jt,"%AsyncGeneratorFunction%":jt,"%AsyncIteratorPrototype%":jt,"%Atomics%":typeof Atomics>"u"?H:Atomics,"%BigInt%":typeof BigInt>"u"?H:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?H:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?H:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?H:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?H:Float32Array,"%Float64Array%":typeof Float64Array>"u"?H:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?H:FinalizationRegistry,"%Function%":zp,"%GeneratorFunction%":jt,"%Int8Array%":typeof Int8Array>"u"?H:Int8Array,"%Int16Array%":typeof Int16Array>"u"?H:Int16Array,"%Int32Array%":typeof Int32Array>"u"?H:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Mt&&fe?fe(fe([][Symbol.iterator]())):H,"%JSON%":typeof JSON=="object"?JSON:H,"%Map%":typeof Map>"u"?H:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Mt||!fe?H:fe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?H:Promise,"%Proxy%":typeof Proxy>"u"?H:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?H:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?H:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Mt||!fe?H:fe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?H:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Mt&&fe?fe(""[Symbol.iterator]()):H,"%Symbol%":Mt?Symbol:H,"%SyntaxError%":Ft,"%ThrowTypeError%":B3,"%TypedArray%":R3,"%TypeError%":Bt,"%Uint8Array%":typeof Uint8Array>"u"?H:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?H:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?H:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?H:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?H:WeakMap,"%WeakRef%":typeof WeakRef>"u"?H:WeakRef,"%WeakSet%":typeof WeakSet>"u"?H:WeakSet};if(fe)try{null.error;}catch(t){Jp=fe(fe(t)),xt["%Error.prototype%"]=Jp;}var Jp,U3=function t(e){var r;if(e==="%AsyncFunction%")r=Qn("async function () {}");else if(e==="%GeneratorFunction%")r=Qn("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Qn("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype);}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&fe&&(r=fe(s.prototype));}return xt[e]=r,r},$p={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ir=Oi(),Ni=Xp(),q3=Ir.call(Function.call,Array.prototype.concat),K3=Ir.call(Function.apply,Array.prototype.splice),Wp=Ir.call(Function.call,String.prototype.replace),Ci=Ir.call(Function.call,String.prototype.slice),V3=Ir.call(Function.call,RegExp.prototype.exec),Y3=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X3=/\\(\\)?/g,J3=function(e){var r=Ci(e,0,1),i=Ci(e,-1);if(r==="%"&&i!=="%")throw new Ft("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new Ft("invalid intrinsic syntax, expected opening `%`");var s=[];return Wp(e,Y3,function(a,n,o,l){s[s.length]=o?Wp(l,X3,"$1"):n||a;}),s},$3=function(e,r){var i=e,s;if(Ni($p,i)&&(s=$p[i],i="%"+s[0]+"%"),Ni(xt,i)){var a=xt[i];if(a===jt&&(a=U3(i)),typeof a>"u"&&!r)throw new Bt("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:i,value:a}}throw new Ft("intrinsic "+e+" does not exist!")};Hp.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Bt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Bt('"allowMissing" argument must be a boolean');if(V3(/^%?[^%]*%?$/,e)===null)throw new Ft("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=J3(e),s=i.length>0?i[0]:"",a=$3("%"+s+"%",r),n=a.name,o=a.value,l=!1,u=a.alias;u&&(s=u[0],K3(i,q3([0,1],u)));for(var p=1,S=!0;p=i.length){var N=St(o,E);S=!!N,S&&"get"in N&&!("originalValue"in N.get)?o=N.get:o=o[E];}else S=Ni(o,E),o=o[E];S&&!l&&(xt[n]=o);}}return o};});var rf=A((yB,Di)=>{var to=Oi(),Rt=eo(),Zp=Rt("%Function.prototype.apply%"),ef=Rt("%Function.prototype.call%"),tf=Rt("%Reflect.apply%",!0)||to.call(ef,Zp),Gp=Rt("%Object.getOwnPropertyDescriptor%",!0),Pt=Rt("%Object.defineProperty%",!0),W3=Rt("%Math.max%");if(Pt)try{Pt({},"a",{value:1});}catch{Pt=null;}Di.exports=function(e){var r=tf(to,ef,arguments);if(Gp&&Pt){var i=Gp(r,"length");i.configurable&&Pt(r,"length",{value:1+W3(0,e.length-(arguments.length-1))});}return r};var Qp=function(){return tf(to,Zp,arguments)};Pt?Pt(Di.exports,"apply",{value:Qp}):Di.exports.apply=Qp;});var of=A((mB,nf)=>{var sf=eo(),af=rf(),z3=af(sf("String.prototype.indexOf"));nf.exports=function(e,r){var i=sf(e,!!r);return typeof i=="function"&&z3(e,".prototype.")>-1?af(i):i};});var df=A((TB,ff)=>{var H3=kp(),cf=Hn()(),pf=of(),lf=Object,G3=pf("Array.prototype.push"),uf=pf("Object.prototype.propertyIsEnumerable"),Q3=cf?Object.getOwnPropertySymbols:null;ff.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var i=lf(e);if(arguments.length===1)return i;for(var s=1;s{var ro=df(),Z3=function(){if(!Object.assign)return !1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},i=0;i{mf.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"};});var bf=A((xB,io)=>{typeof Object.create=="function"?io.exports=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});}:io.exports=function(e,r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e;};});var Ef=A(se=>{var tk=/%[sdj%]/g;se.format=function(t){if(!Fi(t)){for(var e=[],r=0;r=s)return o;switch(o){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch{return "[Circular]"}default:return o}}),n=i[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),uo(e)?r.showHidden=e:e&&se._extend(r,e),ze(r.showHidden)&&(r.showHidden=!1),ze(r.depth)&&(r.depth=2),ze(r.colors)&&(r.colors=!1),ze(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=rk),ji(r,t,r.depth)}se.inspect=nt;nt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};nt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function rk(t,e){var r=nt.styles[e];return r?"\x1B["+nt.colors[r][0]+"m"+t+"\x1B["+nt.colors[r][1]+"m":t}function ik(t,e){return t}function sk(t){var e={};return t.forEach(function(r,i){e[r]=!0;}),e}function ji(t,e,r){if(t.customInspect&&e&&Mi(e.inspect)&&e.inspect!==se.inspect&&!(e.constructor&&e.constructor.prototype===e)){var i=e.inspect(r,t);return Fi(i)||(i=ji(t,i,r)),i}var s=ak(t,e);if(s)return s;var a=Object.keys(e),n=sk(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),_i(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return ao(e);if(a.length===0){if(Mi(e)){var o=e.name?": "+e.name:"";return t.stylize("[Function"+o+"]","special")}if(ki(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(lo(e))return t.stylize(Date.prototype.toString.call(e),"date");if(_i(e))return ao(e)}var l="",u=!1,p=["{","}"];if(Sf(e)&&(u=!0,p=["[","]"]),Mi(e)){var S=e.name?": "+e.name:"";l=" [Function"+S+"]";}if(ki(e)&&(l=" "+RegExp.prototype.toString.call(e)),lo(e)&&(l=" "+Date.prototype.toUTCString.call(e)),_i(e)&&(l=" "+ao(e)),a.length===0&&(!u||e.length==0))return p[0]+l+p[1];if(r<0)return ki(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return u?E=nk(t,e,r,n,a):E=a.map(function(v){return oo(t,e,r,n,v,u)}),t.seen.pop(),ok(E,l,p)}function ak(t,e){if(ze(e))return t.stylize("undefined","undefined");if(Fi(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(xf(e))return t.stylize(""+e,"number");if(uo(e))return t.stylize(""+e,"boolean");if(Bi(e))return t.stylize("null","null")}function ao(t){return "["+Error.prototype.toString.call(t)+"]"}function nk(t,e,r,i,s){for(var a=[],n=0,o=e.length;n-1&&(a?o=o.split(`
+`).map(function(u){return " "+u}).join(`
+`).substr(2):o=`
+`+o.split(`
+`).map(function(u){return " "+u}).join(`
+`))):o=t.stylize("[Circular]","special")),ze(n)){if(a&&s.match(/^\d+$/))return o;n=JSON.stringify(""+s),n.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=t.stylize(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),n=t.stylize(n,"string"));}return n+": "+o}function ok(t,e,r){var i=0,s=t.reduce(function(a,n){return i++,n.indexOf(`
+`)>=0&&i++,a+n.replace(/\u001b\[\d\d?m/g,"").length+1},0);return s>60?r[0]+(e===""?"":e+`
+ `)+" "+t.join(`,
+ `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function Sf(t){return Array.isArray(t)}se.isArray=Sf;function uo(t){return typeof t=="boolean"}se.isBoolean=uo;function Bi(t){return t===null}se.isNull=Bi;function lk(t){return t==null}se.isNullOrUndefined=lk;function xf(t){return typeof t=="number"}se.isNumber=xf;function Fi(t){return typeof t=="string"}se.isString=Fi;function uk(t){return typeof t=="symbol"}se.isSymbol=uk;function ze(t){return t===void 0}se.isUndefined=ze;function ki(t){return Ut(t)&&co(t)==="[object RegExp]"}se.isRegExp=ki;function Ut(t){return typeof t=="object"&&t!==null}se.isObject=Ut;function lo(t){return Ut(t)&&co(t)==="[object Date]"}se.isDate=lo;function _i(t){return Ut(t)&&(co(t)==="[object Error]"||t instanceof Error)}se.isError=_i;function Mi(t){return typeof t=="function"}se.isFunction=Mi;function ck(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}se.isPrimitive=ck;se.isBuffer=Tf();function co(t){return Object.prototype.toString.call(t)}function no(t){return t<10?"0"+t.toString(10):t.toString(10)}var pk=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function fk(){var t=new Date,e=[no(t.getHours()),no(t.getMinutes()),no(t.getSeconds())].join(":");return [t.getDate(),pk[t.getMonth()],e].join(" ")}se.log=function(){console.log("%s - %s",fk(),se.format.apply(se,arguments));};se.inherits=bf();se._extend=function(t,e){if(!e||!Ut(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};function Pf(t,e){return Object.prototype.hasOwnProperty.call(t,e)}});var po=A((EB,Ff)=>{var dk=yf()();function gf(t,e){if(t===e)return 0;for(var r=t.length,i=e.length,s=0,a=Math.min(r,i);s=0){var o=s.indexOf(`
+`,n+1);s=s.substring(o+1);}this.stack=s;}}};Me.inherits(re.AssertionError,Error);function wf(t,e){return typeof t=="string"?t.length=0;u--)if(n[u]!==o[u])return !1;for(u=n.length-1;u>=0;u--)if(l=n[u],!qt(t[l],e[l],r,i))return !1;return !0}re.notDeepEqual=function(e,r,i){qt(e,r,!1)&&we(e,r,i,"notDeepEqual",re.notDeepEqual);};re.notDeepStrictEqual=Mf;function Mf(t,e,r){qt(t,e,!0)&&we(t,e,r,"notDeepStrictEqual",Mf);}re.strictEqual=function(e,r,i){e!==r&&we(e,r,i,"===",re.strictEqual);};re.notStrictEqual=function(e,r,i){e===r&&we(e,r,i,"!==",re.notStrictEqual);};function Cf(t,e){if(!t||!e)return !1;if(Object.prototype.toString.call(e)=="[object RegExp]")return e.test(t);try{if(t instanceof e)return !0}catch{}return Error.isPrototypeOf(e)?!1:e.call({},t)===!0}function bk(t){var e;try{t();}catch(r){e=r;}return e}function jf(t,e,r,i){var s;if(typeof e!="function")throw new TypeError('"block" argument must be a function');typeof r=="string"&&(i=r,r=null),s=bk(e),i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),t&&!s&&we(s,r,"Missing expected exception"+i);var a=typeof i=="string",n=!t&&Me.isError(s),o=!t&&s&&!r;if((n&&a&&Cf(s,r)||o)&&we(s,r,"Got unwanted exception"+i),t&&s&&r&&!Cf(s,r)||!t&&s)throw s}re.throws=function(t,e,r){jf(!0,t,e,r);};re.doesNotThrow=function(t,e,r){jf(!1,t,e,r);};re.ifError=function(t){if(t)throw t};function Bf(t,e){t||we(t,!0,e,"==",Bf);}re.strict=dk(Bf,re,{equal:re.strictEqual,deepEqual:re.deepStrictEqual,notEqual:re.notStrictEqual,notDeepEqual:re.notDeepStrictEqual});re.strict.strict=re.strict;var Df=Object.keys||function(t){var e=[];for(var r in t)hk.call(t,r)&&e.push(r);return e};});var qf=A(Ui=>{Object.defineProperty(Ui,"__esModule",{value:!0});Ui.default=void 0;var je=po(),Sk=ve(),{callExpression:fo,cloneNode:Ri,expressionStatement:Rf,identifier:Or,importDeclaration:xk,importDefaultSpecifier:Pk,importNamespaceSpecifier:Ek,importSpecifier:gk,memberExpression:ho,stringLiteral:Uf,variableDeclaration:Ak,variableDeclarator:vk}=Sk,yo=class{constructor(e,r,i){this._statements=[],this._resultName=null,this._importedSource=void 0,this._scope=r,this._hub=i,this._importedSource=e;}done(){return {statements:this._statements,resultName:this._resultName}}import(){return this._statements.push(xk([],Uf(this._importedSource))),this}require(){return this._statements.push(Rf(fo(Or("require"),[Uf(this._importedSource)]))),this}namespace(e="namespace"){let r=this._scope.generateUidIdentifier(e),i=this._statements[this._statements.length-1];return je(i.type==="ImportDeclaration"),je(i.specifiers.length===0),i.specifiers=[Ek(r)],this._resultName=Ri(r),this}default(e){let r=this._scope.generateUidIdentifier(e),i=this._statements[this._statements.length-1];return je(i.type==="ImportDeclaration"),je(i.specifiers.length===0),i.specifiers=[Pk(r)],this._resultName=Ri(r),this}named(e,r){if(r==="default")return this.default(e);let i=this._scope.generateUidIdentifier(e),s=this._statements[this._statements.length-1];return je(s.type==="ImportDeclaration"),je(s.specifiers.length===0),s.specifiers=[gk(i,Or(r))],this._resultName=Ri(i),this}var(e){let r=this._scope.generateUidIdentifier(e),i=this._statements[this._statements.length-1];return i.type!=="ExpressionStatement"&&(je(this._resultName),i=Rf(this._resultName),this._statements.push(i)),this._statements[this._statements.length-1]=Ak("var",[vk(r,i.expression)]),this._resultName=Ri(r),this}defaultInterop(){return this._interop(this._hub.addHelper("interopRequireDefault"))}wildcardInterop(){return this._interop(this._hub.addHelper("interopRequireWildcard"))}_interop(e){let r=this._statements[this._statements.length-1];return r.type==="ExpressionStatement"?r.expression=fo(e,[r.expression]):r.type==="VariableDeclaration"?(je(r.declarations.length===1),r.declarations[0].init=fo(e,[r.declarations[0].init])):je.fail("Unexpected type."),this}prop(e){let r=this._statements[this._statements.length-1];return r.type==="ExpressionStatement"?r.expression=ho(r.expression,Or(e)):r.type==="VariableDeclaration"?(je(r.declarations.length===1),r.declarations[0].init=ho(r.declarations[0].init,Or(e))):je.fail("Unexpected type:"+r.type),this}read(e){this._resultName=ho(this._resultName,Or(e));}};Ui.default=yo;});var To=A(mo=>{Object.defineProperty(mo,"__esModule",{value:!0});mo.default=Ik;function Ik(t){return t.node.sourceType==="module"}});var Vf=A(qi=>{Object.defineProperty(qi,"__esModule",{value:!0});qi.default=void 0;var Kf=po(),wk=ve(),Ok=qf(),Nk=To(),{numericLiteral:Ck,sequenceExpression:Dk}=wk,bo=class{constructor(e,r,i){this._defaultOpts={importedSource:null,importedType:"commonjs",importedInterop:"babel",importingInterop:"babel",ensureLiveReference:!1,ensureNoContext:!1,importPosition:"before"};let s=e.find(a=>a.isProgram());this._programPath=s,this._programScope=s.scope,this._hub=s.hub,this._defaultOpts=this._applyDefaults(r,i,!0);}addDefault(e,r){return this.addNamed("default",e,r)}addNamed(e,r,i){return Kf(typeof e=="string"),this._generateImport(this._applyDefaults(r,i),e)}addNamespace(e,r){return this._generateImport(this._applyDefaults(e,r),null)}addSideEffect(e,r){return this._generateImport(this._applyDefaults(e,r),void 0)}_applyDefaults(e,r,i=!1){let s;return typeof e=="string"?s=Object.assign({},this._defaultOpts,{importedSource:e},r):(Kf(!r,"Unexpected secondary arguments."),s=Object.assign({},this._defaultOpts,e)),!i&&r&&(r.nameHint!==void 0&&(s.nameHint=r.nameHint),r.blockHoist!==void 0&&(s.blockHoist=r.blockHoist)),s}_generateImport(e,r){let i=r==="default",s=!!r&&!i,a=r===null,{importedSource:n,importedType:o,importedInterop:l,importingInterop:u,ensureLiveReference:p,ensureNoContext:S,nameHint:E,importPosition:v,blockHoist:I}=e,N=E||r,M=(0, Nk.default)(this._programPath),j=M&&u==="node",R=M&&u==="babel";if(v==="after"&&!M)throw new Error('"importPosition": "after" is only supported in modules');let k=new Ok.default(n,this._programScope,this._hub);if(o==="es6"){if(!j&&!R)throw new Error("Cannot import an ES6 module from CommonJS");k.import(),a?k.namespace(E||n):(i||s)&&k.named(N,r);}else {if(o!=="commonjs")throw new Error(`Unexpected interopType "${o}"`);if(l==="babel")if(j){N=N!=="default"?N:n;let ne=`${n}$es6Default`;k.import(),a?k.default(ne).var(N||n).wildcardInterop():i?p?k.default(ne).var(N||n).defaultInterop().read("default"):k.default(ne).var(N).defaultInterop().prop(r):s&&k.default(ne).read(r);}else R?(k.import(),a?k.namespace(N||n):(i||s)&&k.named(N,r)):(k.require(),a?k.var(N||n).wildcardInterop():(i||s)&&p?i?(N=N!=="default"?N:n,k.var(N).read(r),k.defaultInterop()):k.var(n).read(r):i?k.var(N).defaultInterop().prop(r):s&&k.var(N).prop(r));else if(l==="compiled")j?(k.import(),a?k.default(N||n):(i||s)&&k.default(n).read(N)):R?(k.import(),a?k.namespace(N||n):(i||s)&&k.named(N,r)):(k.require(),a?k.var(N||n):(i||s)&&(p?k.var(n).read(N):k.prop(r).var(N)));else if(l==="uncompiled"){if(i&&p)throw new Error("No live reference for commonjs default");j?(k.import(),a?k.default(N||n):i?k.default(N):s&&k.default(n).read(N)):R?(k.import(),a?k.default(N||n):i?k.default(N):s&&k.named(N,r)):(k.require(),a?k.var(N||n):i?k.var(N):s&&(p?k.var(n).read(N):k.var(N).prop(r)));}else throw new Error(`Unknown importedInterop "${l}".`)}let{statements:$,resultName:oe}=k.done();return this._insertStatements($,v,I),(i||s)&&S&&oe.type!=="Identifier"?Dk([Ck(0),oe]):oe}_insertStatements(e,r="before",i=3){let s=this._programPath.get("body");if(r==="after"){for(let a=s.length-1;a>=0;a--)if(s[a].isImportDeclaration()){s[a].insertAfter(e);return}}else {e.forEach(n=>{n._blockHoist=i;});let a=s.find(n=>{let o=n.node._blockHoist;return Number.isFinite(o)&&o<4});if(a){a.insertBefore(e);return}}this._programPath.unshiftContainer("body",e);}};qi.default=bo;});var So=A(ot=>{Object.defineProperty(ot,"__esModule",{value:!0});Object.defineProperty(ot,"ImportInjector",{enumerable:!0,get:function(){return Nr.default}});ot.addDefault=kk;ot.addNamed=_k;ot.addNamespace=Mk;ot.addSideEffect=jk;Object.defineProperty(ot,"isModule",{enumerable:!0,get:function(){return Lk.default}});var Nr=Vf(),Lk=To();function kk(t,e,r){return new Nr.default(t).addDefault(e,r)}function _k(t,e,r,i){return new Nr.default(t).addNamed(e,r,i)}function Mk(t,e,r){return new Nr.default(t).addNamespace(e,r)}function jk(t,e,r){return new Nr.default(t).addSideEffect(e,r)}});var Yf=A((wB,Bk)=>{Bk.exports=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];});var Jf=A((OB,Xf)=>{Xf.exports=Yf();});var $f=A((NB,Fk)=>{Fk.exports=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"];});var zf=A((CB,Wf)=>{Wf.exports=$f();});var hd=A((LB,dd)=>{function m_(t,e){for(;t.lengthe in t?Rk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qf=(t,e)=>{for(var r in e||(e={}))Kk.call(e,r)&&Gf(t,r,e[r]);if(Hf)for(var r of Hf(e))Vk.call(e,r)&&Gf(t,r,e[r]);return t},Yk=(t,e)=>Uk(t,qk(e)),od=(t=>(t[t.STABLE=1]="STABLE",t[t.DYNAMIC=2]="DYNAMIC",t[t.FORWARDED=3]="FORWARDED",t))(od||{}),vo=od,Ki="Fragment",Xk="KeepAlive",Ee=(t,e)=>t.get(e)(),Zf=t=>t.startsWith("v-")||t.startsWith("v")&&t.length>=2&&t[1]>="A"&&t[1]<="Z",ed=t=>!(t.match(RegExp(`^_?${Ki}\\d*$`))||t===Xk),Jk=(t,e)=>{var r,i;let s=t.get("name");if(s.isJSXMemberExpression())return ed(s.node.property.name);let a=s.node.name;return !((i=(r=e.opts).isCustomElement)!=null&&i.call(r,a))&&ed(a)&&!go.default.includes(a)&&!Ao.default.includes(a)},ld=t=>{let e=t.node.object,r=t.node.property,i=V.isJSXMemberExpression(e)?ld(t.get("object")):V.isJSXIdentifier(e)?V.identifier(e.name):V.nullLiteral(),s=V.identifier(r.name);return V.memberExpression(i,s)},$k=(t,e)=>{var r,i;let s=t.get("openingElement").get("name");if(s.isJSXIdentifier()){let{name:a}=s.node;return !go.default.includes(a)&&!Ao.default.includes(a)?a===Ki?Ee(e,Ki):t.scope.hasBinding(a)?V.identifier(a):(i=(r=e.opts).isCustomElement)!=null&&i.call(r,a)?V.stringLiteral(a):V.callExpression(Ee(e,"resolveComponent"),[V.stringLiteral(a)]):V.stringLiteral(a)}if(s.isJSXMemberExpression())return ld(s);throw new Error(`getTag: ${s.type} is not supported`)},Wk=t=>{let e=t.node.name;return V.isJSXIdentifier(e)?e.name:`${e.namespace.name}:${e.name.name}`},zk=t=>{let e=ud(t.node.value);return e!==""?V.stringLiteral(e):null},ud=t=>{let e=t.split(/\r\n|\n|\r/),r=0;for(let s=0;st.get("expression").node,Hk=t=>V.spreadElement(t.get("expression").node),Io=(t,e,r)=>{t.scope.hasBinding(e)&&t.parentPath&&(V.isJSXElement(t.parentPath.node)&&t.parentPath.setData("slotFlag",r),Io(t.parentPath,e,r));},xo=(t,e)=>{let{parentPath:r}=t;if(r.isAssignmentExpression()){let{left:i}=r.node;if(V.isIdentifier(i))return e.map(s=>{if(V.isIdentifier(s)&&s.name===i.name){let a=t.scope.generateUidIdentifier(s.name);return r.insertBefore(V.variableDeclaration("const",[V.variableDeclarator(a,V.callExpression(V.functionExpression(null,[],V.blockStatement([V.returnStatement(s)])),[]))])),a}return s})}return e},Gk=/^on[^a-z]/,Qk=t=>Gk.test(t),Zk=(t,e)=>{V.isArrayExpression(t.value)?t.value.elements.push(e.value):t.value=V.arrayExpression([t.value,e.value]);},Po=(t=[],e)=>{if(!e)return t;let r=new Map,i=[];return t.forEach(s=>{if(V.isStringLiteral(s.key)){let{value:a}=s.key,n=r.get(a);n?(a==="style"||a==="class"||a.startsWith("on"))&&Zk(n,s):(r.set(a,s),i.push(s));}else i.push(s);}),i},Eo=t=>{if(V.isIdentifier(t))return t.name==="undefined";if(V.isArrayExpression(t)){let{elements:e}=t;return e.every(r=>r&&Eo(r))}return V.isObjectExpression(t)?t.properties.every(e=>Eo(e.value)):!!V.isLiteral(t)},e_=(t,e,r,i)=>{let s=e.get("argument"),a=V.isObjectExpression(s.node)?s.node.properties:void 0;a?r?i.push(V.objectExpression(a)):i.push(...a):(s.isIdentifier()&&Io(t,s.node.name,vo.DYNAMIC),i.push(r?s.node:V.spreadElement(s.node)));},t_=t=>{let e=t.get("attributes").find(r=>r.isJSXAttribute()?r.get("name").isJSXIdentifier()&&r.get("name").node.name==="type":!1);return e?e.get("value").node:null},td=t=>ie.isArrayExpression(t)?t.elements.map(e=>ie.isStringLiteral(e)?e.value:"").filter(Boolean):[],r_=t=>{var e,r;let{path:i,value:s,state:a,tag:n,isComponent:o}=t,l=[],u=[],p=[],S,E,v;if("namespace"in i.node.name)[S,E]=t.name.split(":"),S=i.node.name.namespace.name,E=i.node.name.name.name,v=E.split("_").slice(1);else {let R=t.name.split("_");S=R.shift()||"",v=R;}S=S.replace(/^v/,"").replace(/^-/,"").replace(/^\S/,R=>R.toLowerCase()),E&&l.push(ie.stringLiteral(E.split("_")[0]));let I=S==="models",N=S==="model";if(N&&!i.get("value").isJSXExpressionContainer())throw new Error("You have to use JSX Expression inside your v-model");if(I&&!o)throw new Error("v-models can only use in custom components");let M=!["html","text","model","models"].includes(S)||N&&!o,j=v;return ie.isArrayExpression(s)?(I?s.elements:[s]).forEach(k=>{if(I&&!ie.isArrayExpression(k))throw new Error("You should pass a Two-dimensional Arrays to v-models");let{elements:$}=k,[oe,ne,ut]=$;ne&&!ie.isArrayExpression(ne)&&!ie.isSpreadElement(ne)?(l.push(ne),j=td(ut)):ie.isArrayExpression(ne)?(M||l.push(ie.nullLiteral()),j=td(ne)):M||l.push(ie.nullLiteral()),p.push(new Set(j)),u.push(oe);}):N&&!M?(l.push(ie.nullLiteral()),p.push(new Set(v))):p.push(new Set(v)),{directiveName:S,modifiers:p,values:u.length?u:[s],args:l,directive:M?[i_(i,a,n,S),u[0]||s,(e=p[0])!=null&&e.size?l[0]||ie.unaryExpression("void",ie.numericLiteral(0),!0):l[0],!!((r=p[0])!=null&&r.size)&&ie.objectExpression([...p[0]].map(R=>ie.objectProperty(ie.identifier(R),ie.booleanLiteral(!0))))].filter(Boolean):void 0}},i_=(t,e,r,i)=>{if(i==="show")return Ee(e,"vShow");if(i==="model"){let s,a=t_(t.parentPath);switch(r.value){case"select":s=Ee(e,"vModelSelect");break;case"textarea":s=Ee(e,"vModelText");break;default:if(ie.isStringLiteral(a)||!a)switch(a?.value){case"checkbox":s=Ee(e,"vModelCheckbox");break;case"radio":s=Ee(e,"vModelRadio");break;default:s=Ee(e,"vModelText");}else s=Ee(e,"vModelDynamic");}return s}return ie.callExpression(Ee(e,"resolveDirective"),[ie.stringLiteral(i)])},s_=r_,rd=/^xlink([A-Z])/,a_=(t,e)=>{let r=t.get("value");return r.isJSXElement()?wo(r,e):r.isStringLiteral()?w.stringLiteral(ud(r.node.value)):r.isJSXExpressionContainer()?cd(r):null},n_=(t,e)=>{let r=$k(t,e),i=Jk(t.get("openingElement"),e),s=t.get("openingElement").get("attributes"),a=[],n=new Set,o=null,l=0;if(s.length===0)return {tag:r,isComponent:i,slots:o,props:w.nullLiteral(),directives:a,patchFlag:l,dynamicPropNames:n};let u=[],p=!1,S=!1,E=!1,v=!1,I=!1,N=[],{mergeProps:M=!0}=e.opts;s.forEach(R=>{if(R.isJSXAttribute()){let k=Wk(R),$=a_(R,e);if((!Eo($)||k==="ref")&&(!i&&Qk(k)&&k.toLowerCase()!=="onclick"&&k!=="onUpdate:modelValue"&&(v=!0),k==="ref"?p=!0:k==="class"&&!i?S=!0:k==="style"&&!i?E=!0:k!=="key"&&!Zf(k)&&k!=="on"&&n.add(k)),e.opts.transformOn&&(k==="on"||k==="nativeOn")){e.get("transformOn")||e.set("transformOn",(0, nd.addDefault)(t,"@vue/babel-helper-vue-transform-on",{nameHint:"_transformOn"})),N.push(w.callExpression(e.get("transformOn"),[$||w.booleanLiteral(!0)]));return}if(Zf(k)){let{directive:oe,modifiers:ne,values:ut,args:Vi,directiveName:Cr}=s_({tag:r,isComponent:i,name:k,path:R,state:e,value:$});if(Cr==="slots"){o=$;return}oe?a.push(w.arrayExpression(oe)):Cr==="html"?(u.push(w.objectProperty(w.stringLiteral("innerHTML"),ut[0])),n.add("innerHTML")):Cr==="text"&&(u.push(w.objectProperty(w.stringLiteral("textContent"),ut[0])),n.add("textContent")),["models","model"].includes(Cr)&&ut.forEach((Co,Yi)=>{var Do;let Ne=Vi[Yi],ct=Ne&&!w.isStringLiteral(Ne)&&!w.isNullLiteral(Ne);oe||(u.push(w.objectProperty(w.isNullLiteral(Ne)?w.stringLiteral("modelValue"):Ne,Co,ct)),ct||n.add(Ne?.value||"modelValue"),(Do=ne[Yi])!=null&&Do.size&&u.push(w.objectProperty(ct?w.binaryExpression("+",Ne,w.stringLiteral("Modifiers")):w.stringLiteral(`${Ne?.value||"model"}Modifiers`),w.objectExpression([...ne[Yi]].map(bd=>w.objectProperty(w.stringLiteral(bd),w.booleanLiteral(!0)))),ct)));let Lo=ct?w.binaryExpression("+",w.stringLiteral("onUpdate"),Ne):w.stringLiteral(`onUpdate:${Ne?.value||"modelValue"}`);u.push(w.objectProperty(Lo,w.arrowFunctionExpression([w.identifier("$event")],w.assignmentExpression("=",Co,w.identifier("$event"))),ct)),ct?I=!0:n.add(Lo.value);});}else k.match(rd)&&(k=k.replace(rd,(oe,ne)=>`xlink:${ne.toLowerCase()}`)),u.push(w.objectProperty(w.stringLiteral(k),$||w.booleanLiteral(!0)));}else u.length&&M&&(N.push(w.objectExpression(Po(u,M))),u=[]),I=!0,e_(t,R,M,M?N:u);}),I?l|=16:(S&&(l|=2),E&&(l|=4),n.size&&(l|=8),v&&(l|=32)),(l===0||l===32)&&(p||a.length>0)&&(l|=512);let j=w.nullLiteral();return N.length?(u.length&&N.push(w.objectExpression(Po(u,M))),N.length>1?j=w.callExpression(Ee(e,"mergeProps"),N):j=N[0]):u.length&&(u.length===1&&w.isSpreadElement(u[0])?j=u[0].argument:j=w.objectExpression(Po(u,M))),{tag:r,props:j,isComponent:i,slots:o,directives:a,patchFlag:l,dynamicPropNames:n}},o_=(t,e)=>t.map(r=>{if(r.isJSXText()){let i=zk(r);return i&&w.callExpression(Ee(e,"createTextVNode"),[i])}if(r.isJSXExpressionContainer()){let i=cd(r);if(w.isIdentifier(i)){let{name:s}=i,{referencePaths:a=[]}=r.scope.getBinding(s)||{};a.forEach(n=>{Io(n,s,vo.DYNAMIC);});}return i}if(r.isJSXSpreadChild())return Hk(r);if(r.isCallExpression())return r.node;if(r.isJSXElement())return wo(r,e);throw new Error(`getChildren: ${r.type} is not supported`)}).filter(r=>r!=null&&!w.isJSXEmptyExpression(r)),wo=(t,e)=>{let r=o_(t.get("children"),e),{tag:i,props:s,isComponent:a,directives:n,patchFlag:o,dynamicPropNames:l,slots:u}=n_(t,e),{optimize:p=!1}=e.opts,S=t.getData("slotFlag")||vo.STABLE,E;if(r.length>1||u)E=a?r.length?w.objectExpression([!!r.length&&w.objectProperty(w.identifier("default"),w.arrowFunctionExpression([],w.arrayExpression(xo(t,r)))),...u?w.isObjectExpression(u)?u.properties:[w.spreadElement(u)]:[],p&&w.objectProperty(w.identifier("_"),w.numericLiteral(S))].filter(Boolean)):u:w.arrayExpression(r);else if(r.length===1){let{enableObjectSlots:I=!0}=e.opts,N=r[0],M=w.objectExpression([w.objectProperty(w.identifier("default"),w.arrowFunctionExpression([],w.arrayExpression(xo(t,[N])))),p&&w.objectProperty(w.identifier("_"),w.numericLiteral(S))].filter(Boolean));if(w.isIdentifier(N)&&a)E=I?w.conditionalExpression(w.callExpression(e.get("@vue/babel-plugin-jsx/runtimeIsSlot")(),[N]),N,M):M;else if(w.isCallExpression(N)&&N.loc&&a)if(I){let{scope:j}=t,R=j.generateUidIdentifier("slot");j&&j.push({id:R,kind:"let"});let k=w.objectExpression([w.objectProperty(w.identifier("default"),w.arrowFunctionExpression([],w.arrayExpression(xo(t,[R])))),p&&w.objectProperty(w.identifier("_"),w.numericLiteral(S))].filter(Boolean)),$=w.assignmentExpression("=",R,N),oe=w.callExpression(e.get("@vue/babel-plugin-jsx/runtimeIsSlot")(),[$]);E=w.conditionalExpression(oe,R,k);}else E=M;else w.isFunctionExpression(N)||w.isArrowFunctionExpression(N)?E=w.objectExpression([w.objectProperty(w.identifier("default"),N)]):w.isObjectExpression(N)?E=w.objectExpression([...N.properties,p&&w.objectProperty(w.identifier("_"),w.numericLiteral(S))].filter(Boolean)):E=a?w.objectExpression([w.objectProperty(w.identifier("default"),w.arrowFunctionExpression([],w.arrayExpression([N])))]):w.arrayExpression([N]);}let v=w.callExpression(Ee(e,"createVNode"),[i,s,E||w.nullLiteral(),!!o&&p&&w.numericLiteral(o),!!l.size&&p&&w.arrayExpression([...l.keys()].map(I=>w.stringLiteral(I)))].filter(Boolean));return n.length?w.callExpression(Ee(e,"withDirectives"),[v,w.arrayExpression(n)]):v},l_={JSXElement:{exit(t,e){t.replaceWith(wo(t,e));}}},u_=l_,c_=(t,e)=>{let r=t.get("children")||[];return Oe.jsxElement(Oe.jsxOpeningElement(e,[]),Oe.jsxClosingElement(e),r.map(({node:i})=>i),!1)},p_={JSXFragment:{enter(t,e){let r=Ee(e,Ki);t.replaceWith(c_(t,Oe.isIdentifier(r)?Oe.jsxIdentifier(r.name):Oe.jsxMemberExpression(Oe.jsxIdentifier(r.object.name),Oe.jsxIdentifier(r.property.name))));}}},f_=p_,d_=t=>{let e=!1;return t.traverse({JSXElement(r){e=!0,r.stop();},JSXFragment(r){e=!0,r.stop();}}),e},h_=/\*?\s*@jsx\s+([^\s]+)/;function Oo(t){return t.default||t}var y_=Oo(ad.default),id=Oo(sd.default),pd=({types:t})=>({name:"babel-plugin-jsx",inherits:Oo(y_),visitor:Yk(Qf(Qf({},u_),f_),{Program:{enter(e,r){if(d_(e)){let i=["createVNode","Fragment","resolveComponent","withDirectives","vShow","vModelSelect","vModelText","vModelCheckbox","vModelRadio","vModelText","vModelDynamic","resolveDirective","mergeProps","createTextVNode","isVNode"];if((0, Kt.isModule)(e)){let n={};i.forEach(l=>{r.set(l,()=>{if(n[l])return t.cloneNode(n[l]);let u=(0, Kt.addNamed)(e,l,"vue",{ensureLiveReference:!0});return n[l]=u,u});});let{enableObjectSlots:o=!0}=r.opts;o&&r.set("@vue/babel-plugin-jsx/runtimeIsSlot",()=>{if(n.runtimeIsSlot)return n.runtimeIsSlot;let{name:l}=r.get("isVNode")(),u=e.scope.generateUidIdentifier("isSlot"),p=id.ast`
+ function ${u.name}(s) {
+ return typeof s === 'function' || (Object.prototype.toString.call(s) === '[object Object]' && !${l}(s));
+ }
+ `,S=e.get("body").filter(E=>E.isImportDeclaration()).pop();return S&&S.insertAfter(p),n.runtimeIsSlot=u,u});}else {let n;i.forEach(u=>{r.set(u,()=>(n||(n=(0, Kt.addNamespace)(e,"vue",{ensureLiveReference:!0})),he.memberExpression(n,he.identifier(u))));});let o={},{enableObjectSlots:l=!0}=r.opts;l&&r.set("@vue/babel-plugin-jsx/runtimeIsSlot",()=>{if(o.runtimeIsSlot)return o.runtimeIsSlot;let u=e.scope.generateUidIdentifier("isSlot"),{object:p}=r.get("isVNode")(),S=id.ast`
+ function ${u.name}(s) {
+ return typeof s === 'function' || (Object.prototype.toString.call(s) === '[object Object]' && !${p.name}.isVNode(s));
+ }
+ `,v=e.get("body").filter(I=>I.isVariableDeclaration()&&I.node.declarations.some(N=>{var M;return ((M=N.id)==null?void 0:M.name)===n.name})).pop();return v&&v.insertAfter(S),u});}let{opts:{pragma:s=""},file:a}=r;if(s&&r.set("createVNode",()=>he.identifier(s)),a.ast.comments)for(let n of a.ast.comments){let o=h_.exec(n.value);o&&r.set("createVNode",()=>he.identifier(o[1]));}}},exit(e){let r=e.get("body"),i=new Map;r.filter(a=>he.isImportDeclaration(a.node)&&a.node.source.value==="vue").forEach(a=>{let{specifiers:n}=a.node,o=!1;n.forEach(l=>{!l.loc&&he.isImportSpecifier(l)&&he.isIdentifier(l.imported)&&(i.set(l.imported.name,l),o=!0);}),o&&a.remove();});let s=[...i.keys()].map(a=>i.get(a));s.length&&e.unshiftContainer("body",he.importDeclaration(s,he.stringLiteral("vue")));}}})});var md=Ce(hd());function No(t){let[,e,r]=t.match(/([^.]+)\.([^.]+)$/)||[];return {basename:e,lang:r}}var lt="__sfc__";function yd({babel:t,availablePlugins:e={},availablePresets:r={}}){function i(l){return t.transformSync(l,{presets:[[r.env??"env",{modules:"cjs"}]]})}function s(l,u,p={}){let{lang:S,plugins:E=[],presets:v=[]}=p;if(S==="ts"||S==="tsx"){let M=S==="tsx";v.push([r.typescript??"typescript",{isTSX:M,allExtensions:M,onlyRemoveTypeImports:!0}]);}(S==="tsx"||S==="jsx")&&E.push(e["vue-jsx"]??"vue-jsx");let{basename:I}=No(u);return t.transformSync(l,{filename:I+"."+(S||"ts"),presets:v,plugins:E})?.code||""}function a(l,u,p,S){let{filename:E,template:v,scriptSetup:I,script:N}=u,M=v?.content,j=!!I,R=S==="ts"||S==="tsx",k=[];R&&k.push("typescript"),(S==="jsx"||S==="tsx")&&k.push("jsx");let $="";if(N||I)try{let{content:oe}=compileScript(u,{id:l,inlineTemplate:j,templateOptions:{compilerOptions:{expressionPlugins:k}}});$=s(rewriteDefault(oe,lt,k),E,{lang:S});}catch(oe){return [oe]}else $=`const ${lt} = {};`;if(!j&&M){let{code:oe,errors:ne}=compileTemplate({id:l,filename:E,source:M,scoped:p,compilerOptions:{expressionPlugins:k}});if(ne.length)return ne;oe=s(oe,E,{lang:S}),$+=`
+${oe.replace(/\nexport (function|const) render/,"$1 render")}
+ ${lt}.render = render;`;}return $}function n(l,u){let{filename:p}=u,S=[];for(let E of u.styles){let{code:v,errors:I}=compileStyle({source:E.content,filename:p,id:l,scoped:E.scoped});if(I.length)return I;S.push(v);}return S.join(`
+`)}function o(l){let{id:u,code:p,filename:S}=l,{descriptor:E,errors:v}=parse(p,{filename:S});if(v.length)return v;let I="",N=!1;(E.styles.some($=>$.lang)||E.template&&E.template.lang)&&(N=!0,I+=`
+console.warn("Custom preprocessors for and `);},1);let r=createApp(e);return r.config.errorHandler=t=>console.error(t),r.mount(s),()=>{r.unmount();}},l=_;
+
+export { l as default };
diff --git a/suites/preset-vue/lib/runtimePlugin.mjs b/suites/preset-vue/lib/runtimePlugin.mjs
new file mode 100644
index 0000000000..73d5e56b89
--- /dev/null
+++ b/suites/preset-vue/lib/runtimePlugin.mjs
@@ -0,0 +1,53 @@
+var m="vue demo",B="An auto-generated vue demo by dumi",D=(e,t,n)=>`
+
+
+
+
+
+
+ ${e}
+
+
+
+
+ `,
+ filename: 'xx.vue',
+ }),
+ ).toMatchSnapshot();
+ });
+ test('script setup + template', () => {
+ expect(
+ compileSFC({
+ id: 'xx',
+ code: `
+
+
+
+
+ `,
+ filename: 'xx.vue',
+ }),
+ ).toMatchSnapshot();
+ });
+
+ test('two script tags', () => {
+ expect(
+ compileSFC({
+ id: 'xx',
+ code: `
+
+
+
+
+
+ `,
+ filename: 'xx.vue',
+ }),
+ ).toMatchSnapshot();
+ });
+
+ test('script setup + ts', () => {
+ expect(
+ compileSFC({
+ id: 'xx',
+ code: `
+
+
+ {{msg}}
+
+ `,
+ filename: 'xx.vue',
+ }),
+ ).toMatchSnapshot();
+ });
+
+ test('script setup + tsx', () => {
+ expect(
+ compileSFC({
+ id: 'xx',
+ code: `
+
+ `,
+ filename: 'xx.vue',
+ }),
+ ).toMatchSnapshot();
+ });
+
+ test('script options + jsx', () => {
+ expect(
+ compileSFC({
+ id: 'xx',
+ code: `
+
+ `,
+ filename: 'xx.vue',
+ }),
+ ).toMatchSnapshot();
+ });
+
+ test('scoped style', () => {
+ expect(
+ compileSFC({
+ id: 'xx',
+ code: `
+
+
+
+ hi
+
+ `,
+ filename: 'xx.vue',
+ }),
+ ).toMatchSnapshot();
+ });
+
+ test('template only', () => {
+ expect(
+ compileSFC({
+ id: 'xx',
+ code: `
+
+ template only
+
+ `,
+ filename: 'xx.vue',
+ }),
+ ).toMatchSnapshot();
+ });
+
+ test('custom preprocessors are not supported', () => {
+ expect(
+ compileSFC({
+ id: 'xx',
+ code: `
+
+
+ custom preprocessors are not supported
+
+ `,
+ filename: 'xx.vue',
+ }),
+ ).toMatchSnapshot();
+ });
+});
diff --git a/suites/preset-vue/src/compiler/browser.ts b/suites/preset-vue/src/compiler/browser.ts
new file mode 100644
index 0000000000..edde367e8b
--- /dev/null
+++ b/suites/preset-vue/src/compiler/browser.ts
@@ -0,0 +1,47 @@
+import * as Babel from '@babel/standalone';
+import jsx from '@vue/babel-plugin-jsx';
+import hashId from 'hash-sum';
+import { COMP_IDENTIFIER, createCompiler, resolveFilename } from './index';
+
+const { compileSFC, transformTS, toCommonJS } = createCompiler({
+ babel: {
+ // @ts-ignore
+ transformSync(...args) {
+ if (typeof window !== undefined && 'Babel' in window) {
+ // @ts-ignore
+ return Babel.transform(...args);
+ }
+ console.error('@babel/standablone is loading!');
+ return null;
+ },
+ },
+ availablePlugins: {
+ 'vue-jsx': jsx,
+ },
+});
+
+export default function compile(
+ code: string,
+ { filename }: { filename: string },
+) {
+ const { lang } = resolveFilename(filename);
+ if (['js', 'jsx', 'ts', 'tsx'].includes(lang)) {
+ return transformTS(code, filename, {
+ lang,
+ presets: [['env', { modules: 'cjs' }]],
+ });
+ }
+ const id = hashId(code);
+ const compiled = compileSFC({ id, filename, code });
+
+ if (Array.isArray(compiled)) {
+ throw compiled[0];
+ }
+ let { js, css } = compiled;
+ if (css) {
+ js += `\n${COMP_IDENTIFIER}.__css__ = ${JSON.stringify(css)};`;
+ }
+ js += `\n${COMP_IDENTIFIER}.__id__ = "${id}";
+ export default ${COMP_IDENTIFIER};`;
+ return toCommonJS(js)?.code || '';
+}
diff --git a/suites/preset-vue/src/compiler/index.ts b/suites/preset-vue/src/compiler/index.ts
new file mode 100644
index 0000000000..c45526e6a2
--- /dev/null
+++ b/suites/preset-vue/src/compiler/index.ts
@@ -0,0 +1,224 @@
+import type { BabelCore, babelCore } from 'dumi/bundler-utils';
+import {
+ CompilerError,
+ CompilerOptions,
+ SFCDescriptor,
+ compileScript,
+ compileStyle,
+ compileTemplate,
+ parse,
+ rewriteDefault,
+} from 'vue/compiler-sfc';
+
+export interface CompileOptions {
+ id: string;
+ filename: string;
+ code: string;
+}
+
+export type CompileResult =
+ | (string | CompilerError | SyntaxError)[]
+ | {
+ js: string;
+ css: string;
+ };
+
+export function resolveFilename(filename: string) {
+ const [, basename, lang] = filename.match(/([^.]+)\.([^.]+)$/) || [];
+ return { basename, lang };
+}
+type Plugins = Record;
+
+type CreateCompilerContext = {
+ babel: ReturnType;
+ availablePlugins?: Plugins;
+ availablePresets?: Plugins;
+};
+
+export const COMP_IDENTIFIER = '__sfc__';
+
+export function createCompiler({
+ babel,
+ availablePlugins = {},
+ availablePresets = {},
+}: CreateCompilerContext) {
+ function toCommonJS(es: string) {
+ return babel.transformSync(es, {
+ presets: [[availablePresets['env'] ?? 'env', { modules: 'cjs' }]],
+ });
+ }
+
+ function transformTS(
+ src: string,
+ filename: string,
+ options: {
+ lang?: string;
+ plugins?: BabelCore.PluginItem[];
+ presets?: BabelCore.PluginItem[];
+ } = {},
+ ) {
+ const { lang, plugins = [], presets = [] } = options;
+ if (lang === 'ts' || lang === 'tsx') {
+ const isTSX = lang === 'tsx';
+ presets.push([
+ availablePresets['typescript'] ?? 'typescript',
+ { isTSX, allExtensions: isTSX, onlyRemoveTypeImports: true },
+ ]);
+ }
+ if (lang === 'tsx' || lang === 'jsx') {
+ plugins.push(availablePlugins['vue-jsx'] ?? 'vue-jsx');
+ }
+
+ const { basename } = resolveFilename(filename);
+ const result = babel.transformSync(src, {
+ filename: basename + '.' + (lang || 'ts'),
+ presets,
+ plugins,
+ });
+ return result?.code || '';
+ }
+
+ function doCompileScript(
+ id: string,
+ descriptor: SFCDescriptor,
+ hasScoped: boolean,
+ lang?: string,
+ ) {
+ const { filename, template, scriptSetup, script } = descriptor;
+ const templateContent = template?.content;
+
+ const hasSetup = !!scriptSetup;
+
+ const isTS = lang === 'ts' || lang === 'tsx';
+
+ const expressionPlugins: CompilerOptions['expressionPlugins'] = [];
+ if (isTS) expressionPlugins.push('typescript');
+ if (lang === 'jsx' || lang === 'tsx') expressionPlugins.push('jsx');
+
+ let sfcCode = '';
+ if (script || scriptSetup) {
+ try {
+ const { content } = compileScript(descriptor, {
+ id,
+ inlineTemplate: hasSetup,
+ templateOptions: {
+ compilerOptions: { expressionPlugins },
+ },
+ });
+ sfcCode = transformTS(
+ rewriteDefault(content, COMP_IDENTIFIER, expressionPlugins),
+ filename,
+ { lang },
+ );
+ } catch (error) {
+ return [error] as CompilerError[];
+ }
+ } else {
+ sfcCode = `const ${COMP_IDENTIFIER} = {};`;
+ }
+ if (!hasSetup && templateContent) {
+ let { code, errors } = compileTemplate({
+ id,
+ filename,
+ source: templateContent,
+ scoped: hasScoped,
+ compilerOptions: { expressionPlugins },
+ });
+
+ if (errors.length) {
+ return errors;
+ }
+
+ code = transformTS(code, filename, { lang });
+ sfcCode += `\n${code.replace(
+ /\nexport (function|const) render/,
+ `$1 render`,
+ )}
+ ${COMP_IDENTIFIER}.render = render;`;
+ }
+
+ return sfcCode;
+ }
+
+ function doCompileStyle(id: string, descriptor: SFCDescriptor) {
+ const { filename } = descriptor;
+ const styleList: string[] = [];
+ for (const style of descriptor.styles) {
+ const { code, errors } = compileStyle({
+ source: style.content,
+ filename,
+ id,
+ scoped: style.scoped,
+ });
+ if (errors.length) {
+ return errors;
+ }
+ styleList.push(code);
+ }
+ return styleList.join('\n');
+ }
+
+ function compileSFC(options: CompileOptions): CompileResult {
+ const { id, code, filename } = options;
+ const { descriptor, errors } = parse(code, { filename });
+ if (errors.length) {
+ return errors;
+ }
+
+ let js = '';
+ let skipStyleCompile = false;
+ if (
+ descriptor.styles.some((style) => style.lang) ||
+ (descriptor.template && descriptor.template.lang)
+ ) {
+ skipStyleCompile = true;
+ js +=
+ '\nconsole.warn("Custom preprocessors ' +
+ 'for and `,
+ );
+ }, 1);
+ }
+ const app = createApp(component);
+
+ app.config.errorHandler = (e) => console.error(e);
+ app.mount(canvas);
+ return () => {
+ app.unmount();
+ };
+};
+
+export default renderer;
diff --git a/suites/preset-vue/src/vue/runtime/runtimePlugin.ts b/suites/preset-vue/src/vue/runtime/runtimePlugin.ts
new file mode 100644
index 0000000000..c727f3c416
--- /dev/null
+++ b/suites/preset-vue/src/vue/runtime/runtimePlugin.ts
@@ -0,0 +1,26 @@
+import { defaultTitle, getVueApp } from './getPreviewerData';
+
+export function modifyStackBlitzData(memo: any, props: any) {
+ const { title, description } = props;
+ const config = {
+ title: title || defaultTitle,
+ description,
+ template: 'node',
+ files: {},
+ dependencies: {},
+ };
+
+ const files = getVueApp(props);
+
+ config.files = Object.entries(files).reduce((acc, [k, v]) => {
+ acc[k] = v.content;
+ return acc;
+ }, {} as Record);
+ Object.assign(memo, config);
+ return memo;
+}
+
+export function modifyCodeSandboxData(memo: any, props: any) {
+ Object.assign(memo, { files: getVueApp(props) });
+ return memo;
+}
diff --git a/suites/preset-vue/src/vue/techStack/index.ts b/suites/preset-vue/src/vue/techStack/index.ts
new file mode 100644
index 0000000000..07fccfd28d
--- /dev/null
+++ b/suites/preset-vue/src/vue/techStack/index.ts
@@ -0,0 +1,65 @@
+import { BABEL_STANDALONE_CDN, getPkgPath, getPluginPath } from '@/shared';
+import type { IApi } from 'dumi';
+import { fsExtra } from 'dumi/plugin-utils';
+import { join } from 'path';
+import VueJSXTechStack from './jsx';
+import VueSfcTechStack from './sfc';
+
+const COMPILE_FILENAME = 'compiler.mjs';
+const RENDERER_FILENAME = 'renderer.mjs';
+
+export default function registerTechStack(api: IApi) {
+ const vueConfig = api.userConfig?.vue;
+
+ const pkgPath = getPkgPath('@dumijs/preset-vue', api.cwd);
+
+ const libPath = join(pkgPath, '/lib');
+
+ // vue-related runtime files must be placed under .dumi
+ // so that the correct dependencies can be referenced.
+ api.onGenerateFiles(() => {
+ api.writeTmpFile({
+ path: COMPILE_FILENAME,
+ content: fsExtra.readFileSync(join(libPath, COMPILE_FILENAME), 'utf8'),
+ });
+ api.writeTmpFile({
+ path: RENDERER_FILENAME,
+ content: fsExtra.readFileSync(join(libPath, RENDERER_FILENAME), 'utf8'),
+ });
+ });
+
+ const runtimeOpts = {
+ compilePath: getPluginPath(api, COMPILE_FILENAME),
+ rendererPath: getPluginPath(api, RENDERER_FILENAME),
+ pluginPath: join(libPath, 'runtimePlugin.mjs'),
+ };
+
+ // mark @babel/standalone as external
+ api.addHTMLHeadScripts(() => {
+ return [
+ {
+ src: vueConfig?.compiler?.babelStandaloneCDN || BABEL_STANDALONE_CDN,
+ async: true,
+ },
+ ];
+ });
+ api.modifyConfig((memo) => {
+ memo.externals = {
+ ...memo.externals,
+ '@babel/standalone': 'Babel',
+ };
+ return memo;
+ });
+
+ api.register({
+ key: 'registerTechStack',
+ stage: 0,
+ fn: () => new VueJSXTechStack(runtimeOpts),
+ });
+
+ api.register({
+ key: 'registerTechStack',
+ stage: 1,
+ fn: () => new VueSfcTechStack(runtimeOpts),
+ });
+}
diff --git a/suites/preset-vue/src/vue/techStack/jsx.ts b/suites/preset-vue/src/vue/techStack/jsx.ts
new file mode 100644
index 0000000000..c8cf851ae6
--- /dev/null
+++ b/suites/preset-vue/src/vue/techStack/jsx.ts
@@ -0,0 +1,62 @@
+import { compile } from '@/compiler/node';
+import type {
+ IDumiTechStack,
+ IDumiTechStackOnBlockLoadArgs,
+ IDumiTechStackOnBlockLoadResult,
+ IDumiTechStackRuntimeOpts,
+} from 'dumi/tech-stack-utils';
+import { wrapDemoWithFn } from 'dumi/tech-stack-utils';
+import hashId from 'hash-sum';
+import type { Element } from 'hast';
+
+export default class VueJSXTechStack implements IDumiTechStack {
+ name = 'vue3-tsx';
+
+ runtimeOpts!: IDumiTechStackRuntimeOpts;
+
+ constructor(runtimeOpts: IDumiTechStackRuntimeOpts) {
+ this.runtimeOpts = runtimeOpts;
+ }
+
+ isSupported(_: Element, lang: string) {
+ return ['jsx', 'tsx'].includes(lang);
+ }
+
+ onBlockLoad(
+ args: IDumiTechStackOnBlockLoadArgs,
+ ): IDumiTechStackOnBlockLoadResult | null {
+ if (!args.path.endsWith('.tsx') && !args.path.endsWith('.jsx')) return null;
+ const { filename } = args;
+ return {
+ type: 'tsx',
+ content: compile({
+ id: filename,
+ filename,
+ code: args.entryPointCode,
+ }) as string,
+ };
+ }
+
+ transformCode(...[raw, opts]: Parameters) {
+ if (opts.type === 'code-block') {
+ const filename = opts.fileAbsPath;
+
+ const result = compile({
+ id: hashId(raw),
+ filename,
+ code: raw,
+ }) as string;
+
+ if (result) {
+ const code = wrapDemoWithFn(result, {
+ filename,
+ parserConfig: {
+ syntax: 'ecmascript',
+ },
+ });
+ return `(${code})()`;
+ }
+ }
+ return raw;
+ }
+}
diff --git a/suites/preset-vue/src/vue/techStack/sfc.ts b/suites/preset-vue/src/vue/techStack/sfc.ts
new file mode 100644
index 0000000000..0bcaf368b8
--- /dev/null
+++ b/suites/preset-vue/src/vue/techStack/sfc.ts
@@ -0,0 +1,61 @@
+import { compile, compiler } from '@/compiler/node';
+import type {
+ IDumiTechStack,
+ IDumiTechStackOnBlockLoadArgs,
+ IDumiTechStackOnBlockLoadResult,
+ IDumiTechStackRuntimeOpts,
+} from 'dumi/tech-stack-utils';
+import { wrapDemoWithFn } from 'dumi/tech-stack-utils';
+import hashId from 'hash-sum';
+import type { Element } from 'hast';
+import { logger } from 'umi/plugin-utils';
+
+export default class VueSfcTechStack implements IDumiTechStack {
+ name = 'vue3-sfc';
+ runtimeOpts!: IDumiTechStackRuntimeOpts;
+
+ constructor(runtimeOpts: IDumiTechStackRuntimeOpts) {
+ this.runtimeOpts = runtimeOpts;
+ }
+
+ isSupported(_: Element, lang: string) {
+ return ['vue'].includes(lang);
+ }
+
+ onBlockLoad(
+ args: IDumiTechStackOnBlockLoadArgs,
+ ): IDumiTechStackOnBlockLoadResult | null {
+ if (!args.path.endsWith('.vue')) return null;
+ const result = compiler.compileSFC({
+ id: args.path,
+ code: args.entryPointCode,
+ filename: args.filename,
+ });
+ return {
+ type: 'tsx',
+ content: Array.isArray(result) ? '' : result.js,
+ };
+ }
+
+ transformCode(...[raw, opts]: Parameters) {
+ if (opts.type === 'code-block') {
+ const filename = opts.fileAbsPath;
+ const id = hashId(raw);
+
+ const js = compile({ id, filename, code: raw });
+ if (Array.isArray(js)) {
+ logger.error(js);
+ return '';
+ }
+
+ const code = wrapDemoWithFn(js, {
+ filename,
+ parserConfig: {
+ syntax: 'ecmascript',
+ },
+ });
+ return `(${code})()`;
+ }
+ return raw;
+ }
+}
diff --git a/suites/preset-vue/src/vue/webpack/config.ts b/suites/preset-vue/src/vue/webpack/config.ts
new file mode 100644
index 0000000000..4c3fb22b03
--- /dev/null
+++ b/suites/preset-vue/src/vue/webpack/config.ts
@@ -0,0 +1,108 @@
+import type Config from '@umijs/bundler-webpack/compiled/webpack-5-chain';
+import { babelPresetTypeScript } from 'dumi/bundler-utils';
+import type { IApi } from 'umi';
+import VueLoaderPlugin from 'vue-loader/dist/pluginWebpack5.js';
+// Webpack configuration mainly refers to @umijs/preset-vue
+
+export function getConfig(config: Config, api: IApi) {
+ const dumiSrc = api.paths.absSrcPath;
+ const babelInUmi = config.module.rule('src').use('babel-loader').entries();
+
+ // react jsx rules will only include the .dumi directory
+ config.module.rule('jsx-ts-tsx').include.add(dumiSrc).end();
+
+ // Vue3 tsx support
+ config.module
+ .rule('vue-jsx-tsx')
+ .test(/\.(jsx|ts|tsx)$/)
+ .exclude.add(dumiSrc)
+ .end()
+ .use('babel-loader')
+ .loader(babelInUmi.loader)
+ .options({
+ ...babelInUmi.options,
+ presets: [...babelInUmi.options.presets, babelPresetTypeScript()],
+ plugins: [require.resolve('../../../compiled/@vue/babel-plugin-jsx')],
+ });
+
+ config.module.noParse(/^(vue|vue-router|vuex|vuex-router-sync)$/);
+
+ // https://github.com/webpack/webpack/issues/11467#issuecomment-691873586
+ config.module
+ .rule('esm')
+ .type('javascript/auto')
+ .test(/\.m?jsx?$/)
+ .resolve.set('fullySpecified', false);
+
+ config.resolve.extensions.merge(['.vue']).end();
+ config.module
+ .rule('vue')
+ .test(/\.vue$/)
+ .exclude.add(dumiSrc)
+ .end()
+ .use('vue-loader')
+ .loader(require.resolve('vue-loader'))
+ .options({
+ babelParserPlugins: ['jsx', 'classProperties', 'decorators-legacy'],
+ });
+
+ config.plugin('vue-loader-plugin').use(VueLoaderPlugin);
+
+ // https://github.com/vuejs/vue-loader/issues/1435#issuecomment-869074949
+ config.module
+ .rule('vue-style')
+ .test(/\.vue$/)
+ .exclude.add(dumiSrc)
+ .end()
+ .resourceQuery(/type=style/)
+ .sideEffects(true);
+
+ // 兼容 element-ui plus
+ config.module
+ .rule('fix-element-ui-plus')
+ .test(/\.mjs$/)
+ .include.add(/node_modules/)
+ .end()
+ .type('javascript/auto')
+ .resolve.fullySpecified(false);
+
+ // asset
+ config.module.rules.delete('asset');
+
+ const { userConfig } = api;
+
+ const inlineLimit = parseInt(userConfig.inlineLimit || '10000', 10);
+
+ config.module
+ .rule('avif')
+ .test(/\.avif$/)
+ .type('asset')
+ .mimetype('image/avif')
+ .parser({
+ dataUrlCondition: {
+ maxSize: inlineLimit,
+ },
+ });
+ config.module
+ .rule('image')
+ .test(/\.(bmp|gif|jpg|jpeg|png)$/)
+ .type('asset')
+ .parser({
+ dataUrlCondition: {
+ maxSize: inlineLimit,
+ },
+ });
+
+ // TODO: svgo still has problems, temporarily use url-loader and file-loader
+ config.module.rules.delete('svg');
+ config.module
+ .rule('svg')
+ .test(/\.svg$/)
+ .use('url-loader')
+ .loader(require.resolve('@umijs/bundler-webpack/compiled/url-loader'))
+ .options({
+ limit: userConfig.inlineLimit,
+ fallback: require.resolve('@umijs/bundler-webpack/compiled/file-loader'),
+ })
+ .end();
+}
diff --git a/suites/preset-vue/src/vue/webpack/index.ts b/suites/preset-vue/src/vue/webpack/index.ts
new file mode 100644
index 0000000000..58d826fcdb
--- /dev/null
+++ b/suites/preset-vue/src/vue/webpack/index.ts
@@ -0,0 +1,23 @@
+import type Config from '@umijs/bundler-webpack/compiled/webpack-5-chain';
+import type { IApi } from 'umi';
+import { getConfig } from './config';
+
+export default function (api: IApi) {
+ api.modifyConfig((memo) => {
+ const enableMFSU = memo.mfsu !== false;
+ if (enableMFSU) {
+ memo.mfsu = {
+ ...(memo.mfsu || {}),
+ chainWebpack(config: Config) {
+ getConfig(config, api);
+ return config;
+ },
+ };
+ }
+ return memo;
+ });
+
+ api.chainWebpack((memo) => {
+ getConfig(memo, api);
+ });
+}
diff --git a/suites/preset-vue/tsconfig.json b/suites/preset-vue/tsconfig.json
new file mode 100644
index 0000000000..26103f97c1
--- /dev/null
+++ b/suites/preset-vue/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "compilerOptions": {
+ "strict": true,
+ "declaration": true,
+ "skipLibCheck": true,
+ "esModuleInterop": true,
+ "baseUrl": "./",
+ "module": "NodeNext",
+ "paths": {
+ "@/*": ["src/*"]
+ }
+ },
+ "exclude": ["lib/**"]
+}
diff --git a/suites/preset-vue/tsup.config.ts b/suites/preset-vue/tsup.config.ts
new file mode 100644
index 0000000000..d708be0162
--- /dev/null
+++ b/suites/preset-vue/tsup.config.ts
@@ -0,0 +1,38 @@
+import { defineConfig } from 'tsup';
+
+export default defineConfig([
+ {
+ name: 'compiler',
+ entry: {
+ compiler: 'src/compiler/browser.ts',
+ },
+ format: 'esm',
+ outDir: 'lib',
+ target: 'esnext',
+ platform: 'browser',
+ noExternal: ['@vue/babel-plugin-jsx', 'hash-sum'],
+ external: ['vue/compiler-sfc', '@babel/standalone'],
+ treeshake: true,
+ },
+ {
+ name: 'renderer',
+ entry: {
+ renderer: 'src/vue/runtime/renderer.ts',
+ },
+ format: 'esm',
+ outDir: 'lib',
+ target: 'esnext',
+ platform: 'browser',
+ external: ['vue'],
+ treeshake: true,
+ },
+ {
+ name: 'previewer',
+ entry: ['src/vue/runtime/runtimePlugin.ts'],
+ format: 'esm',
+ outDir: 'lib',
+ target: 'esnext',
+ platform: 'browser',
+ treeshake: true,
+ },
+]);
diff --git a/suites/preset-vue/typings.d.ts b/suites/preset-vue/typings.d.ts
new file mode 100644
index 0000000000..d2bc80a20c
--- /dev/null
+++ b/suites/preset-vue/typings.d.ts
@@ -0,0 +1,2 @@
+declare module '@babel/plugin-transform-typescript';
+declare module '@babel/plugin-transform-modules-commonjs';
diff --git a/tech-stack-utils.d.ts b/tech-stack-utils.d.ts
new file mode 100644
index 0000000000..54396916d1
--- /dev/null
+++ b/tech-stack-utils.d.ts
@@ -0,0 +1 @@
+export * from './dist/techStacks/utils';
diff --git a/tech-stack-utils.js b/tech-stack-utils.js
new file mode 100644
index 0000000000..414f7e74bb
--- /dev/null
+++ b/tech-stack-utils.js
@@ -0,0 +1 @@
+module.exports = require('./dist/techStacks/utils');
diff --git a/vitest.config.ts b/vitest.config.ts
index 4e88c3eb0d..90f860455b 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -7,5 +7,7 @@ export default defineConfig({
alias: {
'@': path.join(__dirname, 'src'),
},
+ globalSetup: [path.join(__dirname, 'src/assetParsers/__tests__/setup.js')],
+ poolMatchGlobs: [['**/__tests__/**/*.fork.test.*', 'child_process']],
},
});
|