create-storybook
Version:
Storybook installer: Develop, document, and test UI components in isolation
44 lines (43 loc) • 7.81 MB
JavaScript
import ESM_COMPAT_Module1 from 'node:module';
import urlLib, { fileURLToPath, URL as URL$1, URLSearchParams as URLSearchParams$1 } from 'node:url';
import path2, { dirname, join, win32, posix, isAbsolute, resolve, parse, relative, basename, sep, normalize as normalize$1 } from 'node:path';
import { slash } from './chunk-CLZ3BCYS.js';
import { Queue } from './chunk-O2GNSM63.js';
import { __export, __esm, __commonJS, __toCommonJS, __require, __toESM } from './chunk-VASF4FB5.js';
import Q, { stdin, stdout } from 'node:process';
import * as tn6 from 'node:fs';
import tn6__default, { promises, mkdirSync, readFileSync, writeFileSync, rmSync, readdirSync, existsSync, createWriteStream, createReadStream, lstatSync as lstatSync$1, cpSync } from 'node:fs';
import * as em from 'node:os';
import em__default, { tmpdir, homedir, EOL, constants, platform } from 'node:os';
import aR2, { realpathSync as realpathSync$1, lstatSync, readdir as readdir$1, readdirSync as readdirSync$1, readlinkSync } from 'fs';
import CR2, { resolve as resolve$1, dirname as dirname$1 } from 'path';
import EventEmitter3, { EventEmitter, on as on$1, once } from 'node:events';
import Zl3, { PassThrough, Duplex, Readable } from 'node:stream';
import { finished } from 'node:stream/promises';
import * as fs6 from 'node:fs/promises';
import fs6__default, { readFile, writeFile, rm as rm$1, readdir, lstat, readlink, realpath, stat, cp as cp$1, mkdir } from 'node:fs/promises';
import { debuglog, promisify as promisify$1, inspect } from 'node:util';
import hn, { ChildProcess, execSync as execSync$1, execFile } from 'node:child_process';
import * as Be from 'node:readline';
import Be__default, { createInterface } from 'node:readline';
import WD, { WriteStream, ReadStream } from 'node:tty';
import { Buffer as Buffer$1 } from 'node:buffer';
import { setTimeout as setTimeout$1 } from 'node:timers/promises';
import { StringDecoder } from 'node:string_decoder';
import crypto2, { randomBytes, createHash } from 'node:crypto';
import { promisify, types as types$1 } from 'util';
import Zg2, { randomFillSync, createHash as createHash$1 } from 'crypto';
import semver, { satisfies, gt as gt$1, prerelease, lt as lt$1, coerce as coerce$1, validRange, minVersion } from 'semver';
import q0 from 'semver/functions/sort.js';
import { execSync } from 'child_process';
import os7 from 'os';
import { Agent } from 'http';
import { Agent as Agent$1 } from 'https';
import http, { ServerResponse } from 'node:http';
import { errorMonitor } from 'events';
import net from 'node:net';
import { checkServerIdentity } from 'node:tls';
import https from 'node:https';
import { lookup as lookup$1, V4MAPPED, ALL, ADDRCONFIG, promises as promises$1 } from 'node:dns';
ESM_COMPAT_Module1.createRequire(import.meta.url);
var tslib_es6_exports={};__export(tslib_es6_exports,{__addDisposableResource:()=>__addDisposableResource,__assign:()=>__assign,__asyncDelegator:()=>__asyncDelegator,__asyncGenerator:()=>__asyncGenerator,__asyncValues:()=>__asyncValues,__await:()=>__await,__awaiter:()=>__awaiter,__classPrivateFieldGet:()=>__classPrivateFieldGet,__classPrivateFieldIn:()=>__classPrivateFieldIn,__classPrivateFieldSet:()=>__classPrivateFieldSet,__createBinding:()=>__createBinding,__decorate:()=>__decorate,__disposeResources:()=>__disposeResources,__esDecorate:()=>__esDecorate,__exportStar:()=>__exportStar,__extends:()=>__extends,__generator:()=>__generator,__importDefault:()=>__importDefault,__importStar:()=>__importStar,__makeTemplateObject:()=>__makeTemplateObject,__metadata:()=>__metadata,__param:()=>__param,__propKey:()=>__propKey,__read:()=>__read,__rest:()=>__rest,__rewriteRelativeImportExtension:()=>__rewriteRelativeImportExtension,__runInitializers:()=>__runInitializers,__setFunctionName:()=>__setFunctionName,__spread:()=>__spread,__spreadArray:()=>__spreadArray,__spreadArrays:()=>__spreadArrays,__values:()=>__values,default:()=>tslib_es6_default});function __extends(d7,b8){if(typeof b8!="function"&&b8!==null)throw new TypeError("Class extends value "+String(b8)+" is not a constructor or null");extendStatics(d7,b8);function __2(){this.constructor=d7;}d7.prototype=b8===null?Object.create(b8):(__2.prototype=b8.prototype,new __2);}function __rest(s10,e5){var t18={};for(var p7 in s10)Object.prototype.hasOwnProperty.call(s10,p7)&&e5.indexOf(p7)<0&&(t18[p7]=s10[p7]);if(s10!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i7=0,p7=Object.getOwnPropertySymbols(s10);i7<p7.length;i7++)e5.indexOf(p7[i7])<0&&Object.prototype.propertyIsEnumerable.call(s10,p7[i7])&&(t18[p7[i7]]=s10[p7[i7]]);return t18}function __decorate(decorators,target,key,desc){var c10=arguments.length,r5=c10<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d7;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r5=Reflect.decorate(decorators,target,key,desc);else for(var i7=decorators.length-1;i7>=0;i7--)(d7=decorators[i7])&&(r5=(c10<3?d7(r5):c10>3?d7(target,key,r5):d7(target,key))||r5);return c10>3&&r5&&Object.defineProperty(target,key,r5),r5}function __param(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex);}}function __esDecorate(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f11){if(f11!==void 0&&typeof f11!="function")throw new TypeError("Function expected");return f11}for(var kind=contextIn.kind,key=kind==="getter"?"get":kind==="setter"?"set":"value",target=!descriptorIn&&ctor?contextIn.static?ctor:ctor.prototype:null,descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{}),_11,done=!1,i7=decorators.length-1;i7>=0;i7--){var context={};for(var p7 in contextIn)context[p7]=p7==="access"?{}:contextIn[p7];for(var p7 in contextIn.access)context.access[p7]=contextIn.access[p7];context.addInitializer=function(f11){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f11||null));};var result=(0, decorators[i7])(kind==="accessor"?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if(kind==="accessor"){if(result===void 0)continue;if(result===null||typeof result!="object")throw new TypeError("Object expected");(_11=accept(result.get))&&(descriptor.get=_11),(_11=accept(result.set))&&(descriptor.set=_11),(_11=accept(result.init))&&initializers.unshift(_11);}else (_11=accept(result))&&(kind==="field"?initializers.unshift(_11):descriptor[key]=_11);}target&&Object.defineProperty(target,contextIn.name,descriptor),done=!0;}function __runInitializers(thisArg,initializers,value2){for(var useValue=arguments.length>2,i7=0;i7<initializers.length;i7++)value2=useValue?initializers[i7].call(thisArg,value2):initializers[i7].call(thisArg);return useValue?value2:void 0}function __propKey(x8){return typeof x8=="symbol"?x8:"".concat(x8)}function __setFunctionName(f11,name,prefix2){return typeof name=="symbol"&&(name=name.description?"[".concat(name.description,"]"):""),Object.defineProperty(f11,"name",{configurable:!0,value:prefix2?"".concat(prefix2," ",name):name})}function __metadata(metadataKey,metadataValue){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(metadataKey,metadataValue)}function __awaiter(thisArg,_arguments,P14,generator19){function adopt(value2){return value2 instanceof P14?value2:new P14(function(resolve9){resolve9(value2);})}return new(P14||(P14=Promise))(function(resolve9,reject){function fulfilled(value2){try{step2(generator19.next(value2));}catch(e5){reject(e5);}}function rejected(value2){try{step2(generator19.throw(value2));}catch(e5){reject(e5);}}function step2(result){result.done?resolve9(result.value):adopt(result.value).then(fulfilled,rejected);}step2((generator19=generator19.apply(thisArg,_arguments||[])).next());})}function __generator(thisArg,body){var _11={label:0,sent:function(){if(t18[0]&1)throw t18[1];return t18[1]},trys:[],ops:[]},f11,y7,t18,g5=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g5.next=verb(0),g5.throw=verb(1),g5.return=verb(2),typeof Symbol=="function"&&(g5[Symbol.iterator]=function(){return this}),g5;function verb(n10){return function(v12){return step2([n10,v12])}}function step2(op3){if(f11)throw new TypeError("Generator is already executing.");for(;g5&&(g5=0,op3[0]&&(_11=0)),_11;)try{if(f11=1,y7&&(t18=op3[0]&2?y7.return:op3[0]?y7.throw||((t18=y7.return)&&t18.call(y7),0):y7.next)&&!(t18=t18.call(y7,op3[1])).done)return t18;switch(y7=0,t18&&(op3=[op3[0]&2,t18.value]),op3[0]){case 0:case 1:t18=op3;break;case 4:return _11.label++,{value:op3[1],done:!1};case 5:_11.label++,y7=op3[1],op3=[0];continue;case 7:op3=_11.ops.pop(),_11.trys.pop();continue;default:if(t18=_11.trys,!(t18=t18.length>0&&t18[t18.length-1])&&(op3[0]===6||op3[0]===2)){_11=0;continue}if(op3[0]===3&&(!t18||op3[1]>t18[0]&&op3[1]<t18[3])){_11.label=op3[1];break}if(op3[0]===6&&_11.label<t18[1]){_11.label=t18[1],t18=op3;break}if(t18&&_11.label<t18[2]){_11.label=t18[2],_11.ops.push(op3);break}t18[2]&&_11.ops.pop(),_11.trys.pop();continue}op3=body.call(thisArg,_11);}catch(e5){op3=[6,e5],y7=0;}finally{f11=t18=0;}if(op3[0]&5)throw op3[1];return {value:op3[0]?op3[1]:void 0,done:!0}}}function __exportStar(m7,o10){for(var p7 in m7)p7!=="default"&&!Object.prototype.hasOwnProperty.call(o10,p7)&&__createBinding(o10,m7,p7);}function __values(o10){var s10=typeof Symbol=="function"&&Symbol.iterator,m7=s10&&o10[s10],i7=0;if(m7)return m7.call(o10);if(o10&&typeof o10.length=="number")return {next:function(){return o10&&i7>=o10.length&&(o10=void 0),{value:o10&&o10[i7++],done:!o10}}};throw new TypeError(s10?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(o10,n10){var m7=typeof Symbol=="function"&&o10[Symbol.iterator];if(!m7)return o10;var i7=m7.call(o10),r5,ar5=[],e5;try{for(;(n10===void 0||n10-- >0)&&!(r5=i7.next()).done;)ar5.push(r5.value);}catch(error2){e5={error:error2};}finally{try{r5&&!r5.done&&(m7=i7.return)&&m7.call(i7);}finally{if(e5)throw e5.error}}return ar5}function __spread(){for(var ar5=[],i7=0;i7<arguments.length;i7++)ar5=ar5.concat(__read(arguments[i7]));return ar5}function __spreadArrays(){for(var s10=0,i7=0,il2=arguments.length;i7<il2;i7++)s10+=arguments[i7].length;for(var r5=Array(s10),k13=0,i7=0;i7<il2;i7++)for(var a5=arguments[i7],j12=0,jl5=a5.length;j12<jl5;j12++,k13++)r5[k13]=a5[j12];return r5}function __spreadArray(to6,from,pack){if(pack||arguments.length===2)for(var i7=0,l7=from.length,ar5;i7<l7;i7++)(ar5||!(i7 in from))&&(ar5||(ar5=Array.prototype.slice.call(from,0,i7)),ar5[i7]=from[i7]);return to6.concat(ar5||Array.prototype.slice.call(from))}function __await(v12){return this instanceof __await?(this.v=v12,this):new __await(v12)}function __asyncGenerator(thisArg,_arguments,generator19){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g5=generator19.apply(thisArg,_arguments||[]),i7,q13=[];return i7=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),verb("next"),verb("throw"),verb("return",awaitReturn),i7[Symbol.asyncIterator]=function(){return this},i7;function awaitReturn(f11){return function(v12){return Promise.resolve(v12).then(f11,reject)}}function verb(n10,f11){g5[n10]&&(i7[n10]=function(v12){return new Promise(function(a5,b8){q13.push([n10,v12,a5,b8])>1||resume(n10,v12);})},f11&&(i7[n10]=f11(i7[n10])));}function resume(n10,v12){try{step2(g5[n10](v12));}catch(e5){settle(q13[0][3],e5);}}function step2(r5){r5.value instanceof __await?Promise.resolve(r5.value.v).then(fulfill,reject):settle(q13[0][2],r5);}function fulfill(value2){resume("next",value2);}function reject(value2){resume("throw",value2);}function settle(f11,v12){f11(v12),q13.shift(),q13.length&&resume(q13[0][0],q13[0][1]);}}function __asyncDelegator(o10){var i7,p7;return i7={},verb("next"),verb("throw",function(e5){throw e5}),verb("return"),i7[Symbol.iterator]=function(){return this},i7;function verb(n10,f11){i7[n10]=o10[n10]?function(v12){return (p7=!p7)?{value:__await(o10[n10](v12)),done:!1}:f11?f11(v12):v12}:f11;}}function __asyncValues(o10){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m7=o10[Symbol.asyncIterator],i7;return m7?m7.call(o10):(o10=typeof __values=="function"?__values(o10):o10[Symbol.iterator](),i7={},verb("next"),verb("throw"),verb("return"),i7[Symbol.asyncIterator]=function(){return this},i7);function verb(n10){i7[n10]=o10[n10]&&function(v12){return new Promise(function(resolve9,reject){v12=o10[n10](v12),settle(resolve9,reject,v12.done,v12.value);})};}function settle(resolve9,reject,d7,v12){Promise.resolve(v12).then(function(v13){resolve9({value:v13,done:d7});},reject);}}function __makeTemplateObject(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked}function __importStar(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k13=ownKeys(mod),i7=0;i7<k13.length;i7++)k13[i7]!=="default"&&__createBinding(result,mod,k13[i7]);return __setModuleDefault(result,mod),result}function __importDefault(mod){return mod&&mod.__esModule?mod:{default:mod}}function __classPrivateFieldGet(receiver,state,kind,f11){if(kind==="a"&&!f11)throw new TypeError("Private accessor was defined without a getter");if(typeof state=="function"?receiver!==state||!f11:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return kind==="m"?f11:kind==="a"?f11.call(receiver):f11?f11.value:state.get(receiver)}function __classPrivateFieldSet(receiver,state,value2,kind,f11){if(kind==="m")throw new TypeError("Private method is not writable");if(kind==="a"&&!f11)throw new TypeError("Private accessor was defined without a setter");if(typeof state=="function"?receiver!==state||!f11:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return kind==="a"?f11.call(receiver,value2):f11?f11.value=value2:state.set(receiver,value2),value2}function __classPrivateFieldIn(state,receiver){if(receiver===null||typeof receiver!="object"&&typeof receiver!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof state=="function"?receiver===state:state.has(receiver)}function __addDisposableResource(env3,value2,async){if(value2!=null){if(typeof value2!="object"&&typeof value2!="function")throw new TypeError("Object expected.");var dispose,inner;if(async){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");dispose=value2[Symbol.asyncDispose];}if(dispose===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");dispose=value2[Symbol.dispose],async&&(inner=dispose);}if(typeof dispose!="function")throw new TypeError("Object not disposable.");inner&&(dispose=function(){try{inner.call(this);}catch(e5){return Promise.reject(e5)}}),env3.stack.push({value:value2,dispose,async});}else async&&env3.stack.push({async:!0});return value2}function __disposeResources(env3){function fail(e5){env3.error=env3.hasError?new _SuppressedError(e5,env3.error,"An error was suppressed during disposal."):e5,env3.hasError=!0;}var r5,s10=0;function next(){for(;r5=env3.stack.pop();)try{if(!r5.async&&s10===1)return s10=0,env3.stack.push(r5),Promise.resolve().then(next);if(r5.dispose){var result=r5.dispose.call(r5.value);if(r5.async)return s10|=2,Promise.resolve(result).then(next,function(e5){return fail(e5),next()})}else s10|=1;}catch(e5){fail(e5);}if(s10===1)return env3.hasError?Promise.reject(env3.error):Promise.resolve();if(env3.hasError)throw env3.error}return next()}function __rewriteRelativeImportExtension(path12,preserveJsx){return typeof path12=="string"&&/^\.\.?\//.test(path12)?path12.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(m7,tsx,d7,ext2,cm2){return tsx?preserveJsx?".jsx":".js":d7&&(!ext2||!cm2)?m7:d7+ext2+"."+cm2.toLowerCase()+"js"}):path12}var extendStatics,__assign,__createBinding,__setModuleDefault,ownKeys,_SuppressedError,tslib_es6_default,init_tslib_es6=__esm({"../../node_modules/tslib/tslib.es6.mjs"(){extendStatics=function(d7,b8){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d8,b10){d8.__proto__=b10;}||function(d8,b10){for(var p7 in b10)Object.prototype.hasOwnProperty.call(b10,p7)&&(d8[p7]=b10[p7]);},extendStatics(d7,b8)};__assign=function(){return __assign=Object.assign||function(t18){for(var s10,i7=1,n10=arguments.length;i7<n10;i7++){s10=arguments[i7];for(var p7 in s10)Object.prototype.hasOwnProperty.call(s10,p7)&&(t18[p7]=s10[p7]);}return t18},__assign.apply(this,arguments)};__createBinding=Object.create?function(o10,m7,k13,k22){k22===void 0&&(k22=k13);var desc=Object.getOwnPropertyDescriptor(m7,k13);(!desc||("get"in desc?!m7.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m7[k13]}}),Object.defineProperty(o10,k22,desc);}:function(o10,m7,k13,k22){k22===void 0&&(k22=k13),o10[k22]=m7[k13];};__setModuleDefault=Object.create?function(o10,v12){Object.defineProperty(o10,"default",{enumerable:!0,value:v12});}:function(o10,v12){o10.default=v12;},ownKeys=function(o10){return ownKeys=Object.getOwnPropertyNames||function(o11){var ar5=[];for(var k13 in o11)Object.prototype.hasOwnProperty.call(o11,k13)&&(ar5[ar5.length]=k13);return ar5},ownKeys(o10)};_SuppressedError=typeof SuppressedError=="function"?SuppressedError:function(error2,suppressed,message){var e5=new Error(message);return e5.name="SuppressedError",e5.error=error2,e5.suppressed=suppressed,e5};tslib_es6_default={__extends,__assign,__rest,__decorate,__param,__esDecorate,__runInitializers,__propKey,__setFunctionName,__metadata,__awaiter,__generator,__createBinding,__exportStar,__values,__read,__spread,__spreadArrays,__spreadArray,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet,__classPrivateFieldIn,__addDisposableResource,__disposeResources,__rewriteRelativeImportExtension};}});var require_shared=__commonJS({"../../node_modules/recast/node_modules/ast-types/lib/shared.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.maybeSetModuleExports=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),types_1=tslib_1.__importDefault(require_types());function default_1(fork){var types4=fork.use(types_1.default),Type=types4.Type,builtin=types4.builtInTypes,isNumber=builtin.number;function geq(than){return Type.from(function(value2){return isNumber.check(value2)&&value2>=than},isNumber+" >= "+than)}var defaults3={null:function(){return null},emptyArray:function(){return []},false:function(){return !1},true:function(){return !0},undefined:function(){},"use strict":function(){return "use strict"}},naiveIsPrimitive=Type.or(builtin.string,builtin.number,builtin.boolean,builtin.null,builtin.undefined),isPrimitive=Type.from(function(value2){if(value2===null)return !0;var type=typeof value2;return !(type==="object"||type==="function")},naiveIsPrimitive.toString());return {geq,defaults:defaults3,isPrimitive}}exports.default=default_1;function maybeSetModuleExports(moduleGetter){try{var nodeModule=moduleGetter(),originalExports=nodeModule.exports,defaultExport=originalExports.default;}catch{return}defaultExport&&defaultExport!==originalExports&&typeof originalExports=="object"&&(Object.assign(defaultExport,originalExports,{default:defaultExport}),originalExports.__esModule&&Object.defineProperty(defaultExport,"__esModule",{value:!0}),nodeModule.exports=defaultExport);}exports.maybeSetModuleExports=maybeSetModuleExports;}});var require_types=__commonJS({"../../node_modules/recast/node_modules/ast-types/lib/types.js"(exports,module2){Object.defineProperty(exports,"__esModule",{value:!0});exports.Def=void 0;var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),shared_1=require_shared(),Op3=Object.prototype,objToStr=Op3.toString,hasOwn=Op3.hasOwnProperty,BaseType=function(){function BaseType2(){}return BaseType2.prototype.assert=function(value2,deep){if(!this.check(value2,deep)){var str=shallowStringify(value2);throw new Error(str+" does not match type "+this)}return !0},BaseType2.prototype.arrayOf=function(){var elemType=this;return new ArrayType(elemType)},BaseType2}(),ArrayType=function(_super){tslib_1.__extends(ArrayType2,_super);function ArrayType2(elemType){var _this=_super.call(this)||this;return _this.elemType=elemType,_this.kind="ArrayType",_this}return ArrayType2.prototype.toString=function(){return "["+this.elemType+"]"},ArrayType2.prototype.check=function(value2,deep){var _this=this;return Array.isArray(value2)&&value2.every(function(elem){return _this.elemType.check(elem,deep)})},ArrayType2}(BaseType),IdentityType=function(_super){tslib_1.__extends(IdentityType2,_super);function IdentityType2(value2){var _this=_super.call(this)||this;return _this.value=value2,_this.kind="IdentityType",_this}return IdentityType2.prototype.toString=function(){return String(this.value)},IdentityType2.prototype.check=function(value2,deep){var result=value2===this.value;return !result&&typeof deep=="function"&&deep(this,value2),result},IdentityType2}(BaseType),ObjectType=function(_super){tslib_1.__extends(ObjectType2,_super);function ObjectType2(fields){var _this=_super.call(this)||this;return _this.fields=fields,_this.kind="ObjectType",_this}return ObjectType2.prototype.toString=function(){return "{ "+this.fields.join(", ")+" }"},ObjectType2.prototype.check=function(value2,deep){return objToStr.call(value2)===objToStr.call({})&&this.fields.every(function(field){return field.type.check(value2[field.name],deep)})},ObjectType2}(BaseType),OrType=function(_super){tslib_1.__extends(OrType2,_super);function OrType2(types4){var _this=_super.call(this)||this;return _this.types=types4,_this.kind="OrType",_this}return OrType2.prototype.toString=function(){return this.types.join(" | ")},OrType2.prototype.check=function(value2,deep){return this.types.some(function(type){return type.check(value2,!!deep)})?!0:(typeof deep=="function"&&deep(this,value2),!1)},OrType2}(BaseType),PredicateType=function(_super){tslib_1.__extends(PredicateType2,_super);function PredicateType2(name,predicate){var _this=_super.call(this)||this;return _this.name=name,_this.predicate=predicate,_this.kind="PredicateType",_this}return PredicateType2.prototype.toString=function(){return this.name},PredicateType2.prototype.check=function(value2,deep){var result=this.predicate(value2,deep);return !result&&typeof deep=="function"&&deep(this,value2),result},PredicateType2}(BaseType),Def=function(){function Def2(type,typeName){this.type=type,this.typeName=typeName,this.baseNames=[],this.ownFields=Object.create(null),this.allSupertypes=Object.create(null),this.supertypeList=[],this.allFields=Object.create(null),this.fieldNames=[],this.finalized=!1,this.buildable=!1,this.buildParams=[];}return Def2.prototype.isSupertypeOf=function(that){if(that instanceof Def2){if(this.finalized!==!0||that.finalized!==!0)throw new Error("");return hasOwn.call(that.allSupertypes,this.typeName)}else throw new Error(that+" is not a Def")},Def2.prototype.checkAllFields=function(value2,deep){var allFields=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function checkFieldByName(name){var field=allFields[name],type=field.type,child=field.getValue(value2);return type.check(child,deep)}return value2!==null&&typeof value2=="object"&&Object.keys(allFields).every(checkFieldByName)},Def2.prototype.bases=function(){for(var supertypeNames=[],_i3=0;_i3<arguments.length;_i3++)supertypeNames[_i3]=arguments[_i3];var bases=this.baseNames;if(this.finalized){if(supertypeNames.length!==bases.length)throw new Error("");for(var i7=0;i7<supertypeNames.length;i7++)if(supertypeNames[i7]!==bases[i7])throw new Error("");return this}return supertypeNames.forEach(function(baseName){bases.indexOf(baseName)<0&&bases.push(baseName);}),this},Def2}();exports.Def=Def;var Field=function(){function Field2(name,type,defaultFn,hidden){this.name=name,this.type=type,this.defaultFn=defaultFn,this.hidden=!!hidden;}return Field2.prototype.toString=function(){return JSON.stringify(this.name)+": "+this.type},Field2.prototype.getValue=function(obj){var value2=obj[this.name];return typeof value2<"u"||typeof this.defaultFn=="function"&&(value2=this.defaultFn.call(obj)),value2},Field2}();function shallowStringify(value2){return Array.isArray(value2)?"["+value2.map(shallowStringify).join(", ")+"]":value2&&typeof value2=="object"?"{ "+Object.keys(value2).map(function(key){return key+": "+value2[key]}).join(", ")+" }":JSON.stringify(value2)}function typesPlugin(_fork){var Type={or:function(){for(var types4=[],_i3=0;_i3<arguments.length;_i3++)types4[_i3]=arguments[_i3];return new OrType(types4.map(function(type){return Type.from(type)}))},from:function(value2,name){if(value2 instanceof ArrayType||value2 instanceof IdentityType||value2 instanceof ObjectType||value2 instanceof OrType||value2 instanceof PredicateType)return value2;if(value2 instanceof Def)return value2.type;if(isArray.check(value2)){if(value2.length!==1)throw new Error("only one element type is permitted for typed arrays");return new ArrayType(Type.from(value2[0]))}if(isObject.check(value2))return new ObjectType(Object.keys(value2).map(function(name2){return new Field(name2,Type.from(value2[name2],name2))}));if(typeof value2=="function"){var bicfIndex=builtInCtorFns.indexOf(value2);if(bicfIndex>=0)return builtInCtorTypes[bicfIndex];if(typeof name!="string")throw new Error("missing name");return new PredicateType(name,value2)}return new IdentityType(value2)},def:function(typeName){return hasOwn.call(defCache,typeName)?defCache[typeName]:defCache[typeName]=new DefImpl(typeName)},hasDef:function(typeName){return hasOwn.call(defCache,typeName)}},builtInCtorFns=[],builtInCtorTypes=[];function defBuiltInType(name,example){var objStr=objToStr.call(example),type=new PredicateType(name,function(value2){return objToStr.call(value2)===objStr});return example&&typeof example.constructor=="function"&&(builtInCtorFns.push(example.constructor),builtInCtorTypes.push(type)),type}var isString=defBuiltInType("string","truthy"),isFunction2=defBuiltInType("function",function(){}),isArray=defBuiltInType("array",[]),isObject=defBuiltInType("object",{}),isRegExp=defBuiltInType("RegExp",/./),isDate=defBuiltInType("Date",new Date),isNumber=defBuiltInType("number",3),isBoolean=defBuiltInType("boolean",!0),isNull=defBuiltInType("null",null),isUndefined=defBuiltInType("undefined",void 0),isBigInt=typeof BigInt=="function"?defBuiltInType("BigInt",BigInt(1234)):new PredicateType("BigInt",function(){return !1}),builtInTypes={string:isString,function:isFunction2,array:isArray,object:isObject,RegExp:isRegExp,Date:isDate,number:isNumber,boolean:isBoolean,null:isNull,undefined:isUndefined,BigInt:isBigInt},defCache=Object.create(null);function defFromValue(value2){if(value2&&typeof value2=="object"){var type=value2.type;if(typeof type=="string"&&hasOwn.call(defCache,type)){var d7=defCache[type];if(d7.finalized)return d7}}return null}var DefImpl=function(_super){tslib_1.__extends(DefImpl2,_super);function DefImpl2(typeName){var _this=_super.call(this,new PredicateType(typeName,function(value2,deep){return _this.check(value2,deep)}),typeName)||this;return _this}return DefImpl2.prototype.check=function(value2,deep){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(value2===null||typeof value2!="object")return !1;var vDef=defFromValue(value2);return vDef?deep&&vDef===this?this.checkAllFields(value2,deep):this.isSupertypeOf(vDef)?deep?vDef.checkAllFields(value2,deep)&&this.checkAllFields(value2,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(value2,deep):!1},DefImpl2.prototype.build=function(){for(var _this=this,buildParams=[],_i3=0;_i3<arguments.length;_i3++)buildParams[_i3]=arguments[_i3];if(this.buildParams=buildParams,this.buildable)return this;this.field("type",String,function(){return _this.typeName}),this.buildable=!0;var addParam=function(built,param,arg,isArgAvailable){if(!hasOwn.call(built,param)){var all2=_this.allFields;if(!hasOwn.call(all2,param))throw new Error(""+param);var field=all2[param],type=field.type,value2;if(isArgAvailable)value2=arg;else if(field.defaultFn)value2=field.defaultFn.call(built);else {var message="no value or default function given for field "+JSON.stringify(param)+" of "+_this.typeName+"("+_this.buildParams.map(function(name){return all2[name]}).join(", ")+")";throw new Error(message)}if(!type.check(value2))throw new Error(shallowStringify(value2)+" does not match field "+field+" of type "+_this.typeName);built[param]=value2;}},builder=function(){for(var args=[],_i4=0;_i4<arguments.length;_i4++)args[_i4]=arguments[_i4];var argc=args.length;if(!_this.finalized)throw new Error("attempting to instantiate unfinalized type "+_this.typeName);var built=Object.create(nodePrototype);if(_this.buildParams.forEach(function(param,i7){i7<argc?addParam(built,param,args[i7],!0):addParam(built,param,null,!1);}),Object.keys(_this.allFields).forEach(function(param){addParam(built,param,null,!1);}),built.type!==_this.typeName)throw new Error("");return built};return builder.from=function(obj){if(!_this.finalized)throw new Error("attempting to instantiate unfinalized type "+_this.typeName);var built=Object.create(nodePrototype);if(Object.keys(_this.allFields).forEach(function(param){hasOwn.call(obj,param)?addParam(built,param,obj[param],!0):addParam(built,param,null,!1);}),built.type!==_this.typeName)throw new Error("");return built},Object.defineProperty(builders,getBuilderName(this.typeName),{enumerable:!0,value:builder}),this},DefImpl2.prototype.field=function(name,type,defaultFn,hidden){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(name)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[name]=new Field(name,Type.from(type),defaultFn,hidden),this)},DefImpl2.prototype.finalize=function(){var _this=this;if(!this.finalized){var allFields=this.allFields,allSupertypes=this.allSupertypes;this.baseNames.forEach(function(name){var def=defCache[name];if(def instanceof Def)def.finalize(),extend(allFields,def.allFields),extend(allSupertypes,def.allSupertypes);else {var message="unknown supertype name "+JSON.stringify(name)+" for subtype "+JSON.stringify(_this.typeName);throw new Error(message)}}),extend(allFields,this.ownFields),allSupertypes[this.typeName]=this,this.fieldNames.length=0;for(var fieldName in allFields)hasOwn.call(allFields,fieldName)&&!allFields[fieldName].hidden&&this.fieldNames.push(fieldName);Object.defineProperty(namedTypes,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,populateSupertypeList(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&wrapExpressionBuilderWithStatement(this.typeName);}},DefImpl2}(Def);function getSupertypeNames(typeName){if(!hasOwn.call(defCache,typeName))throw new Error("");var d7=defCache[typeName];if(d7.finalized!==!0)throw new Error("");return d7.supertypeList.slice(1)}function computeSupertypeLookupTable(candidates){for(var table={},typeNames=Object.keys(defCache),typeNameCount=typeNames.length,i7=0;i7<typeNameCount;++i7){var typeName=typeNames[i7],d7=defCache[typeName];if(d7.finalized!==!0)throw new Error(""+typeName);for(var j12=0;j12<d7.supertypeList.length;++j12){var superTypeName=d7.supertypeList[j12];if(hasOwn.call(candidates,superTypeName)){table[typeName]=superTypeName;break}}}return table}var builders=Object.create(null),nodePrototype={};function defineMethod(name,func){var old=nodePrototype[name];return isUndefined.check(func)?delete nodePrototype[name]:(isFunction2.assert(func),Object.defineProperty(nodePrototype,name,{enumerable:!0,configurable:!0,value:func})),old}function getBuilderName(typeName){return typeName.replace(/^[A-Z]+/,function(upperCasePrefix){var len=upperCasePrefix.length;switch(len){case 0:return "";case 1:return upperCasePrefix.toLowerCase();default:return upperCasePrefix.slice(0,len-1).toLowerCase()+upperCasePrefix.charAt(len-1)}})}function getStatementBuilderName(typeName){return typeName=getBuilderName(typeName),typeName.replace(/(Expression)?$/,"Statement")}var namedTypes={};function getFieldNames(object){var d7=defFromValue(object);if(d7)return d7.fieldNames.slice(0);if("type"in object)throw new Error("did not recognize object of type "+JSON.stringify(object.type));return Object.keys(object)}function getFieldValue(object,fieldName){var d7=defFromValue(object);if(d7){var field=d7.allFields[fieldName];if(field)return field.getValue(object)}return object&&object[fieldName]}function eachField(object,callback,context){getFieldNames(object).forEach(function(name){callback.call(this,name,getFieldValue(object,name));},context);}function someField(object,callback,context){return getFieldNames(object).some(function(name){return callback.call(this,name,getFieldValue(object,name))},context)}function wrapExpressionBuilderWithStatement(typeName){var wrapperName=getStatementBuilderName(typeName);if(!builders[wrapperName]){var wrapped=builders[getBuilderName(typeName)];if(wrapped){var builder=function(){for(var args=[],_i3=0;_i3<arguments.length;_i3++)args[_i3]=arguments[_i3];return builders.expressionStatement(wrapped.apply(builders,args))};builder.from=function(){for(var args=[],_i3=0;_i3<arguments.length;_i3++)args[_i3]=arguments[_i3];return builders.expressionStatement(wrapped.from.apply(builders,args))},builders[wrapperName]=builder;}}}function populateSupertypeList(typeName,list){list.length=0,list.push(typeName);for(var lastSeen=Object.create(null),pos=0;pos<list.length;++pos){typeName=list[pos];var d7=defCache[typeName];if(d7.finalized!==!0)throw new Error("");hasOwn.call(lastSeen,typeName)&&delete list[lastSeen[typeName]],lastSeen[typeName]=pos,list.push.apply(list,d7.baseNames);}for(var to6=0,from=to6,len=list.length;from<len;++from)hasOwn.call(list,from)&&(list[to6++]=list[from]);list.length=to6;}function extend(into,from){return Object.keys(from).forEach(function(name){into[name]=from[name];}),into}function finalize(){Object.keys(defCache).forEach(function(name){defCache[name].finalize();});}return {Type,builtInTypes,getSupertypeNames,computeSupertypeLookupTable,builders,defineMethod,getBuilderName,getStatementBuilderName,namedTypes,getFieldNames,getFieldValue,eachField,someField,finalize}}exports.default=typesPlugin;(0, shared_1.maybeSetModuleExports)(function(){return module2});}});var require_path=__commonJS({"../../node_modules/recast/node_modules/ast-types/lib/path.js"(exports,module2){Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),shared_1=require_shared(),types_1=tslib_1.__importDefault(require_types()),Op3=Object.prototype,hasOwn=Op3.hasOwnProperty;function pathPlugin(fork){var types4=fork.use(types_1.default),isArray=types4.builtInTypes.array,isNumber=types4.builtInTypes.number,Path2=function Path3(value2,parentPath,name){if(!(this instanceof Path3))throw new Error("Path constructor cannot be invoked without 'new'");if(parentPath){if(!(parentPath instanceof Path3))throw new Error("")}else parentPath=null,name=null;this.value=value2,this.parentPath=parentPath,this.name=name,this.__childCache=null;},Pp3=Path2.prototype;function getChildCache(path12){return path12.__childCache||(path12.__childCache=Object.create(null))}function getChildPath(path12,name){var cache2=getChildCache(path12),actualChildValue=path12.getValueProperty(name),childPath=cache2[name];return (!hasOwn.call(cache2,name)||childPath.value!==actualChildValue)&&(childPath=cache2[name]=new path12.constructor(actualChildValue,path12,name)),childPath}Pp3.getValueProperty=function(name){return this.value[name]},Pp3.get=function(){for(var names=[],_i3=0;_i3<arguments.length;_i3++)names[_i3]=arguments[_i3];for(var path12=this,count=names.length,i7=0;i7<count;++i7)path12=getChildPath(path12,names[i7]);return path12},Pp3.each=function(callback,context){for(var childPaths=[],len=this.value.length,i7=0,i7=0;i7<len;++i7)hasOwn.call(this.value,i7)&&(childPaths[i7]=this.get(i7));for(context=context||this,i7=0;i7<len;++i7)hasOwn.call(childPaths,i7)&&callback.call(context,childPaths[i7]);},Pp3.map=function(callback,context){var result=[];return this.each(function(childPath){result.push(callback.call(this,childPath));},context),result},Pp3.filter=function(callback,context){var result=[];return this.each(function(childPath){callback.call(this,childPath)&&result.push(childPath);},context),result};function emptyMoves(){}function getMoves(path12,offset,start,end){if(isArray.assert(path12.value),offset===0)return emptyMoves;var length=path12.value.length;if(length<1)return emptyMoves;var argc=arguments.length;argc===2?(start=0,end=length):argc===3?(start=Math.max(start,0),end=length):(start=Math.max(start,0),end=Math.min(end,length)),isNumber.assert(start),isNumber.assert(end);for(var moves=Object.create(null),cache2=getChildCache(path12),i7=start;i7<end;++i7)if(hasOwn.call(path12.value,i7)){var childPath=path12.get(i7);if(childPath.name!==i7)throw new Error("");var newIndex=i7+offset;childPath.name=newIndex,moves[newIndex]=childPath,delete cache2[i7];}return delete cache2.length,function(){for(var newIndex2 in moves){var childPath2=moves[newIndex2];if(childPath2.name!==+newIndex2)throw new Error("");cache2[newIndex2]=childPath2,path12.value[newIndex2]=childPath2.value;}}}Pp3.shift=function(){var move=getMoves(this,-1),result=this.value.shift();return move(),result},Pp3.unshift=function(){for(var args=[],_i3=0;_i3<arguments.length;_i3++)args[_i3]=arguments[_i3];var move=getMoves(this,args.length),result=this.value.unshift.apply(this.value,args);return move(),result},Pp3.push=function(){for(var args=[],_i3=0;_i3<arguments.length;_i3++)args[_i3]=arguments[_i3];return isArray.assert(this.value),delete getChildCache(this).length,this.value.push.apply(this.value,args)},Pp3.pop=function(){isArray.assert(this.value);var cache2=getChildCache(this);return delete cache2[this.value.length-1],delete cache2.length,this.value.pop()},Pp3.insertAt=function(index){var argc=arguments.length,move=getMoves(this,argc-1,index);if(move===emptyMoves&&argc<=1)return this;index=Math.max(index,0);for(var i7=1;i7<argc;++i7)this.value[index+i7-1]=arguments[i7];return move(),this},Pp3.insertBefore=function(){for(var args=[],_i3=0;_i3<arguments.length;_i3++)args[_i3]=arguments[_i3];for(var pp5=this.parentPath,argc=args.length,insertAtArgs=[this.name],i7=0;i7<argc;++i7)insertAtArgs.push(args[i7]);return pp5.insertAt.apply(pp5,insertAtArgs)},Pp3.insertAfter=function(){for(var args=[],_i3=0;_i3<arguments.length;_i3++)args[_i3]=arguments[_i3];for(var pp5=this.parentPath,argc=args.length,insertAtArgs=[this.name+1],i7=0;i7<argc;++i7)insertAtArgs.push(args[i7]);return pp5.insertAt.apply(pp5,insertAtArgs)};function repairRelationshipWithParent(path12){if(!(path12 instanceof Path2))throw new Error("");var pp5=path12.parentPath;if(!pp5)return path12;var parentValue=pp5.value,parentCache=getChildCache(pp5);if(parentValue[path12.name]===path12.value)parentCache[path12.name]=path12;else if(isArray.check(parentValue)){var i7=parentValue.indexOf(path12.value);i7>=0&&(parentCache[path12.name=i7]=path12);}else parentValue[path12.name]=path12.value,parentCache[path12.name]=path12;if(parentValue[path12.name]!==path12.value)throw new Error("");if(path12.parentPath.get(path12.name)!==path12)throw new Error("");return path12}return Pp3.replace=function(replacement){var results=[],parentValue=this.parentPath.value,parentCache=getChildCache(this.parentPath),count=arguments.length;if(repairRelationshipWithParent(this),isArray.check(parentValue)){for(var originalLength=parentValue.length,move=getMoves(this.parentPath,count-1,this.name+1),spliceArgs=[this.name,1],i7=0;i7<count;++i7)spliceArgs.push(arguments[i7]);var splicedOut=parentValue.splice.apply(parentValue,spliceArgs);if(splicedOut[0]!==this.value)throw new Error("");if(parentValue.length!==originalLength-1+count)throw new Error("");if(move(),count===0)delete this.value,delete parentCache[this.name],this.__childCache=null;else {if(parentValue[this.name]!==replacement)throw new Error("");for(this.value!==replacement&&(this.value=replacement,this.__childCache=null),i7=0;i7<count;++i7)results.push(this.parentPath.get(this.name+i7));if(results[0]!==this)throw new Error("")}}else if(count===1)this.value!==replacement&&(this.__childCache=null),this.value=parentValue[this.name]=replacement,results.push(this);else if(count===0)delete parentValue[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return results},Path2}exports.default=pathPlugin;(0, shared_1.maybeSetModuleExports)(function(){return module2});}});var require_scope=__commonJS({"../../node_modules/recast/node_modules/ast-types/lib/scope.js"(exports,module2){Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),shared_1=require_shared(),types_1=tslib_1.__importDefault(require_types()),hasOwn=Object.prototype.hasOwnProperty;function scopePlugin(fork){var types4=fork.use(types_1.default),Type=types4.Type,namedTypes=types4.namedTypes,Node2=namedTypes.Node,Expression=namedTypes.Expression,isArray=types4.builtInTypes.array,b8=types4.builders,Scope=function Scope2(path12,parentScope){if(!(this instanceof Scope2))throw new Error("Scope constructor cannot be invoked without 'new'");TypeParameterScopeType.check(path12.value)||ScopeType.assert(path12.value);var depth;if(parentScope){if(!(parentScope instanceof Scope2))throw new Error("");depth=parentScope.depth+1;}else parentScope=null,depth=0;Object.defineProperties(this,{path:{value:path12},node:{value:path12.value},isGlobal:{value:!parentScope,enumerable:!0},depth:{value:depth},parent:{value:parentScope},bindings:{value:{}},types:{value:{}}});},ScopeType=Type.or(namedTypes.Program,namedTypes.Function,namedTypes.CatchClause),TypeParameterScopeType=Type.or(namedTypes.Function,namedTypes.ClassDeclaration,namedTypes.ClassExpression,namedTypes.InterfaceDeclaration,namedTypes.TSInterfaceDeclaration,namedTypes.TypeAlias,namedTypes.TSTypeAliasDeclaration),FlowOrTSTypeParameterType=Type.or(namedTypes.TypeParameter,namedTypes.TSTypeParameter);Scope.isEstablishedBy=function(node){return ScopeType.check(node)||TypeParameterScopeType.check(node)};var Sp3=Scope.prototype;Sp3.didScan=!1,Sp3.declares=function(name){return this.scan(),hasOwn.call(this.bindings,name)},Sp3.declaresType=function(name){return this.scan(),hasOwn.call(this.types,name)},Sp3.declareTemporary=function(prefix2){if(prefix2){if(!/^[a-z$_]/i.test(prefix2))throw new Error("")}else prefix2="t$";prefix2+=this.depth.toString(36)+"$",this.scan();for(var index=0;this.declares(prefix2+index);)++index;var name=prefix2+index;return this.bindings[name]=types4.builders.identifier(name)},Sp3.injectTemporary=function(identifier,init2){identifier||(identifier=this.declareTemporary());var bodyPath=this.path.get("body");return namedTypes.BlockStatement.check(bodyPath.value)&&(bodyPath=bodyPath.get("body")),bodyPath.unshift(b8.variableDeclaration("var",[b8.variableDeclarator(identifier,init2||null)])),identifier},Sp3.scan=function(force){if(force||!this.didScan){for(var name in this.bindings)delete this.bindings[name];for(var name in this.types)delete this.types[name];scanScope(this.path,this.bindings,this.types),this.didScan=!0;}},Sp3.getBindings=function(){return this.scan(),this.bindings},Sp3.getTypes=function(){return this.scan(),this.types};function scanScope(path12,bindings,scopeTypes){var node=path12.value;if(TypeParameterScopeType.check(node)){var params=path12.get("typeParameters","params");isArray.check(params.value)&¶ms.each(function(childPath){addTypeParameter(childPath,scopeTypes);});}ScopeType.check(node)&&(namedTypes.CatchClause.check(node)?addPattern(path12.get("param"),bindings):recursiveScanScope(path12,bindings,scopeTypes));}function recursiveScanScope(path12,bindings,scopeTypes){var node=path12.value;path12.parent&&namedTypes.FunctionExpression.check(path12.parent.node)&&path12.parent.node.id&&addPattern(path12.parent.get("id"),bindings),node&&(isArray.check(node)?path12.each(function(childPath){recursiveScanChild(childPath,bindings,scopeTypes);}):namedTypes.Function.check(node)?(path12.get("params").each(function(paramPath){addPattern(paramPath,bindings);}),recursiveScanChild(path12.get("body"),bindings,scopeTypes),recursiveScanScope(path12.get("typeParameters"),bindings,scopeTypes)):namedTypes.TypeAlias&&namedTypes.TypeAlias.check(node)||namedTypes.InterfaceDeclaration&&namedTypes.InterfaceDeclaration.check(node)||namedTypes.TSTypeAliasDeclaration&&namedTypes.TSTypeAliasDeclaration.check(node)||namedTypes.TSInterfaceDeclaration&&namedTypes.TSInterfaceDeclaration.check(node)?addTypePattern(path12.get("id"),scopeTypes):namedTypes.VariableDeclarator.check(node)?(addPattern(path12.get("id"),bindings),recursiveScanChild(path12.get("init"),bindings,scopeTypes)):node.type==="ImportSpecifier"||node.type==="ImportNamespaceSpecifier"||node.type==="ImportDefaultSpecifier"?addPattern(path12.get(node.local?"local":node.name?"name":"id"),bindings):Node2.check(node)&&!Expression.check(node)&&types4.eachField(node,function(name,child){var childPath=path12.get(name);if(!pathHasValue(childPath,child))throw new Error("");recursiveScanChild(childPath,bindings,scopeTypes);}));}function pathHasValue(path12,value2){return !!(path12.value===value2||Array.isArray(path12.value)&&path12.value.length===0&&Array.isArray(value2)&&value2.length===0)}function recursiveScanChild(path12,bindings,scopeTypes){var node=path12.value;if(!(!node||Expression.check(node)))if(namedTypes.FunctionDeclaration.check(node)&&node.id!==null)addPattern(path12.get("id"),bindings);else if(namedTypes.ClassDeclaration&&namedTypes.ClassDeclaration.check(node)&&node.id!==null)addPattern(path12.get("id"),bindings),recursiveScanScope(path12.get("typeParameters"),bindings,scopeTypes);else if(namedTypes.InterfaceDeclaration&&namedTypes.InterfaceDeclaration.check(node)||namedTypes.TSInterfaceDeclaration&&namedTypes.TSInterfaceDeclaration.check(node))addTypePattern(path12.get("id"),scopeTypes);else if(ScopeType.check(node)){if(namedTypes.CatchClause.check(node)&&namedTypes.Identifier.check(node.param)){var catchParamName=node.param.name,hadBinding=hasOwn.call(bindings,catchParamName);recursiveScanScope(path12.get("body"),bindings,scopeTypes),hadBinding||delete bindings[catchParamName];}}else recursiveScanScope(path12,bindings,scopeTypes);}function addPattern(patternPath,bindings){var pattern=patternPath.value;namedTypes.Pattern.assert(pattern),namedTypes.Identifier.check(pattern)?hasOwn.call(bindings,pattern.name)?bindings[pattern.name].push(patternPath):bindings[pattern.name]=[patternPath]:namedTypes.AssignmentPattern&&namedTypes.AssignmentPattern.check(pattern)?addPattern(patternPath.get("left"),bindings):namedTypes.ObjectPattern&&namedTypes.ObjectPattern.check(pattern)?patternPath.get("properties").each(function(propertyPath){var property=propertyPath.value;namedTypes.Pattern.check(property)?addPattern(propertyPath,bindings):namedTypes.Property.check(property)||namedTypes.ObjectProperty&&namedTypes.ObjectProperty.check(property)?addPattern(propertyPath.get("value"),bindings):namedTypes.SpreadProperty&&namedTypes.SpreadProperty.check(property)&&addPattern(propertyPath.get("argument"),bindings);}):namedTypes.ArrayPattern&&namedTypes.ArrayPattern.check(pattern)?patternPath.get("elements").each(function(elementPath){var element=elementPath.value;namedTypes.Pattern.check(element)?addPattern(elementPath,bindings):namedTypes.SpreadElement&&namedTypes.SpreadElement.check(element)&&addPattern(elementPath.get("argument"),bindings);}):namedTypes.PropertyPattern&&namedTypes.PropertyPattern.check(pattern)?addPattern(patternPath.get("pattern"),bindings):(namedTypes.SpreadElementPattern&&namedTypes.SpreadElementPattern.check(pattern)||namedTypes.RestElement&&namedTypes.RestElement.check(pattern)||namedTypes.SpreadPropertyPattern&&namedTypes.SpreadPropertyPattern.check(pattern))&&addPattern(patternPath.get("argument"),bindings);}function addTypePattern(patternPath,types5){var pattern=patternPath.value;namedTypes.Pattern.assert(pattern),namedTypes.Identifier.check(pattern)&&(hasOwn.call(types5,pattern.name)?types5[pattern.name].push(patternPath):types5[pattern.name]=[patternPath]);}function addTypeParameter(parameterPath,types5){var parameter=parameterPath.value;FlowOrTSTypeParameterType.assert(parameter),hasOwn.call(types5,parameter.name)?types5[parameter.name].push(parameterPath):types5[parameter.name]=[parameterPath];}return Sp3.lookup=function(name){for(var scope2=this;scope2&&!scope2.declares(name);scope2=scope2.parent);return scope2},Sp3.lookupType=function(name){for(var scope2=this;scope2&&!scope2.declaresType(name);scope2=scope2.parent);return scope2},Sp3.getGlobalScope=function(){for(var scope2=this;!scope2.isGlobal;)scope2=scope2.parent;return scope2},Scope}exports.default=scopePlugin;(0, shared_1.maybeSetModuleExports)(function(){return module2});}});var require_node_path=__commonJS({"../../node_modules/recast/node_modules/ast-types/lib/node-path.js"(exports,module2){Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=(init_tslib_es6(),__toCommonJS(tslib_es6_exports)),types_1=tslib_1.__importDefault(require_types()),path_1=tslib_1.__importDefault(require_path()),scope_1=tslib_1.__importDefault(require_scope()),shared_1=require_shared();function nodePathPlugin(fork){var types4=fork.use(types_1.default),n10=types4.namedTypes,b8=types4.builders,isNumber=types4.builtInTypes.number,isArray=types4.builtInTypes.array,Path2=fork.use(path_1.default),Scope=fork.use(scope_1.default),NodePath=function Nod