diff --git a/packages/next/package.json b/packages/next/package.json index 2705d15591042..cd91759875e6a 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -218,7 +218,6 @@ "@types/ua-parser-js": "0.7.36", "@types/webpack-sources1": "npm:@types/webpack-sources@0.1.5", "@types/ws": "8.2.0", - "@typescript/vfs": "1.6.1", "@vercel/ncc": "0.34.0", "@vercel/nft": "0.27.1", "@vercel/turbopack-ecmascript-runtime": "*", diff --git a/packages/next/src/compiled/@typescript/vfs/LICENSE b/packages/next/src/compiled/@typescript/vfs/LICENSE deleted file mode 100644 index 9f2bf75b16d01..0000000000000 --- a/packages/next/src/compiled/@typescript/vfs/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -The MIT License (MIT) -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/next/src/compiled/@typescript/vfs/index.js b/packages/next/src/compiled/@typescript/vfs/index.js deleted file mode 100644 index b1d8d243e2de7..0000000000000 --- a/packages/next/src/compiled/@typescript/vfs/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var t={188:(t,r,i)=>{if(process.env.NODE_ENV==="production"){t.exports=i(994)}else{t.exports=i(121)}},121:(t,r,i)=>{Object.defineProperty(r,"__esModule",{value:true});function _extends(){_extends=Object.assign?Object.assign.bind():function(t){for(var r=1;rt?r:t})):undefined};var F=p.map((function(t){var r=m.filter((function(r){return r.startsWith("lib."+t.toLowerCase())}));if(r.length===0)return 0;var i=m.indexOf(r.pop());return i}));var x=h(F)||0;var S=Math.max(y,x);return m.slice(0,S+1)};var h=function createDefaultMapFromNodeModules(t,r,p){var m=D();var g=C();var v=function getLib(t){var r=p||m.dirname(i.ab+"typescript.js");return g.readFileSync(m.join(r,t),"utf8")};var y=function isDtsFile(t){return/\.d\.([^\.]+\.)?[cm]?ts$/i.test(t)};var h=g.readdirSync(p||m.dirname(i.ab+"typescript.js"));var F=h.filter((function(t){return t.startsWith("lib.")&&y(t)}));var x=new Map;F.forEach((function(t){x.set("/"+t,v(t))}));return x};var F=function addAllFilesFromFolder(t,r){var i=D();var p=C();var m=function walk(t){var r=[];var m=p.readdirSync(t);m.forEach((function(m){m=i.join(t,m);var g=p.statSync(m);if(g&&g.isDirectory()){r=r.concat(walk(m))}else{r.push(m)}}));return r};var g=m(r);g.forEach((function(m){var g="/node_modules/@types"+m.replace(r,"");var v=p.readFileSync(m,"utf8");var y=[".ts",".tsx"];if(y.includes(i.extname(g))){t.set(g,v)}}))};var x=function addFilesForTypesIntoFolder(t){return F(t,"node_modules/@types")};var S=function createDefaultMapFromCDN(t,r,i,p,m,g,v){var h=g||fetch;var F=new Map;var x=y(t,p);var S="https://playgroundcdn.typescriptlang.org/cdn/"+r+"/typescript/lib/";function zip(t){return m?m.compressToUTF16(t):t}function unzip(t){return m?m.decompressFromUTF16(t):t}function uncached(){return Promise.all(x.map((function(t){return h(S+t).then((function(t){return t.text()}))}))).then((function(t){t.forEach((function(t,r){return F.set("/"+x[r],t)}))}))["catch"]((function(){}))}function cached(){var t=v||localStorage;var i=Object.keys(t);i.forEach((function(i){if(i.startsWith("ts-lib-")&&!i.startsWith("ts-lib-"+r)){t.removeItem(i)}}));return Promise.all(x.map((function(i){var p="ts-lib-"+r+"-"+i;var m=t.getItem(p);if(!m){return h(S+i).then((function(t){return t.text()})).then((function(r){t.setItem(p,zip(r));return r}))["catch"]((function(){}))}else{return Promise.resolve(unzip(m))}}))).then((function(t){t.forEach((function(t,r){if(t){var i="/"+x[r];F.set(i,t)}}))}))}var w=i?cached:uncached;return w().then((function(){return F}))};function notImplemented(t){throw new Error("Method '"+t+"' is not implemented.")}function audit(t,r){return function(){for(var i=arguments.length,p=new Array(i),m=0;m "+t].concat(p));v("< "+y);return g}}var w=function defaultCompilerOptions(t){return _extends({},t.getDefaultCompilerOptions(),{jsx:t.JsxEmit.React,strict:true,esModuleInterop:true,module:t.ModuleKind.ESNext,suppressOutputPathCheck:true,skipLibCheck:true,skipDefaultLibCheck:true,moduleResolution:t.ModuleResolutionKind.NodeJs})};var E=function libize(t){return t.replace("/","/lib.").toLowerCase()};function createSystem(t){return{args:[],createDirectory:function createDirectory(){return notImplemented("createDirectory")},directoryExists:audit("directoryExists",(function(r){return Array.from(t.keys()).some((function(t){return t.startsWith(r)}))})),exit:function exit(){return notImplemented("exit")},fileExists:audit("fileExists",(function(r){return t.has(r)||t.has(E(r))})),getCurrentDirectory:function getCurrentDirectory(){return"/"},getDirectories:function getDirectories(){return[]},getExecutingFilePath:function getExecutingFilePath(){return notImplemented("getExecutingFilePath")},readDirectory:audit("readDirectory",(function(r){return r==="/"?Array.from(t.keys()):[]})),readFile:audit("readFile",(function(r){var i;return(i=t.get(r))!=null?i:t.get(E(r))})),resolvePath:function resolvePath(t){return t},newLine:"\n",useCaseSensitiveFileNames:true,write:function write(){return notImplemented("write")},writeFile:function writeFile(r,i){t.set(r,i)},deleteFile:function deleteFile(r){t["delete"](r)}}}function createFSBackedSystem(t,r,p,m){var g=r+"/vfs";var v=D();var y=p.sys;var h=m!=null?m:v.dirname(i.ab+"typescript.js");return{name:"fs-vfs",root:g,args:[],createDirectory:function createDirectory(){return notImplemented("createDirectory")},directoryExists:audit("directoryExists",(function(r){return Array.from(t.keys()).some((function(t){return t.startsWith(r)}))||y.directoryExists(r)})),exit:y.exit,fileExists:audit("fileExists",(function(r){if(t.has(r))return true;if(r.includes("tsconfig.json")||r.includes("tsconfig.json"))return false;if(r.startsWith("/lib")){var i=h+"/"+r.replace("/","");return y.fileExists(i)}return y.fileExists(r)})),getCurrentDirectory:function getCurrentDirectory(){return g},getDirectories:y.getDirectories,getExecutingFilePath:function getExecutingFilePath(){return notImplemented("getExecutingFilePath")},readDirectory:audit("readDirectory",(function(){if((arguments.length<=0?undefined:arguments[0])==="/"){return Array.from(t.keys())}else{return y.readDirectory.apply(y,arguments)}})),readFile:audit("readFile",(function(r){if(t.has(r))return t.get(r);if(r.startsWith("/lib")){var i=h+"/"+r.replace("/","");var p=y.readFile(i);if(!p){var m=y.readDirectory(h);throw new Error("TSVFS: A request was made for "+i+" but there wasn't a file found in the file map. You likely have a mismatch in the compiler options for the CDN download vs the compiler program. Existing Libs: "+m+".")}return p}return y.readFile(r)})),resolvePath:function resolvePath(r){if(t.has(r))return r;return y.resolvePath(r)},newLine:"\n",useCaseSensitiveFileNames:true,write:function write(){return notImplemented("write")},writeFile:function writeFile(r,i){t.set(r,i)},deleteFile:function deleteFile(r){t["delete"](r)},realpath:y.realpath}}function createVirtualCompilerHost(t,r,i){var p=new Map;var m=function save(t){p.set(t.fileName,t);return t};var g={compilerHost:_extends({},t,{getCanonicalFileName:function getCanonicalFileName(t){return t},getDefaultLibFileName:function getDefaultLibFileName(){return"/"+i.getDefaultLibFileName(r)},getNewLine:function getNewLine(){return t.newLine},getSourceFile:function getSourceFile(g,v){var y;return p.get(g)||m(i.createSourceFile(g,t.readFile(g),(y=v!=null?v:r.target)!=null?y:w(i).target,false))},useCaseSensitiveFileNames:function useCaseSensitiveFileNames(){return t.useCaseSensitiveFileNames}}),updateFile:function updateFile(r){var i=p.has(r.fileName);t.writeFile(r.fileName,r.text);p.set(r.fileName,r);return i},deleteFile:function deleteFile(r){var i=p.has(r.fileName);p["delete"](r.fileName);t.deleteFile(r.fileName);return i}};return g}function createVirtualLanguageServiceHost(t,r,i,p,m){var g=[].concat(r);var v=createVirtualCompilerHost(t,i,p),y=v.compilerHost,h=v.updateFile,F=v.deleteFile;var x=new Map;var S=0;var w=_extends({},y,{getProjectVersion:function getProjectVersion(){return S.toString()},getCompilationSettings:function getCompilationSettings(){return i},getCustomTransformers:function getCustomTransformers(){return m},getScriptFileNames:function getScriptFileNames(){return g.slice()},getScriptSnapshot:function getScriptSnapshot(r){var i=t.readFile(r);if(i&&typeof i==="string"){return p.ScriptSnapshot.fromString(i)}return},getScriptVersion:function getScriptVersion(t){return x.get(t)||"0"},writeFile:t.writeFile});var E={languageServiceHost:w,updateFile:function updateFile(t){S++;x.set(t.fileName,S.toString());if(!g.includes(t.fileName)){g.push(t.fileName)}h(t)},deleteFile:function deleteFile(t){S++;x.set(t.fileName,S.toString());var r=g.indexOf(t.fileName);if(r!==-1){g.splice(r,1)}F(t)}};return E}var D=function requirePath(){return require(String.fromCharCode(112,97,116,104))};var C=function requireFS(){return require(String.fromCharCode(102,115))};r.addAllFilesFromFolder=F;r.addFilesForTypesIntoFolder=x;r.createDefaultMapFromCDN=S;r.createDefaultMapFromNodeModules=h;r.createFSBackedSystem=createFSBackedSystem;r.createSystem=createSystem;r.createVirtualCompilerHost=createVirtualCompilerHost;r.createVirtualLanguageServiceHost=createVirtualLanguageServiceHost;r.createVirtualTypeScriptEnvironment=createVirtualTypeScriptEnvironment;r.knownLibFilesForCompilerOptions=y},994:(t,r,i)=>{function e(){return e=Object.assign?Object.assign.bind():function(t){for(var r=1;rt?r:t})):void 0)||0,x=Math.max(y,F);return m.slice(0,x+1)},n=function(t,r){var i=f(),p=b();(function e(t){var r=[];return p.readdirSync(t).forEach((function(m){m=i.join(t,m);var g=p.statSync(m);g&&g.isDirectory()?r=r.concat(e(m)):r.push(m)})),r})(r).forEach((function(m){var g="/node_modules/@types"+m.replace(r,""),v=p.readFileSync(m,"utf8");[".ts",".tsx"].includes(i.extname(g))&&t.set(g,v)}))};function l(t){throw new Error("Method '"+t+"' is not implemented.")}function o(t,r){return function(){for(var i=arguments.length,p=new Array(i),m=0;m "+t].concat(p)),g("< "+y),v}}var a=function(t){return e({},t.getDefaultCompilerOptions(),{jsx:t.JsxEmit.React,strict:!0,esModuleInterop:!0,module:t.ModuleKind.ESNext,suppressOutputPathCheck:!0,skipLibCheck:!0,skipDefaultLibCheck:!0,moduleResolution:t.ModuleResolutionKind.NodeJs})},c=function(t){return t.replace("/","/lib.").toLowerCase()};function u(t,r,i){var p=new Map;return{compilerHost:e({},t,{getCanonicalFileName:function(t){return t},getDefaultLibFileName:function(){return"/"+i.getDefaultLibFileName(r)},getNewLine:function(){return t.newLine},getSourceFile:function(m,g){var v,y;return p.get(m)||(y=i.createSourceFile(m,t.readFile(m),null!=(v=null!=g?g:r.target)?v:a(i).target,!1),p.set(y.fileName,y),y)},useCaseSensitiveFileNames:function(){return t.useCaseSensitiveFileNames}}),updateFile:function(r){var i=p.has(r.fileName);return t.writeFile(r.fileName,r.text),p.set(r.fileName,r),i},deleteFile:function(r){var i=p.has(r.fileName);return p.delete(r.fileName),t.deleteFile(r.fileName),i}}}function d(t,r,i,p,m){var g=[].concat(r),v=u(t,i,p),y=v.compilerHost,h=v.updateFile,F=v.deleteFile,x=new Map,S=0;return{languageServiceHost:e({},y,{getProjectVersion:function(){return S.toString()},getCompilationSettings:function(){return i},getCustomTransformers:function(){return m},getScriptFileNames:function(){return g.slice()},getScriptSnapshot:function(r){var i=t.readFile(r);if(i&&"string"==typeof i)return p.ScriptSnapshot.fromString(i)},getScriptVersion:function(t){return x.get(t)||"0"},writeFile:t.writeFile}),updateFile:function(t){S++,x.set(t.fileName,S.toString()),g.includes(t.fileName)||g.push(t.fileName),h(t)},deleteFile:function(t){S++,x.set(t.fileName,S.toString());var r=g.indexOf(t.fileName);-1!==r&&g.splice(r,1),F(t)}}}var f=function(){return require(String.fromCharCode(112,97,116,104))},b=function(){return require(String.fromCharCode(102,115))};r.addAllFilesFromFolder=n,r.addFilesForTypesIntoFolder=function(t){return n(t,"node_modules/@types")},r.createDefaultMapFromCDN=function(t,r,i,p,m,g,v){var y=g||fetch,h=new Map,F=s(t,p),x="https://playgroundcdn.typescriptlang.org/cdn/"+r+"/typescript/lib/";return(i?function(){var t=v||localStorage;return Object.keys(t).forEach((function(i){i.startsWith("ts-lib-")&&!i.startsWith("ts-lib-"+r)&&t.removeItem(i)})),Promise.all(F.map((function(i){var p,g="ts-lib-"+r+"-"+i,v=t.getItem(g);return v?Promise.resolve((p=v,m?m.decompressFromUTF16(p):p)):y(x+i).then((function(t){return t.text()})).then((function(r){var i;return t.setItem(g,(i=r,m?m.compressToUTF16(i):i)),r})).catch((function(){}))}))).then((function(t){t.forEach((function(t,r){t&&h.set("/"+F[r],t)}))}))}:function(){return Promise.all(F.map((function(t){return y(x+t).then((function(t){return t.text()}))}))).then((function(t){t.forEach((function(t,r){return h.set("/"+F[r],t)}))})).catch((function(){}))})().then((function(){return h}))},r.createDefaultMapFromNodeModules=function(t,r,p){var m=f(),g=b(),v=g.readdirSync(p||m.dirname(i.ab+"typescript.js")).filter((function(t){return t.startsWith("lib.")&&/\.d\.([^\.]+\.)?[cm]?ts$/i.test(t)})),y=new Map;return v.forEach((function(t){y.set("/"+t,function(t){var r=p||m.dirname(i.ab+"typescript.js");return g.readFileSync(m.join(r,t),"utf8")}(t))})),y},r.createFSBackedSystem=function(t,r,p,m){var g=r+"/vfs",v=f(),y=p.sys,h=null!=m?m:v.dirname(i.ab+"typescript.js");return{name:"fs-vfs",root:g,args:[],createDirectory:function(){return l("createDirectory")},directoryExists:o("directoryExists",(function(r){return Array.from(t.keys()).some((function(t){return t.startsWith(r)}))||y.directoryExists(r)})),exit:y.exit,fileExists:o("fileExists",(function(r){if(t.has(r))return!0;if(r.includes("tsconfig.json")||r.includes("tsconfig.json"))return!1;if(r.startsWith("/lib")){var i=h+"/"+r.replace("/","");return y.fileExists(i)}return y.fileExists(r)})),getCurrentDirectory:function(){return g},getDirectories:y.getDirectories,getExecutingFilePath:function(){return l("getExecutingFilePath")},readDirectory:o("readDirectory",(function(){return"/"===(arguments.length<=0?void 0:arguments[0])?Array.from(t.keys()):y.readDirectory.apply(y,arguments)})),readFile:o("readFile",(function(r){if(t.has(r))return t.get(r);if(r.startsWith("/lib")){var i=h+"/"+r.replace("/",""),p=y.readFile(i);if(!p){var m=y.readDirectory(h);throw new Error("TSVFS: A request was made for "+i+" but there wasn't a file found in the file map. You likely have a mismatch in the compiler options for the CDN download vs the compiler program. Existing Libs: "+m+".")}return p}return y.readFile(r)})),resolvePath:function(r){return t.has(r)?r:y.resolvePath(r)},newLine:"\n",useCaseSensitiveFileNames:!0,write:function(){return l("write")},writeFile:function(r,i){t.set(r,i)},deleteFile:function(r){t.delete(r)},realpath:y.realpath}},r.createSystem=function(t){return{args:[],createDirectory:function(){return l("createDirectory")},directoryExists:o("directoryExists",(function(r){return Array.from(t.keys()).some((function(t){return t.startsWith(r)}))})),exit:function(){return l("exit")},fileExists:o("fileExists",(function(r){return t.has(r)||t.has(c(r))})),getCurrentDirectory:function(){return"/"},getDirectories:function(){return[]},getExecutingFilePath:function(){return l("getExecutingFilePath")},readDirectory:o("readDirectory",(function(r){return"/"===r?Array.from(t.keys()):[]})),readFile:o("readFile",(function(r){var i;return null!=(i=t.get(r))?i:t.get(c(r))})),resolvePath:function(t){return t},newLine:"\n",useCaseSensitiveFileNames:!0,write:function(){return l("write")},writeFile:function(r,i){t.set(r,i)},deleteFile:function(r){t.delete(r)}}},r.createVirtualCompilerHost=u,r.createVirtualLanguageServiceHost=d,r.createVirtualTypeScriptEnvironment=function(t,r,i,p,m){void 0===p&&(p={});var g=e({},a(i),p),v=d(t,r,g,i,m),y=v.updateFile,h=v.deleteFile,F=i.createLanguageService(v.languageServiceHost),x=F.getCompilerOptionsDiagnostics();if(x.length){var S=u(t,p,i);throw new Error(i.formatDiagnostics(x,S.compilerHost))}return{name:"vfs",sys:t,languageService:F,getSourceFile:function(t){var r;return null==(r=F.getProgram())?void 0:r.getSourceFile(t)},createFile:function(t,r){y(i.createSourceFile(t,r,g.target,!1))},updateFile:function(t,r,p){var m=F.getProgram().getSourceFile(t);if(!m)throw new Error("Did not find a source file for "+t);var g=m.text,v=null!=p?p:i.createTextSpan(0,g.length),h=g.slice(0,v.start)+r+g.slice(v.start+v.length),x=i.updateSourceFile(m,h,{span:v,newLength:r.length});y(x)},deleteFile:function(t){var r=F.getProgram().getSourceFile(t);r&&h(r)}}},r.knownLibFilesForCompilerOptions=s}};var r={};function __nccwpck_require__(i){var p=r[i];if(p!==undefined){return p.exports}var m=r[i]={exports:{}};var g=true;try{t[i](m,m.exports,__nccwpck_require__);g=false}finally{if(g)delete r[i]}return m.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(188);module.exports=i})(); \ No newline at end of file diff --git a/packages/next/src/compiled/@typescript/vfs/package.json b/packages/next/src/compiled/@typescript/vfs/package.json deleted file mode 100644 index 8e5c933168498..0000000000000 --- a/packages/next/src/compiled/@typescript/vfs/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"@typescript/vfs","main":"index.js","author":"TypeScript team","license":"MIT"} diff --git a/packages/next/src/compiled/@typescript/vfs/typescript.js b/packages/next/src/compiled/@typescript/vfs/typescript.js deleted file mode 100644 index 9373e1a75d4c3..0000000000000 --- a/packages/next/src/compiled/@typescript/vfs/typescript.js +++ /dev/null @@ -1,21 +0,0 @@ -(()=>{var e={274:e=>{var t=Object.prototype.toString;var n=typeof Buffer!=="undefined"&&typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return t.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,t,r){t>>>=0;var i=e.byteLength-t;if(i<0){throw new RangeError("'offset' is out of bounds")}if(r===undefined){r=i}else{r>>>=0;if(r>i){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(t,t+r)):new Buffer(new Uint8Array(e.slice(t,t+r)))}function fromString(e,t){if(typeof t!=="string"||t===""){t="utf8"}if(!Buffer.isEncoding(t)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,t):new Buffer(e,t)}function bufferFrom(e,t,r){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,t,r)}if(typeof e==="string"){return fromString(e,t)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},737:(e,t,n)=>{e=n.nmd(e);var r=n(749).SourceMapConsumer;var i=n(17);var o;try{o=n(147);if(!o.existsSync||!o.readFileSync){o=null}}catch(e){}var a=n(274);function dynamicRequire(e,t){return e.require(t)}var s=false;var c=false;var l=false;var d="auto";var p={};var u={};var f=/^data:application\/json[^,]+base64,/;var m=[];var _=[];function isInBrowser(){if(d==="browser")return true;if(d==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(t){for(var n=0;n"}var n=this.getLineNumber();if(n!=null){t+=":"+n;var r=this.getColumnNumber();if(r){t+=":"+r}}}var i="";var o=this.getFunctionName();var a=true;var s=this.isConstructor();var c=!(this.isToplevel()||s);if(c){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var d=this.getMethodName();if(o){if(l&&o.indexOf(l)!=0){i+=l+"."}i+=o;if(d&&o.indexOf("."+d)!=o.length-d.length-1){i+=" [as "+d+"]"}}else{i+=l+"."+(d||"")}}else if(s){i+="new "+(o||"")}else if(o){i+=o}else{i+=t;a=false}if(a){i+=" ("+t+")"}return i}function cloneCallSite(e){var t={};Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(n){t[n]=/^(?:is|get)/.test(n)?function(){return e[n].call(e)}:e[n]}));t.toString=CallSiteToString;return t}function wrapCallSite(e,t){if(t===undefined){t={nextPosition:null,curPosition:null}}if(e.isNative()){t.curPosition=null;return e}var n=e.getFileName()||e.getScriptNameOrSourceURL();if(n){var r=e.getLineNumber();var i=e.getColumnNumber()-1;var o=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;var a=o.test(globalProcessVersion())?0:62;if(r===1&&i>a&&!isInBrowser()&&!e.isEval()){i-=a}var s=mapSourcePosition({source:n,line:r,column:i});t.curPosition=s;e=cloneCallSite(e);var c=e.getFunctionName;e.getFunctionName=function(){if(t.nextPosition==null){return c()}return t.nextPosition.name||c()};e.getFileName=function(){return s.source};e.getLineNumber=function(){return s.line};e.getColumnNumber=function(){return s.column+1};e.getScriptNameOrSourceURL=function(){return s.source};return e}var l=e.isEval()&&e.getEvalOrigin();if(l){l=mapEvalOrigin(l);e=cloneCallSite(e);e.getEvalOrigin=function(){return l};return e}return e}function prepareStackTrace(e,t){if(l){p={};u={}}var n=e.name||"Error";var r=e.message||"";var i=n+": "+r;var o={nextPosition:null,curPosition:null};var a=[];for(var s=t.length-1;s>=0;s--){a.push("\n at "+wrapCallSite(t[s],o));o.nextPosition=o.curPosition}o.curPosition=o.nextPosition=null;return i+a.reverse().join("")}function getErrorSource(e){var t=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack);if(t){var n=t[1];var r=+t[2];var i=+t[3];var a=p[n];if(!a&&o&&o.existsSync(n)){try{a=o.readFileSync(n,"utf8")}catch(e){a=""}}if(a){var s=a.split(/(?:\r\n|\r|\n)/)[r-1];if(s){return n+":"+r+"\n"+s+"\n"+new Array(i).join(" ")+"^"}}}return null}function printErrorAndExit(e){var t=getErrorSource(e);var n=globalProcessStderr();if(n&&n._handle&&n._handle.setBlocking){n._handle.setBlocking(true)}if(t){console.error();console.error(t)}console.error(e.stack);globalProcessExit(1)}function shimEmitUncaughtException(){var e=process.emit;process.emit=function(t){if(t==="uncaughtException"){var n=arguments[1]&&arguments[1].stack;var r=this.listeners(t).length>0;if(n&&!r){return printErrorAndExit(arguments[1])}}return e.apply(this,arguments)}}var h=m.slice(0);var T=_.slice(0);t.wrapCallSite=wrapCallSite;t.getErrorSource=getErrorSource;t.mapSourcePosition=mapSourcePosition;t.retrieveSourceMap=y;t.install=function(t){t=t||{};if(t.environment){d=t.environment;if(["node","browser","auto"].indexOf(d)===-1){throw new Error("environment "+d+" was unknown. Available options are {auto, browser, node}")}}if(t.retrieveFile){if(t.overrideRetrieveFile){m.length=0}m.unshift(t.retrieveFile)}if(t.retrieveSourceMap){if(t.overrideRetrieveSourceMap){_.length=0}_.unshift(t.retrieveSourceMap)}if(t.hookRequire&&!isInBrowser()){var n=dynamicRequire(e,"module");var r=n.prototype._compile;if(!r.__sourceMapSupport){n.prototype._compile=function(e,t){p[t]=e;u[t]=undefined;return r.call(this,e,t)};n.prototype._compile.__sourceMapSupport=true}}if(!l){l="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:false}if(!s){s=true;Error.prepareStackTrace=prepareStackTrace}if(!c){var i="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:true;try{var o=dynamicRequire(e,"worker_threads");if(o.isMainThread===false){i=false}}catch(e){}if(i&&hasGlobalProcessEventEmitter()){c=true;shimEmitUncaughtException()}}};t.resetRetrieveHandlers=function(){m.length=0;_.length=0;m=h.slice(0);_=T.slice(0);y=handlerExec(_);g=handlerExec(m)}},219:(e,t,n)=>{ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -var r={};(e=>{"use strict";var t=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var __export=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:true})};var __copyProps=(e,n,a,s)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let c of i(n))if(!o.call(e,c)&&c!==a)t(e,c,{get:()=>n[c],enumerable:!(s=r(n,c))||s.enumerable})}return e};var __toCommonJS=e=>(__copyProps,e);var a={};__export(a,{ANONYMOUS:()=>ec,AccessFlags:()=>Oe,AssertionLevel:()=>_,AssignmentDeclarationKind:()=>ze,AssignmentKind:()=>Sn,Associativity:()=>xn,BreakpointResolver:()=>ed,BuilderFileEmit:()=>Xa,BuilderProgramKind:()=>Ya,BuilderState:()=>Qa,CallHierarchy:()=>td,CharacterCodes:()=>it,CheckFlags:()=>Ne,CheckMode:()=>ia,ClassificationType:()=>Hs,ClassificationTypeNames:()=>qs,CommentDirectiveType:()=>se,Comparison:()=>l,CompletionInfoFlags:()=>Bs,CompletionTriggerKind:()=>Is,Completions:()=>xf,ContainerFlags:()=>Vo,ContextFlags:()=>ye,Debug:()=>S,DiagnosticCategory:()=>Ve,Diagnostics:()=>wt,DocumentHighlights:()=>oc,ElementFlags:()=>Ae,EmitFlags:()=>ct,EmitHint:()=>ut,EmitOnly:()=>pe,EndOfLineState:()=>Ws,ExitStatus:()=>fe,ExportKind:()=>rc,Extension:()=>ot,ExternalEmitHelpers:()=>pt,FileIncludeKind:()=>le,FilePreprocessingDiagnosticsKind:()=>de,FileSystemEntryKind:()=>kt,FileWatcherEventKind:()=>Tt,FindAllReferences:()=>Rf,FlattenLevel:()=>Ta,FlowFlags:()=>ae,ForegroundColorEscapeSequences:()=>Ma,FunctionFlags:()=>vn,GeneratedIdentifierFlags:()=>re,GetLiteralTextFlags:()=>fn,GoToDefinition:()=>Vf,HighlightSpanKind:()=>Os,IdentifierNameMap:()=>ya,ImportKind:()=>nc,ImportsNotUsedAsValues:()=>Ye,IndentStyle:()=>ws,IndexFlags:()=>we,IndexKind:()=>Be,InferenceFlags:()=>We,InferencePriority:()=>Je,InlayHintKind:()=>As,InlayHints:()=>Hf,InternalEmitFlags:()=>lt,InternalNodeBuilderFlags:()=>Te,InternalSymbolName:()=>ke,IntersectionFlags:()=>ge,InvalidatedProjectKind:()=>os,JSDocParsingMode:()=>ht,JsDoc:()=>Gf,JsTyping:()=>ps,JsxEmit:()=>Xe,JsxFlags:()=>ee,JsxReferenceKind:()=>Le,LanguageFeatureMinimumTarget:()=>dt,LanguageServiceMode:()=>ks,LanguageVariant:()=>nt,LexicalEnvironmentFlags:()=>mt,ListFormat:()=>_t,LogLevel:()=>T,MapCode:()=>Yf,MemberOverrideStatus:()=>me,ModifierFlags:()=>Z,ModuleDetectionKind:()=>He,ModuleInstanceState:()=>zo,ModuleKind:()=>Qe,ModuleResolutionKind:()=>qe,ModuleSpecifierEnding:()=>Er,NavigateTo:()=>mc,NavigationBar:()=>_c,NewLineKind:()=>Ze,NodeBuilderFlags:()=>he,NodeCheckFlags:()=>Fe,NodeFactoryFlags:()=>Rr,NodeFlags:()=>Y,NodeResolutionFeatures:()=>Jo,ObjectFlags:()=>De,OperationCanceledException:()=>ce,OperatorPrecedence:()=>bn,OrganizeImports:()=>Zf,OrganizeImportsMode:()=>Ds,OuterExpressionKinds:()=>ft,OutliningElementsCollector:()=>em,OutliningSpanKind:()=>js,OutputFileType:()=>Js,PackageJsonAutoImportPreference:()=>Ns,PackageJsonDependencyGroup:()=>Es,PatternMatchKind:()=>ac,PollingInterval:()=>St,PollingWatchKind:()=>$e,PragmaKindFlags:()=>gt,PredicateSemantics:()=>ne,PreparePasteEdits:()=>Lm,PrivateIdentifierKind:()=>qr,ProcessLevel:()=>Sa,ProgramUpdateLevel:()=>wa,QuotePreference:()=>Xs,RegularExpressionFlags:()=>ie,RelationComparisonResult:()=>te,Rename:()=>nm,ScriptElementKind:()=>zs,ScriptElementKindModifier:()=>Vs,ScriptKind:()=>et,ScriptSnapshot:()=>Cs,ScriptTarget:()=>tt,SemanticClassificationFormat:()=>Ps,SemanticMeaning:()=>Ks,SemicolonPreference:()=>Ls,SignatureCheckMode:()=>oa,SignatureFlags:()=>Re,SignatureHelp:()=>rm,SignatureInfo:()=>$a,SignatureKind:()=>Me,SmartSelectionRange:()=>am,SnippetKind:()=>st,StatisticType:()=>as,StructureIsReused:()=>ue,SymbolAccessibility:()=>xe,SymbolDisplay:()=>cm,SymbolDisplayPartKind:()=>Rs,SymbolFlags:()=>Ee,SymbolFormatFlags:()=>ve,SyntaxKind:()=>X,Ternary:()=>Ue,ThrottledCancellationToken:()=>Xl,TokenClass:()=>Us,TokenFlags:()=>oe,TransformFlags:()=>at,TypeFacts:()=>na,TypeFlags:()=>Pe,TypeFormatFlags:()=>Se,TypeMapKind:()=>je,TypePredicateKind:()=>be,TypeReferenceSerializationKind:()=>Ce,UnionReduction:()=>_e,UpToDateStatusType:()=>rs,VarianceFlags:()=>Ie,Version:()=>F,VersionRange:()=>P,WatchDirectoryFlags:()=>rt,WatchDirectoryKind:()=>Ke,WatchFileKind:()=>Ge,WatchLogLevel:()=>La,WatchType:()=>ns,accessPrivateIdentifier:()=>accessPrivateIdentifier,addEmitFlags:()=>addEmitFlags,addEmitHelper:()=>addEmitHelper,addEmitHelpers:()=>addEmitHelpers,addInternalEmitFlags:()=>addInternalEmitFlags,addNodeFactoryPatcher:()=>addNodeFactoryPatcher,addObjectAllocatorPatcher:()=>addObjectAllocatorPatcher,addRange:()=>addRange,addRelatedInfo:()=>addRelatedInfo,addSyntheticLeadingComment:()=>addSyntheticLeadingComment,addSyntheticTrailingComment:()=>addSyntheticTrailingComment,addToSeen:()=>addToSeen,advancedAsyncSuperHelper:()=>Ci,affectsDeclarationPathOptionDeclarations:()=>ro,affectsEmitOptionDeclarations:()=>no,allKeysStartWithDot:()=>allKeysStartWithDot,altDirectorySeparator:()=>Dt,and:()=>and,append:()=>append,appendIfUnique:()=>appendIfUnique,arrayFrom:()=>arrayFrom,arrayIsEqualTo:()=>arrayIsEqualTo,arrayIsHomogeneous:()=>arrayIsHomogeneous,arrayOf:()=>arrayOf,arrayReverseIterator:()=>arrayReverseIterator,arrayToMap:()=>arrayToMap,arrayToMultiMap:()=>arrayToMultiMap,arrayToNumericMap:()=>arrayToNumericMap,assertType:()=>assertType,assign:()=>assign,asyncSuperHelper:()=>bi,attachFileToDiagnostics:()=>attachFileToDiagnostics,base64decode:()=>base64decode,base64encode:()=>base64encode,binarySearch:()=>binarySearch,binarySearchKey:()=>binarySearchKey,bindSourceFile:()=>bindSourceFile,breakIntoCharacterSpans:()=>breakIntoCharacterSpans,breakIntoWordSpans:()=>breakIntoWordSpans,buildLinkParts:()=>buildLinkParts,buildOpts:()=>mo,buildOverload:()=>buildOverload,bundlerModuleNameResolver:()=>bundlerModuleNameResolver,canBeConvertedToAsync:()=>canBeConvertedToAsync,canHaveDecorators:()=>canHaveDecorators,canHaveExportModifier:()=>canHaveExportModifier,canHaveFlowNode:()=>canHaveFlowNode,canHaveIllegalDecorators:()=>canHaveIllegalDecorators,canHaveIllegalModifiers:()=>canHaveIllegalModifiers,canHaveIllegalType:()=>canHaveIllegalType,canHaveIllegalTypeParameters:()=>canHaveIllegalTypeParameters,canHaveJSDoc:()=>canHaveJSDoc,canHaveLocals:()=>canHaveLocals,canHaveModifiers:()=>canHaveModifiers,canHaveModuleSpecifier:()=>canHaveModuleSpecifier,canHaveSymbol:()=>canHaveSymbol,canIncludeBindAndCheckDiagnostics:()=>canIncludeBindAndCheckDiagnostics,canJsonReportNoInputFiles:()=>canJsonReportNoInputFiles,canProduceDiagnostics:()=>canProduceDiagnostics,canUsePropertyAccess:()=>canUsePropertyAccess,canWatchAffectingLocation:()=>canWatchAffectingLocation,canWatchAtTypes:()=>canWatchAtTypes,canWatchDirectoryOrFile:()=>canWatchDirectoryOrFile,canWatchDirectoryOrFilePath:()=>canWatchDirectoryOrFilePath,cartesianProduct:()=>cartesianProduct,cast:()=>cast,chainBundle:()=>chainBundle,chainDiagnosticMessages:()=>chainDiagnosticMessages,changeAnyExtension:()=>changeAnyExtension,changeCompilerHostLikeToUseCache:()=>changeCompilerHostLikeToUseCache,changeExtension:()=>changeExtension,changeFullExtension:()=>changeFullExtension,changesAffectModuleResolution:()=>changesAffectModuleResolution,changesAffectingProgramStructure:()=>changesAffectingProgramStructure,characterCodeToRegularExpressionFlag:()=>characterCodeToRegularExpressionFlag,childIsDecorated:()=>childIsDecorated,classElementOrClassElementParameterIsDecorated:()=>classElementOrClassElementParameterIsDecorated,classHasClassThisAssignment:()=>classHasClassThisAssignment,classHasDeclaredOrExplicitlyAssignedName:()=>classHasDeclaredOrExplicitlyAssignedName,classHasExplicitlyAssignedName:()=>classHasExplicitlyAssignedName,classOrConstructorParameterIsDecorated:()=>classOrConstructorParameterIsDecorated,classicNameResolver:()=>classicNameResolver,classifier:()=>nd,cleanExtendedConfigCache:()=>cleanExtendedConfigCache,clear:()=>clear,clearMap:()=>clearMap,clearSharedExtendedConfigFileWatcher:()=>clearSharedExtendedConfigFileWatcher,climbPastPropertyAccess:()=>climbPastPropertyAccess,clone:()=>clone,cloneCompilerOptions:()=>cloneCompilerOptions,closeFileWatcher:()=>closeFileWatcher,closeFileWatcherOf:()=>closeFileWatcherOf,codefix:()=>id,collapseTextChangeRangesAcrossMultipleVersions:()=>collapseTextChangeRangesAcrossMultipleVersions,collectExternalModuleInfo:()=>collectExternalModuleInfo,combine:()=>combine,combinePaths:()=>combinePaths,commandLineOptionOfCustomType:()=>po,commentPragmas:()=>yt,commonOptionsWithBuild:()=>Qi,compact:()=>compact,compareBooleans:()=>compareBooleans,compareDataObjects:()=>compareDataObjects,compareDiagnostics:()=>compareDiagnostics,compareEmitHelpers:()=>compareEmitHelpers,compareNumberOfDirectorySeparators:()=>compareNumberOfDirectorySeparators,comparePaths:()=>comparePaths,comparePathsCaseInsensitive:()=>comparePathsCaseInsensitive,comparePathsCaseSensitive:()=>comparePathsCaseSensitive,comparePatternKeys:()=>comparePatternKeys,compareProperties:()=>compareProperties,compareStringsCaseInsensitive:()=>compareStringsCaseInsensitive,compareStringsCaseInsensitiveEslintCompatible:()=>compareStringsCaseInsensitiveEslintCompatible,compareStringsCaseSensitive:()=>compareStringsCaseSensitive,compareStringsCaseSensitiveUI:()=>compareStringsCaseSensitiveUI,compareTextSpans:()=>compareTextSpans,compareValues:()=>compareValues,compilerOptionsAffectDeclarationPath:()=>compilerOptionsAffectDeclarationPath,compilerOptionsAffectEmit:()=>compilerOptionsAffectEmit,compilerOptionsAffectSemanticDiagnostics:()=>compilerOptionsAffectSemanticDiagnostics,compilerOptionsDidYouMeanDiagnostics:()=>To,compilerOptionsIndicateEsModules:()=>compilerOptionsIndicateEsModules,computeCommonSourceDirectoryOfFilenames:()=>computeCommonSourceDirectoryOfFilenames,computeLineAndCharacterOfPosition:()=>computeLineAndCharacterOfPosition,computeLineOfPosition:()=>computeLineOfPosition,computeLineStarts:()=>computeLineStarts,computePositionOfLineAndCharacter:()=>computePositionOfLineAndCharacter,computeSignatureWithDiagnostics:()=>computeSignatureWithDiagnostics,computeSuggestionDiagnostics:()=>computeSuggestionDiagnostics,computedOptions:()=>Wn,concatenate:()=>concatenate,concatenateDiagnosticMessageChains:()=>concatenateDiagnosticMessageChains,consumesNodeCoreModules:()=>consumesNodeCoreModules,contains:()=>contains,containsIgnoredPath:()=>containsIgnoredPath,containsObjectRestOrSpread:()=>containsObjectRestOrSpread,containsParseError:()=>containsParseError,containsPath:()=>containsPath,convertCompilerOptionsForTelemetry:()=>convertCompilerOptionsForTelemetry,convertCompilerOptionsFromJson:()=>convertCompilerOptionsFromJson,convertJsonOption:()=>convertJsonOption,convertToBase64:()=>convertToBase64,convertToJson:()=>convertToJson,convertToObject:()=>convertToObject,convertToOptionsWithAbsolutePaths:()=>convertToOptionsWithAbsolutePaths,convertToRelativePath:()=>convertToRelativePath,convertToTSConfig:()=>convertToTSConfig,convertTypeAcquisitionFromJson:()=>convertTypeAcquisitionFromJson,copyComments:()=>copyComments,copyEntries:()=>copyEntries,copyLeadingComments:()=>copyLeadingComments,copyProperties:()=>copyProperties,copyTrailingAsLeadingComments:()=>copyTrailingAsLeadingComments,copyTrailingComments:()=>copyTrailingComments,couldStartTrivia:()=>couldStartTrivia,countWhere:()=>countWhere,createAbstractBuilder:()=>createAbstractBuilder,createAccessorPropertyBackingField:()=>createAccessorPropertyBackingField,createAccessorPropertyGetRedirector:()=>createAccessorPropertyGetRedirector,createAccessorPropertySetRedirector:()=>createAccessorPropertySetRedirector,createBaseNodeFactory:()=>createBaseNodeFactory,createBinaryExpressionTrampoline:()=>createBinaryExpressionTrampoline,createBuilderProgram:()=>createBuilderProgram,createBuilderProgramUsingIncrementalBuildInfo:()=>createBuilderProgramUsingIncrementalBuildInfo,createBuilderStatusReporter:()=>createBuilderStatusReporter,createCacheableExportInfoMap:()=>createCacheableExportInfoMap,createCachedDirectoryStructureHost:()=>createCachedDirectoryStructureHost,createClassifier:()=>createClassifier,createCommentDirectivesMap:()=>createCommentDirectivesMap,createCompilerDiagnostic:()=>createCompilerDiagnostic,createCompilerDiagnosticForInvalidCustomType:()=>createCompilerDiagnosticForInvalidCustomType,createCompilerDiagnosticFromMessageChain:()=>createCompilerDiagnosticFromMessageChain,createCompilerHost:()=>createCompilerHost,createCompilerHostFromProgramHost:()=>createCompilerHostFromProgramHost,createCompilerHostWorker:()=>createCompilerHostWorker,createDetachedDiagnostic:()=>createDetachedDiagnostic,createDiagnosticCollection:()=>createDiagnosticCollection,createDiagnosticForFileFromMessageChain:()=>createDiagnosticForFileFromMessageChain,createDiagnosticForNode:()=>createDiagnosticForNode,createDiagnosticForNodeArray:()=>createDiagnosticForNodeArray,createDiagnosticForNodeArrayFromMessageChain:()=>createDiagnosticForNodeArrayFromMessageChain,createDiagnosticForNodeFromMessageChain:()=>createDiagnosticForNodeFromMessageChain,createDiagnosticForNodeInSourceFile:()=>createDiagnosticForNodeInSourceFile,createDiagnosticForRange:()=>createDiagnosticForRange,createDiagnosticMessageChainFromDiagnostic:()=>createDiagnosticMessageChainFromDiagnostic,createDiagnosticReporter:()=>createDiagnosticReporter,createDocumentPositionMapper:()=>createDocumentPositionMapper,createDocumentRegistry:()=>createDocumentRegistry,createDocumentRegistryInternal:()=>createDocumentRegistryInternal,createEmitAndSemanticDiagnosticsBuilderProgram:()=>createEmitAndSemanticDiagnosticsBuilderProgram,createEmitHelperFactory:()=>createEmitHelperFactory,createEmptyExports:()=>createEmptyExports,createEvaluator:()=>createEvaluator,createExpressionForJsxElement:()=>createExpressionForJsxElement,createExpressionForJsxFragment:()=>createExpressionForJsxFragment,createExpressionForObjectLiteralElementLike:()=>createExpressionForObjectLiteralElementLike,createExpressionForPropertyName:()=>createExpressionForPropertyName,createExpressionFromEntityName:()=>createExpressionFromEntityName,createExternalHelpersImportDeclarationIfNeeded:()=>createExternalHelpersImportDeclarationIfNeeded,createFileDiagnostic:()=>createFileDiagnostic,createFileDiagnosticFromMessageChain:()=>createFileDiagnosticFromMessageChain,createFlowNode:()=>createFlowNode,createForOfBindingStatement:()=>createForOfBindingStatement,createFutureSourceFile:()=>createFutureSourceFile,createGetCanonicalFileName:()=>createGetCanonicalFileName,createGetIsolatedDeclarationErrors:()=>createGetIsolatedDeclarationErrors,createGetSourceFile:()=>createGetSourceFile,createGetSymbolAccessibilityDiagnosticForNode:()=>createGetSymbolAccessibilityDiagnosticForNode,createGetSymbolAccessibilityDiagnosticForNodeName:()=>createGetSymbolAccessibilityDiagnosticForNodeName,createGetSymbolWalker:()=>createGetSymbolWalker,createIncrementalCompilerHost:()=>createIncrementalCompilerHost,createIncrementalProgram:()=>createIncrementalProgram,createJsxFactoryExpression:()=>createJsxFactoryExpression,createLanguageService:()=>createLanguageService,createLanguageServiceSourceFile:()=>createLanguageServiceSourceFile,createMemberAccessForPropertyName:()=>createMemberAccessForPropertyName,createModeAwareCache:()=>createModeAwareCache,createModeAwareCacheKey:()=>createModeAwareCacheKey,createModeMismatchDetails:()=>createModeMismatchDetails,createModuleNotFoundChain:()=>createModuleNotFoundChain,createModuleResolutionCache:()=>createModuleResolutionCache,createModuleResolutionLoader:()=>createModuleResolutionLoader,createModuleResolutionLoaderUsingGlobalCache:()=>createModuleResolutionLoaderUsingGlobalCache,createModuleSpecifierResolutionHost:()=>createModuleSpecifierResolutionHost,createMultiMap:()=>createMultiMap,createNameResolver:()=>createNameResolver,createNodeConverters:()=>createNodeConverters,createNodeFactory:()=>createNodeFactory,createOptionNameMap:()=>createOptionNameMap,createOverload:()=>createOverload,createPackageJsonImportFilter:()=>createPackageJsonImportFilter,createPackageJsonInfo:()=>createPackageJsonInfo,createParenthesizerRules:()=>createParenthesizerRules,createPatternMatcher:()=>createPatternMatcher,createPrinter:()=>createPrinter,createPrinterWithDefaults:()=>Da,createPrinterWithRemoveComments:()=>Ia,createPrinterWithRemoveCommentsNeverAsciiEscape:()=>Aa,createPrinterWithRemoveCommentsOmitTrailingSemicolon:()=>Oa,createProgram:()=>createProgram,createProgramDiagnostics:()=>createProgramDiagnostics,createProgramHost:()=>createProgramHost,createPropertyNameNodeForIdentifierOrLiteral:()=>createPropertyNameNodeForIdentifierOrLiteral,createQueue:()=>createQueue,createRange:()=>createRange,createRedirectedBuilderProgram:()=>createRedirectedBuilderProgram,createResolutionCache:()=>createResolutionCache,createRuntimeTypeSerializer:()=>createRuntimeTypeSerializer,createScanner:()=>createScanner,createSemanticDiagnosticsBuilderProgram:()=>createSemanticDiagnosticsBuilderProgram,createSet:()=>createSet,createSolutionBuilder:()=>createSolutionBuilder,createSolutionBuilderHost:()=>createSolutionBuilderHost,createSolutionBuilderWithWatch:()=>createSolutionBuilderWithWatch,createSolutionBuilderWithWatchHost:()=>createSolutionBuilderWithWatchHost,createSortedArray:()=>createSortedArray,createSourceFile:()=>createSourceFile,createSourceMapGenerator:()=>createSourceMapGenerator,createSourceMapSource:()=>createSourceMapSource,createSuperAccessVariableStatement:()=>createSuperAccessVariableStatement,createSymbolTable:()=>createSymbolTable,createSymlinkCache:()=>createSymlinkCache,createSyntacticTypeNodeBuilder:()=>createSyntacticTypeNodeBuilder,createSystemWatchFunctions:()=>createSystemWatchFunctions,createTextChange:()=>createTextChange,createTextChangeFromStartLength:()=>createTextChangeFromStartLength,createTextChangeRange:()=>createTextChangeRange,createTextRangeFromNode:()=>createTextRangeFromNode,createTextRangeFromSpan:()=>createTextRangeFromSpan,createTextSpan:()=>createTextSpan,createTextSpanFromBounds:()=>createTextSpanFromBounds,createTextSpanFromNode:()=>createTextSpanFromNode,createTextSpanFromRange:()=>createTextSpanFromRange,createTextSpanFromStringLiteralLikeContent:()=>createTextSpanFromStringLiteralLikeContent,createTextWriter:()=>createTextWriter,createTokenRange:()=>createTokenRange,createTypeChecker:()=>createTypeChecker,createTypeReferenceDirectiveResolutionCache:()=>createTypeReferenceDirectiveResolutionCache,createTypeReferenceResolutionLoader:()=>createTypeReferenceResolutionLoader,createWatchCompilerHost:()=>createWatchCompilerHost2,createWatchCompilerHostOfConfigFile:()=>createWatchCompilerHostOfConfigFile,createWatchCompilerHostOfFilesAndCompilerOptions:()=>createWatchCompilerHostOfFilesAndCompilerOptions,createWatchFactory:()=>createWatchFactory,createWatchHost:()=>createWatchHost,createWatchProgram:()=>createWatchProgram,createWatchStatusReporter:()=>createWatchStatusReporter,createWriteFileMeasuringIO:()=>createWriteFileMeasuringIO,declarationNameToString:()=>declarationNameToString,decodeMappings:()=>decodeMappings,decodedTextSpanIntersectsWith:()=>decodedTextSpanIntersectsWith,deduplicate:()=>deduplicate,defaultInitCompilerOptions:()=>ho,defaultMaximumTruncationLength:()=>ln,diagnosticCategoryName:()=>diagnosticCategoryName,diagnosticToString:()=>diagnosticToString,diagnosticsEqualityComparer:()=>diagnosticsEqualityComparer,directoryProbablyExists:()=>directoryProbablyExists,directorySeparator:()=>Pt,displayPart:()=>displayPart,displayPartsToString:()=>displayPartsToString,disposeEmitNodes:()=>disposeEmitNodes,documentSpansEqual:()=>documentSpansEqual,dumpTracingLegend:()=>Q,elementAt:()=>u,elideNodes:()=>elideNodes,emitDetachedComments:()=>emitDetachedComments,emitFiles:()=>emitFiles,emitFilesAndReportErrors:()=>emitFilesAndReportErrors,emitFilesAndReportErrorsAndGetExitStatus:()=>emitFilesAndReportErrorsAndGetExitStatus,emitModuleKindIsNonNodeESM:()=>emitModuleKindIsNonNodeESM,emitNewLineBeforeLeadingCommentOfPosition:()=>emitNewLineBeforeLeadingCommentOfPosition,emitResolverSkipsTypeChecking:()=>emitResolverSkipsTypeChecking,emitSkippedWithNoDiagnostics:()=>Ka,emptyArray:()=>d,emptyFileSystemEntries:()=>Fr,emptyMap:()=>p,emptyOptions:()=>Fs,endsWith:()=>endsWith,ensurePathIsNonModuleName:()=>ensurePathIsNonModuleName,ensureScriptKind:()=>ensureScriptKind,ensureTrailingDirectorySeparator:()=>ensureTrailingDirectorySeparator,entityNameToString:()=>entityNameToString,enumerateInsertsAndDeletes:()=>enumerateInsertsAndDeletes,equalOwnProperties:()=>equalOwnProperties,equateStringsCaseInsensitive:()=>equateStringsCaseInsensitive,equateStringsCaseSensitive:()=>equateStringsCaseSensitive,equateValues:()=>equateValues,escapeJsxAttributeString:()=>escapeJsxAttributeString,escapeLeadingUnderscores:()=>escapeLeadingUnderscores,escapeNonAsciiString:()=>escapeNonAsciiString,escapeSnippetText:()=>escapeSnippetText,escapeString:()=>escapeString,escapeTemplateSubstitution:()=>escapeTemplateSubstitution,evaluatorResult:()=>evaluatorResult,every:()=>every,exclusivelyPrefixedNodeCoreModules:()=>Ar,executeCommandLine:()=>executeCommandLine,expandPreOrPostfixIncrementOrDecrementExpression:()=>expandPreOrPostfixIncrementOrDecrementExpression,explainFiles:()=>explainFiles,explainIfFileIsRedirectAndImpliedFormat:()=>explainIfFileIsRedirectAndImpliedFormat,exportAssignmentIsAlias:()=>exportAssignmentIsAlias,expressionResultIsUnused:()=>expressionResultIsUnused,extend:()=>extend,extensionFromPath:()=>extensionFromPath,extensionIsTS:()=>extensionIsTS,extensionsNotSupportingExtensionlessResolution:()=>Cr,externalHelpersModuleNameText:()=>cn,factory:()=>zr,fileExtensionIs:()=>fileExtensionIs,fileExtensionIsOneOf:()=>fileExtensionIsOneOf,fileIncludeReasonToDiagnostics:()=>fileIncludeReasonToDiagnostics,fileShouldUseJavaScriptRequire:()=>fileShouldUseJavaScriptRequire,filter:()=>filter,filterMutate:()=>filterMutate,filterSemanticDiagnostics:()=>filterSemanticDiagnostics,find:()=>find,findAncestor:()=>findAncestor,findBestPatternMatch:()=>findBestPatternMatch,findChildOfKind:()=>findChildOfKind,findComputedPropertyNameCacheAssignment:()=>findComputedPropertyNameCacheAssignment,findConfigFile:()=>findConfigFile,findConstructorDeclaration:()=>findConstructorDeclaration,findContainingList:()=>findContainingList,findDiagnosticForNode:()=>findDiagnosticForNode,findFirstNonJsxWhitespaceToken:()=>findFirstNonJsxWhitespaceToken,findIndex:()=>findIndex,findLast:()=>findLast,findLastIndex:()=>findLastIndex,findListItemInfo:()=>findListItemInfo,findModifier:()=>findModifier,findNextToken:()=>findNextToken,findPackageJson:()=>findPackageJson,findPackageJsons:()=>findPackageJsons,findPrecedingMatchingToken:()=>findPrecedingMatchingToken,findPrecedingToken:()=>findPrecedingToken,findSuperStatementIndexPath:()=>findSuperStatementIndexPath,findTokenOnLeftOfPosition:()=>findTokenOnLeftOfPosition,findUseStrictPrologue:()=>findUseStrictPrologue,first:()=>first,firstDefined:()=>firstDefined,firstDefinedIterator:()=>firstDefinedIterator,firstIterator:()=>firstIterator,firstOrOnly:()=>firstOrOnly,firstOrUndefined:()=>firstOrUndefined,firstOrUndefinedIterator:()=>firstOrUndefinedIterator,fixupCompilerOptions:()=>fixupCompilerOptions,flatMap:()=>flatMap,flatMapIterator:()=>flatMapIterator,flatMapToMutable:()=>flatMapToMutable,flatten:()=>flatten,flattenCommaList:()=>flattenCommaList,flattenDestructuringAssignment:()=>flattenDestructuringAssignment,flattenDestructuringBinding:()=>flattenDestructuringBinding,flattenDiagnosticMessageText:()=>flattenDiagnosticMessageText,forEach:()=>forEach,forEachAncestor:()=>forEachAncestor,forEachAncestorDirectory:()=>forEachAncestorDirectory,forEachAncestorDirectoryStoppingAtGlobalCache:()=>forEachAncestorDirectoryStoppingAtGlobalCache,forEachChild:()=>forEachChild,forEachChildRecursively:()=>forEachChildRecursively,forEachDynamicImportOrRequireCall:()=>forEachDynamicImportOrRequireCall,forEachEmittedFile:()=>forEachEmittedFile,forEachEnclosingBlockScopeContainer:()=>forEachEnclosingBlockScopeContainer,forEachEntry:()=>forEachEntry,forEachExternalModuleToImportFrom:()=>forEachExternalModuleToImportFrom,forEachImportClauseDeclaration:()=>forEachImportClauseDeclaration,forEachKey:()=>forEachKey,forEachLeadingCommentRange:()=>forEachLeadingCommentRange,forEachNameInAccessChainWalkingLeft:()=>forEachNameInAccessChainWalkingLeft,forEachNameOfDefaultExport:()=>forEachNameOfDefaultExport,forEachOptionsSyntaxByName:()=>forEachOptionsSyntaxByName,forEachProjectReference:()=>forEachProjectReference,forEachPropertyAssignment:()=>forEachPropertyAssignment,forEachResolvedProjectReference:()=>forEachResolvedProjectReference,forEachReturnStatement:()=>forEachReturnStatement,forEachRight:()=>forEachRight,forEachTrailingCommentRange:()=>forEachTrailingCommentRange,forEachTsConfigPropArray:()=>forEachTsConfigPropArray,forEachUnique:()=>forEachUnique,forEachYieldExpression:()=>forEachYieldExpression,formatColorAndReset:()=>formatColorAndReset,formatDiagnostic:()=>formatDiagnostic,formatDiagnostics:()=>formatDiagnostics,formatDiagnosticsWithColorAndContext:()=>formatDiagnosticsWithColorAndContext,formatGeneratedName:()=>formatGeneratedName,formatGeneratedNamePart:()=>formatGeneratedNamePart,formatLocation:()=>formatLocation,formatMessage:()=>formatMessage,formatStringFromArgs:()=>formatStringFromArgs,formatting:()=>hm,generateDjb2Hash:()=>generateDjb2Hash,generateTSConfig:()=>generateTSConfig,getAdjustedReferenceLocation:()=>getAdjustedReferenceLocation,getAdjustedRenameLocation:()=>getAdjustedRenameLocation,getAliasDeclarationFromName:()=>getAliasDeclarationFromName,getAllAccessorDeclarations:()=>getAllAccessorDeclarations,getAllDecoratorsOfClass:()=>getAllDecoratorsOfClass,getAllDecoratorsOfClassElement:()=>getAllDecoratorsOfClassElement,getAllJSDocTags:()=>getAllJSDocTags,getAllJSDocTagsOfKind:()=>getAllJSDocTagsOfKind,getAllKeys:()=>getAllKeys,getAllProjectOutputs:()=>getAllProjectOutputs,getAllSuperTypeNodes:()=>getAllSuperTypeNodes,getAllowImportingTsExtensions:()=>Un,getAllowJSCompilerOption:()=>rr,getAllowSyntheticDefaultImports:()=>$n,getAncestor:()=>getAncestor,getAnyExtensionFromPath:()=>getAnyExtensionFromPath,getAreDeclarationMapsEnabled:()=>nr,getAssignedExpandoInitializer:()=>getAssignedExpandoInitializer,getAssignedName:()=>getAssignedName,getAssignmentDeclarationKind:()=>getAssignmentDeclarationKind,getAssignmentDeclarationPropertyAccessKind:()=>getAssignmentDeclarationPropertyAccessKind,getAssignmentTargetKind:()=>getAssignmentTargetKind,getAutomaticTypeDirectiveNames:()=>getAutomaticTypeDirectiveNames,getBaseFileName:()=>getBaseFileName,getBinaryOperatorPrecedence:()=>getBinaryOperatorPrecedence,getBuildInfo:()=>getBuildInfo,getBuildInfoFileVersionMap:()=>getBuildInfoFileVersionMap,getBuildInfoText:()=>getBuildInfoText,getBuildOrderFromAnyBuildOrder:()=>getBuildOrderFromAnyBuildOrder,getBuilderCreationParameters:()=>getBuilderCreationParameters,getBuilderFileEmit:()=>getBuilderFileEmit,getCanonicalDiagnostic:()=>getCanonicalDiagnostic,getCheckFlags:()=>getCheckFlags,getClassExtendsHeritageElement:()=>getClassExtendsHeritageElement,getClassLikeDeclarationOfSymbol:()=>getClassLikeDeclarationOfSymbol,getCombinedLocalAndExportSymbolFlags:()=>getCombinedLocalAndExportSymbolFlags,getCombinedModifierFlags:()=>getCombinedModifierFlags,getCombinedNodeFlags:()=>getCombinedNodeFlags,getCombinedNodeFlagsAlwaysIncludeJSDoc:()=>getCombinedNodeFlagsAlwaysIncludeJSDoc,getCommentRange:()=>getCommentRange,getCommonSourceDirectory:()=>getCommonSourceDirectory,getCommonSourceDirectoryOfConfig:()=>getCommonSourceDirectoryOfConfig,getCompilerOptionValue:()=>getCompilerOptionValue,getCompilerOptionsDiffValue:()=>getCompilerOptionsDiffValue,getConditions:()=>getConditions,getConfigFileParsingDiagnostics:()=>getConfigFileParsingDiagnostics,getConstantValue:()=>getConstantValue,getContainerFlags:()=>getContainerFlags,getContainerNode:()=>getContainerNode,getContainingClass:()=>getContainingClass,getContainingClassExcludingClassDecorators:()=>getContainingClassExcludingClassDecorators,getContainingClassStaticBlock:()=>getContainingClassStaticBlock,getContainingFunction:()=>getContainingFunction,getContainingFunctionDeclaration:()=>getContainingFunctionDeclaration,getContainingFunctionOrClassStaticBlock:()=>getContainingFunctionOrClassStaticBlock,getContainingNodeArray:()=>getContainingNodeArray,getContainingObjectLiteralElement:()=>getContainingObjectLiteralElement,getContextualTypeFromParent:()=>getContextualTypeFromParent,getContextualTypeFromParentOrAncestorTypeNode:()=>getContextualTypeFromParentOrAncestorTypeNode,getDeclarationDiagnostics:()=>getDeclarationDiagnostics,getDeclarationEmitExtensionForPath:()=>getDeclarationEmitExtensionForPath,getDeclarationEmitOutputFilePath:()=>getDeclarationEmitOutputFilePath,getDeclarationEmitOutputFilePathWorker:()=>getDeclarationEmitOutputFilePathWorker,getDeclarationFileExtension:()=>getDeclarationFileExtension,getDeclarationFromName:()=>getDeclarationFromName,getDeclarationModifierFlagsFromSymbol:()=>getDeclarationModifierFlagsFromSymbol,getDeclarationOfKind:()=>getDeclarationOfKind,getDeclarationsOfKind:()=>getDeclarationsOfKind,getDeclaredExpandoInitializer:()=>getDeclaredExpandoInitializer,getDecorators:()=>getDecorators,getDefaultCompilerOptions:()=>getDefaultCompilerOptions2,getDefaultFormatCodeSettings:()=>getDefaultFormatCodeSettings,getDefaultLibFileName:()=>getDefaultLibFileName,getDefaultLibFilePath:()=>getDefaultLibFilePath,getDefaultLikeExportInfo:()=>getDefaultLikeExportInfo,getDefaultLikeExportNameFromDeclaration:()=>getDefaultLikeExportNameFromDeclaration,getDefaultResolutionModeForFileWorker:()=>getDefaultResolutionModeForFileWorker,getDiagnosticText:()=>getDiagnosticText,getDiagnosticsWithinSpan:()=>getDiagnosticsWithinSpan,getDirectoryPath:()=>getDirectoryPath,getDirectoryToWatchFailedLookupLocation:()=>getDirectoryToWatchFailedLookupLocation,getDirectoryToWatchFailedLookupLocationFromTypeRoot:()=>getDirectoryToWatchFailedLookupLocationFromTypeRoot,getDocumentPositionMapper:()=>getDocumentPositionMapper,getDocumentSpansEqualityComparer:()=>getDocumentSpansEqualityComparer,getESModuleInterop:()=>Kn,getEditsForFileRename:()=>getEditsForFileRename,getEffectiveBaseTypeNode:()=>getEffectiveBaseTypeNode,getEffectiveConstraintOfTypeParameter:()=>getEffectiveConstraintOfTypeParameter,getEffectiveContainerForJSDocTemplateTag:()=>getEffectiveContainerForJSDocTemplateTag,getEffectiveImplementsTypeNodes:()=>getEffectiveImplementsTypeNodes,getEffectiveInitializer:()=>getEffectiveInitializer,getEffectiveJSDocHost:()=>getEffectiveJSDocHost,getEffectiveModifierFlags:()=>getEffectiveModifierFlags,getEffectiveModifierFlagsAlwaysIncludeJSDoc:()=>getEffectiveModifierFlagsAlwaysIncludeJSDoc,getEffectiveModifierFlagsNoCache:()=>getEffectiveModifierFlagsNoCache,getEffectiveReturnTypeNode:()=>getEffectiveReturnTypeNode,getEffectiveSetAccessorTypeAnnotationNode:()=>getEffectiveSetAccessorTypeAnnotationNode,getEffectiveTypeAnnotationNode:()=>getEffectiveTypeAnnotationNode,getEffectiveTypeParameterDeclarations:()=>getEffectiveTypeParameterDeclarations,getEffectiveTypeRoots:()=>getEffectiveTypeRoots,getElementOrPropertyAccessArgumentExpressionOrName:()=>getElementOrPropertyAccessArgumentExpressionOrName,getElementOrPropertyAccessName:()=>getElementOrPropertyAccessName,getElementsOfBindingOrAssignmentPattern:()=>getElementsOfBindingOrAssignmentPattern,getEmitDeclarations:()=>Zn,getEmitFlags:()=>getEmitFlags,getEmitHelpers:()=>getEmitHelpers,getEmitModuleDetectionKind:()=>Hn,getEmitModuleFormatOfFileWorker:()=>getEmitModuleFormatOfFileWorker,getEmitModuleKind:()=>Vn,getEmitModuleResolutionKind:()=>qn,getEmitScriptTarget:()=>zn,getEmitStandardClassFields:()=>getEmitStandardClassFields,getEnclosingBlockScopeContainer:()=>getEnclosingBlockScopeContainer,getEnclosingContainer:()=>getEnclosingContainer,getEncodedSemanticClassifications:()=>getEncodedSemanticClassifications,getEncodedSyntacticClassifications:()=>getEncodedSyntacticClassifications,getEndLinePosition:()=>getEndLinePosition,getEntityNameFromTypeNode:()=>getEntityNameFromTypeNode,getEntrypointsFromPackageJsonInfo:()=>getEntrypointsFromPackageJsonInfo,getErrorCountForSummary:()=>getErrorCountForSummary,getErrorSpanForNode:()=>getErrorSpanForNode,getErrorSummaryText:()=>getErrorSummaryText,getEscapedTextOfIdentifierOrLiteral:()=>getEscapedTextOfIdentifierOrLiteral,getEscapedTextOfJsxAttributeName:()=>getEscapedTextOfJsxAttributeName,getEscapedTextOfJsxNamespacedName:()=>getEscapedTextOfJsxNamespacedName,getExpandoInitializer:()=>getExpandoInitializer,getExportAssignmentExpression:()=>getExportAssignmentExpression,getExportInfoMap:()=>getExportInfoMap,getExportNeedsImportStarHelper:()=>getExportNeedsImportStarHelper,getExpressionAssociativity:()=>getExpressionAssociativity,getExpressionPrecedence:()=>getExpressionPrecedence,getExternalHelpersModuleName:()=>getExternalHelpersModuleName,getExternalModuleImportEqualsDeclarationExpression:()=>getExternalModuleImportEqualsDeclarationExpression,getExternalModuleName:()=>getExternalModuleName,getExternalModuleNameFromDeclaration:()=>getExternalModuleNameFromDeclaration,getExternalModuleNameFromPath:()=>getExternalModuleNameFromPath,getExternalModuleNameLiteral:()=>getExternalModuleNameLiteral,getExternalModuleRequireArgument:()=>getExternalModuleRequireArgument,getFallbackOptions:()=>getFallbackOptions,getFileEmitOutput:()=>getFileEmitOutput,getFileMatcherPatterns:()=>getFileMatcherPatterns,getFileNamesFromConfigSpecs:()=>getFileNamesFromConfigSpecs,getFileWatcherEventKind:()=>getFileWatcherEventKind,getFilesInErrorForSummary:()=>getFilesInErrorForSummary,getFirstConstructorWithBody:()=>getFirstConstructorWithBody,getFirstIdentifier:()=>getFirstIdentifier,getFirstNonSpaceCharacterPosition:()=>getFirstNonSpaceCharacterPosition,getFirstProjectOutput:()=>getFirstProjectOutput,getFixableErrorSpanExpression:()=>getFixableErrorSpanExpression,getFormatCodeSettingsForWriting:()=>getFormatCodeSettingsForWriting,getFullWidth:()=>getFullWidth,getFunctionFlags:()=>getFunctionFlags,getHeritageClause:()=>getHeritageClause,getHostSignatureFromJSDoc:()=>getHostSignatureFromJSDoc,getIdentifierAutoGenerate:()=>getIdentifierAutoGenerate,getIdentifierGeneratedImportReference:()=>getIdentifierGeneratedImportReference,getIdentifierTypeArguments:()=>getIdentifierTypeArguments,getImmediatelyInvokedFunctionExpression:()=>getImmediatelyInvokedFunctionExpression,getImpliedNodeFormatForEmitWorker:()=>getImpliedNodeFormatForEmitWorker,getImpliedNodeFormatForFile:()=>getImpliedNodeFormatForFile,getImpliedNodeFormatForFileWorker:()=>getImpliedNodeFormatForFileWorker,getImportNeedsImportDefaultHelper:()=>getImportNeedsImportDefaultHelper,getImportNeedsImportStarHelper:()=>getImportNeedsImportStarHelper,getIndentString:()=>getIndentString,getInferredLibraryNameResolveFrom:()=>getInferredLibraryNameResolveFrom,getInitializedVariables:()=>getInitializedVariables,getInitializerOfBinaryExpression:()=>getInitializerOfBinaryExpression,getInitializerOfBindingOrAssignmentElement:()=>getInitializerOfBindingOrAssignmentElement,getInterfaceBaseTypeNodes:()=>getInterfaceBaseTypeNodes,getInternalEmitFlags:()=>getInternalEmitFlags,getInvokedExpression:()=>getInvokedExpression,getIsFileExcluded:()=>getIsFileExcluded,getIsolatedModules:()=>Gn,getJSDocAugmentsTag:()=>getJSDocAugmentsTag,getJSDocClassTag:()=>getJSDocClassTag,getJSDocCommentRanges:()=>getJSDocCommentRanges,getJSDocCommentsAndTags:()=>getJSDocCommentsAndTags,getJSDocDeprecatedTag:()=>getJSDocDeprecatedTag,getJSDocDeprecatedTagNoCache:()=>getJSDocDeprecatedTagNoCache,getJSDocEnumTag:()=>getJSDocEnumTag,getJSDocHost:()=>getJSDocHost,getJSDocImplementsTags:()=>getJSDocImplementsTags,getJSDocOverloadTags:()=>getJSDocOverloadTags,getJSDocOverrideTagNoCache:()=>getJSDocOverrideTagNoCache,getJSDocParameterTags:()=>getJSDocParameterTags,getJSDocParameterTagsNoCache:()=>getJSDocParameterTagsNoCache,getJSDocPrivateTag:()=>getJSDocPrivateTag,getJSDocPrivateTagNoCache:()=>getJSDocPrivateTagNoCache,getJSDocProtectedTag:()=>getJSDocProtectedTag,getJSDocProtectedTagNoCache:()=>getJSDocProtectedTagNoCache,getJSDocPublicTag:()=>getJSDocPublicTag,getJSDocPublicTagNoCache:()=>getJSDocPublicTagNoCache,getJSDocReadonlyTag:()=>getJSDocReadonlyTag,getJSDocReadonlyTagNoCache:()=>getJSDocReadonlyTagNoCache,getJSDocReturnTag:()=>getJSDocReturnTag,getJSDocReturnType:()=>getJSDocReturnType,getJSDocRoot:()=>getJSDocRoot,getJSDocSatisfiesExpressionType:()=>getJSDocSatisfiesExpressionType,getJSDocSatisfiesTag:()=>getJSDocSatisfiesTag,getJSDocTags:()=>getJSDocTags,getJSDocTemplateTag:()=>getJSDocTemplateTag,getJSDocThisTag:()=>getJSDocThisTag,getJSDocType:()=>getJSDocType,getJSDocTypeAliasName:()=>getJSDocTypeAliasName,getJSDocTypeAssertionType:()=>getJSDocTypeAssertionType,getJSDocTypeParameterDeclarations:()=>getJSDocTypeParameterDeclarations,getJSDocTypeParameterTags:()=>getJSDocTypeParameterTags,getJSDocTypeParameterTagsNoCache:()=>getJSDocTypeParameterTagsNoCache,getJSDocTypeTag:()=>getJSDocTypeTag,getJSXImplicitImportBase:()=>getJSXImplicitImportBase,getJSXRuntimeImport:()=>getJSXRuntimeImport,getJSXTransformEnabled:()=>getJSXTransformEnabled,getKeyForCompilerOptions:()=>getKeyForCompilerOptions,getLanguageVariant:()=>getLanguageVariant,getLastChild:()=>getLastChild,getLeadingCommentRanges:()=>getLeadingCommentRanges,getLeadingCommentRangesOfNode:()=>getLeadingCommentRangesOfNode,getLeftmostAccessExpression:()=>getLeftmostAccessExpression,getLeftmostExpression:()=>getLeftmostExpression,getLibFileNameFromLibReference:()=>getLibFileNameFromLibReference,getLibNameFromLibReference:()=>getLibNameFromLibReference,getLibraryNameFromLibFileName:()=>getLibraryNameFromLibFileName,getLineAndCharacterOfPosition:()=>getLineAndCharacterOfPosition,getLineInfo:()=>getLineInfo,getLineOfLocalPosition:()=>getLineOfLocalPosition,getLineStartPositionForPosition:()=>getLineStartPositionForPosition,getLineStarts:()=>getLineStarts,getLinesBetweenPositionAndNextNonWhitespaceCharacter:()=>getLinesBetweenPositionAndNextNonWhitespaceCharacter,getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter:()=>getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter,getLinesBetweenPositions:()=>getLinesBetweenPositions,getLinesBetweenRangeEndAndRangeStart:()=>getLinesBetweenRangeEndAndRangeStart,getLinesBetweenRangeEndPositions:()=>getLinesBetweenRangeEndPositions,getLiteralText:()=>getLiteralText,getLocalNameForExternalImport:()=>getLocalNameForExternalImport,getLocalSymbolForExportDefault:()=>getLocalSymbolForExportDefault,getLocaleSpecificMessage:()=>getLocaleSpecificMessage,getLocaleTimeString:()=>getLocaleTimeString,getMappedContextSpan:()=>getMappedContextSpan,getMappedDocumentSpan:()=>getMappedDocumentSpan,getMappedLocation:()=>getMappedLocation,getMatchedFileSpec:()=>getMatchedFileSpec,getMatchedIncludeSpec:()=>getMatchedIncludeSpec,getMeaningFromDeclaration:()=>getMeaningFromDeclaration,getMeaningFromLocation:()=>getMeaningFromLocation,getMembersOfDeclaration:()=>getMembersOfDeclaration,getModeForFileReference:()=>getModeForFileReference,getModeForResolutionAtIndex:()=>getModeForResolutionAtIndex,getModeForUsageLocation:()=>getModeForUsageLocation,getModifiedTime:()=>getModifiedTime,getModifiers:()=>getModifiers,getModuleInstanceState:()=>getModuleInstanceState,getModuleNameStringLiteralAt:()=>getModuleNameStringLiteralAt,getModuleSpecifierEndingPreference:()=>getModuleSpecifierEndingPreference,getModuleSpecifierResolverHost:()=>getModuleSpecifierResolverHost,getNameForExportedSymbol:()=>getNameForExportedSymbol,getNameFromImportAttribute:()=>getNameFromImportAttribute,getNameFromIndexInfo:()=>getNameFromIndexInfo,getNameFromPropertyName:()=>getNameFromPropertyName,getNameOfAccessExpression:()=>getNameOfAccessExpression,getNameOfCompilerOptionValue:()=>getNameOfCompilerOptionValue,getNameOfDeclaration:()=>getNameOfDeclaration,getNameOfExpando:()=>getNameOfExpando,getNameOfJSDocTypedef:()=>getNameOfJSDocTypedef,getNameOfScriptTarget:()=>getNameOfScriptTarget,getNameOrArgument:()=>getNameOrArgument,getNameTable:()=>getNameTable,getNamespaceDeclarationNode:()=>getNamespaceDeclarationNode,getNewLineCharacter:()=>getNewLineCharacter,getNewLineKind:()=>getNewLineKind,getNewLineOrDefaultFromHost:()=>getNewLineOrDefaultFromHost,getNewTargetContainer:()=>getNewTargetContainer,getNextJSDocCommentLocation:()=>getNextJSDocCommentLocation,getNodeChildren:()=>getNodeChildren,getNodeForGeneratedName:()=>getNodeForGeneratedName,getNodeId:()=>getNodeId,getNodeKind:()=>getNodeKind,getNodeModifiers:()=>getNodeModifiers,getNodeModulePathParts:()=>getNodeModulePathParts,getNonAssignedNameOfDeclaration:()=>getNonAssignedNameOfDeclaration,getNonAssignmentOperatorForCompoundAssignment:()=>getNonAssignmentOperatorForCompoundAssignment,getNonAugmentationDeclaration:()=>getNonAugmentationDeclaration,getNonDecoratorTokenPosOfNode:()=>getNonDecoratorTokenPosOfNode,getNonIncrementalBuildInfoRoots:()=>getNonIncrementalBuildInfoRoots,getNonModifierTokenPosOfNode:()=>getNonModifierTokenPosOfNode,getNormalizedAbsolutePath:()=>getNormalizedAbsolutePath,getNormalizedAbsolutePathWithoutRoot:()=>getNormalizedAbsolutePathWithoutRoot,getNormalizedPathComponents:()=>getNormalizedPathComponents,getObjectFlags:()=>getObjectFlags,getOperatorAssociativity:()=>getOperatorAssociativity,getOperatorPrecedence:()=>getOperatorPrecedence,getOptionFromName:()=>getOptionFromName,getOptionsForLibraryResolution:()=>getOptionsForLibraryResolution,getOptionsNameMap:()=>getOptionsNameMap,getOptionsSyntaxByArrayElementValue:()=>getOptionsSyntaxByArrayElementValue,getOptionsSyntaxByValue:()=>getOptionsSyntaxByValue,getOrCreateEmitNode:()=>getOrCreateEmitNode,getOrUpdate:()=>getOrUpdate,getOriginalNode:()=>getOriginalNode,getOriginalNodeId:()=>getOriginalNodeId,getOutputDeclarationFileName:()=>getOutputDeclarationFileName,getOutputDeclarationFileNameWorker:()=>getOutputDeclarationFileNameWorker,getOutputExtension:()=>getOutputExtension,getOutputFileNames:()=>getOutputFileNames,getOutputJSFileNameWorker:()=>getOutputJSFileNameWorker,getOutputPathsFor:()=>getOutputPathsFor,getOwnEmitOutputFilePath:()=>getOwnEmitOutputFilePath,getOwnKeys:()=>getOwnKeys,getOwnValues:()=>getOwnValues,getPackageJsonTypesVersionsPaths:()=>getPackageJsonTypesVersionsPaths,getPackageNameFromTypesPackageName:()=>getPackageNameFromTypesPackageName,getPackageScopeForPath:()=>getPackageScopeForPath,getParameterSymbolFromJSDoc:()=>getParameterSymbolFromJSDoc,getParentNodeInSpan:()=>getParentNodeInSpan,getParseTreeNode:()=>getParseTreeNode,getParsedCommandLineOfConfigFile:()=>getParsedCommandLineOfConfigFile,getPathComponents:()=>getPathComponents,getPathFromPathComponents:()=>getPathFromPathComponents,getPathUpdater:()=>getPathUpdater,getPathsBasePath:()=>getPathsBasePath,getPatternFromSpec:()=>getPatternFromSpec,getPendingEmitKindWithSeen:()=>getPendingEmitKindWithSeen,getPositionOfLineAndCharacter:()=>getPositionOfLineAndCharacter,getPossibleGenericSignatures:()=>getPossibleGenericSignatures,getPossibleOriginalInputExtensionForExtension:()=>getPossibleOriginalInputExtensionForExtension,getPossibleOriginalInputPathWithoutChangingExt:()=>getPossibleOriginalInputPathWithoutChangingExt,getPossibleTypeArgumentsInfo:()=>getPossibleTypeArgumentsInfo,getPreEmitDiagnostics:()=>getPreEmitDiagnostics,getPrecedingNonSpaceCharacterPosition:()=>getPrecedingNonSpaceCharacterPosition,getPrivateIdentifier:()=>getPrivateIdentifier,getProperties:()=>getProperties,getProperty:()=>getProperty,getPropertyAssignmentAliasLikeExpression:()=>getPropertyAssignmentAliasLikeExpression,getPropertyNameForPropertyNameNode:()=>getPropertyNameForPropertyNameNode,getPropertyNameFromType:()=>getPropertyNameFromType,getPropertyNameOfBindingOrAssignmentElement:()=>getPropertyNameOfBindingOrAssignmentElement,getPropertySymbolFromBindingElement:()=>getPropertySymbolFromBindingElement,getPropertySymbolsFromContextualType:()=>getPropertySymbolsFromContextualType,getQuoteFromPreference:()=>getQuoteFromPreference,getQuotePreference:()=>getQuotePreference,getRangesWhere:()=>getRangesWhere,getRefactorContextSpan:()=>getRefactorContextSpan,getReferencedFileLocation:()=>getReferencedFileLocation,getRegexFromPattern:()=>getRegexFromPattern,getRegularExpressionForWildcard:()=>getRegularExpressionForWildcard,getRegularExpressionsForWildcards:()=>getRegularExpressionsForWildcards,getRelativePathFromDirectory:()=>getRelativePathFromDirectory,getRelativePathFromFile:()=>getRelativePathFromFile,getRelativePathToDirectoryOrUrl:()=>getRelativePathToDirectoryOrUrl,getRenameLocation:()=>getRenameLocation,getReplacementSpanForContextToken:()=>getReplacementSpanForContextToken,getResolutionDiagnostic:()=>getResolutionDiagnostic,getResolutionModeOverride:()=>getResolutionModeOverride,getResolveJsonModule:()=>Yn,getResolvePackageJsonExports:()=>Qn,getResolvePackageJsonImports:()=>Xn,getResolvedExternalModuleName:()=>getResolvedExternalModuleName,getResolvedModuleFromResolution:()=>getResolvedModuleFromResolution,getResolvedTypeReferenceDirectiveFromResolution:()=>getResolvedTypeReferenceDirectiveFromResolution,getRestIndicatorOfBindingOrAssignmentElement:()=>getRestIndicatorOfBindingOrAssignmentElement,getRestParameterElementType:()=>getRestParameterElementType,getRightMostAssignedExpression:()=>getRightMostAssignedExpression,getRootDeclaration:()=>getRootDeclaration,getRootDirectoryOfResolutionCache:()=>getRootDirectoryOfResolutionCache,getRootLength:()=>getRootLength,getScriptKind:()=>getScriptKind,getScriptKindFromFileName:()=>getScriptKindFromFileName,getScriptTargetFeatures:()=>un,getSelectedEffectiveModifierFlags:()=>getSelectedEffectiveModifierFlags,getSelectedSyntacticModifierFlags:()=>getSelectedSyntacticModifierFlags,getSemanticClassifications:()=>getSemanticClassifications,getSemanticJsxChildren:()=>getSemanticJsxChildren,getSetAccessorTypeAnnotationNode:()=>getSetAccessorTypeAnnotationNode,getSetAccessorValueParameter:()=>getSetAccessorValueParameter,getSetExternalModuleIndicator:()=>getSetExternalModuleIndicator,getShebang:()=>getShebang,getSingleVariableOfVariableStatement:()=>getSingleVariableOfVariableStatement,getSnapshotText:()=>getSnapshotText,getSnippetElement:()=>getSnippetElement,getSourceFileOfModule:()=>getSourceFileOfModule,getSourceFileOfNode:()=>getSourceFileOfNode,getSourceFilePathInNewDir:()=>getSourceFilePathInNewDir,getSourceFileVersionAsHashFromText:()=>getSourceFileVersionAsHashFromText,getSourceFilesToEmit:()=>getSourceFilesToEmit,getSourceMapRange:()=>getSourceMapRange,getSourceMapper:()=>getSourceMapper,getSourceTextOfNodeFromSourceFile:()=>getSourceTextOfNodeFromSourceFile,getSpanOfTokenAtPosition:()=>getSpanOfTokenAtPosition,getSpellingSuggestion:()=>getSpellingSuggestion,getStartPositionOfLine:()=>getStartPositionOfLine,getStartPositionOfRange:()=>getStartPositionOfRange,getStartsOnNewLine:()=>getStartsOnNewLine,getStaticPropertiesAndClassStaticBlock:()=>getStaticPropertiesAndClassStaticBlock,getStrictOptionValue:()=>getStrictOptionValue,getStringComparer:()=>getStringComparer,getSubPatternFromSpec:()=>getSubPatternFromSpec,getSuperCallFromStatement:()=>getSuperCallFromStatement,getSuperContainer:()=>getSuperContainer,getSupportedCodeFixes:()=>getSupportedCodeFixes,getSupportedExtensions:()=>getSupportedExtensions,getSupportedExtensionsWithJsonIfResolveJsonModule:()=>getSupportedExtensionsWithJsonIfResolveJsonModule,getSwitchedType:()=>getSwitchedType,getSymbolId:()=>getSymbolId,getSymbolNameForPrivateIdentifier:()=>getSymbolNameForPrivateIdentifier,getSymbolTarget:()=>getSymbolTarget,getSyntacticClassifications:()=>getSyntacticClassifications,getSyntacticModifierFlags:()=>getSyntacticModifierFlags,getSyntacticModifierFlagsNoCache:()=>getSyntacticModifierFlagsNoCache,getSynthesizedDeepClone:()=>getSynthesizedDeepClone,getSynthesizedDeepCloneWithReplacements:()=>getSynthesizedDeepCloneWithReplacements,getSynthesizedDeepClones:()=>getSynthesizedDeepClones,getSynthesizedDeepClonesWithReplacements:()=>getSynthesizedDeepClonesWithReplacements,getSyntheticLeadingComments:()=>getSyntheticLeadingComments,getSyntheticTrailingComments:()=>getSyntheticTrailingComments,getTargetLabel:()=>getTargetLabel,getTargetOfBindingOrAssignmentElement:()=>getTargetOfBindingOrAssignmentElement,getTemporaryModuleResolutionState:()=>getTemporaryModuleResolutionState,getTextOfConstantValue:()=>getTextOfConstantValue,getTextOfIdentifierOrLiteral:()=>getTextOfIdentifierOrLiteral,getTextOfJSDocComment:()=>getTextOfJSDocComment,getTextOfJsxAttributeName:()=>getTextOfJsxAttributeName,getTextOfJsxNamespacedName:()=>getTextOfJsxNamespacedName,getTextOfNode:()=>getTextOfNode,getTextOfNodeFromSourceText:()=>getTextOfNodeFromSourceText,getTextOfPropertyName:()=>getTextOfPropertyName,getThisContainer:()=>getThisContainer,getThisParameter:()=>getThisParameter,getTokenAtPosition:()=>getTokenAtPosition,getTokenPosOfNode:()=>getTokenPosOfNode,getTokenSourceMapRange:()=>getTokenSourceMapRange,getTouchingPropertyName:()=>getTouchingPropertyName,getTouchingToken:()=>getTouchingToken,getTrailingCommentRanges:()=>getTrailingCommentRanges,getTrailingSemicolonDeferringWriter:()=>getTrailingSemicolonDeferringWriter,getTransformers:()=>getTransformers,getTsBuildInfoEmitOutputFilePath:()=>getTsBuildInfoEmitOutputFilePath,getTsConfigObjectLiteralExpression:()=>getTsConfigObjectLiteralExpression,getTsConfigPropArrayElementValue:()=>getTsConfigPropArrayElementValue,getTypeAnnotationNode:()=>getTypeAnnotationNode,getTypeArgumentOrTypeParameterList:()=>getTypeArgumentOrTypeParameterList,getTypeKeywordOfTypeOnlyImport:()=>getTypeKeywordOfTypeOnlyImport,getTypeNode:()=>getTypeNode,getTypeNodeIfAccessible:()=>getTypeNodeIfAccessible,getTypeParameterFromJsDoc:()=>getTypeParameterFromJsDoc,getTypeParameterOwner:()=>getTypeParameterOwner,getTypesPackageName:()=>getTypesPackageName,getUILocale:()=>getUILocale,getUniqueName:()=>getUniqueName,getUniqueSymbolId:()=>getUniqueSymbolId,getUseDefineForClassFields:()=>ir,getWatchErrorSummaryDiagnosticMessage:()=>getWatchErrorSummaryDiagnosticMessage,getWatchFactory:()=>getWatchFactory,group:()=>group,groupBy:()=>groupBy,guessIndentation:()=>guessIndentation,handleNoEmitOptions:()=>handleNoEmitOptions,handleWatchOptionsConfigDirTemplateSubstitution:()=>handleWatchOptionsConfigDirTemplateSubstitution,hasAbstractModifier:()=>hasAbstractModifier,hasAccessorModifier:()=>hasAccessorModifier,hasAmbientModifier:()=>hasAmbientModifier,hasChangesInResolutions:()=>hasChangesInResolutions,hasContextSensitiveParameters:()=>hasContextSensitiveParameters,hasDecorators:()=>hasDecorators,hasDocComment:()=>hasDocComment,hasDynamicName:()=>hasDynamicName,hasEffectiveModifier:()=>hasEffectiveModifier,hasEffectiveModifiers:()=>hasEffectiveModifiers,hasEffectiveReadonlyModifier:()=>hasEffectiveReadonlyModifier,hasExtension:()=>hasExtension,hasImplementationTSFileExtension:()=>hasImplementationTSFileExtension,hasIndexSignature:()=>hasIndexSignature,hasInferredType:()=>hasInferredType,hasInitializer:()=>hasInitializer,hasInvalidEscape:()=>hasInvalidEscape,hasJSDocNodes:()=>hasJSDocNodes,hasJSDocParameterTags:()=>hasJSDocParameterTags,hasJSFileExtension:()=>hasJSFileExtension,hasJsonModuleEmitEnabled:()=>hasJsonModuleEmitEnabled,hasOnlyExpressionInitializer:()=>hasOnlyExpressionInitializer,hasOverrideModifier:()=>hasOverrideModifier,hasPossibleExternalModuleReference:()=>hasPossibleExternalModuleReference,hasProperty:()=>hasProperty,hasPropertyAccessExpressionWithName:()=>hasPropertyAccessExpressionWithName,hasQuestionToken:()=>hasQuestionToken,hasRecordedExternalHelpers:()=>hasRecordedExternalHelpers,hasResolutionModeOverride:()=>hasResolutionModeOverride,hasRestParameter:()=>hasRestParameter,hasScopeMarker:()=>hasScopeMarker,hasStaticModifier:()=>hasStaticModifier,hasSyntacticModifier:()=>hasSyntacticModifier,hasSyntacticModifiers:()=>hasSyntacticModifiers,hasTSFileExtension:()=>hasTSFileExtension,hasTabstop:()=>hasTabstop,hasTrailingDirectorySeparator:()=>hasTrailingDirectorySeparator,hasType:()=>hasType,hasTypeArguments:()=>hasTypeArguments,hasZeroOrOneAsteriskCharacter:()=>hasZeroOrOneAsteriskCharacter,hostGetCanonicalFileName:()=>hostGetCanonicalFileName,hostUsesCaseSensitiveFileNames:()=>hostUsesCaseSensitiveFileNames,idText:()=>idText,identifierIsThisKeyword:()=>identifierIsThisKeyword,identifierToKeywordKind:()=>identifierToKeywordKind,identity:()=>identity,identitySourceMapConsumer:()=>ga,ignoreSourceNewlines:()=>ignoreSourceNewlines,ignoredPaths:()=>Et,importFromModuleSpecifier:()=>importFromModuleSpecifier,importSyntaxAffectsModuleResolution:()=>importSyntaxAffectsModuleResolution,indexOfAnyCharCode:()=>indexOfAnyCharCode,indexOfNode:()=>indexOfNode,indicesOf:()=>indicesOf,inferredTypesContainingFile:()=>Ha,injectClassNamedEvaluationHelperBlockIfMissing:()=>injectClassNamedEvaluationHelperBlockIfMissing,injectClassThisAssignmentIfMissing:()=>injectClassThisAssignmentIfMissing,insertImports:()=>insertImports,insertSorted:()=>insertSorted,insertStatementAfterCustomPrologue:()=>insertStatementAfterCustomPrologue,insertStatementAfterStandardPrologue:()=>insertStatementAfterStandardPrologue,insertStatementsAfterCustomPrologue:()=>insertStatementsAfterCustomPrologue,insertStatementsAfterStandardPrologue:()=>insertStatementsAfterStandardPrologue,intersperse:()=>intersperse,intrinsicTagNameToString:()=>intrinsicTagNameToString,introducesArgumentsExoticObject:()=>introducesArgumentsExoticObject,inverseJsxOptionMap:()=>qi,isAbstractConstructorSymbol:()=>isAbstractConstructorSymbol,isAbstractModifier:()=>isAbstractModifier,isAccessExpression:()=>isAccessExpression,isAccessibilityModifier:()=>isAccessibilityModifier,isAccessor:()=>isAccessor,isAccessorModifier:()=>isAccessorModifier,isAliasableExpression:()=>isAliasableExpression,isAmbientModule:()=>isAmbientModule,isAmbientPropertyDeclaration:()=>isAmbientPropertyDeclaration,isAnyDirectorySeparator:()=>isAnyDirectorySeparator,isAnyImportOrBareOrAccessedRequire:()=>isAnyImportOrBareOrAccessedRequire,isAnyImportOrReExport:()=>isAnyImportOrReExport,isAnyImportOrRequireStatement:()=>isAnyImportOrRequireStatement,isAnyImportSyntax:()=>isAnyImportSyntax,isAnySupportedFileExtension:()=>isAnySupportedFileExtension,isApplicableVersionedTypesKey:()=>isApplicableVersionedTypesKey,isArgumentExpressionOfElementAccess:()=>isArgumentExpressionOfElementAccess,isArray:()=>isArray,isArrayBindingElement:()=>isArrayBindingElement,isArrayBindingOrAssignmentElement:()=>isArrayBindingOrAssignmentElement,isArrayBindingOrAssignmentPattern:()=>isArrayBindingOrAssignmentPattern,isArrayBindingPattern:()=>isArrayBindingPattern,isArrayLiteralExpression:()=>isArrayLiteralExpression,isArrayLiteralOrObjectLiteralDestructuringPattern:()=>isArrayLiteralOrObjectLiteralDestructuringPattern,isArrayTypeNode:()=>isArrayTypeNode,isArrowFunction:()=>isArrowFunction,isAsExpression:()=>isAsExpression,isAssertClause:()=>isAssertClause,isAssertEntry:()=>isAssertEntry,isAssertionExpression:()=>isAssertionExpression,isAssertsKeyword:()=>isAssertsKeyword,isAssignmentDeclaration:()=>isAssignmentDeclaration,isAssignmentExpression:()=>isAssignmentExpression,isAssignmentOperator:()=>isAssignmentOperator,isAssignmentPattern:()=>isAssignmentPattern,isAssignmentTarget:()=>isAssignmentTarget,isAsteriskToken:()=>isAsteriskToken,isAsyncFunction:()=>isAsyncFunction,isAsyncModifier:()=>isAsyncModifier,isAutoAccessorPropertyDeclaration:()=>isAutoAccessorPropertyDeclaration,isAwaitExpression:()=>isAwaitExpression,isAwaitKeyword:()=>isAwaitKeyword,isBigIntLiteral:()=>isBigIntLiteral,isBinaryExpression:()=>isBinaryExpression,isBinaryLogicalOperator:()=>isBinaryLogicalOperator,isBinaryOperatorToken:()=>isBinaryOperatorToken,isBindableObjectDefinePropertyCall:()=>isBindableObjectDefinePropertyCall,isBindableStaticAccessExpression:()=>isBindableStaticAccessExpression,isBindableStaticElementAccessExpression:()=>isBindableStaticElementAccessExpression,isBindableStaticNameExpression:()=>isBindableStaticNameExpression,isBindingElement:()=>isBindingElement,isBindingElementOfBareOrAccessedRequire:()=>isBindingElementOfBareOrAccessedRequire,isBindingName:()=>isBindingName,isBindingOrAssignmentElement:()=>isBindingOrAssignmentElement,isBindingOrAssignmentPattern:()=>isBindingOrAssignmentPattern,isBindingPattern:()=>isBindingPattern,isBlock:()=>isBlock,isBlockLike:()=>isBlockLike,isBlockOrCatchScoped:()=>isBlockOrCatchScoped,isBlockScope:()=>isBlockScope,isBlockScopedContainerTopLevel:()=>isBlockScopedContainerTopLevel,isBooleanLiteral:()=>isBooleanLiteral,isBreakOrContinueStatement:()=>isBreakOrContinueStatement,isBreakStatement:()=>isBreakStatement,isBuildCommand:()=>isBuildCommand,isBuildInfoFile:()=>isBuildInfoFile,isBuilderProgram:()=>isBuilderProgram,isBundle:()=>isBundle,isCallChain:()=>isCallChain,isCallExpression:()=>isCallExpression,isCallExpressionTarget:()=>isCallExpressionTarget,isCallLikeExpression:()=>isCallLikeExpression,isCallLikeOrFunctionLikeExpression:()=>isCallLikeOrFunctionLikeExpression,isCallOrNewExpression:()=>isCallOrNewExpression,isCallOrNewExpressionTarget:()=>isCallOrNewExpressionTarget,isCallSignatureDeclaration:()=>isCallSignatureDeclaration,isCallToHelper:()=>isCallToHelper,isCaseBlock:()=>isCaseBlock,isCaseClause:()=>isCaseClause,isCaseKeyword:()=>isCaseKeyword,isCaseOrDefaultClause:()=>isCaseOrDefaultClause,isCatchClause:()=>isCatchClause,isCatchClauseVariableDeclaration:()=>isCatchClauseVariableDeclaration,isCatchClauseVariableDeclarationOrBindingElement:()=>isCatchClauseVariableDeclarationOrBindingElement,isCheckJsEnabledForFile:()=>isCheckJsEnabledForFile,isCircularBuildOrder:()=>isCircularBuildOrder,isClassDeclaration:()=>isClassDeclaration,isClassElement:()=>isClassElement,isClassExpression:()=>isClassExpression,isClassInstanceProperty:()=>isClassInstanceProperty,isClassLike:()=>isClassLike,isClassMemberModifier:()=>isClassMemberModifier,isClassNamedEvaluationHelperBlock:()=>isClassNamedEvaluationHelperBlock,isClassOrTypeElement:()=>isClassOrTypeElement,isClassStaticBlockDeclaration:()=>isClassStaticBlockDeclaration,isClassThisAssignmentBlock:()=>isClassThisAssignmentBlock,isColonToken:()=>isColonToken,isCommaExpression:()=>isCommaExpression,isCommaListExpression:()=>isCommaListExpression,isCommaSequence:()=>isCommaSequence,isCommaToken:()=>isCommaToken,isComment:()=>isComment,isCommonJsExportPropertyAssignment:()=>isCommonJsExportPropertyAssignment,isCommonJsExportedExpression:()=>isCommonJsExportedExpression,isCompoundAssignment:()=>isCompoundAssignment,isComputedNonLiteralName:()=>isComputedNonLiteralName,isComputedPropertyName:()=>isComputedPropertyName,isConciseBody:()=>isConciseBody,isConditionalExpression:()=>isConditionalExpression,isConditionalTypeNode:()=>isConditionalTypeNode,isConstAssertion:()=>isConstAssertion,isConstTypeReference:()=>isConstTypeReference,isConstructSignatureDeclaration:()=>isConstructSignatureDeclaration,isConstructorDeclaration:()=>isConstructorDeclaration,isConstructorTypeNode:()=>isConstructorTypeNode,isContextualKeyword:()=>isContextualKeyword,isContinueStatement:()=>isContinueStatement,isCustomPrologue:()=>isCustomPrologue,isDebuggerStatement:()=>isDebuggerStatement,isDeclaration:()=>isDeclaration,isDeclarationBindingElement:()=>isDeclarationBindingElement,isDeclarationFileName:()=>isDeclarationFileName,isDeclarationName:()=>isDeclarationName,isDeclarationNameOfEnumOrNamespace:()=>isDeclarationNameOfEnumOrNamespace,isDeclarationReadonly:()=>isDeclarationReadonly,isDeclarationStatement:()=>isDeclarationStatement,isDeclarationWithTypeParameterChildren:()=>isDeclarationWithTypeParameterChildren,isDeclarationWithTypeParameters:()=>isDeclarationWithTypeParameters,isDecorator:()=>isDecorator,isDecoratorTarget:()=>isDecoratorTarget,isDefaultClause:()=>isDefaultClause,isDefaultImport:()=>isDefaultImport,isDefaultModifier:()=>isDefaultModifier,isDefaultedExpandoInitializer:()=>isDefaultedExpandoInitializer,isDeleteExpression:()=>isDeleteExpression,isDeleteTarget:()=>isDeleteTarget,isDeprecatedDeclaration:()=>isDeprecatedDeclaration,isDestructuringAssignment:()=>isDestructuringAssignment,isDiskPathRoot:()=>isDiskPathRoot,isDoStatement:()=>isDoStatement,isDocumentRegistryEntry:()=>isDocumentRegistryEntry,isDotDotDotToken:()=>isDotDotDotToken,isDottedName:()=>isDottedName,isDynamicName:()=>isDynamicName,isEffectiveExternalModule:()=>isEffectiveExternalModule,isEffectiveStrictModeSourceFile:()=>isEffectiveStrictModeSourceFile,isElementAccessChain:()=>isElementAccessChain,isElementAccessExpression:()=>isElementAccessExpression,isEmittedFileOfProgram:()=>isEmittedFileOfProgram,isEmptyArrayLiteral:()=>isEmptyArrayLiteral,isEmptyBindingElement:()=>isEmptyBindingElement,isEmptyBindingPattern:()=>isEmptyBindingPattern,isEmptyObjectLiteral:()=>isEmptyObjectLiteral,isEmptyStatement:()=>isEmptyStatement,isEmptyStringLiteral:()=>isEmptyStringLiteral,isEntityName:()=>isEntityName,isEntityNameExpression:()=>isEntityNameExpression,isEnumConst:()=>isEnumConst,isEnumDeclaration:()=>isEnumDeclaration,isEnumMember:()=>isEnumMember,isEqualityOperatorKind:()=>isEqualityOperatorKind,isEqualsGreaterThanToken:()=>isEqualsGreaterThanToken,isExclamationToken:()=>isExclamationToken,isExcludedFile:()=>isExcludedFile,isExclusivelyTypeOnlyImportOrExport:()=>isExclusivelyTypeOnlyImportOrExport,isExpandoPropertyDeclaration:()=>isExpandoPropertyDeclaration,isExportAssignment:()=>isExportAssignment,isExportDeclaration:()=>isExportDeclaration,isExportModifier:()=>isExportModifier,isExportName:()=>isExportName,isExportNamespaceAsDefaultDeclaration:()=>isExportNamespaceAsDefaultDeclaration,isExportOrDefaultModifier:()=>isExportOrDefaultModifier,isExportSpecifier:()=>isExportSpecifier,isExportsIdentifier:()=>isExportsIdentifier,isExportsOrModuleExportsOrAlias:()=>isExportsOrModuleExportsOrAlias,isExpression:()=>isExpression,isExpressionNode:()=>isExpressionNode,isExpressionOfExternalModuleImportEqualsDeclaration:()=>isExpressionOfExternalModuleImportEqualsDeclaration,isExpressionOfOptionalChainRoot:()=>isExpressionOfOptionalChainRoot,isExpressionStatement:()=>isExpressionStatement,isExpressionWithTypeArguments:()=>isExpressionWithTypeArguments,isExpressionWithTypeArgumentsInClassExtendsClause:()=>isExpressionWithTypeArgumentsInClassExtendsClause,isExternalModule:()=>isExternalModule,isExternalModuleAugmentation:()=>isExternalModuleAugmentation,isExternalModuleImportEqualsDeclaration:()=>isExternalModuleImportEqualsDeclaration,isExternalModuleIndicator:()=>isExternalModuleIndicator,isExternalModuleNameRelative:()=>isExternalModuleNameRelative,isExternalModuleReference:()=>isExternalModuleReference,isExternalModuleSymbol:()=>isExternalModuleSymbol,isExternalOrCommonJsModule:()=>isExternalOrCommonJsModule,isFileLevelReservedGeneratedIdentifier:()=>isFileLevelReservedGeneratedIdentifier,isFileLevelUniqueName:()=>isFileLevelUniqueName,isFileProbablyExternalModule:()=>isFileProbablyExternalModule,isFirstDeclarationOfSymbolParameter:()=>isFirstDeclarationOfSymbolParameter,isFixablePromiseHandler:()=>isFixablePromiseHandler,isForInOrOfStatement:()=>isForInOrOfStatement,isForInStatement:()=>isForInStatement,isForInitializer:()=>isForInitializer,isForOfStatement:()=>isForOfStatement,isForStatement:()=>isForStatement,isFullSourceFile:()=>isFullSourceFile,isFunctionBlock:()=>isFunctionBlock,isFunctionBody:()=>isFunctionBody,isFunctionDeclaration:()=>isFunctionDeclaration,isFunctionExpression:()=>isFunctionExpression,isFunctionExpressionOrArrowFunction:()=>isFunctionExpressionOrArrowFunction,isFunctionLike:()=>isFunctionLike,isFunctionLikeDeclaration:()=>isFunctionLikeDeclaration,isFunctionLikeKind:()=>isFunctionLikeKind,isFunctionLikeOrClassStaticBlockDeclaration:()=>isFunctionLikeOrClassStaticBlockDeclaration,isFunctionOrConstructorTypeNode:()=>isFunctionOrConstructorTypeNode,isFunctionOrModuleBlock:()=>isFunctionOrModuleBlock,isFunctionSymbol:()=>isFunctionSymbol,isFunctionTypeNode:()=>isFunctionTypeNode,isGeneratedIdentifier:()=>isGeneratedIdentifier,isGeneratedPrivateIdentifier:()=>isGeneratedPrivateIdentifier,isGetAccessor:()=>isGetAccessor,isGetAccessorDeclaration:()=>isGetAccessorDeclaration,isGetOrSetAccessorDeclaration:()=>isGetOrSetAccessorDeclaration,isGlobalScopeAugmentation:()=>isGlobalScopeAugmentation,isGlobalSourceFile:()=>isGlobalSourceFile,isGrammarError:()=>isGrammarError,isHeritageClause:()=>isHeritageClause,isHoistedFunction:()=>isHoistedFunction,isHoistedVariableStatement:()=>isHoistedVariableStatement,isIdentifier:()=>isIdentifier,isIdentifierANonContextualKeyword:()=>isIdentifierANonContextualKeyword,isIdentifierName:()=>isIdentifierName,isIdentifierOrThisTypeNode:()=>isIdentifierOrThisTypeNode,isIdentifierPart:()=>isIdentifierPart,isIdentifierStart:()=>isIdentifierStart,isIdentifierText:()=>isIdentifierText,isIdentifierTypePredicate:()=>isIdentifierTypePredicate,isIdentifierTypeReference:()=>isIdentifierTypeReference,isIfStatement:()=>isIfStatement,isIgnoredFileFromWildCardWatching:()=>isIgnoredFileFromWildCardWatching,isImplicitGlob:()=>isImplicitGlob,isImportAttribute:()=>isImportAttribute,isImportAttributeName:()=>isImportAttributeName,isImportAttributes:()=>isImportAttributes,isImportCall:()=>isImportCall,isImportClause:()=>isImportClause,isImportDeclaration:()=>isImportDeclaration,isImportEqualsDeclaration:()=>isImportEqualsDeclaration,isImportKeyword:()=>isImportKeyword,isImportMeta:()=>isImportMeta,isImportOrExportSpecifier:()=>isImportOrExportSpecifier,isImportOrExportSpecifierName:()=>isImportOrExportSpecifierName,isImportSpecifier:()=>isImportSpecifier,isImportTypeAssertionContainer:()=>isImportTypeAssertionContainer,isImportTypeNode:()=>isImportTypeNode,isImportable:()=>isImportable,isInComment:()=>isInComment,isInCompoundLikeAssignment:()=>isInCompoundLikeAssignment,isInExpressionContext:()=>isInExpressionContext,isInJSDoc:()=>isInJSDoc,isInJSFile:()=>isInJSFile,isInJSXText:()=>isInJSXText,isInJsonFile:()=>isInJsonFile,isInNonReferenceComment:()=>isInNonReferenceComment,isInReferenceComment:()=>isInReferenceComment,isInRightSideOfInternalImportEqualsDeclaration:()=>isInRightSideOfInternalImportEqualsDeclaration,isInString:()=>isInString,isInTemplateString:()=>isInTemplateString,isInTopLevelContext:()=>isInTopLevelContext,isInTypeQuery:()=>isInTypeQuery,isIncrementalBuildInfo:()=>isIncrementalBuildInfo,isIncrementalBundleEmitBuildInfo:()=>isIncrementalBundleEmitBuildInfo,isIncrementalCompilation:()=>tr,isIndexSignatureDeclaration:()=>isIndexSignatureDeclaration,isIndexedAccessTypeNode:()=>isIndexedAccessTypeNode,isInferTypeNode:()=>isInferTypeNode,isInfinityOrNaNString:()=>isInfinityOrNaNString,isInitializedProperty:()=>isInitializedProperty,isInitializedVariable:()=>isInitializedVariable,isInsideJsxElement:()=>isInsideJsxElement,isInsideJsxElementOrAttribute:()=>isInsideJsxElementOrAttribute,isInsideNodeModules:()=>isInsideNodeModules,isInsideTemplateLiteral:()=>isInsideTemplateLiteral,isInstanceOfExpression:()=>isInstanceOfExpression,isInstantiatedModule:()=>isInstantiatedModule,isInterfaceDeclaration:()=>isInterfaceDeclaration,isInternalDeclaration:()=>isInternalDeclaration,isInternalModuleImportEqualsDeclaration:()=>isInternalModuleImportEqualsDeclaration,isInternalName:()=>isInternalName,isIntersectionTypeNode:()=>isIntersectionTypeNode,isIntrinsicJsxName:()=>isIntrinsicJsxName,isIterationStatement:()=>isIterationStatement,isJSDoc:()=>isJSDoc,isJSDocAllType:()=>isJSDocAllType,isJSDocAugmentsTag:()=>isJSDocAugmentsTag,isJSDocAuthorTag:()=>isJSDocAuthorTag,isJSDocCallbackTag:()=>isJSDocCallbackTag,isJSDocClassTag:()=>isJSDocClassTag,isJSDocCommentContainingNode:()=>isJSDocCommentContainingNode,isJSDocConstructSignature:()=>isJSDocConstructSignature,isJSDocDeprecatedTag:()=>isJSDocDeprecatedTag,isJSDocEnumTag:()=>isJSDocEnumTag,isJSDocFunctionType:()=>isJSDocFunctionType,isJSDocImplementsTag:()=>isJSDocImplementsTag,isJSDocImportTag:()=>isJSDocImportTag,isJSDocIndexSignature:()=>isJSDocIndexSignature,isJSDocLikeText:()=>isJSDocLikeText,isJSDocLink:()=>isJSDocLink,isJSDocLinkCode:()=>isJSDocLinkCode,isJSDocLinkLike:()=>isJSDocLinkLike,isJSDocLinkPlain:()=>isJSDocLinkPlain,isJSDocMemberName:()=>isJSDocMemberName,isJSDocNameReference:()=>isJSDocNameReference,isJSDocNamepathType:()=>isJSDocNamepathType,isJSDocNamespaceBody:()=>isJSDocNamespaceBody,isJSDocNode:()=>isJSDocNode,isJSDocNonNullableType:()=>isJSDocNonNullableType,isJSDocNullableType:()=>isJSDocNullableType,isJSDocOptionalParameter:()=>isJSDocOptionalParameter,isJSDocOptionalType:()=>isJSDocOptionalType,isJSDocOverloadTag:()=>isJSDocOverloadTag,isJSDocOverrideTag:()=>isJSDocOverrideTag,isJSDocParameterTag:()=>isJSDocParameterTag,isJSDocPrivateTag:()=>isJSDocPrivateTag,isJSDocPropertyLikeTag:()=>isJSDocPropertyLikeTag,isJSDocPropertyTag:()=>isJSDocPropertyTag,isJSDocProtectedTag:()=>isJSDocProtectedTag,isJSDocPublicTag:()=>isJSDocPublicTag,isJSDocReadonlyTag:()=>isJSDocReadonlyTag,isJSDocReturnTag:()=>isJSDocReturnTag,isJSDocSatisfiesExpression:()=>isJSDocSatisfiesExpression,isJSDocSatisfiesTag:()=>isJSDocSatisfiesTag,isJSDocSeeTag:()=>isJSDocSeeTag,isJSDocSignature:()=>isJSDocSignature,isJSDocTag:()=>isJSDocTag,isJSDocTemplateTag:()=>isJSDocTemplateTag,isJSDocThisTag:()=>isJSDocThisTag,isJSDocThrowsTag:()=>isJSDocThrowsTag,isJSDocTypeAlias:()=>isJSDocTypeAlias,isJSDocTypeAssertion:()=>isJSDocTypeAssertion,isJSDocTypeExpression:()=>isJSDocTypeExpression,isJSDocTypeLiteral:()=>isJSDocTypeLiteral,isJSDocTypeTag:()=>isJSDocTypeTag,isJSDocTypedefTag:()=>isJSDocTypedefTag,isJSDocUnknownTag:()=>isJSDocUnknownTag,isJSDocUnknownType:()=>isJSDocUnknownType,isJSDocVariadicType:()=>isJSDocVariadicType,isJSXTagName:()=>isJSXTagName,isJsonEqual:()=>isJsonEqual,isJsonSourceFile:()=>isJsonSourceFile,isJsxAttribute:()=>isJsxAttribute,isJsxAttributeLike:()=>isJsxAttributeLike,isJsxAttributeName:()=>isJsxAttributeName,isJsxAttributes:()=>isJsxAttributes,isJsxCallLike:()=>isJsxCallLike,isJsxChild:()=>isJsxChild,isJsxClosingElement:()=>isJsxClosingElement,isJsxClosingFragment:()=>isJsxClosingFragment,isJsxElement:()=>isJsxElement,isJsxExpression:()=>isJsxExpression,isJsxFragment:()=>isJsxFragment,isJsxNamespacedName:()=>isJsxNamespacedName,isJsxOpeningElement:()=>isJsxOpeningElement,isJsxOpeningFragment:()=>isJsxOpeningFragment,isJsxOpeningLikeElement:()=>isJsxOpeningLikeElement,isJsxOpeningLikeElementTagName:()=>isJsxOpeningLikeElementTagName,isJsxSelfClosingElement:()=>isJsxSelfClosingElement,isJsxSpreadAttribute:()=>isJsxSpreadAttribute,isJsxTagNameExpression:()=>isJsxTagNameExpression,isJsxText:()=>isJsxText,isJumpStatementTarget:()=>isJumpStatementTarget,isKeyword:()=>isKeyword,isKeywordOrPunctuation:()=>isKeywordOrPunctuation,isKnownSymbol:()=>isKnownSymbol,isLabelName:()=>isLabelName,isLabelOfLabeledStatement:()=>isLabelOfLabeledStatement,isLabeledStatement:()=>isLabeledStatement,isLateVisibilityPaintedStatement:()=>isLateVisibilityPaintedStatement,isLeftHandSideExpression:()=>isLeftHandSideExpression,isLet:()=>isLet,isLineBreak:()=>isLineBreak,isLiteralComputedPropertyDeclarationName:()=>isLiteralComputedPropertyDeclarationName,isLiteralExpression:()=>isLiteralExpression,isLiteralExpressionOfObject:()=>isLiteralExpressionOfObject,isLiteralImportTypeNode:()=>isLiteralImportTypeNode,isLiteralKind:()=>isLiteralKind,isLiteralNameOfPropertyDeclarationOrIndexAccess:()=>isLiteralNameOfPropertyDeclarationOrIndexAccess,isLiteralTypeLiteral:()=>isLiteralTypeLiteral,isLiteralTypeNode:()=>isLiteralTypeNode,isLocalName:()=>isLocalName,isLogicalOperator:()=>isLogicalOperator,isLogicalOrCoalescingAssignmentExpression:()=>isLogicalOrCoalescingAssignmentExpression,isLogicalOrCoalescingAssignmentOperator:()=>isLogicalOrCoalescingAssignmentOperator,isLogicalOrCoalescingBinaryExpression:()=>isLogicalOrCoalescingBinaryExpression,isLogicalOrCoalescingBinaryOperator:()=>isLogicalOrCoalescingBinaryOperator,isMappedTypeNode:()=>isMappedTypeNode,isMemberName:()=>isMemberName,isMetaProperty:()=>isMetaProperty,isMethodDeclaration:()=>isMethodDeclaration,isMethodOrAccessor:()=>isMethodOrAccessor,isMethodSignature:()=>isMethodSignature,isMinusToken:()=>isMinusToken,isMissingDeclaration:()=>isMissingDeclaration,isMissingPackageJsonInfo:()=>isMissingPackageJsonInfo,isModifier:()=>isModifier,isModifierKind:()=>isModifierKind,isModifierLike:()=>isModifierLike,isModuleAugmentationExternal:()=>isModuleAugmentationExternal,isModuleBlock:()=>isModuleBlock,isModuleBody:()=>isModuleBody,isModuleDeclaration:()=>isModuleDeclaration,isModuleExportName:()=>isModuleExportName,isModuleExportsAccessExpression:()=>isModuleExportsAccessExpression,isModuleIdentifier:()=>isModuleIdentifier,isModuleName:()=>isModuleName,isModuleOrEnumDeclaration:()=>isModuleOrEnumDeclaration,isModuleReference:()=>isModuleReference,isModuleSpecifierLike:()=>isModuleSpecifierLike,isModuleWithStringLiteralName:()=>isModuleWithStringLiteralName,isNameOfFunctionDeclaration:()=>isNameOfFunctionDeclaration,isNameOfModuleDeclaration:()=>isNameOfModuleDeclaration,isNamedDeclaration:()=>isNamedDeclaration,isNamedEvaluation:()=>isNamedEvaluation,isNamedEvaluationSource:()=>isNamedEvaluationSource,isNamedExportBindings:()=>isNamedExportBindings,isNamedExports:()=>isNamedExports,isNamedImportBindings:()=>isNamedImportBindings,isNamedImports:()=>isNamedImports,isNamedImportsOrExports:()=>isNamedImportsOrExports,isNamedTupleMember:()=>isNamedTupleMember,isNamespaceBody:()=>isNamespaceBody,isNamespaceExport:()=>isNamespaceExport,isNamespaceExportDeclaration:()=>isNamespaceExportDeclaration,isNamespaceImport:()=>isNamespaceImport,isNamespaceReexportDeclaration:()=>isNamespaceReexportDeclaration,isNewExpression:()=>isNewExpression,isNewExpressionTarget:()=>isNewExpressionTarget,isNewScopeNode:()=>isNewScopeNode,isNoSubstitutionTemplateLiteral:()=>isNoSubstitutionTemplateLiteral,isNodeArray:()=>isNodeArray,isNodeArrayMultiLine:()=>isNodeArrayMultiLine,isNodeDescendantOf:()=>isNodeDescendantOf,isNodeKind:()=>isNodeKind,isNodeLikeSystem:()=>isNodeLikeSystem,isNodeModulesDirectory:()=>isNodeModulesDirectory,isNodeWithPossibleHoistedDeclaration:()=>isNodeWithPossibleHoistedDeclaration,isNonContextualKeyword:()=>isNonContextualKeyword,isNonGlobalAmbientModule:()=>isNonGlobalAmbientModule,isNonNullAccess:()=>isNonNullAccess,isNonNullChain:()=>isNonNullChain,isNonNullExpression:()=>isNonNullExpression,isNonStaticMethodOrAccessorWithPrivateName:()=>isNonStaticMethodOrAccessorWithPrivateName,isNotEmittedStatement:()=>isNotEmittedStatement,isNullishCoalesce:()=>isNullishCoalesce,isNumber:()=>isNumber,isNumericLiteral:()=>isNumericLiteral,isNumericLiteralName:()=>isNumericLiteralName,isObjectBindingElementWithoutPropertyName:()=>isObjectBindingElementWithoutPropertyName,isObjectBindingOrAssignmentElement:()=>isObjectBindingOrAssignmentElement,isObjectBindingOrAssignmentPattern:()=>isObjectBindingOrAssignmentPattern,isObjectBindingPattern:()=>isObjectBindingPattern,isObjectLiteralElement:()=>isObjectLiteralElement,isObjectLiteralElementLike:()=>isObjectLiteralElementLike,isObjectLiteralExpression:()=>isObjectLiteralExpression,isObjectLiteralMethod:()=>isObjectLiteralMethod,isObjectLiteralOrClassExpressionMethodOrAccessor:()=>isObjectLiteralOrClassExpressionMethodOrAccessor,isObjectTypeDeclaration:()=>isObjectTypeDeclaration,isOmittedExpression:()=>isOmittedExpression,isOptionalChain:()=>isOptionalChain,isOptionalChainRoot:()=>isOptionalChainRoot,isOptionalDeclaration:()=>isOptionalDeclaration,isOptionalJSDocPropertyLikeTag:()=>isOptionalJSDocPropertyLikeTag,isOptionalTypeNode:()=>isOptionalTypeNode,isOuterExpression:()=>isOuterExpression,isOutermostOptionalChain:()=>isOutermostOptionalChain,isOverrideModifier:()=>isOverrideModifier,isPackageJsonInfo:()=>isPackageJsonInfo,isPackedArrayLiteral:()=>isPackedArrayLiteral,isParameter:()=>isParameter,isParameterPropertyDeclaration:()=>isParameterPropertyDeclaration,isParameterPropertyModifier:()=>isParameterPropertyModifier,isParenthesizedExpression:()=>isParenthesizedExpression,isParenthesizedTypeNode:()=>isParenthesizedTypeNode,isParseTreeNode:()=>isParseTreeNode,isPartOfParameterDeclaration:()=>isPartOfParameterDeclaration,isPartOfTypeNode:()=>isPartOfTypeNode,isPartOfTypeOnlyImportOrExportDeclaration:()=>isPartOfTypeOnlyImportOrExportDeclaration,isPartOfTypeQuery:()=>isPartOfTypeQuery,isPartiallyEmittedExpression:()=>isPartiallyEmittedExpression,isPatternMatch:()=>isPatternMatch,isPinnedComment:()=>isPinnedComment,isPlainJsFile:()=>isPlainJsFile,isPlusToken:()=>isPlusToken,isPossiblyTypeArgumentPosition:()=>isPossiblyTypeArgumentPosition,isPostfixUnaryExpression:()=>isPostfixUnaryExpression,isPrefixUnaryExpression:()=>isPrefixUnaryExpression,isPrimitiveLiteralValue:()=>isPrimitiveLiteralValue,isPrivateIdentifier:()=>isPrivateIdentifier,isPrivateIdentifierClassElementDeclaration:()=>isPrivateIdentifierClassElementDeclaration,isPrivateIdentifierPropertyAccessExpression:()=>isPrivateIdentifierPropertyAccessExpression,isPrivateIdentifierSymbol:()=>isPrivateIdentifierSymbol,isProgramUptoDate:()=>isProgramUptoDate,isPrologueDirective:()=>isPrologueDirective,isPropertyAccessChain:()=>isPropertyAccessChain,isPropertyAccessEntityNameExpression:()=>isPropertyAccessEntityNameExpression,isPropertyAccessExpression:()=>isPropertyAccessExpression,isPropertyAccessOrQualifiedName:()=>isPropertyAccessOrQualifiedName,isPropertyAccessOrQualifiedNameOrImportTypeNode:()=>isPropertyAccessOrQualifiedNameOrImportTypeNode,isPropertyAssignment:()=>isPropertyAssignment,isPropertyDeclaration:()=>isPropertyDeclaration,isPropertyName:()=>isPropertyName,isPropertyNameLiteral:()=>isPropertyNameLiteral,isPropertySignature:()=>isPropertySignature,isPrototypeAccess:()=>isPrototypeAccess,isPrototypePropertyAssignment:()=>isPrototypePropertyAssignment,isPunctuation:()=>isPunctuation,isPushOrUnshiftIdentifier:()=>isPushOrUnshiftIdentifier,isQualifiedName:()=>isQualifiedName,isQuestionDotToken:()=>isQuestionDotToken,isQuestionOrExclamationToken:()=>isQuestionOrExclamationToken,isQuestionOrPlusOrMinusToken:()=>isQuestionOrPlusOrMinusToken,isQuestionToken:()=>isQuestionToken,isReadonlyKeyword:()=>isReadonlyKeyword,isReadonlyKeywordOrPlusOrMinusToken:()=>isReadonlyKeywordOrPlusOrMinusToken,isRecognizedTripleSlashComment:()=>isRecognizedTripleSlashComment,isReferenceFileLocation:()=>isReferenceFileLocation,isReferencedFile:()=>isReferencedFile,isRegularExpressionLiteral:()=>isRegularExpressionLiteral,isRequireCall:()=>isRequireCall,isRequireVariableStatement:()=>isRequireVariableStatement,isRestParameter:()=>isRestParameter,isRestTypeNode:()=>isRestTypeNode,isReturnStatement:()=>isReturnStatement,isReturnStatementWithFixablePromiseHandler:()=>isReturnStatementWithFixablePromiseHandler,isRightSideOfAccessExpression:()=>isRightSideOfAccessExpression,isRightSideOfInstanceofExpression:()=>isRightSideOfInstanceofExpression,isRightSideOfPropertyAccess:()=>isRightSideOfPropertyAccess,isRightSideOfQualifiedName:()=>isRightSideOfQualifiedName,isRightSideOfQualifiedNameOrPropertyAccess:()=>isRightSideOfQualifiedNameOrPropertyAccess,isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName:()=>isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName,isRootedDiskPath:()=>isRootedDiskPath,isSameEntityName:()=>isSameEntityName,isSatisfiesExpression:()=>isSatisfiesExpression,isSemicolonClassElement:()=>isSemicolonClassElement,isSetAccessor:()=>isSetAccessor,isSetAccessorDeclaration:()=>isSetAccessorDeclaration,isShiftOperatorOrHigher:()=>isShiftOperatorOrHigher,isShorthandAmbientModuleSymbol:()=>isShorthandAmbientModuleSymbol,isShorthandPropertyAssignment:()=>isShorthandPropertyAssignment,isSideEffectImport:()=>isSideEffectImport,isSignedNumericLiteral:()=>isSignedNumericLiteral,isSimpleCopiableExpression:()=>isSimpleCopiableExpression,isSimpleInlineableExpression:()=>isSimpleInlineableExpression,isSimpleParameterList:()=>isSimpleParameterList,isSingleOrDoubleQuote:()=>isSingleOrDoubleQuote,isSolutionConfig:()=>isSolutionConfig,isSourceElement:()=>isSourceElement,isSourceFile:()=>isSourceFile,isSourceFileFromLibrary:()=>isSourceFileFromLibrary,isSourceFileJS:()=>isSourceFileJS,isSourceFileNotJson:()=>isSourceFileNotJson,isSourceMapping:()=>isSourceMapping,isSpecialPropertyDeclaration:()=>isSpecialPropertyDeclaration,isSpreadAssignment:()=>isSpreadAssignment,isSpreadElement:()=>isSpreadElement,isStatement:()=>isStatement,isStatementButNotDeclaration:()=>isStatementButNotDeclaration,isStatementOrBlock:()=>isStatementOrBlock,isStatementWithLocals:()=>isStatementWithLocals,isStatic:()=>isStatic,isStaticModifier:()=>isStaticModifier,isString:()=>isString,isStringANonContextualKeyword:()=>isStringANonContextualKeyword,isStringAndEmptyAnonymousObjectIntersection:()=>isStringAndEmptyAnonymousObjectIntersection,isStringDoubleQuoted:()=>isStringDoubleQuoted,isStringLiteral:()=>isStringLiteral,isStringLiteralLike:()=>isStringLiteralLike,isStringLiteralOrJsxExpression:()=>isStringLiteralOrJsxExpression,isStringLiteralOrTemplate:()=>isStringLiteralOrTemplate,isStringOrNumericLiteralLike:()=>isStringOrNumericLiteralLike,isStringOrRegularExpressionOrTemplateLiteral:()=>isStringOrRegularExpressionOrTemplateLiteral,isStringTextContainingNode:()=>isStringTextContainingNode,isSuperCall:()=>isSuperCall,isSuperKeyword:()=>isSuperKeyword,isSuperProperty:()=>isSuperProperty,isSupportedSourceFileName:()=>isSupportedSourceFileName,isSwitchStatement:()=>isSwitchStatement,isSyntaxList:()=>isSyntaxList,isSyntheticExpression:()=>isSyntheticExpression,isSyntheticReference:()=>isSyntheticReference,isTagName:()=>isTagName,isTaggedTemplateExpression:()=>isTaggedTemplateExpression,isTaggedTemplateTag:()=>isTaggedTemplateTag,isTemplateExpression:()=>isTemplateExpression,isTemplateHead:()=>isTemplateHead,isTemplateLiteral:()=>isTemplateLiteral,isTemplateLiteralKind:()=>isTemplateLiteralKind,isTemplateLiteralToken:()=>isTemplateLiteralToken,isTemplateLiteralTypeNode:()=>isTemplateLiteralTypeNode,isTemplateLiteralTypeSpan:()=>isTemplateLiteralTypeSpan,isTemplateMiddle:()=>isTemplateMiddle,isTemplateMiddleOrTemplateTail:()=>isTemplateMiddleOrTemplateTail,isTemplateSpan:()=>isTemplateSpan,isTemplateTail:()=>isTemplateTail,isTextWhiteSpaceLike:()=>isTextWhiteSpaceLike,isThis:()=>isThis,isThisContainerOrFunctionBlock:()=>isThisContainerOrFunctionBlock,isThisIdentifier:()=>isThisIdentifier,isThisInTypeQuery:()=>isThisInTypeQuery,isThisInitializedDeclaration:()=>isThisInitializedDeclaration,isThisInitializedObjectBindingExpression:()=>isThisInitializedObjectBindingExpression,isThisProperty:()=>isThisProperty,isThisTypeNode:()=>isThisTypeNode,isThisTypeParameter:()=>isThisTypeParameter,isThisTypePredicate:()=>isThisTypePredicate,isThrowStatement:()=>isThrowStatement,isToken:()=>isToken,isTokenKind:()=>isTokenKind,isTraceEnabled:()=>isTraceEnabled,isTransientSymbol:()=>isTransientSymbol,isTrivia:()=>isTrivia,isTryStatement:()=>isTryStatement,isTupleTypeNode:()=>isTupleTypeNode,isTypeAlias:()=>isTypeAlias,isTypeAliasDeclaration:()=>isTypeAliasDeclaration,isTypeAssertionExpression:()=>isTypeAssertionExpression,isTypeDeclaration:()=>isTypeDeclaration,isTypeElement:()=>isTypeElement,isTypeKeyword:()=>isTypeKeyword,isTypeKeywordTokenOrIdentifier:()=>isTypeKeywordTokenOrIdentifier,isTypeLiteralNode:()=>isTypeLiteralNode,isTypeNode:()=>isTypeNode,isTypeNodeKind:()=>isTypeNodeKind,isTypeOfExpression:()=>isTypeOfExpression,isTypeOnlyExportDeclaration:()=>isTypeOnlyExportDeclaration,isTypeOnlyImportDeclaration:()=>isTypeOnlyImportDeclaration,isTypeOnlyImportOrExportDeclaration:()=>isTypeOnlyImportOrExportDeclaration,isTypeOperatorNode:()=>isTypeOperatorNode,isTypeParameterDeclaration:()=>isTypeParameterDeclaration,isTypePredicateNode:()=>isTypePredicateNode,isTypeQueryNode:()=>isTypeQueryNode,isTypeReferenceNode:()=>isTypeReferenceNode,isTypeReferenceType:()=>isTypeReferenceType,isTypeUsableAsPropertyName:()=>isTypeUsableAsPropertyName,isUMDExportSymbol:()=>isUMDExportSymbol,isUnaryExpression:()=>isUnaryExpression,isUnaryExpressionWithWrite:()=>isUnaryExpressionWithWrite,isUnicodeIdentifierStart:()=>isUnicodeIdentifierStart,isUnionTypeNode:()=>isUnionTypeNode,isUrl:()=>isUrl,isValidBigIntString:()=>isValidBigIntString,isValidESSymbolDeclaration:()=>isValidESSymbolDeclaration,isValidTypeOnlyAliasUseSite:()=>isValidTypeOnlyAliasUseSite,isValueSignatureDeclaration:()=>isValueSignatureDeclaration,isVarAwaitUsing:()=>isVarAwaitUsing,isVarConst:()=>isVarConst,isVarConstLike:()=>isVarConstLike,isVarUsing:()=>isVarUsing,isVariableDeclaration:()=>isVariableDeclaration,isVariableDeclarationInVariableStatement:()=>isVariableDeclarationInVariableStatement,isVariableDeclarationInitializedToBareOrAccessedRequire:()=>isVariableDeclarationInitializedToBareOrAccessedRequire,isVariableDeclarationInitializedToRequire:()=>isVariableDeclarationInitializedToRequire,isVariableDeclarationList:()=>isVariableDeclarationList,isVariableLike:()=>isVariableLike,isVariableStatement:()=>isVariableStatement,isVoidExpression:()=>isVoidExpression,isWatchSet:()=>isWatchSet,isWhileStatement:()=>isWhileStatement,isWhiteSpaceLike:()=>isWhiteSpaceLike,isWhiteSpaceSingleLine:()=>isWhiteSpaceSingleLine,isWithStatement:()=>isWithStatement,isWriteAccess:()=>isWriteAccess,isWriteOnlyAccess:()=>isWriteOnlyAccess,isYieldExpression:()=>isYieldExpression,jsxModeNeedsExplicitImport:()=>jsxModeNeedsExplicitImport,keywordPart:()=>keywordPart,last:()=>last,lastOrUndefined:()=>lastOrUndefined,length:()=>length,libMap:()=>Ki,libs:()=>Gi,lineBreakPart:()=>lineBreakPart,loadModuleFromGlobalCache:()=>loadModuleFromGlobalCache,loadWithModeAwareCache:()=>loadWithModeAwareCache,makeIdentifierFromModuleName:()=>makeIdentifierFromModuleName,makeImport:()=>makeImport,makeStringLiteral:()=>makeStringLiteral,mangleScopedPackageName:()=>mangleScopedPackageName,map:()=>map,mapAllOrFail:()=>mapAllOrFail,mapDefined:()=>mapDefined,mapDefinedIterator:()=>mapDefinedIterator,mapEntries:()=>mapEntries,mapIterator:()=>mapIterator,mapOneOrMany:()=>mapOneOrMany,mapToDisplayParts:()=>mapToDisplayParts,matchFiles:()=>matchFiles,matchPatternOrExact:()=>matchPatternOrExact,matchedText:()=>matchedText,matchesExclude:()=>matchesExclude,matchesExcludeWorker:()=>matchesExcludeWorker,maxBy:()=>maxBy,maybeBind:()=>maybeBind,maybeSetLocalizedDiagnosticMessages:()=>maybeSetLocalizedDiagnosticMessages,memoize:()=>memoize,memoizeOne:()=>memoizeOne,min:()=>min,minAndMax:()=>minAndMax,missingFileModifiedTime:()=>vt,modifierToFlag:()=>modifierToFlag,modifiersToFlags:()=>modifiersToFlags,moduleExportNameIsDefault:()=>moduleExportNameIsDefault,moduleExportNameTextEscaped:()=>moduleExportNameTextEscaped,moduleExportNameTextUnescaped:()=>moduleExportNameTextUnescaped,moduleOptionDeclaration:()=>Yi,moduleResolutionIsEqualTo:()=>moduleResolutionIsEqualTo,moduleResolutionNameAndModeGetter:()=>Va,moduleResolutionOptionDeclarations:()=>io,moduleResolutionSupportsPackageJsonExportsAndImports:()=>moduleResolutionSupportsPackageJsonExportsAndImports,moduleResolutionUsesNodeModules:()=>moduleResolutionUsesNodeModules,moduleSpecifierToValidIdentifier:()=>moduleSpecifierToValidIdentifier,moduleSpecifiers:()=>Ho,moduleSupportsImportAttributes:()=>moduleSupportsImportAttributes,moduleSymbolToValidIdentifier:()=>moduleSymbolToValidIdentifier,moveEmitHelpers:()=>moveEmitHelpers,moveRangeEnd:()=>moveRangeEnd,moveRangePastDecorators:()=>moveRangePastDecorators,moveRangePastModifiers:()=>moveRangePastModifiers,moveRangePos:()=>moveRangePos,moveSyntheticComments:()=>moveSyntheticComments,mutateMap:()=>mutateMap,mutateMapSkippingNewValues:()=>mutateMapSkippingNewValues,needsParentheses:()=>needsParentheses,needsScopeMarker:()=>needsScopeMarker,newCaseClauseTracker:()=>newCaseClauseTracker,newPrivateEnvironment:()=>newPrivateEnvironment,noEmitNotification:()=>noEmitNotification,noEmitSubstitution:()=>noEmitSubstitution,noTransformers:()=>Na,noTruncationMaximumTruncationLength:()=>dn,nodeCanBeDecorated:()=>nodeCanBeDecorated,nodeCoreModules:()=>Or,nodeHasName:()=>nodeHasName,nodeIsDecorated:()=>nodeIsDecorated,nodeIsMissing:()=>nodeIsMissing,nodeIsPresent:()=>nodeIsPresent,nodeIsSynthesized:()=>nodeIsSynthesized,nodeModuleNameResolver:()=>nodeModuleNameResolver,nodeModulesPathPart:()=>Wo,nodeNextJsonConfigResolver:()=>nodeNextJsonConfigResolver,nodeOrChildIsDecorated:()=>nodeOrChildIsDecorated,nodeOverlapsWithStartEnd:()=>nodeOverlapsWithStartEnd,nodePosToString:()=>nodePosToString,nodeSeenTracker:()=>nodeSeenTracker,nodeStartsNewLexicalEnvironment:()=>nodeStartsNewLexicalEnvironment,noop:()=>noop,noopFileWatcher:()=>ts,normalizePath:()=>normalizePath,normalizeSlashes:()=>normalizeSlashes,normalizeSpans:()=>normalizeSpans,not:()=>not,notImplemented:()=>notImplemented,notImplementedResolver:()=>Pa,nullNodeConverters:()=>Lr,nullParenthesizerRules:()=>wr,nullTransformationContext:()=>ka,objectAllocator:()=>Rn,operatorPart:()=>operatorPart,optionDeclarations:()=>eo,optionMapToObject:()=>optionMapToObject,optionsAffectingProgramStructure:()=>ao,optionsForBuild:()=>fo,optionsForWatch:()=>$i,optionsHaveChanges:()=>optionsHaveChanges,or:()=>or,orderedRemoveItem:()=>orderedRemoveItem,orderedRemoveItemAt:()=>orderedRemoveItemAt,packageIdToPackageName:()=>packageIdToPackageName,packageIdToString:()=>packageIdToString,parameterIsThisKeyword:()=>parameterIsThisKeyword,parameterNamePart:()=>parameterNamePart,parseBaseNodeFactory:()=>Oi,parseBigInt:()=>parseBigInt,parseBuildCommand:()=>parseBuildCommand,parseCommandLine:()=>parseCommandLine,parseCommandLineWorker:()=>parseCommandLineWorker,parseConfigFileTextToJson:()=>parseConfigFileTextToJson,parseConfigFileWithSystem:()=>parseConfigFileWithSystem,parseConfigHostFromCompilerHostLike:()=>parseConfigHostFromCompilerHostLike,parseCustomTypeOption:()=>parseCustomTypeOption,parseIsolatedEntityName:()=>parseIsolatedEntityName,parseIsolatedJSDocComment:()=>parseIsolatedJSDocComment,parseJSDocTypeExpressionForTests:()=>parseJSDocTypeExpressionForTests,parseJsonConfigFileContent:()=>parseJsonConfigFileContent,parseJsonSourceFileConfigFileContent:()=>parseJsonSourceFileConfigFileContent,parseJsonText:()=>parseJsonText,parseListTypeOption:()=>parseListTypeOption,parseNodeFactory:()=>wi,parseNodeModuleFromPath:()=>parseNodeModuleFromPath,parsePackageName:()=>parsePackageName,parsePseudoBigInt:()=>parsePseudoBigInt,parseValidBigInt:()=>parseValidBigInt,pasteEdits:()=>Mm,patchWriteFileEnsuringDirectory:()=>patchWriteFileEnsuringDirectory,pathContainsNodeModules:()=>pathContainsNodeModules,pathIsAbsolute:()=>pathIsAbsolute,pathIsBareSpecifier:()=>pathIsBareSpecifier,pathIsRelative:()=>pathIsRelative,patternText:()=>patternText,performIncrementalCompilation:()=>performIncrementalCompilation,performance:()=>B,positionBelongsToNode:()=>positionBelongsToNode,positionIsASICandidate:()=>positionIsASICandidate,positionIsSynthesized:()=>positionIsSynthesized,positionsAreOnSameLine:()=>positionsAreOnSameLine,preProcessFile:()=>preProcessFile,probablyUsesSemicolons:()=>probablyUsesSemicolons,processCommentPragmas:()=>processCommentPragmas,processPragmasIntoFields:()=>processPragmasIntoFields,processTaggedTemplateExpression:()=>processTaggedTemplateExpression,programContainsEsModules:()=>programContainsEsModules,programContainsModules:()=>programContainsModules,projectReferenceIsEqualTo:()=>projectReferenceIsEqualTo,propertyNamePart:()=>propertyNamePart,pseudoBigIntToString:()=>pseudoBigIntToString,punctuationPart:()=>punctuationPart,pushIfUnique:()=>pushIfUnique,quote:()=>quote,quotePreferenceFromString:()=>quotePreferenceFromString,rangeContainsPosition:()=>rangeContainsPosition,rangeContainsPositionExclusive:()=>rangeContainsPositionExclusive,rangeContainsRange:()=>rangeContainsRange,rangeContainsRangeExclusive:()=>rangeContainsRangeExclusive,rangeContainsStartEnd:()=>rangeContainsStartEnd,rangeEndIsOnSameLineAsRangeStart:()=>rangeEndIsOnSameLineAsRangeStart,rangeEndPositionsAreOnSameLine:()=>rangeEndPositionsAreOnSameLine,rangeEquals:()=>rangeEquals,rangeIsOnSingleLine:()=>rangeIsOnSingleLine,rangeOfNode:()=>rangeOfNode,rangeOfTypeParameters:()=>rangeOfTypeParameters,rangeOverlapsWithStartEnd:()=>rangeOverlapsWithStartEnd,rangeStartIsOnSameLineAsRangeEnd:()=>rangeStartIsOnSameLineAsRangeEnd,rangeStartPositionsAreOnSameLine:()=>rangeStartPositionsAreOnSameLine,readBuilderProgram:()=>readBuilderProgram,readConfigFile:()=>readConfigFile,readJson:()=>readJson,readJsonConfigFile:()=>readJsonConfigFile,readJsonOrUndefined:()=>readJsonOrUndefined,reduceEachLeadingCommentRange:()=>reduceEachLeadingCommentRange,reduceEachTrailingCommentRange:()=>reduceEachTrailingCommentRange,reduceLeft:()=>reduceLeft,reduceLeftIterator:()=>reduceLeftIterator,reducePathComponents:()=>reducePathComponents,refactor:()=>Nc,regExpEscape:()=>regExpEscape,regularExpressionFlagToCharacterCode:()=>regularExpressionFlagToCharacterCode,relativeComplement:()=>relativeComplement,removeAllComments:()=>removeAllComments,removeEmitHelper:()=>removeEmitHelper,removeExtension:()=>removeExtension,removeFileExtension:()=>removeFileExtension,removeIgnoredPath:()=>removeIgnoredPath,removeMinAndVersionNumbers:()=>removeMinAndVersionNumbers,removePrefix:()=>removePrefix,removeSuffix:()=>removeSuffix,removeTrailingDirectorySeparator:()=>removeTrailingDirectorySeparator,repeatString:()=>repeatString,replaceElement:()=>replaceElement,replaceFirstStar:()=>replaceFirstStar,resolutionExtensionIsTSOrJson:()=>resolutionExtensionIsTSOrJson,resolveConfigFileProjectName:()=>resolveConfigFileProjectName,resolveJSModule:()=>resolveJSModule,resolveLibrary:()=>resolveLibrary,resolveModuleName:()=>resolveModuleName,resolveModuleNameFromCache:()=>resolveModuleNameFromCache,resolvePackageNameToPackageJson:()=>resolvePackageNameToPackageJson,resolvePath:()=>resolvePath,resolveProjectReferencePath:()=>resolveProjectReferencePath,resolveTripleslashReference:()=>resolveTripleslashReference,resolveTypeReferenceDirective:()=>resolveTypeReferenceDirective,resolvingEmptyArray:()=>sn,returnFalse:()=>returnFalse,returnNoopFileWatcher:()=>returnNoopFileWatcher,returnTrue:()=>returnTrue,returnUndefined:()=>returnUndefined,returnsPromise:()=>returnsPromise,rewriteModuleSpecifier:()=>rewriteModuleSpecifier,sameFlatMap:()=>sameFlatMap,sameMap:()=>sameMap,sameMapping:()=>sameMapping,scanTokenAtPosition:()=>scanTokenAtPosition,scanner:()=>Gs,semanticDiagnosticsOptionDeclarations:()=>to,serializeCompilerOptions:()=>serializeCompilerOptions,server:()=>sg,servicesVersion:()=>Rl,setCommentRange:()=>setCommentRange,setConfigFileInOptions:()=>setConfigFileInOptions,setConstantValue:()=>setConstantValue,setEmitFlags:()=>setEmitFlags,setGetSourceFileAsHashVersioned:()=>setGetSourceFileAsHashVersioned,setIdentifierAutoGenerate:()=>setIdentifierAutoGenerate,setIdentifierGeneratedImportReference:()=>setIdentifierGeneratedImportReference,setIdentifierTypeArguments:()=>setIdentifierTypeArguments,setInternalEmitFlags:()=>setInternalEmitFlags,setLocalizedDiagnosticMessages:()=>setLocalizedDiagnosticMessages,setNodeChildren:()=>setNodeChildren,setNodeFlags:()=>setNodeFlags,setObjectAllocator:()=>setObjectAllocator,setOriginalNode:()=>setOriginalNode,setParent:()=>setParent,setParentRecursive:()=>setParentRecursive,setPrivateIdentifier:()=>setPrivateIdentifier,setSnippetElement:()=>setSnippetElement,setSourceMapRange:()=>setSourceMapRange,setStackTraceLimit:()=>setStackTraceLimit,setStartsOnNewLine:()=>setStartsOnNewLine,setSyntheticLeadingComments:()=>setSyntheticLeadingComments,setSyntheticTrailingComments:()=>setSyntheticTrailingComments,setSys:()=>setSys,setSysLog:()=>setSysLog,setTextRange:()=>setTextRange,setTextRangeEnd:()=>setTextRangeEnd,setTextRangePos:()=>setTextRangePos,setTextRangePosEnd:()=>setTextRangePosEnd,setTextRangePosWidth:()=>setTextRangePosWidth,setTokenSourceMapRange:()=>setTokenSourceMapRange,setTypeNode:()=>setTypeNode,setUILocale:()=>setUILocale,setValueDeclaration:()=>setValueDeclaration,shouldAllowImportingTsExtension:()=>shouldAllowImportingTsExtension,shouldPreserveConstEnums:()=>er,shouldRewriteModuleSpecifier:()=>shouldRewriteModuleSpecifier,shouldUseUriStyleNodeCoreModules:()=>shouldUseUriStyleNodeCoreModules,showModuleSpecifier:()=>showModuleSpecifier,signatureHasRestParameter:()=>signatureHasRestParameter,signatureToDisplayParts:()=>signatureToDisplayParts,single:()=>single,singleElementArray:()=>singleElementArray,singleIterator:()=>singleIterator,singleOrMany:()=>singleOrMany,singleOrUndefined:()=>singleOrUndefined,skipAlias:()=>skipAlias,skipConstraint:()=>skipConstraint,skipOuterExpressions:()=>skipOuterExpressions,skipParentheses:()=>skipParentheses,skipPartiallyEmittedExpressions:()=>skipPartiallyEmittedExpressions,skipTrivia:()=>skipTrivia,skipTypeChecking:()=>skipTypeChecking,skipTypeCheckingIgnoringNoCheck:()=>skipTypeCheckingIgnoringNoCheck,skipTypeParentheses:()=>skipTypeParentheses,skipWhile:()=>skipWhile,sliceAfter:()=>sliceAfter,some:()=>some,sortAndDeduplicate:()=>sortAndDeduplicate,sortAndDeduplicateDiagnostics:()=>sortAndDeduplicateDiagnostics,sourceFileAffectingCompilerOptions:()=>oo,sourceFileMayBeEmitted:()=>sourceFileMayBeEmitted,sourceMapCommentRegExp:()=>ma,sourceMapCommentRegExpDontCareLineStart:()=>fa,spacePart:()=>spacePart,spanMap:()=>spanMap,startEndContainsRange:()=>startEndContainsRange,startEndOverlapsWithStartEnd:()=>startEndOverlapsWithStartEnd,startOnNewLine:()=>startOnNewLine,startTracing:()=>$,startsWith:()=>startsWith,startsWithDirectory:()=>startsWithDirectory,startsWithUnderscore:()=>startsWithUnderscore,startsWithUseStrict:()=>startsWithUseStrict,stringContainsAt:()=>stringContainsAt,stringToToken:()=>stringToToken,stripQuotes:()=>stripQuotes,supportedDeclarationExtensions:()=>xr,supportedJSExtensionsFlat:()=>Tr,supportedLocaleDirectories:()=>on,supportedTSExtensionsFlat:()=>_r,supportedTSImplementationExtensions:()=>br,suppressLeadingAndTrailingTrivia:()=>suppressLeadingAndTrailingTrivia,suppressLeadingTrivia:()=>suppressLeadingTrivia,suppressTrailingTrivia:()=>suppressTrailingTrivia,symbolEscapedNameNoDefault:()=>symbolEscapedNameNoDefault,symbolName:()=>symbolName,symbolNameNoDefault:()=>symbolNameNoDefault,symbolToDisplayParts:()=>symbolToDisplayParts,sys:()=>Ft,sysLog:()=>sysLog,tagNamesAreEquivalent:()=>tagNamesAreEquivalent,takeWhile:()=>takeWhile,targetOptionDeclaration:()=>Xi,targetToLibMap:()=>nn,testFormatSettings:()=>Ms,textChangeRangeIsUnchanged:()=>textChangeRangeIsUnchanged,textChangeRangeNewSpan:()=>textChangeRangeNewSpan,textChanges:()=>dm,textOrKeywordPart:()=>textOrKeywordPart,textPart:()=>textPart,textRangeContainsPositionInclusive:()=>textRangeContainsPositionInclusive,textRangeContainsTextSpan:()=>textRangeContainsTextSpan,textRangeIntersectsWithTextSpan:()=>textRangeIntersectsWithTextSpan,textSpanContainsPosition:()=>textSpanContainsPosition,textSpanContainsTextRange:()=>textSpanContainsTextRange,textSpanContainsTextSpan:()=>textSpanContainsTextSpan,textSpanEnd:()=>textSpanEnd,textSpanIntersection:()=>textSpanIntersection,textSpanIntersectsWith:()=>textSpanIntersectsWith,textSpanIntersectsWithPosition:()=>textSpanIntersectsWithPosition,textSpanIntersectsWithTextSpan:()=>textSpanIntersectsWithTextSpan,textSpanIsEmpty:()=>textSpanIsEmpty,textSpanOverlap:()=>textSpanOverlap,textSpanOverlapsWith:()=>textSpanOverlapsWith,textSpansEqual:()=>textSpansEqual,textToKeywordObj:()=>Lt,timestamp:()=>R,toArray:()=>toArray,toBuilderFileEmit:()=>toBuilderFileEmit,toBuilderStateFileInfoForMultiEmit:()=>toBuilderStateFileInfoForMultiEmit,toEditorSettings:()=>toEditorSettings,toFileNameLowerCase:()=>toFileNameLowerCase,toPath:()=>toPath,toProgramEmitPending:()=>toProgramEmitPending,toSorted:()=>toSorted,tokenIsIdentifierOrKeyword:()=>tokenIsIdentifierOrKeyword,tokenIsIdentifierOrKeywordOrGreaterThan:()=>tokenIsIdentifierOrKeywordOrGreaterThan,tokenToString:()=>tokenToString,trace:()=>trace,tracing:()=>G,tracingEnabled:()=>K,transferSourceFileChildren:()=>transferSourceFileChildren,transform:()=>transform,transformClassFields:()=>transformClassFields,transformDeclarations:()=>transformDeclarations,transformECMAScriptModule:()=>transformECMAScriptModule,transformES2015:()=>transformES2015,transformES2016:()=>transformES2016,transformES2017:()=>transformES2017,transformES2018:()=>transformES2018,transformES2019:()=>transformES2019,transformES2020:()=>transformES2020,transformES2021:()=>transformES2021,transformESDecorators:()=>transformESDecorators,transformESNext:()=>transformESNext,transformGenerators:()=>transformGenerators,transformImpliedNodeFormatDependentModule:()=>transformImpliedNodeFormatDependentModule,transformJsx:()=>transformJsx,transformLegacyDecorators:()=>transformLegacyDecorators,transformModule:()=>transformModule,transformNamedEvaluation:()=>transformNamedEvaluation,transformNodes:()=>transformNodes,transformSystemModule:()=>transformSystemModule,transformTypeScript:()=>transformTypeScript,transpile:()=>transpile,transpileDeclaration:()=>transpileDeclaration,transpileModule:()=>transpileModule,transpileOptionValueCompilerOptions:()=>so,tryAddToSet:()=>tryAddToSet,tryAndIgnoreErrors:()=>tryAndIgnoreErrors,tryCast:()=>tryCast,tryDirectoryExists:()=>tryDirectoryExists,tryExtractTSExtension:()=>tryExtractTSExtension,tryFileExists:()=>tryFileExists,tryGetClassExtendingExpressionWithTypeArguments:()=>tryGetClassExtendingExpressionWithTypeArguments,tryGetClassImplementingOrExtendingExpressionWithTypeArguments:()=>tryGetClassImplementingOrExtendingExpressionWithTypeArguments,tryGetDirectories:()=>tryGetDirectories,tryGetExtensionFromPath:()=>tryGetExtensionFromPath2,tryGetImportFromModuleSpecifier:()=>tryGetImportFromModuleSpecifier,tryGetJSDocSatisfiesTypeNode:()=>tryGetJSDocSatisfiesTypeNode,tryGetModuleNameFromFile:()=>tryGetModuleNameFromFile,tryGetModuleSpecifierFromDeclaration:()=>tryGetModuleSpecifierFromDeclaration,tryGetNativePerformanceHooks:()=>tryGetNativePerformanceHooks,tryGetPropertyAccessOrIdentifierToString:()=>tryGetPropertyAccessOrIdentifierToString,tryGetPropertyNameOfBindingOrAssignmentElement:()=>tryGetPropertyNameOfBindingOrAssignmentElement,tryGetSourceMappingURL:()=>tryGetSourceMappingURL,tryGetTextOfPropertyName:()=>tryGetTextOfPropertyName,tryParseJson:()=>tryParseJson,tryParsePattern:()=>tryParsePattern,tryParsePatterns:()=>tryParsePatterns,tryParseRawSourceMap:()=>tryParseRawSourceMap,tryReadDirectory:()=>tryReadDirectory,tryReadFile:()=>tryReadFile,tryRemoveDirectoryPrefix:()=>tryRemoveDirectoryPrefix,tryRemoveExtension:()=>tryRemoveExtension,tryRemovePrefix:()=>tryRemovePrefix,tryRemoveSuffix:()=>tryRemoveSuffix,tscBuildOption:()=>uo,typeAcquisitionDeclarations:()=>_o,typeAliasNamePart:()=>typeAliasNamePart,typeDirectiveIsEqualTo:()=>typeDirectiveIsEqualTo,typeKeywords:()=>Qs,typeParameterNamePart:()=>typeParameterNamePart,typeToDisplayParts:()=>typeToDisplayParts,unchangedPollThresholds:()=>Ct,unchangedTextChangeRange:()=>rn,unescapeLeadingUnderscores:()=>unescapeLeadingUnderscores,unmangleScopedPackageName:()=>unmangleScopedPackageName,unorderedRemoveItem:()=>unorderedRemoveItem,unprefixedNodeCoreModules:()=>Ir,unreachableCodeIsError:()=>unreachableCodeIsError,unsetNodeChildren:()=>unsetNodeChildren,unusedLabelIsError:()=>unusedLabelIsError,unwrapInnermostStatementOfLabel:()=>unwrapInnermostStatementOfLabel,unwrapParenthesizedExpression:()=>unwrapParenthesizedExpression,updateErrorForNoInputFiles:()=>updateErrorForNoInputFiles,updateLanguageServiceSourceFile:()=>updateLanguageServiceSourceFile,updateMissingFilePathsWatch:()=>updateMissingFilePathsWatch,updateResolutionField:()=>updateResolutionField,updateSharedExtendedConfigFileWatcher:()=>updateSharedExtendedConfigFileWatcher,updateSourceFile:()=>updateSourceFile,updateWatchingWildcardDirectories:()=>updateWatchingWildcardDirectories,usingSingleLineStringWriter:()=>usingSingleLineStringWriter,utf16EncodeAsString:()=>utf16EncodeAsString,validateLocaleAndSetLanguage:()=>validateLocaleAndSetLanguage,version:()=>c,versionMajorMinor:()=>s,visitArray:()=>visitArray,visitCommaListElements:()=>visitCommaListElements,visitEachChild:()=>visitEachChild,visitFunctionBody:()=>visitFunctionBody,visitIterationBody:()=>visitIterationBody,visitLexicalEnvironment:()=>visitLexicalEnvironment,visitNode:()=>visitNode,visitNodes:()=>visitNodes2,visitParameterList:()=>visitParameterList,walkUpBindingElementsAndPatterns:()=>walkUpBindingElementsAndPatterns,walkUpOuterExpressions:()=>walkUpOuterExpressions,walkUpParenthesizedExpressions:()=>walkUpParenthesizedExpressions,walkUpParenthesizedTypes:()=>walkUpParenthesizedTypes,walkUpParenthesizedTypesAndGetParentAndChild:()=>walkUpParenthesizedTypesAndGetParentAndChild,whitespaceOrMapCommentRegExp:()=>_a,writeCommentRange:()=>writeCommentRange,writeFile:()=>writeFile,writeFileEnsuringDirectories:()=>writeFileEnsuringDirectories,zipWith:()=>zipWith});e.exports=__toCommonJS(a);var s="5.8";var c="5.8.2";var l=(e=>{e[e["LessThan"]=-1]="LessThan";e[e["EqualTo"]=0]="EqualTo";e[e["GreaterThan"]=1]="GreaterThan";return e})(l||{});var d=[];var p=new Map;function length(e){return e!==void 0?e.length:0}function forEach(e,t){if(e!==void 0){for(let n=0;n=0;n--){const r=t(e[n],n);if(r){return r}}}return void 0}function firstDefined(e,t){if(e===void 0){return void 0}for(let n=0;n=0;r--){const n=e[r];if(t(n,r)){return n}}return void 0}function findIndex(e,t,n){if(e===void 0)return-1;for(let r=n??0;r=0;r--){if(t(e[r],r)){return r}}return-1}function contains(e,t,n=equateValues){if(e!==void 0){for(let r=0;r{const[i,o]=t(r,e);n.set(i,o)}));return n}function some(e,t){if(e!==void 0){if(t!==void 0){for(let n=0;n0}}return false}function getRangesWhere(e,t,n){let r;for(let i=0;ie[t]))}function deduplicateEquality(e,t){const n=[];for(let r=0;r0&&r(t,e[n-1])){return false}if(n0){S.assertGreaterThanOrEqual(n(t[o],t[o-1]),0)}t:for(const a=i;ia){S.assertGreaterThanOrEqual(n(e[i],e[i-1]),0)}switch(n(t[o],e[i])){case-1:r.push(t[o]);continue e;case 0:continue e;case 1:continue t}}}return r}function append(e,t){if(t===void 0)return e;if(e===void 0)return[t];e.push(t);return e}function combine(e,t){if(e===void 0)return t;if(t===void 0)return e;if(isArray(e))return isArray(t)?concatenate(e,t):append(e,t);if(isArray(t))return append(t,e);return[e,t]}function toOffset(e,t){return t<0?e.length+t:t}function addRange(e,t,n,r){if(t===void 0||t.length===0)return e;if(e===void 0)return t.slice(n,r);n=n===void 0?0:toOffset(t,n);r=r===void 0?t.length:toOffset(t,r);for(let i=n;in(e[t],e[r])||compareValues(t,r)))}function toSorted(e,t){return e.length===0?d:e.slice().sort(t)}function*arrayReverseIterator(e){for(let t=e.length-1;t>=0;t--){yield e[t]}}function rangeEquals(e,t,n,r){while(ne==null?void 0:e.at(t):(e,t)=>{if(e!==void 0){t=toOffset(e,t);if(t>1);const s=n(e[i],i);switch(r(s,t)){case-1:o=i+1;break;case 0:return i;case 1:a=i-1;break}}return~o}function reduceLeft(e,t,n,r,i){if(e&&e.length>0){const o=e.length;if(o>0){let a=r===void 0||r<0?0:r;const s=i===void 0||a+i>o-1?o-1:a+i;let c;if(arguments.length<=2){c=e[a];a++}else{c=n}while(a<=s){c=t(c,e[a],a);a++}return c}}return n}var f=Object.prototype.hasOwnProperty;function hasProperty(e,t){return f.call(e,t)}function getProperty(e,t){return f.call(e,t)?e[t]:void 0}function getOwnKeys(e){const t=[];for(const n in e){if(f.call(e,n)){t.push(n)}}return t}function getAllKeys(e){const t=[];do{const n=Object.getOwnPropertyNames(e);for(const e of n){pushIfUnique(t,e)}}while(e=Object.getPrototypeOf(e));return t}function getOwnValues(e){const t=[];for(const n in e){if(f.call(e,n)){t.push(e[n])}}return t}function arrayOf(e,t){const n=new Array(e);for(let r=0;r100&&n>t.length>>1){const e=t.length-n;t.copyWithin(0,n);t.length=e;n=0}return e}return{enqueue:enqueue,dequeue:dequeue,isEmpty:isEmpty}}function createSet(e,t){const n=new Map;let r=0;function*getElementIterator(){for(const e of n.values()){if(isArray(e)){yield*e}else{yield e}}}const i={has(r){const i=e(r);if(!n.has(i))return false;const o=n.get(i);if(isArray(o))return contains(o,r,t);return t(o,r)},add(i){const o=e(i);if(n.has(o)){const e=n.get(o);if(isArray(e)){if(!contains(e,i,t)){e.push(i);r++}}else{const a=e;if(!t(a,i)){n.set(o,[a,i]);r++}}}else{n.set(o,i);r++}return this},delete(i){const o=e(i);if(!n.has(o))return false;const a=n.get(o);if(isArray(a)){for(let e=0;egetElementIterator(),[Symbol.toStringTag]:n[Symbol.toStringTag]};return i}function isArray(e){return Array.isArray(e)}function toArray(e){return isArray(e)?e:[e]}function isString(e){return typeof e==="string"}function isNumber(e){return typeof e==="number"}function tryCast(e,t){return e!==void 0&&t(e)?e:void 0}function cast(e,t){if(e!==void 0&&t(e))return e;return S.fail(`Invalid cast. The supplied value ${e} did not pass the test '${S.getFunctionName(t)}'.`)}function noop(e){}function returnFalse(){return false}function returnTrue(){return true}function returnUndefined(){return void 0}function identity(e){return e}function toLowerCase(e){return e.toLowerCase()}var m=/[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;function toFileNameLowerCase(e){return m.test(e)?e.replace(m,toLowerCase):e}function notImplemented(){throw new Error("Not implemented")}function memoize(e){let t;return()=>{if(e){t=e();e=void 0}return t}}function memoizeOne(e){const t=new Map;return n=>{const r=`${typeof n}:${n}`;let i=t.get(r);if(i===void 0&&!t.has(r)){i=e(n);t.set(r,i)}return i}}var _=(e=>{e[e["None"]=0]="None";e[e["Normal"]=1]="Normal";e[e["Aggressive"]=2]="Aggressive";e[e["VeryAggressive"]=3]="VeryAggressive";return e})(_||{});function equateValues(e,t){return e===t}function equateStringsCaseInsensitive(e,t){return e===t||e!==void 0&&t!==void 0&&e.toUpperCase()===t.toUpperCase()}function equateStringsCaseSensitive(e,t){return equateValues(e,t)}function compareComparableValues(e,t){return e===t?0:e===void 0?-1:t===void 0?1:et(e,n)===-1?e:n))}function compareStringsCaseInsensitive(e,t){if(e===t)return 0;if(e===void 0)return-1;if(t===void 0)return 1;e=e.toUpperCase();t=t.toUpperCase();return et?1:0}function compareStringsCaseInsensitiveEslintCompatible(e,t){if(e===t)return 0;if(e===void 0)return-1;if(t===void 0)return 1;e=e.toLowerCase();t=t.toLowerCase();return et?1:0}function compareStringsCaseSensitive(e,t){return compareComparableValues(e,t)}function getStringComparer(e){return e?compareStringsCaseInsensitive:compareStringsCaseSensitive}var g=(()=>{return createIntlCollatorStringComparer;function compareWithCallback(e,t,n){if(e===t)return 0;if(e===void 0)return-1;if(t===void 0)return 1;const r=n(e,t);return r<0?-1:r>0?1:0}function createIntlCollatorStringComparer(e){const t=new Intl.Collator(e,{usage:"sort",sensitivity:"variant",numeric:true}).compare;return(e,n)=>compareWithCallback(e,n,t)}})();var y;var h;function getUILocale(){return h}function setUILocale(e){if(h!==e){h=e;y=void 0}}function compareStringsCaseSensitiveUI(e,t){y??(y=g(h));return y(e,t)}function compareProperties(e,t,n,r){return e===t?0:e===void 0?-1:t===void 0?1:r(e[n],t[n])}function compareBooleans(e,t){return compareValues(e?1:0,t?1:0)}function getSpellingSuggestion(e,t,n){const r=Math.max(2,Math.floor(e.length*.34));let i=Math.floor(e.length*.4)+1;let o;for(const a of t){const t=n(a);if(t!==void 0&&Math.abs(t.length-e.length)<=r){if(t===e){continue}if(t.length<3&&t.toLowerCase()!==e.toLowerCase()){continue}const n=levenshteinWithMax(e,t,i-.1);if(n===void 0){continue}S.assert(nn?a-n:1);const l=Math.floor(t.length>n+a?n+a:t.length);i[0]=a;let d=a;for(let e=1;en){return void 0}const p=r;r=i;i=p}const a=r[t.length];return a>n?void 0:a}function endsWith(e,t,n){const r=e.length-t.length;return r>=0&&(n?equateStringsCaseInsensitive(e.slice(r),t):e.indexOf(t,r)===r)}function removeSuffix(e,t){return endsWith(e,t)?e.slice(0,e.length-t.length):e}function tryRemoveSuffix(e,t){return endsWith(e,t)?e.slice(0,e.length-t.length):void 0}function removeMinAndVersionNumbers(e){let t=e.length;for(let n=t-1;n>0;n--){let r=e.charCodeAt(n);if(r>=48&&r<=57){do{--n;r=e.charCodeAt(n)}while(n>0&&r>=48&&r<=57)}else if(n>4&&(r===110||r===78)){--n;r=e.charCodeAt(n);if(r!==105&&r!==73){break}--n;r=e.charCodeAt(n);if(r!==109&&r!==77){break}--n;r=e.charCodeAt(n)}else{break}if(r!==45&&r!==46){break}t=n}return t===e.length?e:e.slice(0,t)}function orderedRemoveItem(e,t){for(let n=0;ne===t))}function unorderedRemoveFirstItemWhere(e,t){for(let n=0;ni&&isPatternMatch(s,n)){i=s.prefix.length;r=a}}return r}function startsWith(e,t,n){return n?equateStringsCaseInsensitive(e.slice(0,t.length),t):e.lastIndexOf(t,0)===0}function removePrefix(e,t){return startsWith(e,t)?e.substr(t.length):e}function tryRemovePrefix(e,t,n=identity){return startsWith(n(e),n(t))?e.substring(t.length):void 0}function isPatternMatch({prefix:e,suffix:t},n){return n.length>=e.length+t.length&&startsWith(n,e)&&endsWith(n,t)}function and(e,t){return n=>e(n)&&t(n)}function or(...e){return(...t)=>{let n;for(const r of e){n=r(...t);if(n){return n}}return n}}function not(e){return(...t)=>!e(...t)}function assertType(e){}function singleElementArray(e){return e===void 0?void 0:[e]}function enumerateInsertsAndDeletes(e,t,n,r,i,o){o??(o=noop);let a=0;let s=0;const c=e.length;const l=t.length;let d=false;while(a{e[e["Off"]=0]="Off";e[e["Error"]=1]="Error";e[e["Warning"]=2]="Warning";e[e["Info"]=3]="Info";e[e["Verbose"]=4]="Verbose";return e})(T||{});var S;(e=>{let t=0;e.currentLogLevel=2;e.isDebugging=false;function shouldLog(t){return e.currentLogLevel<=t}e.shouldLog=shouldLog;function logMessage(t,n){if(e.loggingHost&&shouldLog(t)){e.loggingHost.log(t,n)}}function log(e){logMessage(3,e)}e.log=log;(e=>{function error2(e){logMessage(1,e)}e.error=error2;function warn(e){logMessage(2,e)}e.warn=warn;function log2(e){logMessage(3,e)}e.log=log2;function trace2(e){logMessage(4,e)}e.trace=trace2})(log=e.log||(e.log={}));const n={};function getAssertionLevel(){return t}e.getAssertionLevel=getAssertionLevel;function setAssertionLevel(r){const i=t;t=r;if(r>i){for(const t of getOwnKeys(n)){const i=n[t];if(i!==void 0&&e[t]!==i.assertion&&r>=i.level){e[t]=i;n[t]=void 0}}}}e.setAssertionLevel=setAssertionLevel;function shouldAssert(e){return t>=e}e.shouldAssert=shouldAssert;function shouldAssertFunction(t,r){if(!shouldAssert(t)){n[r]={level:t,assertion:e[r]};e[r]=noop;return false}return true}function fail(e,t){debugger;const n=new Error(e?`Debug Failure. ${e}`:"Debug Failure.");if(Error.captureStackTrace){Error.captureStackTrace(n,t||fail)}throw n}e.fail=fail;function failBadSyntaxKind(e,t,n){return fail(`${t||"Unexpected node."}\r\nNode ${formatSyntaxKind(e.kind)} was unexpected.`,n||failBadSyntaxKind)}e.failBadSyntaxKind=failBadSyntaxKind;function assert(e,t,n,r){if(!e){t=t?`False expression: ${t}`:"False expression.";if(n){t+="\r\nVerbose Debug Information: "+(typeof n==="string"?n:n())}fail(t,r||assert)}}e.assert=assert;function assertEqual(e,t,n,r,i){if(e!==t){const o=n?r?`${n} ${r}`:n:"";fail(`Expected ${e} === ${t}. ${o}`,i||assertEqual)}}e.assertEqual=assertEqual;function assertLessThan(e,t,n,r){if(e>=t){fail(`Expected ${e} < ${t}. ${n||""}`,r||assertLessThan)}}e.assertLessThan=assertLessThan;function assertLessThanOrEqual(e,t,n){if(e>t){fail(`Expected ${e} <= ${t}`,n||assertLessThanOrEqual)}}e.assertLessThanOrEqual=assertLessThanOrEqual;function assertGreaterThanOrEqual(e,t,n){if(e= ${t}`,n||assertGreaterThanOrEqual)}}e.assertGreaterThanOrEqual=assertGreaterThanOrEqual;function assertIsDefined(e,t,n){if(e===void 0||e===null){fail(t,n||assertIsDefined)}}e.assertIsDefined=assertIsDefined;function checkDefined(e,t,n){assertIsDefined(e,t,n||checkDefined);return e}e.checkDefined=checkDefined;function assertEachIsDefined(e,t,n){for(const r of e){assertIsDefined(r,t,n||assertEachIsDefined)}}e.assertEachIsDefined=assertEachIsDefined;function checkEachDefined(e,t,n){assertEachIsDefined(e,t,n||checkEachDefined);return e}e.checkEachDefined=checkEachDefined;function assertNever(e,t="Illegal value:",n){const r=typeof e==="object"&&hasProperty(e,"kind")&&hasProperty(e,"pos")?"SyntaxKind: "+formatSyntaxKind(e.kind):JSON.stringify(e);return fail(`${t} ${r}`,n||assertNever)}e.assertNever=assertNever;function assertEachNode(e,t,n,r){if(shouldAssertFunction(1,"assertEachNode")){assert(t===void 0||every(e,t),n||"Unexpected node.",(()=>`Node array did not pass test '${getFunctionName(t)}'.`),r||assertEachNode)}}e.assertEachNode=assertEachNode;function assertNode(e,t,n,r){if(shouldAssertFunction(1,"assertNode")){assert(e!==void 0&&(t===void 0||t(e)),n||"Unexpected node.",(()=>`Node ${formatSyntaxKind(e==null?void 0:e.kind)} did not pass test '${getFunctionName(t)}'.`),r||assertNode)}}e.assertNode=assertNode;function assertNotNode(e,t,n,r){if(shouldAssertFunction(1,"assertNotNode")){assert(e===void 0||t===void 0||!t(e),n||"Unexpected node.",(()=>`Node ${formatSyntaxKind(e.kind)} should not have passed test '${getFunctionName(t)}'.`),r||assertNotNode)}}e.assertNotNode=assertNotNode;function assertOptionalNode(e,t,n,r){if(shouldAssertFunction(1,"assertOptionalNode")){assert(t===void 0||e===void 0||t(e),n||"Unexpected node.",(()=>`Node ${formatSyntaxKind(e==null?void 0:e.kind)} did not pass test '${getFunctionName(t)}'.`),r||assertOptionalNode)}}e.assertOptionalNode=assertOptionalNode;function assertOptionalToken(e,t,n,r){if(shouldAssertFunction(1,"assertOptionalToken")){assert(t===void 0||e===void 0||e.kind===t,n||"Unexpected node.",(()=>`Node ${formatSyntaxKind(e==null?void 0:e.kind)} was not a '${formatSyntaxKind(t)}' token.`),r||assertOptionalToken)}}e.assertOptionalToken=assertOptionalToken;function assertMissingNode(e,t,n){if(shouldAssertFunction(1,"assertMissingNode")){assert(e===void 0,t||"Unexpected node.",(()=>`Node ${formatSyntaxKind(e.kind)} was unexpected'.`),n||assertMissingNode)}}e.assertMissingNode=assertMissingNode;function type(e){}e.type=type;function getFunctionName(e){if(typeof e!=="function"){return""}else if(hasProperty(e,"name")){return e.name}else{const t=Function.prototype.toString.call(e);const n=/^function\s+([\w$]+)\s*\(/.exec(t);return n?n[1]:""}}e.getFunctionName=getFunctionName;function formatSymbol(e){return`{ name: ${unescapeLeadingUnderscores(e.escapedName)}; flags: ${formatSymbolFlags(e.flags)}; declarations: ${map(e.declarations,(e=>formatSyntaxKind(e.kind)))} }`}e.formatSymbol=formatSymbol;function formatEnum(e=0,t,n){const r=getEnumMembers(t);if(e===0){return r.length>0&&r[0][0]===0?r[0][1]:"0"}if(n){const t=[];let n=e;for(const[i,o]of r){if(i>e){break}if(i!==0&&i&e){t.push(o);n&=~i}}if(n===0){return t.join("|")}}else{for(const[t,n]of r){if(t===e){return n}}}return e.toString()}e.formatEnum=formatEnum;const r=new Map;function getEnumMembers(e){const t=r.get(e);if(t){return t}const n=[];for(const t in e){const r=e[t];if(typeof r==="number"){n.push([r,t])}}const i=toSorted(n,((e,t)=>compareValues(e[0],t[0])));r.set(e,i);return i}function formatSyntaxKind(e){return formatEnum(e,X,false)}e.formatSyntaxKind=formatSyntaxKind;function formatSnippetKind(e){return formatEnum(e,st,false)}e.formatSnippetKind=formatSnippetKind;function formatScriptKind(e){return formatEnum(e,et,false)}e.formatScriptKind=formatScriptKind;function formatNodeFlags(e){return formatEnum(e,Y,true)}e.formatNodeFlags=formatNodeFlags;function formatNodeCheckFlags(e){return formatEnum(e,Fe,true)}e.formatNodeCheckFlags=formatNodeCheckFlags;function formatModifierFlags(e){return formatEnum(e,Z,true)}e.formatModifierFlags=formatModifierFlags;function formatTransformFlags(e){return formatEnum(e,at,true)}e.formatTransformFlags=formatTransformFlags;function formatEmitFlags(e){return formatEnum(e,ct,true)}e.formatEmitFlags=formatEmitFlags;function formatSymbolFlags(e){return formatEnum(e,Ee,true)}e.formatSymbolFlags=formatSymbolFlags;function formatTypeFlags(e){return formatEnum(e,Pe,true)}e.formatTypeFlags=formatTypeFlags;function formatSignatureFlags(e){return formatEnum(e,Re,true)}e.formatSignatureFlags=formatSignatureFlags;function formatObjectFlags(e){return formatEnum(e,De,true)}e.formatObjectFlags=formatObjectFlags;function formatFlowFlags(e){return formatEnum(e,ae,true)}e.formatFlowFlags=formatFlowFlags;function formatRelationComparisonResult(e){return formatEnum(e,te,true)}e.formatRelationComparisonResult=formatRelationComparisonResult;function formatCheckMode(e){return formatEnum(e,ia,true)}e.formatCheckMode=formatCheckMode;function formatSignatureCheckMode(e){return formatEnum(e,oa,true)}e.formatSignatureCheckMode=formatSignatureCheckMode;function formatTypeFacts(e){return formatEnum(e,na,true)}e.formatTypeFacts=formatTypeFacts;let i=false;let o;function attachFlowNodeDebugInfoWorker(e){if(!("__debugFlowFlags"in e)){Object.defineProperties(e,{__tsDebuggerDisplay:{value(){const e=this.flags&2?"FlowStart":this.flags&4?"FlowBranchLabel":this.flags&8?"FlowLoopLabel":this.flags&16?"FlowAssignment":this.flags&32?"FlowTrueCondition":this.flags&64?"FlowFalseCondition":this.flags&128?"FlowSwitchClause":this.flags&256?"FlowArrayMutation":this.flags&512?"FlowCall":this.flags&1024?"FlowReduceLabel":this.flags&1?"FlowUnreachable":"UnknownFlow";const t=this.flags&~(2048-1);return`${e}${t?` (${formatFlowFlags(t)})`:""}`}},__debugFlowFlags:{get(){return formatEnum(this.flags,ae,true)}},__debugToString:{value(){return formatControlFlowGraph(this)}}})}}function attachFlowNodeDebugInfo(e){if(i){if(typeof Object.setPrototypeOf==="function"){if(!o){o=Object.create(Object.prototype);attachFlowNodeDebugInfoWorker(o)}Object.setPrototypeOf(e,o)}else{attachFlowNodeDebugInfoWorker(e)}}return e}e.attachFlowNodeDebugInfo=attachFlowNodeDebugInfo;let a;function attachNodeArrayDebugInfoWorker(e){if(!("__tsDebuggerDisplay"in e)){Object.defineProperties(e,{__tsDebuggerDisplay:{value(e){e=String(e).replace(/(?:,[\s\w]+:[^,]+)+\]$/,"]");return`NodeArray ${e}`}}})}}function attachNodeArrayDebugInfo(e){if(i){if(typeof Object.setPrototypeOf==="function"){if(!a){a=Object.create(Array.prototype);attachNodeArrayDebugInfoWorker(a)}Object.setPrototypeOf(e,a)}else{attachNodeArrayDebugInfoWorker(e)}}}e.attachNodeArrayDebugInfo=attachNodeArrayDebugInfo;function enableDebugInfo(){if(i)return;const e=new WeakMap;const t=new WeakMap;Object.defineProperties(Rn.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value(){const e=this.flags&33554432?"TransientSymbol":"Symbol";const t=this.flags&~33554432;return`${e} '${symbolName(this)}'${t?` (${formatSymbolFlags(t)})`:""}`}},__debugFlags:{get(){return formatSymbolFlags(this.flags)}}});Object.defineProperties(Rn.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value(){const e=this.flags&67359327?`IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName?` (${this.debugIntrinsicName})`:""}`:this.flags&98304?"NullableType":this.flags&384?`LiteralType ${JSON.stringify(this.value)}`:this.flags&2048?`LiteralType ${this.value.negative?"-":""}${this.value.base10Value}n`:this.flags&8192?"UniqueESSymbolType":this.flags&32?"EnumType":this.flags&1048576?"UnionType":this.flags&2097152?"IntersectionType":this.flags&4194304?"IndexType":this.flags&8388608?"IndexedAccessType":this.flags&16777216?"ConditionalType":this.flags&33554432?"SubstitutionType":this.flags&262144?"TypeParameter":this.flags&524288?this.objectFlags&3?"InterfaceType":this.objectFlags&4?"TypeReference":this.objectFlags&8?"TupleType":this.objectFlags&16?"AnonymousType":this.objectFlags&32?"MappedType":this.objectFlags&1024?"ReverseMappedType":this.objectFlags&256?"EvolvingArrayType":"ObjectType":"Type";const t=this.flags&524288?this.objectFlags&~1343:0;return`${e}${this.symbol?` '${symbolName(this.symbol)}'`:""}${t?` (${formatObjectFlags(t)})`:""}`}},__debugFlags:{get(){return formatTypeFlags(this.flags)}},__debugObjectFlags:{get(){return this.flags&524288?formatObjectFlags(this.objectFlags):""}},__debugTypeToString:{value(){let t=e.get(this);if(t===void 0){t=this.checker.typeToString(this);e.set(this,t)}return t}}});Object.defineProperties(Rn.getSignatureConstructor().prototype,{__debugFlags:{get(){return formatSignatureFlags(this.flags)}},__debugSignatureToString:{value(){var e;return(e=this.checker)==null?void 0:e.signatureToString(this)}}});const n=[Rn.getNodeConstructor(),Rn.getIdentifierConstructor(),Rn.getTokenConstructor(),Rn.getSourceFileConstructor()];for(const e of n){if(!hasProperty(e.prototype,"__debugKind")){Object.defineProperties(e.prototype,{__tsDebuggerDisplay:{value(){const e=isGeneratedIdentifier(this)?"GeneratedIdentifier":isIdentifier(this)?`Identifier '${idText(this)}'`:isPrivateIdentifier(this)?`PrivateIdentifier '${idText(this)}'`:isStringLiteral(this)?`StringLiteral ${JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+"...")}`:isNumericLiteral(this)?`NumericLiteral ${this.text}`:isBigIntLiteral(this)?`BigIntLiteral ${this.text}n`:isTypeParameterDeclaration(this)?"TypeParameterDeclaration":isParameter(this)?"ParameterDeclaration":isConstructorDeclaration(this)?"ConstructorDeclaration":isGetAccessorDeclaration(this)?"GetAccessorDeclaration":isSetAccessorDeclaration(this)?"SetAccessorDeclaration":isCallSignatureDeclaration(this)?"CallSignatureDeclaration":isConstructSignatureDeclaration(this)?"ConstructSignatureDeclaration":isIndexSignatureDeclaration(this)?"IndexSignatureDeclaration":isTypePredicateNode(this)?"TypePredicateNode":isTypeReferenceNode(this)?"TypeReferenceNode":isFunctionTypeNode(this)?"FunctionTypeNode":isConstructorTypeNode(this)?"ConstructorTypeNode":isTypeQueryNode(this)?"TypeQueryNode":isTypeLiteralNode(this)?"TypeLiteralNode":isArrayTypeNode(this)?"ArrayTypeNode":isTupleTypeNode(this)?"TupleTypeNode":isOptionalTypeNode(this)?"OptionalTypeNode":isRestTypeNode(this)?"RestTypeNode":isUnionTypeNode(this)?"UnionTypeNode":isIntersectionTypeNode(this)?"IntersectionTypeNode":isConditionalTypeNode(this)?"ConditionalTypeNode":isInferTypeNode(this)?"InferTypeNode":isParenthesizedTypeNode(this)?"ParenthesizedTypeNode":isThisTypeNode(this)?"ThisTypeNode":isTypeOperatorNode(this)?"TypeOperatorNode":isIndexedAccessTypeNode(this)?"IndexedAccessTypeNode":isMappedTypeNode(this)?"MappedTypeNode":isLiteralTypeNode(this)?"LiteralTypeNode":isNamedTupleMember(this)?"NamedTupleMember":isImportTypeNode(this)?"ImportTypeNode":formatSyntaxKind(this.kind);return`${e}${this.flags?` (${formatNodeFlags(this.flags)})`:""}`}},__debugKind:{get(){return formatSyntaxKind(this.kind)}},__debugNodeFlags:{get(){return formatNodeFlags(this.flags)}},__debugModifierFlags:{get(){return formatModifierFlags(getEffectiveModifierFlagsNoCache(this))}},__debugTransformFlags:{get(){return formatTransformFlags(this.transformFlags)}},__debugIsParseTreeNode:{get(){return isParseTreeNode(this)}},__debugEmitFlags:{get(){return formatEmitFlags(getEmitFlags(this))}},__debugGetText:{value(e){if(nodeIsSynthesized(this))return"";let n=t.get(this);if(n===void 0){const r=getParseTreeNode(this);const i=r&&getSourceFileOfNode(r);n=i?getSourceTextOfNodeFromSourceFile(i,r,e):"";t.set(this,n)}return n}}})}}i=true}e.enableDebugInfo=enableDebugInfo;function formatVariance(e){const t=e&7;let n=t===0?"in out":t===3?"[bivariant]":t===2?"in":t===1?"out":t===4?"[independent]":"";if(e&8){n+=" (unmeasurable)"}else if(e&16){n+=" (unreliable)"}return n}e.formatVariance=formatVariance;class DebugTypeMapper{__debugToString(){var e;type(this);switch(this.kind){case 3:return((e=this.debugInfo)==null?void 0:e.call(this))||"(function mapper)";case 0:return`${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`;case 1:return zipWith(this.sources,this.targets||map(this.sources,(()=>"any")),((e,t)=>`${e.__debugTypeToString()} -> ${typeof t==="string"?t:t.__debugTypeToString()}`)).join(", ");case 2:return zipWith(this.sources,this.targets,((e,t)=>`${e.__debugTypeToString()} -> ${t().__debugTypeToString()}`)).join(", ");case 5:case 4:return`m1: ${this.mapper1.__debugToString().split("\n").join("\n ")}\nm2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`;default:return assertNever(this)}}}e.DebugTypeMapper=DebugTypeMapper;function attachDebugPrototypeIfDebug(t){if(e.isDebugging){return Object.setPrototypeOf(t,DebugTypeMapper.prototype)}return t}e.attachDebugPrototypeIfDebug=attachDebugPrototypeIfDebug;function printControlFlowGraph(e){return console.log(formatControlFlowGraph(e))}e.printControlFlowGraph=printControlFlowGraph;function formatControlFlowGraph(e){let t=-1;function getDebugFlowNodeId(e){if(!e.id){e.id=t;t--}return e.id}let n;(e=>{e["lr"]="─";e["ud"]="│";e["dr"]="╭";e["dl"]="╮";e["ul"]="╯";e["ur"]="╰";e["udr"]="├";e["udl"]="┤";e["dlr"]="┬";e["ulr"]="┴";e["udlr"]="╫"})(n||(n={}));let r;(e=>{e[e["None"]=0]="None";e[e["Up"]=1]="Up";e[e["Down"]=2]="Down";e[e["Left"]=4]="Left";e[e["Right"]=8]="Right";e[e["UpDown"]=3]="UpDown";e[e["LeftRight"]=12]="LeftRight";e[e["UpLeft"]=5]="UpLeft";e[e["UpRight"]=9]="UpRight";e[e["DownLeft"]=6]="DownLeft";e[e["DownRight"]=10]="DownRight";e[e["UpDownLeft"]=7]="UpDownLeft";e[e["UpDownRight"]=11]="UpDownRight";e[e["UpLeftRight"]=13]="UpLeftRight";e[e["DownLeftRight"]=14]="DownLeftRight";e[e["UpDownLeftRight"]=15]="UpDownLeftRight";e[e["NoChildren"]=16]="NoChildren"})(r||(r={}));const i=16|96|128|256|512|1024;const o=2|16|512|96|256;const a=Object.create(null);const s=[];const c=[];const l=buildGraphNode(e,new Set);for(const e of s){e.text=renderFlowNode(e.flowNode,e.circular);computeLevel(e)}const d=computeHeight(l);const p=computeColumnWidths(d);computeLanes(l,0);return renderGraph();function isFlowSwitchClause(e){return!!(e.flags&128)}function hasAntecedents(e){return!!(e.flags&12)&&!!e.antecedent}function hasAntecedent(e){return!!(e.flags&i)}function hasNode(e){return!!(e.flags&o)}function getChildren(e){const t=[];for(const n of e.edges){if(n.source===e){t.push(n.target)}}return t}function getParents(e){const t=[];for(const n of e.edges){if(n.target===e){t.push(n.source)}}return t}function buildGraphNode(e,t){const n=getDebugFlowNodeId(e);let r=a[n];if(r&&t.has(e)){r.circular=true;r={id:-1,flowNode:e,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:"circularity"};s.push(r);return r}t.add(e);if(!r){a[n]=r={id:n,flowNode:e,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:false};s.push(r);if(hasAntecedents(e)){for(const n of e.antecedent){buildGraphEdge(r,n,t)}}else if(hasAntecedent(e)){buildGraphEdge(r,e.antecedent,t)}}t.delete(e);return r}function buildGraphEdge(e,t,n){const r=buildGraphNode(t,n);const i={source:e,target:r};c.push(i);e.edges.push(i);r.edges.push(i)}function computeLevel(e){if(e.level!==-1){return e.level}let t=0;for(const n of getParents(e)){t=Math.max(t,computeLevel(n)+1)}return e.level=t}function computeHeight(e){let t=0;for(const n of getChildren(e)){t=Math.max(t,computeHeight(n))}return t+1}function computeColumnWidths(e){const t=fill(Array(e),0);for(const e of s){t[e.level]=Math.max(t[e.level],e.text.length)}return t}function computeLanes(e,t){if(e.lane===-1){e.lane=t;e.endLane=t;const n=getChildren(e);for(let r=0;r0)t++;const i=n[r];computeLanes(i,t);if(i.endLane>e.endLane){t=i.endLane}}e.endLane=t}}function getHeader2(e){if(e&2)return"Start";if(e&4)return"Branch";if(e&8)return"Loop";if(e&16)return"Assignment";if(e&32)return"True";if(e&64)return"False";if(e&128)return"SwitchClause";if(e&256)return"ArrayMutation";if(e&512)return"Call";if(e&1024)return"ReduceLabel";if(e&1)return"Unreachable";throw new Error}function getNodeText(e){const t=getSourceFileOfNode(e);return getSourceTextOfNodeFromSourceFile(t,e,false)}function renderFlowNode(e,t){let n=getHeader2(e.flags);if(t){n=`${n}#${getDebugFlowNodeId(e)}`}if(isFlowSwitchClause(e)){const t=[];const{switchStatement:r,clauseStart:i,clauseEnd:o}=e.node;for(let e=i;ee.lane))+1;const n=fill(Array(t),"");const r=p.map((()=>Array(t)));const i=p.map((()=>fill(Array(t),0)));for(const e of s){r[e.level][e.lane]=e;const t=getChildren(e);for(let n=0;n0)o|=1;if(n0)o|=1;if(t0?i[n-1][e]:0;const r=e>0?i[n][e-1]:0;let o=i[n][e];if(!o){if(t&8)o|=12;if(r&2)o|=3;i[n][e]=o}}}for(let t=0;t0?e.repeat(t):""}let n="";while(n.length=0,"Invalid argument: major");S.assert(t>=0,"Invalid argument: minor");S.assert(n>=0,"Invalid argument: patch");const o=r?isArray(r)?r:r.split("."):d;const a=i?isArray(i)?i:i.split("."):d;S.assert(every(o,(e=>b.test(e))),"Invalid argument: prerelease");S.assert(every(a,(e=>E.test(e))),"Invalid argument: build");this.major=e;this.minor=t;this.patch=n;this.prerelease=o;this.build=a}static tryParse(e){const t=tryParseComponents(e);if(!t)return void 0;const{major:n,minor:r,patch:i,prerelease:o,build:a}=t;return new _Version(n,r,i,o,a)}compareTo(e){if(this===e)return 0;if(e===void 0)return 1;return compareValues(this.major,e.major)||compareValues(this.minor,e.minor)||compareValues(this.patch,e.patch)||comparePrereleaseIdentifiers(this.prerelease,e.prerelease)}increment(e){switch(e){case"major":return new _Version(this.major+1,0,0);case"minor":return new _Version(this.major,this.minor+1,0);case"patch":return new _Version(this.major,this.minor,this.patch+1);default:return S.assertNever(e)}}with(e){const{major:t=this.major,minor:n=this.minor,patch:r=this.patch,prerelease:i=this.prerelease,build:o=this.build}=e;return new _Version(t,n,r,i,o)}toString(){let e=`${this.major}.${this.minor}.${this.patch}`;if(some(this.prerelease))e+=`-${this.prerelease.join(".")}`;if(some(this.build))e+=`+${this.build.join(".")}`;return e}};k.zero=new k(0,0,0,["0"]);var F=k;function tryParseComponents(e){const t=v.exec(e);if(!t)return void 0;const[,n,r="0",i="0",o="",a=""]=t;if(o&&!x.test(o))return void 0;if(a&&!C.test(a))return void 0;return{major:parseInt(n,10),minor:parseInt(r,10),patch:parseInt(i,10),prerelease:o,build:a}}function comparePrereleaseIdentifiers(e,t){if(e===t)return 0;if(e.length===0)return t.length===0?0:1;if(t.length===0)return-1;const n=Math.min(e.length,t.length);for(let r=0;r=]|<=|>=)?\s*([a-z0-9-+.*]+)$/i;function parseRange(e){const t=[];for(let n of e.trim().split(D)){if(!n)continue;const e=[];n=n.trim();const r=O.exec(n);if(r){if(!parseHyphen(r[1],r[2],e))return void 0}else{for(const t of n.split(I)){const n=w.exec(t.trim());if(!n||!parseComparator(n[1],n[2],e))return void 0}}t.push(e)}return t}function parsePartial(e){const t=A.exec(e);if(!t)return void 0;const[,n,r="*",i="*",o,a]=t;const s=new F(isWildcard(n)?0:parseInt(n,10),isWildcard(n)||isWildcard(r)?0:parseInt(r,10),isWildcard(n)||isWildcard(r)||isWildcard(i)?0:parseInt(i,10),o,a);return{version:s,major:n,minor:r,patch:i}}function parseHyphen(e,t,n){const r=parsePartial(e);if(!r)return false;const i=parsePartial(t);if(!i)return false;if(!isWildcard(r.major)){n.push(createComparator(">=",r.version))}if(!isWildcard(i.major)){n.push(isWildcard(i.minor)?createComparator("<",i.version.increment("major")):isWildcard(i.patch)?createComparator("<",i.version.increment("minor")):createComparator("<=",i.version))}return true}function parseComparator(e,t,n){const r=parsePartial(t);if(!r)return false;const{version:i,major:o,minor:a,patch:s}=r;if(!isWildcard(o)){switch(e){case"~":n.push(createComparator(">=",i));n.push(createComparator("<",i.increment(isWildcard(a)?"major":"minor")));break;case"^":n.push(createComparator(">=",i));n.push(createComparator("<",i.increment(i.major>0||isWildcard(a)?"major":i.minor>0||isWildcard(s)?"minor":"patch")));break;case"<":case">=":n.push(isWildcard(a)||isWildcard(s)?createComparator(e,i.with({prerelease:"0"})):createComparator(e,i));break;case"<=":case">":n.push(isWildcard(a)?createComparator(e==="<="?"<":">=",i.increment("major").with({prerelease:"0"})):isWildcard(s)?createComparator(e==="<="?"<":">=",i.increment("minor").with({prerelease:"0"})):createComparator(e,i));break;case"=":case void 0:if(isWildcard(a)||isWildcard(s)){n.push(createComparator(">=",i.with({prerelease:"0"})));n.push(createComparator("<",i.increment(isWildcard(a)?"major":"minor").with({prerelease:"0"})))}else{n.push(createComparator("=",i))}break;default:return false}}else if(e==="<"||e===">"){n.push(createComparator("<",F.zero))}return true}function isWildcard(e){return e==="*"||e==="x"||e==="X"}function createComparator(e,t){return{operator:e,operand:t}}function testDisjunction(e,t){if(t.length===0)return true;for(const n of t){if(testAlternative(e,n))return true}return false}function testAlternative(e,t){for(const n of t){if(!testComparator(e,n.operator,n.operand))return false}return true}function testComparator(e,t,n){const r=e.compareTo(n);switch(t){case"<":return r<0;case"<=":return r<=0;case">":return r>0;case">=":return r>=0;case"=":return r===0;default:return S.assertNever(t)}}function formatDisjunction(e){return map(e,formatAlternative).join(" || ")||"*"}function formatAlternative(e){return map(e,formatComparator).join(" ")}function formatComparator(e){return`${e.operator}${e.operand}`}function tryGetPerformance(){if(isNodeLikeSystem()){try{const{performance:e}=n(74);if(e){return{shouldWriteNativeEvents:false,performance:e}}}catch{}}if(typeof performance==="object"){return{shouldWriteNativeEvents:true,performance:performance}}return void 0}function tryGetPerformanceHooks(){const e=tryGetPerformance();if(!e)return void 0;const{shouldWriteNativeEvents:t,performance:n}=e;const r={shouldWriteNativeEvents:t,performance:void 0,performanceTime:void 0};if(typeof n.timeOrigin==="number"&&typeof n.now==="function"){r.performanceTime=n}if(r.performanceTime&&typeof n.mark==="function"&&typeof n.measure==="function"&&typeof n.clearMarks==="function"&&typeof n.clearMeasures==="function"){r.performance=n}return r}var L=tryGetPerformanceHooks();var M=L==null?void 0:L.performanceTime;function tryGetNativePerformanceHooks(){return L}var R=M?()=>M.now():Date.now;var B={};__export(B,{clearMarks:()=>clearMarks,clearMeasures:()=>clearMeasures,createTimer:()=>createTimer,createTimerIf:()=>createTimerIf,disable:()=>disable,enable:()=>enable,forEachMark:()=>forEachMark,forEachMeasure:()=>forEachMeasure,getCount:()=>getCount,getDuration:()=>getDuration,isEnabled:()=>isEnabled,mark:()=>mark,measure:()=>measure,nullTimer:()=>W});var j;var J;function createTimerIf(e,t,n,r){return e?createTimer(t,n,r):W}function createTimer(e,t,n){let r=0;return{enter:enter,exit:exit};function enter(){if(++r===1){mark(t)}}function exit(){if(--r===0){mark(n);measure(e,t,n)}else if(r<0){S.fail("enter/exit count does not match.")}}}var W={enter:noop,exit:noop};var U=false;var z=R();var V=new Map;var q=new Map;var H=new Map;function mark(e){if(U){const t=q.get(e)??0;q.set(e,t+1);V.set(e,R());J==null?void 0:J.mark(e);if(typeof onProfilerEvent==="function"){onProfilerEvent(e)}}}function measure(e,t,n){if(U){const r=(n!==void 0?V.get(n):void 0)??R();const i=(t!==void 0?V.get(t):void 0)??z;const o=H.get(e)||0;H.set(e,o+(r-i));J==null?void 0:J.measure(e,t,n)}}function getCount(e){return q.get(e)||0}function getDuration(e){return H.get(e)||0}function forEachMeasure(e){H.forEach(((t,n)=>e(n,t)))}function forEachMark(e){V.forEach(((t,n)=>e(n)))}function clearMeasures(e){if(e!==void 0)H.delete(e);else H.clear();J==null?void 0:J.clearMeasures(e)}function clearMarks(e){if(e!==void 0){q.delete(e);V.delete(e)}else{q.clear();V.clear()}J==null?void 0:J.clearMarks(e)}function isEnabled(){return U}function enable(e=Ft){var t;if(!U){U=true;j||(j=tryGetNativePerformanceHooks());if(j==null?void 0:j.performance){z=j.performance.timeOrigin;if(j.shouldWriteNativeEvents||((t=e==null?void 0:e.cpuProfilingEnabled)==null?void 0:t.call(e))||(e==null?void 0:e.debugMode)){J=j.performance}}}return true}function disable(){if(U){V.clear();q.clear();H.clear();J=void 0;U=false}}var G;var K;(e=>{let t;let r=0;let i=0;let o;const a=[];let s;const c=[];function startTracing2(l,d,p){S.assert(!G,"Tracing already started");if(t===void 0){try{t=n(147)}catch(e){throw new Error(`tracing requires having fs\n(original error: ${e.message||e})`)}}o=l;a.length=0;if(s===void 0){s=combinePaths(d,"legend.json")}if(!t.existsSync(d)){t.mkdirSync(d,{recursive:true})}const u=o==="build"?`.${process.pid}-${++r}`:o==="server"?`.${process.pid}`:``;const f=combinePaths(d,`trace${u}.json`);const m=combinePaths(d,`types${u}.json`);c.push({configFilePath:p,tracePath:f,typesPath:m});i=t.openSync(f,"w");G=e;const _={cat:"__metadata",ph:"M",ts:1e3*R(),pid:1,tid:1};t.writeSync(i,"[\n"+[{name:"process_name",args:{name:"tsc"},..._},{name:"thread_name",args:{name:"Main"},..._},{name:"TracingStartedInBrowser",..._,cat:"disabled-by-default-devtools.timeline"}].map((e=>JSON.stringify(e))).join(",\n"))}e.startTracing=startTracing2;function stopTracing(){S.assert(G,"Tracing is not in progress");S.assert(!!a.length===(o!=="server"));t.writeSync(i,`\n]\n`);t.closeSync(i);G=void 0;if(a.length){dumpTypes(a)}else{c[c.length-1].typesPath=void 0}}e.stopTracing=stopTracing;function recordType(e){if(o!=="server"){a.push(e)}}e.recordType=recordType;let l;(e=>{e["Parse"]="parse";e["Program"]="program";e["Bind"]="bind";e["Check"]="check";e["CheckTypes"]="checkTypes";e["Emit"]="emit";e["Session"]="session"})(l=e.Phase||(e.Phase={}));function instant(e,t,n){writeEvent("I",e,t,n,`"s":"g"`)}e.instant=instant;const d=[];function push(e,t,n,r=false){if(r){writeEvent("B",e,t,n)}d.push({phase:e,name:t,args:n,time:1e3*R(),separateBeginAndEnd:r})}e.push=push;function pop(e){S.assert(d.length>0);writeStackEvent(d.length-1,1e3*R(),e);d.length--}e.pop=pop;function popAll(){const e=1e3*R();for(let t=d.length-1;t>=0;t--){writeStackEvent(t,e)}d.length=0}e.popAll=popAll;const p=1e3*10;function writeStackEvent(e,t,n){const{phase:r,name:i,args:o,time:a,separateBeginAndEnd:s}=d[e];if(s){S.assert(!n,"`results` are not supported for events with `separateBeginAndEnd`");writeEvent("E",r,i,o,void 0,t)}else if(p-a%p<=t-a){writeEvent("X",r,i,{...o,results:n},`"dur":${t-a}`,a)}}function writeEvent(e,n,r,a,s,c=1e3*R()){if(o==="server"&&n==="checkTypes")return;mark("beginTracing");t.writeSync(i,`,\n{"pid":1,"tid":1,"ph":"${e}","cat":"${n}","ts":${c},"name":"${r}"`);if(s)t.writeSync(i,`,${s}`);if(a)t.writeSync(i,`,"args":${JSON.stringify(a)}`);t.writeSync(i,`}`);mark("endTracing");measure("Tracing","beginTracing","endTracing")}function getLocation(e){const t=getSourceFileOfNode(e);return!t?void 0:{path:t.path,start:indexFromOne(getLineAndCharacterOfPosition(t,e.pos)),end:indexFromOne(getLineAndCharacterOfPosition(t,e.end))};function indexFromOne(e){return{line:e.line+1,character:e.character+1}}}function dumpTypes(e){var n,r,i,o,a,s,l,d,p,u,f,m,_,g,y,h,T,v,x;mark("beginDumpTypes");const b=c[c.length-1].typesPath;const C=t.openSync(b,"w");const E=new Map;t.writeSync(C,"[");const N=e.length;for(let c=0;ce.id)),referenceLocation:getLocation(e.node)}}let A={};if(b.flags&16777216){const e=b;A={conditionalCheckType:(s=e.checkType)==null?void 0:s.id,conditionalExtendsType:(l=e.extendsType)==null?void 0:l.id,conditionalTrueType:((d=e.resolvedTrueType)==null?void 0:d.id)??-1,conditionalFalseType:((p=e.resolvedFalseType)==null?void 0:p.id)??-1}}let O={};if(b.flags&33554432){const e=b;O={substitutionBaseType:(u=e.baseType)==null?void 0:u.id,constraintType:(f=e.constraint)==null?void 0:f.id}}let w={};if(k&1024){const e=b;w={reverseMappedSourceType:(m=e.source)==null?void 0:m.id,reverseMappedMappedType:(_=e.mappedType)==null?void 0:_.id,reverseMappedConstraintType:(g=e.constraintType)==null?void 0:g.id}}let L={};if(k&256){const e=b;L={evolvingArrayElementType:e.elementType.id,evolvingArrayFinalType:(y=e.finalArrayType)==null?void 0:y.id}}let M;const R=b.checker.getRecursionIdentity(b);if(R){M=E.get(R);if(!M){M=E.size;E.set(R,M)}}const B={id:b.id,intrinsicName:b.intrinsicName,symbolName:(F==null?void 0:F.escapedName)&&unescapeLeadingUnderscores(F.escapedName),recursionId:M,isTuple:k&8?true:void 0,unionTypes:b.flags&1048576?(h=b.types)==null?void 0:h.map((e=>e.id)):void 0,intersectionTypes:b.flags&2097152?b.types.map((e=>e.id)):void 0,aliasTypeArguments:(T=b.aliasTypeArguments)==null?void 0:T.map((e=>e.id)),keyofType:b.flags&4194304?(v=b.type)==null?void 0:v.id:void 0,...D,...I,...A,...O,...w,...L,destructuringPattern:getLocation(b.pattern),firstDeclaration:getLocation((x=F==null?void 0:F.declarations)==null?void 0:x[0]),flags:S.formatTypeFlags(b.flags).split("|"),display:P};t.writeSync(C,JSON.stringify(B));if(c{e[e["Unknown"]=0]="Unknown";e[e["EndOfFileToken"]=1]="EndOfFileToken";e[e["SingleLineCommentTrivia"]=2]="SingleLineCommentTrivia";e[e["MultiLineCommentTrivia"]=3]="MultiLineCommentTrivia";e[e["NewLineTrivia"]=4]="NewLineTrivia";e[e["WhitespaceTrivia"]=5]="WhitespaceTrivia";e[e["ShebangTrivia"]=6]="ShebangTrivia";e[e["ConflictMarkerTrivia"]=7]="ConflictMarkerTrivia";e[e["NonTextFileMarkerTrivia"]=8]="NonTextFileMarkerTrivia";e[e["NumericLiteral"]=9]="NumericLiteral";e[e["BigIntLiteral"]=10]="BigIntLiteral";e[e["StringLiteral"]=11]="StringLiteral";e[e["JsxText"]=12]="JsxText";e[e["JsxTextAllWhiteSpaces"]=13]="JsxTextAllWhiteSpaces";e[e["RegularExpressionLiteral"]=14]="RegularExpressionLiteral";e[e["NoSubstitutionTemplateLiteral"]=15]="NoSubstitutionTemplateLiteral";e[e["TemplateHead"]=16]="TemplateHead";e[e["TemplateMiddle"]=17]="TemplateMiddle";e[e["TemplateTail"]=18]="TemplateTail";e[e["OpenBraceToken"]=19]="OpenBraceToken";e[e["CloseBraceToken"]=20]="CloseBraceToken";e[e["OpenParenToken"]=21]="OpenParenToken";e[e["CloseParenToken"]=22]="CloseParenToken";e[e["OpenBracketToken"]=23]="OpenBracketToken";e[e["CloseBracketToken"]=24]="CloseBracketToken";e[e["DotToken"]=25]="DotToken";e[e["DotDotDotToken"]=26]="DotDotDotToken";e[e["SemicolonToken"]=27]="SemicolonToken";e[e["CommaToken"]=28]="CommaToken";e[e["QuestionDotToken"]=29]="QuestionDotToken";e[e["LessThanToken"]=30]="LessThanToken";e[e["LessThanSlashToken"]=31]="LessThanSlashToken";e[e["GreaterThanToken"]=32]="GreaterThanToken";e[e["LessThanEqualsToken"]=33]="LessThanEqualsToken";e[e["GreaterThanEqualsToken"]=34]="GreaterThanEqualsToken";e[e["EqualsEqualsToken"]=35]="EqualsEqualsToken";e[e["ExclamationEqualsToken"]=36]="ExclamationEqualsToken";e[e["EqualsEqualsEqualsToken"]=37]="EqualsEqualsEqualsToken";e[e["ExclamationEqualsEqualsToken"]=38]="ExclamationEqualsEqualsToken";e[e["EqualsGreaterThanToken"]=39]="EqualsGreaterThanToken";e[e["PlusToken"]=40]="PlusToken";e[e["MinusToken"]=41]="MinusToken";e[e["AsteriskToken"]=42]="AsteriskToken";e[e["AsteriskAsteriskToken"]=43]="AsteriskAsteriskToken";e[e["SlashToken"]=44]="SlashToken";e[e["PercentToken"]=45]="PercentToken";e[e["PlusPlusToken"]=46]="PlusPlusToken";e[e["MinusMinusToken"]=47]="MinusMinusToken";e[e["LessThanLessThanToken"]=48]="LessThanLessThanToken";e[e["GreaterThanGreaterThanToken"]=49]="GreaterThanGreaterThanToken";e[e["GreaterThanGreaterThanGreaterThanToken"]=50]="GreaterThanGreaterThanGreaterThanToken";e[e["AmpersandToken"]=51]="AmpersandToken";e[e["BarToken"]=52]="BarToken";e[e["CaretToken"]=53]="CaretToken";e[e["ExclamationToken"]=54]="ExclamationToken";e[e["TildeToken"]=55]="TildeToken";e[e["AmpersandAmpersandToken"]=56]="AmpersandAmpersandToken";e[e["BarBarToken"]=57]="BarBarToken";e[e["QuestionToken"]=58]="QuestionToken";e[e["ColonToken"]=59]="ColonToken";e[e["AtToken"]=60]="AtToken";e[e["QuestionQuestionToken"]=61]="QuestionQuestionToken";e[e["BacktickToken"]=62]="BacktickToken";e[e["HashToken"]=63]="HashToken";e[e["EqualsToken"]=64]="EqualsToken";e[e["PlusEqualsToken"]=65]="PlusEqualsToken";e[e["MinusEqualsToken"]=66]="MinusEqualsToken";e[e["AsteriskEqualsToken"]=67]="AsteriskEqualsToken";e[e["AsteriskAsteriskEqualsToken"]=68]="AsteriskAsteriskEqualsToken";e[e["SlashEqualsToken"]=69]="SlashEqualsToken";e[e["PercentEqualsToken"]=70]="PercentEqualsToken";e[e["LessThanLessThanEqualsToken"]=71]="LessThanLessThanEqualsToken";e[e["GreaterThanGreaterThanEqualsToken"]=72]="GreaterThanGreaterThanEqualsToken";e[e["GreaterThanGreaterThanGreaterThanEqualsToken"]=73]="GreaterThanGreaterThanGreaterThanEqualsToken";e[e["AmpersandEqualsToken"]=74]="AmpersandEqualsToken";e[e["BarEqualsToken"]=75]="BarEqualsToken";e[e["BarBarEqualsToken"]=76]="BarBarEqualsToken";e[e["AmpersandAmpersandEqualsToken"]=77]="AmpersandAmpersandEqualsToken";e[e["QuestionQuestionEqualsToken"]=78]="QuestionQuestionEqualsToken";e[e["CaretEqualsToken"]=79]="CaretEqualsToken";e[e["Identifier"]=80]="Identifier";e[e["PrivateIdentifier"]=81]="PrivateIdentifier";e[e["JSDocCommentTextToken"]=82]="JSDocCommentTextToken";e[e["BreakKeyword"]=83]="BreakKeyword";e[e["CaseKeyword"]=84]="CaseKeyword";e[e["CatchKeyword"]=85]="CatchKeyword";e[e["ClassKeyword"]=86]="ClassKeyword";e[e["ConstKeyword"]=87]="ConstKeyword";e[e["ContinueKeyword"]=88]="ContinueKeyword";e[e["DebuggerKeyword"]=89]="DebuggerKeyword";e[e["DefaultKeyword"]=90]="DefaultKeyword";e[e["DeleteKeyword"]=91]="DeleteKeyword";e[e["DoKeyword"]=92]="DoKeyword";e[e["ElseKeyword"]=93]="ElseKeyword";e[e["EnumKeyword"]=94]="EnumKeyword";e[e["ExportKeyword"]=95]="ExportKeyword";e[e["ExtendsKeyword"]=96]="ExtendsKeyword";e[e["FalseKeyword"]=97]="FalseKeyword";e[e["FinallyKeyword"]=98]="FinallyKeyword";e[e["ForKeyword"]=99]="ForKeyword";e[e["FunctionKeyword"]=100]="FunctionKeyword";e[e["IfKeyword"]=101]="IfKeyword";e[e["ImportKeyword"]=102]="ImportKeyword";e[e["InKeyword"]=103]="InKeyword";e[e["InstanceOfKeyword"]=104]="InstanceOfKeyword";e[e["NewKeyword"]=105]="NewKeyword";e[e["NullKeyword"]=106]="NullKeyword";e[e["ReturnKeyword"]=107]="ReturnKeyword";e[e["SuperKeyword"]=108]="SuperKeyword";e[e["SwitchKeyword"]=109]="SwitchKeyword";e[e["ThisKeyword"]=110]="ThisKeyword";e[e["ThrowKeyword"]=111]="ThrowKeyword";e[e["TrueKeyword"]=112]="TrueKeyword";e[e["TryKeyword"]=113]="TryKeyword";e[e["TypeOfKeyword"]=114]="TypeOfKeyword";e[e["VarKeyword"]=115]="VarKeyword";e[e["VoidKeyword"]=116]="VoidKeyword";e[e["WhileKeyword"]=117]="WhileKeyword";e[e["WithKeyword"]=118]="WithKeyword";e[e["ImplementsKeyword"]=119]="ImplementsKeyword";e[e["InterfaceKeyword"]=120]="InterfaceKeyword";e[e["LetKeyword"]=121]="LetKeyword";e[e["PackageKeyword"]=122]="PackageKeyword";e[e["PrivateKeyword"]=123]="PrivateKeyword";e[e["ProtectedKeyword"]=124]="ProtectedKeyword";e[e["PublicKeyword"]=125]="PublicKeyword";e[e["StaticKeyword"]=126]="StaticKeyword";e[e["YieldKeyword"]=127]="YieldKeyword";e[e["AbstractKeyword"]=128]="AbstractKeyword";e[e["AccessorKeyword"]=129]="AccessorKeyword";e[e["AsKeyword"]=130]="AsKeyword";e[e["AssertsKeyword"]=131]="AssertsKeyword";e[e["AssertKeyword"]=132]="AssertKeyword";e[e["AnyKeyword"]=133]="AnyKeyword";e[e["AsyncKeyword"]=134]="AsyncKeyword";e[e["AwaitKeyword"]=135]="AwaitKeyword";e[e["BooleanKeyword"]=136]="BooleanKeyword";e[e["ConstructorKeyword"]=137]="ConstructorKeyword";e[e["DeclareKeyword"]=138]="DeclareKeyword";e[e["GetKeyword"]=139]="GetKeyword";e[e["InferKeyword"]=140]="InferKeyword";e[e["IntrinsicKeyword"]=141]="IntrinsicKeyword";e[e["IsKeyword"]=142]="IsKeyword";e[e["KeyOfKeyword"]=143]="KeyOfKeyword";e[e["ModuleKeyword"]=144]="ModuleKeyword";e[e["NamespaceKeyword"]=145]="NamespaceKeyword";e[e["NeverKeyword"]=146]="NeverKeyword";e[e["OutKeyword"]=147]="OutKeyword";e[e["ReadonlyKeyword"]=148]="ReadonlyKeyword";e[e["RequireKeyword"]=149]="RequireKeyword";e[e["NumberKeyword"]=150]="NumberKeyword";e[e["ObjectKeyword"]=151]="ObjectKeyword";e[e["SatisfiesKeyword"]=152]="SatisfiesKeyword";e[e["SetKeyword"]=153]="SetKeyword";e[e["StringKeyword"]=154]="StringKeyword";e[e["SymbolKeyword"]=155]="SymbolKeyword";e[e["TypeKeyword"]=156]="TypeKeyword";e[e["UndefinedKeyword"]=157]="UndefinedKeyword";e[e["UniqueKeyword"]=158]="UniqueKeyword";e[e["UnknownKeyword"]=159]="UnknownKeyword";e[e["UsingKeyword"]=160]="UsingKeyword";e[e["FromKeyword"]=161]="FromKeyword";e[e["GlobalKeyword"]=162]="GlobalKeyword";e[e["BigIntKeyword"]=163]="BigIntKeyword";e[e["OverrideKeyword"]=164]="OverrideKeyword";e[e["OfKeyword"]=165]="OfKeyword";e[e["QualifiedName"]=166]="QualifiedName";e[e["ComputedPropertyName"]=167]="ComputedPropertyName";e[e["TypeParameter"]=168]="TypeParameter";e[e["Parameter"]=169]="Parameter";e[e["Decorator"]=170]="Decorator";e[e["PropertySignature"]=171]="PropertySignature";e[e["PropertyDeclaration"]=172]="PropertyDeclaration";e[e["MethodSignature"]=173]="MethodSignature";e[e["MethodDeclaration"]=174]="MethodDeclaration";e[e["ClassStaticBlockDeclaration"]=175]="ClassStaticBlockDeclaration";e[e["Constructor"]=176]="Constructor";e[e["GetAccessor"]=177]="GetAccessor";e[e["SetAccessor"]=178]="SetAccessor";e[e["CallSignature"]=179]="CallSignature";e[e["ConstructSignature"]=180]="ConstructSignature";e[e["IndexSignature"]=181]="IndexSignature";e[e["TypePredicate"]=182]="TypePredicate";e[e["TypeReference"]=183]="TypeReference";e[e["FunctionType"]=184]="FunctionType";e[e["ConstructorType"]=185]="ConstructorType";e[e["TypeQuery"]=186]="TypeQuery";e[e["TypeLiteral"]=187]="TypeLiteral";e[e["ArrayType"]=188]="ArrayType";e[e["TupleType"]=189]="TupleType";e[e["OptionalType"]=190]="OptionalType";e[e["RestType"]=191]="RestType";e[e["UnionType"]=192]="UnionType";e[e["IntersectionType"]=193]="IntersectionType";e[e["ConditionalType"]=194]="ConditionalType";e[e["InferType"]=195]="InferType";e[e["ParenthesizedType"]=196]="ParenthesizedType";e[e["ThisType"]=197]="ThisType";e[e["TypeOperator"]=198]="TypeOperator";e[e["IndexedAccessType"]=199]="IndexedAccessType";e[e["MappedType"]=200]="MappedType";e[e["LiteralType"]=201]="LiteralType";e[e["NamedTupleMember"]=202]="NamedTupleMember";e[e["TemplateLiteralType"]=203]="TemplateLiteralType";e[e["TemplateLiteralTypeSpan"]=204]="TemplateLiteralTypeSpan";e[e["ImportType"]=205]="ImportType";e[e["ObjectBindingPattern"]=206]="ObjectBindingPattern";e[e["ArrayBindingPattern"]=207]="ArrayBindingPattern";e[e["BindingElement"]=208]="BindingElement";e[e["ArrayLiteralExpression"]=209]="ArrayLiteralExpression";e[e["ObjectLiteralExpression"]=210]="ObjectLiteralExpression";e[e["PropertyAccessExpression"]=211]="PropertyAccessExpression";e[e["ElementAccessExpression"]=212]="ElementAccessExpression";e[e["CallExpression"]=213]="CallExpression";e[e["NewExpression"]=214]="NewExpression";e[e["TaggedTemplateExpression"]=215]="TaggedTemplateExpression";e[e["TypeAssertionExpression"]=216]="TypeAssertionExpression";e[e["ParenthesizedExpression"]=217]="ParenthesizedExpression";e[e["FunctionExpression"]=218]="FunctionExpression";e[e["ArrowFunction"]=219]="ArrowFunction";e[e["DeleteExpression"]=220]="DeleteExpression";e[e["TypeOfExpression"]=221]="TypeOfExpression";e[e["VoidExpression"]=222]="VoidExpression";e[e["AwaitExpression"]=223]="AwaitExpression";e[e["PrefixUnaryExpression"]=224]="PrefixUnaryExpression";e[e["PostfixUnaryExpression"]=225]="PostfixUnaryExpression";e[e["BinaryExpression"]=226]="BinaryExpression";e[e["ConditionalExpression"]=227]="ConditionalExpression";e[e["TemplateExpression"]=228]="TemplateExpression";e[e["YieldExpression"]=229]="YieldExpression";e[e["SpreadElement"]=230]="SpreadElement";e[e["ClassExpression"]=231]="ClassExpression";e[e["OmittedExpression"]=232]="OmittedExpression";e[e["ExpressionWithTypeArguments"]=233]="ExpressionWithTypeArguments";e[e["AsExpression"]=234]="AsExpression";e[e["NonNullExpression"]=235]="NonNullExpression";e[e["MetaProperty"]=236]="MetaProperty";e[e["SyntheticExpression"]=237]="SyntheticExpression";e[e["SatisfiesExpression"]=238]="SatisfiesExpression";e[e["TemplateSpan"]=239]="TemplateSpan";e[e["SemicolonClassElement"]=240]="SemicolonClassElement";e[e["Block"]=241]="Block";e[e["EmptyStatement"]=242]="EmptyStatement";e[e["VariableStatement"]=243]="VariableStatement";e[e["ExpressionStatement"]=244]="ExpressionStatement";e[e["IfStatement"]=245]="IfStatement";e[e["DoStatement"]=246]="DoStatement";e[e["WhileStatement"]=247]="WhileStatement";e[e["ForStatement"]=248]="ForStatement";e[e["ForInStatement"]=249]="ForInStatement";e[e["ForOfStatement"]=250]="ForOfStatement";e[e["ContinueStatement"]=251]="ContinueStatement";e[e["BreakStatement"]=252]="BreakStatement";e[e["ReturnStatement"]=253]="ReturnStatement";e[e["WithStatement"]=254]="WithStatement";e[e["SwitchStatement"]=255]="SwitchStatement";e[e["LabeledStatement"]=256]="LabeledStatement";e[e["ThrowStatement"]=257]="ThrowStatement";e[e["TryStatement"]=258]="TryStatement";e[e["DebuggerStatement"]=259]="DebuggerStatement";e[e["VariableDeclaration"]=260]="VariableDeclaration";e[e["VariableDeclarationList"]=261]="VariableDeclarationList";e[e["FunctionDeclaration"]=262]="FunctionDeclaration";e[e["ClassDeclaration"]=263]="ClassDeclaration";e[e["InterfaceDeclaration"]=264]="InterfaceDeclaration";e[e["TypeAliasDeclaration"]=265]="TypeAliasDeclaration";e[e["EnumDeclaration"]=266]="EnumDeclaration";e[e["ModuleDeclaration"]=267]="ModuleDeclaration";e[e["ModuleBlock"]=268]="ModuleBlock";e[e["CaseBlock"]=269]="CaseBlock";e[e["NamespaceExportDeclaration"]=270]="NamespaceExportDeclaration";e[e["ImportEqualsDeclaration"]=271]="ImportEqualsDeclaration";e[e["ImportDeclaration"]=272]="ImportDeclaration";e[e["ImportClause"]=273]="ImportClause";e[e["NamespaceImport"]=274]="NamespaceImport";e[e["NamedImports"]=275]="NamedImports";e[e["ImportSpecifier"]=276]="ImportSpecifier";e[e["ExportAssignment"]=277]="ExportAssignment";e[e["ExportDeclaration"]=278]="ExportDeclaration";e[e["NamedExports"]=279]="NamedExports";e[e["NamespaceExport"]=280]="NamespaceExport";e[e["ExportSpecifier"]=281]="ExportSpecifier";e[e["MissingDeclaration"]=282]="MissingDeclaration";e[e["ExternalModuleReference"]=283]="ExternalModuleReference";e[e["JsxElement"]=284]="JsxElement";e[e["JsxSelfClosingElement"]=285]="JsxSelfClosingElement";e[e["JsxOpeningElement"]=286]="JsxOpeningElement";e[e["JsxClosingElement"]=287]="JsxClosingElement";e[e["JsxFragment"]=288]="JsxFragment";e[e["JsxOpeningFragment"]=289]="JsxOpeningFragment";e[e["JsxClosingFragment"]=290]="JsxClosingFragment";e[e["JsxAttribute"]=291]="JsxAttribute";e[e["JsxAttributes"]=292]="JsxAttributes";e[e["JsxSpreadAttribute"]=293]="JsxSpreadAttribute";e[e["JsxExpression"]=294]="JsxExpression";e[e["JsxNamespacedName"]=295]="JsxNamespacedName";e[e["CaseClause"]=296]="CaseClause";e[e["DefaultClause"]=297]="DefaultClause";e[e["HeritageClause"]=298]="HeritageClause";e[e["CatchClause"]=299]="CatchClause";e[e["ImportAttributes"]=300]="ImportAttributes";e[e["ImportAttribute"]=301]="ImportAttribute";e[e["AssertClause"]=300]="AssertClause";e[e["AssertEntry"]=301]="AssertEntry";e[e["ImportTypeAssertionContainer"]=302]="ImportTypeAssertionContainer";e[e["PropertyAssignment"]=303]="PropertyAssignment";e[e["ShorthandPropertyAssignment"]=304]="ShorthandPropertyAssignment";e[e["SpreadAssignment"]=305]="SpreadAssignment";e[e["EnumMember"]=306]="EnumMember";e[e["SourceFile"]=307]="SourceFile";e[e["Bundle"]=308]="Bundle";e[e["JSDocTypeExpression"]=309]="JSDocTypeExpression";e[e["JSDocNameReference"]=310]="JSDocNameReference";e[e["JSDocMemberName"]=311]="JSDocMemberName";e[e["JSDocAllType"]=312]="JSDocAllType";e[e["JSDocUnknownType"]=313]="JSDocUnknownType";e[e["JSDocNullableType"]=314]="JSDocNullableType";e[e["JSDocNonNullableType"]=315]="JSDocNonNullableType";e[e["JSDocOptionalType"]=316]="JSDocOptionalType";e[e["JSDocFunctionType"]=317]="JSDocFunctionType";e[e["JSDocVariadicType"]=318]="JSDocVariadicType";e[e["JSDocNamepathType"]=319]="JSDocNamepathType";e[e["JSDoc"]=320]="JSDoc";e[e["JSDocComment"]=320]="JSDocComment";e[e["JSDocText"]=321]="JSDocText";e[e["JSDocTypeLiteral"]=322]="JSDocTypeLiteral";e[e["JSDocSignature"]=323]="JSDocSignature";e[e["JSDocLink"]=324]="JSDocLink";e[e["JSDocLinkCode"]=325]="JSDocLinkCode";e[e["JSDocLinkPlain"]=326]="JSDocLinkPlain";e[e["JSDocTag"]=327]="JSDocTag";e[e["JSDocAugmentsTag"]=328]="JSDocAugmentsTag";e[e["JSDocImplementsTag"]=329]="JSDocImplementsTag";e[e["JSDocAuthorTag"]=330]="JSDocAuthorTag";e[e["JSDocDeprecatedTag"]=331]="JSDocDeprecatedTag";e[e["JSDocClassTag"]=332]="JSDocClassTag";e[e["JSDocPublicTag"]=333]="JSDocPublicTag";e[e["JSDocPrivateTag"]=334]="JSDocPrivateTag";e[e["JSDocProtectedTag"]=335]="JSDocProtectedTag";e[e["JSDocReadonlyTag"]=336]="JSDocReadonlyTag";e[e["JSDocOverrideTag"]=337]="JSDocOverrideTag";e[e["JSDocCallbackTag"]=338]="JSDocCallbackTag";e[e["JSDocOverloadTag"]=339]="JSDocOverloadTag";e[e["JSDocEnumTag"]=340]="JSDocEnumTag";e[e["JSDocParameterTag"]=341]="JSDocParameterTag";e[e["JSDocReturnTag"]=342]="JSDocReturnTag";e[e["JSDocThisTag"]=343]="JSDocThisTag";e[e["JSDocTypeTag"]=344]="JSDocTypeTag";e[e["JSDocTemplateTag"]=345]="JSDocTemplateTag";e[e["JSDocTypedefTag"]=346]="JSDocTypedefTag";e[e["JSDocSeeTag"]=347]="JSDocSeeTag";e[e["JSDocPropertyTag"]=348]="JSDocPropertyTag";e[e["JSDocThrowsTag"]=349]="JSDocThrowsTag";e[e["JSDocSatisfiesTag"]=350]="JSDocSatisfiesTag";e[e["JSDocImportTag"]=351]="JSDocImportTag";e[e["SyntaxList"]=352]="SyntaxList";e[e["NotEmittedStatement"]=353]="NotEmittedStatement";e[e["NotEmittedTypeElement"]=354]="NotEmittedTypeElement";e[e["PartiallyEmittedExpression"]=355]="PartiallyEmittedExpression";e[e["CommaListExpression"]=356]="CommaListExpression";e[e["SyntheticReferenceExpression"]=357]="SyntheticReferenceExpression";e[e["Count"]=358]="Count";e[e["FirstAssignment"]=64]="FirstAssignment";e[e["LastAssignment"]=79]="LastAssignment";e[e["FirstCompoundAssignment"]=65]="FirstCompoundAssignment";e[e["LastCompoundAssignment"]=79]="LastCompoundAssignment";e[e["FirstReservedWord"]=83]="FirstReservedWord";e[e["LastReservedWord"]=118]="LastReservedWord";e[e["FirstKeyword"]=83]="FirstKeyword";e[e["LastKeyword"]=165]="LastKeyword";e[e["FirstFutureReservedWord"]=119]="FirstFutureReservedWord";e[e["LastFutureReservedWord"]=127]="LastFutureReservedWord";e[e["FirstTypeNode"]=182]="FirstTypeNode";e[e["LastTypeNode"]=205]="LastTypeNode";e[e["FirstPunctuation"]=19]="FirstPunctuation";e[e["LastPunctuation"]=79]="LastPunctuation";e[e["FirstToken"]=0]="FirstToken";e[e["LastToken"]=165]="LastToken";e[e["FirstTriviaToken"]=2]="FirstTriviaToken";e[e["LastTriviaToken"]=7]="LastTriviaToken";e[e["FirstLiteralToken"]=9]="FirstLiteralToken";e[e["LastLiteralToken"]=15]="LastLiteralToken";e[e["FirstTemplateToken"]=15]="FirstTemplateToken";e[e["LastTemplateToken"]=18]="LastTemplateToken";e[e["FirstBinaryOperator"]=30]="FirstBinaryOperator";e[e["LastBinaryOperator"]=79]="LastBinaryOperator";e[e["FirstStatement"]=243]="FirstStatement";e[e["LastStatement"]=259]="LastStatement";e[e["FirstNode"]=166]="FirstNode";e[e["FirstJSDocNode"]=309]="FirstJSDocNode";e[e["LastJSDocNode"]=351]="LastJSDocNode";e[e["FirstJSDocTagNode"]=327]="FirstJSDocTagNode";e[e["LastJSDocTagNode"]=351]="LastJSDocTagNode";e[e["FirstContextualKeyword"]=128]="FirstContextualKeyword";e[e["LastContextualKeyword"]=165]="LastContextualKeyword";return e})(X||{});var Y=(e=>{e[e["None"]=0]="None";e[e["Let"]=1]="Let";e[e["Const"]=2]="Const";e[e["Using"]=4]="Using";e[e["AwaitUsing"]=6]="AwaitUsing";e[e["NestedNamespace"]=8]="NestedNamespace";e[e["Synthesized"]=16]="Synthesized";e[e["Namespace"]=32]="Namespace";e[e["OptionalChain"]=64]="OptionalChain";e[e["ExportContext"]=128]="ExportContext";e[e["ContainsThis"]=256]="ContainsThis";e[e["HasImplicitReturn"]=512]="HasImplicitReturn";e[e["HasExplicitReturn"]=1024]="HasExplicitReturn";e[e["GlobalAugmentation"]=2048]="GlobalAugmentation";e[e["HasAsyncFunctions"]=4096]="HasAsyncFunctions";e[e["DisallowInContext"]=8192]="DisallowInContext";e[e["YieldContext"]=16384]="YieldContext";e[e["DecoratorContext"]=32768]="DecoratorContext";e[e["AwaitContext"]=65536]="AwaitContext";e[e["DisallowConditionalTypesContext"]=131072]="DisallowConditionalTypesContext";e[e["ThisNodeHasError"]=262144]="ThisNodeHasError";e[e["JavaScriptFile"]=524288]="JavaScriptFile";e[e["ThisNodeOrAnySubNodesHasError"]=1048576]="ThisNodeOrAnySubNodesHasError";e[e["HasAggregatedChildData"]=2097152]="HasAggregatedChildData";e[e["PossiblyContainsDynamicImport"]=4194304]="PossiblyContainsDynamicImport";e[e["PossiblyContainsImportMeta"]=8388608]="PossiblyContainsImportMeta";e[e["JSDoc"]=16777216]="JSDoc";e[e["Ambient"]=33554432]="Ambient";e[e["InWithStatement"]=67108864]="InWithStatement";e[e["JsonFile"]=134217728]="JsonFile";e[e["TypeCached"]=268435456]="TypeCached";e[e["Deprecated"]=536870912]="Deprecated";e[e["BlockScoped"]=7]="BlockScoped";e[e["Constant"]=6]="Constant";e[e["ReachabilityCheckFlags"]=1536]="ReachabilityCheckFlags";e[e["ReachabilityAndEmitFlags"]=5632]="ReachabilityAndEmitFlags";e[e["ContextFlags"]=101441536]="ContextFlags";e[e["TypeExcludesFlags"]=81920]="TypeExcludesFlags";e[e["PermanentlySetIncrementalFlags"]=12582912]="PermanentlySetIncrementalFlags";e[e["IdentifierHasExtendedUnicodeEscape"]=256]="IdentifierHasExtendedUnicodeEscape";e[e["IdentifierIsInJSDocNamespace"]=4096]="IdentifierIsInJSDocNamespace";return e})(Y||{});var Z=(e=>{e[e["None"]=0]="None";e[e["Public"]=1]="Public";e[e["Private"]=2]="Private";e[e["Protected"]=4]="Protected";e[e["Readonly"]=8]="Readonly";e[e["Override"]=16]="Override";e[e["Export"]=32]="Export";e[e["Abstract"]=64]="Abstract";e[e["Ambient"]=128]="Ambient";e[e["Static"]=256]="Static";e[e["Accessor"]=512]="Accessor";e[e["Async"]=1024]="Async";e[e["Default"]=2048]="Default";e[e["Const"]=4096]="Const";e[e["In"]=8192]="In";e[e["Out"]=16384]="Out";e[e["Decorator"]=32768]="Decorator";e[e["Deprecated"]=65536]="Deprecated";e[e["JSDocPublic"]=8388608]="JSDocPublic";e[e["JSDocPrivate"]=16777216]="JSDocPrivate";e[e["JSDocProtected"]=33554432]="JSDocProtected";e[e["JSDocReadonly"]=67108864]="JSDocReadonly";e[e["JSDocOverride"]=134217728]="JSDocOverride";e[e["SyntacticOrJSDocModifiers"]=31]="SyntacticOrJSDocModifiers";e[e["SyntacticOnlyModifiers"]=65504]="SyntacticOnlyModifiers";e[e["SyntacticModifiers"]=65535]="SyntacticModifiers";e[e["JSDocCacheOnlyModifiers"]=260046848]="JSDocCacheOnlyModifiers";e[e["JSDocOnlyModifiers"]=65536]="JSDocOnlyModifiers";e[e["NonCacheOnlyModifiers"]=131071]="NonCacheOnlyModifiers";e[e["HasComputedJSDocModifiers"]=268435456]="HasComputedJSDocModifiers";e[e["HasComputedFlags"]=536870912]="HasComputedFlags";e[e["AccessibilityModifier"]=7]="AccessibilityModifier";e[e["ParameterPropertyModifier"]=31]="ParameterPropertyModifier";e[e["NonPublicAccessibilityModifier"]=6]="NonPublicAccessibilityModifier";e[e["TypeScriptModifier"]=28895]="TypeScriptModifier";e[e["ExportDefault"]=2080]="ExportDefault";e[e["All"]=131071]="All";e[e["Modifier"]=98303]="Modifier";return e})(Z||{});var ee=(e=>{e[e["None"]=0]="None";e[e["IntrinsicNamedElement"]=1]="IntrinsicNamedElement";e[e["IntrinsicIndexedElement"]=2]="IntrinsicIndexedElement";e[e["IntrinsicElement"]=3]="IntrinsicElement";return e})(ee||{});var te=(e=>{e[e["None"]=0]="None";e[e["Succeeded"]=1]="Succeeded";e[e["Failed"]=2]="Failed";e[e["ReportsUnmeasurable"]=8]="ReportsUnmeasurable";e[e["ReportsUnreliable"]=16]="ReportsUnreliable";e[e["ReportsMask"]=24]="ReportsMask";e[e["ComplexityOverflow"]=32]="ComplexityOverflow";e[e["StackDepthOverflow"]=64]="StackDepthOverflow";e[e["Overflow"]=96]="Overflow";return e})(te||{});var ne=(e=>{e[e["None"]=0]="None";e[e["Always"]=1]="Always";e[e["Never"]=2]="Never";e[e["Sometimes"]=3]="Sometimes";return e})(ne||{});var re=(e=>{e[e["None"]=0]="None";e[e["Auto"]=1]="Auto";e[e["Loop"]=2]="Loop";e[e["Unique"]=3]="Unique";e[e["Node"]=4]="Node";e[e["KindMask"]=7]="KindMask";e[e["ReservedInNestedScopes"]=8]="ReservedInNestedScopes";e[e["Optimistic"]=16]="Optimistic";e[e["FileLevel"]=32]="FileLevel";e[e["AllowNameSubstitution"]=64]="AllowNameSubstitution";return e})(re||{});var ie=(e=>{e[e["None"]=0]="None";e[e["HasIndices"]=1]="HasIndices";e[e["Global"]=2]="Global";e[e["IgnoreCase"]=4]="IgnoreCase";e[e["Multiline"]=8]="Multiline";e[e["DotAll"]=16]="DotAll";e[e["Unicode"]=32]="Unicode";e[e["UnicodeSets"]=64]="UnicodeSets";e[e["Sticky"]=128]="Sticky";e[e["AnyUnicodeMode"]=96]="AnyUnicodeMode";e[e["Modifiers"]=28]="Modifiers";return e})(ie||{});var oe=(e=>{e[e["None"]=0]="None";e[e["PrecedingLineBreak"]=1]="PrecedingLineBreak";e[e["PrecedingJSDocComment"]=2]="PrecedingJSDocComment";e[e["Unterminated"]=4]="Unterminated";e[e["ExtendedUnicodeEscape"]=8]="ExtendedUnicodeEscape";e[e["Scientific"]=16]="Scientific";e[e["Octal"]=32]="Octal";e[e["HexSpecifier"]=64]="HexSpecifier";e[e["BinarySpecifier"]=128]="BinarySpecifier";e[e["OctalSpecifier"]=256]="OctalSpecifier";e[e["ContainsSeparator"]=512]="ContainsSeparator";e[e["UnicodeEscape"]=1024]="UnicodeEscape";e[e["ContainsInvalidEscape"]=2048]="ContainsInvalidEscape";e[e["HexEscape"]=4096]="HexEscape";e[e["ContainsLeadingZero"]=8192]="ContainsLeadingZero";e[e["ContainsInvalidSeparator"]=16384]="ContainsInvalidSeparator";e[e["PrecedingJSDocLeadingAsterisks"]=32768]="PrecedingJSDocLeadingAsterisks";e[e["BinaryOrOctalSpecifier"]=384]="BinaryOrOctalSpecifier";e[e["WithSpecifier"]=448]="WithSpecifier";e[e["StringLiteralFlags"]=7176]="StringLiteralFlags";e[e["NumericLiteralFlags"]=25584]="NumericLiteralFlags";e[e["TemplateLiteralLikeFlags"]=7176]="TemplateLiteralLikeFlags";e[e["IsInvalid"]=26656]="IsInvalid";return e})(oe||{});var ae=(e=>{e[e["Unreachable"]=1]="Unreachable";e[e["Start"]=2]="Start";e[e["BranchLabel"]=4]="BranchLabel";e[e["LoopLabel"]=8]="LoopLabel";e[e["Assignment"]=16]="Assignment";e[e["TrueCondition"]=32]="TrueCondition";e[e["FalseCondition"]=64]="FalseCondition";e[e["SwitchClause"]=128]="SwitchClause";e[e["ArrayMutation"]=256]="ArrayMutation";e[e["Call"]=512]="Call";e[e["ReduceLabel"]=1024]="ReduceLabel";e[e["Referenced"]=2048]="Referenced";e[e["Shared"]=4096]="Shared";e[e["Label"]=12]="Label";e[e["Condition"]=96]="Condition";return e})(ae||{});var se=(e=>{e[e["ExpectError"]=0]="ExpectError";e[e["Ignore"]=1]="Ignore";return e})(se||{});var ce=class{};var le=(e=>{e[e["RootFile"]=0]="RootFile";e[e["SourceFromProjectReference"]=1]="SourceFromProjectReference";e[e["OutputFromProjectReference"]=2]="OutputFromProjectReference";e[e["Import"]=3]="Import";e[e["ReferenceFile"]=4]="ReferenceFile";e[e["TypeReferenceDirective"]=5]="TypeReferenceDirective";e[e["LibFile"]=6]="LibFile";e[e["LibReferenceDirective"]=7]="LibReferenceDirective";e[e["AutomaticTypeDirectiveFile"]=8]="AutomaticTypeDirectiveFile";return e})(le||{});var de=(e=>{e[e["FilePreprocessingLibReferenceDiagnostic"]=0]="FilePreprocessingLibReferenceDiagnostic";e[e["FilePreprocessingFileExplainingDiagnostic"]=1]="FilePreprocessingFileExplainingDiagnostic";e[e["ResolutionDiagnostics"]=2]="ResolutionDiagnostics";return e})(de||{});var pe=(e=>{e[e["Js"]=0]="Js";e[e["Dts"]=1]="Dts";e[e["BuilderSignature"]=2]="BuilderSignature";return e})(pe||{});var ue=(e=>{e[e["Not"]=0]="Not";e[e["SafeModules"]=1]="SafeModules";e[e["Completely"]=2]="Completely";return e})(ue||{});var fe=(e=>{e[e["Success"]=0]="Success";e[e["DiagnosticsPresent_OutputsSkipped"]=1]="DiagnosticsPresent_OutputsSkipped";e[e["DiagnosticsPresent_OutputsGenerated"]=2]="DiagnosticsPresent_OutputsGenerated";e[e["InvalidProject_OutputsSkipped"]=3]="InvalidProject_OutputsSkipped";e[e["ProjectReferenceCycle_OutputsSkipped"]=4]="ProjectReferenceCycle_OutputsSkipped";return e})(fe||{});var me=(e=>{e[e["Ok"]=0]="Ok";e[e["NeedsOverride"]=1]="NeedsOverride";e[e["HasInvalidOverride"]=2]="HasInvalidOverride";return e})(me||{});var _e=(e=>{e[e["None"]=0]="None";e[e["Literal"]=1]="Literal";e[e["Subtype"]=2]="Subtype";return e})(_e||{});var ge=(e=>{e[e["None"]=0]="None";e[e["NoSupertypeReduction"]=1]="NoSupertypeReduction";e[e["NoConstraintReduction"]=2]="NoConstraintReduction";return e})(ge||{});var ye=(e=>{e[e["None"]=0]="None";e[e["Signature"]=1]="Signature";e[e["NoConstraints"]=2]="NoConstraints";e[e["Completions"]=4]="Completions";e[e["SkipBindingPatterns"]=8]="SkipBindingPatterns";return e})(ye||{});var he=(e=>{e[e["None"]=0]="None";e[e["NoTruncation"]=1]="NoTruncation";e[e["WriteArrayAsGenericType"]=2]="WriteArrayAsGenericType";e[e["GenerateNamesForShadowedTypeParams"]=4]="GenerateNamesForShadowedTypeParams";e[e["UseStructuralFallback"]=8]="UseStructuralFallback";e[e["ForbidIndexedAccessSymbolReferences"]=16]="ForbidIndexedAccessSymbolReferences";e[e["WriteTypeArgumentsOfSignature"]=32]="WriteTypeArgumentsOfSignature";e[e["UseFullyQualifiedType"]=64]="UseFullyQualifiedType";e[e["UseOnlyExternalAliasing"]=128]="UseOnlyExternalAliasing";e[e["SuppressAnyReturnType"]=256]="SuppressAnyReturnType";e[e["WriteTypeParametersInQualifiedName"]=512]="WriteTypeParametersInQualifiedName";e[e["MultilineObjectLiterals"]=1024]="MultilineObjectLiterals";e[e["WriteClassExpressionAsTypeLiteral"]=2048]="WriteClassExpressionAsTypeLiteral";e[e["UseTypeOfFunction"]=4096]="UseTypeOfFunction";e[e["OmitParameterModifiers"]=8192]="OmitParameterModifiers";e[e["UseAliasDefinedOutsideCurrentScope"]=16384]="UseAliasDefinedOutsideCurrentScope";e[e["UseSingleQuotesForStringLiteralType"]=268435456]="UseSingleQuotesForStringLiteralType";e[e["NoTypeReduction"]=536870912]="NoTypeReduction";e[e["OmitThisParameter"]=33554432]="OmitThisParameter";e[e["AllowThisInObjectLiteral"]=32768]="AllowThisInObjectLiteral";e[e["AllowQualifiedNameInPlaceOfIdentifier"]=65536]="AllowQualifiedNameInPlaceOfIdentifier";e[e["AllowAnonymousIdentifier"]=131072]="AllowAnonymousIdentifier";e[e["AllowEmptyUnionOrIntersection"]=262144]="AllowEmptyUnionOrIntersection";e[e["AllowEmptyTuple"]=524288]="AllowEmptyTuple";e[e["AllowUniqueESSymbolType"]=1048576]="AllowUniqueESSymbolType";e[e["AllowEmptyIndexInfoType"]=2097152]="AllowEmptyIndexInfoType";e[e["AllowNodeModulesRelativePaths"]=67108864]="AllowNodeModulesRelativePaths";e[e["IgnoreErrors"]=70221824]="IgnoreErrors";e[e["InObjectTypeLiteral"]=4194304]="InObjectTypeLiteral";e[e["InTypeAlias"]=8388608]="InTypeAlias";e[e["InInitialEntityName"]=16777216]="InInitialEntityName";return e})(he||{});var Te=(e=>{e[e["None"]=0]="None";e[e["WriteComputedProps"]=1]="WriteComputedProps";e[e["NoSyntacticPrinter"]=2]="NoSyntacticPrinter";e[e["DoNotIncludeSymbolChain"]=4]="DoNotIncludeSymbolChain";e[e["AllowUnresolvedNames"]=8]="AllowUnresolvedNames";return e})(Te||{});var Se=(e=>{e[e["None"]=0]="None";e[e["NoTruncation"]=1]="NoTruncation";e[e["WriteArrayAsGenericType"]=2]="WriteArrayAsGenericType";e[e["GenerateNamesForShadowedTypeParams"]=4]="GenerateNamesForShadowedTypeParams";e[e["UseStructuralFallback"]=8]="UseStructuralFallback";e[e["WriteTypeArgumentsOfSignature"]=32]="WriteTypeArgumentsOfSignature";e[e["UseFullyQualifiedType"]=64]="UseFullyQualifiedType";e[e["SuppressAnyReturnType"]=256]="SuppressAnyReturnType";e[e["MultilineObjectLiterals"]=1024]="MultilineObjectLiterals";e[e["WriteClassExpressionAsTypeLiteral"]=2048]="WriteClassExpressionAsTypeLiteral";e[e["UseTypeOfFunction"]=4096]="UseTypeOfFunction";e[e["OmitParameterModifiers"]=8192]="OmitParameterModifiers";e[e["UseAliasDefinedOutsideCurrentScope"]=16384]="UseAliasDefinedOutsideCurrentScope";e[e["UseSingleQuotesForStringLiteralType"]=268435456]="UseSingleQuotesForStringLiteralType";e[e["NoTypeReduction"]=536870912]="NoTypeReduction";e[e["OmitThisParameter"]=33554432]="OmitThisParameter";e[e["AllowUniqueESSymbolType"]=1048576]="AllowUniqueESSymbolType";e[e["AddUndefined"]=131072]="AddUndefined";e[e["WriteArrowStyleSignature"]=262144]="WriteArrowStyleSignature";e[e["InArrayType"]=524288]="InArrayType";e[e["InElementType"]=2097152]="InElementType";e[e["InFirstTypeArgument"]=4194304]="InFirstTypeArgument";e[e["InTypeAlias"]=8388608]="InTypeAlias";e[e["NodeBuilderFlagsMask"]=848330095]="NodeBuilderFlagsMask";return e})(Se||{});var ve=(e=>{e[e["None"]=0]="None";e[e["WriteTypeParametersOrArguments"]=1]="WriteTypeParametersOrArguments";e[e["UseOnlyExternalAliasing"]=2]="UseOnlyExternalAliasing";e[e["AllowAnyNodeKind"]=4]="AllowAnyNodeKind";e[e["UseAliasDefinedOutsideCurrentScope"]=8]="UseAliasDefinedOutsideCurrentScope";e[e["WriteComputedProps"]=16]="WriteComputedProps";e[e["DoNotIncludeSymbolChain"]=32]="DoNotIncludeSymbolChain";return e})(ve||{});var xe=(e=>{e[e["Accessible"]=0]="Accessible";e[e["NotAccessible"]=1]="NotAccessible";e[e["CannotBeNamed"]=2]="CannotBeNamed";e[e["NotResolved"]=3]="NotResolved";return e})(xe||{});var be=(e=>{e[e["This"]=0]="This";e[e["Identifier"]=1]="Identifier";e[e["AssertsThis"]=2]="AssertsThis";e[e["AssertsIdentifier"]=3]="AssertsIdentifier";return e})(be||{});var Ce=(e=>{e[e["Unknown"]=0]="Unknown";e[e["TypeWithConstructSignatureAndValue"]=1]="TypeWithConstructSignatureAndValue";e[e["VoidNullableOrNeverType"]=2]="VoidNullableOrNeverType";e[e["NumberLikeType"]=3]="NumberLikeType";e[e["BigIntLikeType"]=4]="BigIntLikeType";e[e["StringLikeType"]=5]="StringLikeType";e[e["BooleanType"]=6]="BooleanType";e[e["ArrayLikeType"]=7]="ArrayLikeType";e[e["ESSymbolType"]=8]="ESSymbolType";e[e["Promise"]=9]="Promise";e[e["TypeWithCallSignature"]=10]="TypeWithCallSignature";e[e["ObjectType"]=11]="ObjectType";return e})(Ce||{});var Ee=(e=>{e[e["None"]=0]="None";e[e["FunctionScopedVariable"]=1]="FunctionScopedVariable";e[e["BlockScopedVariable"]=2]="BlockScopedVariable";e[e["Property"]=4]="Property";e[e["EnumMember"]=8]="EnumMember";e[e["Function"]=16]="Function";e[e["Class"]=32]="Class";e[e["Interface"]=64]="Interface";e[e["ConstEnum"]=128]="ConstEnum";e[e["RegularEnum"]=256]="RegularEnum";e[e["ValueModule"]=512]="ValueModule";e[e["NamespaceModule"]=1024]="NamespaceModule";e[e["TypeLiteral"]=2048]="TypeLiteral";e[e["ObjectLiteral"]=4096]="ObjectLiteral";e[e["Method"]=8192]="Method";e[e["Constructor"]=16384]="Constructor";e[e["GetAccessor"]=32768]="GetAccessor";e[e["SetAccessor"]=65536]="SetAccessor";e[e["Signature"]=131072]="Signature";e[e["TypeParameter"]=262144]="TypeParameter";e[e["TypeAlias"]=524288]="TypeAlias";e[e["ExportValue"]=1048576]="ExportValue";e[e["Alias"]=2097152]="Alias";e[e["Prototype"]=4194304]="Prototype";e[e["ExportStar"]=8388608]="ExportStar";e[e["Optional"]=16777216]="Optional";e[e["Transient"]=33554432]="Transient";e[e["Assignment"]=67108864]="Assignment";e[e["ModuleExports"]=134217728]="ModuleExports";e[e["All"]=-1]="All";e[e["Enum"]=384]="Enum";e[e["Variable"]=3]="Variable";e[e["Value"]=111551]="Value";e[e["Type"]=788968]="Type";e[e["Namespace"]=1920]="Namespace";e[e["Module"]=1536]="Module";e[e["Accessor"]=98304]="Accessor";e[e["FunctionScopedVariableExcludes"]=111550]="FunctionScopedVariableExcludes";e[e["BlockScopedVariableExcludes"]=111551]="BlockScopedVariableExcludes";e[e["ParameterExcludes"]=111551]="ParameterExcludes";e[e["PropertyExcludes"]=0]="PropertyExcludes";e[e["EnumMemberExcludes"]=900095]="EnumMemberExcludes";e[e["FunctionExcludes"]=110991]="FunctionExcludes";e[e["ClassExcludes"]=899503]="ClassExcludes";e[e["InterfaceExcludes"]=788872]="InterfaceExcludes";e[e["RegularEnumExcludes"]=899327]="RegularEnumExcludes";e[e["ConstEnumExcludes"]=899967]="ConstEnumExcludes";e[e["ValueModuleExcludes"]=110735]="ValueModuleExcludes";e[e["NamespaceModuleExcludes"]=0]="NamespaceModuleExcludes";e[e["MethodExcludes"]=103359]="MethodExcludes";e[e["GetAccessorExcludes"]=46015]="GetAccessorExcludes";e[e["SetAccessorExcludes"]=78783]="SetAccessorExcludes";e[e["AccessorExcludes"]=13247]="AccessorExcludes";e[e["TypeParameterExcludes"]=526824]="TypeParameterExcludes";e[e["TypeAliasExcludes"]=788968]="TypeAliasExcludes";e[e["AliasExcludes"]=2097152]="AliasExcludes";e[e["ModuleMember"]=2623475]="ModuleMember";e[e["ExportHasLocal"]=944]="ExportHasLocal";e[e["BlockScoped"]=418]="BlockScoped";e[e["PropertyOrAccessor"]=98308]="PropertyOrAccessor";e[e["ClassMember"]=106500]="ClassMember";e[e["ExportSupportsDefaultModifier"]=112]="ExportSupportsDefaultModifier";e[e["ExportDoesNotSupportDefaultModifier"]=-113]="ExportDoesNotSupportDefaultModifier";e[e["Classifiable"]=2885600]="Classifiable";e[e["LateBindingContainer"]=6256]="LateBindingContainer";return e})(Ee||{});var Ne=(e=>{e[e["None"]=0]="None";e[e["Instantiated"]=1]="Instantiated";e[e["SyntheticProperty"]=2]="SyntheticProperty";e[e["SyntheticMethod"]=4]="SyntheticMethod";e[e["Readonly"]=8]="Readonly";e[e["ReadPartial"]=16]="ReadPartial";e[e["WritePartial"]=32]="WritePartial";e[e["HasNonUniformType"]=64]="HasNonUniformType";e[e["HasLiteralType"]=128]="HasLiteralType";e[e["ContainsPublic"]=256]="ContainsPublic";e[e["ContainsProtected"]=512]="ContainsProtected";e[e["ContainsPrivate"]=1024]="ContainsPrivate";e[e["ContainsStatic"]=2048]="ContainsStatic";e[e["Late"]=4096]="Late";e[e["ReverseMapped"]=8192]="ReverseMapped";e[e["OptionalParameter"]=16384]="OptionalParameter";e[e["RestParameter"]=32768]="RestParameter";e[e["DeferredType"]=65536]="DeferredType";e[e["HasNeverType"]=131072]="HasNeverType";e[e["Mapped"]=262144]="Mapped";e[e["StripOptional"]=524288]="StripOptional";e[e["Unresolved"]=1048576]="Unresolved";e[e["Synthetic"]=6]="Synthetic";e[e["Discriminant"]=192]="Discriminant";e[e["Partial"]=48]="Partial";return e})(Ne||{});var ke=(e=>{e["Call"]="__call";e["Constructor"]="__constructor";e["New"]="__new";e["Index"]="__index";e["ExportStar"]="__export";e["Global"]="__global";e["Missing"]="__missing";e["Type"]="__type";e["Object"]="__object";e["JSXAttributes"]="__jsxAttributes";e["Class"]="__class";e["Function"]="__function";e["Computed"]="__computed";e["Resolving"]="__resolving__";e["ExportEquals"]="export=";e["Default"]="default";e["This"]="this";e["InstantiationExpression"]="__instantiationExpression";e["ImportAttributes"]="__importAttributes";return e})(ke||{});var Fe=(e=>{e[e["None"]=0]="None";e[e["TypeChecked"]=1]="TypeChecked";e[e["LexicalThis"]=2]="LexicalThis";e[e["CaptureThis"]=4]="CaptureThis";e[e["CaptureNewTarget"]=8]="CaptureNewTarget";e[e["SuperInstance"]=16]="SuperInstance";e[e["SuperStatic"]=32]="SuperStatic";e[e["ContextChecked"]=64]="ContextChecked";e[e["MethodWithSuperPropertyAccessInAsync"]=128]="MethodWithSuperPropertyAccessInAsync";e[e["MethodWithSuperPropertyAssignmentInAsync"]=256]="MethodWithSuperPropertyAssignmentInAsync";e[e["CaptureArguments"]=512]="CaptureArguments";e[e["EnumValuesComputed"]=1024]="EnumValuesComputed";e[e["LexicalModuleMergesWithClass"]=2048]="LexicalModuleMergesWithClass";e[e["LoopWithCapturedBlockScopedBinding"]=4096]="LoopWithCapturedBlockScopedBinding";e[e["ContainsCapturedBlockScopeBinding"]=8192]="ContainsCapturedBlockScopeBinding";e[e["CapturedBlockScopedBinding"]=16384]="CapturedBlockScopedBinding";e[e["BlockScopedBindingInLoop"]=32768]="BlockScopedBindingInLoop";e[e["NeedsLoopOutParameter"]=65536]="NeedsLoopOutParameter";e[e["AssignmentsMarked"]=131072]="AssignmentsMarked";e[e["ContainsConstructorReference"]=262144]="ContainsConstructorReference";e[e["ConstructorReference"]=536870912]="ConstructorReference";e[e["ContainsClassWithPrivateIdentifiers"]=1048576]="ContainsClassWithPrivateIdentifiers";e[e["ContainsSuperPropertyInStaticInitializer"]=2097152]="ContainsSuperPropertyInStaticInitializer";e[e["InCheckIdentifier"]=4194304]="InCheckIdentifier";e[e["PartiallyTypeChecked"]=8388608]="PartiallyTypeChecked";e[e["LazyFlags"]=539358128]="LazyFlags";return e})(Fe||{});var Pe=(e=>{e[e["Any"]=1]="Any";e[e["Unknown"]=2]="Unknown";e[e["String"]=4]="String";e[e["Number"]=8]="Number";e[e["Boolean"]=16]="Boolean";e[e["Enum"]=32]="Enum";e[e["BigInt"]=64]="BigInt";e[e["StringLiteral"]=128]="StringLiteral";e[e["NumberLiteral"]=256]="NumberLiteral";e[e["BooleanLiteral"]=512]="BooleanLiteral";e[e["EnumLiteral"]=1024]="EnumLiteral";e[e["BigIntLiteral"]=2048]="BigIntLiteral";e[e["ESSymbol"]=4096]="ESSymbol";e[e["UniqueESSymbol"]=8192]="UniqueESSymbol";e[e["Void"]=16384]="Void";e[e["Undefined"]=32768]="Undefined";e[e["Null"]=65536]="Null";e[e["Never"]=131072]="Never";e[e["TypeParameter"]=262144]="TypeParameter";e[e["Object"]=524288]="Object";e[e["Union"]=1048576]="Union";e[e["Intersection"]=2097152]="Intersection";e[e["Index"]=4194304]="Index";e[e["IndexedAccess"]=8388608]="IndexedAccess";e[e["Conditional"]=16777216]="Conditional";e[e["Substitution"]=33554432]="Substitution";e[e["NonPrimitive"]=67108864]="NonPrimitive";e[e["TemplateLiteral"]=134217728]="TemplateLiteral";e[e["StringMapping"]=268435456]="StringMapping";e[e["Reserved1"]=536870912]="Reserved1";e[e["Reserved2"]=1073741824]="Reserved2";e[e["AnyOrUnknown"]=3]="AnyOrUnknown";e[e["Nullable"]=98304]="Nullable";e[e["Literal"]=2944]="Literal";e[e["Unit"]=109472]="Unit";e[e["Freshable"]=2976]="Freshable";e[e["StringOrNumberLiteral"]=384]="StringOrNumberLiteral";e[e["StringOrNumberLiteralOrUnique"]=8576]="StringOrNumberLiteralOrUnique";e[e["DefinitelyFalsy"]=117632]="DefinitelyFalsy";e[e["PossiblyFalsy"]=117724]="PossiblyFalsy";e[e["Intrinsic"]=67359327]="Intrinsic";e[e["StringLike"]=402653316]="StringLike";e[e["NumberLike"]=296]="NumberLike";e[e["BigIntLike"]=2112]="BigIntLike";e[e["BooleanLike"]=528]="BooleanLike";e[e["EnumLike"]=1056]="EnumLike";e[e["ESSymbolLike"]=12288]="ESSymbolLike";e[e["VoidLike"]=49152]="VoidLike";e[e["Primitive"]=402784252]="Primitive";e[e["DefinitelyNonNullable"]=470302716]="DefinitelyNonNullable";e[e["DisjointDomains"]=469892092]="DisjointDomains";e[e["UnionOrIntersection"]=3145728]="UnionOrIntersection";e[e["StructuredType"]=3670016]="StructuredType";e[e["TypeVariable"]=8650752]="TypeVariable";e[e["InstantiableNonPrimitive"]=58982400]="InstantiableNonPrimitive";e[e["InstantiablePrimitive"]=406847488]="InstantiablePrimitive";e[e["Instantiable"]=465829888]="Instantiable";e[e["StructuredOrInstantiable"]=469499904]="StructuredOrInstantiable";e[e["ObjectFlagsType"]=3899393]="ObjectFlagsType";e[e["Simplifiable"]=25165824]="Simplifiable";e[e["Singleton"]=67358815]="Singleton";e[e["Narrowable"]=536624127]="Narrowable";e[e["IncludesMask"]=473694207]="IncludesMask";e[e["IncludesMissingType"]=262144]="IncludesMissingType";e[e["IncludesNonWideningType"]=4194304]="IncludesNonWideningType";e[e["IncludesWildcard"]=8388608]="IncludesWildcard";e[e["IncludesEmptyObject"]=16777216]="IncludesEmptyObject";e[e["IncludesInstantiable"]=33554432]="IncludesInstantiable";e[e["IncludesConstrainedTypeVariable"]=536870912]="IncludesConstrainedTypeVariable";e[e["IncludesError"]=1073741824]="IncludesError";e[e["NotPrimitiveUnion"]=36323331]="NotPrimitiveUnion";return e})(Pe||{});var De=(e=>{e[e["None"]=0]="None";e[e["Class"]=1]="Class";e[e["Interface"]=2]="Interface";e[e["Reference"]=4]="Reference";e[e["Tuple"]=8]="Tuple";e[e["Anonymous"]=16]="Anonymous";e[e["Mapped"]=32]="Mapped";e[e["Instantiated"]=64]="Instantiated";e[e["ObjectLiteral"]=128]="ObjectLiteral";e[e["EvolvingArray"]=256]="EvolvingArray";e[e["ObjectLiteralPatternWithComputedProperties"]=512]="ObjectLiteralPatternWithComputedProperties";e[e["ReverseMapped"]=1024]="ReverseMapped";e[e["JsxAttributes"]=2048]="JsxAttributes";e[e["JSLiteral"]=4096]="JSLiteral";e[e["FreshLiteral"]=8192]="FreshLiteral";e[e["ArrayLiteral"]=16384]="ArrayLiteral";e[e["PrimitiveUnion"]=32768]="PrimitiveUnion";e[e["ContainsWideningType"]=65536]="ContainsWideningType";e[e["ContainsObjectOrArrayLiteral"]=131072]="ContainsObjectOrArrayLiteral";e[e["NonInferrableType"]=262144]="NonInferrableType";e[e["CouldContainTypeVariablesComputed"]=524288]="CouldContainTypeVariablesComputed";e[e["CouldContainTypeVariables"]=1048576]="CouldContainTypeVariables";e[e["ClassOrInterface"]=3]="ClassOrInterface";e[e["RequiresWidening"]=196608]="RequiresWidening";e[e["PropagatingFlags"]=458752]="PropagatingFlags";e[e["InstantiatedMapped"]=96]="InstantiatedMapped";e[e["ObjectTypeKindMask"]=1343]="ObjectTypeKindMask";e[e["ContainsSpread"]=2097152]="ContainsSpread";e[e["ObjectRestType"]=4194304]="ObjectRestType";e[e["InstantiationExpressionType"]=8388608]="InstantiationExpressionType";e[e["SingleSignatureType"]=134217728]="SingleSignatureType";e[e["IsClassInstanceClone"]=16777216]="IsClassInstanceClone";e[e["IdenticalBaseTypeCalculated"]=33554432]="IdenticalBaseTypeCalculated";e[e["IdenticalBaseTypeExists"]=67108864]="IdenticalBaseTypeExists";e[e["IsGenericTypeComputed"]=2097152]="IsGenericTypeComputed";e[e["IsGenericObjectType"]=4194304]="IsGenericObjectType";e[e["IsGenericIndexType"]=8388608]="IsGenericIndexType";e[e["IsGenericType"]=12582912]="IsGenericType";e[e["ContainsIntersections"]=16777216]="ContainsIntersections";e[e["IsUnknownLikeUnionComputed"]=33554432]="IsUnknownLikeUnionComputed";e[e["IsUnknownLikeUnion"]=67108864]="IsUnknownLikeUnion";e[e["IsNeverIntersectionComputed"]=16777216]="IsNeverIntersectionComputed";e[e["IsNeverIntersection"]=33554432]="IsNeverIntersection";e[e["IsConstrainedTypeVariable"]=67108864]="IsConstrainedTypeVariable";return e})(De||{});var Ie=(e=>{e[e["Invariant"]=0]="Invariant";e[e["Covariant"]=1]="Covariant";e[e["Contravariant"]=2]="Contravariant";e[e["Bivariant"]=3]="Bivariant";e[e["Independent"]=4]="Independent";e[e["VarianceMask"]=7]="VarianceMask";e[e["Unmeasurable"]=8]="Unmeasurable";e[e["Unreliable"]=16]="Unreliable";e[e["AllowsStructuralFallback"]=24]="AllowsStructuralFallback";return e})(Ie||{});var Ae=(e=>{e[e["Required"]=1]="Required";e[e["Optional"]=2]="Optional";e[e["Rest"]=4]="Rest";e[e["Variadic"]=8]="Variadic";e[e["Fixed"]=3]="Fixed";e[e["Variable"]=12]="Variable";e[e["NonRequired"]=14]="NonRequired";e[e["NonRest"]=11]="NonRest";return e})(Ae||{});var Oe=(e=>{e[e["None"]=0]="None";e[e["IncludeUndefined"]=1]="IncludeUndefined";e[e["NoIndexSignatures"]=2]="NoIndexSignatures";e[e["Writing"]=4]="Writing";e[e["CacheSymbol"]=8]="CacheSymbol";e[e["AllowMissing"]=16]="AllowMissing";e[e["ExpressionPosition"]=32]="ExpressionPosition";e[e["ReportDeprecated"]=64]="ReportDeprecated";e[e["SuppressNoImplicitAnyError"]=128]="SuppressNoImplicitAnyError";e[e["Contextual"]=256]="Contextual";e[e["Persistent"]=1]="Persistent";return e})(Oe||{});var we=(e=>{e[e["None"]=0]="None";e[e["StringsOnly"]=1]="StringsOnly";e[e["NoIndexSignatures"]=2]="NoIndexSignatures";e[e["NoReducibleCheck"]=4]="NoReducibleCheck";return e})(we||{});var Le=(e=>{e[e["Component"]=0]="Component";e[e["Function"]=1]="Function";e[e["Mixed"]=2]="Mixed";return e})(Le||{});var Me=(e=>{e[e["Call"]=0]="Call";e[e["Construct"]=1]="Construct";return e})(Me||{});var Re=(e=>{e[e["None"]=0]="None";e[e["HasRestParameter"]=1]="HasRestParameter";e[e["HasLiteralTypes"]=2]="HasLiteralTypes";e[e["Abstract"]=4]="Abstract";e[e["IsInnerCallChain"]=8]="IsInnerCallChain";e[e["IsOuterCallChain"]=16]="IsOuterCallChain";e[e["IsUntypedSignatureInJSFile"]=32]="IsUntypedSignatureInJSFile";e[e["IsNonInferrable"]=64]="IsNonInferrable";e[e["IsSignatureCandidateForOverloadFailure"]=128]="IsSignatureCandidateForOverloadFailure";e[e["PropagatingFlags"]=167]="PropagatingFlags";e[e["CallChainFlags"]=24]="CallChainFlags";return e})(Re||{});var Be=(e=>{e[e["String"]=0]="String";e[e["Number"]=1]="Number";return e})(Be||{});var je=(e=>{e[e["Simple"]=0]="Simple";e[e["Array"]=1]="Array";e[e["Deferred"]=2]="Deferred";e[e["Function"]=3]="Function";e[e["Composite"]=4]="Composite";e[e["Merged"]=5]="Merged";return e})(je||{});var Je=(e=>{e[e["None"]=0]="None";e[e["NakedTypeVariable"]=1]="NakedTypeVariable";e[e["SpeculativeTuple"]=2]="SpeculativeTuple";e[e["SubstituteSource"]=4]="SubstituteSource";e[e["HomomorphicMappedType"]=8]="HomomorphicMappedType";e[e["PartialHomomorphicMappedType"]=16]="PartialHomomorphicMappedType";e[e["MappedTypeConstraint"]=32]="MappedTypeConstraint";e[e["ContravariantConditional"]=64]="ContravariantConditional";e[e["ReturnType"]=128]="ReturnType";e[e["LiteralKeyof"]=256]="LiteralKeyof";e[e["NoConstraints"]=512]="NoConstraints";e[e["AlwaysStrict"]=1024]="AlwaysStrict";e[e["MaxValue"]=2048]="MaxValue";e[e["PriorityImpliesCombination"]=416]="PriorityImpliesCombination";e[e["Circularity"]=-1]="Circularity";return e})(Je||{});var We=(e=>{e[e["None"]=0]="None";e[e["NoDefault"]=1]="NoDefault";e[e["AnyDefault"]=2]="AnyDefault";e[e["SkippedGenericFunction"]=4]="SkippedGenericFunction";return e})(We||{});var Ue=(e=>{e[e["False"]=0]="False";e[e["Unknown"]=1]="Unknown";e[e["Maybe"]=3]="Maybe";e[e["True"]=-1]="True";return e})(Ue||{});var ze=(e=>{e[e["None"]=0]="None";e[e["ExportsProperty"]=1]="ExportsProperty";e[e["ModuleExports"]=2]="ModuleExports";e[e["PrototypeProperty"]=3]="PrototypeProperty";e[e["ThisProperty"]=4]="ThisProperty";e[e["Property"]=5]="Property";e[e["Prototype"]=6]="Prototype";e[e["ObjectDefinePropertyValue"]=7]="ObjectDefinePropertyValue";e[e["ObjectDefinePropertyExports"]=8]="ObjectDefinePropertyExports";e[e["ObjectDefinePrototypeProperty"]=9]="ObjectDefinePrototypeProperty";return e})(ze||{});var Ve=(e=>{e[e["Warning"]=0]="Warning";e[e["Error"]=1]="Error";e[e["Suggestion"]=2]="Suggestion";e[e["Message"]=3]="Message";return e})(Ve||{});function diagnosticCategoryName(e,t=true){const n=Ve[e.category];return t?n.toLowerCase():n}var qe=(e=>{e[e["Classic"]=1]="Classic";e[e["NodeJs"]=2]="NodeJs";e[e["Node10"]=2]="Node10";e[e["Node16"]=3]="Node16";e[e["NodeNext"]=99]="NodeNext";e[e["Bundler"]=100]="Bundler";return e})(qe||{});var He=(e=>{e[e["Legacy"]=1]="Legacy";e[e["Auto"]=2]="Auto";e[e["Force"]=3]="Force";return e})(He||{});var Ge=(e=>{e[e["FixedPollingInterval"]=0]="FixedPollingInterval";e[e["PriorityPollingInterval"]=1]="PriorityPollingInterval";e[e["DynamicPriorityPolling"]=2]="DynamicPriorityPolling";e[e["FixedChunkSizePolling"]=3]="FixedChunkSizePolling";e[e["UseFsEvents"]=4]="UseFsEvents";e[e["UseFsEventsOnParentDirectory"]=5]="UseFsEventsOnParentDirectory";return e})(Ge||{});var Ke=(e=>{e[e["UseFsEvents"]=0]="UseFsEvents";e[e["FixedPollingInterval"]=1]="FixedPollingInterval";e[e["DynamicPriorityPolling"]=2]="DynamicPriorityPolling";e[e["FixedChunkSizePolling"]=3]="FixedChunkSizePolling";return e})(Ke||{});var $e=(e=>{e[e["FixedInterval"]=0]="FixedInterval";e[e["PriorityInterval"]=1]="PriorityInterval";e[e["DynamicPriority"]=2]="DynamicPriority";e[e["FixedChunkSize"]=3]="FixedChunkSize";return e})($e||{});var Qe=(e=>{e[e["None"]=0]="None";e[e["CommonJS"]=1]="CommonJS";e[e["AMD"]=2]="AMD";e[e["UMD"]=3]="UMD";e[e["System"]=4]="System";e[e["ES2015"]=5]="ES2015";e[e["ES2020"]=6]="ES2020";e[e["ES2022"]=7]="ES2022";e[e["ESNext"]=99]="ESNext";e[e["Node16"]=100]="Node16";e[e["Node18"]=101]="Node18";e[e["NodeNext"]=199]="NodeNext";e[e["Preserve"]=200]="Preserve";return e})(Qe||{});var Xe=(e=>{e[e["None"]=0]="None";e[e["Preserve"]=1]="Preserve";e[e["React"]=2]="React";e[e["ReactNative"]=3]="ReactNative";e[e["ReactJSX"]=4]="ReactJSX";e[e["ReactJSXDev"]=5]="ReactJSXDev";return e})(Xe||{});var Ye=(e=>{e[e["Remove"]=0]="Remove";e[e["Preserve"]=1]="Preserve";e[e["Error"]=2]="Error";return e})(Ye||{});var Ze=(e=>{e[e["CarriageReturnLineFeed"]=0]="CarriageReturnLineFeed";e[e["LineFeed"]=1]="LineFeed";return e})(Ze||{});var et=(e=>{e[e["Unknown"]=0]="Unknown";e[e["JS"]=1]="JS";e[e["JSX"]=2]="JSX";e[e["TS"]=3]="TS";e[e["TSX"]=4]="TSX";e[e["External"]=5]="External";e[e["JSON"]=6]="JSON";e[e["Deferred"]=7]="Deferred";return e})(et||{});var tt=(e=>{e[e["ES3"]=0]="ES3";e[e["ES5"]=1]="ES5";e[e["ES2015"]=2]="ES2015";e[e["ES2016"]=3]="ES2016";e[e["ES2017"]=4]="ES2017";e[e["ES2018"]=5]="ES2018";e[e["ES2019"]=6]="ES2019";e[e["ES2020"]=7]="ES2020";e[e["ES2021"]=8]="ES2021";e[e["ES2022"]=9]="ES2022";e[e["ES2023"]=10]="ES2023";e[e["ES2024"]=11]="ES2024";e[e["ESNext"]=99]="ESNext";e[e["JSON"]=100]="JSON";e[e["Latest"]=99]="Latest";return e})(tt||{});var nt=(e=>{e[e["Standard"]=0]="Standard";e[e["JSX"]=1]="JSX";return e})(nt||{});var rt=(e=>{e[e["None"]=0]="None";e[e["Recursive"]=1]="Recursive";return e})(rt||{});var it=(e=>{e[e["EOF"]=-1]="EOF";e[e["nullCharacter"]=0]="nullCharacter";e[e["maxAsciiCharacter"]=127]="maxAsciiCharacter";e[e["lineFeed"]=10]="lineFeed";e[e["carriageReturn"]=13]="carriageReturn";e[e["lineSeparator"]=8232]="lineSeparator";e[e["paragraphSeparator"]=8233]="paragraphSeparator";e[e["nextLine"]=133]="nextLine";e[e["space"]=32]="space";e[e["nonBreakingSpace"]=160]="nonBreakingSpace";e[e["enQuad"]=8192]="enQuad";e[e["emQuad"]=8193]="emQuad";e[e["enSpace"]=8194]="enSpace";e[e["emSpace"]=8195]="emSpace";e[e["threePerEmSpace"]=8196]="threePerEmSpace";e[e["fourPerEmSpace"]=8197]="fourPerEmSpace";e[e["sixPerEmSpace"]=8198]="sixPerEmSpace";e[e["figureSpace"]=8199]="figureSpace";e[e["punctuationSpace"]=8200]="punctuationSpace";e[e["thinSpace"]=8201]="thinSpace";e[e["hairSpace"]=8202]="hairSpace";e[e["zeroWidthSpace"]=8203]="zeroWidthSpace";e[e["narrowNoBreakSpace"]=8239]="narrowNoBreakSpace";e[e["ideographicSpace"]=12288]="ideographicSpace";e[e["mathematicalSpace"]=8287]="mathematicalSpace";e[e["ogham"]=5760]="ogham";e[e["replacementCharacter"]=65533]="replacementCharacter";e[e["_"]=95]="_";e[e["$"]=36]="$";e[e["_0"]=48]="_0";e[e["_1"]=49]="_1";e[e["_2"]=50]="_2";e[e["_3"]=51]="_3";e[e["_4"]=52]="_4";e[e["_5"]=53]="_5";e[e["_6"]=54]="_6";e[e["_7"]=55]="_7";e[e["_8"]=56]="_8";e[e["_9"]=57]="_9";e[e["a"]=97]="a";e[e["b"]=98]="b";e[e["c"]=99]="c";e[e["d"]=100]="d";e[e["e"]=101]="e";e[e["f"]=102]="f";e[e["g"]=103]="g";e[e["h"]=104]="h";e[e["i"]=105]="i";e[e["j"]=106]="j";e[e["k"]=107]="k";e[e["l"]=108]="l";e[e["m"]=109]="m";e[e["n"]=110]="n";e[e["o"]=111]="o";e[e["p"]=112]="p";e[e["q"]=113]="q";e[e["r"]=114]="r";e[e["s"]=115]="s";e[e["t"]=116]="t";e[e["u"]=117]="u";e[e["v"]=118]="v";e[e["w"]=119]="w";e[e["x"]=120]="x";e[e["y"]=121]="y";e[e["z"]=122]="z";e[e["A"]=65]="A";e[e["B"]=66]="B";e[e["C"]=67]="C";e[e["D"]=68]="D";e[e["E"]=69]="E";e[e["F"]=70]="F";e[e["G"]=71]="G";e[e["H"]=72]="H";e[e["I"]=73]="I";e[e["J"]=74]="J";e[e["K"]=75]="K";e[e["L"]=76]="L";e[e["M"]=77]="M";e[e["N"]=78]="N";e[e["O"]=79]="O";e[e["P"]=80]="P";e[e["Q"]=81]="Q";e[e["R"]=82]="R";e[e["S"]=83]="S";e[e["T"]=84]="T";e[e["U"]=85]="U";e[e["V"]=86]="V";e[e["W"]=87]="W";e[e["X"]=88]="X";e[e["Y"]=89]="Y";e[e["Z"]=90]="Z";e[e["ampersand"]=38]="ampersand";e[e["asterisk"]=42]="asterisk";e[e["at"]=64]="at";e[e["backslash"]=92]="backslash";e[e["backtick"]=96]="backtick";e[e["bar"]=124]="bar";e[e["caret"]=94]="caret";e[e["closeBrace"]=125]="closeBrace";e[e["closeBracket"]=93]="closeBracket";e[e["closeParen"]=41]="closeParen";e[e["colon"]=58]="colon";e[e["comma"]=44]="comma";e[e["dot"]=46]="dot";e[e["doubleQuote"]=34]="doubleQuote";e[e["equals"]=61]="equals";e[e["exclamation"]=33]="exclamation";e[e["greaterThan"]=62]="greaterThan";e[e["hash"]=35]="hash";e[e["lessThan"]=60]="lessThan";e[e["minus"]=45]="minus";e[e["openBrace"]=123]="openBrace";e[e["openBracket"]=91]="openBracket";e[e["openParen"]=40]="openParen";e[e["percent"]=37]="percent";e[e["plus"]=43]="plus";e[e["question"]=63]="question";e[e["semicolon"]=59]="semicolon";e[e["singleQuote"]=39]="singleQuote";e[e["slash"]=47]="slash";e[e["tilde"]=126]="tilde";e[e["backspace"]=8]="backspace";e[e["formFeed"]=12]="formFeed";e[e["byteOrderMark"]=65279]="byteOrderMark";e[e["tab"]=9]="tab";e[e["verticalTab"]=11]="verticalTab";return e})(it||{});var ot=(e=>{e["Ts"]=".ts";e["Tsx"]=".tsx";e["Dts"]=".d.ts";e["Js"]=".js";e["Jsx"]=".jsx";e["Json"]=".json";e["TsBuildInfo"]=".tsbuildinfo";e["Mjs"]=".mjs";e["Mts"]=".mts";e["Dmts"]=".d.mts";e["Cjs"]=".cjs";e["Cts"]=".cts";e["Dcts"]=".d.cts";return e})(ot||{});var at=(e=>{e[e["None"]=0]="None";e[e["ContainsTypeScript"]=1]="ContainsTypeScript";e[e["ContainsJsx"]=2]="ContainsJsx";e[e["ContainsESNext"]=4]="ContainsESNext";e[e["ContainsES2022"]=8]="ContainsES2022";e[e["ContainsES2021"]=16]="ContainsES2021";e[e["ContainsES2020"]=32]="ContainsES2020";e[e["ContainsES2019"]=64]="ContainsES2019";e[e["ContainsES2018"]=128]="ContainsES2018";e[e["ContainsES2017"]=256]="ContainsES2017";e[e["ContainsES2016"]=512]="ContainsES2016";e[e["ContainsES2015"]=1024]="ContainsES2015";e[e["ContainsGenerator"]=2048]="ContainsGenerator";e[e["ContainsDestructuringAssignment"]=4096]="ContainsDestructuringAssignment";e[e["ContainsTypeScriptClassSyntax"]=8192]="ContainsTypeScriptClassSyntax";e[e["ContainsLexicalThis"]=16384]="ContainsLexicalThis";e[e["ContainsRestOrSpread"]=32768]="ContainsRestOrSpread";e[e["ContainsObjectRestOrSpread"]=65536]="ContainsObjectRestOrSpread";e[e["ContainsComputedPropertyName"]=131072]="ContainsComputedPropertyName";e[e["ContainsBlockScopedBinding"]=262144]="ContainsBlockScopedBinding";e[e["ContainsBindingPattern"]=524288]="ContainsBindingPattern";e[e["ContainsYield"]=1048576]="ContainsYield";e[e["ContainsAwait"]=2097152]="ContainsAwait";e[e["ContainsHoistedDeclarationOrCompletion"]=4194304]="ContainsHoistedDeclarationOrCompletion";e[e["ContainsDynamicImport"]=8388608]="ContainsDynamicImport";e[e["ContainsClassFields"]=16777216]="ContainsClassFields";e[e["ContainsDecorators"]=33554432]="ContainsDecorators";e[e["ContainsPossibleTopLevelAwait"]=67108864]="ContainsPossibleTopLevelAwait";e[e["ContainsLexicalSuper"]=134217728]="ContainsLexicalSuper";e[e["ContainsUpdateExpressionForIdentifier"]=268435456]="ContainsUpdateExpressionForIdentifier";e[e["ContainsPrivateIdentifierInExpression"]=536870912]="ContainsPrivateIdentifierInExpression";e[e["HasComputedFlags"]=-2147483648]="HasComputedFlags";e[e["AssertTypeScript"]=1]="AssertTypeScript";e[e["AssertJsx"]=2]="AssertJsx";e[e["AssertESNext"]=4]="AssertESNext";e[e["AssertES2022"]=8]="AssertES2022";e[e["AssertES2021"]=16]="AssertES2021";e[e["AssertES2020"]=32]="AssertES2020";e[e["AssertES2019"]=64]="AssertES2019";e[e["AssertES2018"]=128]="AssertES2018";e[e["AssertES2017"]=256]="AssertES2017";e[e["AssertES2016"]=512]="AssertES2016";e[e["AssertES2015"]=1024]="AssertES2015";e[e["AssertGenerator"]=2048]="AssertGenerator";e[e["AssertDestructuringAssignment"]=4096]="AssertDestructuringAssignment";e[e["OuterExpressionExcludes"]=-2147483648]="OuterExpressionExcludes";e[e["PropertyAccessExcludes"]=-2147483648]="PropertyAccessExcludes";e[e["NodeExcludes"]=-2147483648]="NodeExcludes";e[e["ArrowFunctionExcludes"]=-2072174592]="ArrowFunctionExcludes";e[e["FunctionExcludes"]=-1937940480]="FunctionExcludes";e[e["ConstructorExcludes"]=-1937948672]="ConstructorExcludes";e[e["MethodOrAccessorExcludes"]=-2005057536]="MethodOrAccessorExcludes";e[e["PropertyExcludes"]=-2013249536]="PropertyExcludes";e[e["ClassExcludes"]=-2147344384]="ClassExcludes";e[e["ModuleExcludes"]=-1941676032]="ModuleExcludes";e[e["TypeExcludes"]=-2]="TypeExcludes";e[e["ObjectLiteralExcludes"]=-2147278848]="ObjectLiteralExcludes";e[e["ArrayLiteralOrCallOrNewExcludes"]=-2147450880]="ArrayLiteralOrCallOrNewExcludes";e[e["VariableDeclarationListExcludes"]=-2146893824]="VariableDeclarationListExcludes";e[e["ParameterExcludes"]=-2147483648]="ParameterExcludes";e[e["CatchClauseExcludes"]=-2147418112]="CatchClauseExcludes";e[e["BindingPatternExcludes"]=-2147450880]="BindingPatternExcludes";e[e["ContainsLexicalThisOrSuper"]=134234112]="ContainsLexicalThisOrSuper";e[e["PropertyNamePropagatingFlags"]=134234112]="PropertyNamePropagatingFlags";return e})(at||{});var st=(e=>{e[e["TabStop"]=0]="TabStop";e[e["Placeholder"]=1]="Placeholder";e[e["Choice"]=2]="Choice";e[e["Variable"]=3]="Variable";return e})(st||{});var ct=(e=>{e[e["None"]=0]="None";e[e["SingleLine"]=1]="SingleLine";e[e["MultiLine"]=2]="MultiLine";e[e["AdviseOnEmitNode"]=4]="AdviseOnEmitNode";e[e["NoSubstitution"]=8]="NoSubstitution";e[e["CapturesThis"]=16]="CapturesThis";e[e["NoLeadingSourceMap"]=32]="NoLeadingSourceMap";e[e["NoTrailingSourceMap"]=64]="NoTrailingSourceMap";e[e["NoSourceMap"]=96]="NoSourceMap";e[e["NoNestedSourceMaps"]=128]="NoNestedSourceMaps";e[e["NoTokenLeadingSourceMaps"]=256]="NoTokenLeadingSourceMaps";e[e["NoTokenTrailingSourceMaps"]=512]="NoTokenTrailingSourceMaps";e[e["NoTokenSourceMaps"]=768]="NoTokenSourceMaps";e[e["NoLeadingComments"]=1024]="NoLeadingComments";e[e["NoTrailingComments"]=2048]="NoTrailingComments";e[e["NoComments"]=3072]="NoComments";e[e["NoNestedComments"]=4096]="NoNestedComments";e[e["HelperName"]=8192]="HelperName";e[e["ExportName"]=16384]="ExportName";e[e["LocalName"]=32768]="LocalName";e[e["InternalName"]=65536]="InternalName";e[e["Indented"]=131072]="Indented";e[e["NoIndentation"]=262144]="NoIndentation";e[e["AsyncFunctionBody"]=524288]="AsyncFunctionBody";e[e["ReuseTempVariableScope"]=1048576]="ReuseTempVariableScope";e[e["CustomPrologue"]=2097152]="CustomPrologue";e[e["NoHoisting"]=4194304]="NoHoisting";e[e["Iterator"]=8388608]="Iterator";e[e["NoAsciiEscaping"]=16777216]="NoAsciiEscaping";return e})(ct||{});var lt=(e=>{e[e["None"]=0]="None";e[e["TypeScriptClassWrapper"]=1]="TypeScriptClassWrapper";e[e["NeverApplyImportHelper"]=2]="NeverApplyImportHelper";e[e["IgnoreSourceNewlines"]=4]="IgnoreSourceNewlines";e[e["Immutable"]=8]="Immutable";e[e["IndirectCall"]=16]="IndirectCall";e[e["TransformPrivateStaticElements"]=32]="TransformPrivateStaticElements";return e})(lt||{});var dt={Classes:2,ForOf:2,Generators:2,Iteration:2,SpreadElements:2,RestElements:2,TaggedTemplates:2,DestructuringAssignment:2,BindingPatterns:2,ArrowFunctions:2,BlockScopedVariables:2,ObjectAssign:2,RegularExpressionFlagsUnicode:2,RegularExpressionFlagsSticky:2,Exponentiation:3,AsyncFunctions:4,ForAwaitOf:5,AsyncGenerators:5,AsyncIteration:5,ObjectSpreadRest:5,RegularExpressionFlagsDotAll:5,BindinglessCatch:6,BigInt:7,NullishCoalesce:7,OptionalChaining:7,LogicalAssignment:8,TopLevelAwait:9,ClassFields:9,PrivateNamesAndClassStaticBlocks:9,RegularExpressionFlagsHasIndices:9,ShebangComments:10,RegularExpressionFlagsUnicodeSets:11,UsingAndAwaitUsing:99,ClassAndClassElementDecorators:99};var pt=(e=>{e[e["Extends"]=1]="Extends";e[e["Assign"]=2]="Assign";e[e["Rest"]=4]="Rest";e[e["Decorate"]=8]="Decorate";e[e["ESDecorateAndRunInitializers"]=8]="ESDecorateAndRunInitializers";e[e["Metadata"]=16]="Metadata";e[e["Param"]=32]="Param";e[e["Awaiter"]=64]="Awaiter";e[e["Generator"]=128]="Generator";e[e["Values"]=256]="Values";e[e["Read"]=512]="Read";e[e["SpreadArray"]=1024]="SpreadArray";e[e["Await"]=2048]="Await";e[e["AsyncGenerator"]=4096]="AsyncGenerator";e[e["AsyncDelegator"]=8192]="AsyncDelegator";e[e["AsyncValues"]=16384]="AsyncValues";e[e["ExportStar"]=32768]="ExportStar";e[e["ImportStar"]=65536]="ImportStar";e[e["ImportDefault"]=131072]="ImportDefault";e[e["MakeTemplateObject"]=262144]="MakeTemplateObject";e[e["ClassPrivateFieldGet"]=524288]="ClassPrivateFieldGet";e[e["ClassPrivateFieldSet"]=1048576]="ClassPrivateFieldSet";e[e["ClassPrivateFieldIn"]=2097152]="ClassPrivateFieldIn";e[e["SetFunctionName"]=4194304]="SetFunctionName";e[e["PropKey"]=8388608]="PropKey";e[e["AddDisposableResourceAndDisposeResources"]=16777216]="AddDisposableResourceAndDisposeResources";e[e["RewriteRelativeImportExtension"]=33554432]="RewriteRelativeImportExtension";e[e["FirstEmitHelper"]=1]="FirstEmitHelper";e[e["LastEmitHelper"]=16777216]="LastEmitHelper";e[e["ForOfIncludes"]=256]="ForOfIncludes";e[e["ForAwaitOfIncludes"]=16384]="ForAwaitOfIncludes";e[e["AsyncGeneratorIncludes"]=6144]="AsyncGeneratorIncludes";e[e["AsyncDelegatorIncludes"]=26624]="AsyncDelegatorIncludes";e[e["SpreadIncludes"]=1536]="SpreadIncludes";return e})(pt||{});var ut=(e=>{e[e["SourceFile"]=0]="SourceFile";e[e["Expression"]=1]="Expression";e[e["IdentifierName"]=2]="IdentifierName";e[e["MappedTypeParameter"]=3]="MappedTypeParameter";e[e["Unspecified"]=4]="Unspecified";e[e["EmbeddedStatement"]=5]="EmbeddedStatement";e[e["JsxAttributeValue"]=6]="JsxAttributeValue";e[e["ImportTypeNodeAttributes"]=7]="ImportTypeNodeAttributes";return e})(ut||{});var ft=(e=>{e[e["Parentheses"]=1]="Parentheses";e[e["TypeAssertions"]=2]="TypeAssertions";e[e["NonNullAssertions"]=4]="NonNullAssertions";e[e["PartiallyEmittedExpressions"]=8]="PartiallyEmittedExpressions";e[e["ExpressionsWithTypeArguments"]=16]="ExpressionsWithTypeArguments";e[e["Satisfies"]=32]="Satisfies";e[e["Assertions"]=38]="Assertions";e[e["All"]=63]="All";e[e["ExcludeJSDocTypeAssertion"]=-2147483648]="ExcludeJSDocTypeAssertion";return e})(ft||{});var mt=(e=>{e[e["None"]=0]="None";e[e["InParameters"]=1]="InParameters";e[e["VariablesHoistedInParameters"]=2]="VariablesHoistedInParameters";return e})(mt||{});var _t=(e=>{e[e["None"]=0]="None";e[e["SingleLine"]=0]="SingleLine";e[e["MultiLine"]=1]="MultiLine";e[e["PreserveLines"]=2]="PreserveLines";e[e["LinesMask"]=3]="LinesMask";e[e["NotDelimited"]=0]="NotDelimited";e[e["BarDelimited"]=4]="BarDelimited";e[e["AmpersandDelimited"]=8]="AmpersandDelimited";e[e["CommaDelimited"]=16]="CommaDelimited";e[e["AsteriskDelimited"]=32]="AsteriskDelimited";e[e["DelimitersMask"]=60]="DelimitersMask";e[e["AllowTrailingComma"]=64]="AllowTrailingComma";e[e["Indented"]=128]="Indented";e[e["SpaceBetweenBraces"]=256]="SpaceBetweenBraces";e[e["SpaceBetweenSiblings"]=512]="SpaceBetweenSiblings";e[e["Braces"]=1024]="Braces";e[e["Parenthesis"]=2048]="Parenthesis";e[e["AngleBrackets"]=4096]="AngleBrackets";e[e["SquareBrackets"]=8192]="SquareBrackets";e[e["BracketsMask"]=15360]="BracketsMask";e[e["OptionalIfUndefined"]=16384]="OptionalIfUndefined";e[e["OptionalIfEmpty"]=32768]="OptionalIfEmpty";e[e["Optional"]=49152]="Optional";e[e["PreferNewLine"]=65536]="PreferNewLine";e[e["NoTrailingNewLine"]=131072]="NoTrailingNewLine";e[e["NoInterveningComments"]=262144]="NoInterveningComments";e[e["NoSpaceIfEmpty"]=524288]="NoSpaceIfEmpty";e[e["SingleElement"]=1048576]="SingleElement";e[e["SpaceAfterList"]=2097152]="SpaceAfterList";e[e["Modifiers"]=2359808]="Modifiers";e[e["HeritageClauses"]=512]="HeritageClauses";e[e["SingleLineTypeLiteralMembers"]=768]="SingleLineTypeLiteralMembers";e[e["MultiLineTypeLiteralMembers"]=32897]="MultiLineTypeLiteralMembers";e[e["SingleLineTupleTypeElements"]=528]="SingleLineTupleTypeElements";e[e["MultiLineTupleTypeElements"]=657]="MultiLineTupleTypeElements";e[e["UnionTypeConstituents"]=516]="UnionTypeConstituents";e[e["IntersectionTypeConstituents"]=520]="IntersectionTypeConstituents";e[e["ObjectBindingPatternElements"]=525136]="ObjectBindingPatternElements";e[e["ArrayBindingPatternElements"]=524880]="ArrayBindingPatternElements";e[e["ObjectLiteralExpressionProperties"]=526226]="ObjectLiteralExpressionProperties";e[e["ImportAttributes"]=526226]="ImportAttributes";e[e["ImportClauseEntries"]=526226]="ImportClauseEntries";e[e["ArrayLiteralExpressionElements"]=8914]="ArrayLiteralExpressionElements";e[e["CommaListElements"]=528]="CommaListElements";e[e["CallExpressionArguments"]=2576]="CallExpressionArguments";e[e["NewExpressionArguments"]=18960]="NewExpressionArguments";e[e["TemplateExpressionSpans"]=262144]="TemplateExpressionSpans";e[e["SingleLineBlockStatements"]=768]="SingleLineBlockStatements";e[e["MultiLineBlockStatements"]=129]="MultiLineBlockStatements";e[e["VariableDeclarationList"]=528]="VariableDeclarationList";e[e["SingleLineFunctionBodyStatements"]=768]="SingleLineFunctionBodyStatements";e[e["MultiLineFunctionBodyStatements"]=1]="MultiLineFunctionBodyStatements";e[e["ClassHeritageClauses"]=0]="ClassHeritageClauses";e[e["ClassMembers"]=129]="ClassMembers";e[e["InterfaceMembers"]=129]="InterfaceMembers";e[e["EnumMembers"]=145]="EnumMembers";e[e["CaseBlockClauses"]=129]="CaseBlockClauses";e[e["NamedImportsOrExportsElements"]=525136]="NamedImportsOrExportsElements";e[e["JsxElementOrFragmentChildren"]=262144]="JsxElementOrFragmentChildren";e[e["JsxElementAttributes"]=262656]="JsxElementAttributes";e[e["CaseOrDefaultClauseStatements"]=163969]="CaseOrDefaultClauseStatements";e[e["HeritageClauseTypes"]=528]="HeritageClauseTypes";e[e["SourceFileStatements"]=131073]="SourceFileStatements";e[e["Decorators"]=2146305]="Decorators";e[e["TypeArguments"]=53776]="TypeArguments";e[e["TypeParameters"]=53776]="TypeParameters";e[e["Parameters"]=2576]="Parameters";e[e["IndexSignatureParameters"]=8848]="IndexSignatureParameters";e[e["JSDocComment"]=33]="JSDocComment";return e})(_t||{});var gt=(e=>{e[e["None"]=0]="None";e[e["TripleSlashXML"]=1]="TripleSlashXML";e[e["SingleLine"]=2]="SingleLine";e[e["MultiLine"]=4]="MultiLine";e[e["All"]=7]="All";e[e["Default"]=7]="Default";return e})(gt||{});var yt={reference:{args:[{name:"types",optional:true,captureSpan:true},{name:"lib",optional:true,captureSpan:true},{name:"path",optional:true,captureSpan:true},{name:"no-default-lib",optional:true},{name:"resolution-mode",optional:true},{name:"preserve",optional:true}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:true}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}};var ht=(e=>{e[e["ParseAll"]=0]="ParseAll";e[e["ParseNone"]=1]="ParseNone";e[e["ParseForTypeErrors"]=2]="ParseForTypeErrors";e[e["ParseForTypeInfo"]=3]="ParseForTypeInfo";return e})(ht||{});function generateDjb2Hash(e){let t=5381;for(let n=0;n{e[e["Created"]=0]="Created";e[e["Changed"]=1]="Changed";e[e["Deleted"]=2]="Deleted";return e})(Tt||{});var St=(e=>{e[e["High"]=2e3]="High";e[e["Medium"]=500]="Medium";e[e["Low"]=250]="Low";return e})(St||{});var vt=new Date(0);function getModifiedTime(e,t){return e.getModifiedTime(t)||vt}function createPollingIntervalBasedLevels(e){return{[250]:e.Low,[500]:e.Medium,[2e3]:e.High}}var xt={Low:32,Medium:64,High:256};var bt=createPollingIntervalBasedLevels(xt);var Ct=createPollingIntervalBasedLevels(xt);function setCustomPollingValues(e){if(!e.getEnvironmentVariable){return}const t=setCustomLevels("TSC_WATCH_POLLINGINTERVAL",St);bt=getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE",xt)||bt;Ct=getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS",xt)||Ct;function getLevel(t,n){return e.getEnvironmentVariable(`${t}_${n.toUpperCase()}`)}function getCustomLevels(e){let t;setCustomLevel("Low");setCustomLevel("Medium");setCustomLevel("High");return t;function setCustomLevel(n){const r=getLevel(e,n);if(r){(t||(t={}))[n]=Number(r)}}}function setCustomLevels(e,t){const n=getCustomLevels(e);if(n){setLevel("Low");setLevel("Medium");setLevel("High");return true}return false;function setLevel(e){t[e]=n[e]||t[e]}}function getCustomPollingBasedLevels(e,n){const r=getCustomLevels(e);return(t||r)&&createPollingIntervalBasedLevels(r?{...n,...r}:n)}}function pollWatchedFileQueue(e,t,n,r,i){let o=n;for(let a=t.length;r&&a;nextPollIndex(),a--){const a=t[n];if(!a){continue}else if(a.isClosed){t[n]=void 0;continue}r--;const s=onWatchedFileStat(a,getModifiedTime(e,a.fileName));if(a.isClosed){t[n]=void 0;continue}i==null?void 0:i(a,n,s);if(t[n]){if(o{o.isClosed=true;unorderedRemoveItem(t,o)}}}function createPollingIntervalQueue(e){const t=[];t.pollingInterval=e;t.pollIndex=0;t.pollScheduled=false;return t}function pollPollingIntervalQueue(e,t){t.pollIndex=pollQueue(t,t.pollingInterval,t.pollIndex,bt[t.pollingInterval]);if(t.length){scheduleNextPoll(t.pollingInterval)}else{S.assert(t.pollIndex===0);t.pollScheduled=false}}function pollLowPollingIntervalQueue(e,t){pollQueue(n,250,0,n.length);pollPollingIntervalQueue(e,t);if(!t.pollScheduled&&n.length){scheduleNextPoll(250)}}function pollQueue(t,r,i,o){return pollWatchedFileQueue(e,t,i,o,onWatchFileStat);function onWatchFileStat(e,i,o){if(o){e.unchangedPolls=0;if(t!==n){t[i]=void 0;addChangedFileToLowPollingIntervalQueue(e)}}else if(e.unchangedPolls!==Ct[r]){e.unchangedPolls++}else if(t===n){e.unchangedPolls=1;t[i]=void 0;addToPollingIntervalQueue(e,250)}else if(r!==2e3){e.unchangedPolls++;t[i]=void 0;addToPollingIntervalQueue(e,r===250?500:2e3)}}}function pollingIntervalQueue(e){switch(e){case 250:return r;case 500:return i;case 2e3:return o}}function addToPollingIntervalQueue(e,t){pollingIntervalQueue(t).push(e);scheduleNextPollIfNotAlreadyScheduled(t)}function addChangedFileToLowPollingIntervalQueue(e){n.push(e);scheduleNextPollIfNotAlreadyScheduled(250)}function scheduleNextPollIfNotAlreadyScheduled(e){if(!pollingIntervalQueue(e).pollScheduled){scheduleNextPoll(e)}}function scheduleNextPoll(t){pollingIntervalQueue(t).pollScheduled=e.setTimeout(t===250?pollLowPollingIntervalQueue:pollPollingIntervalQueue,t,t===250?"pollLowPollingIntervalQueue":"pollPollingIntervalQueue",pollingIntervalQueue(t))}}function createUseFsEventsOnParentDirectoryWatchFile(e,t,n,r){const i=createMultiMap();const o=r?new Map:void 0;const a=new Map;const s=createGetCanonicalFileName(t);return nonPollingWatchFile;function nonPollingWatchFile(e,t,r,c){const l=s(e);if(i.add(l,t).length===1&&o){o.set(l,n(e)||vt)}const d=getDirectoryPath(l)||".";const p=a.get(d)||createDirectoryWatcher(getDirectoryPath(e)||".",d,c);p.referenceCount++;return{close:()=>{if(p.referenceCount===1){p.close();a.delete(d)}else{p.referenceCount--}i.remove(l,t)}}}function createDirectoryWatcher(t,r,c){const l=e(t,1,((e,r)=>{if(!isString(r))return;const a=getNormalizedAbsolutePath(r,t);const c=s(a);const l=a&&i.get(c);if(l){let t;let r=1;if(o){const i=o.get(c);if(e==="change"){t=n(a)||vt;if(t.getTime()===i.getTime())return}t||(t=n(a)||vt);o.set(c,t);if(i===vt)r=0;else if(t===vt)r=2}for(const e of l){e(a,r,t)}}}),false,500,c);l.referenceCount=0;a.set(r,l);return l}}function createFixedChunkSizePollingWatchFile(e){const t=[];let n=0;let r;return watchFile2;function watchFile2(n,r){const i={fileName:n,callback:r,mtime:getModifiedTime(e,n)};t.push(i);scheduleNextPoll();return{close:()=>{i.isClosed=true;unorderedRemoveItem(t,i)}}}function pollQueue(){r=void 0;n=pollWatchedFileQueue(e,t,n,bt[250]);scheduleNextPoll()}function scheduleNextPoll(){if(!t.length||r)return;r=e.setTimeout(pollQueue,2e3,"pollQueue")}}function createSingleWatcherPerName(e,t,n,r,i){const o=createGetCanonicalFileName(t);const a=o(n);const s=e.get(a);if(s){s.callbacks.push(r)}else{e.set(a,{watcher:i(((t,n,r)=>{var i;return(i=e.get(a))==null?void 0:i.callbacks.slice().forEach((e=>e(t,n,r)))})),callbacks:[r]})}return{close:()=>{const t=e.get(a);if(!t)return;if(!orderedRemoveItem(t.callbacks,r)||t.callbacks.length)return;e.delete(a);closeFileWatcherOf(t)}}}function onWatchedFileStat(e,t){const n=e.mtime.getTime();const r=t.getTime();if(n!==r){e.mtime=t;e.callback(e.fileName,getFileWatcherEventKind(n,r),t);return true}return false}function getFileWatcherEventKind(e,t){return e===0?0:t===0?2:1}var Et=["/node_modules/.","/.git","/.#"];var Nt=noop;function sysLog(e){return Nt(e)}function setSysLog(e){Nt=e}function createDirectoryWatcherSupportingRecursive({watchDirectory:e,useCaseSensitiveFileNames:t,getCurrentDirectory:n,getAccessibleSortedChildDirectories:r,fileSystemEntryExists:i,realpath:o,setTimeout:a,clearTimeout:s}){const c=new Map;const l=createMultiMap();const p=new Map;let u;const f=getStringComparer(!t);const m=createGetCanonicalFileName(t);return(t,n,r,i)=>r?createDirectoryWatcher(t,i,n):e(t,n,r,i);function createDirectoryWatcher(t,n,r,i){const o=m(t);let a=c.get(o);if(a){a.refCount++}else{a={watcher:e(t,(e=>{var r;if(isIgnoredPath(e,n))return;if(n==null?void 0:n.synchronousWatchDirectory){if(!((r=c.get(o))==null?void 0:r.targetWatcher))invokeCallbacks(t,o,e);updateChildWatches(t,o,n)}else{nonSyncUpdateChildWatches(t,o,e,n)}}),false,n),refCount:1,childWatches:d,targetWatcher:void 0,links:void 0};c.set(o,a);updateChildWatches(t,o,n)}if(i)(a.links??(a.links=new Set)).add(i);const s=r&&{dirName:t,callback:r};if(s){l.add(o,s)}return{dirName:t,close:()=>{var e;const t=S.checkDefined(c.get(o));if(s)l.remove(o,s);if(i)(e=t.links)==null?void 0:e.delete(i);t.refCount--;if(t.refCount)return;c.delete(o);t.links=void 0;closeFileWatcherOf(t);closeTargetWatcher(t);t.childWatches.forEach(closeFileWatcher)}}}function invokeCallbacks(e,t,n,r){var i,o;let a;let s;if(isString(n)){a=n}else{s=n}l.forEach(((e,n)=>{if(s&&s.get(n)===true)return;if(n===t||startsWith(t,n)&&t[n.length]===Pt){if(s){if(r){const e=s.get(n);if(e){e.push(...r)}else{s.set(n,r.slice())}}else{s.set(n,true)}}else{e.forEach((({callback:e})=>e(a)))}}}));(o=(i=c.get(t))==null?void 0:i.links)==null?void 0:o.forEach((t=>{const toPathInLink=n=>combinePaths(t,getRelativePathFromDirectory(e,n,m));if(s){invokeCallbacks(t,m(t),s,r==null?void 0:r.map(toPathInLink))}else{invokeCallbacks(t,m(t),toPathInLink(a))}}))}function nonSyncUpdateChildWatches(e,t,n,r){const o=c.get(t);if(o&&i(e,1)){scheduleUpdateChildWatches(e,t,n,r);return}invokeCallbacks(e,t,n);closeTargetWatcher(o);removeChildWatches(o)}function scheduleUpdateChildWatches(e,t,n,r){const i=p.get(t);if(i){i.fileNames.push(n)}else{p.set(t,{dirName:e,options:r,fileNames:[n]})}if(u){s(u);u=void 0}u=a(onTimerToUpdateChildWatches,1e3,"timerToUpdateChildWatches")}function onTimerToUpdateChildWatches(){var e;u=void 0;sysLog(`sysLog:: onTimerToUpdateChildWatches:: ${p.size}`);const t=R();const n=new Map;while(!u&&p.size){const t=p.entries().next();S.assert(!t.done);const{value:[r,{dirName:i,options:o,fileNames:a}]}=t;p.delete(r);const s=updateChildWatches(i,r,o);if(!((e=c.get(r))==null?void 0:e.targetWatcher))invokeCallbacks(i,r,n,s?void 0:a)}sysLog(`sysLog:: invokingWatchers:: Elapsed:: ${R()-t}ms:: ${p.size}`);l.forEach(((e,t)=>{const r=n.get(t);if(r){e.forEach((({callback:e,dirName:t})=>{if(isArray(r)){r.forEach(e)}else{e(t)}}))}}));const r=R()-t;sysLog(`sysLog:: Elapsed:: ${r}ms:: onTimerToUpdateChildWatches:: ${p.size} ${u}`)}function removeChildWatches(e){if(!e)return;const t=e.childWatches;e.childWatches=d;for(const e of t){e.close();removeChildWatches(c.get(m(e.dirName)))}}function closeTargetWatcher(e){if(e==null?void 0:e.targetWatcher){e.targetWatcher.close();e.targetWatcher=void 0}}function updateChildWatches(e,t,n){const a=c.get(t);if(!a)return false;const s=normalizePath(o(e));let l;let p;if(f(s,e)===0){l=enumerateInsertsAndDeletes(i(e,1)?mapDefined(r(e),(t=>{const r=getNormalizedAbsolutePath(t,e);return!isIgnoredPath(r,n)&&f(r,normalizePath(o(r)))===0?r:void 0})):d,a.childWatches,((e,t)=>f(e,t.dirName)),createAndAddChildDirectoryWatcher,closeFileWatcher,addChildDirectoryWatcher)}else if(a.targetWatcher&&f(s,a.targetWatcher.dirName)===0){l=false;S.assert(a.childWatches===d)}else{closeTargetWatcher(a);a.targetWatcher=createDirectoryWatcher(s,n,void 0,e);a.childWatches.forEach(closeFileWatcher);l=true}a.childWatches=p||d;return l;function createAndAddChildDirectoryWatcher(e){const t=createDirectoryWatcher(e,n);addChildDirectoryWatcher(t)}function addChildDirectoryWatcher(e){(p||(p=[])).push(e)}}function isIgnoredPath(e,r){return some(Et,(t=>isInPath(e,t)))||isIgnoredByWatchOptions(e,r,t,n)}function isInPath(e,n){if(e.includes(n))return true;if(t)return false;return m(e).includes(n)}}var kt=(e=>{e[e["File"]=0]="File";e[e["Directory"]=1]="Directory";return e})(kt||{});function createFileWatcherCallback(e){return(t,n,r)=>e(n===1?"change":"rename","",r)}function createFsWatchCallbackForFileWatcherCallback(e,t,n){return(r,i,o)=>{if(r==="rename"){o||(o=n(e)||vt);t(e,o!==vt?0:2,o)}else{t(e,1,o)}}}function isIgnoredByWatchOptions(e,t,n,r){return((t==null?void 0:t.excludeDirectories)||(t==null?void 0:t.excludeFiles))&&(matchesExclude(e,t==null?void 0:t.excludeFiles,n,r())||matchesExclude(e,t==null?void 0:t.excludeDirectories,n,r()))}function createFsWatchCallbackForDirectoryWatcherCallback(e,t,n,r,i){return(o,a)=>{if(o==="rename"){const o=!a?e:normalizePath(combinePaths(e,a));if(!a||!isIgnoredByWatchOptions(o,n,r,i)){t(o)}}}}function createSystemWatchFunctions({pollingWatchFileWorker:e,getModifiedTime:t,setTimeout:n,clearTimeout:r,fsWatchWorker:i,fileSystemEntryExists:o,useCaseSensitiveFileNames:a,getCurrentDirectory:s,fsSupportsRecursiveFsWatch:c,getAccessibleSortedChildDirectories:l,realpath:d,tscWatchFile:p,useNonPollingWatchers:u,tscWatchDirectory:f,inodeWatching:m,fsWatchWithTimestamp:_,sysLog:g}){const y=new Map;const h=new Map;const T=new Map;let v;let x;let b;let C;let E=false;return{watchFile:watchFile2,watchDirectory:watchDirectory};function watchFile2(e,n,r,i){i=updateOptionsForWatchFile(i,u);const o=S.checkDefined(i.watchFile);switch(o){case 0:return pollingWatchFile(e,n,250,void 0);case 1:return pollingWatchFile(e,n,r,void 0);case 2:return ensureDynamicPollingWatchFile()(e,n,r,void 0);case 3:return ensureFixedChunkSizePollingWatchFile()(e,n,void 0,void 0);case 4:return fsWatch(e,0,createFsWatchCallbackForFileWatcherCallback(e,n,t),false,r,getFallbackOptions(i));case 5:if(!b){b=createUseFsEventsOnParentDirectoryWatchFile(fsWatch,a,t,_)}return b(e,n,r,getFallbackOptions(i));default:S.assertNever(o)}}function ensureDynamicPollingWatchFile(){return v||(v=createDynamicPriorityPollingWatchFile({getModifiedTime:t,setTimeout:n}))}function ensureFixedChunkSizePollingWatchFile(){return x||(x=createFixedChunkSizePollingWatchFile({getModifiedTime:t,setTimeout:n}))}function updateOptionsForWatchFile(e,t){if(e&&e.watchFile!==void 0)return e;switch(p){case"PriorityPollingInterval":return{watchFile:1};case"DynamicPriorityPolling":return{watchFile:2};case"UseFsEvents":return generateWatchFileOptions(4,1,e);case"UseFsEventsWithFallbackDynamicPolling":return generateWatchFileOptions(4,2,e);case"UseFsEventsOnParentDirectory":t=true;default:return t?generateWatchFileOptions(5,1,e):{watchFile:4}}}function generateWatchFileOptions(e,t,n){const r=n==null?void 0:n.fallbackPolling;return{watchFile:e,fallbackPolling:r===void 0?t:r}}function watchDirectory(e,t,i,p){if(c){return fsWatch(e,1,createFsWatchCallbackForDirectoryWatcherCallback(e,t,p,a,s),i,500,getFallbackOptions(p))}if(!C){C=createDirectoryWatcherSupportingRecursive({useCaseSensitiveFileNames:a,getCurrentDirectory:s,fileSystemEntryExists:o,getAccessibleSortedChildDirectories:l,watchDirectory:nonRecursiveWatchDirectory,realpath:d,setTimeout:n,clearTimeout:r})}return C(e,t,i,p)}function nonRecursiveWatchDirectory(e,t,n,r){S.assert(!n);const i=updateOptionsForWatchDirectory(r);const o=S.checkDefined(i.watchDirectory);switch(o){case 1:return pollingWatchFile(e,(()=>t(e)),500,void 0);case 2:return ensureDynamicPollingWatchFile()(e,(()=>t(e)),500,void 0);case 3:return ensureFixedChunkSizePollingWatchFile()(e,(()=>t(e)),void 0,void 0);case 0:return fsWatch(e,1,createFsWatchCallbackForDirectoryWatcherCallback(e,t,r,a,s),n,500,getFallbackOptions(i));default:S.assertNever(o)}}function updateOptionsForWatchDirectory(e){if(e&&e.watchDirectory!==void 0)return e;switch(f){case"RecursiveDirectoryUsingFsWatchFile":return{watchDirectory:1};case"RecursiveDirectoryUsingDynamicPriorityPolling":return{watchDirectory:2};default:const t=e==null?void 0:e.fallbackPolling;return{watchDirectory:0,fallbackPolling:t!==void 0?t:void 0}}}function pollingWatchFile(t,n,r,i){return createSingleWatcherPerName(y,a,t,n,(n=>e(t,n,r,i)))}function fsWatch(e,t,n,r,i,o){return createSingleWatcherPerName(r?T:h,a,e,n,(n=>fsWatchHandlingExistenceOnHost(e,t,n,r,i,o)))}function fsWatchHandlingExistenceOnHost(e,n,r,a,s,c){let l;let d;if(m){l=e.substring(e.lastIndexOf(Pt));d=l.slice(Pt.length)}let p=!o(e,n)?watchMissingFileSystemEntry():watchPresentFileSystemEntry();return{close:()=>{if(p){p.close();p=void 0}}};function updateWatcher(t){if(p){g(`sysLog:: ${e}:: Changing watcher to ${t===watchPresentFileSystemEntry?"Present":"Missing"}FileSystemEntryWatcher`);p.close();p=t()}}function watchPresentFileSystemEntry(){if(E){g(`sysLog:: ${e}:: Defaulting to watchFile`);return watchPresentFileSystemEntryWithFsWatchFile()}try{const t=(n===1||!_?i:fsWatchWorkerHandlingTimestamp)(e,a,m?callbackChangingToMissingFileSystemEntry:r);t.on("error",(()=>{r("rename","");updateWatcher(watchMissingFileSystemEntry)}));return t}catch(t){E||(E=t.code==="ENOSPC");g(`sysLog:: ${e}:: Changing to watchFile`);return watchPresentFileSystemEntryWithFsWatchFile()}}function callbackChangingToMissingFileSystemEntry(n,i){let o;if(i&&endsWith(i,"~")){o=i;i=i.slice(0,i.length-1)}if(n==="rename"&&(!i||i===d||endsWith(i,l))){const a=t(e)||vt;if(o)r(n,o,a);r(n,i,a);if(m){updateWatcher(a===vt?watchMissingFileSystemEntry:watchPresentFileSystemEntry)}else if(a===vt){updateWatcher(watchMissingFileSystemEntry)}}else{if(o)r(n,o);r(n,i)}}function watchPresentFileSystemEntryWithFsWatchFile(){return watchFile2(e,createFileWatcherCallback(r),s,c)}function watchMissingFileSystemEntry(){return watchFile2(e,((n,i,o)=>{if(i===0){o||(o=t(e)||vt);if(o!==vt){r("rename","",o);updateWatcher(watchPresentFileSystemEntry)}}}),s,c)}}function fsWatchWorkerHandlingTimestamp(e,n,r){let o=t(e)||vt;return i(e,n,((n,i,a)=>{if(n==="change"){a||(a=t(e)||vt);if(a.getTime()===o.getTime())return}o=a||t(e)||vt;r(n,i,o)}))}}function patchWriteFileEnsuringDirectory(e){const t=e.writeFile;e.writeFile=(n,r,i)=>writeFileEnsuringDirectories(n,r,!!i,((n,r,i)=>t.call(e,n,r,i)),(t=>e.createDirectory(t)),(t=>e.directoryExists(t)))}var Ft=(()=>{const e="\ufeff";function getNodeSystem(){const t=/^native |^\([^)]+\)$|^(?:internal[\\/]|[\w\s]+(?:\.js)?$)/;const r=n(147);const i=n(17);const o=n(37);let a;try{a=n(113)}catch{a=void 0}let s;let c="./profile.cpuprofile";const l=process.platform==="darwin";const d=process.platform==="linux"||l;const p={throwIfNoEntry:false};const u=o.platform();const f=isFileSystemCaseSensitive();const m=!!r.realpathSync.native?process.platform==="win32"?fsRealPathHandlingLongPath:r.realpathSync.native:r.realpathSync;const _=__filename.endsWith("sys.js")?i.join(i.dirname(__dirname),"__fake__.js"):__filename;const g=process.platform==="win32"||l;const y=memoize((()=>process.cwd()));const{watchFile:h,watchDirectory:T}=createSystemWatchFunctions({pollingWatchFileWorker:fsWatchFileWorker,getModifiedTime:getModifiedTime3,setTimeout:setTimeout,clearTimeout:clearTimeout,fsWatchWorker:fsWatchWorker,useCaseSensitiveFileNames:f,getCurrentDirectory:y,fileSystemEntryExists:fileSystemEntryExists,fsSupportsRecursiveFsWatch:g,getAccessibleSortedChildDirectories:e=>getAccessibleFileSystemEntries(e).directories,realpath:realpath,tscWatchFile:process.env.TSC_WATCHFILE,useNonPollingWatchers:!!process.env.TSC_NONPOLLING_WATCHER,tscWatchDirectory:process.env.TSC_WATCHDIRECTORY,inodeWatching:d,fsWatchWithTimestamp:l,sysLog:sysLog});const S={args:process.argv.slice(2),newLine:o.EOL,useCaseSensitiveFileNames:f,write(e){process.stdout.write(e)},getWidthOfTerminal(){return process.stdout.columns},writeOutputIsTTY(){return process.stdout.isTTY},readFile:readFile,writeFile:writeFile2,watchFile:h,watchDirectory:T,preferNonRecursiveWatch:!g,resolvePath:e=>i.resolve(e),fileExists:fileExists,directoryExists:directoryExists,getAccessibleFileSystemEntries:getAccessibleFileSystemEntries,createDirectory(e){if(!S.directoryExists(e)){try{r.mkdirSync(e)}catch(e){if(e.code!=="EEXIST"){throw e}}}},getExecutingFilePath(){return _},getCurrentDirectory:y,getDirectories:getDirectories,getEnvironmentVariable(e){return process.env[e]||""},readDirectory:readDirectory,getModifiedTime:getModifiedTime3,setModifiedTime:setModifiedTime,deleteFile:deleteFile,createHash:a?createSHA256Hash:generateDjb2Hash,createSHA256Hash:a?createSHA256Hash:void 0,getMemoryUsage(){if(global.gc){global.gc()}return process.memoryUsage().heapUsed},getFileSize(e){const t=statSync(e);if(t==null?void 0:t.isFile()){return t.size}return 0},exit(e){disableCPUProfiler((()=>process.exit(e)))},enableCPUProfiler:enableCPUProfiler,disableCPUProfiler:disableCPUProfiler,cpuProfilingEnabled:()=>!!s||contains(process.execArgv,"--cpu-prof")||contains(process.execArgv,"--prof"),realpath:realpath,debugMode:!!process.env.NODE_INSPECTOR_IPC||!!process.env.VSCODE_INSPECTOR_OPTIONS||some(process.execArgv,(e=>/^--(?:inspect|debug)(?:-brk)?(?:=\d+)?$/i.test(e)))||!!process.recordreplay,tryEnableSourceMapsForHost(){try{n(737).install()}catch{}},setTimeout:setTimeout,clearTimeout:clearTimeout,clearScreen:()=>{process.stdout.write("")},setBlocking:()=>{var e;const t=(e=process.stdout)==null?void 0:e._handle;if(t&&t.setBlocking){t.setBlocking(true)}},base64decode:e=>Buffer.from(e,"base64").toString("utf8"),base64encode:e=>Buffer.from(e).toString("base64"),require:(e,t)=>{try{const n=resolveJSModule(t,e,S);return{module:require(n),modulePath:n,error:void 0}}catch(e){return{module:void 0,modulePath:void 0,error:e}}}};return S;function statSync(e){try{return r.statSync(e,p)}catch{return void 0}}function enableCPUProfiler(e,t){if(s){t();return false}const r=n(405);if(!r||!r.Session){t();return false}const i=new r.Session;i.connect();i.post("Profiler.enable",(()=>{i.post("Profiler.start",(()=>{s=i;c=e;t()}))}));return true}function cleanupPaths(e){let n=0;const r=new Map;const o=normalizeSlashes(i.dirname(_));const a=`file://${getRootLength(o)===1?"":"/"}${o}`;for(const i of e.nodes){if(i.callFrame.url){const e=normalizeSlashes(i.callFrame.url);if(containsPath(a,e,f)){i.callFrame.url=getRelativePathToDirectoryOrUrl(a,e,a,createGetCanonicalFileName(f),true)}else if(!t.test(e)){i.callFrame.url=(r.has(e)?r:r.set(e,`external${n}.js`)).get(e);n++}}}return e}function disableCPUProfiler(e){if(s&&s!=="stopping"){const t=s;s.post("Profiler.stop",((n,{profile:o})=>{var a;if(!n){if((a=statSync(c))==null?void 0:a.isDirectory()){c=i.join(c,`${(new Date).toISOString().replace(/:/g,"-")}+P${process.pid}.cpuprofile`)}try{r.mkdirSync(i.dirname(c),{recursive:true})}catch{}r.writeFileSync(c,JSON.stringify(cleanupPaths(o)))}s=void 0;t.disconnect();e()}));s="stopping";return true}else{e();return false}}function isFileSystemCaseSensitive(){if(u==="win32"||u==="win64"){return false}return!fileExists(swapCase(__filename))}function swapCase(e){return e.replace(/\w/g,(e=>{const t=e.toUpperCase();return e===t?e.toLowerCase():t}))}function fsWatchFileWorker(e,t,n){r.watchFile(e,{persistent:true,interval:n},fileChanged);let i;return{close:()=>r.unwatchFile(e,fileChanged)};function fileChanged(n,r){const o=+r.mtime===0||i===2;if(+n.mtime===0){if(o){return}i=2}else if(o){i=0}else if(+n.mtime===+r.mtime){return}else{i=1}t(e,i,n.mtime)}}function fsWatchWorker(e,t,n){return r.watch(e,g?{persistent:true,recursive:!!t}:{persistent:true},n)}function readFile(e,t){let n;try{n=r.readFileSync(e)}catch{return void 0}let i=n.length;if(i>=2&&n[0]===254&&n[1]===255){i&=~1;for(let e=0;e=2&&n[0]===255&&n[1]===254){return n.toString("utf16le",2)}if(i>=3&&n[0]===239&&n[1]===187&&n[2]===191){return n.toString("utf8",3)}return n.toString("utf8")}function writeFile2(t,n,i){if(i){n=e+n}let o;try{o=r.openSync(t,"w");r.writeSync(o,n,void 0,"utf8")}finally{if(o!==void 0){r.closeSync(o)}}}function getAccessibleFileSystemEntries(e){try{const t=r.readdirSync(e||".",{withFileTypes:true});const n=[];const i=[];for(const r of t){const t=typeof r==="string"?r:r.name;if(t==="."||t===".."){continue}let o;if(typeof r==="string"||r.isSymbolicLink()){const n=combinePaths(e,t);o=statSync(n);if(!o){continue}}else{o=r}if(o.isFile()){n.push(t)}else if(o.isDirectory()){i.push(t)}}n.sort();i.sort();return{files:n,directories:i}}catch{return Fr}}function readDirectory(e,t,n,r,i){return matchFiles(e,t,n,r,f,process.cwd(),i,getAccessibleFileSystemEntries,realpath)}function fileSystemEntryExists(e,t){const n=statSync(e);if(!n){return false}switch(t){case 0:return n.isFile();case 1:return n.isDirectory();default:return false}}function fileExists(e){return fileSystemEntryExists(e,0)}function directoryExists(e){return fileSystemEntryExists(e,1)}function getDirectories(e){return getAccessibleFileSystemEntries(e).directories.slice()}function fsRealPathHandlingLongPath(e){return e.length<260?r.realpathSync.native(e):r.realpathSync(e)}function realpath(e){try{return m(e)}catch{return e}}function getModifiedTime3(e){var t;return(t=statSync(e))==null?void 0:t.mtime}function setModifiedTime(e,t){try{r.utimesSync(e,t,t)}catch{return}}function deleteFile(e){try{return r.unlinkSync(e)}catch{return}}function createSHA256Hash(e){const t=a.createHash("sha256");t.update(e);return t.digest("hex")}}let t;if(isNodeLikeSystem()){t=getNodeSystem()}if(t){patchWriteFileEnsuringDirectory(t)}return t})();function setSys(e){Ft=e}if(Ft&&Ft.getEnvironmentVariable){setCustomPollingValues(Ft);S.setAssertionLevel(/^development$/i.test(Ft.getEnvironmentVariable("NODE_ENV"))?1:0)}if(Ft&&Ft.debugMode){S.isDebugging=true}var Pt="/";var Dt="\\";var It="://";var At=/\\/g;function isAnyDirectorySeparator(e){return e===47||e===92}function isUrl(e){return getEncodedRootLength(e)<0}function isRootedDiskPath(e){return getEncodedRootLength(e)>0}function isDiskPathRoot(e){const t=getEncodedRootLength(e);return t>0&&t===e.length}function pathIsAbsolute(e){return getEncodedRootLength(e)!==0}function pathIsRelative(e){return/^\.\.?(?:$|[\\/])/.test(e)}function pathIsBareSpecifier(e){return!pathIsAbsolute(e)&&!pathIsRelative(e)}function hasExtension(e){return getBaseFileName(e).includes(".")}function fileExtensionIs(e,t){return e.length>t.length&&endsWith(e,t)}function fileExtensionIsOneOf(e,t){for(const n of t){if(fileExtensionIs(e,n)){return true}}return false}function hasTrailingDirectorySeparator(e){return e.length>0&&isAnyDirectorySeparator(e.charCodeAt(e.length-1))}function isVolumeCharacter(e){return e>=97&&e<=122||e>=65&&e<=90}function getFileUrlVolumeSeparatorEnd(e,t){const n=e.charCodeAt(t);if(n===58)return t+1;if(n===37&&e.charCodeAt(t+1)===51){const n=e.charCodeAt(t+2);if(n===97||n===65)return t+3}return-1}function getEncodedRootLength(e){if(!e)return 0;const t=e.charCodeAt(0);if(t===47||t===92){if(e.charCodeAt(1)!==t)return 1;const n=e.indexOf(t===47?Pt:Dt,2);if(n<0)return e.length;return n+1}if(isVolumeCharacter(t)&&e.charCodeAt(1)===58){const t=e.charCodeAt(2);if(t===47||t===92)return 3;if(e.length===2)return 2}const n=e.indexOf(It);if(n!==-1){const t=n+It.length;const r=e.indexOf(Pt,t);if(r!==-1){const i=e.slice(0,n);const o=e.slice(t,r);if(i==="file"&&(o===""||o==="localhost")&&isVolumeCharacter(e.charCodeAt(r+1))){const t=getFileUrlVolumeSeparatorEnd(e,r+2);if(t!==-1){if(e.charCodeAt(t)===47){return~(t+1)}if(t===e.length){return~t}}}return~(r+1)}return~e.length}return 0}function getRootLength(e){const t=getEncodedRootLength(e);return t<0?~t:t}function getDirectoryPath(e){e=normalizeSlashes(e);const t=getRootLength(e);if(t===e.length)return e;e=removeTrailingDirectorySeparator(e);return e.slice(0,Math.max(t,e.lastIndexOf(Pt)))}function getBaseFileName(e,t,n){e=normalizeSlashes(e);const r=getRootLength(e);if(r===e.length)return"";e=removeTrailingDirectorySeparator(e);const i=e.slice(Math.max(getRootLength(e),e.lastIndexOf(Pt)+1));const o=t!==void 0&&n!==void 0?getAnyExtensionFromPath(i,t,n):void 0;return o?i.slice(0,i.length-o.length):i}function tryGetExtensionFromPath(e,t,n){if(!startsWith(t,"."))t="."+t;if(e.length>=t.length&&e.charCodeAt(e.length-t.length)===46){const r=e.slice(e.length-t.length);if(n(r,t)){return r}}}function getAnyExtensionFromPathWorker(e,t,n){if(typeof t==="string"){return tryGetExtensionFromPath(e,t,n)||""}for(const r of t){const t=tryGetExtensionFromPath(e,r,n);if(t)return t}return""}function getAnyExtensionFromPath(e,t,n){if(t){return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(e),t,n?equateStringsCaseInsensitive:equateStringsCaseSensitive)}const r=getBaseFileName(e);const i=r.lastIndexOf(".");if(i>=0){return r.substring(i)}return""}function pathComponents(e,t){const n=e.substring(0,t);const r=e.substring(t).split(Pt);if(r.length&&!lastOrUndefined(r))r.pop();return[n,...r]}function getPathComponents(e,t=""){e=combinePaths(t,e);return pathComponents(e,getRootLength(e))}function getPathFromPathComponents(e,t){if(e.length===0)return"";const n=e[0]&&ensureTrailingDirectorySeparator(e[0]);return n+e.slice(1,t).join(Pt)}function normalizeSlashes(e){return e.includes("\\")?e.replace(At,Pt):e}function reducePathComponents(e){if(!some(e))return[];const t=[e[0]];for(let n=1;n1){if(t[t.length-1]!==".."){t.pop();continue}}else if(t[0])continue}t.push(r)}return t}function combinePaths(e,...t){if(e)e=normalizeSlashes(e);for(let n of t){if(!n)continue;n=normalizeSlashes(n);if(!e||getRootLength(n)!==0){e=n}else{e=ensureTrailingDirectorySeparator(e)+n}}return e}function resolvePath(e,...t){return normalizePath(some(t)?combinePaths(e,...t):normalizeSlashes(e))}function getNormalizedPathComponents(e,t){return reducePathComponents(getPathComponents(e,t))}function getNormalizedAbsolutePath(e,t){let n=getRootLength(e);if(n===0&&t){e=combinePaths(t,e);n=getRootLength(e)}else{e=normalizeSlashes(e)}const r=simpleNormalizePath(e);if(r!==void 0){return r.length>n?removeTrailingDirectorySeparator(r):r}const i=e.length;const o=e.substring(0,n);let a;let s=n;let c=s;let l=s;let d=n!==0;while(sc){a??(a=e.substring(0,c-1));c=s}let r=e.indexOf(Pt,s+1);if(r===-1){r=i}const p=r-c;if(p===1&&e.charCodeAt(s)===46){a??(a=e.substring(0,l))}else if(p===2&&e.charCodeAt(s)===46&&e.charCodeAt(s+1)===46){if(!d){if(a!==void 0){a+=a.length===n?"..":"/.."}else{l=s+2}}else if(a===void 0){if(l-2>=0){a=e.substring(0,Math.max(n,e.lastIndexOf(Pt,l-2)))}else{a=e.substring(0,l)}}else{const e=a.lastIndexOf(Pt);if(e!==-1){a=a.substring(0,Math.max(n,e))}else{a=o}if(a.length===n){d=n!==0}}}else if(a!==void 0){if(a.length!==n){a+=Pt}d=true;a+=e.substring(c,r)}else{d=true;l=r}s=r+1}return a??(i>n?removeTrailingDirectorySeparator(e):e)}function normalizePath(e){e=normalizeSlashes(e);let t=simpleNormalizePath(e);if(t!==void 0){return t}t=getNormalizedAbsolutePath(e,"");return t&&hasTrailingDirectorySeparator(e)?ensureTrailingDirectorySeparator(t):t}function simpleNormalizePath(e){if(!Ot.test(e)){return e}let t=e.replace(/\/\.\//g,"/");if(t.startsWith("./")){t=t.slice(2)}if(t!==e){e=t;if(!Ot.test(e)){return e}}return void 0}function getPathWithoutRoot(e){if(e.length===0)return"";return e.slice(1).join(Pt)}function getNormalizedAbsolutePathWithoutRoot(e,t){return getPathWithoutRoot(getNormalizedPathComponents(e,t))}function toPath(e,t,n){const r=isRootedDiskPath(e)?normalizePath(e):getNormalizedAbsolutePath(e,t);return n(r)}function removeTrailingDirectorySeparator(e){if(hasTrailingDirectorySeparator(e)){return e.substr(0,e.length-1)}return e}function ensureTrailingDirectorySeparator(e){if(!hasTrailingDirectorySeparator(e)){return e+Pt}return e}function ensurePathIsNonModuleName(e){return!pathIsAbsolute(e)&&!pathIsRelative(e)?"./"+e:e}function changeAnyExtension(e,t,n,r){const i=n!==void 0&&r!==void 0?getAnyExtensionFromPath(e,n,r):getAnyExtensionFromPath(e);return i?e.slice(0,e.length-i.length)+(startsWith(t,".")?t:"."+t):e}function changeFullExtension(e,t){const n=getDeclarationFileExtension(e);if(n){return e.slice(0,e.length-n.length)+(startsWith(t,".")?t:"."+t)}return changeAnyExtension(e,t)}var Ot=/\/\/|(?:^|\/)\.\.?(?:$|\/)/;function comparePathsWorker(e,t,n){if(e===t)return 0;if(e===void 0)return-1;if(t===void 0)return 1;const r=e.substring(0,getRootLength(e));const i=t.substring(0,getRootLength(t));const o=compareStringsCaseInsensitive(r,i);if(o!==0){return o}const a=e.substring(r.length);const s=t.substring(i.length);if(!Ot.test(a)&&!Ot.test(s)){return n(a,s)}const c=reducePathComponents(getPathComponents(e));const l=reducePathComponents(getPathComponents(t));const d=Math.min(c.length,l.length);for(let e=1;e0===getRootLength(t)>0,"Paths must either both be absolute or both be relative");const r=typeof n==="function"?n:identity;const i=typeof n==="boolean"?n:false;const o=getPathComponentsRelativeTo(e,t,i?equateStringsCaseInsensitive:equateStringsCaseSensitive,r);return getPathFromPathComponents(o)}function convertToRelativePath(e,t,n){return!isRootedDiskPath(e)?e:getRelativePathToDirectoryOrUrl(t,e,t,n,false)}function getRelativePathFromFile(e,t,n){return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(e),t,n))}function getRelativePathToDirectoryOrUrl(e,t,n,r,i){const o=getPathComponentsRelativeTo(resolvePath(n,e),resolvePath(n,t),equateStringsCaseSensitive,r);const a=o[0];if(i&&isRootedDiskPath(a)){const e=a.charAt(0)===Pt?"file://":"file:///";o[0]=e+a}return getPathFromPathComponents(o)}function forEachAncestorDirectory(e,t){while(true){const n=t(e);if(n!==void 0){return n}const r=getDirectoryPath(e);if(r===e){return void 0}e=r}}function isNodeModulesDirectory(e){return endsWith(e,"/node_modules")}function diag(e,t,n,r,i,o,a){return{code:e,category:t,key:n,message:r,reportsUnnecessary:i,elidedInCompatabilityPyramid:o,reportsDeprecated:a}}var wt={Unterminated_string_literal:diag(1002,1,"Unterminated_string_literal_1002","Unterminated string literal."),Identifier_expected:diag(1003,1,"Identifier_expected_1003","Identifier expected."),_0_expected:diag(1005,1,"_0_expected_1005","'{0}' expected."),A_file_cannot_have_a_reference_to_itself:diag(1006,1,"A_file_cannot_have_a_reference_to_itself_1006","A file cannot have a reference to itself."),The_parser_expected_to_find_a_1_to_match_the_0_token_here:diag(1007,1,"The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007","The parser expected to find a '{1}' to match the '{0}' token here."),Trailing_comma_not_allowed:diag(1009,1,"Trailing_comma_not_allowed_1009","Trailing comma not allowed."),Asterisk_Slash_expected:diag(1010,1,"Asterisk_Slash_expected_1010","'*/' expected."),An_element_access_expression_should_take_an_argument:diag(1011,1,"An_element_access_expression_should_take_an_argument_1011","An element access expression should take an argument."),Unexpected_token:diag(1012,1,"Unexpected_token_1012","Unexpected token."),A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma:diag(1013,1,"A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013","A rest parameter or binding pattern may not have a trailing comma."),A_rest_parameter_must_be_last_in_a_parameter_list:diag(1014,1,"A_rest_parameter_must_be_last_in_a_parameter_list_1014","A rest parameter must be last in a parameter list."),Parameter_cannot_have_question_mark_and_initializer:diag(1015,1,"Parameter_cannot_have_question_mark_and_initializer_1015","Parameter cannot have question mark and initializer."),A_required_parameter_cannot_follow_an_optional_parameter:diag(1016,1,"A_required_parameter_cannot_follow_an_optional_parameter_1016","A required parameter cannot follow an optional parameter."),An_index_signature_cannot_have_a_rest_parameter:diag(1017,1,"An_index_signature_cannot_have_a_rest_parameter_1017","An index signature cannot have a rest parameter."),An_index_signature_parameter_cannot_have_an_accessibility_modifier:diag(1018,1,"An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018","An index signature parameter cannot have an accessibility modifier."),An_index_signature_parameter_cannot_have_a_question_mark:diag(1019,1,"An_index_signature_parameter_cannot_have_a_question_mark_1019","An index signature parameter cannot have a question mark."),An_index_signature_parameter_cannot_have_an_initializer:diag(1020,1,"An_index_signature_parameter_cannot_have_an_initializer_1020","An index signature parameter cannot have an initializer."),An_index_signature_must_have_a_type_annotation:diag(1021,1,"An_index_signature_must_have_a_type_annotation_1021","An index signature must have a type annotation."),An_index_signature_parameter_must_have_a_type_annotation:diag(1022,1,"An_index_signature_parameter_must_have_a_type_annotation_1022","An index signature parameter must have a type annotation."),readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature:diag(1024,1,"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024","'readonly' modifier can only appear on a property declaration or index signature."),An_index_signature_cannot_have_a_trailing_comma:diag(1025,1,"An_index_signature_cannot_have_a_trailing_comma_1025","An index signature cannot have a trailing comma."),Accessibility_modifier_already_seen:diag(1028,1,"Accessibility_modifier_already_seen_1028","Accessibility modifier already seen."),_0_modifier_must_precede_1_modifier:diag(1029,1,"_0_modifier_must_precede_1_modifier_1029","'{0}' modifier must precede '{1}' modifier."),_0_modifier_already_seen:diag(1030,1,"_0_modifier_already_seen_1030","'{0}' modifier already seen."),_0_modifier_cannot_appear_on_class_elements_of_this_kind:diag(1031,1,"_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031","'{0}' modifier cannot appear on class elements of this kind."),super_must_be_followed_by_an_argument_list_or_member_access:diag(1034,1,"super_must_be_followed_by_an_argument_list_or_member_access_1034","'super' must be followed by an argument list or member access."),Only_ambient_modules_can_use_quoted_names:diag(1035,1,"Only_ambient_modules_can_use_quoted_names_1035","Only ambient modules can use quoted names."),Statements_are_not_allowed_in_ambient_contexts:diag(1036,1,"Statements_are_not_allowed_in_ambient_contexts_1036","Statements are not allowed in ambient contexts."),A_declare_modifier_cannot_be_used_in_an_already_ambient_context:diag(1038,1,"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038","A 'declare' modifier cannot be used in an already ambient context."),Initializers_are_not_allowed_in_ambient_contexts:diag(1039,1,"Initializers_are_not_allowed_in_ambient_contexts_1039","Initializers are not allowed in ambient contexts."),_0_modifier_cannot_be_used_in_an_ambient_context:diag(1040,1,"_0_modifier_cannot_be_used_in_an_ambient_context_1040","'{0}' modifier cannot be used in an ambient context."),_0_modifier_cannot_be_used_here:diag(1042,1,"_0_modifier_cannot_be_used_here_1042","'{0}' modifier cannot be used here."),_0_modifier_cannot_appear_on_a_module_or_namespace_element:diag(1044,1,"_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044","'{0}' modifier cannot appear on a module or namespace element."),Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier:diag(1046,1,"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046","Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."),A_rest_parameter_cannot_be_optional:diag(1047,1,"A_rest_parameter_cannot_be_optional_1047","A rest parameter cannot be optional."),A_rest_parameter_cannot_have_an_initializer:diag(1048,1,"A_rest_parameter_cannot_have_an_initializer_1048","A rest parameter cannot have an initializer."),A_set_accessor_must_have_exactly_one_parameter:diag(1049,1,"A_set_accessor_must_have_exactly_one_parameter_1049","A 'set' accessor must have exactly one parameter."),A_set_accessor_cannot_have_an_optional_parameter:diag(1051,1,"A_set_accessor_cannot_have_an_optional_parameter_1051","A 'set' accessor cannot have an optional parameter."),A_set_accessor_parameter_cannot_have_an_initializer:diag(1052,1,"A_set_accessor_parameter_cannot_have_an_initializer_1052","A 'set' accessor parameter cannot have an initializer."),A_set_accessor_cannot_have_rest_parameter:diag(1053,1,"A_set_accessor_cannot_have_rest_parameter_1053","A 'set' accessor cannot have rest parameter."),A_get_accessor_cannot_have_parameters:diag(1054,1,"A_get_accessor_cannot_have_parameters_1054","A 'get' accessor cannot have parameters."),Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value:diag(1055,1,"Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compa_1055","Type '{0}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value."),Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher:diag(1056,1,"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056","Accessors are only available when targeting ECMAScript 5 and higher."),The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:diag(1058,1,"The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058","The return type of an async function must either be a valid promise or must not contain a callable 'then' member."),A_promise_must_have_a_then_method:diag(1059,1,"A_promise_must_have_a_then_method_1059","A promise must have a 'then' method."),The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback:diag(1060,1,"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060","The first parameter of the 'then' method of a promise must be a callback."),Enum_member_must_have_initializer:diag(1061,1,"Enum_member_must_have_initializer_1061","Enum member must have initializer."),Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method:diag(1062,1,"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062","Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."),An_export_assignment_cannot_be_used_in_a_namespace:diag(1063,1,"An_export_assignment_cannot_be_used_in_a_namespace_1063","An export assignment cannot be used in a namespace."),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0:diag(1064,1,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064","The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise<{0}>'?"),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type:diag(1065,1,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1065","The return type of an async function or method must be the global Promise type."),In_ambient_enum_declarations_member_initializer_must_be_constant_expression:diag(1066,1,"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066","In ambient enum declarations member initializer must be constant expression."),Unexpected_token_A_constructor_method_accessor_or_property_was_expected:diag(1068,1,"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068","Unexpected token. A constructor, method, accessor, or property was expected."),Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces:diag(1069,1,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:diag(1070,1,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:diag(1071,1,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:diag(1079,1,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:diag(1084,1,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),_0_modifier_cannot_appear_on_a_constructor_declaration:diag(1089,1,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:diag(1090,1,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:diag(1091,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:diag(1092,1,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:diag(1093,1,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:diag(1094,1,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:diag(1095,1,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:diag(1096,1,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:diag(1097,1,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:diag(1098,1,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:diag(1099,1,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:diag(1100,1,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:diag(1101,1,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:diag(1102,1,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:diag(1103,1,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:diag(1104,1,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:diag(1105,1,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:diag(1106,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:diag(1107,1,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:diag(1108,1,"A_return_statement_can_only_be_used_within_a_function_body_1108","A 'return' statement can only be used within a function body."),Expression_expected:diag(1109,1,"Expression_expected_1109","Expression expected."),Type_expected:diag(1110,1,"Type_expected_1110","Type expected."),Private_field_0_must_be_declared_in_an_enclosing_class:diag(1111,1,"Private_field_0_must_be_declared_in_an_enclosing_class_1111","Private field '{0}' must be declared in an enclosing class."),A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:diag(1113,1,"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113","A 'default' clause cannot appear more than once in a 'switch' statement."),Duplicate_label_0:diag(1114,1,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:diag(1115,1,"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115","A 'continue' statement can only jump to a label of an enclosing iteration statement."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:diag(1116,1,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name:diag(1117,1,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117","An object literal cannot have multiple properties with the same name."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:diag(1118,1,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:diag(1119,1,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:diag(1120,1,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_Use_the_syntax_0:diag(1121,1,"Octal_literals_are_not_allowed_Use_the_syntax_0_1121","Octal literals are not allowed. Use the syntax '{0}'."),Variable_declaration_list_cannot_be_empty:diag(1123,1,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:diag(1124,1,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:diag(1125,1,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:diag(1126,1,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:diag(1127,1,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:diag(1128,1,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:diag(1129,1,"Statement_expected_1129","Statement expected."),case_or_default_expected:diag(1130,1,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:diag(1131,1,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:diag(1132,1,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:diag(1134,1,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:diag(1135,1,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:diag(1136,1,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:diag(1137,1,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:diag(1138,1,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:diag(1139,1,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:diag(1140,1,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:diag(1141,1,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:diag(1142,1,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:diag(1144,1,"or_expected_1144","'{' or ';' expected."),or_JSX_element_expected:diag(1145,1,"or_JSX_element_expected_1145","'{' or JSX element expected."),Declaration_expected:diag(1146,1,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:diag(1147,1,"Import_declarations_in_a_namespace_cannot_reference_a_module_1147","Import declarations in a namespace cannot reference a module."),Cannot_use_imports_exports_or_module_augmentations_when_module_is_none:diag(1148,1,"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148","Cannot use imports, exports, or module augmentations when '--module' is 'none'."),File_name_0_differs_from_already_included_file_name_1_only_in_casing:diag(1149,1,"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149","File name '{0}' differs from already included file name '{1}' only in casing."),_0_declarations_must_be_initialized:diag(1155,1,"_0_declarations_must_be_initialized_1155","'{0}' declarations must be initialized."),_0_declarations_can_only_be_declared_inside_a_block:diag(1156,1,"_0_declarations_can_only_be_declared_inside_a_block_1156","'{0}' declarations can only be declared inside a block."),Unterminated_template_literal:diag(1160,1,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:diag(1161,1,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:diag(1162,1,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:diag(1163,1,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:diag(1164,1,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:diag(1165,1,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:diag(1166,1,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:diag(1168,1,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:diag(1169,1,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:diag(1170,1,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:diag(1171,1,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:diag(1172,1,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:diag(1173,1,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:diag(1174,1,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:diag(1175,1,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:diag(1176,1,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:diag(1177,1,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:diag(1178,1,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:diag(1179,1,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:diag(1180,1,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:diag(1181,1,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:diag(1182,1,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:diag(1183,1,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:diag(1184,1,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:diag(1185,1,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:diag(1186,1,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:diag(1187,1,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:diag(1188,1,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:diag(1189,1,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:diag(1190,1,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:diag(1191,1,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:diag(1192,1,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:diag(1193,1,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:diag(1194,1,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:diag(1195,1,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:diag(1196,1,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:diag(1197,1,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:diag(1198,1,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:diag(1199,1,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:diag(1200,1,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:diag(1202,1,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202",`Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:diag(1203,1,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_0_is_enabled_requires_using_export_type:diag(1205,1,"Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205","Re-exporting a type when '{0}' is enabled requires using 'export type'."),Decorators_are_not_valid_here:diag(1206,1,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:diag(1207,1,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0:diag(1209,1,"Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209","Invalid optional chain from new expression. Did you mean to call '{0}()'?"),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:diag(1210,1,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:diag(1211,1,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:diag(1212,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:diag(1213,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:diag(1214,1,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:diag(1215,1,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:diag(1216,1,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:diag(1218,1,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Generators_are_not_allowed_in_an_ambient_context:diag(1221,1,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:diag(1222,1,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:diag(1223,1,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:diag(1224,1,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:diag(1225,1,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:diag(1226,1,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:diag(1227,1,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:diag(1228,1,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:diag(1229,1,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:diag(1230,1,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:diag(1231,1,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:diag(1232,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232","An import declaration can only be used at the top level of a namespace or module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:diag(1233,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233","An export declaration can only be used at the top level of a namespace or module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:diag(1234,1,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module:diag(1235,1,"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235","A namespace declaration is only allowed at the top level of a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:diag(1236,1,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:diag(1237,1,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:diag(1238,1,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:diag(1239,1,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:diag(1240,1,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:diag(1241,1,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:diag(1242,1,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:diag(1243,1,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:diag(1244,1,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:diag(1245,1,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:diag(1246,1,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:diag(1247,1,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:diag(1248,1,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:diag(1249,1,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5:diag(1250,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode:diag(1251,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definiti_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode:diag(1252,1,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_au_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode."),Abstract_properties_can_only_appear_within_an_abstract_class:diag(1253,1,"Abstract_properties_can_only_appear_within_an_abstract_class_1253","Abstract properties can only appear within an abstract class."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:diag(1254,1,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:diag(1255,1,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:diag(1257,1,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:diag(1258,1,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:diag(1259,1,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:diag(1260,1,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:diag(1261,1,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:diag(1262,1,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:diag(1263,1,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:diag(1264,1,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:diag(1265,1,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:diag(1266,1,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:diag(1267,1,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:diag(1268,1,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled:diag(1269,1,"Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269","Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."),Decorator_function_return_type_0_is_not_assignable_to_type_1:diag(1270,1,"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270","Decorator function return type '{0}' is not assignable to type '{1}'."),Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any:diag(1271,1,"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271","Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled:diag(1272,1,"A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272","A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),_0_modifier_cannot_appear_on_a_type_parameter:diag(1273,1,"_0_modifier_cannot_appear_on_a_type_parameter_1273","'{0}' modifier cannot appear on a type parameter"),_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias:diag(1274,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274","'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),accessor_modifier_can_only_appear_on_a_property_declaration:diag(1275,1,"accessor_modifier_can_only_appear_on_a_property_declaration_1275","'accessor' modifier can only appear on a property declaration."),An_accessor_property_cannot_be_declared_optional:diag(1276,1,"An_accessor_property_cannot_be_declared_optional_1276","An 'accessor' property cannot be declared optional."),_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class:diag(1277,1,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277","'{0}' modifier can only appear on a type parameter of a function, method or class"),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0:diag(1278,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278","The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."),The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0:diag(1279,1,"The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279","The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."),Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement:diag(1280,1,"Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280","Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."),Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead:diag(1281,1,"Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281","Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."),An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:diag(1282,1,"An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282","An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:diag(1283,1,"An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283","An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:diag(1284,1,"An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284","An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:diag(1285,1,"An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285","An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled:diag(1286,1,"ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286","ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled:diag(1287,1,"A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287","A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled:diag(1288,1,"An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288","An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported:diag(1289,1,"_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289","'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default:diag(1290,1,"_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290","'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported:diag(1291,1,"_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291","'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default:diag(1292,1,"_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292","'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve:diag(1293,1,"ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293","ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled:diag(1294,1,"This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294","This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),with_statements_are_not_allowed_in_an_async_function_block:diag(1300,1,"with_statements_are_not_allowed_in_an_async_function_block_1300","'with' statements are not allowed in an async function block."),await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:diag(1308,1,"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308","'await' expressions are only allowed within async functions and at the top levels of modules."),The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level:diag(1309,1,"The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309","The current file is a CommonJS module and cannot use 'await' at the top level."),Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern:diag(1312,1,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:diag(1313,1,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:diag(1314,1,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:diag(1315,1,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:diag(1316,1,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:diag(1317,1,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:diag(1318,1,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:diag(1319,1,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:diag(1320,1,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:diag(1321,1,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:diag(1322,1,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext:diag(1323,1,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve:diag(1324,1,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'."),Argument_of_dynamic_import_cannot_be_spread_element:diag(1325,1,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments:diag(1326,1,"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326","This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),String_literal_with_double_quotes_expected:diag(1327,1,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:diag(1328,1,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:diag(1329,1,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:diag(1330,1,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:diag(1331,1,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:diag(1332,1,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:diag(1333,1,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:diag(1334,1,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:diag(1335,1,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:diag(1337,1,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:diag(1338,1,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:diag(1339,1,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:diag(1340,1,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Class_constructor_may_not_be_an_accessor:diag(1341,1,"Class_constructor_may_not_be_an_accessor_1341","Class constructor may not be an accessor."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext:diag(1343,1,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'."),A_label_is_not_allowed_here:diag(1344,1,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:diag(1345,1,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:diag(1346,1,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:diag(1347,1,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:diag(1348,1,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:diag(1349,1,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:diag(1350,3,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:diag(1351,1,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:diag(1352,1,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:diag(1353,1,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:diag(1354,1,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:diag(1355,1,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:diag(1356,1,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:diag(1357,1,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:diag(1358,1,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:diag(1359,1,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),Type_0_does_not_satisfy_the_expected_type_1:diag(1360,1,"Type_0_does_not_satisfy_the_expected_type_1_1360","Type '{0}' does not satisfy the expected type '{1}'."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:diag(1361,1,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:diag(1362,1,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:diag(1363,1,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:diag(1364,3,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:diag(1365,3,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:diag(1366,3,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:diag(1367,3,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Class_constructor_may_not_be_a_generator:diag(1368,1,"Class_constructor_may_not_be_a_generator_1368","Class constructor may not be a generator."),Did_you_mean_0:diag(1369,3,"Did_you_mean_0_1369","Did you mean '{0}'?"),await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:diag(1375,1,"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375","'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),_0_was_imported_here:diag(1376,3,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:diag(1377,3,"_0_was_exported_here_1377","'{0}' was exported here."),Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:diag(1378,1,"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378","Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:diag(1379,1,"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379","An import alias cannot reference a declaration that was exported using 'export type'."),An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type:diag(1380,1,"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380","An import alias cannot reference a declaration that was imported using 'import type'."),Unexpected_token_Did_you_mean_or_rbrace:diag(1381,1,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `}`?"),Unexpected_token_Did_you_mean_or_gt:diag(1382,1,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `>`?"),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:diag(1385,1,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:diag(1386,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:diag(1387,1,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:diag(1388,1,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:diag(1389,1,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:diag(1390,1,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:diag(1392,1,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:diag(1393,3,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:diag(1394,3,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:diag(1395,3,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:diag(1396,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:diag(1397,3,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:diag(1398,3,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:diag(1399,3,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:diag(1400,3,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:diag(1401,3,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:diag(1402,3,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:diag(1403,3,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:diag(1404,3,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:diag(1405,3,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:diag(1406,3,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:diag(1407,3,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:diag(1408,3,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:diag(1409,3,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:diag(1410,3,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:diag(1411,3,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:diag(1412,3,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:diag(1413,3,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:diag(1414,3,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:diag(1415,3,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:diag(1416,3,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:diag(1417,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:diag(1418,3,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:diag(1419,3,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:diag(1420,3,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:diag(1421,3,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:diag(1422,3,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:diag(1423,3,"File_is_library_specified_here_1423","File is library specified here."),Default_library:diag(1424,3,"Default_library_1424","Default library"),Default_library_for_target_0:diag(1425,3,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:diag(1426,3,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:diag(1427,3,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:diag(1428,3,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:diag(1429,3,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:diag(1430,3,"The_file_is_in_the_program_because_Colon_1430","The file is in the program because:"),for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:diag(1431,1,"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431","'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:diag(1432,1,"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432","Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters:diag(1433,1,"Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433","Neither decorators nor modifiers may be applied to 'this' parameters."),Unexpected_keyword_or_identifier:diag(1434,1,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:diag(1435,1,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:diag(1436,1,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:diag(1437,1,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:diag(1438,1,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:diag(1439,1,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:diag(1440,1,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:diag(1441,1,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:diag(1442,1,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:diag(1443,1,"Module_declaration_names_may_only_use_or_quoted_strings_1443",`Module declaration names may only use ' or " quoted strings.`),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled:diag(1448,1,"_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448","'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed:diag(1449,3,"Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449","Preserve unused imported values in the JavaScript output that would otherwise be removed."),Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments:diag(1450,3,"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450","Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression:diag(1451,1,"Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451","Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),resolution_mode_should_be_either_require_or_import:diag(1453,1,"resolution_mode_should_be_either_require_or_import_1453","`resolution-mode` should be either `require` or `import`."),resolution_mode_can_only_be_set_for_type_only_imports:diag(1454,1,"resolution_mode_can_only_be_set_for_type_only_imports_1454","`resolution-mode` can only be set for type-only imports."),resolution_mode_is_the_only_valid_key_for_type_import_assertions:diag(1455,1,"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455","`resolution-mode` is the only valid key for type import assertions."),Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:diag(1456,1,"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456","Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:diag(1457,3,"Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457","Matched by default include pattern '**/*'"),File_is_ECMAScript_module_because_0_has_field_type_with_value_module:diag(1458,3,"File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458",`File is ECMAScript module because '{0}' has field "type" with value "module"`),File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:diag(1459,3,"File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459",`File is CommonJS module because '{0}' has field "type" whose value is not "module"`),File_is_CommonJS_module_because_0_does_not_have_field_type:diag(1460,3,"File_is_CommonJS_module_because_0_does_not_have_field_type_1460",`File is CommonJS module because '{0}' does not have field "type"`),File_is_CommonJS_module_because_package_json_was_not_found:diag(1461,3,"File_is_CommonJS_module_because_package_json_was_not_found_1461","File is CommonJS module because 'package.json' was not found"),resolution_mode_is_the_only_valid_key_for_type_import_attributes:diag(1463,1,"resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463","'resolution-mode' is the only valid key for type import attributes."),Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:diag(1464,1,"Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464","Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."),The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output:diag(1470,1,"The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470","The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead:diag(1471,1,"Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471","Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."),catch_or_finally_expected:diag(1472,1,"catch_or_finally_expected_1472","'catch' or 'finally' expected."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:diag(1473,1,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473","An import declaration can only be used at the top level of a module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:diag(1474,1,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474","An export declaration can only be used at the top level of a module."),Control_what_method_is_used_to_detect_module_format_JS_files:diag(1475,3,"Control_what_method_is_used_to_detect_module_format_JS_files_1475","Control what method is used to detect module-format JS files."),auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules:diag(1476,3,"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476",'"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),An_instantiation_expression_cannot_be_followed_by_a_property_access:diag(1477,1,"An_instantiation_expression_cannot_be_followed_by_a_property_access_1477","An instantiation expression cannot be followed by a property access."),Identifier_or_string_literal_expected:diag(1478,1,"Identifier_or_string_literal_expected_1478","Identifier or string literal expected."),The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead:diag(1479,1,"The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479",`The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.`),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module:diag(1480,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480",'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'),To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1:diag(1481,3,"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481",`To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`),To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0:diag(1482,3,"To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482",'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'),To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module:diag(1483,3,"To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483",'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:diag(1484,1,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484","'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:diag(1485,1,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),Decorator_used_before_export_here:diag(1486,1,"Decorator_used_before_export_here_1486","Decorator used before 'export' here."),Octal_escape_sequences_are_not_allowed_Use_the_syntax_0:diag(1487,1,"Octal_escape_sequences_are_not_allowed_Use_the_syntax_0_1487","Octal escape sequences are not allowed. Use the syntax '{0}'."),Escape_sequence_0_is_not_allowed:diag(1488,1,"Escape_sequence_0_is_not_allowed_1488","Escape sequence '{0}' is not allowed."),Decimals_with_leading_zeros_are_not_allowed:diag(1489,1,"Decimals_with_leading_zeros_are_not_allowed_1489","Decimals with leading zeros are not allowed."),File_appears_to_be_binary:diag(1490,1,"File_appears_to_be_binary_1490","File appears to be binary."),_0_modifier_cannot_appear_on_a_using_declaration:diag(1491,1,"_0_modifier_cannot_appear_on_a_using_declaration_1491","'{0}' modifier cannot appear on a 'using' declaration."),_0_declarations_may_not_have_binding_patterns:diag(1492,1,"_0_declarations_may_not_have_binding_patterns_1492","'{0}' declarations may not have binding patterns."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration:diag(1493,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493","The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration:diag(1494,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494","The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),_0_modifier_cannot_appear_on_an_await_using_declaration:diag(1495,1,"_0_modifier_cannot_appear_on_an_await_using_declaration_1495","'{0}' modifier cannot appear on an 'await using' declaration."),Identifier_string_literal_or_number_literal_expected:diag(1496,1,"Identifier_string_literal_or_number_literal_expected_1496","Identifier, string literal, or number literal expected."),Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator:diag(1497,1,"Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator_1497","Expression must be enclosed in parentheses to be used as a decorator."),Invalid_syntax_in_decorator:diag(1498,1,"Invalid_syntax_in_decorator_1498","Invalid syntax in decorator."),Unknown_regular_expression_flag:diag(1499,1,"Unknown_regular_expression_flag_1499","Unknown regular expression flag."),Duplicate_regular_expression_flag:diag(1500,1,"Duplicate_regular_expression_flag_1500","Duplicate regular expression flag."),This_regular_expression_flag_is_only_available_when_targeting_0_or_later:diag(1501,1,"This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501","This regular expression flag is only available when targeting '{0}' or later."),The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously:diag(1502,1,"The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1502","The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously."),Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later:diag(1503,1,"Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1503","Named capturing groups are only available when targeting 'ES2018' or later."),Subpattern_flags_must_be_present_when_there_is_a_minus_sign:diag(1504,1,"Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1504","Subpattern flags must be present when there is a minus sign."),Incomplete_quantifier_Digit_expected:diag(1505,1,"Incomplete_quantifier_Digit_expected_1505","Incomplete quantifier. Digit expected."),Numbers_out_of_order_in_quantifier:diag(1506,1,"Numbers_out_of_order_in_quantifier_1506","Numbers out of order in quantifier."),There_is_nothing_available_for_repetition:diag(1507,1,"There_is_nothing_available_for_repetition_1507","There is nothing available for repetition."),Unexpected_0_Did_you_mean_to_escape_it_with_backslash:diag(1508,1,"Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1508","Unexpected '{0}'. Did you mean to escape it with backslash?"),This_regular_expression_flag_cannot_be_toggled_within_a_subpattern:diag(1509,1,"This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1509","This regular expression flag cannot be toggled within a subpattern."),k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets:diag(1510,1,"k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510","'\\k' must be followed by a capturing group name enclosed in angle brackets."),q_is_only_available_inside_character_class:diag(1511,1,"q_is_only_available_inside_character_class_1511","'\\q' is only available inside character class."),c_must_be_followed_by_an_ASCII_letter:diag(1512,1,"c_must_be_followed_by_an_ASCII_letter_1512","'\\c' must be followed by an ASCII letter."),Undetermined_character_escape:diag(1513,1,"Undetermined_character_escape_1513","Undetermined character escape."),Expected_a_capturing_group_name:diag(1514,1,"Expected_a_capturing_group_name_1514","Expected a capturing group name."),Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other:diag(1515,1,"Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1515","Named capturing groups with the same name must be mutually exclusive to each other."),A_character_class_range_must_not_be_bounded_by_another_character_class:diag(1516,1,"A_character_class_range_must_not_be_bounded_by_another_character_class_1516","A character class range must not be bounded by another character class."),Range_out_of_order_in_character_class:diag(1517,1,"Range_out_of_order_in_character_class_1517","Range out of order in character class."),Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class:diag(1518,1,"Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1518","Anything that would possibly match more than a single character is invalid inside a negated character class."),Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead:diag(1519,1,"Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1519","Operators must not be mixed within a character class. Wrap it in a nested class instead."),Expected_a_class_set_operand:diag(1520,1,"Expected_a_class_set_operand_1520","Expected a class set operand."),q_must_be_followed_by_string_alternatives_enclosed_in_braces:diag(1521,1,"q_must_be_followed_by_string_alternatives_enclosed_in_braces_1521","'\\q' must be followed by string alternatives enclosed in braces."),A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash:diag(1522,1,"A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1522","A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash?"),Expected_a_Unicode_property_name:diag(1523,1,"Expected_a_Unicode_property_name_1523","Expected a Unicode property name."),Unknown_Unicode_property_name:diag(1524,1,"Unknown_Unicode_property_name_1524","Unknown Unicode property name."),Expected_a_Unicode_property_value:diag(1525,1,"Expected_a_Unicode_property_value_1525","Expected a Unicode property value."),Unknown_Unicode_property_value:diag(1526,1,"Unknown_Unicode_property_value_1526","Unknown Unicode property value."),Expected_a_Unicode_property_name_or_value:diag(1527,1,"Expected_a_Unicode_property_name_or_value_1527","Expected a Unicode property name or value."),Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set:diag(1528,1,"Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1528","Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set."),Unknown_Unicode_property_name_or_value:diag(1529,1,"Unknown_Unicode_property_name_or_value_1529","Unknown Unicode property name or value."),Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set:diag(1530,1,"Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1530","Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces:diag(1531,1,"_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1531","'\\{0}' must be followed by a Unicode property value expression enclosed in braces."),There_is_no_capturing_group_named_0_in_this_regular_expression:diag(1532,1,"There_is_no_capturing_group_named_0_in_this_regular_expression_1532","There is no capturing group named '{0}' in this regular expression."),This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression:diag(1533,1,"This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_r_1533","This backreference refers to a group that does not exist. There are only {0} capturing groups in this regular expression."),This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression:diag(1534,1,"This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regul_1534","This backreference refers to a group that does not exist. There are no capturing groups in this regular expression."),This_character_cannot_be_escaped_in_a_regular_expression:diag(1535,1,"This_character_cannot_be_escaped_in_a_regular_expression_1535","This character cannot be escaped in a regular expression."),Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead:diag(1536,1,"Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended__1536","Octal escape sequences and backreferences are not allowed in a character class. If this was intended as an escape sequence, use the syntax '{0}' instead."),Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class:diag(1537,1,"Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537","Decimal escape sequences and backreferences are not allowed in a character class."),Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set:diag(1538,1,"Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538","Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),A_bigint_literal_cannot_be_used_as_a_property_name:diag(1539,1,"A_bigint_literal_cannot_be_used_as_a_property_name_1539","A 'bigint' literal cannot be used as a property name."),A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead:diag(1540,2,"A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540","A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",void 0,void 0,true),Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:diag(1541,1,"Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribut_1541","Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:diag(1542,1,"Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542","Type import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0:diag(1543,1,"Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543",`Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to '{0}'.`),Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0:diag(1544,1,"Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544","Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to '{0}'."),The_types_of_0_are_incompatible_between_these_types:diag(2200,1,"The_types_of_0_are_incompatible_between_these_types_2200","The types of '{0}' are incompatible between these types."),The_types_returned_by_0_are_incompatible_between_these_types:diag(2201,1,"The_types_returned_by_0_are_incompatible_between_these_types_2201","The types returned by '{0}' are incompatible between these types."),Call_signature_return_types_0_and_1_are_incompatible:diag(2202,1,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,true),Construct_signature_return_types_0_and_1_are_incompatible:diag(2203,1,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,true),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:diag(2204,1,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,true),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:diag(2205,1,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,true),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:diag(2206,1,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:diag(2207,1,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),This_type_parameter_might_need_an_extends_0_constraint:diag(2208,1,"This_type_parameter_might_need_an_extends_0_constraint_2208","This type parameter might need an `extends {0}` constraint."),The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:diag(2209,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209","The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:diag(2210,1,"The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210","The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),Add_extends_constraint:diag(2211,3,"Add_extends_constraint_2211","Add `extends` constraint."),Add_extends_constraint_to_all_type_parameters:diag(2212,3,"Add_extends_constraint_to_all_type_parameters_2212","Add `extends` constraint to all type parameters"),Duplicate_identifier_0:diag(2300,1,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:diag(2301,1,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:diag(2302,1,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:diag(2303,1,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:diag(2304,1,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:diag(2305,1,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:diag(2306,1,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:diag(2307,1,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:diag(2308,1,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:diag(2309,1,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:diag(2310,1,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function:diag(2311,1,"Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311","Cannot find name '{0}'. Did you mean to write this in an async function?"),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:diag(2312,1,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:diag(2313,1,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:diag(2314,1,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:diag(2315,1,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:diag(2316,1,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:diag(2317,1,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:diag(2318,1,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:diag(2319,1,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:diag(2320,1,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:diag(2321,1,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:diag(2322,1,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:diag(2323,1,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:diag(2324,1,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:diag(2325,1,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:diag(2326,1,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:diag(2327,1,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:diag(2328,1,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:diag(2329,1,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:diag(2330,1,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:diag(2331,1,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:diag(2332,1,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_a_static_property_initializer:diag(2334,1,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:diag(2335,1,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:diag(2336,1,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:diag(2337,1,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:diag(2338,1,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:diag(2339,1,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:diag(2340,1,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:diag(2341,1,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:diag(2343,1,"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343","This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),Type_0_does_not_satisfy_the_constraint_1:diag(2344,1,"Type_0_does_not_satisfy_the_constraint_1_2344","Type '{0}' does not satisfy the constraint '{1}'."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:diag(2345,1,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345","Argument of type '{0}' is not assignable to parameter of type '{1}'."),Untyped_function_calls_may_not_accept_type_arguments:diag(2347,1,"Untyped_function_calls_may_not_accept_type_arguments_2347","Untyped function calls may not accept type arguments."),Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:diag(2348,1,"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348","Value of type '{0}' is not callable. Did you mean to include 'new'?"),This_expression_is_not_callable:diag(2349,1,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:diag(2350,1,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:diag(2351,1,"This_expression_is_not_constructable_2351","This expression is not constructable."),Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first:diag(2352,1,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:diag(2353,1,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:diag(2354,1,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value:diag(2355,1,"A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:diag(2356,1,"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356","An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access:diag(2357,1,"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357","The operand of an increment or decrement operator must be a variable or a property access."),The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:diag(2358,1,"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358","The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method:diag(2359,1,"The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_2359","The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method."),The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:diag(2362,1,"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362","The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:diag(2363,1,"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363","The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access:diag(2364,1,"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364","The left-hand side of an assignment expression must be a variable or a property access."),Operator_0_cannot_be_applied_to_types_1_and_2:diag(2365,1,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:diag(2366,1,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap:diag(2367,1,"This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367","This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."),Type_parameter_name_cannot_be_0:diag(2368,1,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:diag(2369,1,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:diag(2370,1,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:diag(2371,1,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:diag(2372,1,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:diag(2373,1,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:diag(2374,1,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:diag(2375,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers:diag(2376,1,"A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376","A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),Constructors_for_derived_classes_must_contain_a_super_call:diag(2377,1,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:diag(2378,1,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:diag(2379,1,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),Overload_signatures_must_all_be_exported_or_non_exported:diag(2383,1,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:diag(2384,1,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:diag(2385,1,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:diag(2386,1,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:diag(2387,1,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:diag(2388,1,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:diag(2389,1,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:diag(2390,1,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:diag(2391,1,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:diag(2392,1,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:diag(2393,1,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:diag(2394,1,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:diag(2395,1,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:diag(2396,1,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:diag(2397,1,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:diag(2398,1,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:diag(2399,1,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:diag(2400,1,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers:diag(2401,1,"A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401","A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:diag(2402,1,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:diag(2403,1,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:diag(2404,1,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:diag(2405,1,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:diag(2406,1,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0:diag(2407,1,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),Setters_cannot_return_a_value:diag(2408,1,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:diag(2409,1,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:diag(2410,1,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:diag(2412,1,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:diag(2411,1,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:diag(2413,1,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:diag(2414,1,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:diag(2415,1,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:diag(2416,1,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:diag(2417,1,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:diag(2418,1,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:diag(2419,1,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:diag(2420,1,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:diag(2422,1,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:diag(2423,1,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:diag(2425,1,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:diag(2426,1,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:diag(2427,1,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:diag(2428,1,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:diag(2430,1,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:diag(2431,1,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:diag(2432,1,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:diag(2433,1,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:diag(2434,1,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:diag(2435,1,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:diag(2436,1,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:diag(2437,1,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:diag(2438,1,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:diag(2439,1,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:diag(2440,1,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:diag(2441,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:diag(2442,1,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:diag(2443,1,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:diag(2444,1,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:diag(2445,1,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:diag(2446,1,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:diag(2447,1,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:diag(2448,1,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:diag(2449,1,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:diag(2450,1,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:diag(2451,1,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:diag(2452,1,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:diag(2454,1,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:diag(2456,1,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:diag(2457,1,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:diag(2458,1,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:diag(2459,1,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:diag(2460,1,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:diag(2461,1,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:diag(2462,1,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:diag(2463,1,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:diag(2464,1,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:diag(2465,1,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:diag(2466,1,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:diag(2467,1,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:diag(2468,1,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:diag(2469,1,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:diag(2472,1,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:diag(2473,1,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_must_be_constant_expressions:diag(2474,1,"const_enum_member_initializers_must_be_constant_expressions_2474","const enum member initializers must be constant expressions."),const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query:diag(2475,1,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:diag(2476,1,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:diag(2477,1,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:diag(2478,1,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:diag(2480,1,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:diag(2481,1,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:diag(2483,1,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:diag(2484,1,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:diag(2487,1,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:diag(2488,1,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:diag(2489,1,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:diag(2490,1,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:diag(2491,1,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:diag(2492,1,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:diag(2493,1,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:diag(2494,1,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:diag(2495,1,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression:diag(2496,1,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_func_2496","The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:diag(2497,1,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:diag(2498,1,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:diag(2499,1,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:diag(2500,1,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:diag(2501,1,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:diag(2502,1,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:diag(2503,1,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:diag(2504,1,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:diag(2505,1,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:diag(2506,1,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:diag(2507,1,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:diag(2508,1,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:diag(2509,1,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:diag(2510,1,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:diag(2511,1,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:diag(2512,1,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:diag(2513,1,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),A_tuple_type_cannot_be_indexed_with_a_negative_value:diag(2514,1,"A_tuple_type_cannot_be_indexed_with_a_negative_value_2514","A tuple type cannot be indexed with a negative value."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:diag(2515,1,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member {1} from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:diag(2516,1,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:diag(2517,1,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:diag(2518,1,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:diag(2519,1,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:diag(2520,1,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method:diag(2522,1,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_sta_2522","The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:diag(2523,1,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:diag(2524,1,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:diag(2526,1,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:diag(2527,1,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:diag(2528,1,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:diag(2529,1,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:diag(2530,1,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:diag(2531,1,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:diag(2532,1,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:diag(2533,1,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:diag(2534,1,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Type_0_cannot_be_used_to_index_type_1:diag(2536,1,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:diag(2537,1,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:diag(2538,1,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:diag(2539,1,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:diag(2540,1,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:diag(2542,1,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:diag(2543,1,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:diag(2544,1,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:diag(2545,1,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:diag(2547,1,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:diag(2548,1,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:diag(2549,1,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:diag(2550,1,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:diag(2551,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:diag(2552,1,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:diag(2553,1,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:diag(2554,1,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:diag(2555,1,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:diag(2556,1,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:diag(2558,1,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:diag(2559,1,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:diag(2560,1,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:diag(2561,1,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:diag(2562,1,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:diag(2563,1,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:diag(2564,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:diag(2565,1,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:diag(2566,1,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:diag(2567,1,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:diag(2568,1,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Could_not_find_name_0_Did_you_mean_1:diag(2570,1,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:diag(2571,1,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:diag(2574,1,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:diag(2575,1,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:diag(2576,1,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:diag(2577,1,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:diag(2578,1,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:diag(2580,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:diag(2581,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha:diag(2582,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:diag(2583,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:diag(2584,1,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later:diag(2585,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),Cannot_assign_to_0_because_it_is_a_constant:diag(2588,1,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:diag(2589,1,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:diag(2590,1,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:diag(2591,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:diag(2592,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:diag(2593,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:diag(2594,1,"This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594","This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:diag(2595,1,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:diag(2596,1,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:diag(2597,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:diag(2598,1,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:diag(2602,1,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:diag(2603,1,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:diag(2604,1,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:diag(2606,1,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:diag(2607,1,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:diag(2608,1,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:diag(2609,1,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:diag(2610,1,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:diag(2611,1,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration:diag(2612,1,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:diag(2613,1,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:diag(2614,1,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:diag(2615,1,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:diag(2616,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:diag(2617,1,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:diag(2618,1,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:diag(2619,1,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:diag(2620,1,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:diag(2621,1,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:diag(2623,1,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:diag(2624,1,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:diag(2625,1,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:diag(2626,1,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:diag(2627,1,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:diag(2628,1,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:diag(2629,1,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:diag(2630,1,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:diag(2631,1,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:diag(2632,1,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:diag(2633,1,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:diag(2634,1,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable:diag(2635,1,"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635","Type '{0}' has no signatures for which the type argument list is applicable."),Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation:diag(2636,1,"Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636","Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types:diag(2637,1,"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637","Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator:diag(2638,1,"Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638","Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),React_components_cannot_include_JSX_namespace_names:diag(2639,1,"React_components_cannot_include_JSX_namespace_names_2639","React components cannot include JSX namespace names"),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:diag(2649,1,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more:diag(2650,1,"Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and__2650","Non-abstract class expression is missing implementations for the following members of '{0}': {1} and {2} more."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:diag(2651,1,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:diag(2652,1,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:diag(2653,1,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2:diag(2654,1,"Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_2654","Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2}."),Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more:diag(2655,1,"Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more_2655","Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2} and {3} more."),Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1:diag(2656,1,"Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_2656","Non-abstract class expression is missing implementations for the following members of '{0}': {1}."),JSX_expressions_must_have_one_parent_element:diag(2657,1,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:diag(2658,1,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:diag(2659,1,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:diag(2660,1,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:diag(2661,1,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:diag(2662,1,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:diag(2663,1,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:diag(2664,1,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:diag(2665,1,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:diag(2666,1,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:diag(2667,1,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:diag(2668,1,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:diag(2669,1,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:diag(2670,1,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:diag(2671,1,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:diag(2672,1,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:diag(2673,1,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:diag(2674,1,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:diag(2675,1,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:diag(2676,1,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:diag(2677,1,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:diag(2678,1,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:diag(2679,1,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:diag(2680,1,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:diag(2681,1,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:diag(2683,1,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:diag(2684,1,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:diag(2685,1,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:diag(2686,1,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:diag(2687,1,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:diag(2688,1,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:diag(2689,1,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:diag(2690,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:diag(2692,1,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:diag(2693,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:diag(2694,1,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:diag(2695,1,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",true),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:diag(2696,1,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:diag(2697,1,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:diag(2698,1,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:diag(2699,1,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:diag(2700,1,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:diag(2701,1,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:diag(2702,1,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:diag(2703,1,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:diag(2704,1,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:diag(2705,1,"An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_2705","An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:diag(2706,1,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:diag(2707,1,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:diag(2708,1,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:diag(2709,1,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:diag(2710,1,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:diag(2711,1,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:diag(2712,1,"A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_t_2712","A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1:diag(2713,1,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713",`Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}["{1}"]'?`),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:diag(2714,1,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:diag(2715,1,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:diag(2716,1,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:diag(2717,1,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:diag(2718,1,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:diag(2719,1,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:diag(2720,1,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:diag(2721,1,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:diag(2722,1,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:diag(2723,1,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:diag(2724,1,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_with_module_0:diag(2725,1,"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 with module {0}."),Cannot_find_lib_definition_for_0:diag(2726,1,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:diag(2727,1,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:diag(2728,3,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:diag(2729,1,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:diag(2730,1,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:diag(2731,1,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:diag(2732,1,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:diag(2733,1,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:diag(2734,1,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:diag(2735,1,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:diag(2736,1,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:diag(2737,1,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:diag(2738,3,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:diag(2739,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:diag(2740,1,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:diag(2741,1,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:diag(2742,1,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:diag(2743,1,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:diag(2744,1,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:diag(2745,1,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:diag(2746,1,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:diag(2747,1,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_0_is_enabled:diag(2748,1,"Cannot_access_ambient_const_enums_when_0_is_enabled_2748","Cannot access ambient const enums when '{0}' is enabled."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:diag(2749,1,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:diag(2750,1,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:diag(2751,1,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:diag(2752,1,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:diag(2753,1,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:diag(2754,1,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:diag(2755,1,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:diag(2756,1,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:diag(2757,1,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:diag(2758,1,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:diag(2759,1,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:diag(2760,1,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:diag(2761,1,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:diag(2762,1,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:diag(2763,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:diag(2764,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:diag(2765,1,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:diag(2766,1,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:diag(2767,1,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:diag(2768,1,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:diag(2769,1,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:diag(2770,1,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:diag(2771,1,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:diag(2772,1,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:diag(2773,1,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:diag(2774,1,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:diag(2775,1,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:diag(2776,1,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:diag(2777,1,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:diag(2778,1,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:diag(2779,1,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:diag(2780,1,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:diag(2781,1,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:diag(2782,3,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:diag(2783,1,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:diag(2784,1,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:diag(2785,1,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:diag(2786,1,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:diag(2787,1,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:diag(2788,1,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:diag(2789,1,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:diag(2790,1,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:diag(2791,1,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:diag(2792,1,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:diag(2793,1,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:diag(2794,1,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:diag(2795,1,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:diag(2796,1,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:diag(2797,1,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:diag(2798,1,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:diag(2799,1,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:diag(2800,1,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:diag(2801,1,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:diag(2802,1,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:diag(2803,1,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:diag(2804,1,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Private_accessor_was_defined_without_a_getter:diag(2806,1,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0:diag(2807,1,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:diag(2808,1,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses:diag(2809,1,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments:diag(2810,1,"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810","Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),Initializer_for_property_0:diag(2811,1,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:diag(2812,1,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:diag(2813,1,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:diag(2814,1,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers:diag(2815,1,"arguments_cannot_be_referenced_in_property_initializers_2815","'arguments' cannot be referenced in property initializers."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:diag(2816,1,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:diag(2817,1,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:diag(2818,1,"Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818","Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),Namespace_name_cannot_be_0:diag(2819,1,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:diag(2820,1,"Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820","Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve:diag(2821,1,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821","Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:diag(2822,1,"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822","Import assertions cannot be used with type-only imports or exports."),Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve:diag(2823,1,"Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2823","Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),Cannot_find_namespace_0_Did_you_mean_1:diag(2833,1,"Cannot_find_namespace_0_Did_you_mean_1_2833","Cannot find namespace '{0}'. Did you mean '{1}'?"),Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path:diag(2834,1,"Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834","Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0:diag(2835,1,"Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835","Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:diag(2836,1,"Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836","Import assertions are not allowed on statements that compile to CommonJS 'require' calls."),Import_assertion_values_must_be_string_literal_expressions:diag(2837,1,"Import_assertion_values_must_be_string_literal_expressions_2837","Import assertion values must be string literal expressions."),All_declarations_of_0_must_have_identical_constraints:diag(2838,1,"All_declarations_of_0_must_have_identical_constraints_2838","All declarations of '{0}' must have identical constraints."),This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value:diag(2839,1,"This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839","This condition will always return '{0}' since JavaScript compares objects by reference, not value."),An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types:diag(2840,1,"An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types_2840","An interface cannot extend a primitive type like '{0}'. It can only extend other named object types."),_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation:diag(2842,1,"_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842","'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here:diag(2843,1,"We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843","We can only write a type for '{0}' by adding a type for the entire parameter here."),Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:diag(2844,1,"Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844","Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),This_condition_will_always_return_0:diag(2845,1,"This_condition_will_always_return_0_2845","This condition will always return '{0}'."),A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead:diag(2846,1,"A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846","A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?"),The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression:diag(2848,1,"The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression_2848","The right-hand side of an 'instanceof' expression must not be an instantiation expression."),Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1:diag(2849,1,"Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1_2849","Target signature provides too few arguments. Expected {0} or more, but got {1}."),The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined:diag(2850,1,"The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_n_2850","The initializer of a 'using' declaration must be either an object with a '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined:diag(2851,1,"The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851","The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:diag(2852,1,"await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852","'await using' statements are only allowed within async functions and at the top levels of modules."),await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:diag(2853,1,"await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853","'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:diag(2854,1,"Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854","Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super:diag(2855,1,"Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855","Class field '{0}' defined by the parent class is not accessible in the child class via super."),Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:diag(2856,1,"Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856","Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),Import_attributes_cannot_be_used_with_type_only_imports_or_exports:diag(2857,1,"Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857","Import attributes cannot be used with type-only imports or exports."),Import_attribute_values_must_be_string_literal_expressions:diag(2858,1,"Import_attribute_values_must_be_string_literal_expressions_2858","Import attribute values must be string literal expressions."),Excessive_complexity_comparing_types_0_and_1:diag(2859,1,"Excessive_complexity_comparing_types_0_and_1_2859","Excessive complexity comparing types '{0}' and '{1}'."),The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method:diag(2860,1,"The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860","The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."),An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression:diag(2861,1,"An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861","An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."),Type_0_is_generic_and_can_only_be_indexed_for_reading:diag(2862,1,"Type_0_is_generic_and_can_only_be_indexed_for_reading_2862","Type '{0}' is generic and can only be indexed for reading."),A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values:diag(2863,1,"A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863","A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types:diag(2864,1,"A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864","A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled:diag(2865,1,"Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865","Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled:diag(2866,1,"Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866","Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun:diag(2867,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867","Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig:diag(2868,1,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868","Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."),Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish:diag(2869,1,"Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish_2869","Right operand of ?? is unreachable because the left operand is never nullish."),This_binary_expression_is_never_nullish_Are_you_missing_parentheses:diag(2870,1,"This_binary_expression_is_never_nullish_Are_you_missing_parentheses_2870","This binary expression is never nullish. Are you missing parentheses?"),This_expression_is_always_nullish:diag(2871,1,"This_expression_is_always_nullish_2871","This expression is always nullish."),This_kind_of_expression_is_always_truthy:diag(2872,1,"This_kind_of_expression_is_always_truthy_2872","This kind of expression is always truthy."),This_kind_of_expression_is_always_falsy:diag(2873,1,"This_kind_of_expression_is_always_falsy_2873","This kind of expression is always falsy."),This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found:diag(2874,1,"This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found_2874","This JSX tag requires '{0}' to be in scope, but it could not be found."),This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed:diag(2875,1,"This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_fo_2875","This JSX tag requires the module path '{0}' to exist, but none could be found. Make sure you have types for the appropriate package installed."),This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0:diag(2876,1,"This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876",'This relative import path is unsafe to rewrite because it looks like a file name, but actually resolves to "{0}".'),This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path:diag(2877,1,"This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877","This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files:diag(2878,1,"This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878","This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found:diag(2879,1,"Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879","Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert:diag(2880,1,"Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880","Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),Import_declaration_0_is_using_private_name_1:diag(4e3,1,"Import_declaration_0_is_using_private_name_1_4000","Import declaration '{0}' is using private name '{1}'."),Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:diag(4002,1,"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002","Type parameter '{0}' of exported class has or is using private name '{1}'."),Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:diag(4004,1,"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004","Type parameter '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:diag(4006,1,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:diag(4008,1,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:diag(4010,1,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:diag(4012,1,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:diag(4014,1,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:diag(4016,1,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:diag(4019,1,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:diag(4020,1,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:diag(4021,1,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:diag(4022,1,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4023,1,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:diag(4024,1,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:diag(4025,1,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4026,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4027,1,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:diag(4028,1,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4029,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4030,1,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:diag(4031,1,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:diag(4032,1,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:diag(4033,1,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4034,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:diag(4035,1,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4036,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:diag(4037,1,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4038,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4039,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:diag(4040,1,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4041,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4042,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:diag(4043,1,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:diag(4044,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:diag(4045,1,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:diag(4046,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:diag(4047,1,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:diag(4048,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:diag(4049,1,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:diag(4050,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:diag(4051,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:diag(4052,1,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:diag(4053,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:diag(4054,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:diag(4055,1,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:diag(4056,1,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:diag(4057,1,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:diag(4058,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:diag(4059,1,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:diag(4060,1,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4061,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4062,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:diag(4063,1,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:diag(4064,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:diag(4065,1,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:diag(4066,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:diag(4067,1,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4068,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4069,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:diag(4070,1,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4071,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4072,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:diag(4073,1,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:diag(4074,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:diag(4075,1,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4076,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:diag(4077,1,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:diag(4078,1,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:diag(4081,1,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:diag(4082,1,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:diag(4083,1,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:diag(4084,1,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1:diag(4085,1,"Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085","Extends clause for inferred type '{0}' has or is using private name '{1}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:diag(4091,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:diag(4092,1,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected:diag(4094,1,"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","Property '{0}' of exported anonymous class type may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4095,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4096,1,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:diag(4097,1,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4098,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:diag(4099,1,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:diag(4100,1,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:diag(4101,1,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:diag(4102,1,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:diag(4103,1,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:diag(4104,1,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:diag(4105,1,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:diag(4106,1,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:diag(4107,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:diag(4108,1,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:diag(4109,1,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:diag(4110,1,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:diag(4111,1,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:diag(4112,1,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:diag(4113,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:diag(4114,1,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:diag(4115,1,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:diag(4116,1,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:diag(4117,1,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:diag(4118,1,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:diag(4119,1,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:diag(4120,1,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:diag(4121,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:diag(4122,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122","This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:diag(4123,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123","This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:diag(4124,1,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given:diag(4125,1,"Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125","Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value:diag(4126,1,"One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126","One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic:diag(4127,1,"This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127","This member cannot have an 'override' modifier because its name is dynamic."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic:diag(4128,1,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128","This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),The_current_host_does_not_support_the_0_option:diag(5001,1,"The_current_host_does_not_support_the_0_option_5001","The current host does not support the '{0}' option."),Cannot_find_the_common_subdirectory_path_for_the_input_files:diag(5009,1,"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009","Cannot find the common subdirectory path for the input files."),File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:diag(5010,1,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:diag(5012,1,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Unknown_compiler_option_0:diag(5023,1,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:diag(5024,1,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:diag(5025,1,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:diag(5033,1,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:diag(5042,1,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:diag(5047,1,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:diag(5051,1,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:diag(5052,1,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:diag(5053,1,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:diag(5054,1,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:diag(5055,1,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:diag(5056,1,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:diag(5057,1,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:diag(5058,1,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:diag(5059,1,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:diag(5061,1,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:diag(5062,1,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:diag(5063,1,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:diag(5064,1,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:diag(5065,1,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:diag(5066,1,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:diag(5067,1,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig:diag(5068,1,"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068","Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),Option_0_cannot_be_specified_without_specifying_option_1_or_option_2:diag(5069,1,"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069","Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic:diag(5070,1,"Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070","Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd:diag(5071,1,"Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd_5071","Option '--resolveJsonModule' cannot be specified when 'module' is set to 'none', 'system', or 'umd'."),Unknown_build_option_0:diag(5072,1,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:diag(5073,1,"Build_option_0_requires_a_value_of_type_1_5073","Build option '{0}' requires a value of type {1}."),Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified:diag(5074,1,"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074","Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:diag(5075,1,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:diag(5076,1,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:diag(5077,1,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:diag(5078,1,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:diag(5079,1,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:diag(5080,1,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:diag(5081,1,"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081","Cannot find a tsconfig.json file at the current directory: {0}."),_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1:diag(5082,1,"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082","'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),Cannot_read_file_0:diag(5083,1,"Cannot_read_file_0_5083","Cannot read file '{0}'."),A_tuple_member_cannot_be_both_optional_and_rest:diag(5085,1,"A_tuple_member_cannot_be_both_optional_and_rest_5085","A tuple member cannot be both optional and rest."),A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type:diag(5086,1,"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086","A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type:diag(5087,1,"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087","A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:diag(5088,1,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:diag(5089,1,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:diag(5090,1,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled:diag(5091,1,"Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."),The_root_value_of_a_0_file_must_be_an_object:diag(5092,1,"The_root_value_of_a_0_file_must_be_an_object_5092","The root value of a '{0}' file must be an object."),Compiler_option_0_may_only_be_used_with_build:diag(5093,1,"Compiler_option_0_may_only_be_used_with_build_5093","Compiler option '--{0}' may only be used with '--build'."),Compiler_option_0_may_not_be_used_with_build:diag(5094,1,"Compiler_option_0_may_not_be_used_with_build_5094","Compiler option '--{0}' may not be used with '--build'."),Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later:diag(5095,1,"Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095","Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."),Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set:diag(5096,1,"Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096","Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled:diag(5097,1,"An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097","An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler:diag(5098,1,"Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098","Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error:diag(5101,1,"Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101",`Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),Option_0_has_been_removed_Please_remove_it_from_your_configuration:diag(5102,1,"Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102","Option '{0}' has been removed. Please remove it from your configuration."),Invalid_value_for_ignoreDeprecations:diag(5103,1,"Invalid_value_for_ignoreDeprecations_5103","Invalid value for '--ignoreDeprecations'."),Option_0_is_redundant_and_cannot_be_specified_with_option_1:diag(5104,1,"Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104","Option '{0}' is redundant and cannot be specified with option '{1}'."),Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System:diag(5105,1,"Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105","Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."),Use_0_instead:diag(5106,3,"Use_0_instead_5106","Use '{0}' instead."),Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error:diag(5107,1,"Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107",`Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`),Option_0_1_has_been_removed_Please_remove_it_from_your_configuration:diag(5108,1,"Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108","Option '{0}={1}' has been removed. Please remove it from your configuration."),Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1:diag(5109,1,"Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109","Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."),Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1:diag(5110,1,"Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110","Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."),Generates_a_sourcemap_for_each_corresponding_d_ts_file:diag(6e3,3,"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000","Generates a sourcemap for each corresponding '.d.ts' file."),Concatenate_and_emit_output_to_single_file:diag(6001,3,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:diag(6002,3,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:diag(6004,3,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:diag(6005,3,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:diag(6006,3,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:diag(6007,3,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:diag(6008,3,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:diag(6009,3,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:diag(6010,3,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:diag(6011,3,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:diag(6012,3,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:diag(6013,3,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:diag(6014,3,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:diag(6015,3,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:diag(6016,3,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:diag(6017,3,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:diag(6019,3,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:diag(6020,3,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:diag(6023,3,"Syntax_Colon_0_6023","Syntax: {0}"),options:diag(6024,3,"options_6024","options"),file:diag(6025,3,"file_6025","file"),Examples_Colon_0:diag(6026,3,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:diag(6027,3,"Options_Colon_6027","Options:"),Version_0:diag(6029,3,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:diag(6030,3,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:diag(6031,3,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:diag(6032,3,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:diag(6034,3,"KIND_6034","KIND"),FILE:diag(6035,3,"FILE_6035","FILE"),VERSION:diag(6036,3,"VERSION_6036","VERSION"),LOCATION:diag(6037,3,"LOCATION_6037","LOCATION"),DIRECTORY:diag(6038,3,"DIRECTORY_6038","DIRECTORY"),STRATEGY:diag(6039,3,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:diag(6040,3,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Errors_Files:diag(6041,3,"Errors_Files_6041","Errors Files"),Generates_corresponding_map_file:diag(6043,3,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:diag(6044,1,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:diag(6045,1,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:diag(6046,1,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:diag(6048,1,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form or -. For example '{0}' or '{1}'."),Unable_to_open_file_0:diag(6050,1,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:diag(6051,1,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:diag(6052,3,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:diag(6053,1,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:diag(6054,1,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:diag(6055,3,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:diag(6056,3,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:diag(6058,3,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:diag(6059,1,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:diag(6060,3,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:diag(6061,3,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:diag(6064,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:diag(6065,3,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:diag(6066,3,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:diag(6070,3,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:diag(6071,3,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:diag(6072,3,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:diag(6073,3,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:diag(6074,3,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:diag(6075,3,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:diag(6076,3,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:diag(6077,3,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:diag(6078,3,"Disallow_inconsistently_cased_references_to_the_same_file_6078","Disallow inconsistently-cased references to the same file."),Specify_library_files_to_be_included_in_the_compilation:diag(6079,3,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:diag(6080,3,"Specify_JSX_code_generation_6080","Specify JSX code generation."),Only_amd_and_system_modules_are_supported_alongside_0:diag(6082,1,"Only_amd_and_system_modules_are_supported_alongside_0_6082","Only 'amd' and 'system' modules are supported alongside --{0}."),Base_directory_to_resolve_non_absolute_module_names:diag(6083,3,"Base_directory_to_resolve_non_absolute_module_names_6083","Base directory to resolve non-absolute module names."),Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit:diag(6084,3,"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084","[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),Enable_tracing_of_the_name_resolution_process:diag(6085,3,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:diag(6086,3,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:diag(6087,3,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:diag(6088,3,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:diag(6089,3,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:diag(6090,3,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:diag(6091,3,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:diag(6092,3,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:diag(6093,3,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:diag(6094,3,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1:diag(6095,3,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095","Loading module as file / folder, candidate module location '{0}', target file types: {1}."),File_0_does_not_exist:diag(6096,3,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exists_use_it_as_a_name_resolution_result:diag(6097,3,"File_0_exists_use_it_as_a_name_resolution_result_6097","File '{0}' exists - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_types_Colon_1:diag(6098,3,"Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098","Loading module '{0}' from 'node_modules' folder, target file types: {1}."),Found_package_json_at_0:diag(6099,3,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:diag(6100,3,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:diag(6101,3,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:diag(6102,3,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:diag(6104,3,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:diag(6105,3,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:diag(6106,3,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:diag(6107,3,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:diag(6108,3,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:diag(6109,3,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:diag(6110,3,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:diag(6111,3,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:diag(6112,3,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:diag(6113,3,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:diag(6114,1,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:diag(6115,3,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:diag(6116,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:diag(6119,3,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:diag(6120,3,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:diag(6121,3,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:diag(6122,3,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:diag(6123,3,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:diag(6124,3,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:diag(6125,3,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:diag(6126,3,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:diag(6127,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:diag(6128,3,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:diag(6130,3,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:diag(6131,1,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:diag(6132,3,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:diag(6133,1,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",true),Report_errors_on_unused_locals:diag(6134,3,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:diag(6135,3,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:diag(6136,3,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:diag(6137,1,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:diag(6138,1,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",true),Import_emit_helpers_from_tslib:diag(6139,3,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:diag(6140,1,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:diag(6141,3,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:diag(6142,1,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:diag(6144,3,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:diag(6146,3,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:diag(6147,3,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:diag(6148,3,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:diag(6149,3,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:diag(6150,3,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:diag(6151,3,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:diag(6152,3,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:diag(6153,3,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:diag(6154,3,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:diag(6155,3,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:diag(6156,3,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:diag(6157,3,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:diag(6158,3,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:diag(6159,3,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:diag(6160,3,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:diag(6161,3,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:diag(6162,3,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:diag(6163,3,"The_character_set_of_the_input_files_6163","The character set of the input files."),Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1:diag(6164,3,"Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1_6164","Skipping module '{0}' that looks like an absolute URI, target file types: {1}."),Do_not_truncate_error_messages:diag(6165,3,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:diag(6166,3,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:diag(6167,3,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:diag(6168,3,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:diag(6169,3,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:diag(6170,3,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:diag(6171,3,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5:diag(6179,3,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5'."),Enable_all_strict_type_checking_options:diag(6180,3,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),Scoped_package_detected_looking_in_0:diag(6182,3,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:diag(6183,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:diag(6184,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:diag(6186,3,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:diag(6187,3,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:diag(6188,1,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:diag(6189,1,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:diag(6191,3,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:diag(6192,1,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",true),Found_1_error_Watching_for_file_changes:diag(6193,3,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:diag(6194,3,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:diag(6195,3,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:diag(6196,1,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",true),Include_modules_imported_with_json_extension:diag(6197,3,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:diag(6198,1,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",true),All_variables_are_unused:diag(6199,1,"All_variables_are_unused_6199","All variables are unused.",true),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:diag(6200,1,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:diag(6201,3,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:diag(6202,1,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:diag(6203,3,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:diag(6204,3,"and_here_6204","and here."),All_type_parameters_are_unused:diag(6205,1,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:diag(6206,3,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:diag(6207,3,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:diag(6208,3,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:diag(6209,3,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:diag(6210,3,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:diag(6211,3,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:diag(6212,3,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:diag(6213,3,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:diag(6214,3,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:diag(6215,3,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:diag(6216,3,"Found_1_error_6216","Found 1 error."),Found_0_errors:diag(6217,3,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:diag(6218,3,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:diag(6219,3,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:diag(6220,3,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:diag(6221,3,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:diag(6222,3,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:diag(6223,3,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:diag(6224,3,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:diag(6225,3,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:diag(6226,3,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:diag(6227,3,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:diag(6229,1,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:diag(6230,1,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:diag(6231,1,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:diag(6232,1,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:diag(6233,1,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:diag(6234,1,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:diag(6235,3,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:diag(6236,1,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:diag(6237,3,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:diag(6238,1,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:diag(6239,3,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:diag(6240,3,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:diag(6241,3,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:diag(6242,3,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:diag(6243,3,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:diag(6244,3,"Modules_6244","Modules"),File_Management:diag(6245,3,"File_Management_6245","File Management"),Emit:diag(6246,3,"Emit_6246","Emit"),JavaScript_Support:diag(6247,3,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:diag(6248,3,"Type_Checking_6248","Type Checking"),Editor_Support:diag(6249,3,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:diag(6250,3,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:diag(6251,3,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:diag(6252,3,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:diag(6253,3,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:diag(6254,3,"Language_and_Environment_6254","Language and Environment"),Projects:diag(6255,3,"Projects_6255","Projects"),Output_Formatting:diag(6256,3,"Output_Formatting_6256","Output Formatting"),Completeness:diag(6257,3,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:diag(6258,1,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Found_1_error_in_0:diag(6259,3,"Found_1_error_in_0_6259","Found 1 error in {0}"),Found_0_errors_in_the_same_file_starting_at_Colon_1:diag(6260,3,"Found_0_errors_in_the_same_file_starting_at_Colon_1_6260","Found {0} errors in the same file, starting at: {1}"),Found_0_errors_in_1_files:diag(6261,3,"Found_0_errors_in_1_files_6261","Found {0} errors in {1} files."),File_name_0_has_a_1_extension_looking_up_2_instead:diag(6262,3,"File_name_0_has_a_1_extension_looking_up_2_instead_6262","File name '{0}' has a '{1}' extension - looking up '{2}' instead."),Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set:diag(6263,1,"Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263","Module '{0}' was resolved to '{1}', but '--allowArbitraryExtensions' is not set."),Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present:diag(6264,3,"Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264","Enable importing files with any extension, provided a declaration file is present."),Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder:diag(6265,3,"Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_no_6265","Resolving type reference directive for program that specifies custom typeRoots, skipping lookup in 'node_modules' folder."),Option_0_can_only_be_specified_on_command_line:diag(6266,1,"Option_0_can_only_be_specified_on_command_line_6266","Option '{0}' can only be specified on command line."),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:diag(6270,3,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:diag(6271,3,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:diag(6272,3,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:diag(6273,3,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:diag(6274,3,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:diag(6275,3,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:diag(6276,3,"Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276","Export specifier '{0}' does not exist in package.json scope at path '{1}'."),Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update:diag(6277,3,"Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277","Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings:diag(6278,3,"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278",`There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update:diag(6279,3,"Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279","Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler:diag(6280,3,"There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280","There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),package_json_has_a_peerDependencies_field:diag(6281,3,"package_json_has_a_peerDependencies_field_6281","'package.json' has a 'peerDependencies' field."),Found_peerDependency_0_with_1_version:diag(6282,3,"Found_peerDependency_0_with_1_version_6282","Found peerDependency '{0}' with '{1}' version."),Failed_to_find_peerDependency_0:diag(6283,3,"Failed_to_find_peerDependency_0_6283","Failed to find peerDependency '{0}'."),Enable_project_compilation:diag(6302,3,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:diag(6304,1,"Composite_projects_may_not_disable_declaration_emit_6304","Composite projects may not disable declaration emit."),Output_file_0_has_not_been_built_from_source_file_1:diag(6305,1,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:diag(6306,1,"Referenced_project_0_must_have_setting_composite_Colon_true_6306",`Referenced project '{0}' must have setting "composite": true.`),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:diag(6307,1,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Referenced_project_0_may_not_disable_emit:diag(6310,1,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_output_1_is_older_than_input_2:diag(6350,3,"Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350","Project '{0}' is out of date because output '{1}' is older than input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2:diag(6351,3,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:diag(6352,3,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:diag(6353,3,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:diag(6354,3,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:diag(6355,3,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:diag(6356,3,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:diag(6357,3,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:diag(6358,3,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:diag(6359,3,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:diag(6361,3,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:diag(6362,3,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:diag(6363,3,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:diag(6364,3,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:diag(6365,3,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects."),Show_what_would_be_built_or_deleted_if_specified_with_clean:diag(6367,3,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:diag(6369,1,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:diag(6370,1,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:diag(6371,3,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:diag(6374,3,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:diag(6377,1,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Composite_projects_may_not_disable_incremental_compilation:diag(6379,1,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:diag(6380,3,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:diag(6381,3,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:diag(6382,3,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:diag(6383,3,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:diag(6384,3,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:diag(6385,2,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,true),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:diag(6386,3,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:diag(6387,2,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,true),Project_0_is_being_forcibly_rebuilt:diag(6388,3,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:diag(6389,3,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:diag(6390,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:diag(6391,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:diag(6392,3,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:diag(6393,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:diag(6394,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:diag(6395,3,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:diag(6396,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:diag(6397,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:diag(6398,3,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted:diag(6399,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399","Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"),Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files:diag(6400,3,"Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400","Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"),Project_0_is_out_of_date_because_there_was_error_reading_file_1:diag(6401,3,"Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401","Project '{0}' is out of date because there was error reading file '{1}'"),Resolving_in_0_mode_with_conditions_1:diag(6402,3,"Resolving_in_0_mode_with_conditions_1_6402","Resolving in {0} mode with conditions {1}."),Matched_0_condition_1:diag(6403,3,"Matched_0_condition_1_6403","Matched '{0}' condition '{1}'."),Using_0_subpath_1_with_target_2:diag(6404,3,"Using_0_subpath_1_with_target_2_6404","Using '{0}' subpath '{1}' with target '{2}'."),Saw_non_matching_condition_0:diag(6405,3,"Saw_non_matching_condition_0_6405","Saw non-matching condition '{0}'."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions:diag(6406,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406","Project '{0}' is out of date because buildinfo file '{1}' indicates there is change in compilerOptions"),Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set:diag(6407,3,"Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407","Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."),Use_the_package_json_exports_field_when_resolving_package_imports:diag(6408,3,"Use_the_package_json_exports_field_when_resolving_package_imports_6408","Use the package.json 'exports' field when resolving package imports."),Use_the_package_json_imports_field_when_resolving_imports:diag(6409,3,"Use_the_package_json_imports_field_when_resolving_imports_6409","Use the package.json 'imports' field when resolving imports."),Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports:diag(6410,3,"Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410","Conditions to set in addition to the resolver-specific defaults when resolving imports."),true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false:diag(6411,3,"true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411","`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more:diag(6412,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412","Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."),Entering_conditional_exports:diag(6413,3,"Entering_conditional_exports_6413","Entering conditional exports."),Resolved_under_condition_0:diag(6414,3,"Resolved_under_condition_0_6414","Resolved under condition '{0}'."),Failed_to_resolve_under_condition_0:diag(6415,3,"Failed_to_resolve_under_condition_0_6415","Failed to resolve under condition '{0}'."),Exiting_conditional_exports:diag(6416,3,"Exiting_conditional_exports_6416","Exiting conditional exports."),Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0:diag(6417,3,"Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417","Searching all ancestor node_modules directories for preferred extensions: {0}."),Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0:diag(6418,3,"Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418","Searching all ancestor node_modules directories for fallback extensions: {0}."),Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors:diag(6419,3,"Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419","Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),Project_0_is_out_of_date_because_1:diag(6420,3,"Project_0_is_out_of_date_because_1_6420","Project '{0}' is out of date because {1}."),Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files:diag(6421,3,"Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421","Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:diag(6500,3,"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500","The expected type comes from property '{0}' which is declared here on type '{1}'"),The_expected_type_comes_from_this_index_signature:diag(6501,3,"The_expected_type_comes_from_this_index_signature_6501","The expected type comes from this index signature."),The_expected_type_comes_from_the_return_type_of_this_signature:diag(6502,3,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:diag(6503,3,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:diag(6504,1,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:diag(6505,3,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:diag(6506,3,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files:diag(6600,3,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:diag(6601,3,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:diag(6602,3,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:diag(6603,3,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:diag(6604,3,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:diag(6605,3,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:diag(6606,3,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:diag(6607,3,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:diag(6608,3,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:diag(6609,3,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:diag(6611,3,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:diag(6612,3,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:diag(6613,3,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:diag(6614,3,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:diag(6615,3,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:diag(6616,3,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:diag(6617,3,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:diag(6618,3,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:diag(6619,3,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:diag(6620,3,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects."),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:diag(6621,3,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:diag(6622,3,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:diag(6623,3,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:diag(6624,3,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:diag(6625,3,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:diag(6626,3,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),Filters_results_from_the_include_option:diag(6627,3,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:diag(6628,3,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:diag(6629,3,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_legacy_experimental_decorators:diag(6630,3,"Enable_experimental_support_for_legacy_experimental_decorators_6630","Enable experimental support for legacy experimental decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:diag(6631,3,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:diag(6632,3,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:diag(6633,3,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:diag(6634,3,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:diag(6635,3,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:diag(6636,3,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date."),Ensure_that_casing_is_correct_in_imports:diag(6637,3,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:diag(6638,3,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:diag(6639,3,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Skip_building_downstream_projects_on_error_in_upstream_project:diag(6640,3,"Skip_building_downstream_projects_on_error_in_upstream_project_6640","Skip building downstream projects on error in upstream project."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:diag(6641,3,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:diag(6642,3,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:diag(6643,3,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:diag(6644,3,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:diag(6645,3,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:diag(6646,3,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:diag(6647,3,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:diag(6648,3,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:diag(6649,3,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:diag(6650,3,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:diag(6651,3,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:diag(6652,3,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:diag(6653,3,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:diag(6654,3,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:diag(6655,3,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:diag(6656,3,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),Specify_what_module_code_is_generated:diag(6657,3,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:diag(6658,3,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:diag(6659,3,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:diag(6660,3,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:diag(6661,3,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like '__extends' in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:diag(6662,3,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:diag(6663,3,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:diag(6664,3,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:diag(6665,3,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied 'any' type."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:diag(6666,3,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:diag(6667,3,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:diag(6668,3,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when 'this' is given the type 'any'."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:diag(6669,3,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:diag(6670,3,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:diag(6671,3,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type."),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:diag(6672,3,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:diag(6673,3,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:diag(6674,3,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add 'undefined' to a type when accessed using an index."),Enable_error_reporting_when_local_variables_aren_t_read:diag(6675,3,"Enable_error_reporting_when_local_variables_aren_t_read_6675","Enable error reporting when local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:diag(6676,3,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read."),Deprecated_setting_Use_outFile_instead:diag(6677,3,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use 'outFile' instead."),Specify_an_output_folder_for_all_emitted_files:diag(6678,3,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:diag(6679,3,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:diag(6680,3,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:diag(6681,3,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:diag(6682,3,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing 'const enum' declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:diag(6683,3,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:diag(6684,3,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode."),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:diag(6685,3,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read."),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:diag(6686,3,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:diag(6687,3,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:diag(6688,3,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:diag(6689,3,"Enable_importing_json_files_6689","Enable importing .json files."),Specify_the_root_folder_within_your_source_files:diag(6690,3,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:diag(6691,3,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:diag(6692,3,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:diag(6693,3,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:diag(6694,3,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:diag(6695,3,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:diag(6697,3,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:diag(6698,3,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:diag(6699,3,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account 'null' and 'undefined'."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:diag(6700,3,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:diag(6701,3,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have '@internal' in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:diag(6702,3,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:diag(6703,3,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:diag(6704,3,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:diag(6705,3,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:diag(6706,3,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the 'moduleResolution' process."),Specify_the_path_to_tsbuildinfo_incremental_compilation_file:diag(6707,3,"Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707","Specify the path to .tsbuildinfo incremental compilation file."),Specify_options_for_automatic_acquisition_of_declaration_files:diag(6709,3,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:diag(6710,3,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like './node_modules/@types'."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:diag(6711,3,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:diag(6712,3,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:diag(6713,3,"Enable_verbose_logging_6713","Enable verbose logging."),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:diag(6714,3,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:diag(6715,3,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:diag(6717,3,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:diag(6718,3,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types."),Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files:diag(6719,3,"Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719","Require sufficient annotation on exports so other tools can trivially generate declaration files."),Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any:diag(6720,3,"Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720","Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript:diag(6721,3,"Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721","Do not allow runtime constructs that are not part of ECMAScript."),Default_catch_clause_variables_as_unknown_instead_of_any:diag(6803,3,"Default_catch_clause_variables_as_unknown_instead_of_any_6803","Default catch clause variables as 'unknown' instead of 'any'."),Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting:diag(6804,3,"Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804","Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported:diag(6805,3,"Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805","Disable full type checking (only critical parse and emit errors will be reported)."),Check_side_effect_imports:diag(6806,3,"Check_side_effect_imports_6806","Check side effect imports."),This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2:diag(6807,1,"This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807","This operation can be simplified. This shift is identical to `{0} {1} {2}`."),Enable_lib_replacement:diag(6808,3,"Enable_lib_replacement_6808","Enable lib replacement."),one_of_Colon:diag(6900,3,"one_of_Colon_6900","one of:"),one_or_more_Colon:diag(6901,3,"one_or_more_Colon_6901","one or more:"),type_Colon:diag(6902,3,"type_Colon_6902","type:"),default_Colon:diag(6903,3,"default_Colon_6903","default:"),module_system_or_esModuleInterop:diag(6904,3,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:diag(6905,3,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:diag(6906,3,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:diag(6907,3,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:diag(6908,3,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:diag(6909,3,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:diag(69010,3,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:diag(6911,3,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:diag(6912,3,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:diag(6913,3,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:diag(6914,3,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:diag(6915,3,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:diag(6916,3,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:diag(6917,3,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:diag(6918,3,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:diag(6919,3,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:diag(6920,3,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:diag(6921,3,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:diag(6922,3,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:diag(6923,3,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:diag(6924,3,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:diag(6925,3,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:diag(6926,3,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:diag(6927,3,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:diag(6928,3,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:diag(6929,3,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:diag(6930,3,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),List_of_file_name_suffixes_to_search_when_resolving_a_module:diag(6931,1,"List_of_file_name_suffixes_to_search_when_resolving_a_module_6931","List of file name suffixes to search when resolving a module."),Variable_0_implicitly_has_an_1_type:diag(7005,1,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:diag(7006,1,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:diag(7008,1,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:diag(7009,1,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:diag(7010,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:diag(7011,1,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation:diag(7012,1,"This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012","This overload implicitly returns the type '{0}' because it lacks a return type annotation."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:diag(7013,1,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:diag(7014,1,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:diag(7015,1,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:diag(7016,1,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:diag(7017,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:diag(7018,1,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:diag(7019,1,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:diag(7020,1,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:diag(7022,1,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:diag(7023,1,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:diag(7024,1,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation:diag(7025,1,"Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation_7025","Generator implicitly has yield type '{0}'. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:diag(7026,1,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:diag(7027,1,"Unreachable_code_detected_7027","Unreachable code detected.",true),Unused_label:diag(7028,1,"Unused_label_7028","Unused label.",true),Fallthrough_case_in_switch:diag(7029,1,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:diag(7030,1,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:diag(7031,1,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:diag(7032,1,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:diag(7033,1,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:diag(7034,1,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:diag(7035,1,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:diag(7036,1,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:diag(7037,3,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead:diag(7038,3,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),Mapped_object_type_implicitly_has_an_any_template_type:diag(7039,1,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:diag(7040,1,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:diag(7041,1,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:diag(7042,1,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:diag(7043,2,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:diag(7044,2,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:diag(7045,2,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:diag(7046,2,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:diag(7047,2,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:diag(7048,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:diag(7049,2,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:diag(7050,2,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:diag(7051,1,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:diag(7052,1,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:diag(7053,1,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:diag(7054,1,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:diag(7055,1,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:diag(7056,1,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:diag(7057,1,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:diag(7058,1,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:diag(7059,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:diag(7060,1,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:diag(7061,1,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),You_cannot_rename_this_element:diag(8e3,1,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:diag(8001,1,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:diag(8002,1,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:diag(8003,1,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:diag(8004,1,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:diag(8005,1,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:diag(8006,1,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:diag(8008,1,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:diag(8009,1,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:diag(8010,1,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:diag(8011,1,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:diag(8012,1,"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012","Parameter modifiers can only be used in TypeScript files."),Non_null_assertions_can_only_be_used_in_TypeScript_files:diag(8013,1,"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013","Non-null assertions can only be used in TypeScript files."),Type_assertion_expressions_can_only_be_used_in_TypeScript_files:diag(8016,1,"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016","Type assertion expressions can only be used in TypeScript files."),Signature_declarations_can_only_be_used_in_TypeScript_files:diag(8017,1,"Signature_declarations_can_only_be_used_in_TypeScript_files_8017","Signature declarations can only be used in TypeScript files."),Report_errors_in_js_files:diag(8019,3,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:diag(8020,1,"JSDoc_types_can_only_be_used_inside_documentation_comments_8020","JSDoc types can only be used inside documentation comments."),JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags:diag(8021,1,"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021","JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),JSDoc_0_is_not_attached_to_a_class:diag(8022,1,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:diag(8023,1,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:diag(8024,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:diag(8025,1,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:diag(8026,1,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:diag(8027,1,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:diag(8028,1,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:diag(8029,1,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:diag(8030,1,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:diag(8031,1,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:diag(8032,1,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:diag(8033,1,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:diag(8034,1,"The_tag_was_first_specified_here_8034","The tag was first specified here."),You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder:diag(8035,1,"You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035","You cannot rename elements that are defined in a 'node_modules' folder."),You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder:diag(8036,1,"You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036","You cannot rename elements that are defined in another 'node_modules' folder."),Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files:diag(8037,1,"Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037","Type satisfaction expressions can only be used in TypeScript files."),Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export:diag(8038,1,"Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038","Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag:diag(8039,1,"A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039","A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:diag(9005,1,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:diag(9006,1,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations:diag(9007,1,"Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9007","Function must have an explicit return type annotation with --isolatedDeclarations."),Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations:diag(9008,1,"Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9008","Method must have an explicit return type annotation with --isolatedDeclarations."),At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations:diag(9009,1,"At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9009","At least one accessor must have an explicit type annotation with --isolatedDeclarations."),Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations:diag(9010,1,"Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9010","Variable must have an explicit type annotation with --isolatedDeclarations."),Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations:diag(9011,1,"Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9011","Parameter must have an explicit type annotation with --isolatedDeclarations."),Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations:diag(9012,1,"Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9012","Property must have an explicit type annotation with --isolatedDeclarations."),Expression_type_can_t_be_inferred_with_isolatedDeclarations:diag(9013,1,"Expression_type_can_t_be_inferred_with_isolatedDeclarations_9013","Expression type can't be inferred with --isolatedDeclarations."),Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations:diag(9014,1,"Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedD_9014","Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations."),Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations:diag(9015,1,"Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations_9015","Objects that contain spread assignments can't be inferred with --isolatedDeclarations."),Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations:diag(9016,1,"Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations_9016","Objects that contain shorthand properties can't be inferred with --isolatedDeclarations."),Only_const_arrays_can_be_inferred_with_isolatedDeclarations:diag(9017,1,"Only_const_arrays_can_be_inferred_with_isolatedDeclarations_9017","Only const arrays can be inferred with --isolatedDeclarations."),Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations:diag(9018,1,"Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations_9018","Arrays with spread elements can't inferred with --isolatedDeclarations."),Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations:diag(9019,1,"Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations_9019","Binding elements can't be exported directly with --isolatedDeclarations."),Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations:diag(9020,1,"Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDecl_9020","Enum member initializers must be computable without references to external symbols with --isolatedDeclarations."),Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations:diag(9021,1,"Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations_9021","Extends clause can't contain an expression with --isolatedDeclarations."),Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations:diag(9022,1,"Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations_9022","Inference from class expressions is not supported with --isolatedDeclarations."),Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function:diag(9023,1,"Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations__9023","Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function."),Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations:diag(9025,1,"Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_sup_9025","Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations."),Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations:diag(9026,1,"Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_support_9026","Declaration emit for this file requires preserving this import for augmentations. This is not supported with --isolatedDeclarations."),Add_a_type_annotation_to_the_variable_0:diag(9027,1,"Add_a_type_annotation_to_the_variable_0_9027","Add a type annotation to the variable {0}."),Add_a_type_annotation_to_the_parameter_0:diag(9028,1,"Add_a_type_annotation_to_the_parameter_0_9028","Add a type annotation to the parameter {0}."),Add_a_type_annotation_to_the_property_0:diag(9029,1,"Add_a_type_annotation_to_the_property_0_9029","Add a type annotation to the property {0}."),Add_a_return_type_to_the_function_expression:diag(9030,1,"Add_a_return_type_to_the_function_expression_9030","Add a return type to the function expression."),Add_a_return_type_to_the_function_declaration:diag(9031,1,"Add_a_return_type_to_the_function_declaration_9031","Add a return type to the function declaration."),Add_a_return_type_to_the_get_accessor_declaration:diag(9032,1,"Add_a_return_type_to_the_get_accessor_declaration_9032","Add a return type to the get accessor declaration."),Add_a_type_to_parameter_of_the_set_accessor_declaration:diag(9033,1,"Add_a_type_to_parameter_of_the_set_accessor_declaration_9033","Add a type to parameter of the set accessor declaration."),Add_a_return_type_to_the_method:diag(9034,1,"Add_a_return_type_to_the_method_9034","Add a return type to the method"),Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit:diag(9035,1,"Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit_9035","Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit."),Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it:diag(9036,1,"Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036","Move the expression in default export to a variable and add a type annotation to it."),Default_exports_can_t_be_inferred_with_isolatedDeclarations:diag(9037,1,"Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037","Default exports can't be inferred with --isolatedDeclarations."),Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations:diag(9038,1,"Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations_9038","Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."),Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations:diag(9039,1,"Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039","Type containing private name '{0}' can't be used with --isolatedDeclarations."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:diag(17e3,1,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:diag(17001,1,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:diag(17002,1,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:diag(17004,1,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:diag(17005,1,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:diag(17006,1,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:diag(17007,1,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:diag(17008,1,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:diag(17009,1,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:diag(17010,1,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:diag(17011,1,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:diag(17012,1,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:diag(17013,1,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:diag(17014,1,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:diag(17015,1,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:diag(17016,1,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:diag(17017,1,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:diag(17018,1,"Unknown_type_acquisition_option_0_Did_you_mean_1_17018","Unknown type acquisition option '{0}'. Did you mean '{1}'?"),_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:diag(17019,1,"_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17019","'{0}' at the end of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:diag(17020,1,"_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17020","'{0}' at the start of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"),Unicode_escape_sequence_cannot_appear_here:diag(17021,1,"Unicode_escape_sequence_cannot_appear_here_17021","Unicode escape sequence cannot appear here."),Circularity_detected_while_resolving_configuration_Colon_0:diag(18e3,1,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:diag(18002,1,"The_files_list_in_config_file_0_is_empty_18002","The 'files' list in config file '{0}' is empty."),No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2:diag(18003,1,"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003","No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:diag(80001,2,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:diag(80002,2,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:diag(80003,2,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:diag(80004,2,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:diag(80005,2,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:diag(80006,2,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:diag(80007,2,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:diag(80008,2,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),JSDoc_typedef_may_be_converted_to_TypeScript_type:diag(80009,2,"JSDoc_typedef_may_be_converted_to_TypeScript_type_80009","JSDoc typedef may be converted to TypeScript type."),JSDoc_typedefs_may_be_converted_to_TypeScript_types:diag(80010,2,"JSDoc_typedefs_may_be_converted_to_TypeScript_types_80010","JSDoc typedefs may be converted to TypeScript types."),Add_missing_super_call:diag(90001,3,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:diag(90002,3,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:diag(90003,3,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:diag(90004,3,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:diag(90005,3,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:diag(90006,3,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:diag(90007,3,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:diag(90008,3,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:diag(90010,3,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:diag(90011,3,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:diag(90012,3,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_1:diag(90013,3,"Import_0_from_1_90013",`Import '{0}' from "{1}"`),Change_0_to_1:diag(90014,3,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Declare_property_0:diag(90016,3,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:diag(90017,3,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:diag(90018,3,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:diag(90019,3,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:diag(90020,3,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:diag(90021,3,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:diag(90022,3,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:diag(90023,3,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:diag(90024,3,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:diag(90025,3,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:diag(90026,3,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:diag(90027,3,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:diag(90028,3,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:diag(90029,3,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:diag(90030,3,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:diag(90031,3,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Add_parameter_name:diag(90034,3,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:diag(90035,3,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:diag(90036,3,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:diag(90037,3,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:diag(90038,3,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:diag(90039,3,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:diag(90041,3,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:diag(90053,3,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:diag(90054,3,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Remove_type_from_import_declaration_from_0:diag(90055,3,"Remove_type_from_import_declaration_from_0_90055",`Remove 'type' from import declaration from "{0}"`),Remove_type_from_import_of_0_from_1:diag(90056,3,"Remove_type_from_import_of_0_from_1_90056",`Remove 'type' from import of '{0}' from "{1}"`),Add_import_from_0:diag(90057,3,"Add_import_from_0_90057",'Add import from "{0}"'),Update_import_from_0:diag(90058,3,"Update_import_from_0_90058",'Update import from "{0}"'),Export_0_from_module_1:diag(90059,3,"Export_0_from_module_1_90059","Export '{0}' from module '{1}'"),Export_all_referenced_locals:diag(90060,3,"Export_all_referenced_locals_90060","Export all referenced locals"),Update_modifiers_of_0:diag(90061,3,"Update_modifiers_of_0_90061","Update modifiers of '{0}'"),Add_annotation_of_type_0:diag(90062,3,"Add_annotation_of_type_0_90062","Add annotation of type '{0}'"),Add_return_type_0:diag(90063,3,"Add_return_type_0_90063","Add return type '{0}'"),Extract_base_class_to_variable:diag(90064,3,"Extract_base_class_to_variable_90064","Extract base class to variable"),Extract_default_export_to_variable:diag(90065,3,"Extract_default_export_to_variable_90065","Extract default export to variable"),Extract_binding_expressions_to_variable:diag(90066,3,"Extract_binding_expressions_to_variable_90066","Extract binding expressions to variable"),Add_all_missing_type_annotations:diag(90067,3,"Add_all_missing_type_annotations_90067","Add all missing type annotations"),Add_satisfies_and_an_inline_type_assertion_with_0:diag(90068,3,"Add_satisfies_and_an_inline_type_assertion_with_0_90068","Add satisfies and an inline type assertion with '{0}'"),Extract_to_variable_and_replace_with_0_as_typeof_0:diag(90069,3,"Extract_to_variable_and_replace_with_0_as_typeof_0_90069","Extract to variable and replace with '{0} as typeof {0}'"),Mark_array_literal_as_const:diag(90070,3,"Mark_array_literal_as_const_90070","Mark array literal as const"),Annotate_types_of_properties_expando_function_in_a_namespace:diag(90071,3,"Annotate_types_of_properties_expando_function_in_a_namespace_90071","Annotate types of properties expando function in a namespace"),Convert_function_to_an_ES2015_class:diag(95001,3,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:diag(95003,3,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:diag(95004,3,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:diag(95005,3,"Extract_function_95005","Extract function"),Extract_constant:diag(95006,3,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:diag(95007,3,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:diag(95008,3,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:diag(95009,3,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:diag(95011,3,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:diag(95012,3,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:diag(95013,3,"Convert_to_default_import_95013","Convert to default import"),Install_0:diag(95014,3,"Install_0_95014","Install '{0}'"),Replace_import_with_0:diag(95015,3,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:diag(95016,3,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:diag(95017,3,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:diag(95018,3,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:diag(95019,3,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:diag(95020,3,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:diag(95021,3,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:diag(95022,3,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:diag(95023,3,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:diag(95024,3,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:diag(95025,3,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:diag(95026,3,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:diag(95027,3,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:diag(95028,3,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:diag(95029,3,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:diag(95030,3,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:diag(95031,3,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:diag(95032,3,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:diag(95033,3,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:diag(95034,3,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:diag(95035,3,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:diag(95036,3,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:diag(95037,3,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:diag(95038,3,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:diag(95039,3,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:diag(95040,3,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:diag(95041,3,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:diag(95042,3,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:diag(95043,3,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:diag(95044,3,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:diag(95045,3,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:diag(95046,3,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:diag(95047,3,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:diag(95048,3,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:diag(95049,3,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:diag(95050,3,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:diag(95051,3,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:diag(95052,3,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:diag(95053,3,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:diag(95054,3,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:diag(95055,3,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:diag(95056,3,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:diag(95057,3,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:diag(95058,3,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:diag(95059,3,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:diag(95060,3,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:diag(95061,3,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:diag(95062,3,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:diag(95063,3,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:diag(95064,3,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:diag(95065,3,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:diag(95066,3,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:diag(95067,3,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:diag(95068,3,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:diag(95069,3,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:diag(95070,3,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:diag(95071,3,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:diag(95072,3,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:diag(95073,3,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:diag(95074,3,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:diag(95075,3,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:diag(95077,3,"Extract_type_95077","Extract type"),Extract_to_type_alias:diag(95078,3,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:diag(95079,3,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:diag(95080,3,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:diag(95081,3,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:diag(95082,3,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:diag(95083,3,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:diag(95084,3,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:diag(95085,3,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:diag(95086,3,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:diag(95087,3,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:diag(95088,3,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:diag(95089,3,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:diag(95090,3,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:diag(95091,3,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:diag(95092,3,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:diag(95093,3,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:diag(95094,3,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:diag(95095,3,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:diag(95096,3,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:diag(95097,3,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:diag(95098,3,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:diag(95099,3,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:diag(95100,3,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:diag(95101,3,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_all_const_to_let:diag(95102,3,"Convert_all_const_to_let_95102","Convert all 'const' to 'let'"),Convert_function_expression_0_to_arrow_function:diag(95105,3,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:diag(95106,3,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:diag(95107,3,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:diag(95108,3,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:diag(95109,3,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file:diag(95110,3,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig to read more about this file"),Add_a_return_statement:diag(95111,3,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:diag(95112,3,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:diag(95113,3,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:diag(95114,3,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:diag(95115,3,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:diag(95116,3,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:diag(95117,3,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:diag(95118,3,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:diag(95119,3,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:diag(95120,3,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:diag(95121,3,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:diag(95122,3,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:diag(95123,3,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:diag(95124,3,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:diag(95125,3,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:diag(95126,3,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:diag(95127,3,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:diag(95128,3,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:diag(95129,3,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:diag(95130,3,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:diag(95131,3,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:diag(95132,3,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:diag(95133,3,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:diag(95134,3,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:diag(95135,3,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:diag(95136,3,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:diag(95137,3,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:diag(95138,3,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:diag(95139,3,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:diag(95140,3,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:diag(95141,3,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:diag(95142,3,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:diag(95143,3,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:diag(95144,3,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:diag(95145,3,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:diag(95146,3,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:diag(95147,3,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:diag(95148,3,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:diag(95149,3,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:diag(95150,3,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:diag(95151,3,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:diag(95152,3,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:diag(95153,3,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenations_and_string_literals:diag(95154,3,"Can_only_convert_string_concatenations_and_string_literals_95154","Can only convert string concatenations and string literals"),Selection_is_not_a_valid_statement_or_statements:diag(95155,3,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:diag(95156,3,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:diag(95157,3,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:diag(95158,3,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:diag(95159,3,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:diag(95160,3,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:diag(95161,3,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:diag(95162,3,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:diag(95163,3,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:diag(95164,3,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:diag(95165,3,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:diag(95166,3,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:diag(95167,3,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:diag(95168,3,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:diag(95169,3,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),Convert_named_imports_to_default_import:diag(95170,3,"Convert_named_imports_to_default_import_95170","Convert named imports to default import"),Delete_unused_param_tag_0:diag(95171,3,"Delete_unused_param_tag_0_95171","Delete unused '@param' tag '{0}'"),Delete_all_unused_param_tags:diag(95172,3,"Delete_all_unused_param_tags_95172","Delete all unused '@param' tags"),Rename_param_tag_name_0_to_1:diag(95173,3,"Rename_param_tag_name_0_to_1_95173","Rename '@param' tag name '{0}' to '{1}'"),Use_0:diag(95174,3,"Use_0_95174","Use `{0}`."),Use_Number_isNaN_in_all_conditions:diag(95175,3,"Use_Number_isNaN_in_all_conditions_95175","Use `Number.isNaN` in all conditions."),Convert_typedef_to_TypeScript_type:diag(95176,3,"Convert_typedef_to_TypeScript_type_95176","Convert typedef to TypeScript type."),Convert_all_typedef_to_TypeScript_types:diag(95177,3,"Convert_all_typedef_to_TypeScript_types_95177","Convert all typedef to TypeScript types."),Move_to_file:diag(95178,3,"Move_to_file_95178","Move to file"),Cannot_move_to_file_selected_file_is_invalid:diag(95179,3,"Cannot_move_to_file_selected_file_is_invalid_95179","Cannot move to file, selected file is invalid"),Use_import_type:diag(95180,3,"Use_import_type_95180","Use 'import type'"),Use_type_0:diag(95181,3,"Use_type_0_95181","Use 'type {0}'"),Fix_all_with_type_only_imports:diag(95182,3,"Fix_all_with_type_only_imports_95182","Fix all with type-only imports"),Cannot_move_statements_to_the_selected_file:diag(95183,3,"Cannot_move_statements_to_the_selected_file_95183","Cannot move statements to the selected file"),Inline_variable:diag(95184,3,"Inline_variable_95184","Inline variable"),Could_not_find_variable_to_inline:diag(95185,3,"Could_not_find_variable_to_inline_95185","Could not find variable to inline."),Variables_with_multiple_declarations_cannot_be_inlined:diag(95186,3,"Variables_with_multiple_declarations_cannot_be_inlined_95186","Variables with multiple declarations cannot be inlined."),Add_missing_comma_for_object_member_completion_0:diag(95187,3,"Add_missing_comma_for_object_member_completion_0_95187","Add missing comma for object member completion '{0}'."),Add_missing_parameter_to_0:diag(95188,3,"Add_missing_parameter_to_0_95188","Add missing parameter to '{0}'"),Add_missing_parameters_to_0:diag(95189,3,"Add_missing_parameters_to_0_95189","Add missing parameters to '{0}'"),Add_all_missing_parameters:diag(95190,3,"Add_all_missing_parameters_95190","Add all missing parameters"),Add_optional_parameter_to_0:diag(95191,3,"Add_optional_parameter_to_0_95191","Add optional parameter to '{0}'"),Add_optional_parameters_to_0:diag(95192,3,"Add_optional_parameters_to_0_95192","Add optional parameters to '{0}'"),Add_all_optional_parameters:diag(95193,3,"Add_all_optional_parameters_95193","Add all optional parameters"),Wrap_in_parentheses:diag(95194,3,"Wrap_in_parentheses_95194","Wrap in parentheses"),Wrap_all_invalid_decorator_expressions_in_parentheses:diag(95195,3,"Wrap_all_invalid_decorator_expressions_in_parentheses_95195","Wrap all invalid decorator expressions in parentheses"),Add_resolution_mode_import_attribute:diag(95196,3,"Add_resolution_mode_import_attribute_95196","Add 'resolution-mode' import attribute"),Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it:diag(95197,3,"Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it_95197","Add 'resolution-mode' import attribute to all type-only imports that need it"),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:diag(18004,1,"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004","No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),Classes_may_not_have_a_field_named_constructor:diag(18006,1,"Classes_may_not_have_a_field_named_constructor_18006","Classes may not have a field named 'constructor'."),JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array:diag(18007,1,"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007","JSX expressions may not use the comma operator. Did you mean to write an array?"),Private_identifiers_cannot_be_used_as_parameters:diag(18009,1,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:diag(18010,1,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:diag(18011,1,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:diag(18012,1,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:diag(18013,1,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:diag(18014,1,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:diag(18015,1,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:diag(18016,1,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:diag(18017,1,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:diag(18018,1,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:diag(18019,1,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:diag(18024,1,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:diag(18026,1,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:diag(18027,1,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:diag(18028,1,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:diag(18029,1,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:diag(18030,1,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:diag(18031,1,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:diag(18032,1,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values:diag(18033,1,"Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values_18033","Type '{0}' is not assignable to type '{1}' as required for computed enum member values."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:diag(18034,3,"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034","Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name:diag(18035,1,"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035","Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator:diag(18036,1,"Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036","Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),await_expression_cannot_be_used_inside_a_class_static_block:diag(18037,1,"await_expression_cannot_be_used_inside_a_class_static_block_18037","'await' expression cannot be used inside a class static block."),for_await_loops_cannot_be_used_inside_a_class_static_block:diag(18038,1,"for_await_loops_cannot_be_used_inside_a_class_static_block_18038","'for await' loops cannot be used inside a class static block."),Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block:diag(18039,1,"Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039","Invalid use of '{0}'. It cannot be used inside a class static block."),A_return_statement_cannot_be_used_inside_a_class_static_block:diag(18041,1,"A_return_statement_cannot_be_used_inside_a_class_static_block_18041","A 'return' statement cannot be used inside a class static block."),_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation:diag(18042,1,"_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042","'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."),Types_cannot_appear_in_export_declarations_in_JavaScript_files:diag(18043,1,"Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043","Types cannot appear in export declarations in JavaScript files."),_0_is_automatically_exported_here:diag(18044,3,"_0_is_automatically_exported_here_18044","'{0}' is automatically exported here."),Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher:diag(18045,1,"Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045","Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."),_0_is_of_type_unknown:diag(18046,1,"_0_is_of_type_unknown_18046","'{0}' is of type 'unknown'."),_0_is_possibly_null:diag(18047,1,"_0_is_possibly_null_18047","'{0}' is possibly 'null'."),_0_is_possibly_undefined:diag(18048,1,"_0_is_possibly_undefined_18048","'{0}' is possibly 'undefined'."),_0_is_possibly_null_or_undefined:diag(18049,1,"_0_is_possibly_null_or_undefined_18049","'{0}' is possibly 'null' or 'undefined'."),The_value_0_cannot_be_used_here:diag(18050,1,"The_value_0_cannot_be_used_here_18050","The value '{0}' cannot be used here."),Compiler_option_0_cannot_be_given_an_empty_string:diag(18051,1,"Compiler_option_0_cannot_be_given_an_empty_string_18051","Compiler option '{0}' cannot be given an empty string."),Its_type_0_is_not_a_valid_JSX_element_type:diag(18053,1,"Its_type_0_is_not_a_valid_JSX_element_type_18053","Its type '{0}' is not a valid JSX element type."),await_using_statements_cannot_be_used_inside_a_class_static_block:diag(18054,1,"await_using_statements_cannot_be_used_inside_a_class_static_block_18054","'await using' statements cannot be used inside a class static block."),_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled:diag(18055,1,"_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055","'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."),Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled:diag(18056,1,"Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056","Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."),String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020:diag(18057,1,"String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057","String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'.")};function tokenIsIdentifierOrKeyword(e){return e>=80}function tokenIsIdentifierOrKeywordOrGreaterThan(e){return e===32||tokenIsIdentifierOrKeyword(e)}var Lt={abstract:128,accessor:129,any:133,as:130,asserts:131,assert:132,bigint:163,boolean:136,break:83,case:84,catch:85,class:86,continue:88,const:87,["constructor"]:137,debugger:89,declare:138,default:90,delete:91,do:92,else:93,enum:94,export:95,extends:96,false:97,finally:98,for:99,from:161,function:100,get:139,if:101,implements:119,import:102,in:103,infer:140,instanceof:104,interface:120,intrinsic:141,is:142,keyof:143,let:121,module:144,namespace:145,never:146,new:105,null:106,number:150,object:151,package:122,private:123,protected:124,public:125,override:164,out:147,readonly:148,require:149,global:162,return:107,satisfies:152,set:153,static:126,string:154,super:108,switch:109,symbol:155,this:110,throw:111,true:112,try:113,type:156,typeof:114,undefined:157,unique:158,unknown:159,using:160,var:115,void:116,while:117,with:118,yield:127,async:134,await:135,of:165};var Mt=new Map(Object.entries(Lt));var Rt=new Map(Object.entries({...Lt,"{":19,"}":20,"(":21,")":22,"[":23,"]":24,".":25,"...":26,";":27,",":28,"<":30,">":32,"<=":33,">=":34,"==":35,"!=":36,"===":37,"!==":38,"=>":39,"+":40,"-":41,"**":43,"*":42,"/":44,"%":45,"++":46,"--":47,"<<":48,">":49,">>>":50,"&":51,"|":52,"^":53,"!":54,"~":55,"&&":56,"||":57,"?":58,"??":61,"?.":29,":":59,"=":64,"+=":65,"-=":66,"*=":67,"**=":68,"/=":69,"%=":70,"<<=":71,">>=":72,">>>=":73,"&=":74,"|=":75,"^=":79,"||=":76,"&&=":77,"??=":78,"@":60,"#":63,"`":62}));var Bt=new Map([[100,1],[103,2],[105,4],[109,8],[115,16],[117,32],[118,64],[121,128]]);var jt=new Map([[1,dt.RegularExpressionFlagsHasIndices],[16,dt.RegularExpressionFlagsDotAll],[32,dt.RegularExpressionFlagsUnicode],[64,dt.RegularExpressionFlagsUnicodeSets],[128,dt.RegularExpressionFlagsSticky]]);var Jt=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500];var Wt=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500];var Ut=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2160,2183,2185,2190,2208,2249,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3165,3165,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3293,3294,3296,3297,3313,3314,3332,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5905,5919,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6988,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42954,42960,42961,42963,42963,42965,42969,42994,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69248,69289,69296,69297,69376,69404,69415,69415,69424,69445,69488,69505,69552,69572,69600,69622,69635,69687,69745,69746,69749,69749,69763,69807,69840,69864,69891,69926,69956,69956,69959,69959,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70207,70208,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70753,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71488,71494,71680,71723,71840,71903,71935,71942,71945,71945,71948,71955,71957,71958,71960,71983,71999,71999,72001,72001,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72368,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73474,73474,73476,73488,73490,73523,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78913,78918,82944,83526,92160,92728,92736,92766,92784,92862,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101589,101632,101640,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,122624,122654,122661,122666,122928,122989,123136,123180,123191,123197,123214,123214,123536,123565,123584,123627,124112,124139,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173791,173824,177977,177984,178205,178208,183969,183984,191456,191472,192093,194560,195101,196608,201546,201552,205743];var zt=[48,57,65,90,95,95,97,122,170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2160,2183,2185,2190,2200,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2901,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3132,3140,3142,3144,3146,3149,3157,3158,3160,3162,3165,3165,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3293,3294,3296,3299,3302,3311,3313,3315,3328,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3457,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3790,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5909,5919,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6159,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6847,6862,6912,6988,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42954,42960,42961,42963,42963,42965,42969,42994,43047,43052,43052,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,69248,69289,69291,69292,69296,69297,69373,69404,69415,69415,69424,69456,69488,69509,69552,69572,69600,69622,69632,69702,69734,69749,69759,69818,69826,69826,69840,69864,69872,69881,69888,69940,69942,69951,69956,69959,69968,70003,70006,70006,70016,70084,70089,70092,70094,70106,70108,70108,70144,70161,70163,70199,70206,70209,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70656,70730,70736,70745,70750,70753,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71424,71450,71453,71467,71472,71481,71488,71494,71680,71738,71840,71913,71935,71942,71945,71945,71948,71955,71957,71958,71960,71989,71991,71992,71995,72003,72016,72025,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72368,72440,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73440,73462,73472,73488,73490,73530,73534,73538,73552,73561,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78912,78933,82944,83526,92160,92728,92736,92766,92768,92777,92784,92862,92864,92873,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93760,93823,93952,94026,94031,94087,94095,94111,94176,94177,94179,94180,94192,94193,94208,100343,100352,101589,101632,101640,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,118528,118573,118576,118598,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122624,122654,122661,122666,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,122928,122989,123023,123023,123136,123180,123184,123197,123200,123209,123214,123214,123536,123566,123584,123641,124112,124153,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,130032,130041,131072,173791,173824,177977,177984,178205,178208,183969,183984,191456,191472,192093,194560,195101,196608,201546,201552,205743,917760,917999];var Vt=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;var qt=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;var Ht=/@(?:see|link)/i;function lookupInUnicodeMap(e,t){if(e=2?lookupInUnicodeMap(e,Ut):lookupInUnicodeMap(e,Jt)}function isUnicodeIdentifierPart(e,t){return t>=2?lookupInUnicodeMap(e,zt):lookupInUnicodeMap(e,Wt)}function makeReverseMap(e){const t=[];e.forEach(((e,n)=>{t[e]=n}));return t}var Gt=makeReverseMap(Rt);function tokenToString(e){return Gt[e]}function stringToToken(e){return Rt.get(e)}var Kt=makeReverseMap(Bt);function regularExpressionFlagToCharacterCode(e){return Kt[e]}function characterCodeToRegularExpressionFlag(e){return Bt.get(e)}function computeLineStarts(e){const t=[];let n=0;let r=0;while(n127&&isLineBreak(i)){t.push(r);r=n}break}}t.push(r);return t}function getPositionOfLineAndCharacter(e,t,n,r){return e.getPositionOfLineAndCharacter?e.getPositionOfLineAndCharacter(t,n,r):computePositionOfLineAndCharacter(getLineStarts(e),t,n,e.text,r)}function computePositionOfLineAndCharacter(e,t,n,r,i){if(t<0||t>=e.length){if(i){t=t<0?0:t>=e.length?e.length-1:t}else{S.fail(`Bad line number. Line: ${t}, lineStarts.length: ${e.length} , line map is correct? ${r!==void 0?arrayIsEqualTo(e,computeLineStarts(r)):"unknown"}`)}}const o=e[t]+n;if(i){return o>e[t+1]?e[t+1]:typeof r==="string"&&o>r.length?r.length:o}if(t=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function isLineBreak(e){return e===10||e===13||e===8232||e===8233}function isDigit(e){return e>=48&&e<=57}function isHexDigit(e){return isDigit(e)||e>=65&&e<=70||e>=97&&e<=102}function isASCIILetter(e){return e>=65&&e<=90||e>=97&&e<=122}function isWordCharacter(e){return isASCIILetter(e)||isDigit(e)||e===95}function isOctalDigit(e){return e>=48&&e<=55}function couldStartTrivia(e,t){const n=e.charCodeAt(t);switch(n){case 13:case 10:case 9:case 11:case 12:case 32:case 47:case 60:case 124:case 61:case 62:return true;case 35:return t===0;default:return n>127}}function skipTrivia(e,t,n,r,i){if(positionIsSynthesized(t)){return t}let o=false;while(true){const a=e.charCodeAt(t);switch(a){case 13:if(e.charCodeAt(t+1)===10){t++}case 10:t++;if(n){return t}o=!!i;continue;case 9:case 11:case 12:case 32:t++;continue;case 47:if(r){break}if(e.charCodeAt(t+1)===47){t+=2;while(t127&&isWhiteSpaceLike(a)){t++;continue}break}return t}}var $t="<<<<<<<".length;function isConflictMarkerTrivia(e,t){S.assert(t>=0);if(t===0||isLineBreak(e.charCodeAt(t-1))){const n=e.charCodeAt(t);if(t+$t=0&&n127&&isWhiteSpaceLike(a)){if(p&&isLineBreak(a)){d=true}n++;continue}break e}}if(p){f=i(s,c,l,d,o,f)}return f}function forEachLeadingCommentRange(e,t,n,r){return iterateCommentRanges(false,e,t,false,n,r)}function forEachTrailingCommentRange(e,t,n,r){return iterateCommentRanges(false,e,t,true,n,r)}function reduceEachLeadingCommentRange(e,t,n,r,i){return iterateCommentRanges(true,e,t,false,n,r,i)}function reduceEachTrailingCommentRange(e,t,n,r,i){return iterateCommentRanges(true,e,t,true,n,r,i)}function appendCommentRange(e,t,n,r,i,o=[]){o.push({kind:n,pos:e,end:t,hasTrailingNewLine:r});return o}function getLeadingCommentRanges(e,t){return reduceEachLeadingCommentRange(e,t,appendCommentRange,void 0,void 0)}function getTrailingCommentRanges(e,t){return reduceEachTrailingCommentRange(e,t,appendCommentRange,void 0,void 0)}function getShebang(e){const t=Qt.exec(e);if(t){return t[0]}}function isIdentifierStart(e,t){return isASCIILetter(e)||e===36||e===95||e>127&&isUnicodeIdentifierStart(e,t)}function isIdentifierPart(e,t,n){return isWordCharacter(e)||e===36||(n===1?e===45||e===58:false)||e>127&&isUnicodeIdentifierPart(e,t)}function isIdentifierText(e,t,n){let r=codePointAt(e,0);if(!isIdentifierStart(r,t)){return false}for(let i=charSize(r);id,getStartPos:()=>d,getTokenEnd:()=>c,getTextPos:()=>c,getToken:()=>u,getTokenStart:()=>p,getTokenPos:()=>p,getTokenText:()=>s.substring(p,c),getTokenValue:()=>f,hasUnicodeEscape:()=>(m&1024)!==0,hasExtendedUnicodeEscape:()=>(m&8)!==0,hasPrecedingLineBreak:()=>(m&1)!==0,hasPrecedingJSDocComment:()=>(m&2)!==0,hasPrecedingJSDocLeadingAsterisks:()=>(m&32768)!==0,isIdentifier:()=>u===80||u>118,isReservedWord:()=>u>=83&&u<=118,isUnterminated:()=>(m&4)!==0,getCommentDirectives:()=>_,getNumericLiteralFlags:()=>m&25584,getTokenFlags:()=>m,reScanGreaterToken:reScanGreaterToken,reScanAsteriskEqualsToken:reScanAsteriskEqualsToken,reScanSlashToken:reScanSlashToken,reScanTemplateToken:reScanTemplateToken,reScanTemplateHeadOrNoSubstitutionTemplate:reScanTemplateHeadOrNoSubstitutionTemplate,scanJsxIdentifier:scanJsxIdentifier,scanJsxAttributeValue:scanJsxAttributeValue,reScanJsxAttributeValue:reScanJsxAttributeValue,reScanJsxToken:reScanJsxToken,reScanLessThanToken:reScanLessThanToken,reScanHashToken:reScanHashToken,reScanQuestionToken:reScanQuestionToken,reScanInvalidIdentifier:reScanInvalidIdentifier,scanJsxToken:scanJsxToken,scanJsDocToken:scanJsDocToken,scanJSDocCommentTextToken:scanJSDocCommentTextToken,scan:scan,getText:getText,clearCommentDirectives:clearCommentDirectives,setText:setText,setScriptTarget:setScriptTarget,setLanguageVariant:setLanguageVariant,setScriptKind:setScriptKind,setJSDocParsingMode:setJSDocParsingMode,setOnError:setOnError,resetTokenState:resetTokenState,setTextPos:resetTokenState,setSkipJsDocLeadingAsterisks:setSkipJsDocLeadingAsterisks,tryScan:tryScan,lookAhead:lookAhead,scanRange:scanRange};if(S.isDebugging){Object.defineProperty(T,"__debugShowCurrentPositionInText",{get:()=>{const e=T.getText();return e.slice(0,T.getTokenFullStart())+"║"+e.slice(T.getTokenFullStart())}})}return T;function codePointUnchecked(e){return codePointAt(s,e)}function codePointChecked(e){return e>=0&&e=0&&e=65&&e<=70){e+=97-65}else if(!(e>=48&&e<=57||e>=97&&e<=102)){break}r.push(e);c++;o=false}if(r.length=l){n+=s.substring(r,c);m|=4;error2(wt.Unterminated_string_literal);break}const i=charCodeUnchecked(c);if(i===t){n+=s.substring(r,c);c++;break}if(i===92&&!e){n+=s.substring(r,c);n+=scanEscapeSequence(1|2);r=c;continue}if((i===10||i===13)&&!e){n+=s.substring(r,c);m|=4;error2(wt.Unterminated_string_literal);break}c++}return n}function scanTemplateAndSetTokenValue(e){const t=charCodeUnchecked(c)===96;c++;let n=c;let r="";let i;while(true){if(c>=l){r+=s.substring(n,c);m|=4;error2(wt.Unterminated_template_literal);i=t?15:18;break}const o=charCodeUnchecked(c);if(o===96){r+=s.substring(n,c);c++;i=t?15:18;break}if(o===36&&c+1=l){error2(wt.Unexpected_end_of_text);return""}const r=charCodeUnchecked(c);c++;switch(r){case 48:if(c>=l||!isDigit(charCodeUnchecked(c))){return"\0"}case 49:case 50:case 51:if(c=55296&&i<=56319&&c+6=56320&&n<=57343){c=t;return o+String.fromCharCode(n)}}return o;case 120:for(;c1114111){if(e){error2(wt.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive,n,c-n)}o=true}if(c>=l){if(e){error2(wt.Unexpected_end_of_text)}o=true}else if(charCodeUnchecked(c)===125){c++}else{if(e){error2(wt.Unterminated_Unicode_escape_sequence)}o=true}if(o){m|=2048;return s.substring(t,c)}m|=8;return utf16EncodeAsString(i)}function peekUnicodeEscape(){if(c+5=0&&isIdentifierPart(r,e)){t+=scanExtendedUnicodeEscape(true);n=c;continue}r=peekUnicodeEscape();if(!(r>=0&&isIdentifierPart(r,e))){break}m|=1024;t+=s.substring(n,c);t+=utf16EncodeAsString(r);c+=6;n=c}else{break}}t+=s.substring(n,c);return t}function getIdentifierToken(){const e=f.length;if(e>=2&&e<=12){const e=f.charCodeAt(0);if(e>=97&&e<=122){const e=Mt.get(f);if(e!==void 0){return u=e}}}return u=80}function scanBinaryOrOctalDigits(e){let t="";let n=false;let r=false;while(true){const i=charCodeUnchecked(c);if(i===95){m|=512;if(n){n=false;r=true}else if(r){error2(wt.Multiple_consecutive_numeric_separators_are_not_permitted,c,1)}else{error2(wt.Numeric_separators_are_not_allowed_here,c,1)}c++;continue}n=true;if(!isDigit(i)||i-48>=e){break}t+=s[c];c++;r=false}if(charCodeUnchecked(c-1)===95){error2(wt.Numeric_separators_are_not_allowed_here,c-1,1)}return t}function checkBigIntSuffix(){if(charCodeUnchecked(c)===110){f+="n";if(m&384){f=parsePseudoBigInt(f)+"n"}c++;return 10}else{const e=m&128?parseInt(f.slice(2),2):m&256?parseInt(f.slice(2),8):+f;f=""+e;return 9}}function scan(){d=c;m=0;while(true){p=c;if(c>=l){return u=1}const r=codePointUnchecked(c);if(c===0){if(r===35&&isShebangTrivia(s,c)){c=scanShebangTrivia(s,c);if(t){continue}else{return u=6}}}switch(r){case 10:case 13:m|=1;if(t){c++;continue}else{if(r===13&&c+1=0&&isIdentifierStart(i,e)){f=scanExtendedUnicodeEscape(true)+scanIdentifierParts();return u=getIdentifierToken()}const o=peekUnicodeEscape();if(o>=0&&isIdentifierStart(o,e)){c+=6;m|=1024;f=String.fromCharCode(o)+scanIdentifierParts();return u=getIdentifierToken()}error2(wt.Invalid_character);c++;return u=0;case 35:if(c!==0&&s[c+1]==="!"){error2(wt.can_only_be_used_at_the_start_of_a_file,c,2);c++;return u=0}const a=codePointUnchecked(c+1);if(a===92){c++;const t=peekExtendedUnicodeEscape();if(t>=0&&isIdentifierStart(t,e)){f="#"+scanExtendedUnicodeEscape(true)+scanIdentifierParts();return u=81}const n=peekUnicodeEscape();if(n>=0&&isIdentifierStart(n,e)){c+=6;m|=1024;f="#"+String.fromCharCode(n)+scanIdentifierParts();return u=81}c--}if(isIdentifierStart(a,e)){c++;scanIdentifier(a,e)}else{f="#";error2(wt.Invalid_character,c++,charSize(r))}return u=81;case 65533:error2(wt.File_appears_to_be_binary,0,0);c=l;return u=8;default:const d=scanIdentifier(r,e);if(d){return u=d}else if(isWhiteSpaceSingleLine(r)){c+=charSize(r);continue}else if(isLineBreak(r)){m|=1;c+=charSize(r);continue}const y=charSize(r);error2(wt.Invalid_character,c,y);c+=y;return u=0}}}function shouldParseJSDoc(){switch(h){case 0:return true;case 1:return false}if(y!==3&&y!==4){return true}if(h===3){return false}return Ht.test(s.slice(d,c))}function reScanInvalidIdentifier(){S.assert(u===0,"'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");c=p=d;m=0;const e=codePointUnchecked(c);const t=scanIdentifier(e,99);if(t){return u=t}c+=charSize(e);return u}function scanIdentifier(e,t){let n=e;if(isIdentifierStart(n,t)){c+=charSize(n);while(c=l){return u=1}let t=charCodeUnchecked(c);if(t===60){if(charCodeUnchecked(c+1)===47){c+=2;return u=31}c++;return u=30}if(t===123){c++;return u=19}let n=0;while(c0){break}else if(!isWhiteSpaceLike(t)){n=c}c++}f=s.substring(d,c);return n===-1?13:12}function scanJsxIdentifier(){if(tokenIsIdentifierOrKeyword(u)){while(c=l){return u=1}for(let t=charCodeUnchecked(c);c=0&&isWhiteSpaceSingleLine(charCodeUnchecked(c-1))&&!(c+1=l){return u=1}const t=codePointUnchecked(c);c+=charSize(t);switch(t){case 9:case 11:case 12:case 32:while(c=0&&isIdentifierStart(t,e)){f=scanExtendedUnicodeEscape(true)+scanIdentifierParts();return u=getIdentifierToken()}const n=peekUnicodeEscape();if(n>=0&&isIdentifierStart(n,e)){c+=6;m|=1024;f=String.fromCharCode(n)+scanIdentifierParts();return u=getIdentifierToken()}c++;return u=0}if(isIdentifierStart(t,e)){let n=t;while(c=0);c=e;d=e;p=e;u=0;f=void 0;m=0}function setSkipJsDocLeadingAsterisks(e){g+=e?1:-1}}function codePointAt(e,t){return e.codePointAt(t)}function charSize(e){if(e>=65536){return 2}if(e===-1){return 0}return 1}function utf16EncodeAsStringFallback(e){S.assert(0<=e&&e<=1114111);if(e<=65535){return String.fromCharCode(e)}const t=Math.floor((e-65536)/1024)+55296;const n=(e-65536)%1024+56320;return String.fromCharCode(t,n)}var Xt=String.fromCodePoint?e=>String.fromCodePoint(e):utf16EncodeAsStringFallback;function utf16EncodeAsString(e){return Xt(e)}var Yt=new Map(Object.entries({General_Category:"General_Category",gc:"General_Category",Script:"Script",sc:"Script",Script_Extensions:"Script_Extensions",scx:"Script_Extensions"}));var Zt=new Set(["ASCII","ASCII_Hex_Digit","AHex","Alphabetic","Alpha","Any","Assigned","Bidi_Control","Bidi_C","Bidi_Mirrored","Bidi_M","Case_Ignorable","CI","Cased","Changes_When_Casefolded","CWCF","Changes_When_Casemapped","CWCM","Changes_When_Lowercased","CWL","Changes_When_NFKC_Casefolded","CWKCF","Changes_When_Titlecased","CWT","Changes_When_Uppercased","CWU","Dash","Default_Ignorable_Code_Point","DI","Deprecated","Dep","Diacritic","Dia","Emoji","Emoji_Component","EComp","Emoji_Modifier","EMod","Emoji_Modifier_Base","EBase","Emoji_Presentation","EPres","Extended_Pictographic","ExtPict","Extender","Ext","Grapheme_Base","Gr_Base","Grapheme_Extend","Gr_Ext","Hex_Digit","Hex","IDS_Binary_Operator","IDSB","IDS_Trinary_Operator","IDST","ID_Continue","IDC","ID_Start","IDS","Ideographic","Ideo","Join_Control","Join_C","Logical_Order_Exception","LOE","Lowercase","Lower","Math","Noncharacter_Code_Point","NChar","Pattern_Syntax","Pat_Syn","Pattern_White_Space","Pat_WS","Quotation_Mark","QMark","Radical","Regional_Indicator","RI","Sentence_Terminal","STerm","Soft_Dotted","SD","Terminal_Punctuation","Term","Unified_Ideograph","UIdeo","Uppercase","Upper","Variation_Selector","VS","White_Space","space","XID_Continue","XIDC","XID_Start","XIDS"]);var en=new Set(["Basic_Emoji","Emoji_Keycap_Sequence","RGI_Emoji_Modifier_Sequence","RGI_Emoji_Flag_Sequence","RGI_Emoji_Tag_Sequence","RGI_Emoji_ZWJ_Sequence","RGI_Emoji"]);var tn={General_Category:new Set(["C","Other","Cc","Control","cntrl","Cf","Format","Cn","Unassigned","Co","Private_Use","Cs","Surrogate","L","Letter","LC","Cased_Letter","Ll","Lowercase_Letter","Lm","Modifier_Letter","Lo","Other_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter","M","Mark","Combining_Mark","Mc","Spacing_Mark","Me","Enclosing_Mark","Mn","Nonspacing_Mark","N","Number","Nd","Decimal_Number","digit","Nl","Letter_Number","No","Other_Number","P","Punctuation","punct","Pc","Connector_Punctuation","Pd","Dash_Punctuation","Pe","Close_Punctuation","Pf","Final_Punctuation","Pi","Initial_Punctuation","Po","Other_Punctuation","Ps","Open_Punctuation","S","Symbol","Sc","Currency_Symbol","Sk","Modifier_Symbol","Sm","Math_Symbol","So","Other_Symbol","Z","Separator","Zl","Line_Separator","Zp","Paragraph_Separator","Zs","Space_Separator"]),Script:new Set(["Adlm","Adlam","Aghb","Caucasian_Albanian","Ahom","Arab","Arabic","Armi","Imperial_Aramaic","Armn","Armenian","Avst","Avestan","Bali","Balinese","Bamu","Bamum","Bass","Bassa_Vah","Batk","Batak","Beng","Bengali","Bhks","Bhaiksuki","Bopo","Bopomofo","Brah","Brahmi","Brai","Braille","Bugi","Buginese","Buhd","Buhid","Cakm","Chakma","Cans","Canadian_Aboriginal","Cari","Carian","Cham","Cher","Cherokee","Chrs","Chorasmian","Copt","Coptic","Qaac","Cpmn","Cypro_Minoan","Cprt","Cypriot","Cyrl","Cyrillic","Deva","Devanagari","Diak","Dives_Akuru","Dogr","Dogra","Dsrt","Deseret","Dupl","Duployan","Egyp","Egyptian_Hieroglyphs","Elba","Elbasan","Elym","Elymaic","Ethi","Ethiopic","Geor","Georgian","Glag","Glagolitic","Gong","Gunjala_Gondi","Gonm","Masaram_Gondi","Goth","Gothic","Gran","Grantha","Grek","Greek","Gujr","Gujarati","Guru","Gurmukhi","Hang","Hangul","Hani","Han","Hano","Hanunoo","Hatr","Hatran","Hebr","Hebrew","Hira","Hiragana","Hluw","Anatolian_Hieroglyphs","Hmng","Pahawh_Hmong","Hmnp","Nyiakeng_Puachue_Hmong","Hrkt","Katakana_Or_Hiragana","Hung","Old_Hungarian","Ital","Old_Italic","Java","Javanese","Kali","Kayah_Li","Kana","Katakana","Kawi","Khar","Kharoshthi","Khmr","Khmer","Khoj","Khojki","Kits","Khitan_Small_Script","Knda","Kannada","Kthi","Kaithi","Lana","Tai_Tham","Laoo","Lao","Latn","Latin","Lepc","Lepcha","Limb","Limbu","Lina","Linear_A","Linb","Linear_B","Lisu","Lyci","Lycian","Lydi","Lydian","Mahj","Mahajani","Maka","Makasar","Mand","Mandaic","Mani","Manichaean","Marc","Marchen","Medf","Medefaidrin","Mend","Mende_Kikakui","Merc","Meroitic_Cursive","Mero","Meroitic_Hieroglyphs","Mlym","Malayalam","Modi","Mong","Mongolian","Mroo","Mro","Mtei","Meetei_Mayek","Mult","Multani","Mymr","Myanmar","Nagm","Nag_Mundari","Nand","Nandinagari","Narb","Old_North_Arabian","Nbat","Nabataean","Newa","Nkoo","Nko","Nshu","Nushu","Ogam","Ogham","Olck","Ol_Chiki","Orkh","Old_Turkic","Orya","Oriya","Osge","Osage","Osma","Osmanya","Ougr","Old_Uyghur","Palm","Palmyrene","Pauc","Pau_Cin_Hau","Perm","Old_Permic","Phag","Phags_Pa","Phli","Inscriptional_Pahlavi","Phlp","Psalter_Pahlavi","Phnx","Phoenician","Plrd","Miao","Prti","Inscriptional_Parthian","Rjng","Rejang","Rohg","Hanifi_Rohingya","Runr","Runic","Samr","Samaritan","Sarb","Old_South_Arabian","Saur","Saurashtra","Sgnw","SignWriting","Shaw","Shavian","Shrd","Sharada","Sidd","Siddham","Sind","Khudawadi","Sinh","Sinhala","Sogd","Sogdian","Sogo","Old_Sogdian","Sora","Sora_Sompeng","Soyo","Soyombo","Sund","Sundanese","Sylo","Syloti_Nagri","Syrc","Syriac","Tagb","Tagbanwa","Takr","Takri","Tale","Tai_Le","Talu","New_Tai_Lue","Taml","Tamil","Tang","Tangut","Tavt","Tai_Viet","Telu","Telugu","Tfng","Tifinagh","Tglg","Tagalog","Thaa","Thaana","Thai","Tibt","Tibetan","Tirh","Tirhuta","Tnsa","Tangsa","Toto","Ugar","Ugaritic","Vaii","Vai","Vith","Vithkuqi","Wara","Warang_Citi","Wcho","Wancho","Xpeo","Old_Persian","Xsux","Cuneiform","Yezi","Yezidi","Yiii","Yi","Zanb","Zanabazar_Square","Zinh","Inherited","Qaai","Zyyy","Common","Zzzz","Unknown"]),Script_Extensions:void 0};tn.Script_Extensions=tn.Script;function isExternalModuleNameRelative(e){return pathIsRelative(e)||isRootedDiskPath(e)}function sortAndDeduplicateDiagnostics(e){return sortAndDeduplicate(e,compareDiagnostics,diagnosticsEqualityComparer)}var nn=new Map([[99,"lib.esnext.full.d.ts"],[11,"lib.es2024.full.d.ts"],[10,"lib.es2023.full.d.ts"],[9,"lib.es2022.full.d.ts"],[8,"lib.es2021.full.d.ts"],[7,"lib.es2020.full.d.ts"],[6,"lib.es2019.full.d.ts"],[5,"lib.es2018.full.d.ts"],[4,"lib.es2017.full.d.ts"],[3,"lib.es2016.full.d.ts"],[2,"lib.es6.d.ts"]]);function getDefaultLibFileName(e){const t=zn(e);switch(t){case 99:case 11:case 10:case 9:case 8:case 7:case 6:case 5:case 4:case 3:case 2:return nn.get(t);default:return"lib.d.ts"}}function textSpanEnd(e){return e.start+e.length}function textSpanIsEmpty(e){return e.length===0}function textSpanContainsPosition(e,t){return t>=e.start&&t=e.pos&&t<=e.end}function textSpanContainsTextSpan(e,t){return t.start>=e.start&&textSpanEnd(t)<=textSpanEnd(e)}function textSpanContainsTextRange(e,t){return t.pos>=e.start&&t.end<=textSpanEnd(e)}function textRangeContainsTextSpan(e,t){return t.start>=e.pos&&textSpanEnd(t)<=e.end}function textSpanOverlapsWith(e,t){return textSpanOverlap(e,t)!==void 0}function textSpanOverlap(e,t){const n=textSpanIntersection(e,t);return n&&n.length===0?void 0:n}function textSpanIntersectsWithTextSpan(e,t){return decodedTextSpanIntersectsWith(e.start,e.length,t.start,t.length)}function textSpanIntersectsWith(e,t,n){return decodedTextSpanIntersectsWith(e.start,e.length,t,n)}function decodedTextSpanIntersectsWith(e,t,n,r){const i=e+t;const o=n+r;return n<=i&&o>=e}function textSpanIntersectsWithPosition(e,t){return t<=textSpanEnd(e)&&t>=e.start}function textRangeIntersectsWithTextSpan(e,t){return textSpanIntersectsWith(t,e.pos,e.end-e.pos)}function textSpanIntersection(e,t){const n=Math.max(e.start,t.start);const r=Math.min(textSpanEnd(e),textSpanEnd(t));return n<=r?createTextSpanFromBounds(n,r):void 0}function normalizeSpans(e){e=e.filter((e=>e.length>0)).sort(((e,t)=>e.start!==t.start?e.start-t.start:e.length-t.length));const t=[];let n=0;while(n=2&&e.charCodeAt(0)===95&&e.charCodeAt(1)===95?"_"+e:e}function unescapeLeadingUnderscores(e){const t=e;return t.length>=3&&t.charCodeAt(0)===95&&t.charCodeAt(1)===95&&t.charCodeAt(2)===95?t.substr(1):t}function idText(e){return unescapeLeadingUnderscores(e.escapedText)}function identifierToKeywordKind(e){const t=stringToToken(e.escapedText);return t?tryCast(t,isKeyword):void 0}function symbolName(e){if(e.valueDeclaration&&isPrivateIdentifierClassElementDeclaration(e.valueDeclaration)){return idText(e.valueDeclaration.name)}return unescapeLeadingUnderscores(e.escapedName)}function nameForNamelessJSDocTypedef(e){const t=e.parent.parent;if(!t){return void 0}if(isDeclaration(t)){return getDeclarationIdentifier(t)}switch(t.kind){case 243:if(t.declarationList&&t.declarationList.declarations[0]){return getDeclarationIdentifier(t.declarationList.declarations[0])}break;case 244:let e=t.expression;if(e.kind===226&&e.operatorToken.kind===64){e=e.left}switch(e.kind){case 211:return e.name;case 212:const t=e.argumentExpression;if(isIdentifier(t)){return t}}break;case 217:{return getDeclarationIdentifier(t.expression)}case 256:{if(isDeclaration(t.statement)||isExpression(t.statement)){return getDeclarationIdentifier(t.statement)}break}}}function getDeclarationIdentifier(e){const t=getNameOfDeclaration(e);return t&&isIdentifier(t)?t:void 0}function nodeHasName(e,t){if(isNamedDeclaration(e)&&isIdentifier(e.name)&&idText(e.name)===idText(t)){return true}if(isVariableStatement(e)&&some(e.declarationList.declarations,(e=>nodeHasName(e,t)))){return true}return false}function getNameOfJSDocTypedef(e){return e.name||nameForNamelessJSDocTypedef(e)}function isNamedDeclaration(e){return!!e.name}function getNonAssignedNameOfDeclaration(e){switch(e.kind){case 80:return e;case 348:case 341:{const{name:t}=e;if(t.kind===166){return t.right}break}case 213:case 226:{const t=e;switch(getAssignmentDeclarationKind(t)){case 1:case 4:case 5:case 3:return getElementOrPropertyAccessArgumentExpressionOrName(t.left);case 7:case 8:case 9:return t.arguments[1];default:return void 0}}case 346:return getNameOfJSDocTypedef(e);case 340:return nameForNamelessJSDocTypedef(e);case 277:{const{expression:t}=e;return isIdentifier(t)?t:void 0}case 212:const t=e;if(isBindableStaticElementAccessExpression(t)){return t.argumentExpression}}return e.name}function getNameOfDeclaration(e){if(e===void 0)return void 0;return getNonAssignedNameOfDeclaration(e)||(isFunctionExpression(e)||isArrowFunction(e)||isClassExpression(e)?getAssignedName(e):void 0)}function getAssignedName(e){if(!e.parent){return void 0}else if(isPropertyAssignment(e.parent)||isBindingElement(e.parent)){return e.parent.name}else if(isBinaryExpression(e.parent)&&e===e.parent.right){if(isIdentifier(e.parent.left)){return e.parent.left}else if(isAccessExpression(e.parent.left)){return getElementOrPropertyAccessArgumentExpressionOrName(e.parent.left)}}else if(isVariableDeclaration(e.parent)&&isIdentifier(e.parent.name)){return e.parent.name}}function getDecorators(e){if(hasDecorators(e)){return filter(e.modifiers,isDecorator)}}function getModifiers(e){if(hasSyntacticModifier(e,98303)){return filter(e.modifiers,isModifier)}}function getJSDocParameterTagsWorker(e,t){if(e.name){if(isIdentifier(e.name)){const n=e.name.escapedText;return getJSDocTagsWorker(e.parent,t).filter((e=>isJSDocParameterTag(e)&&isIdentifier(e.name)&&e.name.escapedText===n))}else{const n=e.parent.parameters.indexOf(e);S.assert(n>-1,"Parameters should always be in their parents' parameter list");const r=getJSDocTagsWorker(e.parent,t).filter(isJSDocParameterTag);if(nisJSDocTemplateTag(e)&&e.typeParameters.some((e=>e.name.escapedText===n))))}function getJSDocTypeParameterTags(e){return getJSDocTypeParameterTagsWorker(e,false)}function getJSDocTypeParameterTagsNoCache(e){return getJSDocTypeParameterTagsWorker(e,true)}function hasJSDocParameterTags(e){return!!getFirstJSDocTag(e,isJSDocParameterTag)}function getJSDocAugmentsTag(e){return getFirstJSDocTag(e,isJSDocAugmentsTag)}function getJSDocImplementsTags(e){return getAllJSDocTags(e,isJSDocImplementsTag)}function getJSDocClassTag(e){return getFirstJSDocTag(e,isJSDocClassTag)}function getJSDocPublicTag(e){return getFirstJSDocTag(e,isJSDocPublicTag)}function getJSDocPublicTagNoCache(e){return getFirstJSDocTag(e,isJSDocPublicTag,true)}function getJSDocPrivateTag(e){return getFirstJSDocTag(e,isJSDocPrivateTag)}function getJSDocPrivateTagNoCache(e){return getFirstJSDocTag(e,isJSDocPrivateTag,true)}function getJSDocProtectedTag(e){return getFirstJSDocTag(e,isJSDocProtectedTag)}function getJSDocProtectedTagNoCache(e){return getFirstJSDocTag(e,isJSDocProtectedTag,true)}function getJSDocReadonlyTag(e){return getFirstJSDocTag(e,isJSDocReadonlyTag)}function getJSDocReadonlyTagNoCache(e){return getFirstJSDocTag(e,isJSDocReadonlyTag,true)}function getJSDocOverrideTagNoCache(e){return getFirstJSDocTag(e,isJSDocOverrideTag,true)}function getJSDocDeprecatedTag(e){return getFirstJSDocTag(e,isJSDocDeprecatedTag)}function getJSDocDeprecatedTagNoCache(e){return getFirstJSDocTag(e,isJSDocDeprecatedTag,true)}function getJSDocEnumTag(e){return getFirstJSDocTag(e,isJSDocEnumTag)}function getJSDocThisTag(e){return getFirstJSDocTag(e,isJSDocThisTag)}function getJSDocReturnTag(e){return getFirstJSDocTag(e,isJSDocReturnTag)}function getJSDocTemplateTag(e){return getFirstJSDocTag(e,isJSDocTemplateTag)}function getJSDocSatisfiesTag(e){return getFirstJSDocTag(e,isJSDocSatisfiesTag)}function getJSDocTypeTag(e){const t=getFirstJSDocTag(e,isJSDocTypeTag);if(t&&t.typeExpression&&t.typeExpression.type){return t}return void 0}function getJSDocType(e){let t=getFirstJSDocTag(e,isJSDocTypeTag);if(!t&&isParameter(e)){t=find(getJSDocParameterTags(e),(e=>!!e.typeExpression))}return t&&t.typeExpression&&t.typeExpression.type}function getJSDocReturnType(e){const t=getJSDocReturnTag(e);if(t&&t.typeExpression){return t.typeExpression.type}const n=getJSDocTypeTag(e);if(n&&n.typeExpression){const e=n.typeExpression.type;if(isTypeLiteralNode(e)){const t=find(e.members,isCallSignatureDeclaration);return t&&t.type}if(isFunctionTypeNode(e)||isJSDocFunctionType(e)){return e.type}}}function getJSDocTagsWorker(e,t){var n;if(!canHaveJSDoc(e))return d;let r=(n=e.jsDoc)==null?void 0:n.jsDocCache;if(r===void 0||t){const n=getJSDocCommentsAndTags(e,t);S.assert(n.length<2||n[0]!==n[1]);r=flatMap(n,(e=>isJSDoc(e)?e.tags:e));if(!t){e.jsDoc??(e.jsDoc=[]);e.jsDoc.jsDocCache=r}}return r}function getJSDocTags(e){return getJSDocTagsWorker(e,false)}function getFirstJSDocTag(e,t,n){return find(getJSDocTagsWorker(e,n),t)}function getAllJSDocTags(e,t){return getJSDocTags(e).filter(t)}function getAllJSDocTagsOfKind(e,t){return getJSDocTags(e).filter((e=>e.kind===t))}function getTextOfJSDocComment(e){return typeof e==="string"?e:e==null?void 0:e.map((e=>e.kind===321?e.text:formatJSDocLink(e))).join("")}function formatJSDocLink(e){const t=e.kind===324?"link":e.kind===325?"linkcode":"linkplain";const n=e.name?entityNameToString(e.name):"";const r=e.name&&(e.text===""||e.text.startsWith("://"))?"":" ";return`{@${t} ${n}${r}${e.text}}`}function getEffectiveTypeParameterDeclarations(e){if(isJSDocSignature(e)){if(isJSDocOverloadTag(e.parent)){const t=getJSDocRoot(e.parent);if(t&&length(t.tags)){return flatMap(t.tags,(e=>isJSDocTemplateTag(e)?e.typeParameters:void 0))}}return d}if(isJSDocTypeAlias(e)){S.assert(e.parent.kind===320);return flatMap(e.parent.tags,(e=>isJSDocTemplateTag(e)?e.typeParameters:void 0))}if(e.typeParameters){return e.typeParameters}if(canHaveIllegalTypeParameters(e)&&e.typeParameters){return e.typeParameters}if(isInJSFile(e)){const t=getJSDocTypeParameterDeclarations(e);if(t.length){return t}const n=getJSDocType(e);if(n&&isFunctionTypeNode(n)&&n.typeParameters){return n.typeParameters}}return d}function getEffectiveConstraintOfTypeParameter(e){return e.constraint?e.constraint:isJSDocTemplateTag(e.parent)&&e===e.parent.typeParameters[0]?e.parent.constraint:void 0}function isMemberName(e){return e.kind===80||e.kind===81}function isGetOrSetAccessorDeclaration(e){return e.kind===178||e.kind===177}function isPropertyAccessChain(e){return isPropertyAccessExpression(e)&&!!(e.flags&64)}function isElementAccessChain(e){return isElementAccessExpression(e)&&!!(e.flags&64)}function isCallChain(e){return isCallExpression(e)&&!!(e.flags&64)}function isOptionalChain(e){const t=e.kind;return!!(e.flags&64)&&(t===211||t===212||t===213||t===235)}function isOptionalChainRoot(e){return isOptionalChain(e)&&!isNonNullExpression(e)&&!!e.questionDotToken}function isExpressionOfOptionalChainRoot(e){return isOptionalChainRoot(e.parent)&&e.parent.expression===e}function isOutermostOptionalChain(e){return!isOptionalChain(e.parent)||isOptionalChainRoot(e.parent)||e!==e.parent.expression}function isNullishCoalesce(e){return e.kind===226&&e.operatorToken.kind===61}function isConstTypeReference(e){return isTypeReferenceNode(e)&&isIdentifier(e.typeName)&&e.typeName.escapedText==="const"&&!e.typeArguments}function skipPartiallyEmittedExpressions(e){return skipOuterExpressions(e,8)}function isNonNullChain(e){return isNonNullExpression(e)&&!!(e.flags&64)}function isBreakOrContinueStatement(e){return e.kind===252||e.kind===251}function isNamedExportBindings(e){return e.kind===280||e.kind===279}function isJSDocPropertyLikeTag(e){return e.kind===348||e.kind===341}function isNodeKind(e){return e>=166}function isTokenKind(e){return e>=0&&e<=165}function isToken(e){return isTokenKind(e.kind)}function isNodeArray(e){return hasProperty(e,"pos")&&hasProperty(e,"end")}function isLiteralKind(e){return 9<=e&&e<=15}function isLiteralExpression(e){return isLiteralKind(e.kind)}function isLiteralExpressionOfObject(e){switch(e.kind){case 210:case 209:case 14:case 218:case 231:return true}return false}function isTemplateLiteralKind(e){return 15<=e&&e<=18}function isTemplateLiteralToken(e){return isTemplateLiteralKind(e.kind)}function isTemplateMiddleOrTemplateTail(e){const t=e.kind;return t===17||t===18}function isImportOrExportSpecifier(e){return isImportSpecifier(e)||isExportSpecifier(e)}function isTypeOnlyImportDeclaration(e){switch(e.kind){case 276:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 274:return e.parent.isTypeOnly;case 273:case 271:return e.isTypeOnly}return false}function isTypeOnlyExportDeclaration(e){switch(e.kind){case 281:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 278:return e.isTypeOnly&&!!e.moduleSpecifier&&!e.exportClause;case 280:return e.parent.isTypeOnly}return false}function isTypeOnlyImportOrExportDeclaration(e){return isTypeOnlyImportDeclaration(e)||isTypeOnlyExportDeclaration(e)}function isPartOfTypeOnlyImportOrExportDeclaration(e){return findAncestor(e,isTypeOnlyImportOrExportDeclaration)!==void 0}function isStringTextContainingNode(e){return e.kind===11||isTemplateLiteralKind(e.kind)}function isImportAttributeName(e){return isStringLiteral(e)||isIdentifier(e)}function isGeneratedIdentifier(e){var t;return isIdentifier(e)&&((t=e.emitNode)==null?void 0:t.autoGenerate)!==void 0}function isGeneratedPrivateIdentifier(e){var t;return isPrivateIdentifier(e)&&((t=e.emitNode)==null?void 0:t.autoGenerate)!==void 0}function isFileLevelReservedGeneratedIdentifier(e){const t=e.emitNode.autoGenerate.flags;return!!(t&32)&&!!(t&16)&&!!(t&8)}function isPrivateIdentifierClassElementDeclaration(e){return(isPropertyDeclaration(e)||isMethodOrAccessor(e))&&isPrivateIdentifier(e.name)}function isPrivateIdentifierPropertyAccessExpression(e){return isPropertyAccessExpression(e)&&isPrivateIdentifier(e.name)}function isModifierKind(e){switch(e){case 128:case 129:case 134:case 87:case 138:case 90:case 95:case 103:case 125:case 123:case 124:case 148:case 126:case 147:case 164:return true}return false}function isParameterPropertyModifier(e){return!!(modifierToFlag(e)&31)}function isClassMemberModifier(e){return isParameterPropertyModifier(e)||e===126||e===164||e===129}function isModifier(e){return isModifierKind(e.kind)}function isEntityName(e){const t=e.kind;return t===166||t===80}function isPropertyName(e){const t=e.kind;return t===80||t===81||t===11||t===9||t===167}function isBindingName(e){const t=e.kind;return t===80||t===206||t===207}function isFunctionLike(e){return!!e&&isFunctionLikeKind(e.kind)}function isFunctionLikeOrClassStaticBlockDeclaration(e){return!!e&&(isFunctionLikeKind(e.kind)||isClassStaticBlockDeclaration(e))}function isFunctionLikeDeclaration(e){return e&&isFunctionLikeDeclarationKind(e.kind)}function isBooleanLiteral(e){return e.kind===112||e.kind===97}function isFunctionLikeDeclarationKind(e){switch(e){case 262:case 174:case 176:case 177:case 178:case 218:case 219:return true;default:return false}}function isFunctionLikeKind(e){switch(e){case 173:case 179:case 323:case 180:case 181:case 184:case 317:case 185:return true;default:return isFunctionLikeDeclarationKind(e)}}function isFunctionOrModuleBlock(e){return isSourceFile(e)||isModuleBlock(e)||isBlock(e)&&isFunctionLike(e.parent)}function isClassElement(e){const t=e.kind;return t===176||t===172||t===174||t===177||t===178||t===181||t===175||t===240}function isClassLike(e){return e&&(e.kind===263||e.kind===231)}function isAccessor(e){return e&&(e.kind===177||e.kind===178)}function isAutoAccessorPropertyDeclaration(e){return isPropertyDeclaration(e)&&hasAccessorModifier(e)}function isClassInstanceProperty(e){if(isInJSFile(e)&&isExpandoPropertyDeclaration(e)){return(!isBindableStaticAccessExpression(e)||!isPrototypeAccess(e.expression))&&!isBindableStaticNameExpression(e,true)}return e.parent&&isClassLike(e.parent)&&isPropertyDeclaration(e)&&!hasAccessorModifier(e)}function isMethodOrAccessor(e){switch(e.kind){case 174:case 177:case 178:return true;default:return false}}function isModifierLike(e){return isModifier(e)||isDecorator(e)}function isTypeElement(e){const t=e.kind;return t===180||t===179||t===171||t===173||t===181||t===177||t===178||t===354}function isClassOrTypeElement(e){return isTypeElement(e)||isClassElement(e)}function isObjectLiteralElementLike(e){const t=e.kind;return t===303||t===304||t===305||t===174||t===177||t===178}function isTypeNode(e){return isTypeNodeKind(e.kind)}function isFunctionOrConstructorTypeNode(e){switch(e.kind){case 184:case 185:return true}return false}function isBindingPattern(e){if(e){const t=e.kind;return t===207||t===206}return false}function isAssignmentPattern(e){const t=e.kind;return t===209||t===210}function isArrayBindingElement(e){const t=e.kind;return t===208||t===232}function isDeclarationBindingElement(e){switch(e.kind){case 260:case 169:case 208:return true}return false}function isBindingOrAssignmentElement(e){return isVariableDeclaration(e)||isParameter(e)||isObjectBindingOrAssignmentElement(e)||isArrayBindingOrAssignmentElement(e)}function isBindingOrAssignmentPattern(e){return isObjectBindingOrAssignmentPattern(e)||isArrayBindingOrAssignmentPattern(e)}function isObjectBindingOrAssignmentPattern(e){switch(e.kind){case 206:case 210:return true}return false}function isObjectBindingOrAssignmentElement(e){switch(e.kind){case 208:case 303:case 304:case 305:return true}return false}function isArrayBindingOrAssignmentPattern(e){switch(e.kind){case 207:case 209:return true}return false}function isArrayBindingOrAssignmentElement(e){switch(e.kind){case 208:case 232:case 230:case 209:case 210:case 80:case 211:case 212:return true}return isAssignmentExpression(e,true)}function isPropertyAccessOrQualifiedNameOrImportTypeNode(e){const t=e.kind;return t===211||t===166||t===205}function isPropertyAccessOrQualifiedName(e){const t=e.kind;return t===211||t===166}function isCallLikeOrFunctionLikeExpression(e){return isCallLikeExpression(e)||isFunctionExpressionOrArrowFunction(e)}function isCallLikeExpression(e){switch(e.kind){case 213:case 214:case 215:case 170:case 286:case 285:case 289:return true;case 226:return e.operatorToken.kind===104;default:return false}}function isCallOrNewExpression(e){return e.kind===213||e.kind===214}function isTemplateLiteral(e){const t=e.kind;return t===228||t===15}function isLeftHandSideExpression(e){return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(e).kind)}function isLeftHandSideExpressionKind(e){switch(e){case 211:case 212:case 214:case 213:case 284:case 285:case 288:case 215:case 209:case 217:case 210:case 231:case 218:case 80:case 81:case 14:case 9:case 10:case 11:case 15:case 228:case 97:case 106:case 110:case 112:case 108:case 235:case 233:case 236:case 102:case 282:return true;default:return false}}function isUnaryExpression(e){return isUnaryExpressionKind(skipPartiallyEmittedExpressions(e).kind)}function isUnaryExpressionKind(e){switch(e){case 224:case 225:case 220:case 221:case 222:case 223:case 216:return true;default:return isLeftHandSideExpressionKind(e)}}function isUnaryExpressionWithWrite(e){switch(e.kind){case 225:return true;case 224:return e.operator===46||e.operator===47;default:return false}}function isLiteralTypeLiteral(e){switch(e.kind){case 106:case 112:case 97:case 224:return true;default:return isLiteralExpression(e)}}function isExpression(e){return isExpressionKind(skipPartiallyEmittedExpressions(e).kind)}function isExpressionKind(e){switch(e){case 227:case 229:case 219:case 226:case 230:case 234:case 232:case 356:case 355:case 238:return true;default:return isUnaryExpressionKind(e)}}function isAssertionExpression(e){const t=e.kind;return t===216||t===234}function isIterationStatement(e,t){switch(e.kind){case 248:case 249:case 250:case 246:case 247:return true;case 256:return t&&isIterationStatement(e.statement,t)}return false}function isScopeMarker(e){return isExportAssignment(e)||isExportDeclaration(e)}function hasScopeMarker(e){return some(e,isScopeMarker)}function needsScopeMarker(e){return!isAnyImportOrReExport(e)&&!isExportAssignment(e)&&!hasSyntacticModifier(e,32)&&!isAmbientModule(e)}function isExternalModuleIndicator(e){return isAnyImportOrReExport(e)||isExportAssignment(e)||hasSyntacticModifier(e,32)}function isForInOrOfStatement(e){return e.kind===249||e.kind===250}function isConciseBody(e){return isBlock(e)||isExpression(e)}function isFunctionBody(e){return isBlock(e)}function isForInitializer(e){return isVariableDeclarationList(e)||isExpression(e)}function isModuleBody(e){const t=e.kind;return t===268||t===267||t===80}function isNamespaceBody(e){const t=e.kind;return t===268||t===267}function isJSDocNamespaceBody(e){const t=e.kind;return t===80||t===267}function isNamedImportBindings(e){const t=e.kind;return t===275||t===274}function isModuleOrEnumDeclaration(e){return e.kind===267||e.kind===266}function canHaveSymbol(e){switch(e.kind){case 219:case 226:case 208:case 213:case 179:case 263:case 231:case 175:case 176:case 185:case 180:case 212:case 266:case 306:case 277:case 278:case 281:case 262:case 218:case 184:case 177:case 80:case 273:case 271:case 276:case 181:case 264:case 338:case 340:case 317:case 341:case 348:case 323:case 346:case 322:case 291:case 292:case 293:case 200:case 174:case 173:case 267:case 202:case 280:case 270:case 274:case 214:case 15:case 9:case 210:case 169:case 211:case 303:case 172:case 171:case 178:case 304:case 307:case 305:case 11:case 265:case 187:case 168:case 260:return true;default:return false}}function canHaveLocals(e){switch(e.kind){case 219:case 241:case 179:case 269:case 299:case 175:case 194:case 176:case 185:case 180:case 248:case 249:case 250:case 262:case 218:case 184:case 177:case 181:case 338:case 340:case 317:case 323:case 346:case 200:case 174:case 173:case 267:case 178:case 307:case 265:return true;default:return false}}function isDeclarationKind(e){return e===219||e===208||e===263||e===231||e===175||e===176||e===266||e===306||e===281||e===262||e===218||e===177||e===273||e===271||e===276||e===264||e===291||e===174||e===173||e===267||e===270||e===274||e===280||e===169||e===303||e===172||e===171||e===178||e===304||e===265||e===168||e===260||e===346||e===338||e===348||e===202}function isDeclarationStatementKind(e){return e===262||e===282||e===263||e===264||e===265||e===266||e===267||e===272||e===271||e===278||e===277||e===270}function isStatementKindButNotDeclarationKind(e){return e===252||e===251||e===259||e===246||e===244||e===242||e===249||e===250||e===248||e===245||e===256||e===253||e===255||e===257||e===258||e===243||e===247||e===254||e===353}function isDeclaration(e){if(e.kind===168){return e.parent&&e.parent.kind!==345||isInJSFile(e)}return isDeclarationKind(e.kind)}function isDeclarationStatement(e){return isDeclarationStatementKind(e.kind)}function isStatementButNotDeclaration(e){return isStatementKindButNotDeclarationKind(e.kind)}function isStatement(e){const t=e.kind;return isStatementKindButNotDeclarationKind(t)||isDeclarationStatementKind(t)||isBlockStatement(e)}function isBlockStatement(e){if(e.kind!==241)return false;if(e.parent!==void 0){if(e.parent.kind===258||e.parent.kind===299){return false}}return!isFunctionBlock(e)}function isStatementOrBlock(e){const t=e.kind;return isStatementKindButNotDeclarationKind(t)||isDeclarationStatementKind(t)||t===241}function isModuleReference(e){const t=e.kind;return t===283||t===166||t===80}function isJsxTagNameExpression(e){const t=e.kind;return t===110||t===80||t===211||t===295}function isJsxChild(e){const t=e.kind;return t===284||t===294||t===285||t===12||t===288}function isJsxAttributeLike(e){const t=e.kind;return t===291||t===293}function isStringLiteralOrJsxExpression(e){const t=e.kind;return t===11||t===294}function isJsxOpeningLikeElement(e){const t=e.kind;return t===286||t===285}function isJsxCallLike(e){const t=e.kind;return t===286||t===285||t===289}function isCaseOrDefaultClause(e){const t=e.kind;return t===296||t===297}function isJSDocNode(e){return e.kind>=309&&e.kind<=351}function isJSDocCommentContainingNode(e){return e.kind===320||e.kind===319||e.kind===321||isJSDocLinkLike(e)||isJSDocTag(e)||isJSDocTypeLiteral(e)||isJSDocSignature(e)}function isJSDocTag(e){return e.kind>=327&&e.kind<=351}function isSetAccessor(e){return e.kind===178}function isGetAccessor(e){return e.kind===177}function hasJSDocNodes(e){if(!canHaveJSDoc(e))return false;const{jsDoc:t}=e;return!!t&&t.length>0}function hasType(e){return!!e.type}function hasInitializer(e){return!!e.initializer}function hasOnlyExpressionInitializer(e){switch(e.kind){case 260:case 169:case 208:case 172:case 303:case 306:return true;default:return false}}function isObjectLiteralElement(e){return e.kind===291||e.kind===293||isObjectLiteralElementLike(e)}function isTypeReferenceType(e){return e.kind===183||e.kind===233}var an=1073741823;function guessIndentation(e){let t=an;for(const n of e){if(!n.length){continue}let e=0;for(;e0?n.parent.parameters[r-1]:void 0;const o=t.text;const a=i?concatenate(getTrailingCommentRanges(o,skipTrivia(o,i.end+1,false,true)),getLeadingCommentRanges(o,e.pos)):getTrailingCommentRanges(o,skipTrivia(o,e.pos,false,true));return some(a)&&hasInternalAnnotation(last(a),t)}const r=n&&getLeadingCommentRangesOfNode(n,t);return!!forEach(r,(e=>hasInternalAnnotation(e,t)))}var sn=[];var cn="tslib";var ln=160;var dn=1e6;function getDeclarationOfKind(e,t){const n=e.declarations;if(n){for(const e of n){if(e.kind===t){return e}}}return void 0}function getDeclarationsOfKind(e,t){return filter(e.declarations||d,(e=>e.kind===t))}function createSymbolTable(e){const t=new Map;if(e){for(const n of e){t.set(n.escapedName,n)}}return t}function isTransientSymbol(e){return(e.flags&33554432)!==0}function isExternalModuleSymbol(e){return!!(e.flags&1536)&&e.escapedName.charCodeAt(0)===34}var pn=createSingleLineStringWriter();function createSingleLineStringWriter(){var e="";const writeText=t=>e+=t;return{getText:()=>e,write:writeText,rawWrite:writeText,writeKeyword:writeText,writeOperator:writeText,writePunctuation:writeText,writeSpace:writeText,writeStringLiteral:writeText,writeLiteral:writeText,writeParameter:writeText,writeProperty:writeText,writeSymbol:(e,t)=>writeText(e),writeTrailingSemicolon:writeText,writeComment:writeText,getTextPos:()=>e.length,getLine:()=>0,getColumn:()=>0,getIndent:()=>0,isAtStartOfLine:()=>false,hasTrailingComment:()=>false,hasTrailingWhitespace:()=>!!e.length&&isWhiteSpaceLike(e.charCodeAt(e.length-1)),writeLine:()=>e+=" ",increaseIndent:noop,decreaseIndent:noop,clear:()=>e=""}}function changesAffectModuleResolution(e,t){return e.configFilePath!==t.configFilePath||optionsHaveModuleResolutionChanges(e,t)}function optionsHaveModuleResolutionChanges(e,t){return optionsHaveChanges(e,t,io)}function changesAffectingProgramStructure(e,t){return optionsHaveChanges(e,t,ao)}function optionsHaveChanges(e,t,n){return e!==t&&n.some((n=>!isJsonEqual(getCompilerOptionValue(e,n),getCompilerOptionValue(t,n))))}function forEachAncestor(e,t){while(true){const n=t(e);if(n==="quit")return void 0;if(n!==void 0)return n;if(isSourceFile(e))return void 0;e=e.parent}}function forEachEntry(e,t){const n=e.entries();for(const[e,r]of n){const n=t(r,e);if(n){return n}}return void 0}function forEachKey(e,t){const n=e.keys();for(const e of n){const n=t(e);if(n){return n}}return void 0}function copyEntries(e,t){e.forEach(((e,n)=>{t.set(n,e)}))}function usingSingleLineStringWriter(e){const t=pn.getText();try{e(pn);return pn.getText()}finally{pn.clear();pn.writeKeyword(t)}}function getFullWidth(e){return e.end-e.pos}function projectReferenceIsEqualTo(e,t){return e.path===t.path&&!e.prepend===!t.prepend&&!e.circular===!t.circular}function moduleResolutionIsEqualTo(e,t){return e===t||e.resolvedModule===t.resolvedModule||!!e.resolvedModule&&!!t.resolvedModule&&e.resolvedModule.isExternalLibraryImport===t.resolvedModule.isExternalLibraryImport&&e.resolvedModule.extension===t.resolvedModule.extension&&e.resolvedModule.resolvedFileName===t.resolvedModule.resolvedFileName&&e.resolvedModule.originalPath===t.resolvedModule.originalPath&&packageIdIsEqual(e.resolvedModule.packageId,t.resolvedModule.packageId)&&e.alternateResult===t.alternateResult}function getResolvedModuleFromResolution(e){return e.resolvedModule}function getResolvedTypeReferenceDirectiveFromResolution(e){return e.resolvedTypeReferenceDirective}function createModuleNotFoundChain(e,t,n,r,i){var o;const a=(o=t.getResolvedModule(e,n,r))==null?void 0:o.alternateResult;const s=a&&(qn(t.getCompilerOptions())===2?[wt.There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler,[a]]:[wt.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,[a,a.includes(Wo+"@types/")?`@types/${mangleScopedPackageName(i)}`:i]]);const c=s?chainDiagnosticMessages(void 0,s[0],...s[1]):t.typesPackageExists(i)?chainDiagnosticMessages(void 0,wt.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,i,mangleScopedPackageName(i)):t.packageBundlesTypes(i)?chainDiagnosticMessages(void 0,wt.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,i,n):chainDiagnosticMessages(void 0,wt.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,n,mangleScopedPackageName(i));if(c)c.repopulateInfo=()=>({moduleReference:n,mode:r,packageName:i===n?void 0:i});return c}function createModeMismatchDetails(e){const t=tryGetExtensionFromPath2(e.fileName);const n=e.packageJsonScope;const r=t===".ts"?".mts":t===".js"?".mjs":void 0;const i=n&&!n.contents.packageJsonContent.type?r?chainDiagnosticMessages(void 0,wt.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1,r,combinePaths(n.packageDirectory,"package.json")):chainDiagnosticMessages(void 0,wt.To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0,combinePaths(n.packageDirectory,"package.json")):r?chainDiagnosticMessages(void 0,wt.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module,r):chainDiagnosticMessages(void 0,wt.To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module);i.repopulateInfo=()=>true;return i}function packageIdIsEqual(e,t){return e===t||!!e&&!!t&&e.name===t.name&&e.subModuleName===t.subModuleName&&e.version===t.version&&e.peerDependencies===t.peerDependencies}function packageIdToPackageName({name:e,subModuleName:t}){return t?`${e}/${t}`:e}function packageIdToString(e){return`${packageIdToPackageName(e)}@${e.version}${e.peerDependencies??""}`}function typeDirectiveIsEqualTo(e,t){return e===t||e.resolvedTypeReferenceDirective===t.resolvedTypeReferenceDirective||!!e.resolvedTypeReferenceDirective&&!!t.resolvedTypeReferenceDirective&&e.resolvedTypeReferenceDirective.resolvedFileName===t.resolvedTypeReferenceDirective.resolvedFileName&&!!e.resolvedTypeReferenceDirective.primary===!!t.resolvedTypeReferenceDirective.primary&&e.resolvedTypeReferenceDirective.originalPath===t.resolvedTypeReferenceDirective.originalPath}function hasChangesInResolutions(e,t,n,r){S.assert(e.length===t.length);for(let i=0;i=0);return getLineStarts(t)[e]}function nodePosToString(e){const t=getSourceFileOfNode(e);const n=getLineAndCharacterOfPosition(t,e.pos);return`${t.fileName}(${n.line+1},${n.character+1})`}function getEndLinePosition(e,t){S.assert(e>=0);const n=getLineStarts(t);const r=e;const i=t.text;if(r+1===n.length){return i.length-1}else{const e=n[r];let t=n[r+1]-1;S.assert(isLineBreak(i.charCodeAt(t)));while(e<=t&&isLineBreak(i.charCodeAt(t))){t--}return t}}function isFileLevelUniqueName(e,t,n){return!(n&&n(t))&&!e.identifiers.has(t)}function nodeIsMissing(e){if(e===void 0){return true}return e.pos===e.end&&e.pos>=0&&e.kind!==1}function nodeIsPresent(e){return!nodeIsMissing(e)}function isGrammarError(e,t){if(isTypeParameterDeclaration(e))return t===e.expression;if(isClassStaticBlockDeclaration(e))return t===e.modifiers;if(isPropertySignature(e))return t===e.initializer;if(isPropertyDeclaration(e))return t===e.questionToken&&isAutoAccessorPropertyDeclaration(e);if(isPropertyAssignment(e))return t===e.modifiers||t===e.questionToken||t===e.exclamationToken||isGrammarErrorElement(e.modifiers,t,isModifierLike);if(isShorthandPropertyAssignment(e))return t===e.equalsToken||t===e.modifiers||t===e.questionToken||t===e.exclamationToken||isGrammarErrorElement(e.modifiers,t,isModifierLike);if(isMethodDeclaration(e))return t===e.exclamationToken;if(isConstructorDeclaration(e))return t===e.typeParameters||t===e.type||isGrammarErrorElement(e.typeParameters,t,isTypeParameterDeclaration);if(isGetAccessorDeclaration(e))return t===e.typeParameters||isGrammarErrorElement(e.typeParameters,t,isTypeParameterDeclaration);if(isSetAccessorDeclaration(e))return t===e.typeParameters||t===e.type||isGrammarErrorElement(e.typeParameters,t,isTypeParameterDeclaration);if(isNamespaceExportDeclaration(e))return t===e.modifiers||isGrammarErrorElement(e.modifiers,t,isModifierLike);return false}function isGrammarErrorElement(e,t,n){if(!e||isArray(t)||!n(t))return false;return contains(e,t)}function insertStatementsAfterPrologue(e,t,n){if(t===void 0||t.length===0)return e;let r=0;for(;r[`${getLineAndCharacterOfPosition(e,t.range.end).line}`,t])));const r=new Map;return{getUnusedExpectations:getUnusedExpectations,markUsed:markUsed};function getUnusedExpectations(){return arrayFrom(n.entries()).filter((([e,t])=>t.type===0&&!r.get(e))).map((([e,t])=>t))}function markUsed(e){if(!n.has(`${e}`)){return false}r.set(`${e}`,true);return true}}function getTokenPosOfNode(e,t,n){if(nodeIsMissing(e)){return e.pos}if(isJSDocNode(e)||e.kind===12){return skipTrivia((t??getSourceFileOfNode(e)).text,e.pos,false,true)}if(n&&hasJSDocNodes(e)){return getTokenPosOfNode(e.jsDoc[0],t)}if(e.kind===352){t??(t=getSourceFileOfNode(e));const r=firstOrUndefined(getNodeChildren(e,t));if(r){return getTokenPosOfNode(r,t,n)}}return skipTrivia((t??getSourceFileOfNode(e)).text,e.pos,false,false,isInJSDoc(e))}function getNonDecoratorTokenPosOfNode(e,t){const n=!nodeIsMissing(e)&&canHaveModifiers(e)?findLast(e.modifiers,isDecorator):void 0;if(!n){return getTokenPosOfNode(e,t)}return skipTrivia((t||getSourceFileOfNode(e)).text,n.end)}function getNonModifierTokenPosOfNode(e,t){const n=!nodeIsMissing(e)&&canHaveModifiers(e)&&e.modifiers?last(e.modifiers):void 0;if(!n){return getTokenPosOfNode(e,t)}return skipTrivia((t||getSourceFileOfNode(e)).text,n.end)}function getSourceTextOfNodeFromSourceFile(e,t,n=false){return getTextOfNodeFromSourceText(e.text,t,n)}function isJSDocTypeExpressionOrChild(e){return!!findAncestor(e,isJSDocTypeExpression)}function isExportNamespaceAsDefaultDeclaration(e){return!!(isExportDeclaration(e)&&e.exportClause&&isNamespaceExport(e.exportClause)&&moduleExportNameIsDefault(e.exportClause.name))}function moduleExportNameTextUnescaped(e){return e.kind===11?e.text:unescapeLeadingUnderscores(e.escapedText)}function moduleExportNameTextEscaped(e){return e.kind===11?escapeLeadingUnderscores(e.text):e.escapedText}function moduleExportNameIsDefault(e){return(e.kind===11?e.text:e.escapedText)==="default"}function getTextOfNodeFromSourceText(e,t,n=false){if(nodeIsMissing(t)){return""}let r=e.substring(n?t.pos:skipTrivia(e,t.pos),t.end);if(isJSDocTypeExpressionOrChild(t)){r=r.split(/\r\n|\n|\r/).map((e=>e.replace(/^\s*\*/,"").trimStart())).join("\n")}return r}function getTextOfNode(e,t=false){return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(e),e,t)}function getPos(e){return e.pos}function indexOfNode(e,t){return binarySearch(e,t,getPos,compareValues)}function getEmitFlags(e){const t=e.emitNode;return t&&t.flags||0}function getInternalEmitFlags(e){const t=e.emitNode;return t&&t.internalFlags||0}var un=memoize((()=>new Map(Object.entries({Array:new Map(Object.entries({es2015:["find","findIndex","fill","copyWithin","entries","keys","values"],es2016:["includes"],es2019:["flat","flatMap"],es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Iterator:new Map(Object.entries({es2015:d})),AsyncIterator:new Map(Object.entries({es2015:d})),ArrayBuffer:new Map(Object.entries({es2024:["maxByteLength","resizable","resize","detached","transfer","transferToFixedLength"]})),Atomics:new Map(Object.entries({es2017:["add","and","compareExchange","exchange","isLockFree","load","or","store","sub","wait","notify","xor"],es2024:["waitAsync"]})),SharedArrayBuffer:new Map(Object.entries({es2017:["byteLength","slice"],es2024:["growable","maxByteLength","grow"]})),AsyncIterable:new Map(Object.entries({es2018:d})),AsyncIterableIterator:new Map(Object.entries({es2018:d})),AsyncGenerator:new Map(Object.entries({es2018:d})),AsyncGeneratorFunction:new Map(Object.entries({es2018:d})),RegExp:new Map(Object.entries({es2015:["flags","sticky","unicode"],es2018:["dotAll"],es2024:["unicodeSets"]})),Reflect:new Map(Object.entries({es2015:["apply","construct","defineProperty","deleteProperty","get","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"]})),ArrayConstructor:new Map(Object.entries({es2015:["from","of"],esnext:["fromAsync"]})),ObjectConstructor:new Map(Object.entries({es2015:["assign","getOwnPropertySymbols","keys","is","setPrototypeOf"],es2017:["values","entries","getOwnPropertyDescriptors"],es2019:["fromEntries"],es2022:["hasOwn"],es2024:["groupBy"]})),NumberConstructor:new Map(Object.entries({es2015:["isFinite","isInteger","isNaN","isSafeInteger","parseFloat","parseInt"]})),Math:new Map(Object.entries({es2015:["clz32","imul","sign","log10","log2","log1p","expm1","cosh","sinh","tanh","acosh","asinh","atanh","hypot","trunc","fround","cbrt"],esnext:["f16round"]})),Map:new Map(Object.entries({es2015:["entries","keys","values"]})),MapConstructor:new Map(Object.entries({es2024:["groupBy"]})),Set:new Map(Object.entries({es2015:["entries","keys","values"],esnext:["union","intersection","difference","symmetricDifference","isSubsetOf","isSupersetOf","isDisjointFrom"]})),PromiseConstructor:new Map(Object.entries({es2015:["all","race","reject","resolve"],es2020:["allSettled"],es2021:["any"],es2024:["withResolvers"]})),Symbol:new Map(Object.entries({es2015:["for","keyFor"],es2019:["description"]})),WeakMap:new Map(Object.entries({es2015:["entries","keys","values"]})),WeakSet:new Map(Object.entries({es2015:["entries","keys","values"]})),String:new Map(Object.entries({es2015:["codePointAt","includes","endsWith","normalize","repeat","startsWith","anchor","big","blink","bold","fixed","fontcolor","fontsize","italics","link","small","strike","sub","sup"],es2017:["padStart","padEnd"],es2019:["trimStart","trimEnd","trimLeft","trimRight"],es2020:["matchAll"],es2021:["replaceAll"],es2022:["at"],es2024:["isWellFormed","toWellFormed"]})),StringConstructor:new Map(Object.entries({es2015:["fromCodePoint","raw"]})),DateTimeFormat:new Map(Object.entries({es2017:["formatToParts"]})),Promise:new Map(Object.entries({es2015:d,es2018:["finally"]})),RegExpMatchArray:new Map(Object.entries({es2018:["groups"]})),RegExpExecArray:new Map(Object.entries({es2018:["groups"]})),Intl:new Map(Object.entries({es2018:["PluralRules"]})),NumberFormat:new Map(Object.entries({es2018:["formatToParts"]})),SymbolConstructor:new Map(Object.entries({es2020:["matchAll"],esnext:["metadata","dispose","asyncDispose"]})),DataView:new Map(Object.entries({es2020:["setBigInt64","setBigUint64","getBigInt64","getBigUint64"],esnext:["setFloat16","getFloat16"]})),BigInt:new Map(Object.entries({es2020:d})),RelativeTimeFormat:new Map(Object.entries({es2020:["format","formatToParts","resolvedOptions"]})),Int8Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Uint8Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Uint8ClampedArray:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Int16Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Uint16Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Int32Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Uint32Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Float16Array:new Map(Object.entries({esnext:d})),Float32Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Float64Array:new Map(Object.entries({es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),BigInt64Array:new Map(Object.entries({es2020:d,es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),BigUint64Array:new Map(Object.entries({es2020:d,es2022:["at"],es2023:["findLastIndex","findLast","toReversed","toSorted","toSpliced","with"]})),Error:new Map(Object.entries({es2022:["cause"]}))}))));var fn=(e=>{e[e["None"]=0]="None";e[e["NeverAsciiEscape"]=1]="NeverAsciiEscape";e[e["JsxAttributeEscape"]=2]="JsxAttributeEscape";e[e["TerminateUnterminatedLiterals"]=4]="TerminateUnterminatedLiterals";e[e["AllowNumericSeparator"]=8]="AllowNumericSeparator";return e})(fn||{});function getLiteralText(e,t,n){if(t&&canUseOriginalText(e,n)){return getSourceTextOfNodeFromSourceFile(t,e)}switch(e.kind){case 11:{const t=n&2?escapeJsxAttributeString:n&1||getEmitFlags(e)&16777216?escapeString:escapeNonAsciiString;if(e.singleQuote){return"'"+t(e.text,39)+"'"}else{return'"'+t(e.text,34)+'"'}}case 15:case 16:case 17:case 18:{const t=n&1||getEmitFlags(e)&16777216?escapeString:escapeNonAsciiString;const r=e.rawText??escapeTemplateSubstitution(t(e.text,96));switch(e.kind){case 15:return"`"+r+"`";case 16:return"`"+r+"${";case 17:return"}"+r+"${";case 18:return"}"+r+"`"}break}case 9:case 10:return e.text;case 14:if(n&4&&e.isUnterminated){return e.text+(e.text.charCodeAt(e.text.length-1)===92?" /":"/")}return e.text}return S.fail(`Literal kind '${e.kind}' not accounted for.`)}function canUseOriginalText(e,t){if(nodeIsSynthesized(e)||!e.parent||t&4&&e.isUnterminated){return false}if(isNumericLiteral(e)){if(e.numericLiteralFlags&26656){return false}if(e.numericLiteralFlags&512){return!!(t&8)}}return!isBigIntLiteral(e)}function getTextOfConstantValue(e){return isString(e)?`"${escapeString(e)}"`:""+e}function makeIdentifierFromModuleName(e){return getBaseFileName(e).replace(/^(\d)/,"_$1").replace(/\W/g,"_")}function isBlockOrCatchScoped(e){return(getCombinedNodeFlags(e)&7)!==0||isCatchClauseVariableDeclarationOrBindingElement(e)}function isCatchClauseVariableDeclarationOrBindingElement(e){const t=getRootDeclaration(e);return t.kind===260&&t.parent.kind===299}function isAmbientModule(e){return isModuleDeclaration(e)&&(e.name.kind===11||isGlobalScopeAugmentation(e))}function isModuleWithStringLiteralName(e){return isModuleDeclaration(e)&&e.name.kind===11}function isNonGlobalAmbientModule(e){return isModuleDeclaration(e)&&isStringLiteral(e.name)}function isEffectiveModuleDeclaration(e){return isModuleDeclaration(e)||isIdentifier(e)}function isShorthandAmbientModuleSymbol(e){return isShorthandAmbientModule(e.valueDeclaration)}function isShorthandAmbientModule(e){return!!e&&e.kind===267&&!e.body}function isBlockScopedContainerTopLevel(e){return e.kind===307||e.kind===267||isFunctionLikeOrClassStaticBlockDeclaration(e)}function isGlobalScopeAugmentation(e){return!!(e.flags&2048)}function isExternalModuleAugmentation(e){return isAmbientModule(e)&&isModuleAugmentationExternal(e)}function isModuleAugmentationExternal(e){switch(e.parent.kind){case 307:return isExternalModule(e.parent);case 268:return isAmbientModule(e.parent.parent)&&isSourceFile(e.parent.parent.parent)&&!isExternalModule(e.parent.parent.parent)}return false}function getNonAugmentationDeclaration(e){var t;return(t=e.declarations)==null?void 0:t.find((e=>!isExternalModuleAugmentation(e)&&!(isModuleDeclaration(e)&&isGlobalScopeAugmentation(e))))}function isCommonJSContainingModuleKind(e){return e===1||100<=e&&e<=199}function isEffectiveExternalModule(e,t){return isExternalModule(e)||isCommonJSContainingModuleKind(Vn(t))&&!!e.commonJsModuleIndicator}function isEffectiveStrictModeSourceFile(e,t){switch(e.scriptKind){case 1:case 3:case 2:case 4:break;default:return false}if(e.isDeclarationFile){return false}if(getStrictOptionValue(t,"alwaysStrict")){return true}if(startsWithUseStrict(e.statements)){return true}if(isExternalModule(e)||Gn(t)){return true}return false}function isAmbientPropertyDeclaration(e){return!!(e.flags&33554432)||hasSyntacticModifier(e,128)}function isBlockScope(e,t){switch(e.kind){case 307:case 269:case 299:case 267:case 248:case 249:case 250:case 176:case 174:case 177:case 178:case 262:case 218:case 219:case 172:case 175:return true;case 241:return!isFunctionLikeOrClassStaticBlockDeclaration(t)}return false}function isDeclarationWithTypeParameters(e){S.type(e);switch(e.kind){case 338:case 346:case 323:return true;default:assertType(e);return isDeclarationWithTypeParameterChildren(e)}}function isDeclarationWithTypeParameterChildren(e){S.type(e);switch(e.kind){case 179:case 180:case 173:case 181:case 184:case 185:case 317:case 263:case 231:case 264:case 265:case 345:case 262:case 174:case 176:case 177:case 178:case 218:case 219:return true;default:assertType(e);return false}}function isAnyImportSyntax(e){switch(e.kind){case 272:case 271:return true;default:return false}}function isAnyImportOrBareOrAccessedRequire(e){return isAnyImportSyntax(e)||isVariableDeclarationInitializedToBareOrAccessedRequire(e)}function isAnyImportOrRequireStatement(e){return isAnyImportSyntax(e)||isRequireVariableStatement(e)}function isLateVisibilityPaintedStatement(e){switch(e.kind){case 272:case 271:case 243:case 263:case 262:case 267:case 265:case 264:case 266:return true;default:return false}}function hasPossibleExternalModuleReference(e){return isAnyImportOrReExport(e)||isModuleDeclaration(e)||isImportTypeNode(e)||isImportCall(e)}function isAnyImportOrReExport(e){return isAnyImportSyntax(e)||isExportDeclaration(e)}function getEnclosingContainer(e){return findAncestor(e.parent,(e=>!!(getContainerFlags(e)&1)))}function getEnclosingBlockScopeContainer(e){return findAncestor(e.parent,(e=>isBlockScope(e,e.parent)))}function forEachEnclosingBlockScopeContainer(e,t){let n=getEnclosingBlockScopeContainer(e);while(n){t(n);n=getEnclosingBlockScopeContainer(n)}}function declarationNameToString(e){return!e||getFullWidth(e)===0?"(Missing)":getTextOfNode(e)}function getNameFromIndexInfo(e){return e.declaration?declarationNameToString(e.declaration.parameters[0].name):void 0}function isComputedNonLiteralName(e){return e.kind===167&&!isStringOrNumericLiteralLike(e.expression)}function tryGetTextOfPropertyName(e){var t;switch(e.kind){case 80:case 81:return((t=e.emitNode)==null?void 0:t.autoGenerate)?void 0:e.escapedText;case 11:case 9:case 10:case 15:return escapeLeadingUnderscores(e.text);case 167:if(isStringOrNumericLiteralLike(e.expression))return escapeLeadingUnderscores(e.expression.text);return void 0;case 295:return getEscapedTextOfJsxNamespacedName(e);default:return S.assertNever(e)}}function getTextOfPropertyName(e){return S.checkDefined(tryGetTextOfPropertyName(e))}function entityNameToString(e){switch(e.kind){case 110:return"this";case 81:case 80:return getFullWidth(e)===0?idText(e):getTextOfNode(e);case 166:return entityNameToString(e.left)+"."+entityNameToString(e.right);case 211:if(isIdentifier(e.name)||isPrivateIdentifier(e.name)){return entityNameToString(e.expression)+"."+entityNameToString(e.name)}else{return S.assertNever(e.name)}case 311:return entityNameToString(e.left)+"#"+entityNameToString(e.right);case 295:return entityNameToString(e.namespace)+":"+entityNameToString(e.name);default:return S.assertNever(e)}}function createDiagnosticForNode(e,t,...n){const r=getSourceFileOfNode(e);return createDiagnosticForNodeInSourceFile(r,e,t,...n)}function createDiagnosticForNodeArray(e,t,n,...r){const i=skipTrivia(e.text,t.pos);return createFileDiagnostic(e,i,t.end-i,n,...r)}function createDiagnosticForNodeInSourceFile(e,t,n,...r){const i=getErrorSpanForNode(e,t);return createFileDiagnostic(e,i.start,i.length,n,...r)}function createDiagnosticForNodeFromMessageChain(e,t,n,r){const i=getErrorSpanForNode(e,t);return createFileDiagnosticFromMessageChain(e,i.start,i.length,n,r)}function createDiagnosticForNodeArrayFromMessageChain(e,t,n,r){const i=skipTrivia(e.text,t.pos);return createFileDiagnosticFromMessageChain(e,i,t.end-i,n,r)}function assertDiagnosticLocation(e,t,n){S.assertGreaterThanOrEqual(t,0);S.assertGreaterThanOrEqual(n,0);S.assertLessThanOrEqual(t,e.length);S.assertLessThanOrEqual(t+n,e.length)}function createFileDiagnosticFromMessageChain(e,t,n,r,i){assertDiagnosticLocation(e.text,t,n);return{file:e,start:t,length:n,code:r.code,category:r.category,messageText:r.next?r:r.messageText,relatedInformation:i,canonicalHead:r.canonicalHead}}function createDiagnosticForFileFromMessageChain(e,t,n){return{file:e,start:0,length:0,code:t.code,category:t.category,messageText:t.next?t:t.messageText,relatedInformation:n}}function createDiagnosticMessageChainFromDiagnostic(e){return typeof e.messageText==="string"?{code:e.code,category:e.category,messageText:e.messageText,next:e.next}:e.messageText}function createDiagnosticForRange(e,t,n){return{file:e,start:t.pos,length:t.end-t.pos,code:n.code,category:n.category,messageText:n.message}}function getCanonicalDiagnostic(e,...t){return{code:e.code,messageText:formatMessage(e,...t)}}function getSpanOfTokenAtPosition(e,t){const n=createScanner(e.languageVersion,true,e.languageVariant,e.text,void 0,t);n.scan();const r=n.getTokenStart();return createTextSpanFromBounds(r,n.getTokenEnd())}function scanTokenAtPosition(e,t){const n=createScanner(e.languageVersion,true,e.languageVariant,e.text,void 0,t);n.scan();return n.getToken()}function getErrorSpanForArrowFunction(e,t){const n=skipTrivia(e.text,t.pos);if(t.body&&t.body.kind===241){const{line:r}=getLineAndCharacterOfPosition(e,t.body.pos);const{line:i}=getLineAndCharacterOfPosition(e,t.body.end);if(r0?t.statements[0].pos:t.end;return createTextSpanFromBounds(n,r)}case 253:case 229:{const n=skipTrivia(e.text,t.pos);return getSpanOfTokenAtPosition(e,n)}case 238:{const n=skipTrivia(e.text,t.expression.end);return getSpanOfTokenAtPosition(e,n)}case 350:{const n=skipTrivia(e.text,t.tagName.pos);return getSpanOfTokenAtPosition(e,n)}case 176:{const n=t;const r=skipTrivia(e.text,n.pos);const i=createScanner(e.languageVersion,true,e.languageVariant,e.text,void 0,r);let o=i.scan();while(o!==137&&o!==1){o=i.scan()}const a=i.getTokenEnd();return createTextSpanFromBounds(r,a)}}if(n===void 0){return getSpanOfTokenAtPosition(e,t.pos)}S.assert(!isJSDoc(n));const r=nodeIsMissing(n);const i=r||isJsxText(t)?n.pos:skipTrivia(e.text,n.pos);if(r){S.assert(i===n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809");S.assert(i===n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")}else{S.assert(i>=n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809");S.assert(i<=n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")}return createTextSpanFromBounds(i,n.end)}function isGlobalSourceFile(e){return e.kind===307&&!isExternalOrCommonJsModule(e)}function isExternalOrCommonJsModule(e){return(e.externalModuleIndicator||e.commonJsModuleIndicator)!==void 0}function isJsonSourceFile(e){return e.scriptKind===6}function isEnumConst(e){return!!(getCombinedModifierFlags(e)&4096)}function isDeclarationReadonly(e){return!!(getCombinedModifierFlags(e)&8&&!isParameterPropertyDeclaration(e,e.parent))}function isVarAwaitUsing(e){return(getCombinedNodeFlags(e)&7)===6}function isVarUsing(e){return(getCombinedNodeFlags(e)&7)===4}function isVarConst(e){return(getCombinedNodeFlags(e)&7)===2}function isVarConstLike(e){const t=getCombinedNodeFlags(e)&7;return t===2||t===4||t===6}function isLet(e){return(getCombinedNodeFlags(e)&7)===1}function isSuperCall(e){return e.kind===213&&e.expression.kind===108}function isImportCall(e){return e.kind===213&&e.expression.kind===102}function isImportMeta(e){return isMetaProperty(e)&&e.keywordToken===102&&e.name.escapedText==="meta"}function isLiteralImportTypeNode(e){return isImportTypeNode(e)&&isLiteralTypeNode(e.argument)&&isStringLiteral(e.argument.literal)}function isPrologueDirective(e){return e.kind===244&&e.expression.kind===11}function isCustomPrologue(e){return!!(getEmitFlags(e)&2097152)}function isHoistedFunction(e){return isCustomPrologue(e)&&isFunctionDeclaration(e)}function isHoistedVariable(e){return isIdentifier(e.name)&&!e.initializer}function isHoistedVariableStatement(e){return isCustomPrologue(e)&&isVariableStatement(e)&&every(e.declarationList.declarations,isHoistedVariable)}function getLeadingCommentRangesOfNode(e,t){return e.kind!==12?getLeadingCommentRanges(t.text,e.pos):void 0}function getJSDocCommentRanges(e,t){const n=e.kind===169||e.kind===168||e.kind===218||e.kind===219||e.kind===217||e.kind===260||e.kind===281?concatenate(getTrailingCommentRanges(t,e.pos),getLeadingCommentRanges(t,e.pos)):getLeadingCommentRanges(t,e.pos);return filter(n,(n=>n.end<=e.end&&t.charCodeAt(n.pos+1)===42&&t.charCodeAt(n.pos+2)===42&&t.charCodeAt(n.pos+3)!==47))}var mn=/^\/\/\/\s*/;var _n=/^\/\/\/\s*/;var gn=/^\/\/\/\s*/;var yn=/^\/\/\/\s*/;var hn=/^\/\/\/\s*/;var Tn=/^\/\/\/\s*/;function isPartOfTypeNode(e){if(182<=e.kind&&e.kind<=205){return true}switch(e.kind){case 133:case 159:case 150:case 163:case 154:case 136:case 155:case 151:case 157:case 106:case 146:return true;case 116:return e.parent.kind!==222;case 233:return isPartOfTypeExpressionWithTypeArguments(e);case 168:return e.parent.kind===200||e.parent.kind===195;case 80:if(e.parent.kind===166&&e.parent.right===e){e=e.parent}else if(e.parent.kind===211&&e.parent.name===e){e=e.parent}S.assert(e.kind===80||e.kind===166||e.kind===211,"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");case 166:case 211:case 110:{const{parent:t}=e;if(t.kind===186){return false}if(t.kind===205){return!t.isTypeOf}if(182<=t.kind&&t.kind<=205){return true}switch(t.kind){case 233:return isPartOfTypeExpressionWithTypeArguments(t);case 168:return e===t.constraint;case 345:return e===t.constraint;case 172:case 171:case 169:case 260:return e===t.type;case 262:case 218:case 219:case 176:case 174:case 173:case 177:case 178:return e===t.type;case 179:case 180:case 181:return e===t.type;case 216:return e===t.type;case 213:case 214:case 215:return contains(t.typeArguments,e)}}}return false}function isPartOfTypeExpressionWithTypeArguments(e){return isJSDocImplementsTag(e.parent)||isJSDocAugmentsTag(e.parent)||isHeritageClause(e.parent)&&!isExpressionWithTypeArgumentsInClassExtendsClause(e)}function forEachReturnStatement(e,t){return traverse(e);function traverse(e){switch(e.kind){case 253:return t(e);case 269:case 241:case 245:case 246:case 247:case 248:case 249:case 250:case 254:case 255:case 296:case 297:case 256:case 258:case 299:return forEachChild(e,traverse)}}}function forEachYieldExpression(e,t){return traverse(e);function traverse(e){switch(e.kind){case 229:t(e);const n=e.expression;if(n){traverse(n)}return;case 266:case 264:case 267:case 265:return;default:if(isFunctionLike(e)){if(e.name&&e.name.kind===167){traverse(e.name.expression);return}}else if(!isPartOfTypeNode(e)){forEachChild(e,traverse)}}}}function getRestParameterElementType(e){if(e&&e.kind===188){return e.elementType}else if(e&&e.kind===183){return singleOrUndefined(e.typeArguments)}else{return void 0}}function getMembersOfDeclaration(e){switch(e.kind){case 264:case 263:case 231:case 187:return e.members;case 210:return e.properties}}function isVariableLike(e){if(e){switch(e.kind){case 208:case 306:case 169:case 303:case 172:case 171:case 304:case 260:return true}}return false}function isVariableDeclarationInVariableStatement(e){return e.parent.kind===261&&e.parent.parent.kind===243}function isCommonJsExportedExpression(e){if(!isInJSFile(e))return false;return isObjectLiteralExpression(e.parent)&&isBinaryExpression(e.parent.parent)&&getAssignmentDeclarationKind(e.parent.parent)===2||isCommonJsExportPropertyAssignment(e.parent)}function isCommonJsExportPropertyAssignment(e){if(!isInJSFile(e))return false;return isBinaryExpression(e)&&getAssignmentDeclarationKind(e)===1}function isValidESSymbolDeclaration(e){return(isVariableDeclaration(e)?isVarConst(e)&&isIdentifier(e.name)&&isVariableDeclarationInVariableStatement(e):isPropertyDeclaration(e)?hasEffectiveReadonlyModifier(e)&&hasStaticModifier(e):isPropertySignature(e)&&hasEffectiveReadonlyModifier(e))||isCommonJsExportPropertyAssignment(e)}function introducesArgumentsExoticObject(e){switch(e.kind){case 174:case 173:case 176:case 177:case 178:case 262:case 218:return true}return false}function unwrapInnermostStatementOfLabel(e,t){while(true){if(t){t(e)}if(e.statement.kind!==256){return e.statement}e=e.statement}}function isFunctionBlock(e){return e&&e.kind===241&&isFunctionLike(e.parent)}function isObjectLiteralMethod(e){return e&&e.kind===174&&e.parent.kind===210}function isObjectLiteralOrClassExpressionMethodOrAccessor(e){return(e.kind===174||e.kind===177||e.kind===178)&&(e.parent.kind===210||e.parent.kind===231)}function isIdentifierTypePredicate(e){return e&&e.kind===1}function isThisTypePredicate(e){return e&&e.kind===0}function forEachPropertyAssignment(e,t,n,r){return forEach(e==null?void 0:e.properties,(e=>{if(!isPropertyAssignment(e))return void 0;const i=tryGetTextOfPropertyName(e.name);return t===i||r&&r===i?n(e):void 0}))}function getTsConfigObjectLiteralExpression(e){if(e&&e.statements.length){const t=e.statements[0].expression;return tryCast(t,isObjectLiteralExpression)}}function getTsConfigPropArrayElementValue(e,t,n){return forEachTsConfigPropArray(e,t,(e=>isArrayLiteralExpression(e.initializer)?find(e.initializer.elements,(e=>isStringLiteral(e)&&e.text===n)):void 0))}function forEachTsConfigPropArray(e,t,n){return forEachPropertyAssignment(getTsConfigObjectLiteralExpression(e),t,n)}function getContainingFunction(e){return findAncestor(e.parent,isFunctionLike)}function getContainingFunctionDeclaration(e){return findAncestor(e.parent,isFunctionLikeDeclaration)}function getContainingClass(e){return findAncestor(e.parent,isClassLike)}function getContainingClassStaticBlock(e){return findAncestor(e.parent,(e=>{if(isClassLike(e)||isFunctionLike(e)){return"quit"}return isClassStaticBlockDeclaration(e)}))}function getContainingFunctionOrClassStaticBlock(e){return findAncestor(e.parent,isFunctionLikeOrClassStaticBlockDeclaration)}function getContainingClassExcludingClassDecorators(e){const t=findAncestor(e.parent,(e=>isClassLike(e)?"quit":isDecorator(e)));return t&&isClassLike(t.parent)?getContainingClass(t.parent):getContainingClass(t??e)}function getThisContainer(e,t,n){S.assert(e.kind!==307);while(true){e=e.parent;if(!e){return S.fail()}switch(e.kind){case 167:if(n&&isClassLike(e.parent.parent)){return e}e=e.parent.parent;break;case 170:if(e.parent.kind===169&&isClassElement(e.parent.parent)){e=e.parent.parent}else if(isClassElement(e.parent)){e=e.parent}break;case 219:if(!t){continue}case 262:case 218:case 267:case 175:case 172:case 171:case 174:case 173:case 176:case 177:case 178:case 179:case 180:case 181:case 266:case 307:return e}}}function isThisContainerOrFunctionBlock(e){switch(e.kind){case 219:case 262:case 218:case 172:return true;case 241:switch(e.parent.kind){case 176:case 174:case 177:case 178:return true;default:return false}default:return false}}function isInTopLevelContext(e){if(isIdentifier(e)&&(isClassDeclaration(e.parent)||isFunctionDeclaration(e.parent))&&e.parent.name===e){e=e.parent}const t=getThisContainer(e,true,false);return isSourceFile(t)}function getNewTargetContainer(e){const t=getThisContainer(e,false,false);if(t){switch(t.kind){case 176:case 262:case 218:return t}}return void 0}function getSuperContainer(e,t){while(true){e=e.parent;if(!e){return void 0}switch(e.kind){case 167:e=e.parent;break;case 262:case 218:case 219:if(!t){continue}case 172:case 171:case 174:case 173:case 176:case 177:case 178:case 175:return e;case 170:if(e.parent.kind===169&&isClassElement(e.parent.parent)){e=e.parent.parent}else if(isClassElement(e.parent)){e=e.parent}break}}}function getImmediatelyInvokedFunctionExpression(e){if(e.kind===218||e.kind===219){let t=e;let n=e.parent;while(n.kind===217){t=n;n=n.parent}if(n.kind===213&&n.expression===t){return n}}}function isSuperProperty(e){const t=e.kind;return(t===211||t===212)&&e.expression.kind===108}function isThisProperty(e){const t=e.kind;return(t===211||t===212)&&e.expression.kind===110}function isThisInitializedDeclaration(e){var t;return!!e&&isVariableDeclaration(e)&&((t=e.initializer)==null?void 0:t.kind)===110}function isThisInitializedObjectBindingExpression(e){return!!e&&(isShorthandPropertyAssignment(e)||isPropertyAssignment(e))&&isBinaryExpression(e.parent.parent)&&e.parent.parent.operatorToken.kind===64&&e.parent.parent.right.kind===110}function getEntityNameFromTypeNode(e){switch(e.kind){case 183:return e.typeName;case 233:return isEntityNameExpression(e.expression)?e.expression:void 0;case 80:case 166:return e}return void 0}function getInvokedExpression(e){switch(e.kind){case 215:return e.tag;case 286:case 285:return e.tagName;case 226:return e.right;case 289:return e;default:return e.expression}}function nodeCanBeDecorated(e,t,n,r){if(e&&isNamedDeclaration(t)&&isPrivateIdentifier(t.name)){return false}switch(t.kind){case 263:return true;case 231:return!e;case 172:return n!==void 0&&(e?isClassDeclaration(n):isClassLike(n)&&!hasAbstractModifier(t)&&!hasAmbientModifier(t));case 177:case 178:case 174:return t.body!==void 0&&n!==void 0&&(e?isClassDeclaration(n):isClassLike(n));case 169:if(!e)return false;return n!==void 0&&n.body!==void 0&&(n.kind===176||n.kind===174||n.kind===178)&&getThisParameter(n)!==t&&r!==void 0&&r.kind===263}return false}function nodeIsDecorated(e,t,n,r){return hasDecorators(t)&&nodeCanBeDecorated(e,t,n,r)}function nodeOrChildIsDecorated(e,t,n,r){return nodeIsDecorated(e,t,n,r)||childIsDecorated(e,t,n)}function childIsDecorated(e,t,n){switch(t.kind){case 263:return some(t.members,(r=>nodeOrChildIsDecorated(e,r,t,n)));case 231:return!e&&some(t.members,(r=>nodeOrChildIsDecorated(e,r,t,n)));case 174:case 178:case 176:return some(t.parameters,(r=>nodeIsDecorated(e,r,t,n)));default:return false}}function classOrConstructorParameterIsDecorated(e,t){if(nodeIsDecorated(e,t))return true;const n=getFirstConstructorWithBody(t);return!!n&&childIsDecorated(e,n,t)}function classElementOrClassElementParameterIsDecorated(e,t,n){let r;if(isAccessor(t)){const{firstAccessor:e,secondAccessor:i,setAccessor:o}=getAllAccessorDeclarations(n.members,t);const a=hasDecorators(e)?e:i&&hasDecorators(i)?i:void 0;if(!a||t!==a){return false}r=o==null?void 0:o.parameters}else if(isMethodDeclaration(t)){r=t.parameters}if(nodeIsDecorated(e,t,n)){return true}if(r){for(const i of r){if(parameterIsThisKeyword(i))continue;if(nodeIsDecorated(e,i,t,n))return true}}return false}function isEmptyStringLiteral(e){if(e.textSourceNode){switch(e.textSourceNode.kind){case 11:return isEmptyStringLiteral(e.textSourceNode);case 15:return e.text===""}return false}return e.text===""}function isJSXTagName(e){const{parent:t}=e;if(t.kind===286||t.kind===285||t.kind===287){return t.tagName===e}return false}function isExpressionNode(e){switch(e.kind){case 108:case 106:case 112:case 97:case 14:case 209:case 210:case 211:case 212:case 213:case 214:case 215:case 234:case 216:case 238:case 235:case 217:case 218:case 231:case 219:case 222:case 220:case 221:case 224:case 225:case 226:case 227:case 230:case 228:case 232:case 284:case 285:case 288:case 229:case 223:case 236:return true;case 233:return!isHeritageClause(e.parent)&&!isJSDocAugmentsTag(e.parent);case 166:while(e.parent.kind===166){e=e.parent}return e.parent.kind===186||isJSDocLinkLike(e.parent)||isJSDocNameReference(e.parent)||isJSDocMemberName(e.parent)||isJSXTagName(e);case 311:while(isJSDocMemberName(e.parent)){e=e.parent}return e.parent.kind===186||isJSDocLinkLike(e.parent)||isJSDocNameReference(e.parent)||isJSDocMemberName(e.parent)||isJSXTagName(e);case 81:return isBinaryExpression(e.parent)&&e.parent.left===e&&e.parent.operatorToken.kind===103;case 80:if(e.parent.kind===186||isJSDocLinkLike(e.parent)||isJSDocNameReference(e.parent)||isJSDocMemberName(e.parent)||isJSXTagName(e)){return true}case 9:case 10:case 11:case 15:case 110:return isInExpressionContext(e);default:return false}}function isInExpressionContext(e){const{parent:t}=e;switch(t.kind){case 260:case 169:case 172:case 171:case 306:case 303:case 208:return t.initializer===e;case 244:case 245:case 246:case 247:case 253:case 254:case 255:case 296:case 257:return t.expression===e;case 248:const n=t;return n.initializer===e&&n.initializer.kind!==261||n.condition===e||n.incrementor===e;case 249:case 250:const r=t;return r.initializer===e&&r.initializer.kind!==261||r.expression===e;case 216:case 234:return e===t.expression;case 239:return e===t.expression;case 167:return e===t.expression;case 170:case 294:case 293:case 305:return true;case 233:return t.expression===e&&!isPartOfTypeNode(t);case 304:return t.objectAssignmentInitializer===e;case 238:return e===t.expression;default:return isExpressionNode(t)}}function isPartOfTypeQuery(e){while(e.kind===166||e.kind===80){e=e.parent}return e.kind===186}function isNamespaceReexportDeclaration(e){return isNamespaceExport(e)&&!!e.parent.moduleSpecifier}function isExternalModuleImportEqualsDeclaration(e){return e.kind===271&&e.moduleReference.kind===283}function getExternalModuleImportEqualsDeclarationExpression(e){S.assert(isExternalModuleImportEqualsDeclaration(e));return e.moduleReference.expression}function getExternalModuleRequireArgument(e){return isVariableDeclarationInitializedToBareOrAccessedRequire(e)&&getLeftmostAccessExpression(e.initializer).arguments[0]}function isInternalModuleImportEqualsDeclaration(e){return e.kind===271&&e.moduleReference.kind!==283}function isFullSourceFile(e){return(e==null?void 0:e.kind)===307}function isSourceFileJS(e){return isInJSFile(e)}function isInJSFile(e){return!!e&&!!(e.flags&524288)}function isInJsonFile(e){return!!e&&!!(e.flags&134217728)}function isSourceFileNotJson(e){return!isJsonSourceFile(e)}function isInJSDoc(e){return!!e&&!!(e.flags&16777216)}function isJSDocIndexSignature(e){return isTypeReferenceNode(e)&&isIdentifier(e.typeName)&&e.typeName.escapedText==="Object"&&e.typeArguments&&e.typeArguments.length===2&&(e.typeArguments[0].kind===154||e.typeArguments[0].kind===150)}function isRequireCall(e,t){if(e.kind!==213){return false}const{expression:n,arguments:r}=e;if(n.kind!==80||n.escapedText!=="require"){return false}if(r.length!==1){return false}const i=r[0];return!t||isStringLiteralLike(i)}function isVariableDeclarationInitializedToRequire(e){return isVariableDeclarationInitializedWithRequireHelper(e,false)}function isVariableDeclarationInitializedToBareOrAccessedRequire(e){return isVariableDeclarationInitializedWithRequireHelper(e,true)}function isBindingElementOfBareOrAccessedRequire(e){return isBindingElement(e)&&isVariableDeclarationInitializedToBareOrAccessedRequire(e.parent.parent)}function isVariableDeclarationInitializedWithRequireHelper(e,t){return isVariableDeclaration(e)&&!!e.initializer&&isRequireCall(t?getLeftmostAccessExpression(e.initializer):e.initializer,true)}function isRequireVariableStatement(e){return isVariableStatement(e)&&e.declarationList.declarations.length>0&&every(e.declarationList.declarations,(e=>isVariableDeclarationInitializedToRequire(e)))}function isSingleOrDoubleQuote(e){return e===39||e===34}function isStringDoubleQuoted(e,t){return getSourceTextOfNodeFromSourceFile(t,e).charCodeAt(0)===34}function isAssignmentDeclaration(e){return isBinaryExpression(e)||isAccessExpression(e)||isIdentifier(e)||isCallExpression(e)}function getEffectiveInitializer(e){if(isInJSFile(e)&&e.initializer&&isBinaryExpression(e.initializer)&&(e.initializer.operatorToken.kind===57||e.initializer.operatorToken.kind===61)&&e.name&&isEntityNameExpression(e.name)&&isSameEntityName(e.name,e.initializer.left)){return e.initializer.right}return e.initializer}function getDeclaredExpandoInitializer(e){const t=getEffectiveInitializer(e);return t&&getExpandoInitializer(t,isPrototypeAccess(e.name))}function hasExpandoValueProperty(e,t){return forEach(e.properties,(e=>isPropertyAssignment(e)&&isIdentifier(e.name)&&e.name.escapedText==="value"&&e.initializer&&getExpandoInitializer(e.initializer,t)))}function getAssignedExpandoInitializer(e){if(e&&e.parent&&isBinaryExpression(e.parent)&&e.parent.operatorToken.kind===64){const t=isPrototypeAccess(e.parent.left);return getExpandoInitializer(e.parent.right,t)||getDefaultedExpandoInitializer(e.parent.left,e.parent.right,t)}if(e&&isCallExpression(e)&&isBindableObjectDefinePropertyCall(e)){const t=hasExpandoValueProperty(e.arguments[2],e.arguments[1].text==="prototype");if(t){return t}}}function getExpandoInitializer(e,t){if(isCallExpression(e)){const t=skipParentheses(e.expression);return t.kind===218||t.kind===219?e:void 0}if(e.kind===218||e.kind===231||e.kind===219){return e}if(isObjectLiteralExpression(e)&&(e.properties.length===0||t)){return e}}function getDefaultedExpandoInitializer(e,t,n){const r=isBinaryExpression(t)&&(t.operatorToken.kind===57||t.operatorToken.kind===61)&&getExpandoInitializer(t.right,n);if(r&&isSameEntityName(e,t.left)){return r}}function isDefaultedExpandoInitializer(e){const t=isVariableDeclaration(e.parent)?e.parent.name:isBinaryExpression(e.parent)&&e.parent.operatorToken.kind===64?e.parent.left:void 0;return t&&getExpandoInitializer(e.right,isPrototypeAccess(t))&&isEntityNameExpression(t)&&isSameEntityName(t,e.left)}function getNameOfExpando(e){if(isBinaryExpression(e.parent)){const t=(e.parent.operatorToken.kind===57||e.parent.operatorToken.kind===61)&&isBinaryExpression(e.parent.parent)?e.parent.parent:e.parent;if(t.operatorToken.kind===64&&isIdentifier(t.left)){return t.left}}else if(isVariableDeclaration(e.parent)){return e.parent.name}}function isSameEntityName(e,t){if(isPropertyNameLiteral(e)&&isPropertyNameLiteral(t)){return getTextOfIdentifierOrLiteral(e)===getTextOfIdentifierOrLiteral(t)}if(isMemberName(e)&&isLiteralLikeAccess(t)&&(t.expression.kind===110||isIdentifier(t.expression)&&(t.expression.escapedText==="window"||t.expression.escapedText==="self"||t.expression.escapedText==="global"))){return isSameEntityName(e,getNameOrArgument(t))}if(isLiteralLikeAccess(e)&&isLiteralLikeAccess(t)){return getElementOrPropertyAccessName(e)===getElementOrPropertyAccessName(t)&&isSameEntityName(e.expression,t.expression)}return false}function getRightMostAssignedExpression(e){while(isAssignmentExpression(e,true)){e=e.right}return e}function isExportsIdentifier(e){return isIdentifier(e)&&e.escapedText==="exports"}function isModuleIdentifier(e){return isIdentifier(e)&&e.escapedText==="module"}function isModuleExportsAccessExpression(e){return(isPropertyAccessExpression(e)||isLiteralLikeElementAccess(e))&&isModuleIdentifier(e.expression)&&getElementOrPropertyAccessName(e)==="exports"}function getAssignmentDeclarationKind(e){const t=getAssignmentDeclarationKindWorker(e);return t===5||isInJSFile(e)?t:0}function isBindableObjectDefinePropertyCall(e){return length(e.arguments)===3&&isPropertyAccessExpression(e.expression)&&isIdentifier(e.expression.expression)&&idText(e.expression.expression)==="Object"&&idText(e.expression.name)==="defineProperty"&&isStringOrNumericLiteralLike(e.arguments[1])&&isBindableStaticNameExpression(e.arguments[0],true)}function isLiteralLikeAccess(e){return isPropertyAccessExpression(e)||isLiteralLikeElementAccess(e)}function isLiteralLikeElementAccess(e){return isElementAccessExpression(e)&&isStringOrNumericLiteralLike(e.argumentExpression)}function isBindableStaticAccessExpression(e,t){return isPropertyAccessExpression(e)&&(!t&&e.expression.kind===110||isIdentifier(e.name)&&isBindableStaticNameExpression(e.expression,true))||isBindableStaticElementAccessExpression(e,t)}function isBindableStaticElementAccessExpression(e,t){return isLiteralLikeElementAccess(e)&&(!t&&e.expression.kind===110||isEntityNameExpression(e.expression)||isBindableStaticAccessExpression(e.expression,true))}function isBindableStaticNameExpression(e,t){return isEntityNameExpression(e)||isBindableStaticAccessExpression(e,t)}function getNameOrArgument(e){if(isPropertyAccessExpression(e)){return e.name}return e.argumentExpression}function getAssignmentDeclarationKindWorker(e){if(isCallExpression(e)){if(!isBindableObjectDefinePropertyCall(e)){return 0}const t=e.arguments[0];if(isExportsIdentifier(t)||isModuleExportsAccessExpression(t)){return 8}if(isBindableStaticAccessExpression(t)&&getElementOrPropertyAccessName(t)==="prototype"){return 9}return 7}if(e.operatorToken.kind!==64||!isAccessExpression(e.left)||isVoidZero(getRightMostAssignedExpression(e))){return 0}if(isBindableStaticNameExpression(e.left.expression,true)&&getElementOrPropertyAccessName(e.left)==="prototype"&&isObjectLiteralExpression(getInitializerOfBinaryExpression(e))){return 6}return getAssignmentDeclarationPropertyAccessKind(e.left)}function isVoidZero(e){return isVoidExpression(e)&&isNumericLiteral(e.expression)&&e.expression.text==="0"}function getElementOrPropertyAccessArgumentExpressionOrName(e){if(isPropertyAccessExpression(e)){return e.name}const t=skipParentheses(e.argumentExpression);if(isNumericLiteral(t)||isStringLiteralLike(t)){return t}return e}function getElementOrPropertyAccessName(e){const t=getElementOrPropertyAccessArgumentExpressionOrName(e);if(t){if(isIdentifier(t)){return t.escapedText}if(isStringLiteralLike(t)||isNumericLiteral(t)){return escapeLeadingUnderscores(t.text)}}return void 0}function getAssignmentDeclarationPropertyAccessKind(e){if(e.expression.kind===110){return 4}else if(isModuleExportsAccessExpression(e)){return 2}else if(isBindableStaticNameExpression(e.expression,true)){if(isPrototypeAccess(e.expression)){return 3}let t=e;while(!isIdentifier(t.expression)){t=t.expression}const n=t.expression;if((n.escapedText==="exports"||n.escapedText==="module"&&getElementOrPropertyAccessName(t)==="exports")&&isBindableStaticAccessExpression(e)){return 1}if(isBindableStaticNameExpression(e,true)||isElementAccessExpression(e)&&isDynamicName(e)){return 5}}return 0}function getInitializerOfBinaryExpression(e){while(isBinaryExpression(e.right)){e=e.right}return e.right}function isPrototypePropertyAssignment(e){return isBinaryExpression(e)&&getAssignmentDeclarationKind(e)===3}function isSpecialPropertyDeclaration(e){return isInJSFile(e)&&e.parent&&e.parent.kind===244&&(!isElementAccessExpression(e)||isLiteralLikeElementAccess(e))&&!!getJSDocTypeTag(e.parent)}function setValueDeclaration(e,t){const{valueDeclaration:n}=e;if(!n||!(t.flags&33554432&&!isInJSFile(t)&&!(n.flags&33554432))&&(isAssignmentDeclaration(n)&&!isAssignmentDeclaration(t))||n.kind!==t.kind&&isEffectiveModuleDeclaration(n)){e.valueDeclaration=t}}function isFunctionSymbol(e){if(!e||!e.valueDeclaration){return false}const t=e.valueDeclaration;return t.kind===262||isVariableDeclaration(t)&&t.initializer&&isFunctionLike(t.initializer)}function canHaveModuleSpecifier(e){switch(e==null?void 0:e.kind){case 260:case 208:case 272:case 278:case 271:case 273:case 280:case 274:case 281:case 276:case 205:return true}return false}function tryGetModuleSpecifierFromDeclaration(e){var t,n;switch(e.kind){case 260:case 208:return(t=findAncestor(e.initializer,(e=>isRequireCall(e,true))))==null?void 0:t.arguments[0];case 272:case 278:case 351:return tryCast(e.moduleSpecifier,isStringLiteralLike);case 271:return tryCast((n=tryCast(e.moduleReference,isExternalModuleReference))==null?void 0:n.expression,isStringLiteralLike);case 273:case 280:return tryCast(e.parent.moduleSpecifier,isStringLiteralLike);case 274:case 281:return tryCast(e.parent.parent.moduleSpecifier,isStringLiteralLike);case 276:return tryCast(e.parent.parent.parent.moduleSpecifier,isStringLiteralLike);case 205:return isLiteralImportTypeNode(e)?e.argument.literal:void 0;default:S.assertNever(e)}}function importFromModuleSpecifier(e){return tryGetImportFromModuleSpecifier(e)||S.failBadSyntaxKind(e.parent)}function tryGetImportFromModuleSpecifier(e){switch(e.parent.kind){case 272:case 278:case 351:return e.parent;case 283:return e.parent.parent;case 213:return isImportCall(e.parent)||isRequireCall(e.parent,false)?e.parent:void 0;case 201:if(!isStringLiteral(e)){break}return tryCast(e.parent.parent,isImportTypeNode);default:return void 0}}function shouldRewriteModuleSpecifier(e,t){return!!t.rewriteRelativeImportExtensions&&pathIsRelative(e)&&!isDeclarationFileName(e)&&hasTSFileExtension(e)}function getExternalModuleName(e){switch(e.kind){case 272:case 278:case 351:return e.moduleSpecifier;case 271:return e.moduleReference.kind===283?e.moduleReference.expression:void 0;case 205:return isLiteralImportTypeNode(e)?e.argument.literal:void 0;case 213:return e.arguments[0];case 267:return e.name.kind===11?e.name:void 0;default:return S.assertNever(e)}}function getNamespaceDeclarationNode(e){switch(e.kind){case 272:return e.importClause&&tryCast(e.importClause.namedBindings,isNamespaceImport);case 271:return e;case 278:return e.exportClause&&tryCast(e.exportClause,isNamespaceExport);default:return S.assertNever(e)}}function isDefaultImport(e){return(e.kind===272||e.kind===351)&&!!e.importClause&&!!e.importClause.name}function forEachImportClauseDeclaration(e,t){if(e.name){const n=t(e);if(n)return n}if(e.namedBindings){const n=isNamespaceImport(e.namedBindings)?t(e.namedBindings):forEach(e.namedBindings.elements,t);if(n)return n}}function hasQuestionToken(e){switch(e.kind){case 169:case 174:case 173:case 304:case 303:case 172:case 171:return e.questionToken!==void 0}return false}function isJSDocConstructSignature(e){const t=isJSDocFunctionType(e)?firstOrUndefined(e.parameters):void 0;const n=tryCast(t&&t.name,isIdentifier);return!!n&&n.escapedText==="new"}function isJSDocTypeAlias(e){return e.kind===346||e.kind===338||e.kind===340}function isTypeAlias(e){return isJSDocTypeAlias(e)||isTypeAliasDeclaration(e)}function getSourceOfAssignment(e){return isExpressionStatement(e)&&isBinaryExpression(e.expression)&&e.expression.operatorToken.kind===64?getRightMostAssignedExpression(e.expression):void 0}function getSourceOfDefaultedAssignment(e){return isExpressionStatement(e)&&isBinaryExpression(e.expression)&&getAssignmentDeclarationKind(e.expression)!==0&&isBinaryExpression(e.expression.right)&&(e.expression.right.operatorToken.kind===57||e.expression.right.operatorToken.kind===61)?e.expression.right.right:void 0}function getSingleInitializerOfVariableStatementOrPropertyDeclaration(e){switch(e.kind){case 243:const t=getSingleVariableOfVariableStatement(e);return t&&t.initializer;case 172:return e.initializer;case 303:return e.initializer}}function getSingleVariableOfVariableStatement(e){return isVariableStatement(e)?firstOrUndefined(e.declarationList.declarations):void 0}function getNestedModuleDeclaration(e){return isModuleDeclaration(e)&&e.body&&e.body.kind===267?e.body:void 0}function canHaveFlowNode(e){if(e.kind>=243&&e.kind<=259){return true}switch(e.kind){case 80:case 110:case 108:case 166:case 236:case 212:case 211:case 208:case 218:case 219:case 174:case 177:case 178:return true;default:return false}}function canHaveJSDoc(e){switch(e.kind){case 219:case 226:case 241:case 252:case 179:case 296:case 263:case 231:case 175:case 176:case 185:case 180:case 251:case 259:case 246:case 212:case 242:case 1:case 266:case 306:case 277:case 278:case 281:case 244:case 249:case 250:case 248:case 262:case 218:case 184:case 177:case 80:case 245:case 272:case 271:case 181:case 264:case 317:case 323:case 256:case 174:case 173:case 267:case 202:case 270:case 210:case 169:case 217:case 211:case 303:case 172:case 171:case 253:case 240:case 178:case 304:case 305:case 255:case 257:case 258:case 265:case 168:case 260:case 243:case 247:case 254:return true;default:return false}}function getJSDocCommentsAndTags(e,t){let n;if(isVariableLike(e)&&hasInitializer(e)&&hasJSDocNodes(e.initializer)){n=addRange(n,filterOwnedJSDocTags(e,e.initializer.jsDoc))}let r=e;while(r&&r.parent){if(hasJSDocNodes(r)){n=addRange(n,filterOwnedJSDocTags(e,r.jsDoc))}if(r.kind===169){n=addRange(n,(t?getJSDocParameterTagsNoCache:getJSDocParameterTags)(r));break}if(r.kind===168){n=addRange(n,(t?getJSDocTypeParameterTagsNoCache:getJSDocTypeParameterTags)(r));break}r=getNextJSDocCommentLocation(r)}return n||d}function filterOwnedJSDocTags(e,t){const n=last(t);return flatMap(t,(t=>{if(t===n){const n=filter(t.tags,(t=>ownsJSDocTag(e,t)));return t.tags===n?[t]:n}else{return filter(t.tags,isJSDocOverloadTag)}}))}function ownsJSDocTag(e,t){return!(isJSDocTypeTag(t)||isJSDocSatisfiesTag(t))||!t.parent||!isJSDoc(t.parent)||!isParenthesizedExpression(t.parent.parent)||t.parent.parent===e}function getNextJSDocCommentLocation(e){const t=e.parent;if(t.kind===303||t.kind===277||t.kind===172||t.kind===244&&e.kind===211||t.kind===253||getNestedModuleDeclaration(t)||isAssignmentExpression(e)){return t}else if(t.parent&&(getSingleVariableOfVariableStatement(t.parent)===e||isAssignmentExpression(t))){return t.parent}else if(t.parent&&t.parent.parent&&(getSingleVariableOfVariableStatement(t.parent.parent)||getSingleInitializerOfVariableStatementOrPropertyDeclaration(t.parent.parent)===e||getSourceOfDefaultedAssignment(t.parent.parent))){return t.parent.parent}}function getParameterSymbolFromJSDoc(e){if(e.symbol){return e.symbol}if(!isIdentifier(e.name)){return void 0}const t=e.name.escapedText;const n=getHostSignatureFromJSDoc(e);if(!n){return void 0}const r=find(n.parameters,(e=>e.name.kind===80&&e.name.escapedText===t));return r&&r.symbol}function getEffectiveContainerForJSDocTemplateTag(e){if(isJSDoc(e.parent)&&e.parent.tags){const t=find(e.parent.tags,isJSDocTypeAlias);if(t){return t}}return getHostSignatureFromJSDoc(e)}function getJSDocOverloadTags(e){return getAllJSDocTags(e,isJSDocOverloadTag)}function getHostSignatureFromJSDoc(e){const t=getEffectiveJSDocHost(e);if(t){return isPropertySignature(t)&&t.type&&isFunctionLike(t.type)?t.type:isFunctionLike(t)?t:void 0}return void 0}function getEffectiveJSDocHost(e){const t=getJSDocHost(e);if(t){return getSourceOfDefaultedAssignment(t)||getSourceOfAssignment(t)||getSingleInitializerOfVariableStatementOrPropertyDeclaration(t)||getSingleVariableOfVariableStatement(t)||getNestedModuleDeclaration(t)||t}}function getJSDocHost(e){const t=getJSDocRoot(e);if(!t){return void 0}const n=t.parent;if(n&&n.jsDoc&&t===lastOrUndefined(n.jsDoc)){return n}}function getJSDocRoot(e){return findAncestor(e.parent,isJSDoc)}function getTypeParameterFromJsDoc(e){const t=e.name.escapedText;const{typeParameters:n}=e.parent.parent.parent;return n&&find(n,(e=>e.name.escapedText===t))}function hasTypeArguments(e){return!!e.typeArguments}var Sn=(e=>{e[e["None"]=0]="None";e[e["Definite"]=1]="Definite";e[e["Compound"]=2]="Compound";return e})(Sn||{});function getAssignmentTarget(e){let t=e.parent;while(true){switch(t.kind){case 226:const n=t;const r=n.operatorToken.kind;return isAssignmentOperator(r)&&n.left===e?n:void 0;case 224:case 225:const i=t;const o=i.operator;return o===46||o===47?i:void 0;case 249:case 250:const a=t;return a.initializer===e?a:void 0;case 217:case 209:case 230:case 235:e=t;break;case 305:e=t.parent;break;case 304:if(t.name!==e){return void 0}e=t.parent;break;case 303:if(t.name===e){return void 0}e=t.parent;break;default:return void 0}t=e.parent}}function getAssignmentTargetKind(e){const t=getAssignmentTarget(e);if(!t){return 0}switch(t.kind){case 226:const e=t.operatorToken.kind;return e===64||isLogicalOrCoalescingAssignmentOperator(e)?1:2;case 224:case 225:return 2;case 249:case 250:return 1}}function isAssignmentTarget(e){return!!getAssignmentTarget(e)}function isCompoundLikeAssignment(e){const t=skipParentheses(e.right);return t.kind===226&&isShiftOperatorOrHigher(t.operatorToken.kind)}function isInCompoundLikeAssignment(e){const t=getAssignmentTarget(e);return!!t&&isAssignmentExpression(t,true)&&isCompoundLikeAssignment(t)}function isNodeWithPossibleHoistedDeclaration(e){switch(e.kind){case 241:case 243:case 254:case 245:case 255:case 269:case 296:case 297:case 256:case 248:case 249:case 250:case 246:case 247:case 258:case 299:return true}return false}function isValueSignatureDeclaration(e){return isFunctionExpression(e)||isArrowFunction(e)||isMethodOrAccessor(e)||isFunctionDeclaration(e)||isConstructorDeclaration(e)}function walkUp(e,t){while(e&&e.kind===t){e=e.parent}return e}function walkUpParenthesizedTypes(e){return walkUp(e,196)}function walkUpParenthesizedExpressions(e){return walkUp(e,217)}function walkUpParenthesizedTypesAndGetParentAndChild(e){let t;while(e&&e.kind===196){t=e;e=e.parent}return[t,e]}function skipTypeParentheses(e){while(isParenthesizedTypeNode(e))e=e.type;return e}function skipParentheses(e,t){const n=t?1|-2147483648:1;return skipOuterExpressions(e,n)}function isDeleteTarget(e){if(e.kind!==211&&e.kind!==212){return false}e=walkUpParenthesizedExpressions(e.parent);return e&&e.kind===220}function isNodeDescendantOf(e,t){while(e){if(e===t)return true;e=e.parent}return false}function isDeclarationName(e){return!isSourceFile(e)&&!isBindingPattern(e)&&isDeclaration(e.parent)&&e.parent.name===e}function getDeclarationFromName(e){const t=e.parent;switch(e.kind){case 11:case 15:case 9:if(isComputedPropertyName(t))return t.parent;case 80:if(isDeclaration(t)){return t.name===e?t:void 0}else if(isQualifiedName(t)){const e=t.parent;return isJSDocParameterTag(e)&&e.name===t?e:void 0}else{const n=t.parent;return isBinaryExpression(n)&&getAssignmentDeclarationKind(n)!==0&&(n.left.symbol||n.symbol)&&getNameOfDeclaration(n)===e?n:void 0}case 81:return isDeclaration(t)&&t.name===e?t:void 0;default:return void 0}}function isLiteralComputedPropertyDeclarationName(e){return isStringOrNumericLiteralLike(e)&&e.parent.kind===167&&isDeclaration(e.parent.parent)}function isIdentifierName(e){const t=e.parent;switch(t.kind){case 172:case 171:case 174:case 173:case 177:case 178:case 306:case 303:case 211:return t.name===e;case 166:return t.right===e;case 208:case 276:return t.propertyName===e;case 281:case 291:case 285:case 286:case 287:return true}return false}function getAliasDeclarationFromName(e){switch(e.parent.kind){case 273:case 276:case 274:case 281:case 277:case 271:case 280:return e.parent;case 166:do{e=e.parent}while(e.parent.kind===166);return getAliasDeclarationFromName(e)}}function isAliasableExpression(e){return isEntityNameExpression(e)||isClassExpression(e)}function exportAssignmentIsAlias(e){const t=getExportAssignmentExpression(e);return isAliasableExpression(t)}function getExportAssignmentExpression(e){return isExportAssignment(e)?e.expression:e.right}function getPropertyAssignmentAliasLikeExpression(e){return e.kind===304?e.name:e.kind===303?e.initializer:e.parent.right}function getEffectiveBaseTypeNode(e){const t=getClassExtendsHeritageElement(e);if(t&&isInJSFile(e)){const t=getJSDocAugmentsTag(e);if(t){return t.class}}return t}function getClassExtendsHeritageElement(e){const t=getHeritageClause(e.heritageClauses,96);return t&&t.types.length>0?t.types[0]:void 0}function getEffectiveImplementsTypeNodes(e){if(isInJSFile(e)){return getJSDocImplementsTags(e).map((e=>e.class))}else{const t=getHeritageClause(e.heritageClauses,119);return t==null?void 0:t.types}}function getAllSuperTypeNodes(e){return isInterfaceDeclaration(e)?getInterfaceBaseTypeNodes(e)||d:isClassLike(e)?concatenate(singleElementArray(getEffectiveBaseTypeNode(e)),getEffectiveImplementsTypeNodes(e))||d:d}function getInterfaceBaseTypeNodes(e){const t=getHeritageClause(e.heritageClauses,96);return t?t.types:void 0}function getHeritageClause(e,t){if(e){for(const n of e){if(n.token===t){return n}}}return void 0}function getAncestor(e,t){while(e){if(e.kind===t){return e}e=e.parent}return void 0}function isKeyword(e){return 83<=e&&e<=165}function isPunctuation(e){return 19<=e&&e<=79}function isKeywordOrPunctuation(e){return isKeyword(e)||isPunctuation(e)}function isContextualKeyword(e){return 128<=e&&e<=165}function isNonContextualKeyword(e){return isKeyword(e)&&!isContextualKeyword(e)}function isStringANonContextualKeyword(e){const t=stringToToken(e);return t!==void 0&&isNonContextualKeyword(t)}function isIdentifierANonContextualKeyword(e){const t=identifierToKeywordKind(e);return!!t&&!isContextualKeyword(t)}function isTrivia(e){return 2<=e&&e<=7}var vn=(e=>{e[e["Normal"]=0]="Normal";e[e["Generator"]=1]="Generator";e[e["Async"]=2]="Async";e[e["Invalid"]=4]="Invalid";e[e["AsyncGenerator"]=3]="AsyncGenerator";return e})(vn||{});function getFunctionFlags(e){if(!e){return 4}let t=0;switch(e.kind){case 262:case 218:case 174:if(e.asteriskToken){t|=1}case 219:if(hasSyntacticModifier(e,1024)){t|=2}break}if(!e.body){t|=4}return t}function isAsyncFunction(e){switch(e.kind){case 262:case 218:case 219:case 174:return e.body!==void 0&&e.asteriskToken===void 0&&hasSyntacticModifier(e,1024)}return false}function isStringOrNumericLiteralLike(e){return isStringLiteralLike(e)||isNumericLiteral(e)}function isSignedNumericLiteral(e){return isPrefixUnaryExpression(e)&&(e.operator===40||e.operator===41)&&isNumericLiteral(e.operand)}function hasDynamicName(e){const t=getNameOfDeclaration(e);return!!t&&isDynamicName(t)}function isDynamicName(e){if(!(e.kind===167||e.kind===212)){return false}const t=isElementAccessExpression(e)?skipParentheses(e.argumentExpression):e.expression;return!isStringOrNumericLiteralLike(t)&&!isSignedNumericLiteral(t)}function getPropertyNameForPropertyNameNode(e){switch(e.kind){case 80:case 81:return e.escapedText;case 11:case 15:case 9:case 10:return escapeLeadingUnderscores(e.text);case 167:const t=e.expression;if(isStringOrNumericLiteralLike(t)){return escapeLeadingUnderscores(t.text)}else if(isSignedNumericLiteral(t)){if(t.operator===41){return tokenToString(t.operator)+t.operand.text}return t.operand.text}return void 0;case 295:return getEscapedTextOfJsxNamespacedName(e);default:return S.assertNever(e)}}function isPropertyNameLiteral(e){switch(e.kind){case 80:case 11:case 15:case 9:return true;default:return false}}function getTextOfIdentifierOrLiteral(e){return isMemberName(e)?idText(e):isJsxNamespacedName(e)?getTextOfJsxNamespacedName(e):e.text}function getEscapedTextOfIdentifierOrLiteral(e){return isMemberName(e)?e.escapedText:isJsxNamespacedName(e)?getEscapedTextOfJsxNamespacedName(e):escapeLeadingUnderscores(e.text)}function getSymbolNameForPrivateIdentifier(e,t){return`__#${getSymbolId(e)}@${t}`}function isKnownSymbol(e){return startsWith(e.escapedName,"__@")}function isPrivateIdentifierSymbol(e){return startsWith(e.escapedName,"__#")}function isProtoSetter(e){return isIdentifier(e)?idText(e)==="__proto__":isStringLiteral(e)&&e.text==="__proto__"}function isAnonymousFunctionDefinition(e,t){e=skipOuterExpressions(e);switch(e.kind){case 231:if(classHasDeclaredOrExplicitlyAssignedName(e)){return false}break;case 218:if(e.name){return false}break;case 219:break;default:return false}return typeof t==="function"?t(e):true}function isNamedEvaluationSource(e){switch(e.kind){case 303:return!isProtoSetter(e.name);case 304:return!!e.objectAssignmentInitializer;case 260:return isIdentifier(e.name)&&!!e.initializer;case 169:return isIdentifier(e.name)&&!!e.initializer&&!e.dotDotDotToken;case 208:return isIdentifier(e.name)&&!!e.initializer&&!e.dotDotDotToken;case 172:return!!e.initializer;case 226:switch(e.operatorToken.kind){case 64:case 77:case 76:case 78:return isIdentifier(e.left)}break;case 277:return true}return false}function isNamedEvaluation(e,t){if(!isNamedEvaluationSource(e))return false;switch(e.kind){case 303:return isAnonymousFunctionDefinition(e.initializer,t);case 304:return isAnonymousFunctionDefinition(e.objectAssignmentInitializer,t);case 260:case 169:case 208:case 172:return isAnonymousFunctionDefinition(e.initializer,t);case 226:return isAnonymousFunctionDefinition(e.right,t);case 277:return isAnonymousFunctionDefinition(e.expression,t)}}function isPushOrUnshiftIdentifier(e){return e.escapedText==="push"||e.escapedText==="unshift"}function isPartOfParameterDeclaration(e){const t=getRootDeclaration(e);return t.kind===169}function getRootDeclaration(e){while(e.kind===208){e=e.parent.parent}return e}function nodeStartsNewLexicalEnvironment(e){const t=e.kind;return t===176||t===218||t===262||t===219||t===174||t===177||t===178||t===267||t===307}function nodeIsSynthesized(e){return positionIsSynthesized(e.pos)||positionIsSynthesized(e.end)}var xn=(e=>{e[e["Left"]=0]="Left";e[e["Right"]=1]="Right";return e})(xn||{});function getExpressionAssociativity(e){const t=getOperator(e);const n=e.kind===214&&e.arguments!==void 0;return getOperatorAssociativity(e.kind,t,n)}function getOperatorAssociativity(e,t,n){switch(e){case 214:return n?0:1;case 224:case 221:case 222:case 220:case 223:case 227:case 229:return 1;case 226:switch(t){case 43:case 64:case 65:case 66:case 68:case 67:case 69:case 70:case 71:case 72:case 73:case 74:case 79:case 75:case 76:case 77:case 78:return 1}}return 0}function getExpressionPrecedence(e){const t=getOperator(e);const n=e.kind===214&&e.arguments!==void 0;return getOperatorPrecedence(e.kind,t,n)}function getOperator(e){if(e.kind===226){return e.operatorToken.kind}else if(e.kind===224||e.kind===225){return e.operator}else{return e.kind}}var bn=(e=>{e[e["Comma"]=0]="Comma";e[e["Spread"]=1]="Spread";e[e["Yield"]=2]="Yield";e[e["Assignment"]=3]="Assignment";e[e["Conditional"]=4]="Conditional";e[e["Coalesce"]=4]="Coalesce";e[e["LogicalOR"]=5]="LogicalOR";e[e["LogicalAND"]=6]="LogicalAND";e[e["BitwiseOR"]=7]="BitwiseOR";e[e["BitwiseXOR"]=8]="BitwiseXOR";e[e["BitwiseAND"]=9]="BitwiseAND";e[e["Equality"]=10]="Equality";e[e["Relational"]=11]="Relational";e[e["Shift"]=12]="Shift";e[e["Additive"]=13]="Additive";e[e["Multiplicative"]=14]="Multiplicative";e[e["Exponentiation"]=15]="Exponentiation";e[e["Unary"]=16]="Unary";e[e["Update"]=17]="Update";e[e["LeftHandSide"]=18]="LeftHandSide";e[e["Member"]=19]="Member";e[e["Primary"]=20]="Primary";e[e["Highest"]=20]="Highest";e[e["Lowest"]=0]="Lowest";e[e["Invalid"]=-1]="Invalid";return e})(bn||{});function getOperatorPrecedence(e,t,n){switch(e){case 356:return 0;case 230:return 1;case 229:return 2;case 227:return 4;case 226:switch(t){case 28:return 0;case 64:case 65:case 66:case 68:case 67:case 69:case 70:case 71:case 72:case 73:case 74:case 79:case 75:case 76:case 77:case 78:return 3;default:return getBinaryOperatorPrecedence(t)}case 216:case 235:case 224:case 221:case 222:case 220:case 223:return 16;case 225:return 17;case 213:return 18;case 214:return n?19:18;case 215:case 211:case 212:case 236:return 19;case 234:case 238:return 11;case 110:case 108:case 80:case 81:case 106:case 112:case 97:case 9:case 10:case 11:case 209:case 210:case 218:case 219:case 231:case 14:case 15:case 228:case 217:case 232:case 284:case 285:case 288:return 20;default:return-1}}function getBinaryOperatorPrecedence(e){switch(e){case 61:return 4;case 57:return 5;case 56:return 6;case 52:return 7;case 53:return 8;case 51:return 9;case 35:case 36:case 37:case 38:return 10;case 30:case 32:case 33:case 34:case 104:case 103:case 130:case 152:return 11;case 48:case 49:case 50:return 12;case 40:case 41:return 13;case 42:case 44:case 45:return 14;case 43:return 15}return-1}function getSemanticJsxChildren(e){return filter(e,(e=>{switch(e.kind){case 294:return!!e.expression;case 12:return!e.containsOnlyTriviaWhiteSpaces;default:return true}}))}function createDiagnosticCollection(){let e=[];const t=[];const n=new Map;let r=false;return{add:add,lookup:lookup,getGlobalDiagnostics:getGlobalDiagnostics,getDiagnostics:getDiagnostics2};function lookup(t){let r;if(t.file){r=n.get(t.file.fileName)}else{r=e}if(!r){return void 0}const i=binarySearch(r,t,identity,compareDiagnosticsSkipRelatedInformation);if(i>=0){return r[i]}if(~i>0&&diagnosticsEqualityComparer(t,r[~i-1])){return r[~i-1]}return void 0}function add(i){let o;if(i.file){o=n.get(i.file.fileName);if(!o){o=[];n.set(i.file.fileName,o);insertSorted(t,i.file.fileName,compareStringsCaseSensitive)}}else{if(r){r=false;e=e.slice()}o=e}insertSorted(o,i,compareDiagnosticsSkipRelatedInformation,diagnosticsEqualityComparer)}function getGlobalDiagnostics(){r=true;return e}function getDiagnostics2(r){if(r){return n.get(r)||[]}const i=flatMapToMutable(t,(e=>n.get(e)));if(!e.length){return i}i.unshift(...e);return i}}var Cn=/\$\{/g;function escapeTemplateSubstitution(e){return e.replace(Cn,"\\${")}function containsInvalidEscapeFlag(e){return!!((e.templateFlags||0)&2048)}function hasInvalidEscape(e){return e&&!!(isNoSubstitutionTemplateLiteral(e)?containsInvalidEscapeFlag(e):containsInvalidEscapeFlag(e.head)||some(e.templateSpans,(e=>containsInvalidEscapeFlag(e.literal))))}var En=/[\\"\u0000-\u001f\u2028\u2029\u0085]/g;var Nn=/[\\'\u0000-\u001f\u2028\u2029\u0085]/g;var kn=/\r\n|[\\`\u0000-\u0009\u000b-\u001f\u2028\u2029\u0085]/g;var Fn=new Map(Object.entries({"\t":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","…":"\\u0085","\r\n":"\\r\\n"}));function encodeUtf16EscapeSequence(e){const t=e.toString(16).toUpperCase();const n=("0000"+t).slice(-4);return"\\u"+n}function getReplacement(e,t,n){if(e.charCodeAt(0)===0){const r=n.charCodeAt(t+e.length);if(r>=48&&r<=57){return"\\x00"}return"\\0"}return Fn.get(e)||encodeUtf16EscapeSequence(e.charCodeAt(0))}function escapeString(e,t){const n=t===96?kn:t===39?Nn:En;return e.replace(n,getReplacement)}var Pn=/[^\u0000-\u007F]/g;function escapeNonAsciiString(e,t){e=escapeString(e,t);return Pn.test(e)?e.replace(Pn,(e=>encodeUtf16EscapeSequence(e.charCodeAt(0)))):e}var Dn=/["\u0000-\u001f\u2028\u2029\u0085]/g;var In=/['\u0000-\u001f\u2028\u2029\u0085]/g;var An=new Map(Object.entries({'"':""","'":"'"}));function encodeJsxCharacterEntity(e){const t=e.toString(16).toUpperCase();return"&#x"+t+";"}function getJsxAttributeStringReplacement(e){if(e.charCodeAt(0)===0){return"�"}return An.get(e)||encodeJsxCharacterEntity(e.charCodeAt(0))}function escapeJsxAttributeString(e,t){const n=t===39?In:Dn;return e.replace(n,getJsxAttributeStringReplacement)}function stripQuotes(e){const t=e.length;if(t>=2&&e.charCodeAt(0)===e.charCodeAt(t-1)&&isQuoteOrBacktick(e.charCodeAt(0))){return e.substring(1,t-1)}return e}function isQuoteOrBacktick(e){return e===39||e===34||e===96}function isIntrinsicJsxName(e){const t=e.charCodeAt(0);return t>=97&&t<=122||e.includes("-")}var On=[""," "];function getIndentString(e){const t=On[1];for(let n=On.length;n<=e;n++){On.push(On[n-1]+t)}return On[e]}function getIndentSize(){return On[1].length}function createTextWriter(e){var t;var n;var r;var i;var o;var a=false;function updateLineCountAndPosFor(e){const n=computeLineStarts(e);if(n.length>1){i=i+n.length-1;o=t.length-e.length+last(n);r=o-t.length===0}else{r=false}}function writeText(e){if(e&&e.length){if(r){e=getIndentString(n)+e;r=false}t+=e;updateLineCountAndPosFor(e)}}function write(e){if(e)a=false;writeText(e)}function writeComment(e){if(e)a=true;writeText(e)}function reset2(){t="";n=0;r=true;i=0;o=0;a=false}function rawWrite(e){if(e!==void 0){t+=e;updateLineCountAndPosFor(e);a=false}}function writeLiteral(e){if(e&&e.length){write(e)}}function writeLine(n){if(!r||n){t+=e;i++;o=t.length;r=true;a=false}}reset2();return{write:write,rawWrite:rawWrite,writeLiteral:writeLiteral,writeLine:writeLine,increaseIndent:()=>{n++},decreaseIndent:()=>{n--},getIndent:()=>n,getTextPos:()=>t.length,getLine:()=>i,getColumn:()=>r?n*getIndentSize():t.length-o,getText:()=>t,isAtStartOfLine:()=>r,hasTrailingComment:()=>a,hasTrailingWhitespace:()=>!!t.length&&isWhiteSpaceLike(t.charCodeAt(t.length-1)),clear:reset2,writeKeyword:write,writeOperator:write,writeParameter:write,writeProperty:write,writePunctuation:write,writeSpace:write,writeStringLiteral:write,writeSymbol:(e,t)=>write(e),writeTrailingSemicolon:write,writeComment:writeComment}}function getTrailingSemicolonDeferringWriter(e){let t=false;function commitPendingTrailingSemicolon(){if(t){e.writeTrailingSemicolon(";");t=false}}return{...e,writeTrailingSemicolon(){t=true},writeLiteral(t){commitPendingTrailingSemicolon();e.writeLiteral(t)},writeStringLiteral(t){commitPendingTrailingSemicolon();e.writeStringLiteral(t)},writeSymbol(t,n){commitPendingTrailingSemicolon();e.writeSymbol(t,n)},writePunctuation(t){commitPendingTrailingSemicolon();e.writePunctuation(t)},writeKeyword(t){commitPendingTrailingSemicolon();e.writeKeyword(t)},writeOperator(t){commitPendingTrailingSemicolon();e.writeOperator(t)},writeParameter(t){commitPendingTrailingSemicolon();e.writeParameter(t)},writeSpace(t){commitPendingTrailingSemicolon();e.writeSpace(t)},writeProperty(t){commitPendingTrailingSemicolon();e.writeProperty(t)},writeComment(t){commitPendingTrailingSemicolon();e.writeComment(t)},writeLine(){commitPendingTrailingSemicolon();e.writeLine()},increaseIndent(){commitPendingTrailingSemicolon();e.increaseIndent()},decreaseIndent(){commitPendingTrailingSemicolon();e.decreaseIndent()}}}function hostUsesCaseSensitiveFileNames(e){return e.useCaseSensitiveFileNames?e.useCaseSensitiveFileNames():false}function hostGetCanonicalFileName(e){return createGetCanonicalFileName(hostUsesCaseSensitiveFileNames(e))}function getResolvedExternalModuleName(e,t,n){return t.moduleName||getExternalModuleNameFromPath(e,t.fileName,n&&n.fileName)}function getCanonicalAbsolutePath(e,t){return e.getCanonicalFileName(getNormalizedAbsolutePath(t,e.getCurrentDirectory()))}function getExternalModuleNameFromDeclaration(e,t,n){const r=t.getExternalModuleFileFromDeclaration(n);if(!r||r.isDeclarationFile){return void 0}const i=getExternalModuleName(n);if(i&&isStringLiteralLike(i)&&!pathIsRelative(i.text)&&!getCanonicalAbsolutePath(e,r.path).includes(getCanonicalAbsolutePath(e,ensureTrailingDirectorySeparator(e.getCommonSourceDirectory())))){return void 0}return getResolvedExternalModuleName(e,r)}function getExternalModuleNameFromPath(e,t,n){const getCanonicalFileName=t=>e.getCanonicalFileName(t);const r=toPath(n?getDirectoryPath(n):e.getCommonSourceDirectory(),e.getCurrentDirectory(),getCanonicalFileName);const i=getNormalizedAbsolutePath(t,e.getCurrentDirectory());const o=getRelativePathToDirectoryOrUrl(r,i,r,getCanonicalFileName,false);const a=removeFileExtension(o);return n?ensurePathIsNonModuleName(a):a}function getOwnEmitOutputFilePath(e,t,n){const r=t.getCompilerOptions();let i;if(r.outDir){i=removeFileExtension(getSourceFilePathInNewDir(e,t,r.outDir))}else{i=removeFileExtension(e)}return i+n}function getDeclarationEmitOutputFilePath(e,t){return getDeclarationEmitOutputFilePathWorker(e,t.getCompilerOptions(),t)}function getDeclarationEmitOutputFilePathWorker(e,t,n){const r=t.declarationDir||t.outDir;const i=r?getSourceFilePathInNewDirWorker(e,r,n.getCurrentDirectory(),n.getCommonSourceDirectory(),(e=>n.getCanonicalFileName(e))):e;const o=getDeclarationEmitExtensionForPath(i);return removeFileExtension(i)+o}function getDeclarationEmitExtensionForPath(e){return fileExtensionIsOneOf(e,[".mjs",".mts"])?".d.mts":fileExtensionIsOneOf(e,[".cjs",".cts"])?".d.cts":fileExtensionIsOneOf(e,[".json"])?`.d.json.ts`:".d.ts"}function getPossibleOriginalInputExtensionForExtension(e){return fileExtensionIsOneOf(e,[".d.mts",".mjs",".mts"])?[".mts",".mjs"]:fileExtensionIsOneOf(e,[".d.cts",".cjs",".cts"])?[".cts",".cjs"]:fileExtensionIsOneOf(e,[`.d.json.ts`])?[".json"]:[".tsx",".ts",".jsx",".js"]}function getPossibleOriginalInputPathWithoutChangingExt(e,t,n,r){return n?resolvePath(r(),getRelativePathFromDirectory(n,e,t)):e}function getPathsBasePath(e,t){var n;if(!e.paths)return void 0;return e.baseUrl??S.checkDefined(e.pathsBasePath||((n=t.getCurrentDirectory)==null?void 0:n.call(t)),"Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.")}function getSourceFilesToEmit(e,t,n){const r=e.getCompilerOptions();if(r.outFile){const t=Vn(r);const i=r.emitDeclarationOnly||t===2||t===4;return filter(e.getSourceFiles(),(t=>(i||!isExternalModule(t))&&sourceFileMayBeEmitted(t,e,n)))}else{const r=t===void 0?e.getSourceFiles():[t];return filter(r,(t=>sourceFileMayBeEmitted(t,e,n)))}}function sourceFileMayBeEmitted(e,t,n){const r=t.getCompilerOptions();if(r.noEmitForJsFiles&&isSourceFileJS(e))return false;if(e.isDeclarationFile)return false;if(t.isSourceFileFromExternalLibrary(e))return false;if(n)return true;if(t.isSourceOfProjectReferenceRedirect(e.fileName))return false;if(!isJsonSourceFile(e))return true;if(t.getResolvedProjectReferenceToRedirect(e.fileName))return false;if(r.outFile)return true;if(!r.outDir)return false;if(r.rootDir||r.composite&&r.configFilePath){const n=getNormalizedAbsolutePath(getCommonSourceDirectory(r,(()=>[]),t.getCurrentDirectory(),t.getCanonicalFileName),t.getCurrentDirectory());const i=getSourceFilePathInNewDirWorker(e.fileName,r.outDir,t.getCurrentDirectory(),n,t.getCanonicalFileName);if(comparePaths(e.fileName,i,t.getCurrentDirectory(),!t.useCaseSensitiveFileNames())===0)return false}return true}function getSourceFilePathInNewDir(e,t,n){return getSourceFilePathInNewDirWorker(e,n,t.getCurrentDirectory(),t.getCommonSourceDirectory(),(e=>t.getCanonicalFileName(e)))}function getSourceFilePathInNewDirWorker(e,t,n,r,i){let o=getNormalizedAbsolutePath(e,n);const a=i(o).indexOf(i(r))===0;o=a?o.substring(r.length):o;return combinePaths(t,o)}function writeFile(e,t,n,r,i,o,a){e.writeFile(n,r,i,(e=>{t.add(createCompilerDiagnostic(wt.Could_not_write_file_0_Colon_1,n,e))}),o,a)}function ensureDirectoriesExist(e,t,n){if(e.length>getRootLength(e)&&!n(e)){const r=getDirectoryPath(e);ensureDirectoriesExist(r,t,n);t(e)}}function writeFileEnsuringDirectories(e,t,n,r,i,o){try{r(e,t,n)}catch{ensureDirectoriesExist(getDirectoryPath(normalizePath(e)),i,o);r(e,t,n)}}function getLineOfLocalPosition(e,t){const n=getLineStarts(e);return computeLineOfPosition(n,t)}function getLineOfLocalPositionFromLineMap(e,t){return computeLineOfPosition(e,t)}function getFirstConstructorWithBody(e){return find(e.members,(e=>isConstructorDeclaration(e)&&nodeIsPresent(e.body)))}function getSetAccessorValueParameter(e){if(e&&e.parameters.length>0){const t=e.parameters.length===2&¶meterIsThisKeyword(e.parameters[0]);return e.parameters[t?1:0]}}function getSetAccessorTypeAnnotationNode(e){const t=getSetAccessorValueParameter(e);return t&&t.type}function getThisParameter(e){if(e.parameters.length&&!isJSDocSignature(e)){const t=e.parameters[0];if(parameterIsThisKeyword(t)){return t}}}function parameterIsThisKeyword(e){return isThisIdentifier(e.name)}function isThisIdentifier(e){return!!e&&e.kind===80&&identifierIsThisKeyword(e)}function isInTypeQuery(e){return!!findAncestor(e,(e=>e.kind===186?true:e.kind===80||e.kind===166?false:"quit"))}function isThisInTypeQuery(e){if(!isThisIdentifier(e)){return false}while(isQualifiedName(e.parent)&&e.parent.left===e){e=e.parent}return e.parent.kind===186}function identifierIsThisKeyword(e){return e.escapedText==="this"}function getAllAccessorDeclarations(e,t){let n;let r;let i;let o;if(hasDynamicName(t)){n=t;if(t.kind===177){i=t}else if(t.kind===178){o=t}else{S.fail("Accessor has wrong kind")}}else{forEach(e,(e=>{if(isAccessor(e)&&isStatic(e)===isStatic(t)){const a=getPropertyNameForPropertyNameNode(e.name);const s=getPropertyNameForPropertyNameNode(t.name);if(a===s){if(!n){n=e}else if(!r){r=e}if(e.kind===177&&!i){i=e}if(e.kind===178&&!o){o=e}}}}))}return{firstAccessor:n,secondAccessor:r,getAccessor:i,setAccessor:o}}function getEffectiveTypeAnnotationNode(e){if(!isInJSFile(e)&&isFunctionDeclaration(e))return void 0;if(isTypeAliasDeclaration(e))return void 0;const t=e.type;if(t||!isInJSFile(e))return t;return isJSDocPropertyLikeTag(e)?e.typeExpression&&e.typeExpression.type:getJSDocType(e)}function getTypeAnnotationNode(e){return e.type}function getEffectiveReturnTypeNode(e){return isJSDocSignature(e)?e.type&&e.type.typeExpression&&e.type.typeExpression.type:e.type||(isInJSFile(e)?getJSDocReturnType(e):void 0)}function getJSDocTypeParameterDeclarations(e){return flatMap(getJSDocTags(e),(e=>isNonTypeAliasTemplate(e)?e.typeParameters:void 0))}function isNonTypeAliasTemplate(e){return isJSDocTemplateTag(e)&&!(e.parent.kind===320&&(e.parent.tags.some(isJSDocTypeAlias)||e.parent.tags.some(isJSDocOverloadTag)))}function getEffectiveSetAccessorTypeAnnotationNode(e){const t=getSetAccessorValueParameter(e);return t&&getEffectiveTypeAnnotationNode(t)}function emitNewLineBeforeLeadingComments(e,t,n,r){emitNewLineBeforeLeadingCommentsOfPosition(e,t,n.pos,r)}function emitNewLineBeforeLeadingCommentsOfPosition(e,t,n,r){if(r&&r.length&&n!==r[0].pos&&getLineOfLocalPositionFromLineMap(e,n)!==getLineOfLocalPositionFromLineMap(e,r[0].pos)){t.writeLine()}}function emitNewLineBeforeLeadingCommentOfPosition(e,t,n,r){if(n!==r&&getLineOfLocalPositionFromLineMap(e,n)!==getLineOfLocalPositionFromLineMap(e,r)){t.writeLine()}}function emitComments(e,t,n,r,i,o,a,s){if(r&&r.length>0){if(i){n.writeSpace(" ")}let c=false;for(const i of r){if(c){n.writeSpace(" ");c=false}s(e,t,n,i.pos,i.end,a);if(i.hasTrailingNewLine){n.writeLine()}else{c=true}}if(c&&o){n.writeSpace(" ")}}}function emitDetachedComments(e,t,n,r,i,o,a){let s;let c;if(a){if(i.pos===0){s=filter(getLeadingCommentRanges(e,i.pos),isPinnedCommentLocal)}}else{s=getLeadingCommentRanges(e,i.pos)}if(s){const a=[];let l;for(const e of s){if(l){const n=getLineOfLocalPositionFromLineMap(t,l.end);const r=getLineOfLocalPositionFromLineMap(t,e.pos);if(r>=n+2){break}}a.push(e);l=e}if(a.length){const l=getLineOfLocalPositionFromLineMap(t,last(a).end);const d=getLineOfLocalPositionFromLineMap(t,skipTrivia(e,i.pos));if(d>=l+2){emitNewLineBeforeLeadingComments(t,n,i,s);emitComments(e,t,n,a,false,true,o,r);c={nodePos:i.pos,detachedCommentEndPos:last(a).end}}}}return c;function isPinnedCommentLocal(t){return isPinnedComment(e,t.pos)}}function writeCommentRange(e,t,n,r,i,o){if(e.charCodeAt(r+1)===42){const a=computeLineAndCharacterOfPosition(t,r);const s=t.length;let c;for(let l=r,d=a.line;l0){let e=o%getIndentSize();const t=getIndentString((o-e)/getIndentSize());n.rawWrite(t);while(e){n.rawWrite(" ");e--}}else{n.rawWrite("")}}writeTrimmedCurrentLine(e,i,n,o,l,p);l=p}}else{n.writeComment(e.substring(r,i))}}function writeTrimmedCurrentLine(e,t,n,r,i,o){const a=Math.min(t,o-1);const s=e.substring(i,a).trim();if(s){n.writeComment(s);if(a!==t){n.writeLine()}}else{n.rawWrite(r)}}function calculateIndent(e,t,n){let r=0;for(;t=0&&e.kind<=165){return 0}if(!(e.modifierFlagsCache&536870912)){e.modifierFlagsCache=getSyntacticModifierFlagsNoCache(e)|536870912}if(n||t&&isInJSFile(e)){if(!(e.modifierFlagsCache&268435456)&&e.parent){e.modifierFlagsCache|=getRawJSDocModifierFlagsNoCache(e)|268435456}return selectEffectiveModifierFlags(e.modifierFlagsCache)}return selectSyntacticModifierFlags(e.modifierFlagsCache)}function getEffectiveModifierFlags(e){return getModifierFlagsWorker(e,true)}function getEffectiveModifierFlagsAlwaysIncludeJSDoc(e){return getModifierFlagsWorker(e,true,true)}function getSyntacticModifierFlags(e){return getModifierFlagsWorker(e,false)}function getRawJSDocModifierFlagsNoCache(e){let t=0;if(!!e.parent&&!isParameter(e)){if(isInJSFile(e)){if(getJSDocPublicTagNoCache(e))t|=8388608;if(getJSDocPrivateTagNoCache(e))t|=16777216;if(getJSDocProtectedTagNoCache(e))t|=33554432;if(getJSDocReadonlyTagNoCache(e))t|=67108864;if(getJSDocOverrideTagNoCache(e))t|=134217728}if(getJSDocDeprecatedTagNoCache(e))t|=65536}return t}function selectSyntacticModifierFlags(e){return e&65535}function selectEffectiveModifierFlags(e){return e&131071|(e&260046848)>>>23}function getJSDocModifierFlagsNoCache(e){return selectEffectiveModifierFlags(getRawJSDocModifierFlagsNoCache(e))}function getEffectiveModifierFlagsNoCache(e){return getSyntacticModifierFlagsNoCache(e)|getJSDocModifierFlagsNoCache(e)}function getSyntacticModifierFlagsNoCache(e){let t=canHaveModifiers(e)?modifiersToFlags(e.modifiers):0;if(e.flags&8||e.kind===80&&e.flags&4096){t|=32}return t}function modifiersToFlags(e){let t=0;if(e){for(const n of e){t|=modifierToFlag(n.kind)}}return t}function modifierToFlag(e){switch(e){case 126:return 256;case 125:return 1;case 124:return 4;case 123:return 2;case 128:return 64;case 129:return 512;case 95:return 32;case 138:return 128;case 87:return 4096;case 90:return 2048;case 134:return 1024;case 148:return 8;case 164:return 16;case 103:return 8192;case 147:return 16384;case 170:return 32768}return 0}function isBinaryLogicalOperator(e){return e===57||e===56}function isLogicalOperator(e){return isBinaryLogicalOperator(e)||e===54}function isLogicalOrCoalescingAssignmentOperator(e){return e===76||e===77||e===78}function isLogicalOrCoalescingAssignmentExpression(e){return isBinaryExpression(e)&&isLogicalOrCoalescingAssignmentOperator(e.operatorToken.kind)}function isLogicalOrCoalescingBinaryOperator(e){return isBinaryLogicalOperator(e)||e===61}function isLogicalOrCoalescingBinaryExpression(e){return isBinaryExpression(e)&&isLogicalOrCoalescingBinaryOperator(e.operatorToken.kind)}function isAssignmentOperator(e){return e>=64&&e<=79}function tryGetClassExtendingExpressionWithTypeArguments(e){const t=tryGetClassImplementingOrExtendingExpressionWithTypeArguments(e);return t&&!t.isImplements?t.class:void 0}function tryGetClassImplementingOrExtendingExpressionWithTypeArguments(e){if(isExpressionWithTypeArguments(e)){if(isHeritageClause(e.parent)&&isClassLike(e.parent.parent)){return{class:e.parent.parent,isImplements:e.parent.token===119}}if(isJSDocAugmentsTag(e.parent)){const t=getEffectiveJSDocHost(e.parent);if(t&&isClassLike(t)){return{class:t,isImplements:false}}}}return void 0}function isAssignmentExpression(e,t){return isBinaryExpression(e)&&(t?e.operatorToken.kind===64:isAssignmentOperator(e.operatorToken.kind))&&isLeftHandSideExpression(e.left)}function isDestructuringAssignment(e){if(isAssignmentExpression(e,true)){const t=e.left.kind;return t===210||t===209}return false}function isExpressionWithTypeArgumentsInClassExtendsClause(e){return tryGetClassExtendingExpressionWithTypeArguments(e)!==void 0}function isEntityNameExpression(e){return e.kind===80||isPropertyAccessEntityNameExpression(e)}function getFirstIdentifier(e){switch(e.kind){case 80:return e;case 166:do{e=e.left}while(e.kind!==80);return e;case 211:do{e=e.expression}while(e.kind!==80);return e}}function isDottedName(e){return e.kind===80||e.kind===110||e.kind===108||e.kind===236||e.kind===211&&isDottedName(e.expression)||e.kind===217&&isDottedName(e.expression)}function isPropertyAccessEntityNameExpression(e){return isPropertyAccessExpression(e)&&isIdentifier(e.name)&&isEntityNameExpression(e.expression)}function tryGetPropertyAccessOrIdentifierToString(e){if(isPropertyAccessExpression(e)){const t=tryGetPropertyAccessOrIdentifierToString(e.expression);if(t!==void 0){return t+"."+entityNameToString(e.name)}}else if(isElementAccessExpression(e)){const t=tryGetPropertyAccessOrIdentifierToString(e.expression);if(t!==void 0&&isPropertyName(e.argumentExpression)){return t+"."+getPropertyNameForPropertyNameNode(e.argumentExpression)}}else if(isIdentifier(e)){return unescapeLeadingUnderscores(e.escapedText)}else if(isJsxNamespacedName(e)){return getTextOfJsxNamespacedName(e)}return void 0}function isPrototypeAccess(e){return isBindableStaticAccessExpression(e)&&getElementOrPropertyAccessName(e)==="prototype"}function isRightSideOfQualifiedNameOrPropertyAccess(e){return e.parent.kind===166&&e.parent.right===e||e.parent.kind===211&&e.parent.name===e||e.parent.kind===236&&e.parent.name===e}function isRightSideOfAccessExpression(e){return!!e.parent&&(isPropertyAccessExpression(e.parent)&&e.parent.name===e||isElementAccessExpression(e.parent)&&e.parent.argumentExpression===e)}function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(e){return isQualifiedName(e.parent)&&e.parent.right===e||isPropertyAccessExpression(e.parent)&&e.parent.name===e||isJSDocMemberName(e.parent)&&e.parent.right===e}function isInstanceOfExpression(e){return isBinaryExpression(e)&&e.operatorToken.kind===104}function isRightSideOfInstanceofExpression(e){return isInstanceOfExpression(e.parent)&&e===e.parent.right}function isEmptyObjectLiteral(e){return e.kind===210&&e.properties.length===0}function isEmptyArrayLiteral(e){return e.kind===209&&e.elements.length===0}function getLocalSymbolForExportDefault(e){if(!isExportDefaultSymbol(e)||!e.declarations)return void 0;for(const t of e.declarations){if(t.localSymbol)return t.localSymbol}return void 0}function isExportDefaultSymbol(e){return e&&length(e.declarations)>0&&hasSyntacticModifier(e.declarations[0],2048)}function tryExtractTSExtension(e){return find(yr,(t=>fileExtensionIs(e,t)))}function getExpandedCharCodes(e){const t=[];const n=e.length;for(let r=0;r>6|192);t.push(n&63|128)}else if(n<65536){t.push(n>>12|224);t.push(n>>6&63|128);t.push(n&63|128)}else if(n<131072){t.push(n>>18|240);t.push(n>>12&63|128);t.push(n>>6&63|128);t.push(n&63|128)}else{S.assert(false,"Unexpected code point")}}return t}var wn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function convertToBase64(e){let t="";const n=getExpandedCharCodes(e);let r=0;const i=n.length;let o,a,s,c;while(r>2;a=(n[r]&3)<<4|n[r+1]>>4;s=(n[r+1]&15)<<2|n[r+2]>>6;c=n[r+2]&63;if(r+1>=i){s=c=64}else if(r+2>=i){c=64}t+=wn.charAt(o)+wn.charAt(a)+wn.charAt(s)+wn.charAt(c);r+=3}return t}function getStringFromExpandedCharCodes(e){let t="";let n=0;const r=e.length;while(n>4&3;const c=(n&15)<<4|o>>2&15;const l=(o&3)<<6|a&63;if(c===0&&o!==0){r.push(s)}else if(l===0&&a!==0){r.push(s,c)}else{r.push(s,c,l)}i+=4}return getStringFromExpandedCharCodes(r)}function readJsonOrUndefined(e,t){const n=isString(t)?t:t.readFile(e);if(!n)return void 0;const r=parseConfigFileTextToJson(e,n);return!r.error?r.config:void 0}function readJson(e,t){return readJsonOrUndefined(e,t)||{}}function tryParseJson(e){try{return JSON.parse(e)}catch{return void 0}}function directoryProbablyExists(e,t){return!t.directoryExists||t.directoryExists(e)}var Ln="\r\n";var Mn="\n";function getNewLineCharacter(e){switch(e.newLine){case 0:return Ln;case 1:case void 0:return Mn}}function createRange(e,t=e){S.assert(t>=e||t===-1);return{pos:e,end:t}}function moveRangeEnd(e,t){return createRange(e.pos,t)}function moveRangePos(e,t){return createRange(t,e.end)}function moveRangePastDecorators(e){const t=canHaveModifiers(e)?findLast(e.modifiers,isDecorator):void 0;return t&&!positionIsSynthesized(t.end)?moveRangePos(e,t.end):e}function moveRangePastModifiers(e){if(isPropertyDeclaration(e)||isMethodDeclaration(e)){return moveRangePos(e,e.name.pos)}const t=canHaveModifiers(e)?lastOrUndefined(e.modifiers):void 0;return t&&!positionIsSynthesized(t.end)?moveRangePos(e,t.end):moveRangePastDecorators(e)}function createTokenRange(e,t){return createRange(e,e+tokenToString(t).length)}function rangeIsOnSingleLine(e,t){return rangeStartIsOnSameLineAsRangeEnd(e,e,t)}function rangeStartPositionsAreOnSameLine(e,t,n){return positionsAreOnSameLine(getStartPositionOfRange(e,n,false),getStartPositionOfRange(t,n,false),n)}function rangeEndPositionsAreOnSameLine(e,t,n){return positionsAreOnSameLine(e.end,t.end,n)}function rangeStartIsOnSameLineAsRangeEnd(e,t,n){return positionsAreOnSameLine(getStartPositionOfRange(e,n,false),t.end,n)}function rangeEndIsOnSameLineAsRangeStart(e,t,n){return positionsAreOnSameLine(e.end,getStartPositionOfRange(t,n,false),n)}function getLinesBetweenRangeEndAndRangeStart(e,t,n,r){const i=getStartPositionOfRange(t,n,r);return getLinesBetweenPositions(n,e.end,i)}function getLinesBetweenRangeEndPositions(e,t,n){return getLinesBetweenPositions(n,e.end,t.end)}function isNodeArrayMultiLine(e,t){return!positionsAreOnSameLine(e.pos,e.end,t)}function positionsAreOnSameLine(e,t,n){return getLinesBetweenPositions(n,e,t)===0}function getStartPositionOfRange(e,t,n){return positionIsSynthesized(e.pos)?-1:skipTrivia(t.text,e.pos,false,n)}function getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(e,t,n,r){const i=skipTrivia(n.text,e,false,r);const o=getPreviousNonWhitespacePosition(i,t,n);return getLinesBetweenPositions(n,o??t,i)}function getLinesBetweenPositionAndNextNonWhitespaceCharacter(e,t,n,r){const i=skipTrivia(n.text,e,false,r);return getLinesBetweenPositions(n,e,Math.min(t,i))}function rangeContainsRange(e,t){return startEndContainsRange(e.pos,e.end,t)}function startEndContainsRange(e,t,n){return e<=n.pos&&t>=n.end}function getPreviousNonWhitespacePosition(e,t=0,n){while(e-- >t){if(!isWhiteSpaceLike(n.text.charCodeAt(e))){return e}}}function isDeclarationNameOfEnumOrNamespace(e){const t=getParseTreeNode(e);if(t){switch(t.parent.kind){case 266:case 267:return t===t.parent.name}}return false}function getInitializedVariables(e){return filter(e.declarations,isInitializedVariable)}function isInitializedVariable(e){return isVariableDeclaration(e)&&e.initializer!==void 0}function isWatchSet(e){return e.watch&&hasProperty(e,"watch")}function closeFileWatcher(e){e.close()}function getCheckFlags(e){return e.flags&33554432?e.links.checkFlags:0}function getDeclarationModifierFlagsFromSymbol(e,t=false){if(e.valueDeclaration){const n=t&&e.declarations&&find(e.declarations,isSetAccessorDeclaration)||e.flags&32768&&find(e.declarations,isGetAccessorDeclaration)||e.valueDeclaration;const r=getCombinedModifierFlags(n);return e.parent&&e.parent.flags&32?r:r&~7}if(getCheckFlags(e)&6){const t=e.links.checkFlags;const n=t&1024?2:t&256?1:4;const r=t&2048?256:0;return n|r}if(e.flags&4194304){return 1|256}return 0}function skipAlias(e,t){return e.flags&2097152?t.getAliasedSymbol(e):e}function getCombinedLocalAndExportSymbolFlags(e){return e.exportSymbol?e.exportSymbol.flags|e.flags:e.flags}function isWriteOnlyAccess(e){return accessKind(e)===1}function isWriteAccess(e){return accessKind(e)!==0}function accessKind(e){const{parent:t}=e;switch(t==null?void 0:t.kind){case 217:return accessKind(t);case 225:case 224:const{operator:n}=t;return n===46||n===47?2:0;case 226:const{left:r,operatorToken:i}=t;return r===e&&isAssignmentOperator(i.kind)?i.kind===64?1:2:0;case 211:return t.name!==e?0:accessKind(t);case 303:{const n=accessKind(t.parent);return e===t.name?reverseAccessKind(n):n}case 304:return e===t.objectAssignmentInitializer?0:accessKind(t.parent);case 209:return accessKind(t);case 249:case 250:return e===t.initializer?1:0;default:return 0}}function reverseAccessKind(e){switch(e){case 0:return 1;case 1:return 0;case 2:return 2;default:return S.assertNever(e)}}function compareDataObjects(e,t){if(!e||!t||Object.keys(e).length!==Object.keys(t).length){return false}for(const n in e){if(typeof e[n]==="object"){if(!compareDataObjects(e[n],t[n])){return false}}else if(typeof e[n]!=="function"){if(e[n]!==t[n]){return false}}}return true}function clearMap(e,t){e.forEach(t);e.clear()}function mutateMapSkippingNewValues(e,t,n){const{onDeleteValue:r,onExistingValue:i}=n;e.forEach(((n,o)=>{var a;if(!(t==null?void 0:t.has(o))){e.delete(o);r(n,o)}else if(i){i(n,(a=t.get)==null?void 0:a.call(t,o),o)}}))}function mutateMap(e,t,n){mutateMapSkippingNewValues(e,t,n);const{createNewValue:r}=n;t==null?void 0:t.forEach(((t,n)=>{if(!e.has(n)){e.set(n,r(n,t))}}))}function isAbstractConstructorSymbol(e){if(e.flags&32){const t=getClassLikeDeclarationOfSymbol(e);return!!t&&hasSyntacticModifier(t,64)}return false}function getClassLikeDeclarationOfSymbol(e){var t;return(t=e.declarations)==null?void 0:t.find(isClassLike)}function getObjectFlags(e){return e.flags&3899393?e.objectFlags:0}function isUMDExportSymbol(e){return!!e&&!!e.declarations&&!!e.declarations[0]&&isNamespaceExportDeclaration(e.declarations[0])}function showModuleSpecifier({moduleSpecifier:e}){return isStringLiteral(e)?e.text:getTextOfNode(e)}function getLastChild(e){let t;forEachChild(e,(e=>{if(nodeIsPresent(e))t=e}),(e=>{for(let n=e.length-1;n>=0;n--){if(nodeIsPresent(e[n])){t=e[n];break}}}));return t}function addToSeen(e,t){if(e.has(t)){return false}e.add(t);return true}function isObjectTypeDeclaration(e){return isClassLike(e)||isInterfaceDeclaration(e)||isTypeLiteralNode(e)}function isTypeNodeKind(e){return e>=182&&e<=205||e===133||e===159||e===150||e===163||e===151||e===136||e===154||e===155||e===116||e===157||e===146||e===141||e===233||e===312||e===313||e===314||e===315||e===316||e===317||e===318}function isAccessExpression(e){return e.kind===211||e.kind===212}function getNameOfAccessExpression(e){if(e.kind===211){return e.name}S.assert(e.kind===212);return e.argumentExpression}function isNamedImportsOrExports(e){return e.kind===275||e.kind===279}function getLeftmostAccessExpression(e){while(isAccessExpression(e)){e=e.expression}return e}function forEachNameInAccessChainWalkingLeft(e,t){if(isAccessExpression(e.parent)&&isRightSideOfAccessExpression(e)){return walkAccessExpression(e.parent)}function walkAccessExpression(e){if(e.kind===211){const n=t(e.name);if(n!==void 0){return n}}else if(e.kind===212){if(isIdentifier(e.argumentExpression)||isStringLiteralLike(e.argumentExpression)){const n=t(e.argumentExpression);if(n!==void 0){return n}}else{return void 0}}if(isAccessExpression(e.expression)){return walkAccessExpression(e.expression)}if(isIdentifier(e.expression)){return t(e.expression)}return void 0}}function getLeftmostExpression(e,t){while(true){switch(e.kind){case 225:e=e.operand;continue;case 226:e=e.left;continue;case 227:e=e.condition;continue;case 215:e=e.tag;continue;case 213:if(t){return e}case 234:case 212:case 211:case 235:case 355:case 238:e=e.expression;continue}return e}}function Symbol4(e,t){this.flags=e;this.escapedName=t;this.declarations=void 0;this.valueDeclaration=void 0;this.id=0;this.mergeId=0;this.parent=void 0;this.members=void 0;this.exports=void 0;this.exportSymbol=void 0;this.constEnumOnlyModule=void 0;this.isReferenced=void 0;this.lastAssignmentPos=void 0;this.links=void 0}function Type3(e,t){this.flags=t;if(S.isDebugging||G){this.checker=e}}function Signature2(e,t){this.flags=t;if(S.isDebugging){this.checker=e}}function Node4(e,t,n){this.pos=t;this.end=n;this.kind=e;this.id=0;this.flags=0;this.modifierFlagsCache=0;this.transformFlags=0;this.parent=void 0;this.original=void 0;this.emitNode=void 0}function Token(e,t,n){this.pos=t;this.end=n;this.kind=e;this.id=0;this.flags=0;this.transformFlags=0;this.parent=void 0;this.emitNode=void 0}function Identifier2(e,t,n){this.pos=t;this.end=n;this.kind=e;this.id=0;this.flags=0;this.transformFlags=0;this.parent=void 0;this.original=void 0;this.emitNode=void 0}function SourceMapSource(e,t,n){this.fileName=e;this.text=t;this.skipTrivia=n||(e=>e)}var Rn={getNodeConstructor:()=>Node4,getTokenConstructor:()=>Token,getIdentifierConstructor:()=>Identifier2,getPrivateIdentifierConstructor:()=>Node4,getSourceFileConstructor:()=>Node4,getSymbolConstructor:()=>Symbol4,getTypeConstructor:()=>Type3,getSignatureConstructor:()=>Signature2,getSourceMapSourceConstructor:()=>SourceMapSource};var Bn=[];function addObjectAllocatorPatcher(e){Bn.push(e);e(Rn)}function setObjectAllocator(e){Object.assign(Rn,e);forEach(Bn,(e=>e(Rn)))}function formatStringFromArgs(e,t){return e.replace(/\{(\d+)\}/g,((e,n)=>""+S.checkDefined(t[+n])))}var jn;function setLocalizedDiagnosticMessages(e){jn=e}function maybeSetLocalizedDiagnosticMessages(e){if(!jn&&e){jn=e()}}function getLocaleSpecificMessage(e){return jn&&jn[e.key]||e.message}function createDetachedDiagnostic(e,t,n,r,i,...o){if(n+r>t.length){r=t.length-n}assertDiagnosticLocation(t,n,r);let a=getLocaleSpecificMessage(i);if(some(o)){a=formatStringFromArgs(a,o)}return{file:void 0,start:n,length:r,messageText:a,category:i.category,code:i.code,reportsUnnecessary:i.reportsUnnecessary,fileName:e}}function isDiagnosticWithDetachedLocation(e){return e.file===void 0&&e.start!==void 0&&e.length!==void 0&&typeof e.fileName==="string"}function attachFileToDiagnostic(e,t){const n=t.fileName||"";const r=t.text.length;S.assertEqual(e.fileName,n);S.assertLessThanOrEqual(e.start,r);S.assertLessThanOrEqual(e.start+e.length,r);const i={file:t,start:e.start,length:e.length,messageText:e.messageText,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary};if(e.relatedInformation){i.relatedInformation=[];for(const o of e.relatedInformation){if(isDiagnosticWithDetachedLocation(o)&&o.fileName===n){S.assertLessThanOrEqual(o.start,r);S.assertLessThanOrEqual(o.start+o.length,r);i.relatedInformation.push(attachFileToDiagnostic(o,t))}else{i.relatedInformation.push(o)}}}return i}function attachFileToDiagnostics(e,t){const n=[];for(const r of e){n.push(attachFileToDiagnostic(r,t))}return n}function createFileDiagnostic(e,t,n,r,...i){assertDiagnosticLocation(e.text,t,n);let o=getLocaleSpecificMessage(r);if(some(i)){o=formatStringFromArgs(o,i)}return{file:e,start:t,length:n,messageText:o,category:r.category,code:r.code,reportsUnnecessary:r.reportsUnnecessary,reportsDeprecated:r.reportsDeprecated}}function formatMessage(e,...t){let n=getLocaleSpecificMessage(e);if(some(t)){n=formatStringFromArgs(n,t)}return n}function createCompilerDiagnostic(e,...t){let n=getLocaleSpecificMessage(e);if(some(t)){n=formatStringFromArgs(n,t)}return{file:void 0,start:void 0,length:void 0,messageText:n,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated}}function createCompilerDiagnosticFromMessageChain(e,t){return{file:void 0,start:void 0,length:void 0,code:e.code,category:e.category,messageText:e.next?e:e.messageText,relatedInformation:t}}function chainDiagnosticMessages(e,t,...n){let r=getLocaleSpecificMessage(t);if(some(n)){r=formatStringFromArgs(r,n)}return{messageText:r,category:t.category,code:t.code,next:e===void 0||Array.isArray(e)?e:[e]}}function concatenateDiagnosticMessageChains(e,t){let n=e;while(n.next){n=n.next[0]}n.next=[t]}function getDiagnosticFilePath(e){return e.file?e.file.path:void 0}function compareDiagnostics(e,t){return compareDiagnosticsSkipRelatedInformation(e,t)||compareRelatedInformation(e,t)||0}function compareDiagnosticsSkipRelatedInformation(e,t){const n=getDiagnosticCode(e);const r=getDiagnosticCode(t);return compareStringsCaseSensitive(getDiagnosticFilePath(e),getDiagnosticFilePath(t))||compareValues(e.start,t.start)||compareValues(e.length,t.length)||compareValues(n,r)||compareMessageText(e,t)||0}function compareRelatedInformation(e,t){if(!e.relatedInformation&&!t.relatedInformation){return 0}if(e.relatedInformation&&t.relatedInformation){return compareValues(t.relatedInformation.length,e.relatedInformation.length)||forEach(e.relatedInformation,((e,n)=>{const r=t.relatedInformation[n];return compareDiagnostics(e,r)}))||0}return e.relatedInformation?-1:1}function compareMessageText(e,t){let n=getDiagnosticMessage(e);let r=getDiagnosticMessage(t);if(typeof n!=="string"){n=n.messageText}if(typeof r!=="string"){r=r.messageText}const i=typeof e.messageText!=="string"?e.messageText.next:void 0;const o=typeof t.messageText!=="string"?t.messageText.next:void 0;let a=compareStringsCaseSensitive(n,r);if(a){return a}a=compareMessageChain(i,o);if(a){return a}if(e.canonicalHead&&!t.canonicalHead){return-1}if(t.canonicalHead&&!e.canonicalHead){return 1}return 0}function compareMessageChain(e,t){if(e===void 0&&t===void 0){return 0}if(e===void 0){return 1}if(t===void 0){return-1}return compareMessageChainSize(e,t)||compareMessageChainContent(e,t)}function compareMessageChainSize(e,t){if(e===void 0&&t===void 0){return 0}if(e===void 0){return 1}if(t===void 0){return-1}let n=compareValues(t.length,e.length);if(n){return n}for(let r=0;r{e.externalModuleIndicator=isFileProbablyExternalModule(e)||!e.isDeclarationFile||void 0};case 1:return e=>{e.externalModuleIndicator=isFileProbablyExternalModule(e)};case 2:const t=[isFileProbablyExternalModule];if(e.jsx===4||e.jsx===5){t.push(isFileModuleFromUsingJSXTag)}t.push(isFileForcedToBeModuleByFormat);const n=or(...t);const callback=t=>void(t.externalModuleIndicator=n(t,e));return callback}}function importSyntaxAffectsModuleResolution(e){const t=qn(e);return 3<=t&&t<=99||Qn(e)||Xn(e)}function createComputedCompilerOptions(e){return e}var Jn=createComputedCompilerOptions({allowImportingTsExtensions:{dependencies:["rewriteRelativeImportExtensions"],computeValue:e=>!!(e.allowImportingTsExtensions||e.rewriteRelativeImportExtensions)},target:{dependencies:["module"],computeValue:e=>{const t=e.target===0?void 0:e.target;return t??(e.module===100&&9||e.module===101&&9||e.module===199&&99||1)}},module:{dependencies:["target"],computeValue:e=>typeof e.module==="number"?e.module:Jn.target.computeValue(e)>=2?5:1},moduleResolution:{dependencies:["module","target"],computeValue:e=>{let t=e.moduleResolution;if(t===void 0){switch(Jn.module.computeValue(e)){case 1:t=2;break;case 100:case 101:t=3;break;case 199:t=99;break;case 200:t=100;break;default:t=1;break}}return t}},moduleDetection:{dependencies:["module","target"],computeValue:e=>{if(e.moduleDetection!==void 0){return e.moduleDetection}const t=Jn.module.computeValue(e);return 100<=t&&t<=199?3:2}},isolatedModules:{dependencies:["verbatimModuleSyntax"],computeValue:e=>!!(e.isolatedModules||e.verbatimModuleSyntax)},esModuleInterop:{dependencies:["module","target"],computeValue:e=>{if(e.esModuleInterop!==void 0){return e.esModuleInterop}switch(Jn.module.computeValue(e)){case 100:case 101:case 199:case 200:return true}return false}},allowSyntheticDefaultImports:{dependencies:["module","target","moduleResolution"],computeValue:e=>{if(e.allowSyntheticDefaultImports!==void 0){return e.allowSyntheticDefaultImports}return Jn.esModuleInterop.computeValue(e)||Jn.module.computeValue(e)===4||Jn.moduleResolution.computeValue(e)===100}},resolvePackageJsonExports:{dependencies:["moduleResolution"],computeValue:e=>{const t=Jn.moduleResolution.computeValue(e);if(!moduleResolutionSupportsPackageJsonExportsAndImports(t)){return false}if(e.resolvePackageJsonExports!==void 0){return e.resolvePackageJsonExports}switch(t){case 3:case 99:case 100:return true}return false}},resolvePackageJsonImports:{dependencies:["moduleResolution","resolvePackageJsonExports"],computeValue:e=>{const t=Jn.moduleResolution.computeValue(e);if(!moduleResolutionSupportsPackageJsonExportsAndImports(t)){return false}if(e.resolvePackageJsonExports!==void 0){return e.resolvePackageJsonExports}switch(t){case 3:case 99:case 100:return true}return false}},resolveJsonModule:{dependencies:["moduleResolution","module","target"],computeValue:e=>{if(e.resolveJsonModule!==void 0){return e.resolveJsonModule}return Jn.moduleResolution.computeValue(e)===100}},declaration:{dependencies:["composite"],computeValue:e=>!!(e.declaration||e.composite)},preserveConstEnums:{dependencies:["isolatedModules","verbatimModuleSyntax"],computeValue:e=>!!(e.preserveConstEnums||Jn.isolatedModules.computeValue(e))},incremental:{dependencies:["composite"],computeValue:e=>!!(e.incremental||e.composite)},declarationMap:{dependencies:["declaration","composite"],computeValue:e=>!!(e.declarationMap&&Jn.declaration.computeValue(e))},allowJs:{dependencies:["checkJs"],computeValue:e=>e.allowJs===void 0?!!e.checkJs:e.allowJs},useDefineForClassFields:{dependencies:["target","module"],computeValue:e=>e.useDefineForClassFields===void 0?Jn.target.computeValue(e)>=9:e.useDefineForClassFields},noImplicitAny:{dependencies:["strict"],computeValue:e=>getStrictOptionValue(e,"noImplicitAny")},noImplicitThis:{dependencies:["strict"],computeValue:e=>getStrictOptionValue(e,"noImplicitThis")},strictNullChecks:{dependencies:["strict"],computeValue:e=>getStrictOptionValue(e,"strictNullChecks")},strictFunctionTypes:{dependencies:["strict"],computeValue:e=>getStrictOptionValue(e,"strictFunctionTypes")},strictBindCallApply:{dependencies:["strict"],computeValue:e=>getStrictOptionValue(e,"strictBindCallApply")},strictPropertyInitialization:{dependencies:["strict"],computeValue:e=>getStrictOptionValue(e,"strictPropertyInitialization")},strictBuiltinIteratorReturn:{dependencies:["strict"],computeValue:e=>getStrictOptionValue(e,"strictBuiltinIteratorReturn")},alwaysStrict:{dependencies:["strict"],computeValue:e=>getStrictOptionValue(e,"alwaysStrict")},useUnknownInCatchVariables:{dependencies:["strict"],computeValue:e=>getStrictOptionValue(e,"useUnknownInCatchVariables")}});var Wn=Jn;var Un=Jn.allowImportingTsExtensions.computeValue;var zn=Jn.target.computeValue;var Vn=Jn.module.computeValue;var qn=Jn.moduleResolution.computeValue;var Hn=Jn.moduleDetection.computeValue;var Gn=Jn.isolatedModules.computeValue;var Kn=Jn.esModuleInterop.computeValue;var $n=Jn.allowSyntheticDefaultImports.computeValue;var Qn=Jn.resolvePackageJsonExports.computeValue;var Xn=Jn.resolvePackageJsonImports.computeValue;var Yn=Jn.resolveJsonModule.computeValue;var Zn=Jn.declaration.computeValue;var er=Jn.preserveConstEnums.computeValue;var tr=Jn.incremental.computeValue;var nr=Jn.declarationMap.computeValue;var rr=Jn.allowJs.computeValue;var ir=Jn.useDefineForClassFields.computeValue;function emitModuleKindIsNonNodeESM(e){return e>=5&&e<=99}function hasJsonModuleEmitEnabled(e){switch(Vn(e)){case 0:case 4:case 3:return false}return true}function unreachableCodeIsError(e){return e.allowUnreachableCode===false}function unusedLabelIsError(e){return e.allowUnusedLabels===false}function moduleResolutionSupportsPackageJsonExportsAndImports(e){return e>=3&&e<=99||e===100}function moduleSupportsImportAttributes(e){return 101<=e&&e<=199||e===200||e===99}function getStrictOptionValue(e,t){return e[t]===void 0?!!e.strict:!!e[t]}function getNameOfScriptTarget(e){return forEachEntry(Xi.type,((t,n)=>t===e?n:void 0))}function getEmitStandardClassFields(e){return e.useDefineForClassFields!==false&&zn(e)>=9}function compilerOptionsAffectSemanticDiagnostics(e,t){return optionsHaveChanges(t,e,to)}function compilerOptionsAffectEmit(e,t){return optionsHaveChanges(t,e,no)}function compilerOptionsAffectDeclarationPath(e,t){return optionsHaveChanges(t,e,ro)}function getCompilerOptionValue(e,t){return t.strictFlag?getStrictOptionValue(e,t.name):t.allowJsFlag?rr(e):e[t.name]}function getJSXTransformEnabled(e){const t=e.jsx;return t===2||t===4||t===5}function getJSXImplicitImportBase(e,t){const n=t==null?void 0:t.pragmas.get("jsximportsource");const r=isArray(n)?n[n.length-1]:n;const i=t==null?void 0:t.pragmas.get("jsxruntime");const o=isArray(i)?i[i.length-1]:i;if((o==null?void 0:o.arguments.factory)==="classic"){return void 0}return e.jsx===4||e.jsx===5||e.jsxImportSource||r||(o==null?void 0:o.arguments.factory)==="automatic"?(r==null?void 0:r.arguments.factory)||e.jsxImportSource||"react":void 0}function getJSXRuntimeImport(e,t){return e?`${e}/${t.jsx===5?"jsx-dev-runtime":"jsx-runtime"}`:void 0}function hasZeroOrOneAsteriskCharacter(e){let t=false;for(let n=0;ni,getSymlinkedDirectories:()=>n,getSymlinkedDirectoriesByRealpath:()=>r,setSymlinkedFile:(e,t)=>(i||(i=new Map)).set(e,t),setSymlinkedDirectory:(i,o)=>{let a=toPath(i,e,t);if(!containsIgnoredPath(a)){a=ensureTrailingDirectorySeparator(a);if(o!==false&&!(n==null?void 0:n.has(a))){(r||(r=createMultiMap())).add(o.realPath,i)}(n||(n=new Map)).set(a,o)}},setSymlinksFromResolutions(e,t,n){S.assert(!o);o=true;e((e=>processResolution(this,e.resolvedModule)));t((e=>processResolution(this,e.resolvedTypeReferenceDirective)));n.forEach((e=>processResolution(this,e.resolvedTypeReferenceDirective)))},hasProcessedResolutions:()=>o,setSymlinksFromResolution(e){processResolution(this,e)},hasAnySymlinks:hasAnySymlinks};function hasAnySymlinks(){return!!(i==null?void 0:i.size)||!!n&&!!forEachEntry(n,(e=>!!e))}function processResolution(n,r){if(!r||!r.originalPath||!r.resolvedFileName)return;const{resolvedFileName:i,originalPath:o}=r;n.setSymlinkedFile(toPath(o,e,t),i);const[a,s]=guessDirectorySymlink(i,o,e,t)||d;if(a&&s){n.setSymlinkedDirectory(s,{real:ensureTrailingDirectorySeparator(a),realPath:ensureTrailingDirectorySeparator(toPath(a,e,t))})}}}function guessDirectorySymlink(e,t,n,r){const i=getPathComponents(getNormalizedAbsolutePath(e,n));const o=getPathComponents(getNormalizedAbsolutePath(t,n));let a=false;while(i.length>=2&&o.length>=2&&!isNodeModulesOrScopedPackageDirectory(i[i.length-2],r)&&!isNodeModulesOrScopedPackageDirectory(o[o.length-2],r)&&r(i[i.length-1])===r(o[o.length-1])){i.pop();o.pop();a=true}return a?[getPathFromPathComponents(i),getPathFromPathComponents(o)]:void 0}function isNodeModulesOrScopedPackageDirectory(e,t){return e!==void 0&&(t(e)==="node_modules"||startsWith(e,"@"))}function stripLeadingDirectorySeparator(e){return isAnyDirectorySeparator(e.charCodeAt(0))?e.slice(1):void 0}function tryRemoveDirectoryPrefix(e,t,n){const r=tryRemovePrefix(e,t,n);return r===void 0?void 0:stripLeadingDirectorySeparator(r)}var ar=/[^\w\s/]/g;function regExpEscape(e){return e.replace(ar,escapeRegExpCharacter)}function escapeRegExpCharacter(e){return"\\"+e}var sr=[42,63];var cr=["node_modules","bower_components","jspm_packages"];var lr=`(?!(${cr.join("|")})(/|$))`;var dr={singleAsteriskRegexFragment:"([^./]|(\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:`(/${lr}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>replaceWildcardCharacter(e,dr.singleAsteriskRegexFragment)};var pr={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:`(/${lr}[^/.][^/]*)*?`,replaceWildcardCharacter:e=>replaceWildcardCharacter(e,pr.singleAsteriskRegexFragment)};var ur={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/.+?)?",replaceWildcardCharacter:e=>replaceWildcardCharacter(e,ur.singleAsteriskRegexFragment)};var fr={files:dr,directories:pr,exclude:ur};function getRegularExpressionForWildcard(e,t,n){const r=getRegularExpressionsForWildcards(e,t,n);if(!r||!r.length){return void 0}const i=r.map((e=>`(${e})`)).join("|");const o=n==="exclude"?"($|/)":"$";return`^(${i})${o}`}function getRegularExpressionsForWildcards(e,t,n){if(e===void 0||e.length===0){return void 0}return flatMap(e,(e=>e&&getSubPatternFromSpec(e,t,n,fr[n])))}function isImplicitGlob(e){return!/[.*?]/.test(e)}function getPatternFromSpec(e,t,n){const r=e&&getSubPatternFromSpec(e,t,n,fr[n]);return r&&`^(${r})${n==="exclude"?"($|/)":"$"}`}function getSubPatternFromSpec(e,t,n,{singleAsteriskRegexFragment:r,doubleAsteriskRegexFragment:i,replaceWildcardCharacter:o}=fr[n]){let a="";let s=false;const c=getNormalizedPathComponents(e,t);const l=last(c);if(n!=="exclude"&&l==="**"){return void 0}c[0]=removeTrailingDirectorySeparator(c[0]);if(isImplicitGlob(l)){c.push("**","*")}let d=0;for(let e of c){if(e==="**"){a+=i}else{if(n==="directories"){a+="(";d++}if(s){a+=Pt}if(n!=="exclude"){let t="";if(e.charCodeAt(0)===42){t+="([^./]"+r+")?";e=e.substr(1)}else if(e.charCodeAt(0)===63){t+="[^./]";e=e.substr(1)}t+=e.replace(ar,o);if(t!==e){a+=lr}a+=t}else{a+=e.replace(ar,o)}}s=true}while(d>0){a+=")?";d--}return a}function replaceWildcardCharacter(e,t){return e==="*"?t:e==="?"?"[^/]":"\\"+e}function getFileMatcherPatterns(e,t,n,r,i){e=normalizePath(e);i=normalizePath(i);const o=combinePaths(i,e);return{includeFilePatterns:map(getRegularExpressionsForWildcards(n,o,"files"),(e=>`^${e}$`)),includeFilePattern:getRegularExpressionForWildcard(n,o,"files"),includeDirectoryPattern:getRegularExpressionForWildcard(n,o,"directories"),excludePattern:getRegularExpressionForWildcard(t,o,"exclude"),basePaths:getBasePaths(e,n,r)}}function getRegexFromPattern(e,t){return new RegExp(e,t?"":"i")}function matchFiles(e,t,n,r,i,o,a,s,c){e=normalizePath(e);o=normalizePath(o);const l=getFileMatcherPatterns(e,n,r,i,o);const d=l.includeFilePatterns&&l.includeFilePatterns.map((e=>getRegexFromPattern(e,i)));const p=l.includeDirectoryPattern&&getRegexFromPattern(l.includeDirectoryPattern,i);const u=l.excludePattern&&getRegexFromPattern(l.excludePattern,i);const f=d?d.map((()=>[])):[[]];const m=new Map;const _=createGetCanonicalFileName(i);for(const e of l.basePaths){visitDirectory(e,combinePaths(o,e),a)}return flatten(f);function visitDirectory(e,n,r){const i=_(c(n));if(m.has(i))return;m.set(i,true);const{files:o,directories:a}=s(e);for(const r of toSorted(o,compareStringsCaseSensitive)){const i=combinePaths(e,r);const o=combinePaths(n,r);if(t&&!fileExtensionIsOneOf(i,t))continue;if(u&&u.test(o))continue;if(!d){f[0].push(i)}else{const e=findIndex(d,(e=>e.test(o)));if(e!==-1){f[e].push(i)}}}if(r!==void 0){r--;if(r===0){return}}for(const t of toSorted(a,compareStringsCaseSensitive)){const i=combinePaths(e,t);const o=combinePaths(n,t);if((!p||p.test(o))&&(!u||!u.test(o))){visitDirectory(i,o,r)}}}}function getBasePaths(e,t,n){const r=[e];if(t){const i=[];for(const n of t){const t=isRootedDiskPath(n)?n:normalizePath(combinePaths(e,n));i.push(getIncludeBasePath(t))}i.sort(getStringComparer(!n));for(const t of i){if(every(r,(r=>!containsPath(r,t,e,!n)))){r.push(t)}}}return r}function getIncludeBasePath(e){const t=indexOfAnyCharCode(e,sr);if(t<0){return!hasExtension(e)?e:removeTrailingDirectorySeparator(getDirectoryPath(e))}return e.substring(0,e.lastIndexOf(Pt,t))}function ensureScriptKind(e,t){return t||getScriptKindFromFileName(e)||3}function getScriptKindFromFileName(e){const t=e.substr(e.lastIndexOf("."));switch(t.toLowerCase()){case".js":case".cjs":case".mjs":return 1;case".jsx":return 2;case".ts":case".cts":case".mts":return 3;case".tsx":return 4;case".json":return 6;default:return 0}}var mr=[[".ts",".tsx",".d.ts"],[".cts",".d.cts"],[".mts",".d.mts"]];var _r=flatten(mr);var gr=[...mr,[".json"]];var yr=[".d.ts",".d.cts",".d.mts",".cts",".mts",".ts",".tsx"];var hr=[[".js",".jsx"],[".mjs"],[".cjs"]];var Tr=flatten(hr);var Sr=[[".ts",".tsx",".d.ts",".js",".jsx"],[".cts",".d.cts",".cjs"],[".mts",".d.mts",".mjs"]];var vr=[...Sr,[".json"]];var xr=[".d.ts",".d.cts",".d.mts"];var br=[".ts",".cts",".mts",".tsx"];var Cr=[".mts",".d.mts",".mjs",".cts",".d.cts",".cjs"];function getSupportedExtensions(e,t){const n=e&&rr(e);if(!t||t.length===0){return n?Sr:mr}const r=n?Sr:mr;const i=flatten(r);const o=[...r,...mapDefined(t,(e=>e.scriptKind===7||n&&isJSLike(e.scriptKind)&&!i.includes(e.extension)?[e.extension]:void 0))];return o}function getSupportedExtensionsWithJsonIfResolveJsonModule(e,t){if(!e||!Yn(e))return t;if(t===Sr)return vr;if(t===mr)return gr;return[...t,[".json"]]}function isJSLike(e){return e===1||e===2}function hasJSFileExtension(e){return some(Tr,(t=>fileExtensionIs(e,t)))}function hasTSFileExtension(e){return some(_r,(t=>fileExtensionIs(e,t)))}function hasImplementationTSFileExtension(e){return some(br,(t=>fileExtensionIs(e,t)))&&!isDeclarationFileName(e)}var Er=(e=>{e[e["Minimal"]=0]="Minimal";e[e["Index"]=1]="Index";e[e["JsExtension"]=2]="JsExtension";e[e["TsExtension"]=3]="TsExtension";return e})(Er||{});function usesExtensionsOnImports({imports:e},t=or(hasJSFileExtension,hasTSFileExtension)){return firstDefined(e,(({text:e})=>pathIsRelative(e)&&!fileExtensionIsOneOf(e,Cr)?t(e):void 0))||false}function getModuleSpecifierEndingPreference(e,t,n,r){const i=qn(n);const o=3<=i&&i<=99;if(e==="js"||t===99&&o){if(!shouldAllowImportingTsExtension(n)){return 2}return inferPreference()!==2?3:2}if(e==="minimal"){return 0}if(e==="index"){return 1}if(!shouldAllowImportingTsExtension(n)){return r&&usesExtensionsOnImports(r)?2:0}return inferPreference();function inferPreference(){let e=false;const i=(r==null?void 0:r.imports.length)?r.imports:r&&isSourceFileJS(r)?getRequiresAtTopOfFile(r).map((e=>e.arguments[0])):d;for(const a of i){if(pathIsRelative(a.text)){if(o&&t===1&&getModeForUsageLocation(r,a,n)===99){continue}if(fileExtensionIsOneOf(a.text,Cr)){continue}if(hasTSFileExtension(a.text)){return 3}if(hasJSFileExtension(a.text)){e=true}}}return e?2:0}}function getRequiresAtTopOfFile(e){let t=0;let n;for(const r of e.statements){if(t>3){break}if(isRequireVariableStatement(r)){n=concatenate(n,r.declarationList.declarations.map((e=>e.initializer)))}else if(isExpressionStatement(r)&&isRequireCall(r.expression,true)){n=append(n,r.expression)}else{t++}}return n||d}function isSupportedSourceFileName(e,t,n){if(!e)return false;const r=getSupportedExtensions(t,n);for(const n of flatten(getSupportedExtensionsWithJsonIfResolveJsonModule(t,r))){if(fileExtensionIs(e,n)){return true}}return false}function numberOfDirectorySeparators(e){const t=e.match(/\//g);return t?t.length:0}function compareNumberOfDirectorySeparators(e,t){return compareValues(numberOfDirectorySeparators(e),numberOfDirectorySeparators(t))}var Nr=[".d.ts",".d.mts",".d.cts",".mjs",".mts",".cjs",".cts",".ts",".js",".tsx",".jsx",".json"];function removeFileExtension(e){for(const t of Nr){const n=tryRemoveExtension(e,t);if(n!==void 0){return n}}return e}function tryRemoveExtension(e,t){return fileExtensionIs(e,t)?removeExtension(e,t):void 0}function removeExtension(e,t){return e.substring(0,e.length-t.length)}function changeExtension(e,t){return changeAnyExtension(e,t,Nr,false)}function tryParsePattern(e){const t=e.indexOf("*");if(t===-1){return e}return e.indexOf("*",t+1)!==-1?void 0:{prefix:e.substr(0,t),suffix:e.substr(t+1)}}var kr=new WeakMap;function tryParsePatterns(e){let t=kr.get(e);if(t!==void 0){return t}let n;let r;const i=getOwnKeys(e);for(const e of i){const t=tryParsePattern(e);if(t===void 0){continue}else if(typeof t==="string"){(n??(n=new Set)).add(t)}else{(r??(r=[])).push(t)}}kr.set(e,t={matchableStringSet:n,patterns:r});return t}function positionIsSynthesized(e){return!(e>=0)}function extensionIsTS(e){return e===".ts"||e===".tsx"||e===".d.ts"||e===".cts"||e===".mts"||e===".d.mts"||e===".d.cts"||startsWith(e,".d.")&&endsWith(e,".ts")}function resolutionExtensionIsTSOrJson(e){return extensionIsTS(e)||e===".json"}function extensionFromPath(e){const t=tryGetExtensionFromPath2(e);return t!==void 0?t:S.fail(`File ${e} has unknown extension.`)}function isAnySupportedFileExtension(e){return tryGetExtensionFromPath2(e)!==void 0}function tryGetExtensionFromPath2(e){return find(Nr,(t=>fileExtensionIs(e,t)))}function isCheckJsEnabledForFile(e,t){return e.checkJsDirective?e.checkJsDirective.enabled:t.checkJs}var Fr={files:d,directories:d};function matchPatternOrExact(e,t){const{matchableStringSet:n,patterns:r}=e;if(n==null?void 0:n.has(t)){return t}if(r===void 0||r.length===0){return void 0}return findBestPatternMatch(r,(e=>e),t)}function sliceAfter(e,t){const n=e.indexOf(t);S.assert(n!==-1);return e.slice(n)}function addRelatedInfo(e,...t){if(!t.length){return e}if(!e.relatedInformation){e.relatedInformation=[]}S.assert(e.relatedInformation!==d,"Diagnostic had empty array singleton for related info, but is still being constructed!");e.relatedInformation.push(...t);return e}function minAndMax(e,t){S.assert(e.length!==0);let n=t(e[0]);let r=n;for(let i=1;ir){r=o}}return{min:n,max:r}}function rangeOfNode(e){return{pos:getTokenPosOfNode(e),end:e.end}}function rangeOfTypeParameters(e,t){const n=t.pos-1;const r=Math.min(e.text.length,skipTrivia(e.text,t.end)+1);return{pos:n,end:r}}function skipTypeChecking(e,t,n){return skipTypeCheckingWorker(e,t,n,false)}function skipTypeCheckingIgnoringNoCheck(e,t,n){return skipTypeCheckingWorker(e,t,n,true)}function skipTypeCheckingWorker(e,t,n,r){return t.skipLibCheck&&e.isDeclarationFile||t.skipDefaultLibCheck&&e.hasNoDefaultLib||!r&&t.noCheck||n.isSourceOfProjectReferenceRedirect(e.fileName)||!canIncludeBindAndCheckDiagnostics(e,t)}function canIncludeBindAndCheckDiagnostics(e,t){if(!!e.checkJsDirective&&e.checkJsDirective.enabled===false)return false;if(e.scriptKind===3||e.scriptKind===4||e.scriptKind===5)return true;const n=e.scriptKind===1||e.scriptKind===2;const r=n&&isCheckJsEnabledForFile(e,t);const i=isPlainJsFile(e,t.checkJs);return i||r||e.scriptKind===7}function isJsonEqual(e,t){return e===t||typeof e==="object"&&e!==null&&typeof t==="object"&&t!==null&&equalOwnProperties(e,t,isJsonEqual)}function parsePseudoBigInt(e){let t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:const n=e.length-1;let r=0;while(e.charCodeAt(r)===48){r++}return e.slice(r,n)||"0"}const n=2,r=e.length-1;const i=(r-n)*t;const o=new Uint16Array((i>>>4)+(i&15?1:0));for(let i=r-1,a=0;i>=n;i--,a+=t){const t=a>>>4;const n=e.charCodeAt(i);const r=n<=57?n-48:10+n-(n<=70?65:97);const s=r<<(a&15);o[t]|=s;const c=s>>>16;if(c)o[t+1]|=c}let a="";let s=o.length-1;let c=true;while(c){let e=0;c=false;for(let t=s;t>=0;t--){const n=e<<16|o[t];const r=n/10|0;o[t]=r;e=n-r*10;if(r&&!c){s=t;c=true}}a=e+a}return a}function pseudoBigIntToString({negative:e,base10Value:t}){return(e&&t!=="0"?"-":"")+t}function parseBigInt(e){if(!isValidBigIntString(e,false)){return void 0}return parseValidBigInt(e)}function parseValidBigInt(e){const t=e.startsWith("-");const n=parsePseudoBigInt(`${t?e.slice(1):e}n`);return{negative:t,base10Value:n}}function isValidBigIntString(e,t){if(e==="")return false;const n=createScanner(99,false);let r=true;n.setOnError((()=>r=false));n.setText(e+"n");let i=n.scan();const o=i===41;if(o){i=n.scan()}const a=n.getTokenFlags();return r&&i===10&&n.getTokenEnd()===e.length+1&&!(a&512)&&(!t||e===pseudoBigIntToString({negative:o,base10Value:parsePseudoBigInt(n.getTokenValue())}))}function isValidTypeOnlyAliasUseSite(e){return!!(e.flags&33554432)||isInJSDoc(e)||isPartOfTypeQuery(e)||isIdentifierInNonEmittingHeritageClause(e)||isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(e)||!(isExpressionNode(e)||isShorthandPropertyNameUseSite(e))}function isShorthandPropertyNameUseSite(e){return isIdentifier(e)&&isShorthandPropertyAssignment(e.parent)&&e.parent.name===e}function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(e){while(e.kind===80||e.kind===211){e=e.parent}if(e.kind!==167){return false}if(hasSyntacticModifier(e.parent,64)){return true}const t=e.parent.parent.kind;return t===264||t===187}function isIdentifierInNonEmittingHeritageClause(e){if(e.kind!==80)return false;const t=findAncestor(e.parent,(e=>{switch(e.kind){case 298:return true;case 211:case 233:return false;default:return"quit"}}));return(t==null?void 0:t.token)===119||(t==null?void 0:t.parent.kind)===264}function isIdentifierTypeReference(e){return isTypeReferenceNode(e)&&isIdentifier(e.typeName)}function arrayIsHomogeneous(e,t=equateValues){if(e.length<2)return true;const n=e[0];for(let r=1,i=e.length;re.includes(t)))}function getContainingNodeArray(e){if(!e.parent)return void 0;switch(e.kind){case 168:const{parent:t}=e;return t.kind===195?void 0:t.typeParameters;case 169:return e.parent.parameters;case 204:return e.parent.templateSpans;case 239:return e.parent.templateSpans;case 170:{const{parent:t}=e;return canHaveDecorators(t)?t.modifiers:void 0}case 298:return e.parent.heritageClauses}const{parent:t}=e;if(isJSDocTag(e)){return isJSDocTypeLiteral(e.parent)?void 0:e.parent.tags}switch(t.kind){case 187:case 264:return isTypeElement(e)?t.members:void 0;case 192:case 193:return t.types;case 189:case 209:case 356:case 275:case 279:return t.elements;case 210:case 292:return t.properties;case 213:case 214:return isTypeNode(e)?t.typeArguments:t.expression===e?void 0:t.arguments;case 284:case 288:return isJsxChild(e)?t.children:void 0;case 286:case 285:return isTypeNode(e)?t.typeArguments:void 0;case 241:case 296:case 297:case 268:return t.statements;case 269:return t.clauses;case 263:case 231:return isClassElement(e)?t.members:void 0;case 266:return isEnumMember(e)?t.members:void 0;case 307:return t.statements}}function hasContextSensitiveParameters(e){if(!e.typeParameters){if(some(e.parameters,(e=>!getEffectiveTypeAnnotationNode(e)))){return true}if(e.kind!==219){const t=firstOrUndefined(e.parameters);if(!(t&¶meterIsThisKeyword(t))){return true}}}return false}function isInfinityOrNaNString(e){return e==="Infinity"||e==="-Infinity"||e==="NaN"}function isCatchClauseVariableDeclaration(e){return e.kind===260&&e.parent.kind===299}function isFunctionExpressionOrArrowFunction(e){return e.kind===218||e.kind===219}function escapeSnippetText(e){return e.replace(/\$/g,(()=>"\\$"))}function isNumericLiteralName(e){return(+e).toString()===e}function createPropertyNameNodeForIdentifierOrLiteral(e,t,n,r,i){const o=i&&e==="new";return!o&&isIdentifierText(e,t)?zr.createIdentifier(e):!r&&!o&&isNumericLiteralName(e)&&+e>=0?zr.createNumericLiteral(+e):zr.createStringLiteral(e,!!n)}function isThisTypeParameter(e){return!!(e.flags&262144&&e.isThisType)}function getNodeModulePathParts(e){let t=0;let n=0;let r=0;let i=0;let o;(e=>{e[e["BeforeNodeModules"]=0]="BeforeNodeModules";e[e["NodeModules"]=1]="NodeModules";e[e["Scope"]=2]="Scope";e[e["PackageContent"]=3]="PackageContent"})(o||(o={}));let a=0;let s=0;let c=0;while(s>=0){a=s;s=e.indexOf("/",a+1);switch(c){case 0:if(e.indexOf(Wo,a)===a){t=a;n=s;c=1}break;case 1:case 2:if(c===1&&e.charAt(a+1)==="@"){c=2}else{r=s;c=3}break;case 3:if(e.indexOf(Wo,a)===a){c=1}else{c=3}break}}i=a;return c>1?{topLevelNodeModulesIndex:t,topLevelPackageNameIndex:n,packageRootIndex:r,fileNameIndex:i}:void 0}function isTypeDeclaration(e){switch(e.kind){case 168:case 263:case 264:case 265:case 266:case 346:case 338:case 340:return true;case 273:return e.isTypeOnly;case 276:case 281:return e.parent.parent.isTypeOnly;default:return false}}function canHaveExportModifier(e){return isEnumDeclaration(e)||isVariableStatement(e)||isFunctionDeclaration(e)||isClassDeclaration(e)||isInterfaceDeclaration(e)||isTypeDeclaration(e)||isModuleDeclaration(e)&&!isExternalModuleAugmentation(e)&&!isGlobalScopeAugmentation(e)}function isOptionalJSDocPropertyLikeTag(e){if(!isJSDocPropertyLikeTag(e)){return false}const{isBracketed:t,typeExpression:n}=e;return t||!!n&&n.type.kind===316}function canUsePropertyAccess(e,t){if(e.length===0){return false}const n=e.charCodeAt(0);return n===35?e.length>1&&isIdentifierStart(e.charCodeAt(1),t):isIdentifierStart(n,t)}function hasTabstop(e){var t;return((t=getSnippetElement(e))==null?void 0:t.kind)===0}function isJSDocOptionalParameter(e){return isInJSFile(e)&&(e.type&&e.type.kind===316||getJSDocParameterTags(e).some(isOptionalJSDocPropertyLikeTag))}function isOptionalDeclaration(e){switch(e.kind){case 172:case 171:return!!e.questionToken;case 169:return!!e.questionToken||isJSDocOptionalParameter(e);case 348:case 341:return isOptionalJSDocPropertyLikeTag(e);default:return false}}function isNonNullAccess(e){const t=e.kind;return(t===211||t===212)&&isNonNullExpression(e.expression)}function isJSDocSatisfiesExpression(e){return isInJSFile(e)&&isParenthesizedExpression(e)&&hasJSDocNodes(e)&&!!getJSDocSatisfiesTag(e)}function getJSDocSatisfiesExpressionType(e){return S.checkDefined(tryGetJSDocSatisfiesTypeNode(e))}function tryGetJSDocSatisfiesTypeNode(e){const t=getJSDocSatisfiesTag(e);return t&&t.typeExpression&&t.typeExpression.type}function getEscapedTextOfJsxAttributeName(e){return isIdentifier(e)?e.escapedText:getEscapedTextOfJsxNamespacedName(e)}function getTextOfJsxAttributeName(e){return isIdentifier(e)?idText(e):getTextOfJsxNamespacedName(e)}function isJsxAttributeName(e){const t=e.kind;return t===80||t===295}function getEscapedTextOfJsxNamespacedName(e){return`${e.namespace.escapedText}:${idText(e.name)}`}function getTextOfJsxNamespacedName(e){return`${idText(e.namespace)}:${idText(e.name)}`}function intrinsicTagNameToString(e){return isIdentifier(e)?idText(e):getTextOfJsxNamespacedName(e)}function isTypeUsableAsPropertyName(e){return!!(e.flags&8576)}function getPropertyNameFromType(e){if(e.flags&8192){return e.escapedName}if(e.flags&(128|256)){return escapeLeadingUnderscores(""+e.value)}return S.fail()}function isExpandoPropertyDeclaration(e){return!!e&&(isPropertyAccessExpression(e)||isElementAccessExpression(e)||isBinaryExpression(e))}function hasResolutionModeOverride(e){if(e===void 0){return false}return!!getResolutionModeOverride(e.attributes)}var Pr=String.prototype.replace;function replaceFirstStar(e,t){return Pr.call(e,"*",t)}function getNameFromImportAttribute(e){return isIdentifier(e.name)?e.name.escapedText:escapeLeadingUnderscores(e.name.text)}function isSourceElement(e){switch(e.kind){case 168:case 169:case 172:case 171:case 185:case 184:case 179:case 180:case 181:case 174:case 173:case 175:case 176:case 177:case 178:case 183:case 182:case 186:case 187:case 188:case 189:case 192:case 193:case 196:case 190:case 191:case 197:case 198:case 194:case 195:case 203:case 205:case 202:case 328:case 329:case 346:case 338:case 340:case 345:case 344:case 324:case 325:case 326:case 341:case 348:case 317:case 315:case 314:case 312:case 313:case 322:case 318:case 309:case 333:case 335:case 334:case 350:case 343:case 199:case 200:case 262:case 241:case 268:case 243:case 244:case 245:case 246:case 247:case 248:case 249:case 250:case 251:case 252:case 253:case 254:case 255:case 256:case 257:case 258:case 260:case 208:case 263:case 264:case 265:case 266:case 267:case 272:case 271:case 278:case 277:case 242:case 259:case 282:return true}return false}function evaluatorResult(e,t=false,n=false,r=false){return{value:e,isSyntacticallyString:t,resolvedOtherFiles:n,hasExternalReferences:r}}function createEvaluator({evaluateElementAccessExpression:e,evaluateEntityNameExpression:t}){function evaluate(n,r){let i=false;let o=false;let a=false;n=skipParentheses(n);switch(n.kind){case 224:const s=evaluate(n.operand,r);o=s.resolvedOtherFiles;a=s.hasExternalReferences;if(typeof s.value==="number"){switch(n.operator){case 40:return evaluatorResult(s.value,i,o,a);case 41:return evaluatorResult(-s.value,i,o,a);case 55:return evaluatorResult(~s.value,i,o,a)}}break;case 226:{const e=evaluate(n.left,r);const t=evaluate(n.right,r);i=(e.isSyntacticallyString||t.isSyntacticallyString)&&n.operatorToken.kind===40;o=e.resolvedOtherFiles||t.resolvedOtherFiles;a=e.hasExternalReferences||t.hasExternalReferences;if(typeof e.value==="number"&&typeof t.value==="number"){switch(n.operatorToken.kind){case 52:return evaluatorResult(e.value|t.value,i,o,a);case 51:return evaluatorResult(e.value&t.value,i,o,a);case 49:return evaluatorResult(e.value>>t.value,i,o,a);case 50:return evaluatorResult(e.value>>>t.value,i,o,a);case 48:return evaluatorResult(e.value<=2){break}case 174:case 176:case 177:case 178:case 262:if(f&3&&D==="arguments"){b=n;break e}break;case 218:if(f&3&&D==="arguments"){b=n;break e}if(f&16){const e=s.name;if(e&&D===e.escapedText){b=s.symbol;break e}}break;case 170:if(s.parent&&s.parent.kind===169){s=s.parent}if(s.parent&&(isClassElement(s.parent)||s.parent.kind===263)){s=s.parent}break;case 346:case 338:case 340:case 351:const o=getJSDocRoot(s);if(o){s=o.parent}break;case 169:if(C&&(C===s.initializer||C===s.name&&isBindingPattern(C))){if(!k){k=s}}break;case 208:if(C&&(C===s.initializer||C===s.name&&isBindingPattern(C))){if(isPartOfParameterDeclaration(s)&&!k){k=s}}break;case 195:if(f&262144){const e=s.typeParameter.name;if(e&&D===e.escapedText){b=s.typeParameter.symbol;break e}}break;case 281:if(C&&C===s.propertyName&&s.parent.parent.moduleSpecifier){s=s.parent.parent.parent}break}if(isSelfReferenceLocation(s,C)){E=s}C=s;s=isJSDocTemplateTag(s)?getEffectiveContainerForJSDocTemplateTag(s)||s.parent:isJSDocParameterTag(s)||isJSDocReturnTag(s)?getHostSignatureFromJSDoc(s)||s.parent:s.parent}if(g&&b&&(!E||b!==E.symbol)){b.isReferenced|=f}if(!b){if(C){S.assertNode(C,isSourceFile);if(C.commonJsModuleIndicator&&D==="exports"&&f&C.symbol.flags){return C.symbol}}if(!y){b=a(o,D,f)}}if(!b){if(x&&isInJSFile(x)&&x.parent){if(isRequireCall(x.parent,false)){return t}}}if(_){if(N&&l(x,D,N,b)){return void 0}if(!b){d(x,c,f,_)}else{p(x,b,f,C,k,F)}}return b}function useOuterVariableScopeInParameter(t,n,r){const i=zn(e);const o=n;if(isParameter(r)&&o.body&&t.valueDeclaration&&t.valueDeclaration.pos>=o.body.pos&&t.valueDeclaration.end<=o.body.end){if(i>=2){let e=c(o);if(e===void 0){e=forEach(o.parameters,requiresScopeChange)||false;s(o,e)}return!e}}return false;function requiresScopeChange(e){return requiresScopeChangeWorker(e.name)||!!e.initializer&&requiresScopeChangeWorker(e.initializer)}function requiresScopeChangeWorker(e){switch(e.kind){case 219:case 218:case 262:case 176:return false;case 174:case 177:case 178:case 303:return requiresScopeChangeWorker(e.name);case 172:if(hasStaticModifier(e)){return!f}return requiresScopeChangeWorker(e.name);default:if(isNullishCoalesce(e)||isOptionalChain(e)){return i<7}if(isBindingElement(e)&&e.dotDotDotToken&&isObjectBindingPattern(e.parent)){return i<4}if(isTypeNode(e))return false;return forEachChild(e,requiresScopeChangeWorker)||false}}}function getIsDeferredContext(e,t){if(e.kind!==219&&e.kind!==218){return isTypeQueryNode(e)||(isFunctionLikeDeclaration(e)||e.kind===172&&!isStatic(e))&&(!t||t!==e.name)}if(t&&t===e.name){return false}if(e.asteriskToken||hasSyntacticModifier(e,1024)){return true}return!getImmediatelyInvokedFunctionExpression(e)}function isSelfReferenceLocation(e,t){switch(e.kind){case 169:return!!t&&t===e.name;case 262:case 263:case 264:case 266:case 265:case 267:return true;default:return false}}function isTypeParameterSymbolDeclaredInContainer(e,t){if(e.declarations){for(const n of e.declarations){if(n.kind===168){const e=isJSDocTemplateTag(n.parent)?getJSDocHost(n.parent):n.parent;if(e===t){return!(isJSDocTemplateTag(n.parent)&&find(n.parent.parent.tags,isJSDocTypeAlias))}}}}return false}}function isPrimitiveLiteralValue(e,t=true){S.type(e);switch(e.kind){case 112:case 97:case 9:case 11:case 15:return true;case 10:return t;case 224:if(e.operator===41){return isNumericLiteral(e.operand)||t&&isBigIntLiteral(e.operand)}if(e.operator===40){return isNumericLiteral(e.operand)}return false;default:assertType(e);return false}}function unwrapParenthesizedExpression(e){while(e.kind===217){e=e.expression}return e}function hasInferredType(e){S.type(e);switch(e.kind){case 169:case 171:case 172:case 208:case 211:case 212:case 226:case 260:case 277:case 303:case 304:case 341:case 348:return true;default:assertType(e);return false}}function isSideEffectImport(e){const t=findAncestor(e,isImportDeclaration);return!!t&&!t.importClause}var Dr=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","test/mock_loader","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"];var Ir=new Set(Dr);var Ar=new Set(["node:sea","node:sqlite","node:test","node:test/reporters"]);var Or=new Set([...Dr,...Dr.map((e=>`node:${e}`)),...Ar]);function forEachDynamicImportOrRequireCall(e,t,n,r){const i=isInJSFile(e);const o=/import|require/g;while(o.exec(e.text)!==null){const a=getNodeAtPosition(e,o.lastIndex,t);if(i&&isRequireCall(a,n)){r(a,a.arguments[0])}else if(isImportCall(a)&&a.arguments.length>=1&&(!n||isStringLiteralLike(a.arguments[0]))){r(a,a.arguments[0])}else if(t&&isLiteralImportTypeNode(a)){r(a,a.argument.literal)}else if(t&&isJSDocImportTag(a)){const e=getExternalModuleName(a);if(e&&isStringLiteral(e)&&e.text){r(a,e)}}}}function getNodeAtPosition(e,t,n){const r=isInJSFile(e);let i=e;const getContainingChild=e=>{if(e.pos<=t&&(te&&t(e,n)))}function forEachProjectReference(e,t,n,r){let i;return worker(e,t,void 0);function worker(e,t,o){if(r){const t=r(e,o);if(t)return t}let a;return forEach(t,((e,t)=>{if(e&&(i==null?void 0:i.has(e.sourceFile.path))){(a??(a=new Set)).add(e);return void 0}const r=n(e,o,t);if(r||!e)return r;(i||(i=new Set)).add(e.sourceFile.path)}))||forEach(t,(e=>e&&!(a==null?void 0:a.has(e))?worker(e.commandLine.projectReferences,e.references,e):void 0))}}function getOptionsSyntaxByArrayElementValue(e,t,n){return e&&getPropertyArrayElementValue(e,t,n)}function getPropertyArrayElementValue(e,t,n){return forEachPropertyAssignment(e,t,(e=>isArrayLiteralExpression(e.initializer)?find(e.initializer.elements,(e=>isStringLiteral(e)&&e.text===n)):void 0))}function getOptionsSyntaxByValue(e,t,n){return forEachOptionsSyntaxByName(e,t,(e=>isStringLiteral(e.initializer)&&e.initializer.text===n?e.initializer:void 0))}function forEachOptionsSyntaxByName(e,t,n){return forEachPropertyAssignment(e,t,n)}function createBaseNodeFactory(){let e;let t;let n;let r;let i;return{createBaseSourceFileNode:createBaseSourceFileNode,createBaseIdentifierNode:createBaseIdentifierNode,createBasePrivateIdentifierNode:createBasePrivateIdentifierNode,createBaseTokenNode:createBaseTokenNode,createBaseNode:createBaseNode};function createBaseSourceFileNode(e){return new(i||(i=Rn.getSourceFileConstructor()))(e,-1,-1)}function createBaseIdentifierNode(e){return new(n||(n=Rn.getIdentifierConstructor()))(e,-1,-1)}function createBasePrivateIdentifierNode(e){return new(r||(r=Rn.getPrivateIdentifierConstructor()))(e,-1,-1)}function createBaseTokenNode(e){return new(t||(t=Rn.getTokenConstructor()))(e,-1,-1)}function createBaseNode(t){return new(e||(e=Rn.getNodeConstructor()))(t,-1,-1)}}function createParenthesizerRules(e){let t;let n;return{getParenthesizeLeftSideOfBinaryForOperator:getParenthesizeLeftSideOfBinaryForOperator,getParenthesizeRightSideOfBinaryForOperator:getParenthesizeRightSideOfBinaryForOperator,parenthesizeLeftSideOfBinary:parenthesizeLeftSideOfBinary,parenthesizeRightSideOfBinary:parenthesizeRightSideOfBinary,parenthesizeExpressionOfComputedPropertyName:parenthesizeExpressionOfComputedPropertyName,parenthesizeConditionOfConditionalExpression:parenthesizeConditionOfConditionalExpression,parenthesizeBranchOfConditionalExpression:parenthesizeBranchOfConditionalExpression,parenthesizeExpressionOfExportDefault:parenthesizeExpressionOfExportDefault,parenthesizeExpressionOfNew:parenthesizeExpressionOfNew,parenthesizeLeftSideOfAccess:parenthesizeLeftSideOfAccess,parenthesizeOperandOfPostfixUnary:parenthesizeOperandOfPostfixUnary,parenthesizeOperandOfPrefixUnary:parenthesizeOperandOfPrefixUnary,parenthesizeExpressionsOfCommaDelimitedList:parenthesizeExpressionsOfCommaDelimitedList,parenthesizeExpressionForDisallowedComma:parenthesizeExpressionForDisallowedComma,parenthesizeExpressionOfExpressionStatement:parenthesizeExpressionOfExpressionStatement,parenthesizeConciseBodyOfArrowFunction:parenthesizeConciseBodyOfArrowFunction,parenthesizeCheckTypeOfConditionalType:parenthesizeCheckTypeOfConditionalType,parenthesizeExtendsTypeOfConditionalType:parenthesizeExtendsTypeOfConditionalType,parenthesizeConstituentTypesOfUnionType:parenthesizeConstituentTypesOfUnionType,parenthesizeConstituentTypeOfUnionType:parenthesizeConstituentTypeOfUnionType,parenthesizeConstituentTypesOfIntersectionType:parenthesizeConstituentTypesOfIntersectionType,parenthesizeConstituentTypeOfIntersectionType:parenthesizeConstituentTypeOfIntersectionType,parenthesizeOperandOfTypeOperator:parenthesizeOperandOfTypeOperator,parenthesizeOperandOfReadonlyTypeOperator:parenthesizeOperandOfReadonlyTypeOperator,parenthesizeNonArrayTypeOfPostfixType:parenthesizeNonArrayTypeOfPostfixType,parenthesizeElementTypesOfTupleType:parenthesizeElementTypesOfTupleType,parenthesizeElementTypeOfTupleType:parenthesizeElementTypeOfTupleType,parenthesizeTypeOfOptionalType:parenthesizeTypeOfOptionalType,parenthesizeTypeArguments:parenthesizeTypeArguments,parenthesizeLeadingTypeArgument:parenthesizeLeadingTypeArgument};function getParenthesizeLeftSideOfBinaryForOperator(e){t||(t=new Map);let n=t.get(e);if(!n){n=t=>parenthesizeLeftSideOfBinary(e,t);t.set(e,n)}return n}function getParenthesizeRightSideOfBinaryForOperator(e){n||(n=new Map);let t=n.get(e);if(!t){t=t=>parenthesizeRightSideOfBinary(e,void 0,t);n.set(e,t)}return t}function binaryOperandNeedsParentheses(e,t,n,r){const i=getOperatorPrecedence(226,e);const o=getOperatorAssociativity(226,e);const a=skipPartiallyEmittedExpressions(t);if(!n&&t.kind===219&&i>3){return true}const s=getExpressionPrecedence(a);switch(compareValues(s,i)){case-1:if(!n&&o===1&&t.kind===229){return false}return true;case 1:return false;case 0:if(n){return o===1}else{if(isBinaryExpression(a)&&a.operatorToken.kind===e){if(operatorHasAssociativeProperty(e)){return false}if(e===40){const e=r?getLiteralKindOfBinaryPlusOperand(r):0;if(isLiteralKind(e)&&e===getLiteralKindOfBinaryPlusOperand(a)){return false}}}const t=getExpressionAssociativity(a);return t===0}}}function operatorHasAssociativeProperty(e){return e===42||e===52||e===51||e===53||e===28}function getLiteralKindOfBinaryPlusOperand(e){e=skipPartiallyEmittedExpressions(e);if(isLiteralKind(e.kind)){return e.kind}if(e.kind===226&&e.operatorToken.kind===40){if(e.cachedLiteralKind!==void 0){return e.cachedLiteralKind}const t=getLiteralKindOfBinaryPlusOperand(e.left);const n=isLiteralKind(t)&&t===getLiteralKindOfBinaryPlusOperand(e.right)?t:0;e.cachedLiteralKind=n;return n}return 0}function parenthesizeBinaryOperand(t,n,r,i){const o=skipPartiallyEmittedExpressions(n);if(o.kind===217){return n}return binaryOperandNeedsParentheses(t,n,r,i)?e.createParenthesizedExpression(n):n}function parenthesizeLeftSideOfBinary(e,t){return parenthesizeBinaryOperand(e,t,true)}function parenthesizeRightSideOfBinary(e,t,n){return parenthesizeBinaryOperand(e,n,false,t)}function parenthesizeExpressionOfComputedPropertyName(t){return isCommaSequence(t)?e.createParenthesizedExpression(t):t}function parenthesizeConditionOfConditionalExpression(t){const n=getOperatorPrecedence(227,58);const r=skipPartiallyEmittedExpressions(t);const i=getExpressionPrecedence(r);if(compareValues(i,n)!==1){return e.createParenthesizedExpression(t)}return t}function parenthesizeBranchOfConditionalExpression(t){const n=skipPartiallyEmittedExpressions(t);return isCommaSequence(n)?e.createParenthesizedExpression(t):t}function parenthesizeExpressionOfExportDefault(t){const n=skipPartiallyEmittedExpressions(t);let r=isCommaSequence(n);if(!r){switch(getLeftmostExpression(n,false).kind){case 231:case 218:r=true}}return r?e.createParenthesizedExpression(t):t}function parenthesizeExpressionOfNew(t){const n=getLeftmostExpression(t,true);switch(n.kind){case 213:return e.createParenthesizedExpression(t);case 214:return!n.arguments?e.createParenthesizedExpression(t):t}return parenthesizeLeftSideOfAccess(t)}function parenthesizeLeftSideOfAccess(t,n){const r=skipPartiallyEmittedExpressions(t);if(isLeftHandSideExpression(r)&&(r.kind!==214||r.arguments)&&(n||!isOptionalChain(r))){return t}return setTextRange(e.createParenthesizedExpression(t),t)}function parenthesizeOperandOfPostfixUnary(t){return isLeftHandSideExpression(t)?t:setTextRange(e.createParenthesizedExpression(t),t)}function parenthesizeOperandOfPrefixUnary(t){return isUnaryExpression(t)?t:setTextRange(e.createParenthesizedExpression(t),t)}function parenthesizeExpressionsOfCommaDelimitedList(t){const n=sameMap(t,parenthesizeExpressionForDisallowedComma);return setTextRange(e.createNodeArray(n,t.hasTrailingComma),t)}function parenthesizeExpressionForDisallowedComma(t){const n=skipPartiallyEmittedExpressions(t);const r=getExpressionPrecedence(n);const i=getOperatorPrecedence(226,28);return r>i?t:setTextRange(e.createParenthesizedExpression(t),t)}function parenthesizeExpressionOfExpressionStatement(t){const n=skipPartiallyEmittedExpressions(t);if(isCallExpression(n)){const r=n.expression;const i=skipPartiallyEmittedExpressions(r).kind;if(i===218||i===219){const i=e.updateCallExpression(n,setTextRange(e.createParenthesizedExpression(r),r),n.typeArguments,n.arguments);return e.restoreOuterExpressions(t,i,8)}}const r=getLeftmostExpression(n,false).kind;if(r===210||r===218){return setTextRange(e.createParenthesizedExpression(t),t)}return t}function parenthesizeConciseBodyOfArrowFunction(t){if(!isBlock(t)&&(isCommaSequence(t)||getLeftmostExpression(t,false).kind===210)){return setTextRange(e.createParenthesizedExpression(t),t)}return t}function parenthesizeCheckTypeOfConditionalType(t){switch(t.kind){case 184:case 185:case 194:return e.createParenthesizedType(t)}return t}function parenthesizeExtendsTypeOfConditionalType(t){switch(t.kind){case 194:return e.createParenthesizedType(t)}return t}function parenthesizeConstituentTypeOfUnionType(t){switch(t.kind){case 192:case 193:return e.createParenthesizedType(t)}return parenthesizeCheckTypeOfConditionalType(t)}function parenthesizeConstituentTypesOfUnionType(t){return e.createNodeArray(sameMap(t,parenthesizeConstituentTypeOfUnionType))}function parenthesizeConstituentTypeOfIntersectionType(t){switch(t.kind){case 192:case 193:return e.createParenthesizedType(t)}return parenthesizeConstituentTypeOfUnionType(t)}function parenthesizeConstituentTypesOfIntersectionType(t){return e.createNodeArray(sameMap(t,parenthesizeConstituentTypeOfIntersectionType))}function parenthesizeOperandOfTypeOperator(t){switch(t.kind){case 193:return e.createParenthesizedType(t)}return parenthesizeConstituentTypeOfIntersectionType(t)}function parenthesizeOperandOfReadonlyTypeOperator(t){switch(t.kind){case 198:return e.createParenthesizedType(t)}return parenthesizeOperandOfTypeOperator(t)}function parenthesizeNonArrayTypeOfPostfixType(t){switch(t.kind){case 195:case 198:case 186:return e.createParenthesizedType(t)}return parenthesizeOperandOfTypeOperator(t)}function parenthesizeElementTypesOfTupleType(t){return e.createNodeArray(sameMap(t,parenthesizeElementTypeOfTupleType))}function parenthesizeElementTypeOfTupleType(t){if(hasJSDocPostfixQuestion(t))return e.createParenthesizedType(t);return t}function hasJSDocPostfixQuestion(e){if(isJSDocNullableType(e))return e.postfix;if(isNamedTupleMember(e))return hasJSDocPostfixQuestion(e.type);if(isFunctionTypeNode(e)||isConstructorTypeNode(e)||isTypeOperatorNode(e))return hasJSDocPostfixQuestion(e.type);if(isConditionalTypeNode(e))return hasJSDocPostfixQuestion(e.falseType);if(isUnionTypeNode(e))return hasJSDocPostfixQuestion(last(e.types));if(isIntersectionTypeNode(e))return hasJSDocPostfixQuestion(last(e.types));if(isInferTypeNode(e))return!!e.typeParameter.constraint&&hasJSDocPostfixQuestion(e.typeParameter.constraint);return false}function parenthesizeTypeOfOptionalType(t){if(hasJSDocPostfixQuestion(t))return e.createParenthesizedType(t);return parenthesizeNonArrayTypeOfPostfixType(t)}function parenthesizeLeadingTypeArgument(t){return isFunctionOrConstructorTypeNode(t)&&t.typeParameters?e.createParenthesizedType(t):t}function parenthesizeOrdinalTypeArgument(e,t){return t===0?parenthesizeLeadingTypeArgument(e):e}function parenthesizeTypeArguments(t){if(some(t)){return e.createNodeArray(sameMap(t,parenthesizeOrdinalTypeArgument))}}}var wr={getParenthesizeLeftSideOfBinaryForOperator:e=>identity,getParenthesizeRightSideOfBinaryForOperator:e=>identity,parenthesizeLeftSideOfBinary:(e,t)=>t,parenthesizeRightSideOfBinary:(e,t,n)=>n,parenthesizeExpressionOfComputedPropertyName:identity,parenthesizeConditionOfConditionalExpression:identity,parenthesizeBranchOfConditionalExpression:identity,parenthesizeExpressionOfExportDefault:identity,parenthesizeExpressionOfNew:e=>cast(e,isLeftHandSideExpression),parenthesizeLeftSideOfAccess:e=>cast(e,isLeftHandSideExpression),parenthesizeOperandOfPostfixUnary:e=>cast(e,isLeftHandSideExpression),parenthesizeOperandOfPrefixUnary:e=>cast(e,isUnaryExpression),parenthesizeExpressionsOfCommaDelimitedList:e=>cast(e,isNodeArray),parenthesizeExpressionForDisallowedComma:identity,parenthesizeExpressionOfExpressionStatement:identity,parenthesizeConciseBodyOfArrowFunction:identity,parenthesizeCheckTypeOfConditionalType:identity,parenthesizeExtendsTypeOfConditionalType:identity,parenthesizeConstituentTypesOfUnionType:e=>cast(e,isNodeArray),parenthesizeConstituentTypeOfUnionType:identity,parenthesizeConstituentTypesOfIntersectionType:e=>cast(e,isNodeArray),parenthesizeConstituentTypeOfIntersectionType:identity,parenthesizeOperandOfTypeOperator:identity,parenthesizeOperandOfReadonlyTypeOperator:identity,parenthesizeNonArrayTypeOfPostfixType:identity,parenthesizeElementTypesOfTupleType:e=>cast(e,isNodeArray),parenthesizeElementTypeOfTupleType:identity,parenthesizeTypeOfOptionalType:identity,parenthesizeTypeArguments:e=>e&&cast(e,isNodeArray),parenthesizeLeadingTypeArgument:identity};function createNodeConverters(e){return{convertToFunctionBlock:convertToFunctionBlock,convertToFunctionExpression:convertToFunctionExpression,convertToClassExpression:convertToClassExpression,convertToArrayAssignmentElement:convertToArrayAssignmentElement,convertToObjectAssignmentElement:convertToObjectAssignmentElement,convertToAssignmentPattern:convertToAssignmentPattern,convertToObjectAssignmentPattern:convertToObjectAssignmentPattern,convertToArrayAssignmentPattern:convertToArrayAssignmentPattern,convertToAssignmentElementTarget:convertToAssignmentElementTarget};function convertToFunctionBlock(t,n){if(isBlock(t))return t;const r=e.createReturnStatement(t);setTextRange(r,t);const i=e.createBlock([r],n);setTextRange(i,t);return i}function convertToFunctionExpression(t){var n;if(!t.body)return S.fail(`Cannot convert a FunctionDeclaration without a body`);const r=e.createFunctionExpression((n=getModifiers(t))==null?void 0:n.filter((e=>!isExportModifier(e)&&!isDefaultModifier(e))),t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body);setOriginalNode(r,t);setTextRange(r,t);if(getStartsOnNewLine(t)){setStartsOnNewLine(r,true)}return r}function convertToClassExpression(t){var n;const r=e.createClassExpression((n=t.modifiers)==null?void 0:n.filter((e=>!isExportModifier(e)&&!isDefaultModifier(e))),t.name,t.typeParameters,t.heritageClauses,t.members);setOriginalNode(r,t);setTextRange(r,t);if(getStartsOnNewLine(t)){setStartsOnNewLine(r,true)}return r}function convertToArrayAssignmentElement(t){if(isBindingElement(t)){if(t.dotDotDotToken){S.assertNode(t.name,isIdentifier);return setOriginalNode(setTextRange(e.createSpreadElement(t.name),t),t)}const n=convertToAssignmentElementTarget(t.name);return t.initializer?setOriginalNode(setTextRange(e.createAssignment(n,t.initializer),t),t):n}return cast(t,isExpression)}function convertToObjectAssignmentElement(t){if(isBindingElement(t)){if(t.dotDotDotToken){S.assertNode(t.name,isIdentifier);return setOriginalNode(setTextRange(e.createSpreadAssignment(t.name),t),t)}if(t.propertyName){const n=convertToAssignmentElementTarget(t.name);return setOriginalNode(setTextRange(e.createPropertyAssignment(t.propertyName,t.initializer?e.createAssignment(n,t.initializer):n),t),t)}S.assertNode(t.name,isIdentifier);return setOriginalNode(setTextRange(e.createShorthandPropertyAssignment(t.name,t.initializer),t),t)}return cast(t,isObjectLiteralElementLike)}function convertToAssignmentPattern(e){switch(e.kind){case 207:case 209:return convertToArrayAssignmentPattern(e);case 206:case 210:return convertToObjectAssignmentPattern(e)}}function convertToObjectAssignmentPattern(t){if(isObjectBindingPattern(t)){return setOriginalNode(setTextRange(e.createObjectLiteralExpression(map(t.elements,convertToObjectAssignmentElement)),t),t)}return cast(t,isObjectLiteralExpression)}function convertToArrayAssignmentPattern(t){if(isArrayBindingPattern(t)){return setOriginalNode(setTextRange(e.createArrayLiteralExpression(map(t.elements,convertToArrayAssignmentElement)),t),t)}return cast(t,isArrayLiteralExpression)}function convertToAssignmentElementTarget(e){if(isBindingPattern(e)){return convertToAssignmentPattern(e)}return cast(e,isExpression)}}var Lr={convertToFunctionBlock:notImplemented,convertToFunctionExpression:notImplemented,convertToClassExpression:notImplemented,convertToArrayAssignmentElement:notImplemented,convertToObjectAssignmentElement:notImplemented,convertToAssignmentPattern:notImplemented,convertToObjectAssignmentPattern:notImplemented,convertToArrayAssignmentPattern:notImplemented,convertToAssignmentElementTarget:notImplemented};var Mr=0;var Rr=(e=>{e[e["None"]=0]="None";e[e["NoParenthesizerRules"]=1]="NoParenthesizerRules";e[e["NoNodeConverters"]=2]="NoNodeConverters";e[e["NoIndentationOnFreshPropertyAccess"]=4]="NoIndentationOnFreshPropertyAccess";e[e["NoOriginalNode"]=8]="NoOriginalNode";return e})(Rr||{});var Br=[];function addNodeFactoryPatcher(e){Br.push(e)}function createNodeFactory(e,t){const n=e&8?identity:setOriginalNode;const r=memoize((()=>e&1?wr:createParenthesizerRules(h)));const i=memoize((()=>e&2?Lr:createNodeConverters(h)));const o=memoizeOne((e=>(t,n)=>createBinaryExpression(t,e,n)));const a=memoizeOne((e=>t=>createPrefixUnaryExpression(e,t)));const s=memoizeOne((e=>t=>createPostfixUnaryExpression(t,e)));const c=memoizeOne((e=>()=>createJSDocPrimaryTypeWorker(e)));const l=memoizeOne((e=>t=>createJSDocUnaryTypeWorker(e,t)));const p=memoizeOne((e=>(t,n)=>updateJSDocUnaryTypeWorker(e,t,n)));const u=memoizeOne((e=>(t,n)=>createJSDocPrePostfixUnaryTypeWorker(e,t,n)));const f=memoizeOne((e=>(t,n)=>updateJSDocPrePostfixUnaryTypeWorker(e,t,n)));const m=memoizeOne((e=>(t,n)=>createJSDocSimpleTagWorker(e,t,n)));const _=memoizeOne((e=>(t,n,r)=>updateJSDocSimpleTagWorker(e,t,n,r)));const g=memoizeOne((e=>(t,n,r)=>createJSDocTypeLikeTagWorker(e,t,n,r)));const y=memoizeOne((e=>(t,n,r,i)=>updateJSDocTypeLikeTagWorker(e,t,n,r,i)));const h={get parenthesizer(){return r()},get converters(){return i()},baseFactory:t,flags:e,createNodeArray:createNodeArray,createNumericLiteral:createNumericLiteral,createBigIntLiteral:createBigIntLiteral,createStringLiteral:createStringLiteral,createStringLiteralFromNode:createStringLiteralFromNode,createRegularExpressionLiteral:createRegularExpressionLiteral,createLiteralLikeNode:createLiteralLikeNode,createIdentifier:createIdentifier,createTempVariable:createTempVariable,createLoopVariable:createLoopVariable,createUniqueName:createUniqueName,getGeneratedNameForNode:getGeneratedNameForNode,createPrivateIdentifier:createPrivateIdentifier,createUniquePrivateName:createUniquePrivateName,getGeneratedPrivateNameForNode:getGeneratedPrivateNameForNode,createToken:createToken,createSuper:createSuper,createThis:createThis,createNull:createNull,createTrue:createTrue,createFalse:createFalse,createModifier:createModifier,createModifiersFromModifierFlags:createModifiersFromModifierFlags,createQualifiedName:createQualifiedName,updateQualifiedName:updateQualifiedName,createComputedPropertyName:createComputedPropertyName,updateComputedPropertyName:updateComputedPropertyName,createTypeParameterDeclaration:createTypeParameterDeclaration,updateTypeParameterDeclaration:updateTypeParameterDeclaration,createParameterDeclaration:createParameterDeclaration,updateParameterDeclaration:updateParameterDeclaration,createDecorator:createDecorator,updateDecorator:updateDecorator,createPropertySignature:createPropertySignature,updatePropertySignature:updatePropertySignature,createPropertyDeclaration:createPropertyDeclaration,updatePropertyDeclaration:updatePropertyDeclaration2,createMethodSignature:createMethodSignature,updateMethodSignature:updateMethodSignature,createMethodDeclaration:createMethodDeclaration,updateMethodDeclaration:updateMethodDeclaration,createConstructorDeclaration:createConstructorDeclaration,updateConstructorDeclaration:updateConstructorDeclaration,createGetAccessorDeclaration:createGetAccessorDeclaration,updateGetAccessorDeclaration:updateGetAccessorDeclaration,createSetAccessorDeclaration:createSetAccessorDeclaration,updateSetAccessorDeclaration:updateSetAccessorDeclaration,createCallSignature:createCallSignature,updateCallSignature:updateCallSignature,createConstructSignature:createConstructSignature,updateConstructSignature:updateConstructSignature,createIndexSignature:createIndexSignature,updateIndexSignature:updateIndexSignature,createClassStaticBlockDeclaration:createClassStaticBlockDeclaration,updateClassStaticBlockDeclaration:updateClassStaticBlockDeclaration,createTemplateLiteralTypeSpan:createTemplateLiteralTypeSpan,updateTemplateLiteralTypeSpan:updateTemplateLiteralTypeSpan,createKeywordTypeNode:createKeywordTypeNode,createTypePredicateNode:createTypePredicateNode,updateTypePredicateNode:updateTypePredicateNode,createTypeReferenceNode:createTypeReferenceNode,updateTypeReferenceNode:updateTypeReferenceNode,createFunctionTypeNode:createFunctionTypeNode,updateFunctionTypeNode:updateFunctionTypeNode,createConstructorTypeNode:createConstructorTypeNode,updateConstructorTypeNode:updateConstructorTypeNode,createTypeQueryNode:createTypeQueryNode,updateTypeQueryNode:updateTypeQueryNode,createTypeLiteralNode:createTypeLiteralNode,updateTypeLiteralNode:updateTypeLiteralNode,createArrayTypeNode:createArrayTypeNode,updateArrayTypeNode:updateArrayTypeNode,createTupleTypeNode:createTupleTypeNode,updateTupleTypeNode:updateTupleTypeNode,createNamedTupleMember:createNamedTupleMember,updateNamedTupleMember:updateNamedTupleMember,createOptionalTypeNode:createOptionalTypeNode,updateOptionalTypeNode:updateOptionalTypeNode,createRestTypeNode:createRestTypeNode,updateRestTypeNode:updateRestTypeNode,createUnionTypeNode:createUnionTypeNode,updateUnionTypeNode:updateUnionTypeNode,createIntersectionTypeNode:createIntersectionTypeNode,updateIntersectionTypeNode:updateIntersectionTypeNode,createConditionalTypeNode:createConditionalTypeNode,updateConditionalTypeNode:updateConditionalTypeNode,createInferTypeNode:createInferTypeNode,updateInferTypeNode:updateInferTypeNode,createImportTypeNode:createImportTypeNode,updateImportTypeNode:updateImportTypeNode,createParenthesizedType:createParenthesizedType,updateParenthesizedType:updateParenthesizedType,createThisTypeNode:createThisTypeNode,createTypeOperatorNode:createTypeOperatorNode,updateTypeOperatorNode:updateTypeOperatorNode,createIndexedAccessTypeNode:createIndexedAccessTypeNode,updateIndexedAccessTypeNode:updateIndexedAccessTypeNode,createMappedTypeNode:createMappedTypeNode,updateMappedTypeNode:updateMappedTypeNode,createLiteralTypeNode:createLiteralTypeNode,updateLiteralTypeNode:updateLiteralTypeNode,createTemplateLiteralType:createTemplateLiteralType,updateTemplateLiteralType:updateTemplateLiteralType,createObjectBindingPattern:createObjectBindingPattern,updateObjectBindingPattern:updateObjectBindingPattern,createArrayBindingPattern:createArrayBindingPattern,updateArrayBindingPattern:updateArrayBindingPattern,createBindingElement:createBindingElement,updateBindingElement:updateBindingElement,createArrayLiteralExpression:createArrayLiteralExpression,updateArrayLiteralExpression:updateArrayLiteralExpression,createObjectLiteralExpression:createObjectLiteralExpression,updateObjectLiteralExpression:updateObjectLiteralExpression,createPropertyAccessExpression:e&4?(e,t)=>setEmitFlags(createPropertyAccessExpression(e,t),262144):createPropertyAccessExpression,updatePropertyAccessExpression:updatePropertyAccessExpression,createPropertyAccessChain:e&4?(e,t,n)=>setEmitFlags(createPropertyAccessChain(e,t,n),262144):createPropertyAccessChain,updatePropertyAccessChain:updatePropertyAccessChain,createElementAccessExpression:createElementAccessExpression,updateElementAccessExpression:updateElementAccessExpression,createElementAccessChain:createElementAccessChain,updateElementAccessChain:updateElementAccessChain,createCallExpression:createCallExpression,updateCallExpression:updateCallExpression,createCallChain:createCallChain,updateCallChain:updateCallChain,createNewExpression:createNewExpression,updateNewExpression:updateNewExpression,createTaggedTemplateExpression:createTaggedTemplateExpression,updateTaggedTemplateExpression:updateTaggedTemplateExpression,createTypeAssertion:createTypeAssertion,updateTypeAssertion:updateTypeAssertion,createParenthesizedExpression:createParenthesizedExpression,updateParenthesizedExpression:updateParenthesizedExpression,createFunctionExpression:createFunctionExpression,updateFunctionExpression:updateFunctionExpression,createArrowFunction:createArrowFunction,updateArrowFunction:updateArrowFunction,createDeleteExpression:createDeleteExpression,updateDeleteExpression:updateDeleteExpression,createTypeOfExpression:createTypeOfExpression,updateTypeOfExpression:updateTypeOfExpression,createVoidExpression:createVoidExpression,updateVoidExpression:updateVoidExpression,createAwaitExpression:createAwaitExpression,updateAwaitExpression:updateAwaitExpression,createPrefixUnaryExpression:createPrefixUnaryExpression,updatePrefixUnaryExpression:updatePrefixUnaryExpression,createPostfixUnaryExpression:createPostfixUnaryExpression,updatePostfixUnaryExpression:updatePostfixUnaryExpression,createBinaryExpression:createBinaryExpression,updateBinaryExpression:updateBinaryExpression,createConditionalExpression:createConditionalExpression,updateConditionalExpression:updateConditionalExpression,createTemplateExpression:createTemplateExpression,updateTemplateExpression:updateTemplateExpression,createTemplateHead:createTemplateHead,createTemplateMiddle:createTemplateMiddle,createTemplateTail:createTemplateTail,createNoSubstitutionTemplateLiteral:createNoSubstitutionTemplateLiteral,createTemplateLiteralLikeNode:createTemplateLiteralLikeNode,createYieldExpression:createYieldExpression,updateYieldExpression:updateYieldExpression,createSpreadElement:createSpreadElement,updateSpreadElement:updateSpreadElement,createClassExpression:createClassExpression,updateClassExpression:updateClassExpression,createOmittedExpression:createOmittedExpression,createExpressionWithTypeArguments:createExpressionWithTypeArguments,updateExpressionWithTypeArguments:updateExpressionWithTypeArguments,createAsExpression:createAsExpression,updateAsExpression:updateAsExpression,createNonNullExpression:createNonNullExpression,updateNonNullExpression:updateNonNullExpression,createSatisfiesExpression:createSatisfiesExpression,updateSatisfiesExpression:updateSatisfiesExpression,createNonNullChain:createNonNullChain,updateNonNullChain:updateNonNullChain,createMetaProperty:createMetaProperty,updateMetaProperty:updateMetaProperty,createTemplateSpan:createTemplateSpan,updateTemplateSpan:updateTemplateSpan,createSemicolonClassElement:createSemicolonClassElement,createBlock:createBlock,updateBlock:updateBlock,createVariableStatement:createVariableStatement,updateVariableStatement:updateVariableStatement,createEmptyStatement:createEmptyStatement,createExpressionStatement:createExpressionStatement,updateExpressionStatement:updateExpressionStatement,createIfStatement:createIfStatement,updateIfStatement:updateIfStatement,createDoStatement:createDoStatement,updateDoStatement:updateDoStatement,createWhileStatement:createWhileStatement,updateWhileStatement:updateWhileStatement,createForStatement:createForStatement,updateForStatement:updateForStatement,createForInStatement:createForInStatement,updateForInStatement:updateForInStatement,createForOfStatement:createForOfStatement,updateForOfStatement:updateForOfStatement,createContinueStatement:createContinueStatement,updateContinueStatement:updateContinueStatement,createBreakStatement:createBreakStatement,updateBreakStatement:updateBreakStatement,createReturnStatement:createReturnStatement,updateReturnStatement:updateReturnStatement,createWithStatement:createWithStatement,updateWithStatement:updateWithStatement,createSwitchStatement:createSwitchStatement,updateSwitchStatement:updateSwitchStatement,createLabeledStatement:createLabeledStatement,updateLabeledStatement:updateLabeledStatement,createThrowStatement:createThrowStatement,updateThrowStatement:updateThrowStatement,createTryStatement:createTryStatement,updateTryStatement:updateTryStatement,createDebuggerStatement:createDebuggerStatement,createVariableDeclaration:createVariableDeclaration,updateVariableDeclaration:updateVariableDeclaration,createVariableDeclarationList:createVariableDeclarationList,updateVariableDeclarationList:updateVariableDeclarationList,createFunctionDeclaration:createFunctionDeclaration,updateFunctionDeclaration:updateFunctionDeclaration,createClassDeclaration:createClassDeclaration,updateClassDeclaration:updateClassDeclaration,createInterfaceDeclaration:createInterfaceDeclaration,updateInterfaceDeclaration:updateInterfaceDeclaration,createTypeAliasDeclaration:createTypeAliasDeclaration,updateTypeAliasDeclaration:updateTypeAliasDeclaration,createEnumDeclaration:createEnumDeclaration,updateEnumDeclaration:updateEnumDeclaration,createModuleDeclaration:createModuleDeclaration,updateModuleDeclaration:updateModuleDeclaration,createModuleBlock:createModuleBlock,updateModuleBlock:updateModuleBlock,createCaseBlock:createCaseBlock,updateCaseBlock:updateCaseBlock,createNamespaceExportDeclaration:createNamespaceExportDeclaration,updateNamespaceExportDeclaration:updateNamespaceExportDeclaration,createImportEqualsDeclaration:createImportEqualsDeclaration,updateImportEqualsDeclaration:updateImportEqualsDeclaration,createImportDeclaration:createImportDeclaration,updateImportDeclaration:updateImportDeclaration,createImportClause:createImportClause2,updateImportClause:updateImportClause,createAssertClause:createAssertClause,updateAssertClause:updateAssertClause,createAssertEntry:createAssertEntry,updateAssertEntry:updateAssertEntry,createImportTypeAssertionContainer:createImportTypeAssertionContainer,updateImportTypeAssertionContainer:updateImportTypeAssertionContainer,createImportAttributes:createImportAttributes,updateImportAttributes:updateImportAttributes,createImportAttribute:createImportAttribute,updateImportAttribute:updateImportAttribute,createNamespaceImport:createNamespaceImport,updateNamespaceImport:updateNamespaceImport,createNamespaceExport:createNamespaceExport,updateNamespaceExport:updateNamespaceExport,createNamedImports:createNamedImports,updateNamedImports:updateNamedImports,createImportSpecifier:createImportSpecifier,updateImportSpecifier:updateImportSpecifier,createExportAssignment:createExportAssignment2,updateExportAssignment:updateExportAssignment,createExportDeclaration:createExportDeclaration,updateExportDeclaration:updateExportDeclaration,createNamedExports:createNamedExports,updateNamedExports:updateNamedExports,createExportSpecifier:createExportSpecifier,updateExportSpecifier:updateExportSpecifier,createMissingDeclaration:createMissingDeclaration,createExternalModuleReference:createExternalModuleReference,updateExternalModuleReference:updateExternalModuleReference,get createJSDocAllType(){return c(312)},get createJSDocUnknownType(){return c(313)},get createJSDocNonNullableType(){return u(315)},get updateJSDocNonNullableType(){return f(315)},get createJSDocNullableType(){return u(314)},get updateJSDocNullableType(){return f(314)},get createJSDocOptionalType(){return l(316)},get updateJSDocOptionalType(){return p(316)},get createJSDocVariadicType(){return l(318)},get updateJSDocVariadicType(){return p(318)},get createJSDocNamepathType(){return l(319)},get updateJSDocNamepathType(){return p(319)},createJSDocFunctionType:createJSDocFunctionType,updateJSDocFunctionType:updateJSDocFunctionType,createJSDocTypeLiteral:createJSDocTypeLiteral,updateJSDocTypeLiteral:updateJSDocTypeLiteral,createJSDocTypeExpression:createJSDocTypeExpression,updateJSDocTypeExpression:updateJSDocTypeExpression,createJSDocSignature:createJSDocSignature,updateJSDocSignature:updateJSDocSignature,createJSDocTemplateTag:createJSDocTemplateTag,updateJSDocTemplateTag:updateJSDocTemplateTag,createJSDocTypedefTag:createJSDocTypedefTag,updateJSDocTypedefTag:updateJSDocTypedefTag,createJSDocParameterTag:createJSDocParameterTag,updateJSDocParameterTag:updateJSDocParameterTag,createJSDocPropertyTag:createJSDocPropertyTag,updateJSDocPropertyTag:updateJSDocPropertyTag,createJSDocCallbackTag:createJSDocCallbackTag,updateJSDocCallbackTag:updateJSDocCallbackTag,createJSDocOverloadTag:createJSDocOverloadTag,updateJSDocOverloadTag:updateJSDocOverloadTag,createJSDocAugmentsTag:createJSDocAugmentsTag,updateJSDocAugmentsTag:updateJSDocAugmentsTag,createJSDocImplementsTag:createJSDocImplementsTag,updateJSDocImplementsTag:updateJSDocImplementsTag,createJSDocSeeTag:createJSDocSeeTag,updateJSDocSeeTag:updateJSDocSeeTag,createJSDocImportTag:createJSDocImportTag,updateJSDocImportTag:updateJSDocImportTag,createJSDocNameReference:createJSDocNameReference,updateJSDocNameReference:updateJSDocNameReference,createJSDocMemberName:createJSDocMemberName,updateJSDocMemberName:updateJSDocMemberName,createJSDocLink:createJSDocLink,updateJSDocLink:updateJSDocLink,createJSDocLinkCode:createJSDocLinkCode,updateJSDocLinkCode:updateJSDocLinkCode,createJSDocLinkPlain:createJSDocLinkPlain,updateJSDocLinkPlain:updateJSDocLinkPlain,get createJSDocTypeTag(){return g(344)},get updateJSDocTypeTag(){return y(344)},get createJSDocReturnTag(){return g(342)},get updateJSDocReturnTag(){return y(342)},get createJSDocThisTag(){return g(343)},get updateJSDocThisTag(){return y(343)},get createJSDocAuthorTag(){return m(330)},get updateJSDocAuthorTag(){return _(330)},get createJSDocClassTag(){return m(332)},get updateJSDocClassTag(){return _(332)},get createJSDocPublicTag(){return m(333)},get updateJSDocPublicTag(){return _(333)},get createJSDocPrivateTag(){return m(334)},get updateJSDocPrivateTag(){return _(334)},get createJSDocProtectedTag(){return m(335)},get updateJSDocProtectedTag(){return _(335)},get createJSDocReadonlyTag(){return m(336)},get updateJSDocReadonlyTag(){return _(336)},get createJSDocOverrideTag(){return m(337)},get updateJSDocOverrideTag(){return _(337)},get createJSDocDeprecatedTag(){return m(331)},get updateJSDocDeprecatedTag(){return _(331)},get createJSDocThrowsTag(){return g(349)},get updateJSDocThrowsTag(){return y(349)},get createJSDocSatisfiesTag(){return g(350)},get updateJSDocSatisfiesTag(){return y(350)},createJSDocEnumTag:createJSDocEnumTag,updateJSDocEnumTag:updateJSDocEnumTag,createJSDocUnknownTag:createJSDocUnknownTag,updateJSDocUnknownTag:updateJSDocUnknownTag,createJSDocText:createJSDocText,updateJSDocText:updateJSDocText,createJSDocComment:createJSDocComment,updateJSDocComment:updateJSDocComment,createJsxElement:createJsxElement,updateJsxElement:updateJsxElement,createJsxSelfClosingElement:createJsxSelfClosingElement,updateJsxSelfClosingElement:updateJsxSelfClosingElement,createJsxOpeningElement:createJsxOpeningElement,updateJsxOpeningElement:updateJsxOpeningElement,createJsxClosingElement:createJsxClosingElement,updateJsxClosingElement:updateJsxClosingElement,createJsxFragment:createJsxFragment,createJsxText:createJsxText,updateJsxText:updateJsxText,createJsxOpeningFragment:createJsxOpeningFragment,createJsxJsxClosingFragment:createJsxJsxClosingFragment,updateJsxFragment:updateJsxFragment,createJsxAttribute:createJsxAttribute,updateJsxAttribute:updateJsxAttribute,createJsxAttributes:createJsxAttributes,updateJsxAttributes:updateJsxAttributes,createJsxSpreadAttribute:createJsxSpreadAttribute,updateJsxSpreadAttribute:updateJsxSpreadAttribute,createJsxExpression:createJsxExpression,updateJsxExpression:updateJsxExpression,createJsxNamespacedName:createJsxNamespacedName,updateJsxNamespacedName:updateJsxNamespacedName,createCaseClause:createCaseClause,updateCaseClause:updateCaseClause,createDefaultClause:createDefaultClause,updateDefaultClause:updateDefaultClause,createHeritageClause:createHeritageClause,updateHeritageClause:updateHeritageClause,createCatchClause:createCatchClause,updateCatchClause:updateCatchClause,createPropertyAssignment:createPropertyAssignment,updatePropertyAssignment:updatePropertyAssignment,createShorthandPropertyAssignment:createShorthandPropertyAssignment,updateShorthandPropertyAssignment:updateShorthandPropertyAssignment,createSpreadAssignment:createSpreadAssignment,updateSpreadAssignment:updateSpreadAssignment,createEnumMember:createEnumMember,updateEnumMember:updateEnumMember,createSourceFile:createSourceFile2,updateSourceFile:updateSourceFile2,createRedirectedSourceFile:createRedirectedSourceFile,createBundle:createBundle,updateBundle:updateBundle,createSyntheticExpression:createSyntheticExpression,createSyntaxList:createSyntaxList3,createNotEmittedStatement:createNotEmittedStatement,createNotEmittedTypeElement:createNotEmittedTypeElement,createPartiallyEmittedExpression:createPartiallyEmittedExpression,updatePartiallyEmittedExpression:updatePartiallyEmittedExpression,createCommaListExpression:createCommaListExpression,updateCommaListExpression:updateCommaListExpression,createSyntheticReferenceExpression:createSyntheticReferenceExpression,updateSyntheticReferenceExpression:updateSyntheticReferenceExpression,cloneNode:cloneNode,get createComma(){return o(28)},get createAssignment(){return o(64)},get createLogicalOr(){return o(57)},get createLogicalAnd(){return o(56)},get createBitwiseOr(){return o(52)},get createBitwiseXor(){return o(53)},get createBitwiseAnd(){return o(51)},get createStrictEquality(){return o(37)},get createStrictInequality(){return o(38)},get createEquality(){return o(35)},get createInequality(){return o(36)},get createLessThan(){return o(30)},get createLessThanEquals(){return o(33)},get createGreaterThan(){return o(32)},get createGreaterThanEquals(){return o(34)},get createLeftShift(){return o(48)},get createRightShift(){return o(49)},get createUnsignedRightShift(){return o(50)},get createAdd(){return o(40)},get createSubtract(){return o(41)},get createMultiply(){return o(42)},get createDivide(){return o(44)},get createModulo(){return o(45)},get createExponent(){return o(43)},get createPrefixPlus(){return a(40)},get createPrefixMinus(){return a(41)},get createPrefixIncrement(){return a(46)},get createPrefixDecrement(){return a(47)},get createBitwiseNot(){return a(55)},get createLogicalNot(){return a(54)},get createPostfixIncrement(){return s(46)},get createPostfixDecrement(){return s(47)},createImmediatelyInvokedFunctionExpression:createImmediatelyInvokedFunctionExpression,createImmediatelyInvokedArrowFunction:createImmediatelyInvokedArrowFunction,createVoidZero:createVoidZero,createExportDefault:createExportDefault,createExternalModuleExport:createExternalModuleExport,createTypeCheck:createTypeCheck,createIsNotTypeCheck:createIsNotTypeCheck,createMethodCall:createMethodCall,createGlobalMethodCall:createGlobalMethodCall,createFunctionBindCall:createFunctionBindCall,createFunctionCallCall:createFunctionCallCall,createFunctionApplyCall:createFunctionApplyCall,createArraySliceCall:createArraySliceCall,createArrayConcatCall:createArrayConcatCall,createObjectDefinePropertyCall:createObjectDefinePropertyCall,createObjectGetOwnPropertyDescriptorCall:createObjectGetOwnPropertyDescriptorCall,createReflectGetCall:createReflectGetCall,createReflectSetCall:createReflectSetCall,createPropertyDescriptor:createPropertyDescriptor,createCallBinding:createCallBinding,createAssignmentTargetWrapper:createAssignmentTargetWrapper,inlineExpressions:inlineExpressions,getInternalName:getInternalName,getLocalName:getLocalName,getExportName:getExportName,getDeclarationName:getDeclarationName,getNamespaceMemberName:getNamespaceMemberName,getExternalModuleOrNamespaceExportName:getExternalModuleOrNamespaceExportName,restoreOuterExpressions:restoreOuterExpressions,restoreEnclosingLabel:restoreEnclosingLabel,createUseStrictPrologue:createUseStrictPrologue,copyPrologue:copyPrologue,copyStandardPrologue:copyStandardPrologue,copyCustomPrologue:copyCustomPrologue,ensureUseStrict:ensureUseStrict,liftToBlock:liftToBlock,mergeLexicalEnvironment:mergeLexicalEnvironment,replaceModifiers:replaceModifiers,replaceDecoratorsAndModifiers:replaceDecoratorsAndModifiers,replacePropertyName:replacePropertyName};forEach(Br,(e=>e(h)));return h;function createNodeArray(e,t){if(e===void 0||e===d){e=[]}else if(isNodeArray(e)){if(t===void 0||e.hasTrailingComma===t){if(e.transformFlags===void 0){aggregateChildrenFlags(e)}S.attachNodeArrayDebugInfo(e);return e}const n=e.slice();n.pos=e.pos;n.end=e.end;n.hasTrailingComma=t;n.transformFlags=e.transformFlags;S.attachNodeArrayDebugInfo(n);return n}const n=e.length;const r=n>=1&&n<=4?e.slice():e;r.pos=-1;r.end=-1;r.hasTrailingComma=!!t;r.transformFlags=0;aggregateChildrenFlags(r);S.attachNodeArrayDebugInfo(r);return r}function createBaseNode(e){return t.createBaseNode(e)}function createBaseDeclaration(e){const t=createBaseNode(e);t.symbol=void 0;t.localSymbol=void 0;return t}function finishUpdateBaseSignatureDeclaration(e,t){if(e!==t){e.typeArguments=t.typeArguments}return update(e,t)}function createNumericLiteral(e,t=0){const n=typeof e==="number"?e+"":e;S.assert(n.charCodeAt(0)!==45,"Negative numbers should be created in combination with createPrefixUnaryExpression");const r=createBaseDeclaration(9);r.text=n;r.numericLiteralFlags=t;if(t&384)r.transformFlags|=1024;return r}function createBigIntLiteral(e){const t=createBaseToken(10);t.text=typeof e==="string"?e:pseudoBigIntToString(e)+"n";t.transformFlags|=32;return t}function createBaseStringLiteral(e,t){const n=createBaseDeclaration(11);n.text=e;n.singleQuote=t;return n}function createStringLiteral(e,t,n){const r=createBaseStringLiteral(e,t);r.hasExtendedUnicodeEscape=n;if(n)r.transformFlags|=1024;return r}function createStringLiteralFromNode(e){const t=createBaseStringLiteral(getTextOfIdentifierOrLiteral(e),void 0);t.textSourceNode=e;return t}function createRegularExpressionLiteral(e){const t=createBaseToken(14);t.text=e;return t}function createLiteralLikeNode(e,t){switch(e){case 9:return createNumericLiteral(t,0);case 10:return createBigIntLiteral(t);case 11:return createStringLiteral(t,void 0);case 12:return createJsxText(t,false);case 13:return createJsxText(t,true);case 14:return createRegularExpressionLiteral(t);case 15:return createTemplateLiteralLikeNode(e,t,void 0,0)}}function createBaseIdentifier(e){const n=t.createBaseIdentifierNode(80);n.escapedText=e;n.jsDoc=void 0;n.flowNode=void 0;n.symbol=void 0;return n}function createBaseGeneratedIdentifier(e,t,n,r){const i=createBaseIdentifier(escapeLeadingUnderscores(e));setIdentifierAutoGenerate(i,{flags:t,id:Mr,prefix:n,suffix:r});Mr++;return i}function createIdentifier(e,t,n){if(t===void 0&&e){t=stringToToken(e)}if(t===80){t=void 0}const r=createBaseIdentifier(escapeLeadingUnderscores(e));if(n)r.flags|=256;if(r.escapedText==="await"){r.transformFlags|=67108864}if(r.flags&256){r.transformFlags|=1024}return r}function createTempVariable(e,t,n,r){let i=1;if(t)i|=8;const o=createBaseGeneratedIdentifier("",i,n,r);if(e){e(o)}return o}function createLoopVariable(e){let t=2;if(e)t|=8;return createBaseGeneratedIdentifier("",t,void 0,void 0)}function createUniqueName(e,t=0,n,r){S.assert(!(t&7),"Argument out of range: flags");S.assert((t&(16|32))!==32,"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic");return createBaseGeneratedIdentifier(e,3|t,n,r)}function getGeneratedNameForNode(e,t=0,n,r){S.assert(!(t&7),"Argument out of range: flags");const i=!e?"":isMemberName(e)?formatGeneratedName(false,n,e,r,idText):`generated@${getNodeId(e)}`;if(n||r)t|=16;const o=createBaseGeneratedIdentifier(i,4|t,n,r);o.original=e;return o}function createBasePrivateIdentifier(e){const n=t.createBasePrivateIdentifierNode(81);n.escapedText=e;n.transformFlags|=16777216;return n}function createPrivateIdentifier(e){if(!startsWith(e,"#"))S.fail("First character of private identifier must be #: "+e);return createBasePrivateIdentifier(escapeLeadingUnderscores(e))}function createBaseGeneratedPrivateIdentifier(e,t,n,r){const i=createBasePrivateIdentifier(escapeLeadingUnderscores(e));setIdentifierAutoGenerate(i,{flags:t,id:Mr,prefix:n,suffix:r});Mr++;return i}function createUniquePrivateName(e,t,n){if(e&&!startsWith(e,"#"))S.fail("First character of private identifier must be #: "+e);const r=8|(e?3:1);return createBaseGeneratedPrivateIdentifier(e??"",r,t,n)}function getGeneratedPrivateNameForNode(e,t,n){const r=isMemberName(e)?formatGeneratedName(true,t,e,n,idText):`#generated@${getNodeId(e)}`;const i=t||n?16:0;const o=createBaseGeneratedPrivateIdentifier(r,4|i,t,n);o.original=e;return o}function createBaseToken(e){return t.createBaseTokenNode(e)}function createToken(e){S.assert(e>=0&&e<=165,"Invalid token");S.assert(e<=15||e>=18,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals.");S.assert(e<=9||e>=15,"Invalid token. Use 'createLiteralLikeNode' to create literals.");S.assert(e!==80,"Invalid token. Use 'createIdentifier' to create identifiers");const t=createBaseToken(e);let n=0;switch(e){case 134:n=256|128;break;case 160:n=4;break;case 125:case 123:case 124:case 148:case 128:case 138:case 87:case 133:case 150:case 163:case 146:case 151:case 103:case 147:case 164:case 154:case 136:case 155:case 116:case 159:case 157:n=1;break;case 108:n=1024|134217728;t.flowNode=void 0;break;case 126:n=1024;break;case 129:n=16777216;break;case 110:n=16384;t.flowNode=void 0;break}if(n){t.transformFlags|=n}return t}function createSuper(){return createToken(108)}function createThis(){return createToken(110)}function createNull(){return createToken(106)}function createTrue(){return createToken(112)}function createFalse(){return createToken(97)}function createModifier(e){return createToken(e)}function createModifiersFromModifierFlags(e){const t=[];if(e&32)t.push(createModifier(95));if(e&128)t.push(createModifier(138));if(e&2048)t.push(createModifier(90));if(e&4096)t.push(createModifier(87));if(e&1)t.push(createModifier(125));if(e&2)t.push(createModifier(123));if(e&4)t.push(createModifier(124));if(e&64)t.push(createModifier(128));if(e&256)t.push(createModifier(126));if(e&16)t.push(createModifier(164));if(e&8)t.push(createModifier(148));if(e&512)t.push(createModifier(129));if(e&1024)t.push(createModifier(134));if(e&8192)t.push(createModifier(103));if(e&16384)t.push(createModifier(147));return t.length?t:void 0}function createQualifiedName(e,t){const n=createBaseNode(166);n.left=e;n.right=asName(t);n.transformFlags|=propagateChildFlags(n.left)|propagateIdentifierNameFlags(n.right);n.flowNode=void 0;return n}function updateQualifiedName(e,t,n){return e.left!==t||e.right!==n?update(createQualifiedName(t,n),e):e}function createComputedPropertyName(e){const t=createBaseNode(167);t.expression=r().parenthesizeExpressionOfComputedPropertyName(e);t.transformFlags|=propagateChildFlags(t.expression)|1024|131072;return t}function updateComputedPropertyName(e,t){return e.expression!==t?update(createComputedPropertyName(t),e):e}function createTypeParameterDeclaration(e,t,n,r){const i=createBaseDeclaration(168);i.modifiers=asNodeArray(e);i.name=asName(t);i.constraint=n;i.default=r;i.transformFlags=1;i.expression=void 0;i.jsDoc=void 0;return i}function updateTypeParameterDeclaration(e,t,n,r,i){return e.modifiers!==t||e.name!==n||e.constraint!==r||e.default!==i?update(createTypeParameterDeclaration(t,n,r,i),e):e}function createParameterDeclaration(e,t,n,r,i,o){const a=createBaseDeclaration(169);a.modifiers=asNodeArray(e);a.dotDotDotToken=t;a.name=asName(n);a.questionToken=r;a.type=i;a.initializer=asInitializer(o);if(isThisIdentifier(a.name)){a.transformFlags=1}else{a.transformFlags=propagateChildrenFlags(a.modifiers)|propagateChildFlags(a.dotDotDotToken)|propagateNameFlags(a.name)|propagateChildFlags(a.questionToken)|propagateChildFlags(a.initializer)|(a.questionToken??a.type?1:0)|(a.dotDotDotToken??a.initializer?1024:0)|(modifiersToFlags(a.modifiers)&31?8192:0)}a.jsDoc=void 0;return a}function updateParameterDeclaration(e,t,n,r,i,o,a){return e.modifiers!==t||e.dotDotDotToken!==n||e.name!==r||e.questionToken!==i||e.type!==o||e.initializer!==a?update(createParameterDeclaration(t,n,r,i,o,a),e):e}function createDecorator(e){const t=createBaseNode(170);t.expression=r().parenthesizeLeftSideOfAccess(e,false);t.transformFlags|=propagateChildFlags(t.expression)|1|8192|33554432;return t}function updateDecorator(e,t){return e.expression!==t?update(createDecorator(t),e):e}function createPropertySignature(e,t,n,r){const i=createBaseDeclaration(171);i.modifiers=asNodeArray(e);i.name=asName(t);i.type=r;i.questionToken=n;i.transformFlags=1;i.initializer=void 0;i.jsDoc=void 0;return i}function updatePropertySignature(e,t,n,r,i){return e.modifiers!==t||e.name!==n||e.questionToken!==r||e.type!==i?finishUpdatePropertySignature(createPropertySignature(t,n,r,i),e):e}function finishUpdatePropertySignature(e,t){if(e!==t){e.initializer=t.initializer}return update(e,t)}function createPropertyDeclaration(e,t,n,r,i){const o=createBaseDeclaration(172);o.modifiers=asNodeArray(e);o.name=asName(t);o.questionToken=n&&isQuestionToken(n)?n:void 0;o.exclamationToken=n&&isExclamationToken(n)?n:void 0;o.type=r;o.initializer=asInitializer(i);const a=o.flags&33554432||modifiersToFlags(o.modifiers)&128;o.transformFlags=propagateChildrenFlags(o.modifiers)|propagateNameFlags(o.name)|propagateChildFlags(o.initializer)|(a||o.questionToken||o.exclamationToken||o.type?1:0)|(isComputedPropertyName(o.name)||modifiersToFlags(o.modifiers)&256&&o.initializer?8192:0)|16777216;o.jsDoc=void 0;return o}function updatePropertyDeclaration2(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.questionToken!==(r!==void 0&&isQuestionToken(r)?r:void 0)||e.exclamationToken!==(r!==void 0&&isExclamationToken(r)?r:void 0)||e.type!==i||e.initializer!==o?update(createPropertyDeclaration(t,n,r,i,o),e):e}function createMethodSignature(e,t,n,r,i,o){const a=createBaseDeclaration(173);a.modifiers=asNodeArray(e);a.name=asName(t);a.questionToken=n;a.typeParameters=asNodeArray(r);a.parameters=asNodeArray(i);a.type=o;a.transformFlags=1;a.jsDoc=void 0;a.locals=void 0;a.nextContainer=void 0;a.typeArguments=void 0;return a}function updateMethodSignature(e,t,n,r,i,o,a){return e.modifiers!==t||e.name!==n||e.questionToken!==r||e.typeParameters!==i||e.parameters!==o||e.type!==a?finishUpdateBaseSignatureDeclaration(createMethodSignature(t,n,r,i,o,a),e):e}function createMethodDeclaration(e,t,n,r,i,o,a,s){const c=createBaseDeclaration(174);c.modifiers=asNodeArray(e);c.asteriskToken=t;c.name=asName(n);c.questionToken=r;c.exclamationToken=void 0;c.typeParameters=asNodeArray(i);c.parameters=createNodeArray(o);c.type=a;c.body=s;if(!c.body){c.transformFlags=1}else{const e=modifiersToFlags(c.modifiers)&1024;const t=!!c.asteriskToken;const n=e&&t;c.transformFlags=propagateChildrenFlags(c.modifiers)|propagateChildFlags(c.asteriskToken)|propagateNameFlags(c.name)|propagateChildFlags(c.questionToken)|propagateChildrenFlags(c.typeParameters)|propagateChildrenFlags(c.parameters)|propagateChildFlags(c.type)|propagateChildFlags(c.body)&~67108864|(n?128:e?256:t?2048:0)|(c.questionToken||c.typeParameters||c.type?1:0)|1024}c.typeArguments=void 0;c.jsDoc=void 0;c.locals=void 0;c.nextContainer=void 0;c.flowNode=void 0;c.endFlowNode=void 0;c.returnFlowNode=void 0;return c}function updateMethodDeclaration(e,t,n,r,i,o,a,s,c){return e.modifiers!==t||e.asteriskToken!==n||e.name!==r||e.questionToken!==i||e.typeParameters!==o||e.parameters!==a||e.type!==s||e.body!==c?finishUpdateMethodDeclaration(createMethodDeclaration(t,n,r,i,o,a,s,c),e):e}function finishUpdateMethodDeclaration(e,t){if(e!==t){e.exclamationToken=t.exclamationToken}return update(e,t)}function createClassStaticBlockDeclaration(e){const t=createBaseDeclaration(175);t.body=e;t.transformFlags=propagateChildFlags(e)|16777216;t.modifiers=void 0;t.jsDoc=void 0;t.locals=void 0;t.nextContainer=void 0;t.endFlowNode=void 0;t.returnFlowNode=void 0;return t}function updateClassStaticBlockDeclaration(e,t){return e.body!==t?finishUpdateClassStaticBlockDeclaration(createClassStaticBlockDeclaration(t),e):e}function finishUpdateClassStaticBlockDeclaration(e,t){if(e!==t){e.modifiers=t.modifiers}return update(e,t)}function createConstructorDeclaration(e,t,n){const r=createBaseDeclaration(176);r.modifiers=asNodeArray(e);r.parameters=createNodeArray(t);r.body=n;if(!r.body){r.transformFlags=1}else{r.transformFlags=propagateChildrenFlags(r.modifiers)|propagateChildrenFlags(r.parameters)|propagateChildFlags(r.body)&~67108864|1024}r.typeParameters=void 0;r.type=void 0;r.typeArguments=void 0;r.jsDoc=void 0;r.locals=void 0;r.nextContainer=void 0;r.endFlowNode=void 0;r.returnFlowNode=void 0;return r}function updateConstructorDeclaration(e,t,n,r){return e.modifiers!==t||e.parameters!==n||e.body!==r?finishUpdateConstructorDeclaration(createConstructorDeclaration(t,n,r),e):e}function finishUpdateConstructorDeclaration(e,t){if(e!==t){e.typeParameters=t.typeParameters;e.type=t.type}return finishUpdateBaseSignatureDeclaration(e,t)}function createGetAccessorDeclaration(e,t,n,r,i){const o=createBaseDeclaration(177);o.modifiers=asNodeArray(e);o.name=asName(t);o.parameters=createNodeArray(n);o.type=r;o.body=i;if(!o.body){o.transformFlags=1}else{o.transformFlags=propagateChildrenFlags(o.modifiers)|propagateNameFlags(o.name)|propagateChildrenFlags(o.parameters)|propagateChildFlags(o.type)|propagateChildFlags(o.body)&~67108864|(o.type?1:0)}o.typeArguments=void 0;o.typeParameters=void 0;o.jsDoc=void 0;o.locals=void 0;o.nextContainer=void 0;o.flowNode=void 0;o.endFlowNode=void 0;o.returnFlowNode=void 0;return o}function updateGetAccessorDeclaration(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.parameters!==r||e.type!==i||e.body!==o?finishUpdateGetAccessorDeclaration(createGetAccessorDeclaration(t,n,r,i,o),e):e}function finishUpdateGetAccessorDeclaration(e,t){if(e!==t){e.typeParameters=t.typeParameters}return finishUpdateBaseSignatureDeclaration(e,t)}function createSetAccessorDeclaration(e,t,n,r){const i=createBaseDeclaration(178);i.modifiers=asNodeArray(e);i.name=asName(t);i.parameters=createNodeArray(n);i.body=r;if(!i.body){i.transformFlags=1}else{i.transformFlags=propagateChildrenFlags(i.modifiers)|propagateNameFlags(i.name)|propagateChildrenFlags(i.parameters)|propagateChildFlags(i.body)&~67108864|(i.type?1:0)}i.typeArguments=void 0;i.typeParameters=void 0;i.type=void 0;i.jsDoc=void 0;i.locals=void 0;i.nextContainer=void 0;i.flowNode=void 0;i.endFlowNode=void 0;i.returnFlowNode=void 0;return i}function updateSetAccessorDeclaration(e,t,n,r,i){return e.modifiers!==t||e.name!==n||e.parameters!==r||e.body!==i?finishUpdateSetAccessorDeclaration(createSetAccessorDeclaration(t,n,r,i),e):e}function finishUpdateSetAccessorDeclaration(e,t){if(e!==t){e.typeParameters=t.typeParameters;e.type=t.type}return finishUpdateBaseSignatureDeclaration(e,t)}function createCallSignature(e,t,n){const r=createBaseDeclaration(179);r.typeParameters=asNodeArray(e);r.parameters=asNodeArray(t);r.type=n;r.transformFlags=1;r.jsDoc=void 0;r.locals=void 0;r.nextContainer=void 0;r.typeArguments=void 0;return r}function updateCallSignature(e,t,n,r){return e.typeParameters!==t||e.parameters!==n||e.type!==r?finishUpdateBaseSignatureDeclaration(createCallSignature(t,n,r),e):e}function createConstructSignature(e,t,n){const r=createBaseDeclaration(180);r.typeParameters=asNodeArray(e);r.parameters=asNodeArray(t);r.type=n;r.transformFlags=1;r.jsDoc=void 0;r.locals=void 0;r.nextContainer=void 0;r.typeArguments=void 0;return r}function updateConstructSignature(e,t,n,r){return e.typeParameters!==t||e.parameters!==n||e.type!==r?finishUpdateBaseSignatureDeclaration(createConstructSignature(t,n,r),e):e}function createIndexSignature(e,t,n){const r=createBaseDeclaration(181);r.modifiers=asNodeArray(e);r.parameters=asNodeArray(t);r.type=n;r.transformFlags=1;r.jsDoc=void 0;r.locals=void 0;r.nextContainer=void 0;r.typeArguments=void 0;return r}function updateIndexSignature(e,t,n,r){return e.parameters!==n||e.type!==r||e.modifiers!==t?finishUpdateBaseSignatureDeclaration(createIndexSignature(t,n,r),e):e}function createTemplateLiteralTypeSpan(e,t){const n=createBaseNode(204);n.type=e;n.literal=t;n.transformFlags=1;return n}function updateTemplateLiteralTypeSpan(e,t,n){return e.type!==t||e.literal!==n?update(createTemplateLiteralTypeSpan(t,n),e):e}function createKeywordTypeNode(e){return createToken(e)}function createTypePredicateNode(e,t,n){const r=createBaseNode(182);r.assertsModifier=e;r.parameterName=asName(t);r.type=n;r.transformFlags=1;return r}function updateTypePredicateNode(e,t,n,r){return e.assertsModifier!==t||e.parameterName!==n||e.type!==r?update(createTypePredicateNode(t,n,r),e):e}function createTypeReferenceNode(e,t){const n=createBaseNode(183);n.typeName=asName(e);n.typeArguments=t&&r().parenthesizeTypeArguments(createNodeArray(t));n.transformFlags=1;return n}function updateTypeReferenceNode(e,t,n){return e.typeName!==t||e.typeArguments!==n?update(createTypeReferenceNode(t,n),e):e}function createFunctionTypeNode(e,t,n){const r=createBaseDeclaration(184);r.typeParameters=asNodeArray(e);r.parameters=asNodeArray(t);r.type=n;r.transformFlags=1;r.modifiers=void 0;r.jsDoc=void 0;r.locals=void 0;r.nextContainer=void 0;r.typeArguments=void 0;return r}function updateFunctionTypeNode(e,t,n,r){return e.typeParameters!==t||e.parameters!==n||e.type!==r?finishUpdateFunctionTypeNode(createFunctionTypeNode(t,n,r),e):e}function finishUpdateFunctionTypeNode(e,t){if(e!==t){e.modifiers=t.modifiers}return finishUpdateBaseSignatureDeclaration(e,t)}function createConstructorTypeNode(...e){return e.length===4?createConstructorTypeNode1(...e):e.length===3?createConstructorTypeNode2(...e):S.fail("Incorrect number of arguments specified.")}function createConstructorTypeNode1(e,t,n,r){const i=createBaseDeclaration(185);i.modifiers=asNodeArray(e);i.typeParameters=asNodeArray(t);i.parameters=asNodeArray(n);i.type=r;i.transformFlags=1;i.jsDoc=void 0;i.locals=void 0;i.nextContainer=void 0;i.typeArguments=void 0;return i}function createConstructorTypeNode2(e,t,n){return createConstructorTypeNode1(void 0,e,t,n)}function updateConstructorTypeNode(...e){return e.length===5?updateConstructorTypeNode1(...e):e.length===4?updateConstructorTypeNode2(...e):S.fail("Incorrect number of arguments specified.")}function updateConstructorTypeNode1(e,t,n,r,i){return e.modifiers!==t||e.typeParameters!==n||e.parameters!==r||e.type!==i?finishUpdateBaseSignatureDeclaration(createConstructorTypeNode(t,n,r,i),e):e}function updateConstructorTypeNode2(e,t,n,r){return updateConstructorTypeNode1(e,e.modifiers,t,n,r)}function createTypeQueryNode(e,t){const n=createBaseNode(186);n.exprName=e;n.typeArguments=t&&r().parenthesizeTypeArguments(t);n.transformFlags=1;return n}function updateTypeQueryNode(e,t,n){return e.exprName!==t||e.typeArguments!==n?update(createTypeQueryNode(t,n),e):e}function createTypeLiteralNode(e){const t=createBaseDeclaration(187);t.members=createNodeArray(e);t.transformFlags=1;return t}function updateTypeLiteralNode(e,t){return e.members!==t?update(createTypeLiteralNode(t),e):e}function createArrayTypeNode(e){const t=createBaseNode(188);t.elementType=r().parenthesizeNonArrayTypeOfPostfixType(e);t.transformFlags=1;return t}function updateArrayTypeNode(e,t){return e.elementType!==t?update(createArrayTypeNode(t),e):e}function createTupleTypeNode(e){const t=createBaseNode(189);t.elements=createNodeArray(r().parenthesizeElementTypesOfTupleType(e));t.transformFlags=1;return t}function updateTupleTypeNode(e,t){return e.elements!==t?update(createTupleTypeNode(t),e):e}function createNamedTupleMember(e,t,n,r){const i=createBaseDeclaration(202);i.dotDotDotToken=e;i.name=t;i.questionToken=n;i.type=r;i.transformFlags=1;i.jsDoc=void 0;return i}function updateNamedTupleMember(e,t,n,r,i){return e.dotDotDotToken!==t||e.name!==n||e.questionToken!==r||e.type!==i?update(createNamedTupleMember(t,n,r,i),e):e}function createOptionalTypeNode(e){const t=createBaseNode(190);t.type=r().parenthesizeTypeOfOptionalType(e);t.transformFlags=1;return t}function updateOptionalTypeNode(e,t){return e.type!==t?update(createOptionalTypeNode(t),e):e}function createRestTypeNode(e){const t=createBaseNode(191);t.type=e;t.transformFlags=1;return t}function updateRestTypeNode(e,t){return e.type!==t?update(createRestTypeNode(t),e):e}function createUnionOrIntersectionTypeNode(e,t,n){const r=createBaseNode(e);r.types=h.createNodeArray(n(t));r.transformFlags=1;return r}function updateUnionOrIntersectionTypeNode(e,t,n){return e.types!==t?update(createUnionOrIntersectionTypeNode(e.kind,t,n),e):e}function createUnionTypeNode(e){return createUnionOrIntersectionTypeNode(192,e,r().parenthesizeConstituentTypesOfUnionType)}function updateUnionTypeNode(e,t){return updateUnionOrIntersectionTypeNode(e,t,r().parenthesizeConstituentTypesOfUnionType)}function createIntersectionTypeNode(e){return createUnionOrIntersectionTypeNode(193,e,r().parenthesizeConstituentTypesOfIntersectionType)}function updateIntersectionTypeNode(e,t){return updateUnionOrIntersectionTypeNode(e,t,r().parenthesizeConstituentTypesOfIntersectionType)}function createConditionalTypeNode(e,t,n,i){const o=createBaseNode(194);o.checkType=r().parenthesizeCheckTypeOfConditionalType(e);o.extendsType=r().parenthesizeExtendsTypeOfConditionalType(t);o.trueType=n;o.falseType=i;o.transformFlags=1;o.locals=void 0;o.nextContainer=void 0;return o}function updateConditionalTypeNode(e,t,n,r,i){return e.checkType!==t||e.extendsType!==n||e.trueType!==r||e.falseType!==i?update(createConditionalTypeNode(t,n,r,i),e):e}function createInferTypeNode(e){const t=createBaseNode(195);t.typeParameter=e;t.transformFlags=1;return t}function updateInferTypeNode(e,t){return e.typeParameter!==t?update(createInferTypeNode(t),e):e}function createTemplateLiteralType(e,t){const n=createBaseNode(203);n.head=e;n.templateSpans=createNodeArray(t);n.transformFlags=1;return n}function updateTemplateLiteralType(e,t,n){return e.head!==t||e.templateSpans!==n?update(createTemplateLiteralType(t,n),e):e}function createImportTypeNode(e,t,n,i,o=false){const a=createBaseNode(205);a.argument=e;a.attributes=t;if(a.assertions&&a.assertions.assertClause&&a.attributes){a.assertions.assertClause=a.attributes}a.qualifier=n;a.typeArguments=i&&r().parenthesizeTypeArguments(i);a.isTypeOf=o;a.transformFlags=1;return a}function updateImportTypeNode(e,t,n,r,i,o=e.isTypeOf){return e.argument!==t||e.attributes!==n||e.qualifier!==r||e.typeArguments!==i||e.isTypeOf!==o?update(createImportTypeNode(t,n,r,i,o),e):e}function createParenthesizedType(e){const t=createBaseNode(196);t.type=e;t.transformFlags=1;return t}function updateParenthesizedType(e,t){return e.type!==t?update(createParenthesizedType(t),e):e}function createThisTypeNode(){const e=createBaseNode(197);e.transformFlags=1;return e}function createTypeOperatorNode(e,t){const n=createBaseNode(198);n.operator=e;n.type=e===148?r().parenthesizeOperandOfReadonlyTypeOperator(t):r().parenthesizeOperandOfTypeOperator(t);n.transformFlags=1;return n}function updateTypeOperatorNode(e,t){return e.type!==t?update(createTypeOperatorNode(e.operator,t),e):e}function createIndexedAccessTypeNode(e,t){const n=createBaseNode(199);n.objectType=r().parenthesizeNonArrayTypeOfPostfixType(e);n.indexType=t;n.transformFlags=1;return n}function updateIndexedAccessTypeNode(e,t,n){return e.objectType!==t||e.indexType!==n?update(createIndexedAccessTypeNode(t,n),e):e}function createMappedTypeNode(e,t,n,r,i,o){const a=createBaseDeclaration(200);a.readonlyToken=e;a.typeParameter=t;a.nameType=n;a.questionToken=r;a.type=i;a.members=o&&createNodeArray(o);a.transformFlags=1;a.locals=void 0;a.nextContainer=void 0;return a}function updateMappedTypeNode(e,t,n,r,i,o,a){return e.readonlyToken!==t||e.typeParameter!==n||e.nameType!==r||e.questionToken!==i||e.type!==o||e.members!==a?update(createMappedTypeNode(t,n,r,i,o,a),e):e}function createLiteralTypeNode(e){const t=createBaseNode(201);t.literal=e;t.transformFlags=1;return t}function updateLiteralTypeNode(e,t){return e.literal!==t?update(createLiteralTypeNode(t),e):e}function createObjectBindingPattern(e){const t=createBaseNode(206);t.elements=createNodeArray(e);t.transformFlags|=propagateChildrenFlags(t.elements)|1024|524288;if(t.transformFlags&32768){t.transformFlags|=128|65536}return t}function updateObjectBindingPattern(e,t){return e.elements!==t?update(createObjectBindingPattern(t),e):e}function createArrayBindingPattern(e){const t=createBaseNode(207);t.elements=createNodeArray(e);t.transformFlags|=propagateChildrenFlags(t.elements)|1024|524288;return t}function updateArrayBindingPattern(e,t){return e.elements!==t?update(createArrayBindingPattern(t),e):e}function createBindingElement(e,t,n,r){const i=createBaseDeclaration(208);i.dotDotDotToken=e;i.propertyName=asName(t);i.name=asName(n);i.initializer=asInitializer(r);i.transformFlags|=propagateChildFlags(i.dotDotDotToken)|propagateNameFlags(i.propertyName)|propagateNameFlags(i.name)|propagateChildFlags(i.initializer)|(i.dotDotDotToken?32768:0)|1024;i.flowNode=void 0;return i}function updateBindingElement(e,t,n,r,i){return e.propertyName!==n||e.dotDotDotToken!==t||e.name!==r||e.initializer!==i?update(createBindingElement(t,n,r,i),e):e}function createArrayLiteralExpression(e,t){const n=createBaseNode(209);const i=e&&lastOrUndefined(e);const o=createNodeArray(e,i&&isOmittedExpression(i)?true:void 0);n.elements=r().parenthesizeExpressionsOfCommaDelimitedList(o);n.multiLine=t;n.transformFlags|=propagateChildrenFlags(n.elements);return n}function updateArrayLiteralExpression(e,t){return e.elements!==t?update(createArrayLiteralExpression(t,e.multiLine),e):e}function createObjectLiteralExpression(e,t){const n=createBaseDeclaration(210);n.properties=createNodeArray(e);n.multiLine=t;n.transformFlags|=propagateChildrenFlags(n.properties);n.jsDoc=void 0;return n}function updateObjectLiteralExpression(e,t){return e.properties!==t?update(createObjectLiteralExpression(t,e.multiLine),e):e}function createBasePropertyAccessExpression(e,t,n){const r=createBaseDeclaration(211);r.expression=e;r.questionDotToken=t;r.name=n;r.transformFlags=propagateChildFlags(r.expression)|propagateChildFlags(r.questionDotToken)|(isIdentifier(r.name)?propagateIdentifierNameFlags(r.name):propagateChildFlags(r.name)|536870912);r.jsDoc=void 0;r.flowNode=void 0;return r}function createPropertyAccessExpression(e,t){const n=createBasePropertyAccessExpression(r().parenthesizeLeftSideOfAccess(e,false),void 0,asName(t));if(isSuperKeyword(e)){n.transformFlags|=256|128}return n}function updatePropertyAccessExpression(e,t,n){if(isPropertyAccessChain(e)){return updatePropertyAccessChain(e,t,e.questionDotToken,cast(n,isIdentifier))}return e.expression!==t||e.name!==n?update(createPropertyAccessExpression(t,n),e):e}function createPropertyAccessChain(e,t,n){const i=createBasePropertyAccessExpression(r().parenthesizeLeftSideOfAccess(e,true),t,asName(n));i.flags|=64;i.transformFlags|=32;return i}function updatePropertyAccessChain(e,t,n,r){S.assert(!!(e.flags&64),"Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead.");return e.expression!==t||e.questionDotToken!==n||e.name!==r?update(createPropertyAccessChain(t,n,r),e):e}function createBaseElementAccessExpression(e,t,n){const r=createBaseDeclaration(212);r.expression=e;r.questionDotToken=t;r.argumentExpression=n;r.transformFlags|=propagateChildFlags(r.expression)|propagateChildFlags(r.questionDotToken)|propagateChildFlags(r.argumentExpression);r.jsDoc=void 0;r.flowNode=void 0;return r}function createElementAccessExpression(e,t){const n=createBaseElementAccessExpression(r().parenthesizeLeftSideOfAccess(e,false),void 0,asExpression(t));if(isSuperKeyword(e)){n.transformFlags|=256|128}return n}function updateElementAccessExpression(e,t,n){if(isElementAccessChain(e)){return updateElementAccessChain(e,t,e.questionDotToken,n)}return e.expression!==t||e.argumentExpression!==n?update(createElementAccessExpression(t,n),e):e}function createElementAccessChain(e,t,n){const i=createBaseElementAccessExpression(r().parenthesizeLeftSideOfAccess(e,true),t,asExpression(n));i.flags|=64;i.transformFlags|=32;return i}function updateElementAccessChain(e,t,n,r){S.assert(!!(e.flags&64),"Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead.");return e.expression!==t||e.questionDotToken!==n||e.argumentExpression!==r?update(createElementAccessChain(t,n,r),e):e}function createBaseCallExpression(e,t,n,r){const i=createBaseDeclaration(213);i.expression=e;i.questionDotToken=t;i.typeArguments=n;i.arguments=r;i.transformFlags|=propagateChildFlags(i.expression)|propagateChildFlags(i.questionDotToken)|propagateChildrenFlags(i.typeArguments)|propagateChildrenFlags(i.arguments);if(i.typeArguments){i.transformFlags|=1}if(isSuperProperty(i.expression)){i.transformFlags|=16384}return i}function createCallExpression(e,t,n){const i=createBaseCallExpression(r().parenthesizeLeftSideOfAccess(e,false),void 0,asNodeArray(t),r().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(n)));if(isImportKeyword(i.expression)){i.transformFlags|=8388608}return i}function updateCallExpression(e,t,n,r){if(isCallChain(e)){return updateCallChain(e,t,e.questionDotToken,n,r)}return e.expression!==t||e.typeArguments!==n||e.arguments!==r?update(createCallExpression(t,n,r),e):e}function createCallChain(e,t,n,i){const o=createBaseCallExpression(r().parenthesizeLeftSideOfAccess(e,true),t,asNodeArray(n),r().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(i)));o.flags|=64;o.transformFlags|=32;return o}function updateCallChain(e,t,n,r,i){S.assert(!!(e.flags&64),"Cannot update a CallExpression using updateCallChain. Use updateCall instead.");return e.expression!==t||e.questionDotToken!==n||e.typeArguments!==r||e.arguments!==i?update(createCallChain(t,n,r,i),e):e}function createNewExpression(e,t,n){const i=createBaseDeclaration(214);i.expression=r().parenthesizeExpressionOfNew(e);i.typeArguments=asNodeArray(t);i.arguments=n?r().parenthesizeExpressionsOfCommaDelimitedList(n):void 0;i.transformFlags|=propagateChildFlags(i.expression)|propagateChildrenFlags(i.typeArguments)|propagateChildrenFlags(i.arguments)|32;if(i.typeArguments){i.transformFlags|=1}return i}function updateNewExpression(e,t,n,r){return e.expression!==t||e.typeArguments!==n||e.arguments!==r?update(createNewExpression(t,n,r),e):e}function createTaggedTemplateExpression(e,t,n){const i=createBaseNode(215);i.tag=r().parenthesizeLeftSideOfAccess(e,false);i.typeArguments=asNodeArray(t);i.template=n;i.transformFlags|=propagateChildFlags(i.tag)|propagateChildrenFlags(i.typeArguments)|propagateChildFlags(i.template)|1024;if(i.typeArguments){i.transformFlags|=1}if(hasInvalidEscape(i.template)){i.transformFlags|=128}return i}function updateTaggedTemplateExpression(e,t,n,r){return e.tag!==t||e.typeArguments!==n||e.template!==r?update(createTaggedTemplateExpression(t,n,r),e):e}function createTypeAssertion(e,t){const n=createBaseNode(216);n.expression=r().parenthesizeOperandOfPrefixUnary(t);n.type=e;n.transformFlags|=propagateChildFlags(n.expression)|propagateChildFlags(n.type)|1;return n}function updateTypeAssertion(e,t,n){return e.type!==t||e.expression!==n?update(createTypeAssertion(t,n),e):e}function createParenthesizedExpression(e){const t=createBaseNode(217);t.expression=e;t.transformFlags=propagateChildFlags(t.expression);t.jsDoc=void 0;return t}function updateParenthesizedExpression(e,t){return e.expression!==t?update(createParenthesizedExpression(t),e):e}function createFunctionExpression(e,t,n,r,i,o,a){const s=createBaseDeclaration(218);s.modifiers=asNodeArray(e);s.asteriskToken=t;s.name=asName(n);s.typeParameters=asNodeArray(r);s.parameters=createNodeArray(i);s.type=o;s.body=a;const c=modifiersToFlags(s.modifiers)&1024;const l=!!s.asteriskToken;const d=c&&l;s.transformFlags=propagateChildrenFlags(s.modifiers)|propagateChildFlags(s.asteriskToken)|propagateNameFlags(s.name)|propagateChildrenFlags(s.typeParameters)|propagateChildrenFlags(s.parameters)|propagateChildFlags(s.type)|propagateChildFlags(s.body)&~67108864|(d?128:c?256:l?2048:0)|(s.typeParameters||s.type?1:0)|4194304;s.typeArguments=void 0;s.jsDoc=void 0;s.locals=void 0;s.nextContainer=void 0;s.flowNode=void 0;s.endFlowNode=void 0;s.returnFlowNode=void 0;return s}function updateFunctionExpression(e,t,n,r,i,o,a,s){return e.name!==r||e.modifiers!==t||e.asteriskToken!==n||e.typeParameters!==i||e.parameters!==o||e.type!==a||e.body!==s?finishUpdateBaseSignatureDeclaration(createFunctionExpression(t,n,r,i,o,a,s),e):e}function createArrowFunction(e,t,n,i,o,a){const s=createBaseDeclaration(219);s.modifiers=asNodeArray(e);s.typeParameters=asNodeArray(t);s.parameters=createNodeArray(n);s.type=i;s.equalsGreaterThanToken=o??createToken(39);s.body=r().parenthesizeConciseBodyOfArrowFunction(a);const c=modifiersToFlags(s.modifiers)&1024;s.transformFlags=propagateChildrenFlags(s.modifiers)|propagateChildrenFlags(s.typeParameters)|propagateChildrenFlags(s.parameters)|propagateChildFlags(s.type)|propagateChildFlags(s.equalsGreaterThanToken)|propagateChildFlags(s.body)&~67108864|(s.typeParameters||s.type?1:0)|(c?256|16384:0)|1024;s.typeArguments=void 0;s.jsDoc=void 0;s.locals=void 0;s.nextContainer=void 0;s.flowNode=void 0;s.endFlowNode=void 0;s.returnFlowNode=void 0;return s}function updateArrowFunction(e,t,n,r,i,o,a){return e.modifiers!==t||e.typeParameters!==n||e.parameters!==r||e.type!==i||e.equalsGreaterThanToken!==o||e.body!==a?finishUpdateBaseSignatureDeclaration(createArrowFunction(t,n,r,i,o,a),e):e}function createDeleteExpression(e){const t=createBaseNode(220);t.expression=r().parenthesizeOperandOfPrefixUnary(e);t.transformFlags|=propagateChildFlags(t.expression);return t}function updateDeleteExpression(e,t){return e.expression!==t?update(createDeleteExpression(t),e):e}function createTypeOfExpression(e){const t=createBaseNode(221);t.expression=r().parenthesizeOperandOfPrefixUnary(e);t.transformFlags|=propagateChildFlags(t.expression);return t}function updateTypeOfExpression(e,t){return e.expression!==t?update(createTypeOfExpression(t),e):e}function createVoidExpression(e){const t=createBaseNode(222);t.expression=r().parenthesizeOperandOfPrefixUnary(e);t.transformFlags|=propagateChildFlags(t.expression);return t}function updateVoidExpression(e,t){return e.expression!==t?update(createVoidExpression(t),e):e}function createAwaitExpression(e){const t=createBaseNode(223);t.expression=r().parenthesizeOperandOfPrefixUnary(e);t.transformFlags|=propagateChildFlags(t.expression)|256|128|2097152;return t}function updateAwaitExpression(e,t){return e.expression!==t?update(createAwaitExpression(t),e):e}function createPrefixUnaryExpression(e,t){const n=createBaseNode(224);n.operator=e;n.operand=r().parenthesizeOperandOfPrefixUnary(t);n.transformFlags|=propagateChildFlags(n.operand);if((e===46||e===47)&&isIdentifier(n.operand)&&!isGeneratedIdentifier(n.operand)&&!isLocalName(n.operand)){n.transformFlags|=268435456}return n}function updatePrefixUnaryExpression(e,t){return e.operand!==t?update(createPrefixUnaryExpression(e.operator,t),e):e}function createPostfixUnaryExpression(e,t){const n=createBaseNode(225);n.operator=t;n.operand=r().parenthesizeOperandOfPostfixUnary(e);n.transformFlags|=propagateChildFlags(n.operand);if(isIdentifier(n.operand)&&!isGeneratedIdentifier(n.operand)&&!isLocalName(n.operand)){n.transformFlags|=268435456}return n}function updatePostfixUnaryExpression(e,t){return e.operand!==t?update(createPostfixUnaryExpression(t,e.operator),e):e}function createBinaryExpression(e,t,n){const i=createBaseDeclaration(226);const o=asToken(t);const a=o.kind;i.left=r().parenthesizeLeftSideOfBinary(a,e);i.operatorToken=o;i.right=r().parenthesizeRightSideOfBinary(a,i.left,n);i.transformFlags|=propagateChildFlags(i.left)|propagateChildFlags(i.operatorToken)|propagateChildFlags(i.right);if(a===61){i.transformFlags|=32}else if(a===64){if(isObjectLiteralExpression(i.left)){i.transformFlags|=1024|128|4096|propagateAssignmentPatternFlags(i.left)}else if(isArrayLiteralExpression(i.left)){i.transformFlags|=1024|4096|propagateAssignmentPatternFlags(i.left)}}else if(a===43||a===68){i.transformFlags|=512}else if(isLogicalOrCoalescingAssignmentOperator(a)){i.transformFlags|=16}if(a===103&&isPrivateIdentifier(i.left)){i.transformFlags|=536870912}i.jsDoc=void 0;return i}function propagateAssignmentPatternFlags(e){return containsObjectRestOrSpread(e)?65536:0}function updateBinaryExpression(e,t,n,r){return e.left!==t||e.operatorToken!==n||e.right!==r?update(createBinaryExpression(t,n,r),e):e}function createConditionalExpression(e,t,n,i,o){const a=createBaseNode(227);a.condition=r().parenthesizeConditionOfConditionalExpression(e);a.questionToken=t??createToken(58);a.whenTrue=r().parenthesizeBranchOfConditionalExpression(n);a.colonToken=i??createToken(59);a.whenFalse=r().parenthesizeBranchOfConditionalExpression(o);a.transformFlags|=propagateChildFlags(a.condition)|propagateChildFlags(a.questionToken)|propagateChildFlags(a.whenTrue)|propagateChildFlags(a.colonToken)|propagateChildFlags(a.whenFalse);a.flowNodeWhenFalse=void 0;a.flowNodeWhenTrue=void 0;return a}function updateConditionalExpression(e,t,n,r,i,o){return e.condition!==t||e.questionToken!==n||e.whenTrue!==r||e.colonToken!==i||e.whenFalse!==o?update(createConditionalExpression(t,n,r,i,o),e):e}function createTemplateExpression(e,t){const n=createBaseNode(228);n.head=e;n.templateSpans=createNodeArray(t);n.transformFlags|=propagateChildFlags(n.head)|propagateChildrenFlags(n.templateSpans)|1024;return n}function updateTemplateExpression(e,t,n){return e.head!==t||e.templateSpans!==n?update(createTemplateExpression(t,n),e):e}function checkTemplateLiteralLikeNode(e,t,n,r=0){S.assert(!(r&~7176),"Unsupported template flags.");let i=void 0;if(n!==void 0&&n!==t){i=getCookedText(e,n);if(typeof i==="object"){return S.fail("Invalid raw text")}}if(t===void 0){if(i===void 0){return S.fail("Arguments 'text' and 'rawText' may not both be undefined.")}t=i}else if(i!==void 0){S.assert(t===i,"Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.")}return t}function getTransformFlagsOfTemplateLiteralLike(e){let t=1024;if(e){t|=128}return t}function createTemplateLiteralLikeToken(e,t,n,r){const i=createBaseToken(e);i.text=t;i.rawText=n;i.templateFlags=r&7176;i.transformFlags=getTransformFlagsOfTemplateLiteralLike(i.templateFlags);return i}function createTemplateLiteralLikeDeclaration(e,t,n,r){const i=createBaseDeclaration(e);i.text=t;i.rawText=n;i.templateFlags=r&7176;i.transformFlags=getTransformFlagsOfTemplateLiteralLike(i.templateFlags);return i}function createTemplateLiteralLikeNode(e,t,n,r){if(e===15){return createTemplateLiteralLikeDeclaration(e,t,n,r)}return createTemplateLiteralLikeToken(e,t,n,r)}function createTemplateHead(e,t,n){e=checkTemplateLiteralLikeNode(16,e,t,n);return createTemplateLiteralLikeNode(16,e,t,n)}function createTemplateMiddle(e,t,n){e=checkTemplateLiteralLikeNode(16,e,t,n);return createTemplateLiteralLikeNode(17,e,t,n)}function createTemplateTail(e,t,n){e=checkTemplateLiteralLikeNode(16,e,t,n);return createTemplateLiteralLikeNode(18,e,t,n)}function createNoSubstitutionTemplateLiteral(e,t,n){e=checkTemplateLiteralLikeNode(16,e,t,n);return createTemplateLiteralLikeDeclaration(15,e,t,n)}function createYieldExpression(e,t){S.assert(!e||!!t,"A `YieldExpression` with an asteriskToken must have an expression.");const n=createBaseNode(229);n.expression=t&&r().parenthesizeExpressionForDisallowedComma(t);n.asteriskToken=e;n.transformFlags|=propagateChildFlags(n.expression)|propagateChildFlags(n.asteriskToken)|1024|128|1048576;return n}function updateYieldExpression(e,t,n){return e.expression!==n||e.asteriskToken!==t?update(createYieldExpression(t,n),e):e}function createSpreadElement(e){const t=createBaseNode(230);t.expression=r().parenthesizeExpressionForDisallowedComma(e);t.transformFlags|=propagateChildFlags(t.expression)|1024|32768;return t}function updateSpreadElement(e,t){return e.expression!==t?update(createSpreadElement(t),e):e}function createClassExpression(e,t,n,r,i){const o=createBaseDeclaration(231);o.modifiers=asNodeArray(e);o.name=asName(t);o.typeParameters=asNodeArray(n);o.heritageClauses=asNodeArray(r);o.members=createNodeArray(i);o.transformFlags|=propagateChildrenFlags(o.modifiers)|propagateNameFlags(o.name)|propagateChildrenFlags(o.typeParameters)|propagateChildrenFlags(o.heritageClauses)|propagateChildrenFlags(o.members)|(o.typeParameters?1:0)|1024;o.jsDoc=void 0;return o}function updateClassExpression(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.typeParameters!==r||e.heritageClauses!==i||e.members!==o?update(createClassExpression(t,n,r,i,o),e):e}function createOmittedExpression(){return createBaseNode(232)}function createExpressionWithTypeArguments(e,t){const n=createBaseNode(233);n.expression=r().parenthesizeLeftSideOfAccess(e,false);n.typeArguments=t&&r().parenthesizeTypeArguments(t);n.transformFlags|=propagateChildFlags(n.expression)|propagateChildrenFlags(n.typeArguments)|1024;return n}function updateExpressionWithTypeArguments(e,t,n){return e.expression!==t||e.typeArguments!==n?update(createExpressionWithTypeArguments(t,n),e):e}function createAsExpression(e,t){const n=createBaseNode(234);n.expression=e;n.type=t;n.transformFlags|=propagateChildFlags(n.expression)|propagateChildFlags(n.type)|1;return n}function updateAsExpression(e,t,n){return e.expression!==t||e.type!==n?update(createAsExpression(t,n),e):e}function createNonNullExpression(e){const t=createBaseNode(235);t.expression=r().parenthesizeLeftSideOfAccess(e,false);t.transformFlags|=propagateChildFlags(t.expression)|1;return t}function updateNonNullExpression(e,t){if(isNonNullChain(e)){return updateNonNullChain(e,t)}return e.expression!==t?update(createNonNullExpression(t),e):e}function createSatisfiesExpression(e,t){const n=createBaseNode(238);n.expression=e;n.type=t;n.transformFlags|=propagateChildFlags(n.expression)|propagateChildFlags(n.type)|1;return n}function updateSatisfiesExpression(e,t,n){return e.expression!==t||e.type!==n?update(createSatisfiesExpression(t,n),e):e}function createNonNullChain(e){const t=createBaseNode(235);t.flags|=64;t.expression=r().parenthesizeLeftSideOfAccess(e,true);t.transformFlags|=propagateChildFlags(t.expression)|1;return t}function updateNonNullChain(e,t){S.assert(!!(e.flags&64),"Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead.");return e.expression!==t?update(createNonNullChain(t),e):e}function createMetaProperty(e,t){const n=createBaseNode(236);n.keywordToken=e;n.name=t;n.transformFlags|=propagateChildFlags(n.name);switch(e){case 105:n.transformFlags|=1024;break;case 102:n.transformFlags|=32;break;default:return S.assertNever(e)}n.flowNode=void 0;return n}function updateMetaProperty(e,t){return e.name!==t?update(createMetaProperty(e.keywordToken,t),e):e}function createTemplateSpan(e,t){const n=createBaseNode(239);n.expression=e;n.literal=t;n.transformFlags|=propagateChildFlags(n.expression)|propagateChildFlags(n.literal)|1024;return n}function updateTemplateSpan(e,t,n){return e.expression!==t||e.literal!==n?update(createTemplateSpan(t,n),e):e}function createSemicolonClassElement(){const e=createBaseNode(240);e.transformFlags|=1024;return e}function createBlock(e,t){const n=createBaseNode(241);n.statements=createNodeArray(e);n.multiLine=t;n.transformFlags|=propagateChildrenFlags(n.statements);n.jsDoc=void 0;n.locals=void 0;n.nextContainer=void 0;return n}function updateBlock(e,t){return e.statements!==t?update(createBlock(t,e.multiLine),e):e}function createVariableStatement(e,t){const n=createBaseNode(243);n.modifiers=asNodeArray(e);n.declarationList=isArray(t)?createVariableDeclarationList(t):t;n.transformFlags|=propagateChildrenFlags(n.modifiers)|propagateChildFlags(n.declarationList);if(modifiersToFlags(n.modifiers)&128){n.transformFlags=1}n.jsDoc=void 0;n.flowNode=void 0;return n}function updateVariableStatement(e,t,n){return e.modifiers!==t||e.declarationList!==n?update(createVariableStatement(t,n),e):e}function createEmptyStatement(){const e=createBaseNode(242);e.jsDoc=void 0;return e}function createExpressionStatement(e){const t=createBaseNode(244);t.expression=r().parenthesizeExpressionOfExpressionStatement(e);t.transformFlags|=propagateChildFlags(t.expression);t.jsDoc=void 0;t.flowNode=void 0;return t}function updateExpressionStatement(e,t){return e.expression!==t?update(createExpressionStatement(t),e):e}function createIfStatement(e,t,n){const r=createBaseNode(245);r.expression=e;r.thenStatement=asEmbeddedStatement(t);r.elseStatement=asEmbeddedStatement(n);r.transformFlags|=propagateChildFlags(r.expression)|propagateChildFlags(r.thenStatement)|propagateChildFlags(r.elseStatement);r.jsDoc=void 0;r.flowNode=void 0;return r}function updateIfStatement(e,t,n,r){return e.expression!==t||e.thenStatement!==n||e.elseStatement!==r?update(createIfStatement(t,n,r),e):e}function createDoStatement(e,t){const n=createBaseNode(246);n.statement=asEmbeddedStatement(e);n.expression=t;n.transformFlags|=propagateChildFlags(n.statement)|propagateChildFlags(n.expression);n.jsDoc=void 0;n.flowNode=void 0;return n}function updateDoStatement(e,t,n){return e.statement!==t||e.expression!==n?update(createDoStatement(t,n),e):e}function createWhileStatement(e,t){const n=createBaseNode(247);n.expression=e;n.statement=asEmbeddedStatement(t);n.transformFlags|=propagateChildFlags(n.expression)|propagateChildFlags(n.statement);n.jsDoc=void 0;n.flowNode=void 0;return n}function updateWhileStatement(e,t,n){return e.expression!==t||e.statement!==n?update(createWhileStatement(t,n),e):e}function createForStatement(e,t,n,r){const i=createBaseNode(248);i.initializer=e;i.condition=t;i.incrementor=n;i.statement=asEmbeddedStatement(r);i.transformFlags|=propagateChildFlags(i.initializer)|propagateChildFlags(i.condition)|propagateChildFlags(i.incrementor)|propagateChildFlags(i.statement);i.jsDoc=void 0;i.locals=void 0;i.nextContainer=void 0;i.flowNode=void 0;return i}function updateForStatement(e,t,n,r,i){return e.initializer!==t||e.condition!==n||e.incrementor!==r||e.statement!==i?update(createForStatement(t,n,r,i),e):e}function createForInStatement(e,t,n){const r=createBaseNode(249);r.initializer=e;r.expression=t;r.statement=asEmbeddedStatement(n);r.transformFlags|=propagateChildFlags(r.initializer)|propagateChildFlags(r.expression)|propagateChildFlags(r.statement);r.jsDoc=void 0;r.locals=void 0;r.nextContainer=void 0;r.flowNode=void 0;return r}function updateForInStatement(e,t,n,r){return e.initializer!==t||e.expression!==n||e.statement!==r?update(createForInStatement(t,n,r),e):e}function createForOfStatement(e,t,n,i){const o=createBaseNode(250);o.awaitModifier=e;o.initializer=t;o.expression=r().parenthesizeExpressionForDisallowedComma(n);o.statement=asEmbeddedStatement(i);o.transformFlags|=propagateChildFlags(o.awaitModifier)|propagateChildFlags(o.initializer)|propagateChildFlags(o.expression)|propagateChildFlags(o.statement)|1024;if(e)o.transformFlags|=128;o.jsDoc=void 0;o.locals=void 0;o.nextContainer=void 0;o.flowNode=void 0;return o}function updateForOfStatement(e,t,n,r,i){return e.awaitModifier!==t||e.initializer!==n||e.expression!==r||e.statement!==i?update(createForOfStatement(t,n,r,i),e):e}function createContinueStatement(e){const t=createBaseNode(251);t.label=asName(e);t.transformFlags|=propagateChildFlags(t.label)|4194304;t.jsDoc=void 0;t.flowNode=void 0;return t}function updateContinueStatement(e,t){return e.label!==t?update(createContinueStatement(t),e):e}function createBreakStatement(e){const t=createBaseNode(252);t.label=asName(e);t.transformFlags|=propagateChildFlags(t.label)|4194304;t.jsDoc=void 0;t.flowNode=void 0;return t}function updateBreakStatement(e,t){return e.label!==t?update(createBreakStatement(t),e):e}function createReturnStatement(e){const t=createBaseNode(253);t.expression=e;t.transformFlags|=propagateChildFlags(t.expression)|128|4194304;t.jsDoc=void 0;t.flowNode=void 0;return t}function updateReturnStatement(e,t){return e.expression!==t?update(createReturnStatement(t),e):e}function createWithStatement(e,t){const n=createBaseNode(254);n.expression=e;n.statement=asEmbeddedStatement(t);n.transformFlags|=propagateChildFlags(n.expression)|propagateChildFlags(n.statement);n.jsDoc=void 0;n.flowNode=void 0;return n}function updateWithStatement(e,t,n){return e.expression!==t||e.statement!==n?update(createWithStatement(t,n),e):e}function createSwitchStatement(e,t){const n=createBaseNode(255);n.expression=r().parenthesizeExpressionForDisallowedComma(e);n.caseBlock=t;n.transformFlags|=propagateChildFlags(n.expression)|propagateChildFlags(n.caseBlock);n.jsDoc=void 0;n.flowNode=void 0;n.possiblyExhaustive=false;return n}function updateSwitchStatement(e,t,n){return e.expression!==t||e.caseBlock!==n?update(createSwitchStatement(t,n),e):e}function createLabeledStatement(e,t){const n=createBaseNode(256);n.label=asName(e);n.statement=asEmbeddedStatement(t);n.transformFlags|=propagateChildFlags(n.label)|propagateChildFlags(n.statement);n.jsDoc=void 0;n.flowNode=void 0;return n}function updateLabeledStatement(e,t,n){return e.label!==t||e.statement!==n?update(createLabeledStatement(t,n),e):e}function createThrowStatement(e){const t=createBaseNode(257);t.expression=e;t.transformFlags|=propagateChildFlags(t.expression);t.jsDoc=void 0;t.flowNode=void 0;return t}function updateThrowStatement(e,t){return e.expression!==t?update(createThrowStatement(t),e):e}function createTryStatement(e,t,n){const r=createBaseNode(258);r.tryBlock=e;r.catchClause=t;r.finallyBlock=n;r.transformFlags|=propagateChildFlags(r.tryBlock)|propagateChildFlags(r.catchClause)|propagateChildFlags(r.finallyBlock);r.jsDoc=void 0;r.flowNode=void 0;return r}function updateTryStatement(e,t,n,r){return e.tryBlock!==t||e.catchClause!==n||e.finallyBlock!==r?update(createTryStatement(t,n,r),e):e}function createDebuggerStatement(){const e=createBaseNode(259);e.jsDoc=void 0;e.flowNode=void 0;return e}function createVariableDeclaration(e,t,n,r){const i=createBaseDeclaration(260);i.name=asName(e);i.exclamationToken=t;i.type=n;i.initializer=asInitializer(r);i.transformFlags|=propagateNameFlags(i.name)|propagateChildFlags(i.initializer)|(i.exclamationToken??i.type?1:0);i.jsDoc=void 0;return i}function updateVariableDeclaration(e,t,n,r,i){return e.name!==t||e.type!==r||e.exclamationToken!==n||e.initializer!==i?update(createVariableDeclaration(t,n,r,i),e):e}function createVariableDeclarationList(e,t=0){const n=createBaseNode(261);n.flags|=t&7;n.declarations=createNodeArray(e);n.transformFlags|=propagateChildrenFlags(n.declarations)|4194304;if(t&7){n.transformFlags|=1024|262144}if(t&4){n.transformFlags|=4}return n}function updateVariableDeclarationList(e,t){return e.declarations!==t?update(createVariableDeclarationList(t,e.flags),e):e}function createFunctionDeclaration(e,t,n,r,i,o,a){const s=createBaseDeclaration(262);s.modifiers=asNodeArray(e);s.asteriskToken=t;s.name=asName(n);s.typeParameters=asNodeArray(r);s.parameters=createNodeArray(i);s.type=o;s.body=a;if(!s.body||modifiersToFlags(s.modifiers)&128){s.transformFlags=1}else{const e=modifiersToFlags(s.modifiers)&1024;const t=!!s.asteriskToken;const n=e&&t;s.transformFlags=propagateChildrenFlags(s.modifiers)|propagateChildFlags(s.asteriskToken)|propagateNameFlags(s.name)|propagateChildrenFlags(s.typeParameters)|propagateChildrenFlags(s.parameters)|propagateChildFlags(s.type)|propagateChildFlags(s.body)&~67108864|(n?128:e?256:t?2048:0)|(s.typeParameters||s.type?1:0)|4194304}s.typeArguments=void 0;s.jsDoc=void 0;s.locals=void 0;s.nextContainer=void 0;s.endFlowNode=void 0;s.returnFlowNode=void 0;return s}function updateFunctionDeclaration(e,t,n,r,i,o,a,s){return e.modifiers!==t||e.asteriskToken!==n||e.name!==r||e.typeParameters!==i||e.parameters!==o||e.type!==a||e.body!==s?finishUpdateFunctionDeclaration(createFunctionDeclaration(t,n,r,i,o,a,s),e):e}function finishUpdateFunctionDeclaration(e,t){if(e!==t){if(e.modifiers===t.modifiers){e.modifiers=t.modifiers}}return finishUpdateBaseSignatureDeclaration(e,t)}function createClassDeclaration(e,t,n,r,i){const o=createBaseDeclaration(263);o.modifiers=asNodeArray(e);o.name=asName(t);o.typeParameters=asNodeArray(n);o.heritageClauses=asNodeArray(r);o.members=createNodeArray(i);if(modifiersToFlags(o.modifiers)&128){o.transformFlags=1}else{o.transformFlags|=propagateChildrenFlags(o.modifiers)|propagateNameFlags(o.name)|propagateChildrenFlags(o.typeParameters)|propagateChildrenFlags(o.heritageClauses)|propagateChildrenFlags(o.members)|(o.typeParameters?1:0)|1024;if(o.transformFlags&8192){o.transformFlags|=1}}o.jsDoc=void 0;return o}function updateClassDeclaration(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.typeParameters!==r||e.heritageClauses!==i||e.members!==o?update(createClassDeclaration(t,n,r,i,o),e):e}function createInterfaceDeclaration(e,t,n,r,i){const o=createBaseDeclaration(264);o.modifiers=asNodeArray(e);o.name=asName(t);o.typeParameters=asNodeArray(n);o.heritageClauses=asNodeArray(r);o.members=createNodeArray(i);o.transformFlags=1;o.jsDoc=void 0;return o}function updateInterfaceDeclaration(e,t,n,r,i,o){return e.modifiers!==t||e.name!==n||e.typeParameters!==r||e.heritageClauses!==i||e.members!==o?update(createInterfaceDeclaration(t,n,r,i,o),e):e}function createTypeAliasDeclaration(e,t,n,r){const i=createBaseDeclaration(265);i.modifiers=asNodeArray(e);i.name=asName(t);i.typeParameters=asNodeArray(n);i.type=r;i.transformFlags=1;i.jsDoc=void 0;i.locals=void 0;i.nextContainer=void 0;return i}function updateTypeAliasDeclaration(e,t,n,r,i){return e.modifiers!==t||e.name!==n||e.typeParameters!==r||e.type!==i?update(createTypeAliasDeclaration(t,n,r,i),e):e}function createEnumDeclaration(e,t,n){const r=createBaseDeclaration(266);r.modifiers=asNodeArray(e);r.name=asName(t);r.members=createNodeArray(n);r.transformFlags|=propagateChildrenFlags(r.modifiers)|propagateChildFlags(r.name)|propagateChildrenFlags(r.members)|1;r.transformFlags&=~67108864;r.jsDoc=void 0;return r}function updateEnumDeclaration(e,t,n,r){return e.modifiers!==t||e.name!==n||e.members!==r?update(createEnumDeclaration(t,n,r),e):e}function createModuleDeclaration(e,t,n,r=0){const i=createBaseDeclaration(267);i.modifiers=asNodeArray(e);i.flags|=r&(32|8|2048);i.name=t;i.body=n;if(modifiersToFlags(i.modifiers)&128){i.transformFlags=1}else{i.transformFlags|=propagateChildrenFlags(i.modifiers)|propagateChildFlags(i.name)|propagateChildFlags(i.body)|1}i.transformFlags&=~67108864;i.jsDoc=void 0;i.locals=void 0;i.nextContainer=void 0;return i}function updateModuleDeclaration(e,t,n,r){return e.modifiers!==t||e.name!==n||e.body!==r?update(createModuleDeclaration(t,n,r,e.flags),e):e}function createModuleBlock(e){const t=createBaseNode(268);t.statements=createNodeArray(e);t.transformFlags|=propagateChildrenFlags(t.statements);t.jsDoc=void 0;return t}function updateModuleBlock(e,t){return e.statements!==t?update(createModuleBlock(t),e):e}function createCaseBlock(e){const t=createBaseNode(269);t.clauses=createNodeArray(e);t.transformFlags|=propagateChildrenFlags(t.clauses);t.locals=void 0;t.nextContainer=void 0;return t}function updateCaseBlock(e,t){return e.clauses!==t?update(createCaseBlock(t),e):e}function createNamespaceExportDeclaration(e){const t=createBaseDeclaration(270);t.name=asName(e);t.transformFlags|=propagateIdentifierNameFlags(t.name)|1;t.modifiers=void 0;t.jsDoc=void 0;return t}function updateNamespaceExportDeclaration(e,t){return e.name!==t?finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration(t),e):e}function finishUpdateNamespaceExportDeclaration(e,t){if(e!==t){e.modifiers=t.modifiers}return update(e,t)}function createImportEqualsDeclaration(e,t,n,r){const i=createBaseDeclaration(271);i.modifiers=asNodeArray(e);i.name=asName(n);i.isTypeOnly=t;i.moduleReference=r;i.transformFlags|=propagateChildrenFlags(i.modifiers)|propagateIdentifierNameFlags(i.name)|propagateChildFlags(i.moduleReference);if(!isExternalModuleReference(i.moduleReference)){i.transformFlags|=1}i.transformFlags&=~67108864;i.jsDoc=void 0;return i}function updateImportEqualsDeclaration(e,t,n,r,i){return e.modifiers!==t||e.isTypeOnly!==n||e.name!==r||e.moduleReference!==i?update(createImportEqualsDeclaration(t,n,r,i),e):e}function createImportDeclaration(e,t,n,r){const i=createBaseNode(272);i.modifiers=asNodeArray(e);i.importClause=t;i.moduleSpecifier=n;i.attributes=i.assertClause=r;i.transformFlags|=propagateChildFlags(i.importClause)|propagateChildFlags(i.moduleSpecifier);i.transformFlags&=~67108864;i.jsDoc=void 0;return i}function updateImportDeclaration(e,t,n,r,i){return e.modifiers!==t||e.importClause!==n||e.moduleSpecifier!==r||e.attributes!==i?update(createImportDeclaration(t,n,r,i),e):e}function createImportClause2(e,t,n){const r=createBaseDeclaration(273);r.isTypeOnly=e;r.name=t;r.namedBindings=n;r.transformFlags|=propagateChildFlags(r.name)|propagateChildFlags(r.namedBindings);if(e){r.transformFlags|=1}r.transformFlags&=~67108864;return r}function updateImportClause(e,t,n,r){return e.isTypeOnly!==t||e.name!==n||e.namedBindings!==r?update(createImportClause2(t,n,r),e):e}function createAssertClause(e,t){const n=createBaseNode(300);n.elements=createNodeArray(e);n.multiLine=t;n.token=132;n.transformFlags|=4;return n}function updateAssertClause(e,t,n){return e.elements!==t||e.multiLine!==n?update(createAssertClause(t,n),e):e}function createAssertEntry(e,t){const n=createBaseNode(301);n.name=e;n.value=t;n.transformFlags|=4;return n}function updateAssertEntry(e,t,n){return e.name!==t||e.value!==n?update(createAssertEntry(t,n),e):e}function createImportTypeAssertionContainer(e,t){const n=createBaseNode(302);n.assertClause=e;n.multiLine=t;return n}function updateImportTypeAssertionContainer(e,t,n){return e.assertClause!==t||e.multiLine!==n?update(createImportTypeAssertionContainer(t,n),e):e}function createImportAttributes(e,t,n){const r=createBaseNode(300);r.token=n??118;r.elements=createNodeArray(e);r.multiLine=t;r.transformFlags|=4;return r}function updateImportAttributes(e,t,n){return e.elements!==t||e.multiLine!==n?update(createImportAttributes(t,n,e.token),e):e}function createImportAttribute(e,t){const n=createBaseNode(301);n.name=e;n.value=t;n.transformFlags|=4;return n}function updateImportAttribute(e,t,n){return e.name!==t||e.value!==n?update(createImportAttribute(t,n),e):e}function createNamespaceImport(e){const t=createBaseDeclaration(274);t.name=e;t.transformFlags|=propagateChildFlags(t.name);t.transformFlags&=~67108864;return t}function updateNamespaceImport(e,t){return e.name!==t?update(createNamespaceImport(t),e):e}function createNamespaceExport(e){const t=createBaseDeclaration(280);t.name=e;t.transformFlags|=propagateChildFlags(t.name)|32;t.transformFlags&=~67108864;return t}function updateNamespaceExport(e,t){return e.name!==t?update(createNamespaceExport(t),e):e}function createNamedImports(e){const t=createBaseNode(275);t.elements=createNodeArray(e);t.transformFlags|=propagateChildrenFlags(t.elements);t.transformFlags&=~67108864;return t}function updateNamedImports(e,t){return e.elements!==t?update(createNamedImports(t),e):e}function createImportSpecifier(e,t,n){const r=createBaseDeclaration(276);r.isTypeOnly=e;r.propertyName=t;r.name=n;r.transformFlags|=propagateChildFlags(r.propertyName)|propagateChildFlags(r.name);r.transformFlags&=~67108864;return r}function updateImportSpecifier(e,t,n,r){return e.isTypeOnly!==t||e.propertyName!==n||e.name!==r?update(createImportSpecifier(t,n,r),e):e}function createExportAssignment2(e,t,n){const i=createBaseDeclaration(277);i.modifiers=asNodeArray(e);i.isExportEquals=t;i.expression=t?r().parenthesizeRightSideOfBinary(64,void 0,n):r().parenthesizeExpressionOfExportDefault(n);i.transformFlags|=propagateChildrenFlags(i.modifiers)|propagateChildFlags(i.expression);i.transformFlags&=~67108864;i.jsDoc=void 0;return i}function updateExportAssignment(e,t,n){return e.modifiers!==t||e.expression!==n?update(createExportAssignment2(t,e.isExportEquals,n),e):e}function createExportDeclaration(e,t,n,r,i){const o=createBaseDeclaration(278);o.modifiers=asNodeArray(e);o.isTypeOnly=t;o.exportClause=n;o.moduleSpecifier=r;o.attributes=o.assertClause=i;o.transformFlags|=propagateChildrenFlags(o.modifiers)|propagateChildFlags(o.exportClause)|propagateChildFlags(o.moduleSpecifier);o.transformFlags&=~67108864;o.jsDoc=void 0;return o}function updateExportDeclaration(e,t,n,r,i,o){return e.modifiers!==t||e.isTypeOnly!==n||e.exportClause!==r||e.moduleSpecifier!==i||e.attributes!==o?finishUpdateExportDeclaration(createExportDeclaration(t,n,r,i,o),e):e}function finishUpdateExportDeclaration(e,t){if(e!==t){if(e.modifiers===t.modifiers){e.modifiers=t.modifiers}}return update(e,t)}function createNamedExports(e){const t=createBaseNode(279);t.elements=createNodeArray(e);t.transformFlags|=propagateChildrenFlags(t.elements);t.transformFlags&=~67108864;return t}function updateNamedExports(e,t){return e.elements!==t?update(createNamedExports(t),e):e}function createExportSpecifier(e,t,n){const r=createBaseNode(281);r.isTypeOnly=e;r.propertyName=asName(t);r.name=asName(n);r.transformFlags|=propagateChildFlags(r.propertyName)|propagateChildFlags(r.name);r.transformFlags&=~67108864;r.jsDoc=void 0;return r}function updateExportSpecifier(e,t,n,r){return e.isTypeOnly!==t||e.propertyName!==n||e.name!==r?update(createExportSpecifier(t,n,r),e):e}function createMissingDeclaration(){const e=createBaseDeclaration(282);e.jsDoc=void 0;return e}function createExternalModuleReference(e){const t=createBaseNode(283);t.expression=e;t.transformFlags|=propagateChildFlags(t.expression);t.transformFlags&=~67108864;return t}function updateExternalModuleReference(e,t){return e.expression!==t?update(createExternalModuleReference(t),e):e}function createJSDocPrimaryTypeWorker(e){return createBaseNode(e)}function createJSDocPrePostfixUnaryTypeWorker(e,t,n=false){const i=createJSDocUnaryTypeWorker(e,n?t&&r().parenthesizeNonArrayTypeOfPostfixType(t):t);i.postfix=n;return i}function createJSDocUnaryTypeWorker(e,t){const n=createBaseNode(e);n.type=t;return n}function updateJSDocPrePostfixUnaryTypeWorker(e,t,n){return t.type!==n?update(createJSDocPrePostfixUnaryTypeWorker(e,n,t.postfix),t):t}function updateJSDocUnaryTypeWorker(e,t,n){return t.type!==n?update(createJSDocUnaryTypeWorker(e,n),t):t}function createJSDocFunctionType(e,t){const n=createBaseDeclaration(317);n.parameters=asNodeArray(e);n.type=t;n.transformFlags=propagateChildrenFlags(n.parameters)|(n.type?1:0);n.jsDoc=void 0;n.locals=void 0;n.nextContainer=void 0;n.typeArguments=void 0;return n}function updateJSDocFunctionType(e,t,n){return e.parameters!==t||e.type!==n?update(createJSDocFunctionType(t,n),e):e}function createJSDocTypeLiteral(e,t=false){const n=createBaseDeclaration(322);n.jsDocPropertyTags=asNodeArray(e);n.isArrayType=t;return n}function updateJSDocTypeLiteral(e,t,n){return e.jsDocPropertyTags!==t||e.isArrayType!==n?update(createJSDocTypeLiteral(t,n),e):e}function createJSDocTypeExpression(e){const t=createBaseNode(309);t.type=e;return t}function updateJSDocTypeExpression(e,t){return e.type!==t?update(createJSDocTypeExpression(t),e):e}function createJSDocSignature(e,t,n){const r=createBaseDeclaration(323);r.typeParameters=asNodeArray(e);r.parameters=createNodeArray(t);r.type=n;r.jsDoc=void 0;r.locals=void 0;r.nextContainer=void 0;return r}function updateJSDocSignature(e,t,n,r){return e.typeParameters!==t||e.parameters!==n||e.type!==r?update(createJSDocSignature(t,n,r),e):e}function getDefaultTagName(e){const t=getDefaultTagNameForKind(e.kind);return e.tagName.escapedText===escapeLeadingUnderscores(t)?e.tagName:createIdentifier(t)}function createBaseJSDocTag(e,t,n){const r=createBaseNode(e);r.tagName=t;r.comment=n;return r}function createBaseJSDocTagDeclaration(e,t,n){const r=createBaseDeclaration(e);r.tagName=t;r.comment=n;return r}function createJSDocTemplateTag(e,t,n,r){const i=createBaseJSDocTag(345,e??createIdentifier("template"),r);i.constraint=t;i.typeParameters=createNodeArray(n);return i}function updateJSDocTemplateTag(e,t=getDefaultTagName(e),n,r,i){return e.tagName!==t||e.constraint!==n||e.typeParameters!==r||e.comment!==i?update(createJSDocTemplateTag(t,n,r,i),e):e}function createJSDocTypedefTag(e,t,n,r){const i=createBaseJSDocTagDeclaration(346,e??createIdentifier("typedef"),r);i.typeExpression=t;i.fullName=n;i.name=getJSDocTypeAliasName(n);i.locals=void 0;i.nextContainer=void 0;return i}function updateJSDocTypedefTag(e,t=getDefaultTagName(e),n,r,i){return e.tagName!==t||e.typeExpression!==n||e.fullName!==r||e.comment!==i?update(createJSDocTypedefTag(t,n,r,i),e):e}function createJSDocParameterTag(e,t,n,r,i,o){const a=createBaseJSDocTagDeclaration(341,e??createIdentifier("param"),o);a.typeExpression=r;a.name=t;a.isNameFirst=!!i;a.isBracketed=n;return a}function updateJSDocParameterTag(e,t=getDefaultTagName(e),n,r,i,o,a){return e.tagName!==t||e.name!==n||e.isBracketed!==r||e.typeExpression!==i||e.isNameFirst!==o||e.comment!==a?update(createJSDocParameterTag(t,n,r,i,o,a),e):e}function createJSDocPropertyTag(e,t,n,r,i,o){const a=createBaseJSDocTagDeclaration(348,e??createIdentifier("prop"),o);a.typeExpression=r;a.name=t;a.isNameFirst=!!i;a.isBracketed=n;return a}function updateJSDocPropertyTag(e,t=getDefaultTagName(e),n,r,i,o,a){return e.tagName!==t||e.name!==n||e.isBracketed!==r||e.typeExpression!==i||e.isNameFirst!==o||e.comment!==a?update(createJSDocPropertyTag(t,n,r,i,o,a),e):e}function createJSDocCallbackTag(e,t,n,r){const i=createBaseJSDocTagDeclaration(338,e??createIdentifier("callback"),r);i.typeExpression=t;i.fullName=n;i.name=getJSDocTypeAliasName(n);i.locals=void 0;i.nextContainer=void 0;return i}function updateJSDocCallbackTag(e,t=getDefaultTagName(e),n,r,i){return e.tagName!==t||e.typeExpression!==n||e.fullName!==r||e.comment!==i?update(createJSDocCallbackTag(t,n,r,i),e):e}function createJSDocOverloadTag(e,t,n){const r=createBaseJSDocTag(339,e??createIdentifier("overload"),n);r.typeExpression=t;return r}function updateJSDocOverloadTag(e,t=getDefaultTagName(e),n,r){return e.tagName!==t||e.typeExpression!==n||e.comment!==r?update(createJSDocOverloadTag(t,n,r),e):e}function createJSDocAugmentsTag(e,t,n){const r=createBaseJSDocTag(328,e??createIdentifier("augments"),n);r.class=t;return r}function updateJSDocAugmentsTag(e,t=getDefaultTagName(e),n,r){return e.tagName!==t||e.class!==n||e.comment!==r?update(createJSDocAugmentsTag(t,n,r),e):e}function createJSDocImplementsTag(e,t,n){const r=createBaseJSDocTag(329,e??createIdentifier("implements"),n);r.class=t;return r}function createJSDocSeeTag(e,t,n){const r=createBaseJSDocTag(347,e??createIdentifier("see"),n);r.name=t;return r}function updateJSDocSeeTag(e,t,n,r){return e.tagName!==t||e.name!==n||e.comment!==r?update(createJSDocSeeTag(t,n,r),e):e}function createJSDocNameReference(e){const t=createBaseNode(310);t.name=e;return t}function updateJSDocNameReference(e,t){return e.name!==t?update(createJSDocNameReference(t),e):e}function createJSDocMemberName(e,t){const n=createBaseNode(311);n.left=e;n.right=t;n.transformFlags|=propagateChildFlags(n.left)|propagateChildFlags(n.right);return n}function updateJSDocMemberName(e,t,n){return e.left!==t||e.right!==n?update(createJSDocMemberName(t,n),e):e}function createJSDocLink(e,t){const n=createBaseNode(324);n.name=e;n.text=t;return n}function updateJSDocLink(e,t,n){return e.name!==t?update(createJSDocLink(t,n),e):e}function createJSDocLinkCode(e,t){const n=createBaseNode(325);n.name=e;n.text=t;return n}function updateJSDocLinkCode(e,t,n){return e.name!==t?update(createJSDocLinkCode(t,n),e):e}function createJSDocLinkPlain(e,t){const n=createBaseNode(326);n.name=e;n.text=t;return n}function updateJSDocLinkPlain(e,t,n){return e.name!==t?update(createJSDocLinkPlain(t,n),e):e}function updateJSDocImplementsTag(e,t=getDefaultTagName(e),n,r){return e.tagName!==t||e.class!==n||e.comment!==r?update(createJSDocImplementsTag(t,n,r),e):e}function createJSDocSimpleTagWorker(e,t,n){const r=createBaseJSDocTag(e,t??createIdentifier(getDefaultTagNameForKind(e)),n);return r}function updateJSDocSimpleTagWorker(e,t,n=getDefaultTagName(t),r){return t.tagName!==n||t.comment!==r?update(createJSDocSimpleTagWorker(e,n,r),t):t}function createJSDocTypeLikeTagWorker(e,t,n,r){const i=createBaseJSDocTag(e,t??createIdentifier(getDefaultTagNameForKind(e)),r);i.typeExpression=n;return i}function updateJSDocTypeLikeTagWorker(e,t,n=getDefaultTagName(t),r,i){return t.tagName!==n||t.typeExpression!==r||t.comment!==i?update(createJSDocTypeLikeTagWorker(e,n,r,i),t):t}function createJSDocUnknownTag(e,t){const n=createBaseJSDocTag(327,e,t);return n}function updateJSDocUnknownTag(e,t,n){return e.tagName!==t||e.comment!==n?update(createJSDocUnknownTag(t,n),e):e}function createJSDocEnumTag(e,t,n){const r=createBaseJSDocTagDeclaration(340,e??createIdentifier(getDefaultTagNameForKind(340)),n);r.typeExpression=t;r.locals=void 0;r.nextContainer=void 0;return r}function updateJSDocEnumTag(e,t=getDefaultTagName(e),n,r){return e.tagName!==t||e.typeExpression!==n||e.comment!==r?update(createJSDocEnumTag(t,n,r),e):e}function createJSDocImportTag(e,t,n,r,i){const o=createBaseJSDocTag(351,e??createIdentifier("import"),i);o.importClause=t;o.moduleSpecifier=n;o.attributes=r;o.comment=i;return o}function updateJSDocImportTag(e,t,n,r,i,o){return e.tagName!==t||e.comment!==o||e.importClause!==n||e.moduleSpecifier!==r||e.attributes!==i?update(createJSDocImportTag(t,n,r,i,o),e):e}function createJSDocText(e){const t=createBaseNode(321);t.text=e;return t}function updateJSDocText(e,t){return e.text!==t?update(createJSDocText(t),e):e}function createJSDocComment(e,t){const n=createBaseNode(320);n.comment=e;n.tags=asNodeArray(t);return n}function updateJSDocComment(e,t,n){return e.comment!==t||e.tags!==n?update(createJSDocComment(t,n),e):e}function createJsxElement(e,t,n){const r=createBaseNode(284);r.openingElement=e;r.children=createNodeArray(t);r.closingElement=n;r.transformFlags|=propagateChildFlags(r.openingElement)|propagateChildrenFlags(r.children)|propagateChildFlags(r.closingElement)|2;return r}function updateJsxElement(e,t,n,r){return e.openingElement!==t||e.children!==n||e.closingElement!==r?update(createJsxElement(t,n,r),e):e}function createJsxSelfClosingElement(e,t,n){const r=createBaseNode(285);r.tagName=e;r.typeArguments=asNodeArray(t);r.attributes=n;r.transformFlags|=propagateChildFlags(r.tagName)|propagateChildrenFlags(r.typeArguments)|propagateChildFlags(r.attributes)|2;if(r.typeArguments){r.transformFlags|=1}return r}function updateJsxSelfClosingElement(e,t,n,r){return e.tagName!==t||e.typeArguments!==n||e.attributes!==r?update(createJsxSelfClosingElement(t,n,r),e):e}function createJsxOpeningElement(e,t,n){const r=createBaseNode(286);r.tagName=e;r.typeArguments=asNodeArray(t);r.attributes=n;r.transformFlags|=propagateChildFlags(r.tagName)|propagateChildrenFlags(r.typeArguments)|propagateChildFlags(r.attributes)|2;if(t){r.transformFlags|=1}return r}function updateJsxOpeningElement(e,t,n,r){return e.tagName!==t||e.typeArguments!==n||e.attributes!==r?update(createJsxOpeningElement(t,n,r),e):e}function createJsxClosingElement(e){const t=createBaseNode(287);t.tagName=e;t.transformFlags|=propagateChildFlags(t.tagName)|2;return t}function updateJsxClosingElement(e,t){return e.tagName!==t?update(createJsxClosingElement(t),e):e}function createJsxFragment(e,t,n){const r=createBaseNode(288);r.openingFragment=e;r.children=createNodeArray(t);r.closingFragment=n;r.transformFlags|=propagateChildFlags(r.openingFragment)|propagateChildrenFlags(r.children)|propagateChildFlags(r.closingFragment)|2;return r}function updateJsxFragment(e,t,n,r){return e.openingFragment!==t||e.children!==n||e.closingFragment!==r?update(createJsxFragment(t,n,r),e):e}function createJsxText(e,t){const n=createBaseNode(12);n.text=e;n.containsOnlyTriviaWhiteSpaces=!!t;n.transformFlags|=2;return n}function updateJsxText(e,t,n){return e.text!==t||e.containsOnlyTriviaWhiteSpaces!==n?update(createJsxText(t,n),e):e}function createJsxOpeningFragment(){const e=createBaseNode(289);e.transformFlags|=2;return e}function createJsxJsxClosingFragment(){const e=createBaseNode(290);e.transformFlags|=2;return e}function createJsxAttribute(e,t){const n=createBaseDeclaration(291);n.name=e;n.initializer=t;n.transformFlags|=propagateChildFlags(n.name)|propagateChildFlags(n.initializer)|2;return n}function updateJsxAttribute(e,t,n){return e.name!==t||e.initializer!==n?update(createJsxAttribute(t,n),e):e}function createJsxAttributes(e){const t=createBaseDeclaration(292);t.properties=createNodeArray(e);t.transformFlags|=propagateChildrenFlags(t.properties)|2;return t}function updateJsxAttributes(e,t){return e.properties!==t?update(createJsxAttributes(t),e):e}function createJsxSpreadAttribute(e){const t=createBaseNode(293);t.expression=e;t.transformFlags|=propagateChildFlags(t.expression)|2;return t}function updateJsxSpreadAttribute(e,t){return e.expression!==t?update(createJsxSpreadAttribute(t),e):e}function createJsxExpression(e,t){const n=createBaseNode(294);n.dotDotDotToken=e;n.expression=t;n.transformFlags|=propagateChildFlags(n.dotDotDotToken)|propagateChildFlags(n.expression)|2;return n}function updateJsxExpression(e,t){return e.expression!==t?update(createJsxExpression(e.dotDotDotToken,t),e):e}function createJsxNamespacedName(e,t){const n=createBaseNode(295);n.namespace=e;n.name=t;n.transformFlags|=propagateChildFlags(n.namespace)|propagateChildFlags(n.name)|2;return n}function updateJsxNamespacedName(e,t,n){return e.namespace!==t||e.name!==n?update(createJsxNamespacedName(t,n),e):e}function createCaseClause(e,t){const n=createBaseNode(296);n.expression=r().parenthesizeExpressionForDisallowedComma(e);n.statements=createNodeArray(t);n.transformFlags|=propagateChildFlags(n.expression)|propagateChildrenFlags(n.statements);n.jsDoc=void 0;return n}function updateCaseClause(e,t,n){return e.expression!==t||e.statements!==n?update(createCaseClause(t,n),e):e}function createDefaultClause(e){const t=createBaseNode(297);t.statements=createNodeArray(e);t.transformFlags=propagateChildrenFlags(t.statements);return t}function updateDefaultClause(e,t){return e.statements!==t?update(createDefaultClause(t),e):e}function createHeritageClause(e,t){const n=createBaseNode(298);n.token=e;n.types=createNodeArray(t);n.transformFlags|=propagateChildrenFlags(n.types);switch(e){case 96:n.transformFlags|=1024;break;case 119:n.transformFlags|=1;break;default:return S.assertNever(e)}return n}function updateHeritageClause(e,t){return e.types!==t?update(createHeritageClause(e.token,t),e):e}function createCatchClause(e,t){const n=createBaseNode(299);n.variableDeclaration=asVariableDeclaration(e);n.block=t;n.transformFlags|=propagateChildFlags(n.variableDeclaration)|propagateChildFlags(n.block)|(!e?64:0);n.locals=void 0;n.nextContainer=void 0;return n}function updateCatchClause(e,t,n){return e.variableDeclaration!==t||e.block!==n?update(createCatchClause(t,n),e):e}function createPropertyAssignment(e,t){const n=createBaseDeclaration(303);n.name=asName(e);n.initializer=r().parenthesizeExpressionForDisallowedComma(t);n.transformFlags|=propagateNameFlags(n.name)|propagateChildFlags(n.initializer);n.modifiers=void 0;n.questionToken=void 0;n.exclamationToken=void 0;n.jsDoc=void 0;return n}function updatePropertyAssignment(e,t,n){return e.name!==t||e.initializer!==n?finishUpdatePropertyAssignment(createPropertyAssignment(t,n),e):e}function finishUpdatePropertyAssignment(e,t){if(e!==t){e.modifiers=t.modifiers;e.questionToken=t.questionToken;e.exclamationToken=t.exclamationToken}return update(e,t)}function createShorthandPropertyAssignment(e,t){const n=createBaseDeclaration(304);n.name=asName(e);n.objectAssignmentInitializer=t&&r().parenthesizeExpressionForDisallowedComma(t);n.transformFlags|=propagateIdentifierNameFlags(n.name)|propagateChildFlags(n.objectAssignmentInitializer)|1024;n.equalsToken=void 0;n.modifiers=void 0;n.questionToken=void 0;n.exclamationToken=void 0;n.jsDoc=void 0;return n}function updateShorthandPropertyAssignment(e,t,n){return e.name!==t||e.objectAssignmentInitializer!==n?finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment(t,n),e):e}function finishUpdateShorthandPropertyAssignment(e,t){if(e!==t){e.modifiers=t.modifiers;e.questionToken=t.questionToken;e.exclamationToken=t.exclamationToken;e.equalsToken=t.equalsToken}return update(e,t)}function createSpreadAssignment(e){const t=createBaseDeclaration(305);t.expression=r().parenthesizeExpressionForDisallowedComma(e);t.transformFlags|=propagateChildFlags(t.expression)|128|65536;t.jsDoc=void 0;return t}function updateSpreadAssignment(e,t){return e.expression!==t?update(createSpreadAssignment(t),e):e}function createEnumMember(e,t){const n=createBaseDeclaration(306);n.name=asName(e);n.initializer=t&&r().parenthesizeExpressionForDisallowedComma(t);n.transformFlags|=propagateChildFlags(n.name)|propagateChildFlags(n.initializer)|1;n.jsDoc=void 0;return n}function updateEnumMember(e,t,n){return e.name!==t||e.initializer!==n?update(createEnumMember(t,n),e):e}function createSourceFile2(e,n,r){const i=t.createBaseSourceFileNode(307);i.statements=createNodeArray(e);i.endOfFileToken=n;i.flags|=r;i.text="";i.fileName="";i.path="";i.resolvedPath="";i.originalFileName="";i.languageVersion=1;i.languageVariant=0;i.scriptKind=0;i.isDeclarationFile=false;i.hasNoDefaultLib=false;i.transformFlags|=propagateChildrenFlags(i.statements)|propagateChildFlags(i.endOfFileToken);i.locals=void 0;i.nextContainer=void 0;i.endFlowNode=void 0;i.nodeCount=0;i.identifierCount=0;i.symbolCount=0;i.parseDiagnostics=void 0;i.bindDiagnostics=void 0;i.bindSuggestionDiagnostics=void 0;i.lineMap=void 0;i.externalModuleIndicator=void 0;i.setExternalModuleIndicator=void 0;i.pragmas=void 0;i.checkJsDirective=void 0;i.referencedFiles=void 0;i.typeReferenceDirectives=void 0;i.libReferenceDirectives=void 0;i.amdDependencies=void 0;i.commentDirectives=void 0;i.identifiers=void 0;i.packageJsonLocations=void 0;i.packageJsonScope=void 0;i.imports=void 0;i.moduleAugmentations=void 0;i.ambientModuleNames=void 0;i.classifiableNames=void 0;i.impliedNodeFormat=void 0;return i}function createRedirectedSourceFile(e){const t=Object.create(e.redirectTarget);Object.defineProperties(t,{id:{get(){return this.redirectInfo.redirectTarget.id},set(e){this.redirectInfo.redirectTarget.id=e}},symbol:{get(){return this.redirectInfo.redirectTarget.symbol},set(e){this.redirectInfo.redirectTarget.symbol=e}}});t.redirectInfo=e;return t}function cloneRedirectedSourceFile(e){const t=createRedirectedSourceFile(e.redirectInfo);t.flags|=e.flags&~16;t.fileName=e.fileName;t.path=e.path;t.resolvedPath=e.resolvedPath;t.originalFileName=e.originalFileName;t.packageJsonLocations=e.packageJsonLocations;t.packageJsonScope=e.packageJsonScope;t.emitNode=void 0;return t}function cloneSourceFileWorker(e){const n=t.createBaseSourceFileNode(307);n.flags|=e.flags&~16;for(const t in e){if(hasProperty(n,t)||!hasProperty(e,t)){continue}if(t==="emitNode"){n.emitNode=void 0;continue}n[t]=e[t]}return n}function cloneSourceFile(e){const t=e.redirectInfo?cloneRedirectedSourceFile(e):cloneSourceFileWorker(e);n(t,e);return t}function cloneSourceFileWithChanges(e,t,n,r,i,o,a){const s=cloneSourceFile(e);s.statements=createNodeArray(t);s.isDeclarationFile=n;s.referencedFiles=r;s.typeReferenceDirectives=i;s.hasNoDefaultLib=o;s.libReferenceDirectives=a;s.transformFlags=propagateChildrenFlags(s.statements)|propagateChildFlags(s.endOfFileToken);return s}function updateSourceFile2(e,t,n=e.isDeclarationFile,r=e.referencedFiles,i=e.typeReferenceDirectives,o=e.hasNoDefaultLib,a=e.libReferenceDirectives){return e.statements!==t||e.isDeclarationFile!==n||e.referencedFiles!==r||e.typeReferenceDirectives!==i||e.hasNoDefaultLib!==o||e.libReferenceDirectives!==a?update(cloneSourceFileWithChanges(e,t,n,r,i,o,a),e):e}function createBundle(e){const t=createBaseNode(308);t.sourceFiles=e;t.syntheticFileReferences=void 0;t.syntheticTypeReferences=void 0;t.syntheticLibReferences=void 0;t.hasNoDefaultLib=void 0;return t}function updateBundle(e,t){return e.sourceFiles!==t?update(createBundle(t),e):e}function createSyntheticExpression(e,t=false,n){const r=createBaseNode(237);r.type=e;r.isSpread=t;r.tupleNameSource=n;return r}function createSyntaxList3(e){const t=createBaseNode(352);t._children=e;return t}function createNotEmittedStatement(e){const t=createBaseNode(353);t.original=e;setTextRange(t,e);return t}function createPartiallyEmittedExpression(e,t){const n=createBaseNode(355);n.expression=e;n.original=t;n.transformFlags|=propagateChildFlags(n.expression)|1;setTextRange(n,t);return n}function updatePartiallyEmittedExpression(e,t){return e.expression!==t?update(createPartiallyEmittedExpression(t,e.original),e):e}function createNotEmittedTypeElement(){return createBaseNode(354)}function flattenCommaElements(e){if(nodeIsSynthesized(e)&&!isParseTreeNode(e)&&!e.original&&!e.emitNode&&!e.id){if(isCommaListExpression(e)){return e.elements}if(isBinaryExpression(e)&&isCommaToken(e.operatorToken)){return[e.left,e.right]}}return e}function createCommaListExpression(e){const t=createBaseNode(356);t.elements=createNodeArray(sameFlatMap(e,flattenCommaElements));t.transformFlags|=propagateChildrenFlags(t.elements);return t}function updateCommaListExpression(e,t){return e.elements!==t?update(createCommaListExpression(t),e):e}function createSyntheticReferenceExpression(e,t){const n=createBaseNode(357);n.expression=e;n.thisArg=t;n.transformFlags|=propagateChildFlags(n.expression)|propagateChildFlags(n.thisArg);return n}function updateSyntheticReferenceExpression(e,t,n){return e.expression!==t||e.thisArg!==n?update(createSyntheticReferenceExpression(t,n),e):e}function cloneGeneratedIdentifier(e){const t=createBaseIdentifier(e.escapedText);t.flags|=e.flags&~16;t.transformFlags=e.transformFlags;n(t,e);setIdentifierAutoGenerate(t,{...e.emitNode.autoGenerate});return t}function cloneIdentifier(e){const t=createBaseIdentifier(e.escapedText);t.flags|=e.flags&~16;t.jsDoc=e.jsDoc;t.flowNode=e.flowNode;t.symbol=e.symbol;t.transformFlags=e.transformFlags;n(t,e);const r=getIdentifierTypeArguments(e);if(r)setIdentifierTypeArguments(t,r);return t}function cloneGeneratedPrivateIdentifier(e){const t=createBasePrivateIdentifier(e.escapedText);t.flags|=e.flags&~16;t.transformFlags=e.transformFlags;n(t,e);setIdentifierAutoGenerate(t,{...e.emitNode.autoGenerate});return t}function clonePrivateIdentifier(e){const t=createBasePrivateIdentifier(e.escapedText);t.flags|=e.flags&~16;t.transformFlags=e.transformFlags;n(t,e);return t}function cloneNode(e){if(e===void 0){return e}if(isSourceFile(e)){return cloneSourceFile(e)}if(isGeneratedIdentifier(e)){return cloneGeneratedIdentifier(e)}if(isIdentifier(e)){return cloneIdentifier(e)}if(isGeneratedPrivateIdentifier(e)){return cloneGeneratedPrivateIdentifier(e)}if(isPrivateIdentifier(e)){return clonePrivateIdentifier(e)}const r=!isNodeKind(e.kind)?t.createBaseTokenNode(e.kind):t.createBaseNode(e.kind);r.flags|=e.flags&~16;r.transformFlags=e.transformFlags;n(r,e);for(const t in e){if(hasProperty(r,t)||!hasProperty(e,t)){continue}r[t]=e[t]}return r}function createImmediatelyInvokedFunctionExpression(e,t,n){return createCallExpression(createFunctionExpression(void 0,void 0,void 0,void 0,t?[t]:[],void 0,createBlock(e,true)),void 0,n?[n]:[])}function createImmediatelyInvokedArrowFunction(e,t,n){return createCallExpression(createArrowFunction(void 0,void 0,t?[t]:[],void 0,void 0,createBlock(e,true)),void 0,n?[n]:[])}function createVoidZero(){return createVoidExpression(createNumericLiteral("0"))}function createExportDefault(e){return createExportAssignment2(void 0,false,e)}function createExternalModuleExport(e){return createExportDeclaration(void 0,false,createNamedExports([createExportSpecifier(false,void 0,e)]))}function createTypeCheck(e,t){return t==="null"?h.createStrictEquality(e,createNull()):t==="undefined"?h.createStrictEquality(e,createVoidZero()):h.createStrictEquality(createTypeOfExpression(e),createStringLiteral(t))}function createIsNotTypeCheck(e,t){return t==="null"?h.createStrictInequality(e,createNull()):t==="undefined"?h.createStrictInequality(e,createVoidZero()):h.createStrictInequality(createTypeOfExpression(e),createStringLiteral(t))}function createMethodCall(e,t,n){if(isCallChain(e)){return createCallChain(createPropertyAccessChain(e,void 0,t),void 0,void 0,n)}return createCallExpression(createPropertyAccessExpression(e,t),void 0,n)}function createFunctionBindCall(e,t,n){return createMethodCall(e,"bind",[t,...n])}function createFunctionCallCall(e,t,n){return createMethodCall(e,"call",[t,...n])}function createFunctionApplyCall(e,t,n){return createMethodCall(e,"apply",[t,n])}function createGlobalMethodCall(e,t,n){return createMethodCall(createIdentifier(e),t,n)}function createArraySliceCall(e,t){return createMethodCall(e,"slice",t===void 0?[]:[asExpression(t)])}function createArrayConcatCall(e,t){return createMethodCall(e,"concat",t)}function createObjectDefinePropertyCall(e,t,n){return createGlobalMethodCall("Object","defineProperty",[e,asExpression(t),n])}function createObjectGetOwnPropertyDescriptorCall(e,t){return createGlobalMethodCall("Object","getOwnPropertyDescriptor",[e,asExpression(t)])}function createReflectGetCall(e,t,n){return createGlobalMethodCall("Reflect","get",n?[e,t,n]:[e,t])}function createReflectSetCall(e,t,n,r){return createGlobalMethodCall("Reflect","set",r?[e,t,n,r]:[e,t,n])}function tryAddPropertyAssignment(e,t,n){if(n){e.push(createPropertyAssignment(t,n));return true}return false}function createPropertyDescriptor(e,t){const n=[];tryAddPropertyAssignment(n,"enumerable",asExpression(e.enumerable));tryAddPropertyAssignment(n,"configurable",asExpression(e.configurable));let r=tryAddPropertyAssignment(n,"writable",asExpression(e.writable));r=tryAddPropertyAssignment(n,"value",e.value)||r;let i=tryAddPropertyAssignment(n,"get",e.get);i=tryAddPropertyAssignment(n,"set",e.set)||i;S.assert(!(r&&i),"A PropertyDescriptor may not be both an accessor descriptor and a data descriptor.");return createObjectLiteralExpression(n,!t)}function updateOuterExpression(e,t){switch(e.kind){case 217:return updateParenthesizedExpression(e,t);case 216:return updateTypeAssertion(e,e.type,t);case 234:return updateAsExpression(e,t,e.type);case 238:return updateSatisfiesExpression(e,t,e.type);case 235:return updateNonNullExpression(e,t);case 233:return updateExpressionWithTypeArguments(e,t,e.typeArguments);case 355:return updatePartiallyEmittedExpression(e,t)}}function isIgnorableParen(e){return isParenthesizedExpression(e)&&nodeIsSynthesized(e)&&nodeIsSynthesized(getSourceMapRange(e))&&nodeIsSynthesized(getCommentRange(e))&&!some(getSyntheticLeadingComments(e))&&!some(getSyntheticTrailingComments(e))}function restoreOuterExpressions(e,t,n=63){if(e&&isOuterExpression(e,n)&&!isIgnorableParen(e)){return updateOuterExpression(e,restoreOuterExpressions(e.expression,t))}return t}function restoreEnclosingLabel(e,t,n){if(!t){return e}const r=updateLabeledStatement(t,t.label,isLabeledStatement(t.statement)?restoreEnclosingLabel(e,t.statement):e);if(n){n(t)}return r}function shouldBeCapturedInTempVariable(e,t){const n=skipParentheses(e);switch(n.kind){case 80:return t;case 110:case 9:case 10:case 11:return false;case 209:const e=n.elements;if(e.length===0){return false}return true;case 210:return n.properties.length>0;default:return true}}function createCallBinding(e,t,n,i=false){const o=skipOuterExpressions(e,63);let a;let s;if(isSuperProperty(o)){a=createThis();s=o}else if(isSuperKeyword(o)){a=createThis();s=n!==void 0&&n<2?setTextRange(createIdentifier("_super"),o):o}else if(getEmitFlags(o)&8192){a=createVoidZero();s=r().parenthesizeLeftSideOfAccess(o,false)}else if(isPropertyAccessExpression(o)){if(shouldBeCapturedInTempVariable(o.expression,i)){a=createTempVariable(t);s=createPropertyAccessExpression(setTextRange(h.createAssignment(a,o.expression),o.expression),o.name);setTextRange(s,o)}else{a=o.expression;s=o}}else if(isElementAccessExpression(o)){if(shouldBeCapturedInTempVariable(o.expression,i)){a=createTempVariable(t);s=createElementAccessExpression(setTextRange(h.createAssignment(a,o.expression),o.expression),o.argumentExpression);setTextRange(s,o)}else{a=o.expression;s=o}}else{a=createVoidZero();s=r().parenthesizeLeftSideOfAccess(e,false)}return{target:s,thisArg:a}}function createAssignmentTargetWrapper(e,t){return createPropertyAccessExpression(createParenthesizedExpression(createObjectLiteralExpression([createSetAccessorDeclaration(void 0,"value",[createParameterDeclaration(void 0,void 0,e,void 0,void 0,void 0)],createBlock([createExpressionStatement(t)]))])),"value")}function inlineExpressions(e){return e.length>10?createCommaListExpression(e):reduceLeft(e,h.createComma)}function getName(e,t,n,r=0,i){const o=i?e&&getNonAssignedNameOfDeclaration(e):getNameOfDeclaration(e);if(o&&isIdentifier(o)&&!isGeneratedIdentifier(o)){const e=setParent(setTextRange(cloneNode(o),o),o.parent);r|=getEmitFlags(o);if(!n)r|=96;if(!t)r|=3072;if(r)setEmitFlags(e,r);return e}return getGeneratedNameForNode(e)}function getInternalName(e,t,n){return getName(e,t,n,32768|65536)}function getLocalName(e,t,n,r){return getName(e,t,n,32768,r)}function getExportName(e,t,n){return getName(e,t,n,16384)}function getDeclarationName(e,t,n){return getName(e,t,n)}function getNamespaceMemberName(e,t,n,r){const i=createPropertyAccessExpression(e,nodeIsSynthesized(t)?t:cloneNode(t));setTextRange(i,t);let o=0;if(!r)o|=96;if(!n)o|=3072;if(o)setEmitFlags(i,o);return i}function getExternalModuleOrNamespaceExportName(e,t,n,r){if(e&&hasSyntacticModifier(t,32)){return getNamespaceMemberName(e,getName(t),n,r)}return getExportName(t,n,r)}function copyPrologue(e,t,n,r){const i=copyStandardPrologue(e,t,0,n);return copyCustomPrologue(e,t,i,r)}function isUseStrictPrologue2(e){return isStringLiteral(e.expression)&&e.expression.text==="use strict"}function createUseStrictPrologue(){return startOnNewLine(createExpressionStatement(createStringLiteral("use strict")))}function copyStandardPrologue(e,t,n=0,r){S.assert(t.length===0,"Prologue directives should be at the first statement in the target statements array");let i=false;const o=e.length;while(ns){l.splice(i,0,...t.slice(s,c))}if(s>a){l.splice(r,0,...t.slice(a,s))}if(a>o){l.splice(n,0,...t.slice(o,a))}if(o>0){if(n===0){l.splice(0,0,...t.slice(0,o))}else{const r=new Map;for(let t=0;t=0;e--){const n=t[e];if(!r.has(n.expression.text)){l.unshift(n)}}}}if(isNodeArray(e)){return setTextRange(createNodeArray(l,e.hasTrailingComma),e)}return e}function replaceModifiers(e,t){let n;if(typeof t==="number"){n=createModifiersFromModifierFlags(t)}else{n=t}return isTypeParameterDeclaration(e)?updateTypeParameterDeclaration(e,n,e.name,e.constraint,e.default):isParameter(e)?updateParameterDeclaration(e,n,e.dotDotDotToken,e.name,e.questionToken,e.type,e.initializer):isConstructorTypeNode(e)?updateConstructorTypeNode1(e,n,e.typeParameters,e.parameters,e.type):isPropertySignature(e)?updatePropertySignature(e,n,e.name,e.questionToken,e.type):isPropertyDeclaration(e)?updatePropertyDeclaration2(e,n,e.name,e.questionToken??e.exclamationToken,e.type,e.initializer):isMethodSignature(e)?updateMethodSignature(e,n,e.name,e.questionToken,e.typeParameters,e.parameters,e.type):isMethodDeclaration(e)?updateMethodDeclaration(e,n,e.asteriskToken,e.name,e.questionToken,e.typeParameters,e.parameters,e.type,e.body):isConstructorDeclaration(e)?updateConstructorDeclaration(e,n,e.parameters,e.body):isGetAccessorDeclaration(e)?updateGetAccessorDeclaration(e,n,e.name,e.parameters,e.type,e.body):isSetAccessorDeclaration(e)?updateSetAccessorDeclaration(e,n,e.name,e.parameters,e.body):isIndexSignatureDeclaration(e)?updateIndexSignature(e,n,e.parameters,e.type):isFunctionExpression(e)?updateFunctionExpression(e,n,e.asteriskToken,e.name,e.typeParameters,e.parameters,e.type,e.body):isArrowFunction(e)?updateArrowFunction(e,n,e.typeParameters,e.parameters,e.type,e.equalsGreaterThanToken,e.body):isClassExpression(e)?updateClassExpression(e,n,e.name,e.typeParameters,e.heritageClauses,e.members):isVariableStatement(e)?updateVariableStatement(e,n,e.declarationList):isFunctionDeclaration(e)?updateFunctionDeclaration(e,n,e.asteriskToken,e.name,e.typeParameters,e.parameters,e.type,e.body):isClassDeclaration(e)?updateClassDeclaration(e,n,e.name,e.typeParameters,e.heritageClauses,e.members):isInterfaceDeclaration(e)?updateInterfaceDeclaration(e,n,e.name,e.typeParameters,e.heritageClauses,e.members):isTypeAliasDeclaration(e)?updateTypeAliasDeclaration(e,n,e.name,e.typeParameters,e.type):isEnumDeclaration(e)?updateEnumDeclaration(e,n,e.name,e.members):isModuleDeclaration(e)?updateModuleDeclaration(e,n,e.name,e.body):isImportEqualsDeclaration(e)?updateImportEqualsDeclaration(e,n,e.isTypeOnly,e.name,e.moduleReference):isImportDeclaration(e)?updateImportDeclaration(e,n,e.importClause,e.moduleSpecifier,e.attributes):isExportAssignment(e)?updateExportAssignment(e,n,e.expression):isExportDeclaration(e)?updateExportDeclaration(e,n,e.isTypeOnly,e.exportClause,e.moduleSpecifier,e.attributes):S.assertNever(e)}function replaceDecoratorsAndModifiers(e,t){return isParameter(e)?updateParameterDeclaration(e,t,e.dotDotDotToken,e.name,e.questionToken,e.type,e.initializer):isPropertyDeclaration(e)?updatePropertyDeclaration2(e,t,e.name,e.questionToken??e.exclamationToken,e.type,e.initializer):isMethodDeclaration(e)?updateMethodDeclaration(e,t,e.asteriskToken,e.name,e.questionToken,e.typeParameters,e.parameters,e.type,e.body):isGetAccessorDeclaration(e)?updateGetAccessorDeclaration(e,t,e.name,e.parameters,e.type,e.body):isSetAccessorDeclaration(e)?updateSetAccessorDeclaration(e,t,e.name,e.parameters,e.body):isClassExpression(e)?updateClassExpression(e,t,e.name,e.typeParameters,e.heritageClauses,e.members):isClassDeclaration(e)?updateClassDeclaration(e,t,e.name,e.typeParameters,e.heritageClauses,e.members):S.assertNever(e)}function replacePropertyName(e,t){switch(e.kind){case 177:return updateGetAccessorDeclaration(e,e.modifiers,t,e.parameters,e.type,e.body);case 178:return updateSetAccessorDeclaration(e,e.modifiers,t,e.parameters,e.body);case 174:return updateMethodDeclaration(e,e.modifiers,e.asteriskToken,t,e.questionToken,e.typeParameters,e.parameters,e.type,e.body);case 173:return updateMethodSignature(e,e.modifiers,t,e.questionToken,e.typeParameters,e.parameters,e.type);case 172:return updatePropertyDeclaration2(e,e.modifiers,t,e.questionToken??e.exclamationToken,e.type,e.initializer);case 171:return updatePropertySignature(e,e.modifiers,t,e.questionToken,e.type);case 303:return updatePropertyAssignment(e,t,e.initializer)}}function asNodeArray(e){return e?createNodeArray(e):void 0}function asName(e){return typeof e==="string"?createIdentifier(e):e}function asExpression(e){return typeof e==="string"?createStringLiteral(e):typeof e==="number"?createNumericLiteral(e):typeof e==="boolean"?e?createTrue():createFalse():e}function asInitializer(e){return e&&r().parenthesizeExpressionForDisallowedComma(e)}function asToken(e){return typeof e==="number"?createToken(e):e}function asEmbeddedStatement(e){return e&&isNotEmittedStatement(e)?setTextRange(n(createEmptyStatement(),e),e):e}function asVariableDeclaration(e){if(typeof e==="string"||e&&!isVariableDeclaration(e)){return createVariableDeclaration(e,void 0,void 0,void 0)}return e}function update(e,t){if(e!==t){n(e,t);setTextRange(e,t)}return e}}function getDefaultTagNameForKind(e){switch(e){case 344:return"type";case 342:return"returns";case 343:return"this";case 340:return"enum";case 330:return"author";case 332:return"class";case 333:return"public";case 334:return"private";case 335:return"protected";case 336:return"readonly";case 337:return"override";case 345:return"template";case 346:return"typedef";case 341:return"param";case 348:return"prop";case 338:return"callback";case 339:return"overload";case 328:return"augments";case 329:return"implements";case 351:return"import";default:return S.fail(`Unsupported kind: ${S.formatSyntaxKind(e)}`)}}var jr;var Jr={};function getCookedText(e,t){if(!jr){jr=createScanner(99,false,0)}switch(e){case 15:jr.setText("`"+t+"`");break;case 16:jr.setText("`"+t+"${");break;case 17:jr.setText("}"+t+"${");break;case 18:jr.setText("}"+t+"`");break}let n=jr.scan();if(n===20){n=jr.reScanTemplateToken(false)}if(jr.isUnterminated()){jr.setText(void 0);return Jr}let r;switch(n){case 15:case 16:case 17:case 18:r=jr.getTokenValue();break}if(r===void 0||jr.scan()!==1){jr.setText(void 0);return Jr}jr.setText(void 0);return r}function propagateNameFlags(e){return e&&isIdentifier(e)?propagateIdentifierNameFlags(e):propagateChildFlags(e)}function propagateIdentifierNameFlags(e){return propagateChildFlags(e)&~67108864}function propagatePropertyNameFlagsOfChild(e,t){return t|e.transformFlags&134234112}function propagateChildFlags(e){if(!e)return 0;const t=e.transformFlags&~getTransformFlagsSubtreeExclusions(e.kind);return isNamedDeclaration(e)&&isPropertyName(e.name)?propagatePropertyNameFlagsOfChild(e.name,t):t}function propagateChildrenFlags(e){return e?e.transformFlags:0}function aggregateChildrenFlags(e){let t=0;for(const n of e){t|=propagateChildFlags(n)}e.transformFlags=t}function getTransformFlagsSubtreeExclusions(e){if(e>=182&&e<=205){return-2}switch(e){case 213:case 214:case 209:return-2147450880;case 267:return-1941676032;case 169:return-2147483648;case 219:return-2072174592;case 218:case 262:return-1937940480;case 261:return-2146893824;case 263:case 231:return-2147344384;case 176:return-1937948672;case 172:return-2013249536;case 174:case 177:case 178:return-2005057536;case 133:case 150:case 163:case 146:case 154:case 151:case 136:case 155:case 116:case 168:case 171:case 173:case 179:case 180:case 181:case 264:case 265:return-2;case 210:return-2147278848;case 299:return-2147418112;case 206:case 207:return-2147450880;case 216:case 238:case 234:case 355:case 217:case 108:return-2147483648;case 211:case 212:return-2147483648;default:return-2147483648}}var Wr=createBaseNodeFactory();function makeSynthetic(e){e.flags|=16;return e}var Ur={createBaseSourceFileNode:e=>makeSynthetic(Wr.createBaseSourceFileNode(e)),createBaseIdentifierNode:e=>makeSynthetic(Wr.createBaseIdentifierNode(e)),createBasePrivateIdentifierNode:e=>makeSynthetic(Wr.createBasePrivateIdentifierNode(e)),createBaseTokenNode:e=>makeSynthetic(Wr.createBaseTokenNode(e)),createBaseNode:e=>makeSynthetic(Wr.createBaseNode(e))};var zr=createNodeFactory(4,Ur);var Vr;function createSourceMapSource(e,t,n){return new(Vr||(Vr=Rn.getSourceMapSourceConstructor()))(e,t,n)}function setOriginalNode(e,t){if(e.original!==t){e.original=t;if(t){const n=t.emitNode;if(n)e.emitNode=mergeEmitNode(n,e.emitNode)}}return e}function mergeEmitNode(e,t){const{flags:n,internalFlags:r,leadingComments:i,trailingComments:o,commentRange:a,sourceMapRange:s,tokenSourceMapRanges:c,constantValue:l,helpers:d,startsOnNewLine:p,snippetElement:u,classThis:f,assignedName:m}=e;if(!t)t={};if(n){t.flags=n}if(r){t.internalFlags=r&~8}if(i){t.leadingComments=addRange(i.slice(),t.leadingComments)}if(o){t.trailingComments=addRange(o.slice(),t.trailingComments)}if(a){t.commentRange=a}if(s){t.sourceMapRange=s}if(c){t.tokenSourceMapRanges=mergeTokenSourceMapRanges(c,t.tokenSourceMapRanges)}if(l!==void 0){t.constantValue=l}if(d){for(const e of d){t.helpers=appendIfUnique(t.helpers,e)}}if(p!==void 0){t.startsOnNewLine=p}if(u!==void 0){t.snippetElement=u}if(f){t.classThis=f}if(m){t.assignedName=m}return t}function mergeTokenSourceMapRanges(e,t){if(!t)t=[];for(const n in e){t[n]=e[n]}return t}function getOrCreateEmitNode(e){if(!e.emitNode){if(isParseTreeNode(e)){if(e.kind===307){return e.emitNode={annotatedNodes:[e]}}const t=getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(e)))??S.fail("Could not determine parsed source file.");getOrCreateEmitNode(t).annotatedNodes.push(e)}e.emitNode={}}else{S.assert(!(e.emitNode.internalFlags&8),"Invalid attempt to mutate an immutable node.")}return e.emitNode}function disposeEmitNodes(e){var t,n;const r=(n=(t=getSourceFileOfNode(getParseTreeNode(e)))==null?void 0:t.emitNode)==null?void 0:n.annotatedNodes;if(r){for(const e of r){e.emitNode=void 0}}}function removeAllComments(e){const t=getOrCreateEmitNode(e);t.flags|=3072;t.leadingComments=void 0;t.trailingComments=void 0;return e}function setEmitFlags(e,t){getOrCreateEmitNode(e).flags=t;return e}function addEmitFlags(e,t){const n=getOrCreateEmitNode(e);n.flags=n.flags|t;return e}function setInternalEmitFlags(e,t){getOrCreateEmitNode(e).internalFlags=t;return e}function addInternalEmitFlags(e,t){const n=getOrCreateEmitNode(e);n.internalFlags=n.internalFlags|t;return e}function getSourceMapRange(e){var t;return((t=e.emitNode)==null?void 0:t.sourceMapRange)??e}function setSourceMapRange(e,t){getOrCreateEmitNode(e).sourceMapRange=t;return e}function getTokenSourceMapRange(e,t){var n,r;return(r=(n=e.emitNode)==null?void 0:n.tokenSourceMapRanges)==null?void 0:r[t]}function setTokenSourceMapRange(e,t,n){const r=getOrCreateEmitNode(e);const i=r.tokenSourceMapRanges??(r.tokenSourceMapRanges=[]);i[t]=n;return e}function getStartsOnNewLine(e){var t;return(t=e.emitNode)==null?void 0:t.startsOnNewLine}function setStartsOnNewLine(e,t){getOrCreateEmitNode(e).startsOnNewLine=t;return e}function getCommentRange(e){var t;return((t=e.emitNode)==null?void 0:t.commentRange)??e}function setCommentRange(e,t){getOrCreateEmitNode(e).commentRange=t;return e}function getSyntheticLeadingComments(e){var t;return(t=e.emitNode)==null?void 0:t.leadingComments}function setSyntheticLeadingComments(e,t){getOrCreateEmitNode(e).leadingComments=t;return e}function addSyntheticLeadingComment(e,t,n,r){return setSyntheticLeadingComments(e,append(getSyntheticLeadingComments(e),{kind:t,pos:-1,end:-1,hasTrailingNewLine:r,text:n}))}function getSyntheticTrailingComments(e){var t;return(t=e.emitNode)==null?void 0:t.trailingComments}function setSyntheticTrailingComments(e,t){getOrCreateEmitNode(e).trailingComments=t;return e}function addSyntheticTrailingComment(e,t,n,r){return setSyntheticTrailingComments(e,append(getSyntheticTrailingComments(e),{kind:t,pos:-1,end:-1,hasTrailingNewLine:r,text:n}))}function moveSyntheticComments(e,t){setSyntheticLeadingComments(e,getSyntheticLeadingComments(t));setSyntheticTrailingComments(e,getSyntheticTrailingComments(t));const n=getOrCreateEmitNode(t);n.leadingComments=void 0;n.trailingComments=void 0;return e}function getConstantValue(e){var t;return(t=e.emitNode)==null?void 0:t.constantValue}function setConstantValue(e,t){const n=getOrCreateEmitNode(e);n.constantValue=t;return e}function addEmitHelper(e,t){const n=getOrCreateEmitNode(e);n.helpers=append(n.helpers,t);return e}function addEmitHelpers(e,t){if(some(t)){const n=getOrCreateEmitNode(e);for(const e of t){n.helpers=appendIfUnique(n.helpers,e)}}return e}function removeEmitHelper(e,t){var n;const r=(n=e.emitNode)==null?void 0:n.helpers;if(r){return orderedRemoveItem(r,t)}return false}function getEmitHelpers(e){var t;return(t=e.emitNode)==null?void 0:t.helpers}function moveEmitHelpers(e,t,n){const r=e.emitNode;const i=r&&r.helpers;if(!some(i))return;const o=getOrCreateEmitNode(t);let a=0;for(let e=0;e0){i[e-a]=t}}if(a>0){i.length-=a}}function getSnippetElement(e){var t;return(t=e.emitNode)==null?void 0:t.snippetElement}function setSnippetElement(e,t){const n=getOrCreateEmitNode(e);n.snippetElement=t;return e}function ignoreSourceNewlines(e){getOrCreateEmitNode(e).internalFlags|=4;return e}function setTypeNode(e,t){const n=getOrCreateEmitNode(e);n.typeNode=t;return e}function getTypeNode(e){var t;return(t=e.emitNode)==null?void 0:t.typeNode}function setIdentifierTypeArguments(e,t){getOrCreateEmitNode(e).identifierTypeArguments=t;return e}function getIdentifierTypeArguments(e){var t;return(t=e.emitNode)==null?void 0:t.identifierTypeArguments}function setIdentifierAutoGenerate(e,t){getOrCreateEmitNode(e).autoGenerate=t;return e}function getIdentifierAutoGenerate(e){var t;return(t=e.emitNode)==null?void 0:t.autoGenerate}function setIdentifierGeneratedImportReference(e,t){getOrCreateEmitNode(e).generatedImportReference=t;return e}function getIdentifierGeneratedImportReference(e){var t;return(t=e.emitNode)==null?void 0:t.generatedImportReference}var qr=(e=>{e["Field"]="f";e["Method"]="m";e["Accessor"]="a";return e})(qr||{});function createEmitHelperFactory(e){const t=e.factory;const n=memoize((()=>setInternalEmitFlags(t.createTrue(),8)));const r=memoize((()=>setInternalEmitFlags(t.createFalse(),8)));return{getUnscopedHelperName:getUnscopedHelperName,createDecorateHelper:createDecorateHelper,createMetadataHelper:createMetadataHelper,createParamHelper:createParamHelper,createESDecorateHelper:createESDecorateHelper,createRunInitializersHelper:createRunInitializersHelper,createAssignHelper:createAssignHelper,createAwaitHelper:createAwaitHelper,createAsyncGeneratorHelper:createAsyncGeneratorHelper,createAsyncDelegatorHelper:createAsyncDelegatorHelper,createAsyncValuesHelper:createAsyncValuesHelper,createRestHelper:createRestHelper,createAwaiterHelper:createAwaiterHelper,createExtendsHelper:createExtendsHelper,createTemplateObjectHelper:createTemplateObjectHelper,createSpreadArrayHelper:createSpreadArrayHelper,createPropKeyHelper:createPropKeyHelper,createSetFunctionNameHelper:createSetFunctionNameHelper,createValuesHelper:createValuesHelper,createReadHelper:createReadHelper,createGeneratorHelper:createGeneratorHelper,createImportStarHelper:createImportStarHelper,createImportStarCallbackHelper:createImportStarCallbackHelper,createImportDefaultHelper:createImportDefaultHelper,createExportStarHelper:createExportStarHelper,createClassPrivateFieldGetHelper:createClassPrivateFieldGetHelper,createClassPrivateFieldSetHelper:createClassPrivateFieldSetHelper,createClassPrivateFieldInHelper:createClassPrivateFieldInHelper,createAddDisposableResourceHelper:createAddDisposableResourceHelper,createDisposeResourcesHelper:createDisposeResourcesHelper,createRewriteRelativeImportExtensionsHelper:createRewriteRelativeImportExtensionsHelper};function getUnscopedHelperName(e){return setEmitFlags(t.createIdentifier(e),8192|4)}function createDecorateHelper(n,r,i,o){e.requestEmitHelper(Hr);const a=[];a.push(t.createArrayLiteralExpression(n,true));a.push(r);if(i){a.push(i);if(o){a.push(o)}}return t.createCallExpression(getUnscopedHelperName("__decorate"),void 0,a)}function createMetadataHelper(n,r){e.requestEmitHelper(Gr);return t.createCallExpression(getUnscopedHelperName("__metadata"),void 0,[t.createStringLiteral(n),r])}function createParamHelper(n,r,i){e.requestEmitHelper(Kr);return setTextRange(t.createCallExpression(getUnscopedHelperName("__param"),void 0,[t.createNumericLiteral(r+""),n]),i)}function createESDecorateClassContextObject(e){const n=[t.createPropertyAssignment(t.createIdentifier("kind"),t.createStringLiteral("class")),t.createPropertyAssignment(t.createIdentifier("name"),e.name),t.createPropertyAssignment(t.createIdentifier("metadata"),e.metadata)];return t.createObjectLiteralExpression(n)}function createESDecorateClassElementAccessGetMethod(e){const n=e.computed?t.createElementAccessExpression(t.createIdentifier("obj"),e.name):t.createPropertyAccessExpression(t.createIdentifier("obj"),e.name);return t.createPropertyAssignment("get",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,t.createIdentifier("obj"))],void 0,void 0,n))}function createESDecorateClassElementAccessSetMethod(e){const n=e.computed?t.createElementAccessExpression(t.createIdentifier("obj"),e.name):t.createPropertyAccessExpression(t.createIdentifier("obj"),e.name);return t.createPropertyAssignment("set",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,t.createIdentifier("obj")),t.createParameterDeclaration(void 0,void 0,t.createIdentifier("value"))],void 0,void 0,t.createBlock([t.createExpressionStatement(t.createAssignment(n,t.createIdentifier("value")))])))}function createESDecorateClassElementAccessHasMethod(e){const n=e.computed?e.name:isIdentifier(e.name)?t.createStringLiteralFromNode(e.name):e.name;return t.createPropertyAssignment("has",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,t.createIdentifier("obj"))],void 0,void 0,t.createBinaryExpression(n,103,t.createIdentifier("obj"))))}function createESDecorateClassElementAccessObject(e,n){const r=[];r.push(createESDecorateClassElementAccessHasMethod(e));if(n.get)r.push(createESDecorateClassElementAccessGetMethod(e));if(n.set)r.push(createESDecorateClassElementAccessSetMethod(e));return t.createObjectLiteralExpression(r)}function createESDecorateClassElementContextObject(e){const n=[t.createPropertyAssignment(t.createIdentifier("kind"),t.createStringLiteral(e.kind)),t.createPropertyAssignment(t.createIdentifier("name"),e.name.computed?e.name.name:t.createStringLiteralFromNode(e.name.name)),t.createPropertyAssignment(t.createIdentifier("static"),e.static?t.createTrue():t.createFalse()),t.createPropertyAssignment(t.createIdentifier("private"),e.private?t.createTrue():t.createFalse()),t.createPropertyAssignment(t.createIdentifier("access"),createESDecorateClassElementAccessObject(e.name,e.access)),t.createPropertyAssignment(t.createIdentifier("metadata"),e.metadata)];return t.createObjectLiteralExpression(n)}function createESDecorateContextObject(e){return e.kind==="class"?createESDecorateClassContextObject(e):createESDecorateClassElementContextObject(e)}function createESDecorateHelper(n,r,i,o,a,s){e.requestEmitHelper($r);return t.createCallExpression(getUnscopedHelperName("__esDecorate"),void 0,[n??t.createNull(),r??t.createNull(),i,createESDecorateContextObject(o),a,s])}function createRunInitializersHelper(n,r,i){e.requestEmitHelper(Qr);return t.createCallExpression(getUnscopedHelperName("__runInitializers"),void 0,i?[n,r,i]:[n,r])}function createAssignHelper(n){if(zn(e.getCompilerOptions())>=2){return t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"assign"),void 0,n)}e.requestEmitHelper(Xr);return t.createCallExpression(getUnscopedHelperName("__assign"),void 0,n)}function createAwaitHelper(n){e.requestEmitHelper(Yr);return t.createCallExpression(getUnscopedHelperName("__await"),void 0,[n])}function createAsyncGeneratorHelper(n,r){e.requestEmitHelper(Yr);e.requestEmitHelper(Zr);(n.emitNode||(n.emitNode={})).flags|=524288|1048576;return t.createCallExpression(getUnscopedHelperName("__asyncGenerator"),void 0,[r?t.createThis():t.createVoidZero(),t.createIdentifier("arguments"),n])}function createAsyncDelegatorHelper(n){e.requestEmitHelper(Yr);e.requestEmitHelper(ei);return t.createCallExpression(getUnscopedHelperName("__asyncDelegator"),void 0,[n])}function createAsyncValuesHelper(n){e.requestEmitHelper(ti);return t.createCallExpression(getUnscopedHelperName("__asyncValues"),void 0,[n])}function createRestHelper(n,r,i,o){e.requestEmitHelper(ni);const a=[];let s=0;for(let e=0;e{let r="";for(let i=0;i= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };`};var Gr={name:"typescript:metadata",importName:"__metadata",scoped:false,priority:3,text:`\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);\n };`};var Kr={name:"typescript:param",importName:"__param",scoped:false,priority:4,text:`\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };`};var $r={name:"typescript:esDecorate",importName:"__esDecorate",scoped:false,priority:2,text:`\n var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }\n var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";\n var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === "accessor") {\n if (result === void 0) continue;\n if (result === null || typeof result !== "object") throw new TypeError("Object expected");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === "field") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n };`};var Qr={name:"typescript:runInitializers",importName:"__runInitializers",scoped:false,priority:2,text:`\n var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n };`};var Xr={name:"typescript:assign",importName:"__assign",scoped:false,priority:1,text:`\n var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };`};var Yr={name:"typescript:await",importName:"__await",scoped:false,text:`\n var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }`};var Zr={name:"typescript:asyncGenerator",importName:"__asyncGenerator",scoped:false,dependencies:[Yr],text:`\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume("next", value); }\n function reject(value) { resume("throw", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n };`};var ei={name:"typescript:asyncDelegator",importName:"__asyncDelegator",scoped:false,dependencies:[Yr],text:`\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n };`};var ti={name:"typescript:asyncValues",importName:"__asyncValues",scoped:false,text:`\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n };`};var ni={name:"typescript:rest",importName:"__rest",scoped:false,text:`\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };`};var ri={name:"typescript:awaiter",importName:"__awaiter",scoped:false,priority:5,text:`\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };`};var ii={name:"typescript:extends",importName:"__extends",scoped:false,priority:0,text:`\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();`};var oi={name:"typescript:makeTemplateObject",importName:"__makeTemplateObject",scoped:false,priority:0,text:`\n var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n };`};var ai={name:"typescript:read",importName:"__read",scoped:false,text:`\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };`};var si={name:"typescript:spreadArray",importName:"__spreadArray",scoped:false,text:`\n var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n };`};var ci={name:"typescript:propKey",importName:"__propKey",scoped:false,text:`\n var __propKey = (this && this.__propKey) || function (x) {\n return typeof x === "symbol" ? x : "".concat(x);\n };`};var li={name:"typescript:setFunctionName",importName:"__setFunctionName",scoped:false,text:`\n var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {\n if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";\n return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });\n };`};var di={name:"typescript:values",importName:"__values",scoped:false,text:`\n var __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n };`};var pi={name:"typescript:generator",importName:"__generator",scoped:false,priority:6,text:`\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);\n return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };`};var ui={name:"typescript:commonjscreatebinding",importName:"__createBinding",scoped:false,priority:1,text:`\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n }));`};var fi={name:"typescript:commonjscreatevalue",importName:"__setModuleDefault",scoped:false,priority:1,text:`\n var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, "default", { enumerable: true, value: v });\n }) : function(o, v) {\n o["default"] = v;\n });`};var mi={name:"typescript:commonjsimportstar",importName:"__importStar",scoped:false,dependencies:[ui,fi],priority:2,text:`\n var __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n })();`};var _i={name:"typescript:commonjsimportdefault",importName:"__importDefault",scoped:false,text:`\n var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n };`};var gi={name:"typescript:export-star",importName:"__exportStar",scoped:false,dependencies:[ui],priority:2,text:`\n var __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n };`};var yi={name:"typescript:classPrivateFieldGet",importName:"__classPrivateFieldGet",scoped:false,text:`\n var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");\n return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);\n };`};var hi={name:"typescript:classPrivateFieldSet",importName:"__classPrivateFieldSet",scoped:false,text:`\n var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === "m") throw new TypeError("Private method is not writable");\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");\n return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n };`};var Ti={name:"typescript:classPrivateFieldIn",importName:"__classPrivateFieldIn",scoped:false,text:`\n var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");\n return typeof state === "function" ? receiver === state : state.has(receiver);\n };`};var Si={name:"typescript:addDisposableResource",importName:"__addDisposableResource",scoped:false,text:`\n var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== "function") throw new TypeError("Object not disposable.");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n };`};var vi={name:"typescript:disposeResources",importName:"__disposeResources",scoped:false,text:`\n var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {\n return function (env) {\n function fail(e) {\n env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n };\n })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;\n });`};var xi={name:"typescript:rewriteRelativeImportExtensions",importName:"__rewriteRelativeImportExtension",scoped:false,text:`\n var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {\n if (typeof path === "string" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");\n });\n }\n return path;\n };`};var bi={name:"typescript:async-super",scoped:true,text:helperString` - const ${"_superIndex"} = name => super[name];`};var Ci={name:"typescript:advanced-async-super",scoped:true,text:helperString` - const ${"_superIndex"} = (function (geti, seti) { - const cache = Object.create(null); - return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } }); - })(name => super[name], (name, value) => super[name] = value);`};function isCallToHelper(e,t){return isCallExpression(e)&&isIdentifier(e.expression)&&(getEmitFlags(e.expression)&8192)!==0&&e.expression.escapedText===t}function isNumericLiteral(e){return e.kind===9}function isBigIntLiteral(e){return e.kind===10}function isStringLiteral(e){return e.kind===11}function isJsxText(e){return e.kind===12}function isRegularExpressionLiteral(e){return e.kind===14}function isNoSubstitutionTemplateLiteral(e){return e.kind===15}function isTemplateHead(e){return e.kind===16}function isTemplateMiddle(e){return e.kind===17}function isTemplateTail(e){return e.kind===18}function isDotDotDotToken(e){return e.kind===26}function isCommaToken(e){return e.kind===28}function isPlusToken(e){return e.kind===40}function isMinusToken(e){return e.kind===41}function isAsteriskToken(e){return e.kind===42}function isExclamationToken(e){return e.kind===54}function isQuestionToken(e){return e.kind===58}function isColonToken(e){return e.kind===59}function isQuestionDotToken(e){return e.kind===29}function isEqualsGreaterThanToken(e){return e.kind===39}function isIdentifier(e){return e.kind===80}function isPrivateIdentifier(e){return e.kind===81}function isExportModifier(e){return e.kind===95}function isDefaultModifier(e){return e.kind===90}function isAsyncModifier(e){return e.kind===134}function isAssertsKeyword(e){return e.kind===131}function isAwaitKeyword(e){return e.kind===135}function isReadonlyKeyword(e){return e.kind===148}function isStaticModifier(e){return e.kind===126}function isAbstractModifier(e){return e.kind===128}function isOverrideModifier(e){return e.kind===164}function isAccessorModifier(e){return e.kind===129}function isSuperKeyword(e){return e.kind===108}function isImportKeyword(e){return e.kind===102}function isCaseKeyword(e){return e.kind===84}function isQualifiedName(e){return e.kind===166}function isComputedPropertyName(e){return e.kind===167}function isTypeParameterDeclaration(e){return e.kind===168}function isParameter(e){return e.kind===169}function isDecorator(e){return e.kind===170}function isPropertySignature(e){return e.kind===171}function isPropertyDeclaration(e){return e.kind===172}function isMethodSignature(e){return e.kind===173}function isMethodDeclaration(e){return e.kind===174}function isClassStaticBlockDeclaration(e){return e.kind===175}function isConstructorDeclaration(e){return e.kind===176}function isGetAccessorDeclaration(e){return e.kind===177}function isSetAccessorDeclaration(e){return e.kind===178}function isCallSignatureDeclaration(e){return e.kind===179}function isConstructSignatureDeclaration(e){return e.kind===180}function isIndexSignatureDeclaration(e){return e.kind===181}function isTypePredicateNode(e){return e.kind===182}function isTypeReferenceNode(e){return e.kind===183}function isFunctionTypeNode(e){return e.kind===184}function isConstructorTypeNode(e){return e.kind===185}function isTypeQueryNode(e){return e.kind===186}function isTypeLiteralNode(e){return e.kind===187}function isArrayTypeNode(e){return e.kind===188}function isTupleTypeNode(e){return e.kind===189}function isNamedTupleMember(e){return e.kind===202}function isOptionalTypeNode(e){return e.kind===190}function isRestTypeNode(e){return e.kind===191}function isUnionTypeNode(e){return e.kind===192}function isIntersectionTypeNode(e){return e.kind===193}function isConditionalTypeNode(e){return e.kind===194}function isInferTypeNode(e){return e.kind===195}function isParenthesizedTypeNode(e){return e.kind===196}function isThisTypeNode(e){return e.kind===197}function isTypeOperatorNode(e){return e.kind===198}function isIndexedAccessTypeNode(e){return e.kind===199}function isMappedTypeNode(e){return e.kind===200}function isLiteralTypeNode(e){return e.kind===201}function isImportTypeNode(e){return e.kind===205}function isTemplateLiteralTypeSpan(e){return e.kind===204}function isTemplateLiteralTypeNode(e){return e.kind===203}function isObjectBindingPattern(e){return e.kind===206}function isArrayBindingPattern(e){return e.kind===207}function isBindingElement(e){return e.kind===208}function isArrayLiteralExpression(e){return e.kind===209}function isObjectLiteralExpression(e){return e.kind===210}function isPropertyAccessExpression(e){return e.kind===211}function isElementAccessExpression(e){return e.kind===212}function isCallExpression(e){return e.kind===213}function isNewExpression(e){return e.kind===214}function isTaggedTemplateExpression(e){return e.kind===215}function isTypeAssertionExpression(e){return e.kind===216}function isParenthesizedExpression(e){return e.kind===217}function isFunctionExpression(e){return e.kind===218}function isArrowFunction(e){return e.kind===219}function isDeleteExpression(e){return e.kind===220}function isTypeOfExpression(e){return e.kind===221}function isVoidExpression(e){return e.kind===222}function isAwaitExpression(e){return e.kind===223}function isPrefixUnaryExpression(e){return e.kind===224}function isPostfixUnaryExpression(e){return e.kind===225}function isBinaryExpression(e){return e.kind===226}function isConditionalExpression(e){return e.kind===227}function isTemplateExpression(e){return e.kind===228}function isYieldExpression(e){return e.kind===229}function isSpreadElement(e){return e.kind===230}function isClassExpression(e){return e.kind===231}function isOmittedExpression(e){return e.kind===232}function isExpressionWithTypeArguments(e){return e.kind===233}function isAsExpression(e){return e.kind===234}function isSatisfiesExpression(e){return e.kind===238}function isNonNullExpression(e){return e.kind===235}function isMetaProperty(e){return e.kind===236}function isSyntheticExpression(e){return e.kind===237}function isPartiallyEmittedExpression(e){return e.kind===355}function isCommaListExpression(e){return e.kind===356}function isTemplateSpan(e){return e.kind===239}function isSemicolonClassElement(e){return e.kind===240}function isBlock(e){return e.kind===241}function isVariableStatement(e){return e.kind===243}function isEmptyStatement(e){return e.kind===242}function isExpressionStatement(e){return e.kind===244}function isIfStatement(e){return e.kind===245}function isDoStatement(e){return e.kind===246}function isWhileStatement(e){return e.kind===247}function isForStatement(e){return e.kind===248}function isForInStatement(e){return e.kind===249}function isForOfStatement(e){return e.kind===250}function isContinueStatement(e){return e.kind===251}function isBreakStatement(e){return e.kind===252}function isReturnStatement(e){return e.kind===253}function isWithStatement(e){return e.kind===254}function isSwitchStatement(e){return e.kind===255}function isLabeledStatement(e){return e.kind===256}function isThrowStatement(e){return e.kind===257}function isTryStatement(e){return e.kind===258}function isDebuggerStatement(e){return e.kind===259}function isVariableDeclaration(e){return e.kind===260}function isVariableDeclarationList(e){return e.kind===261}function isFunctionDeclaration(e){return e.kind===262}function isClassDeclaration(e){return e.kind===263}function isInterfaceDeclaration(e){return e.kind===264}function isTypeAliasDeclaration(e){return e.kind===265}function isEnumDeclaration(e){return e.kind===266}function isModuleDeclaration(e){return e.kind===267}function isModuleBlock(e){return e.kind===268}function isCaseBlock(e){return e.kind===269}function isNamespaceExportDeclaration(e){return e.kind===270}function isImportEqualsDeclaration(e){return e.kind===271}function isImportDeclaration(e){return e.kind===272}function isImportClause(e){return e.kind===273}function isImportTypeAssertionContainer(e){return e.kind===302}function isAssertClause(e){return e.kind===300}function isAssertEntry(e){return e.kind===301}function isImportAttributes(e){return e.kind===300}function isImportAttribute(e){return e.kind===301}function isNamespaceImport(e){return e.kind===274}function isNamespaceExport(e){return e.kind===280}function isNamedImports(e){return e.kind===275}function isImportSpecifier(e){return e.kind===276}function isExportAssignment(e){return e.kind===277}function isExportDeclaration(e){return e.kind===278}function isNamedExports(e){return e.kind===279}function isExportSpecifier(e){return e.kind===281}function isModuleExportName(e){return e.kind===80||e.kind===11}function isMissingDeclaration(e){return e.kind===282}function isNotEmittedStatement(e){return e.kind===353}function isSyntheticReference(e){return e.kind===357}function isExternalModuleReference(e){return e.kind===283}function isJsxElement(e){return e.kind===284}function isJsxSelfClosingElement(e){return e.kind===285}function isJsxOpeningElement(e){return e.kind===286}function isJsxClosingElement(e){return e.kind===287}function isJsxFragment(e){return e.kind===288}function isJsxOpeningFragment(e){return e.kind===289}function isJsxClosingFragment(e){return e.kind===290}function isJsxAttribute(e){return e.kind===291}function isJsxAttributes(e){return e.kind===292}function isJsxSpreadAttribute(e){return e.kind===293}function isJsxExpression(e){return e.kind===294}function isJsxNamespacedName(e){return e.kind===295}function isCaseClause(e){return e.kind===296}function isDefaultClause(e){return e.kind===297}function isHeritageClause(e){return e.kind===298}function isCatchClause(e){return e.kind===299}function isPropertyAssignment(e){return e.kind===303}function isShorthandPropertyAssignment(e){return e.kind===304}function isSpreadAssignment(e){return e.kind===305}function isEnumMember(e){return e.kind===306}function isSourceFile(e){return e.kind===307}function isBundle(e){return e.kind===308}function isJSDocTypeExpression(e){return e.kind===309}function isJSDocNameReference(e){return e.kind===310}function isJSDocMemberName(e){return e.kind===311}function isJSDocLink(e){return e.kind===324}function isJSDocLinkCode(e){return e.kind===325}function isJSDocLinkPlain(e){return e.kind===326}function isJSDocAllType(e){return e.kind===312}function isJSDocUnknownType(e){return e.kind===313}function isJSDocNullableType(e){return e.kind===314}function isJSDocNonNullableType(e){return e.kind===315}function isJSDocOptionalType(e){return e.kind===316}function isJSDocFunctionType(e){return e.kind===317}function isJSDocVariadicType(e){return e.kind===318}function isJSDocNamepathType(e){return e.kind===319}function isJSDoc(e){return e.kind===320}function isJSDocTypeLiteral(e){return e.kind===322}function isJSDocSignature(e){return e.kind===323}function isJSDocAugmentsTag(e){return e.kind===328}function isJSDocAuthorTag(e){return e.kind===330}function isJSDocClassTag(e){return e.kind===332}function isJSDocCallbackTag(e){return e.kind===338}function isJSDocPublicTag(e){return e.kind===333}function isJSDocPrivateTag(e){return e.kind===334}function isJSDocProtectedTag(e){return e.kind===335}function isJSDocReadonlyTag(e){return e.kind===336}function isJSDocOverrideTag(e){return e.kind===337}function isJSDocOverloadTag(e){return e.kind===339}function isJSDocDeprecatedTag(e){return e.kind===331}function isJSDocSeeTag(e){return e.kind===347}function isJSDocEnumTag(e){return e.kind===340}function isJSDocParameterTag(e){return e.kind===341}function isJSDocReturnTag(e){return e.kind===342}function isJSDocThisTag(e){return e.kind===343}function isJSDocTypeTag(e){return e.kind===344}function isJSDocTemplateTag(e){return e.kind===345}function isJSDocTypedefTag(e){return e.kind===346}function isJSDocUnknownTag(e){return e.kind===327}function isJSDocPropertyTag(e){return e.kind===348}function isJSDocImplementsTag(e){return e.kind===329}function isJSDocSatisfiesTag(e){return e.kind===350}function isJSDocThrowsTag(e){return e.kind===349}function isJSDocImportTag(e){return e.kind===351}function isSyntaxList(e){return e.kind===352}var Ei=new WeakMap;function getNodeChildren(e,t){var n;const r=e.kind;if(!isNodeKind(r)){return d}if(r===352){return e._children}return(n=Ei.get(t))==null?void 0:n.get(e)}function setNodeChildren(e,t,n){if(e.kind===352){S.fail("Should not need to re-set the children of a SyntaxList.")}let r=Ei.get(t);if(r===void 0){r=new WeakMap;Ei.set(t,r)}r.set(e,n);return n}function unsetNodeChildren(e,t){var n;if(e.kind===352){S.fail("Did not expect to unset the children of a SyntaxList.")}(n=Ei.get(t))==null?void 0:n.delete(e)}function transferSourceFileChildren(e,t){const n=Ei.get(e);if(n!==void 0){Ei.delete(e);Ei.set(t,n)}}function createEmptyExports(e){return e.createExportDeclaration(void 0,false,e.createNamedExports([]),void 0)}function createMemberAccessForPropertyName(e,t,n,r){if(isComputedPropertyName(n)){return setTextRange(e.createElementAccessExpression(t,n.expression),r)}else{const r=setTextRange(isMemberName(n)?e.createPropertyAccessExpression(t,n):e.createElementAccessExpression(t,n),n);addEmitFlags(r,128);return r}}function createReactNamespace(e,t){const n=wi.createIdentifier(e||"React");setParent(n,getParseTreeNode(t));return n}function createJsxFactoryExpressionFromEntityName(e,t,n){if(isQualifiedName(t)){const r=createJsxFactoryExpressionFromEntityName(e,t.left,n);const i=e.createIdentifier(idText(t.right));i.escapedText=t.right.escapedText;return e.createPropertyAccessExpression(r,i)}else{return createReactNamespace(idText(t),n)}}function createJsxFactoryExpression(e,t,n,r){return t?createJsxFactoryExpressionFromEntityName(e,t,r):e.createPropertyAccessExpression(createReactNamespace(n,r),"createElement")}function createJsxFragmentFactoryExpression(e,t,n,r){return t?createJsxFactoryExpressionFromEntityName(e,t,r):e.createPropertyAccessExpression(createReactNamespace(n,r),"Fragment")}function createExpressionForJsxElement(e,t,n,r,i,o){const a=[n];if(r){a.push(r)}if(i&&i.length>0){if(!r){a.push(e.createNull())}if(i.length>1){for(const e of i){startOnNewLine(e);a.push(e)}}else{a.push(i[0])}}return setTextRange(e.createCallExpression(t,void 0,a),o)}function createExpressionForJsxFragment(e,t,n,r,i,o,a){const s=createJsxFragmentFactoryExpression(e,n,r,o);const c=[s,e.createNull()];if(i&&i.length>0){if(i.length>1){for(const e of i){startOnNewLine(e);c.push(e)}}else{c.push(i[0])}}return setTextRange(e.createCallExpression(createJsxFactoryExpression(e,t,r,o),void 0,c),a)}function createForOfBindingStatement(e,t,n){if(isVariableDeclarationList(t)){const r=first(t.declarations);const i=e.updateVariableDeclaration(r,r.name,void 0,void 0,n);return setTextRange(e.createVariableStatement(void 0,e.updateVariableDeclarationList(t,[i])),t)}else{const r=setTextRange(e.createAssignment(t,n),t);return setTextRange(e.createExpressionStatement(r),t)}}function createExpressionFromEntityName(e,t){if(isQualifiedName(t)){const n=createExpressionFromEntityName(e,t.left);const r=setParent(setTextRange(e.cloneNode(t.right),t.right),t.right.parent);return setTextRange(e.createPropertyAccessExpression(n,r),t)}else{return setParent(setTextRange(e.cloneNode(t),t),t.parent)}}function createExpressionForPropertyName(e,t){if(isIdentifier(t)){return e.createStringLiteralFromNode(t)}else if(isComputedPropertyName(t)){return setParent(setTextRange(e.cloneNode(t.expression),t.expression),t.expression.parent)}else{return setParent(setTextRange(e.cloneNode(t),t),t.parent)}}function createExpressionForAccessorDeclaration(e,t,n,r,i){const{firstAccessor:o,getAccessor:a,setAccessor:s}=getAllAccessorDeclarations(t,n);if(n===o){return setTextRange(e.createObjectDefinePropertyCall(r,createExpressionForPropertyName(e,n.name),e.createPropertyDescriptor({enumerable:e.createFalse(),configurable:true,get:a&&setTextRange(setOriginalNode(e.createFunctionExpression(getModifiers(a),void 0,void 0,void 0,a.parameters,void 0,a.body),a),a),set:s&&setTextRange(setOriginalNode(e.createFunctionExpression(getModifiers(s),void 0,void 0,void 0,s.parameters,void 0,s.body),s),s)},!i)),o)}return void 0}function createExpressionForPropertyAssignment(e,t,n){return setOriginalNode(setTextRange(e.createAssignment(createMemberAccessForPropertyName(e,n,t.name,t.name),t.initializer),t),t)}function createExpressionForShorthandPropertyAssignment(e,t,n){return setOriginalNode(setTextRange(e.createAssignment(createMemberAccessForPropertyName(e,n,t.name,t.name),e.cloneNode(t.name)),t),t)}function createExpressionForMethodDeclaration(e,t,n){return setOriginalNode(setTextRange(e.createAssignment(createMemberAccessForPropertyName(e,n,t.name,t.name),setOriginalNode(setTextRange(e.createFunctionExpression(getModifiers(t),t.asteriskToken,void 0,void 0,t.parameters,void 0,t.body),t),t)),t),t)}function createExpressionForObjectLiteralElementLike(e,t,n,r){if(n.name&&isPrivateIdentifier(n.name)){S.failBadSyntaxKind(n.name,"Private identifiers are not allowed in object literals.")}switch(n.kind){case 177:case 178:return createExpressionForAccessorDeclaration(e,t.properties,n,r,!!t.multiLine);case 303:return createExpressionForPropertyAssignment(e,n,r);case 304:return createExpressionForShorthandPropertyAssignment(e,n,r);case 174:return createExpressionForMethodDeclaration(e,n,r)}}function expandPreOrPostfixIncrementOrDecrementExpression(e,t,n,r,i){const o=t.operator;S.assert(o===46||o===47,"Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression");const a=e.createTempVariable(r);n=e.createAssignment(a,n);setTextRange(n,t.operand);let s=isPrefixUnaryExpression(t)?e.createPrefixUnaryExpression(o,a):e.createPostfixUnaryExpression(a,o);setTextRange(s,t);if(i){s=e.createAssignment(i,s);setTextRange(s,t)}n=e.createComma(n,s);setTextRange(n,t);if(isPostfixUnaryExpression(t)){n=e.createComma(n,a);setTextRange(n,t)}return n}function isInternalName(e){return(getEmitFlags(e)&65536)!==0}function isLocalName(e){return(getEmitFlags(e)&32768)!==0}function isExportName(e){return(getEmitFlags(e)&16384)!==0}function isUseStrictPrologue(e){return isStringLiteral(e.expression)&&e.expression.text==="use strict"}function findUseStrictPrologue(e){for(const t of e){if(isPrologueDirective(t)){if(isUseStrictPrologue(t)){return t}}else{break}}return void 0}function startsWithUseStrict(e){const t=firstOrUndefined(e);return t!==void 0&&isPrologueDirective(t)&&isUseStrictPrologue(t)}function isCommaExpression(e){return e.kind===226&&e.operatorToken.kind===28}function isCommaSequence(e){return isCommaExpression(e)||isCommaListExpression(e)}function isJSDocTypeAssertion(e){return isParenthesizedExpression(e)&&isInJSFile(e)&&!!getJSDocTypeTag(e)}function getJSDocTypeAssertionType(e){const t=getJSDocType(e);S.assertIsDefined(t);return t}function isOuterExpression(e,t=63){switch(e.kind){case 217:if(t&-2147483648&&isJSDocTypeAssertion(e)){return false}return(t&1)!==0;case 216:case 234:return(t&2)!==0;case 238:return(t&(2|32))!==0;case 233:return(t&16)!==0;case 235:return(t&4)!==0;case 355:return(t&8)!==0}return false}function skipOuterExpressions(e,t=63){while(isOuterExpression(e,t)){e=e.expression}return e}function walkUpOuterExpressions(e,t=63){let n=e.parent;while(isOuterExpression(n,t)){n=n.parent;S.assert(n)}return n}function startOnNewLine(e){return setStartsOnNewLine(e,true)}function getExternalHelpersModuleName(e){const t=getOriginalNode(e,isSourceFile);const n=t&&t.emitNode;return n&&n.externalHelpersModuleName}function hasRecordedExternalHelpers(e){const t=getOriginalNode(e,isSourceFile);const n=t&&t.emitNode;return!!n&&(!!n.externalHelpersModuleName||!!n.externalHelpers)}function createExternalHelpersImportDeclarationIfNeeded(e,t,n,r,i,o,a){if(r.importHelpers&&isEffectiveExternalModule(n,r)){const s=Vn(r);const c=getImpliedNodeFormatForEmitWorker(n,r);const l=getImportedHelpers(n);if(s>=5&&s<=99||c===99||c===void 0&&s===200){if(l){const r=[];for(const e of l){const t=e.importName;if(t){pushIfUnique(r,t)}}if(some(r)){r.sort(compareStringsCaseSensitive);const i=e.createNamedImports(map(r,(r=>isFileLevelUniqueName(n,r)?e.createImportSpecifier(false,void 0,e.createIdentifier(r)):e.createImportSpecifier(false,e.createIdentifier(r),t.getUnscopedHelperName(r)))));const o=getOriginalNode(n,isSourceFile);const a=getOrCreateEmitNode(o);a.externalHelpers=true;const s=e.createImportDeclaration(void 0,e.createImportClause(false,void 0,i),e.createStringLiteral(cn),void 0);addInternalEmitFlags(s,2);return s}}}else{const t=getOrCreateExternalHelpersModuleNameIfNeeded(e,n,r,l,i,o||a);if(t){const n=e.createImportEqualsDeclaration(void 0,false,t,e.createExternalModuleReference(e.createStringLiteral(cn)));addInternalEmitFlags(n,2);return n}}}}function getImportedHelpers(e){return filter(getEmitHelpers(e),(e=>!e.scoped))}function getOrCreateExternalHelpersModuleNameIfNeeded(e,t,n,r,i,o){const a=getExternalHelpersModuleName(t);if(a){return a}const s=some(r)||(i||Kn(n)&&o)&&getEmitModuleFormatOfFileWorker(t,n)<4;if(s){const n=getOriginalNode(t,isSourceFile);const r=getOrCreateEmitNode(n);return r.externalHelpersModuleName||(r.externalHelpersModuleName=e.createUniqueName(cn))}}function getLocalNameForExternalImport(e,t,n){const r=getNamespaceDeclarationNode(t);if(r&&!isDefaultImport(t)&&!isExportNamespaceAsDefaultDeclaration(t)){const i=r.name;if(i.kind===11){return e.getGeneratedNameForNode(t)}return isGeneratedIdentifier(i)?i:e.createIdentifier(getSourceTextOfNodeFromSourceFile(n,i)||idText(i))}if(t.kind===272&&t.importClause){return e.getGeneratedNameForNode(t)}if(t.kind===278&&t.moduleSpecifier){return e.getGeneratedNameForNode(t)}return void 0}function getExternalModuleNameLiteral(e,t,n,r,i,o){const a=getExternalModuleName(t);if(a&&isStringLiteral(a)){return tryGetModuleNameFromDeclaration(t,r,e,i,o)||tryRenameExternalModule(e,a,n)||e.cloneNode(a)}return void 0}function tryRenameExternalModule(e,t,n){const r=n.renamedDependencies&&n.renamedDependencies.get(t.text);return r?e.createStringLiteral(r):void 0}function tryGetModuleNameFromFile(e,t,n,r){if(!t){return void 0}if(t.moduleName){return e.createStringLiteral(t.moduleName)}if(!t.isDeclarationFile&&r.outFile){return e.createStringLiteral(getExternalModuleNameFromPath(n,t.fileName))}return void 0}function tryGetModuleNameFromDeclaration(e,t,n,r,i){return tryGetModuleNameFromFile(n,r.getExternalModuleFileFromDeclaration(e),t,i)}function getInitializerOfBindingOrAssignmentElement(e){if(isDeclarationBindingElement(e)){return e.initializer}if(isPropertyAssignment(e)){const t=e.initializer;return isAssignmentExpression(t,true)?t.right:void 0}if(isShorthandPropertyAssignment(e)){return e.objectAssignmentInitializer}if(isAssignmentExpression(e,true)){return e.right}if(isSpreadElement(e)){return getInitializerOfBindingOrAssignmentElement(e.expression)}}function getTargetOfBindingOrAssignmentElement(e){if(isDeclarationBindingElement(e)){return e.name}if(isObjectLiteralElementLike(e)){switch(e.kind){case 303:return getTargetOfBindingOrAssignmentElement(e.initializer);case 304:return e.name;case 305:return getTargetOfBindingOrAssignmentElement(e.expression)}return void 0}if(isAssignmentExpression(e,true)){return getTargetOfBindingOrAssignmentElement(e.left)}if(isSpreadElement(e)){return getTargetOfBindingOrAssignmentElement(e.expression)}return e}function getRestIndicatorOfBindingOrAssignmentElement(e){switch(e.kind){case 169:case 208:return e.dotDotDotToken;case 230:case 305:return e}return void 0}function getPropertyNameOfBindingOrAssignmentElement(e){const t=tryGetPropertyNameOfBindingOrAssignmentElement(e);S.assert(!!t||isSpreadAssignment(e),"Invalid property name for binding element.");return t}function tryGetPropertyNameOfBindingOrAssignmentElement(e){switch(e.kind){case 208:if(e.propertyName){const t=e.propertyName;if(isPrivateIdentifier(t)){return S.failBadSyntaxKind(t)}return isComputedPropertyName(t)&&isStringOrNumericLiteral(t.expression)?t.expression:t}break;case 303:if(e.name){const t=e.name;if(isPrivateIdentifier(t)){return S.failBadSyntaxKind(t)}return isComputedPropertyName(t)&&isStringOrNumericLiteral(t.expression)?t.expression:t}break;case 305:if(e.name&&isPrivateIdentifier(e.name)){return S.failBadSyntaxKind(e.name)}return e.name}const t=getTargetOfBindingOrAssignmentElement(e);if(t&&isPropertyName(t)){return t}}function isStringOrNumericLiteral(e){const t=e.kind;return t===11||t===9}function getElementsOfBindingOrAssignmentPattern(e){switch(e.kind){case 206:case 207:case 209:return e.elements;case 210:return e.properties}}function getJSDocTypeAliasName(e){if(e){let t=e;while(true){if(isIdentifier(t)||!t.body){return isIdentifier(t)?t:t.name}t=t.body}}}function canHaveIllegalType(e){const t=e.kind;return t===176||t===178}function canHaveIllegalTypeParameters(e){const t=e.kind;return t===176||t===177||t===178}function canHaveIllegalDecorators(e){const t=e.kind;return t===303||t===304||t===262||t===176||t===181||t===175||t===282||t===243||t===264||t===265||t===266||t===267||t===271||t===272||t===270||t===278||t===277}function canHaveIllegalModifiers(e){const t=e.kind;return t===175||t===303||t===304||t===282||t===270}function isQuestionOrExclamationToken(e){return isQuestionToken(e)||isExclamationToken(e)}function isIdentifierOrThisTypeNode(e){return isIdentifier(e)||isThisTypeNode(e)}function isReadonlyKeywordOrPlusOrMinusToken(e){return isReadonlyKeyword(e)||isPlusToken(e)||isMinusToken(e)}function isQuestionOrPlusOrMinusToken(e){return isQuestionToken(e)||isPlusToken(e)||isMinusToken(e)}function isModuleName(e){return isIdentifier(e)||isStringLiteral(e)}function isExponentiationOperator(e){return e===43}function isMultiplicativeOperator(e){return e===42||e===44||e===45}function isMultiplicativeOperatorOrHigher(e){return isExponentiationOperator(e)||isMultiplicativeOperator(e)}function isAdditiveOperator(e){return e===40||e===41}function isAdditiveOperatorOrHigher(e){return isAdditiveOperator(e)||isMultiplicativeOperatorOrHigher(e)}function isShiftOperator(e){return e===48||e===49||e===50}function isShiftOperatorOrHigher(e){return isShiftOperator(e)||isAdditiveOperatorOrHigher(e)}function isRelationalOperator(e){return e===30||e===33||e===32||e===34||e===104||e===103}function isRelationalOperatorOrHigher(e){return isRelationalOperator(e)||isShiftOperatorOrHigher(e)}function isEqualityOperator(e){return e===35||e===37||e===36||e===38}function isEqualityOperatorOrHigher(e){return isEqualityOperator(e)||isRelationalOperatorOrHigher(e)}function isBitwiseOperator(e){return e===51||e===52||e===53}function isBitwiseOperatorOrHigher(e){return isBitwiseOperator(e)||isEqualityOperatorOrHigher(e)}function isLogicalOperator2(e){return e===56||e===57}function isLogicalOperatorOrHigher(e){return isLogicalOperator2(e)||isBitwiseOperatorOrHigher(e)}function isAssignmentOperatorOrHigher(e){return e===61||isLogicalOperatorOrHigher(e)||isAssignmentOperator(e)}function isBinaryOperator(e){return isAssignmentOperatorOrHigher(e)||e===28}function isBinaryOperatorToken(e){return isBinaryOperator(e.kind)}var Ni;(e=>{function enter(e,t,n,r,i,o,a){const s=t>0?i[t-1]:void 0;S.assertEqual(n[t],enter);i[t]=e.onEnter(r[t],s,a);n[t]=nextState(e,enter);return t}e.enter=enter;function left(e,t,n,r,i,o,a){S.assertEqual(n[t],left);S.assertIsDefined(e.onLeft);n[t]=nextState(e,left);const s=e.onLeft(r[t].left,i[t],r[t]);if(s){checkCircularity(t,r,s);return pushStack(t,n,r,i,s)}return t}e.left=left;function operator(e,t,n,r,i,o,a){S.assertEqual(n[t],operator);S.assertIsDefined(e.onOperator);n[t]=nextState(e,operator);e.onOperator(r[t].operatorToken,i[t],r[t]);return t}e.operator=operator;function right(e,t,n,r,i,o,a){S.assertEqual(n[t],right);S.assertIsDefined(e.onRight);n[t]=nextState(e,right);const s=e.onRight(r[t].right,i[t],r[t]);if(s){checkCircularity(t,r,s);return pushStack(t,n,r,i,s)}return t}e.right=right;function exit(e,t,n,r,i,o,a){S.assertEqual(n[t],exit);n[t]=nextState(e,exit);const s=e.onExit(r[t],i[t]);if(t>0){t--;if(e.foldState){const r=n[t]===exit?"right":"left";i[t]=e.foldState(i[t],s,r)}}else{o.value=s}return t}e.exit=exit;function done(e,t,n,r,i,o,a){S.assertEqual(n[t],done);return t}e.done=done;function nextState(e,t){switch(t){case enter:if(e.onLeft)return left;case left:if(e.onOperator)return operator;case operator:if(e.onRight)return right;case right:return exit;case exit:return done;case done:return done;default:S.fail("Invalid state")}}e.nextState=nextState;function pushStack(e,t,n,r,i){e++;t[e]=enter;n[e]=i;r[e]=void 0;return e}function checkCircularity(e,t,n){if(S.shouldAssert(2)){while(e>=0){S.assert(t[e]!==n,"Circular traversal detected.");e--}}}})(Ni||(Ni={}));var ki=class{constructor(e,t,n,r,i,o){this.onEnter=e;this.onLeft=t;this.onOperator=n;this.onRight=r;this.onExit=i;this.foldState=o}};function createBinaryExpressionTrampoline(e,t,n,r,i,o){const a=new ki(e,t,n,r,i,o);return trampoline;function trampoline(e,t){const n={value:void 0};const r=[Ni.enter];const i=[e];const o=[void 0];let s=0;while(r[s]!==Ni.done){s=r[s](a,s,r,i,o,n,t)}S.assertEqual(s,0);return n.value}}function isExportOrDefaultKeywordKind(e){return e===95||e===90}function isExportOrDefaultModifier(e){const t=e.kind;return isExportOrDefaultKeywordKind(t)}function elideNodes(e,t){if(t===void 0)return void 0;if(t.length===0)return t;return setTextRange(e.createNodeArray([],t.hasTrailingComma),t)}function getNodeForGeneratedName(e){var t;const n=e.emitNode.autoGenerate;if(n.flags&4){const r=n.id;let i=e;let o=i.original;while(o){i=o;const e=(t=i.emitNode)==null?void 0:t.autoGenerate;if(isMemberName(i)&&(e===void 0||!!(e.flags&4)&&e.id!==r)){break}o=i.original}return i}return e}function formatGeneratedNamePart(e,t){return typeof e==="object"?formatGeneratedName(false,e.prefix,e.node,e.suffix,t):typeof e==="string"?e.length>0&&e.charCodeAt(0)===35?e.slice(1):e:""}function formatIdentifier(e,t){return typeof e==="string"?e:formatIdentifierWorker(e,S.checkDefined(t))}function formatIdentifierWorker(e,t){return isGeneratedPrivateIdentifier(e)?t(e).slice(1):isGeneratedIdentifier(e)?t(e):isPrivateIdentifier(e)?e.escapedText.slice(1):idText(e)}function formatGeneratedName(e,t,n,r,i){t=formatGeneratedNamePart(t,i);r=formatGeneratedNamePart(r,i);n=formatIdentifier(n,i);return`${e?"#":""}${t}${n}${r}`}function createAccessorPropertyBackingField(e,t,n,r){return e.updatePropertyDeclaration(t,n,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage"),void 0,void 0,r)}function createAccessorPropertyGetRedirector(e,t,n,r,i=e.createThis()){return e.createGetAccessorDeclaration(n,r,[],void 0,e.createBlock([e.createReturnStatement(e.createPropertyAccessExpression(i,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage")))]))}function createAccessorPropertySetRedirector(e,t,n,r,i=e.createThis()){return e.createSetAccessorDeclaration(n,r,[e.createParameterDeclaration(void 0,void 0,"value")],e.createBlock([e.createExpressionStatement(e.createAssignment(e.createPropertyAccessExpression(i,e.getGeneratedPrivateNameForNode(t.name,void 0,"_accessor_storage")),e.createIdentifier("value")))]))}function findComputedPropertyNameCacheAssignment(e){let t=e.expression;while(true){t=skipOuterExpressions(t);if(isCommaListExpression(t)){t=last(t.elements);continue}if(isCommaExpression(t)){t=t.right;continue}if(isAssignmentExpression(t,true)&&isGeneratedIdentifier(t.left)){return t}break}}function isSyntheticParenthesizedExpression(e){return isParenthesizedExpression(e)&&nodeIsSynthesized(e)&&!e.emitNode}function flattenCommaListWorker(e,t){if(isSyntheticParenthesizedExpression(e)){flattenCommaListWorker(e.expression,t)}else if(isCommaExpression(e)){flattenCommaListWorker(e.left,t);flattenCommaListWorker(e.right,t)}else if(isCommaListExpression(e)){for(const n of e.elements){flattenCommaListWorker(n,t)}}else{t.push(e)}}function flattenCommaList(e){const t=[];flattenCommaListWorker(e,t);return t}function containsObjectRestOrSpread(e){if(e.transformFlags&65536)return true;if(e.transformFlags&128){for(const t of getElementsOfBindingOrAssignmentPattern(e)){const e=getTargetOfBindingOrAssignmentElement(t);if(e&&isAssignmentPattern(e)){if(e.transformFlags&65536){return true}if(e.transformFlags&128){if(containsObjectRestOrSpread(e))return true}}}}return false}function setTextRange(e,t){return t?setTextRangePosEnd(e,t.pos,t.end):e}function canHaveModifiers(e){const t=e.kind;return t===168||t===169||t===171||t===172||t===173||t===174||t===176||t===177||t===178||t===181||t===185||t===218||t===219||t===231||t===243||t===262||t===263||t===264||t===265||t===266||t===267||t===271||t===272||t===277||t===278}function canHaveDecorators(e){const t=e.kind;return t===169||t===172||t===174||t===177||t===178||t===231||t===263}var Fi;var Pi;var Di;var Ii;var Ai;var Oi={createBaseSourceFileNode:e=>new(Ai||(Ai=Rn.getSourceFileConstructor()))(e,-1,-1),createBaseIdentifierNode:e=>new(Di||(Di=Rn.getIdentifierConstructor()))(e,-1,-1),createBasePrivateIdentifierNode:e=>new(Ii||(Ii=Rn.getPrivateIdentifierConstructor()))(e,-1,-1),createBaseTokenNode:e=>new(Pi||(Pi=Rn.getTokenConstructor()))(e,-1,-1),createBaseNode:e=>new(Fi||(Fi=Rn.getNodeConstructor()))(e,-1,-1)};var wi=createNodeFactory(1,Oi);function visitNode2(e,t){return t&&e(t)}function visitNodes(e,t,n){if(n){if(t){return t(n)}for(const t of n){const n=e(t);if(n){return n}}}}function isJSDocLikeText(e,t){return e.charCodeAt(t+1)===42&&e.charCodeAt(t+2)===42&&e.charCodeAt(t+3)!==47}function isFileProbablyExternalModule(e){return forEach(e.statements,isAnExternalModuleIndicatorNode)||getImportMetaIfNecessary(e)}function isAnExternalModuleIndicatorNode(e){return canHaveModifiers(e)&&hasModifierOfKind(e,95)||isImportEqualsDeclaration(e)&&isExternalModuleReference(e.moduleReference)||isImportDeclaration(e)||isExportAssignment(e)||isExportDeclaration(e)?e:void 0}function getImportMetaIfNecessary(e){return e.flags&8388608?walkTreeForImportMeta(e):void 0}function walkTreeForImportMeta(e){return isImportMeta2(e)?e:forEachChild(e,walkTreeForImportMeta)}function hasModifierOfKind(e,t){return some(e.modifiers,(e=>e.kind===t))}function isImportMeta2(e){return isMetaProperty(e)&&e.keywordToken===102&&e.name.escapedText==="meta"}var Li={[166]:function forEachChildInQualifiedName(e,t,n){return visitNode2(t,e.left)||visitNode2(t,e.right)},[168]:function forEachChildInTypeParameter(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNode2(t,e.constraint)||visitNode2(t,e.default)||visitNode2(t,e.expression)},[304]:function forEachChildInShorthandPropertyAssignment(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNode2(t,e.questionToken)||visitNode2(t,e.exclamationToken)||visitNode2(t,e.equalsToken)||visitNode2(t,e.objectAssignmentInitializer)},[305]:function forEachChildInSpreadAssignment(e,t,n){return visitNode2(t,e.expression)},[169]:function forEachChildInParameter(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.dotDotDotToken)||visitNode2(t,e.name)||visitNode2(t,e.questionToken)||visitNode2(t,e.type)||visitNode2(t,e.initializer)},[172]:function forEachChildInPropertyDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNode2(t,e.questionToken)||visitNode2(t,e.exclamationToken)||visitNode2(t,e.type)||visitNode2(t,e.initializer)},[171]:function forEachChildInPropertySignature(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNode2(t,e.questionToken)||visitNode2(t,e.type)||visitNode2(t,e.initializer)},[303]:function forEachChildInPropertyAssignment(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNode2(t,e.questionToken)||visitNode2(t,e.exclamationToken)||visitNode2(t,e.initializer)},[260]:function forEachChildInVariableDeclaration(e,t,n){return visitNode2(t,e.name)||visitNode2(t,e.exclamationToken)||visitNode2(t,e.type)||visitNode2(t,e.initializer)},[208]:function forEachChildInBindingElement(e,t,n){return visitNode2(t,e.dotDotDotToken)||visitNode2(t,e.propertyName)||visitNode2(t,e.name)||visitNode2(t,e.initializer)},[181]:function forEachChildInIndexSignature(e,t,n){return visitNodes(t,n,e.modifiers)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)},[185]:function forEachChildInConstructorType(e,t,n){return visitNodes(t,n,e.modifiers)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)},[184]:function forEachChildInFunctionType(e,t,n){return visitNodes(t,n,e.modifiers)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)},[179]:forEachChildInCallOrConstructSignature,[180]:forEachChildInCallOrConstructSignature,[174]:function forEachChildInMethodDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.asteriskToken)||visitNode2(t,e.name)||visitNode2(t,e.questionToken)||visitNode2(t,e.exclamationToken)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)||visitNode2(t,e.body)},[173]:function forEachChildInMethodSignature(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNode2(t,e.questionToken)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)},[176]:function forEachChildInConstructor(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)||visitNode2(t,e.body)},[177]:function forEachChildInGetAccessor(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)||visitNode2(t,e.body)},[178]:function forEachChildInSetAccessor(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)||visitNode2(t,e.body)},[262]:function forEachChildInFunctionDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.asteriskToken)||visitNode2(t,e.name)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)||visitNode2(t,e.body)},[218]:function forEachChildInFunctionExpression(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.asteriskToken)||visitNode2(t,e.name)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)||visitNode2(t,e.body)},[219]:function forEachChildInArrowFunction(e,t,n){return visitNodes(t,n,e.modifiers)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)||visitNode2(t,e.equalsGreaterThanToken)||visitNode2(t,e.body)},[175]:function forEachChildInClassStaticBlockDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.body)},[183]:function forEachChildInTypeReference(e,t,n){return visitNode2(t,e.typeName)||visitNodes(t,n,e.typeArguments)},[182]:function forEachChildInTypePredicate(e,t,n){return visitNode2(t,e.assertsModifier)||visitNode2(t,e.parameterName)||visitNode2(t,e.type)},[186]:function forEachChildInTypeQuery(e,t,n){return visitNode2(t,e.exprName)||visitNodes(t,n,e.typeArguments)},[187]:function forEachChildInTypeLiteral(e,t,n){return visitNodes(t,n,e.members)},[188]:function forEachChildInArrayType(e,t,n){return visitNode2(t,e.elementType)},[189]:function forEachChildInTupleType(e,t,n){return visitNodes(t,n,e.elements)},[192]:forEachChildInUnionOrIntersectionType,[193]:forEachChildInUnionOrIntersectionType,[194]:function forEachChildInConditionalType(e,t,n){return visitNode2(t,e.checkType)||visitNode2(t,e.extendsType)||visitNode2(t,e.trueType)||visitNode2(t,e.falseType)},[195]:function forEachChildInInferType(e,t,n){return visitNode2(t,e.typeParameter)},[205]:function forEachChildInImportType(e,t,n){return visitNode2(t,e.argument)||visitNode2(t,e.attributes)||visitNode2(t,e.qualifier)||visitNodes(t,n,e.typeArguments)},[302]:function forEachChildInImportTypeAssertionContainer(e,t,n){return visitNode2(t,e.assertClause)},[196]:forEachChildInParenthesizedTypeOrTypeOperator,[198]:forEachChildInParenthesizedTypeOrTypeOperator,[199]:function forEachChildInIndexedAccessType(e,t,n){return visitNode2(t,e.objectType)||visitNode2(t,e.indexType)},[200]:function forEachChildInMappedType(e,t,n){return visitNode2(t,e.readonlyToken)||visitNode2(t,e.typeParameter)||visitNode2(t,e.nameType)||visitNode2(t,e.questionToken)||visitNode2(t,e.type)||visitNodes(t,n,e.members)},[201]:function forEachChildInLiteralType(e,t,n){return visitNode2(t,e.literal)},[202]:function forEachChildInNamedTupleMember(e,t,n){return visitNode2(t,e.dotDotDotToken)||visitNode2(t,e.name)||visitNode2(t,e.questionToken)||visitNode2(t,e.type)},[206]:forEachChildInObjectOrArrayBindingPattern,[207]:forEachChildInObjectOrArrayBindingPattern,[209]:function forEachChildInArrayLiteralExpression(e,t,n){return visitNodes(t,n,e.elements)},[210]:function forEachChildInObjectLiteralExpression(e,t,n){return visitNodes(t,n,e.properties)},[211]:function forEachChildInPropertyAccessExpression(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.questionDotToken)||visitNode2(t,e.name)},[212]:function forEachChildInElementAccessExpression(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.questionDotToken)||visitNode2(t,e.argumentExpression)},[213]:forEachChildInCallOrNewExpression,[214]:forEachChildInCallOrNewExpression,[215]:function forEachChildInTaggedTemplateExpression(e,t,n){return visitNode2(t,e.tag)||visitNode2(t,e.questionDotToken)||visitNodes(t,n,e.typeArguments)||visitNode2(t,e.template)},[216]:function forEachChildInTypeAssertionExpression(e,t,n){return visitNode2(t,e.type)||visitNode2(t,e.expression)},[217]:function forEachChildInParenthesizedExpression(e,t,n){return visitNode2(t,e.expression)},[220]:function forEachChildInDeleteExpression(e,t,n){return visitNode2(t,e.expression)},[221]:function forEachChildInTypeOfExpression(e,t,n){return visitNode2(t,e.expression)},[222]:function forEachChildInVoidExpression(e,t,n){return visitNode2(t,e.expression)},[224]:function forEachChildInPrefixUnaryExpression(e,t,n){return visitNode2(t,e.operand)},[229]:function forEachChildInYieldExpression(e,t,n){return visitNode2(t,e.asteriskToken)||visitNode2(t,e.expression)},[223]:function forEachChildInAwaitExpression(e,t,n){return visitNode2(t,e.expression)},[225]:function forEachChildInPostfixUnaryExpression(e,t,n){return visitNode2(t,e.operand)},[226]:function forEachChildInBinaryExpression(e,t,n){return visitNode2(t,e.left)||visitNode2(t,e.operatorToken)||visitNode2(t,e.right)},[234]:function forEachChildInAsExpression(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.type)},[235]:function forEachChildInNonNullExpression(e,t,n){return visitNode2(t,e.expression)},[238]:function forEachChildInSatisfiesExpression(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.type)},[236]:function forEachChildInMetaProperty(e,t,n){return visitNode2(t,e.name)},[227]:function forEachChildInConditionalExpression(e,t,n){return visitNode2(t,e.condition)||visitNode2(t,e.questionToken)||visitNode2(t,e.whenTrue)||visitNode2(t,e.colonToken)||visitNode2(t,e.whenFalse)},[230]:function forEachChildInSpreadElement(e,t,n){return visitNode2(t,e.expression)},[241]:forEachChildInBlock,[268]:forEachChildInBlock,[307]:function forEachChildInSourceFile(e,t,n){return visitNodes(t,n,e.statements)||visitNode2(t,e.endOfFileToken)},[243]:function forEachChildInVariableStatement(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.declarationList)},[261]:function forEachChildInVariableDeclarationList(e,t,n){return visitNodes(t,n,e.declarations)},[244]:function forEachChildInExpressionStatement(e,t,n){return visitNode2(t,e.expression)},[245]:function forEachChildInIfStatement(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.thenStatement)||visitNode2(t,e.elseStatement)},[246]:function forEachChildInDoStatement(e,t,n){return visitNode2(t,e.statement)||visitNode2(t,e.expression)},[247]:function forEachChildInWhileStatement(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.statement)},[248]:function forEachChildInForStatement(e,t,n){return visitNode2(t,e.initializer)||visitNode2(t,e.condition)||visitNode2(t,e.incrementor)||visitNode2(t,e.statement)},[249]:function forEachChildInForInStatement(e,t,n){return visitNode2(t,e.initializer)||visitNode2(t,e.expression)||visitNode2(t,e.statement)},[250]:function forEachChildInForOfStatement(e,t,n){return visitNode2(t,e.awaitModifier)||visitNode2(t,e.initializer)||visitNode2(t,e.expression)||visitNode2(t,e.statement)},[251]:forEachChildInContinueOrBreakStatement,[252]:forEachChildInContinueOrBreakStatement,[253]:function forEachChildInReturnStatement(e,t,n){return visitNode2(t,e.expression)},[254]:function forEachChildInWithStatement(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.statement)},[255]:function forEachChildInSwitchStatement(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.caseBlock)},[269]:function forEachChildInCaseBlock(e,t,n){return visitNodes(t,n,e.clauses)},[296]:function forEachChildInCaseClause(e,t,n){return visitNode2(t,e.expression)||visitNodes(t,n,e.statements)},[297]:function forEachChildInDefaultClause(e,t,n){return visitNodes(t,n,e.statements)},[256]:function forEachChildInLabeledStatement(e,t,n){return visitNode2(t,e.label)||visitNode2(t,e.statement)},[257]:function forEachChildInThrowStatement(e,t,n){return visitNode2(t,e.expression)},[258]:function forEachChildInTryStatement(e,t,n){return visitNode2(t,e.tryBlock)||visitNode2(t,e.catchClause)||visitNode2(t,e.finallyBlock)},[299]:function forEachChildInCatchClause(e,t,n){return visitNode2(t,e.variableDeclaration)||visitNode2(t,e.block)},[170]:function forEachChildInDecorator(e,t,n){return visitNode2(t,e.expression)},[263]:forEachChildInClassDeclarationOrExpression,[231]:forEachChildInClassDeclarationOrExpression,[264]:function forEachChildInInterfaceDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.heritageClauses)||visitNodes(t,n,e.members)},[265]:function forEachChildInTypeAliasDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNodes(t,n,e.typeParameters)||visitNode2(t,e.type)},[266]:function forEachChildInEnumDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNodes(t,n,e.members)},[306]:function forEachChildInEnumMember(e,t,n){return visitNode2(t,e.name)||visitNode2(t,e.initializer)},[267]:function forEachChildInModuleDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNode2(t,e.body)},[271]:function forEachChildInImportEqualsDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNode2(t,e.moduleReference)},[272]:function forEachChildInImportDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.importClause)||visitNode2(t,e.moduleSpecifier)||visitNode2(t,e.attributes)},[273]:function forEachChildInImportClause(e,t,n){return visitNode2(t,e.name)||visitNode2(t,e.namedBindings)},[300]:function forEachChildInImportAttributes(e,t,n){return visitNodes(t,n,e.elements)},[301]:function forEachChildInImportAttribute(e,t,n){return visitNode2(t,e.name)||visitNode2(t,e.value)},[270]:function forEachChildInNamespaceExportDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)},[274]:function forEachChildInNamespaceImport(e,t,n){return visitNode2(t,e.name)},[280]:function forEachChildInNamespaceExport(e,t,n){return visitNode2(t,e.name)},[275]:forEachChildInNamedImportsOrExports,[279]:forEachChildInNamedImportsOrExports,[278]:function forEachChildInExportDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.exportClause)||visitNode2(t,e.moduleSpecifier)||visitNode2(t,e.attributes)},[276]:forEachChildInImportOrExportSpecifier,[281]:forEachChildInImportOrExportSpecifier,[277]:function forEachChildInExportAssignment(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.expression)},[228]:function forEachChildInTemplateExpression(e,t,n){return visitNode2(t,e.head)||visitNodes(t,n,e.templateSpans)},[239]:function forEachChildInTemplateSpan(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.literal)},[203]:function forEachChildInTemplateLiteralType(e,t,n){return visitNode2(t,e.head)||visitNodes(t,n,e.templateSpans)},[204]:function forEachChildInTemplateLiteralTypeSpan(e,t,n){return visitNode2(t,e.type)||visitNode2(t,e.literal)},[167]:function forEachChildInComputedPropertyName(e,t,n){return visitNode2(t,e.expression)},[298]:function forEachChildInHeritageClause(e,t,n){return visitNodes(t,n,e.types)},[233]:function forEachChildInExpressionWithTypeArguments(e,t,n){return visitNode2(t,e.expression)||visitNodes(t,n,e.typeArguments)},[283]:function forEachChildInExternalModuleReference(e,t,n){return visitNode2(t,e.expression)},[282]:function forEachChildInMissingDeclaration(e,t,n){return visitNodes(t,n,e.modifiers)},[356]:function forEachChildInCommaListExpression(e,t,n){return visitNodes(t,n,e.elements)},[284]:function forEachChildInJsxElement(e,t,n){return visitNode2(t,e.openingElement)||visitNodes(t,n,e.children)||visitNode2(t,e.closingElement)},[288]:function forEachChildInJsxFragment(e,t,n){return visitNode2(t,e.openingFragment)||visitNodes(t,n,e.children)||visitNode2(t,e.closingFragment)},[285]:forEachChildInJsxOpeningOrSelfClosingElement,[286]:forEachChildInJsxOpeningOrSelfClosingElement,[292]:function forEachChildInJsxAttributes(e,t,n){return visitNodes(t,n,e.properties)},[291]:function forEachChildInJsxAttribute(e,t,n){return visitNode2(t,e.name)||visitNode2(t,e.initializer)},[293]:function forEachChildInJsxSpreadAttribute(e,t,n){return visitNode2(t,e.expression)},[294]:function forEachChildInJsxExpression(e,t,n){return visitNode2(t,e.dotDotDotToken)||visitNode2(t,e.expression)},[287]:function forEachChildInJsxClosingElement(e,t,n){return visitNode2(t,e.tagName)},[295]:function forEachChildInJsxNamespacedName(e,t,n){return visitNode2(t,e.namespace)||visitNode2(t,e.name)},[190]:forEachChildInOptionalRestOrJSDocParameterModifier,[191]:forEachChildInOptionalRestOrJSDocParameterModifier,[309]:forEachChildInOptionalRestOrJSDocParameterModifier,[315]:forEachChildInOptionalRestOrJSDocParameterModifier,[314]:forEachChildInOptionalRestOrJSDocParameterModifier,[316]:forEachChildInOptionalRestOrJSDocParameterModifier,[318]:forEachChildInOptionalRestOrJSDocParameterModifier,[317]:function forEachChildInJSDocFunctionType(e,t,n){return visitNodes(t,n,e.parameters)||visitNode2(t,e.type)},[320]:function forEachChildInJSDoc(e,t,n){return(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))||visitNodes(t,n,e.tags)},[347]:function forEachChildInJSDocSeeTag(e,t,n){return visitNode2(t,e.tagName)||visitNode2(t,e.name)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))},[310]:function forEachChildInJSDocNameReference(e,t,n){return visitNode2(t,e.name)},[311]:function forEachChildInJSDocMemberName(e,t,n){return visitNode2(t,e.left)||visitNode2(t,e.right)},[341]:forEachChildInJSDocParameterOrPropertyTag,[348]:forEachChildInJSDocParameterOrPropertyTag,[330]:function forEachChildInJSDocAuthorTag(e,t,n){return visitNode2(t,e.tagName)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))},[329]:function forEachChildInJSDocImplementsTag(e,t,n){return visitNode2(t,e.tagName)||visitNode2(t,e.class)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))},[328]:function forEachChildInJSDocAugmentsTag(e,t,n){return visitNode2(t,e.tagName)||visitNode2(t,e.class)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))},[345]:function forEachChildInJSDocTemplateTag(e,t,n){return visitNode2(t,e.tagName)||visitNode2(t,e.constraint)||visitNodes(t,n,e.typeParameters)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))},[346]:function forEachChildInJSDocTypedefTag(e,t,n){return visitNode2(t,e.tagName)||(e.typeExpression&&e.typeExpression.kind===309?visitNode2(t,e.typeExpression)||visitNode2(t,e.fullName)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment)):visitNode2(t,e.fullName)||visitNode2(t,e.typeExpression)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment)))},[338]:function forEachChildInJSDocCallbackTag(e,t,n){return visitNode2(t,e.tagName)||visitNode2(t,e.fullName)||visitNode2(t,e.typeExpression)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))},[342]:forEachChildInJSDocTypeLikeTag,[344]:forEachChildInJSDocTypeLikeTag,[343]:forEachChildInJSDocTypeLikeTag,[340]:forEachChildInJSDocTypeLikeTag,[350]:forEachChildInJSDocTypeLikeTag,[349]:forEachChildInJSDocTypeLikeTag,[339]:forEachChildInJSDocTypeLikeTag,[323]:function forEachChildInJSDocSignature(e,t,n){return forEach(e.typeParameters,t)||forEach(e.parameters,t)||visitNode2(t,e.type)},[324]:forEachChildInJSDocLinkCodeOrPlain,[325]:forEachChildInJSDocLinkCodeOrPlain,[326]:forEachChildInJSDocLinkCodeOrPlain,[322]:function forEachChildInJSDocTypeLiteral(e,t,n){return forEach(e.jsDocPropertyTags,t)},[327]:forEachChildInJSDocTag,[332]:forEachChildInJSDocTag,[333]:forEachChildInJSDocTag,[334]:forEachChildInJSDocTag,[335]:forEachChildInJSDocTag,[336]:forEachChildInJSDocTag,[331]:forEachChildInJSDocTag,[337]:forEachChildInJSDocTag,[351]:forEachChildInJSDocImportTag,[355]:forEachChildInPartiallyEmittedExpression};function forEachChildInCallOrConstructSignature(e,t,n){return visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.parameters)||visitNode2(t,e.type)}function forEachChildInUnionOrIntersectionType(e,t,n){return visitNodes(t,n,e.types)}function forEachChildInParenthesizedTypeOrTypeOperator(e,t,n){return visitNode2(t,e.type)}function forEachChildInObjectOrArrayBindingPattern(e,t,n){return visitNodes(t,n,e.elements)}function forEachChildInCallOrNewExpression(e,t,n){return visitNode2(t,e.expression)||visitNode2(t,e.questionDotToken)||visitNodes(t,n,e.typeArguments)||visitNodes(t,n,e.arguments)}function forEachChildInBlock(e,t,n){return visitNodes(t,n,e.statements)}function forEachChildInContinueOrBreakStatement(e,t,n){return visitNode2(t,e.label)}function forEachChildInClassDeclarationOrExpression(e,t,n){return visitNodes(t,n,e.modifiers)||visitNode2(t,e.name)||visitNodes(t,n,e.typeParameters)||visitNodes(t,n,e.heritageClauses)||visitNodes(t,n,e.members)}function forEachChildInNamedImportsOrExports(e,t,n){return visitNodes(t,n,e.elements)}function forEachChildInImportOrExportSpecifier(e,t,n){return visitNode2(t,e.propertyName)||visitNode2(t,e.name)}function forEachChildInJsxOpeningOrSelfClosingElement(e,t,n){return visitNode2(t,e.tagName)||visitNodes(t,n,e.typeArguments)||visitNode2(t,e.attributes)}function forEachChildInOptionalRestOrJSDocParameterModifier(e,t,n){return visitNode2(t,e.type)}function forEachChildInJSDocParameterOrPropertyTag(e,t,n){return visitNode2(t,e.tagName)||(e.isNameFirst?visitNode2(t,e.name)||visitNode2(t,e.typeExpression):visitNode2(t,e.typeExpression)||visitNode2(t,e.name))||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))}function forEachChildInJSDocTypeLikeTag(e,t,n){return visitNode2(t,e.tagName)||visitNode2(t,e.typeExpression)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))}function forEachChildInJSDocLinkCodeOrPlain(e,t,n){return visitNode2(t,e.name)}function forEachChildInJSDocTag(e,t,n){return visitNode2(t,e.tagName)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))}function forEachChildInJSDocImportTag(e,t,n){return visitNode2(t,e.tagName)||visitNode2(t,e.importClause)||visitNode2(t,e.moduleSpecifier)||visitNode2(t,e.attributes)||(typeof e.comment==="string"?void 0:visitNodes(t,n,e.comment))}function forEachChildInPartiallyEmittedExpression(e,t,n){return visitNode2(t,e.expression)}function forEachChild(e,t,n){if(e===void 0||e.kind<=165){return}const r=Li[e.kind];return r===void 0?void 0:r(e,t,n)}function forEachChildRecursively(e,t,n){const r=gatherPossibleChildren(e);const i=[];while(i.length=0;--t){r.push(e[t]);i.push(o)}}else{const n=t(e,o);if(n){if(n==="skip")continue;return n}if(e.kind>=166){for(const t of gatherPossibleChildren(e)){r.push(t);i.push(e)}}}}}function gatherPossibleChildren(e){const t=[];forEachChild(e,addWorkItem,addWorkItem);return t;function addWorkItem(e){t.unshift(e)}}function setExternalModuleIndicator(e){e.externalModuleIndicator=isFileProbablyExternalModule(e)}function createSourceFile(e,t,n,r=false,i){var o,a;(o=G)==null?void 0:o.push(G.Phase.Parse,"createSourceFile",{path:e},true);mark("beforeParse");let s;const{languageVersion:c,setExternalModuleIndicator:l,impliedNodeFormat:d,jsDocParsingMode:p}=typeof n==="object"?n:{languageVersion:n};if(c===100){s=Mi.parseSourceFile(e,t,c,void 0,r,6,noop,p)}else{const n=d===void 0?l:e=>{e.impliedNodeFormat=d;return(l||setExternalModuleIndicator)(e)};s=Mi.parseSourceFile(e,t,c,void 0,r,i,n,p)}mark("afterParse");measure("Parse","beforeParse","afterParse");(a=G)==null?void 0:a.pop();return s}function parseIsolatedEntityName(e,t){return Mi.parseIsolatedEntityName(e,t)}function parseJsonText(e,t){return Mi.parseJsonText(e,t)}function isExternalModule(e){return e.externalModuleIndicator!==void 0}function updateSourceFile(e,t,n,r=false){const i=ji.updateSourceFile(e,t,n,r);i.flags|=e.flags&12582912;return i}function parseIsolatedJSDocComment(e,t,n){const r=Mi.JSDocParser.parseIsolatedJSDocComment(e,t,n);if(r&&r.jsDoc){Mi.fixupParentReferences(r.jsDoc)}return r}function parseJSDocTypeExpressionForTests(e,t,n){return Mi.JSDocParser.parseJSDocTypeExpressionForTests(e,t,n)}var Mi;(e=>{var t=createScanner(99,true);var n=8192|32768;var r;var i;var o;var a;var s;function countNode(e){$++;return e}var c={createBaseSourceFileNode:e=>countNode(new s(e,0,0)),createBaseIdentifierNode:e=>countNode(new o(e,0,0)),createBasePrivateIdentifierNode:e=>countNode(new a(e,0,0)),createBaseTokenNode:e=>countNode(new i(e,0,0)),createBaseNode:e=>countNode(new r(e,0,0))};var l=createNodeFactory(1|2|8,c);var{createNodeArray:u,createNumericLiteral:f,createStringLiteral:m,createLiteralLikeNode:_,createIdentifier:g,createPrivateIdentifier:y,createToken:h,createArrayLiteralExpression:T,createObjectLiteralExpression:v,createPropertyAccessExpression:x,createPropertyAccessChain:b,createElementAccessExpression:C,createElementAccessChain:E,createCallExpression:N,createCallChain:k,createNewExpression:F,createParenthesizedExpression:P,createBlock:D,createVariableStatement:I,createExpressionStatement:A,createIfStatement:O,createWhileStatement:w,createForStatement:L,createForOfStatement:M,createVariableDeclaration:R,createVariableDeclarationList:B}=l;var j;var J;var W;var U;var z;var V;var q;var H;var G;var K;var $;var Q;var X;var Y;var Z;var ee;var te=true;var ne=false;function parseSourceFile(e,t,n,r,i=false,o,a,s=0){var c;o=ensureScriptKind(e,o);if(o===6){const o=parseJsonText2(e,t,n,r,i);convertToJson(o,(c=o.statements[0])==null?void 0:c.expression,o.parseDiagnostics,false,void 0);o.referencedFiles=d;o.typeReferenceDirectives=d;o.libReferenceDirectives=d;o.amdDependencies=d;o.hasNoDefaultLib=false;o.pragmas=p;return o}initializeState(e,t,n,r,o,s);const l=parseSourceFileWorker(n,i,o,a||setExternalModuleIndicator,s);clearState();return l}e.parseSourceFile=parseSourceFile;function parseIsolatedEntityName2(e,t){initializeState("",e,t,void 0,1,0);nextToken();const n=parseEntityName(true);const r=token()===1&&!q.length;clearState();return r?n:void 0}e.parseIsolatedEntityName=parseIsolatedEntityName2;function parseJsonText2(e,t,n=2,r,i=false){initializeState(e,t,n,r,6,0);J=ee;nextToken();const o=getNodePos();let a,s;if(token()===1){a=createNodeArray([],o,o);s=parseTokenNode()}else{let e;while(token()!==1){let t;switch(token()){case 23:t=parseArrayLiteralExpression();break;case 112:case 97:case 106:t=parseTokenNode();break;case 41:if(lookAhead((()=>nextToken()===9&&nextToken()!==59))){t=parsePrefixUnaryExpression()}else{t=parseObjectLiteralExpression()}break;case 9:case 11:if(lookAhead((()=>nextToken()!==59))){t=parseLiteralNode();break}default:t=parseObjectLiteralExpression();break}if(e&&isArray(e)){e.push(t)}else if(e){e=[e,t]}else{e=t;if(token()!==1){parseErrorAtCurrentToken(wt.Unexpected_token)}}}const t=isArray(e)?finishNode(T(e),o):S.checkDefined(e);const n=A(t);finishNode(n,o);a=createNodeArray([n],o);s=parseExpectedToken(1,wt.Unexpected_token)}const c=createSourceFile2(e,2,6,false,a,s,J,noop);if(i){fixupParentReferences(c)}c.nodeCount=$;c.identifierCount=X;c.identifiers=Q;c.parseDiagnostics=attachFileToDiagnostics(q,c);if(H){c.jsDocDiagnostics=attachFileToDiagnostics(H,c)}const l=c;clearState();return l}e.parseJsonText=parseJsonText2;function initializeState(e,n,c,l,d,p){r=Rn.getNodeConstructor();i=Rn.getTokenConstructor();o=Rn.getIdentifierConstructor();a=Rn.getPrivateIdentifierConstructor();s=Rn.getSourceFileConstructor();j=normalizePath(e);W=n;U=c;G=l;z=d;V=getLanguageVariant(d);q=[];Y=0;Q=new Map;X=0;$=0;J=0;te=true;switch(z){case 1:case 2:ee=524288;break;case 6:ee=524288|134217728;break;default:ee=0;break}ne=false;t.setText(W);t.setOnError(scanError);t.setScriptTarget(U);t.setLanguageVariant(V);t.setScriptKind(z);t.setJSDocParsingMode(p)}function clearState(){t.clearCommentDirectives();t.setText("");t.setOnError(void 0);t.setScriptKind(0);t.setJSDocParsingMode(0);W=void 0;U=void 0;G=void 0;z=void 0;V=void 0;J=0;q=void 0;H=void 0;Y=0;Q=void 0;Z=void 0;te=true}function parseSourceFileWorker(e,n,r,i,o){const a=isDeclarationFileName(j);if(a){ee|=33554432}J=ee;nextToken();const s=parseList(0,parseStatement);S.assert(token()===1);const c=hasPrecedingJSDocComment();const l=withJSDoc(parseTokenNode(),c);const d=createSourceFile2(j,e,r,a,s,l,J,i);processCommentPragmas(d,W);processPragmasIntoFields(d,reportPragmaDiagnostic);d.commentDirectives=t.getCommentDirectives();d.nodeCount=$;d.identifierCount=X;d.identifiers=Q;d.parseDiagnostics=attachFileToDiagnostics(q,d);d.jsDocParsingMode=o;if(H){d.jsDocDiagnostics=attachFileToDiagnostics(H,d)}if(n){fixupParentReferences(d)}return d;function reportPragmaDiagnostic(e,t,n){q.push(createDetachedDiagnostic(j,W,e,t,n))}}let re=false;function withJSDoc(e,t){if(!t){return e}S.assert(!e.jsDoc);const n=mapDefined(getJSDocCommentRanges(e,W),(t=>se.parseJSDocComment(e,t.pos,t.end-t.pos)));if(n.length)e.jsDoc=n;if(re){re=false;e.flags|=536870912}return e}function reparseTopLevelAwait(e){const n=G;const r=ji.createSyntaxCursor(e);G={currentNode:currentNode2};const i=[];const o=q;q=[];let a=0;let s=findNextStatementWithAwait(e.statements,0);while(s!==-1){const n=e.statements[a];const r=e.statements[s];addRange(i,e.statements,a,s);a=findNextStatementWithoutAwait(e.statements,s);const c=findIndex(o,(e=>e.start>=n.pos));const l=c>=0?findIndex(o,(e=>e.start>=r.pos),c):-1;if(c>=0){addRange(q,o,c,l>=0?l:void 0)}speculationHelper((()=>{const n=ee;ee|=65536;t.resetTokenState(r.pos);nextToken();while(token()!==1){const n=t.getTokenFullStart();const r=parseListElement(0,parseStatement);i.push(r);if(n===t.getTokenFullStart()){nextToken()}if(a>=0){const t=e.statements[a];if(r.end===t.pos){break}if(r.end>t.pos){a=findNextStatementWithoutAwait(e.statements,a+1)}}}ee=n}),2);s=a>=0?findNextStatementWithAwait(e.statements,a):-1}if(a>=0){const t=e.statements[a];addRange(i,e.statements,a);const n=findIndex(o,(e=>e.start>=t.pos));if(n>=0){addRange(q,o,n)}}G=n;return l.updateSourceFile(e,setTextRange(u(i),e.statements));function containsPossibleTopLevelAwait(e){return!(e.flags&65536)&&!!(e.transformFlags&67108864)}function findNextStatementWithAwait(e,t){for(let n=t;n118}function isIdentifier2(){if(token()===80){return true}if(token()===127&&inYieldContext()){return false}if(token()===135&&inAwaitContext()){return false}return token()>118}function parseExpected(e,t,n=true){if(token()===e){if(n){nextToken()}return true}if(t){parseErrorAtCurrentToken(t)}else{parseErrorAtCurrentToken(wt._0_expected,tokenToString(e))}return false}const ie=Object.keys(Lt).filter((e=>e.length>2));function parseErrorForMissingSemicolonAfter(e){if(isTaggedTemplateExpression(e)){parseErrorAt(skipTrivia(W,e.template.pos),e.template.end,wt.Module_declaration_names_may_only_use_or_quoted_strings);return}const n=isIdentifier(e)?idText(e):void 0;if(!n||!isIdentifierText(n,U)){parseErrorAtCurrentToken(wt._0_expected,tokenToString(27));return}const r=skipTrivia(W,e.pos);switch(n){case"const":case"let":case"var":parseErrorAt(r,e.end,wt.Variable_declaration_not_allowed_at_this_location);return;case"declare":return;case"interface":parseErrorForInvalidName(wt.Interface_name_cannot_be_0,wt.Interface_must_be_given_a_name,19);return;case"is":parseErrorAt(r,t.getTokenStart(),wt.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);return;case"module":case"namespace":parseErrorForInvalidName(wt.Namespace_name_cannot_be_0,wt.Namespace_must_be_given_a_name,19);return;case"type":parseErrorForInvalidName(wt.Type_alias_name_cannot_be_0,wt.Type_alias_must_be_given_a_name,64);return}const i=getSpellingSuggestion(n,ie,identity)??getSpaceSuggestion(n);if(i){parseErrorAt(r,e.end,wt.Unknown_keyword_or_identifier_Did_you_mean_0,i);return}if(token()===0){return}parseErrorAt(r,e.end,wt.Unexpected_keyword_or_identifier)}function parseErrorForInvalidName(e,n,r){if(token()===r){parseErrorAtCurrentToken(n)}else{parseErrorAtCurrentToken(e,t.getTokenValue())}}function getSpaceSuggestion(e){for(const t of ie){if(e.length>t.length+2&&startsWith(e,t)){return`${t} ${e.slice(t.length)}`}}return void 0}function parseSemicolonAfterPropertyName(e,n,r){if(token()===60&&!t.hasPrecedingLineBreak()){parseErrorAtCurrentToken(wt.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);return}if(token()===21){parseErrorAtCurrentToken(wt.Cannot_start_a_function_call_in_a_type_annotation);nextToken();return}if(n&&!canParseSemicolon()){if(r){parseErrorAtCurrentToken(wt._0_expected,tokenToString(27))}else{parseErrorAtCurrentToken(wt.Expected_for_property_initializer)}return}if(tryParseSemicolon()){return}if(r){parseErrorAtCurrentToken(wt._0_expected,tokenToString(27));return}parseErrorForMissingSemicolonAfter(e)}function parseExpectedJSDoc(e){if(token()===e){nextTokenJSDoc();return true}S.assert(isKeywordOrPunctuation(e));parseErrorAtCurrentToken(wt._0_expected,tokenToString(e));return false}function parseExpectedMatchingBrackets(e,t,n,r){if(token()===t){nextToken();return}const i=parseErrorAtCurrentToken(wt._0_expected,tokenToString(t));if(!n){return}if(i){addRelatedInfo(i,createDetachedDiagnostic(j,W,r,1,wt.The_parser_expected_to_find_a_1_to_match_the_0_token_here,tokenToString(e),tokenToString(t)))}}function parseOptional(e){if(token()===e){nextToken();return true}return false}function parseOptionalToken(e){if(token()===e){return parseTokenNode()}return void 0}function parseOptionalTokenJSDoc(e){if(token()===e){return parseTokenNodeJSDoc()}return void 0}function parseExpectedToken(e,t,n){return parseOptionalToken(e)||createMissingNode(e,false,t||wt._0_expected,n||tokenToString(e))}function parseExpectedTokenJSDoc(e){const t=parseOptionalTokenJSDoc(e);if(t)return t;S.assert(isKeywordOrPunctuation(e));return createMissingNode(e,false,wt._0_expected,tokenToString(e))}function parseTokenNode(){const e=getNodePos();const t=token();nextToken();return finishNode(h(t),e)}function parseTokenNodeJSDoc(){const e=getNodePos();const t=token();nextTokenJSDoc();return finishNode(h(t),e)}function canParseSemicolon(){if(token()===27){return true}return token()===20||token()===1||t.hasPrecedingLineBreak()}function tryParseSemicolon(){if(!canParseSemicolon()){return false}if(token()===27){nextToken()}return true}function parseSemicolon(){return tryParseSemicolon()||parseExpected(27)}function createNodeArray(e,n,r,i){const o=u(e,i);setTextRangePosEnd(o,n,r??t.getTokenFullStart());return o}function finishNode(e,n,r){setTextRangePosEnd(e,n,r??t.getTokenFullStart());if(ee){e.flags|=ee}if(ne){ne=false;e.flags|=262144}return e}function createMissingNode(e,n,r,...i){if(n){parseErrorAtPosition(t.getTokenFullStart(),0,r,...i)}else if(r){parseErrorAtCurrentToken(r,...i)}const o=getNodePos();const a=e===80?g("",void 0):isTemplateLiteralKind(e)?l.createTemplateLiteralLikeNode(e,"","",void 0):e===9?f("",void 0):e===11?m("",void 0):e===282?l.createMissingDeclaration():h(e);return finishNode(a,o)}function internIdentifier(e){let t=Q.get(e);if(t===void 0){Q.set(e,t=e)}return t}function createIdentifier(e,n,r){if(e){X++;const e=t.hasPrecedingJSDocLeadingAsterisks()?t.getTokenStart():getNodePos();const n=token();const r=internIdentifier(t.getTokenValue());const i=t.hasExtendedUnicodeEscape();nextTokenWithoutCheck();return finishNode(g(r,n,i),e)}if(token()===81){parseErrorAtCurrentToken(r||wt.Private_identifiers_are_not_allowed_outside_class_bodies);return createIdentifier(true)}if(token()===0&&t.tryScan((()=>t.reScanInvalidIdentifier()===80))){return createIdentifier(true)}X++;const i=token()===1;const o=t.isReservedWord();const a=t.getTokenText();const s=o?wt.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:wt.Identifier_expected;return createMissingNode(80,i,n||s,a)}function parseBindingIdentifier(e){return createIdentifier(isBindingIdentifier(),void 0,e)}function parseIdentifier(e,t){return createIdentifier(isIdentifier2(),e,t)}function parseIdentifierName(e){return createIdentifier(tokenIsIdentifierOrKeyword(token()),e)}function parseIdentifierNameErrorOnUnicodeEscapeSequence(){if(t.hasUnicodeEscape()||t.hasExtendedUnicodeEscape()){parseErrorAtCurrentToken(wt.Unicode_escape_sequence_cannot_appear_here)}return createIdentifier(tokenIsIdentifierOrKeyword(token()))}function isLiteralPropertyName(){return tokenIsIdentifierOrKeyword(token())||token()===11||token()===9||token()===10}function isImportAttributeName2(){return tokenIsIdentifierOrKeyword(token())||token()===11}function parsePropertyNameWorker(e){if(token()===11||token()===9||token()===10){const e=parseLiteralNode();e.text=internIdentifier(e.text);return e}if(e&&token()===23){return parseComputedPropertyName()}if(token()===81){return parsePrivateIdentifier()}return parseIdentifierName()}function parsePropertyName(){return parsePropertyNameWorker(true)}function parseComputedPropertyName(){const e=getNodePos();parseExpected(23);const t=allowInAnd(parseExpression);parseExpected(24);return finishNode(l.createComputedPropertyName(t),e)}function parsePrivateIdentifier(){const e=getNodePos();const n=y(internIdentifier(t.getTokenValue()));nextToken();return finishNode(n,e)}function parseContextualModifier(e){return token()===e&&tryParse(nextTokenCanFollowModifier)}function nextTokenIsOnSameLineAndCanFollowModifier(){nextToken();if(t.hasPrecedingLineBreak()){return false}return canFollowModifier()}function nextTokenCanFollowModifier(){switch(token()){case 87:return nextToken()===94;case 95:nextToken();if(token()===90){return lookAhead(nextTokenCanFollowDefaultKeyword)}if(token()===156){return lookAhead(nextTokenCanFollowExportModifier)}return canFollowExportModifier();case 90:return nextTokenCanFollowDefaultKeyword();case 126:nextToken();return canFollowModifier();case 139:case 153:nextToken();return canFollowGetOrSetKeyword();default:return nextTokenIsOnSameLineAndCanFollowModifier()}}function canFollowExportModifier(){return token()===60||token()!==42&&token()!==130&&token()!==19&&canFollowModifier()}function nextTokenCanFollowExportModifier(){nextToken();return canFollowExportModifier()}function parseAnyContextualModifier(){return isModifierKind(token())&&tryParse(nextTokenCanFollowModifier)}function canFollowModifier(){return token()===23||token()===19||token()===42||token()===26||isLiteralPropertyName()}function canFollowGetOrSetKeyword(){return token()===23||isLiteralPropertyName()}function nextTokenCanFollowDefaultKeyword(){nextToken();return token()===86||token()===100||token()===120||token()===60||token()===128&&lookAhead(nextTokenIsClassKeywordOnSameLine)||token()===134&&lookAhead(nextTokenIsFunctionKeywordOnSameLine)}function isListElement2(e,t){const n=currentNode(e);if(n){return true}switch(e){case 0:case 1:case 3:return!(token()===27&&t)&&isStartOfStatement();case 2:return token()===84||token()===90;case 4:return lookAhead(isTypeMemberStart);case 5:return lookAhead(isClassMemberStart)||token()===27&&!t;case 6:return token()===23||isLiteralPropertyName();case 12:switch(token()){case 23:case 42:case 26:case 25:return true;default:return isLiteralPropertyName()}case 18:return isLiteralPropertyName();case 9:return token()===23||token()===26||isLiteralPropertyName();case 24:return isImportAttributeName2();case 7:if(token()===19){return lookAhead(isValidHeritageClauseObjectLiteral)}if(!t){return isStartOfLeftHandSideExpression()&&!isHeritageClauseExtendsOrImplementsKeyword()}else{return isIdentifier2()&&!isHeritageClauseExtendsOrImplementsKeyword()}case 8:return isBindingIdentifierOrPrivateIdentifierOrPattern();case 10:return token()===28||token()===26||isBindingIdentifierOrPrivateIdentifierOrPattern();case 19:return token()===103||token()===87||isIdentifier2();case 15:switch(token()){case 28:case 25:return true}case 11:return token()===26||isStartOfExpression();case 16:return isStartOfParameter(false);case 17:return isStartOfParameter(true);case 20:case 21:return token()===28||isStartOfType();case 22:return isHeritageClause2();case 23:if(token()===161&&lookAhead(nextTokenIsStringLiteral)){return false}if(token()===11){return true}return tokenIsIdentifierOrKeyword(token());case 13:return tokenIsIdentifierOrKeyword(token())||token()===19;case 14:return true;case 25:return true;case 26:return S.fail("ParsingContext.Count used as a context");default:S.assertNever(e,"Non-exhaustive case in 'isListElement'.")}}function isValidHeritageClauseObjectLiteral(){S.assert(token()===19);if(nextToken()===20){const e=nextToken();return e===28||e===19||e===96||e===119}return true}function nextTokenIsIdentifier(){nextToken();return isIdentifier2()}function nextTokenIsIdentifierOrKeyword(){nextToken();return tokenIsIdentifierOrKeyword(token())}function nextTokenIsIdentifierOrKeywordOrGreaterThan(){nextToken();return tokenIsIdentifierOrKeywordOrGreaterThan(token())}function isHeritageClauseExtendsOrImplementsKeyword(){if(token()===119||token()===96){return lookAhead(nextTokenIsStartOfExpression)}return false}function nextTokenIsStartOfExpression(){nextToken();return isStartOfExpression()}function nextTokenIsStartOfType(){nextToken();return isStartOfType()}function isListTerminator(e){if(token()===1){return true}switch(e){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return token()===20;case 3:return token()===20||token()===84||token()===90;case 7:return token()===19||token()===96||token()===119;case 8:return isVariableDeclaratorListTerminator();case 19:return token()===32||token()===21||token()===19||token()===96||token()===119;case 11:return token()===22||token()===27;case 15:case 21:case 10:return token()===24;case 17:case 16:case 18:return token()===22||token()===24;case 20:return token()!==28;case 22:return token()===19||token()===20;case 13:return token()===32||token()===44;case 14:return token()===30&&lookAhead(nextTokenIsSlash);default:return false}}function isVariableDeclaratorListTerminator(){if(canParseSemicolon()){return true}if(isInOrOfKeyword(token())){return true}if(token()===39){return true}return false}function isInSomeParsingContext(){S.assert(Y,"Missing parsing context");for(let e=0;e<26;e++){if(Y&1<=0)}function getExpectedCommaDiagnostic(e){return e===6?wt.An_enum_member_name_must_be_followed_by_a_or:void 0}function createMissingList(){const e=createNodeArray([],getNodePos());e.isMissingList=true;return e}function isMissingList(e){return!!e.isMissingList}function parseBracketedList(e,t,n,r){if(parseExpected(n)){const n=parseDelimitedList(e,t);parseExpected(r);return n}return createMissingList()}function parseEntityName(e,t){const n=getNodePos();let r=e?parseIdentifierName(t):parseIdentifier(t);while(parseOptional(25)){if(token()===30){break}r=finishNode(l.createQualifiedName(r,parseRightSideOfDot(e,false,true)),n)}return r}function createQualifiedName(e,t){return finishNode(l.createQualifiedName(e,t),e.pos)}function parseRightSideOfDot(e,n,r){if(t.hasPrecedingLineBreak()&&tokenIsIdentifierOrKeyword(token())){const e=lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);if(e){return createMissingNode(80,true,wt.Identifier_expected)}}if(token()===81){const e=parsePrivateIdentifier();return n?e:createMissingNode(80,true,wt.Identifier_expected)}if(e){return r?parseIdentifierName():parseIdentifierNameErrorOnUnicodeEscapeSequence()}return parseIdentifier()}function parseTemplateSpans(e){const t=getNodePos();const n=[];let r;do{r=parseTemplateSpan(e);n.push(r)}while(r.literal.kind===17);return createNodeArray(n,t)}function parseTemplateExpression(e){const t=getNodePos();return finishNode(l.createTemplateExpression(parseTemplateHead(e),parseTemplateSpans(e)),t)}function parseTemplateType(){const e=getNodePos();return finishNode(l.createTemplateLiteralType(parseTemplateHead(false),parseTemplateTypeSpans()),e)}function parseTemplateTypeSpans(){const e=getNodePos();const t=[];let n;do{n=parseTemplateTypeSpan();t.push(n)}while(n.literal.kind===17);return createNodeArray(t,e)}function parseTemplateTypeSpan(){const e=getNodePos();return finishNode(l.createTemplateLiteralTypeSpan(parseType(),parseLiteralOfTemplateSpan(false)),e)}function parseLiteralOfTemplateSpan(e){if(token()===20){reScanTemplateToken(e);return parseTemplateMiddleOrTemplateTail()}else{return parseExpectedToken(18,wt._0_expected,tokenToString(20))}}function parseTemplateSpan(e){const t=getNodePos();return finishNode(l.createTemplateSpan(allowInAnd(parseExpression),parseLiteralOfTemplateSpan(e)),t)}function parseLiteralNode(){return parseLiteralLikeNode(token())}function parseTemplateHead(e){if(!e&&t.getTokenFlags()&26656){reScanTemplateToken(false)}const n=parseLiteralLikeNode(token());S.assert(n.kind===16,"Template head has wrong token kind");return n}function parseTemplateMiddleOrTemplateTail(){const e=parseLiteralLikeNode(token());S.assert(e.kind===17||e.kind===18,"Template fragment has wrong token kind");return e}function getTemplateLiteralRawText(e){const n=e===15||e===18;const r=t.getTokenText();return r.substring(1,r.length-(t.isUnterminated()?0:n?1:2))}function parseLiteralLikeNode(e){const n=getNodePos();const r=isTemplateLiteralKind(e)?l.createTemplateLiteralLikeNode(e,t.getTokenValue(),getTemplateLiteralRawText(e),t.getTokenFlags()&7176):e===9?f(t.getTokenValue(),t.getNumericLiteralFlags()):e===11?m(t.getTokenValue(),void 0,t.hasExtendedUnicodeEscape()):isLiteralKind(e)?_(e,t.getTokenValue()):S.fail();if(t.hasExtendedUnicodeEscape()){r.hasExtendedUnicodeEscape=true}if(t.isUnterminated()){r.isUnterminated=true}nextToken();return finishNode(r,n)}function parseEntityNameOfTypeReference(){return parseEntityName(true,wt.Type_expected)}function parseTypeArgumentsOfTypeReference(){if(!t.hasPrecedingLineBreak()&&reScanLessThanToken()===30){return parseBracketedList(20,parseType,30,32)}}function parseTypeReference(){const e=getNodePos();return finishNode(l.createTypeReferenceNode(parseEntityNameOfTypeReference(),parseTypeArgumentsOfTypeReference()),e)}function typeHasArrowFunctionBlockingParseError(e){switch(e.kind){case 183:return nodeIsMissing(e.typeName);case 184:case 185:{const{parameters:t,type:n}=e;return isMissingList(t)||typeHasArrowFunctionBlockingParseError(n)}case 196:return typeHasArrowFunctionBlockingParseError(e.type);default:return false}}function parseThisTypePredicate(e){nextToken();return finishNode(l.createTypePredicateNode(void 0,e,parseType()),e.pos)}function parseThisTypeNode(){const e=getNodePos();nextToken();return finishNode(l.createThisTypeNode(),e)}function parseJSDocAllType(){const e=getNodePos();nextToken();return finishNode(l.createJSDocAllType(),e)}function parseJSDocNonNullableType(){const e=getNodePos();nextToken();return finishNode(l.createJSDocNonNullableType(parseNonArrayType(),false),e)}function parseJSDocUnknownOrNullableType(){const e=getNodePos();nextToken();if(token()===28||token()===20||token()===22||token()===32||token()===64||token()===52){return finishNode(l.createJSDocUnknownType(),e)}else{return finishNode(l.createJSDocNullableType(parseType(),false),e)}}function parseJSDocFunctionType(){const e=getNodePos();const t=hasPrecedingJSDocComment();if(tryParse(nextTokenIsOpenParen)){const n=parseParameters(4|32);const r=parseReturnType(59,false);return withJSDoc(finishNode(l.createJSDocFunctionType(n,r),e),t)}return finishNode(l.createTypeReferenceNode(parseIdentifierName(),void 0),e)}function parseJSDocParameter(){const e=getNodePos();let t;if(token()===110||token()===105){t=parseIdentifierName();parseExpected(59)}return finishNode(l.createParameterDeclaration(void 0,void 0,t,void 0,parseJSDocType(),void 0),e)}function parseJSDocType(){t.setSkipJsDocLeadingAsterisks(true);const e=getNodePos();if(parseOptional(144)){const n=l.createJSDocNamepathType(void 0);e:while(true){switch(token()){case 20:case 1:case 28:case 5:break e;default:nextTokenJSDoc()}}t.setSkipJsDocLeadingAsterisks(false);return finishNode(n,e)}const n=parseOptional(26);let r=parseTypeOrTypePredicate();t.setSkipJsDocLeadingAsterisks(false);if(n){r=finishNode(l.createJSDocVariadicType(r),e)}if(token()===64){nextToken();return finishNode(l.createJSDocOptionalType(r),e)}return r}function parseTypeQuery(){const e=getNodePos();parseExpected(114);const n=parseEntityName(true);const r=!t.hasPrecedingLineBreak()?tryParseTypeArguments():void 0;return finishNode(l.createTypeQueryNode(n,r),e)}function parseTypeParameter(){const e=getNodePos();const t=parseModifiers(false,true);const n=parseIdentifier();let r;let i;if(parseOptional(96)){if(isStartOfType()||!isStartOfExpression()){r=parseType()}else{i=parseUnaryExpressionOrHigher()}}const o=parseOptional(64)?parseType():void 0;const a=l.createTypeParameterDeclaration(t,n,r,o);a.expression=i;return finishNode(a,e)}function parseTypeParameters(){if(token()===30){return parseBracketedList(19,parseTypeParameter,30,32)}}function isStartOfParameter(e){return token()===26||isBindingIdentifierOrPrivateIdentifierOrPattern()||isModifierKind(token())||token()===60||isStartOfType(!e)}function parseNameOfParameter(e){const t=parseIdentifierOrPattern(wt.Private_identifiers_cannot_be_used_as_parameters);if(getFullWidth(t)===0&&!some(e)&&isModifierKind(token())){nextToken()}return t}function isParameterNameStart(){return isBindingIdentifier()||token()===23||token()===19}function parseParameter(e){return parseParameterWorker(e)}function parseParameterForSpeculation(e){return parseParameterWorker(e,false)}function parseParameterWorker(e,t=true){const n=getNodePos();const r=hasPrecedingJSDocComment();const i=e?doInAwaitContext((()=>parseModifiers(true))):doOutsideOfAwaitContext((()=>parseModifiers(true)));if(token()===110){const e=l.createParameterDeclaration(i,void 0,createIdentifier(true),void 0,parseTypeAnnotation(),void 0);const t=firstOrUndefined(i);if(t){parseErrorAtRange(t,wt.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters)}return withJSDoc(finishNode(e,n),r)}const o=te;te=false;const a=parseOptionalToken(26);if(!t&&!isParameterNameStart()){return void 0}const s=withJSDoc(finishNode(l.createParameterDeclaration(i,a,parseNameOfParameter(i),parseOptionalToken(58),parseTypeAnnotation(),parseInitializer()),n),r);te=o;return s}function parseReturnType(e,t){if(shouldParseReturnType(e,t)){return allowConditionalTypesAnd(parseTypeOrTypePredicate)}}function shouldParseReturnType(e,t){if(e===39){parseExpected(e);return true}else if(parseOptional(59)){return true}else if(t&&token()===39){parseErrorAtCurrentToken(wt._0_expected,tokenToString(59));nextToken();return true}return false}function parseParametersWorker(e,t){const n=inYieldContext();const r=inAwaitContext();setYieldContext(!!(e&1));setAwaitContext(!!(e&2));const i=e&32?parseDelimitedList(17,parseJSDocParameter):parseDelimitedList(16,(()=>t?parseParameter(r):parseParameterForSpeculation(r)));setYieldContext(n);setAwaitContext(r);return i}function parseParameters(e){if(!parseExpected(21)){return createMissingList()}const t=parseParametersWorker(e,true);parseExpected(22);return t}function parseTypeMemberSemicolon(){if(parseOptional(28)){return}parseSemicolon()}function parseSignatureMember(e){const t=getNodePos();const n=hasPrecedingJSDocComment();if(e===180){parseExpected(105)}const r=parseTypeParameters();const i=parseParameters(4);const o=parseReturnType(59,true);parseTypeMemberSemicolon();const a=e===179?l.createCallSignature(r,i,o):l.createConstructSignature(r,i,o);return withJSDoc(finishNode(a,t),n)}function isIndexSignature(){return token()===23&&lookAhead(isUnambiguouslyIndexSignature)}function isUnambiguouslyIndexSignature(){nextToken();if(token()===26||token()===24){return true}if(isModifierKind(token())){nextToken();if(isIdentifier2()){return true}}else if(!isIdentifier2()){return false}else{nextToken()}if(token()===59||token()===28){return true}if(token()!==58){return false}nextToken();return token()===59||token()===28||token()===24}function parseIndexSignatureDeclaration(e,t,n){const r=parseBracketedList(16,(()=>parseParameter(false)),23,24);const i=parseTypeAnnotation();parseTypeMemberSemicolon();const o=l.createIndexSignature(n,r,i);return withJSDoc(finishNode(o,e),t)}function parsePropertyOrMethodSignature(e,t,n){const r=parsePropertyName();const i=parseOptionalToken(58);let o;if(token()===21||token()===30){const e=parseTypeParameters();const t=parseParameters(4);const a=parseReturnType(59,true);o=l.createMethodSignature(n,r,i,e,t,a)}else{const e=parseTypeAnnotation();o=l.createPropertySignature(n,r,i,e);if(token()===64)o.initializer=parseInitializer()}parseTypeMemberSemicolon();return withJSDoc(finishNode(o,e),t)}function isTypeMemberStart(){if(token()===21||token()===30||token()===139||token()===153){return true}let e=false;while(isModifierKind(token())){e=true;nextToken()}if(token()===23){return true}if(isLiteralPropertyName()){e=true;nextToken()}if(e){return token()===21||token()===30||token()===58||token()===59||token()===28||canParseSemicolon()}return false}function parseTypeMember(){if(token()===21||token()===30){return parseSignatureMember(179)}if(token()===105&&lookAhead(nextTokenIsOpenParenOrLessThan)){return parseSignatureMember(180)}const e=getNodePos();const t=hasPrecedingJSDocComment();const n=parseModifiers(false);if(parseContextualModifier(139)){return parseAccessorDeclaration(e,t,n,177,4)}if(parseContextualModifier(153)){return parseAccessorDeclaration(e,t,n,178,4)}if(isIndexSignature()){return parseIndexSignatureDeclaration(e,t,n)}return parsePropertyOrMethodSignature(e,t,n)}function nextTokenIsOpenParenOrLessThan(){nextToken();return token()===21||token()===30}function nextTokenIsDot(){return nextToken()===25}function nextTokenIsOpenParenOrLessThanOrDot(){switch(nextToken()){case 21:case 30:case 25:return true}return false}function parseTypeLiteral(){const e=getNodePos();return finishNode(l.createTypeLiteralNode(parseObjectTypeMembers()),e)}function parseObjectTypeMembers(){let e;if(parseExpected(19)){e=parseList(4,parseTypeMember);parseExpected(20)}else{e=createMissingList()}return e}function isStartOfMappedType(){nextToken();if(token()===40||token()===41){return nextToken()===148}if(token()===148){nextToken()}return token()===23&&nextTokenIsIdentifier()&&nextToken()===103}function parseMappedTypeParameter(){const e=getNodePos();const t=parseIdentifierName();parseExpected(103);const n=parseType();return finishNode(l.createTypeParameterDeclaration(void 0,t,n,void 0),e)}function parseMappedType(){const e=getNodePos();parseExpected(19);let t;if(token()===148||token()===40||token()===41){t=parseTokenNode();if(t.kind!==148){parseExpected(148)}}parseExpected(23);const n=parseMappedTypeParameter();const r=parseOptional(130)?parseType():void 0;parseExpected(24);let i;if(token()===58||token()===40||token()===41){i=parseTokenNode();if(i.kind!==58){parseExpected(58)}}const o=parseTypeAnnotation();parseSemicolon();const a=parseList(4,parseTypeMember);parseExpected(20);return finishNode(l.createMappedTypeNode(t,n,r,i,o,a),e)}function parseTupleElementType(){const e=getNodePos();if(parseOptional(26)){return finishNode(l.createRestTypeNode(parseType()),e)}const t=parseType();if(isJSDocNullableType(t)&&t.pos===t.type.pos){const e=l.createOptionalTypeNode(t.type);setTextRange(e,t);e.flags=t.flags;return e}return t}function isNextTokenColonOrQuestionColon(){return nextToken()===59||token()===58&&nextToken()===59}function isTupleElementName(){if(token()===26){return tokenIsIdentifierOrKeyword(nextToken())&&isNextTokenColonOrQuestionColon()}return tokenIsIdentifierOrKeyword(token())&&isNextTokenColonOrQuestionColon()}function parseTupleElementNameOrTupleElementType(){if(lookAhead(isTupleElementName)){const e=getNodePos();const t=hasPrecedingJSDocComment();const n=parseOptionalToken(26);const r=parseIdentifierName();const i=parseOptionalToken(58);parseExpected(59);const o=parseTupleElementType();const a=l.createNamedTupleMember(n,r,i,o);return withJSDoc(finishNode(a,e),t)}return parseTupleElementType()}function parseTupleType(){const e=getNodePos();return finishNode(l.createTupleTypeNode(parseBracketedList(21,parseTupleElementNameOrTupleElementType,23,24)),e)}function parseParenthesizedType(){const e=getNodePos();parseExpected(21);const t=parseType();parseExpected(22);return finishNode(l.createParenthesizedType(t),e)}function parseModifiersForConstructorType(){let e;if(token()===128){const t=getNodePos();nextToken();const n=finishNode(h(128),t);e=createNodeArray([n],t)}return e}function parseFunctionOrConstructorType(){const e=getNodePos();const t=hasPrecedingJSDocComment();const n=parseModifiersForConstructorType();const r=parseOptional(105);S.assert(!n||r,"Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");const i=parseTypeParameters();const o=parseParameters(4);const a=parseReturnType(39,false);const s=r?l.createConstructorTypeNode(n,i,o,a):l.createFunctionTypeNode(i,o,a);return withJSDoc(finishNode(s,e),t)}function parseKeywordAndNoDot(){const e=parseTokenNode();return token()===25?void 0:e}function parseLiteralTypeNode(e){const t=getNodePos();if(e){nextToken()}let n=token()===112||token()===97||token()===106?parseTokenNode():parseLiteralLikeNode(token());if(e){n=finishNode(l.createPrefixUnaryExpression(41,n),t)}return finishNode(l.createLiteralTypeNode(n),t)}function isStartOfTypeOfImportType(){nextToken();return token()===102}function parseImportType(){J|=4194304;const e=getNodePos();const n=parseOptional(114);parseExpected(102);parseExpected(21);const r=parseType();let i;if(parseOptional(28)){const e=t.getTokenStart();parseExpected(19);const n=token();if(n===118||n===132){nextToken()}else{parseErrorAtCurrentToken(wt._0_expected,tokenToString(118))}parseExpected(59);i=parseImportAttributes(n,true);if(!parseExpected(20)){const t=lastOrUndefined(q);if(t&&t.code===wt._0_expected.code){addRelatedInfo(t,createDetachedDiagnostic(j,W,e,1,wt.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}}}parseExpected(22);const o=parseOptional(25)?parseEntityNameOfTypeReference():void 0;const a=parseTypeArgumentsOfTypeReference();return finishNode(l.createImportTypeNode(r,i,o,a,n),e)}function nextTokenIsNumericOrBigIntLiteral(){nextToken();return token()===9||token()===10}function parseNonArrayType(){switch(token()){case 133:case 159:case 154:case 150:case 163:case 155:case 136:case 157:case 146:case 151:return tryParse(parseKeywordAndNoDot)||parseTypeReference();case 67:t.reScanAsteriskEqualsToken();case 42:return parseJSDocAllType();case 61:t.reScanQuestionToken();case 58:return parseJSDocUnknownOrNullableType();case 100:return parseJSDocFunctionType();case 54:return parseJSDocNonNullableType();case 15:case 11:case 9:case 10:case 112:case 97:case 106:return parseLiteralTypeNode();case 41:return lookAhead(nextTokenIsNumericOrBigIntLiteral)?parseLiteralTypeNode(true):parseTypeReference();case 116:return parseTokenNode();case 110:{const e=parseThisTypeNode();if(token()===142&&!t.hasPrecedingLineBreak()){return parseThisTypePredicate(e)}else{return e}}case 114:return lookAhead(isStartOfTypeOfImportType)?parseImportType():parseTypeQuery();case 19:return lookAhead(isStartOfMappedType)?parseMappedType():parseTypeLiteral();case 23:return parseTupleType();case 21:return parseParenthesizedType();case 102:return parseImportType();case 131:return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)?parseAssertsTypePredicate():parseTypeReference();case 16:return parseTemplateType();default:return parseTypeReference()}}function isStartOfType(e){switch(token()){case 133:case 159:case 154:case 150:case 163:case 136:case 148:case 155:case 158:case 116:case 157:case 106:case 110:case 114:case 146:case 19:case 23:case 30:case 52:case 51:case 105:case 11:case 9:case 10:case 112:case 97:case 151:case 42:case 58:case 54:case 26:case 140:case 102:case 131:case 15:case 16:return true;case 100:return!e;case 41:return!e&&lookAhead(nextTokenIsNumericOrBigIntLiteral);case 21:return!e&&lookAhead(isStartOfParenthesizedOrFunctionType);default:return isIdentifier2()}}function isStartOfParenthesizedOrFunctionType(){nextToken();return token()===22||isStartOfParameter(false)||isStartOfType()}function parsePostfixTypeOrHigher(){const e=getNodePos();let n=parseNonArrayType();while(!t.hasPrecedingLineBreak()){switch(token()){case 54:nextToken();n=finishNode(l.createJSDocNonNullableType(n,true),e);break;case 58:if(lookAhead(nextTokenIsStartOfType)){return n}nextToken();n=finishNode(l.createJSDocNullableType(n,true),e);break;case 23:parseExpected(23);if(isStartOfType()){const t=parseType();parseExpected(24);n=finishNode(l.createIndexedAccessTypeNode(n,t),e)}else{parseExpected(24);n=finishNode(l.createArrayTypeNode(n),e)}break;default:return n}}return n}function parseTypeOperator(e){const t=getNodePos();parseExpected(e);return finishNode(l.createTypeOperatorNode(e,parseTypeOperatorOrHigher()),t)}function tryParseConstraintOfInferType(){if(parseOptional(96)){const e=disallowConditionalTypesAnd(parseType);if(inDisallowConditionalTypesContext()||token()!==58){return e}}}function parseTypeParameterOfInferType(){const e=getNodePos();const t=parseIdentifier();const n=tryParse(tryParseConstraintOfInferType);const r=l.createTypeParameterDeclaration(void 0,t,n);return finishNode(r,e)}function parseInferType(){const e=getNodePos();parseExpected(140);return finishNode(l.createInferTypeNode(parseTypeParameterOfInferType()),e)}function parseTypeOperatorOrHigher(){const e=token();switch(e){case 143:case 158:case 148:return parseTypeOperator(e);case 140:return parseInferType()}return allowConditionalTypesAnd(parsePostfixTypeOrHigher)}function parseFunctionOrConstructorTypeToError(e){if(isStartOfFunctionTypeOrConstructorType()){const t=parseFunctionOrConstructorType();let n;if(isFunctionTypeNode(t)){n=e?wt.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:wt.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type}else{n=e?wt.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:wt.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type}parseErrorAtRange(t,n);return t}return void 0}function parseUnionOrIntersectionType(e,t,n){const r=getNodePos();const i=e===52;const o=parseOptional(e);let a=o&&parseFunctionOrConstructorTypeToError(i)||t();if(token()===e||o){const o=[a];while(parseOptional(e)){o.push(parseFunctionOrConstructorTypeToError(i)||t())}a=finishNode(n(createNodeArray(o,r)),r)}return a}function parseIntersectionTypeOrHigher(){return parseUnionOrIntersectionType(51,parseTypeOperatorOrHigher,l.createIntersectionTypeNode)}function parseUnionTypeOrHigher(){return parseUnionOrIntersectionType(52,parseIntersectionTypeOrHigher,l.createUnionTypeNode)}function nextTokenIsNewKeyword(){nextToken();return token()===105}function isStartOfFunctionTypeOrConstructorType(){if(token()===30){return true}if(token()===21&&lookAhead(isUnambiguouslyStartOfFunctionType)){return true}return token()===105||token()===128&&lookAhead(nextTokenIsNewKeyword)}function skipParameterStart(){if(isModifierKind(token())){parseModifiers(false)}if(isIdentifier2()||token()===110){nextToken();return true}if(token()===23||token()===19){const e=q.length;parseIdentifierOrPattern();return e===q.length}return false}function isUnambiguouslyStartOfFunctionType(){nextToken();if(token()===22||token()===26){return true}if(skipParameterStart()){if(token()===59||token()===28||token()===58||token()===64){return true}if(token()===22){nextToken();if(token()===39){return true}}}return false}function parseTypeOrTypePredicate(){const e=getNodePos();const t=isIdentifier2()&&tryParse(parseTypePredicatePrefix);const n=parseType();if(t){return finishNode(l.createTypePredicateNode(void 0,t,n),e)}else{return n}}function parseTypePredicatePrefix(){const e=parseIdentifier();if(token()===142&&!t.hasPrecedingLineBreak()){nextToken();return e}}function parseAssertsTypePredicate(){const e=getNodePos();const t=parseExpectedToken(131);const n=token()===110?parseThisTypeNode():parseIdentifier();const r=parseOptional(142)?parseType():void 0;return finishNode(l.createTypePredicateNode(t,n,r),e)}function parseType(){if(ee&81920){return doOutsideOfContext(81920,parseType)}if(isStartOfFunctionTypeOrConstructorType()){return parseFunctionOrConstructorType()}const e=getNodePos();const n=parseUnionTypeOrHigher();if(!inDisallowConditionalTypesContext()&&!t.hasPrecedingLineBreak()&&parseOptional(96)){const t=disallowConditionalTypesAnd(parseType);parseExpected(58);const r=allowConditionalTypesAnd(parseType);parseExpected(59);const i=allowConditionalTypesAnd(parseType);return finishNode(l.createConditionalTypeNode(n,t,r,i),e)}return n}function parseTypeAnnotation(){return parseOptional(59)?parseType():void 0}function isStartOfLeftHandSideExpression(){switch(token()){case 110:case 108:case 106:case 112:case 97:case 9:case 10:case 11:case 15:case 16:case 21:case 23:case 19:case 100:case 86:case 105:case 44:case 69:case 80:return true;case 102:return lookAhead(nextTokenIsOpenParenOrLessThanOrDot);default:return isIdentifier2()}}function isStartOfExpression(){if(isStartOfLeftHandSideExpression()){return true}switch(token()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 46:case 47:case 30:case 135:case 127:case 81:case 60:return true;default:if(isBinaryOperator2()){return true}return isIdentifier2()}}function isStartOfExpressionStatement(){return token()!==19&&token()!==100&&token()!==86&&token()!==60&&isStartOfExpression()}function parseExpression(){const e=inDecoratorContext();if(e){setDecoratorContext(false)}const t=getNodePos();let n=parseAssignmentExpressionOrHigher(true);let r;while(r=parseOptionalToken(28)){n=makeBinaryExpression(n,r,parseAssignmentExpressionOrHigher(true),t)}if(e){setDecoratorContext(true)}return n}function parseInitializer(){return parseOptional(64)?parseAssignmentExpressionOrHigher(true):void 0}function parseAssignmentExpressionOrHigher(e){if(isYieldExpression2()){return parseYieldExpression()}const t=tryParseParenthesizedArrowFunctionExpression(e)||tryParseAsyncSimpleArrowFunctionExpression(e);if(t){return t}const n=getNodePos();const r=hasPrecedingJSDocComment();const i=parseBinaryExpressionOrHigher(0);if(i.kind===80&&token()===39){return parseSimpleArrowFunctionExpression(n,i,e,r,void 0)}if(isLeftHandSideExpression(i)&&isAssignmentOperator(reScanGreaterToken())){return makeBinaryExpression(i,parseTokenNode(),parseAssignmentExpressionOrHigher(e),n)}return parseConditionalExpressionRest(i,n,e)}function isYieldExpression2(){if(token()===127){if(inYieldContext()){return true}return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine)}return false}function nextTokenIsIdentifierOnSameLine(){nextToken();return!t.hasPrecedingLineBreak()&&isIdentifier2()}function parseYieldExpression(){const e=getNodePos();nextToken();if(!t.hasPrecedingLineBreak()&&(token()===42||isStartOfExpression())){return finishNode(l.createYieldExpression(parseOptionalToken(42),parseAssignmentExpressionOrHigher(true)),e)}else{return finishNode(l.createYieldExpression(void 0,void 0),e)}}function parseSimpleArrowFunctionExpression(e,t,n,r,i){S.assert(token()===39,"parseSimpleArrowFunctionExpression should only have been called if we had a =>");const o=l.createParameterDeclaration(void 0,void 0,t,void 0,void 0,void 0);finishNode(o,t.pos);const a=createNodeArray([o],o.pos,o.end);const s=parseExpectedToken(39);const c=parseArrowFunctionExpressionBody(!!i,n);const d=l.createArrowFunction(i,void 0,a,void 0,s,c);return withJSDoc(finishNode(d,e),r)}function tryParseParenthesizedArrowFunctionExpression(e){const t=isParenthesizedArrowFunctionExpression();if(t===0){return void 0}return t===1?parseParenthesizedArrowFunctionExpression(true,true):tryParse((()=>parsePossibleParenthesizedArrowFunctionExpression(e)))}function isParenthesizedArrowFunctionExpression(){if(token()===21||token()===30||token()===134){return lookAhead(isParenthesizedArrowFunctionExpressionWorker)}if(token()===39){return 1}return 0}function isParenthesizedArrowFunctionExpressionWorker(){if(token()===134){nextToken();if(t.hasPrecedingLineBreak()){return 0}if(token()!==21&&token()!==30){return 0}}const e=token();const n=nextToken();if(e===21){if(n===22){const e=nextToken();switch(e){case 39:case 59:case 19:return 1;default:return 0}}if(n===23||n===19){return 2}if(n===26){return 1}if(isModifierKind(n)&&n!==134&&lookAhead(nextTokenIsIdentifier)){if(nextToken()===130){return 0}return 1}if(!isIdentifier2()&&n!==110){return 0}switch(nextToken()){case 59:return 1;case 58:nextToken();if(token()===59||token()===28||token()===64||token()===22){return 1}return 0;case 28:case 64:case 22:return 2}return 0}else{S.assert(e===30);if(!isIdentifier2()&&token()!==87){return 0}if(V===1){const e=lookAhead((()=>{parseOptional(87);const e=nextToken();if(e===96){const e=nextToken();switch(e){case 64:case 32:case 44:return false;default:return true}}else if(e===28||e===64){return true}return false}));if(e){return 1}return 0}return 2}}function parsePossibleParenthesizedArrowFunctionExpression(e){const n=t.getTokenStart();if(Z==null?void 0:Z.has(n)){return void 0}const r=parseParenthesizedArrowFunctionExpression(false,e);if(!r){(Z||(Z=new Set)).add(n)}return r}function tryParseAsyncSimpleArrowFunctionExpression(e){if(token()===134){if(lookAhead(isUnParenthesizedAsyncArrowFunctionWorker)===1){const t=getNodePos();const n=hasPrecedingJSDocComment();const r=parseModifiersForArrowFunction();const i=parseBinaryExpressionOrHigher(0);return parseSimpleArrowFunctionExpression(t,i,e,n,r)}}return void 0}function isUnParenthesizedAsyncArrowFunctionWorker(){if(token()===134){nextToken();if(t.hasPrecedingLineBreak()||token()===39){return 0}const e=parseBinaryExpressionOrHigher(0);if(!t.hasPrecedingLineBreak()&&e.kind===80&&token()===39){return 1}}return 0}function parseParenthesizedArrowFunctionExpression(e,t){const n=getNodePos();const r=hasPrecedingJSDocComment();const i=parseModifiersForArrowFunction();const o=some(i,isAsyncModifier)?2:0;const a=parseTypeParameters();let s;if(!parseExpected(21)){if(!e){return void 0}s=createMissingList()}else{if(!e){const t=parseParametersWorker(o,e);if(!t){return void 0}s=t}else{s=parseParametersWorker(o,e)}if(!parseExpected(22)&&!e){return void 0}}const c=token()===59;const d=parseReturnType(59,false);if(d&&!e&&typeHasArrowFunctionBlockingParseError(d)){return void 0}let p=d;while((p==null?void 0:p.kind)===196){p=p.type}const u=p&&isJSDocFunctionType(p);if(!e&&token()!==39&&(u||token()!==19)){return void 0}const f=token();const m=parseExpectedToken(39);const _=f===39||f===19?parseArrowFunctionExpressionBody(some(i,isAsyncModifier),t):parseIdentifier();if(!t&&c){if(token()!==59){return void 0}}const g=l.createArrowFunction(i,a,s,d,m,_);return withJSDoc(finishNode(g,n),r)}function parseArrowFunctionExpressionBody(e,t){if(token()===19){return parseFunctionBlock(e?2:0)}if(token()!==27&&token()!==100&&token()!==86&&isStartOfStatement()&&!isStartOfExpressionStatement()){return parseFunctionBlock(16|(e?2:0))}const n=te;te=false;const r=e?doInAwaitContext((()=>parseAssignmentExpressionOrHigher(t))):doOutsideOfAwaitContext((()=>parseAssignmentExpressionOrHigher(t)));te=n;return r}function parseConditionalExpressionRest(e,t,r){const i=parseOptionalToken(58);if(!i){return e}let o;return finishNode(l.createConditionalExpression(e,i,doOutsideOfContext(n,(()=>parseAssignmentExpressionOrHigher(false))),o=parseExpectedToken(59),nodeIsPresent(o)?parseAssignmentExpressionOrHigher(r):createMissingNode(80,false,wt._0_expected,tokenToString(59))),t)}function parseBinaryExpressionOrHigher(e){const t=getNodePos();const n=parseUnaryExpressionOrHigher();return parseBinaryExpressionRest(e,n,t)}function isInOrOfKeyword(e){return e===103||e===165}function parseBinaryExpressionRest(e,n,r){while(true){reScanGreaterToken();const i=getBinaryOperatorPrecedence(token());const o=token()===43?i>=e:i>e;if(!o){break}if(token()===103&&inDisallowInContext()){break}if(token()===130||token()===152){if(t.hasPrecedingLineBreak()){break}else{const e=token();nextToken();n=e===152?makeSatisfiesExpression(n,parseType()):makeAsExpression(n,parseType())}}else{n=makeBinaryExpression(n,parseTokenNode(),parseBinaryExpressionOrHigher(i),r)}}return n}function isBinaryOperator2(){if(inDisallowInContext()&&token()===103){return false}return getBinaryOperatorPrecedence(token())>0}function makeSatisfiesExpression(e,t){return finishNode(l.createSatisfiesExpression(e,t),e.pos)}function makeBinaryExpression(e,t,n,r){return finishNode(l.createBinaryExpression(e,t,n),r)}function makeAsExpression(e,t){return finishNode(l.createAsExpression(e,t),e.pos)}function parsePrefixUnaryExpression(){const e=getNodePos();return finishNode(l.createPrefixUnaryExpression(token(),nextTokenAnd(parseSimpleUnaryExpression)),e)}function parseDeleteExpression(){const e=getNodePos();return finishNode(l.createDeleteExpression(nextTokenAnd(parseSimpleUnaryExpression)),e)}function parseTypeOfExpression(){const e=getNodePos();return finishNode(l.createTypeOfExpression(nextTokenAnd(parseSimpleUnaryExpression)),e)}function parseVoidExpression(){const e=getNodePos();return finishNode(l.createVoidExpression(nextTokenAnd(parseSimpleUnaryExpression)),e)}function isAwaitExpression2(){if(token()===135){if(inAwaitContext()){return true}return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine)}return false}function parseAwaitExpression(){const e=getNodePos();return finishNode(l.createAwaitExpression(nextTokenAnd(parseSimpleUnaryExpression)),e)}function parseUnaryExpressionOrHigher(){if(isUpdateExpression()){const e=getNodePos();const t=parseUpdateExpression();return token()===43?parseBinaryExpressionRest(getBinaryOperatorPrecedence(token()),t,e):t}const e=token();const t=parseSimpleUnaryExpression();if(token()===43){const n=skipTrivia(W,t.pos);const{end:r}=t;if(t.kind===216){parseErrorAt(n,r,wt.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses)}else{S.assert(isKeywordOrPunctuation(e));parseErrorAt(n,r,wt.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,tokenToString(e))}}return t}function parseSimpleUnaryExpression(){switch(token()){case 40:case 41:case 55:case 54:return parsePrefixUnaryExpression();case 91:return parseDeleteExpression();case 114:return parseTypeOfExpression();case 116:return parseVoidExpression();case 30:if(V===1){return parseJsxElementOrSelfClosingElementOrFragment(true,void 0,void 0,true)}return parseTypeAssertion();case 135:if(isAwaitExpression2()){return parseAwaitExpression()}default:return parseUpdateExpression()}}function isUpdateExpression(){switch(token()){case 40:case 41:case 55:case 54:case 91:case 114:case 116:case 135:return false;case 30:if(V!==1){return false}default:return true}}function parseUpdateExpression(){if(token()===46||token()===47){const e=getNodePos();return finishNode(l.createPrefixUnaryExpression(token(),nextTokenAnd(parseLeftHandSideExpressionOrHigher)),e)}else if(V===1&&token()===30&&lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)){return parseJsxElementOrSelfClosingElementOrFragment(true)}const e=parseLeftHandSideExpressionOrHigher();S.assert(isLeftHandSideExpression(e));if((token()===46||token()===47)&&!t.hasPrecedingLineBreak()){const t=token();nextToken();return finishNode(l.createPostfixUnaryExpression(e,t),e.pos)}return e}function parseLeftHandSideExpressionOrHigher(){const e=getNodePos();let t;if(token()===102){if(lookAhead(nextTokenIsOpenParenOrLessThan)){J|=4194304;t=parseTokenNode()}else if(lookAhead(nextTokenIsDot)){nextToken();nextToken();t=finishNode(l.createMetaProperty(102,parseIdentifierName()),e);J|=8388608}else{t=parseMemberExpressionOrHigher()}}else{t=token()===108?parseSuperExpression():parseMemberExpressionOrHigher()}return parseCallExpressionRest(e,t)}function parseMemberExpressionOrHigher(){const e=getNodePos();const t=parsePrimaryExpression();return parseMemberExpressionRest(e,t,true)}function parseSuperExpression(){const e=getNodePos();let t=parseTokenNode();if(token()===30){const e=getNodePos();const n=tryParse(parseTypeArgumentsInExpression);if(n!==void 0){parseErrorAt(e,getNodePos(),wt.super_may_not_use_type_arguments);if(!isTemplateStartOfTaggedTemplate()){t=l.createExpressionWithTypeArguments(t,n)}}}if(token()===21||token()===25||token()===23){return t}parseExpectedToken(25,wt.super_must_be_followed_by_an_argument_list_or_member_access);return finishNode(x(t,parseRightSideOfDot(true,true,true)),e)}function parseJsxElementOrSelfClosingElementOrFragment(e,t,n,r=false){const i=getNodePos();const o=parseJsxOpeningOrSelfClosingElementOrOpeningFragment(e);let a;if(o.kind===286){let t=parseJsxChildren(o);let r;const s=t[t.length-1];if((s==null?void 0:s.kind)===284&&!tagNamesAreEquivalent(s.openingElement.tagName,s.closingElement.tagName)&&tagNamesAreEquivalent(o.tagName,s.closingElement.tagName)){const e=s.children.end;const n=finishNode(l.createJsxElement(s.openingElement,s.children,finishNode(l.createJsxClosingElement(finishNode(g(""),e,e)),e,e)),s.openingElement.pos,e);t=createNodeArray([...t.slice(0,t.length-1),n],t.pos,e);r=s.closingElement}else{r=parseJsxClosingElement(o,e);if(!tagNamesAreEquivalent(o.tagName,r.tagName)){if(n&&isJsxOpeningElement(n)&&tagNamesAreEquivalent(r.tagName,n.tagName)){parseErrorAtRange(o.tagName,wt.JSX_element_0_has_no_corresponding_closing_tag,getTextOfNodeFromSourceText(W,o.tagName))}else{parseErrorAtRange(r.tagName,wt.Expected_corresponding_JSX_closing_tag_for_0,getTextOfNodeFromSourceText(W,o.tagName))}}}a=finishNode(l.createJsxElement(o,t,r),i)}else if(o.kind===289){a=finishNode(l.createJsxFragment(o,parseJsxChildren(o),parseJsxClosingFragment(e)),i)}else{S.assert(o.kind===285);a=o}if(!r&&e&&token()===30){const e=typeof t==="undefined"?a.pos:t;const n=tryParse((()=>parseJsxElementOrSelfClosingElementOrFragment(true,e)));if(n){const t=createMissingNode(28,false);setTextRangePosWidth(t,n.pos,0);parseErrorAt(skipTrivia(W,e),n.end,wt.JSX_expressions_must_have_one_parent_element);return finishNode(l.createBinaryExpression(a,t,n),i)}}return a}function parseJsxText(){const e=getNodePos();const n=l.createJsxText(t.getTokenValue(),K===13);K=t.scanJsxToken();return finishNode(n,e)}function parseJsxChild(e,t){switch(t){case 1:if(isJsxOpeningFragment(e)){parseErrorAtRange(e,wt.JSX_fragment_has_no_corresponding_closing_tag)}else{const t=e.tagName;const n=Math.min(skipTrivia(W,t.pos),t.end);parseErrorAt(n,t.end,wt.JSX_element_0_has_no_corresponding_closing_tag,getTextOfNodeFromSourceText(W,e.tagName))}return void 0;case 31:case 7:return void 0;case 12:case 13:return parseJsxText();case 19:return parseJsxExpression(false);case 30:return parseJsxElementOrSelfClosingElementOrFragment(false,void 0,e);default:return S.assertNever(t)}}function parseJsxChildren(e){const n=[];const r=getNodePos();const i=Y;Y|=1<<14;while(true){const r=parseJsxChild(e,K=t.reScanJsxToken());if(!r)break;n.push(r);if(isJsxOpeningElement(e)&&(r==null?void 0:r.kind)===284&&!tagNamesAreEquivalent(r.openingElement.tagName,r.closingElement.tagName)&&tagNamesAreEquivalent(e.tagName,r.closingElement.tagName)){break}}Y=i;return createNodeArray(n,r)}function parseJsxAttributes(){const e=getNodePos();return finishNode(l.createJsxAttributes(parseList(13,parseJsxAttribute)),e)}function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(e){const t=getNodePos();parseExpected(30);if(token()===32){scanJsxText();return finishNode(l.createJsxOpeningFragment(),t)}const n=parseJsxElementName();const r=(ee&524288)===0?tryParseTypeArguments():void 0;const i=parseJsxAttributes();let o;if(token()===32){scanJsxText();o=l.createJsxOpeningElement(n,r,i)}else{parseExpected(44);if(parseExpected(32,void 0,false)){if(e){nextToken()}else{scanJsxText()}}o=l.createJsxSelfClosingElement(n,r,i)}return finishNode(o,t)}function parseJsxElementName(){const e=getNodePos();const t=parseJsxTagName();if(isJsxNamespacedName(t)){return t}let n=t;while(parseOptional(25)){n=finishNode(x(n,parseRightSideOfDot(true,false,false)),e)}return n}function parseJsxTagName(){const e=getNodePos();scanJsxIdentifier();const t=token()===110;const n=parseIdentifierNameErrorOnUnicodeEscapeSequence();if(parseOptional(59)){scanJsxIdentifier();return finishNode(l.createJsxNamespacedName(n,parseIdentifierNameErrorOnUnicodeEscapeSequence()),e)}return t?finishNode(l.createToken(110),e):n}function parseJsxExpression(e){const t=getNodePos();if(!parseExpected(19)){return void 0}let n;let r;if(token()!==20){if(!e){n=parseOptionalToken(26)}r=parseExpression()}if(e){parseExpected(20)}else{if(parseExpected(20,void 0,false)){scanJsxText()}}return finishNode(l.createJsxExpression(n,r),t)}function parseJsxAttribute(){if(token()===19){return parseJsxSpreadAttribute()}const e=getNodePos();return finishNode(l.createJsxAttribute(parseJsxAttributeName(),parseJsxAttributeValue()),e)}function parseJsxAttributeValue(){if(token()===64){if(scanJsxAttributeValue()===11){return parseLiteralNode()}if(token()===19){return parseJsxExpression(true)}if(token()===30){return parseJsxElementOrSelfClosingElementOrFragment(true)}parseErrorAtCurrentToken(wt.or_JSX_element_expected)}return void 0}function parseJsxAttributeName(){const e=getNodePos();scanJsxIdentifier();const t=parseIdentifierNameErrorOnUnicodeEscapeSequence();if(parseOptional(59)){scanJsxIdentifier();return finishNode(l.createJsxNamespacedName(t,parseIdentifierNameErrorOnUnicodeEscapeSequence()),e)}return t}function parseJsxSpreadAttribute(){const e=getNodePos();parseExpected(19);parseExpected(26);const t=parseExpression();parseExpected(20);return finishNode(l.createJsxSpreadAttribute(t),e)}function parseJsxClosingElement(e,t){const n=getNodePos();parseExpected(31);const r=parseJsxElementName();if(parseExpected(32,void 0,false)){if(t||!tagNamesAreEquivalent(e.tagName,r)){nextToken()}else{scanJsxText()}}return finishNode(l.createJsxClosingElement(r),n)}function parseJsxClosingFragment(e){const t=getNodePos();parseExpected(31);if(parseExpected(32,wt.Expected_corresponding_closing_tag_for_JSX_fragment,false)){if(e){nextToken()}else{scanJsxText()}}return finishNode(l.createJsxJsxClosingFragment(),t)}function parseTypeAssertion(){S.assert(V!==1,"Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments.");const e=getNodePos();parseExpected(30);const t=parseType();parseExpected(32);const n=parseSimpleUnaryExpression();return finishNode(l.createTypeAssertion(t,n),e)}function nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate(){nextToken();return tokenIsIdentifierOrKeyword(token())||token()===23||isTemplateStartOfTaggedTemplate()}function isStartOfOptionalPropertyOrElementAccessChain(){return token()===29&&lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate)}function tryReparseOptionalChain(e){if(e.flags&64){return true}if(isNonNullExpression(e)){let t=e.expression;while(isNonNullExpression(t)&&!(t.flags&64)){t=t.expression}if(t.flags&64){while(isNonNullExpression(e)){e.flags|=64;e=e.expression}return true}}return false}function parsePropertyAccessExpressionRest(e,t,n){const r=parseRightSideOfDot(true,true,true);const i=n||tryReparseOptionalChain(t);const o=i?b(t,n,r):x(t,r);if(i&&isPrivateIdentifier(o.name)){parseErrorAtRange(o.name,wt.An_optional_chain_cannot_contain_private_identifiers)}if(isExpressionWithTypeArguments(t)&&t.typeArguments){const e=t.typeArguments.pos-1;const n=skipTrivia(W,t.typeArguments.end)+1;parseErrorAt(e,n,wt.An_instantiation_expression_cannot_be_followed_by_a_property_access)}return finishNode(o,e)}function parseElementAccessExpressionRest(e,t,n){let r;if(token()===24){r=createMissingNode(80,true,wt.An_element_access_expression_should_take_an_argument)}else{const e=allowInAnd(parseExpression);if(isStringOrNumericLiteralLike(e)){e.text=internIdentifier(e.text)}r=e}parseExpected(24);const i=n||tryReparseOptionalChain(t)?E(t,n,r):C(t,r);return finishNode(i,e)}function parseMemberExpressionRest(e,n,r){while(true){let i;let o=false;if(r&&isStartOfOptionalPropertyOrElementAccessChain()){i=parseExpectedToken(29);o=tokenIsIdentifierOrKeyword(token())}else{o=parseOptional(25)}if(o){n=parsePropertyAccessExpressionRest(e,n,i);continue}if((i||!inDecoratorContext())&&parseOptional(23)){n=parseElementAccessExpressionRest(e,n,i);continue}if(isTemplateStartOfTaggedTemplate()){n=!i&&n.kind===233?parseTaggedTemplateRest(e,n.expression,i,n.typeArguments):parseTaggedTemplateRest(e,n,i,void 0);continue}if(!i){if(token()===54&&!t.hasPrecedingLineBreak()){nextToken();n=finishNode(l.createNonNullExpression(n),e);continue}const r=tryParse(parseTypeArgumentsInExpression);if(r){n=finishNode(l.createExpressionWithTypeArguments(n,r),e);continue}}return n}}function isTemplateStartOfTaggedTemplate(){return token()===15||token()===16}function parseTaggedTemplateRest(e,t,n,r){const i=l.createTaggedTemplateExpression(t,r,token()===15?(reScanTemplateToken(true),parseLiteralNode()):parseTemplateExpression(true));if(n||t.flags&64){i.flags|=64}i.questionDotToken=n;return finishNode(i,e)}function parseCallExpressionRest(e,t){while(true){t=parseMemberExpressionRest(e,t,true);let n;const r=parseOptionalToken(29);if(r){n=tryParse(parseTypeArgumentsInExpression);if(isTemplateStartOfTaggedTemplate()){t=parseTaggedTemplateRest(e,t,r,n);continue}}if(n||token()===21){if(!r&&t.kind===233){n=t.typeArguments;t=t.expression}const i=parseArgumentList();const o=r||tryReparseOptionalChain(t)?k(t,r,n,i):N(t,n,i);t=finishNode(o,e);continue}if(r){const n=createMissingNode(80,false,wt.Identifier_expected);t=finishNode(b(t,r,n),e)}break}return t}function parseArgumentList(){parseExpected(21);const e=parseDelimitedList(11,parseArgumentExpression);parseExpected(22);return e}function parseTypeArgumentsInExpression(){if((ee&524288)!==0){return void 0}if(reScanLessThanToken()!==30){return void 0}nextToken();const e=parseDelimitedList(20,parseType);if(reScanGreaterToken()!==32){return void 0}nextToken();return e&&canFollowTypeArgumentsInExpression()?e:void 0}function canFollowTypeArgumentsInExpression(){switch(token()){case 21:case 15:case 16:return true;case 30:case 32:case 40:case 41:return false}return t.hasPrecedingLineBreak()||isBinaryOperator2()||!isStartOfExpression()}function parsePrimaryExpression(){switch(token()){case 15:if(t.getTokenFlags()&26656){reScanTemplateToken(false)}case 9:case 10:case 11:return parseLiteralNode();case 110:case 108:case 106:case 112:case 97:return parseTokenNode();case 21:return parseParenthesizedExpression();case 23:return parseArrayLiteralExpression();case 19:return parseObjectLiteralExpression();case 134:if(!lookAhead(nextTokenIsFunctionKeywordOnSameLine)){break}return parseFunctionExpression();case 60:return parseDecoratedExpression();case 86:return parseClassExpression();case 100:return parseFunctionExpression();case 105:return parseNewExpressionOrNewDotTarget();case 44:case 69:if(reScanSlashToken()===14){return parseLiteralNode()}break;case 16:return parseTemplateExpression(false);case 81:return parsePrivateIdentifier()}return parseIdentifier(wt.Expression_expected)}function parseParenthesizedExpression(){const e=getNodePos();const t=hasPrecedingJSDocComment();parseExpected(21);const n=allowInAnd(parseExpression);parseExpected(22);return withJSDoc(finishNode(P(n),e),t)}function parseSpreadElement(){const e=getNodePos();parseExpected(26);const t=parseAssignmentExpressionOrHigher(true);return finishNode(l.createSpreadElement(t),e)}function parseArgumentOrArrayLiteralElement(){return token()===26?parseSpreadElement():token()===28?finishNode(l.createOmittedExpression(),getNodePos()):parseAssignmentExpressionOrHigher(true)}function parseArgumentExpression(){return doOutsideOfContext(n,parseArgumentOrArrayLiteralElement)}function parseArrayLiteralExpression(){const e=getNodePos();const n=t.getTokenStart();const r=parseExpected(23);const i=t.hasPrecedingLineBreak();const o=parseDelimitedList(15,parseArgumentOrArrayLiteralElement);parseExpectedMatchingBrackets(23,24,r,n);return finishNode(T(o,i),e)}function parseObjectLiteralElement(){const e=getNodePos();const t=hasPrecedingJSDocComment();if(parseOptionalToken(26)){const n=parseAssignmentExpressionOrHigher(true);return withJSDoc(finishNode(l.createSpreadAssignment(n),e),t)}const n=parseModifiers(true);if(parseContextualModifier(139)){return parseAccessorDeclaration(e,t,n,177,0)}if(parseContextualModifier(153)){return parseAccessorDeclaration(e,t,n,178,0)}const r=parseOptionalToken(42);const i=isIdentifier2();const o=parsePropertyName();const a=parseOptionalToken(58);const s=parseOptionalToken(54);if(r||token()===21||token()===30){return parseMethodDeclaration(e,t,n,r,o,a,s)}let c;const d=i&&token()!==59;if(d){const e=parseOptionalToken(64);const t=e?allowInAnd((()=>parseAssignmentExpressionOrHigher(true))):void 0;c=l.createShorthandPropertyAssignment(o,t);c.equalsToken=e}else{parseExpected(59);const e=allowInAnd((()=>parseAssignmentExpressionOrHigher(true)));c=l.createPropertyAssignment(o,e)}c.modifiers=n;c.questionToken=a;c.exclamationToken=s;return withJSDoc(finishNode(c,e),t)}function parseObjectLiteralExpression(){const e=getNodePos();const n=t.getTokenStart();const r=parseExpected(19);const i=t.hasPrecedingLineBreak();const o=parseDelimitedList(12,parseObjectLiteralElement,true);parseExpectedMatchingBrackets(19,20,r,n);return finishNode(v(o,i),e)}function parseFunctionExpression(){const e=inDecoratorContext();setDecoratorContext(false);const t=getNodePos();const n=hasPrecedingJSDocComment();const r=parseModifiers(false);parseExpected(100);const i=parseOptionalToken(42);const o=i?1:0;const a=some(r,isAsyncModifier)?2:0;const s=o&&a?doInYieldAndAwaitContext(parseOptionalBindingIdentifier):o?doInYieldContext(parseOptionalBindingIdentifier):a?doInAwaitContext(parseOptionalBindingIdentifier):parseOptionalBindingIdentifier();const c=parseTypeParameters();const d=parseParameters(o|a);const p=parseReturnType(59,false);const u=parseFunctionBlock(o|a);setDecoratorContext(e);const f=l.createFunctionExpression(r,i,s,c,d,p,u);return withJSDoc(finishNode(f,t),n)}function parseOptionalBindingIdentifier(){return isBindingIdentifier()?parseBindingIdentifier():void 0}function parseNewExpressionOrNewDotTarget(){const e=getNodePos();parseExpected(105);if(parseOptional(25)){const t=parseIdentifierName();return finishNode(l.createMetaProperty(105,t),e)}const t=getNodePos();let n=parseMemberExpressionRest(t,parsePrimaryExpression(),false);let r;if(n.kind===233){r=n.typeArguments;n=n.expression}if(token()===29){parseErrorAtCurrentToken(wt.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0,getTextOfNodeFromSourceText(W,n))}const i=token()===21?parseArgumentList():void 0;return finishNode(F(n,r,i),e)}function parseBlock(e,n){const r=getNodePos();const i=hasPrecedingJSDocComment();const o=t.getTokenStart();const a=parseExpected(19,n);if(a||e){const e=t.hasPrecedingLineBreak();const n=parseList(1,parseStatement);parseExpectedMatchingBrackets(19,20,a,o);const s=withJSDoc(finishNode(D(n,e),r),i);if(token()===64){parseErrorAtCurrentToken(wt.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses);nextToken()}return s}else{const e=createMissingList();return withJSDoc(finishNode(D(e,void 0),r),i)}}function parseFunctionBlock(e,t){const n=inYieldContext();setYieldContext(!!(e&1));const r=inAwaitContext();setAwaitContext(!!(e&2));const i=te;te=false;const o=inDecoratorContext();if(o){setDecoratorContext(false)}const a=parseBlock(!!(e&16),t);if(o){setDecoratorContext(true)}te=i;setYieldContext(n);setAwaitContext(r);return a}function parseEmptyStatement(){const e=getNodePos();const t=hasPrecedingJSDocComment();parseExpected(27);return withJSDoc(finishNode(l.createEmptyStatement(),e),t)}function parseIfStatement(){const e=getNodePos();const n=hasPrecedingJSDocComment();parseExpected(101);const r=t.getTokenStart();const i=parseExpected(21);const o=allowInAnd(parseExpression);parseExpectedMatchingBrackets(21,22,i,r);const a=parseStatement();const s=parseOptional(93)?parseStatement():void 0;return withJSDoc(finishNode(O(o,a,s),e),n)}function parseDoStatement(){const e=getNodePos();const n=hasPrecedingJSDocComment();parseExpected(92);const r=parseStatement();parseExpected(117);const i=t.getTokenStart();const o=parseExpected(21);const a=allowInAnd(parseExpression);parseExpectedMatchingBrackets(21,22,o,i);parseOptional(27);return withJSDoc(finishNode(l.createDoStatement(r,a),e),n)}function parseWhileStatement(){const e=getNodePos();const n=hasPrecedingJSDocComment();parseExpected(117);const r=t.getTokenStart();const i=parseExpected(21);const o=allowInAnd(parseExpression);parseExpectedMatchingBrackets(21,22,i,r);const a=parseStatement();return withJSDoc(finishNode(w(o,a),e),n)}function parseForOrForInOrForOfStatement(){const e=getNodePos();const t=hasPrecedingJSDocComment();parseExpected(99);const n=parseOptionalToken(135);parseExpected(21);let r;if(token()!==27){if(token()===115||token()===121||token()===87||token()===160&&lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLineDisallowOf)||token()===135&&lookAhead(nextTokenIsUsingKeywordThenBindingIdentifierOrStartOfObjectDestructuringOnSameLine)){r=parseVariableDeclarationList(true)}else{r=disallowInAnd(parseExpression)}}let i;if(n?parseExpected(165):parseOptional(165)){const e=allowInAnd((()=>parseAssignmentExpressionOrHigher(true)));parseExpected(22);i=M(n,r,e,parseStatement())}else if(parseOptional(103)){const e=allowInAnd(parseExpression);parseExpected(22);i=l.createForInStatement(r,e,parseStatement())}else{parseExpected(27);const e=token()!==27&&token()!==22?allowInAnd(parseExpression):void 0;parseExpected(27);const t=token()!==22?allowInAnd(parseExpression):void 0;parseExpected(22);i=L(r,e,t,parseStatement())}return withJSDoc(finishNode(i,e),t)}function parseBreakOrContinueStatement(e){const t=getNodePos();const n=hasPrecedingJSDocComment();parseExpected(e===252?83:88);const r=canParseSemicolon()?void 0:parseIdentifier();parseSemicolon();const i=e===252?l.createBreakStatement(r):l.createContinueStatement(r);return withJSDoc(finishNode(i,t),n)}function parseReturnStatement(){const e=getNodePos();const t=hasPrecedingJSDocComment();parseExpected(107);const n=canParseSemicolon()?void 0:allowInAnd(parseExpression);parseSemicolon();return withJSDoc(finishNode(l.createReturnStatement(n),e),t)}function parseWithStatement(){const e=getNodePos();const n=hasPrecedingJSDocComment();parseExpected(118);const r=t.getTokenStart();const i=parseExpected(21);const o=allowInAnd(parseExpression);parseExpectedMatchingBrackets(21,22,i,r);const a=doInsideOfContext(67108864,parseStatement);return withJSDoc(finishNode(l.createWithStatement(o,a),e),n)}function parseCaseClause(){const e=getNodePos();const t=hasPrecedingJSDocComment();parseExpected(84);const n=allowInAnd(parseExpression);parseExpected(59);const r=parseList(3,parseStatement);return withJSDoc(finishNode(l.createCaseClause(n,r),e),t)}function parseDefaultClause(){const e=getNodePos();parseExpected(90);parseExpected(59);const t=parseList(3,parseStatement);return finishNode(l.createDefaultClause(t),e)}function parseCaseOrDefaultClause(){return token()===84?parseCaseClause():parseDefaultClause()}function parseCaseBlock(){const e=getNodePos();parseExpected(19);const t=parseList(2,parseCaseOrDefaultClause);parseExpected(20);return finishNode(l.createCaseBlock(t),e)}function parseSwitchStatement(){const e=getNodePos();const t=hasPrecedingJSDocComment();parseExpected(109);parseExpected(21);const n=allowInAnd(parseExpression);parseExpected(22);const r=parseCaseBlock();return withJSDoc(finishNode(l.createSwitchStatement(n,r),e),t)}function parseThrowStatement(){const e=getNodePos();const n=hasPrecedingJSDocComment();parseExpected(111);let r=t.hasPrecedingLineBreak()?void 0:allowInAnd(parseExpression);if(r===void 0){X++;r=finishNode(g(""),getNodePos())}if(!tryParseSemicolon()){parseErrorForMissingSemicolonAfter(r)}return withJSDoc(finishNode(l.createThrowStatement(r),e),n)}function parseTryStatement(){const e=getNodePos();const t=hasPrecedingJSDocComment();parseExpected(113);const n=parseBlock(false);const r=token()===85?parseCatchClause():void 0;let i;if(!r||token()===98){parseExpected(98,wt.catch_or_finally_expected);i=parseBlock(false)}return withJSDoc(finishNode(l.createTryStatement(n,r,i),e),t)}function parseCatchClause(){const e=getNodePos();parseExpected(85);let t;if(parseOptional(21)){t=parseVariableDeclaration();parseExpected(22)}else{t=void 0}const n=parseBlock(false);return finishNode(l.createCatchClause(t,n),e)}function parseDebuggerStatement(){const e=getNodePos();const t=hasPrecedingJSDocComment();parseExpected(89);parseSemicolon();return withJSDoc(finishNode(l.createDebuggerStatement(),e),t)}function parseExpressionOrLabeledStatement(){const e=getNodePos();let t=hasPrecedingJSDocComment();let n;const r=token()===21;const i=allowInAnd(parseExpression);if(isIdentifier(i)&&parseOptional(59)){n=l.createLabeledStatement(i,parseStatement())}else{if(!tryParseSemicolon()){parseErrorForMissingSemicolonAfter(i)}n=A(i);if(r){t=false}}return withJSDoc(finishNode(n,e),t)}function nextTokenIsIdentifierOrKeywordOnSameLine(){nextToken();return tokenIsIdentifierOrKeyword(token())&&!t.hasPrecedingLineBreak()}function nextTokenIsClassKeywordOnSameLine(){nextToken();return token()===86&&!t.hasPrecedingLineBreak()}function nextTokenIsFunctionKeywordOnSameLine(){nextToken();return token()===100&&!t.hasPrecedingLineBreak()}function nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine(){nextToken();return(tokenIsIdentifierOrKeyword(token())||token()===9||token()===10||token()===11)&&!t.hasPrecedingLineBreak()}function isDeclaration2(){while(true){switch(token()){case 115:case 121:case 87:case 100:case 86:case 94:return true;case 160:return isUsingDeclaration();case 135:return isAwaitUsingDeclaration();case 120:case 156:return nextTokenIsIdentifierOnSameLine();case 144:case 145:return nextTokenIsIdentifierOrStringLiteralOnSameLine();case 128:case 129:case 134:case 138:case 123:case 124:case 125:case 148:const e=token();nextToken();if(t.hasPrecedingLineBreak()){return false}if(e===138&&token()===156){return true}continue;case 162:nextToken();return token()===19||token()===80||token()===95;case 102:nextToken();return token()===11||token()===42||token()===19||tokenIsIdentifierOrKeyword(token());case 95:let n=nextToken();if(n===156){n=lookAhead(nextToken)}if(n===64||n===42||n===19||n===90||n===130||n===60){return true}continue;case 126:nextToken();continue;default:return false}}}function isStartOfDeclaration(){return lookAhead(isDeclaration2)}function isStartOfStatement(){switch(token()){case 60:case 27:case 19:case 115:case 121:case 160:case 100:case 86:case 94:case 101:case 92:case 117:case 99:case 88:case 83:case 107:case 118:case 109:case 111:case 113:case 89:case 85:case 98:return true;case 102:return isStartOfDeclaration()||lookAhead(nextTokenIsOpenParenOrLessThanOrDot);case 87:case 95:return isStartOfDeclaration();case 134:case 138:case 120:case 144:case 145:case 156:case 162:return true;case 129:case 125:case 123:case 124:case 126:case 148:return isStartOfDeclaration()||!lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);default:return isStartOfExpression()}}function nextTokenIsBindingIdentifierOrStartOfDestructuring(){nextToken();return isBindingIdentifier()||token()===19||token()===23}function isLetDeclaration(){return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuring)}function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLineDisallowOf(){return nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(true)}function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(e){nextToken();if(e&&token()===165)return false;return(isBindingIdentifier()||token()===19)&&!t.hasPrecedingLineBreak()}function isUsingDeclaration(){return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine)}function nextTokenIsUsingKeywordThenBindingIdentifierOrStartOfObjectDestructuringOnSameLine(e){if(nextToken()===160){return nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(e)}return false}function isAwaitUsingDeclaration(){return lookAhead(nextTokenIsUsingKeywordThenBindingIdentifierOrStartOfObjectDestructuringOnSameLine)}function parseStatement(){switch(token()){case 27:return parseEmptyStatement();case 19:return parseBlock(false);case 115:return parseVariableStatement(getNodePos(),hasPrecedingJSDocComment(),void 0);case 121:if(isLetDeclaration()){return parseVariableStatement(getNodePos(),hasPrecedingJSDocComment(),void 0)}break;case 135:if(isAwaitUsingDeclaration()){return parseVariableStatement(getNodePos(),hasPrecedingJSDocComment(),void 0)}break;case 160:if(isUsingDeclaration()){return parseVariableStatement(getNodePos(),hasPrecedingJSDocComment(),void 0)}break;case 100:return parseFunctionDeclaration(getNodePos(),hasPrecedingJSDocComment(),void 0);case 86:return parseClassDeclaration(getNodePos(),hasPrecedingJSDocComment(),void 0);case 101:return parseIfStatement();case 92:return parseDoStatement();case 117:return parseWhileStatement();case 99:return parseForOrForInOrForOfStatement();case 88:return parseBreakOrContinueStatement(251);case 83:return parseBreakOrContinueStatement(252);case 107:return parseReturnStatement();case 118:return parseWithStatement();case 109:return parseSwitchStatement();case 111:return parseThrowStatement();case 113:case 85:case 98:return parseTryStatement();case 89:return parseDebuggerStatement();case 60:return parseDeclaration();case 134:case 120:case 156:case 144:case 145:case 138:case 87:case 94:case 95:case 102:case 123:case 124:case 125:case 128:case 129:case 126:case 148:case 162:if(isStartOfDeclaration()){return parseDeclaration()}break}return parseExpressionOrLabeledStatement()}function isDeclareModifier(e){return e.kind===138}function parseDeclaration(){const e=getNodePos();const t=hasPrecedingJSDocComment();const n=parseModifiers(true);const r=some(n,isDeclareModifier);if(r){const r=tryReuseAmbientDeclaration(e);if(r){return r}for(const e of n){e.flags|=33554432}return doInsideOfContext(33554432,(()=>parseDeclarationWorker(e,t,n)))}else{return parseDeclarationWorker(e,t,n)}}function tryReuseAmbientDeclaration(e){return doInsideOfContext(33554432,(()=>{const t=currentNode(Y,e);if(t){return consumeNode(t)}}))}function parseDeclarationWorker(e,t,n){switch(token()){case 115:case 121:case 87:case 160:case 135:return parseVariableStatement(e,t,n);case 100:return parseFunctionDeclaration(e,t,n);case 86:return parseClassDeclaration(e,t,n);case 120:return parseInterfaceDeclaration(e,t,n);case 156:return parseTypeAliasDeclaration(e,t,n);case 94:return parseEnumDeclaration(e,t,n);case 162:case 144:case 145:return parseModuleDeclaration(e,t,n);case 102:return parseImportDeclarationOrImportEqualsDeclaration(e,t,n);case 95:nextToken();switch(token()){case 90:case 64:return parseExportAssignment(e,t,n);case 130:return parseNamespaceExportDeclaration(e,t,n);default:return parseExportDeclaration(e,t,n)}default:if(n){const t=createMissingNode(282,true,wt.Declaration_expected);setTextRangePos(t,e);t.modifiers=n;return t}return void 0}}function nextTokenIsStringLiteral(){return nextToken()===11}function nextTokenIsFromKeywordOrEqualsToken(){nextToken();return token()===161||token()===64}function nextTokenIsIdentifierOrStringLiteralOnSameLine(){nextToken();return!t.hasPrecedingLineBreak()&&(isIdentifier2()||token()===11)}function parseFunctionBlockOrSemicolon(e,t){if(token()!==19){if(e&4){parseTypeMemberSemicolon();return}if(canParseSemicolon()){parseSemicolon();return}}return parseFunctionBlock(e,t)}function parseArrayBindingElement(){const e=getNodePos();if(token()===28){return finishNode(l.createOmittedExpression(),e)}const t=parseOptionalToken(26);const n=parseIdentifierOrPattern();const r=parseInitializer();return finishNode(l.createBindingElement(t,void 0,n,r),e)}function parseObjectBindingElement(){const e=getNodePos();const t=parseOptionalToken(26);const n=isBindingIdentifier();let r=parsePropertyName();let i;if(n&&token()!==59){i=r;r=void 0}else{parseExpected(59);i=parseIdentifierOrPattern()}const o=parseInitializer();return finishNode(l.createBindingElement(t,r,i,o),e)}function parseObjectBindingPattern(){const e=getNodePos();parseExpected(19);const t=allowInAnd((()=>parseDelimitedList(9,parseObjectBindingElement)));parseExpected(20);return finishNode(l.createObjectBindingPattern(t),e)}function parseArrayBindingPattern(){const e=getNodePos();parseExpected(23);const t=allowInAnd((()=>parseDelimitedList(10,parseArrayBindingElement)));parseExpected(24);return finishNode(l.createArrayBindingPattern(t),e)}function isBindingIdentifierOrPrivateIdentifierOrPattern(){return token()===19||token()===23||token()===81||isBindingIdentifier()}function parseIdentifierOrPattern(e){if(token()===23){return parseArrayBindingPattern()}if(token()===19){return parseObjectBindingPattern()}return parseBindingIdentifier(e)}function parseVariableDeclarationAllowExclamation(){return parseVariableDeclaration(true)}function parseVariableDeclaration(e){const n=getNodePos();const r=hasPrecedingJSDocComment();const i=parseIdentifierOrPattern(wt.Private_identifiers_are_not_allowed_in_variable_declarations);let o;if(e&&i.kind===80&&token()===54&&!t.hasPrecedingLineBreak()){o=parseTokenNode()}const a=parseTypeAnnotation();const s=isInOrOfKeyword(token())?void 0:parseInitializer();const c=R(i,o,a,s);return withJSDoc(finishNode(c,n),r)}function parseVariableDeclarationList(e){const t=getNodePos();let n=0;switch(token()){case 115:break;case 121:n|=1;break;case 87:n|=2;break;case 160:n|=4;break;case 135:S.assert(isAwaitUsingDeclaration());n|=6;nextToken();break;default:S.fail()}nextToken();let r;if(token()===165&&lookAhead(canFollowContextualOfKeyword)){r=createMissingList()}else{const t=inDisallowInContext();setDisallowInContext(e);r=parseDelimitedList(8,e?parseVariableDeclaration:parseVariableDeclarationAllowExclamation);setDisallowInContext(t)}return finishNode(B(r,n),t)}function canFollowContextualOfKeyword(){return nextTokenIsIdentifier()&&nextToken()===22}function parseVariableStatement(e,t,n){const r=parseVariableDeclarationList(false);parseSemicolon();const i=I(n,r);return withJSDoc(finishNode(i,e),t)}function parseFunctionDeclaration(e,t,n){const r=inAwaitContext();const i=modifiersToFlags(n);parseExpected(100);const o=parseOptionalToken(42);const a=i&2048?parseOptionalBindingIdentifier():parseBindingIdentifier();const s=o?1:0;const c=i&1024?2:0;const d=parseTypeParameters();if(i&32)setAwaitContext(true);const p=parseParameters(s|c);const u=parseReturnType(59,false);const f=parseFunctionBlockOrSemicolon(s|c,wt.or_expected);setAwaitContext(r);const m=l.createFunctionDeclaration(n,o,a,d,p,u,f);return withJSDoc(finishNode(m,e),t)}function parseConstructorName(){if(token()===137){return parseExpected(137)}if(token()===11&&lookAhead(nextToken)===21){return tryParse((()=>{const e=parseLiteralNode();return e.text==="constructor"?e:void 0}))}}function tryParseConstructorDeclaration(e,t,n){return tryParse((()=>{if(parseConstructorName()){const r=parseTypeParameters();const i=parseParameters(0);const o=parseReturnType(59,false);const a=parseFunctionBlockOrSemicolon(0,wt.or_expected);const s=l.createConstructorDeclaration(n,i,a);s.typeParameters=r;s.type=o;return withJSDoc(finishNode(s,e),t)}}))}function parseMethodDeclaration(e,t,n,r,i,o,a,s){const c=r?1:0;const d=some(n,isAsyncModifier)?2:0;const p=parseTypeParameters();const u=parseParameters(c|d);const f=parseReturnType(59,false);const m=parseFunctionBlockOrSemicolon(c|d,s);const _=l.createMethodDeclaration(n,r,i,o,p,u,f,m);_.exclamationToken=a;return withJSDoc(finishNode(_,e),t)}function parsePropertyDeclaration(e,n,r,i,o){const a=!o&&!t.hasPrecedingLineBreak()?parseOptionalToken(54):void 0;const s=parseTypeAnnotation();const c=doOutsideOfContext(16384|65536|8192,parseInitializer);parseSemicolonAfterPropertyName(i,s,c);const d=l.createPropertyDeclaration(r,i,o||a,s,c);return withJSDoc(finishNode(d,e),n)}function parsePropertyOrMethodDeclaration(e,t,n){const r=parseOptionalToken(42);const i=parsePropertyName();const o=parseOptionalToken(58);if(r||token()===21||token()===30){return parseMethodDeclaration(e,t,n,r,i,o,void 0,wt.or_expected)}return parsePropertyDeclaration(e,t,n,i,o)}function parseAccessorDeclaration(e,t,n,r,i){const o=parsePropertyName();const a=parseTypeParameters();const s=parseParameters(0);const c=parseReturnType(59,false);const d=parseFunctionBlockOrSemicolon(i);const p=r===177?l.createGetAccessorDeclaration(n,o,s,c,d):l.createSetAccessorDeclaration(n,o,s,d);p.typeParameters=a;if(isSetAccessorDeclaration(p))p.type=c;return withJSDoc(finishNode(p,e),t)}function isClassMemberStart(){let e;if(token()===60){return true}while(isModifierKind(token())){e=token();if(isClassMemberModifier(e)){return true}nextToken()}if(token()===42){return true}if(isLiteralPropertyName()){e=token();nextToken()}if(token()===23){return true}if(e!==void 0){if(!isKeyword(e)||e===153||e===139){return true}switch(token()){case 21:case 30:case 54:case 59:case 64:case 58:return true;default:return canParseSemicolon()}}return false}function parseClassStaticBlockDeclaration(e,t,n){parseExpectedToken(126);const r=parseClassStaticBlockBody();const i=withJSDoc(finishNode(l.createClassStaticBlockDeclaration(r),e),t);i.modifiers=n;return i}function parseClassStaticBlockBody(){const e=inYieldContext();const t=inAwaitContext();setYieldContext(false);setAwaitContext(true);const n=parseBlock(false);setYieldContext(e);setAwaitContext(t);return n}function parseDecoratorExpression(){if(inAwaitContext()&&token()===135){const e=getNodePos();const t=parseIdentifier(wt.Expression_expected);nextToken();const n=parseMemberExpressionRest(e,t,true);return parseCallExpressionRest(e,n)}return parseLeftHandSideExpressionOrHigher()}function tryParseDecorator(){const e=getNodePos();if(!parseOptional(60)){return void 0}const t=doInDecoratorContext(parseDecoratorExpression);return finishNode(l.createDecorator(t),e)}function tryParseModifier(e,t,n){const r=getNodePos();const i=token();if(token()===87&&t){if(!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)){return void 0}}else if(n&&token()===126&&lookAhead(nextTokenIsOpenBrace)){return void 0}else if(e&&token()===126){return void 0}else{if(!parseAnyContextualModifier()){return void 0}}return finishNode(h(i),r)}function parseModifiers(e,t,n){const r=getNodePos();let i;let o,a,s=false,c=false,l=false;if(e&&token()===60){while(o=tryParseDecorator()){i=append(i,o)}}while(a=tryParseModifier(s,t,n)){if(a.kind===126)s=true;i=append(i,a);c=true}if(c&&e&&token()===60){while(o=tryParseDecorator()){i=append(i,o);l=true}}if(l){while(a=tryParseModifier(s,t,n)){if(a.kind===126)s=true;i=append(i,a)}}return i&&createNodeArray(i,r)}function parseModifiersForArrowFunction(){let e;if(token()===134){const t=getNodePos();nextToken();const n=finishNode(h(134),t);e=createNodeArray([n],t)}return e}function parseClassElement(){const e=getNodePos();const t=hasPrecedingJSDocComment();if(token()===27){nextToken();return withJSDoc(finishNode(l.createSemicolonClassElement(),e),t)}const n=parseModifiers(true,true,true);if(token()===126&&lookAhead(nextTokenIsOpenBrace)){return parseClassStaticBlockDeclaration(e,t,n)}if(parseContextualModifier(139)){return parseAccessorDeclaration(e,t,n,177,0)}if(parseContextualModifier(153)){return parseAccessorDeclaration(e,t,n,178,0)}if(token()===137||token()===11){const r=tryParseConstructorDeclaration(e,t,n);if(r){return r}}if(isIndexSignature()){return parseIndexSignatureDeclaration(e,t,n)}if(tokenIsIdentifierOrKeyword(token())||token()===11||token()===9||token()===10||token()===42||token()===23){const r=some(n,isDeclareModifier);if(r){for(const e of n){e.flags|=33554432}return doInsideOfContext(33554432,(()=>parsePropertyOrMethodDeclaration(e,t,n)))}else{return parsePropertyOrMethodDeclaration(e,t,n)}}if(n){const r=createMissingNode(80,true,wt.Declaration_expected);return parsePropertyDeclaration(e,t,n,r,void 0)}return S.fail("Should not have attempted to parse class member declaration.")}function parseDecoratedExpression(){const e=getNodePos();const t=hasPrecedingJSDocComment();const n=parseModifiers(true);if(token()===86){return parseClassDeclarationOrExpression(e,t,n,231)}const r=createMissingNode(282,true,wt.Expression_expected);setTextRangePos(r,e);r.modifiers=n;return r}function parseClassExpression(){return parseClassDeclarationOrExpression(getNodePos(),hasPrecedingJSDocComment(),void 0,231)}function parseClassDeclaration(e,t,n){return parseClassDeclarationOrExpression(e,t,n,263)}function parseClassDeclarationOrExpression(e,t,n,r){const i=inAwaitContext();parseExpected(86);const o=parseNameOfClassDeclarationOrExpression();const a=parseTypeParameters();if(some(n,isExportModifier))setAwaitContext(true);const s=parseHeritageClauses();let c;if(parseExpected(19)){c=parseClassMembers();parseExpected(20)}else{c=createMissingList()}setAwaitContext(i);const d=r===263?l.createClassDeclaration(n,o,a,s,c):l.createClassExpression(n,o,a,s,c);return withJSDoc(finishNode(d,e),t)}function parseNameOfClassDeclarationOrExpression(){return isBindingIdentifier()&&!isImplementsClause()?createIdentifier(isBindingIdentifier()):void 0}function isImplementsClause(){return token()===119&&lookAhead(nextTokenIsIdentifierOrKeyword)}function parseHeritageClauses(){if(isHeritageClause2()){return parseList(22,parseHeritageClause)}return void 0}function parseHeritageClause(){const e=getNodePos();const t=token();S.assert(t===96||t===119);nextToken();const n=parseDelimitedList(7,parseExpressionWithTypeArguments);return finishNode(l.createHeritageClause(t,n),e)}function parseExpressionWithTypeArguments(){const e=getNodePos();const t=parseLeftHandSideExpressionOrHigher();if(t.kind===233){return t}const n=tryParseTypeArguments();return finishNode(l.createExpressionWithTypeArguments(t,n),e)}function tryParseTypeArguments(){return token()===30?parseBracketedList(20,parseType,30,32):void 0}function isHeritageClause2(){return token()===96||token()===119}function parseClassMembers(){return parseList(5,parseClassElement)}function parseInterfaceDeclaration(e,t,n){parseExpected(120);const r=parseIdentifier();const i=parseTypeParameters();const o=parseHeritageClauses();const a=parseObjectTypeMembers();const s=l.createInterfaceDeclaration(n,r,i,o,a);return withJSDoc(finishNode(s,e),t)}function parseTypeAliasDeclaration(e,n,r){parseExpected(156);if(t.hasPrecedingLineBreak()){parseErrorAtCurrentToken(wt.Line_break_not_permitted_here)}const i=parseIdentifier();const o=parseTypeParameters();parseExpected(64);const a=token()===141&&tryParse(parseKeywordAndNoDot)||parseType();parseSemicolon();const s=l.createTypeAliasDeclaration(r,i,o,a);return withJSDoc(finishNode(s,e),n)}function parseEnumMember(){const e=getNodePos();const t=hasPrecedingJSDocComment();const n=parsePropertyName();const r=allowInAnd(parseInitializer);return withJSDoc(finishNode(l.createEnumMember(n,r),e),t)}function parseEnumDeclaration(e,t,n){parseExpected(94);const r=parseIdentifier();let i;if(parseExpected(19)){i=doOutsideOfYieldAndAwaitContext((()=>parseDelimitedList(6,parseEnumMember)));parseExpected(20)}else{i=createMissingList()}const o=l.createEnumDeclaration(n,r,i);return withJSDoc(finishNode(o,e),t)}function parseModuleBlock(){const e=getNodePos();let t;if(parseExpected(19)){t=parseList(1,parseStatement);parseExpected(20)}else{t=createMissingList()}return finishNode(l.createModuleBlock(t),e)}function parseModuleOrNamespaceDeclaration(e,t,n,r){const i=r&32;const o=r&8?parseIdentifierName():parseIdentifier();const a=parseOptional(25)?parseModuleOrNamespaceDeclaration(getNodePos(),false,void 0,8|i):parseModuleBlock();const s=l.createModuleDeclaration(n,o,a,r);return withJSDoc(finishNode(s,e),t)}function parseAmbientExternalModuleDeclaration(e,t,n){let r=0;let i;if(token()===162){i=parseIdentifier();r|=2048}else{i=parseLiteralNode();i.text=internIdentifier(i.text)}let o;if(token()===19){o=parseModuleBlock()}else{parseSemicolon()}const a=l.createModuleDeclaration(n,i,o,r);return withJSDoc(finishNode(a,e),t)}function parseModuleDeclaration(e,t,n){let r=0;if(token()===162){return parseAmbientExternalModuleDeclaration(e,t,n)}else if(parseOptional(145)){r|=32}else{parseExpected(144);if(token()===11){return parseAmbientExternalModuleDeclaration(e,t,n)}}return parseModuleOrNamespaceDeclaration(e,t,n,r)}function isExternalModuleReference2(){return token()===149&&lookAhead(nextTokenIsOpenParen)}function nextTokenIsOpenParen(){return nextToken()===21}function nextTokenIsOpenBrace(){return nextToken()===19}function nextTokenIsSlash(){return nextToken()===44}function parseNamespaceExportDeclaration(e,t,n){parseExpected(130);parseExpected(145);const r=parseIdentifier();parseSemicolon();const i=l.createNamespaceExportDeclaration(r);i.modifiers=n;return withJSDoc(finishNode(i,e),t)}function parseImportDeclarationOrImportEqualsDeclaration(e,n,r){parseExpected(102);const i=t.getTokenFullStart();let o;if(isIdentifier2()){o=parseIdentifier()}let a=false;if((o==null?void 0:o.escapedText)==="type"&&(token()!==161||isIdentifier2()&&lookAhead(nextTokenIsFromKeywordOrEqualsToken))&&(isIdentifier2()||tokenAfterImportDefinitelyProducesImportDeclaration())){a=true;o=isIdentifier2()?parseIdentifier():void 0}if(o&&!tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()){return parseImportEqualsDeclaration(e,n,r,o,a)}const s=tryParseImportClause(o,i,a);const c=parseModuleSpecifier();const d=tryParseImportAttributes();parseSemicolon();const p=l.createImportDeclaration(r,s,c,d);return withJSDoc(finishNode(p,e),n)}function tryParseImportClause(e,t,n,r=false){let i;if(e||token()===42||token()===19){i=parseImportClause(e,t,n,r);parseExpected(161)}return i}function tryParseImportAttributes(){const e=token();if((e===118||e===132)&&!t.hasPrecedingLineBreak()){return parseImportAttributes(e)}}function parseImportAttribute(){const e=getNodePos();const t=tokenIsIdentifierOrKeyword(token())?parseIdentifierName():parseLiteralLikeNode(11);parseExpected(59);const n=parseAssignmentExpressionOrHigher(true);return finishNode(l.createImportAttribute(t,n),e)}function parseImportAttributes(e,n){const r=getNodePos();if(!n){parseExpected(e)}const i=t.getTokenStart();if(parseExpected(19)){const n=t.hasPrecedingLineBreak();const o=parseDelimitedList(24,parseImportAttribute,true);if(!parseExpected(20)){const e=lastOrUndefined(q);if(e&&e.code===wt._0_expected.code){addRelatedInfo(e,createDetachedDiagnostic(j,W,i,1,wt.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}}return finishNode(l.createImportAttributes(o,n,e),r)}else{const t=createNodeArray([],getNodePos(),void 0,false);return finishNode(l.createImportAttributes(t,false,e),r)}}function tokenAfterImportDefinitelyProducesImportDeclaration(){return token()===42||token()===19}function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration(){return token()===28||token()===161}function parseImportEqualsDeclaration(e,t,n,r,i){parseExpected(64);const o=parseModuleReference();parseSemicolon();const a=l.createImportEqualsDeclaration(n,i,r,o);const s=withJSDoc(finishNode(a,e),t);return s}function parseImportClause(e,n,r,i){let o;if(!e||parseOptional(28)){if(i)t.setSkipJsDocLeadingAsterisks(true);o=token()===42?parseNamespaceImport():parseNamedImportsOrExports(275);if(i)t.setSkipJsDocLeadingAsterisks(false)}return finishNode(l.createImportClause(r,e,o),n)}function parseModuleReference(){return isExternalModuleReference2()?parseExternalModuleReference():parseEntityName(false)}function parseExternalModuleReference(){const e=getNodePos();parseExpected(149);parseExpected(21);const t=parseModuleSpecifier();parseExpected(22);return finishNode(l.createExternalModuleReference(t),e)}function parseModuleSpecifier(){if(token()===11){const e=parseLiteralNode();e.text=internIdentifier(e.text);return e}else{return parseExpression()}}function parseNamespaceImport(){const e=getNodePos();parseExpected(42);parseExpected(130);const t=parseIdentifier();return finishNode(l.createNamespaceImport(t),e)}function canParseModuleExportName(){return tokenIsIdentifierOrKeyword(token())||token()===11}function parseModuleExportName(e){return token()===11?parseLiteralNode():e()}function parseNamedImportsOrExports(e){const t=getNodePos();const n=e===275?l.createNamedImports(parseBracketedList(23,parseImportSpecifier,19,20)):l.createNamedExports(parseBracketedList(23,parseExportSpecifier,19,20));return finishNode(n,t)}function parseExportSpecifier(){const e=hasPrecedingJSDocComment();return withJSDoc(parseImportOrExportSpecifier(281),e)}function parseImportSpecifier(){return parseImportOrExportSpecifier(276)}function parseImportOrExportSpecifier(e){const n=getNodePos();let r=isKeyword(token())&&!isIdentifier2();let i=t.getTokenStart();let o=t.getTokenEnd();let a=false;let s;let c=true;let d=parseModuleExportName(parseIdentifierName);if(d.kind===80&&d.escapedText==="type"){if(token()===130){const e=parseIdentifierName();if(token()===130){const t=parseIdentifierName();if(canParseModuleExportName()){a=true;s=e;d=parseModuleExportName(parseNameWithKeywordCheck);c=false}else{s=d;d=t;c=false}}else if(canParseModuleExportName()){s=d;c=false;d=parseModuleExportName(parseNameWithKeywordCheck)}else{a=true;d=e}}else if(canParseModuleExportName()){a=true;d=parseModuleExportName(parseNameWithKeywordCheck)}}if(c&&token()===130){s=d;parseExpected(130);d=parseModuleExportName(parseNameWithKeywordCheck)}if(e===276){if(d.kind!==80){parseErrorAt(skipTrivia(W,d.pos),d.end,wt.Identifier_expected);d=setTextRangePosEnd(createMissingNode(80,false),d.pos,d.pos)}else if(r){parseErrorAt(i,o,wt.Identifier_expected)}}const p=e===276?l.createImportSpecifier(a,s,d):l.createExportSpecifier(a,s,d);return finishNode(p,n);function parseNameWithKeywordCheck(){r=isKeyword(token())&&!isIdentifier2();i=t.getTokenStart();o=t.getTokenEnd();return parseIdentifierName()}}function parseNamespaceExport(e){return finishNode(l.createNamespaceExport(parseModuleExportName(parseIdentifierName)),e)}function parseExportDeclaration(e,n,r){const i=inAwaitContext();setAwaitContext(true);let o;let a;let s;const c=parseOptional(156);const d=getNodePos();if(parseOptional(42)){if(parseOptional(130)){o=parseNamespaceExport(d)}parseExpected(161);a=parseModuleSpecifier()}else{o=parseNamedImportsOrExports(279);if(token()===161||token()===11&&!t.hasPrecedingLineBreak()){parseExpected(161);a=parseModuleSpecifier()}}const p=token();if(a&&(p===118||p===132)&&!t.hasPrecedingLineBreak()){s=parseImportAttributes(p)}parseSemicolon();setAwaitContext(i);const u=l.createExportDeclaration(r,c,o,a,s);return withJSDoc(finishNode(u,e),n)}function parseExportAssignment(e,t,n){const r=inAwaitContext();setAwaitContext(true);let i;if(parseOptional(64)){i=true}else{parseExpected(90)}const o=parseAssignmentExpressionOrHigher(true);parseSemicolon();setAwaitContext(r);const a=l.createExportAssignment(n,i,o);return withJSDoc(finishNode(a,e),t)}let oe;(e=>{e[e["SourceElements"]=0]="SourceElements";e[e["BlockStatements"]=1]="BlockStatements";e[e["SwitchClauses"]=2]="SwitchClauses";e[e["SwitchClauseStatements"]=3]="SwitchClauseStatements";e[e["TypeMembers"]=4]="TypeMembers";e[e["ClassMembers"]=5]="ClassMembers";e[e["EnumMembers"]=6]="EnumMembers";e[e["HeritageClauseElement"]=7]="HeritageClauseElement";e[e["VariableDeclarations"]=8]="VariableDeclarations";e[e["ObjectBindingElements"]=9]="ObjectBindingElements";e[e["ArrayBindingElements"]=10]="ArrayBindingElements";e[e["ArgumentExpressions"]=11]="ArgumentExpressions";e[e["ObjectLiteralMembers"]=12]="ObjectLiteralMembers";e[e["JsxAttributes"]=13]="JsxAttributes";e[e["JsxChildren"]=14]="JsxChildren";e[e["ArrayLiteralMembers"]=15]="ArrayLiteralMembers";e[e["Parameters"]=16]="Parameters";e[e["JSDocParameters"]=17]="JSDocParameters";e[e["RestProperties"]=18]="RestProperties";e[e["TypeParameters"]=19]="TypeParameters";e[e["TypeArguments"]=20]="TypeArguments";e[e["TupleElementTypes"]=21]="TupleElementTypes";e[e["HeritageClauses"]=22]="HeritageClauses";e[e["ImportOrExportSpecifiers"]=23]="ImportOrExportSpecifiers";e[e["ImportAttributes"]=24]="ImportAttributes";e[e["JSDocComment"]=25]="JSDocComment";e[e["Count"]=26]="Count"})(oe||(oe={}));let ae;(e=>{e[e["False"]=0]="False";e[e["True"]=1]="True";e[e["Unknown"]=2]="Unknown"})(ae||(ae={}));let se;(e=>{function parseJSDocTypeExpressionForTests2(e,n,r){initializeState("file.js",e,99,void 0,1,0);t.setText(e,n,r);K=t.scan();const i=parseJSDocTypeExpression();const o=createSourceFile2("file.js",99,1,false,[],h(1),0,noop);const a=attachFileToDiagnostics(q,o);if(H){o.jsDocDiagnostics=attachFileToDiagnostics(H,o)}clearState();return i?{jsDocTypeExpression:i,diagnostics:a}:void 0}e.parseJSDocTypeExpressionForTests=parseJSDocTypeExpressionForTests2;function parseJSDocTypeExpression(e){const t=getNodePos();const n=(e?parseOptional:parseExpected)(19);const r=doInsideOfContext(16777216,parseJSDocType);if(!e||n){parseExpectedJSDoc(20)}const i=l.createJSDocTypeExpression(r);fixupParentReferences(i);return finishNode(i,t)}e.parseJSDocTypeExpression=parseJSDocTypeExpression;function parseJSDocNameReference(){const e=getNodePos();const t=parseOptional(19);const n=getNodePos();let r=parseEntityName(false);while(token()===81){reScanHashToken();nextTokenJSDoc();r=finishNode(l.createJSDocMemberName(r,parseIdentifier()),n)}if(t){parseExpectedJSDoc(20)}const i=l.createJSDocNameReference(r);fixupParentReferences(i);return finishNode(i,e)}e.parseJSDocNameReference=parseJSDocNameReference;function parseIsolatedJSDocComment2(e,t,n){initializeState("",e,99,void 0,1,0);const r=doInsideOfContext(16777216,(()=>parseJSDocCommentWorker(t,n)));const i={languageVariant:0,text:e};const o=attachFileToDiagnostics(q,i);clearState();return r?{jsDoc:r,diagnostics:o}:void 0}e.parseIsolatedJSDocComment=parseIsolatedJSDocComment2;function parseJSDocComment(e,t,n){const r=K;const i=q.length;const o=ne;const a=doInsideOfContext(16777216,(()=>parseJSDocCommentWorker(t,n)));setParent(a,e);if(ee&524288){if(!H){H=[]}addRange(H,q,i)}K=r;q.length=i;ne=o;return a}e.parseJSDocComment=parseJSDocComment;let n;(e=>{e[e["BeginningOfLine"]=0]="BeginningOfLine";e[e["SawAsterisk"]=1]="SawAsterisk";e[e["SavingComments"]=2]="SavingComments";e[e["SavingBackticks"]=3]="SavingBackticks"})(n||(n={}));let r;(e=>{e[e["Property"]=1]="Property";e[e["Parameter"]=2]="Parameter";e[e["CallbackParameter"]=4]="CallbackParameter"})(r||(r={}));function parseJSDocCommentWorker(e=0,n){const r=W;const i=n===void 0?r.length:e+n;n=i-e;S.assert(e>=0);S.assert(e<=i);S.assert(i<=r.length);if(!isJSDocLikeText(r,e)){return void 0}let o;let a;let s;let c;let d;let p=[];const u=[];const f=Y;Y|=1<<25;const m=t.scanRange(e+3,n-5,doJSDocScan);Y=f;return m;function doJSDocScan(){let n=1;let f;let m=e-(r.lastIndexOf("\n",e)+1)+4;function pushComment(e){if(!f){f=m}p.push(e);m+=e.length}nextTokenJSDoc();while(parseOptionalJsdoc(5));if(parseOptionalJsdoc(4)){n=0;m=0}e:while(true){switch(token()){case 60:removeTrailingWhitespace(p);if(!d)d=getNodePos();addTag(parseTag(m));n=0;f=void 0;break;case 4:p.push(t.getTokenText());n=0;m=0;break;case 42:const r=t.getTokenText();if(n===1){n=2;pushComment(r)}else{S.assert(n===0);n=1;m+=r.length}break;case 5:S.assert(n!==2,"whitespace shouldn't come from the scanner while saving top-level comment text");const i=t.getTokenText();if(f!==void 0&&m+i.length>f){p.push(i.slice(f-m))}m+=i.length;break;case 1:break e;case 82:n=2;pushComment(t.getTokenValue());break;case 19:n=2;const o=t.getTokenFullStart();const a=t.getTokenEnd()-1;const s=parseJSDocLink(a);if(s){if(!c){removeLeadingNewlines(p)}u.push(finishNode(l.createJSDocText(p.join("")),c??e,o));u.push(s);p=[];c=t.getTokenEnd();break}default:n=2;pushComment(t.getTokenText());break}if(n===2){nextJSDocCommentTextToken(false)}else{nextTokenJSDoc()}}const _=p.join("").trimEnd();if(u.length&&_.length){u.push(finishNode(l.createJSDocText(_),c??e,d))}if(u.length&&o)S.assertIsDefined(d,"having parsed tags implies that the end of the comment span should be set");const g=o&&createNodeArray(o,a,s);return finishNode(l.createJSDocComment(u.length?createNodeArray(u,e,d):_.length?_:void 0,g),e,i)}function removeLeadingNewlines(e){while(e.length&&(e[0]==="\n"||e[0]==="\r")){e.shift()}}function removeTrailingWhitespace(e){while(e.length){const t=e[e.length-1].trimEnd();if(t===""){e.pop()}else if(t.lengthc){i.push(n.slice(c-e));s=2}e+=n.length;break;case 19:s=2;const d=t.getTokenFullStart();const p=t.getTokenEnd()-1;const u=parseJSDocLink(p);if(u){o.push(finishNode(l.createJSDocText(i.join("")),a??r,d));o.push(u);i=[];a=t.getTokenEnd()}else{pushComment(t.getTokenText())}break;case 62:if(s===3){s=2}else{s=3}pushComment(t.getTokenText());break;case 82:if(s!==3){s=2}pushComment(t.getTokenValue());break;case 42:if(s===0){s=1;e+=1;break}default:if(s!==3){s=2}pushComment(t.getTokenText());break}if(s===2||s===3){d=nextJSDocCommentTextToken(s===3)}else{d=nextTokenJSDoc()}}removeLeadingNewlines(i);const p=i.join("").trimEnd();if(o.length){if(p.length){o.push(finishNode(l.createJSDocText(p),a??r))}return createNodeArray(o,r,t.getTokenEnd())}else if(p.length){return p}}function parseJSDocLink(e){const n=tryParse(parseJSDocLinkPrefix);if(!n){return void 0}nextTokenJSDoc();skipWhitespace();const r=parseJSDocLinkName();const i=[];while(token()!==20&&token()!==4&&token()!==1){i.push(t.getTokenText());nextTokenJSDoc()}const o=n==="link"?l.createJSDocLink:n==="linkcode"?l.createJSDocLinkCode:l.createJSDocLinkPlain;return finishNode(o(r,i.join("")),e,t.getTokenEnd())}function parseJSDocLinkName(){if(tokenIsIdentifierOrKeyword(token())){const e=getNodePos();let t=parseIdentifierName();while(parseOptional(25)){t=finishNode(l.createQualifiedName(t,token()===81?createMissingNode(80,false):parseIdentifierName()),e)}while(token()===81){reScanHashToken();nextTokenJSDoc();t=finishNode(l.createJSDocMemberName(t,parseIdentifier()),e)}return t}return void 0}function parseJSDocLinkPrefix(){skipWhitespaceOrAsterisk();if(token()===19&&nextTokenJSDoc()===60&&tokenIsIdentifierOrKeyword(nextTokenJSDoc())){const e=t.getTokenValue();if(isJSDocLinkTag(e))return e}}function isJSDocLinkTag(e){return e==="link"||e==="linkcode"||e==="linkplain"}function parseUnknownTag(e,t,n,r){return finishNode(l.createJSDocUnknownTag(t,parseTrailingTagComments(e,getNodePos(),n,r)),e)}function addTag(e){if(!e){return}if(!o){o=[e];a=e.pos}else{o.push(e)}s=e.end}function tryParseTypeExpression(){skipWhitespaceOrAsterisk();return token()===19?parseJSDocTypeExpression():void 0}function parseBracketNameInPropertyAndParamTag(){const e=parseOptionalJsdoc(23);if(e){skipWhitespace()}const t=parseOptionalJsdoc(62);const n=parseJSDocEntityName();if(t){parseExpectedTokenJSDoc(62)}if(e){skipWhitespace();if(parseOptionalToken(64)){parseExpression()}parseExpected(24)}return{name:n,isBracketed:e}}function isObjectOrObjectArrayTypeReference(e){switch(e.kind){case 151:return true;case 188:return isObjectOrObjectArrayTypeReference(e.elementType);default:return isTypeReferenceNode(e)&&isIdentifier(e.typeName)&&e.typeName.escapedText==="Object"&&!e.typeArguments}}function parseParameterOrPropertyTag(e,t,n,r){let i=tryParseTypeExpression();let o=!i;skipWhitespaceOrAsterisk();const{name:a,isBracketed:s}=parseBracketNameInPropertyAndParamTag();const c=skipWhitespaceOrAsterisk();if(o&&!lookAhead(parseJSDocLinkPrefix)){i=tryParseTypeExpression()}const d=parseTrailingTagComments(e,getNodePos(),r,c);const p=parseNestedTypeLiteral(i,a,n,r);if(p){i=p;o=true}const u=n===1?l.createJSDocPropertyTag(t,a,s,i,o,d):l.createJSDocParameterTag(t,a,s,i,o,d);return finishNode(u,e)}function parseNestedTypeLiteral(e,t,n,r){if(e&&isObjectOrObjectArrayTypeReference(e.type)){const i=getNodePos();let o;let a;while(o=tryParse((()=>parseChildParameterOrPropertyTag(n,r,t)))){if(o.kind===341||o.kind===348){a=append(a,o)}else if(o.kind===345){parseErrorAtRange(o.tagName,wt.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag)}}if(a){const t=finishNode(l.createJSDocTypeLiteral(a,e.type.kind===188),i);return finishNode(l.createJSDocTypeExpression(t),i)}}}function parseReturnTag(e,n,r,i){if(some(o,isJSDocReturnTag)){parseErrorAt(n.pos,t.getTokenStart(),wt._0_tag_already_specified,unescapeLeadingUnderscores(n.escapedText))}const a=tryParseTypeExpression();return finishNode(l.createJSDocReturnTag(n,a,parseTrailingTagComments(e,getNodePos(),r,i)),e)}function parseTypeTag(e,n,r,i){if(some(o,isJSDocTypeTag)){parseErrorAt(n.pos,t.getTokenStart(),wt._0_tag_already_specified,unescapeLeadingUnderscores(n.escapedText))}const a=parseJSDocTypeExpression(true);const s=r!==void 0&&i!==void 0?parseTrailingTagComments(e,getNodePos(),r,i):void 0;return finishNode(l.createJSDocTypeTag(n,a,s),e)}function parseSeeTag(e,n,r,i){const o=token()===23||lookAhead((()=>nextTokenJSDoc()===60&&tokenIsIdentifierOrKeyword(nextTokenJSDoc())&&isJSDocLinkTag(t.getTokenValue())));const a=o?void 0:parseJSDocNameReference();const s=r!==void 0&&i!==void 0?parseTrailingTagComments(e,getNodePos(),r,i):void 0;return finishNode(l.createJSDocSeeTag(n,a,s),e)}function parseThrowsTag(e,t,n,r){const i=tryParseTypeExpression();const o=parseTrailingTagComments(e,getNodePos(),n,r);return finishNode(l.createJSDocThrowsTag(t,i,o),e)}function parseAuthorTag(e,n,r,i){const o=getNodePos();const a=parseAuthorNameAndEmail();let s=t.getTokenFullStart();const c=parseTrailingTagComments(e,s,r,i);if(!c){s=t.getTokenFullStart()}const d=typeof c!=="string"?createNodeArray(concatenate([finishNode(a,o,s)],c),o):a.text+c;return finishNode(l.createJSDocAuthorTag(n,d),e)}function parseAuthorNameAndEmail(){const e=[];let n=false;let r=t.getToken();while(r!==1&&r!==4){if(r===30){n=true}else if(r===60&&!n){break}else if(r===32&&n){e.push(t.getTokenText());t.resetTokenState(t.getTokenEnd());break}e.push(t.getTokenText());r=nextTokenJSDoc()}return l.createJSDocText(e.join(""))}function parseImplementsTag(e,t,n,r){const i=parseExpressionWithTypeArgumentsForAugments();return finishNode(l.createJSDocImplementsTag(t,i,parseTrailingTagComments(e,getNodePos(),n,r)),e)}function parseAugmentsTag(e,t,n,r){const i=parseExpressionWithTypeArgumentsForAugments();return finishNode(l.createJSDocAugmentsTag(t,i,parseTrailingTagComments(e,getNodePos(),n,r)),e)}function parseSatisfiesTag(e,t,n,r){const i=parseJSDocTypeExpression(false);const o=n!==void 0&&r!==void 0?parseTrailingTagComments(e,getNodePos(),n,r):void 0;return finishNode(l.createJSDocSatisfiesTag(t,i,o),e)}function parseImportTag(e,n,r,i){const o=t.getTokenFullStart();let a;if(isIdentifier2()){a=parseIdentifier()}const s=tryParseImportClause(a,o,true,true);const c=parseModuleSpecifier();const d=tryParseImportAttributes();const p=r!==void 0&&i!==void 0?parseTrailingTagComments(e,getNodePos(),r,i):void 0;return finishNode(l.createJSDocImportTag(n,s,c,d,p),e)}function parseExpressionWithTypeArgumentsForAugments(){const e=parseOptional(19);const n=getNodePos();const r=parsePropertyAccessEntityNameExpression();t.setSkipJsDocLeadingAsterisks(true);const i=tryParseTypeArguments();t.setSkipJsDocLeadingAsterisks(false);const o=l.createExpressionWithTypeArguments(r,i);const a=finishNode(o,n);if(e){skipWhitespace();parseExpected(20)}return a}function parsePropertyAccessEntityNameExpression(){const e=getNodePos();let t=parseJSDocIdentifierName();while(parseOptional(25)){const n=parseJSDocIdentifierName();t=finishNode(x(t,n),e)}return t}function parseSimpleTag(e,t,n,r,i){return finishNode(t(n,parseTrailingTagComments(e,getNodePos(),r,i)),e)}function parseThisTag(e,t,n,r){const i=parseJSDocTypeExpression(true);skipWhitespace();return finishNode(l.createJSDocThisTag(t,i,parseTrailingTagComments(e,getNodePos(),n,r)),e)}function parseEnumTag(e,t,n,r){const i=parseJSDocTypeExpression(true);skipWhitespace();return finishNode(l.createJSDocEnumTag(t,i,parseTrailingTagComments(e,getNodePos(),n,r)),e)}function parseTypedefTag(e,t,n,r){let i=tryParseTypeExpression();skipWhitespaceOrAsterisk();const o=parseJSDocTypeNameWithNamespace();skipWhitespace();let a=parseTagComments(n);let s;if(!i||isObjectOrObjectArrayTypeReference(i.type)){let t;let r;let o;let a=false;while(t=tryParse((()=>parseChildPropertyTag(n)))){if(t.kind===345){break}a=true;if(t.kind===344){if(r){const e=parseErrorAtCurrentToken(wt.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);if(e){addRelatedInfo(e,createDetachedDiagnostic(j,W,0,0,wt.The_tag_was_first_specified_here))}break}else{r=t}}else{o=append(o,t)}}if(a){const t=i&&i.type.kind===188;const n=l.createJSDocTypeLiteral(o,t);i=r&&r.typeExpression&&!isObjectOrObjectArrayTypeReference(r.typeExpression.type)?r.typeExpression:finishNode(n,e);s=i.end}}s=s||a!==void 0?getNodePos():(o??i??t).end;if(!a){a=parseTrailingTagComments(e,s,n,r)}const c=l.createJSDocTypedefTag(t,i,o,a);return finishNode(c,e,s)}function parseJSDocTypeNameWithNamespace(e){const n=t.getTokenStart();if(!tokenIsIdentifierOrKeyword(token())){return void 0}const r=parseJSDocIdentifierName();if(parseOptional(25)){const t=parseJSDocTypeNameWithNamespace(true);const i=l.createModuleDeclaration(void 0,r,t,e?8:void 0);return finishNode(i,n)}if(e){r.flags|=4096}return r}function parseCallbackTagParameters(e){const t=getNodePos();let n;let r;while(n=tryParse((()=>parseChildParameterOrPropertyTag(4,e)))){if(n.kind===345){parseErrorAtRange(n.tagName,wt.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);break}r=append(r,n)}return createNodeArray(r||[],t)}function parseJSDocSignature(e,t){const n=parseCallbackTagParameters(t);const r=tryParse((()=>{if(parseOptionalJsdoc(60)){const e=parseTag(t);if(e&&e.kind===342){return e}}}));return finishNode(l.createJSDocSignature(void 0,n,r),e)}function parseCallbackTag(e,t,n,r){const i=parseJSDocTypeNameWithNamespace();skipWhitespace();let o=parseTagComments(n);const a=parseJSDocSignature(e,n);if(!o){o=parseTrailingTagComments(e,getNodePos(),n,r)}const s=o!==void 0?getNodePos():a.end;return finishNode(l.createJSDocCallbackTag(t,a,i,o),e,s)}function parseOverloadTag(e,t,n,r){skipWhitespace();let i=parseTagComments(n);const o=parseJSDocSignature(e,n);if(!i){i=parseTrailingTagComments(e,getNodePos(),n,r)}const a=i!==void 0?getNodePos():o.end;return finishNode(l.createJSDocOverloadTag(t,o,i),e,a)}function escapedTextsEqual(e,t){while(!isIdentifier(e)||!isIdentifier(t)){if(!isIdentifier(e)&&!isIdentifier(t)&&e.right.escapedText===t.right.escapedText){e=e.left;t=t.left}else{return false}}return e.escapedText===t.escapedText}function parseChildPropertyTag(e){return parseChildParameterOrPropertyTag(1,e)}function parseChildParameterOrPropertyTag(e,t,n){let r=true;let i=false;while(true){switch(nextTokenJSDoc()){case 60:if(r){const r=tryParseChildTag(e,t);if(r&&(r.kind===341||r.kind===348)&&n&&(isIdentifier(r.name)||!escapedTextsEqual(n,r.name.left))){return false}return r}i=false;break;case 4:r=true;i=false;break;case 42:if(i){r=false}i=true;break;case 80:r=false;break;case 1:return false}}}function tryParseChildTag(e,n){S.assert(token()===60);const r=t.getTokenFullStart();nextTokenJSDoc();const i=parseJSDocIdentifierName();const o=skipWhitespaceOrAsterisk();let a;switch(i.escapedText){case"type":return e===1&&parseTypeTag(r,i);case"prop":case"property":a=1;break;case"arg":case"argument":case"param":a=2|4;break;case"template":return parseTemplateTag(r,i,n,o);case"this":return parseThisTag(r,i,n,o);default:return false}if(!(e&a)){return false}return parseParameterOrPropertyTag(r,i,e,n)}function parseTemplateTagTypeParameter(){const e=getNodePos();const t=parseOptionalJsdoc(23);if(t){skipWhitespace()}const n=parseModifiers(false,true);const r=parseJSDocIdentifierName(wt.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);let i;if(t){skipWhitespace();parseExpected(64);i=doInsideOfContext(16777216,parseJSDocType);parseExpected(24)}if(nodeIsMissing(r)){return void 0}return finishNode(l.createTypeParameterDeclaration(n,r,void 0,i),e)}function parseTemplateTagTypeParameters(){const e=getNodePos();const t=[];do{skipWhitespace();const e=parseTemplateTagTypeParameter();if(e!==void 0){t.push(e)}skipWhitespaceOrAsterisk()}while(parseOptionalJsdoc(28));return createNodeArray(t,e)}function parseTemplateTag(e,t,n,r){const i=token()===19?parseJSDocTypeExpression():void 0;const o=parseTemplateTagTypeParameters();return finishNode(l.createJSDocTemplateTag(t,i,o,parseTrailingTagComments(e,getNodePos(),n,r)),e)}function parseOptionalJsdoc(e){if(token()===e){nextTokenJSDoc();return true}return false}function parseJSDocEntityName(){let e=parseJSDocIdentifierName();if(parseOptional(23)){parseExpected(24)}while(parseOptional(25)){const t=parseJSDocIdentifierName();if(parseOptional(23)){parseExpected(24)}e=createQualifiedName(e,t)}return e}function parseJSDocIdentifierName(e){if(!tokenIsIdentifierOrKeyword(token())){return createMissingNode(80,!e,e||wt.Identifier_expected)}X++;const n=t.getTokenStart();const r=t.getTokenEnd();const i=token();const o=internIdentifier(t.getTokenValue());const a=finishNode(g(o,i),n,r);nextTokenJSDoc();return a}}})(se=e.JSDocParser||(e.JSDocParser={}))})(Mi||(Mi={}));var Ri=new WeakSet;function markAsIncrementallyParsed(e){if(Ri.has(e)){S.fail("Source file has already been incrementally parsed")}Ri.add(e)}var Bi=new WeakSet;function intersectsIncrementalChange(e){return Bi.has(e)}function markAsIntersectingIncrementalChange(e){Bi.add(e)}var ji;(e=>{function updateSourceFile2(e,t,n,r){r=r||S.shouldAssert(2);checkChangeRange(e,t,n,r);if(textChangeRangeIsUnchanged(n)){return e}if(e.statements.length===0){return Mi.parseSourceFile(e.fileName,t,e.languageVersion,void 0,true,e.scriptKind,e.setExternalModuleIndicator,e.jsDocParsingMode)}markAsIncrementallyParsed(e);Mi.fixupParentReferences(e);const i=e.text;const o=createSyntaxCursor(e);const a=extendToAffectedRange(e,n);checkChangeRange(e,t,a,r);S.assert(a.span.start<=n.span.start);S.assert(textSpanEnd(a.span)===textSpanEnd(n.span));S.assert(textSpanEnd(textChangeRangeNewSpan(a))===textSpanEnd(textChangeRangeNewSpan(n)));const s=textChangeRangeNewSpan(a).length-a.span.length;updateTokenPositionsAndMarkElements(e,a.span.start,textSpanEnd(a.span),textSpanEnd(textChangeRangeNewSpan(a)),s,i,t,r);const c=Mi.parseSourceFile(e.fileName,t,e.languageVersion,o,true,e.scriptKind,e.setExternalModuleIndicator,e.jsDocParsingMode);c.commentDirectives=getNewCommentDirectives(e.commentDirectives,c.commentDirectives,a.span.start,textSpanEnd(a.span),s,i,t,r);c.impliedNodeFormat=e.impliedNodeFormat;transferSourceFileChildren(e,c);return c}e.updateSourceFile=updateSourceFile2;function getNewCommentDirectives(e,t,n,r,i,o,a,s){if(!e)return t;let c;let l=false;for(const t of e){const{range:e,type:l}=t;if(e.endr){addNewlyScannedDirectives();const t={range:{pos:e.pos+i,end:e.end+i},type:l};c=append(c,t);if(s){S.assert(o.substring(e.pos,e.end)===a.substring(t.range.pos,t.range.end))}}}addNewlyScannedDirectives();return c;function addNewlyScannedDirectives(){if(l)return;l=true;if(!c){c=t}else if(t){c.push(...t)}}}function moveElementEntirelyPastChangeRange(e,t,n,r,i,o,a){if(n){visitArray2(e)}else{visitNode3(e)}return;function visitNode3(e){let n="";if(a&&shouldCheckNode(e)){n=i.substring(e.pos,e.end)}unsetNodeChildren(e,t);setTextRangePosEnd(e,e.pos+r,e.end+r);if(a&&shouldCheckNode(e)){S.assert(n===o.substring(e.pos,e.end))}forEachChild(e,visitNode3,visitArray2);if(hasJSDocNodes(e)){for(const t of e.jsDoc){visitNode3(t)}}checkNodePositions(e,a)}function visitArray2(e){setTextRangePosEnd(e,e.pos+r,e.end+r);for(const t of e){visitNode3(t)}}}function shouldCheckNode(e){switch(e.kind){case 11:case 9:case 80:return true}return false}function adjustIntersectingElement(e,t,n,r,i){S.assert(e.end>=t,"Adjusting an element that was entirely before the change range");S.assert(e.pos<=n,"Adjusting an element that was entirely after the change range");S.assert(e.pos<=e.end);const o=Math.min(e.pos,r);const a=e.end>=n?e.end+i:Math.min(e.end,r);S.assert(o<=a);if(e.parent){const t=e.parent;S.assertGreaterThanOrEqual(o,t.pos);S.assertLessThanOrEqual(a,t.end)}setTextRangePosEnd(e,o,a)}function checkNodePositions(e,t){if(t){let t=e.pos;const visitNode3=e=>{S.assert(e.pos>=t);t=e.end};if(hasJSDocNodes(e)){for(const t of e.jsDoc){visitNode3(t)}}forEachChild(e,visitNode3);S.assert(t<=e.end)}}function updateTokenPositionsAndMarkElements(e,t,n,r,i,o,a,s){visitNode3(e);return;function visitNode3(c){S.assert(c.pos<=c.end);if(c.pos>n){moveElementEntirelyPastChangeRange(c,e,false,i,o,a,s);return}const l=c.end;if(l>=t){markAsIntersectingIncrementalChange(c);unsetNodeChildren(c,e);adjustIntersectingElement(c,t,n,r,i);forEachChild(c,visitNode3,visitArray2);if(hasJSDocNodes(c)){for(const e of c.jsDoc){visitNode3(e)}}checkNodePositions(c,s);return}S.assert(ln){moveElementEntirelyPastChangeRange(c,e,true,i,o,a,s);return}const l=c.end;if(l>=t){markAsIntersectingIncrementalChange(c);adjustIntersectingElement(c,t,n,r,i);for(const e of c){visitNode3(e)}return}S.assert(l0&&t<=n;t++){const t=findNearestNodeStartingBeforeOrAtPosition(e,r);S.assert(t.pos<=r);const n=t.pos;r=Math.max(0,n-1)}const i=createTextSpanFromBounds(r,textSpanEnd(t.span));const o=t.newLength+(t.span.start-r);return createTextChangeRange(i,o)}function findNearestNodeStartingBeforeOrAtPosition(e,t){let n=e;let r;forEachChild(e,visit);if(r){const e=getLastDescendant(r);if(e.pos>n.pos){n=e}}return n;function getLastDescendant(e){while(true){const t=getLastChild(e);if(t){e=t}else{return e}}}function visit(e){if(nodeIsMissing(e)){return}if(e.pos<=t){if(e.pos>=n.pos){n=e}if(tt);return true}}}function checkChangeRange(e,t,n,r){const i=e.text;if(n){S.assert(i.length-n.span.length+n.newLength===t.length);if(r||S.shouldAssert(3)){const e=i.substr(0,n.span.start);const r=t.substr(0,n.span.start);S.assert(e===r);const o=i.substring(textSpanEnd(n.span),i.length);const a=t.substring(textSpanEnd(textChangeRangeNewSpan(n)),t.length);S.assert(o===a)}}}function createSyntaxCursor(e){let t=e.statements;let n=0;S.assert(n=e.pos&&i=e.pos&&i{e[e["Value"]=-1]="Value"})(t||(t={}))})(ji||(ji={}));function isDeclarationFileName(e){return getDeclarationFileExtension(e)!==void 0}function getDeclarationFileExtension(e){const t=getAnyExtensionFromPath(e,xr,false);if(t){return t}if(fileExtensionIs(e,".ts")){const t=getBaseFileName(e);const n=t.lastIndexOf(".d.");if(n>=0){return t.substring(n)}}return void 0}function parseResolutionMode(e,t,n,r){if(!e){return void 0}if(e==="import"){return 99}if(e==="require"){return 1}r(t,n-t,wt.resolution_mode_should_be_either_require_or_import);return void 0}function processCommentPragmas(e,t){const n=[];for(const e of getLeadingCommentRanges(t,0)||d){const r=t.substring(e.pos,e.end);extractPragmas(n,e,r)}e.pragmas=new Map;for(const t of n){if(e.pragmas.has(t.name)){const n=e.pragmas.get(t.name);if(n instanceof Array){n.push(t.args)}else{e.pragmas.set(t.name,[n,t.args])}continue}e.pragmas.set(t.name,t.args)}}function processPragmasIntoFields(e,t){e.checkJsDirective=void 0;e.referencedFiles=[];e.typeReferenceDirectives=[];e.libReferenceDirectives=[];e.amdDependencies=[];e.hasNoDefaultLib=false;e.pragmas.forEach(((n,r)=>{switch(r){case"reference":{const r=e.referencedFiles;const i=e.typeReferenceDirectives;const o=e.libReferenceDirectives;forEach(toArray(n),(n=>{const{types:a,lib:s,path:c,["resolution-mode"]:l,preserve:d}=n.arguments;const p=d==="true"?true:void 0;if(n.arguments["no-default-lib"]==="true"){e.hasNoDefaultLib=true}else if(a){const e=parseResolutionMode(l,a.pos,a.end,t);i.push({pos:a.pos,end:a.end,fileName:a.value,...e?{resolutionMode:e}:{},...p?{preserve:p}:{}})}else if(s){o.push({pos:s.pos,end:s.end,fileName:s.value,...p?{preserve:p}:{}})}else if(c){r.push({pos:c.pos,end:c.end,fileName:c.value,...p?{preserve:p}:{}})}else{t(n.range.pos,n.range.end-n.range.pos,wt.Invalid_reference_directive_syntax)}}));break}case"amd-dependency":{e.amdDependencies=map(toArray(n),(e=>({name:e.arguments.name,path:e.arguments.path})));break}case"amd-module":{if(n instanceof Array){for(const r of n){if(e.moduleName){t(r.range.pos,r.range.end-r.range.pos,wt.An_AMD_module_cannot_have_multiple_name_assignments)}e.moduleName=r.arguments.name}}else{e.moduleName=n.arguments.name}break}case"ts-nocheck":case"ts-check":{forEach(toArray(n),(t=>{if(!e.checkJsDirective||t.range.pos>e.checkJsDirective.pos){e.checkJsDirective={enabled:r==="ts-check",end:t.range.end,pos:t.range.pos}}}));break}case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:S.fail("Unhandled pragma kind")}}))}var Ji=new Map;function getNamedArgRegEx(e){if(Ji.has(e)){return Ji.get(e)}const t=new RegExp(`(\\s${e}\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`,"im");Ji.set(e,t);return t}var Wi=/^\/\/\/\s*<(\S+)\s.*?\/>/m;var Ui=/^\/\/\/?\s*@([^\s:]+)((?:[^\S\r\n]|:).*)?$/m;function extractPragmas(e,t,n){const r=t.kind===2&&Wi.exec(n);if(r){const i=r[1].toLowerCase();const o=yt[i];if(!o||!(o.kind&1)){return}if(o.args){const r={};for(const e of o.args){const i=getNamedArgRegEx(e.name);const o=i.exec(n);if(!o&&!e.optional){return}else if(o){const n=o[2]||o[3];if(e.captureSpan){const i=t.pos+o.index+o[1].length+1;r[e.name]={value:n,pos:i,end:i+n.length}}else{r[e.name]=n}}}e.push({name:i,args:{arguments:r,range:t}})}else{e.push({name:i,args:{arguments:{},range:t}})}return}const i=t.kind===2&&Ui.exec(n);if(i){return addPragmaForMatch(e,t,2,i)}if(t.kind===3){const r=/@(\S+)(\s+(?:\S.*)?)?$/gm;let i;while(i=r.exec(n)){addPragmaForMatch(e,t,4,i)}}}function addPragmaForMatch(e,t,n,r){if(!r)return;const i=r[1].toLowerCase();const o=yt[i];if(!o||!(o.kind&n)){return}const a=r[2];const s=getNamedPragmaArguments(o,a);if(s==="fail")return;e.push({name:i,args:{arguments:s,range:t}});return}function getNamedPragmaArguments(e,t){if(!t)return{};if(!e.args)return{};const n=t.trim().split(/\s+/);const r={};for(let t=0;t[""+t,e])));var Hi=[["es5","lib.es5.d.ts"],["es6","lib.es2015.d.ts"],["es2015","lib.es2015.d.ts"],["es7","lib.es2016.d.ts"],["es2016","lib.es2016.d.ts"],["es2017","lib.es2017.d.ts"],["es2018","lib.es2018.d.ts"],["es2019","lib.es2019.d.ts"],["es2020","lib.es2020.d.ts"],["es2021","lib.es2021.d.ts"],["es2022","lib.es2022.d.ts"],["es2023","lib.es2023.d.ts"],["es2024","lib.es2024.d.ts"],["esnext","lib.esnext.d.ts"],["dom","lib.dom.d.ts"],["dom.iterable","lib.dom.iterable.d.ts"],["dom.asynciterable","lib.dom.asynciterable.d.ts"],["webworker","lib.webworker.d.ts"],["webworker.importscripts","lib.webworker.importscripts.d.ts"],["webworker.iterable","lib.webworker.iterable.d.ts"],["webworker.asynciterable","lib.webworker.asynciterable.d.ts"],["scripthost","lib.scripthost.d.ts"],["es2015.core","lib.es2015.core.d.ts"],["es2015.collection","lib.es2015.collection.d.ts"],["es2015.generator","lib.es2015.generator.d.ts"],["es2015.iterable","lib.es2015.iterable.d.ts"],["es2015.promise","lib.es2015.promise.d.ts"],["es2015.proxy","lib.es2015.proxy.d.ts"],["es2015.reflect","lib.es2015.reflect.d.ts"],["es2015.symbol","lib.es2015.symbol.d.ts"],["es2015.symbol.wellknown","lib.es2015.symbol.wellknown.d.ts"],["es2016.array.include","lib.es2016.array.include.d.ts"],["es2016.intl","lib.es2016.intl.d.ts"],["es2017.arraybuffer","lib.es2017.arraybuffer.d.ts"],["es2017.date","lib.es2017.date.d.ts"],["es2017.object","lib.es2017.object.d.ts"],["es2017.sharedmemory","lib.es2017.sharedmemory.d.ts"],["es2017.string","lib.es2017.string.d.ts"],["es2017.intl","lib.es2017.intl.d.ts"],["es2017.typedarrays","lib.es2017.typedarrays.d.ts"],["es2018.asyncgenerator","lib.es2018.asyncgenerator.d.ts"],["es2018.asynciterable","lib.es2018.asynciterable.d.ts"],["es2018.intl","lib.es2018.intl.d.ts"],["es2018.promise","lib.es2018.promise.d.ts"],["es2018.regexp","lib.es2018.regexp.d.ts"],["es2019.array","lib.es2019.array.d.ts"],["es2019.object","lib.es2019.object.d.ts"],["es2019.string","lib.es2019.string.d.ts"],["es2019.symbol","lib.es2019.symbol.d.ts"],["es2019.intl","lib.es2019.intl.d.ts"],["es2020.bigint","lib.es2020.bigint.d.ts"],["es2020.date","lib.es2020.date.d.ts"],["es2020.promise","lib.es2020.promise.d.ts"],["es2020.sharedmemory","lib.es2020.sharedmemory.d.ts"],["es2020.string","lib.es2020.string.d.ts"],["es2020.symbol.wellknown","lib.es2020.symbol.wellknown.d.ts"],["es2020.intl","lib.es2020.intl.d.ts"],["es2020.number","lib.es2020.number.d.ts"],["es2021.promise","lib.es2021.promise.d.ts"],["es2021.string","lib.es2021.string.d.ts"],["es2021.weakref","lib.es2021.weakref.d.ts"],["es2021.intl","lib.es2021.intl.d.ts"],["es2022.array","lib.es2022.array.d.ts"],["es2022.error","lib.es2022.error.d.ts"],["es2022.intl","lib.es2022.intl.d.ts"],["es2022.object","lib.es2022.object.d.ts"],["es2022.string","lib.es2022.string.d.ts"],["es2022.regexp","lib.es2022.regexp.d.ts"],["es2023.array","lib.es2023.array.d.ts"],["es2023.collection","lib.es2023.collection.d.ts"],["es2023.intl","lib.es2023.intl.d.ts"],["es2024.arraybuffer","lib.es2024.arraybuffer.d.ts"],["es2024.collection","lib.es2024.collection.d.ts"],["es2024.object","lib.es2024.object.d.ts"],["es2024.promise","lib.es2024.promise.d.ts"],["es2024.regexp","lib.es2024.regexp.d.ts"],["es2024.sharedmemory","lib.es2024.sharedmemory.d.ts"],["es2024.string","lib.es2024.string.d.ts"],["esnext.array","lib.es2023.array.d.ts"],["esnext.collection","lib.esnext.collection.d.ts"],["esnext.symbol","lib.es2019.symbol.d.ts"],["esnext.asynciterable","lib.es2018.asynciterable.d.ts"],["esnext.intl","lib.esnext.intl.d.ts"],["esnext.disposable","lib.esnext.disposable.d.ts"],["esnext.bigint","lib.es2020.bigint.d.ts"],["esnext.string","lib.es2022.string.d.ts"],["esnext.promise","lib.es2024.promise.d.ts"],["esnext.weakref","lib.es2021.weakref.d.ts"],["esnext.decorators","lib.esnext.decorators.d.ts"],["esnext.object","lib.es2024.object.d.ts"],["esnext.array","lib.esnext.array.d.ts"],["esnext.regexp","lib.es2024.regexp.d.ts"],["esnext.string","lib.es2024.string.d.ts"],["esnext.iterator","lib.esnext.iterator.d.ts"],["esnext.promise","lib.esnext.promise.d.ts"],["esnext.float16","lib.esnext.float16.d.ts"],["decorators","lib.decorators.d.ts"],["decorators.legacy","lib.decorators.legacy.d.ts"]];var Gi=Hi.map((e=>e[0]));var Ki=new Map(Hi);var $i=[{name:"watchFile",type:new Map(Object.entries({fixedpollinginterval:0,prioritypollinginterval:1,dynamicprioritypolling:2,fixedchunksizepolling:3,usefsevents:4,usefseventsonparentdirectory:5})),category:wt.Watch_and_Build_Modes,description:wt.Specify_how_the_TypeScript_watch_mode_works,defaultValueDescription:4},{name:"watchDirectory",type:new Map(Object.entries({usefsevents:0,fixedpollinginterval:1,dynamicprioritypolling:2,fixedchunksizepolling:3})),category:wt.Watch_and_Build_Modes,description:wt.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,defaultValueDescription:0},{name:"fallbackPolling",type:new Map(Object.entries({fixedinterval:0,priorityinterval:1,dynamicpriority:2,fixedchunksize:3})),category:wt.Watch_and_Build_Modes,description:wt.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,defaultValueDescription:1},{name:"synchronousWatchDirectory",type:"boolean",category:wt.Watch_and_Build_Modes,description:wt.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,defaultValueDescription:false},{name:"excludeDirectories",type:"list",element:{name:"excludeDirectory",type:"string",isFilePath:true,extraValidation:specToDiagnostic},allowConfigDirTemplateSubstitution:true,category:wt.Watch_and_Build_Modes,description:wt.Remove_a_list_of_directories_from_the_watch_process},{name:"excludeFiles",type:"list",element:{name:"excludeFile",type:"string",isFilePath:true,extraValidation:specToDiagnostic},allowConfigDirTemplateSubstitution:true,category:wt.Watch_and_Build_Modes,description:wt.Remove_a_list_of_files_from_the_watch_mode_s_processing}];var Qi=[{name:"help",shortName:"h",type:"boolean",showInSimplifiedHelpView:true,isCommandLineOnly:true,category:wt.Command_line_Options,description:wt.Print_this_message,defaultValueDescription:false},{name:"help",shortName:"?",type:"boolean",isCommandLineOnly:true,category:wt.Command_line_Options,defaultValueDescription:false},{name:"watch",shortName:"w",type:"boolean",showInSimplifiedHelpView:true,isCommandLineOnly:true,category:wt.Command_line_Options,description:wt.Watch_input_files,defaultValueDescription:false},{name:"preserveWatchOutput",type:"boolean",showInSimplifiedHelpView:false,category:wt.Output_Formatting,description:wt.Disable_wiping_the_console_in_watch_mode,defaultValueDescription:false},{name:"listFiles",type:"boolean",category:wt.Compiler_Diagnostics,description:wt.Print_all_of_the_files_read_during_the_compilation,defaultValueDescription:false},{name:"explainFiles",type:"boolean",category:wt.Compiler_Diagnostics,description:wt.Print_files_read_during_the_compilation_including_why_it_was_included,defaultValueDescription:false},{name:"listEmittedFiles",type:"boolean",category:wt.Compiler_Diagnostics,description:wt.Print_the_names_of_emitted_files_after_a_compilation,defaultValueDescription:false},{name:"pretty",type:"boolean",showInSimplifiedHelpView:true,category:wt.Output_Formatting,description:wt.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,defaultValueDescription:true},{name:"traceResolution",type:"boolean",category:wt.Compiler_Diagnostics,description:wt.Log_paths_used_during_the_moduleResolution_process,defaultValueDescription:false},{name:"diagnostics",type:"boolean",category:wt.Compiler_Diagnostics,description:wt.Output_compiler_performance_information_after_building,defaultValueDescription:false},{name:"extendedDiagnostics",type:"boolean",category:wt.Compiler_Diagnostics,description:wt.Output_more_detailed_compiler_performance_information_after_building,defaultValueDescription:false},{name:"generateCpuProfile",type:"string",isFilePath:true,paramType:wt.FILE_OR_DIRECTORY,category:wt.Compiler_Diagnostics,description:wt.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging,defaultValueDescription:"profile.cpuprofile"},{name:"generateTrace",type:"string",isFilePath:true,paramType:wt.DIRECTORY,category:wt.Compiler_Diagnostics,description:wt.Generates_an_event_trace_and_a_list_of_types},{name:"incremental",shortName:"i",type:"boolean",category:wt.Projects,description:wt.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects,transpileOptionValue:void 0,defaultValueDescription:wt.false_unless_composite_is_set},{name:"declaration",shortName:"d",type:"boolean",affectsBuildInfo:true,showInSimplifiedHelpView:true,category:wt.Emit,transpileOptionValue:void 0,description:wt.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project,defaultValueDescription:wt.false_unless_composite_is_set},{name:"declarationMap",type:"boolean",affectsBuildInfo:true,showInSimplifiedHelpView:true,category:wt.Emit,defaultValueDescription:false,description:wt.Create_sourcemaps_for_d_ts_files},{name:"emitDeclarationOnly",type:"boolean",affectsBuildInfo:true,showInSimplifiedHelpView:true,category:wt.Emit,description:wt.Only_output_d_ts_files_and_not_JavaScript_files,transpileOptionValue:void 0,defaultValueDescription:false},{name:"sourceMap",type:"boolean",affectsBuildInfo:true,showInSimplifiedHelpView:true,category:wt.Emit,defaultValueDescription:false,description:wt.Create_source_map_files_for_emitted_JavaScript_files},{name:"inlineSourceMap",type:"boolean",affectsBuildInfo:true,category:wt.Emit,description:wt.Include_sourcemap_files_inside_the_emitted_JavaScript,defaultValueDescription:false},{name:"noCheck",type:"boolean",showInSimplifiedHelpView:false,category:wt.Compiler_Diagnostics,description:wt.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,transpileOptionValue:true,defaultValueDescription:false},{name:"noEmit",type:"boolean",showInSimplifiedHelpView:true,category:wt.Emit,description:wt.Disable_emitting_files_from_a_compilation,transpileOptionValue:void 0,defaultValueDescription:false},{name:"assumeChangesOnlyAffectDirectDependencies",type:"boolean",affectsSemanticDiagnostics:true,affectsEmit:true,affectsBuildInfo:true,category:wt.Watch_and_Build_Modes,description:wt.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,defaultValueDescription:false},{name:"locale",type:"string",category:wt.Command_line_Options,isCommandLineOnly:true,description:wt.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,defaultValueDescription:wt.Platform_specific}];var Xi={name:"target",shortName:"t",type:new Map(Object.entries({es3:0,es5:1,es6:2,es2015:2,es2016:3,es2017:4,es2018:5,es2019:6,es2020:7,es2021:8,es2022:9,es2023:10,es2024:11,esnext:99})),affectsSourceFile:true,affectsModuleResolution:true,affectsEmit:true,affectsBuildInfo:true,deprecatedKeys:new Set(["es3"]),paramType:wt.VERSION,showInSimplifiedHelpView:true,category:wt.Language_and_Environment,description:wt.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,defaultValueDescription:1};var Yi={name:"module",shortName:"m",type:new Map(Object.entries({none:0,commonjs:1,amd:2,system:4,umd:3,es6:5,es2015:5,es2020:6,es2022:7,esnext:99,node16:100,node18:101,nodenext:199,preserve:200})),affectsSourceFile:true,affectsModuleResolution:true,affectsEmit:true,affectsBuildInfo:true,paramType:wt.KIND,showInSimplifiedHelpView:true,category:wt.Modules,description:wt.Specify_what_module_code_is_generated,defaultValueDescription:void 0};var Zi=[{name:"all",type:"boolean",showInSimplifiedHelpView:true,category:wt.Command_line_Options,description:wt.Show_all_compiler_options,defaultValueDescription:false},{name:"version",shortName:"v",type:"boolean",showInSimplifiedHelpView:true,category:wt.Command_line_Options,description:wt.Print_the_compiler_s_version,defaultValueDescription:false},{name:"init",type:"boolean",showInSimplifiedHelpView:true,category:wt.Command_line_Options,description:wt.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,defaultValueDescription:false},{name:"project",shortName:"p",type:"string",isFilePath:true,showInSimplifiedHelpView:true,category:wt.Command_line_Options,paramType:wt.FILE_OR_DIRECTORY,description:wt.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json},{name:"showConfig",type:"boolean",showInSimplifiedHelpView:true,category:wt.Command_line_Options,isCommandLineOnly:true,description:wt.Print_the_final_configuration_instead_of_building,defaultValueDescription:false},{name:"listFilesOnly",type:"boolean",category:wt.Command_line_Options,isCommandLineOnly:true,description:wt.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,defaultValueDescription:false},Xi,Yi,{name:"lib",type:"list",element:{name:"lib",type:Ki,defaultValueDescription:void 0},affectsProgramStructure:true,showInSimplifiedHelpView:true,category:wt.Language_and_Environment,description:wt.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment,transpileOptionValue:void 0},{name:"allowJs",type:"boolean",allowJsFlag:true,affectsBuildInfo:true,showInSimplifiedHelpView:true,category:wt.JavaScript_Support,description:wt.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,defaultValueDescription:false},{name:"checkJs",type:"boolean",affectsModuleResolution:true,affectsSemanticDiagnostics:true,affectsBuildInfo:true,showInSimplifiedHelpView:true,category:wt.JavaScript_Support,description:wt.Enable_error_reporting_in_type_checked_JavaScript_files,defaultValueDescription:false},{name:"jsx",type:Vi,affectsSourceFile:true,affectsEmit:true,affectsBuildInfo:true,affectsModuleResolution:true,affectsSemanticDiagnostics:true,paramType:wt.KIND,showInSimplifiedHelpView:true,category:wt.Language_and_Environment,description:wt.Specify_what_JSX_code_is_generated,defaultValueDescription:void 0},{name:"outFile",type:"string",affectsEmit:true,affectsBuildInfo:true,affectsDeclarationPath:true,isFilePath:true,paramType:wt.FILE,showInSimplifiedHelpView:true,category:wt.Emit,description:wt.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output,transpileOptionValue:void 0},{name:"outDir",type:"string",affectsEmit:true,affectsBuildInfo:true,affectsDeclarationPath:true,isFilePath:true,paramType:wt.DIRECTORY,showInSimplifiedHelpView:true,category:wt.Emit,description:wt.Specify_an_output_folder_for_all_emitted_files},{name:"rootDir",type:"string",affectsEmit:true,affectsBuildInfo:true,affectsDeclarationPath:true,isFilePath:true,paramType:wt.LOCATION,category:wt.Modules,description:wt.Specify_the_root_folder_within_your_source_files,defaultValueDescription:wt.Computed_from_the_list_of_input_files},{name:"composite",type:"boolean",affectsBuildInfo:true,isTSConfigOnly:true,category:wt.Projects,transpileOptionValue:void 0,defaultValueDescription:false,description:wt.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references},{name:"tsBuildInfoFile",type:"string",affectsEmit:true,affectsBuildInfo:true,isFilePath:true,paramType:wt.FILE,category:wt.Projects,transpileOptionValue:void 0,defaultValueDescription:".tsbuildinfo",description:wt.Specify_the_path_to_tsbuildinfo_incremental_compilation_file},{name:"removeComments",type:"boolean",affectsEmit:true,affectsBuildInfo:true,showInSimplifiedHelpView:true,category:wt.Emit,defaultValueDescription:false,description:wt.Disable_emitting_comments},{name:"importHelpers",type:"boolean",affectsEmit:true,affectsBuildInfo:true,affectsSourceFile:true,category:wt.Emit,description:wt.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,defaultValueDescription:false},{name:"importsNotUsedAsValues",type:new Map(Object.entries({remove:0,preserve:1,error:2})),affectsEmit:true,affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Backwards_Compatibility,description:wt.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,defaultValueDescription:0},{name:"downlevelIteration",type:"boolean",affectsEmit:true,affectsBuildInfo:true,category:wt.Emit,description:wt.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,defaultValueDescription:false},{name:"isolatedModules",type:"boolean",category:wt.Interop_Constraints,description:wt.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,transpileOptionValue:true,defaultValueDescription:false},{name:"verbatimModuleSyntax",type:"boolean",affectsEmit:true,affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Interop_Constraints,description:wt.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting,defaultValueDescription:false},{name:"isolatedDeclarations",type:"boolean",category:wt.Interop_Constraints,description:wt.Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files,defaultValueDescription:false,affectsBuildInfo:true,affectsSemanticDiagnostics:true},{name:"erasableSyntaxOnly",type:"boolean",category:wt.Interop_Constraints,description:wt.Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript,defaultValueDescription:false,affectsBuildInfo:true,affectsSemanticDiagnostics:true},{name:"libReplacement",type:"boolean",affectsProgramStructure:true,category:wt.Language_and_Environment,description:wt.Enable_lib_replacement,defaultValueDescription:true},{name:"strict",type:"boolean",affectsBuildInfo:true,showInSimplifiedHelpView:true,category:wt.Type_Checking,description:wt.Enable_all_strict_type_checking_options,defaultValueDescription:false},{name:"noImplicitAny",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,strictFlag:true,category:wt.Type_Checking,description:wt.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,defaultValueDescription:wt.false_unless_strict_is_set},{name:"strictNullChecks",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,strictFlag:true,category:wt.Type_Checking,description:wt.When_type_checking_take_into_account_null_and_undefined,defaultValueDescription:wt.false_unless_strict_is_set},{name:"strictFunctionTypes",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,strictFlag:true,category:wt.Type_Checking,description:wt.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,defaultValueDescription:wt.false_unless_strict_is_set},{name:"strictBindCallApply",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,strictFlag:true,category:wt.Type_Checking,description:wt.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,defaultValueDescription:wt.false_unless_strict_is_set},{name:"strictPropertyInitialization",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,strictFlag:true,category:wt.Type_Checking,description:wt.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,defaultValueDescription:wt.false_unless_strict_is_set},{name:"strictBuiltinIteratorReturn",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,strictFlag:true,category:wt.Type_Checking,description:wt.Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any,defaultValueDescription:wt.false_unless_strict_is_set},{name:"noImplicitThis",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,strictFlag:true,category:wt.Type_Checking,description:wt.Enable_error_reporting_when_this_is_given_the_type_any,defaultValueDescription:wt.false_unless_strict_is_set},{name:"useUnknownInCatchVariables",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,strictFlag:true,category:wt.Type_Checking,description:wt.Default_catch_clause_variables_as_unknown_instead_of_any,defaultValueDescription:wt.false_unless_strict_is_set},{name:"alwaysStrict",type:"boolean",affectsSourceFile:true,affectsEmit:true,affectsBuildInfo:true,strictFlag:true,category:wt.Type_Checking,description:wt.Ensure_use_strict_is_always_emitted,defaultValueDescription:wt.false_unless_strict_is_set},{name:"noUnusedLocals",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Type_Checking,description:wt.Enable_error_reporting_when_local_variables_aren_t_read,defaultValueDescription:false},{name:"noUnusedParameters",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Type_Checking,description:wt.Raise_an_error_when_a_function_parameter_isn_t_read,defaultValueDescription:false},{name:"exactOptionalPropertyTypes",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Type_Checking,description:wt.Interpret_optional_property_types_as_written_rather_than_adding_undefined,defaultValueDescription:false},{name:"noImplicitReturns",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Type_Checking,description:wt.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,defaultValueDescription:false},{name:"noFallthroughCasesInSwitch",type:"boolean",affectsBindDiagnostics:true,affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Type_Checking,description:wt.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,defaultValueDescription:false},{name:"noUncheckedIndexedAccess",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Type_Checking,description:wt.Add_undefined_to_a_type_when_accessed_using_an_index,defaultValueDescription:false},{name:"noImplicitOverride",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Type_Checking,description:wt.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,defaultValueDescription:false},{name:"noPropertyAccessFromIndexSignature",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,showInSimplifiedHelpView:false,category:wt.Type_Checking,description:wt.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,defaultValueDescription:false},{name:"moduleResolution",type:new Map(Object.entries({node10:2,node:2,classic:1,node16:3,nodenext:99,bundler:100})),deprecatedKeys:new Set(["node"]),affectsSourceFile:true,affectsModuleResolution:true,paramType:wt.STRATEGY,category:wt.Modules,description:wt.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,defaultValueDescription:wt.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node},{name:"baseUrl",type:"string",affectsModuleResolution:true,isFilePath:true,category:wt.Modules,description:wt.Specify_the_base_directory_to_resolve_non_relative_module_names},{name:"paths",type:"object",affectsModuleResolution:true,allowConfigDirTemplateSubstitution:true,isTSConfigOnly:true,category:wt.Modules,description:wt.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations,transpileOptionValue:void 0},{name:"rootDirs",type:"list",isTSConfigOnly:true,element:{name:"rootDirs",type:"string",isFilePath:true},affectsModuleResolution:true,allowConfigDirTemplateSubstitution:true,category:wt.Modules,description:wt.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules,transpileOptionValue:void 0,defaultValueDescription:wt.Computed_from_the_list_of_input_files},{name:"typeRoots",type:"list",element:{name:"typeRoots",type:"string",isFilePath:true},affectsModuleResolution:true,allowConfigDirTemplateSubstitution:true,category:wt.Modules,description:wt.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types},{name:"types",type:"list",element:{name:"types",type:"string"},affectsProgramStructure:true,showInSimplifiedHelpView:true,category:wt.Modules,description:wt.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file,transpileOptionValue:void 0},{name:"allowSyntheticDefaultImports",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Interop_Constraints,description:wt.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,defaultValueDescription:wt.module_system_or_esModuleInterop},{name:"esModuleInterop",type:"boolean",affectsSemanticDiagnostics:true,affectsEmit:true,affectsBuildInfo:true,showInSimplifiedHelpView:true,category:wt.Interop_Constraints,description:wt.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,defaultValueDescription:false},{name:"preserveSymlinks",type:"boolean",category:wt.Interop_Constraints,description:wt.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,defaultValueDescription:false},{name:"allowUmdGlobalAccess",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Modules,description:wt.Allow_accessing_UMD_globals_from_modules,defaultValueDescription:false},{name:"moduleSuffixes",type:"list",element:{name:"suffix",type:"string"},listPreserveFalsyValues:true,affectsModuleResolution:true,category:wt.Modules,description:wt.List_of_file_name_suffixes_to_search_when_resolving_a_module},{name:"allowImportingTsExtensions",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Modules,description:wt.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,defaultValueDescription:false,transpileOptionValue:void 0},{name:"rewriteRelativeImportExtensions",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Modules,description:wt.Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files,defaultValueDescription:false},{name:"resolvePackageJsonExports",type:"boolean",affectsModuleResolution:true,category:wt.Modules,description:wt.Use_the_package_json_exports_field_when_resolving_package_imports,defaultValueDescription:wt.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false},{name:"resolvePackageJsonImports",type:"boolean",affectsModuleResolution:true,category:wt.Modules,description:wt.Use_the_package_json_imports_field_when_resolving_imports,defaultValueDescription:wt.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false},{name:"customConditions",type:"list",element:{name:"condition",type:"string"},affectsModuleResolution:true,category:wt.Modules,description:wt.Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports},{name:"noUncheckedSideEffectImports",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Modules,description:wt.Check_side_effect_imports,defaultValueDescription:false},{name:"sourceRoot",type:"string",affectsEmit:true,affectsBuildInfo:true,paramType:wt.LOCATION,category:wt.Emit,description:wt.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code},{name:"mapRoot",type:"string",affectsEmit:true,affectsBuildInfo:true,paramType:wt.LOCATION,category:wt.Emit,description:wt.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations},{name:"inlineSources",type:"boolean",affectsEmit:true,affectsBuildInfo:true,category:wt.Emit,description:wt.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,defaultValueDescription:false},{name:"experimentalDecorators",type:"boolean",affectsEmit:true,affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Language_and_Environment,description:wt.Enable_experimental_support_for_legacy_experimental_decorators,defaultValueDescription:false},{name:"emitDecoratorMetadata",type:"boolean",affectsSemanticDiagnostics:true,affectsEmit:true,affectsBuildInfo:true,category:wt.Language_and_Environment,description:wt.Emit_design_type_metadata_for_decorated_declarations_in_source_files,defaultValueDescription:false},{name:"jsxFactory",type:"string",category:wt.Language_and_Environment,description:wt.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h,defaultValueDescription:"`React.createElement`"},{name:"jsxFragmentFactory",type:"string",category:wt.Language_and_Environment,description:wt.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment,defaultValueDescription:"React.Fragment"},{name:"jsxImportSource",type:"string",affectsSemanticDiagnostics:true,affectsEmit:true,affectsBuildInfo:true,affectsModuleResolution:true,affectsSourceFile:true,category:wt.Language_and_Environment,description:wt.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,defaultValueDescription:"react"},{name:"resolveJsonModule",type:"boolean",affectsModuleResolution:true,category:wt.Modules,description:wt.Enable_importing_json_files,defaultValueDescription:false},{name:"allowArbitraryExtensions",type:"boolean",affectsProgramStructure:true,category:wt.Modules,description:wt.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present,defaultValueDescription:false},{name:"out",type:"string",affectsEmit:true,affectsBuildInfo:true,affectsDeclarationPath:true,isFilePath:false,category:wt.Backwards_Compatibility,paramType:wt.FILE,transpileOptionValue:void 0,description:wt.Deprecated_setting_Use_outFile_instead},{name:"reactNamespace",type:"string",affectsEmit:true,affectsBuildInfo:true,category:wt.Language_and_Environment,description:wt.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,defaultValueDescription:"`React`"},{name:"skipDefaultLibCheck",type:"boolean",affectsBuildInfo:true,category:wt.Completeness,description:wt.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,defaultValueDescription:false},{name:"charset",type:"string",category:wt.Backwards_Compatibility,description:wt.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files,defaultValueDescription:"utf8"},{name:"emitBOM",type:"boolean",affectsEmit:true,affectsBuildInfo:true,category:wt.Emit,description:wt.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,defaultValueDescription:false},{name:"newLine",type:new Map(Object.entries({crlf:0,lf:1})),affectsEmit:true,affectsBuildInfo:true,paramType:wt.NEWLINE,category:wt.Emit,description:wt.Set_the_newline_character_for_emitting_files,defaultValueDescription:"lf"},{name:"noErrorTruncation",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Output_Formatting,description:wt.Disable_truncating_types_in_error_messages,defaultValueDescription:false},{name:"noLib",type:"boolean",category:wt.Language_and_Environment,affectsProgramStructure:true,description:wt.Disable_including_any_library_files_including_the_default_lib_d_ts,transpileOptionValue:true,defaultValueDescription:false},{name:"noResolve",type:"boolean",affectsModuleResolution:true,category:wt.Modules,description:wt.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project,transpileOptionValue:true,defaultValueDescription:false},{name:"stripInternal",type:"boolean",affectsEmit:true,affectsBuildInfo:true,category:wt.Emit,description:wt.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,defaultValueDescription:false},{name:"disableSizeLimit",type:"boolean",affectsProgramStructure:true,category:wt.Editor_Support,description:wt.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,defaultValueDescription:false},{name:"disableSourceOfProjectReferenceRedirect",type:"boolean",isTSConfigOnly:true,category:wt.Projects,description:wt.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,defaultValueDescription:false},{name:"disableSolutionSearching",type:"boolean",isTSConfigOnly:true,category:wt.Projects,description:wt.Opt_a_project_out_of_multi_project_reference_checking_when_editing,defaultValueDescription:false},{name:"disableReferencedProjectLoad",type:"boolean",isTSConfigOnly:true,category:wt.Projects,description:wt.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,defaultValueDescription:false},{name:"noImplicitUseStrict",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Backwards_Compatibility,description:wt.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,defaultValueDescription:false},{name:"noEmitHelpers",type:"boolean",affectsEmit:true,affectsBuildInfo:true,category:wt.Emit,description:wt.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,defaultValueDescription:false},{name:"noEmitOnError",type:"boolean",affectsEmit:true,affectsBuildInfo:true,category:wt.Emit,transpileOptionValue:void 0,description:wt.Disable_emitting_files_if_any_type_checking_errors_are_reported,defaultValueDescription:false},{name:"preserveConstEnums",type:"boolean",affectsEmit:true,affectsBuildInfo:true,category:wt.Emit,description:wt.Disable_erasing_const_enum_declarations_in_generated_code,defaultValueDescription:false},{name:"declarationDir",type:"string",affectsEmit:true,affectsBuildInfo:true,affectsDeclarationPath:true,isFilePath:true,paramType:wt.DIRECTORY,category:wt.Emit,transpileOptionValue:void 0,description:wt.Specify_the_output_directory_for_generated_declaration_files},{name:"skipLibCheck",type:"boolean",affectsBuildInfo:true,category:wt.Completeness,description:wt.Skip_type_checking_all_d_ts_files,defaultValueDescription:false},{name:"allowUnusedLabels",type:"boolean",affectsBindDiagnostics:true,affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Type_Checking,description:wt.Disable_error_reporting_for_unused_labels,defaultValueDescription:void 0},{name:"allowUnreachableCode",type:"boolean",affectsBindDiagnostics:true,affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Type_Checking,description:wt.Disable_error_reporting_for_unreachable_code,defaultValueDescription:void 0},{name:"suppressExcessPropertyErrors",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Backwards_Compatibility,description:wt.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,defaultValueDescription:false},{name:"suppressImplicitAnyIndexErrors",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Backwards_Compatibility,description:wt.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,defaultValueDescription:false},{name:"forceConsistentCasingInFileNames",type:"boolean",affectsModuleResolution:true,category:wt.Interop_Constraints,description:wt.Ensure_that_casing_is_correct_in_imports,defaultValueDescription:true},{name:"maxNodeModuleJsDepth",type:"number",affectsModuleResolution:true,category:wt.JavaScript_Support,description:wt.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,defaultValueDescription:0},{name:"noStrictGenericChecks",type:"boolean",affectsSemanticDiagnostics:true,affectsBuildInfo:true,category:wt.Backwards_Compatibility,description:wt.Disable_strict_checking_of_generic_signatures_in_function_types,defaultValueDescription:false},{name:"useDefineForClassFields",type:"boolean",affectsSemanticDiagnostics:true,affectsEmit:true,affectsBuildInfo:true,category:wt.Language_and_Environment,description:wt.Emit_ECMAScript_standard_compliant_class_fields,defaultValueDescription:wt.true_for_ES2022_and_above_including_ESNext},{name:"preserveValueImports",type:"boolean",affectsEmit:true,affectsBuildInfo:true,category:wt.Backwards_Compatibility,description:wt.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,defaultValueDescription:false},{name:"keyofStringsOnly",type:"boolean",category:wt.Backwards_Compatibility,description:wt.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,defaultValueDescription:false},{name:"plugins",type:"list",isTSConfigOnly:true,element:{name:"plugin",type:"object"},description:wt.Specify_a_list_of_language_service_plugins_to_include,category:wt.Editor_Support},{name:"moduleDetection",type:new Map(Object.entries({auto:2,legacy:1,force:3})),affectsSourceFile:true,affectsModuleResolution:true,description:wt.Control_what_method_is_used_to_detect_module_format_JS_files,category:wt.Language_and_Environment,defaultValueDescription:wt.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules},{name:"ignoreDeprecations",type:"string",defaultValueDescription:void 0}];var eo=[...Qi,...Zi];var to=eo.filter((e=>!!e.affectsSemanticDiagnostics));var no=eo.filter((e=>!!e.affectsEmit));var ro=eo.filter((e=>!!e.affectsDeclarationPath));var io=eo.filter((e=>!!e.affectsModuleResolution));var oo=eo.filter((e=>!!e.affectsSourceFile||!!e.affectsBindDiagnostics));var ao=eo.filter((e=>!!e.affectsProgramStructure));var so=eo.filter((e=>hasProperty(e,"transpileOptionValue")));var co=eo.filter((e=>e.allowConfigDirTemplateSubstitution||!e.isCommandLineOnly&&e.isFilePath));var lo=$i.filter((e=>e.allowConfigDirTemplateSubstitution||!e.isCommandLineOnly&&e.isFilePath));var po=eo.filter(isCommandLineOptionOfCustomType);function isCommandLineOptionOfCustomType(e){return!isString(e.type)}var uo={name:"build",type:"boolean",shortName:"b",showInSimplifiedHelpView:true,category:wt.Command_line_Options,description:wt.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,defaultValueDescription:false};var fo=[uo,{name:"verbose",shortName:"v",category:wt.Command_line_Options,description:wt.Enable_verbose_logging,type:"boolean",defaultValueDescription:false},{name:"dry",shortName:"d",category:wt.Command_line_Options,description:wt.Show_what_would_be_built_or_deleted_if_specified_with_clean,type:"boolean",defaultValueDescription:false},{name:"force",shortName:"f",category:wt.Command_line_Options,description:wt.Build_all_projects_including_those_that_appear_to_be_up_to_date,type:"boolean",defaultValueDescription:false},{name:"clean",category:wt.Command_line_Options,description:wt.Delete_the_outputs_of_all_projects,type:"boolean",defaultValueDescription:false},{name:"stopBuildOnErrors",category:wt.Command_line_Options,description:wt.Skip_building_downstream_projects_on_error_in_upstream_project,type:"boolean",defaultValueDescription:false}];var mo=[...Qi,...fo];var _o=[{name:"enable",type:"boolean",defaultValueDescription:false},{name:"include",type:"list",element:{name:"include",type:"string"}},{name:"exclude",type:"list",element:{name:"exclude",type:"string"}},{name:"disableFilenameBasedTypeAcquisition",type:"boolean",defaultValueDescription:false}];function createOptionNameMap(e){const t=new Map;const n=new Map;forEach(e,(e=>{t.set(e.name.toLowerCase(),e);if(e.shortName){n.set(e.shortName,e.name)}}));return{optionsNameMap:t,shortOptionNames:n}}var go;function getOptionsNameMap(){return go||(go=createOptionNameMap(eo))}var yo={diagnostic:wt.Compiler_option_0_may_only_be_used_with_build,getOptionsNameMap:getBuildOptionsNameMap};var ho={module:1,target:3,strict:true,esModuleInterop:true,forceConsistentCasingInFileNames:true,skipLibCheck:true};function createCompilerDiagnosticForInvalidCustomType(e){return createDiagnosticForInvalidCustomType(e,createCompilerDiagnostic)}function createDiagnosticForInvalidCustomType(e,t){const n=arrayFrom(e.type.keys());const r=(e.deprecatedKeys?n.filter((t=>!e.deprecatedKeys.has(t))):n).map((e=>`'${e}'`)).join(", ");return t(wt.Argument_for_0_option_must_be_Colon_1,`--${e.name}`,r)}function parseCustomTypeOption(e,t,n){return convertJsonOptionOfCustomType(e,(t??"").trim(),n)}function parseListTypeOption(e,t="",n){t=t.trim();if(startsWith(t,"-")){return void 0}if(e.type==="listOrElement"&&!t.includes(",")){return validateJsonOptionValue(e,t,n)}if(t===""){return[]}const r=t.split(",");switch(e.element.type){case"number":return mapDefined(r,(t=>validateJsonOptionValue(e.element,parseInt(t),n)));case"string":return mapDefined(r,(t=>validateJsonOptionValue(e.element,t||"",n)));case"boolean":case"object":return S.fail(`List of ${e.element.type} is not yet supported.`);default:return mapDefined(r,(t=>parseCustomTypeOption(e.element,t,n)))}}function getOptionName(e){return e.name}function createUnknownOptionError(e,t,n,r,i){var o;const a=(o=t.alternateMode)==null?void 0:o.getOptionsNameMap().optionsNameMap.get(e.toLowerCase());if(a){return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(i,r,a!==uo?t.alternateMode.diagnostic:wt.Option_build_must_be_the_first_command_line_argument,e)}const s=getSpellingSuggestion(e,t.optionDeclarations,getOptionName);return s?createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(i,r,t.unknownDidYouMeanDiagnostic,n||e,s.name):createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(i,r,t.unknownOptionDiagnostic,n||e)}function parseCommandLineWorker(e,t,n){const r={};let i;const o=[];const a=[];parseStrings(t);return{options:r,watchOptions:i,fileNames:o,errors:a};function parseStrings(t){let n=0;while(nFt.readFile(e)));if(!isString(t)){a.push(t);return}const r=[];let i=0;while(true){while(i=t.length)break;const n=i;if(t.charCodeAt(n)===34){i++;while(i32)i++;r.push(t.substring(n,i))}}parseStrings(r)}}function parseOptionValue(e,t,n,r,i,o){if(r.isTSConfigOnly){const n=e[t];if(n==="null"){i[r.name]=void 0;t++}else if(r.type==="boolean"){if(n==="false"){i[r.name]=validateJsonOptionValue(r,false,o);t++}else{if(n==="true")t++;o.push(createCompilerDiagnostic(wt.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line,r.name))}}else{o.push(createCompilerDiagnostic(wt.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line,r.name));if(n&&!startsWith(n,"-"))t++}}else{if(!e[t]&&r.type!=="boolean"){o.push(createCompilerDiagnostic(n.optionTypeMismatchDiagnostic,r.name,getCompilerOptionValueTypeString(r)))}if(e[t]!=="null"){switch(r.type){case"number":i[r.name]=validateJsonOptionValue(r,parseInt(e[t]),o);t++;break;case"boolean":const n=e[t];i[r.name]=validateJsonOptionValue(r,n!=="false",o);if(n==="false"||n==="true"){t++}break;case"string":i[r.name]=validateJsonOptionValue(r,e[t]||"",o);t++;break;case"list":const a=parseListTypeOption(r,e[t],o);i[r.name]=a||[];if(a){t++}break;case"listOrElement":S.fail("listOrElement not supported here");break;default:i[r.name]=parseCustomTypeOption(r,e[t],o);t++;break}}else{i[r.name]=void 0;t++}}return t}var To={alternateMode:yo,getOptionsNameMap:getOptionsNameMap,optionDeclarations:eo,unknownOptionDiagnostic:wt.Unknown_compiler_option_0,unknownDidYouMeanDiagnostic:wt.Unknown_compiler_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:wt.Compiler_option_0_expects_an_argument};function parseCommandLine(e,t){return parseCommandLineWorker(To,e,t)}function getOptionFromName(e,t){return getOptionDeclarationFromName(getOptionsNameMap,e,t)}function getOptionDeclarationFromName(e,t,n=false){t=t.toLowerCase();const{optionsNameMap:r,shortOptionNames:i}=e();if(n){const e=i.get(t);if(e!==void 0){t=e}}return r.get(t)}var So;function getBuildOptionsNameMap(){return So||(So=createOptionNameMap(mo))}var vo={diagnostic:wt.Compiler_option_0_may_not_be_used_with_build,getOptionsNameMap:getOptionsNameMap};var xo={alternateMode:vo,getOptionsNameMap:getBuildOptionsNameMap,optionDeclarations:mo,unknownOptionDiagnostic:wt.Unknown_build_option_0,unknownDidYouMeanDiagnostic:wt.Unknown_build_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:wt.Build_option_0_requires_a_value_of_type_1};function parseBuildCommand(e){const{options:t,watchOptions:n,fileNames:r,errors:i}=parseCommandLineWorker(xo,e);const o=t;if(r.length===0){r.push(".")}if(o.clean&&o.force){i.push(createCompilerDiagnostic(wt.Options_0_and_1_cannot_be_combined,"clean","force"))}if(o.clean&&o.verbose){i.push(createCompilerDiagnostic(wt.Options_0_and_1_cannot_be_combined,"clean","verbose"))}if(o.clean&&o.watch){i.push(createCompilerDiagnostic(wt.Options_0_and_1_cannot_be_combined,"clean","watch"))}if(o.watch&&o.dry){i.push(createCompilerDiagnostic(wt.Options_0_and_1_cannot_be_combined,"watch","dry"))}return{buildOptions:o,watchOptions:n,projects:r,errors:i}}function getDiagnosticText(e,...t){return cast(createCompilerDiagnostic(e,...t).messageText,isString)}function getParsedCommandLineOfConfigFile(e,t,n,r,i,o){const a=tryReadFile(e,(e=>n.readFile(e)));if(!isString(a)){n.onUnRecoverableConfigFileDiagnostic(a);return void 0}const s=parseJsonText(e,a);const c=n.getCurrentDirectory();s.path=toPath(e,c,createGetCanonicalFileName(n.useCaseSensitiveFileNames));s.resolvedPath=s.path;s.originalFileName=s.fileName;return parseJsonSourceFileConfigFileContent(s,n,getNormalizedAbsolutePath(getDirectoryPath(e),c),t,getNormalizedAbsolutePath(e,c),void 0,o,r,i)}function readConfigFile(e,t){const n=tryReadFile(e,t);return isString(n)?parseConfigFileTextToJson(e,n):{config:{},error:n}}function parseConfigFileTextToJson(e,t){const n=parseJsonText(e,t);return{config:convertConfigFileToObject(n,n.parseDiagnostics,void 0),error:n.parseDiagnostics.length?n.parseDiagnostics[0]:void 0}}function readJsonConfigFile(e,t){const n=tryReadFile(e,t);return isString(n)?parseJsonText(e,n):{fileName:e,parseDiagnostics:[n]}}function tryReadFile(e,t){let n;try{n=t(e)}catch(t){return createCompilerDiagnostic(wt.Cannot_read_file_0_Colon_1,e,t.message)}return n===void 0?createCompilerDiagnostic(wt.Cannot_read_file_0,e):n}function commandLineOptionsToMap(e){return arrayToMap(e,getOptionName)}var bo={optionDeclarations:_o,unknownOptionDiagnostic:wt.Unknown_type_acquisition_option_0,unknownDidYouMeanDiagnostic:wt.Unknown_type_acquisition_option_0_Did_you_mean_1};var Co;function getWatchOptionsNameMap(){return Co||(Co=createOptionNameMap($i))}var Eo={getOptionsNameMap:getWatchOptionsNameMap,optionDeclarations:$i,unknownOptionDiagnostic:wt.Unknown_watch_option_0,unknownDidYouMeanDiagnostic:wt.Unknown_watch_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:wt.Watch_option_0_requires_a_value_of_type_1};var No;function getCommandLineCompilerOptionsMap(){return No||(No=commandLineOptionsToMap(eo))}var ko;function getCommandLineWatchOptionsMap(){return ko||(ko=commandLineOptionsToMap($i))}var Fo;function getCommandLineTypeAcquisitionMap(){return Fo||(Fo=commandLineOptionsToMap(_o))}var Po={name:"extends",type:"listOrElement",element:{name:"extends",type:"string"},category:wt.File_Management,disallowNullOrUndefined:true};var Do={name:"compilerOptions",type:"object",elementOptions:getCommandLineCompilerOptionsMap(),extraKeyDiagnostics:To};var Io={name:"watchOptions",type:"object",elementOptions:getCommandLineWatchOptionsMap(),extraKeyDiagnostics:Eo};var Ao={name:"typeAcquisition",type:"object",elementOptions:getCommandLineTypeAcquisitionMap(),extraKeyDiagnostics:bo};var Oo;function getTsconfigRootOptionsMap(){if(Oo===void 0){Oo={name:void 0,type:"object",elementOptions:commandLineOptionsToMap([Do,Io,Ao,Po,{name:"references",type:"list",element:{name:"references",type:"object"},category:wt.Projects},{name:"files",type:"list",element:{name:"files",type:"string"},category:wt.File_Management},{name:"include",type:"list",element:{name:"include",type:"string"},category:wt.File_Management,defaultValueDescription:wt.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk},{name:"exclude",type:"list",element:{name:"exclude",type:"string"},category:wt.File_Management,defaultValueDescription:wt.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified},zi])}}return Oo}function convertConfigFileToObject(e,t,n){var r;const i=(r=e.statements[0])==null?void 0:r.expression;if(i&&i.kind!==210){t.push(createDiagnosticForNodeInSourceFile(e,i,wt.The_root_value_of_a_0_file_must_be_an_object,getBaseFileName(e.fileName)==="jsconfig.json"?"jsconfig.json":"tsconfig.json"));if(isArrayLiteralExpression(i)){const r=find(i.elements,isObjectLiteralExpression);if(r){return convertToJson(e,r,t,true,n)}}return{}}return convertToJson(e,i,t,true,n)}function convertToObject(e,t){var n;return convertToJson(e,(n=e.statements[0])==null?void 0:n.expression,t,true,void 0)}function convertToJson(e,t,n,r,i){if(!t){return r?{}:void 0}return convertPropertyValueToJson(t,i==null?void 0:i.rootOptions);function convertObjectLiteralExpressionToJson(t,o){var a;const s=r?{}:void 0;for(const c of t.properties){if(c.kind!==303){n.push(createDiagnosticForNodeInSourceFile(e,c,wt.Property_assignment_expected));continue}if(c.questionToken){n.push(createDiagnosticForNodeInSourceFile(e,c.questionToken,wt.The_0_modifier_can_only_be_used_in_TypeScript_files,"?"))}if(!isDoubleQuotedString(c.name)){n.push(createDiagnosticForNodeInSourceFile(e,c.name,wt.String_literal_with_double_quotes_expected))}const t=isComputedNonLiteralName(c.name)?void 0:getTextOfPropertyName(c.name);const l=t&&unescapeLeadingUnderscores(t);const d=l?(a=o==null?void 0:o.elementOptions)==null?void 0:a.get(l):void 0;const p=convertPropertyValueToJson(c.initializer,d);if(typeof l!=="undefined"){if(r){s[l]=p}i==null?void 0:i.onPropertySet(l,p,c,o,d)}}return s}function convertArrayLiteralExpressionToJson(e,t){if(!r){e.forEach((e=>convertPropertyValueToJson(e,t)));return void 0}return filter(e.map((e=>convertPropertyValueToJson(e,t))),(e=>e!==void 0))}function convertPropertyValueToJson(t,r){switch(t.kind){case 112:return true;case 97:return false;case 106:return null;case 11:if(!isDoubleQuotedString(t)){n.push(createDiagnosticForNodeInSourceFile(e,t,wt.String_literal_with_double_quotes_expected))}return t.text;case 9:return Number(t.text);case 224:if(t.operator!==41||t.operand.kind!==9){break}return-Number(t.operand.text);case 210:const i=t;return convertObjectLiteralExpressionToJson(i,r);case 209:return convertArrayLiteralExpressionToJson(t.elements,r&&r.element)}if(r){n.push(createDiagnosticForNodeInSourceFile(e,t,wt.Compiler_option_0_requires_a_value_of_type_1,r.name,getCompilerOptionValueTypeString(r)))}else{n.push(createDiagnosticForNodeInSourceFile(e,t,wt.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal))}return void 0}function isDoubleQuotedString(t){return isStringLiteral(t)&&isStringDoubleQuoted(t,e)}}function getCompilerOptionValueTypeString(e){return e.type==="listOrElement"?`${getCompilerOptionValueTypeString(e.element)} or Array`:e.type==="list"?"Array":isString(e.type)?e.type:"string"}function isCompilerOptionsValue(e,t){if(e){if(isNullOrUndefined(t))return!e.disallowNullOrUndefined;if(e.type==="list"){return isArray(t)}if(e.type==="listOrElement"){return isArray(t)||isCompilerOptionsValue(e.element,t)}const n=isString(e.type)?e.type:"string";return typeof t===n}return false}function convertToTSConfig(e,t,n){var r,i,o;const a=createGetCanonicalFileName(n.useCaseSensitiveFileNames);const s=map(filter(e.fileNames,!((i=(r=e.options.configFile)==null?void 0:r.configFileSpecs)==null?void 0:i.validatedIncludeSpecs)?returnTrue:matchesSpecs(t,e.options.configFile.configFileSpecs.validatedIncludeSpecs,e.options.configFile.configFileSpecs.validatedExcludeSpecs,n)),(e=>getRelativePathFromFile(getNormalizedAbsolutePath(t,n.getCurrentDirectory()),getNormalizedAbsolutePath(e,n.getCurrentDirectory()),a)));const c={configFilePath:getNormalizedAbsolutePath(t,n.getCurrentDirectory()),useCaseSensitiveFileNames:n.useCaseSensitiveFileNames};const l=serializeCompilerOptions(e.options,c);const d=e.watchOptions&&serializeWatchOptions(e.watchOptions);const p={compilerOptions:{...optionMapToObject(l),showConfig:void 0,configFile:void 0,configFilePath:void 0,help:void 0,init:void 0,listFiles:void 0,listEmittedFiles:void 0,project:void 0,build:void 0,version:void 0},watchOptions:d&&optionMapToObject(d),references:map(e.projectReferences,(e=>({...e,path:e.originalPath?e.originalPath:"",originalPath:void 0}))),files:length(s)?s:void 0,...((o=e.options.configFile)==null?void 0:o.configFileSpecs)?{include:filterSameAsDefaultInclude(e.options.configFile.configFileSpecs.validatedIncludeSpecs),exclude:e.options.configFile.configFileSpecs.validatedExcludeSpecs}:{},compileOnSave:!!e.compileOnSave?true:void 0};const u=new Set(l.keys());const f={};for(const t in Wn){if(!u.has(t)&&optionDependsOn(t,u)){const n=Wn[t].computeValue(e.options);const r=Wn[t].computeValue({});if(n!==r){f[t]=Wn[t].computeValue(e.options)}}}assign(p.compilerOptions,optionMapToObject(serializeCompilerOptions(f,c)));return p}function optionDependsOn(e,t){const n=new Set;return optionDependsOnRecursive(e);function optionDependsOnRecursive(e){var r;if(addToSeen(n,e)){return some((r=Wn[e])==null?void 0:r.dependencies,(e=>t.has(e)||optionDependsOnRecursive(e)))}return false}}function optionMapToObject(e){return Object.fromEntries(e)}function filterSameAsDefaultInclude(e){if(!length(e))return void 0;if(length(e)!==1)return e;if(e[0]===wo)return void 0;return e}function matchesSpecs(e,t,n,r){if(!t)return returnTrue;const i=getFileMatcherPatterns(e,n,t,r.useCaseSensitiveFileNames,r.getCurrentDirectory());const o=i.excludePattern&&getRegexFromPattern(i.excludePattern,r.useCaseSensitiveFileNames);const a=i.includeFilePattern&&getRegexFromPattern(i.includeFilePattern,r.useCaseSensitiveFileNames);if(a){if(o){return e=>!(a.test(e)&&!o.test(e))}return e=>!a.test(e)}if(o){return e=>o.test(e)}return returnTrue}function getCustomTypeMapOfCommandLineOption(e){switch(e.type){case"string":case"number":case"boolean":case"object":return void 0;case"list":case"listOrElement":return getCustomTypeMapOfCommandLineOption(e.element);default:return e.type}}function getNameOfCompilerOptionValue(e,t){return forEachEntry(t,((t,n)=>{if(t===e){return n}}))}function serializeCompilerOptions(e,t){return serializeOptionBaseObject(e,getOptionsNameMap(),t)}function serializeWatchOptions(e){return serializeOptionBaseObject(e,getWatchOptionsNameMap())}function serializeOptionBaseObject(e,{optionsNameMap:t},n){const r=new Map;const i=n&&createGetCanonicalFileName(n.useCaseSensitiveFileNames);for(const o in e){if(hasProperty(e,o)){if(t.has(o)&&(t.get(o).category===wt.Command_line_Options||t.get(o).category===wt.Output_Formatting)){continue}const a=e[o];const s=t.get(o.toLowerCase());if(s){S.assert(s.type!=="listOrElement");const e=getCustomTypeMapOfCommandLineOption(s);if(!e){if(n&&s.isFilePath){r.set(o,getRelativePathFromFile(n.configFilePath,getNormalizedAbsolutePath(a,getDirectoryPath(n.configFilePath)),i))}else if(n&&s.type==="list"&&s.element.isFilePath){r.set(o,a.map((e=>getRelativePathFromFile(n.configFilePath,getNormalizedAbsolutePath(e,getDirectoryPath(n.configFilePath)),i))))}else{r.set(o,a)}}else{if(s.type==="list"){r.set(o,a.map((t=>getNameOfCompilerOptionValue(t,e))))}else{r.set(o,getNameOfCompilerOptionValue(a,e))}}}}}return r}function getCompilerOptionsDiffValue(e,t){const n=getSerializedCompilerOption(e);return getOverwrittenDefaultOptions();function makePadding(e){return Array(e+1).join(" ")}function getOverwrittenDefaultOptions(){const e=[];const r=makePadding(2);Zi.forEach((t=>{if(!n.has(t.name)){return}const i=n.get(t.name);const o=getDefaultValueForOption(t);if(i!==o){e.push(`${r}${t.name}: ${i}`)}else if(hasProperty(ho,t.name)){e.push(`${r}${t.name}: ${o}`)}}));return e.join(t)+t}}function getSerializedCompilerOption(e){const t=extend(e,ho);return serializeCompilerOptions(t)}function generateTSConfig(e,t,n){const r=getSerializedCompilerOption(e);return writeConfigurations();function makePadding(e){return Array(e+1).join(" ")}function isAllowedOptionForOutput({category:e,name:t,isCommandLineOnly:n}){const i=[wt.Command_line_Options,wt.Editor_Support,wt.Compiler_Diagnostics,wt.Backwards_Compatibility,wt.Watch_and_Build_Modes,wt.Output_Formatting];return!n&&e!==void 0&&(!i.includes(e)||r.has(t))}function writeConfigurations(){const e=new Map;e.set(wt.Projects,[]);e.set(wt.Language_and_Environment,[]);e.set(wt.Modules,[]);e.set(wt.JavaScript_Support,[]);e.set(wt.Emit,[]);e.set(wt.Interop_Constraints,[]);e.set(wt.Type_Checking,[]);e.set(wt.Completeness,[]);for(const t of eo){if(isAllowedOptionForOutput(t)){let n=e.get(t.category);if(!n)e.set(t.category,n=[]);n.push(t)}}let i=0;let o=0;const a=[];e.forEach(((e,t)=>{if(a.length!==0){a.push({value:""})}a.push({value:`/* ${getLocaleSpecificMessage(t)} */`});for(const t of e){let e;if(r.has(t.name)){e=`"${t.name}": ${JSON.stringify(r.get(t.name))}${(o+=1)===r.size?"":","}`}else{e=`// "${t.name}": ${JSON.stringify(getDefaultValueForOption(t))},`}a.push({value:e,description:`/* ${t.description&&getLocaleSpecificMessage(t.description)||t.name} */`});i=Math.max(e.length,i)}}));const s=makePadding(2);const c=[];c.push(`{`);c.push(`${s}"compilerOptions": {`);c.push(`${s}${s}/* ${getLocaleSpecificMessage(wt.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)} */`);c.push("");for(const e of a){const{value:t,description:n=""}=e;c.push(t&&`${s}${s}${t}${n&&makePadding(i-t.length+2)+n}`)}if(t.length){c.push(`${s}},`);c.push(`${s}"files": [`);for(let e=0;etypeof e==="object"),"object");const n=toPropValue(getSpecsFromRaw("files"));if(n){const r=e==="no-prop"||isArray(e)&&e.length===0;const i=hasProperty(u,"extends");if(n.length===0&&r&&!i){if(t){const e=a||"tsconfig.json";const n=wt.The_files_list_in_config_file_0_is_empty;const r=forEachTsConfigPropArray(t,"files",(e=>e.initializer));const i=createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(t,r,n,e);d.push(i)}else{createCompilerDiagnosticOnlyIfJson(wt.The_files_list_in_config_file_0_is_empty,a||"tsconfig.json")}}}let r=toPropValue(getSpecsFromRaw("include"));const i=getSpecsFromRaw("exclude");let o=false;let s=toPropValue(i);if(i==="no-prop"){const e=f.outDir;const t=f.declarationDir;if(e||t){s=filter([e,t],(e=>!!e))}}if(n===void 0&&r===void 0){r=[wo];o=true}let c,l;let p,m;if(r){c=validateSpecs(r,d,true,t,"include");p=getSubstitutedStringArrayWithConfigDirTemplate(c,_)||c}if(s){l=validateSpecs(s,d,false,t,"exclude");m=getSubstitutedStringArrayWithConfigDirTemplate(l,_)||l}const g=filter(n,isString);const y=getSubstitutedStringArrayWithConfigDirTemplate(g,_)||g;return{filesSpecs:n,includeSpecs:r,excludeSpecs:s,validatedFilesSpec:y,validatedIncludeSpecs:p,validatedExcludeSpecs:m,validatedFilesSpecBeforeSubstitution:g,validatedIncludeSpecsBeforeSubstitution:c,validatedExcludeSpecsBeforeSubstitution:l,isDefaultIncludeSpec:o}}function getFileNames(e){const t=getFileNamesFromConfigSpecs(g,e,f,n,c);if(shouldReportNoInputFiles(t,canJsonReportNoInputFiles(u),s)){d.push(getErrorForNoInputFiles(g,a))}return t}function getProjectReferences(e){let t;const n=getPropFromRaw("references",(e=>typeof e==="object"),"object");if(isArray(n)){for(const r of n){if(typeof r.path!=="string"){createCompilerDiagnosticOnlyIfJson(wt.Compiler_option_0_requires_a_value_of_type_1,"reference.path","string")}else{(t||(t=[])).push({path:getNormalizedAbsolutePath(r.path,e),originalPath:r.path,prepend:r.prepend,circular:r.circular})}}}return t}function toPropValue(e){return isArray(e)?e:void 0}function getSpecsFromRaw(e){return getPropFromRaw(e,isString,"string")}function getPropFromRaw(e,n,r){if(hasProperty(u,e)&&!isNullOrUndefined(u[e])){if(isArray(u[e])){const i=u[e];if(!t&&!every(i,n)){d.push(createCompilerDiagnostic(wt.Compiler_option_0_requires_a_value_of_type_1,e,r))}return i}else{createCompilerDiagnosticOnlyIfJson(wt.Compiler_option_0_requires_a_value_of_type_1,e,"Array");return"not-array"}}return"no-prop"}function createCompilerDiagnosticOnlyIfJson(e,...n){if(!t){d.push(createCompilerDiagnostic(e,...n))}}}function handleWatchOptionsConfigDirTemplateSubstitution(e,t){return handleOptionConfigDirTemplateSubstitution(e,lo,t)}function handleOptionConfigDirTemplateSubstitution(e,t,n){if(!e)return e;let r;for(const r of t){if(e[r.name]!==void 0){const t=e[r.name];switch(r.type){case"string":S.assert(r.isFilePath);if(startsWithConfigDirTemplate(t)){setOptionValue(r,getSubstitutedPathWithConfigDirTemplate(t,n))}break;case"list":S.assert(r.element.isFilePath);const e=getSubstitutedStringArrayWithConfigDirTemplate(t,n);if(e)setOptionValue(r,e);break;case"object":S.assert(r.name==="paths");const i=getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(t,n);if(i)setOptionValue(r,i);break;default:S.fail("option type not supported")}}}return r||e;function setOptionValue(t,n){(r??(r=assign({},e)))[t.name]=n}}var Lo=`\${configDir}`;function startsWithConfigDirTemplate(e){return isString(e)&&startsWith(e,Lo,true)}function getSubstitutedPathWithConfigDirTemplate(e,t){return getNormalizedAbsolutePath(e.replace(Lo,"./"),t)}function getSubstitutedStringArrayWithConfigDirTemplate(e,t){if(!e)return e;let n;e.forEach(((r,i)=>{if(!startsWithConfigDirTemplate(r))return;(n??(n=e.slice()))[i]=getSubstitutedPathWithConfigDirTemplate(r,t)}));return n}function getSubstitutedMapLikeOfStringArrayWithConfigDirTemplate(e,t){let n;const r=getOwnKeys(e);r.forEach((r=>{if(!isArray(e[r]))return;const i=getSubstitutedStringArrayWithConfigDirTemplate(e[r],t);if(!i)return;(n??(n=assign({},e)))[r]=i}));return n}function isErrorNoInputFiles(e){return e.code===wt.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code}function getErrorForNoInputFiles({includeSpecs:e,excludeSpecs:t},n){return createCompilerDiagnostic(wt.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2,n||"tsconfig.json",JSON.stringify(e||[]),JSON.stringify(t||[]))}function shouldReportNoInputFiles(e,t,n){return e.length===0&&t&&(!n||n.length===0)}function isSolutionConfig(e){return!e.fileNames.length&&hasProperty(e.raw,"references")}function canJsonReportNoInputFiles(e){return!hasProperty(e,"files")&&!hasProperty(e,"references")}function updateErrorForNoInputFiles(e,t,n,r,i){const o=r.length;if(shouldReportNoInputFiles(e,i)){r.push(getErrorForNoInputFiles(n,t))}else{filterMutate(r,(e=>!isErrorNoInputFiles(e)))}return o!==r.length}function isSuccessfulParsedTsconfig(e){return!!e.options}function parseConfig(e,t,n,r,i,o,a,s){var c;r=normalizeSlashes(r);const l=getNormalizedAbsolutePath(i||"",r);if(o.includes(l)){a.push(createCompilerDiagnostic(wt.Circularity_detected_while_resolving_configuration_Colon_0,[...o,l].join(" -> ")));return{raw:e||convertToObject(t,a)}}const d=e?parseOwnConfigOfJson(e,n,r,i,a):parseOwnConfigOfJsonSourceFile(t,n,r,i,a);if((c=d.options)==null?void 0:c.paths){d.options.pathsBasePath=r}if(d.extendedConfigPath){o=o.concat([l]);const e={options:{}};if(isString(d.extendedConfigPath)){applyExtendedConfig(e,d.extendedConfigPath)}else{d.extendedConfigPath.forEach((t=>applyExtendedConfig(e,t)))}if(e.include)d.raw.include=e.include;if(e.exclude)d.raw.exclude=e.exclude;if(e.files)d.raw.files=e.files;if(d.raw.compileOnSave===void 0&&e.compileOnSave)d.raw.compileOnSave=e.compileOnSave;if(t&&e.extendedSourceFiles)t.extendedSourceFiles=arrayFrom(e.extendedSourceFiles.keys());d.options=assign(e.options,d.options);d.watchOptions=d.watchOptions&&e.watchOptions?assignWatchOptions(e,d.watchOptions):d.watchOptions||e.watchOptions}return d;function applyExtendedConfig(e,i){const c=getExtendedConfig(t,i,n,o,a,s,e);if(c&&isSuccessfulParsedTsconfig(c)){const t=c.raw;let o;const setPropertyInResultIfNotUndefined=a=>{if(d.raw[a])return;if(t[a]){e[a]=map(t[a],(e=>startsWithConfigDirTemplate(e)||isRootedDiskPath(e)?e:combinePaths(o||(o=convertToRelativePath(getDirectoryPath(i),r,createGetCanonicalFileName(n.useCaseSensitiveFileNames))),e)))}};setPropertyInResultIfNotUndefined("include");setPropertyInResultIfNotUndefined("exclude");setPropertyInResultIfNotUndefined("files");if(t.compileOnSave!==void 0){e.compileOnSave=t.compileOnSave}assign(e.options,c.options);e.watchOptions=e.watchOptions&&c.watchOptions?assignWatchOptions(e,c.watchOptions):e.watchOptions||c.watchOptions}}function assignWatchOptions(e,t){if(e.watchOptionsCopied)return assign(e.watchOptions,t);e.watchOptionsCopied=true;return assign({},e.watchOptions,t)}}function parseOwnConfigOfJson(e,t,n,r,i){if(hasProperty(e,"excludes")){i.push(createCompilerDiagnostic(wt.Unknown_option_excludes_Did_you_mean_exclude))}const o=convertCompilerOptionsFromJsonWorker(e.compilerOptions,n,i,r);const a=convertTypeAcquisitionFromJsonWorker(e.typeAcquisition,n,i,r);const s=convertWatchOptionsFromJsonWorker(e.watchOptions,n,i);e.compileOnSave=convertCompileOnSaveOptionFromJson(e,n,i);const c=e.extends||e.extends===""?getExtendsConfigPathOrArray(e.extends,t,n,r,i):void 0;return{raw:e,options:o,watchOptions:s,typeAcquisition:a,extendedConfigPath:c}}function getExtendsConfigPathOrArray(e,t,n,r,i,o,a,s){let c;const l=r?directoryOfCombinedPath(r,n):n;if(isString(e)){c=getExtendsConfigPath(e,t,l,i,a,s)}else if(isArray(e)){c=[];for(let r=0;re.name===p))){l=append(l,f.name)}}}}}function getExtendsConfigPath(e,t,n,r,i,o){e=normalizeSlashes(e);if(isRootedDiskPath(e)||startsWith(e,"./")||startsWith(e,"../")){let a=getNormalizedAbsolutePath(e,n);if(!t.fileExists(a)&&!endsWith(a,".json")){a=`${a}.json`;if(!t.fileExists(a)){r.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(o,i,wt.File_0_not_found,e));return void 0}}return a}const a=nodeNextJsonConfigResolver(e,combinePaths(n,"tsconfig.json"),t);if(a.resolvedModule){return a.resolvedModule.resolvedFileName}if(e===""){r.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(o,i,wt.Compiler_option_0_cannot_be_given_an_empty_string,"extends"))}else{r.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(o,i,wt.File_0_not_found,e))}return void 0}function getExtendedConfig(e,t,n,r,i,o,a){const s=n.useCaseSensitiveFileNames?t:toFileNameLowerCase(t);let c;let l;let d;if(o&&(c=o.get(s))){({extendedResult:l,extendedConfig:d}=c)}else{l=readJsonConfigFile(t,(e=>n.readFile(e)));if(!l.parseDiagnostics.length){d=parseConfig(void 0,l,n,getDirectoryPath(t),getBaseFileName(t),r,i,o)}if(o){o.set(s,{extendedResult:l,extendedConfig:d})}}if(e){(a.extendedSourceFiles??(a.extendedSourceFiles=new Set)).add(l.fileName);if(l.extendedSourceFiles){for(const e of l.extendedSourceFiles){a.extendedSourceFiles.add(e)}}}if(l.parseDiagnostics.length){i.push(...l.parseDiagnostics);return void 0}return d}function convertCompileOnSaveOptionFromJson(e,t,n){if(!hasProperty(e,zi.name)){return false}const r=convertJsonOption(zi,e.compileOnSave,t,n);return typeof r==="boolean"&&r}function convertCompilerOptionsFromJson(e,t,n){const r=[];const i=convertCompilerOptionsFromJsonWorker(e,t,r,n);return{options:i,errors:r}}function convertTypeAcquisitionFromJson(e,t,n){const r=[];const i=convertTypeAcquisitionFromJsonWorker(e,t,r,n);return{options:i,errors:r}}function getDefaultCompilerOptions(e){const t=e&&getBaseFileName(e)==="jsconfig.json"?{allowJs:true,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:true,skipLibCheck:true,noEmit:true}:{};return t}function convertCompilerOptionsFromJsonWorker(e,t,n,r){const i=getDefaultCompilerOptions(r);convertOptionsFromJson(getCommandLineCompilerOptionsMap(),e,t,i,To,n);if(r){i.configFilePath=normalizeSlashes(r)}return i}function getDefaultTypeAcquisition(e){return{enable:!!e&&getBaseFileName(e)==="jsconfig.json",include:[],exclude:[]}}function convertTypeAcquisitionFromJsonWorker(e,t,n,r){const i=getDefaultTypeAcquisition(r);convertOptionsFromJson(getCommandLineTypeAcquisitionMap(),e,t,i,bo,n);return i}function convertWatchOptionsFromJsonWorker(e,t,n){return convertOptionsFromJson(getCommandLineWatchOptionsMap(),e,t,void 0,Eo,n)}function convertOptionsFromJson(e,t,n,r,i,o){if(!t){return}for(const a in t){const s=e.get(a);if(s){(r||(r={}))[s.name]=convertJsonOption(s,t[a],n,o)}else{o.push(createUnknownOptionError(a,i))}}return r}function createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(e,t,n,...r){return e&&t?createDiagnosticForNodeInSourceFile(e,t,n,...r):createCompilerDiagnostic(n,...r)}function convertJsonOption(e,t,n,r,i,o,a){if(e.isCommandLineOnly){r.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(a,i==null?void 0:i.name,wt.Option_0_can_only_be_specified_on_command_line,e.name));return void 0}if(isCompilerOptionsValue(e,t)){const s=e.type;if(s==="list"&&isArray(t)){return convertJsonOptionOfListType(e,t,n,r,i,o,a)}else if(s==="listOrElement"){return isArray(t)?convertJsonOptionOfListType(e,t,n,r,i,o,a):convertJsonOption(e.element,t,n,r,i,o,a)}else if(!isString(e.type)){return convertJsonOptionOfCustomType(e,t,r,o,a)}const c=validateJsonOptionValue(e,t,r,o,a);return isNullOrUndefined(c)?c:normalizeNonListOptionValue(e,n,c)}else{r.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(a,o,wt.Compiler_option_0_requires_a_value_of_type_1,e.name,getCompilerOptionValueTypeString(e)))}}function normalizeNonListOptionValue(e,t,n){if(e.isFilePath){n=normalizeSlashes(n);n=!startsWithConfigDirTemplate(n)?getNormalizedAbsolutePath(n,t):n;if(n===""){n="."}}return n}function validateJsonOptionValue(e,t,n,r,i){var o;if(isNullOrUndefined(t))return void 0;const a=(o=e.extraValidation)==null?void 0:o.call(e,t);if(!a)return t;n.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(i,r,...a));return void 0}function convertJsonOptionOfCustomType(e,t,n,r,i){if(isNullOrUndefined(t))return void 0;const o=t.toLowerCase();const a=e.type.get(o);if(a!==void 0){return validateJsonOptionValue(e,a,n,r,i)}else{n.push(createDiagnosticForInvalidCustomType(e,((e,...t)=>createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(i,r,e,...t))))}}function convertJsonOptionOfListType(e,t,n,r,i,o,a){return filter(map(t,((t,s)=>convertJsonOption(e.element,t,n,r,i,o==null?void 0:o.elements[s],a))),(t=>e.listPreserveFalsyValues?true:!!t))}var Mo=/(?:^|\/)\*\*\/?$/;var Ro=/^[^*?]*(?=\/[^/]*[*?])/;function getFileNamesFromConfigSpecs(e,t,n,r,i=d){t=normalizePath(t);const o=createGetCanonicalFileName(r.useCaseSensitiveFileNames);const a=new Map;const s=new Map;const c=new Map;const{validatedFilesSpec:l,validatedIncludeSpecs:p,validatedExcludeSpecs:u}=e;const f=getSupportedExtensions(n,i);const m=getSupportedExtensionsWithJsonIfResolveJsonModule(n,f);if(l){for(const e of l){const n=getNormalizedAbsolutePath(e,t);a.set(o(n),n)}}let _;if(p&&p.length>0){for(const e of r.readDirectory(t,flatten(m),u,p,void 0)){if(fileExtensionIs(e,".json")){if(!_){const e=p.filter((e=>endsWith(e,".json")));const n=map(getRegularExpressionsForWildcards(e,t,"files"),(e=>`^${e}$`));_=n?n.map((e=>getRegexFromPattern(e,r.useCaseSensitiveFileNames))):d}const n=findIndex(_,(t=>t.test(e)));if(n!==-1){const t=o(e);if(!a.has(t)&&!c.has(t)){c.set(t,e)}}continue}if(hasFileWithHigherPriorityExtension(e,a,s,f,o)){continue}removeWildcardFilesWithLowerPriorityExtension(e,s,f,o);const n=o(e);if(!a.has(n)&&!s.has(n)){s.set(n,e)}}}const g=arrayFrom(a.values());const y=arrayFrom(s.values());return g.concat(y,arrayFrom(c.values()))}function isExcludedFile(e,t,n,r,i){const{validatedFilesSpec:o,validatedIncludeSpecs:a,validatedExcludeSpecs:s}=t;if(!length(a)||!length(s))return false;n=normalizePath(n);const c=createGetCanonicalFileName(r);if(o){for(const t of o){if(c(getNormalizedAbsolutePath(t,n))===e)return false}}return matchesExcludeWorker(e,s,r,i,n)}function invalidDotDotAfterRecursiveWildcard(e){const t=startsWith(e,"**/")?0:e.indexOf("/**/");if(t===-1){return false}const n=endsWith(e,"/..")?e.length:e.lastIndexOf("/../");return n>t}function matchesExclude(e,t,n,r){return matchesExcludeWorker(e,filter(t,(e=>!invalidDotDotAfterRecursiveWildcard(e))),n,r)}function matchesExcludeWorker(e,t,n,r,i){const o=getRegularExpressionForWildcard(t,combinePaths(normalizePath(r),i),"exclude");const a=o&&getRegexFromPattern(o,n);if(!a)return false;if(a.test(e))return true;return!hasExtension(e)&&a.test(ensureTrailingDirectorySeparator(e))}function validateSpecs(e,t,n,r,i){return e.filter((e=>{if(!isString(e))return false;const r=specToDiagnostic(e,n);if(r!==void 0){t.push(createDiagnostic(...r))}return r===void 0}));function createDiagnostic(e,t){const n=getTsConfigPropArrayElementValue(r,i,t);return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(r,n,e,t)}}function specToDiagnostic(e,t){S.assert(typeof e==="string");if(t&&Mo.test(e)){return[wt.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,e]}else if(invalidDotDotAfterRecursiveWildcard(e)){return[wt.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,e]}}function getWildcardDirectories({validatedIncludeSpecs:e,validatedExcludeSpecs:t},n,r){const i=getRegularExpressionForWildcard(t,n,"exclude");const o=i&&new RegExp(i,r?"":"i");const a={};const s=new Map;if(e!==void 0){const t=[];for(const i of e){const e=normalizePath(combinePaths(n,i));if(o&&o.test(e)){continue}const c=getWildcardDirectoryFromSpec(e,r);if(c){const{key:e,path:n,flags:r}=c;const i=s.get(e);const o=i!==void 0?a[i]:void 0;if(o===void 0||ofileExtensionIsOneOf(e,t)?t:void 0));if(!o){return false}for(const r of o){if(fileExtensionIs(e,r)&&(r!==".ts"||!fileExtensionIs(e,".d.ts"))){return false}const o=i(changeExtension(e,r));if(t.has(o)||n.has(o)){if(r===".d.ts"&&(fileExtensionIs(e,".js")||fileExtensionIs(e,".jsx"))){continue}return true}}return false}function removeWildcardFilesWithLowerPriorityExtension(e,t,n,r){const i=forEach(n,(t=>fileExtensionIsOneOf(e,t)?t:void 0));if(!i){return}for(let n=i.length-1;n>=0;n--){const o=i[n];if(fileExtensionIs(e,o)){return}const a=r(changeExtension(e,o));t.delete(a)}}function convertCompilerOptionsForTelemetry(e){const t={};for(const n in e){if(hasProperty(e,n)){const r=getOptionFromName(n);if(r!==void 0){t[n]=getOptionValueWithEmptyStrings(e[n],r)}}}return t}function getOptionValueWithEmptyStrings(e,t){if(e===void 0)return e;switch(t.type){case"object":return"";case"string":return"";case"number":return typeof e==="number"?e:"";case"boolean":return typeof e==="boolean"?e:"";case"listOrElement":if(!isArray(e))return getOptionValueWithEmptyStrings(e,t.element);case"list":const n=t.element;return isArray(e)?mapDefined(e,(e=>getOptionValueWithEmptyStrings(e,n))):"";default:return forEachEntry(t.type,((t,n)=>{if(t===e){return n}}))}}function getDefaultValueForOption(e){switch(e.type){case"number":return 1;case"boolean":return true;case"string":const t=e.defaultValueDescription;return e.isFilePath?`./${t&&typeof t==="string"?t:""}`:"";case"list":return[];case"listOrElement":return getDefaultValueForOption(e.element);case"object":return{};default:const n=firstOrUndefinedIterator(e.type.keys());if(n!==void 0)return n;return S.fail("Expected 'option.type' to have entries.")}}function trace(e,t,...n){e.trace(formatMessage(t,...n))}function isTraceEnabled(e,t){return!!e.traceResolution&&t.trace!==void 0}function withPackageId(e,t,n){let r;if(t&&e){const i=e.contents.packageJsonContent;if(typeof i.name==="string"&&typeof i.version==="string"){r={name:i.name,subModuleName:t.path.slice(e.packageDirectory.length+Pt.length),version:i.version,peerDependencies:getPeerDependenciesOfPackageJsonInfo(e,n)}}}return t&&{path:t.path,extension:t.ext,packageId:r,resolvedUsingTsExtension:t.resolvedUsingTsExtension}}function noPackageId(e){return withPackageId(void 0,e,void 0)}function removeIgnoredPackageId(e){if(e){S.assert(e.packageId===void 0);return{path:e.path,ext:e.extension,resolvedUsingTsExtension:e.resolvedUsingTsExtension}}}function formatExtensions(e){const t=[];if(e&1)t.push("TypeScript");if(e&2)t.push("JavaScript");if(e&4)t.push("Declaration");if(e&8)t.push("JSON");return t.join(", ")}function extensionsToExtensionsArray(e){const t=[];if(e&1)t.push(...br);if(e&2)t.push(...Tr);if(e&4)t.push(...xr);if(e&8)t.push(".json");return t}function resolvedTypeScriptOnly(e){if(!e){return void 0}S.assert(extensionIsTS(e.extension));return{fileName:e.path,packageId:e.packageId}}function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(e,t,n,r,i,o,a,s,c){if(!a.resultFromCache&&!a.compilerOptions.preserveSymlinks&&t&&n&&!t.originalPath&&!isExternalModuleNameRelative(e)){const{resolvedFileName:e,originalPath:n}=getOriginalAndResolvedFileName(t.path,a.host,a.traceEnabled);if(n)t={...t,path:e,originalPath:n}}return createResolvedModuleWithFailedLookupLocations(t,n,r,i,o,a.resultFromCache,s,c)}function createResolvedModuleWithFailedLookupLocations(e,t,n,r,i,o,a,s){if(o){if(!(a==null?void 0:a.isReadonly)){o.failedLookupLocations=updateResolutionField(o.failedLookupLocations,n);o.affectingLocations=updateResolutionField(o.affectingLocations,r);o.resolutionDiagnostics=updateResolutionField(o.resolutionDiagnostics,i);return o}else{return{...o,failedLookupLocations:initializeResolutionFieldForReadonlyCache(o.failedLookupLocations,n),affectingLocations:initializeResolutionFieldForReadonlyCache(o.affectingLocations,r),resolutionDiagnostics:initializeResolutionFieldForReadonlyCache(o.resolutionDiagnostics,i)}}}return{resolvedModule:e&&{resolvedFileName:e.path,originalPath:e.originalPath===true?void 0:e.originalPath,extension:e.extension,isExternalLibraryImport:t,packageId:e.packageId,resolvedUsingTsExtension:!!e.resolvedUsingTsExtension},failedLookupLocations:initializeResolutionField(n),affectingLocations:initializeResolutionField(r),resolutionDiagnostics:initializeResolutionField(i),alternateResult:s}}function initializeResolutionField(e){return e.length?e:void 0}function updateResolutionField(e,t){if(!(t==null?void 0:t.length))return e;if(!(e==null?void 0:e.length))return t;e.push(...t);return e}function initializeResolutionFieldForReadonlyCache(e,t){if(!(e==null?void 0:e.length))return initializeResolutionField(t);if(!t.length)return e.slice();return[...e,...t]}function readPackageJsonField(e,t,n,r){if(!hasProperty(e,t)){if(r.traceEnabled){trace(r.host,wt.package_json_does_not_have_a_0_field,t)}return}const i=e[t];if(typeof i!==n||i===null){if(r.traceEnabled){trace(r.host,wt.Expected_type_of_0_field_in_package_json_to_be_1_got_2,t,n,i===null?"null":typeof i)}return}return i}function readPackageJsonPathField(e,t,n,r){const i=readPackageJsonField(e,t,"string",r);if(i===void 0){return}if(!i){if(r.traceEnabled){trace(r.host,wt.package_json_had_a_falsy_0_field,t)}return}const o=normalizePath(combinePaths(n,i));if(r.traceEnabled){trace(r.host,wt.package_json_has_0_field_1_that_references_2,t,i,o)}return o}function readPackageJsonTypesFields(e,t,n){return readPackageJsonPathField(e,"typings",t,n)||readPackageJsonPathField(e,"types",t,n)}function readPackageJsonTSConfigField(e,t,n){return readPackageJsonPathField(e,"tsconfig",t,n)}function readPackageJsonMainField(e,t,n){return readPackageJsonPathField(e,"main",t,n)}function readPackageJsonTypesVersionsField(e,t){const n=readPackageJsonField(e,"typesVersions","object",t);if(n===void 0)return;if(t.traceEnabled){trace(t.host,wt.package_json_has_a_typesVersions_field_with_version_specific_path_mappings)}return n}function readPackageJsonTypesVersionPaths(e,t){const n=readPackageJsonTypesVersionsField(e,t);if(n===void 0)return;if(t.traceEnabled){for(const e in n){if(hasProperty(n,e)&&!P.tryParse(e)){trace(t.host,wt.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range,e)}}}const r=getPackageJsonTypesVersionsPaths(n);if(!r){if(t.traceEnabled){trace(t.host,wt.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0,s)}return}const{version:i,paths:o}=r;if(typeof o!=="object"){if(t.traceEnabled){trace(t.host,wt.Expected_type_of_0_field_in_package_json_to_be_1_got_2,`typesVersions['${i}']`,"object",typeof o)}return}return r}var Bo;function getPackageJsonTypesVersionsPaths(e){if(!Bo)Bo=new F(c);for(const t in e){if(!hasProperty(e,t))continue;const n=P.tryParse(t);if(n===void 0){continue}if(n.test(Bo)){return{version:t,paths:e[t]}}}}function getEffectiveTypeRoots(e,t){if(e.typeRoots){return e.typeRoots}let n;if(e.configFilePath){n=getDirectoryPath(e.configFilePath)}else if(t.getCurrentDirectory){n=t.getCurrentDirectory()}if(n!==void 0){return getDefaultTypeRoots(n)}}function getDefaultTypeRoots(e){let t;forEachAncestorDirectory(normalizePath(e),(e=>{const n=combinePaths(e,jo);(t??(t=[])).push(n)}));return t}var jo=combinePaths("node_modules","@types");function arePathsEqual(e,t,n){const r=typeof n.useCaseSensitiveFileNames==="function"?n.useCaseSensitiveFileNames():n.useCaseSensitiveFileNames;return comparePaths(e,t,!r)===0}function getOriginalAndResolvedFileName(e,t,n){const r=realPath(e,t,n);const i=arePathsEqual(e,r,t);return{resolvedFileName:i?e:r,originalPath:i?void 0:e}}function getCandidateFromTypeRoot(e,t,n){const r=endsWith(e,"/node_modules/@types")||endsWith(e,"/node_modules/@types/")?mangleScopedPackageNameWithTrace(t,n):t;return combinePaths(e,r)}function resolveTypeReferenceDirective(e,t,n,r,i,o,a){S.assert(typeof e==="string","Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");const s=isTraceEnabled(n,r);if(i){n=i.commandLine.options}const c=t?getDirectoryPath(t):void 0;let l=c?o==null?void 0:o.getFromDirectoryCache(e,a,c,i):void 0;if(!l&&c&&!isExternalModuleNameRelative(e)){l=o==null?void 0:o.getFromNonRelativeNameCache(e,a,c,i)}if(l){if(s){trace(r,wt.Resolving_type_reference_directive_0_containing_file_1,e,t);if(i)trace(r,wt.Using_compiler_options_of_project_reference_redirect_0,i.sourceFile.fileName);trace(r,wt.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1,e,c);traceResult(l)}return l}const d=getEffectiveTypeRoots(n,r);if(s){if(t===void 0){if(d===void 0){trace(r,wt.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set,e)}else{trace(r,wt.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1,e,d)}}else{if(d===void 0){trace(r,wt.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set,e,t)}else{trace(r,wt.Resolving_type_reference_directive_0_containing_file_1_root_directory_2,e,t,d)}}if(i){trace(r,wt.Using_compiler_options_of_project_reference_redirect_0,i.sourceFile.fileName)}}const p=[];const u=[];let f=getNodeResolutionFeatures(n);if(a!==void 0){f|=30}const m=qn(n);if(a===99&&(3<=m&&m<=99)){f|=32}const _=f&8?getConditions(n,a):[];const g=[];const y={compilerOptions:n,host:r,traceEnabled:s,failedLookupLocations:p,affectingLocations:u,packageJsonInfoCache:o,features:f,conditions:_,requestContainingDirectory:c,reportDiagnostic:e=>void g.push(e),isConfigLookup:false,candidateIsFromPackageJsonField:false,resolvedPackageDirectory:false};let h=primaryLookup();let T=true;if(!h){h=secondaryLookup();T=false}let v;if(h){const{fileName:e,packageId:t}=h;let i=e,o;if(!n.preserveSymlinks)({resolvedFileName:i,originalPath:o}=getOriginalAndResolvedFileName(e,r,s));v={primary:T,resolvedFileName:i,originalPath:o,packageId:t,isExternalLibraryImport:pathContainsNodeModules(e)}}l={resolvedTypeReferenceDirective:v,failedLookupLocations:initializeResolutionField(p),affectingLocations:initializeResolutionField(u),resolutionDiagnostics:initializeResolutionField(g)};if(c&&o&&!o.isReadonly){o.getOrCreateCacheForDirectory(c,i).set(e,a,l);if(!isExternalModuleNameRelative(e)){o.getOrCreateCacheForNonRelativeName(e,a,i).set(c,l)}}if(s)traceResult(l);return l;function traceResult(t){var n;if(!((n=t.resolvedTypeReferenceDirective)==null?void 0:n.resolvedFileName)){trace(r,wt.Type_reference_directive_0_was_not_resolved,e)}else if(t.resolvedTypeReferenceDirective.packageId){trace(r,wt.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3,e,t.resolvedTypeReferenceDirective.resolvedFileName,packageIdToString(t.resolvedTypeReferenceDirective.packageId),t.resolvedTypeReferenceDirective.primary)}else{trace(r,wt.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2,e,t.resolvedTypeReferenceDirective.resolvedFileName,t.resolvedTypeReferenceDirective.primary)}}function primaryLookup(){if(d&&d.length){if(s){trace(r,wt.Resolving_with_primary_search_path_0,d.join(", "))}return firstDefined(d,(t=>{const i=getCandidateFromTypeRoot(t,e,y);const o=directoryProbablyExists(t,r);if(!o&&s){trace(r,wt.Directory_0_does_not_exist_skipping_all_lookups_in_it,t)}if(n.typeRoots){const e=loadModuleFromFile(4,i,!o,y);if(e){const t=parseNodeModuleFromPath(e.path);const n=t?getPackageJsonInfo(t,false,y):void 0;return resolvedTypeScriptOnly(withPackageId(n,e,y))}}return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(4,i,!o,y))}))}else{if(s){trace(r,wt.Root_directory_cannot_be_determined_skipping_primary_search_paths)}}}function secondaryLookup(){const i=t&&getDirectoryPath(t);if(i!==void 0){let o;if(!n.typeRoots||!endsWith(t,Ha)){if(s){trace(r,wt.Looking_up_in_node_modules_folder_initial_location_0,i)}if(!isExternalModuleNameRelative(e)){const t=loadModuleFromNearestNodeModulesDirectory(4,e,i,y,void 0,void 0);o=t&&t.value}else{const{path:t}=normalizePathForCJSResolution(i,e);o=nodeLoadModuleByRelativeName(4,t,false,y,true)}}else if(s){trace(r,wt.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder)}return resolvedTypeScriptOnly(o)}else{if(s){trace(r,wt.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder)}}}}function getNodeResolutionFeatures(e){let t=0;switch(qn(e)){case 3:t=30;break;case 99:t=30;break;case 100:t=30;break}if(e.resolvePackageJsonExports){t|=8}else if(e.resolvePackageJsonExports===false){t&=~8}if(e.resolvePackageJsonImports){t|=2}else if(e.resolvePackageJsonImports===false){t&=~2}return t}function getConditions(e,t){const n=qn(e);if(t===void 0){if(n===100){t=99}else if(n===2){return[]}}const r=t===99?["import"]:["require"];if(!e.noDtsResolution){r.push("types")}if(n!==100){r.push("node")}return concatenate(r,e.customConditions)}function resolvePackageNameToPackageJson(e,t,n,r,i){const o=getTemporaryModuleResolutionState(i==null?void 0:i.getPackageJsonInfoCache(),r,n);return forEachAncestorDirectoryStoppingAtGlobalCache(r,t,(t=>{if(getBaseFileName(t)!=="node_modules"){const n=combinePaths(t,"node_modules");const r=combinePaths(n,e);return getPackageJsonInfo(r,false,o)}}))}function getAutomaticTypeDirectiveNames(e,t){if(e.types){return e.types}const n=[];if(t.directoryExists&&t.getDirectories){const r=getEffectiveTypeRoots(e,t);if(r){for(const e of r){if(t.directoryExists(e)){for(const r of t.getDirectories(e)){const i=normalizePath(r);const o=combinePaths(e,i,"package.json");const a=t.fileExists(o)&&readJson(o,t).typings===null;if(!a){const e=getBaseFileName(i);if(e.charCodeAt(0)!==46){n.push(e)}}}}}}}return n}function isPackageJsonInfo(e){return!!(e==null?void 0:e.contents)}function isMissingPackageJsonInfo(e){return!!e&&!e.contents}function compilerOptionValueToString(e){var t;if(e===null||typeof e!=="object"){return""+e}if(isArray(e)){return`[${(t=e.map((e=>compilerOptionValueToString(e))))==null?void 0:t.join(",")}]`}let n="{";for(const t in e){if(hasProperty(e,t)){n+=`${t}: ${compilerOptionValueToString(e[t])}`}}return n+"}"}function getKeyForCompilerOptions(e,t){return t.map((t=>compilerOptionValueToString(getCompilerOptionValue(e,t)))).join("|")+`|${e.pathsBasePath}`}function createCacheWithRedirects(e,t){const n=new Map;const r=new Map;let i=new Map;if(e)n.set(e,i);return{getMapOfCacheRedirects:getMapOfCacheRedirects,getOrCreateMapOfCacheRedirects:getOrCreateMapOfCacheRedirects,update:update,clear:clear2,getOwnMap:()=>i};function getMapOfCacheRedirects(e){return e?getOrCreateMap(e.commandLine.options,false):i}function getOrCreateMapOfCacheRedirects(e){return e?getOrCreateMap(e.commandLine.options,true):i}function update(t){if(e!==t){if(e)i=getOrCreateMap(t,true);else n.set(t,i);e=t}}function getOrCreateMap(t,o){let a=n.get(t);if(a)return a;const s=getRedirectsCacheKey(t);a=r.get(s);if(!a){if(e){const t=getRedirectsCacheKey(e);if(t===s)a=i;else if(!r.has(t))r.set(t,i)}if(o)a??(a=new Map);if(a)r.set(s,a)}if(a)n.set(t,a);return a}function clear2(){const o=e&&t.get(e);i.clear();n.clear();t.clear();r.clear();if(e){if(o)t.set(e,o);n.set(e,i)}}function getRedirectsCacheKey(e){let n=t.get(e);if(!n){t.set(e,n=getKeyForCompilerOptions(e,io))}return n}}function createPackageJsonInfoCache(e,t){let n;return{getPackageJsonInfo:getPackageJsonInfo2,setPackageJsonInfo:setPackageJsonInfo,clear:clear2,getInternalMap:getInternalMap};function getPackageJsonInfo2(r){return n==null?void 0:n.get(toPath(r,e,t))}function setPackageJsonInfo(r,i){(n||(n=new Map)).set(toPath(r,e,t),i)}function clear2(){n=void 0}function getInternalMap(){return n}}function getOrCreateCache(e,t,n,r){const i=e.getOrCreateMapOfCacheRedirects(t);let o=i.get(n);if(!o){o=r();i.set(n,o)}return o}function createPerDirectoryResolutionCache(e,t,n,r){const i=createCacheWithRedirects(n,r);return{getFromDirectoryCache:getFromDirectoryCache,getOrCreateCacheForDirectory:getOrCreateCacheForDirectory,clear:clear2,update:update,directoryToModuleNameMap:i};function clear2(){i.clear()}function update(e){i.update(e)}function getOrCreateCacheForDirectory(n,r){const o=toPath(n,e,t);return getOrCreateCache(i,r,o,(()=>createModeAwareCache()))}function getFromDirectoryCache(n,r,o,a){var s,c;const l=toPath(o,e,t);return(c=(s=i.getMapOfCacheRedirects(a))==null?void 0:s.get(l))==null?void 0:c.get(n,r)}}function createModeAwareCacheKey(e,t){return t===void 0?e:`${t}|${e}`}function createModeAwareCache(){const e=new Map;const t=new Map;const n={get(t,n){return e.get(getUnderlyingCacheKey(t,n))},set(t,r,i){e.set(getUnderlyingCacheKey(t,r),i);return n},delete(t,r){e.delete(getUnderlyingCacheKey(t,r));return n},has(t,n){return e.has(getUnderlyingCacheKey(t,n))},forEach(n){return e.forEach(((e,r)=>{const[i,o]=t.get(r);return n(e,i,o)}))},size(){return e.size}};return n;function getUnderlyingCacheKey(e,n){const r=createModeAwareCacheKey(e,n);t.set(r,[e,n]);return r}}function getOriginalOrResolvedModuleFileName(e){return e.resolvedModule&&(e.resolvedModule.originalPath||e.resolvedModule.resolvedFileName)}function getOriginalOrResolvedTypeReferenceFileName(e){return e.resolvedTypeReferenceDirective&&(e.resolvedTypeReferenceDirective.originalPath||e.resolvedTypeReferenceDirective.resolvedFileName)}function createNonRelativeNameResolutionCache(e,t,n,r,i){const o=createCacheWithRedirects(n,i);return{getFromNonRelativeNameCache:getFromNonRelativeNameCache,getOrCreateCacheForNonRelativeName:getOrCreateCacheForNonRelativeName,clear:clear2,update:update};function clear2(){o.clear()}function update(e){o.update(e)}function getFromNonRelativeNameCache(e,t,n,r){var i,a;S.assert(!isExternalModuleNameRelative(e));return(a=(i=o.getMapOfCacheRedirects(r))==null?void 0:i.get(createModeAwareCacheKey(e,t)))==null?void 0:a.get(n)}function getOrCreateCacheForNonRelativeName(e,t,n){S.assert(!isExternalModuleNameRelative(e));return getOrCreateCache(o,n,createModeAwareCacheKey(e,t),createPerModuleNameCache)}function createPerModuleNameCache(){const n=new Map;return{get:get,set:set};function get(r){return n.get(toPath(r,e,t))}function set(i,o){const a=toPath(i,e,t);if(n.has(a)){return}n.set(a,o);const s=r(o);const c=s&&getCommonPrefix(a,s);let l=a;while(l!==c){const e=getDirectoryPath(l);if(e===l||n.has(e)){break}n.set(e,o);l=e}}function getCommonPrefix(n,r){const i=toPath(getDirectoryPath(r),e,t);let o=0;const a=Math.min(n.length,i.length);while(or,clearAllExceptPackageJsonInfoCache:clearAllExceptPackageJsonInfoCache,optionsToRedirectsKey:o};function clear2(){clearAllExceptPackageJsonInfoCache();r.clear()}function clearAllExceptPackageJsonInfoCache(){a.clear();s.clear()}function update(e){a.update(e);s.update(e)}}function createModuleResolutionCache(e,t,n,r,i){const o=createModuleOrTypeReferenceResolutionCache(e,t,n,r,getOriginalOrResolvedModuleFileName,i);o.getOrCreateCacheForModuleName=(e,t,n)=>o.getOrCreateCacheForNonRelativeName(e,t,n);return o}function createTypeReferenceDirectiveResolutionCache(e,t,n,r,i){return createModuleOrTypeReferenceResolutionCache(e,t,n,r,getOriginalOrResolvedTypeReferenceFileName,i)}function getOptionsForLibraryResolution(e){return{moduleResolution:2,traceResolution:e.traceResolution}}function resolveLibrary(e,t,n,r,i){return resolveModuleName(e,t,getOptionsForLibraryResolution(n),r,i)}function resolveModuleNameFromCache(e,t,n,r){const i=getDirectoryPath(t);return n.getFromDirectoryCache(e,r,i,void 0)}function resolveModuleName(e,t,n,r,i,o,a){const s=isTraceEnabled(n,r);if(o){n=o.commandLine.options}if(s){trace(r,wt.Resolving_module_0_from_1,e,t);if(o){trace(r,wt.Using_compiler_options_of_project_reference_redirect_0,o.sourceFile.fileName)}}const c=getDirectoryPath(t);let l=i==null?void 0:i.getFromDirectoryCache(e,a,c,o);if(l){if(s){trace(r,wt.Resolution_for_module_0_was_found_in_cache_from_location_1,e,c)}}else{let d=n.moduleResolution;if(d===void 0){d=qn(n);if(s){trace(r,wt.Module_resolution_kind_is_not_specified_using_0,qe[d])}}else{if(s){trace(r,wt.Explicitly_specified_module_resolution_kind_Colon_0,qe[d])}}switch(d){case 3:l=node16ModuleNameResolver(e,t,n,r,i,o,a);break;case 99:l=nodeNextModuleNameResolver(e,t,n,r,i,o,a);break;case 2:l=nodeModuleNameResolver(e,t,n,r,i,o,a?getConditions(n,a):void 0);break;case 1:l=classicNameResolver(e,t,n,r,i,o);break;case 100:l=bundlerModuleNameResolver(e,t,n,r,i,o,a?getConditions(n,a):void 0);break;default:return S.fail(`Unexpected moduleResolution: ${d}`)}if(i&&!i.isReadonly){i.getOrCreateCacheForDirectory(c,o).set(e,a,l);if(!isExternalModuleNameRelative(e)){i.getOrCreateCacheForNonRelativeName(e,a,o).set(c,l)}}}if(s){if(l.resolvedModule){if(l.resolvedModule.packageId){trace(r,wt.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2,e,l.resolvedModule.resolvedFileName,packageIdToString(l.resolvedModule.packageId))}else{trace(r,wt.Module_name_0_was_successfully_resolved_to_1,e,l.resolvedModule.resolvedFileName)}}else{trace(r,wt.Module_name_0_was_not_resolved,e)}}return l}function tryLoadModuleUsingOptionalResolutionSettings(e,t,n,r,i){const o=tryLoadModuleUsingPathsIfEligible(e,t,r,i);if(o)return o.value;if(!isExternalModuleNameRelative(t)){return tryLoadModuleUsingBaseUrl(e,t,r,i)}else{return tryLoadModuleUsingRootDirs(e,t,n,r,i)}}function tryLoadModuleUsingPathsIfEligible(e,t,n,r){const{baseUrl:i,paths:o}=r.compilerOptions;if(o&&!pathIsRelative(t)){if(r.traceEnabled){if(i){trace(r.host,wt.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,i,t)}trace(r.host,wt.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0,t)}const a=getPathsBasePath(r.compilerOptions,r.host);const s=tryParsePatterns(o);return tryLoadModuleUsingPaths(e,t,a,o,s,n,false,r)}}function tryLoadModuleUsingRootDirs(e,t,n,r,i){if(!i.compilerOptions.rootDirs){return void 0}if(i.traceEnabled){trace(i.host,wt.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0,t)}const o=normalizePath(combinePaths(n,t));let a;let s;for(const e of i.compilerOptions.rootDirs){let t=normalizePath(e);if(!endsWith(t,Pt)){t+=Pt}const n=startsWith(o,t)&&(s===void 0||s.length{e[e["None"]=0]="None";e[e["Imports"]=2]="Imports";e[e["SelfName"]=4]="SelfName";e[e["Exports"]=8]="Exports";e[e["ExportsPatternTrailers"]=16]="ExportsPatternTrailers";e[e["AllFeatures"]=30]="AllFeatures";e[e["Node16Default"]=30]="Node16Default";e[e["NodeNextDefault"]=30]="NodeNextDefault";e[e["BundlerDefault"]=30]="BundlerDefault";e[e["EsmMode"]=32]="EsmMode";return e})(Jo||{});function node16ModuleNameResolver(e,t,n,r,i,o,a){return nodeNextModuleNameResolverWorker(30,e,t,n,r,i,o,a)}function nodeNextModuleNameResolver(e,t,n,r,i,o,a){return nodeNextModuleNameResolverWorker(30,e,t,n,r,i,o,a)}function nodeNextModuleNameResolverWorker(e,t,n,r,i,o,a,s,c){const l=getDirectoryPath(n);const d=s===99?32:0;let p=r.noDtsResolution?3:1|2|4;if(Yn(r)){p|=8}return nodeModuleNameResolverWorker(e|d,t,l,r,i,o,p,false,a,c)}function tryResolveJSModuleWorker(e,t,n){return nodeModuleNameResolverWorker(0,e,t,{moduleResolution:2,allowJs:true},n,void 0,2,false,void 0,void 0)}function bundlerModuleNameResolver(e,t,n,r,i,o,a){const s=getDirectoryPath(t);let c=n.noDtsResolution?3:1|2|4;if(Yn(n)){c|=8}return nodeModuleNameResolverWorker(getNodeResolutionFeatures(n),e,s,n,r,i,c,false,o,a)}function nodeModuleNameResolver(e,t,n,r,i,o,a,s){let c;if(s){c=8}else if(n.noDtsResolution){c=3;if(Yn(n))c|=8}else{c=Yn(n)?1|2|4|8:1|2|4}return nodeModuleNameResolverWorker(a?30:0,e,getDirectoryPath(t),n,r,i,c,!!s,o,a)}function nodeNextJsonConfigResolver(e,t,n){return nodeModuleNameResolverWorker(30,e,getDirectoryPath(t),{moduleResolution:99},n,void 0,8,true,void 0,void 0)}function nodeModuleNameResolverWorker(e,t,n,r,i,o,a,s,c,l){var p,u,f,m,_;const g=isTraceEnabled(r,i);const y=[];const h=[];const T=qn(r);l??(l=getConditions(r,T===100||T===2?void 0:e&32?99:1));const S=[];const v={compilerOptions:r,host:i,traceEnabled:g,failedLookupLocations:y,affectingLocations:h,packageJsonInfoCache:o,features:e,conditions:l??d,requestContainingDirectory:n,reportDiagnostic:e=>void S.push(e),isConfigLookup:s,candidateIsFromPackageJsonField:false,resolvedPackageDirectory:false};if(g&&moduleResolutionSupportsPackageJsonExportsAndImports(T)){trace(i,wt.Resolving_in_0_mode_with_conditions_1,e&32?"ESM":"CJS",v.conditions.map((e=>`'${e}'`)).join(", "))}let x;if(T===2){const e=a&(1|4);const t=a&~(1|4);x=e&&tryResolve(e,v)||t&&tryResolve(t,v)||void 0}else{x=tryResolve(a,v)}let b;if(v.resolvedPackageDirectory&&!s&&!isExternalModuleNameRelative(t)){const t=(x==null?void 0:x.value)&&a&(1|4)&&!extensionIsOk(1|4,x.value.resolved.extension);if(((p=x==null?void 0:x.value)==null?void 0:p.isExternalLibraryImport)&&t&&e&8&&(l==null?void 0:l.includes("import"))){traceIfEnabled(v,wt.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);const e={...v,features:v.features&~8,reportDiagnostic:noop};const t=tryResolve(a&(1|4),e);if((u=t==null?void 0:t.value)==null?void 0:u.isExternalLibraryImport){b=t.value.resolved.path}}else if((!(x==null?void 0:x.value)||t)&&T===2){traceIfEnabled(v,wt.Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update);const e={...v.compilerOptions,moduleResolution:100};const t={...v,compilerOptions:e,features:30,conditions:getConditions(e),reportDiagnostic:noop};const n=tryResolve(a&(1|4),t);if((f=n==null?void 0:n.value)==null?void 0:f.isExternalLibraryImport){b=n.value.resolved.path}}}return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(t,(m=x==null?void 0:x.value)==null?void 0:m.resolved,(_=x==null?void 0:x.value)==null?void 0:_.isExternalLibraryImport,y,h,S,v,o,b);function tryResolve(r,a){const loader=(e,t,n,r)=>nodeLoadModuleByRelativeName(e,t,n,r,true);const s=tryLoadModuleUsingOptionalResolutionSettings(r,t,n,loader,a);if(s){return toSearchResult({resolved:s,isExternalLibraryImport:pathContainsNodeModules(s.path)})}if(!isExternalModuleNameRelative(t)){if(e&2&&startsWith(t,"#")){const e=loadModuleFromImports(r,t,n,a,o,c);if(e){return e.value&&{value:{resolved:e.value,isExternalLibraryImport:false}}}}if(e&4){const e=loadModuleFromSelfNameReference(r,t,n,a,o,c);if(e){return e.value&&{value:{resolved:e.value,isExternalLibraryImport:false}}}}if(t.includes(":")){if(g){trace(i,wt.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1,t,formatExtensions(r))}return void 0}if(g){trace(i,wt.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1,t,formatExtensions(r))}let s=loadModuleFromNearestNodeModulesDirectory(r,t,n,a,o,c);if(r&4){s??(s=resolveFromTypeRoot(t,a))}return s&&{value:s.value&&{resolved:s.value,isExternalLibraryImport:true}}}else{const{path:e,parts:i}=normalizePathForCJSResolution(n,t);const o=nodeLoadModuleByRelativeName(r,e,false,a,true);return o&&toSearchResult({resolved:o,isExternalLibraryImport:contains(i,"node_modules")})}}}function normalizePathForCJSResolution(e,t){const n=combinePaths(e,t);const r=getPathComponents(n);const i=lastOrUndefined(r);const o=i==="."||i===".."?ensureTrailingDirectorySeparator(normalizePath(n)):normalizePath(n);return{path:o,parts:r}}function realPath(e,t,n){if(!t.realpath){return e}const r=normalizePath(t.realpath(e));if(n){trace(t,wt.Resolving_real_path_for_0_result_1,e,r)}return r}function nodeLoadModuleByRelativeName(e,t,n,r,i){if(r.traceEnabled){trace(r.host,wt.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1,t,formatExtensions(e))}if(!hasTrailingDirectorySeparator(t)){if(!n){const e=getDirectoryPath(t);if(!directoryProbablyExists(e,r.host)){if(r.traceEnabled){trace(r.host,wt.Directory_0_does_not_exist_skipping_all_lookups_in_it,e)}n=true}}const o=loadModuleFromFile(e,t,n,r);if(o){const e=i?parseNodeModuleFromPath(o.path):void 0;const t=e?getPackageJsonInfo(e,false,r):void 0;return withPackageId(t,o,r)}}if(!n){const e=directoryProbablyExists(t,r.host);if(!e){if(r.traceEnabled){trace(r.host,wt.Directory_0_does_not_exist_skipping_all_lookups_in_it,t)}n=true}}if(!(r.features&32)){return loadNodeModuleFromDirectory(e,t,n,r,i)}return void 0}var Wo="/node_modules/";function pathContainsNodeModules(e){return e.includes(Wo)}function parseNodeModuleFromPath(e,t){const n=normalizePath(e);const r=n.lastIndexOf(Wo);if(r===-1){return void 0}const i=r+Wo.length;let o=moveToNextDirectorySeparatorIfAvailable(n,i,t);if(n.charCodeAt(i)===64){o=moveToNextDirectorySeparatorIfAvailable(n,o,t)}return n.slice(0,o)}function moveToNextDirectorySeparatorIfAvailable(e,t,n){const r=e.indexOf(Pt,t+1);return r===-1?n?e.length:t:r}function loadModuleFromFileNoPackageId(e,t,n,r){return noPackageId(loadModuleFromFile(e,t,n,r))}function loadModuleFromFile(e,t,n,r){const i=loadModuleFromFileNoImplicitExtensions(e,t,n,r);if(i){return i}if(!(r.features&32)){const i=tryAddingExtensions(t,e,"",n,r);if(i){return i}}}function loadModuleFromFileNoImplicitExtensions(e,t,n,r){const i=getBaseFileName(t);if(!i.includes(".")){return void 0}let o=removeFileExtension(t);if(o===t){o=t.substring(0,t.lastIndexOf("."))}const a=t.substring(o.length);if(r.traceEnabled){trace(r.host,wt.File_name_0_has_a_1_extension_stripping_it,t,a)}return tryAddingExtensions(o,e,a,n,r)}function loadFileNameFromPackageJsonField(e,t,n,r,i){if(e&1&&fileExtensionIsOneOf(t,br)||e&4&&fileExtensionIsOneOf(t,xr)){const e=tryFile(t,r,i);const o=tryExtractTSExtension(t);return e!==void 0?{path:t,ext:o,resolvedUsingTsExtension:n?!endsWith(n,o):void 0}:void 0}if(i.isConfigLookup&&e===8&&fileExtensionIs(t,".json")){const e=tryFile(t,r,i);return e!==void 0?{path:t,ext:".json",resolvedUsingTsExtension:void 0}:void 0}return loadModuleFromFileNoImplicitExtensions(e,t,r,i)}function tryAddingExtensions(e,t,n,r,i){if(!r){const t=getDirectoryPath(e);if(t){r=!directoryProbablyExists(t,i.host)}}switch(n){case".mjs":case".mts":case".d.mts":return t&1&&tryExtension(".mts",n===".mts"||n===".d.mts")||t&4&&tryExtension(".d.mts",n===".mts"||n===".d.mts")||t&2&&tryExtension(".mjs")||void 0;case".cjs":case".cts":case".d.cts":return t&1&&tryExtension(".cts",n===".cts"||n===".d.cts")||t&4&&tryExtension(".d.cts",n===".cts"||n===".d.cts")||t&2&&tryExtension(".cjs")||void 0;case".json":return t&4&&tryExtension(".d.json.ts")||t&8&&tryExtension(".json")||void 0;case".tsx":case".jsx":return t&1&&(tryExtension(".tsx",n===".tsx")||tryExtension(".ts",n===".tsx"))||t&4&&tryExtension(".d.ts",n===".tsx")||t&2&&(tryExtension(".jsx")||tryExtension(".js"))||void 0;case".ts":case".d.ts":case".js":case"":return t&1&&(tryExtension(".ts",n===".ts"||n===".d.ts")||tryExtension(".tsx",n===".ts"||n===".d.ts"))||t&4&&tryExtension(".d.ts",n===".ts"||n===".d.ts")||t&2&&(tryExtension(".js")||tryExtension(".jsx"))||i.isConfigLookup&&tryExtension(".json")||void 0;default:return t&4&&!isDeclarationFileName(e+n)&&tryExtension(`.d${n}.ts`)||void 0}function tryExtension(t,n){const o=tryFile(e+t,r,i);return o===void 0?void 0:{path:o,ext:t,resolvedUsingTsExtension:!i.candidateIsFromPackageJsonField&&n}}}function tryFile(e,t,n){var r;if(!((r=n.compilerOptions.moduleSuffixes)==null?void 0:r.length)){return tryFileLookup(e,t,n)}const i=tryGetExtensionFromPath2(e)??"";const o=i?removeExtension(e,i):e;return forEach(n.compilerOptions.moduleSuffixes,(e=>tryFileLookup(o+e+i,t,n)))}function tryFileLookup(e,t,n){var r;if(!t){if(n.host.fileExists(e)){if(n.traceEnabled){trace(n.host,wt.File_0_exists_use_it_as_a_name_resolution_result,e)}return e}else{if(n.traceEnabled){trace(n.host,wt.File_0_does_not_exist,e)}}}(r=n.failedLookupLocations)==null?void 0:r.push(e);return void 0}function loadNodeModuleFromDirectory(e,t,n,r,i=true){const o=i?getPackageJsonInfo(t,n,r):void 0;return withPackageId(o,loadNodeModuleFromDirectoryWorker(e,t,n,r,o),r)}function getEntrypointsFromPackageJsonInfo(e,t,n,r,i){if(!i&&e.contents.resolvedEntrypoints!==void 0){return e.contents.resolvedEntrypoints}let o;const a=1|4|(i?2:0);const s=getNodeResolutionFeatures(t);const c=getTemporaryModuleResolutionState(r==null?void 0:r.getPackageJsonInfoCache(),n,t);c.conditions=getConditions(t);c.requestContainingDirectory=e.packageDirectory;const l=loadNodeModuleFromDirectoryWorker(a,e.packageDirectory,false,c,e);o=append(o,l==null?void 0:l.path);if(s&8&&e.contents.packageJsonContent.exports){const r=deduplicate([getConditions(t,99),getConditions(t,1)],arrayIsEqualTo);for(const t of r){const r={...c,failedLookupLocations:[],conditions:t,host:n};const i=loadEntrypointsFromExportMap(e,e.contents.packageJsonContent.exports,r,a);if(i){for(const e of i){o=appendIfUnique(o,e.path)}}}}return e.contents.resolvedEntrypoints=o||false}function loadEntrypointsFromExportMap(e,t,n,r){let i;if(isArray(t)){for(const e of t){loadEntrypointsFromTargetExports(e)}}else if(typeof t==="object"&&t!==null&&allKeysStartWithDot(t)){for(const e in t){loadEntrypointsFromTargetExports(t[e])}}else{loadEntrypointsFromTargetExports(t)}return i;function loadEntrypointsFromTargetExports(t){var o,a;if(typeof t==="string"&&startsWith(t,"./")){if(t.includes("*")&&n.host.readDirectory){if(t.indexOf("*")!==t.lastIndexOf("*")){return false}n.host.readDirectory(e.packageDirectory,extensionsToExtensionsArray(r),void 0,[changeFullExtension(replaceFirstStar(t,"**/*"),".*")]).forEach((e=>{i=appendIfUnique(i,{path:e,ext:getAnyExtensionFromPath(e),resolvedUsingTsExtension:void 0})}))}else{const s=getPathComponents(t).slice(2);if(s.includes("..")||s.includes(".")||s.includes("node_modules")){return false}const c=combinePaths(e.packageDirectory,t);const l=getNormalizedAbsolutePath(c,(a=(o=n.host).getCurrentDirectory)==null?void 0:a.call(o));const d=loadFileNameFromPackageJsonField(r,l,t,false,n);if(d){i=appendIfUnique(i,d,((e,t)=>e.path===t.path));return true}}}else if(Array.isArray(t)){for(const e of t){const t=loadEntrypointsFromTargetExports(e);if(t){return true}}}else if(typeof t==="object"&&t!==null){return forEach(getOwnKeys(t),(e=>{if(e==="default"||contains(n.conditions,e)||isApplicableVersionedTypesKey(n.conditions,e)){loadEntrypointsFromTargetExports(t[e]);return true}}))}}}function getTemporaryModuleResolutionState(e,t,n){return{host:t,compilerOptions:n,traceEnabled:isTraceEnabled(n,t),failedLookupLocations:void 0,affectingLocations:void 0,packageJsonInfoCache:e,features:0,conditions:d,requestContainingDirectory:void 0,reportDiagnostic:noop,isConfigLookup:false,candidateIsFromPackageJsonField:false,resolvedPackageDirectory:false}}function getPackageScopeForPath(e,t){return forEachAncestorDirectoryStoppingAtGlobalCache(t.host,e,(e=>getPackageJsonInfo(e,false,t)))}function getVersionPathsOfPackageJsonInfo(e,t){if(e.contents.versionPaths===void 0){e.contents.versionPaths=readPackageJsonTypesVersionPaths(e.contents.packageJsonContent,t)||false}return e.contents.versionPaths||void 0}function getPeerDependenciesOfPackageJsonInfo(e,t){if(e.contents.peerDependencies===void 0){e.contents.peerDependencies=readPackageJsonPeerDependencies(e,t)||false}return e.contents.peerDependencies||void 0}function readPackageJsonPeerDependencies(e,t){const n=readPackageJsonField(e.contents.packageJsonContent,"peerDependencies","object",t);if(n===void 0)return void 0;if(t.traceEnabled)trace(t.host,wt.package_json_has_a_peerDependencies_field);const r=realPath(e.packageDirectory,t.host,t.traceEnabled);const i=r.substring(0,r.lastIndexOf("node_modules")+"node_modules".length)+Pt;let o="";for(const e in n){if(hasProperty(n,e)){const n=getPackageJsonInfo(i+e,false,t);if(n){const r=n.contents.packageJsonContent.version;o+=`+${e}@${r}`;if(t.traceEnabled)trace(t.host,wt.Found_peerDependency_0_with_1_version,e,r)}else{if(t.traceEnabled)trace(t.host,wt.Failed_to_find_peerDependency_0,e)}}}return o}function getPackageJsonInfo(e,t,n){var r,i,o,a,s,c;const{host:l,traceEnabled:d}=n;const p=combinePaths(e,"package.json");if(t){(r=n.failedLookupLocations)==null?void 0:r.push(p);return void 0}const u=(i=n.packageJsonInfoCache)==null?void 0:i.getPackageJsonInfo(p);if(u!==void 0){if(isPackageJsonInfo(u)){if(d)trace(l,wt.File_0_exists_according_to_earlier_cached_lookups,p);(o=n.affectingLocations)==null?void 0:o.push(p);return u.packageDirectory===e?u:{packageDirectory:e,contents:u.contents}}else{if(u.directoryExists&&d)trace(l,wt.File_0_does_not_exist_according_to_earlier_cached_lookups,p);(a=n.failedLookupLocations)==null?void 0:a.push(p);return void 0}}const f=directoryProbablyExists(e,l);if(f&&l.fileExists(p)){const t=readJson(p,l);if(d){trace(l,wt.Found_package_json_at_0,p)}const r={packageDirectory:e,contents:{packageJsonContent:t,versionPaths:void 0,resolvedEntrypoints:void 0,peerDependencies:void 0}};if(n.packageJsonInfoCache&&!n.packageJsonInfoCache.isReadonly)n.packageJsonInfoCache.setPackageJsonInfo(p,r);(s=n.affectingLocations)==null?void 0:s.push(p);return r}else{if(f&&d){trace(l,wt.File_0_does_not_exist,p)}if(n.packageJsonInfoCache&&!n.packageJsonInfoCache.isReadonly)n.packageJsonInfoCache.setPackageJsonInfo(p,{packageDirectory:e,directoryExists:f});(c=n.failedLookupLocations)==null?void 0:c.push(p)}}function loadNodeModuleFromDirectoryWorker(e,t,n,r,i){const o=i&&getVersionPathsOfPackageJsonInfo(i,r);let a;if(i&&arePathsEqual(i==null?void 0:i.packageDirectory,t,r.host)){if(r.isConfigLookup){a=readPackageJsonTSConfigField(i.contents.packageJsonContent,i.packageDirectory,r)}else{a=e&4&&readPackageJsonTypesFields(i.contents.packageJsonContent,i.packageDirectory,r)||e&(3|4)&&readPackageJsonMainField(i.contents.packageJsonContent,i.packageDirectory,r)||void 0}}const loader=(e,t,n,r)=>{const o=loadFileNameFromPackageJsonField(e,t,void 0,n,r);if(o){return noPackageId(o)}const a=e===4?1|4:e;const s=r.features;const c=r.candidateIsFromPackageJsonField;r.candidateIsFromPackageJsonField=true;if((i==null?void 0:i.contents.packageJsonContent.type)!=="module"){r.features&=~32}const l=nodeLoadModuleByRelativeName(a,t,n,r,false);r.features=s;r.candidateIsFromPackageJsonField=c;return l};const s=a?!directoryProbablyExists(getDirectoryPath(a),r.host):void 0;const l=n||!directoryProbablyExists(t,r.host);const d=combinePaths(t,r.isConfigLookup?"tsconfig":"index");if(o&&(!a||containsPath(t,a))){const n=getRelativePathFromDirectory(t,a||d,false);if(r.traceEnabled){trace(r.host,wt.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,o.version,c,n)}const i=tryParsePatterns(o.paths);const p=tryLoadModuleUsingPaths(e,n,t,o.paths,i,loader,s||l,r);if(p){return removeIgnoredPackageId(p.value)}}const p=a&&removeIgnoredPackageId(loader(e,a,s,r));if(p)return p;if(!(r.features&32)){return loadModuleFromFile(e,d,l,r)}}function extensionIsOk(e,t){return e&2&&(t===".js"||t===".jsx"||t===".mjs"||t===".cjs")||e&1&&(t===".ts"||t===".tsx"||t===".mts"||t===".cts")||e&4&&(t===".d.ts"||t===".d.mts"||t===".d.cts")||e&8&&t===".json"||false}function parsePackageName(e){let t=e.indexOf(Pt);if(e[0]==="@"){t=e.indexOf(Pt,t+1)}return t===-1?{packageName:e,rest:""}:{packageName:e.slice(0,t),rest:e.slice(t+1)}}function allKeysStartWithDot(e){return every(getOwnKeys(e),(e=>startsWith(e,".")))}function noKeyStartsWithDot(e){return!some(getOwnKeys(e),(e=>startsWith(e,".")))}function loadModuleFromSelfNameReference(e,t,n,r,i,o){var a,s;const c=getNormalizedAbsolutePath(n,(s=(a=r.host).getCurrentDirectory)==null?void 0:s.call(a));const l=getPackageScopeForPath(c,r);if(!l||!l.contents.packageJsonContent.exports){return void 0}if(typeof l.contents.packageJsonContent.name!=="string"){return void 0}const d=getPathComponents(t);const p=getPathComponents(l.contents.packageJsonContent.name);if(!every(p,((e,t)=>d[t]===e))){return void 0}const u=d.slice(p.length);const f=!length(u)?".":`.${Pt}${u.join(Pt)}`;if(rr(r.compilerOptions)&&!pathContainsNodeModules(n)){return loadModuleFromExports(l,e,f,r,i,o)}const m=e&(1|4);const _=e&~(1|4);return loadModuleFromExports(l,m,f,r,i,o)||loadModuleFromExports(l,_,f,r,i,o)}function loadModuleFromExports(e,t,n,r,i,o){if(!e.contents.packageJsonContent.exports){return void 0}if(n==="."){let a;if(typeof e.contents.packageJsonContent.exports==="string"||Array.isArray(e.contents.packageJsonContent.exports)||typeof e.contents.packageJsonContent.exports==="object"&&noKeyStartsWithDot(e.contents.packageJsonContent.exports)){a=e.contents.packageJsonContent.exports}else if(hasProperty(e.contents.packageJsonContent.exports,".")){a=e.contents.packageJsonContent.exports["."]}if(a){const s=getLoadModuleFromTargetExportOrImport(t,r,i,o,n,e,false);return s(a,"",false,".")}}else if(allKeysStartWithDot(e.contents.packageJsonContent.exports)){if(typeof e.contents.packageJsonContent.exports!=="object"){if(r.traceEnabled){trace(r.host,wt.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,n,e.packageDirectory)}return toSearchResult(void 0)}const a=loadModuleFromExportsOrImports(t,r,i,o,n,e.contents.packageJsonContent.exports,e,false);if(a){return a}}if(r.traceEnabled){trace(r.host,wt.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,n,e.packageDirectory)}return toSearchResult(void 0)}function loadModuleFromImports(e,t,n,r,i,o){var a,s;if(t==="#"||startsWith(t,"#/")){if(r.traceEnabled){trace(r.host,wt.Invalid_import_specifier_0_has_no_possible_resolutions,t)}return toSearchResult(void 0)}const c=getNormalizedAbsolutePath(n,(s=(a=r.host).getCurrentDirectory)==null?void 0:s.call(a));const l=getPackageScopeForPath(c,r);if(!l){if(r.traceEnabled){trace(r.host,wt.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve,c)}return toSearchResult(void 0)}if(!l.contents.packageJsonContent.imports){if(r.traceEnabled){trace(r.host,wt.package_json_scope_0_has_no_imports_defined,l.packageDirectory)}return toSearchResult(void 0)}const d=loadModuleFromExportsOrImports(e,r,i,o,t,l.contents.packageJsonContent.imports,l,true);if(d){return d}if(r.traceEnabled){trace(r.host,wt.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1,t,l.packageDirectory)}return toSearchResult(void 0)}function comparePatternKeys(e,t){const n=e.indexOf("*");const r=t.indexOf("*");const i=n===-1?e.length:n+1;const o=r===-1?t.length:r+1;if(i>o)return-1;if(o>i)return 1;if(n===-1)return 1;if(r===-1)return-1;if(e.length>t.length)return-1;if(t.length>e.length)return 1;return 0}function loadModuleFromExportsOrImports(e,t,n,r,i,o,a,s){const c=getLoadModuleFromTargetExportOrImport(e,t,n,r,i,a,s);if(!endsWith(i,Pt)&&!i.includes("*")&&hasProperty(o,i)){const e=o[i];return c(e,"",false,i)}const l=toSorted(filter(getOwnKeys(o),(e=>hasOneAsterisk(e)||endsWith(e,"/"))),comparePatternKeys);for(const e of l){if(t.features&16&&matchesPatternWithTrailer(e,i)){const t=o[e];const n=e.indexOf("*");const r=i.substring(e.substring(0,n).length,i.length-(e.length-1-n));return c(t,r,true,e)}else if(endsWith(e,"*")&&startsWith(i,e.substring(0,e.length-1))){const t=o[e];const n=i.substring(e.length-1);return c(t,n,true,e)}else if(startsWith(i,e)){const t=o[e];const n=i.substring(e.length);return c(t,n,false,e)}}function matchesPatternWithTrailer(e,t){if(endsWith(e,"*"))return false;const n=e.indexOf("*");if(n===-1)return false;return startsWith(t,e.substring(0,n))&&endsWith(t,e.substring(n+1))}}function hasOneAsterisk(e){const t=e.indexOf("*");return t!==-1&&t===e.lastIndexOf("*")}function getLoadModuleFromTargetExportOrImport(e,t,n,r,i,o,a){return loadModuleFromTargetExportOrImport;function loadModuleFromTargetExportOrImport(s,c,l,p){var u,f;if(typeof s==="string"){if(!l&&c.length>0&&!endsWith(s,"/")){if(t.traceEnabled){trace(t.host,wt.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i)}return toSearchResult(void 0)}if(!startsWith(s,"./")){if(a&&!startsWith(s,"../")&&!startsWith(s,"/")&&!isRootedDiskPath(s)){const i=l?s.replace(/\*/g,c):s+c;traceIfEnabled(t,wt.Using_0_subpath_1_with_target_2,"imports",p,i);traceIfEnabled(t,wt.Resolving_module_0_from_1,i,o.packageDirectory+"/");const a=nodeModuleNameResolverWorker(t.features,i,o.packageDirectory+"/",t.compilerOptions,t.host,n,e,false,r,t.conditions);(u=t.failedLookupLocations)==null?void 0:u.push(...a.failedLookupLocations??d);(f=t.affectingLocations)==null?void 0:f.push(...a.affectingLocations??d);return toSearchResult(a.resolvedModule?{path:a.resolvedModule.resolvedFileName,extension:a.resolvedModule.extension,packageId:a.resolvedModule.packageId,originalPath:a.resolvedModule.originalPath,resolvedUsingTsExtension:a.resolvedModule.resolvedUsingTsExtension}:void 0)}if(t.traceEnabled){trace(t.host,wt.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i)}return toSearchResult(void 0)}const m=pathIsRelative(s)?getPathComponents(s).slice(1):getPathComponents(s);const _=m.slice(1);if(_.includes("..")||_.includes(".")||_.includes("node_modules")){if(t.traceEnabled){trace(t.host,wt.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i)}return toSearchResult(void 0)}const g=combinePaths(o.packageDirectory,s);const y=getPathComponents(c);if(y.includes("..")||y.includes(".")||y.includes("node_modules")){if(t.traceEnabled){trace(t.host,wt.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i)}return toSearchResult(void 0)}if(t.traceEnabled){trace(t.host,wt.Using_0_subpath_1_with_target_2,a?"imports":"exports",p,l?s.replace(/\*/g,c):s+c)}const h=toAbsolutePath(l?g.replace(/\*/g,c):g+c);const T=tryLoadInputFileForPath(h,c,combinePaths(o.packageDirectory,"package.json"),a);if(T)return T;return toSearchResult(withPackageId(o,loadFileNameFromPackageJsonField(e,h,s,false,t),t))}else if(typeof s==="object"&&s!==null){if(!Array.isArray(s)){traceIfEnabled(t,wt.Entering_conditional_exports);for(const e of getOwnKeys(s)){if(e==="default"||t.conditions.includes(e)||isApplicableVersionedTypesKey(t.conditions,e)){traceIfEnabled(t,wt.Matched_0_condition_1,a?"imports":"exports",e);const n=s[e];const r=loadModuleFromTargetExportOrImport(n,c,l,p);if(r){traceIfEnabled(t,wt.Resolved_under_condition_0,e);traceIfEnabled(t,wt.Exiting_conditional_exports);return r}else{traceIfEnabled(t,wt.Failed_to_resolve_under_condition_0,e)}}else{traceIfEnabled(t,wt.Saw_non_matching_condition_0,e)}}traceIfEnabled(t,wt.Exiting_conditional_exports);return void 0}else{if(!length(s)){if(t.traceEnabled){trace(t.host,wt.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i)}return toSearchResult(void 0)}for(const e of s){const t=loadModuleFromTargetExportOrImport(e,c,l,p);if(t){return t}}}}else if(s===null){if(t.traceEnabled){trace(t.host,wt.package_json_scope_0_explicitly_maps_specifier_1_to_null,o.packageDirectory,i)}return toSearchResult(void 0)}if(t.traceEnabled){trace(t.host,wt.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,o.packageDirectory,i)}return toSearchResult(void 0);function toAbsolutePath(e){var n,r;if(e===void 0)return e;return getNormalizedAbsolutePath(e,(r=(n=t.host).getCurrentDirectory)==null?void 0:r.call(n))}function combineDirectoryPath(e,t){return ensureTrailingDirectorySeparator(combinePaths(e,t))}function tryLoadInputFileForPath(n,r,i,a){var s,c,l,d;if(!t.isConfigLookup&&(t.compilerOptions.declarationDir||t.compilerOptions.outDir)&&!n.includes("/node_modules/")&&(t.compilerOptions.configFile?containsPath(o.packageDirectory,toAbsolutePath(t.compilerOptions.configFile.fileName),!useCaseSensitiveFileNames(t)):true)){const p=hostGetCanonicalFileName({useCaseSensitiveFileNames:()=>useCaseSensitiveFileNames(t)});const u=[];if(t.compilerOptions.rootDir||t.compilerOptions.composite&&t.compilerOptions.configFilePath){const e=toAbsolutePath(getCommonSourceDirectory(t.compilerOptions,(()=>[]),((c=(s=t.host).getCurrentDirectory)==null?void 0:c.call(s))||"",p));u.push(e)}else if(t.requestContainingDirectory){const e=toAbsolutePath(combinePaths(t.requestContainingDirectory,"index.ts"));const n=toAbsolutePath(getCommonSourceDirectory(t.compilerOptions,(()=>[e,toAbsolutePath(i)]),((d=(l=t.host).getCurrentDirectory)==null?void 0:d.call(l))||"",p));u.push(n);let r=ensureTrailingDirectorySeparator(n);while(r&&r.length>1){const e=getPathComponents(r);e.pop();const t=getPathFromPathComponents(e);u.unshift(t);r=ensureTrailingDirectorySeparator(t)}}if(u.length>1){t.reportDiagnostic(createCompilerDiagnostic(a?wt.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:wt.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate,r===""?".":r,i))}for(const r of u){const i=getOutputDirectoriesForBaseDirectory(r);for(const a of i){if(containsPath(a,n,!useCaseSensitiveFileNames(t))){const i=n.slice(a.length+1);const s=combinePaths(r,i);const c=[".mjs",".cjs",".js",".json",".d.mts",".d.cts",".d.ts"];for(const n of c){if(fileExtensionIs(s,n)){const r=getPossibleOriginalInputExtensionForExtension(s);for(const i of r){if(!extensionIsOk(e,i))continue;const r=changeAnyExtension(s,i,n,!useCaseSensitiveFileNames(t));if(t.host.fileExists(r)){return toSearchResult(withPackageId(o,loadFileNameFromPackageJsonField(e,r,void 0,false,t),t))}}}}}}}}return void 0;function getOutputDirectoriesForBaseDirectory(e){var n,r;const i=t.compilerOptions.configFile?((r=(n=t.host).getCurrentDirectory)==null?void 0:r.call(n))||"":e;const o=[];if(t.compilerOptions.declarationDir){o.push(toAbsolutePath(combineDirectoryPath(i,t.compilerOptions.declarationDir)))}if(t.compilerOptions.outDir&&t.compilerOptions.outDir!==t.compilerOptions.declarationDir){o.push(toAbsolutePath(combineDirectoryPath(i,t.compilerOptions.outDir)))}return o}}}}function isApplicableVersionedTypesKey(e,t){if(!e.includes("types"))return false;if(!startsWith(t,"types@"))return false;const n=P.tryParse(t.substring("types@".length));if(!n)return false;return n.test(c)}function loadModuleFromNearestNodeModulesDirectory(e,t,n,r,i,o){return loadModuleFromNearestNodeModulesDirectoryWorker(e,t,n,r,false,i,o)}function loadModuleFromNearestNodeModulesDirectoryTypesScope(e,t,n){return loadModuleFromNearestNodeModulesDirectoryWorker(4,e,t,n,true,void 0,void 0)}function loadModuleFromNearestNodeModulesDirectoryWorker(e,t,n,r,i,o,a){const s=r.features===0?void 0:r.features&32||r.conditions.includes("import")?99:1;const c=e&(1|4);const l=e&~(1|4);if(c){traceIfEnabled(r,wt.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0,formatExtensions(c));const e=lookup(c);if(e)return e}if(l&&!i){traceIfEnabled(r,wt.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0,formatExtensions(l));return lookup(l)}function lookup(e){return forEachAncestorDirectoryStoppingAtGlobalCache(r.host,normalizeSlashes(n),(n=>{if(getBaseFileName(n)!=="node_modules"){const c=tryFindNonRelativeModuleNameInCache(o,t,s,n,a,r);if(c){return c}return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(e,t,n,r,i,o,a))}}))}}function forEachAncestorDirectoryStoppingAtGlobalCache(e,t,n){var r;const i=(r=e==null?void 0:e.getGlobalTypingsCacheLocation)==null?void 0:r.call(e);return forEachAncestorDirectory(t,(e=>{const t=n(e);if(t!==void 0)return t;if(e===i)return false}))||void 0}function loadModuleFromImmediateNodeModulesDirectory(e,t,n,r,i,o,a){const s=combinePaths(n,"node_modules");const c=directoryProbablyExists(s,r.host);if(!c&&r.traceEnabled){trace(r.host,wt.Directory_0_does_not_exist_skipping_all_lookups_in_it,s)}if(!i){const n=loadModuleFromSpecificNodeModulesDirectory(e,t,s,c,r,o,a);if(n){return n}}if(e&4){const e=combinePaths(s,"@types");let n=c;if(c&&!directoryProbablyExists(e,r.host)){if(r.traceEnabled){trace(r.host,wt.Directory_0_does_not_exist_skipping_all_lookups_in_it,e)}n=false}return loadModuleFromSpecificNodeModulesDirectory(4,mangleScopedPackageNameWithTrace(t,r),e,n,r,o,a)}}function loadModuleFromSpecificNodeModulesDirectory(e,t,n,r,i,o,a){var s,l;const p=normalizePath(combinePaths(n,t));const{packageName:u,rest:f}=parsePackageName(t);const m=combinePaths(n,u);let _;let g=getPackageJsonInfo(p,!r,i);if(f!==""&&g&&(!(i.features&8)||!hasProperty(((s=_=getPackageJsonInfo(m,!r,i))==null?void 0:s.contents.packageJsonContent)??d,"exports"))){const t=loadModuleFromFile(e,p,!r,i);if(t){return noPackageId(t)}const n=loadNodeModuleFromDirectoryWorker(e,p,!r,i,g);return withPackageId(g,n,i)}const loader=(e,t,n,r)=>{let i=(f||!(r.features&32))&&loadModuleFromFile(e,t,n,r)||loadNodeModuleFromDirectoryWorker(e,t,n,r,g);if(!i&&!f&&g&&(g.contents.packageJsonContent.exports===void 0||g.contents.packageJsonContent.exports===null)&&r.features&32){i=loadModuleFromFile(e,combinePaths(t,"index.js"),n,r)}return withPackageId(g,i,r)};if(f!==""){g=_??getPackageJsonInfo(m,!r,i)}if(g){i.resolvedPackageDirectory=true}if(g&&g.contents.packageJsonContent.exports&&i.features&8){return(l=loadModuleFromExports(g,e,combinePaths(".",f),i,o,a))==null?void 0:l.value}const y=f!==""&&g?getVersionPathsOfPackageJsonInfo(g,i):void 0;if(y){if(i.traceEnabled){trace(i.host,wt.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,y.version,c,f)}const t=r&&directoryProbablyExists(m,i.host);const n=tryParsePatterns(y.paths);const o=tryLoadModuleUsingPaths(e,f,m,y.paths,n,loader,!t,i);if(o){return o.value}}return loader(e,p,!r,i)}function tryLoadModuleUsingPaths(e,t,n,r,i,o,a,s){const c=matchPatternOrExact(i,t);if(c){const i=isString(c)?void 0:matchedText(c,t);const l=isString(c)?c:patternText(c);if(s.traceEnabled){trace(s.host,wt.Module_name_0_matched_pattern_1,t,l)}const d=forEach(r[l],(t=>{const r=i?replaceFirstStar(t,i):t;const c=normalizePath(combinePaths(n,r));if(s.traceEnabled){trace(s.host,wt.Trying_substitution_0_candidate_module_location_Colon_1,t,r)}const l=tryGetExtensionFromPath2(t);if(l!==void 0){const e=tryFile(c,a,s);if(e!==void 0){return noPackageId({path:e,ext:l,resolvedUsingTsExtension:void 0})}}return o(e,c,a||!directoryProbablyExists(getDirectoryPath(c),s.host),s)}));return{value:d}}}var Uo="__";function mangleScopedPackageNameWithTrace(e,t){const n=mangleScopedPackageName(e);if(t.traceEnabled&&n!==e){trace(t.host,wt.Scoped_package_detected_looking_in_0,n)}return n}function getTypesPackageName(e){return`@types/${mangleScopedPackageName(e)}`}function mangleScopedPackageName(e){if(startsWith(e,"@")){const t=e.replace(Pt,Uo);if(t!==e){return t.slice(1)}}return e}function getPackageNameFromTypesPackageName(e){const t=removePrefix(e,"@types/");if(t!==e){return unmangleScopedPackageName(t)}return e}function unmangleScopedPackageName(e){return e.includes(Uo)?"@"+e.replace(Uo,Pt):e}function tryFindNonRelativeModuleNameInCache(e,t,n,r,i,o){const a=e&&e.getFromNonRelativeNameCache(t,n,r,i);if(a){if(o.traceEnabled){trace(o.host,wt.Resolution_for_module_0_was_found_in_cache_from_location_1,t,r)}o.resultFromCache=a;return{value:a.resolvedModule&&{path:a.resolvedModule.resolvedFileName,originalPath:a.resolvedModule.originalPath||true,extension:a.resolvedModule.extension,packageId:a.resolvedModule.packageId,resolvedUsingTsExtension:a.resolvedModule.resolvedUsingTsExtension}}}}function classicNameResolver(e,t,n,r,i,o){const a=isTraceEnabled(n,r);const s=[];const c=[];const l=getDirectoryPath(t);const d=[];const p={compilerOptions:n,host:r,traceEnabled:a,failedLookupLocations:s,affectingLocations:c,packageJsonInfoCache:i,features:0,conditions:[],requestContainingDirectory:l,reportDiagnostic:e=>void d.push(e),isConfigLookup:false,candidateIsFromPackageJsonField:false,resolvedPackageDirectory:false};const u=tryResolve(1|4)||tryResolve(2|(n.resolveJsonModule?8:0));return createResolvedModuleWithFailedLookupLocationsHandlingSymlink(e,u&&u.value,(u==null?void 0:u.value)&&pathContainsNodeModules(u.value.path),s,c,d,p,i);function tryResolve(t){const n=tryLoadModuleUsingOptionalResolutionSettings(t,e,l,loadModuleFromFileNoPackageId,p);if(n){return{value:n}}if(!isExternalModuleNameRelative(e)){const n=forEachAncestorDirectoryStoppingAtGlobalCache(p.host,l,(n=>{const r=tryFindNonRelativeModuleNameInCache(i,e,void 0,n,o,p);if(r){return r}const a=normalizePath(combinePaths(n,e));return toSearchResult(loadModuleFromFileNoPackageId(t,a,false,p))}));if(n)return n;if(t&(1|4)){let n=loadModuleFromNearestNodeModulesDirectoryTypesScope(e,l,p);if(t&4)n??(n=resolveFromTypeRoot(e,p));return n}}else{const n=normalizePath(combinePaths(l,e));return toSearchResult(loadModuleFromFileNoPackageId(t,n,false,p))}}}function resolveFromTypeRoot(e,t){if(!t.compilerOptions.typeRoots)return;for(const n of t.compilerOptions.typeRoots){const r=getCandidateFromTypeRoot(n,e,t);const i=directoryProbablyExists(n,t.host);if(!i&&t.traceEnabled){trace(t.host,wt.Directory_0_does_not_exist_skipping_all_lookups_in_it,n)}const o=loadModuleFromFile(4,r,!i,t);if(o){const e=parseNodeModuleFromPath(o.path);const n=e?getPackageJsonInfo(e,false,t):void 0;return toSearchResult(withPackageId(n,o,t))}const a=loadNodeModuleFromDirectory(4,r,!i,t);if(a)return toSearchResult(a)}}function shouldAllowImportingTsExtension(e,t){return Un(e)||!!t&&isDeclarationFileName(t)}function loadModuleFromGlobalCache(e,t,n,r,i,o){const a=isTraceEnabled(n,r);if(a){trace(r,wt.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2,t,e,i)}const s=[];const c=[];const l=[];const d={compilerOptions:n,host:r,traceEnabled:a,failedLookupLocations:s,affectingLocations:c,packageJsonInfoCache:o,features:0,conditions:[],requestContainingDirectory:void 0,reportDiagnostic:e=>void l.push(e),isConfigLookup:false,candidateIsFromPackageJsonField:false,resolvedPackageDirectory:false};const p=loadModuleFromImmediateNodeModulesDirectory(4,e,i,d,false,void 0,void 0);return createResolvedModuleWithFailedLookupLocations(p,true,s,c,l,d.resultFromCache,void 0)}function toSearchResult(e){return e!==void 0?{value:e}:void 0}function traceIfEnabled(e,t,...n){if(e.traceEnabled){trace(e.host,t,...n)}}function useCaseSensitiveFileNames(e){return!e.host.useCaseSensitiveFileNames?true:typeof e.host.useCaseSensitiveFileNames==="boolean"?e.host.useCaseSensitiveFileNames:e.host.useCaseSensitiveFileNames()}var zo=(e=>{e[e["NonInstantiated"]=0]="NonInstantiated";e[e["Instantiated"]=1]="Instantiated";e[e["ConstEnumOnly"]=2]="ConstEnumOnly";return e})(zo||{});function getModuleInstanceState(e,t){if(e.body&&!e.body.parent){setParent(e.body,e);setParentRecursive(e.body,false)}return e.body?getModuleInstanceStateCached(e.body,t):1}function getModuleInstanceStateCached(e,t=new Map){const n=getNodeId(e);if(t.has(n)){return t.get(n)||0}t.set(n,void 0);const r=getModuleInstanceStateWorker(e,t);t.set(n,r);return r}function getModuleInstanceStateWorker(e,t){switch(e.kind){case 264:case 265:return 0;case 266:if(isEnumConst(e)){return 2}break;case 272:case 271:if(!hasSyntacticModifier(e,32)){return 0}break;case 278:const n=e;if(!n.moduleSpecifier&&n.exportClause&&n.exportClause.kind===279){let e=0;for(const r of n.exportClause.elements){const n=getModuleInstanceStateForAliasTarget(r,t);if(n>e){e=n}if(e===1){return e}}return e}break;case 268:{let n=0;forEachChild(e,(e=>{const r=getModuleInstanceStateCached(e,t);switch(r){case 0:return;case 2:n=2;return;case 1:n=1;return true;default:S.assertNever(r)}}));return n}case 267:return getModuleInstanceState(e,t);case 80:if(e.flags&4096){return 0}}return 1}function getModuleInstanceStateForAliasTarget(e,t){const n=e.propertyName||e.name;if(n.kind!==80){return 1}let r=e.parent;while(r){if(isBlock(r)||isModuleBlock(r)||isSourceFile(r)){const e=r.statements;let i;for(const o of e){if(nodeHasName(o,n)){if(!o.parent){setParent(o,r);setParentRecursive(o,false)}const e=getModuleInstanceStateCached(o,t);if(i===void 0||e>i){i=e}if(i===1){return i}if(o.kind===271){i=1}}}if(i!==void 0){return i}}r=r.parent}return 1}var Vo=(e=>{e[e["None"]=0]="None";e[e["IsContainer"]=1]="IsContainer";e[e["IsBlockScopedContainer"]=2]="IsBlockScopedContainer";e[e["IsControlFlowContainer"]=4]="IsControlFlowContainer";e[e["IsFunctionLike"]=8]="IsFunctionLike";e[e["IsFunctionExpression"]=16]="IsFunctionExpression";e[e["HasLocals"]=32]="HasLocals";e[e["IsInterface"]=64]="IsInterface";e[e["IsObjectLiteralOrClassExpressionMethodOrAccessor"]=128]="IsObjectLiteralOrClassExpressionMethodOrAccessor";return e})(Vo||{});function createFlowNode(e,t,n){return S.attachFlowNodeDebugInfo({flags:e,id:0,node:t,antecedent:n})}var qo=createBinder();function bindSourceFile(e,t){mark("beforeBind");qo(e,t);mark("afterBind");measure("Bind","beforeBind","afterBind")}function createBinder(){var e;var t;var n;var r;var i;var o;var a;var s;var c;var l;var d;var p;var u;var f;var m;var _;var g;var y;var h;var T;var v;var x;var b;var C;var E;var N=false;var k=0;var F;var P;var D=createFlowNode(1,void 0,void 0);var I=createFlowNode(1,void 0,void 0);var A=createBindBinaryExpressionFlow();return bindSourceFile2;function createDiagnosticForNode2(t,n,...r){return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(t)||e,t,n,...r)}function bindSourceFile2(h,A){var O,w;e=h;t=A;n=zn(t);E=bindInStrictMode(e,A);P=new Set;k=0;F=Rn.getSymbolConstructor();S.attachFlowNodeDebugInfo(D);S.attachFlowNodeDebugInfo(I);if(!e.locals){(O=G)==null?void 0:O.push(G.Phase.Bind,"bindSourceFile",{path:e.path},true);bind(e);(w=G)==null?void 0:w.pop();e.symbolCount=k;e.classifiableNames=P;delayedBindJSDocTypedefTag();bindJSDocImports()}e=void 0;t=void 0;n=void 0;r=void 0;i=void 0;o=void 0;a=void 0;s=void 0;c=void 0;d=void 0;l=false;p=void 0;u=void 0;f=void 0;m=void 0;_=void 0;g=void 0;y=void 0;T=void 0;v=false;x=false;b=false;N=false;C=0}function bindInStrictMode(e,t){if(getStrictOptionValue(t,"alwaysStrict")&&!e.isDeclarationFile){return true}else{return!!e.externalModuleIndicator}}function createSymbol(e,t){k++;return new F(e,t)}function addDeclarationToSymbol(e,t,n){e.flags|=n;t.symbol=e;e.declarations=appendIfUnique(e.declarations,t);if(n&(32|384|1536|3)&&!e.exports){e.exports=createSymbolTable()}if(n&(32|64|2048|4096)&&!e.members){e.members=createSymbolTable()}if(e.constEnumOnlyModule&&e.flags&(16|32|256)){e.constEnumOnlyModule=false}if(n&111551){setValueDeclaration(e,t)}}function getDeclarationName(e){if(e.kind===277){return e.isExportEquals?"export=":"default"}const t=getNameOfDeclaration(e);if(t){if(isAmbientModule(e)){const n=getTextOfIdentifierOrLiteral(t);return isGlobalScopeAugmentation(e)?"__global":`"${n}"`}if(t.kind===167){const e=t.expression;if(isStringOrNumericLiteralLike(e)){return escapeLeadingUnderscores(e.text)}if(isSignedNumericLiteral(e)){return tokenToString(e.operator)+e.operand.text}else{S.fail("Only computed properties with literal names have declaration names")}}if(isPrivateIdentifier(t)){const n=getContainingClass(e);if(!n){return void 0}const r=n.symbol;return getSymbolNameForPrivateIdentifier(r,t.escapedText)}if(isJsxNamespacedName(t)){return getEscapedTextOfJsxNamespacedName(t)}return isPropertyNameLiteral(t)?getEscapedTextOfIdentifierOrLiteral(t):void 0}switch(e.kind){case 176:return"__constructor";case 184:case 179:case 323:return"__call";case 185:case 180:return"__new";case 181:return"__index";case 278:return"__export";case 307:return"export=";case 226:if(getAssignmentDeclarationKind(e)===2){return"export="}S.fail("Unknown binary declaration kind");break;case 317:return isJSDocConstructSignature(e)?"__new":"__call";case 169:S.assert(e.parent.kind===317,"Impossible parameter parent kind",(()=>`parent is: ${S.formatSyntaxKind(e.parent.kind)}, expected JSDocFunctionType`));const t=e.parent;const n=t.parameters.indexOf(e);return"arg"+n}}function getDisplayName(e){return isNamedDeclaration(e)?declarationNameToString(e.name):unescapeLeadingUnderscores(S.checkDefined(getDeclarationName(e)))}function declareSymbol(t,n,r,i,o,a,s){S.assert(s||!hasDynamicName(r));const c=hasSyntacticModifier(r,2048)||isExportSpecifier(r)&&moduleExportNameIsDefault(r.name);const l=s?"__computed":c&&n?"default":getDeclarationName(r);let d;if(l===void 0){d=createSymbol(0,"__missing")}else{d=t.get(l);if(i&2885600){P.add(l)}if(!d){t.set(l,d=createSymbol(0,l));if(a)d.isReplaceableByMethod=true}else if(a&&!d.isReplaceableByMethod){return d}else if(d.flags&o){if(d.isReplaceableByMethod){t.set(l,d=createSymbol(0,l))}else if(!(i&3&&d.flags&67108864)){if(isNamedDeclaration(r)){setParent(r.name,r)}let t=d.flags&2?wt.Cannot_redeclare_block_scoped_variable_0:wt.Duplicate_identifier_0;let n=true;if(d.flags&384||i&384){t=wt.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations;n=false}let o=false;if(length(d.declarations)){if(c){t=wt.A_module_cannot_have_multiple_default_exports;n=false;o=true}else{if(d.declarations&&d.declarations.length&&(r.kind===277&&!r.isExportEquals)){t=wt.A_module_cannot_have_multiple_default_exports;n=false;o=true}}}const a=[];if(isTypeAliasDeclaration(r)&&nodeIsMissing(r.type)&&hasSyntacticModifier(r,32)&&d.flags&(2097152|788968|1920)){a.push(createDiagnosticForNode2(r,wt.Did_you_mean_0,`export type { ${unescapeLeadingUnderscores(r.name.escapedText)} }`))}const s=getNameOfDeclaration(r)||r;forEach(d.declarations,((r,i)=>{const c=getNameOfDeclaration(r)||r;const l=n?createDiagnosticForNode2(c,t,getDisplayName(r)):createDiagnosticForNode2(c,t);e.bindDiagnostics.push(o?addRelatedInfo(l,createDiagnosticForNode2(s,i===0?wt.Another_export_default_is_here:wt.and_here)):l);if(o){a.push(createDiagnosticForNode2(c,wt.The_first_export_default_is_here))}}));const p=n?createDiagnosticForNode2(s,t,getDisplayName(r)):createDiagnosticForNode2(s,t);e.bindDiagnostics.push(addRelatedInfo(p,...a));d=createSymbol(0,l)}}}addDeclarationToSymbol(d,r,i);if(d.parent){S.assert(d.parent===n,"Existing symbol parent should match new one")}else{d.parent=n}return d}function declareModuleMember(e,t,n){const r=!!(getCombinedModifierFlags(e)&32)||jsdocTreatAsExported(e);if(t&2097152){if(e.kind===281||e.kind===271&&r){return declareSymbol(i.symbol.exports,i.symbol,e,t,n)}else{S.assertNode(i,canHaveLocals);return declareSymbol(i.locals,void 0,e,t,n)}}else{if(isJSDocTypeAlias(e))S.assert(isInJSFile(e));if(!isAmbientModule(e)&&(r||i.flags&128)){if(!canHaveLocals(i)||!i.locals||hasSyntacticModifier(e,2048)&&!getDeclarationName(e)){return declareSymbol(i.symbol.exports,i.symbol,e,t,n)}const r=t&111551?1048576:0;const o=declareSymbol(i.locals,void 0,e,r,n);o.exportSymbol=declareSymbol(i.symbol.exports,i.symbol,e,t,n);e.localSymbol=o;return o}else{S.assertNode(i,canHaveLocals);return declareSymbol(i.locals,void 0,e,t,n)}}}function jsdocTreatAsExported(e){if(e.parent&&isModuleDeclaration(e)){e=e.parent}if(!isJSDocTypeAlias(e))return false;if(!isJSDocEnumTag(e)&&!!e.fullName)return true;const t=getNameOfDeclaration(e);if(!t)return false;if(isPropertyAccessEntityNameExpression(t.parent)&&isTopLevelNamespaceAssignment(t.parent))return true;if(isDeclaration(t.parent)&&getCombinedModifierFlags(t.parent)&32)return true;return false}function bindContainer(e,t){const n=i;const r=o;const s=a;const c=x;if(e.kind===219&&e.body.kind!==241)x=true;if(t&1){if(e.kind!==219){o=i}i=a=e;if(t&32){i.locals=createSymbolTable();addToContainerChain(i)}}else if(t&2){a=e;if(t&32){a.locals=void 0}}if(t&4){const n=p;const r=u;const i=f;const o=m;const a=y;const s=T;const c=v;const l=t&16&&!hasSyntacticModifier(e,1024)&&!e.asteriskToken&&!!getImmediatelyInvokedFunctionExpression(e)||e.kind===175;if(!l){p=createFlowNode(2,void 0,void 0);if(t&(16|128)){p.node=e}}m=l||e.kind===176||isInJSFile(e)&&(e.kind===262||e.kind===218)?createBranchLabel():void 0;y=void 0;u=void 0;f=void 0;T=void 0;v=false;bindChildren(e);e.flags&=~5632;if(!(p.flags&1)&&t&8&&nodeIsPresent(e.body)){e.flags|=512;if(v)e.flags|=1024;e.endFlowNode=p}if(e.kind===307){e.flags|=C;e.endFlowNode=p}if(m){addAntecedent(m,p);p=finishFlowLabel(m);if(e.kind===176||e.kind===175||isInJSFile(e)&&(e.kind===262||e.kind===218)){e.returnFlowNode=p}}if(!l){p=n}u=r;f=i;m=o;y=a;T=s;v=c}else if(t&64){l=false;bindChildren(e);S.assertNotNode(e,isIdentifier);e.flags=l?e.flags|256:e.flags&~256}else{bindChildren(e)}x=c;i=n;o=r;a=s}function bindEachFunctionsFirst(e){bindEach(e,(e=>e.kind===262?bind(e):void 0));bindEach(e,(e=>e.kind!==262?bind(e):void 0))}function bindEach(e,t=bind){if(e===void 0){return}forEach(e,t)}function bindEachChild(e){forEachChild(e,bind,bindEach)}function bindChildren(e){const n=N;N=false;if(checkUnreachable(e)){if(canHaveFlowNode(e)&&e.flowNode){e.flowNode=void 0}bindEachChild(e);bindJSDoc(e);N=n;return}if(e.kind>=243&&e.kind<=259&&(!t.allowUnreachableCode||e.kind===253)){e.flowNode=p}switch(e.kind){case 247:bindWhileStatement(e);break;case 246:bindDoStatement(e);break;case 248:bindForStatement(e);break;case 249:case 250:bindForInOrForOfStatement(e);break;case 245:bindIfStatement(e);break;case 253:case 257:bindReturnOrThrow(e);break;case 252:case 251:bindBreakOrContinueStatement(e);break;case 258:bindTryStatement(e);break;case 255:bindSwitchStatement(e);break;case 269:bindCaseBlock(e);break;case 296:bindCaseClause(e);break;case 244:bindExpressionStatement(e);break;case 256:bindLabeledStatement(e);break;case 224:bindPrefixUnaryExpressionFlow(e);break;case 225:bindPostfixUnaryExpressionFlow(e);break;case 226:if(isDestructuringAssignment(e)){N=n;bindDestructuringAssignmentFlow(e);return}A(e);break;case 220:bindDeleteExpressionFlow(e);break;case 227:bindConditionalExpressionFlow(e);break;case 260:bindVariableDeclarationFlow(e);break;case 211:case 212:bindAccessExpressionFlow(e);break;case 213:bindCallExpressionFlow(e);break;case 235:bindNonNullExpressionFlow(e);break;case 346:case 338:case 340:bindJSDocTypeAlias(e);break;case 351:bindJSDocImportTag(e);break;case 307:{bindEachFunctionsFirst(e.statements);bind(e.endOfFileToken);break}case 241:case 268:bindEachFunctionsFirst(e.statements);break;case 208:bindBindingElementFlow(e);break;case 169:bindParameterFlow(e);break;case 210:case 209:case 303:case 230:N=n;default:bindEachChild(e);break}bindJSDoc(e);N=n}function isNarrowingExpression(e){switch(e.kind){case 80:case 110:return true;case 211:case 212:return containsNarrowableReference(e);case 213:return hasNarrowableArgument(e);case 217:if(isJSDocTypeAssertion(e)){return false}case 235:return isNarrowingExpression(e.expression);case 226:return isNarrowingBinaryExpression(e);case 224:return e.operator===54&&isNarrowingExpression(e.operand);case 221:return isNarrowingExpression(e.expression)}return false}function isNarrowableReference(e){switch(e.kind){case 80:case 110:case 108:case 236:return true;case 211:case 217:case 235:return isNarrowableReference(e.expression);case 212:return(isStringOrNumericLiteralLike(e.argumentExpression)||isEntityNameExpression(e.argumentExpression))&&isNarrowableReference(e.expression);case 226:return e.operatorToken.kind===28&&isNarrowableReference(e.right)||isAssignmentOperator(e.operatorToken.kind)&&isLeftHandSideExpression(e.left)}return false}function containsNarrowableReference(e){return isNarrowableReference(e)||isOptionalChain(e)&&containsNarrowableReference(e.expression)}function hasNarrowableArgument(e){if(e.arguments){for(const t of e.arguments){if(containsNarrowableReference(t)){return true}}}if(e.expression.kind===211&&containsNarrowableReference(e.expression.expression)){return true}return false}function isNarrowingTypeofOperands(e,t){return isTypeOfExpression(e)&&isNarrowableOperand(e.expression)&&isStringLiteralLike(t)}function isNarrowingBinaryExpression(e){switch(e.operatorToken.kind){case 64:case 76:case 77:case 78:return containsNarrowableReference(e.left);case 35:case 36:case 37:case 38:const t=skipParentheses(e.left);const n=skipParentheses(e.right);return isNarrowableOperand(t)||isNarrowableOperand(n)||isNarrowingTypeofOperands(n,t)||isNarrowingTypeofOperands(t,n)||(isBooleanLiteral(n)&&isNarrowingExpression(t)||isBooleanLiteral(t)&&isNarrowingExpression(n));case 104:return isNarrowableOperand(e.left);case 103:return isNarrowingExpression(e.right);case 28:return isNarrowingExpression(e.right)}return false}function isNarrowableOperand(e){switch(e.kind){case 217:return isNarrowableOperand(e.expression);case 226:switch(e.operatorToken.kind){case 64:return isNarrowableOperand(e.left);case 28:return isNarrowableOperand(e.right)}}return containsNarrowableReference(e)}function createBranchLabel(){return createFlowNode(4,void 0,void 0)}function createLoopLabel(){return createFlowNode(8,void 0,void 0)}function createReduceLabel(e,t,n){return createFlowNode(1024,{target:e,antecedents:t},n)}function setFlowNodeReferenced(e){e.flags|=e.flags&2048?4096:2048}function addAntecedent(e,t){if(!(t.flags&1)&&!contains(e.antecedent,t)){(e.antecedent||(e.antecedent=[])).push(t);setFlowNodeReferenced(t)}}function createFlowCondition(e,t,n){if(t.flags&1){return t}if(!n){return e&32?t:D}if((n.kind===112&&e&64||n.kind===97&&e&32)&&!isExpressionOfOptionalChainRoot(n)&&!isNullishCoalesce(n.parent)){return D}if(!isNarrowingExpression(n)){return t}setFlowNodeReferenced(t);return createFlowNode(e,n,t)}function createFlowSwitchClause(e,t,n,r){setFlowNodeReferenced(e);return createFlowNode(128,{switchStatement:t,clauseStart:n,clauseEnd:r},e)}function createFlowMutation(e,t,n){setFlowNodeReferenced(t);b=true;const r=createFlowNode(e,n,t);if(y){addAntecedent(y,r)}return r}function createFlowCall(e,t){setFlowNodeReferenced(e);b=true;return createFlowNode(512,t,e)}function finishFlowLabel(e){const t=e.antecedent;if(!t){return D}if(t.length===1){return t[0]}return e}function isStatementCondition(e){const t=e.parent;switch(t.kind){case 245:case 247:case 246:return t.expression===e;case 248:case 227:return t.condition===e}return false}function isLogicalExpression(e){while(true){if(e.kind===217){e=e.expression}else if(e.kind===224&&e.operator===54){e=e.operand}else{return isLogicalOrCoalescingBinaryExpression(e)}}}function isLogicalAssignmentExpression(e){return isLogicalOrCoalescingAssignmentExpression(skipParentheses(e))}function isTopLevelLogicalExpression(e){while(isParenthesizedExpression(e.parent)||isPrefixUnaryExpression(e.parent)&&e.parent.operator===54){e=e.parent}return!isStatementCondition(e)&&!isLogicalExpression(e.parent)&&!(isOptionalChain(e.parent)&&e.parent.expression===e)}function doWithConditionalBranches(e,t,n,r){const i=_;const o=g;_=n;g=r;e(t);_=i;g=o}function bindCondition(e,t,n){doWithConditionalBranches(bind,e,t,n);if(!e||!isLogicalAssignmentExpression(e)&&!isLogicalExpression(e)&&!(isOptionalChain(e)&&isOutermostOptionalChain(e))){addAntecedent(t,createFlowCondition(32,p,e));addAntecedent(n,createFlowCondition(64,p,e))}}function bindIterativeStatement(e,t,n){const r=u;const i=f;u=t;f=n;bind(e);u=r;f=i}function setContinueTarget(e,t){let n=T;while(n&&e.parent.kind===256){n.continueTarget=t;n=n.next;e=e.parent}return t}function bindWhileStatement(e){const t=setContinueTarget(e,createLoopLabel());const n=createBranchLabel();const r=createBranchLabel();addAntecedent(t,p);p=t;bindCondition(e.expression,n,r);p=finishFlowLabel(n);bindIterativeStatement(e.statement,r,t);addAntecedent(t,p);p=finishFlowLabel(r)}function bindDoStatement(e){const t=createLoopLabel();const n=setContinueTarget(e,createBranchLabel());const r=createBranchLabel();addAntecedent(t,p);p=t;bindIterativeStatement(e.statement,r,n);addAntecedent(n,p);p=finishFlowLabel(n);bindCondition(e.expression,t,r);p=finishFlowLabel(r)}function bindForStatement(e){const t=setContinueTarget(e,createLoopLabel());const n=createBranchLabel();const r=createBranchLabel();const i=createBranchLabel();bind(e.initializer);addAntecedent(t,p);p=t;bindCondition(e.condition,n,i);p=finishFlowLabel(n);bindIterativeStatement(e.statement,i,r);addAntecedent(r,p);p=finishFlowLabel(r);bind(e.incrementor);addAntecedent(t,p);p=finishFlowLabel(i)}function bindForInOrForOfStatement(e){const t=setContinueTarget(e,createLoopLabel());const n=createBranchLabel();bind(e.expression);addAntecedent(t,p);p=t;if(e.kind===250){bind(e.awaitModifier)}addAntecedent(n,p);bind(e.initializer);if(e.initializer.kind!==261){bindAssignmentTargetFlow(e.initializer)}bindIterativeStatement(e.statement,n,t);addAntecedent(t,p);p=finishFlowLabel(n)}function bindIfStatement(e){const t=createBranchLabel();const n=createBranchLabel();const r=createBranchLabel();bindCondition(e.expression,t,n);p=finishFlowLabel(t);bind(e.thenStatement);addAntecedent(r,p);p=finishFlowLabel(n);bind(e.elseStatement);addAntecedent(r,p);p=finishFlowLabel(r)}function bindReturnOrThrow(e){const t=x;x=true;bind(e.expression);x=t;if(e.kind===253){v=true;if(m){addAntecedent(m,p)}}p=D;b=true}function findActiveLabel(e){for(let t=T;t;t=t.next){if(t.name===e){return t}}return void 0}function bindBreakOrContinueFlow(e,t,n){const r=e.kind===252?t:n;if(r){addAntecedent(r,p);p=D;b=true}}function bindBreakOrContinueStatement(e){bind(e.label);if(e.label){const t=findActiveLabel(e.label.escapedText);if(t){t.referenced=true;bindBreakOrContinueFlow(e,t.breakTarget,t.continueTarget)}}else{bindBreakOrContinueFlow(e,u,f)}}function bindTryStatement(e){const t=m;const n=y;const r=createBranchLabel();const i=createBranchLabel();let o=createBranchLabel();if(e.finallyBlock){m=i}addAntecedent(o,p);y=o;bind(e.tryBlock);addAntecedent(r,p);if(e.catchClause){p=finishFlowLabel(o);o=createBranchLabel();addAntecedent(o,p);y=o;bind(e.catchClause);addAntecedent(r,p)}m=t;y=n;if(e.finallyBlock){const t=createBranchLabel();t.antecedent=concatenate(concatenate(r.antecedent,o.antecedent),i.antecedent);p=t;bind(e.finallyBlock);if(p.flags&1){p=D}else{if(m&&i.antecedent){addAntecedent(m,createReduceLabel(t,i.antecedent,p))}if(y&&o.antecedent){addAntecedent(y,createReduceLabel(t,o.antecedent,p))}p=r.antecedent?createReduceLabel(t,r.antecedent,p):D}}else{p=finishFlowLabel(r)}}function bindSwitchStatement(e){const t=createBranchLabel();bind(e.expression);const n=u;const r=h;u=t;h=p;bind(e.caseBlock);addAntecedent(t,p);const i=forEach(e.caseBlock.clauses,(e=>e.kind===297));e.possiblyExhaustive=!i&&!t.antecedent;if(!i){addAntecedent(t,createFlowSwitchClause(h,e,0,0))}u=n;h=r;p=finishFlowLabel(t)}function bindCaseBlock(e){const n=e.clauses;const r=e.parent.expression.kind===112||isNarrowingExpression(e.parent.expression);let i=D;for(let o=0;oisExportDeclaration(e)||isExportAssignment(e)))}function setExportContextFlag(e){if(e.flags&33554432&&!hasExportDeclarations(e)){e.flags|=128}else{e.flags&=~128}}function bindModuleDeclaration(t){setExportContextFlag(t);if(isAmbientModule(t)){if(hasSyntacticModifier(t,32)){errorOnFirstToken(t,wt.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible)}if(isModuleAugmentationExternal(t)){declareModuleSymbol(t)}else{let n;if(t.name.kind===11){const{text:e}=t.name;n=tryParsePattern(e);if(n===void 0){errorOnFirstToken(t.name,wt.Pattern_0_can_have_at_most_one_Asterisk_character,e)}}const r=declareSymbolAndAddToSymbolTable(t,512,110735);e.patternAmbientModules=append(e.patternAmbientModules,n&&!isString(n)?{pattern:n,symbol:r}:void 0)}}else{const e=declareModuleSymbol(t);if(e!==0){const{symbol:n}=t;n.constEnumOnlyModule=!(n.flags&(16|32|256))&&e===2&&n.constEnumOnlyModule!==false}}}function declareModuleSymbol(e){const t=getModuleInstanceState(e);const n=t!==0;declareSymbolAndAddToSymbolTable(e,n?512:1024,n?110735:0);return t}function bindFunctionOrConstructorType(e){const t=createSymbol(131072,getDeclarationName(e));addDeclarationToSymbol(t,e,131072);const n=createSymbol(2048,"__type");addDeclarationToSymbol(n,e,2048);n.members=createSymbolTable();n.members.set(t.escapedName,t)}function bindObjectLiteralExpression(e){return bindAnonymousDeclaration(e,4096,"__object")}function bindJsxAttributes(e){return bindAnonymousDeclaration(e,4096,"__jsxAttributes")}function bindJsxAttribute(e,t,n){return declareSymbolAndAddToSymbolTable(e,t,n)}function bindAnonymousDeclaration(e,t,n){const r=createSymbol(t,n);if(t&(8|106500)){r.parent=i.symbol}addDeclarationToSymbol(r,e,t);return r}function bindBlockScopedDeclaration(e,t,n){switch(a.kind){case 267:declareModuleMember(e,t,n);break;case 307:if(isExternalOrCommonJsModule(i)){declareModuleMember(e,t,n);break}default:S.assertNode(a,canHaveLocals);if(!a.locals){a.locals=createSymbolTable();addToContainerChain(a)}declareSymbol(a.locals,void 0,e,t,n)}}function delayedBindJSDocTypedefTag(){if(!c){return}const t=i;const n=s;const o=a;const l=r;const d=p;for(const t of c){const n=t.parent.parent;i=getEnclosingContainer(n)||e;a=getEnclosingBlockScopeContainer(n)||e;p=createFlowNode(2,void 0,void 0);r=t;bind(t.typeExpression);const o=getNameOfDeclaration(t);if((isJSDocEnumTag(t)||!t.fullName)&&o&&isPropertyAccessEntityNameExpression(o.parent)){const n=isTopLevelNamespaceAssignment(o.parent);if(n){bindPotentiallyMissingNamespaces(e.symbol,o.parent,n,!!findAncestor(o,(e=>isPropertyAccessExpression(e)&&e.name.escapedText==="prototype")),false);const r=i;switch(getAssignmentDeclarationPropertyAccessKind(o.parent)){case 1:case 2:if(!isExternalOrCommonJsModule(e)){i=void 0}else{i=e}break;case 4:i=o.parent.expression;break;case 3:i=o.parent.expression.name;break;case 5:i=isExportsOrModuleExportsOrAlias(e,o.parent.expression)?e:isPropertyAccessExpression(o.parent.expression)?o.parent.expression.name:o.parent.expression;break;case 0:return S.fail("Shouldn't have detected typedef or enum on non-assignment declaration")}if(i){declareModuleMember(t,524288,788968)}i=r}}else if(isJSDocEnumTag(t)||!t.fullName||t.fullName.kind===80){r=t.parent;bindBlockScopedDeclaration(t,524288,788968)}else{bind(t.fullName)}}i=t;s=n;a=o;r=l;p=d}function bindJSDocImports(){if(d===void 0){return}const t=i;const n=s;const o=a;const c=r;const l=p;for(const t of d){const n=getJSDocHost(t);const o=n?getEnclosingContainer(n):void 0;const s=n?getEnclosingBlockScopeContainer(n):void 0;i=o||e;a=s||e;p=createFlowNode(2,void 0,void 0);r=t;bind(t.importClause)}i=t;s=n;a=o;r=c;p=l}function checkContextualIdentifier(t){if(!e.parseDiagnostics.length&&!(t.flags&33554432)&&!(t.flags&16777216)&&!isIdentifierName(t)){const n=identifierToKeywordKind(t);if(n===void 0){return}if(E&&n>=119&&n<=127){e.bindDiagnostics.push(createDiagnosticForNode2(t,getStrictModeIdentifierMessage(t),declarationNameToString(t)))}else if(n===135){if(isExternalModule(e)&&isInTopLevelContext(t)){e.bindDiagnostics.push(createDiagnosticForNode2(t,wt.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module,declarationNameToString(t)))}else if(t.flags&65536){e.bindDiagnostics.push(createDiagnosticForNode2(t,wt.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,declarationNameToString(t)))}}else if(n===127&&t.flags&16384){e.bindDiagnostics.push(createDiagnosticForNode2(t,wt.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,declarationNameToString(t)))}}}function getStrictModeIdentifierMessage(t){if(getContainingClass(t)){return wt.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode}if(e.externalModuleIndicator){return wt.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode}return wt.Identifier_expected_0_is_a_reserved_word_in_strict_mode}function checkPrivateIdentifier(t){if(t.escapedText==="#constructor"){if(!e.parseDiagnostics.length){e.bindDiagnostics.push(createDiagnosticForNode2(t,wt.constructor_is_a_reserved_word,declarationNameToString(t)))}}}function checkStrictModeBinaryExpression(e){if(E&&isLeftHandSideExpression(e.left)&&isAssignmentOperator(e.operatorToken.kind)){checkStrictModeEvalOrArguments(e,e.left)}}function checkStrictModeCatchClause(e){if(E&&e.variableDeclaration){checkStrictModeEvalOrArguments(e,e.variableDeclaration.name)}}function checkStrictModeDeleteExpression(t){if(E&&t.expression.kind===80){const n=getErrorSpanForNode(e,t.expression);e.bindDiagnostics.push(createFileDiagnostic(e,n.start,n.length,wt.delete_cannot_be_called_on_an_identifier_in_strict_mode))}}function isEvalOrArgumentsIdentifier(e){return isIdentifier(e)&&(e.escapedText==="eval"||e.escapedText==="arguments")}function checkStrictModeEvalOrArguments(t,n){if(n&&n.kind===80){const r=n;if(isEvalOrArgumentsIdentifier(r)){const i=getErrorSpanForNode(e,n);e.bindDiagnostics.push(createFileDiagnostic(e,i.start,i.length,getStrictModeEvalOrArgumentsMessage(t),idText(r)))}}}function getStrictModeEvalOrArgumentsMessage(t){if(getContainingClass(t)){return wt.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode}if(e.externalModuleIndicator){return wt.Invalid_use_of_0_Modules_are_automatically_in_strict_mode}return wt.Invalid_use_of_0_in_strict_mode}function checkStrictModeFunctionName(e){if(E&&!(e.flags&33554432)){checkStrictModeEvalOrArguments(e,e.name)}}function getStrictModeBlockScopeFunctionDeclarationMessage(t){if(getContainingClass(t)){return wt.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode}if(e.externalModuleIndicator){return wt.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode}return wt.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5}function checkStrictModeFunctionDeclaration(t){if(n<2){if(a.kind!==307&&a.kind!==267&&!isFunctionLikeOrClassStaticBlockDeclaration(a)){const n=getErrorSpanForNode(e,t);e.bindDiagnostics.push(createFileDiagnostic(e,n.start,n.length,getStrictModeBlockScopeFunctionDeclarationMessage(t)))}}}function checkStrictModePostfixUnaryExpression(e){if(E){checkStrictModeEvalOrArguments(e,e.operand)}}function checkStrictModePrefixUnaryExpression(e){if(E){if(e.operator===46||e.operator===47){checkStrictModeEvalOrArguments(e,e.operand)}}}function checkStrictModeWithStatement(e){if(E){errorOnFirstToken(e,wt.with_statements_are_not_allowed_in_strict_mode)}}function checkStrictModeLabeledStatement(e){if(E&&zn(t)>=2){if(isDeclarationStatement(e.statement)||isVariableStatement(e.statement)){errorOnFirstToken(e.label,wt.A_label_is_not_allowed_here)}}}function errorOnFirstToken(t,n,...r){const i=getSpanOfTokenAtPosition(e,t.pos);e.bindDiagnostics.push(createFileDiagnostic(e,i.start,i.length,n,...r))}function errorOrSuggestionOnNode(e,t,n){errorOrSuggestionOnRange(e,t,t,n)}function errorOrSuggestionOnRange(t,n,r,i){addErrorOrSuggestionDiagnostic(t,{pos:getTokenPosOfNode(n,e),end:r.end},i)}function addErrorOrSuggestionDiagnostic(t,n,r){const i=createFileDiagnostic(e,n.pos,n.end-n.pos,r);if(t){e.bindDiagnostics.push(i)}else{e.bindSuggestionDiagnostics=append(e.bindSuggestionDiagnostics,{...i,category:2})}}function bind(t){if(!t){return}setParent(t,r);if(G)t.tracingPath=e.path;const n=E;bindWorker(t);if(t.kind>165){const e=r;r=t;const n=getContainerFlags(t);if(n===0){bindChildren(t)}else{bindContainer(t,n)}r=e}else{const e=r;if(t.kind===1)r=t;bindJSDoc(t);r=e}E=n}function bindJSDoc(e){if(hasJSDocNodes(e)){if(isInJSFile(e)){for(const t of e.jsDoc){bind(t)}}else{for(const t of e.jsDoc){setParent(t,e);setParentRecursive(t,false)}}}}function updateStrictModeStatementList(e){if(!E){for(const t of e){if(!isPrologueDirective(t)){return}if(isUseStrictPrologueDirective(t)){E=true;return}}}}function isUseStrictPrologueDirective(t){const n=getSourceTextOfNodeFromSourceFile(e,t.expression);return n==='"use strict"'||n==="'use strict'"}function bindWorker(t){switch(t.kind){case 80:if(t.flags&4096){let e=t.parent;while(e&&!isJSDocTypeAlias(e)){e=e.parent}bindBlockScopedDeclaration(e,524288,788968);break}case 110:if(p&&(isExpression(t)||r.kind===304)){t.flowNode=p}return checkContextualIdentifier(t);case 166:if(p&&isPartOfTypeQuery(t)){t.flowNode=p}break;case 236:case 108:t.flowNode=p;break;case 81:return checkPrivateIdentifier(t);case 211:case 212:const n=t;if(p&&isNarrowableReference(n)){n.flowNode=p}if(isSpecialPropertyDeclaration(n)){bindSpecialPropertyDeclaration(n)}if(isInJSFile(n)&&e.commonJsModuleIndicator&&isModuleExportsAccessExpression(n)&&!lookupSymbolForName(a,"module")){declareSymbol(e.locals,void 0,n.expression,1|134217728,111550)}break;case 226:const i=getAssignmentDeclarationKind(t);switch(i){case 1:bindExportsPropertyAssignment(t);break;case 2:bindModuleExportsAssignment(t);break;case 3:bindPrototypePropertyAssignment(t.left,t);break;case 6:bindPrototypeAssignment(t);break;case 4:bindThisPropertyAssignment(t);break;case 5:const e=t.left.expression;if(isInJSFile(t)&&isIdentifier(e)){const n=lookupSymbolForName(a,e.escapedText);if(isThisInitializedDeclaration(n==null?void 0:n.valueDeclaration)){bindThisPropertyAssignment(t);break}}bindSpecialPropertyAssignment(t);break;case 0:break;default:S.fail("Unknown binary expression special property assignment kind")}return checkStrictModeBinaryExpression(t);case 299:return checkStrictModeCatchClause(t);case 220:return checkStrictModeDeleteExpression(t);case 225:return checkStrictModePostfixUnaryExpression(t);case 224:return checkStrictModePrefixUnaryExpression(t);case 254:return checkStrictModeWithStatement(t);case 256:return checkStrictModeLabeledStatement(t);case 197:l=true;return;case 182:break;case 168:return bindTypeParameter(t);case 169:return bindParameter(t);case 260:return bindVariableDeclarationOrBindingElement(t);case 208:t.flowNode=p;return bindVariableDeclarationOrBindingElement(t);case 172:case 171:return bindPropertyWorker(t);case 303:case 304:return bindPropertyOrMethodOrAccessor(t,4,0);case 306:return bindPropertyOrMethodOrAccessor(t,8,900095);case 179:case 180:case 181:return declareSymbolAndAddToSymbolTable(t,131072,0);case 174:case 173:return bindPropertyOrMethodOrAccessor(t,8192|(t.questionToken?16777216:0),isObjectLiteralMethod(t)?0:103359);case 262:return bindFunctionDeclaration(t);case 176:return declareSymbolAndAddToSymbolTable(t,16384,0);case 177:return bindPropertyOrMethodOrAccessor(t,32768,46015);case 178:return bindPropertyOrMethodOrAccessor(t,65536,78783);case 184:case 317:case 323:case 185:return bindFunctionOrConstructorType(t);case 187:case 322:case 200:return bindAnonymousTypeWorker(t);case 332:return bindJSDocClassTag(t);case 210:return bindObjectLiteralExpression(t);case 218:case 219:return bindFunctionExpression(t);case 213:const o=getAssignmentDeclarationKind(t);switch(o){case 7:return bindObjectDefinePropertyAssignment(t);case 8:return bindObjectDefinePropertyExport(t);case 9:return bindObjectDefinePrototypeProperty(t);case 0:break;default:return S.fail("Unknown call expression assignment declaration kind")}if(isInJSFile(t)){bindCallExpression(t)}break;case 231:case 263:E=true;return bindClassLikeDeclaration(t);case 264:return bindBlockScopedDeclaration(t,64,788872);case 265:return bindBlockScopedDeclaration(t,524288,788968);case 266:return bindEnumDeclaration(t);case 267:return bindModuleDeclaration(t);case 292:return bindJsxAttributes(t);case 291:return bindJsxAttribute(t,4,0);case 271:case 274:case 276:case 281:return declareSymbolAndAddToSymbolTable(t,2097152,2097152);case 270:return bindNamespaceExportDeclaration(t);case 273:return bindImportClause(t);case 278:return bindExportDeclaration(t);case 277:return bindExportAssignment(t);case 307:updateStrictModeStatementList(t.statements);return bindSourceFileIfExternalModule();case 241:if(!isFunctionLikeOrClassStaticBlockDeclaration(t.parent)){return}case 268:return updateStrictModeStatementList(t.statements);case 341:if(t.parent.kind===323){return bindParameter(t)}if(t.parent.kind!==322){break}case 348:const s=t;const u=s.isBracketed||s.typeExpression&&s.typeExpression.type.kind===316?4|16777216:4;return declareSymbolAndAddToSymbolTable(s,u,0);case 346:case 338:case 340:return(c||(c=[])).push(t);case 339:return bind(t.typeExpression);case 351:return(d||(d=[])).push(t)}}function bindPropertyWorker(e){const t=isAutoAccessorPropertyDeclaration(e);const n=t?98304:4;const r=t?13247:0;return bindPropertyOrMethodOrAccessor(e,n|(e.questionToken?16777216:0),r)}function bindAnonymousTypeWorker(e){return bindAnonymousDeclaration(e,2048,"__type")}function bindSourceFileIfExternalModule(){setExportContextFlag(e);if(isExternalModule(e)){bindSourceFileAsExternalModule()}else if(isJsonSourceFile(e)){bindSourceFileAsExternalModule();const t=e.symbol;declareSymbol(e.symbol.exports,e.symbol,e,4,-1);e.symbol=t}}function bindSourceFileAsExternalModule(){bindAnonymousDeclaration(e,512,`"${removeFileExtension(e.fileName)}"`)}function bindExportAssignment(e){if(!i.symbol||!i.symbol.exports){bindAnonymousDeclaration(e,111551,getDeclarationName(e))}else{const t=exportAssignmentIsAlias(e)?2097152:4;const n=declareSymbol(i.symbol.exports,i.symbol,e,t,-1);if(e.isExportEquals){setValueDeclaration(n,e)}}}function bindNamespaceExportDeclaration(t){if(some(t.modifiers)){e.bindDiagnostics.push(createDiagnosticForNode2(t,wt.Modifiers_cannot_appear_here))}const n=!isSourceFile(t.parent)?wt.Global_module_exports_may_only_appear_at_top_level:!isExternalModule(t.parent)?wt.Global_module_exports_may_only_appear_in_module_files:!t.parent.isDeclarationFile?wt.Global_module_exports_may_only_appear_in_declaration_files:void 0;if(n){e.bindDiagnostics.push(createDiagnosticForNode2(t,n))}else{e.symbol.globalExports=e.symbol.globalExports||createSymbolTable();declareSymbol(e.symbol.globalExports,e.symbol,t,2097152,2097152)}}function bindExportDeclaration(e){if(!i.symbol||!i.symbol.exports){bindAnonymousDeclaration(e,8388608,getDeclarationName(e))}else if(!e.exportClause){declareSymbol(i.symbol.exports,i.symbol,e,8388608,0)}else if(isNamespaceExport(e.exportClause)){setParent(e.exportClause,e);declareSymbol(i.symbol.exports,i.symbol,e.exportClause,2097152,2097152)}}function bindImportClause(e){if(e.name){declareSymbolAndAddToSymbolTable(e,2097152,2097152)}}function setCommonJsModuleIndicator(t){if(e.externalModuleIndicator&&e.externalModuleIndicator!==true){return false}if(!e.commonJsModuleIndicator){e.commonJsModuleIndicator=t;if(!e.externalModuleIndicator){bindSourceFileAsExternalModule()}}return true}function bindObjectDefinePropertyExport(e){if(!setCommonJsModuleIndicator(e)){return}const t=forEachIdentifierInEntityName(e.arguments[0],void 0,((e,t)=>{if(t){addDeclarationToSymbol(t,e,1536|67108864)}return t}));if(t){const n=4|1048576;declareSymbol(t.exports,t,e,n,0)}}function bindExportsPropertyAssignment(e){if(!setCommonJsModuleIndicator(e)){return}const t=forEachIdentifierInEntityName(e.left.expression,void 0,((e,t)=>{if(t){addDeclarationToSymbol(t,e,1536|67108864)}return t}));if(t){const n=isAliasableExpression(e.right)&&(isExportsIdentifier(e.left.expression)||isModuleExportsAccessExpression(e.left.expression));const r=n?2097152:4|1048576;setParent(e.left,e);declareSymbol(t.exports,t,e.left,r,0)}}function bindModuleExportsAssignment(t){if(!setCommonJsModuleIndicator(t)){return}const n=getRightMostAssignedExpression(t.right);if(isEmptyObjectLiteral(n)||i===e&&isExportsOrModuleExportsOrAlias(e,n)){return}if(isObjectLiteralExpression(n)&&every(n.properties,isShorthandPropertyAssignment)){forEach(n.properties,bindExportAssignedObjectMemberAlias);return}const r=exportAssignmentIsAlias(t)?2097152:4|1048576|512;const o=declareSymbol(e.symbol.exports,e.symbol,t,r|67108864,0);setValueDeclaration(o,t)}function bindExportAssignedObjectMemberAlias(t){declareSymbol(e.symbol.exports,e.symbol,t,2097152|67108864,0)}function bindThisPropertyAssignment(e){S.assert(isInJSFile(e));const t=isBinaryExpression(e)&&isPropertyAccessExpression(e.left)&&isPrivateIdentifier(e.left.name)||isPropertyAccessExpression(e)&&isPrivateIdentifier(e.name);if(t){return}const n=getThisContainer(e,false,false);switch(n.kind){case 262:case 218:let t=n.symbol;if(isBinaryExpression(n.parent)&&n.parent.operatorToken.kind===64){const e=n.parent.left;if(isBindableStaticAccessExpression(e)&&isPrototypeAccess(e.expression)){t=lookupSymbolForPropertyAccess(e.expression.expression,o)}}if(t&&t.valueDeclaration){t.members=t.members||createSymbolTable();if(hasDynamicName(e)){bindDynamicallyNamedThisPropertyAssignment(e,t,t.members)}else{declareSymbol(t.members,t,e,4|67108864,0&~4)}addDeclarationToSymbol(t,t.valueDeclaration,32)}break;case 176:case 172:case 174:case 177:case 178:case 175:const r=n.parent;const i=isStatic(n)?r.symbol.exports:r.symbol.members;if(hasDynamicName(e)){bindDynamicallyNamedThisPropertyAssignment(e,r.symbol,i)}else{declareSymbol(i,r.symbol,e,4|67108864,0,true)}break;case 307:if(hasDynamicName(e)){break}else if(n.commonJsModuleIndicator){declareSymbol(n.symbol.exports,n.symbol,e,4|1048576,0)}else{declareSymbolAndAddToSymbolTable(e,1,111550)}break;case 267:break;default:S.failBadSyntaxKind(n)}}function bindDynamicallyNamedThisPropertyAssignment(e,t,n){declareSymbol(n,t,e,4,0,true,true);addLateBoundAssignmentDeclarationToSymbol(e,t)}function addLateBoundAssignmentDeclarationToSymbol(e,t){if(t){(t.assignmentDeclarationMembers||(t.assignmentDeclarationMembers=new Map)).set(getNodeId(e),e)}}function bindSpecialPropertyDeclaration(e){if(e.expression.kind===110){bindThisPropertyAssignment(e)}else if(isBindableStaticAccessExpression(e)&&e.parent.parent.kind===307){if(isPrototypeAccess(e.expression)){bindPrototypePropertyAssignment(e,e.parent)}else{bindStaticPropertyAssignment(e)}}}function bindPrototypeAssignment(e){setParent(e.left,e);setParent(e.right,e);bindPropertyAssignment(e.left.expression,e.left,false,true)}function bindObjectDefinePrototypeProperty(e){const t=lookupSymbolForPropertyAccess(e.arguments[0].expression);if(t&&t.valueDeclaration){addDeclarationToSymbol(t,t.valueDeclaration,32)}bindPotentiallyNewExpandoMemberToNamespace(e,t,true)}function bindPrototypePropertyAssignment(e,t){const n=e.expression;const r=n.expression;setParent(r,n);setParent(n,e);setParent(e,t);bindPropertyAssignment(r,e,true,true)}function bindObjectDefinePropertyAssignment(e){let t=lookupSymbolForPropertyAccess(e.arguments[0]);const n=e.parent.parent.kind===307;t=bindPotentiallyMissingNamespaces(t,e.arguments[0],n,false,false);bindPotentiallyNewExpandoMemberToNamespace(e,t,false)}function bindSpecialPropertyAssignment(t){var n;const r=lookupSymbolForPropertyAccess(t.left.expression,a)||lookupSymbolForPropertyAccess(t.left.expression,i);if(!isInJSFile(t)&&!isFunctionSymbol(r)){return}const o=getLeftmostAccessExpression(t.left);if(isIdentifier(o)&&((n=lookupSymbolForName(i,o.escapedText))==null?void 0:n.flags)&2097152){return}setParent(t.left,t);setParent(t.right,t);if(isIdentifier(t.left.expression)&&i===e&&isExportsOrModuleExportsOrAlias(e,t.left.expression)){bindExportsPropertyAssignment(t)}else if(hasDynamicName(t)){bindAnonymousDeclaration(t,4|67108864,"__computed");const e=bindPotentiallyMissingNamespaces(r,t.left.expression,isTopLevelNamespaceAssignment(t.left),false,false);addLateBoundAssignmentDeclarationToSymbol(t,e)}else{bindStaticPropertyAssignment(cast(t.left,isBindableStaticNameExpression))}}function bindStaticPropertyAssignment(e){S.assert(!isIdentifier(e));setParent(e.expression,e);bindPropertyAssignment(e.expression,e,false,false)}function bindPotentiallyMissingNamespaces(t,n,r,i,o){if((t==null?void 0:t.flags)&2097152){return t}if(r&&!i){const r=1536|67108864;const i=110735&~67108864;t=forEachIdentifierInEntityName(n,t,((t,n,o)=>{if(n){addDeclarationToSymbol(n,t,r);return n}else{const n=o?o.exports:e.jsGlobalAugmentations||(e.jsGlobalAugmentations=createSymbolTable());return declareSymbol(n,o,t,r,i)}}))}if(o&&t&&t.valueDeclaration){addDeclarationToSymbol(t,t.valueDeclaration,32)}return t}function bindPotentiallyNewExpandoMemberToNamespace(e,t,n){if(!t||!isExpandoSymbol(t)){return}const r=n?t.members||(t.members=createSymbolTable()):t.exports||(t.exports=createSymbolTable());let i=0;let o=0;if(isFunctionLikeDeclaration(getAssignedExpandoInitializer(e))){i=8192;o=103359}else if(isCallExpression(e)&&isBindableObjectDefinePropertyCall(e)){if(some(e.arguments[2].properties,(e=>{const t=getNameOfDeclaration(e);return!!t&&isIdentifier(t)&&idText(t)==="set"}))){i|=65536|4;o|=78783}if(some(e.arguments[2].properties,(e=>{const t=getNameOfDeclaration(e);return!!t&&isIdentifier(t)&&idText(t)==="get"}))){i|=32768|4;o|=46015}}if(i===0){i=4;o=0}declareSymbol(r,t,e,i|67108864,o&~67108864)}function isTopLevelNamespaceAssignment(e){return isBinaryExpression(e.parent)?getParentOfBinaryExpression(e.parent).parent.kind===307:e.parent.parent.kind===307}function bindPropertyAssignment(e,t,n,r){let o=lookupSymbolForPropertyAccess(e,a)||lookupSymbolForPropertyAccess(e,i);const s=isTopLevelNamespaceAssignment(t);o=bindPotentiallyMissingNamespaces(o,t.expression,s,n,r);bindPotentiallyNewExpandoMemberToNamespace(t,o,n)}function isExpandoSymbol(e){if(e.flags&(16|32|1024)){return true}const t=e.valueDeclaration;if(t&&isCallExpression(t)){return!!getAssignedExpandoInitializer(t)}let n=!t?void 0:isVariableDeclaration(t)?t.initializer:isBinaryExpression(t)?t.right:isPropertyAccessExpression(t)&&isBinaryExpression(t.parent)?t.parent.right:void 0;n=n&&getRightMostAssignedExpression(n);if(n){const e=isPrototypeAccess(isVariableDeclaration(t)?t.name:isBinaryExpression(t)?t.left:t);return!!getExpandoInitializer(isBinaryExpression(n)&&(n.operatorToken.kind===57||n.operatorToken.kind===61)?n.right:n,e)}return false}function getParentOfBinaryExpression(e){while(isBinaryExpression(e.parent)){e=e.parent}return e.parent}function lookupSymbolForPropertyAccess(e,t=i){if(isIdentifier(e)){return lookupSymbolForName(t,e.escapedText)}else{const t=lookupSymbolForPropertyAccess(e.expression);return t&&t.exports&&t.exports.get(getElementOrPropertyAccessName(e))}}function forEachIdentifierInEntityName(t,n,r){if(isExportsOrModuleExportsOrAlias(e,t)){return e.symbol}else if(isIdentifier(t)){return r(t,lookupSymbolForPropertyAccess(t),n)}else{const e=forEachIdentifierInEntityName(t.expression,n,r);const i=getNameOrArgument(t);if(isPrivateIdentifier(i)){S.fail("unexpected PrivateIdentifier")}return r(i,e&&e.exports&&e.exports.get(getElementOrPropertyAccessName(t)),e)}}function bindCallExpression(t){if(!e.commonJsModuleIndicator&&isRequireCall(t,false)){setCommonJsModuleIndicator(t)}}function bindClassLikeDeclaration(t){if(t.kind===263){bindBlockScopedDeclaration(t,32,899503)}else{const e=t.name?t.name.escapedText:"__class";bindAnonymousDeclaration(t,32,e);if(t.name){P.add(t.name.escapedText)}}const{symbol:n}=t;const r=createSymbol(4|4194304,"prototype");const i=n.exports.get(r.escapedName);if(i){if(t.name){setParent(t.name,t)}e.bindDiagnostics.push(createDiagnosticForNode2(i.declarations[0],wt.Duplicate_identifier_0,symbolName(r)))}n.exports.set(r.escapedName,r);r.parent=n}function bindEnumDeclaration(e){return isEnumConst(e)?bindBlockScopedDeclaration(e,128,899967):bindBlockScopedDeclaration(e,256,899327)}function bindVariableDeclarationOrBindingElement(e){if(E){checkStrictModeEvalOrArguments(e,e.name)}if(!isBindingPattern(e.name)){const t=e.kind===260?e:e.parent.parent;if(isInJSFile(e)&&isVariableDeclarationInitializedToBareOrAccessedRequire(t)&&!getJSDocTypeTag(e)&&!(getCombinedModifierFlags(e)&32)){declareSymbolAndAddToSymbolTable(e,2097152,2097152)}else if(isBlockOrCatchScoped(e)){bindBlockScopedDeclaration(e,2,111551)}else if(isPartOfParameterDeclaration(e)){declareSymbolAndAddToSymbolTable(e,1,111551)}else{declareSymbolAndAddToSymbolTable(e,1,111550)}}}function bindParameter(e){if(e.kind===341&&i.kind!==323){return}if(E&&!(e.flags&33554432)){checkStrictModeEvalOrArguments(e,e.name)}if(isBindingPattern(e.name)){bindAnonymousDeclaration(e,1,"__"+e.parent.parameters.indexOf(e))}else{declareSymbolAndAddToSymbolTable(e,1,111551)}if(isParameterPropertyDeclaration(e,e.parent)){const t=e.parent.parent;declareSymbol(t.symbol.members,t.symbol,e,4|(e.questionToken?16777216:0),0)}}function bindFunctionDeclaration(t){if(!e.isDeclarationFile&&!(t.flags&33554432)){if(isAsyncFunction(t)){C|=4096}}checkStrictModeFunctionName(t);if(E){checkStrictModeFunctionDeclaration(t);bindBlockScopedDeclaration(t,16,110991)}else{declareSymbolAndAddToSymbolTable(t,16,110991)}}function bindFunctionExpression(t){if(!e.isDeclarationFile&&!(t.flags&33554432)){if(isAsyncFunction(t)){C|=4096}}if(p){t.flowNode=p}checkStrictModeFunctionName(t);const n=t.name?t.name.escapedText:"__function";return bindAnonymousDeclaration(t,16,n)}function bindPropertyOrMethodOrAccessor(t,n,r){if(!e.isDeclarationFile&&!(t.flags&33554432)&&isAsyncFunction(t)){C|=4096}if(p&&isObjectLiteralOrClassExpressionMethodOrAccessor(t)){t.flowNode=p}return hasDynamicName(t)?bindAnonymousDeclaration(t,n,"__computed"):declareSymbolAndAddToSymbolTable(t,n,r)}function getInferTypeContainer(e){const t=findAncestor(e,(e=>e.parent&&isConditionalTypeNode(e.parent)&&e.parent.extendsType===e));return t&&t.parent}function bindTypeParameter(e){if(isJSDocTemplateTag(e.parent)){const t=getEffectiveContainerForJSDocTemplateTag(e.parent);if(t){S.assertNode(t,canHaveLocals);t.locals??(t.locals=createSymbolTable());declareSymbol(t.locals,void 0,e,262144,526824)}else{declareSymbolAndAddToSymbolTable(e,262144,526824)}}else if(e.parent.kind===195){const t=getInferTypeContainer(e.parent);if(t){S.assertNode(t,canHaveLocals);t.locals??(t.locals=createSymbolTable());declareSymbol(t.locals,void 0,e,262144,526824)}else{bindAnonymousDeclaration(e,262144,getDeclarationName(e))}}else{declareSymbolAndAddToSymbolTable(e,262144,526824)}}function shouldReportErrorOnModuleDeclaration(e){const n=getModuleInstanceState(e);return n===1||n===2&&er(t)}function checkUnreachable(e){if(!(p.flags&1)){return false}if(p===D){const n=isStatementButNotDeclaration(e)&&e.kind!==242||e.kind===263||isEnumDeclarationWithPreservedEmit(e,t)||e.kind===267&&shouldReportErrorOnModuleDeclaration(e);if(n){p=I;if(!t.allowUnreachableCode){const n=unreachableCodeIsError(t)&&!(e.flags&33554432)&&(!isVariableStatement(e)||!!(getCombinedNodeFlags(e.declarationList)&7)||e.declarationList.declarations.some((e=>!!e.initializer)));eachUnreachableRange(e,t,((e,t)=>errorOrSuggestionOnRange(n,e,t,wt.Unreachable_code_detected)))}}}return true}}function isEnumDeclarationWithPreservedEmit(e,t){return e.kind===266&&(!isEnumConst(e)||er(t))}function eachUnreachableRange(e,t,n){if(isStatement(e)&&isExecutableStatement(e)&&isBlock(e.parent)){const{statements:t}=e.parent;const r=sliceAfter(t,e);getRangesWhere(r,isExecutableStatement,((e,t)=>n(r[e],r[t-1])))}else{n(e,e)}function isExecutableStatement(e){return!isFunctionDeclaration(e)&&!isPurelyTypeDeclaration(e)&&!(isVariableStatement(e)&&!(getCombinedNodeFlags(e)&7)&&e.declarationList.declarations.some((e=>!e.initializer)))}function isPurelyTypeDeclaration(e){switch(e.kind){case 264:case 265:return true;case 267:return getModuleInstanceState(e)!==1;case 266:return!isEnumDeclarationWithPreservedEmit(e,t);default:return false}}}function isExportsOrModuleExportsOrAlias(e,t){let n=0;const r=createQueue();r.enqueue(t);while(!r.isEmpty()&&n<100){n++;t=r.dequeue();if(isExportsIdentifier(t)||isModuleExportsAccessExpression(t)){return true}else if(isIdentifier(t)){const n=lookupSymbolForName(e,t.escapedText);if(!!n&&!!n.valueDeclaration&&isVariableDeclaration(n.valueDeclaration)&&!!n.valueDeclaration.initializer){const e=n.valueDeclaration.initializer;r.enqueue(e);if(isAssignmentExpression(e,true)){r.enqueue(e.left);r.enqueue(e.right)}}}}return false}function getContainerFlags(e){switch(e.kind){case 231:case 263:case 266:case 210:case 187:case 322:case 292:return 1;case 264:return 1|64;case 267:case 265:case 200:case 181:return 1|32;case 307:return 1|4|32;case 177:case 178:case 174:if(isObjectLiteralOrClassExpressionMethodOrAccessor(e)){return 1|4|32|8|128}case 176:case 262:case 173:case 179:case 323:case 317:case 184:case 180:case 185:case 175:return 1|4|32|8;case 218:case 219:return 1|4|32|8|16;case 268:return 4;case 172:return e.initializer?4:0;case 299:case 248:case 249:case 250:case 269:return 2|32;case 241:return isFunctionLike(e.parent)||isClassStaticBlockDeclaration(e.parent)?0:2|32}return 0}function lookupSymbolForName(e,t){var n,r,i,o;const a=(r=(n=tryCast(e,canHaveLocals))==null?void 0:n.locals)==null?void 0:r.get(t);if(a){return a.exportSymbol??a}if(isSourceFile(e)&&e.jsGlobalAugmentations&&e.jsGlobalAugmentations.has(t)){return e.jsGlobalAugmentations.get(t)}if(canHaveSymbol(e)){return(o=(i=e.symbol)==null?void 0:i.exports)==null?void 0:o.get(t)}}function createGetSymbolWalker(e,t,n,r,i,o,a,s,c,l){return getSymbolWalker;function getSymbolWalker(d=(()=>true)){const p=[];const u=[];return{walkType:e=>{try{visitType(e);return{visitedTypes:getOwnValues(p),visitedSymbols:getOwnValues(u)}}finally{clear(p);clear(u)}},walkSymbol:e=>{try{visitSymbol(e);return{visitedTypes:getOwnValues(p),visitedSymbols:getOwnValues(u)}}finally{clear(p);clear(u)}}};function visitType(e){if(!e){return}if(p[e.id]){return}p[e.id]=e;const t=visitSymbol(e.symbol);if(t)return;if(e.flags&524288){const t=e;const n=t.objectFlags;if(n&4){visitTypeReference(e)}if(n&32){visitMappedType(e)}if(n&(1|2)){visitInterfaceType(e)}if(n&(8|16)){visitObjectType(t)}}if(e.flags&262144){visitTypeParameter(e)}if(e.flags&3145728){visitUnionOrIntersectionType(e)}if(e.flags&4194304){visitIndexType(e)}if(e.flags&8388608){visitIndexedAccessType(e)}}function visitTypeReference(e){visitType(e.target);forEach(l(e),visitType)}function visitTypeParameter(e){visitType(s(e))}function visitUnionOrIntersectionType(e){forEach(e.types,visitType)}function visitIndexType(e){visitType(e.type)}function visitIndexedAccessType(e){visitType(e.objectType);visitType(e.indexType);visitType(e.constraint)}function visitMappedType(e){visitType(e.typeParameter);visitType(e.constraintType);visitType(e.templateType);visitType(e.modifiersType)}function visitSignature(r){const i=t(r);if(i){visitType(i.type)}forEach(r.typeParameters,visitType);for(const e of r.parameters){visitSymbol(e)}visitType(e(r));visitType(n(r))}function visitInterfaceType(e){visitObjectType(e);forEach(e.typeParameters,visitType);forEach(r(e),visitType);visitType(e.thisType)}function visitObjectType(e){const t=i(e);for(const e of t.indexInfos){visitType(e.keyType);visitType(e.type)}for(const e of t.callSignatures){visitSignature(e)}for(const e of t.constructSignatures){visitSignature(e)}for(const e of t.properties){visitSymbol(e)}}function visitSymbol(e){if(!e){return false}const t=getSymbolId(e);if(u[t]){return false}u[t]=e;if(!d(e)){return true}const n=o(e);visitType(n);if(e.exports){e.exports.forEach(visitSymbol)}forEach(e.declarations,(e=>{if(e.type&&e.type.kind===186){const t=e.type;const n=a(c(t.exprName));visitSymbol(n)}}));return false}}}var Ho={};__export(Ho,{RelativePreference:()=>Ko,countPathComponents:()=>countPathComponents,forEachFileNameOfModule:()=>forEachFileNameOfModule,getLocalModuleSpecifierBetweenFileNames:()=>getLocalModuleSpecifierBetweenFileNames,getModuleSpecifier:()=>getModuleSpecifier,getModuleSpecifierPreferences:()=>getModuleSpecifierPreferences,getModuleSpecifiers:()=>getModuleSpecifiers,getModuleSpecifiersWithCacheInfo:()=>getModuleSpecifiersWithCacheInfo,getNodeModulesPackageName:()=>getNodeModulesPackageName,tryGetJSExtensionForFile:()=>tryGetJSExtensionForFile,tryGetModuleSpecifiersFromCache:()=>tryGetModuleSpecifiersFromCache,tryGetRealFileNameForNonJsDeclarationFileName:()=>tryGetRealFileNameForNonJsDeclarationFileName,updateModuleSpecifier:()=>updateModuleSpecifier});var Go=memoizeOne((e=>{try{let t=e.indexOf("/");if(t!==0){return new RegExp(e)}const n=e.lastIndexOf("/");if(t===n){return new RegExp(e)}while((t=e.indexOf("/",t+1))!==n){if(e[t-1]!=="\\"){return new RegExp(e)}}const r=e.substring(n+1).replace(/[^iu]/g,"");e=e.substring(1,n);return new RegExp(e,r)}catch{return void 0}}));var Ko=(e=>{e[e["Relative"]=0]="Relative";e[e["NonRelative"]=1]="NonRelative";e[e["Shortest"]=2]="Shortest";e[e["ExternalNonRelative"]=3]="ExternalNonRelative";return e})(Ko||{});function getModuleSpecifierPreferences({importModuleSpecifierPreference:e,importModuleSpecifierEnding:t,autoImportSpecifierExcludeRegexes:n},r,i,o,a){const s=getPreferredEnding();return{excludeRegexes:n,relativePreference:a!==void 0?isExternalModuleNameRelative(a)?0:1:e==="relative"?0:e==="non-relative"?1:e==="project-relative"?3:2,getAllowedEndingsInPreferredOrder:e=>{const t=getDefaultResolutionModeForFile(o,r,i);const n=e!==t?getPreferredEnding(e):s;const a=qn(i);if((e??t)===99&&3<=a&&a<=99){if(shouldAllowImportingTsExtension(i,o.fileName)){return[3,2]}return[2]}if(qn(i)===1){return n===2?[2,1]:[1,2]}const c=shouldAllowImportingTsExtension(i,o.fileName);switch(n){case 2:return c?[2,3,0,1]:[2,0,1];case 3:return[3,0,2,1];case 1:return c?[1,0,3,2]:[1,0,2];case 0:return c?[0,1,3,2]:[0,1,2];default:S.assertNever(n)}}};function getPreferredEnding(e){if(a!==void 0){if(hasJSFileExtension(a))return 2;if(endsWith(a,"/index"))return 1}return getModuleSpecifierEndingPreference(t,e??getDefaultResolutionModeForFile(o,r,i),i,isFullSourceFile(o)?o:void 0)}}function updateModuleSpecifier(e,t,n,r,i,o,a={}){const s=getModuleSpecifierWorker(e,t,n,r,i,getModuleSpecifierPreferences({},i,e,t,o),{},a);if(s===o)return void 0;return s}function getModuleSpecifier(e,t,n,r,i,o={}){return getModuleSpecifierWorker(e,t,n,r,i,getModuleSpecifierPreferences({},i,e,t),{},o)}function getNodeModulesPackageName(e,t,n,r,i,o={}){const a=getInfo(t.fileName,r);const s=getAllModulePaths(a,n,r,i,e,o);return firstDefined(s,(n=>tryGetModuleNameAsNodeModule(n,a,t,r,e,i,true,o.overrideImportMode)))}function getModuleSpecifierWorker(e,t,n,r,i,o,a,s={}){const c=getInfo(n,i);const l=getAllModulePaths(c,r,i,a,e,s);return firstDefined(l,(n=>tryGetModuleNameAsNodeModule(n,c,t,i,e,a,void 0,s.overrideImportMode)))||getLocalModuleSpecifier(r,c,e,i,s.overrideImportMode||getDefaultResolutionModeForFile(t,i,e),o)}function tryGetModuleSpecifiersFromCache(e,t,n,r,i={}){const o=tryGetModuleSpecifiersFromCacheWorker(e,t,n,r,i);return o[1]&&{kind:o[0],moduleSpecifiers:o[1],computedWithoutCache:false}}function tryGetModuleSpecifiersFromCacheWorker(e,t,n,r,i={}){var o;const a=getSourceFileOfModule(e);if(!a){return d}const s=(o=n.getModuleSpecifierCache)==null?void 0:o.call(n);const c=s==null?void 0:s.get(t.path,a.path,r,i);return[c==null?void 0:c.kind,c==null?void 0:c.moduleSpecifiers,a,c==null?void 0:c.modulePaths,s]}function getModuleSpecifiers(e,t,n,r,i,o,a={}){return getModuleSpecifiersWithCacheInfo(e,t,n,r,i,o,a,false).moduleSpecifiers}function getModuleSpecifiersWithCacheInfo(e,t,n,r,i,o,a={},s){let c=false;const l=tryGetModuleNameFromAmbientModule(e,t);if(l){return{kind:"ambient",moduleSpecifiers:!(s&&isExcludedByRegex(l,o.autoImportSpecifierExcludeRegexes))?[l]:d,computedWithoutCache:c}}let[p,u,f,m,_]=tryGetModuleSpecifiersFromCacheWorker(e,r,i,o,a);if(u)return{kind:p,moduleSpecifiers:u,computedWithoutCache:c};if(!f)return{kind:void 0,moduleSpecifiers:d,computedWithoutCache:c};c=true;m||(m=getAllModulePathsWorker(getInfo(r.fileName,i),f.originalFileName,i,n,a));const g=computeModuleSpecifiers(m,n,r,i,o,a,s);_==null?void 0:_.set(r.path,f.path,o,a,g.kind,m,g.moduleSpecifiers);return g}function getLocalModuleSpecifierBetweenFileNames(e,t,n,r,i,o={}){const a=getInfo(e.fileName,r);const s=o.overrideImportMode??e.impliedNodeFormat;return getLocalModuleSpecifier(t,a,n,r,s,getModuleSpecifierPreferences(i,r,n,e))}function computeModuleSpecifiers(e,t,n,r,i,o={},a){const s=getInfo(n.fileName,r);const c=getModuleSpecifierPreferences(i,r,t,n);const l=isFullSourceFile(n)&&forEach(e,(e=>forEach(r.getFileIncludeReasons().get(toPath(e.path,r.getCurrentDirectory(),s.getCanonicalFileName)),(e=>{if(e.kind!==3||e.file!==n.path)return void 0;const t=r.getModeForResolutionAtIndex(n,e.index);const i=o.overrideImportMode??r.getDefaultResolutionModeForFile(n);if(t!==i&&t!==void 0&&i!==void 0){return void 0}const a=getModuleNameStringLiteralAt(n,e.index).text;return c.relativePreference!==1||!pathIsRelative(a)?a:void 0}))));if(l){return{kind:void 0,moduleSpecifiers:[l],computedWithoutCache:true}}const p=some(e,(e=>e.isInNodeModules));let u;let f;let m;let _;for(const l of e){const e=l.isInNodeModules?tryGetModuleNameAsNodeModule(l,s,n,r,t,i,void 0,o.overrideImportMode):void 0;if(e&&!(a&&isExcludedByRegex(e,c.excludeRegexes))){u=append(u,e);if(l.isRedirect){return{kind:"node_modules",moduleSpecifiers:u,computedWithoutCache:true}}}const d=getLocalModuleSpecifier(l.path,s,t,r,o.overrideImportMode||n.impliedNodeFormat,c,l.isRedirect||!!e);if(!d||a&&isExcludedByRegex(d,c.excludeRegexes)){continue}if(l.isRedirect){m=append(m,d)}else if(pathIsBareSpecifier(d)){if(pathContainsNodeModules(d)){_=append(_,d)}else{f=append(f,d)}}else if(a||!p||l.isInNodeModules){_=append(_,d)}}return(f==null?void 0:f.length)?{kind:"paths",moduleSpecifiers:f,computedWithoutCache:true}:(m==null?void 0:m.length)?{kind:"redirect",moduleSpecifiers:m,computedWithoutCache:true}:(u==null?void 0:u.length)?{kind:"node_modules",moduleSpecifiers:u,computedWithoutCache:true}:{kind:"relative",moduleSpecifiers:_??d,computedWithoutCache:true}}function isExcludedByRegex(e,t){return some(t,(t=>{var n;return!!((n=Go(t))==null?void 0:n.test(e))}))}function getInfo(e,t){e=getNormalizedAbsolutePath(e,t.getCurrentDirectory());const n=createGetCanonicalFileName(t.useCaseSensitiveFileNames?t.useCaseSensitiveFileNames():true);const r=getDirectoryPath(e);return{getCanonicalFileName:n,importingSourceFileName:e,sourceDirectory:r,canonicalSourceDirectory:n(r)}}function getLocalModuleSpecifier(e,t,n,r,i,{getAllowedEndingsInPreferredOrder:o,relativePreference:a,excludeRegexes:s},c){const{baseUrl:l,paths:d,rootDirs:p}=n;if(c&&!d){return void 0}const{sourceDirectory:u,canonicalSourceDirectory:f,getCanonicalFileName:m}=t;const _=o(i);const g=p&&tryGetModuleNameFromRootDirs(p,e,u,m,_,n)||processEnding(ensurePathIsNonModuleName(getRelativePathFromDirectory(u,e,m)),_,n);if(!l&&!d&&!Xn(n)||a===0){return c?void 0:g}const y=getNormalizedAbsolutePath(getPathsBasePath(n,r)||l,r.getCurrentDirectory());const h=getRelativePathIfInSameVolume(e,y,m);if(!h){return c?void 0:g}const T=c?void 0:tryGetModuleNameFromPackageJsonImports(e,u,n,r,i,prefersTsExtension(_));const S=c||T===void 0?d&&tryGetModuleNameFromPaths(h,d,_,y,m,r,n):void 0;if(c){return S}const v=T??(S===void 0&&l!==void 0?processEnding(h,_,n):S);if(!v){return g}const x=isExcludedByRegex(g,s);const b=isExcludedByRegex(v,s);if(!x&&b){return g}if(x&&!b){return v}if(a===1&&!pathIsRelative(v)){return v}if(a===3&&!pathIsRelative(v)){const i=n.configFilePath?toPath(getDirectoryPath(n.configFilePath),r.getCurrentDirectory(),t.getCanonicalFileName):t.getCanonicalFileName(r.getCurrentDirectory());const o=toPath(e,i,m);const a=startsWith(f,i);const s=startsWith(o,i);if(a&&!s||!a&&s){return v}const c=getNearestAncestorDirectoryWithPackageJson(r,getDirectoryPath(o));const l=getNearestAncestorDirectoryWithPackageJson(r,u);const d=!hostUsesCaseSensitiveFileNames(r);if(!packageJsonPathsAreEqual(c,l,d)){return v}return g}return isPathRelativeToParent(v)||countPathComponents(g)e.fileExists(combinePaths(t,"package.json"))?t:void 0))}function forEachFileNameOfModule(e,t,n,r,i){var o;const a=hostGetCanonicalFileName(n);const s=n.getCurrentDirectory();const c=n.isSourceOfProjectReferenceRedirect(t)?n.getProjectReferenceRedirect(t):void 0;const l=toPath(t,s,a);const p=n.redirectTargetsMap.get(l)||d;const u=[...c?[c]:d,t,...p];const f=u.map((e=>getNormalizedAbsolutePath(e,s)));let m=!every(f,containsIgnoredPath);if(!r){const e=forEach(f,(e=>!(m&&containsIgnoredPath(e))&&i(e,c===e)));if(e)return e}const _=(o=n.getSymlinkCache)==null?void 0:o.call(n).getSymlinkedDirectoriesByRealpath();const g=getNormalizedAbsolutePath(t,s);const y=_&&forEachAncestorDirectoryStoppingAtGlobalCache(n,getDirectoryPath(g),(t=>{const n=_.get(ensureTrailingDirectorySeparator(toPath(t,s,a)));if(!n)return void 0;if(startsWithDirectory(e,t,a)){return false}return forEach(f,(e=>{if(!startsWithDirectory(e,t,a)){return}const r=getRelativePathFromDirectory(t,e,a);for(const t of n){const n=resolvePath(t,r);const o=i(n,e===c);m=true;if(o)return o}}))}));return y||(r?forEach(f,(e=>m&&containsIgnoredPath(e)?void 0:i(e,e===c))):void 0)}function getAllModulePaths(e,t,n,r,i,o={}){var a;const s=toPath(e.importingSourceFileName,n.getCurrentDirectory(),hostGetCanonicalFileName(n));const c=toPath(t,n.getCurrentDirectory(),hostGetCanonicalFileName(n));const l=(a=n.getModuleSpecifierCache)==null?void 0:a.call(n);if(l){const e=l.get(s,c,r,o);if(e==null?void 0:e.modulePaths)return e.modulePaths}const d=getAllModulePathsWorker(e,t,n,i,o);if(l){l.setModulePaths(s,c,r,o,d)}return d}var $o=["dependencies","peerDependencies","optionalDependencies"];function getAllRuntimeDependencies(e){let t;for(const n of $o){const r=e[n];if(r&&typeof r==="object"){t=concatenate(t,getOwnKeys(r))}}return t}function getAllModulePathsWorker(e,t,n,r,i){var o,a;const s=(o=n.getModuleResolutionCache)==null?void 0:o.call(n);const c=(a=n.getSymlinkCache)==null?void 0:a.call(n);if(s&&c&&n.readFile&&!pathContainsNodeModules(e.importingSourceFileName)){S.type(n);const t=getTemporaryModuleResolutionState(s.getPackageJsonInfoCache(),n,{});const o=getPackageScopeForPath(getDirectoryPath(e.importingSourceFileName),t);if(o){const e=getAllRuntimeDependencies(o.contents.packageJsonContent);for(const t of e||d){const e=resolveModuleName(t,combinePaths(o.packageDirectory,"package.json"),r,n,s,void 0,i.overrideImportMode);c.setSymlinksFromResolution(e.resolvedModule)}}}const l=new Map;let p=false;forEachFileNameOfModule(e.importingSourceFileName,t,n,true,((t,n)=>{const r=pathContainsNodeModules(t);l.set(t,{path:e.getCanonicalFileName(t),isRedirect:n,isInNodeModules:r});p=p||r}));const u=[];for(let t=e.canonicalSourceDirectory;l.size!==0;){const e=ensureTrailingDirectorySeparator(t);let n;l.forEach((({path:t,isRedirect:r,isInNodeModules:i},o)=>{if(startsWith(t,e)){(n||(n=[])).push({path:o,isRedirect:r,isInNodeModules:i});l.delete(o)}}));if(n){if(n.length>1){n.sort(comparePathsByRedirectAndNumberOfDirectorySeparators)}u.push(...n)}const r=getDirectoryPath(t);if(r===t)break;t=r}if(l.size){const e=arrayFrom(l.entries(),(([e,{isRedirect:t,isInNodeModules:n}])=>({path:e,isRedirect:t,isInNodeModules:n})));if(e.length>1)e.sort(comparePathsByRedirectAndNumberOfDirectorySeparators);u.push(...e)}return u}function tryGetModuleNameFromAmbientModule(e,t){var n;const r=(n=e.declarations)==null?void 0:n.find((e=>isNonGlobalAmbientModule(e)&&(!isExternalModuleAugmentation(e)||!isExternalModuleNameRelative(getTextOfIdentifierOrLiteral(e.name)))));if(r){return r.name.text}const i=mapDefined(e.declarations,(e=>{var n,r,i,o;if(!isModuleDeclaration(e))return;const a=getTopNamespace(e);if(!(((n=a==null?void 0:a.parent)==null?void 0:n.parent)&&isModuleBlock(a.parent)&&isAmbientModule(a.parent.parent)&&isSourceFile(a.parent.parent.parent)))return;const s=(o=(i=(r=a.parent.parent.symbol.exports)==null?void 0:r.get("export="))==null?void 0:i.valueDeclaration)==null?void 0:o.expression;if(!s)return;const c=t.getSymbolAtLocation(s);if(!c)return;const l=(c==null?void 0:c.flags)&2097152?t.getAliasedSymbol(c):c;if(l===e.symbol)return a.parent.parent;function getTopNamespace(e){while(e.flags&8){e=e.parent}return e}}));const o=i[0];if(o){return o.name.text}}function tryGetModuleNameFromPaths(e,t,n,r,i,o,a){for(const o in t){for(const s of t[o]){const t=normalizePath(s);const c=getRelativePathIfInSameVolume(t,r,i)??t;const l=c.indexOf("*");const d=n.map((t=>({ending:t,value:processEnding(e,[t],a)})));if(tryGetExtensionFromPath2(c)){d.push({ending:void 0,value:e})}if(l!==-1){const e=c.substring(0,l);const t=c.substring(l+1);for(const{ending:n,value:r}of d){if(r.length>=e.length+t.length&&startsWith(r,e)&&endsWith(r,t)&&validateEnding({ending:n,value:r})){const n=r.substring(e.length,r.length-t.length);if(!pathIsRelative(n)){return replaceFirstStar(o,n)}}}}else if(some(d,(e=>e.ending!==0&&c===e.value))||some(d,(e=>e.ending===0&&c===e.value&&validateEnding(e)))){return o}}}function validateEnding({ending:t,value:n}){return t!==0||n===processEnding(e,[t],a,o)}}function tryGetModuleNameFromExportsOrImports(e,t,n,r,i,o,a,s,c,l){if(typeof o==="string"){const a=!hostUsesCaseSensitiveFileNames(t);const getCommonSourceDirectory2=()=>t.getCommonSourceDirectory();const d=c&&getOutputJSFileNameWorker(n,e,a,getCommonSourceDirectory2);const p=c&&getOutputDeclarationFileNameWorker(n,e,a,getCommonSourceDirectory2);const u=getNormalizedAbsolutePath(combinePaths(r,o),void 0);const f=hasTSFileExtension(n)?removeFileExtension(n)+tryGetJSExtensionForFile(n,e):void 0;const m=l&&hasImplementationTSFileExtension(n);switch(s){case 0:if(f&&comparePaths(f,u,a)===0||comparePaths(n,u,a)===0||d&&comparePaths(d,u,a)===0||p&&comparePaths(p,u,a)===0){return{moduleFileToTry:i}}break;case 1:if(m&&containsPath(n,u,a)){const e=getRelativePathFromDirectory(u,n,false);return{moduleFileToTry:getNormalizedAbsolutePath(combinePaths(combinePaths(i,o),e),void 0)}}if(f&&containsPath(u,f,a)){const e=getRelativePathFromDirectory(u,f,false);return{moduleFileToTry:getNormalizedAbsolutePath(combinePaths(combinePaths(i,o),e),void 0)}}if(!m&&containsPath(u,n,a)){const e=getRelativePathFromDirectory(u,n,false);return{moduleFileToTry:getNormalizedAbsolutePath(combinePaths(combinePaths(i,o),e),void 0)}}if(d&&containsPath(u,d,a)){const e=getRelativePathFromDirectory(u,d,false);return{moduleFileToTry:combinePaths(i,e)}}if(p&&containsPath(u,p,a)){const t=changeFullExtension(getRelativePathFromDirectory(u,p,false),getJSExtensionForFile(p,e));return{moduleFileToTry:combinePaths(i,t)}}break;case 2:const t=u.indexOf("*");const r=u.slice(0,t);const s=u.slice(t+1);if(m&&startsWith(n,r,a)&&endsWith(n,s,a)){const e=n.slice(r.length,n.length-s.length);return{moduleFileToTry:replaceFirstStar(i,e)}}if(f&&startsWith(f,r,a)&&endsWith(f,s,a)){const e=f.slice(r.length,f.length-s.length);return{moduleFileToTry:replaceFirstStar(i,e)}}if(!m&&startsWith(n,r,a)&&endsWith(n,s,a)){const e=n.slice(r.length,n.length-s.length);return{moduleFileToTry:replaceFirstStar(i,e)}}if(d&&startsWith(d,r,a)&&endsWith(d,s,a)){const e=d.slice(r.length,d.length-s.length);return{moduleFileToTry:replaceFirstStar(i,e)}}if(p&&startsWith(p,r,a)&&endsWith(p,s,a)){const t=p.slice(r.length,p.length-s.length);const n=replaceFirstStar(i,t);const o=tryGetJSExtensionForFile(p,e);return o?{moduleFileToTry:changeFullExtension(n,o)}:void 0}break}}else if(Array.isArray(o)){return forEach(o,(o=>tryGetModuleNameFromExportsOrImports(e,t,n,r,i,o,a,s,c,l)))}else if(typeof o==="object"&&o!==null){for(const d of getOwnKeys(o)){if(d==="default"||a.indexOf(d)>=0||isApplicableVersionedTypesKey(a,d)){const p=o[d];const u=tryGetModuleNameFromExportsOrImports(e,t,n,r,i,p,a,s,c,l);if(u){return u}}}}return void 0}function tryGetModuleNameFromExports(e,t,n,r,i,o,a){if(typeof o==="object"&&o!==null&&!Array.isArray(o)&&allKeysStartWithDot(o)){return forEach(getOwnKeys(o),(s=>{const c=getNormalizedAbsolutePath(combinePaths(i,s),void 0);const l=endsWith(s,"/")?1:s.includes("*")?2:0;return tryGetModuleNameFromExportsOrImports(e,t,n,r,c,o[s],a,l,false,false)}))}return tryGetModuleNameFromExportsOrImports(e,t,n,r,i,o,a,0,false,false)}function tryGetModuleNameFromPackageJsonImports(e,t,n,r,i,o){var a,s,c;if(!r.readFile||!Xn(n)){return void 0}const l=getNearestAncestorDirectoryWithPackageJson(r,t);if(!l){return void 0}const d=combinePaths(l,"package.json");const p=(s=(a=r.getPackageJsonInfoCache)==null?void 0:a.call(r))==null?void 0:s.getPackageJsonInfo(d);if(isMissingPackageJsonInfo(p)||!r.fileExists(d)){return void 0}const u=(p==null?void 0:p.contents.packageJsonContent)||tryParseJson(r.readFile(d));const f=u==null?void 0:u.imports;if(!f){return void 0}const m=getConditions(n,i);return(c=forEach(getOwnKeys(f),(t=>{if(!startsWith(t,"#")||t==="#"||startsWith(t,"#/"))return void 0;const i=endsWith(t,"/")?1:t.includes("*")?2:0;return tryGetModuleNameFromExportsOrImports(n,r,e,l,t,f[t],m,i,true,o)})))==null?void 0:c.moduleFileToTry}function tryGetModuleNameFromRootDirs(e,t,n,r,i,o){const a=getPathsRelativeToRootDirs(t,e,r);if(a===void 0){return void 0}const s=getPathsRelativeToRootDirs(n,e,r);const c=flatMap(s,(e=>map(a,(t=>ensurePathIsNonModuleName(getRelativePathFromDirectory(e,t,r))))));const l=min(c,compareNumberOfDirectorySeparators);if(!l){return void 0}return processEnding(l,i,o)}function tryGetModuleNameAsNodeModule({path:e,isRedirect:t},{getCanonicalFileName:n,canonicalSourceDirectory:r},i,o,a,s,c,l){if(!o.fileExists||!o.readFile){return void 0}const d=getNodeModulePathParts(e);if(!d){return void 0}const p=getModuleSpecifierPreferences(s,o,a,i);const u=p.getAllowedEndingsInPreferredOrder();let f=e;let m=false;if(!c){let t=d.packageRootIndex;let n;while(true){const{moduleFileToTry:r,packageRootPath:i,blockedByExports:s,verbatimFromExports:c}=tryDirectoryWithPackageJson(t);if(qn(a)!==1){if(s){return void 0}if(c){return r}}if(i){f=i;m=true;break}if(!n)n=r;t=e.indexOf(Pt,t+1);if(t===-1){f=processEnding(n,u,a,o);break}}}if(t&&!m){return void 0}const _=o.getGlobalTypingsCacheLocation&&o.getGlobalTypingsCacheLocation();const g=n(f.substring(0,d.topLevelNodeModulesIndex));if(!(startsWith(r,g)||_&&startsWith(n(_),g))){return void 0}const y=f.substring(d.topLevelPackageNameIndex+1);const h=getPackageNameFromTypesPackageName(y);return qn(a)===1&&h===y?void 0:h;function tryDirectoryWithPackageJson(t){var r,s;const c=e.substring(0,t);const p=combinePaths(c,"package.json");let f=e;let m=false;const _=(s=(r=o.getPackageJsonInfoCache)==null?void 0:r.call(o))==null?void 0:s.getPackageJsonInfo(p);if(isPackageJsonInfo(_)||_===void 0&&o.fileExists(p)){const t=(_==null?void 0:_.contents.packageJsonContent)||tryParseJson(o.readFile(p));const r=l||getDefaultResolutionModeForFile(i,o,a);if(Qn(a)){const n=c.substring(d.topLevelPackageNameIndex+1);const i=getPackageNameFromTypesPackageName(n);const s=getConditions(a,r);const l=(t==null?void 0:t.exports)?tryGetModuleNameFromExports(a,o,e,c,i,t.exports,s):void 0;if(l){return{...l,verbatimFromExports:true}}if(t==null?void 0:t.exports){return{moduleFileToTry:e,blockedByExports:true}}}const s=(t==null?void 0:t.typesVersions)?getPackageJsonTypesVersionsPaths(t.typesVersions):void 0;if(s){const t=e.slice(c.length+1);const r=tryGetModuleNameFromPaths(t,s.paths,u,c,n,o,a);if(r===void 0){m=true}else{f=combinePaths(c,r)}}const g=(t==null?void 0:t.typings)||(t==null?void 0:t.types)||(t==null?void 0:t.main)||"index.js";if(isString(g)&&!(m&&matchPatternOrExact(tryParsePatterns(s.paths),g))){const e=toPath(g,c,n);const r=n(f);if(removeFileExtension(e)===removeFileExtension(r)){return{packageRootPath:c,moduleFileToTry:f}}else if((t==null?void 0:t.type)!=="module"&&!fileExtensionIsOneOf(r,Cr)&&startsWith(r,e)&&getDirectoryPath(r)===removeTrailingDirectorySeparator(e)&&removeFileExtension(getBaseFileName(r))==="index"){return{packageRootPath:c,moduleFileToTry:f}}}}else{const e=n(f.substring(d.packageRootIndex+1));if(e==="index.d.ts"||e==="index.js"||e==="index.ts"||e==="index.tsx"){return{moduleFileToTry:f,packageRootPath:c}}}return{moduleFileToTry:f}}}function tryGetAnyFileFromPath(e,t){if(!e.fileExists)return;const n=flatten(getSupportedExtensions({allowJs:true},[{extension:"node",isMixedContent:false},{extension:"json",isMixedContent:false,scriptKind:6}]));for(const r of n){const n=t+r;if(e.fileExists(n)){return n}}}function getPathsRelativeToRootDirs(e,t,n){return mapDefined(t,(t=>{const r=getRelativePathIfInSameVolume(e,t,n);return r!==void 0&&isPathRelativeToParent(r)?void 0:r}))}function processEnding(e,t,n,r){if(fileExtensionIsOneOf(e,[".json",".mjs",".cjs"])){return e}const i=removeFileExtension(e);if(e===i){return e}const o=t.indexOf(2);const a=t.indexOf(3);if(fileExtensionIsOneOf(e,[".mts",".cts"])&&a!==-1&&ae===0||e===1));return r!==-1&&r-1&&t{e[e["None"]=0]="None";e[e["TypeofEQString"]=1]="TypeofEQString";e[e["TypeofEQNumber"]=2]="TypeofEQNumber";e[e["TypeofEQBigInt"]=4]="TypeofEQBigInt";e[e["TypeofEQBoolean"]=8]="TypeofEQBoolean";e[e["TypeofEQSymbol"]=16]="TypeofEQSymbol";e[e["TypeofEQObject"]=32]="TypeofEQObject";e[e["TypeofEQFunction"]=64]="TypeofEQFunction";e[e["TypeofEQHostObject"]=128]="TypeofEQHostObject";e[e["TypeofNEString"]=256]="TypeofNEString";e[e["TypeofNENumber"]=512]="TypeofNENumber";e[e["TypeofNEBigInt"]=1024]="TypeofNEBigInt";e[e["TypeofNEBoolean"]=2048]="TypeofNEBoolean";e[e["TypeofNESymbol"]=4096]="TypeofNESymbol";e[e["TypeofNEObject"]=8192]="TypeofNEObject";e[e["TypeofNEFunction"]=16384]="TypeofNEFunction";e[e["TypeofNEHostObject"]=32768]="TypeofNEHostObject";e[e["EQUndefined"]=65536]="EQUndefined";e[e["EQNull"]=131072]="EQNull";e[e["EQUndefinedOrNull"]=262144]="EQUndefinedOrNull";e[e["NEUndefined"]=524288]="NEUndefined";e[e["NENull"]=1048576]="NENull";e[e["NEUndefinedOrNull"]=2097152]="NEUndefinedOrNull";e[e["Truthy"]=4194304]="Truthy";e[e["Falsy"]=8388608]="Falsy";e[e["IsUndefined"]=16777216]="IsUndefined";e[e["IsNull"]=33554432]="IsNull";e[e["IsUndefinedOrNull"]=50331648]="IsUndefinedOrNull";e[e["All"]=134217727]="All";e[e["BaseStringStrictFacts"]=3735041]="BaseStringStrictFacts";e[e["BaseStringFacts"]=12582401]="BaseStringFacts";e[e["StringStrictFacts"]=16317953]="StringStrictFacts";e[e["StringFacts"]=16776705]="StringFacts";e[e["EmptyStringStrictFacts"]=12123649]="EmptyStringStrictFacts";e[e["EmptyStringFacts"]=12582401]="EmptyStringFacts";e[e["NonEmptyStringStrictFacts"]=7929345]="NonEmptyStringStrictFacts";e[e["NonEmptyStringFacts"]=16776705]="NonEmptyStringFacts";e[e["BaseNumberStrictFacts"]=3734786]="BaseNumberStrictFacts";e[e["BaseNumberFacts"]=12582146]="BaseNumberFacts";e[e["NumberStrictFacts"]=16317698]="NumberStrictFacts";e[e["NumberFacts"]=16776450]="NumberFacts";e[e["ZeroNumberStrictFacts"]=12123394]="ZeroNumberStrictFacts";e[e["ZeroNumberFacts"]=12582146]="ZeroNumberFacts";e[e["NonZeroNumberStrictFacts"]=7929090]="NonZeroNumberStrictFacts";e[e["NonZeroNumberFacts"]=16776450]="NonZeroNumberFacts";e[e["BaseBigIntStrictFacts"]=3734276]="BaseBigIntStrictFacts";e[e["BaseBigIntFacts"]=12581636]="BaseBigIntFacts";e[e["BigIntStrictFacts"]=16317188]="BigIntStrictFacts";e[e["BigIntFacts"]=16775940]="BigIntFacts";e[e["ZeroBigIntStrictFacts"]=12122884]="ZeroBigIntStrictFacts";e[e["ZeroBigIntFacts"]=12581636]="ZeroBigIntFacts";e[e["NonZeroBigIntStrictFacts"]=7928580]="NonZeroBigIntStrictFacts";e[e["NonZeroBigIntFacts"]=16775940]="NonZeroBigIntFacts";e[e["BaseBooleanStrictFacts"]=3733256]="BaseBooleanStrictFacts";e[e["BaseBooleanFacts"]=12580616]="BaseBooleanFacts";e[e["BooleanStrictFacts"]=16316168]="BooleanStrictFacts";e[e["BooleanFacts"]=16774920]="BooleanFacts";e[e["FalseStrictFacts"]=12121864]="FalseStrictFacts";e[e["FalseFacts"]=12580616]="FalseFacts";e[e["TrueStrictFacts"]=7927560]="TrueStrictFacts";e[e["TrueFacts"]=16774920]="TrueFacts";e[e["SymbolStrictFacts"]=7925520]="SymbolStrictFacts";e[e["SymbolFacts"]=16772880]="SymbolFacts";e[e["ObjectStrictFacts"]=7888800]="ObjectStrictFacts";e[e["ObjectFacts"]=16736160]="ObjectFacts";e[e["FunctionStrictFacts"]=7880640]="FunctionStrictFacts";e[e["FunctionFacts"]=16728e3]="FunctionFacts";e[e["VoidFacts"]=9830144]="VoidFacts";e[e["UndefinedFacts"]=26607360]="UndefinedFacts";e[e["NullFacts"]=42917664]="NullFacts";e[e["EmptyObjectStrictFacts"]=83427327]="EmptyObjectStrictFacts";e[e["EmptyObjectFacts"]=83886079]="EmptyObjectFacts";e[e["UnknownFacts"]=83886079]="UnknownFacts";e[e["AllTypeofNE"]=556800]="AllTypeofNE";e[e["OrFactsMask"]=8256]="OrFactsMask";e[e["AndFactsMask"]=134209471]="AndFactsMask";return e})(na||{});var ra=new Map(Object.entries({string:256,number:512,bigint:1024,boolean:2048,symbol:4096,undefined:524288,object:8192,function:16384}));var ia=(e=>{e[e["Normal"]=0]="Normal";e[e["Contextual"]=1]="Contextual";e[e["Inferential"]=2]="Inferential";e[e["SkipContextSensitive"]=4]="SkipContextSensitive";e[e["SkipGenericFunctions"]=8]="SkipGenericFunctions";e[e["IsForSignatureHelp"]=16]="IsForSignatureHelp";e[e["RestBindingElement"]=32]="RestBindingElement";e[e["TypeOnly"]=64]="TypeOnly";return e})(ia||{});var oa=(e=>{e[e["None"]=0]="None";e[e["BivariantCallback"]=1]="BivariantCallback";e[e["StrictCallback"]=2]="StrictCallback";e[e["IgnoreReturnTypes"]=4]="IgnoreReturnTypes";e[e["StrictArity"]=8]="StrictArity";e[e["StrictTopSignature"]=16]="StrictTopSignature";e[e["Callback"]=3]="Callback";return e})(oa||{});var aa=and(isNotOverload,isNotAccessor);var sa=new Map(Object.entries({Uppercase:0,Lowercase:1,Capitalize:2,Uncapitalize:3,NoInfer:4}));var ca=class{};function NodeLinks(){this.flags=0}function getNodeId(e){if(!e.id){e.id=Zo;Zo++}return e.id}function getSymbolId(e){if(!e.id){e.id=Yo;Yo++}return e.id}function isInstantiatedModule(e,t){const n=getModuleInstanceState(e);return n===1||t&&n===2}function createTypeChecker(e){var t=[];var addLazyDiagnostic=e=>{t.push(e)};var n;var r;var i=Rn.getSymbolConstructor();var o=Rn.getTypeConstructor();var a=Rn.getSignatureConstructor();var s=0;var c=0;var l=0;var p=0;var u=0;var f=0;var m;var _;var g=false;var y=createSymbolTable();var h=[1];var T=e.getCompilerOptions();var v=zn(T);var x=Vn(T);var b=!!T.experimentalDecorators;var C=ir(T);var E=getEmitStandardClassFields(T);var N=$n(T);var k=getStrictOptionValue(T,"strictNullChecks");var F=getStrictOptionValue(T,"strictFunctionTypes");var P=getStrictOptionValue(T,"strictBindCallApply");var D=getStrictOptionValue(T,"strictPropertyInitialization");var I=getStrictOptionValue(T,"strictBuiltinIteratorReturn");var A=getStrictOptionValue(T,"noImplicitAny");var O=getStrictOptionValue(T,"noImplicitThis");var w=getStrictOptionValue(T,"useUnknownInCatchVariables");var L=T.exactOptionalPropertyTypes;var M=!!T.noUncheckedSideEffectImports;var R=createCheckBinaryExpression();var B=createResolver();var j=createNodeBuilder();var J=createSyntacticTypeNodeBuilder(T,j.syntacticBuilderResolver);var W=createEvaluator({evaluateElementAccessExpression:evaluateElementAccessExpression,evaluateEntityNameExpression:evaluateEntityNameExpression});var U=createSymbolTable();var z=createSymbol(4,"undefined");z.declarations=[];var V=createSymbol(1536,"globalThis",8);V.exports=U;V.declarations=[];U.set(V.escapedName,V);var q=createSymbol(4,"arguments");var H=createSymbol(4,"require");var K=T.verbatimModuleSyntax?"verbatimModuleSyntax":"isolatedModules";var $=!T.verbatimModuleSyntax;var Q;var X;var Y=0;var Z;var ee=0;var te=createNameResolver({compilerOptions:T,requireSymbol:H,argumentsSymbol:q,globals:U,getSymbolOfDeclaration:getSymbolOfDeclaration,error:error2,getRequiresScopeChangeCache:getRequiresScopeChangeCache,setRequiresScopeChangeCache:setRequiresScopeChangeCache,lookup:getSymbol2,onPropertyWithInvalidInitializer:checkAndReportErrorForInvalidInitializer,onFailedToResolveSymbol:onFailedToResolveSymbol,onSuccessfullyResolvedSymbol:onSuccessfullyResolvedSymbol});var ne=createNameResolver({compilerOptions:T,requireSymbol:H,argumentsSymbol:q,globals:U,getSymbolOfDeclaration:getSymbolOfDeclaration,error:error2,getRequiresScopeChangeCache:getRequiresScopeChangeCache,setRequiresScopeChangeCache:setRequiresScopeChangeCache,lookup:getSuggestionForSymbolNameLookup});const re={getNodeCount:()=>reduceLeft(e.getSourceFiles(),((e,t)=>e+t.nodeCount),0),getIdentifierCount:()=>reduceLeft(e.getSourceFiles(),((e,t)=>e+t.identifierCount),0),getSymbolCount:()=>reduceLeft(e.getSourceFiles(),((e,t)=>e+t.symbolCount),c),getTypeCount:()=>s,getInstantiationCount:()=>l,getRelationCacheSizes:()=>({assignable:bi.size,identity:Ei.size,subtype:vi.size,strictSubtype:xi.size}),isUndefinedSymbol:e=>e===z,isArgumentsSymbol:e=>e===q,isUnknownSymbol:e=>e===xe,getMergedSymbol:getMergedSymbol,symbolIsValue:symbolIsValue,getDiagnostics:getDiagnostics2,getGlobalDiagnostics:getGlobalDiagnostics,getRecursionIdentity:getRecursionIdentity,getUnmatchedProperties:getUnmatchedProperties,getTypeOfSymbolAtLocation:(e,t)=>{const n=getParseTreeNode(t);return n?getTypeOfSymbolAtLocation(e,n):Ie},getTypeOfSymbol:getTypeOfSymbol,getSymbolsOfParameterPropertyDeclaration:(e,t)=>{const n=getParseTreeNode(e,isParameter);if(n===void 0)return S.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node.");S.assert(isParameterPropertyDeclaration(n,n.parent));return getSymbolsOfParameterPropertyDeclaration(n,escapeLeadingUnderscores(t))},getDeclaredTypeOfSymbol:getDeclaredTypeOfSymbol,getPropertiesOfType:getPropertiesOfType,getPropertyOfType:(e,t)=>getPropertyOfType(e,escapeLeadingUnderscores(t)),getPrivateIdentifierPropertyOfType:(e,t,n)=>{const r=getParseTreeNode(n);if(!r){return void 0}const i=escapeLeadingUnderscores(t);const o=lookupSymbolForPrivateIdentifierDeclaration(i,r);return o?getPrivateIdentifierPropertyOfType(e,o):void 0},getTypeOfPropertyOfType:(e,t)=>getTypeOfPropertyOfType(e,escapeLeadingUnderscores(t)),getIndexInfoOfType:(e,t)=>getIndexInfoOfType(e,t===0?ze:Ve),getIndexInfosOfType:getIndexInfosOfType,getIndexInfosOfIndexSymbol:getIndexInfosOfIndexSymbol,getSignaturesOfType:getSignaturesOfType,getIndexTypeOfType:(e,t)=>getIndexTypeOfType(e,t===0?ze:Ve),getIndexType:e=>getIndexType(e),getBaseTypes:getBaseTypes,getBaseTypeOfLiteralType:getBaseTypeOfLiteralType,getWidenedType:getWidenedType,getWidenedLiteralType:getWidenedLiteralType,fillMissingTypeArguments:fillMissingTypeArguments,getTypeFromTypeNode:e=>{const t=getParseTreeNode(e,isTypeNode);return t?getTypeFromTypeNode(t):Ie},getParameterType:getTypeAtPosition,getParameterIdentifierInfoAtPosition:getParameterIdentifierInfoAtPosition,getPromisedTypeOfPromise:getPromisedTypeOfPromise,getAwaitedType:e=>getAwaitedType(e),getReturnTypeOfSignature:getReturnTypeOfSignature,isNullableType:isNullableType,getNullableType:getNullableType,getNonNullableType:getNonNullableType,getNonOptionalType:removeOptionalTypeMarker,getTypeArguments:getTypeArguments,typeToTypeNode:j.typeToTypeNode,typePredicateToTypePredicateNode:j.typePredicateToTypePredicateNode,indexInfoToIndexSignatureDeclaration:j.indexInfoToIndexSignatureDeclaration,signatureToSignatureDeclaration:j.signatureToSignatureDeclaration,symbolToEntityName:j.symbolToEntityName,symbolToExpression:j.symbolToExpression,symbolToNode:j.symbolToNode,symbolToTypeParameterDeclarations:j.symbolToTypeParameterDeclarations,symbolToParameterDeclaration:j.symbolToParameterDeclaration,typeParameterToDeclaration:j.typeParameterToDeclaration,getSymbolsInScope:(e,t)=>{const n=getParseTreeNode(e);return n?getSymbolsInScope(n,t):[]},getSymbolAtLocation:e=>{const t=getParseTreeNode(e);return t?getSymbolAtLocation(t,true):void 0},getIndexInfosAtLocation:e=>{const t=getParseTreeNode(e);return t?getIndexInfosAtLocation(t):void 0},getShorthandAssignmentValueSymbol:e=>{const t=getParseTreeNode(e);return t?getShorthandAssignmentValueSymbol(t):void 0},getExportSpecifierLocalTargetSymbol:e=>{const t=getParseTreeNode(e,isExportSpecifier);return t?getExportSpecifierLocalTargetSymbol(t):void 0},getExportSymbolOfSymbol(e){return getMergedSymbol(e.exportSymbol||e)},getTypeAtLocation:e=>{const t=getParseTreeNode(e);return t?getTypeOfNode(t):Ie},getTypeOfAssignmentPattern:e=>{const t=getParseTreeNode(e,isAssignmentPattern);return t&&getTypeOfAssignmentPattern(t)||Ie},getPropertySymbolOfDestructuringAssignment:e=>{const t=getParseTreeNode(e,isIdentifier);return t?getPropertySymbolOfDestructuringAssignment(t):void 0},signatureToString:(e,t,n,r)=>signatureToString(e,getParseTreeNode(t),n,r),typeToString:(e,t,n)=>typeToString(e,getParseTreeNode(t),n),symbolToString:(e,t,n,r)=>symbolToString(e,getParseTreeNode(t),n,r),typePredicateToString:(e,t,n)=>typePredicateToString(e,getParseTreeNode(t),n),writeSignature:(e,t,n,r,i)=>signatureToString(e,getParseTreeNode(t),n,r,i),writeType:(e,t,n,r)=>typeToString(e,getParseTreeNode(t),n,r),writeSymbol:(e,t,n,r,i)=>symbolToString(e,getParseTreeNode(t),n,r,i),writeTypePredicate:(e,t,n,r)=>typePredicateToString(e,getParseTreeNode(t),n,r),getAugmentedPropertiesOfType:getAugmentedPropertiesOfType,getRootSymbols:getRootSymbols,getSymbolOfExpando:getSymbolOfExpando,getContextualType:(e,t)=>{const n=getParseTreeNode(e,isExpression);if(!n){return void 0}if(t&4){return runWithInferenceBlockedFromSourceNode(n,(()=>getContextualType2(n,t)))}return getContextualType2(n,t)},getContextualTypeForObjectLiteralElement:e=>{const t=getParseTreeNode(e,isObjectLiteralElementLike);return t?getContextualTypeForObjectLiteralElement(t,void 0):void 0},getContextualTypeForArgumentAtIndex:(e,t)=>{const n=getParseTreeNode(e,isCallLikeExpression);return n&&getContextualTypeForArgumentAtIndex(n,t)},getContextualTypeForJsxAttribute:e=>{const t=getParseTreeNode(e,isJsxAttributeLike);return t&&getContextualTypeForJsxAttribute(t,void 0)},isContextSensitive:isContextSensitive,getTypeOfPropertyOfContextualType:getTypeOfPropertyOfContextualType,getFullyQualifiedName:getFullyQualifiedName,getResolvedSignature:(e,t,n)=>getResolvedSignatureWorker(e,t,n,0),getCandidateSignaturesForStringLiteralCompletions:getCandidateSignaturesForStringLiteralCompletions,getResolvedSignatureForSignatureHelp:(e,t,n)=>runWithoutResolvedSignatureCaching(e,(()=>getResolvedSignatureWorker(e,t,n,16))),getExpandedParameters:getExpandedParameters,hasEffectiveRestParameter:hasEffectiveRestParameter,containsArgumentsReference:containsArgumentsReference,getConstantValue:e=>{const t=getParseTreeNode(e,canHaveConstantValue);return t?getConstantValue2(t):void 0},isValidPropertyAccess:(e,t)=>{const n=getParseTreeNode(e,isPropertyAccessOrQualifiedNameOrImportTypeNode);return!!n&&isValidPropertyAccess(n,escapeLeadingUnderscores(t))},isValidPropertyAccessForCompletions:(e,t,n)=>{const r=getParseTreeNode(e,isPropertyAccessExpression);return!!r&&isValidPropertyAccessForCompletions(r,t,n)},getSignatureFromDeclaration:e=>{const t=getParseTreeNode(e,isFunctionLike);return t?getSignatureFromDeclaration(t):void 0},isImplementationOfOverload:e=>{const t=getParseTreeNode(e,isFunctionLike);return t?isImplementationOfOverload(t):void 0},getImmediateAliasedSymbol:getImmediateAliasedSymbol,getAliasedSymbol:resolveAlias,getEmitResolver:getEmitResolver,requiresAddingImplicitUndefined:requiresAddingImplicitUndefined,getExportsOfModule:getExportsOfModuleAsArray,getExportsAndPropertiesOfModule:getExportsAndPropertiesOfModule,forEachExportAndPropertyOfModule:forEachExportAndPropertyOfModule,getSymbolWalker:createGetSymbolWalker(getRestTypeOfSignature,getTypePredicateOfSignature,getReturnTypeOfSignature,getBaseTypes,resolveStructuredTypeMembers,getTypeOfSymbol,getResolvedSymbol,getConstraintOfTypeParameter,getFirstIdentifier,getTypeArguments),getAmbientModules:getAmbientModules,getJsxIntrinsicTagNamesAt:getJsxIntrinsicTagNamesAt,isOptionalParameter:e=>{const t=getParseTreeNode(e,isParameter);return t?isOptionalParameter(t):false},tryGetMemberInModuleExports:(e,t)=>tryGetMemberInModuleExports(escapeLeadingUnderscores(e),t),tryGetMemberInModuleExportsAndProperties:(e,t)=>tryGetMemberInModuleExportsAndProperties(escapeLeadingUnderscores(e),t),tryFindAmbientModule:e=>tryFindAmbientModule(e,true),getApparentType:getApparentType,getUnionType:getUnionType,isTypeAssignableTo:isTypeAssignableTo,createAnonymousType:createAnonymousType,createSignature:createSignature,createSymbol:createSymbol,createIndexInfo:createIndexInfo,getAnyType:()=>ke,getStringType:()=>ze,getStringLiteralType:getStringLiteralType,getNumberType:()=>Ve,getNumberLiteralType:getNumberLiteralType,getBigIntType:()=>qe,getBigIntLiteralType:getBigIntLiteralType,getUnknownType:()=>Le,createPromiseType:createPromiseType,createArrayType:createArrayType,getElementTypeOfArrayType:getElementTypeOfArrayType,getBooleanType:()=>Xe,getFalseType:e=>e?He:Ge,getTrueType:e=>e?Ke:$e,getVoidType:()=>Ze,getUndefinedType:()=>Me,getNullType:()=>We,getESSymbolType:()=>Ye,getNeverType:()=>et,getOptionalType:()=>Je,getPromiseType:()=>getGlobalPromiseType(false),getPromiseLikeType:()=>getGlobalPromiseLikeType(false),getAnyAsyncIterableType:()=>{const e=getGlobalAsyncIterableType(false);if(e===Et)return void 0;return createTypeReference(e,[ke,ke,ke])},isSymbolAccessible:isSymbolAccessible,isArrayType:isArrayType,isTupleType:isTupleType,isArrayLikeType:isArrayLikeType,isEmptyAnonymousObjectType:isEmptyAnonymousObjectType,isTypeInvalidDueToUnionDiscriminant:isTypeInvalidDueToUnionDiscriminant,getExactOptionalProperties:getExactOptionalProperties,getAllPossiblePropertiesOfTypes:getAllPossiblePropertiesOfTypes,getSuggestedSymbolForNonexistentProperty:getSuggestedSymbolForNonexistentProperty,getSuggestedSymbolForNonexistentJSXAttribute:getSuggestedSymbolForNonexistentJSXAttribute,getSuggestedSymbolForNonexistentSymbol:(e,t,n)=>getSuggestedSymbolForNonexistentSymbol(e,escapeLeadingUnderscores(t),n),getSuggestedSymbolForNonexistentModule:getSuggestedSymbolForNonexistentModule,getSuggestedSymbolForNonexistentClassMember:getSuggestedSymbolForNonexistentClassMember,getBaseConstraintOfType:getBaseConstraintOfType,getDefaultFromTypeParameter:e=>e&&e.flags&262144?getDefaultFromTypeParameter(e):void 0,resolveName(e,t,n,r){return te(t,escapeLeadingUnderscores(e),n,void 0,false,r)},getJsxNamespace:e=>unescapeLeadingUnderscores(getJsxNamespace(e)),getJsxFragmentFactory:e=>{const t=getJsxFragmentFactoryEntity(e);return t&&unescapeLeadingUnderscores(getFirstIdentifier(t).escapedText)},getAccessibleSymbolChain:getAccessibleSymbolChain,getTypePredicateOfSignature:getTypePredicateOfSignature,resolveExternalModuleName:e=>{const t=getParseTreeNode(e,isExpression);return t&&resolveExternalModuleName(t,t,true)},resolveExternalModuleSymbol:resolveExternalModuleSymbol,tryGetThisTypeAt:(e,t,n)=>{const r=getParseTreeNode(e);return r&&tryGetThisTypeAt(r,t,n)},getTypeArgumentConstraint:e=>{const t=getParseTreeNode(e,isTypeNode);return t&&getTypeArgumentConstraint(t)},getSuggestionDiagnostics:(t,r)=>{const i=getParseTreeNode(t,isSourceFile)||S.fail("Could not determine parsed source file.");if(skipTypeChecking(i,T,e)){return d}let o;try{n=r;checkSourceFileWithEagerDiagnostics(i);S.assert(!!(getNodeLinks(i).flags&1));o=addRange(o,yi.getDiagnostics(i.fileName));checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(i),((e,t,n)=>{if(!containsParseError(e)&&!unusedIsError(t,!!(e.flags&33554432))){(o||(o=[])).push({...n,category:2})}}));return o||d}finally{n=void 0}},runWithCancellationToken:(e,t)=>{try{n=e;return t(re)}finally{n=void 0}},getLocalTypeParametersOfClassOrInterfaceOrTypeAlias:getLocalTypeParametersOfClassOrInterfaceOrTypeAlias,isDeclarationVisible:isDeclarationVisible,isPropertyAccessible:isPropertyAccessible,getTypeOnlyAliasDeclaration:getTypeOnlyAliasDeclaration,getMemberOverrideModifierStatus:getMemberOverrideModifierStatus,isTypeParameterPossiblyReferenced:isTypeParameterPossiblyReferenced,typeHasCallOrConstructSignatures:typeHasCallOrConstructSignatures,getSymbolFlags:getSymbolFlags,getTypeArgumentsForResolvedSignature:getTypeArgumentsForResolvedSignature};function getTypeArgumentsForResolvedSignature(e){if(e.mapper===void 0)return void 0;return instantiateTypes((e.target||e).typeParameters,e.mapper)}function getCandidateSignaturesForStringLiteralCompletions(e,t){const n=new Set;const r=[];runWithInferenceBlockedFromSourceNode(t,(()=>getResolvedSignatureWorker(e,r,void 0,0)));for(const e of r){n.add(e)}r.length=0;runWithoutResolvedSignatureCaching(t,(()=>getResolvedSignatureWorker(e,r,void 0,0)));for(const e of r){n.add(e)}return arrayFrom(n)}function runWithoutResolvedSignatureCaching(e,t){e=findAncestor(e,isCallLikeOrFunctionLikeExpression);if(e){const n=[];const r=[];while(e){const t=getNodeLinks(e);n.push([t,t.resolvedSignature]);t.resolvedSignature=void 0;if(isFunctionExpressionOrArrowFunction(e)){const t=getSymbolLinks(getSymbolOfDeclaration(e));const n=t.type;r.push([t,n]);t.type=void 0}e=findAncestor(e.parent,isCallLikeOrFunctionLikeExpression)}const i=t();for(const[e,t]of n){e.resolvedSignature=t}for(const[e,t]of r){e.type=t}return i}return t()}function runWithInferenceBlockedFromSourceNode(e,t){const n=findAncestor(e,isCallLikeExpression);if(n){let t=e;do{getNodeLinks(t).skipDirectInference=true;t=t.parent}while(t&&t!==n)}g=true;const r=runWithoutResolvedSignatureCaching(e,t);g=false;if(n){let t=e;do{getNodeLinks(t).skipDirectInference=void 0;t=t.parent}while(t&&t!==n)}return r}function getResolvedSignatureWorker(e,t,n,r){const i=getParseTreeNode(e,isCallLikeExpression);Q=n;const o=!i?void 0:getResolvedSignature(i,t,r);Q=void 0;return o}var ie=new Map;var oe=new Map;var ae=new Map;var se=new Map;var ce=new Map;var le=new Map;var de=new Map;var pe=new Map;var ue=new Map;var fe=new Map;var me=new Map;var _e=new Map;var ge=new Map;var ye=new Map;var he=new Map;var Te=[];var Se=new Map;var ve=new Set;var xe=createSymbol(4,"unknown");var be=createSymbol(0,"__resolving__");var Ce=new Map;var Ee=new Map;var Ne=new Set;var ke=createIntrinsicType(1,"any");var Fe=createIntrinsicType(1,"any",262144,"auto");var Pe=createIntrinsicType(1,"any",void 0,"wildcard");var De=createIntrinsicType(1,"any",void 0,"blocked string");var Ie=createIntrinsicType(1,"error");var Ae=createIntrinsicType(1,"unresolved");var Oe=createIntrinsicType(1,"any",65536,"non-inferrable");var we=createIntrinsicType(1,"intrinsic");var Le=createIntrinsicType(2,"unknown");var Me=createIntrinsicType(32768,"undefined");var Re=k?Me:createIntrinsicType(32768,"undefined",65536,"widening");var Be=createIntrinsicType(32768,"undefined",void 0,"missing");var je=L?Be:Me;var Je=createIntrinsicType(32768,"undefined",void 0,"optional");var We=createIntrinsicType(65536,"null");var Ue=k?We:createIntrinsicType(65536,"null",65536,"widening");var ze=createIntrinsicType(4,"string");var Ve=createIntrinsicType(8,"number");var qe=createIntrinsicType(64,"bigint");var He=createIntrinsicType(512,"false",void 0,"fresh");var Ge=createIntrinsicType(512,"false");var Ke=createIntrinsicType(512,"true",void 0,"fresh");var $e=createIntrinsicType(512,"true");Ke.regularType=$e;Ke.freshType=Ke;$e.regularType=$e;$e.freshType=Ke;He.regularType=Ge;He.freshType=He;Ge.regularType=Ge;Ge.freshType=He;var Xe=getUnionType([Ge,$e]);var Ye=createIntrinsicType(4096,"symbol");var Ze=createIntrinsicType(16384,"void");var et=createIntrinsicType(131072,"never");var tt=createIntrinsicType(131072,"never",262144,"silent");var nt=createIntrinsicType(131072,"never",void 0,"implicit");var rt=createIntrinsicType(131072,"never",void 0,"unreachable");var it=createIntrinsicType(67108864,"object");var ot=getUnionType([ze,Ve]);var at=getUnionType([ze,Ve,Ye]);var st=getUnionType([Ve,qe]);var ct=getUnionType([ze,Ve,Xe,qe,We,Me]);var lt=getTemplateLiteralType(["",""],[Ve]);var pt=makeFunctionTypeMapper((e=>e.flags&262144?getRestrictiveTypeParameter(e):e),(()=>"(restrictive mapper)"));var ut=makeFunctionTypeMapper((e=>e.flags&262144?Pe:e),(()=>"(permissive mapper)"));var ft=createIntrinsicType(131072,"never",void 0,"unique literal");var mt=makeFunctionTypeMapper((e=>e.flags&262144?ft:e),(()=>"(unique literal mapper)"));var _t;var gt=makeFunctionTypeMapper((e=>{if(_t&&(e===Dt||e===It||e===At)){_t(true)}return e}),(()=>"(unmeasurable reporter)"));var yt=makeFunctionTypeMapper((e=>{if(_t&&(e===Dt||e===It||e===At)){_t(false)}return e}),(()=>"(unreliable reporter)"));var ht=createAnonymousType(void 0,y,d,d,d);var Tt=createAnonymousType(void 0,y,d,d,d);Tt.objectFlags|=2048;var St=createAnonymousType(void 0,y,d,d,d);St.objectFlags|=2048|8192|128|131072;var vt=createSymbol(2048,"__type");vt.members=createSymbolTable();var xt=createAnonymousType(vt,y,d,d,d);var bt=createAnonymousType(void 0,y,d,d,d);var Ct=k?getUnionType([Me,We,bt]):Le;var Et=createAnonymousType(void 0,y,d,d,d);Et.instantiations=new Map;var Nt=createAnonymousType(void 0,y,d,d,d);Nt.objectFlags|=262144;var kt=createAnonymousType(void 0,y,d,d,d);var Ft=createAnonymousType(void 0,y,d,d,d);var Pt=createAnonymousType(void 0,y,d,d,d);var Dt=createTypeParameter();var It=createTypeParameter();It.constraint=Dt;var At=createTypeParameter();var Ot=createTypeParameter();var Lt=createTypeParameter();Lt.constraint=Ot;var Mt=createTypePredicate(1,"<>",0,ke);var Rt=createSignature(void 0,void 0,void 0,d,ke,void 0,0,0);var Bt=createSignature(void 0,void 0,void 0,d,Ie,void 0,0,0);var jt=createSignature(void 0,void 0,void 0,d,ke,void 0,0,0);var Jt=createSignature(void 0,void 0,void 0,d,tt,void 0,0,0);var Wt=createIndexInfo(Ve,ze,true);var Ut=createIndexInfo(ze,ke,false);var zt=new Map;var Vt={get yieldType(){return S.fail("Not supported")},get returnType(){return S.fail("Not supported")},get nextType(){return S.fail("Not supported")}};var qt=createIterationTypes(ke,ke,ke);var Ht={iterableCacheKey:"iterationTypesOfAsyncIterable",iteratorCacheKey:"iterationTypesOfAsyncIterator",iteratorSymbolName:"asyncIterator",getGlobalIteratorType:getGlobalAsyncIteratorType,getGlobalIterableType:getGlobalAsyncIterableType,getGlobalIterableIteratorType:getGlobalAsyncIterableIteratorType,getGlobalIteratorObjectType:getGlobalAsyncIteratorObjectType,getGlobalGeneratorType:getGlobalAsyncGeneratorType,getGlobalBuiltinIteratorTypes:getGlobalBuiltinAsyncIteratorTypes,resolveIterationType:(e,t)=>getAwaitedType(e,t,wt.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member),mustHaveANextMethodDiagnostic:wt.An_async_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:wt.The_0_property_of_an_async_iterator_must_be_a_method,mustHaveAValueDiagnostic:wt.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property};var Gt={iterableCacheKey:"iterationTypesOfIterable",iteratorCacheKey:"iterationTypesOfIterator",iteratorSymbolName:"iterator",getGlobalIteratorType:getGlobalIteratorType,getGlobalIterableType:getGlobalIterableType,getGlobalIterableIteratorType:getGlobalIterableIteratorType,getGlobalIteratorObjectType:getGlobalIteratorObjectType,getGlobalGeneratorType:getGlobalGeneratorType,getGlobalBuiltinIteratorTypes:getGlobalBuiltinIteratorTypes,resolveIterationType:(e,t)=>e,mustHaveANextMethodDiagnostic:wt.An_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:wt.The_0_property_of_an_iterator_must_be_a_method,mustHaveAValueDiagnostic:wt.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property};var Kt;var $t=new Map;var Qt=new Map;var Xt;var Yt;var Zt;var en;var tn;var nn;var rn;var on;var an;var pn;var fn;var mn;var _n;var gn;var yn;var hn;var Tn;var Sn;var vn;var xn;var bn;var Cn;var En;var Nn;var kn;var Fn;var Pn;var Dn;var In;var An;var On;var wn;var Ln;var Mn;var Bn;var jn;var Jn;var Wn;var Un;var Hn;var Qn;var Xn;var tr;var nr;var rr;var ar;var sr;var cr;var lr;var dr;var pr;var ur;var fr;var mr;var _r;var gr;var yr;var hr;var Tr;var Sr;var vr;var xr=new Map;var br=0;var Cr=0;var Er=0;var Nr=false;var kr=0;var Fr;var Pr;var Dr;var Ir=[];var Ar=[];var Or=[];var wr=0;var Lr=[];var Mr=[];var Rr=[];var Br=0;var jr=getStringLiteralType("");var Jr=getNumberLiteralType(0);var Wr=getBigIntLiteralType({negative:false,base10Value:"0"});var Ur=[];var Vr=[];var qr=[];var Hr=0;var Gr=false;var Kr=0;var $r=10;var Qr=[];var Xr=[];var Yr=[];var Zr=[];var ei=[];var ti=[];var ni=[];var ri=[];var ii=[];var oi=[];var ai=[];var si=[];var ci=[];var li=[];var di=[];var pi=[];var ui=[];var fi=[];var mi=[];var _i=0;var gi=createDiagnosticCollection();var yi=createDiagnosticCollection();var hi=createTypeofType();var Ti;var Si;var vi=new Map;var xi=new Map;var bi=new Map;var Ci=new Map;var Ei=new Map;var Ni=new Map;var ki=[[".mts",".mjs"],[".ts",".js"],[".cts",".cjs"],[".mjs",".mjs"],[".js",".js"],[".cjs",".cjs"],[".tsx",T.jsx===1?".jsx":".js"],[".jsx",".jsx"],[".json",".json"]];initializeTypeChecker();return re;function isDefinitelyReferenceToGlobalSymbolObject(e){if(!isPropertyAccessExpression(e))return false;if(!isIdentifier(e.name))return false;if(!isPropertyAccessExpression(e.expression)&&!isIdentifier(e.expression))return false;if(isIdentifier(e.expression)){return idText(e.expression)==="Symbol"&&getResolvedSymbol(e.expression)===(getGlobalSymbol("Symbol",111551|1048576,void 0)||xe)}if(!isIdentifier(e.expression.expression))return false;return idText(e.expression.name)==="Symbol"&&idText(e.expression.expression)==="globalThis"&&getResolvedSymbol(e.expression.expression)===V}function getCachedType(e){return e?he.get(e):void 0}function setCachedType(e,t){if(e)he.set(e,t);return t}function getJsxNamespace(e){if(e){const t=getSourceFileOfNode(e);if(t){if(isJsxOpeningFragment(e)){if(t.localJsxFragmentNamespace){return t.localJsxFragmentNamespace}const n=t.pragmas.get("jsxfrag");if(n){const e=isArray(n)?n[0]:n;t.localJsxFragmentFactory=parseIsolatedEntityName(e.arguments.factory,v);visitNode(t.localJsxFragmentFactory,markAsSynthetic,isEntityName);if(t.localJsxFragmentFactory){return t.localJsxFragmentNamespace=getFirstIdentifier(t.localJsxFragmentFactory).escapedText}}const r=getJsxFragmentFactoryEntity(e);if(r){t.localJsxFragmentFactory=r;return t.localJsxFragmentNamespace=getFirstIdentifier(r).escapedText}}else{const e=getLocalJsxNamespace(t);if(e){return t.localJsxNamespace=e}}}}if(!Ti){Ti="React";if(T.jsxFactory){Si=parseIsolatedEntityName(T.jsxFactory,v);visitNode(Si,markAsSynthetic);if(Si){Ti=getFirstIdentifier(Si).escapedText}}else if(T.reactNamespace){Ti=escapeLeadingUnderscores(T.reactNamespace)}}if(!Si){Si=zr.createQualifiedName(zr.createIdentifier(unescapeLeadingUnderscores(Ti)),"createElement")}return Ti}function getLocalJsxNamespace(e){if(e.localJsxNamespace){return e.localJsxNamespace}const t=e.pragmas.get("jsx");if(t){const n=isArray(t)?t[0]:t;e.localJsxFactory=parseIsolatedEntityName(n.arguments.factory,v);visitNode(e.localJsxFactory,markAsSynthetic,isEntityName);if(e.localJsxFactory){return e.localJsxNamespace=getFirstIdentifier(e.localJsxFactory).escapedText}}}function markAsSynthetic(e){setTextRangePosEnd(e,-1,-1);return visitEachChild(e,markAsSynthetic,void 0)}function getEmitResolver(e,t,n){if(!n)getDiagnostics2(e,t);return B}function lookupOrIssueError(e,t,...n){const r=e?createDiagnosticForNode(e,t,...n):createCompilerDiagnostic(t,...n);const i=gi.lookup(r);if(i){return i}else{gi.add(r);return r}}function errorSkippedOn(e,t,n,...r){const i=error2(t,n,...r);i.skippedOn=e;return i}function createError(e,t,...n){return e?createDiagnosticForNode(e,t,...n):createCompilerDiagnostic(t,...n)}function error2(e,t,...n){const r=createError(e,t,...n);gi.add(r);return r}function addErrorOrSuggestion(e,t){if(e){gi.add(t)}else{yi.add({...t,category:2})}}function errorOrSuggestion(e,t,n,...r){if(t.pos<0||t.end<0){if(!e){return}const i=getSourceFileOfNode(t);addErrorOrSuggestion(e,"message"in n?createFileDiagnostic(i,0,0,n,...r):createDiagnosticForFileFromMessageChain(i,n));return}addErrorOrSuggestion(e,"message"in n?createDiagnosticForNode(t,n,...r):createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(t),t,n))}function errorAndMaybeSuggestAwait(e,t,n,...r){const i=error2(e,n,...r);if(t){const t=createDiagnosticForNode(e,wt.Did_you_forget_to_use_await);addRelatedInfo(i,t)}return i}function addDeprecatedSuggestionWorker(e,t){const n=Array.isArray(e)?forEach(e,getJSDocDeprecatedTag):getJSDocDeprecatedTag(e);if(n){addRelatedInfo(t,createDiagnosticForNode(n,wt.The_declaration_was_marked_as_deprecated_here))}yi.add(t);return t}function isDeprecatedSymbol(e){const t=getParentOfSymbol(e);if(t&&length(e.declarations)>1){return t.flags&64?some(e.declarations,isDeprecatedDeclaration2):every(e.declarations,isDeprecatedDeclaration2)}return!!e.valueDeclaration&&isDeprecatedDeclaration2(e.valueDeclaration)||length(e.declarations)&&every(e.declarations,isDeprecatedDeclaration2)}function isDeprecatedDeclaration2(e){return!!(getCombinedNodeFlagsCached(e)&536870912)}function addDeprecatedSuggestion(e,t,n){const r=createDiagnosticForNode(e,wt._0_is_deprecated,n);return addDeprecatedSuggestionWorker(t,r)}function addDeprecatedSuggestionWithSignature(e,t,n,r){const i=n?createDiagnosticForNode(e,wt.The_signature_0_of_1_is_deprecated,r,n):createDiagnosticForNode(e,wt._0_is_deprecated,r);return addDeprecatedSuggestionWorker(t,i)}function createSymbol(e,t,n){c++;const r=new i(e|33554432,t);r.links=new ca;r.links.checkFlags=n||0;return r}function createParameter2(e,t){const n=createSymbol(1,e);n.links.type=t;return n}function createProperty(e,t){const n=createSymbol(4,e);n.links.type=t;return n}function getExcludedSymbolFlags(e){let t=0;if(e&2)t|=111551;if(e&1)t|=111550;if(e&4)t|=0;if(e&8)t|=900095;if(e&16)t|=110991;if(e&32)t|=899503;if(e&64)t|=788872;if(e&256)t|=899327;if(e&128)t|=899967;if(e&512)t|=110735;if(e&8192)t|=103359;if(e&32768)t|=46015;if(e&65536)t|=78783;if(e&262144)t|=526824;if(e&524288)t|=788968;if(e&2097152)t|=2097152;return t}function recordMergedSymbol(e,t){if(!t.mergeId){t.mergeId=ea;ea++}Qr[t.mergeId]=e}function cloneSymbol(e){const t=createSymbol(e.flags,e.escapedName);t.declarations=e.declarations?e.declarations.slice():[];t.parent=e.parent;if(e.valueDeclaration)t.valueDeclaration=e.valueDeclaration;if(e.constEnumOnlyModule)t.constEnumOnlyModule=true;if(e.members)t.members=new Map(e.members);if(e.exports)t.exports=new Map(e.exports);recordMergedSymbol(t,e);return t}function mergeSymbol(e,t,n=false){if(!(e.flags&getExcludedSymbolFlags(t.flags))||(t.flags|e.flags)&67108864){if(t===e){return e}if(!(e.flags&33554432)){const n=resolveSymbol(e);if(n===xe){return t}if(!(n.flags&getExcludedSymbolFlags(t.flags))||(t.flags|n.flags)&67108864){e=cloneSymbol(n)}else{reportMergeSymbolError(e,t);return t}}if(t.flags&512&&e.flags&512&&e.constEnumOnlyModule&&!t.constEnumOnlyModule){e.constEnumOnlyModule=false}e.flags|=t.flags;if(t.valueDeclaration){setValueDeclaration(e,t.valueDeclaration)}addRange(e.declarations,t.declarations);if(t.members){if(!e.members)e.members=createSymbolTable();mergeSymbolTable(e.members,t.members,n)}if(t.exports){if(!e.exports)e.exports=createSymbolTable();mergeSymbolTable(e.exports,t.exports,n,e)}if(!n){recordMergedSymbol(e,t)}}else if(e.flags&1024){if(e!==V){error2(t.declarations&&getNameOfDeclaration(t.declarations[0]),wt.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity,symbolToString(e))}}else{reportMergeSymbolError(e,t)}return e;function reportMergeSymbolError(e,t){const n=!!(e.flags&384||t.flags&384);const r=!!(e.flags&2||t.flags&2);const i=n?wt.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:r?wt.Cannot_redeclare_block_scoped_variable_0:wt.Duplicate_identifier_0;const o=t.declarations&&getSourceFileOfNode(t.declarations[0]);const a=e.declarations&&getSourceFileOfNode(e.declarations[0]);const s=isPlainJsFile(o,T.checkJs);const c=isPlainJsFile(a,T.checkJs);const l=symbolToString(t);if(o&&a&&Kt&&!n&&o!==a){const n=comparePaths(o.path,a.path)===-1?o:a;const i=n===o?a:o;const d=getOrUpdate(Kt,`${n.path}|${i.path}`,(()=>({firstFile:n,secondFile:i,conflictingSymbols:new Map})));const p=getOrUpdate(d.conflictingSymbols,l,(()=>({isBlockScoped:r,firstFileLocations:[],secondFileLocations:[]})));if(!s)addDuplicateLocations(p.firstFileLocations,t);if(!c)addDuplicateLocations(p.secondFileLocations,e)}else{if(!s)addDuplicateDeclarationErrorsForSymbols(t,i,l,e);if(!c)addDuplicateDeclarationErrorsForSymbols(e,i,l,t)}}function addDuplicateLocations(e,t){if(t.declarations){for(const n of t.declarations){pushIfUnique(e,n)}}}}function addDuplicateDeclarationErrorsForSymbols(e,t,n,r){forEach(e.declarations,(e=>{addDuplicateDeclarationError(e,t,n,r.declarations)}))}function addDuplicateDeclarationError(e,t,n,r){const i=(getExpandoInitializer(e,false)?getNameOfExpando(e):getNameOfDeclaration(e))||e;const o=lookupOrIssueError(i,t,n);for(const e of r||d){const t=(getExpandoInitializer(e,false)?getNameOfExpando(e):getNameOfDeclaration(e))||e;if(t===i)continue;o.relatedInformation=o.relatedInformation||[];const r=createDiagnosticForNode(t,wt._0_was_also_declared_here,n);const a=createDiagnosticForNode(t,wt.and_here);if(length(o.relatedInformation)>=5||some(o.relatedInformation,(e=>compareDiagnostics(e,a)===0||compareDiagnostics(e,r)===0)))continue;addRelatedInfo(o,!length(o.relatedInformation)?r:a)}}function combineSymbolTables(e,t){if(!(e==null?void 0:e.size))return t;if(!(t==null?void 0:t.size))return e;const n=createSymbolTable();mergeSymbolTable(n,e);mergeSymbolTable(n,t);return n}function mergeSymbolTable(e,t,n=false,r){t.forEach(((t,i)=>{const o=e.get(i);const a=o?mergeSymbol(o,t,n):getMergedSymbol(t);if(r&&o){a.parent=r}e.set(i,a)}))}function mergeModuleAugmentation(e){var t,n,r;const i=e.parent;if(((t=i.symbol.declarations)==null?void 0:t[0])!==i){S.assert(i.symbol.declarations.length>1);return}if(isGlobalScopeAugmentation(i)){mergeSymbolTable(U,i.symbol.exports)}else{const t=!(e.parent.parent.flags&33554432)?wt.Invalid_module_name_in_augmentation_module_0_cannot_be_found:void 0;let o=resolveExternalModuleNameWorker(e,e,t,false,true);if(!o){return}o=resolveExternalModuleSymbol(o);if(o.flags&1920){if(some(Yt,(e=>o===e.symbol))){const t=mergeSymbol(i.symbol,o,true);if(!Zt){Zt=new Map}Zt.set(e.text,t)}else{if(((n=o.exports)==null?void 0:n.get("__export"))&&((r=i.symbol.exports)==null?void 0:r.size)){const e=getResolvedMembersOrExportsOfSymbol(o,"resolvedExports");for(const[t,n]of arrayFrom(i.symbol.exports.entries())){if(e.has(t)&&!o.exports.has(t)){mergeSymbol(e.get(t),n)}}}mergeSymbol(o,i.symbol)}}else{error2(e,wt.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity,e.text)}}}function addUndefinedToGlobalsOrErrorOnRedeclaration(){const e=z.escapedName;const t=U.get(e);if(t){forEach(t.declarations,(t=>{if(!isTypeDeclaration(t)){gi.add(createDiagnosticForNode(t,wt.Declaration_name_conflicts_with_built_in_global_identifier_0,unescapeLeadingUnderscores(e)))}}))}else{U.set(e,z)}}function getSymbolLinks(e){if(e.flags&33554432)return e.links;const t=getSymbolId(e);return Xr[t]??(Xr[t]=new ca)}function getNodeLinks(e){const t=getNodeId(e);return Yr[t]||(Yr[t]=new NodeLinks)}function getSymbol2(e,t,n){if(n){const r=getMergedSymbol(e.get(t));if(r){if(r.flags&n){return r}if(r.flags&2097152){const e=getSymbolFlags(r);if(e&n){return r}}}}}function getSymbolsOfParameterPropertyDeclaration(e,t){const n=e.parent;const r=e.parent.parent;const i=getSymbol2(n.locals,t,111551);const o=getSymbol2(getMembersOfSymbol(r.symbol),t,111551);if(i&&o){return[i,o]}return S.fail("There should exist two symbols, one as property declaration and one as parameter declaration")}function isBlockScopedNameDeclaredBeforeUse(t,n){const r=getSourceFileOfNode(t);const i=getSourceFileOfNode(n);const o=getEnclosingBlockScopeContainer(t);if(r!==i){if(x&&(r.externalModuleIndicator||i.externalModuleIndicator)||!T.outFile||isInTypeQuery(n)||t.flags&33554432){return true}if(isUsedInFunctionOrInstanceProperty(n,t)){return true}const o=e.getSourceFiles();return o.indexOf(r)<=o.indexOf(i)}if(!!(n.flags&16777216)||isInTypeQuery(n)||isInAmbientOrTypeNode(n)){return true}if(t.pos<=n.pos&&!(isPropertyDeclaration(t)&&isThisProperty(n.parent)&&!t.initializer&&!t.exclamationToken)){if(t.kind===208){const e=getAncestor(n,208);if(e){return findAncestor(e,isBindingElement)!==findAncestor(t,isBindingElement)||t.pose===t?"quit":isComputedPropertyName(e)?e.parent.parent===t:!b&&isDecorator(e)&&(e.parent===t||isMethodDeclaration(e.parent)&&e.parent.parent===t||isGetOrSetAccessorDeclaration(e.parent)&&e.parent.parent===t||isPropertyDeclaration(e.parent)&&e.parent.parent===t||isParameter(e.parent)&&e.parent.parent.parent===t)));if(!e){return true}if(!b&&isDecorator(e)){return!!findAncestor(n,(t=>t===e?"quit":isFunctionLike(t)&&!getImmediatelyInvokedFunctionExpression(t)))}return false}else if(isPropertyDeclaration(t)){return!isPropertyImmediatelyReferencedWithinDeclaration(t,n,false)}else if(isParameterPropertyDeclaration(t,t.parent)){return!(E&&getContainingClass(t)===getContainingClass(n)&&isUsedInFunctionOrInstanceProperty(n,t))}return true}if(n.parent.kind===281||n.parent.kind===277&&n.parent.isExportEquals){return true}if(n.kind===277&&n.isExportEquals){return true}if(isUsedInFunctionOrInstanceProperty(n,t)){if(E&&getContainingClass(t)&&(isPropertyDeclaration(t)||isParameterPropertyDeclaration(t,t.parent))){return!isPropertyImmediatelyReferencedWithinDeclaration(t,n,true)}else{return true}}return false;function isImmediatelyUsedInInitializerOfBlockScopedVariable(e,t){switch(e.parent.parent.kind){case 243:case 248:case 250:if(isSameScopeDescendentOf(t,e,o)){return true}break}const n=e.parent.parent;return isForInOrOfStatement(n)&&isSameScopeDescendentOf(t,n.expression,o)}function isUsedInFunctionOrInstanceProperty(e,t){return!!findAncestor(e,(n=>{if(n===o){return"quit"}if(isFunctionLike(n)){return true}if(isClassStaticBlockDeclaration(n)){return t.pose.end){return false}const r=findAncestor(t,(t=>{if(t===e){return"quit"}switch(t.kind){case 219:return true;case 172:return n&&(isPropertyDeclaration(e)&&t.parent===e.parent||isParameterPropertyDeclaration(e,e.parent)&&t.parent===e.parent.parent)?"quit":true;case 241:switch(t.parent.kind){case 177:case 174:case 178:return true;default:return false}default:return false}}));return r===void 0}}function getRequiresScopeChangeCache(e){return getNodeLinks(e).declarationRequiresScopeChange}function setRequiresScopeChangeCache(e,t){getNodeLinks(e).declarationRequiresScopeChange=t}function checkAndReportErrorForInvalidInitializer(e,t,n,r){if(!E){if(e&&!r&&checkAndReportErrorForMissingPrefix(e,t,t)){return true}error2(e,e&&n.type&&textRangeContainsPositionInclusive(n.type,e.pos)?wt.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:wt.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,declarationNameToString(n.name),diagnosticName(t));return true}return false}function onFailedToResolveSymbol(e,t,n,r){const i=isString(t)?t:t.escapedText;addLazyDiagnostic((()=>{if(!e||e.parent.kind!==324&&!checkAndReportErrorForMissingPrefix(e,i,t)&&!checkAndReportErrorForExtendingInterface(e)&&!checkAndReportErrorForUsingTypeAsNamespace(e,i,n)&&!checkAndReportErrorForExportingPrimitiveType(e,i)&&!checkAndReportErrorForUsingNamespaceAsTypeOrValue(e,i,n)&&!checkAndReportErrorForUsingTypeAsValue(e,i,n)&&!checkAndReportErrorForUsingValueAsType(e,i,n)){let o;let a;if(t){a=getSuggestedLibForNonExistentName(t);if(a){error2(e,r,diagnosticName(t),a)}}if(!a&&Kr<$r){o=getSuggestedSymbolForNonexistentSymbol(e,i,n);const a=(o==null?void 0:o.valueDeclaration)&&isAmbientModule(o.valueDeclaration)&&isGlobalScopeAugmentation(o.valueDeclaration);if(a){o=void 0}if(o){const i=symbolToString(o);const a=isUncheckedJSSuggestion(e,o,false);const s=n===1920||t&&typeof t!=="string"&&nodeIsSynthesized(t)?wt.Cannot_find_namespace_0_Did_you_mean_1:a?wt.Could_not_find_name_0_Did_you_mean_1:wt.Cannot_find_name_0_Did_you_mean_1;const c=createError(e,s,diagnosticName(t),i);c.canonicalHead=getCanonicalDiagnostic(r,diagnosticName(t));addErrorOrSuggestion(!a,c);if(o.valueDeclaration){addRelatedInfo(c,createDiagnosticForNode(o.valueDeclaration,wt._0_is_declared_here,i))}}}if(!o&&!a&&t){error2(e,r,diagnosticName(t))}Kr++}}))}function onSuccessfullyResolvedSymbol(e,t,n,r,i,o){addLazyDiagnostic((()=>{var a;const s=t.escapedName;const c=r&&isSourceFile(r)&&isExternalOrCommonJsModule(r);if(e&&(n&2||(n&32||n&384)&&(n&111551)===111551)){const n=getExportSymbolOfValueSymbolIfExported(t);if(n.flags&2||n.flags&32||n.flags&384){checkResolvedBlockScopedVariable(n,e)}}if(c&&(n&111551)===111551&&!(e.flags&16777216)){const n=getMergedSymbol(t);if(length(n.declarations)&&every(n.declarations,(e=>isNamespaceExportDeclaration(e)||isSourceFile(e)&&!!e.symbol.globalExports))){errorOrSuggestion(!T.allowUmdGlobalAccess,e,wt._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead,unescapeLeadingUnderscores(s))}}if(i&&!o&&(n&111551)===111551){const r=getMergedSymbol(getLateBoundSymbol(t));const o=getRootDeclaration(i);if(r===getSymbolOfDeclaration(i)){error2(e,wt.Parameter_0_cannot_reference_itself,declarationNameToString(i.name))}else if(r.valueDeclaration&&r.valueDeclaration.pos>i.pos&&o.parent.locals&&getSymbol2(o.parent.locals,r.escapedName,n)===r){error2(e,wt.Parameter_0_cannot_reference_identifier_1_declared_after_it,declarationNameToString(i.name),declarationNameToString(e))}}if(e&&n&111551&&t.flags&2097152&&!(t.flags&111551)&&!isValidTypeOnlyAliasUseSite(e)){const n=getTypeOnlyAliasDeclaration(t,111551);if(n){const t=n.kind===281||n.kind===278||n.kind===280?wt._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:wt._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;const r=unescapeLeadingUnderscores(s);addTypeOnlyDeclarationRelatedInfo(error2(e,t,r),n,r)}}if(T.isolatedModules&&t&&c&&(n&111551)===111551){const e=getSymbol2(U,s,n)===t;const i=e&&isSourceFile(r)&&r.locals&&getSymbol2(r.locals,s,~111551);if(i){const e=(a=i.declarations)==null?void 0:a.find((e=>e.kind===276||e.kind===273||e.kind===274||e.kind===271));if(e&&!isTypeOnlyImportDeclaration(e)){error2(e,wt.Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,unescapeLeadingUnderscores(s))}}}}))}function addTypeOnlyDeclarationRelatedInfo(e,t,n){if(!t)return e;return addRelatedInfo(e,createDiagnosticForNode(t,t.kind===281||t.kind===278||t.kind===280?wt._0_was_exported_here:wt._0_was_imported_here,n))}function diagnosticName(e){return isString(e)?unescapeLeadingUnderscores(e):declarationNameToString(e)}function checkAndReportErrorForMissingPrefix(e,t,n){if(!isIdentifier(e)||e.escapedText!==t||isTypeReferenceIdentifier(e)||isInTypeQuery(e)){return false}const r=getThisContainer(e,false,false);let i=r;while(i){if(isClassLike(i.parent)){const o=getSymbolOfDeclaration(i.parent);if(!o){break}const a=getTypeOfSymbol(o);if(getPropertyOfType(a,t)){error2(e,wt.Cannot_find_name_0_Did_you_mean_the_static_member_1_0,diagnosticName(n),symbolToString(o));return true}if(i===r&&!isStatic(i)){const r=getDeclaredTypeOfSymbol(o).thisType;if(getPropertyOfType(r,t)){error2(e,wt.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0,diagnosticName(n));return true}}}i=i.parent}return false}function checkAndReportErrorForExtendingInterface(e){const t=getEntityNameForExtendingInterface(e);if(t&&resolveEntityName(t,64,true)){error2(e,wt.Cannot_extend_an_interface_0_Did_you_mean_implements,getTextOfNode(t));return true}return false}function getEntityNameForExtendingInterface(e){switch(e.kind){case 80:case 211:return e.parent?getEntityNameForExtendingInterface(e.parent):void 0;case 233:if(isEntityNameExpression(e.expression)){return e.expression}default:return void 0}}function checkAndReportErrorForUsingTypeAsNamespace(e,t,n){const r=1920|(isInJSFile(e)?111551:0);if(n===r){const n=resolveSymbol(te(e,t,788968&~r,void 0,false));const i=e.parent;if(n){if(isQualifiedName(i)){S.assert(i.left===e,"Should only be resolving left side of qualified name as a namespace");const r=i.right.escapedText;const o=getPropertyOfType(getDeclaredTypeOfSymbol(n),r);if(o){error2(i,wt.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,unescapeLeadingUnderscores(t),unescapeLeadingUnderscores(r));return true}}error2(e,wt._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here,unescapeLeadingUnderscores(t));return true}}return false}function checkAndReportErrorForUsingValueAsType(e,t,n){if(n&(788968&~1920)){const n=resolveSymbol(te(e,t,~788968&111551,void 0,false));if(n&&!(n.flags&1920)){error2(e,wt._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,unescapeLeadingUnderscores(t));return true}}return false}function isPrimitiveTypeName(e){return e==="any"||e==="string"||e==="number"||e==="boolean"||e==="never"||e==="unknown"}function checkAndReportErrorForExportingPrimitiveType(e,t){if(isPrimitiveTypeName(t)&&e.parent.kind===281){error2(e,wt.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,t);return true}return false}function checkAndReportErrorForUsingTypeAsValue(e,t,n){if(n&111551){if(isPrimitiveTypeName(t)){const n=e.parent.parent;if(n&&n.parent&&isHeritageClause(n)){const r=n.token;const i=n.parent.kind;if(i===264&&r===96){error2(e,wt.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types,unescapeLeadingUnderscores(t))}else if(isClassLike(n.parent)&&r===96){error2(e,wt.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values,unescapeLeadingUnderscores(t))}else if(isClassLike(n.parent)&&r===119){error2(e,wt.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types,unescapeLeadingUnderscores(t))}}else{error2(e,wt._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,unescapeLeadingUnderscores(t))}return true}const n=resolveSymbol(te(e,t,788968&~111551,void 0,false));const r=n&&getSymbolFlags(n);if(n&&r!==void 0&&!(r&111551)){const r=unescapeLeadingUnderscores(t);if(isES2015OrLaterConstructorName(t)){error2(e,wt._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later,r)}else if(maybeMappedType(e,n)){error2(e,wt._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0,r,r==="K"?"P":"K")}else{error2(e,wt._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,r)}return true}}return false}function maybeMappedType(e,t){const n=findAncestor(e.parent,(e=>isComputedPropertyName(e)||isPropertySignature(e)?false:isTypeLiteralNode(e)||"quit"));if(n&&n.members.length===1){const e=getDeclaredTypeOfSymbol(t);return!!(e.flags&1048576)&&allTypesAssignableToKind(e,384,true)}return false}function isES2015OrLaterConstructorName(e){switch(e){case"Promise":case"Symbol":case"Map":case"WeakMap":case"Set":case"WeakSet":return true}return false}function checkAndReportErrorForUsingNamespaceAsTypeOrValue(e,t,n){if(n&(111551&~788968)){const n=resolveSymbol(te(e,t,1024,void 0,false));if(n){error2(e,wt.Cannot_use_namespace_0_as_a_value,unescapeLeadingUnderscores(t));return true}}else if(n&(788968&~111551)){const n=resolveSymbol(te(e,t,1536,void 0,false));if(n){error2(e,wt.Cannot_use_namespace_0_as_a_type,unescapeLeadingUnderscores(t));return true}}return false}function checkResolvedBlockScopedVariable(e,t){var n;S.assert(!!(e.flags&2||e.flags&32||e.flags&384));if(e.flags&(16|1|67108864)&&e.flags&32){return}const r=(n=e.declarations)==null?void 0:n.find((e=>isBlockOrCatchScoped(e)||isClassLike(e)||e.kind===266));if(r===void 0)return S.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");if(!(r.flags&33554432)&&!isBlockScopedNameDeclaredBeforeUse(r,t)){let n;const i=declarationNameToString(getNameOfDeclaration(r));if(e.flags&2){n=error2(t,wt.Block_scoped_variable_0_used_before_its_declaration,i)}else if(e.flags&32){n=error2(t,wt.Class_0_used_before_its_declaration,i)}else if(e.flags&256){n=error2(t,wt.Enum_0_used_before_its_declaration,i)}else{S.assert(!!(e.flags&128));if(Gn(T)){n=error2(t,wt.Enum_0_used_before_its_declaration,i)}}if(n){addRelatedInfo(n,createDiagnosticForNode(r,wt._0_is_declared_here,i))}}}function isSameScopeDescendentOf(e,t,n){return!!t&&!!findAncestor(e,(e=>e===t||(e===n||isFunctionLike(e)&&(!getImmediatelyInvokedFunctionExpression(e)||getFunctionFlags(e)&3)?"quit":false)))}function getAnyImportSyntax(e){switch(e.kind){case 271:return e;case 273:return e.parent;case 274:return e.parent.parent;case 276:return e.parent.parent.parent;default:return void 0}}function getDeclarationOfAliasSymbol(e){return e.declarations&&findLast(e.declarations,isAliasSymbolDeclaration)}function isAliasSymbolDeclaration(e){return e.kind===271||e.kind===270||e.kind===273&&!!e.name||e.kind===274||e.kind===280||e.kind===276||e.kind===281||e.kind===277&&exportAssignmentIsAlias(e)||isBinaryExpression(e)&&getAssignmentDeclarationKind(e)===2&&exportAssignmentIsAlias(e)||isAccessExpression(e)&&isBinaryExpression(e.parent)&&e.parent.left===e&&e.parent.operatorToken.kind===64&&isAliasableOrJsExpression(e.parent.right)||e.kind===304||e.kind===303&&isAliasableOrJsExpression(e.initializer)||e.kind===260&&isVariableDeclarationInitializedToBareOrAccessedRequire(e)||e.kind===208&&isVariableDeclarationInitializedToBareOrAccessedRequire(e.parent.parent)}function isAliasableOrJsExpression(e){return isAliasableExpression(e)||isFunctionExpression(e)&&isJSConstructor(e)}function getTargetOfImportEqualsDeclaration(e,t){const n=getCommonJSPropertyAccess(e);if(n){const e=getLeftmostAccessExpression(n.expression).arguments[0];return isIdentifier(n.name)?resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(e),n.name.escapedText)):void 0}if(isVariableDeclaration(e)||e.moduleReference.kind===283){const t=resolveExternalModuleName(e,getExternalModuleRequireArgument(e)||getExternalModuleImportEqualsDeclarationExpression(e));const n=resolveExternalModuleSymbol(t);markSymbolOfAliasDeclarationIfTypeOnly(e,t,n,false);return n}const r=getSymbolOfPartOfRightHandSideOfImportEquals(e.moduleReference,t);checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(e,r);return r}function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(e,t){if(markSymbolOfAliasDeclarationIfTypeOnly(e,void 0,t,false)&&!e.isTypeOnly){const t=getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(e));const n=t.kind===281||t.kind===278;const r=n?wt.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:wt.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;const i=n?wt._0_was_exported_here:wt._0_was_imported_here;const o=t.kind===278?"*":moduleExportNameTextUnescaped(t.name);addRelatedInfo(error2(e.moduleReference,r),createDiagnosticForNode(t,i,o))}}function resolveExportByName(e,t,n,r){const i=e.exports.get("export=");const o=i?getPropertyOfType(getTypeOfSymbol(i),t,true):e.exports.get(t);const a=resolveSymbol(o,r);markSymbolOfAliasDeclarationIfTypeOnly(n,o,a,false);return a}function isSyntacticDefault(e){return isExportAssignment(e)&&!e.isExportEquals||hasSyntacticModifier(e,2048)||isExportSpecifier(e)||isNamespaceExport(e)}function getEmitSyntaxForModuleSpecifierExpression(t){return isStringLiteralLike(t)?e.getEmitSyntaxForUsageLocation(getSourceFileOfNode(t),t):void 0}function isESMFormatImportImportingCommonjsFormatFile(e,t){return e===99&&t===1}function isOnlyImportableAsDefault(e,t){if(100<=x&&x<=199){const n=getEmitSyntaxForModuleSpecifierExpression(e);if(n===99){t??(t=resolveExternalModuleName(e,e,true));const n=t&&getSourceFileOfModule(t);return n&&(isJsonSourceFile(n)||getDeclarationFileExtension(n.fileName)===".d.json.ts")}}return false}function canHaveSyntheticDefault(t,n,r,i){const o=t&&getEmitSyntaxForModuleSpecifierExpression(i);if(t&&o!==void 0){const n=e.getImpliedNodeFormatForEmit(t);if(o===99&&n===1&&100<=x&&x<=199){return true}if(o===99&&n===99){return false}}if(!N){return false}if(!t||t.isDeclarationFile){const e=resolveExportByName(n,"default",void 0,true);if(e&&some(e.declarations,isSyntacticDefault)){return false}if(resolveExportByName(n,escapeLeadingUnderscores("__esModule"),void 0,r)){return false}return true}if(!isSourceFileJS(t)){return hasExportAssignmentSymbol(n)}return typeof t.externalModuleIndicator!=="object"&&!resolveExportByName(n,escapeLeadingUnderscores("__esModule"),void 0,r)}function getTargetOfImportClause(e,t){const n=resolveExternalModuleName(e,e.parent.moduleSpecifier);if(n){return getTargetofModuleDefault(n,e,t)}}function getTargetofModuleDefault(e,t,n){var r;let i;if(isShorthandAmbientModuleSymbol(e)){i=e}else{i=resolveExportByName(e,"default",t,n)}const o=(r=e.declarations)==null?void 0:r.find(isSourceFile);const a=getModuleSpecifierForImportOrExport(t);if(!a){return i}const s=isOnlyImportableAsDefault(a,e);const c=canHaveSyntheticDefault(o,e,n,a);if(!i&&!c&&!s){if(hasExportAssignmentSymbol(e)&&!N){const n=x>=5?"allowSyntheticDefaultImports":"esModuleInterop";const r=e.exports.get("export=");const i=r.valueDeclaration;const o=error2(t.name,wt.Module_0_can_only_be_default_imported_using_the_1_flag,symbolToString(e),n);if(i){addRelatedInfo(o,createDiagnosticForNode(i,wt.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,n))}}else if(isImportClause(t)){reportNonDefaultExport(e,t)}else{errorNoModuleMemberSymbol(e,e,t,isImportOrExportSpecifier(t)&&t.propertyName||t.name)}}else if(c||s){const r=resolveExternalModuleSymbol(e,n)||resolveSymbol(e,n);markSymbolOfAliasDeclarationIfTypeOnly(t,e,r,false);return r}markSymbolOfAliasDeclarationIfTypeOnly(t,i,void 0,false);return i}function getModuleSpecifierForImportOrExport(e){switch(e.kind){case 273:return e.parent.moduleSpecifier;case 271:return isExternalModuleReference(e.moduleReference)?e.moduleReference.expression:void 0;case 274:return e.parent.parent.moduleSpecifier;case 276:return e.parent.parent.parent.moduleSpecifier;case 281:return e.parent.parent.moduleSpecifier;default:return S.assertNever(e)}}function reportNonDefaultExport(e,t){var n,r,i;if((n=e.exports)==null?void 0:n.has(t.symbol.escapedName)){error2(t.name,wt.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,symbolToString(e),symbolToString(t.symbol))}else{const n=error2(t.name,wt.Module_0_has_no_default_export,symbolToString(e));const o=(r=e.exports)==null?void 0:r.get("__export");if(o){const e=(i=o.declarations)==null?void 0:i.find((e=>{var t,n;return!!(isExportDeclaration(e)&&e.moduleSpecifier&&((n=(t=resolveExternalModuleName(e,e.moduleSpecifier))==null?void 0:t.exports)==null?void 0:n.has("default")))}));if(e){addRelatedInfo(n,createDiagnosticForNode(e,wt.export_Asterisk_does_not_re_export_a_default))}}}}function getTargetOfNamespaceImport(e,t){const n=e.parent.parent.moduleSpecifier;const r=resolveExternalModuleName(e,n);const i=resolveESModuleSymbol(r,n,t,false);markSymbolOfAliasDeclarationIfTypeOnly(e,r,i,false);return i}function getTargetOfNamespaceExport(e,t){const n=e.parent.moduleSpecifier;const r=n&&resolveExternalModuleName(e,n);const i=n&&resolveESModuleSymbol(r,n,t,false);markSymbolOfAliasDeclarationIfTypeOnly(e,r,i,false);return i}function combineValueAndTypeSymbols(e,t){if(e===xe&&t===xe){return xe}if(e.flags&(788968|1920)){return e}const n=createSymbol(e.flags|t.flags,e.escapedName);S.assert(e.declarations||t.declarations);n.declarations=deduplicate(concatenate(e.declarations,t.declarations),equateValues);n.parent=e.parent||t.parent;if(e.valueDeclaration)n.valueDeclaration=e.valueDeclaration;if(t.members)n.members=new Map(t.members);if(e.exports)n.exports=new Map(e.exports);return n}function getExportOfModule(e,t,n,r){var i;if(e.flags&1536){const o=getExportsOfSymbol(e).get(t);const a=resolveSymbol(o,r);const s=(i=getSymbolLinks(e).typeOnlyExportStarMap)==null?void 0:i.get(t);markSymbolOfAliasDeclarationIfTypeOnly(n,o,a,false,s,t);return a}}function getPropertyOfVariable(e,t){if(e.flags&3){const n=e.valueDeclaration.type;if(n){return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(n),t))}}}function getExternalModuleMember(e,t,n=false){var r;const i=getExternalModuleRequireArgument(e)||e.moduleSpecifier;const o=resolveExternalModuleName(e,i);const a=!isPropertyAccessExpression(t)&&t.propertyName||t.name;if(!isIdentifier(a)&&a.kind!==11){return void 0}const s=moduleExportNameTextEscaped(a);const c=s==="default"&&N;const l=resolveESModuleSymbol(o,i,false,c);if(l){if(s||a.kind===11){if(isShorthandAmbientModuleSymbol(o)){return o}let c;if(o&&o.exports&&o.exports.get("export=")){c=getPropertyOfType(getTypeOfSymbol(l),s,true)}else{c=getPropertyOfVariable(l,s)}c=resolveSymbol(c,n);let d=getExportOfModule(l,s,t,n);if(d===void 0&&s==="default"){const e=(r=o.declarations)==null?void 0:r.find(isSourceFile);if(isOnlyImportableAsDefault(i,o)||canHaveSyntheticDefault(e,o,n,i)){d=resolveExternalModuleSymbol(o,n)||resolveSymbol(o,n)}}const p=d&&c&&d!==c?combineValueAndTypeSymbols(c,d):d||c;if(isImportOrExportSpecifier(t)&&isOnlyImportableAsDefault(i,o)&&s!=="default"){error2(a,wt.Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0,Qe[x])}else if(!p){errorNoModuleMemberSymbol(o,l,e,a)}return p}}}function errorNoModuleMemberSymbol(e,t,n,r){var i;const o=getFullyQualifiedName(e,n);const a=declarationNameToString(r);const s=isIdentifier(r)?getSuggestedSymbolForNonexistentModule(r,t):void 0;if(s!==void 0){const e=symbolToString(s);const t=error2(r,wt._0_has_no_exported_member_named_1_Did_you_mean_2,o,a,e);if(s.valueDeclaration){addRelatedInfo(t,createDiagnosticForNode(s.valueDeclaration,wt._0_is_declared_here,e))}}else{if((i=e.exports)==null?void 0:i.has("default")){error2(r,wt.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,o,a)}else{reportNonExportedMember(n,r,a,e,o)}}}function reportNonExportedMember(e,t,n,r,i){var o,a;const s=(a=(o=tryCast(r.valueDeclaration,canHaveLocals))==null?void 0:o.locals)==null?void 0:a.get(moduleExportNameTextEscaped(t));const c=r.exports;if(s){const r=c==null?void 0:c.get("export=");if(r){getSymbolIfSameReference(r,s)?reportInvalidImportEqualsExportMember(e,t,n,i):error2(t,wt.Module_0_has_no_exported_member_1,i,n)}else{const e=c?find(symbolsToArray(c),(e=>!!getSymbolIfSameReference(e,s))):void 0;const r=e?error2(t,wt.Module_0_declares_1_locally_but_it_is_exported_as_2,i,n,symbolToString(e)):error2(t,wt.Module_0_declares_1_locally_but_it_is_not_exported,i,n);if(s.declarations){addRelatedInfo(r,...map(s.declarations,((e,t)=>createDiagnosticForNode(e,t===0?wt._0_is_declared_here:wt.and_here,n))))}}}else{error2(t,wt.Module_0_has_no_exported_member_1,i,n)}}function reportInvalidImportEqualsExportMember(e,t,n,r){if(x>=5){const e=Kn(T)?wt._0_can_only_be_imported_by_using_a_default_import:wt._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;error2(t,e,n)}else{if(isInJSFile(e)){const e=Kn(T)?wt._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:wt._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;error2(t,e,n)}else{const e=Kn(T)?wt._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:wt._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;error2(t,e,n,n,r)}}}function getTargetOfImportSpecifier(e,t){if(isImportSpecifier(e)&&moduleExportNameIsDefault(e.propertyName||e.name)){const n=getModuleSpecifierForImportOrExport(e);const r=n&&resolveExternalModuleName(e,n);if(r){return getTargetofModuleDefault(r,e,t)}}const n=isBindingElement(e)?getRootDeclaration(e):e.parent.parent.parent;const r=getCommonJSPropertyAccess(n);const i=getExternalModuleMember(n,r||e,t);const o=e.propertyName||e.name;if(r&&i&&isIdentifier(o)){return resolveSymbol(getPropertyOfType(getTypeOfSymbol(i),o.escapedText),t)}markSymbolOfAliasDeclarationIfTypeOnly(e,void 0,i,false);return i}function getCommonJSPropertyAccess(e){if(isVariableDeclaration(e)&&e.initializer&&isPropertyAccessExpression(e.initializer)){return e.initializer}}function getTargetOfNamespaceExportDeclaration(e,t){if(canHaveSymbol(e.parent)){const n=resolveExternalModuleSymbol(e.parent.symbol,t);markSymbolOfAliasDeclarationIfTypeOnly(e,void 0,n,false);return n}}function getTargetOfExportSpecifier(e,t,n){const r=e.propertyName||e.name;if(moduleExportNameIsDefault(r)){const t=getModuleSpecifierForImportOrExport(e);const r=t&&resolveExternalModuleName(e,t);if(r){return getTargetofModuleDefault(r,e,!!n)}}const i=e.parent.parent.moduleSpecifier?getExternalModuleMember(e.parent.parent,e,n):r.kind===11?void 0:resolveEntityName(r,t,false,n);markSymbolOfAliasDeclarationIfTypeOnly(e,void 0,i,false);return i}function getTargetOfExportAssignment(e,t){const n=isExportAssignment(e)?e.expression:e.right;const r=getTargetOfAliasLikeExpression(n,t);markSymbolOfAliasDeclarationIfTypeOnly(e,void 0,r,false);return r}function getTargetOfAliasLikeExpression(e,t){if(isClassExpression(e)){return checkExpressionCached(e).symbol}if(!isEntityName(e)&&!isEntityNameExpression(e)){return void 0}const n=resolveEntityName(e,111551|788968|1920,true,t);if(n){return n}checkExpressionCached(e);return getNodeLinks(e).resolvedSymbol}function getTargetOfAccessExpression(e,t){if(!(isBinaryExpression(e.parent)&&e.parent.left===e&&e.parent.operatorToken.kind===64)){return void 0}return getTargetOfAliasLikeExpression(e.parent.right,t)}function getTargetOfAliasDeclaration(e,t=false){switch(e.kind){case 271:case 260:return getTargetOfImportEqualsDeclaration(e,t);case 273:return getTargetOfImportClause(e,t);case 274:return getTargetOfNamespaceImport(e,t);case 280:return getTargetOfNamespaceExport(e,t);case 276:case 208:return getTargetOfImportSpecifier(e,t);case 281:return getTargetOfExportSpecifier(e,111551|788968|1920,t);case 277:case 226:return getTargetOfExportAssignment(e,t);case 270:return getTargetOfNamespaceExportDeclaration(e,t);case 304:return resolveEntityName(e.name,111551|788968|1920,true,t);case 303:return getTargetOfAliasLikeExpression(e.initializer,t);case 212:case 211:return getTargetOfAccessExpression(e,t);default:return S.fail()}}function isNonLocalAlias(e,t=111551|788968|1920){if(!e)return false;return(e.flags&(2097152|t))===2097152||!!(e.flags&2097152&&e.flags&67108864)}function resolveSymbol(e,t){return!t&&isNonLocalAlias(e)?resolveAlias(e):e}function resolveAlias(e){S.assert((e.flags&2097152)!==0,"Should only get Alias here.");const t=getSymbolLinks(e);if(!t.aliasTarget){t.aliasTarget=be;const n=getDeclarationOfAliasSymbol(e);if(!n)return S.fail();const r=getTargetOfAliasDeclaration(n);if(t.aliasTarget===be){t.aliasTarget=r||xe}else{error2(n,wt.Circular_definition_of_import_alias_0,symbolToString(e))}}else if(t.aliasTarget===be){t.aliasTarget=xe}return t.aliasTarget}function tryResolveAlias(e){const t=getSymbolLinks(e);if(t.aliasTarget!==be){return resolveAlias(e)}return void 0}function getSymbolFlags(e,t,n){const r=t&&getTypeOnlyAliasDeclaration(e);const i=r&&isExportDeclaration(r);const o=r&&(i?resolveExternalModuleName(r.moduleSpecifier,r.moduleSpecifier,true):resolveAlias(r.symbol));const a=i&&o?getExportsOfModule(o):void 0;let s=n?0:e.flags;let c;while(e.flags&2097152){const t=getExportSymbolOfValueSymbolIfExported(resolveAlias(e));if(!i&&t===o||(a==null?void 0:a.get(t.escapedName))===t){break}if(t===xe){return-1}if(t===e||(c==null?void 0:c.has(t))){break}if(t.flags&2097152){if(c){c.add(t)}else{c=new Set([e,t])}}s|=t.flags;e=t}return s}function markSymbolOfAliasDeclarationIfTypeOnly(e,t,n,r,i,o){if(!e||isPropertyAccessExpression(e))return false;const a=getSymbolOfDeclaration(e);if(isTypeOnlyImportOrExportDeclaration(e)){const t=getSymbolLinks(a);t.typeOnlyDeclaration=e;return true}if(i){const e=getSymbolLinks(a);e.typeOnlyDeclaration=i;if(a.escapedName!==o){e.typeOnlyExportStarName=o}return true}const s=getSymbolLinks(a);return markSymbolOfAliasDeclarationIfTypeOnlyWorker(s,t,r)||markSymbolOfAliasDeclarationIfTypeOnlyWorker(s,n,r)}function markSymbolOfAliasDeclarationIfTypeOnlyWorker(e,t,n){var r;if(t&&(e.typeOnlyDeclaration===void 0||n&&e.typeOnlyDeclaration===false)){const n=((r=t.exports)==null?void 0:r.get("export="))??t;const i=n.declarations&&find(n.declarations,isTypeOnlyImportOrExportDeclaration);e.typeOnlyDeclaration=i??getSymbolLinks(n).typeOnlyDeclaration??false}return!!e.typeOnlyDeclaration}function getTypeOnlyAliasDeclaration(e,t){var n;if(!(e.flags&2097152)){return void 0}const r=getSymbolLinks(e);if(r.typeOnlyDeclaration===void 0){r.typeOnlyDeclaration=false;const t=resolveSymbol(e);markSymbolOfAliasDeclarationIfTypeOnly((n=e.declarations)==null?void 0:n[0],getDeclarationOfAliasSymbol(e)&&getImmediateAliasedSymbol(e),t,true)}if(t===void 0){return r.typeOnlyDeclaration||void 0}if(r.typeOnlyDeclaration){const n=r.typeOnlyDeclaration.kind===278?resolveSymbol(getExportsOfModule(r.typeOnlyDeclaration.symbol.parent).get(r.typeOnlyExportStarName||e.escapedName)):resolveAlias(r.typeOnlyDeclaration.symbol);return getSymbolFlags(n)&t?r.typeOnlyDeclaration:void 0}return void 0}function getSymbolOfPartOfRightHandSideOfImportEquals(e,t){if(e.kind===80&&isRightSideOfQualifiedNameOrPropertyAccess(e)){e=e.parent}if(e.kind===80||e.parent.kind===166){return resolveEntityName(e,1920,false,t)}else{S.assert(e.parent.kind===271);return resolveEntityName(e,111551|788968|1920,false,t)}}function getFullyQualifiedName(e,t){return e.parent?getFullyQualifiedName(e.parent,t)+"."+symbolToString(e):symbolToString(e,t,void 0,32|4)}function getContainingQualifiedNameNode(e){while(isQualifiedName(e.parent)){e=e.parent}return e}function tryGetQualifiedNameAsValue(e){let t=getFirstIdentifier(e);let n=te(t,t,111551,void 0,true);if(!n){return void 0}while(isQualifiedName(t.parent)){const e=getTypeOfSymbol(n);n=getPropertyOfType(e,t.parent.right.escapedText);if(!n){return void 0}t=t.parent}return n}function resolveEntityName(e,t,n,r,i){if(nodeIsMissing(e)){return void 0}const o=1920|(isInJSFile(e)?t&111551:0);let a;if(e.kind===80){const r=t===o||nodeIsSynthesized(e)?wt.Cannot_find_namespace_0:getCannotFindNameDiagnosticForName(getFirstIdentifier(e));const s=isInJSFile(e)&&!nodeIsSynthesized(e)?resolveEntityNameFromAssignmentDeclaration(e,t):void 0;a=getMergedSymbol(te(i||e,e,t,n||s?void 0:r,true,false));if(!a){return getMergedSymbol(s)}}else if(e.kind===166||e.kind===211){const r=e.kind===166?e.left:e.expression;const s=e.kind===166?e.right:e.name;let c=resolveEntityName(r,o,n,false,i);if(!c||nodeIsMissing(s)){return void 0}else if(c===xe){return c}if(c.valueDeclaration&&isInJSFile(c.valueDeclaration)&&qn(T)!==100&&isVariableDeclaration(c.valueDeclaration)&&c.valueDeclaration.initializer&&isCommonJsRequire(c.valueDeclaration.initializer)){const e=c.valueDeclaration.initializer.arguments[0];const t=resolveExternalModuleName(e,e);if(t){const e=resolveExternalModuleSymbol(t);if(e){c=e}}}a=getMergedSymbol(getSymbol2(getExportsOfSymbol(c),s.escapedText,t));if(!a&&c.flags&2097152){a=getMergedSymbol(getSymbol2(getExportsOfSymbol(resolveAlias(c)),s.escapedText,t))}if(!a){if(!n){const n=getFullyQualifiedName(c);const r=declarationNameToString(s);const i=getSuggestedSymbolForNonexistentModule(s,c);if(i){error2(s,wt._0_has_no_exported_member_named_1_Did_you_mean_2,n,r,symbolToString(i));return void 0}const o=isQualifiedName(e)&&getContainingQualifiedNameNode(e);const a=en&&t&788968&&o&&!isTypeOfExpression(o.parent)&&tryGetQualifiedNameAsValue(o);if(a){error2(o,wt._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,entityNameToString(o));return void 0}if(t&1920&&isQualifiedName(e.parent)){const t=getMergedSymbol(getSymbol2(getExportsOfSymbol(c),s.escapedText,788968));if(t){error2(e.parent.right,wt.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,symbolToString(t),unescapeLeadingUnderscores(e.parent.right.escapedText));return void 0}}error2(s,wt.Namespace_0_has_no_exported_member_1,n,r)}return void 0}}else{S.assertNever(e,"Unknown entity name kind.")}if(!nodeIsSynthesized(e)&&isEntityName(e)&&(a.flags&2097152||e.parent.kind===277)){markSymbolOfAliasDeclarationIfTypeOnly(getAliasDeclarationFromName(e),a,void 0,true)}return a.flags&t||r?a:resolveAlias(a)}function resolveEntityNameFromAssignmentDeclaration(e,t){if(isJSDocTypeReference(e.parent)){const n=getAssignmentDeclarationLocation(e.parent);if(n){return te(n,e,t,void 0,true)}}}function getAssignmentDeclarationLocation(e){const t=findAncestor(e,(e=>!(isJSDocNode(e)||e.flags&16777216)?"quit":isJSDocTypeAlias(e)));if(t){return}const n=getJSDocHost(e);if(n&&isExpressionStatement(n)&&isPrototypePropertyAssignment(n.expression)){const e=getSymbolOfDeclaration(n.expression.left);if(e){return getDeclarationOfJSPrototypeContainer(e)}}if(n&&isFunctionExpression(n)&&isPrototypePropertyAssignment(n.parent)&&isExpressionStatement(n.parent.parent)){const e=getSymbolOfDeclaration(n.parent.left);if(e){return getDeclarationOfJSPrototypeContainer(e)}}if(n&&(isObjectLiteralMethod(n)||isPropertyAssignment(n))&&isBinaryExpression(n.parent.parent)&&getAssignmentDeclarationKind(n.parent.parent)===6){const e=getSymbolOfDeclaration(n.parent.parent.left);if(e){return getDeclarationOfJSPrototypeContainer(e)}}const r=getEffectiveJSDocHost(e);if(r&&isFunctionLike(r)){const e=getSymbolOfDeclaration(r);return e&&e.valueDeclaration}}function getDeclarationOfJSPrototypeContainer(e){const t=e.parent.valueDeclaration;if(!t){return void 0}const n=isAssignmentDeclaration(t)?getAssignedExpandoInitializer(t):hasOnlyExpressionInitializer(t)?getDeclaredExpandoInitializer(t):void 0;return n||t}function getExpandoSymbol(e){const t=e.valueDeclaration;if(!t||!isInJSFile(t)||e.flags&524288||getExpandoInitializer(t,false)){return void 0}const n=isVariableDeclaration(t)?getDeclaredExpandoInitializer(t):getAssignedExpandoInitializer(t);if(n){const t=getSymbolOfNode(n);if(t){return mergeJSSymbols(t,e)}}}function resolveExternalModuleName(e,t,n){const r=qn(T)===1;const i=r?wt.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:wt.Cannot_find_module_0_or_its_corresponding_type_declarations;return resolveExternalModuleNameWorker(e,t,n?void 0:i,n)}function resolveExternalModuleNameWorker(e,t,n,r=false,i=false){return isStringLiteralLike(t)?resolveExternalModule(e,t.text,n,!r?t:void 0,i):void 0}function resolveExternalModule(t,n,r,i,o=false){var a,s,c,l,d,p,u,f,m,_,g;if(i&&startsWith(n,"@types/")){const e=wt.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;const t=removePrefix(n,"@types/");error2(i,e,t,n)}const y=tryFindAmbientModule(n,true);if(y){return y}const h=getSourceFileOfNode(t);const v=isStringLiteralLike(t)?t:((a=isModuleDeclaration(t)?t:t.parent&&isModuleDeclaration(t.parent)&&t.parent.name===t?t.parent:void 0)==null?void 0:a.name)||((s=isLiteralImportTypeNode(t)?t:void 0)==null?void 0:s.argument.literal)||(isVariableDeclaration(t)&&t.initializer&&isRequireCall(t.initializer,true)?t.initializer.arguments[0]:void 0)||((c=findAncestor(t,isImportCall))==null?void 0:c.arguments[0])||((l=findAncestor(t,or(isImportDeclaration,isJSDocImportTag,isExportDeclaration)))==null?void 0:l.moduleSpecifier)||((d=findAncestor(t,isExternalModuleImportEqualsDeclaration))==null?void 0:d.moduleReference.expression);const b=v&&isStringLiteralLike(v)?e.getModeForUsageLocation(h,v):e.getDefaultResolutionModeForFile(h);const C=qn(T);const E=(p=e.getResolvedModule(h,n,b))==null?void 0:p.resolvedModule;const N=i&&E&&getResolutionDiagnostic(T,E,h);const k=E&&(!N||N===wt.Module_0_was_resolved_to_1_but_jsx_is_not_set)&&e.getSourceFile(E.resolvedFileName);if(k){if(N){error2(i,N,n,E.resolvedFileName)}if(E.resolvedUsingTsExtension&&isDeclarationFileName(n)){const e=((u=findAncestor(t,isImportDeclaration))==null?void 0:u.importClause)||findAncestor(t,or(isImportEqualsDeclaration,isExportDeclaration));if(i&&e&&!e.isTypeOnly||findAncestor(t,isImportCall)){error2(i,wt.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead,getSuggestedImportSource(S.checkDefined(tryExtractTSExtension(n))))}}else if(E.resolvedUsingTsExtension&&!shouldAllowImportingTsExtension(T,h.fileName)){const e=((f=findAncestor(t,isImportDeclaration))==null?void 0:f.importClause)||findAncestor(t,or(isImportEqualsDeclaration,isExportDeclaration));if(i&&!((e==null?void 0:e.isTypeOnly)||findAncestor(t,isImportTypeNode))){const e=S.checkDefined(tryExtractTSExtension(n));error2(i,wt.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled,e)}}else if(T.rewriteRelativeImportExtensions&&!(t.flags&33554432)&&!isDeclarationFileName(n)&&!isLiteralImportTypeNode(t)&&!isPartOfTypeOnlyImportOrExportDeclaration(t)){const t=shouldRewriteModuleSpecifier(n,T);if(!E.resolvedUsingTsExtension&&t){error2(i,wt.This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0,getRelativePathFromFile(getNormalizedAbsolutePath(h.fileName,e.getCurrentDirectory()),E.resolvedFileName,hostGetCanonicalFileName(e)))}else if(E.resolvedUsingTsExtension&&!t&&sourceFileMayBeEmitted(k,e)){error2(i,wt.This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path,getAnyExtensionFromPath(n))}else if(E.resolvedUsingTsExtension&&t){const t=e.getResolvedProjectReferenceToRedirect(k.path);if(t){const n=!e.useCaseSensitiveFileNames();const r=e.getCommonSourceDirectory();const o=getCommonSourceDirectoryOfConfig(t.commandLine,n);const a=getRelativePathFromDirectory(r,o,n);const s=getRelativePathFromDirectory(T.outDir||r,t.commandLine.options.outDir||o,n);if(a!==s){error2(i,wt.This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files)}}}}if(k.symbol){if(i&&E.isExternalLibraryImport&&!resolutionExtensionIsTSOrJson(E.extension)){errorOnImplicitAnyModule(false,i,h,b,E,n)}if(i&&(x===100||x===101)){const e=h.impliedNodeFormat===1&&!findAncestor(t,isImportCall)||!!findAncestor(t,isImportEqualsDeclaration);const r=findAncestor(t,(e=>isImportTypeNode(e)||isExportDeclaration(e)||isImportDeclaration(e)||isJSDocImportTag(e)));if(e&&k.impliedNodeFormat===99&&!hasResolutionModeOverride(r)){if(findAncestor(t,isImportEqualsDeclaration)){error2(i,wt.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead,n)}else{let e;const t=tryGetExtensionFromPath2(h.fileName);if(t===".ts"||t===".js"||t===".tsx"||t===".jsx"){e=createModeMismatchDetails(h)}const o=(r==null?void 0:r.kind)===272&&((m=r.importClause)==null?void 0:m.isTypeOnly)?wt.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:(r==null?void 0:r.kind)===205?wt.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute:wt.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead;gi.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(i),i,chainDiagnosticMessages(e,o,n)))}}}return getMergedSymbol(k.symbol)}if(i&&r&&!isSideEffectImport(i)){error2(i,wt.File_0_is_not_a_module,k.fileName)}return void 0}if(Yt){const e=findBestPatternMatch(Yt,(e=>e.pattern),n);if(e){const t=Zt&&Zt.get(n);if(t){return getMergedSymbol(t)}return getMergedSymbol(e.symbol)}}if(!i){return void 0}if(E&&!resolutionExtensionIsTSOrJson(E.extension)&&N===void 0||N===wt.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type){if(o){const e=wt.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;error2(i,e,n,E.resolvedFileName)}else{errorOnImplicitAnyModule(A&&!!r,i,h,b,E,n)}return void 0}if(r){if(E){const t=e.getProjectReferenceRedirect(E.resolvedFileName);if(t){error2(i,wt.Output_file_0_has_not_been_built_from_source_file_1,t,E.resolvedFileName);return void 0}}if(N){error2(i,N,n,E.resolvedFileName)}else{const t=pathIsRelative(n)&&!hasExtension(n);const o=C===3||C===99;if(!Yn(T)&&fileExtensionIs(n,".json")&&C!==1&&hasJsonModuleEmitEnabled(T)){error2(i,wt.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension,n)}else if(b===99&&o&&t){const t=getNormalizedAbsolutePath(n,getDirectoryPath(h.path));const r=(_=ki.find((([n,r])=>e.fileExists(t+n))))==null?void 0:_[1];if(r){error2(i,wt.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0,n+r)}else{error2(i,wt.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path)}}else{if((g=e.getResolvedModule(h,n,b))==null?void 0:g.alternateResult){const t=createModuleNotFoundChain(h,e,n,b,n);errorOrSuggestion(true,i,chainDiagnosticMessages(t,r,n))}else{error2(i,r,n)}}}}return void 0;function getSuggestedImportSource(e){const t=removeExtension(n,e);if(emitModuleKindIsNonNodeESM(x)||b===99){const r=isDeclarationFileName(n)&&shouldAllowImportingTsExtension(T);const i=e===".mts"||e===".d.mts"?r?".mts":".mjs":e===".cts"||e===".d.mts"?r?".cts":".cjs":r?".ts":".js";return t+i}return t}}function errorOnImplicitAnyModule(t,n,r,i,{packageId:o,resolvedFileName:a},s){if(isSideEffectImport(n)){return}let c;if(!isExternalModuleNameRelative(s)&&o){c=createModuleNotFoundChain(r,e,s,i,o.name)}errorOrSuggestion(t,n,chainDiagnosticMessages(c,wt.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,s,a))}function resolveExternalModuleSymbol(e,t){if(e==null?void 0:e.exports){const n=resolveSymbol(e.exports.get("export="),t);const r=getCommonJsExportEquals(getMergedSymbol(n),getMergedSymbol(e));return getMergedSymbol(r)||e}return void 0}function getCommonJsExportEquals(e,t){if(!e||e===xe||e===t||t.exports.size===1||e.flags&2097152){return e}const n=getSymbolLinks(e);if(n.cjsExportMerged){return n.cjsExportMerged}const r=e.flags&33554432?e:cloneSymbol(e);r.flags=r.flags|512;if(r.exports===void 0){r.exports=createSymbolTable()}t.exports.forEach(((e,t)=>{if(t==="export=")return;r.exports.set(t,r.exports.has(t)?mergeSymbol(r.exports.get(t),e):e)}));if(r===e){getSymbolLinks(r).resolvedExports=void 0;getSymbolLinks(r).resolvedMembers=void 0}getSymbolLinks(r).cjsExportMerged=r;return n.cjsExportMerged=r}function resolveESModuleSymbol(t,n,r,i){var o;const a=resolveExternalModuleSymbol(t,r);if(!r&&a){if(!i&&!(a.flags&(1536|3))&&!getDeclarationOfKind(a,307)){const e=x>=5?"allowSyntheticDefaultImports":"esModuleInterop";error2(n,wt.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export,e);return a}const r=n.parent;if(isImportDeclaration(r)&&getNamespaceDeclarationNode(r)||isImportCall(r)){const n=isImportCall(r)?r.arguments[0]:r.moduleSpecifier;const i=getTypeOfSymbol(a);const s=getTypeWithSyntheticDefaultOnly(i,a,t,n);if(s){return cloneTypeAsModuleType(a,s,r)}const c=(o=t==null?void 0:t.declarations)==null?void 0:o.find(isSourceFile);const l=c&&isESMFormatImportImportingCommonjsFormatFile(getEmitSyntaxForModuleSpecifierExpression(n),e.getImpliedNodeFormatForEmit(c));if(Kn(T)||l){let e=getSignaturesOfStructuredType(i,0);if(!e||!e.length){e=getSignaturesOfStructuredType(i,1)}if(e&&e.length||getPropertyOfType(i,"default",true)||l){const e=i.flags&3670016?getTypeWithSyntheticDefaultImportType(i,a,t,n):createDefaultPropertyWrapperForModule(a,a.parent);return cloneTypeAsModuleType(a,e,r)}}}}return a}function cloneTypeAsModuleType(e,t,n){const r=createSymbol(e.flags,e.escapedName);r.declarations=e.declarations?e.declarations.slice():[];r.parent=e.parent;r.links.target=e;r.links.originatingImport=n;if(e.valueDeclaration)r.valueDeclaration=e.valueDeclaration;if(e.constEnumOnlyModule)r.constEnumOnlyModule=true;if(e.members)r.members=new Map(e.members);if(e.exports)r.exports=new Map(e.exports);const i=resolveStructuredTypeMembers(t);r.links.type=createAnonymousType(r,i.members,d,d,i.indexInfos);return r}function hasExportAssignmentSymbol(e){return e.exports.get("export=")!==void 0}function getExportsOfModuleAsArray(e){return symbolsToArray(getExportsOfModule(e))}function getExportsAndPropertiesOfModule(e){const t=getExportsOfModuleAsArray(e);const n=resolveExternalModuleSymbol(e);if(n!==e){const e=getTypeOfSymbol(n);if(shouldTreatPropertiesOfExternalModuleAsExports(e)){addRange(t,getPropertiesOfType(e))}}return t}function forEachExportAndPropertyOfModule(e,t){const n=getExportsOfModule(e);n.forEach(((e,n)=>{if(!isReservedMemberName(n)){t(e,n)}}));const r=resolveExternalModuleSymbol(e);if(r!==e){const e=getTypeOfSymbol(r);if(shouldTreatPropertiesOfExternalModuleAsExports(e)){forEachPropertyOfType(e,((e,n)=>{t(e,n)}))}}}function tryGetMemberInModuleExports(e,t){const n=getExportsOfModule(t);if(n){return n.get(e)}}function tryGetMemberInModuleExportsAndProperties(e,t){const n=tryGetMemberInModuleExports(e,t);if(n){return n}const r=resolveExternalModuleSymbol(t);if(r===t){return void 0}const i=getTypeOfSymbol(r);return shouldTreatPropertiesOfExternalModuleAsExports(i)?getPropertyOfType(i,e):void 0}function shouldTreatPropertiesOfExternalModuleAsExports(e){return!(e.flags&402784252||getObjectFlags(e)&1||isArrayType(e)||isTupleType(e))}function getExportsOfSymbol(e){return e.flags&6256?getResolvedMembersOrExportsOfSymbol(e,"resolvedExports"):e.flags&1536?getExportsOfModule(e):e.exports||y}function getExportsOfModule(e){const t=getSymbolLinks(e);if(!t.resolvedExports){const{exports:n,typeOnlyExportStarMap:r}=getExportsOfModuleWorker(e);t.resolvedExports=n;t.typeOnlyExportStarMap=r}return t.resolvedExports}function extendExportSymbols(e,t,n,r){if(!t)return;t.forEach(((t,i)=>{if(i==="default")return;const o=e.get(i);if(!o){e.set(i,t);if(n&&r){n.set(i,{specifierText:getTextOfNode(r.moduleSpecifier)})}}else if(n&&r&&o&&resolveSymbol(o)!==resolveSymbol(t)){const e=n.get(i);if(!e.exportsWithDuplicate){e.exportsWithDuplicate=[r]}else{e.exportsWithDuplicate.push(r)}}}))}function getExportsOfModuleWorker(e){const t=[];let n;const r=new Set;e=resolveExternalModuleSymbol(e);const i=visit(e)||y;if(n){r.forEach((e=>n.delete(e)))}return{exports:i,typeOnlyExportStarMap:n};function visit(e,i,o){if(!o&&(e==null?void 0:e.exports)){e.exports.forEach(((e,t)=>r.add(t)))}if(!(e&&e.exports&&pushIfUnique(t,e))){return}const a=new Map(e.exports);const s=e.exports.get("__export");if(s){const e=createSymbolTable();const t=new Map;if(s.declarations){for(const n of s.declarations){const r=resolveExternalModuleName(n,n.moduleSpecifier);const i=visit(r,n,o||n.isTypeOnly);extendExportSymbols(e,i,t,n)}}t.forEach((({exportsWithDuplicate:e},n)=>{if(n==="export="||!(e&&e.length)||a.has(n)){return}for(const r of e){gi.add(createDiagnosticForNode(r,wt.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity,t.get(n).specifierText,unescapeLeadingUnderscores(n)))}}));extendExportSymbols(a,e)}if(i==null?void 0:i.isTypeOnly){n??(n=new Map);a.forEach(((e,t)=>n.set(t,i)))}return a}}function getMergedSymbol(e){let t;return e&&e.mergeId&&(t=Qr[e.mergeId])?t:e}function getSymbolOfDeclaration(e){return getMergedSymbol(e.symbol&&getLateBoundSymbol(e.symbol))}function getSymbolOfNode(e){return canHaveSymbol(e)?getSymbolOfDeclaration(e):void 0}function getParentOfSymbol(e){return getMergedSymbol(e.parent&&getLateBoundSymbol(e.parent))}function getFunctionExpressionParentSymbolOrSymbol(e){var t,n;return((t=e.valueDeclaration)==null?void 0:t.kind)===219||((n=e.valueDeclaration)==null?void 0:n.kind)===218?getSymbolOfNode(e.valueDeclaration.parent)||e:e}function getAlternativeContainingModules(t,n){const r=getSourceFileOfNode(n);const i=getNodeId(r);const o=getSymbolLinks(t);let a;if(o.extendedContainersByFile&&(a=o.extendedContainersByFile.get(i))){return a}if(r&&r.imports){for(const e of r.imports){if(nodeIsSynthesized(e))continue;const r=resolveExternalModuleName(n,e,true);if(!r)continue;const i=getAliasForSymbolInContainer(r,t);if(!i)continue;a=append(a,r)}if(length(a)){(o.extendedContainersByFile||(o.extendedContainersByFile=new Map)).set(i,a);return a}}if(o.extendedContainers){return o.extendedContainers}const s=e.getSourceFiles();for(const e of s){if(!isExternalModule(e))continue;const n=getSymbolOfDeclaration(e);const r=getAliasForSymbolInContainer(n,t);if(!r)continue;a=append(a,n)}return o.extendedContainers=a||d}function getContainersOfSymbol(e,t,n){const r=getParentOfSymbol(e);if(r&&!(e.flags&262144)){return getWithAlternativeContainers(r)}const i=mapDefined(e.declarations,(t=>{if(!isAmbientModule(t)&&t.parent){if(hasNonGlobalAugmentationExternalModuleSymbol(t.parent)){return getSymbolOfDeclaration(t.parent)}if(isModuleBlock(t.parent)&&t.parent.parent&&resolveExternalModuleSymbol(getSymbolOfDeclaration(t.parent.parent))===e){return getSymbolOfDeclaration(t.parent.parent)}}if(isClassExpression(t)&&isBinaryExpression(t.parent)&&t.parent.operatorToken.kind===64&&isAccessExpression(t.parent.left)&&isEntityNameExpression(t.parent.left.expression)){if(isModuleExportsAccessExpression(t.parent.left)||isExportsIdentifier(t.parent.left.expression)){return getSymbolOfDeclaration(getSourceFileOfNode(t))}checkExpressionCached(t.parent.left.expression);return getNodeLinks(t.parent.left.expression).resolvedSymbol}}));if(!length(i)){return void 0}const o=mapDefined(i,(t=>getAliasForSymbolInContainer(t,e)?t:void 0));let a=[];let s=[];for(const e of o){const[t,...n]=getWithAlternativeContainers(e);a=append(a,t);s=addRange(s,n)}return concatenate(a,s);function getWithAlternativeContainers(r){const i=mapDefined(r.declarations,fileSymbolIfFileSymbolExportEqualsContainer);const o=t&&getAlternativeContainingModules(e,t);const a=getVariableDeclarationOfObjectLiteral(r,n);if(t&&r.flags&getQualifiedLeftMeaning(n)&&getAccessibleSymbolChain(r,t,1920,false)){return append(concatenate(concatenate([r],i),o),a)}const s=!(r.flags&getQualifiedLeftMeaning(n))&&r.flags&788968&&getDeclaredTypeOfSymbol(r).flags&524288&&n===111551?forEachSymbolTableInScope(t,(e=>forEachEntry(e,(e=>{if(e.flags&getQualifiedLeftMeaning(n)&&getTypeOfSymbol(e)===getDeclaredTypeOfSymbol(r)){return e}})))):void 0;let c=s?[s,...i,r]:[...i,r];c=append(c,a);c=addRange(c,o);return c}function fileSymbolIfFileSymbolExportEqualsContainer(e){return r&&getFileSymbolIfFileSymbolExportEqualsContainer(e,r)}}function getVariableDeclarationOfObjectLiteral(e,t){const n=!!length(e.declarations)&&first(e.declarations);if(t&111551&&n&&n.parent&&isVariableDeclaration(n.parent)){if(isObjectLiteralExpression(n)&&n===n.parent.initializer||isTypeLiteralNode(n)&&n===n.parent.type){return getSymbolOfDeclaration(n.parent)}}}function getFileSymbolIfFileSymbolExportEqualsContainer(e,t){const n=getExternalModuleContainer(e);const r=n&&n.exports&&n.exports.get("export=");return r&&getSymbolIfSameReference(r,t)?n:void 0}function getAliasForSymbolInContainer(e,t){if(e===getParentOfSymbol(t)){return t}const n=e.exports&&e.exports.get("export=");if(n&&getSymbolIfSameReference(n,t)){return e}const r=getExportsOfSymbol(e);const i=r.get(t.escapedName);if(i&&getSymbolIfSameReference(i,t)){return i}return forEachEntry(r,(e=>{if(getSymbolIfSameReference(e,t)){return e}}))}function getSymbolIfSameReference(e,t){if(getMergedSymbol(resolveSymbol(getMergedSymbol(e)))===getMergedSymbol(resolveSymbol(getMergedSymbol(t)))){return e}}function getExportSymbolOfValueSymbolIfExported(e){return getMergedSymbol(e&&(e.flags&1048576)!==0&&e.exportSymbol||e)}function symbolIsValue(e,t){return!!(e.flags&111551||e.flags&2097152&&getSymbolFlags(e,!t)&111551)}function createType(e){var t;const n=new o(re,e);s++;n.id=s;(t=G)==null?void 0:t.recordType(n);return n}function createTypeWithSymbol(e,t){const n=createType(e);n.symbol=t;return n}function createOriginType(e){return new o(re,e)}function createIntrinsicType(e,t,n=0,r){checkIntrinsicName(t,r);const i=createType(e);i.intrinsicName=t;i.debugIntrinsicName=r;i.objectFlags=n|524288|2097152|33554432|16777216;return i}function checkIntrinsicName(e,t){const n=`${e},${t??""}`;if(Ne.has(n)){S.fail(`Duplicate intrinsic type name ${e}${t?` (${t})`:""}; you may need to pass a name to createIntrinsicType.`)}Ne.add(n)}function createObjectType(e,t){const n=createTypeWithSymbol(524288,t);n.objectFlags=e;n.members=void 0;n.properties=void 0;n.callSignatures=void 0;n.constructSignatures=void 0;n.indexInfos=void 0;return n}function createTypeofType(){return getUnionType(arrayFrom(ra.keys(),getStringLiteralType))}function createTypeParameter(e){return createTypeWithSymbol(262144,e)}function isReservedMemberName(e){return e.charCodeAt(0)===95&&e.charCodeAt(1)===95&&e.charCodeAt(2)!==95&&e.charCodeAt(2)!==64&&e.charCodeAt(2)!==35}function getNamedMembers(e){let t;e.forEach(((e,n)=>{if(isNamedMember(e,n)){(t||(t=[])).push(e)}}));return t||d}function isNamedMember(e,t){return!isReservedMemberName(t)&&symbolIsValue(e)}function getNamedOrIndexSignatureMembers(e){const t=getNamedMembers(e);const n=getIndexSymbolFromSymbolTable(e);return n?concatenate(t,[n]):t}function setStructuredTypeMembers(e,t,n,r,i){const o=e;o.members=t;o.properties=d;o.callSignatures=n;o.constructSignatures=r;o.indexInfos=i;if(t!==y)o.properties=getNamedMembers(t);return o}function createAnonymousType(e,t,n,r,i){return setStructuredTypeMembers(createObjectType(16,e),t,n,r,i)}function getResolvedTypeWithoutAbstractConstructSignatures(e){if(e.constructSignatures.length===0)return e;if(e.objectTypeWithoutAbstractConstructSignatures)return e.objectTypeWithoutAbstractConstructSignatures;const t=filter(e.constructSignatures,(e=>!(e.flags&4)));if(e.constructSignatures===t)return e;const n=createAnonymousType(e.symbol,e.members,e.callSignatures,some(t)?t:d,e.indexInfos);e.objectTypeWithoutAbstractConstructSignatures=n;n.objectTypeWithoutAbstractConstructSignatures=n;return n}function forEachSymbolTableInScope(e,t){let n;for(let r=e;r;r=r.parent){if(canHaveLocals(r)&&r.locals&&!isGlobalSourceFile(r)){if(n=t(r.locals,void 0,true,r)){return n}}switch(r.kind){case 307:if(!isExternalOrCommonJsModule(r)){break}case 267:const e=getSymbolOfDeclaration(r);if(n=t((e==null?void 0:e.exports)||y,void 0,true,r)){return n}break;case 263:case 231:case 264:let i;(getSymbolOfDeclaration(r).members||y).forEach(((e,t)=>{if(e.flags&(788968&~67108864)){(i||(i=createSymbolTable())).set(t,e)}}));if(i&&(n=t(i,void 0,false,r))){return n}break}}return t(U,void 0,true)}function getQualifiedLeftMeaning(e){return e===111551?111551:1920}function getAccessibleSymbolChain(e,t,n,r,i=new Map){if(!(e&&!isPropertyOrMethodDeclarationSymbol(e))){return void 0}const o=getSymbolLinks(e);const a=o.accessibleChainCache||(o.accessibleChainCache=new Map);const s=forEachSymbolTableInScope(t,((e,t,n,r)=>r));const c=`${r?0:1}|${s?getNodeId(s):0}|${n}`;if(a.has(c)){return a.get(c)}const l=getSymbolId(e);let d=i.get(l);if(!d){i.set(l,d=[])}const p=forEachSymbolTableInScope(t,getAccessibleSymbolChainFromSymbolTable);a.set(c,p);return p;function getAccessibleSymbolChainFromSymbolTable(e,t,n){if(!pushIfUnique(d,e)){return void 0}const r=trySymbolTable(e,t,n);d.pop();return r}function canQualifySymbol(e,n){return!needsQualification(e,t,n)||!!getAccessibleSymbolChain(e.parent,t,getQualifiedLeftMeaning(n),r,i)}function isAccessible(t,r,i){return(e===(r||t)||getMergedSymbol(e)===getMergedSymbol(r||t))&&!some(t.declarations,hasNonGlobalAugmentationExternalModuleSymbol)&&(i||canQualifySymbol(getMergedSymbol(t),n))}function trySymbolTable(n,i,o){if(isAccessible(n.get(e.escapedName),void 0,i)){return[e]}const a=forEachEntry(n,(n=>{if(n.flags&2097152&&n.escapedName!=="export="&&n.escapedName!=="default"&&!(isUMDExportSymbol(n)&&t&&isExternalModule(getSourceFileOfNode(t)))&&(!r||some(n.declarations,isExternalModuleImportEqualsDeclaration))&&(o?!some(n.declarations,isNamespaceReexportDeclaration):true)&&(i||!getDeclarationOfKind(n,281))){const e=resolveAlias(n);const t=getCandidateListForSymbol(n,e,i);if(t){return t}}if(n.escapedName===e.escapedName&&n.exportSymbol){if(isAccessible(getMergedSymbol(n.exportSymbol),void 0,i)){return[e]}}}));return a||(n===U?getCandidateListForSymbol(V,V,i):void 0)}function getCandidateListForSymbol(e,t,r){if(isAccessible(e,t,r)){return[e]}const i=getExportsOfSymbol(t);const o=i&&getAccessibleSymbolChainFromSymbolTable(i,true);if(o&&canQualifySymbol(e,getQualifiedLeftMeaning(n))){return[e].concat(o)}}}function needsQualification(e,t,n){let r=false;forEachSymbolTableInScope(t,(t=>{let i=getMergedSymbol(t.get(e.escapedName));if(!i){return false}if(i===e){return true}const o=i.flags&2097152&&!getDeclarationOfKind(i,281);i=o?resolveAlias(i):i;const a=o?getSymbolFlags(i):i.flags;if(a&n){r=true;return true}return false}));return r}function isPropertyOrMethodDeclarationSymbol(e){if(e.declarations&&e.declarations.length){for(const t of e.declarations){switch(t.kind){case 172:case 174:case 177:case 178:continue;default:return false}}return true}return false}function isTypeSymbolAccessible(e,t){const n=isSymbolAccessibleWorker(e,t,788968,false,true);return n.accessibility===0}function isValueSymbolAccessible(e,t){const n=isSymbolAccessibleWorker(e,t,111551,false,true);return n.accessibility===0}function isSymbolAccessibleByFlags(e,t,n){const r=isSymbolAccessibleWorker(e,t,n,false,false);return r.accessibility===0}function isAnySymbolAccessible(e,t,n,r,i,o){if(!length(e))return;let a;let s=false;for(const c of e){const e=getAccessibleSymbolChain(c,t,r,false);if(e){a=c;const t=hasVisibleDeclarations(e[0],i);if(t){return t}}if(o){if(some(c.declarations,hasNonGlobalAugmentationExternalModuleSymbol)){if(i){s=true;continue}return{accessibility:0}}}const l=getContainersOfSymbol(c,t,r);const d=isAnySymbolAccessible(l,t,n,n===c?getQualifiedLeftMeaning(r):r,i,o);if(d){return d}}if(s){return{accessibility:0}}if(a){return{accessibility:1,errorSymbolName:symbolToString(n,t,r),errorModuleName:a!==n?symbolToString(a,t,1920):void 0}}}function isSymbolAccessible(e,t,n,r){return isSymbolAccessibleWorker(e,t,n,r,true)}function isSymbolAccessibleWorker(e,t,n,r,i){if(e&&t){const o=isAnySymbolAccessible([e],t,e,n,r,i);if(o){return o}const a=forEach(e.declarations,getExternalModuleContainer);if(a){const r=getExternalModuleContainer(t);if(a!==r){return{accessibility:2,errorSymbolName:symbolToString(e,t,n),errorModuleName:symbolToString(a),errorNode:isInJSFile(t)?t:void 0}}}return{accessibility:1,errorSymbolName:symbolToString(e,t,n)}}return{accessibility:0}}function getExternalModuleContainer(e){const t=findAncestor(e,hasExternalModuleSymbol);return t&&getSymbolOfDeclaration(t)}function hasExternalModuleSymbol(e){return isAmbientModule(e)||e.kind===307&&isExternalOrCommonJsModule(e)}function hasNonGlobalAugmentationExternalModuleSymbol(e){return isModuleWithStringLiteralName(e)||e.kind===307&&isExternalOrCommonJsModule(e)}function hasVisibleDeclarations(e,t){let n;if(!every(filter(e.declarations,(e=>e.kind!==80)),getIsDeclarationVisible)){return void 0}return{accessibility:0,aliasesToMakeVisible:n};function getIsDeclarationVisible(t){var n,r;if(!isDeclarationVisible(t)){const i=getAnyImportSyntax(t);if(i&&!hasSyntacticModifier(i,32)&&isDeclarationVisible(i.parent)){return addVisibleAlias(t,i)}else if(isVariableDeclaration(t)&&isVariableStatement(t.parent.parent)&&!hasSyntacticModifier(t.parent.parent,32)&&isDeclarationVisible(t.parent.parent.parent)){return addVisibleAlias(t,t.parent.parent)}else if(isLateVisibilityPaintedStatement(t)&&!hasSyntacticModifier(t,32)&&isDeclarationVisible(t.parent)){return addVisibleAlias(t,t)}else if(isBindingElement(t)){if(e.flags&2097152&&isInJSFile(t)&&((n=t.parent)==null?void 0:n.parent)&&isVariableDeclaration(t.parent.parent)&&((r=t.parent.parent.parent)==null?void 0:r.parent)&&isVariableStatement(t.parent.parent.parent.parent)&&!hasSyntacticModifier(t.parent.parent.parent.parent,32)&&t.parent.parent.parent.parent.parent&&isDeclarationVisible(t.parent.parent.parent.parent.parent)){return addVisibleAlias(t,t.parent.parent.parent.parent)}else if(e.flags&2){const e=findAncestor(t,isVariableStatement);if(hasSyntacticModifier(e,32)){return true}if(!isDeclarationVisible(e.parent)){return false}return addVisibleAlias(t,e)}}return false}return true}function addVisibleAlias(e,r){if(t){getNodeLinks(e).isVisible=true;n=appendIfUnique(n,r)}return true}}function getMeaningOfEntityNameReference(e){let t;if(e.parent.kind===186||e.parent.kind===233&&!isPartOfTypeNode(e.parent)||e.parent.kind===167||e.parent.kind===182&&e.parent.parameterName===e){t=111551|1048576}else if(e.kind===166||e.kind===211||e.parent.kind===271||e.parent.kind===166&&e.parent.left===e||e.parent.kind===211&&e.parent.expression===e||e.parent.kind===212&&e.parent.expression===e){t=1920}else{t=788968}return t}function isEntityNameVisible(e,t,n=true){const r=getMeaningOfEntityNameReference(e);const i=getFirstIdentifier(e);const o=te(t,i.escapedText,r,void 0,false);if(o&&o.flags&262144&&r&788968){return{accessibility:0}}if(!o&&isThisIdentifier(i)&&isSymbolAccessible(getSymbolOfDeclaration(getThisContainer(i,false,false)),i,r,false).accessibility===0){return{accessibility:0}}if(!o){return{accessibility:3,errorSymbolName:getTextOfNode(i),errorNode:i}}return hasVisibleDeclarations(o,n)||{accessibility:1,errorSymbolName:getTextOfNode(i),errorNode:i}}function symbolToString(e,t,n,r=4,i){let o=70221824;let a=0;if(r&2){o|=128}if(r&1){o|=512}if(r&8){o|=16384}if(r&32){a|=4}if(r&16){a|=1}const s=r&4?j.symbolToNode:j.symbolToEntityName;return i?symbolToStringWorker(i).getText():usingSingleLineStringWriter(symbolToStringWorker);function symbolToStringWorker(r){const i=s(e,n,t,o,a);const c=(t==null?void 0:t.kind)===307?Aa():Ia();const l=t&&getSourceFileOfNode(t);c.writeNode(4,i,l,r);return r}}function signatureToString(e,t,n=0,r,i){return i?signatureToStringWorker(i).getText():usingSingleLineStringWriter(signatureToStringWorker);function signatureToStringWorker(i){let o;if(n&262144){o=r===1?185:184}else{o=r===1?180:179}const a=j.signatureToSignatureDeclaration(e,o,t,toNodeBuilderFlags(n)|70221824|512);const s=Oa();const c=t&&getSourceFileOfNode(t);s.writeNode(4,a,c,getTrailingSemicolonDeferringWriter(i));return i}}function typeToString(e,t,n=1048576|16384,r=createTextWriter("")){const i=T.noErrorTruncation||n&1;const o=j.typeToTypeNode(e,t,toNodeBuilderFlags(n)|70221824|(i?1:0),void 0);if(o===void 0)return S.fail("should always get typenode");const a=e!==Ae?Ia():Da();const s=t&&getSourceFileOfNode(t);a.writeNode(4,o,s,r);const c=r.getText();const l=i?dn*2:ln*2;if(l&&c&&c.length>=l){return c.substr(0,l-"...".length)+"..."}return c}function getTypeNamesForErrorDisplay(e,t){let n=symbolValueDeclarationIsContextSensitive(e.symbol)?typeToString(e,e.symbol.valueDeclaration):typeToString(e);let r=symbolValueDeclarationIsContextSensitive(t.symbol)?typeToString(t,t.symbol.valueDeclaration):typeToString(t);if(n===r){n=getTypeNameForErrorDisplay(e);r=getTypeNameForErrorDisplay(t)}return[n,r]}function getTypeNameForErrorDisplay(e){return typeToString(e,void 0,64)}function symbolValueDeclarationIsContextSensitive(e){return e&&!!e.valueDeclaration&&isExpression(e.valueDeclaration)&&!isContextSensitive(e.valueDeclaration)}function toNodeBuilderFlags(e=0){return e&848330095}function isClassInstanceSide(e){return!!e.symbol&&!!(e.symbol.flags&32)&&(e===getDeclaredTypeOfClassOrInterface(e.symbol)||!!(e.flags&524288)&&!!(getObjectFlags(e)&16777216))}function getTypeFromTypeNodeWithoutContext(e){return getTypeFromTypeNode(e)}function createNodeBuilder(){const t={evaluateEntityNameExpression:evaluateEntityNameExpression,isExpandoFunctionDeclaration:isExpandoFunctionDeclaration,hasLateBindableName:hasLateBindableName,shouldRemoveDeclaration(e,t){return!(e.internalFlags&8&&isEntityNameExpression(t.name.expression)&&checkComputedPropertyName(t.name).flags&1)},createRecoveryBoundary(e){return createRecoveryBoundary(e)},isDefinitelyReferenceToGlobalSymbolObject:isDefinitelyReferenceToGlobalSymbolObject,getAllAccessorDeclarations:getAllAccessorDeclarationsForDeclaration,requiresAddingImplicitUndefined(e,t,n){var r;switch(e.kind){case 172:case 171:case 348:t??(t=getSymbolOfDeclaration(e));const i=getTypeOfSymbol(t);return!!(t.flags&4&&t.flags&16777216&&isOptionalDeclaration(e)&&((r=t.links)==null?void 0:r.mappedType)&&containsNonMissingUndefinedType(i));case 169:case 341:return requiresAddingImplicitUndefined(e,n);default:S.assertNever(e)}},isOptionalParameter:isOptionalParameter,isUndefinedIdentifierExpression(e){S.assert(isExpressionNode(e));return getSymbolAtLocation(e)===z},isEntityNameVisible(e,t,n){return isEntityNameVisible(t,e.enclosingDeclaration,n)},serializeExistingTypeNode(e,t,n){return serializeExistingTypeNode(e,t,!!n)},serializeReturnTypeForSignature(e,t){const n=e;const r=getSignatureFromDeclaration(t);const i=n.enclosingSymbolTypes.get(getSymbolId(getSymbolOfDeclaration(t)))??instantiateType(getReturnTypeOfSignature(r),n.mapper);return serializeInferredReturnTypeForSignature(n,r,i)},serializeTypeOfExpression(e,t){const n=e;const r=instantiateType(getWidenedType(getRegularTypeOfExpression(t)),n.mapper);return typeToTypeNodeHelper(r,n)},serializeTypeOfDeclaration(e,t,n){var r;const i=e;n??(n=getSymbolOfDeclaration(t));let o=(r=i.enclosingSymbolTypes)==null?void 0:r.get(getSymbolId(n));if(o===void 0){o=n&&!(n.flags&(2048|131072))?instantiateType(getWidenedLiteralType(getTypeOfSymbol(n)),i.mapper):Ie}const a=t&&(isParameter(t)||isJSDocParameterTag(t))&&requiresAddingImplicitUndefined(t,i.enclosingDeclaration);if(a){o=getOptionalType(o)}return serializeInferredTypeForDeclaration(n,i,o)},serializeNameOfParameter(e,t){return parameterToParameterDeclarationName(getSymbolOfDeclaration(t),t,e)},serializeEntityName(e,t){const n=e;const r=getSymbolAtLocation(t,true);if(!r)return void 0;if(!isValueSymbolAccessible(r,n.enclosingDeclaration))return void 0;return symbolToExpression(r,n,111551|1048576)},serializeTypeName(e,t,n,r){return serializeTypeName(e,t,n,r)},getJsDocPropertyOverride(e,t,n){const r=e;const i=isIdentifier(n.name)?n.name:n.name.right;const o=getTypeOfPropertyOfType(getTypeFromTypeNode2(r,t),i.escapedText);const a=o&&n.typeExpression&&getTypeFromTypeNode2(r,n.typeExpression.type)!==o?typeToTypeNodeHelper(o,r):void 0;return a},enterNewScope(e,t){if(isFunctionLike(t)||isJSDocSignature(t)){const n=getSignatureFromDeclaration(t);return enterNewScope(e,t,n.parameters,n.typeParameters)}else{const n=isConditionalTypeNode(t)?getInferTypeParameters(t):[getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(t.typeParameter))];return enterNewScope(e,t,void 0,n)}},markNodeReuse(e,t,n){return setTextRange2(e,t,n)},trackExistingEntityName(e,t){return trackExistingEntityName(t,e)},trackComputedName(e,t){trackComputedName(t,e.enclosingDeclaration,e)},getModuleSpecifierOverride(e,t,n){const r=e;if(r.bundled||r.enclosingFile!==getSourceFileOfNode(n)){let e=n.text;const i=getNodeLinks(t).resolvedSymbol;const o=t.isTypeOf?111551:788968;const a=i&&isSymbolAccessible(i,r.enclosingDeclaration,o,false).accessibility===0&&lookupSymbolChain(i,r,o,true)[0];if(a&&isExternalModuleSymbol(a)){e=getSpecifierForModuleSymbol(a,r)}else{const n=getExternalModuleFileFromDeclaration(t);if(n){e=getSpecifierForModuleSymbol(n.symbol,r)}}if(e.includes("/node_modules/")){r.encounteredError=true;if(r.tracker.reportLikelyUnsafeImportRequiredError){r.tracker.reportLikelyUnsafeImportRequiredError(e)}}return e}},canReuseTypeNode(e,t){return canReuseTypeNode(e,t)},canReuseTypeNodeAnnotation(e,t,n,r,i){var o;const a=e;if(a.enclosingDeclaration===void 0)return false;r??(r=getSymbolOfDeclaration(t));let s=(o=a.enclosingSymbolTypes)==null?void 0:o.get(getSymbolId(r));if(s===void 0){if(r.flags&98304){s=t.kind===178?getWriteTypeOfSymbol(r):getTypeOfAccessors(r)}else if(isValueSignatureDeclaration(t)){s=getReturnTypeOfSignature(getSignatureFromDeclaration(t))}else{s=getTypeOfSymbol(r)}}let c=getTypeFromTypeNodeWithoutContext(n);if(isErrorType(c)){return true}if(i&&c){c=addOptionality(c,!isParameter(t))}return!!c&&typeNodeIsEquivalentToType(t,s,c)&&existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(n,s)}};return{syntacticBuilderResolver:t,typeToTypeNode:(e,t,n,r,i)=>withContext2(t,n,r,i,(t=>typeToTypeNodeHelper(e,t))),typePredicateToTypePredicateNode:(e,t,n,r,i)=>withContext2(t,n,r,i,(t=>typePredicateToTypePredicateNodeHelper(e,t))),serializeTypeForExpression:(e,t,n,r,i)=>withContext2(t,n,r,i,(t=>J.serializeTypeOfExpression(e,t))),serializeTypeForDeclaration:(e,t,n,r,i,o)=>withContext2(n,r,i,o,(n=>J.serializeTypeOfDeclaration(e,t,n))),serializeReturnTypeForSignature:(e,t,n,r,i)=>withContext2(t,n,r,i,(t=>J.serializeReturnTypeForSignature(e,getSymbolOfDeclaration(e),t))),indexInfoToIndexSignatureDeclaration:(e,t,n,r,i)=>withContext2(t,n,r,i,(t=>indexInfoToIndexSignatureDeclarationHelper(e,t,void 0))),signatureToSignatureDeclaration:(e,t,n,r,i,o)=>withContext2(n,r,i,o,(n=>signatureToSignatureDeclarationHelper(e,t,n))),symbolToEntityName:(e,t,n,r,i,o)=>withContext2(n,r,i,o,(n=>symbolToName(e,n,t,false))),symbolToExpression:(e,t,n,r,i,o)=>withContext2(n,r,i,o,(n=>symbolToExpression(e,n,t))),symbolToTypeParameterDeclarations:(e,t,n,r,i)=>withContext2(t,n,r,i,(t=>typeParametersToTypeParameterDeclarations(e,t))),symbolToParameterDeclaration:(e,t,n,r,i)=>withContext2(t,n,r,i,(t=>symbolToParameterDeclaration(e,t))),typeParameterToDeclaration:(e,t,n,r,i)=>withContext2(t,n,r,i,(t=>typeParameterToDeclaration(e,t))),symbolTableToDeclarationStatements:(e,t,n,r,i)=>withContext2(t,n,r,i,(t=>symbolTableToDeclarationStatements(e,t))),symbolToNode:(e,t,n,r,i,o)=>withContext2(n,r,i,o,(n=>symbolToNode(e,n,t)))};function getTypeFromTypeNode2(e,t,n){const r=getTypeFromTypeNodeWithoutContext(t);if(!e.mapper)return r;const i=instantiateType(r,e.mapper);return n&&i!==r?void 0:i}function setTextRange2(e,t,n){if(!nodeIsSynthesized(t)||!(t.flags&16)||!e.enclosingFile||e.enclosingFile!==getSourceFileOfNode(getOriginalNode(t))){t=zr.cloneNode(t)}if(t===n)return t;if(!n){return t}let r=t.original;while(r&&r!==n){r=r.original}if(!r){setOriginalNode(t,n)}if(e.enclosingFile&&e.enclosingFile===getSourceFileOfNode(getOriginalNode(n))){return setTextRange(t,n)}return t}function symbolToNode(e,t,n){if(t.internalFlags&1){if(e.valueDeclaration){const t=getNameOfDeclaration(e.valueDeclaration);if(t&&isComputedPropertyName(t))return t}const r=getSymbolLinks(e).nameType;if(r&&r.flags&(1024|8192)){t.enclosingDeclaration=r.symbol.valueDeclaration;return zr.createComputedPropertyName(symbolToExpression(r.symbol,t,n))}}return symbolToExpression(e,t,n)}function withContext2(t,n,r,i,o){const a=(i==null?void 0:i.trackSymbol)?i.moduleResolverHost:(r||0)&4?createBasicNodeBuilderModuleSpecifierResolutionHost(e):void 0;const s={enclosingDeclaration:t,enclosingFile:t&&getSourceFileOfNode(t),flags:n||0,internalFlags:r||0,tracker:void 0,encounteredError:false,suppressReportInferenceFallback:false,reportedDiagnostic:false,visitedTypes:void 0,symbolDepth:void 0,inferTypeParameters:void 0,approximateLength:0,trackedSymbols:void 0,bundled:!!T.outFile&&!!t&&isExternalOrCommonJsModule(getSourceFileOfNode(t)),truncating:false,usedSymbolNames:void 0,remappedSymbolNames:void 0,remappedSymbolReferences:void 0,reverseMappedStack:void 0,mustCreateTypeParameterSymbolList:true,typeParameterSymbolList:void 0,mustCreateTypeParametersNamesLookups:true,typeParameterNames:void 0,typeParameterNamesByText:void 0,typeParameterNamesByTextNextNameCount:void 0,enclosingSymbolTypes:new Map,mapper:void 0};s.tracker=new pa(s,i,a);const c=o(s);if(s.truncating&&s.flags&1){s.tracker.reportTruncationError()}return s.encounteredError?void 0:c}function addSymbolTypeToContext(e,t,n){const r=getSymbolId(t);const i=e.enclosingSymbolTypes.get(r);e.enclosingSymbolTypes.set(r,n);return restore;function restore(){if(i){e.enclosingSymbolTypes.set(r,i)}else{e.enclosingSymbolTypes.delete(r)}}}function saveRestoreFlags(e){const t=e.flags;const n=e.internalFlags;return restore;function restore(){e.flags=t;e.internalFlags=n}}function checkTruncationLength(e){if(e.truncating)return e.truncating;return e.truncating=e.approximateLength>(e.flags&1?dn:ln)}function typeToTypeNodeHelper(e,t){const n=saveRestoreFlags(t);const r=typeToTypeNodeWorker(e,t);n();return r}function typeToTypeNodeWorker(e,t){var r,i;if(n&&n.throwIfCancellationRequested){n.throwIfCancellationRequested()}const o=t.flags&8388608;t.flags&=~8388608;if(!e){if(!(t.flags&262144)){t.encounteredError=true;return void 0}t.approximateLength+=3;return zr.createKeywordTypeNode(133)}if(!(t.flags&536870912)){e=getReducedType(e)}if(e.flags&1){if(e.aliasSymbol){return zr.createTypeReferenceNode(symbolToEntityNameNode(e.aliasSymbol),mapToTypeNodes(e.aliasTypeArguments,t))}if(e===Ae){return addSyntheticLeadingComment(zr.createKeywordTypeNode(133),3,"unresolved")}t.approximateLength+=3;return zr.createKeywordTypeNode(e===we?141:133)}if(e.flags&2){return zr.createKeywordTypeNode(159)}if(e.flags&4){t.approximateLength+=6;return zr.createKeywordTypeNode(154)}if(e.flags&8){t.approximateLength+=6;return zr.createKeywordTypeNode(150)}if(e.flags&64){t.approximateLength+=6;return zr.createKeywordTypeNode(163)}if(e.flags&16&&!e.aliasSymbol){t.approximateLength+=7;return zr.createKeywordTypeNode(136)}if(e.flags&1056){if(e.symbol.flags&8){const n=getParentOfSymbol(e.symbol);const r=symbolToTypeNode(n,t,788968);if(getDeclaredTypeOfSymbol(n)===e){return r}const i=symbolName(e.symbol);if(isIdentifierText(i,1)){return appendReferenceToType(r,zr.createTypeReferenceNode(i,void 0))}if(isImportTypeNode(r)){r.isTypeOf=true;return zr.createIndexedAccessTypeNode(r,zr.createLiteralTypeNode(zr.createStringLiteral(i)))}else if(isTypeReferenceNode(r)){return zr.createIndexedAccessTypeNode(zr.createTypeQueryNode(r.typeName),zr.createLiteralTypeNode(zr.createStringLiteral(i)))}else{return S.fail("Unhandled type node kind returned from `symbolToTypeNode`.")}}return symbolToTypeNode(e.symbol,t,788968)}if(e.flags&128){t.approximateLength+=e.value.length+2;return zr.createLiteralTypeNode(setEmitFlags(zr.createStringLiteral(e.value,!!(t.flags&268435456)),16777216))}if(e.flags&256){const n=e.value;t.approximateLength+=(""+n).length;return zr.createLiteralTypeNode(n<0?zr.createPrefixUnaryExpression(41,zr.createNumericLiteral(-n)):zr.createNumericLiteral(n))}if(e.flags&2048){t.approximateLength+=pseudoBigIntToString(e.value).length+1;return zr.createLiteralTypeNode(zr.createBigIntLiteral(e.value))}if(e.flags&512){t.approximateLength+=e.intrinsicName.length;return zr.createLiteralTypeNode(e.intrinsicName==="true"?zr.createTrue():zr.createFalse())}if(e.flags&8192){if(!(t.flags&1048576)){if(isValueSymbolAccessible(e.symbol,t.enclosingDeclaration)){t.approximateLength+=6;return symbolToTypeNode(e.symbol,t,111551)}if(t.tracker.reportInaccessibleUniqueSymbolError){t.tracker.reportInaccessibleUniqueSymbolError()}}t.approximateLength+=13;return zr.createTypeOperatorNode(158,zr.createKeywordTypeNode(155))}if(e.flags&16384){t.approximateLength+=4;return zr.createKeywordTypeNode(116)}if(e.flags&32768){t.approximateLength+=9;return zr.createKeywordTypeNode(157)}if(e.flags&65536){t.approximateLength+=4;return zr.createLiteralTypeNode(zr.createNull())}if(e.flags&131072){t.approximateLength+=5;return zr.createKeywordTypeNode(146)}if(e.flags&4096){t.approximateLength+=6;return zr.createKeywordTypeNode(155)}if(e.flags&67108864){t.approximateLength+=6;return zr.createKeywordTypeNode(151)}if(isThisTypeParameter(e)){if(t.flags&4194304){if(!t.encounteredError&&!(t.flags&32768)){t.encounteredError=true}(i=(r=t.tracker).reportInaccessibleThisError)==null?void 0:i.call(r)}t.approximateLength+=4;return zr.createThisTypeNode()}if(!o&&e.aliasSymbol&&(t.flags&16384||isTypeSymbolAccessible(e.aliasSymbol,t.enclosingDeclaration))){const n=mapToTypeNodes(e.aliasTypeArguments,t);if(isReservedMemberName(e.aliasSymbol.escapedName)&&!(e.aliasSymbol.flags&32))return zr.createTypeReferenceNode(zr.createIdentifier(""),n);if(length(n)===1&&e.aliasSymbol===on.symbol){return zr.createArrayTypeNode(n[0])}return symbolToTypeNode(e.aliasSymbol,t,788968,n)}const a=getObjectFlags(e);if(a&4){S.assert(!!(e.flags&524288));return e.node?visitAndTransformType(e,typeReferenceToTypeNode):typeReferenceToTypeNode(e)}if(e.flags&262144||a&3){if(e.flags&262144&&contains(t.inferTypeParameters,e)){t.approximateLength+=symbolName(e.symbol).length+6;let n;const r=getConstraintOfTypeParameter(e);if(r){const i=getInferredTypeParameterConstraint(e,true);if(!(i&&isTypeIdenticalTo(r,i))){t.approximateLength+=9;n=r&&typeToTypeNodeHelper(r,t)}}return zr.createInferTypeNode(typeParameterToDeclarationWithConstraint(e,t,n))}if(t.flags&4&&e.flags&262144){const n=typeParameterToName(e,t);t.approximateLength+=idText(n).length;return zr.createTypeReferenceNode(zr.createIdentifier(idText(n)),void 0)}if(e.symbol){return symbolToTypeNode(e.symbol,t,788968)}const n=(e===Ot||e===Lt)&&_&&_.symbol?(e===Lt?"sub-":"super-")+symbolName(_.symbol):"?";return zr.createTypeReferenceNode(zr.createIdentifier(n),void 0)}if(e.flags&1048576&&e.origin){e=e.origin}if(e.flags&(1048576|2097152)){const n=e.flags&1048576?formatUnionTypes(e.types):e.types;if(length(n)===1){return typeToTypeNodeHelper(n[0],t)}const r=mapToTypeNodes(n,t,true);if(r&&r.length>0){return e.flags&1048576?zr.createUnionTypeNode(r):zr.createIntersectionTypeNode(r)}else{if(!t.encounteredError&&!(t.flags&262144)){t.encounteredError=true}return void 0}}if(a&(16|32)){S.assert(!!(e.flags&524288));return createAnonymousTypeNode(e)}if(e.flags&4194304){const n=e.type;t.approximateLength+=6;const r=typeToTypeNodeHelper(n,t);return zr.createTypeOperatorNode(143,r)}if(e.flags&134217728){const n=e.texts;const r=e.types;const i=zr.createTemplateHead(n[0]);const o=zr.createNodeArray(map(r,((e,i)=>zr.createTemplateLiteralTypeSpan(typeToTypeNodeHelper(e,t),(iconditionalTypeToTypeNode(e)))}if(e.flags&33554432){const n=typeToTypeNodeHelper(e.baseType,t);const r=isNoInferType(e)&&getGlobalTypeSymbol("NoInfer",false);return r?symbolToTypeNode(r,t,788968,[n]):n}return S.fail("Should be unreachable.");function conditionalTypeToTypeNode(e){const n=typeToTypeNodeHelper(e.checkType,t);t.approximateLength+=15;if(t.flags&4&&e.root.isDistributive&&!(e.checkType.flags&262144)){const r=createTypeParameter(createSymbol(262144,"T"));const i=typeParameterToName(r,t);const o=zr.createTypeReferenceNode(i);t.approximateLength+=37;const a=prependTypeMapping(e.root.checkType,r,e.mapper);const s=t.inferTypeParameters;t.inferTypeParameters=e.root.inferTypeParameters;const c=typeToTypeNodeHelper(instantiateType(e.root.extendsType,a),t);t.inferTypeParameters=s;const l=typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode2(t,e.root.node.trueType),a));const d=typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode2(t,e.root.node.falseType),a));return zr.createConditionalTypeNode(n,zr.createInferTypeNode(zr.createTypeParameterDeclaration(void 0,zr.cloneNode(o.typeName))),zr.createConditionalTypeNode(zr.createTypeReferenceNode(zr.cloneNode(i)),typeToTypeNodeHelper(e.checkType,t),zr.createConditionalTypeNode(o,c,l,d),zr.createKeywordTypeNode(146)),zr.createKeywordTypeNode(146))}const r=t.inferTypeParameters;t.inferTypeParameters=e.root.inferTypeParameters;const i=typeToTypeNodeHelper(e.extendsType,t);t.inferTypeParameters=r;const o=typeToTypeNodeOrCircularityElision(getTrueTypeFromConditionalType(e));const a=typeToTypeNodeOrCircularityElision(getFalseTypeFromConditionalType(e));return zr.createConditionalTypeNode(n,i,o,a)}function typeToTypeNodeOrCircularityElision(e){var n,r,i;if(e.flags&1048576){if((n=t.visitedTypes)==null?void 0:n.has(getTypeId(e))){if(!(t.flags&131072)){t.encounteredError=true;(i=(r=t.tracker)==null?void 0:r.reportCyclicStructureError)==null?void 0:i.call(r)}return createElidedInformationPlaceholder(t)}return visitAndTransformType(e,(e=>typeToTypeNodeHelper(e,t)))}return typeToTypeNodeHelper(e,t)}function isMappedTypeHomomorphic(e){return!!getHomomorphicTypeVariable(e)}function isHomomorphicMappedTypeWithNonHomomorphicInstantiation(e){return!!e.target&&isMappedTypeHomomorphic(e.target)&&!isMappedTypeHomomorphic(e)}function createMappedTypeNodeFromType(e){var n;S.assert(!!(e.flags&524288));const r=e.declaration.readonlyToken?zr.createToken(e.declaration.readonlyToken.kind):void 0;const i=e.declaration.questionToken?zr.createToken(e.declaration.questionToken.kind):void 0;let o;let a;const s=!isMappedTypeWithKeyofConstraintDeclaration(e)&&!(getModifiersTypeFromMappedType(e).flags&2)&&t.flags&4&&!(getConstraintTypeFromMappedType(e).flags&262144&&((n=getConstraintOfTypeParameter(getConstraintTypeFromMappedType(e)))==null?void 0:n.flags)&4194304);if(isMappedTypeWithKeyofConstraintDeclaration(e)){if(isHomomorphicMappedTypeWithNonHomomorphicInstantiation(e)&&t.flags&4){const e=createTypeParameter(createSymbol(262144,"T"));const n=typeParameterToName(e,t);a=zr.createTypeReferenceNode(n)}o=zr.createTypeOperatorNode(143,a||typeToTypeNodeHelper(getModifiersTypeFromMappedType(e),t))}else if(s){const e=createTypeParameter(createSymbol(262144,"T"));const n=typeParameterToName(e,t);a=zr.createTypeReferenceNode(n);o=a}else{o=typeToTypeNodeHelper(getConstraintTypeFromMappedType(e),t)}const c=typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(e),t,o);const l=e.declaration.nameType?typeToTypeNodeHelper(getNameTypeFromMappedType(e),t):void 0;const d=typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(e),!!(getMappedTypeModifiers(e)&4)),t);const p=zr.createMappedTypeNode(r,c,l,i,d,void 0);t.approximateLength+=10;const u=setEmitFlags(p,1);if(isHomomorphicMappedTypeWithNonHomomorphicInstantiation(e)&&t.flags&4){const n=instantiateType(getConstraintOfTypeParameter(getTypeFromTypeNode2(t,e.declaration.typeParameter.constraint.type))||Le,e.mapper);return zr.createConditionalTypeNode(typeToTypeNodeHelper(getModifiersTypeFromMappedType(e),t),zr.createInferTypeNode(zr.createTypeParameterDeclaration(void 0,zr.cloneNode(a.typeName),n.flags&2?void 0:typeToTypeNodeHelper(n,t))),u,zr.createKeywordTypeNode(146))}else if(s){return zr.createConditionalTypeNode(typeToTypeNodeHelper(getConstraintTypeFromMappedType(e),t),zr.createInferTypeNode(zr.createTypeParameterDeclaration(void 0,zr.cloneNode(a.typeName),zr.createTypeOperatorNode(143,typeToTypeNodeHelper(getModifiersTypeFromMappedType(e),t)))),u,zr.createKeywordTypeNode(146))}return u}function createAnonymousTypeNode(e){var n,r;const i=e.id;const o=e.symbol;if(o){const a=!!(getObjectFlags(e)&8388608);if(a){const r=e;const o=r.node;if(isTypeQueryNode(o)&&getTypeFromTypeNode2(t,o)===e){const e=J.tryReuseExistingTypeNode(t,o);if(e){return e}}if((n=t.visitedTypes)==null?void 0:n.has(i)){return createElidedInformationPlaceholder(t)}return visitAndTransformType(e,createTypeNodeFromObjectType)}const s=isClassInstanceSide(e)?788968:111551;if(isJSConstructor(o.valueDeclaration)){return symbolToTypeNode(o,t,s)}else if(o.flags&32&&!getBaseTypeVariableOfClass(o)&&!(o.valueDeclaration&&isClassLike(o.valueDeclaration)&&t.flags&2048&&(!isClassDeclaration(o.valueDeclaration)||isSymbolAccessible(o,t.enclosingDeclaration,s,false).accessibility!==0))||o.flags&(384|512)||shouldWriteTypeOfFunctionSymbol()){return symbolToTypeNode(o,t,s)}else if((r=t.visitedTypes)==null?void 0:r.has(i)){const n=getTypeAliasForTypeLiteral(e);if(n){return symbolToTypeNode(n,t,788968)}else{return createElidedInformationPlaceholder(t)}}else{return visitAndTransformType(e,createTypeNodeFromObjectType)}}else{return createTypeNodeFromObjectType(e)}function shouldWriteTypeOfFunctionSymbol(){var e;const n=!!(o.flags&8192)&&some(o.declarations,(e=>isStatic(e)&&!isLateBindableIndexSignature(getNameOfDeclaration(e))));const r=!!(o.flags&16)&&(o.parent||forEach(o.declarations,(e=>e.parent.kind===307||e.parent.kind===268)));if(n||r){return(!!(t.flags&4096)||((e=t.visitedTypes)==null?void 0:e.has(i)))&&(!(t.flags&8)||isValueSymbolAccessible(o,t.enclosingDeclaration))}}}function visitAndTransformType(e,n){var r,i,o;const a=e.id;const s=getObjectFlags(e)&16&&e.symbol&&e.symbol.flags&32;const c=getObjectFlags(e)&4&&e.node?"N"+getNodeId(e.node):e.flags&16777216?"N"+getNodeId(e.root.node):e.symbol?(s?"+":"")+getSymbolId(e.symbol):void 0;if(!t.visitedTypes){t.visitedTypes=new Set}if(c&&!t.symbolDepth){t.symbolDepth=new Map}const l=t.enclosingDeclaration&&getNodeLinks(t.enclosingDeclaration);const d=`${getTypeId(e)}|${t.flags}|${t.internalFlags}`;if(l){l.serializedTypes||(l.serializedTypes=new Map)}const p=(r=l==null?void 0:l.serializedTypes)==null?void 0:r.get(d);if(p){(i=p.trackedSymbols)==null?void 0:i.forEach((([e,n,r])=>t.tracker.trackSymbol(e,n,r)));if(p.truncating){t.truncating=true}t.approximateLength+=p.addedLength;return deepCloneOrReuseNode(p.node)}let u;if(c){u=t.symbolDepth.get(c)||0;if(u>10){return createElidedInformationPlaceholder(t)}t.symbolDepth.set(c,u+1)}t.visitedTypes.add(a);const f=t.trackedSymbols;t.trackedSymbols=void 0;const m=t.approximateLength;const _=n(e);const g=t.approximateLength-m;if(!t.reportedDiagnostic&&!t.encounteredError){(o=l==null?void 0:l.serializedTypes)==null?void 0:o.set(d,{node:_,truncating:t.truncating,addedLength:g,trackedSymbols:t.trackedSymbols})}t.visitedTypes.delete(a);if(c){t.symbolDepth.set(c,u)}t.trackedSymbols=f;return _;function deepCloneOrReuseNode(e){if(!nodeIsSynthesized(e)&&getParseTreeNode(e)===e){return e}return setTextRange2(t,zr.cloneNode(visitEachChild(e,deepCloneOrReuseNode,void 0,deepCloneOrReuseNodes,deepCloneOrReuseNode)),e)}function deepCloneOrReuseNodes(e,t,n,r,i){if(e&&e.length===0){return setTextRange(zr.createNodeArray(void 0,e.hasTrailingComma),e)}return visitNodes2(e,t,n,r,i)}}function createTypeNodeFromObjectType(e){if(isGenericMappedType(e)||e.containsError){return createMappedTypeNodeFromType(e)}const n=resolveStructuredTypeMembers(e);if(!n.properties.length&&!n.indexInfos.length){if(!n.callSignatures.length&&!n.constructSignatures.length){t.approximateLength+=2;return setEmitFlags(zr.createTypeLiteralNode(void 0),1)}if(n.callSignatures.length===1&&!n.constructSignatures.length){const e=n.callSignatures[0];const r=signatureToSignatureDeclarationHelper(e,184,t);return r}if(n.constructSignatures.length===1&&!n.callSignatures.length){const e=n.constructSignatures[0];const r=signatureToSignatureDeclarationHelper(e,185,t);return r}}const r=filter(n.constructSignatures,(e=>!!(e.flags&4)));if(some(r)){const e=map(r,(e=>getOrCreateTypeFromSignature(e)));const i=n.callSignatures.length+(n.constructSignatures.length-r.length)+n.indexInfos.length+(t.flags&2048?countWhere(n.properties,(e=>!(e.flags&4194304))):length(n.properties));if(i){e.push(getResolvedTypeWithoutAbstractConstructSignatures(n))}return typeToTypeNodeHelper(getIntersectionType(e),t)}const i=saveRestoreFlags(t);t.flags|=4194304;const o=createTypeNodesFromResolvedType(n);i();const a=zr.createTypeLiteralNode(o);t.approximateLength+=2;setEmitFlags(a,t.flags&1024?0:1);return a}function typeReferenceToTypeNode(e){let n=getTypeArguments(e);if(e.target===on||e.target===an){if(t.flags&2){const r=typeToTypeNodeHelper(n[0],t);return zr.createTypeReferenceNode(e.target===on?"Array":"ReadonlyArray",[r])}const r=typeToTypeNodeHelper(n[0],t);const i=zr.createArrayTypeNode(r);return e.target===on?i:zr.createTypeOperatorNode(148,i)}else if(e.target.objectFlags&8){n=sameMap(n,((t,n)=>removeMissingType(t,!!(e.target.elementFlags[n]&2))));if(n.length>0){const r=getTypeReferenceArity(e);const i=mapToTypeNodes(n.slice(0,r),t);if(i){const{labeledElementDeclarations:t}=e.target;for(let n=0;n0){let r=0;if(e.target.typeParameters){r=Math.min(e.target.typeParameters.length,n.length);if(isReferenceToType2(e,getGlobalIterableType(false))||isReferenceToType2(e,getGlobalIterableIteratorType(false))||isReferenceToType2(e,getGlobalAsyncIterableType(false))||isReferenceToType2(e,getGlobalAsyncIterableIteratorType(false))){if(!e.node||!isTypeReferenceNode(e.node)||!e.node.typeArguments||e.node.typeArguments.length0){const t=n[r-1];const i=e.target.typeParameters[r-1];const o=getDefaultFromTypeParameter(i);if(!o||!isTypeIdenticalTo(t,o)){break}r--}}}}a=mapToTypeNodes(n.slice(i,r),t)}const s=saveRestoreFlags(t);t.flags|=16;const c=symbolToTypeNode(e.symbol,t,788968,a);s();return!o?c:appendReferenceToType(o,c)}}function appendReferenceToType(e,t){if(isImportTypeNode(e)){let n=e.typeArguments;let r=e.qualifier;if(r){if(isIdentifier(r)){if(n!==getIdentifierTypeArguments(r)){r=setIdentifierTypeArguments(zr.cloneNode(r),n)}}else{if(n!==getIdentifierTypeArguments(r.right)){r=zr.updateQualifiedName(r,r.left,setIdentifierTypeArguments(zr.cloneNode(r.right),n))}}}n=t.typeArguments;const i=getAccessStack(t);for(const e of i){r=r?zr.createQualifiedName(r,e):e}return zr.updateImportTypeNode(e,e.argument,e.attributes,r,n,e.isTypeOf)}else{let n=e.typeArguments;let r=e.typeName;if(isIdentifier(r)){if(n!==getIdentifierTypeArguments(r)){r=setIdentifierTypeArguments(zr.cloneNode(r),n)}}else{if(n!==getIdentifierTypeArguments(r.right)){r=zr.updateQualifiedName(r,r.left,setIdentifierTypeArguments(zr.cloneNode(r.right),n))}}n=t.typeArguments;const i=getAccessStack(t);for(const e of i){r=zr.createQualifiedName(r,e)}return zr.updateTypeReferenceNode(e,r,n)}}function getAccessStack(e){let t=e.typeName;const n=[];while(!isIdentifier(t)){n.unshift(t.right);t=t.left}n.unshift(t);return n}function indexInfoToObjectComputedNamesOrSignatureDeclaration(e,t,n){if(e.components){const r=every(e.components,(e=>{var n;return!!(e.name&&isComputedPropertyName(e.name)&&isEntityNameExpression(e.name.expression)&&t.enclosingDeclaration&&((n=isEntityNameVisible(e.name.expression,t.enclosingDeclaration,false))==null?void 0:n.accessibility)===0)}));if(r){const r=filter(e.components,(e=>!hasLateBindableName(e)));return map(r,(r=>{trackComputedName(r.name.expression,t.enclosingDeclaration,t);return setTextRange2(t,zr.createPropertySignature(e.isReadonly?[zr.createModifier(148)]:void 0,r.name,(isPropertySignature(r)||isPropertyDeclaration(r)||isMethodSignature(r)||isMethodDeclaration(r)||isGetAccessor(r)||isSetAccessor(r))&&r.questionToken?zr.createToken(58):void 0,n||typeToTypeNodeHelper(getTypeOfSymbol(r.symbol),t)),r)}))}}return[indexInfoToIndexSignatureDeclarationHelper(e,t,n)]}function createTypeNodesFromResolvedType(e){if(checkTruncationLength(t)){if(t.flags&1){return[addSyntheticTrailingComment(zr.createNotEmittedTypeElement(),3,"elided")]}return[zr.createPropertySignature(void 0,"...",void 0,void 0)]}const n=[];for(const r of e.callSignatures){n.push(signatureToSignatureDeclarationHelper(r,179,t))}for(const r of e.constructSignatures){if(r.flags&4)continue;n.push(signatureToSignatureDeclarationHelper(r,180,t))}for(const r of e.indexInfos){n.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(r,t,e.objectFlags&1024?createElidedInformationPlaceholder(t):void 0))}const r=e.properties;if(!r){return n}let i=0;for(const e of r){i++;if(t.flags&2048){if(e.flags&4194304){continue}if(getDeclarationModifierFlagsFromSymbol(e)&(2|4)&&t.tracker.reportPrivateInBaseOfClassExpression){t.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(e.escapedName))}}if(checkTruncationLength(t)&&i+2!(e.flags&32768))),0);for(const i of r){const r=signatureToSignatureDeclarationHelper(i,173,t,{name:s,questionToken:c});n.push(preserveCommentsOn(r,i.declaration||e.valueDeclaration))}if(r.length||!c){return}}let l;if(shouldUsePlaceholderForProperty(e,t)){l=createElidedInformationPlaceholder(t)}else{if(i){t.reverseMappedStack||(t.reverseMappedStack=[]);t.reverseMappedStack.push(e)}l=o?serializeTypeForDeclaration(t,void 0,o,e):zr.createKeywordTypeNode(133);if(i){t.reverseMappedStack.pop()}}const d=isReadonlySymbol(e)?[zr.createToken(148)]:void 0;if(d){t.approximateLength+=9}const p=zr.createPropertySignature(d,s,c,l);n.push(preserveCommentsOn(p,e.valueDeclaration));function preserveCommentsOn(n,r){var i;const o=(i=e.declarations)==null?void 0:i.find((e=>e.kind===348));if(o){const e=getTextOfJSDocComment(o.comment);if(e){setSyntheticLeadingComments(n,[{kind:3,text:"*\n * "+e.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:true}])}}else if(r){setCommentRange2(t,n,r)}return n}}function setCommentRange2(e,t,n){if(e.enclosingFile&&e.enclosingFile===getSourceFileOfNode(n)){return setCommentRange(t,n)}return t}function mapToTypeNodes(e,t,n){if(some(e)){if(checkTruncationLength(t)){if(!n){return[t.flags&1?addSyntheticLeadingComment(zr.createKeywordTypeNode(133),3,"elided"):zr.createTypeReferenceNode("...",void 0)]}else if(e.length>2){return[typeToTypeNodeHelper(e[0],t),t.flags&1?addSyntheticLeadingComment(zr.createKeywordTypeNode(133),3,`... ${e.length-2} more elided ...`):zr.createTypeReferenceNode(`... ${e.length-2} more ...`,void 0),typeToTypeNodeHelper(e[e.length-1],t)]}}const r=!(t.flags&64);const i=r?createMultiMap():void 0;const o=[];let a=0;for(const n of e){a++;if(checkTruncationLength(t)&&a+2{if(!arrayIsHomogeneous(e,(([e],[t])=>typesAreSameReference(e,t)))){for(const[n,r]of e){o[r]=typeToTypeNodeHelper(n,t)}}}));e()}return o}}function typesAreSameReference(e,t){return e===t||!!e.symbol&&e.symbol===t.symbol||!!e.aliasSymbol&&e.aliasSymbol===t.aliasSymbol}function indexInfoToIndexSignatureDeclarationHelper(e,t,n){const r=getNameFromIndexInfo(e)||"x";const i=typeToTypeNodeHelper(e.keyType,t);const o=zr.createParameterDeclaration(void 0,void 0,r,void 0,i,void 0);if(!n){n=typeToTypeNodeHelper(e.type||ke,t)}if(!e.type&&!(t.flags&2097152)){t.encounteredError=true}t.approximateLength+=r.length+4;return zr.createIndexSignature(e.isReadonly?[zr.createToken(148)]:void 0,[o],n)}function signatureToSignatureDeclarationHelper(e,t,n,r){var i;let o;let a;const s=getExpandedParameters(e,true)[0];const c=enterNewScope(n,e.declaration,s,e.typeParameters,e.parameters,e.mapper);n.approximateLength+=3;if(n.flags&32&&e.target&&e.mapper&&e.target.typeParameters){a=e.target.typeParameters.map((t=>typeToTypeNodeHelper(instantiateType(t,e.mapper),n)))}else{o=e.typeParameters&&e.typeParameters.map((e=>typeParameterToDeclaration(e,n)))}const l=saveRestoreFlags(n);n.flags&=~256;const d=(some(s,(e=>e!==s[s.length-1]&&!!(getCheckFlags(e)&32768)))?e.parameters:s).map((e=>symbolToParameterDeclaration(e,n,t===176)));const p=n.flags&33554432?void 0:tryGetThisParameterDeclaration(e,n);if(p){d.unshift(p)}l();const u=serializeReturnTypeForSignature(n,e);let f=r==null?void 0:r.modifiers;if(t===185&&e.flags&4){const e=modifiersToFlags(f);f=zr.createModifiersFromModifierFlags(e|64)}const m=t===179?zr.createCallSignature(o,d,u):t===180?zr.createConstructSignature(o,d,u):t===173?zr.createMethodSignature(f,(r==null?void 0:r.name)??zr.createIdentifier(""),r==null?void 0:r.questionToken,o,d,u):t===174?zr.createMethodDeclaration(f,void 0,(r==null?void 0:r.name)??zr.createIdentifier(""),void 0,o,d,u,void 0):t===176?zr.createConstructorDeclaration(f,d,void 0):t===177?zr.createGetAccessorDeclaration(f,(r==null?void 0:r.name)??zr.createIdentifier(""),d,u,void 0):t===178?zr.createSetAccessorDeclaration(f,(r==null?void 0:r.name)??zr.createIdentifier(""),d,void 0):t===181?zr.createIndexSignature(f,d,u):t===317?zr.createJSDocFunctionType(d,u):t===184?zr.createFunctionTypeNode(o,d,u??zr.createTypeReferenceNode(zr.createIdentifier(""))):t===185?zr.createConstructorTypeNode(f,o,d,u??zr.createTypeReferenceNode(zr.createIdentifier(""))):t===262?zr.createFunctionDeclaration(f,void 0,(r==null?void 0:r.name)?cast(r.name,isIdentifier):zr.createIdentifier(""),o,d,u,void 0):t===218?zr.createFunctionExpression(f,void 0,(r==null?void 0:r.name)?cast(r.name,isIdentifier):zr.createIdentifier(""),o,d,u,zr.createBlock([])):t===219?zr.createArrowFunction(f,o,d,u,void 0,zr.createBlock([])):S.assertNever(t);if(a){m.typeArguments=zr.createNodeArray(a)}if(((i=e.declaration)==null?void 0:i.kind)===323&&e.declaration.parent.kind===339){const t=getTextOfNode(e.declaration.parent.parent,true).slice(2,-2).split(/\r\n|\n|\r/).map((e=>e.replace(/^\s+/," "))).join("\n");addSyntheticLeadingComment(m,3,t,true)}c==null?void 0:c();return m}function createRecoveryBoundary(e){if(n&&n.throwIfCancellationRequested){n.throwIfCancellationRequested()}let t;let r;let i=false;const o=e.tracker;const a=e.trackedSymbols;e.trackedSymbols=void 0;const s=e.encounteredError;e.tracker=new pa(e,{...o.inner,reportCyclicStructureError(){markError((()=>o.reportCyclicStructureError()))},reportInaccessibleThisError(){markError((()=>o.reportInaccessibleThisError()))},reportInaccessibleUniqueSymbolError(){markError((()=>o.reportInaccessibleUniqueSymbolError()))},reportLikelyUnsafeImportRequiredError(e){markError((()=>o.reportLikelyUnsafeImportRequiredError(e)))},reportNonSerializableProperty(e){markError((()=>o.reportNonSerializableProperty(e)))},reportPrivateInBaseOfClassExpression(e){markError((()=>o.reportPrivateInBaseOfClassExpression(e)))},trackSymbol(e,n,r){(t??(t=[])).push([e,n,r]);return false},moduleResolverHost:e.tracker.moduleResolverHost},e.tracker.moduleResolverHost);return{startRecoveryScope:startRecoveryScope,finalizeBoundary:finalizeBoundary,markError:markError,hadError:()=>i};function markError(e){i=true;if(e){(r??(r=[])).push(e)}}function startRecoveryScope(){const e=(t==null?void 0:t.length)??0;const n=(r==null?void 0:r.length)??0;return()=>{i=false;if(t){t.length=e}if(r){r.length=n}}}function finalizeBoundary(){e.tracker=o;e.trackedSymbols=a;e.encounteredError=s;r==null?void 0:r.forEach((e=>e()));if(i){return false}t==null?void 0:t.forEach((([t,n,r])=>e.tracker.trackSymbol(t,n,r)));return true}}function enterNewScope(e,t,n,r,i,o){const a=cloneNodeBuilderContext(e);let s;let c;const l=e.enclosingDeclaration;const p=e.mapper;if(o){e.mapper=o}if(e.enclosingDeclaration&&t){let pushFakeScope2=function(t,n){S.assert(e.enclosingDeclaration);let r;if(getNodeLinks(e.enclosingDeclaration).fakeScopeForSignatureDeclaration===t){r=e.enclosingDeclaration}else if(e.enclosingDeclaration.parent&&getNodeLinks(e.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration===t){r=e.enclosingDeclaration.parent}S.assertOptionalNode(r,isBlock);const i=(r==null?void 0:r.locals)??createSymbolTable();let o;let a;n(((e,t)=>{if(r){const t=i.get(e);if(!t){o=append(o,e)}else{a=append(a,{name:e,oldSymbol:t})}}i.set(e,t)}));if(!r){const n=zr.createBlock(d);getNodeLinks(n).fakeScopeForSignatureDeclaration=t;n.locals=i;setParent(n,e.enclosingDeclaration);e.enclosingDeclaration=n}else{return function undo(){forEach(o,(e=>i.delete(e)));forEach(a,(e=>i.set(e.name,e.oldSymbol)))}}};var u=pushFakeScope2;s=!some(n)?void 0:pushFakeScope2("params",(e=>{if(!n)return;for(let t=0;t{if(isParameter(t)&&isBindingPattern(t.name)){bindPattern(t.name);return true}return void 0;function bindPattern(e){forEach(e.elements,(e=>{switch(e.kind){case 232:return;case 208:return bindElement(e);default:return S.assertNever(e)}}))}function bindElement(t){if(isBindingPattern(t.name)){return bindPattern(t.name)}const n=getSymbolOfDeclaration(t);e(n.escapedName,n)}}))){e(r.escapedName,r)}}}));if(e.flags&4&&some(r)){c=pushFakeScope2("typeParams",(t=>{for(const n of r??d){const r=typeParameterToName(n,e).escapedText;t(r,n.symbol)}}))}}return()=>{s==null?void 0:s();c==null?void 0:c();a();e.enclosingDeclaration=l;e.mapper=p}}function tryGetThisParameterDeclaration(e,t){if(e.thisParameter){return symbolToParameterDeclaration(e.thisParameter,t)}if(e.declaration&&isInJSFile(e.declaration)){const n=getJSDocThisTag(e.declaration);if(n&&n.typeExpression){return zr.createParameterDeclaration(void 0,void 0,"this",void 0,typeToTypeNodeHelper(getTypeFromTypeNode2(t,n.typeExpression),t))}}}function typeParameterToDeclarationWithConstraint(e,t,n){const r=saveRestoreFlags(t);t.flags&=~512;const i=zr.createModifiersFromModifierFlags(getTypeParameterModifiers(e));const o=typeParameterToName(e,t);const a=getDefaultFromTypeParameter(e);const s=a&&typeToTypeNodeHelper(a,t);r();return zr.createTypeParameterDeclaration(i,o,n,s)}function typeToTypeNodeHelperWithPossibleReusableTypeNode(e,t,n){return t&&getTypeFromTypeNode2(n,t)===e&&J.tryReuseExistingTypeNode(n,t)||typeToTypeNodeHelper(e,n)}function typeParameterToDeclaration(e,t,n=getConstraintOfTypeParameter(e)){const r=n&&typeToTypeNodeHelperWithPossibleReusableTypeNode(n,getConstraintDeclaration(e),t);return typeParameterToDeclarationWithConstraint(e,t,r)}function typePredicateToTypePredicateNodeHelper(e,t){const n=e.kind===2||e.kind===3?zr.createToken(131):void 0;const r=e.kind===1||e.kind===3?setEmitFlags(zr.createIdentifier(e.parameterName),16777216):zr.createThisTypeNode();const i=e.type&&typeToTypeNodeHelper(e.type,t);return zr.createTypePredicateNode(n,r,i)}function getEffectiveParameterDeclaration(e){const t=getDeclarationOfKind(e,169);if(t){return t}if(!isTransientSymbol(e)){return getDeclarationOfKind(e,341)}}function symbolToParameterDeclaration(e,t,n){const r=getEffectiveParameterDeclaration(e);const i=getTypeOfSymbol(e);const o=serializeTypeForDeclaration(t,r,i,e);const a=!(t.flags&8192)&&n&&r&&canHaveModifiers(r)?map(getModifiers(r),zr.cloneNode):void 0;const s=r&&isRestParameter(r)||getCheckFlags(e)&32768;const c=s?zr.createToken(26):void 0;const l=parameterToParameterDeclarationName(e,r,t);const d=r&&isOptionalParameter(r)||getCheckFlags(e)&16384;const p=d?zr.createToken(58):void 0;const u=zr.createParameterDeclaration(a,c,l,p,o,void 0);t.approximateLength+=symbolName(e).length+3;return u}function parameterToParameterDeclarationName(e,t,n){return t?t.name?t.name.kind===80?setEmitFlags(zr.cloneNode(t.name),16777216):t.name.kind===166?setEmitFlags(zr.cloneNode(t.name.right),16777216):cloneBindingName(t.name):symbolName(e):symbolName(e);function cloneBindingName(e){return elideInitializerAndSetEmitFlags(e);function elideInitializerAndSetEmitFlags(e){if(n.tracker.canTrackSymbol&&isComputedPropertyName(e)&&isLateBindableName(e)){trackComputedName(e.expression,n.enclosingDeclaration,n)}let t=visitEachChild(e,elideInitializerAndSetEmitFlags,void 0,void 0,elideInitializerAndSetEmitFlags);if(isBindingElement(t)){t=zr.updateBindingElement(t,t.dotDotDotToken,t.propertyName,t.name,void 0)}if(!nodeIsSynthesized(t)){t=zr.cloneNode(t)}return setEmitFlags(t,1|16777216)}}}function trackComputedName(e,t,n){if(!n.tracker.canTrackSymbol)return;const r=getFirstIdentifier(e);const i=te(t,r.escapedText,111551|1048576,void 0,true);if(i){n.tracker.trackSymbol(i,t,111551)}else{const e=te(r,r.escapedText,111551|1048576,void 0,true);if(e){n.tracker.trackSymbol(e,t,111551)}}}function lookupSymbolChain(e,t,n,r){t.tracker.trackSymbol(e,t.enclosingDeclaration,n);return lookupSymbolChainWorker(e,t,n,r)}function lookupSymbolChainWorker(e,t,n,r){let i;const o=e.flags&262144;if(!o&&(t.enclosingDeclaration||t.flags&64)&&!(t.internalFlags&4)){i=S.checkDefined(getSymbolChain(e,n,true));S.assert(i&&i.length>0)}else{i=[e]}return i;function getSymbolChain(e,n,i){let o=getAccessibleSymbolChain(e,t.enclosingDeclaration,n,!!(t.flags&128));let a;if(!o||needsQualification(o[0],t.enclosingDeclaration,o.length===1?n:getQualifiedLeftMeaning(n))){const r=getContainersOfSymbol(o?o[0]:e,t.enclosingDeclaration,n);if(length(r)){a=r.map((e=>some(e.declarations,hasNonGlobalAugmentationExternalModuleSymbol)?getSpecifierForModuleSymbol(e,t):void 0));const i=r.map(((e,t)=>t));i.sort(sortByBestName);const s=i.map((e=>r[e]));for(const t of s){const r=getSymbolChain(t,getQualifiedLeftMeaning(n),false);if(r){if(t.exports&&t.exports.get("export=")&&getSymbolIfSameReference(t.exports.get("export="),e)){o=r;break}o=r.concat(o||[getAliasForSymbolInContainer(t,e)||e]);break}}}}if(o){return o}if(i||!(e.flags&(2048|4096))){if(!i&&!r&&!!forEach(e.declarations,hasNonGlobalAugmentationExternalModuleSymbol)){return}return[e]}function sortByBestName(e,t){const n=a[e];const r=a[t];if(n&&r){const e=pathIsRelative(r);if(pathIsRelative(n)===e){return countPathComponents(n)-countPathComponents(r)}if(e){return-1}return 1}return 0}}}function typeParametersToTypeParameterDeclarations(e,t){let n;const r=getTargetSymbol(e);if(r.flags&(32|64|524288)){n=zr.createNodeArray(map(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e),(e=>typeParameterToDeclaration(e,t))))}return n}function lookupTypeParameterNodes(e,t,n){var r;S.assert(e&&0<=t&&tgetMappedType(e,o.links.mapper))),n)}else{a=typeParametersToTypeParameterDeclarations(i,n)}}return a}function getTopmostIndexedAccessType(e){if(isIndexedAccessTypeNode(e.objectType)){return getTopmostIndexedAccessType(e.objectType)}return e}function getSpecifierForModuleSymbol(t,n,r){let i=getDeclarationOfKind(t,307);if(!i){const e=firstDefined(t.declarations,(e=>getFileSymbolIfFileSymbolExportEqualsContainer(e,t)));if(e){i=getDeclarationOfKind(e,307)}}if(i&&i.moduleName!==void 0){return i.moduleName}if(!i){if(Qo.test(t.escapedName)){return t.escapedName.substring(1,t.escapedName.length-1)}}if(!n.enclosingFile||!n.tracker.moduleResolverHost){if(Qo.test(t.escapedName)){return t.escapedName.substring(1,t.escapedName.length-1)}return getSourceFileOfNode(getNonAugmentationDeclaration(t)).fileName}const o=getOriginalNode(n.enclosingDeclaration);const a=canHaveModuleSpecifier(o)?tryGetModuleSpecifierFromDeclaration(o):void 0;const s=n.enclosingFile;const c=r||a&&e.getModeForUsageLocation(s,a)||s&&e.getDefaultResolutionModeForFile(s);const l=createModeAwareCacheKey(s.path,c);const d=getSymbolLinks(t);let p=d.specifierCache&&d.specifierCache.get(l);if(!p){const e=!!T.outFile;const{moduleResolverHost:i}=n.tracker;const o=e?{...T,baseUrl:i.getCommonSourceDirectory()}:T;p=first(getModuleSpecifiers(t,re,o,s,i,{importModuleSpecifierPreference:e?"non-relative":"project-relative",importModuleSpecifierEnding:e?"minimal":c===99?"js":void 0},{overrideImportMode:r}));d.specifierCache??(d.specifierCache=new Map);d.specifierCache.set(l,p)}return p}function symbolToEntityNameNode(e){const t=zr.createIdentifier(unescapeLeadingUnderscores(e.escapedName));return e.parent?zr.createQualifiedName(symbolToEntityNameNode(e.parent),t):t}function symbolToTypeNode(e,t,n,r){const i=lookupSymbolChain(e,t,n,!(t.flags&16384));const o=n===111551;if(some(i[0].declarations,hasNonGlobalAugmentationExternalModuleSymbol)){const e=i.length>1?createAccessFromSymbolChain(i,i.length-1,1):void 0;const n=r||lookupTypeParameterNodes(i,0,t);const a=getSourceFileOfNode(getOriginalNode(t.enclosingDeclaration));const s=getSourceFileOfModule(i[0]);let c;let l;if(qn(T)===3||qn(T)===99){if((s==null?void 0:s.impliedNodeFormat)===99&&s.impliedNodeFormat!==(a==null?void 0:a.impliedNodeFormat)){c=getSpecifierForModuleSymbol(i[0],t,99);l=zr.createImportAttributes(zr.createNodeArray([zr.createImportAttribute(zr.createStringLiteral("resolution-mode"),zr.createStringLiteral("import"))]))}}if(!c){c=getSpecifierForModuleSymbol(i[0],t)}if(!(t.flags&67108864)&&qn(T)!==1&&c.includes("/node_modules/")){const e=c;if(qn(T)===3||qn(T)===99){const n=(a==null?void 0:a.impliedNodeFormat)===99?1:99;c=getSpecifierForModuleSymbol(i[0],t,n);if(c.includes("/node_modules/")){c=e}else{l=zr.createImportAttributes(zr.createNodeArray([zr.createImportAttribute(zr.createStringLiteral("resolution-mode"),zr.createStringLiteral(n===99?"import":"require"))]))}}if(!l){t.encounteredError=true;if(t.tracker.reportLikelyUnsafeImportRequiredError){t.tracker.reportLikelyUnsafeImportRequiredError(e)}}}const d=zr.createLiteralTypeNode(zr.createStringLiteral(c));t.approximateLength+=c.length+10;if(!e||isEntityName(e)){if(e){const t=isIdentifier(e)?e:e.right;setIdentifierTypeArguments(t,void 0)}return zr.createImportTypeNode(d,l,e,n,o)}else{const t=getTopmostIndexedAccessType(e);const r=t.objectType.typeName;return zr.createIndexedAccessTypeNode(zr.createImportTypeNode(d,l,r,n,o),t.indexType)}}const a=createAccessFromSymbolChain(i,i.length-1,0);if(isIndexedAccessTypeNode(a)){return a}if(o){return zr.createTypeQueryNode(a)}else{const e=isIdentifier(a)?a:a.right;const t=getIdentifierTypeArguments(e);setIdentifierTypeArguments(e,void 0);return zr.createTypeReferenceNode(a,t)}function createAccessFromSymbolChain(e,n,i){const o=n===e.length-1?r:lookupTypeParameterNodes(e,n,t);const a=e[n];const s=e[n-1];let c;if(n===0){t.flags|=16777216;c=getNameOfSymbolAsWritten(a,t);t.approximateLength+=(c?c.length:0)+1;t.flags^=16777216}else{if(s&&getExportsOfSymbol(s)){const e=getExportsOfSymbol(s);forEachEntry(e,((e,t)=>{if(getSymbolIfSameReference(e,a)&&!isLateBoundName(t)&&t!=="export="){c=unescapeLeadingUnderscores(t);return true}}))}}if(c===void 0){const r=firstDefined(a.declarations,getNameOfDeclaration);if(r&&isComputedPropertyName(r)&&isEntityName(r.expression)){const t=createAccessFromSymbolChain(e,n-1,i);if(isEntityName(t)){return zr.createIndexedAccessTypeNode(zr.createParenthesizedType(zr.createTypeQueryNode(t)),zr.createTypeQueryNode(r.expression))}return t}c=getNameOfSymbolAsWritten(a,t)}t.approximateLength+=c.length+1;if(!(t.flags&16)&&s&&getMembersOfSymbol(s)&&getMembersOfSymbol(s).get(a.escapedName)&&getSymbolIfSameReference(getMembersOfSymbol(s).get(a.escapedName),a)){const t=createAccessFromSymbolChain(e,n-1,i);if(isIndexedAccessTypeNode(t)){return zr.createIndexedAccessTypeNode(t,zr.createLiteralTypeNode(zr.createStringLiteral(c)))}else{return zr.createIndexedAccessTypeNode(zr.createTypeReferenceNode(t,o),zr.createLiteralTypeNode(zr.createStringLiteral(c)))}}const l=setEmitFlags(zr.createIdentifier(c),16777216);if(o)setIdentifierTypeArguments(l,zr.createNodeArray(o));l.symbol=a;if(n>i){const t=createAccessFromSymbolChain(e,n-1,i);if(!isEntityName(t)){return S.fail("Impossible construct - an export of an indexed access cannot be reachable")}return zr.createQualifiedName(t,l)}return l}}function typeParameterShadowsOtherTypeParameterInScope(e,t,n){const r=te(t.enclosingDeclaration,e,788968,void 0,false);if(r&&r.flags&262144){return r!==n.symbol}return false}function typeParameterToName(e,t){var n,r,i,o;if(t.flags&4&&t.typeParameterNames){const n=t.typeParameterNames.get(getTypeId(e));if(n){return n}}let a=symbolToName(e.symbol,t,788968,true);if(!(a.kind&80)){return zr.createIdentifier("(Missing type parameter)")}const s=(r=(n=e.symbol)==null?void 0:n.declarations)==null?void 0:r[0];if(s&&isTypeParameterDeclaration(s)){a=setTextRange2(t,a,s.name)}if(t.flags&4){const n=a.escapedText;let r=((i=t.typeParameterNamesByTextNextNameCount)==null?void 0:i.get(n))||0;let s=n;while(((o=t.typeParameterNamesByText)==null?void 0:o.has(s))||typeParameterShadowsOtherTypeParameterInScope(s,t,e)){r++;s=`${n}_${r}`}if(s!==n){const e=getIdentifierTypeArguments(a);a=zr.createIdentifier(s);setIdentifierTypeArguments(a,e)}if(t.mustCreateTypeParametersNamesLookups){t.mustCreateTypeParametersNamesLookups=false;t.typeParameterNames=new Map(t.typeParameterNames);t.typeParameterNamesByTextNextNameCount=new Map(t.typeParameterNamesByTextNextNameCount);t.typeParameterNamesByText=new Set(t.typeParameterNamesByText)}t.typeParameterNamesByTextNextNameCount.set(n,r);t.typeParameterNames.set(getTypeId(e),a);t.typeParameterNamesByText.add(s)}return a}function symbolToName(e,t,n,r){const i=lookupSymbolChain(e,t,n);if(r&&i.length!==1&&!t.encounteredError&&!(t.flags&65536)){t.encounteredError=true}return createEntityNameFromSymbolChain(i,i.length-1);function createEntityNameFromSymbolChain(e,n){const r=lookupTypeParameterNodes(e,n,t);const i=e[n];if(n===0){t.flags|=16777216}const o=getNameOfSymbolAsWritten(i,t);if(n===0){t.flags^=16777216}const a=setEmitFlags(zr.createIdentifier(o),16777216);if(r)setIdentifierTypeArguments(a,zr.createNodeArray(r));a.symbol=i;return n>0?zr.createQualifiedName(createEntityNameFromSymbolChain(e,n-1),a):a}}function symbolToExpression(e,t,n){const r=lookupSymbolChain(e,t,n);return createExpressionFromSymbolChain(r,r.length-1);function createExpressionFromSymbolChain(e,n){const r=lookupTypeParameterNodes(e,n,t);const i=e[n];if(n===0){t.flags|=16777216}let o=getNameOfSymbolAsWritten(i,t);if(n===0){t.flags^=16777216}let a=o.charCodeAt(0);if(isSingleOrDoubleQuote(a)&&some(i.declarations,hasNonGlobalAugmentationExternalModuleSymbol)){return zr.createStringLiteral(getSpecifierForModuleSymbol(i,t))}if(n===0||canUsePropertyAccess(o,v)){const t=setEmitFlags(zr.createIdentifier(o),16777216);if(r)setIdentifierTypeArguments(t,zr.createNodeArray(r));t.symbol=i;return n>0?zr.createPropertyAccessExpression(createExpressionFromSymbolChain(e,n-1),t):t}else{if(a===91){o=o.substring(1,o.length-1);a=o.charCodeAt(0)}let t;if(isSingleOrDoubleQuote(a)&&!(i.flags&8)){t=zr.createStringLiteral(stripQuotes(o).replace(/\\./g,(e=>e.substring(1))),a===39)}else if(""+ +o===o){t=zr.createNumericLiteral(+o)}if(!t){const e=setEmitFlags(zr.createIdentifier(o),16777216);if(r)setIdentifierTypeArguments(e,zr.createNodeArray(r));e.symbol=i;t=e}return zr.createElementAccessExpression(createExpressionFromSymbolChain(e,n-1),t)}}}function isStringNamed(e){const t=getNameOfDeclaration(e);if(!t){return false}if(isComputedPropertyName(t)){const e=checkExpression(t.expression);return!!(e.flags&402653316)}if(isElementAccessExpression(t)){const e=checkExpression(t.argumentExpression);return!!(e.flags&402653316)}return isStringLiteral(t)}function isSingleQuotedStringNamed(e){const t=getNameOfDeclaration(e);return!!(t&&isStringLiteral(t)&&(t.singleQuote||!nodeIsSynthesized(t)&&startsWith(getTextOfNode(t,false),"'")))}function getPropertyNameNodeForSymbol(e,t){const n=!!length(e.declarations)&&every(e.declarations,isStringNamed);const r=!!length(e.declarations)&&every(e.declarations,isSingleQuotedStringNamed);const i=!!(e.flags&8192);const o=getPropertyNameNodeForSymbolFromNameType(e,t,r,n,i);if(o){return o}const a=unescapeLeadingUnderscores(e.escapedName);return createPropertyNameNodeForIdentifierOrLiteral(a,zn(T),r,n,i)}function getPropertyNameNodeForSymbolFromNameType(e,t,n,r,i){const o=getSymbolLinks(e).nameType;if(o){if(o.flags&384){const e=""+o.value;if(!isIdentifierText(e,zn(T))&&(r||!isNumericLiteralName(e))){return zr.createStringLiteral(e,!!n)}if(isNumericLiteralName(e)&&startsWith(e,"-")){return zr.createComputedPropertyName(zr.createPrefixUnaryExpression(41,zr.createNumericLiteral(-e)))}return createPropertyNameNodeForIdentifierOrLiteral(e,zn(T),n,r,i)}if(o.flags&8192){return zr.createComputedPropertyName(symbolToExpression(o.symbol,t,111551))}}}function cloneNodeBuilderContext(e){const t=e.mustCreateTypeParameterSymbolList;const n=e.mustCreateTypeParametersNamesLookups;e.mustCreateTypeParameterSymbolList=true;e.mustCreateTypeParametersNamesLookups=true;const r=e.typeParameterNames;const i=e.typeParameterNamesByText;const o=e.typeParameterNamesByTextNextNameCount;const a=e.typeParameterSymbolList;return()=>{e.typeParameterNames=r;e.typeParameterNamesByText=i;e.typeParameterNamesByTextNextNameCount=o;e.typeParameterSymbolList=a;e.mustCreateTypeParameterSymbolList=t;e.mustCreateTypeParametersNamesLookups=n}}function getDeclarationWithTypeAnnotation(e,t){return e.declarations&&find(e.declarations,(e=>!!getNonlocalEffectiveTypeAnnotationNode(e)&&(!t||!!findAncestor(e,(e=>e===t)))))}function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(e,t){if(!(getObjectFlags(t)&4))return true;if(!isTypeReferenceNode(e))return true;void getTypeFromTypeReference(e);const n=getNodeLinks(e).resolvedSymbol;const r=n&&getDeclaredTypeOfSymbol(n);if(!r||r!==t.target)return true;return length(e.typeArguments)>=getMinTypeArgumentCount(t.target.typeParameters)}function getEnclosingDeclarationIgnoringFakeScope(e){while(getNodeLinks(e).fakeScopeForSignatureDeclaration){e=e.parent}return e}function serializeInferredTypeForDeclaration(e,t,n){if(n.flags&8192&&n.symbol===e&&(!t.enclosingDeclaration||some(e.declarations,(e=>getSourceFileOfNode(e)===t.enclosingFile)))){t.flags|=1048576}const r=typeToTypeNodeHelper(n,t);return r}function serializeTypeForDeclaration(e,t,n,r){var i;let o;const a=t&&(isParameter(t)||isJSDocParameterTag(t))&&requiresAddingImplicitUndefined(t,e.enclosingDeclaration);const s=t??r.valueDeclaration??getDeclarationWithTypeAnnotation(r)??((i=r.declarations)==null?void 0:i[0]);if(s){if(isAccessor(s)){o=J.serializeTypeOfAccessor(s,r,e)}else if(hasInferredType(s)&&!nodeIsSynthesized(s)&&!(getObjectFlags(n)&196608)){const t=addSymbolTypeToContext(e,r,n);o=J.serializeTypeOfDeclaration(s,r,e);t()}}if(!o){if(a){n=getOptionalType(n)}o=serializeInferredTypeForDeclaration(r,e,n)}return o??zr.createKeywordTypeNode(133)}function typeNodeIsEquivalentToType(e,t,n){if(n===t){return true}if(!e){return false}if((isPropertySignature(e)||isPropertyDeclaration(e))&&e.questionToken){return getTypeWithFacts(t,524288)===n}if(isParameter(e)&&hasEffectiveQuestionToken(e)){return getTypeWithFacts(t,524288)===n}return false}function serializeReturnTypeForSignature(e,t){const n=e.flags&256;const r=saveRestoreFlags(e);if(n)e.flags&=~256;let i;const o=getReturnTypeOfSignature(t);if(!(n&&isTypeAny(o))){if(t.declaration&&!nodeIsSynthesized(t.declaration)){const n=getSymbolOfDeclaration(t.declaration);const r=addSymbolTypeToContext(e,n,o);i=J.serializeReturnTypeForSignature(t.declaration,n,e);r()}if(!i){i=serializeInferredReturnTypeForSignature(e,t,o)}}if(!i&&!n){i=zr.createKeywordTypeNode(133)}r();return i}function serializeInferredReturnTypeForSignature(e,t,n){const r=e.suppressReportInferenceFallback;e.suppressReportInferenceFallback=true;const i=getTypePredicateOfSignature(t);const o=i?typePredicateToTypePredicateNodeHelper(e.mapper?instantiateTypePredicate(i,e.mapper):i,e):typeToTypeNodeHelper(n,e);e.suppressReportInferenceFallback=r;return o}function trackExistingEntityName(e,t,n=t.enclosingDeclaration){let r=false;const i=getFirstIdentifier(e);if(isInJSFile(e)&&(isExportsIdentifier(i)||isModuleExportsAccessExpression(i.parent)||isQualifiedName(i.parent)&&isModuleIdentifier(i.parent.left)&&isExportsIdentifier(i.parent.right))){r=true;return{introducesError:r,node:e}}const o=getMeaningOfEntityNameReference(e);let a;if(isThisIdentifier(i)){a=getSymbolOfDeclaration(getThisContainer(i,false,false));if(isSymbolAccessible(a,i,o,false).accessibility!==0){r=true;t.tracker.reportInaccessibleThisError()}return{introducesError:r,node:attachSymbolToLeftmostIdentifier(e)}}a=resolveEntityName(i,o,true,true);if(t.enclosingDeclaration&&!(a&&a.flags&262144)){a=getExportSymbolOfValueSymbolIfExported(a);const n=resolveEntityName(i,o,true,true,t.enclosingDeclaration);if(n===xe||n===void 0&&a!==void 0||n&&a&&!getSymbolIfSameReference(getExportSymbolOfValueSymbolIfExported(n),a)){if(n!==xe){t.tracker.reportInferenceFallback(e)}r=true;return{introducesError:r,node:e,sym:a}}else{a=n}}if(a){if(a.flags&1&&a.valueDeclaration){if(isPartOfParameterDeclaration(a.valueDeclaration)||isJSDocParameterTag(a.valueDeclaration)){return{introducesError:r,node:attachSymbolToLeftmostIdentifier(e)}}}if(!(a.flags&262144)&&!isDeclarationName(e)&&isSymbolAccessible(a,n,o,false).accessibility!==0){t.tracker.reportInferenceFallback(e);r=true}else{t.tracker.trackSymbol(a,n,o)}return{introducesError:r,node:attachSymbolToLeftmostIdentifier(e)}}return{introducesError:r,node:e};function attachSymbolToLeftmostIdentifier(e){if(e===i){const n=getDeclaredTypeOfSymbol(a);const r=a.flags&262144?typeParameterToName(n,t):zr.cloneNode(e);r.symbol=a;return setTextRange2(t,setEmitFlags(r,16777216),e)}const n=visitEachChild(e,(e=>attachSymbolToLeftmostIdentifier(e)),void 0);if(n!==e){setTextRange2(t,n,e)}return n}}function serializeTypeName(e,t,n,r){const i=n?111551:788968;const o=resolveEntityName(t,i,true);if(!o)return void 0;const a=o.flags&2097152?resolveAlias(o):o;if(isSymbolAccessible(o,e.enclosingDeclaration,i,false).accessibility!==0)return void 0;return symbolToTypeNode(a,e,i,r)}function canReuseTypeNode(e,t){const n=getTypeFromTypeNode2(e,t,true);if(!n){return false}if(isInJSFile(t)){if(isLiteralImportTypeNode(t)){void getTypeFromImportTypeNode(t);const e=getNodeLinks(t).resolvedSymbol;return!e||!(!t.isTypeOf&&!(e.flags&788968)||!(length(t.typeArguments)>=getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e))))}}if(isTypeReferenceNode(t)){if(isConstTypeReference(t))return false;const r=getNodeLinks(t).resolvedSymbol;if(!r)return false;if(r.flags&262144){const t=getDeclaredTypeOfSymbol(r);return!(e.mapper&&getMappedType(t,e.mapper)!==t)}if(isInJSDoc(t)){return existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(t,n)&&!getIntendedTypeFromJSDocTypeReference(t)&&!!(r.flags&788968)}}if(isTypeOperatorNode(t)&&t.operator===158&&t.type.kind===155){const n=e.enclosingDeclaration&&getEnclosingDeclarationIgnoringFakeScope(e.enclosingDeclaration);return!!findAncestor(t,(e=>e===n))}return true}function serializeExistingTypeNode(e,t,n){const r=getTypeFromTypeNode2(e,t);if(n&&!someType(r,(e=>!!(e.flags&32768)))&&canReuseTypeNode(e,t)){const n=J.tryReuseExistingTypeNode(e,t);if(n){return zr.createUnionTypeNode([n,zr.createKeywordTypeNode(157)])}}return typeToTypeNodeHelper(r,e)}function symbolTableToDeclarationStatements(e,t){var n;const r=makeSerializePropertySymbol(zr.createPropertyDeclaration,174,true);const i=makeSerializePropertySymbol(((e,t,n,r)=>zr.createPropertySignature(e,t,n,r)),173,false);const o=t.enclosingDeclaration;let a=[];const s=new Set;const c=[];const l=t;t={...l,usedSymbolNames:new Set(l.usedSymbolNames),remappedSymbolNames:new Map,remappedSymbolReferences:new Map((n=l.remappedSymbolReferences)==null?void 0:n.entries()),tracker:void 0};const p={...l.tracker.inner,trackSymbol:(e,n,r)=>{var i,o;if((i=t.remappedSymbolNames)==null?void 0:i.has(getSymbolId(e)))return false;const a=isSymbolAccessible(e,n,r,false);if(a.accessibility===0){const n=lookupSymbolChainWorker(e,t,r);if(!(e.flags&4)){const e=n[0];const t=getSourceFileOfNode(l.enclosingDeclaration);if(some(e.declarations,(e=>getSourceFileOfNode(e)===t))){includePrivateSymbol(e)}}}else if((o=l.tracker.inner)==null?void 0:o.trackSymbol){return l.tracker.inner.trackSymbol(e,n,r)}return false}};t.tracker=new pa(t,p,l.tracker.moduleResolverHost);forEachEntry(e,((e,t)=>{const n=unescapeLeadingUnderscores(t);void getInternalSymbolName(e,n)}));let u=!t.bundled;const f=e.get("export=");if(f&&e.size>1&&f.flags&(2097152|1536)){e=createSymbolTable();e.set("export=",f)}visitSymbolTable(e);return mergeRedundantStatements(a);function isIdentifierAndNotUndefined(e){return!!e&&e.kind===80}function getNamesOfDeclaration(e){if(isVariableStatement(e)){return filter(map(e.declarationList.declarations,getNameOfDeclaration),isIdentifierAndNotUndefined)}return filter([getNameOfDeclaration(e)],isIdentifierAndNotUndefined)}function flattenExportAssignedNamespace(e){const t=find(e,isExportAssignment);const n=findIndex(e,isModuleDeclaration);let r=n!==-1?e[n]:void 0;if(r&&t&&t.isExportEquals&&isIdentifier(t.expression)&&isIdentifier(r.name)&&idText(r.name)===idText(t.expression)&&r.body&&isModuleBlock(r.body)){const i=filter(e,(e=>!!(getEffectiveModifierFlags(e)&32)));const o=r.name;let s=r.body;if(length(i)){r=zr.updateModuleDeclaration(r,r.modifiers,r.name,s=zr.updateModuleBlock(s,zr.createNodeArray([...r.body.statements,zr.createExportDeclaration(void 0,false,zr.createNamedExports(map(flatMap(i,(e=>getNamesOfDeclaration(e))),(e=>zr.createExportSpecifier(false,void 0,e)))),void 0)])));e=[...e.slice(0,n),r,...e.slice(n+1)]}if(!find(e,(e=>e!==r&&nodeHasName(e,o)))){a=[];const n=!some(s.statements,(e=>hasSyntacticModifier(e,32)||isExportAssignment(e)||isExportDeclaration(e)));forEach(s.statements,(e=>{addResult(e,n?32:0)}));e=[...filter(e,(e=>e!==r&&e!==t)),...a]}}return e}function mergeExportDeclarations(e){const t=filter(e,(e=>isExportDeclaration(e)&&!e.moduleSpecifier&&!!e.exportClause&&isNamedExports(e.exportClause)));if(length(t)>1){const n=filter(e,(e=>!isExportDeclaration(e)||!!e.moduleSpecifier||!e.exportClause));e=[...n,zr.createExportDeclaration(void 0,false,zr.createNamedExports(flatMap(t,(e=>cast(e.exportClause,isNamedExports).elements))),void 0)]}const n=filter(e,(e=>isExportDeclaration(e)&&!!e.moduleSpecifier&&!!e.exportClause&&isNamedExports(e.exportClause)));if(length(n)>1){const t=group(n,(e=>isStringLiteral(e.moduleSpecifier)?">"+e.moduleSpecifier.text:">"));if(t.length!==n.length){for(const n of t){if(n.length>1){e=[...filter(e,(e=>!n.includes(e))),zr.createExportDeclaration(void 0,false,zr.createNamedExports(flatMap(n,(e=>cast(e.exportClause,isNamedExports).elements))),n[0].moduleSpecifier)]}}}}return e}function inlineExportModifiers(e){const t=findIndex(e,(e=>isExportDeclaration(e)&&!e.moduleSpecifier&&!e.attributes&&!!e.exportClause&&isNamedExports(e.exportClause)));if(t>=0){const n=e[t];const r=mapDefined(n.exportClause.elements,(t=>{if(!t.propertyName&&t.name.kind!==11){const n=t.name;const r=indicesOf(e);const i=filter(r,(t=>nodeHasName(e[t],n)));if(length(i)&&every(i,(t=>canHaveExportModifier(e[t])))){for(const t of i){e[t]=addExportModifier(e[t])}return void 0}}return t}));if(!length(r)){orderedRemoveItemAt(e,t)}else{e[t]=zr.updateExportDeclaration(n,n.modifiers,n.isTypeOnly,zr.updateNamedExports(n.exportClause,r),n.moduleSpecifier,n.attributes)}}return e}function mergeRedundantStatements(e){e=flattenExportAssignedNamespace(e);e=mergeExportDeclarations(e);e=inlineExportModifiers(e);if(o&&(isSourceFile(o)&&isExternalOrCommonJsModule(o)||isModuleDeclaration(o))&&(!some(e,isExternalModuleIndicator)||!hasScopeMarker(e)&&some(e,needsScopeMarker))){e.push(createEmptyExports(zr))}return e}function addExportModifier(e){const t=(getEffectiveModifierFlags(e)|32)&~128;return zr.replaceModifiers(e,t)}function removeExportModifier(e){const t=getEffectiveModifierFlags(e)&~32;return zr.replaceModifiers(e,t)}function visitSymbolTable(e,t,n){if(!t){c.push(new Map)}e.forEach((e=>{serializeSymbol(e,false,!!n)}));if(!t){c[c.length-1].forEach((e=>{serializeSymbol(e,true,!!n)}));c.pop()}}function serializeSymbol(e,n,r){void getPropertiesOfType(getTypeOfSymbol(e));const i=getMergedSymbol(e);if(s.has(getSymbolId(i))){return}s.add(getSymbolId(i));const a=!n;if(a||!!length(e.declarations)&&some(e.declarations,(e=>!!findAncestor(e,(e=>e===o))))){const i=cloneNodeBuilderContext(t);t.tracker.pushErrorFallbackNode(find(e.declarations,(e=>getSourceFileOfNode(e)===t.enclosingFile)));serializeSymbolWorker(e,n,r);t.tracker.popErrorFallbackNode();i()}}function serializeSymbolWorker(e,n,r,i=e.escapedName){var o,a,s,c,l,d;const p=unescapeLeadingUnderscores(i);const u=i==="default";if(n&&!(t.flags&131072)&&isStringANonContextualKeyword(p)&&!u){t.encounteredError=true;return}let f=u&&!!(e.flags&-113||e.flags&16&&length(getPropertiesOfType(getTypeOfSymbol(e))))&&!(e.flags&2097152);let m=!f&&!n&&isStringANonContextualKeyword(p)&&!u;if(f||m){n=true}const _=(!n?32:0)|(u&&!f?2048:0);const g=e.flags&1536&&e.flags&(2|1|4)&&i!=="export=";const y=g&&isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(e),e);if(e.flags&(16|8192)||y){serializeAsFunctionNamespaceMerge(getTypeOfSymbol(e),e,getInternalSymbolName(e,p),_)}if(e.flags&524288){serializeTypeAlias(e,p,_)}if(e.flags&(2|1|4|98304)&&i!=="export="&&!(e.flags&4194304)&&!(e.flags&32)&&!(e.flags&8192)&&!y){if(r){const t=serializeMaybeAliasAssignment(e);if(t){m=false;f=false}}else{const u=getTypeOfSymbol(e);const g=getInternalSymbolName(e,p);if(u.symbol&&u.symbol!==e&&u.symbol.flags&16&&some(u.symbol.declarations,isFunctionExpressionOrArrowFunction)&&(((o=u.symbol.members)==null?void 0:o.size)||((a=u.symbol.exports)==null?void 0:a.size))){if(!t.remappedSymbolReferences){t.remappedSymbolReferences=new Map}t.remappedSymbolReferences.set(getSymbolId(u.symbol),e);serializeSymbolWorker(u.symbol,n,r,i);t.remappedSymbolReferences.delete(getSymbolId(u.symbol))}else if(!(e.flags&16)&&isTypeRepresentableAsFunctionNamespaceMerge(u,e)){serializeAsFunctionNamespaceMerge(u,e,g,_)}else{const r=!(e.flags&2)?((s=e.parent)==null?void 0:s.valueDeclaration)&&isSourceFile((c=e.parent)==null?void 0:c.valueDeclaration)?2:void 0:isConstantVariable(e)?2:1;const i=f||!(e.flags&4)?g:getUnusedName(g,e);let o=e.declarations&&find(e.declarations,(e=>isVariableDeclaration(e)));if(o&&isVariableDeclarationList(o.parent)&&o.parent.declarations.length===1){o=o.parent.parent}const a=(l=e.declarations)==null?void 0:l.find(isPropertyAccessExpression);if(a&&isBinaryExpression(a.parent)&&isIdentifier(a.parent.right)&&((d=u.symbol)==null?void 0:d.valueDeclaration)&&isSourceFile(u.symbol.valueDeclaration)){const e=g===a.parent.right.escapedText?void 0:a.parent.right;addResult(zr.createExportDeclaration(void 0,false,zr.createNamedExports([zr.createExportSpecifier(false,e,g)])),0);t.tracker.trackSymbol(u.symbol,t.enclosingDeclaration,111551)}else{const a=setTextRange2(t,zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(i,void 0,serializeTypeForDeclaration(t,void 0,u,e))],r)),o);addResult(a,i!==g?_&~32:_);if(i!==g&&!n){addResult(zr.createExportDeclaration(void 0,false,zr.createNamedExports([zr.createExportSpecifier(false,i,g)])),0);m=false;f=false}}}}}if(e.flags&384){serializeEnum(e,p,_)}if(e.flags&32){if(e.flags&4&&e.valueDeclaration&&isBinaryExpression(e.valueDeclaration.parent)&&isClassExpression(e.valueDeclaration.parent.right)){serializeAsAlias(e,getInternalSymbolName(e,p),_)}else{serializeAsClass(e,getInternalSymbolName(e,p),_)}}if(e.flags&(512|1024)&&(!g||isTypeOnlyNamespace(e))||y){serializeModule(e,p,_)}if(e.flags&64&&!(e.flags&32)){serializeInterface(e,p,_)}if(e.flags&2097152){serializeAsAlias(e,getInternalSymbolName(e,p),_)}if(e.flags&4&&e.escapedName==="export="){serializeMaybeAliasAssignment(e)}if(e.flags&8388608){if(e.declarations){for(const n of e.declarations){const e=resolveExternalModuleName(n,n.moduleSpecifier);if(!e)continue;addResult(zr.createExportDeclaration(void 0,n.isTypeOnly,void 0,zr.createStringLiteral(getSpecifierForModuleSymbol(e,t))),0)}}}if(f){addResult(zr.createExportAssignment(void 0,false,zr.createIdentifier(getInternalSymbolName(e,p))),0)}else if(m){addResult(zr.createExportDeclaration(void 0,false,zr.createNamedExports([zr.createExportSpecifier(false,getInternalSymbolName(e,p),p)])),0)}}function includePrivateSymbol(e){if(some(e.declarations,isPartOfParameterDeclaration))return;S.assertIsDefined(c[c.length-1]);getUnusedName(unescapeLeadingUnderscores(e.escapedName),e);const t=!!(e.flags&2097152)&&!some(e.declarations,(e=>!!findAncestor(e,isExportDeclaration)||isNamespaceExport(e)||isImportEqualsDeclaration(e)&&!isExternalModuleReference(e.moduleReference)));c[t?0:c.length-1].set(getSymbolId(e),e)}function isExportingScope(e){return isSourceFile(e)&&(isExternalOrCommonJsModule(e)||isJsonSourceFile(e))||isAmbientModule(e)&&!isGlobalScopeAugmentation(e)}function addResult(e,n){if(canHaveModifiers(e)){let r=0;const i=t.enclosingDeclaration&&(isJSDocTypeAlias(t.enclosingDeclaration)?getSourceFileOfNode(t.enclosingDeclaration):t.enclosingDeclaration);if(n&32&&i&&(isExportingScope(i)||isModuleDeclaration(i))&&canHaveExportModifier(e)){r|=32}if(u&&!(r&32)&&(!i||!(i.flags&33554432))&&(isEnumDeclaration(e)||isVariableStatement(e)||isFunctionDeclaration(e)||isClassDeclaration(e)||isModuleDeclaration(e))){r|=128}if(n&2048&&(isClassDeclaration(e)||isInterfaceDeclaration(e)||isFunctionDeclaration(e))){r|=2048}if(r){e=zr.replaceModifiers(e,r|getEffectiveModifierFlags(e))}}a.push(e)}function serializeTypeAlias(e,n,r){var i;const o=getDeclaredTypeOfTypeAlias(e);const a=getSymbolLinks(e).typeParameters;const s=map(a,(e=>typeParameterToDeclaration(e,t)));const c=(i=e.declarations)==null?void 0:i.find(isJSDocTypeAlias);const l=getTextOfJSDocComment(c?c.comment||c.parent.comment:void 0);const d=saveRestoreFlags(t);t.flags|=8388608;const p=t.enclosingDeclaration;t.enclosingDeclaration=c;const u=c&&c.typeExpression&&isJSDocTypeExpression(c.typeExpression)&&J.tryReuseExistingTypeNode(t,c.typeExpression.type)||typeToTypeNodeHelper(o,t);addResult(setSyntheticLeadingComments(zr.createTypeAliasDeclaration(void 0,getInternalSymbolName(e,n),s,u),!l?[]:[{kind:3,text:"*\n * "+l.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:true}]),r);d();t.enclosingDeclaration=p}function serializeInterface(e,n,r){const i=getDeclaredTypeOfClassOrInterface(e);const o=getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);const a=map(o,(e=>typeParameterToDeclaration(e,t)));const s=getBaseTypes(i);const c=length(s)?getIntersectionType(s):void 0;const l=flatMap(getPropertiesOfType(i),(e=>serializePropertySymbolForInterface(e,c)));const d=serializeSignatures(0,i,c,179);const p=serializeSignatures(1,i,c,180);const u=serializeIndexSignatures(i,c);const f=!length(s)?void 0:[zr.createHeritageClause(96,mapDefined(s,(e=>trySerializeAsTypeReference(e,111551))))];addResult(zr.createInterfaceDeclaration(void 0,getInternalSymbolName(e,n),a,f,[...u,...p,...d,...l]),r)}function getNamespaceMembersForSerialization(e){let t=arrayFrom(getExportsOfSymbol(e).values());const n=getMergedSymbol(e);if(n!==e){const e=new Set(t);for(const t of getExportsOfSymbol(n).values()){if(!(getSymbolFlags(resolveSymbol(t))&111551)){e.add(t)}}t=arrayFrom(e)}return filter(t,(e=>isNamespaceMember(e)&&isIdentifierText(e.escapedName,99)))}function isTypeOnlyNamespace(e){return every(getNamespaceMembersForSerialization(e),(e=>!(getSymbolFlags(resolveSymbol(e))&111551)))}function serializeModule(e,n,r){const i=getNamespaceMembersForSerialization(e);const o=arrayToMultiMap(i,(t=>t.parent&&t.parent===e?"real":"merged"));const a=o.get("real")||d;const s=o.get("merged")||d;if(length(a)){const t=getInternalSymbolName(e,n);serializeAsNamespaceDeclaration(a,t,r,!!(e.flags&(16|67108864)))}if(length(s)){const r=getSourceFileOfNode(t.enclosingDeclaration);const i=getInternalSymbolName(e,n);const o=zr.createModuleBlock([zr.createExportDeclaration(void 0,false,zr.createNamedExports(mapDefined(filter(s,(e=>e.escapedName!=="export=")),(n=>{var i,o;const a=unescapeLeadingUnderscores(n.escapedName);const s=getInternalSymbolName(n,a);const c=n.declarations&&getDeclarationOfAliasSymbol(n);if(r&&(c?r!==getSourceFileOfNode(c):!some(n.declarations,(e=>getSourceFileOfNode(e)===r)))){(o=(i=t.tracker)==null?void 0:i.reportNonlocalAugmentation)==null?void 0:o.call(i,r,e,n);return void 0}const l=c&&getTargetOfAliasDeclaration(c,true);includePrivateSymbol(l||n);const d=l?getInternalSymbolName(l,unescapeLeadingUnderscores(l.escapedName)):s;return zr.createExportSpecifier(false,a===d?void 0:d,a)}))))]);addResult(zr.createModuleDeclaration(void 0,zr.createIdentifier(i),o,32),0)}}function serializeEnum(e,t,n){addResult(zr.createEnumDeclaration(zr.createModifiersFromModifierFlags(isConstEnumSymbol(e)?4096:0),getInternalSymbolName(e,t),map(filter(getPropertiesOfType(getTypeOfSymbol(e)),(e=>!!(e.flags&8))),(e=>{const t=e.declarations&&e.declarations[0]&&isEnumMember(e.declarations[0])?getConstantValue2(e.declarations[0]):void 0;return zr.createEnumMember(unescapeLeadingUnderscores(e.escapedName),t===void 0?void 0:typeof t==="string"?zr.createStringLiteral(t):zr.createNumericLiteral(t))}))),n)}function serializeAsFunctionNamespaceMerge(e,n,r,i){const o=getSignaturesOfType(e,0);for(const e of o){const n=signatureToSignatureDeclarationHelper(e,262,t,{name:zr.createIdentifier(r)});addResult(setTextRange2(t,n,getSignatureTextRangeLocation(e)),i)}if(!(n.flags&(512|1024)&&!!n.exports&&!!n.exports.size)){const t=filter(getPropertiesOfType(e),isNamespaceMember);serializeAsNamespaceDeclaration(t,r,i,true)}}function getSignatureTextRangeLocation(e){if(e.declaration&&e.declaration.parent){if(isBinaryExpression(e.declaration.parent)&&getAssignmentDeclarationKind(e.declaration.parent)===5){return e.declaration.parent}if(isVariableDeclaration(e.declaration.parent)&&e.declaration.parent.parent){return e.declaration.parent.parent}}return e.declaration}function serializeAsNamespaceDeclaration(e,n,r,i){if(length(e)){const s=arrayToMultiMap(e,(e=>!length(e.declarations)||some(e.declarations,(e=>getSourceFileOfNode(e)===getSourceFileOfNode(t.enclosingDeclaration)))?"local":"remote"));const c=s.get("local")||d;let l=wi.createModuleDeclaration(void 0,zr.createIdentifier(n),zr.createModuleBlock([]),32);setParent(l,o);l.locals=createSymbolTable(e);l.symbol=e[0].parent;const p=a;a=[];const f=u;u=false;const m={...t,enclosingDeclaration:l};const _=t;t=m;visitSymbolTable(createSymbolTable(c),i,true);t=_;u=f;const g=a;a=p;const y=map(g,(e=>isExportAssignment(e)&&!e.isExportEquals&&isIdentifier(e.expression)?zr.createExportDeclaration(void 0,false,zr.createNamedExports([zr.createExportSpecifier(false,e.expression,zr.createIdentifier("default"))])):e));const h=every(y,(e=>hasSyntacticModifier(e,32)))?map(y,removeExportModifier):y;l=zr.updateModuleDeclaration(l,l.modifiers,l.name,zr.createModuleBlock(h));addResult(l,r)}}function isNamespaceMember(e){return!!(e.flags&(788968|1920|2097152))||!(e.flags&4194304||e.escapedName==="prototype"||e.valueDeclaration&&isStatic(e.valueDeclaration)&&isClassLike(e.valueDeclaration.parent))}function sanitizeJSDocImplements(e){const n=mapDefined(e,(e=>{const n=t.enclosingDeclaration;t.enclosingDeclaration=e;let r=e.expression;if(isEntityNameExpression(r)){if(isIdentifier(r)&&idText(r)===""){return cleanup(void 0)}let e;({introducesError:e,node:r}=trackExistingEntityName(r,t));if(e){return cleanup(void 0)}}return cleanup(zr.createExpressionWithTypeArguments(r,map(e.typeArguments,(e=>J.tryReuseExistingTypeNode(t,e)||typeToTypeNodeHelper(getTypeFromTypeNode2(t,e),t)))));function cleanup(e){t.enclosingDeclaration=n;return e}}));if(n.length===e.length){return n}return void 0}function serializeAsClass(e,n,i){var o,a;const s=(o=e.declarations)==null?void 0:o.find(isClassLike);const c=t.enclosingDeclaration;t.enclosingDeclaration=s||c;const l=getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);const p=map(l,(e=>typeParameterToDeclaration(e,t)));const u=getTypeWithThisArgument(getDeclaredTypeOfClassOrInterface(e));const f=getBaseTypes(u);const m=s&&getEffectiveImplementsTypeNodes(s);const _=m&&sanitizeJSDocImplements(m)||mapDefined(getImplementsTypes(u),serializeImplementedType);const g=getTypeOfSymbol(e);const y=!!((a=g.symbol)==null?void 0:a.valueDeclaration)&&isClassLike(g.symbol.valueDeclaration);const h=y?getBaseConstructorTypeOfClass(g):ke;const T=[...!length(f)?[]:[zr.createHeritageClause(96,map(f,(e=>serializeBaseType(e,h,n))))],...!length(_)?[]:[zr.createHeritageClause(119,_)]];const S=getNonInheritedProperties(u,f,getPropertiesOfType(u));const v=filter(S,(e=>{const t=e.valueDeclaration;return!!t&&!(isNamedDeclaration(t)&&isPrivateIdentifier(t.name))}));const x=some(S,(e=>{const t=e.valueDeclaration;return!!t&&isNamedDeclaration(t)&&isPrivateIdentifier(t.name)}));const b=x?[zr.createPropertyDeclaration(void 0,zr.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:d;const C=flatMap(v,(e=>r(e,false,f[0])));const E=flatMap(filter(getPropertiesOfType(g),(e=>!(e.flags&4194304)&&e.escapedName!=="prototype"&&!isNamespaceMember(e))),(e=>r(e,true,h)));const N=!y&&!!e.valueDeclaration&&isInJSFile(e.valueDeclaration)&&!some(getSignaturesOfType(g,1));const k=N?[zr.createConstructorDeclaration(zr.createModifiersFromModifierFlags(2),[],void 0)]:serializeSignatures(1,g,h,176);const F=serializeIndexSignatures(u,f[0]);t.enclosingDeclaration=c;addResult(setTextRange2(t,zr.createClassDeclaration(void 0,n,p,T,[...F,...E,...k,...C,...b]),e.declarations&&filter(e.declarations,(e=>isClassDeclaration(e)||isClassExpression(e)))[0]),i)}function getSomeTargetNameFromDeclarations(e){return firstDefined(e,(e=>{if(isImportSpecifier(e)||isExportSpecifier(e)){return moduleExportNameTextUnescaped(e.propertyName||e.name)}if(isBinaryExpression(e)||isExportAssignment(e)){const t=isExportAssignment(e)?e.expression:e.right;if(isPropertyAccessExpression(t)){return idText(t.name)}}if(isAliasSymbolDeclaration(e)){const t=getNameOfDeclaration(e);if(t&&isIdentifier(t)){return idText(t)}}return void 0}))}function serializeAsAlias(e,n,r){var i,o,a,s,c;const l=getDeclarationOfAliasSymbol(e);if(!l)return S.fail();const d=getMergedSymbol(getTargetOfAliasDeclaration(l,true));if(!d){return}let p=isShorthandAmbientModuleSymbol(d)&&getSomeTargetNameFromDeclarations(e.declarations)||unescapeLeadingUnderscores(d.escapedName);if(p==="export="&&N){p="default"}const u=getInternalSymbolName(d,p);includePrivateSymbol(d);switch(l.kind){case 208:if(((o=(i=l.parent)==null?void 0:i.parent)==null?void 0:o.kind)===260){const e=getSpecifierForModuleSymbol(d.parent||d,t);const{propertyName:r}=l;addResult(zr.createImportDeclaration(void 0,zr.createImportClause(false,void 0,zr.createNamedImports([zr.createImportSpecifier(false,r&&isIdentifier(r)?zr.createIdentifier(idText(r)):void 0,zr.createIdentifier(n))])),zr.createStringLiteral(e),void 0),0);break}S.failBadSyntaxKind(((a=l.parent)==null?void 0:a.parent)||l,"Unhandled binding element grandparent kind in declaration serialization");break;case 304:if(((c=(s=l.parent)==null?void 0:s.parent)==null?void 0:c.kind)===226){serializeExportSpecifier(unescapeLeadingUnderscores(e.escapedName),u)}break;case 260:if(isPropertyAccessExpression(l.initializer)){const e=l.initializer;const i=zr.createUniqueName(n);const o=getSpecifierForModuleSymbol(d.parent||d,t);addResult(zr.createImportEqualsDeclaration(void 0,false,i,zr.createExternalModuleReference(zr.createStringLiteral(o))),0);addResult(zr.createImportEqualsDeclaration(void 0,false,zr.createIdentifier(n),zr.createQualifiedName(i,e.name)),r);break}case 271:if(d.escapedName==="export="&&some(d.declarations,(e=>isSourceFile(e)&&isJsonSourceFile(e)))){serializeMaybeAliasAssignment(e);break}const f=!(d.flags&512)&&!isVariableDeclaration(l);addResult(zr.createImportEqualsDeclaration(void 0,false,zr.createIdentifier(n),f?symbolToName(d,t,-1,false):zr.createExternalModuleReference(zr.createStringLiteral(getSpecifierForModuleSymbol(d,t)))),f?r:0);break;case 270:addResult(zr.createNamespaceExportDeclaration(idText(l.name)),0);break;case 273:{const e=getSpecifierForModuleSymbol(d.parent||d,t);const r=t.bundled?zr.createStringLiteral(e):l.parent.moduleSpecifier;const i=isImportDeclaration(l.parent)?l.parent.attributes:void 0;const o=isJSDocImportTag(l.parent);addResult(zr.createImportDeclaration(void 0,zr.createImportClause(o,zr.createIdentifier(n),void 0),r,i),0);break}case 274:{const e=getSpecifierForModuleSymbol(d.parent||d,t);const r=t.bundled?zr.createStringLiteral(e):l.parent.parent.moduleSpecifier;const i=isJSDocImportTag(l.parent.parent);addResult(zr.createImportDeclaration(void 0,zr.createImportClause(i,void 0,zr.createNamespaceImport(zr.createIdentifier(n))),r,l.parent.attributes),0);break}case 280:addResult(zr.createExportDeclaration(void 0,false,zr.createNamespaceExport(zr.createIdentifier(n)),zr.createStringLiteral(getSpecifierForModuleSymbol(d,t))),0);break;case 276:{const e=getSpecifierForModuleSymbol(d.parent||d,t);const r=t.bundled?zr.createStringLiteral(e):l.parent.parent.parent.moduleSpecifier;const i=isJSDocImportTag(l.parent.parent.parent);addResult(zr.createImportDeclaration(void 0,zr.createImportClause(i,void 0,zr.createNamedImports([zr.createImportSpecifier(false,n!==p?zr.createIdentifier(p):void 0,zr.createIdentifier(n))])),r,l.parent.parent.parent.attributes),0);break}case 281:const m=l.parent.parent.moduleSpecifier;if(m){const e=l.propertyName;if(e&&moduleExportNameIsDefault(e)){p="default"}}serializeExportSpecifier(unescapeLeadingUnderscores(e.escapedName),m?p:u,m&&isStringLiteralLike(m)?zr.createStringLiteral(m.text):void 0);break;case 277:serializeMaybeAliasAssignment(e);break;case 226:case 211:case 212:if(e.escapedName==="default"||e.escapedName==="export="){serializeMaybeAliasAssignment(e)}else{serializeExportSpecifier(n,u)}break;default:return S.failBadSyntaxKind(l,"Unhandled alias declaration kind in symbol serializer!")}}function serializeExportSpecifier(e,t,n){addResult(zr.createExportDeclaration(void 0,false,zr.createNamedExports([zr.createExportSpecifier(false,e!==t?t:void 0,e)]),n),0)}function serializeMaybeAliasAssignment(e){var n;if(e.flags&4194304){return false}const r=unescapeLeadingUnderscores(e.escapedName);const i=r==="export=";const s=r==="default";const c=i||s;const l=e.declarations&&getDeclarationOfAliasSymbol(e);const d=l&&getTargetOfAliasDeclaration(l,true);if(d&&length(d.declarations)&&some(d.declarations,(e=>getSourceFileOfNode(e)===getSourceFileOfNode(o)))){const n=l&&(isExportAssignment(l)||isBinaryExpression(l)?getExportAssignmentExpression(l):getPropertyAssignmentAliasLikeExpression(l));const s=n&&isEntityNameExpression(n)?getFirstNonModuleExportsIdentifier(n):void 0;const p=s&&resolveEntityName(s,-1,true,true,o);if(p||d){includePrivateSymbol(p||d)}const u=t.tracker.disableTrackSymbol;t.tracker.disableTrackSymbol=true;if(c){a.push(zr.createExportAssignment(void 0,i,symbolToExpression(d,t,-1)))}else{if(s===n&&s){serializeExportSpecifier(r,idText(s))}else if(n&&isClassExpression(n)){serializeExportSpecifier(r,getInternalSymbolName(d,symbolName(d)))}else{const n=getUnusedName(r,e);addResult(zr.createImportEqualsDeclaration(void 0,false,zr.createIdentifier(n),symbolToName(d,t,-1,false)),0);serializeExportSpecifier(r,n)}}t.tracker.disableTrackSymbol=u;return true}else{const o=getUnusedName(r,e);const s=getWidenedType(getTypeOfSymbol(getMergedSymbol(e)));if(isTypeRepresentableAsFunctionNamespaceMerge(s,e)){serializeAsFunctionNamespaceMerge(s,e,o,c?0:32)}else{const i=((n=t.enclosingDeclaration)==null?void 0:n.kind)===267&&(!(e.flags&98304)||e.flags&65536)?1:2;const a=zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(o,void 0,serializeTypeForDeclaration(t,void 0,s,e))],i));addResult(a,d&&d.flags&4&&d.escapedName==="export="?128:r===o?32:0)}if(c){a.push(zr.createExportAssignment(void 0,i,zr.createIdentifier(o)));return true}else if(r!==o){serializeExportSpecifier(r,o);return true}return false}}function isTypeRepresentableAsFunctionNamespaceMerge(e,n){var r;const i=getSourceFileOfNode(t.enclosingDeclaration);return getObjectFlags(e)&(16|32)&&!some((r=e.symbol)==null?void 0:r.declarations,isTypeNode)&&!length(getIndexInfosOfType(e))&&!isClassInstanceSide(e)&&!!(length(filter(getPropertiesOfType(e),isNamespaceMember))||length(getSignaturesOfType(e,0)))&&!length(getSignaturesOfType(e,1))&&!getDeclarationWithTypeAnnotation(n,o)&&!(e.symbol&&some(e.symbol.declarations,(e=>getSourceFileOfNode(e)!==i)))&&!some(getPropertiesOfType(e),(e=>isLateBoundName(e.escapedName)))&&!some(getPropertiesOfType(e),(e=>some(e.declarations,(e=>getSourceFileOfNode(e)!==i))))&&every(getPropertiesOfType(e),(e=>{if(!isIdentifierText(symbolName(e),v)){return false}if(!(e.flags&98304)){return true}return getNonMissingTypeOfSymbol(e)===getWriteTypeOfSymbol(e)}))}function makeSerializePropertySymbol(e,n,r){return function serializePropertySymbol(i,o,a){var s,c,l,d,p,u;const f=getDeclarationModifierFlagsFromSymbol(i);const m=!!(f&2);if(o&&i.flags&(788968|1920|2097152)){return[]}if(i.flags&4194304||i.escapedName==="constructor"||a&&getPropertyOfType(a,i.escapedName)&&isReadonlySymbol(getPropertyOfType(a,i.escapedName))===isReadonlySymbol(i)&&(i.flags&16777216)===(getPropertyOfType(a,i.escapedName).flags&16777216)&&isTypeIdenticalTo(getTypeOfSymbol(i),getTypeOfPropertyOfType(a,i.escapedName))){return[]}const _=f&~1024|(o?256:0);const g=getPropertyNameNodeForSymbol(i,t);const y=(s=i.declarations)==null?void 0:s.find(or(isPropertyDeclaration,isAccessor,isVariableDeclaration,isPropertySignature,isBinaryExpression,isPropertyAccessExpression));if(i.flags&98304&&r){const e=[];if(i.flags&65536){const n=i.declarations&&forEach(i.declarations,(e=>{if(e.kind===178){return e}if(isCallExpression(e)&&isBindableObjectDefinePropertyCall(e)){return forEach(e.arguments[2].properties,(e=>{const t=getNameOfDeclaration(e);if(!!t&&isIdentifier(t)&&idText(t)==="set"){return e}}))}}));S.assert(!!n);const r=isFunctionLikeDeclaration(n)?getSignatureFromDeclaration(n).parameters[0]:void 0;const o=(c=i.declarations)==null?void 0:c.find(isSetAccessor);e.push(setTextRange2(t,zr.createSetAccessorDeclaration(zr.createModifiersFromModifierFlags(_),g,[zr.createParameterDeclaration(void 0,void 0,r?parameterToParameterDeclarationName(r,getEffectiveParameterDeclaration(r),t):"value",void 0,m?void 0:serializeTypeForDeclaration(t,o,getWriteTypeOfSymbol(i),i))],void 0),o??y))}if(i.flags&32768){const n=f&2;const r=(l=i.declarations)==null?void 0:l.find(isGetAccessor);e.push(setTextRange2(t,zr.createGetAccessorDeclaration(zr.createModifiersFromModifierFlags(_),g,[],n?void 0:serializeTypeForDeclaration(t,r,getTypeOfSymbol(i),i),void 0),r??y))}return e}else if(i.flags&(4|3|98304)){return setTextRange2(t,e(zr.createModifiersFromModifierFlags((isReadonlySymbol(i)?8:0)|_),g,i.flags&16777216?zr.createToken(58):void 0,m?void 0:serializeTypeForDeclaration(t,(d=i.declarations)==null?void 0:d.find(isSetAccessorDeclaration),getWriteTypeOfSymbol(i),i),void 0),((p=i.declarations)==null?void 0:p.find(or(isPropertyDeclaration,isVariableDeclaration)))||y)}if(i.flags&(8192|16)){const r=getTypeOfSymbol(i);const o=getSignaturesOfType(r,0);if(_&2){return setTextRange2(t,e(zr.createModifiersFromModifierFlags((isReadonlySymbol(i)?8:0)|_),g,i.flags&16777216?zr.createToken(58):void 0,void 0,void 0),((u=i.declarations)==null?void 0:u.find(isFunctionLikeDeclaration))||o[0]&&o[0].declaration||i.declarations&&i.declarations[0])}const a=[];for(const e of o){const r=signatureToSignatureDeclarationHelper(e,n,t,{name:g,questionToken:i.flags&16777216?zr.createToken(58):void 0,modifiers:_?zr.createModifiersFromModifierFlags(_):void 0});const o=e.declaration&&isPrototypePropertyAssignment(e.declaration.parent)?e.declaration.parent:e.declaration;a.push(setTextRange2(t,r,o))}return a}return S.fail(`Unhandled class member kind! ${i.__debugFlags||i.flags}`)}}function serializePropertySymbolForInterface(e,t){return i(e,false,t)}function serializeSignatures(e,n,r,i){const o=getSignaturesOfType(n,e);if(e===1){if(!r&&every(o,(e=>length(e.parameters)===0))){return[]}if(r){const e=getSignaturesOfType(r,1);if(!length(e)&&every(o,(e=>length(e.parameters)===0))){return[]}if(e.length===o.length){let t=false;for(let n=0;ntypeToTypeNodeHelper(e,t)));i=symbolToExpression(e.target.symbol,t,788968)}else if(e.symbol&&isSymbolAccessibleByFlags(e.symbol,o,n)){i=symbolToExpression(e.symbol,t,788968)}if(i){return zr.createExpressionWithTypeArguments(i,r)}}function serializeImplementedType(e){const n=trySerializeAsTypeReference(e,788968);if(n){return n}if(e.symbol){return zr.createExpressionWithTypeArguments(symbolToExpression(e.symbol,t,788968),void 0)}}function getUnusedName(e,n){var r,i;const o=n?getSymbolId(n):void 0;if(o){if(t.remappedSymbolNames.has(o)){return t.remappedSymbolNames.get(o)}}if(n){e=getNameCandidateWorker(n,e)}let a=0;const s=e;while((r=t.usedSymbolNames)==null?void 0:r.has(e)){a++;e=`${s}_${a}`}(i=t.usedSymbolNames)==null?void 0:i.add(e);if(o){t.remappedSymbolNames.set(o,e)}return e}function getNameCandidateWorker(e,n){if(n==="default"||n==="__class"||n==="__function"){const r=saveRestoreFlags(t);t.flags|=16777216;const i=getNameOfSymbolAsWritten(e,t);r();n=i.length>0&&isSingleOrDoubleQuote(i.charCodeAt(0))?stripQuotes(i):i}if(n==="default"){n="_default"}else if(n==="export="){n="_exports"}n=isIdentifierText(n,v)&&!isStringANonContextualKeyword(n)?n:"_"+n.replace(/[^a-z0-9]/gi,"_");return n}function getInternalSymbolName(e,n){const r=getSymbolId(e);if(t.remappedSymbolNames.has(r)){return t.remappedSymbolNames.get(r)}n=getNameCandidateWorker(e,n);t.remappedSymbolNames.set(r,n);return n}}}function typePredicateToString(e,t,n=16384,r){return r?typePredicateToStringWorker(r).getText():usingSingleLineStringWriter(typePredicateToStringWorker);function typePredicateToStringWorker(r){const i=toNodeBuilderFlags(n)|70221824|512;const o=j.typePredicateToTypePredicateNode(e,t,i);const a=Ia();const s=t&&getSourceFileOfNode(t);a.writeNode(4,o,s,r);return r}}function formatUnionTypes(e){const t=[];let n=0;for(let r=0;rgetNameOfDeclaration(e)?e:void 0));const r=n&&getNameOfDeclaration(n);if(n&&r){if(isCallExpression(n)&&isBindableObjectDefinePropertyCall(n)){return symbolName(e)}if(isComputedPropertyName(r)&&!(getCheckFlags(e)&4096)){const n=getSymbolLinks(e).nameType;if(n&&n.flags&384){const n=getNameOfSymbolFromNameType(e,t);if(n!==void 0){return n}}}return declarationNameToString(r)}if(!n){n=e.declarations[0]}if(n.parent&&n.parent.kind===260){return declarationNameToString(n.parent.name)}switch(n.kind){case 231:case 218:case 219:if(t&&!t.encounteredError&&!(t.flags&131072)){t.encounteredError=true}return n.kind===231?"(Anonymous class)":"(Anonymous function)"}}const r=getNameOfSymbolFromNameType(e,t);return r!==void 0?r:symbolName(e)}function isDeclarationVisible(e){if(e){const t=getNodeLinks(e);if(t.isVisible===void 0){t.isVisible=!!determineIfDeclarationIsVisible()}return t.isVisible}return false;function determineIfDeclarationIsVisible(){switch(e.kind){case 338:case 346:case 340:return!!(e.parent&&e.parent.parent&&e.parent.parent.parent&&isSourceFile(e.parent.parent.parent));case 208:return isDeclarationVisible(e.parent.parent);case 260:if(isBindingPattern(e.name)&&!e.name.elements.length){return false}case 267:case 263:case 264:case 265:case 262:case 266:case 271:if(isExternalModuleAugmentation(e)){return true}const t=getDeclarationContainer(e);if(!(getCombinedModifierFlagsCached(e)&32)&&!(e.kind!==271&&t.kind!==307&&t.flags&33554432)){return isGlobalSourceFile(t)}return isDeclarationVisible(t);case 172:case 171:case 177:case 178:case 174:case 173:if(hasEffectiveModifier(e,2|4)){return false}case 176:case 180:case 179:case 181:case 169:case 268:case 184:case 185:case 187:case 183:case 188:case 189:case 192:case 193:case 196:case 202:return isDeclarationVisible(e.parent);case 273:case 274:case 276:return false;case 168:case 307:case 270:return true;case 277:return false;default:return false}}}function collectLinkedAliases(e,t){let n;if(e.kind!==11&&e.parent&&e.parent.kind===277){n=te(e,e,111551|788968|1920|2097152,void 0,false)}else if(e.parent.kind===281){n=getTargetOfExportSpecifier(e.parent,111551|788968|1920|2097152)}let r;let i;if(n){i=new Set;i.add(getSymbolId(n));buildVisibleNodeList(n.declarations)}return r;function buildVisibleNodeList(e){forEach(e,(e=>{const n=getAnyImportSyntax(e)||e;if(t){getNodeLinks(e).isVisible=true}else{r=r||[];pushIfUnique(r,n)}if(isInternalModuleImportEqualsDeclaration(e)){const t=e.moduleReference;const n=getFirstIdentifier(t);const r=te(e,n.escapedText,111551|788968|1920,void 0,false);if(r&&i){if(tryAddToSet(i,getSymbolId(r))){buildVisibleNodeList(r.declarations)}}}}))}}function pushTypeResolution(e,t){const n=findResolutionCycleStartIndex(e,t);if(n>=0){const{length:e}=Ur;for(let t=n;t=Hr;n--){if(resolutionTargetHasProperty(Ur[n],qr[n])){return-1}if(Ur[n]===e&&qr[n]===t){return n}}return-1}function resolutionTargetHasProperty(e,t){switch(t){case 0:return!!getSymbolLinks(e).type;case 2:return!!getSymbolLinks(e).declaredType;case 1:return!!e.resolvedBaseConstructorType;case 3:return!!e.resolvedReturnType;case 4:return!!e.immediateBaseConstraint;case 5:return!!e.resolvedTypeArguments;case 6:return!!e.baseTypesResolved;case 7:return!!getSymbolLinks(e).writeType;case 8:return getNodeLinks(e).parameterInitializerContainsUndefined!==void 0}return S.assertNever(t)}function popTypeResolution(){Ur.pop();qr.pop();return Vr.pop()}function getDeclarationContainer(e){return findAncestor(getRootDeclaration(e),(e=>{switch(e.kind){case 260:case 261:case 276:case 275:case 274:case 273:return false;default:return true}})).parent}function getTypeOfPrototypeProperty(e){const t=getDeclaredTypeOfSymbol(getParentOfSymbol(e));return t.typeParameters?createTypeReference(t,map(t.typeParameters,(e=>ke))):t}function getTypeOfPropertyOfType(e,t){const n=getPropertyOfType(e,t);return n?getTypeOfSymbol(n):void 0}function getTypeOfPropertyOrIndexSignatureOfType(e,t){var n;let r;return getTypeOfPropertyOfType(e,t)||(r=(n=getApplicableIndexInfoForName(e,t))==null?void 0:n.type)&&addOptionality(r,true,true)}function isTypeAny(e){return e&&(e.flags&1)!==0}function isErrorType(e){return e===Ie||!!(e.flags&1&&e.aliasSymbol)}function getTypeForBindingElementParent(e,t){if(t!==0){return getTypeForVariableLikeDeclaration(e,false,t)}const n=getSymbolOfDeclaration(e);return n&&getSymbolLinks(n).type||getTypeForVariableLikeDeclaration(e,false,t)}function getRestType(e,t,n){e=filterType(e,(e=>!(e.flags&98304)));if(e.flags&131072){return ht}if(e.flags&1048576){return mapType(e,(e=>getRestType(e,t,n)))}let r=getUnionType(map(t,getLiteralTypeFromPropertyName));const i=[];const o=[];for(const t of getPropertiesOfType(e)){const e=getLiteralTypeFromProperty(t,8576);if(!isTypeAssignableTo(e,r)&&!(getDeclarationModifierFlagsFromSymbol(t)&(2|4))&&isSpreadableProperty(t)){i.push(t)}else{o.push(e)}}if(isGenericObjectType(e)||isGenericIndexType(r)){if(o.length){r=getUnionType([r,...o])}if(r.flags&131072){return e}const t=getGlobalOmitSymbol();if(!t){return Ie}return getTypeAliasInstantiation(t,[e,r])}const a=createSymbolTable();for(const e of i){a.set(e.escapedName,getSpreadSymbol(e,false))}const s=createAnonymousType(n,a,d,d,getIndexInfosOfType(e));s.objectFlags|=4194304;return s}function isGenericTypeWithUndefinedConstraint(e){return!!(e.flags&465829888)&&maybeTypeOfKind(getBaseConstraintOfType(e)||Le,32768)}function getNonUndefinedType(e){const t=someType(e,isGenericTypeWithUndefinedConstraint)?mapType(e,(e=>e.flags&465829888?getBaseConstraintOrType(e):e)):e;return getTypeWithFacts(t,524288)}function getFlowTypeOfDestructuring(e,t){const n=getSyntheticElementAccess(e);return n?getFlowTypeOfReference(n,t):t}function getSyntheticElementAccess(e){const t=getParentElementAccess(e);if(t&&canHaveFlowNode(t)&&t.flowNode){const n=getDestructuringPropertyName(e);if(n){const r=setTextRange(wi.createStringLiteral(n),e);const i=isLeftHandSideExpression(t)?t:wi.createParenthesizedExpression(t);const o=setTextRange(wi.createElementAccessExpression(i,r),e);setParent(r,o);setParent(o,e);if(i!==t){setParent(i,o)}o.flowNode=t.flowNode;return o}}}function getParentElementAccess(e){const t=e.parent.parent;switch(t.kind){case 208:case 303:return getSyntheticElementAccess(t);case 209:return getSyntheticElementAccess(e.parent);case 260:return t.initializer;case 226:return t.right}}function getDestructuringPropertyName(e){const t=e.parent;if(e.kind===208&&t.kind===206){return getLiteralPropertyNameText(e.propertyName||e.name)}if(e.kind===303||e.kind===304){return getLiteralPropertyNameText(e.name)}return""+t.elements.indexOf(e)}function getLiteralPropertyNameText(e){const t=getLiteralTypeFromPropertyName(e);return t.flags&(128|256)?""+t.value:void 0}function getTypeForBindingElement(e){const t=e.dotDotDotToken?32:0;const n=getTypeForBindingElementParent(e.parent.parent,t);return n&&getBindingElementTypeFromParentType(e,n,false)}function getBindingElementTypeFromParentType(e,t,n){if(isTypeAny(t)){return t}const r=e.parent;if(k&&e.flags&33554432&&isPartOfParameterDeclaration(e)){t=getNonNullableType(t)}else if(k&&r.parent.initializer&&!hasTypeFacts(getTypeOfInitializer(r.parent.initializer),65536)){t=getTypeWithFacts(t,524288)}const i=32|(n||hasDefaultValue(e)?16:0);let o;if(r.kind===206){if(e.dotDotDotToken){t=getReducedType(t);if(t.flags&2||!isValidSpreadType(t)){error2(e,wt.Rest_types_may_only_be_created_from_object_types);return Ie}const n=[];for(const e of r.elements){if(!e.dotDotDotToken){n.push(e.propertyName||e.name)}}o=getRestType(t,n,e.symbol)}else{const n=e.propertyName||e.name;const r=getLiteralTypeFromPropertyName(n);const a=getIndexedAccessType(t,r,i,n);o=getFlowTypeOfDestructuring(e,a)}}else{const n=checkIteratedTypeOrElementType(65|(e.dotDotDotToken?0:128),t,Me,r);const a=r.elements.indexOf(e);if(e.dotDotDotToken){const e=mapType(t,(e=>e.flags&58982400?getBaseConstraintOrType(e):e));o=everyType(e,isTupleType)?mapType(e,(e=>sliceTupleType(e,a))):createArrayType(n)}else if(isArrayLikeType(t)){const n=getNumberLiteralType(a);const r=getIndexedAccessTypeOrUndefined(t,n,i,e.name)||Ie;o=getFlowTypeOfDestructuring(e,r)}else{o=n}}if(!e.initializer){return o}if(getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(e))){return k&&!hasTypeFacts(checkDeclarationInitializer(e,0),16777216)?getNonUndefinedType(o):o}return widenTypeInferredFromInitializer(e,getUnionType([getNonUndefinedType(o),checkDeclarationInitializer(e,0)],2))}function getTypeForDeclarationFromJSDocComment(e){const t=getJSDocType(e);if(t){return getTypeFromTypeNode(t)}return void 0}function isNullOrUndefined3(e){const t=skipParentheses(e,true);return t.kind===106||t.kind===80&&getResolvedSymbol(t)===z}function isEmptyArrayLiteral2(e){const t=skipParentheses(e,true);return t.kind===209&&t.elements.length===0}function addOptionality(e,t=false,n=true){return k&&n?getOptionalType(e,t):e}function getTypeForVariableLikeDeclaration(e,t,n){if(isVariableDeclaration(e)&&e.parent.parent.kind===249){const t=getIndexType(getNonNullableTypeIfNeeded(checkExpression(e.parent.parent.expression,n)));return t.flags&(262144|4194304)?getExtractStringType(t):ze}if(isVariableDeclaration(e)&&e.parent.parent.kind===250){const t=e.parent.parent;return checkRightHandSideOfForOf(t)||ke}if(isBindingPattern(e.parent)){return getTypeForBindingElement(e)}const r=isPropertyDeclaration(e)&&!hasAccessorModifier(e)||isPropertySignature(e)||isJSDocPropertyTag(e);const i=t&&isOptionalDeclaration(e);const o=tryGetTypeFromEffectiveTypeNode(e);if(isCatchClauseVariableDeclarationOrBindingElement(e)){if(o){return isTypeAny(o)||o===Le?o:Ie}return w?Le:ke}if(o){return addOptionality(o,r,i)}if((A||isInJSFile(e))&&isVariableDeclaration(e)&&!isBindingPattern(e.name)&&!(getCombinedModifierFlagsCached(e)&32)&&!(e.flags&33554432)){if(!(getCombinedNodeFlagsCached(e)&6)&&(!e.initializer||isNullOrUndefined3(e.initializer))){return Fe}if(e.initializer&&isEmptyArrayLiteral2(e.initializer)){return hn}}if(isParameter(e)){if(!e.symbol){return}const t=e.parent;if(t.kind===178&&hasBindableName(t)){const n=getDeclarationOfKind(getSymbolOfDeclaration(e.parent),177);if(n){const r=getSignatureFromDeclaration(n);const i=getAccessorThisParameter(t);if(i&&e===i){S.assert(!i.type);return getTypeOfSymbol(r.thisParameter)}return getReturnTypeOfSignature(r)}}const n=getParameterTypeOfTypeTag(t,e);if(n)return n;const r=e.symbol.escapedName==="this"?getContextualThisParameterType(t):getContextuallyTypedParameterType(e);if(r){return addOptionality(r,false,i)}}if(hasOnlyExpressionInitializer(e)&&!!e.initializer){if(isInJSFile(e)&&!isParameter(e)){const t=getJSContainerObjectType(e,getSymbolOfDeclaration(e),getDeclaredExpandoInitializer(e));if(t){return t}}const t=widenTypeInferredFromInitializer(e,checkDeclarationInitializer(e,n));return addOptionality(t,r,i)}if(isPropertyDeclaration(e)&&(A||isInJSFile(e))){if(!hasStaticModifier(e)){const t=findConstructorDeclaration(e.parent);const n=t?getFlowTypeInConstructor(e.symbol,t):getEffectiveModifierFlags(e)&128?getTypeOfPropertyInBaseClass(e.symbol):void 0;return n&&addOptionality(n,true,i)}else{const t=filter(e.parent.members,isClassStaticBlockDeclaration);const n=t.length?getFlowTypeInStaticBlocks(e.symbol,t):getEffectiveModifierFlags(e)&128?getTypeOfPropertyInBaseClass(e.symbol):void 0;return n&&addOptionality(n,true,i)}}if(isJsxAttribute(e)){return Ke}if(isBindingPattern(e.name)){return getTypeFromBindingPattern(e.name,false,true)}return void 0}function isConstructorDeclaredProperty(e){if(e.valueDeclaration&&isBinaryExpression(e.valueDeclaration)){const t=getSymbolLinks(e);if(t.isConstructorDeclaredProperty===void 0){t.isConstructorDeclaredProperty=false;t.isConstructorDeclaredProperty=!!getDeclaringConstructor(e)&&every(e.declarations,(t=>isBinaryExpression(t)&&isPossiblyAliasedThisProperty(t)&&(t.left.kind!==212||isStringOrNumericLiteralLike(t.left.argumentExpression))&&!getAnnotatedTypeForAssignmentDeclaration(void 0,t,e,t)))}return t.isConstructorDeclaredProperty}return false}function isAutoTypedProperty(e){const t=e.valueDeclaration;return t&&isPropertyDeclaration(t)&&!getEffectiveTypeAnnotationNode(t)&&!t.initializer&&(A||isInJSFile(t))}function getDeclaringConstructor(e){if(!e.declarations){return}for(const t of e.declarations){const e=getThisContainer(t,false,false);if(e&&(e.kind===176||isJSConstructor(e))){return e}}}function getFlowTypeFromCommonJSExport(e){const t=getSourceFileOfNode(e.declarations[0]);const n=unescapeLeadingUnderscores(e.escapedName);const r=e.declarations.every((e=>isInJSFile(e)&&isAccessExpression(e)&&isModuleExportsAccessExpression(e.expression)));const i=r?zr.createPropertyAccessExpression(zr.createPropertyAccessExpression(zr.createIdentifier("module"),zr.createIdentifier("exports")),n):zr.createPropertyAccessExpression(zr.createIdentifier("exports"),n);if(r){setParent(i.expression.expression,i.expression)}setParent(i.expression,i);setParent(i,t);i.flowNode=t.endFlowNode;return getFlowTypeOfReference(i,Fe,Me)}function getFlowTypeInStaticBlocks(e,t){const n=startsWith(e.escapedName,"__#")?zr.createPrivateIdentifier(e.escapedName.split("@")[1]):unescapeLeadingUnderscores(e.escapedName);for(const r of t){const t=zr.createPropertyAccessExpression(zr.createThis(),n);setParent(t.expression,t);setParent(t,r);t.flowNode=r.returnFlowNode;const i=getFlowTypeOfProperty(t,e);if(A&&(i===Fe||i===hn)){error2(e.valueDeclaration,wt.Member_0_implicitly_has_an_1_type,symbolToString(e),typeToString(i))}if(everyType(i,isNullableType)){continue}return convertAutoToAny(i)}}function getFlowTypeInConstructor(e,t){const n=startsWith(e.escapedName,"__#")?zr.createPrivateIdentifier(e.escapedName.split("@")[1]):unescapeLeadingUnderscores(e.escapedName);const r=zr.createPropertyAccessExpression(zr.createThis(),n);setParent(r.expression,r);setParent(r,t);r.flowNode=t.returnFlowNode;const i=getFlowTypeOfProperty(r,e);if(A&&(i===Fe||i===hn)){error2(e.valueDeclaration,wt.Member_0_implicitly_has_an_1_type,symbolToString(e),typeToString(i))}return everyType(i,isNullableType)?void 0:convertAutoToAny(i)}function getFlowTypeOfProperty(e,t){const n=(t==null?void 0:t.valueDeclaration)&&(!isAutoTypedProperty(t)||getEffectiveModifierFlags(t.valueDeclaration)&128)&&getTypeOfPropertyInBaseClass(t)||Me;return getFlowTypeOfReference(e,Fe,n)}function getWidenedTypeForAssignmentDeclaration(e,t){const n=getAssignedExpandoInitializer(e.valueDeclaration);if(n){const t=isInJSFile(n)?getJSDocTypeTag(n):void 0;if(t&&t.typeExpression){return getTypeFromTypeNode(t.typeExpression)}const r=e.valueDeclaration&&getJSContainerObjectType(e.valueDeclaration,e,n);return r||getWidenedLiteralType(checkExpressionCached(n))}let r;let i=false;let o=false;if(isConstructorDeclaredProperty(e)){r=getFlowTypeInConstructor(e,getDeclaringConstructor(e))}if(!r){let n;if(e.declarations){let a;for(const r of e.declarations){const s=isBinaryExpression(r)||isCallExpression(r)?r:isAccessExpression(r)?isBinaryExpression(r.parent)?r.parent:r:void 0;if(!s){continue}const c=isAccessExpression(s)?getAssignmentDeclarationPropertyAccessKind(s):getAssignmentDeclarationKind(s);if(c===4||isBinaryExpression(s)&&isPossiblyAliasedThisProperty(s,c)){if(isDeclarationInConstructor(s)){i=true}else{o=true}}if(!isCallExpression(s)){a=getAnnotatedTypeForAssignmentDeclaration(a,s,e,r)}if(!a){(n||(n=[])).push(isBinaryExpression(s)||isCallExpression(s)?getInitializerTypeFromAssignmentDeclaration(e,t,s,c):et)}}r=a}if(!r){if(!length(n)){return Ie}let t=i&&e.declarations?getConstructorDefinedThisAssignmentTypes(n,e.declarations):void 0;if(o){const n=getTypeOfPropertyInBaseClass(e);if(n){(t||(t=[])).push(n);i=true}}const a=some(t,(e=>!!(e.flags&~98304)))?t:n;r=getUnionType(a)}}const a=getWidenedType(addOptionality(r,false,o&&!i));if(e.valueDeclaration&&isInJSFile(e.valueDeclaration)&&filterType(a,(e=>!!(e.flags&~98304)))===et){reportImplicitAny(e.valueDeclaration,ke);return ke}return a}function getJSContainerObjectType(e,t,n){var r,i;if(!isInJSFile(e)||!n||!isObjectLiteralExpression(n)||n.properties.length){return void 0}const o=createSymbolTable();while(isBinaryExpression(e)||isPropertyAccessExpression(e)){const t=getSymbolOfNode(e);if((r=t==null?void 0:t.exports)==null?void 0:r.size){mergeSymbolTable(o,t.exports)}e=isBinaryExpression(e)?e.parent:e.parent.parent}const a=getSymbolOfNode(e);if((i=a==null?void 0:a.exports)==null?void 0:i.size){mergeSymbolTable(o,a.exports)}const s=createAnonymousType(t,o,d,d,d);s.objectFlags|=4096;return s}function getAnnotatedTypeForAssignmentDeclaration(e,t,n,r){var i;const o=getEffectiveTypeAnnotationNode(t.parent);if(o){const t=getWidenedType(getTypeFromTypeNode(o));if(!e){return t}else if(!isErrorType(e)&&!isErrorType(t)&&!isTypeIdenticalTo(e,t)){errorNextVariableOrPropertyDeclarationMustHaveSameType(void 0,e,r,t)}}if((i=n.parent)==null?void 0:i.valueDeclaration){const e=getFunctionExpressionParentSymbolOrSymbol(n.parent);if(e.valueDeclaration){const t=getEffectiveTypeAnnotationNode(e.valueDeclaration);if(t){const e=getPropertyOfType(getTypeFromTypeNode(t),n.escapedName);if(e){return getNonMissingTypeOfSymbol(e)}}}}return e}function getInitializerTypeFromAssignmentDeclaration(e,t,n,r){if(isCallExpression(n)){if(t){return getTypeOfSymbol(t)}const e=checkExpressionCached(n.arguments[2]);const r=getTypeOfPropertyOfType(e,"value");if(r){return r}const i=getTypeOfPropertyOfType(e,"get");if(i){const e=getSingleCallSignature(i);if(e){return getReturnTypeOfSignature(e)}}const o=getTypeOfPropertyOfType(e,"set");if(o){const e=getSingleCallSignature(o);if(e){return getTypeOfFirstParameterOfSignature(e)}}return ke}if(containsSameNamedThisProperty(n.left,n.right)){return ke}const i=r===1&&(isPropertyAccessExpression(n.left)||isElementAccessExpression(n.left))&&(isModuleExportsAccessExpression(n.left.expression)||isIdentifier(n.left.expression)&&isExportsIdentifier(n.left.expression));const o=t?getTypeOfSymbol(t):i?getRegularTypeOfLiteralType(checkExpressionCached(n.right)):getWidenedLiteralType(checkExpressionCached(n.right));if(o.flags&524288&&r===2&&e.escapedName==="export="){const n=resolveStructuredTypeMembers(o);const r=createSymbolTable();copyEntries(n.members,r);const i=r.size;if(t&&!t.exports){t.exports=createSymbolTable()}(t||e).exports.forEach(((e,t)=>{var n;const i=r.get(t);if(i&&i!==e&&!(e.flags&2097152)){if(e.flags&111551&&i.flags&111551){if(e.valueDeclaration&&i.valueDeclaration&&getSourceFileOfNode(e.valueDeclaration)!==getSourceFileOfNode(i.valueDeclaration)){const t=unescapeLeadingUnderscores(e.escapedName);const r=((n=tryCast(i.valueDeclaration,isNamedDeclaration))==null?void 0:n.name)||i.valueDeclaration;addRelatedInfo(error2(e.valueDeclaration,wt.Duplicate_identifier_0,t),createDiagnosticForNode(r,wt._0_was_also_declared_here,t));addRelatedInfo(error2(r,wt.Duplicate_identifier_0,t),createDiagnosticForNode(e.valueDeclaration,wt._0_was_also_declared_here,t))}const o=createSymbol(e.flags|i.flags,t);o.links.type=getUnionType([getTypeOfSymbol(e),getTypeOfSymbol(i)]);o.valueDeclaration=i.valueDeclaration;o.declarations=concatenate(i.declarations,e.declarations);r.set(t,o)}else{r.set(t,mergeSymbol(e,i))}}else{r.set(t,e)}}));const a=createAnonymousType(i!==r.size?void 0:n.symbol,r,n.callSignatures,n.constructSignatures,n.indexInfos);if(i===r.size){if(o.aliasSymbol){a.aliasSymbol=o.aliasSymbol;a.aliasTypeArguments=o.aliasTypeArguments}if(getObjectFlags(o)&4){a.aliasSymbol=o.symbol;const e=getTypeArguments(o);a.aliasTypeArguments=length(e)?e:void 0}}a.objectFlags|=getPropagatingFlagsOfTypes([o])|getObjectFlags(o)&(4096|16384|128);if(a.symbol&&a.symbol.flags&32&&o===getDeclaredTypeOfClassOrInterface(a.symbol)){a.objectFlags|=16777216}return a}if(isEmptyArrayLiteralType(o)){reportImplicitAny(n,yn);return yn}return o}function containsSameNamedThisProperty(e,t){return isPropertyAccessExpression(e)&&e.expression.kind===110&&forEachChildRecursively(t,(t=>isMatchingReference(e,t)))}function isDeclarationInConstructor(e){const t=getThisContainer(e,false,false);return t.kind===176||t.kind===262||t.kind===218&&!isPrototypePropertyAssignment(t.parent)}function getConstructorDefinedThisAssignmentTypes(e,t){S.assert(e.length===t.length);return e.filter(((e,n)=>{const r=t[n];const i=isBinaryExpression(r)?r:isBinaryExpression(r.parent)?r.parent:void 0;return i&&isDeclarationInConstructor(i)}))}function getTypeFromBindingElement(e,t,n){if(e.initializer){const t=isBindingPattern(e.name)?getTypeFromBindingPattern(e.name,true,false):Le;return addOptionality(getWidenedLiteralTypeForInitializer(e,checkDeclarationInitializer(e,0,t)))}if(isBindingPattern(e.name)){return getTypeFromBindingPattern(e.name,t,n)}if(n&&!declarationBelongsToPrivateAmbientMember(e)){reportImplicitAny(e,ke)}return t?Oe:ke}function getTypeFromObjectBindingPattern(e,t,n){const r=createSymbolTable();let i;let o=128|131072;forEach(e.elements,(e=>{const a=e.propertyName||e.name;if(e.dotDotDotToken){i=createIndexInfo(ze,ke,false);return}const s=getLiteralTypeFromPropertyName(a);if(!isTypeUsableAsPropertyName(s)){o|=512;return}const c=getPropertyNameFromType(s);const l=4|(e.initializer?16777216:0);const d=createSymbol(l,c);d.links.type=getTypeFromBindingElement(e,t,n);r.set(d.escapedName,d)}));const a=createAnonymousType(void 0,r,d,d,i?[i]:d);a.objectFlags|=o;if(t){a.pattern=e;a.objectFlags|=131072}return a}function getTypeFromArrayBindingPattern(e,t,n){const r=e.elements;const i=lastOrUndefined(r);const o=i&&i.kind===208&&i.dotDotDotToken?i:void 0;if(r.length===0||r.length===1&&o){return v>=2?createIterableType(ke):yn}const a=map(r,(e=>isOmittedExpression(e)?ke:getTypeFromBindingElement(e,t,n)));const s=findLastIndex(r,(e=>!(e===o||isOmittedExpression(e)||hasDefaultValue(e))),r.length-1)+1;const c=map(r,((e,t)=>e===o?4:t>=s?2:1));let l=createTupleType(a,c);if(t){l=cloneTypeReference(l);l.pattern=e;l.objectFlags|=131072}return l}function getTypeFromBindingPattern(e,t=false,n=false){if(t)Lr.push(e);const r=e.kind===206?getTypeFromObjectBindingPattern(e,t,n):getTypeFromArrayBindingPattern(e,t,n);if(t)Lr.pop();return r}function getWidenedTypeForVariableLikeDeclaration(e,t){return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(e,true,0),e,t)}function getTypeFromImportAttributes(e){const t=getNodeLinks(e);if(!t.resolvedType){const n=createSymbol(4096,"__importAttributes");const r=createSymbolTable();forEach(e.elements,(e=>{const t=createSymbol(4,getNameFromImportAttribute(e));t.parent=n;t.links.type=checkImportAttribute(e);t.links.target=t;r.set(t.escapedName,t)}));const i=createAnonymousType(n,r,d,d,d);i.objectFlags|=128|262144;t.resolvedType=i}return t.resolvedType}function isGlobalSymbolConstructor(e){const t=getSymbolOfNode(e);const n=getGlobalESSymbolConstructorTypeSymbol(false);return n&&t&&t===n}function widenTypeForVariableLikeDeclaration(e,t,n){if(e){if(e.flags&4096&&isGlobalSymbolConstructor(t.parent)){e=getESSymbolLikeTypeForNode(t)}if(n){reportErrorsFromWidening(t,e)}if(e.flags&8192&&(isBindingElement(t)||!t.type)&&e.symbol!==getSymbolOfDeclaration(t)){e=Ye}return getWidenedType(e)}e=isParameter(t)&&t.dotDotDotToken?yn:ke;if(n){if(!declarationBelongsToPrivateAmbientMember(t)){reportImplicitAny(t,e)}}return e}function declarationBelongsToPrivateAmbientMember(e){const t=getRootDeclaration(e);const n=t.kind===169?t.parent:t;return isPrivateWithinAmbient(n)}function tryGetTypeFromEffectiveTypeNode(e){const t=getEffectiveTypeAnnotationNode(e);if(t){return getTypeFromTypeNode(t)}}function isParameterOfContextSensitiveSignature(e){let t=e.valueDeclaration;if(!t){return false}if(isBindingElement(t)){t=walkUpBindingElementsAndPatterns(t)}if(isParameter(t)){return isContextSensitiveFunctionOrObjectLiteralMethod(t.parent)}return false}function getTypeOfVariableOrParameterOrProperty(e){const t=getSymbolLinks(e);if(!t.type){const n=getTypeOfVariableOrParameterOrPropertyWorker(e);if(!t.type&&!isParameterOfContextSensitiveSignature(e)){t.type=n}return n}return t.type}function getTypeOfVariableOrParameterOrPropertyWorker(e){if(e.flags&4194304){return getTypeOfPrototypeProperty(e)}if(e===H){return ke}if(e.flags&134217728&&e.valueDeclaration){const t=getSymbolOfDeclaration(getSourceFileOfNode(e.valueDeclaration));const n=createSymbol(t.flags,"exports");n.declarations=t.declarations?t.declarations.slice():[];n.parent=e;n.links.target=t;if(t.valueDeclaration)n.valueDeclaration=t.valueDeclaration;if(t.members)n.members=new Map(t.members);if(t.exports)n.exports=new Map(t.exports);const r=createSymbolTable();r.set("exports",n);return createAnonymousType(e,r,d,d,d)}S.assertIsDefined(e.valueDeclaration);const t=e.valueDeclaration;if(isSourceFile(t)&&isJsonSourceFile(t)){if(!t.statements.length){return ht}return getWidenedType(getWidenedLiteralType(checkExpression(t.statements[0].expression)))}if(isAccessor(t)){return getTypeOfAccessors(e)}if(!pushTypeResolution(e,0)){if(e.flags&512&&!(e.flags&67108864)){return getTypeOfFuncClassEnumModule(e)}return reportCircularityError(e)}let n;if(t.kind===277){n=widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(t)||checkExpressionCached(t.expression),t)}else if(isBinaryExpression(t)||isInJSFile(t)&&(isCallExpression(t)||(isPropertyAccessExpression(t)||isBindableStaticElementAccessExpression(t))&&isBinaryExpression(t.parent))){n=getWidenedTypeForAssignmentDeclaration(e)}else if(isPropertyAccessExpression(t)||isElementAccessExpression(t)||isIdentifier(t)||isStringLiteralLike(t)||isNumericLiteral(t)||isClassDeclaration(t)||isFunctionDeclaration(t)||isMethodDeclaration(t)&&!isObjectLiteralMethod(t)||isMethodSignature(t)||isSourceFile(t)){if(e.flags&(16|8192|32|384|512)){return getTypeOfFuncClassEnumModule(e)}n=isBinaryExpression(t.parent)?getWidenedTypeForAssignmentDeclaration(e):tryGetTypeFromEffectiveTypeNode(t)||ke}else if(isPropertyAssignment(t)){n=tryGetTypeFromEffectiveTypeNode(t)||checkPropertyAssignment(t)}else if(isJsxAttribute(t)){n=tryGetTypeFromEffectiveTypeNode(t)||checkJsxAttribute(t)}else if(isShorthandPropertyAssignment(t)){n=tryGetTypeFromEffectiveTypeNode(t)||checkExpressionForMutableLocation(t.name,0)}else if(isObjectLiteralMethod(t)){n=tryGetTypeFromEffectiveTypeNode(t)||checkObjectLiteralMethod(t,0)}else if(isParameter(t)||isPropertyDeclaration(t)||isPropertySignature(t)||isVariableDeclaration(t)||isBindingElement(t)||isJSDocPropertyLikeTag(t)){n=getWidenedTypeForVariableLikeDeclaration(t,true)}else if(isEnumDeclaration(t)){n=getTypeOfFuncClassEnumModule(e)}else if(isEnumMember(t)){n=getTypeOfEnumMember(e)}else{return S.fail("Unhandled declaration kind! "+S.formatSyntaxKind(t.kind)+" for "+S.formatSymbol(e))}if(!popTypeResolution()){if(e.flags&512&&!(e.flags&67108864)){return getTypeOfFuncClassEnumModule(e)}return reportCircularityError(e)}return n}function getAnnotatedAccessorTypeNode(e){if(e){switch(e.kind){case 177:const t=getEffectiveReturnTypeNode(e);return t;case 178:const n=getEffectiveSetAccessorTypeAnnotationNode(e);return n;case 172:S.assert(hasAccessorModifier(e));const r=getEffectiveTypeAnnotationNode(e);return r}}return void 0}function getAnnotatedAccessorType(e){const t=getAnnotatedAccessorTypeNode(e);return t&&getTypeFromTypeNode(t)}function getAnnotatedAccessorThisParameter(e){const t=getAccessorThisParameter(e);return t&&t.symbol}function getThisTypeOfDeclaration(e){return getThisTypeOfSignature(getSignatureFromDeclaration(e))}function getTypeOfAccessors(e){const t=getSymbolLinks(e);if(!t.type){if(!pushTypeResolution(e,0)){return Ie}const n=getDeclarationOfKind(e,177);const r=getDeclarationOfKind(e,178);const i=tryCast(getDeclarationOfKind(e,172),isAutoAccessorPropertyDeclaration);let o=n&&isInJSFile(n)&&getTypeForDeclarationFromJSDocComment(n)||getAnnotatedAccessorType(n)||getAnnotatedAccessorType(r)||getAnnotatedAccessorType(i)||n&&n.body&&getReturnTypeFromBody(n)||i&&getWidenedTypeForVariableLikeDeclaration(i,true);if(!o){if(r&&!isPrivateWithinAmbient(r)){errorOrSuggestion(A,r,wt.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation,symbolToString(e))}else if(n&&!isPrivateWithinAmbient(n)){errorOrSuggestion(A,n,wt.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation,symbolToString(e))}else if(i&&!isPrivateWithinAmbient(i)){errorOrSuggestion(A,i,wt.Member_0_implicitly_has_an_1_type,symbolToString(e),"any")}o=ke}if(!popTypeResolution()){if(getAnnotatedAccessorTypeNode(n)){error2(n,wt._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,symbolToString(e))}else if(getAnnotatedAccessorTypeNode(r)){error2(r,wt._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,symbolToString(e))}else if(getAnnotatedAccessorTypeNode(i)){error2(r,wt._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,symbolToString(e))}else if(n&&A){error2(n,wt._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,symbolToString(e))}o=ke}t.type??(t.type=o)}return t.type}function getWriteTypeOfAccessors(e){const t=getSymbolLinks(e);if(!t.writeType){if(!pushTypeResolution(e,7)){return Ie}const n=getDeclarationOfKind(e,178)??tryCast(getDeclarationOfKind(e,172),isAutoAccessorPropertyDeclaration);let r=getAnnotatedAccessorType(n);if(!popTypeResolution()){if(getAnnotatedAccessorTypeNode(n)){error2(n,wt._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,symbolToString(e))}r=ke}t.writeType??(t.writeType=r||getTypeOfAccessors(e))}return t.writeType}function getBaseTypeVariableOfClass(e){const t=getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(e));return t.flags&8650752?t:t.flags&2097152?find(t.types,(e=>!!(e.flags&8650752))):void 0}function getTypeOfFuncClassEnumModule(e){let t=getSymbolLinks(e);const n=t;if(!t.type){const r=e.valueDeclaration&&getSymbolOfExpando(e.valueDeclaration,false);if(r){const n=mergeJSSymbols(e,r);if(n){e=n;t=n.links}}n.type=t.type=getTypeOfFuncClassEnumModuleWorker(e)}return t.type}function getTypeOfFuncClassEnumModuleWorker(e){const t=e.valueDeclaration;if(e.flags&1536&&isShorthandAmbientModuleSymbol(e)){return ke}else if(t&&(t.kind===226||isAccessExpression(t)&&t.parent.kind===226)){return getWidenedTypeForAssignmentDeclaration(e)}else if(e.flags&512&&t&&isSourceFile(t)&&t.commonJsModuleIndicator){const t=resolveExternalModuleSymbol(e);if(t!==e){if(!pushTypeResolution(e,0)){return Ie}const n=getMergedSymbol(e.exports.get("export="));const r=getWidenedTypeForAssignmentDeclaration(n,n===t?void 0:t);if(!popTypeResolution()){return reportCircularityError(e)}return r}}const n=createObjectType(16,e);if(e.flags&32){const t=getBaseTypeVariableOfClass(e);return t?getIntersectionType([n,t]):n}else{return k&&e.flags&16777216?getOptionalType(n,true):n}}function getTypeOfEnumMember(e){const t=getSymbolLinks(e);return t.type||(t.type=getDeclaredTypeOfEnumMember(e))}function getTypeOfAlias(e){const t=getSymbolLinks(e);if(!t.type){if(!pushTypeResolution(e,0)){return Ie}const n=resolveAlias(e);const r=e.declarations&&getTargetOfAliasDeclaration(getDeclarationOfAliasSymbol(e),true);const i=firstDefined(r==null?void 0:r.declarations,(e=>isExportAssignment(e)?tryGetTypeFromEffectiveTypeNode(e):void 0));t.type??(t.type=(r==null?void 0:r.declarations)&&isDuplicatedCommonJSExport(r.declarations)&&e.declarations.length?getFlowTypeFromCommonJSExport(r):isDuplicatedCommonJSExport(e.declarations)?Fe:i?i:getSymbolFlags(n)&111551?getTypeOfSymbol(n):Ie);if(!popTypeResolution()){reportCircularityError(r??e);return t.type??(t.type=Ie)}}return t.type}function getTypeOfInstantiatedSymbol(e){const t=getSymbolLinks(e);return t.type||(t.type=instantiateType(getTypeOfSymbol(t.target),t.mapper))}function getWriteTypeOfInstantiatedSymbol(e){const t=getSymbolLinks(e);return t.writeType||(t.writeType=instantiateType(getWriteTypeOfSymbol(t.target),t.mapper))}function reportCircularityError(e){const t=e.valueDeclaration;if(t){if(getEffectiveTypeAnnotationNode(t)){error2(e.valueDeclaration,wt._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,symbolToString(e));return Ie}if(A&&(t.kind!==169||t.initializer)){error2(e.valueDeclaration,wt._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,symbolToString(e))}}else if(e.flags&2097152){const t=getDeclarationOfAliasSymbol(e);if(t){error2(t,wt.Circular_definition_of_import_alias_0,symbolToString(e))}}return ke}function getTypeOfSymbolWithDeferredType(e){const t=getSymbolLinks(e);if(!t.type){S.assertIsDefined(t.deferralParent);S.assertIsDefined(t.deferralConstituents);t.type=t.deferralParent.flags&1048576?getUnionType(t.deferralConstituents):getIntersectionType(t.deferralConstituents)}return t.type}function getWriteTypeOfSymbolWithDeferredType(e){const t=getSymbolLinks(e);if(!t.writeType&&t.deferralWriteConstituents){S.assertIsDefined(t.deferralParent);S.assertIsDefined(t.deferralConstituents);t.writeType=t.deferralParent.flags&1048576?getUnionType(t.deferralWriteConstituents):getIntersectionType(t.deferralWriteConstituents)}return t.writeType}function getWriteTypeOfSymbol(e){const t=getCheckFlags(e);if(e.flags&4){return t&2?t&65536?getWriteTypeOfSymbolWithDeferredType(e)||getTypeOfSymbolWithDeferredType(e):e.links.writeType||e.links.type:removeMissingType(getTypeOfSymbol(e),!!(e.flags&16777216))}if(e.flags&98304){return t&1?getWriteTypeOfInstantiatedSymbol(e):getWriteTypeOfAccessors(e)}return getTypeOfSymbol(e)}function getTypeOfSymbol(e){const t=getCheckFlags(e);if(t&65536){return getTypeOfSymbolWithDeferredType(e)}if(t&1){return getTypeOfInstantiatedSymbol(e)}if(t&262144){return getTypeOfMappedSymbol(e)}if(t&8192){return getTypeOfReverseMappedSymbol(e)}if(e.flags&(3|4)){return getTypeOfVariableOrParameterOrProperty(e)}if(e.flags&(16|8192|32|384|512)){return getTypeOfFuncClassEnumModule(e)}if(e.flags&8){return getTypeOfEnumMember(e)}if(e.flags&98304){return getTypeOfAccessors(e)}if(e.flags&2097152){return getTypeOfAlias(e)}return Ie}function getNonMissingTypeOfSymbol(e){return removeMissingType(getTypeOfSymbol(e),!!(e.flags&16777216))}function isReferenceToSomeType(e,t){if(e===void 0||(getObjectFlags(e)&4)===0){return false}for(const n of t){if(e.target===n){return true}}return false}function isReferenceToType2(e,t){return e!==void 0&&t!==void 0&&(getObjectFlags(e)&4)!==0&&e.target===t}function getTargetType(e){return getObjectFlags(e)&4?e.target:e}function hasBaseType(e,t){return check(e);function check(e){if(getObjectFlags(e)&(3|4)){const n=getTargetType(e);return n===t||some(getBaseTypes(n),check)}else if(e.flags&2097152){return some(e.types,check)}return false}}function appendTypeParameters(e,t){for(const n of t){e=appendIfUnique(e,getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(n)))}return e}function getOuterTypeParameters(e,t){while(true){e=e.parent;if(e&&isBinaryExpression(e)){const t=getAssignmentDeclarationKind(e);if(t===6||t===3){const t=getSymbolOfDeclaration(e.left);if(t&&t.parent&&!findAncestor(t.parent.valueDeclaration,(t=>e===t))){e=t.parent.valueDeclaration}}}if(!e){return void 0}const n=e.kind;switch(n){case 263:case 231:case 264:case 179:case 180:case 173:case 184:case 185:case 317:case 262:case 174:case 218:case 219:case 265:case 345:case 346:case 340:case 338:case 200:case 194:{const r=getOuterTypeParameters(e,t);if((n===218||n===219||isObjectLiteralMethod(e))&&isContextSensitive(e)){const t=firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfDeclaration(e)),0));if(t&&t.typeParameters){return[...r||d,...t.typeParameters]}}if(n===200){return append(r,getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(e.typeParameter)))}else if(n===194){return concatenate(r,getInferTypeParameters(e))}const i=appendTypeParameters(r,getEffectiveTypeParameterDeclarations(e));const o=t&&(n===263||n===231||n===264||isJSConstructor(e))&&getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(e)).thisType;return o?append(i,o):i}case 341:const r=getParameterSymbolFromJSDoc(e);if(r){e=r.valueDeclaration}break;case 320:{const n=getOuterTypeParameters(e,t);return e.tags?appendTypeParameters(n,flatMap(e.tags,(e=>isJSDocTemplateTag(e)?e.typeParameters:void 0))):n}}}}function getOuterTypeParametersOfClassOrInterface(e){var t;const n=e.flags&32||e.flags&16?e.valueDeclaration:(t=e.declarations)==null?void 0:t.find((e=>{if(e.kind===264){return true}if(e.kind!==260){return false}const t=e.initializer;return!!t&&(t.kind===218||t.kind===219)}));S.assert(!!n,"Class was missing valueDeclaration -OR- non-class had no interface declarations");return getOuterTypeParameters(n)}function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e){if(!e.declarations){return}let t;for(const n of e.declarations){if(n.kind===264||n.kind===263||n.kind===231||isJSConstructor(n)||isTypeAlias(n)){const e=n;t=appendTypeParameters(t,getEffectiveTypeParameterDeclarations(e))}}return t}function getTypeParametersOfClassOrInterface(e){return concatenate(getOuterTypeParametersOfClassOrInterface(e),getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e))}function isMixinConstructorType(e){const t=getSignaturesOfType(e,1);if(t.length===1){const e=t[0];if(!e.typeParameters&&e.parameters.length===1&&signatureHasRestParameter(e)){const t=getTypeOfParameter(e.parameters[0]);return isTypeAny(t)||getElementTypeOfArrayType(t)===ke}}return false}function isConstructorType(e){if(getSignaturesOfType(e,1).length>0){return true}if(e.flags&8650752){const t=getBaseConstraintOfType(e);return!!t&&isMixinConstructorType(t)}return false}function getBaseTypeNodeOfClass(e){const t=getClassLikeDeclarationOfSymbol(e.symbol);return t&&getEffectiveBaseTypeNode(t)}function getConstructorsForTypeArguments(e,t,n){const r=length(t);const i=isInJSFile(n);return filter(getSignaturesOfType(e,1),(e=>(i||r>=getMinTypeArgumentCount(e.typeParameters))&&r<=length(e.typeParameters)))}function getInstantiatedConstructorsForTypeArguments(e,t,n){const r=getConstructorsForTypeArguments(e,t,n);const i=map(t,getTypeFromTypeNode);return sameMap(r,(e=>some(e.typeParameters)?getSignatureInstantiation(e,i,isInJSFile(n)):e))}function getBaseConstructorTypeOfClass(e){if(!e.resolvedBaseConstructorType){const t=getClassLikeDeclarationOfSymbol(e.symbol);const n=t&&getEffectiveBaseTypeNode(t);const r=getBaseTypeNodeOfClass(e);if(!r){return e.resolvedBaseConstructorType=Me}if(!pushTypeResolution(e,1)){return Ie}const i=checkExpression(r.expression);if(n&&r!==n){S.assert(!n.typeArguments);checkExpression(n.expression)}if(i.flags&(524288|2097152)){resolveStructuredTypeMembers(i)}if(!popTypeResolution()){error2(e.symbol.valueDeclaration,wt._0_is_referenced_directly_or_indirectly_in_its_own_base_expression,symbolToString(e.symbol));return e.resolvedBaseConstructorType??(e.resolvedBaseConstructorType=Ie)}if(!(i.flags&1)&&i!==Ue&&!isConstructorType(i)){const t=error2(r.expression,wt.Type_0_is_not_a_constructor_function_type,typeToString(i));if(i.flags&262144){const e=getConstraintFromTypeParameter(i);let n=Le;if(e){const t=getSignaturesOfType(e,1);if(t[0]){n=getReturnTypeOfSignature(t[0])}}if(i.symbol.declarations){addRelatedInfo(t,createDiagnosticForNode(i.symbol.declarations[0],wt.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1,symbolToString(i.symbol),typeToString(n)))}}return e.resolvedBaseConstructorType??(e.resolvedBaseConstructorType=Ie)}e.resolvedBaseConstructorType??(e.resolvedBaseConstructorType=i)}return e.resolvedBaseConstructorType}function getImplementsTypes(e){let t=d;if(e.symbol.declarations){for(const n of e.symbol.declarations){const e=getEffectiveImplementsTypeNodes(n);if(!e)continue;for(const n of e){const e=getTypeFromTypeNode(n);if(!isErrorType(e)){if(t===d){t=[e]}else{t.push(e)}}}}}return t}function reportCircularBaseType(e,t){error2(e,wt.Type_0_recursively_references_itself_as_a_base_type,typeToString(t,void 0,2))}function getBaseTypes(e){if(!e.baseTypesResolved){if(pushTypeResolution(e,6)){if(e.objectFlags&8){e.resolvedBaseTypes=[getTupleBaseType(e)]}else if(e.symbol.flags&(32|64)){if(e.symbol.flags&32){resolveBaseTypesOfClass(e)}if(e.symbol.flags&64){resolveBaseTypesOfInterface(e)}}else{S.fail("type must be class or interface")}if(!popTypeResolution()&&e.symbol.declarations){for(const t of e.symbol.declarations){if(t.kind===263||t.kind===264){reportCircularBaseType(t,e)}}}}e.baseTypesResolved=true}return e.resolvedBaseTypes}function getTupleBaseType(e){const t=sameMap(e.typeParameters,((t,n)=>e.elementFlags[n]&8?getIndexedAccessType(t,Ve):t));return createArrayType(getUnionType(t||d),e.readonly)}function resolveBaseTypesOfClass(e){e.resolvedBaseTypes=sn;const t=getApparentType(getBaseConstructorTypeOfClass(e));if(!(t.flags&(524288|2097152|1))){return e.resolvedBaseTypes=d}const n=getBaseTypeNodeOfClass(e);let r;const i=t.symbol?getDeclaredTypeOfSymbol(t.symbol):void 0;if(t.symbol&&t.symbol.flags&32&&areAllOuterTypeParametersApplied(i)){r=getTypeFromClassOrInterfaceReference(n,t.symbol)}else if(t.flags&1){r=t}else{const i=getInstantiatedConstructorsForTypeArguments(t,n.typeArguments,n);if(!i.length){error2(n.expression,wt.No_base_constructor_has_the_specified_number_of_type_arguments);return e.resolvedBaseTypes=d}r=getReturnTypeOfSignature(i[0])}if(isErrorType(r)){return e.resolvedBaseTypes=d}const o=getReducedType(r);if(!isValidBaseType(o)){const t=elaborateNeverIntersection(void 0,r);const i=chainDiagnosticMessages(t,wt.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members,typeToString(o));gi.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(n.expression),n.expression,i));return e.resolvedBaseTypes=d}if(e===o||hasBaseType(o,e)){error2(e.symbol.valueDeclaration,wt.Type_0_recursively_references_itself_as_a_base_type,typeToString(e,void 0,2));return e.resolvedBaseTypes=d}if(e.resolvedBaseTypes===sn){e.members=void 0}return e.resolvedBaseTypes=[o]}function areAllOuterTypeParametersApplied(e){const t=e.outerTypeParameters;if(t){const n=t.length-1;const r=getTypeArguments(e);return t[n].symbol!==r[n].symbol}return true}function isValidBaseType(e){if(e.flags&262144){const t=getBaseConstraintOfType(e);if(t){return isValidBaseType(t)}}return!!(e.flags&(524288|67108864|1)&&!isGenericMappedType(e)||e.flags&2097152&&every(e.types,isValidBaseType))}function resolveBaseTypesOfInterface(e){e.resolvedBaseTypes=e.resolvedBaseTypes||d;if(e.symbol.declarations){for(const t of e.symbol.declarations){if(t.kind===264&&getInterfaceBaseTypeNodes(t)){for(const n of getInterfaceBaseTypeNodes(t)){const r=getReducedType(getTypeFromTypeNode(n));if(!isErrorType(r)){if(isValidBaseType(r)){if(e!==r&&!hasBaseType(r,e)){if(e.resolvedBaseTypes===d){e.resolvedBaseTypes=[r]}else{e.resolvedBaseTypes.push(r)}}else{reportCircularBaseType(t,e)}}else{error2(n,wt.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members)}}}}}}}function isThislessInterface(e){if(!e.declarations){return true}for(const t of e.declarations){if(t.kind===264){if(t.flags&256){return false}const e=getInterfaceBaseTypeNodes(t);if(e){for(const t of e){if(isEntityNameExpression(t.expression)){const e=resolveEntityName(t.expression,788968,true);if(!e||!(e.flags&64)||getDeclaredTypeOfClassOrInterface(e).thisType){return false}}}}}}return true}function getDeclaredTypeOfClassOrInterface(e){let t=getSymbolLinks(e);const n=t;if(!t.declaredType){const r=e.flags&32?1:2;const i=mergeJSSymbols(e,e.valueDeclaration&&getAssignedClassSymbol(e.valueDeclaration));if(i){e=i;t=i.links}const o=n.declaredType=t.declaredType=createObjectType(r,e);const a=getOuterTypeParametersOfClassOrInterface(e);const s=getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);if(a||s||r===1||!isThislessInterface(e)){o.objectFlags|=4;o.typeParameters=concatenate(a,s);o.outerTypeParameters=a;o.localTypeParameters=s;o.instantiations=new Map;o.instantiations.set(getTypeListId(o.typeParameters),o);o.target=o;o.resolvedTypeArguments=o.typeParameters;o.thisType=createTypeParameter(e);o.thisType.isThisType=true;o.thisType.constraint=o}}return t.declaredType}function getDeclaredTypeOfTypeAlias(e){var t;const n=getSymbolLinks(e);if(!n.declaredType){if(!pushTypeResolution(e,2)){return Ie}const r=S.checkDefined((t=e.declarations)==null?void 0:t.find(isTypeAlias),"Type alias symbol with no valid declaration found");const i=isJSDocTypeAlias(r)?r.typeExpression:r.type;let o=i?getTypeFromTypeNode(i):Ie;if(popTypeResolution()){const t=getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);if(t){n.typeParameters=t;n.instantiations=new Map;n.instantiations.set(getTypeListId(t),o)}if(o===we&&e.escapedName==="BuiltinIteratorReturn"){o=getBuiltinIteratorReturnType()}}else{o=Ie;if(r.kind===340){error2(r.typeExpression.type,wt.Type_alias_0_circularly_references_itself,symbolToString(e))}else{error2(isNamedDeclaration(r)?r.name||r:r,wt.Type_alias_0_circularly_references_itself,symbolToString(e))}}n.declaredType??(n.declaredType=o)}return n.declaredType}function getBaseTypeOfEnumLikeType(e){return e.flags&1056&&e.symbol.flags&8?getDeclaredTypeOfSymbol(getParentOfSymbol(e.symbol)):e}function getDeclaredTypeOfEnum(e){const t=getSymbolLinks(e);if(!t.declaredType){const n=[];if(e.declarations){for(const t of e.declarations){if(t.kind===266){for(const r of t.members){if(hasBindableName(r)){const t=getSymbolOfDeclaration(r);const i=getEnumMemberValue(r).value;const o=getFreshTypeOfLiteralType(i!==void 0?getEnumLiteralType(i,getSymbolId(e),t):createComputedEnumType(t));getSymbolLinks(t).declaredType=o;n.push(getRegularTypeOfLiteralType(o))}}}}}const r=n.length?getUnionType(n,1,e,void 0):createComputedEnumType(e);if(r.flags&1048576){r.flags|=1024;r.symbol=e}t.declaredType=r}return t.declaredType}function createComputedEnumType(e){const t=createTypeWithSymbol(32,e);const n=createTypeWithSymbol(32,e);t.regularType=t;t.freshType=n;n.regularType=t;n.freshType=n;return t}function getDeclaredTypeOfEnumMember(e){const t=getSymbolLinks(e);if(!t.declaredType){const n=getDeclaredTypeOfEnum(getParentOfSymbol(e));if(!t.declaredType){t.declaredType=n}}return t.declaredType}function getDeclaredTypeOfTypeParameter(e){const t=getSymbolLinks(e);return t.declaredType||(t.declaredType=createTypeParameter(e))}function getDeclaredTypeOfAlias(e){const t=getSymbolLinks(e);return t.declaredType||(t.declaredType=getDeclaredTypeOfSymbol(resolveAlias(e)))}function getDeclaredTypeOfSymbol(e){return tryGetDeclaredTypeOfSymbol(e)||Ie}function tryGetDeclaredTypeOfSymbol(e){if(e.flags&(32|64)){return getDeclaredTypeOfClassOrInterface(e)}if(e.flags&524288){return getDeclaredTypeOfTypeAlias(e)}if(e.flags&262144){return getDeclaredTypeOfTypeParameter(e)}if(e.flags&384){return getDeclaredTypeOfEnum(e)}if(e.flags&8){return getDeclaredTypeOfEnumMember(e)}if(e.flags&2097152){return getDeclaredTypeOfAlias(e)}return void 0}function isThislessType(e){switch(e.kind){case 133:case 159:case 154:case 150:case 163:case 136:case 155:case 151:case 116:case 157:case 146:case 201:return true;case 188:return isThislessType(e.elementType);case 183:return!e.typeArguments||e.typeArguments.every(isThislessType)}return false}function isThislessTypeParameter(e){const t=getEffectiveConstraintOfTypeParameter(e);return!t||isThislessType(t)}function isThislessVariableLikeDeclaration(e){const t=getEffectiveTypeAnnotationNode(e);return t?isThislessType(t):!hasInitializer(e)}function isThislessFunctionLikeDeclaration(e){const t=getEffectiveReturnTypeNode(e);const n=getEffectiveTypeParameterDeclarations(e);return(e.kind===176||!!t&&isThislessType(t))&&e.parameters.every(isThislessVariableLikeDeclaration)&&n.every(isThislessTypeParameter)}function isThisless(e){if(e.declarations&&e.declarations.length===1){const t=e.declarations[0];if(t){switch(t.kind){case 172:case 171:return isThislessVariableLikeDeclaration(t);case 174:case 173:case 176:case 177:case 178:return isThislessFunctionLikeDeclaration(t)}}}return false}function createInstantiatedSymbolTable(e,t,n){const r=createSymbolTable();for(const i of e){r.set(i.escapedName,n&&isThisless(i)?i:instantiateSymbol(i,t))}return r}function addInheritedMembers(e,t){for(const n of t){if(isStaticPrivateIdentifierProperty(n)){continue}const t=e.get(n.escapedName);if(!t||t.valueDeclaration&&isBinaryExpression(t.valueDeclaration)&&!isConstructorDeclaredProperty(t)&&!getContainingClassStaticBlock(t.valueDeclaration)){e.set(n.escapedName,n);e.set(n.escapedName,n)}}}function isStaticPrivateIdentifierProperty(e){return!!e.valueDeclaration&&isPrivateIdentifierClassElementDeclaration(e.valueDeclaration)&&isStatic(e.valueDeclaration)}function resolveDeclaredMembers(e){if(!e.declaredProperties){const t=e.symbol;const n=getMembersOfSymbol(t);e.declaredProperties=getNamedMembers(n);e.declaredCallSignatures=d;e.declaredConstructSignatures=d;e.declaredIndexInfos=d;e.declaredCallSignatures=getSignaturesOfSymbol(n.get("__call"));e.declaredConstructSignatures=getSignaturesOfSymbol(n.get("__new"));e.declaredIndexInfos=getIndexInfosOfSymbol(t)}return e}function isLateBindableName(e){return isLateBindableAST(e)&&isTypeUsableAsPropertyName(isComputedPropertyName(e)?checkComputedPropertyName(e):checkExpressionCached(e.argumentExpression))}function isLateBindableIndexSignature(e){return isLateBindableAST(e)&&isTypeUsableAsIndexSignature(isComputedPropertyName(e)?checkComputedPropertyName(e):checkExpressionCached(e.argumentExpression))}function isLateBindableAST(e){if(!isComputedPropertyName(e)&&!isElementAccessExpression(e)){return false}const t=isComputedPropertyName(e)?e.expression:e.argumentExpression;return isEntityNameExpression(t)}function isTypeUsableAsIndexSignature(e){return isTypeAssignableTo(e,at)}function isLateBoundName(e){return e.charCodeAt(0)===95&&e.charCodeAt(1)===95&&e.charCodeAt(2)===64}function hasLateBindableName(e){const t=getNameOfDeclaration(e);return!!t&&isLateBindableName(t)}function hasLateBindableIndexSignature(e){const t=getNameOfDeclaration(e);return!!t&&isLateBindableIndexSignature(t)}function hasBindableName(e){return!hasDynamicName(e)||hasLateBindableName(e)}function isNonBindableDynamicName(e){return isDynamicName(e)&&!isLateBindableName(e)}function addDeclarationToLateBoundSymbol(e,t,n){S.assert(!!(getCheckFlags(e)&4096),"Expected a late-bound symbol.");e.flags|=n;getSymbolLinks(t.symbol).lateSymbol=e;if(!e.declarations){e.declarations=[t]}else if(!t.symbol.isReplaceableByMethod){e.declarations.push(t)}if(n&111551){if(!e.valueDeclaration||e.valueDeclaration.kind!==t.kind){e.valueDeclaration=t}}}function lateBindMember(e,t,n,r){S.assert(!!r.symbol,"The member is expected to have a symbol.");const i=getNodeLinks(r);if(!i.resolvedSymbol){i.resolvedSymbol=r.symbol;const o=isBinaryExpression(r)?r.left:r.name;const a=isElementAccessExpression(o)?checkExpressionCached(o.argumentExpression):checkComputedPropertyName(o);if(isTypeUsableAsPropertyName(a)){const s=getPropertyNameFromType(a);const c=r.symbol.flags;let l=n.get(s);if(!l)n.set(s,l=createSymbol(0,s,4096));const d=t&&t.get(s);if(!(e.flags&32)&&l.flags&getExcludedSymbolFlags(c)){const e=d?concatenate(d.declarations,l.declarations):l.declarations;const t=!(a.flags&8192)&&unescapeLeadingUnderscores(s)||declarationNameToString(o);forEach(e,(e=>error2(getNameOfDeclaration(e)||e,wt.Property_0_was_also_declared_here,t)));error2(o||r,wt.Duplicate_property_0,t);l=createSymbol(0,s,4096)}l.links.nameType=a;addDeclarationToLateBoundSymbol(l,r,c);if(l.parent){S.assert(l.parent===e,"Existing symbol parent should match new one")}else{l.parent=e}return i.resolvedSymbol=l}}return i.resolvedSymbol}function lateBindIndexSignature(e,t,n,r){let i=n.get("__index");if(!i){const e=t==null?void 0:t.get("__index");if(!e){i=createSymbol(0,"__index",4096)}else{i=cloneSymbol(e);i.links.checkFlags|=4096}n.set("__index",i)}if(!i.declarations){i.declarations=[r]}else if(!r.symbol.isReplaceableByMethod){i.declarations.push(r)}}function getResolvedMembersOrExportsOfSymbol(e,t){const n=getSymbolLinks(e);if(!n[t]){const r=t==="resolvedExports";const i=!r?e.members:e.flags&1536?getExportsOfModuleWorker(e).exports:e.exports;n[t]=i||y;const o=createSymbolTable();for(const t of e.declarations||d){const n=getMembersOfDeclaration(t);if(n){for(const t of n){if(r===hasStaticModifier(t)){if(hasLateBindableName(t)){lateBindMember(e,i,o,t)}else if(hasLateBindableIndexSignature(t)){lateBindIndexSignature(e,i,o,t)}}}}}const a=getFunctionExpressionParentSymbolOrSymbol(e).assignmentDeclarationMembers;if(a){const t=arrayFrom(a.values());for(const n of t){const t=getAssignmentDeclarationKind(n);const a=t===3||isBinaryExpression(n)&&isPossiblyAliasedThisProperty(n,t)||t===9||t===6;if(r===!a){if(hasLateBindableName(n)){lateBindMember(e,i,o,n)}}}}let s=combineSymbolTables(i,o);if(e.flags&33554432&&n.cjsExportMerged&&e.declarations){for(const n of e.declarations){const e=getSymbolLinks(n.symbol)[t];if(!s){s=e;continue}if(!e)continue;e.forEach(((e,t)=>{const n=s.get(t);if(!n)s.set(t,e);else if(n===e)return;else s.set(t,mergeSymbol(n,e))}))}}n[t]=s||y}return n[t]}function getMembersOfSymbol(e){return e.flags&6256?getResolvedMembersOrExportsOfSymbol(e,"resolvedMembers"):e.members||y}function getLateBoundSymbol(e){if(e.flags&106500&&e.escapedName==="__computed"){const t=getSymbolLinks(e);if(!t.lateSymbol&&some(e.declarations,hasLateBindableName)){const t=getMergedSymbol(e.parent);if(some(e.declarations,hasStaticModifier)){getExportsOfSymbol(t)}else{getMembersOfSymbol(t)}}return t.lateSymbol||(t.lateSymbol=e)}return e}function getTypeWithThisArgument(e,t,n){if(getObjectFlags(e)&4){const n=e.target;const r=getTypeArguments(e);return length(n.typeParameters)===length(r)?createTypeReference(n,concatenate(r,[t||n.thisType])):e}else if(e.flags&2097152){const r=sameMap(e.types,(e=>getTypeWithThisArgument(e,t,n)));return r!==e.types?getIntersectionType(r):e}return n?getApparentType(e):e}function resolveObjectTypeMembers(e,t,n,r){let i;let o;let a;let s;let c;if(rangeEquals(n,r,0,n.length)){o=t.symbol?getMembersOfSymbol(t.symbol):createSymbolTable(t.declaredProperties);a=t.declaredCallSignatures;s=t.declaredConstructSignatures;c=t.declaredIndexInfos}else{i=createTypeMapper(n,r);o=createInstantiatedSymbolTable(t.declaredProperties,i,n.length===1);a=instantiateSignatures(t.declaredCallSignatures,i);s=instantiateSignatures(t.declaredConstructSignatures,i);c=instantiateIndexInfos(t.declaredIndexInfos,i)}const l=getBaseTypes(t);if(l.length){if(t.symbol&&o===getMembersOfSymbol(t.symbol)){const e=createSymbolTable(t.declaredProperties);const n=getIndexSymbol(t.symbol);if(n){e.set("__index",n)}o=e}setStructuredTypeMembers(e,o,a,s,c);const n=lastOrUndefined(r);for(const e of l){const t=n?getTypeWithThisArgument(instantiateType(e,i),n):e;addInheritedMembers(o,getPropertiesOfType(t));a=concatenate(a,getSignaturesOfType(t,0));s=concatenate(s,getSignaturesOfType(t,1));const r=t!==ke?getIndexInfosOfType(t):[Ut];c=concatenate(c,filter(r,(e=>!findIndexInfo(c,e.keyType))))}}setStructuredTypeMembers(e,o,a,s,c)}function resolveClassOrInterfaceMembers(e){resolveObjectTypeMembers(e,resolveDeclaredMembers(e),d,d)}function resolveTypeReferenceMembers(e){const t=resolveDeclaredMembers(e.target);const n=concatenate(t.typeParameters,[t.thisType]);const r=getTypeArguments(e);const i=r.length===n.length?r:concatenate(r,[e]);resolveObjectTypeMembers(e,t,n,i)}function createSignature(e,t,n,r,i,o,s,c){const l=new a(re,c);l.declaration=e;l.typeParameters=t;l.parameters=r;l.thisParameter=n;l.resolvedReturnType=i;l.resolvedTypePredicate=o;l.minArgumentCount=s;l.resolvedMinArgumentCount=void 0;l.target=void 0;l.mapper=void 0;l.compositeSignatures=void 0;l.compositeKind=void 0;return l}function cloneSignature(e){const t=createSignature(e.declaration,e.typeParameters,e.thisParameter,e.parameters,void 0,void 0,e.minArgumentCount,e.flags&167);t.target=e.target;t.mapper=e.mapper;t.compositeSignatures=e.compositeSignatures;t.compositeKind=e.compositeKind;return t}function createUnionSignature(e,t){const n=cloneSignature(e);n.compositeSignatures=t;n.compositeKind=1048576;n.target=void 0;n.mapper=void 0;return n}function getOptionalCallSignature(e,t){if((e.flags&24)===t){return e}if(!e.optionalCallSignatureCache){e.optionalCallSignatureCache={}}const n=t===8?"inner":"outer";return e.optionalCallSignatureCache[n]||(e.optionalCallSignatureCache[n]=createOptionalCallSignature(e,t))}function createOptionalCallSignature(e,t){S.assert(t===8||t===16,"An optional call signature can either be for an inner call chain or an outer call chain, but not both.");const n=cloneSignature(e);n.flags|=t;return n}function getExpandedParameters(e,t){if(signatureHasRestParameter(e)){const n=e.parameters.length-1;const r=e.parameters[n];const i=getTypeOfSymbol(r);if(isTupleType(i)){return[expandSignatureParametersWithTupleMembers(i,n,r)]}else if(!t&&i.flags&1048576&&every(i.types,isTupleType)){return map(i.types,(e=>expandSignatureParametersWithTupleMembers(e,n,r)))}}return[e.parameters];function expandSignatureParametersWithTupleMembers(t,n,r){const i=getTypeArguments(t);const o=getUniqAssociatedNamesFromTupleType(t,r);const a=map(i,((r,i)=>{const a=o&&o[i]?o[i]:getParameterNameAtPosition(e,n+i,t);const s=t.target.elementFlags[i];const c=s&12?32768:s&2?16384:0;const l=createSymbol(1,a,c);l.links.type=s&4?createArrayType(r):r;return l}));return concatenate(e.parameters.slice(0,n),a)}function getUniqAssociatedNamesFromTupleType(e,t){const n=map(e.target.labeledElementDeclarations,((n,r)=>getTupleElementLabel(n,r,e.target.elementFlags[r],t)));if(n){const e=[];const t=new Set;for(let r=0;r=n&&c<=r){const o=r?createSignatureInstantiation(t,fillMissingTypeArguments(s,t.typeParameters,n,a)):cloneSignature(t);o.typeParameters=e.localTypeParameters;o.resolvedReturnType=e;o.flags=i?o.flags|4:o.flags&~4;l.push(o)}}return l}function findMatchingSignature(e,t,n,r,i){for(const o of e){if(compareSignaturesIdentical(o,t,n,r,i,n?compareTypesSubtypeOf:compareTypesIdentical)){return o}}}function findMatchingSignatures(e,t,n){if(t.typeParameters){if(n>0){return void 0}for(let n=1;n1){n=n===void 0?r:-1}for(const n of e[r]){if(!t||!findMatchingSignature(t,n,false,false,true)){const i=findMatchingSignatures(e,n,r);if(i){let e=n;if(i.length>1){let t=n.thisParameter;const r=forEach(i,(e=>e.thisParameter));if(r){const e=getIntersectionType(mapDefined(i,(e=>e.thisParameter&&getTypeOfSymbol(e.thisParameter))));t=createSymbolWithType(r,e)}e=createUnionSignature(n,i);e.thisParameter=t}(t||(t=[])).push(e)}}}}if(!length(t)&&n!==-1){const r=e[n!==void 0?n:0];let i=r.slice();for(const t of e){if(t!==r){const e=t[0];S.assert(!!e,"getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass");i=!!e.typeParameters&&some(i,(t=>!!t.typeParameters&&!compareTypeParametersIdentical(e.typeParameters,t.typeParameters)))?void 0:map(i,(t=>combineSignaturesOfUnionMembers(t,e)));if(!i){break}}}t=i}return t||d}function compareTypeParametersIdentical(e,t){if(length(e)!==length(t)){return false}if(!e||!t){return true}const n=createTypeMapper(t,e);for(let r=0;r=i?e:t;const a=o===e?t:e;const s=o===e?r:i;const c=hasEffectiveRestParameter(e)||hasEffectiveRestParameter(t);const l=c&&!hasEffectiveRestParameter(o);const d=new Array(s+(l?1:0));for(let p=0;p=getMinArgumentCount(o)&&p>=getMinArgumentCount(a);const y=p>=r?void 0:getParameterNameAtPosition(e,p);const h=p>=i?void 0:getParameterNameAtPosition(t,p);const T=y===h?y:!y?h:!h?y:void 0;const S=createSymbol(1|(g&&!_?16777216:0),T||`arg${p}`,_?32768:g?16384:0);S.links.type=_?createArrayType(m):m;d[p]=S}if(l){const e=createSymbol(1,"args",32768);e.links.type=createArrayType(getTypeAtPosition(a,s));if(a===t){e.links.type=instantiateType(e.links.type,n)}d[s]=e}return d}function combineSignaturesOfUnionMembers(e,t){const n=e.typeParameters||t.typeParameters;let r;if(e.typeParameters&&t.typeParameters){r=createTypeMapper(t.typeParameters,e.typeParameters)}let i=(e.flags|t.flags)&(167&~1);const o=e.declaration;const a=combineUnionParameters(e,t,r);const s=lastOrUndefined(a);if(s&&getCheckFlags(s)&32768){i|=1}const c=combineUnionThisParam(e.thisParameter,t.thisParameter,r);const l=Math.max(e.minArgumentCount,t.minArgumentCount);const d=createSignature(o,n,c,a,void 0,void 0,l,i);d.compositeKind=1048576;d.compositeSignatures=concatenate(e.compositeKind!==2097152&&e.compositeSignatures||[e],[t]);if(r){d.mapper=e.compositeKind!==2097152&&e.mapper&&e.compositeSignatures?combineTypeMappers(e.mapper,r):r}else if(e.compositeKind!==2097152&&e.mapper&&e.compositeSignatures){d.mapper=e.mapper}return d}function getUnionIndexInfos(e){const t=getIndexInfosOfType(e[0]);if(t){const n=[];for(const r of t){const t=r.keyType;if(every(e,(e=>!!getIndexInfoOfType(e,t)))){n.push(createIndexInfo(t,getUnionType(map(e,(e=>getIndexTypeOfType(e,t)))),some(e,(e=>getIndexInfoOfType(e,t).isReadonly))))}}return n}return d}function resolveUnionTypeMembers(e){const t=getUnionSignatures(map(e.types,(e=>e===tn?[Bt]:getSignaturesOfType(e,0))));const n=getUnionSignatures(map(e.types,(e=>getSignaturesOfType(e,1))));const r=getUnionIndexInfos(e.types);setStructuredTypeMembers(e,y,t,n,r)}function intersectTypes(e,t){return!e?t:!t?e:getIntersectionType([e,t])}function findMixins(e){const t=countWhere(e,(e=>getSignaturesOfType(e,1).length>0));const n=map(e,isMixinConstructorType);if(t>0&&t===countWhere(n,(e=>e))){const e=n.indexOf(true);n[e]=false}return n}function includeMixinType(e,t,n,r){const i=[];for(let o=0;oe));for(let s=0;s0){e=map(e,(e=>{const t=cloneSignature(e);t.resolvedReturnType=includeMixinType(getReturnTypeOfSignature(e),i,o,s);return t}))}n=appendSignatures(n,e)}t=appendSignatures(t,getSignaturesOfType(c,0));r=reduceLeft(getIndexInfosOfType(c),((e,t)=>appendIndexInfo(e,t,false)),r)}setStructuredTypeMembers(e,y,t||d,n||d,r||d)}function appendSignatures(e,t){for(const n of t){if(!e||every(e,(e=>!compareSignaturesIdentical(e,n,false,false,false,compareTypesIdentical)))){e=append(e,n)}}return e}function appendIndexInfo(e,t,n){if(e){for(let r=0;r{var n;if(!(t.flags&418)&&!(t.flags&512&&((n=t.declarations)==null?void 0:n.length)&&every(t.declarations,isAmbientModule))){e.set(t.escapedName,t)}}));n=e}let i;setStructuredTypeMembers(e,n,d,d,d);if(t.flags&32){const e=getDeclaredTypeOfClassOrInterface(t);const r=getBaseConstructorTypeOfClass(e);if(r.flags&(524288|2097152|8650752)){n=createSymbolTable(getNamedOrIndexSignatureMembers(n));addInheritedMembers(n,getPropertiesOfType(r))}else if(r===ke){i=Ut}}const o=getIndexSymbolFromSymbolTable(n);if(o){r=getIndexInfosOfIndexSymbol(o,arrayFrom(n.values()))}else{if(i){r=append(r,i)}if(t.flags&384&&(getDeclaredTypeOfSymbol(t).flags&32||some(e.properties,(e=>!!(getTypeOfSymbol(e).flags&296))))){r=append(r,Wt)}}setStructuredTypeMembers(e,n,d,d,r||d);if(t.flags&(16|8192)){e.callSignatures=getSignaturesOfSymbol(t)}if(t.flags&32){const n=getDeclaredTypeOfClassOrInterface(t);let r=t.members?getSignaturesOfSymbol(t.members.get("__constructor")):d;if(t.flags&16){r=addRange(r.slice(),mapDefined(e.callSignatures,(e=>isJSConstructor(e.declaration)?createSignature(e.declaration,e.typeParameters,e.thisParameter,e.parameters,n,void 0,e.minArgumentCount,e.flags&167):void 0)))}if(!r.length){r=getDefaultConstructSignatures(n)}e.constructSignatures=r}}function replaceIndexedAccess(e,t,n){return instantiateType(e,createTypeMapper([t.indexType,t.objectType],[getNumberLiteralType(0),createTupleType([n])]))}function getLimitedConstraint(e){const t=getConstraintTypeFromMappedType(e.mappedType);if(!(t.flags&1048576||t.flags&2097152)){return}const n=t.flags&1048576?t.origin:t;if(!n||!(n.flags&2097152)){return}const r=getIntersectionType(n.types.filter((t=>t!==e.constraintType)));return r!==et?r:void 0}function resolveReverseMappedTypeMembers(e){const t=getIndexInfoOfType(e.source,ze);const n=getMappedTypeModifiers(e.mappedType);const r=n&1?false:true;const i=n&4?0:16777216;const o=t?[createIndexInfo(ze,inferReverseMappedType(t.type,e.mappedType,e.constraintType)||Le,r&&t.isReadonly)]:d;const a=createSymbolTable();const s=getLimitedConstraint(e);for(const t of getPropertiesOfType(e.source)){if(s){const e=getLiteralTypeFromProperty(t,8576);if(!isTypeAssignableTo(e,s)){continue}}const n=8192|(r&&isReadonlySymbol(t)?8:0);const o=createSymbol(4|t.flags&i,t.escapedName,n);o.declarations=t.declarations;o.links.nameType=getSymbolLinks(t).nameType;o.links.propertyType=getTypeOfSymbol(t);if(e.constraintType.type.flags&8388608&&e.constraintType.type.objectType.flags&262144&&e.constraintType.type.indexType.flags&262144){const t=e.constraintType.type.objectType;const n=replaceIndexedAccess(e.mappedType,e.constraintType.type,t);o.links.mappedType=n;o.links.constraintType=getIndexType(t)}else{o.links.mappedType=e.mappedType;o.links.constraintType=e.constraintType}a.set(t.escapedName,o)}setStructuredTypeMembers(e,a,d,d,o)}function getLowerBoundOfKeyType(e){if(e.flags&4194304){const t=getApparentType(e.type);return isGenericTupleType(t)?getKnownKeysOfTupleType(t):getIndexType(t)}if(e.flags&16777216){if(e.root.isDistributive){const t=e.checkType;const n=getLowerBoundOfKeyType(t);if(n!==t){return getConditionalTypeInstantiation(e,prependTypeMapping(e.root.checkType,n,e.mapper),false)}}return e}if(e.flags&1048576){return mapType(e,getLowerBoundOfKeyType,true)}if(e.flags&2097152){const t=e.types;if(t.length===2&&!!(t[0].flags&(4|8|64))&&t[1]===xt){return e}return getIntersectionType(sameMap(e.types,getLowerBoundOfKeyType))}return e}function getIsLateCheckFlag(e){return getCheckFlags(e)&4096}function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(e,t,n,r){for(const n of getPropertiesOfType(e)){r(getLiteralTypeFromProperty(n,t))}if(e.flags&1){r(ze)}else{for(const t of getIndexInfosOfType(e)){if(!n||t.keyType.flags&(4|134217728)){r(t.keyType)}}}}function resolveMappedTypeMembers(e){const t=createSymbolTable();let n;setStructuredTypeMembers(e,y,d,d,d);const r=getTypeParameterFromMappedType(e);const i=getConstraintTypeFromMappedType(e);const o=e.target||e;const a=getNameTypeFromMappedType(o);const s=getMappedTypeNameTypeKind(o)!==2;const c=getTemplateTypeFromMappedType(o);const l=getApparentType(getModifiersTypeFromMappedType(e));const p=getMappedTypeModifiers(e);const u=8576;if(isMappedTypeWithKeyofConstraintDeclaration(e)){forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(l,u,false,addMemberForKeyType)}else{forEachType(getLowerBoundOfKeyType(i),addMemberForKeyType)}setStructuredTypeMembers(e,t,d,d,n||d);function addMemberForKeyType(t){const n=a?instantiateType(a,appendTypeMapping(e.mapper,r,t)):t;forEachType(n,(e=>addMemberForKeyTypeWorker(t,e)))}function addMemberForKeyTypeWorker(i,o){if(isTypeUsableAsPropertyName(o)){const n=getPropertyNameFromType(o);const r=t.get(n);if(r){r.links.nameType=getUnionType([r.links.nameType,o]);r.links.keyType=getUnionType([r.links.keyType,i])}else{const r=isTypeUsableAsPropertyName(i)?getPropertyOfType(l,getPropertyNameFromType(i)):void 0;const a=!!(p&4||!(p&8)&&r&&r.flags&16777216);const c=!!(p&1||!(p&2)&&r&&isReadonlySymbol(r));const d=k&&!a&&r&&r.flags&16777216;const u=r?getIsLateCheckFlag(r):0;const f=createSymbol(4|(a?16777216:0),n,u|262144|(c?8:0)|(d?524288:0));f.links.mappedType=e;f.links.nameType=o;f.links.keyType=i;if(r){f.links.syntheticOrigin=r;f.declarations=s?r.declarations:void 0}t.set(n,f)}}else if(isValidIndexKeyType(o)||o.flags&(1|32)){const t=o.flags&(1|4)?ze:o.flags&(8|32)?Ve:o;const a=instantiateType(c,appendTypeMapping(e.mapper,r,i));const s=getApplicableIndexInfo(l,o);const d=!!(p&1||!(p&2)&&(s==null?void 0:s.isReadonly));const u=createIndexInfo(t,a,d);n=appendIndexInfo(n,u,true)}}}function getTypeOfMappedSymbol(e){var t;if(!e.links.type){const n=e.links.mappedType;if(!pushTypeResolution(e,0)){n.containsError=true;return Ie}const r=getTemplateTypeFromMappedType(n.target||n);const i=appendTypeMapping(n.mapper,getTypeParameterFromMappedType(n),e.links.keyType);const o=instantiateType(r,i);let a=k&&e.flags&16777216&&!maybeTypeOfKind(o,32768|16384)?getOptionalType(o,true):e.links.checkFlags&524288?removeMissingOrUndefinedType(o):o;if(!popTypeResolution()){error2(m,wt.Type_of_property_0_circularly_references_itself_in_mapped_type_1,symbolToString(e),typeToString(n));a=Ie}(t=e.links).type??(t.type=a)}return e.links.type}function getTypeParameterFromMappedType(e){return e.typeParameter||(e.typeParameter=getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(e.declaration.typeParameter)))}function getConstraintTypeFromMappedType(e){return e.constraintType||(e.constraintType=getConstraintOfTypeParameter(getTypeParameterFromMappedType(e))||Ie)}function getNameTypeFromMappedType(e){return e.declaration.nameType?e.nameType||(e.nameType=instantiateType(getTypeFromTypeNode(e.declaration.nameType),e.mapper)):void 0}function getTemplateTypeFromMappedType(e){return e.templateType||(e.templateType=e.declaration.type?instantiateType(addOptionality(getTypeFromTypeNode(e.declaration.type),true,!!(getMappedTypeModifiers(e)&4)),e.mapper):Ie)}function getConstraintDeclarationForMappedType(e){return getEffectiveConstraintOfTypeParameter(e.declaration.typeParameter)}function isMappedTypeWithKeyofConstraintDeclaration(e){const t=getConstraintDeclarationForMappedType(e);return t.kind===198&&t.operator===143}function getModifiersTypeFromMappedType(e){if(!e.modifiersType){if(isMappedTypeWithKeyofConstraintDeclaration(e)){e.modifiersType=instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(e).type),e.mapper)}else{const t=getTypeFromMappedTypeNode(e.declaration);const n=getConstraintTypeFromMappedType(t);const r=n&&n.flags&262144?getConstraintOfTypeParameter(n):n;e.modifiersType=r&&r.flags&4194304?instantiateType(r.type,e.mapper):Le}}return e.modifiersType}function getMappedTypeModifiers(e){const t=e.declaration;return(t.readonlyToken?t.readonlyToken.kind===41?2:1:0)|(t.questionToken?t.questionToken.kind===41?8:4:0)}function getMappedTypeOptionality(e){const t=getMappedTypeModifiers(e);return t&8?-1:t&4?1:0}function getCombinedMappedTypeOptionality(e){if(getObjectFlags(e)&32){return getMappedTypeOptionality(e)||getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(e))}if(e.flags&2097152){const t=getCombinedMappedTypeOptionality(e.types[0]);return every(e.types,((e,n)=>n===0||getCombinedMappedTypeOptionality(e)===t))?t:0}return 0}function isPartialMappedType(e){return!!(getObjectFlags(e)&32&&getMappedTypeModifiers(e)&4)}function isGenericMappedType(e){if(getObjectFlags(e)&32){const t=getConstraintTypeFromMappedType(e);if(isGenericIndexType(t)){return true}const n=getNameTypeFromMappedType(e);if(n&&isGenericIndexType(instantiateType(n,makeUnaryTypeMapper(getTypeParameterFromMappedType(e),t)))){return true}}return false}function getMappedTypeNameTypeKind(e){const t=getNameTypeFromMappedType(e);if(!t){return 0}return isTypeAssignableTo(t,getTypeParameterFromMappedType(e))?1:2}function resolveStructuredTypeMembers(e){if(!e.members){if(e.flags&524288){if(e.objectFlags&4){resolveTypeReferenceMembers(e)}else if(e.objectFlags&3){resolveClassOrInterfaceMembers(e)}else if(e.objectFlags&1024){resolveReverseMappedTypeMembers(e)}else if(e.objectFlags&16){resolveAnonymousTypeMembers(e)}else if(e.objectFlags&32){resolveMappedTypeMembers(e)}else{S.fail("Unhandled object type "+S.formatObjectFlags(e.objectFlags))}}else if(e.flags&1048576){resolveUnionTypeMembers(e)}else if(e.flags&2097152){resolveIntersectionTypeMembers(e)}else{S.fail("Unhandled type "+S.formatTypeFlags(e.flags))}}return e}function getPropertiesOfObjectType(e){if(e.flags&524288){return resolveStructuredTypeMembers(e).properties}return d}function getPropertyOfObjectType(e,t){if(e.flags&524288){const n=resolveStructuredTypeMembers(e);const r=n.members.get(t);if(r&&symbolIsValue(r)){return r}}}function getPropertiesOfUnionOrIntersectionType(e){if(!e.resolvedProperties){const t=createSymbolTable();for(const n of e.types){for(const r of getPropertiesOfType(n)){if(!t.has(r.escapedName)){const n=getPropertyOfUnionOrIntersectionType(e,r.escapedName,!!(e.flags&2097152));if(n){t.set(r.escapedName,n)}}}if(e.flags&1048576&&getIndexInfosOfType(n).length===0){break}}e.resolvedProperties=getNamedMembers(t)}return e.resolvedProperties}function getPropertiesOfType(e){e=getReducedApparentType(e);return e.flags&3145728?getPropertiesOfUnionOrIntersectionType(e):getPropertiesOfObjectType(e)}function forEachPropertyOfType(e,t){e=getReducedApparentType(e);if(e.flags&3670016){resolveStructuredTypeMembers(e).members.forEach(((e,n)=>{if(isNamedMember(e,n)){t(e,n)}}))}}function isTypeInvalidDueToUnionDiscriminant(e,t){const n=t.properties;return n.some((t=>{const n=t.name&&(isJsxNamespacedName(t.name)?getStringLiteralType(getTextOfJsxAttributeName(t.name)):getLiteralTypeFromPropertyName(t.name));const r=n&&isTypeUsableAsPropertyName(n)?getPropertyNameFromType(n):void 0;const i=r===void 0?void 0:getTypeOfPropertyOfType(e,r);return!!i&&isLiteralType(i)&&!isTypeAssignableTo(getTypeOfNode(t),i)}))}function getAllPossiblePropertiesOfTypes(e){const t=getUnionType(e);if(!(t.flags&1048576)){return getAugmentedPropertiesOfType(t)}const n=createSymbolTable();for(const r of e){for(const{escapedName:e}of getAugmentedPropertiesOfType(r)){if(!n.has(e)){const r=createUnionOrIntersectionProperty(t,e);if(r)n.set(e,r)}}}return arrayFrom(n.values())}function getConstraintOfType(e){return e.flags&262144?getConstraintOfTypeParameter(e):e.flags&8388608?getConstraintOfIndexedAccess(e):e.flags&16777216?getConstraintOfConditionalType(e):getBaseConstraintOfType(e)}function getConstraintOfTypeParameter(e){return hasNonCircularBaseConstraint(e)?getConstraintFromTypeParameter(e):void 0}function isConstMappedType(e,t){const n=getHomomorphicTypeVariable(e);return!!n&&isConstTypeVariable(n,t)}function isConstTypeVariable(e,t=0){var n;return t<5&&!!(e&&(e.flags&262144&&some((n=e.symbol)==null?void 0:n.declarations,(e=>hasSyntacticModifier(e,4096)))||e.flags&3145728&&some(e.types,(e=>isConstTypeVariable(e,t)))||e.flags&8388608&&isConstTypeVariable(e.objectType,t+1)||e.flags&16777216&&isConstTypeVariable(getConstraintOfConditionalType(e),t+1)||e.flags&33554432&&isConstTypeVariable(e.baseType,t)||getObjectFlags(e)&32&&isConstMappedType(e,t)||isGenericTupleType(e)&&findIndex(getElementTypes(e),((n,r)=>!!(e.target.elementFlags[r]&8)&&isConstTypeVariable(n,t)))>=0))}function getConstraintOfIndexedAccess(e){return hasNonCircularBaseConstraint(e)?getConstraintFromIndexedAccess(e):void 0}function getSimplifiedTypeOrConstraint(e){const t=getSimplifiedType(e,false);return t!==e?t:getConstraintOfType(e)}function getConstraintFromIndexedAccess(e){if(isMappedTypeGenericIndexedAccess(e)){return substituteIndexedMappedType(e.objectType,e.indexType)}const t=getSimplifiedTypeOrConstraint(e.indexType);if(t&&t!==e.indexType){const n=getIndexedAccessTypeOrUndefined(e.objectType,t,e.accessFlags);if(n){return n}}const n=getSimplifiedTypeOrConstraint(e.objectType);if(n&&n!==e.objectType){return getIndexedAccessTypeOrUndefined(n,e.indexType,e.accessFlags)}return void 0}function getDefaultConstraintOfConditionalType(e){if(!e.resolvedDefaultConstraint){const t=getInferredTrueTypeFromConditionalType(e);const n=getFalseTypeFromConditionalType(e);e.resolvedDefaultConstraint=isTypeAny(t)?n:isTypeAny(n)?t:getUnionType([t,n])}return e.resolvedDefaultConstraint}function getConstraintOfDistributiveConditionalType(e){if(e.resolvedConstraintOfDistributive!==void 0){return e.resolvedConstraintOfDistributive||void 0}if(e.root.isDistributive&&e.restrictiveInstantiation!==e){const t=getSimplifiedType(e.checkType,false);const n=t===e.checkType?getConstraintOfType(t):t;if(n&&n!==e.checkType){const t=getConditionalTypeInstantiation(e,prependTypeMapping(e.root.checkType,n,e.mapper),true);if(!(t.flags&131072)){e.resolvedConstraintOfDistributive=t;return t}}}e.resolvedConstraintOfDistributive=false;return void 0}function getConstraintFromConditionalType(e){return getConstraintOfDistributiveConditionalType(e)||getDefaultConstraintOfConditionalType(e)}function getConstraintOfConditionalType(e){return hasNonCircularBaseConstraint(e)?getConstraintFromConditionalType(e):void 0}function getEffectiveConstraintOfIntersection(e,t){let n;let r=false;for(const i of e){if(i.flags&465829888){let e=getConstraintOfType(i);while(e&&e.flags&(262144|4194304|16777216)){e=getConstraintOfType(e)}if(e){n=append(n,e);if(t){n=append(n,i)}}}else if(i.flags&469892092||isEmptyAnonymousObjectType(i)){r=true}}if(n&&(t||r)){if(r){for(const t of e){if(t.flags&469892092||isEmptyAnonymousObjectType(t)){n=append(n,t)}}}return getNormalizedType(getIntersectionType(n,2),false)}return void 0}function getBaseConstraintOfType(e){if(e.flags&(58982400|3145728|134217728|268435456)||isGenericTupleType(e)){const t=getResolvedBaseConstraint(e);return t!==kt&&t!==Ft?t:void 0}return e.flags&4194304?at:void 0}function getBaseConstraintOrType(e){return getBaseConstraintOfType(e)||e}function hasNonCircularBaseConstraint(e){return getResolvedBaseConstraint(e)!==Ft}function getResolvedBaseConstraint(e){if(e.resolvedBaseConstraint){return e.resolvedBaseConstraint}const t=[];return e.resolvedBaseConstraint=getImmediateBaseConstraint(e);function getImmediateBaseConstraint(e){if(!e.immediateBaseConstraint){if(!pushTypeResolution(e,4)){return Ft}let n;const r=getRecursionIdentity(e);if(t.length<10||t.length<50&&!contains(t,r)){t.push(r);n=computeBaseConstraint(getSimplifiedType(e,false));t.pop()}if(!popTypeResolution()){if(e.flags&262144){const t=getConstraintDeclaration(e);if(t){const n=error2(t,wt.Type_parameter_0_has_a_circular_constraint,typeToString(e));if(m&&!isNodeDescendantOf(t,m)&&!isNodeDescendantOf(m,t)){addRelatedInfo(n,createDiagnosticForNode(m,wt.Circularity_originates_in_type_at_this_location))}}}n=Ft}e.immediateBaseConstraint??(e.immediateBaseConstraint=n||kt)}return e.immediateBaseConstraint}function getBaseConstraint(e){const t=getImmediateBaseConstraint(e);return t!==kt&&t!==Ft?t:void 0}function computeBaseConstraint(e){if(e.flags&262144){const t=getConstraintFromTypeParameter(e);return e.isThisType||!t?t:getBaseConstraint(t)}if(e.flags&3145728){const t=e.types;const n=[];let r=false;for(const e of t){const t=getBaseConstraint(e);if(t){if(t!==e){r=true}n.push(t)}else{r=true}}if(!r){return e}return e.flags&1048576&&n.length===t.length?getUnionType(n):e.flags&2097152&&n.length?getIntersectionType(n):void 0}if(e.flags&4194304){return at}if(e.flags&134217728){const t=e.types;const n=mapDefined(t,getBaseConstraint);return n.length===t.length?getTemplateLiteralType(e.texts,n):ze}if(e.flags&268435456){const t=getBaseConstraint(e.type);return t&&t!==e.type?getStringMappingType(e.symbol,t):ze}if(e.flags&8388608){if(isMappedTypeGenericIndexedAccess(e)){return getBaseConstraint(substituteIndexedMappedType(e.objectType,e.indexType))}const t=getBaseConstraint(e.objectType);const n=getBaseConstraint(e.indexType);const r=t&&n&&getIndexedAccessTypeOrUndefined(t,n,e.accessFlags);return r&&getBaseConstraint(r)}if(e.flags&16777216){const t=getConstraintFromConditionalType(e);return t&&getBaseConstraint(t)}if(e.flags&33554432){return getBaseConstraint(getSubstitutionIntersection(e))}if(isGenericTupleType(e)){const t=map(getElementTypes(e),((t,n)=>{const r=t.flags&262144&&e.target.elementFlags[n]&8&&getBaseConstraint(t)||t;return r!==t&&everyType(r,(e=>isArrayOrTupleType(e)&&!isGenericTupleType(e)))?r:t}));return createTupleType(t,e.target.elementFlags,e.target.readonly,e.target.labeledElementDeclarations)}return e}}function getApparentTypeOfIntersectionType(e,t){if(e===t){return e.resolvedApparentType||(e.resolvedApparentType=getTypeWithThisArgument(e,t,true))}const n=`I${getTypeId(e)},${getTypeId(t)}`;return getCachedType(n)??setCachedType(n,getTypeWithThisArgument(e,t,true))}function getResolvedTypeParameterDefault(e){if(!e.default){if(e.target){const t=getResolvedTypeParameterDefault(e.target);e.default=t?instantiateType(t,e.mapper):kt}else{e.default=Pt;const t=e.symbol&&forEach(e.symbol.declarations,(e=>isTypeParameterDeclaration(e)&&e.default));const n=t?getTypeFromTypeNode(t):kt;if(e.default===Pt){e.default=n}}}else if(e.default===Pt){e.default=Ft}return e.default}function getDefaultFromTypeParameter(e){const t=getResolvedTypeParameterDefault(e);return t!==kt&&t!==Ft?t:void 0}function hasNonCircularTypeParameterDefault(e){return getResolvedTypeParameterDefault(e)!==Ft}function hasTypeParameterDefault(e){return!!(e.symbol&&forEach(e.symbol.declarations,(e=>isTypeParameterDeclaration(e)&&e.default)))}function getApparentTypeOfMappedType(e){return e.resolvedApparentType||(e.resolvedApparentType=getResolvedApparentTypeOfMappedType(e))}function getResolvedApparentTypeOfMappedType(e){const t=e.target??e;const n=getHomomorphicTypeVariable(t);if(n&&!t.declaration.nameType){const r=getModifiersTypeFromMappedType(e);const i=isGenericMappedType(r)?getApparentTypeOfMappedType(r):getBaseConstraintOfType(r);if(i&&everyType(i,(e=>isArrayOrTupleType(e)||isArrayOrTupleOrIntersection(e)))){return instantiateType(t,prependTypeMapping(n,i,e.mapper))}}return e}function isArrayOrTupleOrIntersection(e){return!!(e.flags&2097152)&&every(e.types,isArrayOrTupleType)}function isMappedTypeGenericIndexedAccess(e){let t;return!!(e.flags&8388608&&getObjectFlags(t=e.objectType)&32&&!isGenericMappedType(t)&&isGenericIndexType(e.indexType)&&!(getMappedTypeModifiers(t)&8)&&!t.declaration.nameType)}function getApparentType(e){const t=e.flags&465829888?getBaseConstraintOfType(e)||Le:e;const n=getObjectFlags(t);return n&32?getApparentTypeOfMappedType(t):n&4&&t!==e?getTypeWithThisArgument(t,e):t.flags&2097152?getApparentTypeOfIntersectionType(t,e):t.flags&402653316?pn:t.flags&296?fn:t.flags&2112?getGlobalBigIntType():t.flags&528?mn:t.flags&12288?getGlobalESSymbolType():t.flags&67108864?ht:t.flags&4194304?at:t.flags&2&&!k?ht:t}function getReducedApparentType(e){return getReducedType(getApparentType(getReducedType(e)))}function createUnionOrIntersectionProperty(e,t,n){var r,i,o;let a;let s;let c;const l=e.flags&1048576;let d;let p=4;let u=l?0:8;let f=false;for(const r of e.types){const e=getApparentType(r);if(!(isErrorType(e)||e.flags&131072)){const r=getPropertyOfType(e,t,n);const i=r?getDeclarationModifierFlagsFromSymbol(r):0;if(r){if(r.flags&106500){d??(d=l?0:16777216);if(l){d|=r.flags&16777216}else{d&=r.flags}}if(!a){a=r}else if(r!==a){const e=(getTargetSymbol(r)||r)===(getTargetSymbol(a)||a);if(e&&compareProperties2(a,r,((e,t)=>e===t?-1:0))===-1){f=!!a.parent&&!!length(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(a.parent))}else{if(!s){s=new Map;s.set(getSymbolId(a),a)}const e=getSymbolId(r);if(!s.has(e)){s.set(e,r)}}}if(l&&isReadonlySymbol(r)){u|=8}else if(!l&&!isReadonlySymbol(r)){u&=~8}u|=(!(i&6)?256:0)|(i&4?512:0)|(i&2?1024:0)|(i&256?2048:0);if(!isPrototypeProperty(r)){p=2}}else if(l){const n=!isLateBoundName(t)&&getApplicableIndexInfoForName(e,t);if(n){u|=32|(n.isReadonly?8:0);c=append(c,isTupleType(e)?getRestTypeOfTupleType(e)||Me:n.type)}else if(isObjectLiteralType2(e)&&!(getObjectFlags(e)&2097152)){u|=32;c=append(c,Me)}else{u|=16}}}}if(!a||l&&(s||u&48)&&u&(1024|512)&&!(s&&getCommonDeclarationsOfSymbols(s.values()))){return void 0}if(!s&&!(u&16)&&!c){if(f){const t=(r=tryCast(a,isTransientSymbol))==null?void 0:r.links;const n=createSymbolWithType(a,t==null?void 0:t.type);n.parent=(o=(i=a.valueDeclaration)==null?void 0:i.symbol)==null?void 0:o.parent;n.links.containingType=e;n.links.mapper=t==null?void 0:t.mapper;n.links.writeType=getWriteTypeOfSymbol(a);return n}else{return a}}const m=s?arrayFrom(s.values()):[a];let _;let g;let y;const h=[];let T;let S;let v=false;for(const e of m){if(!S){S=e.valueDeclaration}else if(e.valueDeclaration&&e.valueDeclaration!==S){v=true}_=addRange(_,e.declarations);const t=getTypeOfSymbol(e);if(!g){g=t;y=getSymbolLinks(e).nameType}const n=getWriteTypeOfSymbol(e);if(T||n!==t){T=append(!T?h.slice():T,n)}if(t!==g){u|=64}if(isLiteralType(t)||isPatternLiteralType(t)){u|=128}if(t.flags&131072&&t!==ft){u|=131072}h.push(t)}addRange(h,c);const x=createSymbol(4|(d??0),t,p|u);x.links.containingType=e;if(!v&&S){x.valueDeclaration=S;if(S.symbol.parent){x.parent=S.symbol.parent}}x.declarations=_;x.links.nameType=y;if(h.length>2){x.links.checkFlags|=65536;x.links.deferralParent=e;x.links.deferralConstituents=h;x.links.deferralWriteConstituents=T}else{x.links.type=l?getUnionType(h):getIntersectionType(h);if(T){x.links.writeType=l?getUnionType(T):getIntersectionType(T)}}return x}function getUnionOrIntersectionProperty(e,t,n){var r,i,o;let a=n?(r=e.propertyCacheWithoutObjectFunctionPropertyAugment)==null?void 0:r.get(t):(i=e.propertyCache)==null?void 0:i.get(t);if(!a){a=createUnionOrIntersectionProperty(e,t,n);if(a){const r=n?e.propertyCacheWithoutObjectFunctionPropertyAugment||(e.propertyCacheWithoutObjectFunctionPropertyAugment=createSymbolTable()):e.propertyCache||(e.propertyCache=createSymbolTable());r.set(t,a);if(n&&!(getCheckFlags(a)&48)&&!((o=e.propertyCache)==null?void 0:o.get(t))){const n=e.propertyCache||(e.propertyCache=createSymbolTable());n.set(t,a)}}}return a}function getCommonDeclarationsOfSymbols(e){let t;for(const n of e){if(!n.declarations){return void 0}if(!t){t=new Set(n.declarations);continue}t.forEach((e=>{if(!contains(n.declarations,e)){t.delete(e)}}));if(t.size===0){return void 0}}return t}function getPropertyOfUnionOrIntersectionType(e,t,n){const r=getUnionOrIntersectionProperty(e,t,n);return r&&!(getCheckFlags(r)&16)?r:void 0}function getReducedType(e){if(e.flags&1048576&&e.objectFlags&16777216){return e.resolvedReducedType||(e.resolvedReducedType=getReducedUnionType(e))}else if(e.flags&2097152){if(!(e.objectFlags&16777216)){e.objectFlags|=16777216|(some(getPropertiesOfUnionOrIntersectionType(e),isNeverReducedProperty)?33554432:0)}return e.objectFlags&33554432?et:e}return e}function getReducedUnionType(e){const t=sameMap(e.types,getReducedType);if(t===e.types){return e}const n=getUnionType(t);if(n.flags&1048576){n.resolvedReducedType=n}return n}function isNeverReducedProperty(e){return isDiscriminantWithNeverType(e)||isConflictingPrivateProperty(e)}function isDiscriminantWithNeverType(e){return!(e.flags&16777216)&&(getCheckFlags(e)&(192|131072))===192&&!!(getTypeOfSymbol(e).flags&131072)}function isConflictingPrivateProperty(e){return!e.valueDeclaration&&!!(getCheckFlags(e)&1024)}function isGenericReducibleType(e){return!!(e.flags&1048576&&e.objectFlags&16777216&&some(e.types,isGenericReducibleType)||e.flags&2097152&&isReducibleIntersection(e))}function isReducibleIntersection(e){const t=e.uniqueLiteralFilledInstantiation||(e.uniqueLiteralFilledInstantiation=instantiateType(e,mt));return getReducedType(t)!==t}function elaborateNeverIntersection(e,t){if(t.flags&2097152&&getObjectFlags(t)&33554432){const n=find(getPropertiesOfUnionOrIntersectionType(t),isDiscriminantWithNeverType);if(n){return chainDiagnosticMessages(e,wt.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents,typeToString(t,void 0,536870912),symbolToString(n))}const r=find(getPropertiesOfUnionOrIntersectionType(t),isConflictingPrivateProperty);if(r){return chainDiagnosticMessages(e,wt.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some,typeToString(t,void 0,536870912),symbolToString(r))}}return e}function getPropertyOfType(e,t,n,r){var i,o;e=getReducedApparentType(e);if(e.flags&524288){const a=resolveStructuredTypeMembers(e);const s=a.members.get(t);if(s&&!r&&((i=e.symbol)==null?void 0:i.flags)&512&&((o=getSymbolLinks(e.symbol).typeOnlyExportStarMap)==null?void 0:o.has(t))){return void 0}if(s&&symbolIsValue(s,r)){return s}if(n)return void 0;const c=a===Nt?tn:a.callSignatures.length?nn:a.constructSignatures.length?rn:void 0;if(c){const e=getPropertyOfObjectType(c,t);if(e){return e}}return getPropertyOfObjectType(en,t)}if(e.flags&2097152){const r=getPropertyOfUnionOrIntersectionType(e,t,true);if(r){return r}if(!n){return getPropertyOfUnionOrIntersectionType(e,t,n)}return void 0}if(e.flags&1048576){return getPropertyOfUnionOrIntersectionType(e,t,n)}return void 0}function getSignaturesOfStructuredType(e,t){if(e.flags&3670016){const n=resolveStructuredTypeMembers(e);return t===0?n.callSignatures:n.constructSignatures}return d}function getSignaturesOfType(e,t){const n=getSignaturesOfStructuredType(getReducedApparentType(e),t);if(t===0&&!length(n)&&e.flags&1048576){if(e.arrayFallbackSignatures){return e.arrayFallbackSignatures}let r;if(everyType(e,(e=>{var t;return!!((t=e.symbol)==null?void 0:t.parent)&&isArrayOrTupleSymbol(e.symbol.parent)&&(!r?(r=e.symbol.escapedName,true):r===e.symbol.escapedName)}))){const n=mapType(e,(e=>getMappedType((isReadonlyArraySymbol(e.symbol.parent)?an:on).typeParameters[0],e.mapper)));const i=createArrayType(n,someType(e,(e=>isReadonlyArraySymbol(e.symbol.parent))));return e.arrayFallbackSignatures=getSignaturesOfType(getTypeOfPropertyOfType(i,r),t)}e.arrayFallbackSignatures=n}return n}function isArrayOrTupleSymbol(e){if(!e||!on.symbol||!an.symbol){return false}return!!getSymbolIfSameReference(e,on.symbol)||!!getSymbolIfSameReference(e,an.symbol)}function isReadonlyArraySymbol(e){if(!e||!an.symbol){return false}return!!getSymbolIfSameReference(e,an.symbol)}function findIndexInfo(e,t){return find(e,(e=>e.keyType===t))}function findApplicableIndexInfo(e,t){let n;let r;let i;for(const o of e){if(o.keyType===ze){n=o}else if(isApplicableIndexType(t,o.keyType)){if(!r){r=o}else{(i||(i=[r])).push(o)}}}return i?createIndexInfo(Le,getIntersectionType(map(i,(e=>e.type))),reduceLeft(i,((e,t)=>e&&t.isReadonly),true)):r?r:n&&isApplicableIndexType(t,ze)?n:void 0}function isApplicableIndexType(e,t){return isTypeAssignableTo(e,t)||t===ze&&isTypeAssignableTo(e,Ve)||t===Ve&&(e===lt||!!(e.flags&128)&&isNumericLiteralName(e.value))}function getIndexInfosOfStructuredType(e){if(e.flags&3670016){const t=resolveStructuredTypeMembers(e);return t.indexInfos}return d}function getIndexInfosOfType(e){return getIndexInfosOfStructuredType(getReducedApparentType(e))}function getIndexInfoOfType(e,t){return findIndexInfo(getIndexInfosOfType(e),t)}function getIndexTypeOfType(e,t){var n;return(n=getIndexInfoOfType(e,t))==null?void 0:n.type}function getApplicableIndexInfos(e,t){return getIndexInfosOfType(e).filter((e=>isApplicableIndexType(t,e.keyType)))}function getApplicableIndexInfo(e,t){return findApplicableIndexInfo(getIndexInfosOfType(e),t)}function getApplicableIndexInfoForName(e,t){return getApplicableIndexInfo(e,isLateBoundName(t)?Ye:getStringLiteralType(unescapeLeadingUnderscores(t)))}function getTypeParametersFromDeclaration(e){var t;let n;for(const t of getEffectiveTypeParameterDeclarations(e)){n=appendIfUnique(n,getDeclaredTypeOfTypeParameter(t.symbol))}return(n==null?void 0:n.length)?n:isFunctionDeclaration(e)?(t=getSignatureOfTypeTag(e))==null?void 0:t.typeParameters:void 0}function symbolsToArray(e){const t=[];e.forEach(((e,n)=>{if(!isReservedMemberName(n)){t.push(e)}}));return t}function tryFindAmbientModule(e,t){if(isExternalModuleNameRelative(e)){return void 0}const n=getSymbol2(U,'"'+e+'"',512);return n&&t?getMergedSymbol(n):n}function hasEffectiveQuestionToken(e){return hasQuestionToken(e)||isOptionalJSDocPropertyLikeTag(e)||isParameter(e)&&isJSDocOptionalParameter(e)}function isOptionalParameter(e){if(hasEffectiveQuestionToken(e)){return true}if(!isParameter(e)){return false}if(e.initializer){const t=getSignatureFromDeclaration(e.parent);const n=e.parent.parameters.indexOf(e);S.assert(n>=0);return n>=getMinArgumentCount(t,1|2)}const t=getImmediatelyInvokedFunctionExpression(e.parent);if(t){return!e.type&&!e.dotDotDotToken&&e.parent.parameters.indexOf(e)>=getEffectiveCallArguments(t).length}return false}function isOptionalPropertyDeclaration(e){return isPropertyDeclaration(e)&&!hasAccessorModifier(e)&&e.questionToken}function createTypePredicate(e,t,n,r){return{kind:e,parameterName:t,parameterIndex:n,type:r}}function getMinTypeArgumentCount(e){let t=0;if(e){for(let n=0;n=n&&o<=i){const n=e?e.slice():[];for(let e=o;ec.arguments.length&&!p;if(!u){i=n.length}}if((e.kind===177||e.kind===178)&&hasBindableName(e)&&(!s||!o)){const t=e.kind===177?178:177;const n=getDeclarationOfKind(getSymbolOfDeclaration(e),t);if(n){o=getAnnotatedAccessorThisParameter(n)}}if(a&&a.typeExpression){o=createSymbolWithType(createSymbol(1,"this"),getTypeFromTypeNode(a.typeExpression))}const p=isJSDocSignature(e)?getEffectiveJSDocHost(e):e;const u=p&&isConstructorDeclaration(p)?getDeclaredTypeOfClassOrInterface(getMergedSymbol(p.parent.symbol)):void 0;const f=u?u.localTypeParameters:getTypeParametersFromDeclaration(e);if(hasRestParameter(e)||isInJSFile(e)&&maybeAddJsSyntheticRestParameter(e,n)){r|=1}if(isConstructorTypeNode(e)&&hasSyntacticModifier(e,64)||isConstructorDeclaration(e)&&hasSyntacticModifier(e.parent,64)){r|=4}t.resolvedSignature=createSignature(e,f,o,n,void 0,void 0,i,r)}return t.resolvedSignature}function maybeAddJsSyntheticRestParameter(e,t){if(isJSDocSignature(e)||!containsArgumentsReference(e)){return false}const n=lastOrUndefined(e.parameters);const r=n?getJSDocParameterTags(n):getJSDocTags(e).filter(isJSDocParameterTag);const i=firstDefined(r,(e=>e.typeExpression&&isJSDocVariadicType(e.typeExpression.type)?e.typeExpression.type:void 0));const o=createSymbol(3,"args",32768);if(i){o.links.type=createArrayType(getTypeFromTypeNode(i.type))}else{o.links.checkFlags|=65536;o.links.deferralParent=et;o.links.deferralConstituents=[yn];o.links.deferralWriteConstituents=[yn]}if(i){t.pop()}t.push(o);return true}function getSignatureOfTypeTag(e){if(!(isInJSFile(e)&&isFunctionLikeDeclaration(e)))return void 0;const t=getJSDocTypeTag(e);return(t==null?void 0:t.typeExpression)&&getSingleCallSignature(getTypeFromTypeNode(t.typeExpression))}function getParameterTypeOfTypeTag(e,t){const n=getSignatureOfTypeTag(e);if(!n)return void 0;const r=e.parameters.indexOf(t);return t.dotDotDotToken?getRestTypeAtPosition(n,r):getTypeAtPosition(n,r)}function getReturnTypeOfTypeTag(e){const t=getSignatureOfTypeTag(e);return t&&getReturnTypeOfSignature(t)}function containsArgumentsReference(e){const t=getNodeLinks(e);if(t.containsArgumentsReference===void 0){if(t.flags&512){t.containsArgumentsReference=true}else{t.containsArgumentsReference=traverse(e.body)}}return t.containsArgumentsReference;function traverse(e){if(!e)return false;switch(e.kind){case 80:return e.escapedText===q.escapedName&&getReferencedValueSymbol(e)===q;case 172:case 174:case 177:case 178:return e.name.kind===167&&traverse(e.name);case 211:case 212:return traverse(e.expression);case 303:return traverse(e.initializer);default:return!nodeStartsNewLexicalEnvironment(e)&&!isPartOfTypeNode(e)&&!!forEachChild(e,traverse)}}}function getSignaturesOfSymbol(e){if(!e||!e.declarations)return d;const t=[];for(let n=0;n0&&r.body){const t=e.declarations[n-1];if(r.parent===t.parent&&r.kind===t.kind&&r.pos===t.end){continue}}if(isInJSFile(r)&&r.jsDoc){const e=getJSDocOverloadTags(r);if(length(e)){for(const n of e){const e=n.typeExpression;if(e.type===void 0&&!isConstructorDeclaration(r)){reportImplicitAny(e,ke)}t.push(getSignatureFromDeclaration(e))}continue}}t.push(!isFunctionExpressionOrArrowFunction(r)&&!isObjectLiteralMethod(r)&&getSignatureOfTypeTag(r)||getSignatureFromDeclaration(r))}return t}function resolveExternalModuleTypeByLiteral(e){const t=resolveExternalModuleName(e,e);if(t){const e=resolveExternalModuleSymbol(t);if(e){return getTypeOfSymbol(e)}}return ke}function getThisTypeOfSignature(e){if(e.thisParameter){return getTypeOfSymbol(e.thisParameter)}}function getTypePredicateOfSignature(e){if(!e.resolvedTypePredicate){if(e.target){const t=getTypePredicateOfSignature(e.target);e.resolvedTypePredicate=t?instantiateTypePredicate(t,e.mapper):Mt}else if(e.compositeSignatures){e.resolvedTypePredicate=getUnionOrIntersectionTypePredicate(e.compositeSignatures,e.compositeKind)||Mt}else{const t=e.declaration&&getEffectiveReturnTypeNode(e.declaration);let n;if(!t){const t=getSignatureOfTypeTag(e.declaration);if(t&&e!==t){n=getTypePredicateOfSignature(t)}}if(t||n){e.resolvedTypePredicate=t&&isTypePredicateNode(t)?createTypePredicateFromTypePredicateNode(t,e):n||Mt}else if(e.declaration&&isFunctionLikeDeclaration(e.declaration)&&(!e.resolvedReturnType||e.resolvedReturnType.flags&16)&&getParameterCount(e)>0){const{declaration:t}=e;e.resolvedTypePredicate=Mt;e.resolvedTypePredicate=getTypePredicateFromBody(t)||Mt}else{e.resolvedTypePredicate=Mt}}S.assert(!!e.resolvedTypePredicate)}return e.resolvedTypePredicate===Mt?void 0:e.resolvedTypePredicate}function createTypePredicateFromTypePredicateNode(e,t){const n=e.parameterName;const r=e.type&&getTypeFromTypeNode(e.type);return n.kind===197?createTypePredicate(e.assertsModifier?2:0,void 0,void 0,r):createTypePredicate(e.assertsModifier?3:1,n.escapedText,findIndex(t.parameters,(e=>e.escapedName===n.escapedText)),r)}function getUnionOrIntersectionType(e,t,n){return t!==2097152?getUnionType(e,n):getIntersectionType(e)}function getReturnTypeOfSignature(e){if(!e.resolvedReturnType){if(!pushTypeResolution(e,3)){return Ie}let t=e.target?instantiateType(getReturnTypeOfSignature(e.target),e.mapper):e.compositeSignatures?instantiateType(getUnionOrIntersectionType(map(e.compositeSignatures,getReturnTypeOfSignature),e.compositeKind,2),e.mapper):getReturnTypeFromAnnotation(e.declaration)||(nodeIsMissing(e.declaration.body)?ke:getReturnTypeFromBody(e.declaration));if(e.flags&8){t=addOptionalTypeMarker(t)}else if(e.flags&16){t=getOptionalType(t)}if(!popTypeResolution()){if(e.declaration){const t=getEffectiveReturnTypeNode(e.declaration);if(t){error2(t,wt.Return_type_annotation_circularly_references_itself)}else if(A){const t=e.declaration;const n=getNameOfDeclaration(t);if(n){error2(n,wt._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,declarationNameToString(n))}else{error2(t,wt.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions)}}}t=ke}e.resolvedReturnType??(e.resolvedReturnType=t)}return e.resolvedReturnType}function getReturnTypeFromAnnotation(e){if(e.kind===176){return getDeclaredTypeOfClassOrInterface(getMergedSymbol(e.parent.symbol))}const t=getEffectiveReturnTypeNode(e);if(isJSDocSignature(e)){const n=getJSDocRoot(e);if(n&&isConstructorDeclaration(n.parent)&&!t){return getDeclaredTypeOfClassOrInterface(getMergedSymbol(n.parent.parent.symbol))}}if(isJSDocConstructSignature(e)){return getTypeFromTypeNode(e.parameters[0].type)}if(t){return getTypeFromTypeNode(t)}if(e.kind===177&&hasBindableName(e)){const t=isInJSFile(e)&&getTypeForDeclarationFromJSDocComment(e);if(t){return t}const n=getDeclarationOfKind(getSymbolOfDeclaration(e),178);const r=getAnnotatedAccessorType(n);if(r){return r}}return getReturnTypeOfTypeTag(e)}function isResolvingReturnTypeOfSignature(e){return e.compositeSignatures&&some(e.compositeSignatures,isResolvingReturnTypeOfSignature)||!e.resolvedReturnType&&findResolutionCycleStartIndex(e,3)>=0}function getRestTypeOfSignature(e){return tryGetRestTypeOfSignature(e)||ke}function tryGetRestTypeOfSignature(e){if(signatureHasRestParameter(e)){const t=getTypeOfSymbol(e.parameters[e.parameters.length-1]);const n=isTupleType(t)?getRestTypeOfTupleType(t):t;return n&&getIndexTypeOfType(n,Ve)}return void 0}function getSignatureInstantiation(e,t,n,r){const i=getSignatureInstantiationWithoutFillingInTypeArguments(e,fillMissingTypeArguments(t,e.typeParameters,getMinTypeArgumentCount(e.typeParameters),n));if(r){const e=getSingleCallOrConstructSignature(getReturnTypeOfSignature(i));if(e){const t=cloneSignature(e);t.typeParameters=r;const n=cloneSignature(i);n.resolvedReturnType=getOrCreateTypeFromSignature(t);return n}}return i}function getSignatureInstantiationWithoutFillingInTypeArguments(e,t){const n=e.instantiations||(e.instantiations=new Map);const r=getTypeListId(t);let i=n.get(r);if(!i){n.set(r,i=createSignatureInstantiation(e,t))}return i}function createSignatureInstantiation(e,t){return instantiateSignature(e,createSignatureTypeMapper(e,t),true)}function getTypeParametersForMapper(e){return sameMap(e.typeParameters,(e=>e.mapper?instantiateType(e,e.mapper):e))}function createSignatureTypeMapper(e,t){return createTypeMapper(getTypeParametersForMapper(e),t)}function getErasedSignature(e){return e.typeParameters?e.erasedSignatureCache||(e.erasedSignatureCache=createErasedSignature(e)):e}function createErasedSignature(e){return instantiateSignature(e,createTypeEraser(e.typeParameters),true)}function getCanonicalSignature(e){return e.typeParameters?e.canonicalSignatureCache||(e.canonicalSignatureCache=createCanonicalSignature(e)):e}function createCanonicalSignature(e){return getSignatureInstantiation(e,map(e.typeParameters,(e=>e.target&&!getConstraintOfTypeParameter(e.target)?e.target:e)),isInJSFile(e.declaration))}function getImplementationSignature(e){return e.typeParameters?e.implementationSignatureCache||(e.implementationSignatureCache=createImplementationSignature(e)):e}function createImplementationSignature(e){return e.typeParameters?instantiateSignature(e,createTypeMapper([],[])):e}function getBaseSignature(e){const t=e.typeParameters;if(t){if(e.baseSignatureCache){return e.baseSignatureCache}const n=createTypeEraser(t);const r=createTypeMapper(t,map(t,(e=>getConstraintOfTypeParameter(e)||Le)));let i=map(t,(e=>instantiateType(e,r)||Le));for(let e=0;e{if(isValidIndexKeyType(e)&&!findIndexInfo(n,e)){n.push(createIndexInfo(e,t.type?getTypeFromTypeNode(t.type):ke,hasEffectiveModifier(t,8),t))}}))}}}else if(hasLateBindableIndexSignature(t)){const e=isBinaryExpression(t)?t.left:t.name;const d=isElementAccessExpression(e)?checkExpressionCached(e.argumentExpression):checkComputedPropertyName(e);if(findIndexInfo(n,d)){continue}if(isTypeAssignableTo(d,at)){if(isTypeAssignableTo(d,Ve)){r=true;if(!hasEffectiveReadonlyModifier(t)){i=false}}else if(isTypeAssignableTo(d,Ye)){o=true;if(!hasEffectiveReadonlyModifier(t)){a=false}}else{s=true;if(!hasEffectiveReadonlyModifier(t)){c=false}}l.push(t.symbol)}}}const d=concatenate(l,filter(t,(t=>t!==e)));if(s&&!findIndexInfo(n,ze))n.push(getObjectLiteralIndexInfo(c,0,d,ze));if(r&&!findIndexInfo(n,Ve))n.push(getObjectLiteralIndexInfo(i,0,d,Ve));if(o&&!findIndexInfo(n,Ye))n.push(getObjectLiteralIndexInfo(a,0,d,Ye));return n}return d}function isValidIndexKeyType(e){return!!(e.flags&(4|8|4096))||isPatternLiteralType(e)||!!(e.flags&2097152)&&!isGenericType(e)&&some(e.types,isValidIndexKeyType)}function getConstraintDeclaration(e){return mapDefined(filter(e.symbol&&e.symbol.declarations,isTypeParameterDeclaration),getEffectiveConstraintOfTypeParameter)[0]}function getInferredTypeParameterConstraint(e,t){var n;let r;if((n=e.symbol)==null?void 0:n.declarations){for(const n of e.symbol.declarations){if(n.parent.kind===195){const[i=n.parent,o]=walkUpParenthesizedTypesAndGetParentAndChild(n.parent.parent);if(o.kind===183&&!t){const t=o;const n=getTypeParametersForTypeReferenceOrImport(t);if(n){const o=t.typeArguments.indexOf(i);if(o()=>getEffectiveTypeArgumentAtIndex(t,n,r))));const a=instantiateType(i,o);if(a!==e){r=append(r,a)}}}}}else if(o.kind===169&&o.dotDotDotToken||o.kind===191||o.kind===202&&o.dotDotDotToken){r=append(r,createArrayType(Le))}else if(o.kind===204){r=append(r,ze)}else if(o.kind===168&&o.parent.kind===200){r=append(r,at)}else if(o.kind===200&&o.type&&skipParentheses(o.type)===n.parent&&o.parent.kind===194&&o.parent.extendsType===o&&o.parent.checkType.kind===200&&o.parent.checkType.type){const e=o.parent.checkType;const t=getTypeFromTypeNode(e.type);r=append(r,instantiateType(t,makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(e.typeParameter)),e.typeParameter.constraint?getTypeFromTypeNode(e.typeParameter.constraint):at)))}}}}return r&&getIntersectionType(r)}function getConstraintFromTypeParameter(e){if(!e.constraint){if(e.target){const t=getConstraintOfTypeParameter(e.target);e.constraint=t?instantiateType(t,e.mapper):kt}else{const t=getConstraintDeclaration(e);if(!t){e.constraint=getInferredTypeParameterConstraint(e)||kt}else{let n=getTypeFromTypeNode(t);if(n.flags&1&&!isErrorType(n)){n=t.parent.parent.kind===200?at:Le}e.constraint=n}}}return e.constraint===kt?void 0:e.constraint}function getParentSymbolOfTypeParameter(e){const t=getDeclarationOfKind(e.symbol,168);const n=isJSDocTemplateTag(t.parent)?getEffectiveContainerForJSDocTemplateTag(t.parent):t.parent;return n&&getSymbolOfNode(n)}function getTypeListId(e){let t="";if(e){const n=e.length;let r=0;while(r1){t+=":"+o}r+=o}}return t}function getAliasId(e,t){return e?`@${getSymbolId(e)}`+(t?`:${getTypeListId(t)}`:""):""}function getPropagatingFlagsOfTypes(e,t){let n=0;for(const r of e){if(t===void 0||!(r.flags&t)){n|=getObjectFlags(r)}}return n&458752}function tryCreateTypeReference(e,t){if(some(t)&&e===Et){return Le}return createTypeReference(e,t)}function createTypeReference(e,t){const n=getTypeListId(t);let r=e.instantiations.get(n);if(!r){r=createObjectType(4,e.symbol);e.instantiations.set(n,r);r.objectFlags|=t?getPropagatingFlagsOfTypes(t):0;r.target=e;r.resolvedTypeArguments=t}return r}function cloneTypeReference(e){const t=createTypeWithSymbol(e.flags,e.symbol);t.objectFlags=e.objectFlags;t.target=e.target;t.resolvedTypeArguments=e.resolvedTypeArguments;return t}function createDeferredTypeReference(e,t,n,r,i){if(!r){r=getAliasSymbolForTypeNode(t);const e=getTypeArgumentsForAliasSymbol(r);i=n?instantiateTypes(e,n):e}const o=createObjectType(4,e.symbol);o.target=e;o.node=t;o.mapper=n;o.aliasSymbol=r;o.aliasTypeArguments=i;return o}function getTypeArguments(e){var t,n;if(!e.resolvedTypeArguments){if(!pushTypeResolution(e,5)){return concatenate(e.target.outerTypeParameters,(t=e.target.localTypeParameters)==null?void 0:t.map((()=>Ie)))||d}const r=e.node;const i=!r?d:r.kind===183?concatenate(e.target.outerTypeParameters,getEffectiveTypeArguments2(r,e.target.localTypeParameters)):r.kind===188?[getTypeFromTypeNode(r.elementType)]:map(r.elements,getTypeFromTypeNode);if(popTypeResolution()){e.resolvedTypeArguments??(e.resolvedTypeArguments=e.mapper?instantiateTypes(i,e.mapper):i)}else{e.resolvedTypeArguments??(e.resolvedTypeArguments=concatenate(e.target.outerTypeParameters,((n=e.target.localTypeParameters)==null?void 0:n.map((()=>Ie)))||d));error2(e.node||m,e.target.symbol?wt.Type_arguments_for_0_circularly_reference_themselves:wt.Tuple_type_arguments_circularly_reference_themselves,e.target.symbol&&symbolToString(e.target.symbol))}}return e.resolvedTypeArguments}function getTypeReferenceArity(e){return length(e.target.typeParameters)}function getTypeFromClassOrInterfaceReference(e,t){const n=getDeclaredTypeOfSymbol(getMergedSymbol(t));const r=n.localTypeParameters;if(r){const t=length(e.typeArguments);const i=getMinTypeArgumentCount(r);const o=isInJSFile(e);const a=!A&&o;if(!a&&(tr.length)){const t=o&&isExpressionWithTypeArguments(e)&&!isJSDocAugmentsTag(e.parent);const a=i===r.length?t?wt.Expected_0_type_arguments_provide_these_with_an_extends_tag:wt.Generic_type_0_requires_1_type_argument_s:t?wt.Expected_0_1_type_arguments_provide_these_with_an_extends_tag:wt.Generic_type_0_requires_between_1_and_2_type_arguments;const s=typeToString(n,void 0,2);error2(e,a,s,i,r.length);if(!o){return Ie}}if(e.kind===183&&isDeferredTypeReferenceNode(e,length(e.typeArguments)!==r.length)){return createDeferredTypeReference(n,e,void 0)}const s=concatenate(n.outerTypeParameters,fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(e),r,i,o));return createTypeReference(n,s)}return checkNoTypeArguments(e,t)?n:Ie}function getTypeAliasInstantiation(e,t,n,r){const i=getDeclaredTypeOfSymbol(e);if(i===we){const n=sa.get(e.escapedName);if(n!==void 0&&t&&t.length===1){return n===4?getNoInferType(t[0]):getStringMappingType(e,t[0])}}const o=getSymbolLinks(e);const a=o.typeParameters;const s=getTypeListId(t)+getAliasId(n,r);let c=o.instantiations.get(s);if(!c){o.instantiations.set(s,c=instantiateTypeWithAlias(i,createTypeMapper(a,fillMissingTypeArguments(t,a,getMinTypeArgumentCount(a),isInJSFile(e.valueDeclaration))),n,r))}return c}function getTypeFromTypeAliasReference(e,t){if(getCheckFlags(t)&1048576){const n=typeArgumentsFromTypeReferenceNode(e);const r=getAliasId(t,n);let i=Ee.get(r);if(!i){i=createIntrinsicType(1,"error",void 0,`alias ${r}`);i.aliasSymbol=t;i.aliasTypeArguments=n;Ee.set(r,i)}return i}const n=getDeclaredTypeOfSymbol(t);const r=getSymbolLinks(t).typeParameters;if(r){const n=length(e.typeArguments);const i=getMinTypeArgumentCount(r);if(nr.length){error2(e,i===r.length?wt.Generic_type_0_requires_1_type_argument_s:wt.Generic_type_0_requires_between_1_and_2_type_arguments,symbolToString(t),i,r.length);return Ie}const o=getAliasSymbolForTypeNode(e);let a=o&&(isLocalTypeAlias(t)||!isLocalTypeAlias(o))?o:void 0;let s;if(a){s=getTypeArgumentsForAliasSymbol(a)}else if(isTypeReferenceType(e)){const t=resolveTypeReferenceName(e,2097152,true);if(t&&t!==xe){const n=resolveAlias(t);if(n&&n.flags&524288){a=n;s=typeArgumentsFromTypeReferenceNode(e)||(r?[]:void 0)}}}return getTypeAliasInstantiation(t,typeArgumentsFromTypeReferenceNode(e),a,s)}return checkNoTypeArguments(e,t)?n:Ie}function isLocalTypeAlias(e){var t;const n=(t=e.declarations)==null?void 0:t.find(isTypeAlias);return!!(n&&getContainingFunction(n))}function getTypeReferenceName(e){switch(e.kind){case 183:return e.typeName;case 233:const t=e.expression;if(isEntityNameExpression(t)){return t}}return void 0}function getSymbolPath(e){return e.parent?`${getSymbolPath(e.parent)}.${e.escapedName}`:e.escapedName}function getUnresolvedSymbolForEntityName(e){const t=e.kind===166?e.right:e.kind===211?e.name:e;const n=t.escapedText;if(n){const t=e.kind===166?getUnresolvedSymbolForEntityName(e.left):e.kind===211?getUnresolvedSymbolForEntityName(e.expression):void 0;const r=t?`${getSymbolPath(t)}.${n}`:n;let i=Ce.get(r);if(!i){Ce.set(r,i=createSymbol(524288,n,1048576));i.parent=t;i.links.declaredType=Ae}return i}return xe}function resolveTypeReferenceName(e,t,n){const r=getTypeReferenceName(e);if(!r){return xe}const i=resolveEntityName(r,t,n);return i&&i!==xe?i:n?xe:getUnresolvedSymbolForEntityName(r)}function getTypeReferenceType(e,t){if(t===xe){return Ie}t=getExpandoSymbol(t)||t;if(t.flags&(32|64)){return getTypeFromClassOrInterfaceReference(e,t)}if(t.flags&524288){return getTypeFromTypeAliasReference(e,t)}const n=tryGetDeclaredTypeOfSymbol(t);if(n){return checkNoTypeArguments(e,t)?getRegularTypeOfLiteralType(n):Ie}if(t.flags&111551&&isJSDocTypeReference(e)){const n=getTypeFromJSDocValueReference(e,t);if(n){return n}else{resolveTypeReferenceName(e,788968);return getTypeOfSymbol(t)}}return Ie}function getTypeFromJSDocValueReference(e,t){const n=getNodeLinks(e);if(!n.resolvedJSDocType){const r=getTypeOfSymbol(t);let i=r;if(t.valueDeclaration){const n=e.kind===205&&e.qualifier;if(r.symbol&&r.symbol!==t&&n){i=getTypeReferenceType(e,r.symbol)}}n.resolvedJSDocType=i}return n.resolvedJSDocType}function getNoInferType(e){return isNoInferTargetType(e)?getOrCreateSubstitutionType(e,Le):e}function isNoInferTargetType(e){return!!(e.flags&3145728&&some(e.types,isNoInferTargetType)||e.flags&33554432&&!isNoInferType(e)&&isNoInferTargetType(e.baseType)||e.flags&524288&&!isEmptyAnonymousObjectType(e)||e.flags&(465829888&~33554432)&&!isPatternLiteralType(e))}function isNoInferType(e){return!!(e.flags&33554432&&e.constraint.flags&2)}function getSubstitutionType(e,t){return t.flags&3||t===e||e.flags&1?e:getOrCreateSubstitutionType(e,t)}function getOrCreateSubstitutionType(e,t){const n=`${getTypeId(e)}>${getTypeId(t)}`;const r=_e.get(n);if(r){return r}const i=createType(33554432);i.baseType=e;i.constraint=t;_e.set(n,i);return i}function getSubstitutionIntersection(e){return isNoInferType(e)?e.baseType:getIntersectionType([e.constraint,e.baseType])}function isUnaryTupleTypeNode(e){return e.kind===189&&e.elements.length===1}function getImpliedConstraint(e,t,n){return isUnaryTupleTypeNode(t)&&isUnaryTupleTypeNode(n)?getImpliedConstraint(e,t.elements[0],n.elements[0]):getActualTypeVariable(getTypeFromTypeNode(t))===getActualTypeVariable(e)?getTypeFromTypeNode(n):void 0}function getConditionalFlowTypeOfType(e,t){let n;let r=true;while(t&&!isStatement(t)&&t.kind!==320){const i=t.parent;if(i.kind===169){r=!r}if((r||e.flags&8650752)&&i.kind===194&&t===i.trueType){const t=getImpliedConstraint(e,i.checkType,i.extendsType);if(t){n=append(n,t)}}else if(e.flags&262144&&i.kind===200&&!i.nameType&&t===i.type){const t=getTypeFromTypeNode(i);if(getTypeParameterFromMappedType(t)===getActualTypeVariable(e)){const e=getHomomorphicTypeVariable(t);if(e){const t=getConstraintOfTypeParameter(e);if(t&&everyType(t,isArrayOrTupleType)){n=append(n,getUnionType([Ve,lt]))}}}}t=i}return n?getSubstitutionType(e,getIntersectionType(n)):e}function isJSDocTypeReference(e){return!!(e.flags&16777216)&&(e.kind===183||e.kind===205)}function checkNoTypeArguments(e,t){if(e.typeArguments){error2(e,wt.Type_0_is_not_generic,t?symbolToString(t):e.typeName?declarationNameToString(e.typeName):Xo);return false}return true}function getIntendedTypeFromJSDocTypeReference(e){if(isIdentifier(e.typeName)){const t=e.typeArguments;switch(e.typeName.escapedText){case"String":checkNoTypeArguments(e);return ze;case"Number":checkNoTypeArguments(e);return Ve;case"BigInt":checkNoTypeArguments(e);return qe;case"Boolean":checkNoTypeArguments(e);return Xe;case"Void":checkNoTypeArguments(e);return Ze;case"Undefined":checkNoTypeArguments(e);return Me;case"Null":checkNoTypeArguments(e);return We;case"Function":case"function":checkNoTypeArguments(e);return tn;case"array":return(!t||!t.length)&&!A?yn:void 0;case"promise":return(!t||!t.length)&&!A?createPromiseType(ke):void 0;case"Object":if(t&&t.length===2){if(isJSDocIndexSignature(e)){const e=getTypeFromTypeNode(t[0]);const n=getTypeFromTypeNode(t[1]);const r=e===ze||e===Ve?[createIndexInfo(e,n,false)]:d;return createAnonymousType(void 0,y,d,d,r)}return ke}checkNoTypeArguments(e);return!A?ke:void 0}}}function getTypeFromJSDocNullableTypeNode(e){const t=getTypeFromTypeNode(e.type);return k?getNullableType(t,65536):t}function getTypeFromTypeReference(e){const t=getNodeLinks(e);if(!t.resolvedType){if(isConstTypeReference(e)&&isAssertionExpression(e.parent)){t.resolvedSymbol=xe;return t.resolvedType=checkExpressionCached(e.parent.expression)}let n;let r;const i=788968;if(isJSDocTypeReference(e)){r=getIntendedTypeFromJSDocTypeReference(e);if(!r){n=resolveTypeReferenceName(e,i,true);if(n===xe){n=resolveTypeReferenceName(e,i|111551)}else{resolveTypeReferenceName(e,i)}r=getTypeReferenceType(e,n)}}if(!r){n=resolveTypeReferenceName(e,i);r=getTypeReferenceType(e,n)}t.resolvedSymbol=n;t.resolvedType=r}return t.resolvedType}function typeArgumentsFromTypeReferenceNode(e){return map(e.typeArguments,getTypeFromTypeNode)}function getTypeFromTypeQueryNode(e){const t=getNodeLinks(e);if(!t.resolvedType){const n=checkExpressionWithTypeArguments(e);t.resolvedType=getRegularTypeOfLiteralType(getWidenedType(n))}return t.resolvedType}function getTypeOfGlobalSymbol(e,t){function getTypeDeclaration(e){const t=e.declarations;if(t){for(const e of t){switch(e.kind){case 263:case 264:case 266:return e}}}}if(!e){return t?Et:ht}const n=getDeclaredTypeOfSymbol(e);if(!(n.flags&524288)){error2(getTypeDeclaration(e),wt.Global_type_0_must_be_a_class_or_interface_type,symbolName(e));return t?Et:ht}if(length(n.typeParameters)!==t){error2(getTypeDeclaration(e),wt.Global_type_0_must_have_1_type_parameter_s,symbolName(e),t);return t?Et:ht}return n}function getGlobalValueSymbol(e,t){return getGlobalSymbol(e,111551,t?wt.Cannot_find_global_value_0:void 0)}function getGlobalTypeSymbol(e,t){return getGlobalSymbol(e,788968,t?wt.Cannot_find_global_type_0:void 0)}function getGlobalTypeAliasSymbol(e,t,n){const r=getGlobalSymbol(e,788968,n?wt.Cannot_find_global_type_0:void 0);if(r){getDeclaredTypeOfSymbol(r);if(length(getSymbolLinks(r).typeParameters)!==t){const e=r.declarations&&find(r.declarations,isTypeAliasDeclaration);error2(e,wt.Global_type_0_must_have_1_type_parameter_s,symbolName(r),t);return void 0}}return r}function getGlobalSymbol(e,t,n){return te(void 0,e,t,n,false,false)}function getGlobalType(e,t,n){const r=getGlobalTypeSymbol(e,n);return r||n?getTypeOfGlobalSymbol(r,t):void 0}function getGlobalBuiltinTypes(e,t){let n;for(const r of e){n=append(n,getGlobalType(r,t,false))}return n??d}function getGlobalTypedPropertyDescriptorType(){return Cn||(Cn=getGlobalType("TypedPropertyDescriptor",1,true)||Et)}function getGlobalTemplateStringsArrayType(){return Qn||(Qn=getGlobalType("TemplateStringsArray",0,true)||ht)}function getGlobalImportMetaType(){return Xn||(Xn=getGlobalType("ImportMeta",0,true)||ht)}function getGlobalImportMetaExpressionType(){if(!tr){const e=createSymbol(0,"ImportMetaExpression");const t=getGlobalImportMetaType();const n=createSymbol(4,"meta",8);n.parent=e;n.links.type=t;const r=createSymbolTable([n]);e.members=r;tr=createAnonymousType(e,r,d,d,d)}return tr}function getGlobalImportCallOptionsType(e){return nr||(nr=getGlobalType("ImportCallOptions",0,e))||ht}function getGlobalImportAttributesType(e){return rr||(rr=getGlobalType("ImportAttributes",0,e))||ht}function getGlobalESSymbolConstructorSymbol(e){return vn||(vn=getGlobalValueSymbol("Symbol",e))}function getGlobalESSymbolConstructorTypeSymbol(e){return xn||(xn=getGlobalTypeSymbol("SymbolConstructor",e))}function getGlobalESSymbolType(){return bn||(bn=getGlobalType("Symbol",0,false))||ht}function getGlobalPromiseType(e){return En||(En=getGlobalType("Promise",1,e))||Et}function getGlobalPromiseLikeType(e){return Nn||(Nn=getGlobalType("PromiseLike",1,e))||Et}function getGlobalPromiseConstructorSymbol(e){return kn||(kn=getGlobalValueSymbol("Promise",e))}function getGlobalPromiseConstructorLikeType(e){return Fn||(Fn=getGlobalType("PromiseConstructorLike",0,e))||ht}function getGlobalAsyncIterableType(e){return Mn||(Mn=getGlobalType("AsyncIterable",3,e))||Et}function getGlobalAsyncIteratorType(e){return Bn||(Bn=getGlobalType("AsyncIterator",3,e))||Et}function getGlobalAsyncIterableIteratorType(e){return jn||(jn=getGlobalType("AsyncIterableIterator",3,e))||Et}function getGlobalBuiltinAsyncIteratorTypes(){return Wn??(Wn=getGlobalBuiltinTypes(["ReadableStreamAsyncIterator"],1))}function getGlobalAsyncIteratorObjectType(e){return Un||(Un=getGlobalType("AsyncIteratorObject",3,e))||Et}function getGlobalAsyncGeneratorType(e){return Hn||(Hn=getGlobalType("AsyncGenerator",3,e))||Et}function getGlobalIterableType(e){return Pn||(Pn=getGlobalType("Iterable",3,e))||Et}function getGlobalIteratorType(e){return Dn||(Dn=getGlobalType("Iterator",3,e))||Et}function getGlobalIterableIteratorType(e){return In||(In=getGlobalType("IterableIterator",3,e))||Et}function getBuiltinIteratorReturnType(){return I?Me:ke}function getGlobalBuiltinIteratorTypes(){return Jn??(Jn=getGlobalBuiltinTypes(["ArrayIterator","MapIterator","SetIterator","StringIterator"],1))}function getGlobalIteratorObjectType(e){return An||(An=getGlobalType("IteratorObject",3,e))||Et}function getGlobalGeneratorType(e){return On||(On=getGlobalType("Generator",3,e))||Et}function getGlobalIteratorYieldResultType(e){return wn||(wn=getGlobalType("IteratorYieldResult",1,e))||Et}function getGlobalIteratorReturnResultType(e){return Ln||(Ln=getGlobalType("IteratorReturnResult",1,e))||Et}function getGlobalDisposableType(e){return ar||(ar=getGlobalType("Disposable",0,e))||ht}function getGlobalAsyncDisposableType(e){return sr||(sr=getGlobalType("AsyncDisposable",0,e))||ht}function getGlobalTypeOrUndefined(e,t=0){const n=getGlobalSymbol(e,788968,void 0);return n&&getTypeOfGlobalSymbol(n,t)}function getGlobalExtractSymbol(){cr||(cr=getGlobalTypeAliasSymbol("Extract",2,true)||xe);return cr===xe?void 0:cr}function getGlobalOmitSymbol(){lr||(lr=getGlobalTypeAliasSymbol("Omit",2,true)||xe);return lr===xe?void 0:lr}function getGlobalAwaitedSymbol(e){dr||(dr=getGlobalTypeAliasSymbol("Awaited",1,e)||(e?xe:void 0));return dr===xe?void 0:dr}function getGlobalBigIntType(){return pr||(pr=getGlobalType("BigInt",0,false))||ht}function getGlobalClassDecoratorContextType(e){return mr??(mr=getGlobalType("ClassDecoratorContext",1,e))??Et}function getGlobalClassMethodDecoratorContextType(e){return _r??(_r=getGlobalType("ClassMethodDecoratorContext",2,e))??Et}function getGlobalClassGetterDecoratorContextType(e){return gr??(gr=getGlobalType("ClassGetterDecoratorContext",2,e))??Et}function getGlobalClassSetterDecoratorContextType(e){return yr??(yr=getGlobalType("ClassSetterDecoratorContext",2,e))??Et}function getGlobalClassAccessorDecoratorContextType(e){return hr??(hr=getGlobalType("ClassAccessorDecoratorContext",2,e))??Et}function getGlobalClassAccessorDecoratorTargetType(e){return Tr??(Tr=getGlobalType("ClassAccessorDecoratorTarget",2,e))??Et}function getGlobalClassAccessorDecoratorResultType(e){return Sr??(Sr=getGlobalType("ClassAccessorDecoratorResult",2,e))??Et}function getGlobalClassFieldDecoratorContextType(e){return vr??(vr=getGlobalType("ClassFieldDecoratorContext",2,e))??Et}function getGlobalNaNSymbol(){return ur||(ur=getGlobalValueSymbol("NaN",false))}function getGlobalRecordSymbol(){fr||(fr=getGlobalTypeAliasSymbol("Record",2,true)||xe);return fr===xe?void 0:fr}function createTypeFromGenericGlobalType(e,t){return e!==Et?createTypeReference(e,t):ht}function createTypedPropertyDescriptorType(e){return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(),[e])}function createIterableType(e){return createTypeFromGenericGlobalType(getGlobalIterableType(true),[e,Ze,Me])}function createArrayType(e,t){return createTypeFromGenericGlobalType(t?an:on,[e])}function getTupleElementFlags(e){switch(e.kind){case 190:return 2;case 191:return getRestTypeElementFlags(e);case 202:return e.questionToken?2:e.dotDotDotToken?getRestTypeElementFlags(e):1;default:return 1}}function getRestTypeElementFlags(e){return getArrayElementTypeNode(e.type)?4:8}function getArrayOrTupleTargetType(e){const t=isReadonlyTypeOperator(e.parent);const n=getArrayElementTypeNode(e);if(n){return t?an:on}const r=map(e.elements,getTupleElementFlags);return getTupleTargetType(r,t,map(e.elements,memberIfLabeledElementDeclaration))}function memberIfLabeledElementDeclaration(e){return isNamedTupleMember(e)||isParameter(e)?e:void 0}function isDeferredTypeReferenceNode(e,t){return!!getAliasSymbolForTypeNode(e)||isResolvedByTypeAlias(e)&&(e.kind===188?mayResolveTypeAlias(e.elementType):e.kind===189?some(e.elements,mayResolveTypeAlias):t||some(e.typeArguments,mayResolveTypeAlias))}function isResolvedByTypeAlias(e){const t=e.parent;switch(t.kind){case 196:case 202:case 183:case 192:case 193:case 199:case 194:case 198:case 188:case 189:return isResolvedByTypeAlias(t);case 265:return true}return false}function mayResolveTypeAlias(e){switch(e.kind){case 183:return isJSDocTypeReference(e)||!!(resolveTypeReferenceName(e,788968).flags&524288);case 186:return true;case 198:return e.operator!==158&&mayResolveTypeAlias(e.type);case 196:case 190:case 202:case 316:case 314:case 315:case 309:return mayResolveTypeAlias(e.type);case 191:return e.type.kind!==188||mayResolveTypeAlias(e.type.elementType);case 192:case 193:return some(e.types,mayResolveTypeAlias);case 199:return mayResolveTypeAlias(e.objectType)||mayResolveTypeAlias(e.indexType);case 194:return mayResolveTypeAlias(e.checkType)||mayResolveTypeAlias(e.extendsType)||mayResolveTypeAlias(e.trueType)||mayResolveTypeAlias(e.falseType)}return false}function getTypeFromArrayOrTupleTypeNode(e){const t=getNodeLinks(e);if(!t.resolvedType){const n=getArrayOrTupleTargetType(e);if(n===Et){t.resolvedType=ht}else if(!(e.kind===189&&some(e.elements,(e=>!!(getTupleElementFlags(e)&8))))&&isDeferredTypeReferenceNode(e)){t.resolvedType=e.kind===189&&e.elements.length===0?n:createDeferredTypeReference(n,e,void 0)}else{const r=e.kind===188?[getTypeFromTypeNode(e.elementType)]:map(e.elements,getTypeFromTypeNode);t.resolvedType=createNormalizedTypeReference(n,r)}}return t.resolvedType}function isReadonlyTypeOperator(e){return isTypeOperatorNode(e)&&e.operator===148}function createTupleType(e,t,n=false,r=[]){const i=getTupleTargetType(t||map(e,(e=>1)),n,r);return i===Et?ht:e.length?createNormalizedTypeReference(i,e):i}function getTupleTargetType(e,t,n){if(e.length===1&&e[0]&4){return t?an:on}const r=map(e,(e=>e&1?"#":e&2?"?":e&4?".":"*")).join()+(t?"R":"")+(some(n,(e=>!!e))?","+map(n,(e=>e?getNodeId(e):"_")).join(","):"");let i=ie.get(r);if(!i){ie.set(r,i=createTupleTargetType(e,t,n))}return i}function createTupleTargetType(e,t,n){const r=e.length;const i=countWhere(e,(e=>!!(e&(1|8))));let o;const a=[];let s=0;if(r){o=new Array(r);for(let i=0;i!!(e.elementFlags[n]&8&&t.flags&(131072|1048576))));if(n>=0){return checkCrossProductUnion(map(t,((t,n)=>e.elementFlags[n]&8?t:Le)))?mapType(t[n],(r=>createNormalizedTupleType(e,replaceElement(t,n,r)))):Ie}}const a=[];const s=[];const c=[];let l=-1;let d=-1;let p=-1;for(let s=0;s=1e4){error2(m,isPartOfTypeNode(m)?wt.Type_produces_a_tuple_type_that_is_too_large_to_represent:wt.Expression_produces_a_tuple_type_that_is_too_large_to_represent);return Ie}forEach(e,((e,t)=>{var n;return addElement(e,c.target.elementFlags[t],(n=c.target.labeledElementDeclarations)==null?void 0:n[t])}))}else{addElement(isArrayLikeType(c)&&getIndexTypeOfType(c,Ve)||Ie,4,(i=e.labeledElementDeclarations)==null?void 0:i[s])}}else{addElement(c,l,(o=e.labeledElementDeclarations)==null?void 0:o[s])}}for(let e=0;e=0&&ds[d+t]&8?getIndexedAccessType(e,Ve):e)));a.splice(d+1,p-d);s.splice(d+1,p-d);c.splice(d+1,p-d)}const u=getTupleTargetType(s,e.readonly,c);return u===Et?ht:s.length?createTypeReference(u,a):u;function addElement(e,t,n){if(t&1){l=s.length}if(t&4&&d<0){d=s.length}if(t&(2|4)){p=s.length}a.push(t&2?addOptionality(e,true):e);s.push(t);c.push(n)}}function sliceTupleType(e,t,n=0){const r=e.target;const i=getTypeReferenceArity(e)-n;return t>r.fixedLength?getRestArrayTypeOfTupleType(e)||createTupleType(d):createTupleType(getTypeArguments(e).slice(t,i),r.elementFlags.slice(t,i),false,r.labeledElementDeclarations&&r.labeledElementDeclarations.slice(t,i))}function getKnownKeysOfTupleType(e){return getUnionType(append(arrayOf(e.target.fixedLength,(e=>getStringLiteralType(""+e))),getIndexType(e.target.readonly?an:on)))}function getStartElementCount(e,t){const n=findIndex(e.elementFlags,(e=>!(e&t)));return n>=0?n:e.elementFlags.length}function getEndElementCount(e,t){return e.elementFlags.length-findLastIndex(e.elementFlags,(e=>!(e&t)))-1}function getTotalFixedElementCount(e){return e.fixedLength+getEndElementCount(e,3)}function getElementTypes(e){const t=getTypeArguments(e);const n=getTypeReferenceArity(e);return t.length===n?t:t.slice(0,n)}function getTypeFromOptionalTypeNode(e){return addOptionality(getTypeFromTypeNode(e.type),true)}function getTypeId(e){return e.id}function containsType(e,t){return binarySearch(e,t,getTypeId,compareValues)>=0}function insertType(e,t){const n=binarySearch(e,t,getTypeId,compareValues);if(n<0){e.splice(~n,0,t);return true}return false}function addTypeToUnion(e,t,n){const r=n.flags;if(!(r&131072)){t|=r&473694207;if(r&465829888)t|=33554432;if(r&2097152&&getObjectFlags(n)&67108864)t|=536870912;if(n===Pe)t|=8388608;if(isErrorType(n))t|=1073741824;if(!k&&r&98304){if(!(getObjectFlags(n)&65536))t|=4194304}else{const t=e.length;const r=t&&n.id>e[t-1].id?~t:binarySearch(e,n,getTypeId,compareValues);if(r<0){e.splice(~r,0,n)}}}return t}function addTypesToUnion(e,t,n){let r;for(const i of n){if(i!==r){t=i.flags&1048576?addTypesToUnion(e,t|(isNamedUnionType(i)?1048576:0),i.types):addTypeToUnion(e,t,i);r=i}}return t}function removeSubtypes(e,t){var n;if(e.length<2){return e}const r=getTypeListId(e);const i=ge.get(r);if(i){return i}const o=t&&some(e,(e=>!!(e.flags&524288)&&!isGenericMappedType(e)&&isEmptyResolvedType(resolveStructuredTypeMembers(e))));const a=e.length;let s=a;let c=0;while(s>0){s--;const t=e[s];if(o||t.flags&469499904){if(t.flags&262144&&getBaseConstraintOrType(t).flags&1048576){if(isTypeRelatedTo(t,getUnionType(map(e,(e=>e===t?et:e))),xi)){orderedRemoveItemAt(e,s)}continue}const r=t.flags&(524288|2097152|58982400)?find(getPropertiesOfType(t),(e=>isUnitType(getTypeOfSymbol(e)))):void 0;const i=r&&getRegularTypeOfLiteralType(getTypeOfSymbol(r));for(const o of e){if(t!==o){if(c===1e5){const t=c/(a-s)*a;if(t>1e6){(n=G)==null?void 0:n.instant(G.Phase.CheckTypes,"removeSubtypes_DepthLimit",{typeIds:e.map((e=>e.id))});error2(m,wt.Expression_produces_a_union_type_that_is_too_complex_to_represent);return void 0}}c++;if(r&&o.flags&(524288|2097152|58982400)){const e=getTypeOfPropertyOfType(o,r.escapedName);if(e&&isUnitType(e)&&getRegularTypeOfLiteralType(e)!==i){continue}}if(isTypeRelatedTo(t,o,xi)&&(!(getObjectFlags(getTargetType(t))&1)||!(getObjectFlags(getTargetType(o))&1)||isTypeDerivedFrom(t,o))){orderedRemoveItemAt(e,s);break}}}}}ge.set(r,e);return e}function removeRedundantLiteralTypes(e,t,n){let r=e.length;while(r>0){r--;const i=e[r];const o=i.flags;const a=o&(128|134217728|268435456)&&t&4||o&256&&t&8||o&2048&&t&64||o&8192&&t&4096||n&&o&32768&&t&16384||isFreshLiteralType(i)&&containsType(e,i.regularType);if(a){orderedRemoveItemAt(e,r)}}}function removeStringLiteralsMatchedByTemplateLiterals(e){const t=filter(e,isPatternLiteralType);if(t.length){let n=e.length;while(n>0){n--;const r=e[n];if(r.flags&128&&some(t,(e=>isTypeMatchedByTemplateLiteralOrStringMapping(r,e)))){orderedRemoveItemAt(e,n)}}}}function isTypeMatchedByTemplateLiteralOrStringMapping(e,t){return t.flags&134217728?isTypeMatchedByTemplateLiteralType(e,t):isMemberOfStringMapping(e,t)}function removeConstrainedTypeVariables(e){const t=[];for(const n of e){if(n.flags&2097152&&getObjectFlags(n)&67108864){const e=n.types[0].flags&8650752?0:1;pushIfUnique(t,n.types[e])}}for(const n of t){const t=[];for(const r of e){if(r.flags&2097152&&getObjectFlags(r)&67108864){const e=r.types[0].flags&8650752?0:1;if(r.types[e]===n){insertType(t,r.types[1-e])}}}const r=getBaseConstraintOfType(n);if(everyType(r,(e=>containsType(t,e)))){let r=e.length;while(r>0){r--;const i=e[r];if(i.flags&2097152&&getObjectFlags(i)&67108864){const o=i.types[0].flags&8650752?0:1;if(i.types[o]===n&&containsType(t,i.types[1-o])){orderedRemoveItemAt(e,r)}}}insertType(e,n)}}}function isNamedUnionType(e){return!!(e.flags&1048576&&(e.aliasSymbol||e.origin))}function addNamedUnions(e,t){for(const n of t){if(n.flags&1048576){const t=n.origin;if(n.aliasSymbol||t&&!(t.flags&1048576)){pushIfUnique(e,n)}else if(t&&t.flags&1048576){addNamedUnions(e,t.types)}}}}function createOriginUnionOrIntersectionType(e,t){const n=createOriginType(e);n.types=t;return n}function getUnionType(e,t=1,n,r,i){if(e.length===0){return et}if(e.length===1){return e[0]}if(e.length===2&&!i&&(e[0].flags&1048576||e[1].flags&1048576)){const i=t===0?"N":t===2?"S":"L";const o=e[0].id=2&&o[0]===Me&&o[1]===Be){orderedRemoveItemAt(o,1)}}if(a&(32|2944|8192|134217728|268435456)||a&16384&&a&32768){removeRedundantLiteralTypes(o,a,!!(t&2))}if(a&128&&a&(134217728|268435456)){removeStringLiteralsMatchedByTemplateLiterals(o)}if(a&536870912){removeConstrainedTypeVariables(o)}if(t===2){o=removeSubtypes(o,!!(a&524288));if(!o){return Ie}}if(o.length===0){return a&65536?a&4194304?We:Ue:a&32768?a&4194304?Me:Re:et}}if(!i&&a&1048576){const t=[];addNamedUnions(t,e);const r=[];for(const e of o){if(!some(t,(t=>containsType(t.types,e)))){r.push(e)}}if(!n&&t.length===1&&r.length===0){return t[0]}const a=reduceLeft(t,((e,t)=>e+t.types.length),0);if(a+r.length===o.length){for(const e of t){insertType(r,e)}i=createOriginUnionOrIntersectionType(1048576,r)}}const s=(a&36323331?0:32768)|(a&2097152?16777216:0);return getUnionTypeFromSortedList(o,s,n,r,i)}function getUnionOrIntersectionTypePredicate(e,t){let n;const r=[];for(const i of e){const e=getTypePredicateOfSignature(i);if(e){if(e.kind!==0&&e.kind!==1||n&&!typePredicateKindsMatch(n,e)){return void 0}n=e;r.push(e.type)}else{const e=t!==2097152?getReturnTypeOfSignature(i):void 0;if(e!==He&&e!==Ge){return void 0}}}if(!n){return void 0}const i=getUnionOrIntersectionType(r,t);return createTypePredicate(n.kind,n.parameterName,n.parameterIndex,i)}function typePredicateKindsMatch(e,t){return e.kind===t.kind&&e.parameterIndex===t.parameterIndex}function getUnionTypeFromSortedList(e,t,n,r,i){if(e.length===0){return et}if(e.length===1){return e[0]}const o=!i?getTypeListId(e):i.flags&1048576?`|${getTypeListId(i.types)}`:i.flags&2097152?`&${getTypeListId(i.types)}`:`#${i.type.id}|${getTypeListId(e)}`;const a=o+getAliasId(n,r);let s=oe.get(a);if(!s){s=createType(1048576);s.objectFlags=t|getPropagatingFlagsOfTypes(e,98304);s.types=e;s.origin=i;s.aliasSymbol=n;s.aliasTypeArguments=r;if(e.length===2&&e[0].flags&512&&e[1].flags&512){s.flags|=16;s.intrinsicName="boolean"}oe.set(a,s)}return s}function getTypeFromUnionTypeNode(e){const t=getNodeLinks(e);if(!t.resolvedType){const n=getAliasSymbolForTypeNode(e);t.resolvedType=getUnionType(map(e.types,getTypeFromTypeNode),1,n,getTypeArgumentsForAliasSymbol(n))}return t.resolvedType}function addTypeToIntersection(e,t,n){const r=n.flags;if(r&2097152){return addTypesToIntersection(e,t,n.types)}if(isEmptyAnonymousObjectType(n)){if(!(t&16777216)){t|=16777216;e.set(n.id.toString(),n)}}else{if(r&3){if(n===Pe)t|=8388608;if(isErrorType(n))t|=1073741824}else if(k||!(r&98304)){if(n===Be){t|=262144;n=Me}if(!e.has(n.id.toString())){if(n.flags&109472&&t&109472){t|=67108864}e.set(n.id.toString(),n)}}t|=r&473694207}return t}function addTypesToIntersection(e,t,n){for(const r of n){t=addTypeToIntersection(e,t,getRegularTypeOfLiteralType(r))}return t}function removeRedundantSupertypes(e,t){let n=e.length;while(n>0){n--;const r=e[n];const i=r.flags&4&&t&(128|134217728|268435456)||r.flags&8&&t&256||r.flags&64&&t&2048||r.flags&4096&&t&8192||r.flags&16384&&t&32768||isEmptyAnonymousObjectType(r)&&t&470302716;if(i){orderedRemoveItemAt(e,n)}}}function eachUnionContains(e,t){for(const n of e){if(!containsType(n.types,t)){if(t===Be){return containsType(n.types,Me)}if(t===Me){return containsType(n.types,Be)}const e=t.flags&128?ze:t.flags&(32|256)?Ve:t.flags&2048?qe:t.flags&8192?Ye:void 0;if(!e||!containsType(n.types,e)){return false}}}return true}function extractRedundantTemplateLiterals(e){let t=e.length;const n=filter(e,(e=>!!(e.flags&128)));while(t>0){t--;const r=e[t];if(!(r.flags&(134217728|268435456)))continue;for(const i of n){if(isTypeSubtypeOf(i,r)){orderedRemoveItemAt(e,t);break}else if(isPatternLiteralType(r)){return true}}}return false}function removeFromEach(e,t){for(let n=0;n!(e.flags&t)))}}function intersectUnionsOfPrimitiveTypes(e){let t;const n=findIndex(e,(e=>!!(getObjectFlags(e)&32768)));if(n<0){return false}let r=n+1;while(r!!(e.flags&(402784252|67108864))||isEmptyAnonymousObjectType(e)))){if(isTypeStrictSubtypeOf(e,n)){return t}if(!(e.flags&1048576&&someType(e,(e=>isTypeStrictSubtypeOf(e,n))))){if(!isTypeStrictSubtypeOf(n,e)){return et}}s=67108864}}}const c=getTypeListId(a)+(t&2?"*":getAliasId(n,r));let l=se.get(c);if(!l){if(o&1048576){if(intersectUnionsOfPrimitiveTypes(a)){l=getIntersectionType(a,t,n,r)}else if(every(a,(e=>!!(e.flags&1048576&&e.types[0].flags&32768)))){const e=some(a,containsMissingType)?Be:Me;removeFromEach(a,32768);l=getUnionType([getIntersectionType(a,t),e],1,n,r)}else if(every(a,(e=>!!(e.flags&1048576&&(e.types[0].flags&65536||e.types[1].flags&65536))))){removeFromEach(a,65536);l=getUnionType([getIntersectionType(a,t),We],1,n,r)}else if(a.length>=3&&e.length>2){const e=Math.floor(a.length/2);l=getIntersectionType([getIntersectionType(a.slice(0,e),t),getIntersectionType(a.slice(e),t)],t,n,r)}else{if(!checkCrossProductUnion(a)){return Ie}const e=getCrossProductIntersections(a,t);const i=some(e,(e=>!!(e.flags&2097152)))&&getConstituentCountOfTypes(e)>getConstituentCountOfTypes(a)?createOriginUnionOrIntersectionType(2097152,a):void 0;l=getUnionType(e,1,n,r,i)}}else{l=createIntersectionType(a,s,n,r)}se.set(c,l)}return l}function getCrossProductUnionSize(e){return reduceLeft(e,((e,t)=>t.flags&1048576?e*t.types.length:t.flags&131072?0:e),1)}function checkCrossProductUnion(e){var t;const n=getCrossProductUnionSize(e);if(n>=1e5){(t=G)==null?void 0:t.instant(G.Phase.CheckTypes,"checkCrossProductUnion_DepthLimit",{typeIds:e.map((e=>e.id)),size:n});error2(m,wt.Expression_produces_a_union_type_that_is_too_complex_to_represent);return false}return true}function getCrossProductIntersections(e,t){const n=getCrossProductUnionSize(e);const r=[];for(let i=0;i=0;t--){if(e[t].flags&1048576){const r=e[t].types;const i=r.length;n[t]=r[o%i];o=Math.floor(o/i)}}const a=getIntersectionType(n,t);if(!(a.flags&131072))r.push(a)}return r}function getConstituentCount(e){return!(e.flags&3145728)||e.aliasSymbol?1:e.flags&1048576&&e.origin?getConstituentCount(e.origin):getConstituentCountOfTypes(e.types)}function getConstituentCountOfTypes(e){return reduceLeft(e,((e,t)=>e+getConstituentCount(t)),0)}function getTypeFromIntersectionTypeNode(e){const t=getNodeLinks(e);if(!t.resolvedType){const n=getAliasSymbolForTypeNode(e);const r=map(e.types,getTypeFromTypeNode);const i=r.length===2?r.indexOf(xt):-1;const o=i>=0?r[1-i]:Le;const a=!!(o.flags&(4|8|64)||o.flags&134217728&&isPatternLiteralType(o));t.resolvedType=getIntersectionType(r,a?1:0,n,getTypeArgumentsForAliasSymbol(n))}return t.resolvedType}function createIndexType(e,t){const n=createType(4194304);n.type=e;n.indexFlags=t;return n}function createOriginIndexType(e){const t=createOriginType(4194304);t.type=e;return t}function getIndexTypeForGenericType(e,t){return t&1?e.resolvedStringIndexType||(e.resolvedStringIndexType=createIndexType(e,1)):e.resolvedIndexType||(e.resolvedIndexType=createIndexType(e,0))}function getIndexTypeForMappedType(e,t){const n=getTypeParameterFromMappedType(e);const r=getConstraintTypeFromMappedType(e);const i=getNameTypeFromMappedType(e.target||e);if(!i&&!(t&2)){return r}const o=[];if(isGenericIndexType(r)){if(isMappedTypeWithKeyofConstraintDeclaration(e)){return getIndexTypeForGenericType(e,t)}forEachType(r,addMemberForKeyType)}else if(isMappedTypeWithKeyofConstraintDeclaration(e)){const n=getApparentType(getModifiersTypeFromMappedType(e));forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(n,8576,!!(t&1),addMemberForKeyType)}else{forEachType(getLowerBoundOfKeyType(r),addMemberForKeyType)}const a=t&2?filterType(getUnionType(o),(e=>!(e.flags&(1|4)))):getUnionType(o);if(a.flags&1048576&&r.flags&1048576&&getTypeListId(a.types)===getTypeListId(r.types)){return r}return a;function addMemberForKeyType(t){const r=i?instantiateType(i,appendTypeMapping(e.mapper,n,t)):t;o.push(r===ze?ot:r)}}function hasDistributiveNameType(e){const t=getTypeParameterFromMappedType(e);return isDistributive(getNameTypeFromMappedType(e)||t);function isDistributive(e){return e.flags&(3|402784252|131072|262144|524288|67108864)?true:e.flags&16777216?e.root.isDistributive&&e.checkType===t:e.flags&(3145728|134217728)?every(e.types,isDistributive):e.flags&8388608?isDistributive(e.objectType)&&isDistributive(e.indexType):e.flags&33554432?isDistributive(e.baseType)&&isDistributive(e.constraint):e.flags&268435456?isDistributive(e.type):false}}function getLiteralTypeFromPropertyName(e){if(isPrivateIdentifier(e)){return et}if(isNumericLiteral(e)){return getRegularTypeOfLiteralType(checkExpression(e))}if(isComputedPropertyName(e)){return getRegularTypeOfLiteralType(checkComputedPropertyName(e))}const t=getPropertyNameForPropertyNameNode(e);if(t!==void 0){return getStringLiteralType(unescapeLeadingUnderscores(t))}if(isExpression(e)){return getRegularTypeOfLiteralType(checkExpression(e))}return et}function getLiteralTypeFromProperty(e,t,n){if(n||!(getDeclarationModifierFlagsFromSymbol(e)&6)){let n=getSymbolLinks(getLateBoundSymbol(e)).nameType;if(!n){const t=getNameOfDeclaration(e.valueDeclaration);n=e.escapedName==="default"?getStringLiteralType("default"):t&&getLiteralTypeFromPropertyName(t)||(!isKnownSymbol(e)?getStringLiteralType(symbolName(e)):void 0)}if(n&&n.flags&t){return n}}return et}function isKeyTypeIncluded(e,t){return!!(e.flags&t||e.flags&2097152&&some(e.types,(e=>isKeyTypeIncluded(e,t))))}function getLiteralTypeFromProperties(e,t,n){const r=n&&(getObjectFlags(e)&(3|4)||e.aliasSymbol)?createOriginIndexType(e):void 0;const i=map(getPropertiesOfType(e),(e=>getLiteralTypeFromProperty(e,t)));const o=map(getIndexInfosOfType(e),(e=>e!==Wt&&isKeyTypeIncluded(e.keyType,t)?e.keyType===ze&&t&8?ot:e.keyType:et));return getUnionType(concatenate(i,o),1,void 0,void 0,r)}function shouldDeferIndexType(e,t=0){return!!(e.flags&58982400||isGenericTupleType(e)||isGenericMappedType(e)&&(!hasDistributiveNameType(e)||getMappedTypeNameTypeKind(e)===2)||e.flags&1048576&&!(t&4)&&isGenericReducibleType(e)||e.flags&2097152&&maybeTypeOfKind(e,465829888)&&some(e.types,isEmptyAnonymousObjectType))}function getIndexType(e,t=0){e=getReducedType(e);return isNoInferType(e)?getNoInferType(getIndexType(e.baseType,t)):shouldDeferIndexType(e,t)?getIndexTypeForGenericType(e,t):e.flags&1048576?getIntersectionType(map(e.types,(e=>getIndexType(e,t)))):e.flags&2097152?getUnionType(map(e.types,(e=>getIndexType(e,t)))):getObjectFlags(e)&32?getIndexTypeForMappedType(e,t):e===Pe?Pe:e.flags&2?et:e.flags&(1|131072)?at:getLiteralTypeFromProperties(e,(t&2?128:402653316)|(t&1?0:296|12288),t===0)}function getExtractStringType(e){const t=getGlobalExtractSymbol();return t?getTypeAliasInstantiation(t,[e,ze]):ze}function getIndexTypeOrString(e){const t=getExtractStringType(getIndexType(e));return t.flags&131072?ze:t}function getTypeFromTypeOperatorNode(e){const t=getNodeLinks(e);if(!t.resolvedType){switch(e.operator){case 143:t.resolvedType=getIndexType(getTypeFromTypeNode(e.type));break;case 158:t.resolvedType=e.type.kind===155?getESSymbolLikeTypeForNode(walkUpParenthesizedTypes(e.parent)):Ie;break;case 148:t.resolvedType=getTypeFromTypeNode(e.type);break;default:S.assertNever(e.operator)}}return t.resolvedType}function getTypeFromTemplateTypeNode(e){const t=getNodeLinks(e);if(!t.resolvedType){t.resolvedType=getTemplateLiteralType([e.head.text,...map(e.templateSpans,(e=>e.literal.text))],map(e.templateSpans,(e=>getTypeFromTypeNode(e.type))))}return t.resolvedType}function getTemplateLiteralType(e,t){const n=findIndex(t,(e=>!!(e.flags&(131072|1048576))));if(n>=0){return checkCrossProductUnion(t)?mapType(t[n],(r=>getTemplateLiteralType(e,replaceElement(t,n,r)))):Ie}if(contains(t,Pe)){return Pe}const r=[];const i=[];let o=e[0];if(!addSpans(e,t)){return ze}if(r.length===0){return getStringLiteralType(o)}i.push(o);if(every(i,(e=>e===""))){if(every(r,(e=>!!(e.flags&4)))){return ze}if(r.length===1&&isPatternLiteralType(r[0])){return r[0]}}const a=`${getTypeListId(r)}|${map(i,(e=>e.length)).join(",")}|${i.join("")}`;let s=fe.get(a);if(!s){fe.set(a,s=createTemplateLiteralType(i,r))}return s;function addSpans(e,t){for(let n=0;ngetStringMappingType(e,t))):t.flags&128?getStringLiteralType(applyStringMapping(e,t.value)):t.flags&134217728?getTemplateLiteralType(...applyTemplateStringMapping(e,t.texts,t.types)):t.flags&268435456&&e===t.symbol?t:t.flags&(1|4|268435456)||isGenericIndexType(t)?getStringMappingTypeForGenericType(e,t):isPatternLiteralPlaceholderType(t)?getStringMappingTypeForGenericType(e,getTemplateLiteralType(["",""],[t])):t}function applyStringMapping(e,t){switch(sa.get(e.escapedName)){case 0:return t.toUpperCase();case 1:return t.toLowerCase();case 2:return t.charAt(0).toUpperCase()+t.slice(1);case 3:return t.charAt(0).toLowerCase()+t.slice(1)}return t}function applyTemplateStringMapping(e,t,n){switch(sa.get(e.escapedName)){case 0:return[t.map((e=>e.toUpperCase())),n.map((t=>getStringMappingType(e,t)))];case 1:return[t.map((e=>e.toLowerCase())),n.map((t=>getStringMappingType(e,t)))];case 2:return[t[0]===""?t:[t[0].charAt(0).toUpperCase()+t[0].slice(1),...t.slice(1)],t[0]===""?[getStringMappingType(e,n[0]),...n.slice(1)]:n];case 3:return[t[0]===""?t:[t[0].charAt(0).toLowerCase()+t[0].slice(1),...t.slice(1)],t[0]===""?[getStringMappingType(e,n[0]),...n.slice(1)]:n]}return[t,n]}function getStringMappingTypeForGenericType(e,t){const n=`${getSymbolId(e)},${getTypeId(t)}`;let r=me.get(n);if(!r){me.set(n,r=createStringMappingType(e,t))}return r}function createStringMappingType(e,t){const n=createTypeWithSymbol(268435456,e);n.type=t;return n}function createIndexedAccessType(e,t,n,r,i){const o=createType(8388608);o.objectType=e;o.indexType=t;o.accessFlags=n;o.aliasSymbol=r;o.aliasTypeArguments=i;return o}function isJSLiteralType(e){if(A){return false}if(getObjectFlags(e)&4096){return true}if(e.flags&1048576){return every(e.types,isJSLiteralType)}if(e.flags&2097152){return some(e.types,isJSLiteralType)}if(e.flags&465829888){const t=getResolvedBaseConstraint(e);return t!==e&&isJSLiteralType(t)}return false}function getPropertyNameFromIndex(e,t){return isTypeUsableAsPropertyName(e)?getPropertyNameFromType(e):t&&isPropertyName(t)?getPropertyNameForPropertyNameNode(t):void 0}function isUncalledFunctionReference(e,t){if(t.flags&(16|8192)){const n=findAncestor(e.parent,(e=>!isAccessExpression(e)))||e.parent;if(isCallLikeExpression(n)){return isCallOrNewExpression(n)&&isIdentifier(e)&&hasMatchingArgument(n,e)}return every(t.declarations,(e=>!isFunctionLike(e)||isDeprecatedDeclaration2(e)))}return true}function getPropertyTypeForIndexType(e,t,n,r,i,o){const a=i&&i.kind===212?i:void 0;const s=i&&isPrivateIdentifier(i)?void 0:getPropertyNameFromIndex(n,i);if(s!==void 0){if(o&256){return getTypeOfPropertyOfContextualType(t,s)||ke}const e=getPropertyOfType(t,s);if(e){if(o&64&&i&&e.declarations&&isDeprecatedSymbol(e)&&isUncalledFunctionReference(i,e)){const t=(a==null?void 0:a.argumentExpression)??(isIndexedAccessTypeNode(i)?i.indexType:i);addDeprecatedSuggestion(t,e.declarations,s)}if(a){markPropertyAsReferenced(e,a,isSelfTypeAccess(a.expression,t.symbol));if(isAssignmentToReadonlyEntity(a,e,getAssignmentTargetKind(a))){error2(a.argumentExpression,wt.Cannot_assign_to_0_because_it_is_a_read_only_property,symbolToString(e));return void 0}if(o&8){getNodeLinks(i).resolvedSymbol=e}if(isThisPropertyAccessInConstructor(a,e)){return Fe}}const n=o&4?getWriteTypeOfSymbol(e):getTypeOfSymbol(e);return a&&getAssignmentTargetKind(a)!==1?getFlowTypeOfReference(a,n):i&&isIndexedAccessTypeNode(i)&&containsMissingType(n)?getUnionType([n,Me]):n}if(everyType(t,isTupleType)&&isNumericLiteralName(s)){const e=+s;if(i&&everyType(t,(e=>!(e.target.combinedFlags&12)))&&!(o&16)){const n=getIndexNodeForAccessExpression(i);if(isTupleType(t)){if(e<0){error2(n,wt.A_tuple_type_cannot_be_indexed_with_a_negative_value);return Me}error2(n,wt.Tuple_type_0_of_length_1_has_no_element_at_index_2,typeToString(t),getTypeReferenceArity(t),unescapeLeadingUnderscores(s))}else{error2(n,wt.Property_0_does_not_exist_on_type_1,unescapeLeadingUnderscores(s),typeToString(t))}}if(e>=0){errorIfWritingToReadonlyIndex(getIndexInfoOfType(t,Ve));return getTupleElementTypeOutOfStartCount(t,e,o&1?Be:void 0)}}}if(!(n.flags&98304)&&isTypeAssignableToKind(n,402653316|296|12288)){if(t.flags&(1|131072)){return t}const c=getApplicableIndexInfo(t,n)||getIndexInfoOfType(t,ze);if(c){if(o&2&&c.keyType!==Ve){if(a){if(o&4){error2(a,wt.Type_0_is_generic_and_can_only_be_indexed_for_reading,typeToString(e))}else{error2(a,wt.Type_0_cannot_be_used_to_index_type_1,typeToString(n),typeToString(e))}}return void 0}if(i&&c.keyType===ze&&!isTypeAssignableToKind(n,4|8)){const e=getIndexNodeForAccessExpression(i);error2(e,wt.Type_0_cannot_be_used_as_an_index_type,typeToString(n));return o&1?getUnionType([c.type,Be]):c.type}errorIfWritingToReadonlyIndex(c);if(o&1&&!(t.symbol&&t.symbol.flags&(256|128)&&(n.symbol&&n.flags&1024&&getParentOfSymbol(n.symbol)===t.symbol))){return getUnionType([c.type,Be])}return c.type}if(n.flags&131072){return et}if(isJSLiteralType(t)){return ke}if(a&&!isConstEnumObjectType(t)){if(isObjectLiteralType2(t)){if(A&&n.flags&(128|256)){gi.add(createDiagnosticForNode(a,wt.Property_0_does_not_exist_on_type_1,n.value,typeToString(t)));return Me}else if(n.flags&(8|4)){const e=map(t.properties,(e=>getTypeOfSymbol(e)));return getUnionType(append(e,Me))}}if(t.symbol===V&&s!==void 0&&V.exports.has(s)&&V.exports.get(s).flags&418){error2(a,wt.Property_0_does_not_exist_on_type_1,unescapeLeadingUnderscores(s),typeToString(t))}else if(A&&!(o&128)){if(s!==void 0&&typeHasStaticProperty(s,t)){const e=typeToString(t);error2(a,wt.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,s,e,e+"["+getTextOfNode(a.argumentExpression)+"]")}else if(getIndexTypeOfType(t,Ve)){error2(a.argumentExpression,wt.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number)}else{let e;if(s!==void 0&&(e=getSuggestionForNonexistentProperty(s,t))){if(e!==void 0){error2(a.argumentExpression,wt.Property_0_does_not_exist_on_type_1_Did_you_mean_2,s,typeToString(t),e)}}else{const e=getSuggestionForNonexistentIndexSignature(t,a,n);if(e!==void 0){error2(a,wt.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1,typeToString(t),e)}else{let e;if(n.flags&1024){e=chainDiagnosticMessages(void 0,wt.Property_0_does_not_exist_on_type_1,"["+typeToString(n)+"]",typeToString(t))}else if(n.flags&8192){const r=getFullyQualifiedName(n.symbol,a);e=chainDiagnosticMessages(void 0,wt.Property_0_does_not_exist_on_type_1,"["+r+"]",typeToString(t))}else if(n.flags&128){e=chainDiagnosticMessages(void 0,wt.Property_0_does_not_exist_on_type_1,n.value,typeToString(t))}else if(n.flags&256){e=chainDiagnosticMessages(void 0,wt.Property_0_does_not_exist_on_type_1,n.value,typeToString(t))}else if(n.flags&(8|4)){e=chainDiagnosticMessages(void 0,wt.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1,typeToString(n),typeToString(t))}e=chainDiagnosticMessages(e,wt.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1,typeToString(r),typeToString(t));gi.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(a),a,e))}}}}return void 0}}if(o&16&&isObjectLiteralType2(t)){return Me}if(isJSLiteralType(t)){return ke}if(i){const e=getIndexNodeForAccessExpression(i);if(e.kind!==10&&n.flags&(128|256)){error2(e,wt.Property_0_does_not_exist_on_type_1,""+n.value,typeToString(t))}else if(n.flags&(4|8)){error2(e,wt.Type_0_has_no_matching_index_signature_for_type_1,typeToString(t),typeToString(n))}else{const t=e.kind===10?"bigint":typeToString(n);error2(e,wt.Type_0_cannot_be_used_as_an_index_type,t)}}if(isTypeAny(n)){return n}return void 0;function errorIfWritingToReadonlyIndex(e){if(e&&e.isReadonly&&a&&(isAssignmentTarget(a)||isDeleteTarget(a))){error2(a,wt.Index_signature_in_type_0_only_permits_reading,typeToString(t))}}}function getIndexNodeForAccessExpression(e){return e.kind===212?e.argumentExpression:e.kind===199?e.indexType:e.kind===167?e.expression:e}function isPatternLiteralPlaceholderType(e){if(e.flags&2097152){let t=false;for(const n of e.types){if(n.flags&(2944|98304)||isPatternLiteralPlaceholderType(n)){t=true}else if(!(n.flags&524288)){return false}}return t}return!!(e.flags&(1|4|8|64))||isPatternLiteralType(e)}function isPatternLiteralType(e){return!!(e.flags&134217728)&&every(e.types,isPatternLiteralPlaceholderType)||!!(e.flags&268435456)&&isPatternLiteralPlaceholderType(e.type)}function isGenericStringLikeType(e){return!!(e.flags&(134217728|268435456))&&!isPatternLiteralType(e)}function isGenericType(e){return!!getGenericObjectFlags(e)}function isGenericObjectType(e){return!!(getGenericObjectFlags(e)&4194304)}function isGenericIndexType(e){return!!(getGenericObjectFlags(e)&8388608)}function getGenericObjectFlags(e){if(e.flags&3145728){if(!(e.objectFlags&2097152)){e.objectFlags|=2097152|reduceLeft(e.types,((e,t)=>e|getGenericObjectFlags(t)),0)}return e.objectFlags&12582912}if(e.flags&33554432){if(!(e.objectFlags&2097152)){e.objectFlags|=2097152|getGenericObjectFlags(e.baseType)|getGenericObjectFlags(e.constraint)}return e.objectFlags&12582912}return(e.flags&58982400||isGenericMappedType(e)||isGenericTupleType(e)?4194304:0)|(e.flags&(58982400|4194304)||isGenericStringLikeType(e)?8388608:0)}function getSimplifiedType(e,t){return e.flags&8388608?getSimplifiedIndexedAccessType(e,t):e.flags&16777216?getSimplifiedConditionalType(e,t):e}function distributeIndexOverObjectType(e,t,n){if(e.flags&1048576||e.flags&2097152&&!shouldDeferIndexType(e)){const r=map(e.types,(e=>getSimplifiedType(getIndexedAccessType(e,t),n)));return e.flags&2097152||n?getIntersectionType(r):getUnionType(r)}}function distributeObjectOverIndexType(e,t,n){if(t.flags&1048576){const r=map(t.types,(t=>getSimplifiedType(getIndexedAccessType(e,t),n)));return n?getIntersectionType(r):getUnionType(r)}}function getSimplifiedIndexedAccessType(e,t){const n=t?"simplifiedForWriting":"simplifiedForReading";if(e[n]){return e[n]===Ft?e:e[n]}e[n]=Ft;const r=getSimplifiedType(e.objectType,t);const i=getSimplifiedType(e.indexType,t);const o=distributeObjectOverIndexType(r,i,t);if(o){return e[n]=o}if(!(i.flags&465829888)){const o=distributeIndexOverObjectType(r,i,t);if(o){return e[n]=o}}if(isGenericTupleType(r)&&i.flags&296){const o=getElementTypeOfSliceOfTupleType(r,i.flags&8?0:r.target.fixedLength,0,t);if(o){return e[n]=o}}if(isGenericMappedType(r)){if(getMappedTypeNameTypeKind(r)!==2){return e[n]=mapType(substituteIndexedMappedType(r,e.indexType),(e=>getSimplifiedType(e,t)))}}return e[n]=e}function getSimplifiedConditionalType(e,t){const n=e.checkType;const r=e.extendsType;const i=getTrueTypeFromConditionalType(e);const o=getFalseTypeFromConditionalType(e);if(o.flags&131072&&getActualTypeVariable(i)===getActualTypeVariable(n)){if(n.flags&1||isTypeAssignableTo(getRestrictiveInstantiation(n),getRestrictiveInstantiation(r))){return getSimplifiedType(i,t)}else if(isIntersectionEmpty(n,r)){return et}}else if(i.flags&131072&&getActualTypeVariable(o)===getActualTypeVariable(n)){if(!(n.flags&1)&&isTypeAssignableTo(getRestrictiveInstantiation(n),getRestrictiveInstantiation(r))){return et}else if(n.flags&1||isIntersectionEmpty(n,r)){return getSimplifiedType(o,t)}}return e}function isIntersectionEmpty(e,t){return!!(getUnionType([intersectTypes(e,t),et]).flags&131072)}function substituteIndexedMappedType(e,t){const n=createTypeMapper([getTypeParameterFromMappedType(e)],[t]);const r=combineTypeMappers(e.mapper,n);const i=instantiateType(getTemplateTypeFromMappedType(e.target||e),r);const o=getMappedTypeOptionality(e)>0||(isGenericType(e)?getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(e))>0:couldAccessOptionalProperty(e,t));return addOptionality(i,true,o)}function couldAccessOptionalProperty(e,t){const n=getBaseConstraintOfType(t);return!!n&&some(getPropertiesOfType(e),(e=>!!(e.flags&16777216)&&isTypeAssignableTo(getLiteralTypeFromProperty(e,8576),n)))}function getIndexedAccessType(e,t,n=0,r,i,o){return getIndexedAccessTypeOrUndefined(e,t,n,r,i,o)||(r?Ie:Le)}function indexTypeLessThan(e,t){return everyType(e,(e=>{if(e.flags&384){const n=getPropertyNameFromType(e);if(isNumericLiteralName(n)){const e=+n;return e>=0&&e0&&!some(e.elements,(e=>isOptionalTypeNode(e)||isRestTypeNode(e)||isNamedTupleMember(e)&&!!(e.questionToken||e.dotDotDotToken)))}function isDeferredType(e,t){return isGenericType(e)||t&&isTupleType(e)&&some(getElementTypes(e),isGenericType)}function getConditionalType(e,t,n,r,i){let o;let a;let s=0;while(true){if(s===1e3){error2(m,wt.Type_instantiation_is_excessively_deep_and_possibly_infinite);return Ie}const c=instantiateType(getActualTypeVariable(e.checkType),t);const l=instantiateType(e.extendsType,t);if(c===Ie||l===Ie){return Ie}if(c===Pe||l===Pe){return Pe}const d=skipTypeParentheses(e.node.checkType);const p=skipTypeParentheses(e.node.extendsType);const u=isSimpleTupleType(d)&&isSimpleTupleType(p)&&length(d.elements)===length(p.elements);const f=isDeferredType(c,u);let _;if(e.inferTypeParameters){const n=createInferenceContext(e.inferTypeParameters,void 0,0);if(t){n.nonFixingMapper=combineTypeMappers(n.nonFixingMapper,t)}if(!f){inferTypes(n.inferences,c,l,512|1024)}_=t?combineTypeMappers(n.mapper,t):n.mapper}const g=_?instantiateType(e.extendsType,_):l;if(!f&&!isDeferredType(g,u)){if(!(g.flags&3)&&(c.flags&1||!isTypeAssignableTo(getPermissiveInstantiation(c),getPermissiveInstantiation(g)))){if(c.flags&1||n&&!(g.flags&131072)&&someType(getPermissiveInstantiation(g),(e=>isTypeAssignableTo(e,getPermissiveInstantiation(c))))){(a||(a=[])).push(instantiateType(getTypeFromTypeNode(e.node.trueType),_||t))}const r=getTypeFromTypeNode(e.node.falseType);if(r.flags&16777216){const n=r.root;if(n.node.parent===e.node&&(!n.isDistributive||n.checkType===e.checkType)){e=n;continue}if(canTailRecurse(r,t)){continue}}o=instantiateType(r,t);break}if(g.flags&3||isTypeAssignableTo(getRestrictiveInstantiation(c),getRestrictiveInstantiation(g))){const n=getTypeFromTypeNode(e.node.trueType);const r=_||t;if(canTailRecurse(n,r)){continue}o=instantiateType(n,r);break}}o=createType(16777216);o.root=e;o.checkType=instantiateType(e.checkType,t);o.extendsType=instantiateType(e.extendsType,t);o.mapper=t;o.combinedMapper=_;o.aliasSymbol=r||e.aliasSymbol;o.aliasTypeArguments=r?i:instantiateTypes(e.aliasTypeArguments,t);break}return a?getUnionType(append(a,o)):o;function canTailRecurse(n,o){if(n.flags&16777216&&o){const a=n.root;if(a.outerTypeParameters){const c=combineTypeMappers(n.mapper,o);const l=map(a.outerTypeParameters,(e=>getMappedType(e,c)));const d=createTypeMapper(a.outerTypeParameters,l);const p=a.isDistributive?getMappedType(a.checkType,d):void 0;if(!p||p===a.checkType||!(p.flags&(1048576|131072))){e=a;t=d;r=void 0;i=void 0;if(a.aliasSymbol){s++}return true}}}return false}}function getTrueTypeFromConditionalType(e){return e.resolvedTrueType||(e.resolvedTrueType=instantiateType(getTypeFromTypeNode(e.root.node.trueType),e.mapper))}function getFalseTypeFromConditionalType(e){return e.resolvedFalseType||(e.resolvedFalseType=instantiateType(getTypeFromTypeNode(e.root.node.falseType),e.mapper))}function getInferredTrueTypeFromConditionalType(e){return e.resolvedInferredTrueType||(e.resolvedInferredTrueType=e.combinedMapper?instantiateType(getTypeFromTypeNode(e.root.node.trueType),e.combinedMapper):getTrueTypeFromConditionalType(e))}function getInferTypeParameters(e){let t;if(e.locals){e.locals.forEach((e=>{if(e.flags&262144){t=append(t,getDeclaredTypeOfSymbol(e))}}))}return t}function isDistributionDependent(e){return e.isDistributive&&(isTypeParameterPossiblyReferenced(e.checkType,e.node.trueType)||isTypeParameterPossiblyReferenced(e.checkType,e.node.falseType))}function getTypeFromConditionalTypeNode(e){const t=getNodeLinks(e);if(!t.resolvedType){const n=getTypeFromTypeNode(e.checkType);const r=getAliasSymbolForTypeNode(e);const i=getTypeArgumentsForAliasSymbol(r);const o=getOuterTypeParameters(e,true);const a=i?o:filter(o,(t=>isTypeParameterPossiblyReferenced(t,e)));const s={node:e,checkType:n,extendsType:getTypeFromTypeNode(e.extendsType),isDistributive:!!(n.flags&262144),inferTypeParameters:getInferTypeParameters(e),outerTypeParameters:a,instantiations:void 0,aliasSymbol:r,aliasTypeArguments:i};t.resolvedType=getConditionalType(s,void 0,false);if(a){s.instantiations=new Map;s.instantiations.set(getTypeListId(a),t.resolvedType)}}return t.resolvedType}function getTypeFromInferTypeNode(e){const t=getNodeLinks(e);if(!t.resolvedType){t.resolvedType=getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(e.typeParameter))}return t.resolvedType}function getIdentifierChain(e){if(isIdentifier(e)){return[e]}else{return append(getIdentifierChain(e.left),e.right)}}function getTypeFromImportTypeNode(e){var t;const n=getNodeLinks(e);if(!n.resolvedType){if(!isLiteralImportTypeNode(e)){error2(e.argument,wt.String_literal_expected);n.resolvedSymbol=xe;return n.resolvedType=Ie}const r=e.isTypeOf?111551:e.flags&16777216?111551|788968:788968;const i=resolveExternalModuleName(e,e.argument.literal);if(!i){n.resolvedSymbol=xe;return n.resolvedType=Ie}const o=!!((t=i.exports)==null?void 0:t.get("export="));const a=resolveExternalModuleSymbol(i,false);if(!nodeIsMissing(e.qualifier)){const t=getIdentifierChain(e.qualifier);let i=a;let s;while(s=t.shift()){const a=t.length?1920:r;const c=getMergedSymbol(resolveSymbol(i));const l=e.isTypeOf||isInJSFile(e)&&o?getPropertyOfType(getTypeOfSymbol(c),s.escapedText,false,true):void 0;const d=e.isTypeOf?void 0:getSymbol2(getExportsOfSymbol(c),s.escapedText,a);const p=d??l;if(!p){error2(s,wt.Namespace_0_has_no_exported_member_1,getFullyQualifiedName(i),declarationNameToString(s));return n.resolvedType=Ie}getNodeLinks(s).resolvedSymbol=p;getNodeLinks(s.parent).resolvedSymbol=p;i=p}n.resolvedType=resolveImportSymbolType(e,n,i,r)}else{if(a.flags&r){n.resolvedType=resolveImportSymbolType(e,n,a,r)}else{const t=r===111551?wt.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:wt.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0;error2(e,t,e.argument.literal.text);n.resolvedSymbol=xe;n.resolvedType=Ie}}}return n.resolvedType}function resolveImportSymbolType(e,t,n,r){const i=resolveSymbol(n);t.resolvedSymbol=i;if(r===111551){return getInstantiationExpressionType(getTypeOfSymbol(n),e)}else{return getTypeReferenceType(e,i)}}function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(e){const t=getNodeLinks(e);if(!t.resolvedType){const n=getAliasSymbolForTypeNode(e);if(!e.symbol||getMembersOfSymbol(e.symbol).size===0&&!n){t.resolvedType=xt}else{let r=createObjectType(16,e.symbol);r.aliasSymbol=n;r.aliasTypeArguments=getTypeArgumentsForAliasSymbol(n);if(isJSDocTypeLiteral(e)&&e.isArrayType){r=createArrayType(r)}t.resolvedType=r}}return t.resolvedType}function getAliasSymbolForTypeNode(e){let t=e.parent;while(isParenthesizedTypeNode(t)||isJSDocTypeExpression(t)||isTypeOperatorNode(t)&&t.operator===148){t=t.parent}return isTypeAlias(t)?getSymbolOfDeclaration(t):void 0}function getTypeArgumentsForAliasSymbol(e){return e?getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e):void 0}function isNonGenericObjectType(e){return!!(e.flags&524288)&&!isGenericMappedType(e)}function isEmptyObjectTypeOrSpreadsIntoEmptyObject(e){return isEmptyObjectType(e)||!!(e.flags&(65536|32768|528|296|2112|402653316|1056|67108864|4194304))}function tryMergeUnionOfObjectTypeAndEmptyObject(e,t){if(!(e.flags&1048576)){return e}if(every(e.types,isEmptyObjectTypeOrSpreadsIntoEmptyObject)){return find(e.types,isEmptyObjectType)||ht}const n=find(e.types,(e=>!isEmptyObjectTypeOrSpreadsIntoEmptyObject(e)));if(!n){return e}const r=find(e.types,(e=>e!==n&&!isEmptyObjectTypeOrSpreadsIntoEmptyObject(e)));if(r){return e}return getAnonymousPartialType(n);function getAnonymousPartialType(e){const n=createSymbolTable();for(const r of getPropertiesOfType(e)){if(getDeclarationModifierFlagsFromSymbol(r)&(2|4)){}else if(isSpreadableProperty(r)){const e=r.flags&65536&&!(r.flags&32768);const i=4|16777216;const o=createSymbol(i,r.escapedName,getIsLateCheckFlag(r)|(t?8:0));o.links.type=e?Me:addOptionality(getTypeOfSymbol(r),true);o.declarations=r.declarations;o.links.nameType=getSymbolLinks(r).nameType;o.links.syntheticOrigin=r;n.set(r.escapedName,o)}}const r=createAnonymousType(e.symbol,n,d,d,getIndexInfosOfType(e));r.objectFlags|=128|131072;return r}}function getSpreadType(e,t,n,r,i){if(e.flags&1||t.flags&1){return ke}if(e.flags&2||t.flags&2){return Le}if(e.flags&131072){return t}if(t.flags&131072){return e}e=tryMergeUnionOfObjectTypeAndEmptyObject(e,i);if(e.flags&1048576){return checkCrossProductUnion([e,t])?mapType(e,(e=>getSpreadType(e,t,n,r,i))):Ie}t=tryMergeUnionOfObjectTypeAndEmptyObject(t,i);if(t.flags&1048576){return checkCrossProductUnion([e,t])?mapType(t,(t=>getSpreadType(e,t,n,r,i))):Ie}if(t.flags&(528|296|2112|402653316|1056|67108864|4194304)){return e}if(isGenericObjectType(e)||isGenericObjectType(t)){if(isEmptyObjectType(e)){return t}if(e.flags&2097152){const o=e.types;const a=o[o.length-1];if(isNonGenericObjectType(a)&&isNonGenericObjectType(t)){return getIntersectionType(concatenate(o.slice(0,o.length-1),[getSpreadType(a,t,n,r,i)]))}}return getIntersectionType([e,t])}const o=createSymbolTable();const a=new Set;const s=e===ht?getIndexInfosOfType(t):getUnionIndexInfos([e,t]);for(const e of getPropertiesOfType(t)){if(getDeclarationModifierFlagsFromSymbol(e)&(2|4)){a.add(e.escapedName)}else if(isSpreadableProperty(e)){o.set(e.escapedName,getSpreadSymbol(e,i))}}for(const t of getPropertiesOfType(e)){if(a.has(t.escapedName)||!isSpreadableProperty(t)){continue}if(o.has(t.escapedName)){const e=o.get(t.escapedName);const n=getTypeOfSymbol(e);if(e.flags&16777216){const r=concatenate(t.declarations,e.declarations);const i=4|t.flags&16777216;const a=createSymbol(i,t.escapedName);const s=getTypeOfSymbol(t);const c=removeMissingOrUndefinedType(s);const l=removeMissingOrUndefinedType(n);a.links.type=c===l?s:getUnionType([s,l],2);a.links.leftSpread=t;a.links.rightSpread=e;a.declarations=r;a.links.nameType=getSymbolLinks(t).nameType;o.set(t.escapedName,a)}}else{o.set(t.escapedName,getSpreadSymbol(t,i))}}const c=createAnonymousType(n,o,d,d,sameMap(s,(e=>getIndexInfoWithReadonly(e,i))));c.objectFlags|=128|131072|2097152|r;return c}function isSpreadableProperty(e){var t;return!some(e.declarations,isPrivateIdentifierClassElementDeclaration)&&(!(e.flags&(8192|32768|65536))||!((t=e.declarations)==null?void 0:t.some((e=>isClassLike(e.parent)))))}function getSpreadSymbol(e,t){const n=e.flags&65536&&!(e.flags&32768);if(!n&&t===isReadonlySymbol(e)){return e}const r=4|e.flags&16777216;const i=createSymbol(r,e.escapedName,getIsLateCheckFlag(e)|(t?8:0));i.links.type=n?Me:getTypeOfSymbol(e);i.declarations=e.declarations;i.links.nameType=getSymbolLinks(e).nameType;i.links.syntheticOrigin=e;return i}function getIndexInfoWithReadonly(e,t){return e.isReadonly!==t?createIndexInfo(e.keyType,e.type,t,e.declaration,e.components):e}function createLiteralType(e,t,n,r){const i=createTypeWithSymbol(e,n);i.value=t;i.regularType=r||i;return i}function getFreshTypeOfLiteralType(e){if(e.flags&2976){if(!e.freshType){const t=createLiteralType(e.flags,e.value,e.symbol,e);t.freshType=t;e.freshType=t}return e.freshType}return e}function getRegularTypeOfLiteralType(e){return e.flags&2976?e.regularType:e.flags&1048576?e.regularType||(e.regularType=mapType(e,getRegularTypeOfLiteralType)):e}function isFreshLiteralType(e){return!!(e.flags&2976)&&e.freshType===e}function getStringLiteralType(e){let t;return ce.get(e)||(ce.set(e,t=createLiteralType(128,e)),t)}function getNumberLiteralType(e){let t;return le.get(e)||(le.set(e,t=createLiteralType(256,e)),t)}function getBigIntLiteralType(e){let t;const n=pseudoBigIntToString(e);return de.get(n)||(de.set(n,t=createLiteralType(2048,e)),t)}function getEnumLiteralType(e,t,n){let r;const i=`${t}${typeof e==="string"?"@":"#"}${e}`;const o=1024|(typeof e==="string"?128:256);return pe.get(i)||(pe.set(i,r=createLiteralType(o,e,n)),r)}function getTypeFromLiteralTypeNode(e){if(e.literal.kind===106){return We}const t=getNodeLinks(e);if(!t.resolvedType){t.resolvedType=getRegularTypeOfLiteralType(checkExpression(e.literal))}return t.resolvedType}function createUniqueESSymbolType(e){const t=createTypeWithSymbol(8192,e);t.escapedName=`__@${t.symbol.escapedName}@${getSymbolId(t.symbol)}`;return t}function getESSymbolLikeTypeForNode(e){if(isInJSFile(e)&&isJSDocTypeExpression(e)){const t=getJSDocHost(e);if(t){e=getSingleVariableOfVariableStatement(t)||t}}if(isValidESSymbolDeclaration(e)){const t=isCommonJsExportPropertyAssignment(e)?getSymbolOfNode(e.left):getSymbolOfNode(e);if(t){const e=getSymbolLinks(t);return e.uniqueESSymbolType||(e.uniqueESSymbolType=createUniqueESSymbolType(t))}}return Ye}function getThisType(e){const t=getThisContainer(e,false,false);const n=t&&t.parent;if(n&&(isClassLike(n)||n.kind===264)){if(!isStatic(t)&&(!isConstructorDeclaration(t)||isNodeDescendantOf(e,t.body))){return getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(n)).thisType}}if(n&&isObjectLiteralExpression(n)&&isBinaryExpression(n.parent)&&getAssignmentDeclarationKind(n.parent)===6){return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(n.parent.left).parent).thisType}const r=e.flags&16777216?getHostSignatureFromJSDoc(e):void 0;if(r&&isFunctionExpression(r)&&isBinaryExpression(r.parent)&&getAssignmentDeclarationKind(r.parent)===3){return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(r.parent.left).parent).thisType}if(isJSConstructor(t)&&isNodeDescendantOf(e,t.body)){return getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(t)).thisType}error2(e,wt.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface);return Ie}function getTypeFromThisTypeNode(e){const t=getNodeLinks(e);if(!t.resolvedType){t.resolvedType=getThisType(e)}return t.resolvedType}function getTypeFromRestTypeNode(e){return getTypeFromTypeNode(getArrayElementTypeNode(e.type)||e.type)}function getArrayElementTypeNode(e){switch(e.kind){case 196:return getArrayElementTypeNode(e.type);case 189:if(e.elements.length===1){e=e.elements[0];if(e.kind===191||e.kind===202&&e.dotDotDotToken){return getArrayElementTypeNode(e.type)}}break;case 188:return e.elementType}return void 0}function getTypeFromNamedTupleTypeNode(e){const t=getNodeLinks(e);return t.resolvedType||(t.resolvedType=e.dotDotDotToken?getTypeFromRestTypeNode(e):addOptionality(getTypeFromTypeNode(e.type),true,!!e.questionToken))}function getTypeFromTypeNode(e){return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(e),e)}function getTypeFromTypeNodeWorker(e){switch(e.kind){case 133:case 312:case 313:return ke;case 159:return Le;case 154:return ze;case 150:return Ve;case 163:return qe;case 136:return Xe;case 155:return Ye;case 116:return Ze;case 157:return Me;case 106:return We;case 146:return et;case 151:return e.flags&524288&&!A?ke:it;case 141:return we;case 197:case 110:return getTypeFromThisTypeNode(e);case 201:return getTypeFromLiteralTypeNode(e);case 183:return getTypeFromTypeReference(e);case 182:return e.assertsModifier?Ze:Xe;case 233:return getTypeFromTypeReference(e);case 186:return getTypeFromTypeQueryNode(e);case 188:case 189:return getTypeFromArrayOrTupleTypeNode(e);case 190:return getTypeFromOptionalTypeNode(e);case 192:return getTypeFromUnionTypeNode(e);case 193:return getTypeFromIntersectionTypeNode(e);case 314:return getTypeFromJSDocNullableTypeNode(e);case 316:return addOptionality(getTypeFromTypeNode(e.type));case 202:return getTypeFromNamedTupleTypeNode(e);case 196:case 315:case 309:return getTypeFromTypeNode(e.type);case 191:return getTypeFromRestTypeNode(e);case 318:return getTypeFromJSDocVariadicType(e);case 184:case 185:case 187:case 322:case 317:case 323:return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(e);case 198:return getTypeFromTypeOperatorNode(e);case 199:return getTypeFromIndexedAccessTypeNode(e);case 200:return getTypeFromMappedTypeNode(e);case 194:return getTypeFromConditionalTypeNode(e);case 195:return getTypeFromInferTypeNode(e);case 203:return getTypeFromTemplateTypeNode(e);case 205:return getTypeFromImportTypeNode(e);case 80:case 166:case 211:const t=getSymbolAtLocation(e);return t?getDeclaredTypeOfSymbol(t):Ie;default:return Ie}}function instantiateList(e,t,n){if(e&&e.length){for(let r=0;re.typeParameter)),map(n,(()=>Le)))}function combineTypeMappers(e,t){return e?makeCompositeTypeMapper(4,e,t):t}function mergeTypeMappers(e,t){return e?makeCompositeTypeMapper(5,e,t):t}function prependTypeMapping(e,t,n){return!n?makeUnaryTypeMapper(e,t):makeCompositeTypeMapper(5,makeUnaryTypeMapper(e,t),n)}function appendTypeMapping(e,t,n){return!e?makeUnaryTypeMapper(t,n):makeCompositeTypeMapper(5,e,makeUnaryTypeMapper(t,n))}function getRestrictiveTypeParameter(e){return!e.constraint&&!getConstraintDeclaration(e)||e.constraint===kt?e:e.restrictiveInstantiation||(e.restrictiveInstantiation=createTypeParameter(e.symbol),e.restrictiveInstantiation.constraint=kt,e.restrictiveInstantiation)}function cloneTypeParameter(e){const t=createTypeParameter(e.symbol);t.target=e;return t}function instantiateTypePredicate(e,t){return createTypePredicate(e.kind,e.parameterName,e.parameterIndex,instantiateType(e.type,t))}function instantiateSignature(e,t,n){let r;if(e.typeParameters&&!n){r=map(e.typeParameters,cloneTypeParameter);t=combineTypeMappers(createTypeMapper(e.typeParameters,r),t);for(const e of r){e.mapper=t}}const i=createSignature(e.declaration,r,e.thisParameter&&instantiateSymbol(e.thisParameter,t),instantiateList(e.parameters,t,instantiateSymbol),void 0,void 0,e.minArgumentCount,e.flags&167);i.target=e;i.mapper=t;return i}function instantiateSymbol(e,t){const n=getSymbolLinks(e);if(n.type&&!couldContainTypeVariables(n.type)){if(!(e.flags&65536)){return e}if(n.writeType&&!couldContainTypeVariables(n.writeType)){return e}}if(getCheckFlags(e)&1){e=n.target;t=combineTypeMappers(n.mapper,t)}const r=createSymbol(e.flags,e.escapedName,1|getCheckFlags(e)&(8|4096|16384|32768));r.declarations=e.declarations;r.parent=e.parent;r.links.target=e;r.links.mapper=t;if(e.valueDeclaration){r.valueDeclaration=e.valueDeclaration}if(n.nameType){r.links.nameType=n.nameType}return r}function getObjectTypeInstantiation(e,t,n,r){const i=e.objectFlags&4?e.node:e.objectFlags&8388608?e.node:e.symbol.declarations[0];const o=getNodeLinks(i);const a=e.objectFlags&4?o.resolvedType:e.objectFlags&64?e.target:e;let s=e.objectFlags&134217728?e.outerTypeParameters:o.outerTypeParameters;if(!s){let t=getOuterTypeParameters(i,true);if(isJSConstructor(i)){const e=getTypeParametersFromDeclaration(i);t=addRange(t,e)}s=t||d;const n=e.objectFlags&(4|8388608)?[i]:e.symbol.declarations;s=(a.objectFlags&(4|8388608)||a.symbol.flags&8192||a.symbol.flags&2048)&&!a.aliasTypeArguments?filter(s,(e=>some(n,(t=>isTypeParameterPossiblyReferenced(e,t))))):s;o.outerTypeParameters=s}if(s.length){const i=combineTypeMappers(e.mapper,t);const o=map(s,(e=>getMappedType(e,i)));const c=n||e.aliasSymbol;const l=n?r:instantiateTypes(e.aliasTypeArguments,t);const d=(e.objectFlags&134217728?"S":"")+getTypeListId(o)+getAliasId(c,l);if(!a.instantiations){a.instantiations=new Map;a.instantiations.set(getTypeListId(s)+getAliasId(a.aliasSymbol,a.aliasTypeArguments),a)}let p=a.instantiations.get(d);if(!p){if(e.objectFlags&134217728){p=instantiateAnonymousType(e,t);a.instantiations.set(d,p);return p}const n=createTypeMapper(s,o);p=a.objectFlags&4?createDeferredTypeReference(e.target,e.node,n,c,l):a.objectFlags&32?instantiateMappedType(a,n,c,l):instantiateAnonymousType(a,n,c,l);a.instantiations.set(d,p);const r=getObjectFlags(p);if(p.flags&3899393&&!(r&524288)){const e=some(o,couldContainTypeVariables);if(!(getObjectFlags(p)&524288)){if(r&(32|16|4)){p.objectFlags|=524288|(e?1048576:0)}else{p.objectFlags|=!e?524288:0}}}}return p}return e}function maybeTypeParameterReference(e){return!(e.parent.kind===183&&e.parent.typeArguments&&e===e.parent.typeName||e.parent.kind===205&&e.parent.typeArguments&&e===e.parent.qualifier)}function isTypeParameterPossiblyReferenced(e,t){if(e.symbol&&e.symbol.declarations&&e.symbol.declarations.length===1){const n=e.symbol.declarations[0].parent;for(let e=t;e!==n;e=e.parent){if(!e||e.kind===241||e.kind===194&&forEachChild(e.extendsType,containsReference)){return true}}return containsReference(t)}return true;function containsReference(t){switch(t.kind){case 197:return!!e.isThisType;case 80:return!e.isThisType&&isPartOfTypeNode(t)&&maybeTypeParameterReference(t)&&getTypeFromTypeNodeWorker(t)===e;case 186:const n=t.exprName;const r=getFirstIdentifier(n);if(!isThisIdentifier(r)){const n=getResolvedSymbol(r);const i=e.symbol.declarations[0];const o=i.kind===168?i.parent:e.isThisType?i:void 0;if(n.declarations&&o){return some(n.declarations,(e=>isNodeDescendantOf(e,o)))||some(t.typeArguments,containsReference)}}return true;case 174:case 173:return!t.type&&!!t.body||some(t.typeParameters,containsReference)||some(t.parameters,containsReference)||!!t.type&&containsReference(t.type)}return!!forEachChild(t,containsReference)}}function getHomomorphicTypeVariable(e){const t=getConstraintTypeFromMappedType(e);if(t.flags&4194304){const e=getActualTypeVariable(t.type);if(e.flags&262144){return e}}return void 0}function instantiateMappedType(e,t,n,r){const i=getHomomorphicTypeVariable(e);if(i){const e=instantiateType(i,t);if(i!==e){return mapTypeWithAlias(getReducedType(e),instantiateConstituent,n,r)}}return instantiateType(getConstraintTypeFromMappedType(e),t)===Pe?Pe:instantiateAnonymousType(e,t,n,r);function instantiateConstituent(n){if(n.flags&(3|58982400|524288|2097152)&&n!==Pe&&!isErrorType(n)){if(!e.declaration.nameType){let r;if(isArrayType(n)||n.flags&1&&findResolutionCycleStartIndex(i,4)<0&&(r=getConstraintOfTypeParameter(i))&&everyType(r,isArrayOrTupleType)){return instantiateMappedArrayType(n,e,prependTypeMapping(i,n,t))}if(isTupleType(n)){return instantiateMappedTupleType(n,e,i,t)}if(isArrayOrTupleOrIntersection(n)){return getIntersectionType(map(n.types,instantiateConstituent))}}return instantiateAnonymousType(e,prependTypeMapping(i,n,t))}return n}}function getModifiedReadonlyState(e,t){return t&1?true:t&2?false:e}function instantiateMappedTupleType(e,t,n,r){const i=e.target.elementFlags;const o=e.target.fixedLength;const a=o?prependTypeMapping(n,e,r):r;const s=map(getElementTypes(e),((e,s)=>{const c=i[s];return se&1?2:e)):c&8?map(i,(e=>e&2?1:e)):i;const d=getModifiedReadonlyState(e.target.readonly,getMappedTypeModifiers(t));return contains(s,Ie)?Ie:createTupleType(s,l,d,e.target.labeledElementDeclarations)}function instantiateMappedArrayType(e,t,n){const r=instantiateMappedTypeTemplate(t,Ve,true,n);return isErrorType(r)?Ie:createArrayType(r,getModifiedReadonlyState(isReadonlyArrayType(e),getMappedTypeModifiers(t)))}function instantiateMappedTypeTemplate(e,t,n,r){const i=appendTypeMapping(r,getTypeParameterFromMappedType(e),t);const o=instantiateType(getTemplateTypeFromMappedType(e.target||e),i);const a=getMappedTypeModifiers(e);return k&&a&4&&!maybeTypeOfKind(o,32768|16384)?getOptionalType(o,true):k&&a&8&&n?getTypeWithFacts(o,524288):o}function instantiateAnonymousType(e,t,n,r){S.assert(e.symbol,"anonymous type must have symbol to be instantiated");const i=createObjectType(e.objectFlags&~(524288|1048576)|64,e.symbol);if(e.objectFlags&32){i.declaration=e.declaration;const n=getTypeParameterFromMappedType(e);const r=cloneTypeParameter(n);i.typeParameter=r;t=combineTypeMappers(makeUnaryTypeMapper(n,r),t);r.mapper=t}if(e.objectFlags&8388608){i.node=e.node}if(e.objectFlags&134217728){i.outerTypeParameters=e.outerTypeParameters}i.target=e;i.mapper=t;i.aliasSymbol=n||e.aliasSymbol;i.aliasTypeArguments=n?r:instantiateTypes(e.aliasTypeArguments,t);i.objectFlags|=i.aliasTypeArguments?getPropagatingFlagsOfTypes(i.aliasTypeArguments):0;return i}function getConditionalTypeInstantiation(e,t,n,r,i){const o=e.root;if(o.outerTypeParameters){const e=map(o.outerTypeParameters,(e=>getMappedType(e,t)));const a=(n?"C":"")+getTypeListId(e)+getAliasId(r,i);let s=o.instantiations.get(a);if(!s){const t=createTypeMapper(o.outerTypeParameters,e);const c=o.checkType;const l=o.isDistributive?getReducedType(getMappedType(c,t)):void 0;s=l&&c!==l&&l.flags&(1048576|131072)?mapTypeWithAlias(l,(e=>getConditionalType(o,prependTypeMapping(c,e,t),n)),r,i):getConditionalType(o,t,n,r,i);o.instantiations.set(a,s)}return s}return e}function instantiateType(e,t){return e&&t?instantiateTypeWithAlias(e,t,void 0,void 0):e}function instantiateTypeWithAlias(e,t,n,r){var i;if(!couldContainTypeVariables(e)){return e}if(u===100||p>=5e6){(i=G)==null?void 0:i.instant(G.Phase.CheckTypes,"instantiateType_DepthLimit",{typeId:e.id,instantiationDepth:u,instantiationCount:p});error2(m,wt.Type_instantiation_is_excessively_deep_and_possibly_infinite);return Ie}l++;p++;u++;const o=instantiateTypeWorker(e,t,n,r);u--;return o}function instantiateTypeWorker(e,t,n,r){const i=e.flags;if(i&262144){return getMappedType(e,t)}if(i&524288){const i=e.objectFlags;if(i&(4|16|32)){if(i&4&&!e.node){const n=e.resolvedTypeArguments;const r=instantiateTypes(n,t);return r!==n?createNormalizedTypeReference(e.target,r):e}if(i&1024){return instantiateReverseMappedType(e,t)}return getObjectTypeInstantiation(e,t,n,r)}return e}if(i&3145728){const o=e.flags&1048576?e.origin:void 0;const a=o&&o.flags&3145728?o.types:e.types;const s=instantiateTypes(a,t);if(s===a&&n===e.aliasSymbol){return e}const c=n||e.aliasSymbol;const l=n?r:instantiateTypes(e.aliasTypeArguments,t);return i&2097152||o&&o.flags&2097152?getIntersectionType(s,0,c,l):getUnionType(s,1,c,l)}if(i&4194304){return getIndexType(instantiateType(e.type,t))}if(i&134217728){return getTemplateLiteralType(e.texts,instantiateTypes(e.types,t))}if(i&268435456){return getStringMappingType(e.symbol,instantiateType(e.type,t))}if(i&8388608){const i=n||e.aliasSymbol;const o=n?r:instantiateTypes(e.aliasTypeArguments,t);return getIndexedAccessType(instantiateType(e.objectType,t),instantiateType(e.indexType,t),e.accessFlags,void 0,i,o)}if(i&16777216){return getConditionalTypeInstantiation(e,combineTypeMappers(e.mapper,t),false,n,r)}if(i&33554432){const n=instantiateType(e.baseType,t);if(isNoInferType(e)){return getNoInferType(n)}const r=instantiateType(e.constraint,t);if(n.flags&8650752&&isGenericType(r)){return getSubstitutionType(n,r)}if(r.flags&3||isTypeAssignableTo(getRestrictiveInstantiation(n),getRestrictiveInstantiation(r))){return n}return n.flags&8650752?getSubstitutionType(n,r):getIntersectionType([r,n])}return e}function instantiateReverseMappedType(e,t){const n=instantiateType(e.mappedType,t);if(!(getObjectFlags(n)&32)){return e}const r=instantiateType(e.constraintType,t);if(!(r.flags&4194304)){return e}const i=inferTypeForHomomorphicMappedType(instantiateType(e.source,t),n,r);if(i){return i}return e}function getPermissiveInstantiation(e){return e.flags&(402784252|3|131072)?e:e.permissiveInstantiation||(e.permissiveInstantiation=instantiateType(e,ut))}function getRestrictiveInstantiation(e){if(e.flags&(402784252|3|131072)){return e}if(e.restrictiveInstantiation){return e.restrictiveInstantiation}e.restrictiveInstantiation=instantiateType(e,pt);e.restrictiveInstantiation.restrictiveInstantiation=e.restrictiveInstantiation;return e.restrictiveInstantiation}function instantiateIndexInfo(e,t){return createIndexInfo(e.keyType,instantiateType(e.type,t),e.isReadonly,e.declaration,e.components)}function isContextSensitive(e){S.assert(e.kind!==174||isObjectLiteralMethod(e));switch(e.kind){case 218:case 219:case 174:case 262:return isContextSensitiveFunctionLikeDeclaration(e);case 210:return some(e.properties,isContextSensitive);case 209:return some(e.elements,isContextSensitive);case 227:return isContextSensitive(e.whenTrue)||isContextSensitive(e.whenFalse);case 226:return(e.operatorToken.kind===57||e.operatorToken.kind===61)&&(isContextSensitive(e.left)||isContextSensitive(e.right));case 303:return isContextSensitive(e.initializer);case 217:return isContextSensitive(e.expression);case 292:return some(e.properties,isContextSensitive)||isJsxOpeningElement(e.parent)&&some(e.parent.parent.children,isContextSensitive);case 291:{const{initializer:t}=e;return!!t&&isContextSensitive(t)}case 294:{const{expression:t}=e;return!!t&&isContextSensitive(t)}}return false}function isContextSensitiveFunctionLikeDeclaration(e){return hasContextSensitiveParameters(e)||hasContextSensitiveReturnExpression(e)}function hasContextSensitiveReturnExpression(e){if(e.typeParameters||getEffectiveReturnTypeNode(e)||!e.body){return false}if(e.body.kind!==241){return isContextSensitive(e.body)}return!!forEachReturnStatement(e.body,(e=>!!e.expression&&isContextSensitive(e.expression)))}function isContextSensitiveFunctionOrObjectLiteralMethod(e){return(isFunctionExpressionOrArrowFunction(e)||isObjectLiteralMethod(e))&&isContextSensitiveFunctionLikeDeclaration(e)}function getTypeWithoutSignatures(e){if(e.flags&524288){const t=resolveStructuredTypeMembers(e);if(t.constructSignatures.length||t.callSignatures.length){const n=createObjectType(16,e.symbol);n.members=t.members;n.properties=t.properties;n.callSignatures=d;n.constructSignatures=d;n.indexInfos=d;return n}}else if(e.flags&2097152){return getIntersectionType(map(e.types,getTypeWithoutSignatures))}return e}function isTypeIdenticalTo(e,t){return isTypeRelatedTo(e,t,Ei)}function compareTypesIdentical(e,t){return isTypeRelatedTo(e,t,Ei)?-1:0}function compareTypesAssignable(e,t){return isTypeRelatedTo(e,t,bi)?-1:0}function compareTypesSubtypeOf(e,t){return isTypeRelatedTo(e,t,vi)?-1:0}function isTypeSubtypeOf(e,t){return isTypeRelatedTo(e,t,vi)}function isTypeStrictSubtypeOf(e,t){return isTypeRelatedTo(e,t,xi)}function isTypeAssignableTo(e,t){return isTypeRelatedTo(e,t,bi)}function isTypeDerivedFrom(e,t){return e.flags&1048576?every(e.types,(e=>isTypeDerivedFrom(e,t))):t.flags&1048576?some(t.types,(t=>isTypeDerivedFrom(e,t))):e.flags&2097152?some(e.types,(e=>isTypeDerivedFrom(e,t))):e.flags&58982400?isTypeDerivedFrom(getBaseConstraintOfType(e)||Le,t):isEmptyAnonymousObjectType(t)?!!(e.flags&(524288|67108864)):t===en?!!(e.flags&(524288|67108864))&&!isEmptyAnonymousObjectType(e):t===tn?!!(e.flags&524288)&&isFunctionObjectType(e):hasBaseType(e,getTargetType(t))||isArrayType(t)&&!isReadonlyArrayType(t)&&isTypeDerivedFrom(e,an)}function isTypeComparableTo(e,t){return isTypeRelatedTo(e,t,Ci)}function areTypesComparable(e,t){return isTypeComparableTo(e,t)||isTypeComparableTo(t,e)}function checkTypeAssignableTo(e,t,n,r,i,o){return checkTypeRelatedTo(e,t,bi,n,r,i,o)}function checkTypeAssignableToAndOptionallyElaborate(e,t,n,r,i,o){return checkTypeRelatedToAndOptionallyElaborate(e,t,bi,n,r,i,o,void 0)}function checkTypeRelatedToAndOptionallyElaborate(e,t,n,r,i,o,a,s){if(isTypeRelatedTo(e,t,n))return true;if(!r||!elaborateError(i,e,t,n,o,a,s)){return checkTypeRelatedTo(e,t,n,r,o,a,s)}return false}function isOrHasGenericConditional(e){return!!(e.flags&16777216||e.flags&2097152&&some(e.types,isOrHasGenericConditional))}function elaborateError(e,t,n,r,i,o,a){if(!e||isOrHasGenericConditional(n))return false;if(!checkTypeRelatedTo(t,n,r,void 0)&&elaborateDidYouMeanToCallOrConstruct(e,t,n,r,i,o,a)){return true}switch(e.kind){case 234:if(!isConstAssertion(e)){break}case 294:case 217:return elaborateError(e.expression,t,n,r,i,o,a);case 226:switch(e.operatorToken.kind){case 64:case 28:return elaborateError(e.right,t,n,r,i,o,a)}break;case 210:return elaborateObjectLiteral(e,t,n,r,o,a);case 209:return elaborateArrayLiteral(e,t,n,r,o,a);case 292:return elaborateJsxComponents(e,t,n,r,o,a);case 219:return elaborateArrowFunction(e,t,n,r,o,a)}return false}function elaborateDidYouMeanToCallOrConstruct(e,t,n,r,i,o,a){const s=getSignaturesOfType(t,0);const c=getSignaturesOfType(t,1);for(const l of[c,s]){if(some(l,(e=>{const t=getReturnTypeOfSignature(e);return!(t.flags&(1|131072))&&checkTypeRelatedTo(t,n,r,void 0)}))){const r=a||{};checkTypeAssignableTo(t,n,e,i,o,r);const s=r.errors[r.errors.length-1];addRelatedInfo(s,createDiagnosticForNode(e,l===c?wt.Did_you_mean_to_use_new_with_this_expression:wt.Did_you_mean_to_call_this_expression));return true}}return false}function elaborateArrowFunction(e,t,n,r,i,o){if(isBlock(e.body)){return false}if(some(e.parameters,hasType)){return false}const a=getSingleCallSignature(t);if(!a){return false}const s=getSignaturesOfType(n,0);if(!length(s)){return false}const c=e.body;const l=getReturnTypeOfSignature(a);const d=getUnionType(map(s,getReturnTypeOfSignature));if(!checkTypeRelatedTo(l,d,r,void 0)){const t=c&&elaborateError(c,l,d,r,void 0,i,o);if(t){return t}const a=o||{};checkTypeRelatedTo(l,d,r,c,void 0,i,a);if(a.errors){if(n.symbol&&length(n.symbol.declarations)){addRelatedInfo(a.errors[a.errors.length-1],createDiagnosticForNode(n.symbol.declarations[0],wt.The_expected_type_comes_from_the_return_type_of_this_signature))}if((getFunctionFlags(e)&2)===0&&!getTypeOfPropertyOfType(l,"then")&&checkTypeRelatedTo(createPromiseType(l),d,r,void 0)){addRelatedInfo(a.errors[a.errors.length-1],createDiagnosticForNode(e,wt.Did_you_mean_to_mark_this_function_as_async))}return true}}return false}function getBestMatchIndexedAccessTypeOrUndefined(e,t,n){const r=getIndexedAccessTypeOrUndefined(t,n);if(r){return r}if(t.flags&1048576){const r=getBestMatchingType(e,t);if(r){return getIndexedAccessTypeOrUndefined(r,n)}}}function checkExpressionForMutableLocationWithContextualType(e,t){pushContextualType(e,t,false);const n=checkExpressionForMutableLocation(e,1);popContextualType();return n}function elaborateElementwise(e,t,n,r,i,o){let a=false;for(const s of e){const{errorNode:e,innerExpression:c,nameType:l,errorMessage:d}=s;let p=getBestMatchIndexedAccessTypeOrUndefined(t,n,l);if(!p||p.flags&8388608)continue;let u=getIndexedAccessTypeOrUndefined(t,l);if(!u)continue;const f=getPropertyNameFromIndex(l,void 0);if(!checkTypeRelatedTo(u,p,r,void 0)){const s=c&&elaborateError(c,u,p,r,void 0,i,o);a=true;if(!s){const a=o||{};const s=c?checkExpressionForMutableLocationWithContextualType(c,u):u;if(L&&isExactOptionalPropertyMismatch(s,p)){const t=createDiagnosticForNode(e,wt.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target,typeToString(s),typeToString(p));gi.add(t);a.errors=[t]}else{const o=!!(f&&(getPropertyOfType(n,f)||xe).flags&16777216);const c=!!(f&&(getPropertyOfType(t,f)||xe).flags&16777216);p=removeMissingType(p,o);u=removeMissingType(u,o&&c);const l=checkTypeRelatedTo(s,p,r,e,d,i,a);if(l&&s!==u){checkTypeRelatedTo(u,p,r,e,d,i,a)}}if(a.errors){const e=a.errors[a.errors.length-1];const t=isTypeUsableAsPropertyName(l)?getPropertyNameFromType(l):void 0;const r=t!==void 0?getPropertyOfType(n,t):void 0;let i=false;if(!r){const t=getApplicableIndexInfo(n,l);if(t&&t.declaration&&!getSourceFileOfNode(t.declaration).hasNoDefaultLib){i=true;addRelatedInfo(e,createDiagnosticForNode(t.declaration,wt.The_expected_type_comes_from_this_index_signature))}}if(!i&&(r&&length(r.declarations)||n.symbol&&length(n.symbol.declarations))){const i=r&&length(r.declarations)?r.declarations[0]:n.symbol.declarations[0];if(!getSourceFileOfNode(i).hasNoDefaultLib){addRelatedInfo(e,createDiagnosticForNode(i,wt.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,t&&!(l.flags&8192)?unescapeLeadingUnderscores(t):typeToString(l),typeToString(n)))}}}}}}return a}function elaborateIterableOrArrayLikeTargetElementwise(e,t,n,r,i,o){const a=filterType(n,isArrayOrTupleLikeType);const s=filterType(n,(e=>!isArrayOrTupleLikeType(e)));const c=s!==et?getIterationTypeOfIterable(13,0,s,void 0):void 0;let l=false;for(let n=e.next();!n.done;n=e.next()){const{errorNode:e,innerExpression:s,nameType:d,errorMessage:p}=n.value;let u=c;const f=a!==et?getBestMatchIndexedAccessTypeOrUndefined(t,a,d):void 0;if(f&&!(f.flags&8388608)){u=c?getUnionType([c,f]):f}if(!u)continue;let m=getIndexedAccessTypeOrUndefined(t,d);if(!m)continue;const _=getPropertyNameFromIndex(d,void 0);if(!checkTypeRelatedTo(m,u,r,void 0)){const n=s&&elaborateError(s,m,u,r,void 0,i,o);l=true;if(!n){const n=o||{};const c=s?checkExpressionForMutableLocationWithContextualType(s,m):m;if(L&&isExactOptionalPropertyMismatch(c,u)){const t=createDiagnosticForNode(e,wt.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target,typeToString(c),typeToString(u));gi.add(t);n.errors=[t]}else{const o=!!(_&&(getPropertyOfType(a,_)||xe).flags&16777216);const s=!!(_&&(getPropertyOfType(t,_)||xe).flags&16777216);u=removeMissingType(u,o);m=removeMissingType(m,o&&s);const l=checkTypeRelatedTo(c,u,r,e,p,i,n);if(l&&c!==m){checkTypeRelatedTo(m,u,r,e,p,i,n)}}}}}return l}function*generateJsxAttributes(e){if(!length(e.properties))return;for(const t of e.properties){if(isJsxSpreadAttribute(t)||isHyphenatedJsxName(getTextOfJsxAttributeName(t.name)))continue;yield{errorNode:t.name,innerExpression:t.initializer,nameType:getStringLiteralType(getTextOfJsxAttributeName(t.name))}}}function*generateJsxChildren(e,t){if(!length(e.children))return;let n=0;for(let r=0;r1;let m;let _;const g=getGlobalIterableType(false);if(g!==Et){const e=createIterableType(ke);m=filterType(p,(t=>isTypeAssignableTo(t,e)));_=filterType(p,(t=>!isTypeAssignableTo(t,e)))}else{m=filterType(p,isArrayOrTupleLikeType);_=filterType(p,(e=>!isArrayOrTupleLikeType(e)))}if(f){if(m!==et){const e=createTupleType(checkJsxChildren(s,0));const t=generateJsxChildren(s,getInvalidTextualChildDiagnostic);a=elaborateIterableOrArrayLikeTargetElementwise(t,e,m,r,i,o)||a}else if(!isTypeRelatedTo(getIndexedAccessType(t,d),p,r)){a=true;const e=error2(s.openingElement.tagName,wt.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided,l,typeToString(p));if(o&&o.skipLogging){(o.errors||(o.errors=[])).push(e)}}}else{if(_!==et){const e=u[0];const s=getElaborationElementForJsxChild(e,d,getInvalidTextualChildDiagnostic);if(s){a=elaborateElementwise(function*(){yield s}(),t,n,r,i,o)||a}}else if(!isTypeRelatedTo(getIndexedAccessType(t,d),p,r)){a=true;const e=error2(s.openingElement.tagName,wt.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided,l,typeToString(p));if(o&&o.skipLogging){(o.errors||(o.errors=[])).push(e)}}}}return a;function getInvalidTextualChildDiagnostic(){if(!s){const t=getTextOfNode(e.parent.tagName);const r=getJsxElementChildrenPropertyName(getJsxNamespaceAt(e));const i=r===void 0?"children":unescapeLeadingUnderscores(r);const o=getIndexedAccessType(n,getStringLiteralType(i));const a=wt._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;s={...a,key:"!!ALREADY FORMATTED!!",message:formatMessage(a,t,i,typeToString(o))}}return s}}function*generateLimitedTupleElements(e,t){const n=length(e.elements);if(!n)return;for(let r=0;rc:getMinArgumentCount(e)>c);if(l){if(r&&!(n&8)){i(wt.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1,getMinArgumentCount(e),c)}return 0}if(e.typeParameters&&e.typeParameters!==t.typeParameters){t=getCanonicalSignature(t);e=instantiateSignatureInContextOf(e,t,void 0,a)}const d=getParameterCount(e);const p=getNonArrayRestType(e);const u=getNonArrayRestType(t);if(p||u){void instantiateType(p||u,s)}const f=t.declaration?t.declaration.kind:0;const m=!(n&3)&&F&&f!==174&&f!==173&&f!==176;let _=-1;const g=getThisTypeOfSignature(e);if(g&&g!==Ze){const e=getThisTypeOfSignature(t);if(e){const t=!m&&a(g,e,false)||a(e,g,r);if(!t){if(r){i(wt.The_this_types_of_each_signature_are_incompatible)}return 0}_&=t}}const y=p||u?Math.min(d,c):Math.max(d,c);const h=p||u?y-1:-1;for(let c=0;c=getMinArgumentCount(e)&&c=3&&t[0].flags&32768&&t[1].flags&65536&&some(t,isEmptyAnonymousObjectType)?67108864:0)}return!!(e.objectFlags&67108864)}return false}function containsUndefinedType(e){return!!((e.flags&1048576?e.types[0]:e).flags&32768)}function containsNonMissingUndefinedType(e){const t=e.flags&1048576?e.types[0]:e;return!!(t.flags&32768)&&t!==Be}function isStringIndexSignatureOnlyType(e){return e.flags&524288&&!isGenericMappedType(e)&&getPropertiesOfType(e).length===0&&getIndexInfosOfType(e).length===1&&!!getIndexInfoOfType(e,ze)||e.flags&3145728&&every(e.types,isStringIndexSignatureOnlyType)||false}function isEnumTypeRelatedTo(e,t,n){const r=e.flags&8?getParentOfSymbol(e):e;const i=t.flags&8?getParentOfSymbol(t):t;if(r===i){return true}if(r.escapedName!==i.escapedName||!(r.flags&256)||!(i.flags&256)){return false}const o=getSymbolId(r)+","+getSymbolId(i);const a=Ni.get(o);if(a!==void 0&&!(a&2&&n)){return!!(a&1)}const s=getTypeOfSymbol(i);for(const e of getPropertiesOfType(getTypeOfSymbol(r))){if(e.flags&8){const t=getPropertyOfType(s,e.escapedName);if(!t||!(t.flags&8)){if(n){n(wt.Property_0_is_missing_in_type_1,symbolName(e),typeToString(getDeclaredTypeOfSymbol(i),void 0,64))}Ni.set(o,2);return false}const r=getEnumMemberValue(getDeclarationOfKind(e,306)).value;const a=getEnumMemberValue(getDeclarationOfKind(t,306)).value;if(r!==a){const e=typeof r==="string";const s=typeof a==="string";if(r!==void 0&&a!==void 0){if(n){const o=e?`"${escapeString(r)}"`:r;const c=s?`"${escapeString(a)}"`:a;n(wt.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given,symbolName(i),symbolName(t),c,o)}Ni.set(o,2);return false}if(e||s){if(n){const e=r??a;S.assert(typeof e==="string");const o=`"${escapeString(e)}"`;n(wt.One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value,symbolName(i),symbolName(t),o)}Ni.set(o,2);return false}}}}Ni.set(o,1);return true}function isSimpleTypeRelatedTo(e,t,n,r){const i=e.flags;const o=t.flags;if(o&1||i&131072||e===Pe)return true;if(o&2&&!(n===xi&&i&1))return true;if(o&131072)return false;if(i&402653316&&o&4)return true;if(i&128&&i&1024&&o&128&&!(o&1024)&&e.value===t.value)return true;if(i&296&&o&8)return true;if(i&256&&i&1024&&o&256&&!(o&1024)&&e.value===t.value)return true;if(i&2112&&o&64)return true;if(i&528&&o&16)return true;if(i&12288&&o&4096)return true;if(i&32&&o&32&&e.symbol.escapedName===t.symbol.escapedName&&isEnumTypeRelatedTo(e.symbol,t.symbol,r))return true;if(i&1024&&o&1024){if(i&1048576&&o&1048576&&isEnumTypeRelatedTo(e.symbol,t.symbol,r))return true;if(i&2944&&o&2944&&e.value===t.value&&isEnumTypeRelatedTo(e.symbol,t.symbol,r))return true}if(i&32768&&(!k&&!(o&3145728)||o&(32768|16384)))return true;if(i&65536&&(!k&&!(o&3145728)||o&65536))return true;if(i&524288&&o&67108864&&!(n===xi&&isEmptyAnonymousObjectType(e)&&!(getObjectFlags(e)&8192)))return true;if(n===bi||n===Ci){if(i&1)return true;if(i&8&&(o&32||o&256&&o&1024))return true;if(i&256&&!(i&1024)&&(o&32||o&256&&o&1024&&e.value===t.value))return true;if(isUnknownLikeUnionType(t))return true}return false}function isTypeRelatedTo(e,t,n){if(isFreshLiteralType(e)){e=e.regularType}if(isFreshLiteralType(t)){t=t.regularType}if(e===t){return true}if(n!==Ei){if(n===Ci&&!(t.flags&131072)&&isSimpleTypeRelatedTo(t,e,n)||isSimpleTypeRelatedTo(e,t,n)){return true}}else if(!((e.flags|t.flags)&(3145728|8388608|16777216|33554432))){if(e.flags!==t.flags)return false;if(e.flags&67358815)return true}if(e.flags&524288&&t.flags&524288){const r=n.get(getRelationKey(e,t,0,n,false));if(r!==void 0){return!!(r&1)}}if(e.flags&469499904||t.flags&469499904){return checkTypeRelatedTo(e,t,n,void 0)}return false}function isIgnoredJsxProperty(e,t){return getObjectFlags(e)&2048&&isHyphenatedJsxName(t.escapedName)}function getNormalizedType(e,t){while(true){const n=isFreshLiteralType(e)?e.regularType:isGenericTupleType(e)?getNormalizedTupleType(e,t):getObjectFlags(e)&4?e.node?createTypeReference(e.target,getTypeArguments(e)):getSingleBaseForNonAugmentingSubtype(e)||e:e.flags&3145728?getNormalizedUnionOrIntersectionType(e,t):e.flags&33554432?t?e.baseType:getSubstitutionIntersection(e):e.flags&25165824?getSimplifiedType(e,t):e;if(n===e)return n;e=n}}function getNormalizedUnionOrIntersectionType(e,t){const n=getReducedType(e);if(n!==e){return n}if(e.flags&2097152&&shouldNormalizeIntersection(e)){const n=sameMap(e.types,(e=>getNormalizedType(e,t)));if(n!==e.types){return getIntersectionType(n)}}return e}function shouldNormalizeIntersection(e){let t=false;let n=false;for(const r of e.types){t||(t=!!(r.flags&465829888));n||(n=!!(r.flags&98304)||isEmptyAnonymousObjectType(r));if(t&&n)return true}return false}function getNormalizedTupleType(e,t){const n=getElementTypes(e);const r=sameMap(n,(e=>e.flags&25165824?getSimplifiedType(e,t):e));return n!==r?createNormalizedTupleType(e.target,r):e}function checkTypeRelatedTo(e,t,n,r,i,o,a){var s;let c;let l;let p;let u;let f;let _;let g=0;let y=0;let h=0;let v=0;let x=false;let b=0;let C=0;let E;let N;let F=16e6-n.size>>3;S.assert(n!==Ei||!r,"no error reporting in identity checking");const P=isRelatedTo(e,t,3,!!r,i);if(N){reportIncompatibleStack()}if(x){const i=getRelationKey(e,t,0,n,false);n.set(i,2|(F<=0?32:64));(s=G)==null?void 0:s.instant(G.Phase.CheckTypes,"checkTypeRelatedTo_DepthLimit",{sourceId:e.id,targetId:t.id,depth:y,targetDepth:h});const o=F<=0?wt.Excessive_complexity_comparing_types_0_and_1:wt.Excessive_stack_depth_comparing_types_0_and_1;const c=error2(r||m,o,typeToString(e),typeToString(t));if(a){(a.errors||(a.errors=[])).push(c)}}else if(c){if(o){const e=o();if(e){concatenateDiagnosticMessageChains(e,c);c=e}}let s;if(i&&r&&!P&&e.symbol){const r=getSymbolLinks(e.symbol);if(r.originatingImport&&!isImportCall(r.originatingImport)){const e=checkTypeRelatedTo(getTypeOfSymbol(r.target),t,n,void 0);if(e){const e=createDiagnosticForNode(r.originatingImport,wt.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead);s=append(s,e)}}}const d=createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(r),r,c,s);if(l){addRelatedInfo(d,...l)}if(a){(a.errors||(a.errors=[])).push(d)}if(!a||!a.skipLogging){gi.add(d)}}if(r&&a&&a.skipLogging&&P===0){S.assert(!!a.errors,"missed opportunity to interact with error.")}return P!==0;function resetErrorInfo(e){c=e.errorInfo;E=e.lastSkippedInfo;N=e.incompatibleStack;b=e.overrideNextErrorInfo;C=e.skipParentCounter;l=e.relatedInfo}function captureErrorCalculationState(){return{errorInfo:c,lastSkippedInfo:E,incompatibleStack:N==null?void 0:N.slice(),overrideNextErrorInfo:b,skipParentCounter:C,relatedInfo:l==null?void 0:l.slice()}}function reportIncompatibleError(e,...t){b++;E=void 0;(N||(N=[])).push([e,...t])}function reportIncompatibleStack(){const e=N||[];N=void 0;const t=E;E=void 0;if(e.length===1){reportError(...e[0]);if(t){reportRelationError(void 0,...t)}return}let n="";const r=[];while(e.length){const[t,...i]=e.pop();switch(t.code){case wt.Types_of_property_0_are_incompatible.code:{if(n.indexOf("new ")===0){n=`(${n})`}const e=""+i[0];if(n.length===0){n=`${e}`}else if(isIdentifierText(e,zn(T))){n=`${n}.${e}`}else if(e[0]==="["&&e[e.length-1]==="]"){n=`${n}${e}`}else{n=`${n}[${e}]`}break}case wt.Call_signature_return_types_0_and_1_are_incompatible.code:case wt.Construct_signature_return_types_0_and_1_are_incompatible.code:case wt.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:case wt.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:{if(n.length===0){let e=t;if(t.code===wt.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code){e=wt.Call_signature_return_types_0_and_1_are_incompatible}else if(t.code===wt.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code){e=wt.Construct_signature_return_types_0_and_1_are_incompatible}r.unshift([e,i[0],i[1]])}else{const e=t.code===wt.Construct_signature_return_types_0_and_1_are_incompatible.code||t.code===wt.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"new ":"";const r=t.code===wt.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code||t.code===wt.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"":"...";n=`${e}${n}(${r})`}break}case wt.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code:{r.unshift([wt.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,i[0],i[1]]);break}case wt.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code:{r.unshift([wt.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,i[0],i[1],i[2]]);break}default:return S.fail(`Unhandled Diagnostic: ${t.code}`)}}if(n){reportError(n[n.length-1]===")"?wt.The_types_returned_by_0_are_incompatible_between_these_types:wt.The_types_of_0_are_incompatible_between_these_types,n)}else{r.shift()}for(const[e,...t]of r){const n=e.elidedInCompatabilityPyramid;e.elidedInCompatabilityPyramid=false;reportError(e,...t);e.elidedInCompatabilityPyramid=n}if(t){reportRelationError(void 0,...t)}}function reportError(e,...t){S.assert(!!r);if(N)reportIncompatibleStack();if(e.elidedInCompatabilityPyramid)return;if(C===0){c=chainDiagnosticMessages(c,e,...t)}else{C--}}function reportParentSkippedError(e,...t){reportError(e,...t);C++}function associateRelatedInfo(e){S.assert(!!c);if(!l){l=[e]}else{l.push(e)}}function reportRelationError(e,t,r){if(N)reportIncompatibleStack();const[i,o]=getTypeNamesForErrorDisplay(t,r);let a=t;let s=i;if(!(r.flags&131072)&&isLiteralType(t)&&!typeCouldHaveTopLevelSingletonTypes(r)){a=getBaseTypeOfLiteralType(t);S.assert(!isTypeAssignableTo(a,r),"generalized source shouldn't be assignable");s=getTypeNameForErrorDisplay(a)}const l=r.flags&8388608&&!(t.flags&8388608)?r.objectType.flags:r.flags;if(l&262144&&r!==Ot&&r!==Lt){const e=getBaseConstraintOfType(r);let n;if(e&&(isTypeAssignableTo(a,e)||(n=isTypeAssignableTo(t,e)))){reportError(wt._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2,n?i:s,o,typeToString(e))}else{c=void 0;reportError(wt._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1,o,s)}}if(!e){if(n===Ci){e=wt.Type_0_is_not_comparable_to_type_1}else if(i===o){e=wt.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated}else if(L&&getExactOptionalUnassignableProperties(t,r).length){e=wt.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties}else{if(t.flags&128&&r.flags&1048576){const e=getSuggestedTypeForNonexistentStringLiteralType(t,r);if(e){reportError(wt.Type_0_is_not_assignable_to_type_1_Did_you_mean_2,s,o,typeToString(e));return}}e=wt.Type_0_is_not_assignable_to_type_1}}else if(e===wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1&&L&&getExactOptionalUnassignableProperties(t,r).length){e=wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties}reportError(e,s,o)}function tryElaborateErrorsForPrimitivesAndObjects(e,t){const n=symbolValueDeclarationIsContextSensitive(e.symbol)?typeToString(e,e.symbol.valueDeclaration):typeToString(e);const r=symbolValueDeclarationIsContextSensitive(t.symbol)?typeToString(t,t.symbol.valueDeclaration):typeToString(t);if(pn===e&&ze===t||fn===e&&Ve===t||mn===e&&Xe===t||getGlobalESSymbolType()===e&&Ye===t){reportError(wt._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible,r,n)}}function tryElaborateArrayLikeErrors(e,t,n){if(isTupleType(e)){if(e.target.readonly&&isMutableArrayOrTuple(t)){if(n){reportError(wt.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,typeToString(e),typeToString(t))}return false}return isArrayOrTupleType(t)}if(isReadonlyArrayType(e)&&isMutableArrayOrTuple(t)){if(n){reportError(wt.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,typeToString(e),typeToString(t))}return false}if(isTupleType(t)){return isArrayType(e)}return true}function isRelatedToWorker(e,t,n){return isRelatedTo(e,t,3,n)}function isRelatedTo(e,t,r=3,i=false,o,a=0){if(e===t)return-1;if(e.flags&524288&&t.flags&402784252){if(n===Ci&&!(t.flags&131072)&&isSimpleTypeRelatedTo(t,e,n)||isSimpleTypeRelatedTo(e,t,n,i?reportError:void 0)){return-1}if(i){reportErrorResults(e,t,e,t,o)}return 0}const s=getNormalizedType(e,false);let c=getNormalizedType(t,true);if(s===c)return-1;if(n===Ei){if(s.flags!==c.flags)return 0;if(s.flags&67358815)return-1;traceUnionsOrIntersectionsTooLarge(s,c);return recursiveTypeRelatedTo(s,c,false,0,r)}if(s.flags&262144&&getConstraintOfType(s)===c){return-1}if(s.flags&470302716&&c.flags&1048576){const e=c.types;const t=e.length===2&&e[0].flags&98304?e[1]:e.length===3&&e[0].flags&98304&&e[1].flags&98304?e[2]:void 0;if(t&&!(t.flags&98304)){c=getNormalizedType(t,true);if(s===c)return-1}}if(n===Ci&&!(c.flags&131072)&&isSimpleTypeRelatedTo(c,s,n)||isSimpleTypeRelatedTo(s,c,n,i?reportError:void 0))return-1;if(s.flags&469499904||c.flags&469499904){const l=!(a&2)&&(isObjectLiteralType2(s)&&getObjectFlags(s)&8192);if(l){if(hasExcessProperties(s,c,i)){if(i){reportRelationError(o,s,t.aliasSymbol?t:c)}return 0}}const d=(n!==Ci||isUnitType(s))&&!(a&2)&&s.flags&(402784252|524288|2097152)&&s!==en&&c.flags&(524288|2097152)&&isWeakType(c)&&(getPropertiesOfType(s).length>0||typeHasCallOrConstructSignatures(s));const p=!!(getObjectFlags(s)&2048);if(d&&!hasCommonProperties(s,c,p)){if(i){const n=typeToString(e.aliasSymbol?e:s);const r=typeToString(t.aliasSymbol?t:c);const i=getSignaturesOfType(s,0);const o=getSignaturesOfType(s,1);if(i.length>0&&isRelatedTo(getReturnTypeOfSignature(i[0]),c,1,false)||o.length>0&&isRelatedTo(getReturnTypeOfSignature(o[0]),c,1,false)){reportError(wt.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it,n,r)}else{reportError(wt.Type_0_has_no_properties_in_common_with_type_1,n,r)}}return 0}traceUnionsOrIntersectionsTooLarge(s,c);const u=s.flags&1048576&&s.types.length<4&&!(c.flags&1048576)||c.flags&1048576&&c.types.length<4&&!(s.flags&469499904);const f=u?unionOrIntersectionRelatedTo(s,c,i,a):recursiveTypeRelatedTo(s,c,i,a,r);if(f){return f}}if(i){reportErrorResults(e,t,s,c,o)}return 0}function reportErrorResults(e,t,n,i,o){var a,s;const l=!!getSingleBaseForNonAugmentingSubtype(e);const d=!!getSingleBaseForNonAugmentingSubtype(t);n=e.aliasSymbol||l?e:n;i=t.aliasSymbol||d?t:i;let p=b>0;if(p){b--}if(n.flags&524288&&i.flags&524288){const e=c;tryElaborateArrayLikeErrors(n,i,true);if(c!==e){p=!!c}}if(n.flags&524288&&i.flags&402784252){tryElaborateErrorsForPrimitivesAndObjects(n,i)}else if(n.symbol&&n.flags&524288&&en===n){reportError(wt.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead)}else if(getObjectFlags(n)&2048&&i.flags&2097152){const e=i.types;const t=getJsxType(la.IntrinsicAttributes,r);const n=getJsxType(la.IntrinsicClassAttributes,r);if(!isErrorType(t)&&!isErrorType(n)&&(contains(e,t)||contains(e,n))){return}}else{c=elaborateNeverIntersection(c,t)}if(!o&&p){const e=captureErrorCalculationState();reportRelationError(o,n,i);let t;if(c&&c!==e.errorInfo){t={code:c.code,messageText:c.messageText}}resetErrorInfo(e);if(t&&c){c.canonicalHead=t}E=[n,i];return}reportRelationError(o,n,i);if(n.flags&262144&&((s=(a=n.symbol)==null?void 0:a.declarations)==null?void 0:s[0])&&!getConstraintOfType(n)){const e=cloneTypeParameter(n);e.constraint=instantiateType(i,makeUnaryTypeMapper(n,e));if(hasNonCircularBaseConstraint(e)){const e=typeToString(i,n.symbol.declarations[0]);associateRelatedInfo(createDiagnosticForNode(n.symbol.declarations[0],wt.This_type_parameter_might_need_an_extends_0_constraint,e))}}}function traceUnionsOrIntersectionsTooLarge(e,t){if(!G){return}if(e.flags&3145728&&t.flags&3145728){const n=e;const i=t;if(n.objectFlags&i.objectFlags&32768){return}const o=n.types.length;const a=i.types.length;if(o*a>1e6){G.instant(G.Phase.CheckTypes,"traceUnionsOrIntersectionsTooLarge_DepthLimit",{sourceId:e.id,sourceSize:o,targetId:t.id,targetSize:a,pos:r==null?void 0:r.pos,end:r==null?void 0:r.end})}}}function getTypeOfPropertyInTypes(e,t){const appendPropType=(e,n)=>{var r;n=getApparentType(n);const i=n.flags&3145728?getPropertyOfUnionOrIntersectionType(n,t):getPropertyOfObjectType(n,t);const o=i&&getTypeOfSymbol(i)||((r=getApplicableIndexInfoForName(n,t))==null?void 0:r.type)||Me;return append(e,o)};return getUnionType(reduceLeft(e,appendPropType,void 0)||d)}function hasExcessProperties(e,t,i){var o;if(!isExcessPropertyCheckTarget(t)||!A&&getObjectFlags(t)&4096){return false}const a=!!(getObjectFlags(e)&2048);if((n===bi||n===Ci)&&(isTypeSubsetOf(en,t)||!a&&isEmptyObjectType(t))){return false}let s=t;let c;if(t.flags&1048576){s=findMatchingDiscriminantType(e,t,isRelatedTo)||filterPrimitivesIfContainsNonPrimitive(t);c=s.flags&1048576?s.types:[s]}for(const t of getPropertiesOfType(e)){if(shouldCheckAsExcessProperty(t,e.symbol)&&!isIgnoredJsxProperty(e,t)){if(!isKnownProperty(s,t.escapedName,a)){if(i){const n=filterType(s,isExcessPropertyCheckTarget);if(!r)return S.fail();if(isJsxAttributes(r)||isJsxOpeningLikeElement(r)||isJsxOpeningLikeElement(r.parent)){if(t.valueDeclaration&&isJsxAttribute(t.valueDeclaration)&&getSourceFileOfNode(r)===getSourceFileOfNode(t.valueDeclaration.name)){r=t.valueDeclaration.name}const e=symbolToString(t);const i=getSuggestedSymbolForNonexistentJSXAttribute(e,n);const o=i?symbolToString(i):void 0;if(o){reportError(wt.Property_0_does_not_exist_on_type_1_Did_you_mean_2,e,typeToString(n),o)}else{reportError(wt.Property_0_does_not_exist_on_type_1,e,typeToString(n))}}else{const i=((o=e.symbol)==null?void 0:o.declarations)&&firstOrUndefined(e.symbol.declarations);let a;if(t.valueDeclaration&&findAncestor(t.valueDeclaration,(e=>e===i))&&getSourceFileOfNode(i)===getSourceFileOfNode(r)){const e=t.valueDeclaration;S.assertNode(e,isObjectLiteralElementLike);const i=e.name;r=i;if(isIdentifier(i)){a=getSuggestionForNonexistentProperty(i,n)}}if(a!==void 0){reportParentSkippedError(wt.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,symbolToString(t),typeToString(n),a)}else{reportParentSkippedError(wt.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,symbolToString(t),typeToString(n))}}}return true}if(c&&!isRelatedTo(getTypeOfSymbol(t),getTypeOfPropertyInTypes(c,t.escapedName),3,i)){if(i){reportIncompatibleError(wt.Types_of_property_0_are_incompatible,symbolToString(t))}return true}}}return false}function shouldCheckAsExcessProperty(e,t){return e.valueDeclaration&&t.valueDeclaration&&e.valueDeclaration.parent===t.valueDeclaration}function unionOrIntersectionRelatedTo(e,t,r,i){if(e.flags&1048576){if(t.flags&1048576){const n=e.origin;if(n&&n.flags&2097152&&t.aliasSymbol&&contains(n.types,t)){return-1}const r=t.origin;if(r&&r.flags&1048576&&e.aliasSymbol&&contains(r.types,e)){return-1}}return n===Ci?someTypeRelatedToType(e,t,r&&!(e.flags&402784252),i):eachTypeRelatedToType(e,t,r&&!(e.flags&402784252),i)}if(t.flags&1048576){return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(e),t,r&&!(e.flags&402784252)&&!(t.flags&402784252),i)}if(t.flags&2097152){return typeRelatedToEachType(e,t,r,2)}if(n===Ci&&t.flags&402784252){const n=sameMap(e.types,(e=>e.flags&465829888?getBaseConstraintOfType(e)||Le:e));if(n!==e.types){e=getIntersectionType(n);if(e.flags&131072){return 0}if(!(e.flags&2097152)){return isRelatedTo(e,t,1,false)||isRelatedTo(t,e,1,false)}}}return someTypeRelatedToType(e,t,false,1)}function eachTypeRelatedToSomeType(e,t){let n=-1;const r=e.types;for(const e of r){const r=typeRelatedToSomeType(e,t,false,0);if(!r){return 0}n&=r}return n}function typeRelatedToSomeType(e,t,r,i){const o=t.types;if(t.flags&1048576){if(containsType(o,e)){return-1}if(n!==Ci&&getObjectFlags(t)&32768&&!(e.flags&1024)&&(e.flags&(128|512|2048)||(n===vi||n===xi)&&e.flags&256)){const t=e===e.regularType?e.freshType:e.regularType;const n=e.flags&128?ze:e.flags&256?Ve:e.flags&2048?qe:void 0;return n&&containsType(o,n)||t&&containsType(o,t)?-1:0}const r=getMatchingUnionConstituentForType(t,e);if(r){const t=isRelatedTo(e,r,2,false,void 0,i);if(t){return t}}}for(const t of o){const n=isRelatedTo(e,t,2,false,void 0,i);if(n){return n}}if(r){const n=getBestMatchingType(e,t,isRelatedTo);if(n){isRelatedTo(e,n,2,true,void 0,i)}}return 0}function typeRelatedToEachType(e,t,n,r){let i=-1;const o=t.types;for(const t of o){const o=isRelatedTo(e,t,2,n,void 0,r);if(!o){return 0}i&=o}return i}function someTypeRelatedToType(e,t,n,r){const i=e.types;if(e.flags&1048576&&containsType(i,t)){return-1}const o=i.length;for(let e=0;e=a.types.length&&o.length%a.types.length===0){const t=isRelatedTo(s,a.types[e%a.types.length],3,false,void 0,r);if(t){i&=t;continue}}const c=isRelatedTo(s,t,1,n,void 0,r);if(!c){return 0}i&=c}return i}function typeArgumentsRelatedTo(e=d,t=d,r=d,i,o){if(e.length!==t.length&&n===Ei){return 0}const a=e.length<=t.length?e.length:t.length;let s=-1;for(let c=0;c{C|=e?16:8;return S(e)}}let E;if(v===3){(a=G)==null?void 0:a.instant(G.Phase.CheckTypes,"recursiveTypeRelatedTo_DepthLimit",{sourceId:e.id,sourceIdStack:f.map((e=>e.id)),targetId:t.id,targetIdStack:_.map((e=>e.id)),depth:y,targetDepth:h});E=3}else{(s=G)==null?void 0:s.push(G.Phase.CheckTypes,"structuredTypeRelatedTo",{sourceId:e.id,targetId:t.id});E=structuredTypeRelatedTo(e,t,r,i);(c=G)==null?void 0:c.pop()}if(_t){_t=S}if(o&1){y--}if(o&2){h--}v=T;if(E){if(E===-1||y===0&&h===0){if(E===-1||E===3){resetMaybeStack(true)}else{resetMaybeStack(false)}}}else{n.set(l,2|C);F--;resetMaybeStack(false)}return E;function resetMaybeStack(e){for(let t=m;tt!==e))){a=isRelatedTo(n,t,1,false,void 0,i)}}if(a&&!(i&2)&&t.flags&2097152&&!isGenericObjectType(t)&&e.flags&(524288|2097152)){a&=propertiesRelatedTo(e,t,r,void 0,false,0);if(a&&isObjectLiteralType2(e)&&getObjectFlags(e)&8192){a&=indexSignaturesRelatedTo(e,t,false,r,0)}}else if(a&&isNonGenericObjectType(t)&&!isArrayOrTupleType(t)&&e.flags&2097152&&getApparentType(e).flags&3670016&&!some(e.types,(e=>e===t||!!(getObjectFlags(e)&262144)))){a&=propertiesRelatedTo(e,t,r,void 0,true,i)}}if(a){resetErrorInfo(o)}return a}function getApparentMappedTypeKeys(e,t){const n=getApparentType(getModifiersTypeFromMappedType(t));const r=[];forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(n,8576,false,(n=>void r.push(instantiateType(e,appendTypeMapping(t.mapper,getTypeParameterFromMappedType(t),n)))));return getUnionType(r)}function structuredTypeRelatedToWorker(e,t,r,i,o){let a;let s;let l=false;let p=e.flags;const u=t.flags;if(n===Ei){if(p&3145728){let n=eachTypeRelatedToSomeType(e,t);if(n){n&=eachTypeRelatedToSomeType(t,e)}return n}if(p&4194304){return isRelatedTo(e.type,t.type,3,false)}if(p&8388608){if(a=isRelatedTo(e.objectType,t.objectType,3,false)){if(a&=isRelatedTo(e.indexType,t.indexType,3,false)){return a}}}if(p&16777216){if(e.root.isDistributive===t.root.isDistributive){if(a=isRelatedTo(e.checkType,t.checkType,3,false)){if(a&=isRelatedTo(e.extendsType,t.extendsType,3,false)){if(a&=isRelatedTo(getTrueTypeFromConditionalType(e),getTrueTypeFromConditionalType(t),3,false)){if(a&=isRelatedTo(getFalseTypeFromConditionalType(e),getFalseTypeFromConditionalType(t),3,false)){return a}}}}}}if(p&33554432){if(a=isRelatedTo(e.baseType,t.baseType,3,false)){if(a&=isRelatedTo(e.constraint,t.constraint,3,false)){return a}}}if(!(p&524288)){return 0}}else if(p&3145728||u&3145728){if(a=unionOrIntersectionRelatedTo(e,t,r,i)){return a}if(!(p&465829888||p&524288&&u&1048576||p&2097152&&u&(524288|1048576|465829888))){return 0}}if(p&(524288|16777216)&&e.aliasSymbol&&e.aliasTypeArguments&&e.aliasSymbol===t.aliasSymbol&&!(isMarkerType(e)||isMarkerType(t))){const n=getAliasVariances(e.aliasSymbol);if(n===d){return 1}const r=getSymbolLinks(e.aliasSymbol).typeParameters;const o=getMinTypeArgumentCount(r);const a=fillMissingTypeArguments(e.aliasTypeArguments,r,o,isInJSFile(e.aliasSymbol.valueDeclaration));const s=fillMissingTypeArguments(t.aliasTypeArguments,r,o,isInJSFile(e.aliasSymbol.valueDeclaration));const c=relateVariances(a,s,n,i);if(c!==void 0){return c}}if(isSingleElementGenericTupleType(e)&&!e.target.readonly&&(a=isRelatedTo(getTypeArguments(e)[0],t,1))||isSingleElementGenericTupleType(t)&&(t.target.readonly||isMutableArrayOrTuple(getBaseConstraintOfType(e)||e))&&(a=isRelatedTo(e,getTypeArguments(t)[0],2))){return a}if(u&262144){if(getObjectFlags(e)&32&&!e.declaration.nameType&&isRelatedTo(getIndexType(t),getConstraintTypeFromMappedType(e),3)){if(!(getMappedTypeModifiers(e)&4)){const n=getTemplateTypeFromMappedType(e);const i=getIndexedAccessType(t,getTypeParameterFromMappedType(e));if(a=isRelatedTo(n,i,3,r)){return a}}}if(n===Ci&&p&262144){let n=getConstraintOfTypeParameter(e);if(n){while(n&&someType(n,(e=>!!(e.flags&262144)))){if(a=isRelatedTo(n,t,1,false)){return a}n=getConstraintOfTypeParameter(n)}}return 0}}else if(u&4194304){const n=t.type;if(p&4194304){if(a=isRelatedTo(n,e.type,3,false)){return a}}if(isTupleType(n)){if(a=isRelatedTo(e,getKnownKeysOfTupleType(n),2,r)){return a}}else{const i=getSimplifiedTypeOrConstraint(n);if(i){if(isRelatedTo(e,getIndexType(i,t.indexFlags|4),2,r)===-1){return-1}}else if(isGenericMappedType(n)){const t=getNameTypeFromMappedType(n);const i=getConstraintTypeFromMappedType(n);let o;if(t&&isMappedTypeWithKeyofConstraintDeclaration(n)){const e=getApparentMappedTypeKeys(t,n);o=getUnionType([e,t])}else{o=t||i}if(isRelatedTo(e,o,2,r)===-1){return-1}}}}else if(u&8388608){if(p&8388608){if(a=isRelatedTo(e.objectType,t.objectType,3,r)){a&=isRelatedTo(e.indexType,t.indexType,3,r)}if(a){return a}if(r){s=c}}if(n===bi||n===Ci){const n=t.objectType;const l=t.indexType;const d=getBaseConstraintOfType(n)||n;const p=getBaseConstraintOfType(l)||l;if(!isGenericObjectType(d)&&!isGenericIndexType(p)){const t=4|(d!==n?2:0);const l=getIndexedAccessTypeOrUndefined(d,p,t);if(l){if(r&&s){resetErrorInfo(o)}if(a=isRelatedTo(e,l,2,r,void 0,i)){return a}if(r&&s&&c){c=countMessageChainBreadth([s])<=countMessageChainBreadth([c])?s:c}}}}if(r){s=void 0}}else if(isGenericMappedType(t)&&n!==Ei){const n=!!t.declaration.nameType;const i=getTemplateTypeFromMappedType(t);const l=getMappedTypeModifiers(t);if(!(l&8)){if(!n&&i.flags&8388608&&i.objectType===e&&i.indexType===getTypeParameterFromMappedType(t)){return-1}if(!isGenericMappedType(e)){const i=n?getNameTypeFromMappedType(t):getConstraintTypeFromMappedType(t);const d=getIndexType(e,2);const p=l&4;const u=p?intersectTypes(i,d):void 0;if(p?!(u.flags&131072):isRelatedTo(i,d,3)){const o=getTemplateTypeFromMappedType(t);const s=getTypeParameterFromMappedType(t);const c=extractTypesOfKind(o,~98304);if(!n&&c.flags&8388608&&c.indexType===s){if(a=isRelatedTo(e,c.objectType,2,r)){return a}}else{const t=n?u||i:u?getIntersectionType([u,s]):s;const c=getIndexedAccessType(e,t);if(a=isRelatedTo(c,o,3,r)){return a}}}s=c;resetErrorInfo(o)}}}else if(u&16777216){if(isDeeplyNestedType(t,_,h,10)){return 3}const n=t;if(!n.root.inferTypeParameters&&!isDistributionDependent(n.root)&&!(e.flags&16777216&&e.root===n.root)){const t=!isTypeAssignableTo(getPermissiveInstantiation(n.checkType),getPermissiveInstantiation(n.extendsType));const r=!t&&isTypeAssignableTo(getRestrictiveInstantiation(n.checkType),getRestrictiveInstantiation(n.extendsType));if(a=t?-1:isRelatedTo(e,getTrueTypeFromConditionalType(n),2,false,void 0,i)){a&=r?-1:isRelatedTo(e,getFalseTypeFromConditionalType(n),2,false,void 0,i);if(a){return a}}}}else if(u&134217728){if(p&134217728){if(n===Ci){return templateLiteralTypesDefinitelyUnrelated(e,t)?0:-1}instantiateType(e,gt)}if(isTypeMatchedByTemplateLiteralType(e,t)){return-1}}else if(t.flags&268435456){if(!(e.flags&268435456)){if(isMemberOfStringMapping(e,t)){return-1}}}if(p&8650752){if(!(p&8388608&&u&8388608)){const n=getConstraintOfType(e)||Le;if(a=isRelatedTo(n,t,1,false,void 0,i)){return a}else if(a=isRelatedTo(getTypeWithThisArgument(n,e),t,1,r&&n!==Le&&!(u&p&262144),void 0,i)){return a}if(isMappedTypeGenericIndexedAccess(e)){const n=getConstraintOfType(e.indexType);if(n){if(a=isRelatedTo(getIndexedAccessType(e.objectType,n),t,1,r)){return a}}}}}else if(p&4194304){const n=shouldDeferIndexType(e.type,e.indexFlags)&&getObjectFlags(e.type)&32;if(a=isRelatedTo(at,t,1,r&&!n)){return a}if(n){const n=e.type;const i=getNameTypeFromMappedType(n);const o=i&&isMappedTypeWithKeyofConstraintDeclaration(n)?getApparentMappedTypeKeys(i,n):i||getConstraintTypeFromMappedType(n);if(a=isRelatedTo(o,t,1,r)){return a}}}else if(p&134217728&&!(u&524288)){if(!(u&134217728)){const n=getBaseConstraintOfType(e);if(n&&n!==e&&(a=isRelatedTo(n,t,1,r))){return a}}}else if(p&268435456){if(u&268435456){if(e.symbol!==t.symbol){return 0}if(a=isRelatedTo(e.type,t.type,3,r)){return a}}else{const n=getBaseConstraintOfType(e);if(n&&(a=isRelatedTo(n,t,1,r))){return a}}}else if(p&16777216){if(isDeeplyNestedType(e,f,y,10)){return 3}if(u&16777216){const n=e.root.inferTypeParameters;let i=e.extendsType;let o;if(n){const e=createInferenceContext(n,void 0,0,isRelatedToWorker);inferTypes(e.inferences,t.extendsType,i,512|1024);i=instantiateType(i,e.mapper);o=e.mapper}if(isTypeIdenticalTo(i,t.extendsType)&&(isRelatedTo(e.checkType,t.checkType,3)||isRelatedTo(t.checkType,e.checkType,3))){if(a=isRelatedTo(instantiateType(getTrueTypeFromConditionalType(e),o),getTrueTypeFromConditionalType(t),3,r)){a&=isRelatedTo(getFalseTypeFromConditionalType(e),getFalseTypeFromConditionalType(t),3,r)}if(a){return a}}}const n=getDefaultConstraintOfConditionalType(e);if(n){if(a=isRelatedTo(n,t,1,r)){return a}}const i=!(u&16777216)&&hasNonCircularBaseConstraint(e)?getConstraintOfDistributiveConditionalType(e):void 0;if(i){resetErrorInfo(o);if(a=isRelatedTo(i,t,1,r)){return a}}}else{if(n!==vi&&n!==xi&&isPartialMappedType(t)&&isEmptyObjectType(e)){return-1}if(isGenericMappedType(t)){if(isGenericMappedType(e)){if(a=mappedTypeRelatedTo(e,t,r)){return a}}return 0}const f=!!(p&402784252);if(n!==Ei){e=getApparentType(e);p=e.flags}else if(isGenericMappedType(e)){return 0}if(getObjectFlags(e)&4&&getObjectFlags(t)&4&&e.target===t.target&&!isTupleType(e)&&!(isMarkerType(e)||isMarkerType(t))){if(isEmptyArrayLiteralType(e)){return-1}const n=getVariances(e.target);if(n===d){return 1}const r=relateVariances(getTypeArguments(e),getTypeArguments(t),n,i);if(r!==void 0){return r}}else if(isReadonlyArrayType(t)?everyType(e,isArrayOrTupleType):isArrayType(t)&&everyType(e,(e=>isTupleType(e)&&!e.target.readonly))){if(n!==Ei){return isRelatedTo(getIndexTypeOfType(e,Ve)||ke,getIndexTypeOfType(t,Ve)||ke,3,r)}else{return 0}}else if(isGenericTupleType(e)&&isTupleType(t)&&!isGenericTupleType(t)){const n=getBaseConstraintOrType(e);if(n!==e){return isRelatedTo(n,t,1,r)}}else if((n===vi||n===xi)&&isEmptyObjectType(t)&&getObjectFlags(t)&8192&&!isEmptyObjectType(e)){return 0}if(p&(524288|2097152)&&u&524288){const n=r&&c===o.errorInfo&&!f;a=propertiesRelatedTo(e,t,n,void 0,false,i);if(a){a&=signaturesRelatedTo(e,t,0,n,i);if(a){a&=signaturesRelatedTo(e,t,1,n,i);if(a){a&=indexSignaturesRelatedTo(e,t,f,n,i)}}}if(l&&a){c=s||c||o.errorInfo}else if(a){return a}}if(p&(524288|2097152)&&u&1048576){const n=extractTypesOfKind(t,524288|2097152|33554432);if(n.flags&1048576){const t=typeRelatedToDiscriminatedType(e,n);if(t){return t}}}}return 0;function countMessageChainBreadth(e){if(!e)return 0;return reduceLeft(e,((e,t)=>e+1+countMessageChainBreadth(t.next)),0)}function relateVariances(e,t,n,i){if(a=typeArgumentsRelatedTo(e,t,n,r,i)){return a}if(some(n,(e=>!!(e&24)))){s=void 0;resetErrorInfo(o);return void 0}const p=t&&hasCovariantVoidArgument(t,n);l=!p;if(n!==d&&!p){if(l&&!(r&&some(n,(e=>(e&7)===0)))){return 0}s=c;resetErrorInfo(o)}}}function mappedTypeRelatedTo(e,t,r){const i=n===Ci||(n===Ei?getMappedTypeModifiers(e)===getMappedTypeModifiers(t):getCombinedMappedTypeOptionality(e)<=getCombinedMappedTypeOptionality(t));if(i){let n;const i=getConstraintTypeFromMappedType(t);const o=instantiateType(getConstraintTypeFromMappedType(e),getCombinedMappedTypeOptionality(e)<0?yt:gt);if(n=isRelatedTo(i,o,3,r)){const i=createTypeMapper([getTypeParameterFromMappedType(e)],[getTypeParameterFromMappedType(t)]);if(instantiateType(getNameTypeFromMappedType(e),i)===instantiateType(getNameTypeFromMappedType(t),i)){return n&isRelatedTo(instantiateType(getTemplateTypeFromMappedType(e),i),getTemplateTypeFromMappedType(t),3,r)}}}return 0}function typeRelatedToDiscriminatedType(e,t){var r;const i=getPropertiesOfType(e);const o=findDiscriminantProperties(i,t);if(!o)return 0;let a=1;for(const n of o){a*=countTypes(getNonMissingTypeOfSymbol(n));if(a>25){(r=G)==null?void 0:r.instant(G.Phase.CheckTypes,"typeRelatedToDiscriminatedType_DepthLimit",{sourceId:e.id,targetId:t.id,numCombinations:a});return 0}}const s=new Array(o.length);const c=new Set;for(let e=0;er[i]),false,0,k||n===Ci);if(!l){continue e}}pushIfUnique(d,a,equateValues);i=true}if(!i){return 0}}let p=-1;for(const t of d){p&=propertiesRelatedTo(e,t,false,c,false,0);if(p){p&=signaturesRelatedTo(e,t,0,false,0);if(p){p&=signaturesRelatedTo(e,t,1,false,0);if(p&&!(isTupleType(e)&&isTupleType(t))){p&=indexSignaturesRelatedTo(e,t,false,false,0)}}}if(!p){return p}}return p}function excludeProperties(e,t){if(!t||e.length===0)return e;let n;for(let r=0;r5){reportError(wt.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more,typeToString(e),typeToString(t),map(a.slice(0,4),(e=>symbolToString(e))).join(", "),a.length-4)}else{reportError(wt.Type_0_is_missing_the_following_properties_from_type_1_Colon_2,typeToString(e),typeToString(t),map(a,(e=>symbolToString(e))).join(", "))}if(o&&c){b++}}}function propertiesRelatedTo(e,t,r,i,o,a){if(n===Ei){return propertiesIdenticalTo(e,t,i)}let s=-1;if(isTupleType(t)){if(isArrayOrTupleType(e)){if(!t.target.readonly&&(isReadonlyArrayType(e)||isTupleType(e)&&e.target.readonly)){return 0}const n=getTypeReferenceArity(e);const o=getTypeReferenceArity(t);const c=isTupleType(e)?e.target.combinedFlags&4:4;const l=!!(t.target.combinedFlags&12);const d=isTupleType(e)?e.target.minLength:0;const p=t.target.minLength;if(!c&&n=m?o-1-Math.min(p,_):c;const h=t.target.elementFlags[y];if(h&8&&!(d&8)){if(r){reportError(wt.Source_provides_no_match_for_variadic_element_at_position_0_in_target,y)}return 0}if(d&8&&!(h&12)){if(r){reportError(wt.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target,c,y)}return 0}if(h&1&&!(d&1)){if(r){reportError(wt.Source_provides_no_match_for_required_element_at_position_0_in_target,y)}return 0}if(g){if(d&12||h&12){g=false}if(g&&(i==null?void 0:i.has(""+c))){continue}}const T=removeMissingType(u[c],!!(d&h&2));const S=f[y];const v=d&8&&h&4?createArrayType(S):removeMissingType(S,!!(h&2));const x=isRelatedTo(T,v,3,r,void 0,a);if(!x){if(r&&(o>1||n>1)){if(l&&c>=m&&p>=_&&m!==n-_-1){reportIncompatibleError(wt.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,m,n-_-1,y)}else{reportIncompatibleError(wt.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,c,y)}}return 0}s&=x}return s}if(t.target.combinedFlags&12){return 0}}const c=(n===vi||n===xi)&&!isObjectLiteralType2(e)&&!isEmptyArrayLiteralType(e)&&!isTupleType(e);const l=getUnmatchedProperty(e,t,c,false);if(l){if(r&&shouldReportUnmatchedPropertyError(e,t)){reportUnmatchedProperty(e,t,l,c)}return 0}if(isObjectLiteralType2(t)){for(const n of excludeProperties(getPropertiesOfType(e),i)){if(!getPropertyOfObjectType(t,n.escapedName)){const e=getTypeOfSymbol(n);if(!(e.flags&32768)){if(r){reportError(wt.Property_0_does_not_exist_on_type_1,symbolToString(n),typeToString(t))}return 0}}}}const d=getPropertiesOfType(t);const p=isTupleType(e)&&isTupleType(t);for(const c of excludeProperties(d,i)){const i=c.escapedName;if(!(c.flags&4194304)&&(!p||isNumericLiteralName(i)||i==="length")&&(!o||c.flags&16777216)){const o=getPropertyOfType(e,i);if(o&&o!==c){const i=propertyRelatedTo(e,t,o,c,getNonMissingTypeOfSymbol,r,a,n===Ci);if(!i){return 0}s&=i}}}return s}function propertiesIdenticalTo(e,t,n){if(!(e.flags&524288&&t.flags&524288)){return 0}const r=excludeProperties(getPropertiesOfObjectType(e),n);const i=excludeProperties(getPropertiesOfObjectType(t),n);if(r.length!==i.length){return 0}let o=-1;for(const e of r){const n=getPropertyOfObjectType(t,e.escapedName);if(!n){return 0}const r=compareProperties2(e,n,isRelatedTo);if(!r){return 0}o&=r}return o}function signaturesRelatedTo(e,t,r,i,o){var a,s;if(n===Ei){return signaturesIdenticalTo(e,t,r)}if(t===Nt||e===Nt){return-1}const c=e.symbol&&isJSConstructor(e.symbol.valueDeclaration);const l=t.symbol&&isJSConstructor(t.symbol.valueDeclaration);const d=getSignaturesOfType(e,c&&r===1?0:r);const p=getSignaturesOfType(t,l&&r===1?0:r);if(r===1&&d.length&&p.length){const e=!!(d[0].flags&4);const t=!!(p[0].flags&4);if(e&&!t){if(i){reportError(wt.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type)}return 0}if(!constructorVisibilitiesAreCompatible(d[0],p[0],i)){return 0}}let u=-1;const f=r===1?reportIncompatibleConstructSignatureReturn:reportIncompatibleCallSignatureReturn;const m=getObjectFlags(e);const _=getObjectFlags(t);if(m&64&&_&64&&e.symbol===t.symbol||m&4&&_&4&&e.target===t.target){S.assertEqual(d.length,p.length);for(let e=0;esignatureToString(e,void 0,262144,r);reportError(wt.Type_0_is_not_assignable_to_type_1,constructSignatureToString(t),constructSignatureToString(c));reportError(wt.Types_of_construct_signatures_are_incompatible);return u}}else{e:for(const t of p){const n=captureErrorCalculationState();let a=i;for(const e of d){const r=signatureRelatedTo(e,t,true,a,o,f(e,t));if(r){u&=r;resetErrorInfo(n);continue e}a=false}if(a){reportError(wt.Type_0_provides_no_match_for_the_signature_1,typeToString(e),signatureToString(t,void 0,void 0,r))}return 0}}return u}function shouldReportUnmatchedPropertyError(e,t){const n=getSignaturesOfStructuredType(e,0);const r=getSignaturesOfStructuredType(e,1);const i=getPropertiesOfObjectType(e);if((n.length||r.length)&&!i.length){if(getSignaturesOfType(t,0).length&&n.length||getSignaturesOfType(t,1).length&&r.length){return true}return false}return true}function reportIncompatibleCallSignatureReturn(e,t){if(e.parameters.length===0&&t.parameters.length===0){return(e,t)=>reportIncompatibleError(wt.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,typeToString(e),typeToString(t))}return(e,t)=>reportIncompatibleError(wt.Call_signature_return_types_0_and_1_are_incompatible,typeToString(e),typeToString(t))}function reportIncompatibleConstructSignatureReturn(e,t){if(e.parameters.length===0&&t.parameters.length===0){return(e,t)=>reportIncompatibleError(wt.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,typeToString(e),typeToString(t))}return(e,t)=>reportIncompatibleError(wt.Construct_signature_return_types_0_and_1_are_incompatible,typeToString(e),typeToString(t))}function signatureRelatedTo(e,t,r,i,o,a){const s=n===vi?16:n===xi?16|8:0;return compareSignaturesRelated(r?getErasedSignature(e):e,r?getErasedSignature(t):t,s,i,reportError,a,isRelatedToWorker2,gt);function isRelatedToWorker2(e,t,n){return isRelatedTo(e,t,3,n,void 0,o)}}function signaturesIdenticalTo(e,t,n){const r=getSignaturesOfType(e,n);const i=getSignaturesOfType(t,n);if(r.length!==i.length){return 0}let o=-1;for(let e=0;ee.keyType===ze));let c=-1;for(const t of a){const a=n!==xi&&!r&&s&&t.type.flags&1?-1:isGenericMappedType(e)&&s?isRelatedTo(getTemplateTypeFromMappedType(e),t.type,3,i):typeRelatedToIndexInfo(e,t,i,o);if(!a){return 0}c&=a}return c}function typeRelatedToIndexInfo(e,t,r,i){const o=getApplicableIndexInfo(e,t.keyType);if(o){return indexInfoRelatedTo(o,t,r,i)}if(!(i&1)&&(n!==xi||getObjectFlags(e)&8192)&&isObjectTypeWithInferableIndex(e)){return membersRelatedToIndexInfo(e,t,r,i)}if(r){reportError(wt.Index_signature_for_type_0_is_missing_in_type_1,typeToString(t.keyType),typeToString(e))}return 0}function indexSignaturesIdenticalTo(e,t){const n=getIndexInfosOfType(e);const r=getIndexInfosOfType(t);if(n.length!==r.length){return 0}for(const t of r){const n=getIndexInfoOfType(e,t.keyType);if(!(n&&isRelatedTo(n.type,t.type,3)&&n.isReadonly===t.isReadonly)){return 0}}return-1}function constructorVisibilitiesAreCompatible(e,t,n){if(!e.declaration||!t.declaration){return true}const r=getSelectedEffectiveModifierFlags(e.declaration,6);const i=getSelectedEffectiveModifierFlags(t.declaration,6);if(i===2){return true}if(i===4&&r!==2){return true}if(i!==4&&!r){return true}if(n){reportError(wt.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type,visibilityToString(r),visibilityToString(i))}return false}}function typeCouldHaveTopLevelSingletonTypes(e){if(e.flags&16){return false}if(e.flags&3145728){return!!forEach(e.types,typeCouldHaveTopLevelSingletonTypes)}if(e.flags&465829888){const t=getConstraintOfType(e);if(t&&t!==e){return typeCouldHaveTopLevelSingletonTypes(t)}}return isUnitType(e)||!!(e.flags&134217728)||!!(e.flags&268435456)}function getExactOptionalUnassignableProperties(e,t){if(isTupleType(e)&&isTupleType(t))return d;return getPropertiesOfType(t).filter((t=>isExactOptionalPropertyMismatch(getTypeOfPropertyOfType(e,t.escapedName),getTypeOfSymbol(t))))}function isExactOptionalPropertyMismatch(e,t){return!!e&&!!t&&maybeTypeOfKind(e,32768)&&!!containsMissingType(t)}function getExactOptionalProperties(e){return getPropertiesOfType(e).filter((e=>containsMissingType(getTypeOfSymbol(e))))}function getBestMatchingType(e,t,n=compareTypesAssignable){return findMatchingDiscriminantType(e,t,n)||findMatchingTypeReferenceOrTypeAliasReference(e,t)||findBestTypeForObjectLiteral(e,t)||findBestTypeForInvokable(e,t)||findMostOverlappyType(e,t)}function discriminateTypeByDiscriminableItems(e,t,n){const r=e.types;const i=r.map((e=>e.flags&402784252?0:-1));for(const[e,o]of t){let t=false;for(let a=0;a!!n(e,s)))){t=true}else{i[a]=3}}}for(let e=0;ei[t])),0):e;return o.flags&131072?e:o}function isWeakType(e){if(e.flags&524288){const t=resolveStructuredTypeMembers(e);return t.callSignatures.length===0&&t.constructSignatures.length===0&&t.indexInfos.length===0&&t.properties.length>0&&every(t.properties,(e=>!!(e.flags&16777216)))}if(e.flags&33554432){return isWeakType(e.baseType)}if(e.flags&2097152){return every(e.types,isWeakType)}return false}function hasCommonProperties(e,t,n){for(const r of getPropertiesOfType(e)){if(isKnownProperty(t,r.escapedName,n)){return true}}return false}function getVariances(e){return e===on||e===an||e.objectFlags&8?h:getVariancesWorker(e.symbol,e.typeParameters)}function getAliasVariances(e){return getVariancesWorker(e,getSymbolLinks(e).typeParameters)}function getVariancesWorker(e,t=d){var n,r;const i=getSymbolLinks(e);if(!i.variances){(n=G)==null?void 0:n.push(G.Phase.CheckTypes,"getVariancesWorker",{arity:t.length,id:getTypeId(getDeclaredTypeOfSymbol(e))});const o=Gr;const a=Hr;if(!Gr){Gr=true;Hr=Ur.length}i.variances=d;const s=[];for(const n of t){const t=getTypeParameterModifiers(n);let r=t&16384?t&8192?0:1:t&8192?2:void 0;if(r===void 0){let t=false;let i=false;const o=_t;_t=e=>e?i=true:t=true;const a=createMarkerType(e,n,Dt);const s=createMarkerType(e,n,It);r=(isTypeAssignableTo(s,a)?1:0)|(isTypeAssignableTo(a,s)?2:0);if(r===3&&isTypeAssignableTo(createMarkerType(e,n,At),a)){r=4}_t=o;if(t||i){if(t){r|=8}if(i){r|=16}}}s.push(r)}if(!o){Gr=false;Hr=a}i.variances=s;(r=G)==null?void 0:r.pop({variances:s.map(S.formatVariance)})}return i.variances}function createMarkerType(e,t,n){const r=makeUnaryTypeMapper(t,n);const i=getDeclaredTypeOfSymbol(e);if(isErrorType(i)){return i}const o=e.flags&524288?getTypeAliasInstantiation(e,instantiateTypes(getSymbolLinks(e).typeParameters,r)):createTypeReference(i,instantiateTypes(i.typeParameters,r));ve.add(getTypeId(o));return o}function isMarkerType(e){return ve.has(getTypeId(e))}function getTypeParameterModifiers(e){var t;return reduceLeft((t=e.symbol)==null?void 0:t.declarations,((e,t)=>e|getEffectiveModifierFlags(t)),0)&(8192|16384|4096)}function hasCovariantVoidArgument(e,t){for(let n=0;n!!(e.flags&262144)||isTypeReferenceWithGenericArguments(e)))}function getGenericTypeReferenceRelationKey(e,t,n,r){const i=[];let o="";const a=getTypeReferenceId(e,0);const s=getTypeReferenceId(t,0);return`${o}${a},${s}${n}`;function getTypeReferenceId(e,t=0){let n=""+e.target.id;for(const a of getTypeArguments(e)){if(a.flags&262144){if(r||isUnconstrainedTypeParameter(a)){let e=i.indexOf(a);if(e<0){e=i.length;i.push(a)}n+="="+e;continue}o="*"}else if(t<4&&isTypeReferenceWithGenericArguments(a)){n+="<"+getTypeReferenceId(a,t+1)+">";continue}n+="-"+a.id}return n}}function getRelationKey(e,t,n,r,i){if(r===Ei&&e.id>t.id){const n=e;e=t;t=n}const o=n?":"+n:"";return isTypeReferenceWithGenericArguments(e)&&isTypeReferenceWithGenericArguments(t)?getGenericTypeReferenceRelationKey(e,t,o,i):`${e.id},${t.id}${o}`}function forEachProperty2(e,t){if(getCheckFlags(e)&6){for(const n of e.links.containingType.types){const r=getPropertyOfType(n,e.escapedName);const i=r&&forEachProperty2(r,t);if(i){return i}}return void 0}return t(e)}function getDeclaringClass(e){return e.parent&&e.parent.flags&32?getDeclaredTypeOfSymbol(getParentOfSymbol(e)):void 0}function getTypeOfPropertyInBaseClass(e){const t=getDeclaringClass(e);const n=t&&getBaseTypes(t)[0];return n&&getTypeOfPropertyOfType(n,e.escapedName)}function isPropertyInClassDerivedFrom(e,t){return forEachProperty2(e,(e=>{const n=getDeclaringClass(e);return n?hasBaseType(n,t):false}))}function isValidOverrideOf(e,t){return!forEachProperty2(t,(t=>getDeclarationModifierFlagsFromSymbol(t)&4?!isPropertyInClassDerivedFrom(e,getDeclaringClass(t)):false))}function isClassDerivedFromDeclaringClasses(e,t,n){return forEachProperty2(t,(t=>getDeclarationModifierFlagsFromSymbol(t,n)&4?!hasBaseType(e,getDeclaringClass(t)):false))?void 0:e}function isDeeplyNestedType(e,t,n,r=3){if(n>=r){if((getObjectFlags(e)&96)===96){e=getMappedTargetWithSymbol(e)}if(e.flags&2097152){return some(e.types,(e=>isDeeplyNestedType(e,t,n,r)))}const i=getRecursionIdentity(e);let o=0;let a=0;for(let e=0;e=a){o++;if(o>=r){return true}}a=n.id}}}return false}function getMappedTargetWithSymbol(e){let t;while((getObjectFlags(e)&96)===96&&(t=getModifiersTypeFromMappedType(e))&&(t.symbol||t.flags&2097152&&some(t.types,(e=>!!e.symbol)))){e=t}return e}function hasMatchingRecursionIdentity(e,t){if((getObjectFlags(e)&96)===96){e=getMappedTargetWithSymbol(e)}if(e.flags&2097152){return some(e.types,(e=>hasMatchingRecursionIdentity(e,t)))}return getRecursionIdentity(e)===t}function getRecursionIdentity(e){if(e.flags&524288&&!isObjectOrArrayLiteralType(e)){if(getObjectFlags(e)&4&&e.node){return e.node}if(e.symbol&&!(getObjectFlags(e)&16&&e.symbol.flags&32)){return e.symbol}if(isTupleType(e)){return e.target}}if(e.flags&262144){return e.symbol}if(e.flags&8388608){do{e=e.objectType}while(e.flags&8388608);return e}if(e.flags&16777216){return e.root}return e}function isPropertyIdenticalTo(e,t){return compareProperties2(e,t,compareTypesIdentical)!==0}function compareProperties2(e,t,n){if(e===t){return-1}const r=getDeclarationModifierFlagsFromSymbol(e)&6;const i=getDeclarationModifierFlagsFromSymbol(t)&6;if(r!==i){return 0}if(r){if(getTargetSymbol(e)!==getTargetSymbol(t)){return 0}}else{if((e.flags&16777216)!==(t.flags&16777216)){return 0}}if(isReadonlySymbol(e)!==isReadonlySymbol(t)){return 0}return n(getTypeOfSymbol(e),getTypeOfSymbol(t))}function isMatchingSignature(e,t,n){const r=getParameterCount(e);const i=getParameterCount(t);const o=getMinArgumentCount(e);const a=getMinArgumentCount(t);const s=hasEffectiveRestParameter(e);const c=hasEffectiveRestParameter(t);if(r===i&&o===a&&s===c){return true}if(n&&o<=a){return true}return false}function compareSignaturesIdentical(e,t,n,r,i,o){if(e===t){return-1}if(!isMatchingSignature(e,t,n)){return 0}if(length(e.typeParameters)!==length(t.typeParameters)){return 0}if(t.typeParameters){const n=createTypeMapper(e.typeParameters,t.typeParameters);for(let r=0;re|(t.flags&1048576?getCombinedTypeFlags(t.types):t.flags)),0)}function getCommonSupertype(e){if(e.length===1){return e[0]}const t=k?sameMap(e,(e=>filterType(e,(e=>!(e.flags&98304))))):e;const n=literalTypesWithSameBaseType(t)?getUnionType(t):reduceLeft(t,((e,t)=>isTypeSubtypeOf(e,t)?t:e));return t===e?n:getNullableType(n,getCombinedTypeFlags(e)&98304)}function getCommonSubtype(e){return reduceLeft(e,((e,t)=>isTypeSubtypeOf(t,e)?t:e))}function isArrayType(e){return!!(getObjectFlags(e)&4)&&(e.target===on||e.target===an)}function isReadonlyArrayType(e){return!!(getObjectFlags(e)&4)&&e.target===an}function isArrayOrTupleType(e){return isArrayType(e)||isTupleType(e)}function isMutableArrayOrTuple(e){return isArrayType(e)&&!isReadonlyArrayType(e)||isTupleType(e)&&!e.target.readonly}function getElementTypeOfArrayType(e){return isArrayType(e)?getTypeArguments(e)[0]:void 0}function isArrayLikeType(e){return isArrayType(e)||!(e.flags&98304)&&isTypeAssignableTo(e,Tn)}function isMutableArrayLikeType(e){return isMutableArrayOrTuple(e)||!(e.flags&(1|98304))&&isTypeAssignableTo(e,yn)}function getSingleBaseForNonAugmentingSubtype(e){if(!(getObjectFlags(e)&4)||!(getObjectFlags(e.target)&3)){return void 0}if(getObjectFlags(e)&33554432){return getObjectFlags(e)&67108864?e.cachedEquivalentBaseType:void 0}e.objectFlags|=33554432;const t=e.target;if(getObjectFlags(t)&1){const e=getBaseTypeNodeOfClass(t);if(e&&e.expression.kind!==80&&e.expression.kind!==211){return void 0}}const n=getBaseTypes(t);if(n.length!==1){return void 0}if(getMembersOfSymbol(e.symbol).size){return void 0}let r=!length(t.typeParameters)?n[0]:instantiateType(n[0],createTypeMapper(t.typeParameters,getTypeArguments(e).slice(0,t.typeParameters.length)));if(length(getTypeArguments(e))>length(t.typeParameters)){r=getTypeWithThisArgument(r,last(getTypeArguments(e)))}e.objectFlags|=67108864;return e.cachedEquivalentBaseType=r}function isEmptyLiteralType(e){return k?e===nt:e===Re}function isEmptyArrayLiteralType(e){const t=getElementTypeOfArrayType(e);return!!t&&isEmptyLiteralType(t)}function isTupleLikeType(e){let t;return isTupleType(e)||!!getPropertyOfType(e,"0")||isArrayLikeType(e)&&!!(t=getTypeOfPropertyOfType(e,"length"))&&everyType(t,(e=>!!(e.flags&256)))}function isArrayOrTupleLikeType(e){return isArrayLikeType(e)||isTupleLikeType(e)}function getTupleElementType(e,t){const n=getTypeOfPropertyOfType(e,""+t);if(n){return n}if(everyType(e,isTupleType)){return getTupleElementTypeOutOfStartCount(e,t,T.noUncheckedIndexedAccess?Me:void 0)}return void 0}function isNeitherUnitTypeNorNever(e){return!(e.flags&(109472|131072))}function isUnitType(e){return!!(e.flags&109472)}function isUnitLikeType(e){const t=getBaseConstraintOrType(e);return t.flags&2097152?some(t.types,isUnitType):isUnitType(t)}function extractUnitType(e){return e.flags&2097152?find(e.types,isUnitType)||e:e}function isLiteralType(e){return e.flags&16?true:e.flags&1048576?e.flags&1024?true:every(e.types,isUnitType):isUnitType(e)}function getBaseTypeOfLiteralType(e){return e.flags&1056?getBaseTypeOfEnumLikeType(e):e.flags&(128|134217728|268435456)?ze:e.flags&256?Ve:e.flags&2048?qe:e.flags&512?Xe:e.flags&1048576?getBaseTypeOfLiteralTypeUnion(e):e}function getBaseTypeOfLiteralTypeUnion(e){const t=`B${getTypeId(e)}`;return getCachedType(t)??setCachedType(t,mapType(e,getBaseTypeOfLiteralType))}function getBaseTypeOfLiteralTypeForComparison(e){return e.flags&(128|134217728|268435456)?ze:e.flags&(256|32)?Ve:e.flags&2048?qe:e.flags&512?Xe:e.flags&1048576?mapType(e,getBaseTypeOfLiteralTypeForComparison):e}function getWidenedLiteralType(e){return e.flags&1056&&isFreshLiteralType(e)?getBaseTypeOfEnumLikeType(e):e.flags&128&&isFreshLiteralType(e)?ze:e.flags&256&&isFreshLiteralType(e)?Ve:e.flags&2048&&isFreshLiteralType(e)?qe:e.flags&512&&isFreshLiteralType(e)?Xe:e.flags&1048576?mapType(e,getWidenedLiteralType):e}function getWidenedUniqueESSymbolType(e){return e.flags&8192?Ye:e.flags&1048576?mapType(e,getWidenedUniqueESSymbolType):e}function getWidenedLiteralLikeTypeForContextualType(e,t){if(!isLiteralOfContextualType(e,t)){e=getWidenedUniqueESSymbolType(getWidenedLiteralType(e))}return getRegularTypeOfLiteralType(e)}function getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(e,t,n){if(e&&isUnitType(e)){const r=!t?void 0:n?getPromisedTypeOfPromise(t):t;e=getWidenedLiteralLikeTypeForContextualType(e,r)}return e}function getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(e,t,n,r){if(e&&isUnitType(e)){const i=!t?void 0:getIterationTypeOfGeneratorFunctionReturnType(n,t,r);e=getWidenedLiteralLikeTypeForContextualType(e,i)}return e}function isTupleType(e){return!!(getObjectFlags(e)&4&&e.target.objectFlags&8)}function isGenericTupleType(e){return isTupleType(e)&&!!(e.target.combinedFlags&8)}function isSingleElementGenericTupleType(e){return isGenericTupleType(e)&&e.target.elementFlags.length===1}function getRestTypeOfTupleType(e){return getElementTypeOfSliceOfTupleType(e,e.target.fixedLength)}function getTupleElementTypeOutOfStartCount(e,t,n){return mapType(e,(e=>{const r=e;const i=getRestTypeOfTupleType(r);if(!i){return Me}if(n&&t>=getTotalFixedElementCount(r.target)){return getUnionType([i,n])}return i}))}function getRestArrayTypeOfTupleType(e){const t=getRestTypeOfTupleType(e);return t&&createArrayType(t)}function getElementTypeOfSliceOfTupleType(e,t,n=0,r=false,i=false){const o=getTypeReferenceArity(e)-n;if(t(e&12)===(t.target.elementFlags[n]&12)))}function isZeroBigInt({value:e}){return e.base10Value==="0"}function removeDefinitelyFalsyTypes(e){return filterType(e,(e=>hasTypeFacts(e,4194304)))}function extractDefinitelyFalsyTypes(e){return mapType(e,getDefinitelyFalsyPartOfType)}function getDefinitelyFalsyPartOfType(e){return e.flags&4?jr:e.flags&8?Jr:e.flags&64?Wr:e===Ge||e===He||e.flags&(16384|32768|65536|3)||e.flags&128&&e.value===""||e.flags&256&&e.value===0||e.flags&2048&&isZeroBigInt(e)?e:et}function getNullableType(e,t){const n=t&~e.flags&(32768|65536);return n===0?e:n===32768?getUnionType([e,Me]):n===65536?getUnionType([e,We]):getUnionType([e,Me,We])}function getOptionalType(e,t=false){S.assert(k);const n=t?je:Me;return e===n||e.flags&1048576&&e.types[0]===n?e:getUnionType([e,n])}function getGlobalNonNullableTypeInstantiation(e){if(!Sn){Sn=getGlobalSymbol("NonNullable",524288,void 0)||xe}return Sn!==xe?getTypeAliasInstantiation(Sn,[e]):getIntersectionType([e,ht])}function getNonNullableType(e){return k?getAdjustedTypeWithFacts(e,2097152):e}function addOptionalTypeMarker(e){return k?getUnionType([e,Je]):e}function removeOptionalTypeMarker(e){return k?removeType(e,Je):e}function propagateOptionalTypeMarker(e,t,n){return n?isOutermostOptionalChain(t)?getOptionalType(e):addOptionalTypeMarker(e):e}function getOptionalExpressionType(e,t){return isExpressionOfOptionalChainRoot(t)?getNonNullableType(e):isOptionalChain(t)?removeOptionalTypeMarker(e):e}function removeMissingType(e,t){return L&&t?removeType(e,Be):e}function containsMissingType(e){return e===Be||!!(e.flags&1048576)&&e.types[0]===Be}function removeMissingOrUndefinedType(e){return L?removeType(e,Be):getTypeWithFacts(e,524288)}function isCoercibleUnderDoubleEquals(e,t){return(e.flags&(8|4|512))!==0&&(t.flags&(8|4|16))!==0}function isObjectTypeWithInferableIndex(e){const t=getObjectFlags(e);return e.flags&2097152?every(e.types,isObjectTypeWithInferableIndex):!!(e.symbol&&(e.symbol.flags&(4096|2048|384|512))!==0&&!(e.symbol.flags&32)&&!typeHasCallOrConstructSignatures(e))||!!(t&4194304)||!!(t&1024&&isObjectTypeWithInferableIndex(e.source))}function createSymbolWithType(e,t){const n=createSymbol(e.flags,e.escapedName,getCheckFlags(e)&8);n.declarations=e.declarations;n.parent=e.parent;n.links.type=t;n.links.target=e;if(e.valueDeclaration){n.valueDeclaration=e.valueDeclaration}const r=getSymbolLinks(e).nameType;if(r){n.links.nameType=r}return n}function transformTypeOfMembers(e,t){const n=createSymbolTable();for(const r of getPropertiesOfObjectType(e)){const e=getTypeOfSymbol(r);const i=t(e);n.set(r.escapedName,i===e?r:createSymbolWithType(r,i))}return n}function getRegularTypeOfObjectLiteral(e){if(!(isObjectLiteralType2(e)&&getObjectFlags(e)&8192)){return e}const t=e.regularType;if(t){return t}const n=e;const r=transformTypeOfMembers(e,getRegularTypeOfObjectLiteral);const i=createAnonymousType(n.symbol,r,n.callSignatures,n.constructSignatures,n.indexInfos);i.flags=n.flags;i.objectFlags|=n.objectFlags&~8192;e.regularType=i;return i}function createWideningContext(e,t,n){return{parent:e,propertyName:t,siblings:n,resolvedProperties:void 0}}function getSiblingsOfContext(e){if(!e.siblings){const t=[];for(const n of getSiblingsOfContext(e.parent)){if(isObjectLiteralType2(n)){const r=getPropertyOfObjectType(n,e.propertyName);if(r){forEachType(getTypeOfSymbol(r),(e=>{t.push(e)}))}}}e.siblings=t}return e.siblings}function getPropertiesOfContext(e){if(!e.resolvedProperties){const t=new Map;for(const n of getSiblingsOfContext(e)){if(isObjectLiteralType2(n)&&!(getObjectFlags(n)&2097152)){for(const e of getPropertiesOfType(n)){t.set(e.escapedName,e)}}}e.resolvedProperties=arrayFrom(t.values())}return e.resolvedProperties}function getWidenedProperty(e,t){if(!(e.flags&4)){return e}const n=getTypeOfSymbol(e);const r=t&&createWideningContext(t,e.escapedName,void 0);const i=getWidenedTypeWithContext(n,r);return i===n?e:createSymbolWithType(e,i)}function getUndefinedProperty(e){const t=Se.get(e.escapedName);if(t){return t}const n=createSymbolWithType(e,je);n.flags|=16777216;Se.set(e.escapedName,n);return n}function getWidenedTypeOfObjectLiteral(e,t){const n=createSymbolTable();for(const r of getPropertiesOfObjectType(e)){n.set(r.escapedName,getWidenedProperty(r,t))}if(t){for(const e of getPropertiesOfContext(t)){if(!n.has(e.escapedName)){n.set(e.escapedName,getUndefinedProperty(e))}}}const r=createAnonymousType(e.symbol,n,d,d,sameMap(getIndexInfosOfType(e),(e=>createIndexInfo(e.keyType,getWidenedType(e.type),e.isReadonly,e.declaration,e.components))));r.objectFlags|=getObjectFlags(e)&(4096|262144);return r}function getWidenedType(e){return getWidenedTypeWithContext(e,void 0)}function getWidenedTypeWithContext(e,t){if(getObjectFlags(e)&196608){if(t===void 0&&e.widened){return e.widened}let n;if(e.flags&(1|98304)){n=ke}else if(isObjectLiteralType2(e)){n=getWidenedTypeOfObjectLiteral(e,t)}else if(e.flags&1048576){const r=t||createWideningContext(void 0,void 0,e.types);const i=sameMap(e.types,(e=>e.flags&98304?e:getWidenedTypeWithContext(e,r)));n=getUnionType(i,some(i,isEmptyObjectType)?2:1)}else if(e.flags&2097152){n=getIntersectionType(sameMap(e.types,getWidenedType))}else if(isArrayOrTupleType(e)){n=createTypeReference(e.target,sameMap(getTypeArguments(e),getWidenedType))}if(n&&t===void 0){e.widened=n}return n||e}return e}function reportWideningErrorsInType(e){var t;let n=false;if(getObjectFlags(e)&65536){if(e.flags&1048576){if(some(e.types,isEmptyObjectType)){n=true}else{for(const t of e.types){n||(n=reportWideningErrorsInType(t))}}}else if(isArrayOrTupleType(e)){for(const t of getTypeArguments(e)){n||(n=reportWideningErrorsInType(t))}}else if(isObjectLiteralType2(e)){for(const r of getPropertiesOfObjectType(e)){const i=getTypeOfSymbol(r);if(getObjectFlags(i)&65536){n=reportWideningErrorsInType(i);if(!n){const o=(t=r.declarations)==null?void 0:t.find((t=>{var n;return((n=t.symbol.valueDeclaration)==null?void 0:n.parent)===e.symbol.valueDeclaration}));if(o){error2(o,wt.Object_literal_s_property_0_implicitly_has_an_1_type,symbolToString(r),typeToString(getWidenedType(i)));n=true}}}}}}return n}function reportImplicitAny(e,t,n){const r=typeToString(getWidenedType(t));if(isInJSFile(e)&&!isCheckJsEnabledForFile(getSourceFileOfNode(e),T)){return}let i;switch(e.kind){case 226:case 172:case 171:i=A?wt.Member_0_implicitly_has_an_1_type:wt.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 169:const t=e;if(isIdentifier(t.name)){const n=identifierToKeywordKind(t.name);if((isCallSignatureDeclaration(t.parent)||isMethodSignature(t.parent)||isFunctionTypeNode(t.parent))&&t.parent.parameters.includes(t)&&(te(t,t.name.escapedText,788968,void 0,true)||n&&isTypeNodeKind(n))){const n="arg"+t.parent.parameters.indexOf(t);const r=declarationNameToString(t.name)+(t.dotDotDotToken?"[]":"");errorOrSuggestion(A,e,wt.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1,n,r);return}}i=e.dotDotDotToken?A?wt.Rest_parameter_0_implicitly_has_an_any_type:wt.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:A?wt.Parameter_0_implicitly_has_an_1_type:wt.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 208:i=wt.Binding_element_0_implicitly_has_an_1_type;if(!A){return}break;case 317:error2(e,wt.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,r);return;case 323:if(A&&isJSDocOverloadTag(e.parent)){error2(e.parent.tagName,wt.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation,r)}return;case 262:case 174:case 173:case 177:case 178:case 218:case 219:if(A&&!e.name){if(n===3){error2(e,wt.Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation,r)}else{error2(e,wt.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,r)}return}i=!A?wt._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:n===3?wt._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:wt._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;break;case 200:if(A){error2(e,wt.Mapped_object_type_implicitly_has_an_any_template_type)}return;default:i=A?wt.Variable_0_implicitly_has_an_1_type:wt.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage}errorOrSuggestion(A,e,i,declarationNameToString(getNameOfDeclaration(e)),r)}function shouldReportErrorsFromWideningWithContextualSignature(e,t){const n=getContextualSignatureForFunctionLikeDeclaration(e);if(!n){return true}let r=getReturnTypeOfSignature(n);const i=getFunctionFlags(e);switch(t){case 1:if(i&1){r=getIterationTypeOfGeneratorFunctionReturnType(1,r,!!(i&2))??r}else if(i&2){r=getAwaitedTypeNoAlias(r)??r}return isGenericType(r);case 3:const e=getIterationTypeOfGeneratorFunctionReturnType(0,r,!!(i&2));return!!e&&isGenericType(e);case 2:const t=getIterationTypeOfGeneratorFunctionReturnType(2,r,!!(i&2));return!!t&&isGenericType(t)}return false}function reportErrorsFromWidening(e,t,n){addLazyDiagnostic((()=>{if(A&&getObjectFlags(t)&65536){if(!n||isFunctionLikeDeclaration(e)&&shouldReportErrorsFromWideningWithContextualSignature(e,n)){if(!reportWideningErrorsInType(t)){reportImplicitAny(e,t,n)}}}}))}function applyToParameterTypes(e,t,n){const r=getParameterCount(e);const i=getParameterCount(t);const o=getEffectiveRestType(e);const a=getEffectiveRestType(t);const s=a?i-1:i;const c=o?s:Math.min(r,s);const l=getThisTypeOfSignature(e);if(l){const e=getThisTypeOfSignature(t);if(e){n(l,e)}}for(let r=0;re.typeParameter)),map(e.inferences,((t,n)=>()=>{if(!t.isFixed){inferFromIntraExpressionSites(e);clearCachedInferences(e.inferences);t.isFixed=true}return getInferredType(e,n)})))}function makeNonFixingMapperForContext(e){return makeDeferredTypeMapper(map(e.inferences,(e=>e.typeParameter)),map(e.inferences,((t,n)=>()=>getInferredType(e,n))))}function clearCachedInferences(e){for(const t of e){if(!t.isFixed){t.inferredType=void 0}}}function addIntraExpressionInferenceSite(e,t,n){(e.intraExpressionInferenceSites??(e.intraExpressionInferenceSites=[])).push({node:t,type:n})}function inferFromIntraExpressionSites(e){if(e.intraExpressionInferenceSites){for(const{node:t,type:n}of e.intraExpressionInferenceSites){const r=t.kind===174?getContextualTypeForObjectLiteralMethod(t,2):getContextualType2(t,2);if(r){inferTypes(e.inferences,n,r)}}e.intraExpressionInferenceSites=void 0}}function createInferenceInfo(e){return{typeParameter:e,candidates:void 0,contraCandidates:void 0,inferredType:void 0,priority:void 0,topLevel:true,isFixed:false,impliedArity:void 0}}function cloneInferenceInfo(e){return{typeParameter:e.typeParameter,candidates:e.candidates&&e.candidates.slice(),contraCandidates:e.contraCandidates&&e.contraCandidates.slice(),inferredType:e.inferredType,priority:e.priority,topLevel:e.topLevel,isFixed:e.isFixed,impliedArity:e.impliedArity}}function cloneInferredPartOfContext(e){const t=filter(e.inferences,hasInferenceCandidates);return t.length?createInferenceContextWorker(map(t,cloneInferenceInfo),e.signature,e.flags,e.compareTypes):void 0}function getMapperFromContext(e){return e&&e.mapper}function couldContainTypeVariables(e){const t=getObjectFlags(e);if(t&524288){return!!(t&1048576)}const n=!!(e.flags&465829888||e.flags&524288&&!isNonGenericTopLevelType(e)&&(t&4&&(e.node||some(getTypeArguments(e),couldContainTypeVariables))||t&134217728&&!!length(e.outerTypeParameters)||t&16&&e.symbol&&e.symbol.flags&(16|8192|32|2048|4096)&&e.symbol.declarations||t&(32|1024|4194304|8388608))||e.flags&3145728&&!(e.flags&1024)&&!isNonGenericTopLevelType(e)&&some(e.types,couldContainTypeVariables));if(e.flags&3899393){e.objectFlags|=524288|(n?1048576:0)}return n}function isNonGenericTopLevelType(e){if(e.aliasSymbol&&!e.aliasTypeArguments){const t=getDeclarationOfKind(e.aliasSymbol,265);return!!(t&&findAncestor(t.parent,(e=>e.kind===307?true:e.kind===267?false:"quit")))}return false}function isTypeParameterAtTopLevel(e,t,n=0){return!!(e===t||e.flags&3145728&&some(e.types,(e=>isTypeParameterAtTopLevel(e,t,n)))||n<3&&e.flags&16777216&&(isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(e),t,n+1)||isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(e),t,n+1)))}function isTypeParameterAtTopLevelInReturnType(e,t){const n=getTypePredicateOfSignature(e);return n?!!n.type&&isTypeParameterAtTopLevel(n.type,t):isTypeParameterAtTopLevel(getReturnTypeOfSignature(e),t)}function createEmptyObjectTypeFromStringLiteral(e){const t=createSymbolTable();forEachType(e,(e=>{if(!(e.flags&128)){return}const n=escapeLeadingUnderscores(e.value);const r=createSymbol(4,n);r.links.type=ke;if(e.symbol){r.declarations=e.symbol.declarations;r.valueDeclaration=e.symbol.valueDeclaration}t.set(n,r)}));const n=e.flags&4?[createIndexInfo(ze,ht,false)]:d;return createAnonymousType(void 0,t,d,d,n)}function inferTypeForHomomorphicMappedType(e,t,n){const r=e.id+","+t.id+","+n.id;if(Qt.has(r)){return Qt.get(r)}const i=createReverseMappedType(e,t,n);Qt.set(r,i);return i}function isPartiallyInferableType(e){return!(getObjectFlags(e)&262144)||isObjectLiteralType2(e)&&some(getPropertiesOfType(e),(e=>isPartiallyInferableType(getTypeOfSymbol(e))))||isTupleType(e)&&some(getElementTypes(e),isPartiallyInferableType)}function createReverseMappedType(e,t,n){if(!(getIndexInfoOfType(e,ze)||getPropertiesOfType(e).length!==0&&isPartiallyInferableType(e))){return void 0}if(isArrayType(e)){const r=inferReverseMappedType(getTypeArguments(e)[0],t,n);if(!r){return void 0}return createArrayType(r,isReadonlyArrayType(e))}if(isTupleType(e)){const r=map(getElementTypes(e),(e=>inferReverseMappedType(e,t,n)));if(!every(r,(e=>!!e))){return void 0}const i=getMappedTypeModifiers(t)&4?sameMap(e.target.elementFlags,(e=>e&2?1:e)):e.target.elementFlags;return createTupleType(r,i,e.target.readonly,e.target.labeledElementDeclarations)}const r=createObjectType(1024|16,void 0);r.source=e;r.mappedType=t;r.constraintType=n;return r}function getTypeOfReverseMappedSymbol(e){const t=getSymbolLinks(e);if(!t.type){t.type=inferReverseMappedType(e.links.propertyType,e.links.mappedType,e.links.constraintType)||Le}return t.type}function inferReverseMappedTypeWorker(e,t,n){const r=getIndexedAccessType(n.type,getTypeParameterFromMappedType(t));const i=getTemplateTypeFromMappedType(t);const o=createInferenceInfo(r);inferTypes([o],e,i);return getTypeFromInference(o)||Le}function inferReverseMappedType(e,t,n){const r=e.id+","+t.id+","+n.id;if($t.has(r)){return $t.get(r)||Le}fi.push(e);mi.push(t);const i=_i;if(isDeeplyNestedType(e,fi,fi.length,2))_i|=1;if(isDeeplyNestedType(t,mi,mi.length,2))_i|=2;let o;if(_i!==3){o=inferReverseMappedTypeWorker(e,t,n)}fi.pop();mi.pop();_i=i;$t.set(r,o);return o}function*getUnmatchedProperties(e,t,n,r){const i=getPropertiesOfType(t);for(const t of i){if(isStaticPrivateIdentifierProperty(t)){continue}if(n||!(t.flags&16777216||getCheckFlags(t)&48)){const n=getPropertyOfType(e,t.escapedName);if(!n){yield t}else if(r){const e=getTypeOfSymbol(t);if(e.flags&109472){const r=getTypeOfSymbol(n);if(!(r.flags&1||getRegularTypeOfLiteralType(r)===getRegularTypeOfLiteralType(e))){yield t}}}}}}function getUnmatchedProperty(e,t,n,r){return firstOrUndefinedIterator(getUnmatchedProperties(e,t,n,r))}function tupleTypesDefinitelyUnrelated(e,t){return!(t.target.combinedFlags&8)&&t.target.minLength>e.target.minLength||!(t.target.combinedFlags&12)&&(!!(e.target.combinedFlags&12)||t.target.fixedLengthgetStringMappingType(t,e)),e);return r===e&&isMemberOfStringMapping(e,t)}return false}function isValidTypeForTemplateLiteralPlaceholder(e,t){if(t.flags&2097152){return every(t.types,(t=>t===xt||isValidTypeForTemplateLiteralPlaceholder(e,t)))}if(t.flags&4||isTypeAssignableTo(e,t)){return true}if(e.flags&128){const n=e.value;return!!(t.flags&8&&isValidNumberString(n,false)||t.flags&64&&isValidBigIntString(n,false)||t.flags&(512|98304)&&n===t.intrinsicName||t.flags&268435456&&isMemberOfStringMapping(getStringLiteralType(n),t)||t.flags&134217728&&isTypeMatchedByTemplateLiteralType(e,t))}if(e.flags&134217728){const n=e.texts;return n.length===2&&n[0]===""&&n[1]===""&&isTypeAssignableTo(e.types[0],t)}return false}function inferTypesFromTemplateLiteralType(e,t){return e.flags&128?inferFromLiteralPartsToTemplateLiteral([e.value],d,t):e.flags&134217728?arrayIsEqualTo(e.texts,t.texts)?map(e.types,((e,n)=>isTypeAssignableTo(getBaseConstraintOrType(e),getBaseConstraintOrType(t.types[n]))?e:getStringLikeTypeForType(e))):inferFromLiteralPartsToTemplateLiteral(e.texts,e.types,t):void 0}function isTypeMatchedByTemplateLiteralType(e,t){const n=inferTypesFromTemplateLiteralType(e,t);return!!n&&every(n,((e,n)=>isValidTypeForTemplateLiteralPlaceholder(e,t.types[n])))}function getStringLikeTypeForType(e){return e.flags&(1|402653316)?e:getTemplateLiteralType(["",""],[e])}function inferFromLiteralPartsToTemplateLiteral(e,t,n){const r=e.length-1;const i=e[0];const o=e[r];const a=n.texts;const s=a.length-1;const c=a[0];const l=a[s];if(r===0&&i.length0){let t=u;let r=f;while(true){r=getSourceText(t).indexOf(n,r);if(r>=0)break;t++;if(t===e.length)return void 0;r=0}addMatch(t,r);f+=n.length}else if(f!contains(r,e))):e,i?filter(t,(e=>!contains(i,e))):t]}function inferFromTypeArguments(e,t,n){const r=e.length!!getInferenceInfoForType(e)));if(!e||t&&e!==t){return void 0}t=e}return t}function inferToMultipleTypes(e,t,n){let i=0;if(n&1048576){let n;const o=e.flags&1048576?e.types:[e];const a=new Array(o.length);let c=false;for(const e of t){if(getInferenceInfoForType(e)){n=e;i++}else{for(let t=0;ta[t]?void 0:e));if(e.length){inferFromTypes(getUnionType(e),n);return}}}else{for(const n of t){if(getInferenceInfoForType(n)){i++}else{inferFromTypes(e,n)}}}if(n&2097152?i===1:i>0){for(const n of t){if(getInferenceInfoForType(n)){inferWithPriority(e,n,1)}}}}function inferToMappedType(e,t,n){if(n.flags&1048576||n.flags&2097152){let r=false;for(const i of n.types){r=inferToMappedType(e,t,i)||r}return r}if(n.flags&4194304){const r=getInferenceInfoForType(n.type);if(r&&!r.isFixed&&!isFromInferenceBlockedSource(e)){const i=inferTypeForHomomorphicMappedType(e,t,n);if(i){inferWithPriority(i,r.typeParameter,getObjectFlags(e)&262144?16:8)}}return true}if(n.flags&262144){inferWithPriority(getIndexType(e,!!e.pattern?2:0),n,32);const r=getConstraintOfType(n);if(r&&inferToMappedType(e,t,r)){return true}const i=map(getPropertiesOfType(e),getTypeOfSymbol);const o=map(getIndexInfosOfType(e),(e=>e!==Wt?e.type:et));inferFromTypes(getUnionType(concatenate(i,o)),getTemplateTypeFromMappedType(t));return true}return false}function inferToConditionalType(e,t){if(e.flags&16777216){inferFromTypes(e.checkType,t.checkType);inferFromTypes(e.extendsType,t.extendsType);inferFromTypes(getTrueTypeFromConditionalType(e),getTrueTypeFromConditionalType(t));inferFromTypes(getFalseTypeFromConditionalType(e),getFalseTypeFromConditionalType(t))}else{const n=[getTrueTypeFromConditionalType(t),getFalseTypeFromConditionalType(t)];inferToMultipleTypesWithPriority(e,n,t.flags,i?64:0)}}function inferToTemplateLiteralType(e,t){const n=inferTypesFromTemplateLiteralType(e,t);const r=t.types;if(n||every(t.texts,(e=>e.length===0))){for(let e=0;ee|t.flags),0);if(!(r&4)){const n=t.value;if(r&296&&!isValidNumberString(n,true)){r&=~296}if(r&2112&&!isValidBigIntString(n,true)){r&=~2112}const o=reduceLeft(e,((e,i)=>!(i.flags&r)?e:e.flags&4?e:i.flags&4?t:e.flags&134217728?e:i.flags&134217728&&isTypeMatchedByTemplateLiteralType(t,i)?t:e.flags&268435456?e:i.flags&268435456&&n===applyStringMapping(i.symbol,n)?t:e.flags&128?e:i.flags&128&&i.value===n?i:e.flags&8?e:i.flags&8?getNumberLiteralType(+n):e.flags&32?e:i.flags&32?getNumberLiteralType(+n):e.flags&256?e:i.flags&256&&i.value===+n?i:e.flags&64?e:i.flags&64?parseBigIntLiteralType(n):e.flags&2048?e:i.flags&2048&&pseudoBigIntToString(i.value)===n?i:e.flags&16?e:i.flags&16?n==="true"?Ke:n==="false"?He:Xe:e.flags&512?e:i.flags&512&&i.intrinsicName===n?i:e.flags&32768?e:i.flags&32768&&i.intrinsicName===n?i:e.flags&65536?e:i.flags&65536&&i.intrinsicName===n?i:e),et);if(!(o.flags&131072)){inferFromTypes(o,i);continue}}}}inferFromTypes(t,i)}}}function inferFromGenericMappedTypes(e,t){inferFromTypes(getConstraintTypeFromMappedType(e),getConstraintTypeFromMappedType(t));inferFromTypes(getTemplateTypeFromMappedType(e),getTemplateTypeFromMappedType(t));const n=getNameTypeFromMappedType(e);const r=getNameTypeFromMappedType(t);if(n&&r)inferFromTypes(n,r)}function inferFromObjectTypes(e,t){var n,r;if(getObjectFlags(e)&4&&getObjectFlags(t)&4&&(e.target===t.target||isArrayType(e)&&isArrayType(t))){inferFromTypeArguments(getTypeArguments(e),getTypeArguments(t),getVariances(e.target));return}if(isGenericMappedType(e)&&isGenericMappedType(t)){inferFromGenericMappedTypes(e,t)}if(getObjectFlags(t)&32&&!t.declaration.nameType){const n=getConstraintTypeFromMappedType(t);if(inferToMappedType(e,t,n)){return}}if(!typesDefinitelyUnrelated(e,t)){if(isArrayOrTupleType(e)){if(isTupleType(t)){const i=getTypeReferenceArity(e);const o=getTypeReferenceArity(t);const a=getTypeArguments(t);const s=t.target.elementFlags;if(isTupleType(e)&&isTupleTypeStructureMatching(e,t)){for(let t=0;t0){const e=getSignaturesOfType(t,n);const o=e.length;for(let t=0;t1){const t=filter(e,isObjectOrArrayLiteralType);if(t.length){const n=getUnionType(t,2);return concatenate(filter(e,(e=>!isObjectOrArrayLiteralType(e))),[n])}}return e}function getContravariantInference(e){return e.priority&416?getIntersectionType(e.contraCandidates):getCommonSubtype(e.contraCandidates)}function getCovariantInference(e,t){const n=unionObjectAndArrayLiteralCandidates(e.candidates);const r=hasPrimitiveConstraint(e.typeParameter)||isConstTypeVariable(e.typeParameter);const i=!r&&e.topLevel&&(e.isFixed||!isTypeParameterAtTopLevelInReturnType(t,e.typeParameter));const o=r?sameMap(n,getRegularTypeOfLiteralType):i?sameMap(n,getWidenedLiteralType):n;const a=e.priority&416?getUnionType(o,2):getCommonSupertype(o);return getWidenedType(a)}function getInferredType(e,t){const n=e.inferences[t];if(!n.inferredType){let r;let i;if(e.signature){const o=n.candidates?getCovariantInference(n,e.signature):void 0;const a=n.contraCandidates?getContravariantInference(n):void 0;if(o||a){const t=o&&(!a||!(o.flags&(131072|1))&&some(n.contraCandidates,(e=>isTypeAssignableTo(o,e)))&&every(e.inferences,(e=>e!==n&&getConstraintOfTypeParameter(e.typeParameter)!==n.typeParameter||every(e.candidates,(e=>isTypeAssignableTo(e,o))))));r=t?o:a;i=t?a:o}else if(e.flags&1){r=tt}else{const i=getDefaultFromTypeParameter(n.typeParameter);if(i){r=instantiateType(i,mergeTypeMappers(createBackreferenceMapper(e,t),e.nonFixingMapper))}}}else{r=getTypeFromInference(n)}n.inferredType=r||getDefaultTypeArgumentType(!!(e.flags&2));const o=getConstraintOfTypeParameter(n.typeParameter);if(o){const t=instantiateType(o,e.nonFixingMapper);if(!r||!e.compareTypes(r,getTypeWithThisArgument(t,r))){n.inferredType=i&&e.compareTypes(i,getTypeWithThisArgument(t,i))?i:t}}}return n.inferredType}function getDefaultTypeArgumentType(e){return e?ke:Le}function getInferredTypes(e){const t=[];for(let n=0;nisInterfaceDeclaration(e)||isTypeAliasDeclaration(e)||isTypeLiteralNode(e))))}function getFlowCacheKey(e,t,n,r){switch(e.kind){case 80:if(!isThisInTypeQuery(e)){const i=getResolvedSymbol(e);return i!==xe?`${r?getNodeId(r):"-1"}|${getTypeId(t)}|${getTypeId(n)}|${getSymbolId(i)}`:void 0}case 110:return`0|${r?getNodeId(r):"-1"}|${getTypeId(t)}|${getTypeId(n)}`;case 235:case 217:return getFlowCacheKey(e.expression,t,n,r);case 166:const i=getFlowCacheKey(e.left,t,n,r);return i&&`${i}.${e.right.escapedText}`;case 211:case 212:const o=getAccessedPropertyName(e);if(o!==void 0){const i=getFlowCacheKey(e.expression,t,n,r);return i&&`${i}.${o}`}if(isElementAccessExpression(e)&&isIdentifier(e.argumentExpression)){const i=getResolvedSymbol(e.argumentExpression);if(isConstantVariable(i)||isParameterOrMutableLocalVariable(i)&&!isSymbolAssigned(i)){const o=getFlowCacheKey(e.expression,t,n,r);return o&&`${o}.@${getSymbolId(i)}`}}break;case 206:case 207:case 262:case 218:case 219:case 174:return`${getNodeId(e)}#${getTypeId(t)}`}return void 0}function isMatchingReference(e,t){switch(t.kind){case 217:case 235:return isMatchingReference(e,t.expression);case 226:return isAssignmentExpression(t)&&isMatchingReference(e,t.left)||isBinaryExpression(t)&&t.operatorToken.kind===28&&isMatchingReference(e,t.right)}switch(e.kind){case 236:return t.kind===236&&e.keywordToken===t.keywordToken&&e.name.escapedText===t.name.escapedText;case 80:case 81:return isThisInTypeQuery(e)?t.kind===110:t.kind===80&&getResolvedSymbol(e)===getResolvedSymbol(t)||(isVariableDeclaration(t)||isBindingElement(t))&&getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(e))===getSymbolOfDeclaration(t);case 110:return t.kind===110;case 108:return t.kind===108;case 235:case 217:case 238:return isMatchingReference(e.expression,t);case 211:case 212:const n=getAccessedPropertyName(e);if(n!==void 0){const r=isAccessExpression(t)?getAccessedPropertyName(t):void 0;if(r!==void 0){return r===n&&isMatchingReference(e.expression,t.expression)}}if(isElementAccessExpression(e)&&isElementAccessExpression(t)&&isIdentifier(e.argumentExpression)&&isIdentifier(t.argumentExpression)){const n=getResolvedSymbol(e.argumentExpression);if(n===getResolvedSymbol(t.argumentExpression)&&(isConstantVariable(n)||isParameterOrMutableLocalVariable(n)&&!isSymbolAssigned(n))){return isMatchingReference(e.expression,t.expression)}}break;case 166:return isAccessExpression(t)&&e.right.escapedText===getAccessedPropertyName(t)&&isMatchingReference(e.left,t.expression);case 226:return isBinaryExpression(e)&&e.operatorToken.kind===28&&isMatchingReference(e.right,t)}return false}function getAccessedPropertyName(e){if(isPropertyAccessExpression(e)){return e.name.escapedText}if(isElementAccessExpression(e)){return tryGetElementAccessExpressionName(e)}if(isBindingElement(e)){const t=getDestructuringPropertyName(e);return t?escapeLeadingUnderscores(t):void 0}if(isParameter(e)){return""+e.parent.parameters.indexOf(e)}return void 0}function tryGetNameFromType(e){return e.flags&8192?e.escapedName:e.flags&384?escapeLeadingUnderscores(""+e.value):void 0}function tryGetElementAccessExpressionName(e){return isStringOrNumericLiteralLike(e.argumentExpression)?escapeLeadingUnderscores(e.argumentExpression.text):isEntityNameExpression(e.argumentExpression)?tryGetNameFromEntityNameExpression(e.argumentExpression):void 0}function tryGetNameFromEntityNameExpression(e){const t=resolveEntityName(e,111551,true);if(!t||!(isConstantVariable(t)||t.flags&8))return void 0;const n=t.valueDeclaration;if(n===void 0)return void 0;const r=tryGetTypeFromEffectiveTypeNode(n);if(r){const e=tryGetNameFromType(r);if(e!==void 0){return e}}if(hasOnlyExpressionInitializer(n)&&isBlockScopedNameDeclaredBeforeUse(n,e)){const e=getEffectiveInitializer(n);if(e){const t=isBindingPattern(n.parent)?getTypeForBindingElement(n):getTypeOfExpression(e);return t&&tryGetNameFromType(t)}if(isEnumMember(n)){return getTextOfPropertyName(n.name)}}return void 0}function containsMatchingReference(e,t){while(isAccessExpression(e)){e=e.expression;if(isMatchingReference(e,t)){return true}}return false}function optionalChainContainsReference(e,t){while(isOptionalChain(e)){e=e.expression;if(isMatchingReference(e,t)){return true}}return false}function isDiscriminantProperty(e,t){if(e&&e.flags&1048576){const n=getUnionOrIntersectionProperty(e,t);if(n&&getCheckFlags(n)&2){if(n.links.isDiscriminantProperty===void 0){n.links.isDiscriminantProperty=(n.links.checkFlags&192)===192&&!isGenericType(getTypeOfSymbol(n))}return!!n.links.isDiscriminantProperty}}return false}function findDiscriminantProperties(e,t){let n;for(const r of e){if(isDiscriminantProperty(t,r.escapedName)){if(n){n.push(r);continue}n=[r]}}return n}function mapTypesByKeyProperty(e,t){const n=new Map;let r=0;for(const i of e){if(i.flags&(524288|2097152|58982400)){const e=getTypeOfPropertyOfType(i,t);if(e){if(!isLiteralType(e)){return void 0}let t=false;forEachType(e,(e=>{const r=getTypeId(getRegularTypeOfLiteralType(e));const o=n.get(r);if(!o){n.set(r,i)}else if(o!==Le){n.set(r,Le);t=true}}));if(!t)r++}}}return r>=10&&r*2>=e.length?n:void 0}function getKeyPropertyName(e){const t=e.types;if(t.length<10||getObjectFlags(e)&32768||countWhere(t,(e=>!!(e.flags&(524288|58982400))))<10){return void 0}if(e.keyPropertyName===void 0){const n=forEach(t,(e=>e.flags&(524288|58982400)?forEach(getPropertiesOfType(e),(e=>isUnitType(getTypeOfSymbol(e))?e.escapedName:void 0)):void 0));const r=n&&mapTypesByKeyProperty(t,n);e.keyPropertyName=r?n:"";e.constituentMap=r}return e.keyPropertyName.length?e.keyPropertyName:void 0}function getConstituentTypeForKeyType(e,t){var n;const r=(n=e.constituentMap)==null?void 0:n.get(getTypeId(getRegularTypeOfLiteralType(t)));return r!==Le?r:void 0}function getMatchingUnionConstituentForType(e,t){const n=getKeyPropertyName(e);const r=n&&getTypeOfPropertyOfType(t,n);return r&&getConstituentTypeForKeyType(e,r)}function getMatchingUnionConstituentForObjectLiteral(e,t){const n=getKeyPropertyName(e);const r=n&&find(t.properties,(e=>e.symbol&&e.kind===303&&e.symbol.escapedName===n&&isPossiblyDiscriminantValue(e.initializer)));const i=r&&getContextFreeTypeOfExpression(r.initializer);return i&&getConstituentTypeForKeyType(e,i)}function isOrContainsMatchingReference(e,t){return isMatchingReference(e,t)||containsMatchingReference(e,t)}function hasMatchingArgument(e,t){if(e.arguments){for(const n of e.arguments){if(isOrContainsMatchingReference(t,n)||optionalChainContainsReference(n,t)){return true}}}if(e.expression.kind===211&&isOrContainsMatchingReference(t,e.expression.expression)){return true}return false}function getFlowNodeId(e){if(e.id<=0){e.id=ta;ta++}return e.id}function typeMaybeAssignableTo(e,t){if(!(e.flags&1048576)){return isTypeAssignableTo(e,t)}for(const n of e.types){if(isTypeAssignableTo(n,t)){return true}}return false}function getAssignmentReducedType(e,t){if(e===t){return e}if(t.flags&131072){return t}const n=`A${getTypeId(e)},${getTypeId(t)}`;return getCachedType(n)??setCachedType(n,getAssignmentReducedTypeWorker(e,t))}function getAssignmentReducedTypeWorker(e,t){const n=filterType(e,(e=>typeMaybeAssignableTo(t,e)));const r=t.flags&512&&isFreshLiteralType(t)?mapType(n,getFreshTypeOfLiteralType):n;return isTypeAssignableTo(t,r)?r:e}function isFunctionObjectType(e){if(getObjectFlags(e)&256){return false}const t=resolveStructuredTypeMembers(e);return!!(t.callSignatures.length||t.constructSignatures.length||t.members.get("bind")&&isTypeSubtypeOf(e,tn))}function getTypeFacts(e,t){return getTypeFactsWorker(e,t)&t}function hasTypeFacts(e,t){return getTypeFacts(e,t)!==0}function getTypeFactsWorker(e,t){if(e.flags&(2097152|465829888)){e=getBaseConstraintOfType(e)||Le}const n=e.flags;if(n&(4|268435456)){return k?16317953:16776705}if(n&(128|134217728)){const t=n&128&&e.value==="";return k?t?12123649:7929345:t?12582401:16776705}if(n&(8|32)){return k?16317698:16776450}if(n&256){const t=e.value===0;return k?t?12123394:7929090:t?12582146:16776450}if(n&64){return k?16317188:16775940}if(n&2048){const t=isZeroBigInt(e);return k?t?12122884:7928580:t?12581636:16775940}if(n&16){return k?16316168:16774920}if(n&528){return k?e===He||e===Ge?12121864:7927560:e===He||e===Ge?12580616:16774920}if(n&524288){const n=k?83427327|7880640|7888800:83886079|16728e3|16736160;if((t&n)===0){return 0}return getObjectFlags(e)&16&&isEmptyObjectType(e)?k?83427327:83886079:isFunctionObjectType(e)?k?7880640:16728e3:k?7888800:16736160}if(n&16384){return 9830144}if(n&32768){return 26607360}if(n&65536){return 42917664}if(n&12288){return k?7925520:16772880}if(n&67108864){return k?7888800:16736160}if(n&131072){return 0}if(n&1048576){return reduceLeft(e.types,((e,n)=>e|getTypeFactsWorker(n,t)),0)}if(n&2097152){return getIntersectionTypeFacts(e,t)}return 83886079}function getIntersectionTypeFacts(e,t){const n=maybeTypeOfKind(e,402784252);let r=0;let i=134217727;for(const o of e.types){if(!(n&&o.flags&524288)){const e=getTypeFactsWorker(o,t);r|=e;i&=e}}return r&8256|i&134209471}function getTypeWithFacts(e,t){return filterType(e,(e=>hasTypeFacts(e,t)))}function getAdjustedTypeWithFacts(e,t){const n=recombineUnknownType(getTypeWithFacts(k&&e.flags&2?Ct:e,t));if(k){switch(t){case 524288:return removeNullableByIntersection(n,65536,131072,33554432,We);case 1048576:return removeNullableByIntersection(n,131072,65536,16777216,Me);case 2097152:case 4194304:return mapType(n,(e=>hasTypeFacts(e,262144)?getGlobalNonNullableTypeInstantiation(e):e))}}return n}function removeNullableByIntersection(e,t,n,r,i){const o=getTypeFacts(e,65536|131072|16777216|33554432);if(!(o&t)){return e}const a=getUnionType([ht,i]);return mapType(e,(e=>hasTypeFacts(e,t)?getIntersectionType([e,!(o&r)&&hasTypeFacts(e,n)?a:ht]):e))}function recombineUnknownType(e){return e===Ct?Le:e}function getTypeWithDefault(e,t){return t?getUnionType([getNonUndefinedType(e),getTypeOfExpression(t)]):e}function getTypeOfDestructuredProperty(e,t){var n;const r=getLiteralTypeFromPropertyName(t);if(!isTypeUsableAsPropertyName(r))return Ie;const i=getPropertyNameFromType(r);return getTypeOfPropertyOfType(e,i)||includeUndefinedInIndexSignature((n=getApplicableIndexInfoForName(e,i))==null?void 0:n.type)||Ie}function getTypeOfDestructuredArrayElement(e,t){return everyType(e,isTupleLikeType)&&getTupleElementType(e,t)||includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65,e,Me,void 0))||Ie}function includeUndefinedInIndexSignature(e){if(!e)return e;return T.noUncheckedIndexedAccess?getUnionType([e,Be]):e}function getTypeOfDestructuredSpreadExpression(e){return createArrayType(checkIteratedTypeOrElementType(65,e,Me,void 0)||Ie)}function getAssignedTypeOfBinaryExpression(e){const t=e.parent.kind===209&&isDestructuringAssignmentTarget(e.parent)||e.parent.kind===303&&isDestructuringAssignmentTarget(e.parent.parent);return t?getTypeWithDefault(getAssignedType(e),e.right):getTypeOfExpression(e.right)}function isDestructuringAssignmentTarget(e){return e.parent.kind===226&&e.parent.left===e||e.parent.kind===250&&e.parent.initializer===e}function getAssignedTypeOfArrayLiteralElement(e,t){return getTypeOfDestructuredArrayElement(getAssignedType(e),e.elements.indexOf(t))}function getAssignedTypeOfSpreadExpression(e){return getTypeOfDestructuredSpreadExpression(getAssignedType(e.parent))}function getAssignedTypeOfPropertyAssignment(e){return getTypeOfDestructuredProperty(getAssignedType(e.parent),e.name)}function getAssignedTypeOfShorthandPropertyAssignment(e){return getTypeWithDefault(getAssignedTypeOfPropertyAssignment(e),e.objectAssignmentInitializer)}function getAssignedType(e){const{parent:t}=e;switch(t.kind){case 249:return ze;case 250:return checkRightHandSideOfForOf(t)||Ie;case 226:return getAssignedTypeOfBinaryExpression(t);case 220:return Me;case 209:return getAssignedTypeOfArrayLiteralElement(t,e);case 230:return getAssignedTypeOfSpreadExpression(t);case 303:return getAssignedTypeOfPropertyAssignment(t);case 304:return getAssignedTypeOfShorthandPropertyAssignment(t)}return Ie}function getInitialTypeOfBindingElement(e){const t=e.parent;const n=getInitialType(t.parent);const r=t.kind===206?getTypeOfDestructuredProperty(n,e.propertyName||e.name):!e.dotDotDotToken?getTypeOfDestructuredArrayElement(n,t.elements.indexOf(e)):getTypeOfDestructuredSpreadExpression(n);return getTypeWithDefault(r,e.initializer)}function getTypeOfInitializer(e){const t=getNodeLinks(e);return t.resolvedType||getTypeOfExpression(e)}function getInitialTypeOfVariableDeclaration(e){if(e.initializer){return getTypeOfInitializer(e.initializer)}if(e.parent.parent.kind===249){return ze}if(e.parent.parent.kind===250){return checkRightHandSideOfForOf(e.parent.parent)||Ie}return Ie}function getInitialType(e){return e.kind===260?getInitialTypeOfVariableDeclaration(e):getInitialTypeOfBindingElement(e)}function isEmptyArrayAssignment(e){return e.kind===260&&e.initializer&&isEmptyArrayLiteral2(e.initializer)||e.kind!==208&&e.parent.kind===226&&isEmptyArrayLiteral2(e.parent.right)}function getReferenceCandidate(e){switch(e.kind){case 217:return getReferenceCandidate(e.expression);case 226:switch(e.operatorToken.kind){case 64:case 76:case 77:case 78:return getReferenceCandidate(e.left);case 28:return getReferenceCandidate(e.right)}}return e}function getReferenceRoot(e){const{parent:t}=e;return t.kind===217||t.kind===226&&t.operatorToken.kind===64&&t.left===e||t.kind===226&&t.operatorToken.kind===28&&t.right===e?getReferenceRoot(t):e}function getTypeOfSwitchClause(e){if(e.kind===296){return getRegularTypeOfLiteralType(getTypeOfExpression(e.expression))}return et}function getSwitchClauseTypes(e){const t=getNodeLinks(e);if(!t.switchTypes){t.switchTypes=[];for(const n of e.caseBlock.clauses){t.switchTypes.push(getTypeOfSwitchClause(n))}}return t.switchTypes}function getSwitchClauseTypeOfWitnesses(e){if(some(e.caseBlock.clauses,(e=>e.kind===296&&!isStringLiteralLike(e.expression)))){return void 0}const t=[];for(const n of e.caseBlock.clauses){const e=n.kind===296?n.expression.text:void 0;t.push(e&&!contains(t,e)?e:void 0)}return t}function eachTypeContainedIn(e,t){return e.flags&1048576?!forEach(e.types,(e=>!contains(t,e))):contains(t,e)}function isTypeSubsetOf(e,t){return!!(e===t||e.flags&131072||t.flags&1048576&&isTypeSubsetOfUnion(e,t))}function isTypeSubsetOfUnion(e,t){if(e.flags&1048576){for(const n of e.types){if(!containsType(t.types,n)){return false}}return true}if(e.flags&1056&&getBaseTypeOfEnumLikeType(e)===t){return true}return containsType(t.types,e)}function forEachType(e,t){return e.flags&1048576?forEach(e.types,t):t(e)}function someType(e,t){return e.flags&1048576?some(e.types,t):t(e)}function everyType(e,t){return e.flags&1048576?every(e.types,t):t(e)}function everyContainedType(e,t){return e.flags&3145728?every(e.types,t):t(e)}function filterType(e,t){if(e.flags&1048576){const n=e.types;const r=filter(n,t);if(r===n){return e}const i=e.origin;let o;if(i&&i.flags&1048576){const e=i.types;const a=filter(e,(e=>!!(e.flags&1048576)||t(e)));if(e.length-a.length===n.length-r.length){if(a.length===1){return a[0]}o=createOriginUnionOrIntersectionType(1048576,a)}}return getUnionTypeFromSortedList(r,e.objectFlags&(32768|16777216),void 0,void 0,o)}return e.flags&131072||t(e)?e:et}function removeType(e,t){return filterType(e,(e=>e!==t))}function countTypes(e){return e.flags&1048576?e.types.length:1}function mapType(e,t,n){if(e.flags&131072){return e}if(!(e.flags&1048576)){return t(e)}const r=e.origin;const i=r&&r.flags&1048576?r.types:e.types;let o;let a=false;for(const e of i){const r=e.flags&1048576?mapType(e,t,n):t(e);a||(a=e!==r);if(r){if(!o){o=[r]}else{o.push(r)}}}return a?o&&getUnionType(o,n?0:1):e}function mapTypeWithAlias(e,t,n,r){return e.flags&1048576&&n?getUnionType(map(e.types,t),1,n,r):mapType(e,t)}function extractTypesOfKind(e,t){return filterType(e,(e=>(e.flags&t)!==0))}function replacePrimitivesWithLiterals(e,t){if(maybeTypeOfKind(e,4|134217728|8|64)&&maybeTypeOfKind(t,128|134217728|268435456|256|2048)){return mapType(e,(e=>e.flags&4?extractTypesOfKind(t,4|128|134217728|268435456):isPatternLiteralType(e)&&!maybeTypeOfKind(t,4|134217728|268435456)?extractTypesOfKind(t,128):e.flags&8?extractTypesOfKind(t,8|256):e.flags&64?extractTypesOfKind(t,64|2048):e))}return e}function isIncomplete(e){return e.flags===0}function getTypeFromFlowType(e){return e.flags===0?e.type:e}function createFlowType(e,t){return t?{flags:0,type:e.flags&131072?tt:e}:e}function createEvolvingArrayType(e){const t=createObjectType(256);t.elementType=e;return t}function getEvolvingArrayType(e){return Te[e.id]||(Te[e.id]=createEvolvingArrayType(e))}function addEvolvingArrayElementType(e,t){const n=getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(t)));return isTypeSubsetOf(n,e.elementType)?e:getEvolvingArrayType(getUnionType([e.elementType,n]))}function createFinalArrayType(e){return e.flags&131072?hn:createArrayType(e.flags&1048576?getUnionType(e.types,2):e)}function getFinalArrayType(e){return e.finalArrayType||(e.finalArrayType=createFinalArrayType(e.elementType))}function finalizeEvolvingArrayType(e){return getObjectFlags(e)&256?getFinalArrayType(e):e}function getElementTypeOfEvolvingArrayType(e){return getObjectFlags(e)&256?e.elementType:et}function isEvolvingArrayTypeList(e){let t=false;for(const n of e){if(!(n.flags&131072)){if(!(getObjectFlags(n)&256)){return false}t=true}}return t}function isEvolvingArrayOperationTarget(e){const t=getReferenceRoot(e);const n=t.parent;const r=isPropertyAccessExpression(n)&&(n.name.escapedText==="length"||n.parent.kind===213&&isIdentifier(n.name)&&isPushOrUnshiftIdentifier(n.name));const i=n.kind===212&&n.expression===t&&n.parent.kind===226&&n.parent.operatorToken.kind===64&&n.parent.left===n&&!isAssignmentTarget(n.parent)&&isTypeAssignableToKind(getTypeOfExpression(n.argumentExpression),296);return r||i}function isDeclarationWithExplicitTypeAnnotation(e){return(isVariableDeclaration(e)||isPropertyDeclaration(e)||isPropertySignature(e)||isParameter(e))&&!!(getEffectiveTypeAnnotationNode(e)||isInJSFile(e)&&hasInitializer(e)&&e.initializer&&isFunctionExpressionOrArrowFunction(e.initializer)&&getEffectiveReturnTypeNode(e.initializer))}function getExplicitTypeOfSymbol(e,t){e=resolveSymbol(e);if(e.flags&(16|8192|32|512)){return getTypeOfSymbol(e)}if(e.flags&(3|4)){if(getCheckFlags(e)&262144){const t=e.links.syntheticOrigin;if(t&&getExplicitTypeOfSymbol(t)){return getTypeOfSymbol(e)}}const n=e.valueDeclaration;if(n){if(isDeclarationWithExplicitTypeAnnotation(n)){return getTypeOfSymbol(e)}if(isVariableDeclaration(n)&&n.parent.parent.kind===250){const e=n.parent.parent;const t=getTypeOfDottedName(e.expression,void 0);if(t){const n=e.awaitModifier?15:13;return checkIteratedTypeOrElementType(n,t,Me,void 0)}}if(t){addRelatedInfo(t,createDiagnosticForNode(n,wt._0_needs_an_explicit_type_annotation,symbolToString(e)))}}}}function getTypeOfDottedName(e,t){if(!(e.flags&67108864)){switch(e.kind){case 80:const n=getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(e));return getExplicitTypeOfSymbol(n,t);case 110:return getExplicitThisType(e);case 108:return checkSuperExpression(e);case 211:{const n=getTypeOfDottedName(e.expression,t);if(n){const r=e.name;let i;if(isPrivateIdentifier(r)){if(!n.symbol){return void 0}i=getPropertyOfType(n,getSymbolNameForPrivateIdentifier(n.symbol,r.escapedText))}else{i=getPropertyOfType(n,r.escapedText)}return i&&getExplicitTypeOfSymbol(i,t)}return void 0}case 217:return getTypeOfDottedName(e.expression,t)}}}function getEffectsSignature(e){const t=getNodeLinks(e);let n=t.effectsSignature;if(n===void 0){let r;if(isBinaryExpression(e)){const t=checkNonNullExpression(e.right);r=getSymbolHasInstanceMethodOfObjectType(t)}else if(e.parent.kind===244){r=getTypeOfDottedName(e.expression,void 0)}else if(e.expression.kind!==108){if(isOptionalChain(e)){r=checkNonNullType(getOptionalExpressionType(checkExpression(e.expression),e.expression),e.expression)}else{r=checkNonNullExpression(e.expression)}}const i=getSignaturesOfType(r&&getApparentType(r)||Le,0);const o=i.length===1&&!i[0].typeParameters?i[0]:some(i,hasTypePredicateOrNeverReturnType)?getResolvedSignature(e):void 0;n=t.effectsSignature=o&&hasTypePredicateOrNeverReturnType(o)?o:Bt}return n===Bt?void 0:n}function hasTypePredicateOrNeverReturnType(e){return!!(getTypePredicateOfSignature(e)||e.declaration&&(getReturnTypeFromAnnotation(e.declaration)||Le).flags&131072)}function getTypePredicateArgument(e,t){if(e.kind===1||e.kind===3){return t.arguments[e.parameterIndex]}const n=skipParentheses(t.expression);return isAccessExpression(n)?skipParentheses(n.expression):void 0}function reportFlowControlError(e){const t=findAncestor(e,isFunctionOrModuleBlock);const n=getSourceFileOfNode(e);const r=getSpanOfTokenAtPosition(n,t.statements.pos);gi.add(createFileDiagnostic(n,r.start,r.length,wt.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis))}function isReachableFlowNode(e){const t=isReachableFlowNodeWorker(e,false);Fr=e;Pr=t;return t}function isFalseExpression(e){const t=skipParentheses(e,true);return t.kind===97||t.kind===226&&(t.operatorToken.kind===56&&(isFalseExpression(t.left)||isFalseExpression(t.right))||t.operatorToken.kind===57&&isFalseExpression(t.left)&&isFalseExpression(t.right))}function isReachableFlowNodeWorker(e,t){while(true){if(e===Fr){return Pr}const n=e.flags;if(n&4096){if(!t){const t=getFlowNodeId(e);const n=oi[t];return n!==void 0?n:oi[t]=isReachableFlowNodeWorker(e,true)}t=false}if(n&(16|96|256)){e=e.antecedent}else if(n&512){const t=getEffectsSignature(e.node);if(t){const n=getTypePredicateOfSignature(t);if(n&&n.kind===3&&!n.type){const t=e.node.arguments[n.parameterIndex];if(t&&isFalseExpression(t)){return false}}if(getReturnTypeOfSignature(t).flags&131072){return false}}e=e.antecedent}else if(n&4){return some(e.antecedent,(e=>isReachableFlowNodeWorker(e,false)))}else if(n&8){const t=e.antecedent;if(t===void 0||t.length===0){return false}e=t[0]}else if(n&128){const t=e.node;if(t.clauseStart===t.clauseEnd&&isExhaustiveSwitchStatement(t.switchStatement)){return false}e=e.antecedent}else if(n&1024){Fr=void 0;const t=e.node.target;const n=t.antecedent;t.antecedent=e.node.antecedents;const r=isReachableFlowNodeWorker(e.antecedent,false);t.antecedent=n;return r}else{return!(n&1)}}}function isPostSuperFlowNode(e,t){while(true){const n=e.flags;if(n&4096){if(!t){const t=getFlowNodeId(e);const n=ai[t];return n!==void 0?n:ai[t]=isPostSuperFlowNode(e,true)}t=false}if(n&(16|96|256|128)){e=e.antecedent}else if(n&512){if(e.node.expression.kind===108){return true}e=e.antecedent}else if(n&4){return every(e.antecedent,(e=>isPostSuperFlowNode(e,false)))}else if(n&8){e=e.antecedent[0]}else if(n&1024){const t=e.node.target;const n=t.antecedent;t.antecedent=e.node.antecedents;const r=isPostSuperFlowNode(e.antecedent,false);t.antecedent=n;return r}else{return!!(n&1)}}}function isConstantReference(e){switch(e.kind){case 110:return true;case 80:if(!isThisInTypeQuery(e)){const t=getResolvedSymbol(e);return isConstantVariable(t)||isParameterOrMutableLocalVariable(t)&&!isSymbolAssigned(t)||!!t.valueDeclaration&&isFunctionExpression(t.valueDeclaration)}break;case 211:case 212:return isConstantReference(e.expression)&&isReadonlySymbol(getNodeLinks(e).resolvedSymbol||xe);case 206:case 207:const t=getRootDeclaration(e.parent);return isParameter(t)||isCatchClauseVariableDeclaration(t)?!isSomeSymbolAssigned(t):isVariableDeclaration(t)&&isVarConstLike2(t)}return false}function getFlowTypeOfReference(e,t,n=t,r,i=(t=>(t=tryCast(e,canHaveFlowNode))==null?void 0:t.flowNode)()){let o;let a=false;let s=0;if(Nr){return Ie}if(!i){return t}kr++;const c=Er;const l=getTypeFromFlowType(getTypeAtFlowNode(i));Er=c;const d=getObjectFlags(l)&256&&isEvolvingArrayOperationTarget(e)?hn:finalizeEvolvingArrayType(l);if(d===rt||e.parent&&e.parent.kind===235&&!(d.flags&131072)&&getTypeWithFacts(d,2097152).flags&131072){return t}return d;function getOrSetCacheKey(){if(a){return o}a=true;return o=getFlowCacheKey(e,t,n,r)}function getTypeAtFlowNode(i){var o;if(s===2e3){(o=G)==null?void 0:o.instant(G.Phase.CheckTypes,"getTypeAtFlowNode_DepthLimit",{flowId:i.id});Nr=true;reportFlowControlError(e);return Ie}s++;let a;while(true){const o=i.flags;if(o&4096){for(let e=c;e=0&&n.parameterIndex!(e.flags&(32768|131072))))}else if(n.kind===221&&optionalChainContainsReference(n.expression,e)){i=narrowTypeBySwitchOptionalChainContainment(i,t.node,(e=>!(e.flags&131072||e.flags&128&&e.value==="undefined")))}}const r=getDiscriminantPropertyAccess(n,i);if(r){i=narrowTypeBySwitchOnDiscriminantProperty(i,r,t.node)}}return createFlowType(i,isIncomplete(r))}function getTypeAtFlowBranchLabel(e){const r=[];let i=false;let o=false;let a;for(const s of e.antecedent){if(!a&&s.flags&128&&s.node.clauseStart===s.node.clauseEnd){a=s;continue}const e=getTypeAtFlowNode(s);const c=getTypeFromFlowType(e);if(c===t&&t===n){return c}pushIfUnique(r,c);if(!isTypeSubsetOf(c,n)){i=true}if(isIncomplete(e)){o=true}}if(a){const e=getTypeAtFlowNode(a);const s=getTypeFromFlowType(e);if(!(s.flags&131072)&&!contains(r,s)&&!isExhaustiveSwitchStatement(a.node.switchStatement)){if(s===t&&t===n){return s}r.push(s);if(!isTypeSubsetOf(s,n)){i=true}if(isIncomplete(e)){o=true}}}return createFlowType(getUnionOrEvolvingArrayType(r,i?2:1),o)}function getTypeAtFlowLoopLabel(e){const r=getFlowNodeId(e);const i=Zr[r]||(Zr[r]=new Map);const o=getOrSetCacheKey();if(!o){return t}const a=i.get(o);if(a){return a}for(let t=br;t{const t=getTypeOfPropertyOrIndexSignatureOfType(e,r)||Le;return!(t.flags&131072)&&!(s.flags&131072)&&areTypesComparable(s,t)}))}function narrowTypeByDiscriminantProperty(e,t,n,r,i){if((n===37||n===38)&&e.flags&1048576){const o=getKeyPropertyName(e);if(o&&o===getAccessedPropertyName(t)){const t=getConstituentTypeForKeyType(e,getTypeOfExpression(r));if(t){return n===(i?37:38)?t:isUnitType(getTypeOfPropertyOfType(t,o)||Le)?removeType(e,t):e}}}return narrowTypeByDiscriminant(e,t,(e=>narrowTypeByEquality(e,n,r,i)))}function narrowTypeBySwitchOnDiscriminantProperty(e,t,n){if(n.clauseStartgetConstituentTypeForKeyType(e,t)||Le)));if(r!==Le){return r}}return narrowTypeByDiscriminant(e,t,(e=>narrowTypeBySwitchOnDiscriminant(e,n)))}function narrowTypeByTruthiness(t,n,r){if(isMatchingReference(e,n)){return getAdjustedTypeWithFacts(t,r?4194304:8388608)}if(k&&r&&optionalChainContainsReference(n,e)){t=getAdjustedTypeWithFacts(t,2097152)}const i=getDiscriminantPropertyAccess(n,t);if(i){return narrowTypeByDiscriminant(t,i,(e=>getTypeWithFacts(e,r?4194304:8388608)))}return t}function isTypePresencePossible(e,t,n){const r=getPropertyOfType(e,t);return r?!!(r.flags&16777216||getCheckFlags(r)&48)||n:!!getApplicableIndexInfoForName(e,t)||!n}function narrowTypeByInKeyword(e,t,n){const r=getPropertyNameFromType(t);const i=someType(e,(e=>isTypePresencePossible(e,r,true)));if(i){return filterType(e,(e=>isTypePresencePossible(e,r,n)))}if(n){const n=getGlobalRecordSymbol();if(n){return getIntersectionType([e,getTypeAliasInstantiation(n,[t,Le])])}}return e}function narrowTypeByBooleanComparison(e,t,n,r,i){i=i!==(n.kind===112)!==(r!==38&&r!==36);return narrowType(e,t,i)}function narrowTypeByBinaryExpression(t,n,r){switch(n.operatorToken.kind){case 64:case 76:case 77:case 78:return narrowTypeByTruthiness(narrowType(t,n.right,r),n.left,r);case 35:case 36:case 37:case 38:const i=n.operatorToken.kind;const o=getReferenceCandidate(n.left);const a=getReferenceCandidate(n.right);if(o.kind===221&&isStringLiteralLike(a)){return narrowTypeByTypeof(t,o,i,a,r)}if(a.kind===221&&isStringLiteralLike(o)){return narrowTypeByTypeof(t,a,i,o,r)}if(isMatchingReference(e,o)){return narrowTypeByEquality(t,i,a,r)}if(isMatchingReference(e,a)){return narrowTypeByEquality(t,i,o,r)}if(k){if(optionalChainContainsReference(o,e)){t=narrowTypeByOptionalChainContainment(t,i,a,r)}else if(optionalChainContainsReference(a,e)){t=narrowTypeByOptionalChainContainment(t,i,o,r)}}const s=getDiscriminantPropertyAccess(o,t);if(s){return narrowTypeByDiscriminantProperty(t,s,i,a,r)}const c=getDiscriminantPropertyAccess(a,t);if(c){return narrowTypeByDiscriminantProperty(t,c,i,o,r)}if(isMatchingConstructorReference(o)){return narrowTypeByConstructor(t,i,a,r)}if(isMatchingConstructorReference(a)){return narrowTypeByConstructor(t,i,o,r)}if(isBooleanLiteral(a)&&!isAccessExpression(o)){return narrowTypeByBooleanComparison(t,o,a,i,r)}if(isBooleanLiteral(o)&&!isAccessExpression(a)){return narrowTypeByBooleanComparison(t,a,o,i,r)}break;case 104:return narrowTypeByInstanceof(t,n,r);case 103:if(isPrivateIdentifier(n.left)){return narrowTypeByPrivateIdentifierInInExpression(t,n,r)}const l=getReferenceCandidate(n.right);if(containsMissingType(t)&&isAccessExpression(e)&&isMatchingReference(e.expression,l)){const i=getTypeOfExpression(n.left);if(isTypeUsableAsPropertyName(i)&&getAccessedPropertyName(e)===getPropertyNameFromType(i)){return getTypeWithFacts(t,r?524288:65536)}}if(isMatchingReference(e,l)){const e=getTypeOfExpression(n.left);if(isTypeUsableAsPropertyName(e)){return narrowTypeByInKeyword(t,e,r)}}break;case 28:return narrowType(t,n.right,r);case 56:return r?narrowType(narrowType(t,n.left,true),n.right,true):getUnionType([narrowType(t,n.left,false),narrowType(t,n.right,false)]);case 57:return r?getUnionType([narrowType(t,n.left,true),narrowType(t,n.right,true)]):narrowType(narrowType(t,n.left,false),n.right,false)}return t}function narrowTypeByPrivateIdentifierInInExpression(t,n,r){const i=getReferenceCandidate(n.right);if(!isMatchingReference(e,i)){return t}S.assertNode(n.left,isPrivateIdentifier);const o=getSymbolForPrivateIdentifierExpression(n.left);if(o===void 0){return t}const a=o.parent;const s=hasStaticModifier(S.checkDefined(o.valueDeclaration,"should always have a declaration"))?getTypeOfSymbol(a):getDeclaredTypeOfSymbol(a);return getNarrowedType(t,s,r,true)}function narrowTypeByOptionalChainContainment(e,t,n,r){const i=t===35||t===37;const o=t===35||t===36?98304:32768;const a=getTypeOfExpression(n);const s=i!==r&&everyType(a,(e=>!!(e.flags&o)))||i===r&&everyType(a,(e=>!(e.flags&(3|o))));return s?getAdjustedTypeWithFacts(e,2097152):e}function narrowTypeByEquality(e,t,n,r){if(e.flags&1){return e}if(t===36||t===38){r=!r}const i=getTypeOfExpression(n);const o=t===35||t===36;if(i.flags&98304){if(!k){return e}const t=o?r?262144:2097152:i.flags&65536?r?131072:1048576:r?65536:524288;return getAdjustedTypeWithFacts(e,t)}if(r){if(!o&&(e.flags&2||someType(e,isEmptyAnonymousObjectType))){if(i.flags&(402784252|67108864)||isEmptyAnonymousObjectType(i)){return i}if(i.flags&524288){return it}}const t=filterType(e,(e=>areTypesComparable(e,i)||o&&isCoercibleUnderDoubleEquals(e,i)));return replacePrimitivesWithLiterals(t,i)}if(isUnitType(i)){return filterType(e,(e=>!(isUnitLikeType(e)&&areTypesComparable(e,i))))}return e}function narrowTypeByTypeof(t,n,r,i,o){if(r===36||r===38){o=!o}const a=getReferenceCandidate(n.expression);if(!isMatchingReference(e,a)){if(k&&optionalChainContainsReference(a,e)&&o===(i.text!=="undefined")){t=getAdjustedTypeWithFacts(t,2097152)}const n=getDiscriminantPropertyAccess(a,t);if(n){return narrowTypeByDiscriminant(t,n,(e=>narrowTypeByLiteralExpression(e,i,o)))}return t}return narrowTypeByLiteralExpression(t,i,o)}function narrowTypeByLiteralExpression(e,t,n){return n?narrowTypeByTypeName(e,t.text):getAdjustedTypeWithFacts(e,ra.get(t.text)||32768)}function narrowTypeBySwitchOptionalChainContainment(e,{switchStatement:t,clauseStart:n,clauseEnd:r},i){const o=n!==r&&every(getSwitchClauseTypes(t).slice(n,r),i);return o?getTypeWithFacts(e,2097152):e}function narrowTypeBySwitchOnDiscriminant(e,{switchStatement:t,clauseStart:n,clauseEnd:r}){const i=getSwitchClauseTypes(t);if(!i.length){return e}const o=i.slice(n,r);const a=n===r||contains(o,et);if(e.flags&2&&!a){let t;for(let n=0;nareTypesComparable(s,e))),s);if(!a){return c}const l=filterType(e,(e=>!(isUnitLikeType(e)&&contains(i,e.flags&32768?Me:getRegularTypeOfLiteralType(extractUnitType(e))))));return c.flags&131072?l:getUnionType([c,l])}function narrowTypeByTypeName(e,t){switch(t){case"string":return narrowTypeByTypeFacts(e,ze,1);case"number":return narrowTypeByTypeFacts(e,Ve,2);case"bigint":return narrowTypeByTypeFacts(e,qe,4);case"boolean":return narrowTypeByTypeFacts(e,Xe,8);case"symbol":return narrowTypeByTypeFacts(e,Ye,16);case"object":return e.flags&1?e:getUnionType([narrowTypeByTypeFacts(e,it,32),narrowTypeByTypeFacts(e,We,131072)]);case"function":return e.flags&1?e:narrowTypeByTypeFacts(e,tn,64);case"undefined":return narrowTypeByTypeFacts(e,Me,65536)}return narrowTypeByTypeFacts(e,it,128)}function narrowTypeByTypeFacts(e,t,n){return mapType(e,(e=>isTypeRelatedTo(e,t,xi)?hasTypeFacts(e,n)?e:et:isTypeSubtypeOf(t,e)?t:hasTypeFacts(e,n)?getIntersectionType([e,t]):et))}function narrowTypeBySwitchOnTypeOf(e,{switchStatement:t,clauseStart:n,clauseEnd:r}){const i=getSwitchClauseTypeOfWitnesses(t);if(!i){return e}const o=findIndex(t.caseBlock.clauses,(e=>e.kind===297));const a=n===r||o>=n&&ogetTypeFacts(e,t)===t))}const s=i.slice(n,r);return getUnionType(map(s,(t=>t?narrowTypeByTypeName(e,t):et)))}function narrowTypeBySwitchOnTrue(e,{switchStatement:t,clauseStart:n,clauseEnd:r}){const i=findIndex(t.caseBlock.clauses,(e=>e.kind===297));const o=n===r||i>=n&&it.kind===296?narrowType(e,t.expression,true):et)))}function isMatchingConstructorReference(t){return(isPropertyAccessExpression(t)&&idText(t.name)==="constructor"||isElementAccessExpression(t)&&isStringLiteralLike(t.argumentExpression)&&t.argumentExpression.text==="constructor")&&isMatchingReference(e,t.expression)}function narrowTypeByConstructor(e,t,n,r){if(r?t!==35&&t!==37:t!==36&&t!==38){return e}const i=getTypeOfExpression(n);if(!isFunctionType(i)&&!isConstructorType(i)){return e}const o=getPropertyOfType(i,"prototype");if(!o){return e}const a=getTypeOfSymbol(o);const s=!isTypeAny(a)?a:void 0;if(!s||s===en||s===tn){return e}if(isTypeAny(e)){return s}return filterType(e,(e=>isConstructedBy(e,s)));function isConstructedBy(e,t){if(e.flags&524288&&getObjectFlags(e)&1||t.flags&524288&&getObjectFlags(t)&1){return e.symbol===t.symbol}return isTypeSubtypeOf(e,t)}}function narrowTypeByInstanceof(t,n,r){const i=getReferenceCandidate(n.left);if(!isMatchingReference(e,i)){if(r&&k&&optionalChainContainsReference(i,e)){return getAdjustedTypeWithFacts(t,2097152)}return t}const o=n.right;const a=getTypeOfExpression(o);if(!isTypeDerivedFrom(a,en)){return t}const s=getEffectsSignature(n);const c=s&&getTypePredicateOfSignature(s);if(c&&c.kind===1&&c.parameterIndex===0){return getNarrowedType(t,c.type,r,true)}if(!isTypeDerivedFrom(a,tn)){return t}const l=mapType(a,getInstanceType);if(isTypeAny(t)&&(l===en||l===tn)||!r&&!(l.flags&524288&&!isEmptyAnonymousObjectType(l))){return t}return getNarrowedType(t,l,r,true)}function getInstanceType(e){const t=getTypeOfPropertyOfType(e,"prototype");if(t&&!isTypeAny(t)){return t}const n=getSignaturesOfType(e,1);if(n.length){return getUnionType(map(n,(e=>getReturnTypeOfSignature(getErasedSignature(e)))))}return ht}function getNarrowedType(e,t,n,r){const i=e.flags&1048576?`N${getTypeId(e)},${getTypeId(t)},${(n?1:0)|(r?2:0)}`:void 0;return getCachedType(i)??setCachedType(i,getNarrowedTypeWorker(e,t,n,r))}function getNarrowedTypeWorker(e,t,n,r){if(!n){if(e===t){return et}if(r){return filterType(e,(e=>!isTypeDerivedFrom(e,t)))}e=e.flags&2?Ct:e;const n=getNarrowedType(e,t,true,false);return recombineUnknownType(filterType(e,(e=>!isTypeSubsetOf(e,n))))}if(e.flags&3){return t}if(e===t){return t}const i=r?isTypeDerivedFrom:isTypeSubtypeOf;const o=e.flags&1048576?getKeyPropertyName(e):void 0;const a=mapType(t,(t=>{const n=o&&getTypeOfPropertyOfType(t,o);const a=n&&getConstituentTypeForKeyType(e,n);const s=mapType(a||e,r?e=>isTypeDerivedFrom(e,t)?e:isTypeDerivedFrom(t,e)?t:et:e=>isTypeStrictSubtypeOf(e,t)?e:isTypeStrictSubtypeOf(t,e)?t:isTypeSubtypeOf(e,t)?e:isTypeSubtypeOf(t,e)?t:et);return s.flags&131072?mapType(e,(e=>maybeTypeOfKind(e,465829888)&&i(t,getBaseConstraintOfType(e)||Le)?getIntersectionType([e,t]):et)):s}));return!(a.flags&131072)?a:isTypeSubtypeOf(t,e)?t:isTypeAssignableTo(e,t)?e:isTypeAssignableTo(t,e)?t:getIntersectionType([e,t])}function narrowTypeByCallExpression(t,n,r){if(hasMatchingArgument(n,e)){const e=r||!isCallChain(n)?getEffectsSignature(n):void 0;const i=e&&getTypePredicateOfSignature(e);if(i&&(i.kind===0||i.kind===1)){return narrowTypeByTypePredicate(t,i,n,r)}}if(containsMissingType(t)&&isAccessExpression(e)&&isPropertyAccessExpression(n.expression)){const i=n.expression;if(isMatchingReference(e.expression,getReferenceCandidate(i.expression))&&isIdentifier(i.name)&&i.name.escapedText==="hasOwnProperty"&&n.arguments.length===1){const i=n.arguments[0];if(isStringLiteralLike(i)&&getAccessedPropertyName(e)===escapeLeadingUnderscores(i.text)){return getTypeWithFacts(t,r?524288:65536)}}}return t}function narrowTypeByTypePredicate(t,n,r,i){if(n.type&&!(isTypeAny(t)&&(n.type===en||n.type===tn))){const o=getTypePredicateArgument(n,r);if(o){if(isMatchingReference(e,o)){return getNarrowedType(t,n.type,i,false)}if(k&&optionalChainContainsReference(o,e)&&(i&&!hasTypeFacts(n.type,65536)||!i&&everyType(n.type,isNullableType))){t=getAdjustedTypeWithFacts(t,2097152)}const r=getDiscriminantPropertyAccess(o,t);if(r){return narrowTypeByDiscriminant(t,r,(e=>getNarrowedType(e,n.type,i,false)))}}}return t}function narrowType(t,n,r){if(isExpressionOfOptionalChainRoot(n)||isBinaryExpression(n.parent)&&(n.parent.operatorToken.kind===61||n.parent.operatorToken.kind===78)&&n.parent.left===n){return narrowTypeByOptionality(t,n,r)}switch(n.kind){case 80:if(!isMatchingReference(e,n)&&f<5){const i=getResolvedSymbol(n);if(isConstantVariable(i)){const n=i.valueDeclaration;if(n&&isVariableDeclaration(n)&&!n.type&&n.initializer&&isConstantReference(e)){f++;const e=narrowType(t,n.initializer,r);f--;return e}}}case 110:case 108:case 211:case 212:return narrowTypeByTruthiness(t,n,r);case 213:return narrowTypeByCallExpression(t,n,r);case 217:case 235:case 238:return narrowType(t,n.expression,r);case 226:return narrowTypeByBinaryExpression(t,n,r);case 224:if(n.operator===54){return narrowType(t,n.operand,!r)}break}return t}function narrowTypeByOptionality(t,n,r){if(isMatchingReference(e,n)){return getAdjustedTypeWithFacts(t,r?2097152:262144)}const i=getDiscriminantPropertyAccess(n,t);if(i){return narrowTypeByDiscriminant(t,i,(e=>getTypeWithFacts(e,r?2097152:262144)))}return t}}function getTypeOfSymbolAtLocation(e,t){e=getExportSymbolOfValueSymbolIfExported(e);if(t.kind===80||t.kind===81){if(isRightSideOfQualifiedNameOrPropertyAccess(t)){t=t.parent}if(isExpressionNode(t)&&(!isAssignmentTarget(t)||isWriteAccess(t))){const n=removeOptionalTypeMarker(isWriteAccess(t)&&t.kind===211?checkPropertyAccessExpression(t,void 0,true):getTypeOfExpression(t));if(getExportSymbolOfValueSymbolIfExported(getNodeLinks(t).resolvedSymbol)===e){return n}}}if(isDeclarationName(t)&&isSetAccessor(t.parent)&&getAnnotatedAccessorTypeNode(t.parent)){return getWriteTypeOfAccessors(t.parent.symbol)}return isRightSideOfAccessExpression(t)&&isWriteAccess(t.parent)?getWriteTypeOfSymbol(e):getNonMissingTypeOfSymbol(e)}function getControlFlowContainer(e){return findAncestor(e.parent,(e=>isFunctionLike(e)&&!getImmediatelyInvokedFunctionExpression(e)||e.kind===268||e.kind===307||e.kind===172))}function isSymbolAssignedDefinitely(e){if(e.lastAssignmentPos!==void 0){return e.lastAssignmentPos<0}return isSymbolAssigned(e)&&e.lastAssignmentPos!==void 0&&e.lastAssignmentPos<0}function isSymbolAssigned(e){return!isPastLastAssignment(e,void 0)}function isPastLastAssignment(e,t){const n=findAncestor(e.valueDeclaration,isFunctionOrSourceFile);if(!n){return false}const r=getNodeLinks(n);if(!(r.flags&131072)){r.flags|=131072;if(!hasParentWithAssignmentsMarked(n)){markNodeAssignments(n)}}return!e.lastAssignmentPos||t&&Math.abs(e.lastAssignmentPos)e.kind!==232&&isSomeSymbolAssignedWorker(e.name)))}function hasParentWithAssignmentsMarked(e){return!!findAncestor(e.parent,(e=>isFunctionOrSourceFile(e)&&!!(getNodeLinks(e).flags&131072)))}function isFunctionOrSourceFile(e){return isFunctionLikeDeclaration(e)||isSourceFile(e)}function markNodeAssignments(e){switch(e.kind){case 80:const t=getAssignmentTargetKind(e);if(t!==0){const n=getResolvedSymbol(e);const r=t===1||n.lastAssignmentPos!==void 0&&n.lastAssignmentPos<0;if(isParameterOrMutableLocalVariable(n)){if(n.lastAssignmentPos===void 0||Math.abs(n.lastAssignmentPos)!==Number.MAX_VALUE){const t=findAncestor(e,isFunctionOrSourceFile);const r=findAncestor(n.valueDeclaration,isFunctionOrSourceFile);n.lastAssignmentPos=t===r?extendAssignmentPosition(e,n.valueDeclaration):Number.MAX_VALUE}if(r&&n.lastAssignmentPos>0){n.lastAssignmentPos*=-1}}}return;case 281:const n=e.parent.parent;const r=e.propertyName||e.name;if(!e.isTypeOnly&&!n.isTypeOnly&&!n.moduleSpecifier&&r.kind!==11){const e=resolveEntityName(r,111551,true,true);if(e&&isParameterOrMutableLocalVariable(e)){const t=e.lastAssignmentPos!==void 0&&e.lastAssignmentPos<0?-1:1;e.lastAssignmentPos=t*Number.MAX_VALUE}}return;case 264:case 265:case 266:return}if(isTypeNode(e)){return}forEachChild(e,markNodeAssignments)}function extendAssignmentPosition(e,t){let n=e.pos;while(e&&e.pos>t.pos){switch(e.kind){case 243:case 244:case 245:case 246:case 247:case 248:case 249:case 250:case 254:case 255:case 258:case 263:n=e.end}e=e.parent}return n}function isConstantVariable(e){return e.flags&3&&(getDeclarationNodeFlagsFromSymbol(e)&6)!==0}function isParameterOrMutableLocalVariable(e){const t=e.valueDeclaration&&getRootDeclaration(e.valueDeclaration);return!!t&&(isParameter(t)||isVariableDeclaration(t)&&(isCatchClause(t.parent)||isMutableLocalVariableDeclaration(t)))}function isMutableLocalVariableDeclaration(e){return!!(e.parent.flags&1)&&!(getCombinedModifierFlags(e)&32||e.parent.parent.kind===243&&isGlobalSourceFile(e.parent.parent.parent))}function parameterInitializerContainsUndefined(e){const t=getNodeLinks(e);if(t.parameterInitializerContainsUndefined===void 0){if(!pushTypeResolution(e,8)){reportCircularityError(e.symbol);return true}const n=!!hasTypeFacts(checkDeclarationInitializer(e,0),16777216);if(!popTypeResolution()){reportCircularityError(e.symbol);return true}t.parameterInitializerContainsUndefined??(t.parameterInitializerContainsUndefined=n)}return t.parameterInitializerContainsUndefined}function removeOptionalityFromDeclaredType(e,t){const n=k&&t.kind===169&&t.initializer&&hasTypeFacts(e,16777216)&&!parameterInitializerContainsUndefined(t);return n?getTypeWithFacts(e,524288):e}function isConstraintPosition(e,t){const n=t.parent;return n.kind===211||n.kind===166||n.kind===213&&n.expression===t||n.kind===214&&n.expression===t||n.kind===212&&n.expression===t&&!(someType(e,isGenericTypeWithoutNullableConstraint)&&isGenericIndexType(getTypeOfExpression(n.argumentExpression)))}function isGenericTypeWithUnionConstraint(e){return e.flags&2097152?some(e.types,isGenericTypeWithUnionConstraint):!!(e.flags&465829888&&getBaseConstraintOrType(e).flags&(98304|1048576))}function isGenericTypeWithoutNullableConstraint(e){return e.flags&2097152?some(e.types,isGenericTypeWithoutNullableConstraint):!!(e.flags&465829888&&!maybeTypeOfKind(getBaseConstraintOrType(e),98304))}function hasContextualTypeWithNoGenericTypes(e,t){const n=(isIdentifier(e)||isPropertyAccessExpression(e)||isElementAccessExpression(e))&&!((isJsxOpeningElement(e.parent)||isJsxSelfClosingElement(e.parent))&&e.parent.tagName===e)&&(t&&t&32?getContextualType2(e,8):getContextualType2(e,void 0));return n&&!isGenericType(n)}function getNarrowableTypeForReference(e,t,n){if(isNoInferType(e)){e=e.baseType}const r=!(n&&n&2)&&someType(e,isGenericTypeWithUnionConstraint)&&(isConstraintPosition(e,t)||hasContextualTypeWithNoGenericTypes(t,n));return r?mapType(e,getBaseConstraintOrType):e}function isExportOrExportExpression(e){return!!findAncestor(e,(e=>{const t=e.parent;if(t===void 0){return"quit"}if(isExportAssignment(t)){return t.expression===e&&isEntityNameExpression(e)}if(isExportSpecifier(t)){return t.name===e||t.propertyName===e}return false}))}function markLinkedReferences(e,t,n,r){if(!$){return}if(e.flags&33554432&&!isPropertySignature(e)&&!isPropertyDeclaration(e)){return}switch(t){case 1:return markIdentifierAliasReferenced(e);case 2:return markPropertyAliasReferenced(e,n,r);case 3:return markExportAssignmentAliasReferenced(e);case 4:return markJsxAliasReferenced(e);case 5:return markAsyncFunctionAliasReferenced(e);case 6:return markImportEqualsAliasReferenced(e);case 7:return markExportSpecifierAliasReferenced(e);case 8:return markDecoratorAliasReferenced(e);case 0:{if(isIdentifier(e)&&(isExpressionNode(e)||isShorthandPropertyAssignment(e.parent)||isImportEqualsDeclaration(e.parent)&&e.parent.moduleReference===e)&&shouldMarkIdentifierAliasReferenced(e)){if(isPropertyAccessOrQualifiedName(e.parent)){const t=isPropertyAccessExpression(e.parent)?e.parent.expression:e.parent.left;if(t!==e)return}markIdentifierAliasReferenced(e);return}if(isPropertyAccessOrQualifiedName(e)){let t=e;while(isPropertyAccessOrQualifiedName(t)){if(isPartOfTypeNode(t))return;t=t.parent}return markPropertyAliasReferenced(e)}if(isExportAssignment(e)){return markExportAssignmentAliasReferenced(e)}if(isJsxOpeningLikeElement(e)||isJsxOpeningFragment(e)){return markJsxAliasReferenced(e)}if(isImportEqualsDeclaration(e)){if(isInternalModuleImportEqualsDeclaration(e)||checkExternalImportOrExportDeclaration(e)){return markImportEqualsAliasReferenced(e)}return}if(isExportSpecifier(e)){return markExportSpecifierAliasReferenced(e)}if(isFunctionLikeDeclaration(e)||isMethodSignature(e)){markAsyncFunctionAliasReferenced(e)}if(!T.emitDecoratorMetadata){return}if(!canHaveDecorators(e)||!hasDecorators(e)||!e.modifiers||!nodeCanBeDecorated(b,e,e.parent,e.parent.parent)){return}return markDecoratorAliasReferenced(e)}default:S.assertNever(t,`Unhandled reference hint: ${t}`)}}function markIdentifierAliasReferenced(e){const t=getResolvedSymbol(e);if(t&&t!==q&&t!==xe&&!isThisInTypeQuery(e)){markAliasReferenced(t,e)}}function markPropertyAliasReferenced(e,t,n){const r=isPropertyAccessExpression(e)?e.expression:e.left;if(isThisIdentifier(r)||!isIdentifier(r)){return}const i=getResolvedSymbol(r);if(!i||i===xe){return}if(Gn(T)||er(T)&&isExportOrExportExpression(e)){markAliasReferenced(i,e);return}const o=n||checkExpressionCached(r);if(isTypeAny(o)||o===tt){markAliasReferenced(i,e);return}let a=t;if(!a&&!n){const t=isPropertyAccessExpression(e)?e.name:e.right;const n=isPrivateIdentifier(t)&&lookupSymbolForPrivateIdentifierDeclaration(t.escapedText,t);const r=getAssignmentTargetKind(e);const i=getApparentType(r!==0||isMethodAccessForCall(e)?getWidenedType(o):o);a=isPrivateIdentifier(t)?n&&getPrivateIdentifierPropertyOfType(i,n)||void 0:getPropertyOfType(i,t.escapedText)}if(!(a&&(isConstEnumOrConstEnumOnlyModule(a)||a.flags&8&&e.parent.kind===306))){markAliasReferenced(i,e)}return}function markExportAssignmentAliasReferenced(e){if(isIdentifier(e.expression)){const t=e.expression;const n=getExportSymbolOfValueSymbolIfExported(resolveEntityName(t,-1,true,true,e));if(n){markAliasReferenced(n,t)}}}function markJsxAliasReferenced(e){if(!getJsxNamespaceContainerForImplicitImport(e)){const t=gi&&T.jsx===2?wt.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found:void 0;const n=getJsxNamespace(e);const r=isJsxOpeningLikeElement(e)?e.tagName:e;const i=T.jsx!==1&&T.jsx!==3;let o;if(!(isJsxOpeningFragment(e)&&n==="null")){o=te(r,n,i?111551:111551&~384,t,true)}if(o){o.isReferenced=-1;if($&&o.flags&2097152&&!getTypeOnlyAliasDeclaration(o)){markAliasSymbolAsReferenced(o)}}if(isJsxOpeningFragment(e)){const n=getSourceFileOfNode(e);const o=getJsxFactoryEntity(n);if(o){const e=getFirstIdentifier(o).escapedText;te(r,e,i?111551:111551&~384,t,true)}}}return}function markAsyncFunctionAliasReferenced(e){if(v<2){if(getFunctionFlags(e)&2){const t=getEffectiveReturnTypeNode(e);markTypeNodeAsReferenced(t)}}}function markImportEqualsAliasReferenced(e){if(hasSyntacticModifier(e,32)){markExportAsReferenced(e)}}function markExportSpecifierAliasReferenced(e){if(!e.parent.parent.moduleSpecifier&&!e.isTypeOnly&&!e.parent.parent.isTypeOnly){const t=e.propertyName||e.name;if(t.kind===11){return}const n=te(t,t.escapedText,111551|788968|1920|2097152,void 0,true);if(n&&(n===z||n===V||n.declarations&&isGlobalSourceFile(getDeclarationContainer(n.declarations[0])))){}else{const r=n&&(n.flags&2097152?resolveAlias(n):n);if(!r||getSymbolFlags(r)&111551){markExportAsReferenced(e);markIdentifierAliasReferenced(t)}}return}}function markDecoratorAliasReferenced(e){if(T.emitDecoratorMetadata){const t=find(e.modifiers,isDecorator);if(!t){return}checkExternalEmitHelpers(t,16);switch(e.kind){case 263:const t=getFirstConstructorWithBody(e);if(t){for(const e of t.parameters){markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(e))}}break;case 177:case 178:const n=e.kind===177?178:177;const r=getDeclarationOfKind(getSymbolOfDeclaration(e),n);markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(e)||r&&getAnnotatedAccessorTypeNode(r));break;case 174:for(const t of e.parameters){markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(t))}markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(e));break;case 172:markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(e));break;case 169:markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(e));const i=e.parent;for(const e of i.parameters){markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(e))}markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(i));break}}}function markAliasReferenced(e,t){if(!$){return}if(isNonLocalAlias(e,111551)&&!isInTypeQuery(t)){const n=resolveAlias(e);if(getSymbolFlags(e,true)&(111551|1048576)){if(Gn(T)||er(T)&&isExportOrExportExpression(t)||!isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(n))){markAliasSymbolAsReferenced(e)}}}}function markAliasSymbolAsReferenced(e){S.assert($);const t=getSymbolLinks(e);if(!t.referenced){t.referenced=true;const n=getDeclarationOfAliasSymbol(e);if(!n)return S.fail();if(isInternalModuleImportEqualsDeclaration(n)){if(getSymbolFlags(resolveSymbol(e))&111551){const e=getFirstIdentifier(n.moduleReference);markIdentifierAliasReferenced(e)}}}}function markExportAsReferenced(e){const t=getSymbolOfDeclaration(e);const n=resolveAlias(t);if(n){const e=n===xe||getSymbolFlags(t,true)&111551&&!isConstEnumOrConstEnumOnlyModule(n);if(e){markAliasSymbolAsReferenced(t)}}}function markEntityNameOrEntityExpressionAsReference(e,t){if(!e)return;const n=getFirstIdentifier(e);const r=(e.kind===80?788968:1920)|2097152;const i=te(n,n.escapedText,r,void 0,true);if(i&&i.flags&2097152){if($&&symbolIsValue(i)&&!isConstEnumOrConstEnumOnlyModule(resolveAlias(i))&&!getTypeOnlyAliasDeclaration(i)){markAliasSymbolAsReferenced(i)}else if(t&&Gn(T)&&Vn(T)>=5&&!symbolIsValue(i)&&!some(i.declarations,isTypeOnlyImportOrExportDeclaration)){const t=error2(e,wt.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled);const r=find(i.declarations||d,isAliasSymbolDeclaration);if(r){addRelatedInfo(t,createDiagnosticForNode(r,wt._0_was_imported_here,idText(n)))}}}}function markTypeNodeAsReferenced(e){markEntityNameOrEntityExpressionAsReference(e&&getEntityNameFromTypeNode(e),false)}function markDecoratorMedataDataTypeNodeAsReferenced(e){const t=getEntityNameForDecoratorMetadata(e);if(t&&isEntityName(t)){markEntityNameOrEntityExpressionAsReference(t,true)}}function getNarrowedTypeOfSymbol(e,t){var n;const r=getTypeOfSymbol(e);const i=e.valueDeclaration;if(i){if(isBindingElement(i)&&!i.initializer&&!i.dotDotDotToken&&i.parent.elements.length>=2){const e=i.parent.parent;const n=getRootDeclaration(e);if(n.kind===260&&getCombinedNodeFlagsCached(n)&6||n.kind===169){const r=getNodeLinks(e);if(!(r.flags&4194304)){r.flags|=4194304;const o=getTypeForBindingElementParent(e,0);const a=o&&mapType(o,getBaseConstraintOrType);r.flags&=~4194304;if(a&&a.flags&1048576&&!(n.kind===169&&isSomeSymbolAssigned(n))){const e=i.parent;const n=getFlowTypeOfReference(e,a,a,void 0,t.flowNode);if(n.flags&131072){return et}return getBindingElementTypeFromParentType(i,n,true)}}}}if(isParameter(i)&&!i.type&&!i.initializer&&!i.dotDotDotToken){const e=i.parent;if(e.parameters.length>=2&&isContextSensitiveFunctionOrObjectLiteralMethod(e)){const r=getContextualSignature(e);if(r&&r.parameters.length===1&&signatureHasRestParameter(r)){const o=getReducedApparentType(instantiateType(getTypeOfSymbol(r.parameters[0]),(n=getInferenceContext(e))==null?void 0:n.nonFixingMapper));if(o.flags&1048576&&everyType(o,isTupleType)&&!some(e.parameters,isSomeSymbolAssigned)){const n=getFlowTypeOfReference(e,o,o,void 0,t.flowNode);const r=e.parameters.indexOf(i)-(getThisParameter(e)?1:0);return getIndexedAccessType(n,getNumberLiteralType(r))}}}}}return r}function checkIdentifierCalculateNodeCheckFlags(e,t){if(isThisInTypeQuery(e))return;if(t===q){if(isInPropertyInitializerOrClassStaticBlock(e)){error2(e,wt.arguments_cannot_be_referenced_in_property_initializers);return}let t=getContainingFunction(e);if(t){if(v<2){if(t.kind===219){error2(e,wt.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression)}else if(hasSyntacticModifier(t,1024)){error2(e,wt.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method)}}getNodeLinks(t).flags|=512;while(t&&isArrowFunction(t)){t=getContainingFunction(t);if(t){getNodeLinks(t).flags|=512}}}return}const n=getExportSymbolOfValueSymbolIfExported(t);const r=resolveAliasWithDeprecationCheck(n,e);if(isDeprecatedSymbol(r)&&isUncalledFunctionReference(e,r)&&r.declarations){addDeprecatedSuggestion(e,r.declarations,e.escapedText)}const i=n.valueDeclaration;if(i&&n.flags&32){if(isClassLike(i)&&i.name!==e){let t=getThisContainer(e,false,false);while(t.kind!==307&&t.parent!==i){t=getThisContainer(t,false,false)}if(t.kind!==307){getNodeLinks(i).flags|=262144;getNodeLinks(t).flags|=262144;getNodeLinks(e).flags|=536870912}}}checkNestedBlockScopedBinding(e,t)}function checkIdentifier(e,t){if(isThisInTypeQuery(e)){return checkThisExpression(e)}const n=getResolvedSymbol(e);if(n===xe){return Ie}checkIdentifierCalculateNodeCheckFlags(e,n);if(n===q){if(isInPropertyInitializerOrClassStaticBlock(e)){return Ie}return getTypeOfSymbol(n)}if(shouldMarkIdentifierAliasReferenced(e)){markLinkedReferences(e,1)}const r=getExportSymbolOfValueSymbolIfExported(n);let i=r.valueDeclaration;const o=i;if(i&&i.kind===208&&contains(Lr,i.parent)&&findAncestor(e,(e=>e===i.parent))){return Oe}let a=getNarrowedTypeOfSymbol(r,e);const s=getAssignmentTargetKind(e);if(s){if(!(r.flags&3)&&!(isInJSFile(e)&&r.flags&512)){const t=r.flags&384?wt.Cannot_assign_to_0_because_it_is_an_enum:r.flags&32?wt.Cannot_assign_to_0_because_it_is_a_class:r.flags&1536?wt.Cannot_assign_to_0_because_it_is_a_namespace:r.flags&16?wt.Cannot_assign_to_0_because_it_is_a_function:r.flags&2097152?wt.Cannot_assign_to_0_because_it_is_an_import:wt.Cannot_assign_to_0_because_it_is_not_a_variable;error2(e,t,symbolToString(n));return Ie}if(isReadonlySymbol(r)){if(r.flags&3){error2(e,wt.Cannot_assign_to_0_because_it_is_a_constant,symbolToString(n))}else{error2(e,wt.Cannot_assign_to_0_because_it_is_a_read_only_property,symbolToString(n))}return Ie}}const c=r.flags&2097152;if(r.flags&3){if(s===1){return isInCompoundLikeAssignment(e)?getBaseTypeOfLiteralType(a):a}}else if(c){i=getDeclarationOfAliasSymbol(n)}else{return a}if(!i){return a}a=getNarrowableTypeForReference(a,e,t);const l=getRootDeclaration(i).kind===169;const d=getControlFlowContainer(i);let p=getControlFlowContainer(e);const u=p!==d;const f=e.parent&&e.parent.parent&&isSpreadAssignment(e.parent)&&isDestructuringAssignmentTarget(e.parent.parent);const m=n.flags&134217728;const _=a===Fe||a===hn;const g=_&&e.parent.kind===235;while(p!==d&&(p.kind===218||p.kind===219||isObjectLiteralOrClassExpressionMethodOrAccessor(p))&&(isConstantVariable(r)&&a!==hn||isParameterOrMutableLocalVariable(r)&&isPastLastAssignment(r,e))){p=getControlFlowContainer(p)}const y=o&&isVariableDeclaration(o)&&!o.initializer&&!o.exclamationToken&&isMutableLocalVariableDeclaration(o)&&!isSymbolAssignedDefinitely(n);const h=l||c||u&&!y||f||m||isSameScopedBindingElement(e,i)||a!==Fe&&a!==hn&&(!k||(a.flags&(3|16384))!==0||isInTypeQuery(e)||isInAmbientOrTypeNode(e)||e.parent.kind===281)||e.parent.kind===235||i.kind===260&&i.exclamationToken||i.flags&33554432;const T=g?Me:h?l?removeOptionalityFromDeclaredType(a,i):a:_?Me:getOptionalType(a);const S=g?getNonNullableType(getFlowTypeOfReference(e,a,T,p)):getFlowTypeOfReference(e,a,T,p);if(!isEvolvingArrayOperationTarget(e)&&(a===Fe||a===hn)){if(S===Fe||S===hn){if(A){error2(getNameOfDeclaration(i),wt.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined,symbolToString(n),typeToString(S));error2(e,wt.Variable_0_implicitly_has_an_1_type,symbolToString(n),typeToString(S))}return convertAutoToAny(S)}}else if(!h&&!containsUndefinedType(a)&&containsUndefinedType(S)){error2(e,wt.Variable_0_is_used_before_being_assigned,symbolToString(n));return a}return s?getBaseTypeOfLiteralType(S):S}function isSameScopedBindingElement(e,t){if(isBindingElement(t)){const n=findAncestor(e,isBindingElement);return n&&getRootDeclaration(n)===getRootDeclaration(t)}}function shouldMarkIdentifierAliasReferenced(e){var t;const n=e.parent;if(n){if(isPropertyAccessExpression(n)&&n.expression===e){return false}if(isExportSpecifier(n)&&n.isTypeOnly){return false}const r=(t=n.parent)==null?void 0:t.parent;if(r&&isExportDeclaration(r)&&r.isTypeOnly){return false}}return true}function isInsideFunctionOrInstancePropertyInitializer(e,t){return!!findAncestor(e,(e=>e===t?"quit":isFunctionLike(e)||e.parent&&isPropertyDeclaration(e.parent)&&!hasStaticModifier(e.parent)&&e.parent.initializer===e))}function getPartOfForStatementContainingNode(e,t){return findAncestor(e,(e=>e===t?"quit":e===t.initializer||e===t.condition||e===t.incrementor||e===t.statement))}function getEnclosingIterationStatement(e){return findAncestor(e,(e=>!e||nodeStartsNewLexicalEnvironment(e)?"quit":isIterationStatement(e,false)))}function checkNestedBlockScopedBinding(e,t){if(v>=2||(t.flags&(2|32))===0||!t.valueDeclaration||isSourceFile(t.valueDeclaration)||t.valueDeclaration.parent.kind===299){return}const n=getEnclosingBlockScopeContainer(t.valueDeclaration);const r=isInsideFunctionOrInstancePropertyInitializer(e,n);const i=getEnclosingIterationStatement(n);if(i){if(r){let r=true;if(isForStatement(n)){const i=getAncestor(t.valueDeclaration,261);if(i&&i.parent===n){const i=getPartOfForStatementContainingNode(e.parent,n);if(i){const e=getNodeLinks(i);e.flags|=8192;const o=e.capturedBlockScopeBindings||(e.capturedBlockScopeBindings=[]);pushIfUnique(o,t);if(i===n.initializer){r=false}}}}if(r){getNodeLinks(i).flags|=4096}}if(isForStatement(n)){const r=getAncestor(t.valueDeclaration,261);if(r&&r.parent===n&&isAssignedInBodyOfForStatement(e,n)){getNodeLinks(t.valueDeclaration).flags|=65536}}getNodeLinks(t.valueDeclaration).flags|=32768}if(r){getNodeLinks(t.valueDeclaration).flags|=16384}}function isBindingCapturedByNode(e,t){const n=getNodeLinks(e);return!!n&&contains(n.capturedBlockScopeBindings,getSymbolOfDeclaration(t))}function isAssignedInBodyOfForStatement(e,t){let n=e;while(n.parent.kind===217){n=n.parent}let r=false;if(isAssignmentTarget(n)){r=true}else if(n.parent.kind===224||n.parent.kind===225){const e=n.parent;r=e.operator===46||e.operator===47}if(!r){return false}return!!findAncestor(n,(e=>e===t?"quit":e===t.statement))}function captureLexicalThis(e,t){getNodeLinks(e).flags|=2;if(t.kind===172||t.kind===176){const e=t.parent;getNodeLinks(e).flags|=4}else{getNodeLinks(t).flags|=4}}function findFirstSuperCall(e){return isSuperCall(e)?e:isFunctionLike(e)?void 0:forEachChild(e,findFirstSuperCall)}function classDeclarationExtendsNull(e){const t=getSymbolOfDeclaration(e);const n=getDeclaredTypeOfSymbol(t);const r=getBaseConstructorTypeOfClass(n);return r===Ue}function checkThisBeforeSuper(e,t,n){const r=t.parent;const i=getClassExtendsHeritageElement(r);if(i&&!classDeclarationExtendsNull(r)){if(canHaveFlowNode(e)&&e.flowNode&&!isPostSuperFlowNode(e.flowNode,false)){error2(e,n)}}}function checkThisInStaticClassFieldInitializerInDecoratedClass(e,t){if(isPropertyDeclaration(t)&&hasStaticModifier(t)&&b&&t.initializer&&textRangeContainsPositionInclusive(t.initializer,e.pos)&&hasDecorators(t.parent)){error2(e,wt.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class)}}function checkThisExpression(e){const t=isInTypeQuery(e);let n=getThisContainer(e,true,true);let r=false;let i=false;if(n.kind===176){checkThisBeforeSuper(e,n,wt.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class)}while(true){if(n.kind===219){n=getThisContainer(n,false,!i);r=true}if(n.kind===167){n=getThisContainer(n,!r,false);i=true;continue}break}checkThisInStaticClassFieldInitializerInDecoratedClass(e,n);if(i){error2(e,wt.this_cannot_be_referenced_in_a_computed_property_name)}else{switch(n.kind){case 267:error2(e,wt.this_cannot_be_referenced_in_a_module_or_namespace_body);break;case 266:error2(e,wt.this_cannot_be_referenced_in_current_location);break}}if(!t&&r&&v<2){captureLexicalThis(e,n)}const o=tryGetThisTypeAt(e,true,n);if(O){const t=getTypeOfSymbol(V);if(o===t&&r){error2(e,wt.The_containing_arrow_function_captures_the_global_value_of_this)}else if(!o){const r=error2(e,wt.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);if(!isSourceFile(n)){const e=tryGetThisTypeAt(n);if(e&&e!==t){addRelatedInfo(r,createDiagnosticForNode(n,wt.An_outer_value_of_this_is_shadowed_by_this_container))}}}}return o||ke}function tryGetThisTypeAt(e,t=true,n=getThisContainer(e,false,false)){const r=isInJSFile(e);if(isFunctionLike(n)&&(!isInParameterInitializerBeforeContainingFunction(e)||getThisParameter(n))){let t=getThisTypeOfDeclaration(n)||r&&getTypeForThisExpressionFromJSDoc(n);if(!t){const e=getClassNameFromPrototypeMethod(n);if(r&&e){const n=checkExpression(e).symbol;if(n&&n.members&&n.flags&16){t=getDeclaredTypeOfSymbol(n).thisType}}else if(isJSConstructor(n)){t=getDeclaredTypeOfSymbol(getMergedSymbol(n.symbol)).thisType}t||(t=getContextualThisParameterType(n))}if(t){return getFlowTypeOfReference(e,t)}}if(isClassLike(n.parent)){const t=getSymbolOfDeclaration(n.parent);const r=isStatic(n)?getTypeOfSymbol(t):getDeclaredTypeOfSymbol(t).thisType;return getFlowTypeOfReference(e,r)}if(isSourceFile(n)){if(n.commonJsModuleIndicator){const e=getSymbolOfDeclaration(n);return e&&getTypeOfSymbol(e)}else if(n.externalModuleIndicator){return Me}else if(t){return getTypeOfSymbol(V)}}}function getExplicitThisType(e){const t=getThisContainer(e,false,false);if(isFunctionLike(t)){const e=getSignatureFromDeclaration(t);if(e.thisParameter){return getExplicitTypeOfSymbol(e.thisParameter)}}if(isClassLike(t.parent)){const e=getSymbolOfDeclaration(t.parent);return isStatic(t)?getTypeOfSymbol(e):getDeclaredTypeOfSymbol(e).thisType}}function getClassNameFromPrototypeMethod(e){if(e.kind===218&&isBinaryExpression(e.parent)&&getAssignmentDeclarationKind(e.parent)===3){return e.parent.left.expression.expression}else if(e.kind===174&&e.parent.kind===210&&isBinaryExpression(e.parent.parent)&&getAssignmentDeclarationKind(e.parent.parent)===6){return e.parent.parent.left.expression}else if(e.kind===218&&e.parent.kind===303&&e.parent.parent.kind===210&&isBinaryExpression(e.parent.parent.parent)&&getAssignmentDeclarationKind(e.parent.parent.parent)===6){return e.parent.parent.parent.left.expression}else if(e.kind===218&&isPropertyAssignment(e.parent)&&isIdentifier(e.parent.name)&&(e.parent.name.escapedText==="value"||e.parent.name.escapedText==="get"||e.parent.name.escapedText==="set")&&isObjectLiteralExpression(e.parent.parent)&&isCallExpression(e.parent.parent.parent)&&e.parent.parent.parent.arguments[2]===e.parent.parent&&getAssignmentDeclarationKind(e.parent.parent.parent)===9){return e.parent.parent.parent.arguments[0].expression}else if(isMethodDeclaration(e)&&isIdentifier(e.name)&&(e.name.escapedText==="value"||e.name.escapedText==="get"||e.name.escapedText==="set")&&isObjectLiteralExpression(e.parent)&&isCallExpression(e.parent.parent)&&e.parent.parent.arguments[2]===e.parent&&getAssignmentDeclarationKind(e.parent.parent)===9){return e.parent.parent.arguments[0].expression}}function getTypeForThisExpressionFromJSDoc(e){const t=getJSDocThisTag(e);if(t&&t.typeExpression){return getTypeFromTypeNode(t.typeExpression)}const n=getSignatureOfTypeTag(e);if(n){return getThisTypeOfSignature(n)}}function isInConstructorArgumentInitializer(e,t){return!!findAncestor(e,(e=>isFunctionLikeDeclaration(e)?"quit":e.kind===169&&e.parent===t))}function checkSuperExpression(e){const t=e.parent.kind===213&&e.parent.expression===e;const n=getSuperContainer(e,true);let r=n;let i=false;let o=false;if(!t){while(r&&r.kind===219){if(hasSyntacticModifier(r,1024))o=true;r=getSuperContainer(r,true);i=v<2}if(r&&hasSyntacticModifier(r,1024))o=true}let a=0;if(!r||!isLegalUsageOfSuperExpression(r)){const n=findAncestor(e,(e=>e===r?"quit":e.kind===167));if(n&&n.kind===167){error2(e,wt.super_cannot_be_referenced_in_a_computed_property_name)}else if(t){error2(e,wt.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors)}else if(!r||!r.parent||!(isClassLike(r.parent)||r.parent.kind===210)){error2(e,wt.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions)}else{error2(e,wt.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class)}return Ie}if(!t&&n.kind===176){checkThisBeforeSuper(e,r,wt.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class)}if(isStatic(r)||t){a=32;if(!t&&v>=2&&v<=8&&(isPropertyDeclaration(r)||isClassStaticBlockDeclaration(r))){forEachEnclosingBlockScopeContainer(e.parent,(e=>{if(!isSourceFile(e)||isExternalOrCommonJsModule(e)){getNodeLinks(e).flags|=2097152}}))}}else{a=16}getNodeLinks(e).flags|=a;if(r.kind===174&&o){if(isSuperProperty(e.parent)&&isAssignmentTarget(e.parent)){getNodeLinks(r).flags|=256}else{getNodeLinks(r).flags|=128}}if(i){captureLexicalThis(e.parent,r)}if(r.parent.kind===210){if(v<2){error2(e,wt.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);return Ie}else{return ke}}const s=r.parent;if(!getClassExtendsHeritageElement(s)){error2(e,wt.super_can_only_be_referenced_in_a_derived_class);return Ie}if(classDeclarationExtendsNull(s)){return t?Ie:Ue}const c=getDeclaredTypeOfSymbol(getSymbolOfDeclaration(s));const l=c&&getBaseTypes(c)[0];if(!l){return Ie}if(r.kind===176&&isInConstructorArgumentInitializer(e,r)){error2(e,wt.super_cannot_be_referenced_in_constructor_arguments);return Ie}return a===32?getBaseConstructorTypeOfClass(c):getTypeWithThisArgument(l,c.thisType);function isLegalUsageOfSuperExpression(e){if(t){return e.kind===176}else{if(isClassLike(e.parent)||e.parent.kind===210){if(isStatic(e)){return e.kind===174||e.kind===173||e.kind===177||e.kind===178||e.kind===172||e.kind===175}else{return e.kind===174||e.kind===173||e.kind===177||e.kind===178||e.kind===172||e.kind===171||e.kind===176}}}return false}}function getContainingObjectLiteral(e){return(e.kind===174||e.kind===177||e.kind===178)&&e.parent.kind===210?e.parent:e.kind===218&&e.parent.kind===303?e.parent.parent:void 0}function getThisTypeArgument(e){return getObjectFlags(e)&4&&e.target===gn?getTypeArguments(e)[0]:void 0}function getThisTypeFromContextualType(e){return mapType(e,(e=>e.flags&2097152?forEach(e.types,getThisTypeArgument):getThisTypeArgument(e)))}function getThisTypeOfObjectLiteralFromContextualType(e,t){let n=e;let r=t;while(r){const e=getThisTypeFromContextualType(r);if(e){return e}if(n.parent.kind!==303){break}n=n.parent.parent;r=getApparentTypeOfContextualType(n,void 0)}}function getContextualThisParameterType(e){if(e.kind===219){return void 0}if(isContextSensitiveFunctionOrObjectLiteralMethod(e)){const t=getContextualSignature(e);if(t){const e=t.thisParameter;if(e){return getTypeOfSymbol(e)}}}const t=isInJSFile(e);if(O||t){const n=getContainingObjectLiteral(e);if(n){const e=getApparentTypeOfContextualType(n,void 0);const t=getThisTypeOfObjectLiteralFromContextualType(n,e);if(t){return instantiateType(t,getMapperFromContext(getInferenceContext(n)))}return getWidenedType(e?getNonNullableType(e):checkExpressionCached(n))}const r=walkUpParenthesizedExpressions(e.parent);if(isAssignmentExpression(r)){const e=r.left;if(isAccessExpression(e)){const{expression:n}=e;if(t&&isIdentifier(n)){const e=getSourceFileOfNode(r);if(e.commonJsModuleIndicator&&getResolvedSymbol(n)===e.symbol){return void 0}}return getWidenedType(checkExpressionCached(n))}}}return void 0}function getContextuallyTypedParameterType(e){const t=e.parent;if(!isContextSensitiveFunctionOrObjectLiteralMethod(t)){return void 0}const n=getImmediatelyInvokedFunctionExpression(t);if(n&&n.arguments){const r=getEffectiveCallArguments(n);const i=t.parameters.indexOf(e);if(e.dotDotDotToken){return getSpreadArgumentType(r,i,r.length,ke,void 0,0)}const o=getNodeLinks(n);const a=o.resolvedSignature;o.resolvedSignature=Rt;const s=i0){return getTypeFromBindingPattern(n.name,true,false)}}return void 0}function getContextualTypeForReturnExpression(e,t){const n=getContainingFunction(e);if(n){let e=getContextualReturnType(n,t);if(e){const t=getFunctionFlags(n);if(t&1){const n=(t&2)!==0;if(e.flags&1048576){e=filterType(e,(e=>!!getIterationTypeOfGeneratorFunctionReturnType(1,e,n)))}const r=getIterationTypeOfGeneratorFunctionReturnType(1,e,(t&2)!==0);if(!r){return void 0}e=r}if(t&2){const t=mapType(e,getAwaitedTypeNoAlias);return t&&getUnionType([t,createPromiseLikeType(t)])}return e}}return void 0}function getContextualTypeForAwaitOperand(e,t){const n=getContextualType2(e,t);if(n){const e=getAwaitedTypeNoAlias(n);return e&&getUnionType([e,createPromiseLikeType(e)])}return void 0}function getContextualTypeForYieldOperand(e,t){const n=getContainingFunction(e);if(n){const r=getFunctionFlags(n);let i=getContextualReturnType(n,t);if(i){const n=(r&2)!==0;if(!e.asteriskToken&&i.flags&1048576){i=filterType(i,(e=>!!getIterationTypeOfGeneratorFunctionReturnType(1,e,n)))}if(e.asteriskToken){const r=getIterationTypesOfGeneratorFunctionReturnType(i,n);const o=(r==null?void 0:r.yieldType)??tt;const a=getContextualType2(e,t)??tt;const s=(r==null?void 0:r.nextType)??Le;const c=createGeneratorType(o,a,s,false);if(n){const e=createGeneratorType(o,a,s,true);return getUnionType([c,e])}return c}return getIterationTypeOfGeneratorFunctionReturnType(0,i,n)}}return void 0}function isInParameterInitializerBeforeContainingFunction(e){let t=false;while(e.parent&&!isFunctionLike(e.parent)){if(isParameter(e.parent)&&(t||e.parent.initializer===e)){return true}if(isBindingElement(e.parent)&&e.parent.initializer===e){t=true}e=e.parent}return false}function getContextualIterationType(e,t){const n=!!(getFunctionFlags(t)&2);const r=getContextualReturnType(t,void 0);if(r){return getIterationTypeOfGeneratorFunctionReturnType(e,r,n)||void 0}return void 0}function getContextualReturnType(e,t){const n=getReturnTypeFromAnnotation(e);if(n){return n}const r=getContextualSignatureForFunctionLikeDeclaration(e);if(r&&!isResolvingReturnTypeOfSignature(r)){const t=getReturnTypeOfSignature(r);const n=getFunctionFlags(e);if(n&1){return filterType(t,(e=>!!(e.flags&(3|16384|58982400))||checkGeneratorInstantiationAssignabilityToReturnType(e,n,void 0)))}if(n&2){return filterType(t,(e=>!!(e.flags&(3|16384|58982400))||!!getAwaitedTypeOfPromise(e)))}return t}const i=getImmediatelyInvokedFunctionExpression(e);if(i){return getContextualType2(i,t)}return void 0}function getContextualTypeForArgument(e,t){const n=getEffectiveCallArguments(e);const r=n.indexOf(t);return r===-1?void 0:getContextualTypeForArgumentAtIndex(e,r)}function getContextualTypeForArgumentAtIndex(e,t){if(isImportCall(e)){return t===0?ze:t===1?getGlobalImportCallOptionsType(false):ke}const n=getNodeLinks(e).resolvedSignature===jt?jt:getResolvedSignature(e);if(isJsxOpeningLikeElement(e)&&t===0){return getEffectiveFirstArgumentForJsxSignature(n,e)}const r=n.parameters.length-1;return signatureHasRestParameter(n)&&t>=r?getIndexedAccessType(getTypeOfSymbol(n.parameters[r]),getNumberLiteralType(t-r),256):getTypeAtPosition(n,t)}function getContextualTypeForDecorator(e){const t=getDecoratorCallSignature(e);return t?getOrCreateTypeFromSignature(t):void 0}function getContextualTypeForSubstitutionExpression(e,t){if(e.parent.kind===215){return getContextualTypeForArgument(e.parent,t)}return void 0}function getContextualTypeForBinaryOperand(e,t){const n=e.parent;const{left:r,operatorToken:i,right:o}=n;switch(i.kind){case 64:case 77:case 76:case 78:return e===o?getContextualTypeForAssignmentDeclaration(n):void 0;case 57:case 61:const i=getContextualType2(n,t);return e===o&&(i&&i.pattern||!i&&!isDefaultedExpandoInitializer(n))?getTypeOfExpression(r):i;case 56:case 28:return e===o?getContextualType2(n,t):void 0;default:return void 0}}function getSymbolForExpression(e){if(canHaveSymbol(e)&&e.symbol){return e.symbol}if(isIdentifier(e)){return getResolvedSymbol(e)}if(isPropertyAccessExpression(e)){const t=getTypeOfExpression(e.expression);return isPrivateIdentifier(e.name)?tryGetPrivateIdentifierPropertyOfType(t,e.name):getPropertyOfType(t,e.name.escapedText)}if(isElementAccessExpression(e)){const t=checkExpressionCached(e.argumentExpression);if(!isTypeUsableAsPropertyName(t)){return void 0}const n=getTypeOfExpression(e.expression);return getPropertyOfType(n,getPropertyNameFromType(t))}return void 0;function tryGetPrivateIdentifierPropertyOfType(e,t){const n=lookupSymbolForPrivateIdentifierDeclaration(t.escapedText,t);return n&&getPrivateIdentifierPropertyOfType(e,n)}}function getContextualTypeForAssignmentDeclaration(e){var t,n;const r=getAssignmentDeclarationKind(e);switch(r){case 0:case 4:const i=getSymbolForExpression(e.left);const o=i&&i.valueDeclaration;if(o&&(isPropertyDeclaration(o)||isPropertySignature(o))){const t=getEffectiveTypeAnnotationNode(o);return t&&instantiateType(getTypeFromTypeNode(t),getSymbolLinks(i).mapper)||(isPropertyDeclaration(o)?o.initializer&&getTypeOfExpression(e.left):void 0)}if(r===0){return getTypeOfExpression(e.left)}return getContextualTypeForThisPropertyAssignment(e);case 5:if(isPossiblyAliasedThisProperty(e,r)){return getContextualTypeForThisPropertyAssignment(e)}else if(!canHaveSymbol(e.left)||!e.left.symbol){return getTypeOfExpression(e.left)}else{const t=e.left.symbol.valueDeclaration;if(!t){return void 0}const n=cast(e.left,isAccessExpression);const r=getEffectiveTypeAnnotationNode(t);if(r){return getTypeFromTypeNode(r)}else if(isIdentifier(n.expression)){const e=n.expression;const t=te(e,e.escapedText,111551,void 0,true);if(t){const e=t.valueDeclaration&&getEffectiveTypeAnnotationNode(t.valueDeclaration);if(e){const t=getElementOrPropertyAccessName(n);if(t!==void 0){return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(e),t)}}return void 0}}return isInJSFile(t)||t===e.left?void 0:getTypeOfExpression(e.left)}case 1:case 6:case 3:case 2:let a;if(r!==2){a=canHaveSymbol(e.left)?(t=e.left.symbol)==null?void 0:t.valueDeclaration:void 0}a||(a=(n=e.symbol)==null?void 0:n.valueDeclaration);const s=a&&getEffectiveTypeAnnotationNode(a);return s?getTypeFromTypeNode(s):void 0;case 7:case 8:case 9:return S.fail("Does not apply");default:return S.assertNever(r)}}function isPossiblyAliasedThisProperty(e,t=getAssignmentDeclarationKind(e)){if(t===4){return true}if(!isInJSFile(e)||t!==5||!isIdentifier(e.left.expression)){return false}const n=e.left.expression.escapedText;const r=te(e.left,n,111551,void 0,true,true);return isThisInitializedDeclaration(r==null?void 0:r.valueDeclaration)}function getContextualTypeForThisPropertyAssignment(e){if(!e.symbol)return getTypeOfExpression(e.left);if(e.symbol.valueDeclaration){const t=getEffectiveTypeAnnotationNode(e.symbol.valueDeclaration);if(t){const e=getTypeFromTypeNode(t);if(e){return e}}}const t=cast(e.left,isAccessExpression);if(!isObjectLiteralMethod(getThisContainer(t.expression,false,false))){return void 0}const n=checkThisExpression(t.expression);const r=getElementOrPropertyAccessName(t);return r!==void 0&&getTypeOfPropertyOfContextualType(n,r)||void 0}function isCircularMappedProperty(e){return!!(getCheckFlags(e)&262144&&!e.links.type&&findResolutionCycleStartIndex(e,0)>=0)}function isExcludedMappedPropertyName(e,t){if(e.flags&16777216){const n=e;return!!(getReducedType(getTrueTypeFromConditionalType(n)).flags&131072)&&getActualTypeVariable(getFalseTypeFromConditionalType(n))===getActualTypeVariable(n.checkType)&&isTypeAssignableTo(t,n.extendsType)}if(e.flags&2097152){return some(e.types,(e=>isExcludedMappedPropertyName(e,t)))}return false}function getTypeOfPropertyOfContextualType(e,t,n){return mapType(e,(e=>{if(e.flags&2097152){let r;let i;let o=false;for(const a of e.types){if(!(a.flags&524288)){continue}if(isGenericMappedType(a)&&getMappedTypeNameTypeKind(a)!==2){const e=getIndexedMappedTypeSubstitutedTypeOfContextualType(a,t,n);r=appendContextualPropertyTypeConstituent(r,e);continue}const e=getTypeOfConcretePropertyOfContextualType(a,t);if(!e){if(!o){i=append(i,a)}continue}o=true;i=void 0;r=appendContextualPropertyTypeConstituent(r,e)}if(i){for(const e of i){const i=getTypeFromIndexInfosOfContextualType(e,t,n);r=appendContextualPropertyTypeConstituent(r,i)}}if(!r){return}if(r.length===1){return r[0]}return getIntersectionType(r)}if(!(e.flags&524288)){return}return isGenericMappedType(e)&&getMappedTypeNameTypeKind(e)!==2?getIndexedMappedTypeSubstitutedTypeOfContextualType(e,t,n):getTypeOfConcretePropertyOfContextualType(e,t)??getTypeFromIndexInfosOfContextualType(e,t,n)}),true)}function appendContextualPropertyTypeConstituent(e,t){return t?append(e,t.flags&1?Le:t):e}function getIndexedMappedTypeSubstitutedTypeOfContextualType(e,t,n){const r=n||getStringLiteralType(unescapeLeadingUnderscores(t));const i=getConstraintTypeFromMappedType(e);if(e.nameType&&isExcludedMappedPropertyName(e.nameType,r)||isExcludedMappedPropertyName(i,r)){return}const o=getBaseConstraintOfType(i)||i;if(!isTypeAssignableTo(r,o)){return}return substituteIndexedMappedType(e,r)}function getTypeOfConcretePropertyOfContextualType(e,t){const n=getPropertyOfType(e,t);if(!n||isCircularMappedProperty(n)){return}return removeMissingType(getTypeOfSymbol(n),!!(n.flags&16777216))}function getTypeFromIndexInfosOfContextualType(e,t,n){var r;if(isTupleType(e)&&isNumericLiteralName(t)&&+t>=0){const t=getElementTypeOfSliceOfTupleType(e,e.target.fixedLength,0,false,true);if(t){return t}}return(r=findApplicableIndexInfo(getIndexInfosOfStructuredType(e),n||getStringLiteralType(unescapeLeadingUnderscores(t))))==null?void 0:r.type}function getContextualTypeForObjectLiteralMethod(e,t){S.assert(isObjectLiteralMethod(e));if(e.flags&67108864){return void 0}return getContextualTypeForObjectLiteralElement(e,t)}function getContextualTypeForObjectLiteralElement(e,t){const n=e.parent;const r=isPropertyAssignment(e)&&getContextualTypeForVariableLikeDeclaration(e,t);if(r){return r}const i=getApparentTypeOfContextualType(n,t);if(i){if(hasBindableName(e)){const t=getSymbolOfDeclaration(e);return getTypeOfPropertyOfContextualType(i,t.escapedName,getSymbolLinks(t).nameType)}if(hasDynamicName(e)){const t=getNameOfDeclaration(e);if(t&&isComputedPropertyName(t)){const e=checkExpression(t.expression);const n=isTypeUsableAsPropertyName(e)&&getTypeOfPropertyOfContextualType(i,getPropertyNameFromType(e));if(n){return n}}}if(e.name){const t=getLiteralTypeFromPropertyName(e.name);return mapType(i,(e=>{var n;return(n=findApplicableIndexInfo(getIndexInfosOfStructuredType(e),t))==null?void 0:n.type}),true)}}return void 0}function getSpreadIndices(e){let t,n;for(let r=0;r{if(isTupleType(e)){if((r===void 0||ti)?n-t:0;const a=o>0&&e.target.combinedFlags&12?getEndElementCount(e.target,3):0;if(o>0&&o<=a){return getTypeArguments(e)[getTypeReferenceArity(e)-o]}return getElementTypeOfSliceOfTupleType(e,r===void 0?e.target.fixedLength:Math.min(e.target.fixedLength,r),n===void 0||i===void 0?a:Math.min(a,n-i),false,true)}return(!r||t{if(isArrayLikeType(e)){return getIndexedAccessType(e,getNumberLiteralType(a))}else{return e}}),true))}function getContextualTypeForJsxExpression(e,t){const n=e.parent;return isJsxAttributeLike(n)?getContextualType2(e,t):isJsxElement(n)?getContextualTypeForChildJsxExpression(n,e,t):void 0}function getContextualTypeForJsxAttribute(e,t){if(isJsxAttribute(e)){const n=getApparentTypeOfContextualType(e.parent,t);if(!n||isTypeAny(n)){return void 0}return getTypeOfPropertyOfContextualType(n,getEscapedTextOfJsxAttributeName(e.name))}else{return getContextualType2(e.parent,t)}}function isPossiblyDiscriminantValue(e){switch(e.kind){case 11:case 9:case 10:case 15:case 228:case 112:case 97:case 106:case 80:case 157:return true;case 211:case 217:return isPossiblyDiscriminantValue(e.expression);case 294:return!e.expression||isPossiblyDiscriminantValue(e.expression)}return false}function discriminateContextualTypeByObjectMembers(e,t){const n=`D${getNodeId(e)},${getTypeId(t)}`;return getCachedType(n)??setCachedType(n,getMatchingUnionConstituentForObjectLiteral(t,e)??discriminateTypeByDiscriminableItems(t,concatenate(map(filter(e.properties,(e=>{if(!e.symbol){return false}if(e.kind===303){return isPossiblyDiscriminantValue(e.initializer)&&isDiscriminantProperty(t,e.symbol.escapedName)}if(e.kind===304){return isDiscriminantProperty(t,e.symbol.escapedName)}return false})),(e=>[()=>getContextFreeTypeOfExpression(e.kind===303?e.initializer:e.name),e.symbol.escapedName])),map(filter(getPropertiesOfType(t),(n=>{var r;return!!(n.flags&16777216)&&!!((r=e==null?void 0:e.symbol)==null?void 0:r.members)&&!e.symbol.members.has(n.escapedName)&&isDiscriminantProperty(t,n.escapedName)})),(e=>[()=>Me,e.escapedName]))),isTypeAssignableTo))}function discriminateContextualTypeByJSXAttributes(e,t){const n=`D${getNodeId(e)},${getTypeId(t)}`;const r=getCachedType(n);if(r)return r;const i=getJsxElementChildrenPropertyName(getJsxNamespaceAt(e));return setCachedType(n,discriminateTypeByDiscriminableItems(t,concatenate(map(filter(e.properties,(e=>!!e.symbol&&e.kind===291&&isDiscriminantProperty(t,e.symbol.escapedName)&&(!e.initializer||isPossiblyDiscriminantValue(e.initializer)))),(e=>[!e.initializer?()=>Ke:()=>getContextFreeTypeOfExpression(e.initializer),e.symbol.escapedName])),map(filter(getPropertiesOfType(t),(n=>{var r;if(!(n.flags&16777216)||!((r=e==null?void 0:e.symbol)==null?void 0:r.members)){return false}const o=e.parent.parent;if(n.escapedName===i&&isJsxElement(o)&&getSemanticJsxChildren(o.children).length){return false}return!e.symbol.members.has(n.escapedName)&&isDiscriminantProperty(t,n.escapedName)})),(e=>[()=>Me,e.escapedName]))),isTypeAssignableTo))}function getApparentTypeOfContextualType(e,t){const n=isObjectLiteralMethod(e)?getContextualTypeForObjectLiteralMethod(e,t):getContextualType2(e,t);const r=instantiateContextualType(n,e,t);if(r&&!(t&&t&2&&r.flags&8650752)){const t=mapType(r,(e=>getObjectFlags(e)&32?e:getApparentType(e)),true);return t.flags&1048576&&isObjectLiteralExpression(e)?discriminateContextualTypeByObjectMembers(e,t):t.flags&1048576&&isJsxAttributes(e)?discriminateContextualTypeByJSXAttributes(e,t):t}}function instantiateContextualType(e,t,n){if(e&&maybeTypeOfKind(e,465829888)){const r=getInferenceContext(t);if(r&&n&1&&some(r.inferences,hasInferenceCandidatesOrDefault)){return instantiateInstantiableTypes(e,r.nonFixingMapper)}if(r==null?void 0:r.returnMapper){const t=instantiateInstantiableTypes(e,r.returnMapper);return t.flags&1048576&&containsType(t.types,Ge)&&containsType(t.types,$e)?filterType(t,(e=>e!==Ge&&e!==$e)):t}}return e}function instantiateInstantiableTypes(e,t){if(e.flags&465829888){return instantiateType(e,t)}if(e.flags&1048576){return getUnionType(map(e.types,(e=>instantiateInstantiableTypes(e,t))),0)}if(e.flags&2097152){return getIntersectionType(map(e.types,(e=>instantiateInstantiableTypes(e,t))))}return e}function getContextualType2(e,t){var n;if(e.flags&67108864){return void 0}const r=findContextualNode(e,!t);if(r>=0){return Ar[r]}const{parent:i}=e;switch(i.kind){case 260:case 169:case 172:case 171:case 208:return getContextualTypeForInitializerExpression(e,t);case 219:case 253:return getContextualTypeForReturnExpression(e,t);case 229:return getContextualTypeForYieldOperand(i,t);case 223:return getContextualTypeForAwaitOperand(i,t);case 213:case 214:return getContextualTypeForArgument(i,e);case 170:return getContextualTypeForDecorator(i);case 216:case 234:return isConstTypeReference(i.type)?getContextualType2(i,t):getTypeFromTypeNode(i.type);case 226:return getContextualTypeForBinaryOperand(e,t);case 303:case 304:return getContextualTypeForObjectLiteralElement(i,t);case 305:return getContextualType2(i.parent,t);case 209:{const r=i;const o=getApparentTypeOfContextualType(r,t);const a=indexOfNode(r.elements,e);const s=(n=getNodeLinks(r)).spreadIndices??(n.spreadIndices=getSpreadIndices(r.elements));return getContextualTypeForElementExpression(o,a,r.elements.length,s.first,s.last)}case 227:return getContextualTypeForConditionalOperand(e,t);case 239:S.assert(i.parent.kind===228);return getContextualTypeForSubstitutionExpression(i.parent,e);case 217:{if(isInJSFile(i)){if(isJSDocSatisfiesExpression(i)){return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(i))}const e=getJSDocTypeTag(i);if(e&&!isConstTypeReference(e.typeExpression.type)){return getTypeFromTypeNode(e.typeExpression.type)}}return getContextualType2(i,t)}case 235:return getContextualType2(i,t);case 238:return getTypeFromTypeNode(i.type);case 277:return tryGetTypeFromEffectiveTypeNode(i);case 294:return getContextualTypeForJsxExpression(i,t);case 291:case 293:return getContextualTypeForJsxAttribute(i,t);case 286:case 285:return getContextualJsxElementAttributesType(i,t);case 301:return getContextualImportAttributeType(i)}return void 0}function pushCachedContextualType(e){pushContextualType(e,getContextualType2(e,void 0),true)}function pushContextualType(e,t,n){Ir[wr]=e;Ar[wr]=t;Or[wr]=n;wr++}function popContextualType(){wr--}function findContextualNode(e,t){for(let n=wr-1;n>=0;n--){if(e===Ir[n]&&(t||!Or[n])){return n}}return-1}function pushInferenceContext(e,t){Mr[Br]=e;Rr[Br]=t;Br++}function popInferenceContext(){Br--}function getInferenceContext(e){for(let t=Br-1;t>=0;t--){if(isNodeDescendantOf(e,Mr[t])){return Rr[t]}}}function getContextualImportAttributeType(e){return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType(false),getNameFromImportAttribute(e))}function getContextualJsxElementAttributesType(e,t){if(isJsxOpeningElement(e)&&t!==4){const n=findContextualNode(e.parent,!t);if(n>=0){return Ar[n]}}return getContextualTypeForArgumentAtIndex(e,0)}function getEffectiveFirstArgumentForJsxSignature(e,t){return isJsxOpeningFragment(t)||getJsxReferenceKind(t)!==0?getJsxPropsTypeFromCallSignature(e,t):getJsxPropsTypeFromClassType(e,t)}function getJsxPropsTypeFromCallSignature(e,t){let n=getTypeOfFirstParameterOfSignatureWithFallback(e,Le);n=getJsxManagedAttributesFromLocatedAttributes(t,getJsxNamespaceAt(t),n);const r=getJsxType(la.IntrinsicAttributes,t);if(!isErrorType(r)){n=intersectTypes(r,n)}return n}function getJsxPropsTypeForSignatureFromMember(e,t){if(e.compositeSignatures){const n=[];for(const r of e.compositeSignatures){const e=getReturnTypeOfSignature(r);if(isTypeAny(e)){return e}const i=getTypeOfPropertyOfType(e,t);if(!i){return}n.push(i)}return getIntersectionType(n)}const n=getReturnTypeOfSignature(e);return isTypeAny(n)?n:getTypeOfPropertyOfType(n,t)}function getStaticTypeOfReferencedJsxConstructor(e){if(isJsxOpeningFragment(e))return getJSXFragmentType(e);if(isJsxIntrinsicTagName(e.tagName)){const t=getIntrinsicAttributesTypeFromJsxOpeningLikeElement(e);const n=createSignatureForJSXIntrinsic(e,t);return getOrCreateTypeFromSignature(n)}const t=checkExpressionCached(e.tagName);if(t.flags&128){const n=getIntrinsicAttributesTypeFromStringLiteralType(t,e);if(!n){return Ie}const r=createSignatureForJSXIntrinsic(e,n);return getOrCreateTypeFromSignature(r)}return t}function getJsxManagedAttributesFromLocatedAttributes(e,t,n){const r=getJsxLibraryManagedAttributes(t);if(r){const t=getStaticTypeOfReferencedJsxConstructor(e);const i=instantiateAliasOrInterfaceWithDefaults(r,isInJSFile(e),t,n);if(i){return i}}return n}function getJsxPropsTypeFromClassType(e,t){const n=getJsxNamespaceAt(t);const r=getJsxElementPropertiesName(n);let i=r===void 0?getTypeOfFirstParameterOfSignatureWithFallback(e,Le):r===""?getReturnTypeOfSignature(e):getJsxPropsTypeForSignatureFromMember(e,r);if(!i){if(!!r&&!!length(t.attributes.properties)){error2(t,wt.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property,unescapeLeadingUnderscores(r))}return Le}i=getJsxManagedAttributesFromLocatedAttributes(t,n,i);if(isTypeAny(i)){return i}else{let n=i;const r=getJsxType(la.IntrinsicClassAttributes,t);if(!isErrorType(r)){const i=getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(r.symbol);const o=getReturnTypeOfSignature(e);let a;if(i){const e=fillMissingTypeArguments([o],i,getMinTypeArgumentCount(i),isInJSFile(t));a=instantiateType(r,createTypeMapper(i,e))}else a=r;n=intersectTypes(a,n)}const o=getJsxType(la.IntrinsicAttributes,t);if(!isErrorType(o)){n=intersectTypes(o,n)}return n}}function getIntersectedSignatures(e){return getStrictOptionValue(T,"noImplicitAny")?reduceLeft(e,((e,t)=>e===t||!e?e:compareTypeParametersIdentical(e.typeParameters,t.typeParameters)?combineSignaturesOfIntersectionMembers(e,t):void 0)):void 0}function combineIntersectionThisParam(e,t,n){if(!e||!t){return e||t}const r=getUnionType([getTypeOfSymbol(e),instantiateType(getTypeOfSymbol(t),n)]);return createSymbolWithType(e,r)}function combineIntersectionParameters(e,t,n){const r=getParameterCount(e);const i=getParameterCount(t);const o=r>=i?e:t;const a=o===e?t:e;const s=o===e?r:i;const c=hasEffectiveRestParameter(e)||hasEffectiveRestParameter(t);const l=c&&!hasEffectiveRestParameter(o);const d=new Array(s+(l?1:0));for(let p=0;p=getMinArgumentCount(o)&&p>=getMinArgumentCount(a);const y=p>=r?void 0:getParameterNameAtPosition(e,p);const h=p>=i?void 0:getParameterNameAtPosition(t,p);const T=y===h?y:!y?h:!h?y:void 0;const S=createSymbol(1|(g&&!_?16777216:0),T||`arg${p}`,_?32768:g?16384:0);S.links.type=_?createArrayType(m):m;d[p]=S}if(l){const e=createSymbol(1,"args",32768);e.links.type=createArrayType(getTypeAtPosition(a,s));if(a===t){e.links.type=instantiateType(e.links.type,n)}d[s]=e}return d}function combineSignaturesOfIntersectionMembers(e,t){const n=e.typeParameters||t.typeParameters;let r;if(e.typeParameters&&t.typeParameters){r=createTypeMapper(t.typeParameters,e.typeParameters)}let i=(e.flags|t.flags)&(167&~1);const o=e.declaration;const a=combineIntersectionParameters(e,t,r);const s=lastOrUndefined(a);if(s&&getCheckFlags(s)&32768){i|=1}const c=combineIntersectionThisParam(e.thisParameter,t.thisParameter,r);const l=Math.max(e.minArgumentCount,t.minArgumentCount);const d=createSignature(o,n,c,a,void 0,void 0,l,i);d.compositeKind=2097152;d.compositeSignatures=concatenate(e.compositeKind===2097152&&e.compositeSignatures||[e],[t]);if(r){d.mapper=e.compositeKind===2097152&&e.mapper&&e.compositeSignatures?combineTypeMappers(e.mapper,r):r}return d}function getContextualCallSignature(e,t){const n=getSignaturesOfType(e,0);const r=filter(n,(e=>!isAritySmaller(e,t)));return r.length===1?r[0]:getIntersectedSignatures(r)}function isAritySmaller(e,t){let n=0;for(;n{const a=r.getTokenEnd();if(e.category===3&&n&&a===n.start&&i===n.length){const r=createDetachedDiagnostic(t.fileName,t.text,a,i,e,o);addRelatedInfo(n,r)}else if(!n||a!==n.start){n=createFileDiagnostic(t,a,i,e,o);gi.add(n)}}));r.setText(t.text,e.pos,e.end-e.pos);try{r.scan();S.assert(r.reScanSlashToken(true)===14,"Expected scanner to rescan RegularExpressionLiteral");return!!n}finally{r.setText("");r.setOnError(void 0)}}return false}function checkRegularExpressionLiteral(e){const t=getNodeLinks(e);if(!(t.flags&1)){t.flags|=1;addLazyDiagnostic((()=>checkGrammarRegularExpressionLiteral(e)))}return _n}function checkSpreadExpression(e,t){if(visTupleLikeType(e)||isGenericMappedType(e)&&!e.nameType&&!!getHomomorphicTypeVariable(e.target||e)));let p=false;for(let c=0;ca[t]&8?getIndexedAccessTypeOrUndefined(e,Ve)||ke:e)),2):k?nt:Re,c))}function createArrayLiteralType(e){if(!(getObjectFlags(e)&4)){return e}let t=e.literalType;if(!t){t=e.literalType=cloneTypeReference(e);t.objectFlags|=16384|131072}return t}function isNumericName(e){switch(e.kind){case 167:return isNumericComputedName(e);case 80:return isNumericLiteralName(e.escapedText);case 9:case 11:return isNumericLiteralName(e.text);default:return false}}function isNumericComputedName(e){return isTypeAssignableToKind(checkComputedPropertyName(e),296)}function checkComputedPropertyName(e){const t=getNodeLinks(e.expression);if(!t.resolvedType){if((isTypeLiteralNode(e.parent.parent)||isClassLike(e.parent.parent)||isInterfaceDeclaration(e.parent.parent))&&isBinaryExpression(e.expression)&&e.expression.operatorToken.kind===103&&e.parent.kind!==177&&e.parent.kind!==178){return t.resolvedType=Ie}t.resolvedType=checkExpression(e.expression);if(isPropertyDeclaration(e.parent)&&!hasStaticModifier(e.parent)&&isClassExpression(e.parent.parent)){const t=getEnclosingBlockScopeContainer(e.parent.parent);const n=getEnclosingIterationStatement(t);if(n){getNodeLinks(n).flags|=4096;getNodeLinks(e).flags|=32768;getNodeLinks(e.parent.parent).flags|=32768}}if(t.resolvedType.flags&98304||!isTypeAssignableToKind(t.resolvedType,402653316|296|12288)&&!isTypeAssignableTo(t.resolvedType,at)){error2(e,wt.A_computed_property_name_must_be_of_type_string_number_symbol_or_any)}}return t.resolvedType}function isSymbolWithNumericName(e){var t;const n=(t=e.declarations)==null?void 0:t[0];return isNumericLiteralName(e.escapedName)||n&&isNamedDeclaration(n)&&isNumericName(n.name)}function isSymbolWithSymbolName(e){var t;const n=(t=e.declarations)==null?void 0:t[0];return isKnownSymbol(e)||n&&isNamedDeclaration(n)&&isComputedPropertyName(n.name)&&isTypeAssignableToKind(checkComputedPropertyName(n.name),4096)}function isSymbolWithComputedName(e){var t;const n=(t=e.declarations)==null?void 0:t[0];return n&&isNamedDeclaration(n)&&isComputedPropertyName(n.name)}function getObjectLiteralIndexInfo(e,t,n,r){var i;const o=[];let a;for(let e=t;e0){a=getSpreadType(a,createObjectLiteralType(),e.symbol,_,l);o=[];i=createSymbolTable();y=false;h=false;T=false}const n=getReducedType(checkExpression(d.expression,t&2));if(isValidSpreadType(n)){const t=tryMergeUnionOfObjectTypeAndEmptyObject(n,l);if(r){checkSpreadPropOverrides(t,r,d)}x=o.length;if(isErrorType(a)){continue}a=getSpreadType(a,t,e.symbol,_,l)}else{error2(d,wt.Spread_types_may_only_be_created_from_object_types);a=Ie}continue}else{S.assert(d.kind===177||d.kind===178);checkNodeDeferred(d)}if(b&&!(b.flags&8576)){if(isTypeAssignableTo(b,at)){if(isTypeAssignableTo(b,Ve)){h=true}else if(isTypeAssignableTo(b,Ye)){T=true}else{y=true}if(n){g=true}}}else{i.set(m.escapedName,m)}o.push(m)}popContextualType();if(isErrorType(a)){return Ie}if(a!==ht){if(o.length>0){a=getSpreadType(a,createObjectLiteralType(),e.symbol,_,l);o=[];i=createSymbolTable();y=false;h=false}return mapType(a,(e=>e===ht?createObjectLiteralType():e))}return createObjectLiteralType();function createObjectLiteralType(){const t=[];const r=isConstContext(e);if(y)t.push(getObjectLiteralIndexInfo(r,x,o,ze));if(h)t.push(getObjectLiteralIndexInfo(r,x,o,Ve));if(T)t.push(getObjectLiteralIndexInfo(r,x,o,Ye));const a=createAnonymousType(e.symbol,i,d,d,t);a.objectFlags|=_|128|131072;if(m){a.objectFlags|=4096}if(g){a.objectFlags|=512}if(n){a.pattern=e}return a}}function isValidSpreadType(e){const t=removeDefinitelyFalsyTypes(mapType(e,getBaseConstraintOrType));return!!(t.flags&(1|67108864|524288|58982400)||t.flags&3145728&&every(t.types,isValidSpreadType))}function checkJsxSelfClosingElementDeferred(e){checkJsxOpeningLikeElementOrOpeningFragment(e)}function checkJsxSelfClosingElement(e,t){checkNodeDeferred(e);return getJsxElementTypeAt(e)||ke}function checkJsxElementDeferred(e){checkJsxOpeningLikeElementOrOpeningFragment(e.openingElement);if(isJsxIntrinsicTagName(e.closingElement.tagName)){getIntrinsicTagSymbol(e.closingElement)}else{checkExpression(e.closingElement.tagName)}checkJsxChildren(e)}function checkJsxElement(e,t){checkNodeDeferred(e);return getJsxElementTypeAt(e)||ke}function checkJsxFragment(e){checkJsxOpeningLikeElementOrOpeningFragment(e.openingFragment);const t=getSourceFileOfNode(e);if(getJSXTransformEnabled(T)&&(T.jsxFactory||t.pragmas.has("jsx"))&&!T.jsxFragmentFactory&&!t.pragmas.has("jsxfrag")){error2(e,T.jsxFactory?wt.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:wt.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments)}checkJsxChildren(e);const n=getJsxElementTypeAt(e);return isErrorType(n)?ke:n}function isHyphenatedJsxName(e){return e.includes("-")}function isJsxIntrinsicTagName(e){return isIdentifier(e)&&isIntrinsicJsxName(e.escapedText)||isJsxNamespacedName(e)}function checkJsxAttribute(e,t){return e.initializer?checkExpressionForMutableLocation(e.initializer,t):Ke}function createJsxAttributesTypeFromAttributesProperty(e,t=0){const n=k?createSymbolTable():void 0;let r=createSymbolTable();let i=Tt;let o=false;let a;let s=false;let c=2048;const l=getJsxElementChildrenPropertyName(getJsxNamespaceAt(e));const p=isJsxOpeningFragment(e);let u;let f=e;if(!p){const d=e.attributes;u=d.symbol;f=d;const p=getContextualType2(d,0);for(const e of d.properties){const u=e.symbol;if(isJsxAttribute(e)){const i=checkJsxAttribute(e,t);c|=getObjectFlags(i)&458752;const o=createSymbol(4|u.flags,u.escapedName);o.declarations=u.declarations;o.parent=u.parent;if(u.valueDeclaration){o.valueDeclaration=u.valueDeclaration}o.links.type=i;o.links.target=u;r.set(o.escapedName,o);n==null?void 0:n.set(o.escapedName,o);if(getEscapedTextOfJsxAttributeName(e.name)===l){s=true}if(p){const t=getPropertyOfType(p,u.escapedName);if(t&&t.declarations&&isDeprecatedSymbol(t)&&isIdentifier(e.name)){addDeprecatedSuggestion(e.name,t.declarations,e.name.escapedText)}}if(p&&t&2&&!(t&4)&&isContextSensitive(e)){const t=getInferenceContext(d);S.assert(t);const n=e.initializer.expression;addIntraExpressionInferenceSite(t,n,i)}}else{S.assert(e.kind===293);if(r.size>0){i=getSpreadType(i,createJsxAttributesTypeHelper(),d.symbol,c,false);r=createSymbolTable()}const s=getReducedType(checkExpression(e.expression,t&2));if(isTypeAny(s)){o=true}if(isValidSpreadType(s)){i=getSpreadType(i,s,d.symbol,c,false);if(n){checkSpreadPropOverrides(s,n,e)}}else{error2(e.expression,wt.Spread_types_may_only_be_created_from_object_types);a=a?getIntersectionType([a,s]):s}}}if(!o){if(r.size>0){i=getSpreadType(i,createJsxAttributesTypeHelper(),d.symbol,c,false)}}}const m=e.parent;if((isJsxElement(m)&&m.openingElement===e||isJsxFragment(m)&&m.openingFragment===e)&&getSemanticJsxChildren(m.children).length>0){const n=checkJsxChildren(m,t);if(!o&&l&&l!==""){if(s){error2(f,wt._0_are_specified_twice_The_attribute_named_0_will_be_overwritten,unescapeLeadingUnderscores(l))}const t=isJsxOpeningElement(e)?getApparentTypeOfContextualType(e.attributes,void 0):void 0;const r=t&&getTypeOfPropertyOfContextualType(t,l);const o=createSymbol(4,l);o.links.type=n.length===1?n[0]:r&&someType(r,isTupleLikeType)?createTupleType(n):createArrayType(getUnionType(n));o.valueDeclaration=zr.createPropertySignature(void 0,unescapeLeadingUnderscores(l),void 0,void 0);setParent(o.valueDeclaration,f);o.valueDeclaration.symbol=o;const a=createSymbolTable();a.set(l,o);i=getSpreadType(i,createAnonymousType(u,a,d,d,d),u,c,false)}}if(o){return ke}if(a&&i!==Tt){return getIntersectionType([a,i])}return a||(i===Tt?createJsxAttributesTypeHelper():i);function createJsxAttributesTypeHelper(){c|=8192;return createJsxAttributesType(c,u,r)}}function createJsxAttributesType(e,t,n){const r=createAnonymousType(t,n,d,d,d);r.objectFlags|=e|8192|128|131072;return r}function checkJsxChildren(e,t){const n=[];for(const r of e.children){if(r.kind===12){if(!r.containsOnlyTriviaWhiteSpaces){n.push(ze)}}else if(r.kind===294&&!r.expression){continue}else{n.push(checkExpressionForMutableLocation(r,t))}}return n}function checkSpreadPropOverrides(e,t,n){for(const r of getPropertiesOfType(e)){if(!(r.flags&16777216)){const e=t.get(r.escapedName);if(e){const t=error2(e.valueDeclaration,wt._0_is_specified_more_than_once_so_this_usage_will_be_overwritten,unescapeLeadingUnderscores(e.escapedName));addRelatedInfo(t,createDiagnosticForNode(n,wt.This_spread_always_overwrites_this_property))}}}}function checkJsxAttributes(e,t){return createJsxAttributesTypeFromAttributesProperty(e.parent,t)}function getJsxType(e,t){const n=getJsxNamespaceAt(t);const r=n&&getExportsOfSymbol(n);const i=r&&getSymbol2(r,e,788968);return i?getDeclaredTypeOfSymbol(i):Ie}function getIntrinsicTagSymbol(e){const t=getNodeLinks(e);if(!t.resolvedSymbol){const n=getJsxType(la.IntrinsicElements,e);if(!isErrorType(n)){if(!isIdentifier(e.tagName)&&!isJsxNamespacedName(e.tagName))return S.fail();const r=isJsxNamespacedName(e.tagName)?getEscapedTextOfJsxNamespacedName(e.tagName):e.tagName.escapedText;const i=getPropertyOfType(n,r);if(i){t.jsxFlags|=1;return t.resolvedSymbol=i}const o=getApplicableIndexSymbol(n,getStringLiteralType(unescapeLeadingUnderscores(r)));if(o){t.jsxFlags|=2;return t.resolvedSymbol=o}if(getTypeOfPropertyOrIndexSignatureOfType(n,r)){t.jsxFlags|=2;return t.resolvedSymbol=n.symbol}error2(e,wt.Property_0_does_not_exist_on_type_1,intrinsicTagNameToString(e.tagName),"JSX."+la.IntrinsicElements);return t.resolvedSymbol=xe}else{if(A){error2(e,wt.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists,unescapeLeadingUnderscores(la.IntrinsicElements))}return t.resolvedSymbol=xe}}return t.resolvedSymbol}function getJsxNamespaceContainerForImplicitImport(e){const t=e&&getSourceFileOfNode(e);const n=t&&getNodeLinks(t);if(n&&n.jsxImplicitImportContainer===false){return void 0}if(n&&n.jsxImplicitImportContainer){return n.jsxImplicitImportContainer}const r=getJSXRuntimeImport(getJSXImplicitImportBase(T,t),T);if(!r){return void 0}const i=qn(T)===1;const o=i?wt.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option:wt.This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed;const a=getJSXRuntimeImportSpecifier(t,r);const s=resolveExternalModule(a||e,r,o,e);const c=s&&s!==xe?getMergedSymbol(resolveSymbol(s)):void 0;if(n){n.jsxImplicitImportContainer=c||false}return c}function getJsxNamespaceAt(e){const t=e&&getNodeLinks(e);if(t&&t.jsxNamespace){return t.jsxNamespace}if(!t||t.jsxNamespace!==false){let n=getJsxNamespaceContainerForImplicitImport(e);if(!n||n===xe){const t=getJsxNamespace(e);n=te(e,t,1920,void 0,false)}if(n){const e=resolveSymbol(getSymbol2(getExportsOfSymbol(resolveSymbol(n)),la.JSX,1920));if(e&&e!==xe){if(t){t.jsxNamespace=e}return e}}if(t){t.jsxNamespace=false}}const n=resolveSymbol(getGlobalSymbol(la.JSX,1920,void 0));if(n===xe){return void 0}return n}function getNameFromJsxElementAttributesContainer(e,t){const n=t&&getSymbol2(t.exports,e,788968);const r=n&&getDeclaredTypeOfSymbol(n);const i=r&&getPropertiesOfType(r);if(i){if(i.length===0){return""}else if(i.length===1){return i[0].escapedName}else if(i.length>1&&n.declarations){error2(n.declarations[0],wt.The_global_type_JSX_0_may_not_have_more_than_one_property,unescapeLeadingUnderscores(e))}}return void 0}function getJsxLibraryManagedAttributes(e){return e&&getSymbol2(e.exports,la.LibraryManagedAttributes,788968)}function getJsxElementTypeSymbol(e){return e&&getSymbol2(e.exports,la.ElementType,788968)}function getJsxElementPropertiesName(e){return getNameFromJsxElementAttributesContainer(la.ElementAttributesPropertyNameContainer,e)}function getJsxElementChildrenPropertyName(e){if(T.jsx===4||T.jsx===5){return"children"}return getNameFromJsxElementAttributesContainer(la.ElementChildrenAttributeNameContainer,e)}function getUninstantiatedJsxSignaturesOfType(e,t){if(e.flags&4){return[Rt]}else if(e.flags&128){const n=getIntrinsicAttributesTypeFromStringLiteralType(e,t);if(!n){error2(t,wt.Property_0_does_not_exist_on_type_1,e.value,"JSX."+la.IntrinsicElements);return d}else{const e=createSignatureForJSXIntrinsic(t,n);return[e]}}const n=getApparentType(e);let r=getSignaturesOfType(n,1);if(r.length===0){r=getSignaturesOfType(n,0)}if(r.length===0&&n.flags&1048576){r=getUnionSignatures(map(n.types,(e=>getUninstantiatedJsxSignaturesOfType(e,t))))}return r}function getIntrinsicAttributesTypeFromStringLiteralType(e,t){const n=getJsxType(la.IntrinsicElements,t);if(!isErrorType(n)){const t=e.value;const r=getPropertyOfType(n,escapeLeadingUnderscores(t));if(r){return getTypeOfSymbol(r)}const i=getIndexTypeOfType(n,ze);if(i){return i}return void 0}return ke}function checkJsxReturnAssignableToAppropriateBound(e,t,n){if(e===1){const e=getJsxStatelessElementTypeAt(n);if(e){checkTypeRelatedTo(t,e,bi,n.tagName,wt.Its_return_type_0_is_not_a_valid_JSX_element,generateInitialErrorChain)}}else if(e===0){const e=getJsxElementClassTypeAt(n);if(e){checkTypeRelatedTo(t,e,bi,n.tagName,wt.Its_instance_type_0_is_not_a_valid_JSX_element,generateInitialErrorChain)}}else{const e=getJsxStatelessElementTypeAt(n);const r=getJsxElementClassTypeAt(n);if(!e||!r){return}const i=getUnionType([e,r]);checkTypeRelatedTo(t,i,bi,n.tagName,wt.Its_element_type_0_is_not_a_valid_JSX_element,generateInitialErrorChain)}function generateInitialErrorChain(){const e=getTextOfNode(n.tagName);return chainDiagnosticMessages(void 0,wt._0_cannot_be_used_as_a_JSX_component,e)}}function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(e){var t;S.assert(isJsxIntrinsicTagName(e.tagName));const n=getNodeLinks(e);if(!n.resolvedJsxElementAttributesType){const r=getIntrinsicTagSymbol(e);if(n.jsxFlags&1){return n.resolvedJsxElementAttributesType=getTypeOfSymbol(r)||Ie}else if(n.jsxFlags&2){const r=isJsxNamespacedName(e.tagName)?getEscapedTextOfJsxNamespacedName(e.tagName):e.tagName.escapedText;return n.resolvedJsxElementAttributesType=((t=getApplicableIndexInfoForName(getJsxType(la.IntrinsicElements,e),r))==null?void 0:t.type)||Ie}else{return n.resolvedJsxElementAttributesType=Ie}}return n.resolvedJsxElementAttributesType}function getJsxElementClassTypeAt(e){const t=getJsxType(la.ElementClass,e);if(isErrorType(t))return void 0;return t}function getJsxElementTypeAt(e){return getJsxType(la.Element,e)}function getJsxStatelessElementTypeAt(e){const t=getJsxElementTypeAt(e);if(t){return getUnionType([t,We])}}function getJsxElementTypeTypeAt(e){const t=getJsxNamespaceAt(e);if(!t)return void 0;const n=getJsxElementTypeSymbol(t);if(!n)return void 0;const r=instantiateAliasOrInterfaceWithDefaults(n,isInJSFile(e));if(!r||isErrorType(r))return void 0;return r}function instantiateAliasOrInterfaceWithDefaults(e,t,...n){const r=getDeclaredTypeOfSymbol(e);if(e.flags&524288){const i=getSymbolLinks(e).typeParameters;if(length(i)>=n.length){const o=fillMissingTypeArguments(n,i,n.length,t);return length(o)===0?r:getTypeAliasInstantiation(e,o)}}if(length(r.typeParameters)>=n.length){const e=fillMissingTypeArguments(n,r.typeParameters,n.length,t);return createTypeReference(r,e)}return void 0}function getJsxIntrinsicTagNamesAt(e){const t=getJsxType(la.IntrinsicElements,e);return t?getPropertiesOfType(t):d}function checkJsxPreconditions(e){if((T.jsx||0)===0){error2(e,wt.Cannot_use_JSX_unless_the_jsx_flag_is_provided)}if(getJsxElementTypeAt(e)===void 0){if(A){error2(e,wt.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist)}}}function checkJsxOpeningLikeElementOrOpeningFragment(e){const t=isJsxOpeningLikeElement(e);if(t){checkGrammarJsxElement(e)}checkJsxPreconditions(e);markJsxAliasReferenced(e);const n=getResolvedSignature(e);checkDeprecatedSignature(n,e);if(t){const t=e;const r=getJsxElementTypeTypeAt(t);if(r!==void 0){const e=t.tagName;const n=isJsxIntrinsicTagName(e)?getStringLiteralType(intrinsicTagNameToString(e)):checkExpression(e);checkTypeRelatedTo(n,r,bi,e,wt.Its_type_0_is_not_a_valid_JSX_element_type,(()=>{const t=getTextOfNode(e);return chainDiagnosticMessages(void 0,wt._0_cannot_be_used_as_a_JSX_component,t)}))}else{checkJsxReturnAssignableToAppropriateBound(getJsxReferenceKind(t),getReturnTypeOfSignature(n),t)}}}function isKnownProperty(e,t,n){if(e.flags&524288){if(getPropertyOfObjectType(e,t)||getApplicableIndexInfoForName(e,t)||isLateBoundName(t)&&getIndexInfoOfType(e,ze)||n&&isHyphenatedJsxName(t)){return true}}if(e.flags&33554432){return isKnownProperty(e.baseType,t,n)}if(e.flags&3145728&&isExcessPropertyCheckTarget(e)){for(const r of e.types){if(isKnownProperty(r,t,n)){return true}}}return false}function isExcessPropertyCheckTarget(e){return!!(e.flags&524288&&!(getObjectFlags(e)&512)||e.flags&67108864||e.flags&33554432&&isExcessPropertyCheckTarget(e.baseType)||e.flags&1048576&&some(e.types,isExcessPropertyCheckTarget)||e.flags&2097152&&every(e.types,isExcessPropertyCheckTarget))}function checkJsxExpression(e,t){checkGrammarJsxExpression(e);if(e.expression){const n=checkExpression(e.expression,t);if(e.dotDotDotToken&&n!==ke&&!isArrayType(n)){error2(e,wt.JSX_spread_child_must_be_an_array_type)}return n}else{return Ie}}function getDeclarationNodeFlagsFromSymbol(e){return e.valueDeclaration?getCombinedNodeFlagsCached(e.valueDeclaration):0}function isPrototypeProperty(e){if(e.flags&8192||getCheckFlags(e)&4){return true}if(isInJSFile(e.valueDeclaration)){const t=e.valueDeclaration.parent;return t&&isBinaryExpression(t)&&getAssignmentDeclarationKind(t)===3}}function checkPropertyAccessibility(e,t,n,r,i,o=true){const a=!o?void 0:e.kind===166?e.right:e.kind===205?e:e.kind===208&&e.propertyName?e.propertyName:e.name;return checkPropertyAccessibilityAtLocation(e,t,n,r,i,a)}function checkPropertyAccessibilityAtLocation(e,t,n,r,i,o){var a;const s=getDeclarationModifierFlagsFromSymbol(i,n);if(t){if(v<2){if(symbolHasNonMethodDeclaration(i)){if(o){error2(o,wt.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword)}return false}}if(s&64){if(o){error2(o,wt.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression,symbolToString(i),typeToString(getDeclaringClass(i)))}return false}if(!(s&256)&&((a=i.declarations)==null?void 0:a.some(isClassInstanceProperty))){if(o){error2(o,wt.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super,symbolToString(i))}return false}}if(s&64&&symbolHasNonMethodDeclaration(i)&&(isThisProperty(e)||isThisInitializedObjectBindingExpression(e)||isObjectBindingPattern(e.parent)&&isThisInitializedDeclaration(e.parent.parent))){const t=getClassLikeDeclarationOfSymbol(getParentOfSymbol(i));if(t&&isNodeUsedDuringClassInitialization(e)){if(o){error2(o,wt.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor,symbolToString(i),getTextOfIdentifierOrLiteral(t.name))}return false}}if(!(s&6)){return true}if(s&2){const t=getClassLikeDeclarationOfSymbol(getParentOfSymbol(i));if(!isNodeWithinClass(e,t)){if(o){error2(o,wt.Property_0_is_private_and_only_accessible_within_class_1,symbolToString(i),typeToString(getDeclaringClass(i)))}return false}return true}if(t){return true}let c=forEachEnclosingClass(e,(e=>{const t=getDeclaredTypeOfSymbol(getSymbolOfDeclaration(e));return isClassDerivedFromDeclaringClasses(t,i,n)}));if(!c){c=getEnclosingClassFromThisParameter(e);c=c&&isClassDerivedFromDeclaringClasses(c,i,n);if(s&256||!c){if(o){error2(o,wt.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses,symbolToString(i),typeToString(getDeclaringClass(i)||r))}return false}}if(s&256){return true}if(r.flags&262144){r=r.isThisType?getConstraintOfTypeParameter(r):getBaseConstraintOfType(r)}if(!r||!hasBaseType(r,c)){if(o){error2(o,wt.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2,symbolToString(i),typeToString(c),typeToString(r))}return false}return true}function getEnclosingClassFromThisParameter(e){const t=getThisParameterFromNodeContext(e);let n=(t==null?void 0:t.type)&&getTypeFromTypeNode(t.type);if(n){if(n.flags&262144){n=getConstraintOfTypeParameter(n)}}else{const t=getThisContainer(e,false,false);if(isFunctionLike(t)){n=getContextualThisParameterType(t)}}if(n&&getObjectFlags(n)&(3|4)){return getTargetType(n)}return void 0}function getThisParameterFromNodeContext(e){const t=getThisContainer(e,false,false);return t&&isFunctionLike(t)?getThisParameter(t):void 0}function symbolHasNonMethodDeclaration(e){return!!forEachProperty2(e,(e=>!(e.flags&8192)))}function checkNonNullExpression(e){return checkNonNullType(checkExpression(e),e)}function isNullableType(e){return hasTypeFacts(e,50331648)}function getNonNullableTypeIfNeeded(e){return isNullableType(e)?getNonNullableType(e):e}function reportObjectPossiblyNullOrUndefinedError(e,t){const n=isEntityNameExpression(e)?entityNameToString(e):void 0;if(e.kind===106){error2(e,wt.The_value_0_cannot_be_used_here,"null");return}if(n!==void 0&&n.length<100){if(isIdentifier(e)&&n==="undefined"){error2(e,wt.The_value_0_cannot_be_used_here,"undefined");return}error2(e,t&16777216?t&33554432?wt._0_is_possibly_null_or_undefined:wt._0_is_possibly_undefined:wt._0_is_possibly_null,n)}else{error2(e,t&16777216?t&33554432?wt.Object_is_possibly_null_or_undefined:wt.Object_is_possibly_undefined:wt.Object_is_possibly_null)}}function reportCannotInvokePossiblyNullOrUndefinedError(e,t){error2(e,t&16777216?t&33554432?wt.Cannot_invoke_an_object_which_is_possibly_null_or_undefined:wt.Cannot_invoke_an_object_which_is_possibly_undefined:wt.Cannot_invoke_an_object_which_is_possibly_null)}function checkNonNullTypeWithReporter(e,t,n){if(k&&e.flags&2){if(isEntityNameExpression(t)){const e=entityNameToString(t);if(e.length<100){error2(t,wt._0_is_of_type_unknown,e);return Ie}}error2(t,wt.Object_is_of_type_unknown);return Ie}const r=getTypeFacts(e,50331648);if(r&50331648){n(t,r);const i=getNonNullableType(e);return i.flags&(98304|131072)?Ie:i}return e}function checkNonNullType(e,t){return checkNonNullTypeWithReporter(e,t,reportObjectPossiblyNullOrUndefinedError)}function checkNonNullNonVoidType(e,t){const n=checkNonNullType(e,t);if(n.flags&16384){if(isEntityNameExpression(t)){const e=entityNameToString(t);if(isIdentifier(t)&&e==="undefined"){error2(t,wt.The_value_0_cannot_be_used_here,e);return n}if(e.length<100){error2(t,wt._0_is_possibly_undefined,e);return n}}error2(t,wt.Object_is_possibly_undefined)}return n}function checkPropertyAccessExpression(e,t,n){return e.flags&64?checkPropertyAccessChain(e,t):checkPropertyAccessExpressionOrQualifiedName(e,e.expression,checkNonNullExpression(e.expression),e.name,t,n)}function checkPropertyAccessChain(e,t){const n=checkExpression(e.expression);const r=getOptionalExpressionType(n,e.expression);return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(e,e.expression,checkNonNullType(r,e.expression),e.name,t),e,r!==n)}function checkQualifiedName(e,t){const n=isPartOfTypeQuery(e)&&isThisIdentifier(e.left)?checkNonNullType(checkThisExpression(e.left),e.left):checkNonNullExpression(e.left);return checkPropertyAccessExpressionOrQualifiedName(e,e.left,n,e.right,t)}function isMethodAccessForCall(e){while(e.parent.kind===217){e=e.parent}return isCallOrNewExpression(e.parent)&&e.parent.expression===e}function lookupSymbolForPrivateIdentifierDeclaration(e,t){for(let n=getContainingClassExcludingClassDecorators(t);!!n;n=getContainingClass(n)){const{symbol:t}=n;const r=getSymbolNameForPrivateIdentifier(t,e);const i=t.members&&t.members.get(r)||t.exports&&t.exports.get(r);if(i){return i}}}function checkGrammarPrivateIdentifierExpression(e){if(!getContainingClass(e)){return grammarErrorOnNode(e,wt.Private_identifiers_are_not_allowed_outside_class_bodies)}if(!isForInStatement(e.parent)){if(!isExpressionNode(e)){return grammarErrorOnNode(e,wt.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression)}const t=isBinaryExpression(e.parent)&&e.parent.operatorToken.kind===103;if(!getSymbolForPrivateIdentifierExpression(e)&&!t){return grammarErrorOnNode(e,wt.Cannot_find_name_0,idText(e))}}return false}function checkPrivateIdentifierExpression(e){checkGrammarPrivateIdentifierExpression(e);const t=getSymbolForPrivateIdentifierExpression(e);if(t){markPropertyAsReferenced(t,void 0,false)}return ke}function getSymbolForPrivateIdentifierExpression(e){if(!isExpressionNode(e)){return void 0}const t=getNodeLinks(e);if(t.resolvedSymbol===void 0){t.resolvedSymbol=lookupSymbolForPrivateIdentifierDeclaration(e.escapedText,e)}return t.resolvedSymbol}function getPrivateIdentifierPropertyOfType(e,t){return getPropertyOfType(e,t.escapedName)}function checkPrivateIdentifierPropertyAccess(e,t,n){let r;const i=getPropertiesOfType(e);if(i){forEach(i,(e=>{const n=e.valueDeclaration;if(n&&isNamedDeclaration(n)&&isPrivateIdentifier(n.name)&&n.name.escapedText===t.escapedText){r=e;return true}}))}const o=diagnosticName(t);if(r){const i=S.checkDefined(r.valueDeclaration);const a=S.checkDefined(getContainingClass(i));if(n==null?void 0:n.valueDeclaration){const r=n.valueDeclaration;const s=getContainingClass(r);S.assert(!!s);if(findAncestor(s,(e=>a===e))){const n=error2(t,wt.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling,o,typeToString(e));addRelatedInfo(n,createDiagnosticForNode(r,wt.The_shadowing_declaration_of_0_is_defined_here,o),createDiagnosticForNode(i,wt.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here,o));return true}}error2(t,wt.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier,o,diagnosticName(a.name||Xo));return true}return false}function isThisPropertyAccessInConstructor(e,t){return(isConstructorDeclaredProperty(t)||isThisProperty(e)&&isAutoTypedProperty(t))&&getThisContainer(e,true,false)===getDeclaringConstructor(t)}function checkPropertyAccessExpressionOrQualifiedName(e,t,n,r,i,o){const a=getNodeLinks(t).resolvedSymbol;const s=getAssignmentTargetKind(e);const c=getApparentType(s!==0||isMethodAccessForCall(e)?getWidenedType(n):n);const l=isTypeAny(c)||c===tt;let d;if(isPrivateIdentifier(r)){if(v{switch(e.kind){case 172:return true;case 303:case 174:case 177:case 178:case 305:case 167:case 239:case 294:case 291:case 292:case 293:case 286:case 233:case 298:return false;case 219:case 244:return isBlock(e.parent)&&isClassStaticBlockDeclaration(e.parent.parent)?true:"quit";default:return isExpressionNode(e)?false:"quit"}}))}function isPropertyDeclaredInAncestorClass(e){if(!(e.parent.flags&32)){return false}let t=getTypeOfSymbol(e.parent);while(true){t=t.symbol&&getSuperClass(t);if(!t){return false}const n=getPropertyOfType(t,e.escapedName);if(n&&n.valueDeclaration){return true}}}function getSuperClass(e){const t=getBaseTypes(e);if(t.length===0){return void 0}return getIntersectionType(t)}function reportNonexistentProperty(e,t,n){const r=getNodeLinks(e);const i=r.nonExistentPropCheckCache||(r.nonExistentPropCheckCache=new Set);const o=`${getTypeId(t)}|${n}`;if(i.has(o)){return}i.add(o);let a;let s;if(!isPrivateIdentifier(e)&&t.flags&1048576&&!(t.flags&402784252)){for(const n of t.types){if(!getPropertyOfType(n,e.escapedText)&&!getApplicableIndexInfoForName(n,e.escapedText)){a=chainDiagnosticMessages(a,wt.Property_0_does_not_exist_on_type_1,declarationNameToString(e),typeToString(n));break}}}if(typeHasStaticProperty(e.escapedText,t)){const n=declarationNameToString(e);const r=typeToString(t);a=chainDiagnosticMessages(a,wt.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,n,r,r+"."+n)}else{const r=getPromisedTypeOfPromise(t);if(r&&getPropertyOfType(r,e.escapedText)){a=chainDiagnosticMessages(a,wt.Property_0_does_not_exist_on_type_1,declarationNameToString(e),typeToString(t));s=createDiagnosticForNode(e,wt.Did_you_forget_to_use_await)}else{const r=declarationNameToString(e);const i=typeToString(t);const o=getSuggestedLibForNonExistentProperty(r,t);if(o!==void 0){a=chainDiagnosticMessages(a,wt.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later,r,i,o)}else{const o=getSuggestedSymbolForNonexistentProperty(e,t);if(o!==void 0){const e=symbolName(o);const t=n?wt.Property_0_may_not_exist_on_type_1_Did_you_mean_2:wt.Property_0_does_not_exist_on_type_1_Did_you_mean_2;a=chainDiagnosticMessages(a,t,r,i,e);s=o.valueDeclaration&&createDiagnosticForNode(o.valueDeclaration,wt._0_is_declared_here,e)}else{const e=containerSeemsToBeEmptyDomElement(t)?wt.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:wt.Property_0_does_not_exist_on_type_1;a=chainDiagnosticMessages(elaborateNeverIntersection(a,t),e,r,i)}}}}const c=createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(e),e,a);if(s){addRelatedInfo(c,s)}addErrorOrSuggestion(!n||a.code!==wt.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,c)}function containerSeemsToBeEmptyDomElement(e){return T.lib&&!T.lib.includes("dom")&&everyContainedType(e,(e=>e.symbol&&/^(?:EventTarget|Node|(?:HTML[a-zA-Z]*)?Element)$/.test(unescapeLeadingUnderscores(e.symbol.escapedName))))&&isEmptyObjectType(e)}function typeHasStaticProperty(e,t){const n=t.symbol&&getPropertyOfType(getTypeOfSymbol(t.symbol),e);return n!==void 0&&!!n.valueDeclaration&&isStatic(n.valueDeclaration)}function getSuggestedLibForNonExistentName(e){const t=diagnosticName(e);const n=un();const r=n.get(t);return r&&firstIterator(r.keys())}function getSuggestedLibForNonExistentProperty(e,t){const n=getApparentType(t).symbol;if(!n){return void 0}const r=symbolName(n);const i=un();const o=i.get(r);if(o){for(const[t,n]of o){if(contains(n,e)){return t}}}}function getSuggestedSymbolForNonexistentClassMember(e,t){return getSpellingSuggestionForName(e,getPropertiesOfType(t),106500)}function getSuggestedSymbolForNonexistentProperty(e,t){let n=getPropertiesOfType(t);if(typeof e!=="string"){const r=e.parent;if(isPropertyAccessExpression(r)){n=filter(n,(e=>isValidPropertyAccessForCompletions(r,t,e)))}e=idText(e)}return getSpellingSuggestionForName(e,n,111551)}function getSuggestedSymbolForNonexistentJSXAttribute(e,t){const n=isString(e)?e:idText(e);const r=getPropertiesOfType(t);const i=n==="for"?find(r,(e=>symbolName(e)==="htmlFor")):n==="class"?find(r,(e=>symbolName(e)==="className")):void 0;return i??getSpellingSuggestionForName(n,r,111551)}function getSuggestionForNonexistentProperty(e,t){const n=getSuggestedSymbolForNonexistentProperty(e,t);return n&&symbolName(n)}function getSuggestionForSymbolNameLookup(e,t,n){const r=getSymbol2(e,t,n);if(r)return r;let i;if(e===U){const t=mapDefined(["string","number","boolean","object","bigint","symbol"],(t=>e.has(t.charAt(0).toUpperCase()+t.slice(1))?createSymbol(524288,t):void 0));i=t.concat(arrayFrom(e.values()))}else{i=arrayFrom(e.values())}return getSpellingSuggestionForName(unescapeLeadingUnderscores(t),i,n)}function getSuggestedSymbolForNonexistentSymbol(e,t,n){S.assert(t!==void 0,"outername should always be defined");const r=ne(e,t,n,void 0,false,false);return r}function getSuggestedSymbolForNonexistentModule(e,t){return t.exports&&getSpellingSuggestionForName(idText(e),getExportsOfModuleAsArray(t),2623475)}function getSuggestionForNonexistentIndexSignature(e,t,n){function hasProp(t){const r=getPropertyOfObjectType(e,t);if(r){const e=getSingleCallSignature(getTypeOfSymbol(r));return!!e&&getMinArgumentCount(e)>=1&&isTypeAssignableTo(n,getTypeAtPosition(e,0))}return false}const r=isAssignmentTarget(t)?"set":"get";if(!hasProp(r)){return void 0}let i=tryGetPropertyAccessOrIdentifierToString(t.expression);if(i===void 0){i=r}else{i+="."+r}return i}function getSuggestedTypeForNonexistentStringLiteralType(e,t){const n=t.types.filter((e=>!!(e.flags&128)));return getSpellingSuggestion(e.value,n,(e=>e.value))}function getSpellingSuggestionForName(e,t,n){return getSpellingSuggestion(e,t,getCandidateName);function getCandidateName(e){const t=symbolName(e);if(startsWith(t,'"')){return void 0}if(e.flags&n){return t}if(e.flags&2097152){const r=tryResolveAlias(e);if(r&&r.flags&n){return t}}return void 0}}function markPropertyAsReferenced(e,t,n){const r=e&&e.flags&106500&&e.valueDeclaration;if(!r){return}const i=hasEffectiveModifier(r,2);const o=e.valueDeclaration&&isNamedDeclaration(e.valueDeclaration)&&isPrivateIdentifier(e.valueDeclaration.name);if(!i&&!o){return}if(t&&isWriteOnlyAccess(t)&&!(e.flags&65536)){return}if(n){const n=findAncestor(t,isFunctionLikeDeclaration);if(n&&n.symbol===e){return}}(getCheckFlags(e)&1?getSymbolLinks(e).target:e).isReferenced=-1}function isSelfTypeAccess(e,t){return e.kind===110||!!t&&isEntityNameExpression(e)&&t===getResolvedSymbol(getFirstIdentifier(e))}function isValidPropertyAccess(e,t){switch(e.kind){case 211:return isValidPropertyAccessWithType(e,e.expression.kind===108,t,getWidenedType(checkExpression(e.expression)));case 166:return isValidPropertyAccessWithType(e,false,t,getWidenedType(checkExpression(e.left)));case 205:return isValidPropertyAccessWithType(e,false,t,getTypeFromTypeNode(e))}}function isValidPropertyAccessForCompletions(e,t,n){return isPropertyAccessible(e,e.kind===211&&e.expression.kind===108,false,t,n)}function isValidPropertyAccessWithType(e,t,n,r){if(isTypeAny(r)){return true}const i=getPropertyOfType(r,n);return!!i&&isPropertyAccessible(e,t,false,r,i)}function isPropertyAccessible(e,t,n,r,i){if(isTypeAny(r)){return true}if(i.valueDeclaration&&isPrivateIdentifierClassElementDeclaration(i.valueDeclaration)){const t=getContainingClass(i.valueDeclaration);return!isOptionalChain(e)&&!!findAncestor(e,(e=>e===t))}return checkPropertyAccessibilityAtLocation(e,t,n,r,i)}function getForInVariableSymbol(e){const t=e.initializer;if(t.kind===261){const e=t.declarations[0];if(e&&!isBindingPattern(e.name)){return getSymbolOfDeclaration(e)}}else if(t.kind===80){return getResolvedSymbol(t)}return void 0}function hasNumericPropertyNames(e){return getIndexInfosOfType(e).length===1&&!!getIndexInfoOfType(e,Ve)}function isForInVariableForNumericPropertyNames(e){const t=skipParentheses(e);if(t.kind===80){const n=getResolvedSymbol(t);if(n.flags&3){let t=e;let r=e.parent;while(r){if(r.kind===249&&t===r.statement&&getForInVariableSymbol(r)===n&&hasNumericPropertyNames(getTypeOfExpression(r.expression))){return true}t=r;r=r.parent}}}return false}function checkIndexedAccess(e,t){return e.flags&64?checkElementAccessChain(e,t):checkElementAccessExpression(e,checkNonNullExpression(e.expression),t)}function checkElementAccessChain(e,t){const n=checkExpression(e.expression);const r=getOptionalExpressionType(n,e.expression);return propagateOptionalTypeMarker(checkElementAccessExpression(e,checkNonNullType(r,e.expression),t),e,r!==n)}function checkElementAccessExpression(e,t,n){const r=getAssignmentTargetKind(e)!==0||isMethodAccessForCall(e)?getWidenedType(t):t;const i=e.argumentExpression;const o=checkExpression(i);if(isErrorType(r)||r===tt){return r}if(isConstEnumObjectType(r)&&!isStringLiteralLike(i)){error2(i,wt.A_const_enum_member_can_only_be_accessed_using_a_string_literal);return Ie}const a=isForInVariableForNumericPropertyNames(i)?Ve:o;const s=getAssignmentTargetKind(e);let c;if(s===0){c=32}else{c=4|(isGenericObjectType(r)&&!isThisTypeParameter(r)?2:0);if(s===2){c|=32}}const l=getIndexedAccessTypeOrUndefined(r,a,c,e)||Ie;return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(e,getNodeLinks(e).resolvedSymbol,l,i,n),e)}function callLikeExpressionMayHaveTypeArguments(e){return isCallOrNewExpression(e)||isTaggedTemplateExpression(e)||isJsxOpeningLikeElement(e)}function resolveUntypedCall(e){if(callLikeExpressionMayHaveTypeArguments(e)){forEach(e.typeArguments,checkSourceElement)}if(e.kind===215){checkExpression(e.template)}else if(isJsxOpeningLikeElement(e)){checkExpression(e.attributes)}else if(isBinaryExpression(e)){checkExpression(e.left)}else if(isCallOrNewExpression(e)){forEach(e.arguments,(e=>{checkExpression(e)}))}return Rt}function resolveErrorCall(e){resolveUntypedCall(e);return Bt}function reorderCandidates(e,t,n){let r;let i;let o=0;let a;let s=-1;let c;S.assert(!t.length);for(const l of e){const e=l.declaration&&getSymbolOfDeclaration(l.declaration);const d=l.declaration&&l.declaration.parent;if(!i||e===i){if(r&&d===r){a=a+1}else{r=d;a=o}}else{a=o=t.length;r=d}i=e;if(signatureHasLiteralTypes(l)){s++;c=s;o++}else{c=a}t.splice(c,0,n?getOptionalCallSignature(l,n):l)}}function isSpreadArgument(e){return!!e&&(e.kind===230||e.kind===237&&e.isSpread)}function getSpreadArgumentIndex(e){return findIndex(e,isSpreadArgument)}function acceptsVoid(e){return!!(e.flags&16384)}function acceptsVoidUndefinedUnknownOrAny(e){return!!(e.flags&(16384|32768|2|1))}function hasCorrectArity(e,t,n,r=false){if(isJsxOpeningFragment(e))return true;let i;let o=false;let a=getParameterCount(n);let s=getMinArgumentCount(n);if(e.kind===215){i=t.length;if(e.template.kind===228){const t=last(e.template.templateSpans);o=nodeIsMissing(t.literal)||!!t.literal.isUnterminated}else{const t=e.template;S.assert(t.kind===15);o=!!t.isUnterminated}}else if(e.kind===170){i=getDecoratorArgumentCount(e,n)}else if(e.kind===226){i=1}else if(isJsxOpeningLikeElement(e)){o=e.attributes.end===e.end;if(o){return true}i=s===0?t.length:1;a=t.length===0?a:1;s=Math.min(s,1)}else if(!e.arguments){S.assert(e.kind===214);return getMinArgumentCount(n)===0}else{i=r?t.length+1:t.length;o=e.arguments.end===e.end;const a=getSpreadArgumentIndex(t);if(a>=0){return a>=getMinArgumentCount(n)&&(hasEffectiveRestParameter(n)||aa){return false}if(o||i>=s){return true}for(let t=i;t=r&&t.length<=n}function isInstantiatedGenericParameter(e,t){let n;return!!(e.target&&(n=tryGetTypeAtPosition(e.target,t))&&isGenericType(n))}function getSingleCallSignature(e){return getSingleSignature(e,0,false)}function getSingleCallOrConstructSignature(e){return getSingleSignature(e,0,false)||getSingleSignature(e,1,false)}function getSingleSignature(e,t,n){if(e.flags&524288){const r=resolveStructuredTypeMembers(e);if(n||r.properties.length===0&&r.indexInfos.length===0){if(t===0&&r.callSignatures.length===1&&r.constructSignatures.length===0){return r.callSignatures[0]}if(t===1&&r.constructSignatures.length===1&&r.callSignatures.length===0){return r.constructSignatures[0]}}}return void 0}function instantiateSignatureInContextOf(e,t,n,r){const i=createInferenceContext(getTypeParametersForMapper(e),e,0,r);const o=getEffectiveRestType(t);const a=n&&(o&&o.flags&262144?n.nonFixingMapper:n.mapper);const s=a?instantiateSignature(t,a):t;applyToParameterTypes(s,e,((e,t)=>{inferTypes(i.inferences,e,t)}));if(!n){applyToReturnTypes(t,e,((e,t)=>{inferTypes(i.inferences,e,t,128)}))}return getSignatureInstantiation(e,getInferredTypes(i),isInJSFile(t.declaration))}function inferJsxTypeArguments(e,t,n,r){const i=getEffectiveFirstArgumentForJsxSignature(t,e);const o=checkExpressionWithContextualType(e.attributes,i,r,n);inferTypes(r.inferences,o,i);return getInferredTypes(r)}function getThisArgumentType(e){if(!e){return Ze}const t=checkExpression(e);return isRightSideOfInstanceofExpression(e)?t:isOptionalChainRoot(e.parent)?getNonNullableType(t):isOptionalChain(e.parent)?removeOptionalTypeMarker(t):t}function inferTypeArguments(e,t,n,r,i){if(isJsxOpeningLikeElement(e)){return inferJsxTypeArguments(e,t,r,i)}if(e.kind!==170&&e.kind!==226){const n=every(t.typeParameters,(e=>!!getDefaultFromTypeParameter(e)));const r=getContextualType2(e,n?8:0);if(r){const o=getReturnTypeOfSignature(t);if(couldContainTypeVariables(o)){const a=getInferenceContext(e);const s=!n&&getContextualType2(e,8)!==r;if(!s){const e=getMapperFromContext(cloneInferenceContext(a,1));const t=instantiateType(r,e);const n=getSingleCallSignature(t);const s=n&&n.typeParameters?getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(n,n.typeParameters)):t;inferTypes(i.inferences,s,o,128)}const c=createInferenceContext(t.typeParameters,t,i.flags);const l=instantiateType(r,a&&a.returnMapper);inferTypes(c.inferences,l,o);i.returnMapper=some(c.inferences,hasInferenceCandidates)?getMapperFromContext(cloneInferredPartOfContext(c)):void 0}}}const o=getNonArrayRestType(t);const a=o?Math.min(getParameterCount(t)-1,n.length):n.length;if(o&&o.flags&262144){const e=find(i.inferences,(e=>e.typeParameter===o));if(e){e.impliedArity=findIndex(n,isSpreadArgument,a)<0?n.length-a:void 0}}const s=getThisTypeOfSignature(t);if(s&&couldContainTypeVariables(s)){const t=getThisArgumentOfCall(e);inferTypes(i.inferences,getThisArgumentType(t),s)}for(let e=0;e=n-1){const t=e[n-1];if(isSpreadArgument(t)){const e=t.kind===237?t.type:checkExpressionWithContextualType(t.expression,r,i,o);if(isArrayLikeType(e)){return getMutableArrayOrTupleType(e)}return createArrayType(checkIteratedTypeOrElementType(33,e,Me,t.kind===230?t.expression:t),a)}}const s=[];const c=[];const l=[];for(let d=t;dchainDiagnosticMessages(void 0,wt.Type_0_does_not_satisfy_the_constraint_1):void 0;const l=r||wt.Type_0_does_not_satisfy_the_constraint_1;if(!s){s=createTypeMapper(o,a)}const d=a[e];if(!checkTypeAssignableTo(d,getTypeWithThisArgument(instantiateType(i,s),d),n?t[e]:void 0,l,c)){return void 0}}}return a}function getJsxReferenceKind(e){if(isJsxIntrinsicTagName(e.tagName)){return 2}const t=getApparentType(checkExpression(e.tagName));if(length(getSignaturesOfType(t,1))){return 0}if(length(getSignaturesOfType(t,0))){return 1}return 2}function checkApplicableSignatureForJsxCallLikeElement(e,t,n,r,i,o,a){const s=getEffectiveFirstArgumentForJsxSignature(t,e);const c=isJsxOpeningFragment(e)?createJsxAttributesTypeFromAttributesProperty(e):checkExpressionWithContextualType(e.attributes,s,void 0,r);const l=r&4?getRegularTypeOfObjectLiteral(c):c;return checkTagNameDoesNotExpectTooManyArguments()&&checkTypeRelatedToAndOptionallyElaborate(l,s,n,i?isJsxOpeningFragment(e)?e:e.tagName:void 0,isJsxOpeningFragment(e)?void 0:e.attributes,void 0,o,a);function checkTagNameDoesNotExpectTooManyArguments(){var t;if(getJsxNamespaceContainerForImplicitImport(e)){return true}const n=(isJsxOpeningElement(e)||isJsxSelfClosingElement(e))&&!(isJsxIntrinsicTagName(e.tagName)||isJsxNamespacedName(e.tagName))?checkExpression(e.tagName):void 0;if(!n){return true}const r=getSignaturesOfType(n,0);if(!length(r)){return true}const o=getJsxFactoryEntity(e);if(!o){return true}const s=resolveEntityName(o,111551,true,false,e);if(!s){return true}const c=getTypeOfSymbol(s);const l=getSignaturesOfType(c,0);if(!length(l)){return true}let d=false;let p=0;for(const e of l){const t=getTypeAtPosition(e,0);const n=getSignaturesOfType(t,0);if(!length(n))continue;for(const e of n){d=true;if(hasEffectiveRestParameter(e)){return true}const t=getParameterCount(e);if(t>p){p=t}}}if(!d){return true}let u=Infinity;for(const e of r){const t=getMinArgumentCount(e);if(t{n.push(e.expression)}))}return n}if(e.kind===170){return getEffectiveDecoratorArguments(e)}if(e.kind===226){return[e.left]}if(isJsxOpeningLikeElement(e)){return e.attributes.properties.length>0||isJsxOpeningElement(e)&&e.parent.children.length>0?[e.attributes]:d}const t=e.arguments||d;const n=getSpreadArgumentIndex(t);if(n>=0){const e=t.slice(0,n);for(let r=n;r{var o;const a=i.target.elementFlags[r];const s=createSyntheticExpression(n,a&4?createArrayType(t):t,!!(a&12),(o=i.target.labeledElementDeclarations)==null?void 0:o[r]);e.push(s)}))}else{e.push(n)}}return e}return t}function getEffectiveDecoratorArguments(e){const t=e.expression;const n=getDecoratorCallSignature(e);if(n){const e=[];for(const r of n.parameters){const n=getTypeOfSymbol(r);e.push(createSyntheticExpression(t,n))}return e}return S.fail()}function getDecoratorArgumentCount(e,t){return T.experimentalDecorators?getLegacyDecoratorArgumentCount(e,t):Math.min(Math.max(getParameterCount(t),1),2)}function getLegacyDecoratorArgumentCount(e,t){switch(e.parent.kind){case 263:case 231:return 1;case 172:return hasAccessorModifier(e.parent)?3:2;case 174:case 177:case 178:return t.parameters.length<=2?2:3;case 169:return 3;default:return S.fail()}}function getDiagnosticSpanForCallNode(e){const t=getSourceFileOfNode(e);const{start:n,length:r}=getErrorSpanForNode(t,isPropertyAccessExpression(e.expression)?e.expression.name:e.expression);return{start:n,length:r,sourceFile:t}}function getDiagnosticForCallNode(e,t,...n){if(isCallExpression(e)){const{sourceFile:r,start:i,length:o}=getDiagnosticSpanForCallNode(e);if("message"in t){return createFileDiagnostic(r,i,o,t,...n)}return createDiagnosticForFileFromMessageChain(r,t)}else{if("message"in t){return createDiagnosticForNode(e,t,...n)}return createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(e),e,t)}}function getErrorNodeForCallNode(e){if(isCallOrNewExpression(e)){return isPropertyAccessExpression(e.expression)?e.expression.name:e.expression}if(isTaggedTemplateExpression(e)){return isPropertyAccessExpression(e.tag)?e.tag.name:e.tag}if(isJsxOpeningLikeElement(e)){return e.tagName}return e}function isPromiseResolveArityError(e){if(!isCallExpression(e)||!isIdentifier(e.expression))return false;const t=te(e.expression,e.expression.escapedText,111551,void 0,false);const n=t==null?void 0:t.valueDeclaration;if(!n||!isParameter(n)||!isFunctionExpressionOrArrowFunction(n.parent)||!isNewExpression(n.parent.parent)||!isIdentifier(n.parent.parent.expression)){return false}const r=getGlobalPromiseConstructorSymbol(false);if(!r)return false;const i=getSymbolAtLocation(n.parent.parent.expression,true);return i===r}function getArgumentArityError(e,t,n,r){var i;const o=getSpreadArgumentIndex(n);if(o>-1){return createDiagnosticForNode(n[o],wt.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter)}let a=Number.POSITIVE_INFINITY;let s=Number.NEGATIVE_INFINITY;let c=Number.NEGATIVE_INFINITY;let l=Number.POSITIVE_INFINITY;let d;for(const e of t){const t=getMinArgumentCount(e);const r=getParameterCount(e);if(tc)c=t;if(n.lengthi){a=Math.min(a,t)}else if(n1){y=chooseOverload(T,vi,b,C)}if(!y){y=chooseOverload(T,bi,b,C)}const E=getNodeLinks(e);if(E.resolvedSignature!==jt&&!n){S.assert(E.resolvedSignature);return E.resolvedSignature}if(y){return y}y=getCandidateForOverloadFailure(e,T,x,!!n,r);E.resolvedSignature=y;if(u){if(!o&&p){o=wt.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method}if(f){if(f.length===1||f.length>3){const t=f[f.length-1];let n;if(f.length>3){n=chainDiagnosticMessages(n,wt.The_last_overload_gave_the_following_error);n=chainDiagnosticMessages(n,wt.No_overload_matches_this_call)}if(o){n=chainDiagnosticMessages(n,o)}const r=getSignatureApplicabilityError(e,x,t,bi,0,true,(()=>n),void 0);if(r){for(const e of r){if(t.declaration&&f.length>3){addRelatedInfo(e,createDiagnosticForNode(t.declaration,wt.The_last_overload_is_declared_here))}addImplementationSuccessElaboration(t,e);gi.add(e)}}else{S.fail("No error for last overload signature")}}else{const t=[];let n=0;let r=Number.MAX_VALUE;let i=0;let a=0;for(const o of f){const chain2=()=>chainDiagnosticMessages(void 0,wt.Overload_0_of_1_2_gave_the_following_error,a+1,T.length,signatureToString(o));const s=getSignatureApplicabilityError(e,x,o,bi,0,true,chain2,void 0);if(s){if(s.length<=r){r=s.length;i=a}n=Math.max(n,s.length);t.push(s)}else{S.fail("No error for 3 or fewer overload signatures")}a++}const s=n>1?t[i]:flatten(t);S.assert(s.length>0,"No errors reported for 3 or fewer overload signatures");let c=chainDiagnosticMessages(map(s,createDiagnosticMessageChainFromDiagnostic),wt.No_overload_matches_this_call);if(o){c=chainDiagnosticMessages(c,o)}const l=[...flatMap(s,(e=>e.relatedInformation))];let d;if(every(s,(e=>e.start===s[0].start&&e.length===s[0].length&&e.file===s[0].file))){const{file:e,start:t,length:n}=s[0];d={file:e,start:t,length:n,code:c.code,category:c.category,messageText:c,relatedInformation:l}}else{d=createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(e),getErrorNodeForCallNode(e),c,l)}addImplementationSuccessElaboration(f[0],d);gi.add(d)}}else if(m){gi.add(getArgumentArityError(e,[m],x,o))}else if(_){checkTypeArguments(_,e.typeArguments,true,o)}else if(!l){const n=filter(t,(e=>hasCorrectTypeArgumentArity(e,v)));if(n.length===0){gi.add(getTypeArgumentArityError(e,t,v,o))}else{gi.add(getArgumentArityError(e,n,x,o))}}}return y;function addImplementationSuccessElaboration(e,t){var n,r;const i=f;const o=m;const a=_;const s=((r=(n=e.declaration)==null?void 0:n.symbol)==null?void 0:r.declarations)||d;const c=s.length>1;const l=c?find(s,(e=>isFunctionLikeDeclaration(e)&&nodeIsPresent(e.body))):void 0;if(l){const e=getSignatureFromDeclaration(l);const n=!e.typeParameters;if(chooseOverload([e],bi,n)){addRelatedInfo(t,createDiagnosticForNode(l,wt.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible))}}f=i;m=o;_=a}function chooseOverload(t,n,r,i=false){var o,a;f=void 0;m=void 0;_=void 0;if(r){const r=t[0];if(some(v)||!hasCorrectArity(e,x,r,i)){return void 0}if(getSignatureApplicabilityError(e,x,r,n,0,false,void 0,void 0)){f=[r];return void 0}return r}for(let r=0;re===n))){s=getImplementationSignature(s)}let r;if(some(v)){r=checkTypeArguments(s,v,false);if(!r){_=s;continue}}else{l=createInferenceContext(s.typeParameters,s,isInJSFile(e)?2:0);r=instantiateTypes(inferTypeArguments(e,s,x,h|8,l),l.nonFixingMapper);h|=l.flags&4?8:0}c=getSignatureInstantiation(s,r,isInJSFile(s.declaration),l&&l.inferredTypeParameters);if(getNonArrayRestType(s)&&!hasCorrectArity(e,x,c,i)){m=c;continue}}else{c=s}if(getSignatureApplicabilityError(e,x,c,n,h,false,void 0,l)){(f||(f=[])).push(c);continue}if(h){h=0;if(l){const t=instantiateTypes(inferTypeArguments(e,s,x,h,l),l.mapper);c=getSignatureInstantiation(s,t,isInJSFile(s.declaration),l.inferredTypeParameters);if(getNonArrayRestType(s)&&!hasCorrectArity(e,x,c,i)){m=c;continue}}if(getSignatureApplicabilityError(e,x,c,n,h,false,void 0,l)){(f||(f=[])).push(c);continue}}t[r]=c;return c}return void 0}}function getCandidateForOverloadFailure(e,t,n,r,i){S.assert(t.length>0);checkNodeDeferred(e);return r||t.length===1||t.some((e=>!!e.typeParameters))?pickLongestCandidateSignature(e,t,n,i):createUnionOfSignaturesForOverloadFailure(t)}function createUnionOfSignaturesForOverloadFailure(e){const t=mapDefined(e,(e=>e.thisParameter));let n;if(t.length){n=createCombinedSymbolFromTypes(t,t.map(getTypeOfParameter))}const{min:r,max:i}=minAndMax(e,getNumNonRestParameters);const o=[];for(let t=0;tsignatureHasRestParameter(e)?ttryGetTypeAtPosition(e,t)))))}const a=mapDefined(e,(e=>signatureHasRestParameter(e)?last(e.parameters):void 0));let s=128;if(a.length!==0){const t=createArrayType(getUnionType(mapDefined(e,tryGetRestTypeOfSignature),2));o.push(createCombinedSymbolForOverloadFailure(a,t));s|=1}if(e.some(signatureHasLiteralTypes)){s|=2}return createSignature(e[0].declaration,void 0,n,o,getIntersectionType(e.map(getReturnTypeOfSignature)),void 0,r,s)}function getNumNonRestParameters(e){const t=e.parameters.length;return signatureHasRestParameter(e)?t-1:t}function createCombinedSymbolFromTypes(e,t){return createCombinedSymbolForOverloadFailure(e,getUnionType(t,2))}function createCombinedSymbolForOverloadFailure(e,t){return createSymbolWithType(first(e),t)}function pickLongestCandidateSignature(e,t,n,r){const i=getLongestCandidateIndex(t,Q===void 0?n.length:Q);const o=t[i];const{typeParameters:a}=o;if(!a){return o}const s=callLikeExpressionMayHaveTypeArguments(e)?e.typeArguments:void 0;const c=s?createSignatureInstantiation(o,getTypeArgumentsFromNodes(s,a,isInJSFile(e))):inferSignatureInstantiationForOverloadFailure(e,a,o,n,r);t[i]=c;return c}function getTypeArgumentsFromNodes(e,t,n){const r=e.map(getTypeOfNode);while(r.length>t.length){r.pop()}while(r.length=t){return i}if(a>r){r=a;n=i}}return n}function resolveCallExpression(e,t,n){if(e.expression.kind===108){const r=checkSuperExpression(e.expression);if(isTypeAny(r)){for(const t of e.arguments){checkExpression(t)}return Rt}if(!isErrorType(r)){const i=getEffectiveBaseTypeNode(getContainingClass(e));if(i){const o=getInstantiatedConstructorsForTypeArguments(r,i.typeArguments,i);return resolveCall(e,o,t,n,0)}}return resolveUntypedCall(e)}let r;let i=checkExpression(e.expression);if(isCallChain(e)){const t=getOptionalExpressionType(i,e.expression);r=t===i?0:isOutermostOptionalChain(e)?16:8;i=t}else{r=0}i=checkNonNullTypeWithReporter(i,e.expression,reportCannotInvokePossiblyNullOrUndefinedError);if(i===tt){return Jt}const o=getApparentType(i);if(isErrorType(o)){return resolveErrorCall(e)}const a=getSignaturesOfType(o,0);const s=getSignaturesOfType(o,1).length;if(isUntypedFunctionCall(i,o,a.length,s)){if(!isErrorType(i)&&e.typeArguments){error2(e,wt.Untyped_function_calls_may_not_accept_type_arguments)}return resolveUntypedCall(e)}if(!a.length){if(s){error2(e,wt.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,typeToString(i))}else{let t;if(e.arguments.length===1){const n=getSourceFileOfNode(e).text;if(isLineBreak(n.charCodeAt(skipTrivia(n,e.expression.end,true)-1))){t=createDiagnosticForNode(e.expression,wt.Are_you_missing_a_semicolon)}}invocationError(e.expression,o,0,t)}return resolveErrorCall(e)}if(n&8&&!e.typeArguments&&a.some(isGenericFunctionReturningFunction)){skippedGenericFunction(e,n);return jt}if(a.some((e=>isInJSFile(e.declaration)&&!!getJSDocClassTag(e.declaration)))){error2(e,wt.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,typeToString(i));return resolveErrorCall(e)}return resolveCall(e,a,t,n,r)}function isGenericFunctionReturningFunction(e){return!!(e.typeParameters&&isFunctionType(getReturnTypeOfSignature(e)))}function isUntypedFunctionCall(e,t,n,r){return isTypeAny(e)||isTypeAny(t)&&!!(e.flags&262144)||!n&&!r&&!(t.flags&1048576)&&!(getReducedType(t).flags&131072)&&isTypeAssignableTo(e,tn)}function resolveNewExpression(e,t,n){let r=checkNonNullExpression(e.expression);if(r===tt){return Jt}r=getApparentType(r);if(isErrorType(r)){return resolveErrorCall(e)}if(isTypeAny(r)){if(e.typeArguments){error2(e,wt.Untyped_function_calls_may_not_accept_type_arguments)}return resolveUntypedCall(e)}const i=getSignaturesOfType(r,1);if(i.length){if(!isConstructorAccessible(e,i[0])){return resolveErrorCall(e)}if(someSignature(i,(e=>!!(e.flags&4)))){error2(e,wt.Cannot_create_an_instance_of_an_abstract_class);return resolveErrorCall(e)}const o=r.symbol&&getClassLikeDeclarationOfSymbol(r.symbol);if(o&&hasSyntacticModifier(o,64)){error2(e,wt.Cannot_create_an_instance_of_an_abstract_class);return resolveErrorCall(e)}return resolveCall(e,i,t,n,0)}const o=getSignaturesOfType(r,0);if(o.length){const r=resolveCall(e,o,t,n,0);if(!A){if(r.declaration&&!isJSConstructor(r.declaration)&&getReturnTypeOfSignature(r)!==Ze){error2(e,wt.Only_a_void_function_can_be_called_with_the_new_keyword)}if(getThisTypeOfSignature(r)===Ze){error2(e,wt.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void)}}return r}invocationError(e.expression,r,1);return resolveErrorCall(e)}function someSignature(e,t){if(isArray(e)){return some(e,(e=>someSignature(e,t)))}return e.compositeKind===1048576?some(e.compositeSignatures,t):t(e)}function typeHasProtectedAccessibleBase(e,t){const n=getBaseTypes(t);if(!length(n)){return false}const r=n[0];if(r.flags&2097152){const t=r.types;const n=findMixins(t);let i=0;for(const t of r.types){if(!n[i]){if(getObjectFlags(t)&(1|2)){if(t.symbol===e){return true}if(typeHasProtectedAccessibleBase(e,t)){return true}}}i++}return false}if(r.symbol===e){return true}return typeHasProtectedAccessibleBase(e,r)}function isConstructorAccessible(e,t){if(!t||!t.declaration){return true}const n=t.declaration;const r=getSelectedEffectiveModifierFlags(n,6);if(!r||n.kind!==176){return true}const i=getClassLikeDeclarationOfSymbol(n.parent.symbol);const o=getDeclaredTypeOfSymbol(n.parent.symbol);if(!isNodeWithinClass(e,i)){const t=getContainingClass(e);if(t&&r&4){const e=getTypeOfNode(t);if(typeHasProtectedAccessibleBase(n.parent.symbol,e)){return true}}if(r&2){error2(e,wt.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,typeToString(o))}if(r&4){error2(e,wt.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,typeToString(o))}return false}return true}function invocationErrorDetails(e,t,n){let r;const i=n===0;const o=getAwaitedType(t);const a=o&&getSignaturesOfType(o,n).length>0;if(t.flags&1048576){const e=t.types;let o=false;for(const a of e){const e=getSignaturesOfType(a,n);if(e.length!==0){o=true;if(r){break}}else{if(!r){r=chainDiagnosticMessages(r,i?wt.Type_0_has_no_call_signatures:wt.Type_0_has_no_construct_signatures,typeToString(a));r=chainDiagnosticMessages(r,i?wt.Not_all_constituents_of_type_0_are_callable:wt.Not_all_constituents_of_type_0_are_constructable,typeToString(t))}if(o){break}}}if(!o){r=chainDiagnosticMessages(void 0,i?wt.No_constituent_of_type_0_is_callable:wt.No_constituent_of_type_0_is_constructable,typeToString(t))}if(!r){r=chainDiagnosticMessages(r,i?wt.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:wt.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other,typeToString(t))}}else{r=chainDiagnosticMessages(r,i?wt.Type_0_has_no_call_signatures:wt.Type_0_has_no_construct_signatures,typeToString(t))}let s=i?wt.This_expression_is_not_callable:wt.This_expression_is_not_constructable;if(isCallExpression(e.parent)&&e.parent.arguments.length===0){const{resolvedSymbol:t}=getNodeLinks(e);if(t&&t.flags&32768){s=wt.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without}}return{messageChain:chainDiagnosticMessages(r,s),relatedMessage:a?wt.Did_you_forget_to_use_await:void 0}}function invocationError(e,t,n,r){const{messageChain:i,relatedMessage:o}=invocationErrorDetails(e,t,n);const a=createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(e),e,i);if(o){addRelatedInfo(a,createDiagnosticForNode(e,o))}if(isCallExpression(e.parent)){const{start:t,length:n}=getDiagnosticSpanForCallNode(e.parent);a.start=t;a.length=n}gi.add(a);invocationErrorRecovery(t,n,r?addRelatedInfo(a,r):a)}function invocationErrorRecovery(e,t,n){if(!e.symbol){return}const r=getSymbolLinks(e.symbol).originatingImport;if(r&&!isImportCall(r)){const i=getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(e.symbol).target),t);if(!i||!i.length)return;addRelatedInfo(n,createDiagnosticForNode(r,wt.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead))}}function resolveTaggedTemplateExpression(e,t,n){const r=checkExpression(e.tag);const i=getApparentType(r);if(isErrorType(i)){return resolveErrorCall(e)}const o=getSignaturesOfType(i,0);const a=getSignaturesOfType(i,1).length;if(isUntypedFunctionCall(r,i,o.length,a)){return resolveUntypedCall(e)}if(!o.length){if(isArrayLiteralExpression(e.parent)){const t=createDiagnosticForNode(e.tag,wt.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked);gi.add(t);return resolveErrorCall(e)}invocationError(e.tag,i,0);return resolveErrorCall(e)}return resolveCall(e,o,t,n,0)}function getDiagnosticHeadMessageForDecoratorResolution(e){switch(e.parent.kind){case 263:case 231:return wt.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;case 169:return wt.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;case 172:return wt.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;case 174:case 177:case 178:return wt.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;default:return S.fail()}}function resolveDecorator(e,t,n){const r=checkExpression(e.expression);const i=getApparentType(r);if(isErrorType(i)){return resolveErrorCall(e)}const o=getSignaturesOfType(i,0);const a=getSignaturesOfType(i,1).length;if(isUntypedFunctionCall(r,i,o.length,a)){return resolveUntypedCall(e)}if(isPotentiallyUncalledDecorator(e,o)&&!isParenthesizedExpression(e.expression)){const t=getTextOfNode(e.expression,false);error2(e,wt._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0,t);return resolveErrorCall(e)}const s=getDiagnosticHeadMessageForDecoratorResolution(e);if(!o.length){const t=invocationErrorDetails(e.expression,i,0);const n=chainDiagnosticMessages(t.messageChain,s);const r=createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(e.expression),e.expression,n);if(t.relatedMessage){addRelatedInfo(r,createDiagnosticForNode(e.expression,t.relatedMessage))}gi.add(r);invocationErrorRecovery(i,0,r);return resolveErrorCall(e)}return resolveCall(e,o,t,n,0,s)}function createSignatureForJSXIntrinsic(e,t){const n=getJsxNamespaceAt(e);const r=n&&getExportsOfSymbol(n);const i=r&&getSymbol2(r,la.Element,788968);const o=i&&j.symbolToEntityName(i,788968,e);const a=zr.createFunctionTypeNode(void 0,[zr.createParameterDeclaration(void 0,void 0,"props",void 0,j.typeToTypeNode(t,e))],o?zr.createTypeReferenceNode(o,void 0):zr.createKeywordTypeNode(133));const s=createSymbol(1,"props");s.links.type=t;return createSignature(a,void 0,void 0,[s],i?getDeclaredTypeOfSymbol(i):Ie,void 0,1,0)}function getJSXFragmentType(e){const t=getNodeLinks(getSourceFileOfNode(e));if(t.jsxFragmentType!==void 0)return t.jsxFragmentType;const n=getJsxNamespace(e);const r=(T.jsx===2||T.jsxFragmentFactory!==void 0)&&n!=="null";if(!r)return t.jsxFragmentType=ke;const i=T.jsx!==1&&T.jsx!==3;const o=gi?wt.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found:void 0;const a=getJsxNamespaceContainerForImplicitImport(e)??te(e,n,i?111551:111551&~384,o,true);if(a===void 0)return t.jsxFragmentType=Ie;if(a.escapedName===da.Fragment)return t.jsxFragmentType=getTypeOfSymbol(a);const s=(a.flags&2097152)===0?a:resolveAlias(a);const c=a&&getExportsOfSymbol(s);const l=c&&getSymbol2(c,da.Fragment,2);const d=l&&getTypeOfSymbol(l);return t.jsxFragmentType=d===void 0?Ie:d}function resolveJsxOpeningLikeElement(e,t,n){const r=isJsxOpeningFragment(e);let i;if(!r){if(isJsxIntrinsicTagName(e.tagName)){const t=getIntrinsicAttributesTypeFromJsxOpeningLikeElement(e);const n=createSignatureForJSXIntrinsic(e,t);checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(e.attributes,getEffectiveFirstArgumentForJsxSignature(n,e),void 0,0),t,e.tagName,e.attributes);if(length(e.typeArguments)){forEach(e.typeArguments,checkSourceElement);gi.add(createDiagnosticForNodeArray(getSourceFileOfNode(e),e.typeArguments,wt.Expected_0_type_arguments_but_got_1,0,length(e.typeArguments)))}return n}i=checkExpression(e.tagName)}else{i=getJSXFragmentType(e)}const o=getApparentType(i);if(isErrorType(o)){return resolveErrorCall(e)}const a=getUninstantiatedJsxSignaturesOfType(i,e);if(isUntypedFunctionCall(i,o,a.length,0)){return resolveUntypedCall(e)}if(a.length===0){if(r){error2(e,wt.JSX_element_type_0_does_not_have_any_construct_or_call_signatures,getTextOfNode(e))}else{error2(e.tagName,wt.JSX_element_type_0_does_not_have_any_construct_or_call_signatures,getTextOfNode(e.tagName))}return resolveErrorCall(e)}return resolveCall(e,a,t,n,0)}function resolveInstanceofExpression(e,t,n){const r=checkExpression(e.right);if(!isTypeAny(r)){const i=getSymbolHasInstanceMethodOfObjectType(r);if(i){const r=getApparentType(i);if(isErrorType(r)){return resolveErrorCall(e)}const o=getSignaturesOfType(r,0);const a=getSignaturesOfType(r,1);if(isUntypedFunctionCall(i,r,o.length,a.length)){return resolveUntypedCall(e)}if(o.length){return resolveCall(e,o,t,n,0)}}else if(!(typeHasCallOrConstructSignatures(r)||isTypeSubtypeOf(r,tn))){error2(e.right,wt.The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method);return resolveErrorCall(e)}}return Rt}function isPotentiallyUncalledDecorator(e,t){return t.length&&every(t,(t=>t.minArgumentCount===0&&!signatureHasRestParameter(t)&&t.parameters.length1?checkExpressionCached(e.arguments[1]):void 0;for(let t=2;t{const e=getWidenedType(i);if(!isTypeComparableTo(o,e)){checkTypeComparableTo(i,o,n,wt.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first)}}))}}function checkNonNullChain(e){const t=checkExpression(e.expression);const n=getOptionalExpressionType(t,e.expression);return propagateOptionalTypeMarker(getNonNullableType(n),e,n!==t)}function checkNonNullAssertion(e){return e.flags&64?checkNonNullChain(e):getNonNullableType(checkExpression(e.expression))}function checkExpressionWithTypeArguments(e){checkGrammarExpressionWithTypeArguments(e);forEach(e.typeArguments,checkSourceElement);if(e.kind===233){const t=walkUpParenthesizedExpressions(e.parent);if(t.kind===226&&t.operatorToken.kind===104&&isNodeDescendantOf(e,t.right)){error2(e,wt.The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression)}}const t=e.kind===233?checkExpression(e.expression):isThisIdentifier(e.exprName)?checkThisExpression(e.exprName):checkExpression(e.exprName);return getInstantiationExpressionType(t,e)}function getInstantiationExpressionType(e,t){const n=t.typeArguments;if(e===tt||isErrorType(e)||!some(n)){return e}const r=getNodeLinks(t);if(!r.instantiationExpressionTypes){r.instantiationExpressionTypes=new Map}if(r.instantiationExpressionTypes.has(e.id)){return r.instantiationExpressionTypes.get(e.id)}let i=false;let o;const a=getInstantiatedType(e);r.instantiationExpressionTypes.set(e.id,a);const s=i?o:e;if(s){gi.add(createDiagnosticForNodeArray(getSourceFileOfNode(t),n,wt.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable,typeToString(s)))}return a;function getInstantiatedType(e){let n=false;let r=false;const a=getInstantiatedTypePart(e);i||(i=r);if(n&&!r){o??(o=e)}return a;function getInstantiatedTypePart(e){if(e.flags&524288){const i=resolveStructuredTypeMembers(e);const o=getInstantiatedSignatures(i.callSignatures);const a=getInstantiatedSignatures(i.constructSignatures);n||(n=i.callSignatures.length!==0||i.constructSignatures.length!==0);r||(r=o.length!==0||a.length!==0);if(o!==i.callSignatures||a!==i.constructSignatures){const e=createAnonymousType(createSymbol(0,"__instantiationExpression"),i.members,o,a,i.indexInfos);e.objectFlags|=8388608;e.node=t;return e}}else if(e.flags&58982400){const t=getBaseConstraintOfType(e);if(t){const e=getInstantiatedTypePart(t);if(e!==t){return e}}}else if(e.flags&1048576){return mapType(e,getInstantiatedType)}else if(e.flags&2097152){return getIntersectionType(sameMap(e.types,getInstantiatedTypePart))}return e}}function getInstantiatedSignatures(e){const t=filter(e,(e=>!!e.typeParameters&&hasCorrectTypeArgumentArity(e,n)));return sameMap(t,(e=>{const t=checkTypeArguments(e,n,true);return t?getSignatureInstantiation(e,t,isInJSFile(e.declaration)):e}))}}function checkSatisfiesExpression(e){checkSourceElement(e.type);return checkSatisfiesExpressionWorker(e.expression,e.type)}function checkSatisfiesExpressionWorker(e,t,n){const r=checkExpression(e,n);const i=getTypeFromTypeNode(t);if(isErrorType(i)){return i}const o=findAncestor(t.parent,(e=>e.kind===238||e.kind===350));checkTypeAssignableToAndOptionallyElaborate(r,i,o,e,wt.Type_0_does_not_satisfy_the_expected_type_1);return r}function checkMetaProperty(e){checkGrammarMetaProperty(e);if(e.keywordToken===105){return checkNewTargetMetaProperty(e)}if(e.keywordToken===102){return checkImportMetaProperty(e)}return S.assertNever(e.keywordToken)}function checkMetaPropertyKeyword(e){switch(e.keywordToken){case 102:return getGlobalImportMetaExpressionType();case 105:const t=checkNewTargetMetaProperty(e);return isErrorType(t)?Ie:createNewTargetExpressionType(t);default:S.assertNever(e.keywordToken)}}function checkNewTargetMetaProperty(e){const t=getNewTargetContainer(e);if(!t){error2(e,wt.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor,"new.target");return Ie}else if(t.kind===176){const e=getSymbolOfDeclaration(t.parent);return getTypeOfSymbol(e)}else{const e=getSymbolOfDeclaration(t);return getTypeOfSymbol(e)}}function checkImportMetaProperty(e){if(100<=x&&x<=199){if(getSourceFileOfNode(e).impliedNodeFormat!==99){error2(e,wt.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output)}}else if(x<6&&x!==4){error2(e,wt.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext)}const t=getSourceFileOfNode(e);S.assert(!!(t.flags&8388608),"Containing file is missing import meta node flag.");return e.name.escapedText==="meta"?getGlobalImportMetaType():Ie}function getTypeOfParameter(e){const t=e.valueDeclaration;return addOptionality(getTypeOfSymbol(e),false,!!t&&(hasInitializer(t)||isOptionalDeclaration(t)))}function getTupleElementLabelFromBindingElement(e,t,n){switch(e.name.kind){case 80:{const r=e.name.escapedText;if(e.dotDotDotToken){return n&12?r:`${r}_${t}`}else{return n&3?r:`${r}_n`}}case 207:{if(e.dotDotDotToken){const r=e.name.elements;const i=tryCast(lastOrUndefined(r),isBindingElement);const o=r.length-((i==null?void 0:i.dotDotDotToken)?1:0);if(t=r-1){return t===r-1?o:createArrayType(getIndexedAccessType(o,Ve))}const a=[];const s=[];const c=[];for(let n=t;n!(e&1)));const i=r<0?n.target.fixedLength:r;if(i>0){t=e.parameters.length-1+i}}}if(t===void 0){if(!n&&e.flags&32){return 0}t=e.minArgumentCount}if(r){return t}for(let n=t-1;n>=0;n--){const r=getTypeAtPosition(e,n);if(filterType(r,acceptsVoid).flags&131072){break}t=n}e.resolvedMinArgumentCount=t}return e.resolvedMinArgumentCount}function hasEffectiveRestParameter(e){if(signatureHasRestParameter(e)){const t=getTypeOfSymbol(e.parameters[e.parameters.length-1]);return!isTupleType(t)||!!(t.target.combinedFlags&12)}return false}function getEffectiveRestType(e){if(signatureHasRestParameter(e)){const t=getTypeOfSymbol(e.parameters[e.parameters.length-1]);if(!isTupleType(t)){return isTypeAny(t)?yn:t}if(t.target.combinedFlags&12){return sliceTupleType(t,t.target.fixedLength)}}return void 0}function getNonArrayRestType(e){const t=getEffectiveRestType(e);return t&&!isArrayType(t)&&!isTypeAny(t)?t:void 0}function getTypeOfFirstParameterOfSignature(e){return getTypeOfFirstParameterOfSignatureWithFallback(e,et)}function getTypeOfFirstParameterOfSignatureWithFallback(e,t){return e.parameters.length>0?getTypeAtPosition(e,0):t}function inferFromAnnotatedParameters(e,t,n){const r=e.parameters.length-(signatureHasRestParameter(e)?1:0);for(let i=0;i=0);const i=isConstructorDeclaration(e.parent)?getTypeOfSymbol(getSymbolOfDeclaration(e.parent.parent)):getParentTypeOfClassElement(e.parent);const o=isConstructorDeclaration(e.parent)?Me:getClassElementPropertyKeyType(e.parent);const a=getNumberLiteralType(r);const s=createParameter2("target",i);const c=createParameter2("propertyKey",o);const l=createParameter2("parameterIndex",a);n.decoratorSignature=createCallSignature(void 0,void 0,[s,c,l],Ze);break}case 174:case 177:case 178:case 172:{const e=t;if(!isClassLike(e.parent))break;const r=getParentTypeOfClassElement(e);const i=createParameter2("target",r);const o=getClassElementPropertyKeyType(e);const a=createParameter2("propertyKey",o);const s=isPropertyDeclaration(e)?Ze:createTypedPropertyDescriptorType(getTypeOfNode(e));const c=!isPropertyDeclaration(t)||hasAccessorModifier(t);if(c){const t=createTypedPropertyDescriptorType(getTypeOfNode(e));const r=createParameter2("descriptor",t);n.decoratorSignature=createCallSignature(void 0,void 0,[i,a,r],getUnionType([s,Ze]))}else{n.decoratorSignature=createCallSignature(void 0,void 0,[i,a],getUnionType([s,Ze]))}break}}}return n.decoratorSignature===Rt?void 0:n.decoratorSignature}function getDecoratorCallSignature(e){return b?getLegacyDecoratorCallSignature(e):getESDecoratorCallSignature(e)}function createPromiseType(e){const t=getGlobalPromiseType(true);if(t!==Et){e=getAwaitedTypeNoAlias(unwrapAwaitedType(e))||Le;return createTypeReference(t,[e])}return Le}function createPromiseLikeType(e){const t=getGlobalPromiseLikeType(true);if(t!==Et){e=getAwaitedTypeNoAlias(unwrapAwaitedType(e))||Le;return createTypeReference(t,[e])}return Le}function createPromiseReturnType(e,t){const n=createPromiseType(t);if(n===Le){error2(e,isImportCall(e)?wt.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:wt.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option);return Ie}else if(!getGlobalPromiseConstructorSymbol(true)){error2(e,isImportCall(e)?wt.A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:wt.An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option)}return n}function createNewTargetExpressionType(e){const t=createSymbol(0,"NewTargetExpression");const n=createSymbol(4,"target",8);n.parent=t;n.links.type=e;const r=createSymbolTable([n]);t.members=r;return createAnonymousType(t,r,d,d,d)}function getReturnTypeFromBody(e,t){if(!e.body){return Ie}const n=getFunctionFlags(e);const r=(n&2)!==0;const i=(n&1)!==0;let o;let a;let s;let c=Ze;if(e.body.kind!==241){o=checkExpressionCached(e.body,t&&t&~8);if(r){o=unwrapAwaitedType(checkAwaitedType(o,false,e,wt.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member))}}else if(i){const n=checkAndAggregateReturnExpressionTypes(e,t);if(!n){c=et}else if(n.length>0){o=getUnionType(n,2)}const{yieldTypes:r,nextTypes:i}=checkAndAggregateYieldOperandTypes(e,t);a=some(r)?getUnionType(r,2):void 0;s=some(i)?getIntersectionType(i):void 0}else{const r=checkAndAggregateReturnExpressionTypes(e,t);if(!r){return n&2?createPromiseReturnType(e,et):et}if(r.length===0){const t=getContextualReturnType(e,void 0);const r=t&&(unwrapReturnType(t,n)||Ze).flags&32768?Me:Ze;return n&2?createPromiseReturnType(e,r):r}o=getUnionType(r,2)}if(o||a||s){if(a)reportErrorsFromWidening(e,a,3);if(o)reportErrorsFromWidening(e,o,1);if(s)reportErrorsFromWidening(e,s,2);if(o&&isUnitType(o)||a&&isUnitType(a)||s&&isUnitType(s)){const t=getContextualSignatureForFunctionLikeDeclaration(e);const n=!t?void 0:t===getSignatureFromDeclaration(e)?i?void 0:o:instantiateContextualType(getReturnTypeOfSignature(t),e,void 0);if(i){a=getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(a,n,0,r);o=getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(o,n,1,r);s=getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(s,n,2,r)}else{o=getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(o,n,r)}}if(a)a=getWidenedType(a);if(o)o=getWidenedType(o);if(s)s=getWidenedType(s)}if(i){return createGeneratorType(a||et,o||c,s||getContextualIterationType(2,e)||Le,r)}else{return r?createPromiseType(o||c):o||c}}function createGeneratorType(e,t,n,r){const i=r?Ht:Gt;const o=i.getGlobalGeneratorType(false);e=i.resolveIterationType(e,void 0)||Le;t=i.resolveIterationType(t,void 0)||Le;if(o===Et){const r=i.getGlobalIterableIteratorType(false);if(r!==Et){return createTypeFromGenericGlobalType(r,[e,t,n])}i.getGlobalIterableIteratorType(true);return ht}return createTypeFromGenericGlobalType(o,[e,t,n])}function checkAndAggregateYieldOperandTypes(e,t){const n=[];const r=[];const i=(getFunctionFlags(e)&2)!==0;forEachYieldExpression(e.body,(e=>{const o=e.expression?checkExpression(e.expression,t):Re;pushIfUnique(n,getYieldedTypeOfYieldExpression(e,o,ke,i));let a;if(e.asteriskToken){const t=getIterationTypesOfIterable(o,i?19:17,e.expression);a=t&&t.nextType}else{a=getContextualType2(e,void 0)}if(a)pushIfUnique(r,a)}));return{yieldTypes:n,nextTypes:r}}function getYieldedTypeOfYieldExpression(e,t,n,r){const i=e.expression||e;const o=e.asteriskToken?checkIteratedTypeOrElementType(r?19:17,t,n,i):t;return!r?o:getAwaitedType(o,i,e.asteriskToken?wt.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:wt.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)}function getNotEqualFactsFromTypeofSwitch(e,t,n){let r=0;for(let i=0;i=t?n[i]:void 0;r|=o!==void 0?ra.get(o)||32768:0}return r}function isExhaustiveSwitchStatement(e){const t=getNodeLinks(e);if(t.isExhaustive===void 0){t.isExhaustive=0;const n=computeExhaustiveSwitchStatement(e);if(t.isExhaustive===0){t.isExhaustive=n}}else if(t.isExhaustive===0){t.isExhaustive=false}return t.isExhaustive}function computeExhaustiveSwitchStatement(e){if(e.expression.kind===221){const t=getSwitchClauseTypeOfWitnesses(e);if(!t){return false}const n=getBaseConstraintOrType(checkExpressionCached(e.expression.expression));const r=getNotEqualFactsFromTypeofSwitch(0,0,t);if(n.flags&3){return(556800&r)===556800}return!someType(n,(e=>getTypeFacts(e,r)===r))}const t=getBaseConstraintOrType(checkExpressionCached(e.expression));if(!isLiteralType(t)){return false}const n=getSwitchClauseTypes(e);if(!n.length||some(n,isNeitherUnitTypeNorNever)){return false}return eachTypeContainedIn(mapType(t,getRegularTypeOfLiteralType),n)}function functionHasImplicitReturn(e){return e.endFlowNode&&isReachableFlowNode(e.endFlowNode)}function checkAndAggregateReturnExpressionTypes(e,t){const n=getFunctionFlags(e);const r=[];let i=functionHasImplicitReturn(e);let o=false;forEachReturnStatement(e.body,(a=>{let s=a.expression;if(s){s=skipParentheses(s,true);if(n&2&&s.kind===223){s=skipParentheses(s.expression,true)}if(s.kind===213&&s.expression.kind===80&&checkExpressionCached(s.expression).symbol===getMergedSymbol(e.symbol)&&(!isFunctionExpressionOrArrowFunction(e.symbol.valueDeclaration)||isConstantReference(s.expression))){o=true;return}let i=checkExpressionCached(s,t&&t&~8);if(n&2){i=unwrapAwaitedType(checkAwaitedType(i,false,e,wt.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member))}if(i.flags&131072){o=true}pushIfUnique(r,i)}else{i=true}}));if(r.length===0&&!i&&(o||mayReturnNever(e))){return void 0}if(k&&r.length&&i&&!(isJSConstructor(e)&&r.some((t=>t.symbol===e.symbol)))){pushIfUnique(r,Me)}return r}function mayReturnNever(e){switch(e.kind){case 218:case 219:return true;case 174:return e.parent.kind===210;default:return false}}function getTypePredicateFromBody(e){switch(e.kind){case 176:case 177:case 178:return void 0}const t=getFunctionFlags(e);if(t!==0)return void 0;let n;if(e.body&&e.body.kind!==241){n=e.body}else{const t=forEachReturnStatement(e.body,(e=>{if(n||!e.expression)return true;n=e.expression}));if(t||!n||functionHasImplicitReturn(e))return void 0}return checkIfExpressionRefinesAnyParameter(e,n)}function checkIfExpressionRefinesAnyParameter(e,t){t=skipParentheses(t,true);const n=checkExpressionCached(t);if(!(n.flags&16))return void 0;return forEach(e.parameters,((n,r)=>{const i=getTypeOfSymbol(n.symbol);if(!i||i.flags&16||!isIdentifier(n.name)||isSymbolAssigned(n.symbol)||isRestParameter(n)){return}const o=checkIfExpressionRefinesParameter(e,t,n,i);if(o){return createTypePredicate(1,unescapeLeadingUnderscores(n.name.escapedText),r,o)}}))}function checkIfExpressionRefinesParameter(e,t,n,r){const i=canHaveFlowNode(t)&&t.flowNode||t.parent.kind===253&&t.parent.flowNode||createFlowNode(2,void 0,void 0);const o=createFlowNode(32,t,i);const a=getFlowTypeOfReference(n.name,r,r,e,o);if(a===r)return void 0;const s=createFlowNode(64,t,i);const c=getFlowTypeOfReference(n.name,r,a,e,s);return c.flags&131072?a:void 0}function checkAllCodePathsInNonVoidFunctionReturnOrThrow(e,t){addLazyDiagnostic(checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics);return;function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics(){const n=getFunctionFlags(e);const r=t&&unwrapReturnType(t,n);if(r&&(maybeTypeOfKind(r,16384)||r.flags&(1|32768))){return}if(e.kind===173||nodeIsMissing(e.body)||e.body.kind!==241||!functionHasImplicitReturn(e)){return}const i=e.flags&1024;const o=getEffectiveReturnTypeNode(e)||e;if(r&&r.flags&131072){error2(o,wt.A_function_returning_never_cannot_have_a_reachable_end_point)}else if(r&&!i){error2(o,wt.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value)}else if(r&&k&&!isTypeAssignableTo(Me,r)){error2(o,wt.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined)}else if(T.noImplicitReturns){if(!r){if(!i){return}const t=getReturnTypeOfSignature(getSignatureFromDeclaration(e));if(isUnwrappedReturnTypeUndefinedVoidOrAny(e,t)){return}}error2(o,wt.Not_all_code_paths_return_a_value)}}}function checkFunctionExpressionOrObjectLiteralMethod(e,t){S.assert(e.kind!==174||isObjectLiteralMethod(e));checkNodeDeferred(e);if(isFunctionExpression(e)){checkCollisionsForDeclarationName(e,e.name)}if(t&&t&4&&isContextSensitive(e)){if(!getEffectiveReturnTypeNode(e)&&!hasContextSensitiveParameters(e)){const n=getContextualSignature(e);if(n&&couldContainTypeVariables(getReturnTypeOfSignature(n))){const n=getNodeLinks(e);if(n.contextFreeType){return n.contextFreeType}const r=getReturnTypeFromBody(e,t);const i=createSignature(void 0,void 0,void 0,d,r,void 0,0,64);const o=createAnonymousType(e.symbol,y,[i],d,d);o.objectFlags|=262144;return n.contextFreeType=o}}return Nt}const n=checkGrammarFunctionLikeDeclaration(e);if(!n&&e.kind===218){checkGrammarForGenerator(e)}contextuallyCheckFunctionExpressionOrObjectLiteralMethod(e,t);return getTypeOfSymbol(getSymbolOfDeclaration(e))}function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(e,t){const n=getNodeLinks(e);if(!(n.flags&64)){const r=getContextualSignature(e);if(!(n.flags&64)){n.flags|=64;const i=firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfDeclaration(e)),0));if(!i){return}if(isContextSensitive(e)){if(r){const n=getInferenceContext(e);let o;if(t&&t&2){inferFromAnnotatedParameters(i,r,n);const e=getEffectiveRestType(r);if(e&&e.flags&262144){o=instantiateSignature(r,n.nonFixingMapper)}}o||(o=n?instantiateSignature(r,n.mapper):r);assignContextualParameterTypes(i,o)}else{assignNonContextualParameterTypes(i)}}else if(r&&!e.typeParameters&&r.parameters.length>e.parameters.length){const n=getInferenceContext(e);if(t&&t&2){inferFromAnnotatedParameters(i,r,n)}}if(r&&!getReturnTypeFromAnnotation(e)&&!i.resolvedReturnType){const n=getReturnTypeFromBody(e,t);if(!i.resolvedReturnType){i.resolvedReturnType=n}}checkSignatureDeclaration(e)}}}function checkFunctionExpressionOrObjectLiteralMethodDeferred(e){S.assert(e.kind!==174||isObjectLiteralMethod(e));const t=getFunctionFlags(e);const n=getReturnTypeFromAnnotation(e);checkAllCodePathsInNonVoidFunctionReturnOrThrow(e,n);if(e.body){if(!getEffectiveReturnTypeNode(e)){getReturnTypeOfSignature(getSignatureFromDeclaration(e))}if(e.body.kind===241){checkSourceElement(e.body)}else{const r=checkExpression(e.body);const i=n&&unwrapReturnType(n,t);if(i){checkReturnExpression(e,i,e.body,e.body,r)}}}}function checkArithmeticOperandType(e,t,n,r=false){if(!isTypeAssignableTo(t,st)){const i=r&&getAwaitedTypeOfPromise(t);errorAndMaybeSuggestAwait(e,!!i&&isTypeAssignableTo(i,st),n);return false}return true}function isReadonlyAssignmentDeclaration(e){if(!isCallExpression(e)){return false}if(!isBindableObjectDefinePropertyCall(e)){return false}const t=checkExpressionCached(e.arguments[2]);const n=getTypeOfPropertyOfType(t,"value");if(n){const e=getPropertyOfType(t,"writable");const n=e&&getTypeOfSymbol(e);if(!n||n===He||n===Ge){return true}if(e&&e.valueDeclaration&&isPropertyAssignment(e.valueDeclaration)){const t=e.valueDeclaration.initializer;const n=checkExpression(t);if(n===He||n===Ge){return true}}return false}const r=getPropertyOfType(t,"set");return!r}function isReadonlySymbol(e){return!!(getCheckFlags(e)&8||e.flags&4&&getDeclarationModifierFlagsFromSymbol(e)&8||e.flags&3&&getDeclarationNodeFlagsFromSymbol(e)&6||e.flags&98304&&!(e.flags&65536)||e.flags&8||some(e.declarations,isReadonlyAssignmentDeclaration))}function isAssignmentToReadonlyEntity(e,t,n){var r,i;if(n===0){return false}if(isReadonlySymbol(t)){if(t.flags&4&&isAccessExpression(e)&&e.expression.kind===110){const n=getControlFlowContainer(e);if(!(n&&(n.kind===176||isJSConstructor(n)))){return true}if(t.valueDeclaration){const e=isBinaryExpression(t.valueDeclaration);const o=n.parent===t.valueDeclaration.parent;const a=n===t.valueDeclaration.parent;const s=e&&((r=t.parent)==null?void 0:r.valueDeclaration)===n.parent;const c=e&&((i=t.parent)==null?void 0:i.valueDeclaration)===n;const l=o||a||s||c;return!l}}return true}if(isAccessExpression(e)){const t=skipParentheses(e.expression);if(t.kind===80){const e=getNodeLinks(t).resolvedSymbol;if(e.flags&2097152){const t=getDeclarationOfAliasSymbol(e);return!!t&&t.kind===274}}}return false}function checkReferenceExpression(e,t,n){const r=skipOuterExpressions(e,38|1);if(r.kind!==80&&!isAccessExpression(r)){error2(e,t);return false}if(r.flags&64){error2(e,n);return false}return true}function checkDeleteExpression(e){checkExpression(e.expression);const t=skipParentheses(e.expression);if(!isAccessExpression(t)){error2(t,wt.The_operand_of_a_delete_operator_must_be_a_property_reference);return Xe}if(isPropertyAccessExpression(t)&&isPrivateIdentifier(t.name)){error2(t,wt.The_operand_of_a_delete_operator_cannot_be_a_private_identifier)}const n=getNodeLinks(t);const r=getExportSymbolOfValueSymbolIfExported(n.resolvedSymbol);if(r){if(isReadonlySymbol(r)){error2(t,wt.The_operand_of_a_delete_operator_cannot_be_a_read_only_property)}else{checkDeleteExpressionMustBeOptional(t,r)}}return Xe}function checkDeleteExpressionMustBeOptional(e,t){const n=getTypeOfSymbol(t);if(k&&!(n.flags&(3|131072))&&!(L?t.flags&16777216:hasTypeFacts(n,16777216))){error2(e,wt.The_operand_of_a_delete_operator_must_be_optional)}}function checkTypeOfExpression(e){checkExpression(e.expression);return hi}function checkVoidExpression(e){checkNodeDeferred(e);return Re}function checkAwaitGrammar(e){let t=false;const n=getContainingFunctionOrClassStaticBlock(e);if(n&&isClassStaticBlockDeclaration(n)){const n=isAwaitExpression(e)?wt.await_expression_cannot_be_used_inside_a_class_static_block:wt.await_using_statements_cannot_be_used_inside_a_class_static_block;error2(e,n);t=true}else if(!(e.flags&65536)){if(isInTopLevelContext(e)){const n=getSourceFileOfNode(e);if(!hasParseDiagnostics(n)){let r;if(!isEffectiveExternalModule(n,T)){r??(r=getSpanOfTokenAtPosition(n,e.pos));const i=isAwaitExpression(e)?wt.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:wt.await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module;const o=createFileDiagnostic(n,r.start,r.length,i);gi.add(o);t=true}switch(x){case 100:case 101:case 199:if(n.impliedNodeFormat===1){r??(r=getSpanOfTokenAtPosition(n,e.pos));gi.add(createFileDiagnostic(n,r.start,r.length,wt.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));t=true;break}case 7:case 99:case 200:case 4:if(v>=4){break}default:r??(r=getSpanOfTokenAtPosition(n,e.pos));const i=isAwaitExpression(e)?wt.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher:wt.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;gi.add(createFileDiagnostic(n,r.start,r.length,i));t=true;break}}}else{const r=getSourceFileOfNode(e);if(!hasParseDiagnostics(r)){const i=getSpanOfTokenAtPosition(r,e.pos);const o=isAwaitExpression(e)?wt.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:wt.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules;const a=createFileDiagnostic(r,i.start,i.length,o);if(n&&n.kind!==176&&(getFunctionFlags(n)&2)===0){const e=createDiagnosticForNode(n,wt.Did_you_mean_to_mark_this_function_as_async);addRelatedInfo(a,e)}gi.add(a);t=true}}}if(isAwaitExpression(e)&&isInParameterInitializerBeforeContainingFunction(e)){error2(e,wt.await_expressions_cannot_be_used_in_a_parameter_initializer);t=true}return t}function checkAwaitExpression(e){addLazyDiagnostic((()=>checkAwaitGrammar(e)));const t=checkExpression(e.expression);const n=checkAwaitedType(t,true,e,wt.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);if(n===t&&!isErrorType(n)&&!(t.flags&3)){addErrorOrSuggestion(false,createDiagnosticForNode(e,wt.await_has_no_effect_on_the_type_of_this_expression))}return n}function checkPrefixUnaryExpression(e){const t=checkExpression(e.operand);if(t===tt){return tt}switch(e.operand.kind){case 9:switch(e.operator){case 41:return getFreshTypeOfLiteralType(getNumberLiteralType(-e.operand.text));case 40:return getFreshTypeOfLiteralType(getNumberLiteralType(+e.operand.text))}break;case 10:if(e.operator===41){return getFreshTypeOfLiteralType(getBigIntLiteralType({negative:true,base10Value:parsePseudoBigInt(e.operand.text)}))}}switch(e.operator){case 40:case 41:case 55:checkNonNullType(t,e.operand);if(maybeTypeOfKindConsideringBaseConstraint(t,12288)){error2(e.operand,wt.The_0_operator_cannot_be_applied_to_type_symbol,tokenToString(e.operator))}if(e.operator===40){if(maybeTypeOfKindConsideringBaseConstraint(t,2112)){error2(e.operand,wt.Operator_0_cannot_be_applied_to_type_1,tokenToString(e.operator),typeToString(getBaseTypeOfLiteralType(t)))}return Ve}return getUnaryResultType(t);case 54:checkTruthinessOfType(t,e.operand);const n=getTypeFacts(t,4194304|8388608);return n===4194304?He:n===8388608?Ke:Xe;case 46:case 47:const r=checkArithmeticOperandType(e.operand,checkNonNullType(t,e.operand),wt.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type);if(r){checkReferenceExpression(e.operand,wt.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,wt.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access)}return getUnaryResultType(t)}return Ie}function checkPostfixUnaryExpression(e){const t=checkExpression(e.operand);if(t===tt){return tt}const n=checkArithmeticOperandType(e.operand,checkNonNullType(t,e.operand),wt.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type);if(n){checkReferenceExpression(e.operand,wt.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,wt.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access)}return getUnaryResultType(t)}function getUnaryResultType(e){if(maybeTypeOfKind(e,2112)){return isTypeAssignableToKind(e,3)||maybeTypeOfKind(e,296)?st:qe}return Ve}function maybeTypeOfKindConsideringBaseConstraint(e,t){if(maybeTypeOfKind(e,t)){return true}const n=getBaseConstraintOrType(e);return!!n&&maybeTypeOfKind(n,t)}function maybeTypeOfKind(e,t){if(e.flags&t){return true}if(e.flags&3145728){const n=e.types;for(const e of n){if(maybeTypeOfKind(e,t)){return true}}}return false}function isTypeAssignableToKind(e,t,n){if(e.flags&t){return true}if(n&&e.flags&(3|16384|32768|65536)){return false}return!!(t&296)&&isTypeAssignableTo(e,Ve)||!!(t&2112)&&isTypeAssignableTo(e,qe)||!!(t&402653316)&&isTypeAssignableTo(e,ze)||!!(t&528)&&isTypeAssignableTo(e,Xe)||!!(t&16384)&&isTypeAssignableTo(e,Ze)||!!(t&131072)&&isTypeAssignableTo(e,et)||!!(t&65536)&&isTypeAssignableTo(e,We)||!!(t&32768)&&isTypeAssignableTo(e,Me)||!!(t&4096)&&isTypeAssignableTo(e,Ye)||!!(t&67108864)&&isTypeAssignableTo(e,it)}function allTypesAssignableToKind(e,t,n){return e.flags&1048576?every(e.types,(e=>allTypesAssignableToKind(e,t,n))):isTypeAssignableToKind(e,t,n)}function isConstEnumObjectType(e){return!!(getObjectFlags(e)&16)&&!!e.symbol&&isConstEnumSymbol(e.symbol)}function isConstEnumSymbol(e){return(e.flags&128)!==0}function getSymbolHasInstanceMethodOfObjectType(e){const t=getPropertyNameForKnownSymbolName("hasInstance");if(allTypesAssignableToKind(e,67108864)){const n=getPropertyOfType(e,t);if(n){const e=getTypeOfSymbol(n);if(e&&getSignaturesOfType(e,0).length!==0){return e}}}}function checkInstanceOfExpression(e,t,n,r,i){if(n===tt||r===tt){return tt}if(!isTypeAny(n)&&allTypesAssignableToKind(n,402784252)){error2(e,wt.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter)}S.assert(isInstanceOfExpression(e.parent));const o=getResolvedSignature(e.parent,void 0,i);if(o===jt){return tt}const a=getReturnTypeOfSignature(o);checkTypeAssignableTo(a,Xe,t,wt.An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression);return Xe}function hasEmptyObjectIntersection(e){return someType(e,(e=>e===bt||!!(e.flags&2097152)&&isEmptyAnonymousObjectType(getBaseConstraintOrType(e))))}function checkInExpression(e,t,n,r){if(n===tt||r===tt){return tt}if(isPrivateIdentifier(e)){if(vsliceTupleType(e,n))):createArrayType(r);return checkDestructuringAssignment(o,a,i)}}}return void 0}function checkDestructuringAssignment(e,t,n,r){let i;if(e.kind===304){const r=e;if(r.objectAssignmentInitializer){if(k&&!hasTypeFacts(checkExpression(r.objectAssignmentInitializer),16777216)){t=getTypeWithFacts(t,524288)}checkBinaryLikeExpression(r.name,r.equalsToken,r.objectAssignmentInitializer,n)}i=e.name}else{i=e}if(i.kind===226&&i.operatorToken.kind===64){R(i,n);i=i.left;if(k){t=getTypeWithFacts(t,524288)}}if(i.kind===210){return checkObjectLiteralAssignment(i,t,r)}if(i.kind===209){return checkArrayLiteralAssignment(i,t,n)}return checkReferenceAssignment(i,t,n)}function checkReferenceAssignment(e,t,n){const r=checkExpression(e,n);const i=e.parent.kind===305?wt.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:wt.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;const o=e.parent.kind===305?wt.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:wt.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;if(checkReferenceExpression(e,i,o)){checkTypeAssignableToAndOptionallyElaborate(t,r,e,e)}if(isPrivateIdentifierPropertyAccessExpression(e)){checkExternalEmitHelpers(e.parent,1048576)}return t}function isSideEffectFree(e){e=skipParentheses(e);switch(e.kind){case 80:case 11:case 14:case 215:case 228:case 15:case 9:case 10:case 112:case 97:case 106:case 157:case 218:case 231:case 219:case 209:case 210:case 221:case 235:case 285:case 284:return true;case 227:return isSideEffectFree(e.whenTrue)&&isSideEffectFree(e.whenFalse);case 226:if(isAssignmentOperator(e.operatorToken.kind)){return false}return isSideEffectFree(e.left)&&isSideEffectFree(e.right);case 224:case 225:switch(e.operator){case 54:case 40:case 41:case 55:return true}return false;case 222:case 216:case 234:default:return false}}function isTypeEqualityComparableTo(e,t){return(t.flags&98304)!==0||isTypeComparableTo(e,t)}function createCheckBinaryExpression(){const e=createBinaryExpressionTrampoline(onEnter,onLeft,onOperator,onRight,onExit,foldState);return(t,n)=>{const r=e(t,n);S.assertIsDefined(r);return r};function onEnter(e,t,n){if(t){t.stackIndex++;t.skip=false;setLeftType(t,void 0);setLastResult(t,void 0)}else{t={checkMode:n,skip:false,stackIndex:0,typeStack:[void 0,void 0]}}if(isInJSFile(e)&&getAssignedExpandoInitializer(e)){t.skip=true;setLastResult(t,checkExpression(e.right,n));return t}checkNullishCoalesceOperands(e);const r=e.operatorToken.kind;if(r===64&&(e.left.kind===210||e.left.kind===209)){t.skip=true;setLastResult(t,checkDestructuringAssignment(e.left,checkExpression(e.right,n),n,e.right.kind===110));return t}return t}function onLeft(e,t,n){if(!t.skip){return maybeCheckExpression(t,e)}}function onOperator(e,t,n){if(!t.skip){const r=getLastResult(t);S.assertIsDefined(r);setLeftType(t,r);setLastResult(t,void 0);const i=e.kind;if(isLogicalOrCoalescingBinaryOperator(i)){let e=n.parent;while(e.kind===217||isLogicalOrCoalescingBinaryExpression(e)){e=e.parent}if(i===56||isIfStatement(e)){checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(n.left,r,isIfStatement(e)?e.thenStatement:void 0)}if(isBinaryLogicalOperator(i)){checkTruthinessOfType(r,n.left)}}}}function onRight(e,t,n){if(!t.skip){return maybeCheckExpression(t,e)}}function onExit(e,t){let n;if(t.skip){n=getLastResult(t)}else{const r=getLeftType(t);S.assertIsDefined(r);const i=getLastResult(t);S.assertIsDefined(i);n=checkBinaryLikeExpressionWorker(e.left,e.operatorToken,e.right,r,i,t.checkMode,e)}t.skip=false;setLeftType(t,void 0);setLastResult(t,void 0);t.stackIndex--;return n}function foldState(e,t,n){setLastResult(e,t);return e}function maybeCheckExpression(e,t){if(isBinaryExpression(t)){return t}setLastResult(e,checkExpression(t,e.checkMode))}function getLeftType(e){return e.typeStack[e.stackIndex]}function setLeftType(e,t){e.typeStack[e.stackIndex]=t}function getLastResult(e){return e.typeStack[e.stackIndex+1]}function setLastResult(e,t){e.typeStack[e.stackIndex+1]=t}}function checkNullishCoalesceOperands(e){const{left:t,operatorToken:n,right:r}=e;if(n.kind===61){if(isBinaryExpression(t)&&(t.operatorToken.kind===57||t.operatorToken.kind===56)){grammarErrorOnNode(t,wt._0_and_1_operations_cannot_be_mixed_without_parentheses,tokenToString(t.operatorToken.kind),tokenToString(n.kind))}if(isBinaryExpression(r)&&(r.operatorToken.kind===57||r.operatorToken.kind===56)){grammarErrorOnNode(r,wt._0_and_1_operations_cannot_be_mixed_without_parentheses,tokenToString(r.operatorToken.kind),tokenToString(n.kind))}const i=skipOuterExpressions(t,63);const o=getSyntacticNullishnessSemantics(i);if(o!==3){if(e.parent.kind===226){error2(i,wt.This_binary_expression_is_never_nullish_Are_you_missing_parentheses)}else{if(o===1){error2(i,wt.This_expression_is_always_nullish)}else{error2(i,wt.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish)}}}}}function getSyntacticNullishnessSemantics(e){e=skipOuterExpressions(e);switch(e.kind){case 223:case 213:case 215:case 212:case 236:case 214:case 211:case 229:case 110:return 3;case 226:switch(e.operatorToken.kind){case 64:case 61:case 78:case 57:case 76:case 56:case 77:return 3;case 28:return getSyntacticNullishnessSemantics(e.right)}return 2;case 227:return getSyntacticNullishnessSemantics(e.whenTrue)|getSyntacticNullishnessSemantics(e.whenFalse);case 106:return 1;case 80:if(getResolvedSymbol(e)===z){return 1}return 3}return 2}function checkBinaryLikeExpression(e,t,n,r,i){const o=t.kind;if(o===64&&(e.kind===210||e.kind===209)){return checkDestructuringAssignment(e,checkExpression(n,r),r,n.kind===110)}let a;if(isBinaryLogicalOperator(o)){a=checkTruthinessExpression(e,r)}else{a=checkExpression(e,r)}const s=checkExpression(n,r);return checkBinaryLikeExpressionWorker(e,t,n,a,s,r,i)}function checkBinaryLikeExpressionWorker(e,t,n,r,i,o,a){const s=t.kind;switch(s){case 42:case 43:case 67:case 68:case 44:case 69:case 45:case 70:case 41:case 66:case 48:case 71:case 49:case 72:case 50:case 73:case 52:case 75:case 53:case 79:case 51:case 74:if(r===tt||i===tt){return tt}r=checkNonNullType(r,e);i=checkNonNullType(i,n);let c;if(r.flags&528&&i.flags&528&&(c=getSuggestedBooleanOperator(t.kind))!==void 0){error2(a||t,wt.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead,tokenToString(t.kind),tokenToString(c));return Ve}else{const o=checkArithmeticOperandType(e,r,wt.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,true);const c=checkArithmeticOperandType(n,i,wt.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,true);let l;if(isTypeAssignableToKind(r,3)&&isTypeAssignableToKind(i,3)||!(maybeTypeOfKind(r,2112)||maybeTypeOfKind(i,2112))){l=Ve}else if(bothAreBigIntLike(r,i)){switch(s){case 50:case 73:reportOperatorError();break;case 43:case 68:if(v<3){error2(a,wt.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later)}}l=qe}else{reportOperatorError(bothAreBigIntLike);l=Ie}if(o&&c){checkAssignmentOperator(l);switch(s){case 48:case 71:case 49:case 72:case 50:case 73:const r=W(n);if(typeof r.value==="number"&&Math.abs(r.value)>=32){errorOrSuggestion(isEnumMember(walkUpParenthesizedExpressions(n.parent.parent)),a||t,wt.This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2,getTextOfNode(e),tokenToString(s),r.value%32)}break;default:break}}return l}case 40:case 65:if(r===tt||i===tt){return tt}if(!isTypeAssignableToKind(r,402653316)&&!isTypeAssignableToKind(i,402653316)){r=checkNonNullType(r,e);i=checkNonNullType(i,n)}let l;if(isTypeAssignableToKind(r,296,true)&&isTypeAssignableToKind(i,296,true)){l=Ve}else if(isTypeAssignableToKind(r,2112,true)&&isTypeAssignableToKind(i,2112,true)){l=qe}else if(isTypeAssignableToKind(r,402653316,true)||isTypeAssignableToKind(i,402653316,true)){l=ze}else if(isTypeAny(r)||isTypeAny(i)){l=isErrorType(r)||isErrorType(i)?Ie:ke}if(l&&!checkForDisallowedESSymbolOperand(s)){return l}if(!l){const e=296|2112|402653316|3;reportOperatorError(((t,n)=>isTypeAssignableToKind(t,e)&&isTypeAssignableToKind(n,e)));return ke}if(s===65){checkAssignmentOperator(l)}return l;case 30:case 32:case 33:case 34:if(checkForDisallowedESSymbolOperand(s)){r=getBaseTypeOfLiteralTypeForComparison(checkNonNullType(r,e));i=getBaseTypeOfLiteralTypeForComparison(checkNonNullType(i,n));reportOperatorErrorUnless(((e,t)=>{if(isTypeAny(e)||isTypeAny(t)){return true}const n=isTypeAssignableTo(e,st);const r=isTypeAssignableTo(t,st);return n&&r||!n&&!r&&areTypesComparable(e,t)}))}return Xe;case 35:case 36:case 37:case 38:if(!(o&&o&64)){if((isLiteralExpressionOfObject(e)||isLiteralExpressionOfObject(n))&&(!isInJSFile(e)||(s===37||s===38))){const e=s===35||s===37;error2(a,wt.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value,e?"false":"true")}checkNaNEquality(a,s,e,n);reportOperatorErrorUnless(((e,t)=>isTypeEqualityComparableTo(e,t)||isTypeEqualityComparableTo(t,e)))}return Xe;case 104:return checkInstanceOfExpression(e,n,r,i,o);case 103:return checkInExpression(e,n,r,i);case 56:case 77:{const e=hasTypeFacts(r,4194304)?getUnionType([extractDefinitelyFalsyTypes(k?r:getBaseTypeOfLiteralType(i)),i]):r;if(s===77){checkAssignmentOperator(i)}return e}case 57:case 76:{const e=hasTypeFacts(r,8388608)?getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(r)),i],2):r;if(s===76){checkAssignmentOperator(i)}return e}case 61:case 78:{const e=hasTypeFacts(r,262144)?getUnionType([getNonNullableType(r),i],2):r;if(s===78){checkAssignmentOperator(i)}return e}case 64:const d=isBinaryExpression(e.parent)?getAssignmentDeclarationKind(e.parent):0;checkAssignmentDeclaration(d,i);if(isAssignmentDeclaration2(d)){if(!(i.flags&524288)||d!==2&&d!==6&&!isEmptyObjectType(i)&&!isFunctionObjectType(i)&&!(getObjectFlags(i)&1)){checkAssignmentOperator(i)}return r}else{checkAssignmentOperator(i);return i}case 28:if(!T.allowUnreachableCode&&isSideEffectFree(e)&&!isIndirectCall(e.parent)){const t=getSourceFileOfNode(e);const n=t.text;const r=skipTrivia(n,e.pos);const i=t.parseDiagnostics.some((e=>{if(e.code!==wt.JSX_expressions_must_have_one_parent_element.code)return false;return textSpanContainsPosition(e,r)}));if(!i)error2(e,wt.Left_side_of_comma_operator_is_unused_and_has_no_side_effects)}return i;default:return S.fail()}function bothAreBigIntLike(e,t){return isTypeAssignableToKind(e,2112)&&isTypeAssignableToKind(t,2112)}function checkAssignmentDeclaration(e,t){if(e===2){for(const e of getPropertiesOfObjectType(t)){const t=getTypeOfSymbol(e);if(t.symbol&&t.symbol.flags&32){const t=e.escapedName;const n=te(e.valueDeclaration,t,788968,void 0,false);if((n==null?void 0:n.declarations)&&n.declarations.some(isJSDocTypedefTag)){addDuplicateDeclarationErrorsForSymbols(n,wt.Duplicate_identifier_0,unescapeLeadingUnderscores(t),e);addDuplicateDeclarationErrorsForSymbols(e,wt.Duplicate_identifier_0,unescapeLeadingUnderscores(t),n)}}}}}function isIndirectCall(e){return e.parent.kind===217&&isNumericLiteral(e.left)&&e.left.text==="0"&&(isCallExpression(e.parent.parent)&&e.parent.parent.expression===e.parent||e.parent.parent.kind===215)&&(isAccessExpression(e.right)||isIdentifier(e.right)&&e.right.escapedText==="eval")}function checkForDisallowedESSymbolOperand(t){const o=maybeTypeOfKindConsideringBaseConstraint(r,12288)?e:maybeTypeOfKindConsideringBaseConstraint(i,12288)?n:void 0;if(o){error2(o,wt.The_0_operator_cannot_be_applied_to_type_symbol,tokenToString(t));return false}return true}function getSuggestedBooleanOperator(e){switch(e){case 52:case 75:return 57;case 53:case 79:return 38;case 51:case 74:return 56;default:return void 0}}function checkAssignmentOperator(i){if(isAssignmentOperator(s)){addLazyDiagnostic(checkAssignmentOperatorWorker)}function checkAssignmentOperatorWorker(){let o=r;if(isCompoundAssignment(t.kind)&&e.kind===211){o=checkPropertyAccessExpression(e,void 0,true)}if(checkReferenceExpression(e,wt.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,wt.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)){let t;if(L&&isPropertyAccessExpression(e)&&maybeTypeOfKind(i,32768)){const n=getTypeOfPropertyOfType(getTypeOfExpression(e.expression),e.name.escapedText);if(isExactOptionalPropertyMismatch(i,n)){t=wt.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target}}checkTypeAssignableToAndOptionallyElaborate(i,o,e,n,t)}}}function isAssignmentDeclaration2(t){var r;switch(t){case 2:return true;case 1:case 5:case 6:case 3:case 4:const t=getSymbolOfNode(e);const i=getAssignedExpandoInitializer(n);return!!i&&isObjectLiteralExpression(i)&&!!((r=t==null?void 0:t.exports)==null?void 0:r.size);default:return false}}function reportOperatorErrorUnless(e){if(!e(r,i)){reportOperatorError(e);return true}return false}function reportOperatorError(e){let n=false;const o=a||t;if(e){const t=getAwaitedTypeNoAlias(r);const o=getAwaitedTypeNoAlias(i);n=!(t===r&&o===i)&&!!(t&&o)&&e(t,o)}let s=r;let c=i;if(!n&&e){[s,c]=getBaseTypesIfUnrelated(r,i,e)}const[l,d]=getTypeNamesForErrorDisplay(s,c);if(!tryGiveBetterPrimaryError(o,n,l,d)){errorAndMaybeSuggestAwait(o,n,wt.Operator_0_cannot_be_applied_to_types_1_and_2,tokenToString(t.kind),l,d)}}function tryGiveBetterPrimaryError(e,n,r,i){switch(t.kind){case 37:case 35:case 38:case 36:return errorAndMaybeSuggestAwait(e,n,wt.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap,r,i);default:return void 0}}function checkNaNEquality(e,t,n,r){const i=isGlobalNaN(skipParentheses(n));const o=isGlobalNaN(skipParentheses(r));if(i||o){const a=error2(e,wt.This_condition_will_always_return_0,tokenToString(t===37||t===35?97:112));if(i&&o)return;const s=t===38||t===36?tokenToString(54):"";const c=i?r:n;const l=skipParentheses(c);addRelatedInfo(a,createDiagnosticForNode(c,wt.Did_you_mean_0,`${s}Number.isNaN(${isEntityNameExpression(l)?entityNameToString(l):"..."})`))}}function isGlobalNaN(e){if(isIdentifier(e)&&e.escapedText==="NaN"){const t=getGlobalNaNSymbol();return!!t&&t===getResolvedSymbol(e)}return false}}function getBaseTypesIfUnrelated(e,t,n){let r=e;let i=t;const o=getBaseTypeOfLiteralType(e);const a=getBaseTypeOfLiteralType(t);if(!n(o,a)){r=o;i=a}return[r,i]}function checkYieldExpression(e){addLazyDiagnostic(checkYieldExpressionGrammar);const t=getContainingFunction(e);if(!t)return ke;const n=getFunctionFlags(t);if(!(n&1)){return ke}const r=(n&2)!==0;if(e.asteriskToken){if(r&&vcheckGeneratorInstantiationAssignabilityToReturnType(e,n,void 0)))}const o=i&&getIterationTypesOfGeneratorFunctionReturnType(i,r);const a=o&&o.yieldType||ke;const s=o&&o.nextType||ke;const c=e.expression?checkExpression(e.expression):Re;const l=getYieldedTypeOfYieldExpression(e,c,s,r);if(i&&l){checkTypeAssignableToAndOptionallyElaborate(l,a,e.expression||e,e.expression)}if(e.asteriskToken){const t=r?19:17;return getIterationTypeOfIterable(t,1,c,e.expression)||ke}else if(i){return getIterationTypeOfGeneratorFunctionReturnType(2,i,r)||ke}let d=getContextualIterationType(2,t);if(!d){d=ke;addLazyDiagnostic((()=>{if(A&&!expressionResultIsUnused(e)){const t=getContextualType2(e,void 0);if(!t||isTypeAny(t)){error2(e,wt.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation)}}}))}return d;function checkYieldExpressionGrammar(){if(!(e.flags&16384)){grammarErrorOnFirstToken(e,wt.A_yield_expression_is_only_allowed_in_a_generator_body)}if(isInParameterInitializerBeforeContainingFunction(e)){error2(e,wt.yield_expressions_cannot_be_used_in_a_parameter_initializer)}}}function checkConditionalExpression(e,t){const n=checkTruthinessExpression(e.condition,t);checkTestingKnownTruthyCallableOrAwaitableOrEnumMemberType(e.condition,n,e.whenTrue);const r=checkExpression(e.whenTrue,t);const i=checkExpression(e.whenFalse,t);return getUnionType([r,i],2)}function isTemplateLiteralContext(e){const t=e.parent;return isParenthesizedExpression(t)&&isTemplateLiteralContext(t)||isElementAccessExpression(t)&&t.argumentExpression===e}function checkTemplateExpression(e){const t=[e.head.text];const n=[];for(const r of e.templateSpans){const e=checkExpression(r.expression);if(maybeTypeOfKindConsideringBaseConstraint(e,12288)){error2(r.expression,wt.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String)}t.push(r.literal.text);n.push(isTypeAssignableTo(e,ct)?e:ze)}const r=e.parent.kind!==215&&W(e).value;if(r){return getFreshTypeOfLiteralType(getStringLiteralType(r))}if(isConstContext(e)||isTemplateLiteralContext(e)||someType(getContextualType2(e,void 0)||Le,isTemplateLiteralContextualType)){return getTemplateLiteralType(t,n)}return ze}function isTemplateLiteralContextualType(e){return!!(e.flags&(128|134217728)||e.flags&58982400&&maybeTypeOfKind(getBaseConstraintOfType(e)||Le,402653316))}function getContextNode2(e){if(isJsxAttributes(e)&&!isJsxSelfClosingElement(e.parent)){return e.parent.parent}return e}function checkExpressionWithContextualType(e,t,n,r){const i=getContextNode2(e);pushContextualType(i,t,false);pushInferenceContext(i,n);const o=checkExpression(e,r|1|(n?2:0));if(n&&n.intraExpressionInferenceSites){n.intraExpressionInferenceSites=void 0}const a=maybeTypeOfKind(o,2944)&&isLiteralOfContextualType(o,instantiateContextualType(t,e,void 0))?getRegularTypeOfLiteralType(o):o;popInferenceContext();popContextualType();return a}function checkExpressionCached(e,t){if(t){return checkExpression(e,t)}const n=getNodeLinks(e);if(!n.resolvedType){const r=br;const i=Dr;br=Cr;Dr=void 0;n.resolvedType=checkExpression(e,t);Dr=i;br=r}return n.resolvedType}function isTypeAssertion(e){e=skipParentheses(e,true);return e.kind===216||e.kind===234||isJSDocTypeAssertion(e)}function checkDeclarationInitializer(e,t,n){const r=getEffectiveInitializer(e);if(isInJSFile(e)){const n=tryGetJSDocSatisfiesTypeNode(e);if(n){return checkSatisfiesExpressionWorker(r,n,t)}}const i=getQuickTypeOfExpression(r)||(n?checkExpressionWithContextualType(r,n,void 0,t||0):checkExpressionCached(r,t));if(isParameter(isBindingElement(e)?walkUpBindingElementsAndPatterns(e):e)){if(e.name.kind===206&&isObjectLiteralType2(i)){return padObjectLiteralType(i,e.name)}if(e.name.kind===207&&isTupleType(i)){return padTupleType(i,e.name)}}return i}function padObjectLiteralType(e,t){let n;for(const r of t.elements){if(r.initializer){const t=getPropertyNameFromBindingElement(r);if(t&&!getPropertyOfType(e,t)){n=append(n,r)}}}if(!n){return e}const r=createSymbolTable();for(const t of getPropertiesOfObjectType(e)){r.set(t.escapedName,t)}for(const e of n){const t=createSymbol(4|16777216,getPropertyNameFromBindingElement(e));t.links.type=getTypeFromBindingElement(e,false,false);r.set(t.escapedName,t)}const i=createAnonymousType(e.symbol,r,d,d,getIndexInfosOfType(e));i.objectFlags=e.objectFlags;return i}function getPropertyNameFromBindingElement(e){const t=getLiteralTypeFromPropertyName(e.propertyName||e.name);return isTypeUsableAsPropertyName(t)?getPropertyNameFromType(t):void 0}function padTupleType(e,t){if(e.target.combinedFlags&12||getTypeReferenceArity(e)>=t.elements.length){return e}const n=t.elements;const r=getElementTypes(e).slice();const i=e.target.elementFlags.slice();for(let t=getTypeReferenceArity(e);tisLiteralOfContextualType(e,t)))}if(t.flags&58982400){const n=getBaseConstraintOfType(t)||Le;return maybeTypeOfKind(n,4)&&maybeTypeOfKind(e,128)||maybeTypeOfKind(n,8)&&maybeTypeOfKind(e,256)||maybeTypeOfKind(n,64)&&maybeTypeOfKind(e,2048)||maybeTypeOfKind(n,4096)&&maybeTypeOfKind(e,8192)||isLiteralOfContextualType(e,n)}return!!(t.flags&(128|4194304|134217728|268435456)&&maybeTypeOfKind(e,128)||t.flags&256&&maybeTypeOfKind(e,256)||t.flags&2048&&maybeTypeOfKind(e,2048)||t.flags&512&&maybeTypeOfKind(e,512)||t.flags&8192&&maybeTypeOfKind(e,8192))}return false}function isConstContext(e){const t=e.parent;return isAssertionExpression(t)&&isConstTypeReference(t.type)||isJSDocTypeAssertion(t)&&isConstTypeReference(getJSDocTypeAssertionType(t))||isValidConstAssertionArgument(e)&&isConstTypeVariable(getContextualType2(e,0))||(isParenthesizedExpression(t)||isArrayLiteralExpression(t)||isSpreadElement(t))&&isConstContext(t)||(isPropertyAssignment(t)||isShorthandPropertyAssignment(t)||isTemplateSpan(t))&&isConstContext(t.parent)}function checkExpressionForMutableLocation(e,t,n){const r=checkExpression(e,t,n);return isConstContext(e)||isCommonJsExportedExpression(e)?getRegularTypeOfLiteralType(r):isTypeAssertion(e)?r:getWidenedLiteralLikeTypeForContextualType(r,instantiateContextualType(getContextualType2(e,void 0),e,void 0))}function checkPropertyAssignment(e,t){if(e.name.kind===167){checkComputedPropertyName(e.name)}return checkExpressionForMutableLocation(e.initializer,t)}function checkObjectLiteralMethod(e,t){checkGrammarMethod(e);if(e.name.kind===167){checkComputedPropertyName(e.name)}const n=checkFunctionExpressionOrObjectLiteralMethod(e,t);return instantiateTypeWithSingleGenericCallSignature(e,n,t)}function instantiateTypeWithSingleGenericCallSignature(e,t,n){if(n&&n&(2|8)){const r=getSingleSignature(t,0,true);const i=getSingleSignature(t,1,true);const o=r||i;if(o&&o.typeParameters){const t=getApparentTypeOfContextualType(e,2);if(t){const i=getSingleSignature(getNonNullableType(t),r?0:1,false);if(i&&!i.typeParameters){if(n&8){skippedGenericFunction(e,n);return Nt}const t=getInferenceContext(e);const r=t.signature&&getReturnTypeOfSignature(t.signature);const a=r&&getSingleCallOrConstructSignature(r);if(a&&!a.typeParameters&&!every(t.inferences,hasInferenceCandidates)){const e=getUniqueTypeParameters(t,o.typeParameters);const n=getSignatureInstantiationWithoutFillingInTypeArguments(o,e);const r=map(t.inferences,(e=>createInferenceInfo(e.typeParameter)));applyToParameterTypes(n,i,((e,t)=>{inferTypes(r,e,t,0,true)}));if(some(r,hasInferenceCandidates)){applyToReturnTypes(n,i,((e,t)=>{inferTypes(r,e,t)}));if(!hasOverlappingInferences(t.inferences,r)){mergeInferences(t.inferences,r);t.inferredTypeParameters=concatenate(t.inferredTypeParameters,e);return getOrCreateTypeFromSignature(n)}}}return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(o,i,t),flatMap(Rr,(e=>e&&map(e.inferences,(e=>e.typeParameter)))).slice())}}}}return t}function skippedGenericFunction(e,t){if(t&2){const t=getInferenceContext(e);t.flags|=4}}function hasInferenceCandidates(e){return!!(e.candidates||e.contraCandidates)}function hasInferenceCandidatesOrDefault(e){return!!(e.candidates||e.contraCandidates||hasTypeParameterDefault(e.typeParameter))}function hasOverlappingInferences(e,t){for(let n=0;ne.symbol.escapedName===t))}function getUniqueTypeParameterName(e,t){let n=t.length;while(n>1&&t.charCodeAt(n-1)>=48&&t.charCodeAt(n-1)<=57)n--;const r=t.slice(0,n);for(let t=1;true;t++){const n=r+t;if(!hasTypeParameterByName(e,n)){return n}}}function getReturnTypeOfSingleNonGenericCallSignature(e){const t=getSingleCallSignature(e);if(t&&!t.typeParameters){return getReturnTypeOfSignature(t)}}function getReturnTypeOfSingleNonGenericSignatureOfCallChain(e){const t=checkExpression(e.expression);const n=getOptionalExpressionType(t,e.expression);const r=getReturnTypeOfSingleNonGenericCallSignature(t);return r&&propagateOptionalTypeMarker(r,e,n!==t)}function getTypeOfExpression(e){const t=getQuickTypeOfExpression(e);if(t){return t}if(e.flags&268435456&&Dr){const t=Dr[getNodeId(e)];if(t){return t}}const n=kr;const r=checkExpression(e,64);if(kr!==n){const t=Dr||(Dr=[]);t[getNodeId(e)]=r;setNodeFlags(e,e.flags|268435456)}return r}function getQuickTypeOfExpression(e){let t=skipParentheses(e,true);if(isJSDocTypeAssertion(t)){const e=getJSDocTypeAssertionType(t);if(!isConstTypeReference(e)){return getTypeFromTypeNode(e)}}t=skipParentheses(e);if(isAwaitExpression(t)){const e=getQuickTypeOfExpression(t.expression);return e?getAwaitedType(e):void 0}if(isCallExpression(t)&&t.expression.kind!==108&&!isRequireCall(t,true)&&!isSymbolOrSymbolForCall(t)){return isCallChain(t)?getReturnTypeOfSingleNonGenericSignatureOfCallChain(t):getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(t.expression))}else if(isAssertionExpression(t)&&!isConstTypeReference(t.type)){return getTypeFromTypeNode(t.type)}else if(isLiteralExpression(e)||isBooleanLiteral(e)){return checkExpression(e)}return void 0}function getContextFreeTypeOfExpression(e){const t=getNodeLinks(e);if(t.contextFreeType){return t.contextFreeType}pushContextualType(e,ke,false);const n=t.contextFreeType=checkExpression(e,4);popContextualType();return n}function checkExpression(e,t,n){var r,i;(r=G)==null?void 0:r.push(G.Phase.Check,"checkExpression",{kind:e.kind,pos:e.pos,end:e.end,path:e.tracingPath});const o=m;m=e;p=0;const a=checkExpressionWorker(e,t,n);const s=instantiateTypeWithSingleGenericCallSignature(e,a,t);if(isConstEnumObjectType(s)){checkConstEnumAccess(e,s)}m=o;(i=G)==null?void 0:i.pop();return s}function checkConstEnumAccess(t,n){const r=t.parent.kind===211&&t.parent.expression===t||t.parent.kind===212&&t.parent.expression===t||((t.kind===80||t.kind===166)&&isInRightSideOfImportOrExportAssignment(t)||t.parent.kind===186&&t.parent.exprName===t)||t.parent.kind===281;if(!r){error2(t,wt.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query)}if(T.isolatedModules||T.verbatimModuleSyntax&&r&&!te(t,getFirstIdentifier(t),2097152,void 0,false,true)){S.assert(!!(n.symbol.flags&128));const r=n.symbol.valueDeclaration;const i=e.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(r).resolvedPath);if(r.flags&33554432&&!isValidTypeOnlyAliasUseSite(t)&&(!i||!er(i.commandLine.options))){error2(t,wt.Cannot_access_ambient_const_enums_when_0_is_enabled,K)}}}function checkParenthesizedExpression(e,t){if(hasJSDocNodes(e)){if(isJSDocSatisfiesExpression(e)){return checkSatisfiesExpressionWorker(e.expression,getJSDocSatisfiesExpressionType(e),t)}if(isJSDocTypeAssertion(e)){return checkAssertionWorker(e,t)}}return checkExpression(e.expression,t)}function checkExpressionWorker(e,t,r){const i=e.kind;if(n){switch(i){case 231:case 218:case 219:n.throwIfCancellationRequested()}}switch(i){case 80:return checkIdentifier(e,t);case 81:return checkPrivateIdentifierExpression(e);case 110:return checkThisExpression(e);case 108:return checkSuperExpression(e);case 106:return Ue;case 15:case 11:return hasSkipDirectInferenceFlag(e)?De:getFreshTypeOfLiteralType(getStringLiteralType(e.text));case 9:checkGrammarNumericLiteral(e);return getFreshTypeOfLiteralType(getNumberLiteralType(+e.text));case 10:checkGrammarBigIntLiteral(e);return getFreshTypeOfLiteralType(getBigIntLiteralType({negative:false,base10Value:parsePseudoBigInt(e.text)}));case 112:return Ke;case 97:return He;case 228:return checkTemplateExpression(e);case 14:return checkRegularExpressionLiteral(e);case 209:return checkArrayLiteral(e,t,r);case 210:return checkObjectLiteral(e,t);case 211:return checkPropertyAccessExpression(e,t);case 166:return checkQualifiedName(e,t);case 212:return checkIndexedAccess(e,t);case 213:if(e.expression.kind===102){return checkImportCallExpression(e)}case 214:return checkCallExpression(e,t);case 215:return checkTaggedTemplateExpression(e);case 217:return checkParenthesizedExpression(e,t);case 231:return checkClassExpression(e);case 218:case 219:return checkFunctionExpressionOrObjectLiteralMethod(e,t);case 221:return checkTypeOfExpression(e);case 216:case 234:return checkAssertion(e,t);case 235:return checkNonNullAssertion(e);case 233:return checkExpressionWithTypeArguments(e);case 238:return checkSatisfiesExpression(e);case 236:return checkMetaProperty(e);case 220:return checkDeleteExpression(e);case 222:return checkVoidExpression(e);case 223:return checkAwaitExpression(e);case 224:return checkPrefixUnaryExpression(e);case 225:return checkPostfixUnaryExpression(e);case 226:return R(e,t);case 227:return checkConditionalExpression(e,t);case 230:return checkSpreadExpression(e,t);case 232:return Re;case 229:return checkYieldExpression(e);case 237:return checkSyntheticExpression(e);case 294:return checkJsxExpression(e,t);case 284:return checkJsxElement(e,t);case 285:return checkJsxSelfClosingElement(e,t);case 288:return checkJsxFragment(e);case 292:return checkJsxAttributes(e,t);case 286:S.fail("Shouldn't ever directly check a JsxOpeningElement")}return Ie}function checkTypeParameter(e){checkGrammarModifiers(e);if(e.expression){grammarErrorOnFirstToken(e.expression,wt.Type_expected)}checkSourceElement(e.constraint);checkSourceElement(e.default);const t=getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(e));getBaseConstraintOfType(t);if(!hasNonCircularTypeParameterDefault(t)){error2(e.default,wt.Type_parameter_0_has_a_circular_default,typeToString(t))}const n=getConstraintOfTypeParameter(t);const r=getDefaultFromTypeParameter(t);if(n&&r){checkTypeAssignableTo(r,getTypeWithThisArgument(instantiateType(n,makeUnaryTypeMapper(t,r)),r),e.default,wt.Type_0_does_not_satisfy_the_constraint_1)}checkNodeDeferred(e);addLazyDiagnostic((()=>checkTypeNameIsReserved(e.name,wt.Type_parameter_name_cannot_be_0)))}function checkTypeParameterDeferred(e){var t,n;if(isInterfaceDeclaration(e.parent)||isClassLike(e.parent)||isTypeAliasDeclaration(e.parent)){const r=getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(e));const i=getTypeParameterModifiers(r)&(8192|16384);if(i){const o=getSymbolOfDeclaration(e.parent);if(isTypeAliasDeclaration(e.parent)&&!(getObjectFlags(getDeclaredTypeOfSymbol(o))&(16|32))){error2(e,wt.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types)}else if(i===8192||i===16384){(t=G)==null?void 0:t.push(G.Phase.CheckTypes,"checkTypeParameterDeferred",{parent:getTypeId(getDeclaredTypeOfSymbol(o)),id:getTypeId(r)});const a=createMarkerType(o,r,i===16384?Lt:Ot);const s=createMarkerType(o,r,i===16384?Ot:Lt);const c=r;_=r;checkTypeAssignableTo(a,s,e,wt.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);_=c;(n=G)==null?void 0:n.pop()}}}}function checkParameter(e){checkGrammarModifiers(e);checkVariableLikeDeclaration(e);const t=getContainingFunction(e);if(hasSyntacticModifier(e,31)){if(T.erasableSyntaxOnly){error2(e,wt.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled)}if(!(t.kind===176&&nodeIsPresent(t.body))){error2(e,wt.A_parameter_property_is_only_allowed_in_a_constructor_implementation)}if(t.kind===176&&isIdentifier(e.name)&&e.name.escapedText==="constructor"){error2(e.name,wt.constructor_cannot_be_used_as_a_parameter_property_name)}}if(!e.initializer&&isOptionalDeclaration(e)&&isBindingPattern(e.name)&&t.body){error2(e,wt.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature)}if(e.name&&isIdentifier(e.name)&&(e.name.escapedText==="this"||e.name.escapedText==="new")){if(t.parameters.indexOf(e)!==0){error2(e,wt.A_0_parameter_must_be_the_first_parameter,e.name.escapedText)}if(t.kind===176||t.kind===180||t.kind===185){error2(e,wt.A_constructor_cannot_have_a_this_parameter)}if(t.kind===219){error2(e,wt.An_arrow_function_cannot_have_a_this_parameter)}if(t.kind===177||t.kind===178){error2(e,wt.get_and_set_accessors_cannot_declare_this_parameters)}}if(e.dotDotDotToken&&!isBindingPattern(e.name)&&!isTypeAssignableTo(getReducedType(getTypeOfSymbol(e.symbol)),Tn)){error2(e,wt.A_rest_parameter_must_be_of_an_array_type)}}function checkTypePredicate(e){const t=getTypePredicateParent(e);if(!t){error2(e,wt.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);return}const n=getSignatureFromDeclaration(t);const r=getTypePredicateOfSignature(n);if(!r){return}checkSourceElement(e.type);const{parameterName:i}=e;if(r.kind!==0&&r.kind!==2){if(r.parameterIndex>=0){if(signatureHasRestParameter(n)&&r.parameterIndex===n.parameters.length-1){error2(i,wt.A_type_predicate_cannot_reference_a_rest_parameter)}else{if(r.type){const leadingError=()=>chainDiagnosticMessages(void 0,wt.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type);checkTypeAssignableTo(r.type,getTypeOfSymbol(n.parameters[r.parameterIndex]),e.type,void 0,leadingError)}}}else if(i){let n=false;for(const{name:e}of t.parameters){if(isBindingPattern(e)&&checkIfTypePredicateVariableIsDeclaredInBindingPattern(e,i,r.parameterName)){n=true;break}}if(!n){error2(e.parameterName,wt.Cannot_find_parameter_0,r.parameterName)}}}}function getTypePredicateParent(e){switch(e.parent.kind){case 219:case 179:case 262:case 218:case 184:case 174:case 173:const t=e.parent;if(e===t.type){return t}}}function checkIfTypePredicateVariableIsDeclaredInBindingPattern(e,t,n){for(const r of e.elements){if(isOmittedExpression(r)){continue}const e=r.name;if(e.kind===80&&e.escapedText===n){error2(t,wt.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern,n);return true}else if(e.kind===207||e.kind===206){if(checkIfTypePredicateVariableIsDeclaredInBindingPattern(e,t,n)){return true}}}}function checkSignatureDeclaration(e){if(e.kind===181){checkGrammarIndexSignature(e)}else if(e.kind===184||e.kind===262||e.kind===185||e.kind===179||e.kind===176||e.kind===180){checkGrammarFunctionLikeDeclaration(e)}const t=getFunctionFlags(e);if(!(t&4)){if((t&3)===3&&v0&&t.declarations[0]!==e){return}}const t=getIndexSymbol(getSymbolOfDeclaration(e));if(t==null?void 0:t.declarations){const e=new Map;for(const n of t.declarations){if(isIndexSignatureDeclaration(n)){if(n.parameters.length===1&&n.parameters[0].type){forEachType(getTypeFromTypeNode(n.parameters[0].type),(t=>{const r=e.get(getTypeId(t));if(r){r.declarations.push(n)}else{e.set(getTypeId(t),{type:t,declarations:[n]})}}))}}}e.forEach((e=>{if(e.declarations.length>1){for(const t of e.declarations){error2(t,wt.Duplicate_index_signature_for_type_0,typeToString(e.type))}}}))}}function checkPropertyDeclaration(e){if(!checkGrammarModifiers(e)&&!checkGrammarProperty(e))checkGrammarComputedPropertyName(e.name);checkVariableLikeDeclaration(e);setNodeLinksForPrivateIdentifierScope(e);if(hasSyntacticModifier(e,64)&&e.kind===172&&e.initializer){error2(e,wt.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract,declarationNameToString(e.name))}}function checkPropertySignature(e){if(isPrivateIdentifier(e.name)){error2(e,wt.Private_identifiers_are_not_allowed_outside_class_bodies)}return checkPropertyDeclaration(e)}function checkMethodDeclaration(e){if(!checkGrammarMethod(e))checkGrammarComputedPropertyName(e.name);if(isMethodDeclaration(e)&&e.asteriskToken&&isIdentifier(e.name)&&idText(e.name)==="constructor"){error2(e.name,wt.Class_constructor_may_not_be_a_generator)}checkFunctionOrMethodDeclaration(e);if(hasSyntacticModifier(e,64)&&e.kind===174&&e.body){error2(e,wt.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,declarationNameToString(e.name))}if(isPrivateIdentifier(e.name)&&!getContainingClass(e)){error2(e,wt.Private_identifiers_are_not_allowed_outside_class_bodies)}setNodeLinksForPrivateIdentifierScope(e)}function setNodeLinksForPrivateIdentifierScope(e){if(isPrivateIdentifier(e.name)){if(vhasSyntacticModifier(e,31))));if(t){if(!superCallIsRootLevelInConstructor(r,e.body)){error2(r,wt.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers)}else{let t;for(const n of e.body.statements){if(isExpressionStatement(n)&&isSuperCall(skipOuterExpressions(n.expression))){t=n;break}if(nodeImmediatelyReferencesSuperOrThis(n)){break}}if(t===void 0){error2(e,wt.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers)}}}}else if(!n){error2(e,wt.Constructors_for_derived_classes_must_contain_a_super_call)}}}}function superCallIsRootLevelInConstructor(e,t){const n=walkUpParenthesizedExpressions(e.parent);return isExpressionStatement(n)&&n.parent===t}function nodeImmediatelyReferencesSuperOrThis(e){if(e.kind===108||e.kind===110){return true}if(isThisContainerOrFunctionBlock(e)){return false}return!!forEachChild(e,nodeImmediatelyReferencesSuperOrThis)}function checkAccessorDeclaration(e){if(isIdentifier(e.name)&&idText(e.name)==="constructor"&&isClassLike(e.parent)){error2(e.name,wt.Class_constructor_may_not_be_an_accessor)}addLazyDiagnostic(checkAccessorDeclarationDiagnostics);checkSourceElement(e.body);setNodeLinksForPrivateIdentifierScope(e);function checkAccessorDeclarationDiagnostics(){if(!checkGrammarFunctionLikeDeclaration(e)&&!checkGrammarAccessor(e))checkGrammarComputedPropertyName(e.name);checkDecorators(e);checkSignatureDeclaration(e);if(e.kind===177){if(!(e.flags&33554432)&&nodeIsPresent(e.body)&&e.flags&512){if(!(e.flags&1024)){error2(e.name,wt.A_get_accessor_must_return_a_value)}}}if(e.name.kind===167){checkComputedPropertyName(e.name)}if(hasBindableName(e)){const t=getSymbolOfDeclaration(e);const n=getDeclarationOfKind(t,177);const r=getDeclarationOfKind(t,178);if(n&&r&&!(getNodeCheckFlags(n)&1)){getNodeLinks(n).flags|=1;const e=getEffectiveModifierFlags(n);const t=getEffectiveModifierFlags(r);if((e&64)!==(t&64)){error2(n.name,wt.Accessors_must_both_be_abstract_or_non_abstract);error2(r.name,wt.Accessors_must_both_be_abstract_or_non_abstract)}if(e&4&&!(t&(4|2))||e&2&&!(t&2)){error2(n.name,wt.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);error2(r.name,wt.A_get_accessor_must_be_at_least_as_accessible_as_the_setter)}}}const t=getTypeOfAccessors(getSymbolOfDeclaration(e));if(e.kind===177){checkAllCodePathsInNonVoidFunctionReturnOrThrow(e,t)}}}function checkMissingDeclaration(e){checkDecorators(e)}function getEffectiveTypeArgumentAtIndex(e,t,n){if(e.typeArguments&&n{const t=getTypeParametersForTypeReferenceOrImport(e);if(t){checkTypeArgumentConstraints(e,t)}}))}const t=getNodeLinks(e).resolvedSymbol;if(t){if(some(t.declarations,(e=>isTypeDeclaration(e)&&!!(e.flags&536870912)))){addDeprecatedSuggestion(getDeprecatedSuggestionNode(e),t.declarations,t.escapedName)}}}}function getTypeArgumentConstraint(e){const t=tryCast(e.parent,isTypeReferenceType);if(!t)return void 0;const n=getTypeParametersForTypeReferenceOrImport(t);if(!n)return void 0;const r=getConstraintOfTypeParameter(n[t.typeArguments.indexOf(e)]);return r&&instantiateType(r,createTypeMapper(n,getEffectiveTypeArguments2(t,n)))}function checkTypeQuery(e){getTypeFromTypeQueryNode(e)}function checkTypeLiteral(e){forEach(e.members,checkSourceElement);addLazyDiagnostic(checkTypeLiteralDiagnostics);function checkTypeLiteralDiagnostics(){const t=getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(e);checkIndexConstraints(t,t.symbol);checkTypeForDuplicateIndexSignatures(e);checkObjectTypeForDuplicateDeclarations(e)}}function checkArrayType(e){checkSourceElement(e.elementType)}function checkTupleType(e){let t=false;let n=false;for(const r of e.elements){let e=getTupleElementFlags(r);if(e&8){const t=getTypeFromTypeNode(r.type);if(!isArrayLikeType(t)){error2(r,wt.A_rest_element_type_must_be_an_array_type);break}if(isArrayType(t)||isTupleType(t)&&t.target.combinedFlags&4){e|=4}}if(e&4){if(n){grammarErrorOnNode(r,wt.A_rest_element_cannot_follow_another_rest_element);break}n=true}else if(e&2){if(n){grammarErrorOnNode(r,wt.An_optional_element_cannot_follow_a_rest_element);break}t=true}else if(e&1&&t){grammarErrorOnNode(r,wt.A_required_element_cannot_follow_an_optional_element);break}}forEach(e.elements,checkSourceElement);getTypeFromTypeNode(e)}function checkUnionOrIntersectionType(e){forEach(e.types,checkSourceElement);getTypeFromTypeNode(e)}function checkIndexedAccessIndexType(e,t){if(!(e.flags&8388608)){return e}const n=e.objectType;const r=e.indexType;const i=isGenericMappedType(n)&&getMappedTypeNameTypeKind(n)===2?getIndexTypeForMappedType(n,0):getIndexType(n,0);const o=!!getIndexInfoOfType(n,Ve);if(everyType(r,(e=>isTypeAssignableTo(e,i)||o&&isApplicableIndexType(e,Ve)))){if(t.kind===212&&isAssignmentTarget(t)&&getObjectFlags(n)&32&&getMappedTypeModifiers(n)&1){error2(t,wt.Index_signature_in_type_0_only_permits_reading,typeToString(n))}return e}if(isGenericObjectType(n)){const e=getPropertyNameFromIndex(r,t);if(e){const r=forEachType(getApparentType(n),(t=>getPropertyOfType(t,e)));if(r&&getDeclarationModifierFlagsFromSymbol(r)&6){error2(t,wt.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter,unescapeLeadingUnderscores(e));return Ie}}}error2(t,wt.Type_0_cannot_be_used_to_index_type_1,typeToString(r),typeToString(n));return Ie}function checkIndexedAccessType(e){checkSourceElement(e.objectType);checkSourceElement(e.indexType);checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(e),e)}function checkMappedType(e){checkGrammarMappedType(e);checkSourceElement(e.typeParameter);checkSourceElement(e.nameType);checkSourceElement(e.type);if(!e.type){reportImplicitAny(e,ke)}const t=getTypeFromMappedTypeNode(e);const n=getNameTypeFromMappedType(t);if(n){checkTypeAssignableTo(n,at,e.nameType)}else{const n=getConstraintTypeFromMappedType(t);checkTypeAssignableTo(n,at,getEffectiveConstraintOfTypeParameter(e.typeParameter))}}function checkGrammarMappedType(e){var t;if((t=e.members)==null?void 0:t.length){return grammarErrorOnNode(e.members[0],wt.A_mapped_type_may_not_declare_properties_or_methods)}}function checkThisType(e){getTypeFromThisTypeNode(e)}function checkTypeOperator(e){checkGrammarTypeOperatorNode(e);checkSourceElement(e.type)}function checkConditionalType(e){forEachChild(e,checkSourceElement)}function checkInferType(e){if(!findAncestor(e,(e=>e.parent&&e.parent.kind===194&&e.parent.extendsType===e))){grammarErrorOnNode(e,wt.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type)}checkSourceElement(e.typeParameter);const t=getSymbolOfDeclaration(e.typeParameter);if(t.declarations&&t.declarations.length>1){const e=getSymbolLinks(t);if(!e.typeParametersChecked){e.typeParametersChecked=true;const n=getDeclaredTypeOfTypeParameter(t);const r=getDeclarationsOfKind(t,168);if(!areTypeParametersIdentical(r,[n],(e=>[e]))){const e=symbolToString(t);for(const t of r){error2(t.name,wt.All_declarations_of_0_must_have_identical_constraints,e)}}}}registerForUnusedIdentifiersCheck(e)}function checkTemplateLiteralType(e){for(const t of e.templateSpans){checkSourceElement(t.type);const e=getTypeFromTypeNode(t.type);checkTypeAssignableTo(e,ct,t.type)}getTypeFromTypeNode(e)}function checkImportType(e){checkSourceElement(e.argument);if(e.attributes){getResolutionModeOverride(e.attributes,grammarErrorOnNode)}checkTypeReferenceOrImport(e)}function checkNamedTupleMember(e){if(e.dotDotDotToken&&e.questionToken){grammarErrorOnNode(e,wt.A_tuple_member_cannot_be_both_optional_and_rest)}if(e.type.kind===190){grammarErrorOnNode(e.type,wt.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type)}if(e.type.kind===191){grammarErrorOnNode(e.type,wt.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type)}checkSourceElement(e.type);getTypeFromTypeNode(e)}function isPrivateWithinAmbient(e){return(hasEffectiveModifier(e,2)||isPrivateIdentifierClassElementDeclaration(e))&&!!(e.flags&33554432)}function getEffectiveDeclarationFlags(e,t){let n=getCombinedModifierFlagsCached(e);if(e.parent.kind!==264&&e.parent.kind!==263&&e.parent.kind!==231&&e.flags&33554432){const t=getEnclosingContainer(e);if(t&&t.flags&128&&!(n&128)&&!(isModuleBlock(e.parent)&&isModuleDeclaration(e.parent.parent)&&isGlobalScopeAugmentation(e.parent.parent))){n|=32}n|=128}return n&t}function checkFunctionOrConstructorSymbol(e){addLazyDiagnostic((()=>checkFunctionOrConstructorSymbolWorker(e)))}function checkFunctionOrConstructorSymbolWorker(e){function getCanonicalOverload(e,t){const n=t!==void 0&&t.parent===e[0].parent;return n?t:e[0]}function checkFlagAgreementBetweenOverloads(e,t,n,r,i){const o=r^i;if(o!==0){const r=getEffectiveDeclarationFlags(getCanonicalOverload(e,t),n);group(e,(e=>getSourceFileOfNode(e).fileName)).forEach((e=>{const i=getEffectiveDeclarationFlags(getCanonicalOverload(e,t),n);for(const t of e){const e=getEffectiveDeclarationFlags(t,n)^r;const o=getEffectiveDeclarationFlags(t,n)^i;if(o&32){error2(getNameOfDeclaration(t),wt.Overload_signatures_must_all_be_exported_or_non_exported)}else if(o&128){error2(getNameOfDeclaration(t),wt.Overload_signatures_must_all_be_ambient_or_non_ambient)}else if(e&(2|4)){error2(getNameOfDeclaration(t)||t,wt.Overload_signatures_must_all_be_public_private_or_protected)}else if(e&64){error2(getNameOfDeclaration(t),wt.Overload_signatures_must_all_be_abstract_or_non_abstract)}}}))}}function checkQuestionTokenAgreementBetweenOverloads(e,t,n,r){if(n!==r){const n=hasQuestionToken(getCanonicalOverload(e,t));forEach(e,(e=>{const t=hasQuestionToken(e)!==n;if(t){error2(getNameOfDeclaration(e),wt.Overload_signatures_must_all_be_optional_or_required)}}))}}const t=32|128|2|4|64;let n=0;let r=t;let i=false;let o=true;let a=false;let s;let c;let l;const d=e.declarations;const p=(e.flags&16384)!==0;function reportImplementationExpectedError(e){if(e.name&&nodeIsMissing(e.name)){return}let t=false;const n=forEachChild(e.parent,(n=>{if(t){return n}else{t=n===e}}));if(n&&n.pos===e.end){if(n.kind===e.kind){const t=n.name||n;const r=n.name;if(e.name&&r&&(isPrivateIdentifier(e.name)&&isPrivateIdentifier(r)&&e.name.escapedText===r.escapedText||isComputedPropertyName(e.name)&&isComputedPropertyName(r)&&isTypeIdenticalTo(checkComputedPropertyName(e.name),checkComputedPropertyName(r))||isPropertyNameLiteral(e.name)&&isPropertyNameLiteral(r)&&getEscapedTextOfIdentifierOrLiteral(e.name)===getEscapedTextOfIdentifierOrLiteral(r))){const r=(e.kind===174||e.kind===173)&&isStatic(e)!==isStatic(n);if(r){const n=isStatic(e)?wt.Function_overload_must_be_static:wt.Function_overload_must_not_be_static;error2(t,n)}return}if(nodeIsPresent(n.body)){error2(t,wt.Function_implementation_name_must_be_0,declarationNameToString(e.name));return}}}const r=e.name||e;if(p){error2(r,wt.Constructor_implementation_is_missing)}else{if(hasSyntacticModifier(e,64)){error2(r,wt.All_declarations_of_an_abstract_method_must_be_consecutive)}else{error2(r,wt.Function_implementation_is_missing_or_not_immediately_following_the_declaration)}}}let u=false;let f=false;let m=false;const _=[];if(d){for(const e of d){const d=e;const g=d.flags&33554432;const y=d.parent&&(d.parent.kind===264||d.parent.kind===187)||g;if(y){l=void 0}if((d.kind===263||d.kind===231)&&!g){m=true}if(d.kind===262||d.kind===174||d.kind===173||d.kind===176){_.push(d);const e=getEffectiveDeclarationFlags(d,t);n|=e;r&=e;i=i||hasQuestionToken(d);o=o&&hasQuestionToken(d);const m=nodeIsPresent(d.body);if(m&&s){if(p){f=true}else{u=true}}else if((l==null?void 0:l.parent)===d.parent&&l.end!==d.pos){reportImplementationExpectedError(l)}if(m){if(!s){s=d}}else{a=true}l=d;if(!y){c=d}}if(isInJSFile(e)&&isFunctionLike(e)&&e.jsDoc){a=length(getJSDocOverloadTags(e))>0}}}if(f){forEach(_,(e=>{error2(e,wt.Multiple_constructor_implementations_are_not_allowed)}))}if(u){forEach(_,(e=>{error2(getNameOfDeclaration(e)||e,wt.Duplicate_function_implementation)}))}if(m&&!p&&e.flags&16&&d){const t=filter(d,(e=>e.kind===263)).map((e=>createDiagnosticForNode(e,wt.Consider_adding_a_declare_modifier_to_this_class)));forEach(d,(n=>{const r=n.kind===263?wt.Class_declaration_cannot_implement_overload_list_for_0:n.kind===262?wt.Function_with_bodies_can_only_merge_with_classes_that_are_ambient:void 0;if(r){addRelatedInfo(error2(getNameOfDeclaration(n)||n,r,symbolName(e)),...t)}}))}if(c&&!c.body&&!hasSyntacticModifier(c,64)&&!c.questionToken){reportImplementationExpectedError(c)}if(a){if(d){checkFlagAgreementBetweenOverloads(d,s,t,n,r);checkQuestionTokenAgreementBetweenOverloads(d,s,i,o)}if(s){const t=getSignaturesOfSymbol(e);const n=getSignatureFromDeclaration(s);for(const e of t){if(!isImplementationCompatibleWithOverload(n,e)){const t=e.declaration&&isJSDocSignature(e.declaration)?e.declaration.parent.tagName:e.declaration;addRelatedInfo(error2(t,wt.This_overload_signature_is_not_compatible_with_its_implementation_signature),createDiagnosticForNode(s,wt.The_implementation_signature_is_declared_here));break}}}}}function checkExportsOnMergedDeclarations(e){addLazyDiagnostic((()=>checkExportsOnMergedDeclarationsWorker(e)))}function checkExportsOnMergedDeclarationsWorker(e){let t=e.localSymbol;if(!t){t=getSymbolOfDeclaration(e);if(!t.exportSymbol){return}}if(getDeclarationOfKind(t,e.kind)!==e){return}let n=0;let r=0;let i=0;for(const e of t.declarations){const t=getDeclarationSpaces(e);const o=getEffectiveDeclarationFlags(e,32|2048);if(o&32){if(o&2048){i|=t}else{n|=t}}else{r|=t}}const o=n|r;const a=n&r;const s=i&o;if(a||s){for(const e of t.declarations){const t=getDeclarationSpaces(e);const n=getNameOfDeclaration(e);if(t&s){error2(n,wt.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead,declarationNameToString(n))}else if(t&a){error2(n,wt.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,declarationNameToString(n))}}}function getDeclarationSpaces(e){let t=e;switch(t.kind){case 264:case 265:case 346:case 338:case 340:return 2;case 267:return isAmbientModule(t)||getModuleInstanceState(t)!==0?4|1:4;case 263:case 266:case 306:return 2|1;case 307:return 2|1|4;case 277:case 226:const e=t;const n=isExportAssignment(e)?e.expression:e.right;if(!isEntityNameExpression(n)){return 1}t=n;case 271:case 274:case 273:let r=0;const i=resolveAlias(getSymbolOfDeclaration(t));forEach(i.declarations,(e=>{r|=getDeclarationSpaces(e)}));return r;case 260:case 208:case 262:case 276:case 80:return 1;case 173:case 171:return 2;default:return S.failBadSyntaxKind(t)}}}function getAwaitedTypeOfPromise(e,t,n,...r){const i=getPromisedTypeOfPromise(e,t);return i&&getAwaitedType(i,t,n,...r)}function getPromisedTypeOfPromise(e,t,n){if(isTypeAny(e)){return void 0}const r=e;if(r.promisedTypeOfPromise){return r.promisedTypeOfPromise}if(isReferenceToType2(e,getGlobalPromiseType(false))){return r.promisedTypeOfPromise=getTypeArguments(e)[0]}if(allTypesAssignableToKind(getBaseConstraintOrType(e),402784252|131072)){return void 0}const i=getTypeOfPropertyOfType(e,"then");if(isTypeAny(i)){return void 0}const o=i?getSignaturesOfType(i,0):d;if(o.length===0){if(t){error2(t,wt.A_promise_must_have_a_then_method)}return void 0}let a;let s;for(const t of o){const n=getThisTypeOfSignature(t);if(n&&n!==Ze&&!isTypeRelatedTo(e,n,vi)){a=n}else{s=append(s,t)}}if(!s){S.assertIsDefined(a);if(n){n.value=a}if(t){error2(t,wt.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1,typeToString(e),typeToString(a))}return void 0}const c=getTypeWithFacts(getUnionType(map(s,getTypeOfFirstParameterOfSignature)),2097152);if(isTypeAny(c)){return void 0}const l=getSignaturesOfType(c,0);if(l.length===0){if(t){error2(t,wt.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback)}return void 0}return r.promisedTypeOfPromise=getUnionType(map(l,getTypeOfFirstParameterOfSignature),2)}function checkAwaitedType(e,t,n,r,...i){const o=t?getAwaitedType(e,n,r,...i):getAwaitedTypeNoAlias(e,n,r,...i);return o||Ie}function isThenableType(e){if(allTypesAssignableToKind(getBaseConstraintOrType(e),402784252|131072)){return false}const t=getTypeOfPropertyOfType(e,"then");return!!t&&getSignaturesOfType(getTypeWithFacts(t,2097152),0).length>0}function isAwaitedTypeInstantiation(e){var t;if(e.flags&16777216){const n=getGlobalAwaitedSymbol(false);return!!n&&e.aliasSymbol===n&&((t=e.aliasTypeArguments)==null?void 0:t.length)===1}return false}function unwrapAwaitedType(e){return e.flags&1048576?mapType(e,unwrapAwaitedType):isAwaitedTypeInstantiation(e)?e.aliasTypeArguments[0]:e}function isAwaitedTypeNeeded(e){if(isTypeAny(e)||isAwaitedTypeInstantiation(e)){return false}if(isGenericObjectType(e)){const t=getBaseConstraintOfType(e);if(t?t.flags&3||isEmptyObjectType(t)||someType(t,isThenableType):maybeTypeOfKind(e,8650752)){return true}}return false}function tryCreateAwaitedType(e){const t=getGlobalAwaitedSymbol(true);if(t){return getTypeAliasInstantiation(t,[unwrapAwaitedType(e)])}return void 0}function createAwaitedTypeIfNeeded(e){if(isAwaitedTypeNeeded(e)){return tryCreateAwaitedType(e)??e}S.assert(isAwaitedTypeInstantiation(e)||getPromisedTypeOfPromise(e)===void 0,"type provided should not be a non-generic 'promise'-like.");return e}function getAwaitedType(e,t,n,...r){const i=getAwaitedTypeNoAlias(e,t,n,...r);return i&&createAwaitedTypeIfNeeded(i)}function getAwaitedTypeNoAlias(e,t,n,...r){if(isTypeAny(e)){return e}if(isAwaitedTypeInstantiation(e)){return e}const i=e;if(i.awaitedTypeOfType){return i.awaitedTypeOfType}if(e.flags&1048576){if(ui.lastIndexOf(e.id)>=0){if(t){error2(t,wt.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method)}return void 0}const o=t?e=>getAwaitedTypeNoAlias(e,t,n,...r):getAwaitedTypeNoAlias;ui.push(e.id);const a=mapType(e,o);ui.pop();return i.awaitedTypeOfType=a}if(isAwaitedTypeNeeded(e)){return i.awaitedTypeOfType=e}const o={value:void 0};const a=getPromisedTypeOfPromise(e,void 0,o);if(a){if(e.id===a.id||ui.lastIndexOf(a.id)>=0){if(t){error2(t,wt.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method)}return void 0}ui.push(e.id);const o=getAwaitedTypeNoAlias(a,t,n,...r);ui.pop();if(!o){return void 0}return i.awaitedTypeOfType=o}if(isThenableType(e)){if(t){S.assertIsDefined(n);let i;if(o.value){i=chainDiagnosticMessages(i,wt.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1,typeToString(e),typeToString(o.value))}i=chainDiagnosticMessages(i,n,...r);gi.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(t),t,i))}return void 0}return i.awaitedTypeOfType=e}function checkAsyncFunctionReturnType(e,t,n){const r=getTypeFromTypeNode(t);if(v>=2){if(isErrorType(r)){return}const e=getGlobalPromiseType(true);if(e!==Et&&!isReferenceToType2(r,e)){reportErrorForInvalidReturnType(wt.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0,t,n,typeToString(getAwaitedTypeNoAlias(r)||Ze));return}}else{markLinkedReferences(e,5);if(isErrorType(r)){return}const i=getEntityNameFromTypeNode(t);if(i===void 0){reportErrorForInvalidReturnType(wt.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,t,n,typeToString(r));return}const o=resolveEntityName(i,111551,true);const a=o?getTypeOfSymbol(o):Ie;if(isErrorType(a)){if(i.kind===80&&i.escapedText==="Promise"&&getTargetType(r)===getGlobalPromiseType(false)){error2(n,wt.An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option)}else{reportErrorForInvalidReturnType(wt.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,t,n,entityNameToString(i))}return}const s=getGlobalPromiseConstructorLikeType(true);if(s===ht){reportErrorForInvalidReturnType(wt.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,t,n,entityNameToString(i));return}const c=wt.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value;const errorInfo=()=>t===n?void 0:chainDiagnosticMessages(void 0,wt.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);if(!checkTypeAssignableTo(a,s,n,c,errorInfo)){return}const l=i&&getFirstIdentifier(i);const d=getSymbol2(e.locals,l.escapedText,111551);if(d){error2(d.valueDeclaration,wt.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,idText(l),entityNameToString(i));return}}checkAwaitedType(r,false,e,wt.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);function reportErrorForInvalidReturnType(e,t,n,r){if(t===n){error2(n,e,r)}else{const i=error2(n,wt.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);addRelatedInfo(i,createDiagnosticForNode(t,e,r))}}}function checkGrammarDecorator(e){const t=getSourceFileOfNode(e);if(!hasParseDiagnostics(t)){let t=e.expression;if(isParenthesizedExpression(t)){return false}let n=true;let r;while(true){if(isExpressionWithTypeArguments(t)||isNonNullExpression(t)){t=t.expression;continue}if(isCallExpression(t)){if(!n){r=t}if(t.questionDotToken){r=t.questionDotToken}t=t.expression;n=false;continue}if(isPropertyAccessExpression(t)){if(t.questionDotToken){r=t.questionDotToken}t=t.expression;n=false;continue}if(!isIdentifier(t)){r=t}break}if(r){addRelatedInfo(error2(e.expression,wt.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator),createDiagnosticForNode(r,wt.Invalid_syntax_in_decorator));return true}}return false}function checkDecorator(e){checkGrammarDecorator(e);const t=getResolvedSignature(e);checkDeprecatedSignature(t,e);const n=getReturnTypeOfSignature(t);if(n.flags&1){return}const r=getDecoratorCallSignature(e);if(!(r==null?void 0:r.resolvedReturnType))return;let i;const o=r.resolvedReturnType;switch(e.parent.kind){case 263:case 231:i=wt.Decorator_function_return_type_0_is_not_assignable_to_type_1;break;case 172:if(!b){i=wt.Decorator_function_return_type_0_is_not_assignable_to_type_1;break}case 169:i=wt.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;break;case 174:case 177:case 178:i=wt.Decorator_function_return_type_0_is_not_assignable_to_type_1;break;default:return S.failBadSyntaxKind(e.parent)}checkTypeAssignableTo(n,o,e.expression,i)}function createCallSignature(e,t,n,r,i,o=n.length,a=0){const s=zr.createFunctionTypeNode(void 0,d,zr.createKeywordTypeNode(133));return createSignature(s,e,t,n,r,i,o,a)}function createFunctionType(e,t,n,r,i,o,a){const s=createCallSignature(e,t,n,r,i,o,a);return getOrCreateTypeFromSignature(s)}function createGetterFunctionType(e){return createFunctionType(void 0,void 0,d,e)}function createSetterFunctionType(e){const t=createParameter2("value",e);return createFunctionType(void 0,void 0,[t],Ze)}function getEntityNameForDecoratorMetadata(e){if(e){switch(e.kind){case 193:case 192:return getEntityNameForDecoratorMetadataFromTypeList(e.types);case 194:return getEntityNameForDecoratorMetadataFromTypeList([e.trueType,e.falseType]);case 196:case 202:return getEntityNameForDecoratorMetadata(e.type);case 183:return e.typeName}}}function getEntityNameForDecoratorMetadataFromTypeList(e){let t;for(let n of e){while(n.kind===196||n.kind===202){n=n.type}if(n.kind===146){continue}if(!k&&(n.kind===201&&n.literal.kind===106||n.kind===157)){continue}const e=getEntityNameForDecoratorMetadata(n);if(!e){return void 0}if(t){if(!isIdentifier(t)||!isIdentifier(e)||t.escapedText!==e.escapedText){return void 0}}else{t=e}}return t}function getParameterTypeNodeForDecoratorCheck(e){const t=getEffectiveTypeAnnotationNode(e);return isRestParameter(e)?getRestParameterElementType(t):t}function checkDecorators(e){if(!canHaveDecorators(e)||!hasDecorators(e)||!e.modifiers||!nodeCanBeDecorated(b,e,e.parent,e.parent.parent)){return}const t=find(e.modifiers,isDecorator);if(!t){return}if(b){checkExternalEmitHelpers(t,8);if(e.kind===169){checkExternalEmitHelpers(t,32)}}else if(v1){for(let t=1;t0);if(n.length>1){error2(n[1],wt.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag)}const r=getIdentifierFromEntityNameExpression(e.class.expression);const i=getClassExtendsHeritageElement(t);if(i){const t=getIdentifierFromEntityNameExpression(i.expression);if(t&&r.escapedText!==t.escapedText){error2(r,wt.JSDoc_0_1_does_not_match_the_extends_2_clause,idText(e.tagName),idText(r),idText(t))}}}function checkJSDocAccessibilityModifiers(e){const t=getJSDocHost(e);if(t&&isPrivateIdentifierClassElementDeclaration(t)){error2(e,wt.An_accessibility_modifier_cannot_be_used_with_a_private_identifier)}}function getIdentifierFromEntityNameExpression(e){switch(e.kind){case 80:return e;case 211:return e.name;default:return void 0}}function checkFunctionOrMethodDeclaration(e){var t;checkDecorators(e);checkSignatureDeclaration(e);const n=getFunctionFlags(e);if(e.name&&e.name.kind===167){checkComputedPropertyName(e.name)}if(hasBindableName(e)){const n=getSymbolOfDeclaration(e);const r=e.localSymbol||n;const i=(t=r.declarations)==null?void 0:t.find((t=>t.kind===e.kind&&!(t.flags&524288)));if(e===i){checkFunctionOrConstructorSymbol(r)}if(n.parent){checkFunctionOrConstructorSymbol(n)}}const r=e.kind===173?void 0:e.body;checkSourceElement(r);checkAllCodePathsInNonVoidFunctionReturnOrThrow(e,getReturnTypeFromAnnotation(e));addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics);if(isInJSFile(e)){const t=getJSDocTypeTag(e);if(t&&t.typeExpression&&!getContextualCallSignature(getTypeFromTypeNode(t.typeExpression),e)){error2(t.typeExpression.type,wt.The_type_of_a_function_declaration_must_match_the_function_s_signature)}}function checkFunctionOrMethodDeclarationDiagnostics(){if(!getEffectiveReturnTypeNode(e)){if(nodeIsMissing(r)&&!isPrivateWithinAmbient(e)){reportImplicitAny(e,ke)}if(n&1&&nodeIsPresent(r)){getReturnTypeOfSignature(getSignatureFromDeclaration(e))}}}}function registerForUnusedIdentifiersCheck(e){addLazyDiagnostic(registerForUnusedIdentifiersCheckDiagnostics);function registerForUnusedIdentifiersCheckDiagnostics(){const t=getSourceFileOfNode(e);let n=xr.get(t.path);if(!n){n=[];xr.set(t.path,n)}n.push(e)}}function checkUnusedIdentifiers(e,t){for(const n of e){switch(n.kind){case 263:case 231:checkUnusedClassMembers(n,t);checkUnusedTypeParameters(n,t);break;case 307:case 267:case 241:case 269:case 248:case 249:case 250:checkUnusedLocalsAndParameters(n,t);break;case 176:case 218:case 262:case 219:case 174:case 177:case 178:if(n.body){checkUnusedLocalsAndParameters(n,t)}checkUnusedTypeParameters(n,t);break;case 173:case 179:case 180:case 184:case 185:case 265:case 264:checkUnusedTypeParameters(n,t);break;case 195:checkUnusedInferTypeParameter(n,t);break;default:S.assertNever(n,"Node should not have been registered for unused identifiers check")}}}function errorUnusedLocal(e,t,n){const r=getNameOfDeclaration(e)||e;const i=isTypeDeclaration(e)?wt._0_is_declared_but_never_used:wt._0_is_declared_but_its_value_is_never_read;n(e,0,createDiagnosticForNode(r,i,t))}function isIdentifierThatStartsWithUnderscore(e){return isIdentifier(e)&&idText(e).charCodeAt(0)===95}function checkUnusedClassMembers(e,t){for(const n of e.members){switch(n.kind){case 174:case 172:case 177:case 178:if(n.kind===178&&n.symbol.flags&32768){break}const e=getSymbolOfDeclaration(n);if(!e.isReferenced&&(hasEffectiveModifier(n,2)||isNamedDeclaration(n)&&isPrivateIdentifier(n.name))&&!(n.flags&33554432)){t(n,0,createDiagnosticForNode(n.name,wt._0_is_declared_but_its_value_is_never_read,symbolToString(e)))}break;case 176:for(const e of n.parameters){if(!e.symbol.isReferenced&&hasSyntacticModifier(e,2)){t(e,0,createDiagnosticForNode(e.name,wt.Property_0_is_declared_but_its_value_is_never_read,symbolName(e.symbol)))}}break;case 181:case 240:case 175:break;default:S.fail("Unexpected class member")}}}function checkUnusedInferTypeParameter(e,t){const{typeParameter:n}=e;if(isTypeParameterUnused(n)){t(e,1,createDiagnosticForNode(e,wt._0_is_declared_but_its_value_is_never_read,idText(n.name)))}}function checkUnusedTypeParameters(e,t){const n=getSymbolOfDeclaration(e).declarations;if(!n||last(n)!==e)return;const r=getEffectiveTypeParameterDeclarations(e);const i=new Set;for(const e of r){if(!isTypeParameterUnused(e))continue;const n=idText(e.name);const{parent:r}=e;if(r.kind!==195&&r.typeParameters.every(isTypeParameterUnused)){if(tryAddToSet(i,r)){const i=getSourceFileOfNode(r);const o=isJSDocTemplateTag(r)?rangeOfNode(r):rangeOfTypeParameters(i,r.typeParameters);const a=r.typeParameters.length===1;const s=a?[wt._0_is_declared_but_its_value_is_never_read,n]:[wt.All_type_parameters_are_unused];t(e,1,createFileDiagnostic(i,o.pos,o.end-o.pos,...s))}}else{t(e,1,createDiagnosticForNode(e,wt._0_is_declared_but_its_value_is_never_read,n))}}}function isTypeParameterUnused(e){return!(getMergedSymbol(e.symbol).isReferenced&262144)&&!isIdentifierThatStartsWithUnderscore(e.name)}function addToGroup(e,t,n,r){const i=String(r(t));const o=e.get(i);if(o){o[1].push(n)}else{e.set(i,[t,[n]])}}function tryGetRootParameterDeclaration(e){return tryCast(getRootDeclaration(e),isParameter)}function isValidUnusedLocalDeclaration(e){if(isBindingElement(e)){if(isObjectBindingPattern(e.parent)){return!!(e.propertyName&&isIdentifierThatStartsWithUnderscore(e.name))}return isIdentifierThatStartsWithUnderscore(e.name)}return isAmbientModule(e)||(isVariableDeclaration(e)&&isForInOrOfStatement(e.parent.parent)||isImportedDeclaration(e))&&isIdentifierThatStartsWithUnderscore(e.name)}function checkUnusedLocalsAndParameters(e,t){const n=new Map;const r=new Map;const i=new Map;e.locals.forEach((e=>{if(e.flags&262144?!(e.flags&3&&!(e.isReferenced&3)):e.isReferenced||e.exportSymbol){return}if(e.declarations){for(const o of e.declarations){if(isValidUnusedLocalDeclaration(o)){continue}if(isImportedDeclaration(o)){addToGroup(n,importClauseFromImported(o),o,getNodeId)}else if(isBindingElement(o)&&isObjectBindingPattern(o.parent)){const e=last(o.parent.elements);if(o===e||!last(o.parent.elements).dotDotDotToken){addToGroup(r,o.parent,o,getNodeId)}}else if(isVariableDeclaration(o)){const e=getCombinedNodeFlagsCached(o)&7;const t=getNameOfDeclaration(o);if(e!==4&&e!==6||!t||!isIdentifierThatStartsWithUnderscore(t)){addToGroup(i,o.parent,o,getNodeId)}}else{const n=e.valueDeclaration&&tryGetRootParameterDeclaration(e.valueDeclaration);const i=e.valueDeclaration&&getNameOfDeclaration(e.valueDeclaration);if(n&&i){if(!isParameterPropertyDeclaration(n,n.parent)&&!parameterIsThisKeyword(n)&&!isIdentifierThatStartsWithUnderscore(i)){if(isBindingElement(o)&&isArrayBindingPattern(o.parent)){addToGroup(r,o.parent,o,getNodeId)}else{t(n,1,createDiagnosticForNode(i,wt._0_is_declared_but_its_value_is_never_read,symbolName(e)))}}}else{errorUnusedLocal(o,symbolName(e),t)}}}}}));n.forEach((([e,n])=>{const r=e.parent;const i=(e.name?1:0)+(e.namedBindings?e.namedBindings.kind===274?1:e.namedBindings.elements.length:0);if(i===n.length){t(r,0,n.length===1?createDiagnosticForNode(r,wt._0_is_declared_but_its_value_is_never_read,idText(first(n).name)):createDiagnosticForNode(r,wt.All_imports_in_import_declaration_are_unused))}else{for(const e of n)errorUnusedLocal(e,idText(e.name),t)}}));r.forEach((([e,n])=>{const r=tryGetRootParameterDeclaration(e.parent)?1:0;if(e.elements.length===n.length){if(n.length===1&&e.parent.kind===260&&e.parent.parent.kind===261){addToGroup(i,e.parent.parent,e.parent,getNodeId)}else{t(e,r,n.length===1?createDiagnosticForNode(e,wt._0_is_declared_but_its_value_is_never_read,bindingNameText(first(n).name)):createDiagnosticForNode(e,wt.All_destructured_elements_are_unused))}}else{for(const e of n){t(e,r,createDiagnosticForNode(e,wt._0_is_declared_but_its_value_is_never_read,bindingNameText(e.name)))}}}));i.forEach((([e,n])=>{if(e.declarations.length===n.length){t(e,0,n.length===1?createDiagnosticForNode(first(n).name,wt._0_is_declared_but_its_value_is_never_read,bindingNameText(first(n).name)):createDiagnosticForNode(e.parent.kind===243?e.parent:e,wt.All_variables_are_unused))}else{for(const e of n){t(e,0,createDiagnosticForNode(e,wt._0_is_declared_but_its_value_is_never_read,bindingNameText(e.name)))}}}))}function checkPotentialUncheckedRenamedBindingElementsInTypes(){var e;for(const t of pi){if(!((e=getSymbolOfDeclaration(t))==null?void 0:e.isReferenced)){const e=walkUpBindingElementsAndPatterns(t);S.assert(isPartOfParameterDeclaration(e),"Only parameter declaration should be checked here");const n=createDiagnosticForNode(t.name,wt._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation,declarationNameToString(t.name),declarationNameToString(t.propertyName));if(!e.type){addRelatedInfo(n,createFileDiagnostic(getSourceFileOfNode(e),e.end,0,wt.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here,declarationNameToString(t.propertyName)))}gi.add(n)}}}function bindingNameText(e){switch(e.kind){case 80:return idText(e);case 207:case 206:return bindingNameText(cast(first(e.elements),isBindingElement).name);default:return S.assertNever(e)}}function isImportedDeclaration(e){return e.kind===273||e.kind===276||e.kind===274}function importClauseFromImported(e){return e.kind===273?e:e.kind===274?e.parent:e.parent.parent}function checkBlock(e){if(e.kind===241){checkGrammarStatementInAmbientContext(e)}if(isFunctionOrModuleBlock(e)){const t=Nr;forEach(e.statements,checkSourceElement);Nr=t}else{forEach(e.statements,checkSourceElement)}if(e.locals){registerForUnusedIdentifiersCheck(e)}}function checkCollisionWithArgumentsInGeneratedCode(e){if(v>=2||!hasRestParameter(e)||e.flags&33554432||nodeIsMissing(e.body)){return}forEach(e.parameters,(e=>{if(e.name&&!isBindingPattern(e.name)&&e.name.escapedText===q.escapedName){errorSkippedOn("noEmit",e,wt.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters)}}))}function needCollisionCheckForIdentifier(e,t,n){if((t==null?void 0:t.escapedText)!==n){return false}if(e.kind===172||e.kind===171||e.kind===174||e.kind===173||e.kind===177||e.kind===178||e.kind===303){return false}if(e.flags&33554432){return false}if(isImportClause(e)||isImportEqualsDeclaration(e)||isImportSpecifier(e)){if(isTypeOnlyImportOrExportDeclaration(e)){return false}}const r=getRootDeclaration(e);if(isParameter(r)&&nodeIsMissing(r.parent.body)){return false}return true}function checkIfThisIsCapturedInEnclosingScope(e){findAncestor(e,(t=>{if(getNodeCheckFlags(t)&4){const t=e.kind!==80;if(t){error2(getNameOfDeclaration(e),wt.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference)}else{error2(e,wt.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference)}return true}return false}))}function checkIfNewTargetIsCapturedInEnclosingScope(e){findAncestor(e,(t=>{if(getNodeCheckFlags(t)&8){const t=e.kind!==80;if(t){error2(getNameOfDeclaration(e),wt.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference)}else{error2(e,wt.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference)}return true}return false}))}function checkCollisionWithRequireExportsInGeneratedCode(t,n){if(e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))>=5){return}if(!n||!needCollisionCheckForIdentifier(t,n,"require")&&!needCollisionCheckForIdentifier(t,n,"exports")){return}if(isModuleDeclaration(t)&&getModuleInstanceState(t)!==1){return}const r=getDeclarationContainer(t);if(r.kind===307&&isExternalOrCommonJsModule(r)){errorSkippedOn("noEmit",n,wt.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module,declarationNameToString(n),declarationNameToString(n))}}function checkCollisionWithGlobalPromiseInGeneratedCode(e,t){if(!t||v>=4||!needCollisionCheckForIdentifier(e,t,"Promise")){return}if(isModuleDeclaration(e)&&getModuleInstanceState(e)!==1){return}const n=getDeclarationContainer(e);if(n.kind===307&&isExternalOrCommonJsModule(n)&&n.flags&4096){errorSkippedOn("noEmit",t,wt.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions,declarationNameToString(t),declarationNameToString(t))}}function recordPotentialCollisionWithWeakMapSetInGeneratedCode(e,t){if(v<=8&&(needCollisionCheckForIdentifier(e,t,"WeakMap")||needCollisionCheckForIdentifier(e,t,"WeakSet"))){li.push(e)}}function checkWeakMapSetCollision(e){const t=getEnclosingBlockScopeContainer(e);if(getNodeCheckFlags(t)&1048576){S.assert(isNamedDeclaration(e)&&isIdentifier(e.name)&&typeof e.name.escapedText==="string","The target of a WeakMap/WeakSet collision check should be an identifier");errorSkippedOn("noEmit",e,wt.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel,e.name.escapedText)}}function recordPotentialCollisionWithReflectInGeneratedCode(e,t){if(t&&v>=2&&v<=8&&needCollisionCheckForIdentifier(e,t,"Reflect")){di.push(e)}}function checkReflectCollision(e){let t=false;if(isClassExpression(e)){for(const n of e.members){if(getNodeCheckFlags(n)&2097152){t=true;break}}}else if(isFunctionExpression(e)){if(getNodeCheckFlags(e)&2097152){t=true}}else{const n=getEnclosingBlockScopeContainer(e);if(n&&getNodeCheckFlags(n)&2097152){t=true}}if(t){S.assert(isNamedDeclaration(e)&&isIdentifier(e.name),"The target of a Reflect collision check should be an identifier");errorSkippedOn("noEmit",e,wt.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers,declarationNameToString(e.name),"Reflect")}}function checkCollisionsForDeclarationName(e,t){if(!t)return;checkCollisionWithRequireExportsInGeneratedCode(e,t);checkCollisionWithGlobalPromiseInGeneratedCode(e,t);recordPotentialCollisionWithWeakMapSetInGeneratedCode(e,t);recordPotentialCollisionWithReflectInGeneratedCode(e,t);if(isClassLike(e)){checkTypeNameIsReserved(t,wt.Class_name_cannot_be_0);if(!(e.flags&33554432)){checkClassNameCollisionWithObject(t)}}else if(isEnumDeclaration(e)){checkTypeNameIsReserved(t,wt.Enum_name_cannot_be_0)}}function checkVarDeclaredNamesNotShadowed(e){if((getCombinedNodeFlagsCached(e)&7)!==0||isPartOfParameterDeclaration(e)){return}const t=getSymbolOfDeclaration(e);if(t.flags&1){if(!isIdentifier(e.name))return S.fail();const n=te(e,e.name.escapedText,3,void 0,false);if(n&&n!==t&&n.flags&2){if(getDeclarationNodeFlagsFromSymbol(n)&7){const t=getAncestor(n.valueDeclaration,261);const r=t.parent.kind===243&&t.parent.parent?t.parent.parent:void 0;const i=r&&(r.kind===241&&isFunctionLike(r.parent)||r.kind===268||r.kind===267||r.kind===307);if(!i){const t=symbolToString(n);error2(e,wt.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1,t,t)}}}}}function convertAutoToAny(e){return e===Fe?ke:e===hn?yn:e}function checkVariableLikeDeclaration(e){var t;checkDecorators(e);if(!isBindingElement(e)){checkSourceElement(e.type)}if(!e.name){return}if(e.name.kind===167){checkComputedPropertyName(e.name);if(hasOnlyExpressionInitializer(e)&&e.initializer){checkExpressionCached(e.initializer)}}if(isBindingElement(e)){if(e.propertyName&&isIdentifier(e.name)&&isPartOfParameterDeclaration(e)&&nodeIsMissing(getContainingFunction(e).body)){pi.push(e);return}if(isObjectBindingPattern(e.parent)&&e.dotDotDotToken&&v1){if(some(n.declarations,(t=>t!==e&&isVariableLike(t)&&!areDeclarationFlagsIdentical(t,e)))){error2(e.name,wt.All_declarations_of_0_must_have_identical_modifiers,declarationNameToString(e.name))}}}else{const t=convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(e));if(!isErrorType(r)&&!isErrorType(t)&&!isTypeIdenticalTo(r,t)&&!(n.flags&67108864)){errorNextVariableOrPropertyDeclarationMustHaveSameType(n.valueDeclaration,r,e,t)}if(hasOnlyExpressionInitializer(e)&&e.initializer){checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(e.initializer),t,e,e.initializer,void 0)}if(n.valueDeclaration&&!areDeclarationFlagsIdentical(e,n.valueDeclaration)){error2(e.name,wt.All_declarations_of_0_must_have_identical_modifiers,declarationNameToString(e.name))}}if(e.kind!==172&&e.kind!==171){checkExportsOnMergedDeclarations(e);if(e.kind===260||e.kind===208){checkVarDeclaredNamesNotShadowed(e)}checkCollisionsForDeclarationName(e,e.name)}}function errorNextVariableOrPropertyDeclarationMustHaveSameType(e,t,n,r){const i=getNameOfDeclaration(n);const o=n.kind===172||n.kind===171?wt.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:wt.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;const a=declarationNameToString(i);const s=error2(i,o,a,typeToString(t),typeToString(r));if(e){addRelatedInfo(s,createDiagnosticForNode(e,wt._0_was_also_declared_here,a))}}function areDeclarationFlagsIdentical(e,t){if(e.kind===169&&t.kind===260||e.kind===260&&t.kind===169){return true}if(hasQuestionToken(e)!==hasQuestionToken(t)){return false}const n=2|4|1024|64|8|256;return getSelectedEffectiveModifierFlags(e,n)===getSelectedEffectiveModifierFlags(t,n)}function checkVariableDeclaration(e){var t,n;(t=G)==null?void 0:t.push(G.Phase.Check,"checkVariableDeclaration",{kind:e.kind,pos:e.pos,end:e.end,path:e.tracingPath});checkGrammarVariableDeclaration(e);checkVariableLikeDeclaration(e);(n=G)==null?void 0:n.pop()}function checkBindingElement(e){checkGrammarBindingElement(e);return checkVariableLikeDeclaration(e)}function checkVariableDeclarationList(e){const t=getCombinedNodeFlags(e)&7;if((t===4||t===6)&&v=2;const s=!a&&T.downlevelIteration;const c=T.noUncheckedIndexedAccess&&!!(e&128);if(a||s||o){const o=getIterationTypesOfIterable(t,e,a?r:void 0);if(i){if(o){const t=e&8?wt.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:e&32?wt.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:e&64?wt.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:e&16?wt.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:void 0;if(t){checkTypeAssignableTo(n,o.nextType,r,t)}}}if(o||a){return c?includeUndefinedInIndexSignature(o&&o.yieldType):o&&o.yieldType}}let l=t;let d=false;if(e&4){if(l.flags&1048576){const e=t.types;const n=filter(e,(e=>!(e.flags&402653316)));if(n!==e){l=getUnionType(n,2)}}else if(l.flags&402653316){l=et}d=l!==t;if(d){if(l.flags&131072){return c?includeUndefinedInIndexSignature(ze):ze}}}if(!isArrayLikeType(l)){if(r){const t=!!(e&4)&&!d;const[n,i]=getIterationDiagnosticDetails(t,s);errorAndMaybeSuggestAwait(r,i&&!!getAwaitedTypeOfPromise(l),n,typeToString(l))}return d?c?includeUndefinedInIndexSignature(ze):ze:void 0}const p=getIndexTypeOfType(l,Ve);if(d&&p){if(p.flags&402653316&&!T.noUncheckedIndexedAccess){return ze}return getUnionType(c?[p,ze,Me]:[p,ze],2)}return e&128?includeUndefinedInIndexSignature(p):p;function getIterationDiagnosticDetails(n,r){var i;if(r){return n?[wt.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,true]:[wt.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,true]}const o=getIterationTypeOfIterable(e,0,t,void 0);if(o){return[wt.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,false]}if(isES2015OrLaterIterable((i=t.symbol)==null?void 0:i.escapedName)){return[wt.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,true]}return n?[wt.Type_0_is_not_an_array_type_or_a_string_type,true]:[wt.Type_0_is_not_an_array_type,true]}}function isES2015OrLaterIterable(e){switch(e){case"Float32Array":case"Float64Array":case"Int16Array":case"Int32Array":case"Int8Array":case"NodeList":case"Uint16Array":case"Uint32Array":case"Uint8Array":case"Uint8ClampedArray":return true}return false}function getIterationTypeOfIterable(e,t,n,r){if(isTypeAny(n)){return void 0}const i=getIterationTypesOfIterable(n,e,r);return i&&i[getIterationTypesKeyFromIterationTypeKind(t)]}function createIterationTypes(e=et,t=et,n=Le){if(e.flags&67359327&&t.flags&(1|131072|2|16384|32768)&&n.flags&(1|131072|2|16384|32768)){const r=getTypeListId([e,t,n]);let i=zt.get(r);if(!i){i={yieldType:e,returnType:t,nextType:n};zt.set(r,i)}return i}return{yieldType:e,returnType:t,nextType:n}}function combineIterationTypes(e){let t;let n;let r;for(const i of e){if(i===void 0||i===Vt){continue}if(i===qt){return qt}t=append(t,i.yieldType);n=append(n,i.returnType);r=append(r,i.nextType)}if(t||n||r){return createIterationTypes(t&&getUnionType(t),n&&getUnionType(n),r&&getIntersectionType(r))}return Vt}function getCachedIterationTypes(e,t){return e[t]}function setCachedIterationTypes(e,t,n){return e[t]=n}function getIterationTypesOfIterable(e,t,n){var r,i;if(isTypeAny(e)){return qt}if(!(e.flags&1048576)){const i=n?{errors:void 0,skipLogging:true}:void 0;const o=getIterationTypesOfIterableWorker(e,t,n,i);if(o===Vt){if(n){const r=reportTypeNotIterableError(n,e,!!(t&2));if(i==null?void 0:i.errors){addRelatedInfo(r,...i.errors)}}return void 0}else if((r=i==null?void 0:i.errors)==null?void 0:r.length){for(const e of i.errors){gi.add(e)}}return o}const o=t&2?"iterationTypesOfAsyncIterable":"iterationTypesOfIterable";const a=getCachedIterationTypes(e,o);if(a)return a===Vt?void 0:a;let s;for(const r of e.types){const a=n?{errors:void 0}:void 0;const c=getIterationTypesOfIterableWorker(r,t,n,a);if(c===Vt){if(n){const r=reportTypeNotIterableError(n,e,!!(t&2));if(a==null?void 0:a.errors){addRelatedInfo(r,...a.errors)}}setCachedIterationTypes(e,o,Vt);return void 0}else if((i=a==null?void 0:a.errors)==null?void 0:i.length){for(const e of a.errors){gi.add(e)}}s=append(s,c)}const c=s?combineIterationTypes(s):Vt;setCachedIterationTypes(e,o,c);return c===Vt?void 0:c}function getAsyncFromSyncIterationTypes(e,t){if(e===Vt)return Vt;if(e===qt)return qt;const{yieldType:n,returnType:r,nextType:i}=e;if(t){getGlobalAwaitedSymbol(true)}return createIterationTypes(getAwaitedType(n,t)||ke,getAwaitedType(r,t)||ke,i)}function getIterationTypesOfIterableWorker(e,t,n,r){if(isTypeAny(e)){return qt}let i=false;if(t&2){const r=getIterationTypesOfIterableCached(e,Ht)||getIterationTypesOfIterableFast(e,Ht);if(r){if(r===Vt&&n){i=true}else{return t&8?getAsyncFromSyncIterationTypes(r,n):r}}}if(t&1){let r=getIterationTypesOfIterableCached(e,Gt)||getIterationTypesOfIterableFast(e,Gt);if(r){if(r===Vt&&n){i=true}else{if(t&2){if(r!==Vt){r=getAsyncFromSyncIterationTypes(r,n);return i?r:setCachedIterationTypes(e,"iterationTypesOfAsyncIterable",r)}}else{return r}}}}if(t&2){const t=getIterationTypesOfIterableSlow(e,Ht,n,r,i);if(t!==Vt){return t}}if(t&1){let o=getIterationTypesOfIterableSlow(e,Gt,n,r,i);if(o!==Vt){if(t&2){o=getAsyncFromSyncIterationTypes(o,n);return i?o:setCachedIterationTypes(e,"iterationTypesOfAsyncIterable",o)}else{return o}}}return Vt}function getIterationTypesOfIterableCached(e,t){return getCachedIterationTypes(e,t.iterableCacheKey)}function getIterationTypesOfIterableFast(e,t){if(isReferenceToType2(e,t.getGlobalIterableType(false))||isReferenceToType2(e,t.getGlobalIteratorObjectType(false))||isReferenceToType2(e,t.getGlobalIterableIteratorType(false))||isReferenceToType2(e,t.getGlobalGeneratorType(false))){const[n,r,i]=getTypeArguments(e);return setCachedIterationTypes(e,t.iterableCacheKey,createIterationTypes(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(r,void 0)||r,i))}if(isReferenceToSomeType(e,t.getGlobalBuiltinIteratorTypes())){const[n]=getTypeArguments(e);const r=getBuiltinIteratorReturnType();const i=Le;return setCachedIterationTypes(e,t.iterableCacheKey,createIterationTypes(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(r,void 0)||r,i))}}function getPropertyNameForKnownSymbolName(e){const t=getGlobalESSymbolConstructorSymbol(false);const n=t&&getTypeOfPropertyOfType(getTypeOfSymbol(t),escapeLeadingUnderscores(e));return n&&isTypeUsableAsPropertyName(n)?getPropertyNameFromType(n):`__@${e}`}function getIterationTypesOfIterableSlow(e,t,n,r,i){const o=getPropertyOfType(e,getPropertyNameForKnownSymbolName(t.iteratorSymbolName));const a=o&&!(o.flags&16777216)?getTypeOfSymbol(o):void 0;if(isTypeAny(a)){return i?qt:setCachedIterationTypes(e,t.iterableCacheKey,qt)}const s=a?getSignaturesOfType(a,0):void 0;const c=filter(s,(e=>getMinArgumentCount(e)===0));if(!some(c)){if(n&&some(s)){checkTypeAssignableTo(e,t.getGlobalIterableType(true),n,void 0,void 0,r)}return i?Vt:setCachedIterationTypes(e,t.iterableCacheKey,Vt)}const l=getIntersectionType(map(c,getReturnTypeOfSignature));const d=getIterationTypesOfIteratorWorker(l,t,n,r,i)??Vt;return i?d:setCachedIterationTypes(e,t.iterableCacheKey,d)}function reportTypeNotIterableError(e,t,n){const r=n?wt.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:wt.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;const i=!!getAwaitedTypeOfPromise(t)||!n&&isForOfStatement(e.parent)&&e.parent.expression===e&&getGlobalAsyncIterableType(false)!==Et&&isTypeAssignableTo(t,createTypeFromGenericGlobalType(getGlobalAsyncIterableType(false),[ke,ke,ke]));return errorAndMaybeSuggestAwait(e,i,r,typeToString(t))}function getIterationTypesOfIterator(e,t,n,r){return getIterationTypesOfIteratorWorker(e,t,n,r,false)}function getIterationTypesOfIteratorWorker(e,t,n,r,i){if(isTypeAny(e)){return qt}let o=getIterationTypesOfIteratorCached(e,t)||getIterationTypesOfIteratorFast(e,t);if(o===Vt&&n){o=void 0;i=true}o??(o=getIterationTypesOfIteratorSlow(e,t,n,r,i));return o===Vt?void 0:o}function getIterationTypesOfIteratorCached(e,t){return getCachedIterationTypes(e,t.iteratorCacheKey)}function getIterationTypesOfIteratorFast(e,t){if(isReferenceToType2(e,t.getGlobalIterableIteratorType(false))||isReferenceToType2(e,t.getGlobalIteratorType(false))||isReferenceToType2(e,t.getGlobalIteratorObjectType(false))||isReferenceToType2(e,t.getGlobalGeneratorType(false))){const[n,r,i]=getTypeArguments(e);return setCachedIterationTypes(e,t.iteratorCacheKey,createIterationTypes(n,r,i))}if(isReferenceToSomeType(e,t.getGlobalBuiltinIteratorTypes())){const[n]=getTypeArguments(e);const r=getBuiltinIteratorReturnType();const i=Le;return setCachedIterationTypes(e,t.iteratorCacheKey,createIterationTypes(n,r,i))}}function isIteratorResult(e,t){const n=getTypeOfPropertyOfType(e,"done")||He;return isTypeAssignableTo(t===0?He:Ke,n)}function isYieldIteratorResult(e){return isIteratorResult(e,0)}function isReturnIteratorResult(e){return isIteratorResult(e,1)}function getIterationTypesOfIteratorResult(e){if(isTypeAny(e)){return qt}const t=getCachedIterationTypes(e,"iterationTypesOfIteratorResult");if(t){return t}if(isReferenceToType2(e,getGlobalIteratorYieldResultType(false))){const t=getTypeArguments(e)[0];return setCachedIterationTypes(e,"iterationTypesOfIteratorResult",createIterationTypes(t,void 0,void 0))}if(isReferenceToType2(e,getGlobalIteratorReturnResultType(false))){const t=getTypeArguments(e)[0];return setCachedIterationTypes(e,"iterationTypesOfIteratorResult",createIterationTypes(void 0,t,void 0))}const n=filterType(e,isYieldIteratorResult);const r=n!==et?getTypeOfPropertyOfType(n,"value"):void 0;const i=filterType(e,isReturnIteratorResult);const o=i!==et?getTypeOfPropertyOfType(i,"value"):void 0;if(!r&&!o){return setCachedIterationTypes(e,"iterationTypesOfIteratorResult",Vt)}return setCachedIterationTypes(e,"iterationTypesOfIteratorResult",createIterationTypes(r,o||Ze,void 0))}function getIterationTypesOfMethod(e,t,n,r,i){var o,a,s,c;const l=getPropertyOfType(e,n);if(!l&&n!=="next"){return void 0}const p=l&&!(n==="next"&&l.flags&16777216)?n==="next"?getTypeOfSymbol(l):getTypeWithFacts(getTypeOfSymbol(l),2097152):void 0;if(isTypeAny(p)){return qt}const u=p?getSignaturesOfType(p,0):d;if(u.length===0){if(r){const e=n==="next"?t.mustHaveANextMethodDiagnostic:t.mustBeAMethodDiagnostic;if(i){i.errors??(i.errors=[]);i.errors.push(createDiagnosticForNode(r,e,n))}else{error2(r,e,n)}}return n==="next"?Vt:void 0}if((p==null?void 0:p.symbol)&&u.length===1){const e=t.getGlobalGeneratorType(false);const r=t.getGlobalIteratorType(false);const i=((a=(o=e.symbol)==null?void 0:o.members)==null?void 0:a.get(n))===p.symbol;const l=!i&&((c=(s=r.symbol)==null?void 0:s.members)==null?void 0:c.get(n))===p.symbol;if(i||l){const t=i?e:r;const{mapper:o}=p;return createIterationTypes(getMappedType(t.typeParameters[0],o),getMappedType(t.typeParameters[1],o),n==="next"?getMappedType(t.typeParameters[2],o):void 0)}}let f;let m;for(const e of u){if(n!=="throw"&&some(e.parameters)){f=append(f,getTypeAtPosition(e,0))}m=append(m,getReturnTypeOfSignature(e))}let _;let g;if(n!=="throw"){const e=f?getUnionType(f):Le;if(n==="next"){g=e}else if(n==="return"){const n=t.resolveIterationType(e,r)||ke;_=append(_,n)}}let y;const h=m?getIntersectionType(m):et;const T=t.resolveIterationType(h,r)||ke;const S=getIterationTypesOfIteratorResult(T);if(S===Vt){if(r){if(i){i.errors??(i.errors=[]);i.errors.push(createDiagnosticForNode(r,t.mustHaveAValueDiagnostic,n))}else{error2(r,t.mustHaveAValueDiagnostic,n)}}y=ke;_=append(_,ke)}else{y=S.yieldType;_=append(_,S.returnType)}return createIterationTypes(y,getUnionType(_),g)}function getIterationTypesOfIteratorSlow(e,t,n,r,i){const o=combineIterationTypes([getIterationTypesOfMethod(e,t,"next",n,r),getIterationTypesOfMethod(e,t,"return",n,r),getIterationTypesOfMethod(e,t,"throw",n,r)]);return i?o:setCachedIterationTypes(e,t.iteratorCacheKey,o)}function getIterationTypeOfGeneratorFunctionReturnType(e,t,n){if(isTypeAny(t)){return void 0}const r=getIterationTypesOfGeneratorFunctionReturnType(t,n);return r&&r[getIterationTypesKeyFromIterationTypeKind(e)]}function getIterationTypesOfGeneratorFunctionReturnType(e,t){if(isTypeAny(e)){return qt}const n=t?2:1;const r=t?Ht:Gt;return getIterationTypesOfIterable(e,n,void 0)||getIterationTypesOfIterator(e,r,void 0,void 0)}function checkBreakOrContinueStatement(e){if(!checkGrammarStatementInAmbientContext(e))checkGrammarBreakOrContinueStatement(e)}function unwrapReturnType(e,t){const n=!!(t&1);const r=!!(t&2);if(n){const t=getIterationTypeOfGeneratorFunctionReturnType(1,e,r);if(!t){return Ie}return r?getAwaitedTypeNoAlias(unwrapAwaitedType(t)):t}return r?getAwaitedTypeNoAlias(e)||Ie:e}function isUnwrappedReturnTypeUndefinedVoidOrAny(e,t){const n=unwrapReturnType(t,getFunctionFlags(e));return!!(n&&(maybeTypeOfKind(n,16384)||n.flags&(1|32768)))}function checkReturnStatement(e){if(checkGrammarStatementInAmbientContext(e)){return}const t=getContainingFunctionOrClassStaticBlock(e);if(t&&isClassStaticBlockDeclaration(t)){grammarErrorOnFirstToken(e,wt.A_return_statement_cannot_be_used_inside_a_class_static_block);return}if(!t){grammarErrorOnFirstToken(e,wt.A_return_statement_can_only_be_used_within_a_function_body);return}const n=getSignatureFromDeclaration(t);const r=getReturnTypeOfSignature(n);if(k||e.expression||r.flags&131072){const n=e.expression?checkExpressionCached(e.expression):Me;if(t.kind===178){if(e.expression){error2(e,wt.Setters_cannot_return_a_value)}}else if(t.kind===176){const t=e.expression?checkExpressionCached(e.expression):Me;if(e.expression&&!checkTypeAssignableToAndOptionallyElaborate(t,r,e,e.expression)){error2(e,wt.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class)}}else if(getReturnTypeFromAnnotation(t)){const i=unwrapReturnType(r,getFunctionFlags(t))??r;checkReturnExpression(t,i,e,e.expression,n)}}else if(t.kind!==176&&T.noImplicitReturns&&!isUnwrappedReturnTypeUndefinedVoidOrAny(t,r)){error2(e,wt.Not_all_code_paths_return_a_value)}}function checkReturnExpression(e,t,n,r,i,o=false){const a=isInJSFile(n);const s=getFunctionFlags(e);if(r){const i=skipParentheses(r,a);if(isConditionalExpression(i)){checkReturnExpression(e,t,n,i.whenTrue,checkExpression(i.whenTrue),true);checkReturnExpression(e,t,n,i.whenFalse,checkExpression(i.whenFalse),true);return}}const c=n.kind===253;const l=s&2?checkAwaitedType(i,false,n,wt.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):i;const d=r&&getEffectiveCheckNode(r);const p=c&&!o?n:d;checkTypeAssignableToAndOptionallyElaborate(l,t,p,d)}function checkWithStatement(e){if(!checkGrammarStatementInAmbientContext(e)){if(e.flags&65536){grammarErrorOnFirstToken(e,wt.with_statements_are_not_allowed_in_an_async_function_block)}}checkExpression(e.expression);const t=getSourceFileOfNode(e);if(!hasParseDiagnostics(t)){const n=getSpanOfTokenAtPosition(t,e.pos).start;const r=e.statement.pos;grammarErrorAtPos(t,n,r-n,wt.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any)}}function checkSwitchStatement(e){checkGrammarStatementInAmbientContext(e);let t;let n=false;const r=checkExpression(e.expression);forEach(e.caseBlock.clauses,(e=>{if(e.kind===297&&!n){if(t===void 0){t=e}else{grammarErrorOnNode(e,wt.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement);n=true}}if(e.kind===296){addLazyDiagnostic(createLazyCaseClauseDiagnostics(e))}forEach(e.statements,checkSourceElement);if(T.noFallthroughCasesInSwitch&&e.fallthroughFlowNode&&isReachableFlowNode(e.fallthroughFlowNode)){error2(e,wt.Fallthrough_case_in_switch)}function createLazyCaseClauseDiagnostics(e){return()=>{const t=checkExpression(e.expression);if(!isTypeEqualityComparableTo(r,t)){checkTypeComparableTo(t,r,e.expression,void 0)}}}}));if(e.caseBlock.locals){registerForUnusedIdentifiersCheck(e.caseBlock)}}function checkLabeledStatement(e){if(!checkGrammarStatementInAmbientContext(e)){findAncestor(e.parent,(t=>{if(isFunctionLike(t)){return"quit"}if(t.kind===256&&t.label.escapedText===e.label.escapedText){grammarErrorOnNode(e.label,wt.Duplicate_label_0,getTextOfNode(e.label));return true}return false}))}checkSourceElement(e.statement)}function checkThrowStatement(e){if(!checkGrammarStatementInAmbientContext(e)){if(isIdentifier(e.expression)&&!e.expression.escapedText){grammarErrorAfterFirstToken(e,wt.Line_break_not_permitted_here)}}if(e.expression){checkExpression(e.expression)}}function checkTryStatement(e){checkGrammarStatementInAmbientContext(e);checkBlock(e.tryBlock);const t=e.catchClause;if(t){if(t.variableDeclaration){const e=t.variableDeclaration;checkVariableLikeDeclaration(e);const n=getEffectiveTypeAnnotationNode(e);if(n){const e=getTypeFromTypeNode(n);if(e&&!(e.flags&3)){grammarErrorOnFirstToken(n,wt.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified)}}else if(e.initializer){grammarErrorOnFirstToken(e.initializer,wt.Catch_clause_variable_cannot_have_an_initializer)}else{const e=t.block.locals;if(e){forEachKey(t.locals,(t=>{const n=e.get(t);if((n==null?void 0:n.valueDeclaration)&&(n.flags&2)!==0){grammarErrorOnNode(n.valueDeclaration,wt.Cannot_redeclare_identifier_0_in_catch_clause,unescapeLeadingUnderscores(t))}}))}}}checkBlock(t.block)}if(e.finallyBlock){checkBlock(e.finallyBlock)}}function checkIndexConstraints(e,t,n){const r=getIndexInfosOfType(e);if(r.length===0){return}for(const t of getPropertiesOfObjectType(e)){if(!(n&&t.flags&4194304)){checkIndexConstraintForProperty(e,t,getLiteralTypeFromProperty(t,8576,true),getNonMissingTypeOfSymbol(t))}}const i=t.valueDeclaration;if(i&&isClassLike(i)){for(const t of i.members){if((!n&&!isStatic(t)||n&&isStatic(t))&&!hasBindableName(t)){const n=getSymbolOfDeclaration(t);checkIndexConstraintForProperty(e,n,getTypeOfExpression(t.name.expression),getNonMissingTypeOfSymbol(n))}}}if(r.length>1){for(const t of r){checkIndexConstraintForIndexSignature(e,t)}}}function checkIndexConstraintForProperty(e,t,n,r){const i=t.valueDeclaration;const o=getNameOfDeclaration(i);if(o&&isPrivateIdentifier(o)){return}const a=getApplicableIndexInfos(e,n);const s=getObjectFlags(e)&2?getDeclarationOfKind(e.symbol,264):void 0;const c=i&&i.kind===226||o&&o.kind===167?i:void 0;const l=getParentOfSymbol(t)===e.symbol?i:void 0;for(const n of a){const i=n.declaration&&getParentOfSymbol(getSymbolOfDeclaration(n.declaration))===e.symbol?n.declaration:void 0;const o=l||i||(s&&!some(getBaseTypes(e),(e=>!!getPropertyOfObjectType(e,t.escapedName)&&!!getIndexTypeOfType(e,n.keyType)))?s:void 0);if(o&&!isTypeAssignableTo(r,n.type)){const e=createError(o,wt.Property_0_of_type_1_is_not_assignable_to_2_index_type_3,symbolToString(t),typeToString(r),typeToString(n.keyType),typeToString(n.type));if(c&&o!==c){addRelatedInfo(e,createDiagnosticForNode(c,wt._0_is_declared_here,symbolToString(t)))}gi.add(e)}}}function checkIndexConstraintForIndexSignature(e,t){const n=t.declaration;const r=getApplicableIndexInfos(e,t.keyType);const i=getObjectFlags(e)&2?getDeclarationOfKind(e.symbol,264):void 0;const o=n&&getParentOfSymbol(getSymbolOfDeclaration(n))===e.symbol?n:void 0;for(const n of r){if(n===t)continue;const r=n.declaration&&getParentOfSymbol(getSymbolOfDeclaration(n.declaration))===e.symbol?n.declaration:void 0;const a=o||r||(i&&!some(getBaseTypes(e),(e=>!!getIndexInfoOfType(e,t.keyType)&&!!getIndexTypeOfType(e,n.keyType)))?i:void 0);if(a&&!isTypeAssignableTo(t.type,n.type)){error2(a,wt._0_index_type_1_is_not_assignable_to_2_index_type_3,typeToString(t.keyType),typeToString(t.type),typeToString(n.keyType),typeToString(n.type))}}}function checkTypeNameIsReserved(e,t){switch(e.escapedText){case"any":case"unknown":case"never":case"number":case"bigint":case"boolean":case"string":case"symbol":case"void":case"object":case"undefined":error2(e,t,e.escapedText)}}function checkClassNameCollisionWithObject(t){if(v>=1&&t.escapedText==="Object"&&e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))<5){error2(t,wt.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0,Qe[x])}}function checkUnmatchedJSDocParameters(e){const t=filter(getJSDocTags(e),isJSDocParameterTag);if(!length(t))return;const n=isInJSFile(e);const r=new Set;const i=new Set;forEach(e.parameters,(({name:e},t)=>{if(isIdentifier(e)){r.add(e.escapedText)}if(isBindingPattern(e)){i.add(t)}}));const o=containsArgumentsReference(e);if(o){const e=t.length-1;const o=t[e];if(n&&o&&isIdentifier(o.name)&&o.typeExpression&&o.typeExpression.type&&!r.has(o.name.escapedText)&&!i.has(e)&&!isArrayType(getTypeFromTypeNode(o.typeExpression.type))){error2(o.name,wt.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type,idText(o.name))}}else{forEach(t,(({name:e,isNameFirst:t},o)=>{if(i.has(o)||isIdentifier(e)&&r.has(e.escapedText)){return}if(isQualifiedName(e)){if(n){error2(e,wt.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1,entityNameToString(e),entityNameToString(e.left))}}else{if(!t){errorOrSuggestion(n,e,wt.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,idText(e))}}}))}}function checkTypeParameters(e){let t=false;if(e){for(let t=0;t{if(n.default){t=true;checkTypeParametersNotReferenced(n.default,e,r)}else if(t){error2(n,wt.Required_type_parameters_may_not_follow_optional_type_parameters)}for(let t=0;tr){return false}for(let n=0;nhasStaticModifier(e)&&isPrivateIdentifierClassElementDeclaration(e)))){grammarErrorOnNode(t,wt.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator)}if(!e.name&&!hasSyntacticModifier(e,2048)){grammarErrorOnFirstToken(e,wt.A_class_declaration_without_the_default_modifier_must_have_a_name)}checkClassLikeDeclaration(e);forEach(e.members,checkSourceElement);registerForUnusedIdentifiersCheck(e)}function checkClassLikeDeclaration(e){checkGrammarClassLikeDeclaration(e);checkDecorators(e);checkCollisionsForDeclarationName(e,e.name);checkTypeParameters(getEffectiveTypeParameterDeclarations(e));checkExportsOnMergedDeclarations(e);const t=getSymbolOfDeclaration(e);const n=getDeclaredTypeOfSymbol(t);const r=getTypeWithThisArgument(n);const i=getTypeOfSymbol(t);checkTypeParameterListsIdentical(t);checkFunctionOrConstructorSymbol(t);checkClassForDuplicateDeclarations(e);const o=!!(e.flags&33554432);if(!o){checkClassForStaticPropertyNameConflicts(e)}const a=getEffectiveBaseTypeNode(e);if(a){forEach(a.typeArguments,checkSourceElement);if(v{const t=o[0];const s=getBaseConstructorTypeOfClass(n);const c=getApparentType(s);checkBaseTypeAccessibility(c,a);checkSourceElement(a.expression);if(some(a.typeArguments)){forEach(a.typeArguments,checkSourceElement);for(const e of getConstructorsForTypeArguments(c,a.typeArguments,a)){if(!checkTypeArgumentConstraints(a,e.typeParameters)){break}}}const l=getTypeWithThisArgument(t,n.thisType);if(!checkTypeAssignableTo(r,l,void 0)){issueMemberSpecificError(e,r,l,wt.Class_0_incorrectly_extends_base_class_1)}else{checkTypeAssignableTo(i,getTypeWithoutSignatures(c),e.name||e,wt.Class_static_side_0_incorrectly_extends_base_class_static_side_1)}if(s.flags&8650752){if(!isMixinConstructorType(i)){error2(e.name||e,wt.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any)}else{const t=getSignaturesOfType(s,1);if(t.some((e=>e.flags&4))&&!hasSyntacticModifier(e,64)){error2(e.name||e,wt.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract)}}}if(!(c.symbol&&c.symbol.flags&32)&&!(s.flags&8650752)){const e=getInstantiatedConstructorsForTypeArguments(c,a.typeArguments,a);if(forEach(e,(e=>!isJSConstructor(e.declaration)&&!isTypeIdenticalTo(getReturnTypeOfSignature(e),t)))){error2(a.expression,wt.Base_constructors_must_all_have_the_same_return_type)}}checkKindsOfPropertyMemberOverrides(n,t)}))}}checkMembersForOverrideModifier(e,n,r,i);const s=getEffectiveImplementsTypeNodes(e);if(s){for(const e of s){if(!isEntityNameExpression(e.expression)||isOptionalChain(e.expression)){error2(e.expression,wt.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments)}checkTypeReferenceNode(e);addLazyDiagnostic(createImplementsDiagnostics(e))}}addLazyDiagnostic((()=>{checkIndexConstraints(n,t);checkIndexConstraints(i,t,true);checkTypeForDuplicateIndexSignatures(e);checkPropertyInitialization(e)}));function createImplementsDiagnostics(t){return()=>{const i=getReducedType(getTypeFromTypeNode(t));if(!isErrorType(i)){if(isValidBaseType(i)){const t=i.symbol&&i.symbol.flags&32?wt.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:wt.Class_0_incorrectly_implements_interface_1;const o=getTypeWithThisArgument(i,n.thisType);if(!checkTypeAssignableTo(r,o,void 0)){issueMemberSpecificError(e,r,o,t)}}else{error2(t,wt.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members)}}}}}function checkMembersForOverrideModifier(e,t,n,r){const i=getEffectiveBaseTypeNode(e);const o=i&&getBaseTypes(t);const a=(o==null?void 0:o.length)?getTypeWithThisArgument(first(o),t.thisType):void 0;const s=getBaseConstructorTypeOfClass(t);for(const i of e.members){if(hasAmbientModifier(i)){continue}if(isConstructorDeclaration(i)){forEach(i.parameters,(o=>{if(isParameterPropertyDeclaration(o,i)){checkExistingMemberForOverrideModifier(e,r,s,a,t,n,o,true)}}))}checkExistingMemberForOverrideModifier(e,r,s,a,t,n,i,false)}}function checkExistingMemberForOverrideModifier(e,t,n,r,i,o,a,s,c=true){const l=a.name&&getSymbolAtLocation(a.name)||getSymbolAtLocation(a);if(!l){return 0}return checkMemberForOverrideModifier(e,t,n,r,i,o,hasOverrideModifier(a),hasAbstractModifier(a),isStatic(a),s,l,c?a:void 0)}function checkMemberForOverrideModifier(e,t,n,r,i,o,a,s,c,l,d,p){const u=isInJSFile(e);const f=!!(e.flags&33554432);if(a&&(d==null?void 0:d.valueDeclaration)&&isClassElement(d.valueDeclaration)&&d.valueDeclaration.name&&isNonBindableDynamicName(d.valueDeclaration.name)){error2(p,u?wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic:wt.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic);return 2}if(r&&(a||T.noImplicitOverride)){const e=c?t:o;const i=c?n:r;const m=getPropertyOfType(e,d.escapedName);const _=getPropertyOfType(i,d.escapedName);const g=typeToString(r);if(m&&!_&&a){if(p){const e=getSuggestedSymbolForNonexistentClassMember(symbolName(d),i);e?error2(p,u?wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:wt.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1,g,symbolToString(e)):error2(p,u?wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:wt.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0,g)}return 2}else if(m&&(_==null?void 0:_.declarations)&&T.noImplicitOverride&&!f){const e=some(_.declarations,hasAbstractModifier);if(a){return 0}if(!e){if(p){const e=l?u?wt.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:wt.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:u?wt.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:wt.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;error2(p,e,g)}return 1}else if(s&&e){if(p){error2(p,wt.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0,g)}return 1}}}else if(a){if(p){const e=typeToString(i);error2(p,u?wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:wt.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class,e)}return 2}return 0}function issueMemberSpecificError(e,t,n,r){let i=false;for(const r of e.members){if(isStatic(r)){continue}const e=r.name&&getSymbolAtLocation(r.name)||getSymbolAtLocation(r);if(e){const o=getPropertyOfType(t,e.escapedName);const a=getPropertyOfType(n,e.escapedName);if(o&&a){const rootChain=()=>chainDiagnosticMessages(void 0,wt.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2,symbolToString(e),typeToString(t),typeToString(n));if(!checkTypeAssignableTo(getTypeOfSymbol(o),getTypeOfSymbol(a),r.name||r,void 0,rootChain)){i=true}}}}if(!i){checkTypeAssignableTo(t,n,e.name||e,r)}}function checkBaseTypeAccessibility(e,t){const n=getSignaturesOfType(e,1);if(n.length){const r=n[0].declaration;if(r&&hasEffectiveModifier(r,2)){const n=getClassLikeDeclarationOfSymbol(e.symbol);if(!isNodeWithinClass(t,n)){error2(t,wt.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private,getFullyQualifiedName(e.symbol))}}}}function getMemberOverrideModifierStatus(e,t,n){if(!t.name){return 0}const r=getSymbolOfDeclaration(e);const i=getDeclaredTypeOfSymbol(r);const o=getTypeWithThisArgument(i);const a=getTypeOfSymbol(r);const s=getEffectiveBaseTypeNode(e);const c=s&&getBaseTypes(i);const l=(c==null?void 0:c.length)?getTypeWithThisArgument(first(c),i.thisType):void 0;const d=getBaseConstructorTypeOfClass(i);const p=t.parent?hasOverrideModifier(t):hasSyntacticModifier(t,16);return checkMemberForOverrideModifier(e,a,d,l,i,o,p,hasAbstractModifier(t),isStatic(t),false,n)}function getTargetSymbol(e){return getCheckFlags(e)&1?e.links.target:e}function getClassOrInterfaceDeclarationsOfSymbol(e){return filter(e.declarations,(e=>e.kind===263||e.kind===264))}function checkKindsOfPropertyMemberOverrides(e,t){var n,r,i,o,a;const s=getPropertiesOfType(t);const c=new Map;e:for(const l of s){const s=getTargetSymbol(l);if(s.flags&4194304){continue}const d=getPropertyOfObjectType(e,s.escapedName);if(!d){continue}const p=getTargetSymbol(d);const u=getDeclarationModifierFlagsFromSymbol(s);S.assert(!!p,"derived should point to something, even if it is the base class' declaration.");if(p===s){const r=getClassLikeDeclarationOfSymbol(e.symbol);if(u&64&&(!r||!hasSyntacticModifier(r,64))){for(const n of getBaseTypes(e)){if(n===t)continue;const e=getPropertyOfObjectType(n,s.escapedName);const r=e&&getTargetSymbol(e);if(r&&r!==s){continue e}}const i=typeToString(t);const o=typeToString(e);const a=symbolToString(l);const d=append((n=c.get(r))==null?void 0:n.missedProperties,a);c.set(r,{baseTypeName:i,typeName:o,missedProperties:d})}}else{const n=getDeclarationModifierFlagsFromSymbol(p);if(u&2||n&2){continue}let c;const l=s.flags&98308;const d=p.flags&98308;if(l&&d){if((getCheckFlags(s)&6?(r=s.declarations)==null?void 0:r.some((e=>isPropertyAbstractOrInterface(e,u))):(i=s.declarations)==null?void 0:i.every((e=>isPropertyAbstractOrInterface(e,u))))||getCheckFlags(s)&262144||p.valueDeclaration&&isBinaryExpression(p.valueDeclaration)){continue}const c=l!==4&&d===4;const f=l===4&&d!==4;if(c||f){const n=c?wt._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:wt._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;error2(getNameOfDeclaration(p.valueDeclaration)||p.valueDeclaration,n,symbolToString(s),typeToString(t),typeToString(e))}else if(C){const r=(o=p.declarations)==null?void 0:o.find((e=>e.kind===172&&!e.initializer));if(r&&!(p.flags&33554432)&&!(u&64)&&!(n&64)&&!((a=p.declarations)==null?void 0:a.some((e=>!!(e.flags&33554432))))){const n=findConstructorDeclaration(getClassLikeDeclarationOfSymbol(e.symbol));const i=r.name;if(r.exclamationToken||!n||!isIdentifier(i)||!k||!isPropertyInitializedInConstructor(i,e,n)){const e=wt.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration;error2(getNameOfDeclaration(p.valueDeclaration)||p.valueDeclaration,e,symbolToString(s),typeToString(t))}}}continue}else if(isPrototypeProperty(s)){if(isPrototypeProperty(p)||p.flags&4){continue}else{S.assert(!!(p.flags&98304));c=wt.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor}}else if(s.flags&98304){c=wt.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function}else{c=wt.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function}error2(getNameOfDeclaration(p.valueDeclaration)||p.valueDeclaration,c,typeToString(t),symbolToString(s),typeToString(e))}}for(const[e,t]of c){if(length(t.missedProperties)===1){if(isClassExpression(e)){error2(e,wt.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,first(t.missedProperties),t.baseTypeName)}else{error2(e,wt.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,t.typeName,first(t.missedProperties),t.baseTypeName)}}else if(length(t.missedProperties)>5){const n=map(t.missedProperties.slice(0,4),(e=>`'${e}'`)).join(", ");const r=length(t.missedProperties)-4;if(isClassExpression(e)){error2(e,wt.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more,t.baseTypeName,n,r)}else{error2(e,wt.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more,t.typeName,t.baseTypeName,n,r)}}else{const n=map(t.missedProperties,(e=>`'${e}'`)).join(", ");if(isClassExpression(e)){error2(e,wt.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1,t.baseTypeName,n)}else{error2(e,wt.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2,t.typeName,t.baseTypeName,n)}}}}function isPropertyAbstractOrInterface(e,t){return t&64&&(!isPropertyDeclaration(e)||!e.initializer)||isInterfaceDeclaration(e.parent)}function getNonInheritedProperties(e,t,n){if(!length(t)){return n}const r=new Map;forEach(n,(e=>{r.set(e.escapedName,e)}));for(const n of t){const t=getPropertiesOfType(getTypeWithThisArgument(n,e.thisType));for(const e of t){const t=r.get(e.escapedName);if(t&&e.parent===t.parent){r.delete(e.escapedName)}}}return arrayFrom(r.values())}function checkInheritedPropertiesAreIdentical(e,t){const n=getBaseTypes(e);if(n.length<2){return true}const r=new Map;forEach(resolveDeclaredMembers(e).declaredProperties,(t=>{r.set(t.escapedName,{prop:t,containingType:e})}));let i=true;for(const o of n){const n=getPropertiesOfType(getTypeWithThisArgument(o,e.thisType));for(const a of n){const n=r.get(a.escapedName);if(!n){r.set(a.escapedName,{prop:a,containingType:o})}else{const r=n.containingType!==e;if(r&&!isPropertyIdenticalTo(n.prop,a)){i=false;const r=typeToString(n.containingType);const s=typeToString(o);let c=chainDiagnosticMessages(void 0,wt.Named_property_0_of_types_1_and_2_are_not_identical,symbolToString(a),r,s);c=chainDiagnosticMessages(c,wt.Interface_0_cannot_simultaneously_extend_types_1_and_2,typeToString(e),r,s);gi.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(t),t,c))}}}}return i}function checkPropertyInitialization(e){if(!k||!D||e.flags&33554432){return}const t=findConstructorDeclaration(e);for(const n of e.members){if(getEffectiveModifierFlags(n)&128){continue}if(!isStatic(n)&&isPropertyWithoutInitializer(n)){const e=n.name;if(isIdentifier(e)||isPrivateIdentifier(e)||isComputedPropertyName(e)){const r=getTypeOfSymbol(getSymbolOfDeclaration(n));if(!(r.flags&3||containsUndefinedType(r))){if(!t||!isPropertyInitializedInConstructor(e,r,t)){error2(n.name,wt.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor,declarationNameToString(e))}}}}}}function isPropertyWithoutInitializer(e){return e.kind===172&&!hasAbstractModifier(e)&&!e.exclamationToken&&!e.initializer}function isPropertyInitializedInStaticBlocks(e,t,n,r,i){for(const o of n){if(o.pos>=r&&o.pos<=i){const n=zr.createPropertyAccessExpression(zr.createThis(),e);setParent(n.expression,n);setParent(n,o);n.flowNode=o.returnFlowNode;const r=getFlowTypeOfReference(n,t,getOptionalType(t));if(!containsUndefinedType(r)){return true}}}return false}function isPropertyInitializedInConstructor(e,t,n){const r=isComputedPropertyName(e)?zr.createElementAccessExpression(zr.createThis(),e.expression):zr.createPropertyAccessExpression(zr.createThis(),e);setParent(r.expression,r);setParent(r,n);r.flowNode=n.returnFlowNode;const i=getFlowTypeOfReference(r,t,getOptionalType(t));return!containsUndefinedType(i)}function checkInterfaceDeclaration(e){if(!checkGrammarModifiers(e))checkGrammarInterfaceDeclaration(e);if(!allowBlockDeclarations(e.parent)){grammarErrorOnNode(e,wt._0_declarations_can_only_be_declared_inside_a_block,"interface")}checkTypeParameters(e.typeParameters);addLazyDiagnostic((()=>{checkTypeNameIsReserved(e.name,wt.Interface_name_cannot_be_0);checkExportsOnMergedDeclarations(e);const t=getSymbolOfDeclaration(e);checkTypeParameterListsIdentical(t);const n=getDeclarationOfKind(t,264);if(e===n){const n=getDeclaredTypeOfSymbol(t);const r=getTypeWithThisArgument(n);if(checkInheritedPropertiesAreIdentical(n,e.name)){for(const t of getBaseTypes(n)){checkTypeAssignableTo(r,getTypeWithThisArgument(t,n.thisType),e.name,wt.Interface_0_incorrectly_extends_interface_1)}checkIndexConstraints(n,t)}}checkObjectTypeForDuplicateDeclarations(e)}));forEach(getInterfaceBaseTypeNodes(e),(e=>{if(!isEntityNameExpression(e.expression)||isOptionalChain(e.expression)){error2(e.expression,wt.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments)}checkTypeReferenceNode(e)}));forEach(e.members,checkSourceElement);addLazyDiagnostic((()=>{checkTypeForDuplicateIndexSignatures(e);registerForUnusedIdentifiersCheck(e)}))}function checkTypeAliasDeclaration(e){checkGrammarModifiers(e);checkTypeNameIsReserved(e.name,wt.Type_alias_name_cannot_be_0);if(!allowBlockDeclarations(e.parent)){grammarErrorOnNode(e,wt._0_declarations_can_only_be_declared_inside_a_block,"type")}checkExportsOnMergedDeclarations(e);checkTypeParameters(e.typeParameters);if(e.type.kind===141){const t=length(e.typeParameters);const n=t===0?e.name.escapedText==="BuiltinIteratorReturn":t===1&&sa.has(e.name.escapedText);if(!n){error2(e.type,wt.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types)}}else{checkSourceElement(e.type);registerForUnusedIdentifiersCheck(e)}}function computeEnumMemberValues(e){const t=getNodeLinks(e);if(!(t.flags&1024)){t.flags|=1024;let n=0;let r;for(const t of e.members){const e=computeEnumMemberValue(t,n,r);getNodeLinks(t).enumMemberValue=e;n=typeof e.value==="number"?e.value+1:void 0;r=t}}}function computeEnumMemberValue(e,t,n){if(isComputedNonLiteralName(e.name)){error2(e.name,wt.Computed_property_names_are_not_allowed_in_enums)}else{const t=getTextOfPropertyName(e.name);if(isNumericLiteralName(t)&&!isInfinityOrNaNString(t)){error2(e.name,wt.An_enum_member_cannot_have_a_numeric_name)}}if(e.initializer){return computeConstantEnumMemberValue(e)}if(e.parent.flags&33554432&&!isEnumConst(e.parent)){return evaluatorResult(void 0)}if(t===void 0){error2(e.name,wt.Enum_member_must_have_initializer);return evaluatorResult(void 0)}if(Gn(T)&&(n==null?void 0:n.initializer)){const t=getEnumMemberValue(n);if(!(typeof t.value==="number"&&!t.resolvedOtherFiles)){error2(e.name,wt.Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled)}}return evaluatorResult(t)}function computeConstantEnumMemberValue(e){const t=isEnumConst(e.parent);const n=e.initializer;const r=W(n,e);if(r.value!==void 0){if(t&&typeof r.value==="number"&&!isFinite(r.value)){error2(n,isNaN(r.value)?wt.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:wt.const_enum_member_initializer_was_evaluated_to_a_non_finite_value)}else if(Gn(T)&&typeof r.value==="string"&&!r.isSyntacticallyString){error2(n,wt._0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled,`${idText(e.parent.name)}.${getTextOfPropertyName(e.name)}`)}}else if(t){error2(n,wt.const_enum_member_initializers_must_be_constant_expressions)}else if(e.parent.flags&33554432){error2(n,wt.In_ambient_enum_declarations_member_initializer_must_be_constant_expression)}else{checkTypeAssignableTo(checkExpression(n),Ve,n,wt.Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values)}return r}function evaluateEntityNameExpression(e,t){const n=resolveEntityName(e,111551,true);if(!n)return evaluatorResult(void 0);if(e.kind===80){const t=e;if(isInfinityOrNaNString(t.escapedText)&&n===getGlobalSymbol(t.escapedText,111551,void 0)){return evaluatorResult(+t.escapedText,false)}}if(n.flags&8){return t?evaluateEnumMember(e,n,t):getEnumMemberValue(n.valueDeclaration)}if(isConstantVariable(n)){const e=n.valueDeclaration;if(e&&isVariableDeclaration(e)&&!e.type&&e.initializer&&(!t||e!==t&&isBlockScopedNameDeclaredBeforeUse(e,t))){const n=W(e.initializer,e);if(t&&getSourceFileOfNode(t)!==getSourceFileOfNode(e)){return evaluatorResult(n.value,false,true,true)}return evaluatorResult(n.value,n.isSyntacticallyString,n.resolvedOtherFiles,true)}}return evaluatorResult(void 0)}function evaluateElementAccessExpression(e,t){const n=e.expression;if(isEntityNameExpression(n)&&isStringLiteralLike(e.argumentExpression)){const r=resolveEntityName(n,111551,true);if(r&&r.flags&384){const n=escapeLeadingUnderscores(e.argumentExpression.text);const i=r.exports.get(n);if(i){S.assert(getSourceFileOfNode(i.valueDeclaration)===getSourceFileOfNode(r.valueDeclaration));return t?evaluateEnumMember(e,i,t):getEnumMemberValue(i.valueDeclaration)}}}return evaluatorResult(void 0)}function evaluateEnumMember(e,t,n){const r=t.valueDeclaration;if(!r||r===n){error2(e,wt.Property_0_is_used_before_being_assigned,symbolToString(t));return evaluatorResult(void 0)}if(!isBlockScopedNameDeclaredBeforeUse(r,n)){error2(e,wt.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums);return evaluatorResult(0)}const i=getEnumMemberValue(r);if(n.parent!==r.parent){return evaluatorResult(i.value,i.isSyntacticallyString,i.resolvedOtherFiles,true)}return i}function checkEnumDeclaration(e){addLazyDiagnostic((()=>checkEnumDeclarationWorker(e)))}function checkEnumDeclarationWorker(e){checkGrammarModifiers(e);checkCollisionsForDeclarationName(e,e.name);checkExportsOnMergedDeclarations(e);e.members.forEach(checkEnumMember);if(T.erasableSyntaxOnly&&!(e.flags&33554432)){error2(e,wt.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled)}computeEnumMemberValues(e);const t=getSymbolOfDeclaration(e);const n=getDeclarationOfKind(t,e.kind);if(e===n){if(t.declarations&&t.declarations.length>1){const n=isEnumConst(e);forEach(t.declarations,(e=>{if(isEnumDeclaration(e)&&isEnumConst(e)!==n){error2(getNameOfDeclaration(e),wt.Enum_declarations_must_all_be_const_or_non_const)}}))}let n=false;forEach(t.declarations,(e=>{if(e.kind!==266){return false}const t=e;if(!t.members.length){return false}const r=t.members[0];if(!r.initializer){if(n){error2(r.name,wt.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element)}else{n=true}}}))}}function checkEnumMember(e){if(isPrivateIdentifier(e.name)){error2(e,wt.An_enum_member_cannot_be_named_with_a_private_identifier)}if(e.initializer){checkExpression(e.initializer)}}function getFirstNonAmbientClassOrFunctionDeclaration(e){const t=e.declarations;if(t){for(const e of t){if((e.kind===263||e.kind===262&&nodeIsPresent(e.body))&&!(e.flags&33554432)){return e}}}return void 0}function inSameLexicalScope(e,t){const n=getEnclosingBlockScopeContainer(e);const r=getEnclosingBlockScopeContainer(t);if(isGlobalSourceFile(n)){return isGlobalSourceFile(r)}else if(isGlobalSourceFile(r)){return false}else{return n===r}}function checkModuleDeclaration(t){if(t.body){checkSourceElement(t.body);if(!isGlobalScopeAugmentation(t)){registerForUnusedIdentifiersCheck(t)}}addLazyDiagnostic(checkModuleDeclarationDiagnostics);function checkModuleDeclarationDiagnostics(){var n,r;const i=isGlobalScopeAugmentation(t);const o=t.flags&33554432;if(i&&!o){error2(t.name,wt.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context)}const a=isAmbientModule(t);const s=a?wt.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:wt.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;if(checkGrammarModuleElementContext(t,s)){return}if(!checkGrammarModifiers(t)){if(!o&&t.name.kind===11){grammarErrorOnNode(t.name,wt.Only_ambient_modules_can_use_quoted_names)}}if(isIdentifier(t.name)){checkCollisionsForDeclarationName(t,t.name);if(!(t.flags&(32|2048))){const e=getSourceFileOfNode(t);const n=getNonModifierTokenPosOfNode(t);const r=getSpanOfTokenAtPosition(e,n);yi.add(createFileDiagnostic(e,r.start,r.length,wt.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead))}}checkExportsOnMergedDeclarations(t);const c=getSymbolOfDeclaration(t);if(c.flags&512&&!o&&isInstantiatedModule(t,er(T))){if(T.erasableSyntaxOnly){error2(t.name,wt.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled)}if(Gn(T)&&!getSourceFileOfNode(t).externalModuleIndicator){error2(t.name,wt.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement,K)}if(((n=c.declarations)==null?void 0:n.length)>1){const e=getFirstNonAmbientClassOrFunctionDeclaration(c);if(e){if(getSourceFileOfNode(t)!==getSourceFileOfNode(e)){error2(t.name,wt.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged)}else if(t.pose.kind===95));if(e){error2(e,wt.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled)}}}if(a){if(isExternalModuleAugmentation(t)){const e=i||getSymbolOfDeclaration(t).flags&33554432;if(e&&t.body){for(const e of t.body.statements){checkModuleAugmentationElement(e,i)}}}else if(isGlobalSourceFile(t.parent)){if(i){error2(t.name,wt.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations)}else if(isExternalModuleNameRelative(getTextOfIdentifierOrLiteral(t.name))){error2(t.name,wt.Ambient_module_declaration_cannot_specify_relative_module_name)}}else{if(i){error2(t.name,wt.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations)}else{error2(t.name,wt.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces)}}}}}function checkModuleAugmentationElement(e,t){switch(e.kind){case 243:for(const n of e.declarationList.declarations){checkModuleAugmentationElement(n,t)}break;case 277:case 278:grammarErrorOnFirstToken(e,wt.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);break;case 271:if(isInternalModuleImportEqualsDeclaration(e))break;case 272:grammarErrorOnFirstToken(e,wt.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);break;case 208:case 260:const n=e.name;if(isBindingPattern(n)){for(const e of n.elements){checkModuleAugmentationElement(e,t)}break}case 263:case 266:case 262:case 264:case 267:case 265:if(t){return}break}}function getFirstNonModuleExportsIdentifier(e){switch(e.kind){case 80:return e;case 166:do{e=e.left}while(e.kind!==80);return e;case 211:do{if(isModuleExportsAccessExpression(e.expression)&&!isPrivateIdentifier(e.name)){return e.name}e=e.expression}while(e.kind!==80);return e}}function checkExternalImportOrExportDeclaration(e){const t=getExternalModuleName(e);if(!t||nodeIsMissing(t)){return false}if(!isStringLiteral(t)){error2(t,wt.String_literal_expected);return false}const n=e.parent.kind===268&&isAmbientModule(e.parent.parent);if(e.parent.kind!==307&&!n){error2(t,e.kind===278?wt.Export_declarations_are_not_permitted_in_a_namespace:wt.Import_declarations_in_a_namespace_cannot_reference_a_module);return false}if(n&&isExternalModuleNameRelative(t.text)){if(!isTopLevelInExternalModuleAugmentation(e)){error2(e,wt.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name);return false}}if(!isImportEqualsDeclaration(e)&&e.attributes){const t=e.attributes.token===118?wt.Import_attribute_values_must_be_string_literal_expressions:wt.Import_assertion_values_must_be_string_literal_expressions;let n=false;for(const r of e.attributes.elements){if(!isStringLiteral(r.value)){n=true;error2(r.value,t)}}return!n}return true}function checkModuleExportName(e,t=true){if(e===void 0||e.kind!==11){return}if(!t){grammarErrorOnNode(e,wt.Identifier_expected)}else if(x===5||x===6){grammarErrorOnNode(e,wt.String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020)}}function checkAliasSymbol(t){var n,r,i,o;let a=getSymbolOfDeclaration(t);const s=resolveAlias(a);if(s!==xe){a=getMergedSymbol(a.exportSymbol||a);if(isInJSFile(t)&&!(s.flags&111551)&&!isTypeOnlyImportOrExportDeclaration(t)){const e=isImportOrExportSpecifier(t)?t.propertyName||t.name:isNamedDeclaration(t)?t.name:t;S.assert(t.kind!==280);if(t.kind===281){const o=error2(e,wt.Types_cannot_appear_in_export_declarations_in_JavaScript_files);const a=(r=(n=getSourceFileOfNode(t).symbol)==null?void 0:n.exports)==null?void 0:r.get(moduleExportNameTextEscaped(t.propertyName||t.name));if(a===s){const e=(i=a.declarations)==null?void 0:i.find(isJSDocNode);if(e){addRelatedInfo(o,createDiagnosticForNode(e,wt._0_is_automatically_exported_here,unescapeLeadingUnderscores(a.escapedName)))}}}else{S.assert(t.kind!==260);const n=findAncestor(t,or(isImportDeclaration,isImportEqualsDeclaration));const r=(n&&((o=tryGetModuleSpecifierFromDeclaration(n))==null?void 0:o.text))??"...";const i=unescapeLeadingUnderscores(isIdentifier(e)?e.escapedText:a.escapedName);error2(e,wt._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation,i,`import("${r}").${i}`)}return}const c=getSymbolFlags(s);const l=(a.flags&(111551|1048576)?111551:0)|(a.flags&788968?788968:0)|(a.flags&1920?1920:0);if(c&l){const e=t.kind===281?wt.Export_declaration_conflicts_with_exported_declaration_of_0:wt.Import_declaration_conflicts_with_local_declaration_of_0;error2(t,e,symbolToString(a))}else if(t.kind!==281){const e=T.isolatedModules&&!findAncestor(t,isTypeOnlyImportOrExportDeclaration);if(e&&a.flags&(111551|1048576)){error2(t,wt.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled,symbolToString(a),K)}}if(Gn(T)&&!isTypeOnlyImportOrExportDeclaration(t)&&!(t.flags&33554432)){const n=getTypeOnlyAliasDeclaration(a);const r=!(c&111551);if(r||n){switch(t.kind){case 273:case 276:case 271:{if(T.verbatimModuleSyntax){S.assertIsDefined(t.name,"An ImportClause with a symbol should have a name");const e=T.verbatimModuleSyntax&&isInternalModuleImportEqualsDeclaration(t)?wt.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled:r?wt._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled:wt._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled;const i=moduleExportNameTextUnescaped(t.kind===276?t.propertyName||t.name:t.name);addTypeOnlyDeclarationRelatedInfo(error2(t,e,i),r?void 0:n,i)}if(r&&t.kind===271&&hasEffectiveModifier(t,32)){error2(t,wt.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled,K)}break}case 281:{if(T.verbatimModuleSyntax||getSourceFileOfNode(n)!==getSourceFileOfNode(t)){const e=moduleExportNameTextUnescaped(t.propertyName||t.name);const i=r?error2(t,wt.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type,K):error2(t,wt._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled,e,K);addTypeOnlyDeclarationRelatedInfo(i,r?void 0:n,e);break}}}}if(T.verbatimModuleSyntax&&t.kind!==271&&!isInJSFile(t)&&e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))===1){error2(t,wt.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled)}else if(x===200&&t.kind!==271&&t.kind!==260&&e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))===1){error2(t,wt.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve)}if(T.verbatimModuleSyntax&&!isTypeOnlyImportOrExportDeclaration(t)&&!(t.flags&33554432)&&c&128){const n=s.valueDeclaration;const r=e.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(n).resolvedPath);if(n.flags&33554432&&(!r||!er(r.commandLine.options))){error2(t,wt.Cannot_access_ambient_const_enums_when_0_is_enabled,K)}}}if(isImportSpecifier(t)){const e=resolveAliasWithDeprecationCheck(a,t);if(isDeprecatedSymbol(e)&&e.declarations){addDeprecatedSuggestion(t,e.declarations,e.escapedName)}}}}function resolveAliasWithDeprecationCheck(e,t){if(!(e.flags&2097152)||isDeprecatedSymbol(e)||!getDeclarationOfAliasSymbol(e)){return e}const n=resolveAlias(e);if(n===xe)return n;while(e.flags&2097152){const r=getImmediateAliasedSymbol(e);if(r){if(r===n)break;if(r.declarations&&length(r.declarations)){if(isDeprecatedSymbol(r)){addDeprecatedSuggestion(t,r.declarations,r.escapedName);break}else{if(e===n)break;e=r}}}else{break}}return n}function checkImportBinding(t){checkCollisionsForDeclarationName(t,t.name);checkAliasSymbol(t);if(t.kind===276){checkModuleExportName(t.propertyName);if(moduleExportNameIsDefault(t.propertyName||t.name)&&Kn(T)&&e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))<4){checkExternalEmitHelpers(t,131072)}}}function checkImportAttributes(e){var t;const n=e.attributes;if(n){const r=getGlobalImportAttributesType(true);if(r!==ht){checkTypeAssignableTo(getTypeFromImportAttributes(n),getNullableType(r,32768),n)}const i=isExclusivelyTypeOnlyImportOrExport(e);const o=getResolutionModeOverride(n,i?grammarErrorOnNode:void 0);const a=e.attributes.token===118;if(i&&o){return}if(!moduleSupportsImportAttributes(x)){return grammarErrorOnNode(n,a?wt.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve:wt.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve)}if(x===199&&!a){return grammarErrorOnFirstToken(n,wt.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert)}if(e.moduleSpecifier&&getEmitSyntaxForModuleSpecifierExpression(e.moduleSpecifier)===1){return grammarErrorOnNode(n,a?wt.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls:wt.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls)}const s=isJSDocImportTag(e)||(isImportDeclaration(e)?(t=e.importClause)==null?void 0:t.isTypeOnly:e.isTypeOnly);if(s){return grammarErrorOnNode(n,a?wt.Import_attributes_cannot_be_used_with_type_only_imports_or_exports:wt.Import_assertions_cannot_be_used_with_type_only_imports_or_exports)}if(o){return grammarErrorOnNode(n,wt.resolution_mode_can_only_be_set_for_type_only_imports)}}}function checkImportAttribute(e){return getRegularTypeOfLiteralType(checkExpressionCached(e.value))}function checkImportDeclaration(t){if(checkGrammarModuleElementContext(t,isInJSFile(t)?wt.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:wt.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)){return}if(!checkGrammarModifiers(t)&&t.modifiers){grammarErrorOnFirstToken(t,wt.An_import_declaration_cannot_have_modifiers)}if(checkExternalImportOrExportDeclaration(t)){let n;const r=t.importClause;if(r&&!checkGrammarImportClause(r)){if(r.name){checkImportBinding(r)}if(r.namedBindings){if(r.namedBindings.kind===274){checkImportBinding(r.namedBindings);if(e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))<4&&Kn(T)){checkExternalEmitHelpers(t,65536)}}else{n=resolveExternalModuleName(t,t.moduleSpecifier);if(n){forEach(r.namedBindings.elements,checkImportBinding)}}}if(!r.isTypeOnly&&101<=x&&x<=199&&isOnlyImportableAsDefault(t.moduleSpecifier,n)&&!hasTypeJsonImportAttribute(t)){error2(t.moduleSpecifier,wt.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0,Qe[x])}}else if(M&&!r){void resolveExternalModuleName(t,t.moduleSpecifier)}}checkImportAttributes(t)}function hasTypeJsonImportAttribute(e){return!!e.attributes&&e.attributes.elements.some((e=>{var t;return getTextOfIdentifierOrLiteral(e.name)==="type"&&((t=tryCast(e.value,isStringLiteralLike))==null?void 0:t.text)==="json"}))}function checkImportEqualsDeclaration(e){if(checkGrammarModuleElementContext(e,isInJSFile(e)?wt.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:wt.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)){return}checkGrammarModifiers(e);if(T.erasableSyntaxOnly&&!(e.flags&33554432)){error2(e,wt.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled)}if(isInternalModuleImportEqualsDeclaration(e)||checkExternalImportOrExportDeclaration(e)){checkImportBinding(e);markLinkedReferences(e,6);if(e.moduleReference.kind!==283){const t=resolveAlias(getSymbolOfDeclaration(e));if(t!==xe){const n=getSymbolFlags(t);if(n&111551){const t=getFirstIdentifier(e.moduleReference);if(!(resolveEntityName(t,111551|1920).flags&1920)){error2(t,wt.Module_0_is_hidden_by_a_local_declaration_with_the_same_name,declarationNameToString(t))}}if(n&788968){checkTypeNameIsReserved(e.name,wt.Import_name_cannot_be_0)}}if(e.isTypeOnly){grammarErrorOnNode(e,wt.An_import_alias_cannot_use_import_type)}}else{if(5<=x&&x<=99&&!e.isTypeOnly&&!(e.flags&33554432)){grammarErrorOnNode(e,wt.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead)}}}}function checkExportDeclaration(t){if(checkGrammarModuleElementContext(t,isInJSFile(t)?wt.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:wt.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)){return}if(!checkGrammarModifiers(t)&&hasSyntacticModifiers(t)){grammarErrorOnFirstToken(t,wt.An_export_declaration_cannot_have_modifiers)}checkGrammarExportDeclaration(t);if(!t.moduleSpecifier||checkExternalImportOrExportDeclaration(t)){if(t.exportClause&&!isNamespaceExport(t.exportClause)){forEach(t.exportClause.elements,checkExportSpecifier);const e=t.parent.kind===268&&isAmbientModule(t.parent.parent);const n=!e&&t.parent.kind===268&&!t.moduleSpecifier&&t.flags&33554432;if(t.parent.kind!==307&&!e&&!n){error2(t,wt.Export_declarations_are_not_permitted_in_a_namespace)}}else{const n=resolveExternalModuleName(t,t.moduleSpecifier);if(n&&hasExportAssignmentSymbol(n)){error2(t.moduleSpecifier,wt.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk,symbolToString(n))}else if(t.exportClause){checkAliasSymbol(t.exportClause);checkModuleExportName(t.exportClause.name)}if(e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))<4){if(t.exportClause){if(Kn(T)){checkExternalEmitHelpers(t,65536)}}else{checkExternalEmitHelpers(t,32768)}}}}checkImportAttributes(t)}function checkGrammarExportDeclaration(e){var t;if(e.isTypeOnly&&((t=e.exportClause)==null?void 0:t.kind)===279){return checkGrammarNamedImportsOrExports(e.exportClause)}return false}function checkGrammarModuleElementContext(e,t){const n=e.parent.kind===307||e.parent.kind===268||e.parent.kind===267;if(!n){grammarErrorOnFirstToken(e,t)}return!n}function checkExportSpecifier(t){checkAliasSymbol(t);const n=t.parent.parent.moduleSpecifier!==void 0;checkModuleExportName(t.propertyName,n);checkModuleExportName(t.name);if(Zn(T)){collectLinkedAliases(t.propertyName||t.name,true)}if(!n){const e=t.propertyName||t.name;if(e.kind===11){return}const n=te(e,e.escapedText,111551|788968|1920|2097152,void 0,true);if(n&&(n===z||n===V||n.declarations&&isGlobalSourceFile(getDeclarationContainer(n.declarations[0])))){error2(e,wt.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,idText(e))}else{markLinkedReferences(t,7)}}else{if(Kn(T)&&e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))<4&&moduleExportNameIsDefault(t.propertyName||t.name)){checkExternalEmitHelpers(t,131072)}}}function checkExportAssignment(t){const n=t.isExportEquals?wt.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:wt.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration;if(checkGrammarModuleElementContext(t,n)){return}if(T.erasableSyntaxOnly&&t.isExportEquals&&!(t.flags&33554432)){error2(t,wt.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled)}const r=t.parent.kind===307?t.parent:t.parent.parent;if(r.kind===267&&!isAmbientModule(r)){if(t.isExportEquals){error2(t,wt.An_export_assignment_cannot_be_used_in_a_namespace)}else{error2(t,wt.A_default_export_can_only_be_used_in_an_ECMAScript_style_module)}return}if(!checkGrammarModifiers(t)&&hasEffectiveModifiers(t)){grammarErrorOnFirstToken(t,wt.An_export_assignment_cannot_have_modifiers)}const i=getEffectiveTypeAnnotationNode(t);if(i){checkTypeAssignableTo(checkExpressionCached(t.expression),getTypeFromTypeNode(i),t.expression)}const o=!t.isExportEquals&&!(t.flags&33554432)&&T.verbatimModuleSyntax&&e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))===1;if(t.expression.kind===80){const e=t.expression;const n=getExportSymbolOfValueSymbolIfExported(resolveEntityName(e,-1,true,true,t));if(n){markLinkedReferences(t,3);const r=getTypeOnlyAliasDeclaration(n,111551);if(getSymbolFlags(n)&111551){checkExpressionCached(e);if(!o&&!(t.flags&33554432)&&T.verbatimModuleSyntax&&r){error2(e,t.isExportEquals?wt.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration:wt.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,idText(e))}}else if(!o&&!(t.flags&33554432)&&T.verbatimModuleSyntax){error2(e,t.isExportEquals?wt.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type:wt.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type,idText(e))}if(!o&&!(t.flags&33554432)&&Gn(T)&&!(n.flags&111551)){const i=getSymbolFlags(n,false,true);if(n.flags&2097152&&i&788968&&!(i&111551)&&(!r||getSourceFileOfNode(r)!==getSourceFileOfNode(t))){error2(e,t.isExportEquals?wt._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported:wt._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,idText(e),K)}else if(r&&getSourceFileOfNode(r)!==getSourceFileOfNode(t)){addTypeOnlyDeclarationRelatedInfo(error2(e,t.isExportEquals?wt._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported:wt._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,idText(e),K),r,idText(e))}}}else{checkExpressionCached(e)}if(Zn(T)){collectLinkedAliases(e,true)}}else{checkExpressionCached(t.expression)}if(o){error2(t,wt.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled)}checkExternalModuleExports(r);if(t.flags&33554432&&!isEntityNameExpression(t.expression)){grammarErrorOnNode(t.expression,wt.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context)}if(t.isExportEquals){if(x>=5&&x!==200&&(t.flags&33554432&&e.getImpliedNodeFormatForEmit(getSourceFileOfNode(t))===99||!(t.flags&33554432)&&e.getImpliedNodeFormatForEmit(getSourceFileOfNode(t))!==1)){grammarErrorOnNode(t,wt.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead)}else if(x===4&&!(t.flags&33554432)){grammarErrorOnNode(t,wt.Export_assignment_is_not_supported_when_module_flag_is_system)}}}function hasExportedMembers(e){return forEachEntry(e.exports,((e,t)=>t!=="export="))}function checkExternalModuleExports(e){const t=getSymbolOfDeclaration(e);const n=getSymbolLinks(t);if(!n.exportsChecked){const e=t.exports.get("export=");if(e&&hasExportedMembers(t)){const t=getDeclarationOfAliasSymbol(e)||e.valueDeclaration;if(t&&!isTopLevelInExternalModuleAugmentation(t)&&!isInJSFile(t)){error2(t,wt.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements)}}const r=getExportsOfModule(t);if(r){r.forEach((({declarations:e,flags:t},n)=>{if(n==="__export"){return}if(t&(1920|384)){return}const r=countWhere(e,and(aa,not(isInterfaceDeclaration)));if(t&524288&&r<=2){return}if(r>1){if(!isDuplicatedCommonJSExport(e)){for(const t of e){if(isNotOverload(t)){gi.add(createDiagnosticForNode(t,wt.Cannot_redeclare_exported_variable_0,unescapeLeadingUnderscores(n)))}}}}}))}n.exportsChecked=true}}function isDuplicatedCommonJSExport(e){return e&&e.length>1&&e.every((e=>isInJSFile(e)&&isAccessExpression(e)&&(isExportsIdentifier(e.expression)||isModuleExportsAccessExpression(e.expression))))}function checkSourceElement(e){if(e){const t=m;m=e;p=0;checkSourceElementWorker(e);m=t}}function checkSourceElementWorker(e){if(getNodeCheckFlags(e)&8388608){return}if(canHaveJSDoc(e)){forEach(e.jsDoc,(({comment:t,tags:n})=>{checkJSDocCommentWorker(t);forEach(n,(t=>{checkJSDocCommentWorker(t.comment);if(isInJSFile(e)){checkSourceElement(t)}}))}))}const t=e.kind;if(n){switch(t){case 267:case 263:case 264:case 262:n.throwIfCancellationRequested()}}if(t>=243&&t<=259&&canHaveFlowNode(e)&&e.flowNode&&!isReachableFlowNode(e.flowNode)){errorOrSuggestion(T.allowUnreachableCode===false,e,wt.Unreachable_code_detected)}switch(t){case 168:return checkTypeParameter(e);case 169:return checkParameter(e);case 172:return checkPropertyDeclaration(e);case 171:return checkPropertySignature(e);case 185:case 184:case 179:case 180:case 181:return checkSignatureDeclaration(e);case 174:case 173:return checkMethodDeclaration(e);case 175:return checkClassStaticBlockDeclaration(e);case 176:return checkConstructorDeclaration(e);case 177:case 178:return checkAccessorDeclaration(e);case 183:return checkTypeReferenceNode(e);case 182:return checkTypePredicate(e);case 186:return checkTypeQuery(e);case 187:return checkTypeLiteral(e);case 188:return checkArrayType(e);case 189:return checkTupleType(e);case 192:case 193:return checkUnionOrIntersectionType(e);case 196:case 190:case 191:return checkSourceElement(e.type);case 197:return checkThisType(e);case 198:return checkTypeOperator(e);case 194:return checkConditionalType(e);case 195:return checkInferType(e);case 203:return checkTemplateLiteralType(e);case 205:return checkImportType(e);case 202:return checkNamedTupleMember(e);case 328:return checkJSDocAugmentsTag(e);case 329:return checkJSDocImplementsTag(e);case 346:case 338:case 340:return checkJSDocTypeAliasTag(e);case 345:return checkJSDocTemplateTag(e);case 344:return checkJSDocTypeTag(e);case 324:case 325:case 326:return checkJSDocLinkLikeTag(e);case 341:return checkJSDocParameterTag(e);case 348:return checkJSDocPropertyTag(e);case 317:checkJSDocFunctionType(e);case 315:case 314:case 312:case 313:case 322:checkJSDocTypeIsInJsFile(e);forEachChild(e,checkSourceElement);return;case 318:checkJSDocVariadicType(e);return;case 309:return checkSourceElement(e.type);case 333:case 335:case 334:return checkJSDocAccessibilityModifiers(e);case 350:return checkJSDocSatisfiesTag(e);case 343:return checkJSDocThisTag(e);case 351:return checkJSDocImportTag(e);case 199:return checkIndexedAccessType(e);case 200:return checkMappedType(e);case 262:return checkFunctionDeclaration(e);case 241:case 268:return checkBlock(e);case 243:return checkVariableStatement(e);case 244:return checkExpressionStatement(e);case 245:return checkIfStatement(e);case 246:return checkDoStatement(e);case 247:return checkWhileStatement(e);case 248:return checkForStatement(e);case 249:return checkForInStatement(e);case 250:return checkForOfStatement(e);case 251:case 252:return checkBreakOrContinueStatement(e);case 253:return checkReturnStatement(e);case 254:return checkWithStatement(e);case 255:return checkSwitchStatement(e);case 256:return checkLabeledStatement(e);case 257:return checkThrowStatement(e);case 258:return checkTryStatement(e);case 260:return checkVariableDeclaration(e);case 208:return checkBindingElement(e);case 263:return checkClassDeclaration(e);case 264:return checkInterfaceDeclaration(e);case 265:return checkTypeAliasDeclaration(e);case 266:return checkEnumDeclaration(e);case 267:return checkModuleDeclaration(e);case 272:return checkImportDeclaration(e);case 271:return checkImportEqualsDeclaration(e);case 278:return checkExportDeclaration(e);case 277:return checkExportAssignment(e);case 242:case 259:checkGrammarStatementInAmbientContext(e);return;case 282:return checkMissingDeclaration(e)}}function checkJSDocCommentWorker(e){if(isArray(e)){forEach(e,(e=>{if(isJSDocLinkLike(e)){checkSourceElement(e)}}))}}function checkJSDocTypeIsInJsFile(e){if(!isInJSFile(e)){if(isJSDocNonNullableType(e)||isJSDocNullableType(e)){const t=tokenToString(isJSDocNonNullableType(e)?54:58);const n=e.postfix?wt._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1:wt._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1;const r=e.type;const i=getTypeFromTypeNode(r);grammarErrorOnNode(e,n,t,typeToString(isJSDocNullableType(e)&&!(i===et||i===Ze)?getUnionType(append([i,Me],e.postfix?void 0:We)):i))}else{grammarErrorOnNode(e,wt.JSDoc_types_can_only_be_used_inside_documentation_comments)}}}function checkJSDocVariadicType(e){checkJSDocTypeIsInJsFile(e);checkSourceElement(e.type);const{parent:t}=e;if(isParameter(t)&&isJSDocFunctionType(t.parent)){if(last(t.parent.parameters)!==t){error2(e,wt.A_rest_parameter_must_be_last_in_a_parameter_list)}return}if(!isJSDocTypeExpression(t)){error2(e,wt.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature)}const n=e.parent.parent;if(!isJSDocParameterTag(n)){error2(e,wt.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);return}const r=getParameterSymbolFromJSDoc(n);if(!r){return}const i=getHostSignatureFromJSDoc(n);if(!i||last(i.parameters).symbol!==r){error2(e,wt.A_rest_parameter_must_be_last_in_a_parameter_list)}}function getTypeFromJSDocVariadicType(e){const t=getTypeFromTypeNode(e.type);const{parent:n}=e;const r=e.parent.parent;if(isJSDocTypeExpression(e.parent)&&isJSDocParameterTag(r)){const e=getHostSignatureFromJSDoc(r);const n=isJSDocCallbackTag(r.parent.parent);if(e||n){const i=n?lastOrUndefined(r.parent.parent.typeExpression.parameters):lastOrUndefined(e.parameters);const o=getParameterSymbolFromJSDoc(r);if(!i||o&&i.symbol===o&&isRestParameter(i)){return createArrayType(t)}}}if(isParameter(n)&&isJSDocFunctionType(n.parent)){return createArrayType(t)}return addOptionality(t)}function checkNodeDeferred(e){const t=getSourceFileOfNode(e);const n=getNodeLinks(t);if(!(n.flags&1)){n.deferredNodes||(n.deferredNodes=new Set);n.deferredNodes.add(e)}else{S.assert(!n.deferredNodes,"A type-checked file should have no deferred nodes.")}}function checkDeferredNodes(e){const t=getNodeLinks(e);if(t.deferredNodes){t.deferredNodes.forEach(checkDeferredNode)}t.deferredNodes=void 0}function checkDeferredNode(e){var t,n;(t=G)==null?void 0:t.push(G.Phase.Check,"checkDeferredNode",{kind:e.kind,pos:e.pos,end:e.end,path:e.tracingPath});const r=m;m=e;p=0;switch(e.kind){case 213:case 214:case 215:case 170:case 286:resolveUntypedCall(e);break;case 218:case 219:case 174:case 173:checkFunctionExpressionOrObjectLiteralMethodDeferred(e);break;case 177:case 178:checkAccessorDeclaration(e);break;case 231:checkClassExpressionDeferred(e);break;case 168:checkTypeParameterDeferred(e);break;case 285:checkJsxSelfClosingElementDeferred(e);break;case 284:checkJsxElementDeferred(e);break;case 216:case 234:case 217:checkAssertionDeferred(e);break;case 222:checkExpression(e.expression);break;case 226:if(isInstanceOfExpression(e)){resolveUntypedCall(e)}break}m=r;(n=G)==null?void 0:n.pop()}function checkSourceFile(e,t){var n,r;(n=G)==null?void 0:n.push(G.Phase.Check,t?"checkSourceFileNodes":"checkSourceFile",{path:e.path},true);const i=t?"beforeCheckNodes":"beforeCheck";const o=t?"afterCheckNodes":"afterCheck";mark(i);t?checkSourceFileNodesWorker(e,t):checkSourceFileWorker(e);mark(o);measure("Check",i,o);(r=G)==null?void 0:r.pop()}function unusedIsError(e,t){if(t){return false}switch(e){case 0:return!!T.noUnusedLocals;case 1:return!!T.noUnusedParameters;default:return S.assertNever(e)}}function getPotentiallyUnusedIdentifiers(e){return xr.get(e.path)||d}function checkSourceFileWorker(t){const n=getNodeLinks(t);if(!(n.flags&1)){if(skipTypeChecking(t,T,e)){return}checkGrammarSourceFile(t);clear(si);clear(ci);clear(li);clear(di);clear(pi);if(n.flags&8388608){si=n.potentialThisCollisions;ci=n.potentialNewTargetCollisions;li=n.potentialWeakMapSetCollisions;di=n.potentialReflectCollisions;pi=n.potentialUnusedRenamedBindingElementsInTypes}forEach(t.statements,checkSourceElement);checkSourceElement(t.endOfFileToken);checkDeferredNodes(t);if(isExternalOrCommonJsModule(t)){registerForUnusedIdentifiersCheck(t)}addLazyDiagnostic((()=>{if(!t.isDeclarationFile&&(T.noUnusedLocals||T.noUnusedParameters)){checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(t),((e,t,n)=>{if(!containsParseError(e)&&unusedIsError(t,!!(e.flags&33554432))){gi.add(n)}}))}if(!t.isDeclarationFile){checkPotentialUncheckedRenamedBindingElementsInTypes()}}));if(isExternalOrCommonJsModule(t)){checkExternalModuleExports(t)}if(si.length){forEach(si,checkIfThisIsCapturedInEnclosingScope);clear(si)}if(ci.length){forEach(ci,checkIfNewTargetIsCapturedInEnclosingScope);clear(ci)}if(li.length){forEach(li,checkWeakMapSetCollision);clear(li)}if(di.length){forEach(di,checkReflectCollision);clear(di)}n.flags|=1}}function checkSourceFileNodesWorker(t,n){const r=getNodeLinks(t);if(!(r.flags&1)){if(skipTypeChecking(t,T,e)){return}checkGrammarSourceFile(t);clear(si);clear(ci);clear(li);clear(di);clear(pi);forEach(n,checkSourceElement);checkDeferredNodes(t);(r.potentialThisCollisions||(r.potentialThisCollisions=[])).push(...si);(r.potentialNewTargetCollisions||(r.potentialNewTargetCollisions=[])).push(...ci);(r.potentialWeakMapSetCollisions||(r.potentialWeakMapSetCollisions=[])).push(...li);(r.potentialReflectCollisions||(r.potentialReflectCollisions=[])).push(...di);(r.potentialUnusedRenamedBindingElementsInTypes||(r.potentialUnusedRenamedBindingElementsInTypes=[])).push(...pi);r.flags|=8388608;for(const e of n){const t=getNodeLinks(e);t.flags|=8388608}}}function getDiagnostics2(e,t,r){try{n=t;return getDiagnosticsWorker(e,r)}finally{n=void 0}}function ensurePendingDiagnosticWorkComplete(){for(const e of t){e()}t=[]}function checkSourceFileWithEagerDiagnostics(e,t){ensurePendingDiagnosticWorkComplete();const n=addLazyDiagnostic;addLazyDiagnostic=e=>e();checkSourceFile(e,t);addLazyDiagnostic=n}function getDiagnosticsWorker(t,n){if(t){ensurePendingDiagnosticWorkComplete();const e=gi.getGlobalDiagnostics();const r=e.length;checkSourceFileWithEagerDiagnostics(t,n);const i=gi.getDiagnostics(t.fileName);if(n){return i}const o=gi.getGlobalDiagnostics();if(o!==e){const t=relativeComplement(e,o,compareDiagnostics);return concatenate(t,i)}else if(r===0&&o.length>0){return concatenate(o,i)}return i}forEach(e.getSourceFiles(),(e=>checkSourceFileWithEagerDiagnostics(e)));return gi.getDiagnostics()}function getGlobalDiagnostics(){ensurePendingDiagnosticWorkComplete();return gi.getGlobalDiagnostics()}function getSymbolsInScope(e,t){if(e.flags&67108864){return[]}const n=createSymbolTable();let r=false;populateSymbols();n.delete("this");return symbolsToArray(n);function populateSymbols(){while(e){if(canHaveLocals(e)&&e.locals&&!isGlobalSourceFile(e)){copySymbols(e.locals,t)}switch(e.kind){case 307:if(!isExternalModule(e))break;case 267:copyLocallyVisibleExportSymbols(getSymbolOfDeclaration(e).exports,t&2623475);break;case 266:copySymbols(getSymbolOfDeclaration(e).exports,t&8);break;case 231:const n=e.name;if(n){copySymbol(e.symbol,t)}case 263:case 264:if(!r){copySymbols(getMembersOfSymbol(getSymbolOfDeclaration(e)),t&788968)}break;case 218:const i=e.name;if(i){copySymbol(e.symbol,t)}break}if(introducesArgumentsExoticObject(e)){copySymbol(q,t)}r=isStatic(e);e=e.parent}copySymbols(U,t)}function copySymbol(e,t){if(getCombinedLocalAndExportSymbolFlags(e)&t){const t=e.escapedName;if(!n.has(t)){n.set(t,e)}}}function copySymbols(e,t){if(t){e.forEach((e=>{copySymbol(e,t)}))}}function copyLocallyVisibleExportSymbols(e,t){if(t){e.forEach((e=>{if(!getDeclarationOfKind(e,281)&&!getDeclarationOfKind(e,280)&&e.escapedName!=="default"){copySymbol(e,t)}}))}}}function isTypeDeclarationName(e){return e.kind===80&&isTypeDeclaration(e.parent)&&getNameOfDeclaration(e.parent)===e}function isTypeReferenceIdentifier(e){while(e.parent.kind===166){e=e.parent}return e.parent.kind===183}function isInNameOfExpressionWithTypeArguments(e){while(e.parent.kind===211){e=e.parent}return e.parent.kind===233}function forEachEnclosingClass(e,t){let n;let r=getContainingClass(e);while(r){if(n=t(r))break;r=getContainingClass(r)}return n}function isNodeUsedDuringClassInitialization(e){return!!findAncestor(e,(e=>{if(isConstructorDeclaration(e)&&nodeIsPresent(e.body)||isPropertyDeclaration(e)){return true}else if(isClassLike(e)||isFunctionLikeDeclaration(e)){return"quit"}return false}))}function isNodeWithinClass(e,t){return!!forEachEnclosingClass(e,(e=>e===t))}function getLeftSideOfImportEqualsOrExportAssignment(e){while(e.parent.kind===166){e=e.parent}if(e.parent.kind===271){return e.parent.moduleReference===e?e.parent:void 0}if(e.parent.kind===277){return e.parent.expression===e?e.parent:void 0}return void 0}function isInRightSideOfImportOrExportAssignment(e){return getLeftSideOfImportEqualsOrExportAssignment(e)!==void 0}function getSpecialPropertyAssignmentSymbolFromEntityName(e){const t=getAssignmentDeclarationKind(e.parent.parent);switch(t){case 1:case 3:return getSymbolOfNode(e.parent);case 5:if(isPropertyAccessExpression(e.parent)&&getLeftmostAccessExpression(e.parent)===e){return void 0}case 4:case 2:return getSymbolOfDeclaration(e.parent.parent)}}function isImportTypeQualifierPart(e){let t=e.parent;while(isQualifiedName(t)){e=t;t=t.parent}if(t&&t.kind===205&&t.qualifier===e){return t}return void 0}function isThisPropertyAndThisTyped(e){if(e.expression.kind===110){const t=getThisContainer(e,false,false);if(isFunctionLike(t)){const e=getContainingObjectLiteral(t);if(e){const t=getApparentTypeOfContextualType(e,void 0);const n=getThisTypeOfObjectLiteralFromContextualType(e,t);return n&&!isTypeAny(n)}}}}function getSymbolOfNameOrPropertyAccessExpression(e){if(isDeclarationName(e)){return getSymbolOfNode(e.parent)}if(isInJSFile(e)&&e.parent.kind===211&&e.parent===e.parent.parent.left){if(!isPrivateIdentifier(e)&&!isJSDocMemberName(e)&&!isThisPropertyAndThisTyped(e.parent)){const t=getSpecialPropertyAssignmentSymbolFromEntityName(e);if(t){return t}}}if(e.parent.kind===277&&isEntityNameExpression(e)){const t=resolveEntityName(e,111551|788968|1920|2097152,true);if(t&&t!==xe){return t}}else if(isEntityName(e)&&isInRightSideOfImportOrExportAssignment(e)){const t=getAncestor(e,271);S.assert(t!==void 0);return getSymbolOfPartOfRightHandSideOfImportEquals(e,true)}if(isEntityName(e)){const t=isImportTypeQualifierPart(e);if(t){getTypeFromTypeNode(t);const n=getNodeLinks(e).resolvedSymbol;return n===xe?void 0:n}}while(isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(e)){e=e.parent}if(isInNameOfExpressionWithTypeArguments(e)){let t=0;if(e.parent.kind===233){t=isPartOfTypeNode(e)?788968:111551;if(isExpressionWithTypeArgumentsInClassExtendsClause(e.parent)){t|=111551}}else{t=1920}t|=2097152;const n=isEntityNameExpression(e)?resolveEntityName(e,t,true):void 0;if(n){return n}}if(e.parent.kind===341){return getParameterSymbolFromJSDoc(e.parent)}if(e.parent.kind===168&&e.parent.parent.kind===345){S.assert(!isInJSFile(e));const t=getTypeParameterFromJsDoc(e.parent);return t&&t.symbol}if(isExpressionNode(e)){if(nodeIsMissing(e)){return void 0}const t=findAncestor(e,or(isJSDocLinkLike,isJSDocNameReference,isJSDocMemberName));const n=t?788968|1920|111551:111551;if(e.kind===80){if(isJSXTagName(e)&&isJsxIntrinsicTagName(e)){const t=getIntrinsicTagSymbol(e.parent);return t===xe?void 0:t}const r=resolveEntityName(e,n,true,true,getHostSignatureFromJSDoc(e));if(!r&&t){const t=findAncestor(e,or(isClassLike,isInterfaceDeclaration));if(t){return resolveJSDocMemberName(e,true,getSymbolOfDeclaration(t))}}if(r&&t){const t=getJSDocHost(e);if(t&&isEnumMember(t)&&t===r.valueDeclaration){return resolveEntityName(e,n,true,true,getSourceFileOfNode(t))||r}}return r}else if(isPrivateIdentifier(e)){return getSymbolForPrivateIdentifierExpression(e)}else if(e.kind===211||e.kind===166){const n=getNodeLinks(e);if(n.resolvedSymbol){return n.resolvedSymbol}if(e.kind===211){checkPropertyAccessExpression(e,0);if(!n.resolvedSymbol){n.resolvedSymbol=getApplicableIndexSymbol(checkExpressionCached(e.expression),getLiteralTypeFromPropertyName(e.name))}}else{checkQualifiedName(e,0)}if(!n.resolvedSymbol&&t&&isQualifiedName(e)){return resolveJSDocMemberName(e)}return n.resolvedSymbol}else if(isJSDocMemberName(e)){return resolveJSDocMemberName(e)}}else if(isEntityName(e)&&isTypeReferenceIdentifier(e)){const t=e.parent.kind===183?788968:1920;const n=resolveEntityName(e,t,true,true);return n&&n!==xe?n:getUnresolvedSymbolForEntityName(e)}if(e.parent.kind===182){return resolveEntityName(e,1,true)}return void 0}function getApplicableIndexSymbol(e,t){const n=getApplicableIndexInfos(e,t);if(n.length&&e.members){const t=getIndexSymbolFromSymbolTable(resolveStructuredTypeMembers(e).members);if(n===getIndexInfosOfType(e)){return t}else if(t){const r=getSymbolLinks(t);const i=mapDefined(n,(e=>e.declaration));const o=map(i,getNodeId).join(",");if(!r.filteredIndexSymbolCache){r.filteredIndexSymbolCache=new Map}if(r.filteredIndexSymbolCache.has(o)){return r.filteredIndexSymbolCache.get(o)}else{const t=createSymbol(131072,"__index");t.declarations=mapDefined(n,(e=>e.declaration));t.parent=e.aliasSymbol?e.aliasSymbol:e.symbol?e.symbol:getSymbolAtLocation(t.declarations[0].parent);r.filteredIndexSymbolCache.set(o,t);return t}}}}function resolveJSDocMemberName(e,t,n){if(isEntityName(e)){const r=788968|1920|111551;let i=resolveEntityName(e,r,t,true,getHostSignatureFromJSDoc(e));if(!i&&isIdentifier(e)&&n){i=getMergedSymbol(getSymbol2(getExportsOfSymbol(n),e.escapedText,r))}if(i){return i}}const r=isIdentifier(e)?n:resolveJSDocMemberName(e.left,t,n);const i=isIdentifier(e)?e.escapedText:e.right.escapedText;if(r){const e=r.flags&111551&&getPropertyOfType(getTypeOfSymbol(r),"prototype");const t=e?getTypeOfSymbol(e):getDeclaredTypeOfSymbol(r);return getPropertyOfType(t,i)}}function getSymbolAtLocation(e,t){if(isSourceFile(e)){return isExternalModule(e)?getMergedSymbol(e.symbol):void 0}const{parent:n}=e;const r=n.parent;if(e.flags&67108864){return void 0}if(isDeclarationNameOrImportPropertyName(e)){const t=getSymbolOfDeclaration(n);return isImportOrExportSpecifier(e.parent)&&e.parent.propertyName===e?getImmediateAliasedSymbol(t):t}else if(isLiteralComputedPropertyDeclarationName(e)){return getSymbolOfDeclaration(n.parent)}if(e.kind===80){if(isInRightSideOfImportOrExportAssignment(e)){return getSymbolOfNameOrPropertyAccessExpression(e)}else if(n.kind===208&&r.kind===206&&e===n.propertyName){const t=getTypeOfNode(r);const n=getPropertyOfType(t,e.escapedText);if(n){return n}}else if(isMetaProperty(n)&&n.name===e){if(n.keywordToken===105&&idText(e)==="target"){return checkNewTargetMetaProperty(n).symbol}if(n.keywordToken===102&&idText(e)==="meta"){return getGlobalImportMetaExpressionType().members.get("meta")}return void 0}}switch(e.kind){case 80:case 81:case 211:case 166:if(!isThisInTypeQuery(e)){return getSymbolOfNameOrPropertyAccessExpression(e)}case 110:const i=getThisContainer(e,false,false);if(isFunctionLike(i)){const e=getSignatureFromDeclaration(i);if(e.thisParameter){return e.thisParameter}}if(isInExpressionContext(e)){return checkExpression(e).symbol}case 197:return getTypeFromThisTypeNode(e).symbol;case 108:return checkExpression(e).symbol;case 137:const o=e.parent;if(o&&o.kind===176){return o.parent.symbol}return void 0;case 11:case 15:if(isExternalModuleImportEqualsDeclaration(e.parent.parent)&&getExternalModuleImportEqualsDeclarationExpression(e.parent.parent)===e||(e.parent.kind===272||e.parent.kind===278)&&e.parent.moduleSpecifier===e||isInJSFile(e)&&isJSDocImportTag(e.parent)&&e.parent.moduleSpecifier===e||(isInJSFile(e)&&isRequireCall(e.parent,false)||isImportCall(e.parent))||isLiteralTypeNode(e.parent)&&isLiteralImportTypeNode(e.parent.parent)&&e.parent.parent.argument===e.parent){return resolveExternalModuleName(e,e,t)}if(isCallExpression(n)&&isBindableObjectDefinePropertyCall(n)&&n.arguments[1]===e){return getSymbolOfDeclaration(n)}case 9:const a=isElementAccessExpression(n)?n.argumentExpression===e?getTypeOfExpression(n.expression):void 0:isLiteralTypeNode(n)&&isIndexedAccessTypeNode(r)?getTypeFromTypeNode(r.objectType):void 0;return a&&getPropertyOfType(a,escapeLeadingUnderscores(e.text));case 90:case 100:case 39:case 86:return getSymbolOfNode(e.parent);case 205:return isLiteralImportTypeNode(e)?getSymbolAtLocation(e.argument.literal,t):void 0;case 95:return isExportAssignment(e.parent)?S.checkDefined(e.parent.symbol):void 0;case 102:case 105:return isMetaProperty(e.parent)?checkMetaPropertyKeyword(e.parent).symbol:void 0;case 104:if(isBinaryExpression(e.parent)){const t=getTypeOfExpression(e.parent.right);const n=getSymbolHasInstanceMethodOfObjectType(t);return(n==null?void 0:n.symbol)??t.symbol}return void 0;case 236:return checkExpression(e).symbol;case 295:if(isJSXTagName(e)&&isJsxIntrinsicTagName(e)){const t=getIntrinsicTagSymbol(e.parent);return t===xe?void 0:t}default:return void 0}}function getIndexInfosAtLocation(e){if(isIdentifier(e)&&isPropertyAccessExpression(e.parent)&&e.parent.name===e){const t=getLiteralTypeFromPropertyName(e);const n=getTypeOfExpression(e.parent.expression);const r=n.flags&1048576?n.types:[n];return flatMap(r,(e=>filter(getIndexInfosOfType(e),(e=>isApplicableIndexType(t,e.keyType)))))}return void 0}function getShorthandAssignmentValueSymbol(e){if(e&&e.kind===304){return resolveEntityName(e.name,111551|2097152,true)}return void 0}function getExportSpecifierLocalTargetSymbol(e){if(isExportSpecifier(e)){const t=e.propertyName||e.name;return e.parent.parent.moduleSpecifier?getExternalModuleMember(e.parent.parent,e):t.kind===11?void 0:resolveEntityName(t,111551|788968|1920|2097152,true)}else{return resolveEntityName(e,111551|788968|1920|2097152,true)}}function getTypeOfNode(e){if(isSourceFile(e)&&!isExternalModule(e)){return Ie}if(e.flags&67108864){return Ie}const t=tryGetClassImplementingOrExtendingExpressionWithTypeArguments(e);const n=t&&getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(t.class));if(isPartOfTypeNode(e)){const t=getTypeFromTypeNode(e);return n?getTypeWithThisArgument(t,n.thisType):t}if(isExpressionNode(e)){return getRegularTypeOfExpression(e)}if(n&&!t.isImplements){const e=firstOrUndefined(getBaseTypes(n));return e?getTypeWithThisArgument(e,n.thisType):Ie}if(isTypeDeclaration(e)){const t=getSymbolOfDeclaration(e);return getDeclaredTypeOfSymbol(t)}if(isTypeDeclarationName(e)){const t=getSymbolAtLocation(e);return t?getDeclaredTypeOfSymbol(t):Ie}if(isBindingElement(e)){return getTypeForVariableLikeDeclaration(e,true,0)||Ie}if(isDeclaration(e)){const t=getSymbolOfDeclaration(e);return t?getTypeOfSymbol(t):Ie}if(isDeclarationNameOrImportPropertyName(e)){const t=getSymbolAtLocation(e);if(t){return getTypeOfSymbol(t)}return Ie}if(isBindingPattern(e)){return getTypeForVariableLikeDeclaration(e.parent,true,0)||Ie}if(isInRightSideOfImportOrExportAssignment(e)){const t=getSymbolAtLocation(e);if(t){const e=getDeclaredTypeOfSymbol(t);return!isErrorType(e)?e:getTypeOfSymbol(t)}}if(isMetaProperty(e.parent)&&e.parent.keywordToken===e.kind){return checkMetaPropertyKeyword(e.parent)}if(isImportAttributes(e)){return getGlobalImportAttributesType(false)}return Ie}function getTypeOfAssignmentPattern(e){S.assert(e.kind===210||e.kind===209);if(e.parent.kind===250){const t=checkRightHandSideOfForOf(e.parent);return checkDestructuringAssignment(e,t||Ie)}if(e.parent.kind===226){const t=getTypeOfExpression(e.parent.right);return checkDestructuringAssignment(e,t||Ie)}if(e.parent.kind===303){const t=cast(e.parent.parent,isObjectLiteralExpression);const n=getTypeOfAssignmentPattern(t)||Ie;const r=indexOfNode(t.properties,e.parent);return checkObjectLiteralDestructuringPropertyAssignment(t,n,r)}const t=cast(e.parent,isArrayLiteralExpression);const n=getTypeOfAssignmentPattern(t)||Ie;const r=checkIteratedTypeOrElementType(65,n,Me,e.parent)||Ie;return checkArrayLiteralDestructuringElementAssignment(t,n,t.elements.indexOf(e),r)}function getPropertySymbolOfDestructuringAssignment(e){const t=getTypeOfAssignmentPattern(cast(e.parent.parent,isAssignmentPattern));return t&&getPropertyOfType(t,e.escapedText)}function getRegularTypeOfExpression(e){if(isRightSideOfQualifiedNameOrPropertyAccess(e)){e=e.parent}return getRegularTypeOfLiteralType(getTypeOfExpression(e))}function getParentTypeOfClassElement(e){const t=getSymbolOfNode(e.parent);return isStatic(e)?getTypeOfSymbol(t):getDeclaredTypeOfSymbol(t)}function getClassElementPropertyKeyType(e){const t=e.name;switch(t.kind){case 80:return getStringLiteralType(idText(t));case 9:case 11:return getStringLiteralType(t.text);case 167:const e=checkComputedPropertyName(t);return isTypeAssignableToKind(e,12288)?e:ze;default:return S.fail("Unsupported property name.")}}function getAugmentedPropertiesOfType(e){e=getApparentType(e);const t=createSymbolTable(getPropertiesOfType(e));const n=getSignaturesOfType(e,0).length?nn:getSignaturesOfType(e,1).length?rn:void 0;if(n){forEach(getPropertiesOfType(n),(e=>{if(!t.has(e.escapedName)){t.set(e.escapedName,e)}}))}return getNamedMembers(t)}function typeHasCallOrConstructSignatures(e){return getSignaturesOfType(e,0).length!==0||getSignaturesOfType(e,1).length!==0}function getRootSymbols(e){const t=getImmediateRootSymbols(e);return t?flatMap(t,getRootSymbols):[e]}function getImmediateRootSymbols(e){if(getCheckFlags(e)&6){return mapDefined(getSymbolLinks(e).containingType.types,(t=>getPropertyOfType(t,e.escapedName)))}else if(e.flags&33554432){const{links:{leftSpread:t,rightSpread:n,syntheticOrigin:r}}=e;return t?[t,n]:r?[r]:singleElementArray(tryGetTarget(e))}return void 0}function tryGetTarget(e){let t;let n=e;while(n=getSymbolLinks(n).target){t=n}return t}function isArgumentsLocalBinding(e){if(isGeneratedIdentifier(e))return false;const t=getParseTreeNode(e,isIdentifier);if(!t)return false;const n=t.parent;if(!n)return false;const r=(isPropertyAccessExpression(n)||isPropertyAssignment(n))&&n.name===t;return!r&&getReferencedValueSymbol(t)===q}function isNameOfModuleOrEnumDeclaration(e){return isModuleOrEnumDeclaration(e.parent)&&e===e.parent.name}function getReferencedExportContainer(e,t){var n;const r=getParseTreeNode(e,isIdentifier);if(r){let e=getReferencedValueSymbol(r,isNameOfModuleOrEnumDeclaration(r));if(e){if(e.flags&1048576){const n=getMergedSymbol(e.exportSymbol);if(!t&&n.flags&944&&!(n.flags&3)){return void 0}e=n}const i=getParentOfSymbol(e);if(i){if(i.flags&512&&((n=i.valueDeclaration)==null?void 0:n.kind)===307){const e=i.valueDeclaration;const t=getSourceFileOfNode(r);const n=e!==t;return n?void 0:e}return findAncestor(r.parent,(e=>isModuleOrEnumDeclaration(e)&&getSymbolOfDeclaration(e)===i))}}}}function getReferencedImportDeclaration(e){const t=getIdentifierGeneratedImportReference(e);if(t){return t}const n=getParseTreeNode(e,isIdentifier);if(n){const e=getReferencedValueOrAliasSymbol(n);if(isNonLocalAlias(e,111551)&&!getTypeOnlyAliasDeclaration(e,111551)){return getDeclarationOfAliasSymbol(e)}}return void 0}function isSymbolOfDestructuredElementOfCatchBinding(e){return e.valueDeclaration&&isBindingElement(e.valueDeclaration)&&walkUpBindingElementsAndPatterns(e.valueDeclaration).parent.kind===299}function isSymbolOfDeclarationWithCollidingName(e){if(e.flags&418&&e.valueDeclaration&&!isSourceFile(e.valueDeclaration)){const t=getSymbolLinks(e);if(t.isDeclarationWithCollidingName===void 0){const n=getEnclosingBlockScopeContainer(e.valueDeclaration);if(isStatementWithLocals(n)||isSymbolOfDestructuredElementOfCatchBinding(e)){if(te(n.parent,e.escapedName,111551,void 0,false)){t.isDeclarationWithCollidingName=true}else if(hasNodeCheckFlag(e.valueDeclaration,16384)){const r=hasNodeCheckFlag(e.valueDeclaration,32768);const i=isIterationStatement(n,false);const o=n.kind===241&&isIterationStatement(n.parent,false);t.isDeclarationWithCollidingName=!isBlockScopedContainerTopLevel(n)&&(!r||!i&&!o)}else{t.isDeclarationWithCollidingName=false}}}return t.isDeclarationWithCollidingName}return false}function getReferencedDeclarationWithCollidingName(e){if(!isGeneratedIdentifier(e)){const t=getParseTreeNode(e,isIdentifier);if(t){const e=getReferencedValueSymbol(t);if(e&&isSymbolOfDeclarationWithCollidingName(e)){return e.valueDeclaration}}}return void 0}function isDeclarationWithCollidingName(e){const t=getParseTreeNode(e,isDeclaration);if(t){const e=getSymbolOfDeclaration(t);if(e){return isSymbolOfDeclarationWithCollidingName(e)}}return false}function isValueAliasDeclaration(e){S.assert($);switch(e.kind){case 271:return isAliasResolvedToValue(getSymbolOfDeclaration(e));case 273:case 274:case 276:case 281:const t=getSymbolOfDeclaration(e);return!!t&&isAliasResolvedToValue(t,true);case 278:const n=e.exportClause;return!!n&&(isNamespaceExport(n)||some(n.elements,isValueAliasDeclaration));case 277:return e.expression&&e.expression.kind===80?isAliasResolvedToValue(getSymbolOfDeclaration(e),true):true}return false}function isTopLevelValueImportEqualsWithEntityName(e){const t=getParseTreeNode(e,isImportEqualsDeclaration);if(t===void 0||t.parent.kind!==307||!isInternalModuleImportEqualsDeclaration(t)){return false}const n=isAliasResolvedToValue(getSymbolOfDeclaration(t));return n&&t.moduleReference&&!nodeIsMissing(t.moduleReference)}function isAliasResolvedToValue(e,t){if(!e){return false}const n=getSourceFileOfNode(e.valueDeclaration);const r=n&&getSymbolOfDeclaration(n);void resolveExternalModuleSymbol(r);const i=getExportSymbolOfValueSymbolIfExported(resolveAlias(e));if(i===xe){return!t||!getTypeOnlyAliasDeclaration(e)}return!!(getSymbolFlags(e,t,true)&111551)&&(er(T)||!isConstEnumOrConstEnumOnlyModule(i))}function isConstEnumOrConstEnumOnlyModule(e){return isConstEnumSymbol(e)||!!e.constEnumOnlyModule}function isReferencedAliasDeclaration(e,t){S.assert($);if(isAliasSymbolDeclaration(e)){const t=getSymbolOfDeclaration(e);const n=t&&getSymbolLinks(t);if(n==null?void 0:n.referenced){return true}const r=getSymbolLinks(t).aliasTarget;if(r&&getEffectiveModifierFlags(e)&32&&getSymbolFlags(r)&111551&&(er(T)||!isConstEnumOrConstEnumOnlyModule(r))){return true}}if(t){return!!forEachChild(e,(e=>isReferencedAliasDeclaration(e,t)))}return false}function isImplementationOfOverload(e){if(nodeIsPresent(e.body)){if(isGetAccessor(e)||isSetAccessor(e))return false;const t=getSymbolOfDeclaration(e);const n=getSignaturesOfSymbol(t);return n.length>1||n.length===1&&n[0].declaration!==e}return false}function declaredParameterTypeContainsUndefined(e){const t=getNonlocalEffectiveTypeAnnotationNode(e);if(!t)return false;const n=getTypeFromTypeNode(t);return isErrorType(n)||containsUndefinedType(n)}function requiresAddingImplicitUndefined(e,t){return(isRequiredInitializedParameter(e,t)||isOptionalUninitializedParameterProperty(e))&&!declaredParameterTypeContainsUndefined(e)}function isRequiredInitializedParameter(e,t){if(!k||isOptionalParameter(e)||isJSDocParameterTag(e)||!e.initializer){return false}if(hasSyntacticModifier(e,31)){return!!t&&isFunctionLikeDeclaration(t)}return true}function isOptionalUninitializedParameterProperty(e){return k&&isOptionalParameter(e)&&(isJSDocParameterTag(e)||!e.initializer)&&hasSyntacticModifier(e,31)}function isExpandoFunctionDeclaration(e){const t=getParseTreeNode(e,(e=>isFunctionDeclaration(e)||isVariableDeclaration(e)));if(!t){return false}let n;if(isVariableDeclaration(t)){if(t.type||!isInJSFile(t)&&!isVarConstLike2(t)){return false}const e=getDeclaredExpandoInitializer(t);if(!e||!canHaveSymbol(e)){return false}n=getSymbolOfDeclaration(e)}else{n=getSymbolOfDeclaration(t)}if(!n||!(n.flags&16|3)){return false}return!!forEachEntry(getExportsOfSymbol(n),(e=>e.flags&111551&&isExpandoPropertyDeclaration(e.valueDeclaration)))}function getPropertiesOfContainerFunction(e){const t=getParseTreeNode(e,isFunctionDeclaration);if(!t){return d}const n=getSymbolOfDeclaration(t);return n&&getPropertiesOfType(getTypeOfSymbol(n))||d}function getNodeCheckFlags(e){var t;const n=e.id||0;if(n<0||n>=Yr.length)return 0;return((t=Yr[n])==null?void 0:t.flags)||0}function hasNodeCheckFlag(e,t){calculateNodeCheckFlagWorker(e,t);return!!(getNodeCheckFlags(e)&t)}function calculateNodeCheckFlagWorker(e,t){if(!T.noCheck&&canIncludeBindAndCheckDiagnostics(getSourceFileOfNode(e),T)){return}const n=getNodeLinks(e);if(n.calculatedFlags&t){return}switch(t){case 16:case 32:return checkSingleSuperExpression(e);case 128:case 256:case 2097152:return checkChildSuperExpressions(e);case 512:case 8192:case 65536:case 262144:return checkChildIdentifiers(e);case 536870912:return checkSingleIdentifier(e);case 4096:case 32768:case 16384:return checkContainingBlockScopeBindingUses(e);default:return S.assertNever(t,`Unhandled node check flag calculation: ${S.formatNodeCheckFlags(t)}`)}function forEachNodeRecursively(e,t){const n=t(e,e.parent);if(n==="skip")return void 0;if(n)return n;return forEachChildRecursively(e,t)}function checkSuperExpressions(e){const n=getNodeLinks(e);if(n.calculatedFlags&t)return"skip";n.calculatedFlags|=128|256|2097152;checkSingleSuperExpression(e);return void 0}function checkChildSuperExpressions(e){forEachNodeRecursively(e,checkSuperExpressions)}function checkSingleSuperExpression(e){const t=getNodeLinks(e);t.calculatedFlags|=16|32;if(e.kind===108){checkSuperExpression(e)}}function checkIdentifiers(e){const n=getNodeLinks(e);if(n.calculatedFlags&t)return"skip";n.calculatedFlags|=512|8192|65536|262144;checkSingleIdentifier(e);return void 0}function checkChildIdentifiers(e){forEachNodeRecursively(e,checkIdentifiers)}function isExpressionNodeOrShorthandPropertyAssignmentName(e){return isExpressionNode(e)||isShorthandPropertyAssignment(e.parent)&&(e.parent.objectAssignmentInitializer??e.parent.name)===e}function checkSingleIdentifier(e){const t=getNodeLinks(e);t.calculatedFlags|=536870912;if(isIdentifier(e)){t.calculatedFlags|=32768|16384;if(isExpressionNodeOrShorthandPropertyAssignmentName(e)&&!(isPropertyAccessExpression(e.parent)&&e.parent.name===e)){const t=getResolvedSymbol(e);if(t&&t!==xe){checkIdentifierCalculateNodeCheckFlags(e,t)}}}}function checkBlockScopeBindings(e){const n=getNodeLinks(e);if(n.calculatedFlags&t)return"skip";n.calculatedFlags|=4096|32768|16384;checkSingleBlockScopeBinding(e);return void 0}function checkContainingBlockScopeBindingUses(e){const t=getEnclosingBlockScopeContainer(isDeclarationName(e)?e.parent:e);forEachNodeRecursively(t,checkBlockScopeBindings)}function checkSingleBlockScopeBinding(e){checkSingleIdentifier(e);if(isComputedPropertyName(e)){checkComputedPropertyName(e)}if(isPrivateIdentifier(e)&&isClassElement(e.parent)){setNodeLinksForPrivateIdentifierScope(e.parent)}}}function getEnumMemberValue(e){computeEnumMemberValues(e.parent);return getNodeLinks(e).enumMemberValue??evaluatorResult(void 0)}function canHaveConstantValue(e){switch(e.kind){case 306:case 211:case 212:return true}return false}function getConstantValue2(e){if(e.kind===306){return getEnumMemberValue(e).value}if(!getNodeLinks(e).resolvedSymbol){void checkExpressionCached(e)}const t=getNodeLinks(e).resolvedSymbol||(isEntityNameExpression(e)?resolveEntityName(e,111551,true):void 0);if(t&&t.flags&8){const e=t.valueDeclaration;if(isEnumConst(e.parent)){return getEnumMemberValue(e).value}}return void 0}function isFunctionType(e){return!!(e.flags&524288)&&getSignaturesOfType(e,0).length>0}function getTypeReferenceSerializationKind(e,t){var n;const r=getParseTreeNode(e,isEntityName);if(!r)return 0;if(t){t=getParseTreeNode(t);if(!t)return 0}let i=false;if(isQualifiedName(r)){const e=resolveEntityName(getFirstIdentifier(r),111551,true,true,t);i=!!((n=e==null?void 0:e.declarations)==null?void 0:n.every(isTypeOnlyImportOrExportDeclaration))}const o=resolveEntityName(r,111551,true,true,t);const a=o&&o.flags&2097152?resolveAlias(o):o;i||(i=!!(o&&getTypeOnlyAliasDeclaration(o,111551)));const s=resolveEntityName(r,788968,true,true,t);const c=s&&s.flags&2097152?resolveAlias(s):s;if(!o){i||(i=!!(s&&getTypeOnlyAliasDeclaration(s,788968)))}if(a&&a===c){const e=getGlobalPromiseConstructorSymbol(false);if(e&&a===e){return 9}const t=getTypeOfSymbol(a);if(t&&isConstructorType(t)){return i?10:1}}if(!c){return i?11:0}const l=getDeclaredTypeOfSymbol(c);if(isErrorType(l)){return i?11:0}else if(l.flags&3){return 11}else if(isTypeAssignableToKind(l,16384|98304|131072)){return 2}else if(isTypeAssignableToKind(l,528)){return 6}else if(isTypeAssignableToKind(l,296)){return 3}else if(isTypeAssignableToKind(l,2112)){return 4}else if(isTypeAssignableToKind(l,402653316)){return 5}else if(isTupleType(l)){return 7}else if(isTypeAssignableToKind(l,12288)){return 8}else if(isFunctionType(l)){return 10}else if(isArrayType(l)){return 7}else{return 11}}function createTypeOfDeclaration(e,t,n,r,i){const o=getParseTreeNode(e,hasInferredType);if(!o){return zr.createToken(133)}const a=getSymbolOfDeclaration(o);return j.serializeTypeForDeclaration(o,a,t,n|1024,r,i)}function getAllAccessorDeclarationsForDeclaration(e){e=getParseTreeNode(e,isGetOrSetAccessorDeclaration);const t=e.kind===178?177:178;const n=getDeclarationOfKind(getSymbolOfDeclaration(e),t);const r=n&&n.pos{switch(e.kind){case 260:case 169:case 208:case 172:case 303:case 304:case 306:case 210:case 262:case 218:case 219:case 263:case 231:case 266:case 174:case 177:case 178:case 267:return true}return false}))}}}return void 0}function isLiteralConstDeclaration(e){if(isDeclarationReadonly(e)||isVariableDeclaration(e)&&isVarConstLike2(e)){return isFreshLiteralType(getTypeOfSymbol(getSymbolOfDeclaration(e)))}return false}function literalTypeToNode(e,t,n){const r=e.flags&1056?j.symbolToExpression(e.symbol,111551,t,void 0,void 0,n):e===Ke?zr.createTrue():e===He&&zr.createFalse();if(r)return r;const i=e.value;return typeof i==="object"?zr.createBigIntLiteral(i):typeof i==="string"?zr.createStringLiteral(i):i<0?zr.createPrefixUnaryExpression(41,zr.createNumericLiteral(-i)):zr.createNumericLiteral(i)}function createLiteralConstValue(e,t){const n=getTypeOfSymbol(getSymbolOfDeclaration(e));return literalTypeToNode(n,e,t)}function getJsxFactoryEntity(e){return e?(getJsxNamespace(e),getSourceFileOfNode(e).localJsxFactory||Si):Si}function getJsxFragmentFactoryEntity(e){if(e){const t=getSourceFileOfNode(e);if(t){if(t.localJsxFragmentFactory){return t.localJsxFragmentFactory}const e=t.pragmas.get("jsxfrag");const n=isArray(e)?e[0]:e;if(n){t.localJsxFragmentFactory=parseIsolatedEntityName(n.arguments.factory,v);return t.localJsxFragmentFactory}}}if(T.jsxFragmentFactory){return parseIsolatedEntityName(T.jsxFragmentFactory,v)}}function getNonlocalEffectiveTypeAnnotationNode(e){const t=getEffectiveTypeAnnotationNode(e);if(t){return t}if(e.kind===169&&e.parent.kind===178){const t=getAllAccessorDeclarationsForDeclaration(e.parent).getAccessor;if(t){return getEffectiveReturnTypeNode(t)}}return void 0}function createResolver(){return{getReferencedExportContainer:getReferencedExportContainer,getReferencedImportDeclaration:getReferencedImportDeclaration,getReferencedDeclarationWithCollidingName:getReferencedDeclarationWithCollidingName,isDeclarationWithCollidingName:isDeclarationWithCollidingName,isValueAliasDeclaration:e=>{const t=getParseTreeNode(e);return t&&$?isValueAliasDeclaration(t):true},hasGlobalName:hasGlobalName,isReferencedAliasDeclaration:(e,t)=>{const n=getParseTreeNode(e);return n&&$?isReferencedAliasDeclaration(n,t):true},hasNodeCheckFlag:(e,t)=>{const n=getParseTreeNode(e);if(!n)return false;return hasNodeCheckFlag(n,t)},isTopLevelValueImportEqualsWithEntityName:isTopLevelValueImportEqualsWithEntityName,isDeclarationVisible:isDeclarationVisible,isImplementationOfOverload:isImplementationOfOverload,requiresAddingImplicitUndefined:requiresAddingImplicitUndefined,isExpandoFunctionDeclaration:isExpandoFunctionDeclaration,getPropertiesOfContainerFunction:getPropertiesOfContainerFunction,createTypeOfDeclaration:createTypeOfDeclaration,createReturnTypeOfSignatureDeclaration:createReturnTypeOfSignatureDeclaration,createTypeOfExpression:createTypeOfExpression,createLiteralConstValue:createLiteralConstValue,isSymbolAccessible:isSymbolAccessible,isEntityNameVisible:isEntityNameVisible,getConstantValue:e=>{const t=getParseTreeNode(e,canHaveConstantValue);return t?getConstantValue2(t):void 0},getEnumMemberValue:e=>{const t=getParseTreeNode(e,isEnumMember);return t?getEnumMemberValue(t):void 0},collectLinkedAliases:collectLinkedAliases,markLinkedReferences:e=>{const t=getParseTreeNode(e);return t&&markLinkedReferences(t,0)},getReferencedValueDeclaration:getReferencedValueDeclaration,getReferencedValueDeclarations:getReferencedValueDeclarations,getTypeReferenceSerializationKind:getTypeReferenceSerializationKind,isOptionalParameter:isOptionalParameter,isArgumentsLocalBinding:isArgumentsLocalBinding,getExternalModuleFileFromDeclaration:e=>{const t=getParseTreeNode(e,hasPossibleExternalModuleReference);return t&&getExternalModuleFileFromDeclaration(t)},isLiteralConstDeclaration:isLiteralConstDeclaration,isLateBound:e=>{const t=getParseTreeNode(e,isDeclaration);const n=t&&getSymbolOfDeclaration(t);return!!(n&&getCheckFlags(n)&4096)},getJsxFactoryEntity:getJsxFactoryEntity,getJsxFragmentFactoryEntity:getJsxFragmentFactoryEntity,isBindingCapturedByNode:(e,t)=>{const n=getParseTreeNode(e);const r=getParseTreeNode(t);return!!n&&!!r&&(isVariableDeclaration(r)||isBindingElement(r))&&isBindingCapturedByNode(n,r)},getDeclarationStatementsForSourceFile:(e,t,n,r)=>{const i=getParseTreeNode(e);S.assert(i&&i.kind===307,"Non-sourcefile node passed into getDeclarationsForSourceFile");const o=getSymbolOfDeclaration(e);if(!o){return!e.locals?[]:j.symbolTableToDeclarationStatements(e.locals,e,t,n,r)}resolveExternalModuleSymbol(o);return!o.exports?[]:j.symbolTableToDeclarationStatements(o.exports,e,t,n,r)},isImportRequiredByAugmentation:isImportRequiredByAugmentation,isDefinitelyReferenceToGlobalSymbolObject:isDefinitelyReferenceToGlobalSymbolObject,createLateBoundIndexSignatures:(e,t,n,r,i)=>{const o=e.symbol;const a=getIndexInfosOfType(getTypeOfSymbol(o));const s=getIndexSymbol(o);const c=s&&getIndexInfosOfIndexSymbol(s,arrayFrom(getMembersOfSymbol(o).values()));let l;for(const e of[a,c]){if(!length(e))continue;l||(l=[]);for(const o of e){if(o.declaration)continue;if(o===Ut)continue;if(o.components){const s=every(o.components,(e=>{var n;return!!(e.name&&isComputedPropertyName(e.name)&&isEntityNameExpression(e.name.expression)&&t&&((n=isEntityNameVisible(e.name.expression,t,false))==null?void 0:n.accessibility)===0)}));if(s){const s=filter(o.components,(e=>!hasLateBindableName(e)));l.push(...map(s,(s=>{trackComputedName(s.name.expression);const c=e===a?[zr.createModifier(126)]:void 0;return zr.createPropertyDeclaration(append(c,o.isReadonly?zr.createModifier(148):void 0),s.name,(isPropertySignature(s)||isPropertyDeclaration(s)||isMethodSignature(s)||isMethodDeclaration(s)||isGetAccessor(s)||isSetAccessor(s))&&s.questionToken?zr.createToken(58):void 0,j.typeToTypeNode(getTypeOfSymbol(s.symbol),t,n,r,i),void 0)})));continue}}const s=j.indexInfoToIndexSignatureDeclaration(o,t,n,r,i);if(s&&e===a){(s.modifiers||(s.modifiers=zr.createNodeArray())).unshift(zr.createModifier(126))}if(s){l.push(s)}}}return l;function trackComputedName(e){if(!i.trackSymbol)return;const n=getFirstIdentifier(e);const r=te(n,n.escapedText,111551|1048576,void 0,true);if(r){i.trackSymbol(r,t,111551)}}}};function isImportRequiredByAugmentation(e){const t=getSourceFileOfNode(e);if(!t.symbol)return false;const n=getExternalModuleFileFromDeclaration(e);if(!n)return false;if(n===t)return false;const r=getExportsOfModule(t.symbol);for(const e of arrayFrom(r.values())){if(e.mergeId){const t=getMergedSymbol(e);if(t.declarations){for(const e of t.declarations){const t=getSourceFileOfNode(e);if(t===n){return true}}}}}return false}}function getExternalModuleFileFromDeclaration(e){const t=e.kind===267?tryCast(e.name,isStringLiteral):getExternalModuleName(e);const n=resolveExternalModuleNameWorker(t,t,void 0);if(!n){return void 0}return getDeclarationOfKind(n,307)}function initializeTypeChecker(){for(const t of e.getSourceFiles()){bindSourceFile(t,T)}Kt=new Map;let t;for(const n of e.getSourceFiles()){if(n.redirectInfo){continue}if(!isExternalOrCommonJsModule(n)){const e=n.locals.get("globalThis");if(e==null?void 0:e.declarations){for(const t of e.declarations){gi.add(createDiagnosticForNode(t,wt.Declaration_name_conflicts_with_built_in_global_identifier_0,"globalThis"))}}mergeSymbolTable(U,n.locals)}if(n.jsGlobalAugmentations){mergeSymbolTable(U,n.jsGlobalAugmentations)}if(n.patternAmbientModules&&n.patternAmbientModules.length){Yt=concatenate(Yt,n.patternAmbientModules)}if(n.moduleAugmentations.length){(t||(t=[])).push(n.moduleAugmentations)}if(n.symbol&&n.symbol.globalExports){const e=n.symbol.globalExports;e.forEach(((e,t)=>{if(!U.has(t)){U.set(t,e)}}))}}if(t){for(const e of t){for(const t of e){if(!isGlobalScopeAugmentation(t.parent))continue;mergeModuleAugmentation(t)}}}addUndefinedToGlobalsOrErrorOnRedeclaration();getSymbolLinks(z).type=Re;getSymbolLinks(q).type=getGlobalType("IArguments",0,true);getSymbolLinks(xe).type=Ie;getSymbolLinks(V).type=createObjectType(16,V);on=getGlobalType("Array",1,true);en=getGlobalType("Object",0,true);tn=getGlobalType("Function",0,true);nn=P&&getGlobalType("CallableFunction",0,true)||tn;rn=P&&getGlobalType("NewableFunction",0,true)||tn;pn=getGlobalType("String",0,true);fn=getGlobalType("Number",0,true);mn=getGlobalType("Boolean",0,true);_n=getGlobalType("RegExp",0,true);yn=createArrayType(ke);hn=createArrayType(Fe);if(hn===ht){hn=createAnonymousType(void 0,y,d,d,d)}an=getGlobalTypeOrUndefined("ReadonlyArray",1)||on;Tn=an?createTypeFromGenericGlobalType(an,[ke]):yn;gn=getGlobalTypeOrUndefined("ThisType",1);if(t){for(const e of t){for(const t of e){if(isGlobalScopeAugmentation(t.parent))continue;mergeModuleAugmentation(t)}}}Kt.forEach((({firstFile:e,secondFile:t,conflictingSymbols:n})=>{if(n.size<8){n.forEach((({isBlockScoped:e,firstFileLocations:t,secondFileLocations:n},r)=>{const i=e?wt.Cannot_redeclare_block_scoped_variable_0:wt.Duplicate_identifier_0;for(const e of t){addDuplicateDeclarationError(e,i,r,n)}for(const e of n){addDuplicateDeclarationError(e,i,r,t)}}))}else{const r=arrayFrom(n.keys()).join(", ");gi.add(addRelatedInfo(createDiagnosticForNode(e,wt.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,r),createDiagnosticForNode(t,wt.Conflicts_are_in_this_file)));gi.add(addRelatedInfo(createDiagnosticForNode(t,wt.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,r),createDiagnosticForNode(e,wt.Conflicts_are_in_this_file)))}}));Kt=void 0}function checkExternalEmitHelpers(e,t){if(T.importHelpers){const n=getSourceFileOfNode(e);if(isEffectiveExternalModule(n,T)&&!(e.flags&33554432)){const r=resolveHelpersModule(n,e);if(r!==xe){const n=getSymbolLinks(r);n.requestedExternalEmitHelpers??(n.requestedExternalEmitHelpers=0);if((n.requestedExternalEmitHelpers&t)!==t){const i=t&~n.requestedExternalEmitHelpers;for(let t=1;t<=16777216;t<<=1){if(i&t){for(const n of getHelperNames(t)){const i=resolveSymbol(getSymbol2(getExportsOfModule(r),escapeLeadingUnderscores(n),111551));if(!i){error2(e,wt.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0,cn,n)}else if(t&524288){if(!some(getSignaturesOfSymbol(i),(e=>getParameterCount(e)>3))){error2(e,wt.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,cn,n,4)}}else if(t&1048576){if(!some(getSignaturesOfSymbol(i),(e=>getParameterCount(e)>4))){error2(e,wt.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,cn,n,5)}}else if(t&1024){if(!some(getSignaturesOfSymbol(i),(e=>getParameterCount(e)>2))){error2(e,wt.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,cn,n,3)}}}}}}n.requestedExternalEmitHelpers|=t}}}}function getHelperNames(e){switch(e){case 1:return["__extends"];case 2:return["__assign"];case 4:return["__rest"];case 8:return b?["__decorate"]:["__esDecorate","__runInitializers"];case 16:return["__metadata"];case 32:return["__param"];case 64:return["__awaiter"];case 128:return["__generator"];case 256:return["__values"];case 512:return["__read"];case 1024:return["__spreadArray"];case 2048:return["__await"];case 4096:return["__asyncGenerator"];case 8192:return["__asyncDelegator"];case 16384:return["__asyncValues"];case 32768:return["__exportStar"];case 65536:return["__importStar"];case 131072:return["__importDefault"];case 262144:return["__makeTemplateObject"];case 524288:return["__classPrivateFieldGet"];case 1048576:return["__classPrivateFieldSet"];case 2097152:return["__classPrivateFieldIn"];case 4194304:return["__setFunctionName"];case 8388608:return["__propKey"];case 16777216:return["__addDisposableResource","__disposeResources"];case 33554432:return["__rewriteRelativeImportExtension"];default:return S.fail("Unrecognized helper")}}function resolveHelpersModule(e,t){const n=getNodeLinks(e);if(!n.externalHelpersModule){n.externalHelpersModule=resolveExternalModule(getImportHelpersImportSpecifier(e),cn,wt.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found,t)||xe}return n.externalHelpersModule}function checkGrammarModifiers(t){var n;const r=reportObviousDecoratorErrors(t)||reportObviousModifierErrors(t);if(r!==void 0){return r}if(isParameter(t)&¶meterIsThisKeyword(t)){return grammarErrorOnFirstToken(t,wt.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters)}const i=isVariableStatement(t)?t.declarationList.flags&7:0;let o,a,s,c,l;let d=0;let p=false;let u=false;for(const r of t.modifiers){if(isDecorator(r)){if(!nodeCanBeDecorated(b,t,t.parent,t.parent.parent)){if(t.kind===174&&!nodeIsPresent(t.body)){return grammarErrorOnFirstToken(t,wt.A_decorator_can_only_decorate_a_method_implementation_not_an_overload)}else{return grammarErrorOnFirstToken(t,wt.Decorators_are_not_valid_here)}}else if(b&&(t.kind===177||t.kind===178)){const e=getAllAccessorDeclarationsForDeclaration(t);if(hasDecorators(e.firstAccessor)&&t===e.secondAccessor){return grammarErrorOnFirstToken(t,wt.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name)}}if(d&~(2080|32768)){return grammarErrorOnNode(r,wt.Decorators_are_not_valid_here)}if(u&&d&98303){S.assertIsDefined(l);const e=getSourceFileOfNode(r);if(!hasParseDiagnostics(e)){addRelatedInfo(error2(r,wt.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),createDiagnosticForNode(l,wt.Decorator_used_before_export_here));return true}return false}d|=32768;if(!(d&98303)){u=true}else if(d&32){p=true}l??(l=r)}else{if(r.kind!==148){if(t.kind===171||t.kind===173){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_type_member,tokenToString(r.kind))}if(t.kind===181&&(r.kind!==126||!isClassLike(t.parent))){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_an_index_signature,tokenToString(r.kind))}}if(r.kind!==103&&r.kind!==147&&r.kind!==87){if(t.kind===168){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_type_parameter,tokenToString(r.kind))}}switch(r.kind){case 87:{if(t.kind!==266&&t.kind!==168){return grammarErrorOnNode(t,wt.A_class_member_cannot_have_the_0_keyword,tokenToString(87))}const e=isJSDocTemplateTag(t.parent)&&getEffectiveJSDocHost(t.parent)||t.parent;if(t.kind===168&&!(isFunctionLikeDeclaration(e)||isClassLike(e)||isFunctionTypeNode(e)||isConstructorTypeNode(e)||isCallSignatureDeclaration(e)||isConstructSignatureDeclaration(e)||isMethodSignature(e))){return grammarErrorOnNode(r,wt._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class,tokenToString(r.kind))}break}case 164:if(d&16){return grammarErrorOnNode(r,wt._0_modifier_already_seen,"override")}else if(d&128){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,"override","declare")}else if(d&8){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"override","readonly")}else if(d&512){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"override","accessor")}else if(d&1024){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"override","async")}d|=16;c=r;break;case 125:case 124:case 123:const u=visibilityToString(modifierToFlag(r.kind));if(d&7){return grammarErrorOnNode(r,wt.Accessibility_modifier_already_seen)}else if(d&16){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,u,"override")}else if(d&256){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,u,"static")}else if(d&512){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,u,"accessor")}else if(d&8){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,u,"readonly")}else if(d&1024){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,u,"async")}else if(t.parent.kind===268||t.parent.kind===307){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_module_or_namespace_element,u)}else if(d&64){if(r.kind===123){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,u,"abstract")}else{return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,u,"abstract")}}else if(isPrivateIdentifierClassElementDeclaration(t)){return grammarErrorOnNode(r,wt.An_accessibility_modifier_cannot_be_used_with_a_private_identifier)}d|=modifierToFlag(r.kind);break;case 126:if(d&256){return grammarErrorOnNode(r,wt._0_modifier_already_seen,"static")}else if(d&8){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"static","readonly")}else if(d&1024){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"static","async")}else if(d&512){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"static","accessor")}else if(t.parent.kind===268||t.parent.kind===307){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_module_or_namespace_element,"static")}else if(t.kind===169){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_parameter,"static")}else if(d&64){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,"static","abstract")}else if(d&16){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"static","override")}d|=256;o=r;break;case 129:if(d&512){return grammarErrorOnNode(r,wt._0_modifier_already_seen,"accessor")}else if(d&8){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,"accessor","readonly")}else if(d&128){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,"accessor","declare")}else if(t.kind!==172){return grammarErrorOnNode(r,wt.accessor_modifier_can_only_appear_on_a_property_declaration)}d|=512;break;case 148:if(d&8){return grammarErrorOnNode(r,wt._0_modifier_already_seen,"readonly")}else if(t.kind!==172&&t.kind!==171&&t.kind!==181&&t.kind!==169){return grammarErrorOnNode(r,wt.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature)}else if(d&512){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,"readonly","accessor")}d|=8;break;case 95:if(T.verbatimModuleSyntax&&!(t.flags&33554432)&&t.kind!==265&&t.kind!==264&&t.kind!==267&&t.parent.kind===307&&e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))===1){return grammarErrorOnNode(r,wt.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled)}if(d&32){return grammarErrorOnNode(r,wt._0_modifier_already_seen,"export")}else if(d&128){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"export","declare")}else if(d&64){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"export","abstract")}else if(d&1024){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"export","async")}else if(isClassLike(t.parent)){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_class_elements_of_this_kind,"export")}else if(t.kind===169){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_parameter,"export")}else if(i===4){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_using_declaration,"export")}else if(i===6){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_an_await_using_declaration,"export")}d|=32;break;case 90:const f=t.parent.kind===307?t.parent:t.parent.parent;if(f.kind===267&&!isAmbientModule(f)){return grammarErrorOnNode(r,wt.A_default_export_can_only_be_used_in_an_ECMAScript_style_module)}else if(i===4){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_using_declaration,"default")}else if(i===6){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_an_await_using_declaration,"default")}else if(!(d&32)){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"export","default")}else if(p){return grammarErrorOnNode(l,wt.Decorators_are_not_valid_here)}d|=2048;break;case 138:if(d&128){return grammarErrorOnNode(r,wt._0_modifier_already_seen,"declare")}else if(d&1024){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_in_an_ambient_context,"async")}else if(d&16){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_in_an_ambient_context,"override")}else if(isClassLike(t.parent)&&!isPropertyDeclaration(t)){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_class_elements_of_this_kind,"declare")}else if(t.kind===169){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_parameter,"declare")}else if(i===4){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_using_declaration,"declare")}else if(i===6){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_an_await_using_declaration,"declare")}else if(t.parent.flags&33554432&&t.parent.kind===268){return grammarErrorOnNode(r,wt.A_declare_modifier_cannot_be_used_in_an_already_ambient_context)}else if(isPrivateIdentifierClassElementDeclaration(t)){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_a_private_identifier,"declare")}else if(d&512){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,"declare","accessor")}d|=128;a=r;break;case 128:if(d&64){return grammarErrorOnNode(r,wt._0_modifier_already_seen,"abstract")}if(t.kind!==263&&t.kind!==185){if(t.kind!==174&&t.kind!==172&&t.kind!==177&&t.kind!==178){return grammarErrorOnNode(r,wt.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration)}if(!(t.parent.kind===263&&hasSyntacticModifier(t.parent,64))){const e=t.kind===172?wt.Abstract_properties_can_only_appear_within_an_abstract_class:wt.Abstract_methods_can_only_appear_within_an_abstract_class;return grammarErrorOnNode(r,e)}if(d&256){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,"static","abstract")}if(d&2){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,"private","abstract")}if(d&1024&&s){return grammarErrorOnNode(s,wt._0_modifier_cannot_be_used_with_1_modifier,"async","abstract")}if(d&16){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"abstract","override")}if(d&512){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"abstract","accessor")}}if(isNamedDeclaration(t)&&t.name.kind===81){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_a_private_identifier,"abstract")}d|=64;break;case 134:if(d&1024){return grammarErrorOnNode(r,wt._0_modifier_already_seen,"async")}else if(d&128||t.parent.flags&33554432){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_in_an_ambient_context,"async")}else if(t.kind===169){return grammarErrorOnNode(r,wt._0_modifier_cannot_appear_on_a_parameter,"async")}if(d&64){return grammarErrorOnNode(r,wt._0_modifier_cannot_be_used_with_1_modifier,"async","abstract")}d|=1024;s=r;break;case 103:case 147:{const e=r.kind===103?8192:16384;const i=r.kind===103?"in":"out";const o=isJSDocTemplateTag(t.parent)&&(getEffectiveJSDocHost(t.parent)||find((n=getJSDocRoot(t.parent))==null?void 0:n.tags,isJSDocTypedefTag))||t.parent;if(t.kind!==168||o&&!(isInterfaceDeclaration(o)||isClassLike(o)||isTypeAliasDeclaration(o)||isJSDocTypedefTag(o))){return grammarErrorOnNode(r,wt._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias,i)}if(d&e){return grammarErrorOnNode(r,wt._0_modifier_already_seen,i)}if(e&8192&&d&16384){return grammarErrorOnNode(r,wt._0_modifier_must_precede_1_modifier,"in","out")}d|=e;break}}}}if(t.kind===176){if(d&256){return grammarErrorOnNode(o,wt._0_modifier_cannot_appear_on_a_constructor_declaration,"static")}if(d&16){return grammarErrorOnNode(c,wt._0_modifier_cannot_appear_on_a_constructor_declaration,"override")}if(d&1024){return grammarErrorOnNode(s,wt._0_modifier_cannot_appear_on_a_constructor_declaration,"async")}return false}else if((t.kind===272||t.kind===271)&&d&128){return grammarErrorOnNode(a,wt.A_0_modifier_cannot_be_used_with_an_import_declaration,"declare")}else if(t.kind===169&&d&31&&isBindingPattern(t.name)){return grammarErrorOnNode(t,wt.A_parameter_property_may_not_be_declared_using_a_binding_pattern)}else if(t.kind===169&&d&31&&t.dotDotDotToken){return grammarErrorOnNode(t,wt.A_parameter_property_cannot_be_declared_using_a_rest_parameter)}if(d&1024){return checkGrammarAsyncModifier(t,s)}return false}function reportObviousModifierErrors(e){if(!e.modifiers)return false;const t=findFirstIllegalModifier(e);return t&&grammarErrorOnFirstToken(t,wt.Modifiers_cannot_appear_here)}function findFirstModifierExcept(e,t){const n=find(e.modifiers,isModifier);return n&&n.kind!==t?n:void 0}function findFirstIllegalModifier(e){switch(e.kind){case 177:case 178:case 176:case 172:case 171:case 174:case 173:case 181:case 267:case 272:case 271:case 278:case 277:case 218:case 219:case 169:case 168:return void 0;case 175:case 303:case 304:case 270:case 282:return find(e.modifiers,isModifier);default:if(e.parent.kind===268||e.parent.kind===307){return void 0}switch(e.kind){case 262:return findFirstModifierExcept(e,134);case 263:case 185:return findFirstModifierExcept(e,128);case 231:case 264:case 265:return find(e.modifiers,isModifier);case 243:return e.declarationList.flags&4?findFirstModifierExcept(e,135):find(e.modifiers,isModifier);case 266:return findFirstModifierExcept(e,87);default:S.assertNever(e)}}}function reportObviousDecoratorErrors(e){const t=findFirstIllegalDecorator(e);return t&&grammarErrorOnFirstToken(t,wt.Decorators_are_not_valid_here)}function findFirstIllegalDecorator(e){return canHaveIllegalDecorators(e)?find(e.modifiers,isDecorator):void 0}function checkGrammarAsyncModifier(e,t){switch(e.kind){case 174:case 262:case 218:case 219:return false}return grammarErrorOnNode(t,wt._0_modifier_cannot_be_used_here,"async")}function checkGrammarForDisallowedTrailingComma(e,t=wt.Trailing_comma_not_allowed){if(e&&e.hasTrailingComma){return grammarErrorAtPos(e[0],e.end-",".length,",".length,t)}return false}function checkGrammarTypeParameterList(e,t){if(e&&e.length===0){const n=e.pos-"<".length;const r=skipTrivia(t.text,e.end)+">".length;return grammarErrorAtPos(t,n,r-n,wt.Type_parameter_list_cannot_be_empty)}return false}function checkGrammarParameterList(e){let t=false;const n=e.length;for(let r=0;r!!e.initializer||isBindingPattern(e.name)||isRestParameter(e)))}function checkGrammarForUseStrictSimpleParameterList(e){if(v>=3){const t=e.body&&isBlock(e.body)&&findUseStrictPrologue(e.body.statements);if(t){const n=getNonSimpleParameters(e.parameters);if(length(n)){forEach(n,(e=>{addRelatedInfo(error2(e,wt.This_parameter_is_not_allowed_with_use_strict_directive),createDiagnosticForNode(t,wt.use_strict_directive_used_here))}));const e=n.map(((e,t)=>t===0?createDiagnosticForNode(e,wt.Non_simple_parameter_declared_here):createDiagnosticForNode(e,wt.and_here)));addRelatedInfo(error2(t,wt.use_strict_directive_cannot_be_used_with_non_simple_parameter_list),...e);return true}}}return false}function checkGrammarFunctionLikeDeclaration(e){const t=getSourceFileOfNode(e);return checkGrammarModifiers(e)||checkGrammarTypeParameterList(e.typeParameters,t)||checkGrammarParameterList(e.parameters)||checkGrammarArrowFunction(e,t)||isFunctionLikeDeclaration(e)&&checkGrammarForUseStrictSimpleParameterList(e)}function checkGrammarClassLikeDeclaration(e){const t=getSourceFileOfNode(e);return checkGrammarClassDeclarationHeritageClauses(e)||checkGrammarTypeParameterList(e.typeParameters,t)}function checkGrammarArrowFunction(e,t){if(!isArrowFunction(e)){return false}if(e.typeParameters&&!(length(e.typeParameters)>1||e.typeParameters.hasTrailingComma||e.typeParameters[0].constraint)){if(t&&fileExtensionIsOneOf(t.fileName,[".mts",".cts"])){grammarErrorOnNode(e.typeParameters[0],wt.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint)}}const{equalsGreaterThanToken:n}=e;const r=getLineAndCharacterOfPosition(t,n.pos).line;const i=getLineAndCharacterOfPosition(t,n.end).line;return r!==i&&grammarErrorOnNode(n,wt.Line_terminator_not_permitted_before_arrow)}function checkGrammarIndexSignatureParameters(e){const t=e.parameters[0];if(e.parameters.length!==1){if(t){return grammarErrorOnNode(t.name,wt.An_index_signature_must_have_exactly_one_parameter)}else{return grammarErrorOnNode(e,wt.An_index_signature_must_have_exactly_one_parameter)}}checkGrammarForDisallowedTrailingComma(e.parameters,wt.An_index_signature_cannot_have_a_trailing_comma);if(t.dotDotDotToken){return grammarErrorOnNode(t.dotDotDotToken,wt.An_index_signature_cannot_have_a_rest_parameter)}if(hasEffectiveModifiers(t)){return grammarErrorOnNode(t.name,wt.An_index_signature_parameter_cannot_have_an_accessibility_modifier)}if(t.questionToken){return grammarErrorOnNode(t.questionToken,wt.An_index_signature_parameter_cannot_have_a_question_mark)}if(t.initializer){return grammarErrorOnNode(t.name,wt.An_index_signature_parameter_cannot_have_an_initializer)}if(!t.type){return grammarErrorOnNode(t.name,wt.An_index_signature_parameter_must_have_a_type_annotation)}const n=getTypeFromTypeNode(t.type);if(someType(n,(e=>!!(e.flags&8576)))||isGenericType(n)){return grammarErrorOnNode(t.name,wt.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead)}if(!everyType(n,isValidIndexKeyType)){return grammarErrorOnNode(t.name,wt.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type)}if(!e.type){return grammarErrorOnNode(e,wt.An_index_signature_must_have_a_type_annotation)}return false}function checkGrammarIndexSignature(e){return checkGrammarModifiers(e)||checkGrammarIndexSignatureParameters(e)}function checkGrammarForAtLeastOneTypeArgument(e,t){if(t&&t.length===0){const n=getSourceFileOfNode(e);const r=t.pos-"<".length;const i=skipTrivia(n.text,t.end)+">".length;return grammarErrorAtPos(n,r,i-r,wt.Type_argument_list_cannot_be_empty)}return false}function checkGrammarTypeArguments(e,t){return checkGrammarForDisallowedTrailingComma(t)||checkGrammarForAtLeastOneTypeArgument(e,t)}function checkGrammarTaggedTemplateChain(e){if(e.questionDotToken||e.flags&64){return grammarErrorOnNode(e.template,wt.Tagged_template_expressions_are_not_permitted_in_an_optional_chain)}return false}function checkGrammarHeritageClause(e){const t=e.types;if(checkGrammarForDisallowedTrailingComma(t)){return true}if(t&&t.length===0){const n=tokenToString(e.token);return grammarErrorAtPos(e,t.pos,0,wt._0_list_cannot_be_empty,n)}return some(t,checkGrammarExpressionWithTypeArguments)}function checkGrammarExpressionWithTypeArguments(e){if(isExpressionWithTypeArguments(e)&&isImportKeyword(e.expression)&&e.typeArguments){return grammarErrorOnNode(e,wt.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments)}return checkGrammarTypeArguments(e,e.typeArguments)}function checkGrammarClassDeclarationHeritageClauses(e){let t=false;let n=false;if(!checkGrammarModifiers(e)&&e.heritageClauses){for(const r of e.heritageClauses){if(r.token===96){if(t){return grammarErrorOnFirstToken(r,wt.extends_clause_already_seen)}if(n){return grammarErrorOnFirstToken(r,wt.extends_clause_must_precede_implements_clause)}if(r.types.length>1){return grammarErrorOnFirstToken(r.types[1],wt.Classes_can_only_extend_a_single_class)}t=true}else{S.assert(r.token===119);if(n){return grammarErrorOnFirstToken(r,wt.implements_clause_already_seen)}n=true}checkGrammarHeritageClause(r)}}}function checkGrammarInterfaceDeclaration(e){let t=false;if(e.heritageClauses){for(const n of e.heritageClauses){if(n.token===96){if(t){return grammarErrorOnFirstToken(n,wt.extends_clause_already_seen)}t=true}else{S.assert(n.token===119);return grammarErrorOnFirstToken(n,wt.Interface_declaration_cannot_have_implements_clause)}checkGrammarHeritageClause(n)}}return false}function checkGrammarComputedPropertyName(e){if(e.kind!==167){return false}const t=e;if(t.expression.kind===226&&t.expression.operatorToken.kind===28){return grammarErrorOnNode(t.expression,wt.A_comma_expression_is_not_allowed_in_a_computed_property_name)}return false}function checkGrammarForGenerator(e){if(e.asteriskToken){S.assert(e.kind===262||e.kind===218||e.kind===174);if(e.flags&33554432){return grammarErrorOnNode(e.asteriskToken,wt.Generators_are_not_allowed_in_an_ambient_context)}if(!e.body){return grammarErrorOnNode(e.asteriskToken,wt.An_overload_signature_cannot_be_declared_as_a_generator)}}}function checkGrammarForInvalidQuestionMark(e,t){return!!e&&grammarErrorOnNode(e,t)}function checkGrammarForInvalidExclamationToken(e,t){return!!e&&grammarErrorOnNode(e,t)}function checkGrammarObjectLiteralExpression(e,t){const n=new Map;for(const r of e.properties){if(r.kind===305){if(t){const e=skipParentheses(r.expression);if(isArrayLiteralExpression(e)||isObjectLiteralExpression(e)){return grammarErrorOnNode(r.expression,wt.A_rest_element_cannot_contain_a_binding_pattern)}}continue}const e=r.name;if(e.kind===167){checkGrammarComputedPropertyName(e)}if(r.kind===304&&!t&&r.objectAssignmentInitializer){grammarErrorOnNode(r.equalsToken,wt.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern)}if(e.kind===81){grammarErrorOnNode(e,wt.Private_identifiers_are_not_allowed_outside_class_bodies)}if(canHaveModifiers(r)&&r.modifiers){for(const e of r.modifiers){if(isModifier(e)&&(e.kind!==134||r.kind!==174)){grammarErrorOnNode(e,wt._0_modifier_cannot_be_used_here,getTextOfNode(e))}}}else if(canHaveIllegalModifiers(r)&&r.modifiers){for(const e of r.modifiers){if(isModifier(e)){grammarErrorOnNode(e,wt._0_modifier_cannot_be_used_here,getTextOfNode(e))}}}let i;switch(r.kind){case 304:case 303:checkGrammarForInvalidExclamationToken(r.exclamationToken,wt.A_definite_assignment_assertion_is_not_permitted_in_this_context);checkGrammarForInvalidQuestionMark(r.questionToken,wt.An_object_member_cannot_be_declared_optional);if(e.kind===9){checkGrammarNumericLiteral(e)}if(e.kind===10){addErrorOrSuggestion(true,createDiagnosticForNode(e,wt.A_bigint_literal_cannot_be_used_as_a_property_name))}i=4;break;case 174:i=8;break;case 177:i=1;break;case 178:i=2;break;default:S.assertNever(r,"Unexpected syntax kind:"+r.kind)}if(!t){const t=getEffectivePropertyNameForPropertyNameNode(e);if(t===void 0){continue}const r=n.get(t);if(!r){n.set(t,i)}else{if(i&8&&r&8){grammarErrorOnNode(e,wt.Duplicate_identifier_0,getTextOfNode(e))}else if(i&4&&r&4){grammarErrorOnNode(e,wt.An_object_literal_cannot_have_multiple_properties_with_the_same_name,getTextOfNode(e))}else if(i&3&&r&3){if(r!==3&&i!==r){n.set(t,i|r)}else{return grammarErrorOnNode(e,wt.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name)}}else{return grammarErrorOnNode(e,wt.An_object_literal_cannot_have_property_and_accessor_with_the_same_name)}}}}}function checkGrammarJsxElement(e){checkGrammarJsxName(e.tagName);checkGrammarTypeArguments(e,e.typeArguments);const t=new Map;for(const n of e.attributes.properties){if(n.kind===293){continue}const{name:e,initializer:r}=n;const i=getEscapedTextOfJsxAttributeName(e);if(!t.get(i)){t.set(i,true)}else{return grammarErrorOnNode(e,wt.JSX_elements_cannot_have_multiple_attributes_with_the_same_name)}if(r&&r.kind===294&&!r.expression){return grammarErrorOnNode(r,wt.JSX_attributes_must_only_be_assigned_a_non_empty_expression)}}}function checkGrammarJsxName(e){if(isPropertyAccessExpression(e)&&isJsxNamespacedName(e.expression)){return grammarErrorOnNode(e.expression,wt.JSX_property_access_expressions_cannot_include_JSX_namespace_names)}if(isJsxNamespacedName(e)&&getJSXTransformEnabled(T)&&!isIntrinsicJsxName(e.namespace.escapedText)){return grammarErrorOnNode(e,wt.React_components_cannot_include_JSX_namespace_names)}}function checkGrammarJsxExpression(e){if(e.expression&&isCommaSequence(e.expression)){return grammarErrorOnNode(e.expression,wt.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array)}}function checkGrammarForInOrForOfStatement(e){if(checkGrammarStatementInAmbientContext(e)){return true}if(e.kind===250&&e.awaitModifier){if(!(e.flags&65536)){const t=getSourceFileOfNode(e);if(isInTopLevelContext(e)){if(!hasParseDiagnostics(t)){if(!isEffectiveExternalModule(t,T)){gi.add(createDiagnosticForNode(e.awaitModifier,wt.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module))}switch(x){case 100:case 101:case 199:if(t.impliedNodeFormat===1){gi.add(createDiagnosticForNode(e.awaitModifier,wt.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));break}case 7:case 99:case 200:case 4:if(v>=4){break}default:gi.add(createDiagnosticForNode(e.awaitModifier,wt.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher));break}}}else{if(!hasParseDiagnostics(t)){const t=createDiagnosticForNode(e.awaitModifier,wt.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);const n=getContainingFunction(e);if(n&&n.kind!==176){S.assert((getFunctionFlags(n)&2)===0,"Enclosing function should never be an async function.");const e=createDiagnosticForNode(n,wt.Did_you_mean_to_mark_this_function_as_async);addRelatedInfo(t,e)}gi.add(t);return true}}}}if(isForOfStatement(e)&&!(e.flags&65536)&&isIdentifier(e.initializer)&&e.initializer.escapedText==="async"){grammarErrorOnNode(e.initializer,wt.The_left_hand_side_of_a_for_of_statement_may_not_be_async);return false}if(e.initializer.kind===261){const t=e.initializer;if(!checkGrammarVariableDeclarationList(t)){const n=t.declarations;if(!n.length){return false}if(n.length>1){const n=e.kind===249?wt.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:wt.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;return grammarErrorOnFirstToken(t.declarations[1],n)}const r=n[0];if(r.initializer){const t=e.kind===249?wt.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:wt.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;return grammarErrorOnNode(r.name,t)}if(r.type){const t=e.kind===249?wt.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:wt.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;return grammarErrorOnNode(r,t)}}}return false}function checkGrammarAccessor(e){if(!(e.flags&33554432)&&e.parent.kind!==187&&e.parent.kind!==264){if(v<2&&isPrivateIdentifier(e.name)){return grammarErrorOnNode(e.name,wt.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher)}if(e.body===void 0&&!hasSyntacticModifier(e,64)){return grammarErrorAtPos(e,e.end-1,";".length,wt._0_expected,"{")}}if(e.body){if(hasSyntacticModifier(e,64)){return grammarErrorOnNode(e,wt.An_abstract_accessor_cannot_have_an_implementation)}if(e.parent.kind===187||e.parent.kind===264){return grammarErrorOnNode(e.body,wt.An_implementation_cannot_be_declared_in_ambient_contexts)}}if(e.typeParameters){return grammarErrorOnNode(e.name,wt.An_accessor_cannot_have_type_parameters)}if(!doesAccessorHaveCorrectParameterCount(e)){return grammarErrorOnNode(e.name,e.kind===177?wt.A_get_accessor_cannot_have_parameters:wt.A_set_accessor_must_have_exactly_one_parameter)}if(e.kind===178){if(e.type){return grammarErrorOnNode(e.name,wt.A_set_accessor_cannot_have_a_return_type_annotation)}const t=S.checkDefined(getSetAccessorValueParameter(e),"Return value does not match parameter count assertion.");if(t.dotDotDotToken){return grammarErrorOnNode(t.dotDotDotToken,wt.A_set_accessor_cannot_have_rest_parameter)}if(t.questionToken){return grammarErrorOnNode(t.questionToken,wt.A_set_accessor_cannot_have_an_optional_parameter)}if(t.initializer){return grammarErrorOnNode(e.name,wt.A_set_accessor_parameter_cannot_have_an_initializer)}}return false}function doesAccessorHaveCorrectParameterCount(e){return getAccessorThisParameter(e)||e.parameters.length===(e.kind===177?0:1)}function getAccessorThisParameter(e){if(e.parameters.length===(e.kind===177?1:2)){return getThisParameter(e)}}function checkGrammarTypeOperatorNode(e){if(e.operator===158){if(e.type.kind!==155){return grammarErrorOnNode(e.type,wt._0_expected,tokenToString(155))}let t=walkUpParenthesizedTypes(e.parent);if(isInJSFile(t)&&isJSDocTypeExpression(t)){const e=getJSDocHost(t);if(e){t=getSingleVariableOfVariableStatement(e)||e}}switch(t.kind){case 260:const n=t;if(n.name.kind!==80){return grammarErrorOnNode(e,wt.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name)}if(!isVariableDeclarationInVariableStatement(n)){return grammarErrorOnNode(e,wt.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement)}if(!(n.parent.flags&2)){return grammarErrorOnNode(t.name,wt.A_variable_whose_type_is_a_unique_symbol_type_must_be_const)}break;case 172:if(!isStatic(t)||!hasEffectiveReadonlyModifier(t)){return grammarErrorOnNode(t.name,wt.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly)}break;case 171:if(!hasSyntacticModifier(t,8)){return grammarErrorOnNode(t.name,wt.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly)}break;default:return grammarErrorOnNode(e,wt.unique_symbol_types_are_not_allowed_here)}}else if(e.operator===148){if(e.type.kind!==188&&e.type.kind!==189){return grammarErrorOnFirstToken(e,wt.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types,tokenToString(155))}}}function checkGrammarForInvalidDynamicName(e,t){if(isNonBindableDynamicName(e)&&!isEntityNameExpression(isElementAccessExpression(e)?skipParentheses(e.argumentExpression):e.expression)){return grammarErrorOnNode(e,t)}}function checkGrammarMethod(e){if(checkGrammarFunctionLikeDeclaration(e)){return true}if(e.kind===174){if(e.parent.kind===210){if(e.modifiers&&!(e.modifiers.length===1&&first(e.modifiers).kind===134)){return grammarErrorOnFirstToken(e,wt.Modifiers_cannot_appear_here)}else if(checkGrammarForInvalidQuestionMark(e.questionToken,wt.An_object_member_cannot_be_declared_optional)){return true}else if(checkGrammarForInvalidExclamationToken(e.exclamationToken,wt.A_definite_assignment_assertion_is_not_permitted_in_this_context)){return true}else if(e.body===void 0){return grammarErrorAtPos(e,e.end-1,";".length,wt._0_expected,"{")}}if(checkGrammarForGenerator(e)){return true}}if(isClassLike(e.parent)){if(v<2&&isPrivateIdentifier(e.name)){return grammarErrorOnNode(e.name,wt.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher)}if(e.flags&33554432){return checkGrammarForInvalidDynamicName(e.name,wt.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}else if(e.kind===174&&!e.body){return checkGrammarForInvalidDynamicName(e.name,wt.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}}else if(e.parent.kind===264){return checkGrammarForInvalidDynamicName(e.name,wt.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}else if(e.parent.kind===187){return checkGrammarForInvalidDynamicName(e.name,wt.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}}function checkGrammarBreakOrContinueStatement(e){let t=e;while(t){if(isFunctionLikeOrClassStaticBlockDeclaration(t)){return grammarErrorOnNode(e,wt.Jump_target_cannot_cross_function_boundary)}switch(t.kind){case 256:if(e.label&&t.label.escapedText===e.label.escapedText){const n=e.kind===251&&!isIterationStatement(t.statement,true);if(n){return grammarErrorOnNode(e,wt.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement)}return false}break;case 255:if(e.kind===252&&!e.label){return false}break;default:if(isIterationStatement(t,false)&&!e.label){return false}break}t=t.parent}if(e.label){const t=e.kind===252?wt.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:wt.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;return grammarErrorOnNode(e,t)}else{const t=e.kind===252?wt.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:wt.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;return grammarErrorOnNode(e,t)}}function checkGrammarBindingElement(e){if(e.dotDotDotToken){const t=e.parent.elements;if(e!==last(t)){return grammarErrorOnNode(e,wt.A_rest_element_must_be_last_in_a_destructuring_pattern)}checkGrammarForDisallowedTrailingComma(t,wt.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);if(e.propertyName){return grammarErrorOnNode(e.name,wt.A_rest_element_cannot_have_a_property_name)}}if(e.dotDotDotToken&&e.initializer){return grammarErrorAtPos(e,e.initializer.pos-1,1,wt.A_rest_element_cannot_have_an_initializer)}}function isStringOrNumberLiteralExpression(e){return isStringOrNumericLiteralLike(e)||e.kind===224&&e.operator===41&&e.operand.kind===9}function isBigIntLiteralExpression(e){return e.kind===10||e.kind===224&&e.operator===41&&e.operand.kind===10}function isSimpleLiteralEnumReference(e){if((isPropertyAccessExpression(e)||isElementAccessExpression(e)&&isStringOrNumberLiteralExpression(e.argumentExpression))&&isEntityNameExpression(e.expression)){return!!(checkExpressionCached(e).flags&1056)}}function checkAmbientInitializer(e){const t=e.initializer;if(t){const n=!(isStringOrNumberLiteralExpression(t)||isSimpleLiteralEnumReference(t)||t.kind===112||t.kind===97||isBigIntLiteralExpression(t));const r=isDeclarationReadonly(e)||isVariableDeclaration(e)&&isVarConstLike2(e);if(r&&!e.type){if(n){return grammarErrorOnNode(t,wt.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference)}}else{return grammarErrorOnNode(t,wt.Initializers_are_not_allowed_in_ambient_contexts)}}}function checkGrammarVariableDeclaration(t){const n=getCombinedNodeFlagsCached(t);const r=n&7;if(isBindingPattern(t.name)){switch(r){case 6:return grammarErrorOnNode(t,wt._0_declarations_may_not_have_binding_patterns,"await using");case 4:return grammarErrorOnNode(t,wt._0_declarations_may_not_have_binding_patterns,"using")}}if(t.parent.parent.kind!==249&&t.parent.parent.kind!==250){if(n&33554432){checkAmbientInitializer(t)}else if(!t.initializer){if(isBindingPattern(t.name)&&!isBindingPattern(t.parent)){return grammarErrorOnNode(t,wt.A_destructuring_declaration_must_have_an_initializer)}switch(r){case 6:return grammarErrorOnNode(t,wt._0_declarations_must_be_initialized,"await using");case 4:return grammarErrorOnNode(t,wt._0_declarations_must_be_initialized,"using");case 2:return grammarErrorOnNode(t,wt._0_declarations_must_be_initialized,"const")}}}if(t.exclamationToken&&(t.parent.parent.kind!==243||!t.type||t.initializer||n&33554432)){const e=t.initializer?wt.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:!t.type?wt.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:wt.A_definite_assignment_assertion_is_not_permitted_in_this_context;return grammarErrorOnNode(t.exclamationToken,e)}if(e.getEmitModuleFormatOfFile(getSourceFileOfNode(t))<4&&!(t.parent.parent.flags&33554432)&&hasSyntacticModifier(t.parent.parent,32)){checkESModuleMarker(t.name)}return!!r&&checkGrammarNameInLetOrConstDeclarations(t.name)}function checkESModuleMarker(e){if(e.kind===80){if(idText(e)==="__esModule"){return grammarErrorOnNodeSkippedOn("noEmit",e,wt.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules)}}else{const t=e.elements;for(const e of t){if(!isOmittedExpression(e)){return checkESModuleMarker(e.name)}}}return false}function checkGrammarNameInLetOrConstDeclarations(e){if(e.kind===80){if(e.escapedText==="let"){return grammarErrorOnNode(e,wt.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations)}}else{const t=e.elements;for(const e of t){if(!isOmittedExpression(e)){checkGrammarNameInLetOrConstDeclarations(e.name)}}}return false}function checkGrammarVariableDeclarationList(e){const t=e.declarations;if(checkGrammarForDisallowedTrailingComma(e.declarations)){return true}if(!e.declarations.length){return grammarErrorAtPos(e,t.pos,t.end-t.pos,wt.Variable_declaration_list_cannot_be_empty)}const n=e.flags&7;if((n===4||n===6)&&isForInStatement(e.parent)){return grammarErrorOnNode(e,n===4?wt.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration:wt.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration)}if(n===6){return checkAwaitGrammar(e)}return false}function allowBlockDeclarations(e){switch(e.kind){case 245:case 246:case 247:case 254:case 248:case 249:case 250:return false;case 256:return allowBlockDeclarations(e.parent)}return true}function checkGrammarForDisallowedBlockScopedVariableStatement(e){if(!allowBlockDeclarations(e.parent)){const t=getCombinedNodeFlagsCached(e.declarationList)&7;if(t){const n=t===1?"let":t===2?"const":t===4?"using":t===6?"await using":S.fail("Unknown BlockScope flag");return grammarErrorOnNode(e,wt._0_declarations_can_only_be_declared_inside_a_block,n)}}}function checkGrammarMetaProperty(e){const t=e.name.escapedText;switch(e.keywordToken){case 105:if(t!=="target"){return grammarErrorOnNode(e.name,wt._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,unescapeLeadingUnderscores(e.name.escapedText),tokenToString(e.keywordToken),"target")}break;case 102:if(t!=="meta"){return grammarErrorOnNode(e.name,wt._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,unescapeLeadingUnderscores(e.name.escapedText),tokenToString(e.keywordToken),"meta")}break}}function hasParseDiagnostics(e){return e.parseDiagnostics.length>0}function grammarErrorOnFirstToken(e,t,...n){const r=getSourceFileOfNode(e);if(!hasParseDiagnostics(r)){const i=getSpanOfTokenAtPosition(r,e.pos);gi.add(createFileDiagnostic(r,i.start,i.length,t,...n));return true}return false}function grammarErrorAtPos(e,t,n,r,...i){const o=getSourceFileOfNode(e);if(!hasParseDiagnostics(o)){gi.add(createFileDiagnostic(o,t,n,r,...i));return true}return false}function grammarErrorOnNodeSkippedOn(e,t,n,...r){const i=getSourceFileOfNode(t);if(!hasParseDiagnostics(i)){errorSkippedOn(e,t,n,...r);return true}return false}function grammarErrorOnNode(e,t,...n){const r=getSourceFileOfNode(e);if(!hasParseDiagnostics(r)){gi.add(createDiagnosticForNode(e,t,...n));return true}return false}function checkGrammarConstructorTypeParameters(e){const t=isInJSFile(e)?getJSDocTypeParameterDeclarations(e):void 0;const n=e.typeParameters||t&&firstOrUndefined(t);if(n){const t=n.pos===n.end?n.pos:skipTrivia(getSourceFileOfNode(e).text,n.pos);return grammarErrorAtPos(e,t,n.end-t,wt.Type_parameters_cannot_appear_on_a_constructor_declaration)}}function checkGrammarConstructorTypeAnnotation(e){const t=e.type||getEffectiveReturnTypeNode(e);if(t){return grammarErrorOnNode(t,wt.Type_annotation_cannot_appear_on_a_constructor_declaration)}}function checkGrammarProperty(e){if(isComputedPropertyName(e.name)&&isBinaryExpression(e.name.expression)&&e.name.expression.operatorToken.kind===103){return grammarErrorOnNode(e.parent.members[0],wt.A_mapped_type_may_not_declare_properties_or_methods)}if(isClassLike(e.parent)){if(isStringLiteral(e.name)&&e.name.text==="constructor"){return grammarErrorOnNode(e.name,wt.Classes_may_not_have_a_field_named_constructor)}if(checkGrammarForInvalidDynamicName(e.name,wt.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type)){return true}if(v<2&&isPrivateIdentifier(e.name)){return grammarErrorOnNode(e.name,wt.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher)}if(v<2&&isAutoAccessorPropertyDeclaration(e)){return grammarErrorOnNode(e.name,wt.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher)}if(isAutoAccessorPropertyDeclaration(e)&&checkGrammarForInvalidQuestionMark(e.questionToken,wt.An_accessor_property_cannot_be_declared_optional)){return true}}else if(e.parent.kind===264){if(checkGrammarForInvalidDynamicName(e.name,wt.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)){return true}S.assertNode(e,isPropertySignature);if(e.initializer){return grammarErrorOnNode(e.initializer,wt.An_interface_property_cannot_have_an_initializer)}}else if(isTypeLiteralNode(e.parent)){if(checkGrammarForInvalidDynamicName(e.name,wt.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)){return true}S.assertNode(e,isPropertySignature);if(e.initializer){return grammarErrorOnNode(e.initializer,wt.A_type_literal_property_cannot_have_an_initializer)}}if(e.flags&33554432){checkAmbientInitializer(e)}if(isPropertyDeclaration(e)&&e.exclamationToken&&(!isClassLike(e.parent)||!e.type||e.initializer||e.flags&33554432||isStatic(e)||hasAbstractModifier(e))){const t=e.initializer?wt.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:!e.type?wt.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:wt.A_definite_assignment_assertion_is_not_permitted_in_this_context;return grammarErrorOnNode(e.exclamationToken,t)}}function checkGrammarTopLevelElementForRequiredDeclareModifier(e){if(e.kind===264||e.kind===265||e.kind===272||e.kind===271||e.kind===278||e.kind===277||e.kind===270||hasSyntacticModifier(e,128|32|2048)){return false}return grammarErrorOnFirstToken(e,wt.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier)}function checkGrammarTopLevelElementsForRequiredDeclareModifier(e){for(const t of e.statements){if(isDeclaration(t)||t.kind===243){if(checkGrammarTopLevelElementForRequiredDeclareModifier(t)){return true}}}return false}function checkGrammarSourceFile(e){return!!(e.flags&33554432)&&checkGrammarTopLevelElementsForRequiredDeclareModifier(e)}function checkGrammarStatementInAmbientContext(e){if(e.flags&33554432){const t=getNodeLinks(e);if(!t.hasReportedStatementInAmbientContext&&(isFunctionLike(e.parent)||isAccessor(e.parent))){return getNodeLinks(e).hasReportedStatementInAmbientContext=grammarErrorOnFirstToken(e,wt.An_implementation_cannot_be_declared_in_ambient_contexts)}if(e.parent.kind===241||e.parent.kind===268||e.parent.kind===307){const t=getNodeLinks(e.parent);if(!t.hasReportedStatementInAmbientContext){return t.hasReportedStatementInAmbientContext=grammarErrorOnFirstToken(e,wt.Statements_are_not_allowed_in_ambient_contexts)}}else{}}return false}function checkGrammarNumericLiteral(e){const t=getTextOfNode(e).includes(".");const n=e.numericLiteralFlags&16;if(t||n){return}const r=+e.text;if(r<=2**53-1){return}addErrorOrSuggestion(false,createDiagnosticForNode(e,wt.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers))}function checkGrammarBigIntLiteral(e){const t=isLiteralTypeNode(e.parent)||isPrefixUnaryExpression(e.parent)&&isLiteralTypeNode(e.parent.parent);if(!t){if(v<7){if(grammarErrorOnNode(e,wt.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020)){return true}}}return false}function grammarErrorAfterFirstToken(e,t,...n){const r=getSourceFileOfNode(e);if(!hasParseDiagnostics(r)){const i=getSpanOfTokenAtPosition(r,e.pos);gi.add(createFileDiagnostic(r,textSpanEnd(i),0,t,...n));return true}return false}function getAmbientModules(){if(!Xt){Xt=[];U.forEach(((e,t)=>{if(Qo.test(t)){Xt.push(e)}}))}return Xt}function checkGrammarImportClause(e){var t;if(e.isTypeOnly&&e.name&&e.namedBindings){return grammarErrorOnNode(e,wt.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both)}if(e.isTypeOnly&&((t=e.namedBindings)==null?void 0:t.kind)===275){return checkGrammarNamedImportsOrExports(e.namedBindings)}return false}function checkGrammarNamedImportsOrExports(e){return!!forEach(e.elements,(e=>{if(e.isTypeOnly){return grammarErrorOnFirstToken(e,e.kind===276?wt.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:wt.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement)}}))}function checkGrammarImportCallExpression(e){if(T.verbatimModuleSyntax&&x===1){return grammarErrorOnNode(e,wt.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled)}if(x===5){return grammarErrorOnNode(e,wt.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext)}if(e.typeArguments){return grammarErrorOnNode(e,wt.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments)}const t=e.arguments;if(!(100<=x&&x<=199)&&x!==99&&x!==200){checkGrammarForDisallowedTrailingComma(t);if(t.length>1){const e=t[1];return grammarErrorOnNode(e,wt.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve)}}if(t.length===0||t.length>2){return grammarErrorOnNode(e,wt.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments)}const n=find(t,isSpreadElement);if(n){return grammarErrorOnNode(n,wt.Argument_of_dynamic_import_cannot_be_spread_element)}return false}function findMatchingTypeReferenceOrTypeAliasReference(e,t){const n=getObjectFlags(e);if(n&(4|16)&&t.flags&1048576){return find(t.types,(t=>{if(t.flags&524288){const r=n&getObjectFlags(t);if(r&4){return e.target===t.target}if(r&16){return!!e.aliasSymbol&&e.aliasSymbol===t.aliasSymbol}}return false}))}}function findBestTypeForObjectLiteral(e,t){if(getObjectFlags(e)&128&&someType(t,isArrayLikeType)){return find(t.types,(e=>!isArrayLikeType(e)))}}function findBestTypeForInvokable(e,t){let n=0;const r=getSignaturesOfType(e,n).length>0||(n=1,getSignaturesOfType(e,n).length>0);if(r){return find(t.types,(e=>getSignaturesOfType(e,n).length>0))}}function findMostOverlappyType(e,t){let n;if(!(e.flags&(402784252|406847488))){let r=0;for(const i of t.types){if(!(i.flags&(402784252|406847488))){const t=getIntersectionType([getIndexType(e),getIndexType(i)]);if(t.flags&4194304){return i}else if(isUnitType(t)||t.flags&1048576){const e=t.flags&1048576?countWhere(t.types,isUnitType):1;if(e>=r){n=i;r=e}}}}}return n}function filterPrimitivesIfContainsNonPrimitive(e){if(maybeTypeOfKind(e,67108864)){const t=filterType(e,(e=>!(e.flags&402784252)));if(!(t.flags&131072)){return t}}return e}function findMatchingDiscriminantType(e,t,n){if(t.flags&1048576&&e.flags&(2097152|524288)){const r=getMatchingUnionConstituentForType(t,e);if(r){return r}const i=getPropertiesOfType(e);if(i){const e=findDiscriminantProperties(i,t);if(e){const r=discriminateTypeByDiscriminableItems(t,map(e,(e=>[()=>getTypeOfSymbol(e),e.escapedName])),n);if(r!==t){return r}}}}return void 0}function getEffectivePropertyNameForPropertyNameNode(e){const t=getPropertyNameForPropertyNameNode(e);return t?t:isComputedPropertyName(e)?tryGetNameFromType(getTypeOfExpression(e.expression)):void 0}function getCombinedModifierFlagsCached(e){if(Z===e){return ee}Z=e;ee=getCombinedModifierFlags(e);return ee}function getCombinedNodeFlagsCached(e){if(X===e){return Y}X=e;Y=getCombinedNodeFlags(e);return Y}function isVarConstLike2(e){const t=getCombinedNodeFlagsCached(e)&7;return t===2||t===4||t===6}function getJSXRuntimeImportSpecifier(e,t){const n=T.importHelpers?1:0;const r=e==null?void 0:e.imports[n];if(r){S.assert(nodeIsSynthesized(r)&&r.text===t,`Expected sourceFile.imports[${n}] to be the synthesized JSX runtime import`)}return r}function getImportHelpersImportSpecifier(e){S.assert(T.importHelpers,"Expected importHelpers to be enabled");const t=e.imports[0];S.assert(t&&nodeIsSynthesized(t)&&t.text==="tslib",`Expected sourceFile.imports[0] to be the synthesized tslib import`);return t}}function isNotAccessor(e){return!isAccessor(e)}function isNotOverload(e){return e.kind!==262&&e.kind!==174||!!e.body}function isDeclarationNameOrImportPropertyName(e){switch(e.parent.kind){case 276:case 281:return isIdentifier(e)||e.kind===11;default:return isDeclarationName(e)}}var la;(e=>{e.JSX="JSX";e.IntrinsicElements="IntrinsicElements";e.ElementClass="ElementClass";e.ElementAttributesPropertyNameContainer="ElementAttributesProperty";e.ElementChildrenAttributeNameContainer="ElementChildrenAttribute";e.Element="Element";e.ElementType="ElementType";e.IntrinsicAttributes="IntrinsicAttributes";e.IntrinsicClassAttributes="IntrinsicClassAttributes";e.LibraryManagedAttributes="LibraryManagedAttributes"})(la||(la={}));var da;(e=>{e.Fragment="Fragment"})(da||(da={}));function getIterationTypesKeyFromIterationTypeKind(e){switch(e){case 0:return"yieldType";case 1:return"returnType";case 2:return"nextType"}}function signatureHasRestParameter(e){return!!(e.flags&1)}function signatureHasLiteralTypes(e){return!!(e.flags&2)}function createBasicNodeBuilderModuleSpecifierResolutionHost(e){return{getCommonSourceDirectory:!!e.getCommonSourceDirectory?()=>e.getCommonSourceDirectory():()=>"",getCurrentDirectory:()=>e.getCurrentDirectory(),getSymlinkCache:maybeBind(e,e.getSymlinkCache),getPackageJsonInfoCache:()=>{var t;return(t=e.getPackageJsonInfoCache)==null?void 0:t.call(e)},useCaseSensitiveFileNames:()=>e.useCaseSensitiveFileNames(),redirectTargetsMap:e.redirectTargetsMap,getProjectReferenceRedirect:t=>e.getProjectReferenceRedirect(t),isSourceOfProjectReferenceRedirect:t=>e.isSourceOfProjectReferenceRedirect(t),fileExists:t=>e.fileExists(t),getFileIncludeReasons:()=>e.getFileIncludeReasons(),readFile:e.readFile?t=>e.readFile(t):void 0,getDefaultResolutionModeForFile:t=>e.getDefaultResolutionModeForFile(t),getModeForResolutionAtIndex:(t,n)=>e.getModeForResolutionAtIndex(t,n),getGlobalTypingsCacheLocation:maybeBind(e,e.getGlobalTypingsCacheLocation)}}var pa=class _SymbolTrackerImpl{constructor(e,t,n){this.moduleResolverHost=void 0;this.inner=void 0;this.disableTrackSymbol=false;var r;while(t instanceof _SymbolTrackerImpl){t=t.inner}this.inner=t;this.moduleResolverHost=n;this.context=e;this.canTrackSymbol=!!((r=this.inner)==null?void 0:r.trackSymbol)}trackSymbol(e,t,n){var r,i;if(((r=this.inner)==null?void 0:r.trackSymbol)&&!this.disableTrackSymbol){if(this.inner.trackSymbol(e,t,n)){this.onDiagnosticReported();return true}if(!(e.flags&262144))((i=this.context).trackedSymbols??(i.trackedSymbols=[])).push([e,t,n])}return false}reportInaccessibleThisError(){var e;if((e=this.inner)==null?void 0:e.reportInaccessibleThisError){this.onDiagnosticReported();this.inner.reportInaccessibleThisError()}}reportPrivateInBaseOfClassExpression(e){var t;if((t=this.inner)==null?void 0:t.reportPrivateInBaseOfClassExpression){this.onDiagnosticReported();this.inner.reportPrivateInBaseOfClassExpression(e)}}reportInaccessibleUniqueSymbolError(){var e;if((e=this.inner)==null?void 0:e.reportInaccessibleUniqueSymbolError){this.onDiagnosticReported();this.inner.reportInaccessibleUniqueSymbolError()}}reportCyclicStructureError(){var e;if((e=this.inner)==null?void 0:e.reportCyclicStructureError){this.onDiagnosticReported();this.inner.reportCyclicStructureError()}}reportLikelyUnsafeImportRequiredError(e){var t;if((t=this.inner)==null?void 0:t.reportLikelyUnsafeImportRequiredError){this.onDiagnosticReported();this.inner.reportLikelyUnsafeImportRequiredError(e)}}reportTruncationError(){var e;if((e=this.inner)==null?void 0:e.reportTruncationError){this.onDiagnosticReported();this.inner.reportTruncationError()}}reportNonlocalAugmentation(e,t,n){var r;if((r=this.inner)==null?void 0:r.reportNonlocalAugmentation){this.onDiagnosticReported();this.inner.reportNonlocalAugmentation(e,t,n)}}reportNonSerializableProperty(e){var t;if((t=this.inner)==null?void 0:t.reportNonSerializableProperty){this.onDiagnosticReported();this.inner.reportNonSerializableProperty(e)}}onDiagnosticReported(){this.context.reportedDiagnostic=true}reportInferenceFallback(e){var t;if(((t=this.inner)==null?void 0:t.reportInferenceFallback)&&!this.context.suppressReportInferenceFallback){this.onDiagnosticReported();this.inner.reportInferenceFallback(e)}}pushErrorFallbackNode(e){var t,n;return(n=(t=this.inner)==null?void 0:t.pushErrorFallbackNode)==null?void 0:n.call(t,e)}popErrorFallbackNode(){var e,t;return(t=(e=this.inner)==null?void 0:e.popErrorFallbackNode)==null?void 0:t.call(e)}};function visitNode(e,t,n,r){if(e===void 0){return e}const i=t(e);let o;if(i===void 0){return void 0}else if(isArray(i)){o=(r||extractSingleNode)(i)}else{o=i}S.assertNode(o,n);return o}function visitNodes2(e,t,n,r,i){if(e===void 0){return e}const o=e.length;if(r===void 0||r<0){r=0}if(i===void 0||i>o-r){i=o-r}let a;let s=-1;let c=-1;if(r>0||io-r){i=o-r}return visitArrayWorker(e,t,n,r,i)}function visitArrayWorker(e,t,n,r,i){let o;const a=e.length;if(r>0||i=2){i=addDefaultValueAssignmentsIfNeeded(i,n)}n.setLexicalEnvironmentFlags(1,false)}n.suspendLexicalEnvironment();return i}function addDefaultValueAssignmentsIfNeeded(e,t){let n;for(let r=0;r{const o=rs,addSource:addSource,setSourceContent:setSourceContent,addName:addName,addMapping:addMapping,appendSourceMap:appendSourceMap,toJSON:toJSON,toString:()=>JSON.stringify(toJSON())};function addSource(t){o();const n=getRelativePathToDirectoryOrUrl(r,t,e.getCurrentDirectory(),e.getCanonicalFileName,true);let i=l.get(n);if(i===void 0){i=c.length;c.push(n);s.push(t);l.set(n,i)}a();return i}function setSourceContent(e,t){o();if(t!==null){if(!d)d=[];while(d.lengtht||N===t&&k>n)}function addMapping(e,t,n,r,i,s){S.assert(e>=b,"generatedLine cannot backtrack");S.assert(t>=0,"generatedCharacter cannot be negative");S.assert(n===void 0||n>=0,"sourceIndex cannot be negative");S.assert(r===void 0||r>=0,"sourceLine cannot be negative");S.assert(i===void 0||i>=0,"sourceCharacter cannot be negative");o();if(isNewGeneratedPosition(e,t)||isBacktrackingSourcePosition(n,r,i)){commitPendingMapping();b=e;C=t;D=false;I=false;P=true}if(n!==void 0&&r!==void 0&&i!==void 0){E=n;N=r;k=i;D=true;if(s!==void 0){F=s;I=true}}a()}function appendSourceMap(e,t,n,r,i,s){S.assert(e>=b,"generatedLine cannot backtrack");S.assert(t>=0,"generatedCharacter cannot be negative");o();const c=[];let l;const d=decodeMappings(n.mappings);for(const o of d){if(s&&(o.generatedLine>s.line||o.generatedLine===s.line&&o.generatedCharacter>s.character)){break}if(i&&(o.generatedLine=1024){flushMappingBuffer()}}function commitPendingMapping(){if(!P||!shouldCommitMapping()){return}o();if(_0){m+=String.fromCharCode.apply(void 0,f);f.length=0}}function toJSON(){commitPendingMapping();flushMappingBuffer();return{version:3,file:t,sourceRoot:n,sources:c,names:p,mappings:m,sourcesContent:d}}function appendBase64VLQ(e){if(e<0){e=(-e<<1)+1}else{e=e<<1}do{let t=e&31;e=e>>5;if(e>0){t=t|32}appendMappingCharCode(base64FormatEncode(t))}while(e>0)}}var fa=/\/\/[@#] source[M]appingURL=(.+)\r?\n?$/;var ma=/^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/;var _a=/^\s*(\/\/[@#] .*)?$/;function getLineInfo(e,t){return{getLineCount:()=>t.length,getLineText:n=>e.substring(t[n],t[n+1])}}function tryGetSourceMappingURL(e){for(let t=e.getLineCount()-1;t>=0;t--){const n=e.getLineText(t);const r=ma.exec(n);if(r){return r[1].trimEnd()}else if(!n.match(_a)){break}}}function isStringOrNull(e){return typeof e==="string"||e===null}function isRawSourceMap(e){return e!==null&&typeof e==="object"&&e.version===3&&typeof e.file==="string"&&typeof e.mappings==="string"&&isArray(e.sources)&&every(e.sources,isString)&&(e.sourceRoot===void 0||e.sourceRoot===null||typeof e.sourceRoot==="string")&&(e.sourcesContent===void 0||e.sourcesContent===null||isArray(e.sourcesContent)&&every(e.sourcesContent,isStringOrNull))&&(e.names===void 0||e.names===null||isArray(e.names)&&every(e.names,isString))}function tryParseRawSourceMap(e){try{const t=JSON.parse(e);if(isRawSourceMap(t)){return t}}catch{}return void 0}function decodeMappings(e){let t=false;let n=0;let r=0;let i=0;let o=0;let a=0;let s=0;let c=0;let l;return{get pos(){return n},get error(){return l},get state(){return captureMapping(true,true)},next(){while(!t&&n=e.length)return setError("Error in decoding base64VLQFormatDecode, past the mapping string"),-1;const o=base64FormatDecode(e.charCodeAt(n));if(o===-1)return setError("Invalid character in VLQ"),-1;t=(o&32)!==0;i=i|(o&31)<>1}else{i=i>>1;i=-i}return i}}function sameMapping(e,t){return e===t||e.generatedLine===t.generatedLine&&e.generatedCharacter===t.generatedCharacter&&e.sourceIndex===t.sourceIndex&&e.sourceLine===t.sourceLine&&e.sourceCharacter===t.sourceCharacter&&e.nameIndex===t.nameIndex}function isSourceMapping(e){return e.sourceIndex!==void 0&&e.sourceLine!==void 0&&e.sourceCharacter!==void 0}function base64FormatEncode(e){return e>=0&&e<26?65+e:e>=26&&e<52?97+e-26:e>=52&&e<62?48+e-52:e===62?43:e===63?47:S.fail(`${e}: not a base64 value`)}function base64FormatDecode(e){return e>=65&&e<=90?e-65:e>=97&&e<=122?e-97+26:e>=48&&e<=57?e-48+52:e===43?62:e===47?63:-1}function isSourceMappedPosition(e){return e.sourceIndex!==void 0&&e.sourcePosition!==void 0}function sameMappedPosition(e,t){return e.generatedPosition===t.generatedPosition&&e.sourceIndex===t.sourceIndex&&e.sourcePosition===t.sourcePosition}function compareSourcePositions(e,t){S.assert(e.sourceIndex===t.sourceIndex);return compareValues(e.sourcePosition,t.sourcePosition)}function compareGeneratedPositions(e,t){return compareValues(e.generatedPosition,t.generatedPosition)}function getSourcePositionOfMapping(e){return e.sourcePosition}function getGeneratedPositionOfMapping(e){return e.generatedPosition}function createDocumentPositionMapper(e,t,n){const r=getDirectoryPath(n);const i=t.sourceRoot?getNormalizedAbsolutePath(t.sourceRoot,r):r;const o=getNormalizedAbsolutePath(t.file,r);const a=e.getSourceFileLike(o);const s=t.sources.map((e=>getNormalizedAbsolutePath(e,i)));const c=new Map(s.map(((t,n)=>[e.getCanonicalFileName(t),n])));let l;let p;let u;return{getSourcePosition:getSourcePosition,getGeneratedPosition:getGeneratedPosition};function processMapping(n){const r=a!==void 0?getPositionOfLineAndCharacter(a,n.generatedLine,n.generatedCharacter,true):-1;let i;let o;if(isSourceMapping(n)){const r=e.getSourceFileLike(s[n.sourceIndex]);i=t.sources[n.sourceIndex];o=r!==void 0?getPositionOfLineAndCharacter(r,n.sourceLine,n.sourceCharacter,true):-1}return{generatedPosition:r,source:i,sourceIndex:n.sourceIndex,sourcePosition:o,nameIndex:n.nameIndex}}function getDecodedMappings(){if(l===void 0){const n=decodeMappings(t.mappings);const r=arrayFrom(n,processMapping);if(n.error!==void 0){if(e.log){e.log(`Encountered error while decoding sourcemap: ${n.error}`)}l=d}else{l=r}}return l}function getSourceMappings(e){if(u===void 0){const e=[];for(const t of getDecodedMappings()){if(!isSourceMappedPosition(t))continue;let n=e[t.sourceIndex];if(!n)e[t.sourceIndex]=n=[];n.push(t)}u=e.map((e=>sortAndDeduplicate(e,compareSourcePositions,sameMappedPosition)))}return u[e]}function getGeneratedMappings(){if(p===void 0){const e=[];for(const t of getDecodedMappings()){e.push(t)}p=sortAndDeduplicate(e,compareGeneratedPositions,sameMappedPosition)}return p}function getGeneratedPosition(t){const n=c.get(e.getCanonicalFileName(t.fileName));if(n===void 0)return t;const r=getSourceMappings(n);if(!some(r))return t;let i=binarySearchKey(r,t.pos,getSourcePositionOfMapping,compareValues);if(i<0){i=~i}const a=r[i];if(a===void 0||a.sourceIndex!==n){return t}return{fileName:o,pos:a.generatedPosition}}function getSourcePosition(e){const t=getGeneratedMappings();if(!some(t))return e;let n=binarySearchKey(t,e.pos,getGeneratedPositionOfMapping,compareValues);if(n<0){n=~n}const r=t[n];if(r===void 0||!isSourceMappedPosition(r)){return e}return{fileName:s[r.sourceIndex],pos:r.sourcePosition}}}var ga={getSourcePosition:identity,getGeneratedPosition:identity};function getOriginalNodeId(e){e=getOriginalNode(e);return e?getNodeId(e):0}function containsDefaultReference(e){if(!e)return false;if(!isNamedImports(e)&&!isNamedExports(e))return false;return some(e.elements,isNamedDefaultReference)}function isNamedDefaultReference(e){return moduleExportNameIsDefault(e.propertyName||e.name)}function chainBundle(e,t){return transformSourceFileOrBundle;function transformSourceFileOrBundle(e){return e.kind===307?t(e):transformBundle(e)}function transformBundle(n){return e.factory.createBundle(map(n.sourceFiles,t))}}function getExportNeedsImportStarHelper(e){return!!getNamespaceDeclarationNode(e)}function getImportNeedsImportStarHelper(e){if(!!getNamespaceDeclarationNode(e)){return true}const t=e.importClause&&e.importClause.namedBindings;if(!t){return false}if(!isNamedImports(t))return false;let n=0;for(const e of t.elements){if(isNamedDefaultReference(e)){n++}}return n>0&&n!==t.elements.length||!!(t.elements.length-n)&&isDefaultImport(e)}function getImportNeedsImportDefaultHelper(e){return!getImportNeedsImportStarHelper(e)&&(isDefaultImport(e)||!!e.importClause&&isNamedImports(e.importClause.namedBindings)&&containsDefaultReference(e.importClause.namedBindings))}function collectExternalModuleInfo(e,t){const n=e.getEmitResolver();const r=e.getCompilerOptions();const i=[];const o=new ha;const a=[];const s=new Map;const c=new Set;let l;let d=false;let p;let u=false;let f=false;let m=false;for(const n of t.statements){switch(n.kind){case 272:i.push(n);if(!f&&getImportNeedsImportStarHelper(n)){f=true}if(!m&&getImportNeedsImportDefaultHelper(n)){m=true}break;case 271:if(n.moduleReference.kind===283){i.push(n)}break;case 278:if(n.moduleSpecifier){if(!n.exportClause){i.push(n);u=true}else{i.push(n);if(isNamedExports(n.exportClause)){addExportedNamesForExportDeclaration(n);m||(m=containsDefaultReference(n.exportClause))}else{const e=n.exportClause.name;const t=moduleExportNameTextUnescaped(e);if(!s.get(t)){multiMapSparseArrayAdd(a,getOriginalNodeId(n),e);s.set(t,true);l=append(l,e)}f=true}}}else{addExportedNamesForExportDeclaration(n)}break;case 277:if(n.isExportEquals&&!p){p=n}break;case 243:if(hasSyntacticModifier(n,32)){for(const e of n.declarationList.declarations){l=collectExportedVariableInfo(e,s,l,a)}}break;case 262:if(hasSyntacticModifier(n,32)){addExportedFunctionDeclaration(n,void 0,hasSyntacticModifier(n,2048))}break;case 263:if(hasSyntacticModifier(n,32)){if(hasSyntacticModifier(n,2048)){if(!d){multiMapSparseArrayAdd(a,getOriginalNodeId(n),e.factory.getDeclarationName(n));d=true}}else{const e=n.name;if(e&&!s.get(idText(e))){multiMapSparseArrayAdd(a,getOriginalNodeId(n),e);s.set(idText(e),true);l=append(l,e)}}}break}}const _=createExternalHelpersImportDeclarationIfNeeded(e.factory,e.getEmitHelperFactory(),t,r,u,f,m);if(_){i.unshift(_)}return{externalImports:i,exportSpecifiers:o,exportEquals:p,hasExportStarsToExportValues:u,exportedBindings:a,exportedNames:l,exportedFunctions:c,externalHelpersImportDeclaration:_};function addExportedNamesForExportDeclaration(e){for(const t of cast(e.exportClause,isNamedExports).elements){const r=moduleExportNameTextUnescaped(t.name);if(!s.get(r)){const i=t.propertyName||t.name;if(i.kind!==11){if(!e.moduleSpecifier){o.add(i,t)}const r=n.getReferencedImportDeclaration(i)||n.getReferencedValueDeclaration(i);if(r){if(r.kind===262){addExportedFunctionDeclaration(r,t.name,moduleExportNameIsDefault(t.name));continue}multiMapSparseArrayAdd(a,getOriginalNodeId(r),t.name)}}s.set(r,true);l=append(l,t.name)}}}function addExportedFunctionDeclaration(t,n,r){c.add(getOriginalNode(t,isFunctionDeclaration));if(r){if(!d){multiMapSparseArrayAdd(a,getOriginalNodeId(t),n??e.factory.getDeclarationName(t));d=true}}else{n??(n=t.name);const e=moduleExportNameTextUnescaped(n);if(!s.get(e)){multiMapSparseArrayAdd(a,getOriginalNodeId(t),n);s.set(e,true)}}}}function collectExportedVariableInfo(e,t,n,r){if(isBindingPattern(e.name)){for(const i of e.name.elements){if(!isOmittedExpression(i)){n=collectExportedVariableInfo(i,t,n,r)}}}else if(!isGeneratedIdentifier(e.name)){const i=idText(e.name);if(!t.get(i)){t.set(i,true);n=append(n,e.name);if(isLocalName(e.name)){multiMapSparseArrayAdd(r,getOriginalNodeId(e),e.name)}}}return n}function multiMapSparseArrayAdd(e,t,n){let r=e[t];if(r){r.push(n)}else{e[t]=r=[n]}return r}var ya=class _IdentifierNameMap{constructor(){this._map=new Map}get size(){return this._map.size}has(e){return this._map.has(_IdentifierNameMap.toKey(e))}get(e){return this._map.get(_IdentifierNameMap.toKey(e))}set(e,t){this._map.set(_IdentifierNameMap.toKey(e),t);return this}delete(e){var t;return((t=this._map)==null?void 0:t.delete(_IdentifierNameMap.toKey(e)))??false}clear(){this._map.clear()}values(){return this._map.values()}static toKey(e){if(isGeneratedPrivateIdentifier(e)||isGeneratedIdentifier(e)){const t=e.emitNode.autoGenerate;if((t.flags&7)===4){const n=getNodeForGeneratedName(e);const r=isMemberName(n)&&n!==e?_IdentifierNameMap.toKey(n):`(generated@${getNodeId(n)})`;return formatGeneratedName(false,t.prefix,r,t.suffix,_IdentifierNameMap.toKey)}else{const e=`(auto@${t.id})`;return formatGeneratedName(false,t.prefix,e,t.suffix,_IdentifierNameMap.toKey)}}if(isPrivateIdentifier(e)){return idText(e).slice(1)}return idText(e)}};var ha=class extends ya{add(e,t){let n=this.get(e);if(n){n.push(t)}else{this.set(e,n=[t])}return n}remove(e,t){const n=this.get(e);if(n){unorderedRemoveItem(n,t);if(!n.length){this.delete(e)}}}};function isSimpleCopiableExpression(e){return isStringLiteralLike(e)||e.kind===9||isKeyword(e.kind)||isIdentifier(e)}function isSimpleInlineableExpression(e){return!isIdentifier(e)&&isSimpleCopiableExpression(e)}function isCompoundAssignment(e){return e>=65&&e<=79}function getNonAssignmentOperatorForCompoundAssignment(e){switch(e){case 65:return 40;case 66:return 41;case 67:return 42;case 68:return 43;case 69:return 44;case 70:return 45;case 71:return 48;case 72:return 49;case 73:return 50;case 74:return 51;case 75:return 52;case 79:return 53;case 76:return 57;case 77:return 56;case 78:return 61}}function getSuperCallFromStatement(e){if(!isExpressionStatement(e)){return void 0}const t=skipParentheses(e.expression);return isSuperCall(t)?t:void 0}function findSuperStatementIndexPathWorker(e,t,n){for(let r=t;risInitializedOrStaticProperty(e,t,n)))}function isStaticPropertyDeclarationOrClassStaticBlockDeclaration(e){return isStaticPropertyDeclaration(e)||isClassStaticBlockDeclaration(e)}function getStaticPropertiesAndClassStaticBlock(e){return filter(e.members,isStaticPropertyDeclarationOrClassStaticBlockDeclaration)}function isInitializedOrStaticProperty(e,t,n){return isPropertyDeclaration(e)&&(!!e.initializer||!t)&&hasStaticModifier(e)===n}function isStaticPropertyDeclaration(e){return isPropertyDeclaration(e)&&hasStaticModifier(e)}function isInitializedProperty(e){return e.kind===172&&e.initializer!==void 0}function isNonStaticMethodOrAccessorWithPrivateName(e){return!isStatic(e)&&(isMethodOrAccessor(e)||isAutoAccessorPropertyDeclaration(e))&&isPrivateIdentifier(e.name)}function getDecoratorsOfParameters(e){let t;if(e){const n=e.parameters;const r=n.length>0&¶meterIsThisKeyword(n[0]);const i=r?1:0;const o=r?n.length-1:n.length;for(let e=0;egetPrivateIdentifier(e.privateEnv,t)))}function isSimpleParameter(e){return!e.initializer&&isIdentifier(e.name)}function isSimpleParameterList(e){return every(e,isSimpleParameter)}function rewriteModuleSpecifier(e,t){if(!e||!isStringLiteral(e)||!shouldRewriteModuleSpecifier(e.text,t)){return e}const n=changeExtension(e.text,getOutputExtension(e.text,t));return n!==e.text?setOriginalNode(setTextRange(zr.createStringLiteral(n,e.singleQuote),e),e):e}var Ta=(e=>{e[e["All"]=0]="All";e[e["ObjectRest"]=1]="ObjectRest";return e})(Ta||{});function flattenDestructuringAssignment(e,t,n,r,i,o){let a=e;let s;if(isDestructuringAssignment(e)){s=e.right;while(isEmptyArrayLiteral(e.left)||isEmptyObjectLiteral(e.left)){if(isDestructuringAssignment(s)){a=e=s;s=e.right}else{return S.checkDefined(visitNode(s,t,isExpression))}}}let c;const l={context:n,level:r,downlevelIteration:!!n.getCompilerOptions().downlevelIteration,hoistTempVariables:true,emitExpression:emitExpression,emitBindingOrAssignment:emitBindingOrAssignment,createArrayBindingOrAssignmentPattern:e=>makeArrayAssignmentPattern(n.factory,e),createObjectBindingOrAssignmentPattern:e=>makeObjectAssignmentPattern(n.factory,e),createArrayBindingOrAssignmentElement:makeAssignmentElement,visitor:t};if(s){s=visitNode(s,t,isExpression);S.assert(s);if(isIdentifier(s)&&bindingOrAssignmentElementAssignsToName(e,s.escapedText)||bindingOrAssignmentElementContainsNonLiteralComputedName(e)){s=ensureIdentifier(l,s,false,a)}else if(i){s=ensureIdentifier(l,s,true,a)}else if(nodeIsSynthesized(e)){a=s}}flattenBindingOrAssignmentElement(l,e,s,a,isDestructuringAssignment(e));if(s&&i){if(!some(c)){return s}c.push(s)}return n.factory.inlineExpressions(c)||n.factory.createOmittedExpression();function emitExpression(e){c=append(c,e)}function emitBindingOrAssignment(e,r,i,a){S.assertNode(e,o?isIdentifier:isExpression);const s=o?o(e,r,i):setTextRange(n.factory.createAssignment(S.checkDefined(visitNode(e,t,isExpression)),r),i);s.original=a;emitExpression(s)}}function bindingOrAssignmentElementAssignsToName(e,t){const n=getTargetOfBindingOrAssignmentElement(e);if(isBindingOrAssignmentPattern(n)){return bindingOrAssignmentPatternAssignsToName(n,t)}else if(isIdentifier(n)){return n.escapedText===t}return false}function bindingOrAssignmentPatternAssignsToName(e,t){const n=getElementsOfBindingOrAssignmentPattern(e);for(const e of n){if(bindingOrAssignmentElementAssignsToName(e,t)){return true}}return false}function bindingOrAssignmentElementContainsNonLiteralComputedName(e){const t=tryGetPropertyNameOfBindingOrAssignmentElement(e);if(t&&isComputedPropertyName(t)&&!isLiteralExpression(t.expression)){return true}const n=getTargetOfBindingOrAssignmentElement(e);return!!n&&isBindingOrAssignmentPattern(n)&&bindingOrAssignmentPatternContainsNonLiteralComputedName(n)}function bindingOrAssignmentPatternContainsNonLiteralComputedName(e){return!!forEach(getElementsOfBindingOrAssignmentPattern(e),bindingOrAssignmentElementContainsNonLiteralComputedName)}function flattenDestructuringBinding(e,t,n,r,i,o=false,a){let s;const c=[];const l=[];const d={context:n,level:r,downlevelIteration:!!n.getCompilerOptions().downlevelIteration,hoistTempVariables:o,emitExpression:emitExpression,emitBindingOrAssignment:emitBindingOrAssignment,createArrayBindingOrAssignmentPattern:e=>makeArrayBindingPattern(n.factory,e),createObjectBindingOrAssignmentPattern:e=>makeObjectBindingPattern(n.factory,e),createArrayBindingOrAssignmentElement:e=>makeBindingElement(n.factory,e),visitor:t};if(isVariableDeclaration(e)){let t=getInitializerOfBindingOrAssignmentElement(e);if(t&&(isIdentifier(t)&&bindingOrAssignmentElementAssignsToName(e,t.escapedText)||bindingOrAssignmentElementContainsNonLiteralComputedName(e))){t=ensureIdentifier(d,S.checkDefined(visitNode(t,d.visitor,isExpression)),false,t);e=n.factory.updateVariableDeclaration(e,e.name,void 0,void 0,t)}}flattenBindingOrAssignmentElement(d,e,i,e,a);if(s){const e=n.factory.createTempVariable(void 0);if(o){const t=n.factory.inlineExpressions(s);s=void 0;emitBindingOrAssignment(e,t,void 0,void 0)}else{n.hoistVariableDeclaration(e);const t=last(c);t.pendingExpressions=append(t.pendingExpressions,n.factory.createAssignment(e,t.value));addRange(t.pendingExpressions,s);t.value=e}}for(const{pendingExpressions:e,name:t,value:r,location:i,original:o}of c){const a=n.factory.createVariableDeclaration(t,void 0,void 0,e?n.factory.inlineExpressions(append(e,r)):r);a.original=o;setTextRange(a,i);l.push(a)}return l;function emitExpression(e){s=append(s,e)}function emitBindingOrAssignment(e,t,r,i){S.assertNode(e,isBindingName);if(s){t=n.factory.inlineExpressions(append(s,t));s=void 0}c.push({pendingExpressions:s,name:e,value:t,location:r,original:i})}}function flattenBindingOrAssignmentElement(e,t,n,r,i){const o=getTargetOfBindingOrAssignmentElement(t);if(!i){const i=visitNode(getInitializerOfBindingOrAssignmentElement(t),e.visitor,isExpression);if(i){if(n){n=createDefaultValueCheck(e,n,i,r);if(!isSimpleInlineableExpression(i)&&isBindingOrAssignmentPattern(o)){n=ensureIdentifier(e,n,true,r)}}else{n=i}}else if(!n){n=e.context.factory.createVoidZero()}}if(isObjectBindingOrAssignmentPattern(o)){flattenObjectBindingOrAssignmentPattern(e,t,o,n,r)}else if(isArrayBindingOrAssignmentPattern(o)){flattenArrayBindingOrAssignmentPattern(e,t,o,n,r)}else{e.emitBindingOrAssignment(o,n,r,t)}}function flattenObjectBindingOrAssignmentPattern(e,t,n,r,i){const o=getElementsOfBindingOrAssignmentPattern(n);const a=o.length;if(a!==1){const n=!isDeclarationBindingElement(t)||a!==0;r=ensureIdentifier(e,r,n,i)}let s;let c;for(let t=0;t=1&&!(l.transformFlags&(32768|65536))&&!(getTargetOfBindingOrAssignmentElement(l).transformFlags&(32768|65536))&&!isComputedPropertyName(t)){s=append(s,visitNode(l,e.visitor,isBindingOrAssignmentElement))}else{if(s){e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(s),r,i,n);s=void 0}const o=createDestructuringPropertyAccess(e,r,t);if(isComputedPropertyName(t)){c=append(c,o.argumentExpression)}flattenBindingOrAssignmentElement(e,l,o,l)}}else if(t===a-1){if(s){e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(s),r,i,n);s=void 0}const t=e.context.getEmitHelperFactory().createRestHelper(r,o,c,n);flattenBindingOrAssignmentElement(e,l,t,l)}}if(s){e.emitBindingOrAssignment(e.createObjectBindingOrAssignmentPattern(s),r,i,n)}}function flattenArrayBindingOrAssignmentPattern(e,t,n,r,i){const o=getElementsOfBindingOrAssignmentPattern(n);const a=o.length;if(e.level<1&&e.downlevelIteration){r=ensureIdentifier(e,setTextRange(e.context.getEmitHelperFactory().createReadHelper(r,a>0&&getRestIndicatorOfBindingOrAssignmentElement(o[a-1])?void 0:a),i),false,i)}else if(a!==1&&(e.level<1||a===0)||every(o,isOmittedExpression)){const n=!isDeclarationBindingElement(t)||a!==0;r=ensureIdentifier(e,r,n,i)}let s;let c;for(let t=0;t=1){if(n.transformFlags&65536||e.hasTransformedPriorElement&&!isSimpleBindingOrAssignmentElement(n)){e.hasTransformedPriorElement=true;const t=e.context.factory.createTempVariable(void 0);if(e.hoistTempVariables){e.context.hoistVariableDeclaration(t)}c=append(c,[t,n]);s=append(s,e.createArrayBindingOrAssignmentElement(t))}else{s=append(s,n)}}else if(isOmittedExpression(n)){continue}else if(!getRestIndicatorOfBindingOrAssignmentElement(n)){const i=e.context.factory.createElementAccessExpression(r,t);flattenBindingOrAssignmentElement(e,n,i,n)}else if(t===a-1){const i=e.context.factory.createArraySliceCall(r,t);flattenBindingOrAssignmentElement(e,n,i,n)}}if(s){e.emitBindingOrAssignment(e.createArrayBindingOrAssignmentPattern(s),r,i,n)}if(c){for(const[t,n]of c){flattenBindingOrAssignmentElement(e,n,t,n)}}}function isSimpleBindingOrAssignmentElement(e){const t=getTargetOfBindingOrAssignmentElement(e);if(!t||isOmittedExpression(t))return true;const n=tryGetPropertyNameOfBindingOrAssignmentElement(e);if(n&&!isPropertyNameLiteral(n))return false;const r=getInitializerOfBindingOrAssignmentElement(e);if(r&&!isSimpleInlineableExpression(r))return false;if(isBindingOrAssignmentPattern(t))return every(getElementsOfBindingOrAssignmentPattern(t),isSimpleBindingOrAssignmentElement);return isIdentifier(t)}function createDefaultValueCheck(e,t,n,r){t=ensureIdentifier(e,t,true,r);return e.context.factory.createConditionalExpression(e.context.factory.createTypeCheck(t,"undefined"),void 0,n,void 0,t)}function createDestructuringPropertyAccess(e,t,n){const{factory:r}=e.context;if(isComputedPropertyName(n)){const r=ensureIdentifier(e,S.checkDefined(visitNode(n.expression,e.visitor,isExpression)),false,n);return e.context.factory.createElementAccessExpression(t,r)}else if(isStringOrNumericLiteralLike(n)||isBigIntLiteral(n)){const i=r.cloneNode(n);return e.context.factory.createElementAccessExpression(t,i)}else{const r=e.context.factory.createIdentifier(idText(n));return e.context.factory.createPropertyAccessExpression(t,r)}}function ensureIdentifier(e,t,n,r){if(isIdentifier(t)&&n){return t}else{const n=e.context.factory.createTempVariable(void 0);if(e.hoistTempVariables){e.context.hoistVariableDeclaration(n);e.emitExpression(setTextRange(e.context.factory.createAssignment(n,t),r))}else{e.emitBindingOrAssignment(n,t,r,void 0)}return n}}function makeArrayBindingPattern(e,t){S.assertEachNode(t,isArrayBindingElement);return e.createArrayBindingPattern(t)}function makeArrayAssignmentPattern(e,t){S.assertEachNode(t,isArrayBindingOrAssignmentElement);return e.createArrayLiteralExpression(map(t,e.converters.convertToArrayAssignmentElement))}function makeObjectBindingPattern(e,t){S.assertEachNode(t,isBindingElement);return e.createObjectBindingPattern(t)}function makeObjectAssignmentPattern(e,t){S.assertEachNode(t,isObjectBindingOrAssignmentElement);return e.createObjectLiteralExpression(map(t,e.converters.convertToObjectAssignmentElement))}function makeBindingElement(e,t){return e.createBindingElement(void 0,void 0,t)}function makeAssignmentElement(e){return e}function createClassThisAssignmentBlock(e,t,n=e.createThis()){const r=e.createAssignment(t,n);const i=e.createExpressionStatement(r);const o=e.createBlock([i],false);const a=e.createClassStaticBlockDeclaration(o);getOrCreateEmitNode(a).classThis=t;return a}function isClassThisAssignmentBlock(e){var t;if(!isClassStaticBlockDeclaration(e)||e.body.statements.length!==1){return false}const n=e.body.statements[0];return isExpressionStatement(n)&&isAssignmentExpression(n.expression,true)&&isIdentifier(n.expression.left)&&((t=e.emitNode)==null?void 0:t.classThis)===n.expression.left&&n.expression.right.kind===110}function classHasClassThisAssignment(e){var t;return!!((t=e.emitNode)==null?void 0:t.classThis)&&some(e.members,isClassThisAssignmentBlock)}function injectClassThisAssignmentIfMissing(e,t,n,r){if(classHasClassThisAssignment(t)){return t}const i=createClassThisAssignmentBlock(e,n,r);if(t.name){setSourceMapRange(i.body.statements[0],t.name)}const o=e.createNodeArray([i,...t.members]);setTextRange(o,t.members);const a=isClassDeclaration(t)?e.updateClassDeclaration(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,o):e.updateClassExpression(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,o);getOrCreateEmitNode(a).classThis=n;return a}function getAssignedNameOfIdentifier(e,t,n){const r=getOriginalNode(skipOuterExpressions(n));if((isClassDeclaration(r)||isFunctionDeclaration(r))&&!r.name&&hasSyntacticModifier(r,2048)){return e.createStringLiteral("default")}return e.createStringLiteralFromNode(t)}function getAssignedNameOfPropertyName(e,t,n){const{factory:r}=e;if(n!==void 0){const e=r.createStringLiteral(n);return{assignedName:e,name:t}}if(isPropertyNameLiteral(t)||isPrivateIdentifier(t)){const e=r.createStringLiteralFromNode(t);return{assignedName:e,name:t}}if(isPropertyNameLiteral(t.expression)&&!isIdentifier(t.expression)){const e=r.createStringLiteralFromNode(t.expression);return{assignedName:e,name:t}}const i=r.getGeneratedNameForNode(t);e.hoistVariableDeclaration(i);const o=e.getEmitHelperFactory().createPropKeyHelper(t.expression);const a=r.createAssignment(i,o);const s=r.updateComputedPropertyName(t,a);return{assignedName:i,name:s}}function createClassNamedEvaluationHelperBlock(e,t,n=e.factory.createThis()){const{factory:r}=e;const i=e.getEmitHelperFactory().createSetFunctionNameHelper(n,t);const o=r.createExpressionStatement(i);const a=r.createBlock([o],false);const s=r.createClassStaticBlockDeclaration(a);getOrCreateEmitNode(s).assignedName=t;return s}function isClassNamedEvaluationHelperBlock(e){var t;if(!isClassStaticBlockDeclaration(e)||e.body.statements.length!==1){return false}const n=e.body.statements[0];return isExpressionStatement(n)&&isCallToHelper(n.expression,"___setFunctionName")&&n.expression.arguments.length>=2&&n.expression.arguments[1]===((t=e.emitNode)==null?void 0:t.assignedName)}function classHasExplicitlyAssignedName(e){var t;return!!((t=e.emitNode)==null?void 0:t.assignedName)&&some(e.members,isClassNamedEvaluationHelperBlock)}function classHasDeclaredOrExplicitlyAssignedName(e){return!!e.name||classHasExplicitlyAssignedName(e)}function injectClassNamedEvaluationHelperBlockIfMissing(e,t,n,r){if(classHasExplicitlyAssignedName(t)){return t}const{factory:i}=e;const o=createClassNamedEvaluationHelperBlock(e,n,r);if(t.name){setSourceMapRange(o.body.statements[0],t.name)}const a=findIndex(t.members,isClassThisAssignmentBlock)+1;const s=t.members.slice(0,a);const c=t.members.slice(a);const l=i.createNodeArray([...s,o,...c]);setTextRange(l,t.members);t=isClassDeclaration(t)?i.updateClassDeclaration(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,l):i.updateClassExpression(t,t.modifiers,t.name,t.typeParameters,t.heritageClauses,l);getOrCreateEmitNode(t).assignedName=n;return t}function finishTransformNamedEvaluation(e,t,n,r){if(r&&isStringLiteral(n)&&isEmptyStringLiteral(n)){return t}const{factory:i}=e;const o=skipOuterExpressions(t);const a=isClassExpression(o)?cast(injectClassNamedEvaluationHelperBlockIfMissing(e,o,n),isClassExpression):e.getEmitHelperFactory().createSetFunctionNameHelper(o,n);return i.restoreOuterExpressions(t,a)}function transformNamedEvaluationOfPropertyAssignment(e,t,n,r){const{factory:i}=e;const{assignedName:o,name:a}=getAssignedNameOfPropertyName(e,t.name,r);const s=finishTransformNamedEvaluation(e,t.initializer,o,n);return i.updatePropertyAssignment(t,a,s)}function transformNamedEvaluationOfShorthandAssignmentProperty(e,t,n,r){const{factory:i}=e;const o=r!==void 0?i.createStringLiteral(r):getAssignedNameOfIdentifier(i,t.name,t.objectAssignmentInitializer);const a=finishTransformNamedEvaluation(e,t.objectAssignmentInitializer,o,n);return i.updateShorthandPropertyAssignment(t,t.name,a)}function transformNamedEvaluationOfVariableDeclaration(e,t,n,r){const{factory:i}=e;const o=r!==void 0?i.createStringLiteral(r):getAssignedNameOfIdentifier(i,t.name,t.initializer);const a=finishTransformNamedEvaluation(e,t.initializer,o,n);return i.updateVariableDeclaration(t,t.name,t.exclamationToken,t.type,a)}function transformNamedEvaluationOfParameterDeclaration(e,t,n,r){const{factory:i}=e;const o=r!==void 0?i.createStringLiteral(r):getAssignedNameOfIdentifier(i,t.name,t.initializer);const a=finishTransformNamedEvaluation(e,t.initializer,o,n);return i.updateParameterDeclaration(t,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,t.type,a)}function transformNamedEvaluationOfBindingElement(e,t,n,r){const{factory:i}=e;const o=r!==void 0?i.createStringLiteral(r):getAssignedNameOfIdentifier(i,t.name,t.initializer);const a=finishTransformNamedEvaluation(e,t.initializer,o,n);return i.updateBindingElement(t,t.dotDotDotToken,t.propertyName,t.name,a)}function transformNamedEvaluationOfPropertyDeclaration(e,t,n,r){const{factory:i}=e;const{assignedName:o,name:a}=getAssignedNameOfPropertyName(e,t.name,r);const s=finishTransformNamedEvaluation(e,t.initializer,o,n);return i.updatePropertyDeclaration(t,t.modifiers,a,t.questionToken??t.exclamationToken,t.type,s)}function transformNamedEvaluationOfAssignmentExpression(e,t,n,r){const{factory:i}=e;const o=r!==void 0?i.createStringLiteral(r):getAssignedNameOfIdentifier(i,t.left,t.right);const a=finishTransformNamedEvaluation(e,t.right,o,n);return i.updateBinaryExpression(t,t.left,t.operatorToken,a)}function transformNamedEvaluationOfExportAssignment(e,t,n,r){const{factory:i}=e;const o=r!==void 0?i.createStringLiteral(r):i.createStringLiteral(t.isExportEquals?"":"default");const a=finishTransformNamedEvaluation(e,t.expression,o,n);return i.updateExportAssignment(t,t.modifiers,a)}function transformNamedEvaluation(e,t,n,r){switch(t.kind){case 303:return transformNamedEvaluationOfPropertyAssignment(e,t,n,r);case 304:return transformNamedEvaluationOfShorthandAssignmentProperty(e,t,n,r);case 260:return transformNamedEvaluationOfVariableDeclaration(e,t,n,r);case 169:return transformNamedEvaluationOfParameterDeclaration(e,t,n,r);case 208:return transformNamedEvaluationOfBindingElement(e,t,n,r);case 172:return transformNamedEvaluationOfPropertyDeclaration(e,t,n,r);case 226:return transformNamedEvaluationOfAssignmentExpression(e,t,n,r);case 277:return transformNamedEvaluationOfExportAssignment(e,t,n,r)}}var Sa=(e=>{e[e["LiftRestriction"]=0]="LiftRestriction";e[e["All"]=1]="All";return e})(Sa||{});function processTaggedTemplateExpression(e,t,n,r,i,o){const a=visitNode(t.tag,n,isExpression);S.assert(a);const s=[void 0];const c=[];const l=[];const d=t.template;if(o===0&&!hasInvalidEscape(d)){return visitEachChild(t,n,e)}const{factory:p}=e;if(isNoSubstitutionTemplateLiteral(d)){c.push(createTemplateCooked(p,d));l.push(getRawLiteral(p,d,r))}else{c.push(createTemplateCooked(p,d.head));l.push(getRawLiteral(p,d.head,r));for(const e of d.templateSpans){c.push(createTemplateCooked(p,e.literal));l.push(getRawLiteral(p,e.literal,r));s.push(S.checkDefined(visitNode(e.expression,n,isExpression)))}}const u=e.getEmitHelperFactory().createTemplateObjectHelper(p.createArrayLiteralExpression(c),p.createArrayLiteralExpression(l));if(isExternalModule(r)){const e=p.createUniqueName("templateObject");i(e);s[0]=p.createLogicalOr(e,p.createAssignment(e,u))}else{s[0]=u}return p.createCallExpression(a,void 0,s)}function createTemplateCooked(e,t){return t.templateFlags&26656?e.createVoidZero():e.createStringLiteral(t.text)}function getRawLiteral(e,t,n){let r=t.rawText;if(r===void 0){S.assertIsDefined(n,"Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform.");r=getSourceTextOfNodeFromSourceFile(n,t);const e=t.kind===15||t.kind===18;r=r.substring(1,r.length-(e?1:2))}r=r.replace(/\r\n?/g,"\n");return setTextRange(e.createStringLiteral(r),t)}var va=false;function transformTypeScript(e){const{factory:t,getEmitHelperFactory:n,startLexicalEnvironment:r,resumeLexicalEnvironment:i,endLexicalEnvironment:o,hoistVariableDeclaration:a}=e;const s=e.getEmitResolver();const c=e.getCompilerOptions();const l=zn(c);const d=Vn(c);const p=!!c.experimentalDecorators;const u=c.emitDecoratorMetadata?createRuntimeTypeSerializer(e):void 0;const f=e.onEmitNode;const m=e.onSubstituteNode;e.onEmitNode=onEmitNode;e.onSubstituteNode=onSubstituteNode;e.enableSubstitution(211);e.enableSubstitution(212);let _;let g;let y;let h;let T;let v=0;let x;return transformSourceFileOrBundle;function transformSourceFileOrBundle(e){if(e.kind===308){return transformBundle(e)}return transformSourceFile(e)}function transformBundle(e){return t.createBundle(e.sourceFiles.map(transformSourceFile))}function transformSourceFile(t){if(t.isDeclarationFile){return t}_=t;const n=saveStateAndInvoke(t,visitSourceFile);addEmitHelpers(n,e.readEmitHelpers());_=void 0;return n}function saveStateAndInvoke(e,t){const n=h;const r=T;onBeforeVisitNode(e);const i=t(e);if(h!==n){T=r}h=n;return i}function onBeforeVisitNode(e){switch(e.kind){case 307:case 269:case 268:case 241:h=e;T=void 0;break;case 263:case 262:if(hasSyntacticModifier(e,128)){break}if(e.name){recordEmittedDeclarationInScope(e)}else{S.assert(e.kind===263||hasSyntacticModifier(e,2048))}break}}function visitor(e){return saveStateAndInvoke(e,visitorWorker)}function visitorWorker(e){if(e.transformFlags&1){return visitTypeScript(e)}return e}function sourceElementVisitor(e){return saveStateAndInvoke(e,sourceElementVisitorWorker)}function sourceElementVisitorWorker(e){switch(e.kind){case 272:case 271:case 277:case 278:return visitElidableStatement(e);default:return visitorWorker(e)}}function isElisionBlocked(e){const t=getParseTreeNode(e);if(t===e||isExportAssignment(e)){return false}if(!t||t.kind!==e.kind){return true}switch(e.kind){case 272:S.assertNode(t,isImportDeclaration);if(e.importClause!==t.importClause){return true}if(e.attributes!==t.attributes){return true}break;case 271:S.assertNode(t,isImportEqualsDeclaration);if(e.name!==t.name){return true}if(e.isTypeOnly!==t.isTypeOnly){return true}if(e.moduleReference!==t.moduleReference&&(isEntityName(e.moduleReference)||isEntityName(t.moduleReference))){return true}break;case 278:S.assertNode(t,isExportDeclaration);if(e.exportClause!==t.exportClause){return true}if(e.attributes!==t.attributes){return true}break}return false}function visitElidableStatement(t){if(isElisionBlocked(t)){if(t.transformFlags&1){return visitEachChild(t,visitor,e)}return t}switch(t.kind){case 272:return visitImportDeclaration(t);case 271:return visitImportEqualsDeclaration(t);case 277:return visitExportAssignment(t);case 278:return visitExportDeclaration(t);default:S.fail("Unhandled ellided statement")}}function namespaceElementVisitor(e){return saveStateAndInvoke(e,namespaceElementVisitorWorker)}function namespaceElementVisitorWorker(e){if(e.kind===278||e.kind===272||e.kind===273||e.kind===271&&e.moduleReference.kind===283){return void 0}else if(e.transformFlags&1||hasSyntacticModifier(e,32)){return visitTypeScript(e)}return e}function getClassElementVisitor(e){return t=>saveStateAndInvoke(t,(t=>classElementVisitorWorker(t,e)))}function classElementVisitorWorker(t,n){switch(t.kind){case 176:return visitConstructor(t);case 172:return visitPropertyDeclaration(t,n);case 177:return visitGetAccessor(t,n);case 178:return visitSetAccessor(t,n);case 174:return visitMethodDeclaration(t,n);case 175:return visitEachChild(t,visitor,e);case 240:return t;case 181:return;default:return S.failBadSyntaxKind(t)}}function getObjectLiteralElementVisitor(e){return t=>saveStateAndInvoke(t,(t=>objectLiteralElementVisitorWorker(t,e)))}function objectLiteralElementVisitorWorker(e,t){switch(e.kind){case 303:case 304:case 305:return visitor(e);case 177:return visitGetAccessor(e,t);case 178:return visitSetAccessor(e,t);case 174:return visitMethodDeclaration(e,t);default:return S.failBadSyntaxKind(e)}}function decoratorElidingVisitor(e){return isDecorator(e)?void 0:visitor(e)}function modifierElidingVisitor(e){return isModifier(e)?void 0:visitor(e)}function modifierVisitor(e){if(isDecorator(e))return void 0;if(modifierToFlag(e.kind)&28895){return void 0}else if(g&&e.kind===95){return void 0}return e}function visitTypeScript(n){if(isStatement(n)&&hasSyntacticModifier(n,128)){return t.createNotEmittedStatement(n)}switch(n.kind){case 95:case 90:return g?void 0:n;case 125:case 123:case 124:case 128:case 164:case 87:case 138:case 148:case 103:case 147:case 188:case 189:case 190:case 191:case 187:case 182:case 168:case 133:case 159:case 136:case 154:case 150:case 146:case 116:case 155:case 185:case 184:case 186:case 183:case 192:case 193:case 194:case 196:case 197:case 198:case 199:case 200:case 201:case 181:return void 0;case 265:return t.createNotEmittedStatement(n);case 270:return void 0;case 264:return t.createNotEmittedStatement(n);case 263:return visitClassDeclaration(n);case 231:return visitClassExpression(n);case 298:return visitHeritageClause(n);case 233:return visitExpressionWithTypeArguments(n);case 210:return visitObjectLiteralExpression(n);case 176:case 172:case 174:case 177:case 178:case 175:return S.fail("Class and object literal elements must be visited with their respective visitors");case 262:return visitFunctionDeclaration(n);case 218:return visitFunctionExpression(n);case 219:return visitArrowFunction(n);case 169:return visitParameter(n);case 217:return visitParenthesizedExpression(n);case 216:case 234:return visitAssertionExpression(n);case 238:return visitSatisfiesExpression(n);case 213:return visitCallExpression(n);case 214:return visitNewExpression(n);case 215:return visitTaggedTemplateExpression(n);case 235:return visitNonNullExpression(n);case 266:return visitEnumDeclaration(n);case 243:return visitVariableStatement(n);case 260:return visitVariableDeclaration(n);case 267:return visitModuleDeclaration(n);case 271:return visitImportEqualsDeclaration(n);case 285:return visitJsxSelfClosingElement(n);case 286:return visitJsxJsxOpeningElement(n);default:return visitEachChild(n,visitor,e)}}function visitSourceFile(n){const r=getStrictOptionValue(c,"alwaysStrict")&&!(isExternalModule(n)&&d>=5)&&!isJsonSourceFile(n);return t.updateSourceFile(n,visitLexicalEnvironment(n.statements,sourceElementVisitor,e,0,r))}function visitObjectLiteralExpression(e){return t.updateObjectLiteralExpression(e,visitNodes2(e.properties,getObjectLiteralElementVisitor(e),isObjectLiteralElementLike))}function getClassFacts(e){let t=0;if(some(getProperties(e,true,true)))t|=1;const n=getEffectiveBaseTypeNode(e);if(n&&skipOuterExpressions(n.expression).kind!==106)t|=64;if(classOrConstructorParameterIsDecorated(p,e))t|=2;if(childIsDecorated(p,e))t|=4;if(isExportOfNamespace(e))t|=8;else if(isDefaultExternalModuleExport(e))t|=32;else if(isNamedExternalModuleExport(e))t|=16;return t}function hasTypeScriptClassSyntax(e){return!!(e.transformFlags&8192)}function isClassLikeDeclarationWithTypeScriptSyntax(e){return hasDecorators(e)||some(e.typeParameters)||some(e.heritageClauses,hasTypeScriptClassSyntax)||some(e.members,hasTypeScriptClassSyntax)}function visitClassDeclaration(n){const r=getClassFacts(n);const i=l<=1&&!!(r&7);if(!isClassLikeDeclarationWithTypeScriptSyntax(n)&&!classOrConstructorParameterIsDecorated(p,n)&&!isExportOfNamespace(n)){return t.updateClassDeclaration(n,visitNodes2(n.modifiers,modifierVisitor,isModifier),n.name,void 0,visitNodes2(n.heritageClauses,visitor,isHeritageClause),visitNodes2(n.members,getClassElementVisitor(n),isClassElement))}if(i){e.startLexicalEnvironment()}const o=i||r&8;let a=o?visitNodes2(n.modifiers,modifierElidingVisitor,isModifierLike):visitNodes2(n.modifiers,visitor,isModifierLike);if(r&2){a=injectClassTypeMetadata(a,n)}const s=o&&!n.name||r&4||r&1;const c=s?n.name??t.getGeneratedNameForNode(n):n.name;const d=t.updateClassDeclaration(n,a,c,void 0,visitNodes2(n.heritageClauses,visitor,isHeritageClause),transformClassMembers(n));let u=getEmitFlags(n);if(r&1){u|=64}setEmitFlags(d,u);let f;if(i){const r=[d];const i=createTokenRange(skipTrivia(_.text,n.members.end),20);const o=t.getInternalName(n);const a=t.createPartiallyEmittedExpression(o);setTextRangeEnd(a,i.end);setEmitFlags(a,3072);const s=t.createReturnStatement(a);setTextRangePos(s,i.pos);setEmitFlags(s,3072|768);r.push(s);insertStatementsAfterStandardPrologue(r,e.endLexicalEnvironment());const c=t.createImmediatelyInvokedArrowFunction(r);setInternalEmitFlags(c,1);const l=t.createVariableDeclaration(t.getLocalName(n,false,false),void 0,void 0,c);setOriginalNode(l,n);const p=t.createVariableStatement(void 0,t.createVariableDeclarationList([l],1));setOriginalNode(p,n);setCommentRange(p,n);setSourceMapRange(p,moveRangePastDecorators(n));startOnNewLine(p);f=p}else{f=d}if(o){if(r&8){return[f,createExportMemberAssignmentStatement(n)]}if(r&32){return[f,t.createExportDefault(t.getLocalName(n,false,true))]}if(r&16){return[f,t.createExternalModuleExport(t.getDeclarationName(n,false,true))]}}return f}function visitClassExpression(e){let n=visitNodes2(e.modifiers,modifierElidingVisitor,isModifierLike);if(classOrConstructorParameterIsDecorated(p,e)){n=injectClassTypeMetadata(n,e)}return t.updateClassExpression(e,n,e.name,void 0,visitNodes2(e.heritageClauses,visitor,isHeritageClause),transformClassMembers(e))}function transformClassMembers(e){const n=visitNodes2(e.members,getClassElementVisitor(e),isClassElement);let r;const i=getFirstConstructorWithBody(e);const o=i&&filter(i.parameters,(e=>isParameterPropertyDeclaration(e,i)));if(o){for(const e of o){const n=t.createPropertyDeclaration(void 0,e.name,void 0,void 0,void 0);setOriginalNode(n,e);r=append(r,n)}}if(r){r=addRange(r,n);return setTextRange(t.createNodeArray(r),e.members)}return n}function injectClassTypeMetadata(e,n){const r=getTypeMetadata(n,n);if(some(r)){const n=[];addRange(n,takeWhile(e,isExportOrDefaultModifier));addRange(n,filter(e,isDecorator));addRange(n,r);addRange(n,filter(skipWhile(e,isExportOrDefaultModifier),isModifier));e=setTextRange(t.createNodeArray(n),e)}return e}function injectClassElementTypeMetadata(e,n,r){if(isClassLike(r)&&classElementOrClassElementParameterIsDecorated(p,n,r)){const i=getTypeMetadata(n,r);if(some(i)){const n=[];addRange(n,filter(e,isDecorator));addRange(n,i);addRange(n,filter(e,isModifier));e=setTextRange(t.createNodeArray(n),e)}}return e}function getTypeMetadata(e,t){if(!p)return void 0;return va?getNewTypeMetadata(e,t):getOldTypeMetadata(e,t)}function getOldTypeMetadata(e,r){if(u){let i;if(shouldAddTypeMetadata(e)){const o=n().createMetadataHelper("design:type",u.serializeTypeOfNode({currentLexicalScope:h,currentNameScope:r},e,r));i=append(i,t.createDecorator(o))}if(shouldAddParamTypesMetadata(e)){const o=n().createMetadataHelper("design:paramtypes",u.serializeParameterTypesOfNode({currentLexicalScope:h,currentNameScope:r},e,r));i=append(i,t.createDecorator(o))}if(shouldAddReturnTypeMetadata(e)){const o=n().createMetadataHelper("design:returntype",u.serializeReturnTypeOfNode({currentLexicalScope:h,currentNameScope:r},e));i=append(i,t.createDecorator(o))}return i}}function getNewTypeMetadata(e,r){if(u){let i;if(shouldAddTypeMetadata(e)){const n=t.createPropertyAssignment("type",t.createArrowFunction(void 0,void 0,[],void 0,t.createToken(39),u.serializeTypeOfNode({currentLexicalScope:h,currentNameScope:r},e,r)));i=append(i,n)}if(shouldAddParamTypesMetadata(e)){const n=t.createPropertyAssignment("paramTypes",t.createArrowFunction(void 0,void 0,[],void 0,t.createToken(39),u.serializeParameterTypesOfNode({currentLexicalScope:h,currentNameScope:r},e,r)));i=append(i,n)}if(shouldAddReturnTypeMetadata(e)){const n=t.createPropertyAssignment("returnType",t.createArrowFunction(void 0,void 0,[],void 0,t.createToken(39),u.serializeReturnTypeOfNode({currentLexicalScope:h,currentNameScope:r},e)));i=append(i,n)}if(i){const e=n().createMetadataHelper("design:typeinfo",t.createObjectLiteralExpression(i,true));return[t.createDecorator(e)]}}}function shouldAddTypeMetadata(e){const t=e.kind;return t===174||t===177||t===178||t===172}function shouldAddReturnTypeMetadata(e){return e.kind===174}function shouldAddParamTypesMetadata(e){switch(e.kind){case 263:case 231:return getFirstConstructorWithBody(e)!==void 0;case 174:case 177:case 178:return true}return false}function getExpressionForPropertyName(e,n){const r=e.name;if(isPrivateIdentifier(r)){return t.createIdentifier("")}else if(isComputedPropertyName(r)){return n&&!isSimpleInlineableExpression(r.expression)?t.getGeneratedNameForNode(r):r.expression}else if(isIdentifier(r)){return t.createStringLiteral(idText(r))}else{return t.cloneNode(r)}}function visitPropertyNameOfClassElement(e){const n=e.name;if(p&&isComputedPropertyName(n)&&hasDecorators(e)){const e=visitNode(n.expression,visitor,isExpression);S.assert(e);const r=skipPartiallyEmittedExpressions(e);if(!isSimpleInlineableExpression(r)){const r=t.getGeneratedNameForNode(n);a(r);return t.updateComputedPropertyName(n,t.createAssignment(r,e))}}return S.checkDefined(visitNode(n,visitor,isPropertyName))}function visitHeritageClause(t){if(t.token===119){return void 0}return visitEachChild(t,visitor,e)}function visitExpressionWithTypeArguments(e){return t.updateExpressionWithTypeArguments(e,S.checkDefined(visitNode(e.expression,visitor,isLeftHandSideExpression)),void 0)}function shouldEmitFunctionLikeDeclaration(e){return!nodeIsMissing(e.body)}function visitPropertyDeclaration(e,n){const r=e.flags&33554432||hasSyntacticModifier(e,64);if(r&&!(p&&hasDecorators(e))){return void 0}let i=isClassLike(n)?!r?visitNodes2(e.modifiers,visitor,isModifierLike):visitNodes2(e.modifiers,modifierElidingVisitor,isModifierLike):visitNodes2(e.modifiers,decoratorElidingVisitor,isModifierLike);i=injectClassElementTypeMetadata(i,e,n);if(r){return t.updatePropertyDeclaration(e,concatenate(i,t.createModifiersFromModifierFlags(128)),S.checkDefined(visitNode(e.name,visitor,isPropertyName)),void 0,void 0,void 0)}return t.updatePropertyDeclaration(e,i,visitPropertyNameOfClassElement(e),void 0,void 0,visitNode(e.initializer,visitor,isExpression))}function visitConstructor(n){if(!shouldEmitFunctionLikeDeclaration(n)){return void 0}return t.updateConstructorDeclaration(n,void 0,visitParameterList(n.parameters,visitor,e),transformConstructorBody(n.body,n))}function transformConstructorBodyWorker(e,n,r,i,o,a){const s=i[o];const c=n[s];addRange(e,visitNodes2(n,visitor,isStatement,r,s-r));if(isTryStatement(c)){const n=[];transformConstructorBodyWorker(n,c.tryBlock.statements,0,i,o+1,a);const r=t.createNodeArray(n);setTextRange(r,c.tryBlock.statements);e.push(t.updateTryStatement(c,t.updateBlock(c.tryBlock,n),visitNode(c.catchClause,visitor,isCatchClause),visitNode(c.finallyBlock,visitor,isBlock)))}else{addRange(e,visitNodes2(n,visitor,isStatement,s,1));addRange(e,a)}addRange(e,visitNodes2(n,visitor,isStatement,s+1))}function transformConstructorBody(n,r){const a=r&&filter(r.parameters,(e=>isParameterPropertyDeclaration(e,r)));if(!some(a)){return visitFunctionBody(n,visitor,e)}let s=[];i();const c=t.copyPrologue(n.statements,s,false,visitor);const l=findSuperStatementIndexPath(n.statements,c);const d=mapDefined(a,transformParameterWithPropertyAssignment);if(l.length){transformConstructorBodyWorker(s,n.statements,c,l,0,d)}else{addRange(s,d);addRange(s,visitNodes2(n.statements,visitor,isStatement,c))}s=t.mergeLexicalEnvironment(s,o());const p=t.createBlock(setTextRange(t.createNodeArray(s),n.statements),true);setTextRange(p,n);setOriginalNode(p,n);return p}function transformParameterWithPropertyAssignment(e){const n=e.name;if(!isIdentifier(n)){return void 0}const r=setParent(setTextRange(t.cloneNode(n),n),n.parent);setEmitFlags(r,3072|96);const i=setParent(setTextRange(t.cloneNode(n),n),n.parent);setEmitFlags(i,3072);return startOnNewLine(removeAllComments(setTextRange(setOriginalNode(t.createExpressionStatement(t.createAssignment(setTextRange(t.createPropertyAccessExpression(t.createThis(),r),e.name),i)),e),moveRangePos(e,-1))))}function visitMethodDeclaration(n,r){if(!(n.transformFlags&1)){return n}if(!shouldEmitFunctionLikeDeclaration(n)){return void 0}let i=isClassLike(r)?visitNodes2(n.modifiers,visitor,isModifierLike):visitNodes2(n.modifiers,decoratorElidingVisitor,isModifierLike);i=injectClassElementTypeMetadata(i,n,r);return t.updateMethodDeclaration(n,i,n.asteriskToken,visitPropertyNameOfClassElement(n),void 0,void 0,visitParameterList(n.parameters,visitor,e),void 0,visitFunctionBody(n.body,visitor,e))}function shouldEmitAccessorDeclaration(e){return!(nodeIsMissing(e.body)&&hasSyntacticModifier(e,64))}function visitGetAccessor(n,r){if(!(n.transformFlags&1)){return n}if(!shouldEmitAccessorDeclaration(n)){return void 0}let i=isClassLike(r)?visitNodes2(n.modifiers,visitor,isModifierLike):visitNodes2(n.modifiers,decoratorElidingVisitor,isModifierLike);i=injectClassElementTypeMetadata(i,n,r);return t.updateGetAccessorDeclaration(n,i,visitPropertyNameOfClassElement(n),visitParameterList(n.parameters,visitor,e),void 0,visitFunctionBody(n.body,visitor,e)||t.createBlock([]))}function visitSetAccessor(n,r){if(!(n.transformFlags&1)){return n}if(!shouldEmitAccessorDeclaration(n)){return void 0}let i=isClassLike(r)?visitNodes2(n.modifiers,visitor,isModifierLike):visitNodes2(n.modifiers,decoratorElidingVisitor,isModifierLike);i=injectClassElementTypeMetadata(i,n,r);return t.updateSetAccessorDeclaration(n,i,visitPropertyNameOfClassElement(n),visitParameterList(n.parameters,visitor,e),visitFunctionBody(n.body,visitor,e)||t.createBlock([]))}function visitFunctionDeclaration(n){if(!shouldEmitFunctionLikeDeclaration(n)){return t.createNotEmittedStatement(n)}const r=t.updateFunctionDeclaration(n,visitNodes2(n.modifiers,modifierVisitor,isModifier),n.asteriskToken,n.name,void 0,visitParameterList(n.parameters,visitor,e),void 0,visitFunctionBody(n.body,visitor,e)||t.createBlock([]));if(isExportOfNamespace(n)){const e=[r];addExportMemberAssignment(e,n);return e}return r}function visitFunctionExpression(n){if(!shouldEmitFunctionLikeDeclaration(n)){return t.createOmittedExpression()}const r=t.updateFunctionExpression(n,visitNodes2(n.modifiers,modifierVisitor,isModifier),n.asteriskToken,n.name,void 0,visitParameterList(n.parameters,visitor,e),void 0,visitFunctionBody(n.body,visitor,e)||t.createBlock([]));return r}function visitArrowFunction(n){const r=t.updateArrowFunction(n,visitNodes2(n.modifiers,modifierVisitor,isModifier),void 0,visitParameterList(n.parameters,visitor,e),void 0,n.equalsGreaterThanToken,visitFunctionBody(n.body,visitor,e));return r}function visitParameter(e){if(parameterIsThisKeyword(e)){return void 0}const n=t.updateParameterDeclaration(e,visitNodes2(e.modifiers,(e=>isDecorator(e)?visitor(e):void 0),isModifierLike),e.dotDotDotToken,S.checkDefined(visitNode(e.name,visitor,isBindingName)),void 0,void 0,visitNode(e.initializer,visitor,isExpression));if(n!==e){setCommentRange(n,e);setTextRange(n,moveRangePastModifiers(e));setSourceMapRange(n,moveRangePastModifiers(e));setEmitFlags(n.name,64)}return n}function visitVariableStatement(n){if(isExportOfNamespace(n)){const e=getInitializedVariables(n.declarationList);if(e.length===0){return void 0}return setTextRange(t.createExpressionStatement(t.inlineExpressions(map(e,transformInitializedVariable))),n)}else{return visitEachChild(n,visitor,e)}}function transformInitializedVariable(n){const r=n.name;if(isBindingPattern(r)){return flattenDestructuringAssignment(n,visitor,e,0,false,createNamespaceExportExpression)}else{return setTextRange(t.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(r),S.checkDefined(visitNode(n.initializer,visitor,isExpression))),n)}}function visitVariableDeclaration(e){const n=t.updateVariableDeclaration(e,S.checkDefined(visitNode(e.name,visitor,isBindingName)),void 0,void 0,visitNode(e.initializer,visitor,isExpression));if(e.type){setTypeNode(n.name,e.type)}return n}function visitParenthesizedExpression(n){const r=skipOuterExpressions(n.expression,~(38|16));if(isAssertionExpression(r)||isSatisfiesExpression(r)){const e=visitNode(n.expression,visitor,isExpression);S.assert(e);return t.createPartiallyEmittedExpression(e,n)}return visitEachChild(n,visitor,e)}function visitAssertionExpression(e){const n=visitNode(e.expression,visitor,isExpression);S.assert(n);return t.createPartiallyEmittedExpression(n,e)}function visitNonNullExpression(e){const n=visitNode(e.expression,visitor,isLeftHandSideExpression);S.assert(n);return t.createPartiallyEmittedExpression(n,e)}function visitSatisfiesExpression(e){const n=visitNode(e.expression,visitor,isExpression);S.assert(n);return t.createPartiallyEmittedExpression(n,e)}function visitCallExpression(e){return t.updateCallExpression(e,S.checkDefined(visitNode(e.expression,visitor,isExpression)),void 0,visitNodes2(e.arguments,visitor,isExpression))}function visitNewExpression(e){return t.updateNewExpression(e,S.checkDefined(visitNode(e.expression,visitor,isExpression)),void 0,visitNodes2(e.arguments,visitor,isExpression))}function visitTaggedTemplateExpression(e){return t.updateTaggedTemplateExpression(e,S.checkDefined(visitNode(e.tag,visitor,isExpression)),void 0,S.checkDefined(visitNode(e.template,visitor,isTemplateLiteral)))}function visitJsxSelfClosingElement(e){return t.updateJsxSelfClosingElement(e,S.checkDefined(visitNode(e.tagName,visitor,isJsxTagNameExpression)),void 0,S.checkDefined(visitNode(e.attributes,visitor,isJsxAttributes)))}function visitJsxJsxOpeningElement(e){return t.updateJsxOpeningElement(e,S.checkDefined(visitNode(e.tagName,visitor,isJsxTagNameExpression)),void 0,S.checkDefined(visitNode(e.attributes,visitor,isJsxAttributes)))}function shouldEmitEnumDeclaration(e){return!isEnumConst(e)||er(c)}function visitEnumDeclaration(e){if(!shouldEmitEnumDeclaration(e)){return t.createNotEmittedStatement(e)}const n=[];let r=4;const i=addVarForEnumOrModuleDeclaration(n,e);if(i){if(d!==4||h!==_){r|=1024}}const o=getNamespaceParameterName(e);const a=getNamespaceContainerName(e);const s=isExportOfNamespace(e)?t.getExternalModuleOrNamespaceExportName(y,e,false,true):t.getDeclarationName(e,false,true);let c=t.createLogicalOr(s,t.createAssignment(s,t.createObjectLiteralExpression()));if(isExportOfNamespace(e)){const n=t.getLocalName(e,false,true);c=t.createAssignment(n,c)}const l=t.createExpressionStatement(t.createCallExpression(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,o)],void 0,transformEnumBody(e,a)),void 0,[c]));setOriginalNode(l,e);if(i){setSyntheticLeadingComments(l,void 0);setSyntheticTrailingComments(l,void 0)}setTextRange(l,e);addEmitFlags(l,r);n.push(l);return n}function transformEnumBody(e,n){const i=y;y=n;const a=[];r();const s=map(e.members,transformEnumMember);insertStatementsAfterStandardPrologue(a,o());addRange(a,s);y=i;return t.createBlock(setTextRange(t.createNodeArray(a),e.members),true)}function transformEnumMember(e){const n=getExpressionForPropertyName(e,false);const r=s.getEnumMemberValue(e);const i=transformEnumMemberDeclarationValue(e,r==null?void 0:r.value);const o=t.createAssignment(t.createElementAccessExpression(y,n),i);const a=typeof(r==null?void 0:r.value)==="string"||(r==null?void 0:r.isSyntacticallyString)?o:t.createAssignment(t.createElementAccessExpression(y,o),n);return setTextRange(t.createExpressionStatement(setTextRange(a,e)),e)}function transformEnumMemberDeclarationValue(e,n){if(n!==void 0){return typeof n==="string"?t.createStringLiteral(n):n<0?t.createPrefixUnaryExpression(41,t.createNumericLiteral(-n)):t.createNumericLiteral(n)}else{enableSubstitutionForNonQualifiedEnumMembers();if(e.initializer){return S.checkDefined(visitNode(e.initializer,visitor,isExpression))}else{return t.createVoidZero()}}}function shouldEmitModuleDeclaration(e){const t=getParseTreeNode(e,isModuleDeclaration);if(!t){return true}return isInstantiatedModule(t,er(c))}function recordEmittedDeclarationInScope(e){if(!T){T=new Map}const t=declaredNameInScope(e);if(!T.has(t)){T.set(t,e)}}function isFirstEmittedDeclarationInScope(e){if(T){const t=declaredNameInScope(e);return T.get(t)===e}return true}function declaredNameInScope(e){S.assertNode(e.name,isIdentifier);return e.name.escapedText}function addVarForEnumOrModuleDeclaration(e,n){const r=t.createVariableDeclaration(t.getLocalName(n,false,true));const i=h.kind===307?0:1;const o=t.createVariableStatement(visitNodes2(n.modifiers,modifierVisitor,isModifier),t.createVariableDeclarationList([r],i));setOriginalNode(r,n);setSyntheticLeadingComments(r,void 0);setSyntheticTrailingComments(r,void 0);setOriginalNode(o,n);recordEmittedDeclarationInScope(n);if(isFirstEmittedDeclarationInScope(n)){if(n.kind===266){setSourceMapRange(o.declarationList,n)}else{setSourceMapRange(o,n)}setCommentRange(o,n);addEmitFlags(o,2048);e.push(o);return true}return false}function visitModuleDeclaration(e){if(!shouldEmitModuleDeclaration(e)){return t.createNotEmittedStatement(e)}S.assertNode(e.name,isIdentifier,"A TypeScript namespace should have an Identifier name.");enableSubstitutionForNamespaceExports();const n=[];let r=4;const i=addVarForEnumOrModuleDeclaration(n,e);if(i){if(d!==4||h!==_){r|=1024}}const o=getNamespaceParameterName(e);const a=getNamespaceContainerName(e);const s=isExportOfNamespace(e)?t.getExternalModuleOrNamespaceExportName(y,e,false,true):t.getDeclarationName(e,false,true);let c=t.createLogicalOr(s,t.createAssignment(s,t.createObjectLiteralExpression()));if(isExportOfNamespace(e)){const n=t.getLocalName(e,false,true);c=t.createAssignment(n,c)}const l=t.createExpressionStatement(t.createCallExpression(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,o)],void 0,transformModuleBody(e,a)),void 0,[c]));setOriginalNode(l,e);if(i){setSyntheticLeadingComments(l,void 0);setSyntheticTrailingComments(l,void 0)}setTextRange(l,e);addEmitFlags(l,r);n.push(l);return n}function transformModuleBody(e,n){const i=y;const a=g;const s=T;y=n;g=e;T=void 0;const c=[];r();let l;let d;if(e.body){if(e.body.kind===268){saveStateAndInvoke(e.body,(e=>addRange(c,visitNodes2(e.statements,namespaceElementVisitor,isStatement))));l=e.body.statements;d=e.body}else{const t=visitModuleDeclaration(e.body);if(t){if(isArray(t)){addRange(c,t)}else{c.push(t)}}const n=getInnerMostModuleDeclarationFromDottedModule(e).body;l=moveRangePos(n.statements,-1)}}insertStatementsAfterStandardPrologue(c,o());y=i;g=a;T=s;const p=t.createBlock(setTextRange(t.createNodeArray(c),l),true);setTextRange(p,d);if(!e.body||e.body.kind!==268){setEmitFlags(p,getEmitFlags(p)|3072)}return p}function getInnerMostModuleDeclarationFromDottedModule(e){if(e.body.kind===267){const t=getInnerMostModuleDeclarationFromDottedModule(e.body);return t||e.body}}function visitImportDeclaration(e){if(!e.importClause){return e}if(e.importClause.isTypeOnly){return void 0}const n=visitNode(e.importClause,visitImportClause,isImportClause);return n?t.updateImportDeclaration(e,void 0,n,e.moduleSpecifier,e.attributes):void 0}function visitImportClause(e){S.assert(!e.isTypeOnly);const n=shouldEmitAliasDeclaration(e)?e.name:void 0;const r=visitNode(e.namedBindings,visitNamedImportBindings,isNamedImportBindings);return n||r?t.updateImportClause(e,false,n,r):void 0}function visitNamedImportBindings(e){if(e.kind===274){return shouldEmitAliasDeclaration(e)?e:void 0}else{const n=c.verbatimModuleSyntax;const r=visitNodes2(e.elements,visitImportSpecifier,isImportSpecifier);return n||some(r)?t.updateNamedImports(e,r):void 0}}function visitImportSpecifier(e){return!e.isTypeOnly&&shouldEmitAliasDeclaration(e)?e:void 0}function visitExportAssignment(t){return c.verbatimModuleSyntax||s.isValueAliasDeclaration(t)?visitEachChild(t,visitor,e):void 0}function visitExportDeclaration(e){if(e.isTypeOnly){return void 0}if(!e.exportClause||isNamespaceExport(e.exportClause)){return t.updateExportDeclaration(e,e.modifiers,e.isTypeOnly,e.exportClause,e.moduleSpecifier,e.attributes)}const n=!!c.verbatimModuleSyntax;const r=visitNode(e.exportClause,(e=>visitNamedExportBindings(e,n)),isNamedExportBindings);return r?t.updateExportDeclaration(e,void 0,e.isTypeOnly,r,e.moduleSpecifier,e.attributes):void 0}function visitNamedExports(e,n){const r=visitNodes2(e.elements,visitExportSpecifier,isExportSpecifier);return n||some(r)?t.updateNamedExports(e,r):void 0}function visitNamespaceExports(e){return t.updateNamespaceExport(e,S.checkDefined(visitNode(e.name,visitor,isIdentifier)))}function visitNamedExportBindings(e,t){return isNamespaceExport(e)?visitNamespaceExports(e):visitNamedExports(e,t)}function visitExportSpecifier(e){return!e.isTypeOnly&&(c.verbatimModuleSyntax||s.isValueAliasDeclaration(e))?e:void 0}function shouldEmitImportEqualsDeclaration(e){return shouldEmitAliasDeclaration(e)||!isExternalModule(_)&&s.isTopLevelValueImportEqualsWithEntityName(e)}function visitImportEqualsDeclaration(n){if(n.isTypeOnly){return void 0}if(isExternalModuleImportEqualsDeclaration(n)){if(!shouldEmitAliasDeclaration(n)){return void 0}return visitEachChild(n,visitor,e)}if(!shouldEmitImportEqualsDeclaration(n)){return void 0}const r=createExpressionFromEntityName(t,n.moduleReference);setEmitFlags(r,3072|4096);if(isNamedExternalModuleExport(n)||!isExportOfNamespace(n)){return setOriginalNode(setTextRange(t.createVariableStatement(visitNodes2(n.modifiers,modifierVisitor,isModifier),t.createVariableDeclarationList([setOriginalNode(t.createVariableDeclaration(n.name,void 0,void 0,r),n)])),n),n)}else{return setOriginalNode(createNamespaceExport(n.name,r,n),n)}}function isExportOfNamespace(e){return g!==void 0&&hasSyntacticModifier(e,32)}function isExternalModuleExport(e){return g===void 0&&hasSyntacticModifier(e,32)}function isNamedExternalModuleExport(e){return isExternalModuleExport(e)&&!hasSyntacticModifier(e,2048)}function isDefaultExternalModuleExport(e){return isExternalModuleExport(e)&&hasSyntacticModifier(e,2048)}function createExportMemberAssignmentStatement(e){const n=t.createAssignment(t.getExternalModuleOrNamespaceExportName(y,e,false,true),t.getLocalName(e));setSourceMapRange(n,createRange(e.name?e.name.pos:e.pos,e.end));const r=t.createExpressionStatement(n);setSourceMapRange(r,createRange(-1,e.end));return r}function addExportMemberAssignment(e,t){e.push(createExportMemberAssignmentStatement(t))}function createNamespaceExport(e,n,r){return setTextRange(t.createExpressionStatement(t.createAssignment(t.getNamespaceMemberName(y,e,false,true),n)),r)}function createNamespaceExportExpression(e,n,r){return setTextRange(t.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(e),n),r)}function getNamespaceMemberNameWithSourceMapsAndWithoutComments(e){return t.getNamespaceMemberName(y,e,false,true)}function getNamespaceParameterName(e){const n=t.getGeneratedNameForNode(e);setSourceMapRange(n,e.name);return n}function getNamespaceContainerName(e){return t.getGeneratedNameForNode(e)}function enableSubstitutionForNonQualifiedEnumMembers(){if((v&8)===0){v|=8;e.enableSubstitution(80)}}function enableSubstitutionForNamespaceExports(){if((v&2)===0){v|=2;e.enableSubstitution(80);e.enableSubstitution(304);e.enableEmitNotification(267)}}function isTransformedModuleDeclaration(e){return getOriginalNode(e).kind===267}function isTransformedEnumDeclaration(e){return getOriginalNode(e).kind===266}function onEmitNode(e,t,n){const r=x;const i=_;if(isSourceFile(t)){_=t}if(v&2&&isTransformedModuleDeclaration(t)){x|=2}if(v&8&&isTransformedEnumDeclaration(t)){x|=8}f(e,t,n);x=r;_=i}function onSubstituteNode(e,t){t=m(e,t);if(e===1){return substituteExpression(t)}else if(isShorthandPropertyAssignment(t)){return substituteShorthandPropertyAssignment(t)}return t}function substituteShorthandPropertyAssignment(e){if(v&2){const n=e.name;const r=trySubstituteNamespaceExportedName(n);if(r){if(e.objectAssignmentInitializer){const i=t.createAssignment(r,e.objectAssignmentInitializer);return setTextRange(t.createPropertyAssignment(n,i),e)}return setTextRange(t.createPropertyAssignment(n,r),e)}}return e}function substituteExpression(e){switch(e.kind){case 80:return substituteExpressionIdentifier(e);case 211:return substitutePropertyAccessExpression(e);case 212:return substituteElementAccessExpression(e)}return e}function substituteExpressionIdentifier(e){return trySubstituteNamespaceExportedName(e)||e}function trySubstituteNamespaceExportedName(e){if(v&x&&!isGeneratedIdentifier(e)&&!isLocalName(e)){const n=s.getReferencedExportContainer(e,false);if(n&&n.kind!==307){const r=x&2&&n.kind===267||x&8&&n.kind===266;if(r){return setTextRange(t.createPropertyAccessExpression(t.getGeneratedNameForNode(n),e),e)}}}return void 0}function substitutePropertyAccessExpression(e){return substituteConstantValue(e)}function substituteElementAccessExpression(e){return substituteConstantValue(e)}function safeMultiLineComment(e){return e.replace(/\*\//g,"*_/")}function substituteConstantValue(e){const n=tryGetConstEnumValue(e);if(n!==void 0){setConstantValue(e,n);const r=typeof n==="string"?t.createStringLiteral(n):n<0?t.createPrefixUnaryExpression(41,t.createNumericLiteral(-n)):t.createNumericLiteral(n);if(!c.removeComments){const t=getOriginalNode(e,isAccessExpression);addSyntheticTrailingComment(r,3,` ${safeMultiLineComment(getTextOfNode(t))} `)}return r}return e}function tryGetConstEnumValue(e){if(Gn(c)){return void 0}return isPropertyAccessExpression(e)||isElementAccessExpression(e)?s.getConstantValue(e):void 0}function shouldEmitAliasDeclaration(e){return c.verbatimModuleSyntax||isInJSFile(e)||s.isReferencedAliasDeclaration(e)}}function transformClassFields(e){const{factory:t,getEmitHelperFactory:n,hoistVariableDeclaration:r,endLexicalEnvironment:i,startLexicalEnvironment:o,resumeLexicalEnvironment:a,addBlockScopedVariable:s}=e;const c=e.getEmitResolver();const l=e.getCompilerOptions();const d=zn(l);const p=ir(l);const u=!!l.experimentalDecorators;const f=!p;const m=p&&d<9;const _=f||m;const g=d<9;const y=d<99?-1:!p?3:0;const h=d<9;const T=h&&d>=2;const v=_||g||y===-1;const x=e.onSubstituteNode;e.onSubstituteNode=onSubstituteNode;const b=e.onEmitNode;e.onEmitNode=onEmitNode;let C=false;let E=0;let N;let k;let F;let P;const D=new Map;const I=new Set;let A;let O;let w=false;let L=false;return chainBundle(e,transformSourceFile);function transformSourceFile(t){if(t.isDeclarationFile){return t}P=void 0;C=!!(getInternalEmitFlags(t)&32);if(!v&&!C){return t}const n=visitEachChild(t,visitor,e);addEmitHelpers(n,e.readEmitHelpers());return n}function modifierVisitor(e){switch(e.kind){case 129:return shouldTransformAutoAccessorsInCurrentClass()?void 0:e;default:return tryCast(e,isModifier)}}function visitor(e){if(!(e.transformFlags&16777216)&&!(e.transformFlags&134234112)){return e}switch(e.kind){case 263:return visitClassDeclaration(e);case 231:return visitClassExpression(e);case 175:case 172:return S.fail("Use `classElementVisitor` instead.");case 303:return visitPropertyAssignment(e);case 243:return visitVariableStatement(e);case 260:return visitVariableDeclaration(e);case 169:return visitParameterDeclaration(e);case 208:return visitBindingElement(e);case 277:return visitExportAssignment(e);case 81:return visitPrivateIdentifier(e);case 211:return visitPropertyAccessExpression(e);case 212:return visitElementAccessExpression(e);case 224:case 225:return visitPreOrPostfixUnaryExpression(e,false);case 226:return visitBinaryExpression(e,false);case 217:return visitParenthesizedExpression(e,false);case 213:return visitCallExpression(e);case 244:return visitExpressionStatement(e);case 215:return visitTaggedTemplateExpression(e);case 248:return visitForStatement(e);case 110:return visitThisExpression(e);case 262:case 218:return setCurrentClassElementAnd(void 0,fallbackVisitor,e);case 176:case 174:case 177:case 178:{return setCurrentClassElementAnd(e,fallbackVisitor,e)}default:return fallbackVisitor(e)}}function fallbackVisitor(t){return visitEachChild(t,visitor,e)}function discardedValueVisitor(e){switch(e.kind){case 224:case 225:return visitPreOrPostfixUnaryExpression(e,true);case 226:return visitBinaryExpression(e,true);case 356:return visitCommaListExpression(e,true);case 217:return visitParenthesizedExpression(e,true);default:return visitor(e)}}function heritageClauseVisitor(t){switch(t.kind){case 298:return visitEachChild(t,heritageClauseVisitor,e);case 233:return visitExpressionWithTypeArgumentsInHeritageClause(t);default:return visitor(t)}}function assignmentTargetVisitor(e){switch(e.kind){case 210:case 209:return visitAssignmentPattern(e);default:return visitor(e)}}function classElementVisitor(e){switch(e.kind){case 176:return setCurrentClassElementAnd(e,visitConstructorDeclaration,e);case 177:case 178:case 174:return setCurrentClassElementAnd(e,visitMethodOrAccessorDeclaration,e);case 172:return setCurrentClassElementAnd(e,visitPropertyDeclaration,e);case 175:return setCurrentClassElementAnd(e,visitClassStaticBlockDeclaration,e);case 167:return visitComputedPropertyName(e);case 240:return e;default:return isModifierLike(e)?modifierVisitor(e):visitor(e)}}function propertyNameVisitor(e){switch(e.kind){case 167:return visitComputedPropertyName(e);default:return visitor(e)}}function accessorFieldResultVisitor(e){switch(e.kind){case 172:return transformFieldInitializer(e);case 177:case 178:return classElementVisitor(e);default:S.assertMissingNode(e,"Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration");break}}function visitPrivateIdentifier(e){if(!g){return e}if(isStatement(e.parent)){return e}return setOriginalNode(t.createIdentifier(""),e)}function transformPrivateIdentifierInInExpression(t){const r=accessPrivateIdentifier2(t.left);if(r){const e=visitNode(t.right,visitor,isExpression);return setOriginalNode(n().createClassPrivateFieldInHelper(r.brandCheckIdentifier,e),t)}return visitEachChild(t,visitor,e)}function visitPropertyAssignment(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t)}return visitEachChild(t,visitor,e)}function visitVariableStatement(t){const n=F;F=[];const r=visitEachChild(t,visitor,e);const i=some(F)?[r,...F]:r;F=n;return i}function visitVariableDeclaration(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t)}return visitEachChild(t,visitor,e)}function visitParameterDeclaration(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t)}return visitEachChild(t,visitor,e)}function visitBindingElement(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t)}return visitEachChild(t,visitor,e)}function visitExportAssignment(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t,true,t.isExportEquals?"":"default")}return visitEachChild(t,visitor,e)}function injectPendingExpressions(e){if(some(k)){if(isParenthesizedExpression(e)){k.push(e.expression);e=t.updateParenthesizedExpression(e,t.inlineExpressions(k))}else{k.push(e);e=t.inlineExpressions(k)}k=void 0}return e}function visitComputedPropertyName(e){const n=visitNode(e.expression,visitor,isExpression);return t.updateComputedPropertyName(e,injectPendingExpressions(n))}function visitConstructorDeclaration(e){if(A){return transformConstructor(e,A)}return fallbackVisitor(e)}function shouldTransformClassElementToWeakMap(e){if(g)return true;if(hasStaticModifier(e)&&getInternalEmitFlags(e)&32)return true;return false}function visitMethodOrAccessorDeclaration(n){S.assert(!hasDecorators(n));if(!isPrivateIdentifierClassElementDeclaration(n)||!shouldTransformClassElementToWeakMap(n)){return visitEachChild(n,classElementVisitor,e)}const r=accessPrivateIdentifier2(n.name);S.assert(r,"Undeclared private name for property declaration.");if(!r.isValid){return n}const i=getHoistedFunctionName(n);if(i){getPendingExpressions().push(t.createAssignment(i,t.createFunctionExpression(filter(n.modifiers,(e=>isModifier(e)&&!isStaticModifier(e)&&!isAccessorModifier(e))),n.asteriskToken,i,void 0,visitParameterList(n.parameters,visitor,e),void 0,visitFunctionBody(n.body,visitor,e))))}return void 0}function setCurrentClassElementAnd(e,t,n){if(e!==O){const r=O;O=e;const i=t(n);O=r;return i}return t(n)}function getHoistedFunctionName(e){S.assert(isPrivateIdentifier(e.name));const t=accessPrivateIdentifier2(e.name);S.assert(t,"Undeclared private name for property declaration.");if(t.kind==="m"){return t.methodName}if(t.kind==="a"){if(isGetAccessor(e)){return t.getterName}if(isSetAccessor(e)){return t.setterName}}}function tryGetClassThis(){const e=getClassLexicalEnvironment();return e.classThis??e.classConstructor??(A==null?void 0:A.name)}function transformAutoAccessor(e){const n=getCommentRange(e);const i=getSourceMapRange(e);const o=e.name;let a=o;let s=o;if(isComputedPropertyName(o)&&!isSimpleInlineableExpression(o.expression)){const e=findComputedPropertyNameCacheAssignment(o);if(e){a=t.updateComputedPropertyName(o,visitNode(o.expression,visitor,isExpression));s=t.updateComputedPropertyName(o,e.left)}else{const e=t.createTempVariable(r);setSourceMapRange(e,o.expression);const n=visitNode(o.expression,visitor,isExpression);const i=t.createAssignment(e,n);setSourceMapRange(i,o.expression);a=t.updateComputedPropertyName(o,i);s=t.updateComputedPropertyName(o,e)}}const c=visitNodes2(e.modifiers,modifierVisitor,isModifier);const l=createAccessorPropertyBackingField(t,e,c,e.initializer);setOriginalNode(l,e);setEmitFlags(l,3072);setSourceMapRange(l,i);const d=isStatic(e)?tryGetClassThis()??t.createThis():t.createThis();const p=createAccessorPropertyGetRedirector(t,e,c,a,d);setOriginalNode(p,e);setCommentRange(p,n);setSourceMapRange(p,i);const u=t.createModifiersFromModifierFlags(modifiersToFlags(c));const f=createAccessorPropertySetRedirector(t,e,u,s,d);setOriginalNode(f,e);setEmitFlags(f,3072);setSourceMapRange(f,i);return visitArray([l,p,f],accessorFieldResultVisitor,isClassElement)}function transformPrivateFieldInitializer(n){if(shouldTransformClassElementToWeakMap(n)){const e=accessPrivateIdentifier2(n.name);S.assert(e,"Undeclared private name for property declaration.");if(!e.isValid){return n}if(e.isStatic&&!g){const e=transformPropertyOrClassStaticBlock(n,t.createThis());if(e){return t.createClassStaticBlockDeclaration(t.createBlock([e],true))}}return void 0}if(f&&!isStatic(n)&&(P==null?void 0:P.data)&&P.data.facts&16){return t.updatePropertyDeclaration(n,visitNodes2(n.modifiers,visitor,isModifierLike),n.name,void 0,void 0,void 0)}if(isNamedEvaluation(n,isAnonymousClassNeedingAssignedName)){n=transformNamedEvaluation(e,n)}return t.updatePropertyDeclaration(n,visitNodes2(n.modifiers,modifierVisitor,isModifier),visitNode(n.name,propertyNameVisitor,isPropertyName),void 0,void 0,visitNode(n.initializer,visitor,isExpression))}function transformPublicFieldInitializer(e){if(_&&!isAutoAccessorPropertyDeclaration(e)){const n=getPropertyNameExpressionIfNeeded(e.name,!!e.initializer||p);if(n){getPendingExpressions().push(...flattenCommaList(n))}if(isStatic(e)&&!g){const n=transformPropertyOrClassStaticBlock(e,t.createThis());if(n){const r=t.createClassStaticBlockDeclaration(t.createBlock([n]));setOriginalNode(r,e);setCommentRange(r,e);setCommentRange(n,{pos:-1,end:-1});setSyntheticLeadingComments(n,void 0);setSyntheticTrailingComments(n,void 0);return r}}return void 0}return t.updatePropertyDeclaration(e,visitNodes2(e.modifiers,modifierVisitor,isModifier),visitNode(e.name,propertyNameVisitor,isPropertyName),void 0,void 0,visitNode(e.initializer,visitor,isExpression))}function transformFieldInitializer(e){S.assert(!hasDecorators(e),"Decorators should already have been transformed and elided.");return isPrivateIdentifierClassElementDeclaration(e)?transformPrivateFieldInitializer(e):transformPublicFieldInitializer(e)}function shouldTransformAutoAccessorsInCurrentClass(){return y===-1||y===3&&!!(P==null?void 0:P.data)&&!!(P.data.facts&16)}function visitPropertyDeclaration(e){if(isAutoAccessorPropertyDeclaration(e)&&(shouldTransformAutoAccessorsInCurrentClass()||hasStaticModifier(e)&&getInternalEmitFlags(e)&32)){return transformAutoAccessor(e)}return transformFieldInitializer(e)}function shouldForceDynamicThis(){return!!O&&hasStaticModifier(O)&&isAccessor(O)&&isAutoAccessorPropertyDeclaration(getOriginalNode(O))}function ensureDynamicThisIfNeeded(e){if(shouldForceDynamicThis()){const t=skipOuterExpressions(e);if(t.kind===110){I.add(t)}}}function createPrivateIdentifierAccess(e,t){t=visitNode(t,visitor,isExpression);ensureDynamicThisIfNeeded(t);return createPrivateIdentifierAccessHelper(e,t)}function createPrivateIdentifierAccessHelper(e,t){setCommentRange(t,moveRangePos(t,-1));switch(e.kind){case"a":return n().createClassPrivateFieldGetHelper(t,e.brandCheckIdentifier,e.kind,e.getterName);case"m":return n().createClassPrivateFieldGetHelper(t,e.brandCheckIdentifier,e.kind,e.methodName);case"f":return n().createClassPrivateFieldGetHelper(t,e.brandCheckIdentifier,e.kind,e.isStatic?e.variableName:void 0);case"untransformed":return S.fail("Access helpers should not be created for untransformed private elements");default:S.assertNever(e,"Unknown private element type")}}function visitPropertyAccessExpression(n){if(isPrivateIdentifier(n.name)){const e=accessPrivateIdentifier2(n.name);if(e){return setTextRange(setOriginalNode(createPrivateIdentifierAccess(e,n.expression),n),n)}}if(T&&O&&isSuperProperty(n)&&isIdentifier(n.name)&&isStaticPropertyDeclarationOrClassStaticBlock(O)&&(P==null?void 0:P.data)){const{classConstructor:e,superClassReference:r,facts:i}=P.data;if(i&1){return visitInvalidSuperProperty(n)}if(e&&r){const i=t.createReflectGetCall(r,t.createStringLiteralFromNode(n.name),e);setOriginalNode(i,n.expression);setTextRange(i,n.expression);return i}}return visitEachChild(n,visitor,e)}function visitElementAccessExpression(n){if(T&&O&&isSuperProperty(n)&&isStaticPropertyDeclarationOrClassStaticBlock(O)&&(P==null?void 0:P.data)){const{classConstructor:e,superClassReference:r,facts:i}=P.data;if(i&1){return visitInvalidSuperProperty(n)}if(e&&r){const i=t.createReflectGetCall(r,visitNode(n.argumentExpression,visitor,isExpression),e);setOriginalNode(i,n.expression);setTextRange(i,n.expression);return i}}return visitEachChild(n,visitor,e)}function visitPreOrPostfixUnaryExpression(n,i){if(n.operator===46||n.operator===47){const e=skipParentheses(n.operand);if(isPrivateIdentifierPropertyAccessExpression(e)){let o;if(o=accessPrivateIdentifier2(e.name)){const a=visitNode(e.expression,visitor,isExpression);ensureDynamicThisIfNeeded(a);const{readExpression:s,initializeExpression:c}=createCopiableReceiverExpr(a);let l=createPrivateIdentifierAccess(o,s);const d=isPrefixUnaryExpression(n)||i?void 0:t.createTempVariable(r);l=expandPreOrPostfixIncrementOrDecrementExpression(t,n,l,r,d);l=createPrivateIdentifierAssignment(o,c||s,l,64);setOriginalNode(l,n);setTextRange(l,n);if(d){l=t.createComma(l,d);setTextRange(l,n)}return l}}else if(T&&O&&isSuperProperty(e)&&isStaticPropertyDeclarationOrClassStaticBlock(O)&&(P==null?void 0:P.data)){const{classConstructor:o,superClassReference:a,facts:s}=P.data;if(s&1){const r=visitInvalidSuperProperty(e);return isPrefixUnaryExpression(n)?t.updatePrefixUnaryExpression(n,r):t.updatePostfixUnaryExpression(n,r)}if(o&&a){let s;let c;if(isPropertyAccessExpression(e)){if(isIdentifier(e.name)){c=s=t.createStringLiteralFromNode(e.name)}}else{if(isSimpleInlineableExpression(e.argumentExpression)){c=s=e.argumentExpression}else{c=t.createTempVariable(r);s=t.createAssignment(c,visitNode(e.argumentExpression,visitor,isExpression))}}if(s&&c){let l=t.createReflectGetCall(a,c,o);setTextRange(l,e);const d=i?void 0:t.createTempVariable(r);l=expandPreOrPostfixIncrementOrDecrementExpression(t,n,l,r,d);l=t.createReflectSetCall(a,s,l,o);setOriginalNode(l,n);setTextRange(l,n);if(d){l=t.createComma(l,d);setTextRange(l,n)}return l}}}}return visitEachChild(n,visitor,e)}function visitForStatement(n){return t.updateForStatement(n,visitNode(n.initializer,discardedValueVisitor,isForInitializer),visitNode(n.condition,visitor,isExpression),visitNode(n.incrementor,discardedValueVisitor,isExpression),visitIterationBody(n.statement,visitor,e))}function visitExpressionStatement(e){return t.updateExpressionStatement(e,visitNode(e.expression,discardedValueVisitor,isExpression))}function createCopiableReceiverExpr(e){const n=nodeIsSynthesized(e)?e:t.cloneNode(e);if(e.kind===110&&I.has(e)){I.add(n)}if(isSimpleInlineableExpression(e)){return{readExpression:n,initializeExpression:void 0}}const i=t.createTempVariable(r);const o=t.createAssignment(i,n);return{readExpression:i,initializeExpression:o}}function visitCallExpression(n){var i;if(isPrivateIdentifierPropertyAccessExpression(n.expression)&&accessPrivateIdentifier2(n.expression.name)){const{thisArg:e,target:i}=t.createCallBinding(n.expression,r,d);if(isCallChain(n)){return t.updateCallChain(n,t.createPropertyAccessChain(visitNode(i,visitor,isExpression),n.questionDotToken,"call"),void 0,void 0,[visitNode(e,visitor,isExpression),...visitNodes2(n.arguments,visitor,isExpression)])}return t.updateCallExpression(n,t.createPropertyAccessExpression(visitNode(i,visitor,isExpression),"call"),void 0,[visitNode(e,visitor,isExpression),...visitNodes2(n.arguments,visitor,isExpression)])}if(T&&O&&isSuperProperty(n.expression)&&isStaticPropertyDeclarationOrClassStaticBlock(O)&&((i=P==null?void 0:P.data)==null?void 0:i.classConstructor)){const e=t.createFunctionCallCall(visitNode(n.expression,visitor,isExpression),P.data.classConstructor,visitNodes2(n.arguments,visitor,isExpression));setOriginalNode(e,n);setTextRange(e,n);return e}return visitEachChild(n,visitor,e)}function visitTaggedTemplateExpression(n){var i;if(isPrivateIdentifierPropertyAccessExpression(n.tag)&&accessPrivateIdentifier2(n.tag.name)){const{thisArg:e,target:i}=t.createCallBinding(n.tag,r,d);return t.updateTaggedTemplateExpression(n,t.createCallExpression(t.createPropertyAccessExpression(visitNode(i,visitor,isExpression),"bind"),void 0,[visitNode(e,visitor,isExpression)]),void 0,visitNode(n.template,visitor,isTemplateLiteral))}if(T&&O&&isSuperProperty(n.tag)&&isStaticPropertyDeclarationOrClassStaticBlock(O)&&((i=P==null?void 0:P.data)==null?void 0:i.classConstructor)){const e=t.createFunctionBindCall(visitNode(n.tag,visitor,isExpression),P.data.classConstructor,[]);setOriginalNode(e,n);setTextRange(e,n);return t.updateTaggedTemplateExpression(n,e,void 0,visitNode(n.template,visitor,isTemplateLiteral))}return visitEachChild(n,visitor,e)}function transformClassStaticBlockDeclaration(e){if(P){D.set(getOriginalNode(e),P)}if(g){if(isClassThisAssignmentBlock(e)){const t=visitNode(e.body.statements[0].expression,visitor,isExpression);if(isAssignmentExpression(t,true)&&t.left===t.right){return void 0}return t}if(isClassNamedEvaluationHelperBlock(e)){return visitNode(e.body.statements[0].expression,visitor,isExpression)}o();let n=setCurrentClassElementAnd(e,(e=>visitNodes2(e,visitor,isStatement)),e.body.statements);n=t.mergeLexicalEnvironment(n,i());const r=t.createImmediatelyInvokedArrowFunction(n);setOriginalNode(skipParentheses(r.expression),e);addEmitFlags(skipParentheses(r.expression),4);setOriginalNode(r,e);setTextRange(r,e);return r}}function isAnonymousClassNeedingAssignedName(e){if(isClassExpression(e)&&!e.name){const t=getStaticPropertiesAndClassStaticBlock(e);if(some(t,isClassNamedEvaluationHelperBlock)){return false}const n=(g||!!(getInternalEmitFlags(e)&&32))&&some(t,(e=>isClassStaticBlockDeclaration(e)||isPrivateIdentifierClassElementDeclaration(e)||_&&isInitializedProperty(e)));return n}return false}function visitBinaryExpression(n,i){if(isDestructuringAssignment(n)){const e=k;k=void 0;n=t.updateBinaryExpression(n,visitNode(n.left,assignmentTargetVisitor,isExpression),n.operatorToken,visitNode(n.right,visitor,isExpression));const r=some(k)?t.inlineExpressions(compact([...k,n])):n;k=e;return r}if(isAssignmentExpression(n)){if(isNamedEvaluation(n,isAnonymousClassNeedingAssignedName)){n=transformNamedEvaluation(e,n);S.assertNode(n,isAssignmentExpression)}const o=skipOuterExpressions(n.left,8|1);if(isPrivateIdentifierPropertyAccessExpression(o)){const e=accessPrivateIdentifier2(o.name);if(e){return setTextRange(setOriginalNode(createPrivateIdentifierAssignment(e,o.expression,n.right,n.operatorToken.kind),n),n)}}else if(T&&O&&isSuperProperty(n.left)&&isStaticPropertyDeclarationOrClassStaticBlock(O)&&(P==null?void 0:P.data)){const{classConstructor:e,superClassReference:o,facts:a}=P.data;if(a&1){return t.updateBinaryExpression(n,visitInvalidSuperProperty(n.left),n.operatorToken,visitNode(n.right,visitor,isExpression))}if(e&&o){let a=isElementAccessExpression(n.left)?visitNode(n.left.argumentExpression,visitor,isExpression):isIdentifier(n.left.name)?t.createStringLiteralFromNode(n.left.name):void 0;if(a){let s=visitNode(n.right,visitor,isExpression);if(isCompoundAssignment(n.operatorToken.kind)){let i=a;if(!isSimpleInlineableExpression(a)){i=t.createTempVariable(r);a=t.createAssignment(i,a)}const c=t.createReflectGetCall(o,i,e);setOriginalNode(c,n.left);setTextRange(c,n.left);s=t.createBinaryExpression(c,getNonAssignmentOperatorForCompoundAssignment(n.operatorToken.kind),s);setTextRange(s,n)}const c=i?void 0:t.createTempVariable(r);if(c){s=t.createAssignment(c,s);setTextRange(c,n)}s=t.createReflectSetCall(o,a,s,e);setOriginalNode(s,n);setTextRange(s,n);if(c){s=t.createComma(s,c);setTextRange(s,n)}return s}}}}if(isPrivateIdentifierInExpression(n)){return transformPrivateIdentifierInInExpression(n)}return visitEachChild(n,visitor,e)}function visitCommaListExpression(e,n){const r=n?visitCommaListElements(e.elements,discardedValueVisitor):visitCommaListElements(e.elements,visitor,discardedValueVisitor);return t.updateCommaListExpression(e,r)}function visitParenthesizedExpression(e,n){const r=n?discardedValueVisitor:visitor;const i=visitNode(e.expression,r,isExpression);return t.updateParenthesizedExpression(e,i)}function createPrivateIdentifierAssignment(e,r,i,o){r=visitNode(r,visitor,isExpression);i=visitNode(i,visitor,isExpression);ensureDynamicThisIfNeeded(r);if(isCompoundAssignment(o)){const{readExpression:n,initializeExpression:a}=createCopiableReceiverExpr(r);r=a||n;i=t.createBinaryExpression(createPrivateIdentifierAccessHelper(e,n),getNonAssignmentOperatorForCompoundAssignment(o),i)}setCommentRange(r,moveRangePos(r,-1));switch(e.kind){case"a":return n().createClassPrivateFieldSetHelper(r,e.brandCheckIdentifier,i,e.kind,e.setterName);case"m":return n().createClassPrivateFieldSetHelper(r,e.brandCheckIdentifier,i,e.kind,void 0);case"f":return n().createClassPrivateFieldSetHelper(r,e.brandCheckIdentifier,i,e.kind,e.isStatic?e.variableName:void 0);case"untransformed":return S.fail("Access helpers should not be created for untransformed private elements");default:S.assertNever(e,"Unknown private element type")}}function getPrivateInstanceMethodsAndAccessors(e){return filter(e.members,isNonStaticMethodOrAccessorWithPrivateName)}function getClassFacts(e){var t;let n=0;const r=getOriginalNode(e);if(isClassLike(r)&&classOrConstructorParameterIsDecorated(u,r)){n|=1}if(g&&(classHasClassThisAssignment(e)||classHasExplicitlyAssignedName(e))){n|=2}let i=false;let o=false;let a=false;let s=false;for(const r of e.members){if(isStatic(r)){if(r.name&&(isPrivateIdentifier(r.name)||isAutoAccessorPropertyDeclaration(r))&&g){n|=2}else if(isAutoAccessorPropertyDeclaration(r)&&y===-1&&!e.name&&!((t=e.emitNode)==null?void 0:t.classThis)){n|=2}if(isPropertyDeclaration(r)||isClassStaticBlockDeclaration(r)){if(h&&r.transformFlags&16384){n|=8;if(!(n&1)){n|=2}}if(T&&r.transformFlags&134217728){if(!(n&1)){n|=2|4}}}}else if(!hasAbstractModifier(getOriginalNode(r))){if(isAutoAccessorPropertyDeclaration(r)){s=true;a||(a=isPrivateIdentifierClassElementDeclaration(r))}else if(isPrivateIdentifierClassElementDeclaration(r)){a=true;if(c.hasNodeCheckFlag(r,262144)){n|=2}}else if(isPropertyDeclaration(r)){i=true;o||(o=!!r.initializer)}}}const l=m&&i||f&&o||g&&a||g&&s&&y===-1;if(l){n|=16}return n}function visitExpressionWithTypeArgumentsInHeritageClause(n){var i;const o=((i=P==null?void 0:P.data)==null?void 0:i.facts)||0;if(o&4){const e=t.createTempVariable(r,true);getClassLexicalEnvironment().superClassReference=e;return t.updateExpressionWithTypeArguments(n,t.createAssignment(e,visitNode(n.expression,visitor,isExpression)),void 0)}return visitEachChild(n,visitor,e)}function visitInNewClassLexicalEnvironment(e,n){var r;const i=A;const o=k;const a=P;A=e;k=void 0;startClassLexicalEnvironment();const s=getInternalEmitFlags(e)&32;if(g||s){const n=getNameOfDeclaration(e);if(n&&isIdentifier(n)){getPrivateIdentifierEnvironment().data.className=n}else if((r=e.emitNode)==null?void 0:r.assignedName){if(isStringLiteral(e.emitNode.assignedName)){if(e.emitNode.assignedName.textSourceNode&&isIdentifier(e.emitNode.assignedName.textSourceNode)){getPrivateIdentifierEnvironment().data.className=e.emitNode.assignedName.textSourceNode}else if(isIdentifierText(e.emitNode.assignedName.text,d)){const n=t.createIdentifier(e.emitNode.assignedName.text);getPrivateIdentifierEnvironment().data.className=n}}}}if(g){const t=getPrivateInstanceMethodsAndAccessors(e);if(some(t)){getPrivateIdentifierEnvironment().data.weakSetName=createHoistedVariableForClass("instances",t[0].name)}}const c=getClassFacts(e);if(c){getClassLexicalEnvironment().facts=c}if(c&8){enableSubstitutionForClassStaticThisOrSuperReference()}const l=n(e,c);endClassLexicalEnvironment();S.assert(P===a);A=i;k=o;return l}function visitClassDeclaration(e){return visitInNewClassLexicalEnvironment(e,visitClassDeclarationInNewClassLexicalEnvironment)}function visitClassDeclarationInNewClassLexicalEnvironment(e,n){var i,o;let a;if(n&2){if(g&&((i=e.emitNode)==null?void 0:i.classThis)){getClassLexicalEnvironment().classConstructor=e.emitNode.classThis;a=t.createAssignment(e.emitNode.classThis,t.getInternalName(e))}else{const n=t.createTempVariable(r,true);getClassLexicalEnvironment().classConstructor=t.cloneNode(n);a=t.createAssignment(n,t.getInternalName(e))}}if((o=e.emitNode)==null?void 0:o.classThis){getClassLexicalEnvironment().classThis=e.emitNode.classThis}const s=c.hasNodeCheckFlag(e,262144);const l=hasSyntacticModifier(e,32);const d=hasSyntacticModifier(e,2048);let p=visitNodes2(e.modifiers,modifierVisitor,isModifier);const u=visitNodes2(e.heritageClauses,heritageClauseVisitor,isHeritageClause);const{members:m,prologue:_}=transformClassMembers(e);const y=[];if(a){getPendingExpressions().unshift(a)}if(some(k)){y.push(t.createExpressionStatement(t.inlineExpressions(k)))}if(f||g||getInternalEmitFlags(e)&32){const n=getStaticPropertiesAndClassStaticBlock(e);if(some(n)){addPropertyOrClassStaticBlockStatements(y,n,t.getInternalName(e))}}if(y.length>0&&l&&d){p=visitNodes2(p,(e=>isExportOrDefaultModifier(e)?void 0:e),isModifier);y.push(t.createExportAssignment(void 0,false,t.getLocalName(e,false,true)))}const h=getClassLexicalEnvironment().classConstructor;if(s&&h){enableSubstitutionForClassAliases();N[getOriginalNodeId(e)]=h}const T=t.updateClassDeclaration(e,p,e.name,void 0,u,m);y.unshift(T);if(_){y.unshift(t.createExpressionStatement(_))}return y}function visitClassExpression(e){return visitInNewClassLexicalEnvironment(e,visitClassExpressionInNewClassLexicalEnvironment)}function visitClassExpressionInNewClassLexicalEnvironment(e,n){var i,o,a;const l=!!(n&1);const d=getStaticPropertiesAndClassStaticBlock(e);const p=c.hasNodeCheckFlag(e,262144);const u=c.hasNodeCheckFlag(e,32768);let f;function createClassTempVar(){var n;if(g&&((n=e.emitNode)==null?void 0:n.classThis)){return getClassLexicalEnvironment().classConstructor=e.emitNode.classThis}const i=t.createTempVariable(u?s:r,true);getClassLexicalEnvironment().classConstructor=t.cloneNode(i);return i}if((i=e.emitNode)==null?void 0:i.classThis){getClassLexicalEnvironment().classThis=e.emitNode.classThis}if(n&2){f??(f=createClassTempVar())}const m=visitNodes2(e.modifiers,modifierVisitor,isModifier);const y=visitNodes2(e.heritageClauses,heritageClauseVisitor,isHeritageClause);const{members:h,prologue:T}=transformClassMembers(e);const v=t.updateClassExpression(e,m,e.name,void 0,y,h);const x=[];if(T){x.push(T)}const b=(g||getInternalEmitFlags(e)&32)&&some(d,(e=>isClassStaticBlockDeclaration(e)||isPrivateIdentifierClassElementDeclaration(e)||_&&isInitializedProperty(e)));if(b||some(k)){if(l){S.assertIsDefined(F,"Decorated classes transformed by TypeScript are expected to be within a variable declaration.");if(some(k)){addRange(F,map(k,t.createExpressionStatement))}if(some(d)){addPropertyOrClassStaticBlockStatements(F,d,((o=e.emitNode)==null?void 0:o.classThis)??t.getInternalName(e))}if(f){x.push(t.createAssignment(f,v))}else if(g&&((a=e.emitNode)==null?void 0:a.classThis)){x.push(t.createAssignment(e.emitNode.classThis,v))}else{x.push(v)}}else{f??(f=createClassTempVar());if(p){enableSubstitutionForClassAliases();const n=t.cloneNode(f);n.emitNode.autoGenerate.flags&=~8;N[getOriginalNodeId(e)]=n}x.push(t.createAssignment(f,v));addRange(x,k);addRange(x,generateInitializedPropertyExpressionsOrClassStaticBlock(d,f));x.push(t.cloneNode(f))}}else{x.push(v)}if(x.length>1){addEmitFlags(v,131072);x.forEach(startOnNewLine)}return t.inlineExpressions(x)}function visitClassStaticBlockDeclaration(t){if(!g){return visitEachChild(t,visitor,e)}return void 0}function visitThisExpression(e){if(h&&O&&isClassStaticBlockDeclaration(O)&&(P==null?void 0:P.data)){const{classThis:t,classConstructor:n}=P.data;return t??n??e}return e}function transformClassMembers(e){const n=!!(getInternalEmitFlags(e)&32);if(g||C){for(const t of e.members){if(isPrivateIdentifierClassElementDeclaration(t)){if(shouldTransformClassElementToWeakMap(t)){addPrivateIdentifierToEnvironment(t,t.name,addPrivateIdentifierClassElementToEnvironment)}else{const e=getPrivateIdentifierEnvironment();setPrivateIdentifier(e,t.name,{kind:"untransformed"})}}}if(g){if(some(getPrivateInstanceMethodsAndAccessors(e))){createBrandCheckWeakSetForPrivateMethods()}}if(shouldTransformAutoAccessorsInCurrentClass()){for(const r of e.members){if(isAutoAccessorPropertyDeclaration(r)){const e=t.getGeneratedPrivateNameForNode(r.name,void 0,"_accessor_storage");if(g||n&&hasStaticModifier(r)){addPrivateIdentifierToEnvironment(r,e,addPrivateIdentifierPropertyDeclarationToEnvironment)}else{const t=getPrivateIdentifierEnvironment();setPrivateIdentifier(t,e,{kind:"untransformed"})}}}}}let i=visitNodes2(e.members,classElementVisitor,isClassElement);let o;if(!some(i,isConstructorDeclaration)){o=transformConstructor(void 0,e)}let a;let s;if(!g&&some(k)){let e=t.createExpressionStatement(t.inlineExpressions(k));if(e.transformFlags&134234112){const n=t.createTempVariable(r);const i=t.createArrowFunction(void 0,void 0,[],void 0,void 0,t.createBlock([e]));a=t.createAssignment(n,i);e=t.createExpressionStatement(t.createCallExpression(n,void 0,[]))}const n=t.createBlock([e]);s=t.createClassStaticBlockDeclaration(n);k=void 0}if(o||s){let n;const r=find(i,isClassThisAssignmentBlock);const a=find(i,isClassNamedEvaluationHelperBlock);n=append(n,r);n=append(n,a);n=append(n,o);n=append(n,s);const c=r||a?filter(i,(e=>e!==r&&e!==a)):i;n=addRange(n,c);i=setTextRange(t.createNodeArray(n),e.members)}return{members:i,prologue:a}}function createBrandCheckWeakSetForPrivateMethods(){const{weakSetName:e}=getPrivateIdentifierEnvironment().data;S.assert(e,"weakSetName should be set in private identifier environment");getPendingExpressions().push(t.createAssignment(e,t.createNewExpression(t.createIdentifier("WeakSet"),void 0,[])))}function transformConstructor(n,r){n=visitNode(n,visitor,isConstructorDeclaration);if(!(P==null?void 0:P.data)||!(P.data.facts&16)){return n}const i=getEffectiveBaseTypeNode(r);const o=!!(i&&skipOuterExpressions(i.expression).kind!==106);const a=visitParameterList(n?n.parameters:void 0,visitor,e);const s=transformConstructorBody(r,n,o);if(!s){return n}if(n){S.assert(a);return t.updateConstructorDeclaration(n,void 0,a,s)}return startOnNewLine(setOriginalNode(setTextRange(t.createConstructorDeclaration(void 0,a??[],s),n||r),n))}function transformConstructorBodyWorker(e,n,r,i,o,a,s){const c=i[o];const l=n[c];addRange(e,visitNodes2(n,visitor,isStatement,r,c-r));r=c+1;if(isTryStatement(l)){const n=[];transformConstructorBodyWorker(n,l.tryBlock.statements,0,i,o+1,a,s);const r=t.createNodeArray(n);setTextRange(r,l.tryBlock.statements);e.push(t.updateTryStatement(l,t.updateBlock(l.tryBlock,n),visitNode(l.catchClause,visitor,isCatchClause),visitNode(l.finallyBlock,visitor,isBlock)))}else{addRange(e,visitNodes2(n,visitor,isStatement,c,1));while(r!!e.initializer||isPrivateIdentifier(e.name)||hasAccessorModifier(e)))}const d=getPrivateInstanceMethodsAndAccessors(n);const u=some(l)||some(d);if(!r&&!u){return visitFunctionBody(void 0,visitor,e)}a();const f=!r&&o;let m=0;let _=[];const g=[];const y=t.createThis();addInstanceMethodStatements(g,d,y);if(r){const e=filter(c,(e=>isParameterPropertyDeclaration(getOriginalNode(e),r)));const t=filter(l,(e=>!isParameterPropertyDeclaration(getOriginalNode(e),r)));addPropertyOrClassStaticBlockStatements(g,e,y);addPropertyOrClassStaticBlockStatements(g,t,y)}else{addPropertyOrClassStaticBlockStatements(g,l,y)}if(r==null?void 0:r.body){m=t.copyPrologue(r.body.statements,_,false,visitor);const e=findSuperStatementIndexPath(r.body.statements,m);if(e.length){transformConstructorBodyWorker(_,r.body.statements,m,e,0,g,r)}else{while(m=_.length?r.body.multiLine??_.length>0:_.length>0;return setTextRange(t.createBlock(setTextRange(t.createNodeArray(_),((s=r==null?void 0:r.body)==null?void 0:s.statements)??n.members),h),r==null?void 0:r.body)}function addPropertyOrClassStaticBlockStatements(e,t,n){for(const r of t){if(isStatic(r)&&!g){continue}const t=transformPropertyOrClassStaticBlock(r,n);if(!t){continue}e.push(t)}}function transformPropertyOrClassStaticBlock(e,n){const r=isClassStaticBlockDeclaration(e)?setCurrentClassElementAnd(e,transformClassStaticBlockDeclaration,e):transformProperty(e,n);if(!r){return void 0}const i=t.createExpressionStatement(r);setOriginalNode(i,e);addEmitFlags(i,getEmitFlags(e)&3072);setCommentRange(i,e);const o=getOriginalNode(e);if(isParameter(o)){setSourceMapRange(i,o);removeAllComments(i)}else{setSourceMapRange(i,moveRangePastModifiers(e))}setSyntheticLeadingComments(r,void 0);setSyntheticTrailingComments(r,void 0);if(hasAccessorModifier(o)){addEmitFlags(i,3072)}return i}function generateInitializedPropertyExpressionsOrClassStaticBlock(e,t){const n=[];for(const r of e){const e=isClassStaticBlockDeclaration(r)?setCurrentClassElementAnd(r,transformClassStaticBlockDeclaration,r):setCurrentClassElementAnd(r,(()=>transformProperty(r,t)),void 0);if(!e){continue}startOnNewLine(e);setOriginalNode(e,r);addEmitFlags(e,getEmitFlags(r)&3072);setSourceMapRange(e,moveRangePastModifiers(r));setCommentRange(e,r);n.push(e)}return n}function transformProperty(e,t){var n;const r=O;const i=transformPropertyWorker(e,t);if(i&&hasStaticModifier(e)&&((n=P==null?void 0:P.data)==null?void 0:n.facts)){setOriginalNode(i,e);addEmitFlags(i,4);setSourceMapRange(i,getSourceMapRange(e.name));D.set(getOriginalNode(e),P)}O=r;return i}function transformPropertyWorker(n,r){const i=!p;if(isNamedEvaluation(n,isAnonymousClassNeedingAssignedName)){n=transformNamedEvaluation(e,n)}const o=hasAccessorModifier(n)?t.getGeneratedPrivateNameForNode(n.name):isComputedPropertyName(n.name)&&!isSimpleInlineableExpression(n.name.expression)?t.updateComputedPropertyName(n.name,t.getGeneratedNameForNode(n.name)):n.name;if(hasStaticModifier(n)){O=n}if(isPrivateIdentifier(o)&&shouldTransformClassElementToWeakMap(n)){const e=accessPrivateIdentifier2(o);if(e){if(e.kind==="f"){if(!e.isStatic){return createPrivateInstanceFieldInitializer(t,r,visitNode(n.initializer,visitor,isExpression),e.brandCheckIdentifier)}else{return createPrivateStaticFieldInitializer(t,e.variableName,visitNode(n.initializer,visitor,isExpression))}}else{return void 0}}else{S.fail("Undeclared private name for property declaration.")}}if((isPrivateIdentifier(o)||hasStaticModifier(n))&&!n.initializer){return void 0}const a=getOriginalNode(n);if(hasSyntacticModifier(a,64)){return void 0}let s=visitNode(n.initializer,visitor,isExpression);if(isParameterPropertyDeclaration(a,a.parent)&&isIdentifier(o)){const e=t.cloneNode(o);if(s){if(isParenthesizedExpression(s)&&isCommaExpression(s.expression)&&isCallToHelper(s.expression.left,"___runInitializers")&&isVoidExpression(s.expression.right)&&isNumericLiteral(s.expression.right.expression)){s=s.expression.left}s=t.inlineExpressions([s,e])}else{s=e}setEmitFlags(o,3072|96);setSourceMapRange(e,a.name);setEmitFlags(e,3072)}else{s??(s=t.createVoidZero())}if(i||isPrivateIdentifier(o)){const e=createMemberAccessForPropertyName(t,r,o,o);addEmitFlags(e,1024);const n=t.createAssignment(e,s);return n}else{const e=isComputedPropertyName(o)?o.expression:isIdentifier(o)?t.createStringLiteral(unescapeLeadingUnderscores(o.escapedText)):o;const n=t.createPropertyDescriptor({value:s,configurable:true,writable:true,enumerable:true});return t.createObjectDefinePropertyCall(r,e,n)}}function enableSubstitutionForClassAliases(){if((E&1)===0){E|=1;e.enableSubstitution(80);N=[]}}function enableSubstitutionForClassStaticThisOrSuperReference(){if((E&2)===0){E|=2;e.enableSubstitution(110);e.enableEmitNotification(262);e.enableEmitNotification(218);e.enableEmitNotification(176);e.enableEmitNotification(177);e.enableEmitNotification(178);e.enableEmitNotification(174);e.enableEmitNotification(172);e.enableEmitNotification(167)}}function addInstanceMethodStatements(e,n,r){if(!g||!some(n)){return}const{weakSetName:i}=getPrivateIdentifierEnvironment().data;S.assert(i,"weakSetName should be set in private identifier environment");e.push(t.createExpressionStatement(createPrivateInstanceMethodInitializer(t,r,i)))}function visitInvalidSuperProperty(e){return isPropertyAccessExpression(e)?t.updatePropertyAccessExpression(e,t.createVoidZero(),e.name):t.updateElementAccessExpression(e,t.createVoidZero(),visitNode(e.argumentExpression,visitor,isExpression))}function getPropertyNameExpressionIfNeeded(e,n){if(isComputedPropertyName(e)){const i=findComputedPropertyNameCacheAssignment(e);const o=visitNode(e.expression,visitor,isExpression);const a=skipPartiallyEmittedExpressions(o);const l=isSimpleInlineableExpression(a);const d=!!i||isAssignmentExpression(a)&&isGeneratedIdentifier(a.left);if(!d&&!l&&n){const n=t.getGeneratedNameForNode(e);if(c.hasNodeCheckFlag(e,32768)){s(n)}else{r(n)}return t.createAssignment(n,o)}return l||isIdentifier(a)?void 0:o}}function startClassLexicalEnvironment(){P={previous:P,data:void 0}}function endClassLexicalEnvironment(){P=P==null?void 0:P.previous}function getClassLexicalEnvironment(){S.assert(P);return P.data??(P.data={facts:0,classConstructor:void 0,classThis:void 0,superClassReference:void 0})}function getPrivateIdentifierEnvironment(){S.assert(P);return P.privateEnv??(P.privateEnv=newPrivateEnvironment({className:void 0,weakSetName:void 0}))}function getPendingExpressions(){return k??(k=[])}function addPrivateIdentifierClassElementToEnvironment(e,t,n,r,i,o,a){if(isAutoAccessorPropertyDeclaration(e)){addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(e,t,n,r,i,o,a)}else if(isPropertyDeclaration(e)){addPrivateIdentifierPropertyDeclarationToEnvironment(e,t,n,r,i,o,a)}else if(isMethodDeclaration(e)){addPrivateIdentifierMethodDeclarationToEnvironment(e,t,n,r,i,o,a)}else if(isGetAccessorDeclaration(e)){addPrivateIdentifierGetAccessorDeclarationToEnvironment(e,t,n,r,i,o,a)}else if(isSetAccessorDeclaration(e)){addPrivateIdentifierSetAccessorDeclarationToEnvironment(e,t,n,r,i,o,a)}}function addPrivateIdentifierPropertyDeclarationToEnvironment(e,n,r,i,o,a,s){if(o){const e=S.checkDefined(r.classThis??r.classConstructor,"classConstructor should be set in private identifier environment");const t=createHoistedVariableForPrivateName(n);setPrivateIdentifier(i,n,{kind:"f",isStatic:true,brandCheckIdentifier:e,variableName:t,isValid:a})}else{const e=createHoistedVariableForPrivateName(n);setPrivateIdentifier(i,n,{kind:"f",isStatic:false,brandCheckIdentifier:e,isValid:a});getPendingExpressions().push(t.createAssignment(e,t.createNewExpression(t.createIdentifier("WeakMap"),void 0,[])))}}function addPrivateIdentifierMethodDeclarationToEnvironment(e,t,n,r,i,o,a){const s=createHoistedVariableForPrivateName(t);const c=i?S.checkDefined(n.classThis??n.classConstructor,"classConstructor should be set in private identifier environment"):S.checkDefined(r.data.weakSetName,"weakSetName should be set in private identifier environment");setPrivateIdentifier(r,t,{kind:"m",methodName:s,brandCheckIdentifier:c,isStatic:i,isValid:o})}function addPrivateIdentifierGetAccessorDeclarationToEnvironment(e,t,n,r,i,o,a){const s=createHoistedVariableForPrivateName(t,"_get");const c=i?S.checkDefined(n.classThis??n.classConstructor,"classConstructor should be set in private identifier environment"):S.checkDefined(r.data.weakSetName,"weakSetName should be set in private identifier environment");if((a==null?void 0:a.kind)==="a"&&a.isStatic===i&&!a.getterName){a.getterName=s}else{setPrivateIdentifier(r,t,{kind:"a",getterName:s,setterName:void 0,brandCheckIdentifier:c,isStatic:i,isValid:o})}}function addPrivateIdentifierSetAccessorDeclarationToEnvironment(e,t,n,r,i,o,a){const s=createHoistedVariableForPrivateName(t,"_set");const c=i?S.checkDefined(n.classThis??n.classConstructor,"classConstructor should be set in private identifier environment"):S.checkDefined(r.data.weakSetName,"weakSetName should be set in private identifier environment");if((a==null?void 0:a.kind)==="a"&&a.isStatic===i&&!a.setterName){a.setterName=s}else{setPrivateIdentifier(r,t,{kind:"a",getterName:void 0,setterName:s,brandCheckIdentifier:c,isStatic:i,isValid:o})}}function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(e,t,n,r,i,o,a){const s=createHoistedVariableForPrivateName(t,"_get");const c=createHoistedVariableForPrivateName(t,"_set");const l=i?S.checkDefined(n.classThis??n.classConstructor,"classConstructor should be set in private identifier environment"):S.checkDefined(r.data.weakSetName,"weakSetName should be set in private identifier environment");setPrivateIdentifier(r,t,{kind:"a",getterName:s,setterName:c,brandCheckIdentifier:l,isStatic:i,isValid:o})}function addPrivateIdentifierToEnvironment(e,t,n){const r=getClassLexicalEnvironment();const i=getPrivateIdentifierEnvironment();const o=getPrivateIdentifier(i,t);const a=hasStaticModifier(e);const s=!isReservedPrivateName(t)&&o===void 0;n(e,t,r,i,a,s,o)}function createHoistedVariableForClass(e,n,i){const{className:o}=getPrivateIdentifierEnvironment().data;const a=o?{prefix:"_",node:o,suffix:"_"}:"_";const l=typeof e==="object"?t.getGeneratedNameForNode(e,16|8,a,i):typeof e==="string"?t.createUniqueName(e,16,a,i):t.createTempVariable(void 0,true,a,i);if(c.hasNodeCheckFlag(n,32768)){s(l)}else{r(l)}return l}function createHoistedVariableForPrivateName(e,t){const n=tryGetTextOfPropertyName(e);return createHoistedVariableForClass((n==null?void 0:n.substring(1))??e,e,t)}function accessPrivateIdentifier2(e){const t=accessPrivateIdentifier(P,e);return(t==null?void 0:t.kind)==="untransformed"?void 0:t}function wrapPrivateIdentifierForDestructuringTarget(n){const i=t.getGeneratedNameForNode(n);const o=accessPrivateIdentifier2(n.name);if(!o){return visitEachChild(n,visitor,e)}let a=n.expression;if(isThisProperty(n)||isSuperProperty(n)||!isSimpleCopiableExpression(n.expression)){a=t.createTempVariable(r,true);getPendingExpressions().push(t.createBinaryExpression(a,64,visitNode(n.expression,visitor,isExpression)))}return t.createAssignmentTargetWrapper(i,createPrivateIdentifierAssignment(o,a,i,64))}function visitDestructuringAssignmentTarget(n){if(isObjectLiteralExpression(n)||isArrayLiteralExpression(n)){return visitAssignmentPattern(n)}if(isPrivateIdentifierPropertyAccessExpression(n)){return wrapPrivateIdentifierForDestructuringTarget(n)}else if(T&&O&&isSuperProperty(n)&&isStaticPropertyDeclarationOrClassStaticBlock(O)&&(P==null?void 0:P.data)){const{classConstructor:e,superClassReference:r,facts:i}=P.data;if(i&1){return visitInvalidSuperProperty(n)}else if(e&&r){const i=isElementAccessExpression(n)?visitNode(n.argumentExpression,visitor,isExpression):isIdentifier(n.name)?t.createStringLiteralFromNode(n.name):void 0;if(i){const n=t.createTempVariable(void 0);return t.createAssignmentTargetWrapper(n,t.createReflectSetCall(r,i,n,e))}}}return visitEachChild(n,visitor,e)}function visitAssignmentElement(n){if(isNamedEvaluation(n,isAnonymousClassNeedingAssignedName)){n=transformNamedEvaluation(e,n)}if(isAssignmentExpression(n,true)){const e=visitDestructuringAssignmentTarget(n.left);const r=visitNode(n.right,visitor,isExpression);return t.updateBinaryExpression(n,e,n.operatorToken,r)}return visitDestructuringAssignmentTarget(n)}function visitAssignmentRestElement(n){if(isLeftHandSideExpression(n.expression)){const e=visitDestructuringAssignmentTarget(n.expression);return t.updateSpreadElement(n,e)}return visitEachChild(n,visitor,e)}function visitArrayAssignmentElement(t){if(isArrayBindingOrAssignmentElement(t)){if(isSpreadElement(t))return visitAssignmentRestElement(t);if(!isOmittedExpression(t))return visitAssignmentElement(t)}return visitEachChild(t,visitor,e)}function visitAssignmentProperty(n){const r=visitNode(n.name,visitor,isPropertyName);if(isAssignmentExpression(n.initializer,true)){const e=visitAssignmentElement(n.initializer);return t.updatePropertyAssignment(n,r,e)}if(isLeftHandSideExpression(n.initializer)){const e=visitDestructuringAssignmentTarget(n.initializer);return t.updatePropertyAssignment(n,r,e)}return visitEachChild(n,visitor,e)}function visitShorthandAssignmentProperty(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t)}return visitEachChild(t,visitor,e)}function visitAssignmentRestProperty(n){if(isLeftHandSideExpression(n.expression)){const e=visitDestructuringAssignmentTarget(n.expression);return t.updateSpreadAssignment(n,e)}return visitEachChild(n,visitor,e)}function visitObjectAssignmentElement(t){S.assertNode(t,isObjectBindingOrAssignmentElement);if(isSpreadAssignment(t))return visitAssignmentRestProperty(t);if(isShorthandPropertyAssignment(t))return visitShorthandAssignmentProperty(t);if(isPropertyAssignment(t))return visitAssignmentProperty(t);return visitEachChild(t,visitor,e)}function visitAssignmentPattern(e){if(isArrayLiteralExpression(e)){return t.updateArrayLiteralExpression(e,visitNodes2(e.elements,visitArrayAssignmentElement,isExpression))}else{return t.updateObjectLiteralExpression(e,visitNodes2(e.properties,visitObjectAssignmentElement,isObjectLiteralElementLike))}}function onEmitNode(e,t,n){const r=getOriginalNode(t);const i=D.get(r);if(i){const o=P;const a=L;P=i;L=w;w=!isClassStaticBlockDeclaration(r)||!(getInternalEmitFlags(r)&32);b(e,t,n);w=L;L=a;P=o;return}switch(t.kind){case 218:if(isArrowFunction(r)||getEmitFlags(t)&524288){break}case 262:case 176:case 177:case 178:case 174:case 172:{const r=P;const i=L;P=void 0;L=w;w=false;b(e,t,n);w=L;L=i;P=r;return}case 167:{const r=P;const i=w;P=P==null?void 0:P.previous;w=L;b(e,t,n);w=i;P=r;return}}b(e,t,n)}function onSubstituteNode(e,t){t=x(e,t);if(e===1){return substituteExpression(t)}return t}function substituteExpression(e){switch(e.kind){case 80:return substituteExpressionIdentifier(e);case 110:return substituteThisExpression(e)}return e}function substituteThisExpression(e){if(E&2&&(P==null?void 0:P.data)&&!I.has(e)){const{facts:n,classConstructor:r,classThis:i}=P.data;const o=w?i??r:r;if(o){return setTextRange(setOriginalNode(t.cloneNode(o),e),e)}if(n&1&&u){return t.createParenthesizedExpression(t.createVoidZero())}}return e}function substituteExpressionIdentifier(e){return trySubstituteClassAlias(e)||e}function trySubstituteClassAlias(e){if(E&1){if(c.hasNodeCheckFlag(e,536870912)){const n=c.getReferencedValueDeclaration(e);if(n){const r=N[n.id];if(r){const n=t.cloneNode(r);setSourceMapRange(n,e);setCommentRange(n,e);return n}}}}return void 0}}function createPrivateStaticFieldInitializer(e,t,n){return e.createAssignment(t,e.createObjectLiteralExpression([e.createPropertyAssignment("value",n||e.createVoidZero())]))}function createPrivateInstanceFieldInitializer(e,t,n,r){return e.createCallExpression(e.createPropertyAccessExpression(r,"set"),void 0,[t,n||e.createVoidZero()])}function createPrivateInstanceMethodInitializer(e,t,n){return e.createCallExpression(e.createPropertyAccessExpression(n,"add"),void 0,[t])}function isReservedPrivateName(e){return!isGeneratedPrivateIdentifier(e)&&e.escapedText==="#constructor"}function isPrivateIdentifierInExpression(e){return isPrivateIdentifier(e.left)&&e.operatorToken.kind===103}function isStaticPropertyDeclaration2(e){return isPropertyDeclaration(e)&&hasStaticModifier(e)}function isStaticPropertyDeclarationOrClassStaticBlock(e){return isClassStaticBlockDeclaration(e)||isStaticPropertyDeclaration2(e)}function createRuntimeTypeSerializer(e){const{factory:t,hoistVariableDeclaration:n}=e;const r=e.getEmitResolver();const i=e.getCompilerOptions();const o=zn(i);const a=getStrictOptionValue(i,"strictNullChecks");let s;let c;return{serializeTypeNode:(e,t)=>setSerializerContextAnd(e,serializeTypeNode,t),serializeTypeOfNode:(e,t,n)=>setSerializerContextAnd(e,serializeTypeOfNode,t,n),serializeParameterTypesOfNode:(e,t,n)=>setSerializerContextAnd(e,serializeParameterTypesOfNode,t,n),serializeReturnTypeOfNode:(e,t)=>setSerializerContextAnd(e,serializeReturnTypeOfNode,t)};function setSerializerContextAnd(e,t,n,r){const i=s;const o=c;s=e.currentLexicalScope;c=e.currentNameScope;const a=r===void 0?t(n):t(n,r);s=i;c=o;return a}function getAccessorTypeNode(e,t){const n=getAllAccessorDeclarations(t.members,e);return n.setAccessor&&getSetAccessorTypeAnnotationNode(n.setAccessor)||n.getAccessor&&getEffectiveReturnTypeNode(n.getAccessor)}function serializeTypeOfNode(e,n){switch(e.kind){case 172:case 169:return serializeTypeNode(e.type);case 178:case 177:return serializeTypeNode(getAccessorTypeNode(e,n));case 263:case 231:case 174:return t.createIdentifier("Function");default:return t.createVoidZero()}}function serializeParameterTypesOfNode(e,n){const r=isClassLike(e)?getFirstConstructorWithBody(e):isFunctionLike(e)&&nodeIsPresent(e.body)?e:void 0;const i=[];if(r){const e=getParametersOfDecoratedDeclaration(r,n);const t=e.length;for(let r=0;re.parent&&isConditionalTypeNode(e.parent)&&(e.parent.trueType===e||e.parent.falseType===e)))){return t.createIdentifier("Object")}const r=serializeEntityNameAsExpressionFallback(e.typeName);const o=t.createTempVariable(n);return t.createConditionalExpression(t.createTypeCheck(t.createAssignment(o,r),"function"),void 0,o,void 0,t.createIdentifier("Object"));case 1:return serializeEntityNameAsExpression(e.typeName);case 2:return t.createVoidZero();case 4:return getGlobalConstructor("BigInt",7);case 6:return t.createIdentifier("Boolean");case 3:return t.createIdentifier("Number");case 5:return t.createIdentifier("String");case 7:return t.createIdentifier("Array");case 8:return getGlobalConstructor("Symbol",2);case 10:return t.createIdentifier("Function");case 9:return t.createIdentifier("Promise");case 11:return t.createIdentifier("Object");default:return S.assertNever(i)}}function createCheckedValue(e,n){return t.createLogicalAnd(t.createStrictInequality(t.createTypeOfExpression(e),t.createStringLiteral("undefined")),n)}function serializeEntityNameAsExpressionFallback(e){if(e.kind===80){const t=serializeEntityNameAsExpression(e);return createCheckedValue(t,t)}if(e.left.kind===80){return createCheckedValue(serializeEntityNameAsExpression(e.left),serializeEntityNameAsExpression(e))}const r=serializeEntityNameAsExpressionFallback(e.left);const i=t.createTempVariable(n);return t.createLogicalAnd(t.createLogicalAnd(r.left,t.createStrictInequality(t.createAssignment(i,r.right),t.createVoidZero())),t.createPropertyAccessExpression(i,e.right))}function serializeEntityNameAsExpression(e){switch(e.kind){case 80:const t=setParent(setTextRange(wi.cloneNode(e),e),e.parent);t.original=void 0;setParent(t,getParseTreeNode(s));return t;case 166:return serializeQualifiedNameAsExpression(e)}}function serializeQualifiedNameAsExpression(e){return t.createPropertyAccessExpression(serializeEntityNameAsExpression(e.left),e.right)}function getGlobalConstructorWithFallback(e){return t.createConditionalExpression(t.createTypeCheck(t.createIdentifier(e),"function"),void 0,t.createIdentifier(e),void 0,t.createIdentifier("Object"))}function getGlobalConstructor(e,n){return oisExportOrDefaultModifier(e)||isDecorator(e)?void 0:e),isModifierLike);const s=moveRangePastModifiers(e);const c=getClassAliasIfNeeded(e);const l=a<2?t.getInternalName(e,false,true):t.getLocalName(e,false,true);const d=visitNodes2(e.heritageClauses,visitor,isHeritageClause);let p=visitNodes2(e.members,visitor,isClassElement);let u=[];({members:p,decorationStatements:u}=transformDecoratorsOfClassElements(e,p));const f=a>=9&&!!c&&some(p,(e=>isPropertyDeclaration(e)&&hasSyntacticModifier(e,256)||isClassStaticBlockDeclaration(e)));if(f){p=setTextRange(t.createNodeArray([t.createClassStaticBlockDeclaration(t.createBlock([t.createExpressionStatement(t.createAssignment(c,t.createThis()))])),...p]),p)}const m=t.createClassExpression(o,n&&isGeneratedIdentifier(n)?void 0:n,void 0,d,p);setOriginalNode(m,e);setTextRange(m,s);const _=c&&!f?t.createAssignment(c,m):m;const g=t.createVariableDeclaration(l,void 0,void 0,_);setOriginalNode(g,e);const y=t.createVariableDeclarationList([g],1);const h=t.createVariableStatement(void 0,y);setOriginalNode(h,e);setTextRange(h,s);setCommentRange(h,e);const T=[h];addRange(T,u);addConstructorDecorationStatement(T,e);if(r){if(i){const e=t.createExportDefault(l);T.push(e)}else{const n=t.createExternalModuleExport(t.getDeclarationName(e));T.push(n)}}return T}function visitClassExpression(e){return t.updateClassExpression(e,visitNodes2(e.modifiers,modifierVisitor,isModifier),e.name,void 0,visitNodes2(e.heritageClauses,visitor,isHeritageClause),visitNodes2(e.members,visitor,isClassElement))}function visitConstructorDeclaration(e){return t.updateConstructorDeclaration(e,visitNodes2(e.modifiers,modifierVisitor,isModifier),visitNodes2(e.parameters,visitor,isParameter),visitNode(e.body,visitor,isBlock))}function finishClassElement(e,t){if(e!==t){setCommentRange(e,t);setSourceMapRange(e,moveRangePastModifiers(t))}return e}function visitMethodDeclaration(e){return finishClassElement(t.updateMethodDeclaration(e,visitNodes2(e.modifiers,modifierVisitor,isModifier),e.asteriskToken,S.checkDefined(visitNode(e.name,visitor,isPropertyName)),void 0,void 0,visitNodes2(e.parameters,visitor,isParameter),void 0,visitNode(e.body,visitor,isBlock)),e)}function visitGetAccessorDeclaration(e){return finishClassElement(t.updateGetAccessorDeclaration(e,visitNodes2(e.modifiers,modifierVisitor,isModifier),S.checkDefined(visitNode(e.name,visitor,isPropertyName)),visitNodes2(e.parameters,visitor,isParameter),void 0,visitNode(e.body,visitor,isBlock)),e)}function visitSetAccessorDeclaration(e){return finishClassElement(t.updateSetAccessorDeclaration(e,visitNodes2(e.modifiers,modifierVisitor,isModifier),S.checkDefined(visitNode(e.name,visitor,isPropertyName)),visitNodes2(e.parameters,visitor,isParameter),visitNode(e.body,visitor,isBlock)),e)}function visitPropertyDeclaration(e){if(e.flags&33554432||hasSyntacticModifier(e,128)){return void 0}return finishClassElement(t.updatePropertyDeclaration(e,visitNodes2(e.modifiers,modifierVisitor,isModifier),S.checkDefined(visitNode(e.name,visitor,isPropertyName)),void 0,void 0,visitNode(e.initializer,visitor,isExpression)),e)}function visitParameterDeclaration(e){const n=t.updateParameterDeclaration(e,elideNodes(t,e.modifiers),e.dotDotDotToken,S.checkDefined(visitNode(e.name,visitor,isBindingName)),void 0,void 0,visitNode(e.initializer,visitor,isExpression));if(n!==e){setCommentRange(n,e);setTextRange(n,moveRangePastModifiers(e));setSourceMapRange(n,moveRangePastModifiers(e));setEmitFlags(n.name,64)}return n}function isSyntheticMetadataDecorator(e){return isCallToHelper(e.expression,"___metadata")}function transformAllDecoratorsOfDeclaration(e){if(!e){return void 0}const{false:t,true:n}=groupBy(e.decorators,isSyntheticMetadataDecorator);const r=[];addRange(r,map(t,transformDecorator));addRange(r,flatMap(e.parameters,transformDecoratorsOfParameter));addRange(r,map(n,transformDecorator));return r}function addClassElementDecorationStatements(e,n,r){addRange(e,map(generateClassElementDecorationExpressions(n,r),(e=>t.createExpressionStatement(e))))}function isDecoratedClassElement(e,t,n){return nodeOrChildIsDecorated(true,e,n)&&t===isStatic(e)}function getDecoratedClassElements(e,t){return filter(e.members,(n=>isDecoratedClassElement(n,t,e)))}function generateClassElementDecorationExpressions(e,t){const n=getDecoratedClassElements(e,t);let r;for(const t of n){r=append(r,generateClassElementDecorationExpression(e,t))}return r}function generateClassElementDecorationExpression(e,r){const i=getAllDecoratorsOfClassElement(r,e,true);const o=transformAllDecoratorsOfDeclaration(i);if(!o){return void 0}const a=getClassMemberPrefix(e,r);const s=getExpressionForPropertyName(r,!hasSyntacticModifier(r,128));const c=isPropertyDeclaration(r)&&!hasAccessorModifier(r)?t.createVoidZero():t.createNull();const l=n().createDecorateHelper(o,a,s,c);setEmitFlags(l,3072);setSourceMapRange(l,moveRangePastModifiers(r));return l}function addConstructorDecorationStatement(e,n){const r=generateConstructorDecorationExpression(n);if(r){e.push(setOriginalNode(t.createExpressionStatement(r),n))}}function generateConstructorDecorationExpression(e){const r=getAllDecoratorsOfClass(e,true);const i=transformAllDecoratorsOfDeclaration(r);if(!i){return void 0}const o=c&&c[getOriginalNodeId(e)];const s=a<2?t.getInternalName(e,false,true):t.getDeclarationName(e,false,true);const l=n().createDecorateHelper(i,s);const d=t.createAssignment(s,o?t.createAssignment(o,l):l);setEmitFlags(d,3072);setSourceMapRange(d,moveRangePastModifiers(e));return d}function transformDecorator(e){return S.checkDefined(visitNode(e.expression,visitor,isExpression))}function transformDecoratorsOfParameter(e,t){let r;if(e){r=[];for(const i of e){const e=n().createParamHelper(transformDecorator(i),t);setTextRange(e,i.expression);setEmitFlags(e,3072);r.push(e)}}return r}function getExpressionForPropertyName(e,n){const r=e.name;if(isPrivateIdentifier(r)){return t.createIdentifier("")}else if(isComputedPropertyName(r)){return n&&!isSimpleInlineableExpression(r.expression)?t.getGeneratedNameForNode(r):r.expression}else if(isIdentifier(r)){return t.createStringLiteral(idText(r))}else{return t.cloneNode(r)}}function enableSubstitutionForClassAliases(){if(!c){e.enableSubstitution(80);c=[]}}function getClassAliasIfNeeded(e){if(i.hasNodeCheckFlag(e,262144)){enableSubstitutionForClassAliases();const n=t.createUniqueName(e.name&&!isGeneratedIdentifier(e.name)?idText(e.name):"default");c[getOriginalNodeId(e)]=n;r(n);return n}}function getClassPrototype(e){return t.createPropertyAccessExpression(t.getDeclarationName(e),"prototype")}function getClassMemberPrefix(e,n){return isStatic(n)?t.getDeclarationName(e):getClassPrototype(e)}function onSubstituteNode(e,t){t=s(e,t);if(e===1){return substituteExpression(t)}return t}function substituteExpression(e){switch(e.kind){case 80:return substituteExpressionIdentifier(e)}return e}function substituteExpressionIdentifier(e){return trySubstituteClassAlias(e)??e}function trySubstituteClassAlias(e){if(c){if(i.hasNodeCheckFlag(e,536870912)){const n=i.getReferencedValueDeclaration(e);if(n){const r=c[n.id];if(r){const n=t.cloneNode(r);setSourceMapRange(n,e);setCommentRange(n,e);return n}}}}return void 0}}function transformESDecorators(e){const{factory:t,getEmitHelperFactory:n,startLexicalEnvironment:r,endLexicalEnvironment:i,hoistVariableDeclaration:o}=e;const a=zn(e.getCompilerOptions());let s;let c;let l;let d;let p;let u;return chainBundle(e,transformSourceFile);function transformSourceFile(t){s=void 0;u=false;const n=visitEachChild(t,visitor,e);addEmitHelpers(n,e.readEmitHelpers());if(u){addInternalEmitFlags(n,32);u=false}return n}function updateState(){c=void 0;l=void 0;d=void 0;switch(s==null?void 0:s.kind){case"class":c=s.classInfo;break;case"class-element":c=s.next.classInfo;l=s.classThis;d=s.classSuper;break;case"name":const e=s.next.next.next;if((e==null?void 0:e.kind)==="class-element"){c=e.next.classInfo;l=e.classThis;d=e.classSuper}break}}function enterClass(e){s={kind:"class",next:s,classInfo:e,savedPendingExpressions:p};p=void 0;updateState()}function exitClass(){S.assert((s==null?void 0:s.kind)==="class","Incorrect value for top.kind.",(()=>`Expected top.kind to be 'class' but got '${s==null?void 0:s.kind}' instead.`));p=s.savedPendingExpressions;s=s.next;updateState()}function enterClassElement(e){var t,n;S.assert((s==null?void 0:s.kind)==="class","Incorrect value for top.kind.",(()=>`Expected top.kind to be 'class' but got '${s==null?void 0:s.kind}' instead.`));s={kind:"class-element",next:s};if(isClassStaticBlockDeclaration(e)||isPropertyDeclaration(e)&&hasStaticModifier(e)){s.classThis=(t=s.next.classInfo)==null?void 0:t.classThis;s.classSuper=(n=s.next.classInfo)==null?void 0:n.classSuper}updateState()}function exitClassElement(){var e;S.assert((s==null?void 0:s.kind)==="class-element","Incorrect value for top.kind.",(()=>`Expected top.kind to be 'class-element' but got '${s==null?void 0:s.kind}' instead.`));S.assert(((e=s.next)==null?void 0:e.kind)==="class","Incorrect value for top.next.kind.",(()=>{var e;return`Expected top.next.kind to be 'class' but got '${(e=s.next)==null?void 0:e.kind}' instead.`}));s=s.next;updateState()}function enterName(){S.assert((s==null?void 0:s.kind)==="class-element","Incorrect value for top.kind.",(()=>`Expected top.kind to be 'class-element' but got '${s==null?void 0:s.kind}' instead.`));s={kind:"name",next:s};updateState()}function exitName(){S.assert((s==null?void 0:s.kind)==="name","Incorrect value for top.kind.",(()=>`Expected top.kind to be 'name' but got '${s==null?void 0:s.kind}' instead.`));s=s.next;updateState()}function enterOther(){if((s==null?void 0:s.kind)==="other"){S.assert(!p);s.depth++}else{s={kind:"other",next:s,depth:0,savedPendingExpressions:p};p=void 0;updateState()}}function exitOther(){S.assert((s==null?void 0:s.kind)==="other","Incorrect value for top.kind.",(()=>`Expected top.kind to be 'other' but got '${s==null?void 0:s.kind}' instead.`));if(s.depth>0){S.assert(!p);s.depth--}else{p=s.savedPendingExpressions;s=s.next;updateState()}}function shouldVisitNode(e){return!!(e.transformFlags&33554432)||!!l&&!!(e.transformFlags&16384)||!!l&&!!d&&!!(e.transformFlags&134217728)}function visitor(t){if(!shouldVisitNode(t)){return t}switch(t.kind){case 170:return S.fail("Use `modifierVisitor` instead.");case 263:return visitClassDeclaration(t);case 231:return visitClassExpression(t);case 176:case 172:case 175:return S.fail("Not supported outside of a class. Use 'classElementVisitor' instead.");case 169:return visitParameterDeclaration(t);case 226:return visitBinaryExpression(t,false);case 303:return visitPropertyAssignment(t);case 260:return visitVariableDeclaration(t);case 208:return visitBindingElement(t);case 277:return visitExportAssignment(t);case 110:return visitThisExpression(t);case 248:return visitForStatement(t);case 244:return visitExpressionStatement(t);case 356:return visitCommaListExpression(t,false);case 217:return visitParenthesizedExpression(t,false);case 355:return visitPartiallyEmittedExpression(t,false);case 213:return visitCallExpression(t);case 215:return visitTaggedTemplateExpression(t);case 224:case 225:return visitPreOrPostfixUnaryExpression(t,false);case 211:return visitPropertyAccessExpression(t);case 212:return visitElementAccessExpression(t);case 167:return visitComputedPropertyName(t);case 174:case 178:case 177:case 218:case 262:{enterOther();const n=visitEachChild(t,fallbackVisitor,e);exitOther();return n}default:return visitEachChild(t,fallbackVisitor,e)}}function fallbackVisitor(e){switch(e.kind){case 170:return void 0;default:return visitor(e)}}function modifierVisitor(e){switch(e.kind){case 170:return void 0;default:return e}}function classElementVisitor(e){switch(e.kind){case 176:return visitConstructorDeclaration(e);case 174:return visitMethodDeclaration(e);case 177:return visitGetAccessorDeclaration(e);case 178:return visitSetAccessorDeclaration(e);case 172:return visitPropertyDeclaration(e);case 175:return visitClassStaticBlockDeclaration(e);default:return visitor(e)}}function discardedValueVisitor(e){switch(e.kind){case 224:case 225:return visitPreOrPostfixUnaryExpression(e,true);case 226:return visitBinaryExpression(e,true);case 356:return visitCommaListExpression(e,true);case 217:return visitParenthesizedExpression(e,true);default:return visitor(e)}}function getHelperVariableName(e){let t=e.name&&isIdentifier(e.name)&&!isGeneratedIdentifier(e.name)?idText(e.name):e.name&&isPrivateIdentifier(e.name)&&!isGeneratedIdentifier(e.name)?idText(e.name).slice(1):e.name&&isStringLiteral(e.name)&&isIdentifierText(e.name.text,99)?e.name.text:isClassLike(e)?"class":"member";if(isGetAccessor(e))t=`get_${t}`;if(isSetAccessor(e))t=`set_${t}`;if(e.name&&isPrivateIdentifier(e.name))t=`private_${t}`;if(isStatic(e))t=`static_${t}`;return"_"+t}function createHelperVariable(e,n){return t.createUniqueName(`${getHelperVariableName(e)}_${n}`,16|8)}function createLet(e,n){return t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(e,void 0,void 0,n)],1))}function createClassInfo(e){const r=t.createUniqueName("_metadata",16|32);let i;let o;let a=false;let s=false;let c=false;let l;let d;let p;if(nodeIsDecorated(false,e)){const n=some(e.members,(e=>(isPrivateIdentifierClassElementDeclaration(e)||isAutoAccessorPropertyDeclaration(e))&&hasStaticModifier(e)));l=t.createUniqueName("_classThis",n?16|8:16|32)}for(const r of e.members){if(isMethodOrAccessor(r)&&nodeOrChildIsDecorated(false,r,e)){if(hasStaticModifier(r)){if(!o){o=t.createUniqueName("_staticExtraInitializers",16|32);const r=n().createRunInitializersHelper(l??t.createThis(),o);setSourceMapRange(r,e.name??moveRangePastDecorators(e));d??(d=[]);d.push(r)}}else{if(!i){i=t.createUniqueName("_instanceExtraInitializers",16|32);const r=n().createRunInitializersHelper(t.createThis(),i);setSourceMapRange(r,e.name??moveRangePastDecorators(e));p??(p=[]);p.push(r)}i??(i=t.createUniqueName("_instanceExtraInitializers",16|32))}}if(isClassStaticBlockDeclaration(r)){if(!isClassNamedEvaluationHelperBlock(r)){a=true}}else if(isPropertyDeclaration(r)){if(hasStaticModifier(r)){a||(a=!!r.initializer||hasDecorators(r))}else{s||(s=!isAmbientPropertyDeclaration(r))}}if((isPrivateIdentifierClassElementDeclaration(r)||isAutoAccessorPropertyDeclaration(r))&&hasStaticModifier(r)){c=true}if(o&&i&&a&&s&&c){break}}return{class:e,classThis:l,metadataReference:r,instanceMethodExtraInitializersName:i,staticMethodExtraInitializersName:o,hasStaticInitializers:a,hasNonAmbientInstanceFields:s,hasStaticPrivateClassElements:c,pendingStaticInitializers:d,pendingInstanceInitializers:p}}function transformClassLike(o){r();if(!classHasDeclaredOrExplicitlyAssignedName(o)&&classOrConstructorParameterIsDecorated(false,o)){o=injectClassNamedEvaluationHelperBlockIfMissing(e,o,t.createStringLiteral(""))}const a=t.getLocalName(o,false,false,true);const s=createClassInfo(o);const c=[];let l;let d;let f;let m;let _=false;const g=transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(o,false));if(g){s.classDecoratorsName=t.createUniqueName("_classDecorators",16|32);s.classDescriptorName=t.createUniqueName("_classDescriptor",16|32);s.classExtraInitializersName=t.createUniqueName("_classExtraInitializers",16|32);S.assertIsDefined(s.classThis);c.push(createLet(s.classDecoratorsName,t.createArrayLiteralExpression(g)),createLet(s.classDescriptorName),createLet(s.classExtraInitializersName,t.createArrayLiteralExpression()),createLet(s.classThis));if(s.hasStaticPrivateClassElements){_=true;u=true}}const y=getHeritageClause(o.heritageClauses,96);const h=y&&firstOrUndefined(y.types);const T=h&&visitNode(h.expression,visitor,isExpression);if(T){s.classSuper=t.createUniqueName("_classSuper",16|32);const e=skipOuterExpressions(T);const n=isClassExpression(e)&&!e.name||isFunctionExpression(e)&&!e.name||isArrowFunction(e)?t.createComma(t.createNumericLiteral(0),T):T;c.push(createLet(s.classSuper,n));const r=t.updateExpressionWithTypeArguments(h,s.classSuper,void 0);const i=t.updateHeritageClause(y,[r]);m=t.createNodeArray([i])}const v=s.classThis??t.createThis();enterClass(s);l=append(l,createMetadata(s.metadataReference,s.classSuper));let x=o.members;x=visitNodes2(x,(e=>isConstructorDeclaration(e)?e:classElementVisitor(e)),isClassElement);x=visitNodes2(x,(e=>isConstructorDeclaration(e)?classElementVisitor(e):e),isClassElement);if(p){let n;for(let r of p){r=visitNode(r,(function thisVisitor(r){if(!(r.transformFlags&16384)){return r}switch(r.kind){case 110:if(!n){n=t.createUniqueName("_outerThis",16);c.unshift(createLet(n,t.createThis()))}return n;default:return visitEachChild(r,thisVisitor,e)}}),isExpression);const i=t.createExpressionStatement(r);l=append(l,i)}p=void 0}exitClass();if(some(s.pendingInstanceInitializers)&&!getFirstConstructorWithBody(o)){const e=prepareConstructor(o,s);if(e){const n=getEffectiveBaseTypeNode(o);const r=!!(n&&skipOuterExpressions(n.expression).kind!==106);const i=[];if(r){const e=t.createSpreadElement(t.createIdentifier("arguments"));const n=t.createCallExpression(t.createSuper(),void 0,[e]);i.push(t.createExpressionStatement(n))}addRange(i,e);const a=t.createBlock(i,true);f=t.createConstructorDeclaration(void 0,[],a)}}if(s.staticMethodExtraInitializersName){c.push(createLet(s.staticMethodExtraInitializersName,t.createArrayLiteralExpression()))}if(s.instanceMethodExtraInitializersName){c.push(createLet(s.instanceMethodExtraInitializersName,t.createArrayLiteralExpression()))}if(s.memberInfos){forEachEntry(s.memberInfos,((e,n)=>{if(isStatic(n)){c.push(createLet(e.memberDecoratorsName));if(e.memberInitializersName){c.push(createLet(e.memberInitializersName,t.createArrayLiteralExpression()))}if(e.memberExtraInitializersName){c.push(createLet(e.memberExtraInitializersName,t.createArrayLiteralExpression()))}if(e.memberDescriptorName){c.push(createLet(e.memberDescriptorName))}}}))}if(s.memberInfos){forEachEntry(s.memberInfos,((e,n)=>{if(!isStatic(n)){c.push(createLet(e.memberDecoratorsName));if(e.memberInitializersName){c.push(createLet(e.memberInitializersName,t.createArrayLiteralExpression()))}if(e.memberExtraInitializersName){c.push(createLet(e.memberExtraInitializersName,t.createArrayLiteralExpression()))}if(e.memberDescriptorName){c.push(createLet(e.memberDescriptorName))}}}))}l=addRange(l,s.staticNonFieldDecorationStatements);l=addRange(l,s.nonStaticNonFieldDecorationStatements);l=addRange(l,s.staticFieldDecorationStatements);l=addRange(l,s.nonStaticFieldDecorationStatements);if(s.classDescriptorName&&s.classDecoratorsName&&s.classExtraInitializersName&&s.classThis){l??(l=[]);const e=t.createPropertyAssignment("value",v);const r=t.createObjectLiteralExpression([e]);const i=t.createAssignment(s.classDescriptorName,r);const c=t.createPropertyAccessExpression(v,"name");const d=n().createESDecorateHelper(t.createNull(),i,s.classDecoratorsName,{kind:"class",name:c,metadata:s.metadataReference},t.createNull(),s.classExtraInitializersName);const p=t.createExpressionStatement(d);setSourceMapRange(p,moveRangePastDecorators(o));l.push(p);const u=t.createPropertyAccessExpression(s.classDescriptorName,"value");const f=t.createAssignment(s.classThis,u);const m=t.createAssignment(a,f);l.push(t.createExpressionStatement(m))}l.push(createSymbolMetadata(v,s.metadataReference));if(some(s.pendingStaticInitializers)){for(const e of s.pendingStaticInitializers){const n=t.createExpressionStatement(e);setSourceMapRange(n,getSourceMapRange(e));d=append(d,n)}s.pendingStaticInitializers=void 0}if(s.classExtraInitializersName){const e=n().createRunInitializersHelper(v,s.classExtraInitializersName);const r=t.createExpressionStatement(e);setSourceMapRange(r,o.name??moveRangePastDecorators(o));d=append(d,r)}if(l&&d&&!s.hasStaticInitializers){addRange(l,d);d=void 0}const b=l&&t.createClassStaticBlockDeclaration(t.createBlock(l,true));if(b&&_){setInternalEmitFlags(b,32)}const C=d&&t.createClassStaticBlockDeclaration(t.createBlock(d,true));if(b||f||C){const e=[];const n=x.findIndex(isClassNamedEvaluationHelperBlock);if(b){addRange(e,x,0,n+1);e.push(b);addRange(e,x,n+1)}else{addRange(e,x)}if(f){e.push(f)}if(C){e.push(C)}x=setTextRange(t.createNodeArray(e),x)}const E=i();let N;if(g){N=t.createClassExpression(void 0,void 0,void 0,m,x);if(s.classThis){N=injectClassThisAssignmentIfMissing(t,N,s.classThis)}const e=t.createVariableDeclaration(a,void 0,void 0,N);const n=t.createVariableDeclarationList([e]);const r=s.classThis?t.createAssignment(a,s.classThis):a;c.push(t.createVariableStatement(void 0,n),t.createReturnStatement(r))}else{N=t.createClassExpression(void 0,o.name,void 0,m,x);c.push(t.createReturnStatement(N))}if(_){addInternalEmitFlags(N,32);for(const e of N.members){if((isPrivateIdentifierClassElementDeclaration(e)||isAutoAccessorPropertyDeclaration(e))&&hasStaticModifier(e)){addInternalEmitFlags(e,32)}}}setOriginalNode(N,o);return t.createImmediatelyInvokedArrowFunction(t.mergeLexicalEnvironment(c,E))}function isDecoratedClassLike(e){return classOrConstructorParameterIsDecorated(false,e)||childIsDecorated(false,e)}function visitClassDeclaration(n){if(isDecoratedClassLike(n)){const r=[];const i=getOriginalNode(n,isClassLike)??n;const o=i.name?t.createStringLiteralFromNode(i.name):t.createStringLiteral("default");const a=hasSyntacticModifier(n,32);const s=hasSyntacticModifier(n,2048);if(!n.name){n=injectClassNamedEvaluationHelperBlockIfMissing(e,n,o)}if(a&&s){const e=transformClassLike(n);if(n.name){const i=t.createVariableDeclaration(t.getLocalName(n),void 0,void 0,e);setOriginalNode(i,n);const o=t.createVariableDeclarationList([i],1);const a=t.createVariableStatement(void 0,o);r.push(a);const s=t.createExportDefault(t.getDeclarationName(n));setOriginalNode(s,n);setCommentRange(s,getCommentRange(n));setSourceMapRange(s,moveRangePastDecorators(n));r.push(s)}else{const i=t.createExportDefault(e);setOriginalNode(i,n);setCommentRange(i,getCommentRange(n));setSourceMapRange(i,moveRangePastDecorators(n));r.push(i)}}else{S.assertIsDefined(n.name,"A class declaration that is not a default export must have a name.");const e=transformClassLike(n);const i=a?e=>isExportModifier(e)?void 0:modifierVisitor(e):modifierVisitor;const o=visitNodes2(n.modifiers,i,isModifier);const s=t.getLocalName(n,false,true);const c=t.createVariableDeclaration(s,void 0,void 0,e);setOriginalNode(c,n);const l=t.createVariableDeclarationList([c],1);const d=t.createVariableStatement(o,l);setOriginalNode(d,n);setCommentRange(d,getCommentRange(n));r.push(d);if(a){const e=t.createExternalModuleExport(s);setOriginalNode(e,n);r.push(e)}}return singleOrMany(r)}else{const e=visitNodes2(n.modifiers,modifierVisitor,isModifier);const r=visitNodes2(n.heritageClauses,visitor,isHeritageClause);enterClass(void 0);const i=visitNodes2(n.members,classElementVisitor,isClassElement);exitClass();return t.updateClassDeclaration(n,e,n.name,void 0,r,i)}}function visitClassExpression(e){if(isDecoratedClassLike(e)){const t=transformClassLike(e);setOriginalNode(t,e);return t}else{const n=visitNodes2(e.modifiers,modifierVisitor,isModifier);const r=visitNodes2(e.heritageClauses,visitor,isHeritageClause);enterClass(void 0);const i=visitNodes2(e.members,classElementVisitor,isClassElement);exitClass();return t.updateClassExpression(e,n,e.name,void 0,r,i)}}function prepareConstructor(e,n){if(some(n.pendingInstanceInitializers)){const e=[];e.push(t.createExpressionStatement(t.inlineExpressions(n.pendingInstanceInitializers)));n.pendingInstanceInitializers=void 0;return e}}function transformConstructorBodyWorker(e,n,r,i,o,a){const s=i[o];const c=n[s];addRange(e,visitNodes2(n,visitor,isStatement,r,s-r));if(isTryStatement(c)){const n=[];transformConstructorBodyWorker(n,c.tryBlock.statements,0,i,o+1,a);const r=t.createNodeArray(n);setTextRange(r,c.tryBlock.statements);e.push(t.updateTryStatement(c,t.updateBlock(c.tryBlock,n),visitNode(c.catchClause,visitor,isCatchClause),visitNode(c.finallyBlock,visitor,isBlock)))}else{addRange(e,visitNodes2(n,visitor,isStatement,s,1));addRange(e,a)}addRange(e,visitNodes2(n,visitor,isStatement,s+1))}function visitConstructorDeclaration(e){enterClassElement(e);const n=visitNodes2(e.modifiers,modifierVisitor,isModifier);const r=visitNodes2(e.parameters,visitor,isParameter);let i;if(e.body&&c){const n=prepareConstructor(c.class,c);if(n){const r=[];const o=t.copyPrologue(e.body.statements,r,false,visitor);const a=findSuperStatementIndexPath(e.body.statements,o);if(a.length>0){transformConstructorBodyWorker(r,e.body.statements,o,a,0,n)}else{addRange(r,n);addRange(r,visitNodes2(e.body.statements,visitor,isStatement))}i=t.createBlock(r,true);setOriginalNode(i,e.body);setTextRange(i,e.body)}}i??(i=visitNode(e.body,visitor,isBlock));exitClassElement();return t.updateConstructorDeclaration(e,n,r,i)}function finishClassElement(e,t){if(e!==t){setCommentRange(e,t);setSourceMapRange(e,moveRangePastDecorators(t))}return e}function partialTransformClassElement(e,r,i){let o;let a;let s;let c;let l;let d;if(!r){const t=visitNodes2(e.modifiers,modifierVisitor,isModifier);enterName();a=visitPropertyName(e.name);exitName();return{modifiers:t,referencedName:o,name:a,initializersName:s,descriptorName:d,thisArg:l}}const u=transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClassElement(e,r.class,false));const f=visitNodes2(e.modifiers,modifierVisitor,isModifier);if(u){const m=createHelperVariable(e,"decorators");const _=t.createArrayLiteralExpression(u);const g=t.createAssignment(m,_);const y={memberDecoratorsName:m};r.memberInfos??(r.memberInfos=new Map);r.memberInfos.set(e,y);p??(p=[]);p.push(g);const h=isMethodOrAccessor(e)||isAutoAccessorPropertyDeclaration(e)?isStatic(e)?r.staticNonFieldDecorationStatements??(r.staticNonFieldDecorationStatements=[]):r.nonStaticNonFieldDecorationStatements??(r.nonStaticNonFieldDecorationStatements=[]):isPropertyDeclaration(e)&&!isAutoAccessorPropertyDeclaration(e)?isStatic(e)?r.staticFieldDecorationStatements??(r.staticFieldDecorationStatements=[]):r.nonStaticFieldDecorationStatements??(r.nonStaticFieldDecorationStatements=[]):S.fail();const T=isGetAccessorDeclaration(e)?"getter":isSetAccessorDeclaration(e)?"setter":isMethodDeclaration(e)?"method":isAutoAccessorPropertyDeclaration(e)?"accessor":isPropertyDeclaration(e)?"field":S.fail();let v;if(isIdentifier(e.name)||isPrivateIdentifier(e.name)){v={computed:false,name:e.name}}else if(isPropertyNameLiteral(e.name)){v={computed:true,name:t.createStringLiteralFromNode(e.name)}}else{const n=e.name.expression;if(isPropertyNameLiteral(n)&&!isIdentifier(n)){v={computed:true,name:t.createStringLiteralFromNode(n)}}else{enterName();({referencedName:o,name:a}=visitReferencedPropertyName(e.name));v={computed:true,name:o};exitName()}}const x={kind:T,name:v,static:isStatic(e),private:isPrivateIdentifier(e.name),access:{get:isPropertyDeclaration(e)||isGetAccessorDeclaration(e)||isMethodDeclaration(e),set:isPropertyDeclaration(e)||isSetAccessorDeclaration(e)},metadata:r.metadataReference};if(isMethodOrAccessor(e)){const o=isStatic(e)?r.staticMethodExtraInitializersName:r.instanceMethodExtraInitializersName;S.assertIsDefined(o);let a;if(isPrivateIdentifierClassElementDeclaration(e)&&i){a=i(e,visitNodes2(f,(e=>tryCast(e,isAsyncModifier)),isModifier));y.memberDescriptorName=d=createHelperVariable(e,"descriptor");a=t.createAssignment(d,a)}const s=n().createESDecorateHelper(t.createThis(),a??t.createNull(),m,x,t.createNull(),o);const c=t.createExpressionStatement(s);setSourceMapRange(c,moveRangePastDecorators(e));h.push(c)}else if(isPropertyDeclaration(e)){s=y.memberInitializersName??(y.memberInitializersName=createHelperVariable(e,"initializers"));c=y.memberExtraInitializersName??(y.memberExtraInitializersName=createHelperVariable(e,"extraInitializers"));if(isStatic(e)){l=r.classThis}let o;if(isPrivateIdentifierClassElementDeclaration(e)&&hasAccessorModifier(e)&&i){o=i(e,void 0);y.memberDescriptorName=d=createHelperVariable(e,"descriptor");o=t.createAssignment(d,o)}const a=n().createESDecorateHelper(isAutoAccessorPropertyDeclaration(e)?t.createThis():t.createNull(),o??t.createNull(),m,x,s,c);const p=t.createExpressionStatement(a);setSourceMapRange(p,moveRangePastDecorators(e));h.push(p)}}if(a===void 0){enterName();a=visitPropertyName(e.name);exitName()}if(!some(f)&&(isMethodDeclaration(e)||isPropertyDeclaration(e))){setEmitFlags(a,1024)}return{modifiers:f,referencedName:o,name:a,initializersName:s,extraInitializersName:c,descriptorName:d,thisArg:l}}function visitMethodDeclaration(e){enterClassElement(e);const{modifiers:n,name:r,descriptorName:i}=partialTransformClassElement(e,c,createMethodDescriptorObject);if(i){exitClassElement();return finishClassElement(createMethodDescriptorForwarder(n,r,i),e)}else{const i=visitNodes2(e.parameters,visitor,isParameter);const o=visitNode(e.body,visitor,isBlock);exitClassElement();return finishClassElement(t.updateMethodDeclaration(e,n,e.asteriskToken,r,void 0,void 0,i,void 0,o),e)}}function visitGetAccessorDeclaration(e){enterClassElement(e);const{modifiers:n,name:r,descriptorName:i}=partialTransformClassElement(e,c,createGetAccessorDescriptorObject);if(i){exitClassElement();return finishClassElement(createGetAccessorDescriptorForwarder(n,r,i),e)}else{const i=visitNodes2(e.parameters,visitor,isParameter);const o=visitNode(e.body,visitor,isBlock);exitClassElement();return finishClassElement(t.updateGetAccessorDeclaration(e,n,r,i,void 0,o),e)}}function visitSetAccessorDeclaration(e){enterClassElement(e);const{modifiers:n,name:r,descriptorName:i}=partialTransformClassElement(e,c,createSetAccessorDescriptorObject);if(i){exitClassElement();return finishClassElement(createSetAccessorDescriptorForwarder(n,r,i),e)}else{const i=visitNodes2(e.parameters,visitor,isParameter);const o=visitNode(e.body,visitor,isBlock);exitClassElement();return finishClassElement(t.updateSetAccessorDeclaration(e,n,r,i,o),e)}}function visitClassStaticBlockDeclaration(n){enterClassElement(n);let r;if(isClassNamedEvaluationHelperBlock(n)){r=visitEachChild(n,visitor,e)}else if(isClassThisAssignmentBlock(n)){const t=l;l=void 0;r=visitEachChild(n,visitor,e);l=t}else{n=visitEachChild(n,visitor,e);r=n;if(c){c.hasStaticInitializers=true;if(some(c.pendingStaticInitializers)){const e=[];for(const n of c.pendingStaticInitializers){const r=t.createExpressionStatement(n);setSourceMapRange(r,getSourceMapRange(n));e.push(r)}const n=t.createBlock(e,true);const i=t.createClassStaticBlockDeclaration(n);r=[i,r];c.pendingStaticInitializers=void 0}}}exitClassElement();return r}function visitPropertyDeclaration(a){if(isNamedEvaluation(a,isAnonymousClassNeedingAssignedName)){a=transformNamedEvaluation(e,a,canIgnoreEmptyStringLiteralInAssignedName(a.initializer))}enterClassElement(a);S.assert(!isAmbientPropertyDeclaration(a),"Not yet implemented.");const{modifiers:s,name:l,initializersName:d,extraInitializersName:p,descriptorName:u,thisArg:f}=partialTransformClassElement(a,c,hasAccessorModifier(a)?createAccessorPropertyDescriptorObject:void 0);r();let m=visitNode(a.initializer,visitor,isExpression);if(d){m=n().createRunInitializersHelper(f??t.createThis(),d,m??t.createVoidZero())}if(isStatic(a)&&c&&m){c.hasStaticInitializers=true}const _=i();if(some(_)){m=t.createImmediatelyInvokedArrowFunction([..._,t.createReturnStatement(m)])}if(c){if(isStatic(a)){m=injectPendingInitializers(c,true,m);if(p){c.pendingStaticInitializers??(c.pendingStaticInitializers=[]);c.pendingStaticInitializers.push(n().createRunInitializersHelper(c.classThis??t.createThis(),p))}}else{m=injectPendingInitializers(c,false,m);if(p){c.pendingInstanceInitializers??(c.pendingInstanceInitializers=[]);c.pendingInstanceInitializers.push(n().createRunInitializersHelper(t.createThis(),p))}}}exitClassElement();if(hasAccessorModifier(a)&&u){const e=getCommentRange(a);const n=getSourceMapRange(a);const r=a.name;let i=r;let c=r;if(isComputedPropertyName(r)&&!isSimpleInlineableExpression(r.expression)){const e=findComputedPropertyNameCacheAssignment(r);if(e){i=t.updateComputedPropertyName(r,visitNode(r.expression,visitor,isExpression));c=t.updateComputedPropertyName(r,e.left)}else{const e=t.createTempVariable(o);setSourceMapRange(e,r.expression);const n=visitNode(r.expression,visitor,isExpression);const a=t.createAssignment(e,n);setSourceMapRange(a,r.expression);i=t.updateComputedPropertyName(r,a);c=t.updateComputedPropertyName(r,e)}}const l=visitNodes2(s,(e=>e.kind!==129?e:void 0),isModifier);const d=createAccessorPropertyBackingField(t,a,l,m);setOriginalNode(d,a);setEmitFlags(d,3072);setSourceMapRange(d,n);setSourceMapRange(d.name,a.name);const p=createGetAccessorDescriptorForwarder(l,i,u);setOriginalNode(p,a);setCommentRange(p,e);setSourceMapRange(p,n);const f=createSetAccessorDescriptorForwarder(l,c,u);setOriginalNode(f,a);setEmitFlags(f,3072);setSourceMapRange(f,n);return[d,p,f]}return finishClassElement(t.updatePropertyDeclaration(a,s,l,void 0,void 0,m),a)}function visitThisExpression(e){return l??e}function visitCallExpression(n){if(isSuperProperty(n.expression)&&l){const e=visitNode(n.expression,visitor,isExpression);const r=visitNodes2(n.arguments,visitor,isExpression);const i=t.createFunctionCallCall(e,l,r);setOriginalNode(i,n);setTextRange(i,n);return i}return visitEachChild(n,visitor,e)}function visitTaggedTemplateExpression(n){if(isSuperProperty(n.tag)&&l){const e=visitNode(n.tag,visitor,isExpression);const r=t.createFunctionBindCall(e,l,[]);setOriginalNode(r,n);setTextRange(r,n);const i=visitNode(n.template,visitor,isTemplateLiteral);return t.updateTaggedTemplateExpression(n,r,void 0,i)}return visitEachChild(n,visitor,e)}function visitPropertyAccessExpression(n){if(isSuperProperty(n)&&isIdentifier(n.name)&&l&&d){const e=t.createStringLiteralFromNode(n.name);const r=t.createReflectGetCall(d,e,l);setOriginalNode(r,n.expression);setTextRange(r,n.expression);return r}return visitEachChild(n,visitor,e)}function visitElementAccessExpression(n){if(isSuperProperty(n)&&l&&d){const e=visitNode(n.argumentExpression,visitor,isExpression);const r=t.createReflectGetCall(d,e,l);setOriginalNode(r,n.expression);setTextRange(r,n.expression);return r}return visitEachChild(n,visitor,e)}function visitParameterDeclaration(n){if(isNamedEvaluation(n,isAnonymousClassNeedingAssignedName)){n=transformNamedEvaluation(e,n,canIgnoreEmptyStringLiteralInAssignedName(n.initializer))}const r=t.updateParameterDeclaration(n,void 0,n.dotDotDotToken,visitNode(n.name,visitor,isBindingName),void 0,void 0,visitNode(n.initializer,visitor,isExpression));if(r!==n){setCommentRange(r,n);setTextRange(r,moveRangePastModifiers(n));setSourceMapRange(r,moveRangePastModifiers(n));setEmitFlags(r.name,64)}return r}function isAnonymousClassNeedingAssignedName(e){return isClassExpression(e)&&!e.name&&isDecoratedClassLike(e)}function canIgnoreEmptyStringLiteralInAssignedName(e){const t=skipOuterExpressions(e);return isClassExpression(t)&&!t.name&&!classOrConstructorParameterIsDecorated(false,t)}function visitForStatement(n){return t.updateForStatement(n,visitNode(n.initializer,discardedValueVisitor,isForInitializer),visitNode(n.condition,visitor,isExpression),visitNode(n.incrementor,discardedValueVisitor,isExpression),visitIterationBody(n.statement,visitor,e))}function visitExpressionStatement(t){return visitEachChild(t,discardedValueVisitor,e)}function visitBinaryExpression(n,r){if(isDestructuringAssignment(n)){const e=visitAssignmentPattern(n.left);const r=visitNode(n.right,visitor,isExpression);return t.updateBinaryExpression(n,e,n.operatorToken,r)}if(isAssignmentExpression(n)){if(isNamedEvaluation(n,isAnonymousClassNeedingAssignedName)){n=transformNamedEvaluation(e,n,canIgnoreEmptyStringLiteralInAssignedName(n.right));return visitEachChild(n,visitor,e)}if(isSuperProperty(n.left)&&l&&d){let e=isElementAccessExpression(n.left)?visitNode(n.left.argumentExpression,visitor,isExpression):isIdentifier(n.left.name)?t.createStringLiteralFromNode(n.left.name):void 0;if(e){let i=visitNode(n.right,visitor,isExpression);if(isCompoundAssignment(n.operatorToken.kind)){let r=e;if(!isSimpleInlineableExpression(e)){r=t.createTempVariable(o);e=t.createAssignment(r,e)}const a=t.createReflectGetCall(d,r,l);setOriginalNode(a,n.left);setTextRange(a,n.left);i=t.createBinaryExpression(a,getNonAssignmentOperatorForCompoundAssignment(n.operatorToken.kind),i);setTextRange(i,n)}const a=r?void 0:t.createTempVariable(o);if(a){i=t.createAssignment(a,i);setTextRange(a,n)}i=t.createReflectSetCall(d,e,i,l);setOriginalNode(i,n);setTextRange(i,n);if(a){i=t.createComma(i,a);setTextRange(i,n)}return i}}}if(n.operatorToken.kind===28){const e=visitNode(n.left,discardedValueVisitor,isExpression);const i=visitNode(n.right,r?discardedValueVisitor:visitor,isExpression);return t.updateBinaryExpression(n,e,n.operatorToken,i)}return visitEachChild(n,visitor,e)}function visitPreOrPostfixUnaryExpression(n,r){if(n.operator===46||n.operator===47){const e=skipParentheses(n.operand);if(isSuperProperty(e)&&l&&d){let i=isElementAccessExpression(e)?visitNode(e.argumentExpression,visitor,isExpression):isIdentifier(e.name)?t.createStringLiteralFromNode(e.name):void 0;if(i){let e=i;if(!isSimpleInlineableExpression(i)){e=t.createTempVariable(o);i=t.createAssignment(e,i)}let a=t.createReflectGetCall(d,e,l);setOriginalNode(a,n);setTextRange(a,n);const s=r?void 0:t.createTempVariable(o);a=expandPreOrPostfixIncrementOrDecrementExpression(t,n,a,o,s);a=t.createReflectSetCall(d,i,a,l);setOriginalNode(a,n);setTextRange(a,n);if(s){a=t.createComma(a,s);setTextRange(a,n)}return a}}}return visitEachChild(n,visitor,e)}function visitCommaListExpression(e,n){const r=n?visitCommaListElements(e.elements,discardedValueVisitor):visitCommaListElements(e.elements,visitor,discardedValueVisitor);return t.updateCommaListExpression(e,r)}function visitReferencedPropertyName(e){if(isPropertyNameLiteral(e)||isPrivateIdentifier(e)){const n=t.createStringLiteralFromNode(e);const r=visitNode(e,visitor,isPropertyName);return{referencedName:n,name:r}}if(isPropertyNameLiteral(e.expression)&&!isIdentifier(e.expression)){const n=t.createStringLiteralFromNode(e.expression);const r=visitNode(e,visitor,isPropertyName);return{referencedName:n,name:r}}const r=t.getGeneratedNameForNode(e);o(r);const i=n().createPropKeyHelper(visitNode(e.expression,visitor,isExpression));const a=t.createAssignment(r,i);const s=t.updateComputedPropertyName(e,injectPendingExpressions(a));return{referencedName:r,name:s}}function visitPropertyName(e){if(isComputedPropertyName(e)){return visitComputedPropertyName(e)}return visitNode(e,visitor,isPropertyName)}function visitComputedPropertyName(e){let n=visitNode(e.expression,visitor,isExpression);if(!isSimpleInlineableExpression(n)){n=injectPendingExpressions(n)}return t.updateComputedPropertyName(e,n)}function visitPropertyAssignment(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t,canIgnoreEmptyStringLiteralInAssignedName(t.initializer))}return visitEachChild(t,visitor,e)}function visitVariableDeclaration(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t,canIgnoreEmptyStringLiteralInAssignedName(t.initializer))}return visitEachChild(t,visitor,e)}function visitBindingElement(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t,canIgnoreEmptyStringLiteralInAssignedName(t.initializer))}return visitEachChild(t,visitor,e)}function visitDestructuringAssignmentTarget(n){if(isObjectLiteralExpression(n)||isArrayLiteralExpression(n)){return visitAssignmentPattern(n)}if(isSuperProperty(n)&&l&&d){const e=isElementAccessExpression(n)?visitNode(n.argumentExpression,visitor,isExpression):isIdentifier(n.name)?t.createStringLiteralFromNode(n.name):void 0;if(e){const r=t.createTempVariable(void 0);const i=t.createAssignmentTargetWrapper(r,t.createReflectSetCall(d,e,r,l));setOriginalNode(i,n);setTextRange(i,n);return i}}return visitEachChild(n,visitor,e)}function visitAssignmentElement(n){if(isAssignmentExpression(n,true)){if(isNamedEvaluation(n,isAnonymousClassNeedingAssignedName)){n=transformNamedEvaluation(e,n,canIgnoreEmptyStringLiteralInAssignedName(n.right))}const r=visitDestructuringAssignmentTarget(n.left);const i=visitNode(n.right,visitor,isExpression);return t.updateBinaryExpression(n,r,n.operatorToken,i)}else{return visitDestructuringAssignmentTarget(n)}}function visitAssignmentRestElement(n){if(isLeftHandSideExpression(n.expression)){const e=visitDestructuringAssignmentTarget(n.expression);return t.updateSpreadElement(n,e)}return visitEachChild(n,visitor,e)}function visitArrayAssignmentElement(t){S.assertNode(t,isArrayBindingOrAssignmentElement);if(isSpreadElement(t))return visitAssignmentRestElement(t);if(!isOmittedExpression(t))return visitAssignmentElement(t);return visitEachChild(t,visitor,e)}function visitAssignmentProperty(n){const r=visitNode(n.name,visitor,isPropertyName);if(isAssignmentExpression(n.initializer,true)){const e=visitAssignmentElement(n.initializer);return t.updatePropertyAssignment(n,r,e)}if(isLeftHandSideExpression(n.initializer)){const e=visitDestructuringAssignmentTarget(n.initializer);return t.updatePropertyAssignment(n,r,e)}return visitEachChild(n,visitor,e)}function visitShorthandAssignmentProperty(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t,canIgnoreEmptyStringLiteralInAssignedName(t.objectAssignmentInitializer))}return visitEachChild(t,visitor,e)}function visitAssignmentRestProperty(n){if(isLeftHandSideExpression(n.expression)){const e=visitDestructuringAssignmentTarget(n.expression);return t.updateSpreadAssignment(n,e)}return visitEachChild(n,visitor,e)}function visitObjectAssignmentElement(t){S.assertNode(t,isObjectBindingOrAssignmentElement);if(isSpreadAssignment(t))return visitAssignmentRestProperty(t);if(isShorthandPropertyAssignment(t))return visitShorthandAssignmentProperty(t);if(isPropertyAssignment(t))return visitAssignmentProperty(t);return visitEachChild(t,visitor,e)}function visitAssignmentPattern(e){if(isArrayLiteralExpression(e)){const n=visitNodes2(e.elements,visitArrayAssignmentElement,isExpression);return t.updateArrayLiteralExpression(e,n)}else{const n=visitNodes2(e.properties,visitObjectAssignmentElement,isObjectLiteralElementLike);return t.updateObjectLiteralExpression(e,n)}}function visitExportAssignment(t){if(isNamedEvaluation(t,isAnonymousClassNeedingAssignedName)){t=transformNamedEvaluation(e,t,canIgnoreEmptyStringLiteralInAssignedName(t.expression))}return visitEachChild(t,visitor,e)}function visitParenthesizedExpression(e,n){const r=n?discardedValueVisitor:visitor;const i=visitNode(e.expression,r,isExpression);return t.updateParenthesizedExpression(e,i)}function visitPartiallyEmittedExpression(e,n){const r=n?discardedValueVisitor:visitor;const i=visitNode(e.expression,r,isExpression);return t.updatePartiallyEmittedExpression(e,i)}function injectPendingExpressionsCommon(e,n){if(some(e)){if(n){if(isParenthesizedExpression(n)){e.push(n.expression);n=t.updateParenthesizedExpression(n,t.inlineExpressions(e))}else{e.push(n);n=t.inlineExpressions(e)}}else{n=t.inlineExpressions(e)}}return n}function injectPendingExpressions(e){const t=injectPendingExpressionsCommon(p,e);S.assertIsDefined(t);if(t!==e){p=void 0}return t}function injectPendingInitializers(e,t,n){const r=injectPendingExpressionsCommon(t?e.pendingStaticInitializers:e.pendingInstanceInitializers,n);if(r!==n){if(t){e.pendingStaticInitializers=void 0}else{e.pendingInstanceInitializers=void 0}}return r}function transformAllDecoratorsOfDeclaration(e){if(!e){return void 0}const t=[];addRange(t,map(e.decorators,transformDecorator));return t}function transformDecorator(e){const n=visitNode(e.expression,visitor,isExpression);setEmitFlags(n,3072);const r=skipOuterExpressions(n);if(isAccessExpression(r)){const{target:e,thisArg:r}=t.createCallBinding(n,o,a,true);return t.restoreOuterExpressions(n,t.createFunctionBindCall(e,r,[]))}return n}function createDescriptorMethod(e,r,i,o,a,s,c){const l=t.createFunctionExpression(i,o,void 0,void 0,s,void 0,c??t.createBlock([]));setOriginalNode(l,e);setSourceMapRange(l,moveRangePastDecorators(e));setEmitFlags(l,3072);const d=a==="get"||a==="set"?a:void 0;const p=t.createStringLiteralFromNode(r,void 0);const u=n().createSetFunctionNameHelper(l,p,d);const f=t.createPropertyAssignment(t.createIdentifier(a),u);setOriginalNode(f,e);setSourceMapRange(f,moveRangePastDecorators(e));setEmitFlags(f,3072);return f}function createMethodDescriptorObject(e,n){return t.createObjectLiteralExpression([createDescriptorMethod(e,e.name,n,e.asteriskToken,"value",visitNodes2(e.parameters,visitor,isParameter),visitNode(e.body,visitor,isBlock))])}function createGetAccessorDescriptorObject(e,n){return t.createObjectLiteralExpression([createDescriptorMethod(e,e.name,n,void 0,"get",[],visitNode(e.body,visitor,isBlock))])}function createSetAccessorDescriptorObject(e,n){return t.createObjectLiteralExpression([createDescriptorMethod(e,e.name,n,void 0,"set",visitNodes2(e.parameters,visitor,isParameter),visitNode(e.body,visitor,isBlock))])}function createAccessorPropertyDescriptorObject(e,n){return t.createObjectLiteralExpression([createDescriptorMethod(e,e.name,n,void 0,"get",[],t.createBlock([t.createReturnStatement(t.createPropertyAccessExpression(t.createThis(),t.getGeneratedPrivateNameForNode(e.name)))])),createDescriptorMethod(e,e.name,n,void 0,"set",[t.createParameterDeclaration(void 0,void 0,"value")],t.createBlock([t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(t.createThis(),t.getGeneratedPrivateNameForNode(e.name)),t.createIdentifier("value")))]))])}function createMethodDescriptorForwarder(e,n,r){e=visitNodes2(e,(e=>isStaticModifier(e)?e:void 0),isModifier);return t.createGetAccessorDeclaration(e,n,[],void 0,t.createBlock([t.createReturnStatement(t.createPropertyAccessExpression(r,t.createIdentifier("value")))]))}function createGetAccessorDescriptorForwarder(e,n,r){e=visitNodes2(e,(e=>isStaticModifier(e)?e:void 0),isModifier);return t.createGetAccessorDeclaration(e,n,[],void 0,t.createBlock([t.createReturnStatement(t.createFunctionCallCall(t.createPropertyAccessExpression(r,t.createIdentifier("get")),t.createThis(),[]))]))}function createSetAccessorDescriptorForwarder(e,n,r){e=visitNodes2(e,(e=>isStaticModifier(e)?e:void 0),isModifier);return t.createSetAccessorDeclaration(e,n,[t.createParameterDeclaration(void 0,void 0,"value")],t.createBlock([t.createReturnStatement(t.createFunctionCallCall(t.createPropertyAccessExpression(r,t.createIdentifier("set")),t.createThis(),[t.createIdentifier("value")]))]))}function createMetadata(e,n){const r=t.createVariableDeclaration(e,void 0,void 0,t.createConditionalExpression(t.createLogicalAnd(t.createTypeCheck(t.createIdentifier("Symbol"),"function"),t.createPropertyAccessExpression(t.createIdentifier("Symbol"),"metadata")),t.createToken(58),t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"create"),void 0,[n?createSymbolMetadataReference(n):t.createNull()]),t.createToken(59),t.createVoidZero()));return t.createVariableStatement(void 0,t.createVariableDeclarationList([r],2))}function createSymbolMetadata(e,n){const r=t.createObjectDefinePropertyCall(e,t.createPropertyAccessExpression(t.createIdentifier("Symbol"),"metadata"),t.createPropertyDescriptor({configurable:true,writable:true,enumerable:true,value:n},true));return setEmitFlags(t.createIfStatement(n,t.createExpressionStatement(r)),1)}function createSymbolMetadataReference(e){return t.createBinaryExpression(t.createElementAccessExpression(e,t.createPropertyAccessExpression(t.createIdentifier("Symbol"),"metadata")),61,t.createNull())}}function transformES2017(e){const{factory:t,getEmitHelperFactory:n,resumeLexicalEnvironment:r,endLexicalEnvironment:i,hoistVariableDeclaration:o}=e;const a=e.getEmitResolver();const s=e.getCompilerOptions();const c=zn(s);let l=0;let d=0;let p;let u;let f;let m;const _=[];let g=0;const y=e.onEmitNode;const h=e.onSubstituteNode;e.onEmitNode=onEmitNode;e.onSubstituteNode=onSubstituteNode;return chainBundle(e,transformSourceFile);function transformSourceFile(t){if(t.isDeclarationFile){return t}setContextFlag(1,false);setContextFlag(2,!isEffectiveStrictModeSourceFile(t,s));const n=visitEachChild(t,visitor,e);addEmitHelpers(n,e.readEmitHelpers());return n}function setContextFlag(e,t){g=t?g|e:g&~e}function inContext(e){return(g&e)!==0}function inTopLevelContext(){return!inContext(1)}function inHasLexicalThisContext(){return inContext(2)}function doWithContext(e,t,n){const r=e&~g;if(r){setContextFlag(r,true);const e=t(n);setContextFlag(r,false);return e}return t(n)}function visitDefault(t){return visitEachChild(t,visitor,e)}function argumentsVisitor(t){switch(t.kind){case 218:case 262:case 174:case 177:case 178:case 176:return t;case 169:case 208:case 260:break;case 80:if(m&&a.isArgumentsLocalBinding(t)){return m}break}return visitEachChild(t,argumentsVisitor,e)}function visitor(t){if((t.transformFlags&256)===0){return m?argumentsVisitor(t):t}switch(t.kind){case 134:return void 0;case 223:return visitAwaitExpression(t);case 174:return doWithContext(1|2,visitMethodDeclaration,t);case 262:return doWithContext(1|2,visitFunctionDeclaration,t);case 218:return doWithContext(1|2,visitFunctionExpression,t);case 219:return doWithContext(1,visitArrowFunction,t);case 211:if(u&&isPropertyAccessExpression(t)&&t.expression.kind===108){u.add(t.name.escapedText)}return visitEachChild(t,visitor,e);case 212:if(u&&t.expression.kind===108){f=true}return visitEachChild(t,visitor,e);case 177:return doWithContext(1|2,visitGetAccessorDeclaration,t);case 178:return doWithContext(1|2,visitSetAccessorDeclaration,t);case 176:return doWithContext(1|2,visitConstructorDeclaration,t);case 263:case 231:return doWithContext(1|2,visitDefault,t);default:return visitEachChild(t,visitor,e)}}function asyncBodyVisitor(t){if(isNodeWithPossibleHoistedDeclaration(t)){switch(t.kind){case 243:return visitVariableStatementInAsyncBody(t);case 248:return visitForStatementInAsyncBody(t);case 249:return visitForInStatementInAsyncBody(t);case 250:return visitForOfStatementInAsyncBody(t);case 299:return visitCatchClauseInAsyncBody(t);case 241:case 255:case 269:case 296:case 297:case 258:case 246:case 247:case 245:case 254:case 256:return visitEachChild(t,asyncBodyVisitor,e);default:return S.assertNever(t,"Unhandled node.")}}return visitor(t)}function visitCatchClauseInAsyncBody(t){const n=new Set;recordDeclarationName(t.variableDeclaration,n);let r;n.forEach(((e,t)=>{if(p.has(t)){if(!r){r=new Set(p)}r.delete(t)}}));if(r){const n=p;p=r;const i=visitEachChild(t,asyncBodyVisitor,e);p=n;return i}else{return visitEachChild(t,asyncBodyVisitor,e)}}function visitVariableStatementInAsyncBody(n){if(isVariableDeclarationListWithCollidingName(n.declarationList)){const e=visitVariableDeclarationListWithCollidingNames(n.declarationList,false);return e?t.createExpressionStatement(e):void 0}return visitEachChild(n,visitor,e)}function visitForInStatementInAsyncBody(n){return t.updateForInStatement(n,isVariableDeclarationListWithCollidingName(n.initializer)?visitVariableDeclarationListWithCollidingNames(n.initializer,true):S.checkDefined(visitNode(n.initializer,visitor,isForInitializer)),S.checkDefined(visitNode(n.expression,visitor,isExpression)),visitIterationBody(n.statement,asyncBodyVisitor,e))}function visitForOfStatementInAsyncBody(n){return t.updateForOfStatement(n,visitNode(n.awaitModifier,visitor,isAwaitKeyword),isVariableDeclarationListWithCollidingName(n.initializer)?visitVariableDeclarationListWithCollidingNames(n.initializer,true):S.checkDefined(visitNode(n.initializer,visitor,isForInitializer)),S.checkDefined(visitNode(n.expression,visitor,isExpression)),visitIterationBody(n.statement,asyncBodyVisitor,e))}function visitForStatementInAsyncBody(n){const r=n.initializer;return t.updateForStatement(n,isVariableDeclarationListWithCollidingName(r)?visitVariableDeclarationListWithCollidingNames(r,false):visitNode(n.initializer,visitor,isForInitializer),visitNode(n.condition,visitor,isExpression),visitNode(n.incrementor,visitor,isExpression),visitIterationBody(n.statement,asyncBodyVisitor,e))}function visitAwaitExpression(n){if(inTopLevelContext()){return visitEachChild(n,visitor,e)}return setOriginalNode(setTextRange(t.createYieldExpression(void 0,visitNode(n.expression,visitor,isExpression)),n),n)}function visitConstructorDeclaration(n){const r=m;m=void 0;const i=t.updateConstructorDeclaration(n,visitNodes2(n.modifiers,visitor,isModifier),visitParameterList(n.parameters,visitor,e),transformMethodBody(n));m=r;return i}function visitMethodDeclaration(n){let r;const i=getFunctionFlags(n);const o=m;m=void 0;const a=t.updateMethodDeclaration(n,visitNodes2(n.modifiers,visitor,isModifierLike),n.asteriskToken,n.name,void 0,void 0,r=i&2?transformAsyncFunctionParameterList(n):visitParameterList(n.parameters,visitor,e),void 0,i&2?transformAsyncFunctionBody(n,r):transformMethodBody(n));m=o;return a}function visitGetAccessorDeclaration(n){const r=m;m=void 0;const i=t.updateGetAccessorDeclaration(n,visitNodes2(n.modifiers,visitor,isModifierLike),n.name,visitParameterList(n.parameters,visitor,e),void 0,transformMethodBody(n));m=r;return i}function visitSetAccessorDeclaration(n){const r=m;m=void 0;const i=t.updateSetAccessorDeclaration(n,visitNodes2(n.modifiers,visitor,isModifierLike),n.name,visitParameterList(n.parameters,visitor,e),transformMethodBody(n));m=r;return i}function visitFunctionDeclaration(n){let r;const i=m;m=void 0;const o=getFunctionFlags(n);const a=t.updateFunctionDeclaration(n,visitNodes2(n.modifiers,visitor,isModifierLike),n.asteriskToken,n.name,void 0,r=o&2?transformAsyncFunctionParameterList(n):visitParameterList(n.parameters,visitor,e),void 0,o&2?transformAsyncFunctionBody(n,r):visitFunctionBody(n.body,visitor,e));m=i;return a}function visitFunctionExpression(n){let r;const i=m;m=void 0;const o=getFunctionFlags(n);const a=t.updateFunctionExpression(n,visitNodes2(n.modifiers,visitor,isModifier),n.asteriskToken,n.name,void 0,r=o&2?transformAsyncFunctionParameterList(n):visitParameterList(n.parameters,visitor,e),void 0,o&2?transformAsyncFunctionBody(n,r):visitFunctionBody(n.body,visitor,e));m=i;return a}function visitArrowFunction(n){let r;const i=getFunctionFlags(n);return t.updateArrowFunction(n,visitNodes2(n.modifiers,visitor,isModifier),void 0,r=i&2?transformAsyncFunctionParameterList(n):visitParameterList(n.parameters,visitor,e),void 0,n.equalsGreaterThanToken,i&2?transformAsyncFunctionBody(n,r):visitFunctionBody(n.body,visitor,e))}function recordDeclarationName({name:e},t){if(isIdentifier(e)){t.add(e.escapedText)}else{for(const n of e.elements){if(!isOmittedExpression(n)){recordDeclarationName(n,t)}}}}function isVariableDeclarationListWithCollidingName(e){return!!e&&isVariableDeclarationList(e)&&!(e.flags&7)&&e.declarations.some(collidesWithParameterName)}function visitVariableDeclarationListWithCollidingNames(e,n){hoistVariableDeclarationList(e);const r=getInitializedVariables(e);if(r.length===0){if(n){return visitNode(t.converters.convertToAssignmentElementTarget(e.declarations[0].name),visitor,isExpression)}return void 0}return t.inlineExpressions(map(r,transformInitializedVariable))}function hoistVariableDeclarationList(e){forEach(e.declarations,hoistVariable)}function hoistVariable({name:e}){if(isIdentifier(e)){o(e)}else{for(const t of e.elements){if(!isOmittedExpression(t)){hoistVariable(t)}}}}function transformInitializedVariable(e){const n=setSourceMapRange(t.createAssignment(t.converters.convertToAssignmentElementTarget(e.name),e.initializer),e);return S.checkDefined(visitNode(n,visitor,isExpression))}function collidesWithParameterName({name:e}){if(isIdentifier(e)){return p.has(e.escapedText)}else{for(const t of e.elements){if(!isOmittedExpression(t)&&collidesWithParameterName(t)){return true}}}return false}function transformMethodBody(n){S.assertIsDefined(n.body);const r=u;const i=f;u=new Set;f=false;let o=visitFunctionBody(n.body,visitor,e);const s=getOriginalNode(n,isFunctionLikeDeclaration);const l=c>=2&&(a.hasNodeCheckFlag(n,256)||a.hasNodeCheckFlag(n,128))&&(getFunctionFlags(s)&3)!==3;if(l){enableSubstitutionForAsyncMethodsWithSuper();if(u.size){const e=createSuperAccessVariableStatement(t,a,n,u);_[getNodeId(e)]=true;const r=o.statements.slice();insertStatementsAfterStandardPrologue(r,[e]);o=t.updateBlock(o,r)}if(f){if(a.hasNodeCheckFlag(n,256)){addEmitHelper(o,Ci)}else if(a.hasNodeCheckFlag(n,128)){addEmitHelper(o,bi)}}}u=r;f=i;return o}function createCaptureArgumentsStatement(){S.assert(m);const e=t.createVariableDeclaration(m,void 0,void 0,t.createIdentifier("arguments"));const n=t.createVariableStatement(void 0,[e]);startOnNewLine(n);addEmitFlags(n,2097152);return n}function transformAsyncFunctionParameterList(n){if(isSimpleParameterList(n.parameters)){return visitParameterList(n.parameters,visitor,e)}const r=[];for(const e of n.parameters){if(e.initializer||e.dotDotDotToken){if(n.kind===219){const e=t.createParameterDeclaration(void 0,t.createToken(26),t.createUniqueName("args",8));r.push(e)}break}const i=t.createParameterDeclaration(void 0,void 0,t.getGeneratedNameForNode(e.name,8));r.push(i)}const i=t.createNodeArray(r);setTextRange(i,n.parameters);return i}function transformAsyncFunctionBody(o,s){const l=!isSimpleParameterList(o.parameters)?visitParameterList(o.parameters,visitor,e):void 0;r();const d=getOriginalNode(o,isFunctionLike);const g=d.type;const y=c<2?getPromiseConstructor(g):void 0;const h=o.kind===219;const T=m;const v=a.hasNodeCheckFlag(o,512);const x=v&&!m;if(x){m=t.createUniqueName("arguments")}let b;if(l){if(h){const e=[];S.assert(s.length<=o.parameters.length);for(let n=0;n=2&&(a.hasNodeCheckFlag(o,256)||a.hasNodeCheckFlag(o,128));if(r){enableSubstitutionForAsyncMethodsWithSuper();if(u.size){const n=createSuperAccessVariableStatement(t,a,o,u);_[getNodeId(n)]=true;insertStatementsAfterStandardPrologue(e,[n])}}if(x){insertStatementsAfterStandardPrologue(e,[createCaptureArgumentsStatement()])}const i=t.createBlock(e,true);setTextRange(i,o.body);if(r&&f){if(a.hasNodeCheckFlag(o,256)){addEmitHelper(i,Ci)}else if(a.hasNodeCheckFlag(o,128)){addEmitHelper(i,bi)}}P=i}else{P=n().createAwaiterHelper(k,b,y,l,F);if(x){const e=t.converters.convertToFunctionBlock(P);P=t.updateBlock(e,t.mergeLexicalEnvironment(e.statements,[createCaptureArgumentsStatement()]))}}p=C;if(!h){u=E;f=N;m=T}return P}function transformAsyncFunctionBodyWorker(e,n){if(isBlock(e)){return t.updateBlock(e,visitNodes2(e.statements,asyncBodyVisitor,isStatement,n))}else{return t.converters.convertToFunctionBlock(S.checkDefined(visitNode(e,asyncBodyVisitor,isConciseBody)))}}function getPromiseConstructor(e){const t=e&&getEntityNameFromTypeNode(e);if(t&&isEntityName(t)){const e=a.getTypeReferenceSerializationKind(t);if(e===1||e===0){return t}}return void 0}function enableSubstitutionForAsyncMethodsWithSuper(){if((l&1)===0){l|=1;e.enableSubstitution(213);e.enableSubstitution(211);e.enableSubstitution(212);e.enableEmitNotification(263);e.enableEmitNotification(174);e.enableEmitNotification(177);e.enableEmitNotification(178);e.enableEmitNotification(176);e.enableEmitNotification(243)}}function onEmitNode(e,t,n){if(l&1&&isSuperContainer(t)){const r=(a.hasNodeCheckFlag(t,128)?128:0)|(a.hasNodeCheckFlag(t,256)?256:0);if(r!==d){const i=d;d=r;y(e,t,n);d=i;return}}else if(l&&_[getNodeId(t)]){const r=d;d=0;y(e,t,n);d=r;return}y(e,t,n)}function onSubstituteNode(e,t){t=h(e,t);if(e===1&&d){return substituteExpression(t)}return t}function substituteExpression(e){switch(e.kind){case 211:return substitutePropertyAccessExpression(e);case 212:return substituteElementAccessExpression(e);case 213:return substituteCallExpression(e)}return e}function substitutePropertyAccessExpression(e){if(e.expression.kind===108){return setTextRange(t.createPropertyAccessExpression(t.createUniqueName("_super",16|32),e.name),e)}return e}function substituteElementAccessExpression(e){if(e.expression.kind===108){return createSuperElementAccessInAsyncMethod(e.argumentExpression,e)}return e}function substituteCallExpression(e){const n=e.expression;if(isSuperProperty(n)){const r=isPropertyAccessExpression(n)?substitutePropertyAccessExpression(n):substituteElementAccessExpression(n);return t.createCallExpression(t.createPropertyAccessExpression(r,"call"),void 0,[t.createThis(),...e.arguments])}return e}function isSuperContainer(e){const t=e.kind;return t===263||t===176||t===174||t===177||t===178}function createSuperElementAccessInAsyncMethod(e,n){if(d&256){return setTextRange(t.createPropertyAccessExpression(t.createCallExpression(t.createUniqueName("_superIndex",16|32),void 0,[e]),"value"),n)}else{return setTextRange(t.createCallExpression(t.createUniqueName("_superIndex",16|32),void 0,[e]),n)}}}function createSuperAccessVariableStatement(e,t,n,r){const i=t.hasNodeCheckFlag(n,256);const o=[];r.forEach(((t,n)=>{const r=unescapeLeadingUnderscores(n);const a=[];a.push(e.createPropertyAssignment("get",e.createArrowFunction(void 0,void 0,[],void 0,void 0,setEmitFlags(e.createPropertyAccessExpression(setEmitFlags(e.createSuper(),8),r),8))));if(i){a.push(e.createPropertyAssignment("set",e.createArrowFunction(void 0,void 0,[e.createParameterDeclaration(void 0,void 0,"v",void 0,void 0,void 0)],void 0,void 0,e.createAssignment(setEmitFlags(e.createPropertyAccessExpression(setEmitFlags(e.createSuper(),8),r),8),e.createIdentifier("v")))))}o.push(e.createPropertyAssignment(r,e.createObjectLiteralExpression(a)))}));return e.createVariableStatement(void 0,e.createVariableDeclarationList([e.createVariableDeclaration(e.createUniqueName("_super",16|32),void 0,void 0,e.createCallExpression(e.createPropertyAccessExpression(e.createIdentifier("Object"),"create"),void 0,[e.createNull(),e.createObjectLiteralExpression(o,true)]))],2))}function transformES2018(e){const{factory:t,getEmitHelperFactory:n,resumeLexicalEnvironment:r,endLexicalEnvironment:i,hoistVariableDeclaration:o}=e;const a=e.getEmitResolver();const s=e.getCompilerOptions();const c=zn(s);const l=e.onEmitNode;e.onEmitNode=onEmitNode;const d=e.onSubstituteNode;e.onSubstituteNode=onSubstituteNode;let p=false;let u=0;let f;let m;let _=0;let g=0;let y;let h;let T;let v;const x=[];return chainBundle(e,transformSourceFile);function affectsSubtree(e,t){return g!==(g&~e|t)}function enterSubtree(e,t){const n=g;g=(g&~e|t)&3;return n}function exitSubtree(e){g=e}function recordTaggedTemplateString(e){h=append(h,t.createVariableDeclaration(e))}function transformSourceFile(t){if(t.isDeclarationFile){return t}y=t;const n=visitSourceFile(t);addEmitHelpers(n,e.readEmitHelpers());y=void 0;h=void 0;return n}function visitor(e){return visitorWorker(e,false)}function visitorWithUnusedExpressionResult(e){return visitorWorker(e,true)}function visitorNoAsyncModifier(e){if(e.kind===134){return void 0}return e}function doWithHierarchyFacts(e,t,n,r){if(affectsSubtree(n,r)){const i=enterSubtree(n,r);const o=e(t);exitSubtree(i);return o}return e(t)}function visitDefault(t){return visitEachChild(t,visitor,e)}function visitorWorker(t,n){if((t.transformFlags&128)===0){return t}switch(t.kind){case 223:return visitAwaitExpression(t);case 229:return visitYieldExpression(t);case 253:return visitReturnStatement(t);case 256:return visitLabeledStatement(t);case 210:return visitObjectLiteralExpression(t);case 226:return visitBinaryExpression(t,n);case 356:return visitCommaListExpression(t,n);case 299:return visitCatchClause(t);case 243:return visitVariableStatement(t);case 260:return visitVariableDeclaration(t);case 246:case 247:case 249:return doWithHierarchyFacts(visitDefault,t,0,2);case 250:return visitForOfStatement(t,void 0);case 248:return doWithHierarchyFacts(visitForStatement,t,0,2);case 222:return visitVoidExpression(t);case 176:return doWithHierarchyFacts(visitConstructorDeclaration,t,2,1);case 174:return doWithHierarchyFacts(visitMethodDeclaration,t,2,1);case 177:return doWithHierarchyFacts(visitGetAccessorDeclaration,t,2,1);case 178:return doWithHierarchyFacts(visitSetAccessorDeclaration,t,2,1);case 262:return doWithHierarchyFacts(visitFunctionDeclaration,t,2,1);case 218:return doWithHierarchyFacts(visitFunctionExpression,t,2,1);case 219:return doWithHierarchyFacts(visitArrowFunction,t,2,0);case 169:return visitParameter(t);case 244:return visitExpressionStatement(t);case 217:return visitParenthesizedExpression(t,n);case 215:return visitTaggedTemplateExpression(t);case 211:if(T&&isPropertyAccessExpression(t)&&t.expression.kind===108){T.add(t.name.escapedText)}return visitEachChild(t,visitor,e);case 212:if(T&&t.expression.kind===108){v=true}return visitEachChild(t,visitor,e);case 263:case 231:return doWithHierarchyFacts(visitDefault,t,2,1);default:return visitEachChild(t,visitor,e)}}function visitAwaitExpression(r){if(f&2&&f&1){return setOriginalNode(setTextRange(t.createYieldExpression(void 0,n().createAwaitHelper(visitNode(r.expression,visitor,isExpression))),r),r)}return visitEachChild(r,visitor,e)}function visitYieldExpression(r){if(f&2&&f&1){if(r.asteriskToken){const e=visitNode(S.checkDefined(r.expression),visitor,isExpression);return setOriginalNode(setTextRange(t.createYieldExpression(void 0,n().createAwaitHelper(t.updateYieldExpression(r,r.asteriskToken,setTextRange(n().createAsyncDelegatorHelper(setTextRange(n().createAsyncValuesHelper(e),e)),e)))),r),r)}return setOriginalNode(setTextRange(t.createYieldExpression(void 0,createDownlevelAwait(r.expression?visitNode(r.expression,visitor,isExpression):t.createVoidZero())),r),r)}return visitEachChild(r,visitor,e)}function visitReturnStatement(n){if(f&2&&f&1){return t.updateReturnStatement(n,createDownlevelAwait(n.expression?visitNode(n.expression,visitor,isExpression):t.createVoidZero()))}return visitEachChild(n,visitor,e)}function visitLabeledStatement(n){if(f&2){const e=unwrapInnermostStatementOfLabel(n);if(e.kind===250&&e.awaitModifier){return visitForOfStatement(e,n)}return t.restoreEnclosingLabel(visitNode(e,visitor,isStatement,t.liftToBlock),n)}return visitEachChild(n,visitor,e)}function chunkObjectLiteralElements(e){let n;const r=[];for(const i of e){if(i.kind===305){if(n){r.push(t.createObjectLiteralExpression(n));n=void 0}const e=i.expression;r.push(visitNode(e,visitor,isExpression))}else{n=append(n,i.kind===303?t.createPropertyAssignment(i.name,visitNode(i.initializer,visitor,isExpression)):visitNode(i,visitor,isObjectLiteralElementLike))}}if(n){r.push(t.createObjectLiteralExpression(n))}return r}function visitObjectLiteralExpression(r){if(r.transformFlags&65536){const e=chunkObjectLiteralElements(r.properties);if(e.length&&e[0].kind!==210){e.unshift(t.createObjectLiteralExpression())}let i=e[0];if(e.length>1){for(let t=1;t=2&&(a.hasNodeCheckFlag(o,256)||a.hasNodeCheckFlag(o,128));if(m){enableSubstitutionForAsyncMethodsWithSuper();const e=createSuperAccessVariableStatement(t,a,o,T);x[getNodeId(e)]=true;insertStatementsAfterStandardPrologue(p,[e])}p.push(f);const _=t.updateBlock(o.body,p);if(m&&v){if(a.hasNodeCheckFlag(o,256)){addEmitHelper(_,Ci)}else if(a.hasNodeCheckFlag(o,128)){addEmitHelper(_,bi)}}T=l;v=d;return _}function transformFunctionBody2(e){r();let n=0;const o=[];const a=visitNode(e.body,visitor,isConciseBody)??t.createBlock([]);if(isBlock(a)){n=t.copyPrologue(a.statements,o,false,visitor)}addRange(o,appendObjectRestAssignmentsIfNeeded(void 0,e));const s=i();if(n>0||some(o)||some(s)){const e=t.converters.convertToFunctionBlock(a,true);insertStatementsAfterStandardPrologue(o,s);addRange(o,e.statements.slice(n));return t.updateBlock(e,setTextRange(t.createNodeArray(o),e.statements))}return a}function appendObjectRestAssignmentsIfNeeded(n,r){let i=false;for(const o of r.parameters){if(i){if(isBindingPattern(o.name)){if(o.name.elements.length>0){const r=flattenDestructuringBinding(o,visitor,e,0,t.getGeneratedNameForNode(o));if(some(r)){const e=t.createVariableDeclarationList(r);const i=t.createVariableStatement(void 0,e);setEmitFlags(i,2097152);n=append(n,i)}}else if(o.initializer){const e=t.getGeneratedNameForNode(o);const r=visitNode(o.initializer,visitor,isExpression);const i=t.createAssignment(e,r);const a=t.createExpressionStatement(i);setEmitFlags(a,2097152);n=append(n,a)}}else if(o.initializer){const e=t.cloneNode(o.name);setTextRange(e,o.name);setEmitFlags(e,96);const r=visitNode(o.initializer,visitor,isExpression);addEmitFlags(r,96|3072);const i=t.createAssignment(e,r);setTextRange(i,o);setEmitFlags(i,3072);const a=t.createBlock([t.createExpressionStatement(i)]);setTextRange(a,o);setEmitFlags(a,1|64|768|3072);const s=t.createTypeCheck(t.cloneNode(o.name),"undefined");const c=t.createIfStatement(s,a);startOnNewLine(c);setTextRange(c,o);setEmitFlags(c,768|64|2097152|3072);n=append(n,c)}}else if(o.transformFlags&65536){i=true;const r=flattenDestructuringBinding(o,visitor,e,1,t.getGeneratedNameForNode(o),false,true);if(some(r)){const e=t.createVariableDeclarationList(r);const i=t.createVariableStatement(void 0,e);setEmitFlags(i,2097152);n=append(n,i)}}}return n}function enableSubstitutionForAsyncMethodsWithSuper(){if((u&1)===0){u|=1;e.enableSubstitution(213);e.enableSubstitution(211);e.enableSubstitution(212);e.enableEmitNotification(263);e.enableEmitNotification(174);e.enableEmitNotification(177);e.enableEmitNotification(178);e.enableEmitNotification(176);e.enableEmitNotification(243)}}function onEmitNode(e,t,n){if(u&1&&isSuperContainer(t)){const r=(a.hasNodeCheckFlag(t,128)?128:0)|(a.hasNodeCheckFlag(t,256)?256:0);if(r!==_){const i=_;_=r;l(e,t,n);_=i;return}}else if(u&&x[getNodeId(t)]){const r=_;_=0;l(e,t,n);_=r;return}l(e,t,n)}function onSubstituteNode(e,t){t=d(e,t);if(e===1&&_){return substituteExpression(t)}return t}function substituteExpression(e){switch(e.kind){case 211:return substitutePropertyAccessExpression(e);case 212:return substituteElementAccessExpression(e);case 213:return substituteCallExpression(e)}return e}function substitutePropertyAccessExpression(e){if(e.expression.kind===108){return setTextRange(t.createPropertyAccessExpression(t.createUniqueName("_super",16|32),e.name),e)}return e}function substituteElementAccessExpression(e){if(e.expression.kind===108){return createSuperElementAccessInAsyncMethod(e.argumentExpression,e)}return e}function substituteCallExpression(e){const n=e.expression;if(isSuperProperty(n)){const r=isPropertyAccessExpression(n)?substitutePropertyAccessExpression(n):substituteElementAccessExpression(n);return t.createCallExpression(t.createPropertyAccessExpression(r,"call"),void 0,[t.createThis(),...e.arguments])}return e}function isSuperContainer(e){const t=e.kind;return t===263||t===176||t===174||t===177||t===178}function createSuperElementAccessInAsyncMethod(e,n){if(_&256){return setTextRange(t.createPropertyAccessExpression(t.createCallExpression(t.createIdentifier("_superIndex"),void 0,[e]),"value"),n)}else{return setTextRange(t.createCallExpression(t.createIdentifier("_superIndex"),void 0,[e]),n)}}}function transformES2019(e){const t=e.factory;return chainBundle(e,transformSourceFile);function transformSourceFile(t){if(t.isDeclarationFile){return t}return visitEachChild(t,visitor,e)}function visitor(t){if((t.transformFlags&64)===0){return t}switch(t.kind){case 299:return visitCatchClause(t);default:return visitEachChild(t,visitor,e)}}function visitCatchClause(n){if(!n.variableDeclaration){return t.updateCatchClause(n,t.createVariableDeclaration(t.createTempVariable(void 0)),visitNode(n.block,visitor,isBlock))}return visitEachChild(n,visitor,e)}}function transformES2020(e){const{factory:t,hoistVariableDeclaration:n}=e;return chainBundle(e,transformSourceFile);function transformSourceFile(t){if(t.isDeclarationFile){return t}return visitEachChild(t,visitor,e)}function visitor(t){if((t.transformFlags&32)===0){return t}switch(t.kind){case 213:{const e=visitNonOptionalCallExpression(t,false);S.assertNotNode(e,isSyntheticReference);return e}case 211:case 212:if(isOptionalChain(t)){const e=visitOptionalExpression(t,false,false);S.assertNotNode(e,isSyntheticReference);return e}return visitEachChild(t,visitor,e);case 226:if(t.operatorToken.kind===61){return transformNullishCoalescingExpression(t)}return visitEachChild(t,visitor,e);case 220:return visitDeleteExpression(t);default:return visitEachChild(t,visitor,e)}}function flattenChain(e){S.assertNotNode(e,isNonNullChain);const t=[e];while(!e.questionDotToken&&!isTaggedTemplateExpression(e)){e=cast(skipPartiallyEmittedExpressions(e.expression),isOptionalChain);S.assertNotNode(e,isNonNullChain);t.unshift(e)}return{expression:e.expression,chain:t}}function visitNonOptionalParenthesizedExpression(e,n,r){const i=visitNonOptionalExpression(e.expression,n,r);if(isSyntheticReference(i)){return t.createSyntheticReferenceExpression(t.updateParenthesizedExpression(e,i.expression),i.thisArg)}return t.updateParenthesizedExpression(e,i)}function visitNonOptionalPropertyOrElementAccessExpression(e,r,i){if(isOptionalChain(e)){return visitOptionalExpression(e,r,i)}let o=visitNode(e.expression,visitor,isExpression);S.assertNotNode(o,isSyntheticReference);let a;if(r){if(!isSimpleCopiableExpression(o)){a=t.createTempVariable(n);o=t.createAssignment(a,o)}else{a=o}}o=e.kind===211?t.updatePropertyAccessExpression(e,o,visitNode(e.name,visitor,isIdentifier)):t.updateElementAccessExpression(e,o,visitNode(e.argumentExpression,visitor,isExpression));return a?t.createSyntheticReferenceExpression(o,a):o}function visitNonOptionalCallExpression(n,r){if(isOptionalChain(n)){return visitOptionalExpression(n,r,false)}if(isParenthesizedExpression(n.expression)&&isOptionalChain(skipParentheses(n.expression))){const e=visitNonOptionalParenthesizedExpression(n.expression,true,false);const r=visitNodes2(n.arguments,visitor,isExpression);if(isSyntheticReference(e)){return setTextRange(t.createFunctionCallCall(e.expression,e.thisArg,r),n)}return t.updateCallExpression(n,e,void 0,r)}return visitEachChild(n,visitor,e)}function visitNonOptionalExpression(e,t,n){switch(e.kind){case 217:return visitNonOptionalParenthesizedExpression(e,t,n);case 211:case 212:return visitNonOptionalPropertyOrElementAccessExpression(e,t,n);case 213:return visitNonOptionalCallExpression(e,t);default:return visitNode(e,visitor,isExpression)}}function visitOptionalExpression(e,r,i){const{expression:o,chain:a}=flattenChain(e);const s=visitNonOptionalExpression(skipPartiallyEmittedExpressions(o),isCallChain(a[0]),false);let c=isSyntheticReference(s)?s.thisArg:void 0;let l=isSyntheticReference(s)?s.expression:s;let d=t.restoreOuterExpressions(o,l,8);if(!isSimpleCopiableExpression(l)){l=t.createTempVariable(n);d=t.createAssignment(l,d)}let p=l;let u;for(let e=0;ee){addRange(c,visitNodes2(n.statements,visitor,isStatement,e,d-e))}break}d++}S.assert(dvisitCaseOrDefaultClause(t,e)))))],e,r===2)}return visitEachChild(n,visitor,e)}function transformUsingDeclarations(r,i,o,a,s){const c=[];for(let s=i;st)t=e}return t}function getUsingKindOfCaseOrDefaultClauses(e){let t=0;for(const n of e){const e=getUsingKindOfStatements(n.statements);if(e===2)return 2;if(e>t)t=e}return t}function transformJsx(e){const{factory:t,getEmitHelperFactory:n}=e;const r=e.getCompilerOptions();let i;let o;return chainBundle(e,transformSourceFile);function getCurrentFileNameExpression(){if(o.filenameDeclaration){return o.filenameDeclaration.name}const e=t.createVariableDeclaration(t.createUniqueName("_jsxFileName",16|32),void 0,void 0,t.createStringLiteral(i.fileName));o.filenameDeclaration=e;return o.filenameDeclaration.name}function getJsxFactoryCalleePrimitive(e){return r.jsx===5?"jsxDEV":e?"jsxs":"jsx"}function getJsxFactoryCallee(e){const t=getJsxFactoryCalleePrimitive(e);return getImplicitImportForName(t)}function getImplicitJsxFragmentReference(){return getImplicitImportForName("Fragment")}function getImplicitImportForName(e){var n,i;const a=e==="createElement"?o.importSpecifier:getJSXRuntimeImport(o.importSpecifier,r);const s=(i=(n=o.utilizedImplicitRuntimeImports)==null?void 0:n.get(a))==null?void 0:i.get(e);if(s){return s.name}if(!o.utilizedImplicitRuntimeImports){o.utilizedImplicitRuntimeImports=new Map}let c=o.utilizedImplicitRuntimeImports.get(a);if(!c){c=new Map;o.utilizedImplicitRuntimeImports.set(a,c)}const l=t.createUniqueName(`_${e}`,16|32|64);const d=t.createImportSpecifier(false,t.createIdentifier(e),l);setIdentifierGeneratedImportReference(l,d);c.set(e,d);return l}function transformSourceFile(n){if(n.isDeclarationFile){return n}i=n;o={};o.importSpecifier=getJSXImplicitImportBase(r,n);let a=visitEachChild(n,visitor,e);addEmitHelpers(a,e.readEmitHelpers());let s=a.statements;if(o.filenameDeclaration){s=insertStatementAfterCustomPrologue(s.slice(),t.createVariableStatement(void 0,t.createVariableDeclarationList([o.filenameDeclaration],2)))}if(o.utilizedImplicitRuntimeImports){for(const[e,r]of arrayFrom(o.utilizedImplicitRuntimeImports.entries())){if(isExternalModule(n)){const n=t.createImportDeclaration(void 0,t.createImportClause(false,void 0,t.createNamedImports(arrayFrom(r.values()))),t.createStringLiteral(e),void 0);setParentRecursive(n,false);s=insertStatementAfterCustomPrologue(s.slice(),n)}else if(isExternalOrCommonJsModule(n)){const n=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createObjectBindingPattern(arrayFrom(r.values(),(e=>t.createBindingElement(void 0,e.propertyName,e.name)))),void 0,void 0,t.createCallExpression(t.createIdentifier("require"),void 0,[t.createStringLiteral(e)]))],2));setParentRecursive(n,false);s=insertStatementAfterCustomPrologue(s.slice(),n)}else{}}}if(s!==a.statements){a=t.updateSourceFile(a,s)}o=void 0;return a}function visitor(e){if(e.transformFlags&2){return visitorWorker(e)}else{return e}}function visitorWorker(t){switch(t.kind){case 284:return visitJsxElement(t,false);case 285:return visitJsxSelfClosingElement(t,false);case 288:return visitJsxFragment(t,false);case 294:return visitJsxExpression(t);default:return visitEachChild(t,visitor,e)}}function transformJsxChildToExpression(e){switch(e.kind){case 12:return visitJsxText(e);case 294:return visitJsxExpression(e);case 284:return visitJsxElement(e,true);case 285:return visitJsxSelfClosingElement(e,true);case 288:return visitJsxFragment(e,true);default:return S.failBadSyntaxKind(e)}}function hasProto(e){return e.properties.some((e=>isPropertyAssignment(e)&&(isIdentifier(e.name)&&idText(e.name)==="__proto__"||isStringLiteral(e.name)&&e.name.text==="__proto__")))}function hasKeyAfterPropsSpread(e){let t=false;for(const n of e.attributes.properties){if(isJsxSpreadAttribute(n)&&(!isObjectLiteralExpression(n.expression)||n.expression.properties.some(isSpreadAssignment))){t=true}else if(t&&isJsxAttribute(n)&&isIdentifier(n.name)&&n.name.escapedText==="key"){return true}}return false}function shouldUseCreateElement(e){return o.importSpecifier===void 0||hasKeyAfterPropsSpread(e)}function visitJsxElement(e,t){const n=shouldUseCreateElement(e.openingElement)?visitJsxOpeningLikeElementCreateElement:visitJsxOpeningLikeElementJSX;return n(e.openingElement,e.children,t,e)}function visitJsxSelfClosingElement(e,t){const n=shouldUseCreateElement(e)?visitJsxOpeningLikeElementCreateElement:visitJsxOpeningLikeElementJSX;return n(e,void 0,t,e)}function visitJsxFragment(e,t){const n=o.importSpecifier===void 0?visitJsxOpeningFragmentCreateElement:visitJsxOpeningFragmentJSX;return n(e.openingFragment,e.children,t,e)}function convertJsxChildrenToChildrenPropObject(e){const n=convertJsxChildrenToChildrenPropAssignment(e);return n&&t.createObjectLiteralExpression([n])}function convertJsxChildrenToChildrenPropAssignment(e){const n=getSemanticJsxChildren(e);if(length(n)===1&&!n[0].dotDotDotToken){const e=transformJsxChildToExpression(n[0]);return e&&t.createPropertyAssignment("children",e)}const r=mapDefined(e,transformJsxChildToExpression);return length(r)?t.createPropertyAssignment("children",t.createArrayLiteralExpression(r)):void 0}function visitJsxOpeningLikeElementJSX(e,n,r,i){const o=getTagName(e);const a=n&&n.length?convertJsxChildrenToChildrenPropAssignment(n):void 0;const s=find(e.attributes.properties,(e=>!!e.name&&isIdentifier(e.name)&&e.name.escapedText==="key"));const c=s?filter(e.attributes.properties,(e=>e!==s)):e.attributes.properties;const l=length(c)?transformJsxAttributesToObjectProps(c,a):t.createObjectLiteralExpression(a?[a]:d);return visitJsxOpeningLikeElementOrFragmentJSX(o,l,s,n||d,r,i)}function visitJsxOpeningLikeElementOrFragmentJSX(e,n,o,a,s,c){var l;const d=getSemanticJsxChildren(a);const p=length(d)>1||!!((l=d[0])==null?void 0:l.dotDotDotToken);const u=[e,n];if(o){u.push(transformJsxAttributeInitializer(o.initializer))}if(r.jsx===5){const e=getOriginalNode(i);if(e&&isSourceFile(e)){if(o===void 0){u.push(t.createVoidZero())}u.push(p?t.createTrue():t.createFalse());const n=getLineAndCharacterOfPosition(e,c.pos);u.push(t.createObjectLiteralExpression([t.createPropertyAssignment("fileName",getCurrentFileNameExpression()),t.createPropertyAssignment("lineNumber",t.createNumericLiteral(n.line+1)),t.createPropertyAssignment("columnNumber",t.createNumericLiteral(n.character+1))]));u.push(t.createThis())}}const f=setTextRange(t.createCallExpression(getJsxFactoryCallee(p),void 0,u),c);if(s){startOnNewLine(f)}return f}function visitJsxOpeningLikeElementCreateElement(n,a,s,c){const l=getTagName(n);const d=n.attributes.properties;const p=length(d)?transformJsxAttributesToObjectProps(d):t.createNull();const u=o.importSpecifier===void 0?createJsxFactoryExpression(t,e.getEmitResolver().getJsxFactoryEntity(i),r.reactNamespace,n):getImplicitImportForName("createElement");const f=createExpressionForJsxElement(t,u,l,p,mapDefined(a,transformJsxChildToExpression),c);if(s){startOnNewLine(f)}return f}function visitJsxOpeningFragmentJSX(e,n,r,i){let o;if(n&&n.length){const e=convertJsxChildrenToChildrenPropObject(n);if(e){o=e}}return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(),o||t.createObjectLiteralExpression([]),void 0,n,r,i)}function visitJsxOpeningFragmentCreateElement(n,o,a,s){const c=createExpressionForJsxFragment(t,e.getEmitResolver().getJsxFactoryEntity(i),e.getEmitResolver().getJsxFragmentFactoryEntity(i),r.reactNamespace,mapDefined(o,transformJsxChildToExpression),n,s);if(a){startOnNewLine(c)}return c}function transformJsxSpreadAttributeToProps(e){if(isObjectLiteralExpression(e.expression)&&!hasProto(e.expression)){return sameMap(e.expression.properties,(e=>S.checkDefined(visitNode(e,visitor,isObjectLiteralElementLike))))}return t.createSpreadAssignment(S.checkDefined(visitNode(e.expression,visitor,isExpression)))}function transformJsxAttributesToObjectProps(e,n){const i=zn(r);return i&&i>=5?t.createObjectLiteralExpression(transformJsxAttributesToProps(e,n)):transformJsxAttributesToExpression(e,n)}function transformJsxAttributesToProps(e,t){const n=flatten(spanMap(e,isJsxSpreadAttribute,((e,t)=>flatten(map(e,(e=>t?transformJsxSpreadAttributeToProps(e):transformJsxAttributeToObjectLiteralElement(e)))))));if(t){n.push(t)}return n}function transformJsxAttributesToExpression(e,r){const i=[];let o=[];for(const t of e){if(isJsxSpreadAttribute(t)){if(isObjectLiteralExpression(t.expression)&&!hasProto(t.expression)){for(const e of t.expression.properties){if(isSpreadAssignment(e)){finishObjectLiteralIfNeeded();i.push(S.checkDefined(visitNode(e.expression,visitor,isExpression)));continue}o.push(S.checkDefined(visitNode(e,visitor)))}continue}finishObjectLiteralIfNeeded();i.push(S.checkDefined(visitNode(t.expression,visitor,isExpression)));continue}o.push(transformJsxAttributeToObjectLiteralElement(t))}if(r){o.push(r)}finishObjectLiteralIfNeeded();if(i.length&&!isObjectLiteralExpression(i[0])){i.unshift(t.createObjectLiteralExpression())}return singleOrUndefined(i)||n().createAssignHelper(i);function finishObjectLiteralIfNeeded(){if(o.length){i.push(t.createObjectLiteralExpression(o));o=[]}}}function transformJsxAttributeToObjectLiteralElement(e){const n=getAttributeName(e);const r=transformJsxAttributeInitializer(e.initializer);return t.createPropertyAssignment(n,r)}function transformJsxAttributeInitializer(e){if(e===void 0){return t.createTrue()}if(e.kind===11){const n=e.singleQuote!==void 0?e.singleQuote:!isStringDoubleQuoted(e,i);const r=t.createStringLiteral(tryDecodeEntities(e.text)||e.text,n);return setTextRange(r,e)}if(e.kind===294){if(e.expression===void 0){return t.createTrue()}return S.checkDefined(visitNode(e.expression,visitor,isExpression))}if(isJsxElement(e)){return visitJsxElement(e,false)}if(isJsxSelfClosingElement(e)){return visitJsxSelfClosingElement(e,false)}if(isJsxFragment(e)){return visitJsxFragment(e,false)}return S.failBadSyntaxKind(e)}function visitJsxText(e){const n=fixupWhitespaceAndDecodeEntities(e.text);return n===void 0?void 0:t.createStringLiteral(n)}function fixupWhitespaceAndDecodeEntities(e){let t;let n=0;let r=-1;for(let i=0;i{if(i){return utf16EncodeAsString(parseInt(i,10))}else if(o){return utf16EncodeAsString(parseInt(o,16))}else{const t=xa.get(a);return t?utf16EncodeAsString(t):e}}))}function tryDecodeEntities(e){const t=decodeEntities(e);return t===e?void 0:t}function getTagName(e){if(e.kind===284){return getTagName(e.openingElement)}else{const n=e.tagName;if(isIdentifier(n)&&isIntrinsicJsxName(n.escapedText)){return t.createStringLiteral(idText(n))}else if(isJsxNamespacedName(n)){return t.createStringLiteral(idText(n.namespace)+":"+idText(n.name))}else{return createExpressionFromEntityName(t,n)}}}function getAttributeName(e){const n=e.name;if(isIdentifier(n)){const e=idText(n);return/^[A-Z_]\w*$/i.test(e)?n:t.createStringLiteral(e)}return t.createStringLiteral(idText(n.namespace)+":"+idText(n.name))}function visitJsxExpression(e){const n=visitNode(e.expression,visitor,isExpression);return e.dotDotDotToken?t.createSpreadElement(n):n}}var xa=new Map(Object.entries({quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}));function transformES2016(e){const{factory:t,hoistVariableDeclaration:n}=e;return chainBundle(e,transformSourceFile);function transformSourceFile(t){if(t.isDeclarationFile){return t}return visitEachChild(t,visitor,e)}function visitor(t){if((t.transformFlags&512)===0){return t}switch(t.kind){case 226:return visitBinaryExpression(t);default:return visitEachChild(t,visitor,e)}}function visitBinaryExpression(t){switch(t.operatorToken.kind){case 68:return visitExponentiationAssignmentExpression(t);case 43:return visitExponentiationExpression(t);default:return visitEachChild(t,visitor,e)}}function visitExponentiationAssignmentExpression(e){let r;let i;const o=visitNode(e.left,visitor,isExpression);const a=visitNode(e.right,visitor,isExpression);if(isElementAccessExpression(o)){const e=t.createTempVariable(n);const a=t.createTempVariable(n);r=setTextRange(t.createElementAccessExpression(setTextRange(t.createAssignment(e,o.expression),o.expression),setTextRange(t.createAssignment(a,o.argumentExpression),o.argumentExpression)),o);i=setTextRange(t.createElementAccessExpression(e,a),o)}else if(isPropertyAccessExpression(o)){const e=t.createTempVariable(n);r=setTextRange(t.createPropertyAccessExpression(setTextRange(t.createAssignment(e,o.expression),o.expression),o.name),o);i=setTextRange(t.createPropertyAccessExpression(e,o.name),o)}else{r=o;i=o}return setTextRange(t.createAssignment(r,setTextRange(t.createGlobalMethodCall("Math","pow",[i,a]),e)),e)}function visitExponentiationExpression(e){const n=visitNode(e.left,visitor,isExpression);const r=visitNode(e.right,visitor,isExpression);return setTextRange(t.createGlobalMethodCall("Math","pow",[n,r]),e)}}function createSpreadSegment(e,t){return{kind:e,expression:t}}function transformES2015(e){const{factory:t,getEmitHelperFactory:n,startLexicalEnvironment:r,resumeLexicalEnvironment:i,endLexicalEnvironment:o,hoistVariableDeclaration:a}=e;const s=e.getCompilerOptions();const c=e.getEmitResolver();const l=e.onSubstituteNode;const d=e.onEmitNode;e.onEmitNode=onEmitNode;e.onSubstituteNode=onSubstituteNode;let p;let f;let m;let _;function recordTaggedTemplateString(e){_=append(_,t.createVariableDeclaration(e))}let g;let y=0;return chainBundle(e,transformSourceFile);function transformSourceFile(t){if(t.isDeclarationFile){return t}p=t;f=t.text;const n=visitSourceFile(t);addEmitHelpers(n,e.readEmitHelpers());p=void 0;f=void 0;_=void 0;m=0;return n}function enterSubtree(e,t){const n=m;m=(m&~e|t)&32767;return n}function exitSubtree(e,t,n){m=(m&~t|n)&-32768|e}function isReturnVoidStatementInConstructorWithCapturedSuper(e){return(m&8192)!==0&&e.kind===253&&!e.expression}function isOrMayContainReturnCompletion(e){return e.transformFlags&4194304&&(isReturnStatement(e)||isIfStatement(e)||isWithStatement(e)||isSwitchStatement(e)||isCaseBlock(e)||isCaseClause(e)||isDefaultClause(e)||isTryStatement(e)||isCatchClause(e)||isLabeledStatement(e)||isIterationStatement(e,false)||isBlock(e))}function shouldVisitNode(e){return(e.transformFlags&1024)!==0||g!==void 0||m&8192&&isOrMayContainReturnCompletion(e)||isIterationStatement(e,false)&&shouldConvertIterationStatement(e)||(getInternalEmitFlags(e)&1)!==0}function visitor(e){return shouldVisitNode(e)?visitorWorker(e,false):e}function visitorWithUnusedExpressionResult(e){return shouldVisitNode(e)?visitorWorker(e,true):e}function classWrapperStatementVisitor(e){if(shouldVisitNode(e)){const t=getOriginalNode(e);if(isPropertyDeclaration(t)&&hasStaticModifier(t)){const t=enterSubtree(32670,16449);const n=visitorWorker(e,false);exitSubtree(t,229376,0);return n}return visitorWorker(e,false)}return e}function callExpressionVisitor(e){if(e.kind===108){return visitSuperKeyword(e,true)}return visitor(e)}function visitorWorker(t,n){switch(t.kind){case 126:return void 0;case 263:return visitClassDeclaration(t);case 231:return visitClassExpression(t);case 169:return visitParameter(t);case 262:return visitFunctionDeclaration(t);case 219:return visitArrowFunction(t);case 218:return visitFunctionExpression(t);case 260:return visitVariableDeclaration(t);case 80:return visitIdentifier(t);case 261:return visitVariableDeclarationList(t);case 255:return visitSwitchStatement(t);case 269:return visitCaseBlock(t);case 241:return visitBlock(t,false);case 252:case 251:return visitBreakOrContinueStatement(t);case 256:return visitLabeledStatement(t);case 246:case 247:return visitDoOrWhileStatement(t,void 0);case 248:return visitForStatement(t,void 0);case 249:return visitForInStatement(t,void 0);case 250:return visitForOfStatement(t,void 0);case 244:return visitExpressionStatement(t);case 210:return visitObjectLiteralExpression(t);case 299:return visitCatchClause(t);case 304:return visitShorthandPropertyAssignment(t);case 167:return visitComputedPropertyName(t);case 209:return visitArrayLiteralExpression(t);case 213:return visitCallExpression(t);case 214:return visitNewExpression(t);case 217:return visitParenthesizedExpression(t,n);case 226:return visitBinaryExpression(t,n);case 356:return visitCommaListExpression(t,n);case 15:case 16:case 17:case 18:return visitTemplateLiteral(t);case 11:return visitStringLiteral(t);case 9:return visitNumericLiteral(t);case 215:return visitTaggedTemplateExpression(t);case 228:return visitTemplateExpression(t);case 229:return visitYieldExpression(t);case 230:return visitSpreadElement(t);case 108:return visitSuperKeyword(t,false);case 110:return visitThisKeyword(t);case 236:return visitMetaProperty(t);case 174:return visitMethodDeclaration(t);case 177:case 178:return visitAccessorDeclaration(t);case 243:return visitVariableStatement(t);case 253:return visitReturnStatement(t);case 222:return visitVoidExpression(t);default:return visitEachChild(t,visitor,e)}}function visitSourceFile(e){const n=enterSubtree(8064,64);const i=[];const a=[];r();const s=t.copyPrologue(e.statements,i,false,visitor);addRange(a,visitNodes2(e.statements,visitor,isStatement,s));if(_){a.push(t.createVariableStatement(void 0,t.createVariableDeclarationList(_)))}t.mergeLexicalEnvironment(i,o());insertCaptureThisForNodeIfNeeded(i,e);exitSubtree(n,0,0);return t.updateSourceFile(e,setTextRange(t.createNodeArray(concatenate(i,a)),e.statements))}function visitSwitchStatement(t){if(g!==void 0){const n=g.allowedNonLabeledJumps;g.allowedNonLabeledJumps|=2;const r=visitEachChild(t,visitor,e);g.allowedNonLabeledJumps=n;return r}return visitEachChild(t,visitor,e)}function visitCaseBlock(t){const n=enterSubtree(7104,0);const r=visitEachChild(t,visitor,e);exitSubtree(n,0,0);return r}function returnCapturedThis(e){return setOriginalNode(t.createReturnStatement(createCapturedThis()),e)}function createCapturedThis(){return t.createUniqueName("_this",16|32)}function visitReturnStatement(n){if(g){g.nonLocalJumps|=8;if(isReturnVoidStatementInConstructorWithCapturedSuper(n)){n=returnCapturedThis(n)}return t.createReturnStatement(t.createObjectLiteralExpression([t.createPropertyAssignment(t.createIdentifier("value"),n.expression?S.checkDefined(visitNode(n.expression,visitor,isExpression)):t.createVoidZero())]))}else if(isReturnVoidStatementInConstructorWithCapturedSuper(n)){return returnCapturedThis(n)}return visitEachChild(n,visitor,e)}function visitThisKeyword(e){m|=65536;if(m&2&&!(m&16384)){m|=131072}if(g){if(m&2){g.containsLexicalThis=true;return e}return g.thisName||(g.thisName=t.createUniqueName("this"))}return e}function visitVoidExpression(t){return visitEachChild(t,visitorWithUnusedExpressionResult,e)}function visitIdentifier(e){if(g){if(c.isArgumentsLocalBinding(e)){return g.argumentsName||(g.argumentsName=t.createUniqueName("arguments"))}}if(e.flags&256){return setOriginalNode(setTextRange(t.createIdentifier(unescapeLeadingUnderscores(e.escapedText)),e),e)}return e}function visitBreakOrContinueStatement(n){if(g){const e=n.kind===252?2:4;const r=n.label&&g.labels&&g.labels.get(idText(n.label))||!n.label&&g.allowedNonLabeledJumps&e;if(!r){let e;const r=n.label;if(!r){if(n.kind===252){g.nonLocalJumps|=2;e="break"}else{g.nonLocalJumps|=4;e="continue"}}else{if(n.kind===252){e=`break-${r.escapedText}`;setLabeledJump(g,true,idText(r),e)}else{e=`continue-${r.escapedText}`;setLabeledJump(g,false,idText(r),e)}}let i=t.createStringLiteral(e);if(g.loopOutParameters.length){const e=g.loopOutParameters;let n;for(let r=0;risIdentifier(e.name)&&!e.initializer))}function containsSuperCall(e){if(isSuperCall(e)){return true}if(!(e.transformFlags&134217728)){return false}switch(e.kind){case 219:case 218:case 262:case 176:case 175:return false;case 177:case 178:case 174:case 172:{const t=e;if(isComputedPropertyName(t.name)){return!!forEachChild(t.name,containsSuperCall)}return false}}return!!forEachChild(e,containsSuperCall)}function transformConstructorBody(e,n,r,a){const s=!!r&&skipOuterExpressions(r.expression).kind!==106;if(!e)return createDefaultConstructorBody(n,s);const c=[];const l=[];i();const d=t.copyStandardPrologue(e.body.statements,c,0);if(a||containsSuperCall(e.body)){m|=8192}addRange(l,visitNodes2(e.body.statements,visitor,isStatement,d));const p=s||m&8192;addDefaultValueAssignmentsIfNeeded2(c,e);addRestParameterIfNeeded(c,e,a);insertCaptureNewTargetIfNeeded(c,e);if(p){insertCaptureThisForNode(c,e,createActualThis())}else{insertCaptureThisForNodeIfNeeded(c,e)}t.mergeLexicalEnvironment(c,o());if(p&&!isSufficientlyCoveredByReturnStatements(e.body)){l.push(t.createReturnStatement(createCapturedThis()))}const u=t.createBlock(setTextRange(t.createNodeArray([...c,...l]),e.body.statements),true);setTextRange(u,e.body);return simplifyConstructor(u,e.body,a)}function isCapturedThis(e){return isGeneratedIdentifier(e)&&idText(e)==="_this"}function isSyntheticSuper(e){return isGeneratedIdentifier(e)&&idText(e)==="_super"}function isThisCapturingVariableStatement(e){return isVariableStatement(e)&&e.declarationList.declarations.length===1&&isThisCapturingVariableDeclaration(e.declarationList.declarations[0])}function isThisCapturingVariableDeclaration(e){return isVariableDeclaration(e)&&isCapturedThis(e.name)&&!!e.initializer}function isThisCapturingAssignment(e){return isAssignmentExpression(e,true)&&isCapturedThis(e.left)}function isTransformedSuperCall(e){return isCallExpression(e)&&isPropertyAccessExpression(e.expression)&&isSyntheticSuper(e.expression.expression)&&isIdentifier(e.expression.name)&&(idText(e.expression.name)==="call"||idText(e.expression.name)==="apply")&&e.arguments.length>=1&&e.arguments[0].kind===110}function isTransformedSuperCallWithFallback(e){return isBinaryExpression(e)&&e.operatorToken.kind===57&&e.right.kind===110&&isTransformedSuperCall(e.left)}function isImplicitSuperCall(e){return isBinaryExpression(e)&&e.operatorToken.kind===56&&isBinaryExpression(e.left)&&e.left.operatorToken.kind===38&&isSyntheticSuper(e.left.left)&&e.left.right.kind===106&&isTransformedSuperCall(e.right)&&idText(e.right.expression.name)==="apply"}function isImplicitSuperCallWithFallback(e){return isBinaryExpression(e)&&e.operatorToken.kind===57&&e.right.kind===110&&isImplicitSuperCall(e.left)}function isThisCapturingTransformedSuperCallWithFallback(e){return isThisCapturingAssignment(e)&&isTransformedSuperCallWithFallback(e.right)}function isThisCapturingImplicitSuperCallWithFallback(e){return isThisCapturingAssignment(e)&&isImplicitSuperCallWithFallback(e.right)}function isTransformedSuperCallLike(e){return isTransformedSuperCall(e)||isTransformedSuperCallWithFallback(e)||isThisCapturingTransformedSuperCallWithFallback(e)||isImplicitSuperCall(e)||isImplicitSuperCallWithFallback(e)||isThisCapturingImplicitSuperCallWithFallback(e)}function simplifyConstructorInlineSuperInThisCaptureVariable(e){for(let n=0;n0;n--){const i=e.statements[n];if(isReturnStatement(i)&&i.expression&&isCapturedThis(i.expression)){const i=e.statements[n-1];let o;if(isExpressionStatement(i)&&isThisCapturingTransformedSuperCallWithFallback(skipOuterExpressions(i.expression))){o=i.expression}else if(r&&isThisCapturingVariableStatement(i)){const e=i.declarationList.declarations[0];if(isTransformedSuperCallLike(skipOuterExpressions(e.initializer))){o=t.createAssignment(createCapturedThis(),e.initializer)}}if(!o){break}const a=t.createReturnStatement(o);setOriginalNode(a,i);setTextRange(a,i);const s=t.createNodeArray([...e.statements.slice(0,n-1),a,...e.statements.slice(n+1)]);setTextRange(s,e.statements);return t.updateBlock(e,s)}}return e}function elideUnusedThisCaptureWorker(e){if(isThisCapturingVariableStatement(e)){const t=e.declarationList.declarations[0];if(t.initializer.kind===110){return void 0}}else if(isThisCapturingAssignment(e)){return t.createPartiallyEmittedExpression(e.right,e)}switch(e.kind){case 219:case 218:case 262:case 176:case 175:return e;case 177:case 178:case 174:case 172:{const n=e;if(isComputedPropertyName(n.name)){return t.replacePropertyName(n,visitEachChild(n.name,elideUnusedThisCaptureWorker,void 0))}return e}}return visitEachChild(e,elideUnusedThisCaptureWorker,void 0)}function simplifyConstructorElideUnusedThisCapture(e,n){if(n.transformFlags&16384||m&65536||m&131072){return e}for(const t of n.statements){if(t.transformFlags&134217728&&!getSuperCallFromStatement(t)){return e}}return t.updateBlock(e,visitNodes2(e.statements,elideUnusedThisCaptureWorker,isStatement))}function injectSuperPresenceCheckWorker(e){if(isTransformedSuperCall(e)&&e.arguments.length===2&&isIdentifier(e.arguments[1])&&idText(e.arguments[1])==="arguments"){return t.createLogicalAnd(t.createStrictInequality(createSyntheticSuper(),t.createNull()),e)}switch(e.kind){case 219:case 218:case 262:case 176:case 175:return e;case 177:case 178:case 174:case 172:{const n=e;if(isComputedPropertyName(n.name)){return t.replacePropertyName(n,visitEachChild(n.name,injectSuperPresenceCheckWorker,void 0))}return e}}return visitEachChild(e,injectSuperPresenceCheckWorker,void 0)}function complicateConstructorInjectSuperPresenceCheck(e){return t.updateBlock(e,visitNodes2(e.statements,injectSuperPresenceCheckWorker,isStatement))}function simplifyConstructor(e,t,n){const r=e;e=simplifyConstructorInlineSuperInThisCaptureVariable(e);e=simplifyConstructorInlineSuperReturn(e,t);if(e!==r){e=simplifyConstructorElideUnusedThisCapture(e,t)}if(n){e=complicateConstructorInjectSuperPresenceCheck(e)}return e}function isSufficientlyCoveredByReturnStatements(e){if(e.kind===253){return true}else if(e.kind===245){const t=e;if(t.elseStatement){return isSufficientlyCoveredByReturnStatements(t.thenStatement)&&isSufficientlyCoveredByReturnStatements(t.elseStatement)}}else if(e.kind===241){const t=lastOrUndefined(e.statements);if(t&&isSufficientlyCoveredByReturnStatements(t)){return true}}return false}function createActualThis(){return setEmitFlags(t.createThis(),8)}function createDefaultSuperCallOrThis(){return t.createLogicalOr(t.createLogicalAnd(t.createStrictInequality(createSyntheticSuper(),t.createNull()),t.createFunctionApplyCall(createSyntheticSuper(),createActualThis(),t.createIdentifier("arguments"))),createActualThis())}function visitParameter(e){if(e.dotDotDotToken){return void 0}else if(isBindingPattern(e.name)){return setOriginalNode(setTextRange(t.createParameterDeclaration(void 0,void 0,t.getGeneratedNameForNode(e),void 0,void 0,void 0),e),e)}else if(e.initializer){return setOriginalNode(setTextRange(t.createParameterDeclaration(void 0,void 0,e.name,void 0,void 0,void 0),e),e)}else{return e}}function hasDefaultValueOrBindingPattern(e){return e.initializer!==void 0||isBindingPattern(e.name)}function addDefaultValueAssignmentsIfNeeded2(e,t){if(!some(t.parameters,hasDefaultValueOrBindingPattern)){return false}let n=false;for(const r of t.parameters){const{name:t,initializer:i,dotDotDotToken:o}=r;if(o){continue}if(isBindingPattern(t)){n=insertDefaultValueAssignmentForBindingPattern(e,r,t,i)||n}else if(i){insertDefaultValueAssignmentForInitializer(e,r,t,i);n=true}}return n}function insertDefaultValueAssignmentForBindingPattern(n,r,i,o){if(i.elements.length>0){insertStatementAfterCustomPrologue(n,setEmitFlags(t.createVariableStatement(void 0,t.createVariableDeclarationList(flattenDestructuringBinding(r,visitor,e,0,t.getGeneratedNameForNode(r)))),2097152));return true}else if(o){insertStatementAfterCustomPrologue(n,setEmitFlags(t.createExpressionStatement(t.createAssignment(t.getGeneratedNameForNode(r),S.checkDefined(visitNode(o,visitor,isExpression)))),2097152));return true}return false}function insertDefaultValueAssignmentForInitializer(e,n,r,i){i=S.checkDefined(visitNode(i,visitor,isExpression));const o=t.createIfStatement(t.createTypeCheck(t.cloneNode(r),"undefined"),setEmitFlags(setTextRange(t.createBlock([t.createExpressionStatement(setEmitFlags(setTextRange(t.createAssignment(setEmitFlags(setParent(setTextRange(t.cloneNode(r),r),r.parent),96),setEmitFlags(i,96|getEmitFlags(i)|3072)),n),3072))]),n),1|64|768|3072));startOnNewLine(o);setTextRange(o,n);setEmitFlags(o,768|64|2097152|3072);insertStatementAfterCustomPrologue(e,o)}function shouldAddRestParameter(e,t){return!!(e&&e.dotDotDotToken&&!t)}function addRestParameterIfNeeded(n,r,i){const o=[];const a=lastOrUndefined(r.parameters);if(!shouldAddRestParameter(a,i)){return false}const s=a.name.kind===80?setParent(setTextRange(t.cloneNode(a.name),a.name),a.name.parent):t.createTempVariable(void 0);setEmitFlags(s,96);const c=a.name.kind===80?t.cloneNode(a.name):s;const l=r.parameters.length-1;const d=t.createLoopVariable();o.push(setEmitFlags(setTextRange(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(s,void 0,void 0,t.createArrayLiteralExpression([]))])),a),2097152));const p=t.createForStatement(setTextRange(t.createVariableDeclarationList([t.createVariableDeclaration(d,void 0,void 0,t.createNumericLiteral(l))]),a),setTextRange(t.createLessThan(d,t.createPropertyAccessExpression(t.createIdentifier("arguments"),"length")),a),setTextRange(t.createPostfixIncrement(d),a),t.createBlock([startOnNewLine(setTextRange(t.createExpressionStatement(t.createAssignment(t.createElementAccessExpression(c,l===0?d:t.createSubtract(d,t.createNumericLiteral(l))),t.createElementAccessExpression(t.createIdentifier("arguments"),d))),a))]));setEmitFlags(p,2097152);startOnNewLine(p);o.push(p);if(a.name.kind!==80){o.push(setEmitFlags(setTextRange(t.createVariableStatement(void 0,t.createVariableDeclarationList(flattenDestructuringBinding(a,visitor,e,0,c))),a),2097152))}insertStatementsAfterCustomPrologue(n,o);return true}function insertCaptureThisForNodeIfNeeded(e,n){if(m&131072&&n.kind!==219){insertCaptureThisForNode(e,n,t.createThis());return true}return false}function insertCaptureThisForNode(e,n,r){enableSubstitutionsForCapturedThis();const i=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(createCapturedThis(),void 0,void 0,r)]));setEmitFlags(i,3072|2097152);setSourceMapRange(i,n);insertStatementAfterCustomPrologue(e,i)}function insertCaptureNewTargetIfNeeded(e,n){if(m&32768){let r;switch(n.kind){case 219:return e;case 174:case 177:case 178:r=t.createVoidZero();break;case 176:r=t.createPropertyAccessExpression(setEmitFlags(t.createThis(),8),"constructor");break;case 262:case 218:r=t.createConditionalExpression(t.createLogicalAnd(setEmitFlags(t.createThis(),8),t.createBinaryExpression(setEmitFlags(t.createThis(),8),104,t.getLocalName(n))),void 0,t.createPropertyAccessExpression(setEmitFlags(t.createThis(),8),"constructor"),void 0,t.createVoidZero());break;default:return S.failBadSyntaxKind(n)}const i=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createUniqueName("_newTarget",16|32),void 0,void 0,r)]));setEmitFlags(i,3072|2097152);insertStatementAfterCustomPrologue(e,i)}return e}function addClassMembers(e,t){for(const n of t.members){switch(n.kind){case 240:e.push(transformSemicolonClassElementToStatement(n));break;case 174:e.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(t,n),n,t));break;case 177:case 178:const r=getAllAccessorDeclarations(t.members,n);if(n===r.firstAccessor){e.push(transformAccessorsToStatement(getClassMemberPrefix(t,n),r,t))}break;case 176:case 175:break;default:S.failBadSyntaxKind(n,p&&p.fileName);break}}}function transformSemicolonClassElementToStatement(e){return setTextRange(t.createEmptyStatement(),e)}function transformClassMethodDeclarationToStatement(n,r,i){const o=getCommentRange(r);const a=getSourceMapRange(r);const s=transformFunctionLikeToExpression(r,r,void 0,i);const c=visitNode(r.name,visitor,isPropertyName);S.assert(c);let l;if(!isPrivateIdentifier(c)&&ir(e.getCompilerOptions())){const e=isComputedPropertyName(c)?c.expression:isIdentifier(c)?t.createStringLiteral(unescapeLeadingUnderscores(c.escapedText)):c;l=t.createObjectDefinePropertyCall(n,e,t.createPropertyDescriptor({value:s,enumerable:false,writable:true,configurable:true}))}else{const e=createMemberAccessForPropertyName(t,n,c,r.name);l=t.createAssignment(e,s)}setEmitFlags(s,3072);setSourceMapRange(s,a);const d=setTextRange(t.createExpressionStatement(l),r);setOriginalNode(d,r);setCommentRange(d,o);setEmitFlags(d,96);return d}function transformAccessorsToStatement(e,n,r){const i=t.createExpressionStatement(transformAccessorsToExpression(e,n,r,false));setEmitFlags(i,3072);setSourceMapRange(i,getSourceMapRange(n.firstAccessor));return i}function transformAccessorsToExpression(e,{firstAccessor:n,getAccessor:r,setAccessor:i},o,a){const s=setParent(setTextRange(t.cloneNode(e),e),e.parent);setEmitFlags(s,3072|64);setSourceMapRange(s,n.name);const c=visitNode(n.name,visitor,isPropertyName);S.assert(c);if(isPrivateIdentifier(c)){return S.failBadSyntaxKind(c,"Encountered unhandled private identifier while transforming ES2015.")}const l=createExpressionForPropertyName(t,c);setEmitFlags(l,3072|32);setSourceMapRange(l,n.name);const d=[];if(r){const e=transformFunctionLikeToExpression(r,void 0,void 0,o);setSourceMapRange(e,getSourceMapRange(r));setEmitFlags(e,1024);const n=t.createPropertyAssignment("get",e);setCommentRange(n,getCommentRange(r));d.push(n)}if(i){const e=transformFunctionLikeToExpression(i,void 0,void 0,o);setSourceMapRange(e,getSourceMapRange(i));setEmitFlags(e,1024);const n=t.createPropertyAssignment("set",e);setCommentRange(n,getCommentRange(i));d.push(n)}d.push(t.createPropertyAssignment("enumerable",r||i?t.createFalse():t.createTrue()),t.createPropertyAssignment("configurable",t.createTrue()));const p=t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"defineProperty"),void 0,[s,l,t.createObjectLiteralExpression(d,true)]);if(a){startOnNewLine(p)}return p}function visitArrowFunction(n){if(n.transformFlags&16384&&!(m&16384)){m|=131072}const r=g;g=void 0;const i=enterSubtree(15232,66);const o=t.createFunctionExpression(void 0,void 0,void 0,void 0,visitParameterList(n.parameters,visitor,e),void 0,transformFunctionBody2(n));setTextRange(o,n);setOriginalNode(o,n);setEmitFlags(o,16);exitSubtree(i,0,0);g=r;return o}function visitFunctionExpression(n){const r=getEmitFlags(n)&524288?enterSubtree(32662,69):enterSubtree(32670,65);const i=g;g=void 0;const o=visitParameterList(n.parameters,visitor,e);const a=transformFunctionBody2(n);const s=m&32768?t.getLocalName(n):n.name;exitSubtree(r,229376,0);g=i;return t.updateFunctionExpression(n,void 0,n.asteriskToken,s,void 0,o,void 0,a)}function visitFunctionDeclaration(n){const r=g;g=void 0;const i=enterSubtree(32670,65);const o=visitParameterList(n.parameters,visitor,e);const a=transformFunctionBody2(n);const s=m&32768?t.getLocalName(n):n.name;exitSubtree(i,229376,0);g=r;return t.updateFunctionDeclaration(n,visitNodes2(n.modifiers,visitor,isModifier),n.asteriskToken,s,void 0,o,void 0,a)}function transformFunctionLikeToExpression(n,r,i,o){const a=g;g=void 0;const s=o&&isClassLike(o)&&!isStatic(n)?enterSubtree(32670,65|8):enterSubtree(32670,65);const c=visitParameterList(n.parameters,visitor,e);const l=transformFunctionBody2(n);if(m&32768&&!i&&(n.kind===262||n.kind===218)){i=t.getGeneratedNameForNode(n)}exitSubtree(s,229376,0);g=a;return setOriginalNode(setTextRange(t.createFunctionExpression(void 0,n.asteriskToken,i,void 0,c,void 0,l),r),n)}function transformFunctionBody2(e){let n=false;let r=false;let a;let s;const c=[];const l=[];const d=e.body;let u;i();if(isBlock(d)){u=t.copyStandardPrologue(d.statements,c,0,false);u=t.copyCustomPrologue(d.statements,l,u,visitor,isHoistedFunction);u=t.copyCustomPrologue(d.statements,l,u,visitor,isHoistedVariableStatement)}n=addDefaultValueAssignmentsIfNeeded2(l,e)||n;n=addRestParameterIfNeeded(l,e,false)||n;if(isBlock(d)){u=t.copyCustomPrologue(d.statements,l,u,visitor);a=d.statements;addRange(l,visitNodes2(d.statements,visitor,isStatement,u));if(!n&&d.multiLine){n=true}}else{S.assert(e.kind===219);a=moveRangeEnd(d,-1);const i=e.equalsGreaterThanToken;if(!nodeIsSynthesized(i)&&!nodeIsSynthesized(d)){if(rangeEndIsOnSameLineAsRangeStart(i,d,p)){r=true}else{n=true}}const o=visitNode(d,visitor,isExpression);const c=t.createReturnStatement(o);setTextRange(c,d);moveSyntheticComments(c,d);setEmitFlags(c,768|64|2048);l.push(c);s=d}t.mergeLexicalEnvironment(c,o());insertCaptureNewTargetIfNeeded(c,e);insertCaptureThisForNodeIfNeeded(c,e);if(some(c)){n=true}l.unshift(...c);if(isBlock(d)&&arrayIsEqualTo(l,d.statements)){return d}const f=t.createBlock(setTextRange(t.createNodeArray(l),a),n);setTextRange(f,e.body);if(!n&&r){setEmitFlags(f,1)}if(s){setTokenSourceMapRange(f,20,s)}setOriginalNode(f,e.body);return f}function visitBlock(t,n){if(n){return visitEachChild(t,visitor,e)}const r=m&256?enterSubtree(7104,512):enterSubtree(6976,128);const i=visitEachChild(t,visitor,e);exitSubtree(r,0,0);return i}function visitExpressionStatement(t){return visitEachChild(t,visitorWithUnusedExpressionResult,e)}function visitParenthesizedExpression(t,n){return visitEachChild(t,n?visitorWithUnusedExpressionResult:visitor,e)}function visitBinaryExpression(n,r){if(isDestructuringAssignment(n)){return flattenDestructuringAssignment(n,visitor,e,0,!r)}if(n.operatorToken.kind===28){return t.updateBinaryExpression(n,S.checkDefined(visitNode(n.left,visitorWithUnusedExpressionResult,isExpression)),n.operatorToken,S.checkDefined(visitNode(n.right,r?visitorWithUnusedExpressionResult:visitor,isExpression)))}return visitEachChild(n,visitor,e)}function visitCommaListExpression(n,r){if(r){return visitEachChild(n,visitorWithUnusedExpressionResult,e)}let i;for(let e=0;ee.name)));const c=i?t.createYieldExpression(t.createToken(42),setEmitFlags(s,8388608)):s;if(a){o.push(t.createExpressionStatement(c));copyOutParameters(n.loopOutParameters,1,0,o)}else{const e=t.createUniqueName("state");const i=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(e,void 0,void 0,c)]));o.push(i);copyOutParameters(n.loopOutParameters,1,0,o);if(n.nonLocalJumps&8){let n;if(r){r.nonLocalJumps|=8;n=t.createReturnStatement(e)}else{n=t.createReturnStatement(t.createPropertyAccessExpression(e,"value"))}o.push(t.createIfStatement(t.createTypeCheck(e,"object"),n))}if(n.nonLocalJumps&2){o.push(t.createIfStatement(t.createStrictEquality(e,t.createStringLiteral("break")),t.createBreakStatement()))}if(n.labeledNonLocalBreaks||n.labeledNonLocalContinues){const i=[];processLabeledJumps(n.labeledNonLocalBreaks,true,e,r,i);processLabeledJumps(n.labeledNonLocalContinues,false,e,r,i);o.push(t.createSwitchStatement(e,t.createCaseBlock(i)))}}return o}function setLabeledJump(e,t,n,r){if(t){if(!e.labeledNonLocalBreaks){e.labeledNonLocalBreaks=new Map}e.labeledNonLocalBreaks.set(n,r)}else{if(!e.labeledNonLocalContinues){e.labeledNonLocalContinues=new Map}e.labeledNonLocalContinues.set(n,r)}}function processLabeledJumps(e,n,r,i,o){if(!e){return}e.forEach(((e,a)=>{const s=[];if(!i||i.labels&&i.labels.get(a)){const e=t.createIdentifier(a);s.push(n?t.createBreakStatement(e):t.createContinueStatement(e))}else{setLabeledJump(i,n,a,e);s.push(t.createReturnStatement(r))}o.push(t.createCaseClause(t.createStringLiteral(e),s))}))}function processLoopVariableDeclaration(e,n,r,i,o){const a=n.name;if(isBindingPattern(a)){for(const t of a.elements){if(!isOmittedExpression(t)){processLoopVariableDeclaration(e,t,r,i,o)}}}else{r.push(t.createParameterDeclaration(void 0,void 0,a));const s=c.hasNodeCheckFlag(n,65536);if(s||o){const r=t.createUniqueName("out_"+idText(a));let o=0;if(s){o|=1}if(isForStatement(e)){if(e.initializer&&c.isBindingCapturedByNode(e.initializer,n)){o|=2}if(e.condition&&c.isBindingCapturedByNode(e.condition,n)||e.incrementor&&c.isBindingCapturedByNode(e.incrementor,n)){o|=1}}i.push({flags:o,originalName:a,outParamName:r})}}}function addObjectLiteralMembers(e,t,n,r){const i=t.properties;const o=i.length;for(let a=r;aisVariableStatement(e)&&!!first(e.declarationList.declarations).initializer;const r=g;g=void 0;const i=visitNodes2(n.statements,classWrapperStatementVisitor,isStatement);g=r;const o=filter(i,isVariableStatementWithInitializer);const a=filter(i,(e=>!isVariableStatementWithInitializer(e)));const s=cast(first(o),isVariableStatement);const c=s.declarationList.declarations[0];const l=skipOuterExpressions(c.initializer);let d=tryCast(l,isAssignmentExpression);if(!d&&isBinaryExpression(l)&&l.operatorToken.kind===28){d=tryCast(l.left,isAssignmentExpression)}const p=cast(d?skipOuterExpressions(d.right):l,isCallExpression);const f=cast(skipOuterExpressions(p.expression),isFunctionExpression);const m=f.body.statements;let _=0;let y=-1;const h=[];if(d){const e=tryCast(m[_],isExpressionStatement);if(e){h.push(e);_++}h.push(m[_]);_++;h.push(t.createExpressionStatement(t.createAssignment(d.left,cast(c.name,isIdentifier))))}while(!isReturnStatement(u(m,y))){y--}addRange(h,m,_,y);if(y<-1){addRange(h,m,y+1)}const T=tryCast(u(m,y),isReturnStatement);for(const e of a){if(isReturnStatement(e)&&(T==null?void 0:T.expression)&&!isIdentifier(T.expression)){h.push(T)}else{h.push(e)}}addRange(h,o,1);return t.restoreOuterExpressions(e.expression,t.restoreOuterExpressions(c.initializer,t.restoreOuterExpressions(d&&d.right,t.updateCallExpression(p,t.restoreOuterExpressions(p.expression,t.updateFunctionExpression(f,void 0,void 0,void 0,void 0,f.parameters,void 0,t.updateBlock(f.body,h))),void 0,p.arguments))))}function visitCallExpressionWithPotentialCapturedThisAssignment(n,r){if(n.transformFlags&32768||n.expression.kind===108||isSuperProperty(skipOuterExpressions(n.expression))){const{target:e,thisArg:i}=t.createCallBinding(n.expression,a);if(n.expression.kind===108){setEmitFlags(i,8)}let o;if(n.transformFlags&32768){o=t.createFunctionApplyCall(S.checkDefined(visitNode(e,callExpressionVisitor,isExpression)),n.expression.kind===108?i:S.checkDefined(visitNode(i,visitor,isExpression)),transformAndSpreadElements(n.arguments,true,false,false))}else{o=setTextRange(t.createFunctionCallCall(S.checkDefined(visitNode(e,callExpressionVisitor,isExpression)),n.expression.kind===108?i:S.checkDefined(visitNode(i,visitor,isExpression)),visitNodes2(n.arguments,visitor,isExpression)),n)}if(n.expression.kind===108){const e=t.createLogicalOr(o,createActualThis());o=r?t.createAssignment(createCapturedThis(),e):e}return setOriginalNode(o,n)}if(isSuperCall(n)){m|=131072}return visitEachChild(n,visitor,e)}function visitNewExpression(n){if(some(n.arguments,isSpreadElement)){const{target:e,thisArg:r}=t.createCallBinding(t.createPropertyAccessExpression(n.expression,"bind"),a);return t.createNewExpression(t.createFunctionApplyCall(S.checkDefined(visitNode(e,visitor,isExpression)),r,transformAndSpreadElements(t.createNodeArray([t.createVoidZero(),...n.arguments]),true,false,false)),void 0,[])}return visitEachChild(n,visitor,e)}function transformAndSpreadElements(e,r,i,o){const a=e.length;const c=flatten(spanMap(e,partitionSpread,((e,t,n,r)=>t(e,i,o&&r===a))));if(c.length===1){const e=c[0];if(r&&!s.downlevelIteration||isPackedArrayLiteral(e.expression)||isCallToHelper(e.expression,"___spreadArray")){return e.expression}}const l=n();const d=c[0].kind!==0;let p=d?t.createArrayLiteralExpression():c[0].expression;for(let e=d?0:1;e0){e.push(t.createStringLiteral(r.literal.text))}n=t.createCallExpression(t.createPropertyAccessExpression(n,"concat"),void 0,e)}return setTextRange(n,e)}function createSyntheticSuper(){return t.createUniqueName("_super",16|32)}function visitSuperKeyword(e,n){const r=m&8&&!n?t.createPropertyAccessExpression(setOriginalNode(createSyntheticSuper(),e),"prototype"):createSyntheticSuper();setOriginalNode(r,e);setCommentRange(r,e);setSourceMapRange(r,e);return r}function visitMetaProperty(e){if(e.keywordToken===105&&e.name.escapedText==="target"){m|=32768;return t.createUniqueName("_newTarget",16|32)}return e}function onEmitNode(e,t,n){if(y&1&&isFunctionLike(t)){const r=enterSubtree(32670,getEmitFlags(t)&16?65|16:65);d(e,t,n);exitSubtree(r,0,0);return}d(e,t,n)}function enableSubstitutionsForBlockScopedBindings(){if((y&2)===0){y|=2;e.enableSubstitution(80)}}function enableSubstitutionsForCapturedThis(){if((y&1)===0){y|=1;e.enableSubstitution(110);e.enableEmitNotification(176);e.enableEmitNotification(174);e.enableEmitNotification(177);e.enableEmitNotification(178);e.enableEmitNotification(219);e.enableEmitNotification(218);e.enableEmitNotification(262)}}function onSubstituteNode(e,t){t=l(e,t);if(e===1){return substituteExpression(t)}if(isIdentifier(t)){return substituteIdentifier(t)}return t}function substituteIdentifier(e){if(y&2&&!isInternalName(e)){const n=getParseTreeNode(e,isIdentifier);if(n&&isNameOfDeclarationWithCollidingName(n)){return setTextRange(t.getGeneratedNameForNode(n),e)}}return e}function isNameOfDeclarationWithCollidingName(e){switch(e.parent.kind){case 208:case 263:case 266:case 260:return e.parent.name===e&&c.isDeclarationWithCollidingName(e.parent)}return false}function substituteExpression(e){switch(e.kind){case 80:return substituteExpressionIdentifier(e);case 110:return substituteThisKeyword(e)}return e}function substituteExpressionIdentifier(e){if(y&2&&!isInternalName(e)){const n=c.getReferencedDeclarationWithCollidingName(e);if(n&&!(isClassLike(n)&&isPartOfClassBody(n,e))){return setTextRange(t.getGeneratedNameForNode(getNameOfDeclaration(n)),e)}}return e}function isPartOfClassBody(e,t){let n=getParseTreeNode(t);if(!n||n===e||n.end<=e.pos||n.pos>=e.end){return false}const r=getEnclosingBlockScopeContainer(e);while(n){if(n===r||n===e){return false}if(isClassElement(n)&&n.parent===e){return true}n=n.parent}return false}function substituteThisKeyword(e){if(y&1&&m&16){return setTextRange(createCapturedThis(),e)}return e}function getClassMemberPrefix(e,n){return isStatic(n)?t.getInternalName(e):t.createPropertyAccessExpression(t.getInternalName(e),"prototype")}function hasSynthesizedDefaultSuperCall(e,t){if(!e||!t){return false}if(some(e.parameters)){return false}const n=firstOrUndefined(e.body.statements);if(!n||!nodeIsSynthesized(n)||n.kind!==244){return false}const r=n.expression;if(!nodeIsSynthesized(r)||r.kind!==213){return false}const i=r.expression;if(!nodeIsSynthesized(i)||i.kind!==108){return false}const o=singleOrUndefined(r.arguments);if(!o||!nodeIsSynthesized(o)||o.kind!==230){return false}const a=o.expression;return isIdentifier(a)&&a.escapedText==="arguments"}}function getInstructionName(e){switch(e){case 2:return"return";case 3:return"break";case 4:return"yield";case 5:return"yield*";case 7:return"endfinally";default:return void 0}}function transformGenerators(e){const{factory:t,getEmitHelperFactory:n,resumeLexicalEnvironment:r,endLexicalEnvironment:i,hoistFunctionDeclaration:o,hoistVariableDeclaration:a}=e;const s=e.getCompilerOptions();const c=zn(s);const l=e.getEmitResolver();const d=e.onSubstituteNode;e.onSubstituteNode=onSubstituteNode;let p;let u;let f;let m;let _;let g;let y;let h;let T;let v;let x=1;let b;let C;let E;let N;let k=0;let F=0;let P;let D;let I;let A;let O;let w;let L;let M;return chainBundle(e,transformSourceFile);function transformSourceFile(t){if(t.isDeclarationFile||(t.transformFlags&2048)===0){return t}const n=visitEachChild(t,visitor,e);addEmitHelpers(n,e.readEmitHelpers());return n}function visitor(t){const n=t.transformFlags;if(m){return visitJavaScriptInStatementContainingYield(t)}else if(f){return visitJavaScriptInGeneratorFunctionBody(t)}else if(isFunctionLikeDeclaration(t)&&t.asteriskToken){return visitGenerator(t)}else if(n&2048){return visitEachChild(t,visitor,e)}else{return t}}function visitJavaScriptInStatementContainingYield(e){switch(e.kind){case 246:return visitDoStatement(e);case 247:return visitWhileStatement(e);case 255:return visitSwitchStatement(e);case 256:return visitLabeledStatement(e);default:return visitJavaScriptInGeneratorFunctionBody(e)}}function visitJavaScriptInGeneratorFunctionBody(t){switch(t.kind){case 262:return visitFunctionDeclaration(t);case 218:return visitFunctionExpression(t);case 177:case 178:return visitAccessorDeclaration(t);case 243:return visitVariableStatement(t);case 248:return visitForStatement(t);case 249:return visitForInStatement(t);case 252:return visitBreakStatement(t);case 251:return visitContinueStatement(t);case 253:return visitReturnStatement(t);default:if(t.transformFlags&1048576){return visitJavaScriptContainingYield(t)}else if(t.transformFlags&(2048|4194304)){return visitEachChild(t,visitor,e)}else{return t}}}function visitJavaScriptContainingYield(t){switch(t.kind){case 226:return visitBinaryExpression(t);case 356:return visitCommaListExpression(t);case 227:return visitConditionalExpression(t);case 229:return visitYieldExpression(t);case 209:return visitArrayLiteralExpression(t);case 210:return visitObjectLiteralExpression(t);case 212:return visitElementAccessExpression(t);case 213:return visitCallExpression(t);case 214:return visitNewExpression(t);default:return visitEachChild(t,visitor,e)}}function visitGenerator(e){switch(e.kind){case 262:return visitFunctionDeclaration(e);case 218:return visitFunctionExpression(e);default:return S.failBadSyntaxKind(e)}}function visitFunctionDeclaration(n){if(n.asteriskToken){n=setOriginalNode(setTextRange(t.createFunctionDeclaration(n.modifiers,void 0,n.name,void 0,visitParameterList(n.parameters,visitor,e),void 0,transformGeneratorFunctionBody(n.body)),n),n)}else{const t=f;const r=m;f=false;m=false;n=visitEachChild(n,visitor,e);f=t;m=r}if(f){o(n);return void 0}else{return n}}function visitFunctionExpression(n){if(n.asteriskToken){n=setOriginalNode(setTextRange(t.createFunctionExpression(void 0,void 0,n.name,void 0,visitParameterList(n.parameters,visitor,e),void 0,transformGeneratorFunctionBody(n.body)),n),n)}else{const t=f;const r=m;f=false;m=false;n=visitEachChild(n,visitor,e);f=t;m=r}return n}function visitAccessorDeclaration(t){const n=f;const r=m;f=false;m=false;t=visitEachChild(t,visitor,e);f=n;m=r;return t}function transformGeneratorFunctionBody(e){const n=[];const o=f;const a=m;const s=_;const c=g;const l=y;const d=h;const p=T;const u=v;const S=x;const k=b;const F=C;const P=E;const D=N;f=true;m=false;_=void 0;g=void 0;y=void 0;h=void 0;T=void 0;v=void 0;x=1;b=void 0;C=void 0;E=void 0;N=t.createTempVariable(void 0);r();const I=t.copyPrologue(e.statements,n,false,visitor);transformAndEmitStatements(e.statements,I);const A=build2();insertStatementsAfterStandardPrologue(n,i());n.push(t.createReturnStatement(A));f=o;m=a;_=s;g=c;y=l;h=d;T=p;v=u;x=S;b=k;C=F;E=P;N=D;return setTextRange(t.createBlock(n,e.multiLine),e)}function visitVariableStatement(e){if(e.transformFlags&1048576){transformAndEmitVariableDeclarationList(e.declarationList);return void 0}else{if(getEmitFlags(e)&2097152){return e}for(const t of e.declarationList.declarations){a(t.name)}const n=getInitializedVariables(e.declarationList);if(n.length===0){return void 0}return setSourceMapRange(t.createExpressionStatement(t.inlineExpressions(map(n,transformInitializedVariable))),e)}}function visitBinaryExpression(e){const t=getExpressionAssociativity(e);switch(t){case 0:return visitLeftAssociativeBinaryExpression(e);case 1:return visitRightAssociativeBinaryExpression(e);default:return S.assertNever(t)}}function visitRightAssociativeBinaryExpression(n){const{left:r,right:i}=n;if(containsYield(i)){let e;switch(r.kind){case 211:e=t.updatePropertyAccessExpression(r,cacheExpression(S.checkDefined(visitNode(r.expression,visitor,isLeftHandSideExpression))),r.name);break;case 212:e=t.updateElementAccessExpression(r,cacheExpression(S.checkDefined(visitNode(r.expression,visitor,isLeftHandSideExpression))),cacheExpression(S.checkDefined(visitNode(r.argumentExpression,visitor,isExpression))));break;default:e=S.checkDefined(visitNode(r,visitor,isExpression));break}const o=n.operatorToken.kind;if(isCompoundAssignment(o)){return setTextRange(t.createAssignment(e,setTextRange(t.createBinaryExpression(cacheExpression(e),getNonAssignmentOperatorForCompoundAssignment(o),S.checkDefined(visitNode(i,visitor,isExpression))),n)),n)}else{return t.updateBinaryExpression(n,e,n.operatorToken,S.checkDefined(visitNode(i,visitor,isExpression)))}}return visitEachChild(n,visitor,e)}function visitLeftAssociativeBinaryExpression(n){if(containsYield(n.right)){if(isLogicalOperator(n.operatorToken.kind)){return visitLogicalBinaryExpression(n)}else if(n.operatorToken.kind===28){return visitCommaExpression(n)}return t.updateBinaryExpression(n,cacheExpression(S.checkDefined(visitNode(n.left,visitor,isExpression))),n.operatorToken,S.checkDefined(visitNode(n.right,visitor,isExpression)))}return visitEachChild(n,visitor,e)}function visitCommaExpression(e){let n=[];visit(e.left);visit(e.right);return t.inlineExpressions(n);function visit(e){if(isBinaryExpression(e)&&e.operatorToken.kind===28){visit(e.left);visit(e.right)}else{if(containsYield(e)&&n.length>0){emitWorker(1,[t.createExpressionStatement(t.inlineExpressions(n))]);n=[]}n.push(S.checkDefined(visitNode(e,visitor,isExpression)))}}}function visitCommaListExpression(e){let n=[];for(const r of e.elements){if(isBinaryExpression(r)&&r.operatorToken.kind===28){n.push(visitCommaExpression(r))}else{if(containsYield(r)&&n.length>0){emitWorker(1,[t.createExpressionStatement(t.inlineExpressions(n))]);n=[]}n.push(S.checkDefined(visitNode(r,visitor,isExpression)))}}return t.inlineExpressions(n)}function visitLogicalBinaryExpression(e){const t=defineLabel();const n=declareLocal();emitAssignment(n,S.checkDefined(visitNode(e.left,visitor,isExpression)),e.left);if(e.operatorToken.kind===56){emitBreakWhenFalse(t,n,e.left)}else{emitBreakWhenTrue(t,n,e.left)}emitAssignment(n,S.checkDefined(visitNode(e.right,visitor,isExpression)),e.right);markLabel(t);return n}function visitConditionalExpression(t){if(containsYield(t.whenTrue)||containsYield(t.whenFalse)){const e=defineLabel();const n=defineLabel();const r=declareLocal();emitBreakWhenFalse(e,S.checkDefined(visitNode(t.condition,visitor,isExpression)),t.condition);emitAssignment(r,S.checkDefined(visitNode(t.whenTrue,visitor,isExpression)),t.whenTrue);emitBreak(n);markLabel(e);emitAssignment(r,S.checkDefined(visitNode(t.whenFalse,visitor,isExpression)),t.whenFalse);markLabel(n);return r}return visitEachChild(t,visitor,e)}function visitYieldExpression(e){const t=defineLabel();const r=visitNode(e.expression,visitor,isExpression);if(e.asteriskToken){const t=(getEmitFlags(e.expression)&8388608)===0?setTextRange(n().createValuesHelper(r),e):r;emitYieldStar(t,e)}else{emitYield(r,e)}markLabel(t);return createGeneratorResume(e)}function visitArrayLiteralExpression(e){return visitElements(e.elements,void 0,void 0,e.multiLine)}function visitElements(e,n,r,i){const o=countInitialNodesWithoutYield(e);let a;if(o>0){a=declareLocal();const r=visitNodes2(e,visitor,isExpression,0,o);emitAssignment(a,t.createArrayLiteralExpression(n?[n,...r]:r));n=void 0}const s=reduceLeft(e,reduceElement,[],o);return a?t.createArrayConcatCall(a,[t.createArrayLiteralExpression(s,i)]):setTextRange(t.createArrayLiteralExpression(n?[n,...s]:s,i),r);function reduceElement(e,r){if(containsYield(r)&&e.length>0){const r=a!==void 0;if(!a){a=declareLocal()}emitAssignment(a,r?t.createArrayConcatCall(a,[t.createArrayLiteralExpression(e,i)]):t.createArrayLiteralExpression(n?[n,...e]:e,i));n=void 0;e=[]}e.push(S.checkDefined(visitNode(r,visitor,isExpression)));return e}}function visitObjectLiteralExpression(e){const n=e.properties;const r=e.multiLine;const i=countInitialNodesWithoutYield(n);const o=declareLocal();emitAssignment(o,t.createObjectLiteralExpression(visitNodes2(n,visitor,isObjectLiteralElementLike,0,i),r));const a=reduceLeft(n,reduceProperty,[],i);a.push(r?startOnNewLine(setParent(setTextRange(t.cloneNode(o),o),o.parent)):o);return t.inlineExpressions(a);function reduceProperty(n,i){if(containsYield(i)&&n.length>0){emitStatement(t.createExpressionStatement(t.inlineExpressions(n)));n=[]}const a=createExpressionForObjectLiteralElementLike(t,e,i,o);const s=visitNode(a,visitor,isExpression);if(s){if(r){startOnNewLine(s)}n.push(s)}return n}}function visitElementAccessExpression(n){if(containsYield(n.argumentExpression)){return t.updateElementAccessExpression(n,cacheExpression(S.checkDefined(visitNode(n.expression,visitor,isLeftHandSideExpression))),S.checkDefined(visitNode(n.argumentExpression,visitor,isExpression)))}return visitEachChild(n,visitor,e)}function visitCallExpression(n){if(!isImportCall(n)&&forEach(n.arguments,containsYield)){const{target:e,thisArg:r}=t.createCallBinding(n.expression,a,c,true);return setOriginalNode(setTextRange(t.createFunctionApplyCall(cacheExpression(S.checkDefined(visitNode(e,visitor,isLeftHandSideExpression))),r,visitElements(n.arguments)),n),n)}return visitEachChild(n,visitor,e)}function visitNewExpression(n){if(forEach(n.arguments,containsYield)){const{target:e,thisArg:r}=t.createCallBinding(t.createPropertyAccessExpression(n.expression,"bind"),a);return setOriginalNode(setTextRange(t.createNewExpression(t.createFunctionApplyCall(cacheExpression(S.checkDefined(visitNode(e,visitor,isExpression))),r,visitElements(n.arguments,t.createVoidZero())),void 0,[]),n),n)}return visitEachChild(n,visitor,e)}function transformAndEmitStatements(e,t=0){const n=e.length;for(let r=t;r0){break}o.push(transformInitializedVariable(t))}if(o.length){emitStatement(t.createExpressionStatement(t.inlineExpressions(o)));i+=o.length;o=[]}}return void 0}function transformInitializedVariable(e){return setSourceMapRange(t.createAssignment(setSourceMapRange(t.cloneNode(e.name),e.name),S.checkDefined(visitNode(e.initializer,visitor,isExpression))),e)}function transformAndEmitIfStatement(e){if(containsYield(e)){if(containsYield(e.thenStatement)||containsYield(e.elseStatement)){const t=defineLabel();const n=e.elseStatement?defineLabel():void 0;emitBreakWhenFalse(e.elseStatement?n:t,S.checkDefined(visitNode(e.expression,visitor,isExpression)),e.expression);transformAndEmitEmbeddedStatement(e.thenStatement);if(e.elseStatement){emitBreak(t);markLabel(n);transformAndEmitEmbeddedStatement(e.elseStatement)}markLabel(t)}else{emitStatement(visitNode(e,visitor,isStatement))}}else{emitStatement(visitNode(e,visitor,isStatement))}}function transformAndEmitDoStatement(e){if(containsYield(e)){const t=defineLabel();const n=defineLabel();beginLoopBlock(t);markLabel(n);transformAndEmitEmbeddedStatement(e.statement);markLabel(t);emitBreakWhenTrue(n,S.checkDefined(visitNode(e.expression,visitor,isExpression)));endLoopBlock()}else{emitStatement(visitNode(e,visitor,isStatement))}}function visitDoStatement(t){if(m){beginScriptLoopBlock();t=visitEachChild(t,visitor,e);endLoopBlock();return t}else{return visitEachChild(t,visitor,e)}}function transformAndEmitWhileStatement(e){if(containsYield(e)){const t=defineLabel();const n=beginLoopBlock(t);markLabel(t);emitBreakWhenFalse(n,S.checkDefined(visitNode(e.expression,visitor,isExpression)));transformAndEmitEmbeddedStatement(e.statement);emitBreak(t);endLoopBlock()}else{emitStatement(visitNode(e,visitor,isStatement))}}function visitWhileStatement(t){if(m){beginScriptLoopBlock();t=visitEachChild(t,visitor,e);endLoopBlock();return t}else{return visitEachChild(t,visitor,e)}}function transformAndEmitForStatement(e){if(containsYield(e)){const n=defineLabel();const r=defineLabel();const i=beginLoopBlock(r);if(e.initializer){const n=e.initializer;if(isVariableDeclarationList(n)){transformAndEmitVariableDeclarationList(n)}else{emitStatement(setTextRange(t.createExpressionStatement(S.checkDefined(visitNode(n,visitor,isExpression))),n))}}markLabel(n);if(e.condition){emitBreakWhenFalse(i,S.checkDefined(visitNode(e.condition,visitor,isExpression)))}transformAndEmitEmbeddedStatement(e.statement);markLabel(r);if(e.incrementor){emitStatement(setTextRange(t.createExpressionStatement(S.checkDefined(visitNode(e.incrementor,visitor,isExpression))),e.incrementor))}emitBreak(n);endLoopBlock()}else{emitStatement(visitNode(e,visitor,isStatement))}}function visitForStatement(n){if(m){beginScriptLoopBlock()}const r=n.initializer;if(r&&isVariableDeclarationList(r)){for(const e of r.declarations){a(e.name)}const i=getInitializedVariables(r);n=t.updateForStatement(n,i.length>0?t.inlineExpressions(map(i,transformInitializedVariable)):void 0,visitNode(n.condition,visitor,isExpression),visitNode(n.incrementor,visitor,isExpression),visitIterationBody(n.statement,visitor,e))}else{n=visitEachChild(n,visitor,e)}if(m){endLoopBlock()}return n}function transformAndEmitForInStatement(e){if(containsYield(e)){const n=declareLocal();const r=declareLocal();const i=declareLocal();const o=t.createLoopVariable();const s=e.initializer;a(o);emitAssignment(n,S.checkDefined(visitNode(e.expression,visitor,isExpression)));emitAssignment(r,t.createArrayLiteralExpression());emitStatement(t.createForInStatement(i,n,t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(r,"push"),void 0,[i]))));emitAssignment(o,t.createNumericLiteral(0));const c=defineLabel();const l=defineLabel();const d=beginLoopBlock(l);markLabel(c);emitBreakWhenFalse(d,t.createLessThan(o,t.createPropertyAccessExpression(r,"length")));emitAssignment(i,t.createElementAccessExpression(r,o));emitBreakWhenFalse(l,t.createBinaryExpression(i,103,n));let p;if(isVariableDeclarationList(s)){for(const e of s.declarations){a(e.name)}p=t.cloneNode(s.declarations[0].name)}else{p=S.checkDefined(visitNode(s,visitor,isExpression));S.assert(isLeftHandSideExpression(p))}emitAssignment(p,i);transformAndEmitEmbeddedStatement(e.statement);markLabel(l);emitStatement(t.createExpressionStatement(t.createPostfixIncrement(o)));emitBreak(c);endLoopBlock()}else{emitStatement(visitNode(e,visitor,isStatement))}}function visitForInStatement(n){if(m){beginScriptLoopBlock()}const r=n.initializer;if(isVariableDeclarationList(r)){for(const e of r.declarations){a(e.name)}n=t.updateForInStatement(n,r.declarations[0].name,S.checkDefined(visitNode(n.expression,visitor,isExpression)),S.checkDefined(visitNode(n.statement,visitor,isStatement,t.liftToBlock)))}else{n=visitEachChild(n,visitor,e)}if(m){endLoopBlock()}return n}function transformAndEmitContinueStatement(e){const t=findContinueTarget(e.label?idText(e.label):void 0);if(t>0){emitBreak(t,e)}else{emitStatement(e)}}function visitContinueStatement(t){if(m){const e=findContinueTarget(t.label&&idText(t.label));if(e>0){return createInlineBreak(e,t)}}return visitEachChild(t,visitor,e)}function transformAndEmitBreakStatement(e){const t=findBreakTarget(e.label?idText(e.label):void 0);if(t>0){emitBreak(t,e)}else{emitStatement(e)}}function visitBreakStatement(t){if(m){const e=findBreakTarget(t.label&&idText(t.label));if(e>0){return createInlineBreak(e,t)}}return visitEachChild(t,visitor,e)}function transformAndEmitReturnStatement(e){emitReturn(visitNode(e.expression,visitor,isExpression),e)}function visitReturnStatement(e){return createInlineReturn(visitNode(e.expression,visitor,isExpression),e)}function transformAndEmitWithStatement(e){if(containsYield(e)){beginWithBlock(cacheExpression(S.checkDefined(visitNode(e.expression,visitor,isExpression))));transformAndEmitEmbeddedStatement(e.statement);endWithBlock()}else{emitStatement(visitNode(e,visitor,isStatement))}}function transformAndEmitSwitchStatement(e){if(containsYield(e.caseBlock)){const n=e.caseBlock;const r=n.clauses.length;const i=beginSwitchBlock();const o=cacheExpression(S.checkDefined(visitNode(e.expression,visitor,isExpression)));const a=[];let s=-1;for(let e=0;e0){break}l.push(t.createCaseClause(S.checkDefined(visitNode(r.expression,visitor,isExpression)),[createInlineBreak(a[i],r.expression)]))}else{e++}}if(l.length){emitStatement(t.createSwitchStatement(o,t.createCaseBlock(l)));c+=l.length;l=[]}if(e>0){c+=e;e=0}}if(s>=0){emitBreak(a[s])}else{emitBreak(i)}for(let e=0;e=0;n--){const t=h[n];if(supportsLabeledBreakOrContinue(t)){if(t.labelText===e){return true}}else{break}}return false}function findBreakTarget(e){if(h){if(e){for(let t=h.length-1;t>=0;t--){const n=h[t];if(supportsLabeledBreakOrContinue(n)&&n.labelText===e){return n.breakLabel}else if(supportsUnlabeledBreak(n)&&hasImmediateContainingLabeledBlock(e,t-1)){return n.breakLabel}}}else{for(let e=h.length-1;e>=0;e--){const t=h[e];if(supportsUnlabeledBreak(t)){return t.breakLabel}}}}return 0}function findContinueTarget(e){if(h){if(e){for(let t=h.length-1;t>=0;t--){const n=h[t];if(supportsUnlabeledContinue(n)&&hasImmediateContainingLabeledBlock(e,t-1)){return n.continueLabel}}}else{for(let e=h.length-1;e>=0;e--){const t=h[e];if(supportsUnlabeledContinue(t)){return t.continueLabel}}}}return 0}function createLabel(e){if(e!==void 0&&e>0){if(v===void 0){v=[]}const n=t.createNumericLiteral(Number.MAX_SAFE_INTEGER);if(v[e]===void 0){v[e]=[n]}else{v[e].push(n)}return n}return t.createOmittedExpression()}function createInstruction(e){const n=t.createNumericLiteral(e);addSyntheticTrailingComment(n,3,getInstructionName(e));return n}function createInlineBreak(e,n){S.assertLessThan(0,e,"Invalid label");return setTextRange(t.createReturnStatement(t.createArrayLiteralExpression([createInstruction(3),createLabel(e)])),n)}function createInlineReturn(e,n){return setTextRange(t.createReturnStatement(t.createArrayLiteralExpression(e?[createInstruction(2),e]:[createInstruction(2)])),n)}function createGeneratorResume(e){return setTextRange(t.createCallExpression(t.createPropertyAccessExpression(N,"sent"),void 0,[]),e)}function emitNop(){emitWorker(0)}function emitStatement(e){if(e){emitWorker(1,[e])}else{emitNop()}}function emitAssignment(e,t,n){emitWorker(2,[e,t],n)}function emitBreak(e,t){emitWorker(3,[e],t)}function emitBreakWhenTrue(e,t,n){emitWorker(4,[e,t],n)}function emitBreakWhenFalse(e,t,n){emitWorker(5,[e,t],n)}function emitYieldStar(e,t){emitWorker(7,[e],t)}function emitYield(e,t){emitWorker(6,[e],t)}function emitReturn(e,t){emitWorker(8,[e],t)}function emitThrow(e,t){emitWorker(9,[e],t)}function emitEndfinally(){emitWorker(10)}function emitWorker(e,t,n){if(b===void 0){b=[];C=[];E=[]}if(T===void 0){markLabel(defineLabel())}const r=b.length;b[r]=e;C[r]=t;E[r]=n}function build2(){k=0;F=0;P=void 0;D=false;I=false;A=void 0;O=void 0;w=void 0;L=void 0;M=void 0;const e=buildStatements();return n().createGeneratorHelper(setEmitFlags(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,N)],void 0,t.createBlock(e,e.length>0)),1048576))}function buildStatements(){if(b){for(let e=0;e=0;e--){const n=M[e];O=[t.createWithStatement(n.expression,t.createBlock(O))]}}if(L){const{startLabel:e,catchLabel:n,finallyLabel:r,endLabel:i}=L;O.unshift(t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(t.createPropertyAccessExpression(N,"trys"),"push"),void 0,[t.createArrayLiteralExpression([createLabel(e),createLabel(n),createLabel(r),createLabel(i)])])));L=void 0}if(e){O.push(t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(N,"label"),t.createNumericLiteral(F+1))))}}A.push(t.createCaseClause(t.createNumericLiteral(F),O||[]));O=void 0}function tryEnterLabel(e){if(!T){return}for(let t=0;t{if(!isStringLiteralLike(e.arguments[0])||shouldRewriteModuleSpecifier(e.arguments[0].text,a)){y=append(y,e)}}))}const n=getTransformModuleDelegate(p);const r=n(t);_=void 0;g=void 0;T=false;return r}function shouldEmitUnderscoreUnderscoreESModule(){if(hasJSFileExtension(_.fileName)&&_.commonJsModuleIndicator&&(!_.externalModuleIndicator||_.externalModuleIndicator===true)){return false}if(!g.exportEquals&&isExternalModule(_)){return true}return false}function transformCommonJSModule(n){r();const o=[];const s=getStrictOptionValue(a,"alwaysStrict")||isExternalModule(_);const c=t.copyPrologue(n.statements,o,s&&!isJsonSourceFile(n),topLevelVisitor);if(shouldEmitUnderscoreUnderscoreESModule()){append(o,createUnderscoreUnderscoreESModule())}if(some(g.exportedNames)){const e=50;for(let n=0;nn.kind===11?t.createAssignment(t.createElementAccessExpression(t.createIdentifier("exports"),t.createStringLiteral(n.text)),e):t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("exports"),t.createIdentifier(idText(n))),e)),t.createVoidZero())))}}for(const e of g.exportedFunctions){appendExportsOfHoistedDeclaration(o,e)}append(o,visitNode(g.externalHelpersImportDeclaration,topLevelVisitor,isStatement));addRange(o,visitNodes2(n.statements,topLevelVisitor,isStatement,c));addExportEqualsIfNeeded(o,false);insertStatementsAfterStandardPrologue(o,i());const l=t.updateSourceFile(n,setTextRange(t.createNodeArray(o),n.statements));addEmitHelpers(l,e.readEmitHelpers());return l}function transformAMDModule(n){const r=t.createIdentifier("define");const i=tryGetModuleNameFromFile(t,n,c,a);const o=isJsonSourceFile(n)&&n;const{aliasedModuleNames:s,unaliasedModuleNames:l,importAliasNames:p}=collectAsynchronousDependencies(n,true);const u=t.updateSourceFile(n,setTextRange(t.createNodeArray([t.createExpressionStatement(t.createCallExpression(r,void 0,[...i?[i]:[],t.createArrayLiteralExpression(o?d:[t.createStringLiteral("require"),t.createStringLiteral("exports"),...s,...l]),o?o.statements.length?o.statements[0].expression:t.createObjectLiteralExpression():t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,"require"),t.createParameterDeclaration(void 0,void 0,"exports"),...p],void 0,transformAsynchronousModuleBody(n))]))]),n.statements));addEmitHelpers(u,e.readEmitHelpers());return u}function transformUMDModule(n){const{aliasedModuleNames:r,unaliasedModuleNames:i,importAliasNames:o}=collectAsynchronousDependencies(n,false);const s=tryGetModuleNameFromFile(t,n,c,a);const l=t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,"factory")],void 0,setTextRange(t.createBlock([t.createIfStatement(t.createLogicalAnd(t.createTypeCheck(t.createIdentifier("module"),"object"),t.createTypeCheck(t.createPropertyAccessExpression(t.createIdentifier("module"),"exports"),"object")),t.createBlock([t.createVariableStatement(void 0,[t.createVariableDeclaration("v",void 0,void 0,t.createCallExpression(t.createIdentifier("factory"),void 0,[t.createIdentifier("require"),t.createIdentifier("exports")]))]),setEmitFlags(t.createIfStatement(t.createStrictInequality(t.createIdentifier("v"),t.createIdentifier("undefined")),t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("module"),"exports"),t.createIdentifier("v")))),1)]),t.createIfStatement(t.createLogicalAnd(t.createTypeCheck(t.createIdentifier("define"),"function"),t.createPropertyAccessExpression(t.createIdentifier("define"),"amd")),t.createBlock([t.createExpressionStatement(t.createCallExpression(t.createIdentifier("define"),void 0,[...s?[s]:[],t.createArrayLiteralExpression([t.createStringLiteral("require"),t.createStringLiteral("exports"),...r,...i]),t.createIdentifier("factory")]))])))],true),void 0));const d=t.updateSourceFile(n,setTextRange(t.createNodeArray([t.createExpressionStatement(t.createCallExpression(l,void 0,[t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,"require"),t.createParameterDeclaration(void 0,void 0,"exports"),...o],void 0,transformAsynchronousModuleBody(n))]))]),n.statements));addEmitHelpers(d,e.readEmitHelpers());return d}function collectAsynchronousDependencies(e,n){const r=[];const i=[];const o=[];for(const n of e.amdDependencies){if(n.name){r.push(t.createStringLiteral(n.path));o.push(t.createParameterDeclaration(void 0,void 0,n.name))}else{i.push(t.createStringLiteral(n.path))}}for(const e of g.externalImports){const l=getExternalModuleNameLiteral(t,e,_,c,s,a);const d=getLocalNameForExternalImport(t,e,_);if(l){if(n&&d){setEmitFlags(d,8);r.push(l);o.push(t.createParameterDeclaration(void 0,void 0,d))}else{i.push(l)}}}return{aliasedModuleNames:r,unaliasedModuleNames:i,importAliasNames:o}}function getAMDImportExpressionForImport(e){if(isImportEqualsDeclaration(e)||isExportDeclaration(e)||!getExternalModuleNameLiteral(t,e,_,c,s,a)){return void 0}const n=getLocalNameForExternalImport(t,e,_);const r=getHelperExpressionForImport(e,n);if(r===n){return void 0}return t.createExpressionStatement(t.createAssignment(n,r))}function transformAsynchronousModuleBody(e){r();const n=[];const o=t.copyPrologue(e.statements,n,true,topLevelVisitor);if(shouldEmitUnderscoreUnderscoreESModule()){append(n,createUnderscoreUnderscoreESModule())}if(some(g.exportedNames)){append(n,t.createExpressionStatement(reduceLeft(g.exportedNames,((e,n)=>n.kind===11?t.createAssignment(t.createElementAccessExpression(t.createIdentifier("exports"),t.createStringLiteral(n.text)),e):t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("exports"),t.createIdentifier(idText(n))),e)),t.createVoidZero())))}for(const e of g.exportedFunctions){appendExportsOfHoistedDeclaration(n,e)}append(n,visitNode(g.externalHelpersImportDeclaration,topLevelVisitor,isStatement));if(p===2){addRange(n,mapDefined(g.externalImports,getAMDImportExpressionForImport))}addRange(n,visitNodes2(e.statements,topLevelVisitor,isStatement,o));addExportEqualsIfNeeded(n,true);insertStatementsAfterStandardPrologue(n,i());const a=t.createBlock(n,true);if(T){addEmitHelper(a,ba)}return a}function addExportEqualsIfNeeded(e,n){if(g.exportEquals){const r=visitNode(g.exportEquals.expression,visitor,isExpression);if(r){if(n){const n=t.createReturnStatement(r);setTextRange(n,g.exportEquals);setEmitFlags(n,768|3072);e.push(n)}else{const n=t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("module"),"exports"),r));setTextRange(n,g.exportEquals);setEmitFlags(n,3072);e.push(n)}}}}function topLevelVisitor(e){switch(e.kind){case 272:return visitTopLevelImportDeclaration(e);case 271:return visitTopLevelImportEqualsDeclaration(e);case 278:return visitTopLevelExportDeclaration(e);case 277:return visitTopLevelExportAssignment(e);default:return topLevelNestedVisitor(e)}}function topLevelNestedVisitor(e){switch(e.kind){case 243:return visitVariableStatement(e);case 262:return visitFunctionDeclaration(e);case 263:return visitClassDeclaration(e);case 248:return visitForStatement(e,true);case 249:return visitForInStatement(e);case 250:return visitForOfStatement(e);case 246:return visitDoStatement(e);case 247:return visitWhileStatement(e);case 256:return visitLabeledStatement(e);case 254:return visitWithStatement(e);case 245:return visitIfStatement(e);case 255:return visitSwitchStatement(e);case 269:return visitCaseBlock(e);case 296:return visitCaseClause(e);case 297:return visitDefaultClause(e);case 258:return visitTryStatement(e);case 299:return visitCatchClause(e);case 241:return visitBlock(e);default:return visitor(e)}}function visitorWorker(t,n){if(!(t.transformFlags&(8388608|4096|268435456))&&!(y==null?void 0:y.length)){return t}switch(t.kind){case 248:return visitForStatement(t,false);case 244:return visitExpressionStatement(t);case 217:return visitParenthesizedExpression(t,n);case 355:return visitPartiallyEmittedExpression(t,n);case 213:const e=t===firstOrUndefined(y);if(e){y.shift()}if(isImportCall(t)&&c.shouldTransformImportCall(_)){return visitImportCallExpression(t,e)}else if(e){return shimOrRewriteImportOrRequireCall(t)}break;case 226:if(isDestructuringAssignment(t)){return visitDestructuringAssignment(t,n)}break;case 224:case 225:return visitPreOrPostfixUnaryExpression(t,n)}return visitEachChild(t,visitor,e)}function visitor(e){return visitorWorker(e,false)}function discardedValueVisitor(e){return visitorWorker(e,true)}function destructuringNeedsFlattening(e){if(isObjectLiteralExpression(e)){for(const t of e.properties){switch(t.kind){case 303:if(destructuringNeedsFlattening(t.initializer)){return true}break;case 304:if(destructuringNeedsFlattening(t.name)){return true}break;case 305:if(destructuringNeedsFlattening(t.expression)){return true}break;case 174:case 177:case 178:return false;default:S.assertNever(t,"Unhandled object member kind")}}}else if(isArrayLiteralExpression(e)){for(const t of e.elements){if(isSpreadElement(t)){if(destructuringNeedsFlattening(t.expression)){return true}}else if(destructuringNeedsFlattening(t)){return true}}}else if(isIdentifier(e)){return length(getExports(e))>(isExportName(e)?1:0)}return false}function visitDestructuringAssignment(t,n){if(destructuringNeedsFlattening(t.left)){return flattenDestructuringAssignment(t,visitor,e,0,!n,createAllExportExpressions)}return visitEachChild(t,visitor,e)}function visitForStatement(n,r){if(r&&n.initializer&&isVariableDeclarationList(n.initializer)&&!(n.initializer.flags&7)){const i=appendExportsOfVariableDeclarationList(void 0,n.initializer,false);if(i){const o=[];const a=visitNode(n.initializer,discardedValueVisitor,isVariableDeclarationList);const s=t.createVariableStatement(void 0,a);o.push(s);addRange(o,i);const c=visitNode(n.condition,visitor,isExpression);const l=visitNode(n.incrementor,discardedValueVisitor,isExpression);const d=visitIterationBody(n.statement,r?topLevelNestedVisitor:visitor,e);o.push(t.updateForStatement(n,void 0,c,l,d));return o}}return t.updateForStatement(n,visitNode(n.initializer,discardedValueVisitor,isForInitializer),visitNode(n.condition,visitor,isExpression),visitNode(n.incrementor,discardedValueVisitor,isExpression),visitIterationBody(n.statement,r?topLevelNestedVisitor:visitor,e))}function visitForInStatement(n){if(isVariableDeclarationList(n.initializer)&&!(n.initializer.flags&7)){const r=appendExportsOfVariableDeclarationList(void 0,n.initializer,true);if(some(r)){const i=visitNode(n.initializer,discardedValueVisitor,isForInitializer);const o=visitNode(n.expression,visitor,isExpression);const a=visitIterationBody(n.statement,topLevelNestedVisitor,e);const s=isBlock(a)?t.updateBlock(a,[...r,...a.statements]):t.createBlock([...r,a],true);return t.updateForInStatement(n,i,o,s)}}return t.updateForInStatement(n,visitNode(n.initializer,discardedValueVisitor,isForInitializer),visitNode(n.expression,visitor,isExpression),visitIterationBody(n.statement,topLevelNestedVisitor,e))}function visitForOfStatement(n){if(isVariableDeclarationList(n.initializer)&&!(n.initializer.flags&7)){const r=appendExportsOfVariableDeclarationList(void 0,n.initializer,true);const i=visitNode(n.initializer,discardedValueVisitor,isForInitializer);const o=visitNode(n.expression,visitor,isExpression);let a=visitIterationBody(n.statement,topLevelNestedVisitor,e);if(some(r)){a=isBlock(a)?t.updateBlock(a,[...r,...a.statements]):t.createBlock([...r,a],true)}return t.updateForOfStatement(n,n.awaitModifier,i,o,a)}return t.updateForOfStatement(n,n.awaitModifier,visitNode(n.initializer,discardedValueVisitor,isForInitializer),visitNode(n.expression,visitor,isExpression),visitIterationBody(n.statement,topLevelNestedVisitor,e))}function visitDoStatement(n){return t.updateDoStatement(n,visitIterationBody(n.statement,topLevelNestedVisitor,e),visitNode(n.expression,visitor,isExpression))}function visitWhileStatement(n){return t.updateWhileStatement(n,visitNode(n.expression,visitor,isExpression),visitIterationBody(n.statement,topLevelNestedVisitor,e))}function visitLabeledStatement(e){return t.updateLabeledStatement(e,e.label,visitNode(e.statement,topLevelNestedVisitor,isStatement,t.liftToBlock)??setTextRange(t.createEmptyStatement(),e.statement))}function visitWithStatement(e){return t.updateWithStatement(e,visitNode(e.expression,visitor,isExpression),S.checkDefined(visitNode(e.statement,topLevelNestedVisitor,isStatement,t.liftToBlock)))}function visitIfStatement(e){return t.updateIfStatement(e,visitNode(e.expression,visitor,isExpression),visitNode(e.thenStatement,topLevelNestedVisitor,isStatement,t.liftToBlock)??t.createBlock([]),visitNode(e.elseStatement,topLevelNestedVisitor,isStatement,t.liftToBlock))}function visitSwitchStatement(e){return t.updateSwitchStatement(e,visitNode(e.expression,visitor,isExpression),S.checkDefined(visitNode(e.caseBlock,topLevelNestedVisitor,isCaseBlock)))}function visitCaseBlock(e){return t.updateCaseBlock(e,visitNodes2(e.clauses,topLevelNestedVisitor,isCaseOrDefaultClause))}function visitCaseClause(e){return t.updateCaseClause(e,visitNode(e.expression,visitor,isExpression),visitNodes2(e.statements,topLevelNestedVisitor,isStatement))}function visitDefaultClause(t){return visitEachChild(t,topLevelNestedVisitor,e)}function visitTryStatement(t){return visitEachChild(t,topLevelNestedVisitor,e)}function visitCatchClause(e){return t.updateCatchClause(e,e.variableDeclaration,S.checkDefined(visitNode(e.block,topLevelNestedVisitor,isBlock)))}function visitBlock(t){t=visitEachChild(t,topLevelNestedVisitor,e);return t}function visitExpressionStatement(e){return t.updateExpressionStatement(e,visitNode(e.expression,discardedValueVisitor,isExpression))}function visitParenthesizedExpression(e,n){return t.updateParenthesizedExpression(e,visitNode(e.expression,n?discardedValueVisitor:visitor,isExpression))}function visitPartiallyEmittedExpression(e,n){return t.updatePartiallyEmittedExpression(e,visitNode(e.expression,n?discardedValueVisitor:visitor,isExpression))}function visitPreOrPostfixUnaryExpression(n,r){if((n.operator===46||n.operator===47)&&isIdentifier(n.operand)&&!isGeneratedIdentifier(n.operand)&&!isLocalName(n.operand)&&!isDeclarationNameOfEnumOrNamespace(n.operand)){const e=getExports(n.operand);if(e){let i;let a=visitNode(n.operand,visitor,isExpression);if(isPrefixUnaryExpression(n)){a=t.updatePrefixUnaryExpression(n,a)}else{a=t.updatePostfixUnaryExpression(n,a);if(!r){i=t.createTempVariable(o);a=t.createAssignment(i,a);setTextRange(a,n)}a=t.createComma(a,t.cloneNode(n.operand));setTextRange(a,n)}for(const t of e){h[getNodeId(a)]=true;a=createExportExpression(t,a);setTextRange(a,n)}if(i){h[getNodeId(a)]=true;a=t.createComma(a,i);setTextRange(a,n)}return a}}return visitEachChild(n,visitor,e)}function shimOrRewriteImportOrRequireCall(e){return t.updateCallExpression(e,e.expression,void 0,visitNodes2(e.arguments,(t=>{if(t===e.arguments[0]){return isStringLiteralLike(t)?rewriteModuleSpecifier(t,a):n().createRewriteRelativeImportExtensionsHelper(t)}return visitor(t)}),isExpression))}function visitImportCallExpression(r,i){if(p===0&&l>=7){return visitEachChild(r,visitor,e)}const o=getExternalModuleNameLiteral(t,r,_,c,s,a);const d=visitNode(firstOrUndefined(r.arguments),visitor,isExpression);const u=o&&(!d||!isStringLiteral(d)||d.text!==o.text)?o:d&&i?isStringLiteral(d)?rewriteModuleSpecifier(d,a):n().createRewriteRelativeImportExtensionsHelper(d):d;const f=!!(r.transformFlags&16384);switch(a.module){case 2:return createImportCallExpressionAMD(u,f);case 3:return createImportCallExpressionUMD(u??t.createVoidZero(),f);case 1:default:return createImportCallExpressionCommonJS(u)}}function createImportCallExpressionUMD(e,n){T=true;if(isSimpleCopiableExpression(e)){const r=isGeneratedIdentifier(e)?e:isStringLiteral(e)?t.createStringLiteralFromNode(e):setEmitFlags(setTextRange(t.cloneNode(e),e),3072);return t.createConditionalExpression(t.createIdentifier("__syncRequire"),void 0,createImportCallExpressionCommonJS(e),void 0,createImportCallExpressionAMD(r,n))}else{const r=t.createTempVariable(o);return t.createComma(t.createAssignment(r,e),t.createConditionalExpression(t.createIdentifier("__syncRequire"),void 0,createImportCallExpressionCommonJS(r,true),void 0,createImportCallExpressionAMD(r,n)))}}function createImportCallExpressionAMD(e,r){const i=t.createUniqueName("resolve");const o=t.createUniqueName("reject");const s=[t.createParameterDeclaration(void 0,void 0,i),t.createParameterDeclaration(void 0,void 0,o)];const c=t.createBlock([t.createExpressionStatement(t.createCallExpression(t.createIdentifier("require"),void 0,[t.createArrayLiteralExpression([e||t.createOmittedExpression()]),i,o]))]);let d;if(l>=2){d=t.createArrowFunction(void 0,void 0,s,void 0,void 0,c)}else{d=t.createFunctionExpression(void 0,void 0,void 0,void 0,s,void 0,c);if(r){setEmitFlags(d,16)}}const p=t.createNewExpression(t.createIdentifier("Promise"),void 0,[d]);if(Kn(a)){return t.createCallExpression(t.createPropertyAccessExpression(p,t.createIdentifier("then")),void 0,[n().createImportStarCallbackHelper()])}return p}function createImportCallExpressionCommonJS(e,r){const i=e&&!isSimpleInlineableExpression(e)&&!r;const o=t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Promise"),"resolve"),void 0,i?l>=2?[t.createTemplateExpression(t.createTemplateHead(""),[t.createTemplateSpan(e,t.createTemplateTail(""))])]:[t.createCallExpression(t.createPropertyAccessExpression(t.createStringLiteral(""),"concat"),void 0,[e])]:[]);let s=t.createCallExpression(t.createIdentifier("require"),void 0,i?[t.createIdentifier("s")]:e?[e]:[]);if(Kn(a)){s=n().createImportStarHelper(s)}const c=i?[t.createParameterDeclaration(void 0,void 0,"s")]:[];let d;if(l>=2){d=t.createArrowFunction(void 0,void 0,c,void 0,void 0,s)}else{d=t.createFunctionExpression(void 0,void 0,void 0,void 0,c,void 0,t.createBlock([t.createReturnStatement(s)]))}const p=t.createCallExpression(t.createPropertyAccessExpression(o,"then"),void 0,[d]);return p}function getHelperExpressionForExport(e,t){if(!Kn(a)||getInternalEmitFlags(e)&2){return t}if(getExportNeedsImportStarHelper(e)){return n().createImportStarHelper(t)}return t}function getHelperExpressionForImport(e,t){if(!Kn(a)||getInternalEmitFlags(e)&2){return t}if(getImportNeedsImportStarHelper(e)){return n().createImportStarHelper(t)}if(getImportNeedsImportDefaultHelper(e)){return n().createImportDefaultHelper(t)}return t}function visitTopLevelImportDeclaration(e){let n;const r=getNamespaceDeclarationNode(e);if(p!==2){if(!e.importClause){return setOriginalNode(setTextRange(t.createExpressionStatement(createRequireCall2(e)),e),e)}else{const i=[];if(r&&!isDefaultImport(e)){i.push(t.createVariableDeclaration(t.cloneNode(r.name),void 0,void 0,getHelperExpressionForImport(e,createRequireCall2(e))))}else{i.push(t.createVariableDeclaration(t.getGeneratedNameForNode(e),void 0,void 0,getHelperExpressionForImport(e,createRequireCall2(e))));if(r&&isDefaultImport(e)){i.push(t.createVariableDeclaration(t.cloneNode(r.name),void 0,void 0,t.getGeneratedNameForNode(e)))}}n=append(n,setOriginalNode(setTextRange(t.createVariableStatement(void 0,t.createVariableDeclarationList(i,l>=2?2:0)),e),e))}}else if(r&&isDefaultImport(e)){n=append(n,t.createVariableStatement(void 0,t.createVariableDeclarationList([setOriginalNode(setTextRange(t.createVariableDeclaration(t.cloneNode(r.name),void 0,void 0,t.getGeneratedNameForNode(e)),e),e)],l>=2?2:0)))}n=appendExportsOfImportDeclaration(n,e);return singleOrMany(n)}function createRequireCall2(e){const n=getExternalModuleNameLiteral(t,e,_,c,s,a);const r=[];if(n){r.push(rewriteModuleSpecifier(n,a))}return t.createCallExpression(t.createIdentifier("require"),void 0,r)}function visitTopLevelImportEqualsDeclaration(e){S.assert(isExternalModuleImportEqualsDeclaration(e),"import= for internal module references should be handled in an earlier transformer.");let n;if(p!==2){if(hasSyntacticModifier(e,32)){n=append(n,setOriginalNode(setTextRange(t.createExpressionStatement(createExportExpression(e.name,createRequireCall2(e))),e),e))}else{n=append(n,setOriginalNode(setTextRange(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.cloneNode(e.name),void 0,void 0,createRequireCall2(e))],l>=2?2:0)),e),e))}}else{if(hasSyntacticModifier(e,32)){n=append(n,setOriginalNode(setTextRange(t.createExpressionStatement(createExportExpression(t.getExportName(e),t.getLocalName(e))),e),e))}}n=appendExportsOfImportEqualsDeclaration(n,e);return singleOrMany(n)}function visitTopLevelExportDeclaration(e){if(!e.moduleSpecifier){return void 0}const r=t.getGeneratedNameForNode(e);if(e.exportClause&&isNamedExports(e.exportClause)){const i=[];if(p!==2){i.push(setOriginalNode(setTextRange(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(r,void 0,void 0,createRequireCall2(e))])),e),e))}for(const o of e.exportClause.elements){const s=o.propertyName||o.name;const c=!!Kn(a)&&!(getInternalEmitFlags(e)&2)&&moduleExportNameIsDefault(s);const l=c?n().createImportDefaultHelper(r):r;const d=s.kind===11?t.createElementAccessExpression(l,s):t.createPropertyAccessExpression(l,s);i.push(setOriginalNode(setTextRange(t.createExpressionStatement(createExportExpression(o.name.kind===11?t.cloneNode(o.name):t.getExportName(o),d,void 0,true)),o),o))}return singleOrMany(i)}else if(e.exportClause){const n=[];n.push(setOriginalNode(setTextRange(t.createExpressionStatement(createExportExpression(t.cloneNode(e.exportClause.name),getHelperExpressionForExport(e,p!==2?createRequireCall2(e):isExportNamespaceAsDefaultDeclaration(e)?r:e.exportClause.name.kind===11?r:t.createIdentifier(idText(e.exportClause.name))))),e),e));return singleOrMany(n)}else{return setOriginalNode(setTextRange(t.createExpressionStatement(n().createExportStarHelper(p!==2?createRequireCall2(e):r)),e),e)}}function visitTopLevelExportAssignment(e){if(e.isExportEquals){return void 0}return createExportStatement(t.createIdentifier("default"),visitNode(e.expression,visitor,isExpression),e,true)}function visitFunctionDeclaration(n){let r;if(hasSyntacticModifier(n,32)){r=append(r,setOriginalNode(setTextRange(t.createFunctionDeclaration(visitNodes2(n.modifiers,modifierVisitor,isModifier),n.asteriskToken,t.getDeclarationName(n,true,true),void 0,visitNodes2(n.parameters,visitor,isParameter),void 0,visitEachChild(n.body,visitor,e)),n),n))}else{r=append(r,visitEachChild(n,visitor,e))}return singleOrMany(r)}function visitClassDeclaration(n){let r;if(hasSyntacticModifier(n,32)){r=append(r,setOriginalNode(setTextRange(t.createClassDeclaration(visitNodes2(n.modifiers,modifierVisitor,isModifierLike),t.getDeclarationName(n,true,true),void 0,visitNodes2(n.heritageClauses,visitor,isHeritageClause),visitNodes2(n.members,visitor,isClassElement)),n),n))}else{r=append(r,visitEachChild(n,visitor,e))}r=appendExportsOfHoistedDeclaration(r,n);return singleOrMany(r)}function visitVariableStatement(n){let r;let i;let o;if(hasSyntacticModifier(n,32)){let e;let a=false;for(const r of n.declarationList.declarations){if(isIdentifier(r.name)&&isLocalName(r.name)){if(!e){e=visitNodes2(n.modifiers,modifierVisitor,isModifier)}if(r.initializer){const e=t.updateVariableDeclaration(r,r.name,void 0,void 0,createExportExpression(r.name,visitNode(r.initializer,visitor,isExpression)));i=append(i,e)}else{i=append(i,r)}}else if(r.initializer){if(!isBindingPattern(r.name)&&(isArrowFunction(r.initializer)||isFunctionExpression(r.initializer)||isClassExpression(r.initializer))){const e=t.createAssignment(setTextRange(t.createPropertyAccessExpression(t.createIdentifier("exports"),r.name),r.name),t.createIdentifier(getTextOfIdentifierOrLiteral(r.name)));const n=t.createVariableDeclaration(r.name,r.exclamationToken,r.type,visitNode(r.initializer,visitor,isExpression));i=append(i,n);o=append(o,e);a=true}else{o=append(o,transformInitializedVariable(r))}}}if(i){r=append(r,t.updateVariableStatement(n,e,t.updateVariableDeclarationList(n.declarationList,i)))}if(o){const e=setOriginalNode(setTextRange(t.createExpressionStatement(t.inlineExpressions(o)),n),n);if(a){removeAllComments(e)}r=append(r,e)}}else{r=append(r,visitEachChild(n,visitor,e))}r=appendExportsOfVariableStatement(r,n);return singleOrMany(r)}function createAllExportExpressions(e,n,r){const i=getExports(e);if(i){let o=isExportName(e)?n:t.createAssignment(e,n);for(const e of i){setEmitFlags(o,8);o=createExportExpression(e,o,r)}return o}return t.createAssignment(e,n)}function transformInitializedVariable(n){if(isBindingPattern(n.name)){return flattenDestructuringAssignment(visitNode(n,visitor,isInitializedVariable),visitor,e,0,false,createAllExportExpressions)}else{return t.createAssignment(setTextRange(t.createPropertyAccessExpression(t.createIdentifier("exports"),n.name),n.name),n.initializer?visitNode(n.initializer,visitor,isExpression):t.createVoidZero())}}function appendExportsOfImportDeclaration(e,t){if(g.exportEquals){return e}const n=t.importClause;if(!n){return e}const r=new ya;if(n.name){e=appendExportsOfDeclaration(e,r,n)}const i=n.namedBindings;if(i){switch(i.kind){case 274:e=appendExportsOfDeclaration(e,r,i);break;case 275:for(const t of i.elements){e=appendExportsOfDeclaration(e,r,t,true)}break}}return e}function appendExportsOfImportEqualsDeclaration(e,t){if(g.exportEquals){return e}return appendExportsOfDeclaration(e,new ya,t)}function appendExportsOfVariableStatement(e,t){return appendExportsOfVariableDeclarationList(e,t.declarationList,false)}function appendExportsOfVariableDeclarationList(e,t,n){if(g.exportEquals){return e}for(const r of t.declarations){e=appendExportsOfBindingElement(e,r,n)}return e}function appendExportsOfBindingElement(e,t,n){if(g.exportEquals){return e}if(isBindingPattern(t.name)){for(const r of t.name.elements){if(!isOmittedExpression(r)){e=appendExportsOfBindingElement(e,r,n)}}}else if(!isGeneratedIdentifier(t.name)&&(!isVariableDeclaration(t)||t.initializer||n)){e=appendExportsOfDeclaration(e,new ya,t)}return e}function appendExportsOfHoistedDeclaration(e,n){if(g.exportEquals){return e}const r=new ya;if(hasSyntacticModifier(n,32)){const i=hasSyntacticModifier(n,2048)?t.createIdentifier("default"):t.getDeclarationName(n);e=appendExportStatement(e,r,i,t.getLocalName(n),n)}if(n.name){e=appendExportsOfDeclaration(e,r,n)}return e}function appendExportsOfDeclaration(e,n,r,i){const o=t.getDeclarationName(r);const a=g.exportSpecifiers.get(o);if(a){for(const t of a){e=appendExportStatement(e,n,t.name,o,t.name,void 0,i)}}return e}function appendExportStatement(e,t,n,r,i,o,a){if(n.kind!==11){if(t.has(n)){return e}t.set(n,true)}e=append(e,createExportStatement(n,r,i,o,a));return e}function createUnderscoreUnderscoreESModule(){const e=t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"defineProperty"),void 0,[t.createIdentifier("exports"),t.createStringLiteral("__esModule"),t.createObjectLiteralExpression([t.createPropertyAssignment("value",t.createTrue())])]));setEmitFlags(e,2097152);return e}function createExportStatement(e,n,r,i,o){const a=setTextRange(t.createExpressionStatement(createExportExpression(e,n,void 0,o)),r);startOnNewLine(a);if(!i){setEmitFlags(a,3072)}return a}function createExportExpression(e,n,r,i){return setTextRange(i?t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"defineProperty"),void 0,[t.createIdentifier("exports"),t.createStringLiteralFromNode(e),t.createObjectLiteralExpression([t.createPropertyAssignment("enumerable",t.createTrue()),t.createPropertyAssignment("get",t.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,t.createBlock([t.createReturnStatement(n)])))])]):t.createAssignment(e.kind===11?t.createElementAccessExpression(t.createIdentifier("exports"),t.cloneNode(e)):t.createPropertyAccessExpression(t.createIdentifier("exports"),t.cloneNode(e)),n),r)}function modifierVisitor(e){switch(e.kind){case 95:case 90:return void 0}return e}function onEmitNode(e,t,n){if(t.kind===307){_=t;g=m[getOriginalNodeId(_)];f(e,t,n);_=void 0;g=void 0}else{f(e,t,n)}}function onSubstituteNode(e,t){t=u(e,t);if(t.id&&h[t.id]){return t}if(e===1){return substituteExpression(t)}else if(isShorthandPropertyAssignment(t)){return substituteShorthandPropertyAssignment(t)}return t}function substituteShorthandPropertyAssignment(e){const n=e.name;const r=substituteExpressionIdentifier(n);if(r!==n){if(e.objectAssignmentInitializer){const i=t.createAssignment(r,e.objectAssignmentInitializer);return setTextRange(t.createPropertyAssignment(n,i),e)}return setTextRange(t.createPropertyAssignment(n,r),e)}return e}function substituteExpression(e){switch(e.kind){case 80:return substituteExpressionIdentifier(e);case 213:return substituteCallExpression(e);case 215:return substituteTaggedTemplateExpression(e);case 226:return substituteBinaryExpression(e)}return e}function substituteCallExpression(e){if(isIdentifier(e.expression)){const n=substituteExpressionIdentifier(e.expression);h[getNodeId(n)]=true;if(!isIdentifier(n)&&!(getEmitFlags(e.expression)&8192)){return addInternalEmitFlags(t.updateCallExpression(e,n,void 0,e.arguments),16)}}return e}function substituteTaggedTemplateExpression(e){if(isIdentifier(e.tag)){const n=substituteExpressionIdentifier(e.tag);h[getNodeId(n)]=true;if(!isIdentifier(n)&&!(getEmitFlags(e.tag)&8192)){return addInternalEmitFlags(t.updateTaggedTemplateExpression(e,n,void 0,e.template),16)}}return e}function substituteExpressionIdentifier(e){var n,r;if(getEmitFlags(e)&8192){const n=getExternalHelpersModuleName(_);if(n){return t.createPropertyAccessExpression(n,e)}return e}else if(!(isGeneratedIdentifier(e)&&!(e.emitNode.autoGenerate.flags&64))&&!isLocalName(e)){const i=s.getReferencedExportContainer(e,isExportName(e));if(i&&i.kind===307){return setTextRange(t.createPropertyAccessExpression(t.createIdentifier("exports"),t.cloneNode(e)),e)}const o=s.getReferencedImportDeclaration(e);if(o){if(isImportClause(o)){return setTextRange(t.createPropertyAccessExpression(t.getGeneratedNameForNode(o.parent),t.createIdentifier("default")),e)}else if(isImportSpecifier(o)){const i=o.propertyName||o.name;const a=t.getGeneratedNameForNode(((r=(n=o.parent)==null?void 0:n.parent)==null?void 0:r.parent)||o);return setTextRange(i.kind===11?t.createElementAccessExpression(a,t.cloneNode(i)):t.createPropertyAccessExpression(a,t.cloneNode(i)),e)}}}return e}function substituteBinaryExpression(e){if(isAssignmentOperator(e.operatorToken.kind)&&isIdentifier(e.left)&&(!isGeneratedIdentifier(e.left)||isFileLevelReservedGeneratedIdentifier(e.left))&&!isLocalName(e.left)){const t=getExports(e.left);if(t){let n=e;for(const r of t){h[getNodeId(n)]=true;n=createExportExpression(r,n,e)}return n}}return e}function getExports(e){if(!isGeneratedIdentifier(e)){const t=s.getReferencedImportDeclaration(e);if(t){return g==null?void 0:g.exportedBindings[getOriginalNodeId(t)]}const n=new Set;const r=s.getReferencedValueDeclarations(e);if(r){for(const e of r){const t=g==null?void 0:g.exportedBindings[getOriginalNodeId(e)];if(t){for(const e of t){n.add(e)}}}if(n.size){return arrayFrom(n)}}}else if(isFileLevelReservedGeneratedIdentifier(e)){const t=g==null?void 0:g.exportSpecifiers.get(e);if(t){const e=[];for(const n of t){e.push(n.name)}return e}}}}var ba={name:"typescript:dynamicimport-sync-require",scoped:true,text:`\n var __syncRequire = typeof module === "object" && typeof module.exports === "object";`};function transformSystemModule(e){const{factory:t,startLexicalEnvironment:n,endLexicalEnvironment:r,hoistVariableDeclaration:i}=e;const o=e.getCompilerOptions();const a=e.getEmitResolver();const s=e.getEmitHost();const c=e.onSubstituteNode;const l=e.onEmitNode;e.onSubstituteNode=onSubstituteNode;e.onEmitNode=onEmitNode;e.enableSubstitution(80);e.enableSubstitution(304);e.enableSubstitution(226);e.enableSubstitution(236);e.enableEmitNotification(307);const d=[];const p=[];const u=[];const f=[];let m;let _;let g;let y;let h;let T;let v;return chainBundle(e,transformSourceFile);function transformSourceFile(n){if(n.isDeclarationFile||!(isEffectiveExternalModule(n,o)||n.transformFlags&8388608)){return n}const r=getOriginalNodeId(n);m=n;T=n;_=d[r]=collectExternalModuleInfo(e,n);g=t.createUniqueName("exports");p[r]=g;y=f[r]=t.createUniqueName("context");const i=collectDependencyGroups(_.externalImports);const a=createSystemModuleBody(n,i);const c=t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,g),t.createParameterDeclaration(void 0,void 0,y)],void 0,a);const l=tryGetModuleNameFromFile(t,n,s,o);const S=t.createArrayLiteralExpression(map(i,(e=>e.name)));const x=setEmitFlags(t.updateSourceFile(n,setTextRange(t.createNodeArray([t.createExpressionStatement(t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("System"),"register"),void 0,l?[l,S,c]:[S,c]))]),n.statements)),2048);if(!o.outFile){moveEmitHelpers(x,a,(e=>!e.scoped))}if(v){u[r]=v;v=void 0}m=void 0;_=void 0;g=void 0;y=void 0;h=void 0;T=void 0;return x}function collectDependencyGroups(e){const n=new Map;const r=[];for(const i of e){const e=getExternalModuleNameLiteral(t,i,m,s,a,o);if(e){const t=e.text;const o=n.get(t);if(o!==void 0){r[o].externalImports.push(i)}else{n.set(t,r.length);r.push({name:e,externalImports:[i]})}}}return r}function createSystemModuleBody(e,i){const a=[];n();const s=getStrictOptionValue(o,"alwaysStrict")||isExternalModule(m);const c=t.copyPrologue(e.statements,a,s,topLevelVisitor);a.push(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration("__moduleName",void 0,void 0,t.createLogicalAnd(y,t.createPropertyAccessExpression(y,"id")))])));visitNode(_.externalHelpersImportDeclaration,topLevelVisitor,isStatement);const l=visitNodes2(e.statements,topLevelVisitor,isStatement,c);addRange(a,h);insertStatementsAfterStandardPrologue(a,r());const d=addExportStarIfNeeded(a);const p=e.transformFlags&2097152?t.createModifiersFromModifierFlags(1024):void 0;const u=t.createObjectLiteralExpression([t.createPropertyAssignment("setters",createSettersArray(d,i)),t.createPropertyAssignment("execute",t.createFunctionExpression(p,void 0,void 0,void 0,[],void 0,t.createBlock(l,true)))],true);a.push(t.createReturnStatement(u));return t.createBlock(a,true)}function addExportStarIfNeeded(e){if(!_.hasExportStarsToExportValues){return}if(!some(_.exportedNames)&&_.exportedFunctions.size===0&&_.exportSpecifiers.size===0){let t=false;for(const e of _.externalImports){if(e.kind===278&&e.exportClause){t=true;break}}if(!t){const t=createExportStarFunction(void 0);e.push(t);return t.name}}const n=[];if(_.exportedNames){for(const e of _.exportedNames){if(moduleExportNameIsDefault(e)){continue}n.push(t.createPropertyAssignment(t.createStringLiteralFromNode(e),t.createTrue()))}}for(const e of _.exportedFunctions){if(hasSyntacticModifier(e,2048)){continue}S.assert(!!e.name);n.push(t.createPropertyAssignment(t.createStringLiteralFromNode(e.name),t.createTrue()))}const r=t.createUniqueName("exportedNames");e.push(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(r,void 0,void 0,t.createObjectLiteralExpression(n,true))])));const i=createExportStarFunction(r);e.push(i);return i.name}function createExportStarFunction(e){const n=t.createUniqueName("exportStar");const r=t.createIdentifier("m");const i=t.createIdentifier("n");const o=t.createIdentifier("exports");let a=t.createStrictInequality(i,t.createStringLiteral("default"));if(e){a=t.createLogicalAnd(a,t.createLogicalNot(t.createCallExpression(t.createPropertyAccessExpression(e,"hasOwnProperty"),void 0,[i])))}return t.createFunctionDeclaration(void 0,void 0,n,void 0,[t.createParameterDeclaration(void 0,void 0,r)],void 0,t.createBlock([t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(o,void 0,void 0,t.createObjectLiteralExpression([]))])),t.createForInStatement(t.createVariableDeclarationList([t.createVariableDeclaration(i)]),r,t.createBlock([setEmitFlags(t.createIfStatement(a,t.createExpressionStatement(t.createAssignment(t.createElementAccessExpression(o,i),t.createElementAccessExpression(r,i)))),1)])),t.createExpressionStatement(t.createCallExpression(g,void 0,[o]))],true))}function createSettersArray(e,n){const r=[];for(const i of n){const n=forEach(i.externalImports,(e=>getLocalNameForExternalImport(t,e,m)));const o=n?t.getGeneratedNameForNode(n):t.createUniqueName("");const a=[];for(const n of i.externalImports){const r=getLocalNameForExternalImport(t,n,m);switch(n.kind){case 272:if(!n.importClause){break}case 271:S.assert(r!==void 0);a.push(t.createExpressionStatement(t.createAssignment(r,o)));if(hasSyntacticModifier(n,32)){a.push(t.createExpressionStatement(t.createCallExpression(g,void 0,[t.createStringLiteral(idText(r)),o])))}break;case 278:S.assert(r!==void 0);if(n.exportClause){if(isNamedExports(n.exportClause)){const e=[];for(const r of n.exportClause.elements){e.push(t.createPropertyAssignment(t.createStringLiteral(moduleExportNameTextUnescaped(r.name)),t.createElementAccessExpression(o,t.createStringLiteral(moduleExportNameTextUnescaped(r.propertyName||r.name)))))}a.push(t.createExpressionStatement(t.createCallExpression(g,void 0,[t.createObjectLiteralExpression(e,true)])))}else{a.push(t.createExpressionStatement(t.createCallExpression(g,void 0,[t.createStringLiteral(moduleExportNameTextUnescaped(n.exportClause.name)),o])))}}else{a.push(t.createExpressionStatement(t.createCallExpression(e,void 0,[o])))}break}}r.push(t.createFunctionExpression(void 0,void 0,void 0,void 0,[t.createParameterDeclaration(void 0,void 0,o)],void 0,t.createBlock(a,true)))}return t.createArrayLiteralExpression(r,true)}function topLevelVisitor(e){switch(e.kind){case 272:return visitImportDeclaration(e);case 271:return visitImportEqualsDeclaration(e);case 278:return visitExportDeclaration(e);case 277:return visitExportAssignment(e);default:return topLevelNestedVisitor(e)}}function visitImportDeclaration(e){let n;if(e.importClause){i(getLocalNameForExternalImport(t,e,m))}return singleOrMany(appendExportsOfImportDeclaration(n,e))}function visitExportDeclaration(e){S.assertIsDefined(e);return void 0}function visitImportEqualsDeclaration(e){S.assert(isExternalModuleImportEqualsDeclaration(e),"import= for internal module references should be handled in an earlier transformer.");let n;i(getLocalNameForExternalImport(t,e,m));return singleOrMany(appendExportsOfImportEqualsDeclaration(n,e))}function visitExportAssignment(e){if(e.isExportEquals){return void 0}const n=visitNode(e.expression,visitor,isExpression);return createExportStatement(t.createIdentifier("default"),n,true)}function visitFunctionDeclaration(n){if(hasSyntacticModifier(n,32)){h=append(h,t.updateFunctionDeclaration(n,visitNodes2(n.modifiers,modifierVisitor,isModifierLike),n.asteriskToken,t.getDeclarationName(n,true,true),void 0,visitNodes2(n.parameters,visitor,isParameter),void 0,visitNode(n.body,visitor,isBlock)))}else{h=append(h,visitEachChild(n,visitor,e))}h=appendExportsOfHoistedDeclaration(h,n);return void 0}function visitClassDeclaration(e){let n;const r=t.getLocalName(e);i(r);n=append(n,setTextRange(t.createExpressionStatement(t.createAssignment(r,setTextRange(t.createClassExpression(visitNodes2(e.modifiers,modifierVisitor,isModifierLike),e.name,void 0,visitNodes2(e.heritageClauses,visitor,isHeritageClause),visitNodes2(e.members,visitor,isClassElement)),e))),e));n=appendExportsOfHoistedDeclaration(n,e);return singleOrMany(n)}function visitVariableStatement(e){if(!shouldHoistVariableDeclarationList(e.declarationList)){return visitNode(e,visitor,isStatement)}let n;if(isVarUsing(e.declarationList)||isVarAwaitUsing(e.declarationList)){const r=visitNodes2(e.modifiers,modifierVisitor,isModifierLike);const i=[];for(const n of e.declarationList.declarations){i.push(t.updateVariableDeclaration(n,t.getGeneratedNameForNode(n.name),void 0,void 0,transformInitializedVariable(n,false)))}const o=t.updateVariableDeclarationList(e.declarationList,i);n=append(n,t.updateVariableStatement(e,r,o))}else{let r;const i=hasSyntacticModifier(e,32);for(const t of e.declarationList.declarations){if(t.initializer){r=append(r,transformInitializedVariable(t,i))}else{hoistBindingElement(t)}}if(r){n=append(n,setTextRange(t.createExpressionStatement(t.inlineExpressions(r)),e))}}n=appendExportsOfVariableStatement(n,e,false);return singleOrMany(n)}function hoistBindingElement(e){if(isBindingPattern(e.name)){for(const t of e.name.elements){if(!isOmittedExpression(t)){hoistBindingElement(t)}}}else{i(t.cloneNode(e.name))}}function shouldHoistVariableDeclarationList(e){return(getEmitFlags(e)&4194304)===0&&(T.kind===307||(getOriginalNode(e).flags&7)===0)}function transformInitializedVariable(t,n){const r=n?createExportedVariableAssignment:createNonExportedVariableAssignment;return isBindingPattern(t.name)?flattenDestructuringAssignment(t,visitor,e,0,false,r):t.initializer?r(t.name,visitNode(t.initializer,visitor,isExpression)):t.name}function createExportedVariableAssignment(e,t,n){return createVariableAssignment(e,t,n,true)}function createNonExportedVariableAssignment(e,t,n){return createVariableAssignment(e,t,n,false)}function createVariableAssignment(e,n,r,o){i(t.cloneNode(e));return o?createExportExpression(e,preventSubstitution(setTextRange(t.createAssignment(e,n),r))):preventSubstitution(setTextRange(t.createAssignment(e,n),r))}function appendExportsOfImportDeclaration(e,t){if(_.exportEquals){return e}const n=t.importClause;if(!n){return e}if(n.name){e=appendExportsOfDeclaration(e,n)}const r=n.namedBindings;if(r){switch(r.kind){case 274:e=appendExportsOfDeclaration(e,r);break;case 275:for(const t of r.elements){e=appendExportsOfDeclaration(e,t)}break}}return e}function appendExportsOfImportEqualsDeclaration(e,t){if(_.exportEquals){return e}return appendExportsOfDeclaration(e,t)}function appendExportsOfVariableStatement(e,t,n){if(_.exportEquals){return e}for(const r of t.declarationList.declarations){if(r.initializer||n){e=appendExportsOfBindingElement(e,r,n)}}return e}function appendExportsOfBindingElement(e,n,r){if(_.exportEquals){return e}if(isBindingPattern(n.name)){for(const t of n.name.elements){if(!isOmittedExpression(t)){e=appendExportsOfBindingElement(e,t,r)}}}else if(!isGeneratedIdentifier(n.name)){let i;if(r){e=appendExportStatement(e,n.name,t.getLocalName(n));i=idText(n.name)}e=appendExportsOfDeclaration(e,n,i)}return e}function appendExportsOfHoistedDeclaration(e,n){if(_.exportEquals){return e}let r;if(hasSyntacticModifier(n,32)){const i=hasSyntacticModifier(n,2048)?t.createStringLiteral("default"):n.name;e=appendExportStatement(e,i,t.getLocalName(n));r=getTextOfIdentifierOrLiteral(i)}if(n.name){e=appendExportsOfDeclaration(e,n,r)}return e}function appendExportsOfDeclaration(e,n,r){if(_.exportEquals){return e}const i=t.getDeclarationName(n);const o=_.exportSpecifiers.get(i);if(o){for(const t of o){if(moduleExportNameTextUnescaped(t.name)!==r){e=appendExportStatement(e,t.name,i)}}}return e}function appendExportStatement(e,t,n,r){e=append(e,createExportStatement(t,n,r));return e}function createExportStatement(e,n,r){const i=t.createExpressionStatement(createExportExpression(e,n));startOnNewLine(i);if(!r){setEmitFlags(i,3072)}return i}function createExportExpression(e,n){const r=isIdentifier(e)?t.createStringLiteralFromNode(e):e;setEmitFlags(n,getEmitFlags(n)|3072);return setCommentRange(t.createCallExpression(g,void 0,[r,n]),n)}function topLevelNestedVisitor(e){switch(e.kind){case 243:return visitVariableStatement(e);case 262:return visitFunctionDeclaration(e);case 263:return visitClassDeclaration(e);case 248:return visitForStatement(e,true);case 249:return visitForInStatement(e);case 250:return visitForOfStatement(e);case 246:return visitDoStatement(e);case 247:return visitWhileStatement(e);case 256:return visitLabeledStatement(e);case 254:return visitWithStatement(e);case 245:return visitIfStatement(e);case 255:return visitSwitchStatement(e);case 269:return visitCaseBlock(e);case 296:return visitCaseClause(e);case 297:return visitDefaultClause(e);case 258:return visitTryStatement(e);case 299:return visitCatchClause(e);case 241:return visitBlock(e);default:return visitor(e)}}function visitForStatement(n,r){const i=T;T=n;n=t.updateForStatement(n,visitNode(n.initializer,r?visitForInitializer:discardedValueVisitor,isForInitializer),visitNode(n.condition,visitor,isExpression),visitNode(n.incrementor,discardedValueVisitor,isExpression),visitIterationBody(n.statement,r?topLevelNestedVisitor:visitor,e));T=i;return n}function visitForInStatement(n){const r=T;T=n;n=t.updateForInStatement(n,visitForInitializer(n.initializer),visitNode(n.expression,visitor,isExpression),visitIterationBody(n.statement,topLevelNestedVisitor,e));T=r;return n}function visitForOfStatement(n){const r=T;T=n;n=t.updateForOfStatement(n,n.awaitModifier,visitForInitializer(n.initializer),visitNode(n.expression,visitor,isExpression),visitIterationBody(n.statement,topLevelNestedVisitor,e));T=r;return n}function shouldHoistForInitializer(e){return isVariableDeclarationList(e)&&shouldHoistVariableDeclarationList(e)}function visitForInitializer(e){if(shouldHoistForInitializer(e)){let n;for(const t of e.declarations){n=append(n,transformInitializedVariable(t,false));if(!t.initializer){hoistBindingElement(t)}}return n?t.inlineExpressions(n):t.createOmittedExpression()}else{return visitNode(e,discardedValueVisitor,isForInitializer)}}function visitDoStatement(n){return t.updateDoStatement(n,visitIterationBody(n.statement,topLevelNestedVisitor,e),visitNode(n.expression,visitor,isExpression))}function visitWhileStatement(n){return t.updateWhileStatement(n,visitNode(n.expression,visitor,isExpression),visitIterationBody(n.statement,topLevelNestedVisitor,e))}function visitLabeledStatement(e){return t.updateLabeledStatement(e,e.label,visitNode(e.statement,topLevelNestedVisitor,isStatement,t.liftToBlock)??t.createExpressionStatement(t.createIdentifier("")))}function visitWithStatement(e){return t.updateWithStatement(e,visitNode(e.expression,visitor,isExpression),S.checkDefined(visitNode(e.statement,topLevelNestedVisitor,isStatement,t.liftToBlock)))}function visitIfStatement(e){return t.updateIfStatement(e,visitNode(e.expression,visitor,isExpression),visitNode(e.thenStatement,topLevelNestedVisitor,isStatement,t.liftToBlock)??t.createBlock([]),visitNode(e.elseStatement,topLevelNestedVisitor,isStatement,t.liftToBlock))}function visitSwitchStatement(e){return t.updateSwitchStatement(e,visitNode(e.expression,visitor,isExpression),S.checkDefined(visitNode(e.caseBlock,topLevelNestedVisitor,isCaseBlock)))}function visitCaseBlock(e){const n=T;T=e;e=t.updateCaseBlock(e,visitNodes2(e.clauses,topLevelNestedVisitor,isCaseOrDefaultClause));T=n;return e}function visitCaseClause(e){return t.updateCaseClause(e,visitNode(e.expression,visitor,isExpression),visitNodes2(e.statements,topLevelNestedVisitor,isStatement))}function visitDefaultClause(t){return visitEachChild(t,topLevelNestedVisitor,e)}function visitTryStatement(t){return visitEachChild(t,topLevelNestedVisitor,e)}function visitCatchClause(e){const n=T;T=e;e=t.updateCatchClause(e,e.variableDeclaration,S.checkDefined(visitNode(e.block,topLevelNestedVisitor,isBlock)));T=n;return e}function visitBlock(t){const n=T;T=t;t=visitEachChild(t,topLevelNestedVisitor,e);T=n;return t}function visitorWorker(t,n){if(!(t.transformFlags&(4096|8388608|268435456))){return t}switch(t.kind){case 248:return visitForStatement(t,false);case 244:return visitExpressionStatement(t);case 217:return visitParenthesizedExpression(t,n);case 355:return visitPartiallyEmittedExpression(t,n);case 226:if(isDestructuringAssignment(t)){return visitDestructuringAssignment(t,n)}break;case 213:if(isImportCall(t)){return visitImportCallExpression(t)}break;case 224:case 225:return visitPrefixOrPostfixUnaryExpression(t,n)}return visitEachChild(t,visitor,e)}function visitor(e){return visitorWorker(e,false)}function discardedValueVisitor(e){return visitorWorker(e,true)}function visitExpressionStatement(e){return t.updateExpressionStatement(e,visitNode(e.expression,discardedValueVisitor,isExpression))}function visitParenthesizedExpression(e,n){return t.updateParenthesizedExpression(e,visitNode(e.expression,n?discardedValueVisitor:visitor,isExpression))}function visitPartiallyEmittedExpression(e,n){return t.updatePartiallyEmittedExpression(e,visitNode(e.expression,n?discardedValueVisitor:visitor,isExpression))}function visitImportCallExpression(e){const n=getExternalModuleNameLiteral(t,e,m,s,a,o);const r=visitNode(firstOrUndefined(e.arguments),visitor,isExpression);const i=n&&(!r||!isStringLiteral(r)||r.text!==n.text)?n:r;return t.createCallExpression(t.createPropertyAccessExpression(y,t.createIdentifier("import")),void 0,i?[i]:[])}function visitDestructuringAssignment(t,n){if(hasExportedReferenceInDestructuringTarget(t.left)){return flattenDestructuringAssignment(t,visitor,e,0,!n)}return visitEachChild(t,visitor,e)}function hasExportedReferenceInDestructuringTarget(e){if(isAssignmentExpression(e,true)){return hasExportedReferenceInDestructuringTarget(e.left)}else if(isSpreadElement(e)){return hasExportedReferenceInDestructuringTarget(e.expression)}else if(isObjectLiteralExpression(e)){return some(e.properties,hasExportedReferenceInDestructuringTarget)}else if(isArrayLiteralExpression(e)){return some(e.elements,hasExportedReferenceInDestructuringTarget)}else if(isShorthandPropertyAssignment(e)){return hasExportedReferenceInDestructuringTarget(e.name)}else if(isPropertyAssignment(e)){return hasExportedReferenceInDestructuringTarget(e.initializer)}else if(isIdentifier(e)){const t=a.getReferencedExportContainer(e);return t!==void 0&&t.kind===307}else{return false}}function visitPrefixOrPostfixUnaryExpression(n,r){if((n.operator===46||n.operator===47)&&isIdentifier(n.operand)&&!isGeneratedIdentifier(n.operand)&&!isLocalName(n.operand)&&!isDeclarationNameOfEnumOrNamespace(n.operand)){const e=getExports(n.operand);if(e){let o;let a=visitNode(n.operand,visitor,isExpression);if(isPrefixUnaryExpression(n)){a=t.updatePrefixUnaryExpression(n,a)}else{a=t.updatePostfixUnaryExpression(n,a);if(!r){o=t.createTempVariable(i);a=t.createAssignment(o,a);setTextRange(a,n)}a=t.createComma(a,t.cloneNode(n.operand));setTextRange(a,n)}for(const t of e){a=createExportExpression(t,preventSubstitution(a))}if(o){a=t.createComma(a,o);setTextRange(a,n)}return a}}return visitEachChild(n,visitor,e)}function modifierVisitor(e){switch(e.kind){case 95:case 90:return void 0}return e}function onEmitNode(e,t,n){if(t.kind===307){const r=getOriginalNodeId(t);m=t;_=d[r];g=p[r];v=u[r];y=f[r];if(v){delete u[r]}l(e,t,n);m=void 0;_=void 0;g=void 0;y=void 0;v=void 0}else{l(e,t,n)}}function onSubstituteNode(e,t){t=c(e,t);if(isSubstitutionPrevented(t)){return t}if(e===1){return substituteExpression(t)}else if(e===4){return substituteUnspecified(t)}return t}function substituteUnspecified(e){switch(e.kind){case 304:return substituteShorthandPropertyAssignment(e)}return e}function substituteShorthandPropertyAssignment(e){var n,r;const i=e.name;if(!isGeneratedIdentifier(i)&&!isLocalName(i)){const o=a.getReferencedImportDeclaration(i);if(o){if(isImportClause(o)){return setTextRange(t.createPropertyAssignment(t.cloneNode(i),t.createPropertyAccessExpression(t.getGeneratedNameForNode(o.parent),t.createIdentifier("default"))),e)}else if(isImportSpecifier(o)){const a=o.propertyName||o.name;const s=t.getGeneratedNameForNode(((r=(n=o.parent)==null?void 0:n.parent)==null?void 0:r.parent)||o);return setTextRange(t.createPropertyAssignment(t.cloneNode(i),a.kind===11?t.createElementAccessExpression(s,t.cloneNode(a)):t.createPropertyAccessExpression(s,t.cloneNode(a))),e)}}}return e}function substituteExpression(e){switch(e.kind){case 80:return substituteExpressionIdentifier(e);case 226:return substituteBinaryExpression(e);case 236:return substituteMetaProperty(e)}return e}function substituteExpressionIdentifier(e){var n,r;if(getEmitFlags(e)&8192){const n=getExternalHelpersModuleName(m);if(n){return t.createPropertyAccessExpression(n,e)}return e}if(!isGeneratedIdentifier(e)&&!isLocalName(e)){const i=a.getReferencedImportDeclaration(e);if(i){if(isImportClause(i)){return setTextRange(t.createPropertyAccessExpression(t.getGeneratedNameForNode(i.parent),t.createIdentifier("default")),e)}else if(isImportSpecifier(i)){const o=i.propertyName||i.name;const a=t.getGeneratedNameForNode(((r=(n=i.parent)==null?void 0:n.parent)==null?void 0:r.parent)||i);return setTextRange(o.kind===11?t.createElementAccessExpression(a,t.cloneNode(o)):t.createPropertyAccessExpression(a,t.cloneNode(o)),e)}}}return e}function substituteBinaryExpression(e){if(isAssignmentOperator(e.operatorToken.kind)&&isIdentifier(e.left)&&(!isGeneratedIdentifier(e.left)||isFileLevelReservedGeneratedIdentifier(e.left))&&!isLocalName(e.left)){const t=getExports(e.left);if(t){let n=e;for(const e of t){n=createExportExpression(e,preventSubstitution(n))}return n}}return e}function substituteMetaProperty(e){if(isImportMeta(e)){return t.createPropertyAccessExpression(y,t.createIdentifier("meta"))}return e}function getExports(e){let n;const r=getReferencedDeclaration(e);if(r){const i=a.getReferencedExportContainer(e,false);if(i&&i.kind===307){n=append(n,t.getDeclarationName(r))}n=addRange(n,_==null?void 0:_.exportedBindings[getOriginalNodeId(r)])}else if(isGeneratedIdentifier(e)&&isFileLevelReservedGeneratedIdentifier(e)){const t=_==null?void 0:_.exportSpecifiers.get(e);if(t){const e=[];for(const n of t){e.push(n.name)}return e}}return n}function getReferencedDeclaration(e){if(!isGeneratedIdentifier(e)){const t=a.getReferencedImportDeclaration(e);if(t)return t;const n=a.getReferencedValueDeclaration(e);if(n&&(_==null?void 0:_.exportedBindings[getOriginalNodeId(n)]))return n;const r=a.getReferencedValueDeclarations(e);if(r){for(const e of r){if(e!==n&&(_==null?void 0:_.exportedBindings[getOriginalNodeId(e)]))return e}}return n}}function preventSubstitution(e){if(v===void 0)v=[];v[getNodeId(e)]=true;return e}function isSubstitutionPrevented(e){return v&&e.id&&v[e.id]}}function transformECMAScriptModule(e){const{factory:t,getEmitHelperFactory:n}=e;const r=e.getEmitHost();const i=e.getEmitResolver();const o=e.getCompilerOptions();const a=zn(o);const s=e.onEmitNode;const c=e.onSubstituteNode;e.onEmitNode=onEmitNode;e.onSubstituteNode=onSubstituteNode;e.enableEmitNotification(307);e.enableSubstitution(80);const l=new Set;let d;let p;let u;let f;return chainBundle(e,transformSourceFile);function transformSourceFile(n){if(n.isDeclarationFile){return n}if(isExternalModule(n)||Gn(o)){u=n;f=void 0;if(o.rewriteRelativeImportExtensions&&(u.flags&4194304||isInJSFile(n))){forEachDynamicImportOrRequireCall(n,false,false,(e=>{if(!isStringLiteralLike(e.arguments[0])||shouldRewriteModuleSpecifier(e.arguments[0].text,o)){d=append(d,e)}}))}let r=updateExternalModule(n);addEmitHelpers(r,e.readEmitHelpers());u=void 0;if(f){r=t.updateSourceFile(r,setTextRange(t.createNodeArray(insertStatementsAfterCustomPrologue(r.statements.slice(),f)),r.statements))}if(!isExternalModule(n)||Vn(o)===200||some(r.statements,isExternalModuleIndicator)){return r}return t.updateSourceFile(r,setTextRange(t.createNodeArray([...r.statements,createEmptyExports(t)]),r.statements))}return n}function updateExternalModule(r){const i=createExternalHelpersImportDeclarationIfNeeded(t,n(),r,o);if(i){const e=[];const n=t.copyPrologue(r.statements,e);addRange(e,visitArray([i],visitor,isStatement));addRange(e,visitNodes2(r.statements,visitor,isStatement,n));return t.updateSourceFile(r,setTextRange(t.createNodeArray(e),r.statements))}else{return visitEachChild(r,visitor,e)}}function visitor(t){switch(t.kind){case 271:return Vn(o)>=100?visitImportEqualsDeclaration(t):void 0;case 277:return visitExportAssignment(t);case 278:const n=t;return visitExportDeclaration(n);case 272:return visitImportDeclaration(t);case 213:if(t===(d==null?void 0:d[0])){return visitImportOrRequireCall(d.shift())}default:if((d==null?void 0:d.length)&&rangeContainsRange(t,d[0])){return visitEachChild(t,visitor,e)}}return t}function visitImportDeclaration(e){if(!o.rewriteRelativeImportExtensions){return e}const n=rewriteModuleSpecifier(e.moduleSpecifier,o);if(n===e.moduleSpecifier){return e}return t.updateImportDeclaration(e,e.modifiers,e.importClause,n,e.attributes)}function visitImportOrRequireCall(e){return t.updateCallExpression(e,e.expression,e.typeArguments,[isStringLiteralLike(e.arguments[0])?rewriteModuleSpecifier(e.arguments[0],o):n().createRewriteRelativeImportExtensionsHelper(e.arguments[0]),...e.arguments.slice(1)])}function createRequireCall2(e){const n=getExternalModuleNameLiteral(t,e,S.checkDefined(u),r,i,o);const s=[];if(n){s.push(rewriteModuleSpecifier(n,o))}if(Vn(o)===200){return t.createCallExpression(t.createIdentifier("require"),void 0,s)}if(!f){const e=t.createUniqueName("_createRequire",16|32);const n=t.createImportDeclaration(void 0,t.createImportClause(false,void 0,t.createNamedImports([t.createImportSpecifier(false,t.createIdentifier("createRequire"),e)])),t.createStringLiteral("module"),void 0);const r=t.createUniqueName("__require",16|32);const i=t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(r,void 0,void 0,t.createCallExpression(t.cloneNode(e),void 0,[t.createPropertyAccessExpression(t.createMetaProperty(102,t.createIdentifier("meta")),t.createIdentifier("url"))]))],a>=2?2:0));f=[n,i]}const c=f[1].declarationList.declarations[0].name;S.assertNode(c,isIdentifier);return t.createCallExpression(t.cloneNode(c),void 0,s)}function visitImportEqualsDeclaration(e){S.assert(isExternalModuleImportEqualsDeclaration(e),"import= for internal module references should be handled in an earlier transformer.");let n;n=append(n,setOriginalNode(setTextRange(t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.cloneNode(e.name),void 0,void 0,createRequireCall2(e))],a>=2?2:0)),e),e));n=appendExportsOfImportEqualsDeclaration(n,e);return singleOrMany(n)}function appendExportsOfImportEqualsDeclaration(e,n){if(hasSyntacticModifier(n,32)){e=append(e,t.createExportDeclaration(void 0,n.isTypeOnly,t.createNamedExports([t.createExportSpecifier(false,void 0,idText(n.name))])))}return e}function visitExportAssignment(e){if(e.isExportEquals){if(Vn(o)===200){const n=setOriginalNode(t.createExpressionStatement(t.createAssignment(t.createPropertyAccessExpression(t.createIdentifier("module"),"exports"),e.expression)),e);return n}return void 0}return e}function visitExportDeclaration(e){const n=rewriteModuleSpecifier(e.moduleSpecifier,o);if(o.module!==void 0&&o.module>5||!e.exportClause||!isNamespaceExport(e.exportClause)||!e.moduleSpecifier){return!e.moduleSpecifier||n===e.moduleSpecifier?e:t.updateExportDeclaration(e,e.modifiers,e.isTypeOnly,e.exportClause,n,e.attributes)}const r=e.exportClause.name;const i=t.getGeneratedNameForNode(r);const a=t.createImportDeclaration(void 0,t.createImportClause(false,void 0,t.createNamespaceImport(i)),n,e.attributes);setOriginalNode(a,e.exportClause);const s=isExportNamespaceAsDefaultDeclaration(e)?t.createExportDefault(i):t.createExportDeclaration(void 0,false,t.createNamedExports([t.createExportSpecifier(false,i,r)]));setOriginalNode(s,e);return[a,s]}function onEmitNode(e,t,n){if(isSourceFile(t)){if((isExternalModule(t)||Gn(o))&&o.importHelpers){p=new Map}u=t;s(e,t,n);u=void 0;p=void 0}else{s(e,t,n)}}function onSubstituteNode(e,t){t=c(e,t);if(t.id&&l.has(t.id)){return t}if(isIdentifier(t)&&getEmitFlags(t)&8192){return substituteHelperName(t)}return t}function substituteHelperName(e){const n=u&&getExternalHelpersModuleName(u);if(n){l.add(getNodeId(e));return t.createPropertyAccessExpression(n,e)}if(p){const n=idText(e);let r=p.get(n);if(!r){p.set(n,r=t.createUniqueName(n,16|32))}return r}return e}}function transformImpliedNodeFormatDependentModule(e){const t=e.onSubstituteNode;const n=e.onEmitNode;const r=transformECMAScriptModule(e);const i=e.onSubstituteNode;const o=e.onEmitNode;e.onSubstituteNode=t;e.onEmitNode=n;const a=transformModule(e);const s=e.onSubstituteNode;const c=e.onEmitNode;const getEmitModuleFormatOfFile2=t=>e.getEmitHost().getEmitModuleFormatOfFile(t);e.onSubstituteNode=onSubstituteNode;e.onEmitNode=onEmitNode;e.enableSubstitution(307);e.enableEmitNotification(307);let l;return transformSourceFileOrBundle;function onSubstituteNode(e,n){if(isSourceFile(n)){l=n;return t(e,n)}else{if(!l){return t(e,n)}if(getEmitModuleFormatOfFile2(l)>=5){return i(e,n)}return s(e,n)}}function onEmitNode(e,t,r){if(isSourceFile(t)){l=t}if(!l){return n(e,t,r)}if(getEmitModuleFormatOfFile2(l)>=5){return o(e,t,r)}return c(e,t,r)}function getModuleTransformForFile(e){return getEmitModuleFormatOfFile2(e)>=5?r:a}function transformSourceFile(e){if(e.isDeclarationFile){return e}l=e;const t=getModuleTransformForFile(e)(e);l=void 0;S.assert(isSourceFile(t));return t}function transformSourceFileOrBundle(e){return e.kind===307?transformSourceFile(e):transformBundle(e)}function transformBundle(t){return e.factory.createBundle(map(t.sourceFiles,transformSourceFile))}}function canProduceDiagnostics(e){return isVariableDeclaration(e)||isPropertyDeclaration(e)||isPropertySignature(e)||isBindingElement(e)||isSetAccessor(e)||isGetAccessor(e)||isConstructSignatureDeclaration(e)||isCallSignatureDeclaration(e)||isMethodDeclaration(e)||isMethodSignature(e)||isFunctionDeclaration(e)||isParameter(e)||isTypeParameterDeclaration(e)||isExpressionWithTypeArguments(e)||isImportEqualsDeclaration(e)||isTypeAliasDeclaration(e)||isConstructorDeclaration(e)||isIndexSignatureDeclaration(e)||isPropertyAccessExpression(e)||isElementAccessExpression(e)||isBinaryExpression(e)||isJSDocTypeAlias(e)}function createGetSymbolAccessibilityDiagnosticForNodeName(e){if(isSetAccessor(e)||isGetAccessor(e)){return getAccessorNameVisibilityError}else if(isMethodSignature(e)||isMethodDeclaration(e)){return getMethodNameVisibilityError}else{return createGetSymbolAccessibilityDiagnosticForNode(e)}function getAccessorNameVisibilityError(t){const n=getAccessorNameVisibilityDiagnosticMessage(t);return n!==void 0?{diagnosticMessage:n,errorNode:e,typeName:e.name}:void 0}function getAccessorNameVisibilityDiagnosticMessage(t){if(isStatic(e)){return t.errorModuleName?t.accessibility===2?wt.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1}else if(e.parent.kind===263){return t.errorModuleName?t.accessibility===2?wt.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Public_property_0_of_exported_class_has_or_is_using_private_name_1}else{return t.errorModuleName?wt.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:wt.Property_0_of_exported_interface_has_or_is_using_private_name_1}}function getMethodNameVisibilityError(t){const n=getMethodNameVisibilityDiagnosticMessage(t);return n!==void 0?{diagnosticMessage:n,errorNode:e,typeName:e.name}:void 0}function getMethodNameVisibilityDiagnosticMessage(t){if(isStatic(e)){return t.errorModuleName?t.accessibility===2?wt.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1}else if(e.parent.kind===263){return t.errorModuleName?t.accessibility===2?wt.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Public_method_0_of_exported_class_has_or_is_using_private_name_1}else{return t.errorModuleName?wt.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:wt.Method_0_of_exported_interface_has_or_is_using_private_name_1}}}function createGetSymbolAccessibilityDiagnosticForNode(e){if(isVariableDeclaration(e)||isPropertyDeclaration(e)||isPropertySignature(e)||isPropertyAccessExpression(e)||isElementAccessExpression(e)||isBinaryExpression(e)||isBindingElement(e)||isConstructorDeclaration(e)){return getVariableDeclarationTypeVisibilityError}else if(isSetAccessor(e)||isGetAccessor(e)){return getAccessorDeclarationTypeVisibilityError}else if(isConstructSignatureDeclaration(e)||isCallSignatureDeclaration(e)||isMethodDeclaration(e)||isMethodSignature(e)||isFunctionDeclaration(e)||isIndexSignatureDeclaration(e)){return getReturnTypeVisibilityError}else if(isParameter(e)){if(isParameterPropertyDeclaration(e,e.parent)&&hasSyntacticModifier(e.parent,2)){return getVariableDeclarationTypeVisibilityError}return getParameterDeclarationTypeVisibilityError}else if(isTypeParameterDeclaration(e)){return getTypeParameterConstraintVisibilityError}else if(isExpressionWithTypeArguments(e)){return getHeritageClauseVisibilityError}else if(isImportEqualsDeclaration(e)){return getImportEntityNameVisibilityError}else if(isTypeAliasDeclaration(e)||isJSDocTypeAlias(e)){return getTypeAliasDeclarationVisibilityError}else{return S.assertNever(e,`Attempted to set a declaration diagnostic context for unhandled node kind: ${S.formatSyntaxKind(e.kind)}`)}function getVariableDeclarationTypeVisibilityDiagnosticMessage(t){if(e.kind===260||e.kind===208){return t.errorModuleName?t.accessibility===2?wt.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Exported_variable_0_has_or_is_using_name_1_from_private_module_2:wt.Exported_variable_0_has_or_is_using_private_name_1}else if(e.kind===172||e.kind===211||e.kind===212||e.kind===226||e.kind===171||e.kind===169&&hasSyntacticModifier(e.parent,2)){if(isStatic(e)){return t.errorModuleName?t.accessibility===2?wt.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1}else if(e.parent.kind===263||e.kind===169){return t.errorModuleName?t.accessibility===2?wt.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Public_property_0_of_exported_class_has_or_is_using_private_name_1}else{return t.errorModuleName?wt.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:wt.Property_0_of_exported_interface_has_or_is_using_private_name_1}}}function getVariableDeclarationTypeVisibilityError(t){const n=getVariableDeclarationTypeVisibilityDiagnosticMessage(t);return n!==void 0?{diagnosticMessage:n,errorNode:e,typeName:e.name}:void 0}function getAccessorDeclarationTypeVisibilityError(t){let n;if(e.kind===178){if(isStatic(e)){n=t.errorModuleName?wt.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1}else{n=t.errorModuleName?wt.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1}}else{if(isStatic(e)){n=t.errorModuleName?t.accessibility===2?wt.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1}else{n=t.errorModuleName?t.accessibility===2?wt.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1}}return{diagnosticMessage:n,errorNode:e.name,typeName:e.name}}function getReturnTypeVisibilityError(t){let n;switch(e.kind){case 180:n=t.errorModuleName?wt.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:wt.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 179:n=t.errorModuleName?wt.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:wt.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 181:n=t.errorModuleName?wt.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:wt.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 174:case 173:if(isStatic(e)){n=t.errorModuleName?t.accessibility===2?wt.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:wt.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:wt.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0}else if(e.parent.kind===263){n=t.errorModuleName?t.accessibility===2?wt.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:wt.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:wt.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0}else{n=t.errorModuleName?wt.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:wt.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0}break;case 262:n=t.errorModuleName?t.accessibility===2?wt.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:wt.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:wt.Return_type_of_exported_function_has_or_is_using_private_name_0;break;default:return S.fail("This is unknown kind for signature: "+e.kind)}return{diagnosticMessage:n,errorNode:e.name||e}}function getParameterDeclarationTypeVisibilityError(t){const n=getParameterDeclarationTypeVisibilityDiagnosticMessage(t);return n!==void 0?{diagnosticMessage:n,errorNode:e,typeName:e.name}:void 0}function getParameterDeclarationTypeVisibilityDiagnosticMessage(t){switch(e.parent.kind){case 176:return t.errorModuleName?t.accessibility===2?wt.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;case 180:case 185:return t.errorModuleName?wt.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:wt.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;case 179:return t.errorModuleName?wt.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:wt.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;case 181:return t.errorModuleName?wt.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:wt.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;case 174:case 173:if(isStatic(e.parent)){return t.errorModuleName?t.accessibility===2?wt.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1}else if(e.parent.parent.kind===263){return t.errorModuleName?t.accessibility===2?wt.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:wt.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1}else{return t.errorModuleName?wt.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:wt.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1}case 262:case 184:return t.errorModuleName?t.accessibility===2?wt.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:wt.Parameter_0_of_exported_function_has_or_is_using_private_name_1;case 178:case 177:return t.errorModuleName?t.accessibility===2?wt.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:wt.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:wt.Parameter_0_of_accessor_has_or_is_using_private_name_1;default:return S.fail(`Unknown parent for parameter: ${S.formatSyntaxKind(e.parent.kind)}`)}}function getTypeParameterConstraintVisibilityError(){let t;switch(e.parent.kind){case 263:t=wt.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;break;case 264:t=wt.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;break;case 200:t=wt.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;break;case 185:case 180:t=wt.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 179:t=wt.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 174:case 173:if(isStatic(e.parent)){t=wt.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1}else if(e.parent.parent.kind===263){t=wt.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1}else{t=wt.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1}break;case 184:case 262:t=wt.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;break;case 195:t=wt.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;break;case 265:t=wt.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;break;default:return S.fail("This is unknown parent for type parameter: "+e.parent.kind)}return{diagnosticMessage:t,errorNode:e,typeName:e.name}}function getHeritageClauseVisibilityError(){let t;if(isClassDeclaration(e.parent.parent)){t=isHeritageClause(e.parent)&&e.parent.token===119?wt.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:e.parent.parent.name?wt.extends_clause_of_exported_class_0_has_or_is_using_private_name_1:wt.extends_clause_of_exported_class_has_or_is_using_private_name_0}else{t=wt.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1}return{diagnosticMessage:t,errorNode:e,typeName:getNameOfDeclaration(e.parent.parent)}}function getImportEntityNameVisibilityError(){return{diagnosticMessage:wt.Import_declaration_0_is_using_private_name_1,errorNode:e,typeName:e.name}}function getTypeAliasDeclarationVisibilityError(t){return{diagnosticMessage:t.errorModuleName?wt.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:wt.Exported_type_alias_0_has_or_is_using_private_name_1,errorNode:isJSDocTypeAlias(e)?S.checkDefined(e.typeExpression):e.type,typeName:isJSDocTypeAlias(e)?getNameOfDeclaration(e):e.name}}}function createGetIsolatedDeclarationErrors(e){const t={[219]:wt.Add_a_return_type_to_the_function_expression,[218]:wt.Add_a_return_type_to_the_function_expression,[174]:wt.Add_a_return_type_to_the_method,[177]:wt.Add_a_return_type_to_the_get_accessor_declaration,[178]:wt.Add_a_type_to_parameter_of_the_set_accessor_declaration,[262]:wt.Add_a_return_type_to_the_function_declaration,[180]:wt.Add_a_return_type_to_the_function_declaration,[169]:wt.Add_a_type_annotation_to_the_parameter_0,[260]:wt.Add_a_type_annotation_to_the_variable_0,[172]:wt.Add_a_type_annotation_to_the_property_0,[171]:wt.Add_a_type_annotation_to_the_property_0,[277]:wt.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it};const n={[218]:wt.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,[262]:wt.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,[219]:wt.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,[174]:wt.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,[180]:wt.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,[177]:wt.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations,[178]:wt.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations,[169]:wt.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations,[260]:wt.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations,[172]:wt.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations,[171]:wt.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations,[167]:wt.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations,[305]:wt.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations,[304]:wt.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations,[209]:wt.Only_const_arrays_can_be_inferred_with_isolatedDeclarations,[277]:wt.Default_exports_can_t_be_inferred_with_isolatedDeclarations,[230]:wt.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations};return getDiagnostic2;function getDiagnostic2(e){const t=findAncestor(e,isHeritageClause);if(t){return createDiagnosticForNode(e,wt.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations)}if((isPartOfTypeNode(e)||isTypeQueryNode(e.parent))&&(isEntityName(e)||isEntityNameExpression(e))){return createEntityInTypeNodeError(e)}S.type(e);switch(e.kind){case 177:case 178:return createAccessorTypeError(e);case 167:case 304:case 305:return createObjectLiteralError(e);case 209:case 230:return createArrayLiteralError(e);case 174:case 180:case 218:case 219:case 262:return createReturnTypeError(e);case 208:return createBindingElementError(e);case 172:case 260:return createVariableOrPropertyError(e);case 169:return createParameterError(e);case 303:return createExpressionError(e.initializer);case 231:return createClassExpressionError(e);default:assertType(e);return createExpressionError(e)}}function findNearestDeclaration(e){const t=findAncestor(e,(e=>isExportAssignment(e)||isStatement(e)||isVariableDeclaration(e)||isPropertyDeclaration(e)||isParameter(e)));if(!t)return void 0;if(isExportAssignment(t))return t;if(isReturnStatement(t)){return findAncestor(t,(e=>isFunctionLikeDeclaration(e)&&!isConstructorDeclaration(e)))}return isStatement(t)?void 0:t}function createAccessorTypeError(e){const{getAccessor:r,setAccessor:i}=getAllAccessorDeclarations(e.symbol.declarations,e);const o=(isSetAccessor(e)?e.parameters[0]:e)??e;const a=createDiagnosticForNode(o,n[e.kind]);if(i){addRelatedInfo(a,createDiagnosticForNode(i,t[i.kind]))}if(r){addRelatedInfo(a,createDiagnosticForNode(r,t[r.kind]))}return a}function addParentDeclarationRelatedInfo(e,n){const r=findNearestDeclaration(e);if(r){const e=isExportAssignment(r)||!r.name?"":getTextOfNode(r.name,false);addRelatedInfo(n,createDiagnosticForNode(r,t[r.kind],e))}return n}function createObjectLiteralError(e){const t=createDiagnosticForNode(e,n[e.kind]);addParentDeclarationRelatedInfo(e,t);return t}function createArrayLiteralError(e){const t=createDiagnosticForNode(e,n[e.kind]);addParentDeclarationRelatedInfo(e,t);return t}function createReturnTypeError(e){const r=createDiagnosticForNode(e,n[e.kind]);addParentDeclarationRelatedInfo(e,r);addRelatedInfo(r,createDiagnosticForNode(e,t[e.kind]));return r}function createBindingElementError(e){return createDiagnosticForNode(e,wt.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations)}function createVariableOrPropertyError(e){const r=createDiagnosticForNode(e,n[e.kind]);const i=getTextOfNode(e.name,false);addRelatedInfo(r,createDiagnosticForNode(e,t[e.kind],i));return r}function createParameterError(r){if(isSetAccessor(r.parent)){return createAccessorTypeError(r.parent)}const i=e.requiresAddingImplicitUndefined(r,r.parent);if(!i&&r.initializer){return createExpressionError(r.initializer)}const o=i?wt.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations:n[r.kind];const a=createDiagnosticForNode(r,o);const s=getTextOfNode(r.name,false);addRelatedInfo(a,createDiagnosticForNode(r,t[r.kind],s));return a}function createClassExpressionError(e){return createExpressionError(e,wt.Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations)}function createEntityInTypeNodeError(e){const t=createDiagnosticForNode(e,wt.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations,getTextOfNode(e,false));addParentDeclarationRelatedInfo(e,t);return t}function createExpressionError(e,r){const i=findNearestDeclaration(e);let o;if(i){const a=isExportAssignment(i)||!i.name?"":getTextOfNode(i.name,false);const s=findAncestor(e.parent,(e=>isExportAssignment(e)||(isStatement(e)?"quit":!isParenthesizedExpression(e)&&!isTypeAssertionExpression(e)&&!isAsExpression(e))));if(i===s){o=createDiagnosticForNode(e,r??n[i.kind]);addRelatedInfo(o,createDiagnosticForNode(i,t[i.kind],a))}else{o=createDiagnosticForNode(e,r??wt.Expression_type_can_t_be_inferred_with_isolatedDeclarations);addRelatedInfo(o,createDiagnosticForNode(i,t[i.kind],a));addRelatedInfo(o,createDiagnosticForNode(e,wt.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit))}}else{o=createDiagnosticForNode(e,r??wt.Expression_type_can_t_be_inferred_with_isolatedDeclarations)}return o}}function getDeclarationDiagnostics(e,t,n){const r=e.getCompilerOptions();const i=filter(getSourceFilesToEmit(e,n),isSourceFileNotJson);return contains(i,n)?transformNodes(t,e,zr,r,[n],[transformDeclarations],false).diagnostics:void 0}var Ca=1024|2048|4096|8|524288|4|1;var Ea=8;function transformDeclarations(e){const throwDiagnostic=()=>S.fail("Diagnostic emitted without context");let t=throwDiagnostic;let n=true;let r=false;let i=false;let o=false;let a=false;let s;let c;let l;let p;const{factory:u}=e;const f=e.getEmitHost();let restoreFallbackNode=()=>void 0;const m={trackSymbol:trackSymbol,reportInaccessibleThisError:reportInaccessibleThisError,reportInaccessibleUniqueSymbolError:reportInaccessibleUniqueSymbolError,reportCyclicStructureError:reportCyclicStructureError,reportPrivateInBaseOfClassExpression:reportPrivateInBaseOfClassExpression,reportLikelyUnsafeImportRequiredError:reportLikelyUnsafeImportRequiredError,reportTruncationError:reportTruncationError,moduleResolverHost:f,reportNonlocalAugmentation:reportNonlocalAugmentation,reportNonSerializableProperty:reportNonSerializableProperty,reportInferenceFallback:reportInferenceFallback,pushErrorFallbackNode(e){const t=g;const n=restoreFallbackNode;restoreFallbackNode=()=>{restoreFallbackNode=n;g=t};g=e},popErrorFallbackNode(){restoreFallbackNode()}};let _;let g;let y;let h;let T;let v;const x=e.getEmitResolver();const b=e.getCompilerOptions();const C=createGetIsolatedDeclarationErrors(x);const{stripInternal:E,isolatedDeclarations:N}=b;return transformRoot;function reportExpandoFunctionErrors(t){x.getPropertiesOfContainerFunction(t).forEach((t=>{if(isExpandoPropertyDeclaration(t.valueDeclaration)){const n=isBinaryExpression(t.valueDeclaration)?t.valueDeclaration.left:t.valueDeclaration;e.addDiagnostic(createDiagnosticForNode(n,wt.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function))}}))}function reportInferenceFallback(t){if(!N||isSourceFileJS(y))return;if(getSourceFileOfNode(t)!==y)return;if(isVariableDeclaration(t)&&x.isExpandoFunctionDeclaration(t)){reportExpandoFunctionErrors(t)}else{e.addDiagnostic(C(t))}}function handleSymbolAccessibilityError(n){if(n.accessibility===0){if(n.aliasesToMakeVisible){if(!c){c=n.aliasesToMakeVisible}else{for(const e of n.aliasesToMakeVisible){pushIfUnique(c,e)}}}}else if(n.accessibility!==3){const r=t(n);if(r){if(r.typeName){e.addDiagnostic(createDiagnosticForNode(n.errorNode||r.errorNode,r.diagnosticMessage,getTextOfNode(r.typeName),n.errorSymbolName,n.errorModuleName))}else{e.addDiagnostic(createDiagnosticForNode(n.errorNode||r.errorNode,r.diagnosticMessage,n.errorSymbolName,n.errorModuleName))}return true}}return false}function trackSymbol(e,t,n){if(e.flags&262144)return false;const r=handleSymbolAccessibilityError(x.isSymbolAccessible(e,t,n,true));return r}function reportPrivateInBaseOfClassExpression(t){if(_||g){e.addDiagnostic(addRelatedInfo(createDiagnosticForNode(_||g,wt.Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected,t),...isVariableDeclaration((_||g).parent)?[createDiagnosticForNode(_||g,wt.Add_a_type_annotation_to_the_variable_0,errorDeclarationNameWithFallback())]:[]))}}function errorDeclarationNameWithFallback(){return _?declarationNameToString(_):g&&getNameOfDeclaration(g)?declarationNameToString(getNameOfDeclaration(g)):g&&isExportAssignment(g)?g.isExportEquals?"export=":"default":"(Missing)"}function reportInaccessibleUniqueSymbolError(){if(_||g){e.addDiagnostic(createDiagnosticForNode(_||g,wt.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,errorDeclarationNameWithFallback(),"unique symbol"))}}function reportCyclicStructureError(){if(_||g){e.addDiagnostic(createDiagnosticForNode(_||g,wt.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary,errorDeclarationNameWithFallback()))}}function reportInaccessibleThisError(){if(_||g){e.addDiagnostic(createDiagnosticForNode(_||g,wt.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,errorDeclarationNameWithFallback(),"this"))}}function reportLikelyUnsafeImportRequiredError(t){if(_||g){e.addDiagnostic(createDiagnosticForNode(_||g,wt.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary,errorDeclarationNameWithFallback(),t))}}function reportTruncationError(){if(_||g){e.addDiagnostic(createDiagnosticForNode(_||g,wt.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed))}}function reportNonlocalAugmentation(t,n,r){var i;const o=(i=n.declarations)==null?void 0:i.find((e=>getSourceFileOfNode(e)===t));const a=filter(r.declarations,(e=>getSourceFileOfNode(e)!==t));if(o&&a){for(const t of a){e.addDiagnostic(addRelatedInfo(createDiagnosticForNode(t,wt.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized),createDiagnosticForNode(o,wt.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)))}}}function reportNonSerializableProperty(t){if(_||g){e.addDiagnostic(createDiagnosticForNode(_||g,wt.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized,t))}}function transformDeclarationsForJS(e){const n=t;t=t=>t.errorNode&&canProduceDiagnostics(t.errorNode)?createGetSymbolAccessibilityDiagnosticForNode(t.errorNode)(t):{diagnosticMessage:t.errorModuleName?wt.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:wt.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit,errorNode:t.errorNode||e};const r=x.getDeclarationStatementsForSourceFile(e,Ca,Ea,m);t=n;return r}function transformRoot(d){if(d.kind===307&&d.isDeclarationFile){return d}if(d.kind===308){r=true;h=[];T=[];v=[];let m=false;const _=u.createBundle(map(d.sourceFiles,(r=>{if(r.isDeclarationFile)return void 0;m=m||r.hasNoDefaultLib;y=r;s=r;c=void 0;p=false;l=new Map;t=throwDiagnostic;o=false;a=false;collectFileReferences(r);if(isExternalOrCommonJsModule(r)||isJsonSourceFile(r)){i=false;n=false;const t=isSourceFileJS(r)?u.createNodeArray(transformDeclarationsForJS(r)):visitNodes2(r.statements,visitDeclarationStatements,isStatement);const o=u.updateSourceFile(r,[u.createModuleDeclaration([u.createModifier(138)],u.createStringLiteral(getResolvedExternalModuleName(e.getEmitHost(),r)),u.createModuleBlock(setTextRange(u.createNodeArray(transformAndReplaceLatePaintedStatements(t)),r.statements)))],true,[],[],false,[]);return o}n=true;const d=isSourceFileJS(r)?u.createNodeArray(transformDeclarationsForJS(r)):visitNodes2(r.statements,visitDeclarationStatements,isStatement);return u.updateSourceFile(r,transformAndReplaceLatePaintedStatements(d),true,[],[],false,[])})));const g=getDirectoryPath(normalizeSlashes(getOutputPathsFor(d,f,true).declarationFilePath));_.syntheticFileReferences=getReferencedFiles(g);_.syntheticTypeReferences=getTypeReferences();_.syntheticLibReferences=getLibReferences();_.hasNoDefaultLib=m;return _}n=true;o=false;a=false;s=d;y=d;t=throwDiagnostic;r=false;i=false;p=false;c=void 0;l=new Map;h=[];T=[];v=[];collectFileReferences(y);let m;if(isSourceFileJS(y)){m=u.createNodeArray(transformDeclarationsForJS(d))}else{const e=visitNodes2(d.statements,visitDeclarationStatements,isStatement);m=setTextRange(u.createNodeArray(transformAndReplaceLatePaintedStatements(e)),d.statements);if(isExternalModule(d)&&(!i||o&&!a)){m=setTextRange(u.createNodeArray([...m,createEmptyExports(u)]),m)}}const _=getDirectoryPath(normalizeSlashes(getOutputPathsFor(d,f,true).declarationFilePath));return u.updateSourceFile(d,m,true,getReferencedFiles(_),getTypeReferences(),d.hasNoDefaultLib,getLibReferences());function collectFileReferences(e){h=concatenate(h,map(e.referencedFiles,(t=>[e,t])));T=concatenate(T,e.typeReferenceDirectives);v=concatenate(v,e.libReferenceDirectives)}function copyFileReferenceAsSynthetic(e){const t={...e};t.pos=-1;t.end=-1;return t}function getTypeReferences(){return mapDefined(T,(e=>{if(!e.preserve)return void 0;return copyFileReferenceAsSynthetic(e)}))}function getLibReferences(){return mapDefined(v,(e=>{if(!e.preserve)return void 0;return copyFileReferenceAsSynthetic(e)}))}function getReferencedFiles(e){return mapDefined(h,(([t,n])=>{if(!n.preserve)return void 0;const i=f.getSourceFileFromReference(t,n);if(!i){return void 0}let o;if(i.isDeclarationFile){o=i.fileName}else{if(r&&contains(d.sourceFiles,i))return;const e=getOutputPathsFor(i,f,true);o=e.declarationFilePath||e.jsFilePath||i.fileName}if(!o)return void 0;const a=getRelativePathToDirectoryOrUrl(e,o,f.getCurrentDirectory(),f.getCanonicalFileName,false);const s=copyFileReferenceAsSynthetic(n);s.fileName=a;return s}))}}function filterBindingPatternInitializers(e){if(e.kind===80){return e}else{if(e.kind===207){return u.updateArrayBindingPattern(e,visitNodes2(e.elements,visitBindingElement,isArrayBindingElement))}else{return u.updateObjectBindingPattern(e,visitNodes2(e.elements,visitBindingElement,isBindingElement))}}function visitBindingElement(e){if(e.kind===232){return e}if(e.propertyName&&isComputedPropertyName(e.propertyName)&&isEntityNameExpression(e.propertyName.expression)){checkEntityNameVisibility(e.propertyName.expression,s)}return u.updateBindingElement(e,e.dotDotDotToken,e.propertyName,filterBindingPatternInitializers(e.name),void 0)}}function ensureParameter(e,n){let r;if(!p){r=t;t=createGetSymbolAccessibilityDiagnosticForNode(e)}const i=u.updateParameterDeclaration(e,maskModifiers(u,e,n),e.dotDotDotToken,filterBindingPatternInitializers(e.name),x.isOptionalParameter(e)?e.questionToken||u.createToken(58):void 0,ensureType(e,true),ensureNoInitializer(e));if(!p){t=r}return i}function shouldPrintWithInitializer(e){return canHaveLiteralInitializer(e)&&!!e.initializer&&x.isLiteralConstDeclaration(getParseTreeNode(e))}function ensureNoInitializer(e){if(shouldPrintWithInitializer(e)){const t=unwrapParenthesizedExpression(e.initializer);if(!isPrimitiveLiteralValue(t)){reportInferenceFallback(e)}return x.createLiteralConstValue(getParseTreeNode(e,canHaveLiteralInitializer),m)}return void 0}function ensureType(e,n){if(!n&&hasEffectiveModifier(e,2)){return}if(shouldPrintWithInitializer(e)){return}if(!isExportAssignment(e)&&!isBindingElement(e)&&e.type&&(!isParameter(e)||!x.requiresAddingImplicitUndefined(e,s))){return visitNode(e.type,visitDeclarationSubtree,isTypeNode)}const r=_;_=e.name;let i;if(!p){i=t;if(canProduceDiagnostics(e)){t=createGetSymbolAccessibilityDiagnosticForNode(e)}}let o;if(hasInferredType(e)){o=x.createTypeOfDeclaration(e,s,Ca,Ea,m)}else if(isFunctionLike(e)){o=x.createReturnTypeOfSignatureDeclaration(e,s,Ca,Ea,m)}else{S.assertNever(e)}_=r;if(!p){t=i}return o??u.createKeywordTypeNode(133)}function isDeclarationAndNotVisible(e){e=getParseTreeNode(e);switch(e.kind){case 262:case 267:case 264:case 263:case 265:case 266:return!x.isDeclarationVisible(e);case 260:return!getBindingNameVisible(e);case 271:case 272:case 278:case 277:return false;case 175:return true}return false}function shouldEmitFunctionProperties(e){var t;if(e.body){return true}const n=(t=e.symbol.declarations)==null?void 0:t.filter((e=>isFunctionDeclaration(e)&&!e.body));return!n||n.indexOf(e)===n.length-1}function getBindingNameVisible(e){if(isOmittedExpression(e)){return false}if(isBindingPattern(e.name)){return some(e.name.elements,getBindingNameVisible)}else{return x.isDeclarationVisible(e)}}function updateParamsList(e,t,n){if(hasEffectiveModifier(e,2)){return u.createNodeArray()}const r=map(t,(e=>ensureParameter(e,n)));if(!r){return u.createNodeArray()}return u.createNodeArray(r,t.hasTrailingComma)}function updateAccessorParamsList(e,t){let n;if(!t){const t=getThisParameter(e);if(t){n=[ensureParameter(t)]}}if(isSetAccessorDeclaration(e)){let r;if(!t){const t=getSetAccessorValueParameter(e);if(t){r=ensureParameter(t)}}if(!r){r=u.createParameterDeclaration(void 0,void 0,"value")}n=append(n,r)}return u.createNodeArray(n||d)}function ensureTypeParams(e,t){return hasEffectiveModifier(e,2)?void 0:visitNodes2(t,visitDeclarationSubtree,isTypeParameterDeclaration)}function isEnclosingDeclaration(e){return isSourceFile(e)||isTypeAliasDeclaration(e)||isModuleDeclaration(e)||isClassDeclaration(e)||isInterfaceDeclaration(e)||isFunctionLike(e)||isIndexSignatureDeclaration(e)||isMappedTypeNode(e)}function checkEntityNameVisibility(e,t){const n=x.isEntityNameVisible(e,t);handleSymbolAccessibilityError(n)}function preserveJsDoc(e,t){if(hasJSDocNodes(e)&&hasJSDocNodes(t)){e.jsDoc=t.jsDoc}return setCommentRange(e,getCommentRange(t))}function rewriteModuleSpecifier2(t,n){if(!n)return void 0;i=i||t.kind!==267&&t.kind!==205;if(isStringLiteralLike(n)){if(r){const n=getExternalModuleNameFromDeclaration(e.getEmitHost(),x,t);if(n){return u.createStringLiteral(n)}}}return n}function transformImportEqualsDeclaration(e){if(!x.isDeclarationVisible(e))return;if(e.moduleReference.kind===283){const t=getExternalModuleImportEqualsDeclarationExpression(e);return u.updateImportEqualsDeclaration(e,e.modifiers,e.isTypeOnly,e.name,u.updateExternalModuleReference(e.moduleReference,rewriteModuleSpecifier2(e,t)))}else{const n=t;t=createGetSymbolAccessibilityDiagnosticForNode(e);checkEntityNameVisibility(e.moduleReference,s);t=n;return e}}function transformImportDeclaration(t){if(!t.importClause){return u.updateImportDeclaration(t,t.modifiers,t.importClause,rewriteModuleSpecifier2(t,t.moduleSpecifier),tryGetResolutionModeOverride(t.attributes))}const n=t.importClause&&t.importClause.name&&x.isDeclarationVisible(t.importClause)?t.importClause.name:void 0;if(!t.importClause.namedBindings){return n&&u.updateImportDeclaration(t,t.modifiers,u.updateImportClause(t.importClause,t.importClause.isTypeOnly,n,void 0),rewriteModuleSpecifier2(t,t.moduleSpecifier),tryGetResolutionModeOverride(t.attributes))}if(t.importClause.namedBindings.kind===274){const e=x.isDeclarationVisible(t.importClause.namedBindings)?t.importClause.namedBindings:void 0;return n||e?u.updateImportDeclaration(t,t.modifiers,u.updateImportClause(t.importClause,t.importClause.isTypeOnly,n,e),rewriteModuleSpecifier2(t,t.moduleSpecifier),tryGetResolutionModeOverride(t.attributes)):void 0}const r=mapDefined(t.importClause.namedBindings.elements,(e=>x.isDeclarationVisible(e)?e:void 0));if(r&&r.length||n){return u.updateImportDeclaration(t,t.modifiers,u.updateImportClause(t.importClause,t.importClause.isTypeOnly,n,r&&r.length?u.updateNamedImports(t.importClause.namedBindings,r):void 0),rewriteModuleSpecifier2(t,t.moduleSpecifier),tryGetResolutionModeOverride(t.attributes))}if(x.isImportRequiredByAugmentation(t)){if(N){e.addDiagnostic(createDiagnosticForNode(t,wt.Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations))}return u.updateImportDeclaration(t,t.modifiers,void 0,rewriteModuleSpecifier2(t,t.moduleSpecifier),tryGetResolutionModeOverride(t.attributes))}}function tryGetResolutionModeOverride(e){const t=getResolutionModeOverride(e);return e&&t!==void 0?e:void 0}function transformAndReplaceLatePaintedStatements(e){while(length(c)){const e=c.shift();if(!isLateVisibilityPaintedStatement(e)){return S.fail(`Late replaced statement was found which is not handled by the declaration transformer!: ${S.formatSyntaxKind(e.kind)}`)}const t=n;n=e.parent&&isSourceFile(e.parent)&&!(isExternalModule(e.parent)&&r);const i=transformTopLevelDeclaration(e);n=t;l.set(getOriginalNodeId(e),i)}return visitNodes2(e,visitLateVisibilityMarkedStatements,isStatement);function visitLateVisibilityMarkedStatements(e){if(isLateVisibilityPaintedStatement(e)){const t=getOriginalNodeId(e);if(l.has(t)){const n=l.get(t);l.delete(t);if(n){if(isArray(n)?some(n,needsScopeMarker):needsScopeMarker(n)){o=true}if(isSourceFile(e.parent)&&(isArray(n)?some(n,isExternalModuleIndicator):isExternalModuleIndicator(n))){i=true}}return n}}return e}}function visitDeclarationSubtree(n){if(shouldStripInternal(n))return;if(isDeclaration(n)){if(isDeclarationAndNotVisible(n))return;if(hasDynamicName(n)){if(N){if(!x.isDefinitelyReferenceToGlobalSymbolObject(n.name.expression)){if(isClassDeclaration(n.parent)||isObjectLiteralExpression(n.parent)){e.addDiagnostic(createDiagnosticForNode(n,wt.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));return}else if((isInterfaceDeclaration(n.parent)||isTypeLiteralNode(n.parent))&&!isEntityNameExpression(n.name.expression)){e.addDiagnostic(createDiagnosticForNode(n,wt.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations));return}}}else if(!x.isLateBound(getParseTreeNode(n))||!isEntityNameExpression(n.name.expression)){return}}}if(isFunctionLike(n)&&x.isImplementationOfOverload(n))return;if(isSemicolonClassElement(n))return;let r;if(isEnclosingDeclaration(n)){r=s;s=n}const i=t;const o=canProduceDiagnostics(n);const a=p;let c=(n.kind===187||n.kind===200)&&n.parent.kind!==265;if(isMethodDeclaration(n)||isMethodSignature(n)){if(hasEffectiveModifier(n,2)){if(n.symbol&&n.symbol.declarations&&n.symbol.declarations[0]!==n)return;return cleanup(u.createPropertyDeclaration(ensureModifiers(n),n.name,void 0,void 0,void 0))}}if(o&&!p){t=createGetSymbolAccessibilityDiagnosticForNode(n)}if(isTypeQueryNode(n)){checkEntityNameVisibility(n.exprName,s)}if(c){p=true}if(isProcessedComponent(n)){switch(n.kind){case 233:{if(isEntityName(n.expression)||isEntityNameExpression(n.expression)){checkEntityNameVisibility(n.expression,s)}const t=visitEachChild(n,visitDeclarationSubtree,e);return cleanup(u.updateExpressionWithTypeArguments(t,t.expression,t.typeArguments))}case 183:{checkEntityNameVisibility(n.typeName,s);const t=visitEachChild(n,visitDeclarationSubtree,e);return cleanup(u.updateTypeReferenceNode(t,t.typeName,t.typeArguments))}case 180:return cleanup(u.updateConstructSignature(n,ensureTypeParams(n,n.typeParameters),updateParamsList(n,n.parameters),ensureType(n)));case 176:{const e=u.createConstructorDeclaration(ensureModifiers(n),updateParamsList(n,n.parameters,0),void 0);return cleanup(e)}case 174:{if(isPrivateIdentifier(n.name)){return cleanup(void 0)}const e=u.createMethodDeclaration(ensureModifiers(n),void 0,n.name,n.questionToken,ensureTypeParams(n,n.typeParameters),updateParamsList(n,n.parameters),ensureType(n),void 0);return cleanup(e)}case 177:{if(isPrivateIdentifier(n.name)){return cleanup(void 0)}return cleanup(u.updateGetAccessorDeclaration(n,ensureModifiers(n),n.name,updateAccessorParamsList(n,hasEffectiveModifier(n,2)),ensureType(n),void 0))}case 178:{if(isPrivateIdentifier(n.name)){return cleanup(void 0)}return cleanup(u.updateSetAccessorDeclaration(n,ensureModifiers(n),n.name,updateAccessorParamsList(n,hasEffectiveModifier(n,2)),void 0))}case 172:if(isPrivateIdentifier(n.name)){return cleanup(void 0)}return cleanup(u.updatePropertyDeclaration(n,ensureModifiers(n),n.name,n.questionToken,ensureType(n),ensureNoInitializer(n)));case 171:if(isPrivateIdentifier(n.name)){return cleanup(void 0)}return cleanup(u.updatePropertySignature(n,ensureModifiers(n),n.name,n.questionToken,ensureType(n)));case 173:{if(isPrivateIdentifier(n.name)){return cleanup(void 0)}return cleanup(u.updateMethodSignature(n,ensureModifiers(n),n.name,n.questionToken,ensureTypeParams(n,n.typeParameters),updateParamsList(n,n.parameters),ensureType(n)))}case 179:{return cleanup(u.updateCallSignature(n,ensureTypeParams(n,n.typeParameters),updateParamsList(n,n.parameters),ensureType(n)))}case 181:{return cleanup(u.updateIndexSignature(n,ensureModifiers(n),updateParamsList(n,n.parameters),visitNode(n.type,visitDeclarationSubtree,isTypeNode)||u.createKeywordTypeNode(133)))}case 260:{if(isBindingPattern(n.name)){return recreateBindingPattern(n.name)}c=true;p=true;return cleanup(u.updateVariableDeclaration(n,n.name,void 0,ensureType(n),ensureNoInitializer(n)))}case 168:{if(isPrivateMethodTypeParameter(n)&&(n.default||n.constraint)){return cleanup(u.updateTypeParameterDeclaration(n,n.modifiers,n.name,void 0,void 0))}return cleanup(visitEachChild(n,visitDeclarationSubtree,e))}case 194:{const e=visitNode(n.checkType,visitDeclarationSubtree,isTypeNode);const t=visitNode(n.extendsType,visitDeclarationSubtree,isTypeNode);const r=s;s=n.trueType;const i=visitNode(n.trueType,visitDeclarationSubtree,isTypeNode);s=r;const o=visitNode(n.falseType,visitDeclarationSubtree,isTypeNode);S.assert(e);S.assert(t);S.assert(i);S.assert(o);return cleanup(u.updateConditionalTypeNode(n,e,t,i,o))}case 184:{return cleanup(u.updateFunctionTypeNode(n,visitNodes2(n.typeParameters,visitDeclarationSubtree,isTypeParameterDeclaration),updateParamsList(n,n.parameters),S.checkDefined(visitNode(n.type,visitDeclarationSubtree,isTypeNode))))}case 185:{return cleanup(u.updateConstructorTypeNode(n,ensureModifiers(n),visitNodes2(n.typeParameters,visitDeclarationSubtree,isTypeParameterDeclaration),updateParamsList(n,n.parameters),S.checkDefined(visitNode(n.type,visitDeclarationSubtree,isTypeNode))))}case 205:{if(!isLiteralImportTypeNode(n))return cleanup(n);return cleanup(u.updateImportTypeNode(n,u.updateLiteralTypeNode(n.argument,rewriteModuleSpecifier2(n,n.argument.literal)),n.attributes,n.qualifier,visitNodes2(n.typeArguments,visitDeclarationSubtree,isTypeNode),n.isTypeOf))}default:S.assertNever(n,`Attempted to process unhandled node kind: ${S.formatSyntaxKind(n.kind)}`)}}if(isTupleTypeNode(n)&&getLineAndCharacterOfPosition(y,n.pos).line===getLineAndCharacterOfPosition(y,n.end).line){setEmitFlags(n,1)}return cleanup(visitEachChild(n,visitDeclarationSubtree,e));function cleanup(e){if(e&&o&&hasDynamicName(n)){checkName(n)}if(isEnclosingDeclaration(n)){s=r}if(o&&!p){t=i}if(c){p=a}if(e===n){return e}return e&&setOriginalNode(preserveJsDoc(e,n),n)}}function isPrivateMethodTypeParameter(e){return e.parent.kind===174&&hasEffectiveModifier(e.parent,2)}function visitDeclarationStatements(e){if(!isPreservedDeclarationStatement(e)){return}if(shouldStripInternal(e))return;switch(e.kind){case 278:{if(isSourceFile(e.parent)){i=true}a=true;return u.updateExportDeclaration(e,e.modifiers,e.isTypeOnly,e.exportClause,rewriteModuleSpecifier2(e,e.moduleSpecifier),tryGetResolutionModeOverride(e.attributes))}case 277:{if(isSourceFile(e.parent)){i=true}a=true;if(e.expression.kind===80){return e}else{const r=u.createUniqueName("_default",16);t=()=>({diagnosticMessage:wt.Default_export_of_the_module_has_or_is_using_private_name_0,errorNode:e});g=e;const i=ensureType(e);const o=u.createVariableDeclaration(r,void 0,i,void 0);g=void 0;const a=u.createVariableStatement(n?[u.createModifier(138)]:[],u.createVariableDeclarationList([o],2));preserveJsDoc(a,e);removeAllComments(e);return[a,u.updateExportAssignment(e,e.modifiers,r)]}}}const r=transformTopLevelDeclaration(e);l.set(getOriginalNodeId(e),r);return e}function stripExportModifiers(e){if(isImportEqualsDeclaration(e)||hasEffectiveModifier(e,2048)||!canHaveModifiers(e)){return e}const t=u.createModifiersFromModifierFlags(getEffectiveModifierFlags(e)&(131071^32));return u.replaceModifiers(e,t)}function updateModuleDeclarationAndKeyword(e,t,n,r){const i=u.updateModuleDeclaration(e,t,n,r);if(isAmbientModule(i)||i.flags&32){return i}const o=u.createModuleDeclaration(i.modifiers,i.name,i.body,i.flags|32);setOriginalNode(o,i);setTextRange(o,i);return o}function transformTopLevelDeclaration(r){if(c){while(orderedRemoveItem(c,r));}if(shouldStripInternal(r))return;switch(r.kind){case 271:{return transformImportEqualsDeclaration(r)}case 272:{return transformImportDeclaration(r)}}if(isDeclaration(r)&&isDeclarationAndNotVisible(r))return;if(isJSDocImportTag(r))return;if(isFunctionLike(r)&&x.isImplementationOfOverload(r))return;let d;if(isEnclosingDeclaration(r)){d=s;s=r}const p=canProduceDiagnostics(r);const f=t;if(p){t=createGetSymbolAccessibilityDiagnosticForNode(r)}const y=n;switch(r.kind){case 265:{n=false;const e=cleanup(u.updateTypeAliasDeclaration(r,ensureModifiers(r),r.name,visitNodes2(r.typeParameters,visitDeclarationSubtree,isTypeParameterDeclaration),S.checkDefined(visitNode(r.type,visitDeclarationSubtree,isTypeNode))));n=y;return e}case 264:{return cleanup(u.updateInterfaceDeclaration(r,ensureModifiers(r),r.name,ensureTypeParams(r,r.typeParameters),transformHeritageClauses(r.heritageClauses),visitNodes2(r.members,visitDeclarationSubtree,isTypeElement)))}case 262:{const e=cleanup(u.updateFunctionDeclaration(r,ensureModifiers(r),void 0,r.name,ensureTypeParams(r,r.typeParameters),updateParamsList(r,r.parameters),ensureType(r),void 0));if(e&&x.isExpandoFunctionDeclaration(r)&&shouldEmitFunctionProperties(r)){const n=x.getPropertiesOfContainerFunction(r);if(N){reportExpandoFunctionErrors(r)}const o=wi.createModuleDeclaration(void 0,e.name||u.createIdentifier("_default"),u.createModuleBlock([]),32);setParent(o,s);o.locals=createSymbolTable(n);o.symbol=n[0].parent;const c=[];let l=mapDefined(n,(e=>{if(!isExpandoPropertyDeclaration(e.valueDeclaration)){return void 0}const n=unescapeLeadingUnderscores(e.escapedName);if(!isIdentifierText(n,99)){return void 0}t=createGetSymbolAccessibilityDiagnosticForNode(e.valueDeclaration);const r=x.createTypeOfDeclaration(e.valueDeclaration,o,Ca,Ea|2,m);t=f;const i=isStringANonContextualKeyword(n);const a=i?u.getGeneratedNameForNode(e.valueDeclaration):u.createIdentifier(n);if(i){c.push([a,n])}const s=u.createVariableDeclaration(a,void 0,r,void 0);return u.createVariableStatement(i?void 0:[u.createToken(95)],u.createVariableDeclarationList([s]))}));if(!c.length){l=mapDefined(l,(e=>u.replaceModifiers(e,0)))}else{l.push(u.createExportDeclaration(void 0,false,u.createNamedExports(map(c,(([e,t])=>u.createExportSpecifier(false,e,t))))))}const d=u.createModuleDeclaration(ensureModifiers(r),r.name,u.createModuleBlock(l),32);if(!hasEffectiveModifier(e,2048)){return[e,d]}const p=u.createModifiersFromModifierFlags(getEffectiveModifierFlags(e)&~2080|128);const _=u.updateFunctionDeclaration(e,p,void 0,e.name,e.typeParameters,e.parameters,e.type,void 0);const g=u.updateModuleDeclaration(d,p,d.name,d.body);const y=u.createExportAssignment(void 0,false,d.name);if(isSourceFile(r.parent)){i=true}a=true;return[_,g,y]}else{return e}}case 267:{n=false;const e=r.body;if(e&&e.kind===268){const t=o;const i=a;a=false;o=false;const s=visitNodes2(e.statements,visitDeclarationStatements,isStatement);let c=transformAndReplaceLatePaintedStatements(s);if(r.flags&33554432){o=false}if(!isGlobalScopeAugmentation(r)&&!hasScopeMarker2(c)&&!a){if(o){c=u.createNodeArray([...c,createEmptyExports(u)])}else{c=visitNodes2(c,stripExportModifiers,isStatement)}}const l=u.updateModuleBlock(e,c);n=y;o=t;a=i;const d=ensureModifiers(r);return cleanup(updateModuleDeclarationAndKeyword(r,d,isExternalModuleAugmentation(r)?rewriteModuleSpecifier2(r,r.name):r.name,l))}else{n=y;const t=ensureModifiers(r);n=false;visitNode(e,visitDeclarationStatements);const i=getOriginalNodeId(e);const o=l.get(i);l.delete(i);return cleanup(updateModuleDeclarationAndKeyword(r,t,r.name,o))}}case 263:{_=r.name;g=r;const e=u.createNodeArray(ensureModifiers(r));const i=ensureTypeParams(r,r.typeParameters);const o=getFirstConstructorWithBody(r);let a;if(o){const e=t;a=compact(flatMap(o.parameters,(e=>{if(!hasSyntacticModifier(e,31)||shouldStripInternal(e))return;t=createGetSymbolAccessibilityDiagnosticForNode(e);if(e.name.kind===80){return preserveJsDoc(u.createPropertyDeclaration(ensureModifiers(e),e.name,e.questionToken,ensureType(e),ensureNoInitializer(e)),e)}else{return walkBindingPattern(e.name)}function walkBindingPattern(t){let n;for(const r of t.elements){if(isOmittedExpression(r))continue;if(isBindingPattern(r.name)){n=concatenate(n,walkBindingPattern(r.name))}n=n||[];n.push(u.createPropertyDeclaration(ensureModifiers(e),r.name,void 0,ensureType(r),void 0))}return n}})));t=e}const c=some(r.members,(e=>!!e.name&&isPrivateIdentifier(e.name)));const l=c?[u.createPropertyDeclaration(void 0,u.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:void 0;const d=x.createLateBoundIndexSignatures(r,s,Ca,Ea,m);const p=concatenate(concatenate(concatenate(l,d),a),visitNodes2(r.members,visitDeclarationSubtree,isClassElement));const f=u.createNodeArray(p);const y=getEffectiveBaseTypeNode(r);if(y&&!isEntityNameExpression(y.expression)&&y.expression.kind!==106){const o=r.name?unescapeLeadingUnderscores(r.name.escapedText):"default";const a=u.createUniqueName(`${o}_base`,16);t=()=>({diagnosticMessage:wt.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,errorNode:y,typeName:r.name});const s=u.createVariableDeclaration(a,void 0,x.createTypeOfExpression(y.expression,r,Ca,Ea,m),void 0);const c=u.createVariableStatement(n?[u.createModifier(138)]:[],u.createVariableDeclarationList([s],2));const l=u.createNodeArray(map(r.heritageClauses,(e=>{if(e.token===96){const n=t;t=createGetSymbolAccessibilityDiagnosticForNode(e.types[0]);const r=u.updateHeritageClause(e,map(e.types,(e=>u.updateExpressionWithTypeArguments(e,a,visitNodes2(e.typeArguments,visitDeclarationSubtree,isTypeNode)))));t=n;return r}return u.updateHeritageClause(e,visitNodes2(u.createNodeArray(filter(e.types,(e=>isEntityNameExpression(e.expression)||e.expression.kind===106))),visitDeclarationSubtree,isExpressionWithTypeArguments))})));return[c,cleanup(u.updateClassDeclaration(r,e,r.name,i,l,f))]}else{const t=transformHeritageClauses(r.heritageClauses);return cleanup(u.updateClassDeclaration(r,e,r.name,i,t,f))}}case 243:{return cleanup(transformVariableStatement(r))}case 266:{return cleanup(u.updateEnumDeclaration(r,u.createNodeArray(ensureModifiers(r)),r.name,u.createNodeArray(mapDefined(r.members,(t=>{if(shouldStripInternal(t))return;const n=x.getEnumMemberValue(t);const r=n==null?void 0:n.value;if(N&&t.initializer&&(n==null?void 0:n.hasExternalReferences)&&!isComputedPropertyName(t.name)){e.addDiagnostic(createDiagnosticForNode(t,wt.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations))}const i=r===void 0?void 0:typeof r==="string"?u.createStringLiteral(r):r<0?u.createPrefixUnaryExpression(41,u.createNumericLiteral(-r)):u.createNumericLiteral(r);return preserveJsDoc(u.updateEnumMember(t,t.name,i),t)})))))}}return S.assertNever(r,`Unhandled top-level node in declaration emit: ${S.formatSyntaxKind(r.kind)}`);function cleanup(e){if(isEnclosingDeclaration(r)){s=d}if(p){t=f}if(r.kind===267){n=y}if(e===r){return e}g=void 0;_=void 0;return e&&setOriginalNode(preserveJsDoc(e,r),r)}}function transformVariableStatement(e){if(!forEach(e.declarationList.declarations,getBindingNameVisible))return;const t=visitNodes2(e.declarationList.declarations,visitDeclarationSubtree,isVariableDeclaration);if(!length(t))return;const n=u.createNodeArray(ensureModifiers(e));let r;if(isVarUsing(e.declarationList)||isVarAwaitUsing(e.declarationList)){r=u.createVariableDeclarationList(t,2);setOriginalNode(r,e.declarationList);setTextRange(r,e.declarationList);setCommentRange(r,e.declarationList)}else{r=u.updateVariableDeclarationList(e.declarationList,t)}return u.updateVariableStatement(e,n,r)}function recreateBindingPattern(e){return flatten(mapDefined(e.elements,(e=>recreateBindingElement(e))))}function recreateBindingElement(e){if(e.kind===232){return}if(e.name){if(!getBindingNameVisible(e))return;if(isBindingPattern(e.name)){return recreateBindingPattern(e.name)}else{return u.createVariableDeclaration(e.name,void 0,ensureType(e),void 0)}}}function checkName(e){let n;if(!p){n=t;t=createGetSymbolAccessibilityDiagnosticForNodeName(e)}_=e.name;S.assert(hasDynamicName(e));const r=e;const i=r.name.expression;checkEntityNameVisibility(i,s);if(!p){t=n}_=void 0}function shouldStripInternal(e){return!!E&&!!e&&isInternalDeclaration(e,y)}function isScopeMarker2(e){return isExportAssignment(e)||isExportDeclaration(e)}function hasScopeMarker2(e){return some(e,isScopeMarker2)}function ensureModifiers(e){const t=getEffectiveModifierFlags(e);const n=ensureModifierFlags(e);if(t===n){return visitArray(e.modifiers,(e=>tryCast(e,isModifier)),isModifier)}return u.createModifiersFromModifierFlags(n)}function ensureModifierFlags(e){let t=131071^(1|1024|16);let i=n&&!isAlwaysType(e)?128:0;const o=e.parent.kind===307;if(!o||r&&o&&isExternalModule(e.parent)){t^=128;i=0}return maskModifierFlags(e,t,i)}function transformHeritageClauses(e){return u.createNodeArray(filter(map(e,(e=>u.updateHeritageClause(e,visitNodes2(u.createNodeArray(filter(e.types,(t=>isEntityNameExpression(t.expression)||e.token===96&&t.expression.kind===106))),visitDeclarationSubtree,isExpressionWithTypeArguments)))),(e=>e.types&&!!e.types.length)))}}function isAlwaysType(e){if(e.kind===264){return true}return false}function maskModifiers(e,t,n,r){return e.createModifiersFromModifierFlags(maskModifierFlags(t,n,r))}function maskModifierFlags(e,t=131071^1,n=0){let r=getEffectiveModifierFlags(e)&t|n;if(r&2048&&!(r&32)){r^=32}if(r&2048&&r&128){r^=128}return r}function canHaveLiteralInitializer(e){switch(e.kind){case 172:case 171:return!hasEffectiveModifier(e,2);case 169:case 260:return true}return false}function isPreservedDeclarationStatement(e){switch(e.kind){case 262:case 267:case 271:case 264:case 263:case 265:case 266:case 243:case 272:case 278:case 277:return true}return false}function isProcessedComponent(e){switch(e.kind){case 180:case 176:case 174:case 177:case 178:case 172:case 171:case 173:case 179:case 181:case 260:case 168:case 233:case 183:case 194:case 184:case 185:case 205:return true}return false}function getModuleTransformer(e){switch(e){case 200:return transformECMAScriptModule;case 99:case 7:case 6:case 5:case 100:case 101:case 199:case 1:return transformImpliedNodeFormatDependentModule;case 4:return transformSystemModule;default:return transformModule}}var Na={scriptTransformers:d,declarationTransformers:d};function getTransformers(e,t,n){return{scriptTransformers:getScriptTransformers(e,t,n),declarationTransformers:getDeclarationTransformers(t)}}function getScriptTransformers(e,t,n){if(n)return d;const r=zn(e);const i=Vn(e);const o=ir(e);const a=[];addRange(a,t&&map(t.before,wrapScriptTransformerFactory));a.push(transformTypeScript);if(e.experimentalDecorators){a.push(transformLegacyDecorators)}if(getJSXTransformEnabled(e)){a.push(transformJsx)}if(r<99){a.push(transformESNext)}if(!e.experimentalDecorators&&(r<99||!o)){a.push(transformESDecorators)}a.push(transformClassFields);if(r<8){a.push(transformES2021)}if(r<7){a.push(transformES2020)}if(r<6){a.push(transformES2019)}if(r<5){a.push(transformES2018)}if(r<4){a.push(transformES2017)}if(r<3){a.push(transformES2016)}if(r<2){a.push(transformES2015);a.push(transformGenerators)}a.push(getModuleTransformer(i));addRange(a,t&&map(t.after,wrapScriptTransformerFactory));return a}function getDeclarationTransformers(e){const t=[];t.push(transformDeclarations);addRange(t,e&&map(e.afterDeclarations,wrapDeclarationTransformerFactory));return t}function wrapCustomTransformer(e){return t=>isBundle(t)?e.transformBundle(t):e.transformSourceFile(t)}function wrapCustomTransformerFactory(e,t){return n=>{const r=e(n);return typeof r==="function"?t(n,r):wrapCustomTransformer(r)}}function wrapScriptTransformerFactory(e){return wrapCustomTransformerFactory(e,chainBundle)}function wrapDeclarationTransformerFactory(e){return wrapCustomTransformerFactory(e,((e,t)=>t))}function noEmitSubstitution(e,t){return t}function noEmitNotification(e,t,n){n(e,t)}function transformNodes(e,t,n,r,i,o,a){var s,c;const l=new Array(358);let d;let p;let u;let f=0;let m=[];let _=[];let g=[];let y=[];let h=0;let T=false;let v=[];let x=0;let b;let C;let E=noEmitSubstitution;let N=noEmitNotification;let k=0;const F=[];const P={factory:n,getCompilerOptions:()=>r,getEmitResolver:()=>e,getEmitHost:()=>t,getEmitHelperFactory:memoize((()=>createEmitHelperFactory(P))),startLexicalEnvironment:startLexicalEnvironment,suspendLexicalEnvironment:suspendLexicalEnvironment,resumeLexicalEnvironment:resumeLexicalEnvironment,endLexicalEnvironment:endLexicalEnvironment,setLexicalEnvironmentFlags:setLexicalEnvironmentFlags,getLexicalEnvironmentFlags:getLexicalEnvironmentFlags,hoistVariableDeclaration:hoistVariableDeclaration,hoistFunctionDeclaration:hoistFunctionDeclaration,addInitializationStatement:addInitializationStatement,startBlockScope:startBlockScope,endBlockScope:endBlockScope,addBlockScopedVariable:addBlockScopedVariable,requestEmitHelper:requestEmitHelper,readEmitHelpers:readEmitHelpers,enableSubstitution:enableSubstitution,enableEmitNotification:enableEmitNotification,isSubstitutionEnabled:isSubstitutionEnabled,isEmitNotificationEnabled:isEmitNotificationEnabled,get onSubstituteNode(){return E},set onSubstituteNode(e){S.assert(k<1,"Cannot modify transformation hooks after initialization has completed.");S.assert(e!==void 0,"Value must not be 'undefined'");E=e},get onEmitNode(){return N},set onEmitNode(e){S.assert(k<1,"Cannot modify transformation hooks after initialization has completed.");S.assert(e!==void 0,"Value must not be 'undefined'");N=e},addDiagnostic(e){F.push(e)}};for(const e of i){disposeEmitNodes(getSourceFileOfNode(getParseTreeNode(e)))}mark("beforeTransform");const D=o.map((e=>e(P)));const transformation=e=>{for(const t of D){e=t(e)}return e};k=1;const I=[];for(const e of i){(s=G)==null?void 0:s.push(G.Phase.Emit,"transformNodes",e.kind===307?{path:e.path}:{kind:e.kind,pos:e.pos,end:e.end});I.push((a?transformation:transformRoot)(e));(c=G)==null?void 0:c.pop()}k=2;mark("afterTransform");measure("transformTime","beforeTransform","afterTransform");return{transformed:I,substituteNode:substituteNode,emitNodeWithNotification:emitNodeWithNotification,isEmitNotificationEnabled:isEmitNotificationEnabled,dispose:dispose,diagnostics:F};function transformRoot(e){return e&&(!isSourceFile(e)||!e.isDeclarationFile)?transformation(e):e}function enableSubstitution(e){S.assert(k<2,"Cannot modify the transformation context after transformation has completed.");l[e]|=1}function isSubstitutionEnabled(e){return(l[e.kind]&1)!==0&&(getEmitFlags(e)&8)===0}function substituteNode(e,t){S.assert(k<3,"Cannot substitute a node after the result is disposed.");return t&&isSubstitutionEnabled(t)&&E(e,t)||t}function enableEmitNotification(e){S.assert(k<2,"Cannot modify the transformation context after transformation has completed.");l[e]|=2}function isEmitNotificationEnabled(e){return(l[e.kind]&2)!==0||(getEmitFlags(e)&4)!==0}function emitNodeWithNotification(e,t,n){S.assert(k<3,"Cannot invoke TransformationResult callbacks after the result is disposed.");if(t){if(isEmitNotificationEnabled(t)){N(e,t,n)}else{n(e,t)}}}function hoistVariableDeclaration(e){S.assert(k>0,"Cannot modify the lexical environment during initialization.");S.assert(k<2,"Cannot modify the lexical environment after transformation has completed.");const t=setEmitFlags(n.createVariableDeclaration(e),128);if(!d){d=[t]}else{d.push(t)}if(f&1){f|=2}}function hoistFunctionDeclaration(e){S.assert(k>0,"Cannot modify the lexical environment during initialization.");S.assert(k<2,"Cannot modify the lexical environment after transformation has completed.");setEmitFlags(e,2097152);if(!p){p=[e]}else{p.push(e)}}function addInitializationStatement(e){S.assert(k>0,"Cannot modify the lexical environment during initialization.");S.assert(k<2,"Cannot modify the lexical environment after transformation has completed.");setEmitFlags(e,2097152);if(!u){u=[e]}else{u.push(e)}}function startLexicalEnvironment(){S.assert(k>0,"Cannot modify the lexical environment during initialization.");S.assert(k<2,"Cannot modify the lexical environment after transformation has completed.");S.assert(!T,"Lexical environment is suspended.");m[h]=d;_[h]=p;g[h]=u;y[h]=f;h++;d=void 0;p=void 0;u=void 0;f=0}function suspendLexicalEnvironment(){S.assert(k>0,"Cannot modify the lexical environment during initialization.");S.assert(k<2,"Cannot modify the lexical environment after transformation has completed.");S.assert(!T,"Lexical environment is already suspended.");T=true}function resumeLexicalEnvironment(){S.assert(k>0,"Cannot modify the lexical environment during initialization.");S.assert(k<2,"Cannot modify the lexical environment after transformation has completed.");S.assert(T,"Lexical environment is not suspended.");T=false}function endLexicalEnvironment(){S.assert(k>0,"Cannot modify the lexical environment during initialization.");S.assert(k<2,"Cannot modify the lexical environment after transformation has completed.");S.assert(!T,"Lexical environment is suspended.");let e;if(d||p||u){if(p){e=[...p]}if(d){const t=n.createVariableStatement(void 0,n.createVariableDeclarationList(d));setEmitFlags(t,2097152);if(!e){e=[t]}else{e.push(t)}}if(u){if(!e){e=[...u]}else{e=[...e,...u]}}}h--;d=m[h];p=_[h];u=g[h];f=y[h];if(h===0){m=[];_=[];g=[];y=[]}return e}function setLexicalEnvironmentFlags(e,t){f=t?f|e:f&~e}function getLexicalEnvironmentFlags(){return f}function startBlockScope(){S.assert(k>0,"Cannot start a block scope during initialization.");S.assert(k<2,"Cannot start a block scope after transformation has completed.");v[x]=b;x++;b=void 0}function endBlockScope(){S.assert(k>0,"Cannot end a block scope during initialization.");S.assert(k<2,"Cannot end a block scope after transformation has completed.");const e=some(b)?[n.createVariableStatement(void 0,n.createVariableDeclarationList(b.map((e=>n.createVariableDeclaration(e))),1))]:void 0;x--;b=v[x];if(x===0){v=[]}return e}function addBlockScopedVariable(e){S.assert(x>0,"Cannot add a block scoped variable outside of an iteration body.");(b||(b=[])).push(e)}function requestEmitHelper(e){S.assert(k>0,"Cannot modify the transformation context during initialization.");S.assert(k<2,"Cannot modify the transformation context after transformation has completed.");S.assert(!e.scoped,"Cannot request a scoped emit helper.");if(e.dependencies){for(const t of e.dependencies){requestEmitHelper(t)}}C=append(C,e)}function readEmitHelpers(){S.assert(k>0,"Cannot modify the transformation context during initialization.");S.assert(k<2,"Cannot modify the transformation context after transformation has completed.");const e=C;C=void 0;return e}function dispose(){if(k<3){for(const e of i){disposeEmitNodes(getSourceFileOfNode(getParseTreeNode(e)))}d=void 0;m=void 0;p=void 0;_=void 0;E=void 0;N=void 0;C=void 0;k=3}}}var ka={factory:zr,getCompilerOptions:()=>({}),getEmitResolver:notImplemented,getEmitHost:notImplemented,getEmitHelperFactory:notImplemented,startLexicalEnvironment:noop,resumeLexicalEnvironment:noop,suspendLexicalEnvironment:noop,endLexicalEnvironment:returnUndefined,setLexicalEnvironmentFlags:noop,getLexicalEnvironmentFlags:()=>0,hoistVariableDeclaration:noop,hoistFunctionDeclaration:noop,addInitializationStatement:noop,startBlockScope:noop,endBlockScope:returnUndefined,addBlockScopedVariable:noop,requestEmitHelper:noop,readEmitHelpers:notImplemented,enableSubstitution:noop,enableEmitNotification:noop,isSubstitutionEnabled:notImplemented,isEmitNotificationEnabled:notImplemented,onSubstituteNode:noEmitSubstitution,onEmitNode:noEmitNotification,addDiagnostic:noop};var Fa=createBracketsMap();function isBuildInfoFile(e){return fileExtensionIs(e,".tsbuildinfo")}function forEachEmittedFile(e,t,n,r=false,i,o){const a=isArray(n)?n:getSourceFilesToEmit(e,n,r);const s=e.getCompilerOptions();if(!i){if(s.outFile){if(a.length){const n=zr.createBundle(a);const i=t(getOutputPathsFor(n,e,r),n);if(i){return i}}}else{for(const n of a){const i=t(getOutputPathsFor(n,e,r),n);if(i){return i}}}}if(o){const e=getTsBuildInfoEmitOutputFilePath(s);if(e)return t({buildInfoPath:e},void 0)}}function getTsBuildInfoEmitOutputFilePath(e){const t=e.configFilePath;if(!canEmitTsBuildInfo(e))return void 0;if(e.tsBuildInfoFile)return e.tsBuildInfoFile;const n=e.outFile;let r;if(n){r=removeFileExtension(n)}else{if(!t)return void 0;const n=removeFileExtension(t);r=e.outDir?e.rootDir?resolvePath(e.outDir,getRelativePathFromDirectory(e.rootDir,n,true)):combinePaths(e.outDir,getBaseFileName(n)):n}return r+".tsbuildinfo"}function canEmitTsBuildInfo(e){return tr(e)||!!e.tscBuild}function getOutputPathsForBundle(e,t){const n=e.outFile;const r=e.emitDeclarationOnly?void 0:n;const i=r&&getSourceMapFilePath(r,e);const o=t||Zn(e)?removeFileExtension(n)+".d.ts":void 0;const a=o&&nr(e)?o+".map":void 0;return{jsFilePath:r,sourceMapFilePath:i,declarationFilePath:o,declarationMapPath:a}}function getOutputPathsFor(e,t,n){const r=t.getCompilerOptions();if(e.kind===308){return getOutputPathsForBundle(r,n)}else{const i=getOwnEmitOutputFilePath(e.fileName,t,getOutputExtension(e.fileName,r));const o=isJsonSourceFile(e);const a=o&&comparePaths(e.fileName,i,t.getCurrentDirectory(),!t.useCaseSensitiveFileNames())===0;const s=r.emitDeclarationOnly||a?void 0:i;const c=!s||isJsonSourceFile(e)?void 0:getSourceMapFilePath(s,r);const l=n||Zn(r)&&!o?getDeclarationEmitOutputFilePath(e.fileName,t):void 0;const d=l&&nr(r)?l+".map":void 0;return{jsFilePath:s,sourceMapFilePath:c,declarationFilePath:l,declarationMapPath:d}}}function getSourceMapFilePath(e,t){return t.sourceMap&&!t.inlineSourceMap?e+".map":void 0}function getOutputExtension(e,t){return fileExtensionIs(e,".json")?".json":t.jsx===1&&fileExtensionIsOneOf(e,[".jsx",".tsx"])?".jsx":fileExtensionIsOneOf(e,[".mts",".mjs"])?".mjs":fileExtensionIsOneOf(e,[".cts",".cjs"])?".cjs":".js"}function getOutputPathWithoutChangingExt(e,t,n,r){return n?resolvePath(n,getRelativePathFromDirectory(r(),e,t)):e}function getOutputDeclarationFileName(e,t,n,r=(()=>getCommonSourceDirectoryOfConfig(t,n))){return getOutputDeclarationFileNameWorker(e,t.options,n,r)}function getOutputDeclarationFileNameWorker(e,t,n,r){return changeExtension(getOutputPathWithoutChangingExt(e,n,t.declarationDir||t.outDir,r),getDeclarationEmitExtensionForPath(e))}function getOutputJSFileName(e,t,n,r=(()=>getCommonSourceDirectoryOfConfig(t,n))){if(t.options.emitDeclarationOnly)return void 0;const i=fileExtensionIs(e,".json");const o=getOutputJSFileNameWorker(e,t.options,n,r);return!i||comparePaths(e,o,S.checkDefined(t.options.configFilePath),n)!==0?o:void 0}function getOutputJSFileNameWorker(e,t,n,r){return changeExtension(getOutputPathWithoutChangingExt(e,n,t.outDir,r),getOutputExtension(e,t))}function createAddOutput(){let e;return{addOutput:addOutput,getOutputs:getOutputs};function addOutput(t){if(t){(e||(e=[])).push(t)}}function getOutputs(){return e||d}}function getSingleOutputFileNames(e,t){const{jsFilePath:n,sourceMapFilePath:r,declarationFilePath:i,declarationMapPath:o}=getOutputPathsForBundle(e.options,false);t(n);t(r);t(i);t(o)}function getOwnOutputFileNames(e,t,n,r,i){if(isDeclarationFileName(t))return;const o=getOutputJSFileName(t,e,n,i);r(o);if(fileExtensionIs(t,".json"))return;if(o&&e.options.sourceMap){r(`${o}.map`)}if(Zn(e.options)){const o=getOutputDeclarationFileName(t,e,n,i);r(o);if(e.options.declarationMap){r(`${o}.map`)}}}function getCommonSourceDirectory(e,t,n,r,i){let o;if(e.rootDir){o=getNormalizedAbsolutePath(e.rootDir,n);i==null?void 0:i(e.rootDir)}else if(e.composite&&e.configFilePath){o=getDirectoryPath(normalizeSlashes(e.configFilePath));i==null?void 0:i(o)}else{o=computeCommonSourceDirectoryOfFilenames(t(),n,r)}if(o&&o[o.length-1]!==Pt){o+=Pt}return o}function getCommonSourceDirectoryOfConfig({options:e,fileNames:t},n){return getCommonSourceDirectory(e,(()=>filter(t,(t=>!(e.noEmitForJsFiles&&fileExtensionIsOneOf(t,Tr))&&!isDeclarationFileName(t)))),getDirectoryPath(normalizeSlashes(S.checkDefined(e.configFilePath))),createGetCanonicalFileName(!n))}function getAllProjectOutputs(e,t){const{addOutput:n,getOutputs:r}=createAddOutput();if(e.options.outFile){getSingleOutputFileNames(e,n)}else{const r=memoize((()=>getCommonSourceDirectoryOfConfig(e,t)));for(const i of e.fileNames){getOwnOutputFileNames(e,i,t,n,r)}}n(getTsBuildInfoEmitOutputFilePath(e.options));return r()}function getOutputFileNames(e,t,n){t=normalizePath(t);S.assert(contains(e.fileNames,t),`Expected fileName to be present in command line`);const{addOutput:r,getOutputs:i}=createAddOutput();if(e.options.outFile){getSingleOutputFileNames(e,r)}else{getOwnOutputFileNames(e,t,n,r)}return i()}function getFirstProjectOutput(e,t){if(e.options.outFile){const{jsFilePath:t,declarationFilePath:n}=getOutputPathsForBundle(e.options,false);return S.checkDefined(t||n,`project ${e.options.configFilePath} expected to have at least one output`)}const n=memoize((()=>getCommonSourceDirectoryOfConfig(e,t)));for(const r of e.fileNames){if(isDeclarationFileName(r))continue;const i=getOutputJSFileName(r,e,t,n);if(i)return i;if(fileExtensionIs(r,".json"))continue;if(Zn(e.options)){return getOutputDeclarationFileName(r,e,t,n)}}const r=getTsBuildInfoEmitOutputFilePath(e.options);if(r)return r;return S.fail(`project ${e.options.configFilePath} expected to have at least one output`)}function emitResolverSkipsTypeChecking(e,t){return!!t&&!!e}function emitFiles(e,t,n,{scriptTransformers:r,declarationTransformers:i},o,a,s,l){var d=t.getCompilerOptions();var p=d.sourceMap||d.inlineSourceMap||nr(d)?[]:void 0;var u=d.listEmittedFiles?[]:void 0;var f=createDiagnosticCollection();var m=getNewLineCharacter(d);var _=createTextWriter(m);var{enter:g,exit:y}=createTimer("printTime","beforePrint","afterPrint");var h=false;g();forEachEmittedFile(t,emitSourceFileOrBundle,getSourceFilesToEmit(t,n,s),s,a,!n&&!l);y();return{emitSkipped:h,diagnostics:f.getDiagnostics(),emittedFiles:u,sourceMaps:p};function emitSourceFileOrBundle({jsFilePath:e,sourceMapFilePath:t,declarationFilePath:n,declarationMapPath:r,buildInfoPath:i},o){var a,s,c,l,d,p;(a=G)==null?void 0:a.push(G.Phase.Emit,"emitJsFileOrBundle",{jsFilePath:e});emitJsFileOrBundle(o,e,t);(s=G)==null?void 0:s.pop();(c=G)==null?void 0:c.push(G.Phase.Emit,"emitDeclarationFileOrBundle",{declarationFilePath:n});emitDeclarationFileOrBundle(o,n,r);(l=G)==null?void 0:l.pop();(d=G)==null?void 0:d.push(G.Phase.Emit,"emitBuildInfo",{buildInfoPath:i});emitBuildInfo(i);(p=G)==null?void 0:p.pop()}function emitBuildInfo(e){if(!e||n)return;if(t.isEmitBlocked(e)){h=true;return}const r=t.getBuildInfo()||{version:c};writeFile(t,f,e,getBuildInfoText(r),false,void 0,{buildInfo:r});u==null?void 0:u.push(e)}function emitJsFileOrBundle(n,i,a){if(!n||o||!i){return}if(t.isEmitBlocked(i)||d.noEmit){h=true;return}(isSourceFile(n)?[n]:filter(n.sourceFiles,isSourceFileNotJson)).forEach((e=>{if(d.noCheck||!canIncludeBindAndCheckDiagnostics(e,d))markLinkedReferences(e)}));const s=transformNodes(e,t,zr,d,[n],r,false);const c={removeComments:d.removeComments,newLine:d.newLine,noEmitHelpers:d.noEmitHelpers,module:Vn(d),moduleResolution:qn(d),target:zn(d),sourceMap:d.sourceMap,inlineSourceMap:d.inlineSourceMap,inlineSources:d.inlineSources,extendedDiagnostics:d.extendedDiagnostics};const l=createPrinter(c,{hasGlobalName:e.hasGlobalName,onEmitNode:s.emitNodeWithNotification,isEmitNotificationEnabled:s.isEmitNotificationEnabled,substituteNode:s.substituteNode});S.assert(s.transformed.length===1,"Should only see one output from the transform");printSourceFileOrBundle(i,a,s,l,d);s.dispose();if(u){u.push(i);if(a){u.push(a)}}}function emitDeclarationFileOrBundle(n,r,a){if(!n||o===0)return;if(!r){if(o||d.emitDeclarationOnly)h=true;return}const c=isSourceFile(n)?[n]:n.sourceFiles;const l=s?c:filter(c,isSourceFileNotJson);const p=d.outFile?[zr.createBundle(l)]:l;l.forEach((e=>{if(o&&!Zn(d)||d.noCheck||emitResolverSkipsTypeChecking(o,s)||!canIncludeBindAndCheckDiagnostics(e,d)){collectLinkedAliases(e)}}));const m=transformNodes(e,t,zr,d,p,i,false);if(length(m.diagnostics)){for(const e of m.diagnostics){f.add(e)}}const _=!!m.diagnostics&&!!m.diagnostics.length||!!t.isEmitBlocked(r)||!!d.noEmit;h=h||_;if(!_||s){S.assert(m.transformed.length===1,"Should only see one output from the decl transform");const t={removeComments:d.removeComments,newLine:d.newLine,noEmitHelpers:true,module:d.module,moduleResolution:d.moduleResolution,target:d.target,sourceMap:o!==2&&d.declarationMap,inlineSourceMap:d.inlineSourceMap,extendedDiagnostics:d.extendedDiagnostics,onlyPrintJsDocStyle:true,omitBraceSourceMapPositions:true};const n=createPrinter(t,{hasGlobalName:e.hasGlobalName,onEmitNode:m.emitNodeWithNotification,isEmitNotificationEnabled:m.isEmitNotificationEnabled,substituteNode:m.substituteNode});const i=printSourceFileOrBundle(r,a,m,n,{sourceMap:t.sourceMap,sourceRoot:d.sourceRoot,mapRoot:d.mapRoot,extendedDiagnostics:d.extendedDiagnostics});if(u){if(i)u.push(r);if(a){u.push(a)}}}m.dispose()}function collectLinkedAliases(t){if(isExportAssignment(t)){if(t.expression.kind===80){e.collectLinkedAliases(t.expression,true)}return}else if(isExportSpecifier(t)){e.collectLinkedAliases(t.propertyName||t.name,true);return}forEachChild(t,collectLinkedAliases)}function markLinkedReferences(t){if(isSourceFileJS(t))return;forEachChildRecursively(t,(t=>{if(isImportEqualsDeclaration(t)&&!(getSyntacticModifierFlags(t)&32))return"skip";if(isImportDeclaration(t))return"skip";e.markLinkedReferences(t)}))}function printSourceFileOrBundle(e,n,r,i,o){const a=r.transformed[0];const s=a.kind===308?a:void 0;const c=a.kind===307?a:void 0;const l=s?s.sourceFiles:[c];let u;if(shouldEmitSourceMaps(o,a)){u=createSourceMapGenerator(t,getBaseFileName(normalizeSlashes(e)),getSourceRoot(o),getSourceMapDirectory(o,e,c),o)}if(s){i.writeBundle(s,_,u)}else{i.writeFile(c,_,u)}let g;if(u){if(p){p.push({inputSourceFileNames:u.getSources(),sourceMap:u.toJSON()})}const r=getSourceMappingURL(o,u,e,n,c);if(r){if(!_.isAtStartOfLine())_.rawWrite(m);g=_.getTextPos();_.writeComment(`//# ${"sourceMappingURL"}=${r}`)}if(n){const e=u.toString();writeFile(t,f,n,e,false,l)}}else{_.writeLine()}const y=_.getText();const h={sourceMapUrlPos:g,diagnostics:r.diagnostics};writeFile(t,f,e,y,!!d.emitBOM,l,h);_.clear();return!h.skippedDtsWrite}function shouldEmitSourceMaps(e,t){return(e.sourceMap||e.inlineSourceMap)&&(t.kind!==307||!fileExtensionIs(t.fileName,".json"))}function getSourceRoot(e){const t=normalizeSlashes(e.sourceRoot||"");return t?ensureTrailingDirectorySeparator(t):t}function getSourceMapDirectory(e,n,r){if(e.sourceRoot)return t.getCommonSourceDirectory();if(e.mapRoot){let n=normalizeSlashes(e.mapRoot);if(r){n=getDirectoryPath(getSourceFilePathInNewDir(r.fileName,t,n))}if(getRootLength(n)===0){n=combinePaths(t.getCommonSourceDirectory(),n)}return n}return getDirectoryPath(normalizePath(n))}function getSourceMappingURL(e,n,r,i,o){if(e.inlineSourceMap){const e=n.toString();const t=base64encode(Ft,e);return`data:application/json;base64,${t}`}const a=getBaseFileName(normalizeSlashes(S.checkDefined(i)));if(e.mapRoot){let n=normalizeSlashes(e.mapRoot);if(o){n=getDirectoryPath(getSourceFilePathInNewDir(o.fileName,t,n))}if(getRootLength(n)===0){n=combinePaths(t.getCommonSourceDirectory(),n);return encodeURI(getRelativePathToDirectoryOrUrl(getDirectoryPath(normalizePath(r)),combinePaths(n,a),t.getCurrentDirectory(),t.getCanonicalFileName,true))}else{return encodeURI(combinePaths(n,a))}}return encodeURI(a)}}function getBuildInfoText(e){return JSON.stringify(e)}function getBuildInfo(e,t){return readJsonOrUndefined(e,t)}var Pa={hasGlobalName:notImplemented,getReferencedExportContainer:notImplemented,getReferencedImportDeclaration:notImplemented,getReferencedDeclarationWithCollidingName:notImplemented,isDeclarationWithCollidingName:notImplemented,isValueAliasDeclaration:notImplemented,isReferencedAliasDeclaration:notImplemented,isTopLevelValueImportEqualsWithEntityName:notImplemented,hasNodeCheckFlag:notImplemented,isDeclarationVisible:notImplemented,isLateBound:e=>false,collectLinkedAliases:notImplemented,markLinkedReferences:notImplemented,isImplementationOfOverload:notImplemented,requiresAddingImplicitUndefined:notImplemented,isExpandoFunctionDeclaration:notImplemented,getPropertiesOfContainerFunction:notImplemented,createTypeOfDeclaration:notImplemented,createReturnTypeOfSignatureDeclaration:notImplemented,createTypeOfExpression:notImplemented,createLiteralConstValue:notImplemented,isSymbolAccessible:notImplemented,isEntityNameVisible:notImplemented,getConstantValue:notImplemented,getEnumMemberValue:notImplemented,getReferencedValueDeclaration:notImplemented,getReferencedValueDeclarations:notImplemented,getTypeReferenceSerializationKind:notImplemented,isOptionalParameter:notImplemented,isArgumentsLocalBinding:notImplemented,getExternalModuleFileFromDeclaration:notImplemented,isLiteralConstDeclaration:notImplemented,getJsxFactoryEntity:notImplemented,getJsxFragmentFactoryEntity:notImplemented,isBindingCapturedByNode:notImplemented,getDeclarationStatementsForSourceFile:notImplemented,isImportRequiredByAugmentation:notImplemented,isDefinitelyReferenceToGlobalSymbolObject:notImplemented,createLateBoundIndexSignatures:notImplemented};var Da=memoize((()=>createPrinter({})));var Ia=memoize((()=>createPrinter({removeComments:true})));var Aa=memoize((()=>createPrinter({removeComments:true,neverAsciiEscape:true})));var Oa=memoize((()=>createPrinter({removeComments:true,omitTrailingSemicolon:true})));function createPrinter(e={},t={}){var{hasGlobalName:n,onEmitNode:r=noEmitNotification,isEmitNotificationEnabled:i,substituteNode:o=noEmitSubstitution,onBeforeEmitNode:a,onAfterEmitNode:s,onBeforeEmitNodeArray:c,onAfterEmitNodeArray:l,onBeforeEmitToken:d,onAfterEmitToken:p}=t;var u=!!e.extendedDiagnostics;var f=!!e.omitBraceSourceMapPositions;var m=getNewLineCharacter(e);var _=Vn(e);var g=new Map;var y;var h;var T;var v;var x;var b;var C;var E;var N;var k;var F;var P;var D;var I;var A;var O=e.preserveSourceNewlines;var w;var L;var M;var R=writeBase;var B;var j=true;var J;var W;var U=-1;var z;var V=-1;var q=-1;var H=-1;var G=-1;var K;var $;var Q=false;var X=!!e.removeComments;var Y;var Z;var{enter:ee,exit:te}=createTimerIf(u,"commentTime","beforeComment","afterComment");var ne=zr.parenthesizer;var ie={select:e=>e===0?ne.parenthesizeLeadingTypeArgument:void 0};var oe=createEmitBinaryExpression();reset2();return{printNode:printNode,printList:printList,printFile:printFile,printBundle:printBundle,writeNode:writeNode,writeList:writeList,writeFile:writeFile2,writeBundle:writeBundle};function printNode(e,t,n){switch(e){case 0:S.assert(isSourceFile(t),"Expected a SourceFile node.");break;case 2:S.assert(isIdentifier(t),"Expected an Identifier node.");break;case 1:S.assert(isExpression(t),"Expected an Expression node.");break}switch(t.kind){case 307:return printFile(t);case 308:return printBundle(t)}writeNode(e,t,n,beginPrint());return endPrint()}function printList(e,t,n){writeList(e,t,n,beginPrint());return endPrint()}function printBundle(e){writeBundle(e,beginPrint(),void 0);return endPrint()}function printFile(e){writeFile2(e,beginPrint(),void 0);return endPrint()}function writeNode(e,t,n,r){const i=L;setWriter(r,void 0);print(e,t,n);reset2();L=i}function writeList(e,t,n,r){const i=L;setWriter(r,void 0);if(n){setSourceFile(n)}emitList(void 0,t,e);reset2();L=i}function writeBundle(e,t,n){B=false;const r=L;setWriter(t,n);emitShebangIfNeeded(e);emitPrologueDirectivesIfNeeded(e);emitHelpers(e);emitSyntheticTripleSlashReferencesIfNeeded(e);for(const t of e.sourceFiles){print(0,t,t)}reset2();L=r}function writeFile2(e,t,n){B=true;const r=L;setWriter(t,n);emitShebangIfNeeded(e);emitPrologueDirectivesIfNeeded(e);print(0,e,e);reset2();L=r}function beginPrint(){return M||(M=createTextWriter(m))}function endPrint(){const e=M.getText();M.clear();return e}function print(e,t,n){if(n){setSourceFile(n)}pipelineEmit(e,t,void 0)}function setSourceFile(e){y=e;K=void 0;$=void 0;if(e){setSourceMapSource(e)}}function setWriter(t,n){if(t&&e.omitTrailingSemicolon){t=getTrailingSemicolonDeferringWriter(t)}L=t;J=n;j=!L||!J}function reset2(){h=[];T=[];v=[];x=new Set;b=[];C=new Map;E=[];N=0;k=[];F=0;P=[];D=void 0;I=[];A=void 0;y=void 0;K=void 0;$=void 0;setWriter(void 0,void 0)}function getCurrentLineMap(){return K||(K=getLineStarts(S.checkDefined(y)))}function emit(e,t){if(e===void 0)return;pipelineEmit(4,e,t)}function emitIdentifierName(e){if(e===void 0)return;pipelineEmit(2,e,void 0)}function emitExpression(e,t){if(e===void 0)return;pipelineEmit(1,e,t)}function emitJsxAttributeValue(e){pipelineEmit(isStringLiteral(e)?6:4,e)}function beforeEmitNode(e){if(O&&getInternalEmitFlags(e)&4){O=false}}function afterEmitNode(e){O=e}function pipelineEmit(e,t,n){Z=n;const r=getPipelinePhase(0,e,t);r(e,t);Z=void 0}function shouldEmitComments(e){return!X&&!isSourceFile(e)}function shouldEmitSourceMaps(e){return!j&&!isSourceFile(e)&&!isInJsonFile(e)}function getPipelinePhase(e,t,n){switch(e){case 0:if(r!==noEmitNotification&&(!i||i(n))){return pipelineEmitWithNotification}case 1:if(o!==noEmitSubstitution&&(Y=o(t,n)||n)!==n){if(Z){Y=Z(Y)}return pipelineEmitWithSubstitution}case 2:if(shouldEmitComments(n)){return pipelineEmitWithComments}case 3:if(shouldEmitSourceMaps(n)){return pipelineEmitWithSourceMaps}case 4:return pipelineEmitWithHint;default:return S.assertNever(e)}}function getNextPipelinePhase(e,t,n){return getPipelinePhase(e+1,t,n)}function pipelineEmitWithNotification(e,t){const n=getNextPipelinePhase(0,e,t);r(e,t,n)}function pipelineEmitWithHint(e,t){a==null?void 0:a(t);if(O){const n=O;beforeEmitNode(t);pipelineEmitWithHintWorker(e,t);afterEmitNode(n)}else{pipelineEmitWithHintWorker(e,t)}s==null?void 0:s(t);Z=void 0}function pipelineEmitWithHintWorker(e,t,n=true){if(n){const n=getSnippetElement(t);if(n){return emitSnippetNode(e,t,n)}}if(e===0)return emitSourceFile(cast(t,isSourceFile));if(e===2)return emitIdentifier(cast(t,isIdentifier));if(e===6)return emitLiteral(cast(t,isStringLiteral),true);if(e===3)return emitMappedTypeParameter(cast(t,isTypeParameterDeclaration));if(e===7)return emitImportTypeNodeAttributes(cast(t,isImportAttributes));if(e===5){S.assertNode(t,isEmptyStatement);return emitEmptyStatement(true)}if(e===4){switch(t.kind){case 16:case 17:case 18:return emitLiteral(t,false);case 80:return emitIdentifier(t);case 81:return emitPrivateIdentifier(t);case 166:return emitQualifiedName(t);case 167:return emitComputedPropertyName(t);case 168:return emitTypeParameter(t);case 169:return emitParameter(t);case 170:return emitDecorator(t);case 171:return emitPropertySignature(t);case 172:return emitPropertyDeclaration(t);case 173:return emitMethodSignature(t);case 174:return emitMethodDeclaration(t);case 175:return emitClassStaticBlockDeclaration(t);case 176:return emitConstructor(t);case 177:case 178:return emitAccessorDeclaration(t);case 179:return emitCallSignature(t);case 180:return emitConstructSignature(t);case 181:return emitIndexSignature(t);case 182:return emitTypePredicate(t);case 183:return emitTypeReference(t);case 184:return emitFunctionType(t);case 185:return emitConstructorType(t);case 186:return emitTypeQuery(t);case 187:return emitTypeLiteral(t);case 188:return emitArrayType(t);case 189:return emitTupleType(t);case 190:return emitOptionalType(t);case 192:return emitUnionType(t);case 193:return emitIntersectionType(t);case 194:return emitConditionalType(t);case 195:return emitInferType(t);case 196:return emitParenthesizedType(t);case 233:return emitExpressionWithTypeArguments(t);case 197:return emitThisType();case 198:return emitTypeOperator(t);case 199:return emitIndexedAccessType(t);case 200:return emitMappedType(t);case 201:return emitLiteralType(t);case 202:return emitNamedTupleMember(t);case 203:return emitTemplateType(t);case 204:return emitTemplateTypeSpan(t);case 205:return emitImportTypeNode(t);case 206:return emitObjectBindingPattern(t);case 207:return emitArrayBindingPattern(t);case 208:return emitBindingElement(t);case 239:return emitTemplateSpan(t);case 240:return emitSemicolonClassElement();case 241:return emitBlock(t);case 243:return emitVariableStatement(t);case 242:return emitEmptyStatement(false);case 244:return emitExpressionStatement(t);case 245:return emitIfStatement(t);case 246:return emitDoStatement(t);case 247:return emitWhileStatement(t);case 248:return emitForStatement(t);case 249:return emitForInStatement(t);case 250:return emitForOfStatement(t);case 251:return emitContinueStatement(t);case 252:return emitBreakStatement(t);case 253:return emitReturnStatement(t);case 254:return emitWithStatement(t);case 255:return emitSwitchStatement(t);case 256:return emitLabeledStatement(t);case 257:return emitThrowStatement(t);case 258:return emitTryStatement(t);case 259:return emitDebuggerStatement(t);case 260:return emitVariableDeclaration(t);case 261:return emitVariableDeclarationList(t);case 262:return emitFunctionDeclaration(t);case 263:return emitClassDeclaration(t);case 264:return emitInterfaceDeclaration(t);case 265:return emitTypeAliasDeclaration(t);case 266:return emitEnumDeclaration(t);case 267:return emitModuleDeclaration(t);case 268:return emitModuleBlock(t);case 269:return emitCaseBlock(t);case 270:return emitNamespaceExportDeclaration(t);case 271:return emitImportEqualsDeclaration(t);case 272:return emitImportDeclaration(t);case 273:return emitImportClause(t);case 274:return emitNamespaceImport(t);case 280:return emitNamespaceExport(t);case 275:return emitNamedImports(t);case 276:return emitImportSpecifier(t);case 277:return emitExportAssignment(t);case 278:return emitExportDeclaration(t);case 279:return emitNamedExports(t);case 281:return emitExportSpecifier(t);case 300:return emitImportAttributes(t);case 301:return emitImportAttribute(t);case 282:return;case 283:return emitExternalModuleReference(t);case 12:return emitJsxText(t);case 286:case 289:return emitJsxOpeningElementOrFragment(t);case 287:case 290:return emitJsxClosingElementOrFragment(t);case 291:return emitJsxAttribute(t);case 292:return emitJsxAttributes(t);case 293:return emitJsxSpreadAttribute(t);case 294:return emitJsxExpression(t);case 295:return emitJsxNamespacedName(t);case 296:return emitCaseClause(t);case 297:return emitDefaultClause(t);case 298:return emitHeritageClause(t);case 299:return emitCatchClause(t);case 303:return emitPropertyAssignment(t);case 304:return emitShorthandPropertyAssignment(t);case 305:return emitSpreadAssignment(t);case 306:return emitEnumMember(t);case 307:return emitSourceFile(t);case 308:return S.fail("Bundles should be printed using printBundle");case 309:return emitJSDocTypeExpression(t);case 310:return emitJSDocNameReference(t);case 312:return writePunctuation("*");case 313:return writePunctuation("?");case 314:return emitJSDocNullableType(t);case 315:return emitJSDocNonNullableType(t);case 316:return emitJSDocOptionalType(t);case 317:return emitJSDocFunctionType(t);case 191:case 318:return emitRestOrJSDocVariadicType(t);case 319:return;case 320:return emitJSDoc(t);case 322:return emitJSDocTypeLiteral(t);case 323:return emitJSDocSignature(t);case 327:case 332:case 337:return emitJSDocSimpleTag(t);case 328:case 329:return emitJSDocHeritageTag(t);case 330:case 331:return;case 333:case 334:case 335:case 336:return;case 338:return emitJSDocCallbackTag(t);case 339:return emitJSDocOverloadTag(t);case 341:case 348:return emitJSDocPropertyLikeTag(t);case 340:case 342:case 343:case 344:case 349:case 350:return emitJSDocSimpleTypedTag(t);case 345:return emitJSDocTemplateTag(t);case 346:return emitJSDocTypedefTag(t);case 347:return emitJSDocSeeTag(t);case 351:return emitJSDocImportTag(t);case 353:case 354:return}if(isExpression(t)){e=1;if(o!==noEmitSubstitution){const n=o(e,t)||t;if(n!==t){t=n;if(Z){t=Z(t)}}}}}if(e===1){switch(t.kind){case 9:case 10:return emitNumericOrBigIntLiteral(t);case 11:case 14:case 15:return emitLiteral(t,false);case 80:return emitIdentifier(t);case 81:return emitPrivateIdentifier(t);case 209:return emitArrayLiteralExpression(t);case 210:return emitObjectLiteralExpression(t);case 211:return emitPropertyAccessExpression(t);case 212:return emitElementAccessExpression(t);case 213:return emitCallExpression(t);case 214:return emitNewExpression(t);case 215:return emitTaggedTemplateExpression(t);case 216:return emitTypeAssertionExpression(t);case 217:return emitParenthesizedExpression(t);case 218:return emitFunctionExpression(t);case 219:return emitArrowFunction(t);case 220:return emitDeleteExpression(t);case 221:return emitTypeOfExpression(t);case 222:return emitVoidExpression(t);case 223:return emitAwaitExpression(t);case 224:return emitPrefixUnaryExpression(t);case 225:return emitPostfixUnaryExpression(t);case 226:return oe(t);case 227:return emitConditionalExpression(t);case 228:return emitTemplateExpression(t);case 229:return emitYieldExpression(t);case 230:return emitSpreadElement(t);case 231:return emitClassExpression(t);case 232:return;case 234:return emitAsExpression(t);case 235:return emitNonNullExpression(t);case 233:return emitExpressionWithTypeArguments(t);case 238:return emitSatisfiesExpression(t);case 236:return emitMetaProperty(t);case 237:return S.fail("SyntheticExpression should never be printed.");case 282:return;case 284:return emitJsxElement(t);case 285:return emitJsxSelfClosingElement(t);case 288:return emitJsxFragment(t);case 352:return S.fail("SyntaxList should not be printed");case 353:return;case 355:return emitPartiallyEmittedExpression(t);case 356:return emitCommaList(t);case 357:return S.fail("SyntheticReferenceExpression should not be printed")}}if(isKeyword(t.kind))return writeTokenNode(t,writeKeyword);if(isTokenKind(t.kind))return writeTokenNode(t,writePunctuation);S.fail(`Unhandled SyntaxKind: ${S.formatSyntaxKind(t.kind)}.`)}function emitMappedTypeParameter(e){emit(e.name);writeSpace();writeKeyword("in");writeSpace();emit(e.constraint)}function pipelineEmitWithSubstitution(e,t){const n=getNextPipelinePhase(1,e,t);S.assertIsDefined(Y);t=Y;Y=void 0;n(e,t)}function emitHelpers(t){let n=false;const r=t.kind===308?t:void 0;if(r&&_===0){return}const i=r?r.sourceFiles.length:1;for(let o=0;o")}function emitFunctionTypeBody(e){writeSpace();emit(e.type)}function emitJSDocFunctionType(e){writeKeyword("function");emitParameters(e,e.parameters);writePunctuation(":");emit(e.type)}function emitJSDocNullableType(e){writePunctuation("?");emit(e.type)}function emitJSDocNonNullableType(e){writePunctuation("!");emit(e.type)}function emitJSDocOptionalType(e){emit(e.type);writePunctuation("=")}function emitConstructorType(e){emitModifierList(e,e.modifiers);writeKeyword("new");writeSpace();emitSignatureAndBody(e,emitFunctionTypeHead,emitFunctionTypeBody)}function emitTypeQuery(e){writeKeyword("typeof");writeSpace();emit(e.exprName);emitTypeArguments(e,e.typeArguments)}function emitTypeLiteral(e){pushNameGenerationScope(e);forEach(e.members,generateMemberNames);writePunctuation("{");const t=getEmitFlags(e)&1?768:32897;emitList(e,e.members,t|524288);writePunctuation("}");popNameGenerationScope(e)}function emitArrayType(e){emit(e.elementType,ne.parenthesizeNonArrayTypeOfPostfixType);writePunctuation("[");writePunctuation("]")}function emitRestOrJSDocVariadicType(e){writePunctuation("...");emit(e.type)}function emitTupleType(e){emitTokenWithComment(23,e.pos,writePunctuation,e);const t=getEmitFlags(e)&1?528:657;emitList(e,e.elements,t|524288,ne.parenthesizeElementTypeOfTupleType);emitTokenWithComment(24,e.elements.end,writePunctuation,e)}function emitNamedTupleMember(e){emit(e.dotDotDotToken);emit(e.name);emit(e.questionToken);emitTokenWithComment(59,e.name.end,writePunctuation,e);writeSpace();emit(e.type)}function emitOptionalType(e){emit(e.type,ne.parenthesizeTypeOfOptionalType);writePunctuation("?")}function emitUnionType(e){emitList(e,e.types,516,ne.parenthesizeConstituentTypeOfUnionType)}function emitIntersectionType(e){emitList(e,e.types,520,ne.parenthesizeConstituentTypeOfIntersectionType)}function emitConditionalType(e){emit(e.checkType,ne.parenthesizeCheckTypeOfConditionalType);writeSpace();writeKeyword("extends");writeSpace();emit(e.extendsType,ne.parenthesizeExtendsTypeOfConditionalType);writeSpace();writePunctuation("?");writeSpace();emit(e.trueType);writeSpace();writePunctuation(":");writeSpace();emit(e.falseType)}function emitInferType(e){writeKeyword("infer");writeSpace();emit(e.typeParameter)}function emitParenthesizedType(e){writePunctuation("(");emit(e.type);writePunctuation(")")}function emitThisType(){writeKeyword("this")}function emitTypeOperator(e){writeTokenText(e.operator,writeKeyword);writeSpace();const t=e.operator===148?ne.parenthesizeOperandOfReadonlyTypeOperator:ne.parenthesizeOperandOfTypeOperator;emit(e.type,t)}function emitIndexedAccessType(e){emit(e.objectType,ne.parenthesizeNonArrayTypeOfPostfixType);writePunctuation("[");emit(e.indexType);writePunctuation("]")}function emitMappedType(e){const t=getEmitFlags(e);writePunctuation("{");if(t&1){writeSpace()}else{writeLine();increaseIndent()}if(e.readonlyToken){emit(e.readonlyToken);if(e.readonlyToken.kind!==148){writeKeyword("readonly")}writeSpace()}writePunctuation("[");pipelineEmit(3,e.typeParameter);if(e.nameType){writeSpace();writeKeyword("as");writeSpace();emit(e.nameType)}writePunctuation("]");if(e.questionToken){emit(e.questionToken);if(e.questionToken.kind!==58){writePunctuation("?")}}writePunctuation(":");writeSpace();emit(e.type);writeTrailingSemicolon();if(t&1){writeSpace()}else{writeLine();decreaseIndent()}emitList(e,e.members,2);writePunctuation("}")}function emitLiteralType(e){emitExpression(e.literal)}function emitTemplateType(e){emit(e.head);emitList(e,e.templateSpans,262144)}function emitImportTypeNode(e){if(e.isTypeOf){writeKeyword("typeof");writeSpace()}writeKeyword("import");writePunctuation("(");emit(e.argument);if(e.attributes){writePunctuation(",");writeSpace();pipelineEmit(7,e.attributes)}writePunctuation(")");if(e.qualifier){writePunctuation(".");emit(e.qualifier)}emitTypeArguments(e,e.typeArguments)}function emitObjectBindingPattern(e){writePunctuation("{");emitList(e,e.elements,525136);writePunctuation("}")}function emitArrayBindingPattern(e){writePunctuation("[");emitList(e,e.elements,524880);writePunctuation("]")}function emitBindingElement(e){emit(e.dotDotDotToken);if(e.propertyName){emit(e.propertyName);writePunctuation(":");writeSpace()}emit(e.name);emitInitializer(e.initializer,e.name.end,e,ne.parenthesizeExpressionForDisallowedComma)}function emitArrayLiteralExpression(e){const t=e.elements;const n=e.multiLine?65536:0;emitExpressionList(e,t,8914|n,ne.parenthesizeExpressionForDisallowedComma)}function emitObjectLiteralExpression(e){pushNameGenerationScope(e);forEach(e.properties,generateMemberNames);const t=getEmitFlags(e)&131072;if(t){increaseIndent()}const n=e.multiLine?65536:0;const r=y&&y.languageVersion>=1&&!isJsonSourceFile(y)?64:0;emitList(e,e.properties,526226|r|n);if(t){decreaseIndent()}popNameGenerationScope(e)}function emitPropertyAccessExpression(e){emitExpression(e.expression,ne.parenthesizeLeftSideOfAccess);const t=e.questionDotToken||setTextRangePosEnd(zr.createToken(25),e.expression.end,e.name.pos);const n=getLinesBetweenNodes(e,e.expression,t);const r=getLinesBetweenNodes(e,t,e.name);writeLinesAndIndent(n,false);const i=t.kind!==29&&mayNeedDotDotForPropertyAccess(e.expression)&&!L.hasTrailingComment()&&!L.hasTrailingWhitespace();if(i){writePunctuation(".")}if(e.questionDotToken){emit(t)}else{emitTokenWithComment(t.kind,e.expression.end,writePunctuation,e)}writeLinesAndIndent(r,false);emit(e.name);decreaseIndentIf(n,r)}function mayNeedDotDotForPropertyAccess(e){e=skipPartiallyEmittedExpressions(e);if(isNumericLiteral(e)){const t=getLiteralTextOfNode(e,void 0,true,false);return!(e.numericLiteralFlags&448)&&!t.includes(tokenToString(25))&&!t.includes(String.fromCharCode(69))&&!t.includes(String.fromCharCode(101))}else if(isAccessExpression(e)){const t=getConstantValue(e);return typeof t==="number"&&isFinite(t)&&t>=0&&Math.floor(t)===t}}function emitElementAccessExpression(e){emitExpression(e.expression,ne.parenthesizeLeftSideOfAccess);emit(e.questionDotToken);emitTokenWithComment(23,e.expression.end,writePunctuation,e);emitExpression(e.argumentExpression);emitTokenWithComment(24,e.argumentExpression.end,writePunctuation,e)}function emitCallExpression(e){const t=getInternalEmitFlags(e)&16;if(t){writePunctuation("(");writeLiteral("0");writePunctuation(",");writeSpace()}emitExpression(e.expression,ne.parenthesizeLeftSideOfAccess);if(t){writePunctuation(")")}emit(e.questionDotToken);emitTypeArguments(e,e.typeArguments);emitExpressionList(e,e.arguments,2576,ne.parenthesizeExpressionForDisallowedComma)}function emitNewExpression(e){emitTokenWithComment(105,e.pos,writeKeyword,e);writeSpace();emitExpression(e.expression,ne.parenthesizeExpressionOfNew);emitTypeArguments(e,e.typeArguments);emitExpressionList(e,e.arguments,18960,ne.parenthesizeExpressionForDisallowedComma)}function emitTaggedTemplateExpression(e){const t=getInternalEmitFlags(e)&16;if(t){writePunctuation("(");writeLiteral("0");writePunctuation(",");writeSpace()}emitExpression(e.tag,ne.parenthesizeLeftSideOfAccess);if(t){writePunctuation(")")}emitTypeArguments(e,e.typeArguments);writeSpace();emitExpression(e.template)}function emitTypeAssertionExpression(e){writePunctuation("<");emit(e.type);writePunctuation(">");emitExpression(e.expression,ne.parenthesizeOperandOfPrefixUnary)}function emitParenthesizedExpression(e){const t=emitTokenWithComment(21,e.pos,writePunctuation,e);const n=writeLineSeparatorsAndIndentBefore(e.expression,e);emitExpression(e.expression,void 0);writeLineSeparatorsAfter(e.expression,e);decreaseIndentIf(n);emitTokenWithComment(22,e.expression?e.expression.end:t,writePunctuation,e)}function emitFunctionExpression(e){generateNameIfNeeded(e.name);emitFunctionDeclarationOrExpression(e)}function emitArrowFunction(e){emitModifierList(e,e.modifiers);emitSignatureAndBody(e,emitArrowFunctionHead,emitArrowFunctionBody)}function emitArrowFunctionHead(e){emitTypeParameters(e,e.typeParameters);emitParametersForArrow(e,e.parameters);emitTypeAnnotation(e.type);writeSpace();emit(e.equalsGreaterThanToken)}function emitArrowFunctionBody(e){if(isBlock(e.body)){emitBlockFunctionBody(e.body)}else{writeSpace();emitExpression(e.body,ne.parenthesizeConciseBodyOfArrowFunction)}}function emitDeleteExpression(e){emitTokenWithComment(91,e.pos,writeKeyword,e);writeSpace();emitExpression(e.expression,ne.parenthesizeOperandOfPrefixUnary)}function emitTypeOfExpression(e){emitTokenWithComment(114,e.pos,writeKeyword,e);writeSpace();emitExpression(e.expression,ne.parenthesizeOperandOfPrefixUnary)}function emitVoidExpression(e){emitTokenWithComment(116,e.pos,writeKeyword,e);writeSpace();emitExpression(e.expression,ne.parenthesizeOperandOfPrefixUnary)}function emitAwaitExpression(e){emitTokenWithComment(135,e.pos,writeKeyword,e);writeSpace();emitExpression(e.expression,ne.parenthesizeOperandOfPrefixUnary)}function emitPrefixUnaryExpression(e){writeTokenText(e.operator,writeOperator);if(shouldEmitWhitespaceBeforeOperand(e)){writeSpace()}emitExpression(e.operand,ne.parenthesizeOperandOfPrefixUnary)}function shouldEmitWhitespaceBeforeOperand(e){const t=e.operand;return t.kind===224&&(e.operator===40&&(t.operator===40||t.operator===46)||e.operator===41&&(t.operator===41||t.operator===47))}function emitPostfixUnaryExpression(e){emitExpression(e.operand,ne.parenthesizeOperandOfPostfixUnary);writeTokenText(e.operator,writeOperator)}function createEmitBinaryExpression(){return createBinaryExpressionTrampoline(onEnter,onLeft,onOperator,onRight,onExit,void 0);function onEnter(e,t){if(t){t.stackIndex++;t.preserveSourceNewlinesStack[t.stackIndex]=O;t.containerPosStack[t.stackIndex]=q;t.containerEndStack[t.stackIndex]=H;t.declarationListContainerEndStack[t.stackIndex]=G;const n=t.shouldEmitCommentsStack[t.stackIndex]=shouldEmitComments(e);const r=t.shouldEmitSourceMapsStack[t.stackIndex]=shouldEmitSourceMaps(e);a==null?void 0:a(e);if(n)emitCommentsBeforeNode(e);if(r)emitSourceMapsBeforeNode(e);beforeEmitNode(e)}else{t={stackIndex:0,preserveSourceNewlinesStack:[void 0],containerPosStack:[-1],containerEndStack:[-1],declarationListContainerEndStack:[-1],shouldEmitCommentsStack:[false],shouldEmitSourceMapsStack:[false]}}return t}function onLeft(e,t,n){return maybeEmitExpression(e,n,"left")}function onOperator(e,t,n){const r=e.kind!==28;const i=getLinesBetweenNodes(n,n.left,e);const o=getLinesBetweenNodes(n,e,n.right);writeLinesAndIndent(i,r);emitLeadingCommentsOfPosition(e.pos);writeTokenNode(e,e.kind===103?writeKeyword:writeOperator);emitTrailingCommentsOfPosition(e.end,true);writeLinesAndIndent(o,true)}function onRight(e,t,n){return maybeEmitExpression(e,n,"right")}function onExit(e,t){const n=getLinesBetweenNodes(e,e.left,e.operatorToken);const r=getLinesBetweenNodes(e,e.operatorToken,e.right);decreaseIndentIf(n,r);if(t.stackIndex>0){const n=t.preserveSourceNewlinesStack[t.stackIndex];const r=t.containerPosStack[t.stackIndex];const i=t.containerEndStack[t.stackIndex];const o=t.declarationListContainerEndStack[t.stackIndex];const a=t.shouldEmitCommentsStack[t.stackIndex];const c=t.shouldEmitSourceMapsStack[t.stackIndex];afterEmitNode(n);if(c)emitSourceMapsAfterNode(e);if(a)emitCommentsAfterNode(e,r,i,o);s==null?void 0:s(e);t.stackIndex--}}function maybeEmitExpression(e,t,n){const r=n==="left"?ne.getParenthesizeLeftSideOfBinaryForOperator(t.operatorToken.kind):ne.getParenthesizeRightSideOfBinaryForOperator(t.operatorToken.kind);let i=getPipelinePhase(0,1,e);if(i===pipelineEmitWithSubstitution){S.assertIsDefined(Y);e=r(cast(Y,isExpression));i=getNextPipelinePhase(1,1,e);Y=void 0}if(i===pipelineEmitWithComments||i===pipelineEmitWithSourceMaps||i===pipelineEmitWithHint){if(isBinaryExpression(e)){return e}}Z=r;i(1,e)}}function emitConditionalExpression(e){const t=getLinesBetweenNodes(e,e.condition,e.questionToken);const n=getLinesBetweenNodes(e,e.questionToken,e.whenTrue);const r=getLinesBetweenNodes(e,e.whenTrue,e.colonToken);const i=getLinesBetweenNodes(e,e.colonToken,e.whenFalse);emitExpression(e.condition,ne.parenthesizeConditionOfConditionalExpression);writeLinesAndIndent(t,true);emit(e.questionToken);writeLinesAndIndent(n,true);emitExpression(e.whenTrue,ne.parenthesizeBranchOfConditionalExpression);decreaseIndentIf(t,n);writeLinesAndIndent(r,true);emit(e.colonToken);writeLinesAndIndent(i,true);emitExpression(e.whenFalse,ne.parenthesizeBranchOfConditionalExpression);decreaseIndentIf(r,i)}function emitTemplateExpression(e){emit(e.head);emitList(e,e.templateSpans,262144)}function emitYieldExpression(e){emitTokenWithComment(127,e.pos,writeKeyword,e);emit(e.asteriskToken);emitExpressionWithLeadingSpace(e.expression&&parenthesizeExpressionForNoAsi(e.expression),parenthesizeExpressionForNoAsiAndDisallowedComma)}function emitSpreadElement(e){emitTokenWithComment(26,e.pos,writePunctuation,e);emitExpression(e.expression,ne.parenthesizeExpressionForDisallowedComma)}function emitClassExpression(e){generateNameIfNeeded(e.name);emitClassDeclarationOrExpression(e)}function emitExpressionWithTypeArguments(e){emitExpression(e.expression,ne.parenthesizeLeftSideOfAccess);emitTypeArguments(e,e.typeArguments)}function emitAsExpression(e){emitExpression(e.expression,void 0);if(e.type){writeSpace();writeKeyword("as");writeSpace();emit(e.type)}}function emitNonNullExpression(e){emitExpression(e.expression,ne.parenthesizeLeftSideOfAccess);writeOperator("!")}function emitSatisfiesExpression(e){emitExpression(e.expression,void 0);if(e.type){writeSpace();writeKeyword("satisfies");writeSpace();emit(e.type)}}function emitMetaProperty(e){writeToken(e.keywordToken,e.pos,writePunctuation);writePunctuation(".");emit(e.name)}function emitTemplateSpan(e){emitExpression(e.expression);emit(e.literal)}function emitBlock(e){emitBlockStatements(e,!e.multiLine&&isEmptyBlock(e))}function emitBlockStatements(e,t){emitTokenWithComment(19,e.pos,writePunctuation,e);const n=t||getEmitFlags(e)&1?768:129;emitList(e,e.statements,n);emitTokenWithComment(20,e.statements.end,writePunctuation,e,!!(n&1))}function emitVariableStatement(e){emitDecoratorsAndModifiers(e,e.modifiers,false);emit(e.declarationList);writeTrailingSemicolon()}function emitEmptyStatement(e){if(e){writePunctuation(";")}else{writeTrailingSemicolon()}}function emitExpressionStatement(e){emitExpression(e.expression,ne.parenthesizeExpressionOfExpressionStatement);if(!y||!isJsonSourceFile(y)||nodeIsSynthesized(e.expression)){writeTrailingSemicolon()}}function emitIfStatement(e){const t=emitTokenWithComment(101,e.pos,writeKeyword,e);writeSpace();emitTokenWithComment(21,t,writePunctuation,e);emitExpression(e.expression);emitTokenWithComment(22,e.expression.end,writePunctuation,e);emitEmbeddedStatement(e,e.thenStatement);if(e.elseStatement){writeLineOrSpace(e,e.thenStatement,e.elseStatement);emitTokenWithComment(93,e.thenStatement.end,writeKeyword,e);if(e.elseStatement.kind===245){writeSpace();emit(e.elseStatement)}else{emitEmbeddedStatement(e,e.elseStatement)}}}function emitWhileClause(e,t){const n=emitTokenWithComment(117,t,writeKeyword,e);writeSpace();emitTokenWithComment(21,n,writePunctuation,e);emitExpression(e.expression);emitTokenWithComment(22,e.expression.end,writePunctuation,e)}function emitDoStatement(e){emitTokenWithComment(92,e.pos,writeKeyword,e);emitEmbeddedStatement(e,e.statement);if(isBlock(e.statement)&&!O){writeSpace()}else{writeLineOrSpace(e,e.statement,e.expression)}emitWhileClause(e,e.statement.end);writeTrailingSemicolon()}function emitWhileStatement(e){emitWhileClause(e,e.pos);emitEmbeddedStatement(e,e.statement)}function emitForStatement(e){const t=emitTokenWithComment(99,e.pos,writeKeyword,e);writeSpace();let n=emitTokenWithComment(21,t,writePunctuation,e);emitForBinding(e.initializer);n=emitTokenWithComment(27,e.initializer?e.initializer.end:n,writePunctuation,e);emitExpressionWithLeadingSpace(e.condition);n=emitTokenWithComment(27,e.condition?e.condition.end:n,writePunctuation,e);emitExpressionWithLeadingSpace(e.incrementor);emitTokenWithComment(22,e.incrementor?e.incrementor.end:n,writePunctuation,e);emitEmbeddedStatement(e,e.statement)}function emitForInStatement(e){const t=emitTokenWithComment(99,e.pos,writeKeyword,e);writeSpace();emitTokenWithComment(21,t,writePunctuation,e);emitForBinding(e.initializer);writeSpace();emitTokenWithComment(103,e.initializer.end,writeKeyword,e);writeSpace();emitExpression(e.expression);emitTokenWithComment(22,e.expression.end,writePunctuation,e);emitEmbeddedStatement(e,e.statement)}function emitForOfStatement(e){const t=emitTokenWithComment(99,e.pos,writeKeyword,e);writeSpace();emitWithTrailingSpace(e.awaitModifier);emitTokenWithComment(21,t,writePunctuation,e);emitForBinding(e.initializer);writeSpace();emitTokenWithComment(165,e.initializer.end,writeKeyword,e);writeSpace();emitExpression(e.expression);emitTokenWithComment(22,e.expression.end,writePunctuation,e);emitEmbeddedStatement(e,e.statement)}function emitForBinding(e){if(e!==void 0){if(e.kind===261){emit(e)}else{emitExpression(e)}}}function emitContinueStatement(e){emitTokenWithComment(88,e.pos,writeKeyword,e);emitWithLeadingSpace(e.label);writeTrailingSemicolon()}function emitBreakStatement(e){emitTokenWithComment(83,e.pos,writeKeyword,e);emitWithLeadingSpace(e.label);writeTrailingSemicolon()}function emitTokenWithComment(e,t,n,r,i){const o=getParseTreeNode(r);const a=o&&o.kind===r.kind;const s=t;if(a&&y){t=skipTrivia(y.text,t)}if(a&&r.pos!==s){const e=i&&y&&!positionsAreOnSameLine(s,t,y);if(e){increaseIndent()}emitLeadingCommentsOfPosition(s);if(e){decreaseIndent()}}if(!f&&(e===19||e===20)){t=writeToken(e,t,n,r)}else{t=writeTokenText(e,n,t)}if(a&&r.end!==t){const e=r.kind===294;emitTrailingCommentsOfPosition(t,!e,e)}return t}function commentWillEmitNewLine(e){return e.kind===2||!!e.hasTrailingNewLine}function willEmitLeadingNewLine(e){if(!y)return false;const t=getLeadingCommentRanges(y.text,e.pos);if(t){const t=getParseTreeNode(e);if(t&&isParenthesizedExpression(t.parent)){return true}}if(some(t,commentWillEmitNewLine))return true;if(some(getSyntheticLeadingComments(e),commentWillEmitNewLine))return true;if(isPartiallyEmittedExpression(e)){if(e.pos!==e.expression.pos){if(some(getTrailingCommentRanges(y.text,e.expression.pos),commentWillEmitNewLine))return true}return willEmitLeadingNewLine(e.expression)}return false}function parenthesizeExpressionForNoAsi(e){if(!X){switch(e.kind){case 355:if(willEmitLeadingNewLine(e)){const t=getParseTreeNode(e);if(t&&isParenthesizedExpression(t)){const n=zr.createParenthesizedExpression(e.expression);setOriginalNode(n,e);setTextRange(n,t);return n}return zr.createParenthesizedExpression(e)}return zr.updatePartiallyEmittedExpression(e,parenthesizeExpressionForNoAsi(e.expression));case 211:return zr.updatePropertyAccessExpression(e,parenthesizeExpressionForNoAsi(e.expression),e.name);case 212:return zr.updateElementAccessExpression(e,parenthesizeExpressionForNoAsi(e.expression),e.argumentExpression);case 213:return zr.updateCallExpression(e,parenthesizeExpressionForNoAsi(e.expression),e.typeArguments,e.arguments);case 215:return zr.updateTaggedTemplateExpression(e,parenthesizeExpressionForNoAsi(e.tag),e.typeArguments,e.template);case 225:return zr.updatePostfixUnaryExpression(e,parenthesizeExpressionForNoAsi(e.operand));case 226:return zr.updateBinaryExpression(e,parenthesizeExpressionForNoAsi(e.left),e.operatorToken,e.right);case 227:return zr.updateConditionalExpression(e,parenthesizeExpressionForNoAsi(e.condition),e.questionToken,e.whenTrue,e.colonToken,e.whenFalse);case 234:return zr.updateAsExpression(e,parenthesizeExpressionForNoAsi(e.expression),e.type);case 238:return zr.updateSatisfiesExpression(e,parenthesizeExpressionForNoAsi(e.expression),e.type);case 235:return zr.updateNonNullExpression(e,parenthesizeExpressionForNoAsi(e.expression))}}return e}function parenthesizeExpressionForNoAsiAndDisallowedComma(e){return parenthesizeExpressionForNoAsi(ne.parenthesizeExpressionForDisallowedComma(e))}function emitReturnStatement(e){emitTokenWithComment(107,e.pos,writeKeyword,e);emitExpressionWithLeadingSpace(e.expression&&parenthesizeExpressionForNoAsi(e.expression),parenthesizeExpressionForNoAsi);writeTrailingSemicolon()}function emitWithStatement(e){const t=emitTokenWithComment(118,e.pos,writeKeyword,e);writeSpace();emitTokenWithComment(21,t,writePunctuation,e);emitExpression(e.expression);emitTokenWithComment(22,e.expression.end,writePunctuation,e);emitEmbeddedStatement(e,e.statement)}function emitSwitchStatement(e){const t=emitTokenWithComment(109,e.pos,writeKeyword,e);writeSpace();emitTokenWithComment(21,t,writePunctuation,e);emitExpression(e.expression);emitTokenWithComment(22,e.expression.end,writePunctuation,e);writeSpace();emit(e.caseBlock)}function emitLabeledStatement(e){emit(e.label);emitTokenWithComment(59,e.label.end,writePunctuation,e);writeSpace();emit(e.statement)}function emitThrowStatement(e){emitTokenWithComment(111,e.pos,writeKeyword,e);emitExpressionWithLeadingSpace(parenthesizeExpressionForNoAsi(e.expression),parenthesizeExpressionForNoAsi);writeTrailingSemicolon()}function emitTryStatement(e){emitTokenWithComment(113,e.pos,writeKeyword,e);writeSpace();emit(e.tryBlock);if(e.catchClause){writeLineOrSpace(e,e.tryBlock,e.catchClause);emit(e.catchClause)}if(e.finallyBlock){writeLineOrSpace(e,e.catchClause||e.tryBlock,e.finallyBlock);emitTokenWithComment(98,(e.catchClause||e.tryBlock).end,writeKeyword,e);writeSpace();emit(e.finallyBlock)}}function emitDebuggerStatement(e){writeToken(89,e.pos,writeKeyword);writeTrailingSemicolon()}function emitVariableDeclaration(e){var t,n,r;emit(e.name);emit(e.exclamationToken);emitTypeAnnotation(e.type);emitInitializer(e.initializer,((t=e.type)==null?void 0:t.end)??((r=(n=e.name.emitNode)==null?void 0:n.typeNode)==null?void 0:r.end)??e.name.end,e,ne.parenthesizeExpressionForDisallowedComma)}function emitVariableDeclarationList(e){if(isVarAwaitUsing(e)){writeKeyword("await");writeSpace();writeKeyword("using")}else{const t=isLet(e)?"let":isVarConst(e)?"const":isVarUsing(e)?"using":"var";writeKeyword(t)}writeSpace();emitList(e,e.declarations,528)}function emitFunctionDeclaration(e){emitFunctionDeclarationOrExpression(e)}function emitFunctionDeclarationOrExpression(e){emitDecoratorsAndModifiers(e,e.modifiers,false);writeKeyword("function");emit(e.asteriskToken);writeSpace();emitIdentifierName(e.name);emitSignatureAndBody(e,emitSignatureHead,emitFunctionBody)}function emitSignatureAndBody(e,t,n){const r=getEmitFlags(e)&131072;if(r){increaseIndent()}pushNameGenerationScope(e);forEach(e.parameters,generateNames);t(e);n(e);popNameGenerationScope(e);if(r){decreaseIndent()}}function emitFunctionBody(e){const t=e.body;if(t){emitBlockFunctionBody(t)}else{writeTrailingSemicolon()}}function emitEmptyFunctionBody(e){writeTrailingSemicolon()}function emitSignatureHead(e){emitTypeParameters(e,e.typeParameters);emitParameters(e,e.parameters);emitTypeAnnotation(e.type)}function shouldEmitBlockFunctionBodyOnSingleLine(e){if(getEmitFlags(e)&1){return true}if(e.multiLine){return false}if(!nodeIsSynthesized(e)&&y&&!rangeIsOnSingleLine(e,y)){return false}if(getLeadingLineTerminatorCount(e,firstOrUndefined(e.statements),2)||getClosingLineTerminatorCount(e,lastOrUndefined(e.statements),2,e.statements)){return false}let t;for(const n of e.statements){if(getSeparatingLineTerminatorCount(t,n,2)>0){return false}t=n}return true}function emitBlockFunctionBody(e){generateNames(e);a==null?void 0:a(e);writeSpace();writePunctuation("{");increaseIndent();const t=shouldEmitBlockFunctionBodyOnSingleLine(e)?emitBlockFunctionBodyOnSingleLine:emitBlockFunctionBodyWorker;emitBodyWithDetachedComments(e,e.statements,t);decreaseIndent();writeToken(20,e.statements.end,writePunctuation,e);s==null?void 0:s(e)}function emitBlockFunctionBodyOnSingleLine(e){emitBlockFunctionBodyWorker(e,true)}function emitBlockFunctionBodyWorker(e,t){const n=emitPrologueDirectives(e.statements);const r=L.getTextPos();emitHelpers(e);if(n===0&&r===L.getTextPos()&&t){decreaseIndent();emitList(e,e.statements,768);increaseIndent()}else{emitList(e,e.statements,1,void 0,n)}}function emitClassDeclaration(e){emitClassDeclarationOrExpression(e)}function emitClassDeclarationOrExpression(e){emitDecoratorsAndModifiers(e,e.modifiers,true);emitTokenWithComment(86,moveRangePastModifiers(e).pos,writeKeyword,e);if(e.name){writeSpace();emitIdentifierName(e.name)}const t=getEmitFlags(e)&131072;if(t){increaseIndent()}emitTypeParameters(e,e.typeParameters);emitList(e,e.heritageClauses,0);writeSpace();writePunctuation("{");pushNameGenerationScope(e);forEach(e.members,generateMemberNames);emitList(e,e.members,129);popNameGenerationScope(e);writePunctuation("}");if(t){decreaseIndent()}}function emitInterfaceDeclaration(e){emitDecoratorsAndModifiers(e,e.modifiers,false);writeKeyword("interface");writeSpace();emit(e.name);emitTypeParameters(e,e.typeParameters);emitList(e,e.heritageClauses,512);writeSpace();writePunctuation("{");pushNameGenerationScope(e);forEach(e.members,generateMemberNames);emitList(e,e.members,129);popNameGenerationScope(e);writePunctuation("}")}function emitTypeAliasDeclaration(e){emitDecoratorsAndModifiers(e,e.modifiers,false);writeKeyword("type");writeSpace();emit(e.name);emitTypeParameters(e,e.typeParameters);writeSpace();writePunctuation("=");writeSpace();emit(e.type);writeTrailingSemicolon()}function emitEnumDeclaration(e){emitDecoratorsAndModifiers(e,e.modifiers,false);writeKeyword("enum");writeSpace();emit(e.name);writeSpace();writePunctuation("{");emitList(e,e.members,145);writePunctuation("}")}function emitModuleDeclaration(e){emitDecoratorsAndModifiers(e,e.modifiers,false);if(~e.flags&2048){writeKeyword(e.flags&32?"namespace":"module");writeSpace()}emit(e.name);let t=e.body;if(!t)return writeTrailingSemicolon();while(t&&isModuleDeclaration(t)){writePunctuation(".");emit(t.name);t=t.body}writeSpace();emit(t)}function emitModuleBlock(e){pushNameGenerationScope(e);forEach(e.statements,generateNames);emitBlockStatements(e,isEmptyBlock(e));popNameGenerationScope(e)}function emitCaseBlock(e){emitTokenWithComment(19,e.pos,writePunctuation,e);emitList(e,e.clauses,129);emitTokenWithComment(20,e.clauses.end,writePunctuation,e,true)}function emitImportEqualsDeclaration(e){emitDecoratorsAndModifiers(e,e.modifiers,false);emitTokenWithComment(102,e.modifiers?e.modifiers.end:e.pos,writeKeyword,e);writeSpace();if(e.isTypeOnly){emitTokenWithComment(156,e.pos,writeKeyword,e);writeSpace()}emit(e.name);writeSpace();emitTokenWithComment(64,e.name.end,writePunctuation,e);writeSpace();emitModuleReference(e.moduleReference);writeTrailingSemicolon()}function emitModuleReference(e){if(e.kind===80){emitExpression(e)}else{emit(e)}}function emitImportDeclaration(e){emitDecoratorsAndModifiers(e,e.modifiers,false);emitTokenWithComment(102,e.modifiers?e.modifiers.end:e.pos,writeKeyword,e);writeSpace();if(e.importClause){emit(e.importClause);writeSpace();emitTokenWithComment(161,e.importClause.end,writeKeyword,e);writeSpace()}emitExpression(e.moduleSpecifier);if(e.attributes){emitWithLeadingSpace(e.attributes)}writeTrailingSemicolon()}function emitImportClause(e){if(e.isTypeOnly){emitTokenWithComment(156,e.pos,writeKeyword,e);writeSpace()}emit(e.name);if(e.name&&e.namedBindings){emitTokenWithComment(28,e.name.end,writePunctuation,e);writeSpace()}emit(e.namedBindings)}function emitNamespaceImport(e){const t=emitTokenWithComment(42,e.pos,writePunctuation,e);writeSpace();emitTokenWithComment(130,t,writeKeyword,e);writeSpace();emit(e.name)}function emitNamedImports(e){emitNamedImportsOrExports(e)}function emitImportSpecifier(e){emitImportOrExportSpecifier(e)}function emitExportAssignment(e){const t=emitTokenWithComment(95,e.pos,writeKeyword,e);writeSpace();if(e.isExportEquals){emitTokenWithComment(64,t,writeOperator,e)}else{emitTokenWithComment(90,t,writeKeyword,e)}writeSpace();emitExpression(e.expression,e.isExportEquals?ne.getParenthesizeRightSideOfBinaryForOperator(64):ne.parenthesizeExpressionOfExportDefault);writeTrailingSemicolon()}function emitExportDeclaration(e){emitDecoratorsAndModifiers(e,e.modifiers,false);let t=emitTokenWithComment(95,e.pos,writeKeyword,e);writeSpace();if(e.isTypeOnly){t=emitTokenWithComment(156,t,writeKeyword,e);writeSpace()}if(e.exportClause){emit(e.exportClause)}else{t=emitTokenWithComment(42,t,writePunctuation,e)}if(e.moduleSpecifier){writeSpace();const n=e.exportClause?e.exportClause.end:t;emitTokenWithComment(161,n,writeKeyword,e);writeSpace();emitExpression(e.moduleSpecifier)}if(e.attributes){emitWithLeadingSpace(e.attributes)}writeTrailingSemicolon()}function emitImportTypeNodeAttributes(e){writePunctuation("{");writeSpace();writeKeyword(e.token===132?"assert":"with");writePunctuation(":");writeSpace();const t=e.elements;emitList(e,t,526226);writeSpace();writePunctuation("}")}function emitImportAttributes(e){emitTokenWithComment(e.token,e.pos,writeKeyword,e);writeSpace();const t=e.elements;emitList(e,t,526226)}function emitImportAttribute(e){emit(e.name);writePunctuation(":");writeSpace();const t=e.value;if((getEmitFlags(t)&1024)===0){const e=getCommentRange(t);emitTrailingCommentsOfPosition(e.pos)}emit(t)}function emitNamespaceExportDeclaration(e){let t=emitTokenWithComment(95,e.pos,writeKeyword,e);writeSpace();t=emitTokenWithComment(130,t,writeKeyword,e);writeSpace();t=emitTokenWithComment(145,t,writeKeyword,e);writeSpace();emit(e.name);writeTrailingSemicolon()}function emitNamespaceExport(e){const t=emitTokenWithComment(42,e.pos,writePunctuation,e);writeSpace();emitTokenWithComment(130,t,writeKeyword,e);writeSpace();emit(e.name)}function emitNamedExports(e){emitNamedImportsOrExports(e)}function emitExportSpecifier(e){emitImportOrExportSpecifier(e)}function emitNamedImportsOrExports(e){writePunctuation("{");emitList(e,e.elements,525136);writePunctuation("}")}function emitImportOrExportSpecifier(e){if(e.isTypeOnly){writeKeyword("type");writeSpace()}if(e.propertyName){emit(e.propertyName);writeSpace();emitTokenWithComment(130,e.propertyName.end,writeKeyword,e);writeSpace()}emit(e.name)}function emitExternalModuleReference(e){writeKeyword("require");writePunctuation("(");emitExpression(e.expression);writePunctuation(")")}function emitJsxElement(e){emit(e.openingElement);emitList(e,e.children,262144);emit(e.closingElement)}function emitJsxSelfClosingElement(e){writePunctuation("<");emitJsxTagName(e.tagName);emitTypeArguments(e,e.typeArguments);writeSpace();emit(e.attributes);writePunctuation("/>")}function emitJsxFragment(e){emit(e.openingFragment);emitList(e,e.children,262144);emit(e.closingFragment)}function emitJsxOpeningElementOrFragment(e){writePunctuation("<");if(isJsxOpeningElement(e)){const t=writeLineSeparatorsAndIndentBefore(e.tagName,e);emitJsxTagName(e.tagName);emitTypeArguments(e,e.typeArguments);if(e.attributes.properties&&e.attributes.properties.length>0){writeSpace()}emit(e.attributes);writeLineSeparatorsAfter(e.attributes,e);decreaseIndentIf(t)}writePunctuation(">")}function emitJsxText(e){L.writeLiteral(e.text)}function emitJsxClosingElementOrFragment(e){writePunctuation("")}function emitJsxAttributes(e){emitList(e,e.properties,262656)}function emitJsxAttribute(e){emit(e.name);emitNodeWithPrefix("=",writePunctuation,e.initializer,emitJsxAttributeValue)}function emitJsxSpreadAttribute(e){writePunctuation("{...");emitExpression(e.expression);writePunctuation("}")}function hasTrailingCommentsAtPosition(e){let t=false;forEachTrailingCommentRange((y==null?void 0:y.text)||"",e+1,(()=>t=true));return t}function hasLeadingCommentsAtPosition(e){let t=false;forEachLeadingCommentRange((y==null?void 0:y.text)||"",e+1,(()=>t=true));return t}function hasCommentsAtPosition(e){return hasTrailingCommentsAtPosition(e)||hasLeadingCommentsAtPosition(e)}function emitJsxExpression(e){var t;if(e.expression||!X&&!nodeIsSynthesized(e)&&hasCommentsAtPosition(e.pos)){const n=y&&!nodeIsSynthesized(e)&&getLineAndCharacterOfPosition(y,e.pos).line!==getLineAndCharacterOfPosition(y,e.end).line;if(n){L.increaseIndent()}const r=emitTokenWithComment(19,e.pos,writePunctuation,e);emit(e.dotDotDotToken);emitExpression(e.expression);emitTokenWithComment(20,((t=e.expression)==null?void 0:t.end)||r,writePunctuation,e);if(n){L.decreaseIndent()}}}function emitJsxNamespacedName(e){emitIdentifierName(e.namespace);writePunctuation(":");emitIdentifierName(e.name)}function emitJsxTagName(e){if(e.kind===80){emitExpression(e)}else{emit(e)}}function emitCaseClause(e){emitTokenWithComment(84,e.pos,writeKeyword,e);writeSpace();emitExpression(e.expression,ne.parenthesizeExpressionForDisallowedComma);emitCaseOrDefaultClauseRest(e,e.statements,e.expression.end)}function emitDefaultClause(e){const t=emitTokenWithComment(90,e.pos,writeKeyword,e);emitCaseOrDefaultClauseRest(e,e.statements,t)}function emitCaseOrDefaultClauseRest(e,t,n){const r=t.length===1&&(!y||nodeIsSynthesized(e)||nodeIsSynthesized(t[0])||rangeStartPositionsAreOnSameLine(e,t[0],y));let i=163969;if(r){writeToken(59,n,writePunctuation,e);writeSpace();i&=~(1|128)}else{emitTokenWithComment(59,n,writePunctuation,e)}emitList(e,t,i)}function emitHeritageClause(e){writeSpace();writeTokenText(e.token,writeKeyword);writeSpace();emitList(e,e.types,528)}function emitCatchClause(e){const t=emitTokenWithComment(85,e.pos,writeKeyword,e);writeSpace();if(e.variableDeclaration){emitTokenWithComment(21,t,writePunctuation,e);emit(e.variableDeclaration);emitTokenWithComment(22,e.variableDeclaration.end,writePunctuation,e);writeSpace()}emit(e.block)}function emitPropertyAssignment(e){emit(e.name);writePunctuation(":");writeSpace();const t=e.initializer;if((getEmitFlags(t)&1024)===0){const e=getCommentRange(t);emitTrailingCommentsOfPosition(e.pos)}emitExpression(t,ne.parenthesizeExpressionForDisallowedComma)}function emitShorthandPropertyAssignment(e){emit(e.name);if(e.objectAssignmentInitializer){writeSpace();writePunctuation("=");writeSpace();emitExpression(e.objectAssignmentInitializer,ne.parenthesizeExpressionForDisallowedComma)}}function emitSpreadAssignment(e){if(e.expression){emitTokenWithComment(26,e.pos,writePunctuation,e);emitExpression(e.expression,ne.parenthesizeExpressionForDisallowedComma)}}function emitEnumMember(e){emit(e.name);emitInitializer(e.initializer,e.name.end,e,ne.parenthesizeExpressionForDisallowedComma)}function emitJSDoc(e){R("/**");if(e.comment){const t=getTextOfJSDocComment(e.comment);if(t){const e=t.split(/\r\n?|\n/);for(const t of e){writeLine();writeSpace();writePunctuation("*");writeSpace();R(t)}}}if(e.tags){if(e.tags.length===1&&e.tags[0].kind===344&&!e.comment){writeSpace();emit(e.tags[0])}else{emitList(e,e.tags,33)}}writeSpace();R("*/")}function emitJSDocSimpleTypedTag(e){emitJSDocTagName(e.tagName);emitJSDocTypeExpression(e.typeExpression);emitJSDocComment(e.comment)}function emitJSDocSeeTag(e){emitJSDocTagName(e.tagName);emit(e.name);emitJSDocComment(e.comment)}function emitJSDocImportTag(e){emitJSDocTagName(e.tagName);writeSpace();if(e.importClause){emit(e.importClause);writeSpace();emitTokenWithComment(161,e.importClause.end,writeKeyword,e);writeSpace()}emitExpression(e.moduleSpecifier);if(e.attributes){emitWithLeadingSpace(e.attributes)}emitJSDocComment(e.comment)}function emitJSDocNameReference(e){writeSpace();writePunctuation("{");emit(e.name);writePunctuation("}")}function emitJSDocHeritageTag(e){emitJSDocTagName(e.tagName);writeSpace();writePunctuation("{");emit(e.class);writePunctuation("}");emitJSDocComment(e.comment)}function emitJSDocTemplateTag(e){emitJSDocTagName(e.tagName);emitJSDocTypeExpression(e.constraint);writeSpace();emitList(e,e.typeParameters,528);emitJSDocComment(e.comment)}function emitJSDocTypedefTag(e){emitJSDocTagName(e.tagName);if(e.typeExpression){if(e.typeExpression.kind===309){emitJSDocTypeExpression(e.typeExpression)}else{writeSpace();writePunctuation("{");R("Object");if(e.typeExpression.isArrayType){writePunctuation("[");writePunctuation("]")}writePunctuation("}")}}if(e.fullName){writeSpace();emit(e.fullName)}emitJSDocComment(e.comment);if(e.typeExpression&&e.typeExpression.kind===322){emitJSDocTypeLiteral(e.typeExpression)}}function emitJSDocCallbackTag(e){emitJSDocTagName(e.tagName);if(e.name){writeSpace();emit(e.name)}emitJSDocComment(e.comment);emitJSDocSignature(e.typeExpression)}function emitJSDocOverloadTag(e){emitJSDocComment(e.comment);emitJSDocSignature(e.typeExpression)}function emitJSDocSimpleTag(e){emitJSDocTagName(e.tagName);emitJSDocComment(e.comment)}function emitJSDocTypeLiteral(e){emitList(e,zr.createNodeArray(e.jsDocPropertyTags),33)}function emitJSDocSignature(e){if(e.typeParameters){emitList(e,zr.createNodeArray(e.typeParameters),33)}if(e.parameters){emitList(e,zr.createNodeArray(e.parameters),33)}if(e.type){writeLine();writeSpace();writePunctuation("*");writeSpace();emit(e.type)}}function emitJSDocPropertyLikeTag(e){emitJSDocTagName(e.tagName);emitJSDocTypeExpression(e.typeExpression);writeSpace();if(e.isBracketed){writePunctuation("[")}emit(e.name);if(e.isBracketed){writePunctuation("]")}emitJSDocComment(e.comment)}function emitJSDocTagName(e){writePunctuation("@");emit(e)}function emitJSDocComment(e){const t=getTextOfJSDocComment(e);if(t){writeSpace();R(t)}}function emitJSDocTypeExpression(e){if(e){writeSpace();writePunctuation("{");emit(e.type);writePunctuation("}")}}function emitSourceFile(e){writeLine();const t=e.statements;const n=t.length===0||!isPrologueDirective(t[0])||nodeIsSynthesized(t[0]);if(n){emitBodyWithDetachedComments(e,t,emitSourceFileWorker);return}emitSourceFileWorker(e)}function emitSyntheticTripleSlashReferencesIfNeeded(e){emitTripleSlashDirectives(!!e.hasNoDefaultLib,e.syntheticFileReferences||[],e.syntheticTypeReferences||[],e.syntheticLibReferences||[])}function emitTripleSlashDirectivesIfNeeded(e){if(e.isDeclarationFile)emitTripleSlashDirectives(e.hasNoDefaultLib,e.referencedFiles,e.typeReferenceDirectives,e.libReferenceDirectives)}function emitTripleSlashDirectives(e,t,n,r){if(e){writeComment(`/// `);writeLine()}if(y&&y.moduleName){writeComment(`/// `);writeLine()}if(y&&y.amdDependencies){for(const e of y.amdDependencies){if(e.name){writeComment(`/// `)}else{writeComment(`/// `)}writeLine()}}function writeDirectives(e,t){for(const n of t){const t=n.resolutionMode?`resolution-mode="${n.resolutionMode===99?"import":"require"}" `:"";const r=n.preserve?`preserve="true" `:"";writeComment(`/// `);writeLine()}}writeDirectives("path",t);writeDirectives("types",n);writeDirectives("lib",r)}function emitSourceFileWorker(e){const t=e.statements;pushNameGenerationScope(e);forEach(e.statements,generateNames);emitHelpers(e);const n=findIndex(t,(e=>!isPrologueDirective(e)));emitTripleSlashDirectivesIfNeeded(e);emitList(e,t,1,void 0,n===-1?t.length:n);popNameGenerationScope(e)}function emitPartiallyEmittedExpression(e){const t=getEmitFlags(e);if(!(t&1024)&&e.pos!==e.expression.pos){emitTrailingCommentsOfPosition(e.expression.pos)}emitExpression(e.expression);if(!(t&2048)&&e.end!==e.expression.end){emitLeadingCommentsOfPosition(e.expression.end)}}function emitCommaList(e){emitExpressionList(e,e.elements,528,void 0)}function emitPrologueDirectives(e,t,n){let r=!!t;for(let i=0;i=n.length||a===0;if(d&&r&32768){c==null?void 0:c(n);l==null?void 0:l(n);return}if(r&15360){writePunctuation(getOpeningBracket(r));if(d&&n){emitTrailingCommentsOfPosition(n.pos,true)}}c==null?void 0:c(n);if(d){if(r&1&&!(O&&(!t||y&&rangeIsOnSingleLine(t,y)))){writeLine()}else if(r&256&&!(r&524288)){writeSpace()}}else{emitNodeListItems(e,t,n,r,i,o,a,n.hasTrailingComma,n)}l==null?void 0:l(n);if(r&15360){if(d&&n){emitLeadingCommentsOfPosition(n.end)}writePunctuation(getClosingBracket(r))}}function emitNodeListItems(e,t,n,r,i,o,a,s,c){const l=(r&262144)===0;let d=l;const p=getLeadingLineTerminatorCount(t,n[o],r);if(p){writeLine(p);d=false}else if(r&256){writeSpace()}if(r&128){increaseIndent()}const u=getEmitListItem(e,i);let f;let m=false;for(let s=0;s0){if((r&(3|128))===0){increaseIndent();m=true}if(d&&r&60&&!positionIsSynthesized(a.pos)){const e=getCommentRange(a);emitTrailingCommentsOfPosition(e.pos,!!(r&512),true)}writeLine(e);d=false}else if(f&&r&512){writeSpace()}}if(d){const e=getCommentRange(a);emitTrailingCommentsOfPosition(e.pos)}else{d=l}w=a.pos;u(a,e,i,s);if(m){decreaseIndent();m=false}f=a}const _=f?getEmitFlags(f):0;const g=X||!!(_&2048);const y=s&&r&64&&r&16;if(y){if(f&&!g){emitTokenWithComment(28,f.end,writePunctuation,f)}else{writePunctuation(",")}}if(f&&(t?t.end:-1)!==f.end&&r&60&&!g){emitLeadingCommentsOfPosition(y&&(c==null?void 0:c.end)?c.end:f.end)}if(r&128){decreaseIndent()}const h=getClosingLineTerminatorCount(t,n[o+a-1],r,c);if(h){writeLine(h)}else if(r&(2097152|256)){writeSpace()}}function writeLiteral(e){L.writeLiteral(e)}function writeStringLiteral(e){L.writeStringLiteral(e)}function writeBase(e){L.write(e)}function writeSymbol(e,t){L.writeSymbol(e,t)}function writePunctuation(e){L.writePunctuation(e)}function writeTrailingSemicolon(){L.writeTrailingSemicolon(";")}function writeKeyword(e){L.writeKeyword(e)}function writeOperator(e){L.writeOperator(e)}function writeParameter(e){L.writeParameter(e)}function writeComment(e){L.writeComment(e)}function writeSpace(){L.writeSpace(" ")}function writeProperty(e){L.writeProperty(e)}function nonEscapingWrite(e){if(L.nonEscapingWrite){L.nonEscapingWrite(e)}else{L.write(e)}}function writeLine(e=1){for(let t=0;t0)}}function increaseIndent(){L.increaseIndent()}function decreaseIndent(){L.decreaseIndent()}function writeToken(e,t,n,r){return!j?emitTokenWithSourceMap(r,e,n,t,writeTokenText):writeTokenText(e,n,t)}function writeTokenNode(e,t){if(d){d(e)}t(tokenToString(e.kind));if(p){p(e)}}function writeTokenText(e,t,n){const r=tokenToString(e);t(r);return n<0?n:n+r.length}function writeLineOrSpace(e,t,n){if(getEmitFlags(e)&1){writeSpace()}else if(O){const r=getLinesBetweenNodes(e,t,n);if(r){writeLine(r)}else{writeSpace()}}else{writeLine()}}function writeLines(e){const t=e.split(/\r\n?|\n/);const n=guessIndentation(t);for(const e of t){const t=n?e.slice(n):e;if(t.length){writeLine();R(t)}}}function writeLinesAndIndent(e,t){if(e){increaseIndent();writeLine(e)}else if(t){writeSpace()}}function decreaseIndentIf(e,t){if(e){decreaseIndent()}if(t){decreaseIndent()}}function getLeadingLineTerminatorCount(e,t,n){if(n&2||O){if(n&65536){return 1}if(t===void 0){return!e||y&&rangeIsOnSingleLine(e,y)?0:1}if(t.pos===w){return 0}if(t.kind===12){return 0}if(y&&e&&!positionIsSynthesized(e.pos)&&!nodeIsSynthesized(t)&&(!t.parent||getOriginalNode(t.parent)===getOriginalNode(e))){if(O){return getEffectiveLines((n=>getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(t.pos,e.pos,y,n)))}return rangeStartPositionsAreOnSameLine(e,t,y)?0:1}if(synthesizedNodeStartsOnNewLine(t,n)){return 1}}return n&1?1:0}function getSeparatingLineTerminatorCount(e,t,n){if(n&2||O){if(e===void 0||t===void 0){return 0}if(t.kind===12){return 0}else if(y&&!nodeIsSynthesized(e)&&!nodeIsSynthesized(t)){if(O&&siblingNodePositionsAreComparable(e,t)){return getEffectiveLines((n=>getLinesBetweenRangeEndAndRangeStart(e,t,y,n)))}else if(!O&&originalNodesHaveSameParent(e,t)){return rangeEndIsOnSameLineAsRangeStart(e,t,y)?0:1}return n&65536?1:0}else if(synthesizedNodeStartsOnNewLine(e,n)||synthesizedNodeStartsOnNewLine(t,n)){return 1}}else if(getStartsOnNewLine(t)){return 1}return n&1?1:0}function getClosingLineTerminatorCount(e,t,n,r){if(n&2||O){if(n&65536){return 1}if(t===void 0){return!e||y&&rangeIsOnSingleLine(e,y)?0:1}if(y&&e&&!positionIsSynthesized(e.pos)&&!nodeIsSynthesized(t)&&(!t.parent||t.parent===e)){if(O){const n=r&&!positionIsSynthesized(r.end)?r.end:t.end;return getEffectiveLines((t=>getLinesBetweenPositionAndNextNonWhitespaceCharacter(n,e.end,y,t)))}return rangeEndPositionsAreOnSameLine(e,t,y)?0:1}if(synthesizedNodeStartsOnNewLine(t,n)){return 1}}if(n&1&&!(n&131072)){return 1}return 0}function getEffectiveLines(e){S.assert(!!O);const t=e(true);if(t===0){return e(false)}return t}function writeLineSeparatorsAndIndentBefore(e,t){const n=O&&getLeadingLineTerminatorCount(t,e,0);if(n){writeLinesAndIndent(n,false)}return!!n}function writeLineSeparatorsAfter(e,t){const n=O&&getClosingLineTerminatorCount(t,e,0,void 0);if(n){writeLine(n)}}function synthesizedNodeStartsOnNewLine(e,t){if(nodeIsSynthesized(e)){const n=getStartsOnNewLine(e);if(n===void 0){return(t&65536)!==0}return n}return(t&65536)!==0}function getLinesBetweenNodes(e,t,n){if(getEmitFlags(e)&262144){return 0}e=skipSynthesizedParentheses(e);t=skipSynthesizedParentheses(t);n=skipSynthesizedParentheses(n);if(getStartsOnNewLine(n)){return 1}if(y&&!nodeIsSynthesized(e)&&!nodeIsSynthesized(t)&&!nodeIsSynthesized(n)){if(O){return getEffectiveLines((e=>getLinesBetweenRangeEndAndRangeStart(t,n,y,e)))}return rangeEndIsOnSameLineAsRangeStart(t,n,y)?0:1}return 0}function isEmptyBlock(e){return e.statements.length===0&&(!y||rangeEndIsOnSameLineAsRangeStart(e,e,y))}function skipSynthesizedParentheses(e){while(e.kind===217&&nodeIsSynthesized(e)){e=e.expression}return e}function getTextOfNode2(e,t){if(isGeneratedIdentifier(e)||isGeneratedPrivateIdentifier(e)){return generateName(e)}if(isStringLiteral(e)&&e.textSourceNode){return getTextOfNode2(e.textSourceNode,t)}const n=y;const r=!!n&&!!e.parent&&!nodeIsSynthesized(e);if(isMemberName(e)){if(!r||getSourceFileOfNode(e)!==getOriginalNode(n)){return idText(e)}}else if(isJsxNamespacedName(e)){if(!r||getSourceFileOfNode(e)!==getOriginalNode(n)){return getTextOfJsxNamespacedName(e)}}else{S.assertNode(e,isLiteralExpression);if(!r){return e.text}}return getSourceTextOfNodeFromSourceFile(n,e,t)}function getLiteralTextOfNode(t,n=y,r,i){if(t.kind===11&&t.textSourceNode){const e=t.textSourceNode;if(isIdentifier(e)||isPrivateIdentifier(e)||isNumericLiteral(e)||isJsxNamespacedName(e)){const n=isNumericLiteral(e)?e.text:getTextOfNode2(e);return i?`"${escapeJsxAttributeString(n)}"`:r||getEmitFlags(t)&16777216?`"${escapeString(n)}"`:`"${escapeNonAsciiString(n)}"`}else{return getLiteralTextOfNode(e,getSourceFileOfNode(e),r,i)}}const o=(r?1:0)|(i?2:0)|(e.terminateUnterminatedLiterals?4:0)|(e.target&&e.target>=8?8:0);return getLiteralText(t,n,o)}function pushNameGenerationScope(e){E.push(N);N=0;I.push(A);if(e&&getEmitFlags(e)&1048576){return}k.push(F);F=0;b.push(C);C=void 0;P.push(D)}function popNameGenerationScope(e){N=E.pop();A=I.pop();if(e&&getEmitFlags(e)&1048576){return}F=k.pop();C=b.pop();D=P.pop()}function reserveNameInNestedScopes(e){if(!D||D===lastOrUndefined(P)){D=new Set}D.add(e)}function reservePrivateNameInNestedScopes(e){if(!A||A===lastOrUndefined(I)){A=new Set}A.add(e)}function generateNames(e){if(!e)return;switch(e.kind){case 241:forEach(e.statements,generateNames);break;case 256:case 254:case 246:case 247:generateNames(e.statement);break;case 245:generateNames(e.thenStatement);generateNames(e.elseStatement);break;case 248:case 250:case 249:generateNames(e.initializer);generateNames(e.statement);break;case 255:generateNames(e.caseBlock);break;case 269:forEach(e.clauses,generateNames);break;case 296:case 297:forEach(e.statements,generateNames);break;case 258:generateNames(e.tryBlock);generateNames(e.catchClause);generateNames(e.finallyBlock);break;case 299:generateNames(e.variableDeclaration);generateNames(e.block);break;case 243:generateNames(e.declarationList);break;case 261:forEach(e.declarations,generateNames);break;case 260:case 169:case 208:case 263:generateNameIfNeeded(e.name);break;case 262:generateNameIfNeeded(e.name);if(getEmitFlags(e)&1048576){forEach(e.parameters,generateNames);generateNames(e.body)}break;case 206:case 207:forEach(e.elements,generateNames);break;case 272:generateNames(e.importClause);break;case 273:generateNameIfNeeded(e.name);generateNames(e.namedBindings);break;case 274:generateNameIfNeeded(e.name);break;case 280:generateNameIfNeeded(e.name);break;case 275:forEach(e.elements,generateNames);break;case 276:generateNameIfNeeded(e.propertyName||e.name);break}}function generateMemberNames(e){if(!e)return;switch(e.kind){case 303:case 304:case 172:case 171:case 174:case 173:case 177:case 178:generateNameIfNeeded(e.name);break}}function generateNameIfNeeded(e){if(e){if(isGeneratedIdentifier(e)||isGeneratedPrivateIdentifier(e)){generateName(e)}else if(isBindingPattern(e)){generateNames(e)}}}function generateName(e){const t=e.emitNode.autoGenerate;if((t.flags&7)===4){return generateNameCached(getNodeForGeneratedName(e),isPrivateIdentifier(e),t.flags,t.prefix,t.suffix)}else{const n=t.id;return v[n]||(v[n]=makeName(e))}}function generateNameCached(e,t,n,r,i){const o=getNodeId(e);const a=t?T:h;return a[o]||(a[o]=generateNameForNode(e,t,n??0,formatGeneratedNamePart(r,generateName),formatGeneratedNamePart(i)))}function isUniqueName(e,t){return isFileLevelUniqueNameInCurrentFile(e,t)&&!isReservedName(e,t)&&!x.has(e)}function isReservedName(e,t){let n;let r;if(t){n=A;r=I}else{n=D;r=P}if(n==null?void 0:n.has(e)){return true}for(let t=r.length-1;t>=0;t--){if(n===r[t]){continue}n=r[t];if(n==null?void 0:n.has(e)){return true}}return false}function isFileLevelUniqueNameInCurrentFile(e,t){return y?isFileLevelUniqueName(y,e,n):true}function isUniqueLocalName(e,t){for(let n=t;n&&isNodeDescendantOf(n,t);n=n.nextContainer){if(canHaveLocals(n)&&n.locals){const t=n.locals.get(escapeLeadingUnderscores(e));if(t&&t.flags&(111551|1048576|2097152)){return false}}}return true}function getTempFlags(e){switch(e){case"":return F;case"#":return N;default:return(C==null?void 0:C.get(e))??0}}function setTempFlags(e,t){switch(e){case"":F=t;break;case"#":N=t;break;default:C??(C=new Map);C.set(e,t);break}}function makeTempVariableName(e,t,n,r,i){if(r.length>0&&r.charCodeAt(0)===35){r=r.slice(1)}const o=formatGeneratedName(n,r,"",i);let a=getTempFlags(o);if(e&&!(a&e)){const s=e===268435456?"_i":"_n";const c=formatGeneratedName(n,r,s,i);if(isUniqueName(c,n)){a|=e;if(n){reservePrivateNameInNestedScopes(c)}else if(t){reserveNameInNestedScopes(c)}setTempFlags(o,a);return c}}while(true){const e=a&268435455;a++;if(e!==8&&e!==13){const s=e<26?"_"+String.fromCharCode(97+e):"_"+(e-26);const c=formatGeneratedName(n,r,s,i);if(isUniqueName(c,n)){if(n){reservePrivateNameInNestedScopes(c)}else if(t){reserveNameInNestedScopes(c)}setTempFlags(o,a);return c}}}}function makeUniqueName2(e,t=isUniqueName,n,r,i,o,a){if(e.length>0&&e.charCodeAt(0)===35){e=e.slice(1)}if(o.length>0&&o.charCodeAt(0)===35){o=o.slice(1)}if(n){const n=formatGeneratedName(i,o,e,a);if(t(n,i)){if(i){reservePrivateNameInNestedScopes(n)}else if(r){reserveNameInNestedScopes(n)}else{x.add(n)}return n}}if(e.charCodeAt(e.length-1)!==95){e+="_"}let s=1;while(true){const n=formatGeneratedName(i,o,e+s,a);if(t(n,i)){if(i){reservePrivateNameInNestedScopes(n)}else if(r){reserveNameInNestedScopes(n)}else{x.add(n)}return n}s++}}function makeFileLevelOptimisticUniqueName(e){return makeUniqueName2(e,isFileLevelUniqueNameInCurrentFile,true,false,false,"","")}function generateNameForModuleOrEnum(e){const t=getTextOfNode2(e.name);return isUniqueLocalName(t,tryCast(e,canHaveLocals))?t:makeUniqueName2(t,isUniqueName,false,false,false,"","")}function generateNameForImportOrExportDeclaration(e){const t=getExternalModuleName(e);const n=isStringLiteral(t)?makeIdentifierFromModuleName(t.text):"module";return makeUniqueName2(n,isUniqueName,false,false,false,"","")}function generateNameForExportDefault(){return makeUniqueName2("default",isUniqueName,false,false,false,"","")}function generateNameForClassExpression(){return makeUniqueName2("class",isUniqueName,false,false,false,"","")}function generateNameForMethodOrAccessor(e,t,n,r){if(isIdentifier(e.name)){return generateNameCached(e.name,t)}return makeTempVariableName(0,false,t,n,r)}function generateNameForNode(e,t,n,r,i){switch(e.kind){case 80:case 81:return makeUniqueName2(getTextOfNode2(e),isUniqueName,!!(n&16),!!(n&8),t,r,i);case 267:case 266:S.assert(!r&&!i&&!t);return generateNameForModuleOrEnum(e);case 272:case 278:S.assert(!r&&!i&&!t);return generateNameForImportOrExportDeclaration(e);case 262:case 263:{S.assert(!r&&!i&&!t);const o=e.name;if(o&&!isGeneratedIdentifier(o)){return generateNameForNode(o,false,n,r,i)}return generateNameForExportDefault()}case 277:S.assert(!r&&!i&&!t);return generateNameForExportDefault();case 231:S.assert(!r&&!i&&!t);return generateNameForClassExpression();case 174:case 177:case 178:return generateNameForMethodOrAccessor(e,t,r,i);case 167:return makeTempVariableName(0,true,t,r,i);default:return makeTempVariableName(0,false,t,r,i)}}function makeName(e){const t=e.emitNode.autoGenerate;const n=formatGeneratedNamePart(t.prefix,generateName);const r=formatGeneratedNamePart(t.suffix);switch(t.flags&7){case 1:return makeTempVariableName(0,!!(t.flags&8),isPrivateIdentifier(e),n,r);case 2:S.assertNode(e,isIdentifier);return makeTempVariableName(268435456,!!(t.flags&8),false,n,r);case 3:return makeUniqueName2(idText(e),t.flags&32?isFileLevelUniqueNameInCurrentFile:isUniqueName,!!(t.flags&16),!!(t.flags&8),isPrivateIdentifier(e),n,r)}return S.fail(`Unsupported GeneratedIdentifierKind: ${S.formatEnum(t.flags&7,re,true)}.`)}function pipelineEmitWithComments(e,t){const n=getNextPipelinePhase(2,e,t);const r=q;const i=H;const o=G;emitCommentsBeforeNode(t);n(e,t);emitCommentsAfterNode(t,r,i,o)}function emitCommentsBeforeNode(e){const t=getEmitFlags(e);const n=getCommentRange(e);emitLeadingCommentsOfNode(e,t,n.pos,n.end);if(t&4096){X=true}}function emitCommentsAfterNode(e,t,n,r){const i=getEmitFlags(e);const o=getCommentRange(e);if(i&4096){X=false}emitTrailingCommentsOfNode(e,i,o.pos,o.end,t,n,r);const a=getTypeNode(e);if(a){emitTrailingCommentsOfNode(e,i,a.pos,a.end,t,n,r)}}function emitLeadingCommentsOfNode(e,t,n,r){ee();Q=false;const i=n<0||(t&1024)!==0||e.kind===12;const o=r<0||(t&2048)!==0||e.kind===12;if((n>0||r>0)&&n!==r){if(!i){emitLeadingComments(n,e.kind!==353)}if(!i||n>=0&&(t&1024)!==0){q=n}if(!o||r>=0&&(t&2048)!==0){H=r;if(e.kind===261){G=r}}}forEach(getSyntheticLeadingComments(e),emitLeadingSynthesizedComment);te()}function emitTrailingCommentsOfNode(e,t,n,r,i,o,a){ee();const s=r<0||(t&2048)!==0||e.kind===12;forEach(getSyntheticTrailingComments(e),emitTrailingSynthesizedComment);if((n>0||r>0)&&n!==r){q=i;H=o;G=a;if(!s&&e.kind!==353){emitTrailingComments(r)}}te()}function emitLeadingSynthesizedComment(e){if(e.hasLeadingNewline||e.kind===2){L.writeLine()}writeSynthesizedComment(e);if(e.hasTrailingNewLine||e.kind===2){L.writeLine()}else{L.writeSpace(" ")}}function emitTrailingSynthesizedComment(e){if(!L.isAtStartOfLine()){L.writeSpace(" ")}writeSynthesizedComment(e);if(e.hasTrailingNewLine){L.writeLine()}}function writeSynthesizedComment(e){const t=formatSynthesizedComment(e);const n=e.kind===3?computeLineStarts(t):void 0;writeCommentRange(t,n,L,0,t.length,m)}function formatSynthesizedComment(e){return e.kind===3?`/*${e.text}*/`:`//${e.text}`}function emitBodyWithDetachedComments(e,t,n){ee();const{pos:r,end:i}=t;const o=getEmitFlags(e);const a=r<0||(o&1024)!==0;const s=X||i<0||(o&2048)!==0;if(!a){emitDetachedCommentsAndUpdateCommentsInfo(t)}te();if(o&4096&&!X){X=true;n(e);X=false}else{n(e)}ee();if(!s){emitLeadingComments(t.end,true);if(Q&&!L.isAtStartOfLine()){L.writeLine()}}te()}function originalNodesHaveSameParent(e,t){e=getOriginalNode(e);return e.parent&&e.parent===getOriginalNode(t).parent}function siblingNodePositionsAreComparable(e,t){if(t.pos-1&&r.indexOf(t)===i+1}function emitLeadingComments(e,t){Q=false;if(t){if(e===0&&(y==null?void 0:y.isDeclarationFile)){forEachLeadingCommentToEmit(e,emitNonTripleSlashLeadingComment)}else{forEachLeadingCommentToEmit(e,emitLeadingComment)}}else if(e===0){forEachLeadingCommentToEmit(e,emitTripleSlashLeadingComment)}}function emitTripleSlashLeadingComment(e,t,n,r,i){if(isTripleSlashComment(e,t)){emitLeadingComment(e,t,n,r,i)}}function emitNonTripleSlashLeadingComment(e,t,n,r,i){if(!isTripleSlashComment(e,t)){emitLeadingComment(e,t,n,r,i)}}function shouldWriteComment(t,n){if(e.onlyPrintJsDocStyle){return isJSDocLikeText(t,n)||isPinnedComment(t,n)}return true}function emitLeadingComment(e,t,n,r,i){if(!y||!shouldWriteComment(y.text,e))return;if(!Q){emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(),L,i,e);Q=true}emitPos(e);writeCommentRange(y.text,getCurrentLineMap(),L,e,t,m);emitPos(t);if(r){L.writeLine()}else if(n===3){L.writeSpace(" ")}}function emitLeadingCommentsOfPosition(e){if(X||e===-1){return}emitLeadingComments(e,true)}function emitTrailingComments(e){forEachTrailingCommentToEmit(e,emitTrailingComment)}function emitTrailingComment(e,t,n,r){if(!y||!shouldWriteComment(y.text,e))return;if(!L.isAtStartOfLine()){L.writeSpace(" ")}emitPos(e);writeCommentRange(y.text,getCurrentLineMap(),L,e,t,m);emitPos(t);if(r){L.writeLine()}}function emitTrailingCommentsOfPosition(e,t,n){if(X){return}ee();forEachTrailingCommentToEmit(e,t?emitTrailingComment:n?emitTrailingCommentOfPositionNoNewline:emitTrailingCommentOfPosition);te()}function emitTrailingCommentOfPositionNoNewline(e,t,n){if(!y)return;emitPos(e);writeCommentRange(y.text,getCurrentLineMap(),L,e,t,m);emitPos(t);if(n===2){L.writeLine()}}function emitTrailingCommentOfPosition(e,t,n,r){if(!y)return;emitPos(e);writeCommentRange(y.text,getCurrentLineMap(),L,e,t,m);emitPos(t);if(r){L.writeLine()}else{L.writeSpace(" ")}}function forEachLeadingCommentToEmit(e,t){if(y&&(q===-1||e!==q)){if(hasDetachedComments(e)){forEachLeadingCommentWithoutDetachedComments(t)}else{forEachLeadingCommentRange(y.text,e,t,e)}}}function forEachTrailingCommentToEmit(e,t){if(y&&(H===-1||e!==H&&e!==G)){forEachTrailingCommentRange(y.text,e,t)}}function hasDetachedComments(e){return $!==void 0&&last($).nodePos===e}function forEachLeadingCommentWithoutDetachedComments(e){if(!y)return;const t=last($).detachedCommentEndPos;if($.length-1){$.pop()}else{$=void 0}forEachLeadingCommentRange(y.text,t,e,t)}function emitDetachedCommentsAndUpdateCommentsInfo(e){const t=y&&emitDetachedComments(y.text,getCurrentLineMap(),L,emitComment,e,m,X);if(t){if($){$.push(t)}else{$=[t]}}}function emitComment(e,t,n,r,i,o){if(!y||!shouldWriteComment(y.text,r))return;emitPos(r);writeCommentRange(e,t,n,r,i,o);emitPos(i)}function isTripleSlashComment(e,t){return!!y&&isRecognizedTripleSlashComment(y.text,e,t)}function pipelineEmitWithSourceMaps(e,t){const n=getNextPipelinePhase(3,e,t);emitSourceMapsBeforeNode(t);n(e,t);emitSourceMapsAfterNode(t)}function emitSourceMapsBeforeNode(e){const t=getEmitFlags(e);const n=getSourceMapRange(e);const r=n.source||W;if(e.kind!==353&&(t&32)===0&&n.pos>=0){emitSourcePos(n.source||W,skipSourceTrivia(r,n.pos))}if(t&128){j=true}}function emitSourceMapsAfterNode(e){const t=getEmitFlags(e);const n=getSourceMapRange(e);if(t&128){j=false}if(e.kind!==353&&(t&64)===0&&n.end>=0){emitSourcePos(n.source||W,n.end)}}function skipSourceTrivia(e,t){return e.skipTrivia?e.skipTrivia(t):skipTrivia(e.text,t)}function emitPos(e){if(j||positionIsSynthesized(e)||isJsonSourceMapSource(W)){return}const{line:t,character:n}=getLineAndCharacterOfPosition(W,e);J.addMapping(L.getLine(),L.getColumn(),U,t,n,void 0)}function emitSourcePos(e,t){if(e!==W){const n=W;const r=U;setSourceMapSource(e);emitPos(t);resetSourceMapSource(n,r)}else{emitPos(t)}}function emitTokenWithSourceMap(e,t,n,r,i){if(j||e&&isInJsonFile(e)){return i(t,n,r)}const o=e&&e.emitNode;const a=o&&o.flags||0;const s=o&&o.tokenSourceMapRanges&&o.tokenSourceMapRanges[t];const c=s&&s.source||W;r=skipSourceTrivia(c,s?s.pos:r);if((a&256)===0&&r>=0){emitSourcePos(c,r)}r=i(t,n,r);if(s)r=s.end;if((a&512)===0&&r>=0){emitSourcePos(c,r)}return r}function setSourceMapSource(t){if(j){return}W=t;if(t===z){U=V;return}if(isJsonSourceMapSource(t)){return}U=J.addSource(t.fileName);if(e.inlineSources){J.setSourceContent(U,t.text)}z=t;V=U}function resetSourceMapSource(e,t){W=e;U=t}function isJsonSourceMapSource(e){return fileExtensionIs(e.fileName,".json")}}function createBracketsMap(){const e=[];e[1024]=["{","}"];e[2048]=["(",")"];e[4096]=["<",">"];e[8192]=["[","]"];return e}function getOpeningBracket(e){return Fa[e&15360][0]}function getClosingBracket(e){return Fa[e&15360][1]}function emitListItemNoParenthesizer(e,t,n,r){t(e)}function emitListItemWithParenthesizerRuleSelector(e,t,n,r){t(e,n.select(r))}function emitListItemWithParenthesizerRule(e,t,n,r){t(e,n)}function getEmitListItem(e,t){return e.length===1?emitListItemNoParenthesizer:typeof t==="object"?emitListItemWithParenthesizerRuleSelector:emitListItemWithParenthesizerRule}function createCachedDirectoryStructureHost(e,t,n){if(!e.getDirectories||!e.readDirectory){return void 0}const r=new Map;const i=createGetCanonicalFileName(n);return{useCaseSensitiveFileNames:n,fileExists:fileExists,readFile:(t,n)=>e.readFile(t,n),directoryExists:e.directoryExists&&directoryExists,getDirectories:getDirectories,readDirectory:readDirectory,createDirectory:e.createDirectory&&createDirectory,writeFile:e.writeFile&&writeFile2,addOrDeleteFileOrDirectory:addOrDeleteFileOrDirectory,addOrDeleteFile:addOrDeleteFile,clearCache:clearCache,realpath:e.realpath&&realpath};function toPath3(e){return toPath(e,t,i)}function getCachedFileSystemEntries(e){return r.get(ensureTrailingDirectorySeparator(e))}function getCachedFileSystemEntriesForBaseDir(e){const t=getCachedFileSystemEntries(getDirectoryPath(e));if(!t){return t}if(!t.sortedAndCanonicalizedFiles){t.sortedAndCanonicalizedFiles=t.files.map(i).sort();t.sortedAndCanonicalizedDirectories=t.directories.map(i).sort()}return t}function getBaseNameOfFileName(e){return getBaseFileName(normalizePath(e))}function createCachedFileSystemEntries(t,n){var i;if(!e.realpath||ensureTrailingDirectorySeparator(toPath3(e.realpath(t)))===n){const i={files:map(e.readDirectory(t,void 0,void 0,["*.*"]),getBaseNameOfFileName)||[],directories:e.getDirectories(t)||[]};r.set(ensureTrailingDirectorySeparator(n),i);return i}if((i=e.directoryExists)==null?void 0:i.call(e,t)){r.set(n,false);return false}return void 0}function tryReadDirectory2(e,t){t=ensureTrailingDirectorySeparator(t);const n=getCachedFileSystemEntries(t);if(n){return n}try{return createCachedFileSystemEntries(e,t)}catch{S.assert(!r.has(ensureTrailingDirectorySeparator(t)));return void 0}}function hasEntry(e,t){const n=binarySearch(e,t,identity,compareStringsCaseSensitive);return n>=0}function writeFile2(t,n,r){const i=toPath3(t);const o=getCachedFileSystemEntriesForBaseDir(i);if(o){updateFilesOfFileSystemEntry(o,getBaseNameOfFileName(t),true)}return e.writeFile(t,n,r)}function fileExists(t){const n=toPath3(t);const r=getCachedFileSystemEntriesForBaseDir(n);return r&&hasEntry(r.sortedAndCanonicalizedFiles,i(getBaseNameOfFileName(t)))||e.fileExists(t)}function directoryExists(t){const n=toPath3(t);return r.has(ensureTrailingDirectorySeparator(n))||e.directoryExists(t)}function createDirectory(t){const n=toPath3(t);const r=getCachedFileSystemEntriesForBaseDir(n);if(r){const e=getBaseNameOfFileName(t);const n=i(e);const o=r.sortedAndCanonicalizedDirectories;if(insertSorted(o,n,compareStringsCaseSensitive)){r.directories.push(e)}}e.createDirectory(t)}function getDirectories(t){const n=toPath3(t);const r=tryReadDirectory2(t,n);if(r){return r.directories.slice()}return e.getDirectories(t)}function readDirectory(r,i,o,a,s){const c=toPath3(r);const l=tryReadDirectory2(r,c);let p;if(l!==void 0){return matchFiles(r,i,o,a,n,t,s,getFileSystemEntries,realpath)}return e.readDirectory(r,i,o,a,s);function getFileSystemEntries(e){const t=toPath3(e);if(t===c){return l||getFileSystemEntriesFromHost(e,t)}const n=tryReadDirectory2(e,t);return n!==void 0?n||getFileSystemEntriesFromHost(e,t):Fr}function getFileSystemEntriesFromHost(t,n){if(p&&n===c)return p;const r={files:map(e.readDirectory(t,void 0,void 0,["*.*"]),getBaseNameOfFileName)||d,directories:e.getDirectories(t)||d};if(n===c)p=r;return r}}function realpath(t){return e.realpath?e.realpath(t):t}function clearFirstAncestorEntry(e){forEachAncestorDirectory(getDirectoryPath(e),(e=>r.delete(ensureTrailingDirectorySeparator(e))?true:void 0))}function addOrDeleteFileOrDirectory(t,n){const r=getCachedFileSystemEntries(n);if(r!==void 0){clearCache();return void 0}const o=getCachedFileSystemEntriesForBaseDir(n);if(!o){clearFirstAncestorEntry(n);return void 0}if(!e.directoryExists){clearCache();return void 0}const a=getBaseNameOfFileName(t);const s={fileExists:e.fileExists(t),directoryExists:e.directoryExists(t)};if(s.directoryExists||hasEntry(o.sortedAndCanonicalizedDirectories,i(a))){clearCache()}else{updateFilesOfFileSystemEntry(o,a,s.fileExists)}return s}function addOrDeleteFile(e,t,n){if(n===1){return}const r=getCachedFileSystemEntriesForBaseDir(t);if(r){updateFilesOfFileSystemEntry(r,getBaseNameOfFileName(e),n===0)}else{clearFirstAncestorEntry(t)}}function updateFilesOfFileSystemEntry(e,t,n){const r=e.sortedAndCanonicalizedFiles;const o=i(t);if(n){if(insertSorted(r,o,compareStringsCaseSensitive)){e.files.push(t)}}else{const t=binarySearch(r,o,identity,compareStringsCaseSensitive);if(t>=0){r.splice(t,1);const n=e.files.findIndex((e=>i(e)===o));e.files.splice(n,1)}}}function clearCache(){r.clear()}}var wa=(e=>{e[e["Update"]=0]="Update";e[e["RootNamesAndUpdate"]=1]="RootNamesAndUpdate";e[e["Full"]=2]="Full";return e})(wa||{});function updateSharedExtendedConfigFileWatcher(e,t,n,r,i){var o;const a=arrayToMap(((o=t==null?void 0:t.configFile)==null?void 0:o.extendedSourceFiles)||d,i);n.forEach(((t,n)=>{if(!a.has(n)){t.projects.delete(e);t.close()}}));a.forEach(((t,i)=>{const o=n.get(i);if(o){o.projects.add(e)}else{n.set(i,{projects:new Set([e]),watcher:r(t,i),close:()=>{const e=n.get(i);if(!e||e.projects.size!==0)return;e.watcher.close();n.delete(i)}})}}))}function clearSharedExtendedConfigFileWatcher(e,t){t.forEach((t=>{if(t.projects.delete(e))t.close()}))}function cleanExtendedConfigCache(e,t,n){if(!e.delete(t))return;e.forEach((({extendedResult:r},i)=>{var o;if((o=r.extendedSourceFiles)==null?void 0:o.some((e=>n(e)===t))){cleanExtendedConfigCache(e,i,n)}}))}function updateMissingFilePathsWatch(e,t,n){mutateMap(t,e.getMissingFilePaths(),{createNewValue:n,onDeleteValue:closeFileWatcher})}function updateWatchingWildcardDirectories(e,t,n){if(t){mutateMap(e,new Map(Object.entries(t)),{createNewValue:createWildcardDirectoryWatcher,onDeleteValue:closeFileWatcherOf,onExistingValue:updateWildcardDirectoryWatcher})}else{clearMap(e,closeFileWatcherOf)}function createWildcardDirectoryWatcher(e,t){return{watcher:n(e,t),flags:t}}function updateWildcardDirectoryWatcher(t,n,r){if(t.flags===n){return}t.watcher.close();e.set(r,createWildcardDirectoryWatcher(r,n))}}function isIgnoredFileFromWildCardWatching({watchedDirPath:e,fileOrDirectory:t,fileOrDirectoryPath:n,configFileName:r,options:i,program:o,extraFileExtensions:a,currentDirectory:s,useCaseSensitiveFileNames:c,writeLog:l,toPath:d,getScriptKind:p}){const u=removeIgnoredPath(n);if(!u){l(`Project: ${r} Detected ignored path: ${t}`);return true}n=u;if(n===e)return false;if(hasExtension(n)&&!(isSupportedSourceFileName(t,i,a)||isSupportedScriptKind())){l(`Project: ${r} Detected file add/remove of non supported extension: ${t}`);return true}if(isExcludedFile(t,i.configFile.configFileSpecs,getNormalizedAbsolutePath(getDirectoryPath(r),s),c,s)){l(`Project: ${r} Detected excluded file: ${t}`);return true}if(!o)return false;if(i.outFile||i.outDir)return false;if(isDeclarationFileName(n)){if(i.declarationDir)return false}else if(!fileExtensionIsOneOf(n,Tr)){return false}const f=removeFileExtension(n);const m=isArray(o)?void 0:isBuilderProgram(o)?o.getProgramOrUndefined():o;const _=!m&&!isArray(o)?o:void 0;if(hasSourceFile(f+".ts")||hasSourceFile(f+".tsx")){l(`Project: ${r} Detected output file: ${t}`);return true}return false;function hasSourceFile(e){return m?!!m.getSourceFileByPath(e):_?_.state.fileInfos.has(e):!!find(o,(t=>d(t)===e))}function isSupportedScriptKind(){if(!p)return false;const e=p(t);switch(e){case 3:case 4:case 7:case 5:return true;case 1:case 2:return rr(i);case 6:return Yn(i);case 0:return false}}}function isEmittedFileOfProgram(e,t){if(!e){return false}return e.isEmittedFile(t)}var La=(e=>{e[e["None"]=0]="None";e[e["TriggerOnly"]=1]="TriggerOnly";e[e["Verbose"]=2]="Verbose";return e})(La||{});function getWatchFactory(e,t,n,r){setSysLog(t===2?n:noop);const i={watchFile:(t,n,r,i)=>e.watchFile(t,n,r,i),watchDirectory:(t,n,r,i)=>e.watchDirectory(t,n,(r&1)!==0,i)};const o=t!==0?{watchFile:createTriggerLoggingAddWatch("watchFile"),watchDirectory:createTriggerLoggingAddWatch("watchDirectory")}:void 0;const a=t===2?{watchFile:createFileWatcherWithLogging,watchDirectory:createDirectoryWatcherWithLogging}:o||i;const s=t===2?createExcludeWatcherWithLogging:returnNoopFileWatcher;return{watchFile:createExcludeHandlingAddWatch("watchFile"),watchDirectory:createExcludeHandlingAddWatch("watchDirectory")};function createExcludeHandlingAddWatch(t){return(n,r,i,o,c,l)=>{var d;return!matchesExclude(n,t==="watchFile"?o==null?void 0:o.excludeFiles:o==null?void 0:o.excludeDirectories,useCaseSensitiveFileNames2(),((d=e.getCurrentDirectory)==null?void 0:d.call(e))||"")?a[t].call(void 0,n,r,i,o,c,l):s(n,i,o,c,l)}}function useCaseSensitiveFileNames2(){return typeof e.useCaseSensitiveFileNames==="boolean"?e.useCaseSensitiveFileNames:e.useCaseSensitiveFileNames()}function createExcludeWatcherWithLogging(e,t,i,o,a){n(`ExcludeWatcher:: Added:: ${getWatchInfo(e,t,i,o,a,r)}`);return{close:()=>n(`ExcludeWatcher:: Close:: ${getWatchInfo(e,t,i,o,a,r)}`)}}function createFileWatcherWithLogging(e,t,i,a,s,c){n(`FileWatcher:: Added:: ${getWatchInfo(e,i,a,s,c,r)}`);const l=o.watchFile(e,t,i,a,s,c);return{close:()=>{n(`FileWatcher:: Close:: ${getWatchInfo(e,i,a,s,c,r)}`);l.close()}}}function createDirectoryWatcherWithLogging(e,t,i,a,s,c){const l=`DirectoryWatcher:: Added:: ${getWatchInfo(e,i,a,s,c,r)}`;n(l);const d=R();const p=o.watchDirectory(e,t,i,a,s,c);const u=R()-d;n(`Elapsed:: ${u}ms ${l}`);return{close:()=>{const t=`DirectoryWatcher:: Close:: ${getWatchInfo(e,i,a,s,c,r)}`;n(t);const o=R();p.close();const l=R()-o;n(`Elapsed:: ${l}ms ${t}`)}}}function createTriggerLoggingAddWatch(e){return(t,o,a,s,c,l)=>i[e].call(void 0,t,((...i)=>{const d=`${e==="watchFile"?"FileWatcher":"DirectoryWatcher"}:: Triggered with ${i[0]} ${i[1]!==void 0?i[1]:""}:: ${getWatchInfo(t,a,s,c,l,r)}`;n(d);const p=R();o.call(void 0,...i);const u=R()-p;n(`Elapsed:: ${u}ms ${d}`)}),a,s,c,l)}function getWatchInfo(e,t,n,r,i,o){return`WatchInfo: ${e} ${t} ${JSON.stringify(n)} ${o?o(r,i):i===void 0?r:`${r} ${i}`}`}}function getFallbackOptions(e){const t=e==null?void 0:e.fallbackPolling;return{watchFile:t!==void 0?t:1}}function closeFileWatcherOf(e){e.watcher.close()}function findConfigFile(e,t,n="tsconfig.json"){return forEachAncestorDirectory(e,(e=>{const r=combinePaths(e,n);return t(r)?r:void 0}))}function resolveTripleslashReference(e,t){const n=getDirectoryPath(t);const r=isRootedDiskPath(e)?e:combinePaths(n,e);return normalizePath(r)}function computeCommonSourceDirectoryOfFilenames(e,t,n){let r;const i=forEach(e,(e=>{const i=getNormalizedPathComponents(e,t);i.pop();if(!r){r=i;return}const o=Math.min(r.length,i.length);for(let e=0;e{let o;try{mark("beforeIORead");o=e(n);mark("afterIORead");measure("I/O Read","beforeIORead","afterIORead")}catch(e){if(i){i(e.message)}o=""}return o!==void 0?createSourceFile(n,o,r,t):void 0}}function createWriteFileMeasuringIO(e,t,n){return(r,i,o,a)=>{try{mark("beforeIOWrite");writeFileEnsuringDirectories(r,i,o,e,t,n);mark("afterIOWrite");measure("I/O Write","beforeIOWrite","afterIOWrite")}catch(e){if(a){a(e.message)}}}}function createCompilerHostWorker(e,t,n=Ft){const r=new Map;const i=createGetCanonicalFileName(n.useCaseSensitiveFileNames);function directoryExists(e){if(r.has(e)){return true}if((s.directoryExists||n.directoryExists)(e)){r.set(e,true);return true}return false}function getDefaultLibLocation(){return getDirectoryPath(normalizePath(n.getExecutingFilePath()))}const o=getNewLineCharacter(e);const a=n.realpath&&(e=>n.realpath(e));const s={getSourceFile:createGetSourceFile((e=>s.readFile(e)),t),getDefaultLibLocation:getDefaultLibLocation,getDefaultLibFileName:e=>combinePaths(getDefaultLibLocation(),getDefaultLibFileName(e)),writeFile:createWriteFileMeasuringIO(((e,t,r)=>n.writeFile(e,t,r)),(e=>(s.createDirectory||n.createDirectory)(e)),(e=>directoryExists(e))),getCurrentDirectory:memoize((()=>n.getCurrentDirectory())),useCaseSensitiveFileNames:()=>n.useCaseSensitiveFileNames,getCanonicalFileName:i,getNewLine:()=>o,fileExists:e=>n.fileExists(e),readFile:e=>n.readFile(e),trace:e=>n.write(e+o),directoryExists:e=>n.directoryExists(e),getEnvironmentVariable:e=>n.getEnvironmentVariable?n.getEnvironmentVariable(e):"",getDirectories:e=>n.getDirectories(e),realpath:a,readDirectory:(e,t,r,i,o)=>n.readDirectory(e,t,r,i,o),createDirectory:e=>n.createDirectory(e),createHash:maybeBind(n,n.createHash)};return s}function changeCompilerHostLikeToUseCache(e,t,n){const r=e.readFile;const i=e.fileExists;const o=e.directoryExists;const a=e.createDirectory;const s=e.writeFile;const c=new Map;const l=new Map;const d=new Map;const p=new Map;const readFileWithCache=e=>{const n=t(e);const r=c.get(n);if(r!==void 0)return r!==false?r:void 0;return setReadFileCache(n,e)};const setReadFileCache=(t,n)=>{const i=r.call(e,n);c.set(t,i!==void 0?i:false);return i};e.readFile=n=>{const i=t(n);const o=c.get(i);if(o!==void 0)return o!==false?o:void 0;if(!fileExtensionIs(n,".json")&&!isBuildInfoFile(n)){return r.call(e,n)}return setReadFileCache(i,n)};const u=n?(e,r,i,o)=>{const a=t(e);const s=typeof r==="object"?r.impliedNodeFormat:void 0;const c=p.get(s);const l=c==null?void 0:c.get(a);if(l)return l;const d=n(e,r,i,o);if(d&&(isDeclarationFileName(e)||fileExtensionIs(e,".json"))){p.set(s,(c||new Map).set(a,d))}return d}:void 0;e.fileExists=n=>{const r=t(n);const o=l.get(r);if(o!==void 0)return o;const a=i.call(e,n);l.set(r,!!a);return a};if(s){e.writeFile=(n,r,...i)=>{const o=t(n);l.delete(o);const a=c.get(o);if(a!==void 0&&a!==r){c.delete(o);p.forEach((e=>e.delete(o)))}else if(u){p.forEach((e=>{const t=e.get(o);if(t&&t.text!==r){e.delete(o)}}))}s.call(e,n,r,...i)}}if(o){e.directoryExists=n=>{const r=t(n);const i=d.get(r);if(i!==void 0)return i;const a=o.call(e,n);d.set(r,!!a);return a};if(a){e.createDirectory=n=>{const r=t(n);d.delete(r);a.call(e,n)}}}return{originalReadFile:r,originalFileExists:i,originalDirectoryExists:o,originalCreateDirectory:a,originalWriteFile:s,getSourceFileWithCache:u,readFileWithCache:readFileWithCache}}function getPreEmitDiagnostics(e,t,n){let r;r=addRange(r,e.getConfigFileParsingDiagnostics());r=addRange(r,e.getOptionsDiagnostics(n));r=addRange(r,e.getSyntacticDiagnostics(t,n));r=addRange(r,e.getGlobalDiagnostics(n));r=addRange(r,e.getSemanticDiagnostics(t,n));if(Zn(e.getCompilerOptions())){r=addRange(r,e.getDeclarationDiagnostics(t,n))}return sortAndDeduplicateDiagnostics(r||d)}function formatDiagnostics(e,t){let n="";for(const r of e){n+=formatDiagnostic(r,t)}return n}function formatDiagnostic(e,t){const n=`${diagnosticCategoryName(e)} TS${e.code}: ${flattenDiagnosticMessageText(e.messageText,t.getNewLine())}${t.getNewLine()}`;if(e.file){const{line:r,character:i}=getLineAndCharacterOfPosition(e.file,e.start);const o=e.file.fileName;const a=convertToRelativePath(o,t.getCurrentDirectory(),(e=>t.getCanonicalFileName(e)));return`${a}(${r+1},${i+1}): `+n}return n}var Ma=(e=>{e["Grey"]="";e["Red"]="";e["Yellow"]="";e["Blue"]="";e["Cyan"]="";return e})(Ma||{});var Ra="";var Ba=" ";var ja="";var Ja="...";var Wa=" ";var Ua=" ";function getCategoryFormat(e){switch(e){case 1:return"";case 0:return"";case 2:return S.fail("Should never get an Info diagnostic on the command line.");case 3:return""}}function formatColorAndReset(e,t){return t+e+ja}function formatCodeSpan(e,t,n,r,i,o){const{line:a,character:s}=getLineAndCharacterOfPosition(e,t);const{line:c,character:l}=getLineAndCharacterOfPosition(e,t+n);const d=getLineAndCharacterOfPosition(e,e.text.length).line;const p=c-a>=4;let u=(c+1+"").length;if(p){u=Math.max(Ja.length,u)}let f="";for(let t=a;t<=c;t++){f+=o.getNewLine();if(p&&a+1n.getCanonicalFileName(e))):e.fileName;let s="";s+=r(a,"");s+=":";s+=r(`${i+1}`,"");s+=":";s+=r(`${o+1}`,"");return s}function formatDiagnosticsWithColorAndContext(e,t){let n="";for(const r of e){if(r.file){const{file:e,start:i}=r;n+=formatLocation(e,i,t);n+=" - "}n+=formatColorAndReset(diagnosticCategoryName(r),getCategoryFormat(r.category));n+=formatColorAndReset(` TS${r.code}: `,"");n+=flattenDiagnosticMessageText(r.messageText,t.getNewLine());if(r.file&&r.code!==wt.File_appears_to_be_binary.code){n+=t.getNewLine();n+=formatCodeSpan(r.file,r.start,r.length,"",getCategoryFormat(r.category),t)}if(r.relatedInformation){n+=t.getNewLine();for(const{file:e,start:i,length:o,messageText:a}of r.relatedInformation){if(e){n+=t.getNewLine();n+=Wa+formatLocation(e,i,t);n+=formatCodeSpan(e,i,o,Ua,"",t)}n+=t.getNewLine();n+=Ua+flattenDiagnosticMessageText(a,t.getNewLine())}}n+=t.getNewLine()}return n}function flattenDiagnosticMessageText(e,t,n=0){if(isString(e)){return e}else if(e===void 0){return""}let r="";if(n){r+=t;for(let e=0;egetModeForUsageLocation(t,e,n)};function createModuleResolutionLoader(e,t,n,r,i){return{nameAndMode:Va,resolve:(o,a)=>resolveModuleName(o,e,n,r,i,t,a)}}function getTypeReferenceResolutionName(e){return!isString(e)?e.fileName:e}var qa={getName:getTypeReferenceResolutionName,getMode:(e,t,n)=>getModeForFileReference(e,t&&getDefaultResolutionModeForFileWorker(t,n))};function createTypeReferenceResolutionLoader(e,t,n,r,i){return{nameAndMode:qa,resolve:(o,a)=>resolveTypeReferenceDirective(o,e,n,r,t,i,a)}}function loadWithModeAwareCache(e,t,n,r,i,o,a,s){if(e.length===0)return d;const c=[];const l=new Map;const p=s(t,n,r,o,a);for(const t of e){const e=p.nameAndMode.getName(t);const o=p.nameAndMode.getMode(t,i,(n==null?void 0:n.commandLine.options)||r);const a=createModeAwareCacheKey(e,o);let s=l.get(a);if(!s){l.set(a,s=p.resolve(e,o))}c.push(s)}return c}var Ha="__inferred type names__.ts";function getInferredLibraryNameResolveFrom(e,t,n){const r=e.configFilePath?getDirectoryPath(e.configFilePath):t;return combinePaths(r,`__lib_node_modules_lookup_${n}__.ts`)}function getLibraryNameFromLibFileName(e){const t=e.split(".");let n=t[1];let r=2;while(t[r]&&t[r]!=="d"){n+=(r===2?"/":"-")+t[r];r++}return"@typescript/lib-"+n}function isReferencedFile(e){switch(e==null?void 0:e.kind){case 3:case 4:case 5:case 7:return true;default:return false}}function isReferenceFileLocation(e){return e.pos!==void 0}function getReferencedFileLocation(e,t){var n,r,i,o;const a=S.checkDefined(e.getSourceFileByPath(t.file));const{kind:s,index:c}=t;let l,d,p;switch(s){case 3:const t=getModuleNameStringLiteralAt(a,c);p=(r=(n=e.getResolvedModuleFromModuleSpecifier(t,a))==null?void 0:n.resolvedModule)==null?void 0:r.packageId;if(t.pos===-1)return{file:a,packageId:p,text:t.text};l=skipTrivia(a.text,t.pos);d=t.end;break;case 4:({pos:l,end:d}=a.referencedFiles[c]);break;case 5:({pos:l,end:d}=a.typeReferenceDirectives[c]);p=(o=(i=e.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(a.typeReferenceDirectives[c],a))==null?void 0:i.resolvedTypeReferenceDirective)==null?void 0:o.packageId;break;case 7:({pos:l,end:d}=a.libReferenceDirectives[c]);break;default:return S.assertNever(s)}return{file:a,pos:l,end:d,packageId:p}}function isProgramUptoDate(e,t,n,r,i,o,a,s,c,l){if(!e||(s==null?void 0:s()))return false;if(!arrayIsEqualTo(e.getRootFileNames(),t))return false;let d;if(!arrayIsEqualTo(e.getProjectReferences(),l,projectReferenceUptoDate))return false;if(e.getSourceFiles().some(sourceFileNotUptoDate))return false;const p=e.getMissingFilePaths();if(p&&forEachEntry(p,i))return false;const u=e.getCompilerOptions();if(!compareDataObjects(u,n))return false;if(e.resolvedLibReferences&&forEachEntry(e.resolvedLibReferences,((e,t)=>a(t))))return false;if(u.configFile&&n.configFile)return u.configFile.text===n.configFile.text;return true;function sourceFileNotUptoDate(e){return!sourceFileVersionUptoDate(e)||o(e.path)}function sourceFileVersionUptoDate(e){return e.version===r(e.resolvedPath,e.fileName)}function projectReferenceUptoDate(t,n,r){return projectReferenceIsEqualTo(t,n)&&resolvedProjectReferenceUptoDate(e.getResolvedProjectReferences()[r],t)}function resolvedProjectReferenceUptoDate(e,t){if(e){if(contains(d,e))return true;const n=resolveProjectReferencePath(t);const r=c(n);if(!r)return false;if(e.commandLine.options.configFile!==r.options.configFile)return false;if(!arrayIsEqualTo(e.commandLine.fileNames,r.fileNames))return false;(d||(d=[])).push(e);return!forEach(e.references,((t,n)=>!resolvedProjectReferenceUptoDate(t,e.commandLine.projectReferences[n])))}const n=resolveProjectReferencePath(t);return!c(n)}}function getConfigFileParsingDiagnostics(e){return e.options.configFile?[...e.options.configFile.parseDiagnostics,...e.errors]:e.errors}function getImpliedNodeFormatForFile(e,t,n,r){const i=getImpliedNodeFormatForFileWorker(e,t,n,r);return typeof i==="object"?i.impliedNodeFormat:i}function getImpliedNodeFormatForFileWorker(e,t,n,r){const i=qn(r);const o=3<=i&&i<=99||pathContainsNodeModules(e);return fileExtensionIsOneOf(e,[".d.mts",".mts",".mjs"])?99:fileExtensionIsOneOf(e,[".d.cts",".cts",".cjs"])?1:o&&fileExtensionIsOneOf(e,[".d.ts",".ts",".tsx",".js",".jsx"])?lookupFromPackageJson():void 0;function lookupFromPackageJson(){const i=getTemporaryModuleResolutionState(t,n,r);const o=[];i.failedLookupLocations=o;i.affectingLocations=o;const a=getPackageScopeForPath(getDirectoryPath(e),i);const s=(a==null?void 0:a.contents.packageJsonContent.type)==="module"?99:1;return{impliedNodeFormat:s,packageJsonLocations:o,packageJsonScope:a}}}var Ga=new Set([wt.Cannot_redeclare_block_scoped_variable_0.code,wt.A_module_cannot_have_multiple_default_exports.code,wt.Another_export_default_is_here.code,wt.The_first_export_default_is_here.code,wt.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,wt.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,wt.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,wt.constructor_is_a_reserved_word.code,wt.delete_cannot_be_called_on_an_identifier_in_strict_mode.code,wt.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code,wt.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code,wt.Invalid_use_of_0_in_strict_mode.code,wt.A_label_is_not_allowed_here.code,wt.with_statements_are_not_allowed_in_strict_mode.code,wt.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,wt.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,wt.A_class_declaration_without_the_default_modifier_must_have_a_name.code,wt.A_class_member_cannot_have_the_0_keyword.code,wt.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,wt.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,wt.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,wt.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,wt.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,wt.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,wt.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,wt.A_destructuring_declaration_must_have_an_initializer.code,wt.A_get_accessor_cannot_have_parameters.code,wt.A_rest_element_cannot_contain_a_binding_pattern.code,wt.A_rest_element_cannot_have_a_property_name.code,wt.A_rest_element_cannot_have_an_initializer.code,wt.A_rest_element_must_be_last_in_a_destructuring_pattern.code,wt.A_rest_parameter_cannot_have_an_initializer.code,wt.A_rest_parameter_must_be_last_in_a_parameter_list.code,wt.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,wt.A_return_statement_cannot_be_used_inside_a_class_static_block.code,wt.A_set_accessor_cannot_have_rest_parameter.code,wt.A_set_accessor_must_have_exactly_one_parameter.code,wt.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code,wt.An_export_declaration_cannot_have_modifiers.code,wt.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code,wt.An_import_declaration_cannot_have_modifiers.code,wt.An_object_member_cannot_be_declared_optional.code,wt.Argument_of_dynamic_import_cannot_be_spread_element.code,wt.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,wt.Cannot_redeclare_identifier_0_in_catch_clause.code,wt.Catch_clause_variable_cannot_have_an_initializer.code,wt.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,wt.Classes_can_only_extend_a_single_class.code,wt.Classes_may_not_have_a_field_named_constructor.code,wt.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,wt.Duplicate_label_0.code,wt.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,wt.for_await_loops_cannot_be_used_inside_a_class_static_block.code,wt.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,wt.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,wt.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,wt.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,wt.Jump_target_cannot_cross_function_boundary.code,wt.Line_terminator_not_permitted_before_arrow.code,wt.Modifiers_cannot_appear_here.code,wt.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,wt.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,wt.Private_identifiers_are_not_allowed_outside_class_bodies.code,wt.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,wt.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,wt.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,wt.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,wt.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,wt.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,wt.Trailing_comma_not_allowed.code,wt.Variable_declaration_list_cannot_be_empty.code,wt._0_and_1_operations_cannot_be_mixed_without_parentheses.code,wt._0_expected.code,wt._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,wt._0_list_cannot_be_empty.code,wt._0_modifier_already_seen.code,wt._0_modifier_cannot_appear_on_a_constructor_declaration.code,wt._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,wt._0_modifier_cannot_appear_on_a_parameter.code,wt._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,wt._0_modifier_cannot_be_used_here.code,wt._0_modifier_must_precede_1_modifier.code,wt._0_declarations_can_only_be_declared_inside_a_block.code,wt._0_declarations_must_be_initialized.code,wt.extends_clause_already_seen.code,wt.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,wt.Class_constructor_may_not_be_a_generator.code,wt.Class_constructor_may_not_be_an_accessor.code,wt.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,wt.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,wt.Private_field_0_must_be_declared_in_an_enclosing_class.code,wt.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code]);function shouldProgramCreateNewSourceFiles(e,t){if(!e)return false;return optionsHaveChanges(e.getCompilerOptions(),t,oo)}function createCreateProgramOptions(e,t,n,r,i,o){return{rootNames:e,options:t,host:n,oldProgram:r,configFileParsingDiagnostics:i,typeScriptVersion:o}}function createProgram(e,t,n,r,i){var o,a,c,l,p,u,f,m,_,g,y,h,T,v,x,b;let C=isArray(e)?createCreateProgramOptions(e,t,n,r,i):e;const{rootNames:E,options:N,configFileParsingDiagnostics:k,projectReferences:P,typeScriptVersion:D,host:I}=C;let{oldProgram:A}=C;C=void 0;e=void 0;for(const e of po){if(hasProperty(N,e.name)){if(typeof N[e.name]==="string"){throw new Error(`${e.name} is a string value; tsconfig JSON must be parsed with parseJsonSourceFileConfigFileContent or getParsedCommandLineOfConfigFile before passing to createProgram`)}}}const O=memoize((()=>createOptionValueDiagnostic("ignoreDeprecations",wt.Invalid_value_for_ignoreDeprecations)));let w;let L;let M;let R;let B;let j;let J;let W;let U;const z=createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax);let V;let q;let H;let K;let $;let Q;let X;let Y;let Z;const ee=typeof N.maxNodeModuleJsDepth==="number"?N.maxNodeModuleJsDepth:0;let te=0;const ne=new Map;const re=new Map;(o=G)==null?void 0:o.push(G.Phase.Program,"createProgram",{configFilePath:N.configFilePath,rootDir:N.rootDir},true);mark("beforeProgram");const ie=I||createCompilerHost(N);const oe=parseConfigHostFromCompilerHostLike(ie);let ae=N.noLib;const se=memoize((()=>ie.getDefaultLibFileName(N)));const de=ie.getDefaultLibLocation?ie.getDefaultLibLocation():getDirectoryPath(se());let pe=false;const ue=ie.getCurrentDirectory();const fe=getSupportedExtensions(N);const me=getSupportedExtensionsWithJsonIfResolveJsonModule(N,fe);const _e=new Map;let ge;let ye;let he;let Te;const Se=ie.hasInvalidatedResolutions||returnFalse;if(ie.resolveModuleNameLiterals){Te=ie.resolveModuleNameLiterals.bind(ie);he=(a=ie.getModuleResolutionCache)==null?void 0:a.call(ie)}else if(ie.resolveModuleNames){Te=(e,t,n,r,i,o)=>ie.resolveModuleNames(e.map(getModuleResolutionName),t,o==null?void 0:o.map(getModuleResolutionName),n,r,i).map((e=>e?e.extension!==void 0?{resolvedModule:e}:{resolvedModule:{...e,extension:extensionFromPath(e.resolvedFileName)}}:za));he=(c=ie.getModuleResolutionCache)==null?void 0:c.call(ie)}else{he=createModuleResolutionCache(ue,getCanonicalFileName,N);Te=(e,t,n,r,i)=>loadWithModeAwareCache(e,t,n,r,i,ie,he,createModuleResolutionLoader)}let ve;if(ie.resolveTypeReferenceDirectiveReferences){ve=ie.resolveTypeReferenceDirectiveReferences.bind(ie)}else if(ie.resolveTypeReferenceDirectives){ve=(e,t,n,r,i)=>ie.resolveTypeReferenceDirectives(e.map(getTypeReferenceResolutionName),t,n,r,i==null?void 0:i.impliedNodeFormat).map((e=>({resolvedTypeReferenceDirective:e})))}else{const e=createTypeReferenceDirectiveResolutionCache(ue,getCanonicalFileName,void 0,he==null?void 0:he.getPackageJsonInfoCache(),he==null?void 0:he.optionsToRedirectsKey);ve=(t,n,r,i,o)=>loadWithModeAwareCache(t,n,r,i,o,ie,e,createTypeReferenceResolutionLoader)}const xe=ie.hasInvalidatedLibResolutions||returnFalse;let be;if(ie.resolveLibrary){be=ie.resolveLibrary.bind(ie)}else{const e=createModuleResolutionCache(ue,getCanonicalFileName,N,he==null?void 0:he.getPackageJsonInfoCache());be=(t,n,r)=>resolveLibrary(t,n,r,ie,e)}const Ce=new Map;let Ee=new Map;let Ne=createMultiMap();let ke;const Fe=new Map;let Pe=new Map;const De=ie.useCaseSensitiveFileNames()?new Map:void 0;let Ie;let Ae;let Oe;let we;const Le=!!((l=ie.useSourceOfProjectReferenceRedirect)==null?void 0:l.call(ie))&&!N.disableSourceOfProjectReferenceRedirect;const{onProgramCreateComplete:Me,fileExists:Re,directoryExists:Be}=updateHostForUseSourceOfProjectReferenceRedirect({compilerHost:ie,getSymlinkCache:getSymlinkCache,useSourceOfProjectReferenceRedirect:Le,toPath:toPath3,getResolvedProjectReferences:getResolvedProjectReferences,getSourceOfProjectReferenceRedirect:getSourceOfProjectReferenceRedirect,forEachResolvedProjectReference:forEachResolvedProjectReference2});const je=ie.readFile.bind(ie);(p=G)==null?void 0:p.push(G.Phase.Program,"shouldProgramCreateNewSourceFiles",{hasOldProgram:!!A});const Je=shouldProgramCreateNewSourceFiles(A,N);(u=G)==null?void 0:u.pop();let We;(f=G)==null?void 0:f.push(G.Phase.Program,"tryReuseStructureFromOldProgram",{});We=tryReuseStructureFromOldProgram();(m=G)==null?void 0:m.pop();if(We!==2){w=[];L=[];if(P){if(!Ie){Ie=P.map(parseProjectReferenceConfigFile)}if(E.length){Ie==null?void 0:Ie.forEach(((e,t)=>{if(!e)return;const n=e.commandLine.options.outFile;if(Le){if(n||Vn(e.commandLine.options)===0){for(const n of e.commandLine.fileNames){processProjectReferenceFile(n,{kind:1,index:t})}}}else{if(n){processProjectReferenceFile(changeExtension(n,".d.ts"),{kind:2,index:t})}else if(Vn(e.commandLine.options)===0){const n=memoize((()=>getCommonSourceDirectoryOfConfig(e.commandLine,!ie.useCaseSensitiveFileNames())));for(const r of e.commandLine.fileNames){if(!isDeclarationFileName(r)&&!fileExtensionIs(r,".json")){processProjectReferenceFile(getOutputDeclarationFileName(r,e.commandLine,!ie.useCaseSensitiveFileNames(),n),{kind:2,index:t})}}}}}))}}(_=G)==null?void 0:_.push(G.Phase.Program,"processRootFiles",{count:E.length});forEach(E,((e,t)=>processRootFile(e,false,false,{kind:0,index:t})));(g=G)==null?void 0:g.pop();V??(V=E.length?getAutomaticTypeDirectiveNames(N,ie):d);q=createModeAwareCache();if(V.length){(y=G)==null?void 0:y.push(G.Phase.Program,"processTypeReferences",{count:V.length});const e=N.configFilePath?getDirectoryPath(N.configFilePath):ue;const t=combinePaths(e,Ha);const n=resolveTypeReferenceDirectiveNamesReusingOldState(V,t);for(let e=0;e{processRootFile(pathForLibFile(e),true,false,{kind:6,index:t})}))}}M=toSorted(w,compareDefaultLibFiles).concat(L);w=void 0;L=void 0;J=void 0}if(A&&ie.onReleaseOldSourceFile){const e=A.getSourceFiles();for(const t of e){const e=getSourceFileByPath(t.resolvedPath);if(Je||!e||e.impliedNodeFormat!==t.impliedNodeFormat||t.resolvedPath===t.path&&e.resolvedPath!==t.path){ie.onReleaseOldSourceFile(t,A.getCompilerOptions(),!!getSourceFileByPath(t.path),e)}}if(!ie.getParsedCommandLine){A.forEachResolvedProjectReference((e=>{if(!getResolvedProjectReferenceByPath(e.sourceFile.path)){ie.onReleaseOldSourceFile(e.sourceFile,A.getCompilerOptions(),false,void 0)}}))}}if(A&&ie.onReleaseParsedCommandLine){forEachProjectReference(A.getProjectReferences(),A.getResolvedProjectReferences(),((e,t,n)=>{const r=(t==null?void 0:t.commandLine.projectReferences[n])||A.getProjectReferences()[n];const i=resolveProjectReferencePath(r);if(!(Ae==null?void 0:Ae.has(toPath3(i)))){ie.onReleaseParsedCommandLine(i,e,A.getCompilerOptions())}}))}A=void 0;K=void 0;Q=void 0;Y=void 0;const Ue={getRootFileNames:()=>E,getSourceFile:getSourceFile,getSourceFileByPath:getSourceFileByPath,getSourceFiles:()=>M,getMissingFilePaths:()=>Pe,getModuleResolutionCache:()=>he,getFilesByNameMap:()=>Fe,getCompilerOptions:()=>N,getSyntacticDiagnostics:getSyntacticDiagnostics,getOptionsDiagnostics:getOptionsDiagnostics,getGlobalDiagnostics:getGlobalDiagnostics,getSemanticDiagnostics:getSemanticDiagnostics,getCachedSemanticDiagnostics:getCachedSemanticDiagnostics,getSuggestionDiagnostics:getSuggestionDiagnostics,getDeclarationDiagnostics:getDeclarationDiagnostics2,getBindAndCheckDiagnostics:getBindAndCheckDiagnostics,getProgramDiagnostics:getProgramDiagnostics,getTypeChecker:getTypeChecker,getClassifiableNames:getClassifiableNames,getCommonSourceDirectory:getCommonSourceDirectory2,emit:emit,getCurrentDirectory:()=>ue,getNodeCount:()=>getTypeChecker().getNodeCount(),getIdentifierCount:()=>getTypeChecker().getIdentifierCount(),getSymbolCount:()=>getTypeChecker().getSymbolCount(),getTypeCount:()=>getTypeChecker().getTypeCount(),getInstantiationCount:()=>getTypeChecker().getInstantiationCount(),getRelationCacheSizes:()=>getTypeChecker().getRelationCacheSizes(),getFileProcessingDiagnostics:()=>z.getFileProcessingDiagnostics(),getAutomaticTypeDirectiveNames:()=>V,getAutomaticTypeDirectiveResolutions:()=>q,isSourceFileFromExternalLibrary:isSourceFileFromExternalLibrary,isSourceFileDefaultLibrary:isSourceFileDefaultLibrary,getModeForUsageLocation:getModeForUsageLocation2,getEmitSyntaxForUsageLocation:getEmitSyntaxForUsageLocation,getModeForResolutionAtIndex:getModeForResolutionAtIndex2,getSourceFileFromReference:getSourceFileFromReference,getLibFileFromReference:getLibFileFromReference,sourceFileToPackageName:Ee,redirectTargetsMap:Ne,usesUriStyleNodeCoreModules:ke,resolvedModules:$,resolvedTypeReferenceDirectiveNames:X,resolvedLibReferences:H,getProgramDiagnosticsContainer:()=>z,getResolvedModule:getResolvedModule,getResolvedModuleFromModuleSpecifier:getResolvedModuleFromModuleSpecifier,getResolvedTypeReferenceDirective:getResolvedTypeReferenceDirective,getResolvedTypeReferenceDirectiveFromTypeReferenceDirective:getResolvedTypeReferenceDirectiveFromTypeReferenceDirective,forEachResolvedModule:forEachResolvedModule,forEachResolvedTypeReferenceDirective:forEachResolvedTypeReferenceDirective,getCurrentPackagesMap:()=>Z,typesPackageExists:typesPackageExists,packageBundlesTypes:packageBundlesTypes,isEmittedFile:isEmittedFile,getConfigFileParsingDiagnostics:getConfigFileParsingDiagnostics2,getProjectReferences:getProjectReferences,getResolvedProjectReferences:getResolvedProjectReferences,getProjectReferenceRedirect:getProjectReferenceRedirect,getResolvedProjectReferenceToRedirect:getResolvedProjectReferenceToRedirect,getResolvedProjectReferenceByPath:getResolvedProjectReferenceByPath,forEachResolvedProjectReference:forEachResolvedProjectReference2,isSourceOfProjectReferenceRedirect:isSourceOfProjectReferenceRedirect,getRedirectReferenceForResolutionFromSourceOfProject:getRedirectReferenceForResolutionFromSourceOfProject,getCompilerOptionsForFile:getCompilerOptionsForFile,getDefaultResolutionModeForFile:getDefaultResolutionModeForFile2,getEmitModuleFormatOfFile:getEmitModuleFormatOfFile2,getImpliedNodeFormatForEmit:getImpliedNodeFormatForEmit2,shouldTransformImportCall:shouldTransformImportCall,emitBuildInfo:emitBuildInfo,fileExists:Re,readFile:je,directoryExists:Be,getSymlinkCache:getSymlinkCache,realpath:(x=ie.realpath)==null?void 0:x.bind(ie),useCaseSensitiveFileNames:()=>ie.useCaseSensitiveFileNames(),getCanonicalFileName:getCanonicalFileName,getFileIncludeReasons:()=>z.getFileReasons(),structureIsReused:We,writeFile:writeFile2,getGlobalTypingsCacheLocation:maybeBind(ie,ie.getGlobalTypingsCacheLocation)};Me();if(!pe){verifyCompilerOptions()}mark("afterProgram");measure("Program","beforeProgram","afterProgram");(b=G)==null?void 0:b.pop();return Ue;function getResolvedModule(e,t,n){var r;return(r=$==null?void 0:$.get(e.path))==null?void 0:r.get(t,n)}function getResolvedModuleFromModuleSpecifier(e,t){t??(t=getSourceFileOfNode(e));S.assertIsDefined(t,"`moduleSpecifier` must have a `SourceFile` ancestor. Use `program.getResolvedModule` instead to provide the containing file and resolution mode.");return getResolvedModule(t,e.text,getModeForUsageLocation2(t,e))}function getResolvedTypeReferenceDirective(e,t,n){var r;return(r=X==null?void 0:X.get(e.path))==null?void 0:r.get(t,n)}function getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(e,t){return getResolvedTypeReferenceDirective(t,e.fileName,getModeForTypeReferenceDirectiveInFile(e,t))}function forEachResolvedModule(e,t){forEachResolution($,e,t)}function forEachResolvedTypeReferenceDirective(e,t){forEachResolution(X,e,t)}function forEachResolution(e,t,n){var r;if(n)(r=e==null?void 0:e.get(n.path))==null?void 0:r.forEach(((e,r,i)=>t(e,r,i,n.path)));else e==null?void 0:e.forEach(((e,n)=>e.forEach(((e,r,i)=>t(e,r,i,n)))))}function getPackagesMap(){if(Z)return Z;Z=new Map;forEachResolvedModule((({resolvedModule:e})=>{if(e==null?void 0:e.packageId)Z.set(e.packageId.name,e.extension===".d.ts"||!!Z.get(e.packageId.name))}));return Z}function typesPackageExists(e){return getPackagesMap().has(getTypesPackageName(e))}function packageBundlesTypes(e){return!!getPackagesMap().get(e)}function addResolutionDiagnostics(e){var t;if(!((t=e.resolutionDiagnostics)==null?void 0:t.length))return;z.addFileProcessingDiagnostic({kind:2,diagnostics:e.resolutionDiagnostics})}function addResolutionDiagnosticsFromResolutionOrCache(e,t,n,r){if(ie.resolveModuleNameLiterals||!ie.resolveModuleNames)return addResolutionDiagnostics(n);if(!he||isExternalModuleNameRelative(t))return;const i=getNormalizedAbsolutePath(e.originalFileName,ue);const o=getDirectoryPath(i);const a=getRedirectReferenceForResolution(e);const s=he.getFromNonRelativeNameCache(t,r,o,a);if(s)addResolutionDiagnostics(s)}function resolveModuleNamesWorker(e,t,n){var r,i;const o=getNormalizedAbsolutePath(t.originalFileName,ue);const a=getRedirectReferenceForResolution(t);(r=G)==null?void 0:r.push(G.Phase.Program,"resolveModuleNamesWorker",{containingFileName:o});mark("beforeResolveModule");const s=Te(e,o,a,N,t,n);mark("afterResolveModule");measure("ResolveModule","beforeResolveModule","afterResolveModule");(i=G)==null?void 0:i.pop();return s}function resolveTypeReferenceDirectiveNamesWorker(e,t,n){var r,i;const o=!isString(t)?t:void 0;const a=!isString(t)?getNormalizedAbsolutePath(t.originalFileName,ue):t;const s=o&&getRedirectReferenceForResolution(o);(r=G)==null?void 0:r.push(G.Phase.Program,"resolveTypeReferenceDirectiveNamesWorker",{containingFileName:a});mark("beforeResolveTypeReference");const c=ve(e,a,s,N,o,n);mark("afterResolveTypeReference");measure("ResolveTypeReference","beforeResolveTypeReference","afterResolveTypeReference");(i=G)==null?void 0:i.pop();return c}function getRedirectReferenceForResolution(e){const t=getResolvedProjectReferenceToRedirect(e.originalFileName);if(t||!isDeclarationFileName(e.originalFileName))return t;const n=getRedirectReferenceForResolutionFromSourceOfProject(e.path);if(n)return n;if(!ie.realpath||!N.preserveSymlinks||!e.originalFileName.includes(Wo))return void 0;const r=toPath3(ie.realpath(e.originalFileName));return r===e.path?void 0:getRedirectReferenceForResolutionFromSourceOfProject(r)}function getRedirectReferenceForResolutionFromSourceOfProject(e){const t=getSourceOfProjectReferenceRedirect(e);if(isString(t))return getResolvedProjectReferenceToRedirect(t);if(!t)return void 0;return forEachResolvedProjectReference2((t=>{const n=t.commandLine.options.outFile;if(!n)return void 0;return toPath3(n)===e?t:void 0}))}function compareDefaultLibFiles(e,t){return compareValues(getDefaultLibFilePriority(e),getDefaultLibFilePriority(t))}function getDefaultLibFilePriority(e){if(containsPath(de,e.fileName,false)){const t=getBaseFileName(e.fileName);if(t==="lib.d.ts"||t==="lib.es6.d.ts")return 0;const n=removeSuffix(removePrefix(t,"lib."),".d.ts");const r=Gi.indexOf(n);if(r!==-1)return r+1}return Gi.length+2}function toPath3(e){return toPath(e,ue,getCanonicalFileName)}function getCommonSourceDirectory2(){let e=z.getCommonSourceDirectory();if(e!==void 0){return e}const t=filter(M,(e=>sourceFileMayBeEmitted(e,Ue)));e=getCommonSourceDirectory(N,(()=>mapDefined(t,(e=>e.isDeclarationFile?void 0:e.fileName))),ue,getCanonicalFileName,(e=>checkSourceFilesBelongToPath(t,e)));z.setCommonSourceDirectory(e);return e}function getClassifiableNames(){var e;if(!j){getTypeChecker();j=new Set;for(const t of M){(e=t.classifiableNames)==null?void 0:e.forEach((e=>j.add(e)))}}return j}function resolveModuleNamesReusingOldState(e,t){return resolveNamesReusingOldState({entries:e,containingFile:t,containingSourceFile:t,redirectedReference:getRedirectReferenceForResolution(t),nameAndModeGetter:Va,resolutionWorker:resolveModuleNamesWorker,getResolutionFromOldProgram:(e,n)=>A==null?void 0:A.getResolvedModule(t,e,n),getResolved:getResolvedModuleFromResolution,canReuseResolutionsInFile:()=>t===(A==null?void 0:A.getSourceFile(t.fileName))&&!Se(t.path),resolveToOwnAmbientModule:true})}function resolveTypeReferenceDirectiveNamesReusingOldState(e,t){const n=!isString(t)?t:void 0;return resolveNamesReusingOldState({entries:e,containingFile:t,containingSourceFile:n,redirectedReference:n&&getRedirectReferenceForResolution(n),nameAndModeGetter:qa,resolutionWorker:resolveTypeReferenceDirectiveNamesWorker,getResolutionFromOldProgram:(e,t)=>{var r;return n?A==null?void 0:A.getResolvedTypeReferenceDirective(n,e,t):(r=A==null?void 0:A.getAutomaticTypeDirectiveResolutions())==null?void 0:r.get(e,t)},getResolved:getResolvedTypeReferenceDirectiveFromResolution,canReuseResolutionsInFile:()=>n?n===(A==null?void 0:A.getSourceFile(n.fileName))&&!Se(n.path):!Se(toPath3(t))})}function resolveNamesReusingOldState({entries:e,containingFile:t,containingSourceFile:n,redirectedReference:r,nameAndModeGetter:i,resolutionWorker:o,getResolutionFromOldProgram:a,getResolved:s,canReuseResolutionsInFile:c,resolveToOwnAmbientModule:l}){if(!e.length)return d;if(We===0&&(!l||!n.ambientModuleNames.length)){return o(e,t,void 0)}let p;let u;let f;let m;const _=c();for(let c=0;cf[u[t]]=e));return f}function canReuseProjectReferences(){return!forEachProjectReference(A.getProjectReferences(),A.getResolvedProjectReferences(),((e,t,n)=>{const r=(t?t.commandLine.projectReferences:P)[n];const i=parseProjectReferenceConfigFile(r);if(e){return!i||i.sourceFile!==e.sourceFile||!arrayIsEqualTo(e.commandLine.fileNames,i.commandLine.fileNames)}else{return i!==void 0}}),((e,t)=>{const n=t?getResolvedProjectReferenceByPath(t.sourceFile.path).commandLine.projectReferences:P;return!arrayIsEqualTo(e,n,projectReferenceIsEqualTo)}))}function tryReuseStructureFromOldProgram(){var e;if(!A){return 0}const t=A.getCompilerOptions();if(changesAffectModuleResolution(t,N)){return 0}const n=A.getRootFileNames();if(!arrayIsEqualTo(n,E)){return 0}if(!canReuseProjectReferences()){return 0}if(P){Ie=P.map(parseProjectReferenceConfigFile)}const r=[];const i=[];We=2;if(forEachEntry(A.getMissingFilePaths(),(e=>ie.fileExists(e)))){return 0}const o=A.getSourceFiles();let a;(e=>{e[e["Exists"]=0]="Exists";e[e["Modified"]=1]="Modified"})(a||(a={}));const s=new Map;for(const t of o){const n=getCreateSourceFileOptions(t.fileName,he,ie,N);let o=ie.getSourceFileByPath?ie.getSourceFileByPath(t.fileName,t.resolvedPath,n,void 0,Je):ie.getSourceFile(t.fileName,n,void 0,Je);if(!o){return 0}o.packageJsonLocations=((e=n.packageJsonLocations)==null?void 0:e.length)?n.packageJsonLocations:void 0;o.packageJsonScope=n.packageJsonScope;S.assert(!o.redirectInfo,"Host should not return a redirect source file from `getSourceFile`");let a;if(t.redirectInfo){if(o!==t.redirectInfo.unredirected){return 0}a=false;o=t}else if(A.redirectTargetsMap.has(t.path)){if(o!==t){return 0}a=false}else{a=o!==t}o.path=t.path;o.originalFileName=t.originalFileName;o.resolvedPath=t.resolvedPath;o.fileName=t.fileName;const c=A.sourceFileToPackageName.get(t.path);if(c!==void 0){const e=s.get(c);const t=a?1:0;if(e!==void 0&&t===1||e===1){return 0}s.set(c,t)}if(a){if(t.impliedNodeFormat!==o.impliedNodeFormat){We=1}else if(!arrayIsEqualTo(t.libReferenceDirectives,o.libReferenceDirectives,fileReferenceIsEqualTo)){We=1}else if(t.hasNoDefaultLib!==o.hasNoDefaultLib){We=1}else if(!arrayIsEqualTo(t.referencedFiles,o.referencedFiles,fileReferenceIsEqualTo)){We=1}else{collectExternalModuleReferences(o);if(!arrayIsEqualTo(t.imports,o.imports,moduleNameIsEqualTo)){We=1}else if(!arrayIsEqualTo(t.moduleAugmentations,o.moduleAugmentations,moduleNameIsEqualTo)){We=1}else if((t.flags&12582912)!==(o.flags&12582912)){We=1}else if(!arrayIsEqualTo(t.typeReferenceDirectives,o.typeReferenceDirectives,fileReferenceIsEqualTo)){We=1}}i.push(o)}else if(Se(t.path)){We=1;i.push(o)}r.push(o)}if(We!==2){return We}for(const e of i){const t=getModuleNames(e);const n=resolveModuleNamesReusingOldState(t,e);(Q??(Q=new Map)).set(e.path,n);const r=getCompilerOptionsForFile(e);const i=hasChangesInResolutions(t,n,(t=>A.getResolvedModule(e,t.text,getModeForUsageLocationWorker(e,t,r))),moduleResolutionIsEqualTo);if(i)We=1;const o=e.typeReferenceDirectives;const a=resolveTypeReferenceDirectiveNamesReusingOldState(o,e);(Y??(Y=new Map)).set(e.path,a);const s=hasChangesInResolutions(o,a,(t=>A.getResolvedTypeReferenceDirective(e,getTypeReferenceResolutionName(t),getModeForTypeReferenceDirectiveInFile(t,e))),typeDirectiveIsEqualTo);if(s)We=1}if(We!==2){return We}if(changesAffectingProgramStructure(t,N)){return 1}if(A.resolvedLibReferences&&forEachEntry(A.resolvedLibReferences,((e,t)=>pathForLibFileWorker(t).actual!==e.actual))){return 1}if(ie.hasChangedAutomaticTypeDirectiveNames){if(ie.hasChangedAutomaticTypeDirectiveNames())return 1}else{V=getAutomaticTypeDirectiveNames(N,ie);if(!arrayIsEqualTo(A.getAutomaticTypeDirectiveNames(),V))return 1}Pe=A.getMissingFilePaths();S.assert(r.length===A.getSourceFiles().length);for(const e of r){Fe.set(e.path,e)}const c=A.getFilesByNameMap();c.forEach(((e,t)=>{if(!e){Fe.set(t,e);return}if(e.path===t){if(A.isSourceFileFromExternalLibrary(e)){re.set(e.path,true)}return}Fe.set(t,Fe.get(e.path))}));const l=t.configFile&&t.configFile===N.configFile||!t.configFile&&!N.configFile&&!optionsHaveChanges(t,N,eo);z.reuseStateFromOldProgram(A.getProgramDiagnosticsContainer(),l);pe=l;M=r;V=A.getAutomaticTypeDirectiveNames();q=A.getAutomaticTypeDirectiveResolutions();Ee=A.sourceFileToPackageName;Ne=A.redirectTargetsMap;ke=A.usesUriStyleNodeCoreModules;$=A.resolvedModules;X=A.resolvedTypeReferenceDirectiveNames;H=A.resolvedLibReferences;Z=A.getCurrentPackagesMap();return 2}function getEmitHost(e){return{getCanonicalFileName:getCanonicalFileName,getCommonSourceDirectory:Ue.getCommonSourceDirectory,getCompilerOptions:Ue.getCompilerOptions,getCurrentDirectory:()=>ue,getSourceFile:Ue.getSourceFile,getSourceFileByPath:Ue.getSourceFileByPath,getSourceFiles:Ue.getSourceFiles,isSourceFileFromExternalLibrary:isSourceFileFromExternalLibrary,getResolvedProjectReferenceToRedirect:getResolvedProjectReferenceToRedirect,getProjectReferenceRedirect:getProjectReferenceRedirect,isSourceOfProjectReferenceRedirect:isSourceOfProjectReferenceRedirect,getSymlinkCache:getSymlinkCache,writeFile:e||writeFile2,isEmitBlocked:isEmitBlocked,shouldTransformImportCall:shouldTransformImportCall,getEmitModuleFormatOfFile:getEmitModuleFormatOfFile2,getDefaultResolutionModeForFile:getDefaultResolutionModeForFile2,getModeForResolutionAtIndex:getModeForResolutionAtIndex2,readFile:e=>ie.readFile(e),fileExists:e=>{const t=toPath3(e);if(getSourceFileByPath(t))return true;if(Pe.has(t))return false;return ie.fileExists(e)},realpath:maybeBind(ie,ie.realpath),useCaseSensitiveFileNames:()=>ie.useCaseSensitiveFileNames(),getBuildInfo:()=>{var e;return(e=Ue.getBuildInfo)==null?void 0:e.call(Ue)},getSourceFileFromReference:(e,t)=>Ue.getSourceFileFromReference(e,t),redirectTargetsMap:Ne,getFileIncludeReasons:Ue.getFileIncludeReasons,createHash:maybeBind(ie,ie.createHash),getModuleResolutionCache:()=>Ue.getModuleResolutionCache(),trace:maybeBind(ie,ie.trace),getGlobalTypingsCacheLocation:Ue.getGlobalTypingsCacheLocation}}function writeFile2(e,t,n,r,i,o){ie.writeFile(e,t,n,r,i,o)}function emitBuildInfo(e){var t,n;(t=G)==null?void 0:t.push(G.Phase.Emit,"emitBuildInfo",{},true);mark("beforeEmit");const r=emitFiles(Pa,getEmitHost(e),void 0,Na,false,true);mark("afterEmit");measure("Emit","beforeEmit","afterEmit");(n=G)==null?void 0:n.pop();return r}function getResolvedProjectReferences(){return Ie}function getProjectReferences(){return P}function isSourceFileFromExternalLibrary(e){return!!re.get(e.path)}function isSourceFileDefaultLibrary(e){if(!e.isDeclarationFile){return false}if(e.hasNoDefaultLib){return true}if(N.noLib){return false}const t=ie.useCaseSensitiveFileNames()?equateStringsCaseSensitive:equateStringsCaseInsensitive;if(!N.lib){return t(e.fileName,se())}else{return some(N.lib,(n=>{const r=H.get(n);return!!r&&t(e.fileName,r.actual)}))}}function getTypeChecker(){return B||(B=createTypeChecker(Ue))}function emit(e,t,n,r,i,o,a){var s,c;(s=G)==null?void 0:s.push(G.Phase.Emit,"emit",{path:e==null?void 0:e.path},true);const l=runWithCancellationToken((()=>emitWorker(Ue,e,t,n,r,i,o,a)));(c=G)==null?void 0:c.pop();return l}function isEmitBlocked(e){return _e.has(toPath3(e))}function emitWorker(e,t,n,r,i,o,a,s){if(!a){const i=handleNoEmitOptions(e,t,n,r);if(i)return i}const c=getTypeChecker();const l=c.getEmitResolver(N.outFile?void 0:t,r,emitResolverSkipsTypeChecking(i,a));mark("beforeEmit");const d=c.runWithCancellationToken(r,(()=>emitFiles(l,getEmitHost(n),t,getTransformers(N,o,i),i,false,a,s)));mark("afterEmit");measure("Emit","beforeEmit","afterEmit");return d}function getSourceFile(e){return getSourceFileByPath(toPath3(e))}function getSourceFileByPath(e){return Fe.get(e)||void 0}function getDiagnosticsHelper(e,t,n){if(e){return sortAndDeduplicateDiagnostics(t(e,n))}return sortAndDeduplicateDiagnostics(flatMap(Ue.getSourceFiles(),(e=>{if(n){n.throwIfCancellationRequested()}return t(e,n)})))}function getSyntacticDiagnostics(e,t){return getDiagnosticsHelper(e,getSyntacticDiagnosticsForFile,t)}function getSemanticDiagnostics(e,t,n){return getDiagnosticsHelper(e,((e,t)=>getSemanticDiagnosticsForFile(e,t,n)),t)}function getCachedSemanticDiagnostics(e){return W==null?void 0:W.get(e.path)}function getBindAndCheckDiagnostics(e,t){return getBindAndCheckDiagnosticsForFile(e,t,void 0)}function getProgramDiagnostics(e){var t;if(skipTypeChecking(e,N,Ue)){return d}const n=z.getCombinedDiagnostics(Ue).getDiagnostics(e.fileName);if(!((t=e.commentDirectives)==null?void 0:t.length)){return n}return getDiagnosticsWithPrecedingDirectives(e,e.commentDirectives,n).diagnostics}function getDeclarationDiagnostics2(e,t){return getDiagnosticsHelper(e,getDeclarationDiagnosticsForFile,t)}function getSyntacticDiagnosticsForFile(e){if(isSourceFileJS(e)){if(!e.additionalSyntacticDiagnostics){e.additionalSyntacticDiagnostics=getJSSyntacticDiagnosticsForFile(e)}return concatenate(e.additionalSyntacticDiagnostics,e.parseDiagnostics)}return e.parseDiagnostics}function runWithCancellationToken(e){try{return e()}catch(e){if(e instanceof ce){B=void 0}throw e}}function getSemanticDiagnosticsForFile(e,t,n){return concatenate(filterSemanticDiagnostics(getBindAndCheckDiagnosticsForFile(e,t,n),N),getProgramDiagnostics(e))}function getBindAndCheckDiagnosticsForFile(e,t,n){if(n){return getBindAndCheckDiagnosticsForFileNoCache(e,t,n)}let r=W==null?void 0:W.get(e.path);if(!r){(W??(W=new Map)).set(e.path,r=getBindAndCheckDiagnosticsForFileNoCache(e,t))}return r}function getBindAndCheckDiagnosticsForFileNoCache(e,t,n){return runWithCancellationToken((()=>{if(skipTypeChecking(e,N,Ue)){return d}const r=getTypeChecker();S.assert(!!e.bindDiagnostics);const i=e.scriptKind===1||e.scriptKind===2;const o=isPlainJsFile(e,N.checkJs);const a=i&&isCheckJsEnabledForFile(e,N);let s=e.bindDiagnostics;let c=r.getDiagnostics(e,t,n);if(o){s=filter(s,(e=>Ga.has(e.code)));c=filter(c,(e=>Ga.has(e.code)))}return getMergedBindAndCheckDiagnostics(e,!o,!!n,s,c,a?e.jsDocDiagnostics:void 0)}))}function getMergedBindAndCheckDiagnostics(e,t,n,...r){var i;const o=flatten(r);if(!t||!((i=e.commentDirectives)==null?void 0:i.length)){return o}const{diagnostics:a,directives:s}=getDiagnosticsWithPrecedingDirectives(e,e.commentDirectives,o);if(n){return a}for(const t of s.getUnusedExpectations()){a.push(createDiagnosticForRange(e,t.range,wt.Unused_ts_expect_error_directive))}return a}function getDiagnosticsWithPrecedingDirectives(e,t,n){const r=createCommentDirectivesMap(e,t);const i=n.filter((e=>markPrecedingCommentDirectiveLine(e,r)===-1));return{diagnostics:i,directives:r}}function getSuggestionDiagnostics(e,t){return runWithCancellationToken((()=>getTypeChecker().getSuggestionDiagnostics(e,t)))}function markPrecedingCommentDirectiveLine(e,t){const{file:n,start:r}=e;if(!n){return-1}const i=getLineStarts(n);let o=computeLineAndCharacterOfPosition(i,r).line-1;while(o>=0){if(t.markUsed(o)){return o}const e=n.text.slice(i[o],i[o+1]).trim();if(e!==""&&!/^\s*\/\/.*$/.test(e)){return-1}o--}return-1}function getJSSyntacticDiagnosticsForFile(e){return runWithCancellationToken((()=>{const t=[];walk(e,e);forEachChildRecursively(e,walk,walkArray);return t;function walk(e,n){switch(n.kind){case 169:case 172:case 174:if(n.questionToken===e){t.push(createDiagnosticForNode2(e,wt.The_0_modifier_can_only_be_used_in_TypeScript_files,"?"));return"skip"}case 173:case 176:case 177:case 178:case 218:case 262:case 219:case 260:if(n.type===e){t.push(createDiagnosticForNode2(e,wt.Type_annotations_can_only_be_used_in_TypeScript_files));return"skip"}}switch(e.kind){case 273:if(e.isTypeOnly){t.push(createDiagnosticForNode2(n,wt._0_declarations_can_only_be_used_in_TypeScript_files,"import type"));return"skip"}break;case 278:if(e.isTypeOnly){t.push(createDiagnosticForNode2(e,wt._0_declarations_can_only_be_used_in_TypeScript_files,"export type"));return"skip"}break;case 276:case 281:if(e.isTypeOnly){t.push(createDiagnosticForNode2(e,wt._0_declarations_can_only_be_used_in_TypeScript_files,isImportSpecifier(e)?"import...type":"export...type"));return"skip"}break;case 271:t.push(createDiagnosticForNode2(e,wt.import_can_only_be_used_in_TypeScript_files));return"skip";case 277:if(e.isExportEquals){t.push(createDiagnosticForNode2(e,wt.export_can_only_be_used_in_TypeScript_files));return"skip"}break;case 298:const r=e;if(r.token===119){t.push(createDiagnosticForNode2(e,wt.implements_clauses_can_only_be_used_in_TypeScript_files));return"skip"}break;case 264:const i=tokenToString(120);S.assertIsDefined(i);t.push(createDiagnosticForNode2(e,wt._0_declarations_can_only_be_used_in_TypeScript_files,i));return"skip";case 267:const o=e.flags&32?tokenToString(145):tokenToString(144);S.assertIsDefined(o);t.push(createDiagnosticForNode2(e,wt._0_declarations_can_only_be_used_in_TypeScript_files,o));return"skip";case 265:t.push(createDiagnosticForNode2(e,wt.Type_aliases_can_only_be_used_in_TypeScript_files));return"skip";case 176:case 174:case 262:if(!e.body){t.push(createDiagnosticForNode2(e,wt.Signature_declarations_can_only_be_used_in_TypeScript_files));return"skip"}return;case 266:const a=S.checkDefined(tokenToString(94));t.push(createDiagnosticForNode2(e,wt._0_declarations_can_only_be_used_in_TypeScript_files,a));return"skip";case 235:t.push(createDiagnosticForNode2(e,wt.Non_null_assertions_can_only_be_used_in_TypeScript_files));return"skip";case 234:t.push(createDiagnosticForNode2(e.type,wt.Type_assertion_expressions_can_only_be_used_in_TypeScript_files));return"skip";case 238:t.push(createDiagnosticForNode2(e.type,wt.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files));return"skip";case 216:S.fail()}}function walkArray(e,n){if(canHaveIllegalDecorators(n)){const e=find(n.modifiers,isDecorator);if(e){t.push(createDiagnosticForNode2(e,wt.Decorators_are_not_valid_here))}}else if(canHaveDecorators(n)&&n.modifiers){const e=findIndex(n.modifiers,isDecorator);if(e>=0){if(isParameter(n)&&!N.experimentalDecorators){t.push(createDiagnosticForNode2(n.modifiers[e],wt.Decorators_are_not_valid_here))}else if(isClassDeclaration(n)){const r=findIndex(n.modifiers,isExportModifier);if(r>=0){const i=findIndex(n.modifiers,isDefaultModifier);if(e>r&&i>=0&&e=0&&e=0){t.push(addRelatedInfo(createDiagnosticForNode2(n.modifiers[i],wt.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),createDiagnosticForNode2(n.modifiers[e],wt.Decorator_used_before_export_here)))}}}}}}switch(n.kind){case 263:case 231:case 174:case 176:case 177:case 178:case 218:case 262:case 219:if(e===n.typeParameters){t.push(createDiagnosticForNodeArray2(e,wt.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));return"skip"}case 243:if(e===n.modifiers){checkModifiers(n.modifiers,n.kind===243);return"skip"}break;case 172:if(e===n.modifiers){for(const n of e){if(isModifier(n)&&n.kind!==126&&n.kind!==129){t.push(createDiagnosticForNode2(n,wt.The_0_modifier_can_only_be_used_in_TypeScript_files,tokenToString(n.kind)))}}return"skip"}break;case 169:if(e===n.modifiers&&some(e,isModifier)){t.push(createDiagnosticForNodeArray2(e,wt.Parameter_modifiers_can_only_be_used_in_TypeScript_files));return"skip"}break;case 213:case 214:case 233:case 285:case 286:case 215:if(e===n.typeArguments){t.push(createDiagnosticForNodeArray2(e,wt.Type_arguments_can_only_be_used_in_TypeScript_files));return"skip"}break}}function checkModifiers(e,n){for(const r of e){switch(r.kind){case 87:if(n){continue}case 125:case 123:case 124:case 148:case 138:case 128:case 164:case 103:case 147:t.push(createDiagnosticForNode2(r,wt.The_0_modifier_can_only_be_used_in_TypeScript_files,tokenToString(r.kind)));break;case 126:case 95:case 90:case 129:}}}function createDiagnosticForNodeArray2(t,n,...r){const i=t.pos;return createFileDiagnostic(e,i,t.end-i,n,...r)}function createDiagnosticForNode2(t,n,...r){return createDiagnosticForNodeInSourceFile(e,t,n,...r)}}))}function getDeclarationDiagnosticsWorker(e,t){let n=U==null?void 0:U.get(e.path);if(!n){(U??(U=new Map)).set(e.path,n=getDeclarationDiagnosticsForFileNoCache(e,t))}return n}function getDeclarationDiagnosticsForFileNoCache(e,t){return runWithCancellationToken((()=>{const n=getTypeChecker().getEmitResolver(e,t);return getDeclarationDiagnostics(getEmitHost(noop),n,e)||d}))}function getDeclarationDiagnosticsForFile(e,t){return e.isDeclarationFile?d:getDeclarationDiagnosticsWorker(e,t)}function getOptionsDiagnostics(){return sortAndDeduplicateDiagnostics(concatenate(z.getCombinedDiagnostics(Ue).getGlobalDiagnostics(),getOptionsDiagnosticsOfConfigFile()))}function getOptionsDiagnosticsOfConfigFile(){if(!N.configFile)return d;let e=z.getCombinedDiagnostics(Ue).getDiagnostics(N.configFile.fileName);forEachResolvedProjectReference2((t=>{e=concatenate(e,z.getCombinedDiagnostics(Ue).getDiagnostics(t.sourceFile.fileName))}));return e}function getGlobalDiagnostics(){return E.length?sortAndDeduplicateDiagnostics(getTypeChecker().getGlobalDiagnostics().slice()):d}function getConfigFileParsingDiagnostics2(){return k||d}function processRootFile(e,t,n,r){processSourceFile(normalizePath(e),t,n,void 0,r)}function fileReferenceIsEqualTo(e,t){return e.fileName===t.fileName}function moduleNameIsEqualTo(e,t){return e.kind===80?t.kind===80&&e.escapedText===t.escapedText:t.kind===11&&e.text===t.text}function createSyntheticImport(e,t){const n=zr.createStringLiteral(e);const r=zr.createImportDeclaration(void 0,void 0,n);addInternalEmitFlags(r,2);setParent(n,r);setParent(r,t);n.flags&=~16;r.flags&=~16;return n}function collectExternalModuleReferences(e){if(e.imports){return}const t=isSourceFileJS(e);const n=isExternalModule(e);let r;let i;let o;if(t||!e.isDeclarationFile&&(Gn(N)||isExternalModule(e))){if(N.importHelpers){r=[createSyntheticImport(cn,e)]}const t=getJSXRuntimeImport(getJSXImplicitImportBase(N,e),N);if(t){(r||(r=[])).push(createSyntheticImport(t,e))}}for(const t of e.statements){collectModuleReferences(t,false)}if(e.flags&4194304||t){forEachDynamicImportOrRequireCall(e,true,true,((e,t)=>{setParentRecursive(e,false);r=append(r,t)}))}e.imports=r||d;e.moduleAugmentations=i||d;e.ambientModuleNames=o||d;return;function collectModuleReferences(t,a){if(isAnyImportOrReExport(t)){const n=getExternalModuleName(t);if(n&&isStringLiteral(n)&&n.text&&(!a||!isExternalModuleNameRelative(n.text))){setParentRecursive(t,false);r=append(r,n);if(!ke&&te===0&&!e.isDeclarationFile){if(startsWith(n.text,"node:")&&!Ar.has(n.text)){ke=true}else if(ke===void 0&&Ir.has(n.text)){ke=false}}}}else if(isModuleDeclaration(t)){if(isAmbientModule(t)&&(a||hasSyntacticModifier(t,128)||e.isDeclarationFile)){t.name.parent=t;const r=getTextOfIdentifierOrLiteral(t.name);if(n||a&&!isExternalModuleNameRelative(r)){(i||(i=[])).push(t.name)}else if(!a){if(e.isDeclarationFile){(o||(o=[])).push(r)}const n=t.body;if(n){for(const e of n.statements){collectModuleReferences(e,true)}}}}}}}function getLibFileFromReference(e){var t;const n=getLibFileNameFromLibReference(e);const r=n&&((t=H==null?void 0:H.get(n))==null?void 0:t.actual);return r!==void 0?getSourceFile(r):void 0}function getSourceFileFromReference(e,t){return getSourceFileFromReferenceWorker(resolveTripleslashReference(t.fileName,e.fileName),getSourceFile)}function getSourceFileFromReferenceWorker(e,t,n,r){if(hasExtension(e)){const i=ie.getCanonicalFileName(e);if(!N.allowNonTsExtensions&&!forEach(flatten(me),(e=>fileExtensionIs(i,e)))){if(n){if(hasJSFileExtension(i)){n(wt.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option,e)}else{n(wt.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1,e,"'"+flatten(fe).join("', '")+"'")}}return void 0}const o=t(e);if(n){if(!o){const t=getProjectReferenceRedirect(e);if(t){n(wt.Output_file_0_has_not_been_built_from_source_file_1,t,e)}else{n(wt.File_0_not_found,e)}}else if(isReferencedFile(r)&&i===ie.getCanonicalFileName(getSourceFileByPath(r.file).fileName)){n(wt.A_file_cannot_have_a_reference_to_itself)}}return o}else{const r=N.allowNonTsExtensions&&t(e);if(r)return r;if(n&&N.allowNonTsExtensions){n(wt.File_0_not_found,e);return void 0}const i=forEach(fe[0],(n=>t(e+n)));if(n&&!i)n(wt.Could_not_resolve_the_path_0_with_the_extensions_Colon_1,e,"'"+flatten(fe).join("', '")+"'");return i}}function processSourceFile(e,t,n,r,i){getSourceFileFromReferenceWorker(e,(e=>findSourceFile(e,t,n,i,r)),((e,...t)=>addFilePreprocessingFileExplainingDiagnostic(void 0,i,e,t)),i)}function processProjectReferenceFile(e,t){return processSourceFile(e,false,false,void 0,t)}function reportFileNamesDifferOnlyInCasingError(e,t,n){const r=!isReferencedFile(n)&&some(z.getFileReasons().get(t.path),isReferencedFile);if(r){addFilePreprocessingFileExplainingDiagnostic(t,n,wt.Already_included_file_name_0_differs_from_file_name_1_only_in_casing,[t.fileName,e])}else{addFilePreprocessingFileExplainingDiagnostic(t,n,wt.File_name_0_differs_from_already_included_file_name_1_only_in_casing,[e,t.fileName])}}function createRedirectedSourceFile(e,t,n,r,i,o,a){var s;const c=wi.createRedirectedSourceFile({redirectTarget:e,unredirected:t});c.fileName=n;c.path=r;c.resolvedPath=i;c.originalFileName=o;c.packageJsonLocations=((s=a.packageJsonLocations)==null?void 0:s.length)?a.packageJsonLocations:void 0;c.packageJsonScope=a.packageJsonScope;re.set(r,te>0);return c}function findSourceFile(e,t,n,r,i){var o,a;(o=G)==null?void 0:o.push(G.Phase.Program,"findSourceFile",{fileName:e,isDefaultLib:t||void 0,fileIncludeKind:le[r.kind]});const s=findSourceFileWorker(e,t,n,r,i);(a=G)==null?void 0:a.pop();return s}function getCreateSourceFileOptions(e,t,n,r){const i=getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(e,ue),t==null?void 0:t.getPackageJsonInfoCache(),n,r);const o=zn(r);const a=getSetExternalModuleIndicator(r);return typeof i==="object"?{...i,languageVersion:o,setExternalModuleIndicator:a,jsDocParsingMode:n.jsDocParsingMode}:{languageVersion:o,impliedNodeFormat:i,setExternalModuleIndicator:a,jsDocParsingMode:n.jsDocParsingMode}}function findSourceFileWorker(e,t,n,r,i){var o;const a=toPath3(e);if(Le){let o=getSourceOfProjectReferenceRedirect(a);if(!o&&ie.realpath&&N.preserveSymlinks&&isDeclarationFileName(e)&&e.includes(Wo)){const t=toPath3(ie.realpath(e));if(t!==a)o=getSourceOfProjectReferenceRedirect(t)}if(o){const s=isString(o)?findSourceFile(o,t,n,r,i):void 0;if(s)addFileToFilesByName(s,a,e,void 0);return s}}const s=e;if(Fe.has(a)){const n=Fe.get(a);const i=addFileIncludeReason(n||void 0,r,true);if(n&&i&&!(N.forceConsistentCasingInFileNames===false)){const t=n.fileName;const i=toPath3(t)!==toPath3(e);if(i){e=getProjectReferenceRedirect(e)||e}const o=getNormalizedAbsolutePathWithoutRoot(t,ue);const a=getNormalizedAbsolutePathWithoutRoot(e,ue);if(o!==a){reportFileNamesDifferOnlyInCasingError(e,n,r)}}if(n&&re.get(n.path)&&te===0){re.set(n.path,false);if(!N.noResolve){processReferencedFiles(n,t);processTypeReferenceDirectives(n)}if(!N.noLib){processLibReferenceDirectives(n)}ne.set(n.path,false);processImportedModules(n)}else if(n&&ne.get(n.path)){if(teaddFilePreprocessingFileExplainingDiagnostic(void 0,r,wt.Cannot_read_file_0_Colon_1,[e,t])),Je);if(i){const t=packageIdToString(i);const n=Ce.get(t);if(n){const t=createRedirectedSourceFile(n,d,e,a,toPath3(e),s,l);Ne.add(n.path,e);addFileToFilesByName(t,a,e,c);addFileIncludeReason(t,r,false);Ee.set(a,packageIdToPackageName(i));L.push(t);return t}else if(d){Ce.set(t,d);Ee.set(a,packageIdToPackageName(i))}}addFileToFilesByName(d,a,e,c);if(d){re.set(a,te>0);d.fileName=e;d.path=a;d.resolvedPath=toPath3(e);d.originalFileName=s;d.packageJsonLocations=((o=l.packageJsonLocations)==null?void 0:o.length)?l.packageJsonLocations:void 0;d.packageJsonScope=l.packageJsonScope;addFileIncludeReason(d,r,false);if(ie.useCaseSensitiveFileNames()){const t=toFileNameLowerCase(a);const n=De.get(t);if(n){reportFileNamesDifferOnlyInCasingError(e,n,r)}else{De.set(t,d)}}ae=ae||d.hasNoDefaultLib&&!n;if(!N.noResolve){processReferencedFiles(d,t);processTypeReferenceDirectives(d)}if(!N.noLib){processLibReferenceDirectives(d)}processImportedModules(d);if(t){w.push(d)}else{L.push(d)}(J??(J=new Set)).add(d.path)}return d}function addFileIncludeReason(e,t,n){if(e&&(!n||!isReferencedFile(t)||!(J==null?void 0:J.has(t.file)))){z.getFileReasons().add(e.path,t);return true}return false}function addFileToFilesByName(e,t,n,r){if(r){updateFilesByNameMap(n,r,e);updateFilesByNameMap(n,t,e||false)}else{updateFilesByNameMap(n,t,e)}}function updateFilesByNameMap(e,t,n){Fe.set(t,n);if(n!==void 0)Pe.delete(t);else Pe.set(t,e)}function getProjectReferenceRedirect(e){const t=getProjectReferenceRedirectProject(e);return t&&getProjectReferenceOutputName(t,e)}function getProjectReferenceRedirectProject(e){if(!Ie||!Ie.length||isDeclarationFileName(e)||fileExtensionIs(e,".json")){return void 0}return getResolvedProjectReferenceToRedirect(e)}function getProjectReferenceOutputName(e,t){const n=e.commandLine.options.outFile;return n?changeExtension(n,".d.ts"):getOutputDeclarationFileName(t,e.commandLine,!ie.useCaseSensitiveFileNames())}function getResolvedProjectReferenceToRedirect(e){if(Oe===void 0){Oe=new Map;forEachResolvedProjectReference2((e=>{if(toPath3(N.configFilePath)!==e.sourceFile.path){e.commandLine.fileNames.forEach((t=>Oe.set(toPath3(t),e.sourceFile.path)))}}))}const t=Oe.get(toPath3(e));return t&&getResolvedProjectReferenceByPath(t)}function forEachResolvedProjectReference2(e){return forEachResolvedProjectReference(Ie,e)}function getSourceOfProjectReferenceRedirect(e){if(!isDeclarationFileName(e))return void 0;if(we===void 0){we=new Map;forEachResolvedProjectReference2((e=>{const t=e.commandLine.options.outFile;if(t){const e=changeExtension(t,".d.ts");we.set(toPath3(e),true)}else{const t=memoize((()=>getCommonSourceDirectoryOfConfig(e.commandLine,!ie.useCaseSensitiveFileNames())));forEach(e.commandLine.fileNames,(n=>{if(!isDeclarationFileName(n)&&!fileExtensionIs(n,".json")){const r=getOutputDeclarationFileName(n,e.commandLine,!ie.useCaseSensitiveFileNames(),t);we.set(toPath3(r),n)}}))}}))}return we.get(e)}function isSourceOfProjectReferenceRedirect(e){return Le&&!!getResolvedProjectReferenceToRedirect(e)}function getResolvedProjectReferenceByPath(e){if(!Ae){return void 0}return Ae.get(e)||void 0}function processReferencedFiles(e,t){forEach(e.referencedFiles,((n,r)=>{processSourceFile(resolveTripleslashReference(n.fileName,e.fileName),t,false,void 0,{kind:4,file:e.path,index:r})}))}function processTypeReferenceDirectives(e){const t=e.typeReferenceDirectives;if(!t.length)return;const n=(Y==null?void 0:Y.get(e.path))||resolveTypeReferenceDirectiveNamesReusingOldState(t,e);const r=createModeAwareCache();(X??(X=new Map)).set(e.path,r);for(let i=0;i{const r=getLibFileNameFromLibReference(t);if(r){processRootFile(pathForLibFile(r),true,true,{kind:7,file:e.path,index:n})}else{z.addFileProcessingDiagnostic({kind:0,reason:{kind:7,file:e.path,index:n}})}}))}function getCanonicalFileName(e){return ie.getCanonicalFileName(e)}function processImportedModules(e){collectExternalModuleReferences(e);if(e.imports.length||e.moduleAugmentations.length){const t=getModuleNames(e);const n=(Q==null?void 0:Q.get(e.path))||resolveModuleNamesReusingOldState(t,e);S.assert(n.length===t.length);const r=getCompilerOptionsForFile(e);const i=createModeAwareCache();($??($=new Map)).set(e.path,i);for(let o=0;oee;const m=u&&!getResolutionDiagnostic(r,a,e)&&!r.noResolve&&oisExternalModule(e)&&!e.isDeclarationFile));if(N.isolatedModules||N.verbatimModuleSyntax){if(N.module===0&&t<2&&N.isolatedModules){createDiagnosticForOptionName(wt.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher,"isolatedModules","target")}if(N.preserveConstEnums===false){createDiagnosticForOptionName(wt.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled,N.verbatimModuleSyntax?"verbatimModuleSyntax":"isolatedModules","preserveConstEnums")}}else if(n&&t<2&&N.module===0){const e=getErrorSpanForNode(n,typeof n.externalModuleIndicator==="boolean"?n:n.externalModuleIndicator);z.addConfigDiagnostic(createFileDiagnostic(n,e.start,e.length,wt.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none))}if(e&&!N.emitDeclarationOnly){if(N.module&&!(N.module===2||N.module===4)){createDiagnosticForOptionName(wt.Only_amd_and_system_modules_are_supported_alongside_0,"outFile","module")}else if(N.module===void 0&&n){const e=getErrorSpanForNode(n,typeof n.externalModuleIndicator==="boolean"?n:n.externalModuleIndicator);z.addConfigDiagnostic(createFileDiagnostic(n,e.start,e.length,wt.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system,"outFile"))}}if(Yn(N)){if(qn(N)===1){createDiagnosticForOptionName(wt.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic,"resolveJsonModule")}else if(!hasJsonModuleEmitEnabled(N)){createDiagnosticForOptionName(wt.Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd,"resolveJsonModule","module")}}if(N.outDir||N.rootDir||N.sourceRoot||N.mapRoot||Zn(N)&&N.declarationDir){const e=getCommonSourceDirectory2();if(N.outDir&&e===""&&M.some((e=>getRootLength(e.fileName)>1))){createDiagnosticForOptionName(wt.Cannot_find_the_common_subdirectory_path_for_the_input_files,"outDir")}}if(N.checkJs&&!rr(N)){createDiagnosticForOptionName(wt.Option_0_cannot_be_specified_without_specifying_option_1,"checkJs","allowJs")}if(N.emitDeclarationOnly){if(!Zn(N)){createDiagnosticForOptionName(wt.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"emitDeclarationOnly","declaration","composite")}}if(N.emitDecoratorMetadata&&!N.experimentalDecorators){createDiagnosticForOptionName(wt.Option_0_cannot_be_specified_without_specifying_option_1,"emitDecoratorMetadata","experimentalDecorators")}if(N.jsxFactory){if(N.reactNamespace){createDiagnosticForOptionName(wt.Option_0_cannot_be_specified_with_option_1,"reactNamespace","jsxFactory")}if(N.jsx===4||N.jsx===5){createDiagnosticForOptionName(wt.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFactory",qi.get(""+N.jsx))}if(!parseIsolatedEntityName(N.jsxFactory,t)){createOptionValueDiagnostic("jsxFactory",wt.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name,N.jsxFactory)}}else if(N.reactNamespace&&!isIdentifierText(N.reactNamespace,t)){createOptionValueDiagnostic("reactNamespace",wt.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier,N.reactNamespace)}if(N.jsxFragmentFactory){if(!N.jsxFactory){createDiagnosticForOptionName(wt.Option_0_cannot_be_specified_without_specifying_option_1,"jsxFragmentFactory","jsxFactory")}if(N.jsx===4||N.jsx===5){createDiagnosticForOptionName(wt.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFragmentFactory",qi.get(""+N.jsx))}if(!parseIsolatedEntityName(N.jsxFragmentFactory,t)){createOptionValueDiagnostic("jsxFragmentFactory",wt.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name,N.jsxFragmentFactory)}}if(N.reactNamespace){if(N.jsx===4||N.jsx===5){createDiagnosticForOptionName(wt.Option_0_cannot_be_specified_when_option_jsx_is_1,"reactNamespace",qi.get(""+N.jsx))}}if(N.jsxImportSource){if(N.jsx===2){createDiagnosticForOptionName(wt.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxImportSource",qi.get(""+N.jsx))}}const r=Vn(N);if(N.verbatimModuleSyntax){if(r===2||r===3||r===4){createDiagnosticForOptionName(wt.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System,"verbatimModuleSyntax")}}if(N.allowImportingTsExtensions&&!(N.noEmit||N.emitDeclarationOnly||N.rewriteRelativeImportExtensions)){createOptionValueDiagnostic("allowImportingTsExtensions",wt.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set)}const i=qn(N);if(N.resolvePackageJsonExports&&!moduleResolutionSupportsPackageJsonExportsAndImports(i)){createDiagnosticForOptionName(wt.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler,"resolvePackageJsonExports")}if(N.resolvePackageJsonImports&&!moduleResolutionSupportsPackageJsonExportsAndImports(i)){createDiagnosticForOptionName(wt.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler,"resolvePackageJsonImports")}if(N.customConditions&&!moduleResolutionSupportsPackageJsonExportsAndImports(i)){createDiagnosticForOptionName(wt.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler,"customConditions")}if(i===100&&!emitModuleKindIsNonNodeESM(r)&&r!==200){createOptionValueDiagnostic("moduleResolution",wt.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later,"bundler")}if(Qe[r]&&(100<=r&&r<=199)&&!(3<=i&&i<=99)){const e=Qe[r];const t=qe[e]?e:"Node16";createOptionValueDiagnostic("moduleResolution",wt.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1,t,e)}else if(qe[i]&&(3<=i&&i<=99)&&!(100<=r&&r<=199)){const e=qe[i];createOptionValueDiagnostic("module",wt.Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1,e,e)}if(!N.noEmit&&!N.suppressOutputPathCheck){const e=getEmitHost();const t=new Set;forEachEmittedFile(e,(e=>{if(!N.emitDeclarationOnly){verifyEmitFilePath(e.jsFilePath,t)}verifyEmitFilePath(e.declarationFilePath,t)}))}function verifyEmitFilePath(e,t){if(e){const n=toPath3(e);if(Fe.has(n)){let t;if(!N.configFilePath){t=chainDiagnosticMessages(void 0,wt.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig)}t=chainDiagnosticMessages(t,wt.Cannot_write_file_0_because_it_would_overwrite_input_file,e);blockEmittingOfFile(e,createCompilerDiagnosticFromMessageChain(t))}const r=!ie.useCaseSensitiveFileNames()?toFileNameLowerCase(n):n;if(t.has(r)){blockEmittingOfFile(e,createCompilerDiagnostic(wt.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files,e))}else{t.add(r)}}}}function getIgnoreDeprecationsVersion(){const e=N.ignoreDeprecations;if(e){if(e==="5.0"){return new F(e)}O()}return F.zero}function checkDeprecations(e,t,n,r){const i=new F(e);const o=new F(t);const a=new F(D||s);const c=getIgnoreDeprecationsVersion();const l=!(o.compareTo(a)===1);const d=!l&&c.compareTo(i)===-1;if(l||d){r(((r,i,o)=>{if(l){if(i===void 0){n(r,i,o,wt.Option_0_has_been_removed_Please_remove_it_from_your_configuration,r)}else{n(r,i,o,wt.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration,r,i)}}else{if(i===void 0){n(r,i,o,wt.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error,r,t,e)}else{n(r,i,o,wt.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error,r,i,t,e)}}}))}}function verifyDeprecatedCompilerOptions(){function createDiagnostic(e,t,n,r,...i){if(n){const o=chainDiagnosticMessages(void 0,wt.Use_0_instead,n);const a=chainDiagnosticMessages(o,r,...i);createDiagnosticForOption(!t,e,void 0,a)}else{createDiagnosticForOption(!t,e,void 0,r,...i)}}checkDeprecations("5.0","5.5",createDiagnostic,(e=>{if(N.target===0){e("target","ES3")}if(N.noImplicitUseStrict){e("noImplicitUseStrict")}if(N.keyofStringsOnly){e("keyofStringsOnly")}if(N.suppressExcessPropertyErrors){e("suppressExcessPropertyErrors")}if(N.suppressImplicitAnyIndexErrors){e("suppressImplicitAnyIndexErrors")}if(N.noStrictGenericChecks){e("noStrictGenericChecks")}if(N.charset){e("charset")}if(N.out){e("out",void 0,"outFile")}if(N.importsNotUsedAsValues){e("importsNotUsedAsValues",void 0,"verbatimModuleSyntax")}if(N.preserveValueImports){e("preserveValueImports",void 0,"verbatimModuleSyntax")}}))}function verifyDeprecatedProjectReference(e,t,n){function createDiagnostic(e,r,i,o,...a){createDiagnosticForReference(t,n,o,...a)}checkDeprecations("5.0","5.5",createDiagnostic,(t=>{if(e.prepend){t("prepend")}}))}function addFilePreprocessingFileExplainingDiagnostic(e,t,n,r){z.addFileProcessingDiagnostic({kind:1,file:e&&e.path,fileProcessingReason:t,diagnostic:n,args:r})}function verifyProjectReferences(){const e=!N.suppressOutputPathCheck?getTsBuildInfoEmitOutputFilePath(N):void 0;forEachProjectReference(P,Ie,((t,n,r)=>{const i=(n?n.commandLine.projectReferences:P)[r];const o=n&&n.sourceFile;verifyDeprecatedProjectReference(i,o,r);if(!t){createDiagnosticForReference(o,r,wt.File_0_not_found,i.path);return}const a=t.commandLine.options;if(!a.composite||a.noEmit){const e=n?n.commandLine.fileNames:E;if(e.length){if(!a.composite)createDiagnosticForReference(o,r,wt.Referenced_project_0_must_have_setting_composite_Colon_true,i.path);if(a.noEmit)createDiagnosticForReference(o,r,wt.Referenced_project_0_may_not_disable_emit,i.path)}}if(!n&&e&&e===getTsBuildInfoEmitOutputFilePath(a)){createDiagnosticForReference(o,r,wt.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1,e,i.path);_e.set(toPath3(e),true)}}))}function createDiagnosticForOptionPathKeyValue(e,t,n,...r){let i=true;forEachOptionPathsSyntax((o=>{if(isObjectLiteralExpression(o.initializer)){forEachPropertyAssignment(o.initializer,e,(e=>{const o=e.initializer;if(isArrayLiteralExpression(o)&&o.elements.length>t){z.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(N.configFile,o.elements[t],n,...r));i=false}}))}}));if(i){createCompilerOptionsDiagnostic(n,...r)}}function createDiagnosticForOptionPaths(e,t,n,...r){let i=true;forEachOptionPathsSyntax((o=>{if(isObjectLiteralExpression(o.initializer)&&createOptionDiagnosticInObjectLiteralSyntax(o.initializer,e,t,void 0,n,...r)){i=false}}));if(i){createCompilerOptionsDiagnostic(n,...r)}}function forEachOptionPathsSyntax(e){return forEachOptionsSyntaxByName(getCompilerOptionsObjectLiteralSyntax(),"paths",e)}function createDiagnosticForOptionName(e,t,n,r){createDiagnosticForOption(true,t,n,e,t,n,r)}function createOptionValueDiagnostic(e,t,...n){createDiagnosticForOption(false,e,void 0,t,...n)}function createDiagnosticForReference(e,t,n,...r){const i=forEachTsConfigPropArray(e||N.configFile,"references",(e=>isArrayLiteralExpression(e.initializer)?e.initializer:void 0));if(i&&i.elements.length>t){z.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(e||N.configFile,i.elements[t],n,...r))}else{z.addConfigDiagnostic(createCompilerDiagnostic(n,...r))}}function createDiagnosticForOption(e,t,n,r,...i){const o=getCompilerOptionsObjectLiteralSyntax();const a=!o||!createOptionDiagnosticInObjectLiteralSyntax(o,e,t,n,r,...i);if(a){createCompilerOptionsDiagnostic(r,...i)}}function createCompilerOptionsDiagnostic(e,...t){const n=getCompilerOptionsPropertySyntax();if(n){if("messageText"in e){z.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(N.configFile,n.name,e))}else{z.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(N.configFile,n.name,e,...t))}}else if("messageText"in e){z.addConfigDiagnostic(createCompilerDiagnosticFromMessageChain(e))}else{z.addConfigDiagnostic(createCompilerDiagnostic(e,...t))}}function getCompilerOptionsObjectLiteralSyntax(){if(ge===void 0){const e=getCompilerOptionsPropertySyntax();ge=e?tryCast(e.initializer,isObjectLiteralExpression)||false:false}return ge||void 0}function getCompilerOptionsPropertySyntax(){if(ye===void 0){ye=forEachPropertyAssignment(getTsConfigObjectLiteralExpression(N.configFile),"compilerOptions",identity)||false}return ye||void 0}function createOptionDiagnosticInObjectLiteralSyntax(e,t,n,r,i,...o){let a=false;forEachPropertyAssignment(e,n,(e=>{if("messageText"in i){z.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(N.configFile,t?e.name:e.initializer,i))}else{z.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(N.configFile,t?e.name:e.initializer,i,...o))}a=true}),r);return a}function blockEmittingOfFile(e,t){_e.set(toPath3(e),true);z.addConfigDiagnostic(t)}function isEmittedFile(e){if(N.noEmit){return false}const t=toPath3(e);if(getSourceFileByPath(t)){return false}const n=N.outFile;if(n){return isSameFile(t,n)||isSameFile(t,removeFileExtension(n)+".d.ts")}if(N.declarationDir&&containsPath(N.declarationDir,t,ue,!ie.useCaseSensitiveFileNames())){return true}if(N.outDir){return containsPath(N.outDir,t,ue,!ie.useCaseSensitiveFileNames())}if(fileExtensionIsOneOf(t,Tr)||isDeclarationFileName(t)){const e=removeFileExtension(t);return!!getSourceFileByPath(e+".ts")||!!getSourceFileByPath(e+".tsx")}return false}function isSameFile(e,t){return comparePaths(e,t,ue,!ie.useCaseSensitiveFileNames())===0}function getSymlinkCache(){if(ie.getSymlinkCache){return ie.getSymlinkCache()}if(!R){R=createSymlinkCache(ue,getCanonicalFileName)}if(M&&!R.hasProcessedResolutions()){R.setSymlinksFromResolutions(forEachResolvedModule,forEachResolvedTypeReferenceDirective,q)}return R}function getModeForUsageLocation2(e,t){return getModeForUsageLocationWorker(e,t,getCompilerOptionsForFile(e))}function getEmitSyntaxForUsageLocation(e,t){return getEmitSyntaxForUsageLocationWorker(e,t,getCompilerOptionsForFile(e))}function getModeForResolutionAtIndex2(e,t){return getModeForUsageLocation2(e,getModuleNameStringLiteralAt(e,t))}function getDefaultResolutionModeForFile2(e){return getDefaultResolutionModeForFileWorker(e,getCompilerOptionsForFile(e))}function getImpliedNodeFormatForEmit2(e){return getImpliedNodeFormatForEmitWorker(e,getCompilerOptionsForFile(e))}function getEmitModuleFormatOfFile2(e){return getEmitModuleFormatOfFileWorker(e,getCompilerOptionsForFile(e))}function shouldTransformImportCall(e){return shouldTransformImportCallWorker(e,getCompilerOptionsForFile(e))}function getModeForTypeReferenceDirectiveInFile(e,t){return e.resolutionMode||getDefaultResolutionModeForFile2(t)}}function shouldTransformImportCallWorker(e,t){const n=Vn(t);if(100<=n&&n<=199||n===200){return false}return getEmitModuleFormatOfFileWorker(e,t)<5}function getEmitModuleFormatOfFileWorker(e,t){return getImpliedNodeFormatForEmitWorker(e,t)??Vn(t)}function getImpliedNodeFormatForEmitWorker(e,t){var n,r;const i=Vn(t);if(100<=i&&i<=199){return e.impliedNodeFormat}if(e.impliedNodeFormat===1&&(((n=e.packageJsonScope)==null?void 0:n.contents.packageJsonContent.type)==="commonjs"||fileExtensionIsOneOf(e.fileName,[".cjs",".cts"]))){return 1}if(e.impliedNodeFormat===99&&(((r=e.packageJsonScope)==null?void 0:r.contents.packageJsonContent.type)==="module"||fileExtensionIsOneOf(e.fileName,[".mjs",".mts"]))){return 99}return void 0}function getDefaultResolutionModeForFileWorker(e,t){return importSyntaxAffectsModuleResolution(t)?getImpliedNodeFormatForEmitWorker(e,t):void 0}function updateHostForUseSourceOfProjectReferenceRedirect(e){let t;const n=e.compilerHost.fileExists;const r=e.compilerHost.directoryExists;const i=e.compilerHost.getDirectories;const o=e.compilerHost.realpath;if(!e.useSourceOfProjectReferenceRedirect)return{onProgramCreateComplete:noop,fileExists:fileExists};e.compilerHost.fileExists=fileExists;let a;if(r){a=e.compilerHost.directoryExists=n=>{if(r.call(e.compilerHost,n)){handleDirectoryCouldBeSymlink(n);return true}if(!e.getResolvedProjectReferences())return false;if(!t){t=new Set;e.forEachResolvedProjectReference((n=>{const r=n.commandLine.options.outFile;if(r){t.add(getDirectoryPath(e.toPath(r)))}else{const r=n.commandLine.options.declarationDir||n.commandLine.options.outDir;if(r){t.add(e.toPath(r))}}}))}return fileOrDirectoryExistsUsingSource(n,false)}}if(i){e.compilerHost.getDirectories=t=>!e.getResolvedProjectReferences()||r&&r.call(e.compilerHost,t)?i.call(e.compilerHost,t):[]}if(o){e.compilerHost.realpath=t=>{var n;return((n=e.getSymlinkCache().getSymlinkedFiles())==null?void 0:n.get(e.toPath(t)))||o.call(e.compilerHost,t)}}return{onProgramCreateComplete:onProgramCreateComplete,fileExists:fileExists,directoryExists:a};function onProgramCreateComplete(){e.compilerHost.fileExists=n;e.compilerHost.directoryExists=r;e.compilerHost.getDirectories=i}function fileExists(t){if(n.call(e.compilerHost,t))return true;if(!e.getResolvedProjectReferences())return false;if(!isDeclarationFileName(t))return false;return fileOrDirectoryExistsUsingSource(t,true)}function fileExistsIfProjectReferenceDts(t){const r=e.getSourceOfProjectReferenceRedirect(e.toPath(t));return r!==void 0?isString(r)?n.call(e.compilerHost,r):true:void 0}function directoryExistsIfProjectReferenceDeclDir(n){const r=e.toPath(n);const i=`${r}${Pt}`;return forEachKey(t,(e=>r===e||startsWith(e,i)||startsWith(r,`${e}/`)))}function handleDirectoryCouldBeSymlink(t){var n;if(!e.getResolvedProjectReferences()||containsIgnoredPath(t))return;if(!o||!t.includes(Wo))return;const r=e.getSymlinkCache();const i=ensureTrailingDirectorySeparator(e.toPath(t));if((n=r.getSymlinkedDirectories())==null?void 0:n.has(i))return;const a=normalizePath(o.call(e.compilerHost,t));let s;if(a===t||(s=ensureTrailingDirectorySeparator(e.toPath(a)))===i){r.setSymlinkedDirectory(i,false);return}r.setSymlinkedDirectory(t,{real:ensureTrailingDirectorySeparator(a),realPath:s})}function fileOrDirectoryExistsUsingSource(t,n){var r;const i=n?e=>fileExistsIfProjectReferenceDts(e):e=>directoryExistsIfProjectReferenceDeclDir(e);const o=i(t);if(o!==void 0)return o;const a=e.getSymlinkCache();const s=a.getSymlinkedDirectories();if(!s)return false;const c=e.toPath(t);if(!c.includes(Wo))return false;if(n&&((r=a.getSymlinkedFiles())==null?void 0:r.has(c)))return true;return firstDefinedIterator(s.entries(),(([r,o])=>{if(!o||!startsWith(c,r))return void 0;const s=i(c.replace(r,o.realPath));if(n&&s){const n=getNormalizedAbsolutePath(t,e.compilerHost.getCurrentDirectory());a.setSymlinkedFile(c,`${o.real}${n.replace(new RegExp(r,"i"),"")}`)}return s}))||false}}var Ka={diagnostics:d,sourceMaps:void 0,emittedFiles:void 0,emitSkipped:true};function handleNoEmitOptions(e,t,n,r){const i=e.getCompilerOptions();if(i.noEmit){return t?Ka:e.emitBuildInfo(n,r)}if(!i.noEmitOnError)return void 0;let o=[...e.getOptionsDiagnostics(r),...e.getSyntacticDiagnostics(t,r),...e.getGlobalDiagnostics(r),...e.getSemanticDiagnostics(t,r)];if(o.length===0&&Zn(e.getCompilerOptions())){o=e.getDeclarationDiagnostics(void 0,r)}if(!o.length)return void 0;let a;if(!t){const t=e.emitBuildInfo(n,r);if(t.diagnostics)o=[...o,...t.diagnostics];a=t.emittedFiles}return{diagnostics:o,sourceMaps:void 0,emittedFiles:a,emitSkipped:true}}function filterSemanticDiagnostics(e,t){return filter(e,(e=>!e.skippedOn||!t[e.skippedOn]))}function parseConfigHostFromCompilerHostLike(e,t=e){return{fileExists:e=>t.fileExists(e),readDirectory(e,n,r,i,o){S.assertIsDefined(t.readDirectory,"'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'");return t.readDirectory(e,n,r,i,o)},readFile:e=>t.readFile(e),directoryExists:maybeBind(t,t.directoryExists),getDirectories:maybeBind(t,t.getDirectories),realpath:maybeBind(t,t.realpath),useCaseSensitiveFileNames:e.useCaseSensitiveFileNames(),getCurrentDirectory:()=>e.getCurrentDirectory(),onUnRecoverableConfigFileDiagnostic:e.onUnRecoverableConfigFileDiagnostic||returnUndefined,trace:e.trace?t=>e.trace(t):void 0}}function resolveProjectReferencePath(e){return resolveConfigFileProjectName(e.path)}function getResolutionDiagnostic(e,{extension:t},{isDeclarationFile:n}){switch(t){case".ts":case".d.ts":case".mts":case".d.mts":case".cts":case".d.cts":return void 0;case".tsx":return needJsx();case".jsx":return needJsx()||needAllowJs();case".js":case".mjs":case".cjs":return needAllowJs();case".json":return needResolveJsonModule();default:return needAllowArbitraryExtensions()}function needJsx(){return e.jsx?void 0:wt.Module_0_was_resolved_to_1_but_jsx_is_not_set}function needAllowJs(){return rr(e)||!getStrictOptionValue(e,"noImplicitAny")?void 0:wt.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type}function needResolveJsonModule(){return Yn(e)?void 0:wt.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used}function needAllowArbitraryExtensions(){return n||e.allowArbitraryExtensions?void 0:wt.Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set}}function getModuleNames({imports:e,moduleAugmentations:t}){const n=e.map((e=>e));for(const e of t){if(e.kind===11){n.push(e)}}return n}function getModuleNameStringLiteralAt({imports:e,moduleAugmentations:t},n){if(nt.add(e)));r==null?void 0:r.forEach((n=>{switch(n.kind){case 1:return t.add(createDiagnosticExplainingFile(e,n.file&&e.getSourceFileByPath(n.file),n.fileProcessingReason,n.diagnostic,n.args||d));case 0:return t.add(filePreprocessingLibreferenceDiagnostic(e,n));case 2:return n.diagnostics.forEach((e=>t.add(e)));default:S.assertNever(n)}}));a==null?void 0:a.forEach((({file:n,diagnostic:r,args:i})=>t.add(createDiagnosticExplainingFile(e,n,void 0,r,i))));s=void 0;c=void 0;return t}};function filePreprocessingLibreferenceDiagnostic(e,{reason:t}){const{file:n,pos:r,end:i}=getReferencedFileLocation(e,t);const o=n.libReferenceDirectives[t.index];const a=getLibNameFromLibReference(o);const s=removeSuffix(removePrefix(a,"lib."),".d.ts");const c=getSpellingSuggestion(s,Gi,identity);return createFileDiagnostic(n,S.checkDefined(r),S.checkDefined(i)-r,c?wt.Cannot_find_lib_definition_for_0_Did_you_mean_1:wt.Cannot_find_lib_definition_for_0,a,c)}function createDiagnosticExplainingFile(e,t,r,i,o){let a;let c;let l;let p;let u;let f;const m=t&&n.get(t.path);let _=isReferencedFile(r)?r:void 0;let g=t&&(s==null?void 0:s.get(t.path));if(g){if(g.fileIncludeReasonDetails){a=new Set(m);m==null?void 0:m.forEach(populateRelatedInfo)}else{m==null?void 0:m.forEach(processReason)}u=g.redirectInfo}else{m==null?void 0:m.forEach(processReason);u=t&&explainIfFileIsRedirectAndImpliedFormat(t,e.getCompilerOptionsForFile(t))}if(r)processReason(r);const y=(a==null?void 0:a.size)!==(m==null?void 0:m.length);if(_&&(a==null?void 0:a.size)===1)a=void 0;if(a&&g){if(g.details&&!y){f=chainDiagnosticMessages(g.details,i,...o??d)}else if(g.fileIncludeReasonDetails){if(!y){if(!cachedFileIncludeDetailsHasProcessedExtraReason()){p=g.fileIncludeReasonDetails}else{c=g.fileIncludeReasonDetails.next.slice(0,m.length)}}else{if(!cachedFileIncludeDetailsHasProcessedExtraReason()){c=[...g.fileIncludeReasonDetails.next,c[0]]}else{c=append(g.fileIncludeReasonDetails.next.slice(0,m.length),c[0])}}}}if(!f){if(!p)p=a&&chainDiagnosticMessages(c,wt.The_file_is_in_the_program_because_Colon);f=chainDiagnosticMessages(u?p?[p,...u]:u:p,i,...o||d)}if(t){if(g){if(!g.fileIncludeReasonDetails||!y&&p){g.fileIncludeReasonDetails=p}}else{(s??(s=new Map)).set(t.path,g={fileIncludeReasonDetails:p,redirectInfo:u})}if(!g.details&&!y)g.details=f.next}const h=_&&getReferencedFileLocation(e,_);return h&&isReferenceFileLocation(h)?createFileDiagnosticFromMessageChain(h.file,h.pos,h.end-h.pos,f,l):createCompilerDiagnosticFromMessageChain(f,l);function processReason(t){if(a==null?void 0:a.has(t))return;(a??(a=new Set)).add(t);(c??(c=[])).push(fileIncludeReasonToDiagnostics(e,t));populateRelatedInfo(t)}function populateRelatedInfo(t){if(!_&&isReferencedFile(t)){_=t}else if(_!==t){l=append(l,getFileIncludeReasonToRelatedInformation(e,t))}}function cachedFileIncludeDetailsHasProcessedExtraReason(){var e;return((e=g.fileIncludeReasonDetails.next)==null?void 0:e.length)!==(m==null?void 0:m.length)}}function getFileIncludeReasonToRelatedInformation(e,t){let n=c==null?void 0:c.get(t);if(n===void 0)(c??(c=new Map)).set(t,n=fileIncludeReasonToRelatedInformation(e,t)??false);return n||void 0}function fileIncludeReasonToRelatedInformation(t,n){if(isReferencedFile(n)){const e=getReferencedFileLocation(t,n);let r;switch(n.kind){case 3:r=wt.File_is_included_via_import_here;break;case 4:r=wt.File_is_included_via_reference_here;break;case 5:r=wt.File_is_included_via_type_library_reference_here;break;case 7:r=wt.File_is_included_via_library_reference_here;break;default:S.assertNever(n)}return isReferenceFileLocation(e)?createFileDiagnostic(e.file,e.pos,e.end-e.pos,r):void 0}const r=t.getCurrentDirectory();const i=t.getRootFileNames();const o=t.getCompilerOptions();if(!o.configFile)return void 0;let a;let s;switch(n.kind){case 0:if(!o.configFile.configFileSpecs)return void 0;const c=getNormalizedAbsolutePath(i[n.index],r);const l=getMatchedFileSpec(t,c);if(l){a=getTsConfigPropArrayElementValue(o.configFile,"files",l);s=wt.File_is_matched_by_files_list_specified_here;break}const d=getMatchedIncludeSpec(t,c);if(!d||!isString(d))return void 0;a=getTsConfigPropArrayElementValue(o.configFile,"include",d);s=wt.File_is_matched_by_include_pattern_specified_here;break;case 1:case 2:const p=t.getResolvedProjectReferences();const u=t.getProjectReferences();const f=S.checkDefined(p==null?void 0:p[n.index]);const m=forEachProjectReference(u,p,((e,t,n)=>e===f?{sourceFile:(t==null?void 0:t.sourceFile)||o.configFile,index:n}:void 0));if(!m)return void 0;const{sourceFile:_,index:g}=m;const y=forEachTsConfigPropArray(_,"references",(e=>isArrayLiteralExpression(e.initializer)?e.initializer:void 0));return y&&y.elements.length>g?createDiagnosticForNodeInSourceFile(_,y.elements[g],n.kind===2?wt.File_is_output_from_referenced_project_specified_here:wt.File_is_source_from_referenced_project_specified_here):void 0;case 8:if(!o.types)return void 0;a=getOptionsSyntaxByArrayElementValue(e(),"types",n.typeReference);s=wt.File_is_entry_point_of_type_library_specified_here;break;case 6:if(n.index!==void 0){a=getOptionsSyntaxByArrayElementValue(e(),"lib",o.lib[n.index]);s=wt.File_is_library_specified_here;break}const h=getNameOfScriptTarget(zn(o));a=h?getOptionsSyntaxByValue(e(),"target",h):void 0;s=wt.File_is_default_library_for_target_specified_here;break;default:S.assertNever(n)}return a&&createDiagnosticForNodeInSourceFile(o.configFile,a,s)}}function getFileEmitOutput(e,t,n,r,i,o){const a=[];const{emitSkipped:s,diagnostics:c}=e.emit(t,writeFile2,r,n,i,o);return{outputFiles:a,emitSkipped:s,diagnostics:c};function writeFile2(e,t,n){a.push({name:e,writeByteOrderMark:n,text:t})}}var $a=(e=>{e[e["ComputedDts"]=0]="ComputedDts";e[e["StoredSignatureAtEmit"]=1]="StoredSignatureAtEmit";e[e["UsedVersion"]=2]="UsedVersion";return e})($a||{});var Qa;(e=>{function createManyToManyPathMap(){function create2(e,t,n){const r={getKeys:e=>t.get(e),getValues:t=>e.get(t),keys:()=>e.keys(),size:()=>e.size,deleteKey:r=>{(n||(n=new Set)).add(r);const i=e.get(r);if(!i){return false}i.forEach((e=>deleteFromMultimap(t,e,r)));e.delete(r);return true},set:(i,o)=>{n==null?void 0:n.delete(i);const a=e.get(i);e.set(i,o);a==null?void 0:a.forEach((e=>{if(!o.has(e)){deleteFromMultimap(t,e,i)}}));o.forEach((e=>{if(!(a==null?void 0:a.has(e))){addToMultimap(t,e,i)}}));return r}};return r}return create2(new Map,new Map,void 0)}e.createManyToManyPathMap=createManyToManyPathMap;function addToMultimap(e,t,n){let r=e.get(t);if(!r){r=new Set;e.set(t,r)}r.add(n)}function deleteFromMultimap(e,t,n){const r=e.get(t);if(r==null?void 0:r.delete(n)){if(!r.size){e.delete(t)}return true}return false}function getReferencedFilesFromImportedModuleSymbol(e){return mapDefined(e.declarations,(e=>{var t;return(t=getSourceFileOfNode(e))==null?void 0:t.resolvedPath}))}function getReferencedFilesFromImportLiteral(e,t){const n=e.getSymbolAtLocation(t);return n&&getReferencedFilesFromImportedModuleSymbol(n)}function getReferencedFileFromFileName(e,t,n,r){return toPath(e.getProjectReferenceRedirect(t)||t,n,r)}function getReferencedFiles(e,t,n){let r;if(t.imports&&t.imports.length>0){const n=e.getTypeChecker();for(const e of t.imports){const t=getReferencedFilesFromImportLiteral(n,e);t==null?void 0:t.forEach(addReferencedFile)}}const i=getDirectoryPath(t.resolvedPath);if(t.referencedFiles&&t.referencedFiles.length>0){for(const r of t.referencedFiles){const t=getReferencedFileFromFileName(e,r.fileName,i,n);addReferencedFile(t)}}e.forEachResolvedTypeReferenceDirective((({resolvedTypeReferenceDirective:t})=>{if(!t){return}const r=t.resolvedFileName;const o=getReferencedFileFromFileName(e,r,i,n);addReferencedFile(o)}),t);if(t.moduleAugmentations.length){const n=e.getTypeChecker();for(const e of t.moduleAugmentations){if(!isStringLiteral(e))continue;const t=n.getSymbolAtLocation(e);if(!t)continue;addReferenceFromAmbientModule(t)}}for(const t of e.getTypeChecker().getAmbientModules()){if(t.declarations&&t.declarations.length>1){addReferenceFromAmbientModule(t)}}return r;function addReferenceFromAmbientModule(e){if(!e.declarations){return}for(const n of e.declarations){const e=getSourceFileOfNode(n);if(e&&e!==t){addReferencedFile(e.resolvedPath)}}}function addReferencedFile(e){(r||(r=new Set)).add(e)}}function canReuseOldState(e,t){return t&&!t.referencedMap===!e}e.canReuseOldState=canReuseOldState;function createReferencedMap(e){return e.module!==0&&!e.outFile?createManyToManyPathMap():void 0}e.createReferencedMap=createReferencedMap;function create(e,t,n){var r,i;const o=new Map;const a=e.getCompilerOptions();const s=createReferencedMap(a);const c=canReuseOldState(s,t);e.getTypeChecker();for(const n of e.getSourceFiles()){const l=S.checkDefined(n.version,"Program intended to be used with Builder should have source files with versions set");const d=c?(r=t.oldSignatures)==null?void 0:r.get(n.resolvedPath):void 0;const p=d===void 0?c?(i=t.fileInfos.get(n.resolvedPath))==null?void 0:i.signature:void 0:d||void 0;if(s){const t=getReferencedFiles(e,n,e.getCanonicalFileName);if(t){s.set(n.resolvedPath,t)}}o.set(n.resolvedPath,{version:l,signature:p,affectsGlobalScope:!a.outFile?isFileAffectingGlobalScope(n)||void 0:void 0,impliedFormat:n.impliedNodeFormat})}return{fileInfos:o,referencedMap:s,useFileVersionAsSignature:!n&&!c}}e.create=create;function releaseCache2(e){e.allFilesExcludingDefaultLibraryFile=void 0;e.allFileNames=void 0}e.releaseCache=releaseCache2;function getFilesAffectedBy(e,t,n,r,i){var o;const a=getFilesAffectedByWithOldState(e,t,n,r,i);(o=e.oldSignatures)==null?void 0:o.clear();return a}e.getFilesAffectedBy=getFilesAffectedBy;function getFilesAffectedByWithOldState(e,t,n,r,i){const o=t.getSourceFileByPath(n);if(!o){return d}if(!updateShapeSignature(e,t,o,r,i)){return[o]}return(e.referencedMap?getFilesAffectedByUpdatedShapeWhenModuleEmit:getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(e,t,o,r,i)}e.getFilesAffectedByWithOldState=getFilesAffectedByWithOldState;function updateSignatureOfFile(e,t,n){e.fileInfos.get(n).signature=t;(e.hasCalledUpdateShapeSignature||(e.hasCalledUpdateShapeSignature=new Set)).add(n)}e.updateSignatureOfFile=updateSignatureOfFile;function computeDtsSignature(e,t,n,r,i){e.emit(t,((n,o,a,s,c,l)=>{S.assert(isDeclarationFileName(n),`File extension for signature expected to be dts: Got:: ${n}`);i(computeSignatureWithDiagnostics(e,t,o,r,l),c)}),n,2,void 0,true)}e.computeDtsSignature=computeDtsSignature;function updateShapeSignature(e,t,n,r,i,o=e.useFileVersionAsSignature){var a;if((a=e.hasCalledUpdateShapeSignature)==null?void 0:a.has(n.resolvedPath))return false;const s=e.fileInfos.get(n.resolvedPath);const c=s.signature;let l;if(!n.isDeclarationFile&&!o){computeDtsSignature(t,n,r,i,(t=>{l=t;if(i.storeSignatureInfo)(e.signatureInfo??(e.signatureInfo=new Map)).set(n.resolvedPath,0)}))}if(l===void 0){l=n.version;if(i.storeSignatureInfo)(e.signatureInfo??(e.signatureInfo=new Map)).set(n.resolvedPath,2)}(e.oldSignatures||(e.oldSignatures=new Map)).set(n.resolvedPath,c||false);(e.hasCalledUpdateShapeSignature||(e.hasCalledUpdateShapeSignature=new Set)).add(n.resolvedPath);s.signature=l;return l!==c}e.updateShapeSignature=updateShapeSignature;function getAllDependencies(e,t,n){const r=t.getCompilerOptions();if(r.outFile){return getAllFileNames(e,t)}if(!e.referencedMap||isFileAffectingGlobalScope(n)){return getAllFileNames(e,t)}const i=new Set;const o=[n.resolvedPath];while(o.length){const t=o.pop();if(!i.has(t)){i.add(t);const n=e.referencedMap.getValues(t);if(n){for(const e of n.keys()){o.push(e)}}}}return arrayFrom(mapDefinedIterator(i.keys(),(e=>{var n;return((n=t.getSourceFileByPath(e))==null?void 0:n.fileName)??e})))}e.getAllDependencies=getAllDependencies;function getAllFileNames(e,t){if(!e.allFileNames){const n=t.getSourceFiles();e.allFileNames=n===d?d:n.map((e=>e.fileName))}return e.allFileNames}function getReferencedByPaths(e,t){const n=e.referencedMap.getKeys(t);return n?arrayFrom(n.keys()):[]}e.getReferencedByPaths=getReferencedByPaths;function containsOnlyAmbientModules(e){for(const t of e.statements){if(!isModuleWithStringLiteralName(t)){return false}}return true}function containsGlobalScopeAugmentation(e){return some(e.moduleAugmentations,(e=>isGlobalScopeAugmentation(e.parent)))}function isFileAffectingGlobalScope(e){return containsGlobalScopeAugmentation(e)||!isExternalOrCommonJsModule(e)&&!isJsonSourceFile(e)&&!containsOnlyAmbientModules(e)}function getAllFilesExcludingDefaultLibraryFile(e,t,n){if(e.allFilesExcludingDefaultLibraryFile){return e.allFilesExcludingDefaultLibraryFile}let r;if(n)addSourceFile(n);for(const e of t.getSourceFiles()){if(e!==n){addSourceFile(e)}}e.allFilesExcludingDefaultLibraryFile=r||d;return e.allFilesExcludingDefaultLibraryFile;function addSourceFile(e){if(!t.isSourceFileDefaultLibrary(e)){(r||(r=[])).push(e)}}}e.getAllFilesExcludingDefaultLibraryFile=getAllFilesExcludingDefaultLibraryFile;function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(e,t,n){const r=t.getCompilerOptions();if(r&&r.outFile){return[n]}return getAllFilesExcludingDefaultLibraryFile(e,t,n)}function getFilesAffectedByUpdatedShapeWhenModuleEmit(e,t,n,r,i){if(isFileAffectingGlobalScope(n)){return getAllFilesExcludingDefaultLibraryFile(e,t,n)}const o=t.getCompilerOptions();if(o&&(Gn(o)||o.outFile)){return[n]}const a=new Map;a.set(n.resolvedPath,n);const s=getReferencedByPaths(e,n.resolvedPath);while(s.length>0){const n=s.pop();if(!a.has(n)){const o=t.getSourceFileByPath(n);a.set(n,o);if(o&&updateShapeSignature(e,t,o,r,i)){s.push(...getReferencedByPaths(e,o.resolvedPath))}}}return arrayFrom(mapDefinedIterator(a.values(),(e=>e)))}})(Qa||(Qa={}));var Xa=(e=>{e[e["None"]=0]="None";e[e["Js"]=1]="Js";e[e["JsMap"]=2]="JsMap";e[e["JsInlineMap"]=4]="JsInlineMap";e[e["DtsErrors"]=8]="DtsErrors";e[e["DtsEmit"]=16]="DtsEmit";e[e["DtsMap"]=32]="DtsMap";e[e["Dts"]=24]="Dts";e[e["AllJs"]=7]="AllJs";e[e["AllDtsEmit"]=48]="AllDtsEmit";e[e["AllDts"]=56]="AllDts";e[e["All"]=63]="All";return e})(Xa||{});function isBuilderProgramStateWithDefinedProgram(e){return e.program!==void 0}function toBuilderProgramStateWithDefinedProgram(e){S.assert(isBuilderProgramStateWithDefinedProgram(e));return e}function getBuilderFileEmit(e){let t=1;if(e.sourceMap)t=t|2;if(e.inlineSourceMap)t=t|4;if(Zn(e))t=t|24;if(e.declarationMap)t=t|32;if(e.emitDeclarationOnly)t=t&56;return t}function getPendingEmitKind(e,t){const n=t&&(isNumber(t)?t:getBuilderFileEmit(t));const r=isNumber(e)?e:getBuilderFileEmit(e);if(n===r)return 0;if(!n||!r)return r;const i=n^r;let o=0;if(i&7)o=r&7;if(i&8)o=o|r&8;if(i&48)o=o|r&48;return o}function hasSameKeys(e,t){return e===t||e!==void 0&&t!==void 0&&e.size===t.size&&!forEachKey(e,(e=>!t.has(e)))}function createBuilderProgramState(e,t){var n,r;const i=Qa.create(e,t,false);i.program=e;const o=e.getCompilerOptions();i.compilerOptions=o;const a=o.outFile;i.semanticDiagnosticsPerFile=new Map;if(a&&o.composite&&(t==null?void 0:t.outSignature)&&a===t.compilerOptions.outFile){i.outSignature=t.outSignature&&getEmitSignatureFromOldSignature(o,t.compilerOptions,t.outSignature)}i.changedFilesSet=new Set;i.latestChangedDtsFile=o.composite?t==null?void 0:t.latestChangedDtsFile:void 0;i.checkPending=i.compilerOptions.noCheck?true:void 0;const s=Qa.canReuseOldState(i.referencedMap,t);const c=s?t.compilerOptions:void 0;let l=s&&!compilerOptionsAffectSemanticDiagnostics(o,c);const d=o.composite&&(t==null?void 0:t.emitSignatures)&&!a&&!compilerOptionsAffectDeclarationPath(o,t.compilerOptions);let p=true;if(s){(n=t.changedFilesSet)==null?void 0:n.forEach((e=>i.changedFilesSet.add(e)));if(!a&&((r=t.affectedFilesPendingEmit)==null?void 0:r.size)){i.affectedFilesPendingEmit=new Map(t.affectedFilesPendingEmit);i.seenAffectedFiles=new Set}i.programEmitPending=t.programEmitPending;if(a&&i.changedFilesSet.size){l=false;p=false}i.hasErrorsFromOldState=t.hasErrors}else{i.buildInfoEmitPending=tr(o)}const u=i.referencedMap;const f=s?t.referencedMap:void 0;const m=l&&!o.skipLibCheck===!c.skipLibCheck;const _=m&&!o.skipDefaultLibCheck===!c.skipDefaultLibCheck;i.fileInfos.forEach(((n,r)=>{var a;let c;let g;if(!s||!(c=t.fileInfos.get(r))||c.version!==n.version||c.impliedFormat!==n.impliedFormat||!hasSameKeys(g=u&&u.getValues(r),f&&f.getValues(r))||g&&forEachKey(g,(e=>!i.fileInfos.has(e)&&t.fileInfos.has(e)))){addFileToChangeSet(r)}else{const n=e.getSourceFileByPath(r);const o=p?(a=t.emitDiagnosticsPerFile)==null?void 0:a.get(r):void 0;if(o){(i.emitDiagnosticsPerFile??(i.emitDiagnosticsPerFile=new Map)).set(r,t.hasReusableDiagnostic?convertToDiagnostics(o,r,e):repopulateDiagnostics(o,e))}if(l){if(n.isDeclarationFile&&!m)return;if(n.hasNoDefaultLib&&!_)return;const o=t.semanticDiagnosticsPerFile.get(r);if(o){i.semanticDiagnosticsPerFile.set(r,t.hasReusableDiagnostic?convertToDiagnostics(o,r,e):repopulateDiagnostics(o,e));(i.semanticDiagnosticsFromOldState??(i.semanticDiagnosticsFromOldState=new Set)).add(r)}}}if(d){const e=t.emitSignatures.get(r);if(e){(i.emitSignatures??(i.emitSignatures=new Map)).set(r,getEmitSignatureFromOldSignature(o,t.compilerOptions,e))}}}));if(s&&forEachEntry(t.fileInfos,((e,t)=>{if(i.fileInfos.has(t))return false;if(e.affectsGlobalScope)return true;i.buildInfoEmitPending=true;return!!a}))){Qa.getAllFilesExcludingDefaultLibraryFile(i,e,void 0).forEach((e=>addFileToChangeSet(e.resolvedPath)))}else if(c){const t=compilerOptionsAffectEmit(o,c)?getBuilderFileEmit(o):getPendingEmitKind(o,c);if(t!==0){if(!a){e.getSourceFiles().forEach((e=>{if(!i.changedFilesSet.has(e.resolvedPath)){addToAffectedFilesPendingEmit(i,e.resolvedPath,t)}}));S.assert(!i.seenAffectedFiles||!i.seenAffectedFiles.size);i.seenAffectedFiles=i.seenAffectedFiles||new Set}else if(!i.changedFilesSet.size){i.programEmitPending=i.programEmitPending?i.programEmitPending|t:t}i.buildInfoEmitPending=true}}if(s&&i.semanticDiagnosticsPerFile.size!==i.fileInfos.size&&t.checkPending!==i.checkPending)i.buildInfoEmitPending=true;return i;function addFileToChangeSet(e){i.changedFilesSet.add(e);if(a){l=false;p=false;i.semanticDiagnosticsFromOldState=void 0;i.semanticDiagnosticsPerFile.clear();i.emitDiagnosticsPerFile=void 0}i.buildInfoEmitPending=true;i.programEmitPending=void 0}}function getEmitSignatureFromOldSignature(e,t,n){return!!e.declarationMap===!!t.declarationMap?n:isString(n)?[n]:n[0]}function repopulateDiagnostics(e,t){if(!e.length)return e;return sameMap(e,(e=>{if(isString(e.messageText))return e;const n=convertOrRepopulateDiagnosticMessageChain(e.messageText,e.file,t,(e=>{var t;return(t=e.repopulateInfo)==null?void 0:t.call(e)}));return n===e.messageText?e:{...e,messageText:n}}))}function convertOrRepopulateDiagnosticMessageChain(e,t,n,r){const i=r(e);if(i===true){return{...createModeMismatchDetails(t),next:convertOrRepopulateDiagnosticMessageChainArray(e.next,t,n,r)}}else if(i){return{...createModuleNotFoundChain(t,n,i.moduleReference,i.mode,i.packageName||i.moduleReference),next:convertOrRepopulateDiagnosticMessageChainArray(e.next,t,n,r)}}const o=convertOrRepopulateDiagnosticMessageChainArray(e.next,t,n,r);return o===e.next?e:{...e,next:o}}function convertOrRepopulateDiagnosticMessageChainArray(e,t,n,r){return sameMap(e,(e=>convertOrRepopulateDiagnosticMessageChain(e,t,n,r)))}function convertToDiagnostics(e,t,n){if(!e.length)return d;let r;return e.map((e=>{const r=convertToDiagnosticRelatedInformation(e,t,n,toPathInBuildInfoDirectory);r.reportsUnnecessary=e.reportsUnnecessary;r.reportsDeprecated=e.reportDeprecated;r.source=e.source;r.skippedOn=e.skippedOn;const{relatedInformation:i}=e;r.relatedInformation=i?i.length?i.map((e=>convertToDiagnosticRelatedInformation(e,t,n,toPathInBuildInfoDirectory))):[]:void 0;return r}));function toPathInBuildInfoDirectory(e){r??(r=getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(n.getCompilerOptions()),n.getCurrentDirectory())));return toPath(e,r,n.getCanonicalFileName)}}function convertToDiagnosticRelatedInformation(e,t,n,r){const{file:i}=e;const o=i!==false?n.getSourceFileByPath(i?r(i):t):void 0;return{...e,file:o,messageText:isString(e.messageText)?e.messageText:convertOrRepopulateDiagnosticMessageChain(e.messageText,o,n,(e=>e.info))}}function releaseCache(e){Qa.releaseCache(e);e.program=void 0}function assertSourceFileOkWithoutNextAffectedCall(e,t){S.assert(!t||!e.affectedFiles||e.affectedFiles[e.affectedFilesIndex-1]!==t||!e.semanticDiagnosticsPerFile.has(t.resolvedPath))}function getNextAffectedFile(e,t,n){var r;while(true){const{affectedFiles:i}=e;if(i){const o=e.seenAffectedFiles;let a=e.affectedFilesIndex;while(a{const i=!n?t&7:t&(7|48);if(!i)e.affectedFilesPendingEmit.delete(r);else e.affectedFilesPendingEmit.set(r,i)}));if(e.programEmitPending){const t=!n?e.programEmitPending&7:e.programEmitPending&(7|48);if(!t)e.programEmitPending=void 0;else e.programEmitPending=t}}function getPendingEmitKindWithSeen(e,t,n,r){let i=getPendingEmitKind(e,t);if(n)i=i&56;if(r)i=i&8;return i}function getBuilderFileEmitAllDts(e){return!e?56:8}function getNextAffectedFilePendingEmit(e,t,n){var r;if(!((r=e.affectedFilesPendingEmit)==null?void 0:r.size))return void 0;return forEachEntry(e.affectedFilesPendingEmit,((r,i)=>{var o;const a=e.program.getSourceFileByPath(i);if(!a||!sourceFileMayBeEmitted(a,e.program)){e.affectedFilesPendingEmit.delete(i);return void 0}const s=(o=e.seenEmittedFiles)==null?void 0:o.get(a.resolvedPath);const c=getPendingEmitKindWithSeen(r,s,t,n);if(c)return{affectedFile:a,emitKind:c}}))}function getNextPendingEmitDiagnosticsFile(e,t){var n;if(!((n=e.emitDiagnosticsPerFile)==null?void 0:n.size))return void 0;return forEachEntry(e.emitDiagnosticsPerFile,((n,r)=>{var i;const o=e.program.getSourceFileByPath(r);if(!o||!sourceFileMayBeEmitted(o,e.program)){e.emitDiagnosticsPerFile.delete(r);return void 0}const a=((i=e.seenEmittedFiles)==null?void 0:i.get(o.resolvedPath))||0;if(!(a&getBuilderFileEmitAllDts(t)))return{affectedFile:o,diagnostics:n,seenKind:a}}))}function removeDiagnosticsOfLibraryFiles(e){if(!e.cleanedDiagnosticsOfLibFiles){e.cleanedDiagnosticsOfLibFiles=true;const t=e.program.getCompilerOptions();forEach(e.program.getSourceFiles(),(n=>e.program.isSourceFileDefaultLibrary(n)&&!skipTypeCheckingIgnoringNoCheck(n,t,e.program)&&removeSemanticDiagnosticsOf(e,n.resolvedPath)))}}function handleDtsMayChangeOfAffectedFile(e,t,n,r){removeSemanticDiagnosticsOf(e,t.resolvedPath);if(e.allFilesExcludingDefaultLibraryFile===e.affectedFiles){removeDiagnosticsOfLibraryFiles(e);Qa.updateShapeSignature(e,e.program,t,n,r);return}if(e.compilerOptions.assumeChangesOnlyAffectDirectDependencies)return;handleDtsMayChangeOfReferencingExportOfAffectedFile(e,t,n,r)}function handleDtsMayChangeOf(e,t,n,r,i){removeSemanticDiagnosticsOf(e,t);if(!e.changedFilesSet.has(t)){const o=e.program.getSourceFileByPath(t);if(o){Qa.updateShapeSignature(e,e.program,o,r,i,true);if(n){addToAffectedFilesPendingEmit(e,t,getBuilderFileEmit(e.compilerOptions))}else if(Zn(e.compilerOptions)){addToAffectedFilesPendingEmit(e,t,e.compilerOptions.declarationMap?56:24)}}}}function removeSemanticDiagnosticsOf(e,t){if(!e.semanticDiagnosticsFromOldState){return true}e.semanticDiagnosticsFromOldState.delete(t);e.semanticDiagnosticsPerFile.delete(t);return!e.semanticDiagnosticsFromOldState.size}function isChangedSignature(e,t){const n=S.checkDefined(e.oldSignatures).get(t)||void 0;const r=S.checkDefined(e.fileInfos.get(t)).signature;return r!==n}function handleDtsMayChangeOfGlobalScope(e,t,n,r,i){var o;if(!((o=e.fileInfos.get(t))==null?void 0:o.affectsGlobalScope))return false;Qa.getAllFilesExcludingDefaultLibraryFile(e,e.program,void 0).forEach((t=>handleDtsMayChangeOf(e,t.resolvedPath,n,r,i)));removeDiagnosticsOfLibraryFiles(e);return true}function handleDtsMayChangeOfReferencingExportOfAffectedFile(e,t,n,r){var i,o;if(!e.referencedMap||!e.changedFilesSet.has(t.resolvedPath))return;if(!isChangedSignature(e,t.resolvedPath))return;if(Gn(e.compilerOptions)){const i=new Map;i.set(t.resolvedPath,true);const o=Qa.getReferencedByPaths(e,t.resolvedPath);while(o.length>0){const t=o.pop();if(!i.has(t)){i.set(t,true);if(handleDtsMayChangeOfGlobalScope(e,t,false,n,r))return;handleDtsMayChangeOf(e,t,false,n,r);if(isChangedSignature(e,t)){const n=e.program.getSourceFileByPath(t);o.push(...Qa.getReferencedByPaths(e,n.resolvedPath))}}}}const a=new Set;const s=!!((i=t.symbol)==null?void 0:i.exports)&&!!forEachEntry(t.symbol.exports,(n=>{if((n.flags&128)!==0)return true;const r=skipAlias(n,e.program.getTypeChecker());if(r===n)return false;return(r.flags&128)!==0&&some(r.declarations,(e=>getSourceFileOfNode(e)===t))}));(o=e.referencedMap.getKeys(t.resolvedPath))==null?void 0:o.forEach((t=>{if(handleDtsMayChangeOfGlobalScope(e,t,s,n,r))return true;const i=e.referencedMap.getKeys(t);return i&&forEachKey(i,(t=>handleDtsMayChangeOfFileAndExportsOfFile(e,t,s,a,n,r)))}))}function handleDtsMayChangeOfFileAndExportsOfFile(e,t,n,r,i,o){var a;if(!tryAddToSet(r,t))return void 0;if(handleDtsMayChangeOfGlobalScope(e,t,n,i,o))return true;handleDtsMayChangeOf(e,t,n,i,o);(a=e.referencedMap.getKeys(t))==null?void 0:a.forEach((t=>handleDtsMayChangeOfFileAndExportsOfFile(e,t,n,r,i,o)));return void 0}function getSemanticDiagnosticsOfFile(e,t,n,r){if(e.compilerOptions.noCheck)return d;return concatenate(getBinderAndCheckerDiagnosticsOfFile(e,t,n,r),e.program.getProgramDiagnostics(t))}function getBinderAndCheckerDiagnosticsOfFile(e,t,n,r){r??(r=e.semanticDiagnosticsPerFile);const i=t.resolvedPath;const o=r.get(i);if(o){return filterSemanticDiagnostics(o,e.compilerOptions)}const a=e.program.getBindAndCheckDiagnostics(t,n);r.set(i,a);e.buildInfoEmitPending=true;return filterSemanticDiagnostics(a,e.compilerOptions)}function isIncrementalBundleEmitBuildInfo(e){var t;return!!((t=e.options)==null?void 0:t.outFile)}function isIncrementalBuildInfo(e){return!!e.fileNames}function isNonIncrementalBuildInfo(e){return!isIncrementalBuildInfo(e)&&!!e.root}function ensureHasErrorsForState(e){if(e.hasErrors!==void 0)return;if(tr(e.compilerOptions)){e.hasErrors=!some(e.program.getSourceFiles(),(t=>{var n,r;const i=e.semanticDiagnosticsPerFile.get(t.resolvedPath);return i===void 0||!!i.length||!!((r=(n=e.emitDiagnosticsPerFile)==null?void 0:n.get(t.resolvedPath))==null?void 0:r.length)}))&&(hasSyntaxOrGlobalErrors(e)||some(e.program.getSourceFiles(),(t=>!!e.program.getProgramDiagnostics(t).length)))}else{e.hasErrors=some(e.program.getSourceFiles(),(t=>{var n,r;const i=e.semanticDiagnosticsPerFile.get(t.resolvedPath);return!!(i==null?void 0:i.length)||!!((r=(n=e.emitDiagnosticsPerFile)==null?void 0:n.get(t.resolvedPath))==null?void 0:r.length)}))||hasSyntaxOrGlobalErrors(e)}}function hasSyntaxOrGlobalErrors(e){return!!e.program.getConfigFileParsingDiagnostics().length||!!e.program.getSyntacticDiagnostics().length||!!e.program.getOptionsDiagnostics().length||!!e.program.getGlobalDiagnostics().length}function getBuildInfoEmitPending(e){ensureHasErrorsForState(e);return e.buildInfoEmitPending??(e.buildInfoEmitPending=!!e.hasErrorsFromOldState!==!!e.hasErrors)}function getBuildInfo2(e){var t,n;const r=e.program.getCurrentDirectory();const i=getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(e.compilerOptions),r));const o=e.latestChangedDtsFile?relativeToBuildInfoEnsuringAbsolutePath(e.latestChangedDtsFile):void 0;const a=[];const s=new Map;const l=new Set(e.program.getRootFileNames().map((t=>toPath(t,r,e.program.getCanonicalFileName))));ensureHasErrorsForState(e);if(!tr(e.compilerOptions)){const t={root:arrayFrom(l,(e=>relativeToBuildInfo(e))),errors:e.hasErrors?true:void 0,checkPending:e.checkPending,version:c};return t}const p=[];if(e.compilerOptions.outFile){const t=arrayFrom(e.fileInfos.entries(),(([e,t])=>{const n=toFileId(e);tryAddRoot(e,n);return t.impliedFormat?{version:t.version,impliedFormat:t.impliedFormat,signature:void 0,affectsGlobalScope:void 0}:t.version}));const n={fileNames:a,fileInfos:t,root:p,resolvedRoot:toResolvedRoot(),options:toIncrementalBuildInfoCompilerOptions(e.compilerOptions),semanticDiagnosticsPerFile:!e.changedFilesSet.size?toIncrementalBuildInfoDiagnostics():void 0,emitDiagnosticsPerFile:toIncrementalBuildInfoEmitDiagnostics(),changeFileSet:toChangeFileSet(),outSignature:e.outSignature,latestChangedDtsFile:o,pendingEmit:!e.programEmitPending?void 0:e.programEmitPending===getBuilderFileEmit(e.compilerOptions)?false:e.programEmitPending,errors:e.hasErrors?true:void 0,checkPending:e.checkPending,version:c};return n}let u;let f;let m;const _=arrayFrom(e.fileInfos.entries(),(([t,n])=>{var r,i;const o=toFileId(t);tryAddRoot(t,o);S.assert(a[o-1]===relativeToBuildInfo(t));const s=(r=e.oldSignatures)==null?void 0:r.get(t);const c=s!==void 0?s||void 0:n.signature;if(e.compilerOptions.composite){const n=e.program.getSourceFileByPath(t);if(!isJsonSourceFile(n)&&sourceFileMayBeEmitted(n,e.program)){const n=(i=e.emitSignatures)==null?void 0:i.get(t);if(n!==c){m=append(m,n===void 0?o:[o,!isString(n)&&n[0]===c?d:n])}}}return n.version===c?n.affectsGlobalScope||n.impliedFormat?{version:n.version,signature:void 0,affectsGlobalScope:n.affectsGlobalScope,impliedFormat:n.impliedFormat}:n.version:c!==void 0?s===void 0?n:{version:n.version,signature:c,affectsGlobalScope:n.affectsGlobalScope,impliedFormat:n.impliedFormat}:{version:n.version,signature:false,affectsGlobalScope:n.affectsGlobalScope,impliedFormat:n.impliedFormat}}));let g;if((t=e.referencedMap)==null?void 0:t.size()){g=arrayFrom(e.referencedMap.keys()).sort(compareStringsCaseSensitive).map((t=>[toFileId(t),toFileIdListId(e.referencedMap.getValues(t))]))}const y=toIncrementalBuildInfoDiagnostics();let h;if((n=e.affectedFilesPendingEmit)==null?void 0:n.size){const t=getBuilderFileEmit(e.compilerOptions);const n=new Set;for(const r of arrayFrom(e.affectedFilesPendingEmit.keys()).sort(compareStringsCaseSensitive)){if(tryAddToSet(n,r)){const n=e.program.getSourceFileByPath(r);if(!n||!sourceFileMayBeEmitted(n,e.program))continue;const i=toFileId(r),o=e.affectedFilesPendingEmit.get(r);h=append(h,o===t?i:o===24?[i]:[i,o])}}}const T={fileNames:a,fileIdsList:u,fileInfos:_,root:p,resolvedRoot:toResolvedRoot(),options:toIncrementalBuildInfoCompilerOptions(e.compilerOptions),referencedMap:g,semanticDiagnosticsPerFile:y,emitDiagnosticsPerFile:toIncrementalBuildInfoEmitDiagnostics(),changeFileSet:toChangeFileSet(),affectedFilesPendingEmit:h,emitSignatures:m,latestChangedDtsFile:o,errors:e.hasErrors?true:void 0,checkPending:e.checkPending,version:c};return T;function relativeToBuildInfoEnsuringAbsolutePath(e){return relativeToBuildInfo(getNormalizedAbsolutePath(e,r))}function relativeToBuildInfo(t){return ensurePathIsNonModuleName(getRelativePathFromDirectory(i,t,e.program.getCanonicalFileName))}function toFileId(e){let t=s.get(e);if(t===void 0){a.push(relativeToBuildInfo(e));s.set(e,t=a.length)}return t}function toFileIdListId(e){const t=arrayFrom(e.keys(),toFileId).sort(compareValues);const n=t.join();let r=f==null?void 0:f.get(n);if(r===void 0){u=append(u,t);(f??(f=new Map)).set(n,r=u.length)}return r}function tryAddRoot(t,n){const r=e.program.getSourceFile(t);if(!e.program.getFileIncludeReasons().get(r.path).some((e=>e.kind===0)))return;if(!p.length)return p.push(n);const i=p[p.length-1];const o=isArray(i);if(o&&i[1]===n-1)return i[1]=n;if(o||p.length===1||i!==n-1)return p.push(n);const a=p[p.length-2];if(!isNumber(a)||a!==i-1)return p.push(n);p[p.length-2]=[a,n];return p.length=p.length-1}function toResolvedRoot(){let t;l.forEach((n=>{const r=e.program.getSourceFileByPath(n);if(r&&n!==r.resolvedPath){t=append(t,[toFileId(r.resolvedPath),toFileId(n)])}}));return t}function toIncrementalBuildInfoCompilerOptions(e){let t;const{optionsNameMap:n}=getOptionsNameMap();for(const r of getOwnKeys(e).sort(compareStringsCaseSensitive)){const i=n.get(r.toLowerCase());if(i==null?void 0:i.affectsBuildInfo){(t||(t={}))[r]=toReusableCompilerOptionValue(i,e[r])}}return t}function toReusableCompilerOptionValue(e,t){if(e){S.assert(e.type!=="listOrElement");if(e.type==="list"){const n=t;if(e.element.isFilePath&&n.length){return n.map(relativeToBuildInfoEnsuringAbsolutePath)}}else if(e.isFilePath){return relativeToBuildInfoEnsuringAbsolutePath(t)}}return t}function toIncrementalBuildInfoDiagnostics(){let t;e.fileInfos.forEach(((n,r)=>{const i=e.semanticDiagnosticsPerFile.get(r);if(!i){if(!e.changedFilesSet.has(r))t=append(t,toFileId(r))}else if(i.length){t=append(t,[toFileId(r),toReusableDiagnostic(i,r)])}}));return t}function toIncrementalBuildInfoEmitDiagnostics(){var t;let n;if(!((t=e.emitDiagnosticsPerFile)==null?void 0:t.size))return n;for(const t of arrayFrom(e.emitDiagnosticsPerFile.keys()).sort(compareStringsCaseSensitive)){const r=e.emitDiagnosticsPerFile.get(t);n=append(n,[toFileId(t),toReusableDiagnostic(r,t)])}return n}function toReusableDiagnostic(e,t){S.assert(!!e.length);return e.map((e=>{const n=toReusableDiagnosticRelatedInformation(e,t);n.reportsUnnecessary=e.reportsUnnecessary;n.reportDeprecated=e.reportsDeprecated;n.source=e.source;n.skippedOn=e.skippedOn;const{relatedInformation:r}=e;n.relatedInformation=r?r.length?r.map((e=>toReusableDiagnosticRelatedInformation(e,t))):[]:void 0;return n}))}function toReusableDiagnosticRelatedInformation(e,t){const{file:n}=e;return{...e,file:n?n.resolvedPath===t?void 0:relativeToBuildInfo(n.resolvedPath):false,messageText:isString(e.messageText)?e.messageText:toReusableDiagnosticMessageChain(e.messageText)}}function toReusableDiagnosticMessageChain(e){if(e.repopulateInfo){return{info:e.repopulateInfo(),next:toReusableDiagnosticMessageChainArray(e.next)}}const t=toReusableDiagnosticMessageChainArray(e.next);return t===e.next?e:{...e,next:t}}function toReusableDiagnosticMessageChainArray(e){if(!e)return e;return forEach(e,((t,n)=>{const r=toReusableDiagnosticMessageChain(t);if(t===r)return void 0;const i=n>0?e.slice(0,n-1):[];i.push(r);for(let t=n+1;t{e[e["SemanticDiagnosticsBuilderProgram"]=0]="SemanticDiagnosticsBuilderProgram";e[e["EmitAndSemanticDiagnosticsBuilderProgram"]=1]="EmitAndSemanticDiagnosticsBuilderProgram";return e})(Ya||{});function getBuilderCreationParameters(e,t,n,r,i,o){let a;let s;let c;if(e===void 0){S.assert(t===void 0);a=n;c=r;S.assert(!!c);s=c.getProgram()}else if(isArray(e)){c=r;s=createProgram({rootNames:e,options:t,host:n,oldProgram:c&&c.getProgramOrUndefined(),configFileParsingDiagnostics:i,projectReferences:o});a=n}else{s=e;a=t;c=n;i=r}return{host:a,newProgram:s,oldProgram:c,configFileParsingDiagnostics:i||d}}function getTextHandlingSourceMapForSignature(e,t){return(t==null?void 0:t.sourceMapUrlPos)!==void 0?e.substring(0,t.sourceMapUrlPos):e}function computeSignatureWithDiagnostics(e,t,n,r,i){var o;n=getTextHandlingSourceMapForSignature(n,i);let a;if((o=i==null?void 0:i.diagnostics)==null?void 0:o.length){n+=i.diagnostics.map((e=>`${locationInfo(e)}${Ve[e.category]}${e.code}: ${flattenDiagnosticMessageText2(e.messageText)}`)).join("\n")}return(r.createHash??generateDjb2Hash)(n);function flattenDiagnosticMessageText2(e){return isString(e)?e:e===void 0?"":!e.next?e.messageText:e.messageText+e.next.map(flattenDiagnosticMessageText2).join("\n")}function locationInfo(n){if(n.file.resolvedPath===t.resolvedPath)return`(${n.start},${n.length})`;if(a===void 0)a=getDirectoryPath(t.resolvedPath);return`${ensurePathIsNonModuleName(getRelativePathFromDirectory(a,n.file.resolvedPath,e.getCanonicalFileName))}(${n.start},${n.length})`}}function computeSignature(e,t,n){return(t.createHash??generateDjb2Hash)(getTextHandlingSourceMapForSignature(e,n))}function createBuilderProgram(e,{newProgram:t,host:n,oldProgram:r,configFileParsingDiagnostics:i}){let o=r&&r.state;if(o&&t===o.program&&i===t.getConfigFileParsingDiagnostics()){t=void 0;o=void 0;return r}const a=createBuilderProgramState(t,o);t.getBuildInfo=()=>getBuildInfo2(toBuilderProgramStateWithDefinedProgram(a));t=void 0;r=void 0;o=void 0;const s=createRedirectedBuilderProgram(a,i);s.state=a;s.hasChangedEmitSignature=()=>!!a.hasChangedEmitSignature;s.getAllDependencies=e=>Qa.getAllDependencies(a,S.checkDefined(a.program),e);s.getSemanticDiagnostics=getSemanticDiagnostics;s.getDeclarationDiagnostics=getDeclarationDiagnostics2;s.emit=emit;s.releaseProgram=()=>releaseCache(a);if(e===0){s.getSemanticDiagnosticsOfNextAffectedFile=getSemanticDiagnosticsOfNextAffectedFile}else if(e===1){s.getSemanticDiagnosticsOfNextAffectedFile=getSemanticDiagnosticsOfNextAffectedFile;s.emitNextAffectedFile=emitNextAffectedFile;s.emitBuildInfo=emitBuildInfo}else{notImplemented()}return s;function emitBuildInfo(e,t){S.assert(isBuilderProgramStateWithDefinedProgram(a));if(getBuildInfoEmitPending(a)){const r=a.program.emitBuildInfo(e||maybeBind(n,n.writeFile),t);a.buildInfoEmitPending=false;return r}return Ka}function emitNextAffectedFileOrDtsErrors(e,t,r,i,o){var s,c,l,d;S.assert(isBuilderProgramStateWithDefinedProgram(a));let p=getNextAffectedFile(a,t,n);const u=getBuilderFileEmit(a.compilerOptions);let f=!o?r?u&56:u:8;if(!p){if(!a.compilerOptions.outFile){const e=getNextAffectedFilePendingEmit(a,r,o);if(e){({affectedFile:p,emitKind:f}=e)}else{const e=getNextPendingEmitDiagnosticsFile(a,o);if(e){(a.seenEmittedFiles??(a.seenEmittedFiles=new Map)).set(e.affectedFile.resolvedPath,e.seenKind|getBuilderFileEmitAllDts(o));return{result:{emitSkipped:true,diagnostics:e.diagnostics},affected:e.affectedFile}}}}else{if(a.programEmitPending){f=getPendingEmitKindWithSeen(a.programEmitPending,a.seenProgramEmit,r,o);if(f)p=a.program}if(!p&&((s=a.emitDiagnosticsPerFile)==null?void 0:s.size)){const e=a.seenProgramEmit||0;if(!(e&getBuilderFileEmitAllDts(o))){a.seenProgramEmit=getBuilderFileEmitAllDts(o)|e;const t=[];a.emitDiagnosticsPerFile.forEach((e=>addRange(t,e)));return{result:{emitSkipped:true,diagnostics:t},affected:a.program}}}}if(!p){if(o||!getBuildInfoEmitPending(a))return void 0;const r=a.program;const i=r.emitBuildInfo(e||maybeBind(n,n.writeFile),t);a.buildInfoEmitPending=false;return{result:i,affected:r}}}let m;if(f&7)m=0;if(f&56)m=m===void 0?1:void 0;const _=!o?a.program.emit(p===a.program?void 0:p,getWriteFileCallback(e,i),t,m,i,void 0,true):{emitSkipped:true,diagnostics:a.program.getDeclarationDiagnostics(p===a.program?void 0:p,t)};if(p!==a.program){const e=p;a.seenAffectedFiles.add(e.resolvedPath);if(a.affectedFilesIndex!==void 0)a.affectedFilesIndex++;a.buildInfoEmitPending=true;const t=((c=a.seenEmittedFiles)==null?void 0:c.get(e.resolvedPath))||0;(a.seenEmittedFiles??(a.seenEmittedFiles=new Map)).set(e.resolvedPath,f|t);const n=((l=a.affectedFilesPendingEmit)==null?void 0:l.get(e.resolvedPath))||u;const r=getPendingEmitKind(n,f|t);if(r)(a.affectedFilesPendingEmit??(a.affectedFilesPendingEmit=new Map)).set(e.resolvedPath,r);else(d=a.affectedFilesPendingEmit)==null?void 0:d.delete(e.resolvedPath);if(_.diagnostics.length)(a.emitDiagnosticsPerFile??(a.emitDiagnosticsPerFile=new Map)).set(e.resolvedPath,_.diagnostics)}else{a.changedFilesSet.clear();a.programEmitPending=a.changedFilesSet.size?getPendingEmitKind(u,f):a.programEmitPending?getPendingEmitKind(a.programEmitPending,f):void 0;a.seenProgramEmit=f|(a.seenProgramEmit||0);setEmitDiagnosticsPerFile(_.diagnostics);a.buildInfoEmitPending=true}return{result:_,affected:p}}function setEmitDiagnosticsPerFile(e){let t;e.forEach((e=>{if(!e.file)return;let n=t==null?void 0:t.get(e.file.resolvedPath);if(!n)(t??(t=new Map)).set(e.file.resolvedPath,n=[]);n.push(e)}));if(t)a.emitDiagnosticsPerFile=t}function emitNextAffectedFile(e,t,n,r){return emitNextAffectedFileOrDtsErrors(e,t,n,r,false)}function getWriteFileCallback(e,t){S.assert(isBuilderProgramStateWithDefinedProgram(a));if(!Zn(a.compilerOptions))return e||maybeBind(n,n.writeFile);return(r,i,o,s,c,l)=>{var d,p,u;if(isDeclarationFileName(r)){if(!a.compilerOptions.outFile){S.assert((c==null?void 0:c.length)===1);let e;if(!t){const t=c[0];const r=a.fileInfos.get(t.resolvedPath);if(r.signature===t.version){const o=computeSignatureWithDiagnostics(a.program,t,i,n,l);if(!((d=l==null?void 0:l.diagnostics)==null?void 0:d.length))e=o;if(o!==t.version){if(n.storeSignatureInfo)(a.signatureInfo??(a.signatureInfo=new Map)).set(t.resolvedPath,1);if(a.affectedFiles){const e=(p=a.oldSignatures)==null?void 0:p.get(t.resolvedPath);if(e===void 0)(a.oldSignatures??(a.oldSignatures=new Map)).set(t.resolvedPath,r.signature||false);r.signature=o}else{r.signature=o}}}}if(a.compilerOptions.composite){const t=c[0].resolvedPath;e=handleNewSignature((u=a.emitSignatures)==null?void 0:u.get(t),e);if(!e)return l.skippedDtsWrite=true;(a.emitSignatures??(a.emitSignatures=new Map)).set(t,e)}}else if(a.compilerOptions.composite){const e=handleNewSignature(a.outSignature,void 0);if(!e)return l.skippedDtsWrite=true;a.outSignature=e}}if(e)e(r,i,o,s,c,l);else if(n.writeFile)n.writeFile(r,i,o,s,c,l);else a.program.writeFile(r,i,o,s,c,l);function handleNewSignature(e,t){const o=!e||isString(e)?e:e[0];t??(t=computeSignature(i,n,l));if(t===o){if(e===o)return void 0;else if(l)l.differsOnlyInMap=true;else l={differsOnlyInMap:true}}else{a.hasChangedEmitSignature=true;a.latestChangedDtsFile=r}return t}}}function emit(t,n,r,i,o){S.assert(isBuilderProgramStateWithDefinedProgram(a));if(e===1){assertSourceFileOkWithoutNextAffectedCall(a,t)}const c=handleNoEmitOptions(s,t,n,r);if(c)return c;if(!t){if(e===1){let e=[];let t=false;let a;let s=[];let c;while(c=emitNextAffectedFile(n,r,i,o)){t=t||c.result.emitSkipped;a=addRange(a,c.result.diagnostics);s=addRange(s,c.result.emittedFiles);e=addRange(e,c.result.sourceMaps)}return{emitSkipped:t,diagnostics:a||d,emittedFiles:s,sourceMaps:e}}else{clearAffectedFilesPendingEmit(a,i,false)}}const l=a.program.emit(t,getWriteFileCallback(n,o),r,i,o);handleNonEmitBuilderWithEmitOrDtsErrors(t,i,false,l.diagnostics);return l}function handleNonEmitBuilderWithEmitOrDtsErrors(t,n,r,i){if(!t&&e!==1){clearAffectedFilesPendingEmit(a,n,r);setEmitDiagnosticsPerFile(i)}}function getDeclarationDiagnostics2(t,n){var r;S.assert(isBuilderProgramStateWithDefinedProgram(a));if(e===1){assertSourceFileOkWithoutNextAffectedCall(a,t);let e;let i;while(e=emitNextAffectedFileOrDtsErrors(void 0,n,void 0,void 0,true)){if(!t)i=addRange(i,e.result.diagnostics)}return(!t?i:(r=a.emitDiagnosticsPerFile)==null?void 0:r.get(t.resolvedPath))||d}else{const e=a.program.getDeclarationDiagnostics(t,n);handleNonEmitBuilderWithEmitOrDtsErrors(t,void 0,true,e);return e}}function getSemanticDiagnosticsOfNextAffectedFile(e,t){S.assert(isBuilderProgramStateWithDefinedProgram(a));while(true){const r=getNextAffectedFile(a,e,n);let i;if(!r){if(a.checkPending&&!a.compilerOptions.noCheck){a.checkPending=void 0;a.buildInfoEmitPending=true}return void 0}else if(r!==a.program){const n=r;if(!t||!t(n)){i=getSemanticDiagnosticsOfFile(a,n,e)}a.seenAffectedFiles.add(n.resolvedPath);a.affectedFilesIndex++;a.buildInfoEmitPending=true;if(!i)continue}else{let t;const n=new Map;a.program.getSourceFiles().forEach((r=>t=addRange(t,getSemanticDiagnosticsOfFile(a,r,e,n))));a.semanticDiagnosticsPerFile=n;i=t||d;a.changedFilesSet.clear();a.programEmitPending=getBuilderFileEmit(a.compilerOptions);if(!a.compilerOptions.noCheck)a.checkPending=void 0;a.buildInfoEmitPending=true}return{result:i,affected:r}}}function getSemanticDiagnostics(e,t){S.assert(isBuilderProgramStateWithDefinedProgram(a));assertSourceFileOkWithoutNextAffectedCall(a,e);if(e){return getSemanticDiagnosticsOfFile(a,e,t)}while(true){const e=getSemanticDiagnosticsOfNextAffectedFile(t);if(!e)break;if(e.affected===a.program)return e.result}let n;for(const e of a.program.getSourceFiles()){n=addRange(n,getSemanticDiagnosticsOfFile(a,e,t))}if(a.checkPending&&!a.compilerOptions.noCheck){a.checkPending=void 0;a.buildInfoEmitPending=true}return n||d}}function addToAffectedFilesPendingEmit(e,t,n){var r,i;const o=((r=e.affectedFilesPendingEmit)==null?void 0:r.get(t))||0;(e.affectedFilesPendingEmit??(e.affectedFilesPendingEmit=new Map)).set(t,o|n);(i=e.emitDiagnosticsPerFile)==null?void 0:i.delete(t)}function toBuilderStateFileInfoForMultiEmit(e){return isString(e)?{version:e,signature:e,affectsGlobalScope:void 0,impliedFormat:void 0}:isString(e.signature)?e:{version:e.version,signature:e.signature===false?void 0:e.version,affectsGlobalScope:e.affectsGlobalScope,impliedFormat:e.impliedFormat}}function toBuilderFileEmit(e,t){return isNumber(e)?t:e[1]||24}function toProgramEmitPending(e,t){return!e?getBuilderFileEmit(t||{}):e}function createBuilderProgramUsingIncrementalBuildInfo(e,t,n){var r,i,o,a;const s=getDirectoryPath(getNormalizedAbsolutePath(t,n.getCurrentDirectory()));const c=createGetCanonicalFileName(n.useCaseSensitiveFileNames());let l;const p=(r=e.fileNames)==null?void 0:r.map(toPathInBuildInfoDirectory);let u;const f=e.latestChangedDtsFile?toAbsolutePath(e.latestChangedDtsFile):void 0;const m=new Map;const _=new Set(map(e.changeFileSet,toFilePath));if(isIncrementalBundleEmitBuildInfo(e)){e.fileInfos.forEach(((e,t)=>{const n=toFilePath(t+1);m.set(n,isString(e)?{version:e,signature:void 0,affectsGlobalScope:void 0,impliedFormat:void 0}:e)}));l={fileInfos:m,compilerOptions:e.options?convertToOptionsWithAbsolutePaths(e.options,toAbsolutePath):{},semanticDiagnosticsPerFile:toPerFileSemanticDiagnostics(e.semanticDiagnosticsPerFile),emitDiagnosticsPerFile:toPerFileEmitDiagnostics(e.emitDiagnosticsPerFile),hasReusableDiagnostic:true,changedFilesSet:_,latestChangedDtsFile:f,outSignature:e.outSignature,programEmitPending:e.pendingEmit===void 0?void 0:toProgramEmitPending(e.pendingEmit,e.options),hasErrors:e.errors,checkPending:e.checkPending}}else{u=(i=e.fileIdsList)==null?void 0:i.map((e=>new Set(e.map(toFilePath))));const t=((o=e.options)==null?void 0:o.composite)&&!e.options.outFile?new Map:void 0;e.fileInfos.forEach(((e,n)=>{const r=toFilePath(n+1);const i=toBuilderStateFileInfoForMultiEmit(e);m.set(r,i);if(t&&i.signature)t.set(r,i.signature)}));(a=e.emitSignatures)==null?void 0:a.forEach((e=>{if(isNumber(e))t.delete(toFilePath(e));else{const n=toFilePath(e[0]);t.set(n,!isString(e[1])&&!e[1].length?[t.get(n)]:e[1])}}));const n=e.affectedFilesPendingEmit?getBuilderFileEmit(e.options||{}):void 0;l={fileInfos:m,compilerOptions:e.options?convertToOptionsWithAbsolutePaths(e.options,toAbsolutePath):{},referencedMap:toManyToManyPathMap(e.referencedMap,e.options??{}),semanticDiagnosticsPerFile:toPerFileSemanticDiagnostics(e.semanticDiagnosticsPerFile),emitDiagnosticsPerFile:toPerFileEmitDiagnostics(e.emitDiagnosticsPerFile),hasReusableDiagnostic:true,changedFilesSet:_,affectedFilesPendingEmit:e.affectedFilesPendingEmit&&arrayToMap(e.affectedFilesPendingEmit,(e=>toFilePath(isNumber(e)?e:e[0])),(e=>toBuilderFileEmit(e,n))),latestChangedDtsFile:f,emitSignatures:(t==null?void 0:t.size)?t:void 0,hasErrors:e.errors,checkPending:e.checkPending}}return{state:l,getProgram:notImplemented,getProgramOrUndefined:returnUndefined,releaseProgram:noop,getCompilerOptions:()=>l.compilerOptions,getSourceFile:notImplemented,getSourceFiles:notImplemented,getOptionsDiagnostics:notImplemented,getGlobalDiagnostics:notImplemented,getConfigFileParsingDiagnostics:notImplemented,getSyntacticDiagnostics:notImplemented,getDeclarationDiagnostics:notImplemented,getSemanticDiagnostics:notImplemented,emit:notImplemented,getAllDependencies:notImplemented,getCurrentDirectory:notImplemented,emitNextAffectedFile:notImplemented,getSemanticDiagnosticsOfNextAffectedFile:notImplemented,emitBuildInfo:notImplemented,close:noop,hasChangedEmitSignature:returnFalse};function toPathInBuildInfoDirectory(e){return toPath(e,s,c)}function toAbsolutePath(e){return getNormalizedAbsolutePath(e,s)}function toFilePath(e){return p[e-1]}function toFilePathsSet(e){return u[e-1]}function toManyToManyPathMap(e,t){const n=Qa.createReferencedMap(t);if(!n||!e)return n;e.forEach((([e,t])=>n.set(toFilePath(e),toFilePathsSet(t))));return n}function toPerFileSemanticDiagnostics(e){const t=new Map(mapDefinedIterator(m.keys(),(e=>!_.has(e)?[e,d]:void 0)));e==null?void 0:e.forEach((e=>{if(isNumber(e))t.delete(toFilePath(e));else t.set(toFilePath(e[0]),e[1])}));return t}function toPerFileEmitDiagnostics(e){return e&&arrayToMap(e,(e=>toFilePath(e[0])),(e=>e[1]))}}function getBuildInfoFileVersionMap(e,t,n){const r=getDirectoryPath(getNormalizedAbsolutePath(t,n.getCurrentDirectory()));const i=createGetCanonicalFileName(n.useCaseSensitiveFileNames());const o=new Map;let a=0;const s=new Map;const c=new Map(e.resolvedRoot);e.fileInfos.forEach(((t,n)=>{const s=toPath(e.fileNames[n],r,i);const c=isString(t)?t:t.version;o.set(s,c);if(atoPath(e,r,i)))}function createRedirectedBuilderProgram(e,t){return{state:void 0,getProgram:getProgram,getProgramOrUndefined:()=>e.program,releaseProgram:()=>e.program=void 0,getCompilerOptions:()=>e.compilerOptions,getSourceFile:e=>getProgram().getSourceFile(e),getSourceFiles:()=>getProgram().getSourceFiles(),getOptionsDiagnostics:e=>getProgram().getOptionsDiagnostics(e),getGlobalDiagnostics:e=>getProgram().getGlobalDiagnostics(e),getConfigFileParsingDiagnostics:()=>t,getSyntacticDiagnostics:(e,t)=>getProgram().getSyntacticDiagnostics(e,t),getDeclarationDiagnostics:(e,t)=>getProgram().getDeclarationDiagnostics(e,t),getSemanticDiagnostics:(e,t)=>getProgram().getSemanticDiagnostics(e,t),emit:(e,t,n,r,i)=>getProgram().emit(e,t,n,r,i),emitBuildInfo:(e,t)=>getProgram().emitBuildInfo(e,t),getAllDependencies:notImplemented,getCurrentDirectory:()=>getProgram().getCurrentDirectory(),close:noop};function getProgram(){return S.checkDefined(e.program)}}function createSemanticDiagnosticsBuilderProgram(e,t,n,r,i,o){return createBuilderProgram(0,getBuilderCreationParameters(e,t,n,r,i,o))}function createEmitAndSemanticDiagnosticsBuilderProgram(e,t,n,r,i,o){return createBuilderProgram(1,getBuilderCreationParameters(e,t,n,r,i,o))}function createAbstractBuilder(e,t,n,r,i,o){const{newProgram:a,configFileParsingDiagnostics:s}=getBuilderCreationParameters(e,t,n,r,i,o);return createRedirectedBuilderProgram({program:a,compilerOptions:a.getCompilerOptions()},s)}function removeIgnoredPath(e){if(endsWith(e,"/node_modules/.staging")){return removeSuffix(e,"/.staging")}return some(Et,(t=>e.includes(t)))?void 0:e}function perceivedOsRootLengthForWatching(e,t){if(t<=1)return 1;let n=1;let r=e[0].search(/[a-z]:/i)===0;if(e[0]!==Pt&&!r&&e[1].search(/[a-z]\$$/i)===0){if(t===2)return 2;n=2;r=true}if(r&&!e[n].match(/^users$/i)){return n}if(e[n].match(/^workspaces$/i)){return n+1}return n+2}function canWatchDirectoryOrFile(e,t){if(t===void 0)t=e.length;if(t<=2)return false;const n=perceivedOsRootLengthForWatching(e,t);return t>n+1}function canWatchDirectoryOrFilePath(e){return canWatchDirectoryOrFile(getPathComponents(e))}function canWatchAtTypes(e){return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(e))}function isInDirectoryPath(e,t){if(t.lengthi.length+1){return getDirectoryOfFailedLookupWatch(l,c,Math.max(i.length+1,d+1),u)}else{return{dir:n,dirPath:r,nonRecursive:true}}}return getDirectoryToWatchFromFailedLookupLocationDirectory(l,c,c.length-1,d,p,i,u,s)}function getDirectoryToWatchFromFailedLookupLocationDirectory(e,t,n,r,i,o,a,s){if(i!==-1){return getDirectoryOfFailedLookupWatch(e,t,i+1,a)}let c=true;let l=n;if(!s){for(let e=0;e=n&&r+2resolveModuleNameUsingGlobalCache(r,i,o,e,n,t,a)}}function resolveModuleNameUsingGlobalCache(e,t,n,r,i,o,a){const s=getModuleResolutionHost(e);const c=resolveModuleName(n,r,i,s,t,o,a);if(!e.getGlobalTypingsCacheLocation){return c}const l=e.getGlobalTypingsCacheLocation();if(l!==void 0&&!isExternalModuleNameRelative(n)&&!(c.resolvedModule&&extensionIsTS(c.resolvedModule.extension))){const{resolvedModule:r,failedLookupLocations:o,affectingLocations:a,resolutionDiagnostics:d}=loadModuleFromGlobalCache(S.checkDefined(e.globalCacheResolutionModuleName)(n),e.projectName,i,s,l,t);if(r){c.resolvedModule=r;c.failedLookupLocations=updateResolutionField(c.failedLookupLocations,o);c.affectingLocations=updateResolutionField(c.affectingLocations,a);c.resolutionDiagnostics=updateResolutionField(c.resolutionDiagnostics,d);return c}}return c}function createResolutionCache(e,t,n){let r;let i;let o;const a=new Set;const s=new Set;const c=new Set;const l=new Map;const p=new Map;let u=false;let f;let m;let _;let g;let y;let h=false;const T=memoize((()=>e.getCurrentDirectory()));const v=e.getCachedDirectoryStructureHost();const x=new Map;const b=createModuleResolutionCache(T(),e.getCanonicalFileName,e.getCompilationSettings());const C=new Map;const E=createTypeReferenceDirectiveResolutionCache(T(),e.getCanonicalFileName,e.getCompilationSettings(),b.getPackageJsonInfoCache(),b.optionsToRedirectsKey);const N=new Map;const k=createModuleResolutionCache(T(),e.getCanonicalFileName,getOptionsForLibraryResolution(e.getCompilationSettings()),b.getPackageJsonInfoCache());const F=new Map;const P=new Map;const D=getRootDirectoryOfResolutionCache(t,T);const I=e.toPath(D);const A=getPathComponents(I);const O=canWatchDirectoryOrFile(A);const w=new Map;const L=new Map;const M=new Map;const R=new Map;return{rootDirForResolution:t,resolvedModuleNames:x,resolvedTypeReferenceDirectives:C,resolvedLibraries:N,resolvedFileToResolution:l,resolutionsWithFailedLookups:s,resolutionsWithOnlyAffectingLocations:c,directoryWatchesOfFailedLookups:F,fileWatchesOfAffectingLocations:P,packageDirWatchers:L,dirPathToSymlinkPackageRefCount:M,watchFailedLookupLocationsOfExternalModuleResolutions:watchFailedLookupLocationsOfExternalModuleResolutions,getModuleResolutionCache:()=>b,startRecordingFilesWithChangedResolutions:startRecordingFilesWithChangedResolutions,finishRecordingFilesWithChangedResolutions:finishRecordingFilesWithChangedResolutions,startCachingPerDirectoryResolution:startCachingPerDirectoryResolution,finishCachingPerDirectoryResolution:finishCachingPerDirectoryResolution,resolveModuleNameLiterals:resolveModuleNameLiterals,resolveTypeReferenceDirectiveReferences:resolveTypeReferenceDirectiveReferences,resolveLibrary:resolveLibrary2,resolveSingleModuleNameWithoutWatching:resolveSingleModuleNameWithoutWatching,removeResolutionsFromProjectReferenceRedirects:removeResolutionsFromProjectReferenceRedirects,removeResolutionsOfFile:removeResolutionsOfFile,hasChangedAutomaticTypeDirectiveNames:()=>u,invalidateResolutionOfFile:invalidateResolutionOfFile,invalidateResolutionsOfFailedLookupLocations:invalidateResolutionsOfFailedLookupLocations,setFilesWithInvalidatedNonRelativeUnresolvedImports:setFilesWithInvalidatedNonRelativeUnresolvedImports,createHasInvalidatedResolutions:createHasInvalidatedResolutions,isFileWithInvalidatedNonRelativeUnresolvedImports:isFileWithInvalidatedNonRelativeUnresolvedImports,updateTypeRootsWatch:updateTypeRootsWatch,closeTypeRootsWatch:closeTypeRootsWatch,clear:clear2,onChangesAffectModuleResolution:onChangesAffectModuleResolution};function clear2(){clearMap(F,closeFileWatcherOf);clearMap(P,closeFileWatcherOf);w.clear();L.clear();M.clear();a.clear();closeTypeRootsWatch();x.clear();C.clear();l.clear();s.clear();c.clear();_=void 0;g=void 0;y=void 0;m=void 0;f=void 0;h=false;b.clear();E.clear();b.update(e.getCompilationSettings());E.update(e.getCompilationSettings());k.clear();p.clear();N.clear();u=false}function onChangesAffectModuleResolution(){h=true;b.clearAllExceptPackageJsonInfoCache();E.clearAllExceptPackageJsonInfoCache();b.update(e.getCompilationSettings());E.update(e.getCompilationSettings())}function startRecordingFilesWithChangedResolutions(){r=[]}function finishRecordingFilesWithChangedResolutions(){const e=r;r=void 0;return e}function isFileWithInvalidatedNonRelativeUnresolvedImports(e){if(!o){return false}const t=o.get(e);return!!t&&!!t.length}function createHasInvalidatedResolutions(e,t){invalidateResolutionsOfFailedLookupLocations();const n=i;i=void 0;return{hasInvalidatedResolutions:t=>e(t)||h||!!(n==null?void 0:n.has(t))||isFileWithInvalidatedNonRelativeUnresolvedImports(t),hasInvalidatedLibResolutions:e=>{var n;return t(e)||!!((n=N==null?void 0:N.get(e))==null?void 0:n.isInvalidated)}}}function startCachingPerDirectoryResolution(){b.isReadonly=void 0;E.isReadonly=void 0;k.isReadonly=void 0;b.getPackageJsonInfoCache().isReadonly=void 0;b.clearAllExceptPackageJsonInfoCache();E.clearAllExceptPackageJsonInfoCache();k.clearAllExceptPackageJsonInfoCache();watchFailedLookupLocationOfNonRelativeModuleResolutions();w.clear()}function cleanupLibResolutionWatching(t){N.forEach(((n,r)=>{var i;if(!((i=t==null?void 0:t.resolvedLibReferences)==null?void 0:i.has(r))){stopWatchFailedLookupLocationOfResolution(n,e.toPath(getInferredLibraryNameResolveFrom(e.getCompilationSettings(),T(),r)),getResolvedModuleFromResolution);N.delete(r)}}))}function finishCachingPerDirectoryResolution(e,t){o=void 0;h=false;watchFailedLookupLocationOfNonRelativeModuleResolutions();if(e!==t){cleanupLibResolutionWatching(e);e==null?void 0:e.getSourceFiles().forEach((e=>{var t;const n=((t=e.packageJsonLocations)==null?void 0:t.length)??0;const r=p.get(e.resolvedPath)??d;for(let t=r.length;tn){for(let e=n;e{const r=e==null?void 0:e.getSourceFileByPath(n);if(!r||r.resolvedPath!==n){t.forEach((e=>P.get(e).files--));p.delete(n)}}))}F.forEach(closeDirectoryWatchesOfFailedLookup);P.forEach(closeFileWatcherOfAffectingLocation);L.forEach(closePackageDirWatcher);u=false;b.isReadonly=true;E.isReadonly=true;k.isReadonly=true;b.getPackageJsonInfoCache().isReadonly=true;w.clear()}function closePackageDirWatcher(e,t){if(e.dirPathToWatcher.size===0){L.delete(t)}}function closeDirectoryWatchesOfFailedLookup(e,t){if(e.refCount===0){F.delete(t);e.watcher.close()}}function closeFileWatcherOfAffectingLocation(e,t){var n;if(e.files===0&&e.resolutions===0&&!((n=e.symlinks)==null?void 0:n.size)){P.delete(t);e.watcher.close()}}function resolveNamesWithLocalCache({entries:t,containingFile:n,containingSourceFile:i,redirectedReference:o,options:a,perFileCache:s,reusedNames:c,loader:l,getResolutionWithResolvedFileName:d,deferWatchingNonRelativeResolution:p,shouldRetryResolution:u,logChanges:f}){const m=e.toPath(n);const _=s.get(m)||s.set(m,createModeAwareCache()).get(m);const g=[];const y=f&&isFileWithInvalidatedNonRelativeUnresolvedImports(m);const T=e.getCurrentProgram();const v=T&&T.getResolvedProjectReferenceToRedirect(n);const b=v?!o||o.sourceFile.path!==v.sourceFile.path:!!o;const C=createModeAwareCache();for(const c of t){const t=l.nameAndMode.getName(c);const T=l.nameAndMode.getMode(c,i,(o==null?void 0:o.commandLine.options)||a);let v=_.get(t,T);if(!C.has(t,T)&&(h||b||!v||v.isInvalidated||y&&!isExternalModuleNameRelative(t)&&u(v))){const n=v;v=l.resolve(t,T);if(e.onDiscoveredSymlink&&resolutionIsSymlink(v)){e.onDiscoveredSymlink()}_.set(t,T,v);if(v!==n){watchFailedLookupLocationsOfExternalModuleResolutions(t,v,m,d,p);if(n){stopWatchFailedLookupLocationOfResolution(n,m,d)}}if(f&&r&&!resolutionIsEqualTo(n,v)){r.push(m);f=false}}else{const r=getModuleResolutionHost(e);if(isTraceEnabled(a,r)&&!C.has(t,T)){const e=d(v);trace(r,s===x?(e==null?void 0:e.resolvedFileName)?e.packageId?wt.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:wt.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:wt.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:(e==null?void 0:e.resolvedFileName)?e.packageId?wt.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:wt.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:wt.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved,t,n,e==null?void 0:e.resolvedFileName,(e==null?void 0:e.packageId)&&packageIdToString(e.packageId))}}S.assert(v!==void 0&&!v.isInvalidated);C.set(t,T,true);g.push(v)}c==null?void 0:c.forEach((e=>C.set(l.nameAndMode.getName(e),l.nameAndMode.getMode(e,i,(o==null?void 0:o.commandLine.options)||a),true)));if(_.size()!==C.size()){_.forEach(((e,t,n)=>{if(!C.has(t,n)){stopWatchFailedLookupLocationOfResolution(e,m,d);_.delete(t,n)}}))}return g;function resolutionIsEqualTo(e,t){if(e===t){return true}if(!e||!t){return false}const n=d(e);const r=d(t);if(n===r){return true}if(!n||!r){return false}return n.resolvedFileName===r.resolvedFileName}}function resolveTypeReferenceDirectiveReferences(t,n,r,i,o,a){return resolveNamesWithLocalCache({entries:t,containingFile:n,containingSourceFile:o,redirectedReference:r,options:i,reusedNames:a,perFileCache:C,loader:createTypeReferenceResolutionLoader(n,r,i,getModuleResolutionHost(e),E),getResolutionWithResolvedFileName:getResolvedTypeReferenceDirectiveFromResolution,shouldRetryResolution:e=>e.resolvedTypeReferenceDirective===void 0,deferWatchingNonRelativeResolution:false})}function resolveModuleNameLiterals(t,r,i,o,a,s){return resolveNamesWithLocalCache({entries:t,containingFile:r,containingSourceFile:a,redirectedReference:i,options:o,reusedNames:s,perFileCache:x,loader:createModuleResolutionLoaderUsingGlobalCache(r,i,o,e,b),getResolutionWithResolvedFileName:getResolvedModuleFromResolution,shouldRetryResolution:e=>!e.resolvedModule||!resolutionExtensionIsTSOrJson(e.resolvedModule.extension),logChanges:n,deferWatchingNonRelativeResolution:true})}function resolveLibrary2(t,n,r,i){const o=getModuleResolutionHost(e);let a=N==null?void 0:N.get(i);if(!a||a.isInvalidated){const s=a;a=resolveLibrary(t,n,r,o,k);const c=e.toPath(n);watchFailedLookupLocationsOfExternalModuleResolutions(t,a,c,getResolvedModuleFromResolution,false);N.set(i,a);if(s){stopWatchFailedLookupLocationOfResolution(s,c,getResolvedModuleFromResolution)}}else{if(isTraceEnabled(r,o)){const e=getResolvedModuleFromResolution(a);trace(o,(e==null?void 0:e.resolvedFileName)?e.packageId?wt.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:wt.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:wt.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved,t,n,e==null?void 0:e.resolvedFileName,(e==null?void 0:e.packageId)&&packageIdToString(e.packageId))}}return a}function resolveSingleModuleNameWithoutWatching(t,n){var r,i;const o=e.toPath(n);const a=x.get(o);const s=a==null?void 0:a.get(t,void 0);if(s&&!s.isInvalidated)return s;const c=(r=e.beforeResolveSingleModuleNameWithoutWatching)==null?void 0:r.call(e,b);const l=getModuleResolutionHost(e);const d=resolveModuleName(t,n,e.getCompilationSettings(),l,b);(i=e.afterResolveSingleModuleNameWithoutWatching)==null?void 0:i.call(e,b,t,n,d,c);return d}function isNodeModulesAtTypesDirectory(e){return endsWith(e,"/node_modules/@types")}function watchFailedLookupLocationsOfExternalModuleResolutions(t,n,r,i,o){(n.files??(n.files=new Set)).add(r);if(n.files.size!==1)return;if(!o||isExternalModuleNameRelative(t)){watchFailedLookupLocationOfResolution(n)}else{a.add(n)}const s=i(n);if(s&&s.resolvedFileName){const t=e.toPath(s.resolvedFileName);let r=l.get(t);if(!r)l.set(t,r=new Set);r.add(n)}}function watchFailedLookupLocation(t,n){const r=e.toPath(t);const i=getDirectoryToWatchFailedLookupLocation(t,r,D,I,A,O,T,e.preferNonRecursiveWatch);if(i){const{dir:e,dirPath:t,nonRecursive:r,packageDir:o,packageDirPath:a}=i;if(t===I){S.assert(r);S.assert(!o);n=true}else{setDirectoryWatcher(e,t,o,a,r)}}return n}function watchFailedLookupLocationOfResolution(e){var t;S.assert(!!((t=e.files)==null?void 0:t.size));const{failedLookupLocations:n,affectingLocations:r,alternateResult:i}=e;if(!(n==null?void 0:n.length)&&!(r==null?void 0:r.length)&&!i)return;if((n==null?void 0:n.length)||i)s.add(e);let o=false;if(n){for(const e of n){o=watchFailedLookupLocation(e,o)}}if(i)o=watchFailedLookupLocation(i,o);if(o){setDirectoryWatcher(D,I,void 0,void 0,true)}watchAffectingLocationsOfResolution(e,!(n==null?void 0:n.length)&&!i)}function watchAffectingLocationsOfResolution(e,t){var n;S.assert(!!((n=e.files)==null?void 0:n.size));const{affectingLocations:r}=e;if(!(r==null?void 0:r.length))return;if(t)c.add(e);for(const e of r){createFileWatcherOfAffectingLocation(e,true)}}function createFileWatcherOfAffectingLocation(t,n){const r=P.get(t);if(r){if(n)r.resolutions++;else r.files++;return}let i=t;let o=false;let a;if(e.realpath){i=e.realpath(t);if(t!==i){o=true;a=P.get(i)}}const s=n?1:0;const c=n?0:1;if(!o||!a){const t={watcher:canWatchAffectingLocation(e.toPath(i))?e.watchAffectingFileLocation(i,((t,n)=>{v==null?void 0:v.addOrDeleteFile(t,e.toPath(i),n);invalidateAffectingFileWatcher(i,b.getPackageJsonInfoCache().getInternalMap());e.scheduleInvalidateResolutionsOfFailedLookupLocations()})):ts,resolutions:o?0:s,files:o?0:c,symlinks:void 0};P.set(i,t);if(o)a=t}if(o){S.assert(!!a);const e={watcher:{close:()=>{var e;const n=P.get(i);if(((e=n==null?void 0:n.symlinks)==null?void 0:e.delete(t))&&!n.symlinks.size&&!n.resolutions&&!n.files){P.delete(i);n.watcher.close()}}},resolutions:s,files:c,symlinks:void 0};P.set(t,e);(a.symlinks??(a.symlinks=new Set)).add(t)}}function invalidateAffectingFileWatcher(t,n){var r;const i=P.get(t);if(i==null?void 0:i.resolutions)(m??(m=new Set)).add(t);if(i==null?void 0:i.files)(f??(f=new Set)).add(t);(r=i==null?void 0:i.symlinks)==null?void 0:r.forEach((e=>invalidateAffectingFileWatcher(e,n)));n==null?void 0:n.delete(e.toPath(t))}function watchFailedLookupLocationOfNonRelativeModuleResolutions(){a.forEach(watchFailedLookupLocationOfResolution);a.clear()}function createDirectoryWatcherForPackageDir(t,n,r,i,o){S.assert(!o);let a=w.get(i);let s=L.get(i);if(a===void 0){const t=e.realpath(r);a=t!==r&&e.toPath(t)!==i;w.set(i,a);if(!s){L.set(i,s={dirPathToWatcher:new Map,isSymlink:a})}else if(s.isSymlink!==a){s.dirPathToWatcher.forEach((e=>{removeDirectoryWatcher(s.isSymlink?i:n);e.watcher=createDirPathToWatcher()}));s.isSymlink=a}}else{S.assertIsDefined(s);S.assert(a===s.isSymlink)}const c=s.dirPathToWatcher.get(n);if(c){c.refCount++}else{s.dirPathToWatcher.set(n,{watcher:createDirPathToWatcher(),refCount:1});if(a)M.set(n,(M.get(n)??0)+1)}function createDirPathToWatcher(){return a?createOrAddRefToDirectoryWatchOfFailedLookups(r,i,o):createOrAddRefToDirectoryWatchOfFailedLookups(t,n,o)}}function setDirectoryWatcher(t,n,r,i,o){if(!i||!e.realpath){createOrAddRefToDirectoryWatchOfFailedLookups(t,n,o)}else{createDirectoryWatcherForPackageDir(t,n,r,i,o)}}function createOrAddRefToDirectoryWatchOfFailedLookups(e,t,n){let r=F.get(t);if(r){S.assert(!!n===!!r.nonRecursive);r.refCount++}else{F.set(t,r={watcher:createDirectoryWatcher(e,t,n),refCount:1,nonRecursive:n})}return r}function stopWatchFailedLookupLocation(t,n){const r=e.toPath(t);const i=getDirectoryToWatchFailedLookupLocation(t,r,D,I,A,O,T,e.preferNonRecursiveWatch);if(i){const{dirPath:t,packageDirPath:r}=i;if(t===I){n=true}else if(r&&e.realpath){const e=L.get(r);const n=e.dirPathToWatcher.get(t);n.refCount--;if(n.refCount===0){removeDirectoryWatcher(e.isSymlink?r:t);e.dirPathToWatcher.delete(t);if(e.isSymlink){const e=M.get(t)-1;if(e===0){M.delete(t)}else{M.set(t,e)}}}}else{removeDirectoryWatcher(t)}}return n}function stopWatchFailedLookupLocationOfResolution(t,n,r){S.checkDefined(t.files).delete(n);if(t.files.size)return;t.files=void 0;const i=r(t);if(i&&i.resolvedFileName){const n=e.toPath(i.resolvedFileName);const r=l.get(n);if((r==null?void 0:r.delete(t))&&!r.size)l.delete(n)}const{failedLookupLocations:o,affectingLocations:a,alternateResult:d}=t;if(s.delete(t)){let e=false;if(o){for(const t of o){e=stopWatchFailedLookupLocation(t,e)}}if(d)e=stopWatchFailedLookupLocation(d,e);if(e)removeDirectoryWatcher(I)}else if(a==null?void 0:a.length){c.delete(t)}if(a){for(const e of a){const t=P.get(e);t.resolutions--}}}function removeDirectoryWatcher(e){const t=F.get(e);t.refCount--}function createDirectoryWatcher(t,n,r){return e.watchDirectoryOfFailedLookupLocation(t,(t=>{const r=e.toPath(t);if(v){v.addOrDeleteFileOrDirectory(t,r)}scheduleInvalidateResolutionOfFailedLookupLocation(r,n===r)}),r?0:1)}function removeResolutionsOfFileFromCache(e,t,n){const r=e.get(t);if(r){r.forEach((e=>stopWatchFailedLookupLocationOfResolution(e,t,n)));e.delete(t)}}function removeResolutionsFromProjectReferenceRedirects(t){if(!fileExtensionIs(t,".json"))return;const n=e.getCurrentProgram();if(!n)return;const r=n.getResolvedProjectReferenceByPath(t);if(!r)return;r.commandLine.fileNames.forEach((t=>removeResolutionsOfFile(e.toPath(t))))}function removeResolutionsOfFile(e){removeResolutionsOfFileFromCache(x,e,getResolvedModuleFromResolution);removeResolutionsOfFileFromCache(C,e,getResolvedTypeReferenceDirectiveFromResolution)}function invalidateResolutions(e,t){if(!e)return false;let n=false;e.forEach((e=>{if(e.isInvalidated||!t(e))return;e.isInvalidated=n=true;for(const t of S.checkDefined(e.files)){(i??(i=new Set)).add(t);u=u||endsWith(t,Ha)}}));return n}function invalidateResolutionOfFile(t){removeResolutionsOfFile(t);const n=u;if(invalidateResolutions(l.get(t),returnTrue)&&u&&!n){e.onChangedAutomaticTypeDirectiveNames()}}function setFilesWithInvalidatedNonRelativeUnresolvedImports(e){S.assert(o===e||o===void 0);o=e}function scheduleInvalidateResolutionOfFailedLookupLocation(t,n){if(n){(y||(y=new Set)).add(t)}else{const n=removeIgnoredPath(t);if(!n)return false;t=n;if(e.fileIsOpen(t)){return false}const r=getDirectoryPath(t);if(isNodeModulesAtTypesDirectory(t)||isNodeModulesDirectory(t)||isNodeModulesAtTypesDirectory(r)||isNodeModulesDirectory(r)){(_||(_=new Set)).add(t);(g||(g=new Set)).add(t)}else{if(isEmittedFileOfProgram(e.getCurrentProgram(),t)){return false}if(fileExtensionIs(t,".map")){return false}(_||(_=new Set)).add(t);(g||(g=new Set)).add(t);const n=parseNodeModuleFromPath(t,true);if(n)(g||(g=new Set)).add(n)}}e.scheduleInvalidateResolutionsOfFailedLookupLocations()}function invalidatePackageJsonMap(){const e=b.getPackageJsonInfoCache().getInternalMap();if(e&&(_||g||y)){e.forEach(((t,n)=>isInvalidatedFailedLookup(n)?e.delete(n):void 0))}}function invalidateResolutionsOfFailedLookupLocations(){var t;if(h){f=void 0;invalidatePackageJsonMap();if(_||g||y||m){invalidateResolutions(N,canInvalidateFailedLookupResolution)}_=void 0;g=void 0;y=void 0;m=void 0;return true}let n=false;if(f){(t=e.getCurrentProgram())==null?void 0:t.getSourceFiles().forEach((e=>{if(some(e.packageJsonLocations,(e=>f.has(e)))){(i??(i=new Set)).add(e.path);n=true}}));f=void 0}if(!_&&!g&&!y&&!m){return n}n=invalidateResolutions(s,canInvalidateFailedLookupResolution)||n;invalidatePackageJsonMap();_=void 0;g=void 0;y=void 0;n=invalidateResolutions(c,canInvalidatedFailedLookupResolutionWithAffectingLocation)||n;m=void 0;return n}function canInvalidateFailedLookupResolution(t){var n;if(canInvalidatedFailedLookupResolutionWithAffectingLocation(t))return true;if(!_&&!g&&!y)return false;return((n=t.failedLookupLocations)==null?void 0:n.some((t=>isInvalidatedFailedLookup(e.toPath(t)))))||!!t.alternateResult&&isInvalidatedFailedLookup(e.toPath(t.alternateResult))}function isInvalidatedFailedLookup(e){return(_==null?void 0:_.has(e))||firstDefinedIterator((g==null?void 0:g.keys())||[],(t=>startsWith(e,t)?true:void 0))||firstDefinedIterator((y==null?void 0:y.keys())||[],(t=>e.length>t.length&&startsWith(e,t)&&(isDiskPathRoot(t)||e[t.length]===Pt)?true:void 0))}function canInvalidatedFailedLookupResolutionWithAffectingLocation(e){var t;return!!m&&((t=e.affectingLocations)==null?void 0:t.some((e=>m.has(e))))}function closeTypeRootsWatch(){clearMap(R,closeFileWatcher)}function createTypeRootsWatch(t){return canWatchTypeRootPath(t)?e.watchTypeRootsDirectory(t,(n=>{const r=e.toPath(n);if(v){v.addOrDeleteFileOrDirectory(n,r)}u=true;e.onChangedAutomaticTypeDirectiveNames();const i=getDirectoryToWatchFailedLookupLocationFromTypeRoot(t,e.toPath(t),I,A,O,T,e.preferNonRecursiveWatch,(e=>F.has(e)||M.has(e)));if(i){scheduleInvalidateResolutionOfFailedLookupLocation(r,i===r)}}),1):ts}function updateTypeRootsWatch(){const t=e.getCompilationSettings();if(t.types){closeTypeRootsWatch();return}const n=getEffectiveTypeRoots(t,{getCurrentDirectory:T});if(n){mutateMap(R,new Set(n),{createNewValue:createTypeRootsWatch,onDeleteValue:closeFileWatcher})}else{closeTypeRootsWatch()}}function canWatchTypeRootPath(t){if(e.getCompilationSettings().typeRoots)return true;return canWatchAtTypes(e.toPath(t))}}function resolutionIsSymlink(e){var t,n;return!!(((t=e.resolvedModule)==null?void 0:t.originalPath)||((n=e.resolvedTypeReferenceDirective)==null?void 0:n.originalPath))}var Za=Ft?{getCurrentDirectory:()=>Ft.getCurrentDirectory(),getNewLine:()=>Ft.newLine,getCanonicalFileName:createGetCanonicalFileName(Ft.useCaseSensitiveFileNames)}:void 0;function createDiagnosticReporter(e,t){const n=e===Ft&&Za?Za:{getCurrentDirectory:()=>e.getCurrentDirectory(),getNewLine:()=>e.newLine,getCanonicalFileName:createGetCanonicalFileName(e.useCaseSensitiveFileNames)};if(!t){return t=>e.write(formatDiagnostic(t,n))}const r=new Array(1);return t=>{r[0]=t;e.write(formatDiagnosticsWithColorAndContext(r,n)+n.getNewLine());r[0]=void 0}}function clearScreenIfNotWatchingForFileChanges(e,t,n){if(e.clearScreen&&!n.preserveWatchOutput&&!n.extendedDiagnostics&&!n.diagnostics&&contains(es,t.code)){e.clearScreen();return true}return false}var es=[wt.Starting_compilation_in_watch_mode.code,wt.File_change_detected_Starting_incremental_compilation.code];function getPlainDiagnosticFollowingNewLines(e,t){return contains(es,e.code)?t+t:t}function getLocaleTimeString(e){return!e.now?(new Date).toLocaleTimeString():e.now().toLocaleTimeString("en-US",{timeZone:"UTC"}).replace(" "," ")}function createWatchStatusReporter(e,t){return t?(t,n,r)=>{clearScreenIfNotWatchingForFileChanges(e,t,r);let i=`[${formatColorAndReset(getLocaleTimeString(e),"")}] `;i+=`${flattenDiagnosticMessageText(t.messageText,e.newLine)}${n+n}`;e.write(i)}:(t,n,r)=>{let i="";if(!clearScreenIfNotWatchingForFileChanges(e,t,r)){i+=n}i+=`${getLocaleTimeString(e)} - `;i+=`${flattenDiagnosticMessageText(t.messageText,e.newLine)}${getPlainDiagnosticFollowingNewLines(t,n)}`;e.write(i)}}function parseConfigFileWithSystem(e,t,n,r,i,o){const a=i;a.onUnRecoverableConfigFileDiagnostic=e=>reportUnrecoverableDiagnostic(i,o,e);const s=getParsedCommandLineOfConfigFile(e,t,a,n,r);a.onUnRecoverableConfigFileDiagnostic=void 0;return s}function getErrorCountForSummary(e){return countWhere(e,(e=>e.category===1))}function getFilesInErrorForSummary(e){const t=filter(e,(e=>e.category===1)).map((e=>{if(e.file===void 0)return;return`${e.file.fileName}`}));return t.map((t=>{if(t===void 0){return void 0}const n=find(e,(e=>e.file!==void 0&&e.file.fileName===t));if(n!==void 0){const{line:e}=getLineAndCharacterOfPosition(n.file,n.start);return{fileName:t,line:e+1}}}))}function getWatchErrorSummaryDiagnosticMessage(e){return e===1?wt.Found_1_error_Watching_for_file_changes:wt.Found_0_errors_Watching_for_file_changes}function prettyPathForFileError(e,t){const n=formatColorAndReset(":"+e.line,"");if(pathIsAbsolute(e.fileName)&&pathIsAbsolute(t)){return getRelativePathFromDirectory(t,e.fileName,false)+n}return e.fileName+n}function getErrorSummaryText(e,t,n,r){if(e===0)return"";const i=t.filter((e=>e!==void 0));const o=i.map((e=>`${e.fileName}:${e.line}`)).filter(((e,t,n)=>n.indexOf(e)===t));const a=i[0]&&prettyPathForFileError(i[0],r.getCurrentDirectory());let s;if(e===1){s=t[0]!==void 0?[wt.Found_1_error_in_0,a]:[wt.Found_1_error]}else{s=o.length===0?[wt.Found_0_errors,e]:o.length===1?[wt.Found_0_errors_in_the_same_file_starting_at_Colon_1,e,a]:[wt.Found_0_errors_in_1_files,e,o.length]}const c=createCompilerDiagnostic(...s);const l=o.length>1?createTabularErrorsDisplay(i,r):"";return`${n}${flattenDiagnosticMessageText(c.messageText,n)}${n}${n}${l}`}function createTabularErrorsDisplay(e,t){const n=e.filter(((e,t,n)=>t===n.findIndex((t=>(t==null?void 0:t.fileName)===(e==null?void 0:e.fileName)))));if(n.length===0)return"";const numberLength=e=>Math.log(e)*Math.LOG10E+1;const r=n.map((t=>[t,countWhere(e,(e=>e.fileName===t.fileName))]));const i=maxBy(r,0,(e=>e[1]));const o=wt.Errors_Files.message;const a=o.split(" ")[0].length;const s=Math.max(a,numberLength(i));const c=Math.max(numberLength(i)-a,0);let l="";l+=" ".repeat(c)+o+"\n";r.forEach((e=>{const[n,r]=e;const i=Math.log(r)*Math.LOG10E+1|0;const o=i{t(e.fileName)}))}}function explainFiles(e,t){var n,r;const i=e.getFileIncludeReasons();const relativeFileName=t=>convertToRelativePath(t,e.getCurrentDirectory(),e.getCanonicalFileName);for(const o of e.getSourceFiles()){t(`${toFileName(o,relativeFileName)}`);(n=i.get(o.path))==null?void 0:n.forEach((n=>t(` ${fileIncludeReasonToDiagnostics(e,n,relativeFileName).messageText}`)));(r=explainIfFileIsRedirectAndImpliedFormat(o,e.getCompilerOptionsForFile(o),relativeFileName))==null?void 0:r.forEach((e=>t(` ${e.messageText}`)))}}function explainIfFileIsRedirectAndImpliedFormat(e,t,n){var r;let i;if(e.path!==e.resolvedPath){(i??(i=[])).push(chainDiagnosticMessages(void 0,wt.File_is_output_of_project_reference_source_0,toFileName(e.originalFileName,n)))}if(e.redirectInfo){(i??(i=[])).push(chainDiagnosticMessages(void 0,wt.File_redirects_to_file_0,toFileName(e.redirectInfo.redirectTarget,n)))}if(isExternalOrCommonJsModule(e)){switch(getImpliedNodeFormatForEmitWorker(e,t)){case 99:if(e.packageJsonScope){(i??(i=[])).push(chainDiagnosticMessages(void 0,wt.File_is_ECMAScript_module_because_0_has_field_type_with_value_module,toFileName(last(e.packageJsonLocations),n)))}break;case 1:if(e.packageJsonScope){(i??(i=[])).push(chainDiagnosticMessages(void 0,e.packageJsonScope.contents.packageJsonContent.type?wt.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module:wt.File_is_CommonJS_module_because_0_does_not_have_field_type,toFileName(last(e.packageJsonLocations),n)))}else if((r=e.packageJsonLocations)==null?void 0:r.length){(i??(i=[])).push(chainDiagnosticMessages(void 0,wt.File_is_CommonJS_module_because_package_json_was_not_found))}break}}return i}function getMatchedFileSpec(e,t){var n;const r=e.getCompilerOptions().configFile;if(!((n=r==null?void 0:r.configFileSpecs)==null?void 0:n.validatedFilesSpec))return void 0;const i=e.getCanonicalFileName(t);const o=getDirectoryPath(getNormalizedAbsolutePath(r.fileName,e.getCurrentDirectory()));const a=findIndex(r.configFileSpecs.validatedFilesSpec,(t=>e.getCanonicalFileName(getNormalizedAbsolutePath(t,o))===i));return a!==-1?r.configFileSpecs.validatedFilesSpecBeforeSubstitution[a]:void 0}function getMatchedIncludeSpec(e,t){var n,r;const i=e.getCompilerOptions().configFile;if(!((n=i==null?void 0:i.configFileSpecs)==null?void 0:n.validatedIncludeSpecs))return void 0;if(i.configFileSpecs.isDefaultIncludeSpec)return true;const o=fileExtensionIs(t,".json");const a=getDirectoryPath(getNormalizedAbsolutePath(i.fileName,e.getCurrentDirectory()));const s=e.useCaseSensitiveFileNames();const c=findIndex((r=i==null?void 0:i.configFileSpecs)==null?void 0:r.validatedIncludeSpecs,(e=>{if(o&&!endsWith(e,".json"))return false;const n=getPatternFromSpec(e,a,"files");return!!n&&getRegexFromPattern(`(${n})$`,s).test(t)}));return c!==-1?i.configFileSpecs.validatedIncludeSpecsBeforeSubstitution[c]:void 0}function fileIncludeReasonToDiagnostics(e,t,n){var r,i;const o=e.getCompilerOptions();if(isReferencedFile(t)){const r=getReferencedFileLocation(e,t);const i=isReferenceFileLocation(r)?r.file.text.substring(r.pos,r.end):`"${r.text}"`;let o;S.assert(isReferenceFileLocation(r)||t.kind===3,"Only synthetic references are imports");switch(t.kind){case 3:if(isReferenceFileLocation(r)){o=r.packageId?wt.Imported_via_0_from_file_1_with_packageId_2:wt.Imported_via_0_from_file_1}else if(r.text===cn){o=r.packageId?wt.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:wt.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions}else{o=r.packageId?wt.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:wt.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions}break;case 4:S.assert(!r.packageId);o=wt.Referenced_via_0_from_file_1;break;case 5:o=r.packageId?wt.Type_library_referenced_via_0_from_file_1_with_packageId_2:wt.Type_library_referenced_via_0_from_file_1;break;case 7:S.assert(!r.packageId);o=wt.Library_referenced_via_0_from_file_1;break;default:S.assertNever(t)}return chainDiagnosticMessages(void 0,o,i,toFileName(r.file,n),r.packageId&&packageIdToString(r.packageId))}switch(t.kind){case 0:if(!((r=o.configFile)==null?void 0:r.configFileSpecs))return chainDiagnosticMessages(void 0,wt.Root_file_specified_for_compilation);const a=getNormalizedAbsolutePath(e.getRootFileNames()[t.index],e.getCurrentDirectory());const s=getMatchedFileSpec(e,a);if(s)return chainDiagnosticMessages(void 0,wt.Part_of_files_list_in_tsconfig_json);const c=getMatchedIncludeSpec(e,a);return isString(c)?chainDiagnosticMessages(void 0,wt.Matched_by_include_pattern_0_in_1,c,toFileName(o.configFile,n)):chainDiagnosticMessages(void 0,c?wt.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk:wt.Root_file_specified_for_compilation);case 1:case 2:const l=t.kind===2;const d=S.checkDefined((i=e.getResolvedProjectReferences())==null?void 0:i[t.index]);return chainDiagnosticMessages(void 0,o.outFile?l?wt.Output_from_referenced_project_0_included_because_1_specified:wt.Source_from_referenced_project_0_included_because_1_specified:l?wt.Output_from_referenced_project_0_included_because_module_is_specified_as_none:wt.Source_from_referenced_project_0_included_because_module_is_specified_as_none,toFileName(d.sourceFile.fileName,n),o.outFile?"--outFile":"--out");case 8:{const e=o.types?t.packageId?[wt.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1,t.typeReference,packageIdToString(t.packageId)]:[wt.Entry_point_of_type_library_0_specified_in_compilerOptions,t.typeReference]:t.packageId?[wt.Entry_point_for_implicit_type_library_0_with_packageId_1,t.typeReference,packageIdToString(t.packageId)]:[wt.Entry_point_for_implicit_type_library_0,t.typeReference];return chainDiagnosticMessages(void 0,...e)}case 6:{if(t.index!==void 0)return chainDiagnosticMessages(void 0,wt.Library_0_specified_in_compilerOptions,o.lib[t.index]);const e=getNameOfScriptTarget(zn(o));const n=e?[wt.Default_library_for_target_0,e]:[wt.Default_library];return chainDiagnosticMessages(void 0,...n)}default:S.assertNever(t)}}function toFileName(e,t){const n=isString(e)?e:e.fileName;return t?t(n):n}function emitFilesAndReportErrors(e,t,n,r,i,o,a,s){const c=e.getCompilerOptions();const l=e.getConfigFileParsingDiagnostics().slice();const p=l.length;addRange(l,e.getSyntacticDiagnostics(void 0,o));if(l.length===p){addRange(l,e.getOptionsDiagnostics(o));if(!c.listFilesOnly){addRange(l,e.getGlobalDiagnostics(o));if(l.length===p){addRange(l,e.getSemanticDiagnostics(void 0,o))}if(c.noEmit&&Zn(c)&&l.length===p){addRange(l,e.getDeclarationDiagnostics(void 0,o))}}}const u=c.listFilesOnly?{emitSkipped:true,diagnostics:d}:e.emit(void 0,i,o,a,s);addRange(l,u.diagnostics);const f=sortAndDeduplicateDiagnostics(l);f.forEach(t);if(n){const t=e.getCurrentDirectory();forEach(u.emittedFiles,(e=>{const r=getNormalizedAbsolutePath(e,t);n(`TSFILE: ${r}`)}));listFiles(e,n)}if(r){r(getErrorCountForSummary(f),getFilesInErrorForSummary(f))}return{emitResult:u,diagnostics:f}}function emitFilesAndReportErrorsAndGetExitStatus(e,t,n,r,i,o,a,s){const{emitResult:c,diagnostics:l}=emitFilesAndReportErrors(e,t,n,r,i,o,a,s);if(c.emitSkipped&&l.length>0){return 1}else if(l.length>0){return 2}return 0}var ts={close:noop};var returnNoopFileWatcher=()=>ts;function createWatchHost(e=Ft,t){const n=t||createWatchStatusReporter(e);return{onWatchStatusChange:n,watchFile:maybeBind(e,e.watchFile)||returnNoopFileWatcher,watchDirectory:maybeBind(e,e.watchDirectory)||returnNoopFileWatcher,setTimeout:maybeBind(e,e.setTimeout)||noop,clearTimeout:maybeBind(e,e.clearTimeout)||noop,preferNonRecursiveWatch:e.preferNonRecursiveWatch}}var ns={ConfigFile:"Config file",ExtendedConfigFile:"Extended config file",SourceFile:"Source file",MissingFile:"Missing file",WildcardDirectory:"Wild card directory",FailedLookupLocations:"Failed Lookup Locations",AffectingFileLocation:"File location affecting resolution",TypeRoots:"Type roots",ConfigFileOfReferencedProject:"Config file of referened project",ExtendedConfigOfReferencedProject:"Extended config file of referenced project",WildcardDirectoryOfReferencedProject:"Wild card directory of referenced project",PackageJson:"package.json file",ClosedScriptInfo:"Closed Script info",ConfigFileForInferredRoot:"Config file for the inferred project root",NodeModules:"node_modules for closed script infos and package.jsons affecting module specifier cache",MissingSourceMapFile:"Missing source map file",NoopConfigFileForInferredRoot:"Noop Config file for the inferred project root",MissingGeneratedFile:"Missing generated file",NodeModulesForModuleSpecifierCache:"node_modules for module specifier cache invalidation",TypingInstallerLocationFile:"File location for typing installer",TypingInstallerLocationDirectory:"Directory location for typing installer"};function createWatchFactory(e,t){const n=e.trace?t.extendedDiagnostics?2:t.diagnostics?1:0:0;const r=n!==0?t=>e.trace(t):noop;const i=getWatchFactory(e,n,r);i.writeLog=r;return i}function createCompilerHostFromProgramHost(e,t,n=e){const r=e.useCaseSensitiveFileNames();const i={getSourceFile:createGetSourceFile(((t,n)=>!n?i.readFile(t):e.readFile(t,n)),void 0),getDefaultLibLocation:maybeBind(e,e.getDefaultLibLocation),getDefaultLibFileName:t=>e.getDefaultLibFileName(t),writeFile:createWriteFileMeasuringIO(((t,n,r)=>e.writeFile(t,n,r)),(t=>e.createDirectory(t)),(t=>e.directoryExists(t))),getCurrentDirectory:memoize((()=>e.getCurrentDirectory())),useCaseSensitiveFileNames:()=>r,getCanonicalFileName:createGetCanonicalFileName(r),getNewLine:()=>getNewLineCharacter(t()),fileExists:t=>e.fileExists(t),readFile:t=>e.readFile(t),trace:maybeBind(e,e.trace),directoryExists:maybeBind(n,n.directoryExists),getDirectories:maybeBind(n,n.getDirectories),realpath:maybeBind(e,e.realpath),getEnvironmentVariable:maybeBind(e,e.getEnvironmentVariable)||(()=>""),createHash:maybeBind(e,e.createHash),readDirectory:maybeBind(e,e.readDirectory),storeSignatureInfo:e.storeSignatureInfo,jsDocParsingMode:e.jsDocParsingMode};return i}function getSourceFileVersionAsHashFromText(e,t){if(t.match(fa)){let e=t.length;let n=e;for(let r=e-1;r>=0;r--){const i=t.charCodeAt(r);switch(i){case 10:if(r&&t.charCodeAt(r-1)===13){r--}case 13:break;default:if(i<127||!isLineBreak(i)){n=r;continue}break}const o=t.substring(n,e);if(o.match(ma)){t=t.substring(0,n);break}else if(!o.match(_a)){break}e=n}}return(e.createHash||generateDjb2Hash)(t)}function setGetSourceFileAsHashVersioned(e){const t=e.getSourceFile;e.getSourceFile=(...n)=>{const r=t.call(e,...n);if(r){r.version=getSourceFileVersionAsHashFromText(e,r.text)}return r}}function createProgramHost(e,t){const n=memoize((()=>getDirectoryPath(normalizePath(e.getExecutingFilePath()))));return{useCaseSensitiveFileNames:()=>e.useCaseSensitiveFileNames,getNewLine:()=>e.newLine,getCurrentDirectory:memoize((()=>e.getCurrentDirectory())),getDefaultLibLocation:n,getDefaultLibFileName:e=>combinePaths(n(),getDefaultLibFileName(e)),fileExists:t=>e.fileExists(t),readFile:(t,n)=>e.readFile(t,n),directoryExists:t=>e.directoryExists(t),getDirectories:t=>e.getDirectories(t),readDirectory:(t,n,r,i,o)=>e.readDirectory(t,n,r,i,o),realpath:maybeBind(e,e.realpath),getEnvironmentVariable:maybeBind(e,e.getEnvironmentVariable),trace:t=>e.write(t+e.newLine),createDirectory:t=>e.createDirectory(t),writeFile:(t,n,r)=>e.writeFile(t,n,r),createHash:maybeBind(e,e.createHash),createProgram:t||createEmitAndSemanticDiagnosticsBuilderProgram,storeSignatureInfo:e.storeSignatureInfo,now:maybeBind(e,e.now)}}function createWatchCompilerHost(e=Ft,t,n,r){const write=t=>e.write(t+e.newLine);const i=createProgramHost(e,t);copyProperties(i,createWatchHost(e,r));i.afterProgramCreate=e=>{const t=e.getCompilerOptions();const r=getNewLineCharacter(t);emitFilesAndReportErrors(e,n,write,(e=>i.onWatchStatusChange(createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(e),e),r,t,e)))};return i}function reportUnrecoverableDiagnostic(e,t,n){t(n);e.exit(1)}function createWatchCompilerHostOfConfigFile({configFileName:e,optionsToExtend:t,watchOptionsToExtend:n,extraFileExtensions:r,system:i,createProgram:o,reportDiagnostic:a,reportWatchStatus:s}){const c=a||createDiagnosticReporter(i);const l=createWatchCompilerHost(i,o,c,s);l.onUnRecoverableConfigFileDiagnostic=e=>reportUnrecoverableDiagnostic(i,c,e);l.configFileName=e;l.optionsToExtend=t;l.watchOptionsToExtend=n;l.extraFileExtensions=r;return l}function createWatchCompilerHostOfFilesAndCompilerOptions({rootFiles:e,options:t,watchOptions:n,projectReferences:r,system:i,createProgram:o,reportDiagnostic:a,reportWatchStatus:s}){const c=createWatchCompilerHost(i,o,a||createDiagnosticReporter(i),s);c.rootFiles=e;c.options=t;c.watchOptions=n;c.projectReferences=r;return c}function performIncrementalCompilation(e){const t=e.system||Ft;const n=e.host||(e.host=createIncrementalCompilerHost(e.options,t));const r=createIncrementalProgram(e);const i=emitFilesAndReportErrorsAndGetExitStatus(r,e.reportDiagnostic||createDiagnosticReporter(t),(e=>n.trace&&n.trace(e)),e.reportErrorSummary||e.options.pretty?(e,r)=>t.write(getErrorSummaryText(e,r,t.newLine,n)):void 0);if(e.afterProgramEmitAndDiagnostics)e.afterProgramEmitAndDiagnostics(r);return i}function readBuilderProgram(e,t){const n=getTsBuildInfoEmitOutputFilePath(e);if(!n)return void 0;let r;if(t.getBuildInfo){r=t.getBuildInfo(n,e.configFilePath)}else{const e=t.readFile(n);if(!e)return void 0;r=getBuildInfo(n,e)}if(!r||r.version!==c||!isIncrementalBuildInfo(r))return void 0;return createBuilderProgramUsingIncrementalBuildInfo(r,n,t)}function createIncrementalCompilerHost(e,t=Ft){const n=createCompilerHostWorker(e,void 0,t);n.createHash=maybeBind(t,t.createHash);n.storeSignatureInfo=t.storeSignatureInfo;setGetSourceFileAsHashVersioned(n);changeCompilerHostLikeToUseCache(n,(e=>toPath(e,n.getCurrentDirectory(),n.getCanonicalFileName)));return n}function createIncrementalProgram({rootNames:e,options:t,configFileParsingDiagnostics:n,projectReferences:r,host:i,createProgram:o}){i=i||createIncrementalCompilerHost(t);o=o||createEmitAndSemanticDiagnosticsBuilderProgram;const a=readBuilderProgram(t,i);return o(e,t,i,a,n,r)}function createWatchCompilerHost2(e,t,n,r,i,o,a,s){if(isArray(e)){return createWatchCompilerHostOfFilesAndCompilerOptions({rootFiles:e,options:t,watchOptions:s,projectReferences:a,system:n,createProgram:r,reportDiagnostic:i,reportWatchStatus:o})}else{return createWatchCompilerHostOfConfigFile({configFileName:e,optionsToExtend:t,watchOptionsToExtend:a,extraFileExtensions:s,system:n,createProgram:r,reportDiagnostic:i,reportWatchStatus:o})}}function createWatchProgram(e){let t;let n;let r;let i;let o=new Map([[void 0,void 0]]);let a;let s;let c;let l;let d=e.extendedConfigCache;let p=false;const u=new Map;let f;let m=false;const _=e.useCaseSensitiveFileNames();const g=e.getCurrentDirectory();const{configFileName:y,optionsToExtend:h={},watchOptionsToExtend:T,extraFileExtensions:v,createProgram:x}=e;let{rootFiles:b,options:C,watchOptions:E,projectReferences:N}=e;let k;let F;let P=false;let D=false;const I=y===void 0?void 0:createCachedDirectoryStructureHost(e,g,_);const A=I||e;const O=parseConfigHostFromCompilerHostLike(e,A);let w=updateNewLine();if(y&&e.configFileParsingResult){setConfigFileParsingResult(e.configFileParsingResult);w=updateNewLine()}reportWatchDiagnostic(wt.Starting_compilation_in_watch_mode);if(y&&!e.configFileParsingResult){w=getNewLineCharacter(h);S.assert(!b);parseConfigFile2();w=updateNewLine()}S.assert(C);S.assert(b);const{watchFile:L,watchDirectory:M,writeLog:R}=createWatchFactory(e,C);const B=createGetCanonicalFileName(_);R(`Current directory: ${g} CaseSensitiveFileNames: ${_}`);let j;if(y){j=L(y,scheduleProgramReload,2e3,E,ns.ConfigFile)}const J=createCompilerHostFromProgramHost(e,(()=>C),A);setGetSourceFileAsHashVersioned(J);const W=J.getSourceFile;J.getSourceFile=(e,...t)=>getVersionedSourceFileByPath(e,toPath3(e),...t);J.getSourceFileByPath=getVersionedSourceFileByPath;J.getNewLine=()=>w;J.fileExists=fileExists;J.onReleaseOldSourceFile=onReleaseOldSourceFile;J.onReleaseParsedCommandLine=onReleaseParsedCommandLine;J.toPath=toPath3;J.getCompilationSettings=()=>C;J.useSourceOfProjectReferenceRedirect=maybeBind(e,e.useSourceOfProjectReferenceRedirect);J.preferNonRecursiveWatch=e.preferNonRecursiveWatch;J.watchDirectoryOfFailedLookupLocation=(e,t,n)=>M(e,t,n,E,ns.FailedLookupLocations);J.watchAffectingFileLocation=(e,t)=>L(e,t,2e3,E,ns.AffectingFileLocation);J.watchTypeRootsDirectory=(e,t,n)=>M(e,t,n,E,ns.TypeRoots);J.getCachedDirectoryStructureHost=()=>I;J.scheduleInvalidateResolutionsOfFailedLookupLocations=scheduleInvalidateResolutionsOfFailedLookupLocations;J.onInvalidatedResolution=scheduleProgramUpdate;J.onChangedAutomaticTypeDirectiveNames=scheduleProgramUpdate;J.fileIsOpen=returnFalse;J.getCurrentProgram=getCurrentProgram;J.writeLog=R;J.getParsedCommandLine=getParsedCommandLine;const U=createResolutionCache(J,y?getDirectoryPath(getNormalizedAbsolutePath(y,g)):g,false);J.resolveModuleNameLiterals=maybeBind(e,e.resolveModuleNameLiterals);J.resolveModuleNames=maybeBind(e,e.resolveModuleNames);if(!J.resolveModuleNameLiterals&&!J.resolveModuleNames){J.resolveModuleNameLiterals=U.resolveModuleNameLiterals.bind(U)}J.resolveTypeReferenceDirectiveReferences=maybeBind(e,e.resolveTypeReferenceDirectiveReferences);J.resolveTypeReferenceDirectives=maybeBind(e,e.resolveTypeReferenceDirectives);if(!J.resolveTypeReferenceDirectiveReferences&&!J.resolveTypeReferenceDirectives){J.resolveTypeReferenceDirectiveReferences=U.resolveTypeReferenceDirectiveReferences.bind(U)}J.resolveLibrary=!e.resolveLibrary?U.resolveLibrary.bind(U):e.resolveLibrary.bind(e);J.getModuleResolutionCache=e.resolveModuleNameLiterals||e.resolveModuleNames?maybeBind(e,e.getModuleResolutionCache):()=>U.getModuleResolutionCache();const z=!!e.resolveModuleNameLiterals||!!e.resolveTypeReferenceDirectiveReferences||!!e.resolveModuleNames||!!e.resolveTypeReferenceDirectives;const V=z?maybeBind(e,e.hasInvalidatedResolutions)||returnTrue:returnFalse;const q=e.resolveLibrary?maybeBind(e,e.hasInvalidatedLibResolutions)||returnTrue:returnFalse;t=readBuilderProgram(C,J);synchronizeProgram();return y?{getCurrentProgram:getCurrentBuilderProgram,getProgram:updateProgram,close:close,getResolutionCache:getResolutionCache}:{getCurrentProgram:getCurrentBuilderProgram,getProgram:updateProgram,updateRootFileNames:updateRootFileNames,close:close,getResolutionCache:getResolutionCache};function close(){clearInvalidateResolutionsOfFailedLookupLocations();U.clear();clearMap(u,(e=>{if(e&&e.fileWatcher){e.fileWatcher.close();e.fileWatcher=void 0}}));if(j){j.close();j=void 0}d==null?void 0:d.clear();d=void 0;if(l){clearMap(l,closeFileWatcherOf);l=void 0}if(i){clearMap(i,closeFileWatcherOf);i=void 0}if(r){clearMap(r,closeFileWatcher);r=void 0}if(c){clearMap(c,(e=>{var t;(t=e.watcher)==null?void 0:t.close();e.watcher=void 0;if(e.watchedDirectories)clearMap(e.watchedDirectories,closeFileWatcherOf);e.watchedDirectories=void 0}));c=void 0}t=void 0}function getResolutionCache(){return U}function getCurrentBuilderProgram(){return t}function getCurrentProgram(){return t&&t.getProgramOrUndefined()}function synchronizeProgram(){R(`Synchronizing program`);S.assert(C);S.assert(b);clearInvalidateResolutionsOfFailedLookupLocations();const n=getCurrentBuilderProgram();if(m){w=updateNewLine();if(n&&changesAffectModuleResolution(n.getCompilerOptions(),C)){U.onChangesAffectModuleResolution()}}const{hasInvalidatedResolutions:r,hasInvalidatedLibResolutions:i}=U.createHasInvalidatedResolutions(V,q);const{originalReadFile:a,originalFileExists:s,originalDirectoryExists:l,originalCreateDirectory:d,originalWriteFile:u,readFileWithCache:f}=changeCompilerHostLikeToUseCache(J,toPath3);if(isProgramUptoDate(getCurrentProgram(),b,C,(e=>getSourceVersion(e,f)),(e=>J.fileExists(e)),r,i,hasChangedAutomaticTypeDirectiveNames,getParsedCommandLine,N)){if(D){if(p){reportWatchDiagnostic(wt.File_change_detected_Starting_incremental_compilation)}t=x(void 0,void 0,J,t,F,N);D=false}}else{if(p){reportWatchDiagnostic(wt.File_change_detected_Starting_incremental_compilation)}createNewProgram(r,i)}p=false;if(e.afterProgramCreate&&n!==t){e.afterProgramCreate(t)}J.readFile=a;J.fileExists=s;J.directoryExists=l;J.createDirectory=d;J.writeFile=u;o==null?void 0:o.forEach(((e,t)=>{if(!t){watchConfigFileWildCardDirectories();if(y)updateExtendedConfigFilesWatches(toPath3(y),C,E,ns.ExtendedConfigFile)}else{const n=c==null?void 0:c.get(t);if(n)watchReferencedProject(e,t,n)}}));o=void 0;return t}function createNewProgram(e,n){R("CreatingProgramWith::");R(` roots: ${JSON.stringify(b)}`);R(` options: ${JSON.stringify(C)}`);if(N)R(` projectReferences: ${JSON.stringify(N)}`);const i=m||!getCurrentProgram();m=false;D=false;U.startCachingPerDirectoryResolution();J.hasInvalidatedResolutions=e;J.hasInvalidatedLibResolutions=n;J.hasChangedAutomaticTypeDirectiveNames=hasChangedAutomaticTypeDirectiveNames;const o=getCurrentProgram();t=x(b,C,J,t,F,N);U.finishCachingPerDirectoryResolution(t.getProgram(),o);updateMissingFilePathsWatch(t.getProgram(),r||(r=new Map),watchMissingFilePath);if(i){U.updateTypeRootsWatch()}if(f){for(const e of f){if(!r.has(e)){u.delete(e)}}f=void 0}}function updateRootFileNames(e){S.assert(!y,"Cannot update root file names with config file watch mode");b=e;scheduleProgramUpdate()}function updateNewLine(){return getNewLineCharacter(C||h)}function toPath3(e){return toPath(e,g,B)}function isFileMissingOnHost(e){return typeof e==="boolean"}function isFilePresenceUnknownOnHost(e){return typeof e.version==="boolean"}function fileExists(e){const t=toPath3(e);if(isFileMissingOnHost(u.get(t))){return false}return A.fileExists(e)}function getVersionedSourceFileByPath(e,t,n,r,i){const o=u.get(t);if(isFileMissingOnHost(o)){return void 0}const a=typeof n==="object"?n.impliedNodeFormat:void 0;if(o===void 0||i||isFilePresenceUnknownOnHost(o)||o.sourceFile.impliedNodeFormat!==a){const i=W(e,n,r);if(o){if(i){o.sourceFile=i;o.version=i.version;if(!o.fileWatcher){o.fileWatcher=watchFilePath(t,e,onSourceFileChange,250,E,ns.SourceFile)}}else{if(o.fileWatcher){o.fileWatcher.close()}u.set(t,false)}}else{if(i){const n=watchFilePath(t,e,onSourceFileChange,250,E,ns.SourceFile);u.set(t,{sourceFile:i,version:i.version,fileWatcher:n})}else{u.set(t,false)}}return i}return o.sourceFile}function nextSourceFileVersion(e){const t=u.get(e);if(t!==void 0){if(isFileMissingOnHost(t)){u.set(e,{version:false})}else{t.version=false}}}function getSourceVersion(e,t){const n=u.get(e);if(!n)return void 0;if(n.version)return n.version;const r=t(e);return r!==void 0?getSourceFileVersionAsHashFromText(J,r):void 0}function onReleaseOldSourceFile(e,t,n){const r=u.get(e.resolvedPath);if(r!==void 0){if(isFileMissingOnHost(r)){(f||(f=[])).push(e.path)}else if(r.sourceFile===e){if(r.fileWatcher){r.fileWatcher.close()}u.delete(e.resolvedPath);if(!n){U.removeResolutionsOfFile(e.path)}}}}function reportWatchDiagnostic(t){if(e.onWatchStatusChange){e.onWatchStatusChange(createCompilerDiagnostic(t),w,C||h)}}function hasChangedAutomaticTypeDirectiveNames(){return U.hasChangedAutomaticTypeDirectiveNames()}function clearInvalidateResolutionsOfFailedLookupLocations(){if(!s)return false;e.clearTimeout(s);s=void 0;return true}function scheduleInvalidateResolutionsOfFailedLookupLocations(){if(!e.setTimeout||!e.clearTimeout){return U.invalidateResolutionsOfFailedLookupLocations()}const t=clearInvalidateResolutionsOfFailedLookupLocations();R(`Scheduling invalidateFailedLookup${t?", Cancelled earlier one":""}`);s=e.setTimeout(invalidateResolutionsOfFailedLookup,250,"timerToInvalidateFailedLookupResolutions")}function invalidateResolutionsOfFailedLookup(){s=void 0;if(U.invalidateResolutionsOfFailedLookupLocations()){scheduleProgramUpdate()}}function scheduleProgramUpdate(){if(!e.setTimeout||!e.clearTimeout){return}if(a){e.clearTimeout(a)}R("Scheduling update");a=e.setTimeout(updateProgramWithWatchStatus,250,"timerToUpdateProgram")}function scheduleProgramReload(){S.assert(!!y);n=2;scheduleProgramUpdate()}function updateProgramWithWatchStatus(){a=void 0;p=true;updateProgram()}function updateProgram(){switch(n){case 1:reloadFileNamesFromConfigFile();break;case 2:reloadConfigFile();break;default:synchronizeProgram();break}return getCurrentBuilderProgram()}function reloadFileNamesFromConfigFile(){R("Reloading new file names and options");S.assert(C);S.assert(y);n=0;b=getFileNamesFromConfigSpecs(C.configFile.configFileSpecs,getNormalizedAbsolutePath(getDirectoryPath(y),g),C,O,v);if(updateErrorForNoInputFiles(b,getNormalizedAbsolutePath(y,g),C.configFile.configFileSpecs,F,P)){D=true}synchronizeProgram()}function reloadConfigFile(){S.assert(y);R(`Reloading config file: ${y}`);n=0;if(I){I.clearCache()}parseConfigFile2();m=true;(o??(o=new Map)).set(void 0,void 0);synchronizeProgram()}function parseConfigFile2(){S.assert(y);setConfigFileParsingResult(getParsedCommandLineOfConfigFile(y,h,O,d||(d=new Map),T,v))}function setConfigFileParsingResult(e){b=e.fileNames;C=e.options;E=e.watchOptions;N=e.projectReferences;k=e.wildcardDirectories;F=getConfigFileParsingDiagnostics(e).slice();P=canJsonReportNoInputFiles(e.raw);D=true}function getParsedCommandLine(t){const n=toPath3(t);let r=c==null?void 0:c.get(n);if(r){if(!r.updateLevel)return r.parsedCommandLine;if(r.parsedCommandLine&&r.updateLevel===1&&!e.getParsedCommandLine){R("Reloading new file names and options");S.assert(C);const e=getFileNamesFromConfigSpecs(r.parsedCommandLine.options.configFile.configFileSpecs,getNormalizedAbsolutePath(getDirectoryPath(t),g),C,O);r.parsedCommandLine={...r.parsedCommandLine,fileNames:e};r.updateLevel=void 0;return r.parsedCommandLine}}R(`Loading config file: ${t}`);const i=e.getParsedCommandLine?e.getParsedCommandLine(t):getParsedCommandLineFromConfigFileHost(t);if(r){r.parsedCommandLine=i;r.updateLevel=void 0}else{(c||(c=new Map)).set(n,r={parsedCommandLine:i})}(o??(o=new Map)).set(n,t);return i}function getParsedCommandLineFromConfigFileHost(e){const t=O.onUnRecoverableConfigFileDiagnostic;O.onUnRecoverableConfigFileDiagnostic=noop;const n=getParsedCommandLineOfConfigFile(e,void 0,O,d||(d=new Map),T);O.onUnRecoverableConfigFileDiagnostic=t;return n}function onReleaseParsedCommandLine(e){var t;const n=toPath3(e);const r=c==null?void 0:c.get(n);if(!r)return;c.delete(n);if(r.watchedDirectories)clearMap(r.watchedDirectories,closeFileWatcherOf);(t=r.watcher)==null?void 0:t.close();clearSharedExtendedConfigFileWatcher(n,l)}function watchFilePath(e,t,n,r,i,o){return L(t,((t,r)=>n(t,r,e)),r,i,o)}function onSourceFileChange(e,t,n){updateCachedSystemWithFile(e,n,t);if(t===2&&u.has(n)){U.invalidateResolutionOfFile(n)}nextSourceFileVersion(n);scheduleProgramUpdate()}function updateCachedSystemWithFile(e,t,n){if(I){I.addOrDeleteFile(e,t,n)}}function watchMissingFilePath(e,t){return(c==null?void 0:c.has(e))?ts:watchFilePath(e,t,onMissingFileChange,500,E,ns.MissingFile)}function onMissingFileChange(e,t,n){updateCachedSystemWithFile(e,n,t);if(t===0&&r.has(n)){r.get(n).close();r.delete(n);nextSourceFileVersion(n);scheduleProgramUpdate()}}function watchConfigFileWildCardDirectories(){updateWatchingWildcardDirectories(i||(i=new Map),k,watchWildcardDirectory)}function watchWildcardDirectory(e,t){return M(e,(t=>{S.assert(y);S.assert(C);const r=toPath3(t);if(I){I.addOrDeleteFileOrDirectory(t,r)}nextSourceFileVersion(r);if(isIgnoredFileFromWildCardWatching({watchedDirPath:toPath3(e),fileOrDirectory:t,fileOrDirectoryPath:r,configFileName:y,extraFileExtensions:v,options:C,program:getCurrentBuilderProgram()||b,currentDirectory:g,useCaseSensitiveFileNames:_,writeLog:R,toPath:toPath3}))return;if(n!==2){n=1;scheduleProgramUpdate()}}),t,E,ns.WildcardDirectory)}function updateExtendedConfigFilesWatches(e,t,r,i){updateSharedExtendedConfigFileWatcher(e,t,l||(l=new Map),((e,t)=>L(e,((r,i)=>{var o;updateCachedSystemWithFile(e,t,i);if(d)cleanExtendedConfigCache(d,t,toPath3);const a=(o=l.get(t))==null?void 0:o.projects;if(!(a==null?void 0:a.size))return;a.forEach((e=>{if(y&&toPath3(y)===e){n=2}else{const t=c==null?void 0:c.get(e);if(t)t.updateLevel=2;U.removeResolutionsFromProjectReferenceRedirects(e)}scheduleProgramUpdate()}))}),2e3,r,i)),toPath3)}function watchReferencedProject(e,t,n){var r,i,o,a;n.watcher||(n.watcher=L(e,((n,r)=>{updateCachedSystemWithFile(e,t,r);const i=c==null?void 0:c.get(t);if(i)i.updateLevel=2;U.removeResolutionsFromProjectReferenceRedirects(t);scheduleProgramUpdate()}),2e3,((r=n.parsedCommandLine)==null?void 0:r.watchOptions)||E,ns.ConfigFileOfReferencedProject));updateWatchingWildcardDirectories(n.watchedDirectories||(n.watchedDirectories=new Map),(i=n.parsedCommandLine)==null?void 0:i.wildcardDirectories,((r,i)=>{var o;return M(r,(n=>{const i=toPath3(n);if(I){I.addOrDeleteFileOrDirectory(n,i)}nextSourceFileVersion(i);const o=c==null?void 0:c.get(t);if(!(o==null?void 0:o.parsedCommandLine))return;if(isIgnoredFileFromWildCardWatching({watchedDirPath:toPath3(r),fileOrDirectory:n,fileOrDirectoryPath:i,configFileName:e,options:o.parsedCommandLine.options,program:o.parsedCommandLine.fileNames,currentDirectory:g,useCaseSensitiveFileNames:_,writeLog:R,toPath:toPath3}))return;if(o.updateLevel!==2){o.updateLevel=1;scheduleProgramUpdate()}}),i,((o=n.parsedCommandLine)==null?void 0:o.watchOptions)||E,ns.WildcardDirectoryOfReferencedProject)}));updateExtendedConfigFilesWatches(t,(o=n.parsedCommandLine)==null?void 0:o.options,((a=n.parsedCommandLine)==null?void 0:a.watchOptions)||E,ns.ExtendedConfigOfReferencedProject)}}var rs=(e=>{e[e["Unbuildable"]=0]="Unbuildable";e[e["UpToDate"]=1]="UpToDate";e[e["UpToDateWithUpstreamTypes"]=2]="UpToDateWithUpstreamTypes";e[e["OutputMissing"]=3]="OutputMissing";e[e["ErrorReadingFile"]=4]="ErrorReadingFile";e[e["OutOfDateWithSelf"]=5]="OutOfDateWithSelf";e[e["OutOfDateWithUpstream"]=6]="OutOfDateWithUpstream";e[e["OutOfDateBuildInfoWithPendingEmit"]=7]="OutOfDateBuildInfoWithPendingEmit";e[e["OutOfDateBuildInfoWithErrors"]=8]="OutOfDateBuildInfoWithErrors";e[e["OutOfDateOptions"]=9]="OutOfDateOptions";e[e["OutOfDateRoots"]=10]="OutOfDateRoots";e[e["UpstreamOutOfDate"]=11]="UpstreamOutOfDate";e[e["UpstreamBlocked"]=12]="UpstreamBlocked";e[e["ComputingUpstream"]=13]="ComputingUpstream";e[e["TsVersionOutputOfDate"]=14]="TsVersionOutputOfDate";e[e["UpToDateWithInputFileText"]=15]="UpToDateWithInputFileText";e[e["ContainerOnly"]=16]="ContainerOnly";e[e["ForceBuild"]=17]="ForceBuild";return e})(rs||{});function resolveConfigFileProjectName(e){if(fileExtensionIs(e,".json")){return e}return combinePaths(e,"tsconfig.json")}var is=new Date(-864e13);function getOrCreateValueFromConfigFileMap(e,t,n){const r=e.get(t);let i;if(!r){i=n();e.set(t,i)}return r||i}function getOrCreateValueMapFromConfigFileMap(e,t){return getOrCreateValueFromConfigFileMap(e,t,(()=>new Map))}function getCurrentTime(e){return e.now?e.now():new Date}function isCircularBuildOrder(e){return!!e&&!!e.buildOrder}function getBuildOrderFromAnyBuildOrder(e){return isCircularBuildOrder(e)?e.buildOrder:e}function createBuilderStatusReporter(e,t){return n=>{let r=t?`[${formatColorAndReset(getLocaleTimeString(e),"")}] `:`${getLocaleTimeString(e)} - `;r+=`${flattenDiagnosticMessageText(n.messageText,e.newLine)}${e.newLine+e.newLine}`;e.write(r)}}function createSolutionBuilderHostBase(e,t,n,r){const i=createProgramHost(e,t);i.getModifiedTime=e.getModifiedTime?t=>e.getModifiedTime(t):returnUndefined;i.setModifiedTime=e.setModifiedTime?(t,n)=>e.setModifiedTime(t,n):noop;i.deleteFile=e.deleteFile?t=>e.deleteFile(t):noop;i.reportDiagnostic=n||createDiagnosticReporter(e);i.reportSolutionBuilderStatus=r||createBuilderStatusReporter(e);i.now=maybeBind(e,e.now);return i}function createSolutionBuilderHost(e=Ft,t,n,r,i){const o=createSolutionBuilderHostBase(e,t,n,r);o.reportErrorSummary=i;return o}function createSolutionBuilderWithWatchHost(e=Ft,t,n,r,i){const o=createSolutionBuilderHostBase(e,t,n,r);const a=createWatchHost(e,i);copyProperties(o,a);return o}function getCompilerOptionsOfBuildOptions(e){const t={};Qi.forEach((n=>{if(hasProperty(e,n.name))t[n.name]=e[n.name]}));t.tscBuild=true;return t}function createSolutionBuilder(e,t,n){return createSolutionBuilderWorker(false,e,t,n)}function createSolutionBuilderWithWatch(e,t,n,r){return createSolutionBuilderWorker(true,e,t,n,r)}function createSolutionBuilderState(e,t,n,r,i){const o=t;const a=t;const s=getCompilerOptionsOfBuildOptions(r);const c=createCompilerHostFromProgramHost(o,(()=>_.projectCompilerOptions));setGetSourceFileAsHashVersioned(c);c.getParsedCommandLine=e=>parseConfigFile(_,e,toResolvedConfigFilePath(_,e));c.resolveModuleNameLiterals=maybeBind(o,o.resolveModuleNameLiterals);c.resolveTypeReferenceDirectiveReferences=maybeBind(o,o.resolveTypeReferenceDirectiveReferences);c.resolveLibrary=maybeBind(o,o.resolveLibrary);c.resolveModuleNames=maybeBind(o,o.resolveModuleNames);c.resolveTypeReferenceDirectives=maybeBind(o,o.resolveTypeReferenceDirectives);c.getModuleResolutionCache=maybeBind(o,o.getModuleResolutionCache);let l,d;if(!c.resolveModuleNameLiterals&&!c.resolveModuleNames){l=createModuleResolutionCache(c.getCurrentDirectory(),c.getCanonicalFileName);c.resolveModuleNameLiterals=(e,t,n,r,i)=>loadWithModeAwareCache(e,t,n,r,i,o,l,createModuleResolutionLoader);c.getModuleResolutionCache=()=>l}if(!c.resolveTypeReferenceDirectiveReferences&&!c.resolveTypeReferenceDirectives){d=createTypeReferenceDirectiveResolutionCache(c.getCurrentDirectory(),c.getCanonicalFileName,void 0,l==null?void 0:l.getPackageJsonInfoCache(),l==null?void 0:l.optionsToRedirectsKey);c.resolveTypeReferenceDirectiveReferences=(e,t,n,r,i)=>loadWithModeAwareCache(e,t,n,r,i,o,d,createTypeReferenceResolutionLoader)}let p;if(!c.resolveLibrary){p=createModuleResolutionCache(c.getCurrentDirectory(),c.getCanonicalFileName,void 0,l==null?void 0:l.getPackageJsonInfoCache());c.resolveLibrary=(e,t,n)=>resolveLibrary(e,t,n,o,p)}c.getBuildInfo=(e,t)=>getBuildInfo3(_,e,toResolvedConfigFilePath(_,t),void 0);const{watchFile:u,watchDirectory:f,writeLog:m}=createWatchFactory(a,r);const _={host:o,hostWithWatch:a,parseConfigFileHost:parseConfigHostFromCompilerHostLike(o),write:maybeBind(o,o.trace),options:r,baseCompilerOptions:s,rootNames:n,baseWatchOptions:i,resolvedConfigFilePaths:new Map,configFileCache:new Map,projectStatus:new Map,extendedConfigCache:new Map,buildInfoCache:new Map,outputTimeStamps:new Map,builderPrograms:new Map,diagnostics:new Map,projectPendingBuild:new Map,projectErrorsReported:new Map,compilerHost:c,moduleResolutionCache:l,typeReferenceDirectiveResolutionCache:d,libraryResolutionCache:p,buildOrder:void 0,readFileWithCache:e=>o.readFile(e),projectCompilerOptions:s,cache:void 0,allProjectBuildPending:true,needsSummary:true,watchAllProjectsPending:e,watch:e,allWatchedWildcardDirectories:new Map,allWatchedInputFiles:new Map,allWatchedConfigFiles:new Map,allWatchedExtendedConfigFiles:new Map,allWatchedPackageJsonFiles:new Map,filesWatched:new Map,lastCachedPackageJsonLookups:new Map,timerToBuildInvalidatedProject:void 0,reportFileChangeDetected:false,watchFile:u,watchDirectory:f,writeLog:m};return _}function toPath2(e,t){return toPath(t,e.compilerHost.getCurrentDirectory(),e.compilerHost.getCanonicalFileName)}function toResolvedConfigFilePath(e,t){const{resolvedConfigFilePaths:n}=e;const r=n.get(t);if(r!==void 0)return r;const i=toPath2(e,t);n.set(t,i);return i}function isParsedCommandLine(e){return!!e.options}function getCachedParsedConfigFile(e,t){const n=e.configFileCache.get(t);return n&&isParsedCommandLine(n)?n:void 0}function parseConfigFile(e,t,n){const{configFileCache:r}=e;const i=r.get(n);if(i){return isParsedCommandLine(i)?i:void 0}mark("SolutionBuilder::beforeConfigFileParsing");let o;const{parseConfigFileHost:a,baseCompilerOptions:s,baseWatchOptions:c,extendedConfigCache:l,host:d}=e;let p;if(d.getParsedCommandLine){p=d.getParsedCommandLine(t);if(!p)o=createCompilerDiagnostic(wt.File_0_not_found,t)}else{a.onUnRecoverableConfigFileDiagnostic=e=>o=e;p=getParsedCommandLineOfConfigFile(t,s,a,l,c);a.onUnRecoverableConfigFileDiagnostic=noop}r.set(n,p||o);mark("SolutionBuilder::afterConfigFileParsing");measure("SolutionBuilder::Config file parsing","SolutionBuilder::beforeConfigFileParsing","SolutionBuilder::afterConfigFileParsing");return p}function resolveProjectName(e,t){return resolveConfigFileProjectName(resolvePath(e.compilerHost.getCurrentDirectory(),t))}function createBuildOrder(e,t){const n=new Map;const r=new Map;const i=[];let o;let a;for(const e of t){visit(e)}return a?{buildOrder:o||d,circularDiagnostics:a}:o||d;function visit(t,s){const c=toResolvedConfigFilePath(e,t);if(r.has(c))return;if(n.has(c)){if(!s){(a||(a=[])).push(createCompilerDiagnostic(wt.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0,i.join("\r\n")))}return}n.set(c,true);i.push(t);const l=parseConfigFile(e,t,c);if(l&&l.projectReferences){for(const t of l.projectReferences){const n=resolveProjectName(e,t.path);visit(n,s||t.circular)}}i.pop();r.set(c,true);(o||(o=[])).push(t)}}function getBuildOrder(e){return e.buildOrder||createStateBuildOrder(e)}function createStateBuildOrder(e){const t=createBuildOrder(e,e.rootNames.map((t=>resolveProjectName(e,t))));e.resolvedConfigFilePaths.clear();const n=new Set(getBuildOrderFromAnyBuildOrder(t).map((t=>toResolvedConfigFilePath(e,t))));const r={onDeleteValue:noop};mutateMapSkippingNewValues(e.configFileCache,n,r);mutateMapSkippingNewValues(e.projectStatus,n,r);mutateMapSkippingNewValues(e.builderPrograms,n,r);mutateMapSkippingNewValues(e.diagnostics,n,r);mutateMapSkippingNewValues(e.projectPendingBuild,n,r);mutateMapSkippingNewValues(e.projectErrorsReported,n,r);mutateMapSkippingNewValues(e.buildInfoCache,n,r);mutateMapSkippingNewValues(e.outputTimeStamps,n,r);mutateMapSkippingNewValues(e.lastCachedPackageJsonLookups,n,r);if(e.watch){mutateMapSkippingNewValues(e.allWatchedConfigFiles,n,{onDeleteValue:closeFileWatcher});e.allWatchedExtendedConfigFiles.forEach((e=>{e.projects.forEach((t=>{if(!n.has(t)){e.projects.delete(t)}}));e.close()}));mutateMapSkippingNewValues(e.allWatchedWildcardDirectories,n,{onDeleteValue:e=>e.forEach(closeFileWatcherOf)});mutateMapSkippingNewValues(e.allWatchedInputFiles,n,{onDeleteValue:e=>e.forEach(closeFileWatcher)});mutateMapSkippingNewValues(e.allWatchedPackageJsonFiles,n,{onDeleteValue:e=>e.forEach(closeFileWatcher)})}return e.buildOrder=t}function getBuildOrderFor(e,t,n){const r=t&&resolveProjectName(e,t);const i=getBuildOrder(e);if(isCircularBuildOrder(i))return i;if(r){const t=toResolvedConfigFilePath(e,r);const n=findIndex(i,(n=>toResolvedConfigFilePath(e,n)===t));if(n===-1)return void 0}const o=r?createBuildOrder(e,[r]):i;S.assert(!isCircularBuildOrder(o));S.assert(!n||r!==void 0);S.assert(!n||o[o.length-1]===r);return n?o.slice(0,o.length-1):o}function enableCache(e){if(e.cache){disableCache(e)}const{compilerHost:t,host:n}=e;const r=e.readFileWithCache;const i=t.getSourceFile;const{originalReadFile:o,originalFileExists:a,originalDirectoryExists:s,originalCreateDirectory:c,originalWriteFile:l,getSourceFileWithCache:d,readFileWithCache:p}=changeCompilerHostLikeToUseCache(n,(t=>toPath2(e,t)),((...e)=>i.call(t,...e)));e.readFileWithCache=p;t.getSourceFile=d;e.cache={originalReadFile:o,originalFileExists:a,originalDirectoryExists:s,originalCreateDirectory:c,originalWriteFile:l,originalReadFileWithCache:r,originalGetSourceFile:i}}function disableCache(e){if(!e.cache)return;const{cache:t,host:n,compilerHost:r,extendedConfigCache:i,moduleResolutionCache:o,typeReferenceDirectiveResolutionCache:a,libraryResolutionCache:s}=e;n.readFile=t.originalReadFile;n.fileExists=t.originalFileExists;n.directoryExists=t.originalDirectoryExists;n.createDirectory=t.originalCreateDirectory;n.writeFile=t.originalWriteFile;r.getSourceFile=t.originalGetSourceFile;e.readFileWithCache=t.originalReadFileWithCache;i.clear();o==null?void 0:o.clear();a==null?void 0:a.clear();s==null?void 0:s.clear();e.cache=void 0}function clearProjectStatus(e,t){e.projectStatus.delete(t);e.diagnostics.delete(t)}function addProjToQueue({projectPendingBuild:e},t,n){const r=e.get(t);if(r===void 0){e.set(t,n)}else if(re.projectPendingBuild.set(toResolvedConfigFilePath(e,t),0)));if(t){t.throwIfCancellationRequested()}}var os=(e=>{e[e["Build"]=0]="Build";e[e["UpdateOutputFileStamps"]=1]="UpdateOutputFileStamps";return e})(os||{});function doneInvalidatedProject(e,t){e.projectPendingBuild.delete(t);return e.diagnostics.has(t)?1:0}function createUpdateOutputFileStampsProject(e,t,n,r,i){let o=true;return{kind:1,project:t,projectPath:n,buildOrder:i,getCompilerOptions:()=>r.options,getCurrentDirectory:()=>e.compilerHost.getCurrentDirectory(),updateOutputFileStatmps:()=>{updateOutputTimestamps(e,r,n);o=false},done:()=>{if(o){updateOutputTimestamps(e,r,n)}mark("SolutionBuilder::Timestamps only updates");return doneInvalidatedProject(e,n)}}}function createBuildOrUpdateInvalidedProject(e,t,n,r,i,o,a){let s=0;let c;let l;return{kind:0,project:t,projectPath:n,buildOrder:a,getCompilerOptions:()=>i.options,getCurrentDirectory:()=>e.compilerHost.getCurrentDirectory(),getBuilderProgram:()=>withProgramOrUndefined(identity),getProgram:()=>withProgramOrUndefined((e=>e.getProgramOrUndefined())),getSourceFile:e=>withProgramOrUndefined((t=>t.getSourceFile(e))),getSourceFiles:()=>withProgramOrEmptyArray((e=>e.getSourceFiles())),getOptionsDiagnostics:e=>withProgramOrEmptyArray((t=>t.getOptionsDiagnostics(e))),getGlobalDiagnostics:e=>withProgramOrEmptyArray((t=>t.getGlobalDiagnostics(e))),getConfigFileParsingDiagnostics:()=>withProgramOrEmptyArray((e=>e.getConfigFileParsingDiagnostics())),getSyntacticDiagnostics:(e,t)=>withProgramOrEmptyArray((n=>n.getSyntacticDiagnostics(e,t))),getAllDependencies:e=>withProgramOrEmptyArray((t=>t.getAllDependencies(e))),getSemanticDiagnostics:(e,t)=>withProgramOrEmptyArray((n=>n.getSemanticDiagnostics(e,t))),getSemanticDiagnosticsOfNextAffectedFile:(e,t)=>withProgramOrUndefined((n=>n.getSemanticDiagnosticsOfNextAffectedFile&&n.getSemanticDiagnosticsOfNextAffectedFile(e,t))),emit:(n,r,i,o,a)=>{if(n||o){return withProgramOrUndefined((s=>{var c,l;return s.emit(n,r,i,o,a||((l=(c=e.host).getCustomTransformers)==null?void 0:l.call(c,t)))}))}executeSteps(0,i);return emit(r,i,a)},done:done};function done(t,r,i){executeSteps(3,t,r,i);mark("SolutionBuilder::Projects built");return doneInvalidatedProject(e,n)}function withProgramOrUndefined(e){executeSteps(0);return c&&e(c)}function withProgramOrEmptyArray(e){return withProgramOrUndefined(e)||d}function createProgram2(){var r,o,a;S.assert(c===void 0);if(e.options.dry){reportStatus(e,wt.A_non_dry_build_would_build_project_0,t);l=1;s=2;return}if(e.options.verbose)reportStatus(e,wt.Building_project_0,t);if(i.fileNames.length===0){reportAndStoreErrors(e,n,getConfigFileParsingDiagnostics(i));l=0;s=2;return}const{host:d,compilerHost:p}=e;e.projectCompilerOptions=i.options;(r=e.moduleResolutionCache)==null?void 0:r.update(i.options);(o=e.typeReferenceDirectiveResolutionCache)==null?void 0:o.update(i.options);c=d.createProgram(i.fileNames,i.options,p,getOldProgram(e,n,i),getConfigFileParsingDiagnostics(i),i.projectReferences);if(e.watch){const t=(a=e.moduleResolutionCache)==null?void 0:a.getPackageJsonInfoCache().getInternalMap();e.lastCachedPackageJsonLookups.set(n,t&&new Set(arrayFrom(t.values(),(t=>e.host.realpath&&(isPackageJsonInfo(t)||t.directoryExists)?e.host.realpath(combinePaths(t.packageDirectory,"package.json")):combinePaths(t.packageDirectory,"package.json")))));e.builderPrograms.set(n,c)}s++}function emit(r,a,d){var p,u,f;S.assertIsDefined(c);S.assert(s===1);const{host:m,compilerHost:_}=e;const g=new Map;const y=c.getCompilerOptions();const h=tr(y);let T;let v;const{emitResult:x,diagnostics:b}=emitFilesAndReportErrors(c,(e=>m.reportDiagnostic(e)),e.write,void 0,((t,i,o,a,s,l)=>{var d;const p=toPath2(e,t);g.set(toPath2(e,t),t);if(l==null?void 0:l.buildInfo){v||(v=getCurrentTime(e.host));const r=(d=c.hasChangedEmitSignature)==null?void 0:d.call(c);const i=getBuildInfoCacheEntry(e,t,n);if(i){i.buildInfo=l.buildInfo;i.modifiedTime=v;if(r)i.latestChangedDtsTime=v}else{e.buildInfoCache.set(n,{path:toPath2(e,t),buildInfo:l.buildInfo,modifiedTime:v,latestChangedDtsTime:r?v:void 0})}}const u=(l==null?void 0:l.differsOnlyInMap)?getModifiedTime(e.host,t):void 0;(r||_.writeFile)(t,i,o,a,s,l);if(l==null?void 0:l.differsOnlyInMap)e.host.setModifiedTime(t,u);else if(!h&&e.watch){(T||(T=getOutputTimeStampMap(e,n))).set(p,v||(v=getCurrentTime(e.host)))}}),a,void 0,d||((u=(p=e.host).getCustomTransformers)==null?void 0:u.call(p,t)));if((!y.noEmitOnError||!b.length)&&(g.size||o.type!==8)){updateOutputTimestampsWorker(e,i,n,wt.Updating_unchanged_output_timestamps_of_project_0,g)}e.projectErrorsReported.set(n,true);l=((f=c.hasChangedEmitSignature)==null?void 0:f.call(c))?0:2;if(!b.length){e.diagnostics.delete(n);e.projectStatus.set(n,{type:1,oldestOutputFileName:firstOrUndefinedIterator(g.values())??getFirstProjectOutput(i,!m.useCaseSensitiveFileNames())})}else{e.diagnostics.set(n,b);e.projectStatus.set(n,{type:0,reason:`it had errors`});l|=4}afterProgramDone(e,c);s=2;return x}function executeSteps(o,c,d,p){while(s<=o&&s<3){const o=s;switch(s){case 0:createProgram2();break;case 1:emit(d,c,p);break;case 2:queueReferencingProjects(e,t,n,r,i,a,S.checkDefined(l));s++;break;case 3:default:assertType(s)}S.assert(s>o)}}}function getNextInvalidatedProjectCreateInfo(e,t,n){if(!e.projectPendingBuild.size)return void 0;if(isCircularBuildOrder(t))return void 0;const{options:r,projectPendingBuild:i}=e;for(let o=0;o{const i=S.checkDefined(e.filesWatched.get(s));S.assert(isFileWatcherWithModifiedTime(i));i.modifiedTime=r;i.callbacks.forEach((e=>e(t,n,r)))}),r,i,o,a);e.filesWatched.set(s,{callbacks:[n],watcher:l,modifiedTime:c})}return{close:()=>{const t=S.checkDefined(e.filesWatched.get(s));S.assert(isFileWatcherWithModifiedTime(t));if(t.callbacks.length===1){e.filesWatched.delete(s);closeFileWatcherOf(t)}else{unorderedRemoveItem(t.callbacks,n)}}}}function getOutputTimeStampMap(e,t){if(!e.watch)return void 0;let n=e.outputTimeStamps.get(t);if(!n)e.outputTimeStamps.set(t,n=new Map);return n}function getBuildInfoCacheEntry(e,t,n){const r=toPath2(e,t);const i=e.buildInfoCache.get(n);return(i==null?void 0:i.path)===r?i:void 0}function getBuildInfo3(e,t,n,r){const i=toPath2(e,t);const o=e.buildInfoCache.get(n);if(o!==void 0&&o.path===i){return o.buildInfo||void 0}const a=e.readFileWithCache(t);const s=a?getBuildInfo(t,a):void 0;e.buildInfoCache.set(n,{path:i,buildInfo:s||false,modifiedTime:r||vt});return s}function checkConfigFileUpToDateStatus(e,t,n,r){const i=getModifiedTime2(e,t);if(nb){x=n;b=t}E.add(r)}let k;if(h){if(!N)N=getBuildInfoFileVersionMap(h,f,u);k=forEachEntry(N.roots,((e,t)=>!E.has(t)?t:void 0))}else{k=forEach(getNonIncrementalBuildInfoRoots(y,f,u),(e=>!E.has(e)?e:void 0))}if(k){return{type:10,buildInfoFile:f,inputFile:k}}if(!m){const r=getAllProjectOutputs(t,!u.useCaseSensitiveFileNames());const i=getOutputTimeStampMap(e,n);for(const t of r){if(t===f)continue;const n=toPath2(e,t);let r=i==null?void 0:i.get(n);if(!r){r=getModifiedTime(e.host,t);i==null?void 0:i.set(n,r)}if(r===vt){return{type:3,missingOutputFileName:t}}if(rcheckConfigFileUpToDateStatus(e,t,T,v)));if(D)return D;const I=e.lastCachedPackageJsonLookups.get(n);const A=I&&forEachKey(I,(t=>checkConfigFileUpToDateStatus(e,t,T,v)));if(A)return A;return{type:F?2:C?15:1,newestInputFileTime:b,newestInputFileName:x,oldestOutputFileName:v}}function hasSameBuildInfo(e,t,n){const r=e.buildInfoCache.get(n);return r.path===t.path}function getUpToDateStatus(e,t,n){if(t===void 0){return{type:0,reason:"config file deleted mid-build"}}const r=e.projectStatus.get(n);if(r!==void 0){return r}mark("SolutionBuilder::beforeUpToDateCheck");const i=getUpToDateStatusWorker(e,t,n);mark("SolutionBuilder::afterUpToDateCheck");measure("SolutionBuilder::Up-to-date check","SolutionBuilder::beforeUpToDateCheck","SolutionBuilder::afterUpToDateCheck");e.projectStatus.set(n,i);return i}function updateOutputTimestampsWorker(e,t,n,r,i){if(t.options.noEmit)return;let o;const a=getTsBuildInfoEmitOutputFilePath(t.options);const s=tr(t.options);if(a&&s){if(!(i==null?void 0:i.has(toPath2(e,a)))){if(!!e.options.verbose)reportStatus(e,r,t.options.configFilePath);e.host.setModifiedTime(a,o=getCurrentTime(e.host));getBuildInfoCacheEntry(e,a,n).modifiedTime=o}e.outputTimeStamps.delete(n);return}const{host:c}=e;const l=getAllProjectOutputs(t,!c.useCaseSensitiveFileNames());const d=getOutputTimeStampMap(e,n);const p=d?new Set:void 0;if(!i||l.length!==i.size){let s=!!e.options.verbose;for(const u of l){const l=toPath2(e,u);if(i==null?void 0:i.has(l))continue;if(s){s=false;reportStatus(e,r,t.options.configFilePath)}c.setModifiedTime(u,o||(o=getCurrentTime(e.host)));if(u===a)getBuildInfoCacheEntry(e,a,n).modifiedTime=o;else if(d){d.set(l,o);p.add(l)}}}d==null?void 0:d.forEach(((e,t)=>{if(!(i==null?void 0:i.has(t))&&!p.has(t))d.delete(t)}))}function getLatestChangedDtsTime(e,t,n){if(!t.composite)return void 0;const r=S.checkDefined(e.buildInfoCache.get(n));if(r.latestChangedDtsTime!==void 0)return r.latestChangedDtsTime||void 0;const i=r.buildInfo&&isIncrementalBuildInfo(r.buildInfo)&&r.buildInfo.latestChangedDtsFile?e.host.getModifiedTime(getNormalizedAbsolutePath(r.buildInfo.latestChangedDtsFile,getDirectoryPath(r.path))):void 0;r.latestChangedDtsTime=i||false;return i}function updateOutputTimestamps(e,t,n){if(e.options.dry){return reportStatus(e,wt.A_non_dry_build_would_update_timestamps_for_output_of_project_0,t.options.configFilePath)}updateOutputTimestampsWorker(e,t,n,wt.Updating_output_timestamps_of_project_0);e.projectStatus.set(n,{type:1,oldestOutputFileName:getFirstProjectOutput(t,!e.host.useCaseSensitiveFileNames())})}function queueReferencingProjects(e,t,n,r,i,o,a){if(e.options.stopBuildOnErrors&&a&4)return;if(!i.options.composite)return;for(let i=r+1;ie.diagnostics.has(toResolvedConfigFilePath(e,t))))?0:c?2:1}function clean(e,t,n){mark("SolutionBuilder::beforeClean");const r=cleanWorker(e,t,n);mark("SolutionBuilder::afterClean");measure("SolutionBuilder::Clean","SolutionBuilder::beforeClean","SolutionBuilder::afterClean");return r}function cleanWorker(e,t,n){const r=getBuildOrderFor(e,t,n);if(!r)return 3;if(isCircularBuildOrder(r)){reportErrors(e,r.circularDiagnostics);return 4}const{options:i,host:o}=e;const a=i.dry?[]:void 0;for(const t of r){const n=toResolvedConfigFilePath(e,t);const r=parseConfigFile(e,t,n);if(r===void 0){reportParseConfigFileDiagnostic(e,n);continue}const i=getAllProjectOutputs(r,!o.useCaseSensitiveFileNames());if(!i.length)continue;const s=new Set(r.fileNames.map((t=>toPath2(e,t))));for(const t of i){if(s.has(toPath2(e,t)))continue;if(o.fileExists(t)){if(a){a.push(t)}else{o.deleteFile(t);invalidateProject(e,n,0)}}}}if(a){reportStatus(e,wt.A_non_dry_build_would_delete_the_following_files_Colon_0,a.map((e=>`\r\n * ${e}`)).join(""))}return 0}function invalidateProject(e,t,n){if(e.host.getParsedCommandLine&&n===1){n=2}if(n===2){e.configFileCache.delete(t);e.buildOrder=void 0}e.needsSummary=true;clearProjectStatus(e,t);addProjToQueue(e,t,n);enableCache(e)}function invalidateProjectAndScheduleBuilds(e,t,n){e.reportFileChangeDetected=true;invalidateProject(e,t,n);scheduleBuildInvalidatedProject(e,250,true)}function scheduleBuildInvalidatedProject(e,t,n){const{hostWithWatch:r}=e;if(!r.setTimeout||!r.clearTimeout){return}if(e.timerToBuildInvalidatedProject){r.clearTimeout(e.timerToBuildInvalidatedProject)}e.timerToBuildInvalidatedProject=r.setTimeout(buildNextInvalidatedProject,t,"timerToBuildInvalidatedProject",e,n)}function buildNextInvalidatedProject(e,t,n){mark("SolutionBuilder::beforeBuild");const r=buildNextInvalidatedProjectWorker(t,n);mark("SolutionBuilder::afterBuild");measure("SolutionBuilder::Build","SolutionBuilder::beforeBuild","SolutionBuilder::afterBuild");if(r)reportErrorSummary(t,r)}function buildNextInvalidatedProjectWorker(e,t){e.timerToBuildInvalidatedProject=void 0;if(e.reportFileChangeDetected){e.reportFileChangeDetected=false;e.projectErrorsReported.clear();reportWatchStatus(e,wt.File_change_detected_Starting_incremental_compilation)}let n=0;const r=getBuildOrder(e);const i=getNextInvalidatedProject(e,r,false);if(i){i.done();n++;while(e.projectPendingBuild.size){if(e.timerToBuildInvalidatedProject)return;const i=getNextInvalidatedProjectCreateInfo(e,r,false);if(!i)break;if(i.kind!==1&&(t||n===5)){scheduleBuildInvalidatedProject(e,100,false);return}const o=createInvalidatedProjectWithInfo(e,i,r);o.done();if(i.kind!==1)n++}}disableCache(e);return r}function watchConfigFile(e,t,n,r){if(!e.watch||e.allWatchedConfigFiles.has(n))return;e.allWatchedConfigFiles.set(n,watchFile(e,t,(()=>invalidateProjectAndScheduleBuilds(e,n,2)),2e3,r==null?void 0:r.watchOptions,ns.ConfigFile,t))}function watchExtendedConfigFiles(e,t,n){updateSharedExtendedConfigFileWatcher(t,n==null?void 0:n.options,e.allWatchedExtendedConfigFiles,((t,r)=>watchFile(e,t,(()=>{var t;return(t=e.allWatchedExtendedConfigFiles.get(r))==null?void 0:t.projects.forEach((t=>invalidateProjectAndScheduleBuilds(e,t,2)))}),2e3,n==null?void 0:n.watchOptions,ns.ExtendedConfigFile)),(t=>toPath2(e,t)))}function watchWildCardDirectories(e,t,n,r){if(!e.watch)return;updateWatchingWildcardDirectories(getOrCreateValueMapFromConfigFileMap(e.allWatchedWildcardDirectories,n),r.wildcardDirectories,((i,o)=>e.watchDirectory(i,(o=>{var a;if(isIgnoredFileFromWildCardWatching({watchedDirPath:toPath2(e,i),fileOrDirectory:o,fileOrDirectoryPath:toPath2(e,o),configFileName:t,currentDirectory:e.compilerHost.getCurrentDirectory(),options:r.options,program:e.builderPrograms.get(n)||((a=getCachedParsedConfigFile(e,n))==null?void 0:a.fileNames),useCaseSensitiveFileNames:e.parseConfigFileHost.useCaseSensitiveFileNames,writeLog:t=>e.writeLog(t),toPath:t=>toPath2(e,t)}))return;invalidateProjectAndScheduleBuilds(e,n,1)}),o,r==null?void 0:r.watchOptions,ns.WildcardDirectory,t)))}function watchInputFiles(e,t,n,r){if(!e.watch)return;mutateMap(getOrCreateValueMapFromConfigFileMap(e.allWatchedInputFiles,n),new Set(r.fileNames),{createNewValue:i=>watchFile(e,i,(()=>invalidateProjectAndScheduleBuilds(e,n,0)),250,r==null?void 0:r.watchOptions,ns.SourceFile,t),onDeleteValue:closeFileWatcher})}function watchPackageJsonFiles(e,t,n,r){if(!e.watch||!e.lastCachedPackageJsonLookups)return;mutateMap(getOrCreateValueMapFromConfigFileMap(e.allWatchedPackageJsonFiles,n),e.lastCachedPackageJsonLookups.get(n),{createNewValue:i=>watchFile(e,i,(()=>invalidateProjectAndScheduleBuilds(e,n,0)),2e3,r==null?void 0:r.watchOptions,ns.PackageJson,t),onDeleteValue:closeFileWatcher})}function startWatching(e,t){if(!e.watchAllProjectsPending)return;mark("SolutionBuilder::beforeWatcherCreation");e.watchAllProjectsPending=false;for(const n of getBuildOrderFromAnyBuildOrder(t)){const t=toResolvedConfigFilePath(e,n);const r=parseConfigFile(e,n,t);watchConfigFile(e,n,t,r);watchExtendedConfigFiles(e,t,r);if(r){watchWildCardDirectories(e,n,t,r);watchInputFiles(e,n,t,r);watchPackageJsonFiles(e,n,t,r)}}mark("SolutionBuilder::afterWatcherCreation");measure("SolutionBuilder::Watcher creation","SolutionBuilder::beforeWatcherCreation","SolutionBuilder::afterWatcherCreation")}function stopWatching(e){clearMap(e.allWatchedConfigFiles,closeFileWatcher);clearMap(e.allWatchedExtendedConfigFiles,closeFileWatcherOf);clearMap(e.allWatchedWildcardDirectories,(e=>clearMap(e,closeFileWatcherOf)));clearMap(e.allWatchedInputFiles,(e=>clearMap(e,closeFileWatcher)));clearMap(e.allWatchedPackageJsonFiles,(e=>clearMap(e,closeFileWatcher)))}function createSolutionBuilderWorker(e,t,n,r,i){const o=createSolutionBuilderState(e,t,n,r,i);return{build:(e,t,n,r)=>build(o,e,t,n,r),clean:e=>clean(o,e),buildReferences:(e,t,n,r)=>build(o,e,t,n,r,true),cleanReferences:e=>clean(o,e,true),getNextInvalidatedProject:e=>{setupInitialBuild(o,e);return getNextInvalidatedProject(o,getBuildOrder(o),false)},getBuildOrder:()=>getBuildOrder(o),getUpToDateStatusOfProject:e=>{const t=resolveProjectName(o,e);const n=toResolvedConfigFilePath(o,t);return getUpToDateStatus(o,parseConfigFile(o,t,n),n)},invalidateProject:(e,t)=>invalidateProject(o,e,t||0),close:()=>stopWatching(o)}}function relName(e,t){return convertToRelativePath(t,e.compilerHost.getCurrentDirectory(),e.compilerHost.getCanonicalFileName)}function reportStatus(e,t,...n){e.host.reportSolutionBuilderStatus(createCompilerDiagnostic(t,...n))}function reportWatchStatus(e,t,...n){var r,i;(i=(r=e.hostWithWatch).onWatchStatusChange)==null?void 0:i.call(r,createCompilerDiagnostic(t,...n),e.host.getNewLine(),e.baseCompilerOptions)}function reportErrors({host:e},t){t.forEach((t=>e.reportDiagnostic(t)))}function reportAndStoreErrors(e,t,n){reportErrors(e,n);e.projectErrorsReported.set(t,true);if(n.length){e.diagnostics.set(t,n)}}function reportParseConfigFileDiagnostic(e,t){reportAndStoreErrors(e,t,[e.configFileCache.get(t)])}function reportErrorSummary(e,t){if(!e.needsSummary)return;e.needsSummary=false;const n=e.watch||!!e.host.reportErrorSummary;const{diagnostics:r}=e;let i=0;let o=[];if(isCircularBuildOrder(t)){reportBuildQueue(e,t.buildOrder);reportErrors(e,t.circularDiagnostics);if(n)i+=getErrorCountForSummary(t.circularDiagnostics);if(n)o=[...o,...getFilesInErrorForSummary(t.circularDiagnostics)]}else{t.forEach((t=>{const n=toResolvedConfigFilePath(e,t);if(!e.projectErrorsReported.has(n)){reportErrors(e,r.get(n)||d)}}));if(n)r.forEach((e=>i+=getErrorCountForSummary(e)));if(n)r.forEach((e=>[...o,...getFilesInErrorForSummary(e)]))}if(e.watch){reportWatchStatus(e,getWatchErrorSummaryDiagnosticMessage(i),i)}else if(e.host.reportErrorSummary){e.host.reportErrorSummary(i,o)}}function reportBuildQueue(e,t){if(e.options.verbose){reportStatus(e,wt.Projects_in_this_build_Colon_0,t.map((t=>"\r\n * "+relName(e,t))).join(""))}}function reportUpToDateStatus(e,t,n){switch(n.type){case 5:return reportStatus(e,wt.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,relName(e,t),relName(e,n.outOfDateOutputFileName),relName(e,n.newerInputFileName));case 6:return reportStatus(e,wt.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,relName(e,t),relName(e,n.outOfDateOutputFileName),relName(e,n.newerProjectName));case 3:return reportStatus(e,wt.Project_0_is_out_of_date_because_output_file_1_does_not_exist,relName(e,t),relName(e,n.missingOutputFileName));case 4:return reportStatus(e,wt.Project_0_is_out_of_date_because_there_was_error_reading_file_1,relName(e,t),relName(e,n.fileName));case 7:return reportStatus(e,wt.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted,relName(e,t),relName(e,n.buildInfoFile));case 8:return reportStatus(e,wt.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors,relName(e,t),relName(e,n.buildInfoFile));case 9:return reportStatus(e,wt.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions,relName(e,t),relName(e,n.buildInfoFile));case 10:return reportStatus(e,wt.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more,relName(e,t),relName(e,n.buildInfoFile),relName(e,n.inputFile));case 1:if(n.newestInputFileTime!==void 0){return reportStatus(e,wt.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2,relName(e,t),relName(e,n.newestInputFileName||""),relName(e,n.oldestOutputFileName||""))}break;case 2:return reportStatus(e,wt.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,relName(e,t));case 15:return reportStatus(e,wt.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,relName(e,t));case 11:return reportStatus(e,wt.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,relName(e,t),relName(e,n.upstreamProjectName));case 12:return reportStatus(e,n.upstreamProjectBlocked?wt.Project_0_can_t_be_built_because_its_dependency_1_was_not_built:wt.Project_0_can_t_be_built_because_its_dependency_1_has_errors,relName(e,t),relName(e,n.upstreamProjectName));case 0:return reportStatus(e,wt.Project_0_is_out_of_date_because_1,relName(e,t),n.reason);case 14:return reportStatus(e,wt.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,relName(e,t),n.version,c);case 17:return reportStatus(e,wt.Project_0_is_being_forcibly_rebuilt,relName(e,t));case 16:case 13:break;default:assertType(n)}}function verboseReportProjectStatus(e,t,n){if(e.options.verbose){reportUpToDateStatus(e,t,n)}}var as=(e=>{e[e["time"]=0]="time";e[e["count"]=1]="count";e[e["memory"]=2]="memory";return e})(as||{});function countLines(e){const t=getCountsMap();forEach(e.getSourceFiles(),(n=>{const r=getCountKey(e,n);const i=getLineStarts(n).length;t.set(r,t.get(r)+i)}));return t}function getCountsMap(){const e=new Map;e.set("Library",0);e.set("Definitions",0);e.set("TypeScript",0);e.set("JavaScript",0);e.set("JSON",0);e.set("Other",0);return e}function getCountKey(e,t){if(e.isSourceFileDefaultLibrary(t)){return"Library"}else if(t.isDeclarationFile){return"Definitions"}const n=t.path;if(fileExtensionIsOneOf(n,_r)){return"TypeScript"}else if(fileExtensionIsOneOf(n,Tr)){return"JavaScript"}else if(fileExtensionIs(n,".json")){return"JSON"}else{return"Other"}}function updateReportDiagnostic(e,t,n){return shouldBePretty(e,n)?createDiagnosticReporter(e,true):t}function defaultIsPretty(e){return!!e.writeOutputIsTTY&&e.writeOutputIsTTY()&&!e.getEnvironmentVariable("NO_COLOR")}function shouldBePretty(e,t){if(!t||typeof t.pretty==="undefined"){return defaultIsPretty(e)}return t.pretty}function getOptionsForHelp(e){return!!e.options.all?toSorted(eo.concat(uo),((e,t)=>compareStringsCaseInsensitive(e.name,t.name))):filter(eo.concat(uo),(e=>!!e.showInSimplifiedHelpView))}function printVersion(e){e.write(getDiagnosticText(wt.Version_0,c)+e.newLine)}function createColors(e){const t=defaultIsPretty(e);if(!t){return{bold:e=>e,blue:e=>e,blueBackground:e=>e,brightWhite:e=>e}}function bold(e){return`${e}`}const n=e.getEnvironmentVariable("OS")&&e.getEnvironmentVariable("OS").toLowerCase().includes("windows");const r=e.getEnvironmentVariable("WT_SESSION");const i=e.getEnvironmentVariable("TERM_PROGRAM")&&e.getEnvironmentVariable("TERM_PROGRAM")==="vscode";function blue(e){if(n&&!r&&!i){return brightWhite(e)}return`${e}`}const o=e.getEnvironmentVariable("COLORTERM")==="truecolor"||e.getEnvironmentVariable("TERM")==="xterm-256color";function blueBackground(e){if(o){return`${e}`}else{return`${e}`}}function brightWhite(e){return`${e}`}return{bold:bold,blue:blue,brightWhite:brightWhite,blueBackground:blueBackground}}function getDisplayNameTextOfOption(e){return`--${e.name}${e.shortName?`, -${e.shortName}`:""}`}function generateOptionOutput(e,t,n,r){var i;const o=[];const a=createColors(e);const s=getDisplayNameTextOfOption(t);const c=getValueCandidate(t);const l=typeof t.defaultValueDescription==="object"?getDiagnosticText(t.defaultValueDescription):formatDefaultValue(t.defaultValueDescription,t.type==="list"||t.type==="listOrElement"?t.element.type:t.type);const d=((i=e.getWidthOfTerminal)==null?void 0:i.call(e))??0;if(d>=80){let i="";if(t.description){i=getDiagnosticText(t.description)}o.push(...getPrettyOutput(s,i,n,r,d,true),e.newLine);if(showAdditionalInfoOutput(c,t)){if(c){o.push(...getPrettyOutput(c.valueType,c.possibleValues,n,r,d,false),e.newLine)}if(l){o.push(...getPrettyOutput(getDiagnosticText(wt.default_Colon),l,n,r,d,false),e.newLine)}}o.push(e.newLine)}else{o.push(a.blue(s),e.newLine);if(t.description){const e=getDiagnosticText(t.description);o.push(e)}o.push(e.newLine);if(showAdditionalInfoOutput(c,t)){if(c){o.push(`${c.valueType} ${c.possibleValues}`)}if(l){if(c)o.push(e.newLine);const t=getDiagnosticText(wt.default_Colon);o.push(`${t} ${l}`)}o.push(e.newLine)}o.push(e.newLine)}return o;function formatDefaultValue(e,t){return e!==void 0&&typeof t==="object"?arrayFrom(t.entries()).filter((([,t])=>t===e)).map((([e])=>e)).join("/"):String(e)}function showAdditionalInfoOutput(e,t){const n=["string"];const r=[void 0,"false","n/a"];const i=t.defaultValueDescription;if(t.category===wt.Command_line_Options)return false;if(contains(n,e==null?void 0:e.possibleValues)&&contains(r,i)){return false}return true}function getPrettyOutput(e,t,n,r,i,o){const s=[];let c=true;let l=t;const d=i-r;while(l.length>0){let t="";if(c){t=e.padStart(n);t=t.padEnd(r);t=o?a.blue(t):t}else{t="".padStart(r)}const i=l.substr(0,d);l=l.slice(d);s.push(`${t}${i}`);c=false}return s}function getValueCandidate(e){if(e.type==="object"){return void 0}return{valueType:getValueType(e),possibleValues:getPossibleValues(e)};function getValueType(e){S.assert(e.type!=="listOrElement");switch(e.type){case"string":case"number":case"boolean":return getDiagnosticText(wt.type_Colon);case"list":return getDiagnosticText(wt.one_or_more_Colon);default:return getDiagnosticText(wt.one_of_Colon)}}function getPossibleValues(e){let t;switch(e.type){case"string":case"number":case"boolean":t=e.type;break;case"list":case"listOrElement":t=getPossibleValues(e.element);break;case"object":t="";break;default:const n={};e.type.forEach(((t,r)=>{var i;if(!((i=e.deprecatedKeys)==null?void 0:i.has(r))){(n[t]||(n[t]=[])).push(r)}}));return Object.entries(n).map((([,e])=>e.join("/"))).join(", ")}return t}}}function generateGroupOptionOutput(e,t){let n=0;for(const e of t){const t=getDisplayNameTextOfOption(e).length;n=n>t?n:t}const r=n+2;const i=r+2;let o=[];for(const n of t){const t=generateOptionOutput(e,n,r,i);o=[...o,...t]}if(o[o.length-2]!==e.newLine){o.push(e.newLine)}return o}function generateSectionOptionsOutput(e,t,n,r,i,o){let a=[];a.push(createColors(e).bold(t)+e.newLine+e.newLine);if(i){a.push(i+e.newLine+e.newLine)}if(!r){a=[...a,...generateGroupOptionOutput(e,n)];if(o){a.push(o+e.newLine+e.newLine)}return a}const s=new Map;for(const e of n){if(!e.category){continue}const t=getDiagnosticText(e.category);const n=s.get(t)??[];n.push(e);s.set(t,n)}s.forEach(((t,n)=>{a.push(`### ${n}${e.newLine}${e.newLine}`);a=[...a,...generateGroupOptionOutput(e,t)]}));if(o){a.push(o+e.newLine+e.newLine)}return a}function printEasyHelp(e,t){const n=createColors(e);let r=[...getHeader(e,`${getDiagnosticText(wt.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(wt.Version_0,c)}`)];r.push(n.bold(getDiagnosticText(wt.COMMON_COMMANDS))+e.newLine+e.newLine);example("tsc",wt.Compiles_the_current_project_tsconfig_json_in_the_working_directory);example("tsc app.ts util.ts",wt.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);example("tsc -b",wt.Build_a_composite_project_in_the_working_directory);example("tsc --init",wt.Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory);example("tsc -p ./path/to/tsconfig.json",wt.Compiles_the_TypeScript_project_located_at_the_specified_path);example("tsc --help --all",wt.An_expanded_version_of_this_information_showing_all_possible_compiler_options);example(["tsc --noEmit","tsc --target esnext"],wt.Compiles_the_current_project_with_additional_settings);const i=t.filter((e=>e.isCommandLineOnly||e.category===wt.Command_line_Options));const o=t.filter((e=>!contains(i,e)));r=[...r,...generateSectionOptionsOutput(e,getDiagnosticText(wt.COMMAND_LINE_FLAGS),i,false,void 0,void 0),...generateSectionOptionsOutput(e,getDiagnosticText(wt.COMMON_COMPILER_OPTIONS),o,false,void 0,formatMessage(wt.You_can_learn_about_all_of_the_compiler_options_at_0,"https://aka.ms/tsc"))];for(const t of r){e.write(t)}function example(t,i){const o=typeof t==="string"?[t]:t;for(const t of o){r.push(" "+n.blue(t)+e.newLine)}r.push(" "+getDiagnosticText(i)+e.newLine+e.newLine)}}function printAllHelp(e,t,n,r){let i=[...getHeader(e,`${getDiagnosticText(wt.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(wt.Version_0,c)}`)];i=[...i,...generateSectionOptionsOutput(e,getDiagnosticText(wt.ALL_COMPILER_OPTIONS),t,true,void 0,formatMessage(wt.You_can_learn_about_all_of_the_compiler_options_at_0,"https://aka.ms/tsc"))];i=[...i,...generateSectionOptionsOutput(e,getDiagnosticText(wt.WATCH_OPTIONS),r,false,getDiagnosticText(wt.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon))];i=[...i,...generateSectionOptionsOutput(e,getDiagnosticText(wt.BUILD_OPTIONS),filter(n,(e=>e!==uo)),false,formatMessage(wt.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0,"https://aka.ms/tsc-composite-builds"))];for(const t of i){e.write(t)}}function printBuildHelp(e,t){let n=[...getHeader(e,`${getDiagnosticText(wt.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(wt.Version_0,c)}`)];n=[...n,...generateSectionOptionsOutput(e,getDiagnosticText(wt.BUILD_OPTIONS),filter(t,(e=>e!==uo)),false,formatMessage(wt.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0,"https://aka.ms/tsc-composite-builds"))];for(const t of n){e.write(t)}}function getHeader(e,t){var n;const r=createColors(e);const i=[];const o=((n=e.getWidthOfTerminal)==null?void 0:n.call(e))??0;const a=5;const s=r.blueBackground("".padStart(a));const c=r.blueBackground(r.brightWhite("TS ".padStart(a)));if(o>=t.length+a){const n=o>120?120:o;const r=n-a;i.push(t.padEnd(r)+s+e.newLine);i.push("".padStart(r)+c+e.newLine)}else{i.push(t+e.newLine);i.push(e.newLine)}return i}function printHelp(e,t){if(!t.options.all){printEasyHelp(e,getOptionsForHelp(t))}else{printAllHelp(e,getOptionsForHelp(t),fo,$i)}}function executeCommandLineWorker(e,t,n){let r=createDiagnosticReporter(e);let i;if(n.options.locale){validateLocaleAndSetLanguage(n.options.locale,e,n.errors)}if(n.errors.length>0){n.errors.forEach(r);return e.exit(1)}if(n.options.init){writeConfigFile(e,r,n.options,n.fileNames);return e.exit(0)}if(n.options.version){printVersion(e);return e.exit(0)}if(n.options.help||n.options.all){printHelp(e,n);return e.exit(0)}if(n.options.watch&&n.options.listFilesOnly){r(createCompilerDiagnostic(wt.Options_0_and_1_cannot_be_combined,"watch","listFilesOnly"));return e.exit(1)}if(n.options.project){if(n.fileNames.length!==0){r(createCompilerDiagnostic(wt.Option_project_cannot_be_mixed_with_source_files_on_a_command_line));return e.exit(1)}const t=normalizePath(n.options.project);if(!t||e.directoryExists(t)){i=combinePaths(t,"tsconfig.json");if(!e.fileExists(i)){r(createCompilerDiagnostic(wt.Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0,n.options.project));return e.exit(1)}}else{i=t;if(!e.fileExists(i)){r(createCompilerDiagnostic(wt.The_specified_path_does_not_exist_Colon_0,n.options.project));return e.exit(1)}}}else if(n.fileNames.length===0){const t=normalizePath(e.getCurrentDirectory());i=findConfigFile(t,(t=>e.fileExists(t)))}if(n.fileNames.length===0&&!i){if(n.options.showConfig){r(createCompilerDiagnostic(wt.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0,normalizePath(e.getCurrentDirectory())))}else{printVersion(e);printHelp(e,n)}return e.exit(1)}const o=e.getCurrentDirectory();const a=convertToOptionsWithAbsolutePaths(n.options,(e=>getNormalizedAbsolutePath(e,o)));if(i){const o=new Map;const s=parseConfigFileWithSystem(i,a,o,n.watchOptions,e,r);if(a.showConfig){if(s.errors.length!==0){r=updateReportDiagnostic(e,r,s.options);s.errors.forEach(r);return e.exit(1)}e.write(JSON.stringify(convertToTSConfig(s,i,e),null,4)+e.newLine);return e.exit(0)}r=updateReportDiagnostic(e,r,s.options);if(isWatchSet(s.options)){if(reportWatchModeWithoutSysSupport(e,r))return;return createWatchOfConfigFile(e,t,r,s,a,n.watchOptions,o)}else if(tr(s.options)){performIncrementalCompilation2(e,t,r,s)}else{performCompilation(e,t,r,s)}}else{if(a.showConfig){e.write(JSON.stringify(convertToTSConfig(n,combinePaths(o,"tsconfig.json"),e),null,4)+e.newLine);return e.exit(0)}r=updateReportDiagnostic(e,r,a);if(isWatchSet(a)){if(reportWatchModeWithoutSysSupport(e,r))return;return createWatchOfFilesAndCompilerOptions(e,t,r,n.fileNames,a,n.watchOptions)}else if(tr(a)){performIncrementalCompilation2(e,t,r,{...n,options:a})}else{performCompilation(e,t,r,{...n,options:a})}}}function isBuildCommand(e){if(e.length>0&&e[0].charCodeAt(0)===45){const t=e[0].slice(e[0].charCodeAt(1)===45?2:1).toLowerCase();return t===uo.name||t===uo.shortName}return false}function executeCommandLine(e,t,n){if(isBuildCommand(n)){const{buildOptions:r,watchOptions:i,projects:o,errors:a}=parseBuildCommand(n);if(r.generateCpuProfile&&e.enableCPUProfiler){e.enableCPUProfiler(r.generateCpuProfile,(()=>performBuild(e,t,r,i,o,a)))}else{return performBuild(e,t,r,i,o,a)}}const r=parseCommandLine(n,(t=>e.readFile(t)));if(r.options.generateCpuProfile&&e.enableCPUProfiler){e.enableCPUProfiler(r.options.generateCpuProfile,(()=>executeCommandLineWorker(e,t,r)))}else{return executeCommandLineWorker(e,t,r)}}function reportWatchModeWithoutSysSupport(e,t){if(!e.watchFile||!e.watchDirectory){t(createCompilerDiagnostic(wt.The_current_host_does_not_support_the_0_option,"--watch"));e.exit(1);return true}return false}var ss=2;function performBuild(e,t,n,r,i,o){const a=updateReportDiagnostic(e,createDiagnosticReporter(e),n);if(n.locale){validateLocaleAndSetLanguage(n.locale,e,o)}if(o.length>0){o.forEach(a);return e.exit(1)}if(n.help){printVersion(e);printBuildHelp(e,mo);return e.exit(0)}if(i.length===0){printVersion(e);printBuildHelp(e,mo);return e.exit(0)}if(!e.getModifiedTime||!e.setModifiedTime||n.clean&&!e.deleteFile){a(createCompilerDiagnostic(wt.The_current_host_does_not_support_the_0_option,"--build"));return e.exit(1)}if(n.watch){if(reportWatchModeWithoutSysSupport(e,a))return;const o=createSolutionBuilderWithWatchHost(e,void 0,a,createBuilderStatusReporter(e,shouldBePretty(e,n)),createWatchStatusReporter2(e,n));o.jsDocParsingMode=ss;const s=enableSolutionPerformance(e,n);updateSolutionBuilderHost(e,t,o,s);const c=o.onWatchStatusChange;let l=false;o.onWatchStatusChange=(e,t,n,r)=>{c==null?void 0:c(e,t,n,r);if(l&&(e.code===wt.Found_0_errors_Watching_for_file_changes.code||e.code===wt.Found_1_error_Watching_for_file_changes.code)){reportSolutionBuilderTimes(d,s)}};const d=createSolutionBuilderWithWatch(o,i,n,r);d.build();reportSolutionBuilderTimes(d,s);l=true;return d}const s=createSolutionBuilderHost(e,void 0,a,createBuilderStatusReporter(e,shouldBePretty(e,n)),createReportErrorSummary(e,n));s.jsDocParsingMode=ss;const c=enableSolutionPerformance(e,n);updateSolutionBuilderHost(e,t,s,c);const l=createSolutionBuilder(s,i,n);const d=n.clean?l.clean():l.build();reportSolutionBuilderTimes(l,c);Q();return e.exit(d)}function createReportErrorSummary(e,t){return shouldBePretty(e,t)?(t,n)=>e.write(getErrorSummaryText(t,n,e.newLine,e)):void 0}function performCompilation(e,t,n,r){const{fileNames:i,options:o,projectReferences:a}=r;const s=createCompilerHostWorker(o,void 0,e);s.jsDocParsingMode=ss;const c=s.getCurrentDirectory();const l=createGetCanonicalFileName(s.useCaseSensitiveFileNames());changeCompilerHostLikeToUseCache(s,(e=>toPath(e,c,l)));enableStatisticsAndTracing(e,o,false);const d={rootNames:i,options:o,projectReferences:a,host:s,configFileParsingDiagnostics:getConfigFileParsingDiagnostics(r)};const p=createProgram(d);const u=emitFilesAndReportErrorsAndGetExitStatus(p,n,(t=>e.write(t+e.newLine)),createReportErrorSummary(e,o));reportStatistics(e,p,void 0);t(p);return e.exit(u)}function performIncrementalCompilation2(e,t,n,r){const{options:i,fileNames:o,projectReferences:a}=r;enableStatisticsAndTracing(e,i,false);const s=createIncrementalCompilerHost(i,e);s.jsDocParsingMode=ss;const c=performIncrementalCompilation({host:s,system:e,rootNames:o,options:i,configFileParsingDiagnostics:getConfigFileParsingDiagnostics(r),projectReferences:a,reportDiagnostic:n,reportErrorSummary:createReportErrorSummary(e,i),afterProgramEmitAndDiagnostics:n=>{reportStatistics(e,n.getProgram(),void 0);t(n)}});return e.exit(c)}function updateSolutionBuilderHost(e,t,n,r){updateCreateProgram(e,n,true);n.afterProgramEmitAndDiagnostics=n=>{reportStatistics(e,n.getProgram(),r);t(n)}}function updateCreateProgram(e,t,n){const r=t.createProgram;t.createProgram=(t,i,o,a,s,c)=>{S.assert(t!==void 0||i===void 0&&!!a);if(i!==void 0){enableStatisticsAndTracing(e,i,n)}return r(t,i,o,a,s,c)}}function updateWatchCompilationHost(e,t,n){n.jsDocParsingMode=ss;updateCreateProgram(e,n,false);const r=n.afterProgramCreate;n.afterProgramCreate=n=>{r(n);reportStatistics(e,n.getProgram(),void 0);t(n)}}function createWatchStatusReporter2(e,t){return createWatchStatusReporter(e,shouldBePretty(e,t))}function createWatchOfConfigFile(e,t,n,r,i,o,a){const s=createWatchCompilerHostOfConfigFile({configFileName:r.options.configFilePath,optionsToExtend:i,watchOptionsToExtend:o,system:e,reportDiagnostic:n,reportWatchStatus:createWatchStatusReporter2(e,r.options)});updateWatchCompilationHost(e,t,s);s.configFileParsingResult=r;s.extendedConfigCache=a;return createWatchProgram(s)}function createWatchOfFilesAndCompilerOptions(e,t,n,r,i,o){const a=createWatchCompilerHostOfFilesAndCompilerOptions({rootFiles:r,options:i,watchOptions:o,system:e,reportDiagnostic:n,reportWatchStatus:createWatchStatusReporter2(e,i)});updateWatchCompilationHost(e,t,a);return createWatchProgram(a)}function enableSolutionPerformance(e,t){if(e===Ft&&t.extendedDiagnostics){enable();return createSolutionPerfomrance()}}function createSolutionPerfomrance(){let e;return{addAggregateStatistic:addAggregateStatistic,forEachAggregateStatistics:forEachAggreateStatistics,clear:clear2};function addAggregateStatistic(t){const n=e==null?void 0:e.get(t.name);if(n){if(n.type===2)n.value=Math.max(n.value,t.value);else n.value+=t.value}else{(e??(e=new Map)).set(t.name,t)}}function forEachAggreateStatistics(t){e==null?void 0:e.forEach(t)}function clear2(){e=void 0}}function reportSolutionBuilderTimes(e,t){if(!t)return;if(!isEnabled()){Ft.write(wt.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message+"\n");return}const n=[];n.push({name:"Projects in scope",value:getBuildOrderFromAnyBuildOrder(e.getBuildOrder()).length,type:1});reportSolutionBuilderCountStatistic("SolutionBuilder::Projects built");reportSolutionBuilderCountStatistic("SolutionBuilder::Timestamps only updates");reportSolutionBuilderCountStatistic("SolutionBuilder::Bundles updated");t.forEachAggregateStatistics((e=>{e.name=`Aggregate ${e.name}`;n.push(e)}));forEachMeasure(((e,t)=>{if(isSolutionMarkOrMeasure(e))n.push({name:`${getNameFromSolutionBuilderMarkOrMeasure(e)} time`,value:t,type:0})}));disable();enable();t.clear();reportAllStatistics(Ft,n);function reportSolutionBuilderCountStatistic(e){const t=getCount(e);if(t){n.push({name:getNameFromSolutionBuilderMarkOrMeasure(e),value:t,type:1})}}function getNameFromSolutionBuilderMarkOrMeasure(e){return e.replace("SolutionBuilder::","")}}function canReportDiagnostics(e,t){return e===Ft&&(t.diagnostics||t.extendedDiagnostics)}function canTrace(e,t){return e===Ft&&t.generateTrace}function enableStatisticsAndTracing(e,t,n){if(canReportDiagnostics(e,t)){enable(e)}if(canTrace(e,t)){$(n?"build":"project",t.generateTrace,t.configFilePath)}}function isSolutionMarkOrMeasure(e){return startsWith(e,"SolutionBuilder::")}function reportStatistics(e,t,n){var r;const i=t.getCompilerOptions();if(canTrace(e,i)){(r=G)==null?void 0:r.stopTracing()}let o;if(canReportDiagnostics(e,i)){o=[];const r=e.getMemoryUsage?e.getMemoryUsage():-1;reportCountStatistic("Files",t.getSourceFiles().length);const a=countLines(t);if(i.extendedDiagnostics){for(const[e,t]of a.entries()){reportCountStatistic("Lines of "+e,t)}}else{reportCountStatistic("Lines",reduceLeftIterator(a.values(),((e,t)=>e+t),0))}reportCountStatistic("Identifiers",t.getIdentifierCount());reportCountStatistic("Symbols",t.getSymbolCount());reportCountStatistic("Types",t.getTypeCount());reportCountStatistic("Instantiations",t.getInstantiationCount());if(r>=0){reportStatisticalValue({name:"Memory used",value:r,type:2},true)}const s=isEnabled();const c=s?getDuration("Program"):0;const l=s?getDuration("Bind"):0;const d=s?getDuration("Check"):0;const p=s?getDuration("Emit"):0;if(i.extendedDiagnostics){const e=t.getRelationCacheSizes();reportCountStatistic("Assignability cache size",e.assignable);reportCountStatistic("Identity cache size",e.identity);reportCountStatistic("Subtype cache size",e.subtype);reportCountStatistic("Strict subtype cache size",e.strictSubtype);if(s){forEachMeasure(((e,t)=>{if(!isSolutionMarkOrMeasure(e))reportTimeStatistic(`${e} time`,t,true)}))}}else if(s){reportTimeStatistic("I/O read",getDuration("I/O Read"),true);reportTimeStatistic("I/O write",getDuration("I/O Write"),true);reportTimeStatistic("Parse time",c,true);reportTimeStatistic("Bind time",l,true);reportTimeStatistic("Check time",d,true);reportTimeStatistic("Emit time",p,true)}if(s){reportTimeStatistic("Total time",c+l+d+p,false)}reportAllStatistics(e,o);if(!s){e.write(wt.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message+"\n")}else{if(n){forEachMeasure((e=>{if(!isSolutionMarkOrMeasure(e))clearMeasures(e)}));forEachMark((e=>{if(!isSolutionMarkOrMeasure(e))clearMarks(e)}))}else{disable()}}}function reportStatisticalValue(e,t){o.push(e);if(t)n==null?void 0:n.addAggregateStatistic(e)}function reportCountStatistic(e,t){reportStatisticalValue({name:e,value:t,type:1},true)}function reportTimeStatistic(e,t,n){reportStatisticalValue({name:e,value:t,type:0},n)}}function reportAllStatistics(e,t){let n=0;let r=0;for(const e of t){if(e.name.length>n){n=e.name.length}const t=statisticValue(e);if(t.length>r){r=t.length}}for(const i of t){e.write(`${i.name}:`.padEnd(n+2)+statisticValue(i).toString().padStart(r)+e.newLine)}}function statisticValue(e){switch(e.type){case 1:return""+e.value;case 0:return(e.value/1e3).toFixed(2)+"s";case 2:return Math.round(e.value/1e3)+"K";default:S.assertNever(e.type)}}function writeConfigFile(e,t,n,r){const i=e.getCurrentDirectory();const o=normalizePath(combinePaths(i,"tsconfig.json"));if(e.fileExists(o)){t(createCompilerDiagnostic(wt.A_tsconfig_json_file_is_already_defined_at_Colon_0,o))}else{e.writeFile(o,generateTSConfig(n,r,e.newLine));const t=[e.newLine,...getHeader(e,"Created a new tsconfig.json with:")];t.push(getCompilerOptionsDiffValue(n,e.newLine)+e.newLine+e.newLine);t.push(`You can learn more at https://aka.ms/tsconfig`+e.newLine);for(const n of t){e.write(n)}}return}function syntacticResult(e,t=true){return{type:e,reportFallback:t}}var cs=syntacticResult(void 0,false);var ls=syntacticResult(void 0,false);var ds=syntacticResult(void 0,true);function createSyntacticTypeNodeBuilder(e,t){const n=getStrictOptionValue(e,"strictNullChecks");return{serializeTypeOfDeclaration:serializeTypeOfDeclaration,serializeReturnTypeForSignature:serializeReturnTypeForSignature,serializeTypeOfExpression:serializeTypeOfExpression,serializeTypeOfAccessor:serializeTypeOfAccessor,tryReuseExistingTypeNode(e,n){if(!t.canReuseTypeNode(e,n)){return void 0}return tryReuseExistingTypeNode(e,n)}};function reuseNode(e,n,r=n){return n===void 0?void 0:t.markNodeReuse(e,n.flags&16?n:zr.cloneNode(n),r??n)}function tryReuseExistingTypeNode(n,r){const{finalizeBoundary:i,startRecoveryScope:o,hadError:a,markError:s}=t.createRecoveryBoundary(n);const c=visitNode(r,visitExistingNodeTreeSymbols,isTypeNode);if(!i()){return void 0}n.approximateLength+=r.end-r.pos;return c;function visitExistingNodeTreeSymbols(e){if(a())return e;const r=o();const i=isNewScopeNode(e)?t.enterNewScope(n,e):void 0;const s=visitExistingNodeTreeSymbolsWorker(e);i==null?void 0:i();if(a()){if(isTypeNode(e)&&!isTypePredicateNode(e)){r();return t.serializeExistingTypeNode(n,e)}return e}return s?t.markNodeReuse(n,s,e):void 0}function tryVisitSimpleTypeNode(e){const t=skipTypeParentheses(e);switch(t.kind){case 183:return tryVisitTypeReference(t);case 186:return tryVisitTypeQuery(t);case 199:return tryVisitIndexedAccess(t);case 198:const e=t;if(e.operator===143){return tryVisitKeyOf(e)}}return visitNode(e,visitExistingNodeTreeSymbols,isTypeNode)}function tryVisitIndexedAccess(e){const t=tryVisitSimpleTypeNode(e.objectType);if(t===void 0){return void 0}return zr.updateIndexedAccessTypeNode(e,t,visitNode(e.indexType,visitExistingNodeTreeSymbols,isTypeNode))}function tryVisitKeyOf(e){S.assertEqual(e.operator,143);const t=tryVisitSimpleTypeNode(e.type);if(t===void 0){return void 0}return zr.updateTypeOperatorNode(e,t)}function tryVisitTypeQuery(e){const{introducesError:r,node:i}=t.trackExistingEntityName(n,e.exprName);if(!r){return zr.updateTypeQueryNode(e,i,visitNodes2(e.typeArguments,visitExistingNodeTreeSymbols,isTypeNode))}const o=t.serializeTypeName(n,e.exprName,true);if(o){return t.markNodeReuse(n,o,e.exprName)}}function tryVisitTypeReference(e){if(t.canReuseTypeNode(n,e)){const{introducesError:r,node:i}=t.trackExistingEntityName(n,e.typeName);const o=visitNodes2(e.typeArguments,visitExistingNodeTreeSymbols,isTypeNode);if(!r){const r=zr.updateTypeReferenceNode(e,i,o);return t.markNodeReuse(n,r,e)}else{const r=t.serializeTypeName(n,e.typeName,false,o);if(r){return t.markNodeReuse(n,r,e.typeName)}}}}function visitExistingNodeTreeSymbolsWorker(r){var i;if(isJSDocTypeExpression(r)){return visitNode(r.type,visitExistingNodeTreeSymbols,isTypeNode)}if(isJSDocAllType(r)||r.kind===319){return zr.createKeywordTypeNode(133)}if(isJSDocUnknownType(r)){return zr.createKeywordTypeNode(159)}if(isJSDocNullableType(r)){return zr.createUnionTypeNode([visitNode(r.type,visitExistingNodeTreeSymbols,isTypeNode),zr.createLiteralTypeNode(zr.createNull())])}if(isJSDocOptionalType(r)){return zr.createUnionTypeNode([visitNode(r.type,visitExistingNodeTreeSymbols,isTypeNode),zr.createKeywordTypeNode(157)])}if(isJSDocNonNullableType(r)){return visitNode(r.type,visitExistingNodeTreeSymbols)}if(isJSDocVariadicType(r)){return zr.createArrayTypeNode(visitNode(r.type,visitExistingNodeTreeSymbols,isTypeNode))}if(isJSDocTypeLiteral(r)){return zr.createTypeLiteralNode(map(r.jsDocPropertyTags,(e=>{const i=visitNode(isIdentifier(e.name)?e.name:e.name.right,visitExistingNodeTreeSymbols,isIdentifier);const o=t.getJsDocPropertyOverride(n,r,e);return zr.createPropertySignature(void 0,i,e.isBracketed||e.typeExpression&&isJSDocOptionalType(e.typeExpression.type)?zr.createToken(58):void 0,o||e.typeExpression&&visitNode(e.typeExpression.type,visitExistingNodeTreeSymbols,isTypeNode)||zr.createKeywordTypeNode(133))})))}if(isTypeReferenceNode(r)&&isIdentifier(r.typeName)&&r.typeName.escapedText===""){return setOriginalNode(zr.createKeywordTypeNode(133),r)}if((isExpressionWithTypeArguments(r)||isTypeReferenceNode(r))&&isJSDocIndexSignature(r)){return zr.createTypeLiteralNode([zr.createIndexSignature(void 0,[zr.createParameterDeclaration(void 0,void 0,"x",void 0,visitNode(r.typeArguments[0],visitExistingNodeTreeSymbols,isTypeNode))],visitNode(r.typeArguments[1],visitExistingNodeTreeSymbols,isTypeNode))])}if(isJSDocFunctionType(r)){if(isJSDocConstructSignature(r)){let e;return zr.createConstructorTypeNode(void 0,visitNodes2(r.typeParameters,visitExistingNodeTreeSymbols,isTypeParameterDeclaration),mapDefined(r.parameters,((r,i)=>r.name&&isIdentifier(r.name)&&r.name.escapedText==="new"?(e=r.type,void 0):zr.createParameterDeclaration(void 0,getEffectiveDotDotDotForParameter(r),t.markNodeReuse(n,zr.createIdentifier(getNameForJSDocFunctionParameter(r,i)),r),zr.cloneNode(r.questionToken),visitNode(r.type,visitExistingNodeTreeSymbols,isTypeNode),void 0))),visitNode(e||r.type,visitExistingNodeTreeSymbols,isTypeNode)||zr.createKeywordTypeNode(133))}else{return zr.createFunctionTypeNode(visitNodes2(r.typeParameters,visitExistingNodeTreeSymbols,isTypeParameterDeclaration),map(r.parameters,((e,r)=>zr.createParameterDeclaration(void 0,getEffectiveDotDotDotForParameter(e),t.markNodeReuse(n,zr.createIdentifier(getNameForJSDocFunctionParameter(e,r)),e),zr.cloneNode(e.questionToken),visitNode(e.type,visitExistingNodeTreeSymbols,isTypeNode),void 0))),visitNode(r.type,visitExistingNodeTreeSymbols,isTypeNode)||zr.createKeywordTypeNode(133))}}if(isThisTypeNode(r)){if(t.canReuseTypeNode(n,r)){return r}s();return r}if(isTypeParameterDeclaration(r)){const{node:e}=t.trackExistingEntityName(n,r.name);return zr.updateTypeParameterDeclaration(r,visitNodes2(r.modifiers,visitExistingNodeTreeSymbols,isModifier),e,visitNode(r.constraint,visitExistingNodeTreeSymbols,isTypeNode),visitNode(r.default,visitExistingNodeTreeSymbols,isTypeNode))}if(isIndexedAccessTypeNode(r)){const e=tryVisitIndexedAccess(r);if(!e){s();return r}return e}if(isTypeReferenceNode(r)){const e=tryVisitTypeReference(r);if(e){return e}s();return r}if(isLiteralImportTypeNode(r)){if(((i=r.attributes)==null?void 0:i.token)===132){s();return r}if(!t.canReuseTypeNode(n,r)){return t.serializeExistingTypeNode(n,r)}return zr.updateImportTypeNode(r,zr.updateLiteralTypeNode(r.argument,rewriteModuleSpecifier2(r,r.argument.literal)),visitNode(r.attributes,visitExistingNodeTreeSymbols,isImportAttributes),visitNode(r.qualifier,visitExistingNodeTreeSymbols,isEntityName),visitNodes2(r.typeArguments,visitExistingNodeTreeSymbols,isTypeNode),r.isTypeOf)}if(isNamedDeclaration(r)&&r.name.kind===167&&!t.hasLateBindableName(r)){if(!hasDynamicName(r)){return visitEachChild2(r,visitExistingNodeTreeSymbols)}if(t.shouldRemoveDeclaration(n,r)){return void 0}}if(isFunctionLike(r)&&!r.type||isPropertyDeclaration(r)&&!r.type&&!r.initializer||isPropertySignature(r)&&!r.type&&!r.initializer||isParameter(r)&&!r.type&&!r.initializer){let e=visitEachChild2(r,visitExistingNodeTreeSymbols);if(e===r){e=t.markNodeReuse(n,zr.cloneNode(r),r)}e.type=zr.createKeywordTypeNode(133);if(isParameter(r)){e.modifiers=void 0}return e}if(isTypeQueryNode(r)){const e=tryVisitTypeQuery(r);if(!e){s();return r}return e}if(isComputedPropertyName(r)&&isEntityNameExpression(r.expression)){const{node:i,introducesError:o}=t.trackExistingEntityName(n,r.expression);if(!o){return zr.updateComputedPropertyName(r,i)}else{const i=t.serializeTypeOfExpression(n,r.expression);let o;if(isLiteralTypeNode(i)){o=i.literal}else{const e=t.evaluateEntityNameExpression(r.expression);const a=typeof e.value==="string"?zr.createStringLiteral(e.value,void 0):typeof e.value==="number"?zr.createNumericLiteral(e.value,0):void 0;if(!a){if(isImportTypeNode(i)){t.trackComputedName(n,r.expression)}return r}o=a}if(o.kind===11&&isIdentifierText(o.text,zn(e))){return zr.createIdentifier(o.text)}if(o.kind===9&&!o.text.startsWith("-")){return o}return zr.updateComputedPropertyName(r,o)}}if(isTypePredicateNode(r)){let e;if(isIdentifier(r.parameterName)){const{node:i,introducesError:o}=t.trackExistingEntityName(n,r.parameterName);if(o)s();e=i}else{e=zr.cloneNode(r.parameterName)}return zr.updateTypePredicateNode(r,zr.cloneNode(r.assertsModifier),e,visitNode(r.type,visitExistingNodeTreeSymbols,isTypeNode))}if(isTupleTypeNode(r)||isTypeLiteralNode(r)||isMappedTypeNode(r)){const e=visitEachChild2(r,visitExistingNodeTreeSymbols);const i=t.markNodeReuse(n,e===r?zr.cloneNode(r):e,r);const o=getEmitFlags(i);setEmitFlags(i,o|(n.flags&1024&&isTypeLiteralNode(r)?0:1));return i}if(isStringLiteral(r)&&!!(n.flags&268435456)&&!r.singleQuote){const e=zr.cloneNode(r);e.singleQuote=true;return e}if(isConditionalTypeNode(r)){const e=visitNode(r.checkType,visitExistingNodeTreeSymbols,isTypeNode);const i=t.enterNewScope(n,r);const o=visitNode(r.extendsType,visitExistingNodeTreeSymbols,isTypeNode);const a=visitNode(r.trueType,visitExistingNodeTreeSymbols,isTypeNode);i();const s=visitNode(r.falseType,visitExistingNodeTreeSymbols,isTypeNode);return zr.updateConditionalTypeNode(r,e,o,a,s)}if(isTypeOperatorNode(r)){if(r.operator===158&&r.type.kind===155){if(!t.canReuseTypeNode(n,r)){s();return r}}else if(r.operator===143){const e=tryVisitKeyOf(r);if(!e){s();return r}return e}}return visitEachChild2(r,visitExistingNodeTreeSymbols);function visitEachChild2(e,t){const r=!n.enclosingFile||n.enclosingFile!==getSourceFileOfNode(e);return visitEachChild(e,t,void 0,r?visitNodesWithoutCopyingPositions:void 0)}function visitNodesWithoutCopyingPositions(e,t,n,r,i){let o=visitNodes2(e,t,n,r,i);if(o){if(o.pos!==-1||o.end!==-1){if(o===e){o=zr.createNodeArray(e.slice(),e.hasTrailingComma)}setTextRangePosEnd(o,-1,-1)}}return o}function getEffectiveDotDotDotForParameter(e){return e.dotDotDotToken||(e.type&&isJSDocVariadicType(e.type)?zr.createToken(26):void 0)}function getNameForJSDocFunctionParameter(e,t){return e.name&&isIdentifier(e.name)&&e.name.escapedText==="this"?"this":getEffectiveDotDotDotForParameter(e)?`args`:`arg${t}`}function rewriteModuleSpecifier2(e,r){const i=t.getModuleSpecifierOverride(n,e,r);if(i){return setOriginalNode(zr.createStringLiteral(i),r)}return visitNode(r,visitExistingNodeTreeSymbols,isStringLiteral)}}}function serializeExistingTypeNode(e,n,r){if(!e)return void 0;let i;if((!r||canAddUndefined(e))&&t.canReuseTypeNode(n,e)){i=tryReuseExistingTypeNode(n,e);if(i!==void 0){i=addUndefinedIfNeeded(i,r,void 0,n)}}return i}function serializeTypeAnnotationOfDeclaration(e,n,r,i,o,a=o!==void 0){if(!e)return void 0;if(!t.canReuseTypeNodeAnnotation(n,r,e,i,o)){if(!o||!t.canReuseTypeNodeAnnotation(n,r,e,i,false)){return void 0}}let s;if(!o||canAddUndefined(e)){s=serializeExistingTypeNode(e,n,o)}if(s!==void 0||!a){return s}n.tracker.reportInferenceFallback(r);return t.serializeExistingTypeNode(n,e,o)??zr.createKeywordTypeNode(133)}function serializeExistingTypeNodeWithFallback(e,n,r,i){if(!e)return void 0;const o=serializeExistingTypeNode(e,n,r);if(o!==void 0){return o}n.tracker.reportInferenceFallback(i??e);return t.serializeExistingTypeNode(n,e,r)??zr.createKeywordTypeNode(133)}function serializeTypeOfAccessor(e,n,r){return typeFromAccessor(e,n,r)??inferAccessorType(e,t.getAllAccessorDeclarations(e),r,n)}function serializeTypeOfExpression(e,t,n,r){const i=typeFromExpression(e,t,false,n,r);return i.type!==void 0?i.type:inferExpressionType(e,t,i.reportFallback)}function serializeTypeOfDeclaration(e,t,n){switch(e.kind){case 169:case 341:return typeFromParameter(e,t,n);case 260:return typeFromVariable(e,t,n);case 171:case 348:case 172:return typeFromProperty(e,t,n);case 208:return inferTypeOfDeclaration(e,t,n);case 277:return serializeTypeOfExpression(e.expression,n,void 0,true);case 211:case 212:case 226:return typeFromExpandoProperty(e,t,n);case 303:case 304:return typeFromPropertyAssignment(e,t,n);default:S.assertNever(e,`Node needs to be an inferrable node, found ${S.formatSyntaxKind(e.kind)}`)}}function typeFromPropertyAssignment(e,n,r){const i=getEffectiveTypeAnnotationNode(e);let o;if(i&&t.canReuseTypeNodeAnnotation(r,e,i,n)){o=serializeExistingTypeNode(i,r)}if(!o&&e.kind===303){const i=e.initializer;const a=isJSDocTypeAssertion(i)?getJSDocTypeAssertionType(i):i.kind===234||i.kind===216?i.type:void 0;if(a&&!isConstTypeReference(a)&&t.canReuseTypeNodeAnnotation(r,e,a,n)){o=serializeExistingTypeNode(a,r)}}return o??inferTypeOfDeclaration(e,n,r,false)}function serializeReturnTypeForSignature(e,t,n){switch(e.kind){case 177:return serializeTypeOfAccessor(e,t,n);case 174:case 262:case 180:case 173:case 179:case 176:case 178:case 181:case 184:case 185:case 218:case 219:case 317:case 323:return createReturnFromSignature(e,t,n);default:S.assertNever(e,`Node needs to be an inferrable node, found ${S.formatSyntaxKind(e.kind)}`)}}function getTypeAnnotationFromAccessor(e){if(e){return e.kind===177?isInJSFile(e)&&getJSDocType(e)||getEffectiveReturnTypeNode(e):getEffectiveSetAccessorTypeAnnotationNode(e)}}function getTypeAnnotationFromAllAccessorDeclarations(e,t){let n=getTypeAnnotationFromAccessor(e);if(!n&&e!==t.firstAccessor){n=getTypeAnnotationFromAccessor(t.firstAccessor)}if(!n&&t.secondAccessor&&e!==t.secondAccessor){n=getTypeAnnotationFromAccessor(t.secondAccessor)}return n}function typeFromAccessor(e,n,r){const i=t.getAllAccessorDeclarations(e);const o=getTypeAnnotationFromAllAccessorDeclarations(e,i);if(o&&!isTypePredicateNode(o)){return withNewScope(r,e,(()=>serializeTypeAnnotationOfDeclaration(o,r,e,n)??inferTypeOfDeclaration(e,n,r)))}if(i.getAccessor){return withNewScope(r,i.getAccessor,(()=>createReturnFromSignature(i.getAccessor,void 0,r)))}return void 0}function typeFromVariable(e,n,r){var i;const o=getEffectiveTypeAnnotationNode(e);let a=ds;if(o){a=syntacticResult(serializeTypeAnnotationOfDeclaration(o,r,e,n))}else if(e.initializer&&(((i=n.declarations)==null?void 0:i.length)===1||countWhere(n.declarations,isVariableDeclaration)===1)){if(!t.isExpandoFunctionDeclaration(e)&&!isContextuallyTyped(e)){a=typeFromExpression(e.initializer,r,void 0,void 0,isVarConstLike(e))}}return a.type!==void 0?a.type:inferTypeOfDeclaration(e,n,r,a.reportFallback)}function typeFromParameter(e,n,r){const i=e.parent;if(i.kind===178){return serializeTypeOfAccessor(i,void 0,r)}const o=getEffectiveTypeAnnotationNode(e);const a=t.requiresAddingImplicitUndefined(e,n,r.enclosingDeclaration);let s=ds;if(o){s=syntacticResult(serializeTypeAnnotationOfDeclaration(o,r,e,n,a))}else if(isParameter(e)&&e.initializer&&isIdentifier(e.name)&&!isContextuallyTyped(e)){s=typeFromExpression(e.initializer,r,void 0,a)}return s.type!==void 0?s.type:inferTypeOfDeclaration(e,n,r,s.reportFallback)}function typeFromExpandoProperty(e,t,n){const r=getEffectiveTypeAnnotationNode(e);let i;if(r){i=serializeTypeAnnotationOfDeclaration(r,n,e,t)}const o=n.suppressReportInferenceFallback;n.suppressReportInferenceFallback=true;const a=i??inferTypeOfDeclaration(e,t,n,false);n.suppressReportInferenceFallback=o;return a}function typeFromProperty(e,n,r){const i=getEffectiveTypeAnnotationNode(e);const o=t.requiresAddingImplicitUndefined(e,n,r.enclosingDeclaration);let a=ds;if(i){a=syntacticResult(serializeTypeAnnotationOfDeclaration(i,r,e,n,o))}else{const t=isPropertyDeclaration(e)?e.initializer:void 0;if(t&&!isContextuallyTyped(e)){const n=isDeclarationReadonly(e);a=typeFromExpression(t,r,void 0,o,n)}}return a.type!==void 0?a.type:inferTypeOfDeclaration(e,n,r,a.reportFallback)}function inferTypeOfDeclaration(e,n,r,i=true){if(i){r.tracker.reportInferenceFallback(e)}if(r.noInferenceFallback===true){return zr.createKeywordTypeNode(133)}return t.serializeTypeOfDeclaration(r,e,n)}function inferExpressionType(e,n,r=true,i){S.assert(!i);if(r){n.tracker.reportInferenceFallback(e)}if(n.noInferenceFallback===true){return zr.createKeywordTypeNode(133)}return t.serializeTypeOfExpression(n,e)??zr.createKeywordTypeNode(133)}function inferReturnTypeOfSignatureSignature(e,n,r){if(r){n.tracker.reportInferenceFallback(e)}if(n.noInferenceFallback===true){return zr.createKeywordTypeNode(133)}return t.serializeReturnTypeForSignature(n,e)??zr.createKeywordTypeNode(133)}function inferAccessorType(e,n,r,i,o=true){if(e.kind===177){return createReturnFromSignature(e,i,r,o)}else{if(o){r.tracker.reportInferenceFallback(e)}const a=n.getAccessor&&createReturnFromSignature(n.getAccessor,i,r,o);return a??t.serializeTypeOfDeclaration(r,e,i)??zr.createKeywordTypeNode(133)}}function withNewScope(e,n,r){const i=t.enterNewScope(e,n);const o=r();i();return o}function typeFromTypeAssertion(e,t,n,r){if(isConstTypeReference(t)){return typeFromExpression(e,n,true,r)}return syntacticResult(serializeExistingTypeNodeWithFallback(t,n,r))}function typeFromExpression(e,r,i=false,o=false,a=false){switch(e.kind){case 217:if(isJSDocTypeAssertion(e)){return typeFromTypeAssertion(e.expression,getJSDocTypeAssertionType(e),r,o)}return typeFromExpression(e.expression,r,i,o);case 80:if(t.isUndefinedIdentifierExpression(e)){return syntacticResult(createUndefinedTypeNode())}break;case 106:if(n){return syntacticResult(addUndefinedIfNeeded(zr.createLiteralTypeNode(zr.createNull()),o,e,r))}else{return syntacticResult(zr.createKeywordTypeNode(133))}case 219:case 218:S.type(e);return withNewScope(r,e,(()=>typeFromFunctionLikeExpression(e,r)));case 216:case 234:const s=e;return typeFromTypeAssertion(s.expression,s.type,r,o);case 224:const c=e;if(isPrimitiveLiteralValue(c)){return typeFromPrimitiveLiteral(c.operator===40?c.operand:c,c.operand.kind===10?163:150,r,i||a,o)}break;case 209:return typeFromArrayLiteral(e,r,i,o);case 210:return typeFromObjectLiteral(e,r,i,o);case 231:return syntacticResult(inferExpressionType(e,r,true,o));case 228:if(!i&&!a){return syntacticResult(zr.createKeywordTypeNode(154))}break;default:let l;let d=e;switch(e.kind){case 9:l=150;break;case 15:d=zr.createStringLiteral(e.text);l=154;break;case 11:l=154;break;case 10:l=163;break;case 112:case 97:l=136;break}if(l){return typeFromPrimitiveLiteral(d,l,r,i||a,o)}}return ds}function typeFromFunctionLikeExpression(e,t){const n=createReturnFromSignature(e,void 0,t);const r=reuseTypeParameters(e.typeParameters,t);const i=e.parameters.map((e=>ensureParameter(e,t)));return syntacticResult(zr.createFunctionTypeNode(r,i,n))}function canGetTypeFromArrayLiteral(e,t,n){if(!n){t.tracker.reportInferenceFallback(e);return false}for(const n of e.elements){if(n.kind===230){t.tracker.reportInferenceFallback(n);return false}}return true}function typeFromArrayLiteral(e,t,n,r){if(!canGetTypeFromArrayLiteral(e,t,n)){if(r||isDeclaration(walkUpParenthesizedExpressions(e).parent)){return ls}return syntacticResult(inferExpressionType(e,t,false,r))}const i=t.noInferenceFallback;t.noInferenceFallback=true;const o=[];for(const r of e.elements){S.assert(r.kind!==230);if(r.kind===232){o.push(createUndefinedTypeNode())}else{const e=typeFromExpression(r,t,n);const i=e.type!==void 0?e.type:inferExpressionType(r,t,e.reportFallback);o.push(i)}}const a=zr.createTupleTypeNode(o);a.emitNode={flags:1,autoGenerate:void 0,internalFlags:0};t.noInferenceFallback=i;return cs}function canGetTypeFromObjectLiteral(e,n){let r=true;for(const i of e.properties){if(i.flags&262144){r=false;break}if(i.kind===304||i.kind===305){n.tracker.reportInferenceFallback(i);r=false}else if(i.name.flags&262144){r=false;break}else if(i.name.kind===81){r=false}else if(i.name.kind===167){const e=i.name.expression;if(!isPrimitiveLiteralValue(e,false)&&!t.isDefinitelyReferenceToGlobalSymbolObject(e)){n.tracker.reportInferenceFallback(i.name);r=false}}}return r}function typeFromObjectLiteral(e,t,n,r){if(!canGetTypeFromObjectLiteral(e,t)){if(r||isDeclaration(walkUpParenthesizedExpressions(e).parent)){return ls}return syntacticResult(inferExpressionType(e,t,false,r))}const i=t.noInferenceFallback;t.noInferenceFallback=true;const o=[];const a=t.flags;t.flags|=4194304;for(const r of e.properties){S.assert(!isShorthandPropertyAssignment(r)&&!isSpreadAssignment(r));const e=r.name;let i;switch(r.kind){case 174:i=withNewScope(t,r,(()=>typeFromObjectLiteralMethod(r,e,t,n)));break;case 303:i=typeFromObjectLiteralPropertyAssignment(r,e,t,n);break;case 178:case 177:i=typeFromObjectLiteralAccessor(r,e,t);break}if(i){setCommentRange(i,r);o.push(i)}}t.flags=a;const s=zr.createTypeLiteralNode(o);if(!(t.flags&1024)){setEmitFlags(s,1)}t.noInferenceFallback=i;return cs}function typeFromObjectLiteralPropertyAssignment(e,t,n,r){const i=r?[zr.createModifier(148)]:[];const o=typeFromExpression(e.initializer,n,r);const a=o.type!==void 0?o.type:inferTypeOfDeclaration(e,void 0,n,o.reportFallback);return zr.createPropertySignature(i,reuseNode(n,t),void 0,a)}function ensureParameter(e,n){return zr.updateParameterDeclaration(e,[],reuseNode(n,e.dotDotDotToken),t.serializeNameOfParameter(n,e),t.isOptionalParameter(e)?zr.createToken(58):void 0,typeFromParameter(e,void 0,n),void 0)}function reuseTypeParameters(e,t){return e==null?void 0:e.map((e=>{var n;return zr.updateTypeParameterDeclaration(e,(n=e.modifiers)==null?void 0:n.map((e=>reuseNode(t,e))),reuseNode(t,e.name),serializeExistingTypeNodeWithFallback(e.constraint,t),serializeExistingTypeNodeWithFallback(e.default,t))}))}function typeFromObjectLiteralMethod(e,t,n,r){const i=createReturnFromSignature(e,void 0,n);const o=reuseTypeParameters(e.typeParameters,n);const a=e.parameters.map((e=>ensureParameter(e,n)));if(r){return zr.createPropertySignature([zr.createModifier(148)],reuseNode(n,t),reuseNode(n,e.questionToken),zr.createFunctionTypeNode(o,a,i))}else{if(isIdentifier(t)&&t.escapedText==="new"){t=zr.createStringLiteral("new")}return zr.createMethodSignature([],reuseNode(n,t),reuseNode(n,e.questionToken),o,a,i)}}function typeFromObjectLiteralAccessor(e,n,r){const i=t.getAllAccessorDeclarations(e);const o=i.getAccessor&&getTypeAnnotationFromAccessor(i.getAccessor);const a=i.setAccessor&&getTypeAnnotationFromAccessor(i.setAccessor);if(o!==void 0&&a!==void 0){return withNewScope(r,e,(()=>{const t=e.parameters.map((e=>ensureParameter(e,r)));if(isGetAccessor(e)){return zr.updateGetAccessorDeclaration(e,[],reuseNode(r,n),t,serializeExistingTypeNodeWithFallback(o,r),void 0)}else{return zr.updateSetAccessorDeclaration(e,[],reuseNode(r,n),t,void 0)}}))}else if(i.firstAccessor===e){const t=o?withNewScope(r,i.getAccessor,(()=>serializeExistingTypeNodeWithFallback(o,r))):a?withNewScope(r,i.setAccessor,(()=>serializeExistingTypeNodeWithFallback(a,r))):void 0;const s=t??inferAccessorType(e,i,r,void 0);const c=zr.createPropertySignature(i.setAccessor===void 0?[zr.createModifier(148)]:[],reuseNode(r,n),void 0,s);return c}}function createUndefinedTypeNode(){if(n){return zr.createKeywordTypeNode(157)}else{return zr.createKeywordTypeNode(133)}}function typeFromPrimitiveLiteral(e,t,n,r,i){let o;if(r){if(e.kind===224&&e.operator===40){o=zr.createLiteralTypeNode(reuseNode(n,e.operand))}o=zr.createLiteralTypeNode(reuseNode(n,e))}else{o=zr.createKeywordTypeNode(t)}return syntacticResult(addUndefinedIfNeeded(o,i,e,n))}function addUndefinedIfNeeded(e,t,r,i){const o=r&&walkUpParenthesizedExpressions(r).parent;const a=o&&isDeclaration(o)&&isOptionalDeclaration(o);if(!n||!(t||a))return e;if(!canAddUndefined(e)){i.tracker.reportInferenceFallback(e)}if(isUnionTypeNode(e)){return zr.createUnionTypeNode([...e.types,zr.createKeywordTypeNode(157)])}return zr.createUnionTypeNode([e,zr.createKeywordTypeNode(157)])}function canAddUndefined(e){if(!n)return true;if(isKeyword(e.kind)||e.kind===201||e.kind===184||e.kind===185||e.kind===188||e.kind===189||e.kind===187||e.kind===203||e.kind===197){return true}if(e.kind===196){return canAddUndefined(e.type)}if(e.kind===192||e.kind===193){return e.types.every(canAddUndefined)}return false}function createReturnFromSignature(e,t,n,r=true){let i=ds;const o=isJSDocConstructSignature(e)?getEffectiveTypeAnnotationNode(e.parameters[0]):getEffectiveReturnTypeNode(e);if(o){i=syntacticResult(serializeTypeAnnotationOfDeclaration(o,n,e,t))}else if(isValueSignatureDeclaration(e)){i=typeFromSingleReturnExpression(e,n)}return i.type!==void 0?i.type:inferReturnTypeOfSignatureSignature(e,n,r&&i.reportFallback&&!o)}function typeFromSingleReturnExpression(e,t){let n;if(e&&!nodeIsMissing(e.body)){const t=getFunctionFlags(e);if(t&3)return ds;const r=e.body;if(r&&isBlock(r)){forEachReturnStatement(r,(e=>{if(e.parent!==r){n=void 0;return true}if(!n){n=e.expression}else{n=void 0;return true}}))}else{n=r}}if(n){if(isContextuallyTyped(n)){const e=isJSDocTypeAssertion(n)?getJSDocTypeAssertionType(n):isAsExpression(n)||isTypeAssertionExpression(n)?n.type:void 0;if(e&&!isConstTypeReference(e)){return syntacticResult(serializeExistingTypeNode(e,t))}}else{return typeFromExpression(n,t)}}return ds}function isContextuallyTyped(e){return findAncestor(e.parent,(e=>isCallExpression(e)||!isFunctionLikeDeclaration(e)&&!!getEffectiveTypeAnnotationNode(e)||isJsxElement(e)||isJsxExpression(e)))}}var ps={};__export(ps,{NameValidationResult:()=>xs,discoverTypings:()=>discoverTypings,isTypingUpToDate:()=>isTypingUpToDate,loadSafeList:()=>loadSafeList,loadTypesMap:()=>loadTypesMap,nonRelativeModuleNameForTypingCache:()=>nonRelativeModuleNameForTypingCache,renderPackageNameValidationFailure:()=>renderPackageNameValidationFailure,validatePackageName:()=>validatePackageName});var us="action::set";var fs="action::invalidate";var ms="action::packageInstalled";var _s="event::typesRegistry";var gs="event::beginInstallTypes";var ys="event::endInstallTypes";var hs="event::initializationFailed";var Ts="action::watchTypingLocations";var Ss;(e=>{e.GlobalCacheLocation="--globalTypingsCacheLocation";e.LogFile="--logFile";e.EnableTelemetry="--enableTelemetry";e.TypingSafeListLocation="--typingSafeListLocation";e.TypesMapLocation="--typesMapLocation";e.NpmLocation="--npmLocation";e.ValidateDefaultNpmLocation="--validateDefaultNpmLocation"})(Ss||(Ss={}));function hasArgument(e){return Ft.args.includes(e)}function findArgument(e){const t=Ft.args.indexOf(e);return t>=0&&te.readFile(t)));return new Map(Object.entries(n.config))}function loadTypesMap(e,t){var n;const r=readConfigFile(t,(t=>e.readFile(t)));if((n=r.config)==null?void 0:n.simpleMap){return new Map(Object.entries(r.config.simpleMap))}return void 0}function discoverTypings(e,t,n,r,i,o,a,s,c,l){if(!a||!a.enable){return{cachedTypingPaths:[],newTypingNames:[],filesToWatch:[]}}const d=new Map;n=mapDefined(n,(e=>{const t=normalizePath(e);if(hasJSFileExtension(t)){return t}}));const p=[];if(a.include)addInferredTypings(a.include,"Explicitly included types");const u=a.exclude||[];if(!l.types){const e=new Set(n.map(getDirectoryPath));e.add(r);e.forEach((e=>{getTypingNames(e,"bower.json","bower_components",p);getTypingNames(e,"package.json","node_modules",p)}))}if(!a.disableFilenameBasedTypeAcquisition){getTypingNamesFromSourceFileNames(n)}if(s){const e=deduplicate(s.map(nonRelativeModuleNameForTypingCache),equateStringsCaseSensitive,compareStringsCaseSensitive);addInferredTypings(e,"Inferred typings from unresolved imports")}for(const e of u){const n=d.delete(e);if(n&&t)t(`Typing for ${e} is in exclude list, will be ignored.`)}o.forEach(((e,t)=>{const n=c.get(t);if(d.get(t)===false&&n!==void 0&&isTypingUpToDate(e,n)){d.set(t,e.typingLocation)}}));const f=[];const m=[];d.forEach(((e,t)=>{if(e){m.push(e)}else{f.push(t)}}));const _={cachedTypingPaths:m,newTypingNames:f,filesToWatch:p};if(t)t(`Finished typings discovery:${stringifyIndented(_)}`);return _;function addInferredTyping(e){if(!d.has(e)){d.set(e,false)}}function addInferredTypings(e,n){if(t)t(`${n}: ${JSON.stringify(e)}`);forEach(e,addInferredTyping)}function getTypingNames(n,r,i,o){const a=combinePaths(n,r);let s;let c;if(e.fileExists(a)){o.push(a);s=readConfigFile(a,(t=>e.readFile(t))).config;c=flatMap([s.dependencies,s.devDependencies,s.optionalDependencies,s.peerDependencies],getOwnKeys);addInferredTypings(c,`Typing names in '${a}' dependencies`)}const l=combinePaths(n,i);o.push(l);if(!e.directoryExists(l)){return}const p=[];const u=c?c.map((e=>combinePaths(l,e,r))):e.readDirectory(l,[".json"],void 0,void 0,3).filter((e=>{if(getBaseFileName(e)!==r){return false}const t=getPathComponents(normalizePath(e));const n=t[t.length-3][0]==="@";return n&&toFileNameLowerCase(t[t.length-4])===i||!n&&toFileNameLowerCase(t[t.length-3])===i}));if(t)t(`Searching for typing names in ${l}; all files: ${JSON.stringify(u)}`);for(const n of u){const r=normalizePath(n);const i=readConfigFile(r,(t=>e.readFile(t)));const o=i.config;if(!o.name){continue}const a=o.types||o.typings;if(a){const n=getNormalizedAbsolutePath(a,getDirectoryPath(r));if(e.fileExists(n)){if(t)t(` Package '${o.name}' provides its own types.`);d.set(o.name,n)}else{if(t)t(` Package '${o.name}' provides its own types but they are missing.`)}}else{p.push(o.name)}}addInferredTypings(p," Found package names")}function getTypingNamesFromSourceFileNames(e){const n=mapDefined(e,(e=>{if(!hasJSFileExtension(e))return void 0;const t=removeFileExtension(toFileNameLowerCase(getBaseFileName(e)));const n=removeMinAndVersionNumbers(t);return i.get(n)}));if(n.length){addInferredTypings(n,"Inferred typings from file names")}const r=some(e,(e=>fileExtensionIs(e,".jsx")));if(r){if(t)t(`Inferred 'react' typings due to presence of '.jsx' extension`);addInferredTyping("react")}}}var xs=(e=>{e[e["Ok"]=0]="Ok";e[e["EmptyName"]=1]="EmptyName";e[e["NameTooLong"]=2]="NameTooLong";e[e["NameStartsWithDot"]=3]="NameStartsWithDot";e[e["NameStartsWithUnderscore"]=4]="NameStartsWithUnderscore";e[e["NameContainsNonURISafeCharacters"]=5]="NameContainsNonURISafeCharacters";return e})(xs||{});var bs=214;function validatePackageName(e){return validatePackageNameWorker(e,true)}function validatePackageNameWorker(e,t){if(!e){return 1}if(e.length>bs){return 2}if(e.charCodeAt(0)===46){return 3}if(e.charCodeAt(0)===95){return 4}if(t){const t=/^@([^/]+)\/([^/]+)$/.exec(e);if(t){const e=validatePackageNameWorker(t[1],false);if(e!==0){return{name:t[1],isScopeName:true,result:e}}const n=validatePackageNameWorker(t[2],false);if(n!==0){return{name:t[2],isScopeName:false,result:n}}return 0}}if(encodeURIComponent(e)!==e){return 5}return 0}function renderPackageNameValidationFailure(e,t){return typeof e==="object"?renderPackageNameValidationFailureWorker(t,e.result,e.name,e.isScopeName):renderPackageNameValidationFailureWorker(t,e,t,false)}function renderPackageNameValidationFailureWorker(e,t,n,r){const i=r?"Scope":"Package";switch(t){case 1:return`'${e}':: ${i} name '${n}' cannot be empty`;case 2:return`'${e}':: ${i} name '${n}' should be less than ${bs} characters`;case 3:return`'${e}':: ${i} name '${n}' cannot start with '.'`;case 4:return`'${e}':: ${i} name '${n}' cannot start with '_'`;case 5:return`'${e}':: ${i} name '${n}' contains non URI safe characters`;case 0:return S.fail();default:S.assertNever(t)}}var Cs;(e=>{class StringScriptSnapshot{constructor(e){this.text=e}getText(e,t){return e===0&&t===this.text.length?this.text:this.text.substring(e,t)}getLength(){return this.text.length}getChangeRange(){return void 0}}function fromString(e){return new StringScriptSnapshot(e)}e.fromString=fromString})(Cs||(Cs={}));var Es=(e=>{e[e["Dependencies"]=1]="Dependencies";e[e["DevDependencies"]=2]="DevDependencies";e[e["PeerDependencies"]=4]="PeerDependencies";e[e["OptionalDependencies"]=8]="OptionalDependencies";e[e["All"]=15]="All";return e})(Es||{});var Ns=(e=>{e[e["Off"]=0]="Off";e[e["On"]=1]="On";e[e["Auto"]=2]="Auto";return e})(Ns||{});var ks=(e=>{e[e["Semantic"]=0]="Semantic";e[e["PartialSemantic"]=1]="PartialSemantic";e[e["Syntactic"]=2]="Syntactic";return e})(ks||{});var Fs={};var Ps=(e=>{e["Original"]="original";e["TwentyTwenty"]="2020";return e})(Ps||{});var Ds=(e=>{e["All"]="All";e["SortAndCombine"]="SortAndCombine";e["RemoveUnused"]="RemoveUnused";return e})(Ds||{});var Is=(e=>{e[e["Invoked"]=1]="Invoked";e[e["TriggerCharacter"]=2]="TriggerCharacter";e[e["TriggerForIncompleteCompletions"]=3]="TriggerForIncompleteCompletions";return e})(Is||{});var As=(e=>{e["Type"]="Type";e["Parameter"]="Parameter";e["Enum"]="Enum";return e})(As||{});var Os=(e=>{e["none"]="none";e["definition"]="definition";e["reference"]="reference";e["writtenReference"]="writtenReference";return e})(Os||{});var ws=(e=>{e[e["None"]=0]="None";e[e["Block"]=1]="Block";e[e["Smart"]=2]="Smart";return e})(ws||{});var Ls=(e=>{e["Ignore"]="ignore";e["Insert"]="insert";e["Remove"]="remove";return e})(Ls||{});function getDefaultFormatCodeSettings(e){return{indentSize:4,tabSize:4,newLineCharacter:e||"\n",convertTabsToSpaces:true,indentStyle:2,insertSpaceAfterConstructor:false,insertSpaceAfterCommaDelimiter:true,insertSpaceAfterSemicolonInForStatements:true,insertSpaceBeforeAndAfterBinaryOperators:true,insertSpaceAfterKeywordsInControlFlowStatements:true,insertSpaceAfterFunctionKeywordForAnonymousFunctions:false,insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:false,insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:false,insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:true,insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:false,insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces:false,insertSpaceBeforeFunctionParenthesis:false,placeOpenBraceOnNewLineForFunctions:false,placeOpenBraceOnNewLineForControlBlocks:false,semicolons:"ignore",trimTrailingWhitespace:true,indentSwitchCase:true}}var Ms=getDefaultFormatCodeSettings("\n");var Rs=(e=>{e[e["aliasName"]=0]="aliasName";e[e["className"]=1]="className";e[e["enumName"]=2]="enumName";e[e["fieldName"]=3]="fieldName";e[e["interfaceName"]=4]="interfaceName";e[e["keyword"]=5]="keyword";e[e["lineBreak"]=6]="lineBreak";e[e["numericLiteral"]=7]="numericLiteral";e[e["stringLiteral"]=8]="stringLiteral";e[e["localName"]=9]="localName";e[e["methodName"]=10]="methodName";e[e["moduleName"]=11]="moduleName";e[e["operator"]=12]="operator";e[e["parameterName"]=13]="parameterName";e[e["propertyName"]=14]="propertyName";e[e["punctuation"]=15]="punctuation";e[e["space"]=16]="space";e[e["text"]=17]="text";e[e["typeParameterName"]=18]="typeParameterName";e[e["enumMemberName"]=19]="enumMemberName";e[e["functionName"]=20]="functionName";e[e["regularExpressionLiteral"]=21]="regularExpressionLiteral";e[e["link"]=22]="link";e[e["linkName"]=23]="linkName";e[e["linkText"]=24]="linkText";return e})(Rs||{});var Bs=(e=>{e[e["None"]=0]="None";e[e["MayIncludeAutoImports"]=1]="MayIncludeAutoImports";e[e["IsImportStatementCompletion"]=2]="IsImportStatementCompletion";e[e["IsContinuation"]=4]="IsContinuation";e[e["ResolvedModuleSpecifiers"]=8]="ResolvedModuleSpecifiers";e[e["ResolvedModuleSpecifiersBeyondLimit"]=16]="ResolvedModuleSpecifiersBeyondLimit";e[e["MayIncludeMethodSnippets"]=32]="MayIncludeMethodSnippets";return e})(Bs||{});var js=(e=>{e["Comment"]="comment";e["Region"]="region";e["Code"]="code";e["Imports"]="imports";return e})(js||{});var Js=(e=>{e[e["JavaScript"]=0]="JavaScript";e[e["SourceMap"]=1]="SourceMap";e[e["Declaration"]=2]="Declaration";return e})(Js||{});var Ws=(e=>{e[e["None"]=0]="None";e[e["InMultiLineCommentTrivia"]=1]="InMultiLineCommentTrivia";e[e["InSingleQuoteStringLiteral"]=2]="InSingleQuoteStringLiteral";e[e["InDoubleQuoteStringLiteral"]=3]="InDoubleQuoteStringLiteral";e[e["InTemplateHeadOrNoSubstitutionTemplate"]=4]="InTemplateHeadOrNoSubstitutionTemplate";e[e["InTemplateMiddleOrTail"]=5]="InTemplateMiddleOrTail";e[e["InTemplateSubstitutionPosition"]=6]="InTemplateSubstitutionPosition";return e})(Ws||{});var Us=(e=>{e[e["Punctuation"]=0]="Punctuation";e[e["Keyword"]=1]="Keyword";e[e["Operator"]=2]="Operator";e[e["Comment"]=3]="Comment";e[e["Whitespace"]=4]="Whitespace";e[e["Identifier"]=5]="Identifier";e[e["NumberLiteral"]=6]="NumberLiteral";e[e["BigIntLiteral"]=7]="BigIntLiteral";e[e["StringLiteral"]=8]="StringLiteral";e[e["RegExpLiteral"]=9]="RegExpLiteral";return e})(Us||{});var zs=(e=>{e["unknown"]="";e["warning"]="warning";e["keyword"]="keyword";e["scriptElement"]="script";e["moduleElement"]="module";e["classElement"]="class";e["localClassElement"]="local class";e["interfaceElement"]="interface";e["typeElement"]="type";e["enumElement"]="enum";e["enumMemberElement"]="enum member";e["variableElement"]="var";e["localVariableElement"]="local var";e["variableUsingElement"]="using";e["variableAwaitUsingElement"]="await using";e["functionElement"]="function";e["localFunctionElement"]="local function";e["memberFunctionElement"]="method";e["memberGetAccessorElement"]="getter";e["memberSetAccessorElement"]="setter";e["memberVariableElement"]="property";e["memberAccessorVariableElement"]="accessor";e["constructorImplementationElement"]="constructor";e["callSignatureElement"]="call";e["indexSignatureElement"]="index";e["constructSignatureElement"]="construct";e["parameterElement"]="parameter";e["typeParameterElement"]="type parameter";e["primitiveType"]="primitive type";e["label"]="label";e["alias"]="alias";e["constElement"]="const";e["letElement"]="let";e["directory"]="directory";e["externalModuleName"]="external module name";e["jsxAttribute"]="JSX attribute";e["string"]="string";e["link"]="link";e["linkName"]="link name";e["linkText"]="link text";return e})(zs||{});var Vs=(e=>{e["none"]="";e["publicMemberModifier"]="public";e["privateMemberModifier"]="private";e["protectedMemberModifier"]="protected";e["exportedModifier"]="export";e["ambientModifier"]="declare";e["staticModifier"]="static";e["abstractModifier"]="abstract";e["optionalModifier"]="optional";e["deprecatedModifier"]="deprecated";e["dtsModifier"]=".d.ts";e["tsModifier"]=".ts";e["tsxModifier"]=".tsx";e["jsModifier"]=".js";e["jsxModifier"]=".jsx";e["jsonModifier"]=".json";e["dmtsModifier"]=".d.mts";e["mtsModifier"]=".mts";e["mjsModifier"]=".mjs";e["dctsModifier"]=".d.cts";e["ctsModifier"]=".cts";e["cjsModifier"]=".cjs";return e})(Vs||{});var qs=(e=>{e["comment"]="comment";e["identifier"]="identifier";e["keyword"]="keyword";e["numericLiteral"]="number";e["bigintLiteral"]="bigint";e["operator"]="operator";e["stringLiteral"]="string";e["whiteSpace"]="whitespace";e["text"]="text";e["punctuation"]="punctuation";e["className"]="class name";e["enumName"]="enum name";e["interfaceName"]="interface name";e["moduleName"]="module name";e["typeParameterName"]="type parameter name";e["typeAliasName"]="type alias name";e["parameterName"]="parameter name";e["docCommentTagName"]="doc comment tag name";e["jsxOpenTagName"]="jsx open tag name";e["jsxCloseTagName"]="jsx close tag name";e["jsxSelfClosingTagName"]="jsx self closing tag name";e["jsxAttribute"]="jsx attribute";e["jsxText"]="jsx text";e["jsxAttributeStringLiteralValue"]="jsx attribute string literal value";return e})(qs||{});var Hs=(e=>{e[e["comment"]=1]="comment";e[e["identifier"]=2]="identifier";e[e["keyword"]=3]="keyword";e[e["numericLiteral"]=4]="numericLiteral";e[e["operator"]=5]="operator";e[e["stringLiteral"]=6]="stringLiteral";e[e["regularExpressionLiteral"]=7]="regularExpressionLiteral";e[e["whiteSpace"]=8]="whiteSpace";e[e["text"]=9]="text";e[e["punctuation"]=10]="punctuation";e[e["className"]=11]="className";e[e["enumName"]=12]="enumName";e[e["interfaceName"]=13]="interfaceName";e[e["moduleName"]=14]="moduleName";e[e["typeParameterName"]=15]="typeParameterName";e[e["typeAliasName"]=16]="typeAliasName";e[e["parameterName"]=17]="parameterName";e[e["docCommentTagName"]=18]="docCommentTagName";e[e["jsxOpenTagName"]=19]="jsxOpenTagName";e[e["jsxCloseTagName"]=20]="jsxCloseTagName";e[e["jsxSelfClosingTagName"]=21]="jsxSelfClosingTagName";e[e["jsxAttribute"]=22]="jsxAttribute";e[e["jsxText"]=23]="jsxText";e[e["jsxAttributeStringLiteralValue"]=24]="jsxAttributeStringLiteralValue";e[e["bigintLiteral"]=25]="bigintLiteral";return e})(Hs||{});var Gs=createScanner(99,true);var Ks=(e=>{e[e["None"]=0]="None";e[e["Value"]=1]="Value";e[e["Type"]=2]="Type";e[e["Namespace"]=4]="Namespace";e[e["All"]=7]="All";return e})(Ks||{});function getMeaningFromDeclaration(e){switch(e.kind){case 260:return isInJSFile(e)&&getJSDocEnumTag(e)?7:1;case 169:case 208:case 172:case 171:case 303:case 304:case 174:case 173:case 176:case 177:case 178:case 262:case 218:case 219:case 299:case 291:return 1;case 168:case 264:case 265:case 187:return 2;case 346:return e.name===void 0?1|2:2;case 306:case 263:return 1|2;case 267:if(isAmbientModule(e)){return 4|1}else if(getModuleInstanceState(e)===1){return 4|1}else{return 4}case 266:case 275:case 276:case 271:case 272:case 277:case 278:return 7;case 307:return 4|1}return 7}function getMeaningFromLocation(e){e=getAdjustedReferenceLocation(e);const t=e.parent;if(e.kind===307){return 1}else if(isExportAssignment(t)||isExportSpecifier(t)||isExternalModuleReference(t)||isImportSpecifier(t)||isImportClause(t)||isImportEqualsDeclaration(t)&&e===t.name){return 7}else if(isInRightSideOfInternalImportEqualsDeclaration(e)){return getMeaningFromRightHandSideOfImportEquals(e)}else if(isDeclarationName(e)){return getMeaningFromDeclaration(t)}else if(isEntityName(e)&&findAncestor(e,or(isJSDocNameReference,isJSDocLinkLike,isJSDocMemberName))){return 7}else if(isTypeReference(e)){return 2}else if(isNamespaceReference(e)){return 4}else if(isTypeParameterDeclaration(t)){S.assert(isJSDocTemplateTag(t.parent));return 2}else if(isLiteralTypeNode(t)){return 2|1}else{return 1}}function getMeaningFromRightHandSideOfImportEquals(e){const t=e.kind===166?e:isQualifiedName(e.parent)&&e.parent.right===e?e.parent:void 0;return t&&t.parent.kind===271?7:4}function isInRightSideOfInternalImportEqualsDeclaration(e){while(e.parent.kind===166){e=e.parent}return isInternalModuleImportEqualsDeclaration(e.parent)&&e.parent.moduleReference===e}function isNamespaceReference(e){return isQualifiedNameNamespaceReference(e)||isPropertyAccessNamespaceReference(e)}function isQualifiedNameNamespaceReference(e){let t=e;let n=true;if(t.parent.kind===166){while(t.parent&&t.parent.kind===166){t=t.parent}n=t.right===e}return t.parent.kind===183&&!n}function isPropertyAccessNamespaceReference(e){let t=e;let n=true;if(t.parent.kind===211){while(t.parent&&t.parent.kind===211){t=t.parent}n=t.name===e}if(!n&&t.parent.kind===233&&t.parent.parent.kind===298){const e=t.parent.parent.parent;return e.kind===263&&t.parent.parent.token===119||e.kind===264&&t.parent.parent.token===96}return false}function isTypeReference(e){if(isRightSideOfQualifiedNameOrPropertyAccess(e)){e=e.parent}switch(e.kind){case 110:return!isExpressionNode(e);case 197:return true}switch(e.parent.kind){case 183:return true;case 205:return!e.parent.isTypeOf;case 233:return isPartOfTypeNode(e.parent)}return false}function isCallExpressionTarget(e,t=false,n=false){return isCalleeWorker(e,isCallExpression,selectExpressionOfCallOrNewExpressionOrDecorator,t,n)}function isNewExpressionTarget(e,t=false,n=false){return isCalleeWorker(e,isNewExpression,selectExpressionOfCallOrNewExpressionOrDecorator,t,n)}function isCallOrNewExpressionTarget(e,t=false,n=false){return isCalleeWorker(e,isCallOrNewExpression,selectExpressionOfCallOrNewExpressionOrDecorator,t,n)}function isTaggedTemplateTag(e,t=false,n=false){return isCalleeWorker(e,isTaggedTemplateExpression,selectTagOfTaggedTemplateExpression,t,n)}function isDecoratorTarget(e,t=false,n=false){return isCalleeWorker(e,isDecorator,selectExpressionOfCallOrNewExpressionOrDecorator,t,n)}function isJsxOpeningLikeElementTagName(e,t=false,n=false){return isCalleeWorker(e,isJsxOpeningLikeElement,selectTagNameOfJsxOpeningLikeElement,t,n)}function selectExpressionOfCallOrNewExpressionOrDecorator(e){return e.expression}function selectTagOfTaggedTemplateExpression(e){return e.tag}function selectTagNameOfJsxOpeningLikeElement(e){return e.tagName}function isCalleeWorker(e,t,n,r,i){let o=r?climbPastPropertyOrElementAccess(e):climbPastPropertyAccess(e);if(i){o=skipOuterExpressions(o)}return!!o&&!!o.parent&&t(o.parent)&&n(o.parent)===o}function climbPastPropertyAccess(e){return isRightSideOfPropertyAccess(e)?e.parent:e}function climbPastPropertyOrElementAccess(e){return isRightSideOfPropertyAccess(e)||isArgumentExpressionOfElementAccess(e)?e.parent:e}function getTargetLabel(e,t){while(e){if(e.kind===256&&e.label.escapedText===t){return e.label}e=e.parent}return void 0}function hasPropertyAccessExpressionWithName(e,t){if(!isPropertyAccessExpression(e.expression)){return false}return e.expression.name.text===t}function isJumpStatementTarget(e){var t;return isIdentifier(e)&&((t=tryCast(e.parent,isBreakOrContinueStatement))==null?void 0:t.label)===e}function isLabelOfLabeledStatement(e){var t;return isIdentifier(e)&&((t=tryCast(e.parent,isLabeledStatement))==null?void 0:t.label)===e}function isLabelName(e){return isLabelOfLabeledStatement(e)||isJumpStatementTarget(e)}function isTagName(e){var t;return((t=tryCast(e.parent,isJSDocTag))==null?void 0:t.tagName)===e}function isRightSideOfQualifiedName(e){var t;return((t=tryCast(e.parent,isQualifiedName))==null?void 0:t.right)===e}function isRightSideOfPropertyAccess(e){var t;return((t=tryCast(e.parent,isPropertyAccessExpression))==null?void 0:t.name)===e}function isArgumentExpressionOfElementAccess(e){var t;return((t=tryCast(e.parent,isElementAccessExpression))==null?void 0:t.argumentExpression)===e}function isNameOfModuleDeclaration(e){var t;return((t=tryCast(e.parent,isModuleDeclaration))==null?void 0:t.name)===e}function isNameOfFunctionDeclaration(e){var t;return isIdentifier(e)&&((t=tryCast(e.parent,isFunctionLike))==null?void 0:t.name)===e}function isLiteralNameOfPropertyDeclarationOrIndexAccess(e){switch(e.parent.kind){case 172:case 171:case 303:case 306:case 174:case 173:case 177:case 178:case 267:return getNameOfDeclaration(e.parent)===e;case 212:return e.parent.argumentExpression===e;case 167:return true;case 201:return e.parent.parent.kind===199;default:return false}}function isExpressionOfExternalModuleImportEqualsDeclaration(e){return isExternalModuleImportEqualsDeclaration(e.parent.parent)&&getExternalModuleImportEqualsDeclarationExpression(e.parent.parent)===e}function getContainerNode(e){if(isJSDocTypeAlias(e)){e=e.parent.parent}while(true){e=e.parent;if(!e){return void 0}switch(e.kind){case 307:case 174:case 173:case 262:case 218:case 177:case 178:case 263:case 264:case 266:case 267:return e}}}function getNodeKind(e){switch(e.kind){case 307:return isExternalModule(e)?"module":"script";case 267:return"module";case 263:case 231:return"class";case 264:return"interface";case 265:case 338:case 346:return"type";case 266:return"enum";case 260:return getKindOfVariableDeclaration(e);case 208:return getKindOfVariableDeclaration(getRootDeclaration(e));case 219:case 262:case 218:return"function";case 177:return"getter";case 178:return"setter";case 174:case 173:return"method";case 303:const{initializer:t}=e;return isFunctionLike(t)?"method":"property";case 172:case 171:case 304:case 305:return"property";case 181:return"index";case 180:return"construct";case 179:return"call";case 176:case 175:return"constructor";case 168:return"type parameter";case 306:return"enum member";case 169:return hasSyntacticModifier(e,31)?"property":"parameter";case 271:case 276:case 281:case 274:case 280:return"alias";case 226:const n=getAssignmentDeclarationKind(e);const{right:r}=e;switch(n){case 7:case 8:case 9:case 0:return"";case 1:case 2:const e=getNodeKind(r);return e===""?"const":e;case 3:return isFunctionExpression(r)?"method":"property";case 4:return"property";case 5:return isFunctionExpression(r)?"method":"property";case 6:return"local class";default:{assertType(n);return""}}case 80:return isImportClause(e.parent)?"alias":"";case 277:const i=getNodeKind(e.expression);return i===""?"const":i;default:return""}function getKindOfVariableDeclaration(e){return isVarConst(e)?"const":isLet(e)?"let":"var"}}function isThis(e){switch(e.kind){case 110:return true;case 80:return identifierIsThisKeyword(e)&&e.parent.kind===169;default:return false}}var $s=/^\/\/\/\s*=n}function rangeOverlapsWithStartEnd(e,t,n){return startEndOverlapsWithStartEnd(e.pos,e.end,t,n)}function nodeOverlapsWithStartEnd(e,t,n,r){return startEndOverlapsWithStartEnd(e.getStart(t),e.end,n,r)}function startEndOverlapsWithStartEnd(e,t,n,r){const i=Math.max(e,n);const o=Math.min(t,r);return ie.kind===t))}function findContainingList(e){const t=find(e.parent.getChildren(),(t=>isSyntaxList(t)&&rangeContainsRange(t,e)));S.assert(!t||contains(t.getChildren(),e));return t}function isDefaultModifier2(e){return e.kind===90}function isClassKeyword(e){return e.kind===86}function isFunctionKeyword(e){return e.kind===100}function getAdjustedLocationForClass(e){if(isNamedDeclaration(e)){return e.name}if(isClassDeclaration(e)){const t=e.modifiers&&find(e.modifiers,isDefaultModifier2);if(t)return t}if(isClassExpression(e)){const t=find(e.getChildren(),isClassKeyword);if(t)return t}}function getAdjustedLocationForFunction(e){if(isNamedDeclaration(e)){return e.name}if(isFunctionDeclaration(e)){const t=find(e.modifiers,isDefaultModifier2);if(t)return t}if(isFunctionExpression(e)){const t=find(e.getChildren(),isFunctionKeyword);if(t)return t}}function getAncestorTypeNode(e){let t;findAncestor(e,(e=>{if(isTypeNode(e)){t=e}return!isQualifiedName(e.parent)&&!isTypeNode(e.parent)&&!isTypeElement(e.parent)}));return t}function getContextualTypeFromParentOrAncestorTypeNode(e,t){if(e.flags&(16777216&~524288))return void 0;const n=getContextualTypeFromParent(e,t);if(n)return n;const r=getAncestorTypeNode(e);return r&&t.getTypeAtLocation(r)}function getAdjustedLocationForDeclaration(e,t){if(!t){switch(e.kind){case 263:case 231:return getAdjustedLocationForClass(e);case 262:case 218:return getAdjustedLocationForFunction(e);case 176:return e}}if(isNamedDeclaration(e)){return e.name}}function getAdjustedLocationForImportDeclaration(e,t){if(e.importClause){if(e.importClause.name&&e.importClause.namedBindings){return}if(e.importClause.name){return e.importClause.name}if(e.importClause.namedBindings){if(isNamedImports(e.importClause.namedBindings)){const t=singleOrUndefined(e.importClause.namedBindings.elements);if(!t){return}return t.name}else if(isNamespaceImport(e.importClause.namedBindings)){return e.importClause.namedBindings.name}}}if(!t){return e.moduleSpecifier}}function getAdjustedLocationForExportDeclaration(e,t){if(e.exportClause){if(isNamedExports(e.exportClause)){const t=singleOrUndefined(e.exportClause.elements);if(!t){return}return e.exportClause.elements[0].name}else if(isNamespaceExport(e.exportClause)){return e.exportClause.name}}if(!t){return e.moduleSpecifier}}function getAdjustedLocationForHeritageClause(e){if(e.types.length===1){return e.types[0].expression}}function getAdjustedLocation(e,t){const{parent:n}=e;if(isModifier(e)&&(t||e.kind!==90)?canHaveModifiers(n)&&contains(n.modifiers,e):e.kind===86?isClassDeclaration(n)||isClassExpression(e):e.kind===100?isFunctionDeclaration(n)||isFunctionExpression(e):e.kind===120?isInterfaceDeclaration(n):e.kind===94?isEnumDeclaration(n):e.kind===156?isTypeAliasDeclaration(n):e.kind===145||e.kind===144?isModuleDeclaration(n):e.kind===102?isImportEqualsDeclaration(n):e.kind===139?isGetAccessorDeclaration(n):e.kind===153&&isSetAccessorDeclaration(n)){const e=getAdjustedLocationForDeclaration(n,t);if(e){return e}}if((e.kind===115||e.kind===87||e.kind===121)&&isVariableDeclarationList(n)&&n.declarations.length===1){const e=n.declarations[0];if(isIdentifier(e.name)){return e.name}}if(e.kind===156){if(isImportClause(n)&&n.isTypeOnly){const e=getAdjustedLocationForImportDeclaration(n.parent,t);if(e){return e}}if(isExportDeclaration(n)&&n.isTypeOnly){const e=getAdjustedLocationForExportDeclaration(n,t);if(e){return e}}}if(e.kind===130){if(isImportSpecifier(n)&&n.propertyName||isExportSpecifier(n)&&n.propertyName||isNamespaceImport(n)||isNamespaceExport(n)){return n.name}if(isExportDeclaration(n)&&n.exportClause&&isNamespaceExport(n.exportClause)){return n.exportClause.name}}if(e.kind===102&&isImportDeclaration(n)){const e=getAdjustedLocationForImportDeclaration(n,t);if(e){return e}}if(e.kind===95){if(isExportDeclaration(n)){const e=getAdjustedLocationForExportDeclaration(n,t);if(e){return e}}if(isExportAssignment(n)){return skipOuterExpressions(n.expression)}}if(e.kind===149&&isExternalModuleReference(n)){return n.expression}if(e.kind===161&&(isImportDeclaration(n)||isExportDeclaration(n))&&n.moduleSpecifier){return n.moduleSpecifier}if((e.kind===96||e.kind===119)&&isHeritageClause(n)&&n.token===e.kind){const e=getAdjustedLocationForHeritageClause(n);if(e){return e}}if(e.kind===96){if(isTypeParameterDeclaration(n)&&n.constraint&&isTypeReferenceNode(n.constraint)){return n.constraint.typeName}if(isConditionalTypeNode(n)&&isTypeReferenceNode(n.extendsType)){return n.extendsType.typeName}}if(e.kind===140&&isInferTypeNode(n)){return n.typeParameter.name}if(e.kind===103&&isTypeParameterDeclaration(n)&&isMappedTypeNode(n.parent)){return n.name}if(e.kind===143&&isTypeOperatorNode(n)&&n.operator===143&&isTypeReferenceNode(n.type)){return n.type.typeName}if(e.kind===148&&isTypeOperatorNode(n)&&n.operator===148&&isArrayTypeNode(n.type)&&isTypeReferenceNode(n.type.elementType)){return n.type.elementType.typeName}if(!t){if(e.kind===105&&isNewExpression(n)||e.kind===116&&isVoidExpression(n)||e.kind===114&&isTypeOfExpression(n)||e.kind===135&&isAwaitExpression(n)||e.kind===127&&isYieldExpression(n)||e.kind===91&&isDeleteExpression(n)){if(n.expression){return skipOuterExpressions(n.expression)}}if((e.kind===103||e.kind===104)&&isBinaryExpression(n)&&n.operatorToken===e){return skipOuterExpressions(n.right)}if(e.kind===130&&isAsExpression(n)&&isTypeReferenceNode(n.type)){return n.type.typeName}if(e.kind===103&&isForInStatement(n)||e.kind===165&&isForOfStatement(n)){return skipOuterExpressions(n.expression)}}return e}function getAdjustedReferenceLocation(e){return getAdjustedLocation(e,false)}function getAdjustedRenameLocation(e){return getAdjustedLocation(e,true)}function getTouchingPropertyName(e,t){return getTouchingToken(e,t,(e=>isPropertyNameLiteral(e)||isKeyword(e.kind)||isPrivateIdentifier(e)))}function getTouchingToken(e,t,n){return getTokenAtPositionWorker(e,t,false,n,false)}function getTokenAtPosition(e,t){return getTokenAtPositionWorker(e,t,true,void 0,false)}function getTokenAtPositionWorker(e,t,n,r,i){let o=e;let a;e:while(true){const i=o.getChildren(e);const s=binarySearchKey(i,t,((e,t)=>t),((o,a)=>{const s=i[o].getEnd();if(st){return 1}if(nodeContainsPosition(i[o],c,s)){if(i[o-1]){if(nodeContainsPosition(i[o-1])){return 1}}return 0}if(r&&c===t&&i[o-1]&&i[o-1].getEnd()===t&&nodeContainsPosition(i[o-1])){return 1}return-1}));if(a){return a}if(s>=0&&i[s]){o=i[s];continue e}return o}function nodeContainsPosition(o,s,c){c??(c=o.getEnd());if(ct){return false}if(tn.getStart(e)&&t{const r=t.pos<=e.pos&&t.end>e.end||t.pos===e.end;return r&&nodeHasTokens(t,n)?find2(t):void 0}))}}function findPrecedingToken(e,t,n,r){const i=find2(n||t);S.assert(!(i&&isWhiteSpaceOnlyJsxText(i)));return i;function find2(i){if(isNonWhitespaceToken(i)&&i.kind!==1){return i}const o=i.getChildren(t);const a=binarySearchKey(o,e,((e,t)=>t),((t,n)=>{if(e=o[t-1].end){return 0}return 1}return-1}));if(a>=0&&o[a]){const n=o[a];if(e=e||!nodeHasTokens(n,t)||isWhiteSpaceOnlyJsxText(n);if(c){const e=findRightmostChildNodeWithTokens(o,a,t,i.kind);if(e){if(!r&&isJSDocCommentContainingNode(e)&&e.getChildren(t).length){return find2(e)}return findRightmostToken(e,t)}return void 0}else{return find2(n)}}}S.assert(n!==void 0||i.kind===307||i.kind===1||isJSDocCommentContainingNode(i));const s=findRightmostChildNodeWithTokens(o,o.length,t,i.kind);return s&&findRightmostToken(s,t)}}function isNonWhitespaceToken(e){return isToken(e)&&!isWhiteSpaceOnlyJsxText(e)}function findRightmostToken(e,t){if(isNonWhitespaceToken(e)){return e}const n=e.getChildren(t);if(n.length===0){return e}const r=findRightmostChildNodeWithTokens(n,n.length,t,e.kind);return r&&findRightmostToken(r,t)}function findRightmostChildNodeWithTokens(e,t,n,r){for(let i=t-1;i>=0;i--){const t=e[i];if(isWhiteSpaceOnlyJsxText(t)){if(i===0&&(r===12||r===285)){S.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`")}}else if(nodeHasTokens(e[i],n)){return e[i]}}}function isInString(e,t,n=findPrecedingToken(t,e)){if(n&&isStringTextContainingNode(n)){const r=n.getStart(e);const i=n.getEnd();if(rn.getStart(e)}function isInJSXText(e,t){const n=getTokenAtPosition(e,t);if(isJsxText(n)){return true}if(n.kind===19&&isJsxExpression(n.parent)&&isJsxElement(n.parent.parent)){return true}if(n.kind===30&&isJsxOpeningLikeElement(n.parent)&&isJsxElement(n.parent.parent)){return true}return false}function isInsideJsxElement(e,t){function isInsideJsxElementTraversal(n){while(n){if(n.kind>=285&&n.kind<=294||n.kind===12||n.kind===30||n.kind===32||n.kind===80||n.kind===20||n.kind===19||n.kind===44){n=n.parent}else if(n.kind===284){if(t>n.getStart(e))return true;n=n.parent}else{return false}}return false}return isInsideJsxElementTraversal(getTokenAtPosition(e,t))}function findPrecedingMatchingToken(e,t,n){const r=tokenToString(e.kind);const i=tokenToString(t);const o=e.getFullStart();const a=n.text.lastIndexOf(i,o);if(a===-1){return void 0}if(n.text.lastIndexOf(r,o-1)!!e.typeParameters&&e.typeParameters.length>=t))}function getPossibleTypeArgumentsInfo(e,t){if(t.text.lastIndexOf("<",e?e.pos:t.text.length)===-1){return void 0}let n=e;let r=0;let i=0;while(n){switch(n.kind){case 30:n=findPrecedingToken(n.getFullStart(),t);if(n&&n.kind===29){n=findPrecedingToken(n.getFullStart(),t)}if(!n||!isIdentifier(n))return void 0;if(!r){return isDeclarationName(n)?void 0:{called:n,nTypeArguments:i}}r--;break;case 50:r=3;break;case 49:r=2;break;case 32:r++;break;case 20:n=findPrecedingMatchingToken(n,19,t);if(!n)return void 0;break;case 22:n=findPrecedingMatchingToken(n,21,t);if(!n)return void 0;break;case 24:n=findPrecedingMatchingToken(n,23,t);if(!n)return void 0;break;case 28:i++;break;case 39:case 80:case 11:case 9:case 10:case 112:case 97:case 114:case 96:case 143:case 25:case 52:case 58:case 59:break;default:if(isTypeNode(n)){break}return void 0}n=findPrecedingToken(n.getFullStart(),t)}return void 0}function isInComment(e,t,n){return hm.getRangeOfEnclosingComment(e,t,void 0,n)}function hasDocComment(e,t){const n=getTokenAtPosition(e,t);return!!findAncestor(n,isJSDoc)}function nodeHasTokens(e,t){return e.kind===1?!!e.jsDoc:e.getWidth(t)!==0}function getNodeModifiers(e,t=0){const n=[];const r=isDeclaration(e)?getCombinedNodeFlagsAlwaysIncludeJSDoc(e)&~t:0;if(r&2)n.push("private");if(r&4)n.push("protected");if(r&1)n.push("public");if(r&256||isClassStaticBlockDeclaration(e))n.push("static");if(r&64)n.push("abstract");if(r&32)n.push("export");if(r&65536)n.push("deprecated");if(e.flags&33554432)n.push("declare");if(e.kind===277)n.push("export");return n.length>0?n.join(","):""}function getTypeArgumentOrTypeParameterList(e){if(e.kind===183||e.kind===213){return e.typeArguments}if(isFunctionLike(e)||e.kind===263||e.kind===264){return e.typeParameters}return void 0}function isComment(e){return e===2||e===3}function isStringOrRegularExpressionOrTemplateLiteral(e){if(e===11||e===14||isTemplateLiteralKind(e)){return true}return false}function areIntersectedTypesAvoidingStringReduction(e,t,n){return!!(t.flags&4)&&e.isEmptyAnonymousObjectType(n)}function isStringAndEmptyAnonymousObjectIntersection(e){if(!e.isIntersection()){return false}const{types:t,checker:n}=e;return t.length===2&&(areIntersectedTypesAvoidingStringReduction(n,t[0],t[1])||areIntersectedTypesAvoidingStringReduction(n,t[1],t[0]))}function isInsideTemplateLiteral(e,t,n){return isTemplateLiteralKind(e.kind)&&(e.getStart(n){const n=getNodeId(t);return!e[n]&&(e[n]=true)}}function getSnapshotText(e){return e.getText(0,e.getLength())}function repeatString(e,t){let n="";for(let r=0;r!t.isDeclarationFile&&!e.isSourceFileFromExternalLibrary(t)&&!!(t.externalModuleIndicator||t.commonJsModuleIndicator)))}function programContainsEsModules(e){return e.getSourceFiles().some((t=>!t.isDeclarationFile&&!e.isSourceFileFromExternalLibrary(t)&&!!t.externalModuleIndicator))}function compilerOptionsIndicateEsModules(e){return!!e.module||zn(e)>=2||!!e.noEmit}function createModuleSpecifierResolutionHost(e,t){return{fileExists:t=>e.fileExists(t),getCurrentDirectory:()=>t.getCurrentDirectory(),readFile:maybeBind(t,t.readFile),useCaseSensitiveFileNames:maybeBind(t,t.useCaseSensitiveFileNames)||e.useCaseSensitiveFileNames,getSymlinkCache:maybeBind(t,t.getSymlinkCache)||e.getSymlinkCache,getModuleSpecifierCache:maybeBind(t,t.getModuleSpecifierCache),getPackageJsonInfoCache:()=>{var t;return(t=e.getModuleResolutionCache())==null?void 0:t.getPackageJsonInfoCache()},getGlobalTypingsCacheLocation:maybeBind(t,t.getGlobalTypingsCacheLocation),redirectTargetsMap:e.redirectTargetsMap,getProjectReferenceRedirect:t=>e.getProjectReferenceRedirect(t),isSourceOfProjectReferenceRedirect:t=>e.isSourceOfProjectReferenceRedirect(t),getNearestAncestorDirectoryWithPackageJson:maybeBind(t,t.getNearestAncestorDirectoryWithPackageJson),getFileIncludeReasons:()=>e.getFileIncludeReasons(),getCommonSourceDirectory:()=>e.getCommonSourceDirectory(),getDefaultResolutionModeForFile:t=>e.getDefaultResolutionModeForFile(t),getModeForResolutionAtIndex:(t,n)=>e.getModeForResolutionAtIndex(t,n)}}function getModuleSpecifierResolverHost(e,t){return{...createModuleSpecifierResolutionHost(e,t),getCommonSourceDirectory:()=>e.getCommonSourceDirectory()}}function moduleResolutionUsesNodeModules(e){return e===2||e>=3&&e<=99||e===100}function makeImport(e,t,n,r,i){return zr.createImportDeclaration(void 0,e||t?zr.createImportClause(!!i,e,t&&t.length?zr.createNamedImports(t):void 0):void 0,typeof n==="string"?makeStringLiteral(n,r):n,void 0)}function makeStringLiteral(e,t){return zr.createStringLiteral(e,t===0)}var Xs=(e=>{e[e["Single"]=0]="Single";e[e["Double"]=1]="Double";return e})(Xs||{});function quotePreferenceFromString(e,t){return isStringDoubleQuoted(e,t)?1:0}function getQuotePreference(e,t){if(t.quotePreference&&t.quotePreference!=="auto"){return t.quotePreference==="single"?0:1}else{const t=isFullSourceFile(e)&&e.imports&&find(e.imports,(e=>isStringLiteral(e)&&!nodeIsSynthesized(e.parent)));return t?quotePreferenceFromString(t,e):1}}function getQuoteFromPreference(e){switch(e){case 0:return"'";case 1:return'"';default:return S.assertNever(e)}}function symbolNameNoDefault(e){const t=symbolEscapedNameNoDefault(e);return t===void 0?void 0:unescapeLeadingUnderscores(t)}function symbolEscapedNameNoDefault(e){if(e.escapedName!=="default"){return e.escapedName}return firstDefined(e.declarations,(e=>{const t=getNameOfDeclaration(e);return t&&t.kind===80?t.escapedText:void 0}))}function isModuleSpecifierLike(e){return isStringLiteralLike(e)&&(isExternalModuleReference(e.parent)||isImportDeclaration(e.parent)||isJSDocImportTag(e.parent)||isRequireCall(e.parent,false)&&e.parent.arguments[0]===e||isImportCall(e.parent)&&e.parent.arguments[0]===e)}function isObjectBindingElementWithoutPropertyName(e){return isBindingElement(e)&&isObjectBindingPattern(e.parent)&&isIdentifier(e.name)&&!e.propertyName}function getPropertySymbolFromBindingElement(e,t){const n=e.getTypeAtLocation(t.parent);return n&&e.getPropertyOfType(n,t.name.text)}function getParentNodeInSpan(e,t,n){if(!e)return void 0;while(e.parent){if(isSourceFile(e.parent)||!spanContainsNode(n,e.parent,t)){return e}e=e.parent}}function spanContainsNode(e,t,n){return textSpanContainsPosition(e,t.getStart(n))&&t.getEnd()<=textSpanEnd(e)}function findModifier(e,t){return canHaveModifiers(e)?find(e.modifiers,(e=>e.kind===t)):void 0}function insertImports(e,t,n,r,i){var o;const a=isArray(n)?n[0]:n;const s=a.kind===243?isRequireVariableStatement:isAnyImportSyntax;const c=filter(t.statements,s);const{comparer:l,isSorted:d}=Zf.getOrganizeImportsStringComparerWithDetection(c,i);const p=isArray(n)?toSorted(n,((e,t)=>Zf.compareImportsOrRequireStatements(e,t,l))):[n];if(!(c==null?void 0:c.length)){if(isFullSourceFile(t)){e.insertNodesAtTopOfFile(t,p,r)}else{for(const n of p){e.insertStatementsInNewFile(t.fileName,[n],(o=getOriginalNode(n))==null?void 0:o.getSourceFile())}}return}S.assert(isFullSourceFile(t));if(c&&d){for(const n of p){const r=Zf.getImportDeclarationInsertionIndex(c,n,l);if(r===0){const r=c[0]===t.statements[0]?{leadingTriviaOption:dm.LeadingTriviaOption.Exclude}:{};e.insertNodeBefore(t,c[0],n,false,r)}else{const i=c[r-1];e.insertNodeAfter(t,i,n)}}}else{const n=lastOrUndefined(c);if(n){e.insertNodesAfter(t,n,p)}else{e.insertNodesAtTopOfFile(t,p,r)}}}function getTypeKeywordOfTypeOnlyImport(e,t){S.assert(e.isTypeOnly);return cast(e.getChildAt(0,t),isTypeKeywordToken)}function textSpansEqual(e,t){return!!e&&!!t&&e.start===t.start&&e.length===t.length}function documentSpansEqual(e,t,n){return(n?equateStringsCaseSensitive:equateStringsCaseInsensitive)(e.fileName,t.fileName)&&textSpansEqual(e.textSpan,t.textSpan)}function getDocumentSpansEqualityComparer(e){return(t,n)=>documentSpansEqual(t,n,e)}function forEachUnique(e,t){if(e){for(let n=0;nisParameter(e)?true:isBindingElement(e)||isObjectBindingPattern(e)||isArrayBindingPattern(e)?false:"quit"))}var Ys=getDisplayPartWriter();function getDisplayPartWriter(){const e=ln*10;let t;let n;let r;let i;resetWriter();const unknownWrite=e=>writeKind(e,17);return{displayParts:()=>{const n=t.length&&t[t.length-1].text;if(i>e&&n&&n!=="..."){if(!isWhiteSpaceLike(n.charCodeAt(n.length-1))){t.push(displayPart(" ",16))}t.push(displayPart("...",15))}return t},writeKeyword:e=>writeKind(e,5),writeOperator:e=>writeKind(e,12),writePunctuation:e=>writeKind(e,15),writeTrailingSemicolon:e=>writeKind(e,15),writeSpace:e=>writeKind(e,16),writeStringLiteral:e=>writeKind(e,8),writeParameter:e=>writeKind(e,13),writeProperty:e=>writeKind(e,14),writeLiteral:e=>writeKind(e,8),writeSymbol:writeSymbol,writeLine:writeLine,write:unknownWrite,writeComment:unknownWrite,getText:()=>"",getTextPos:()=>0,getColumn:()=>0,getLine:()=>0,isAtStartOfLine:()=>false,hasTrailingWhitespace:()=>false,hasTrailingComment:()=>false,rawWrite:notImplemented,getIndent:()=>r,increaseIndent:()=>{r++},decreaseIndent:()=>{r--},clear:resetWriter};function writeIndent(){if(i>e)return;if(n){const e=getIndentString(r);if(e){i+=e.length;t.push(displayPart(e,16))}n=false}}function writeKind(n,r){if(i>e)return;writeIndent();i+=n.length;t.push(displayPart(n,r))}function writeSymbol(n,r){if(i>e)return;writeIndent();i+=n.length;t.push(symbolPart(n,r))}function writeLine(){if(i>e)return;i+=1;t.push(lineBreakPart());n=true}function resetWriter(){t=[];n=true;r=0;i=0}}function symbolPart(e,t){return displayPart(e,displayPartKind(t));function displayPartKind(e){const t=e.flags;if(t&3){return isFirstDeclarationOfSymbolParameter(e)?13:9}if(t&4)return 14;if(t&32768)return 14;if(t&65536)return 14;if(t&8)return 19;if(t&16)return 20;if(t&32)return 1;if(t&64)return 4;if(t&384)return 2;if(t&1536)return 11;if(t&8192)return 10;if(t&262144)return 18;if(t&524288)return 0;if(t&2097152)return 0;return 17}}function displayPart(e,t){return{text:e,kind:Rs[t]}}function spacePart(){return displayPart(" ",16)}function keywordPart(e){return displayPart(tokenToString(e),5)}function punctuationPart(e){return displayPart(tokenToString(e),15)}function operatorPart(e){return displayPart(tokenToString(e),12)}function parameterNamePart(e){return displayPart(e,13)}function propertyNamePart(e){return displayPart(e,14)}function textOrKeywordPart(e){const t=stringToToken(e);return t===void 0?textPart(e):keywordPart(t)}function textPart(e){return displayPart(e,17)}function typeAliasNamePart(e){return displayPart(e,0)}function typeParameterNamePart(e){return displayPart(e,18)}function linkTextPart(e){return displayPart(e,24)}function linkNamePart(e,t){return{text:e,kind:Rs[23],target:{fileName:getSourceFileOfNode(t).fileName,textSpan:createTextSpanFromNode(t)}}}function linkPart(e){return displayPart(e,22)}function buildLinkParts(e,t){var n;const r=isJSDocLink(e)?"link":isJSDocLinkCode(e)?"linkcode":"linkplain";const i=[linkPart(`{@${r} `)];if(!e.name){if(e.text){i.push(linkTextPart(e.text))}}else{const r=t==null?void 0:t.getSymbolAtLocation(e.name);const o=r&&t?getSymbolTarget(r,t):void 0;const a=findLinkNameEnd(e.text);const s=getTextOfNode(e.name)+e.text.slice(0,a);const c=skipSeparatorFromLinkText(e.text.slice(a));const l=(o==null?void 0:o.valueDeclaration)||((n=o==null?void 0:o.declarations)==null?void 0:n[0]);if(l){i.push(linkNamePart(s,l));if(c)i.push(linkTextPart(c))}else{const t=a===0||e.text.charCodeAt(a)===124&&s.charCodeAt(s.length-1)!==32?" ":"";i.push(linkTextPart(s+t+c))}}i.push(linkPart("}"));return i}function skipSeparatorFromLinkText(e){let t=0;if(e.charCodeAt(t++)===124){while(t")t--;n++;if(!t)return n}}return 0}var Zs="\n";function getNewLineOrDefaultFromHost(e,t){var n;return(t==null?void 0:t.newLineCharacter)||((n=e.getNewLine)==null?void 0:n.call(e))||Zs}function lineBreakPart(){return displayPart("\n",6)}function mapToDisplayParts(e){try{e(Ys);return Ys.displayParts()}finally{Ys.clear()}}function typeToDisplayParts(e,t,n,r=0){return mapToDisplayParts((i=>{e.writeType(t,n,r|1024|16384,i)}))}function symbolToDisplayParts(e,t,n,r,i=0){return mapToDisplayParts((o=>{e.writeSymbol(t,n,r,i|8,o)}))}function signatureToDisplayParts(e,t,n,r=0){r|=16384|1024|32|8192;return mapToDisplayParts((i=>{e.writeSignature(t,n,r,void 0,i)}))}function isImportOrExportSpecifierName(e){return!!e.parent&&isImportOrExportSpecifier(e.parent)&&e.parent.propertyName===e}function getScriptKind(e,t){return ensureScriptKind(e,t.getScriptKind&&t.getScriptKind(e))}function getSymbolTarget(e,t){let n=e;while(isAliasSymbol(n)||isTransientSymbol(n)&&n.links.target){if(isTransientSymbol(n)&&n.links.target){n=n.links.target}else{n=skipAlias(n,t)}}return n}function isAliasSymbol(e){return(e.flags&2097152)!==0}function getUniqueSymbolId(e,t){return getSymbolId(skipAlias(e,t))}function getFirstNonSpaceCharacterPosition(e,t){while(isWhiteSpaceLike(e.charCodeAt(t))){t+=1}return t}function getPrecedingNonSpaceCharacterPosition(e,t){while(t>-1&&isWhiteSpaceSingleLine(e.charCodeAt(t))){t-=1}return t+1}function getSynthesizedDeepClone(e,t=true){const n=e&&getSynthesizedDeepCloneWorker(e);if(n&&!t)suppressLeadingAndTrailingTrivia(n);return setParentRecursive(n,false)}function getSynthesizedDeepCloneWithReplacements(e,t,n){let r=n(e);if(r){setOriginalNode(r,e)}else{r=getSynthesizedDeepCloneWorker(e,n)}if(r&&!t)suppressLeadingAndTrailingTrivia(r);return r}function getSynthesizedDeepCloneWorker(e,t){const n=t?e=>getSynthesizedDeepCloneWithReplacements(e,true,t):getSynthesizedDeepClone;const r=t?e=>e&&getSynthesizedDeepClonesWithReplacements(e,true,t):e=>e&&getSynthesizedDeepClones(e);const i=visitEachChild(e,n,void 0,r,n);if(i===e){const t=isStringLiteral(e)?setOriginalNode(zr.createStringLiteralFromNode(e),e):isNumericLiteral(e)?setOriginalNode(zr.createNumericLiteral(e.text,e.numericLiteralFlags),e):zr.cloneNode(e);return setTextRange(t,e)}i.parent=void 0;return i}function getSynthesizedDeepClones(e,t=true){if(e){const n=zr.createNodeArray(e.map((e=>getSynthesizedDeepClone(e,t))),e.hasTrailingComma);setTextRange(n,e);return n}return e}function getSynthesizedDeepClonesWithReplacements(e,t,n){return zr.createNodeArray(e.map((e=>getSynthesizedDeepCloneWithReplacements(e,t,n))),e.hasTrailingComma)}function suppressLeadingAndTrailingTrivia(e){suppressLeadingTrivia(e);suppressTrailingTrivia(e)}function suppressLeadingTrivia(e){addEmitFlagsRecursively(e,1024,getFirstChild)}function suppressTrailingTrivia(e){addEmitFlagsRecursively(e,2048,getLastChild)}function copyComments(e,t){const n=e.getSourceFile();const r=n.text;if(hasLeadingLineBreak(e,r)){copyLeadingComments(e,t,n)}else{copyTrailingAsLeadingComments(e,t,n)}copyTrailingComments(e,t,n)}function hasLeadingLineBreak(e,t){const n=e.getFullStart();const r=e.getStart();for(let e=n;ee))}function getUniqueName(e,t){let n=e;for(let r=1;!isFileLevelUniqueName(t,n);r++){n=`${e}_${r}`}return n}function getRenameLocation(e,t,n,r){let i=0;let o=-1;for(const{fileName:a,textChanges:s}of e){S.assert(a===t);for(const e of s){const{span:t,newText:a}=e;const s=indexInTextChange(a,escapeString(n));if(s!==-1){o=t.start+i+s;if(!r){return o}}i+=a.length-t.length}}S.assert(r);S.assert(o>=0);return o}function copyLeadingComments(e,t,n,r,i){forEachLeadingCommentRange(n.text,e.pos,getAddCommentsFunction(t,n,r,i,addSyntheticLeadingComment))}function copyTrailingComments(e,t,n,r,i){forEachTrailingCommentRange(n.text,e.end,getAddCommentsFunction(t,n,r,i,addSyntheticTrailingComment))}function copyTrailingAsLeadingComments(e,t,n,r,i){forEachTrailingCommentRange(n.text,e.pos,getAddCommentsFunction(t,n,r,i,addSyntheticLeadingComment))}function getAddCommentsFunction(e,t,n,r,i){return(o,a,s,c)=>{if(s===3){o+=2;a-=2}else{o+=2}i(e,n||s,t.text.slice(o,a),r!==void 0?r:c)}}function indexInTextChange(e,t){if(startsWith(e,t))return 0;let n=e.indexOf(" "+t);if(n===-1)n=e.indexOf("."+t);if(n===-1)n=e.indexOf('"'+t);return n===-1?-1:n+1}function needsParentheses(e){return isBinaryExpression(e)&&e.operatorToken.kind===28||isObjectLiteralExpression(e)||(isAsExpression(e)||isSatisfiesExpression(e))&&isObjectLiteralExpression(e.expression)}function getContextualTypeFromParent(e,t,n){const r=walkUpParenthesizedExpressions(e.parent);switch(r.kind){case 214:return t.getContextualType(r,n);case 226:{const{left:i,operatorToken:o,right:a}=r;return isEqualityOperatorKind(o.kind)?t.getTypeAtLocation(e===a?i:a):t.getContextualType(e,n)}case 296:return getSwitchedType(r,t);default:return t.getContextualType(e,n)}}function quote(e,t,n){const r=getQuotePreference(e,t);const i=JSON.stringify(n);return r===0?`'${stripQuotes(i).replace(/'/g,(()=>"\\'")).replace(/\\"/g,'"')}'`:i}function isEqualityOperatorKind(e){switch(e){case 37:case 35:case 38:case 36:return true;default:return false}}function isStringLiteralOrTemplate(e){switch(e.kind){case 11:case 15:case 228:case 215:return true;default:return false}}function hasIndexSignature(e){return!!e.getStringIndexType()||!!e.getNumberIndexType()}function getSwitchedType(e,t){return t.getTypeAtLocation(e.parent.parent.expression)}var ec="anonymous function";function getTypeNodeIfAccessible(e,t,n,r){const i=n.getTypeChecker();let o=true;const notAccessible=()=>o=false;const a=i.typeToTypeNode(e,t,1,8,{trackSymbol:(e,t,n)=>{o=o&&i.isSymbolAccessible(e,t,n,false).accessibility===0;return!o},reportInaccessibleThisError:notAccessible,reportPrivateInBaseOfClassExpression:notAccessible,reportInaccessibleUniqueSymbolError:notAccessible,moduleResolverHost:getModuleSpecifierResolverHost(n,r)});return o?a:void 0}function syntaxRequiresTrailingCommaOrSemicolonOrASI(e){return e===179||e===180||e===181||e===171||e===173}function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(e){return e===262||e===176||e===174||e===177||e===178}function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(e){return e===267}function syntaxRequiresTrailingSemicolonOrASI(e){return e===243||e===244||e===246||e===251||e===252||e===253||e===257||e===259||e===172||e===265||e===272||e===271||e===278||e===270||e===277}var tc=or(syntaxRequiresTrailingCommaOrSemicolonOrASI,syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI,syntaxRequiresTrailingModuleBlockOrSemicolonOrASI,syntaxRequiresTrailingSemicolonOrASI);function nodeIsASICandidate(e,t){const n=e.getLastToken(t);if(n&&n.kind===27){return false}if(syntaxRequiresTrailingCommaOrSemicolonOrASI(e.kind)){if(n&&n.kind===28){return false}}else if(syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(e.kind)){const n=last(e.getChildren(t));if(n&&isModuleBlock(n)){return false}}else if(syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(e.kind)){const n=last(e.getChildren(t));if(n&&isFunctionBlock(n)){return false}}else if(!syntaxRequiresTrailingSemicolonOrASI(e.kind)){return false}if(e.kind===246){return true}const r=findAncestor(e,(e=>!e.parent));const i=findNextToken(e,r,t);if(!i||i.kind===20){return true}const o=t.getLineAndCharacterOfPosition(e.getEnd()).line;const a=t.getLineAndCharacterOfPosition(i.getStart(t)).line;return o!==a}function positionIsASICandidate(e,t,n){const r=findAncestor(t,(t=>{if(t.end!==e){return"quit"}return tc(t.kind)}));return!!r&&nodeIsASICandidate(r,n)}function probablyUsesSemicolons(e){let t=0;let n=0;const r=5;forEachChild(e,(function visit(i){if(syntaxRequiresTrailingSemicolonOrASI(i.kind)){const r=i.getLastToken(e);if((r==null?void 0:r.kind)===27){t++}else{n++}}else if(syntaxRequiresTrailingCommaOrSemicolonOrASI(i.kind)){const r=i.getLastToken(e);if((r==null?void 0:r.kind)===27){t++}else if(r&&r.kind!==28){const t=getLineAndCharacterOfPosition(e,r.getStart(e)).line;const i=getLineAndCharacterOfPosition(e,getSpanOfTokenAtPosition(e,r.end).start).line;if(t!==i){n++}}}if(t+n>=r){return true}return forEachChild(i,visit)}));if(t===0&&n<=1){return true}return t/n>1/r}function tryGetDirectories(e,t){return tryIOAndConsumeErrors(e,e.getDirectories,t)||[]}function tryReadDirectory(e,t,n,r,i){return tryIOAndConsumeErrors(e,e.readDirectory,t,n,r,i)||d}function tryFileExists(e,t){return tryIOAndConsumeErrors(e,e.fileExists,t)}function tryDirectoryExists(e,t){return tryAndIgnoreErrors((()=>directoryProbablyExists(t,e)))||false}function tryAndIgnoreErrors(e){try{return e()}catch{return void 0}}function tryIOAndConsumeErrors(e,t,...n){return tryAndIgnoreErrors((()=>t&&t.apply(e,n)))}function findPackageJsons(e,t){const n=[];forEachAncestorDirectoryStoppingAtGlobalCache(t,e,(e=>{const r=combinePaths(e,"package.json");if(tryFileExists(t,r)){n.push(r)}}));return n}function findPackageJson(e,t){let n;forEachAncestorDirectoryStoppingAtGlobalCache(t,e,(e=>{if(e==="node_modules")return true;n=findConfigFile(e,(e=>tryFileExists(t,e)),"package.json");if(n){return true}}));return n}function getPackageJsonsVisibleToFile(e,t){if(!t.fileExists){return[]}const n=[];forEachAncestorDirectoryStoppingAtGlobalCache(t,getDirectoryPath(e),(e=>{const r=combinePaths(e,"package.json");if(t.fileExists(r)){const e=createPackageJsonInfo(r,t);if(e){n.push(e)}}}));return n}function createPackageJsonInfo(e,t){if(!t.readFile){return void 0}const n=["dependencies","devDependencies","optionalDependencies","peerDependencies"];const r=t.readFile(e)||"";const i=tryParseJson(r);const o={};if(i){for(const e of n){const t=i[e];if(!t){continue}const n=new Map;for(const e in t){n.set(e,t[e])}o[e]=n}}const a=[[1,o.dependencies],[2,o.devDependencies],[8,o.optionalDependencies],[4,o.peerDependencies]];return{...o,parseable:!!i,fileName:e,get:get,has(e,t){return!!get(e,t)}};function get(e,t=15){for(const[n,r]of a){if(r&&t&n){const t=r.get(e);if(t!==void 0){return t}}}}}function createPackageJsonImportFilter(e,t,n){const r=(n.getPackageJsonsVisibleToFile&&n.getPackageJsonsVisibleToFile(e.fileName)||getPackageJsonsVisibleToFile(e.fileName,n)).filter((e=>e.parseable));let i;let o;let a;return{allowsImportingAmbientModule:allowsImportingAmbientModule,getSourceFileInfo:getSourceFileInfo,allowsImportingSpecifier:allowsImportingSpecifier};function moduleSpecifierIsCoveredByPackageJson(e){const t=getNodeModuleRootSpecifier(e);for(const e of r){if(e.has(t)||e.has(getTypesPackageName(t))){return true}}return false}function allowsImportingAmbientModule(e,t){if(!r.length||!e.valueDeclaration){return true}if(!o){o=new Map}else{const t=o.get(e);if(t!==void 0){return t}}const n=stripQuotes(e.getName());if(isAllowedCoreNodeModulesImport(n)){o.set(e,true);return true}const i=e.valueDeclaration.getSourceFile();const a=getNodeModulesPackageNameFromFileName(i.fileName,t);if(typeof a==="undefined"){o.set(e,true);return true}const s=moduleSpecifierIsCoveredByPackageJson(a)||moduleSpecifierIsCoveredByPackageJson(n);o.set(e,s);return s}function getSourceFileInfo(e,t){if(!r.length){return{importable:true,packageName:void 0}}if(!a){a=new Map}else{const t=a.get(e);if(t!==void 0){return t}}const n=getNodeModulesPackageNameFromFileName(e.fileName,t);if(!n){const t={importable:true,packageName:n};a.set(e,t);return t}const i=moduleSpecifierIsCoveredByPackageJson(n);const o={importable:i,packageName:n};a.set(e,o);return o}function allowsImportingSpecifier(e){if(!r.length||isAllowedCoreNodeModulesImport(e)){return true}if(pathIsRelative(e)||isRootedDiskPath(e)){return true}return moduleSpecifierIsCoveredByPackageJson(e)}function isAllowedCoreNodeModulesImport(t){if(isFullSourceFile(e)&&isSourceFileJS(e)&&Or.has(t)){if(i===void 0){i=consumesNodeCoreModules(e)}if(i){return true}}return false}function getNodeModulesPackageNameFromFileName(r,i){if(!r.includes("node_modules")){return void 0}const o=Ho.getNodeModulesPackageName(n.getCompilationSettings(),e,r,i,t);if(!o){return void 0}if(!pathIsRelative(o)&&!isRootedDiskPath(o)){return getNodeModuleRootSpecifier(o)}}function getNodeModuleRootSpecifier(e){const t=getPathComponents(getPackageNameFromTypesPackageName(e)).slice(1);if(startsWith(t[0],"@")){return`${t[0]}/${t[1]}`}return t[0]}}function consumesNodeCoreModules(e){return some(e.imports,(({text:e})=>Or.has(e)))}function isInsideNodeModules(e){return contains(getPathComponents(e),"node_modules")}function isDiagnosticWithLocation(e){return e.file!==void 0&&e.start!==void 0&&e.length!==void 0}function findDiagnosticForNode(e,t){const n=createTextSpanFromNode(e);const r=binarySearchKey(t,n,identity,compareTextSpans);if(r>=0){const n=t[r];S.assertEqual(n.file,e.getSourceFile(),"Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile");return cast(n,isDiagnosticWithLocation)}}function getDiagnosticsWithinSpan(e,t){var n;let r=binarySearchKey(t,e.start,(e=>e.start),compareValues);if(r<0){r=~r}while(((n=t[r-1])==null?void 0:n.start)===e.start){r--}const i=[];const o=textSpanEnd(e);while(true){const n=tryCast(t[r],isDiagnosticWithLocation);if(!n||n.start>o){break}if(textSpanContainsTextSpan(e,n)){i.push(n)}r++}return i}function getRefactorContextSpan({startPosition:e,endPosition:t}){return createTextSpanFromBounds(e,t===void 0?e:t)}function getFixableErrorSpanExpression(e,t){const n=getTokenAtPosition(e,t.start);const r=findAncestor(n,(n=>{if(n.getStart(e)textSpanEnd(t)){return"quit"}return isExpression(n)&&textSpansEqual(t,createTextSpanFromNode(n,e))}));return r}function mapOneOrMany(e,t,n=identity){return e?isArray(e)?n(map(e,t)):t(e,0):void 0}function firstOrOnly(e){return isArray(e)?first(e):e}function getNameForExportedSymbol(e,t,n){if(e.escapedName==="export="||e.escapedName==="default"){return getDefaultLikeExportNameFromDeclaration(e)||moduleSymbolToValidIdentifier(getSymbolParentOrFail(e),t,!!n)}return e.name}function getDefaultLikeExportNameFromDeclaration(e){return firstDefined(e.declarations,(t=>{var n,r,i;if(isExportAssignment(t)){return(n=tryCast(skipOuterExpressions(t.expression),isIdentifier))==null?void 0:n.text}if(isExportSpecifier(t)&&t.symbol.flags===2097152){return(r=tryCast(t.propertyName,isIdentifier))==null?void 0:r.text}const o=(i=tryCast(getNameOfDeclaration(t),isIdentifier))==null?void 0:i.text;if(o){return o}if(e.parent&&!isExternalModuleSymbol(e.parent)){return e.parent.getName()}}))}function getSymbolParentOrFail(e){var t;return S.checkDefined(e.parent,`Symbol parent was undefined. Flags: ${S.formatSymbolFlags(e.flags)}. Declarations: ${(t=e.declarations)==null?void 0:t.map((e=>{const t=S.formatSyntaxKind(e.kind);const n=isInJSFile(e);const{expression:r}=e;return(n?"[JS]":"")+t+(r?` (expression: ${S.formatSyntaxKind(r.kind)})`:"")})).join(", ")}.`)}function moduleSymbolToValidIdentifier(e,t,n){return moduleSpecifierToValidIdentifier(removeFileExtension(stripQuotes(e.name)),t,n)}function moduleSpecifierToValidIdentifier(e,t,n){const r=getBaseFileName(removeSuffix(removeFileExtension(e),"/index"));let i="";let o=true;const a=r.charCodeAt(0);if(isIdentifierStart(a,t)){i+=String.fromCharCode(a);if(n){i=i.toUpperCase()}}else{o=false}for(let e=1;ee.length){return false}for(let i=0;i{e[e["Named"]=0]="Named";e[e["Default"]=1]="Default";e[e["Namespace"]=2]="Namespace";e[e["CommonJS"]=3]="CommonJS";return e})(nc||{});var rc=(e=>{e[e["Named"]=0]="Named";e[e["Default"]=1]="Default";e[e["ExportEquals"]=2]="ExportEquals";e[e["UMD"]=3]="UMD";e[e["Module"]=4]="Module";return e})(rc||{});function createCacheableExportInfoMap(e){let t=1;const n=createMultiMap();const r=new Map;const i=new Map;let o;const a={isUsableByFile:e=>e===o,isEmpty:()=>!n.size,clear:()=>{n.clear();r.clear();o=void 0},add:(e,s,c,l,d,p,u,f)=>{if(e!==o){a.clear();o=e}let m;if(d){const t=getNodeModulePathParts(d.fileName);if(t){const{topLevelNodeModulesIndex:n,topLevelPackageNameIndex:r,packageRootIndex:o}=t;m=unmangleScopedPackageName(getPackageNameFromTypesPackageName(d.fileName.substring(r+1,o)));if(startsWith(e,d.path.substring(0,n))){const e=i.get(m);const t=d.fileName.substring(0,r+1);if(e){const r=e.indexOf(Wo);if(n>r){i.set(m,t)}}else{i.set(m,t)}}}}const _=p===1;const g=_&&getLocalSymbolForExportDefault(s)||s;const y=p===0||isExternalModuleSymbol(g)?unescapeLeadingUnderscores(c):getNamesForExportedSymbol(g,f,void 0);const h=typeof y==="string"?y:y[0];const T=typeof y==="string"?void 0:y[1];const S=stripQuotes(l.name);const v=t++;const x=skipAlias(s,f);const b=s.flags&33554432?void 0:s;const C=l.flags&33554432?void 0:l;if(!b||!C)r.set(v,[s,l]);n.add(key(h,s,isExternalModuleNameRelative(S)?void 0:S,f),{id:v,symbolTableKey:c,symbolName:h,capitalizedSymbolName:T,moduleName:S,moduleFile:d,moduleFileName:d==null?void 0:d.fileName,packageName:m,exportKind:p,targetFlags:x.flags,isFromPackageJson:u,symbol:b,moduleSymbol:C})},get:(e,t)=>{if(e!==o)return;const r=n.get(t);return r==null?void 0:r.map(rehydrateCachedInfo)},search:(e,t,r,i)=>{if(e!==o)return;return forEachEntry(n,((e,n)=>{const{symbolName:o,ambientModuleName:a}=parseKey(n);const s=t&&e[0].capitalizedSymbolName||o;if(r(s,e[0].targetFlags)){const t=e.map(rehydrateCachedInfo);const r=t.filter(((t,n)=>isNotShadowedByDeeperNodeModulesPackage(t,e[n].packageName)));if(r.length){const e=i(r,s,!!a,n);if(e!==void 0)return e}}}))},releaseSymbols:()=>{r.clear()},onFileChanged:(e,t,n)=>{if(fileIsGlobalOnly(e)&&fileIsGlobalOnly(t)){return false}if(o&&o!==t.path||n&&consumesNodeCoreModules(e)!==consumesNodeCoreModules(t)||!arrayIsEqualTo(e.moduleAugmentations,t.moduleAugmentations)||!ambientModuleDeclarationsAreEqual(e,t)){a.clear();return true}o=t.path;return false}};if(S.isDebugging){Object.defineProperty(a,"__cache",{value:n})}return a;function rehydrateCachedInfo(t){if(t.symbol&&t.moduleSymbol)return t;const{id:n,exportKind:i,targetFlags:o,isFromPackageJson:a,moduleFileName:s}=t;const[c,l]=r.get(n)||d;if(c&&l){return{symbol:c,moduleSymbol:l,moduleFileName:s,exportKind:i,targetFlags:o,isFromPackageJson:a}}const p=(a?e.getPackageJsonAutoImportProvider():e.getCurrentProgram()).getTypeChecker();const u=t.moduleSymbol||l||S.checkDefined(t.moduleFile?p.getMergedSymbol(t.moduleFile.symbol):p.tryFindAmbientModule(t.moduleName));const f=t.symbol||c||S.checkDefined(i===2?p.resolveExternalModuleSymbol(u):p.tryGetMemberInModuleExportsAndProperties(unescapeLeadingUnderscores(t.symbolTableKey),u),`Could not find symbol '${t.symbolName}' by key '${t.symbolTableKey}' in module ${u.name}`);r.set(n,[f,u]);return{symbol:f,moduleSymbol:u,moduleFileName:s,exportKind:i,targetFlags:o,isFromPackageJson:a}}function key(e,t,n,r){const i=n||"";return`${e.length} ${getSymbolId(skipAlias(t,r))} ${e} ${i}`}function parseKey(e){const t=e.indexOf(" ");const n=e.indexOf(" ",t+1);const r=parseInt(e.substring(0,t),10);const i=e.substring(n+1);const o=i.substring(0,r);const a=i.substring(r+1);const s=a===""?void 0:a;return{symbolName:o,ambientModuleName:s}}function fileIsGlobalOnly(e){return!e.commonJsModuleIndicator&&!e.externalModuleIndicator&&!e.moduleAugmentations&&!e.ambientModuleNames}function ambientModuleDeclarationsAreEqual(e,t){if(!arrayIsEqualTo(e.ambientModuleNames,t.ambientModuleNames)){return false}let n=-1;let r=-1;for(const i of t.ambientModuleNames){const isMatchingModuleDeclaration=e=>isNonGlobalAmbientModule(e)&&e.name.text===i;n=findIndex(e.statements,isMatchingModuleDeclaration,n+1);r=findIndex(t.statements,isMatchingModuleDeclaration,r+1);if(e.statements[n]!==t.statements[r]){return false}}return true}function isNotShadowedByDeeperNodeModulesPackage(t,n){if(!n||!t.moduleFileName)return true;const r=e.getGlobalTypingsCacheLocation();if(r&&startsWith(t.moduleFileName,r))return true;const o=i.get(n);return!o||startsWith(t.moduleFileName,o)}}function isImportable(e,t,n,r,i,o,a,s){var c;if(!n){let n;const i=stripQuotes(r.name);if(Or.has(i)&&(n=shouldUseUriStyleNodeCoreModules(t,e))!==void 0){return n===startsWith(i,"node:")}return!o||o.allowsImportingAmbientModule(r,a)||fileContainsPackageImport(t,i)}S.assertIsDefined(n);if(t===n)return false;const l=s==null?void 0:s.get(t.path,n.path,i,{});if((l==null?void 0:l.isBlockedByPackageJsonDependencies)!==void 0){return!l.isBlockedByPackageJsonDependencies||!!l.packageName&&fileContainsPackageImport(t,l.packageName)}const d=hostGetCanonicalFileName(a);const p=(c=a.getGlobalTypingsCacheLocation)==null?void 0:c.call(a);const u=!!Ho.forEachFileNameOfModule(t.fileName,n.fileName,a,false,(r=>{const i=e.getSourceFile(r);return(i===n||!i)&&isImportablePath(t.fileName,r,d,p,a)}));if(o){const e=u?o.getSourceFileInfo(n,a):void 0;s==null?void 0:s.setBlockedByPackageJsonDependencies(t.path,n.path,i,{},e==null?void 0:e.packageName,!(e==null?void 0:e.importable));return!!(e==null?void 0:e.importable)||u&&!!(e==null?void 0:e.packageName)&&fileContainsPackageImport(t,e.packageName)}return u}function fileContainsPackageImport(e,t){return e.imports&&e.imports.some((e=>e.text===t||e.text.startsWith(t+"/")))}function isImportablePath(e,t,n,r,i){const o=forEachAncestorDirectoryStoppingAtGlobalCache(i,t,(e=>getBaseFileName(e)==="node_modules"?e:void 0));const a=o&&getDirectoryPath(n(o));return a===void 0||startsWith(n(e),a)||!!r&&startsWith(n(r),a)}function forEachExternalModuleToImportFrom(e,t,n,r,i){var o,a;const s=hostUsesCaseSensitiveFileNames(t);const c=n.autoImportFileExcludePatterns&&getIsExcludedPatterns(n,s);forEachExternalModule(e.getTypeChecker(),e.getSourceFiles(),c,t,((t,n)=>i(t,n,e,false)));const l=r&&((o=t.getPackageJsonAutoImportProvider)==null?void 0:o.call(t));if(l){const n=R();const r=e.getTypeChecker();forEachExternalModule(l.getTypeChecker(),l.getSourceFiles(),c,t,((t,n)=>{if(n&&!e.getSourceFile(n.fileName)||!n&&!r.resolveName(t.name,void 0,1536,false)){i(t,n,l,true)}}));(a=t.log)==null?void 0:a.call(t,`forEachExternalModuleToImportFrom autoImportProvider: ${R()-n}`)}}function getIsExcludedPatterns(e,t){return mapDefined(e.autoImportFileExcludePatterns,(e=>{const n=getSubPatternFromSpec(e,"","exclude");return n?getRegexFromPattern(n,t):void 0}))}function forEachExternalModule(e,t,n,r,i){var o;const a=n&&getIsExcluded(n,r);for(const t of e.getAmbientModules()){if(!t.name.includes("*")&&!(n&&((o=t.declarations)==null?void 0:o.every((e=>a(e.getSourceFile())))))){i(t,void 0)}}for(const n of t){if(isExternalOrCommonJsModule(n)&&!(a==null?void 0:a(n))){i(e.getMergedSymbol(n.symbol),n)}}}function getIsExcluded(e,t){var n;const r=(n=t.getSymlinkCache)==null?void 0:n.call(t).getSymlinkedDirectoriesByRealpath();return({fileName:n,path:i})=>{if(e.some((e=>e.test(n))))return true;if((r==null?void 0:r.size)&&pathContainsNodeModules(n)){let o=getDirectoryPath(n);return forEachAncestorDirectoryStoppingAtGlobalCache(t,getDirectoryPath(i),(t=>{const i=r.get(ensureTrailingDirectorySeparator(t));if(i){return i.some((t=>e.some((e=>e.test(n.replace(o,t))))))}o=getDirectoryPath(o)}))??false}return false}}function getIsFileExcluded(e,t){if(!t.autoImportFileExcludePatterns)return()=>false;return getIsExcluded(getIsExcludedPatterns(t,hostUsesCaseSensitiveFileNames(e)),e)}function getExportInfoMap(e,t,n,r,i){var o,a,s,c,l;const d=R();(o=t.getPackageJsonAutoImportProvider)==null?void 0:o.call(t);const p=((a=t.getCachedExportInfoMap)==null?void 0:a.call(t))||createCacheableExportInfoMap({getCurrentProgram:()=>n,getPackageJsonAutoImportProvider:()=>{var e;return(e=t.getPackageJsonAutoImportProvider)==null?void 0:e.call(t)},getGlobalTypingsCacheLocation:()=>{var e;return(e=t.getGlobalTypingsCacheLocation)==null?void 0:e.call(t)}});if(p.isUsableByFile(e.path)){(s=t.log)==null?void 0:s.call(t,"getExportInfoMap: cache hit");return p}(c=t.log)==null?void 0:c.call(t,"getExportInfoMap: cache miss or empty; calculating new results");let u=0;try{forEachExternalModuleToImportFrom(n,t,r,true,((t,n,r,o)=>{if(++u%100===0)i==null?void 0:i.throwIfCancellationRequested();const a=new Set;const s=r.getTypeChecker();const c=getDefaultLikeExportInfo(t,s);if(c&&isImportableSymbol(c.symbol,s)){p.add(e.path,c.symbol,c.exportKind===1?"default":"export=",t,n,c.exportKind,o,s)}s.forEachExportAndPropertyOfModule(t,((r,i)=>{if(r!==(c==null?void 0:c.symbol)&&isImportableSymbol(r,s)&&addToSeen(a,i)){p.add(e.path,r,i,t,n,0,o,s)}}))}))}catch(e){p.clear();throw e}(l=t.log)==null?void 0:l.call(t,`getExportInfoMap: done in ${R()-d} ms`);return p}function getDefaultLikeExportInfo(e,t){const n=t.resolveExternalModuleSymbol(e);if(n!==e){const e=t.tryGetMemberInModuleExports("default",n);if(e)return{symbol:e,exportKind:1};return{symbol:n,exportKind:2}}const r=t.tryGetMemberInModuleExports("default",e);if(r)return{symbol:r,exportKind:1}}function isImportableSymbol(e,t){return!t.isUndefinedSymbol(e)&&!t.isUnknownSymbol(e)&&!isKnownSymbol(e)&&!isPrivateIdentifierSymbol(e)}function getNamesForExportedSymbol(e,t,n){let r;forEachNameOfDefaultExport(e,t,n,((e,t)=>{r=t?[e,t]:e;return true}));return S.checkDefined(r)}function forEachNameOfDefaultExport(e,t,n,r){let i;let o=e;const a=new Set;while(o){const e=getDefaultLikeExportNameFromDeclaration(o);if(e){const t=r(e);if(t)return t}if(o.escapedName!=="default"&&o.escapedName!=="export="){const e=r(o.name);if(e)return e}i=append(i,o);if(!addToSeen(a,o))break;o=o.flags&2097152?t.getImmediateAliasedSymbol(o):void 0}for(const e of i??d){if(e.parent&&isExternalModuleSymbol(e.parent)){const t=r(moduleSymbolToValidIdentifier(e.parent,n,false),moduleSymbolToValidIdentifier(e.parent,n,true));if(t)return t}}}function createClassifier(){const e=createScanner(99,false);function getClassificationsForLine(e,t,n){return convertClassificationsToResult(getEncodedLexicalClassifications(e,t,n),e)}function getEncodedLexicalClassifications(t,n,r){let i=0;let o=0;const a=[];const{prefix:s,pushTemplate:c}=getPrefixFromLexState(n);t=s+t;const l=s.length;if(c){a.push(16)}e.setText(t);let d=0;const p=[];let u=0;do{i=e.scan();if(!isTrivia(i)){handleToken();o=i}const n=e.getTokenEnd();pushEncodedClassification(e.getTokenStart(),n,l,classFromKind(i),p);if(n>=t.length){const t=getNewEndOfLineState(e,i,lastOrUndefined(a));if(t!==void 0){d=t}}}while(i!==1);function handleToken(){switch(i){case 44:case 69:if(!ic[o]&&e.reScanSlashToken()===14){i=14}break;case 30:if(o===80){u++}break;case 32:if(u>0){u--}break;case 133:case 154:case 150:case 136:case 155:if(u>0&&!r){i=80}break;case 16:a.push(i);break;case 19:if(a.length>0){a.push(i)}break;case 20:if(a.length>0){const t=lastOrUndefined(a);if(t===16){i=e.reScanTemplateToken(false);if(i===18){a.pop()}else{S.assertEqual(i,17,"Should have been a template middle.")}}else{S.assertEqual(t,19,"Should have been an open brace");a.pop()}}break;default:if(!isKeyword(i)){break}if(o===25){i=80}else if(isKeyword(o)&&isKeyword(i)&&!canFollow(o,i)){i=80}}}return{endOfLineState:d,spans:p}}return{getClassificationsForLine:getClassificationsForLine,getEncodedLexicalClassifications:getEncodedLexicalClassifications}}var ic=arrayToNumericMap([80,11,9,10,14,110,46,47,22,24,20,112,97],(e=>e),(()=>true));function getNewEndOfLineState(e,t,n){switch(t){case 11:{if(!e.isUnterminated())return void 0;const t=e.getTokenText();const n=t.length-1;let r=0;while(t.charCodeAt(n-r)===92){r++}if((r&1)===0)return void 0;return t.charCodeAt(0)===34?3:2}case 3:return e.isUnterminated()?1:void 0;default:if(isTemplateLiteralKind(t)){if(!e.isUnterminated()){return void 0}switch(t){case 18:return 5;case 15:return 4;default:return S.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #"+t)}}return n===16?6:void 0}}function pushEncodedClassification(e,t,n,r,i){if(r===8){return}if(e===0&&n>0){e+=n}const o=t-e;if(o>0){i.push(e-n,o,r)}}function convertClassificationsToResult(e,t){const n=[];const r=e.spans;let i=0;for(let e=0;e=0){const e=t-i;if(e>0){n.push({length:e,classification:4})}}n.push({length:o,classification:convertClassification(a)});i=t+o}const o=t.length-i;if(o>0){n.push({length:o,classification:4})}return{entries:n,finalLexState:e.endOfLineState}}function convertClassification(e){switch(e){case 1:return 3;case 3:return 1;case 4:return 6;case 25:return 7;case 5:return 2;case 6:return 8;case 8:return 4;case 10:return 0;case 2:case 11:case 12:case 13:case 14:case 15:case 16:case 9:case 17:return 5;default:return void 0}}function canFollow(e,t){if(!isAccessibilityModifier(e)){return true}switch(t){case 139:case 153:case 137:case 126:case 129:return true;default:return false}}function getPrefixFromLexState(e){switch(e){case 3:return{prefix:'"\\\n'};case 2:return{prefix:"'\\\n"};case 1:return{prefix:"/*\n"};case 4:return{prefix:"`\n"};case 5:return{prefix:"}\n",pushTemplate:true};case 6:return{prefix:"",pushTemplate:true};case 0:return{prefix:""};default:return S.assertNever(e)}}function isBinaryExpressionOperatorToken(e){switch(e){case 42:case 44:case 45:case 40:case 41:case 48:case 49:case 50:case 30:case 32:case 33:case 34:case 104:case 103:case 130:case 152:case 35:case 36:case 37:case 38:case 51:case 53:case 52:case 56:case 57:case 75:case 74:case 79:case 71:case 72:case 73:case 65:case 66:case 67:case 69:case 70:case 64:case 28:case 61:case 76:case 77:case 78:return true;default:return false}}function isPrefixUnaryExpressionOperatorToken(e){switch(e){case 40:case 41:case 55:case 54:case 46:case 47:return true;default:return false}}function classFromKind(e){if(isKeyword(e)){return 3}else if(isBinaryExpressionOperatorToken(e)||isPrefixUnaryExpressionOperatorToken(e)){return 5}else if(e>=19&&e<=79){return 10}switch(e){case 9:return 4;case 10:return 25;case 11:return 6;case 14:return 7;case 7:case 3:case 2:return 1;case 5:case 4:return 8;case 80:default:if(isTemplateLiteralKind(e)){return 6}return 2}}function getSemanticClassifications(e,t,n,r,i){return convertClassificationsToSpans(getEncodedSemanticClassifications(e,t,n,r,i))}function checkForClassificationCancellation(e,t){switch(t){case 267:case 263:case 264:case 262:case 231:case 218:case 219:e.throwIfCancellationRequested()}}function getEncodedSemanticClassifications(e,t,n,r,i){const o=[];n.forEachChild((function cb(o){if(!o||!textSpanIntersectsWith(i,o.pos,o.getFullWidth())){return}checkForClassificationCancellation(t,o.kind);if(isIdentifier(o)&&!nodeIsMissing(o)&&r.has(o.escapedText)){const t=e.getSymbolAtLocation(o);const r=t&&classifySymbol(t,getMeaningFromLocation(o),e);if(r){pushClassification(o.getStart(n),o.getEnd(),r)}}o.forEachChild(cb)}));return{spans:o,endOfLineState:0};function pushClassification(e,t,n){const r=t-e;S.assert(r>0,`Classification had non-positive length of ${r}`);o.push(e);o.push(r);o.push(n)}}function classifySymbol(e,t,n){const r=e.getFlags();if((r&2885600)===0){return void 0}else if(r&32){return 11}else if(r&384){return 12}else if(r&524288){return 16}else if(r&1536){return t&4||t&1&&hasValueSideModule(e)?14:void 0}else if(r&2097152){return classifySymbol(n.getAliasedSymbol(e),t,n)}else if(t&2){return r&64?13:r&262144?15:void 0}else{return void 0}}function hasValueSideModule(e){return some(e.declarations,(e=>isModuleDeclaration(e)&&getModuleInstanceState(e)===1))}function getClassificationTypeName(e){switch(e){case 1:return"comment";case 2:return"identifier";case 3:return"keyword";case 4:return"number";case 25:return"bigint";case 5:return"operator";case 6:return"string";case 8:return"whitespace";case 9:return"text";case 10:return"punctuation";case 11:return"class name";case 12:return"enum name";case 13:return"interface name";case 14:return"module name";case 15:return"type parameter name";case 16:return"type alias name";case 17:return"parameter name";case 18:return"doc comment tag name";case 19:return"jsx open tag name";case 20:return"jsx close tag name";case 21:return"jsx self closing tag name";case 22:return"jsx attribute";case 23:return"jsx text";case 24:return"jsx attribute string literal value";default:return void 0}}function convertClassificationsToSpans(e){S.assert(e.spans.length%3===0);const t=e.spans;const n=[];for(let e=0;e])*)(\/>)?)?/m;const i=/(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/g;const o=t.text.substr(e,n);const a=r.exec(o);if(!a){return false}if(!a[3]||!(a[3]in yt)){return false}let s=e;pushCommentRange(s,a[1].length);s+=a[1].length;pushClassification(s,a[2].length,10);s+=a[2].length;pushClassification(s,a[3].length,21);s+=a[3].length;const c=a[4];let l=s;while(true){const e=i.exec(c);if(!e){break}const t=s+e.index+e[1].length;if(t>l){pushCommentRange(l,t-l);l=t}pushClassification(l,e[2].length,22);l+=e[2].length;if(e[3].length){pushCommentRange(l,e[3].length);l+=e[3].length}pushClassification(l,e[4].length,5);l+=e[4].length;if(e[5].length){pushCommentRange(l,e[5].length);l+=e[5].length}pushClassification(l,e[6].length,24);l+=e[6].length}s+=a[4].length;if(s>l){pushCommentRange(l,s-l)}if(a[5]){pushClassification(s,a[5].length,10);s+=a[5].length}const d=e+n;if(s=0);if(r>0){const i=t||classifyTokenType(e.kind,e);if(i){pushClassification(n,r,i)}}return true}function tryClassifyJsxElementName(e){switch(e.parent&&e.parent.kind){case 286:if(e.parent.tagName===e){return 19}break;case 287:if(e.parent.tagName===e){return 20}break;case 285:if(e.parent.tagName===e){return 21}break;case 291:if(e.parent.name===e){return 22}break}return void 0}function classifyTokenType(e,t){if(isKeyword(e)){return 3}if(e===30||e===32){if(t&&getTypeArgumentOrTypeParameterList(t.parent)){return 10}}if(isPunctuation(e)){if(t){const n=t.parent;if(e===64){if(n.kind===260||n.kind===172||n.kind===169||n.kind===291){return 5}}if(n.kind===226||n.kind===224||n.kind===225||n.kind===227){return 5}}return 10}else if(e===9){return 4}else if(e===10){return 25}else if(e===11){return t&&t.parent.kind===291?24:6}else if(e===14){return 6}else if(isTemplateLiteralKind(e)){return 6}else if(e===12){return 23}else if(e===80){if(t){switch(t.parent.kind){case 263:if(t.parent.name===t){return 11}return;case 168:if(t.parent.name===t){return 15}return;case 264:if(t.parent.name===t){return 13}return;case 266:if(t.parent.name===t){return 12}return;case 267:if(t.parent.name===t){return 14}return;case 169:if(t.parent.name===t){return isThisIdentifier(t)?3:17}return}if(isConstTypeReference(t.parent)){return 3}}return 2}}function processElement(n){if(!n){return}if(decodedTextSpanIntersectsWith(r,i,n.pos,n.getFullWidth())){checkForClassificationCancellation(e,n.kind);for(const e of n.getChildren(t)){if(!tryClassifyNode(e)){processElement(e)}}}}}var oc;(e=>{function getDocumentHighlights(e,t,n,r,i){const o=getTouchingPropertyName(n,r);if(o.parent&&(isJsxOpeningElement(o.parent)&&o.parent.tagName===o||isJsxClosingElement(o.parent))){const{openingElement:e,closingElement:t}=o.parent.parent;const r=[e,t].map((({tagName:e})=>getHighlightSpanForNode(e,n)));return[{fileName:n.fileName,highlightSpans:r}]}return getSemanticDocumentHighlights(r,o,e,t,i)||getSyntacticDocumentHighlights(o,n)}e.getDocumentHighlights=getDocumentHighlights;function getHighlightSpanForNode(e,t){return{fileName:t.fileName,textSpan:createTextSpanFromNode(e,t),kind:"none"}}function getSemanticDocumentHighlights(e,t,n,r,i){const o=new Set(i.map((e=>e.fileName)));const a=Rf.getReferenceEntriesForNode(e,t,n,i,r,void 0,o);if(!a)return void 0;const s=arrayToMultiMap(a.map(Rf.toHighlightSpan),(e=>e.fileName),(e=>e.span));const c=createGetCanonicalFileName(n.useCaseSensitiveFileNames());return arrayFrom(mapDefinedIterator(s.entries(),(([e,t])=>{if(!o.has(e)){if(!n.redirectTargetsMap.has(toPath(e,n.getCurrentDirectory(),c))){return void 0}const t=n.getSourceFile(e);const r=find(i,(e=>!!e.redirectInfo&&e.redirectInfo.redirectTarget===t));e=r.fileName;S.assert(o.has(e))}return{fileName:e,highlightSpans:t}})))}function getSyntacticDocumentHighlights(e,t){const n=getHighlightSpans(e,t);return n&&[{fileName:t.fileName,highlightSpans:n}]}function getHighlightSpans(e,t){switch(e.kind){case 101:case 93:return isIfStatement(e.parent)?getIfElseOccurrences(e.parent,t):void 0;case 107:return useParent(e.parent,isReturnStatement,getReturnOccurrences);case 111:return useParent(e.parent,isThrowStatement,getThrowOccurrences);case 113:case 85:case 98:const n=e.kind===85?e.parent.parent:e.parent;return useParent(n,isTryStatement,getTryCatchFinallyOccurrences);case 109:return useParent(e.parent,isSwitchStatement,getSwitchCaseDefaultOccurrences);case 84:case 90:{if(isDefaultClause(e.parent)||isCaseClause(e.parent)){return useParent(e.parent.parent.parent,isSwitchStatement,getSwitchCaseDefaultOccurrences)}return void 0}case 83:case 88:return useParent(e.parent,isBreakOrContinueStatement,getBreakOrContinueStatementOccurrences);case 99:case 117:case 92:return useParent(e.parent,(e=>isIterationStatement(e,true)),getLoopBreakContinueOccurrences);case 137:return getFromAllDeclarations(isConstructorDeclaration,[137]);case 139:case 153:return getFromAllDeclarations(isAccessor,[139,153]);case 135:return useParent(e.parent,isAwaitExpression,getAsyncAndAwaitOccurrences);case 134:return highlightSpans(getAsyncAndAwaitOccurrences(e));case 127:return highlightSpans(getYieldOccurrences(e));case 103:case 147:return void 0;default:return isModifierKind(e.kind)&&(isDeclaration(e.parent)||isVariableStatement(e.parent))?highlightSpans(getModifierOccurrences(e.kind,e.parent)):void 0}function getFromAllDeclarations(n,r){return useParent(e.parent,n,(e=>{var i;return mapDefined((i=tryCast(e,canHaveSymbol))==null?void 0:i.symbol.declarations,(e=>n(e)?find(e.getChildren(t),(e=>contains(r,e.kind))):void 0))}))}function useParent(e,n,r){return n(e)?highlightSpans(r(e,t)):void 0}function highlightSpans(e){return e&&e.map((e=>getHighlightSpanForNode(e,t)))}}function aggregateOwnedThrowStatements(e){if(isThrowStatement(e)){return[e]}else if(isTryStatement(e)){return concatenate(e.catchClause?aggregateOwnedThrowStatements(e.catchClause):e.tryBlock&&aggregateOwnedThrowStatements(e.tryBlock),e.finallyBlock&&aggregateOwnedThrowStatements(e.finallyBlock))}return isFunctionLike(e)?void 0:flatMapChildren(e,aggregateOwnedThrowStatements)}function getThrowStatementOwner(e){let t=e;while(t.parent){const e=t.parent;if(isFunctionBlock(e)||e.kind===307){return e}if(isTryStatement(e)&&e.tryBlock===t&&e.catchClause){return t}t=e}return void 0}function aggregateAllBreakAndContinueStatements(e){return isBreakOrContinueStatement(e)?[e]:isFunctionLike(e)?void 0:flatMapChildren(e,aggregateAllBreakAndContinueStatements)}function flatMapChildren(e,t){const n=[];e.forEachChild((e=>{const r=t(e);if(r!==void 0){n.push(...toArray(r))}}));return n}function ownsBreakOrContinueStatement(e,t){const n=getBreakOrContinueOwner(t);return!!n&&n===e}function getBreakOrContinueOwner(e){return findAncestor(e,(t=>{switch(t.kind){case 255:if(e.kind===251){return false}case 248:case 249:case 250:case 247:case 246:return!e.label||isLabeledBy(t,e.label.escapedText);default:return isFunctionLike(t)&&"quit"}}))}function getModifierOccurrences(e,t){return mapDefined(getNodesToSearchForModifier(t,modifierToFlag(e)),(t=>findModifier(t,e)))}function getNodesToSearchForModifier(e,t){const n=e.parent;switch(n.kind){case 268:case 307:case 241:case 296:case 297:if(t&64&&isClassDeclaration(e)){return[...e.members,e]}else{return n.statements}case 176:case 174:case 262:return[...n.parameters,...isClassLike(n.parent)?n.parent.members:[]];case 263:case 231:case 264:case 187:const r=n.members;if(t&(7|8)){const e=find(n.members,isConstructorDeclaration);if(e){return[...r,...e.parameters]}}else if(t&64){return[...r,n]}return r;default:return void 0}}function pushKeywordIf(e,t,...n){if(t&&contains(n,t.kind)){e.push(t);return true}return false}function getLoopBreakContinueOccurrences(e){const t=[];if(pushKeywordIf(t,e.getFirstToken(),99,117,92)){if(e.kind===246){const n=e.getChildren();for(let e=n.length-1;e>=0;e--){if(pushKeywordIf(t,n[e],117)){break}}}}forEach(aggregateAllBreakAndContinueStatements(e.statement),(n=>{if(ownsBreakOrContinueStatement(e,n)){pushKeywordIf(t,n.getFirstToken(),83,88)}}));return t}function getBreakOrContinueStatementOccurrences(e){const t=getBreakOrContinueOwner(e);if(t){switch(t.kind){case 248:case 249:case 250:case 246:case 247:return getLoopBreakContinueOccurrences(t);case 255:return getSwitchCaseDefaultOccurrences(t)}}return void 0}function getSwitchCaseDefaultOccurrences(e){const t=[];pushKeywordIf(t,e.getFirstToken(),109);forEach(e.caseBlock.clauses,(n=>{pushKeywordIf(t,n.getFirstToken(),84,90);forEach(aggregateAllBreakAndContinueStatements(n),(n=>{if(ownsBreakOrContinueStatement(e,n)){pushKeywordIf(t,n.getFirstToken(),83)}}))}));return t}function getTryCatchFinallyOccurrences(e,t){const n=[];pushKeywordIf(n,e.getFirstToken(),113);if(e.catchClause){pushKeywordIf(n,e.catchClause.getFirstToken(),85)}if(e.finallyBlock){const r=findChildOfKind(e,98,t);pushKeywordIf(n,r,98)}return n}function getThrowOccurrences(e,t){const n=getThrowStatementOwner(e);if(!n){return void 0}const r=[];forEach(aggregateOwnedThrowStatements(n),(e=>{r.push(findChildOfKind(e,111,t))}));if(isFunctionBlock(n)){forEachReturnStatement(n,(e=>{r.push(findChildOfKind(e,107,t))}))}return r}function getReturnOccurrences(e,t){const n=getContainingFunction(e);if(!n){return void 0}const r=[];forEachReturnStatement(cast(n.body,isBlock),(e=>{r.push(findChildOfKind(e,107,t))}));forEach(aggregateOwnedThrowStatements(n.body),(e=>{r.push(findChildOfKind(e,111,t))}));return r}function getAsyncAndAwaitOccurrences(e){const t=getContainingFunction(e);if(!t){return void 0}const n=[];if(t.modifiers){t.modifiers.forEach((e=>{pushKeywordIf(n,e,134)}))}forEachChild(t,(e=>{traverseWithoutCrossingFunction(e,(e=>{if(isAwaitExpression(e)){pushKeywordIf(n,e.getFirstToken(),135)}}))}));return n}function getYieldOccurrences(e){const t=getContainingFunction(e);if(!t){return void 0}const n=[];forEachChild(t,(e=>{traverseWithoutCrossingFunction(e,(e=>{if(isYieldExpression(e)){pushKeywordIf(n,e.getFirstToken(),127)}}))}));return n}function traverseWithoutCrossingFunction(e,t){t(e);if(!isFunctionLike(e)&&!isClassLike(e)&&!isInterfaceDeclaration(e)&&!isModuleDeclaration(e)&&!isTypeAliasDeclaration(e)&&!isTypeNode(e)){forEachChild(e,(e=>traverseWithoutCrossingFunction(e,t)))}}function getIfElseOccurrences(e,t){const n=getIfElseKeywords(e,t);const r=[];for(let e=0;e=i.end;e--){if(!isWhiteSpaceSingleLine(t.text.charCodeAt(e))){a=false;break}}if(a){r.push({fileName:t.fileName,textSpan:createTextSpanFromBounds(i.getStart(),o.end),kind:"reference"});e++;continue}}r.push(getHighlightSpanForNode(n[e],t))}return r}function getIfElseKeywords(e,t){const n=[];while(isIfStatement(e.parent)&&e.parent.elseStatement===e){e=e.parent}while(true){const r=e.getChildren(t);pushKeywordIf(n,r[0],101);for(let e=r.length-1;e>=0;e--){if(pushKeywordIf(n,r[e],93)){break}}if(!e.elseStatement||!isIfStatement(e.elseStatement)){break}e=e.elseStatement}return n}function isLabeledBy(e,t){return!!findAncestor(e.parent,(e=>!isLabeledStatement(e)?"quit":e.label.escapedText===t))}})(oc||(oc={}));function isDocumentRegistryEntry(e){return!!e.sourceFile}function createDocumentRegistry(e,t,n){return createDocumentRegistryInternal(e,t,n)}function createDocumentRegistryInternal(e,t="",n,r){const i=new Map;const o=createGetCanonicalFileName(!!e);function reportStats(){const e=arrayFrom(i.keys()).filter((e=>e&&e.charAt(0)==="_")).map((e=>{const t=i.get(e);const n=[];t.forEach(((e,t)=>{if(isDocumentRegistryEntry(e)){n.push({name:t,scriptKind:e.sourceFile.scriptKind,refCount:e.languageServiceRefCount})}else{e.forEach(((e,r)=>n.push({name:t,scriptKind:r,refCount:e.languageServiceRefCount})))}}));n.sort(((e,t)=>t.refCount-e.refCount));return{bucket:e,sourceFiles:n}}));return JSON.stringify(e,void 0,2)}function getCompilationSettings(e){if(typeof e.getCompilationSettings==="function"){return e.getCompilationSettings()}return e}function acquireDocument(e,n,r,i,a,s){const c=toPath(e,t,o);const l=getKeyForCompilationSettings(getCompilationSettings(n));return acquireDocumentWithKey(e,c,n,l,r,i,a,s)}function acquireDocumentWithKey(e,t,n,r,i,o,a,s){return acquireOrUpdateDocument(e,t,n,r,i,o,true,a,s)}function updateDocument(e,n,r,i,a,s){const c=toPath(e,t,o);const l=getKeyForCompilationSettings(getCompilationSettings(n));return updateDocumentWithKey(e,c,n,l,r,i,a,s)}function updateDocumentWithKey(e,t,n,r,i,o,a,s){return acquireOrUpdateDocument(e,t,getCompilationSettings(n),r,i,o,false,a,s)}function getDocumentRegistryEntry(e,t){const n=isDocumentRegistryEntry(e)?e:e.get(S.checkDefined(t,"If there are more than one scriptKind's for same document the scriptKind should be provided"));S.assert(t===void 0||!n||n.sourceFile.scriptKind===t,`Script kind should match provided ScriptKind:${t} and sourceFile.scriptKind: ${n==null?void 0:n.sourceFile.scriptKind}, !entry: ${!n}`);return n}function acquireOrUpdateDocument(e,t,o,a,s,c,l,d,p){var u,f,m,_;d=ensureScriptKind(e,d);const g=getCompilationSettings(o);const y=o===g?void 0:o;const h=d===6?100:zn(g);const T=typeof p==="object"?p:{languageVersion:h,impliedNodeFormat:y&&getImpliedNodeFormatForFile(t,(_=(m=(f=(u=y.getCompilerHost)==null?void 0:u.call(y))==null?void 0:f.getModuleResolutionCache)==null?void 0:m.call(f))==null?void 0:_.getPackageJsonInfoCache(),y,g),setExternalModuleIndicator:getSetExternalModuleIndicator(g),jsDocParsingMode:n};T.languageVersion=h;S.assertEqual(n,T.jsDocParsingMode);const v=i.size;const x=getDocumentRegistryBucketKeyWithMode(a,T.impliedNodeFormat);const b=getOrUpdate(i,x,(()=>new Map));if(G){if(i.size>v){G.instant(G.Phase.Session,"createdDocumentRegistryBucket",{configFilePath:g.configFilePath,key:x})}const e=!isDeclarationFileName(t)&&forEachEntry(i,((e,n)=>n!==x&&e.has(t)&&n));if(e){G.instant(G.Phase.Session,"documentRegistryBucketOverlap",{path:t,key1:e,key2:x})}}const C=b.get(t);let E=C&&getDocumentRegistryEntry(C,d);if(!E&&r){const e=r.getDocument(x,t);if(e&&e.scriptKind===d&&e.text===getSnapshotText(s)){S.assert(l);E={sourceFile:e,languageServiceRefCount:0};setBucketEntry()}}if(!E){const n=createLanguageServiceSourceFile(e,s,T,c,false,d);if(r){r.setDocument(x,t,n)}E={sourceFile:n,languageServiceRefCount:1};setBucketEntry()}else{if(E.sourceFile.version!==c){E.sourceFile=updateLanguageServiceSourceFile(E.sourceFile,s,c,s.getChangeRange(E.sourceFile.scriptSnapshot));if(r){r.setDocument(x,t,E.sourceFile)}}if(l){E.languageServiceRefCount++}}S.assert(E.languageServiceRefCount!==0);return E.sourceFile;function setBucketEntry(){if(!C){b.set(t,E)}else if(isDocumentRegistryEntry(C)){const e=new Map;e.set(C.sourceFile.scriptKind,C);e.set(d,E);b.set(t,e)}else{C.set(d,E)}}}function releaseDocument(e,n,r,i){const a=toPath(e,t,o);const s=getKeyForCompilationSettings(n);return releaseDocumentWithKey(a,s,r,i)}function releaseDocumentWithKey(e,t,n,r){const o=S.checkDefined(i.get(getDocumentRegistryBucketKeyWithMode(t,r)));const a=o.get(e);const s=getDocumentRegistryEntry(a,n);s.languageServiceRefCount--;S.assert(s.languageServiceRefCount>=0);if(s.languageServiceRefCount===0){if(isDocumentRegistryEntry(a)){o.delete(e)}else{a.delete(n);if(a.size===1){o.set(e,firstDefinedIterator(a.values(),identity))}}}}return{acquireDocument:acquireDocument,acquireDocumentWithKey:acquireDocumentWithKey,updateDocument:updateDocument,updateDocumentWithKey:updateDocumentWithKey,releaseDocument:releaseDocument,releaseDocumentWithKey:releaseDocumentWithKey,getKeyForCompilationSettings:getKeyForCompilationSettings,getDocumentRegistryBucketKeyWithMode:getDocumentRegistryBucketKeyWithMode,reportStats:reportStats,getBuckets:()=>i}}function getKeyForCompilationSettings(e){return getKeyForCompilerOptions(e,oo)}function getDocumentRegistryBucketKeyWithMode(e,t){return t?`${e}|${t}`:e}function getEditsForFileRename(e,t,n,r,i,o,a){const s=hostUsesCaseSensitiveFileNames(r);const c=createGetCanonicalFileName(s);const l=getPathUpdater(t,n,c,a);const d=getPathUpdater(n,t,c,a);return dm.ChangeTracker.with({host:r,formatContext:i,preferences:o},(i=>{updateTsconfigFiles(e,i,l,t,n,r.getCurrentDirectory(),s);updateImports(e,i,l,d,r,c)}))}function getPathUpdater(e,t,n,r){const i=n(e);return e=>{const t=r&&r.tryGetSourcePosition({fileName:e,pos:0});const i=getUpdatedPath(t?t.fileName:e);return t?i===void 0?void 0:makeCorrespondingRelativeChange(t.fileName,i,e,n):i};function getUpdatedPath(e){if(n(e)===i)return t;const r=tryRemoveDirectoryPrefix(e,i,n);return r===void 0?void 0:t+"/"+r}}function makeCorrespondingRelativeChange(e,t,n,r){const i=getRelativePathFromFile(e,t,r);return combinePathsSafe(getDirectoryPath(n),i)}function updateTsconfigFiles(e,t,n,r,i,o,a){const{configFile:s}=e.getCompilerOptions();if(!s)return;const c=getDirectoryPath(s.fileName);const l=getTsConfigObjectLiteralExpression(s);if(!l)return;forEachProperty(l,((e,n)=>{switch(n){case"files":case"include":case"exclude":{const l=updatePaths(e);if(l||n!=="include"||!isArrayLiteralExpression(e.initializer))return;const d=mapDefined(e.initializer.elements,(e=>isStringLiteral(e)?e.text:void 0));if(d.length===0)return;const p=getFileMatcherPatterns(c,[],d,a,o);if(getRegexFromPattern(S.checkDefined(p.includeFilePattern),a).test(r)&&!getRegexFromPattern(S.checkDefined(p.includeFilePattern),a).test(i)){t.insertNodeAfter(s,last(e.initializer.elements),zr.createStringLiteral(relativePath(i)))}return}case"compilerOptions":forEachProperty(e.initializer,((e,t)=>{const n=getOptionFromName(t);S.assert((n==null?void 0:n.type)!=="listOrElement");if(n&&(n.isFilePath||n.type==="list"&&n.element.isFilePath)){updatePaths(e)}else if(t==="paths"){forEachProperty(e.initializer,(e=>{if(!isArrayLiteralExpression(e.initializer))return;for(const t of e.initializer.elements){tryUpdateString(t)}}))}}));return}}));function updatePaths(e){const t=isArrayLiteralExpression(e.initializer)?e.initializer.elements:[e.initializer];let n=false;for(const e of t){n=tryUpdateString(e)||n}return n}function tryUpdateString(e){if(!isStringLiteral(e))return false;const r=combinePathsSafe(c,e.text);const i=n(r);if(i!==void 0){t.replaceRangeWithText(s,createStringRange(e,s),relativePath(i));return true}return false}function relativePath(e){return getRelativePathFromDirectory(c,e,!a)}}function updateImports(e,t,n,r,i,o){const a=e.getSourceFiles();for(const s of a){const c=n(s.fileName);const l=c??s.fileName;const d=getDirectoryPath(l);const p=r(s.fileName);const u=p||s.fileName;const f=getDirectoryPath(u);const m=c!==void 0||p!==void 0;updateImportsWorker(s,t,(e=>{if(!pathIsRelative(e))return void 0;const t=combinePathsSafe(f,e);const r=n(t);return r===void 0?void 0:ensurePathIsNonModuleName(getRelativePathFromDirectory(d,r,o))}),(t=>{const r=e.getTypeChecker().getSymbolAtLocation(t);if((r==null?void 0:r.declarations)&&r.declarations.some((e=>isAmbientModule(e))))return void 0;const o=p!==void 0?getSourceFileToImportFromResolved(t,resolveModuleName(t.text,u,e.getCompilerOptions(),i),n,a):getSourceFileToImport(r,t,s,e,i,n);return o!==void 0&&(o.updated||m&&pathIsRelative(t.text))?Ho.updateModuleSpecifier(e.getCompilerOptions(),s,l,o.newFileName,createModuleSpecifierResolutionHost(e,i),t.text):void 0}))}}function combineNormal(e,t){return normalizePath(combinePaths(e,t))}function combinePathsSafe(e,t){return ensurePathIsNonModuleName(combineNormal(e,t))}function getSourceFileToImport(e,t,n,r,i,o){if(e){const t=find(e.declarations,isSourceFile).fileName;const n=o(t);return n===void 0?{newFileName:t,updated:false}:{newFileName:n,updated:true}}else{const e=r.getModeForUsageLocation(n,t);const a=i.resolveModuleNameLiterals||!i.resolveModuleNames?r.getResolvedModuleFromModuleSpecifier(t,n):i.getResolvedModuleWithFailedLookupLocationsFromCache&&i.getResolvedModuleWithFailedLookupLocationsFromCache(t.text,n.fileName,e);return getSourceFileToImportFromResolved(t,a,o,r.getSourceFiles())}}function getSourceFileToImportFromResolved(e,t,n,r){if(!t)return void 0;if(t.resolvedModule){const e=tryChange(t.resolvedModule.resolvedFileName);if(e)return e}const i=forEach(t.failedLookupLocations,tryChangeWithIgnoringPackageJsonExisting)||pathIsRelative(e.text)&&forEach(t.failedLookupLocations,tryChangeWithIgnoringPackageJson);if(i)return i;return t.resolvedModule&&{newFileName:t.resolvedModule.resolvedFileName,updated:false};function tryChangeWithIgnoringPackageJsonExisting(e){const t=n(e);return t&&find(r,(e=>e.fileName===t))?tryChangeWithIgnoringPackageJson(e):void 0}function tryChangeWithIgnoringPackageJson(e){return!endsWith(e,"/package.json")?tryChange(e):void 0}function tryChange(e){const t=n(e);return t&&{newFileName:t,updated:true}}}function updateImportsWorker(e,t,n,r){for(const r of e.referencedFiles||d){const i=n(r.fileName);if(i!==void 0&&i!==e.text.slice(r.pos,r.end))t.replaceRangeWithText(e,r,i)}for(const n of e.imports){const i=r(n);if(i!==void 0&&i!==n.text)t.replaceRangeWithText(e,createStringRange(n,e),i)}}function createStringRange(e,t){return createRange(e.getStart(t)+1,e.end-1)}function forEachProperty(e,t){if(!isObjectLiteralExpression(e))return;for(const n of e.properties){if(isPropertyAssignment(n)&&isStringLiteral(n.name)){t(n,n.name.text)}}}var ac=(e=>{e[e["exact"]=0]="exact";e[e["prefix"]=1]="prefix";e[e["substring"]=2]="substring";e[e["camelCase"]=3]="camelCase";return e})(ac||{});function createPatternMatch(e,t){return{kind:e,isCaseSensitive:t}}function createPatternMatcher(e){const t=new Map;const n=e.trim().split(".").map((e=>createSegment(e.trim())));if(n.length===1&&n[0].totalTextChunk.text===""){return{getMatchForLastSegmentOfPattern:()=>createPatternMatch(2,true),getFullMatch:()=>createPatternMatch(2,true),patternContainsDots:false}}if(n.some((e=>!e.subWordTextChunks.length)))return void 0;return{getFullMatch:(e,r)=>getFullMatch(e,r,n,t),getMatchForLastSegmentOfPattern:e=>matchSegment(e,last(n),t),patternContainsDots:n.length>1}}function getFullMatch(e,t,n,r){const i=matchSegment(t,last(n),r);if(!i){return void 0}if(n.length-1>e.length){return void 0}let o;for(let t=n.length-2,i=e.length-1;t>=0;t-=1,i-=1){o=betterMatch(o,matchSegment(e[i],n[t],r))}return o}function getWordSpans(e,t){let n=t.get(e);if(!n){t.set(e,n=breakIntoWordSpans(e))}return n}function matchTextChunk(e,t,n){const r=indexOfIgnoringCase(e,t.textLowerCase);if(r===0){return createPatternMatch(t.text.length===e.length?0:1,startsWith(e,t.text))}if(t.isLowerCase){if(r===-1)return void 0;const i=getWordSpans(e,n);for(const n of i){if(partStartsWith(e,n,t.text,true)){return createPatternMatch(2,partStartsWith(e,n,t.text,false))}}if(t.text.length0){return createPatternMatch(2,true)}if(t.characterSpans.length>0){const r=getWordSpans(e,n);const i=tryCamelCaseMatch(e,r,t,false)?true:tryCamelCaseMatch(e,r,t,true)?false:void 0;if(i!==void 0){return createPatternMatch(3,i)}}}}function matchSegment(e,t,n){if(every2(t.totalTextChunk.text,(e=>e!==32&&e!==42))){const r=matchTextChunk(e,t.totalTextChunk,n);if(r)return r}const r=t.subWordTextChunks;let i;for(const t of r){i=betterMatch(i,matchTextChunk(e,t,n))}return i}function betterMatch(e,t){return min([e,t],compareMatches)}function compareMatches(e,t){return e===void 0?1:t===void 0?-1:compareValues(e.kind,t.kind)||compareBooleans(!e.isCaseSensitive,!t.isCaseSensitive)}function partStartsWith(e,t,n,r,i={start:0,length:n.length}){return i.length<=t.length&&everyInRange(0,i.length,(o=>equalChars(n.charCodeAt(i.start+o),e.charCodeAt(t.start+o),r)))}function equalChars(e,t,n){return n?toLowerCase2(e)===toLowerCase2(t):e===t}function tryCamelCaseMatch(e,t,n,r){const i=n.characterSpans;let o=0;let a=0;let s;let c;while(true){if(a===i.length){return true}else if(o===t.length){return false}let l=t[o];let d=false;for(;a=65&&e<=90){return true}if(e<127||!isUnicodeIdentifierStart(e,99)){return false}const t=String.fromCharCode(e);return t===t.toUpperCase()}function isLowerCaseLetter(e){if(e>=97&&e<=122){return true}if(e<127||!isUnicodeIdentifierStart(e,99)){return false}const t=String.fromCharCode(e);return t===t.toLowerCase()}function indexOfIgnoringCase(e,t){const n=e.length-t.length;for(let r=0;r<=n;r++){if(every2(t,((t,n)=>toLowerCase2(e.charCodeAt(n+r))===t))){return r}}return-1}function toLowerCase2(e){if(e>=65&&e<=90){return 97+(e-65)}if(e<127){return e}return String.fromCharCode(e).toLowerCase().charCodeAt(0)}function isDigit2(e){return e>=48&&e<=57}function isWordChar(e){return isUpperCaseLetter(e)||isLowerCaseLetter(e)||isDigit2(e)||e===95||e===36}function breakPatternIntoTextChunks(e){const t=[];let n=0;let r=0;for(let i=0;i0){t.push(createTextChunk(e.substr(n,r)));r=0}}}if(r>0){t.push(createTextChunk(e.substr(n,r)))}return t}function createTextChunk(e){const t=e.toLowerCase();return{text:e,textLowerCase:t,isLowerCase:e===t,characterSpans:breakIntoCharacterSpans(e)}}function breakIntoCharacterSpans(e){return breakIntoSpans(e,false)}function breakIntoWordSpans(e){return breakIntoSpans(e,true)}function breakIntoSpans(e,t){const n=[];let r=0;for(let i=1;icharIsPunctuation(e)&&e!==95),t,n)}function transitionFromUpperToLower(e,t,n){return t!==n&&t+1t(e.charCodeAt(n),n)))}function preProcessFile(e,t=true,n=false){const r={languageVersion:1,pragmas:void 0,checkJsDirective:void 0,referencedFiles:[],typeReferenceDirectives:[],libReferenceDirectives:[],amdDependencies:[],hasNoDefaultLib:void 0,moduleName:void 0};const i=[];let o;let a;let s;let c=0;let l=false;function nextToken(){a=s;s=Gs.scan();if(s===19){c++}else if(s===20){c--}return s}function getFileReference(){const e=Gs.getTokenValue();const t=Gs.getTokenStart();return{fileName:e,pos:t,end:t+e.length}}function recordAmbientExternalModule(){if(!o){o=[]}o.push({ref:getFileReference(),depth:c})}function recordModuleName(){i.push(getFileReference());markAsExternalModuleIfTopLevel()}function markAsExternalModuleIfTopLevel(){if(c===0){l=true}}function tryConsumeDeclare(){let e=Gs.getToken();if(e===138){e=nextToken();if(e===144){e=nextToken();if(e===11){recordAmbientExternalModule()}}return true}return false}function tryConsumeImport(){if(a===25){return false}let e=Gs.getToken();if(e===102){e=nextToken();if(e===21){e=nextToken();if(e===11||e===15){recordModuleName();return true}}else if(e===11){recordModuleName();return true}else{if(e===156){const t=Gs.lookAhead((()=>{const e=Gs.scan();return e!==161&&(e===42||e===19||e===80||isKeyword(e))}));if(t){e=nextToken()}}if(e===80||isKeyword(e)){e=nextToken();if(e===161){e=nextToken();if(e===11){recordModuleName();return true}}else if(e===64){if(tryConsumeRequireCall(true)){return true}}else if(e===28){e=nextToken()}else{return true}}if(e===19){e=nextToken();while(e!==20&&e!==1){e=nextToken()}if(e===20){e=nextToken();if(e===161){e=nextToken();if(e===11){recordModuleName()}}}}else if(e===42){e=nextToken();if(e===130){e=nextToken();if(e===80||isKeyword(e)){e=nextToken();if(e===161){e=nextToken();if(e===11){recordModuleName()}}}}}}return true}return false}function tryConsumeExport(){let e=Gs.getToken();if(e===95){markAsExternalModuleIfTopLevel();e=nextToken();if(e===156){const t=Gs.lookAhead((()=>{const e=Gs.scan();return e===42||e===19}));if(t){e=nextToken()}}if(e===19){e=nextToken();while(e!==20&&e!==1){e=nextToken()}if(e===20){e=nextToken();if(e===161){e=nextToken();if(e===11){recordModuleName()}}}}else if(e===42){e=nextToken();if(e===161){e=nextToken();if(e===11){recordModuleName()}}}else if(e===102){e=nextToken();if(e===156){const t=Gs.lookAhead((()=>{const e=Gs.scan();return e===80||isKeyword(e)}));if(t){e=nextToken()}}if(e===80||isKeyword(e)){e=nextToken();if(e===64){if(tryConsumeRequireCall(true)){return true}}}}return true}return false}function tryConsumeRequireCall(e,t=false){let n=e?nextToken():Gs.getToken();if(n===149){n=nextToken();if(n===21){n=nextToken();if(n===11||t&&n===15){recordModuleName()}}return true}return false}function tryConsumeDefine(){let e=Gs.getToken();if(e===80&&Gs.getTokenValue()==="define"){e=nextToken();if(e!==21){return true}e=nextToken();if(e===11||e===15){e=nextToken();if(e===28){e=nextToken()}else{return true}}if(e!==23){return true}e=nextToken();while(e!==24&&e!==1){if(e===11||e===15){recordModuleName()}e=nextToken()}return true}return false}function processImports(){Gs.setText(e);nextToken();while(true){if(Gs.getToken()===1){break}if(Gs.getToken()===16){const e=[Gs.getToken()];e:while(length(e)){const t=Gs.scan();switch(t){case 1:break e;case 102:tryConsumeImport();break;case 16:e.push(t);break;case 19:if(length(e)){e.push(t)}break;case 20:if(length(e)){if(lastOrUndefined(e)===16){if(Gs.reScanTemplateToken(false)===18){e.pop()}}else{e.pop()}}break}}nextToken()}if(tryConsumeDeclare()||tryConsumeImport()||tryConsumeExport()||n&&(tryConsumeRequireCall(false,true)||tryConsumeDefine())){continue}else{nextToken()}}Gs.setText(void 0)}if(t){processImports()}processCommentPragmas(r,e);processPragmasIntoFields(r,noop);if(l){if(o){for(const e of o){i.push(e.ref)}}return{referencedFiles:r.referencedFiles,typeReferenceDirectives:r.typeReferenceDirectives,libReferenceDirectives:r.libReferenceDirectives,importedFiles:i,isLibFile:!!r.hasNoDefaultLib,ambientExternalModules:void 0}}else{let e;if(o){for(const t of o){if(t.depth===0){if(!e){e=[]}e.push(t.ref.fileName)}else{i.push(t.ref)}}}return{referencedFiles:r.referencedFiles,typeReferenceDirectives:r.typeReferenceDirectives,libReferenceDirectives:r.libReferenceDirectives,importedFiles:i,isLibFile:!!r.hasNoDefaultLib,ambientExternalModules:e}}}var sc=/^data:(?:application\/json;charset=[uU][tT][fF]-8;base64,([A-Za-z0-9+/=]+)$)?/;function getSourceMapper(e){const t=createGetCanonicalFileName(e.useCaseSensitiveFileNames());const n=e.getCurrentDirectory();const r=new Map;const i=new Map;return{tryGetSourcePosition:tryGetSourcePosition,tryGetGeneratedPosition:tryGetGeneratedPosition,toLineColumnOffset:toLineColumnOffset,clearCache:clearCache,documentPositionMappers:i};function toPath3(e){return toPath(e,n,t)}function getDocumentPositionMapper2(n,r){const o=toPath3(n);const a=i.get(o);if(a)return a;let s;if(e.getDocumentPositionMapper){s=e.getDocumentPositionMapper(n,r)}else if(e.readFile){const r=getSourceFileLike(n);s=r&&getDocumentPositionMapper({getSourceFileLike:getSourceFileLike,getCanonicalFileName:t,log:t=>e.log(t)},n,getLineInfo(r.text,getLineStarts(r)),(t=>!e.fileExists||e.fileExists(t)?e.readFile(t):void 0))}i.set(o,s||ga);return s||ga}function tryGetSourcePosition(e){if(!isDeclarationFileName(e.fileName))return void 0;const t=getSourceFile(e.fileName);if(!t)return void 0;const n=getDocumentPositionMapper2(e.fileName).getSourcePosition(e);return!n||n===e?void 0:tryGetSourcePosition(n)||n}function tryGetGeneratedPosition(t){if(isDeclarationFileName(t.fileName))return void 0;const n=getSourceFile(t.fileName);if(!n)return void 0;const r=e.getProgram();if(r.isSourceOfProjectReferenceRedirect(n.fileName)){return void 0}const i=r.getCompilerOptions();const o=i.outFile;const a=o?removeFileExtension(o)+".d.ts":getDeclarationEmitOutputFilePathWorker(t.fileName,r.getCompilerOptions(),r);if(a===void 0)return void 0;const s=getDocumentPositionMapper2(a,t.fileName).getGeneratedPosition(t);return s===t?void 0:s}function getSourceFile(t){const n=e.getProgram();if(!n)return void 0;const r=toPath3(t);const i=n.getSourceFileByPath(r);return i&&i.resolvedPath===r?i:void 0}function getOrCreateSourceFileLike(t){const n=toPath3(t);const i=r.get(n);if(i!==void 0)return i?i:void 0;if(!e.readFile||e.fileExists&&!e.fileExists(t)){r.set(n,false);return void 0}const o=e.readFile(t);const a=o?createSourceFileLike(o):false;r.set(n,a);return a?a:void 0}function getSourceFileLike(t){return!e.getSourceFileLike?getSourceFile(t)||getOrCreateSourceFileLike(t):e.getSourceFileLike(t)}function toLineColumnOffset(e,t){const n=getSourceFileLike(e);return n.getLineAndCharacterOfPosition(t)}function clearCache(){r.clear();i.clear()}}function getDocumentPositionMapper(e,t,n,r){let i=tryGetSourceMappingURL(n);if(i){const n=sc.exec(i);if(n){if(n[1]){const r=n[1];return convertDocumentToSourceMapper(e,base64decode(Ft,r),t)}i=void 0}}const o=[];if(i){o.push(i)}o.push(t+".map");const a=i&&getNormalizedAbsolutePath(i,getDirectoryPath(t));for(const n of o){const i=getNormalizedAbsolutePath(n,getDirectoryPath(t));const o=r(i,a);if(isString(o)){return convertDocumentToSourceMapper(e,o,i)}if(o!==void 0){return o||void 0}}return void 0}function convertDocumentToSourceMapper(e,t,n){const r=tryParseRawSourceMap(t);if(!r||!r.sources||!r.file||!r.mappings){return void 0}if(r.sourcesContent&&r.sourcesContent.some(isString))return void 0;return createDocumentPositionMapper(e,r,n)}function createSourceFileLike(e,t){return{text:e,lineMap:t,getLineAndCharacterOfPosition(e){return computeLineAndCharacterOfPosition(getLineStarts(this),e)}}}var cc=new Map;function computeSuggestionDiagnostics(e,t,n){var r;t.getSemanticDiagnostics(e,n);const i=[];const o=t.getTypeChecker();const a=t.getImpliedNodeFormatForEmit(e)===1||fileExtensionIsOneOf(e.fileName,[".cts",".cjs"]);if(!a&&e.commonJsModuleIndicator&&(programContainsEsModules(t)||compilerOptionsIndicateEsModules(t.getCompilerOptions()))&&containsTopLevelCommonjs(e)){i.push(createDiagnosticForNode(getErrorNodeFromCommonJsIndicator(e.commonJsModuleIndicator),wt.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module))}const s=isSourceFileJS(e);cc.clear();check(e);if($n(t.getCompilerOptions())){for(const n of e.imports){const o=importFromModuleSpecifier(n);const a=importNameForConvertToDefaultImport(o);if(!a)continue;const s=(r=t.getResolvedModuleFromModuleSpecifier(n,e))==null?void 0:r.resolvedModule;const c=s&&t.getSourceFile(s.resolvedFileName);if(c&&c.externalModuleIndicator&&c.externalModuleIndicator!==true&&isExportAssignment(c.externalModuleIndicator)&&c.externalModuleIndicator.isExportEquals){i.push(createDiagnosticForNode(a,wt.Import_may_be_converted_to_a_default_import))}}}addRange(i,e.bindSuggestionDiagnostics);addRange(i,t.getSuggestionDiagnostics(e,n));i.sort(((e,t)=>e.start-t.start));return i;function check(t){if(s){if(canBeConvertedToClass(t,o)){i.push(createDiagnosticForNode(isVariableDeclaration(t.parent)?t.parent.name:t,wt.This_constructor_function_may_be_converted_to_a_class_declaration))}}else{if(isVariableStatement(t)&&t.parent===e&&t.declarationList.flags&2&&t.declarationList.declarations.length===1){const e=t.declarationList.declarations[0].initializer;if(e&&isRequireCall(e,true)){i.push(createDiagnosticForNode(e,wt.require_call_may_be_converted_to_an_import))}}const n=id.getJSDocTypedefNodes(t);for(const e of n){i.push(createDiagnosticForNode(e,wt.JSDoc_typedef_may_be_converted_to_TypeScript_type))}if(id.parameterShouldGetTypeFromJSDoc(t)){i.push(createDiagnosticForNode(t.name||t,wt.JSDoc_types_may_be_moved_to_TypeScript_types))}}if(canBeConvertedToAsync(t)){addConvertToAsyncFunctionDiagnostics(t,o,i)}t.forEachChild(check)}}function containsTopLevelCommonjs(e){return e.statements.some((e=>{switch(e.kind){case 243:return e.declarationList.declarations.some((e=>!!e.initializer&&isRequireCall(propertyAccessLeftHandSide(e.initializer),true)));case 244:{const{expression:t}=e;if(!isBinaryExpression(t))return isRequireCall(t,true);const n=getAssignmentDeclarationKind(t);return n===1||n===2}default:return false}}))}function propertyAccessLeftHandSide(e){return isPropertyAccessExpression(e)?propertyAccessLeftHandSide(e.expression):e}function importNameForConvertToDefaultImport(e){switch(e.kind){case 272:const{importClause:t,moduleSpecifier:n}=e;return t&&!t.name&&t.namedBindings&&t.namedBindings.kind===274&&isStringLiteral(n)?t.namedBindings.name:void 0;case 271:return e.name;default:return void 0}}function addConvertToAsyncFunctionDiagnostics(e,t,n){if(isConvertibleFunction(e,t)&&!cc.has(getKeyFromNode(e))){n.push(createDiagnosticForNode(!e.name&&isVariableDeclaration(e.parent)&&isIdentifier(e.parent.name)?e.parent.name:e,wt.This_may_be_converted_to_an_async_function))}}function isConvertibleFunction(e,t){return!isAsyncFunction(e)&&e.body&&isBlock(e.body)&&hasReturnStatementWithPromiseHandler(e.body,t)&&returnsPromise(e,t)}function returnsPromise(e,t){const n=t.getSignatureFromDeclaration(e);const r=n?t.getReturnTypeOfSignature(n):void 0;return!!r&&!!t.getPromisedTypeOfPromise(r)}function getErrorNodeFromCommonJsIndicator(e){return isBinaryExpression(e)?e.left:e}function hasReturnStatementWithPromiseHandler(e,t){return!!forEachReturnStatement(e,(e=>isReturnStatementWithFixablePromiseHandler(e,t)))}function isReturnStatementWithFixablePromiseHandler(e,t){return isReturnStatement(e)&&!!e.expression&&isFixablePromiseHandler(e.expression,t)}function isFixablePromiseHandler(e,t){if(!isPromiseHandler(e)||!hasSupportedNumberOfArguments(e)||!e.arguments.every((e=>isFixablePromiseArgument(e,t)))){return false}let n=e.expression.expression;while(isPromiseHandler(n)||isPropertyAccessExpression(n)){if(isCallExpression(n)){if(!hasSupportedNumberOfArguments(n)||!n.arguments.every((e=>isFixablePromiseArgument(e,t)))){return false}n=n.expression.expression}else{n=n.expression}}return true}function isPromiseHandler(e){return isCallExpression(e)&&(hasPropertyAccessExpressionWithName(e,"then")||hasPropertyAccessExpressionWithName(e,"catch")||hasPropertyAccessExpressionWithName(e,"finally"))}function hasSupportedNumberOfArguments(e){const t=e.expression.name.text;const n=t==="then"?2:t==="catch"?1:t==="finally"?1:0;if(e.arguments.length>n)return false;if(e.arguments.lengthe.kind===106||isIdentifier(e)&&e.text==="undefined"))}function isFixablePromiseArgument(e,t){switch(e.kind){case 262:case 218:const n=getFunctionFlags(e);if(n&1){return false}case 219:cc.set(getKeyFromNode(e),true);case 106:return true;case 80:case 211:{const n=t.getSymbolAtLocation(e);if(!n){return false}return t.isUndefinedSymbol(n)||some(skipAlias(n,t).declarations,(e=>isFunctionLike(e)||hasInitializer(e)&&!!e.initializer&&isFunctionLike(e.initializer)))}default:return false}}function getKeyFromNode(e){return`${e.pos.toString()}:${e.end.toString()}`}function canBeConvertedToClass(e,t){var n,r,i,o;if(isFunctionExpression(e)){if(isVariableDeclaration(e.parent)&&((n=e.symbol.members)==null?void 0:n.size)){return true}const o=t.getSymbolOfExpando(e,false);return!!(o&&(((r=o.exports)==null?void 0:r.size)||((i=o.members)==null?void 0:i.size)))}if(isFunctionDeclaration(e)){return!!((o=e.symbol.members)==null?void 0:o.size)}return false}function canBeConvertedToAsync(e){switch(e.kind){case 262:case 174:case 218:case 219:return true;default:return false}}var lc=new Set(["isolatedModules"]);function transpileModule(e,t){return transpileWorker(e,t,false)}function transpileDeclaration(e,t){return transpileWorker(e,t,true)}var dc=`/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number {}\ninterface Object {}\ninterface RegExp {}\ninterface String {}\ninterface Array { length: number; [n: number]: T; }\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}`;var pc="lib.d.ts";var uc;function transpileWorker(e,t,n){uc??(uc=createSourceFile(pc,dc,{languageVersion:99}));const r=[];const i=t.compilerOptions?fixupCompilerOptions(t.compilerOptions,r):{};const o=getDefaultCompilerOptions2();for(const e in o){if(hasProperty(o,e)&&i[e]===void 0){i[e]=o[e]}}for(const e of so){if(i.verbatimModuleSyntax&&lc.has(e.name)){continue}i[e.name]=e.transpileOptionValue}i.suppressOutputPathCheck=true;i.allowNonTsExtensions=true;if(n){i.declaration=true;i.emitDeclarationOnly=true;i.isolatedDeclarations=true}else{i.declaration=false;i.declarationMap=false}const a=getNewLineCharacter(i);const s={getSourceFile:e=>e===normalizePath(c)?l:e===normalizePath(pc)?uc:void 0,writeFile:(e,t)=>{if(fileExtensionIs(e,".map")){S.assertEqual(p,void 0,"Unexpected multiple source map outputs, file:",e);p=t}else{S.assertEqual(d,void 0,"Unexpected multiple outputs, file:",e);d=t}},getDefaultLibFileName:()=>pc,useCaseSensitiveFileNames:()=>false,getCanonicalFileName:e=>e,getCurrentDirectory:()=>"",getNewLine:()=>a,fileExists:e=>e===c||!!n&&e===pc,readFile:()=>"",directoryExists:()=>true,getDirectories:()=>[]};const c=t.fileName||(t.compilerOptions&&t.compilerOptions.jsx?"module.tsx":"module.ts");const l=createSourceFile(c,e,{languageVersion:zn(i),impliedNodeFormat:getImpliedNodeFormatForFile(toPath(c,"",s.getCanonicalFileName),void 0,s,i),setExternalModuleIndicator:getSetExternalModuleIndicator(i),jsDocParsingMode:t.jsDocParsingMode??0});if(t.moduleName){l.moduleName=t.moduleName}if(t.renamedDependencies){l.renamedDependencies=new Map(Object.entries(t.renamedDependencies))}let d;let p;const u=n?[c,pc]:[c];const f=createProgram(u,i,s);if(t.reportDiagnostics){addRange(r,f.getSyntacticDiagnostics(l));addRange(r,f.getOptionsDiagnostics())}const m=f.emit(void 0,void 0,void 0,n,t.transformers,n);addRange(r,m.diagnostics);if(d===void 0)return S.fail("Output generation failed");return{outputText:d,diagnostics:r,sourceMapText:p}}function transpile(e,t,n,r,i){const o=transpileModule(e,{compilerOptions:t,fileName:n,reportDiagnostics:!!r,moduleName:i});addRange(r,o.diagnostics);return o.outputText}var fc;function fixupCompilerOptions(e,t){fc=fc||filter(eo,(e=>typeof e.type==="object"&&!forEachEntry(e.type,(e=>typeof e!=="number"))));e=cloneCompilerOptions(e);for(const n of fc){if(!hasProperty(e,n.name)){continue}const r=e[n.name];if(isString(r)){e[n.name]=parseCustomTypeOption(n,r,t)}else{if(!forEachEntry(n.type,(e=>e===r))){t.push(createCompilerDiagnosticForInvalidCustomType(n))}}}return e}var mc={};__export(mc,{getNavigateToItems:()=>getNavigateToItems});function getNavigateToItems(e,t,n,r,i,o,a){const s=createPatternMatcher(r);if(!s)return d;const c=[];const l=e.length===1?e[0]:void 0;for(const r of e){n.throwIfCancellationRequested();if(o&&r.isDeclarationFile){continue}if(shouldExcludeFile(r,!!a,l)){continue}r.getNamedDeclarations().forEach(((e,n)=>{getItemsFromNamedDeclaration(s,n,e,t,r.fileName,!!a,l,c)}))}c.sort(compareNavigateToItems);return(i===void 0?c:c.slice(0,i)).map(createNavigateToItem)}function shouldExcludeFile(e,t,n){return e!==n&&t&&(isInsideNodeModules(e.path)||e.hasNoDefaultLib)}function getItemsFromNamedDeclaration(e,t,n,r,i,o,a,s){const c=e.getMatchForLastSegmentOfPattern(t);if(!c){return}for(const l of n){if(!shouldKeepItem(l,r,o,a))continue;if(e.patternContainsDots){const n=e.getFullMatch(getContainers(l),t);if(n){s.push({name:t,fileName:i,matchKind:n.kind,isCaseSensitive:n.isCaseSensitive,declaration:l})}}else{s.push({name:t,fileName:i,matchKind:c.kind,isCaseSensitive:c.isCaseSensitive,declaration:l})}}}function shouldKeepItem(e,t,n,r){var i;switch(e.kind){case 273:case 276:case 271:const o=t.getSymbolAtLocation(e.name);const a=t.getAliasedSymbol(o);return o.escapedName!==a.escapedName&&!((i=a.declarations)==null?void 0:i.every((e=>shouldExcludeFile(e.getSourceFile(),n,r))));default:return true}}function tryAddSingleDeclarationName(e,t){const n=getNameOfDeclaration(e);return!!n&&(pushLiteral(n,t)||n.kind===167&&tryAddComputedPropertyName(n.expression,t))}function tryAddComputedPropertyName(e,t){return pushLiteral(e,t)||isPropertyAccessExpression(e)&&(t.push(e.name.text),true)&&tryAddComputedPropertyName(e.expression,t)}function pushLiteral(e,t){return isPropertyNameLiteral(e)&&(t.push(getTextOfIdentifierOrLiteral(e)),true)}function getContainers(e){const t=[];const n=getNameOfDeclaration(e);if(n&&n.kind===167&&!tryAddComputedPropertyName(n.expression,t)){return d}t.shift();let r=getContainerNode(e);while(r){if(!tryAddSingleDeclarationName(r,t)){return d}r=getContainerNode(r)}t.reverse();return t}function compareNavigateToItems(e,t){return compareValues(e.matchKind,t.matchKind)||compareStringsCaseSensitiveUI(e.name,t.name)}function createNavigateToItem(e){const t=e.declaration;const n=getContainerNode(t);const r=n&&getNameOfDeclaration(n);return{name:e.name,kind:getNodeKind(t),kindModifiers:getNodeModifiers(t),matchKind:ac[e.matchKind],isCaseSensitive:e.isCaseSensitive,fileName:e.fileName,textSpan:createTextSpanFromNode(t),containerName:r?r.text:"",containerKind:r?getNodeKind(n):""}}var _c={};__export(_c,{getNavigationBarItems:()=>getNavigationBarItems,getNavigationTree:()=>getNavigationTree});var gc=/\s+/g;var yc=150;var hc;var Tc;var Sc=[];var vc;var xc=[];var bc;var Cc=[];function getNavigationBarItems(e,t){hc=t;Tc=e;try{return map(primaryNavBarMenuItems(rootNavigationBarNode(e)),convertToPrimaryNavBarMenuItem)}finally{reset()}}function getNavigationTree(e,t){hc=t;Tc=e;try{return convertToTree(rootNavigationBarNode(e))}finally{reset()}}function reset(){Tc=void 0;hc=void 0;Sc=[];vc=void 0;Cc=[]}function nodeText(e){return cleanText(e.getText(Tc))}function navigationBarNodeKind(e){return e.node.kind}function pushChild(e,t){if(e.children){e.children.push(t)}else{e.children=[t]}}function rootNavigationBarNode(e){S.assert(!Sc.length);const t={node:e,name:void 0,additionalNodes:void 0,parent:void 0,children:void 0,indent:0};vc=t;for(const t of e.statements){addChildrenRecursively(t)}endNode();S.assert(!vc&&!Sc.length);return t}function addLeafNode(e,t){pushChild(vc,emptyNavigationBarNode(e,t))}function emptyNavigationBarNode(e,t){return{node:e,name:t||(isDeclaration(e)||isExpression(e)?getNameOfDeclaration(e):void 0),additionalNodes:void 0,parent:vc,children:void 0,indent:vc.indent+1}}function addTrackedEs5Class(e){if(!bc){bc=new Map}bc.set(e,true)}function endNestedNodes(e){for(let t=0;t0;t--){const r=n[t];startNode(e,r)}return[n.length-1,n[0]]}function startNode(e,t){const n=emptyNavigationBarNode(e,t);pushChild(vc,n);Sc.push(vc);xc.push(bc);bc=void 0;vc=n}function endNode(){if(vc.children){mergeChildren(vc.children,vc);sortChildren(vc.children)}vc=Sc.pop();bc=xc.pop()}function addNodeWithRecursiveChild(e,t,n){startNode(e,n);addChildrenRecursively(t);endNode()}function addNodeWithRecursiveInitializer(e){if(e.initializer&&isFunctionOrClassExpression(e.initializer)){startNode(e);forEachChild(e.initializer,addChildrenRecursively);endNode()}else{addNodeWithRecursiveChild(e,e.initializer)}}function hasNavigationBarName(e){const t=getNameOfDeclaration(e);if(t===void 0)return false;if(isComputedPropertyName(t)){const e=t.expression;return isEntityNameExpression(e)||isNumericLiteral(e)||isStringOrNumericLiteralLike(e)}return!!t}function addChildrenRecursively(e){hc.throwIfCancellationRequested();if(!e||isToken(e)){return}switch(e.kind){case 176:const t=e;addNodeWithRecursiveChild(t,t.body);for(const e of t.parameters){if(isParameterPropertyDeclaration(e,t)){addLeafNode(e)}}break;case 174:case 177:case 178:case 173:if(hasNavigationBarName(e)){addNodeWithRecursiveChild(e,e.body)}break;case 172:if(hasNavigationBarName(e)){addNodeWithRecursiveInitializer(e)}break;case 171:if(hasNavigationBarName(e)){addLeafNode(e)}break;case 273:const n=e;if(n.name){addLeafNode(n.name)}const{namedBindings:r}=n;if(r){if(r.kind===274){addLeafNode(r)}else{for(const e of r.elements){addLeafNode(e)}}}break;case 304:addNodeWithRecursiveChild(e,e.name);break;case 305:const{expression:i}=e;isIdentifier(i)?addLeafNode(e,i):addLeafNode(e);break;case 208:case 303:case 260:{const t=e;if(isBindingPattern(t.name)){addChildrenRecursively(t.name)}else{addNodeWithRecursiveInitializer(t)}break}case 262:const o=e.name;if(o&&isIdentifier(o)){addTrackedEs5Class(o.text)}addNodeWithRecursiveChild(e,e.body);break;case 219:case 218:addNodeWithRecursiveChild(e,e.body);break;case 266:startNode(e);for(const t of e.members){if(!isComputedProperty(t)){addLeafNode(t)}}endNode();break;case 263:case 231:case 264:startNode(e);for(const t of e.members){addChildrenRecursively(t)}endNode();break;case 267:addNodeWithRecursiveChild(e,getInteriorModule(e).body);break;case 277:{const t=e.expression;const n=isObjectLiteralExpression(t)||isCallExpression(t)?t:isArrowFunction(t)||isFunctionExpression(t)?t.body:void 0;if(n){startNode(e);addChildrenRecursively(n);endNode()}else{addLeafNode(e)}break}case 281:case 271:case 181:case 179:case 180:case 265:addLeafNode(e);break;case 213:case 226:{const t=getAssignmentDeclarationKind(e);switch(t){case 1:case 2:addNodeWithRecursiveChild(e,e.right);return;case 6:case 3:{const n=e;const r=n.left;const i=t===3?r.expression:r;let o=0;let a;if(isIdentifier(i.expression)){addTrackedEs5Class(i.expression.text);a=i.expression}else{[o,a]=startNestedNodes(n,i.expression)}if(t===6){if(isObjectLiteralExpression(n.right)){if(n.right.properties.length>0){startNode(n,a);forEachChild(n.right,addChildrenRecursively);endNode()}}}else if(isFunctionExpression(n.right)||isArrowFunction(n.right)){addNodeWithRecursiveChild(e,n.right,a)}else{startNode(n,a);addNodeWithRecursiveChild(e,n.right,r.name);endNode()}endNestedNodes(o);return}case 7:case 9:{const n=e;const r=t===7?n.arguments[0]:n.arguments[0].expression;const i=n.arguments[1];const[o,a]=startNestedNodes(e,r);startNode(e,a);startNode(e,setTextRange(zr.createIdentifier(i.text),i));addChildrenRecursively(e.arguments[2]);endNode();endNode();endNestedNodes(o);return}case 5:{const t=e;const n=t.left;const r=n.expression;if(isIdentifier(r)&&getElementOrPropertyAccessName(n)!=="prototype"&&bc&&bc.has(r.text)){if(isFunctionExpression(t.right)||isArrowFunction(t.right)){addNodeWithRecursiveChild(e,t.right,r)}else if(isBindableStaticAccessExpression(n)){startNode(t,r);addNodeWithRecursiveChild(t.left,t.right,getNameOrArgument(n));endNode()}return}break}case 4:case 0:case 8:break;default:S.assertNever(t)}}default:if(hasJSDocNodes(e)){forEach(e.jsDoc,(e=>{forEach(e.tags,(e=>{if(isJSDocTypeAlias(e)){addLeafNode(e)}}))}))}forEachChild(e,addChildrenRecursively)}}function mergeChildren(e,t){const n=new Map;filterMutate(e,((e,r)=>{const i=e.name||getNameOfDeclaration(e.node);const o=i&&nodeText(i);if(!o){return true}const a=n.get(o);if(!a){n.set(o,e);return true}if(a instanceof Array){for(const n of a){if(tryMerge(n,e,r,t)){return false}}a.push(e);return true}else{const i=a;if(tryMerge(i,e,r,t)){return false}n.set(o,[i,e]);return true}}))}var Ec={[5]:true,[3]:true,[7]:true,[9]:true,[0]:false,[1]:false,[2]:false,[8]:false,[6]:true,[4]:false};function tryMergeEs5Class(e,t,n,r){function isPossibleConstructor(e){return isFunctionExpression(e)||isFunctionDeclaration(e)||isVariableDeclaration(e)}const i=isBinaryExpression(t.node)||isCallExpression(t.node)?getAssignmentDeclarationKind(t.node):0;const o=isBinaryExpression(e.node)||isCallExpression(e.node)?getAssignmentDeclarationKind(e.node):0;if(Ec[i]&&Ec[o]||isPossibleConstructor(e.node)&&Ec[i]||isPossibleConstructor(t.node)&&Ec[o]||isClassDeclaration(e.node)&&isSynthesized(e.node)&&Ec[i]||isClassDeclaration(t.node)&&Ec[o]||isClassDeclaration(e.node)&&isSynthesized(e.node)&&isPossibleConstructor(t.node)||isClassDeclaration(t.node)&&isPossibleConstructor(e.node)&&isSynthesized(e.node)){let i=e.additionalNodes&&lastOrUndefined(e.additionalNodes)||e.node;if(!isClassDeclaration(e.node)&&!isClassDeclaration(t.node)||isPossibleConstructor(e.node)||isPossibleConstructor(t.node)){const n=isPossibleConstructor(e.node)?e.node:isPossibleConstructor(t.node)?t.node:void 0;if(n!==void 0){const r=setTextRange(zr.createConstructorDeclaration(void 0,[],void 0),n);const i=emptyNavigationBarNode(r);i.indent=e.indent+1;i.children=e.node===n?e.children:t.children;e.children=e.node===n?concatenate([i],t.children||[t]):concatenate(e.children||[{...e}],[i])}else{if(e.children||t.children){e.children=concatenate(e.children||[{...e}],t.children||[t]);if(e.children){mergeChildren(e.children,e);sortChildren(e.children)}}}i=e.node=setTextRange(zr.createClassDeclaration(void 0,e.name||zr.createIdentifier("__class__"),void 0,void 0,[]),e.node)}else{e.children=concatenate(e.children,t.children);if(e.children){mergeChildren(e.children,e)}}const o=t.node;if(r.children[n-1].node.end===i.end){setTextRange(i,{pos:i.pos,end:o.end})}else{if(!e.additionalNodes)e.additionalNodes=[];e.additionalNodes.push(setTextRange(zr.createClassDeclaration(void 0,e.name||zr.createIdentifier("__class__"),void 0,void 0,[]),t.node))}return true}return i===0?false:true}function tryMerge(e,t,n,r){if(tryMergeEs5Class(e,t,n,r)){return true}if(shouldReallyMerge(e.node,t.node,r)){merge(e,t);return true}return false}function shouldReallyMerge(e,t,n){if(e.kind!==t.kind||e.parent!==t.parent&&!(isOwnChild(e,n)&&isOwnChild(t,n))){return false}switch(e.kind){case 172:case 174:case 177:case 178:return isStatic(e)===isStatic(t);case 267:return areSameModule(e,t)&&getFullyQualifiedModuleName(e)===getFullyQualifiedModuleName(t);default:return true}}function isSynthesized(e){return!!(e.flags&16)}function isOwnChild(e,t){if(e.parent===void 0)return false;const n=isModuleBlock(e.parent)?e.parent.parent:e.parent;return n===t.node||contains(t.additionalNodes,n)}function areSameModule(e,t){if(!e.body||!t.body){return e.body===t.body}return e.body.kind===t.body.kind&&(e.body.kind!==267||areSameModule(e.body,t.body))}function merge(e,t){e.additionalNodes=e.additionalNodes||[];e.additionalNodes.push(t.node);if(t.additionalNodes){e.additionalNodes.push(...t.additionalNodes)}e.children=concatenate(e.children,t.children);if(e.children){mergeChildren(e.children,e);sortChildren(e.children)}}function sortChildren(e){e.sort(compareChildren)}function compareChildren(e,t){return compareStringsCaseSensitiveUI(tryGetName(e.node),tryGetName(t.node))||compareValues(navigationBarNodeKind(e),navigationBarNodeKind(t))}function tryGetName(e){if(e.kind===267){return getModuleName(e)}const t=getNameOfDeclaration(e);if(t&&isPropertyName(t)){const e=getPropertyNameForPropertyNameNode(t);return e&&unescapeLeadingUnderscores(e)}switch(e.kind){case 218:case 219:case 231:return getFunctionOrClassName(e);default:return void 0}}function getItemName(e,t){if(e.kind===267){return cleanText(getModuleName(e))}if(t){const e=isIdentifier(t)?t.text:isElementAccessExpression(t)?`[${nodeText(t.argumentExpression)}]`:nodeText(t);if(e.length>0){return cleanText(e)}}switch(e.kind){case 307:const t=e;return isExternalModule(t)?`"${escapeString(getBaseFileName(removeFileExtension(normalizePath(t.fileName))))}"`:"";case 277:return isExportAssignment(e)&&e.isExportEquals?"export=":"default";case 219:case 262:case 218:case 263:case 231:if(getSyntacticModifierFlags(e)&2048){return"default"}return getFunctionOrClassName(e);case 176:return"constructor";case 180:return"new()";case 179:return"()";case 181:return"[]";default:return""}}function primaryNavBarMenuItems(e){const t=[];function recur(e){if(shouldAppearInPrimaryNavBarMenu(e)){t.push(e);if(e.children){for(const t of e.children){recur(t)}}}}recur(e);return t;function shouldAppearInPrimaryNavBarMenu(e){if(e.children){return true}switch(navigationBarNodeKind(e)){case 263:case 231:case 266:case 264:case 267:case 307:case 265:case 346:case 338:return true;case 219:case 262:case 218:return isTopLevelFunctionDeclaration(e);default:return false}function isTopLevelFunctionDeclaration(e){if(!e.node.body){return false}switch(navigationBarNodeKind(e.parent)){case 268:case 307:case 174:case 176:return true;default:return false}}}}function convertToTree(e){return{text:getItemName(e.node,e.name),kind:getNodeKind(e.node),kindModifiers:getModifiers2(e.node),spans:getSpans(e),nameSpan:e.name&&getNodeSpan(e.name),childItems:map(e.children,convertToTree)}}function convertToPrimaryNavBarMenuItem(e){return{text:getItemName(e.node,e.name),kind:getNodeKind(e.node),kindModifiers:getModifiers2(e.node),spans:getSpans(e),childItems:map(e.children,convertToSecondaryNavBarMenuItem)||Cc,indent:e.indent,bolded:false,grayed:false};function convertToSecondaryNavBarMenuItem(e){return{text:getItemName(e.node,e.name),kind:getNodeKind(e.node),kindModifiers:getNodeModifiers(e.node),spans:getSpans(e),childItems:Cc,indent:0,bolded:false,grayed:false}}}function getSpans(e){const t=[getNodeSpan(e.node)];if(e.additionalNodes){for(const n of e.additionalNodes){t.push(getNodeSpan(n))}}return t}function getModuleName(e){if(isAmbientModule(e)){return getTextOfNode(e.name)}return getFullyQualifiedModuleName(e)}function getFullyQualifiedModuleName(e){const t=[getTextOfIdentifierOrLiteral(e.name)];while(e.body&&e.body.kind===267){e=e.body;t.push(getTextOfIdentifierOrLiteral(e.name))}return t.join(".")}function getInteriorModule(e){return e.body&&isModuleDeclaration(e.body)?getInteriorModule(e.body):e}function isComputedProperty(e){return!e.name||e.name.kind===167}function getNodeSpan(e){return e.kind===307?createTextSpanFromRange(e):createTextSpanFromNode(e,Tc)}function getModifiers2(e){if(e.parent&&e.parent.kind===260){e=e.parent}return getNodeModifiers(e)}function getFunctionOrClassName(e){const{parent:t}=e;if(e.name&&getFullWidth(e.name)>0){return cleanText(declarationNameToString(e.name))}else if(isVariableDeclaration(t)){return cleanText(declarationNameToString(t.name))}else if(isBinaryExpression(t)&&t.operatorToken.kind===64){return nodeText(t.left).replace(gc,"")}else if(isPropertyAssignment(t)){return nodeText(t.name)}else if(getSyntacticModifierFlags(e)&2048){return"default"}else if(isClassLike(e)){return""}else if(isCallExpression(t)){let e=getCalledExpressionName(t.expression);if(e!==void 0){e=cleanText(e);if(e.length>yc){return`${e} callback`}const n=cleanText(mapDefined(t.arguments,(e=>isStringLiteralLike(e)||isTemplateLiteral(e)?e.getText(Tc):void 0)).join(", "));return`${e}(${n}) callback`}}return""}function getCalledExpressionName(e){if(isIdentifier(e)){return e.text}else if(isPropertyAccessExpression(e)){const t=getCalledExpressionName(e.expression);const n=e.name.text;return t===void 0?n:`${t}.${n}`}else{return void 0}}function isFunctionOrClassExpression(e){switch(e.kind){case 219:case 218:case 231:return true;default:return false}}function cleanText(e){e=e.length>yc?e.substring(0,yc)+"...":e;return e.replace(/\\?(?:\r?\n|[\r\u2028\u2029])/g,"")}var Nc={};__export(Nc,{addExportsInOldFile:()=>addExportsInOldFile,addImportsForMovedSymbols:()=>addImportsForMovedSymbols,addNewFileToTsconfig:()=>addNewFileToTsconfig,addOrRemoveBracesToArrowFunction:()=>Hc,addTargetFileImports:()=>addTargetFileImports,containsJsx:()=>containsJsx,convertArrowFunctionOrFunctionExpression:()=>el,convertParamsToDestructuredObject:()=>al,convertStringOrTemplateLiteral:()=>pl,convertToOptionalChainExpression:()=>_l,createNewFileName:()=>createNewFileName,doChangeNamedToNamespaceOrDefault:()=>doChangeNamedToNamespaceOrDefault,extractSymbol:()=>Tl,generateGetAccessorAndSetAccessor:()=>El,getApplicableRefactors:()=>getApplicableRefactors,getEditsForRefactor:()=>getEditsForRefactor,getExistingLocals:()=>getExistingLocals,getIdentifierForNode:()=>getIdentifierForNode,getNewStatementsAndRemoveFromOldFile:()=>getNewStatementsAndRemoveFromOldFile,getStatementsToMove:()=>getStatementsToMove,getUsageInfo:()=>getUsageInfo,inferFunctionReturnType:()=>Pl,isInImport:()=>isInImport,isRefactorErrorInfo:()=>isRefactorErrorInfo,refactorKindBeginsWith:()=>refactorKindBeginsWith,registerRefactor:()=>registerRefactor});var kc=new Map;function registerRefactor(e,t){kc.set(e,t)}function getApplicableRefactors(e,t){return arrayFrom(flatMapIterator(kc.values(),(n=>{var r;return e.cancellationToken&&e.cancellationToken.isCancellationRequested()||!((r=n.kinds)==null?void 0:r.some((t=>refactorKindBeginsWith(t,e.kind))))?void 0:n.getAvailableActions(e,t)})))}function getEditsForRefactor(e,t,n,r){const i=kc.get(t);return i&&i.getEditsForAction(e,n,r)}var Fc="Convert export";var Pc={name:"Convert default export to named export",description:getLocaleSpecificMessage(wt.Convert_default_export_to_named_export),kind:"refactor.rewrite.export.named"};var Dc={name:"Convert named export to default export",description:getLocaleSpecificMessage(wt.Convert_named_export_to_default_export),kind:"refactor.rewrite.export.default"};registerRefactor(Fc,{kinds:[Pc.kind,Dc.kind],getAvailableActions:function getRefactorActionsToConvertBetweenNamedAndDefaultExports(e){const t=getInfo2(e,e.triggerReason==="invoked");if(!t)return d;if(!isRefactorErrorInfo(t)){const e=t.wasDefault?Pc:Dc;return[{name:Fc,description:e.description,actions:[e]}]}if(e.preferences.provideRefactorNotApplicableReason){return[{name:Fc,description:getLocaleSpecificMessage(wt.Convert_default_export_to_named_export),actions:[{...Pc,notApplicableReason:t.error},{...Dc,notApplicableReason:t.error}]}]}return d},getEditsForAction:function getRefactorEditsToConvertBetweenNamedAndDefaultExports(e,t){S.assert(t===Pc.name||t===Dc.name,"Unexpected action name");const n=getInfo2(e);S.assert(n&&!isRefactorErrorInfo(n),"Expected applicable refactor info");const r=dm.ChangeTracker.with(e,(t=>doChange(e.file,e.program,n,t,e.cancellationToken)));return{edits:r,renameFilename:void 0,renameLocation:void 0}}});function getInfo2(e,t=true){const{file:n,program:r}=e;const i=getRefactorContextSpan(e);const o=getTokenAtPosition(n,i.start);const a=!!(o.parent&&getSyntacticModifierFlags(o.parent)&32)&&t?o.parent:getParentNodeInSpan(o,n,i);if(!a||!isSourceFile(a.parent)&&!(isModuleBlock(a.parent)&&isAmbientModule(a.parent.parent))){return{error:getLocaleSpecificMessage(wt.Could_not_find_export_statement)}}const s=r.getTypeChecker();const c=getExportingModuleSymbol(a.parent,s);const l=getSyntacticModifierFlags(a)||(isExportAssignment(a)&&!a.isExportEquals?2080:0);const d=!!(l&2048);if(!(l&32)||!d&&c.exports.has("default")){return{error:getLocaleSpecificMessage(wt.This_file_already_has_a_default_export)}}const noSymbolError=e=>isIdentifier(e)&&s.getSymbolAtLocation(e)?void 0:{error:getLocaleSpecificMessage(wt.Can_only_convert_named_export)};switch(a.kind){case 262:case 263:case 264:case 266:case 265:case 267:{const e=a;if(!e.name)return void 0;return noSymbolError(e.name)||{exportNode:e,exportName:e.name,wasDefault:d,exportingModuleSymbol:c}}case 243:{const e=a;if(!(e.declarationList.flags&2)||e.declarationList.declarations.length!==1){return void 0}const t=first(e.declarationList.declarations);if(!t.initializer)return void 0;S.assert(!d,"Can't have a default flag here");return noSymbolError(t.name)||{exportNode:e,exportName:t.name,wasDefault:d,exportingModuleSymbol:c}}case 277:{const e=a;if(e.isExportEquals)return void 0;return noSymbolError(e.expression)||{exportNode:e,exportName:e.expression,wasDefault:d,exportingModuleSymbol:c}}default:return void 0}}function doChange(e,t,n,r,i){changeExport(e,n,r,t.getTypeChecker());changeImports(t,n,r,i)}function changeExport(e,{wasDefault:t,exportNode:n,exportName:r},i,o){if(t){if(isExportAssignment(n)&&!n.isExportEquals){const t=n.expression;const r=makeExportSpecifier(t.text,t.text);i.replaceNode(e,n,zr.createExportDeclaration(void 0,false,zr.createNamedExports([r])))}else{i.delete(e,S.checkDefined(findModifier(n,90),"Should find a default keyword in modifier list"))}}else{const t=S.checkDefined(findModifier(n,95),"Should find an export keyword in modifier list");switch(n.kind){case 262:case 263:case 264:i.insertNodeAfter(e,t,zr.createToken(90));break;case 243:const a=first(n.declarationList.declarations);if(!Rf.Core.isSymbolReferencedInFile(r,o,e)&&!a.type){i.replaceNode(e,n,zr.createExportDefault(S.checkDefined(a.initializer,"Initializer was previously known to be present")));break}case 266:case 265:case 267:i.deleteModifier(e,t);i.insertNodeAfter(e,n,zr.createExportDefault(zr.createIdentifier(r.text)));break;default:S.fail(`Unexpected exportNode kind ${n.kind}`)}}}function changeImports(e,{wasDefault:t,exportName:n,exportingModuleSymbol:r},i,o){const a=e.getTypeChecker();const s=S.checkDefined(a.getSymbolAtLocation(n),"Export name should resolve to a symbol");Rf.Core.eachExportReference(e.getSourceFiles(),a,o,s,r,n.text,t,(e=>{if(n===e)return;const r=e.getSourceFile();if(t){changeDefaultToNamedImport(r,e,i,n.text)}else{changeNamedToDefaultImport(r,e,i)}}))}function changeDefaultToNamedImport(e,t,n,r){const{parent:i}=t;switch(i.kind){case 211:n.replaceNode(e,t,zr.createIdentifier(r));break;case 276:case 281:{const t=i;n.replaceNode(e,t,makeImportSpecifier(r,t.name.text));break}case 273:{const o=i;S.assert(o.name===t,"Import clause name should match provided ref");const a=makeImportSpecifier(r,t.text);const{namedBindings:s}=o;if(!s){n.replaceNode(e,t,zr.createNamedImports([a]))}else if(s.kind===274){n.deleteRange(e,{pos:t.getStart(e),end:s.getStart(e)});const i=isStringLiteral(o.parent.moduleSpecifier)?quotePreferenceFromString(o.parent.moduleSpecifier,e):1;const a=makeImport(void 0,[makeImportSpecifier(r,t.text)],o.parent.moduleSpecifier,i);n.insertNodeAfter(e,o.parent,a)}else{n.delete(e,t);n.insertNodeAtEndOfList(e,s.elements,a)}break}case 205:const o=i;n.replaceNode(e,i,zr.createImportTypeNode(o.argument,o.attributes,zr.createIdentifier(r),o.typeArguments,o.isTypeOf));break;default:S.failBadSyntaxKind(i)}}function changeNamedToDefaultImport(e,t,n){const r=t.parent;switch(r.kind){case 211:n.replaceNode(e,t,zr.createIdentifier("default"));break;case 276:{const t=zr.createIdentifier(r.name.text);if(r.parent.elements.length===1){n.replaceNode(e,r.parent,t)}else{n.delete(e,r);n.insertNodeBefore(e,r.parent,t)}break}case 281:{n.replaceNode(e,r,makeExportSpecifier("default",r.name.text));break}default:S.assertNever(r,`Unexpected parent kind ${r.kind}`)}}function makeImportSpecifier(e,t){return zr.createImportSpecifier(false,e===t?void 0:zr.createIdentifier(e),zr.createIdentifier(t))}function makeExportSpecifier(e,t){return zr.createExportSpecifier(false,e===t?void 0:zr.createIdentifier(e),zr.createIdentifier(t))}function getExportingModuleSymbol(e,t){if(isSourceFile(e)){return e.symbol}const n=e.parent.symbol;if(n.valueDeclaration&&isExternalModuleAugmentation(n.valueDeclaration)){return t.getMergedSymbol(n)}return n}var Ic="Convert import";var Ac={[0]:{name:"Convert namespace import to named imports",description:getLocaleSpecificMessage(wt.Convert_namespace_import_to_named_imports),kind:"refactor.rewrite.import.named"},[2]:{name:"Convert named imports to namespace import",description:getLocaleSpecificMessage(wt.Convert_named_imports_to_namespace_import),kind:"refactor.rewrite.import.namespace"},[1]:{name:"Convert named imports to default import",description:getLocaleSpecificMessage(wt.Convert_named_imports_to_default_import),kind:"refactor.rewrite.import.default"}};registerRefactor(Ic,{kinds:getOwnValues(Ac).map((e=>e.kind)),getAvailableActions:function getRefactorActionsToConvertBetweenNamedAndNamespacedImports(e){const t=getImportConversionInfo(e,e.triggerReason==="invoked");if(!t)return d;if(!isRefactorErrorInfo(t)){const e=Ac[t.convertTo];return[{name:Ic,description:e.description,actions:[e]}]}if(e.preferences.provideRefactorNotApplicableReason){return getOwnValues(Ac).map((e=>({name:Ic,description:e.description,actions:[{...e,notApplicableReason:t.error}]})))}return d},getEditsForAction:function getRefactorEditsToConvertBetweenNamedAndNamespacedImports(e,t){S.assert(some(getOwnValues(Ac),(e=>e.name===t)),"Unexpected action name");const n=getImportConversionInfo(e);S.assert(n&&!isRefactorErrorInfo(n),"Expected applicable refactor info");const r=dm.ChangeTracker.with(e,(t=>doChange2(e.file,e.program,t,n)));return{edits:r,renameFilename:void 0,renameLocation:void 0}}});function getImportConversionInfo(e,t=true){const{file:n}=e;const r=getRefactorContextSpan(e);const i=getTokenAtPosition(n,r.start);const o=t?findAncestor(i,or(isImportDeclaration,isJSDocImportTag)):getParentNodeInSpan(i,n,r);if(o===void 0||!(isImportDeclaration(o)||isJSDocImportTag(o)))return{error:"Selection is not an import declaration."};const a=r.start+r.length;const s=findNextToken(o,o.parent,n);if(s&&a>s.getStart())return void 0;const{importClause:c}=o;if(!c){return{error:getLocaleSpecificMessage(wt.Could_not_find_import_clause)}}if(!c.namedBindings){return{error:getLocaleSpecificMessage(wt.Could_not_find_namespace_import_or_named_imports)}}if(c.namedBindings.kind===274){return{convertTo:0,import:c.namedBindings}}const l=getShouldUseDefault(e.program,c);return l?{convertTo:1,import:c.namedBindings}:{convertTo:2,import:c.namedBindings}}function getShouldUseDefault(e,t){return $n(e.getCompilerOptions())&&isExportEqualsModule(t.parent.moduleSpecifier,e.getTypeChecker())}function doChange2(e,t,n,r){const i=t.getTypeChecker();if(r.convertTo===0){doChangeNamespaceToNamed(e,i,n,r.import,$n(t.getCompilerOptions()))}else{doChangeNamedToNamespaceOrDefault(e,t,n,r.import,r.convertTo===1)}}function doChangeNamespaceToNamed(e,t,n,r,i){let o=false;const a=[];const s=new Map;Rf.Core.eachSymbolReferenceInFile(r.name,t,e,(e=>{if(!isPropertyAccessOrQualifiedName(e.parent)){o=true}else{const n=getRightOfPropertyAccessOrQualifiedName(e.parent).text;if(t.resolveName(n,e,-1,true)){s.set(n,true)}S.assert(getLeftOfPropertyAccessOrQualifiedName(e.parent)===e,"Parent expression should match id");a.push(e.parent)}}));const c=new Map;for(const t of a){const r=getRightOfPropertyAccessOrQualifiedName(t).text;let i=c.get(r);if(i===void 0){c.set(r,i=s.has(r)?getUniqueName(r,e):r)}n.replaceNode(e,t,zr.createIdentifier(i))}const l=[];c.forEach(((e,t)=>{l.push(zr.createImportSpecifier(false,e===t?void 0:zr.createIdentifier(t),zr.createIdentifier(e)))}));const d=r.parent.parent;if(o&&!i&&isImportDeclaration(d)){n.insertNodeAfter(e,d,createImport(d,void 0,l))}else{const t=o?zr.createIdentifier(r.name.text):void 0;n.replaceNode(e,r.parent,createImportClause(t,l))}}function getRightOfPropertyAccessOrQualifiedName(e){return isPropertyAccessExpression(e)?e.name:e.right}function getLeftOfPropertyAccessOrQualifiedName(e){return isPropertyAccessExpression(e)?e.expression:e.left}function doChangeNamedToNamespaceOrDefault(e,t,n,r,i=getShouldUseDefault(t,r.parent)){const o=t.getTypeChecker();const a=r.parent.parent;const{moduleSpecifier:s}=a;const c=new Set;r.elements.forEach((e=>{const t=o.getSymbolAtLocation(e.name);if(t){c.add(t)}}));const l=s&&isStringLiteral(s)?moduleSpecifierToValidIdentifier(s.text,99):"module";function hasNamespaceNameConflict(t){return!!Rf.Core.eachSymbolReferenceInFile(t.name,o,e,(e=>{const t=o.resolveName(l,e,-1,true);if(t){if(c.has(t)){return isExportSpecifier(e.parent)}return true}return false}))}const d=r.elements.some(hasNamespaceNameConflict);const p=d?getUniqueName(l,e):l;const u=new Set;for(const t of r.elements){const r=t.propertyName||t.name;Rf.Core.eachSymbolReferenceInFile(t.name,o,e,(i=>{const o=r.kind===11?zr.createElementAccessExpression(zr.createIdentifier(p),zr.cloneNode(r)):zr.createPropertyAccessExpression(zr.createIdentifier(p),zr.cloneNode(r));if(isShorthandPropertyAssignment(i.parent)){n.replaceNode(e,i.parent,zr.createPropertyAssignment(i.text,o))}else if(isExportSpecifier(i.parent)){u.add(t)}else{n.replaceNode(e,i,o)}}))}n.replaceNode(e,r,i?zr.createIdentifier(p):zr.createNamespaceImport(zr.createIdentifier(p)));if(u.size&&isImportDeclaration(a)){const t=arrayFrom(u.values(),(e=>zr.createImportSpecifier(e.isTypeOnly,e.propertyName&&zr.cloneNode(e.propertyName),zr.cloneNode(e.name))));n.insertNodeAfter(e,r.parent.parent,createImport(a,void 0,t))}}function isExportEqualsModule(e,t){const n=t.resolveExternalModuleName(e);if(!n)return false;const r=t.resolveExternalModuleSymbol(n);return n!==r}function createImport(e,t,n){return zr.createImportDeclaration(void 0,createImportClause(t,n),e.moduleSpecifier,void 0)}function createImportClause(e,t){return zr.createImportClause(false,e,t&&t.length?zr.createNamedImports(t):void 0)}var Oc="Extract type";var wc={name:"Extract to type alias",description:getLocaleSpecificMessage(wt.Extract_to_type_alias),kind:"refactor.extract.type"};var Lc={name:"Extract to interface",description:getLocaleSpecificMessage(wt.Extract_to_interface),kind:"refactor.extract.interface"};var Mc={name:"Extract to typedef",description:getLocaleSpecificMessage(wt.Extract_to_typedef),kind:"refactor.extract.typedef"};registerRefactor(Oc,{kinds:[wc.kind,Lc.kind,Mc.kind],getAvailableActions:function getRefactorActionsToExtractType(e){const{info:t,affectedTextRange:n}=getRangeToExtract(e,e.triggerReason==="invoked");if(!t)return d;if(!isRefactorErrorInfo(t)){const r=[{name:Oc,description:getLocaleSpecificMessage(wt.Extract_type),actions:t.isJS?[Mc]:append([wc],t.typeElements&&Lc)}];return r.map((t=>({...t,actions:t.actions.map((t=>({...t,range:n?{start:{line:getLineAndCharacterOfPosition(e.file,n.pos).line,offset:getLineAndCharacterOfPosition(e.file,n.pos).character},end:{line:getLineAndCharacterOfPosition(e.file,n.end).line,offset:getLineAndCharacterOfPosition(e.file,n.end).character}}:void 0})))})))}if(e.preferences.provideRefactorNotApplicableReason){return[{name:Oc,description:getLocaleSpecificMessage(wt.Extract_type),actions:[{...Mc,notApplicableReason:t.error},{...wc,notApplicableReason:t.error},{...Lc,notApplicableReason:t.error}]}]}return d},getEditsForAction:function getRefactorEditsToExtractType(e,t){const{file:n}=e;const{info:r}=getRangeToExtract(e);S.assert(r&&!isRefactorErrorInfo(r),"Expected to find a range to extract");const i=getUniqueName("NewType",n);const o=dm.ChangeTracker.with(e,(o=>{switch(t){case wc.name:S.assert(!r.isJS,"Invalid actionName/JS combo");return doTypeAliasChange(o,n,i,r);case Mc.name:S.assert(r.isJS,"Invalid actionName/JS combo");return doTypedefChange(o,e,n,i,r);case Lc.name:S.assert(!r.isJS&&!!r.typeElements,"Invalid actionName/JS combo");return doInterfaceChange(o,n,i,r);default:S.fail("Unexpected action name")}}));const a=n.fileName;const s=getRenameLocation(o,a,i,false);return{edits:o,renameFilename:a,renameLocation:s}}});function getRangeToExtract(e,t=true){const{file:n,startPosition:r}=e;const i=isSourceFileJS(n);const o=createTextRangeFromSpan(getRefactorContextSpan(e));const a=o.pos===o.end&&t;const s=getFirstTypeAt(n,r,o,a);if(!s||!isTypeNode(s))return{info:{error:getLocaleSpecificMessage(wt.Selection_is_not_a_valid_type_node)},affectedTextRange:void 0};const c=e.program.getTypeChecker();const l=getEnclosingNode(s,i);if(l===void 0)return{info:{error:getLocaleSpecificMessage(wt.No_type_could_be_extracted_from_this_type_node)},affectedTextRange:void 0};const d=getExpandedSelectionNode(s,l);if(!isTypeNode(d))return{info:{error:getLocaleSpecificMessage(wt.Selection_is_not_a_valid_type_node)},affectedTextRange:void 0};const p=[];if((isUnionTypeNode(d.parent)||isIntersectionTypeNode(d.parent))&&o.end>s.end){addRange(p,d.parent.types.filter((e=>nodeOverlapsWithStartEnd(e,n,o.pos,o.end))))}const u=p.length>1?p:d;const{typeParameters:f,affectedTextRange:m}=collectTypeParameters(c,u,l,n);if(!f)return{info:{error:getLocaleSpecificMessage(wt.No_type_could_be_extracted_from_this_type_node)},affectedTextRange:void 0};const _=flattenTypeLiteralNodeReference(c,u);return{info:{isJS:i,selection:u,enclosingNode:l,typeParameters:f,typeElements:_},affectedTextRange:m}}function getFirstTypeAt(e,t,n,r){const i=[()=>getTokenAtPosition(e,t),()=>getTouchingToken(e,t,(()=>true))];for(const t of i){const i=t();const o=nodeOverlapsWithStartEnd(i,e,n.pos,n.end);const a=findAncestor(i,(t=>t.parent&&isTypeNode(t)&&!rangeContainsSkipTrivia(n,t.parent,e)&&(r||o)));if(a){return a}}return void 0}function flattenTypeLiteralNodeReference(e,t){if(!t)return void 0;if(isArray(t)){const n=[];for(const r of t){const t=flattenTypeLiteralNodeReference(e,r);if(!t)return void 0;addRange(n,t)}return n}if(isIntersectionTypeNode(t)){const n=[];const r=new Set;for(const i of t.types){const t=flattenTypeLiteralNodeReference(e,i);if(!t||!t.every((e=>e.name&&addToSeen(r,getNameFromPropertyName(e.name))))){return void 0}addRange(n,t)}return n}else if(isParenthesizedTypeNode(t)){return flattenTypeLiteralNodeReference(e,t.type)}else if(isTypeLiteralNode(t)){return t.members}return void 0}function rangeContainsSkipTrivia(e,t,n){return rangeContainsStartEnd(e,skipTrivia(n.text,t.pos),t.end)}function collectTypeParameters(e,t,n,r){const i=[];const o=toArray(t);const a={pos:o[0].getStart(r),end:o[o.length-1].end};for(const e of o){if(visitor(e))return{typeParameters:void 0,affectedTextRange:void 0}}return{typeParameters:i,affectedTextRange:a};function visitor(t){if(isTypeReferenceNode(t)){if(isIdentifier(t.typeName)){const o=t.typeName;const s=e.resolveName(o.text,o,262144,true);for(const e of(s==null?void 0:s.declarations)||d){if(isTypeParameterDeclaration(e)&&e.getSourceFile()===r){if(e.name.escapedText===o.escapedText&&rangeContainsSkipTrivia(e,a,r)){return true}if(rangeContainsSkipTrivia(n,e,r)&&!rangeContainsSkipTrivia(a,e,r)){pushIfUnique(i,e);break}}}}}else if(isInferTypeNode(t)){const e=findAncestor(t,(e=>isConditionalTypeNode(e)&&rangeContainsSkipTrivia(e.extendsType,t,r)));if(!e||!rangeContainsSkipTrivia(a,e,r)){return true}}else if(isTypePredicateNode(t)||isThisTypeNode(t)){const e=findAncestor(t.parent,isFunctionLike);if(e&&e.type&&rangeContainsSkipTrivia(e.type,t,r)&&!rangeContainsSkipTrivia(a,e,r)){return true}}else if(isTypeQueryNode(t)){if(isIdentifier(t.exprName)){const i=e.resolveName(t.exprName.text,t.exprName,111551,false);if((i==null?void 0:i.valueDeclaration)&&rangeContainsSkipTrivia(n,i.valueDeclaration,r)&&!rangeContainsSkipTrivia(a,i.valueDeclaration,r)){return true}}else{if(isThisIdentifier(t.exprName.left)&&!rangeContainsSkipTrivia(a,t.parent,r)){return true}}}if(r&&isTupleTypeNode(t)&&getLineAndCharacterOfPosition(r,t.pos).line===getLineAndCharacterOfPosition(r,t.end).line){setEmitFlags(t,1)}return forEachChild(t,visitor)}}function doTypeAliasChange(e,t,n,r){const{enclosingNode:i,typeParameters:o}=r;const{firstTypeNode:a,lastTypeNode:s,newTypeNode:c}=getNodesToEdit(r);const l=zr.createTypeAliasDeclaration(void 0,n,o.map((e=>zr.updateTypeParameterDeclaration(e,e.modifiers,e.name,e.constraint,void 0))),c);e.insertNodeBefore(t,i,ignoreSourceNewlines(l),true);e.replaceNodeRange(t,a,s,zr.createTypeReferenceNode(n,o.map((e=>zr.createTypeReferenceNode(e.name,void 0)))),{leadingTriviaOption:dm.LeadingTriviaOption.Exclude,trailingTriviaOption:dm.TrailingTriviaOption.ExcludeWhitespace})}function doInterfaceChange(e,t,n,r){var i;const{enclosingNode:o,typeParameters:a,typeElements:s}=r;const c=zr.createInterfaceDeclaration(void 0,n,a,void 0,s);setTextRange(c,(i=s[0])==null?void 0:i.parent);e.insertNodeBefore(t,o,ignoreSourceNewlines(c),true);const{firstTypeNode:l,lastTypeNode:d}=getNodesToEdit(r);e.replaceNodeRange(t,l,d,zr.createTypeReferenceNode(n,a.map((e=>zr.createTypeReferenceNode(e.name,void 0)))),{leadingTriviaOption:dm.LeadingTriviaOption.Exclude,trailingTriviaOption:dm.TrailingTriviaOption.ExcludeWhitespace})}function doTypedefChange(e,t,n,r,i){var o;toArray(i.selection).forEach((e=>{setEmitFlags(e,3072|4096)}));const{enclosingNode:a,typeParameters:s}=i;const{firstTypeNode:c,lastTypeNode:l,newTypeNode:d}=getNodesToEdit(i);const p=zr.createJSDocTypedefTag(zr.createIdentifier("typedef"),zr.createJSDocTypeExpression(d),zr.createIdentifier(r));const u=[];forEach(s,(e=>{const t=getEffectiveConstraintOfTypeParameter(e);const n=zr.createTypeParameterDeclaration(void 0,e.name);const r=zr.createJSDocTemplateTag(zr.createIdentifier("template"),t&&cast(t,isJSDocTypeExpression),[n]);u.push(r)}));const f=zr.createJSDocComment(void 0,zr.createNodeArray(concatenate(u,[p])));if(isJSDoc(a)){const r=a.getStart(n);const i=getNewLineOrDefaultFromHost(t.host,(o=t.formatContext)==null?void 0:o.options);e.insertNodeAt(n,a.getStart(n),f,{suffix:i+i+n.text.slice(getPrecedingNonSpaceCharacterPosition(n.text,r-1),r)})}else{e.insertNodeBefore(n,a,f,true)}e.replaceNodeRange(n,c,l,zr.createTypeReferenceNode(r,s.map((e=>zr.createTypeReferenceNode(e.name,void 0)))))}function getNodesToEdit(e){if(isArray(e.selection)){return{firstTypeNode:e.selection[0],lastTypeNode:e.selection[e.selection.length-1],newTypeNode:isUnionTypeNode(e.selection[0].parent)?zr.createUnionTypeNode(e.selection):zr.createIntersectionTypeNode(e.selection)}}return{firstTypeNode:e.selection,lastTypeNode:e.selection,newTypeNode:e.selection}}function getEnclosingNode(e,t){return findAncestor(e,isStatement)||(t?findAncestor(e,isJSDoc):void 0)}function getExpandedSelectionNode(e,t){return findAncestor(e,(e=>{if(e===t)return"quit";if(isUnionTypeNode(e.parent)||isIntersectionTypeNode(e.parent)){return true}return false}))??e}var Rc="Move to file";var Bc=getLocaleSpecificMessage(wt.Move_to_file);var jc={name:"Move to file",description:Bc,kind:"refactor.move.file"};registerRefactor(Rc,{kinds:[jc.kind],getAvailableActions:function getRefactorActionsToMoveToFile(e,t){const n=e.file;const r=getStatementsToMove(e);if(!t){return d}if(e.triggerReason==="implicit"&&e.endPosition!==void 0){const t=findAncestor(getTokenAtPosition(n,e.startPosition),isBlockLike);const r=findAncestor(getTokenAtPosition(n,e.endPosition),isBlockLike);if(t&&!isSourceFile(t)&&r&&!isSourceFile(r)){return d}}if(e.preferences.allowTextChangesInNewFiles&&r){const e={start:{line:getLineAndCharacterOfPosition(n,r.all[0].getStart(n)).line,offset:getLineAndCharacterOfPosition(n,r.all[0].getStart(n)).character},end:{line:getLineAndCharacterOfPosition(n,last(r.all).end).line,offset:getLineAndCharacterOfPosition(n,last(r.all).end).character}};return[{name:Rc,description:Bc,actions:[{...jc,range:e}]}]}if(e.preferences.provideRefactorNotApplicableReason){return[{name:Rc,description:Bc,actions:[{...jc,notApplicableReason:getLocaleSpecificMessage(wt.Selection_is_not_a_valid_statement_or_statements)}]}]}return d},getEditsForAction:function getRefactorEditsToMoveToFile(e,t,n){S.assert(t===Rc,"Wrong refactor invoked");const r=S.checkDefined(getStatementsToMove(e));const{host:i,program:o}=e;S.assert(n,"No interactive refactor arguments available");const a=n.targetFile;if(hasJSFileExtension(a)||hasTSFileExtension(a)){if(i.fileExists(a)&&o.getSourceFile(a)===void 0){return error(getLocaleSpecificMessage(wt.Cannot_move_statements_to_the_selected_file))}const t=dm.ChangeTracker.with(e,(t=>doChange3(e,e.file,n.targetFile,e.program,r,t,e.host,e.preferences)));return{edits:t,renameFilename:void 0,renameLocation:void 0}}return error(getLocaleSpecificMessage(wt.Cannot_move_to_file_selected_file_is_invalid))}});function error(e){return{edits:[],renameFilename:void 0,renameLocation:void 0,notApplicableReason:e}}function doChange3(e,t,n,r,i,o,a,s){const c=r.getTypeChecker();const l=!a.fileExists(n);const d=l?createFutureSourceFile(n,t.externalModuleIndicator?99:t.commonJsModuleIndicator?1:void 0,r,a):S.checkDefined(r.getSourceFile(n));const p=id.createImportAdder(t,e.program,e.preferences,e.host);const u=id.createImportAdder(d,e.program,e.preferences,e.host);getNewStatementsAndRemoveFromOldFile(t,d,getUsageInfo(t,i.all,c,l?void 0:getExistingLocals(d,i.all,c)),o,i,r,a,s,u,p);if(l){addNewFileToTsconfig(r,o,t.fileName,n,hostGetCanonicalFileName(a))}}function getNewStatementsAndRemoveFromOldFile(e,t,n,r,i,o,a,s,c,l){const d=o.getTypeChecker();const p=takeWhile(e.statements,isPrologueDirective);const u=!fileShouldUseJavaScriptRequire(t.fileName,o,a,!!e.commonJsModuleIndicator);const f=getQuotePreference(e,s);addImportsForMovedSymbols(n.oldFileImportsFromTargetFile,t.fileName,l,o);deleteUnusedOldImports(e,i.all,n.unusedImportsFromOldFile,l);l.writeFixes(r,f);deleteMovedStatements(e,i.ranges,r);updateImportsInOtherFiles(r,o,a,e,n.movedSymbols,t.fileName,f);addExportsInOldFile(e,n.targetFileImportsFromOldFile,r,u);addTargetFileImports(e,n.oldImportsNeededByTargetFile,n.targetFileImportsFromOldFile,d,o,c);if(!isFullSourceFile(t)&&p.length){r.insertStatementsInNewFile(t.fileName,p,e)}c.writeFixes(r,f);const m=addExports(e,i.all,arrayFrom(n.oldFileImportsFromTargetFile.keys()),u);if(isFullSourceFile(t)&&t.statements.length>0){moveStatementsToTargetFile(r,o,m,t,i)}else if(isFullSourceFile(t)){r.insertNodesAtEndOfFile(t,m,false)}else{r.insertStatementsInNewFile(t.fileName,c.hasFixes()?[4,...m]:m,e)}}function addNewFileToTsconfig(e,t,n,r,i){const o=e.getCompilerOptions().configFile;if(!o)return;const a=normalizePath(combinePaths(n,"..",r));const s=getRelativePathFromFile(o.fileName,a,i);const c=o.statements[0]&&tryCast(o.statements[0].expression,isObjectLiteralExpression);const l=c&&find(c.properties,(e=>isPropertyAssignment(e)&&isStringLiteral(e.name)&&e.name.text==="files"));if(l&&isArrayLiteralExpression(l.initializer)){t.insertNodeInListAfter(o,last(l.initializer.elements),zr.createStringLiteral(s),l.initializer.elements)}}function deleteMovedStatements(e,t,n){for(const{first:r,afterLast:i}of t){n.deleteNodeRangeExcludingEnd(e,r,i)}}function deleteUnusedOldImports(e,t,n,r){for(const i of e.statements){if(contains(t,i))continue;forEachImportInStatement(i,(e=>{forEachAliasDeclarationInImportOrRequire(e,(e=>{if(n.has(e.symbol)){r.removeExistingImport(e)}}))}))}}function addExportsInOldFile(e,t,n,r){const i=nodeSeenTracker();t.forEach(((t,o)=>{if(!o.declarations){return}for(const t of o.declarations){if(!isTopLevelDeclaration(t))continue;const o=nameOfTopLevelDeclaration(t);if(!o)continue;const a=getTopLevelDeclarationStatement(t);if(i(a)){addExportToChanges(e,a,o,n,r)}}}))}function updateImportsInOtherFiles(e,t,n,r,i,o,a){const s=t.getTypeChecker();for(const c of t.getSourceFiles()){if(c===r)continue;for(const l of c.statements){forEachImportInStatement(l,(d=>{if(s.getSymbolAtLocation(moduleSpecifierFromImport(d))!==r.symbol)return;const shouldMove=e=>{const t=isBindingElement(e.parent)?getPropertySymbolFromBindingElement(s,e.parent):skipAlias(s.getSymbolAtLocation(e),s);return!!t&&i.has(t)};deleteUnusedImports(c,d,e,shouldMove);const p=resolvePath(getDirectoryPath(getNormalizedAbsolutePath(r.fileName,t.getCurrentDirectory())),o);if(getStringComparer(!t.useCaseSensitiveFileNames())(p,c.fileName)===0)return;const u=Ho.getModuleSpecifier(t.getCompilerOptions(),c,c.fileName,p,createModuleSpecifierResolutionHost(t,n));const f=filterImport(d,makeStringLiteral(u,a),shouldMove);if(f)e.insertNodeAfter(c,l,f);const m=getNamespaceLikeImport(d);if(m)updateNamespaceLikeImport(e,c,s,i,u,m,d,a)}))}}}function getNamespaceLikeImport(e){switch(e.kind){case 272:return e.importClause&&e.importClause.namedBindings&&e.importClause.namedBindings.kind===274?e.importClause.namedBindings.name:void 0;case 271:return e.name;case 260:return tryCast(e.name,isIdentifier);default:return S.assertNever(e,`Unexpected node kind ${e.kind}`)}}function updateNamespaceLikeImport(e,t,n,r,i,o,a,s){const c=moduleSpecifierToValidIdentifier(i,99);let l=false;const d=[];Rf.Core.eachSymbolReferenceInFile(o,n,t,(e=>{if(!isPropertyAccessExpression(e.parent))return;l=l||!!n.resolveName(c,e,-1,true);if(r.has(n.getSymbolAtLocation(e.parent.name))){d.push(e)}}));if(d.length){const n=l?getUniqueName(c,t):c;for(const r of d){e.replaceNode(t,r,zr.createIdentifier(n))}e.insertNodeAfter(t,a,updateNamespaceLikeImportNode(a,c,i,s))}}function updateNamespaceLikeImportNode(e,t,n,r){const i=zr.createIdentifier(t);const o=makeStringLiteral(n,r);switch(e.kind){case 272:return zr.createImportDeclaration(void 0,zr.createImportClause(false,void 0,zr.createNamespaceImport(i)),o,void 0);case 271:return zr.createImportEqualsDeclaration(void 0,false,i,zr.createExternalModuleReference(o));case 260:return zr.createVariableDeclaration(i,void 0,void 0,createRequireCall(o));default:return S.assertNever(e,`Unexpected node kind ${e.kind}`)}}function createRequireCall(e){return zr.createCallExpression(zr.createIdentifier("require"),void 0,[e])}function moduleSpecifierFromImport(e){return e.kind===272?e.moduleSpecifier:e.kind===271?e.moduleReference.expression:e.initializer.arguments[0]}function forEachImportInStatement(e,t){if(isImportDeclaration(e)){if(isStringLiteral(e.moduleSpecifier))t(e)}else if(isImportEqualsDeclaration(e)){if(isExternalModuleReference(e.moduleReference)&&isStringLiteralLike(e.moduleReference.expression)){t(e)}}else if(isVariableStatement(e)){for(const n of e.declarationList.declarations){if(n.initializer&&isRequireCall(n.initializer,true)){t(n)}}}}function forEachAliasDeclarationInImportOrRequire(e,t){var n,r,i,o,a;if(e.kind===272){if((n=e.importClause)==null?void 0:n.name){t(e.importClause)}if(((i=(r=e.importClause)==null?void 0:r.namedBindings)==null?void 0:i.kind)===274){t(e.importClause.namedBindings)}if(((a=(o=e.importClause)==null?void 0:o.namedBindings)==null?void 0:a.kind)===275){for(const n of e.importClause.namedBindings.elements){t(n)}}}else if(e.kind===271){t(e)}else if(e.kind===260){if(e.name.kind===80){t(e)}else if(e.name.kind===206){for(const n of e.name.elements){if(isIdentifier(n.name)){t(n)}}}}}function addImportsForMovedSymbols(e,t,n,r){for(const[i,o]of e){const e=getNameForExportedSymbol(i,zn(r.getCompilerOptions()));const a=i.name==="default"&&i.parent?1:0;n.addImportForNonExistentExport(e,t,a,i.flags,o)}}function makeVariableStatement(e,t,n,r=2){return zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(e,void 0,t,n)],r))}function addExports(e,t,n,r){return flatMap(t,(t=>{if(isTopLevelDeclarationStatement(t)&&!isExported(e,t,r)&&forEachTopLevelDeclaration(t,(e=>{var t;return n.includes(S.checkDefined((t=tryCast(e,canHaveSymbol))==null?void 0:t.symbol))}))){const e=addExport(getSynthesizedDeepClone(t),r);if(e)return e}return getSynthesizedDeepClone(t)}))}function isExported(e,t,n,r){var i;if(n){return!isExpressionStatement(t)&&hasSyntacticModifier(t,32)||!!(r&&e.symbol&&((i=e.symbol.exports)==null?void 0:i.has(r.escapedText)))}return!!e.symbol&&!!e.symbol.exports&&getNamesToExportInCommonJS(t).some((t=>e.symbol.exports.has(escapeLeadingUnderscores(t))))}function deleteUnusedImports(e,t,n,r){if(t.kind===272&&t.importClause){const{name:i,namedBindings:o}=t.importClause;if((!i||r(i))&&(!o||o.kind===275&&o.elements.length!==0&&o.elements.every((e=>r(e.name))))){return n.delete(e,t)}}forEachAliasDeclarationInImportOrRequire(t,(t=>{if(t.name&&isIdentifier(t.name)&&r(t.name)){n.delete(e,t)}}))}function isTopLevelDeclarationStatement(e){S.assert(isSourceFile(e.parent),"Node parent should be a SourceFile");return isNonVariableTopLevelDeclaration(e)||isVariableStatement(e)}function addExport(e,t){return t?[addEs6Export(e)]:addCommonjsExport(e)}function addEs6Export(e){const t=canHaveModifiers(e)?concatenate([zr.createModifier(95)],getModifiers(e)):void 0;switch(e.kind){case 262:return zr.updateFunctionDeclaration(e,t,e.asteriskToken,e.name,e.typeParameters,e.parameters,e.type,e.body);case 263:const n=canHaveDecorators(e)?getDecorators(e):void 0;return zr.updateClassDeclaration(e,concatenate(n,t),e.name,e.typeParameters,e.heritageClauses,e.members);case 243:return zr.updateVariableStatement(e,t,e.declarationList);case 267:return zr.updateModuleDeclaration(e,t,e.name,e.body);case 266:return zr.updateEnumDeclaration(e,t,e.name,e.members);case 265:return zr.updateTypeAliasDeclaration(e,t,e.name,e.typeParameters,e.type);case 264:return zr.updateInterfaceDeclaration(e,t,e.name,e.typeParameters,e.heritageClauses,e.members);case 271:return zr.updateImportEqualsDeclaration(e,t,e.isTypeOnly,e.name,e.moduleReference);case 244:return S.fail();default:return S.assertNever(e,`Unexpected declaration kind ${e.kind}`)}}function addCommonjsExport(e){return[e,...getNamesToExportInCommonJS(e).map(createExportAssignment)]}function createExportAssignment(e){return zr.createExpressionStatement(zr.createBinaryExpression(zr.createPropertyAccessExpression(zr.createIdentifier("exports"),zr.createIdentifier(e)),64,zr.createIdentifier(e)))}function getNamesToExportInCommonJS(e){switch(e.kind){case 262:case 263:return[e.name.text];case 243:return mapDefined(e.declarationList.declarations,(e=>isIdentifier(e.name)?e.name.text:void 0));case 267:case 266:case 265:case 264:case 271:return d;case 244:return S.fail("Can't export an ExpressionStatement");default:return S.assertNever(e,`Unexpected decl kind ${e.kind}`)}}function filterImport(e,t,n){switch(e.kind){case 272:{const r=e.importClause;if(!r)return void 0;const i=r.name&&n(r.name)?r.name:void 0;const o=r.namedBindings&&filterNamedBindings(r.namedBindings,n);return i||o?zr.createImportDeclaration(void 0,zr.createImportClause(r.isTypeOnly,i,o),getSynthesizedDeepClone(t),void 0):void 0}case 271:return n(e.name)?e:void 0;case 260:{const r=filterBindingName(e.name,n);return r?makeVariableStatement(r,e.type,createRequireCall(t),e.parent.flags):void 0}default:return S.assertNever(e,`Unexpected import kind ${e.kind}`)}}function filterNamedBindings(e,t){if(e.kind===274){return t(e.name)?e:void 0}else{const n=e.elements.filter((e=>t(e.name)));return n.length?zr.createNamedImports(n):void 0}}function filterBindingName(e,t){switch(e.kind){case 80:return t(e)?e:void 0;case 207:return e;case 206:{const n=e.elements.filter((e=>e.propertyName||!isIdentifier(e.name)||t(e.name)));return n.length?zr.createObjectBindingPattern(n):void 0}}}function nameOfTopLevelDeclaration(e){return isExpressionStatement(e)?tryCast(e.expression.left.name,isIdentifier):tryCast(e.name,isIdentifier)}function getTopLevelDeclarationStatement(e){switch(e.kind){case 260:return e.parent.parent;case 208:return getTopLevelDeclarationStatement(cast(e.parent.parent,(e=>isVariableDeclaration(e)||isBindingElement(e))));default:return e}}function addExportToChanges(e,t,n,r,i){if(isExported(e,t,i,n))return;if(i){if(!isExpressionStatement(t))r.insertExportModifier(e,t)}else{const n=getNamesToExportInCommonJS(t);if(n.length!==0)r.insertNodesAfter(e,t,n.map(createExportAssignment))}}function createNewFileName(e,t,n,r){const i=t.getTypeChecker();if(r){const t=getUsageInfo(e,r.all,i);const o=getDirectoryPath(e.fileName);const a=extensionFromPath(e.fileName);const s=combinePaths(o,makeUniqueFilename(inferNewFileName(t.oldFileImportsFromTargetFile,t.movedSymbols),a,o,n))+a;return s}return""}function getRangeToMove(e){const{file:t}=e;const n=createTextRangeFromSpan(getRefactorContextSpan(e));const{statements:r}=t;let i=findIndex(r,(e=>e.end>n.pos));if(i===-1)return void 0;const o=r[i];const a=getOverloadRangeToMove(t,o);if(a){i=a.start}let s=findIndex(r,(e=>e.end>=n.end),i);if(s!==-1&&n.end<=r[s].getStart()){s--}const c=getOverloadRangeToMove(t,r[s]);if(c){s=c.end}return{toMove:r.slice(i,s===-1?r.length:s+1),afterLast:s===-1?void 0:r[s+1]}}function getStatementsToMove(e){const t=getRangeToMove(e);if(t===void 0)return void 0;const n=[];const r=[];const{toMove:i,afterLast:o}=t;getRangesWhere(i,isAllowedStatementToMove,((e,t)=>{for(let r=e;r!!(e.transformFlags&2)))}function isAllowedStatementToMove(e){return!isPureImport(e)&&!isPrologueDirective(e)}function isPureImport(e){switch(e.kind){case 272:return true;case 271:return!hasSyntacticModifier(e,32);case 243:return e.declarationList.declarations.every((e=>!!e.initializer&&isRequireCall(e.initializer,true)));default:return false}}function getUsageInfo(e,t,n,r=new Set,i){var o;const a=new Set;const s=new Map;const c=new Map;const l=getJsxNamespaceSymbol(containsJsx(t));if(l){s.set(l,[false,tryCast((o=l.declarations)==null?void 0:o[0],(e=>isImportSpecifier(e)||isImportClause(e)||isNamespaceImport(e)||isImportEqualsDeclaration(e)||isBindingElement(e)||isVariableDeclaration(e)))])}for(const e of t){forEachTopLevelDeclaration(e,(e=>{a.add(S.checkDefined(isExpressionStatement(e)?n.getSymbolAtLocation(e.expression.left):e.symbol,"Need a symbol here"))}))}const d=new Set;for(const o of t){forEachReference(o,n,i,((t,i)=>{if(!some(t.declarations)){return}if(r.has(skipAlias(t,n))){d.add(t);return}const o=find(t.declarations,isInImport);if(o){const e=s.get(t);s.set(t,[e===void 0?i:e&&i,tryCast(o,(e=>isImportSpecifier(e)||isImportClause(e)||isNamespaceImport(e)||isImportEqualsDeclaration(e)||isBindingElement(e)||isVariableDeclaration(e)))])}else if(!a.has(t)&&every(t.declarations,(t=>isTopLevelDeclaration(t)&&sourceFileOfTopLevelDeclaration(t)===e))){c.set(t,i)}}))}for(const e of s.keys()){d.add(e)}const p=new Map;for(const r of e.statements){if(contains(t,r))continue;if(l&&!!(r.transformFlags&2)){d.delete(l)}forEachReference(r,n,i,((e,t)=>{if(a.has(e))p.set(e,t);d.delete(e)}))}return{movedSymbols:a,targetFileImportsFromOldFile:c,oldFileImportsFromTargetFile:p,oldImportsNeededByTargetFile:s,unusedImportsFromOldFile:d};function getJsxNamespaceSymbol(e){if(e===void 0){return void 0}const t=n.getJsxNamespace(e);const r=n.resolveName(t,e,1920,true);return!!r&&some(r.declarations,isInImport)?r:void 0}}function makeUniqueFilename(e,t,n,r){let i=e;for(let o=1;;o++){const a=combinePaths(n,i+t);if(!r.fileExists(a))return i;i=`${e}.${o}`}}function inferNewFileName(e,t){return forEachKey(e,symbolNameNoDefault)||forEachKey(t,symbolNameNoDefault)||"newFile"}function forEachReference(e,t,n,r){e.forEachChild((function cb(e){if(isIdentifier(e)&&!isDeclarationName(e)){if(n&&!rangeContainsRange(n,e)){return}const i=t.getSymbolAtLocation(e);if(i)r(i,isValidTypeOnlyAliasUseSite(e))}else{e.forEachChild(cb)}}))}function forEachTopLevelDeclaration(e,t){switch(e.kind){case 262:case 263:case 267:case 266:case 265:case 264:case 271:return t(e);case 243:return firstDefined(e.declarationList.declarations,(e=>forEachTopLevelDeclarationInBindingName(e.name,t)));case 244:{const{expression:n}=e;return isBinaryExpression(n)&&getAssignmentDeclarationKind(n)===1?t(e):void 0}}}function isInImport(e){switch(e.kind){case 271:case 276:case 273:case 274:return true;case 260:return isVariableDeclarationInImport(e);case 208:return isVariableDeclaration(e.parent.parent)&&isVariableDeclarationInImport(e.parent.parent);default:return false}}function isVariableDeclarationInImport(e){return isSourceFile(e.parent.parent.parent)&&!!e.initializer&&isRequireCall(e.initializer,true)}function isTopLevelDeclaration(e){return isNonVariableTopLevelDeclaration(e)&&isSourceFile(e.parent)||isVariableDeclaration(e)&&isSourceFile(e.parent.parent.parent)}function sourceFileOfTopLevelDeclaration(e){return isVariableDeclaration(e)?e.parent.parent.parent:e.parent}function forEachTopLevelDeclarationInBindingName(e,t){switch(e.kind){case 80:return t(cast(e.parent,(e=>isVariableDeclaration(e)||isBindingElement(e))));case 207:case 206:return firstDefined(e.elements,(e=>isOmittedExpression(e)?void 0:forEachTopLevelDeclarationInBindingName(e.name,t)));default:return S.assertNever(e,`Unexpected name kind ${e.kind}`)}}function isNonVariableTopLevelDeclaration(e){switch(e.kind){case 262:case 263:case 267:case 266:case 265:case 264:case 271:return true;default:return false}}function moveStatementsToTargetFile(e,t,n,r,i){var o;const a=new Set;const s=(o=r.symbol)==null?void 0:o.exports;if(s){const n=t.getTypeChecker();const o=new Map;for(const e of i.all){if(isTopLevelDeclarationStatement(e)&&hasSyntacticModifier(e,32)){forEachTopLevelDeclaration(e,(e=>{var t;const n=canHaveSymbol(e)?(t=s.get(e.symbol.escapedName))==null?void 0:t.declarations:void 0;const r=firstDefined(n,(e=>isExportDeclaration(e)?e:isExportSpecifier(e)?tryCast(e.parent.parent,isExportDeclaration):void 0));if(r&&r.moduleSpecifier){o.set(r,(o.get(r)||new Set).add(e))}}))}}for(const[t,i]of arrayFrom(o)){if(t.exportClause&&isNamedExports(t.exportClause)&&length(t.exportClause.elements)){const o=t.exportClause.elements;const s=filter(o,(e=>find(skipAlias(e.symbol,n).declarations,(e=>isTopLevelDeclaration(e)&&i.has(e)))===void 0));if(length(s)===0){e.deleteNode(r,t);a.add(t);continue}if(length(s)isExportDeclaration(e)&&!!e.moduleSpecifier&&!a.has(e)));if(c){e.insertNodesBefore(r,c,n,true)}else{e.insertNodesAfter(r,r.statements[r.statements.length-1],n)}}function getOverloadRangeToMove(e,t){if(isFunctionLikeDeclaration(t)){const n=t.symbol.declarations;if(n===void 0||length(n)<=1||!contains(n,t)){return void 0}const r=n[0];const i=n[length(n)-1];const o=mapDefined(n,(t=>getSourceFileOfNode(t)===e&&isStatement(t)?t:void 0));const a=findIndex(e.statements,(e=>e.end>=i.end));const s=findIndex(e.statements,(e=>e.end>=r.end));return{toMove:o,start:s,end:a}}return void 0}function getExistingLocals(e,t,n){const r=new Set;for(const t of e.imports){const e=importFromModuleSpecifier(t);if(isImportDeclaration(e)&&e.importClause&&e.importClause.namedBindings&&isNamedImports(e.importClause.namedBindings)){for(const t of e.importClause.namedBindings.elements){const e=n.getSymbolAtLocation(t.propertyName||t.name);if(e){r.add(skipAlias(e,n))}}}if(isVariableDeclarationInitializedToRequire(e.parent)&&isObjectBindingPattern(e.parent.name)){for(const t of e.parent.name.elements){const e=n.getSymbolAtLocation(t.propertyName||t.name);if(e){r.add(skipAlias(e,n))}}}}for(const i of t){forEachReference(i,n,void 0,(t=>{const i=skipAlias(t,n);if(i.valueDeclaration&&getSourceFileOfNode(i.valueDeclaration).path===e.path){r.add(i)}}))}return r}function isRefactorErrorInfo(e){return e.error!==void 0}function refactorKindBeginsWith(e,t){if(!t)return true;return e.substr(0,t.length)===t}function getIdentifierForNode(e,t,n,r){return isPropertyAccessExpression(e)&&!isClassLike(t)&&!n.resolveName(e.name.text,e,111551,false)&&!isPrivateIdentifier(e.name)&&!identifierToKeywordKind(e.name)?e.name.text:getUniqueName(isClassLike(t)?"newProperty":"newLocal",r)}function addTargetFileImports(e,t,n,r,i,o){t.forEach((([e,t],n)=>{var i;const a=skipAlias(n,r);if(r.isUnknownSymbol(a)){o.addVerbatimImport(S.checkDefined(t??findAncestor((i=n.declarations)==null?void 0:i[0],isAnyImportOrRequireStatement)))}else if(a.parent===void 0){S.assert(t!==void 0,"expected module symbol to have a declaration");o.addImportForModuleSymbol(n,e,t)}else{o.addImportFromExportedSymbol(a,e,t)}}));addImportsForMovedSymbols(n,e.fileName,o,i)}var Jc="Inline variable";var Wc=getLocaleSpecificMessage(wt.Inline_variable);var Uc={name:Jc,description:Wc,kind:"refactor.inline.variable"};registerRefactor(Jc,{kinds:[Uc.kind],getAvailableActions(e){const{file:t,program:n,preferences:r,startPosition:i,triggerReason:o}=e;const a=getInliningInfo(t,i,o==="invoked",n);if(!a){return d}if(!Nc.isRefactorErrorInfo(a)){return[{name:Jc,description:Wc,actions:[Uc]}]}if(r.provideRefactorNotApplicableReason){return[{name:Jc,description:Wc,actions:[{...Uc,notApplicableReason:a.error}]}]}return d},getEditsForAction(e,t){S.assert(t===Jc,"Unexpected refactor invoked");const{file:n,program:r,startPosition:i}=e;const o=getInliningInfo(n,i,true,r);if(!o||Nc.isRefactorErrorInfo(o)){return void 0}const{references:a,declaration:s,replacement:c}=o;const l=dm.ChangeTracker.with(e,(e=>{for(const t of a){const r=isStringLiteral(c)&&isIdentifier(t)&&walkUpParenthesizedExpressions(t.parent);if(r&&isTemplateSpan(r)&&!isTaggedTemplateExpression(r.parent.parent)){replaceTemplateStringVariableWithLiteral(e,n,r,c)}else{e.replaceNode(n,t,getReplacementExpression(t,c))}}e.delete(n,s)}));return{edits:l}}});function getInliningInfo(e,t,n,r){var i,o;const a=r.getTypeChecker();const s=getTouchingPropertyName(e,t);const c=s.parent;if(!isIdentifier(s)){return void 0}if(isInitializedVariable(c)&&isVariableDeclarationInVariableStatement(c)&&isIdentifier(c.name)){if(((i=a.getMergedSymbol(c.symbol).declarations)==null?void 0:i.length)!==1){return{error:getLocaleSpecificMessage(wt.Variables_with_multiple_declarations_cannot_be_inlined)}}if(isDeclarationExported(c)){return void 0}const t=getReferenceNodes(c,a,e);return t&&{references:t,declaration:c,replacement:c.initializer}}if(n){let t=a.resolveName(s.text,s,111551,false);t=t&&a.getMergedSymbol(t);if(((o=t==null?void 0:t.declarations)==null?void 0:o.length)!==1){return{error:getLocaleSpecificMessage(wt.Variables_with_multiple_declarations_cannot_be_inlined)}}const n=t.declarations[0];if(!isInitializedVariable(n)||!isVariableDeclarationInVariableStatement(n)||!isIdentifier(n.name)){return void 0}if(isDeclarationExported(n)){return void 0}const r=getReferenceNodes(n,a,e);return r&&{references:r,declaration:n,replacement:n.initializer}}return{error:getLocaleSpecificMessage(wt.Could_not_find_variable_to_inline)}}function isDeclarationExported(e){const t=cast(e.parent.parent,isVariableStatement);return some(t.modifiers,isExportModifier)}function getReferenceNodes(e,t,n){const r=[];const i=Rf.Core.eachSymbolReferenceInFile(e.name,t,n,(t=>{if(Rf.isWriteAccessForReference(t)&&!isShorthandPropertyAssignment(t.parent)){return true}if(isExportSpecifier(t.parent)||isExportAssignment(t.parent)){return true}if(isTypeQueryNode(t.parent)){return true}if(textRangeContainsPositionInclusive(e,t.pos)){return true}r.push(t)}));return r.length===0||i?void 0:r}function getReplacementExpression(e,t){t=getSynthesizedDeepClone(t);const{parent:n}=e;if(isExpression(n)&&(getExpressionPrecedence(t)doChange4(e.file,e.program,n,t,e.host,e,e.preferences)));return{edits:r,renameFilename:void 0,renameLocation:void 0}}});function doChange4(e,t,n,r,i,o,a){const s=t.getTypeChecker();const c=getUsageInfo(e,n.all,s);const l=createNewFileName(e,t,i,n);const d=createFutureSourceFile(l,e.externalModuleIndicator?99:e.commonJsModuleIndicator?1:void 0,t,i);const p=id.createImportAdder(e,o.program,o.preferences,o.host);const u=id.createImportAdder(d,o.program,o.preferences,o.host);getNewStatementsAndRemoveFromOldFile(e,d,c,r,n,t,i,a,u,p);addNewFileToTsconfig(t,r,e.fileName,l,hostGetCanonicalFileName(i))}var Hc={};var Gc="Convert overload list to single signature";var Kc=getLocaleSpecificMessage(wt.Convert_overload_list_to_single_signature);var $c={name:Gc,description:Kc,kind:"refactor.rewrite.function.overloadList"};registerRefactor(Gc,{kinds:[$c.kind],getEditsForAction:getRefactorEditsToConvertOverloadsToOneSignature,getAvailableActions:getRefactorActionsToConvertOverloadsToOneSignature});function getRefactorActionsToConvertOverloadsToOneSignature(e){const{file:t,startPosition:n,program:r}=e;const i=getConvertableOverloadListAtPosition(t,n,r);if(!i)return d;return[{name:Gc,description:Kc,actions:[$c]}]}function getRefactorEditsToConvertOverloadsToOneSignature(e){const{file:t,startPosition:n,program:r}=e;const i=getConvertableOverloadListAtPosition(t,n,r);if(!i)return void 0;const o=r.getTypeChecker();const a=i[i.length-1];let s=a;switch(a.kind){case 173:{s=zr.updateMethodSignature(a,a.modifiers,a.name,a.questionToken,a.typeParameters,getNewParametersForCombinedSignature(i),a.type);break}case 174:{s=zr.updateMethodDeclaration(a,a.modifiers,a.asteriskToken,a.name,a.questionToken,a.typeParameters,getNewParametersForCombinedSignature(i),a.type,a.body);break}case 179:{s=zr.updateCallSignature(a,a.typeParameters,getNewParametersForCombinedSignature(i),a.type);break}case 176:{s=zr.updateConstructorDeclaration(a,a.modifiers,getNewParametersForCombinedSignature(i),a.body);break}case 180:{s=zr.updateConstructSignature(a,a.typeParameters,getNewParametersForCombinedSignature(i),a.type);break}case 262:{s=zr.updateFunctionDeclaration(a,a.modifiers,a.asteriskToken,a.name,a.typeParameters,getNewParametersForCombinedSignature(i),a.type,a.body);break}default:return S.failBadSyntaxKind(a,"Unhandled signature kind in overload list conversion refactoring")}if(s===a){return}const c=dm.ChangeTracker.with(e,(e=>{e.replaceNodeRange(t,i[0],i[i.length-1],s)}));return{renameFilename:void 0,renameLocation:void 0,edits:c};function getNewParametersForCombinedSignature(e){const t=e[e.length-1];if(isFunctionLikeDeclaration(t)&&t.body){e=e.slice(0,e.length-1)}return zr.createNodeArray([zr.createParameterDeclaration(void 0,zr.createToken(26),"args",void 0,zr.createUnionTypeNode(map(e,convertSignatureParametersToTuple)))])}function convertSignatureParametersToTuple(e){const t=map(e.parameters,convertParameterToNamedTupleMember);return setEmitFlags(zr.createTupleTypeNode(t),some(t,(e=>!!length(getSyntheticLeadingComments(e))))?0:1)}function convertParameterToNamedTupleMember(e){S.assert(isIdentifier(e.name));const t=setTextRange(zr.createNamedTupleMember(e.dotDotDotToken,e.name,e.questionToken,e.type||zr.createKeywordTypeNode(133)),e);const n=e.symbol&&e.symbol.getDocumentationComment(o);if(n){const e=displayPartsToString(n);if(e.length){setSyntheticLeadingComments(t,[{text:`*\n${e.split("\n").map((e=>` * ${e}`)).join("\n")}\n `,kind:3,pos:-1,end:-1,hasTrailingNewLine:true,hasLeadingNewline:true}])}}return t}}function isConvertableSignatureDeclaration(e){switch(e.kind){case 173:case 174:case 179:case 176:case 180:case 262:return true}return false}function getConvertableOverloadListAtPosition(e,t,n){const r=getTokenAtPosition(e,t);const i=findAncestor(r,isConvertableSignatureDeclaration);if(!i){return}if(isFunctionLikeDeclaration(i)&&i.body&&rangeContainsPosition(i.body,t)){return}const o=n.getTypeChecker();const a=i.symbol;if(!a){return}const s=a.declarations;if(length(s)<=1){return}if(!every(s,(t=>getSourceFileOfNode(t)===e))){return}if(!isConvertableSignatureDeclaration(s[0])){return}const c=s[0].kind;if(!every(s,(e=>e.kind===c))){return}const l=s;if(some(l,(e=>!!e.typeParameters||some(e.parameters,(e=>!!e.modifiers||!isIdentifier(e.name)))))){return}const d=mapDefined(l,(e=>o.getSignatureFromDeclaration(e)));if(length(d)!==length(s)){return}const p=o.getReturnTypeOfSignature(d[0]);if(!every(d,(e=>o.getReturnTypeOfSignature(e)===p))){return}return l}var Qc="Add or remove braces in an arrow function";var Xc=getLocaleSpecificMessage(wt.Add_or_remove_braces_in_an_arrow_function);var Yc={name:"Add braces to arrow function",description:getLocaleSpecificMessage(wt.Add_braces_to_arrow_function),kind:"refactor.rewrite.arrow.braces.add"};var Zc={name:"Remove braces from arrow function",description:getLocaleSpecificMessage(wt.Remove_braces_from_arrow_function),kind:"refactor.rewrite.arrow.braces.remove"};registerRefactor(Qc,{kinds:[Zc.kind],getEditsForAction:getRefactorEditsToRemoveFunctionBraces,getAvailableActions:getRefactorActionsToRemoveFunctionBraces});function getRefactorActionsToRemoveFunctionBraces(e){const{file:t,startPosition:n,triggerReason:r}=e;const i=getConvertibleArrowFunctionAtPosition(t,n,r==="invoked");if(!i)return d;if(!isRefactorErrorInfo(i)){return[{name:Qc,description:Xc,actions:[i.addBraces?Yc:Zc]}]}if(e.preferences.provideRefactorNotApplicableReason){return[{name:Qc,description:Xc,actions:[{...Yc,notApplicableReason:i.error},{...Zc,notApplicableReason:i.error}]}]}return d}function getRefactorEditsToRemoveFunctionBraces(e,t){const{file:n,startPosition:r}=e;const i=getConvertibleArrowFunctionAtPosition(n,r);S.assert(i&&!isRefactorErrorInfo(i),"Expected applicable refactor info");const{expression:o,returnStatement:a,func:s}=i;let c;if(t===Yc.name){const e=zr.createReturnStatement(o);c=zr.createBlock([e],true);copyLeadingComments(o,e,n,3,true)}else if(t===Zc.name&&a){const e=o||zr.createVoidZero();c=needsParentheses(e)?zr.createParenthesizedExpression(e):e;copyTrailingAsLeadingComments(a,c,n,3,false);copyLeadingComments(a,c,n,3,false);copyTrailingComments(a,c,n,3,false)}else{S.fail("invalid action")}const l=dm.ChangeTracker.with(e,(e=>{e.replaceNode(n,s.body,c)}));return{renameFilename:void 0,renameLocation:void 0,edits:l}}function getConvertibleArrowFunctionAtPosition(e,t,n=true,r){const i=getTokenAtPosition(e,t);const o=getContainingFunction(i);if(!o){return{error:getLocaleSpecificMessage(wt.Could_not_find_a_containing_arrow_function)}}if(!isArrowFunction(o)){return{error:getLocaleSpecificMessage(wt.Containing_function_is_not_an_arrow_function)}}if(!rangeContainsRange(o,i)||rangeContainsRange(o.body,i)&&!n){return void 0}if(refactorKindBeginsWith(Yc.kind,r)&&isExpression(o.body)){return{func:o,addBraces:true,expression:o.body}}else if(refactorKindBeginsWith(Zc.kind,r)&&isBlock(o.body)&&o.body.statements.length===1){const e=first(o.body.statements);if(isReturnStatement(e)){const t=e.expression&&isObjectLiteralExpression(getLeftmostExpression(e.expression,false))?zr.createParenthesizedExpression(e.expression):e.expression;return{func:o,addBraces:false,expression:t,returnStatement:e}}}return void 0}var el={};var tl="Convert arrow function or function expression";var nl=getLocaleSpecificMessage(wt.Convert_arrow_function_or_function_expression);var rl={name:"Convert to anonymous function",description:getLocaleSpecificMessage(wt.Convert_to_anonymous_function),kind:"refactor.rewrite.function.anonymous"};var il={name:"Convert to named function",description:getLocaleSpecificMessage(wt.Convert_to_named_function),kind:"refactor.rewrite.function.named"};var ol={name:"Convert to arrow function",description:getLocaleSpecificMessage(wt.Convert_to_arrow_function),kind:"refactor.rewrite.function.arrow"};registerRefactor(tl,{kinds:[rl.kind,il.kind,ol.kind],getEditsForAction:getRefactorEditsToConvertFunctionExpressions,getAvailableActions:getRefactorActionsToConvertFunctionExpressions});function getRefactorActionsToConvertFunctionExpressions(e){const{file:t,startPosition:n,program:r,kind:i}=e;const o=getFunctionInfo(t,n,r);if(!o)return d;const{selectedVariableDeclaration:a,func:s}=o;const c=[];const l=[];if(refactorKindBeginsWith(il.kind,i)){const e=a||isArrowFunction(s)&&isVariableDeclaration(s.parent)?void 0:getLocaleSpecificMessage(wt.Could_not_convert_to_named_function);if(e){l.push({...il,notApplicableReason:e})}else{c.push(il)}}if(refactorKindBeginsWith(rl.kind,i)){const e=!a&&isArrowFunction(s)?void 0:getLocaleSpecificMessage(wt.Could_not_convert_to_anonymous_function);if(e){l.push({...rl,notApplicableReason:e})}else{c.push(rl)}}if(refactorKindBeginsWith(ol.kind,i)){const e=isFunctionExpression(s)?void 0:getLocaleSpecificMessage(wt.Could_not_convert_to_arrow_function);if(e){l.push({...ol,notApplicableReason:e})}else{c.push(ol)}}return[{name:tl,description:nl,actions:c.length===0&&e.preferences.provideRefactorNotApplicableReason?l:c}]}function getRefactorEditsToConvertFunctionExpressions(e,t){const{file:n,startPosition:r,program:i}=e;const o=getFunctionInfo(n,r,i);if(!o)return void 0;const{func:a}=o;const s=[];switch(t){case rl.name:s.push(...getEditInfoForConvertToAnonymousFunction(e,a));break;case il.name:const t=getVariableInfo(a);if(!t)return void 0;s.push(...getEditInfoForConvertToNamedFunction(e,a,t));break;case ol.name:if(!isFunctionExpression(a))return void 0;s.push(...getEditInfoForConvertToArrowFunction(e,a));break;default:return S.fail("invalid action")}return{renameFilename:void 0,renameLocation:void 0,edits:s}}function containingThis(e){let t=false;e.forEachChild((function checkThis(e){if(isThis(e)){t=true;return}if(!isClassLike(e)&&!isFunctionDeclaration(e)&&!isFunctionExpression(e)){forEachChild(e,checkThis)}}));return t}function getFunctionInfo(e,t,n){const r=getTokenAtPosition(e,t);const i=n.getTypeChecker();const o=tryGetFunctionFromVariableDeclaration(e,i,r.parent);if(o&&!containingThis(o.body)&&!i.containsArgumentsReference(o)){return{selectedVariableDeclaration:true,func:o}}const a=getContainingFunction(r);if(a&&(isFunctionExpression(a)||isArrowFunction(a))&&!rangeContainsRange(a.body,r)&&!containingThis(a.body)&&!i.containsArgumentsReference(a)){if(isFunctionExpression(a)&&isFunctionReferencedInFile(e,i,a))return void 0;return{selectedVariableDeclaration:false,func:a}}return void 0}function isSingleVariableDeclaration(e){return isVariableDeclaration(e)||isVariableDeclarationList(e)&&e.declarations.length===1}function tryGetFunctionFromVariableDeclaration(e,t,n){if(!isSingleVariableDeclaration(n)){return void 0}const r=isVariableDeclaration(n)?n:first(n.declarations);const i=r.initializer;if(i&&(isArrowFunction(i)||isFunctionExpression(i)&&!isFunctionReferencedInFile(e,t,i))){return i}return void 0}function convertToBlock(e){if(isExpression(e)){const t=zr.createReturnStatement(e);const n=e.getSourceFile();setTextRange(t,e);suppressLeadingAndTrailingTrivia(t);copyTrailingAsLeadingComments(e,t,n,void 0,true);return zr.createBlock([t],true)}else{return e}}function getVariableInfo(e){const t=e.parent;if(!isVariableDeclaration(t)||!isVariableDeclarationInVariableStatement(t))return void 0;const n=t.parent;const r=n.parent;if(!isVariableDeclarationList(n)||!isVariableStatement(r)||!isIdentifier(t.name))return void 0;return{variableDeclaration:t,variableDeclarationList:n,statement:r,name:t.name}}function getEditInfoForConvertToAnonymousFunction(e,t){const{file:n}=e;const r=convertToBlock(t.body);const i=zr.createFunctionExpression(t.modifiers,t.asteriskToken,void 0,t.typeParameters,t.parameters,t.type,r);return dm.ChangeTracker.with(e,(e=>e.replaceNode(n,t,i)))}function getEditInfoForConvertToNamedFunction(e,t,n){const{file:r}=e;const i=convertToBlock(t.body);const{variableDeclaration:o,variableDeclarationList:a,statement:s,name:c}=n;suppressLeadingTrivia(s);const l=getCombinedModifierFlags(o)&32|getEffectiveModifierFlags(t);const d=zr.createModifiersFromModifierFlags(l);const p=zr.createFunctionDeclaration(length(d)?d:void 0,t.asteriskToken,c,t.typeParameters,t.parameters,t.type,i);if(a.declarations.length===1){return dm.ChangeTracker.with(e,(e=>e.replaceNode(r,s,p)))}else{return dm.ChangeTracker.with(e,(e=>{e.delete(r,o);e.insertNodeAfter(r,s,p)}))}}function getEditInfoForConvertToArrowFunction(e,t){const{file:n}=e;const r=t.body.statements;const i=r[0];let o;if(canBeConvertedToExpression(t.body,i)){o=i.expression;suppressLeadingAndTrailingTrivia(o);copyComments(i,o)}else{o=t.body}const a=zr.createArrowFunction(t.modifiers,t.typeParameters,t.parameters,t.type,zr.createToken(39),o);return dm.ChangeTracker.with(e,(e=>e.replaceNode(n,t,a)))}function canBeConvertedToExpression(e,t){return e.statements.length===1&&(isReturnStatement(t)&&!!t.expression)}function isFunctionReferencedInFile(e,t,n){return!!n.name&&Rf.Core.isSymbolReferencedInFile(n.name,t,e)}var al={};var sl="Convert parameters to destructured object";var cl=1;var ll=getLocaleSpecificMessage(wt.Convert_parameters_to_destructured_object);var dl={name:sl,description:ll,kind:"refactor.rewrite.parameters.toDestructured"};registerRefactor(sl,{kinds:[dl.kind],getEditsForAction:getRefactorEditsToConvertParametersToDestructuredObject,getAvailableActions:getRefactorActionsToConvertParametersToDestructuredObject});function getRefactorActionsToConvertParametersToDestructuredObject(e){const{file:t,startPosition:n}=e;const r=isSourceFileJS(t);if(r)return d;const i=getFunctionDeclarationAtPosition(t,n,e.program.getTypeChecker());if(!i)return d;return[{name:sl,description:ll,actions:[dl]}]}function getRefactorEditsToConvertParametersToDestructuredObject(e,t){S.assert(t===sl,"Unexpected action name");const{file:n,startPosition:r,program:i,cancellationToken:o,host:a}=e;const s=getFunctionDeclarationAtPosition(n,r,i.getTypeChecker());if(!s||!o)return void 0;const c=getGroupedReferences(s,i,o);if(c.valid){const t=dm.ChangeTracker.with(e,(e=>doChange5(n,i,a,e,s,c)));return{renameFilename:void 0,renameLocation:void 0,edits:t}}return{edits:[]}}function doChange5(e,t,n,r,i,o){const a=o.signature;const s=map(createNewParameters(i,t,n),(e=>getSynthesizedDeepClone(e)));if(a){const e=map(createNewParameters(a,t,n),(e=>getSynthesizedDeepClone(e)));replaceParameters(a,e)}replaceParameters(i,s);const c=sortAndDeduplicate(o.functionCalls,((e,t)=>compareValues(e.pos,t.pos)));for(const e of c){if(e.arguments&&e.arguments.length){const t=getSynthesizedDeepClone(createNewArgument(i,e.arguments),true);r.replaceNodeRange(getSourceFileOfNode(e),first(e.arguments),last(e.arguments),t,{leadingTriviaOption:dm.LeadingTriviaOption.IncludeAll,trailingTriviaOption:dm.TrailingTriviaOption.Include})}}function replaceParameters(t,n){r.replaceNodeRangeWithNodes(e,first(t.parameters),last(t.parameters),n,{joiner:", ",indentation:0,leadingTriviaOption:dm.LeadingTriviaOption.IncludeAll,trailingTriviaOption:dm.TrailingTriviaOption.Include})}}function getGroupedReferences(e,t,n){const r=getFunctionNames(e);const i=isConstructorDeclaration(e)?getClassNames(e):[];const o=deduplicate([...r,...i],equateValues);const a=t.getTypeChecker();const s=flatMap(o,(e=>Rf.getReferenceEntriesForNode(-1,e,t,t.getSourceFiles(),n)));const c=groupReferences(s);if(!every(c.declarations,(e=>contains(o,e)))){c.valid=false}return c;function groupReferences(t){const n={accessExpressions:[],typeUsages:[]};const o={functionCalls:[],declarations:[],classReferences:n,valid:true};const s=map(r,getSymbolTargetAtLocation);const c=map(i,getSymbolTargetAtLocation);const l=isConstructorDeclaration(e);const d=map(r,(e=>getSymbolForContextualType(e,a)));for(const r of t){if(r.kind===Rf.EntryKind.Span){o.valid=false;continue}if(contains(d,getSymbolTargetAtLocation(r.node))){if(isValidMethodSignature(r.node.parent)){o.signature=r.node.parent;continue}const e=entryToFunctionCall(r);if(e){o.functionCalls.push(e);continue}}const t=getSymbolForContextualType(r.node,a);if(t&&contains(d,t)){const e=entryToDeclaration(r);if(e){o.declarations.push(e);continue}}if(contains(s,getSymbolTargetAtLocation(r.node))||isNewExpressionTarget(r.node)){const e=entryToImportOrExport(r);if(e){continue}const t=entryToDeclaration(r);if(t){o.declarations.push(t);continue}const n=entryToFunctionCall(r);if(n){o.functionCalls.push(n);continue}}if(l&&contains(c,getSymbolTargetAtLocation(r.node))){const t=entryToImportOrExport(r);if(t){continue}const i=entryToDeclaration(r);if(i){o.declarations.push(i);continue}const a=entryToAccessExpression(r);if(a){n.accessExpressions.push(a);continue}if(isClassDeclaration(e.parent)){const e=entryToType(r);if(e){n.typeUsages.push(e);continue}}}o.valid=false}return o}function getSymbolTargetAtLocation(e){const t=a.getSymbolAtLocation(e);return t&&getSymbolTarget(t,a)}}function getSymbolForContextualType(e,t){const n=getContainingObjectLiteralElement(e);if(n){const e=t.getContextualTypeForObjectLiteralElement(n);const r=e==null?void 0:e.getSymbol();if(r&&!(getCheckFlags(r)&6)){return r}}}function entryToImportOrExport(e){const t=e.node;if(isImportSpecifier(t.parent)||isImportClause(t.parent)||isImportEqualsDeclaration(t.parent)||isNamespaceImport(t.parent)){return t}if(isExportSpecifier(t.parent)||isExportAssignment(t.parent)){return t}return void 0}function entryToDeclaration(e){if(isDeclaration(e.node.parent)){return e.node}return void 0}function entryToFunctionCall(e){if(e.node.parent){const t=e.node;const n=t.parent;switch(n.kind){case 213:case 214:const e=tryCast(n,isCallOrNewExpression);if(e&&e.expression===t){return e}break;case 211:const r=tryCast(n,isPropertyAccessExpression);if(r&&r.parent&&r.name===t){const e=tryCast(r.parent,isCallOrNewExpression);if(e&&e.expression===r){return e}}break;case 212:const i=tryCast(n,isElementAccessExpression);if(i&&i.parent&&i.argumentExpression===t){const e=tryCast(i.parent,isCallOrNewExpression);if(e&&e.expression===i){return e}}break}}return void 0}function entryToAccessExpression(e){if(e.node.parent){const t=e.node;const n=t.parent;switch(n.kind){case 211:const e=tryCast(n,isPropertyAccessExpression);if(e&&e.expression===t){return e}break;case 212:const r=tryCast(n,isElementAccessExpression);if(r&&r.expression===t){return r}break}}return void 0}function entryToType(e){const t=e.node;if(getMeaningFromLocation(t)===2||isExpressionWithTypeArgumentsInClassExtendsClause(t.parent)){return t}return void 0}function getFunctionDeclarationAtPosition(e,t,n){const r=getTouchingToken(e,t);const i=getContainingFunctionDeclaration(r);if(isTopLevelJSDoc(r))return void 0;if(i&&isValidFunctionDeclaration(i,n)&&rangeContainsRange(i,r)&&!(i.body&&rangeContainsRange(i.body,r)))return i;return void 0}function isTopLevelJSDoc(e){const t=findAncestor(e,isJSDocNode);if(t){const e=findAncestor(t,(e=>!isJSDocNode(e)));return!!e&&isFunctionLikeDeclaration(e)}return false}function isValidMethodSignature(e){return isMethodSignature(e)&&(isInterfaceDeclaration(e.parent)||isTypeLiteralNode(e.parent))}function isValidFunctionDeclaration(e,t){var n;if(!isValidParameterNodeArray(e.parameters,t))return false;switch(e.kind){case 262:return hasNameOrDefault(e)&&isSingleImplementation(e,t);case 174:if(isObjectLiteralExpression(e.parent)){const r=getSymbolForContextualType(e.name,t);return((n=r==null?void 0:r.declarations)==null?void 0:n.length)===1&&isSingleImplementation(e,t)}return isSingleImplementation(e,t);case 176:if(isClassDeclaration(e.parent)){return hasNameOrDefault(e.parent)&&isSingleImplementation(e,t)}else{return isValidVariableDeclaration(e.parent.parent)&&isSingleImplementation(e,t)}case 218:case 219:return isValidVariableDeclaration(e.parent)}return false}function isSingleImplementation(e,t){return!!e.body&&!t.isImplementationOfOverload(e)}function hasNameOrDefault(e){if(!e.name){const t=findModifier(e,90);return!!t}return true}function isValidParameterNodeArray(e,t){return getRefactorableParametersLength(e)>=cl&&every(e,(e=>isValidParameterDeclaration(e,t)))}function isValidParameterDeclaration(e,t){if(isRestParameter(e)){const n=t.getTypeAtLocation(e);if(!t.isArrayType(n)&&!t.isTupleType(n))return false}return!e.modifiers&&isIdentifier(e.name)}function isValidVariableDeclaration(e){return isVariableDeclaration(e)&&isVarConst(e)&&isIdentifier(e.name)&&!e.type}function hasThisParameter(e){return e.length>0&&isThis(e[0].name)}function getRefactorableParametersLength(e){if(hasThisParameter(e)){return e.length-1}return e.length}function getRefactorableParameters(e){if(hasThisParameter(e)){e=zr.createNodeArray(e.slice(1),e.hasTrailingComma)}return e}function createPropertyOrShorthandAssignment(e,t){if(isIdentifier(t)&&getTextOfIdentifierOrLiteral(t)===e){return zr.createShorthandPropertyAssignment(e)}return zr.createPropertyAssignment(e,t)}function createNewArgument(e,t){const n=getRefactorableParameters(e.parameters);const r=isRestParameter(last(n));const i=r?t.slice(0,n.length-1):t;const o=map(i,((e,t)=>{const r=getParameterName(n[t]);const i=createPropertyOrShorthandAssignment(r,e);suppressLeadingAndTrailingTrivia(i.name);if(isPropertyAssignment(i))suppressLeadingAndTrailingTrivia(i.initializer);copyComments(e,i);return i}));if(r&&t.length>=n.length){const e=t.slice(n.length-1);const r=zr.createPropertyAssignment(getParameterName(last(n)),zr.createArrayLiteralExpression(e));o.push(r)}const a=zr.createObjectLiteralExpression(o,false);return a}function createNewParameters(e,t,n){const r=t.getTypeChecker();const i=getRefactorableParameters(e.parameters);const o=map(i,createBindingElementFromParameterDeclaration);const a=zr.createObjectBindingPattern(o);const s=createParameterTypeNode(i);let c;if(every(i,isOptionalParameter)){c=zr.createObjectLiteralExpression()}const l=zr.createParameterDeclaration(void 0,void 0,a,void 0,s,c);if(hasThisParameter(e.parameters)){const t=e.parameters[0];const n=zr.createParameterDeclaration(void 0,void 0,t.name,void 0,t.type);suppressLeadingAndTrailingTrivia(n.name);copyComments(t.name,n.name);if(t.type){suppressLeadingAndTrailingTrivia(n.type);copyComments(t.type,n.type)}return zr.createNodeArray([n,l])}return zr.createNodeArray([l]);function createBindingElementFromParameterDeclaration(e){const t=zr.createBindingElement(void 0,void 0,getParameterName(e),isRestParameter(e)&&isOptionalParameter(e)?zr.createArrayLiteralExpression():e.initializer);suppressLeadingAndTrailingTrivia(t);if(e.initializer&&t.initializer){copyComments(e.initializer,t.initializer)}return t}function createParameterTypeNode(e){const t=map(e,createPropertySignatureFromParameterDeclaration);const n=addEmitFlags(zr.createTypeLiteralNode(t),1);return n}function createPropertySignatureFromParameterDeclaration(e){let t=e.type;if(!t&&(e.initializer||isRestParameter(e))){t=getTypeNode3(e)}const n=zr.createPropertySignature(void 0,getParameterName(e),isOptionalParameter(e)?zr.createToken(58):e.questionToken,t);suppressLeadingAndTrailingTrivia(n);copyComments(e.name,n.name);if(e.type&&n.type){copyComments(e.type,n.type)}return n}function getTypeNode3(e){const i=r.getTypeAtLocation(e);return getTypeNodeIfAccessible(i,e,t,n)}function isOptionalParameter(e){if(isRestParameter(e)){const t=r.getTypeAtLocation(e);return!r.isTupleType(t)}return r.isOptionalParameter(e)}}function getParameterName(e){return getTextOfIdentifierOrLiteral(e.name)}function getClassNames(e){switch(e.parent.kind){case 263:const t=e.parent;if(t.name)return[t.name];const n=S.checkDefined(findModifier(t,90),"Nameless class declaration should be a default export");return[n];case 231:const r=e.parent;const i=e.parent.parent;const o=r.name;if(o)return[o,i.name];return[i.name]}}function getFunctionNames(e){switch(e.kind){case 262:if(e.name)return[e.name];const t=S.checkDefined(findModifier(e,90),"Nameless function declaration should be a default export");return[t];case 174:return[e.name];case 176:const n=S.checkDefined(findChildOfKind(e,137,e.getSourceFile()),"Constructor declaration should have constructor keyword");if(e.parent.kind===231){const t=e.parent.parent;return[t.name,n]}return[n];case 219:return[e.parent.name];case 218:if(e.name)return[e.name,e.parent.name];return[e.parent.name];default:return S.assertNever(e,`Unexpected function declaration kind ${e.kind}`)}}var pl={};var ul="Convert to template string";var fl=getLocaleSpecificMessage(wt.Convert_to_template_string);var ml={name:ul,description:fl,kind:"refactor.rewrite.string"};registerRefactor(ul,{kinds:[ml.kind],getEditsForAction:getRefactorEditsToConvertToTemplateString,getAvailableActions:getRefactorActionsToConvertToTemplateString});function getRefactorActionsToConvertToTemplateString(e){const{file:t,startPosition:n}=e;const r=getNodeOrParentOfParentheses(t,n);const i=getParentBinaryExpression(r);const o=isStringLiteral(i);const a={name:ul,description:fl,actions:[]};if(o&&e.triggerReason!=="invoked"){return d}if(isExpressionNode(i)&&(o||isBinaryExpression(i)&&treeToArray(i).isValidConcatenation)){a.actions.push(ml);return[a]}else if(e.preferences.provideRefactorNotApplicableReason){a.actions.push({...ml,notApplicableReason:getLocaleSpecificMessage(wt.Can_only_convert_string_concatenations_and_string_literals)});return[a]}return d}function getNodeOrParentOfParentheses(e,t){const n=getTokenAtPosition(e,t);const r=getParentBinaryExpression(n);const i=!treeToArray(r).isValidConcatenation;if(i&&isParenthesizedExpression(r.parent)&&isBinaryExpression(r.parent.parent)){return r.parent.parent}return n}function getRefactorEditsToConvertToTemplateString(e,t){const{file:n,startPosition:r}=e;const i=getNodeOrParentOfParentheses(n,r);switch(t){case fl:return{edits:getEditsForToTemplateLiteral(e,i)};default:return S.fail("invalid action")}}function getEditsForToTemplateLiteral(e,t){const n=getParentBinaryExpression(t);const r=e.file;const i=nodesToTemplate(treeToArray(n),r);const o=getTrailingCommentRanges(r.text,n.end);if(o){const t=o[o.length-1];const a={pos:o[0].pos,end:t.end};return dm.ChangeTracker.with(e,(e=>{e.deleteRange(r,a);e.replaceNode(r,n,i)}))}else{return dm.ChangeTracker.with(e,(e=>e.replaceNode(r,n,i)))}}function isNotEqualsOperator(e){return!(e.operatorToken.kind===64||e.operatorToken.kind===65)}function getParentBinaryExpression(e){const t=findAncestor(e.parent,(e=>{switch(e.kind){case 211:case 212:return false;case 228:case 226:return!(isBinaryExpression(e.parent)&&isNotEqualsOperator(e.parent));default:return"quit"}}));return t||e}function treeToArray(e){const loop=e=>{if(!isBinaryExpression(e)){return{nodes:[e],operators:[],validOperators:true,hasString:isStringLiteral(e)||isNoSubstitutionTemplateLiteral(e)}}const{nodes:t,operators:n,hasString:r,validOperators:i}=loop(e.left);if(!(r||isStringLiteral(e.right)||isTemplateExpression(e.right))){return{nodes:[e],operators:[],hasString:false,validOperators:true}}const o=e.operatorToken.kind===40;const a=i&&o;t.push(e.right);n.push(e.operatorToken);return{nodes:t,operators:n,hasString:true,validOperators:a}};const{nodes:t,operators:n,validOperators:r,hasString:i}=loop(e);return{nodes:t,operators:n,isValidConcatenation:r&&i}}var copyTrailingOperatorComments=(e,t)=>(n,r)=>{if(n(r,i)=>{while(r.length>0){const o=r.shift();copyTrailingComments(e[o],i,t,3,false);n(o,i)}};function escapeRawStringForTemplate(e){return e.replace(/\\.|[$`]/g,(e=>e[0]==="\\"?e:"\\"+e))}function getRawTextOfTemplate(e){const t=isTemplateHead(e)||isTemplateMiddle(e)?-2:-1;return getTextOfNode(e).slice(1,t)}function concatConsecutiveString(e,t){const n=[];let r="",i="";while(e{copyExpressionComments(e);const r=t===n.templateSpans.length-1;const i=e.literal.text+(r?a:"");const o=getRawTextOfTemplate(e.literal)+(r?s:"");return zr.createTemplateSpan(e.expression,d&&r?zr.createTemplateTail(i,o):zr.createTemplateMiddle(i,o))}));l.push(...e)}else{const e=d?zr.createTemplateTail(a,s):zr.createTemplateMiddle(a,s);i(c,e);l.push(zr.createTemplateSpan(n,e))}}return zr.createTemplateExpression(d,l)}function copyExpressionComments(e){const t=e.getSourceFile();copyTrailingComments(e,e.expression,t,3,false);copyTrailingAsLeadingComments(e.expression,e.expression,t,3,false)}function getExpressionFromParenthesesOrExpression(e){if(isParenthesizedExpression(e)){copyExpressionComments(e);e=e.expression}return e}var _l={};var gl="Convert to optional chain expression";var yl=getLocaleSpecificMessage(wt.Convert_to_optional_chain_expression);var hl={name:gl,description:yl,kind:"refactor.rewrite.expression.optionalChain"};registerRefactor(gl,{kinds:[hl.kind],getEditsForAction:getRefactorEditsToConvertToOptionalChain,getAvailableActions:getRefactorActionsToConvertToOptionalChain});function getRefactorActionsToConvertToOptionalChain(e){const t=getInfo3(e,e.triggerReason==="invoked");if(!t)return d;if(!isRefactorErrorInfo(t)){return[{name:gl,description:yl,actions:[hl]}]}if(e.preferences.provideRefactorNotApplicableReason){return[{name:gl,description:yl,actions:[{...hl,notApplicableReason:t.error}]}]}return d}function getRefactorEditsToConvertToOptionalChain(e,t){const n=getInfo3(e);S.assert(n&&!isRefactorErrorInfo(n),"Expected applicable refactor info");const r=dm.ChangeTracker.with(e,(r=>doChange6(e.file,e.program.getTypeChecker(),r,n,t)));return{edits:r,renameFilename:void 0,renameLocation:void 0}}function isValidExpression(e){return isBinaryExpression(e)||isConditionalExpression(e)}function isValidStatement(e){return isExpressionStatement(e)||isReturnStatement(e)||isVariableStatement(e)}function isValidExpressionOrStatement(e){return isValidExpression(e)||isValidStatement(e)}function getInfo3(e,t=true){const{file:n,program:r}=e;const i=getRefactorContextSpan(e);const o=i.length===0;if(o&&!t)return void 0;const a=getTokenAtPosition(n,i.start);const s=findTokenOnLeftOfPosition(n,i.start+i.length);const c=createTextSpanFromBounds(a.pos,s&&s.end>=a.pos?s.getEnd():a.getEnd());const l=o?getValidParentNodeOfEmptySpan(a):getValidParentNodeContainingSpan(a,c);const d=l&&isValidExpressionOrStatement(l)?getExpression(l):void 0;if(!d)return{error:getLocaleSpecificMessage(wt.Could_not_find_convertible_access_expression)};const p=r.getTypeChecker();return isConditionalExpression(d)?getConditionalInfo(d,p):getBinaryInfo(d)}function getConditionalInfo(e,t){const n=e.condition;const r=getFinalExpressionInChain(e.whenTrue);if(!r||t.isNullableType(t.getTypeAtLocation(r))){return{error:getLocaleSpecificMessage(wt.Could_not_find_convertible_access_expression)}}if((isPropertyAccessExpression(n)||isIdentifier(n))&&getMatchingStart(n,r.expression)){return{finalExpression:r,occurrences:[n],expression:e}}else if(isBinaryExpression(n)){const t=getOccurrencesInExpression(r.expression,n);return t?{finalExpression:r,occurrences:t,expression:e}:{error:getLocaleSpecificMessage(wt.Could_not_find_matching_access_expressions)}}}function getBinaryInfo(e){if(e.operatorToken.kind!==56){return{error:getLocaleSpecificMessage(wt.Can_only_convert_logical_AND_access_chains)}}const t=getFinalExpressionInChain(e.right);if(!t)return{error:getLocaleSpecificMessage(wt.Could_not_find_convertible_access_expression)};const n=getOccurrencesInExpression(t.expression,e.left);return n?{finalExpression:t,occurrences:n,expression:e}:{error:getLocaleSpecificMessage(wt.Could_not_find_matching_access_expressions)}}function getOccurrencesInExpression(e,t){const n=[];while(isBinaryExpression(t)&&t.operatorToken.kind===56){const r=getMatchingStart(skipParentheses(e),skipParentheses(t.right));if(!r){break}n.push(r);e=r;t=t.left}const r=getMatchingStart(e,t);if(r){n.push(r)}return n.length>0?n:void 0}function getMatchingStart(e,t){if(!isIdentifier(t)&&!isPropertyAccessExpression(t)&&!isElementAccessExpression(t)){return void 0}return chainStartsWith(e,t)?t:void 0}function chainStartsWith(e,t){while(isCallExpression(e)||isPropertyAccessExpression(e)||isElementAccessExpression(e)){if(getTextOfChainNode(e)===getTextOfChainNode(t))break;e=e.expression}while(isPropertyAccessExpression(e)&&isPropertyAccessExpression(t)||isElementAccessExpression(e)&&isElementAccessExpression(t)){if(getTextOfChainNode(e)!==getTextOfChainNode(t))return false;e=e.expression;t=t.expression}return isIdentifier(e)&&isIdentifier(t)&&e.getText()===t.getText()}function getTextOfChainNode(e){if(isIdentifier(e)||isStringOrNumericLiteralLike(e)){return e.getText()}if(isPropertyAccessExpression(e)){return getTextOfChainNode(e.name)}if(isElementAccessExpression(e)){return getTextOfChainNode(e.argumentExpression)}return void 0}function getValidParentNodeContainingSpan(e,t){while(e.parent){if(isValidExpressionOrStatement(e)&&t.length!==0&&e.end>=t.start+t.length){return e}e=e.parent}return void 0}function getValidParentNodeOfEmptySpan(e){while(e.parent){if(isValidExpressionOrStatement(e)&&!isValidExpressionOrStatement(e.parent)){return e}e=e.parent}return void 0}function getExpression(e){if(isValidExpression(e)){return e}if(isVariableStatement(e)){const t=getSingleVariableOfVariableStatement(e);const n=t==null?void 0:t.initializer;return n&&isValidExpression(n)?n:void 0}return e.expression&&isValidExpression(e.expression)?e.expression:void 0}function getFinalExpressionInChain(e){e=skipParentheses(e);if(isBinaryExpression(e)){return getFinalExpressionInChain(e.left)}else if((isPropertyAccessExpression(e)||isElementAccessExpression(e)||isCallExpression(e))&&!isOptionalChain(e)){return e}return void 0}function convertOccurrences(e,t,n){if(isPropertyAccessExpression(t)||isElementAccessExpression(t)||isCallExpression(t)){const r=convertOccurrences(e,t.expression,n);const i=n.length>0?n[n.length-1]:void 0;const o=(i==null?void 0:i.getText())===t.expression.getText();if(o)n.pop();if(isCallExpression(t)){return o?zr.createCallChain(r,zr.createToken(29),t.typeArguments,t.arguments):zr.createCallChain(r,t.questionDotToken,t.typeArguments,t.arguments)}else if(isPropertyAccessExpression(t)){return o?zr.createPropertyAccessChain(r,zr.createToken(29),t.name):zr.createPropertyAccessChain(r,t.questionDotToken,t.name)}else if(isElementAccessExpression(t)){return o?zr.createElementAccessChain(r,zr.createToken(29),t.argumentExpression):zr.createElementAccessChain(r,t.questionDotToken,t.argumentExpression)}}return t}function doChange6(e,t,n,r,i){const{finalExpression:o,occurrences:a,expression:s}=r;const c=a[a.length-1];const l=convertOccurrences(t,o,a);if(l&&(isPropertyAccessExpression(l)||isElementAccessExpression(l)||isCallExpression(l))){if(isBinaryExpression(s)){n.replaceNodeRange(e,c,o,l)}else if(isConditionalExpression(s)){n.replaceNode(e,s,zr.createBinaryExpression(l,zr.createToken(61),s.whenFalse))}}}var Tl={};__export(Tl,{Messages:()=>bl,RangeFacts:()=>Cl,getRangeToExtract:()=>getRangeToExtract2,getRefactorActionsToExtractSymbol:()=>getRefactorActionsToExtractSymbol,getRefactorEditsToExtractSymbol:()=>getRefactorEditsToExtractSymbol});var Sl="Extract Symbol";var vl={name:"Extract Constant",description:getLocaleSpecificMessage(wt.Extract_constant),kind:"refactor.extract.constant"};var xl={name:"Extract Function",description:getLocaleSpecificMessage(wt.Extract_function),kind:"refactor.extract.function"};registerRefactor(Sl,{kinds:[vl.kind,xl.kind],getEditsForAction:getRefactorEditsToExtractSymbol,getAvailableActions:getRefactorActionsToExtractSymbol});function getRefactorActionsToExtractSymbol(e){const t=e.kind;const n=getRangeToExtract2(e.file,getRefactorContextSpan(e),e.triggerReason==="invoked");const r=n.targetRange;if(r===void 0){if(!n.errors||n.errors.length===0||!e.preferences.provideRefactorNotApplicableReason){return d}const r=[];if(refactorKindBeginsWith(xl.kind,t)){r.push({name:Sl,description:xl.description,actions:[{...xl,notApplicableReason:getStringError(n.errors)}]})}if(refactorKindBeginsWith(vl.kind,t)){r.push({name:Sl,description:vl.description,actions:[{...vl,notApplicableReason:getStringError(n.errors)}]})}return r}const{affectedTextRange:i,extractions:o}=getPossibleExtractions(r,e);if(o===void 0){return d}const a=[];const s=new Map;let c;const l=[];const p=new Map;let u;let f=0;for(const{functionExtraction:n,constantExtraction:r}of o){if(refactorKindBeginsWith(xl.kind,t)){const t=n.description;if(n.errors.length===0){if(!s.has(t)){s.set(t,true);a.push({description:t,name:`function_scope_${f}`,kind:xl.kind,range:{start:{line:getLineAndCharacterOfPosition(e.file,i.pos).line,offset:getLineAndCharacterOfPosition(e.file,i.pos).character},end:{line:getLineAndCharacterOfPosition(e.file,i.end).line,offset:getLineAndCharacterOfPosition(e.file,i.end).character}}})}}else if(!c){c={description:t,name:`function_scope_${f}`,notApplicableReason:getStringError(n.errors),kind:xl.kind}}}if(refactorKindBeginsWith(vl.kind,t)){const t=r.description;if(r.errors.length===0){if(!p.has(t)){p.set(t,true);l.push({description:t,name:`constant_scope_${f}`,kind:vl.kind,range:{start:{line:getLineAndCharacterOfPosition(e.file,i.pos).line,offset:getLineAndCharacterOfPosition(e.file,i.pos).character},end:{line:getLineAndCharacterOfPosition(e.file,i.end).line,offset:getLineAndCharacterOfPosition(e.file,i.end).character}}})}}else if(!u){u={description:t,name:`constant_scope_${f}`,notApplicableReason:getStringError(r.errors),kind:vl.kind}}}f++}const m=[];if(a.length){m.push({name:Sl,description:getLocaleSpecificMessage(wt.Extract_function),actions:a})}else if(e.preferences.provideRefactorNotApplicableReason&&c){m.push({name:Sl,description:getLocaleSpecificMessage(wt.Extract_function),actions:[c]})}if(l.length){m.push({name:Sl,description:getLocaleSpecificMessage(wt.Extract_constant),actions:l})}else if(e.preferences.provideRefactorNotApplicableReason&&u){m.push({name:Sl,description:getLocaleSpecificMessage(wt.Extract_constant),actions:[u]})}return m.length?m:d;function getStringError(e){let t=e[0].messageText;if(typeof t!=="string"){t=t.messageText}return t}}function getRefactorEditsToExtractSymbol(e,t){const n=getRangeToExtract2(e.file,getRefactorContextSpan(e));const r=n.targetRange;const i=/^function_scope_(\d+)$/.exec(t);if(i){const t=+i[1];S.assert(isFinite(t),"Expected to parse a finite number from the function scope index");return getFunctionExtractionAtIndex(r,e,t)}const o=/^constant_scope_(\d+)$/.exec(t);if(o){const t=+o[1];S.assert(isFinite(t),"Expected to parse a finite number from the constant scope index");return getConstantExtractionAtIndex(r,e,t)}S.fail("Unrecognized action name")}var bl;(e=>{function createMessage(e){return{message:e,code:0,category:3,key:e}}e.cannotExtractRange=createMessage("Cannot extract range.");e.cannotExtractImport=createMessage("Cannot extract import statement.");e.cannotExtractSuper=createMessage("Cannot extract super call.");e.cannotExtractJSDoc=createMessage("Cannot extract JSDoc.");e.cannotExtractEmpty=createMessage("Cannot extract empty range.");e.expressionExpected=createMessage("expression expected.");e.uselessConstantType=createMessage("No reason to extract constant of type.");e.statementOrExpressionExpected=createMessage("Statement or expression expected.");e.cannotExtractRangeContainingConditionalBreakOrContinueStatements=createMessage("Cannot extract range containing conditional break or continue statements.");e.cannotExtractRangeContainingConditionalReturnStatement=createMessage("Cannot extract range containing conditional return statement.");e.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange=createMessage("Cannot extract range containing labeled break or continue with target outside of the range.");e.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators=createMessage("Cannot extract range containing writes to references located outside of the target range in generators.");e.typeWillNotBeVisibleInTheNewScope=createMessage("Type will not visible in the new scope.");e.functionWillNotBeVisibleInTheNewScope=createMessage("Function will not visible in the new scope.");e.cannotExtractIdentifier=createMessage("Select more than a single identifier.");e.cannotExtractExportedEntity=createMessage("Cannot extract exported declaration");e.cannotWriteInExpression=createMessage("Cannot write back side-effects when extracting an expression");e.cannotExtractReadonlyPropertyInitializerOutsideConstructor=createMessage("Cannot move initialization of read-only class property outside of the constructor");e.cannotExtractAmbientBlock=createMessage("Cannot extract code from ambient contexts");e.cannotAccessVariablesFromNestedScopes=createMessage("Cannot access variables from nested scopes");e.cannotExtractToJSClass=createMessage("Cannot extract constant to a class scope in JS");e.cannotExtractToExpressionArrowFunction=createMessage("Cannot extract constant to an arrow function without a block");e.cannotExtractFunctionsContainingThisToMethod=createMessage("Cannot extract functions containing this to method")})(bl||(bl={}));var Cl=(e=>{e[e["None"]=0]="None";e[e["HasReturn"]=1]="HasReturn";e[e["IsGenerator"]=2]="IsGenerator";e[e["IsAsyncFunction"]=4]="IsAsyncFunction";e[e["UsesThis"]=8]="UsesThis";e[e["UsesThisInFunction"]=16]="UsesThisInFunction";e[e["InStaticRegion"]=32]="InStaticRegion";return e})(Cl||{});function getRangeToExtract2(e,t,n=true){const{length:r}=t;if(r===0&&!n){return{errors:[createFileDiagnostic(e,t.start,r,bl.cannotExtractEmpty)]}}const i=r===0&&n;const o=findFirstNonJsxWhitespaceToken(e,t.start);const a=findTokenOnLeftOfPosition(e,textSpanEnd(t));const s=o&&a&&n?getAdjustedSpanFromNodes(o,a,e):t;const c=i?getExtractableParent(o):getParentNodeInSpan(o,e,s);const l=i?c:getParentNodeInSpan(a,e,s);let d=0;let p;if(!c||!l){return{errors:[createFileDiagnostic(e,t.start,r,bl.cannotExtractRange)]}}if(c.flags&16777216){return{errors:[createFileDiagnostic(e,t.start,r,bl.cannotExtractJSDoc)]}}if(c.parent!==l.parent){return{errors:[createFileDiagnostic(e,t.start,r,bl.cannotExtractRange)]}}if(c!==l){if(!isBlockLike(c.parent)){return{errors:[createFileDiagnostic(e,t.start,r,bl.cannotExtractRange)]}}const n=[];for(const e of c.parent.statements){if(e===c||n.length){const t=checkNode(e);if(t){return{errors:t}}n.push(e)}if(e===l){break}}if(!n.length){return{errors:[createFileDiagnostic(e,t.start,r,bl.cannotExtractRange)]}}return{targetRange:{range:n,facts:d,thisNode:p}}}if(isReturnStatement(c)&&!c.expression){return{errors:[createFileDiagnostic(e,t.start,r,bl.cannotExtractRange)]}}const u=refineNode(c);const f=checkRootNode(u)||checkNode(u);if(f){return{errors:f}}return{targetRange:{range:getStatementOrExpressionRange(u),facts:d,thisNode:p}};function refineNode(e){if(isReturnStatement(e)){if(e.expression){return e.expression}}else if(isVariableStatement(e)||isVariableDeclarationList(e)){const t=isVariableStatement(e)?e.declarationList.declarations:e.declarations;let n=0;let r;for(const e of t){if(e.initializer){n++;r=e.initializer}}if(n===1){return r}}else if(isVariableDeclaration(e)){if(e.initializer){return e.initializer}}return e}function checkRootNode(e){if(isIdentifier(isExpressionStatement(e)?e.expression:e)){return[createDiagnosticForNode(e,bl.cannotExtractIdentifier)]}return void 0}function checkForStaticContext(e,t){let n=e;while(n!==t){if(n.kind===172){if(isStatic(n)){d|=32}break}else if(n.kind===169){const e=getContainingFunction(n);if(e.kind===176){d|=32}break}else if(n.kind===174){if(isStatic(n)){d|=32}}n=n.parent}}function checkNode(e){let n;(e=>{e[e["None"]=0]="None";e[e["Break"]=1]="Break";e[e["Continue"]=2]="Continue";e[e["Return"]=4]="Return"})(n||(n={}));S.assert(e.pos<=e.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)");S.assert(!positionIsSynthesized(e.pos),"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)");if(!isStatement(e)&&!(isExpressionNode(e)&&isExtractableExpression(e))&&!isStringLiteralJsxAttribute(e)){return[createDiagnosticForNode(e,bl.statementOrExpressionExpected)]}if(e.flags&33554432){return[createDiagnosticForNode(e,bl.cannotExtractAmbientBlock)]}const r=getContainingClass(e);if(r){checkForStaticContext(e,r)}let i;let o=4;let a;visit(e);if(d&8){const t=getThisContainer(e,false,false);if(t.kind===262||t.kind===174&&t.parent.kind===210||t.kind===218){d|=16}}return i;function visit(e){if(i){return true}if(isDeclaration(e)){const t=e.kind===260?e.parent.parent:e;if(hasSyntacticModifier(t,32)){(i||(i=[])).push(createDiagnosticForNode(e,bl.cannotExtractExportedEntity));return true}}switch(e.kind){case 272:(i||(i=[])).push(createDiagnosticForNode(e,bl.cannotExtractImport));return true;case 277:(i||(i=[])).push(createDiagnosticForNode(e,bl.cannotExtractExportedEntity));return true;case 108:if(e.parent.kind===213){const n=getContainingClass(e);if(n===void 0||n.pos=t.start+t.length){(i||(i=[])).push(createDiagnosticForNode(e,bl.cannotExtractSuper));return true}}else{d|=8;p=e}break;case 219:forEachChild(e,(function check(t){if(isThis(t)){d|=8;p=e}else if(isClassLike(t)||isFunctionLike(t)&&!isArrowFunction(t)){return false}else{forEachChild(t,check)}}));case 263:case 262:if(isSourceFile(e.parent)&&e.parent.externalModuleIndicator===void 0){(i||(i=[])).push(createDiagnosticForNode(e,bl.functionWillNotBeVisibleInTheNewScope))}case 231:case 218:case 174:case 176:case 177:case 178:return false}const n=o;switch(e.kind){case 245:o&=~4;break;case 258:o=0;break;case 241:if(e.parent&&e.parent.kind===258&&e.parent.finallyBlock===e){o=4}break;case 297:case 296:o|=1;break;default:if(isIterationStatement(e,false)){o|=1|2}break}switch(e.kind){case 197:case 110:d|=8;p=e;break;case 256:{const t=e.label;(a||(a=[])).push(t.escapedText);forEachChild(e,visit);a.pop();break}case 252:case 251:{const t=e.label;if(t){if(!contains(a,t.escapedText)){(i||(i=[])).push(createDiagnosticForNode(e,bl.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange))}}else{if(!(o&(e.kind===252?1:2))){(i||(i=[])).push(createDiagnosticForNode(e,bl.cannotExtractRangeContainingConditionalBreakOrContinueStatements))}}break}case 223:d|=4;break;case 229:d|=2;break;case 253:if(o&4){d|=1}else{(i||(i=[])).push(createDiagnosticForNode(e,bl.cannotExtractRangeContainingConditionalReturnStatement))}break;default:forEachChild(e,visit);break}o=n}}}function getAdjustedSpanFromNodes(e,t,n){const r=e.getStart(n);let i=t.getEnd();if(n.text.charCodeAt(i)===59){i++}return{start:r,length:i-r}}function getStatementOrExpressionRange(e){if(isStatement(e)){return[e]}if(isExpressionNode(e)){return isExpressionStatement(e.parent)?[e.parent]:e}if(isStringLiteralJsxAttribute(e)){return e}return void 0}function isScope(e){return isArrowFunction(e)?isFunctionBody(e.body):isFunctionLikeDeclaration(e)||isSourceFile(e)||isModuleBlock(e)||isClassLike(e)}function collectEnclosingScopes(e){let t=isReadonlyArray(e.range)?first(e.range):e.range;if(e.facts&8&&!(e.facts&16)){const e=getContainingClass(t);if(e){const n=findAncestor(t,isFunctionLikeDeclaration);return n?[n,e]:[e]}}const n=[];while(true){t=t.parent;if(t.kind===169){t=findAncestor(t,(e=>isFunctionLikeDeclaration(e))).parent}if(isScope(t)){n.push(t);if(t.kind===307){return n}}}}function getFunctionExtractionAtIndex(e,t,n){const{scopes:r,readsAndWrites:{target:i,usagesPerScope:o,functionErrorsPerScope:a,exposedVariableDeclarations:s}}=getPossibleExtractionsWorker(e,t);S.assert(!a[n].length,"The extraction went missing? How?");t.cancellationToken.throwIfCancellationRequested();return extractFunctionInScope(i,r[n],o[n],s,e,t)}function getConstantExtractionAtIndex(e,t,n){const{scopes:r,readsAndWrites:{target:i,usagesPerScope:o,constantErrorsPerScope:a,exposedVariableDeclarations:s}}=getPossibleExtractionsWorker(e,t);S.assert(!a[n].length,"The extraction went missing? How?");S.assert(s.length===0,"Extract constant accepted a range containing a variable declaration?");t.cancellationToken.throwIfCancellationRequested();const c=isExpression(i)?i:i.statements[0].expression;return extractConstantInScope(c,r[n],o[n],e.facts,t)}function getPossibleExtractions(e,t){const{scopes:n,affectedTextRange:r,readsAndWrites:{functionErrorsPerScope:i,constantErrorsPerScope:o}}=getPossibleExtractionsWorker(e,t);const a=n.map(((e,t)=>{const n=getDescriptionForFunctionInScope(e);const r=getDescriptionForConstantInScope(e);const a=isFunctionLikeDeclaration(e)?getDescriptionForFunctionLikeDeclaration(e):isClassLike(e)?getDescriptionForClassLikeDeclaration(e):getDescriptionForModuleLikeDeclaration(e);let s;let c;if(a===1){s=formatStringFromArgs(getLocaleSpecificMessage(wt.Extract_to_0_in_1_scope),[n,"global"]);c=formatStringFromArgs(getLocaleSpecificMessage(wt.Extract_to_0_in_1_scope),[r,"global"])}else if(a===0){s=formatStringFromArgs(getLocaleSpecificMessage(wt.Extract_to_0_in_1_scope),[n,"module"]);c=formatStringFromArgs(getLocaleSpecificMessage(wt.Extract_to_0_in_1_scope),[r,"module"])}else{s=formatStringFromArgs(getLocaleSpecificMessage(wt.Extract_to_0_in_1),[n,a]);c=formatStringFromArgs(getLocaleSpecificMessage(wt.Extract_to_0_in_1),[r,a])}if(t===0&&!isClassLike(e)){c=formatStringFromArgs(getLocaleSpecificMessage(wt.Extract_to_0_in_enclosing_scope),[r])}return{functionExtraction:{description:s,errors:i[t]},constantExtraction:{description:c,errors:o[t]}}}));return{affectedTextRange:r,extractions:a}}function getPossibleExtractionsWorker(e,t){const{file:n}=t;const r=collectEnclosingScopes(e);const i=getEnclosingTextRange(e,n);const o=collectReadsAndWrites(e,r,i,n,t.program.getTypeChecker(),t.cancellationToken);return{scopes:r,affectedTextRange:i,readsAndWrites:o}}function getDescriptionForFunctionInScope(e){return isFunctionLikeDeclaration(e)?"inner function":isClassLike(e)?"method":"function"}function getDescriptionForConstantInScope(e){return isClassLike(e)?"readonly field":"constant"}function getDescriptionForFunctionLikeDeclaration(e){switch(e.kind){case 176:return"constructor";case 218:case 262:return e.name?`function '${e.name.text}'`:ec;case 219:return"arrow function";case 174:return`method '${e.name.getText()}'`;case 177:return`'get ${e.name.getText()}'`;case 178:return`'set ${e.name.getText()}'`;default:S.assertNever(e,`Unexpected scope kind ${e.kind}`)}}function getDescriptionForClassLikeDeclaration(e){return e.kind===263?e.name?`class '${e.name.text}'`:"anonymous class declaration":e.name?`class expression '${e.name.text}'`:"anonymous class expression"}function getDescriptionForModuleLikeDeclaration(e){return e.kind===268?`namespace '${e.parent.name.getText()}'`:e.externalModuleIndicator?0:1}function extractFunctionInScope(e,t,{usages:n,typeParameterUsages:r,substitutions:i},o,a,s){const c=s.program.getTypeChecker();const l=zn(s.program.getCompilerOptions());const d=id.createImportAdder(s.file,s.program,s.preferences,s.host);const p=t.getSourceFile();const u=getUniqueName(isClassLike(t)?"newMethod":"newFunction",p);const f=isInJSFile(t);const m=zr.createIdentifier(u);let _;const g=[];const y=[];let h;n.forEach(((e,n)=>{let r;if(!f){let n=c.getTypeOfSymbolAtLocation(e.symbol,e.node);n=c.getBaseTypeOfLiteralType(n);r=id.typeToAutoImportableTypeNode(c,d,n,t,l,1,8)}const i=zr.createParameterDeclaration(void 0,void 0,n,void 0,r);g.push(i);if(e.usage===2){(h||(h=[])).push(e)}y.push(zr.createIdentifier(n))}));const T=arrayFrom(r.values(),(e=>({type:e,declaration:getFirstDeclarationBeforePosition(e,s.startPosition)})));T.sort(compareTypesByDeclarationOrder);const v=T.length===0?void 0:mapDefined(T,(({declaration:e})=>e));const x=v!==void 0?v.map((e=>zr.createTypeReferenceNode(e.name,void 0))):void 0;if(isExpression(e)&&!f){const n=c.getContextualType(e);_=c.typeToTypeNode(n,t,1,8)}const{body:b,returnValueProperty:C}=transformFunctionBody(e,o,h,i,!!(a.facts&1));suppressLeadingAndTrailingTrivia(b);let E;const N=!!(a.facts&16);if(isClassLike(t)){const e=f?[]:[zr.createModifier(123)];if(a.facts&32){e.push(zr.createModifier(126))}if(a.facts&4){e.push(zr.createModifier(134))}E=zr.createMethodDeclaration(e.length?e:void 0,a.facts&2?zr.createToken(42):void 0,m,void 0,v,g,_,b)}else{if(N){g.unshift(zr.createParameterDeclaration(void 0,void 0,"this",void 0,c.typeToTypeNode(c.getTypeAtLocation(a.thisNode),t,1,8),void 0))}E=zr.createFunctionDeclaration(a.facts&4?[zr.createToken(134)]:void 0,a.facts&2?zr.createToken(42):void 0,m,v,g,_,b)}const k=dm.ChangeTracker.fromContext(s);const F=(isReadonlyArray(a.range)?last(a.range):a.range).end;const P=getNodeToInsertFunctionBefore(F,t);if(P){k.insertNodeBefore(s.file,P,E,true)}else{k.insertNodeAtEndOfScope(s.file,t,E)}d.writeFixes(k);const D=[];const I=getCalledExpression(t,a,u);if(N){y.unshift(zr.createIdentifier("this"))}let A=zr.createCallExpression(N?zr.createPropertyAccessExpression(I,"call"):I,x,y);if(a.facts&2){A=zr.createYieldExpression(zr.createToken(42),A)}if(a.facts&4){A=zr.createAwaitExpression(A)}if(isInJSXContent(e)){A=zr.createJsxExpression(void 0,A)}if(o.length&&!h){S.assert(!C,"Expected no returnValueProperty");S.assert(!(a.facts&1),"Expected RangeFacts.HasReturn flag to be unset");if(o.length===1){const e=o[0];D.push(zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(getSynthesizedDeepClone(e.name),void 0,getSynthesizedDeepClone(e.type),A)],e.parent.flags)))}else{const e=[];const n=[];let r=o[0].parent.flags;let i=false;for(const a of o){e.push(zr.createBindingElement(void 0,void 0,getSynthesizedDeepClone(a.name)));const o=c.typeToTypeNode(c.getBaseTypeOfLiteralType(c.getTypeAtLocation(a)),t,1,8);n.push(zr.createPropertySignature(void 0,a.symbol.name,void 0,o));i=i||a.type!==void 0;r=r&a.parent.flags}const a=i?zr.createTypeLiteralNode(n):void 0;if(a){setEmitFlags(a,1)}D.push(zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(zr.createObjectBindingPattern(e),void 0,a,A)],r)))}}else if(o.length||h){if(o.length){for(const e of o){let t=e.parent.flags;if(t&2){t=t&~2|1}D.push(zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(e.symbol.name,void 0,getTypeDeepCloneUnionUndefined(e.type))],t)))}}if(C){D.push(zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(C,void 0,getTypeDeepCloneUnionUndefined(_))],1)))}const e=getPropertyAssignmentsForWritesAndVariableDeclarations(o,h);if(C){e.unshift(zr.createShorthandPropertyAssignment(C))}if(e.length===1){S.assert(!C,"Shouldn't have returnValueProperty here");D.push(zr.createExpressionStatement(zr.createAssignment(e[0].name,A)));if(a.facts&1){D.push(zr.createReturnStatement())}}else{D.push(zr.createExpressionStatement(zr.createAssignment(zr.createObjectLiteralExpression(e),A)));if(C){D.push(zr.createReturnStatement(zr.createIdentifier(C)))}}}else{if(a.facts&1){D.push(zr.createReturnStatement(A))}else if(isReadonlyArray(a.range)){D.push(zr.createExpressionStatement(A))}else{D.push(A)}}if(isReadonlyArray(a.range)){k.replaceNodeRangeWithNodes(s.file,first(a.range),last(a.range),D)}else{k.replaceNodeWithNodes(s.file,a.range,D)}const O=k.getChanges();const w=isReadonlyArray(a.range)?first(a.range):a.range;const L=w.getSourceFile().fileName;const M=getRenameLocation(O,L,u,false);return{renameFilename:L,renameLocation:M,edits:O};function getTypeDeepCloneUnionUndefined(e){if(e===void 0){return void 0}const t=getSynthesizedDeepClone(e);let n=t;while(isParenthesizedTypeNode(n)){n=n.type}return isUnionTypeNode(n)&&find(n.types,(e=>e.kind===157))?t:zr.createUnionTypeNode([t,zr.createKeywordTypeNode(157)])}}function extractConstantInScope(e,t,{substitutions:n},r,i){const o=i.program.getTypeChecker();const a=t.getSourceFile();const s=getIdentifierForNode(e,t,o,a);const c=isInJSFile(t);let l=c||!o.isContextSensitive(e)?void 0:o.typeToTypeNode(o.getContextualType(e),t,1,8);let d=transformConstantInitializer(skipParentheses(e),n);({variableType:l,initializer:d}=transformFunctionInitializerAndType(l,d));suppressLeadingAndTrailingTrivia(d);const p=dm.ChangeTracker.fromContext(i);if(isClassLike(t)){S.assert(!c,"Cannot extract to a JS class");const n=[];n.push(zr.createModifier(123));if(r&32){n.push(zr.createModifier(126))}n.push(zr.createModifier(148));const o=zr.createPropertyDeclaration(n,s,void 0,l,d);let a=zr.createPropertyAccessExpression(r&32?zr.createIdentifier(t.name.getText()):zr.createThis(),zr.createIdentifier(s));if(isInJSXContent(e)){a=zr.createJsxExpression(void 0,a)}const u=e.pos;const f=getNodeToInsertPropertyBefore(u,t);p.insertNodeBefore(i.file,f,o,true);p.replaceNode(i.file,e,a)}else{const n=zr.createVariableDeclaration(s,void 0,l,d);const r=getContainingVariableDeclarationIfInList(e,t);if(r){p.insertNodeBefore(i.file,r,n);const t=zr.createIdentifier(s);p.replaceNode(i.file,e,t)}else if(e.parent.kind===244&&t===findAncestor(e,isScope)){const t=zr.createVariableStatement(void 0,zr.createVariableDeclarationList([n],2));p.replaceNode(i.file,e.parent,t)}else{const r=zr.createVariableStatement(void 0,zr.createVariableDeclarationList([n],2));const o=getNodeToInsertConstantBefore(e,t);if(o.pos===0){p.insertNodeAtTopOfFile(i.file,r,false)}else{p.insertNodeBefore(i.file,o,r,false)}if(e.parent.kind===244){p.delete(i.file,e.parent)}else{let t=zr.createIdentifier(s);if(isInJSXContent(e)){t=zr.createJsxExpression(void 0,t)}p.replaceNode(i.file,e,t)}}}const u=p.getChanges();const f=e.getSourceFile().fileName;const m=getRenameLocation(u,f,s,true);return{renameFilename:f,renameLocation:m,edits:u};function transformFunctionInitializerAndType(n,r){if(n===void 0)return{variableType:n,initializer:r};if(!isFunctionExpression(r)&&!isArrowFunction(r)||!!r.typeParameters)return{variableType:n,initializer:r};const i=o.getTypeAtLocation(e);const a=singleOrUndefined(o.getSignaturesOfType(i,0));if(!a)return{variableType:n,initializer:r};if(!!a.getTypeParameters())return{variableType:n,initializer:r};const s=[];let c=false;for(const e of r.parameters){if(e.type){s.push(e)}else{const n=o.getTypeAtLocation(e);if(n===o.getAnyType())c=true;s.push(zr.updateParameterDeclaration(e,e.modifiers,e.dotDotDotToken,e.name,e.questionToken,e.type||o.typeToTypeNode(n,t,1,8),e.initializer))}}if(c)return{variableType:n,initializer:r};n=void 0;if(isArrowFunction(r)){r=zr.updateArrowFunction(r,canHaveModifiers(e)?getModifiers(e):void 0,r.typeParameters,s,r.type||o.typeToTypeNode(a.getReturnType(),t,1,8),r.equalsGreaterThanToken,r.body)}else{if(a&&!!a.thisParameter){const n=firstOrUndefined(s);if(!n||isIdentifier(n.name)&&n.name.escapedText!=="this"){const n=o.getTypeOfSymbolAtLocation(a.thisParameter,e);s.splice(0,0,zr.createParameterDeclaration(void 0,void 0,"this",void 0,o.typeToTypeNode(n,t,1,8)))}}r=zr.updateFunctionExpression(r,canHaveModifiers(e)?getModifiers(e):void 0,r.asteriskToken,r.name,r.typeParameters,s,r.type||o.typeToTypeNode(a.getReturnType(),t,1),r.body)}return{variableType:n,initializer:r}}}function getContainingVariableDeclarationIfInList(e,t){let n;while(e!==void 0&&e!==t){if(isVariableDeclaration(e)&&e.initializer===n&&isVariableDeclarationList(e.parent)&&e.parent.declarations.length>1){return e}n=e;e=e.parent}}function getFirstDeclarationBeforePosition(e,t){let n;const r=e.symbol;if(r&&r.declarations){for(const e of r.declarations){if((n===void 0||e.pos0;if(isBlock(e)&&!o&&r.size===0){return{body:zr.createBlock(e.statements,true),returnValueProperty:void 0}}let a;let s=false;const c=zr.createNodeArray(isBlock(e)?e.statements.slice(0):[isStatement(e)?e:zr.createReturnStatement(skipParentheses(e))]);if(o||r.size){const r=visitNodes2(c,visitor,isStatement).slice();if(o&&!i&&isStatement(e)){const e=getPropertyAssignmentsForWritesAndVariableDeclarations(t,n);if(e.length===1){r.push(zr.createReturnStatement(e[0].name))}else{r.push(zr.createReturnStatement(zr.createObjectLiteralExpression(e)))}}return{body:zr.createBlock(r,true),returnValueProperty:a}}else{return{body:zr.createBlock(c,true),returnValueProperty:void 0}}function visitor(e){if(!s&&isReturnStatement(e)&&o){const r=getPropertyAssignmentsForWritesAndVariableDeclarations(t,n);if(e.expression){if(!a){a="__return"}r.unshift(zr.createPropertyAssignment(a,visitNode(e.expression,visitor,isExpression)))}if(r.length===1){return zr.createReturnStatement(r[0].name)}else{return zr.createReturnStatement(zr.createObjectLiteralExpression(r))}}else{const t=s;s=s||isFunctionLikeDeclaration(e)||isClassLike(e);const n=r.get(getNodeId(e).toString());const i=n?getSynthesizedDeepClone(n):visitEachChild(e,visitor,void 0);s=t;return i}}}function transformConstantInitializer(e,t){return t.size?visitor(e):e;function visitor(e){const n=t.get(getNodeId(e).toString());return n?getSynthesizedDeepClone(n):visitEachChild(e,visitor,void 0)}}function getStatementsOrClassElements(e){if(isFunctionLikeDeclaration(e)){const t=e.body;if(isBlock(t)){return t.statements}}else if(isModuleBlock(e)||isSourceFile(e)){return e.statements}else if(isClassLike(e)){return e.members}else{assertType(e)}return d}function getNodeToInsertFunctionBefore(e,t){return find(getStatementsOrClassElements(t),(t=>t.pos>=e&&isFunctionLikeDeclaration(t)&&!isConstructorDeclaration(t)))}function getNodeToInsertPropertyBefore(e,t){const n=t.members;S.assert(n.length>0,"Found no members");let r;let i=true;for(const t of n){if(t.pos>e){return r||n[0]}if(i&&!isPropertyDeclaration(t)){if(r!==void 0){return t}i=false}r=t}if(r===void 0)return S.fail();return r}function getNodeToInsertConstantBefore(e,t){S.assert(!isClassLike(t));let n;for(let r=e;r!==t;r=r.parent){if(isScope(r)){n=r}}for(let r=(n||e).parent;;r=r.parent){if(isBlockLike(r)){let t;for(const n of r.statements){if(n.pos>e.pos){break}t=n}if(!t&&isCaseClause(r)){S.assert(isSwitchStatement(r.parent.parent),"Grandparent isn't a switch statement");return r.parent.parent}return S.checkDefined(t,"prevStatement failed to get set")}S.assert(r!==t,"Didn't encounter a block-like before encountering scope")}}function getPropertyAssignmentsForWritesAndVariableDeclarations(e,t){const n=map(e,(e=>zr.createShorthandPropertyAssignment(e.symbol.name)));const r=map(t,(e=>zr.createShorthandPropertyAssignment(e.symbol.name)));return n===void 0?r:r===void 0?n:n.concat(r)}function isReadonlyArray(e){return isArray(e)}function getEnclosingTextRange(e,t){return isReadonlyArray(e.range)?{pos:first(e.range).getStart(t),end:last(e.range).getEnd()}:e.range}function collectReadsAndWrites(e,t,n,r,i,o){const a=new Map;const s=[];const c=[];const l=[];const d=[];const p=[];const u=new Map;const f=[];let m;const _=!isReadonlyArray(e.range)?e.range:e.range.length===1&&isExpressionStatement(e.range[0])?e.range[0].expression:void 0;let g;if(_===void 0){const t=e.range;const n=first(t).getStart();const i=last(t).end;g=createFileDiagnostic(r,n,i-n,bl.expressionExpected)}else if(i.getTypeAtLocation(_).flags&(16384|131072)){g=createDiagnosticForNode(_,bl.uselessConstantType)}for(const e of t){s.push({usages:new Map,typeParameterUsages:new Map,substitutions:new Map});c.push(new Map);l.push([]);const t=[];if(g){t.push(g)}if(isClassLike(e)&&isInJSFile(e)){t.push(createDiagnosticForNode(e,bl.cannotExtractToJSClass))}if(isArrowFunction(e)&&!isBlock(e.body)){t.push(createDiagnosticForNode(e,bl.cannotExtractToExpressionArrowFunction))}d.push(t)}const y=new Map;const h=isReadonlyArray(e.range)?zr.createBlock(e.range):e.range;const T=isReadonlyArray(e.range)?first(e.range):e.range;const v=isInGenericContext(T);collectUsages(h);if(v&&!isReadonlyArray(e.range)&&!isJsxAttribute(e.range)){const t=i.getContextualType(e.range);recordTypeParameterUsages(t)}if(a.size>0){const e=new Map;let n=0;for(let r=T;r!==void 0&&n{s[n].typeParameterUsages.set(t,e)}));n++}if(isDeclarationWithTypeParameters(r)){for(const t of getEffectiveTypeParameterDeclarations(r)){const n=i.getTypeAtLocation(t);if(a.has(n.id.toString())){e.set(n.id.toString(),n)}}}}S.assert(n===t.length,"Should have iterated all scopes")}if(p.length){const e=isBlockScope(t[0],t[0].parent)?t[0]:getEnclosingBlockScopeContainer(t[0]);forEachChild(e,checkForUsedDeclarations)}for(let n=0;n0&&(r.usages.size>0||r.typeParameterUsages.size>0)){const t=isReadonlyArray(e.range)?e.range[0]:e.range;d[n].push(createDiagnosticForNode(t,bl.cannotAccessVariablesFromNestedScopes))}if(e.facts&16&&isClassLike(t[n])){l[n].push(createDiagnosticForNode(e.thisNode,bl.cannotExtractFunctionsContainingThisToMethod))}let i=false;let o;s[n].usages.forEach((e=>{if(e.usage===2){i=true;if(e.symbol.flags&106500&&e.symbol.valueDeclaration&&hasEffectiveModifier(e.symbol.valueDeclaration,8)){o=e.symbol.valueDeclaration}}}));S.assert(isReadonlyArray(e.range)||f.length===0,"No variable declarations expected if something was extracted");if(i&&!isReadonlyArray(e.range)){const t=createDiagnosticForNode(e.range,bl.cannotWriteInExpression);l[n].push(t);d[n].push(t)}else if(o&&n>0){const e=createDiagnosticForNode(o,bl.cannotExtractReadonlyPropertyInitializerOutsideConstructor);l[n].push(e);d[n].push(e)}else if(m){const e=createDiagnosticForNode(m,bl.cannotExtractExportedEntity);l[n].push(e);d[n].push(e)}}return{target:h,usagesPerScope:s,functionErrorsPerScope:l,constantErrorsPerScope:d,exposedVariableDeclarations:f};function isInGenericContext(e){return!!findAncestor(e,(e=>isDeclarationWithTypeParameters(e)&&getEffectiveTypeParameterDeclarations(e).length!==0))}function recordTypeParameterUsages(e){const t=i.getSymbolWalker((()=>(o.throwIfCancellationRequested(),true)));const{visitedTypes:n}=t.walkType(e);for(const e of n){if(e.isTypeParameter()){a.set(e.id.toString(),e)}}}function collectUsages(e,t=1){if(v){const t=i.getTypeAtLocation(e);recordTypeParameterUsages(t)}if(isDeclaration(e)&&e.symbol){p.push(e)}if(isAssignmentExpression(e)){collectUsages(e.left,2);collectUsages(e.right)}else if(isUnaryExpressionWithWrite(e)){collectUsages(e.operand,2)}else if(isPropertyAccessExpression(e)||isElementAccessExpression(e)){forEachChild(e,collectUsages)}else if(isIdentifier(e)){if(!e.parent){return}if(isQualifiedName(e.parent)&&e!==e.parent.left){return}if(isPropertyAccessExpression(e.parent)&&e!==e.parent.expression){return}recordUsage(e,t,isPartOfTypeNode(e))}else{forEachChild(e,collectUsages)}}function recordUsage(e,n,r){const i=recordUsagebySymbol(e,n,r);if(i){for(let n=0;n=a){return f}y.set(f,a);if(m){for(const e of s){const t=e.usages.get(o.text);if(t){e.usages.set(o.text,{usage:a,symbol:u,node:o})}}return f}const _=u.getDeclarations();const g=_&&find(_,(e=>e.getSourceFile()===r));if(!g){return void 0}if(rangeContainsStartEnd(n,g.getStart(),g.end)){return void 0}if(e.facts&2&&a===2){const e=createDiagnosticForNode(o,bl.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators);for(const t of l){t.push(e)}for(const t of d){t.push(e)}}for(let e=0;ee.symbol===n));if(e){if(isVariableDeclaration(e)){const t=e.symbol.id.toString();if(!u.has(t)){f.push(e);u.set(t,true)}}else{m=m||e}}}forEachChild(t,checkForUsedDeclarations)}function getSymbolReferencedByIdentifier(e){return e.parent&&isShorthandPropertyAssignment(e.parent)&&e.parent.name===e?i.getShorthandAssignmentValueSymbol(e.parent):i.getSymbolAtLocation(e)}function tryReplaceWithQualifiedNameOrPropertyAccess(e,t,n){if(!e){return void 0}const r=e.getDeclarations();if(r&&r.some((e=>e.parent===t))){return zr.createIdentifier(e.name)}const i=tryReplaceWithQualifiedNameOrPropertyAccess(e.parent,t,n);if(i===void 0){return void 0}return n?zr.createQualifiedName(i,zr.createIdentifier(e.name)):zr.createPropertyAccessExpression(i,e.name)}}function getExtractableParent(e){return findAncestor(e,(e=>e.parent&&isExtractableExpression(e)&&!isBinaryExpression(e.parent)))}function isExtractableExpression(e){const{parent:t}=e;switch(t.kind){case 306:return false}switch(e.kind){case 11:return t.kind!==272&&t.kind!==276;case 230:case 206:case 208:return false;case 80:return t.kind!==208&&t.kind!==276&&t.kind!==281}return true}function isInJSXContent(e){return isStringLiteralJsxAttribute(e)||(isJsxElement(e)||isJsxSelfClosingElement(e)||isJsxFragment(e))&&(isJsxElement(e.parent)||isJsxFragment(e.parent))}function isStringLiteralJsxAttribute(e){return isStringLiteral(e)&&e.parent&&isJsxAttribute(e.parent)}var El={};var Nl="Generate 'get' and 'set' accessors";var kl=getLocaleSpecificMessage(wt.Generate_get_and_set_accessors);var Fl={name:Nl,description:kl,kind:"refactor.rewrite.property.generateAccessors"};registerRefactor(Nl,{kinds:[Fl.kind],getEditsForAction:function getRefactorActionsToGenerateGetAndSetAccessors(e,t){if(!e.endPosition)return void 0;const n=id.getAccessorConvertiblePropertyAtPosition(e.file,e.program,e.startPosition,e.endPosition);S.assert(n&&!isRefactorErrorInfo(n),"Expected applicable refactor info");const r=id.generateAccessorFromProperty(e.file,e.program,e.startPosition,e.endPosition,e,t);if(!r)return void 0;const i=e.file.fileName;const o=n.renameAccessor?n.accessorName:n.fieldName;const a=isIdentifier(o)?0:-1;const s=a+getRenameLocation(r,i,o.text,isParameter(n.declaration));return{renameFilename:i,renameLocation:s,edits:r}},getAvailableActions(e){if(!e.endPosition)return d;const t=id.getAccessorConvertiblePropertyAtPosition(e.file,e.program,e.startPosition,e.endPosition,e.triggerReason==="invoked");if(!t)return d;if(!isRefactorErrorInfo(t)){return[{name:Nl,description:kl,actions:[Fl]}]}if(e.preferences.provideRefactorNotApplicableReason){return[{name:Nl,description:kl,actions:[{...Fl,notApplicableReason:t.error}]}]}return d}});var Pl={};var Dl="Infer function return type";var Il=getLocaleSpecificMessage(wt.Infer_function_return_type);var Al={name:Dl,description:Il,kind:"refactor.rewrite.function.returnType"};registerRefactor(Dl,{kinds:[Al.kind],getEditsForAction:getRefactorEditsToInferReturnType,getAvailableActions:getRefactorActionsToInferReturnType});function getRefactorEditsToInferReturnType(e){const t=getInfo4(e);if(t&&!isRefactorErrorInfo(t)){const n=dm.ChangeTracker.with(e,(n=>doChange7(e.file,n,t.declaration,t.returnTypeNode)));return{renameFilename:void 0,renameLocation:void 0,edits:n}}return void 0}function getRefactorActionsToInferReturnType(e){const t=getInfo4(e);if(!t)return d;if(!isRefactorErrorInfo(t)){return[{name:Dl,description:Il,actions:[Al]}]}if(e.preferences.provideRefactorNotApplicableReason){return[{name:Dl,description:Il,actions:[{...Al,notApplicableReason:t.error}]}]}return d}function doChange7(e,t,n,r){const i=findChildOfKind(n,22,e);const o=isArrowFunction(n)&&i===void 0;const a=o?first(n.parameters):i;if(a){if(o){t.insertNodeBefore(e,a,zr.createToken(21));t.insertNodeAfter(e,a,zr.createToken(22))}t.insertNodeAt(e,a.end,r,{prefix:": "})}}function getInfo4(e){if(isInJSFile(e.file)||!refactorKindBeginsWith(Al.kind,e.kind))return;const t=getTouchingPropertyName(e.file,e.startPosition);const n=findAncestor(t,(e=>isBlock(e)||e.parent&&isArrowFunction(e.parent)&&(e.kind===39||e.parent.body===e)?"quit":isConvertibleDeclaration(e)));if(!n||!n.body||n.type){return{error:getLocaleSpecificMessage(wt.Return_type_must_be_inferred_from_a_function)}}const r=e.program.getTypeChecker();let i;if(r.isImplementationOfOverload(n)){const e=r.getTypeAtLocation(n).getCallSignatures();if(e.length>1){i=r.getUnionType(mapDefined(e,(e=>e.getReturnType())))}}if(!i){const e=r.getSignatureFromDeclaration(n);if(e){const t=r.getTypePredicateOfSignature(e);if(t&&t.type){const e=r.typePredicateToTypePredicateNode(t,n,1,8);if(e){return{declaration:n,returnTypeNode:e}}}else{i=r.getReturnTypeOfSignature(e)}}}if(!i){return{error:getLocaleSpecificMessage(wt.Could_not_determine_function_return_type)}}const o=r.typeToTypeNode(i,n,1,8);if(o){return{declaration:n,returnTypeNode:o}}}function isConvertibleDeclaration(e){switch(e.kind){case 262:case 218:case 219:case 174:return true;default:return false}}var Ol=(e=>{e[e["typeOffset"]=8]="typeOffset";e[e["modifierMask"]=255]="modifierMask";return e})(Ol||{});var wl=(e=>{e[e["class"]=0]="class";e[e["enum"]=1]="enum";e[e["interface"]=2]="interface";e[e["namespace"]=3]="namespace";e[e["typeParameter"]=4]="typeParameter";e[e["type"]=5]="type";e[e["parameter"]=6]="parameter";e[e["variable"]=7]="variable";e[e["enumMember"]=8]="enumMember";e[e["property"]=9]="property";e[e["function"]=10]="function";e[e["member"]=11]="member";return e})(wl||{});var Ll=(e=>{e[e["declaration"]=0]="declaration";e[e["static"]=1]="static";e[e["async"]=2]="async";e[e["readonly"]=3]="readonly";e[e["defaultLibrary"]=4]="defaultLibrary";e[e["local"]=5]="local";return e})(Ll||{});function getSemanticClassifications2(e,t,n,r){const i=getEncodedSemanticClassifications2(e,t,n,r);S.assert(i.spans.length%3===0);const o=i.spans;const a=[];for(let e=0;e{i.push(e.getStart(t),e.getWidth(t),(n+1<<8)+r)};if(e&&t){collectTokens(e,t,n,collector,r)}return i}function collectTokens(e,t,n,r,i){const o=e.getTypeChecker();let a=false;function visit(s){switch(s.kind){case 267:case 263:case 264:case 262:case 231:case 218:case 219:i.throwIfCancellationRequested()}if(!s||!textSpanIntersectsWith(n,s.pos,s.getFullWidth())||s.getFullWidth()===0){return}const c=a;if(isJsxElement(s)||isJsxSelfClosingElement(s)){a=true}if(isJsxExpression(s)){a=false}if(isIdentifier(s)&&!a&&!inImportClause(s)&&!isInfinityOrNaNString(s.escapedText)){let n=o.getSymbolAtLocation(s);if(n){if(n.flags&2097152){n=o.getAliasedSymbol(n)}let i=classifySymbol2(n,getMeaningFromLocation(s));if(i!==void 0){let a=0;if(s.parent){const e=isBindingElement(s.parent)||Ml.get(s.parent.kind)===i;if(e&&s.parent.name===s){a=1<<0}}if(i===6&&isRightSideOfQualifiedNameOrPropertyAccess2(s)){i=9}i=reclassifyByType(o,s,i);const c=n.valueDeclaration;if(c){const r=getCombinedModifierFlags(c);const o=getCombinedNodeFlags(c);if(r&256){a|=1<<1}if(r&1024){a|=1<<2}if(i!==0&&i!==2){if(r&8||o&2||n.getFlags()&8){a|=1<<3}}if((i===7||i===10)&&isLocalDeclaration(c,t)){a|=1<<5}if(e.isSourceFileDefaultLibrary(c.getSourceFile())){a|=1<<4}}else if(n.declarations&&n.declarations.some((t=>e.isSourceFileDefaultLibrary(t.getSourceFile())))){a|=1<<4}r(s,i,a)}}}forEachChild(s,visit);a=c}visit(t)}function classifySymbol2(e,t){const n=e.getFlags();if(n&32){return 0}else if(n&384){return 1}else if(n&524288){return 5}else if(n&64){if(t&2){return 2}}else if(n&262144){return 4}let r=e.valueDeclaration||e.declarations&&e.declarations[0];if(r&&isBindingElement(r)){r=getDeclarationForBindingElement(r)}return r&&Ml.get(r.kind)}function reclassifyByType(e,t,n){if(n===7||n===9||n===6){const r=e.getTypeAtLocation(t);if(r){const test=e=>e(r)||r.isUnion()&&r.types.some(e);if(n!==6&&test((e=>e.getConstructSignatures().length>0))){return 0}if(test((e=>e.getCallSignatures().length>0))&&!test((e=>e.getProperties().length>0))||isExpressionInCallExpression(t)){return n===9?11:10}}}return n}function isLocalDeclaration(e,t){if(isBindingElement(e)){e=getDeclarationForBindingElement(e)}if(isVariableDeclaration(e)){return(!isSourceFile(e.parent.parent.parent)||isCatchClause(e.parent))&&e.getSourceFile()===t}else if(isFunctionDeclaration(e)){return!isSourceFile(e.parent)&&e.getSourceFile()===t}return false}function getDeclarationForBindingElement(e){while(true){if(isBindingElement(e.parent.parent)){e=e.parent.parent}else{return e.parent.parent}}}function inImportClause(e){const t=e.parent;return t&&(isImportClause(t)||isImportSpecifier(t)||isNamespaceImport(t))}function isExpressionInCallExpression(e){while(isRightSideOfQualifiedNameOrPropertyAccess2(e)){e=e.parent}return isCallExpression(e.parent)&&e.parent.expression===e}function isRightSideOfQualifiedNameOrPropertyAccess2(e){return isQualifiedName(e.parent)&&e.parent.right===e||isPropertyAccessExpression(e.parent)&&e.parent.name===e}var Ml=new Map([[260,7],[169,6],[172,9],[267,3],[266,1],[306,8],[263,0],[174,11],[262,10],[218,10],[173,11],[177,9],[178,9],[171,9],[264,2],[265,5],[168,4],[303,9],[304,9]]);var Rl="0.8";function createNode(e,t,n,r){const i=isNodeKind(e)?new Bl(e,t,n):e===80?new Ul(80,t,n):e===81?new zl(81,t,n):new Wl(e,t,n);i.parent=r;i.flags=r.flags&101441536;return i}var Bl=class{constructor(e,t,n){this.pos=t;this.end=n;this.kind=e;this.id=0;this.flags=0;this.modifierFlagsCache=0;this.transformFlags=0;this.parent=void 0;this.original=void 0;this.emitNode=void 0}assertHasRealPosition(e){S.assert(!positionIsSynthesized(this.pos)&&!positionIsSynthesized(this.end),e||"Node must have a real position for this operation")}getSourceFile(){return getSourceFileOfNode(this)}getStart(e,t){this.assertHasRealPosition();return getTokenPosOfNode(this,e,t)}getFullStart(){this.assertHasRealPosition();return this.pos}getEnd(){this.assertHasRealPosition();return this.end}getWidth(e){this.assertHasRealPosition();return this.getEnd()-this.getStart(e)}getFullWidth(){this.assertHasRealPosition();return this.end-this.pos}getLeadingTriviaWidth(e){this.assertHasRealPosition();return this.getStart(e)-this.pos}getFullText(e){this.assertHasRealPosition();return(e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){this.assertHasRealPosition();if(!e){e=this.getSourceFile()}return e.text.substring(this.getStart(e),this.getEnd())}getChildCount(e){return this.getChildren(e).length}getChildAt(e,t){return this.getChildren(t)[e]}getChildren(e=getSourceFileOfNode(this)){this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine");return getNodeChildren(this,e)??setNodeChildren(this,e,createChildren(this,e))}getFirstToken(e){this.assertHasRealPosition();const t=this.getChildren(e);if(!t.length){return void 0}const n=find(t,(e=>e.kind<309||e.kind>351));return n.kind<166?n:n.getFirstToken(e)}getLastToken(e){this.assertHasRealPosition();const t=this.getChildren(e);const n=lastOrUndefined(t);if(!n){return void 0}return n.kind<166?n:n.getLastToken(e)}forEachChild(e,t){return forEachChild(this,e,t)}};function createChildren(e,t){const n=[];if(isJSDocCommentContainingNode(e)){e.forEachChild((e=>{n.push(e)}));return n}Gs.setText((t||e.getSourceFile()).text);let r=e.pos;const processNode=t=>{addSyntheticNodes(n,r,t.pos,e);n.push(t);r=t.end};const processNodes=t=>{addSyntheticNodes(n,r,t.pos,e);n.push(createSyntaxList(t,e));r=t.end};forEach(e.jsDoc,processNode);r=e.pos;e.forEachChild(processNode,processNodes);addSyntheticNodes(n,r,e.end,e);Gs.setText(void 0);return n}function addSyntheticNodes(e,t,n,r){Gs.resetTokenState(t);while(te.tagName.text==="inheritDoc"||e.tagName.text==="inheritdoc"))}function getJsDocTagsOfDeclarations(e,t){if(!e)return d;let n=Gf.getJsDocTagsFromDeclarations(e,t);if(t&&(n.length===0||e.some(hasJSDocInheritDocTag))){const r=new Set;for(const i of e){const e=findBaseOfDeclaration(t,i,(e=>{var n;if(!r.has(e)){r.add(e);if(i.kind===177||i.kind===178){return e.getContextualJsDocTags(i,t)}return((n=e.declarations)==null?void 0:n.length)===1?e.getJsDocTags(t):void 0}}));if(e){n=[...e,...n]}}}return n}function getDocumentationComment(e,t){if(!e)return d;let n=Gf.getJsDocCommentsFromDeclarations(e,t);if(t&&(n.length===0||e.some(hasJSDocInheritDocTag))){const r=new Set;for(const i of e){const e=findBaseOfDeclaration(t,i,(e=>{if(!r.has(e)){r.add(e);if(i.kind===177||i.kind===178){return e.getContextualDocumentationComment(i,t)}return e.getDocumentationComment(t)}}));if(e)n=n.length===0?e.slice():e.concat(lineBreakPart(),n)}}return n}function findBaseOfDeclaration(e,t,n){var r;const i=((r=t.parent)==null?void 0:r.kind)===176?t.parent.parent:t.parent;if(!i)return;const o=hasStaticModifier(t);return firstDefined(getAllSuperTypeNodes(i),(r=>{const i=e.getTypeAtLocation(r);const a=o&&i.symbol?e.getTypeOfSymbol(i.symbol):i;const s=e.getPropertyOfType(a,t.symbol.name);return s?n(s):void 0}))}var Hl=class extends Bl{constructor(e,t,n){super(e,t,n)}update(e,t){return updateSourceFile(this,e,t)}getLineAndCharacterOfPosition(e){return getLineAndCharacterOfPosition(this,e)}getLineStarts(){return getLineStarts(this)}getPositionOfLineAndCharacter(e,t,n){return computePositionOfLineAndCharacter(getLineStarts(this),e,t,this.text,n)}getLineEndOfPosition(e){const{line:t}=this.getLineAndCharacterOfPosition(e);const n=this.getLineStarts();let r;if(t+1>=n.length){r=this.getEnd()}if(!r){r=n[t+1]-1}const i=this.getFullText();return i[r]==="\n"&&i[r-1]==="\r"?r-1:r}getNamedDeclarations(){if(!this.namedDeclarations){this.namedDeclarations=this.computeNamedDeclarations()}return this.namedDeclarations}computeNamedDeclarations(){const e=createMultiMap();this.forEachChild(visit);return e;function addDeclaration(t){const n=getDeclarationName(t);if(n){e.add(n,t)}}function getDeclarations(t){let n=e.get(t);if(!n){e.set(t,n=[])}return n}function getDeclarationName(e){const t=getNonAssignedNameOfDeclaration(e);return t&&(isComputedPropertyName(t)&&isPropertyAccessExpression(t.expression)?t.expression.name.text:isPropertyName(t)?getNameFromPropertyName(t):void 0)}function visit(e){switch(e.kind){case 262:case 218:case 174:case 173:const t=e;const n=getDeclarationName(t);if(n){const e=getDeclarations(n);const r=lastOrUndefined(e);if(r&&t.parent===r.parent&&t.symbol===r.symbol){if(t.body&&!r.body){e[e.length-1]=t}}else{e.push(t)}}forEachChild(e,visit);break;case 263:case 231:case 264:case 265:case 266:case 267:case 271:case 281:case 276:case 273:case 274:case 177:case 178:case 187:addDeclaration(e);forEachChild(e,visit);break;case 169:if(!hasSyntacticModifier(e,31)){break}case 260:case 208:{const t=e;if(isBindingPattern(t.name)){forEachChild(t.name,visit);break}if(t.initializer){visit(t.initializer)}}case 306:case 172:case 171:addDeclaration(e);break;case 278:const r=e;if(r.exportClause){if(isNamedExports(r.exportClause)){forEach(r.exportClause.elements,visit)}else{visit(r.exportClause.name)}}break;case 272:const i=e.importClause;if(i){if(i.name){addDeclaration(i.name)}if(i.namedBindings){if(i.namedBindings.kind===274){addDeclaration(i.namedBindings)}else{forEach(i.namedBindings.elements,visit)}}}break;case 226:if(getAssignmentDeclarationKind(e)!==0){addDeclaration(e)}default:forEachChild(e,visit)}}}};var Gl=class{constructor(e,t,n){this.fileName=e;this.text=t;this.skipTrivia=n||(e=>e)}getLineAndCharacterOfPosition(e){return getLineAndCharacterOfPosition(this,e)}};function getServicesObjectAllocator(){return{getNodeConstructor:()=>Bl,getTokenConstructor:()=>Wl,getIdentifierConstructor:()=>Ul,getPrivateIdentifierConstructor:()=>zl,getSourceFileConstructor:()=>Hl,getSymbolConstructor:()=>Jl,getTypeConstructor:()=>Vl,getSignatureConstructor:()=>ql,getSourceMapSourceConstructor:()=>Gl}}function toEditorSettings(e){let t=true;for(const n in e){if(hasProperty(e,n)&&!isCamelCase(n)){t=false;break}}if(t){return e}const n={};for(const t in e){if(hasProperty(e,t)){const r=isCamelCase(t)?t:t.charAt(0).toLowerCase()+t.substr(1);n[r]=e[t]}}return n}function isCamelCase(e){return!e.length||e.charAt(0)===e.charAt(0).toLowerCase()}function displayPartsToString(e){if(e){return map(e,(e=>e.text)).join("")}return""}function getDefaultCompilerOptions2(){return{target:1,jsx:1}}function getSupportedCodeFixes(){return id.getSupportedErrorCodes()}var Kl=class{constructor(e){this.host=e}getCurrentSourceFile(e){var t,n,r,i,o,a,s,c;const l=this.host.getScriptSnapshot(e);if(!l){throw new Error("Could not find file: '"+e+"'.")}const d=getScriptKind(e,this.host);const p=this.host.getScriptVersion(e);let u;if(this.currentFileName!==e){const f={languageVersion:99,impliedNodeFormat:getImpliedNodeFormatForFile(toPath(e,this.host.getCurrentDirectory(),((r=(n=(t=this.host).getCompilerHost)==null?void 0:n.call(t))==null?void 0:r.getCanonicalFileName)||hostGetCanonicalFileName(this.host)),(c=(s=(a=(o=(i=this.host).getCompilerHost)==null?void 0:o.call(i))==null?void 0:a.getModuleResolutionCache)==null?void 0:s.call(a))==null?void 0:c.getPackageJsonInfoCache(),this.host,this.host.getCompilationSettings()),setExternalModuleIndicator:getSetExternalModuleIndicator(this.host.getCompilationSettings()),jsDocParsingMode:0};u=createLanguageServiceSourceFile(e,l,f,p,true,d)}else if(this.currentFileVersion!==p){const e=l.getChangeRange(this.currentFileScriptSnapshot);u=updateLanguageServiceSourceFile(this.currentSourceFile,l,p,e)}if(u){this.currentFileVersion=p;this.currentFileName=e;this.currentFileScriptSnapshot=l;this.currentSourceFile=u}return this.currentSourceFile}};function setSourceFileFields(e,t,n){e.version=n;e.scriptSnapshot=t}function createLanguageServiceSourceFile(e,t,n,r,i,o){const a=createSourceFile(e,getSnapshotText(t),n,i,o);setSourceFileFields(a,t,r);return a}function updateLanguageServiceSourceFile(e,t,n,r,i){if(r){if(n!==e.version){let o;const a=r.span.start!==0?e.text.substr(0,r.span.start):"";const s=textSpanEnd(r.span)!==e.text.length?e.text.substr(textSpanEnd(r.span)):"";if(r.newLength===0){o=a&&s?a+s:a||s}else{const e=t.getText(r.span.start,r.span.start+r.newLength);o=a&&s?a+e+s:a?a+e:e+s}const c=updateSourceFile(e,o,r,i);setSourceFileFields(c,t,n);c.nameTable=void 0;if(e!==c&&e.scriptSnapshot){if(e.scriptSnapshot.dispose){e.scriptSnapshot.dispose()}e.scriptSnapshot=void 0}return c}}const o={languageVersion:e.languageVersion,impliedNodeFormat:e.impliedNodeFormat,setExternalModuleIndicator:e.setExternalModuleIndicator,jsDocParsingMode:e.jsDocParsingMode};return createLanguageServiceSourceFile(e.fileName,t,o,n,true,e.scriptKind)}var $l={isCancellationRequested:returnFalse,throwIfCancellationRequested:noop};var Ql=class{constructor(e){this.cancellationToken=e}isCancellationRequested(){return this.cancellationToken.isCancellationRequested()}throwIfCancellationRequested(){var e;if(this.isCancellationRequested()){(e=G)==null?void 0:e.instant(G.Phase.Session,"cancellationThrown",{kind:"CancellationTokenObject"});throw new ce}}};var Xl=class{constructor(e,t=20){this.hostCancellationToken=e;this.throttleWaitMilliseconds=t;this.lastCancellationCheckTime=0}isCancellationRequested(){const e=R();const t=Math.abs(e-this.lastCancellationCheckTime);if(t>=this.throttleWaitMilliseconds){this.lastCancellationCheckTime=e;return this.hostCancellationToken.isCancellationRequested()}return false}throwIfCancellationRequested(){var e;if(this.isCancellationRequested()){(e=G)==null?void 0:e.instant(G.Phase.Session,"cancellationThrown",{kind:"ThrottledCancellationToken"});throw new ce}}};var Yl=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints","getSupportedCodeFixes","getPasteEdits"];var Zl=[...Yl,"getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors","preparePasteEditsForFile"];function createLanguageService(e,t=createDocumentRegistry(e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames(),e.getCurrentDirectory(),e.jsDocParsingMode),n){var r;let i;if(n===void 0){i=0}else if(typeof n==="boolean"){i=n?2:0}else{i=n}const o=new Kl(e);let a;let s;let c=0;const l=e.getCancellationToken?new Ql(e.getCancellationToken()):$l;const p=e.getCurrentDirectory();maybeSetLocalizedDiagnosticMessages((r=e.getLocalizedDiagnosticMessages)==null?void 0:r.bind(e));function log(t){if(e.log){e.log(t)}}const u=hostUsesCaseSensitiveFileNames(e);const f=createGetCanonicalFileName(u);const m=getSourceMapper({useCaseSensitiveFileNames:()=>u,getCurrentDirectory:()=>p,getProgram:getProgram,fileExists:maybeBind(e,e.fileExists),readFile:maybeBind(e,e.readFile),getDocumentPositionMapper:maybeBind(e,e.getDocumentPositionMapper),getSourceFileLike:maybeBind(e,e.getSourceFileLike),log:log});function getValidSourceFile(e){const t=a.getSourceFile(e);if(!t){const t=new Error(`Could not find source file: '${e}'.`);t.ProgramFiles=a.getSourceFiles().map((e=>e.fileName));throw t}return t}function synchronizeHostData(){if(e.updateFromProject&&!e.updateFromProjectInProgress){e.updateFromProject()}else{synchronizeHostDataWorker()}}function synchronizeHostDataWorker(){var n,r,o;S.assert(i!==2);if(e.getProjectVersion){const t=e.getProjectVersion();if(t){if(s===t&&!((n=e.hasChangedAutomaticTypeDirectiveNames)==null?void 0:n.call(e))){return}s=t}}const d=e.getTypeRootsVersion?e.getTypeRootsVersion():0;if(c!==d){log("TypeRoots version has changed; provide new program");a=void 0;c=d}const _=e.getScriptFileNames().slice();const g=e.getCompilationSettings()||getDefaultCompilerOptions2();const y=e.hasInvalidatedResolutions||returnFalse;const h=maybeBind(e,e.hasInvalidatedLibResolutions)||returnFalse;const T=maybeBind(e,e.hasChangedAutomaticTypeDirectiveNames);const v=(r=e.getProjectReferences)==null?void 0:r.call(e);let x;let b={getSourceFile:getOrCreateSourceFile,getSourceFileByPath:getOrCreateSourceFileByPath,getCancellationToken:()=>l,getCanonicalFileName:f,useCaseSensitiveFileNames:()=>u,getNewLine:()=>getNewLineCharacter(g),getDefaultLibFileName:t=>e.getDefaultLibFileName(t),writeFile:noop,getCurrentDirectory:()=>p,fileExists:t=>e.fileExists(t),readFile:t=>e.readFile&&e.readFile(t),getSymlinkCache:maybeBind(e,e.getSymlinkCache),realpath:maybeBind(e,e.realpath),directoryExists:t=>directoryProbablyExists(t,e),getDirectories:t=>e.getDirectories?e.getDirectories(t):[],readDirectory:(t,n,r,i,o)=>{S.checkDefined(e.readDirectory,"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'");return e.readDirectory(t,n,r,i,o)},onReleaseOldSourceFile:onReleaseOldSourceFile,onReleaseParsedCommandLine:onReleaseParsedCommandLine,hasInvalidatedResolutions:y,hasInvalidatedLibResolutions:h,hasChangedAutomaticTypeDirectiveNames:T,trace:maybeBind(e,e.trace),resolveModuleNames:maybeBind(e,e.resolveModuleNames),getModuleResolutionCache:maybeBind(e,e.getModuleResolutionCache),createHash:maybeBind(e,e.createHash),resolveTypeReferenceDirectives:maybeBind(e,e.resolveTypeReferenceDirectives),resolveModuleNameLiterals:maybeBind(e,e.resolveModuleNameLiterals),resolveTypeReferenceDirectiveReferences:maybeBind(e,e.resolveTypeReferenceDirectiveReferences),resolveLibrary:maybeBind(e,e.resolveLibrary),useSourceOfProjectReferenceRedirect:maybeBind(e,e.useSourceOfProjectReferenceRedirect),getParsedCommandLine:getParsedCommandLine,jsDocParsingMode:e.jsDocParsingMode,getGlobalTypingsCacheLocation:maybeBind(e,e.getGlobalTypingsCacheLocation)};const C=b.getSourceFile;const{getSourceFileWithCache:E}=changeCompilerHostLikeToUseCache(b,(e=>toPath(e,p,f)),((...e)=>C.call(b,...e)));b.getSourceFile=E;(o=e.setCompilerHost)==null?void 0:o.call(e,b);const N={useCaseSensitiveFileNames:u,fileExists:e=>b.fileExists(e),readFile:e=>b.readFile(e),directoryExists:e=>b.directoryExists(e),getDirectories:e=>b.getDirectories(e),realpath:b.realpath,readDirectory:(...e)=>b.readDirectory(...e),trace:b.trace,getCurrentDirectory:b.getCurrentDirectory,onUnRecoverableConfigFileDiagnostic:noop};const k=t.getKeyForCompilationSettings(g);let F=new Set;if(isProgramUptoDate(a,_,g,((t,n)=>e.getScriptVersion(n)),(e=>b.fileExists(e)),y,h,T,getParsedCommandLine,v)){b=void 0;x=void 0;F=void 0;return}const P={rootNames:_,options:g,host:b,oldProgram:a,projectReferences:v};a=createProgram(P);b=void 0;x=void 0;F=void 0;m.clearCache();a.getTypeChecker();return;function getParsedCommandLine(t){const n=toPath(t,p,f);const r=x==null?void 0:x.get(n);if(r!==void 0)return r||void 0;const i=e.getParsedCommandLine?e.getParsedCommandLine(t):getParsedCommandLineOfConfigFileUsingSourceFile(t);(x||(x=new Map)).set(n,i||false);return i}function getParsedCommandLineOfConfigFileUsingSourceFile(e){const t=getOrCreateSourceFile(e,100);if(!t)return void 0;t.path=toPath(e,p,f);t.resolvedPath=t.path;t.originalFileName=t.fileName;return parseJsonSourceFileConfigFileContent(t,N,getNormalizedAbsolutePath(getDirectoryPath(e),p),void 0,getNormalizedAbsolutePath(e,p))}function onReleaseParsedCommandLine(t,n,r){var i;if(e.getParsedCommandLine){(i=e.onReleaseParsedCommandLine)==null?void 0:i.call(e,t,n,r)}else if(n){releaseOldSourceFile(n.sourceFile,r)}}function releaseOldSourceFile(e,n){const r=t.getKeyForCompilationSettings(n);t.releaseDocumentWithKey(e.resolvedPath,r,e.scriptKind,e.impliedNodeFormat)}function onReleaseOldSourceFile(t,n,r,i){var o;releaseOldSourceFile(t,n);(o=e.onReleaseOldSourceFile)==null?void 0:o.call(e,t,n,r,i)}function getOrCreateSourceFile(e,t,n,r){return getOrCreateSourceFileByPath(e,toPath(e,p,f),t,n,r)}function getOrCreateSourceFileByPath(n,r,i,o,s){S.assert(b,"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");const c=e.getScriptSnapshot(n);if(!c){return void 0}const l=getScriptKind(n,e);const d=e.getScriptVersion(n);if(!s){const o=a&&a.getSourceFileByPath(r);if(o){if(l===o.scriptKind||F.has(o.resolvedPath)){return t.updateDocumentWithKey(n,r,e,k,c,d,l,i)}else{t.releaseDocumentWithKey(o.resolvedPath,t.getKeyForCompilationSettings(a.getCompilerOptions()),o.scriptKind,o.impliedNodeFormat);F.add(o.resolvedPath)}}}return t.acquireDocumentWithKey(n,r,e,k,c,d,l,i)}}function getProgram(){if(i===2){S.assert(a===void 0);return void 0}synchronizeHostData();return a}function getAutoImportProvider(){var t;return(t=e.getPackageJsonAutoImportProvider)==null?void 0:t.call(e)}function updateIsDefinitionOfReferencedSymbols(t,n){const r=a.getTypeChecker();const i=getSymbolForProgram();if(!i)return false;for(const r of t){for(const t of r.references){const r=getNodeForSpan(t);S.assertIsDefined(r);if(n.has(t)||Rf.isDeclarationOfSymbol(r,i)){n.add(t);t.isDefinition=true;const r=getMappedDocumentSpan(t,m,maybeBind(e,e.fileExists));if(r){n.add(r)}}else{t.isDefinition=false}}}return true;function getSymbolForProgram(){for(const i of t){for(const t of i.references){if(n.has(t)){const e=getNodeForSpan(t);S.assertIsDefined(e);return r.getSymbolAtLocation(e)}const i=getMappedDocumentSpan(t,m,maybeBind(e,e.fileExists));if(i&&n.has(i)){const e=getNodeForSpan(i);if(e){return r.getSymbolAtLocation(e)}}}}return void 0}function getNodeForSpan(e){const t=a.getSourceFile(e.fileName);if(!t)return void 0;const n=getTouchingPropertyName(t,e.textSpan.start);const r=Rf.Core.getAdjustedNode(n,{use:Rf.FindReferencesUse.References});return r}}function cleanupSemanticCache(){if(a){const e=t.getKeyForCompilationSettings(a.getCompilerOptions());forEach(a.getSourceFiles(),(n=>t.releaseDocumentWithKey(n.resolvedPath,e,n.scriptKind,n.impliedNodeFormat)));a=void 0}}function dispose(){cleanupSemanticCache();e=void 0}function getSyntacticDiagnostics(e){synchronizeHostData();return a.getSyntacticDiagnostics(getValidSourceFile(e),l).slice()}function getSemanticDiagnostics(e){synchronizeHostData();const t=getValidSourceFile(e);const n=a.getSemanticDiagnostics(t,l);if(!Zn(a.getCompilerOptions())){return n.slice()}const r=a.getDeclarationDiagnostics(t,l);return[...n,...r]}function getRegionSemanticDiagnostics(e,t){synchronizeHostData();const n=getValidSourceFile(e);const r=a.getCompilerOptions();if(skipTypeChecking(n,r,a)||!canIncludeBindAndCheckDiagnostics(n,r)||a.getCachedSemanticDiagnostics(n)){return void 0}const i=getNodesForRanges(n,t);if(!i){return void 0}const o=normalizeSpans(i.map((e=>createTextSpanFromBounds(e.getFullStart(),e.getEnd()))));const s=a.getSemanticDiagnostics(n,l,i);return{diagnostics:s.slice(),spans:o}}function getNodesForRanges(e,t){const n=[];const r=normalizeSpans(t.map((e=>createTextSpanFromRange(e))));for(const t of r){const r=getNodesForSpan(e,t);if(!r){return void 0}n.push(...r)}if(!n.length){return void 0}return n}function getNodesForSpan(e,t){if(textSpanContainsTextRange(t,e)){return void 0}const n=findTokenOnLeftOfPosition(e,textSpanEnd(t))||e;const r=findAncestor(n,(e=>textRangeContainsTextSpan(e,t)));const i=[];chooseOverlappingNodes(t,r,i);if(e.end===t.start+t.length){i.push(e.endOfFileToken)}if(some(i,isSourceFile)){return void 0}return i}function chooseOverlappingNodes(e,t,n){if(!nodeOverlapsWithSpan(t,e)){return false}if(textSpanContainsTextRange(e,t)){addSourceElement(t,n);return true}if(isBlockLike(t)){return chooseOverlappingBlockLike(e,t,n)}if(isClassLike(t)){return chooseOverlappingClassLike(e,t,n)}addSourceElement(t,n);return true}function nodeOverlapsWithSpan(e,t){const n=t.start+t.length;return e.post.start}function addSourceElement(e,t){while(e.parent&&!isSourceElement(e)){e=e.parent}t.push(e)}function chooseOverlappingBlockLike(e,t,n){const r=[];const i=t.statements.filter((t=>chooseOverlappingNodes(e,t,r)));if(i.length===t.statements.length){addSourceElement(t,n);return true}n.push(...r);return false}function chooseOverlappingClassLike(e,t,n){var r,i,o;const overlaps=t=>textRangeIntersectsWithTextSpan(t,e);if(((r=t.modifiers)==null?void 0:r.some(overlaps))||t.name&&overlaps(t.name)||((i=t.typeParameters)==null?void 0:i.some(overlaps))||((o=t.heritageClauses)==null?void 0:o.some(overlaps))){addSourceElement(t,n);return true}const a=[];const s=t.members.filter((t=>chooseOverlappingNodes(e,t,a)));if(s.length===t.members.length){addSourceElement(t,n);return true}n.push(...a);return false}function getSuggestionDiagnostics(e){synchronizeHostData();return computeSuggestionDiagnostics(getValidSourceFile(e),a,l)}function getCompilerOptionsDiagnostics(){synchronizeHostData();return[...a.getOptionsDiagnostics(l),...a.getGlobalDiagnostics(l)]}function getCompletionsAtPosition2(t,n,r=Fs,i){const o={...identity(r),includeCompletionsForModuleExports:r.includeCompletionsForModuleExports||r.includeExternalModuleExports,includeCompletionsWithInsertText:r.includeCompletionsWithInsertText||r.includeInsertTextCompletions};synchronizeHostData();return xf.getCompletionsAtPosition(e,a,log,getValidSourceFile(t),n,o,r.triggerCharacter,r.triggerKind,l,i&&hm.getFormatContext(i,e),r.includeSymbol)}function getCompletionEntryDetails2(t,n,r,i,o,s=Fs,c){synchronizeHostData();return xf.getCompletionEntryDetails(a,log,getValidSourceFile(t),n,{name:r,source:o,data:c},e,i&&hm.getFormatContext(i,e),s,l)}function getCompletionEntrySymbol2(t,n,r,i,o=Fs){synchronizeHostData();return xf.getCompletionEntrySymbol(a,log,getValidSourceFile(t),n,{name:r,source:i},e,o)}function getQuickInfoAtPosition(e,t){synchronizeHostData();const n=getValidSourceFile(e);const r=getTouchingPropertyName(n,t);if(r===n){return void 0}const i=a.getTypeChecker();const o=getNodeForQuickInfo(r);const s=getSymbolAtLocationForQuickInfo(o,i);if(!s||i.isUnknownSymbol(s)){const e=shouldGetType(n,o,t)?i.getTypeAtLocation(o):void 0;return e&&{kind:"",kindModifiers:"",textSpan:createTextSpanFromNode(o,n),displayParts:i.runWithCancellationToken(l,(t=>typeToDisplayParts(t,e,getContainerNode(o)))),documentation:e.symbol?e.symbol.getDocumentationComment(i):void 0,tags:e.symbol?e.symbol.getJsDocTags(i):void 0}}const{symbolKind:c,displayParts:d,documentation:p,tags:u}=i.runWithCancellationToken(l,(e=>cm.getSymbolDisplayPartsDocumentationAndSymbolKind(e,s,n,getContainerNode(o),o)));return{kind:c,kindModifiers:cm.getSymbolModifiers(i,s),textSpan:createTextSpanFromNode(o,n),displayParts:d,documentation:p,tags:u}}function preparePasteEditsForFile(e,t){synchronizeHostData();return Lm.preparePasteEdits(getValidSourceFile(e),t,a.getTypeChecker())}function getPasteEdits(t,n){synchronizeHostData();return Mm.pasteEditsProvider(getValidSourceFile(t.targetFile),t.pastedText,t.pasteLocations,t.copiedFrom?{file:getValidSourceFile(t.copiedFrom.file),range:t.copiedFrom.range}:void 0,e,t.preferences,hm.getFormatContext(n,e),l)}function getNodeForQuickInfo(e){if(isNewExpression(e.parent)&&e.pos===e.parent.pos){return e.parent.expression}if(isNamedTupleMember(e.parent)&&e.pos===e.parent.pos){return e.parent}if(isImportMeta(e.parent)&&e.parent.name===e){return e.parent}if(isJsxNamespacedName(e.parent)){return e.parent}return e}function shouldGetType(e,t,n){switch(t.kind){case 80:if(t.flags&16777216&&!isInJSFile(t)&&(t.parent.kind===171&&t.parent.name===t||findAncestor(t,(e=>e.kind===169)))){return false}return!isLabelName(t)&&!isTagName(t)&&!isConstTypeReference(t.parent);case 211:case 166:return!isInComment(e,n);case 110:case 197:case 108:case 202:return true;case 236:return isImportMeta(t);default:return false}}function getDefinitionAtPosition2(e,t,n,r){synchronizeHostData();return Vf.getDefinitionAtPosition(a,getValidSourceFile(e),t,n,r)}function getDefinitionAndBoundSpan2(e,t){synchronizeHostData();return Vf.getDefinitionAndBoundSpan(a,getValidSourceFile(e),t)}function getTypeDefinitionAtPosition2(e,t){synchronizeHostData();return Vf.getTypeDefinitionAtPosition(a.getTypeChecker(),getValidSourceFile(e),t)}function getImplementationAtPosition(e,t){synchronizeHostData();return Rf.getImplementationsAtPosition(a,l,a.getSourceFiles(),getValidSourceFile(e),t)}function getDocumentHighlights(e,t,n){const r=normalizePath(e);S.assert(n.some((e=>normalizePath(e)===r)));synchronizeHostData();const i=mapDefined(n,(e=>a.getSourceFile(e)));const o=getValidSourceFile(e);return oc.getDocumentHighlights(a,l,o,t,i)}function findRenameLocations(e,t,n,r,i){synchronizeHostData();const o=getValidSourceFile(e);const a=getAdjustedRenameLocation(getTouchingPropertyName(o,t));if(!nm.nodeIsEligibleForRename(a))return void 0;if(isIdentifier(a)&&(isJsxOpeningElement(a.parent)||isJsxClosingElement(a.parent))&&isIntrinsicJsxName(a.escapedText)){const{openingElement:e,closingElement:t}=a.parent.parent;return[e,t].map((e=>{const t=createTextSpanFromNode(e.tagName,o);return{fileName:o.fileName,textSpan:t,...Rf.toContextSpan(t,o,e.parent)}}))}else{const e=getQuotePreference(o,i??Fs);const s=typeof i==="boolean"?i:i==null?void 0:i.providePrefixAndSuffixTextForRename;return getReferencesWorker2(a,t,{findInStrings:n,findInComments:r,providePrefixAndSuffixTextForRename:s,use:Rf.FindReferencesUse.Rename},((t,n,r)=>Rf.toRenameLocation(t,n,r,s||false,e)))}}function getReferencesAtPosition(e,t){synchronizeHostData();return getReferencesWorker2(getTouchingPropertyName(getValidSourceFile(e),t),t,{use:Rf.FindReferencesUse.References},Rf.toReferenceEntry)}function getReferencesWorker2(e,t,n,r){synchronizeHostData();const i=n&&n.use===Rf.FindReferencesUse.Rename?a.getSourceFiles().filter((e=>!a.isSourceFileDefaultLibrary(e))):a.getSourceFiles();return Rf.findReferenceOrRenameEntries(a,l,i,e,t,n,r)}function findReferences(e,t){synchronizeHostData();return Rf.findReferencedSymbols(a,l,a.getSourceFiles(),getValidSourceFile(e),t)}function getFileReferences(e){synchronizeHostData();return Rf.Core.getReferencesForFileName(e,a,a.getSourceFiles()).map(Rf.toReferenceEntry)}function getNavigateToItems2(e,t,n,r=false,i=false){synchronizeHostData();const o=n?[getValidSourceFile(n)]:a.getSourceFiles();return getNavigateToItems(o,a.getTypeChecker(),l,e,t,r,i)}function getEmitOutput(t,n,r){synchronizeHostData();const i=getValidSourceFile(t);const o=e.getCustomTransformers&&e.getCustomTransformers();return getFileEmitOutput(a,i,!!n,l,o,r)}function getSignatureHelpItems2(e,t,{triggerReason:n}=Fs){synchronizeHostData();const r=getValidSourceFile(e);return rm.getSignatureHelpItems(a,r,t,n,l)}function getNonBoundSourceFile(e){return o.getCurrentSourceFile(e)}function getNameOrDottedNameSpan(e,t,n){const r=o.getCurrentSourceFile(e);const i=getTouchingPropertyName(r,t);if(i===r){return void 0}switch(i.kind){case 211:case 166:case 11:case 97:case 112:case 106:case 108:case 110:case 197:case 80:break;default:return void 0}let a=i;while(true){if(isRightSideOfPropertyAccess(a)||isRightSideOfQualifiedName(a)){a=a.parent}else if(isNameOfModuleDeclaration(a)){if(a.parent.parent.kind===267&&a.parent.parent.body===a.parent){a=a.parent.parent.name}else{break}}else{break}}return createTextSpanFromBounds(a.getStart(),i.getEnd())}function getBreakpointStatementAtPosition(e,t){const n=o.getCurrentSourceFile(e);return ed.spanInSourceFileAtLocation(n,t)}function getNavigationBarItems2(e){return getNavigationBarItems(o.getCurrentSourceFile(e),l)}function getNavigationTree2(e){return getNavigationTree(o.getCurrentSourceFile(e),l)}function getSemanticClassifications3(e,t,n){synchronizeHostData();const r=n||"original";if(r==="2020"){return getSemanticClassifications2(a,l,getValidSourceFile(e),t)}else{return getSemanticClassifications(a.getTypeChecker(),l,getValidSourceFile(e),a.getClassifiableNames(),t)}}function getEncodedSemanticClassifications3(e,t,n){synchronizeHostData();const r=n||"original";if(r==="original"){return getEncodedSemanticClassifications(a.getTypeChecker(),l,getValidSourceFile(e),a.getClassifiableNames(),t)}else{return getEncodedSemanticClassifications2(a,l,getValidSourceFile(e),t)}}function getSyntacticClassifications2(e,t){return getSyntacticClassifications(l,o.getCurrentSourceFile(e),t)}function getEncodedSyntacticClassifications2(e,t){return getEncodedSyntacticClassifications(l,o.getCurrentSourceFile(e),t)}function getOutliningSpans(e){const t=o.getCurrentSourceFile(e);return em.collectElements(t,l)}const _=new Map(Object.entries({[19]:20,[21]:22,[23]:24,[32]:30}));_.forEach(((e,t)=>_.set(e.toString(),Number(t))));function getBraceMatchingAtPosition(e,t){const n=o.getCurrentSourceFile(e);const r=getTouchingToken(n,t);const i=r.getStart(n)===t?_.get(r.kind.toString()):void 0;const a=i&&findChildOfKind(r.parent,i,n);return a?[createTextSpanFromNode(r,n),createTextSpanFromNode(a,n)].sort(((e,t)=>e.start-t.start)):d}function getIndentationAtPosition(e,t,n){let r=R();const i=toEditorSettings(n);const a=o.getCurrentSourceFile(e);log("getIndentationAtPosition: getCurrentSourceFile: "+(R()-r));r=R();const s=hm.SmartIndenter.getIndentation(t,a,i);log("getIndentationAtPosition: computeIndentation : "+(R()-r));return s}function getFormattingEditsForRange(t,n,r,i){const a=o.getCurrentSourceFile(t);return hm.formatSelection(n,r,a,hm.getFormatContext(toEditorSettings(i),e))}function getFormattingEditsForDocument(t,n){return hm.formatDocument(o.getCurrentSourceFile(t),hm.getFormatContext(toEditorSettings(n),e))}function getFormattingEditsAfterKeystroke(t,n,r,i){const a=o.getCurrentSourceFile(t);const s=hm.getFormatContext(toEditorSettings(i),e);if(!isInComment(a,n)){switch(r){case"{":return hm.formatOnOpeningCurly(n,a,s);case"}":return hm.formatOnClosingCurly(n,a,s);case";":return hm.formatOnSemicolon(n,a,s);case"\n":return hm.formatOnEnter(n,a,s)}}return[]}function getCodeFixesAtPosition(t,n,r,i,o,s=Fs){synchronizeHostData();const c=getValidSourceFile(t);const d=createTextSpanFromBounds(n,r);const p=hm.getFormatContext(o,e);return flatMap(deduplicate(i,equateValues,compareValues),(t=>{l.throwIfCancellationRequested();return id.getFixes({errorCode:t,sourceFile:c,span:d,program:a,host:e,cancellationToken:l,formatContext:p,preferences:s})}))}function getCombinedCodeFix(t,n,r,i=Fs){synchronizeHostData();S.assert(t.type==="file");const o=getValidSourceFile(t.fileName);const s=hm.getFormatContext(r,e);return id.getAllFixes({fixId:n,sourceFile:o,program:a,host:e,cancellationToken:l,formatContext:s,preferences:i})}function organizeImports2(t,n,r=Fs){synchronizeHostData();S.assert(t.type==="file");const i=getValidSourceFile(t.fileName);if(containsParseError(i))return d;const o=hm.getFormatContext(n,e);const s=t.mode??(t.skipDestructiveCodeActions?"SortAndCombine":"All");return Zf.organizeImports(i,o,e,a,r,s)}function getEditsForFileRename2(t,n,r,i=Fs){return getEditsForFileRename(getProgram(),t,n,e,hm.getFormatContext(r,e),i,m)}function applyCodeActionCommand(e,t){const n=typeof e==="string"?t:e;return isArray(n)?Promise.all(n.map((e=>applySingleCodeActionCommand(e)))):applySingleCodeActionCommand(n)}function applySingleCodeActionCommand(t){const getPath=e=>toPath(e,p,f);S.assertEqual(t.type,"install package");return e.installPackage?e.installPackage({fileName:getPath(t.file),packageName:t.packageName}):Promise.reject("Host does not implement `installPackage`")}function getDocCommentTemplateAtPosition2(t,n,r,i){const a=i?hm.getFormatContext(i,e).options:void 0;return Gf.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(e,a),o.getCurrentSourceFile(t),n,r)}function isValidBraceCompletionAtPosition(e,t,n){if(n===60){return false}const r=o.getCurrentSourceFile(e);if(isInString(r,t)){return false}if(isInsideJsxElementOrAttribute(r,t)){return n===123}if(isInTemplateString(r,t)){return false}switch(n){case 39:case 34:case 96:return!isInComment(r,t)}return true}function getJsxClosingTagAtPosition(e,t){const n=o.getCurrentSourceFile(e);const r=findPrecedingToken(t,n);if(!r)return void 0;const i=r.kind===32&&isJsxOpeningElement(r.parent)?r.parent.parent:isJsxText(r)&&isJsxElement(r.parent)?r.parent:void 0;if(i&&isUnclosedTag(i)){return{newText:``}}const a=r.kind===32&&isJsxOpeningFragment(r.parent)?r.parent.parent:isJsxText(r)&&isJsxFragment(r.parent)?r.parent:void 0;if(a&&isUnclosedFragment(a)){return{newText:""}}}function getLinkedEditingRangeAtPosition(e,t){const n=o.getCurrentSourceFile(e);const r=findPrecedingToken(t,n);if(!r||r.parent.kind===307)return void 0;const i="[a-zA-Z0-9:\\-\\._$]*";if(isJsxFragment(r.parent.parent)){const e=r.parent.parent.openingFragment;const o=r.parent.parent.closingFragment;if(containsParseError(e)||containsParseError(o))return void 0;const a=e.getStart(n)+1;const s=o.getStart(n)+2;if(t!==a&&t!==s)return void 0;return{ranges:[{start:a,length:0},{start:s,length:0}],wordPattern:i}}else{const e=findAncestor(r.parent,(e=>{if(isJsxOpeningElement(e)||isJsxClosingElement(e)){return true}return false}));if(!e)return void 0;S.assert(isJsxOpeningElement(e)||isJsxClosingElement(e),"tag should be opening or closing element");const o=e.parent.openingElement;const a=e.parent.closingElement;const s=o.tagName.getStart(n);const c=o.tagName.end;const l=a.tagName.getStart(n);const d=a.tagName.end;if(s===o.getStart(n)||l===a.getStart(n)||c===o.getEnd()||d===a.getEnd())return void 0;if(!(s<=t&&t<=c||l<=t&&t<=d))return void 0;const p=o.tagName.getText(n);if(p!==a.tagName.getText(n))return void 0;return{ranges:[{start:s,length:c-s},{start:l,length:d-l}],wordPattern:i}}}function getLinesForRange(e,t){return{lineStarts:e.getLineStarts(),firstLine:e.getLineAndCharacterOfPosition(t.pos).line,lastLine:e.getLineAndCharacterOfPosition(t.end).line}}function toggleLineComment(e,t,n){const r=o.getCurrentSourceFile(e);const i=[];const{lineStarts:a,firstLine:s,lastLine:c}=getLinesForRange(r,t);let l=n||false;let d=Number.MAX_VALUE;const p=new Map;const u=new RegExp(/\S/);const f=isInsideJsxElement(r,a[s]);const m=f?"{/*":"//";for(let e=s;e<=c;e++){const t=r.text.substring(a[e],r.getLineEndOfPosition(a[e]));const i=u.exec(t);if(i){d=Math.min(d,i.index);p.set(e.toString(),i.index);if(t.substr(i.index,m.length)!==m){l=n===void 0||n}}}for(let n=s;n<=c;n++){if(s!==c&&a[n]===t.end){continue}const o=p.get(n.toString());if(o!==void 0){if(f){i.push(...toggleMultilineComment(e,{pos:a[n]+d,end:r.getLineEndOfPosition(a[n])},l,f))}else if(l){i.push({newText:m,span:{length:0,start:a[n]+d}})}else if(r.text.substr(a[n]+o,m.length)===m){i.push({newText:"",span:{length:m.length,start:a[n]+o}})}}}return i}function toggleMultilineComment(e,t,n,r){var i;const a=o.getCurrentSourceFile(e);const s=[];const{text:c}=a;let l=false;let d=n||false;const p=[];let{pos:u}=t;const f=r!==void 0?r:isInsideJsxElement(a,u);const m=f?"{/*":"/*";const _=f?"*/}":"*/";const g=f?"\\{\\/\\*":"\\/\\*";const y=f?"\\*\\/\\}":"\\*\\/";while(u<=t.end){const e=c.substr(u,m.length)===m?m.length:0;const r=isInComment(a,u+e);if(r){if(f){r.pos--;r.end++}p.push(r.pos);if(r.kind===3){p.push(r.end)}l=true;u=r.end+1}else{const e=c.substring(u,t.end).search(`(${g})|(${y})`);d=n!==void 0?n:d||!isTextWhiteSpaceLike(c,u,e===-1?t.end:u+e);u=e===-1?t.end+1:u+e+_.length}}if(d||!l){if(((i=isInComment(a,t.pos))==null?void 0:i.kind)!==2){insertSorted(p,t.pos,compareValues)}insertSorted(p,t.end,compareValues);const e=p[0];if(c.substr(e,m.length)!==m){s.push({newText:m,span:{length:0,start:e}})}for(let e=1;e0?e-_.length:0;const n=c.substr(t,_.length)===_?_.length:0;s.push({newText:"",span:{length:m.length,start:e-n}})}}return s}function commentSelection(e,t){const n=o.getCurrentSourceFile(e);const{firstLine:r,lastLine:i}=getLinesForRange(n,t);return r===i&&t.pos!==t.end?toggleMultilineComment(e,t,true):toggleLineComment(e,t,true)}function uncommentSelection(e,t){const n=o.getCurrentSourceFile(e);const r=[];const{pos:i}=t;let{end:a}=t;if(i===a){a+=isInsideJsxElement(n,i)?2:1}for(let t=i;t<=a;t++){const i=isInComment(n,t);if(i){switch(i.kind){case 2:r.push(...toggleLineComment(e,{end:i.end,pos:i.pos+1},false));break;case 3:r.push(...toggleMultilineComment(e,{end:i.end,pos:i.pos+1},false))}t=i.end+1}}return r}function isUnclosedTag({openingElement:e,closingElement:t,parent:n}){return!tagNamesAreEquivalent(e.tagName,t.tagName)||isJsxElement(n)&&tagNamesAreEquivalent(e.tagName,n.openingElement.tagName)&&isUnclosedTag(n)}function isUnclosedFragment({closingFragment:e,parent:t}){return!!(e.flags&262144)||isJsxFragment(t)&&isUnclosedFragment(t)}function getSpanOfEnclosingComment(e,t,n){const r=o.getCurrentSourceFile(e);const i=hm.getRangeOfEnclosingComment(r,t);return i&&(!n||i.kind===3)?createTextSpanFromRange(i):void 0}function getTodoComments(e,t){synchronizeHostData();const n=getValidSourceFile(e);l.throwIfCancellationRequested();const r=n.text;const i=[];if(t.length>0&&!isNodeModulesFile(n.fileName)){const e=getTodoCommentsRegExp();let o;while(o=e.exec(r)){l.throwIfCancellationRequested();const e=3;S.assert(o.length===t.length+e);const a=o[1];const s=o.index+a.length;if(!isInComment(n,s)){continue}let c;for(let n=0;n"("+escapeRegExp(e.text)+")")).join("|")+")";const a=/(?:$|\*\/)/.source;const s=/(?:.*?)/.source;const c="("+o+s+")";const l=i+c+a;return new RegExp(l,"gim")}function isLetterOrDigit(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}function isNodeModulesFile(e){return e.includes("/node_modules/")}}function getRenameInfo2(e,t,n){synchronizeHostData();return nm.getRenameInfo(a,getValidSourceFile(e),t,n||{})}function getRefactorContext(t,n,r,i,o,a){const[s,c]=typeof n==="number"?[n,void 0]:[n.pos,n.end];return{file:t,startPosition:s,endPosition:c,program:getProgram(),host:e,formatContext:hm.getFormatContext(i,e),cancellationToken:l,preferences:r,triggerReason:o,kind:a}}function getInlayHintsContext(t,n,r){return{file:t,program:getProgram(),host:e,span:n,preferences:r,cancellationToken:l}}function getSmartSelectionRange2(e,t){return am.getSmartSelectionRange(t,o.getCurrentSourceFile(e))}function getApplicableRefactors2(e,t,n=Fs,r,i,o){synchronizeHostData();const a=getValidSourceFile(e);return Nc.getApplicableRefactors(getRefactorContext(a,t,n,Fs,r,i),o)}function getMoveToRefactoringFileSuggestions(t,n,r=Fs){synchronizeHostData();const i=getValidSourceFile(t);const o=S.checkDefined(a.getSourceFiles());const s=extensionFromPath(t);const c=getStatementsToMove(getRefactorContext(i,n,r,Fs));const l=containsJsx(c==null?void 0:c.all);const d=mapDefined(o,(e=>{const t=extensionFromPath(e.fileName);const n=!(a==null?void 0:a.isSourceFileFromExternalLibrary(i))&&!(i===getValidSourceFile(e.fileName)||s===".ts"&&t===".d.ts"||s===".d.ts"&&startsWith(getBaseFileName(e.fileName),"lib.")&&t===".d.ts");return n&&(s===t||(s===".tsx"&&t===".ts"||s===".jsx"&&t===".js")&&!l)?e.fileName:void 0}));return{newFileName:createNewFileName(i,a,e,c),files:d}}function getEditsForRefactor2(e,t,n,r,i,o=Fs,a){synchronizeHostData();const s=getValidSourceFile(e);return Nc.getEditsForRefactor(getRefactorContext(s,n,o,t),r,i,a)}function toLineColumnOffset(e,t){if(t===0){return{line:0,character:0}}return m.toLineColumnOffset(e,t)}function prepareCallHierarchy(e,t){synchronizeHostData();const n=td.resolveCallHierarchyDeclaration(a,getTouchingPropertyName(getValidSourceFile(e),t));return n&&mapOneOrMany(n,(e=>td.createCallHierarchyItem(a,e)))}function provideCallHierarchyIncomingCalls(e,t){synchronizeHostData();const n=getValidSourceFile(e);const r=firstOrOnly(td.resolveCallHierarchyDeclaration(a,t===0?n:getTouchingPropertyName(n,t)));return r?td.getIncomingCalls(a,r,l):[]}function provideCallHierarchyOutgoingCalls(e,t){synchronizeHostData();const n=getValidSourceFile(e);const r=firstOrOnly(td.resolveCallHierarchyDeclaration(a,t===0?n:getTouchingPropertyName(n,t)));return r?td.getOutgoingCalls(a,r):[]}function provideInlayHints2(e,t,n=Fs){synchronizeHostData();const r=getValidSourceFile(e);return Hf.provideInlayHints(getInlayHintsContext(r,t,n))}function mapCode2(t,n,r,i,a){return Yf.mapCode(o.getCurrentSourceFile(t),n,r,e,hm.getFormatContext(i,e),a)}const g={dispose:dispose,cleanupSemanticCache:cleanupSemanticCache,getSyntacticDiagnostics:getSyntacticDiagnostics,getSemanticDiagnostics:getSemanticDiagnostics,getRegionSemanticDiagnostics:getRegionSemanticDiagnostics,getSuggestionDiagnostics:getSuggestionDiagnostics,getCompilerOptionsDiagnostics:getCompilerOptionsDiagnostics,getSyntacticClassifications:getSyntacticClassifications2,getSemanticClassifications:getSemanticClassifications3,getEncodedSyntacticClassifications:getEncodedSyntacticClassifications2,getEncodedSemanticClassifications:getEncodedSemanticClassifications3,getCompletionsAtPosition:getCompletionsAtPosition2,getCompletionEntryDetails:getCompletionEntryDetails2,getCompletionEntrySymbol:getCompletionEntrySymbol2,getSignatureHelpItems:getSignatureHelpItems2,getQuickInfoAtPosition:getQuickInfoAtPosition,getDefinitionAtPosition:getDefinitionAtPosition2,getDefinitionAndBoundSpan:getDefinitionAndBoundSpan2,getImplementationAtPosition:getImplementationAtPosition,getTypeDefinitionAtPosition:getTypeDefinitionAtPosition2,getReferencesAtPosition:getReferencesAtPosition,findReferences:findReferences,getFileReferences:getFileReferences,getDocumentHighlights:getDocumentHighlights,getNameOrDottedNameSpan:getNameOrDottedNameSpan,getBreakpointStatementAtPosition:getBreakpointStatementAtPosition,getNavigateToItems:getNavigateToItems2,getRenameInfo:getRenameInfo2,getSmartSelectionRange:getSmartSelectionRange2,findRenameLocations:findRenameLocations,getNavigationBarItems:getNavigationBarItems2,getNavigationTree:getNavigationTree2,getOutliningSpans:getOutliningSpans,getTodoComments:getTodoComments,getBraceMatchingAtPosition:getBraceMatchingAtPosition,getIndentationAtPosition:getIndentationAtPosition,getFormattingEditsForRange:getFormattingEditsForRange,getFormattingEditsForDocument:getFormattingEditsForDocument,getFormattingEditsAfterKeystroke:getFormattingEditsAfterKeystroke,getDocCommentTemplateAtPosition:getDocCommentTemplateAtPosition2,isValidBraceCompletionAtPosition:isValidBraceCompletionAtPosition,getJsxClosingTagAtPosition:getJsxClosingTagAtPosition,getLinkedEditingRangeAtPosition:getLinkedEditingRangeAtPosition,getSpanOfEnclosingComment:getSpanOfEnclosingComment,getCodeFixesAtPosition:getCodeFixesAtPosition,getCombinedCodeFix:getCombinedCodeFix,applyCodeActionCommand:applyCodeActionCommand,organizeImports:organizeImports2,getEditsForFileRename:getEditsForFileRename2,getEmitOutput:getEmitOutput,getNonBoundSourceFile:getNonBoundSourceFile,getProgram:getProgram,getCurrentProgram:()=>a,getAutoImportProvider:getAutoImportProvider,updateIsDefinitionOfReferencedSymbols:updateIsDefinitionOfReferencedSymbols,getApplicableRefactors:getApplicableRefactors2,getEditsForRefactor:getEditsForRefactor2,getMoveToRefactoringFileSuggestions:getMoveToRefactoringFileSuggestions,toLineColumnOffset:toLineColumnOffset,getSourceMapper:()=>m,clearSourceMapperCache:()=>m.clearCache(),prepareCallHierarchy:prepareCallHierarchy,provideCallHierarchyIncomingCalls:provideCallHierarchyIncomingCalls,provideCallHierarchyOutgoingCalls:provideCallHierarchyOutgoingCalls,toggleLineComment:toggleLineComment,toggleMultilineComment:toggleMultilineComment,commentSelection:commentSelection,uncommentSelection:uncommentSelection,provideInlayHints:provideInlayHints2,getSupportedCodeFixes:getSupportedCodeFixes,preparePasteEditsForFile:preparePasteEditsForFile,getPasteEdits:getPasteEdits,mapCode:mapCode2};switch(i){case 0:break;case 1:Yl.forEach((e=>g[e]=()=>{throw new Error(`LanguageService Operation: ${e} not allowed in LanguageServiceMode.PartialSemantic`)}));break;case 2:Zl.forEach((e=>g[e]=()=>{throw new Error(`LanguageService Operation: ${e} not allowed in LanguageServiceMode.Syntactic`)}));break;default:S.assertNever(i)}return g}function getNameTable(e){if(!e.nameTable){initializeNameTable(e)}return e.nameTable}function initializeNameTable(e){const t=e.nameTable=new Map;e.forEachChild((function walk(e){if(isIdentifier(e)&&!isTagName(e)&&e.escapedText||isStringOrNumericLiteralLike(e)&&literalIsName(e)){const n=getEscapedTextOfIdentifierOrLiteral(e);t.set(n,t.get(n)===void 0?e.pos:-1)}else if(isPrivateIdentifier(e)){const n=e.escapedText;t.set(n,t.get(n)===void 0?e.pos:-1)}forEachChild(e,walk);if(hasJSDocNodes(e)){for(const t of e.jsDoc){forEachChild(t,walk)}}}))}function literalIsName(e){return isDeclarationName(e)||e.parent.kind===283||isArgumentOfElementAccessExpression(e)||isLiteralComputedPropertyDeclarationName(e)}function getContainingObjectLiteralElement(e){const t=getContainingObjectLiteralElementWorker(e);return t&&(isObjectLiteralExpression(t.parent)||isJsxAttributes(t.parent))?t:void 0}function getContainingObjectLiteralElementWorker(e){switch(e.kind){case 11:case 15:case 9:if(e.parent.kind===167){return isObjectLiteralElement(e.parent.parent)?e.parent.parent:void 0}case 80:return isObjectLiteralElement(e.parent)&&(e.parent.parent.kind===210||e.parent.parent.kind===292)&&e.parent.name===e?e.parent:void 0}return void 0}function getSymbolAtLocationForQuickInfo(e,t){const n=getContainingObjectLiteralElement(e);if(n){const e=t.getContextualType(n.parent);const r=e&&getPropertySymbolsFromContextualType(n,t,e,false);if(r&&r.length===1){return first(r)}}return t.getSymbolAtLocation(e)}function getPropertySymbolsFromContextualType(e,t,n,r){const i=getNameFromPropertyName(e.name);if(!i)return d;if(!n.isUnion()){const e=n.getProperty(i);return e?[e]:d}const o=isObjectLiteralExpression(e.parent)||isJsxAttributes(e.parent)?filter(n.types,(n=>!t.isTypeInvalidDueToUnionDiscriminant(n,e.parent))):n.types;const a=mapDefined(o,(e=>e.getProperty(i)));if(r&&(a.length===0||a.length===n.types.length)){const e=n.getProperty(i);if(e)return[e]}if(!o.length&&!a.length){return mapDefined(n.types,(e=>e.getProperty(i)))}return deduplicate(a,equateValues)}function isArgumentOfElementAccessExpression(e){return e&&e.parent&&e.parent.kind===212&&e.parent.argumentExpression===e}function getDefaultLibFilePath(e){if(Ft){return combinePaths(getDirectoryPath(normalizePath(Ft.getExecutingFilePath())),getDefaultLibFileName(e))}throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. ")}setObjectAllocator(getServicesObjectAllocator());function transform(e,t,n){const r=[];n=fixupCompilerOptions(n,r);const i=isArray(e)?e:[e];const o=transformNodes(void 0,void 0,zr,n,i,t,true);o.diagnostics=concatenate(o.diagnostics,r);return o}var ed={};__export(ed,{spanInSourceFileAtLocation:()=>spanInSourceFileAtLocation});function spanInSourceFileAtLocation(e,t){if(e.isDeclarationFile){return void 0}let n=getTokenAtPosition(e,t);const r=e.getLineAndCharacterOfPosition(t).line;if(e.getLineAndCharacterOfPosition(n.getStart(e)).line>r){const t=findPrecedingToken(n.pos,e);if(!t||e.getLineAndCharacterOfPosition(t.getEnd()).line!==r){return void 0}n=t}if(n.flags&33554432){return void 0}return spanInNode(n);function textSpan(t,n){const r=canHaveDecorators(t)?findLast(t.modifiers,isDecorator):void 0;const i=r?skipTrivia(e.text,r.end):t.getStart(e);return createTextSpanFromBounds(i,(n||t).getEnd())}function textSpanEndingAtNextToken(t,n){return textSpan(t,findNextToken(n,n.parent,e))}function spanInNodeIfStartsOnSameLine(t,n){if(t&&r===e.getLineAndCharacterOfPosition(t.getStart(e)).line){return spanInNode(t)}return spanInNode(n)}function spanInNodeArray(t,n,r){if(t){const i=t.indexOf(n);if(i>=0){let n=i;let o=i+1;while(n>0&&r(t[n-1]))n--;while(o0){return spanInNode(t.declarations[0])}}else{return spanInNode(e.initializer)}}function spanInForStatement(e){if(e.initializer){return spanInInitializerOfForLike(e)}if(e.condition){return textSpan(e.condition)}if(e.incrementor){return textSpan(e.incrementor)}}function spanInBindingPattern(e){const t=forEach(e.elements,(e=>e.kind!==232?e:void 0));if(t){return spanInNode(t)}if(e.parent.kind===208){return textSpan(e.parent)}return textSpanFromVariableDeclaration(e.parent)}function spanInArrayLiteralOrObjectLiteralDestructuringPattern(e){S.assert(e.kind!==207&&e.kind!==206);const t=e.kind===209?e.elements:e.properties;const n=forEach(t,(e=>e.kind!==232?e:void 0));if(n){return spanInNode(n)}return textSpan(e.parent.kind===226?e.parent:e)}function spanInOpenBraceToken(t){switch(t.parent.kind){case 266:const n=t.parent;return spanInNodeIfStartsOnSameLine(findPrecedingToken(t.pos,e,t.parent),n.members.length?n.members[0]:n.getLastToken(e));case 263:const r=t.parent;return spanInNodeIfStartsOnSameLine(findPrecedingToken(t.pos,e,t.parent),r.members.length?r.members[0]:r.getLastToken(e));case 269:return spanInNodeIfStartsOnSameLine(t.parent.parent,t.parent.clauses[0])}return spanInNode(t.parent)}function spanInCloseBraceToken(e){switch(e.parent.kind){case 268:if(getModuleInstanceState(e.parent.parent)!==1){return void 0}case 266:case 263:return textSpan(e);case 241:if(isFunctionBlock(e.parent)){return textSpan(e)}case 299:return spanInNode(lastOrUndefined(e.parent.statements));case 269:const t=e.parent;const n=lastOrUndefined(t.clauses);if(n){return spanInNode(lastOrUndefined(n.statements))}return void 0;case 206:const r=e.parent;return spanInNode(lastOrUndefined(r.elements)||r);default:if(isArrayLiteralOrObjectLiteralDestructuringPattern(e.parent)){const t=e.parent;return textSpan(lastOrUndefined(t.properties)||t)}return spanInNode(e.parent)}}function spanInCloseBracketToken(e){switch(e.parent.kind){case 207:const t=e.parent;return textSpan(lastOrUndefined(t.elements)||t);default:if(isArrayLiteralOrObjectLiteralDestructuringPattern(e.parent)){const t=e.parent;return textSpan(lastOrUndefined(t.elements)||t)}return spanInNode(e.parent)}}function spanInOpenParenToken(e){if(e.parent.kind===246||e.parent.kind===213||e.parent.kind===214){return spanInPreviousNode(e)}if(e.parent.kind===217){return spanInNextNode(e)}return spanInNode(e.parent)}function spanInCloseParenToken(e){switch(e.parent.kind){case 218:case 262:case 219:case 174:case 173:case 177:case 178:case 176:case 247:case 246:case 248:case 250:case 213:case 214:case 217:return spanInPreviousNode(e);default:return spanInNode(e.parent)}}function spanInColonToken(e){if(isFunctionLike(e.parent)||e.parent.kind===303||e.parent.kind===169){return spanInPreviousNode(e)}return spanInNode(e.parent)}function spanInGreaterThanOrLessThanToken(e){if(e.parent.kind===216){return spanInNextNode(e)}return spanInNode(e.parent)}function spanInWhileKeyword(e){if(e.parent.kind===246){return textSpanEndingAtNextToken(e,e.parent.expression)}return spanInNode(e.parent)}function spanInOfKeyword(e){if(e.parent.kind===250){return spanInNextNode(e)}return spanInNode(e.parent)}}}var td={};__export(td,{createCallHierarchyItem:()=>createCallHierarchyItem,getIncomingCalls:()=>getIncomingCalls,getOutgoingCalls:()=>getOutgoingCalls,resolveCallHierarchyDeclaration:()=>resolveCallHierarchyDeclaration});function isNamedExpression(e){return(isFunctionExpression(e)||isClassExpression(e))&&isNamedDeclaration(e)}function isVariableLike2(e){return isPropertyDeclaration(e)||isVariableDeclaration(e)}function isAssignedExpression(e){return(isFunctionExpression(e)||isArrowFunction(e)||isClassExpression(e))&&isVariableLike2(e.parent)&&e===e.parent.initializer&&isIdentifier(e.parent.name)&&(!!(getCombinedNodeFlags(e.parent)&2)||isPropertyDeclaration(e.parent))}function isPossibleCallHierarchyDeclaration(e){return isSourceFile(e)||isModuleDeclaration(e)||isFunctionDeclaration(e)||isFunctionExpression(e)||isClassDeclaration(e)||isClassExpression(e)||isClassStaticBlockDeclaration(e)||isMethodDeclaration(e)||isMethodSignature(e)||isGetAccessorDeclaration(e)||isSetAccessorDeclaration(e)}function isValidCallHierarchyDeclaration(e){return isSourceFile(e)||isModuleDeclaration(e)&&isIdentifier(e.name)||isFunctionDeclaration(e)||isClassDeclaration(e)||isClassStaticBlockDeclaration(e)||isMethodDeclaration(e)||isMethodSignature(e)||isGetAccessorDeclaration(e)||isSetAccessorDeclaration(e)||isNamedExpression(e)||isAssignedExpression(e)}function getCallHierarchyDeclarationReferenceNode(e){if(isSourceFile(e))return e;if(isNamedDeclaration(e))return e.name;if(isAssignedExpression(e))return e.parent.name;return S.checkDefined(e.modifiers&&find(e.modifiers,isDefaultModifier3))}function isDefaultModifier3(e){return e.kind===90}function getSymbolOfCallHierarchyDeclaration(e,t){const n=getCallHierarchyDeclarationReferenceNode(t);return n&&e.getSymbolAtLocation(n)}function getCallHierarchyItemName(e,t){if(isSourceFile(t)){return{text:t.fileName,pos:0,end:0}}if((isFunctionDeclaration(t)||isClassDeclaration(t))&&!isNamedDeclaration(t)){const e=t.modifiers&&find(t.modifiers,isDefaultModifier3);if(e){return{text:"default",pos:e.getStart(),end:e.getEnd()}}}if(isClassStaticBlockDeclaration(t)){const n=t.getSourceFile();const r=skipTrivia(n.text,moveRangePastModifiers(t).pos);const i=r+6;const o=e.getTypeChecker();const a=o.getSymbolAtLocation(t.parent);const s=a?`${o.symbolToString(a,t.parent)} `:"";return{text:`${s}static {}`,pos:r,end:i}}const n=isAssignedExpression(t)?t.parent.name:S.checkDefined(getNameOfDeclaration(t),"Expected call hierarchy item to have a name");let r=isIdentifier(n)?idText(n):isStringOrNumericLiteralLike(n)?n.text:isComputedPropertyName(n)?isStringOrNumericLiteralLike(n.expression)?n.expression.text:void 0:void 0;if(r===void 0){const i=e.getTypeChecker();const o=i.getSymbolAtLocation(n);if(o){r=i.symbolToString(o,t)}}if(r===void 0){const e=Oa();r=usingSingleLineStringWriter((n=>e.writeNode(4,t,t.getSourceFile(),n)))}return{text:r,pos:n.getStart(),end:n.getEnd()}}function getCallHierarchItemContainerName(e){var t,n,r,i;if(isAssignedExpression(e)){if(isPropertyDeclaration(e.parent)&&isClassLike(e.parent.parent)){return isClassExpression(e.parent.parent)?(t=getAssignedName(e.parent.parent))==null?void 0:t.getText():(n=e.parent.parent.name)==null?void 0:n.getText()}if(isModuleBlock(e.parent.parent.parent.parent)&&isIdentifier(e.parent.parent.parent.parent.parent.name)){return e.parent.parent.parent.parent.parent.name.getText()}return}switch(e.kind){case 177:case 178:case 174:if(e.parent.kind===210){return(r=getAssignedName(e.parent))==null?void 0:r.getText()}return(i=getNameOfDeclaration(e.parent))==null?void 0:i.getText();case 262:case 263:case 267:if(isModuleBlock(e.parent)&&isIdentifier(e.parent.parent.name)){return e.parent.parent.name.getText()}}}function findImplementation(e,t){if(t.body){return t}if(isConstructorDeclaration(t)){return getFirstConstructorWithBody(t.parent)}if(isFunctionDeclaration(t)||isMethodDeclaration(t)){const n=getSymbolOfCallHierarchyDeclaration(e,t);if(n&&n.valueDeclaration&&isFunctionLikeDeclaration(n.valueDeclaration)&&n.valueDeclaration.body){return n.valueDeclaration}return void 0}return t}function findAllInitialDeclarations(e,t){const n=getSymbolOfCallHierarchyDeclaration(e,t);let r;if(n&&n.declarations){const e=indicesOf(n.declarations);const t=map(n.declarations,(e=>({file:e.getSourceFile().fileName,pos:e.pos})));e.sort(((e,n)=>compareStringsCaseSensitive(t[e].file,t[n].file)||t[e].pos-t[n].pos));const i=map(e,(e=>n.declarations[e]));let o;for(const e of i){if(isValidCallHierarchyDeclaration(e)){if(!o||o.parent!==e.parent||o.end!==e.pos){r=append(r,e)}o=e}}}return r}function findImplementationOrAllInitialDeclarations(e,t){if(isClassStaticBlockDeclaration(t)){return t}if(isFunctionLikeDeclaration(t)){return findImplementation(e,t)??findAllInitialDeclarations(e,t)??t}return findAllInitialDeclarations(e,t)??t}function resolveCallHierarchyDeclaration(e,t){const n=e.getTypeChecker();let r=false;while(true){if(isValidCallHierarchyDeclaration(t)){return findImplementationOrAllInitialDeclarations(n,t)}if(isPossibleCallHierarchyDeclaration(t)){const e=findAncestor(t,isValidCallHierarchyDeclaration);return e&&findImplementationOrAllInitialDeclarations(n,e)}if(isDeclarationName(t)){if(isValidCallHierarchyDeclaration(t.parent)){return findImplementationOrAllInitialDeclarations(n,t.parent)}if(isPossibleCallHierarchyDeclaration(t.parent)){const e=findAncestor(t.parent,isValidCallHierarchyDeclaration);return e&&findImplementationOrAllInitialDeclarations(n,e)}if(isVariableLike2(t.parent)&&t.parent.initializer&&isAssignedExpression(t.parent.initializer)){return t.parent.initializer}return void 0}if(isConstructorDeclaration(t)){if(isValidCallHierarchyDeclaration(t.parent)){return t.parent}return void 0}if(t.kind===126&&isClassStaticBlockDeclaration(t.parent)){t=t.parent;continue}if(isVariableDeclaration(t)&&t.initializer&&isAssignedExpression(t.initializer)){return t.initializer}if(!r){let e=n.getSymbolAtLocation(t);if(e){if(e.flags&2097152){e=n.getAliasedSymbol(e)}if(e.valueDeclaration){r=true;t=e.valueDeclaration;continue}}}return void 0}}function createCallHierarchyItem(e,t){const n=t.getSourceFile();const r=getCallHierarchyItemName(e,t);const i=getCallHierarchItemContainerName(t);const o=getNodeKind(t);const a=getNodeModifiers(t);const s=createTextSpanFromBounds(skipTrivia(n.text,t.getFullStart(),false,true),t.getEnd());const c=createTextSpanFromBounds(r.pos,r.end);return{file:n.fileName,kind:o,kindModifiers:a,name:r.text,containerName:i,span:s,selectionSpan:c}}function isDefined(e){return e!==void 0}function convertEntryToCallSite(e){if(e.kind===Rf.EntryKind.Node){const{node:t}=e;if(isCallOrNewExpressionTarget(t,true,true)||isTaggedTemplateTag(t,true,true)||isDecoratorTarget(t,true,true)||isJsxOpeningLikeElementTagName(t,true,true)||isRightSideOfPropertyAccess(t)||isArgumentExpressionOfElementAccess(t)){const e=t.getSourceFile();const n=findAncestor(t,isValidCallHierarchyDeclaration)||e;return{declaration:n,range:createTextRangeFromNode(t,e)}}}}function getCallSiteGroupKey(e){return getNodeId(e.declaration)}function createCallHierarchyIncomingCall(e,t){return{from:e,fromSpans:t}}function convertCallSiteGroupToIncomingCall(e,t){return createCallHierarchyIncomingCall(createCallHierarchyItem(e,t[0].declaration),map(t,(e=>createTextSpanFromRange(e.range))))}function getIncomingCalls(e,t,n){if(isSourceFile(t)||isModuleDeclaration(t)||isClassStaticBlockDeclaration(t)){return[]}const r=getCallHierarchyDeclarationReferenceNode(t);const i=filter(Rf.findReferenceOrRenameEntries(e,n,e.getSourceFiles(),r,0,{use:Rf.FindReferencesUse.References},convertEntryToCallSite),isDefined);return i?group(i,getCallSiteGroupKey,(t=>convertCallSiteGroupToIncomingCall(e,t))):[]}function createCallSiteCollector(e,t){function recordCallSite(n){const r=isTaggedTemplateExpression(n)?n.tag:isJsxOpeningLikeElement(n)?n.tagName:isAccessExpression(n)?n:isClassStaticBlockDeclaration(n)?n:n.expression;const i=resolveCallHierarchyDeclaration(e,r);if(i){const e=createTextRangeFromNode(r,n.getSourceFile());if(isArray(i)){for(const n of i){t.push({declaration:n,range:e})}}else{t.push({declaration:i,range:e})}}}function collect(e){if(!e)return;if(e.flags&33554432){return}if(isValidCallHierarchyDeclaration(e)){if(isClassLike(e)){for(const t of e.members){if(t.name&&isComputedPropertyName(t.name)){collect(t.name.expression)}}}return}switch(e.kind){case 80:case 271:case 272:case 278:case 264:case 265:return;case 175:recordCallSite(e);return;case 216:case 234:collect(e.expression);return;case 260:case 169:collect(e.name);collect(e.initializer);return;case 213:recordCallSite(e);collect(e.expression);forEach(e.arguments,collect);return;case 214:recordCallSite(e);collect(e.expression);forEach(e.arguments,collect);return;case 215:recordCallSite(e);collect(e.tag);collect(e.template);return;case 286:case 285:recordCallSite(e);collect(e.tagName);collect(e.attributes);return;case 170:recordCallSite(e);collect(e.expression);return;case 211:case 212:recordCallSite(e);forEachChild(e,collect);break;case 238:collect(e.expression);return}if(isPartOfTypeNode(e)){return}forEachChild(e,collect)}return collect}function collectCallSitesOfSourceFile(e,t){forEach(e.statements,t)}function collectCallSitesOfModuleDeclaration(e,t){if(!hasSyntacticModifier(e,128)&&e.body&&isModuleBlock(e.body)){forEach(e.body.statements,t)}}function collectCallSitesOfFunctionLikeDeclaration(e,t,n){const r=findImplementation(e,t);if(r){forEach(r.parameters,n);n(r.body)}}function collectCallSitesOfClassStaticBlockDeclaration(e,t){t(e.body)}function collectCallSitesOfClassLikeDeclaration(e,t){forEach(e.modifiers,t);const n=getClassExtendsHeritageElement(e);if(n){t(n.expression)}for(const n of e.members){if(canHaveModifiers(n)){forEach(n.modifiers,t)}if(isPropertyDeclaration(n)){t(n.initializer)}else if(isConstructorDeclaration(n)&&n.body){forEach(n.parameters,t);t(n.body)}else if(isClassStaticBlockDeclaration(n)){t(n)}}}function collectCallSites(e,t){const n=[];const r=createCallSiteCollector(e,n);switch(t.kind){case 307:collectCallSitesOfSourceFile(t,r);break;case 267:collectCallSitesOfModuleDeclaration(t,r);break;case 262:case 218:case 219:case 174:case 177:case 178:collectCallSitesOfFunctionLikeDeclaration(e.getTypeChecker(),t,r);break;case 263:case 231:collectCallSitesOfClassLikeDeclaration(t,r);break;case 175:collectCallSitesOfClassStaticBlockDeclaration(t,r);break;default:S.assertNever(t)}return n}function createCallHierarchyOutgoingCall(e,t){return{to:e,fromSpans:t}}function convertCallSiteGroupToOutgoingCall(e,t){return createCallHierarchyOutgoingCall(createCallHierarchyItem(e,t[0].declaration),map(t,(e=>createTextSpanFromRange(e.range))))}function getOutgoingCalls(e,t){if(t.flags&33554432||isMethodSignature(t)){return[]}return group(collectCallSites(e,t),getCallSiteGroupKey,(t=>convertCallSiteGroupToOutgoingCall(e,t)))}var nd={};__export(nd,{v2020:()=>rd});var rd={};__export(rd,{TokenEncodingConsts:()=>Ol,TokenModifier:()=>Ll,TokenType:()=>wl,getEncodedSemanticClassifications:()=>getEncodedSemanticClassifications2,getSemanticClassifications:()=>getSemanticClassifications2});var id={};__export(id,{PreserveOptionalFlags:()=>ju,addNewNodeForMemberSymbol:()=>addNewNodeForMemberSymbol,codeFixAll:()=>codeFixAll,createCodeFixAction:()=>createCodeFixAction,createCodeFixActionMaybeFixAll:()=>createCodeFixActionMaybeFixAll,createCodeFixActionWithoutFixAll:()=>createCodeFixActionWithoutFixAll,createCombinedCodeActions:()=>createCombinedCodeActions,createFileTextChanges:()=>createFileTextChanges,createImportAdder:()=>createImportAdder,createImportSpecifierResolver:()=>createImportSpecifierResolver,createMissingMemberNodes:()=>createMissingMemberNodes,createSignatureDeclarationFromCallExpression:()=>createSignatureDeclarationFromCallExpression,createSignatureDeclarationFromSignature:()=>createSignatureDeclarationFromSignature,createStubbedBody:()=>createStubbedBody,eachDiagnostic:()=>eachDiagnostic,findAncestorMatchingSpan:()=>findAncestorMatchingSpan,generateAccessorFromProperty:()=>generateAccessorFromProperty,getAccessorConvertiblePropertyAtPosition:()=>getAccessorConvertiblePropertyAtPosition,getAllFixes:()=>getAllFixes,getAllSupers:()=>getAllSupers,getFixes:()=>getFixes,getImportCompletionAction:()=>getImportCompletionAction,getImportKind:()=>getImportKind,getJSDocTypedefNodes:()=>getJSDocTypedefNodes,getNoopSymbolTrackerWithResolver:()=>getNoopSymbolTrackerWithResolver,getPromoteTypeOnlyCompletionAction:()=>getPromoteTypeOnlyCompletionAction,getSupportedErrorCodes:()=>getSupportedErrorCodes,importFixName:()=>Gd,importSymbols:()=>importSymbols,parameterShouldGetTypeFromJSDoc:()=>parameterShouldGetTypeFromJSDoc,registerCodeFix:()=>registerCodeFix,setJsonCompilerOptionValue:()=>setJsonCompilerOptionValue,setJsonCompilerOptionValues:()=>setJsonCompilerOptionValues,tryGetAutoImportableReferenceFromTypeNode:()=>tryGetAutoImportableReferenceFromTypeNode,typeNodeToAutoImportableTypeNode:()=>typeNodeToAutoImportableTypeNode,typePredicateToAutoImportableTypeNode:()=>typePredicateToAutoImportableTypeNode,typeToAutoImportableTypeNode:()=>typeToAutoImportableTypeNode,typeToMinimizedReferenceType:()=>typeToMinimizedReferenceType});var od=createMultiMap();var ad=new Map;function createCodeFixActionWithoutFixAll(e,t,n){return createCodeFixActionWorker(e,diagnosticToString(n),t,void 0,void 0)}function createCodeFixAction(e,t,n,r,i,o){return createCodeFixActionWorker(e,diagnosticToString(n),t,r,diagnosticToString(i),o)}function createCodeFixActionMaybeFixAll(e,t,n,r,i,o){return createCodeFixActionWorker(e,diagnosticToString(n),t,r,i&&diagnosticToString(i),o)}function createCodeFixActionWorker(e,t,n,r,i,o){return{fixName:e,description:t,changes:n,fixId:r,fixAllDescription:i,commands:o?[o]:void 0}}function registerCodeFix(e){for(const t of e.errorCodes){sd=void 0;od.add(String(t),e)}if(e.fixIds){for(const t of e.fixIds){S.assert(!ad.has(t));ad.set(t,e)}}}var sd;function getSupportedErrorCodes(){return sd??(sd=arrayFrom(od.keys()))}function removeFixIdIfFixAllUnavailable(e,t){const{errorCodes:n}=e;let r=0;for(const e of t){if(contains(n,e.code))r++;if(r>1)break}const i=r<2;return({fixId:e,fixAllDescription:t,...n})=>i?n:{...n,fixId:e,fixAllDescription:t}}function getFixes(e){const t=getDiagnostics(e);const n=od.get(String(e.errorCode));return flatMap(n,(n=>map(n.getCodeActions(e),removeFixIdIfFixAllUnavailable(n,t))))}function getAllFixes(e){return ad.get(cast(e.fixId,isString)).getAllCodeActions(e)}function createCombinedCodeActions(e,t){return{changes:e,commands:t}}function createFileTextChanges(e,t){return{fileName:e,textChanges:t}}function codeFixAll(e,t,n){const r=[];const i=dm.ChangeTracker.with(e,(i=>eachDiagnostic(e,t,(e=>n(i,e,r)))));return createCombinedCodeActions(i,r.length===0?void 0:r)}function eachDiagnostic(e,t,n){for(const r of getDiagnostics(e)){if(contains(t,r.code)){n(r)}}}function getDiagnostics({program:e,sourceFile:t,cancellationToken:n}){const r=[...e.getSemanticDiagnostics(t,n),...e.getSyntacticDiagnostics(t,n),...computeSuggestionDiagnostics(t,e,n)];if(Zn(e.getCompilerOptions())){r.push(...e.getDeclarationDiagnostics(t,n))}return r}var cd="addConvertToUnknownForNonOverlappingTypes";var ld=[wt.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];registerCodeFix({errorCodes:ld,getCodeActions:function getCodeActionsToAddConvertToUnknownForNonOverlappingTypes(e){const t=getAssertion(e.sourceFile,e.span.start);if(t===void 0)return void 0;const n=dm.ChangeTracker.with(e,(n=>makeChange(n,e.sourceFile,t)));return[createCodeFixAction(cd,n,wt.Add_unknown_conversion_for_non_overlapping_types,cd,wt.Add_unknown_to_all_conversions_of_non_overlapping_types)]},fixIds:[cd],getAllCodeActions:e=>codeFixAll(e,ld,((e,t)=>{const n=getAssertion(t.file,t.start);if(n){makeChange(e,t.file,n)}}))});function makeChange(e,t,n){const r=isAsExpression(n)?zr.createAsExpression(n.expression,zr.createKeywordTypeNode(159)):zr.createTypeAssertion(zr.createKeywordTypeNode(159),n.expression);e.replaceNode(t,n.expression,r)}function getAssertion(e,t){if(isInJSFile(e))return void 0;return findAncestor(getTokenAtPosition(e,t),(e=>isAsExpression(e)||isTypeAssertionExpression(e)))}registerCodeFix({errorCodes:[wt.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,wt.await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,wt.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code],getCodeActions:function getCodeActionsToAddEmptyExportDeclaration(e){const{sourceFile:t}=e;const n=dm.ChangeTracker.with(e,(e=>{const n=zr.createExportDeclaration(void 0,false,zr.createNamedExports([]),void 0);e.insertNodeAtEndOfScope(t,t,n)}));return[createCodeFixActionWithoutFixAll("addEmptyExportDeclaration",n,wt.Add_export_to_make_this_file_into_a_module)]}});var dd="addMissingAsync";var pd=[wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,wt.Type_0_is_not_assignable_to_type_1.code,wt.Type_0_is_not_comparable_to_type_1.code];registerCodeFix({fixIds:[dd],errorCodes:pd,getCodeActions:function getCodeActionsToAddMissingAsync(e){const{sourceFile:t,errorCode:n,cancellationToken:r,program:i,span:o}=e;const a=find(i.getTypeChecker().getDiagnostics(t,r),getIsMatchingAsyncError(o,n));const s=a&&a.relatedInformation&&find(a.relatedInformation,(e=>e.code===wt.Did_you_mean_to_mark_this_function_as_async.code));const c=getFixableErrorSpanDeclaration(t,s);if(!c){return}const trackChanges=t=>dm.ChangeTracker.with(e,t);return[getFix(e,c,trackChanges)]},getAllCodeActions:e=>{const{sourceFile:t}=e;const n=new Set;return codeFixAll(e,pd,((r,i)=>{const o=i.relatedInformation&&find(i.relatedInformation,(e=>e.code===wt.Did_you_mean_to_mark_this_function_as_async.code));const a=getFixableErrorSpanDeclaration(t,o);if(!a){return}const trackChanges=e=>(e(r),[]);return getFix(e,a,trackChanges,n)}))}});function getFix(e,t,n,r){const i=n((n=>makeChange2(n,e.sourceFile,t,r)));return createCodeFixAction(dd,i,wt.Add_async_modifier_to_containing_function,dd,wt.Add_all_missing_async_modifiers)}function makeChange2(e,t,n,r){if(r){if(r.has(getNodeId(n))){return}}r==null?void 0:r.add(getNodeId(n));const i=zr.replaceModifiers(getSynthesizedDeepClone(n,true),zr.createNodeArray(zr.createModifiersFromModifierFlags(getSyntacticModifierFlags(n)|1024)));e.replaceNode(t,n,i)}function getFixableErrorSpanDeclaration(e,t){if(!t)return void 0;const n=getTokenAtPosition(e,t.start);const r=findAncestor(n,(n=>{if(n.getStart(e)textSpanEnd(t)){return"quit"}return(isArrowFunction(n)||isMethodDeclaration(n)||isFunctionExpression(n)||isFunctionDeclaration(n))&&textSpansEqual(t,createTextSpanFromNode(n,e))}));return r}function getIsMatchingAsyncError(e,t){return({start:n,length:r,relatedInformation:i,code:o})=>isNumber(n)&&isNumber(r)&&textSpansEqual({start:n,length:r},e)&&o===t&&!!i&&some(i,(e=>e.code===wt.Did_you_mean_to_mark_this_function_as_async.code))}var ud="addMissingAwait";var fd=wt.Property_0_does_not_exist_on_type_1.code;var md=[wt.This_expression_is_not_callable.code,wt.This_expression_is_not_constructable.code];var _d=[wt.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,wt.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,wt.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,wt.Operator_0_cannot_be_applied_to_type_1.code,wt.Operator_0_cannot_be_applied_to_types_1_and_2.code,wt.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap.code,wt.This_condition_will_always_return_true_since_this_0_is_always_defined.code,wt.Type_0_is_not_an_array_type.code,wt.Type_0_is_not_an_array_type_or_a_string_type.code,wt.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code,wt.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,wt.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,wt.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,wt.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,fd,...md];registerCodeFix({fixIds:[ud],errorCodes:_d,getCodeActions:function getCodeActionsToAddMissingAwait(e){const{sourceFile:t,errorCode:n,span:r,cancellationToken:i,program:o}=e;const a=getAwaitErrorSpanExpression(t,n,r,i,o);if(!a){return}const s=e.program.getTypeChecker();const trackChanges=t=>dm.ChangeTracker.with(e,t);return compact([getDeclarationSiteFix(e,a,n,s,trackChanges),getUseSiteFix(e,a,n,s,trackChanges)])},getAllCodeActions:e=>{const{sourceFile:t,program:n,cancellationToken:r}=e;const i=e.program.getTypeChecker();const o=new Set;return codeFixAll(e,_d,((a,s)=>{const c=getAwaitErrorSpanExpression(t,s.code,s,r,n);if(!c){return}const trackChanges=e=>(e(a),[]);return getDeclarationSiteFix(e,c,s.code,i,trackChanges,o)||getUseSiteFix(e,c,s.code,i,trackChanges,o)}))}});function getAwaitErrorSpanExpression(e,t,n,r,i){const o=getFixableErrorSpanExpression(e,n);return o&&isMissingAwaitError(e,t,n,r,i)&&isInsideAwaitableBody(o)?o:void 0}function getDeclarationSiteFix(e,t,n,r,i,o){const{sourceFile:a,program:s,cancellationToken:c}=e;const l=findAwaitableInitializers(t,a,c,s,r);if(l){const e=i((e=>{forEach(l.initializers,(({expression:t})=>makeChange3(e,n,a,r,t,o)));if(o&&l.needsSecondPassForFixAll){makeChange3(e,n,a,r,t,o)}}));return createCodeFixActionWithoutFixAll("addMissingAwaitToInitializer",e,l.initializers.length===1?[wt.Add_await_to_initializer_for_0,l.initializers[0].declarationSymbol.name]:wt.Add_await_to_initializers)}}function getUseSiteFix(e,t,n,r,i,o){const a=i((i=>makeChange3(i,n,e.sourceFile,r,t,o)));return createCodeFixAction(ud,a,wt.Add_await,ud,wt.Fix_all_expressions_possibly_missing_await)}function isMissingAwaitError(e,t,n,r,i){const o=i.getTypeChecker();const a=o.getDiagnostics(e,r);return some(a,(({start:e,length:r,relatedInformation:i,code:o})=>isNumber(e)&&isNumber(r)&&textSpansEqual({start:e,length:r},n)&&o===t&&!!i&&some(i,(e=>e.code===wt.Did_you_forget_to_use_await.code))))}function findAwaitableInitializers(e,t,n,r,i){const o=getIdentifiersFromErrorSpanExpression(e,i);if(!o){return}let a=o.isCompleteFix;let s;for(const e of o.identifiers){const o=i.getSymbolAtLocation(e);if(!o){continue}const c=tryCast(o.valueDeclaration,isVariableDeclaration);const l=c&&tryCast(c.name,isIdentifier);const d=getAncestor(c,243);if(!c||!d||c.type||!c.initializer||d.getSourceFile()!==t||hasSyntacticModifier(d,32)||!l||!isInsideAwaitableBody(c.initializer)){a=false;continue}const p=r.getSemanticDiagnostics(t,n);const u=Rf.Core.eachSymbolReferenceInFile(l,i,t,(n=>e!==n&&!symbolReferenceIsAlsoMissingAwait(n,p,t,i)));if(u){a=false;continue}(s||(s=[])).push({expression:c.initializer,declarationSymbol:o})}return s&&{initializers:s,needsSecondPassForFixAll:!a}}function getIdentifiersFromErrorSpanExpression(e,t){if(isPropertyAccessExpression(e.parent)&&isIdentifier(e.parent.expression)){return{identifiers:[e.parent.expression],isCompleteFix:true}}if(isIdentifier(e)){return{identifiers:[e],isCompleteFix:true}}if(isBinaryExpression(e)){let n;let r=true;for(const i of[e.left,e.right]){const e=t.getTypeAtLocation(i);if(t.getPromisedTypeOfPromise(e)){if(!isIdentifier(i)){r=false;continue}(n||(n=[])).push(i)}}return n&&{identifiers:n,isCompleteFix:r}}}function symbolReferenceIsAlsoMissingAwait(e,t,n,r){const i=isPropertyAccessExpression(e.parent)?e.parent.name:isBinaryExpression(e.parent)?e.parent:e;const o=find(t,(e=>e.start===i.getStart(n)&&e.start+e.length===i.getEnd()));return o&&contains(_d,o.code)||r.getTypeAtLocation(i).flags&1}function isInsideAwaitableBody(e){return e.flags&65536||!!findAncestor(e,(e=>e.parent&&isArrowFunction(e.parent)&&e.parent.body===e||isBlock(e)&&(e.parent.kind===262||e.parent.kind===218||e.parent.kind===219||e.parent.kind===174)))}function makeChange3(e,t,n,r,i,o){if(isForOfStatement(i.parent)&&!i.parent.awaitModifier){const t=r.getTypeAtLocation(i);const o=r.getAnyAsyncIterableType();if(o&&r.isTypeAssignableTo(t,o)){const t=i.parent;e.replaceNode(n,t,zr.updateForOfStatement(t,zr.createToken(135),t.initializer,t.expression,t.statement));return}}if(isBinaryExpression(i)){for(const t of[i.left,i.right]){if(o&&isIdentifier(t)){const e=r.getSymbolAtLocation(t);if(e&&o.has(getSymbolId(e))){continue}}const i=r.getTypeAtLocation(t);const a=r.getPromisedTypeOfPromise(i)?zr.createAwaitExpression(t):t;e.replaceNode(n,t,a)}}else if(t===fd&&isPropertyAccessExpression(i.parent)){if(o&&isIdentifier(i.parent.expression)){const e=r.getSymbolAtLocation(i.parent.expression);if(e&&o.has(getSymbolId(e))){return}}e.replaceNode(n,i.parent.expression,zr.createParenthesizedExpression(zr.createAwaitExpression(i.parent.expression)));insertLeadingSemicolonIfNeeded(e,i.parent.expression,n)}else if(contains(md,t)&&isCallOrNewExpression(i.parent)){if(o&&isIdentifier(i)){const e=r.getSymbolAtLocation(i);if(e&&o.has(getSymbolId(e))){return}}e.replaceNode(n,i,zr.createParenthesizedExpression(zr.createAwaitExpression(i)));insertLeadingSemicolonIfNeeded(e,i,n)}else{if(o&&isVariableDeclaration(i.parent)&&isIdentifier(i.parent.name)){const e=r.getSymbolAtLocation(i.parent.name);if(e&&!tryAddToSet(o,getSymbolId(e))){return}}e.replaceNode(n,i,zr.createAwaitExpression(i))}}function insertLeadingSemicolonIfNeeded(e,t,n){const r=findPrecedingToken(t.pos,n);if(r&&positionIsASICandidate(r.end,r.parent,n)){e.insertText(n,t.getStart(n),";")}}var gd="addMissingConst";var yd=[wt.Cannot_find_name_0.code,wt.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code];registerCodeFix({errorCodes:yd,getCodeActions:function getCodeActionsToAddMissingConst(e){const t=dm.ChangeTracker.with(e,(t=>makeChange4(t,e.sourceFile,e.span.start,e.program)));if(t.length>0){return[createCodeFixAction(gd,t,wt.Add_const_to_unresolved_variable,gd,wt.Add_const_to_all_unresolved_variables)]}},fixIds:[gd],getAllCodeActions:e=>{const t=new Set;return codeFixAll(e,yd,((n,r)=>makeChange4(n,r.file,r.start,e.program,t)))}});function makeChange4(e,t,n,r,i){const o=getTokenAtPosition(t,n);const a=findAncestor(o,(e=>isForInOrOfStatement(e.parent)?e.parent.initializer===e:isPossiblyPartOfDestructuring(e)?false:"quit"));if(a)return applyChange(e,a,t,i);const s=o.parent;if(isBinaryExpression(s)&&s.operatorToken.kind===64&&isExpressionStatement(s.parent)){return applyChange(e,o,t,i)}if(isArrayLiteralExpression(s)){const n=r.getTypeChecker();if(!every(s.elements,(e=>arrayElementCouldBeVariableDeclaration(e,n)))){return}return applyChange(e,s,t,i)}const c=findAncestor(o,(e=>isExpressionStatement(e.parent)?true:isPossiblyPartOfCommaSeperatedInitializer(e)?false:"quit"));if(c){const n=r.getTypeChecker();if(!expressionCouldBeVariableDeclaration(c,n)){return}return applyChange(e,c,t,i)}}function applyChange(e,t,n,r){if(!r||tryAddToSet(r,t)){e.insertModifierBefore(n,87,t)}}function isPossiblyPartOfDestructuring(e){switch(e.kind){case 80:case 209:case 210:case 303:case 304:return true;default:return false}}function arrayElementCouldBeVariableDeclaration(e,t){const n=isIdentifier(e)?e:isAssignmentExpression(e,true)&&isIdentifier(e.left)?e.left:void 0;return!!n&&!t.getSymbolAtLocation(n)}function isPossiblyPartOfCommaSeperatedInitializer(e){switch(e.kind){case 80:case 226:case 28:return true;default:return false}}function expressionCouldBeVariableDeclaration(e,t){if(!isBinaryExpression(e)){return false}if(e.operatorToken.kind===28){return every([e.left,e.right],(e=>expressionCouldBeVariableDeclaration(e,t)))}return e.operatorToken.kind===64&&isIdentifier(e.left)&&!t.getSymbolAtLocation(e.left)}var hd="addMissingDeclareProperty";var Td=[wt.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code];registerCodeFix({errorCodes:Td,getCodeActions:function getCodeActionsToAddMissingDeclareOnProperty(e){const t=dm.ChangeTracker.with(e,(t=>makeChange5(t,e.sourceFile,e.span.start)));if(t.length>0){return[createCodeFixAction(hd,t,wt.Prefix_with_declare,hd,wt.Prefix_all_incorrect_property_declarations_with_declare)]}},fixIds:[hd],getAllCodeActions:e=>{const t=new Set;return codeFixAll(e,Td,((e,n)=>makeChange5(e,n.file,n.start,t)))}});function makeChange5(e,t,n,r){const i=getTokenAtPosition(t,n);if(!isIdentifier(i)){return}const o=i.parent;if(o.kind===172&&(!r||tryAddToSet(r,o))){e.insertModifierBefore(t,138,o)}}var Sd="addMissingInvocationForDecorator";var vd=[wt._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];registerCodeFix({errorCodes:vd,getCodeActions:function getCodeActionsToAddMissingInvocationForDecorator(e){const t=dm.ChangeTracker.with(e,(t=>makeChange6(t,e.sourceFile,e.span.start)));return[createCodeFixAction(Sd,t,wt.Call_decorator_expression,Sd,wt.Add_to_all_uncalled_decorators)]},fixIds:[Sd],getAllCodeActions:e=>codeFixAll(e,vd,((e,t)=>makeChange6(e,t.file,t.start)))});function makeChange6(e,t,n){const r=getTokenAtPosition(t,n);const i=findAncestor(r,isDecorator);S.assert(!!i,"Expected position to be owned by a decorator.");const o=zr.createCallExpression(i.expression,void 0,void 0);e.replaceNode(t,i.expression,o)}var xd="addMissingResolutionModeImportAttribute";var bd=[wt.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute.code,wt.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute.code];registerCodeFix({errorCodes:bd,getCodeActions:function getCodeActionsToAddMissingResolutionModeImportAttribute(e){const t=dm.ChangeTracker.with(e,(t=>makeChange7(t,e.sourceFile,e.span.start,e.program,e.host,e.preferences)));return[createCodeFixAction(xd,t,wt.Add_resolution_mode_import_attribute,xd,wt.Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it)]},fixIds:[xd],getAllCodeActions:e=>codeFixAll(e,bd,((t,n)=>makeChange7(t,n.file,n.start,e.program,e.host,e.preferences)))});function makeChange7(e,t,n,r,i,o){var a,s,c;const l=getTokenAtPosition(t,n);const d=findAncestor(l,or(isImportDeclaration,isImportTypeNode));S.assert(!!d,"Expected position to be owned by an ImportDeclaration or ImportType.");const p=getQuotePreference(t,o)===0;const u=tryGetModuleSpecifierFromDeclaration(d);const f=!u||((a=resolveModuleName(u.text,t.fileName,r.getCompilerOptions(),i,r.getModuleResolutionCache(),void 0,99).resolvedModule)==null?void 0:a.resolvedFileName)===((c=(s=r.getResolvedModuleFromModuleSpecifier(u,t))==null?void 0:s.resolvedModule)==null?void 0:c.resolvedFileName);const m=d.attributes?zr.updateImportAttributes(d.attributes,zr.createNodeArray([...d.attributes.elements,zr.createImportAttribute(zr.createStringLiteral("resolution-mode",p),zr.createStringLiteral(f?"import":"require",p))],d.attributes.elements.hasTrailingComma),d.attributes.multiLine):zr.createImportAttributes(zr.createNodeArray([zr.createImportAttribute(zr.createStringLiteral("resolution-mode",p),zr.createStringLiteral(f?"import":"require",p))]));if(d.kind===272){e.replaceNode(t,d,zr.updateImportDeclaration(d,d.modifiers,d.importClause,d.moduleSpecifier,m))}else{e.replaceNode(t,d,zr.updateImportTypeNode(d,d.argument,m,d.qualifier,d.typeArguments))}}var Cd="addNameToNamelessParameter";var Ed=[wt.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];registerCodeFix({errorCodes:Ed,getCodeActions:function getCodeActionsToAddNameToNamelessParameter(e){const t=dm.ChangeTracker.with(e,(t=>makeChange8(t,e.sourceFile,e.span.start)));return[createCodeFixAction(Cd,t,wt.Add_parameter_name,Cd,wt.Add_names_to_all_parameters_without_names)]},fixIds:[Cd],getAllCodeActions:e=>codeFixAll(e,Ed,((e,t)=>makeChange8(e,t.file,t.start)))});function makeChange8(e,t,n){const r=getTokenAtPosition(t,n);const i=r.parent;if(!isParameter(i)){return S.fail("Tried to add a parameter name to a non-parameter: "+S.formatSyntaxKind(r.kind))}const o=i.parent.parameters.indexOf(i);S.assert(!i.type,"Tried to add a parameter name to a parameter that already had one.");S.assert(o>-1,"Parameter not found in parent parameter list.");let a=i.name.getEnd();let s=zr.createTypeReferenceNode(i.name,void 0);let c=tryGetNextParam(t,i);while(c){s=zr.createArrayTypeNode(s);a=c.getEnd();c=tryGetNextParam(t,c)}const l=zr.createParameterDeclaration(i.modifiers,i.dotDotDotToken,"arg"+o,i.questionToken,i.dotDotDotToken&&!isArrayTypeNode(s)?zr.createArrayTypeNode(s):s,i.initializer);e.replaceRange(t,createRange(i.getStart(t),a),l)}function tryGetNextParam(e,t){const n=findNextToken(t.name,t.parent,e);if(n&&n.kind===23&&isArrayBindingPattern(n.parent)&&isParameter(n.parent.parent)){return n.parent.parent}return void 0}var Nd="addOptionalPropertyUndefined";var kd=[wt.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,wt.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code];registerCodeFix({errorCodes:kd,getCodeActions(e){const t=e.program.getTypeChecker();const n=getPropertiesToAdd(e.sourceFile,e.span,t);if(!n.length){return void 0}const r=dm.ChangeTracker.with(e,(e=>addUndefinedToOptionalProperty(e,n)));return[createCodeFixActionWithoutFixAll(Nd,r,wt.Add_undefined_to_optional_property_type)]},fixIds:[Nd]});function getPropertiesToAdd(e,t,n){var r,i;const o=getSourceTarget(getFixableErrorSpanExpression(e,t),n);if(!o){return d}const{source:a,target:s}=o;const c=shouldUseParentTypeOfProperty(a,s,n)?n.getTypeAtLocation(s.expression):n.getTypeAtLocation(s);if((i=(r=c.symbol)==null?void 0:r.declarations)==null?void 0:i.some((e=>getSourceFileOfNode(e).fileName.match(/\.d\.ts$/)))){return d}return n.getExactOptionalProperties(c)}function shouldUseParentTypeOfProperty(e,t,n){return isPropertyAccessExpression(t)&&!!n.getExactOptionalProperties(n.getTypeAtLocation(t.expression)).length&&n.getTypeAtLocation(e)===n.getUndefinedType()}function getSourceTarget(e,t){var n;if(!e){return void 0}else if(isBinaryExpression(e.parent)&&e.parent.operatorToken.kind===64){return{source:e.parent.right,target:e.parent.left}}else if(isVariableDeclaration(e.parent)&&e.parent.initializer){return{source:e.parent.initializer,target:e.parent.name}}else if(isCallExpression(e.parent)){const n=t.getSymbolAtLocation(e.parent.expression);if(!(n==null?void 0:n.valueDeclaration)||!isFunctionLikeKind(n.valueDeclaration.kind))return void 0;if(!isExpression(e))return void 0;const r=e.parent.arguments.indexOf(e);if(r===-1)return void 0;const i=n.valueDeclaration.parameters[r].name;if(isIdentifier(i))return{source:e,target:i}}else if(isPropertyAssignment(e.parent)&&isIdentifier(e.parent.name)||isShorthandPropertyAssignment(e.parent)){const r=getSourceTarget(e.parent.parent,t);if(!r)return void 0;const i=t.getPropertyOfType(t.getTypeAtLocation(r.target),e.parent.name.text);const o=(n=i==null?void 0:i.declarations)==null?void 0:n[0];if(!o)return void 0;return{source:isPropertyAssignment(e.parent)?e.parent.initializer:e.parent.name,target:o}}return void 0}function addUndefinedToOptionalProperty(e,t){for(const n of t){const t=n.valueDeclaration;if(t&&(isPropertySignature(t)||isPropertyDeclaration(t))&&t.type){const n=zr.createUnionTypeNode([...t.type.kind===192?t.type.types:[t.type],zr.createTypeReferenceNode("undefined")]);e.replaceNode(t.getSourceFile(),t.type,n)}}}var Fd="annotateWithTypeFromJSDoc";var Pd=[wt.JSDoc_types_may_be_moved_to_TypeScript_types.code];registerCodeFix({errorCodes:Pd,getCodeActions(e){const t=getDeclaration(e.sourceFile,e.span.start);if(!t)return;const n=dm.ChangeTracker.with(e,(n=>doChange8(n,e.sourceFile,t)));return[createCodeFixAction(Fd,n,wt.Annotate_with_type_from_JSDoc,Fd,wt.Annotate_everything_with_types_from_JSDoc)]},fixIds:[Fd],getAllCodeActions:e=>codeFixAll(e,Pd,((e,t)=>{const n=getDeclaration(t.file,t.start);if(n)doChange8(e,t.file,n)}))});function getDeclaration(e,t){const n=getTokenAtPosition(e,t);return tryCast(isParameter(n.parent)?n.parent.parent:n.parent,parameterShouldGetTypeFromJSDoc)}function parameterShouldGetTypeFromJSDoc(e){return isDeclarationWithType(e)&&hasUsableJSDoc(e)}function hasUsableJSDoc(e){return isFunctionLikeDeclaration(e)?e.parameters.some(hasUsableJSDoc)||!e.type&&!!getJSDocReturnType(e):!e.type&&!!getJSDocType(e)}function doChange8(e,t,n){if(isFunctionLikeDeclaration(n)&&(getJSDocReturnType(n)||n.parameters.some((e=>!!getJSDocType(e))))){if(!n.typeParameters){const r=getJSDocTypeParameterDeclarations(n);if(r.length)e.insertTypeParameters(t,n,r)}const r=isArrowFunction(n)&&!findChildOfKind(n,21,t);if(r)e.insertNodeBefore(t,first(n.parameters),zr.createToken(21));for(const r of n.parameters){if(!r.type){const n=getJSDocType(r);if(n)e.tryInsertTypeAnnotation(t,r,visitNode(n,transformJSDocType,isTypeNode))}}if(r)e.insertNodeAfter(t,last(n.parameters),zr.createToken(22));if(!n.type){const r=getJSDocReturnType(n);if(r)e.tryInsertTypeAnnotation(t,n,visitNode(r,transformJSDocType,isTypeNode))}}else{const r=S.checkDefined(getJSDocType(n),"A JSDocType for this declaration should exist");S.assert(!n.type,"The JSDocType decl should have a type");e.tryInsertTypeAnnotation(t,n,visitNode(r,transformJSDocType,isTypeNode))}}function isDeclarationWithType(e){return isFunctionLikeDeclaration(e)||e.kind===260||e.kind===171||e.kind===172}function transformJSDocType(e){switch(e.kind){case 312:case 313:return zr.createTypeReferenceNode("any",d);case 316:return transformJSDocOptionalType(e);case 315:return transformJSDocType(e.type);case 314:return transformJSDocNullableType(e);case 318:return transformJSDocVariadicType(e);case 317:return transformJSDocFunctionType(e);case 183:return transformJSDocTypeReference(e);case 322:return transformJSDocTypeLiteral(e);default:const t=visitEachChild(e,transformJSDocType,void 0);setEmitFlags(t,1);return t}}function transformJSDocTypeLiteral(e){const t=zr.createTypeLiteralNode(map(e.jsDocPropertyTags,(e=>zr.createPropertySignature(void 0,isIdentifier(e.name)?e.name:e.name.right,isOptionalJSDocPropertyLikeTag(e)?zr.createToken(58):void 0,e.typeExpression&&visitNode(e.typeExpression.type,transformJSDocType,isTypeNode)||zr.createKeywordTypeNode(133)))));setEmitFlags(t,1);return t}function transformJSDocOptionalType(e){return zr.createUnionTypeNode([visitNode(e.type,transformJSDocType,isTypeNode),zr.createTypeReferenceNode("undefined",d)])}function transformJSDocNullableType(e){return zr.createUnionTypeNode([visitNode(e.type,transformJSDocType,isTypeNode),zr.createTypeReferenceNode("null",d)])}function transformJSDocVariadicType(e){return zr.createArrayTypeNode(visitNode(e.type,transformJSDocType,isTypeNode))}function transformJSDocFunctionType(e){return zr.createFunctionTypeNode(d,e.parameters.map(transformJSDocParameter),e.type??zr.createKeywordTypeNode(133))}function transformJSDocParameter(e){const t=e.parent.parameters.indexOf(e);const n=e.type.kind===318&&t===e.parent.parameters.length-1;const r=e.name||(n?"rest":"arg"+t);const i=n?zr.createToken(26):e.dotDotDotToken;return zr.createParameterDeclaration(e.modifiers,i,r,e.questionToken,visitNode(e.type,transformJSDocType,isTypeNode),e.initializer)}function transformJSDocTypeReference(e){let t=e.typeName;let n=e.typeArguments;if(isIdentifier(e.typeName)){if(isJSDocIndexSignature(e)){return transformJSDocIndexSignature(e)}let r=e.typeName.text;switch(e.typeName.text){case"String":case"Boolean":case"Object":case"Number":r=r.toLowerCase();break;case"array":case"date":case"promise":r=r[0].toUpperCase()+r.slice(1);break}t=zr.createIdentifier(r);if((r==="Array"||r==="Promise")&&!e.typeArguments){n=zr.createNodeArray([zr.createTypeReferenceNode("any",d)])}else{n=visitNodes2(e.typeArguments,transformJSDocType,isTypeNode)}}return zr.createTypeReferenceNode(t,n)}function transformJSDocIndexSignature(e){const t=zr.createParameterDeclaration(void 0,void 0,e.typeArguments[0].kind===150?"n":"s",void 0,zr.createTypeReferenceNode(e.typeArguments[0].kind===150?"number":"string",[]),void 0);const n=zr.createTypeLiteralNode([zr.createIndexSignature(void 0,[t],e.typeArguments[1])]);setEmitFlags(n,1);return n}var Dd="convertFunctionToEs6Class";var Id=[wt.This_constructor_function_may_be_converted_to_a_class_declaration.code];registerCodeFix({errorCodes:Id,getCodeActions(e){const t=dm.ChangeTracker.with(e,(t=>doChange9(t,e.sourceFile,e.span.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions())));return[createCodeFixAction(Dd,t,wt.Convert_function_to_an_ES2015_class,Dd,wt.Convert_all_constructor_functions_to_classes)]},fixIds:[Dd],getAllCodeActions:e=>codeFixAll(e,Id,((t,n)=>doChange9(t,n.file,n.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions())))});function doChange9(e,t,n,r,i,o){const a=r.getSymbolAtLocation(getTokenAtPosition(t,n));if(!a||!a.valueDeclaration||!(a.flags&(16|3))){return void 0}const s=a.valueDeclaration;if(isFunctionDeclaration(s)||isFunctionExpression(s)){e.replaceNode(t,s,createClassFromFunction(s))}else if(isVariableDeclaration(s)){const n=createClassFromVariableDeclaration(s);if(!n){return void 0}const r=s.parent.parent;if(isVariableDeclarationList(s.parent)&&s.parent.declarations.length>1){e.delete(t,s);e.insertNodeAfter(t,r,n)}else{e.replaceNode(t,r,n)}}function createClassElementsFromSymbol(n){const r=[];if(n.exports){n.exports.forEach((e=>{if(e.name==="prototype"&&e.declarations){const t=e.declarations[0];if(e.declarations.length===1&&isPropertyAccessExpression(t)&&isBinaryExpression(t.parent)&&t.parent.operatorToken.kind===64&&isObjectLiteralExpression(t.parent.right)){const e=t.parent.right;createClassElement(e.symbol,void 0,r)}}else{createClassElement(e,[zr.createToken(126)],r)}}))}if(n.members){n.members.forEach(((i,o)=>{var a,s,c,l;if(o==="constructor"&&i.valueDeclaration){const r=(l=(c=(s=(a=n.exports)==null?void 0:a.get("prototype"))==null?void 0:s.declarations)==null?void 0:c[0])==null?void 0:l.parent;if(r&&isBinaryExpression(r)&&isObjectLiteralExpression(r.right)&&some(r.right.properties,isConstructorAssignment)){}else{e.delete(t,i.valueDeclaration.parent)}return}createClassElement(i,void 0,r)}))}return r;function shouldConvertDeclaration(e,t){if(isAccessExpression(e)){if(isPropertyAccessExpression(e)&&isConstructorAssignment(e))return true;return isFunctionLike(t)}else{return every(e.properties,(e=>{if(isMethodDeclaration(e)||isGetOrSetAccessorDeclaration(e))return true;if(isPropertyAssignment(e)&&isFunctionExpression(e.initializer)&&!!e.name)return true;if(isConstructorAssignment(e))return true;return false}))}}function createClassElement(n,r,a){if(!(n.flags&8192)&&!(n.flags&4096)){return}const s=n.valueDeclaration;const c=s.parent;const l=c.right;if(!shouldConvertDeclaration(s,l)){return}if(some(a,(e=>{const t=getNameOfDeclaration(e);if(t&&isIdentifier(t)&&idText(t)===symbolName(n)){return true}return false}))){return}const d=c.parent&&c.parent.kind===244?c.parent:c;e.delete(t,d);if(!l){a.push(zr.createPropertyDeclaration(r,n.name,void 0,void 0,void 0));return}if(isAccessExpression(s)&&(isFunctionExpression(l)||isArrowFunction(l))){const e=getQuotePreference(t,i);const n=tryGetPropertyName(s,o,e);if(n){createFunctionLikeExpressionMember(a,l,n)}return}else if(isObjectLiteralExpression(l)){forEach(l.properties,(e=>{if(isMethodDeclaration(e)||isGetOrSetAccessorDeclaration(e)){a.push(e)}if(isPropertyAssignment(e)&&isFunctionExpression(e.initializer)){createFunctionLikeExpressionMember(a,e.initializer,e.name)}if(isConstructorAssignment(e))return;return}));return}else{if(isSourceFileJS(t))return;if(!isPropertyAccessExpression(s))return;const e=zr.createPropertyDeclaration(r,s.name,void 0,void 0,l);copyLeadingComments(c.parent,e,t);a.push(e);return}function createFunctionLikeExpressionMember(e,t,n){if(isFunctionExpression(t))return createFunctionExpressionMember(e,t,n);else return createArrowFunctionExpressionMember(e,t,n)}function createFunctionExpressionMember(e,n,i){const o=concatenate(r,getModifierKindFromSource(n,134));const a=zr.createMethodDeclaration(o,void 0,i,void 0,void 0,n.parameters,void 0,n.body);copyLeadingComments(c,a,t);e.push(a);return}function createArrowFunctionExpressionMember(e,n,i){const o=n.body;let a;if(o.kind===241){a=o}else{a=zr.createBlock([zr.createReturnStatement(o)])}const s=concatenate(r,getModifierKindFromSource(n,134));const l=zr.createMethodDeclaration(s,void 0,i,void 0,void 0,n.parameters,void 0,a);copyLeadingComments(c,l,t);e.push(l)}}}function createClassFromVariableDeclaration(e){const t=e.initializer;if(!t||!isFunctionExpression(t)||!isIdentifier(e.name)){return void 0}const n=createClassElementsFromSymbol(e.symbol);if(t.body){n.unshift(zr.createConstructorDeclaration(void 0,t.parameters,t.body))}const r=getModifierKindFromSource(e.parent.parent,95);const i=zr.createClassDeclaration(r,e.name,void 0,void 0,n);return i}function createClassFromFunction(e){const t=createClassElementsFromSymbol(a);if(e.body){t.unshift(zr.createConstructorDeclaration(void 0,e.parameters,e.body))}const n=getModifierKindFromSource(e,95);const r=zr.createClassDeclaration(n,e.name,void 0,void 0,t);return r}}function getModifierKindFromSource(e,t){return canHaveModifiers(e)?filter(e.modifiers,(e=>e.kind===t)):void 0}function isConstructorAssignment(e){if(!e.name)return false;if(isIdentifier(e.name)&&e.name.text==="constructor")return true;return false}function tryGetPropertyName(e,t,n){if(isPropertyAccessExpression(e)){return e.name}const r=e.argumentExpression;if(isNumericLiteral(r)){return r}if(isStringLiteralLike(r)){return isIdentifierText(r.text,zn(t))?zr.createIdentifier(r.text):isNoSubstitutionTemplateLiteral(r)?zr.createStringLiteral(r.text,n===0):r}return void 0}var Ad="convertToAsyncFunction";var Od=[wt.This_may_be_converted_to_an_async_function.code];var wd=true;registerCodeFix({errorCodes:Od,getCodeActions(e){wd=true;const t=dm.ChangeTracker.with(e,(t=>convertToAsyncFunction(t,e.sourceFile,e.span.start,e.program.getTypeChecker())));return wd?[createCodeFixAction(Ad,t,wt.Convert_to_async_function,Ad,wt.Convert_all_to_async_functions)]:[]},fixIds:[Ad],getAllCodeActions:e=>codeFixAll(e,Od,((t,n)=>convertToAsyncFunction(t,n.file,n.start,e.program.getTypeChecker())))});function convertToAsyncFunction(e,t,n,r){const i=getTokenAtPosition(t,n);let o;if(isIdentifier(i)&&isVariableDeclaration(i.parent)&&i.parent.initializer&&isFunctionLikeDeclaration(i.parent.initializer)){o=i.parent.initializer}else{o=tryCast(getContainingFunction(getTokenAtPosition(t,n)),canBeConvertedToAsync)}if(!o){return}const a=new Map;const s=isInJSFile(o);const c=getAllPromiseExpressionsToReturn(o,r);const l=renameCollidingVarNames(o,r,a);if(!returnsPromise(l,r)){return}const p=l.body&&isBlock(l.body)?getReturnStatementsWithPromiseHandlers(l.body,r):d;const u={checker:r,synthNamesMap:a,setOfExpressionsToReturn:c,isInJSFile:s};if(!p.length){return}const f=skipTrivia(t.text,moveRangePastModifiers(o).pos);e.insertModifierAt(t,f,134,{suffix:" "});for(const n of p){forEachChild(n,(function visit(r){if(isCallExpression(r)){const i=transformExpression(r,r,u,false);if(hasFailed()){return true}e.replaceNodeWithNodes(t,n,i)}else if(!isFunctionLike(r)){forEachChild(r,visit);if(hasFailed()){return true}}}));if(hasFailed()){return}}}function getReturnStatementsWithPromiseHandlers(e,t){const n=[];forEachReturnStatement(e,(e=>{if(isReturnStatementWithFixablePromiseHandler(e,t))n.push(e)}));return n}function getAllPromiseExpressionsToReturn(e,t){if(!e.body){return new Set}const n=new Set;forEachChild(e.body,(function visit(e){if(isPromiseReturningCallExpression(e,t,"then")){n.add(getNodeId(e));forEach(e.arguments,visit)}else if(isPromiseReturningCallExpression(e,t,"catch")||isPromiseReturningCallExpression(e,t,"finally")){n.add(getNodeId(e));forEachChild(e,visit)}else if(isPromiseTypedExpression(e,t)){n.add(getNodeId(e))}else{forEachChild(e,visit)}}));return n}function isPromiseReturningCallExpression(e,t,n){if(!isCallExpression(e))return false;const r=hasPropertyAccessExpressionWithName(e,n);const i=r&&t.getTypeAtLocation(e);return!!(i&&t.getPromisedTypeOfPromise(i))}function isReferenceToType(e,t){return(getObjectFlags(e)&4)!==0&&e.target===t}function getExplicitPromisedTypeOfPromiseReturningCallExpression(e,t,n){if(e.expression.name.escapedText==="finally"){return void 0}const r=n.getTypeAtLocation(e.expression.expression);if(isReferenceToType(r,n.getPromiseType())||isReferenceToType(r,n.getPromiseLikeType())){if(e.expression.name.escapedText==="then"){if(t===u(e.arguments,0)){return u(e.typeArguments,0)}else if(t===u(e.arguments,1)){return u(e.typeArguments,1)}}else{return u(e.typeArguments,0)}}}function isPromiseTypedExpression(e,t){if(!isExpression(e))return false;return!!t.getPromisedTypeOfPromise(t.getTypeAtLocation(e))}function renameCollidingVarNames(e,t,n){const r=new Map;const i=createMultiMap();forEachChild(e,(function visit(e){if(!isIdentifier(e)){forEachChild(e,visit);return}const o=t.getSymbolAtLocation(e);if(o){const a=t.getTypeAtLocation(e);const s=getLastCallSignature(a,t);const c=getSymbolId(o).toString();if(s&&!isParameter(e.parent)&&!isFunctionLikeDeclaration(e.parent)&&!n.has(c)){const e=firstOrUndefined(s.parameters);const t=(e==null?void 0:e.valueDeclaration)&&isParameter(e.valueDeclaration)&&tryCast(e.valueDeclaration.name,isIdentifier)||zr.createUniqueName("result",16);const r=getNewNameIfConflict(t,i);n.set(c,r);i.add(t.text,o)}else if(e.parent&&(isParameter(e.parent)||isVariableDeclaration(e.parent)||isBindingElement(e.parent))){const t=e.text;const a=i.get(t);if(a&&a.some((e=>e!==o))){const a=getNewNameIfConflict(e,i);r.set(c,a.identifier);n.set(c,a);i.add(t,o)}else{const r=getSynthesizedDeepClone(e);n.set(c,createSynthIdentifier(r));i.add(t,o)}}}}));return getSynthesizedDeepCloneWithReplacements(e,true,(e=>{if(isBindingElement(e)&&isIdentifier(e.name)&&isObjectBindingPattern(e.parent)){const n=t.getSymbolAtLocation(e.name);const i=n&&r.get(String(getSymbolId(n)));if(i&&i.text!==(e.name||e.propertyName).getText()){return zr.createBindingElement(e.dotDotDotToken,e.propertyName||e.name,i,e.initializer)}}else if(isIdentifier(e)){const n=t.getSymbolAtLocation(e);const i=n&&r.get(String(getSymbolId(n)));if(i){return zr.createIdentifier(i.text)}}}))}function getNewNameIfConflict(e,t){const n=(t.get(e.text)||d).length;const r=n===0?e:zr.createIdentifier(e.text+"_"+n);return createSynthIdentifier(r)}function hasFailed(){return!wd}function silentFail(){wd=false;return d}function transformExpression(e,t,n,r,i){if(isPromiseReturningCallExpression(t,n.checker,"then")){return transformThen(t,u(t.arguments,0),u(t.arguments,1),n,r,i)}if(isPromiseReturningCallExpression(t,n.checker,"catch")){return transformCatch(t,u(t.arguments,0),n,r,i)}if(isPromiseReturningCallExpression(t,n.checker,"finally")){return transformFinally(t,u(t.arguments,0),n,r,i)}if(isPropertyAccessExpression(t)){return transformExpression(e,t.expression,n,r,i)}const o=n.checker.getTypeAtLocation(t);if(o&&n.checker.getPromisedTypeOfPromise(o)){S.assertNode(getOriginalNode(t).parent,isPropertyAccessExpression);return transformPromiseExpressionOfPropertyAccess(e,t,n,r,i)}return silentFail()}function isNullOrUndefined2({checker:e},t){if(t.kind===106)return true;if(isIdentifier(t)&&!isGeneratedIdentifier(t)&&idText(t)==="undefined"){const n=e.getSymbolAtLocation(t);return!n||e.isUndefinedSymbol(n)}return false}function createUniqueSynthName(e){const t=zr.createUniqueName(e.identifier.text,16);return createSynthIdentifier(t)}function getPossibleNameForVarDecl(e,t,n){let r;if(n&&!shouldReturn(e,t)){if(isSynthIdentifier(n)){r=n;t.synthNamesMap.forEach(((e,r)=>{if(e.identifier.text===n.identifier.text){const e=createUniqueSynthName(n);t.synthNamesMap.set(r,e)}}))}else{r=createSynthIdentifier(zr.createUniqueName("result",16),n.types)}declareSynthIdentifier(r)}return r}function finishCatchOrFinallyTransform(e,t,n,r,i){const o=[];let a;if(r&&!shouldReturn(e,t)){a=getSynthesizedDeepClone(declareSynthIdentifier(r));const e=r.types;const n=t.checker.getUnionType(e,2);const i=t.isInJSFile?void 0:t.checker.typeToTypeNode(n,void 0,void 0);const s=[zr.createVariableDeclaration(a,void 0,i)];const c=zr.createVariableStatement(void 0,zr.createVariableDeclarationList(s,1));o.push(c)}o.push(n);if(i&&a&&isSynthBindingPattern(i)){o.push(zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(getSynthesizedDeepClone(declareSynthBindingPattern(i)),void 0,void 0,a)],2)))}return o}function transformFinally(e,t,n,r,i){if(!t||isNullOrUndefined2(n,t)){return transformExpression(e,e.expression.expression,n,r,i)}const o=getPossibleNameForVarDecl(e,n,i);const a=transformExpression(e,e.expression.expression,n,true,o);if(hasFailed())return silentFail();const s=transformCallbackArgument(t,r,void 0,void 0,e,n);if(hasFailed())return silentFail();const c=zr.createBlock(a);const l=zr.createBlock(s);const d=zr.createTryStatement(c,void 0,l);return finishCatchOrFinallyTransform(e,n,d,o,i)}function transformCatch(e,t,n,r,i){if(!t||isNullOrUndefined2(n,t)){return transformExpression(e,e.expression.expression,n,r,i)}const o=getArgBindingName(t,n);const a=getPossibleNameForVarDecl(e,n,i);const s=transformExpression(e,e.expression.expression,n,true,a);if(hasFailed())return silentFail();const c=transformCallbackArgument(t,r,a,o,e,n);if(hasFailed())return silentFail();const l=zr.createBlock(s);const d=zr.createCatchClause(o&&getSynthesizedDeepClone(declareSynthBindingName(o)),zr.createBlock(c));const p=zr.createTryStatement(l,d,void 0);return finishCatchOrFinallyTransform(e,n,p,a,i)}function transformThen(e,t,n,r,i,o){if(!t||isNullOrUndefined2(r,t)){return transformCatch(e,n,r,i,o)}if(n&&!isNullOrUndefined2(r,n)){return silentFail()}const a=getArgBindingName(t,r);const s=transformExpression(e.expression.expression,e.expression.expression,r,true,a);if(hasFailed())return silentFail();const c=transformCallbackArgument(t,i,o,a,e,r);if(hasFailed())return silentFail();return concatenate(s,c)}function transformPromiseExpressionOfPropertyAccess(e,t,n,r,i){if(shouldReturn(e,n)){let e=getSynthesizedDeepClone(t);if(r){e=zr.createAwaitExpression(e)}return[zr.createReturnStatement(e)]}return createVariableOrAssignmentOrExpressionStatement(i,zr.createAwaitExpression(t),void 0)}function createVariableOrAssignmentOrExpressionStatement(e,t,n){if(!e||isEmptyBindingName(e)){return[zr.createExpressionStatement(t)]}if(isSynthIdentifier(e)&&e.hasBeenDeclared){return[zr.createExpressionStatement(zr.createAssignment(getSynthesizedDeepClone(referenceSynthIdentifier(e)),t))]}return[zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(getSynthesizedDeepClone(declareSynthBindingName(e)),void 0,n,t)],2))]}function maybeAnnotateAndReturn(e,t){if(t&&e){const n=zr.createUniqueName("result",16);return[...createVariableOrAssignmentOrExpressionStatement(createSynthIdentifier(n),e,t),zr.createReturnStatement(n)]}return[zr.createReturnStatement(e)]}function transformCallbackArgument(e,t,n,r,i,o){var a;switch(e.kind){case 106:break;case 211:case 80:if(!r){break}const s=zr.createCallExpression(getSynthesizedDeepClone(e),void 0,isSynthIdentifier(r)?[referenceSynthIdentifier(r)]:[]);if(shouldReturn(i,o)){return maybeAnnotateAndReturn(s,getExplicitPromisedTypeOfPromiseReturningCallExpression(i,e,o.checker))}const c=o.checker.getTypeAtLocation(e);const l=o.checker.getSignaturesOfType(c,0);if(!l.length){return silentFail()}const p=l[0].getReturnType();const u=createVariableOrAssignmentOrExpressionStatement(n,zr.createAwaitExpression(s),getExplicitPromisedTypeOfPromiseReturningCallExpression(i,e,o.checker));if(n){n.types.push(o.checker.getAwaitedType(p)||p)}return u;case 218:case 219:{const r=e.body;const s=(a=getLastCallSignature(o.checker.getTypeAtLocation(e),o.checker))==null?void 0:a.getReturnType();if(isBlock(r)){let a=[];let c=false;for(const l of r.statements){if(isReturnStatement(l)){c=true;if(isReturnStatementWithFixablePromiseHandler(l,o.checker)){a=a.concat(transformReturnStatementWithFixablePromiseHandler(o,l,t,n))}else{const t=s&&l.expression?getPossiblyAwaitedRightHandSide(o.checker,s,l.expression):l.expression;a.push(...maybeAnnotateAndReturn(t,getExplicitPromisedTypeOfPromiseReturningCallExpression(i,e,o.checker)))}}else if(t&&forEachReturnStatement(l,returnTrue)){return silentFail()}else{a.push(l)}}return shouldReturn(i,o)?a.map((e=>getSynthesizedDeepClone(e))):removeReturns(a,n,o,c)}else{const a=isFixablePromiseHandler(r,o.checker)?transformReturnStatementWithFixablePromiseHandler(o,zr.createReturnStatement(r),t,n):d;if(a.length>0){return a}if(s){const t=getPossiblyAwaitedRightHandSide(o.checker,s,r);if(!shouldReturn(i,o)){const e=createVariableOrAssignmentOrExpressionStatement(n,t,void 0);if(n){n.types.push(o.checker.getAwaitedType(s)||s)}return e}else{return maybeAnnotateAndReturn(t,getExplicitPromisedTypeOfPromiseReturningCallExpression(i,e,o.checker))}}else{return silentFail()}}}default:return silentFail()}return d}function getPossiblyAwaitedRightHandSide(e,t,n){const r=getSynthesizedDeepClone(n);return!!e.getPromisedTypeOfPromise(t)?zr.createAwaitExpression(r):r}function getLastCallSignature(e,t){const n=t.getSignaturesOfType(e,0);return lastOrUndefined(n)}function removeReturns(e,t,n,r){const i=[];for(const r of e){if(isReturnStatement(r)){if(r.expression){const e=isPromiseTypedExpression(r.expression,n.checker)?zr.createAwaitExpression(r.expression):r.expression;if(t===void 0){i.push(zr.createExpressionStatement(e))}else if(isSynthIdentifier(t)&&t.hasBeenDeclared){i.push(zr.createExpressionStatement(zr.createAssignment(referenceSynthIdentifier(t),e)))}else{i.push(zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(declareSynthBindingName(t),void 0,void 0,e)],2)))}}}else{i.push(getSynthesizedDeepClone(r))}}if(!r&&t!==void 0){i.push(zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(declareSynthBindingName(t),void 0,void 0,zr.createIdentifier("undefined"))],2)))}return i}function transformReturnStatementWithFixablePromiseHandler(e,t,n,r){let i=[];forEachChild(t,(function visit(t){if(isCallExpression(t)){const o=transformExpression(t,t,e,n,r);i=i.concat(o);if(i.length>0){return}}else if(!isFunctionLike(t)){forEachChild(t,visit)}}));return i}function getArgBindingName(e,t){const n=[];let r;if(isFunctionLikeDeclaration(e)){if(e.parameters.length>0){const t=e.parameters[0].name;r=getMappedBindingNameOrDefault(t)}}else if(isIdentifier(e)){r=getMapEntryOrDefault(e)}else if(isPropertyAccessExpression(e)&&isIdentifier(e.name)){r=getMapEntryOrDefault(e.name)}if(!r||"identifier"in r&&r.identifier.text==="undefined"){return void 0}return r;function getMappedBindingNameOrDefault(e){if(isIdentifier(e))return getMapEntryOrDefault(e);const t=flatMap(e.elements,(e=>{if(isOmittedExpression(e))return[];return[getMappedBindingNameOrDefault(e.name)]}));return createSynthBindingPattern(e,t)}function getMapEntryOrDefault(e){const r=getOriginalNode2(e);const i=getSymbol2(r);if(!i){return createSynthIdentifier(e,n)}const o=t.synthNamesMap.get(getSymbolId(i).toString());return o||createSynthIdentifier(e,n)}function getSymbol2(e){var n;return((n=tryCast(e,canHaveSymbol))==null?void 0:n.symbol)??t.checker.getSymbolAtLocation(e)}function getOriginalNode2(e){return e.original?e.original:e}}function isEmptyBindingName(e){if(!e){return true}if(isSynthIdentifier(e)){return!e.identifier.text}return every(e.elements,isEmptyBindingName)}function createSynthIdentifier(e,t=[]){return{kind:0,identifier:e,types:t,hasBeenDeclared:false,hasBeenReferenced:false}}function createSynthBindingPattern(e,t=d,n=[]){return{kind:1,bindingPattern:e,elements:t,types:n}}function referenceSynthIdentifier(e){e.hasBeenReferenced=true;return e.identifier}function declareSynthBindingName(e){return isSynthIdentifier(e)?declareSynthIdentifier(e):declareSynthBindingPattern(e)}function declareSynthBindingPattern(e){for(const t of e.elements){declareSynthBindingName(t)}return e.bindingPattern}function declareSynthIdentifier(e){e.hasBeenDeclared=true;return e.identifier}function isSynthIdentifier(e){return e.kind===0}function isSynthBindingPattern(e){return e.kind===1}function shouldReturn(e,t){return!!e.original&&t.setOfExpressionsToReturn.has(getNodeId(e.original))}registerCodeFix({errorCodes:[wt.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],getCodeActions(e){const{sourceFile:t,program:n,preferences:r}=e;const i=dm.ChangeTracker.with(e,(e=>{const i=convertFileToEsModule(t,n.getTypeChecker(),e,zn(n.getCompilerOptions()),getQuotePreference(t,r));if(i){for(const i of n.getSourceFiles()){fixImportOfModuleExports(i,t,n,e,getQuotePreference(i,r))}}}));return[createCodeFixActionWithoutFixAll("convertToEsModule",i,wt.Convert_to_ES_module)]}});function fixImportOfModuleExports(e,t,n,r,i){var o;for(const a of e.imports){const s=(o=n.getResolvedModuleFromModuleSpecifier(a,e))==null?void 0:o.resolvedModule;if(!s||s.resolvedFileName!==t.fileName){continue}const c=importFromModuleSpecifier(a);switch(c.kind){case 271:r.replaceNode(e,c,makeImport(c.name,void 0,a,i));break;case 213:if(isRequireCall(c,false)){r.replaceNode(e,c,zr.createPropertyAccessExpression(getSynthesizedDeepClone(c),"default"))}break}}}function convertFileToEsModule(e,t,n,r,i){const o={original:collectFreeIdentifiers(e),additional:new Set};const a=collectExportRenames(e,t,o);convertExportsAccesses(e,a,n);let s=false;let c;for(const a of filter(e.statements,isVariableStatement)){const s=convertVariableStatement(e,a,n,t,o,r,i);if(s){copyEntries(s,c??(c=new Map))}}for(const l of filter(e.statements,(e=>!isVariableStatement(e)))){const d=convertStatement(e,l,t,n,o,r,a,c,i);s=s||d}c==null?void 0:c.forEach(((t,r)=>{n.replaceNode(e,r,t)}));return s}function collectExportRenames(e,t,n){const r=new Map;forEachExportReference(e,(e=>{const{text:i}=e.name;if(!r.has(i)&&(isIdentifierANonContextualKeyword(e.name)||t.resolveName(i,e,111551,true))){r.set(i,makeUniqueName(`_${i}`,n))}}));return r}function convertExportsAccesses(e,t,n){forEachExportReference(e,((r,i)=>{if(i){return}const{text:o}=r.name;n.replaceNode(e,r,zr.createIdentifier(t.get(o)||o))}))}function forEachExportReference(e,t){e.forEachChild((function recur(n){if(isPropertyAccessExpression(n)&&isExportsOrModuleExportsOrAlias(e,n.expression)&&isIdentifier(n.name)){const{parent:e}=n;t(n,isBinaryExpression(e)&&e.left===n&&e.operatorToken.kind===64)}n.forEachChild(recur)}))}function convertStatement(e,t,n,r,i,o,a,s,c){switch(t.kind){case 243:convertVariableStatement(e,t,r,n,i,o,c);return false;case 244:{const{expression:i}=t;switch(i.kind){case 213:{if(isRequireCall(i,true)){r.replaceNode(e,t,makeImport(void 0,void 0,i.arguments[0],c))}return false}case 226:{const{operatorToken:t}=i;return t.kind===64&&convertAssignment(e,n,i,r,a,s)}}}default:return false}}function convertVariableStatement(e,t,n,r,i,o,a){const{declarationList:s}=t;let c=false;const l=map(s.declarations,(t=>{const{name:n,initializer:l}=t;if(l){if(isExportsOrModuleExportsOrAlias(e,l)){c=true;return convertedImports([])}else if(isRequireCall(l,true)){c=true;return convertSingleImport(n,l.arguments[0],r,i,o,a)}else if(isPropertyAccessExpression(l)&&isRequireCall(l.expression,true)){c=true;return convertPropertyAccessImport(n,l.name.text,l.expression.arguments[0],i,a)}}return convertedImports([zr.createVariableStatement(void 0,zr.createVariableDeclarationList([t],s.flags))])}));if(c){n.replaceNodeWithNodes(e,t,flatMap(l,(e=>e.newImports)));let r;forEach(l,(e=>{if(e.useSitesToUnqualify){copyEntries(e.useSitesToUnqualify,r??(r=new Map))}}));return r}}function convertPropertyAccessImport(e,t,n,r,i){switch(e.kind){case 206:case 207:{const o=makeUniqueName(t,r);return convertedImports([makeSingleImport(o,t,n,i),makeConst(void 0,e,zr.createIdentifier(o))])}case 80:return convertedImports([makeSingleImport(e.text,t,n,i)]);default:return S.assertNever(e,`Convert to ES module got invalid syntax form ${e.kind}`)}}function convertAssignment(e,t,n,r,i,o){const{left:a,right:s}=n;if(!isPropertyAccessExpression(a)){return false}if(isExportsOrModuleExportsOrAlias(e,a)){if(isExportsOrModuleExportsOrAlias(e,s)){r.delete(e,n.parent)}else{const i=isObjectLiteralExpression(s)?tryChangeModuleExportsObject(s,o):isRequireCall(s,true)?convertReExportAll(s.arguments[0],t):void 0;if(i){r.replaceNodeWithNodes(e,n.parent,i[0]);return i[1]}else{r.replaceRangeWithText(e,createRange(a.getStart(e),s.pos),"export default");return true}}}else if(isExportsOrModuleExportsOrAlias(e,a.expression)){convertNamedExport(e,n,r,i)}return false}function tryChangeModuleExportsObject(e,t){const n=mapAllOrFail(e.properties,(e=>{switch(e.kind){case 177:case 178:case 304:case 305:return void 0;case 303:return!isIdentifier(e.name)?void 0:convertExportsDotXEquals_replaceNode(e.name.text,e.initializer,t);case 174:return!isIdentifier(e.name)?void 0:functionExpressionToDeclaration(e.name.text,[zr.createToken(95)],e,t);default:S.assertNever(e,`Convert to ES6 got invalid prop kind ${e.kind}`)}}));return n&&[n,false]}function convertNamedExport(e,t,n,r){const{text:i}=t.left.name;const o=r.get(i);if(o!==void 0){const r=[makeConst(void 0,o,t.right),makeExportDeclaration([zr.createExportSpecifier(false,o,i)])];n.replaceNodeWithNodes(e,t.parent,r)}else{convertExportsPropertyAssignment(t,e,n)}}function convertReExportAll(e,t){const n=e.text;const r=t.getSymbolAtLocation(e);const i=r?r.exports:p;return i.has("export=")?[[reExportDefault(n)],true]:!i.has("default")?[[reExportStar(n)],false]:i.size>1?[[reExportStar(n),reExportDefault(n)],true]:[[reExportDefault(n)],true]}function reExportStar(e){return makeExportDeclaration(void 0,e)}function reExportDefault(e){return makeExportDeclaration([zr.createExportSpecifier(false,void 0,"default")],e)}function convertExportsPropertyAssignment({left:e,right:t,parent:n},r,i){const o=e.name.text;if((isFunctionExpression(t)||isArrowFunction(t)||isClassExpression(t))&&(!t.name||t.name.text===o)){i.replaceRange(r,{pos:e.getStart(r),end:t.getStart(r)},zr.createToken(95),{suffix:" "});if(!t.name)i.insertName(r,t,o);const a=findChildOfKind(n,27,r);if(a)i.delete(r,a)}else{i.replaceNodeRangeWithNodes(r,e.expression,findChildOfKind(e,25,r),[zr.createToken(95),zr.createToken(87)],{joiner:" ",suffix:" "})}}function convertExportsDotXEquals_replaceNode(e,t,n){const r=[zr.createToken(95)];switch(t.kind){case 218:{const{name:n}=t;if(n&&n.text!==e){return exportConst()}}case 219:return functionExpressionToDeclaration(e,r,t,n);case 231:return classExpressionToDeclaration(e,r,t,n);default:return exportConst()}function exportConst(){return makeConst(r,zr.createIdentifier(e),replaceImportUseSites(t,n))}}function replaceImportUseSites(e,t){if(!t||!some(arrayFrom(t.keys()),(t=>rangeContainsRange(e,t)))){return e}return isArray(e)?getSynthesizedDeepClonesWithReplacements(e,true,replaceNode):getSynthesizedDeepCloneWithReplacements(e,true,replaceNode);function replaceNode(e){if(e.kind===211){const n=t.get(e);t.delete(e);return n}}}function convertSingleImport(e,t,n,r,i,o){switch(e.kind){case 206:{const n=mapAllOrFail(e.elements,(e=>e.dotDotDotToken||e.initializer||e.propertyName&&!isIdentifier(e.propertyName)||!isIdentifier(e.name)?void 0:makeImportSpecifier2(e.propertyName&&e.propertyName.text,e.name.text)));if(n){return convertedImports([makeImport(void 0,n,t,o)])}}case 207:{const n=makeUniqueName(moduleSpecifierToValidIdentifier(t.text,i),r);return convertedImports([makeImport(zr.createIdentifier(n),void 0,t,o),makeConst(void 0,getSynthesizedDeepClone(e),zr.createIdentifier(n))])}case 80:return convertSingleIdentifierImport(e,t,n,r,o);default:return S.assertNever(e,`Convert to ES module got invalid name kind ${e.kind}`)}}function convertSingleIdentifierImport(e,t,n,r,i){const o=n.getSymbolAtLocation(e);const a=new Map;let s=false;let c;for(const t of r.original.get(e.text)){if(n.getSymbolAtLocation(t)!==o||t===e){continue}const{parent:i}=t;if(isPropertyAccessExpression(i)){const{name:{text:e}}=i;if(e==="default"){s=true;const e=t.getText();(c??(c=new Map)).set(i,zr.createIdentifier(e))}else{S.assert(i.expression===t,"Didn't expect expression === use");let n=a.get(e);if(n===void 0){n=makeUniqueName(e,r);a.set(e,n)}(c??(c=new Map)).set(i,zr.createIdentifier(n))}}else{s=true}}const l=a.size===0?void 0:arrayFrom(mapIterator(a.entries(),(([e,t])=>zr.createImportSpecifier(false,e===t?void 0:zr.createIdentifier(e),zr.createIdentifier(t)))));if(!l){s=true}return convertedImports([makeImport(s?getSynthesizedDeepClone(e):void 0,l,t,i)],c)}function makeUniqueName(e,t){while(t.original.has(e)||t.additional.has(e)){e=`_${e}`}t.additional.add(e);return e}function collectFreeIdentifiers(e){const t=createMultiMap();forEachFreeIdentifier(e,(e=>t.add(e.text,e)));return t}function forEachFreeIdentifier(e,t){if(isIdentifier(e)&&isFreeIdentifier(e))t(e);e.forEachChild((e=>forEachFreeIdentifier(e,t)))}function isFreeIdentifier(e){const{parent:t}=e;switch(t.kind){case 211:return t.name!==e;case 208:return t.propertyName!==e;case 276:return t.propertyName!==e;default:return true}}function functionExpressionToDeclaration(e,t,n,r){return zr.createFunctionDeclaration(concatenate(t,getSynthesizedDeepClones(n.modifiers)),getSynthesizedDeepClone(n.asteriskToken),e,getSynthesizedDeepClones(n.typeParameters),getSynthesizedDeepClones(n.parameters),getSynthesizedDeepClone(n.type),zr.converters.convertToFunctionBlock(replaceImportUseSites(n.body,r)))}function classExpressionToDeclaration(e,t,n,r){return zr.createClassDeclaration(concatenate(t,getSynthesizedDeepClones(n.modifiers)),e,getSynthesizedDeepClones(n.typeParameters),getSynthesizedDeepClones(n.heritageClauses),replaceImportUseSites(n.members,r))}function makeSingleImport(e,t,n,r){return t==="default"?makeImport(zr.createIdentifier(e),void 0,n,r):makeImport(void 0,[makeImportSpecifier2(t,e)],n,r)}function makeImportSpecifier2(e,t){return zr.createImportSpecifier(false,e!==void 0&&e!==t?zr.createIdentifier(e):void 0,zr.createIdentifier(t))}function makeConst(e,t,n){return zr.createVariableStatement(e,zr.createVariableDeclarationList([zr.createVariableDeclaration(t,void 0,void 0,n)],2))}function makeExportDeclaration(e,t){return zr.createExportDeclaration(void 0,false,e&&zr.createNamedExports(e),t===void 0?void 0:zr.createStringLiteral(t))}function convertedImports(e,t){return{newImports:e,useSitesToUnqualify:t}}var Ld="correctQualifiedNameToIndexedAccessType";var Md=[wt.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code];registerCodeFix({errorCodes:Md,getCodeActions(e){const t=getQualifiedName(e.sourceFile,e.span.start);if(!t)return void 0;const n=dm.ChangeTracker.with(e,(n=>doChange10(n,e.sourceFile,t)));const r=`${t.left.text}["${t.right.text}"]`;return[createCodeFixAction(Ld,n,[wt.Rewrite_as_the_indexed_access_type_0,r],Ld,wt.Rewrite_all_as_indexed_access_types)]},fixIds:[Ld],getAllCodeActions:e=>codeFixAll(e,Md,((e,t)=>{const n=getQualifiedName(t.file,t.start);if(n){doChange10(e,t.file,n)}}))});function getQualifiedName(e,t){const n=findAncestor(getTokenAtPosition(e,t),isQualifiedName);S.assert(!!n,"Expected position to be owned by a qualified name.");return isIdentifier(n.left)?n:void 0}function doChange10(e,t,n){const r=n.right.text;const i=zr.createIndexedAccessTypeNode(zr.createTypeReferenceNode(n.left,void 0),zr.createLiteralTypeNode(zr.createStringLiteral(r)));e.replaceNode(t,n,i)}var Rd=[wt.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code];var Bd="convertToTypeOnlyExport";registerCodeFix({errorCodes:Rd,getCodeActions:function getCodeActionsToConvertToTypeOnlyExport(e){const t=dm.ChangeTracker.with(e,(t=>fixSingleExportDeclaration(t,getExportSpecifierForDiagnosticSpan(e.span,e.sourceFile),e)));if(t.length){return[createCodeFixAction(Bd,t,wt.Convert_to_type_only_export,Bd,wt.Convert_all_re_exported_types_to_type_only_exports)]}},fixIds:[Bd],getAllCodeActions:function getAllCodeActionsToConvertToTypeOnlyExport(e){const t=new Set;return codeFixAll(e,Rd,((n,r)=>{const i=getExportSpecifierForDiagnosticSpan(r,e.sourceFile);if(i&&addToSeen(t,getNodeId(i.parent.parent))){fixSingleExportDeclaration(n,i,e)}}))}});function getExportSpecifierForDiagnosticSpan(e,t){return tryCast(getTokenAtPosition(t,e.start).parent,isExportSpecifier)}function fixSingleExportDeclaration(e,t,n){if(!t){return}const r=t.parent;const i=r.parent;const o=getTypeExportSpecifiers(t,n);if(o.length===r.elements.length){e.insertModifierBefore(n.sourceFile,156,r)}else{const t=zr.updateExportDeclaration(i,i.modifiers,false,zr.updateNamedExports(r,filter(r.elements,(e=>!contains(o,e)))),i.moduleSpecifier,void 0);const a=zr.createExportDeclaration(void 0,true,zr.createNamedExports(o),i.moduleSpecifier,void 0);e.replaceNode(n.sourceFile,i,t,{leadingTriviaOption:dm.LeadingTriviaOption.IncludeAll,trailingTriviaOption:dm.TrailingTriviaOption.Exclude});e.insertNodeAfter(n.sourceFile,i,a)}}function getTypeExportSpecifiers(e,t){const n=e.parent;if(n.elements.length===1){return n.elements}const r=getDiagnosticsWithinSpan(createTextSpanFromNode(n),t.program.getSemanticDiagnostics(t.sourceFile,t.cancellationToken));return filter(n.elements,(t=>{var n;return t===e||((n=findDiagnosticForNode(t,r))==null?void 0:n.code)===Rd[0]}))}var jd=[wt._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,wt._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code];var Jd="convertToTypeOnlyImport";registerCodeFix({errorCodes:jd,getCodeActions:function getCodeActionsToConvertToTypeOnlyImport(e){var t;const n=getDeclaration2(e.sourceFile,e.span.start);if(n){const r=dm.ChangeTracker.with(e,(t=>doChange11(t,e.sourceFile,n)));const i=n.kind===276&&isImportDeclaration(n.parent.parent.parent)&&canConvertImportDeclarationForSpecifier(n,e.sourceFile,e.program)?dm.ChangeTracker.with(e,(t=>doChange11(t,e.sourceFile,n.parent.parent.parent))):void 0;const o=createCodeFixAction(Jd,r,n.kind===276?[wt.Use_type_0,((t=n.propertyName)==null?void 0:t.text)??n.name.text]:wt.Use_import_type,Jd,wt.Fix_all_with_type_only_imports);if(some(i)){return[createCodeFixActionWithoutFixAll(Jd,i,wt.Use_import_type),o]}return[o]}return void 0},fixIds:[Jd],getAllCodeActions:function getAllCodeActionsToConvertToTypeOnlyImport(e){const t=new Set;return codeFixAll(e,jd,((n,r)=>{const i=getDeclaration2(r.file,r.start);if((i==null?void 0:i.kind)===272&&!t.has(i)){doChange11(n,r.file,i);t.add(i)}else if((i==null?void 0:i.kind)===276&&isImportDeclaration(i.parent.parent.parent)&&!t.has(i.parent.parent.parent)&&canConvertImportDeclarationForSpecifier(i,r.file,e.program)){doChange11(n,r.file,i.parent.parent.parent);t.add(i.parent.parent.parent)}else if((i==null?void 0:i.kind)===276){doChange11(n,r.file,i)}}))}});function getDeclaration2(e,t){const{parent:n}=getTokenAtPosition(e,t);return isImportSpecifier(n)||isImportDeclaration(n)&&n.importClause?n:void 0}function canConvertImportDeclarationForSpecifier(e,t,n){if(e.parent.parent.name){return false}const r=e.parent.elements.filter((e=>!e.isTypeOnly));if(r.length===1){return true}const i=n.getTypeChecker();for(const e of r){const n=Rf.Core.eachSymbolReferenceInFile(e.name,i,t,(e=>{const t=i.getSymbolAtLocation(e);return!!t&&i.symbolIsValue(t)||!isValidTypeOnlyAliasUseSite(e)}));if(n){return false}}return true}function doChange11(e,t,n){var r;if(isImportSpecifier(n)){e.replaceNode(t,n,zr.updateImportSpecifier(n,true,n.propertyName,n.name))}else{const i=n.importClause;if(i.name&&i.namedBindings){e.replaceNodeWithNodes(t,n,[zr.createImportDeclaration(getSynthesizedDeepClones(n.modifiers,true),zr.createImportClause(true,getSynthesizedDeepClone(i.name,true),void 0),getSynthesizedDeepClone(n.moduleSpecifier,true),getSynthesizedDeepClone(n.attributes,true)),zr.createImportDeclaration(getSynthesizedDeepClones(n.modifiers,true),zr.createImportClause(true,void 0,getSynthesizedDeepClone(i.namedBindings,true)),getSynthesizedDeepClone(n.moduleSpecifier,true),getSynthesizedDeepClone(n.attributes,true))])}else{const o=((r=i.namedBindings)==null?void 0:r.kind)===275?zr.updateNamedImports(i.namedBindings,sameMap(i.namedBindings.elements,(e=>zr.updateImportSpecifier(e,false,e.propertyName,e.name)))):i.namedBindings;const a=zr.updateImportDeclaration(n,n.modifiers,zr.updateImportClause(i,true,i.name,o),n.moduleSpecifier,n.attributes);e.replaceNode(t,n,a)}}}var Wd="convertTypedefToType";var Ud=[wt.JSDoc_typedef_may_be_converted_to_TypeScript_type.code];registerCodeFix({fixIds:[Wd],errorCodes:Ud,getCodeActions(e){const t=getNewLineOrDefaultFromHost(e.host,e.formatContext.options);const n=getTokenAtPosition(e.sourceFile,e.span.start);if(!n)return;const r=dm.ChangeTracker.with(e,(r=>doChange12(r,n,e.sourceFile,t)));if(r.length>0){return[createCodeFixAction(Wd,r,wt.Convert_typedef_to_TypeScript_type,Wd,wt.Convert_all_typedef_to_TypeScript_types)]}},getAllCodeActions:e=>codeFixAll(e,Ud,((t,n)=>{const r=getNewLineOrDefaultFromHost(e.host,e.formatContext.options);const i=getTokenAtPosition(n.file,n.start);const o=true;if(i)doChange12(t,i,n.file,r,o)}))});function doChange12(e,t,n,r,i=false){if(!isJSDocTypedefTag(t))return;const o=createDeclaration(t);if(!o)return;const a=t.parent;const{leftSibling:s,rightSibling:c}=getLeftAndRightSiblings(t);let l=a.getStart();let d="";if(!s&&a.comment){l=findEndOfTextBetween(a,a.getStart(),t.getStart());d=`${r} */${r}`}if(s){if(i&&isJSDocTypedefTag(s)){l=t.getStart();d=""}else{l=findEndOfTextBetween(a,s.getStart(),t.getStart());d=`${r} */${r}`}}let p=a.getEnd();let u="";if(c){if(i&&isJSDocTypedefTag(c)){p=c.getStart();u=`${r}${r}`}else{p=c.getStart();u=`${r}/**${r} * `}}e.replaceRange(n,{pos:l,end:p},o,{prefix:d,suffix:u})}function getLeftAndRightSiblings(e){const t=e.parent;const n=t.getChildCount()-1;const r=t.getChildren().findIndex((t=>t.getStart()===e.getStart()&&t.getEnd()===e.getEnd()));const i=r>0?t.getChildAt(r-1):void 0;const o=r0;e--){if(!/[*/\s]/.test(r.substring(e-1,e))){return t+e}}return n}function createDeclaration(e){var t;const{typeExpression:n}=e;if(!n)return;const r=(t=e.name)==null?void 0:t.getText();if(!r)return;if(n.kind===322){return createInterfaceForTypeLiteral(r,n)}if(n.kind===309){return createTypeAliasForTypeExpression(r,n)}}function createInterfaceForTypeLiteral(e,t){const n=createSignatureFromTypeLiteral(t);if(!some(n))return;return zr.createInterfaceDeclaration(void 0,e,void 0,void 0,n)}function createTypeAliasForTypeExpression(e,t){const n=getSynthesizedDeepClone(t.type);if(!n)return;return zr.createTypeAliasDeclaration(void 0,zr.createIdentifier(e),void 0,n)}function createSignatureFromTypeLiteral(e){const t=e.jsDocPropertyTags;if(!some(t))return;const getSignature=e=>{var t;const n=getPropertyName(e);const r=(t=e.typeExpression)==null?void 0:t.type;const i=e.isBracketed;let o;if(r&&isJSDocTypeLiteral(r)){const e=createSignatureFromTypeLiteral(r);o=zr.createTypeLiteralNode(e)}else if(r){o=getSynthesizedDeepClone(r)}if(o&&n){const e=i?zr.createToken(58):void 0;return zr.createPropertySignature(void 0,n,e,o)}};return mapDefined(t,getSignature)}function getPropertyName(e){return e.name.kind===80?e.name.text:e.name.right.text}function getJSDocTypedefNodes(e){if(hasJSDocNodes(e)){return flatMap(e.jsDoc,(e=>{var t;return(t=e.tags)==null?void 0:t.filter((e=>isJSDocTypedefTag(e)))}))}return[]}var zd="convertLiteralTypeToMappedType";var Vd=[wt._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code];registerCodeFix({errorCodes:Vd,getCodeActions:function getCodeActionsToConvertLiteralTypeToMappedType(e){const{sourceFile:t,span:n}=e;const r=getInfo5(t,n.start);if(!r){return void 0}const{name:i,constraint:o}=r;const a=dm.ChangeTracker.with(e,(e=>doChange13(e,t,r)));return[createCodeFixAction(zd,a,[wt.Convert_0_to_1_in_0,o,i],zd,wt.Convert_all_type_literals_to_mapped_type)]},fixIds:[zd],getAllCodeActions:e=>codeFixAll(e,Vd,((e,t)=>{const n=getInfo5(t.file,t.start);if(n){doChange13(e,t.file,n)}}))});function getInfo5(e,t){const n=getTokenAtPosition(e,t);if(isIdentifier(n)){const t=cast(n.parent.parent,isPropertySignature);const r=n.getText(e);return{container:cast(t.parent,isTypeLiteralNode),typeNode:t.type,constraint:r,name:r==="K"?"P":"K"}}return void 0}function doChange13(e,t,{container:n,typeNode:r,constraint:i,name:o}){e.replaceNode(t,n,zr.createMappedTypeNode(void 0,zr.createTypeParameterDeclaration(void 0,o,zr.createTypeReferenceNode(i)),void 0,void 0,r,void 0))}var qd=[wt.Class_0_incorrectly_implements_interface_1.code,wt.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code];var Hd="fixClassIncorrectlyImplementsInterface";registerCodeFix({errorCodes:qd,getCodeActions(e){const{sourceFile:t,span:n}=e;const r=getClass(t,n.start);return mapDefined(getEffectiveImplementsTypeNodes(r),(n=>{const i=dm.ChangeTracker.with(e,(i=>addMissingDeclarations(e,n,t,r,i,e.preferences)));return i.length===0?void 0:createCodeFixAction(Hd,i,[wt.Implement_interface_0,n.getText(t)],Hd,wt.Implement_all_unimplemented_interfaces)}))},fixIds:[Hd],getAllCodeActions(e){const t=new Set;return codeFixAll(e,qd,((n,r)=>{const i=getClass(r.file,r.start);if(addToSeen(t,getNodeId(i))){for(const t of getEffectiveImplementsTypeNodes(i)){addMissingDeclarations(e,t,r.file,i,n,e.preferences)}}}))}});function getClass(e,t){return S.checkDefined(getContainingClass(getTokenAtPosition(e,t)),"There should be a containing class")}function symbolPointsToNonPrivateMember(e){return!e.valueDeclaration||!(getEffectiveModifierFlags(e.valueDeclaration)&2)}function addMissingDeclarations(e,t,n,r,i,o){const a=e.program.getTypeChecker();const s=getHeritageClauseSymbolTable(r,a);const c=a.getTypeAtLocation(t);const l=a.getPropertiesOfType(c);const d=l.filter(and(symbolPointsToNonPrivateMember,(e=>!s.has(e.escapedName))));const p=a.getTypeAtLocation(r);const u=find(r.members,(e=>isConstructorDeclaration(e)));if(!p.getNumberIndexType()){createMissingIndexSignatureDeclaration(c,1)}if(!p.getStringIndexType()){createMissingIndexSignatureDeclaration(c,0)}const f=createImportAdder(n,e.program,o,e.host);createMissingMemberNodes(r,d,n,e,o,f,(e=>insertInterfaceMemberNode(n,r,e)));f.writeFixes(i);function createMissingIndexSignatureDeclaration(t,i){const o=a.getIndexInfoOfType(t,i);if(o){insertInterfaceMemberNode(n,r,a.indexInfoToIndexSignatureDeclaration(o,r,void 0,void 0,getNoopSymbolTrackerWithResolver(e)))}}function insertInterfaceMemberNode(e,t,n){if(u){i.insertNodeAfter(e,u,n)}else{i.insertMemberAtStart(e,t,n)}}}function getHeritageClauseSymbolTable(e,t){const n=getEffectiveBaseTypeNode(e);if(!n)return createSymbolTable();const r=t.getTypeAtLocation(n);const i=t.getPropertiesOfType(r);return createSymbolTable(i.filter(symbolPointsToNonPrivateMember))}var Gd="import";var Kd="fixMissingImport";var $d=[wt.Cannot_find_name_0.code,wt.Cannot_find_name_0_Did_you_mean_1.code,wt.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,wt.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,wt.Cannot_find_namespace_0.code,wt._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,wt._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,wt.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,wt._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code,wt.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery.code,wt.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later.code,wt.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom.code,wt.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig.code,wt.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code,wt.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig.code,wt.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha.code,wt.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,wt.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,wt.Cannot_find_namespace_0_Did_you_mean_1.code,wt.Cannot_extend_an_interface_0_Did_you_mean_implements.code,wt.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found.code];registerCodeFix({errorCodes:$d,getCodeActions(e){const{errorCode:t,preferences:n,sourceFile:r,span:i,program:o}=e;const a=getFixInfos(e,t,i.start,true);if(!a)return void 0;return a.map((({fix:t,symbolName:i,errorIdentifierText:a})=>codeActionForFix(e,r,i,t,i!==a,o,n)))},fixIds:[Kd],getAllCodeActions:e=>{const{sourceFile:t,program:n,preferences:r,host:i,cancellationToken:o}=e;const a=createImportAdderWorker(t,n,true,r,i,o);eachDiagnostic(e,$d,(t=>a.addImportFromDiagnostic(t,e)));return createCombinedCodeActions(dm.ChangeTracker.with(e,a.writeFixes))}});function createImportAdder(e,t,n,r,i){return createImportAdderWorker(e,t,false,n,r,i)}function createImportAdderWorker(e,t,n,r,i,o){const a=t.getCompilerOptions();const s=[];const c=[];const l=new Map;const d=new Set;const p=new Set;const u=new Map;return{addImportFromDiagnostic:addImportFromDiagnostic,addImportFromExportedSymbol:addImportFromExportedSymbol,addImportForModuleSymbol:addImportForModuleSymbol,writeFixes:writeFixes,hasFixes:hasFixes,addImportForUnresolvedIdentifier:addImportForUnresolvedIdentifier,addImportForNonExistentExport:addImportForNonExistentExport,removeExistingImport:removeExistingImport,addVerbatimImport:addVerbatimImport};function addVerbatimImport(e){p.add(e)}function addImportForUnresolvedIdentifier(e,t,n){const r=getFixInfosWithoutDiagnostic(e,t,n);if(!r||!r.length)return;addImport(first(r))}function addImportFromDiagnostic(e,t){const r=getFixInfos(t,e.code,e.start,n);if(!r||!r.length)return;addImport(first(r))}function addImportFromExportedSymbol(n,s,c){var l,d;const p=S.checkDefined(n.parent,"Expected exported symbol to have module symbol as parent");const u=getNameForExportedSymbol(n,zn(a));const f=t.getTypeChecker();const m=f.getMergedSymbol(skipAlias(n,f));const _=getAllExportInfoForSymbol(e,m,u,p,false,t,i,r,o);if(!_){S.assert((l=r.autoImportFileExcludePatterns)==null?void 0:l.length);return}const g=shouldUseRequire(e,t);let y=getImportFixForSymbol(e,_,t,void 0,!!s,g,i,r);if(y){const e=((d=tryCast(c==null?void 0:c.name,isIdentifier))==null?void 0:d.text)??u;let t;let r;if(c&&isTypeOnlyImportDeclaration(c)&&(y.kind===3||y.kind===2)&&y.addAsTypeOnly===1){t=2}if(n.name!==e){r=n.name}y={...y,...t===void 0?{}:{addAsTypeOnly:t},...r===void 0?{}:{propertyName:r}};addImport({fix:y,symbolName:e??u,errorIdentifierText:void 0})}}function addImportForModuleSymbol(n,o,s){var c,l,d;const p=t.getTypeChecker();const u=p.getAliasedSymbol(n);S.assert(u.flags&1536,"Expected symbol to be a module");const f=createModuleSpecifierResolutionHost(t,i);const m=Ho.getModuleSpecifiersWithCacheInfo(u,p,a,e,f,r,void 0,true);const _=shouldUseRequire(e,t);let g=getAddAsTypeOnly(o,true,void 0,n.flags,t.getTypeChecker(),a);g=g===1&&isTypeOnlyImportDeclaration(s)?2:1;const y=isImportDeclaration(s)?isDefaultImport(s)?1:2:isImportSpecifier(s)?0:isImportClause(s)&&!!s.name?1:2;const h=[{symbol:n,moduleSymbol:u,moduleFileName:(d=(l=(c=u.declarations)==null?void 0:c[0])==null?void 0:l.getSourceFile())==null?void 0:d.fileName,exportKind:4,targetFlags:n.flags,isFromPackageJson:false}];const T=getImportFixForSymbol(e,h,t,void 0,!!o,_,i,r);let v;if(T&&y!==2){v={...T,addAsTypeOnly:g,importKind:y}}else{v={kind:3,moduleSpecifierKind:T!==void 0?T.moduleSpecifierKind:m.kind,moduleSpecifier:T!==void 0?T.moduleSpecifier:first(m.moduleSpecifiers),importKind:y,addAsTypeOnly:g,useRequire:_}}addImport({fix:v,symbolName:n.name,errorIdentifierText:void 0})}function addImportForNonExistentExport(n,o,s,c,l){const d=t.getSourceFile(o);const p=shouldUseRequire(e,t);if(d&&d.symbol){const{fixes:a}=getImportFixes([{exportKind:s,isFromPackageJson:false,moduleFileName:o,moduleSymbol:d.symbol,targetFlags:c}],void 0,l,p,t,e,i,r);if(a.length){addImport({fix:a[0],symbolName:n,errorIdentifierText:n})}}else{const d=createFutureSourceFile(o,99,t,i);const u=Ho.getLocalModuleSpecifierBetweenFileNames(e,o,a,createModuleSpecifierResolutionHost(t,i),r);const f=getImportKind(d,s,t);const m=getAddAsTypeOnly(l,true,void 0,c,t.getTypeChecker(),a);const _={kind:3,moduleSpecifierKind:"relative",moduleSpecifier:u,importKind:f,addAsTypeOnly:m,useRequire:p};addImport({fix:_,symbolName:n,errorIdentifierText:n})}}function removeExistingImport(e){if(e.kind===273){S.assertIsDefined(e.name,"ImportClause should have a name if it's being removed")}d.add(e)}function addImport(e){var t,n,r;const{fix:i,symbolName:o}=e;switch(i.kind){case 0:s.push(i);break;case 1:c.push(i);break;case 2:{const{importClauseOrBindingPattern:e,importKind:r,addAsTypeOnly:a,propertyName:s}=i;let c=l.get(e);if(!c){l.set(e,c={importClauseOrBindingPattern:e,defaultImport:void 0,namedImports:new Map})}if(r===0){const e=(t=c==null?void 0:c.namedImports.get(o))==null?void 0:t.addAsTypeOnly;c.namedImports.set(o,{addAsTypeOnly:reduceAddAsTypeOnlyValues(e,a),propertyName:s})}else{S.assert(c.defaultImport===void 0||c.defaultImport.name===o,"(Add to Existing) Default import should be missing or match symbolName");c.defaultImport={name:o,addAsTypeOnly:reduceAddAsTypeOnlyValues((n=c.defaultImport)==null?void 0:n.addAsTypeOnly,a)}}break}case 3:{const{moduleSpecifier:e,importKind:t,useRequire:n,addAsTypeOnly:s,propertyName:c}=i;const l=getNewImportEntry(e,t,n,s);S.assert(l.useRequire===n,"(Add new) Tried to add an `import` and a `require` for the same module");switch(t){case 1:S.assert(l.defaultImport===void 0||l.defaultImport.name===o,"(Add new) Default import should be missing or match symbolName");l.defaultImport={name:o,addAsTypeOnly:reduceAddAsTypeOnlyValues((r=l.defaultImport)==null?void 0:r.addAsTypeOnly,s)};break;case 0:const e=(l.namedImports||(l.namedImports=new Map)).get(o);l.namedImports.set(o,[reduceAddAsTypeOnlyValues(e,s),c]);break;case 3:if(a.verbatimModuleSyntax){const e=(l.namedImports||(l.namedImports=new Map)).get(o);l.namedImports.set(o,[reduceAddAsTypeOnlyValues(e,s),c])}else{S.assert(l.namespaceLikeImport===void 0||l.namespaceLikeImport.name===o,"Namespacelike import shoudl be missing or match symbolName");l.namespaceLikeImport={importKind:t,name:o,addAsTypeOnly:s}}break;case 2:S.assert(l.namespaceLikeImport===void 0||l.namespaceLikeImport.name===o,"Namespacelike import shoudl be missing or match symbolName");l.namespaceLikeImport={importKind:t,name:o,addAsTypeOnly:s};break}break}case 4:break;default:S.assertNever(i,`fix wasn't never - got kind ${i.kind}`)}function reduceAddAsTypeOnlyValues(e,t){return Math.max(e??0,t)}function getNewImportEntry(e,t,n,r){const i=newImportsKey(e,true);const o=newImportsKey(e,false);const a=u.get(i);const s=u.get(o);const c={defaultImport:void 0,namedImports:void 0,namespaceLikeImport:void 0,useRequire:n};if(t===1&&r===2){if(a)return a;u.set(i,c);return c}if(r===1&&(a||s)){return a||s}if(s){return s}u.set(o,c);return c}function newImportsKey(e,t){return`${t?1:0}|${e}`}}function writeFixes(t,n){var i,o;let p;if(e.imports!==void 0&&e.imports.length===0&&n!==void 0){p=n}else{p=getQuotePreference(e,r)}for(const n of s){addNamespaceQualifier(t,e,n)}for(const n of c){addImportType(t,e,n,p)}let f;if(d.size){S.assert(isFullSourceFile(e),"Cannot remove imports from a future source file");const n=new Set(mapDefined([...d],(e=>findAncestor(e,isImportDeclaration))));const r=new Set(mapDefined([...d],(e=>findAncestor(e,isVariableDeclarationInitializedToRequire))));const a=[...n].filter((e=>{var t,n,r;return!l.has(e.importClause)&&(!((t=e.importClause)==null?void 0:t.name)||d.has(e.importClause))&&(!tryCast((n=e.importClause)==null?void 0:n.namedBindings,isNamespaceImport)||d.has(e.importClause.namedBindings))&&(!tryCast((r=e.importClause)==null?void 0:r.namedBindings,isNamedImports)||every(e.importClause.namedBindings.elements,(e=>d.has(e))))}));const s=[...r].filter((e=>(e.name.kind!==206||!l.has(e.name))&&(e.name.kind!==206||every(e.name.elements,(e=>d.has(e))))));const c=[...n].filter((e=>{var t,n;return((t=e.importClause)==null?void 0:t.namedBindings)&&a.indexOf(e)===-1&&!((n=l.get(e.importClause))==null?void 0:n.namedImports)&&(e.importClause.namedBindings.kind===274||every(e.importClause.namedBindings.elements,(e=>d.has(e))))}));for(const n of[...a,...s]){t.delete(e,n)}for(const n of c){t.replaceNode(e,n.importClause,zr.updateImportClause(n.importClause,n.importClause.isTypeOnly,n.importClause.name,void 0))}for(const n of d){const r=findAncestor(n,isImportDeclaration);if(r&&a.indexOf(r)===-1&&c.indexOf(r)===-1){if(n.kind===273){t.delete(e,n.name)}else{S.assert(n.kind===276,"NamespaceImport should have been handled earlier");if((i=l.get(r.importClause))==null?void 0:i.namedImports){(f??(f=new Set)).add(n)}else{t.delete(e,n)}}}else if(n.kind===208){if((o=l.get(n.parent))==null?void 0:o.namedImports){(f??(f=new Set)).add(n)}else{t.delete(e,n)}}else if(n.kind===271){t.delete(e,n)}}}l.forEach((({importClauseOrBindingPattern:n,defaultImport:i,namedImports:o})=>{doAddExistingFix(t,e,n,i,arrayFrom(o.entries(),(([e,{addAsTypeOnly:t,propertyName:n}])=>({addAsTypeOnly:t,propertyName:n,name:e}))),f,r)}));let m;u.forEach((({useRequire:e,defaultImport:t,namedImports:n,namespaceLikeImport:i},o)=>{const s=o.slice(2);const c=e?getNewRequires:getNewImports;const l=c(s,p,t,n&&arrayFrom(n.entries(),(([e,[t,n]])=>({addAsTypeOnly:t,propertyName:n,name:e}))),i,a,r);m=combine(m,l)}));m=combine(m,getCombinedVerbatimImports());if(m){insertImports(t,e,m,true,r)}}function getCombinedVerbatimImports(){if(!p.size)return void 0;const e=new Set(mapDefined([...p],(e=>findAncestor(e,isImportDeclaration))));const t=new Set(mapDefined([...p],(e=>findAncestor(e,isRequireVariableStatement))));return[...mapDefined([...p],(e=>e.kind===271?getSynthesizedDeepClone(e,true):void 0)),...[...e].map((e=>{var t;if(p.has(e)){return getSynthesizedDeepClone(e,true)}return getSynthesizedDeepClone(zr.updateImportDeclaration(e,e.modifiers,e.importClause&&zr.updateImportClause(e.importClause,e.importClause.isTypeOnly,p.has(e.importClause)?e.importClause.name:void 0,p.has(e.importClause.namedBindings)?e.importClause.namedBindings:((t=tryCast(e.importClause.namedBindings,isNamedImports))==null?void 0:t.elements.some((e=>p.has(e))))?zr.updateNamedImports(e.importClause.namedBindings,e.importClause.namedBindings.elements.filter((e=>p.has(e)))):void 0),e.moduleSpecifier,e.attributes),true)})),...[...t].map((e=>{if(p.has(e)){return getSynthesizedDeepClone(e,true)}return getSynthesizedDeepClone(zr.updateVariableStatement(e,e.modifiers,zr.updateVariableDeclarationList(e.declarationList,mapDefined(e.declarationList.declarations,(e=>{if(p.has(e)){return e}return zr.updateVariableDeclaration(e,e.name.kind===206?zr.updateObjectBindingPattern(e.name,e.name.elements.filter((e=>p.has(e)))):e.name,e.exclamationToken,e.type,e.initializer)})))),true)}))]}function hasFixes(){return s.length>0||c.length>0||l.size>0||u.size>0||p.size>0||d.size>0}}function createImportSpecifierResolver(e,t,n,r){const i=createPackageJsonImportFilter(e,r,n);const o=createExistingImportMap(e,t);return{getModuleSpecifierForBestExportInfo:getModuleSpecifierForBestExportInfo};function getModuleSpecifierForBestExportInfo(a,s,c,l){const{fixes:d,computedWithoutCacheCount:p}=getImportFixes(a,s,c,false,t,e,n,r,o,l);const u=getBestFix(d,e,t,i,n,r);return u&&{...u,computedWithoutCacheCount:p}}}function getImportCompletionAction(e,t,n,r,i,o,a,s,c,l,d,p){let u;if(n){u=getExportInfoMap(r,a,s,d,p).get(r.path,n);S.assertIsDefined(u,"Some exportInfo should match the specified exportMapKey")}else{u=pathIsBareSpecifier(stripQuotes(t.name))?[getSingleExportInfoForSymbol(e,i,t,s,a)]:getAllExportInfoForSymbol(r,e,i,t,o,s,a,d,p);S.assertIsDefined(u,"Some exportInfo should match the specified symbol / moduleSymbol")}const f=shouldUseRequire(r,s);const m=isValidTypeOnlyAliasUseSite(getTokenAtPosition(r,l));const _=S.checkDefined(getImportFixForSymbol(r,u,s,l,m,f,a,d));return{moduleSpecifier:_.moduleSpecifier,codeAction:codeFixActionToCodeAction(codeActionForFix({host:a,formatContext:c,preferences:d},r,i,_,false,s,d))}}function getPromoteTypeOnlyCompletionAction(e,t,n,r,i,o){const a=n.getCompilerOptions();const s=single(getSymbolNamesToImport(e,n.getTypeChecker(),t,a));const c=getTypeOnlyPromotionFix(e,t,s,n);const l=s!==t.text;return c&&codeFixActionToCodeAction(codeActionForFix({host:r,formatContext:i,preferences:o},e,s,c,l,n,o))}function getImportFixForSymbol(e,t,n,r,i,o,a,s){const c=createPackageJsonImportFilter(e,s,a);return getBestFix(getImportFixes(t,r,i,o,n,e,a,s).fixes,e,n,c,a,s)}function codeFixActionToCodeAction({description:e,changes:t,commands:n}){return{description:e,changes:t,commands:n}}function getAllExportInfoForSymbol(e,t,n,r,i,o,a,s,c){const l=createGetChecker(o,a);const d=s.autoImportFileExcludePatterns&&getIsFileExcluded(a,s);const p=o.getTypeChecker().getMergedSymbol(r);const u=d&&p.declarations&&getDeclarationOfKind(p,307);const f=u&&d(u);return getExportInfoMap(e,a,o,s,c).search(e.path,i,(e=>e===n),(e=>{const n=l(e[0].isFromPackageJson);if(n.getMergedSymbol(skipAlias(e[0].symbol,n))===t&&(f||e.some((e=>n.getMergedSymbol(e.moduleSymbol)===r||e.symbol.parent===r)))){return e}}))}function getSingleExportInfoForSymbol(e,t,n,r,i){var o,a;const s=getInfoWithChecker(r.getTypeChecker(),false);if(s){return s}const c=(a=(o=i.getPackageJsonAutoImportProvider)==null?void 0:o.call(i))==null?void 0:a.getTypeChecker();return S.checkDefined(c&&getInfoWithChecker(c,true),`Could not find symbol in specified module for code actions`);function getInfoWithChecker(r,i){const o=getDefaultLikeExportInfo(n,r);if(o&&skipAlias(o.symbol,r)===e){return{symbol:o.symbol,moduleSymbol:n,moduleFileName:void 0,exportKind:o.exportKind,targetFlags:skipAlias(e,r).flags,isFromPackageJson:i}}const a=r.tryGetMemberInModuleExportsAndProperties(t,n);if(a&&skipAlias(a,r)===e){return{symbol:a,moduleSymbol:n,moduleFileName:void 0,exportKind:0,targetFlags:skipAlias(e,r).flags,isFromPackageJson:i}}}}function getImportFixes(e,t,n,r,i,o,a,s,c=(isFullSourceFile(o)?createExistingImportMap(o,i):void 0),l){const p=i.getTypeChecker();const u=c?flatMap(e,c.getImportsForExportInfo):d;const f=t!==void 0&&tryUseExistingNamespaceImport(u,t);const m=tryAddToExistingImport(u,n,p,i.getCompilerOptions());if(m){return{computedWithoutCacheCount:0,fixes:[...f?[f]:d,m]}}const{fixes:_,computedWithoutCacheCount:g=0}=getFixesForAddImport(e,u,i,o,t,n,r,a,s,l);return{computedWithoutCacheCount:g,fixes:[...f?[f]:d,..._]}}function tryUseExistingNamespaceImport(e,t){return firstDefined(e,(({declaration:e,importKind:n})=>{var r;if(n!==0)return void 0;const i=getNamespaceLikeImportText(e);const o=i&&((r=tryGetModuleSpecifierFromDeclaration(e))==null?void 0:r.text);if(o){return{kind:0,namespacePrefix:i,usagePosition:t,moduleSpecifierKind:void 0,moduleSpecifier:o}}}))}function getNamespaceLikeImportText(e){var t,n,r;switch(e.kind){case 260:return(t=tryCast(e.name,isIdentifier))==null?void 0:t.text;case 271:return e.name.text;case 351:case 272:return(r=tryCast((n=e.importClause)==null?void 0:n.namedBindings,isNamespaceImport))==null?void 0:r.name.text;default:return S.assertNever(e)}}function getAddAsTypeOnly(e,t,n,r,i,o){if(!e){return 4}if(n&&o.verbatimModuleSyntax&&(!(r&111551)||!!i.getTypeOnlyAliasDeclaration(n))){return 2}return 1}function tryAddToExistingImport(e,t,n,r){let i;for(const t of e){const e=getAddToExistingImportFix(t);if(!e)continue;const n=isTypeOnlyImportDeclaration(e.importClauseOrBindingPattern);if(e.addAsTypeOnly!==4&&n||e.addAsTypeOnly===4&&!n){return e}i??(i=e)}return i;function getAddToExistingImportFix({declaration:e,importKind:i,symbol:o,targetFlags:a}){if(i===3||i===2||e.kind===271){return void 0}if(e.kind===260){return(i===0||i===1)&&e.name.kind===206?{kind:2,importClauseOrBindingPattern:e.name,importKind:i,moduleSpecifierKind:void 0,moduleSpecifier:e.initializer.arguments[0].text,addAsTypeOnly:4}:void 0}const{importClause:s}=e;if(!s||!isStringLiteralLike(e.moduleSpecifier)){return void 0}const{name:c,namedBindings:l}=s;if(s.isTypeOnly&&!(i===0&&l)){return void 0}const d=getAddAsTypeOnly(t,false,o,a,n,r);if(i===1&&(c||d===2&&l)){return void 0}if(i===0&&(l==null?void 0:l.kind)===274){return void 0}return{kind:2,importClauseOrBindingPattern:s,importKind:i,moduleSpecifierKind:void 0,moduleSpecifier:e.moduleSpecifier.text,addAsTypeOnly:d}}}function createExistingImportMap(e,t){const n=t.getTypeChecker();let r;for(const t of e.imports){const e=importFromModuleSpecifier(t);if(isVariableDeclarationInitializedToRequire(e.parent)){const i=n.resolveExternalModuleName(t);if(i){(r||(r=createMultiMap())).add(getSymbolId(i),e.parent)}}else if(e.kind===272||e.kind===271||e.kind===351){const i=n.getSymbolAtLocation(t);if(i){(r||(r=createMultiMap())).add(getSymbolId(i),e)}}}return{getImportsForExportInfo:({moduleSymbol:n,exportKind:i,targetFlags:o,symbol:a})=>{const s=r==null?void 0:r.get(getSymbolId(n));if(!s)return d;if(isSourceFileJS(e)&&!(o&111551)&&!every(s,isJSDocImportTag))return d;const c=getImportKind(e,i,t);return s.map((e=>({declaration:e,importKind:c,symbol:a,targetFlags:o})))}}}function shouldUseRequire(e,t){if(!hasJSFileExtension(e.fileName)){return false}if(e.commonJsModuleIndicator&&!e.externalModuleIndicator)return true;if(e.externalModuleIndicator&&!e.commonJsModuleIndicator)return false;const n=t.getCompilerOptions();if(n.configFile){return Vn(n)<5}if(getImpliedNodeFormatForEmit(e,t)===1)return true;if(getImpliedNodeFormatForEmit(e,t)===99)return false;for(const n of t.getSourceFiles()){if(n===e||!isSourceFileJS(n)||t.isSourceFileFromExternalLibrary(n))continue;if(n.commonJsModuleIndicator&&!n.externalModuleIndicator)return true;if(n.externalModuleIndicator&&!n.commonJsModuleIndicator)return false}return true}function createGetChecker(e,t){return memoizeOne((n=>n?t.getPackageJsonAutoImportProvider().getTypeChecker():e.getTypeChecker()))}function getNewImportFixes(e,t,n,r,i,o,a,s,c){const l=hasJSFileExtension(t.fileName);const d=e.getCompilerOptions();const p=createModuleSpecifierResolutionHost(e,a);const u=createGetChecker(e,a);const f=qn(d);const m=moduleResolutionUsesNodeModules(f);const _=c?e=>Ho.tryGetModuleSpecifiersFromCache(e.moduleSymbol,t,p,s):(e,n)=>Ho.getModuleSpecifiersWithCacheInfo(e.moduleSymbol,n,d,t,p,s,void 0,true);let g=0;const y=flatMap(o,((o,a)=>{const s=u(o.isFromPackageJson);const{computedWithoutCache:c,moduleSpecifiers:p,kind:f}=_(o,s)??{};const y=!!(o.targetFlags&111551);const h=getAddAsTypeOnly(r,true,o.symbol,o.targetFlags,s,d);g+=c?1:0;return mapDefined(p,(r=>{if(m&&pathContainsNodeModules(r)){return void 0}if(!y&&l&&n!==void 0){return{kind:1,moduleSpecifierKind:f,moduleSpecifier:r,usagePosition:n,exportInfo:o,isReExport:a>0}}const c=getImportKind(t,o.exportKind,e);let p;if(n!==void 0&&c===3&&o.exportKind===0){const e=s.resolveExternalModuleSymbol(o.moduleSymbol);let t;if(e!==o.moduleSymbol){t=forEachNameOfDefaultExport(e,s,zn(d),identity)}t||(t=moduleSymbolToValidIdentifier(o.moduleSymbol,zn(d),false));p={namespacePrefix:t,usagePosition:n}}return{kind:3,moduleSpecifierKind:f,moduleSpecifier:r,importKind:c,useRequire:i,addAsTypeOnly:h,exportInfo:o,isReExport:a>0,qualification:p}}))}));return{computedWithoutCacheCount:g,fixes:y}}function getFixesForAddImport(e,t,n,r,i,o,a,s,c,l){const d=firstDefined(t,(e=>newImportInfoFromExistingSpecifier(e,o,a,n.getTypeChecker(),n.getCompilerOptions())));return d?{fixes:[d]}:getNewImportFixes(n,r,i,o,a,e,s,c,l)}function newImportInfoFromExistingSpecifier({declaration:e,importKind:t,symbol:n,targetFlags:r},i,o,a,s){var c;const l=(c=tryGetModuleSpecifierFromDeclaration(e))==null?void 0:c.text;if(l){const e=o?4:getAddAsTypeOnly(i,true,n,r,a,s);return{kind:3,moduleSpecifierKind:void 0,moduleSpecifier:l,importKind:t,addAsTypeOnly:e,useRequire:o}}}function getFixInfos(e,t,n,r){const i=getTokenAtPosition(e.sourceFile,n);let o;if(t===wt._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code){o=getFixesInfoForUMDImport(e,i)}else if(!isIdentifier(i)){return void 0}else if(t===wt._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code){const t=single(getSymbolNamesToImport(e.sourceFile,e.program.getTypeChecker(),i,e.program.getCompilerOptions()));const n=getTypeOnlyPromotionFix(e.sourceFile,i,t,e.program);return n&&[{fix:n,symbolName:t,errorIdentifierText:i.text}]}else{o=getFixesInfoForNonUMDImport(e,i,r)}const a=createPackageJsonImportFilter(e.sourceFile,e.preferences,e.host);return o&&sortFixInfo(o,e.sourceFile,e.program,a,e.host,e.preferences)}function sortFixInfo(e,t,n,r,i,o){const _toPath=e=>toPath(e,i.getCurrentDirectory(),hostGetCanonicalFileName(i));return toSorted(e,((e,i)=>compareBooleans(!!e.isJsxNamespaceFix,!!i.isJsxNamespaceFix)||compareValues(e.fix.kind,i.fix.kind)||compareModuleSpecifiers(e.fix,i.fix,t,n,o,r.allowsImportingSpecifier,_toPath)))}function getFixInfosWithoutDiagnostic(e,t,n){const r=getFixesInfoForNonUMDImport(e,t,n);const i=createPackageJsonImportFilter(e.sourceFile,e.preferences,e.host);return r&&sortFixInfo(r,e.sourceFile,e.program,i,e.host,e.preferences)}function getBestFix(e,t,n,r,i,o){if(!some(e))return;if(e[0].kind===0||e[0].kind===2){return e[0]}return e.reduce(((e,a)=>compareModuleSpecifiers(a,e,t,n,o,r.allowsImportingSpecifier,(e=>toPath(e,i.getCurrentDirectory(),hostGetCanonicalFileName(i))))===-1?a:e))}function compareModuleSpecifiers(e,t,n,r,i,o,a){if(e.kind!==0&&t.kind!==0){return compareBooleans(t.moduleSpecifierKind!=="node_modules"||o(t.moduleSpecifier),e.moduleSpecifierKind!=="node_modules"||o(e.moduleSpecifier))||compareModuleSpecifierRelativity(e,t,i)||compareNodeCoreModuleSpecifiers(e.moduleSpecifier,t.moduleSpecifier,n,r)||compareBooleans(isFixPossiblyReExportingImportingFile(e,n.path,a),isFixPossiblyReExportingImportingFile(t,n.path,a))||compareNumberOfDirectorySeparators(e.moduleSpecifier,t.moduleSpecifier)}return 0}function compareModuleSpecifierRelativity(e,t,n){if(n.importModuleSpecifierPreference==="non-relative"||n.importModuleSpecifierPreference==="project-relative"){return compareBooleans(e.moduleSpecifierKind==="relative",t.moduleSpecifierKind==="relative")}return 0}function isFixPossiblyReExportingImportingFile(e,t,n){var r;if(e.isReExport&&((r=e.exportInfo)==null?void 0:r.moduleFileName)&&isIndexFileName(e.exportInfo.moduleFileName)){const r=n(getDirectoryPath(e.exportInfo.moduleFileName));return startsWith(t,r)}return false}function isIndexFileName(e){return getBaseFileName(e,[".js",".jsx",".d.ts",".ts",".tsx"],true)==="index"}function compareNodeCoreModuleSpecifiers(e,t,n,r){if(startsWith(e,"node:")&&!startsWith(t,"node:"))return shouldUseUriStyleNodeCoreModules(n,r)?-1:1;if(startsWith(t,"node:")&&!startsWith(e,"node:"))return shouldUseUriStyleNodeCoreModules(n,r)?1:-1;return 0}function getFixesInfoForUMDImport({sourceFile:e,program:t,host:n,preferences:r},i){const o=t.getTypeChecker();const a=getUmdSymbol(i,o);if(!a)return void 0;const s=o.getAliasedSymbol(a);const c=a.name;const l=[{symbol:a,moduleSymbol:s,moduleFileName:void 0,exportKind:3,targetFlags:s.flags,isFromPackageJson:false}];const d=shouldUseRequire(e,t);const p=getImportFixes(l,void 0,false,d,t,e,n,r).fixes;return p.map((e=>{var t;return{fix:e,symbolName:c,errorIdentifierText:(t=tryCast(i,isIdentifier))==null?void 0:t.text}}))}function getUmdSymbol(e,t){const n=isIdentifier(e)?t.getSymbolAtLocation(e):void 0;if(isUMDExportSymbol(n))return n;const{parent:r}=e;if(isJsxOpeningLikeElement(r)&&r.tagName===e||isJsxOpeningFragment(r)){const n=t.resolveName(t.getJsxNamespace(r),isJsxOpeningLikeElement(r)?e:r,111551,false);if(isUMDExportSymbol(n)){return n}}return void 0}function getImportKind(e,t,n,r){if(n.getCompilerOptions().verbatimModuleSyntax&&getEmitModuleFormatOfFile(e,n)===1){return 3}switch(t){case 0:return 0;case 1:return 1;case 2:return getExportEqualsImportKind(e,n.getCompilerOptions(),!!r);case 3:return getUmdImportKind(e,n,!!r);case 4:return 2;default:return S.assertNever(t)}}function getUmdImportKind(e,t,n){if($n(t.getCompilerOptions())){return 1}const r=Vn(t.getCompilerOptions());switch(r){case 2:case 1:case 3:if(hasJSFileExtension(e.fileName)){return e.externalModuleIndicator||n?2:3}return 3;case 4:case 5:case 6:case 7:case 99:case 0:case 200:return 2;case 100:case 101:case 199:return getImpliedNodeFormatForEmit(e,t)===99?2:3;default:return S.assertNever(r,`Unexpected moduleKind ${r}`)}}function getFixesInfoForNonUMDImport({sourceFile:e,program:t,cancellationToken:n,host:r,preferences:i},o,a){const s=t.getTypeChecker();const c=t.getCompilerOptions();return flatMap(getSymbolNamesToImport(e,s,o,c),(s=>{if(s==="default"){return void 0}const c=isValidTypeOnlyAliasUseSite(o);const l=shouldUseRequire(e,t);const d=getExportInfos(s,isJSXTagName(o),getMeaningFromLocation(o),n,e,t,a,r,i);return arrayFrom(flatMapIterator(d.values(),(n=>getImportFixes(n,o.getStart(e),c,l,t,e,r,i).fixes)),(e=>({fix:e,symbolName:s,errorIdentifierText:o.text,isJsxNamespaceFix:s!==o.text})))}))}function getTypeOnlyPromotionFix(e,t,n,r){const i=r.getTypeChecker();const o=i.resolveName(n,t,111551,true);if(!o)return void 0;const a=i.getTypeOnlyAliasDeclaration(o);if(!a||getSourceFileOfNode(a)!==e)return void 0;return{kind:4,typeOnlyAliasDeclaration:a}}function getSymbolNamesToImport(e,t,n,r){const i=n.parent;if((isJsxOpeningLikeElement(i)||isJsxClosingElement(i))&&i.tagName===n&&jsxModeNeedsExplicitImport(r.jsx)){const r=t.getJsxNamespace(e);if(needsJsxNamespaceFix(r,n,t)){const e=!isIntrinsicJsxName(n.text)&&!t.resolveName(n.text,n,111551,false);return e?[n.text,r]:[r]}}return[n.text]}function needsJsxNamespaceFix(e,t,n){if(isIntrinsicJsxName(t.text))return true;const r=n.resolveName(e,t,111551,true);return!r||some(r.declarations,isTypeOnlyImportOrExportDeclaration)&&!(r.flags&111551)}function getExportInfos(e,t,n,r,i,o,a,s,c){var l;const d=createMultiMap();const p=createPackageJsonImportFilter(i,c,s);const u=(l=s.getModuleSpecifierCache)==null?void 0:l.call(s);const f=memoizeOne((e=>createModuleSpecifierResolutionHost(e?s.getPackageJsonAutoImportProvider():o,s)));function addSymbol(e,t,n,r,o,a){const s=f(a);if(isImportable(o,i,t,e,c,p,s,u)){const i=o.getTypeChecker();d.add(getUniqueSymbolId(n,i).toString(),{symbol:n,moduleSymbol:e,moduleFileName:t==null?void 0:t.fileName,exportKind:r,targetFlags:skipAlias(n,i).flags,isFromPackageJson:a})}}forEachExternalModuleToImportFrom(o,s,c,a,((i,o,a,s)=>{const c=a.getTypeChecker();r.throwIfCancellationRequested();const l=a.getCompilerOptions();const d=getDefaultLikeExportInfo(i,c);if(d&&symbolFlagsHaveMeaning(c.getSymbolFlags(d.symbol),n)&&forEachNameOfDefaultExport(d.symbol,c,zn(l),((n,r)=>(t?r??n:n)===e))){addSymbol(i,o,d.symbol,d.exportKind,a,s)}const p=c.tryGetMemberInModuleExportsAndProperties(e,i);if(p&&symbolFlagsHaveMeaning(c.getSymbolFlags(p),n)){addSymbol(i,o,p,0,a,s)}}));return d}function getExportEqualsImportKind(e,t,n){const r=$n(t);const i=hasJSFileExtension(e.fileName);if(!i&&Vn(t)>=5){return r?1:2}if(i){return e.externalModuleIndicator||n?r?1:2:3}for(const t of e.statements??d){if(isImportEqualsDeclaration(t)&&!nodeIsMissing(t.moduleReference)){return 3}}return r?1:3}function codeActionForFix(e,t,n,r,i,o,a){let s;const c=dm.ChangeTracker.with(e,(e=>{s=codeActionForFixWorker(e,t,n,r,i,o,a)}));return createCodeFixAction(Gd,c,s,Kd,wt.Add_all_missing_imports)}function codeActionForFixWorker(e,t,n,r,i,o,a){const s=getQuotePreference(t,a);switch(r.kind){case 0:addNamespaceQualifier(e,t,r);return[wt.Change_0_to_1,n,`${r.namespacePrefix}.${n}`];case 1:addImportType(e,t,r,s);return[wt.Change_0_to_1,n,getImportTypePrefix(r.moduleSpecifier,s)+n];case 2:{const{importClauseOrBindingPattern:o,importKind:s,addAsTypeOnly:c,moduleSpecifier:l}=r;doAddExistingFix(e,t,o,s===1?{name:n,addAsTypeOnly:c}:void 0,s===0?[{name:n,addAsTypeOnly:c}]:d,void 0,a);const p=stripQuotes(l);return i?[wt.Import_0_from_1,n,p]:[wt.Update_import_from_0,p]}case 3:{const{importKind:c,moduleSpecifier:l,addAsTypeOnly:d,useRequire:p,qualification:u}=r;const f=p?getNewRequires:getNewImports;const m=c===1?{name:n,addAsTypeOnly:d}:void 0;const _=c===0?[{name:n,addAsTypeOnly:d}]:void 0;const g=c===2||c===3?{importKind:c,name:(u==null?void 0:u.namespacePrefix)||n,addAsTypeOnly:d}:void 0;insertImports(e,t,f(l,s,m,_,g,o.getCompilerOptions(),a),true,a);if(u){addNamespaceQualifier(e,t,u)}return i?[wt.Import_0_from_1,n,l]:[wt.Add_import_from_0,l]}case 4:{const{typeOnlyAliasDeclaration:i}=r;const s=promoteFromTypeOnly(e,i,o,t,a);return s.kind===276?[wt.Remove_type_from_import_of_0_from_1,n,getModuleSpecifierText(s.parent.parent)]:[wt.Remove_type_from_import_declaration_from_0,getModuleSpecifierText(s)]}default:return S.assertNever(r,`Unexpected fix kind ${r.kind}`)}}function getModuleSpecifierText(e){var t,n;return e.kind===271?((n=tryCast((t=tryCast(e.moduleReference,isExternalModuleReference))==null?void 0:t.expression,isStringLiteralLike))==null?void 0:n.text)||e.moduleReference.getText():cast(e.parent.moduleSpecifier,isStringLiteral).text}function promoteFromTypeOnly(e,t,n,r,i){const o=n.getCompilerOptions();const a=o.verbatimModuleSyntax;switch(t.kind){case 276:if(t.isTypeOnly){if(t.parent.elements.length>1){const n=zr.updateImportSpecifier(t,false,t.propertyName,t.name);const{specifierComparer:o}=Zf.getNamedImportSpecifierComparerWithDetection(t.parent.parent.parent,i,r);const a=Zf.getImportSpecifierInsertionIndex(t.parent.elements,n,o);if(a!==t.parent.elements.indexOf(t)){e.delete(r,t);e.insertImportSpecifierAtIndex(r,n,t.parent,a);return t}}e.deleteRange(r,{pos:getTokenPosOfNode(t.getFirstToken()),end:getTokenPosOfNode(t.propertyName??t.name)});return t}else{S.assert(t.parent.parent.isTypeOnly);promoteImportClause(t.parent.parent);return t.parent.parent}case 273:promoteImportClause(t);return t;case 274:promoteImportClause(t.parent);return t.parent;case 271:e.deleteRange(r,t.getChildAt(1));return t;default:S.failBadSyntaxKind(t)}function promoteImportClause(s){var c;e.delete(r,getTypeKeywordOfTypeOnlyImport(s,r));if(!o.allowImportingTsExtensions){const t=tryGetModuleSpecifierFromDeclaration(s.parent);const i=t&&((c=n.getResolvedModuleFromModuleSpecifier(t,r))==null?void 0:c.resolvedModule);if(i==null?void 0:i.resolvedUsingTsExtension){const n=changeAnyExtension(t.text,getOutputExtension(t.text,o));e.replaceNode(r,t,zr.createStringLiteral(n))}}if(a){const n=tryCast(s.namedBindings,isNamedImports);if(n&&n.elements.length>1){const o=Zf.getNamedImportSpecifierComparerWithDetection(s.parent,i,r);if(o.isSorted!==false&&t.kind===276&&n.elements.indexOf(t)!==0){e.delete(r,t);e.insertImportSpecifierAtIndex(r,t,n,0)}for(const i of n.elements){if(i!==t&&!i.isTypeOnly){e.insertModifierBefore(r,156,i)}}}}}}function doAddExistingFix(e,t,n,r,i,o,a){var s;if(n.kind===206){if(o&&n.elements.some((e=>o.has(e)))){e.replaceNode(t,n,zr.createObjectBindingPattern([...n.elements.filter((e=>!o.has(e))),...r?[zr.createBindingElement(void 0,"default",r.name)]:d,...i.map((e=>zr.createBindingElement(void 0,e.propertyName,e.name)))]));return}if(r){addElementToBindingPattern(n,r.name,"default")}for(const e of i){addElementToBindingPattern(n,e.name,e.propertyName)}return}const c=n.isTypeOnly&&some([r,...i],(e=>(e==null?void 0:e.addAsTypeOnly)===4));const l=n.namedBindings&&((s=tryCast(n.namedBindings,isNamedImports))==null?void 0:s.elements);if(r){S.assert(!n.name,"Cannot add a default import to an import clause that already has one");e.insertNodeAt(t,n.getStart(t),zr.createIdentifier(r.name),{suffix:", "})}if(i.length){const{specifierComparer:r,isSorted:s}=Zf.getNamedImportSpecifierComparerWithDetection(n.parent,a,t);const d=toSorted(i.map((e=>zr.createImportSpecifier((!n.isTypeOnly||c)&&shouldUseTypeOnly(e,a),e.propertyName===void 0?void 0:zr.createIdentifier(e.propertyName),zr.createIdentifier(e.name)))),r);if(o){e.replaceNode(t,n.namedBindings,zr.updateNamedImports(n.namedBindings,toSorted([...l.filter((e=>!o.has(e))),...d],r)))}else if((l==null?void 0:l.length)&&s!==false){const i=c&&l?zr.updateNamedImports(n.namedBindings,sameMap(l,(e=>zr.updateImportSpecifier(e,true,e.propertyName,e.name)))).elements:l;for(const o of d){const a=Zf.getImportSpecifierInsertionIndex(i,o,r);e.insertImportSpecifierAtIndex(t,o,n.namedBindings,a)}}else if(l==null?void 0:l.length){for(const n of d){e.insertNodeInListAfter(t,last(l),n,l)}}else{if(d.length){const r=zr.createNamedImports(d);if(n.namedBindings){e.replaceNode(t,n.namedBindings,r)}else{e.insertNodeAfter(t,S.checkDefined(n.name,"Import clause must have either named imports or a default import"),r)}}}}if(c){e.delete(t,getTypeKeywordOfTypeOnlyImport(n,t));if(l){for(const n of l){e.insertModifierBefore(t,156,n)}}}function addElementToBindingPattern(n,r,i){const o=zr.createBindingElement(void 0,i,r);if(n.elements.length){e.insertNodeInListAfter(t,last(n.elements),o)}else{e.replaceNode(t,n,zr.createObjectBindingPattern([o]))}}}function addNamespaceQualifier(e,t,{namespacePrefix:n,usagePosition:r}){e.insertText(t,r,n+".")}function addImportType(e,t,{moduleSpecifier:n,usagePosition:r},i){e.insertText(t,r,getImportTypePrefix(n,i))}function getImportTypePrefix(e,t){const n=getQuoteFromPreference(t);return`import(${n}${e}${n}).`}function needsTypeOnly({addAsTypeOnly:e}){return e===2}function shouldUseTypeOnly(e,t){return needsTypeOnly(e)||!!t.preferTypeOnlyAutoImports&&e.addAsTypeOnly!==4}function getNewImports(e,t,n,r,i,o,a){const s=makeStringLiteral(e,t);let c;if(n!==void 0||(r==null?void 0:r.length)){const i=(!n||needsTypeOnly(n))&&every(r,needsTypeOnly)||(o.verbatimModuleSyntax||a.preferTypeOnlyAutoImports)&&(n==null?void 0:n.addAsTypeOnly)!==4&&!some(r,(e=>e.addAsTypeOnly===4));c=combine(c,makeImport(n&&zr.createIdentifier(n.name),r==null?void 0:r.map((e=>zr.createImportSpecifier(!i&&shouldUseTypeOnly(e,a),e.propertyName===void 0?void 0:zr.createIdentifier(e.propertyName),zr.createIdentifier(e.name)))),e,t,i))}if(i){const e=i.importKind===3?zr.createImportEqualsDeclaration(void 0,shouldUseTypeOnly(i,a),zr.createIdentifier(i.name),zr.createExternalModuleReference(s)):zr.createImportDeclaration(void 0,zr.createImportClause(shouldUseTypeOnly(i,a),void 0,zr.createNamespaceImport(zr.createIdentifier(i.name))),s,void 0);c=combine(c,e)}return S.checkDefined(c)}function getNewRequires(e,t,n,r,i){const o=makeStringLiteral(e,t);let a;if(n||(r==null?void 0:r.length)){const e=(r==null?void 0:r.map((({name:e,propertyName:t})=>zr.createBindingElement(void 0,t,e))))||[];if(n){e.unshift(zr.createBindingElement(void 0,"default",n.name))}const t=createConstEqualsRequireDeclaration(zr.createObjectBindingPattern(e),o);a=combine(a,t)}if(i){const e=createConstEqualsRequireDeclaration(i.name,o);a=combine(a,e)}return S.checkDefined(a)}function createConstEqualsRequireDeclaration(e,t){return zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(typeof e==="string"?zr.createIdentifier(e):e,void 0,void 0,zr.createCallExpression(zr.createIdentifier("require"),void 0,[t]))],2))}function symbolFlagsHaveMeaning(e,t){return t===7?true:t&1?!!(e&111551):t&2?!!(e&788968):t&4?!!(e&1920):false}function getImpliedNodeFormatForEmit(e,t){return isFullSourceFile(e)?t.getImpliedNodeFormatForEmit(e):getImpliedNodeFormatForEmitWorker(e,t.getCompilerOptions())}function getEmitModuleFormatOfFile(e,t){return isFullSourceFile(e)?t.getEmitModuleFormatOfFile(e):getEmitModuleFormatOfFileWorker(e,t.getCompilerOptions())}var Qd="addMissingConstraint";var Xd=[wt.Type_0_is_not_comparable_to_type_1.code,wt.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,wt.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,wt.Type_0_is_not_assignable_to_type_1.code,wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,wt.Property_0_is_incompatible_with_index_signature.code,wt.Property_0_in_type_1_is_not_assignable_to_type_2.code,wt.Type_0_does_not_satisfy_the_constraint_1.code];registerCodeFix({errorCodes:Xd,getCodeActions(e){const{sourceFile:t,span:n,program:r,preferences:i,host:o}=e;const a=getInfo6(r,t,n);if(a===void 0)return;const s=dm.ChangeTracker.with(e,(e=>addMissingConstraint(e,r,i,o,t,a)));return[createCodeFixAction(Qd,s,wt.Add_extends_constraint,Qd,wt.Add_extends_constraint_to_all_type_parameters)]},fixIds:[Qd],getAllCodeActions:e=>{const{program:t,preferences:n,host:r}=e;const i=new Set;return createCombinedCodeActions(dm.ChangeTracker.with(e,(o=>{eachDiagnostic(e,Xd,(e=>{const a=getInfo6(t,e.file,createTextSpan(e.start,e.length));if(a){if(addToSeen(i,getNodeId(a.declaration))){return addMissingConstraint(o,t,n,r,e.file,a)}}return void 0}))})))}});function getInfo6(e,t,n){const r=find(e.getSemanticDiagnostics(t),(e=>e.start===n.start&&e.length===n.length));if(r===void 0||r.relatedInformation===void 0)return;const i=find(r.relatedInformation,(e=>e.code===wt.This_type_parameter_might_need_an_extends_0_constraint.code));if(i===void 0||i.file===void 0||i.start===void 0||i.length===void 0)return;let o=findAncestorMatchingSpan(i.file,createTextSpan(i.start,i.length));if(o===void 0)return;if(isIdentifier(o)&&isTypeParameterDeclaration(o.parent)){o=o.parent}if(isTypeParameterDeclaration(o)){if(isMappedTypeNode(o.parent))return;const r=getTokenAtPosition(t,n.start);const a=e.getTypeChecker();const s=tryGetConstraintType(a,r)||tryGetConstraintFromDiagnosticMessage(i.messageText);return{constraint:s,declaration:o,token:r}}return void 0}function addMissingConstraint(e,t,n,r,i,o){const{declaration:a,constraint:s}=o;const c=t.getTypeChecker();if(isString(s)){e.insertText(i,a.name.end,` extends ${s}`)}else{const o=zn(t.getCompilerOptions());const l=getNoopSymbolTrackerWithResolver({program:t,host:r});const d=createImportAdder(i,t,n,r);const p=typeToAutoImportableTypeNode(c,d,s,void 0,o,void 0,void 0,l);if(p){e.replaceNode(i,a,zr.updateTypeParameterDeclaration(a,void 0,a.name,p,a.default));d.writeFixes(e)}}}function tryGetConstraintFromDiagnosticMessage(e){const[,t]=flattenDiagnosticMessageText(e,"\n",0).match(/`extends (.*)`/)||[];return t}function tryGetConstraintType(e,t){if(isTypeNode(t.parent)){return e.getTypeArgumentConstraint(t.parent)}const n=isExpression(t)?e.getContextualType(t):void 0;return n||e.getTypeAtLocation(t)}var Yd="fixOverrideModifier";var Zd="fixAddOverrideModifier";var ep="fixRemoveOverrideModifier";var tp=[wt.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code,wt.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code,wt.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code,wt.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code,wt.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code,wt.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code,wt.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code];var np={[wt.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:wt.Add_override_modifier,fixId:Zd,fixAllDescriptions:wt.Add_all_missing_override_modifiers},[wt.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:wt.Add_override_modifier,fixId:Zd,fixAllDescriptions:wt.Add_all_missing_override_modifiers},[wt.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]:{descriptions:wt.Remove_override_modifier,fixId:ep,fixAllDescriptions:wt.Remove_all_unnecessary_override_modifiers},[wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code]:{descriptions:wt.Remove_override_modifier,fixId:ep,fixAllDescriptions:wt.Remove_override_modifier},[wt.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]:{descriptions:wt.Add_override_modifier,fixId:Zd,fixAllDescriptions:wt.Add_all_missing_override_modifiers},[wt.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:wt.Add_override_modifier,fixId:Zd,fixAllDescriptions:wt.Add_all_missing_override_modifiers},[wt.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]:{descriptions:wt.Add_override_modifier,fixId:Zd,fixAllDescriptions:wt.Remove_all_unnecessary_override_modifiers},[wt.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]:{descriptions:wt.Remove_override_modifier,fixId:ep,fixAllDescriptions:wt.Remove_all_unnecessary_override_modifiers},[wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code]:{descriptions:wt.Remove_override_modifier,fixId:ep,fixAllDescriptions:wt.Remove_all_unnecessary_override_modifiers}};registerCodeFix({errorCodes:tp,getCodeActions:function getCodeActionsToFixOverrideModifierIssues(e){const{errorCode:t,span:n}=e;const r=np[t];if(!r)return d;const{descriptions:i,fixId:o,fixAllDescriptions:a}=r;const s=dm.ChangeTracker.with(e,(r=>dispatchChanges(r,e,t,n.start)));return[createCodeFixActionMaybeFixAll(Yd,s,i,o,a)]},fixIds:[Yd,Zd,ep],getAllCodeActions:e=>codeFixAll(e,tp,((t,n)=>{const{code:r,start:i}=n;const o=np[r];if(!o||o.fixId!==e.fixId){return}dispatchChanges(t,e,r,i)}))});function dispatchChanges(e,t,n,r){switch(n){case wt.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code:case wt.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:case wt.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code:case wt.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code:case wt.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:return doAddOverrideModifierChange(e,t.sourceFile,r);case wt.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code:case wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code:case wt.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code:case wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code:return doRemoveOverrideModifierChange(e,t.sourceFile,r);default:S.fail("Unexpected error code: "+n)}}function doAddOverrideModifierChange(e,t,n){const r=findContainerClassElementLike(t,n);if(isSourceFileJS(t)){e.addJSDocTags(t,r,[zr.createJSDocOverrideTag(zr.createIdentifier("override"))]);return}const i=r.modifiers||d;const o=find(i,isStaticModifier);const a=find(i,isAbstractModifier);const s=find(i,(e=>isAccessibilityModifier(e.kind)));const c=findLast(i,isDecorator);const l=a?a.end:o?o.end:s?s.end:c?skipTrivia(t.text,c.end):r.getStart(t);const p=s||o||a?{prefix:" "}:{suffix:" "};e.insertModifierAt(t,l,164,p)}function doRemoveOverrideModifierChange(e,t,n){const r=findContainerClassElementLike(t,n);if(isSourceFileJS(t)){e.filterJSDocTags(t,r,not(isJSDocOverrideTag));return}const i=find(r.modifiers,isOverrideModifier);S.assertIsDefined(i);e.deleteModifier(t,i)}function isClassElementLikeHasJSDoc(e){switch(e.kind){case 176:case 172:case 174:case 177:case 178:return true;case 169:return isParameterPropertyDeclaration(e,e.parent);default:return false}}function findContainerClassElementLike(e,t){const n=getTokenAtPosition(e,t);const r=findAncestor(n,(e=>{if(isClassLike(e))return"quit";return isClassElementLikeHasJSDoc(e)}));S.assert(r&&isClassElementLikeHasJSDoc(r));return r}var rp="fixNoPropertyAccessFromIndexSignature";var ip=[wt.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code];registerCodeFix({errorCodes:ip,fixIds:[rp],getCodeActions(e){const{sourceFile:t,span:n,preferences:r}=e;const i=getPropertyAccessExpression(t,n.start);const o=dm.ChangeTracker.with(e,(t=>doChange14(t,e.sourceFile,i,r)));return[createCodeFixAction(rp,o,[wt.Use_element_access_for_0,i.name.text],rp,wt.Use_element_access_for_all_undeclared_properties)]},getAllCodeActions:e=>codeFixAll(e,ip,((t,n)=>doChange14(t,n.file,getPropertyAccessExpression(n.file,n.start),e.preferences)))});function doChange14(e,t,n,r){const i=getQuotePreference(t,r);const o=zr.createStringLiteral(n.name.text,i===0);e.replaceNode(t,n,isPropertyAccessChain(n)?zr.createElementAccessChain(n.expression,n.questionDotToken,o):zr.createElementAccessExpression(n.expression,o))}function getPropertyAccessExpression(e,t){return cast(getTokenAtPosition(e,t).parent,isPropertyAccessExpression)}var op="fixImplicitThis";var ap=[wt.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];registerCodeFix({errorCodes:ap,getCodeActions:function getCodeActionsToFixImplicitThis(e){const{sourceFile:t,program:n,span:r}=e;let i;const o=dm.ChangeTracker.with(e,(e=>{i=doChange15(e,t,r.start,n.getTypeChecker())}));return i?[createCodeFixAction(op,o,i,op,wt.Fix_all_implicit_this_errors)]:d},fixIds:[op],getAllCodeActions:e=>codeFixAll(e,ap,((t,n)=>{doChange15(t,n.file,n.start,e.program.getTypeChecker())}))});function doChange15(e,t,n,r){const i=getTokenAtPosition(t,n);if(!isThis(i))return void 0;const o=getThisContainer(i,false,false);if(!isFunctionDeclaration(o)&&!isFunctionExpression(o))return void 0;if(!isSourceFile(getThisContainer(o,false,false))){const n=S.checkDefined(findChildOfKind(o,100,t));const{name:i}=o;const a=S.checkDefined(o.body);if(isFunctionExpression(o)){if(i&&Rf.Core.isSymbolReferencedInFile(i,r,t,a)){return void 0}e.delete(t,n);if(i){e.delete(t,i)}e.insertText(t,a.pos," =>");return[wt.Convert_function_expression_0_to_arrow_function,i?i.text:ec]}else{e.replaceNode(t,n,zr.createToken(87));e.insertText(t,i.end," = ");e.insertText(t,a.pos," =>");return[wt.Convert_function_declaration_0_to_arrow_function,i.text]}}}var sp="fixImportNonExportedMember";var cp=[wt.Module_0_declares_1_locally_but_it_is_not_exported.code];registerCodeFix({errorCodes:cp,fixIds:[sp],getCodeActions(e){const{sourceFile:t,span:n,program:r}=e;const i=getInfo7(t,n.start,r);if(i===void 0)return void 0;const o=dm.ChangeTracker.with(e,(e=>doChange16(e,r,i)));return[createCodeFixAction(sp,o,[wt.Export_0_from_module_1,i.exportName.node.text,i.moduleSpecifier],sp,wt.Export_all_referenced_locals)]},getAllCodeActions(e){const{program:t}=e;return createCombinedCodeActions(dm.ChangeTracker.with(e,(n=>{const r=new Map;eachDiagnostic(e,cp,(e=>{const i=getInfo7(e.file,e.start,t);if(i===void 0)return void 0;const{exportName:o,node:a,moduleSourceFile:s}=i;if(tryGetExportDeclaration(s,o.isTypeOnly)===void 0&&canHaveExportModifier(a)){n.insertExportModifier(s,a)}else{const e=r.get(s)||{typeOnlyExports:[],exports:[]};if(o.isTypeOnly){e.typeOnlyExports.push(o)}else{e.exports.push(o)}r.set(s,e)}}));r.forEach(((e,r)=>{const i=tryGetExportDeclaration(r,true);if(i&&i.isTypeOnly){doChanges(n,t,r,e.typeOnlyExports,i);doChanges(n,t,r,e.exports,tryGetExportDeclaration(r,false))}else{doChanges(n,t,r,[...e.exports,...e.typeOnlyExports],i)}}))})))}});function getInfo7(e,t,n){var r,i;const o=getTokenAtPosition(e,t);if(isIdentifier(o)){const t=findAncestor(o,isImportDeclaration);if(t===void 0)return void 0;const a=isStringLiteral(t.moduleSpecifier)?t.moduleSpecifier:void 0;if(a===void 0)return void 0;const s=(r=n.getResolvedModuleFromModuleSpecifier(a,e))==null?void 0:r.resolvedModule;if(s===void 0)return void 0;const c=n.getSourceFile(s.resolvedFileName);if(c===void 0||isSourceFileFromLibrary(n,c))return void 0;const l=c.symbol;const d=(i=tryCast(l.valueDeclaration,canHaveLocals))==null?void 0:i.locals;if(d===void 0)return void 0;const p=d.get(o.escapedText);if(p===void 0)return void 0;const u=getNodeOfSymbol(p);if(u===void 0)return void 0;const f={node:o,isTypeOnly:isTypeDeclaration(u)};return{exportName:f,node:u,moduleSourceFile:c,moduleSpecifier:a.text}}return void 0}function doChange16(e,t,{exportName:n,node:r,moduleSourceFile:i}){const o=tryGetExportDeclaration(i,n.isTypeOnly);if(o){updateExport(e,t,i,o,[n])}else if(canHaveExportModifier(r)){e.insertExportModifier(i,r)}else{createExport(e,t,i,[n])}}function doChanges(e,t,n,r,i){if(length(r)){if(i){updateExport(e,t,n,i,r)}else{createExport(e,t,n,r)}}}function tryGetExportDeclaration(e,t){const predicate=e=>isExportDeclaration(e)&&(t&&e.isTypeOnly||!e.isTypeOnly);return findLast(e.statements,predicate)}function updateExport(e,t,n,r,i){const o=r.exportClause&&isNamedExports(r.exportClause)?r.exportClause.elements:zr.createNodeArray([]);const a=!r.isTypeOnly&&!!(Gn(t.getCompilerOptions())||find(o,(e=>e.isTypeOnly)));e.replaceNode(n,r,zr.updateExportDeclaration(r,r.modifiers,r.isTypeOnly,zr.createNamedExports(zr.createNodeArray([...o,...createExportSpecifiers(i,a)],o.hasTrailingComma)),r.moduleSpecifier,r.attributes))}function createExport(e,t,n,r){e.insertNodeAtEndOfScope(n,n,zr.createExportDeclaration(void 0,false,zr.createNamedExports(createExportSpecifiers(r,Gn(t.getCompilerOptions()))),void 0,void 0))}function createExportSpecifiers(e,t){return zr.createNodeArray(map(e,(e=>zr.createExportSpecifier(t&&e.isTypeOnly,void 0,e.node))))}function getNodeOfSymbol(e){if(e.valueDeclaration===void 0){return firstOrUndefined(e.declarations)}const t=e.valueDeclaration;const n=isVariableDeclaration(t)?tryCast(t.parent.parent,isVariableStatement):void 0;return n&&length(n.declarationList.declarations)===1?n:t}var lp="fixIncorrectNamedTupleSyntax";var dp=[wt.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,wt.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code];registerCodeFix({errorCodes:dp,getCodeActions:function getCodeActionsToFixIncorrectNamedTupleSyntax(e){const{sourceFile:t,span:n}=e;const r=getNamedTupleMember(t,n.start);const i=dm.ChangeTracker.with(e,(e=>doChange17(e,t,r)));return[createCodeFixAction(lp,i,wt.Move_labeled_tuple_element_modifiers_to_labels,lp,wt.Move_labeled_tuple_element_modifiers_to_labels)]},fixIds:[lp]});function getNamedTupleMember(e,t){const n=getTokenAtPosition(e,t);return findAncestor(n,(e=>e.kind===202))}function doChange17(e,t,n){if(!n){return}let r=n.type;let i=false;let o=false;while(r.kind===190||r.kind===191||r.kind===196){if(r.kind===190){i=true}else if(r.kind===191){o=true}r=r.type}const a=zr.updateNamedTupleMember(n,n.dotDotDotToken||(o?zr.createToken(26):void 0),n.name,n.questionToken||(i?zr.createToken(58):void 0),r);if(a===n){return}e.replaceNode(t,n,a)}var pp="fixSpelling";var up=[wt.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,wt.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,wt.Cannot_find_name_0_Did_you_mean_1.code,wt.Could_not_find_name_0_Did_you_mean_1.code,wt.Cannot_find_namespace_0_Did_you_mean_1.code,wt.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,wt.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,wt._0_has_no_exported_member_named_1_Did_you_mean_2.code,wt.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,wt.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,wt.No_overload_matches_this_call.code,wt.Type_0_is_not_assignable_to_type_1.code];registerCodeFix({errorCodes:up,getCodeActions(e){const{sourceFile:t,errorCode:n}=e;const r=getInfo8(t,e.span.start,e,n);if(!r)return void 0;const{node:i,suggestedSymbol:o}=r;const a=zn(e.host.getCompilationSettings());const s=dm.ChangeTracker.with(e,(e=>doChange18(e,t,i,o,a)));return[createCodeFixAction("spelling",s,[wt.Change_spelling_to_0,symbolName(o)],pp,wt.Fix_all_detected_spelling_errors)]},fixIds:[pp],getAllCodeActions:e=>codeFixAll(e,up,((t,n)=>{const r=getInfo8(n.file,n.start,e,n.code);const i=zn(e.host.getCompilationSettings());if(r)doChange18(t,e.sourceFile,r.node,r.suggestedSymbol,i)}))});function getInfo8(e,t,n,r){const i=getTokenAtPosition(e,t);const o=i.parent;if((r===wt.No_overload_matches_this_call.code||r===wt.Type_0_is_not_assignable_to_type_1.code)&&!isJsxAttribute(o))return void 0;const a=n.program.getTypeChecker();let s;if(isPropertyAccessExpression(o)&&o.name===i){S.assert(isMemberName(i),"Expected an identifier for spelling (property access)");let e=a.getTypeAtLocation(o.expression);if(o.flags&64){e=a.getNonNullableType(e)}s=a.getSuggestedSymbolForNonexistentProperty(i,e)}else if(isBinaryExpression(o)&&o.operatorToken.kind===103&&o.left===i&&isPrivateIdentifier(i)){const e=a.getTypeAtLocation(o.right);s=a.getSuggestedSymbolForNonexistentProperty(i,e)}else if(isQualifiedName(o)&&o.right===i){const e=a.getSymbolAtLocation(o.left);if(e&&e.flags&1536){s=a.getSuggestedSymbolForNonexistentModule(o.right,e)}}else if(isImportSpecifier(o)&&o.name===i){S.assertNode(i,isIdentifier,"Expected an identifier for spelling (import)");const t=findAncestor(i,isImportDeclaration);const r=getResolvedSourceFileFromImportDeclaration(n,t,e);if(r&&r.symbol){s=a.getSuggestedSymbolForNonexistentModule(i,r.symbol)}}else if(isJsxAttribute(o)&&o.name===i){S.assertNode(i,isIdentifier,"Expected an identifier for JSX attribute");const e=findAncestor(i,isJsxOpeningLikeElement);const t=a.getContextualTypeForArgumentAtIndex(e,0);s=a.getSuggestedSymbolForNonexistentJSXAttribute(i,t)}else if(hasOverrideModifier(o)&&isClassElement(o)&&o.name===i){const e=findAncestor(i,isClassLike);const t=e?getEffectiveBaseTypeNode(e):void 0;const n=t?a.getTypeAtLocation(t):void 0;if(n){s=a.getSuggestedSymbolForNonexistentClassMember(getTextOfNode(i),n)}}else{const e=getMeaningFromLocation(i);const t=getTextOfNode(i);S.assert(t!==void 0,"name should be defined");s=a.getSuggestedSymbolForNonexistentSymbol(i,t,convertSemanticMeaningToSymbolFlags(e))}return s===void 0?void 0:{node:i,suggestedSymbol:s}}function doChange18(e,t,n,r,i){const o=symbolName(r);if(!isIdentifierText(o,i)&&isPropertyAccessExpression(n.parent)){const i=r.valueDeclaration;if(i&&isNamedDeclaration(i)&&isPrivateIdentifier(i.name)){e.replaceNode(t,n,zr.createIdentifier(o))}else{e.replaceNode(t,n.parent,zr.createElementAccessExpression(n.parent.expression,zr.createStringLiteral(o)))}}else{e.replaceNode(t,n,zr.createIdentifier(o))}}function convertSemanticMeaningToSymbolFlags(e){let t=0;if(e&4){t|=1920}if(e&2){t|=788968}if(e&1){t|=111551}return t}function getResolvedSourceFileFromImportDeclaration(e,t,n){var r;if(!t||!isStringLiteralLike(t.moduleSpecifier))return void 0;const i=(r=e.program.getResolvedModuleFromModuleSpecifier(t.moduleSpecifier,n))==null?void 0:r.resolvedModule;if(!i)return void 0;return e.program.getSourceFile(i.resolvedFileName)}var fp="returnValueCorrect";var mp="fixAddReturnStatement";var _p="fixRemoveBracesFromArrowFunctionBody";var gp="fixWrapTheBlockWithParen";var yp=[wt.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code,wt.Type_0_is_not_assignable_to_type_1.code,wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code];registerCodeFix({errorCodes:yp,fixIds:[mp,_p,gp],getCodeActions:function getCodeActionsToCorrectReturnValue(e){const{program:t,sourceFile:n,span:{start:r},errorCode:i}=e;const o=getInfo9(t.getTypeChecker(),n,r,i);if(!o)return void 0;if(o.kind===0){return append([getActionForfixAddReturnStatement(e,o.expression,o.statement)],isArrowFunction(o.declaration)?getActionForFixRemoveBracesFromArrowFunctionBody(e,o.declaration,o.expression,o.commentSource):void 0)}else{return[getActionForfixWrapTheBlockWithParen(e,o.declaration,o.expression)]}},getAllCodeActions:e=>codeFixAll(e,yp,((t,n)=>{const r=getInfo9(e.program.getTypeChecker(),n.file,n.start,n.code);if(!r)return void 0;switch(e.fixId){case mp:addReturnStatement(t,n.file,r.expression,r.statement);break;case _p:if(!isArrowFunction(r.declaration))return void 0;removeBlockBodyBrace(t,n.file,r.declaration,r.expression,r.commentSource,false);break;case gp:if(!isArrowFunction(r.declaration))return void 0;wrapBlockWithParen(t,n.file,r.declaration,r.expression);break;default:S.fail(JSON.stringify(e.fixId))}}))});function createObjectTypeFromLabeledExpression(e,t,n){const r=e.createSymbol(4,t.escapedText);r.links.type=e.getTypeAtLocation(n);const i=createSymbolTable([r]);return e.createAnonymousType(void 0,i,[],[],[])}function getFixInfo(e,t,n,r){if(!t.body||!isBlock(t.body)||length(t.body.statements)!==1)return void 0;const i=first(t.body.statements);if(isExpressionStatement(i)&&checkFixedAssignableTo(e,t,e.getTypeAtLocation(i.expression),n,r)){return{declaration:t,kind:0,expression:i.expression,statement:i,commentSource:i.expression}}else if(isLabeledStatement(i)&&isExpressionStatement(i.statement)){const o=zr.createObjectLiteralExpression([zr.createPropertyAssignment(i.label,i.statement.expression)]);const a=createObjectTypeFromLabeledExpression(e,i.label,i.statement.expression);if(checkFixedAssignableTo(e,t,a,n,r)){return isArrowFunction(t)?{declaration:t,kind:1,expression:o,statement:i,commentSource:i.statement.expression}:{declaration:t,kind:0,expression:o,statement:i,commentSource:i.statement.expression}}}else if(isBlock(i)&&length(i.statements)===1){const o=first(i.statements);if(isLabeledStatement(o)&&isExpressionStatement(o.statement)){const a=zr.createObjectLiteralExpression([zr.createPropertyAssignment(o.label,o.statement.expression)]);const s=createObjectTypeFromLabeledExpression(e,o.label,o.statement.expression);if(checkFixedAssignableTo(e,t,s,n,r)){return{declaration:t,kind:0,expression:a,statement:i,commentSource:o}}}}return void 0}function checkFixedAssignableTo(e,t,n,r,i){if(i){const r=e.getSignatureFromDeclaration(t);if(r){if(hasSyntacticModifier(t,1024)){n=e.createPromiseType(n)}const i=e.createSignature(t,r.typeParameters,r.thisParameter,r.parameters,n,void 0,r.minArgumentCount,r.flags);n=e.createAnonymousType(void 0,createSymbolTable(),[i],[],[])}else{n=e.getAnyType()}}return e.isTypeAssignableTo(n,r)}function getInfo9(e,t,n,r){const i=getTokenAtPosition(t,n);if(!i.parent)return void 0;const o=findAncestor(i.parent,isFunctionLikeDeclaration);switch(r){case wt.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code:if(!o||!o.body||!o.type||!rangeContainsRange(o.type,i))return void 0;return getFixInfo(e,o,e.getTypeFromTypeNode(o.type),false);case wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:if(!o||!isCallExpression(o.parent)||!o.body)return void 0;const t=o.parent.arguments.indexOf(o);if(t===-1)return void 0;const n=e.getContextualTypeForArgumentAtIndex(o.parent,t);if(!n)return void 0;return getFixInfo(e,o,n,true);case wt.Type_0_is_not_assignable_to_type_1.code:if(!isDeclarationName(i)||!isVariableLike(i.parent)&&!isJsxAttribute(i.parent))return void 0;const r=getVariableLikeInitializer(i.parent);if(!r||!isFunctionLikeDeclaration(r)||!r.body)return void 0;return getFixInfo(e,r,e.getTypeAtLocation(i.parent),true)}return void 0}function getVariableLikeInitializer(e){switch(e.kind){case 260:case 169:case 208:case 172:case 303:return e.initializer;case 291:return e.initializer&&(isJsxExpression(e.initializer)?e.initializer.expression:void 0);case 304:case 171:case 306:case 348:case 341:return void 0}}function addReturnStatement(e,t,n,r){suppressLeadingAndTrailingTrivia(n);const i=probablyUsesSemicolons(t);e.replaceNode(t,r,zr.createReturnStatement(n),{leadingTriviaOption:dm.LeadingTriviaOption.Exclude,trailingTriviaOption:dm.TrailingTriviaOption.Exclude,suffix:i?";":void 0})}function removeBlockBodyBrace(e,t,n,r,i,o){const a=o||needsParentheses(r)?zr.createParenthesizedExpression(r):r;suppressLeadingAndTrailingTrivia(i);copyComments(i,a);e.replaceNode(t,n.body,a)}function wrapBlockWithParen(e,t,n,r){e.replaceNode(t,n.body,zr.createParenthesizedExpression(r))}function getActionForfixAddReturnStatement(e,t,n){const r=dm.ChangeTracker.with(e,(r=>addReturnStatement(r,e.sourceFile,t,n)));return createCodeFixAction(fp,r,wt.Add_a_return_statement,mp,wt.Add_all_missing_return_statement)}function getActionForFixRemoveBracesFromArrowFunctionBody(e,t,n,r){const i=dm.ChangeTracker.with(e,(i=>removeBlockBodyBrace(i,e.sourceFile,t,n,r,false)));return createCodeFixAction(fp,i,wt.Remove_braces_from_arrow_function_body,_p,wt.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues)}function getActionForfixWrapTheBlockWithParen(e,t,n){const r=dm.ChangeTracker.with(e,(r=>wrapBlockWithParen(r,e.sourceFile,t,n)));return createCodeFixAction(fp,r,wt.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal,gp,wt.Wrap_all_object_literal_with_parentheses)}var hp="fixMissingMember";var Tp="fixMissingProperties";var Sp="fixMissingAttributes";var vp="fixMissingFunctionDeclaration";var xp=[wt.Property_0_does_not_exist_on_type_1.code,wt.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,wt.Property_0_is_missing_in_type_1_but_required_in_type_2.code,wt.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,wt.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,wt.Cannot_find_name_0.code,wt.Type_0_does_not_satisfy_the_expected_type_1.code];registerCodeFix({errorCodes:xp,getCodeActions(e){const t=e.program.getTypeChecker();const n=getInfo10(e.sourceFile,e.span.start,e.errorCode,t,e.program);if(!n){return void 0}if(n.kind===3){const t=dm.ChangeTracker.with(e,(t=>addObjectLiteralProperties(t,e,n)));return[createCodeFixAction(Tp,t,wt.Add_missing_properties,Tp,wt.Add_all_missing_properties)]}if(n.kind===4){const t=dm.ChangeTracker.with(e,(t=>addJsxAttributes(t,e,n)));return[createCodeFixAction(Sp,t,wt.Add_missing_attributes,Sp,wt.Add_all_missing_attributes)]}if(n.kind===2||n.kind===5){const t=dm.ChangeTracker.with(e,(t=>addFunctionDeclaration(t,e,n)));return[createCodeFixAction(vp,t,[wt.Add_missing_function_declaration_0,n.token.text],vp,wt.Add_all_missing_function_declarations)]}if(n.kind===1){const t=dm.ChangeTracker.with(e,(t=>addEnumMemberDeclaration(t,e.program.getTypeChecker(),n)));return[createCodeFixAction(hp,t,[wt.Add_missing_enum_member_0,n.token.text],hp,wt.Add_all_missing_members)]}return concatenate(getActionsForMissingMethodDeclaration(e,n),getActionsForMissingMemberDeclaration(e,n))},fixIds:[hp,vp,Tp,Sp],getAllCodeActions:e=>{const{program:t,fixId:n}=e;const r=t.getTypeChecker();const i=new Set;const o=new Map;return createCombinedCodeActions(dm.ChangeTracker.with(e,(t=>{eachDiagnostic(e,xp,(a=>{const s=getInfo10(a.file,a.start,a.code,r,e.program);if(s===void 0)return;const c=getNodeId(s.parentDeclaration)+"#"+(s.kind===3?s.identifier||getNodeId(s.token):s.token.text);if(!addToSeen(i,c))return;if(n===vp&&(s.kind===2||s.kind===5)){addFunctionDeclaration(t,e,s)}else if(n===Tp&&s.kind===3){addObjectLiteralProperties(t,e,s)}else if(n===Sp&&s.kind===4){addJsxAttributes(t,e,s)}else{if(s.kind===1){addEnumMemberDeclaration(t,r,s)}if(s.kind===0){const{parentDeclaration:e,token:t}=s;const n=getOrUpdate(o,e,(()=>[]));if(!n.some((e=>e.token.text===t.text))){n.push(s)}}}}));o.forEach(((n,i)=>{const a=isTypeLiteralNode(i)?void 0:getAllSupers(i,r);for(const i of n){if(a==null?void 0:a.some((e=>{const t=o.get(e);return!!t&&t.some((({token:e})=>e.text===i.token.text))})))continue;const{parentDeclaration:n,declSourceFile:s,modifierFlags:c,token:l,call:d,isJSFile:p}=i;if(d&&!isPrivateIdentifier(l)){addMethodDeclaration(e,t,d,l,c&256,n,s)}else{if(p&&!isInterfaceDeclaration(n)&&!isTypeLiteralNode(n)){addMissingMemberInJs(t,s,n,l,!!(c&256))}else{const e=getTypeNode2(r,n,l);addPropertyDeclaration(t,s,n,l.text,e,c&256)}}}}))})))}});function getInfo10(e,t,n,r,i){var o,a;const s=getTokenAtPosition(e,t);const c=s.parent;if(n===wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code){if(!(s.kind===19&&isObjectLiteralExpression(c)&&isCallExpression(c.parent)))return void 0;const e=findIndex(c.parent.arguments,(e=>e===c));if(e<0)return void 0;const t=r.getResolvedSignature(c.parent);if(!(t&&t.declaration&&t.parameters[e]))return void 0;const n=t.parameters[e].valueDeclaration;if(!(n&&isParameter(n)&&isIdentifier(n.name)))return void 0;const i=arrayFrom(r.getUnmatchedProperties(r.getTypeAtLocation(c),r.getParameterType(t,e).getNonNullableType(),false,false));if(!length(i))return void 0;return{kind:3,token:n.name,identifier:n.name.text,properties:i,parentDeclaration:c}}if(s.kind===19||isSatisfiesExpression(c)||isReturnStatement(c)){const e=(isSatisfiesExpression(c)||isReturnStatement(c))&&c.expression?c.expression:c;if(isObjectLiteralExpression(e)){const t=isSatisfiesExpression(c)?r.getTypeFromTypeNode(c.type):r.getContextualType(e)||r.getTypeAtLocation(e);const n=arrayFrom(r.getUnmatchedProperties(r.getTypeAtLocation(c),t.getNonNullableType(),false,false));if(!length(n))return void 0;return{kind:3,token:c,identifier:void 0,properties:n,parentDeclaration:e,indentation:isReturnStatement(e.parent)||isYieldExpression(e.parent)?0:void 0}}}if(!isMemberName(s))return void 0;if(isIdentifier(s)&&hasInitializer(c)&&c.initializer&&isObjectLiteralExpression(c.initializer)){const e=(o=r.getContextualType(s)||r.getTypeAtLocation(s))==null?void 0:o.getNonNullableType();const t=arrayFrom(r.getUnmatchedProperties(r.getTypeAtLocation(c.initializer),e,false,false));if(!length(t))return void 0;return{kind:3,token:s,identifier:s.text,properties:t,parentDeclaration:c.initializer}}if(isIdentifier(s)&&isJsxOpeningLikeElement(s.parent)){const e=zn(i.getCompilerOptions());const t=getUnmatchedAttributes(r,e,s.parent);if(!length(t))return void 0;return{kind:4,token:s,attributes:t,parentDeclaration:s.parent}}if(isIdentifier(s)){const t=(a=r.getContextualType(s))==null?void 0:a.getNonNullableType();if(t&&getObjectFlags(t)&16){const n=firstOrUndefined(r.getSignaturesOfType(t,0));if(n===void 0)return void 0;return{kind:5,token:s,signature:n,sourceFile:e,parentDeclaration:findScope(s)}}if(isCallExpression(c)&&c.expression===s){return{kind:2,token:s,call:c,sourceFile:e,modifierFlags:0,parentDeclaration:findScope(s)}}}if(!isPropertyAccessExpression(c))return void 0;const l=skipConstraint(r.getTypeAtLocation(c.expression));const d=l.symbol;if(!d||!d.declarations)return void 0;if(isIdentifier(s)&&isCallExpression(c.parent)){const t=find(d.declarations,isModuleDeclaration);const n=t==null?void 0:t.getSourceFile();if(t&&n&&!isSourceFileFromLibrary(i,n)){return{kind:2,token:s,call:c.parent,sourceFile:n,modifierFlags:32,parentDeclaration:t}}const r=find(d.declarations,isSourceFile);if(e.commonJsModuleIndicator)return void 0;if(r&&!isSourceFileFromLibrary(i,r)){return{kind:2,token:s,call:c.parent,sourceFile:r,modifierFlags:32,parentDeclaration:r}}}const p=find(d.declarations,isClassLike);if(!p&&isPrivateIdentifier(s))return void 0;const u=p||find(d.declarations,(e=>isInterfaceDeclaration(e)||isTypeLiteralNode(e)));if(u&&!isSourceFileFromLibrary(i,u.getSourceFile())){const e=!isTypeLiteralNode(u)&&(l.target||l)!==r.getDeclaredTypeOfSymbol(d);if(e&&(isPrivateIdentifier(s)||isInterfaceDeclaration(u)))return void 0;const t=u.getSourceFile();const n=isTypeLiteralNode(u)?0:(e?256:0)|(startsWithUnderscore(s.text)?2:0);const i=isSourceFileJS(t);const o=tryCast(c.parent,isCallExpression);return{kind:0,token:s,call:o,modifierFlags:n,parentDeclaration:u,declSourceFile:t,isJSFile:i}}const f=find(d.declarations,isEnumDeclaration);if(f&&!(l.flags&1056)&&!isPrivateIdentifier(s)&&!isSourceFileFromLibrary(i,f.getSourceFile())){return{kind:1,token:s,parentDeclaration:f}}return void 0}function getActionsForMissingMemberDeclaration(e,t){return t.isJSFile?singleElementArray(createActionForAddMissingMemberInJavascriptFile(e,t)):createActionsForAddMissingMemberInTypeScriptFile(e,t)}function createActionForAddMissingMemberInJavascriptFile(e,{parentDeclaration:t,declSourceFile:n,modifierFlags:r,token:i}){if(isInterfaceDeclaration(t)||isTypeLiteralNode(t)){return void 0}const o=dm.ChangeTracker.with(e,(e=>addMissingMemberInJs(e,n,t,i,!!(r&256))));if(o.length===0){return void 0}const a=r&256?wt.Initialize_static_property_0:isPrivateIdentifier(i)?wt.Declare_a_private_field_named_0:wt.Initialize_property_0_in_the_constructor;return createCodeFixAction(hp,o,[a,i.text],hp,wt.Add_all_missing_members)}function addMissingMemberInJs(e,t,n,r,i){const o=r.text;if(i){if(n.kind===231){return}const r=n.name.getText();const i=initializePropertyToUndefined(zr.createIdentifier(r),o);e.insertNodeAfter(t,n,i)}else if(isPrivateIdentifier(r)){const r=zr.createPropertyDeclaration(void 0,o,void 0,void 0,void 0);const i=getNodeToInsertPropertyAfter(n);if(i){e.insertNodeAfter(t,i,r)}else{e.insertMemberAtStart(t,n,r)}}else{const r=getFirstConstructorWithBody(n);if(!r){return}const i=initializePropertyToUndefined(zr.createThis(),o);e.insertNodeAtConstructorEnd(t,r,i)}}function initializePropertyToUndefined(e,t){return zr.createExpressionStatement(zr.createAssignment(zr.createPropertyAccessExpression(e,t),createUndefined()))}function createActionsForAddMissingMemberInTypeScriptFile(e,{parentDeclaration:t,declSourceFile:n,modifierFlags:r,token:i}){const o=i.text;const a=r&256;const s=getTypeNode2(e.program.getTypeChecker(),t,i);const addPropertyDeclarationChanges=r=>dm.ChangeTracker.with(e,(e=>addPropertyDeclaration(e,n,t,o,s,r)));const c=[createCodeFixAction(hp,addPropertyDeclarationChanges(r&256),[a?wt.Declare_static_property_0:wt.Declare_property_0,o],hp,wt.Add_all_missing_members)];if(a||isPrivateIdentifier(i)){return c}if(r&2){c.unshift(createCodeFixActionWithoutFixAll(hp,addPropertyDeclarationChanges(2),[wt.Declare_private_property_0,o]))}c.push(createAddIndexSignatureAction(e,n,t,i.text,s));return c}function getTypeNode2(e,t,n){let r;if(n.parent.parent.kind===226){const i=n.parent.parent;const o=n.parent===i.left?i.right:i.left;const a=e.getWidenedType(e.getBaseTypeOfLiteralType(e.getTypeAtLocation(o)));r=e.typeToTypeNode(a,t,1,8)}else{const t=e.getContextualType(n.parent);r=t?e.typeToTypeNode(t,void 0,1,8):void 0}return r||zr.createKeywordTypeNode(133)}function addPropertyDeclaration(e,t,n,r,i,o){const a=o?zr.createNodeArray(zr.createModifiersFromModifierFlags(o)):void 0;const s=isClassLike(n)?zr.createPropertyDeclaration(a,r,void 0,i,void 0):zr.createPropertySignature(void 0,r,void 0,i);const c=getNodeToInsertPropertyAfter(n);if(c){e.insertNodeAfter(t,c,s)}else{e.insertMemberAtStart(t,n,s)}}function getNodeToInsertPropertyAfter(e){let t;for(const n of e.members){if(!isPropertyDeclaration(n))break;t=n}return t}function createAddIndexSignatureAction(e,t,n,r,i){const o=zr.createKeywordTypeNode(154);const a=zr.createParameterDeclaration(void 0,void 0,"x",void 0,o,void 0);const s=zr.createIndexSignature(void 0,[a],i);const c=dm.ChangeTracker.with(e,(e=>e.insertMemberAtStart(t,n,s)));return createCodeFixActionWithoutFixAll(hp,c,[wt.Add_index_signature_for_property_0,r])}function getActionsForMissingMethodDeclaration(e,t){const{parentDeclaration:n,declSourceFile:r,modifierFlags:i,token:o,call:a}=t;if(a===void 0){return void 0}const s=o.text;const addMethodDeclarationChanges=t=>dm.ChangeTracker.with(e,(i=>addMethodDeclaration(e,i,a,o,t,n,r)));const c=[createCodeFixAction(hp,addMethodDeclarationChanges(i&256),[i&256?wt.Declare_static_method_0:wt.Declare_method_0,s],hp,wt.Add_all_missing_members)];if(i&2){c.unshift(createCodeFixActionWithoutFixAll(hp,addMethodDeclarationChanges(2),[wt.Declare_private_method_0,s]))}return c}function addMethodDeclaration(e,t,n,r,i,o,a){const s=createImportAdder(a,e.program,e.preferences,e.host);const c=isClassLike(o)?174:173;const l=createSignatureDeclarationFromCallExpression(c,e,s,n,r,i,o);const d=tryGetContainingMethodDeclaration(o,n);if(d){t.insertNodeAfter(a,d,l)}else{t.insertMemberAtStart(a,o,l)}s.writeFixes(t)}function addEnumMemberDeclaration(e,t,{token:n,parentDeclaration:r}){const i=some(r.members,(e=>{const n=t.getTypeAtLocation(e);return!!(n&&n.flags&402653316)}));const o=r.getSourceFile();const a=zr.createEnumMember(n,i?zr.createStringLiteral(n.text):void 0);const s=lastOrUndefined(r.members);if(s){e.insertNodeInListAfter(o,s,a,r.members)}else{e.insertMemberAtStart(o,r,a)}}function addFunctionDeclaration(e,t,n){const r=getQuotePreference(t.sourceFile,t.preferences);const i=createImportAdder(t.sourceFile,t.program,t.preferences,t.host);const o=n.kind===2?createSignatureDeclarationFromCallExpression(262,t,i,n.call,idText(n.token),n.modifierFlags,n.parentDeclaration):createSignatureDeclarationFromSignature(262,t,r,n.signature,createStubbedBody(wt.Function_not_implemented.message,r),n.token,void 0,void 0,void 0,i);if(o===void 0){S.fail("fixMissingFunctionDeclaration codefix got unexpected error.")}isReturnStatement(n.parentDeclaration)?e.insertNodeBefore(n.sourceFile,n.parentDeclaration,o,true):e.insertNodeAtEndOfScope(n.sourceFile,n.parentDeclaration,o);i.writeFixes(e)}function addJsxAttributes(e,t,n){const r=createImportAdder(t.sourceFile,t.program,t.preferences,t.host);const i=getQuotePreference(t.sourceFile,t.preferences);const o=t.program.getTypeChecker();const a=n.parentDeclaration.attributes;const s=some(a.properties,isJsxSpreadAttribute);const c=map(n.attributes,(e=>{const a=tryGetValueFromType(t,o,r,i,o.getTypeOfSymbol(e),n.parentDeclaration);const s=zr.createIdentifier(e.name);const c=zr.createJsxAttribute(s,zr.createJsxExpression(void 0,a));setParent(s,c);return c}));const l=zr.createJsxAttributes(s?[...c,...a.properties]:[...a.properties,...c]);const d={prefix:a.pos===a.end?" ":void 0};e.replaceNode(t.sourceFile,a,l,d);r.writeFixes(e)}function addObjectLiteralProperties(e,t,n){const r=createImportAdder(t.sourceFile,t.program,t.preferences,t.host);const i=getQuotePreference(t.sourceFile,t.preferences);const o=zn(t.program.getCompilerOptions());const a=t.program.getTypeChecker();const s=map(n.properties,(e=>{const s=tryGetValueFromType(t,a,r,i,a.getTypeOfSymbol(e),n.parentDeclaration);return zr.createPropertyAssignment(createPropertyNameFromSymbol(e,o,i,a),s)}));const c={leadingTriviaOption:dm.LeadingTriviaOption.Exclude,trailingTriviaOption:dm.TrailingTriviaOption.Exclude,indentation:n.indentation};e.replaceNode(t.sourceFile,n.parentDeclaration,zr.createObjectLiteralExpression([...n.parentDeclaration.properties,...s],true),c);r.writeFixes(e)}function tryGetValueFromType(e,t,n,r,i,o){if(i.flags&3){return createUndefined()}if(i.flags&(4|134217728)){return zr.createStringLiteral("",r===0)}if(i.flags&8){return zr.createNumericLiteral(0)}if(i.flags&64){return zr.createBigIntLiteral("0n")}if(i.flags&16){return zr.createFalse()}if(i.flags&1056){const e=i.symbol.exports?firstOrUndefinedIterator(i.symbol.exports.values()):i.symbol;const n=i.symbol.parent&&i.symbol.parent.flags&256?i.symbol.parent:i.symbol;const r=t.symbolToExpression(n,111551,void 0,64);return e===void 0||r===void 0?zr.createNumericLiteral(0):zr.createPropertyAccessExpression(r,t.symbolToString(e))}if(i.flags&256){return zr.createNumericLiteral(i.value)}if(i.flags&2048){return zr.createBigIntLiteral(i.value)}if(i.flags&128){return zr.createStringLiteral(i.value,r===0)}if(i.flags&512){return i===t.getFalseType()||i===t.getFalseType(true)?zr.createFalse():zr.createTrue()}if(i.flags&65536){return zr.createNull()}if(i.flags&1048576){const a=firstDefined(i.types,(i=>tryGetValueFromType(e,t,n,r,i,o)));return a??createUndefined()}if(t.isArrayLikeType(i)){return zr.createArrayLiteralExpression()}if(isObjectLiteralType(i)){const a=map(t.getPropertiesOfType(i),(i=>{const a=tryGetValueFromType(e,t,n,r,t.getTypeOfSymbol(i),o);return zr.createPropertyAssignment(i.name,a)}));return zr.createObjectLiteralExpression(a,true)}if(getObjectFlags(i)&16){const a=find(i.symbol.declarations||d,or(isFunctionTypeNode,isMethodSignature,isMethodDeclaration));if(a===void 0)return createUndefined();const s=t.getSignaturesOfType(i,0);if(s===void 0)return createUndefined();const c=createSignatureDeclarationFromSignature(218,e,r,s[0],createStubbedBody(wt.Function_not_implemented.message,r),void 0,void 0,void 0,o,n);return c??createUndefined()}if(getObjectFlags(i)&1){const e=getClassLikeDeclarationOfSymbol(i.symbol);if(e===void 0||hasAbstractModifier(e))return createUndefined();const t=getFirstConstructorWithBody(e);if(t&&length(t.parameters))return createUndefined();return zr.createNewExpression(zr.createIdentifier(i.symbol.name),void 0,void 0)}return createUndefined()}function createUndefined(){return zr.createIdentifier("undefined")}function isObjectLiteralType(e){return e.flags&524288&&(getObjectFlags(e)&128||e.symbol&&tryCast(singleOrUndefined(e.symbol.declarations),isTypeLiteralNode))}function getUnmatchedAttributes(e,t,n){const r=e.getContextualType(n.attributes);if(r===void 0)return d;const i=r.getProperties();if(!length(i))return d;const o=new Set;for(const t of n.attributes.properties){if(isJsxAttribute(t)){o.add(getEscapedTextOfJsxAttributeName(t.name))}if(isJsxSpreadAttribute(t)){const n=e.getTypeAtLocation(t.expression);for(const e of n.getProperties()){o.add(e.escapedName)}}}return filter(i,(e=>isIdentifierText(e.name,t,1)&&!(e.flags&16777216||getCheckFlags(e)&48||o.has(e.escapedName))))}function tryGetContainingMethodDeclaration(e,t){if(isTypeLiteralNode(e)){return void 0}const n=findAncestor(t,(e=>isMethodDeclaration(e)||isConstructorDeclaration(e)));return n&&n.parent===e?n:void 0}function createPropertyNameFromSymbol(e,t,n,r){if(isTransientSymbol(e)){const t=r.symbolToNode(e,111551,void 0,void 0,1);if(t&&isComputedPropertyName(t))return t}return createPropertyNameNodeForIdentifierOrLiteral(e.name,t,n===0,false,false)}function findScope(e){if(findAncestor(e,isJsxExpression)){const t=findAncestor(e.parent,isReturnStatement);if(t)return t}return getSourceFileOfNode(e)}var bp="addMissingNewOperator";var Cp=[wt.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code];registerCodeFix({errorCodes:Cp,getCodeActions(e){const{sourceFile:t,span:n}=e;const r=dm.ChangeTracker.with(e,(e=>addMissingNewOperator(e,t,n)));return[createCodeFixAction(bp,r,wt.Add_missing_new_operator_to_call,bp,wt.Add_missing_new_operator_to_all_calls)]},fixIds:[bp],getAllCodeActions:e=>codeFixAll(e,Cp,((t,n)=>addMissingNewOperator(t,e.sourceFile,n)))});function addMissingNewOperator(e,t,n){const r=cast(findAncestorMatchingSpan2(t,n),isCallExpression);const i=zr.createNewExpression(r.expression,r.typeArguments,r.arguments);e.replaceNode(t,r,i)}function findAncestorMatchingSpan2(e,t){let n=getTokenAtPosition(e,t.start);const r=textSpanEnd(t);while(n.enddoChange19(t,e.program,e.preferences,e.host,r,i))),[length(i)>1?wt.Add_missing_parameters_to_0:wt.Add_missing_parameter_to_0,n],Ep,wt.Add_all_missing_parameters))}if(length(o)){append(a,createCodeFixAction(Np,dm.ChangeTracker.with(e,(t=>doChange19(t,e.program,e.preferences,e.host,r,o))),[length(o)>1?wt.Add_optional_parameters_to_0:wt.Add_optional_parameter_to_0,n],Np,wt.Add_all_optional_parameters))}return a},getAllCodeActions:e=>codeFixAll(e,kp,((t,n)=>{const r=getInfo11(e.sourceFile,e.program,n.start);if(r){const{declarations:n,newParameters:i,newOptionalParameters:o}=r;if(e.fixId===Ep){doChange19(t,e.program,e.preferences,e.host,n,i)}if(e.fixId===Np){doChange19(t,e.program,e.preferences,e.host,n,o)}}}))});function getInfo11(e,t,n){const r=getTokenAtPosition(e,n);const i=findAncestor(r,isCallExpression);if(i===void 0||length(i.arguments)===0){return void 0}const o=t.getTypeChecker();const a=o.getTypeAtLocation(i.expression);const s=filter(a.symbol.declarations,isConvertibleSignatureDeclaration);if(s===void 0){return void 0}const c=lastOrUndefined(s);if(c===void 0||c.body===void 0||isSourceFileFromLibrary(t,c.getSourceFile())){return void 0}const l=tryGetName2(c);if(l===void 0){return void 0}const d=[];const p=[];const u=length(c.parameters);const f=length(i.arguments);if(u>f){return void 0}const m=[c,...getOverloads(c,s)];for(let e=0,t=0,n=0;e{const s=getSourceFileOfNode(i);const c=createImportAdder(s,t,n,r);if(length(i.parameters)){e.replaceNodeRangeWithNodes(s,first(i.parameters),last(i.parameters),updateParameters(c,a,i,o),{joiner:", ",indentation:0,leadingTriviaOption:dm.LeadingTriviaOption.IncludeAll,trailingTriviaOption:dm.TrailingTriviaOption.Include})}else{forEach(updateParameters(c,a,i,o),((t,n)=>{if(length(i.parameters)===0&&n===0){e.insertNodeAt(s,i.parameters.end,t)}else{e.insertNodeAtEndOfList(s,i.parameters,t)}}))}c.writeFixes(e)}))}function isConvertibleSignatureDeclaration(e){switch(e.kind){case 262:case 218:case 174:case 219:return true;default:return false}}function updateParameters(e,t,n,r){const i=map(n.parameters,(e=>zr.createParameterDeclaration(e.modifiers,e.dotDotDotToken,e.name,e.questionToken,e.type,e.initializer)));for(const{pos:n,declaration:o}of r){const r=n>0?i[n-1]:void 0;i.splice(n,0,zr.updateParameterDeclaration(o,o.modifiers,o.dotDotDotToken,o.name,r&&r.questionToken?zr.createToken(58):o.questionToken,getParameterType(e,o.type,t),o.initializer))}return i}function getOverloads(e,t){const n=[];for(const r of t){if(isOverload(r)){if(length(r.parameters)===length(e.parameters)){n.push(r);continue}if(length(r.parameters)>length(e.parameters)){return[]}}}return n}function isOverload(e){return isConvertibleSignatureDeclaration(e)&&e.body===void 0}function createParameter(e,t,n){return zr.createParameterDeclaration(void 0,void 0,e,n,t,void 0)}function isOptionalPos(e,t){return length(e)&&some(e,(e=>tcodeFixAll(e,Ap,((t,n,r)=>{const i=tryGetImportedPackageName(n.file,n.start);if(i===void 0)return void 0;switch(e.fixId){case Pp:{const t=getTypesPackageNameToInstall(i,e.host,n.code);if(t){r.push(getInstallCommand(n.file.fileName,t))}break}default:S.fail(`Bad fixId: ${e.fixId}`)}}))});function getInstallCommand(e,t){return{type:"install package",file:e,packageName:t}}function tryGetImportedPackageName(e,t){const n=tryCast(getTokenAtPosition(e,t),isStringLiteral);if(!n)return void 0;const r=n.text;const{packageName:i}=parsePackageName(r);return isExternalModuleNameRelative(i)?void 0:i}function getTypesPackageNameToInstall(e,t,n){var r;return n===Dp?Or.has(e)?"@types/node":void 0:((r=t.isKnownTypesPackageName)==null?void 0:r.call(t,e))?getTypesPackageName(e):void 0}var Op=[wt.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,wt.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2.code,wt.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more.code,wt.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code,wt.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1.code,wt.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more.code];var wp="fixClassDoesntImplementInheritedAbstractMember";registerCodeFix({errorCodes:Op,getCodeActions:function getCodeActionsToFixClassNotImplementingInheritedMembers(e){const{sourceFile:t,span:n}=e;const r=dm.ChangeTracker.with(e,(r=>addMissingMembers(getClass2(t,n.start),t,e,r,e.preferences)));return r.length===0?void 0:[createCodeFixAction(wp,r,wt.Implement_inherited_abstract_class,wp,wt.Implement_all_inherited_abstract_classes)]},fixIds:[wp],getAllCodeActions:function getAllCodeActionsToFixClassDoesntImplementInheritedAbstractMember(e){const t=new Set;return codeFixAll(e,Op,((n,r)=>{const i=getClass2(r.file,r.start);if(addToSeen(t,getNodeId(i))){addMissingMembers(i,e.sourceFile,e,n,e.preferences)}}))}});function getClass2(e,t){const n=getTokenAtPosition(e,t);return cast(n.parent,isClassLike)}function addMissingMembers(e,t,n,r,i){const o=getEffectiveBaseTypeNode(e);const a=n.program.getTypeChecker();const s=a.getTypeAtLocation(o);const c=a.getPropertiesOfType(s).filter(symbolPointsToNonPrivateAndAbstractMember);const l=createImportAdder(t,n.program,i,n.host);createMissingMemberNodes(e,c,t,n,i,l,(n=>r.insertMemberAtStart(t,e,n)));l.writeFixes(r)}function symbolPointsToNonPrivateAndAbstractMember(e){const t=getSyntacticModifierFlags(first(e.getDeclarations()));return!(t&2)&&!!(t&64)}var Lp="classSuperMustPrecedeThisAccess";var Mp=[wt.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];registerCodeFix({errorCodes:Mp,getCodeActions(e){const{sourceFile:t,span:n}=e;const r=getNodes(t,n.start);if(!r)return void 0;const{constructor:i,superCall:o}=r;const a=dm.ChangeTracker.with(e,(e=>doChange20(e,t,i,o)));return[createCodeFixAction(Lp,a,wt.Make_super_call_the_first_statement_in_the_constructor,Lp,wt.Make_all_super_calls_the_first_statement_in_their_constructor)]},fixIds:[Lp],getAllCodeActions(e){const{sourceFile:t}=e;const n=new Set;return codeFixAll(e,Mp,((e,r)=>{const i=getNodes(r.file,r.start);if(!i)return;const{constructor:o,superCall:a}=i;if(addToSeen(n,getNodeId(o.parent))){doChange20(e,t,o,a)}}))}});function doChange20(e,t,n,r){e.insertNodeAtConstructorStart(t,n,r);e.delete(t,r)}function getNodes(e,t){const n=getTokenAtPosition(e,t);if(n.kind!==110)return void 0;const r=getContainingFunction(n);const i=findSuperCall(r.body);return i&&!i.expression.arguments.some((e=>isPropertyAccessExpression(e)&&e.expression===n))?{constructor:r,superCall:i}:void 0}function findSuperCall(e){return isExpressionStatement(e)&&isSuperCall(e.expression)?e:isFunctionLike(e)?void 0:forEachChild(e,findSuperCall)}var Rp="constructorForDerivedNeedSuperCall";var Bp=[wt.Constructors_for_derived_classes_must_contain_a_super_call.code];registerCodeFix({errorCodes:Bp,getCodeActions(e){const{sourceFile:t,span:n}=e;const r=getNode(t,n.start);const i=dm.ChangeTracker.with(e,(e=>doChange21(e,t,r)));return[createCodeFixAction(Rp,i,wt.Add_missing_super_call,Rp,wt.Add_all_missing_super_calls)]},fixIds:[Rp],getAllCodeActions:e=>codeFixAll(e,Bp,((t,n)=>doChange21(t,e.sourceFile,getNode(n.file,n.start))))});function getNode(e,t){const n=getTokenAtPosition(e,t);S.assert(isConstructorDeclaration(n.parent),"token should be at the constructor declaration");return n.parent}function doChange21(e,t,n){const r=zr.createExpressionStatement(zr.createCallExpression(zr.createSuper(),void 0,d));e.insertNodeAtConstructorStart(t,n,r)}var jp="fixEnableJsxFlag";var Jp=[wt.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];registerCodeFix({errorCodes:Jp,getCodeActions:function getCodeActionsToFixEnableJsxFlag(e){const{configFile:t}=e.program.getCompilerOptions();if(t===void 0){return void 0}const n=dm.ChangeTracker.with(e,(e=>doChange22(e,t)));return[createCodeFixActionWithoutFixAll(jp,n,wt.Enable_the_jsx_flag_in_your_configuration_file)]},fixIds:[jp],getAllCodeActions:e=>codeFixAll(e,Jp,(t=>{const{configFile:n}=e.program.getCompilerOptions();if(n===void 0){return void 0}doChange22(t,n)}))});function doChange22(e,t){setJsonCompilerOptionValue(e,t,"jsx",zr.createStringLiteral("react"))}var Wp="fixNaNEquality";var Up=[wt.This_condition_will_always_return_0.code];registerCodeFix({errorCodes:Up,getCodeActions(e){const{sourceFile:t,span:n,program:r}=e;const i=getInfo12(r,t,n);if(i===void 0)return;const{suggestion:o,expression:a,arg:s}=i;const c=dm.ChangeTracker.with(e,(e=>doChange23(e,t,s,a)));return[createCodeFixAction(Wp,c,[wt.Use_0,o],Wp,wt.Use_Number_isNaN_in_all_conditions)]},fixIds:[Wp],getAllCodeActions:e=>codeFixAll(e,Up,((t,n)=>{const r=getInfo12(e.program,n.file,createTextSpan(n.start,n.length));if(r){doChange23(t,n.file,r.arg,r.expression)}}))});function getInfo12(e,t,n){const r=find(e.getSemanticDiagnostics(t),(e=>e.start===n.start&&e.length===n.length));if(r===void 0||r.relatedInformation===void 0)return;const i=find(r.relatedInformation,(e=>e.code===wt.Did_you_mean_0.code));if(i===void 0||i.file===void 0||i.start===void 0||i.length===void 0)return;const o=findAncestorMatchingSpan(i.file,createTextSpan(i.start,i.length));if(o===void 0)return;if(isExpression(o)&&isBinaryExpression(o.parent)){return{suggestion:getSuggestion(i.messageText),expression:o.parent,arg:o}}return void 0}function doChange23(e,t,n,r){const i=zr.createCallExpression(zr.createPropertyAccessExpression(zr.createIdentifier("Number"),zr.createIdentifier("isNaN")),void 0,[n]);const o=r.operatorToken.kind;e.replaceNode(t,r,o===38||o===36?zr.createPrefixUnaryExpression(54,i):i)}function getSuggestion(e){const[,t]=flattenDiagnosticMessageText(e,"\n",0).match(/'(.*)'/)||[];return t}registerCodeFix({errorCodes:[wt.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,wt.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,wt.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code],getCodeActions:function getCodeActionsToFixModuleAndTarget(e){const t=e.program.getCompilerOptions();const{configFile:n}=t;if(n===void 0){return void 0}const r=[];const i=Vn(t);const o=i>=5&&i<99;if(o){const t=dm.ChangeTracker.with(e,(e=>{setJsonCompilerOptionValue(e,n,"module",zr.createStringLiteral("esnext"))}));r.push(createCodeFixActionWithoutFixAll("fixModuleOption",t,[wt.Set_the_module_option_in_your_configuration_file_to_0,"esnext"]))}const a=zn(t);const s=a<4||a>99;if(s){const t=dm.ChangeTracker.with(e,(e=>{const t=getTsConfigObjectLiteralExpression(n);if(!t)return;const r=[["target",zr.createStringLiteral("es2017")]];if(i===1){r.push(["module",zr.createStringLiteral("commonjs")])}setJsonCompilerOptionValues(e,n,r)}));r.push(createCodeFixActionWithoutFixAll("fixTargetOption",t,[wt.Set_the_target_option_in_your_configuration_file_to_0,"es2017"]))}return r.length?r:void 0}});var zp="fixPropertyAssignment";var Vp=[wt.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code];registerCodeFix({errorCodes:Vp,fixIds:[zp],getCodeActions(e){const{sourceFile:t,span:n}=e;const r=getProperty2(t,n.start);const i=dm.ChangeTracker.with(e,(t=>doChange24(t,e.sourceFile,r)));return[createCodeFixAction(zp,i,[wt.Change_0_to_1,"=",":"],zp,[wt.Switch_each_misused_0_to_1,"=",":"])]},getAllCodeActions:e=>codeFixAll(e,Vp,((e,t)=>doChange24(e,t.file,getProperty2(t.file,t.start))))});function doChange24(e,t,n){e.replaceNode(t,n,zr.createPropertyAssignment(n.name,n.objectAssignmentInitializer))}function getProperty2(e,t){return cast(getTokenAtPosition(e,t).parent,isShorthandPropertyAssignment)}var qp="extendsInterfaceBecomesImplements";var Hp=[wt.Cannot_extend_an_interface_0_Did_you_mean_implements.code];registerCodeFix({errorCodes:Hp,getCodeActions(e){const{sourceFile:t}=e;const n=getNodes2(t,e.span.start);if(!n)return void 0;const{extendsToken:r,heritageClauses:i}=n;const o=dm.ChangeTracker.with(e,(e=>doChanges2(e,t,r,i)));return[createCodeFixAction(qp,o,wt.Change_extends_to_implements,qp,wt.Change_all_extended_interfaces_to_implements)]},fixIds:[qp],getAllCodeActions:e=>codeFixAll(e,Hp,((e,t)=>{const n=getNodes2(t.file,t.start);if(n)doChanges2(e,t.file,n.extendsToken,n.heritageClauses)}))});function getNodes2(e,t){const n=getTokenAtPosition(e,t);const r=getContainingClass(n).heritageClauses;const i=r[0].getFirstToken();return i.kind===96?{extendsToken:i,heritageClauses:r}:void 0}function doChanges2(e,t,n,r){e.replaceNode(t,n,zr.createToken(119));if(r.length===2&&r[0].token===96&&r[1].token===119){const n=r[1].getFirstToken();const i=n.getFullStart();e.replaceRange(t,{pos:i,end:i},zr.createToken(28));const o=t.text;let a=n.end;while(adoChange25(e,t,n)));return[createCodeFixAction(Gp,r,[wt.Add_0_to_unresolved_variable,n.className||"this"],Gp,wt.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]},fixIds:[Gp],getAllCodeActions:e=>codeFixAll(e,$p,((t,n)=>{const r=getInfo13(n.file,n.start,n.code);if(r)doChange25(t,e.sourceFile,r)}))});function getInfo13(e,t,n){const r=getTokenAtPosition(e,t);if(isIdentifier(r)||isPrivateIdentifier(r)){return{node:r,className:n===Kp?getContainingClass(r).name.text:void 0}}}function doChange25(e,t,{node:n,className:r}){suppressLeadingAndTrailingTrivia(n);e.replaceNode(t,n,zr.createPropertyAccessExpression(r?zr.createIdentifier(r):zr.createThis(),n))}var Qp="fixInvalidJsxCharacters_expression";var Xp="fixInvalidJsxCharacters_htmlEntity";var Yp=[wt.Unexpected_token_Did_you_mean_or_gt.code,wt.Unexpected_token_Did_you_mean_or_rbrace.code];registerCodeFix({errorCodes:Yp,fixIds:[Qp,Xp],getCodeActions(e){const{sourceFile:t,preferences:n,span:r}=e;const i=dm.ChangeTracker.with(e,(e=>doChange26(e,n,t,r.start,false)));const o=dm.ChangeTracker.with(e,(e=>doChange26(e,n,t,r.start,true)));return[createCodeFixAction(Qp,i,wt.Wrap_invalid_character_in_an_expression_container,Qp,wt.Wrap_all_invalid_characters_in_an_expression_container),createCodeFixAction(Xp,o,wt.Convert_invalid_character_to_its_html_entity_code,Xp,wt.Convert_all_invalid_characters_to_HTML_entity_code)]},getAllCodeActions(e){return codeFixAll(e,Yp,((t,n)=>doChange26(t,e.preferences,n.file,n.start,e.fixId===Xp)))}});var Zp={">":">","}":"}"};function isValidCharacter(e){return hasProperty(Zp,e)}function doChange26(e,t,n,r,i){const o=n.getText()[r];if(!isValidCharacter(o)){return}const a=i?Zp[o]:`{${quote(n,t,o)}}`;e.replaceRangeWithText(n,{pos:r,end:r+1},a)}var eu="deleteUnmatchedParameter";var tu="renameUnmatchedParameter";var nu=[wt.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code];registerCodeFix({fixIds:[eu,tu],errorCodes:nu,getCodeActions:function getCodeActionsToFixUnmatchedParameter(e){const{sourceFile:t,span:n}=e;const r=[];const i=getInfo14(t,n.start);if(i){append(r,getDeleteAction(e,i));append(r,getRenameAction(e,i));return r}return void 0},getAllCodeActions:function getAllCodeActionsToFixUnmatchedParameter(e){const t=new Map;return createCombinedCodeActions(dm.ChangeTracker.with(e,(n=>{eachDiagnostic(e,nu,(({file:e,start:n})=>{const r=getInfo14(e,n);if(r){t.set(r.signature,append(t.get(r.signature),r.jsDocParameterTag))}}));t.forEach(((t,r)=>{if(e.fixId===eu){const e=new Set(t);n.filterJSDocTags(r.getSourceFile(),r,(t=>!e.has(t)))}}))})))}});function getDeleteAction(e,{name:t,jsDocHost:n,jsDocParameterTag:r}){const i=dm.ChangeTracker.with(e,(t=>t.filterJSDocTags(e.sourceFile,n,(e=>e!==r))));return createCodeFixAction(eu,i,[wt.Delete_unused_param_tag_0,t.getText(e.sourceFile)],eu,wt.Delete_all_unused_param_tags)}function getRenameAction(e,{name:t,jsDocHost:n,signature:r,jsDocParameterTag:i}){if(!length(r.parameters))return void 0;const o=e.sourceFile;const a=getJSDocTags(r);const s=new Set;for(const e of a){if(isJSDocParameterTag(e)&&isIdentifier(e.name)){s.add(e.name.escapedText)}}const c=firstDefined(r.parameters,(e=>isIdentifier(e.name)&&!s.has(e.name.escapedText)?e.name.getText(o):void 0));if(c===void 0)return void 0;const l=zr.updateJSDocParameterTag(i,i.tagName,zr.createIdentifier(c),i.isBracketed,i.typeExpression,i.isNameFirst,i.comment);const d=dm.ChangeTracker.with(e,(e=>e.replaceJSDocComment(o,n,map(a,(e=>e===i?l:e)))));return createCodeFixActionWithoutFixAll(tu,d,[wt.Rename_param_tag_name_0_to_1,t.getText(o),c])}function getInfo14(e,t){const n=getTokenAtPosition(e,t);if(n.parent&&isJSDocParameterTag(n.parent)&&isIdentifier(n.parent.name)){const e=n.parent;const t=getJSDocHost(e);const r=getHostSignatureFromJSDoc(e);if(t&&r){return{jsDocHost:t,signature:r,name:n.parent.name,jsDocParameterTag:e}}}return void 0}var ru="fixUnreferenceableDecoratorMetadata";var iu=[wt.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code];registerCodeFix({errorCodes:iu,getCodeActions:e=>{const t=getImportDeclaration(e.sourceFile,e.program,e.span.start);if(!t)return;const n=dm.ChangeTracker.with(e,(n=>t.kind===276&&doNamespaceImportChange(n,e.sourceFile,t,e.program)));const r=dm.ChangeTracker.with(e,(n=>doTypeOnlyImportChange(n,e.sourceFile,t,e.program)));let i;if(n.length){i=append(i,createCodeFixActionWithoutFixAll(ru,n,wt.Convert_named_imports_to_namespace_import))}if(r.length){i=append(i,createCodeFixActionWithoutFixAll(ru,r,wt.Use_import_type))}return i},fixIds:[ru]});function getImportDeclaration(e,t,n){const r=tryCast(getTokenAtPosition(e,n),isIdentifier);if(!r||r.parent.kind!==183)return;const i=t.getTypeChecker();const o=i.getSymbolAtLocation(r);return find((o==null?void 0:o.declarations)||d,or(isImportClause,isImportSpecifier,isImportEqualsDeclaration))}function doTypeOnlyImportChange(e,t,n,r){if(n.kind===271){e.insertModifierBefore(t,156,n.name);return}const i=n.kind===273?n:n.parent.parent;if(i.name&&i.namedBindings){return}const o=r.getTypeChecker();const a=!!forEachImportClauseDeclaration(i,(e=>{if(skipAlias(e.symbol,o).flags&111551)return true}));if(a){return}e.insertModifierBefore(t,156,i)}function doNamespaceImportChange(e,t,n,r){Nc.doChangeNamedToNamespaceOrDefault(t,r,e,n.parent)}var ou="unusedIdentifier";var au="unusedIdentifier_prefix";var su="unusedIdentifier_delete";var cu="unusedIdentifier_deleteImports";var lu="unusedIdentifier_infer";var du=[wt._0_is_declared_but_its_value_is_never_read.code,wt._0_is_declared_but_never_used.code,wt.Property_0_is_declared_but_its_value_is_never_read.code,wt.All_imports_in_import_declaration_are_unused.code,wt.All_destructured_elements_are_unused.code,wt.All_variables_are_unused.code,wt.All_type_parameters_are_unused.code];registerCodeFix({errorCodes:du,getCodeActions(e){const{errorCode:t,sourceFile:n,program:r,cancellationToken:i}=e;const o=r.getTypeChecker();const a=r.getSourceFiles();const s=getTokenAtPosition(n,e.span.start);if(isJSDocTemplateTag(s)){return[createDeleteFix(dm.ChangeTracker.with(e,(e=>e.delete(n,s))),wt.Remove_template_tag)]}if(s.kind===30){const t=dm.ChangeTracker.with(e,(e=>deleteTypeParameters(e,n,s)));return[createDeleteFix(t,wt.Remove_type_parameters)]}const c=tryGetFullImport(s);if(c){const t=dm.ChangeTracker.with(e,(e=>e.delete(n,c)));return[createCodeFixAction(ou,t,[wt.Remove_import_from_0,showModuleSpecifier(c)],cu,wt.Delete_all_unused_imports)]}else if(isImport(s)){const t=dm.ChangeTracker.with(e,(e=>tryDeleteDeclaration(n,s,e,o,a,r,i,false)));if(t.length){return[createCodeFixAction(ou,t,[wt.Remove_unused_declaration_for_Colon_0,s.getText(n)],cu,wt.Delete_all_unused_imports)]}}if(isObjectBindingPattern(s.parent)||isArrayBindingPattern(s.parent)){if(isParameter(s.parent.parent)){const t=s.parent.elements;const r=[t.length>1?wt.Remove_unused_declarations_for_Colon_0:wt.Remove_unused_declaration_for_Colon_0,map(t,(e=>e.getText(n))).join(", ")];return[createDeleteFix(dm.ChangeTracker.with(e,(e=>deleteDestructuringElements(e,n,s.parent))),r)]}return[createDeleteFix(dm.ChangeTracker.with(e,(t=>deleteDestructuring(e,t,n,s.parent))),wt.Remove_unused_destructuring_declaration)]}if(canDeleteEntireVariableStatement(n,s)){return[createDeleteFix(dm.ChangeTracker.with(e,(e=>deleteEntireVariableStatement(e,n,s.parent))),wt.Remove_variable_statement)]}if(isIdentifier(s)&&isFunctionDeclaration(s.parent)){return[createDeleteFix(dm.ChangeTracker.with(e,(e=>deleteFunctionLikeDeclaration(e,n,s.parent))),[wt.Remove_unused_declaration_for_Colon_0,s.getText(n)])]}const l=[];if(s.kind===140){const t=dm.ChangeTracker.with(e,(e=>changeInferToUnknown(e,n,s)));const r=cast(s.parent,isInferTypeNode).typeParameter.name.text;l.push(createCodeFixAction(ou,t,[wt.Replace_infer_0_with_unknown,r],lu,wt.Replace_all_unused_infer_with_unknown))}else{const t=dm.ChangeTracker.with(e,(e=>tryDeleteDeclaration(n,s,e,o,a,r,i,false)));if(t.length){const e=isComputedPropertyName(s.parent)?s.parent:s;l.push(createDeleteFix(t,[wt.Remove_unused_declaration_for_Colon_0,e.getText(n)]))}}const d=dm.ChangeTracker.with(e,(e=>tryPrefixDeclaration(e,t,n,s)));if(d.length){l.push(createCodeFixAction(ou,d,[wt.Prefix_0_with_an_underscore,s.getText(n)],au,wt.Prefix_all_unused_declarations_with_where_possible))}return l},fixIds:[au,su,cu,lu],getAllCodeActions:e=>{const{sourceFile:t,program:n,cancellationToken:r}=e;const i=n.getTypeChecker();const o=n.getSourceFiles();return codeFixAll(e,du,((a,s)=>{const c=getTokenAtPosition(t,s.start);switch(e.fixId){case au:tryPrefixDeclaration(a,s.code,t,c);break;case cu:{const e=tryGetFullImport(c);if(e){a.delete(t,e)}else if(isImport(c)){tryDeleteDeclaration(t,c,a,i,o,n,r,true)}break}case su:{if(c.kind===140||isImport(c)){break}else if(isJSDocTemplateTag(c)){a.delete(t,c)}else if(c.kind===30){deleteTypeParameters(a,t,c)}else if(isObjectBindingPattern(c.parent)){if(c.parent.parent.initializer){break}else if(!isParameter(c.parent.parent)||isNotProvidedArguments(c.parent.parent,i,o)){a.delete(t,c.parent.parent)}}else if(isArrayBindingPattern(c.parent.parent)&&c.parent.parent.parent.initializer){break}else if(canDeleteEntireVariableStatement(t,c)){deleteEntireVariableStatement(a,t,c.parent)}else if(isIdentifier(c)&&isFunctionDeclaration(c.parent)){deleteFunctionLikeDeclaration(a,t,c.parent)}else{tryDeleteDeclaration(t,c,a,i,o,n,r,true)}break}case lu:if(c.kind===140){changeInferToUnknown(a,t,c)}break;default:S.fail(JSON.stringify(e.fixId))}}))}});function changeInferToUnknown(e,t,n){e.replaceNode(t,n.parent,zr.createKeywordTypeNode(159))}function createDeleteFix(e,t){return createCodeFixAction(ou,e,t,su,wt.Delete_all_unused_declarations)}function deleteTypeParameters(e,t,n){e.delete(t,S.checkDefined(cast(n.parent,isDeclarationWithTypeParameterChildren).typeParameters,"The type parameter to delete should exist"))}function isImport(e){return e.kind===102||e.kind===80&&(e.parent.kind===276||e.parent.kind===273)}function tryGetFullImport(e){return e.kind===102?tryCast(e.parent,isImportDeclaration):void 0}function canDeleteEntireVariableStatement(e,t){return isVariableDeclarationList(t.parent)&&first(t.parent.getChildren(e))===t}function deleteEntireVariableStatement(e,t,n){e.delete(t,n.parent.kind===243?n.parent:n)}function deleteDestructuringElements(e,t,n){forEach(n.elements,(n=>e.delete(t,n)))}function deleteDestructuring(e,t,n,{parent:r}){if(isVariableDeclaration(r)&&r.initializer&&isCallLikeExpression(r.initializer)){if(isVariableDeclarationList(r.parent)&&length(r.parent.declarations)>1){const i=r.parent.parent;const o=i.getStart(n);const a=i.end;t.delete(n,r);t.insertNodeAt(n,a,r.initializer,{prefix:getNewLineOrDefaultFromHost(e.host,e.formatContext.options)+n.text.slice(getPrecedingNonSpaceCharacterPosition(n.text,o-1),o),suffix:probablyUsesSemicolons(n)?";":""})}else{t.replaceNode(n,r.parent,r.initializer)}}else{t.delete(n,r)}}function tryPrefixDeclaration(e,t,n,r){if(t===wt.Property_0_is_declared_but_its_value_is_never_read.code)return;if(r.kind===140){r=cast(r.parent,isInferTypeNode).typeParameter.name}if(isIdentifier(r)&&canPrefix(r)){e.replaceNode(n,r,zr.createIdentifier(`_${r.text}`));if(isParameter(r.parent)){getJSDocParameterTags(r.parent).forEach((t=>{if(isIdentifier(t.name)){e.replaceNode(n,t.name,zr.createIdentifier(`_${t.name.text}`))}}))}}}function canPrefix(e){switch(e.parent.kind){case 169:case 168:return true;case 260:{const t=e.parent;switch(t.parent.parent.kind){case 250:case 249:return true}}}return false}function tryDeleteDeclaration(e,t,n,r,i,o,a,s){tryDeleteDeclarationWorker(t,n,e,r,i,o,a,s);if(isIdentifier(t)){Rf.Core.eachSymbolReferenceInFile(t,r,e,(t=>{if(isPropertyAccessExpression(t.parent)&&t.parent.name===t)t=t.parent;if(!s&&mayDeleteExpression(t)){n.delete(e,t.parent.parent)}}))}}function tryDeleteDeclarationWorker(e,t,n,r,i,o,a,s){const{parent:c}=e;if(isParameter(c)){tryDeleteParameter(t,n,c,r,i,o,a,s)}else if(!(s&&isIdentifier(e)&&Rf.Core.isSymbolReferencedInFile(e,r,n))){const r=isImportClause(c)?e:isComputedPropertyName(c)?c.parent:c;S.assert(r!==n,"should not delete whole source file");t.delete(n,r)}}function tryDeleteParameter(e,t,n,r,i,o,a,s=false){if(mayDeleteParameter(r,t,n,i,o,a,s)){if(n.modifiers&&n.modifiers.length>0&&(!isIdentifier(n.name)||Rf.Core.isSymbolReferencedInFile(n.name,r,t))){for(const r of n.modifiers){if(isModifier(r)){e.deleteModifier(t,r)}}}else if(!n.initializer&&isNotProvidedArguments(n,r,i)){e.delete(t,n)}}}function isNotProvidedArguments(e,t,n){const r=e.parent.parameters.indexOf(e);return!Rf.Core.someSignatureUsage(e.parent,n,t,((e,t)=>!t||t.arguments.length>r))}function mayDeleteParameter(e,t,n,r,i,o,a){const{parent:s}=n;switch(s.kind){case 174:case 176:const c=s.parameters.indexOf(n);const l=isMethodDeclaration(s)?s.name:s;const d=Rf.Core.getReferencedSymbolsForNode(s.pos,l,i,r,o);if(d){for(const e of d){for(const t of e.references){if(t.kind===Rf.EntryKind.Node){const e=isSuperKeyword(t.node)&&isCallExpression(t.node.parent)&&t.node.parent.arguments.length>c;const r=isPropertyAccessExpression(t.node.parent)&&isSuperKeyword(t.node.parent.expression)&&isCallExpression(t.node.parent.parent)&&t.node.parent.parent.arguments.length>c;const i=(isMethodDeclaration(t.node.parent)||isMethodSignature(t.node.parent))&&t.node.parent!==n.parent&&t.node.parent.parameters.length>c;if(e||r||i)return false}}}}return true;case 262:{if(s.name&&isCallbackLike(e,t,s.name)){return isLastParameter(s,n,a)}return true}case 218:case 219:return isLastParameter(s,n,a);case 178:return false;case 177:return true;default:return S.failBadSyntaxKind(s)}}function isCallbackLike(e,t,n){return!!Rf.Core.eachSymbolReferenceInFile(n,e,t,(e=>isIdentifier(e)&&isCallExpression(e.parent)&&e.parent.arguments.includes(e)))}function isLastParameter(e,t,n){const r=e.parameters;const i=r.indexOf(t);S.assert(i!==-1,"The parameter should already be in the list");return n?r.slice(i+1).every((e=>isIdentifier(e.name)&&!e.symbol.isReferenced)):i===r.length-1}function mayDeleteExpression(e){return(isBinaryExpression(e.parent)&&e.parent.left===e||(isPostfixUnaryExpression(e.parent)||isPrefixUnaryExpression(e.parent))&&e.parent.operand===e)&&isExpressionStatement(e.parent.parent)}function deleteFunctionLikeDeclaration(e,t,n){const r=n.symbol.declarations;if(r){for(const n of r){e.delete(t,n)}}}var pu="fixUnreachableCode";var uu=[wt.Unreachable_code_detected.code];registerCodeFix({errorCodes:uu,getCodeActions(e){const t=e.program.getSyntacticDiagnostics(e.sourceFile,e.cancellationToken);if(t.length)return;const n=dm.ChangeTracker.with(e,(t=>doChange27(t,e.sourceFile,e.span.start,e.span.length,e.errorCode)));return[createCodeFixAction(pu,n,wt.Remove_unreachable_code,pu,wt.Remove_all_unreachable_code)]},fixIds:[pu],getAllCodeActions:e=>codeFixAll(e,uu,((e,t)=>doChange27(e,t.file,t.start,t.length,t.code)))});function doChange27(e,t,n,r,i){const o=getTokenAtPosition(t,n);const a=findAncestor(o,isStatement);if(a.getStart(t)!==o.getStart(t)){const e=JSON.stringify({statementKind:S.formatSyntaxKind(a.kind),tokenKind:S.formatSyntaxKind(o.kind),errorCode:i,start:n,length:r});S.fail("Token and statement should start at the same point. "+e)}const s=(isBlock(a.parent)?a.parent:a).parent;if(!isBlock(a.parent)||a===first(a.parent.statements)){switch(s.kind){case 245:if(s.elseStatement){if(isBlock(a.parent)){break}else{e.replaceNode(t,a,zr.createBlock(d))}return}case 247:case 248:e.delete(t,s);return}}if(isBlock(a.parent)){const i=n+r;const o=S.checkDefined(lastWhere(sliceAfter(a.parent.statements,a),(e=>e.posdoChange28(t,e.sourceFile,e.span.start)));return[createCodeFixAction(fu,t,wt.Remove_unused_label,fu,wt.Remove_all_unused_labels)]},fixIds:[fu],getAllCodeActions:e=>codeFixAll(e,mu,((e,t)=>doChange28(e,t.file,t.start)))});function doChange28(e,t,n){const r=getTokenAtPosition(t,n);const i=cast(r.parent,isLabeledStatement);const o=r.getStart(t);const a=i.statement.getStart(t);const s=positionsAreOnSameLine(o,a,t)?a:skipTrivia(t.text,findChildOfKind(i,59,t).end,true);e.deleteRange(t,{pos:o,end:s})}var _u="fixJSDocTypes_plain";var gu="fixJSDocTypes_nullable";var yu=[wt.JSDoc_types_can_only_be_used_inside_documentation_comments.code,wt._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code,wt._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code];registerCodeFix({errorCodes:yu,getCodeActions(e){const{sourceFile:t}=e;const n=e.program.getTypeChecker();const r=getInfo15(t,e.span.start,n);if(!r)return void 0;const{typeNode:i,type:o}=r;const a=i.getText(t);const s=[fix(o,_u,wt.Change_all_jsdoc_style_types_to_TypeScript)];if(i.kind===314){s.push(fix(o,gu,wt.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types))}return s;function fix(r,o,s){const c=dm.ChangeTracker.with(e,(e=>doChange29(e,t,i,r,n)));return createCodeFixAction("jdocTypes",c,[wt.Change_0_to_1,a,n.typeToString(r)],o,s)}},fixIds:[_u,gu],getAllCodeActions(e){const{fixId:t,program:n,sourceFile:r}=e;const i=n.getTypeChecker();return codeFixAll(e,yu,((e,n)=>{const o=getInfo15(n.file,n.start,i);if(!o)return;const{typeNode:a,type:s}=o;const c=a.kind===314&&t===gu?i.getNullableType(s,32768):s;doChange29(e,r,a,c,i)}))}});function doChange29(e,t,n,r,i){e.replaceNode(t,n,i.typeToTypeNode(r,n,void 0))}function getInfo15(e,t,n){const r=findAncestor(getTokenAtPosition(e,t),isTypeContainer);const i=r&&r.type;return i&&{typeNode:i,type:getType(n,i)}}function isTypeContainer(e){switch(e.kind){case 234:case 179:case 180:case 262:case 177:case 181:case 200:case 174:case 173:case 169:case 172:case 171:case 178:case 265:case 216:case 260:return true;default:return false}}function getType(e,t){if(isJSDocNullableType(t)){const n=e.getTypeFromTypeNode(t.type);if(n===e.getNeverType()||n===e.getVoidType()){return n}return e.getUnionType(append([n,e.getUndefinedType()],t.postfix?void 0:e.getNullType()))}return e.getTypeFromTypeNode(t)}var hu="fixMissingCallParentheses";var Tu=[wt.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code];registerCodeFix({errorCodes:Tu,fixIds:[hu],getCodeActions(e){const{sourceFile:t,span:n}=e;const r=getCallName(t,n.start);if(!r)return;const i=dm.ChangeTracker.with(e,(t=>doChange30(t,e.sourceFile,r)));return[createCodeFixAction(hu,i,wt.Add_missing_call_parentheses,hu,wt.Add_all_missing_call_parentheses)]},getAllCodeActions:e=>codeFixAll(e,Tu,((e,t)=>{const n=getCallName(t.file,t.start);if(n)doChange30(e,t.file,n)}))});function doChange30(e,t,n){e.replaceNodeWithText(t,n,`${n.text}()`)}function getCallName(e,t){const n=getTokenAtPosition(e,t);if(isPropertyAccessExpression(n.parent)){let e=n.parent;while(isPropertyAccessExpression(e.parent)){e=e.parent}return e.name}if(isIdentifier(n)){return n}return void 0}var Su="fixMissingTypeAnnotationOnExports";var vu="add-annotation";var xu="add-type-assertion";var bu="extract-expression";var Cu=[wt.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,wt.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,wt.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,wt.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,wt.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,wt.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,wt.Expression_type_can_t_be_inferred_with_isolatedDeclarations.code,wt.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations.code,wt.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations.code,wt.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations.code,wt.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations.code,wt.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations.code,wt.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations.code,wt.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations.code,wt.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations.code,wt.Default_exports_can_t_be_inferred_with_isolatedDeclarations.code,wt.Only_const_arrays_can_be_inferred_with_isolatedDeclarations.code,wt.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function.code,wt.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations.code,wt.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations.code,wt.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit.code];var Eu=new Set([177,174,172,262,218,219,260,169,277,263,206,207]);var Nu=1024|2048|4096|8|524288|4|1;var ku=1;registerCodeFix({errorCodes:Cu,fixIds:[Su],getCodeActions(e){const t=[];addCodeAction(vu,t,e,0,(t=>t.addTypeAnnotation(e.span)));addCodeAction(vu,t,e,1,(t=>t.addTypeAnnotation(e.span)));addCodeAction(vu,t,e,2,(t=>t.addTypeAnnotation(e.span)));addCodeAction(xu,t,e,0,(t=>t.addInlineAssertion(e.span)));addCodeAction(xu,t,e,1,(t=>t.addInlineAssertion(e.span)));addCodeAction(xu,t,e,2,(t=>t.addInlineAssertion(e.span)));addCodeAction(bu,t,e,0,(t=>t.extractAsVariable(e.span)));return t},getAllCodeActions:e=>{const t=withContext(e,0,(t=>{eachDiagnostic(e,Cu,(e=>{t.addTypeAnnotation(e)}))}));return createCombinedCodeActions(t.textChanges)}});function addCodeAction(e,t,n,r,i){const o=withContext(n,r,i);if(o.result&&o.textChanges.length){t.push(createCodeFixAction(e,o.textChanges,o.result,Su,wt.Add_all_missing_type_annotations))}}function withContext(e,t,n){const r={typeNode:void 0,mutatedTarget:false};const i=dm.ChangeTracker.fromContext(e);const o=e.sourceFile;const a=e.program;const s=a.getTypeChecker();const c=zn(a.getCompilerOptions());const l=createImportAdder(e.sourceFile,e.program,e.preferences,e.host);const d=new Set;const p=new Set;const u=createPrinter({preserveSourceNewlines:false});const f=n({addTypeAnnotation:addTypeAnnotation,addInlineAssertion:addInlineAssertion,extractAsVariable:extractAsVariable});l.writeFixes(i);return{result:f,textChanges:i.getChanges()};function addTypeAnnotation(t){e.cancellationToken.throwIfCancellationRequested();const n=getTokenAtPosition(o,t.start);const r=findExpandoFunction(n);if(r){if(isFunctionDeclaration(r)){return createNamespaceForExpandoProperties(r)}return fixIsolatedDeclarationError(r)}const i=findAncestorWithMissingType(n);if(i){return fixIsolatedDeclarationError(i)}return void 0}function createNamespaceForExpandoProperties(e){var t;if(p==null?void 0:p.has(e))return void 0;p==null?void 0:p.add(e);const n=s.getTypeAtLocation(e);const r=s.getPropertiesOfType(n);if(!e.name||r.length===0)return void 0;const c=[];for(const t of r){if(!isIdentifierText(t.name,zn(a.getCompilerOptions())))continue;if(t.valueDeclaration&&isVariableDeclaration(t.valueDeclaration))continue;c.push(zr.createVariableStatement([zr.createModifier(95)],zr.createVariableDeclarationList([zr.createVariableDeclaration(t.name,void 0,typeToTypeNode2(s.getTypeOfSymbol(t),e),void 0)])))}if(c.length===0)return void 0;const l=[];if((t=e.modifiers)==null?void 0:t.some((e=>e.kind===95))){l.push(zr.createModifier(95))}l.push(zr.createModifier(138));const d=zr.createModuleDeclaration(l,e.name,zr.createModuleBlock(c),32|128|33554432|101441536);i.insertNodeAfter(o,e,d);return[wt.Annotate_types_of_properties_expando_function_in_a_namespace]}function needsParenthesizedExpressionForAssertion(e){return!isEntityNameExpression(e)&&!isCallExpression(e)&&!isObjectLiteralExpression(e)&&!isArrayLiteralExpression(e)}function createAsExpression(e,t){if(needsParenthesizedExpressionForAssertion(e)){e=zr.createParenthesizedExpression(e)}return zr.createAsExpression(e,t)}function createSatisfiesAsExpression(e,t){if(needsParenthesizedExpressionForAssertion(e)){e=zr.createParenthesizedExpression(e)}return zr.createAsExpression(zr.createSatisfiesExpression(e,getSynthesizedDeepClone(t)),t)}function addInlineAssertion(t){e.cancellationToken.throwIfCancellationRequested();const n=getTokenAtPosition(o,t.start);const r=findExpandoFunction(n);if(r)return;const a=findBestFittingNode(n,t);if(!a||isValueSignatureDeclaration(a)||isValueSignatureDeclaration(a.parent))return;const c=isExpression(a);const l=isShorthandPropertyAssignment(a);if(!l&&isDeclaration(a)){return void 0}if(findAncestor(a,isBindingPattern)){return void 0}if(findAncestor(a,isEnumMember)){return void 0}if(c&&(findAncestor(a,isHeritageClause)||findAncestor(a,isTypeNode))){return void 0}if(isSpreadElement(a)){return void 0}const d=findAncestor(a,isVariableDeclaration);const p=d&&s.getTypeAtLocation(d);if(p&&p.flags&8192){return void 0}if(!(c||l))return void 0;const{typeNode:u,mutatedTarget:f}=inferType(a,p);if(!u||f)return void 0;if(l){i.insertNodeAt(o,a.end,createAsExpression(getSynthesizedDeepClone(a.name),u),{prefix:": "})}else if(c){i.replaceNode(o,a,createSatisfiesAsExpression(getSynthesizedDeepClone(a),u))}else{S.assertNever(a)}return[wt.Add_satisfies_and_an_inline_type_assertion_with_0,typeToStringForDiag(u)]}function extractAsVariable(t){e.cancellationToken.throwIfCancellationRequested();const n=getTokenAtPosition(o,t.start);const r=findBestFittingNode(n,t);if(!r||isValueSignatureDeclaration(r)||isValueSignatureDeclaration(r.parent))return;const a=isExpression(r);if(!a)return;if(isArrayLiteralExpression(r)){i.replaceNode(o,r,createAsExpression(r,zr.createTypeReferenceNode("const")));return[wt.Mark_array_literal_as_const]}const c=findAncestor(r,isPropertyAssignment);if(c){if(c===r.parent&&isEntityNameExpression(r))return;const e=zr.createUniqueName(getIdentifierForNode(r,o,s,o),16);let t=r;let n=r;if(isSpreadElement(t)){t=walkUpParenthesizedExpressions(t.parent);if(isConstAssertion2(t.parent)){n=t=t.parent}else{n=createAsExpression(t,zr.createTypeReferenceNode("const"))}}if(isEntityNameExpression(t))return void 0;const a=zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(e,void 0,void 0,n)],2));const l=findAncestor(r,isStatement);i.insertNodeBefore(o,l,a);i.replaceNode(o,t,zr.createAsExpression(zr.cloneNode(e),zr.createTypeQueryNode(zr.cloneNode(e))));return[wt.Extract_to_variable_and_replace_with_0_as_typeof_0,typeToStringForDiag(e)]}}function findExpandoFunction(e){const t=findAncestor(e,(e=>isStatement(e)?"quit":isExpandoPropertyDeclaration(e)));if(t&&isExpandoPropertyDeclaration(t)){let e=t;if(isBinaryExpression(e)){e=e.left;if(!isExpandoPropertyDeclaration(e))return void 0}const n=s.getTypeAtLocation(e.expression);if(!n)return;const r=s.getPropertiesOfType(n);if(some(r,(e=>e.valueDeclaration===t||e.valueDeclaration===t.parent))){const e=n.symbol.valueDeclaration;if(e){if(isFunctionExpressionOrArrowFunction(e)&&isVariableDeclaration(e.parent)){return e.parent}if(isFunctionDeclaration(e)){return e}}}}return void 0}function fixIsolatedDeclarationError(e){if(d==null?void 0:d.has(e))return void 0;d==null?void 0:d.add(e);switch(e.kind){case 169:case 172:case 260:return addTypeToVariableLike(e);case 219:case 218:case 262:case 174:case 177:return addTypeToSignatureDeclaration(e,o);case 277:return transformExportAssignment(e);case 263:return transformExtendsClauseWithExpression(e);case 206:case 207:return transformDestructuringPatterns(e);default:throw new Error(`Cannot find a fix for the given node ${e.kind}`)}}function addTypeToSignatureDeclaration(e,t){if(e.type){return}const{typeNode:n}=inferType(e);if(n){i.tryInsertTypeAnnotation(t,e,n);return[wt.Add_return_type_0,typeToStringForDiag(n)]}}function transformExportAssignment(e){if(e.isExportEquals){return}const{typeNode:t}=inferType(e.expression);if(!t)return void 0;const n=zr.createUniqueName("_default");i.replaceNodeWithNodes(o,e,[zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(n,void 0,t,e.expression)],2)),zr.updateExportAssignment(e,e==null?void 0:e.modifiers,n)]);return[wt.Extract_default_export_to_variable]}function transformExtendsClauseWithExpression(e){var t,n;const r=(t=e.heritageClauses)==null?void 0:t.find((e=>e.token===96));const a=r==null?void 0:r.types[0];if(!a){return void 0}const{typeNode:s}=inferType(a.expression);if(!s){return void 0}const c=zr.createUniqueName(e.name?e.name.text+"Base":"Anonymous",16);const l=zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(c,void 0,s,a.expression)],2));i.insertNodeBefore(o,e,l);const d=getTrailingCommentRanges(o.text,a.end);const p=((n=d==null?void 0:d[d.length-1])==null?void 0:n.end)??a.end;i.replaceRange(o,{pos:a.getFullStart(),end:p},c,{prefix:" "});return[wt.Extract_base_class_to_variable]}let m;(e=>{e[e["Text"]=0]="Text";e[e["Computed"]=1]="Computed";e[e["ArrayAccess"]=2]="ArrayAccess";e[e["Identifier"]=3]="Identifier"})(m||(m={}));function transformDestructuringPatterns(e){var t;const n=e.parent;const r=e.parent.parent.parent;if(!n.initializer)return void 0;let a;const s=[];if(!isIdentifier(n.initializer)){const e=zr.createUniqueName("dest",16);a={expression:{kind:3,identifier:e}};s.push(zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(e,void 0,void 0,n.initializer)],2)))}else{a={expression:{kind:3,identifier:n.initializer}}}const c=[];if(isArrayBindingPattern(e)){addArrayBindingPatterns(e,c,a)}else{addObjectBindingPatterns(e,c,a)}const l=new Map;for(const e of c){if(e.element.propertyName&&isComputedPropertyName(e.element.propertyName)){const t=e.element.propertyName.expression;const n=zr.getGeneratedNameForNode(t);const r=zr.createVariableDeclaration(n,void 0,void 0,t);const i=zr.createVariableDeclarationList([r],2);const o=zr.createVariableStatement(void 0,i);s.push(o);l.set(t,n)}const n=e.element.name;if(isArrayBindingPattern(n)){addArrayBindingPatterns(n,c,e)}else if(isObjectBindingPattern(n)){addObjectBindingPatterns(n,c,e)}else{const{typeNode:i}=inferType(n);let o=createChainedExpression(e,l);if(e.element.initializer){const n=(t=e.element)==null?void 0:t.propertyName;const r=zr.createUniqueName(n&&isIdentifier(n)?n.text:"temp",16);s.push(zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(r,void 0,void 0,o)],2)));o=zr.createConditionalExpression(zr.createBinaryExpression(r,zr.createToken(37),zr.createIdentifier("undefined")),zr.createToken(58),e.element.initializer,zr.createToken(59),o)}const a=hasSyntacticModifier(r,32)?[zr.createToken(95)]:void 0;s.push(zr.createVariableStatement(a,zr.createVariableDeclarationList([zr.createVariableDeclaration(n,void 0,i,o)],2)))}}if(r.declarationList.declarations.length>1){s.push(zr.updateVariableStatement(r,r.modifiers,zr.updateVariableDeclarationList(r.declarationList,r.declarationList.declarations.filter((t=>t!==e.parent)))))}i.replaceNodeWithNodes(o,r,s);return[wt.Extract_binding_expressions_to_variable]}function addArrayBindingPatterns(e,t,n){for(let r=0;r=0;--e){const i=n[e].expression;if(i.kind===0){r=zr.createPropertyAccessChain(r,void 0,zr.createIdentifier(i.text))}else if(i.kind===1){r=zr.createElementAccessExpression(r,t.get(i.computed))}else if(i.kind===2){r=zr.createElementAccessExpression(r,i.arrayIndex)}}return r}function inferType(e,n){if(t===1){return relativeType(e)}let i;if(isValueSignatureDeclaration(e)){const t=s.getSignatureFromDeclaration(e);if(t){const n=s.getTypePredicateOfSignature(t);if(n){if(!n.type){return r}return{typeNode:typePredicateToTypeNode(n,findAncestor(e,isDeclaration)??o,getFlags(n.type)),mutatedTarget:false}}i=s.getReturnTypeOfSignature(t)}}else{i=s.getTypeAtLocation(e)}if(!i){return r}if(t===2){if(n){i=n}const e=s.getWidenedLiteralType(i);if(s.isTypeAssignableTo(e,i)){return r}i=e}const a=findAncestor(e,isDeclaration)??o;if(isParameter(e)&&s.requiresAddingImplicitUndefined(e,a)){i=s.getUnionType([s.getUndefinedType(),i],0)}return{typeNode:typeToTypeNode2(i,a,getFlags(i)),mutatedTarget:false};function getFlags(t){return(isVariableDeclaration(e)||isPropertyDeclaration(e)&&hasSyntacticModifier(e,256|8))&&t.flags&8192?1048576:0}}function createTypeOfFromEntityNameExpression(e){return zr.createTypeQueryNode(getSynthesizedDeepClone(e))}function typeFromArraySpreadElements(e,t="temp"){const n=!!findAncestor(e,isConstAssertion2);if(!n)return r;return typeFromSpreads(e,t,n,(e=>e.elements),isSpreadElement,zr.createSpreadElement,(e=>zr.createArrayLiteralExpression(e,true)),(e=>zr.createTupleTypeNode(e.map(zr.createRestTypeNode))))}function typeFromObjectSpreadAssignment(e,t="temp"){const n=!!findAncestor(e,isConstAssertion2);return typeFromSpreads(e,t,n,(e=>e.properties),isSpreadAssignment,zr.createSpreadAssignment,(e=>zr.createObjectLiteralExpression(e,true)),zr.createIntersectionTypeNode)}function typeFromSpreads(e,t,n,a,s,c,l,d){const p=[];const u=[];let f;const m=findAncestor(e,isStatement);for(const t of a(e)){if(s(t)){finalizesVariablePart();if(isEntityNameExpression(t.expression)){p.push(createTypeOfFromEntityNameExpression(t.expression));u.push(t)}else{makeVariable(t.expression)}}else{(f??(f=[])).push(t)}}if(u.length===0){return r}finalizesVariablePart();i.replaceNode(o,e,l(u));return{typeNode:d(p),mutatedTarget:true};function makeVariable(e){const r=zr.createUniqueName(t+"_Part"+(u.length+1),16);const a=!n?e:zr.createAsExpression(e,zr.createTypeReferenceNode("const"));const s=zr.createVariableStatement(void 0,zr.createVariableDeclarationList([zr.createVariableDeclaration(r,void 0,void 0,a)],2));i.insertNodeBefore(o,m,s);p.push(createTypeOfFromEntityNameExpression(r));u.push(c(r))}function finalizesVariablePart(){if(f){makeVariable(l(f));f=void 0}}}function isConstAssertion2(e){return isAssertionExpression(e)&&isConstTypeReference(e.type)}function relativeType(e){if(isParameter(e)){return r}if(isShorthandPropertyAssignment(e)){return{typeNode:createTypeOfFromEntityNameExpression(e.name),mutatedTarget:false}}if(isEntityNameExpression(e)){return{typeNode:createTypeOfFromEntityNameExpression(e),mutatedTarget:false}}if(isConstAssertion2(e)){return relativeType(e.expression)}if(isArrayLiteralExpression(e)){const t=findAncestor(e,isVariableDeclaration);const n=t&&isIdentifier(t.name)?t.name.text:void 0;return typeFromArraySpreadElements(e,n)}if(isObjectLiteralExpression(e)){const t=findAncestor(e,isVariableDeclaration);const n=t&&isIdentifier(t.name)?t.name.text:void 0;return typeFromObjectSpreadAssignment(e,n)}if(isVariableDeclaration(e)&&e.initializer){return relativeType(e.initializer)}if(isConditionalExpression(e)){const{typeNode:t,mutatedTarget:n}=relativeType(e.whenTrue);if(!t)return r;const{typeNode:i,mutatedTarget:o}=relativeType(e.whenFalse);if(!i)return r;return{typeNode:zr.createUnionTypeNode([t,i]),mutatedTarget:n||o}}return r}function typeToTypeNode2(e,t,n=0){let r=false;const i=typeToMinimizedReferenceType(s,e,t,Nu|n,ku,{moduleResolverHost:a,trackSymbol(){return true},reportTruncationError(){r=true}});if(!i){return void 0}const o=typeNodeToAutoImportableTypeNode(i,l,c);return r?zr.createKeywordTypeNode(133):o}function typePredicateToTypeNode(e,t,n=0){let r=false;const i=typePredicateToAutoImportableTypeNode(s,l,e,t,c,Nu|n,ku,{moduleResolverHost:a,trackSymbol(){return true},reportTruncationError(){r=true}});return r?zr.createKeywordTypeNode(133):i}function addTypeToVariableLike(e){const{typeNode:t}=inferType(e);if(t){if(e.type){i.replaceNode(getSourceFileOfNode(e),e.type,t)}else{i.tryInsertTypeAnnotation(getSourceFileOfNode(e),e,t)}return[wt.Add_annotation_of_type_0,typeToStringForDiag(t)]}}function typeToStringForDiag(e){setEmitFlags(e,1);const t=u.printNode(4,e,o);if(t.length>ln){return t.substring(0,ln-"...".length)+"..."}setEmitFlags(e,0);return t}function findAncestorWithMissingType(e){return findAncestor(e,(e=>Eu.has(e.kind)&&(!isObjectBindingPattern(e)&&!isArrayBindingPattern(e)||isVariableDeclaration(e.parent))))}function findBestFittingNode(e,t){while(e&&e.enddoChange31(e,t,r)));return[createCodeFixAction(Fu,i,wt.Add_async_modifier_to_containing_function,Fu,wt.Add_all_missing_async_modifiers)]},fixIds:[Fu],getAllCodeActions:function getAllCodeActionsToFixAwaitInSyncFunction(e){const t=new Set;return codeFixAll(e,Pu,((n,r)=>{const i=getNodes3(r.file,r.start);if(!i||!addToSeen(t,getNodeId(i.insertBefore)))return;doChange31(n,e.sourceFile,i)}))}});function getReturnType(e){if(e.type){return e.type}if(isVariableDeclaration(e.parent)&&e.parent.type&&isFunctionTypeNode(e.parent.type)){return e.parent.type.type}}function getNodes3(e,t){const n=getTokenAtPosition(e,t);const r=getContainingFunction(n);if(!r){return}let i;switch(r.kind){case 174:i=r.name;break;case 262:case 218:i=findChildOfKind(r,100,e);break;case 219:const t=r.typeParameters?30:21;i=findChildOfKind(r,t,e)||first(r.parameters);break;default:return}return i&&{insertBefore:i,returnType:getReturnType(r)}}function doChange31(e,t,{insertBefore:n,returnType:r}){if(r){const n=getEntityNameFromTypeNode(r);if(!n||n.kind!==80||n.text!=="Promise"){e.replaceNode(t,r,zr.createTypeReferenceNode("Promise",zr.createNodeArray([r])))}}e.insertModifierBefore(t,134,n)}var Du=[wt._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,wt._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code];var Iu="fixPropertyOverrideAccessor";registerCodeFix({errorCodes:Du,getCodeActions(e){const t=doChange32(e.sourceFile,e.span.start,e.span.length,e.errorCode,e);if(t){return[createCodeFixAction(Iu,t,wt.Generate_get_and_set_accessors,Iu,wt.Generate_get_and_set_accessors_for_all_overriding_properties)]}},fixIds:[Iu],getAllCodeActions:e=>codeFixAll(e,Du,((t,n)=>{const r=doChange32(n.file,n.start,n.length,n.code,e);if(r){for(const n of r){t.pushRaw(e.sourceFile,n)}}}))});function doChange32(e,t,n,r,i){let o;let a;if(r===wt._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code){o=t;a=t+n}else if(r===wt._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code){const n=i.program.getTypeChecker();const r=getTokenAtPosition(e,t).parent;S.assert(isAccessor(r),"error span of fixPropertyOverrideAccessor should only be on an accessor");const s=r.parent;S.assert(isClassLike(s),"erroneous accessors should only be inside classes");const c=singleOrUndefined(getAllSupers(s,n));if(!c)return[];const l=unescapeLeadingUnderscores(getTextOfPropertyName(r.name));const d=n.getPropertyOfType(n.getTypeAtLocation(c),l);if(!d||!d.valueDeclaration)return[];o=d.valueDeclaration.pos;a=d.valueDeclaration.end;e=getSourceFileOfNode(d.valueDeclaration)}else{S.fail("fixPropertyOverrideAccessor codefix got unexpected error code "+r)}return generateAccessorFromProperty(e,i.program,o,a,i,wt.Generate_get_and_set_accessors.message)}var Au="inferFromUsage";var Ou=[wt.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,wt.Variable_0_implicitly_has_an_1_type.code,wt.Parameter_0_implicitly_has_an_1_type.code,wt.Rest_parameter_0_implicitly_has_an_any_type.code,wt.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,wt._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,wt.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,wt.Member_0_implicitly_has_an_1_type.code,wt.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code,wt.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,wt.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,wt.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code,wt.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code,wt._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code,wt.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code,wt.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,wt.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];registerCodeFix({errorCodes:Ou,getCodeActions(e){const{sourceFile:t,program:n,span:{start:r},errorCode:i,cancellationToken:o,host:a,preferences:s}=e;const c=getTokenAtPosition(t,r);let l;const d=dm.ChangeTracker.with(e,(e=>{l=doChange33(e,t,c,i,n,o,returnTrue,a,s)}));const p=l&&getNameOfDeclaration(l);return!p||d.length===0?void 0:[createCodeFixAction(Au,d,[getDiagnostic(i,c),getTextOfNode(p)],Au,wt.Infer_all_types_from_usage)]},fixIds:[Au],getAllCodeActions(e){const{sourceFile:t,program:n,cancellationToken:r,host:i,preferences:o}=e;const a=nodeSeenTracker();return codeFixAll(e,Ou,((e,s)=>{doChange33(e,t,getTokenAtPosition(s.file,s.start),s.code,n,r,a,i,o)}))}});function getDiagnostic(e,t){switch(e){case wt.Parameter_0_implicitly_has_an_1_type.code:case wt.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return isSetAccessorDeclaration(getContainingFunction(t))?wt.Infer_type_of_0_from_usage:wt.Infer_parameter_types_from_usage;case wt.Rest_parameter_0_implicitly_has_an_any_type.code:case wt.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return wt.Infer_parameter_types_from_usage;case wt.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:return wt.Infer_this_type_of_0_from_usage;default:return wt.Infer_type_of_0_from_usage}}function mapSuggestionDiagnostic(e){switch(e){case wt.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code:return wt.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code;case wt.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return wt.Variable_0_implicitly_has_an_1_type.code;case wt.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return wt.Parameter_0_implicitly_has_an_1_type.code;case wt.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return wt.Rest_parameter_0_implicitly_has_an_any_type.code;case wt.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code:return wt.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code;case wt._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code:return wt._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code;case wt.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code:return wt.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code;case wt.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return wt.Member_0_implicitly_has_an_1_type.code}return e}function doChange33(e,t,n,r,i,o,a,s,c){if(!isParameterPropertyModifier(n.kind)&&n.kind!==80&&n.kind!==26&&n.kind!==110){return void 0}const{parent:l}=n;const d=createImportAdder(t,i,c,s);r=mapSuggestionDiagnostic(r);switch(r){case wt.Member_0_implicitly_has_an_1_type.code:case wt.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:if(isVariableDeclaration(l)&&a(l)||isPropertyDeclaration(l)||isPropertySignature(l)){annotateVariableDeclaration(e,d,t,l,i,s,o);d.writeFixes(e);return l}if(isPropertyAccessExpression(l)){const n=inferTypeForVariableFromUsage(l.name,i,o);const r=getTypeNodeIfAccessible(n,l,i,s);if(r){const n=zr.createJSDocTypeTag(void 0,zr.createJSDocTypeExpression(r),void 0);e.addJSDocTags(t,cast(l.parent.parent,isExpressionStatement),[n])}d.writeFixes(e);return l}return void 0;case wt.Variable_0_implicitly_has_an_1_type.code:{const t=i.getTypeChecker().getSymbolAtLocation(n);if(t&&t.valueDeclaration&&isVariableDeclaration(t.valueDeclaration)&&a(t.valueDeclaration)){annotateVariableDeclaration(e,d,getSourceFileOfNode(t.valueDeclaration),t.valueDeclaration,i,s,o);d.writeFixes(e);return t.valueDeclaration}return void 0}}const p=getContainingFunction(n);if(p===void 0){return void 0}let u;switch(r){case wt.Parameter_0_implicitly_has_an_1_type.code:if(isSetAccessorDeclaration(p)){annotateSetAccessor(e,d,t,p,i,s,o);u=p;break}case wt.Rest_parameter_0_implicitly_has_an_any_type.code:if(a(p)){const n=cast(l,isParameter);annotateParameters(e,d,t,n,p,i,s,o);u=n}break;case wt.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:case wt._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:if(isGetAccessorDeclaration(p)&&isIdentifier(p.name)){annotate(e,d,t,p,inferTypeForVariableFromUsage(p.name,i,o),i,s);u=p}break;case wt.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:if(isSetAccessorDeclaration(p)){annotateSetAccessor(e,d,t,p,i,s,o);u=p}break;case wt.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:if(dm.isThisTypeAnnotatable(p)&&a(p)){annotateThis(e,t,p,i,s,o);u=p}break;default:return S.fail(String(r))}d.writeFixes(e);return u}function annotateVariableDeclaration(e,t,n,r,i,o,a){if(isIdentifier(r.name)){annotate(e,t,n,r,inferTypeForVariableFromUsage(r.name,i,a),i,o)}}function annotateParameters(e,t,n,r,i,o,a,s){if(!isIdentifier(r.name)){return}const c=inferTypeForParametersFromUsage(i,n,o,s);S.assert(i.parameters.length===c.length,"Parameter count and inference count should match");if(isInJSFile(i)){annotateJSDocParameters(e,n,c,o,a)}else{const r=isArrowFunction(i)&&!findChildOfKind(i,21,n);if(r)e.insertNodeBefore(n,first(i.parameters),zr.createToken(21));for(const{declaration:r,type:i}of c){if(r&&!r.type&&!r.initializer){annotate(e,t,n,r,i,o,a)}}if(r)e.insertNodeAfter(n,last(i.parameters),zr.createToken(22))}}function annotateThis(e,t,n,r,i,o){const a=getFunctionReferences(n,t,r,o);if(!a||!a.length){return}const s=inferTypeFromReferences(r,a,o).thisParameter();const c=getTypeNodeIfAccessible(s,n,r,i);if(!c){return}if(isInJSFile(n)){annotateJSDocThis(e,t,n,c)}else{e.tryInsertThisTypeAnnotation(t,n,c)}}function annotateJSDocThis(e,t,n,r){e.addJSDocTags(t,n,[zr.createJSDocThisTag(void 0,zr.createJSDocTypeExpression(r))])}function annotateSetAccessor(e,t,n,r,i,o,a){const s=firstOrUndefined(r.parameters);if(s&&isIdentifier(r.name)&&isIdentifier(s.name)){let c=inferTypeForVariableFromUsage(r.name,i,a);if(c===i.getTypeChecker().getAnyType()){c=inferTypeForVariableFromUsage(s.name,i,a)}if(isInJSFile(r)){annotateJSDocParameters(e,n,[{declaration:s,type:c}],i,o)}else{annotate(e,t,n,s,c,i,o)}}}function annotate(e,t,n,r,i,o,a){const s=getTypeNodeIfAccessible(i,r,o,a);if(s){if(isInJSFile(n)&&r.kind!==171){const t=isVariableDeclaration(r)?tryCast(r.parent.parent,isVariableStatement):r;if(!t){return}const i=zr.createJSDocTypeExpression(s);const o=isGetAccessorDeclaration(r)?zr.createJSDocReturnTag(void 0,i,void 0):zr.createJSDocTypeTag(void 0,i,void 0);e.addJSDocTags(n,t,[o])}else if(!tryReplaceImportTypeNodeWithAutoImport(s,r,n,e,t,zn(o.getCompilerOptions()))){e.tryInsertTypeAnnotation(n,r,s)}}}function tryReplaceImportTypeNodeWithAutoImport(e,t,n,r,i,o){const a=tryGetAutoImportableReferenceFromTypeNode(e,o);if(a&&r.tryInsertTypeAnnotation(n,t,a.typeNode)){forEach(a.symbols,(e=>i.addImportFromExportedSymbol(e,true)));return true}return false}function annotateJSDocParameters(e,t,n,r,i){const o=n.length&&n[0].declaration.parent;if(!o){return}const a=mapDefined(n,(e=>{const t=e.declaration;if(t.initializer||getJSDocType(t)||!isIdentifier(t.name)){return}const n=e.type&&getTypeNodeIfAccessible(e.type,t,r,i);if(n){const r=zr.cloneNode(t.name);setEmitFlags(r,3072|4096);return{name:zr.cloneNode(t.name),param:t,isOptional:!!e.isOptional,typeNode:n}}}));if(!a.length){return}if(isArrowFunction(o)||isFunctionExpression(o)){const n=isArrowFunction(o)&&!findChildOfKind(o,21,t);if(n){e.insertNodeBefore(t,first(o.parameters),zr.createToken(21))}forEach(a,(({typeNode:n,param:r})=>{const i=zr.createJSDocTypeTag(void 0,zr.createJSDocTypeExpression(n));const o=zr.createJSDocComment(void 0,[i]);e.insertNodeAt(t,r.getStart(t),o,{suffix:" "})}));if(n){e.insertNodeAfter(t,last(o.parameters),zr.createToken(22))}}else{const n=map(a,(({name:e,typeNode:t,isOptional:n})=>zr.createJSDocParameterTag(void 0,e,!!n,zr.createJSDocTypeExpression(t),false,void 0)));e.addJSDocTags(t,o,n)}}function getReferences(e,t,n){return mapDefined(Rf.getReferenceEntriesForNode(-1,e,t,t.getSourceFiles(),n),(e=>e.kind!==Rf.EntryKind.Span?tryCast(e.node,isIdentifier):void 0))}function inferTypeForVariableFromUsage(e,t,n){const r=getReferences(e,t,n);return inferTypeFromReferences(t,r,n).single()}function inferTypeForParametersFromUsage(e,t,n,r){const i=getFunctionReferences(e,t,n,r);return i&&inferTypeFromReferences(n,i,r).parameters(e)||e.parameters.map((e=>({declaration:e,type:isIdentifier(e.name)?inferTypeForVariableFromUsage(e.name,n,r):n.getTypeChecker().getAnyType()})))}function getFunctionReferences(e,t,n,r){let i;switch(e.kind){case 176:i=findChildOfKind(e,137,t);break;case 219:case 218:const n=e.parent;i=(isVariableDeclaration(n)||isPropertyDeclaration(n))&&isIdentifier(n.name)?n.name:e.name;break;case 262:case 174:case 173:i=e.name;break}if(!i){return void 0}return getReferences(i,n,r)}function inferTypeFromReferences(e,t,n){const r=e.getTypeChecker();const i={string:()=>r.getStringType(),number:()=>r.getNumberType(),Array:e=>r.createArrayType(e),Promise:e=>r.createPromiseType(e)};const o=[r.getStringType(),r.getNumberType(),r.createArrayType(r.getAnyType()),r.createPromiseType(r.getAnyType())];return{single:single2,parameters:parameters,thisParameter:thisParameter};function createEmptyUsage(){return{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0}}function combineUsages(e){const t=new Map;for(const n of e){if(n.properties){n.properties.forEach(((e,n)=>{if(!t.has(n)){t.set(n,[])}t.get(n).push(e)}))}}const n=new Map;t.forEach(((e,t)=>{n.set(t,combineUsages(e))}));return{isNumber:e.some((e=>e.isNumber)),isString:e.some((e=>e.isString)),isNumberOrString:e.some((e=>e.isNumberOrString)),candidateTypes:flatMap(e,(e=>e.candidateTypes)),properties:n,calls:flatMap(e,(e=>e.calls)),constructs:flatMap(e,(e=>e.constructs)),numberIndex:forEach(e,(e=>e.numberIndex)),stringIndex:forEach(e,(e=>e.stringIndex)),candidateThisTypes:flatMap(e,(e=>e.candidateThisTypes)),inferredTypes:void 0}}function single2(){return combineTypes(inferTypesFromReferencesSingle(t))}function parameters(i){if(t.length===0||!i.parameters){return void 0}const o=createEmptyUsage();for(const e of t){n.throwIfCancellationRequested();calculateUsageOfNode(e,o)}const a=[...o.constructs||[],...o.calls||[]];return i.parameters.map(((t,o)=>{const s=[];const c=isRestParameter(t);let l=false;for(const e of a){if(e.argumentTypes.length<=o){l=isInJSFile(i);s.push(r.getUndefinedType())}else if(c){for(let t=o;tn.every((t=>!t(e)))))}function combineFromUsage(e){return combineTypes(inferTypes(e))}function combineTypes(e){if(!e.length)return r.getAnyType();const t=r.getUnionType([r.getStringType(),r.getNumberType()]);const n=[{high:e=>e===r.getStringType()||e===r.getNumberType(),low:e=>e===t},{high:e=>!(e.flags&(1|16384)),low:e=>!!(e.flags&(1|16384))},{high:e=>!(e.flags&(98304|1|16384))&&!(getObjectFlags(e)&16),low:e=>!!(getObjectFlags(e)&16)}];let i=removeLowPriorityInferences(e,n);const o=i.filter((e=>getObjectFlags(e)&16));if(o.length){i=i.filter((e=>!(getObjectFlags(e)&16)));i.push(combineAnonymousTypes(o))}return r.getWidenedType(r.getUnionType(i.map(r.getBaseTypeOfLiteralType),2))}function combineAnonymousTypes(e){if(e.length===1){return e[0]}const t=[];const n=[];const i=[];const o=[];let a=false;let s=false;const c=createMultiMap();for(const l of e){for(const e of r.getPropertiesOfType(l)){c.add(e.escapedName,e.valueDeclaration?r.getTypeOfSymbolAtLocation(e,e.valueDeclaration):r.getAnyType())}t.push(...r.getSignaturesOfType(l,0));n.push(...r.getSignaturesOfType(l,1));const e=r.getIndexInfoOfType(l,0);if(e){i.push(e.type);a=a||e.isReadonly}const d=r.getIndexInfoOfType(l,1);if(d){o.push(d.type);s=s||d.isReadonly}}const l=mapEntries(c,((t,n)=>{const i=n.lengthr.getBaseTypeOfLiteralType(e)));const s=((i=e.calls)==null?void 0:i.length)?inferStructuralType(e):void 0;if(s&&a){o.push(r.getUnionType([s,...a],2))}else{if(s){o.push(s)}if(length(a)){o.push(...a)}}o.push(...inferNamedTypesFromProperties(e));return o}function inferStructuralType(e){const t=new Map;if(e.properties){e.properties.forEach(((e,n)=>{const i=r.createSymbol(4,n);i.links.type=combineFromUsage(e);t.set(n,i)}))}const n=e.calls?[getSignatureFromCalls(e.calls)]:[];const i=e.constructs?[getSignatureFromCalls(e.constructs)]:[];const o=e.stringIndex?[r.createIndexInfo(r.getStringType(),combineFromUsage(e.stringIndex),false)]:[];return r.createAnonymousType(void 0,t,n,i,o)}function inferNamedTypesFromProperties(e){if(!e.properties||!e.properties.size)return[];const t=o.filter((t=>allPropertiesAreAssignableToUsage(t,e)));if(0inferInstantiationFromUsage(t,e)))}return[]}function allPropertiesAreAssignableToUsage(e,t){if(!t.properties)return false;return!forEachEntry(t.properties,((t,n)=>{const i=r.getTypeOfPropertyOfType(e,n);if(!i){return true}if(t.calls){const e=r.getSignaturesOfType(i,0);return!e.length||!r.isTypeAssignableTo(i,getFunctionFromCalls(t.calls))}else{return!r.isTypeAssignableTo(i,combineFromUsage(t))}}))}function inferInstantiationFromUsage(e,t){if(!(getObjectFlags(e)&4)||!t.properties){return e}const n=e.target;const o=singleOrUndefined(n.typeParameters);if(!o)return e;const a=[];t.properties.forEach(((e,t)=>{const i=r.getTypeOfPropertyOfType(n,t);S.assert(!!i,"generic should have all the properties of its reference.");a.push(...inferTypeParameters(i,combineFromUsage(e),o))}));return i[e.symbol.escapedName](combineTypes(a))}function inferTypeParameters(e,t,n){if(e===n){return[t]}else if(e.flags&3145728){return flatMap(e.types,(e=>inferTypeParameters(e,t,n)))}else if(getObjectFlags(e)&4&&getObjectFlags(t)&4){const i=r.getTypeArguments(e);const o=r.getTypeArguments(t);const a=[];if(i&&o){for(let e=0;ee.argumentTypes.length)));for(let i=0;ie.argumentTypes[i]||r.getUndefinedType())));if(e.some((e=>e.argumentTypes[i]===void 0))){n.flags|=16777216}t.push(n)}const i=combineFromUsage(combineUsages(e.map((e=>e.return_))));return r.createSignature(void 0,void 0,void 0,t,i,void 0,n,0)}function addCandidateType(e,t){if(t&&!(t.flags&1)&&!(t.flags&131072)){(e.candidateTypes||(e.candidateTypes=[])).push(t)}}function addCandidateThisType(e,t){if(t&&!(t.flags&1)&&!(t.flags&131072)){(e.candidateThisTypes||(e.candidateThisTypes=[])).push(t)}}}var wu="fixReturnTypeInAsyncFunction";var Lu=[wt.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code];registerCodeFix({errorCodes:Lu,fixIds:[wu],getCodeActions:function getCodeActionsToFixReturnTypeInAsyncFunction(e){const{sourceFile:t,program:n,span:r}=e;const i=n.getTypeChecker();const o=getInfo16(t,n.getTypeChecker(),r.start);if(!o){return void 0}const{returnTypeNode:a,returnType:s,promisedTypeNode:c,promisedType:l}=o;const d=dm.ChangeTracker.with(e,(e=>doChange34(e,t,a,c)));return[createCodeFixAction(wu,d,[wt.Replace_0_with_Promise_1,i.typeToString(s),i.typeToString(l)],wu,wt.Fix_all_incorrect_return_type_of_an_async_functions)]},getAllCodeActions:e=>codeFixAll(e,Lu,((t,n)=>{const r=getInfo16(n.file,e.program.getTypeChecker(),n.start);if(r){doChange34(t,n.file,r.returnTypeNode,r.promisedTypeNode)}}))});function getInfo16(e,t,n){if(isInJSFile(e)){return void 0}const r=getTokenAtPosition(e,n);const i=findAncestor(r,isFunctionLikeDeclaration);const o=i==null?void 0:i.type;if(!o){return void 0}const a=t.getTypeFromTypeNode(o);const s=t.getAwaitedType(a)||t.getVoidType();const c=t.typeToTypeNode(s,o,void 0);if(c){return{returnTypeNode:o,returnType:a,promisedTypeNode:c,promisedType:s}}}function doChange34(e,t,n,r){e.replaceNode(t,n,zr.createTypeReferenceNode("Promise",[r]))}var Mu="disableJsDiagnostics";var Ru="disableJsDiagnostics";var Bu=mapDefined(Object.keys(wt),(e=>{const t=wt[e];return t.category===1?t.code:void 0}));registerCodeFix({errorCodes:Bu,getCodeActions:function getCodeActionsToDisableJsDiagnostics(e){const{sourceFile:t,program:n,span:r,host:i,formatContext:o}=e;if(!isInJSFile(t)||!isCheckJsEnabledForFile(t,n.getCompilerOptions())){return void 0}const a=t.checkJsDirective?"":getNewLineOrDefaultFromHost(i,o.options);const s=[createCodeFixActionWithoutFixAll(Mu,[createFileTextChanges(t.fileName,[createTextChange(t.checkJsDirective?createTextSpanFromBounds(t.checkJsDirective.pos,t.checkJsDirective.end):createTextSpan(0,0),`// @ts-nocheck${a}`)])],wt.Disable_checking_for_this_file)];if(dm.isValidLocationToAddComment(t,r.start)){s.unshift(createCodeFixAction(Mu,dm.ChangeTracker.with(e,(e=>makeChange9(e,t,r.start))),wt.Ignore_this_error_message,Ru,wt.Add_ts_ignore_to_all_error_messages))}return s},fixIds:[Ru],getAllCodeActions:e=>{const t=new Set;return codeFixAll(e,Bu,((e,n)=>{if(dm.isValidLocationToAddComment(n.file,n.start)){makeChange9(e,n.file,n.start,t)}}))}});function makeChange9(e,t,n,r){const{line:i}=getLineAndCharacterOfPosition(t,n);if(!r||tryAddToSet(r,i)){e.insertCommentBeforeLine(t,i,n," @ts-ignore")}}function createMissingMemberNodes(e,t,n,r,i,o,a){const s=e.symbol.members;for(const c of t){if(!s.has(c.escapedName)){addNewNodeForMemberSymbol(c,e,n,r,i,o,a,void 0)}}}function getNoopSymbolTrackerWithResolver(e){return{trackSymbol:()=>false,moduleResolverHost:getModuleSpecifierResolverHost(e.program,e.host)}}var ju=(e=>{e[e["Method"]=1]="Method";e[e["Property"]=2]="Property";e[e["All"]=3]="All";return e})(ju||{});function addNewNodeForMemberSymbol(e,t,n,r,i,o,a,s,c=3,l=false){const p=e.getDeclarations();const u=firstOrUndefined(p);const f=r.program.getTypeChecker();const m=zn(r.program.getCompilerOptions());const _=(u==null?void 0:u.kind)??171;const g=createDeclarationName(e,u);const y=u?getEffectiveModifierFlags(u):0;let h=y&256;h|=y&1?1:y&4?4:0;if(u&&isAutoAccessorPropertyDeclaration(u)){h|=512}const T=createModifiers();const v=f.getWidenedType(f.getTypeOfSymbolAtLocation(e,t));const x=!!(e.flags&16777216);const b=!!(t.flags&33554432)||l;const C=getQuotePreference(n,i);const E=1|(C===0?268435456:0);switch(_){case 171:case 172:let n=f.typeToTypeNode(v,t,E,8,getNoopSymbolTrackerWithResolver(r));if(o){const e=tryGetAutoImportableReferenceFromTypeNode(n,m);if(e){n=e.typeNode;importSymbols(o,e.symbols)}}a(zr.createPropertyDeclaration(T,u?createName(g):e.getName(),x&&c&2?zr.createToken(58):void 0,n,void 0));break;case 177:case 178:{S.assertIsDefined(p);let e=f.typeToTypeNode(v,t,E,void 0,getNoopSymbolTrackerWithResolver(r));const n=getAllAccessorDeclarations(p,u);const i=n.secondAccessor?[n.firstAccessor,n.secondAccessor]:[n.firstAccessor];if(o){const t=tryGetAutoImportableReferenceFromTypeNode(e,m);if(t){e=t.typeNode;importSymbols(o,t.symbols)}}for(const t of i){if(isGetAccessorDeclaration(t)){a(zr.createGetAccessorDeclaration(T,createName(g),d,createTypeNode(e),createBody(s,C,b)))}else{S.assertNode(t,isSetAccessorDeclaration,"The counterpart to a getter should be a setter");const n=getSetAccessorValueParameter(t);const r=n&&isIdentifier(n.name)?idText(n.name):void 0;a(zr.createSetAccessorDeclaration(T,createName(g),createDummyParameters(1,[r],[createTypeNode(e)],1,false),createBody(s,C,b)))}}break}case 173:case 174:S.assertIsDefined(p);const i=v.isUnion()?flatMap(v.types,(e=>e.getCallSignatures())):v.getCallSignatures();if(!some(i)){break}if(p.length===1){S.assert(i.length===1,"One declaration implies one signature");const e=i[0];outputMethod(C,e,T,createName(g),createBody(s,C,b));break}for(const e of i){if(e.declaration&&e.declaration.flags&33554432){continue}outputMethod(C,e,T,createName(g))}if(!b){if(p.length>i.length){const e=f.getSignatureFromDeclaration(p[p.length-1]);outputMethod(C,e,T,createName(g),createBody(s,C))}else{S.assert(p.length===i.length,"Declarations and signatures should match count");a(createMethodImplementingSignatures(f,r,t,i,createName(g),x&&!!(c&1),T,C,s))}}break}function outputMethod(e,n,i,s,l){const d=createSignatureDeclarationFromSignature(174,r,e,n,l,s,i,x&&!!(c&1),t,o);if(d)a(d)}function createModifiers(){let e;if(h){e=combine(e,zr.createModifiersFromModifierFlags(h))}if(shouldAddOverrideKeyword()){e=append(e,zr.createToken(164))}return e&&zr.createNodeArray(e)}function shouldAddOverrideKeyword(){return!!(r.program.getCompilerOptions().noImplicitOverride&&u&&hasAbstractModifier(u))}function createName(e){if(isIdentifier(e)&&e.escapedText==="constructor"){return zr.createComputedPropertyName(zr.createStringLiteral(idText(e),C===0))}return getSynthesizedDeepClone(e,false)}function createBody(e,t,n){return n?void 0:getSynthesizedDeepClone(e,false)||createStubbedMethodBody(t)}function createTypeNode(e){return getSynthesizedDeepClone(e,false)}function createDeclarationName(e,t){if(getCheckFlags(e)&262144){const t=e.links.nameType;if(t&&isTypeUsableAsPropertyName(t)){return zr.createIdentifier(unescapeLeadingUnderscores(getPropertyNameFromType(t)))}}return getSynthesizedDeepClone(getNameOfDeclaration(t),false)}}function createSignatureDeclarationFromSignature(e,t,n,r,i,o,a,s,c,l){const d=t.program;const p=d.getTypeChecker();const u=zn(d.getCompilerOptions());const f=isInJSFile(c);const m=1|256|524288|(n===0?268435456:0);const _=p.signatureToSignatureDeclaration(r,e,c,m,8,getNoopSymbolTrackerWithResolver(t));if(!_){return void 0}let g=f?void 0:_.typeParameters;let y=_.parameters;let h=f?void 0:getSynthesizedDeepClone(_.type);if(l){if(g){const e=sameMap(g,(e=>{let t=e.constraint;let n=e.default;if(t){const e=tryGetAutoImportableReferenceFromTypeNode(t,u);if(e){t=e.typeNode;importSymbols(l,e.symbols)}}if(n){const e=tryGetAutoImportableReferenceFromTypeNode(n,u);if(e){n=e.typeNode;importSymbols(l,e.symbols)}}return zr.updateTypeParameterDeclaration(e,e.modifiers,e.name,t,n)}));if(g!==e){g=setTextRange(zr.createNodeArray(e,g.hasTrailingComma),g)}}const e=sameMap(y,(e=>{let t=f?void 0:e.type;if(t){const e=tryGetAutoImportableReferenceFromTypeNode(t,u);if(e){t=e.typeNode;importSymbols(l,e.symbols)}}return zr.updateParameterDeclaration(e,e.modifiers,e.dotDotDotToken,e.name,f?void 0:e.questionToken,t,e.initializer)}));if(y!==e){y=setTextRange(zr.createNodeArray(e,y.hasTrailingComma),y)}if(h){const e=tryGetAutoImportableReferenceFromTypeNode(h,u);if(e){h=e.typeNode;importSymbols(l,e.symbols)}}}const T=s?zr.createToken(58):void 0;const S=_.asteriskToken;if(isFunctionExpression(_)){return zr.updateFunctionExpression(_,a,_.asteriskToken,tryCast(o,isIdentifier),g,y,h,i??_.body)}if(isArrowFunction(_)){return zr.updateArrowFunction(_,a,g,y,h,_.equalsGreaterThanToken,i??_.body)}if(isMethodDeclaration(_)){return zr.updateMethodDeclaration(_,a,S,o??zr.createIdentifier(""),T,g,y,h,i)}if(isFunctionDeclaration(_)){return zr.updateFunctionDeclaration(_,a,_.asteriskToken,tryCast(o,isIdentifier),g,y,h,i??_.body)}return void 0}function createSignatureDeclarationFromCallExpression(e,t,n,r,i,o,a){const s=getQuotePreference(t.sourceFile,t.preferences);const c=zn(t.program.getCompilerOptions());const l=getNoopSymbolTrackerWithResolver(t);const d=t.program.getTypeChecker();const p=isInJSFile(a);const{typeArguments:u,arguments:f,parent:m}=r;const _=p?void 0:d.getContextualType(r);const g=map(f,(e=>isIdentifier(e)?e.text:isPropertyAccessExpression(e)&&isIdentifier(e.name)?e.name.text:void 0));const y=p?[]:map(f,(e=>d.getTypeAtLocation(e)));const{argumentTypeNodes:h,argumentTypeParameters:T}=getArgumentTypesAndTypeParameters(d,n,y,a,c,1,8,l);const v=o?zr.createNodeArray(zr.createModifiersFromModifierFlags(o)):void 0;const x=isYieldExpression(m)?zr.createToken(42):void 0;const b=p?void 0:createTypeParametersForArguments(d,T,u);const C=createDummyParameters(f.length,g,h,void 0,p);const E=p||_===void 0?void 0:d.typeToTypeNode(_,a,void 0,void 0,l);switch(e){case 174:return zr.createMethodDeclaration(v,x,i,void 0,b,C,E,createStubbedMethodBody(s));case 173:return zr.createMethodSignature(v,i,void 0,b,C,E===void 0?zr.createKeywordTypeNode(159):E);case 262:S.assert(typeof i==="string"||isIdentifier(i),"Unexpected name");return zr.createFunctionDeclaration(v,x,i,b,C,E,createStubbedBody(wt.Function_not_implemented.message,s));default:S.fail("Unexpected kind")}}function createTypeParametersForArguments(e,t,n){const r=new Set(t.map((e=>e[0])));const i=new Map(t);if(n){const i=n.filter((n=>!t.some((t=>{var r;return e.getTypeAtLocation(n)===((r=t[1])==null?void 0:r.argumentType)}))));const o=r.size+i.length;for(let e=0;r.size{var t;return zr.createTypeParameterDeclaration(void 0,e,(t=i.get(e))==null?void 0:t.constraint)}))}function createTypeParameterName(e){return 84+e<=90?String.fromCharCode(84+e):`T${e}`}function typeToAutoImportableTypeNode(e,t,n,r,i,o,a,s){const c=e.typeToTypeNode(n,r,o,a,s);if(!c){return void 0}return typeNodeToAutoImportableTypeNode(c,t,i)}function typeNodeToAutoImportableTypeNode(e,t,n){const r=tryGetAutoImportableReferenceFromTypeNode(e,n);if(r){importSymbols(t,r.symbols);e=r.typeNode}return getSynthesizedDeepClone(e)}function endOfRequiredTypeParameters(e,t){S.assert(t.typeArguments);const n=t.typeArguments;const r=t.target;for(let t=0;te===n[t]))){return t}}return n.length}function typeToMinimizedReferenceType(e,t,n,r,i,o){let a=e.typeToTypeNode(t,n,r,i,o);if(!a){return void 0}if(isTypeReferenceNode(a)){const n=t;if(n.typeArguments&&a.typeArguments){const t=endOfRequiredTypeParameters(e,n);if(t=r?zr.createToken(58):void 0,i?void 0:(n==null?void 0:n[s])||zr.createKeywordTypeNode(159),void 0);o.push(l)}return o}function createMethodImplementingSignatures(e,t,n,r,i,o,a,s,c){let l=r[0];let d=r[0].minArgumentCount;let p=false;for(const e of r){d=Math.min(e.minArgumentCount,d);if(signatureHasRestParameter(e)){p=true}if(e.parameters.length>=l.parameters.length&&(!signatureHasRestParameter(e)||signatureHasRestParameter(l))){l=e}}const u=l.parameters.length-(signatureHasRestParameter(l)?1:0);const f=l.parameters.map((e=>e.name));const m=createDummyParameters(u,f,void 0,d,false);if(p){const e=zr.createParameterDeclaration(void 0,zr.createToken(26),f[u]||"rest",u>=d?zr.createToken(58):void 0,zr.createArrayTypeNode(zr.createKeywordTypeNode(159)),void 0);m.push(e)}return createStubbedMethod(a,i,o,void 0,m,getReturnTypeFromSignatures(r,e,t,n),s,c)}function getReturnTypeFromSignatures(e,t,n,r){if(length(e)){const i=t.getUnionType(map(e,t.getReturnTypeOfSignature));return t.typeToTypeNode(i,r,1,8,getNoopSymbolTrackerWithResolver(n))}}function createStubbedMethod(e,t,n,r,i,o,a,s){return zr.createMethodDeclaration(e,void 0,t,n?zr.createToken(58):void 0,r,i,o,s||createStubbedMethodBody(a))}function createStubbedMethodBody(e){return createStubbedBody(wt.Method_not_implemented.message,e)}function createStubbedBody(e,t){return zr.createBlock([zr.createThrowStatement(zr.createNewExpression(zr.createIdentifier("Error"),void 0,[zr.createStringLiteral(e,t===0)]))],true)}function setJsonCompilerOptionValues(e,t,n){const r=getTsConfigObjectLiteralExpression(t);if(!r)return void 0;const i=findJsonProperty(r,"compilerOptions");if(i===void 0){e.insertNodeAtObjectStart(t,r,createJsonPropertyAssignment("compilerOptions",zr.createObjectLiteralExpression(n.map((([e,t])=>createJsonPropertyAssignment(e,t))),true)));return}const o=i.initializer;if(!isObjectLiteralExpression(o)){return}for(const[r,i]of n){const n=findJsonProperty(o,r);if(n===void 0){e.insertNodeAtObjectStart(t,o,createJsonPropertyAssignment(r,i))}else{e.replaceNode(t,n.initializer,i)}}}function setJsonCompilerOptionValue(e,t,n,r){setJsonCompilerOptionValues(e,t,[[n,r]])}function createJsonPropertyAssignment(e,t){return zr.createPropertyAssignment(zr.createStringLiteral(e),t)}function findJsonProperty(e,t){return find(e.properties,(e=>isPropertyAssignment(e)&&!!e.name&&isStringLiteral(e.name)&&e.name.text===t))}function tryGetAutoImportableReferenceFromTypeNode(e,t){let n;const r=visitNode(e,visit,isTypeNode);if(n&&r){return{typeNode:r,symbols:n}}function visit(e){if(isLiteralImportTypeNode(e)&&e.qualifier){const r=getFirstIdentifier(e.qualifier);if(!r.symbol){return visitEachChild(e,visit,void 0)}const i=getNameForExportedSymbol(r.symbol,t);const o=i!==r.text?replaceFirstIdentifierOfEntityName(e.qualifier,zr.createIdentifier(i)):e.qualifier;n=append(n,r.symbol);const a=visitNodes2(e.typeArguments,visit,isTypeNode);return zr.createTypeReferenceNode(o,a)}return visitEachChild(e,visit,void 0)}}function replaceFirstIdentifierOfEntityName(e,t){if(e.kind===80){return t}return zr.createQualifiedName(replaceFirstIdentifierOfEntityName(e.left,t),e.right)}function importSymbols(e,t){t.forEach((t=>e.addImportFromExportedSymbol(t,true)))}function findAncestorMatchingSpan(e,t){const n=textSpanEnd(t);let r=getTokenAtPosition(e,t.start);while(r.ende.replaceNode(t,n,r)));return createCodeFixActionWithoutFixAll(Ju,i,[wt.Replace_import_with_0,i[0].textChanges[0].newText])}registerCodeFix({errorCodes:[wt.This_expression_is_not_callable.code,wt.This_expression_is_not_constructable.code],getCodeActions:getActionsForUsageOfInvalidImport});function getActionsForUsageOfInvalidImport(e){const t=e.sourceFile;const n=wt.This_expression_is_not_callable.code===e.errorCode?213:214;const r=findAncestor(getTokenAtPosition(t,e.span.start),(e=>e.kind===n));if(!r){return[]}const i=r.expression;return getImportCodeFixesForExpression(e,i)}registerCodeFix({errorCodes:[wt.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,wt.Type_0_does_not_satisfy_the_constraint_1.code,wt.Type_0_is_not_assignable_to_type_1.code,wt.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,wt.Type_predicate_0_is_not_assignable_to_1.code,wt.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code,wt._0_index_type_1_is_not_assignable_to_2_index_type_3.code,wt.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code,wt.Property_0_in_type_1_is_not_assignable_to_type_2.code,wt.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code,wt.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code],getCodeActions:getActionsForInvalidImportLocation});function getActionsForInvalidImportLocation(e){const t=e.sourceFile;const n=findAncestor(getTokenAtPosition(t,e.span.start),(t=>t.getStart()===e.span.start&&t.getEnd()===e.span.start+e.span.length));if(!n){return[]}return getImportCodeFixesForExpression(e,n)}function getImportCodeFixesForExpression(e,t){const n=e.program.getTypeChecker().getTypeAtLocation(t);if(!(n.symbol&&isTransientSymbol(n.symbol)&&n.symbol.links.originatingImport)){return[]}const r=[];const i=n.symbol.links.originatingImport;if(!isImportCall(i)){addRange(r,getCodeFixesForImportDeclaration(e,i))}if(isExpression(t)&&!(isNamedDeclaration(t.parent)&&t.parent.name===t)){const n=e.sourceFile;const i=dm.ChangeTracker.with(e,(e=>e.replaceNode(n,t,zr.createPropertyAccessExpression(t,"default"),{})));r.push(createCodeFixActionWithoutFixAll(Ju,i,wt.Use_synthetic_default_member))}return r}var Wu="strictClassInitialization";var Uu="addMissingPropertyDefiniteAssignmentAssertions";var zu="addMissingPropertyUndefinedType";var Vu="addMissingPropertyInitializer";var qu=[wt.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];registerCodeFix({errorCodes:qu,getCodeActions:function getCodeActionsForStrictClassInitializationErrors(e){const t=getInfo17(e.sourceFile,e.span.start);if(!t)return;const n=[];append(n,getActionForAddMissingUndefinedType(e,t));append(n,getActionForAddMissingDefiniteAssignmentAssertion(e,t));append(n,getActionForAddMissingInitializer(e,t));return n},fixIds:[Uu,zu,Vu],getAllCodeActions:e=>codeFixAll(e,qu,((t,n)=>{const r=getInfo17(n.file,n.start);if(!r)return;switch(e.fixId){case Uu:addDefiniteAssignmentAssertion(t,n.file,r.prop);break;case zu:addUndefinedType(t,n.file,r);break;case Vu:const i=e.program.getTypeChecker();const o=getInitializer(i,r.prop);if(!o)return;addInitializer(t,n.file,r.prop,o);break;default:S.fail(JSON.stringify(e.fixId))}}))});function getInfo17(e,t){const n=getTokenAtPosition(e,t);if(isIdentifier(n)&&isPropertyDeclaration(n.parent)){const e=getEffectiveTypeAnnotationNode(n.parent);if(e){return{type:e,prop:n.parent,isJs:isInJSFile(n.parent)}}}return void 0}function getActionForAddMissingDefiniteAssignmentAssertion(e,t){if(t.isJs)return void 0;const n=dm.ChangeTracker.with(e,(n=>addDefiniteAssignmentAssertion(n,e.sourceFile,t.prop)));return createCodeFixAction(Wu,n,[wt.Add_definite_assignment_assertion_to_property_0,t.prop.getText()],Uu,wt.Add_definite_assignment_assertions_to_all_uninitialized_properties)}function addDefiniteAssignmentAssertion(e,t,n){suppressLeadingAndTrailingTrivia(n);const r=zr.updatePropertyDeclaration(n,n.modifiers,n.name,zr.createToken(54),n.type,n.initializer);e.replaceNode(t,n,r)}function getActionForAddMissingUndefinedType(e,t){const n=dm.ChangeTracker.with(e,(n=>addUndefinedType(n,e.sourceFile,t)));return createCodeFixAction(Wu,n,[wt.Add_undefined_type_to_property_0,t.prop.name.getText()],zu,wt.Add_undefined_type_to_all_uninitialized_properties)}function addUndefinedType(e,t,n){const r=zr.createKeywordTypeNode(157);const i=isUnionTypeNode(n.type)?n.type.types.concat(r):[n.type,r];const o=zr.createUnionTypeNode(i);if(n.isJs){e.addJSDocTags(t,n.prop,[zr.createJSDocTypeTag(void 0,zr.createJSDocTypeExpression(o))])}else{e.replaceNode(t,n.type,o)}}function getActionForAddMissingInitializer(e,t){if(t.isJs)return void 0;const n=e.program.getTypeChecker();const r=getInitializer(n,t.prop);if(!r)return void 0;const i=dm.ChangeTracker.with(e,(n=>addInitializer(n,e.sourceFile,t.prop,r)));return createCodeFixAction(Wu,i,[wt.Add_initializer_to_property_0,t.prop.name.getText()],Vu,wt.Add_initializers_to_all_uninitialized_properties)}function addInitializer(e,t,n,r){suppressLeadingAndTrailingTrivia(n);const i=zr.updatePropertyDeclaration(n,n.modifiers,n.name,n.questionToken,n.type,r);e.replaceNode(t,n,i)}function getInitializer(e,t){return getDefaultValueFromType(e,e.getTypeFromTypeNode(t.type))}function getDefaultValueFromType(e,t){if(t.flags&512){return t===e.getFalseType()||t===e.getFalseType(true)?zr.createFalse():zr.createTrue()}else if(t.isStringLiteral()){return zr.createStringLiteral(t.value)}else if(t.isNumberLiteral()){return zr.createNumericLiteral(t.value)}else if(t.flags&2048){return zr.createBigIntLiteral(t.value)}else if(t.isUnion()){return firstDefined(t.types,(t=>getDefaultValueFromType(e,t)))}else if(t.isClass()){const e=getClassLikeDeclarationOfSymbol(t.symbol);if(!e||hasSyntacticModifier(e,64))return void 0;const n=getFirstConstructorWithBody(e);if(n&&n.parameters.length)return void 0;return zr.createNewExpression(zr.createIdentifier(t.symbol.name),void 0,void 0)}else if(e.isArrayLikeType(t)){return zr.createArrayLiteralExpression()}return void 0}var Hu="requireInTs";var Gu=[wt.require_call_may_be_converted_to_an_import.code];registerCodeFix({errorCodes:Gu,getCodeActions(e){const t=getInfo18(e.sourceFile,e.program,e.span.start,e.preferences);if(!t){return void 0}const n=dm.ChangeTracker.with(e,(n=>doChange35(n,e.sourceFile,t)));return[createCodeFixAction(Hu,n,wt.Convert_require_to_import,Hu,wt.Convert_all_require_to_import)]},fixIds:[Hu],getAllCodeActions:e=>codeFixAll(e,Gu,((t,n)=>{const r=getInfo18(n.file,e.program,n.start,e.preferences);if(r){doChange35(t,e.sourceFile,r)}}))});function doChange35(e,t,n){const{allowSyntheticDefaults:r,defaultImportName:i,namedImports:o,statement:a,moduleSpecifier:s}=n;e.replaceNode(t,a,i&&!r?zr.createImportEqualsDeclaration(void 0,false,i,zr.createExternalModuleReference(s)):zr.createImportDeclaration(void 0,zr.createImportClause(false,i,o),s,void 0))}function getInfo18(e,t,n,r){const{parent:i}=getTokenAtPosition(e,n);if(!isRequireCall(i,true)){S.failBadSyntaxKind(i)}const o=cast(i.parent,isVariableDeclaration);const a=getQuotePreference(e,r);const s=tryCast(o.name,isIdentifier);const c=isObjectBindingPattern(o.name)?tryCreateNamedImportsFromObjectBindingPattern(o.name):void 0;if(s||c){const e=first(i.arguments);return{allowSyntheticDefaults:$n(t.getCompilerOptions()),defaultImportName:s,namedImports:c,statement:cast(o.parent.parent,isVariableStatement),moduleSpecifier:isNoSubstitutionTemplateLiteral(e)?zr.createStringLiteral(e.text,a===0):e}}}function tryCreateNamedImportsFromObjectBindingPattern(e){const t=[];for(const n of e.elements){if(!isIdentifier(n.name)||n.initializer){return void 0}t.push(zr.createImportSpecifier(false,tryCast(n.propertyName,isIdentifier),n.name))}if(t.length){return zr.createNamedImports(t)}}var Ku="useDefaultImport";var $u=[wt.Import_may_be_converted_to_a_default_import.code];registerCodeFix({errorCodes:$u,getCodeActions(e){const{sourceFile:t,span:{start:n}}=e;const r=getInfo19(t,n);if(!r)return void 0;const i=dm.ChangeTracker.with(e,(n=>doChange36(n,t,r,e.preferences)));return[createCodeFixAction(Ku,i,wt.Convert_to_default_import,Ku,wt.Convert_all_to_default_imports)]},fixIds:[Ku],getAllCodeActions:e=>codeFixAll(e,$u,((t,n)=>{const r=getInfo19(n.file,n.start);if(r)doChange36(t,n.file,r,e.preferences)}))});function getInfo19(e,t){const n=getTokenAtPosition(e,t);if(!isIdentifier(n))return void 0;const{parent:r}=n;if(isImportEqualsDeclaration(r)&&isExternalModuleReference(r.moduleReference)){return{importNode:r,name:n,moduleSpecifier:r.moduleReference.expression}}else if(isNamespaceImport(r)&&isImportDeclaration(r.parent.parent)){const e=r.parent.parent;return{importNode:e,name:n,moduleSpecifier:e.moduleSpecifier}}}function doChange36(e,t,n,r){e.replaceNode(t,n.importNode,makeImport(n.name,void 0,n.moduleSpecifier,getQuotePreference(t,r)))}var Qu="useBigintLiteral";var Xu=[wt.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code];registerCodeFix({errorCodes:Xu,getCodeActions:function getCodeActionsToUseBigintLiteral(e){const t=dm.ChangeTracker.with(e,(t=>makeChange10(t,e.sourceFile,e.span)));if(t.length>0){return[createCodeFixAction(Qu,t,wt.Convert_to_a_bigint_numeric_literal,Qu,wt.Convert_all_to_bigint_numeric_literals)]}},fixIds:[Qu],getAllCodeActions:e=>codeFixAll(e,Xu,((e,t)=>makeChange10(e,t.file,t)))});function makeChange10(e,t,n){const r=tryCast(getTokenAtPosition(t,n.start),isNumericLiteral);if(!r){return}const i=r.getText(t)+"n";e.replaceNode(t,r,zr.createBigIntLiteral(i))}var Yu="fixAddModuleReferTypeMissingTypeof";var Zu=Yu;var ef=[wt.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];registerCodeFix({errorCodes:ef,getCodeActions:function getCodeActionsToAddMissingTypeof(e){const{sourceFile:t,span:n}=e;const r=getImportTypeNode(t,n.start);const i=dm.ChangeTracker.with(e,(e=>doChange37(e,t,r)));return[createCodeFixAction(Zu,i,wt.Add_missing_typeof,Zu,wt.Add_missing_typeof)]},fixIds:[Zu],getAllCodeActions:e=>codeFixAll(e,ef,((t,n)=>doChange37(t,e.sourceFile,getImportTypeNode(n.file,n.start))))});function getImportTypeNode(e,t){const n=getTokenAtPosition(e,t);S.assert(n.kind===102,"This token should be an ImportKeyword");S.assert(n.parent.kind===205,"Token parent should be an ImportType");return n.parent}function doChange37(e,t,n){const r=zr.updateImportTypeNode(n,n.argument,n.attributes,n.qualifier,n.typeArguments,true);e.replaceNode(t,n,r)}var tf="wrapJsxInFragment";var nf=[wt.JSX_expressions_must_have_one_parent_element.code];registerCodeFix({errorCodes:nf,getCodeActions:function getCodeActionsToWrapJsxInFragment(e){const{sourceFile:t,span:n}=e;const r=findNodeToFix(t,n.start);if(!r)return void 0;const i=dm.ChangeTracker.with(e,(e=>doChange38(e,t,r)));return[createCodeFixAction(tf,i,wt.Wrap_in_JSX_fragment,tf,wt.Wrap_all_unparented_JSX_in_JSX_fragment)]},fixIds:[tf],getAllCodeActions:e=>codeFixAll(e,nf,((t,n)=>{const r=findNodeToFix(e.sourceFile,n.start);if(!r)return void 0;doChange38(t,e.sourceFile,r)}))});function findNodeToFix(e,t){const n=getTokenAtPosition(e,t);const r=n.parent;let i=r.parent;if(!isBinaryExpression(i)){i=i.parent;if(!isBinaryExpression(i))return void 0}if(!nodeIsMissing(i.operatorToken))return void 0;return i}function doChange38(e,t,n){const r=flattenInvalidBinaryExpr(n);if(r)e.replaceNode(t,n,zr.createJsxFragment(zr.createJsxOpeningFragment(),r,zr.createJsxJsxClosingFragment()))}function flattenInvalidBinaryExpr(e){const t=[];let n=e;while(true){if(isBinaryExpression(n)&&nodeIsMissing(n.operatorToken)&&n.operatorToken.kind===28){t.push(n.left);if(isJsxChild(n.right)){t.push(n.right);return t}else if(isBinaryExpression(n.right)){n=n.right;continue}else return void 0}else return void 0}}var rf="wrapDecoratorInParentheses";var of=[wt.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator.code];registerCodeFix({errorCodes:of,getCodeActions:function getCodeActionsToWrapDecoratorExpressionInParentheses(e){const t=dm.ChangeTracker.with(e,(t=>makeChange11(t,e.sourceFile,e.span.start)));return[createCodeFixAction(rf,t,wt.Wrap_in_parentheses,rf,wt.Wrap_all_invalid_decorator_expressions_in_parentheses)]},fixIds:[rf],getAllCodeActions:e=>codeFixAll(e,of,((e,t)=>makeChange11(e,t.file,t.start)))});function makeChange11(e,t,n){const r=getTokenAtPosition(t,n);const i=findAncestor(r,isDecorator);S.assert(!!i,"Expected position to be owned by a decorator.");const o=zr.createParenthesizedExpression(i.expression);e.replaceNode(t,i.expression,o)}var af="fixConvertToMappedObjectType";var sf=[wt.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];registerCodeFix({errorCodes:sf,getCodeActions:function getCodeActionsToConvertToMappedTypeObject(e){const{sourceFile:t,span:n}=e;const r=getInfo20(t,n.start);if(!r)return void 0;const i=dm.ChangeTracker.with(e,(e=>doChange39(e,t,r)));const o=idText(r.container.name);return[createCodeFixAction(af,i,[wt.Convert_0_to_mapped_object_type,o],af,[wt.Convert_0_to_mapped_object_type,o])]},fixIds:[af],getAllCodeActions:e=>codeFixAll(e,sf,((e,t)=>{const n=getInfo20(t.file,t.start);if(n)doChange39(e,t.file,n)}))});function getInfo20(e,t){const n=getTokenAtPosition(e,t);const r=tryCast(n.parent.parent,isIndexSignatureDeclaration);if(!r)return void 0;const i=isInterfaceDeclaration(r.parent)?r.parent:tryCast(r.parent.parent,isTypeAliasDeclaration);if(!i)return void 0;return{indexSignature:r,container:i}}function createTypeAliasFromInterface(e,t){return zr.createTypeAliasDeclaration(e.modifiers,e.name,e.typeParameters,t)}function doChange39(e,t,{indexSignature:n,container:r}){const i=isInterfaceDeclaration(r)?r.members:r.type.members;const o=i.filter((e=>!isIndexSignatureDeclaration(e)));const a=first(n.parameters);const s=zr.createTypeParameterDeclaration(void 0,cast(a.name,isIdentifier),a.type);const c=zr.createMappedTypeNode(hasEffectiveReadonlyModifier(n)?zr.createModifier(148):void 0,s,void 0,n.questionToken,n.type,void 0);const l=zr.createIntersectionTypeNode([...getAllSuperTypeNodes(r),c,...o.length?[zr.createTypeLiteralNode(o)]:d]);e.replaceNode(t,r,createTypeAliasFromInterface(r,l))}var cf="removeAccidentalCallParentheses";var lf=[wt.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code];registerCodeFix({errorCodes:lf,getCodeActions(e){const t=findAncestor(getTokenAtPosition(e.sourceFile,e.span.start),isCallExpression);if(!t){return void 0}const n=dm.ChangeTracker.with(e,(n=>{n.deleteRange(e.sourceFile,{pos:t.expression.end,end:t.end})}));return[createCodeFixActionWithoutFixAll(cf,n,wt.Remove_parentheses)]},fixIds:[cf]});var df="removeUnnecessaryAwait";var pf=[wt.await_has_no_effect_on_the_type_of_this_expression.code];registerCodeFix({errorCodes:pf,getCodeActions:function getCodeActionsToRemoveUnnecessaryAwait(e){const t=dm.ChangeTracker.with(e,(t=>makeChange12(t,e.sourceFile,e.span)));if(t.length>0){return[createCodeFixAction(df,t,wt.Remove_unnecessary_await,df,wt.Remove_all_unnecessary_uses_of_await)]}},fixIds:[df],getAllCodeActions:e=>codeFixAll(e,pf,((e,t)=>makeChange12(e,t.file,t)))});function makeChange12(e,t,n){const r=tryCast(getTokenAtPosition(t,n.start),(e=>e.kind===135));const i=r&&tryCast(r.parent,isAwaitExpression);if(!i){return}let o=i;const a=isParenthesizedExpression(i.parent);if(a){const e=getLeftmostExpression(i.expression,false);if(isIdentifier(e)){const e=findPrecedingToken(i.parent.pos,t);if(e&&e.kind!==105){o=i.parent}}}e.replaceNode(t,o,i.expression)}var uf=[wt.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];var ff="splitTypeOnlyImport";registerCodeFix({errorCodes:uf,fixIds:[ff],getCodeActions:function getCodeActionsToSplitTypeOnlyImport(e){const t=dm.ChangeTracker.with(e,(t=>splitTypeOnlyImport(t,getImportDeclaration2(e.sourceFile,e.span),e)));if(t.length){return[createCodeFixAction(ff,t,wt.Split_into_two_separate_import_declarations,ff,wt.Split_all_invalid_type_only_imports)]}},getAllCodeActions:e=>codeFixAll(e,uf,((t,n)=>{splitTypeOnlyImport(t,getImportDeclaration2(e.sourceFile,n),e)}))});function getImportDeclaration2(e,t){return findAncestor(getTokenAtPosition(e,t.start),isImportDeclaration)}function splitTypeOnlyImport(e,t,n){if(!t){return}const r=S.checkDefined(t.importClause);e.replaceNode(n.sourceFile,t,zr.updateImportDeclaration(t,t.modifiers,zr.updateImportClause(r,r.isTypeOnly,r.name,void 0),t.moduleSpecifier,t.attributes));e.insertNodeAfter(n.sourceFile,t,zr.createImportDeclaration(void 0,zr.updateImportClause(r,r.isTypeOnly,void 0,r.namedBindings),t.moduleSpecifier,t.attributes))}var mf="fixConvertConstToLet";var _f=[wt.Cannot_assign_to_0_because_it_is_a_constant.code];registerCodeFix({errorCodes:_f,getCodeActions:function getCodeActionsToConvertConstToLet(e){const{sourceFile:t,span:n,program:r}=e;const i=getInfo21(t,n.start,r);if(i===void 0)return;const o=dm.ChangeTracker.with(e,(e=>doChange40(e,t,i.token)));return[createCodeFixActionMaybeFixAll(mf,o,wt.Convert_const_to_let,mf,wt.Convert_all_const_to_let)]},getAllCodeActions:e=>{const{program:t}=e;const n=new Set;return createCombinedCodeActions(dm.ChangeTracker.with(e,(r=>{eachDiagnostic(e,_f,(e=>{const i=getInfo21(e.file,e.start,t);if(i){if(addToSeen(n,getSymbolId(i.symbol))){return doChange40(r,e.file,i.token)}}return void 0}))})))},fixIds:[mf]});function getInfo21(e,t,n){var r;const i=n.getTypeChecker();const o=i.getSymbolAtLocation(getTokenAtPosition(e,t));if(o===void 0)return;const a=tryCast((r=o==null?void 0:o.valueDeclaration)==null?void 0:r.parent,isVariableDeclarationList);if(a===void 0)return;const s=findChildOfKind(a,87,e);if(s===void 0)return;return{symbol:o,token:s}}function doChange40(e,t,n){e.replaceNode(t,n,zr.createToken(121))}var gf="fixExpectedComma";var yf=wt._0_expected.code;var hf=[yf];registerCodeFix({errorCodes:hf,getCodeActions(e){const{sourceFile:t}=e;const n=getInfo22(t,e.span.start,e.errorCode);if(!n)return void 0;const r=dm.ChangeTracker.with(e,(e=>doChange41(e,t,n)));return[createCodeFixAction(gf,r,[wt.Change_0_to_1,";",","],gf,[wt.Change_0_to_1,";",","])]},fixIds:[gf],getAllCodeActions:e=>codeFixAll(e,hf,((t,n)=>{const r=getInfo22(n.file,n.start,n.code);if(r)doChange41(t,e.sourceFile,r)}))});function getInfo22(e,t,n){const r=getTokenAtPosition(e,t);return r.kind===27&&r.parent&&(isObjectLiteralExpression(r.parent)||isArrayLiteralExpression(r.parent))?{node:r}:void 0}function doChange41(e,t,{node:n}){const r=zr.createToken(28);e.replaceNode(t,n,r)}var Tf="addVoidToPromise";var Sf="addVoidToPromise";var vf=[wt.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,wt.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code];registerCodeFix({errorCodes:vf,fixIds:[Sf],getCodeActions(e){const t=dm.ChangeTracker.with(e,(t=>makeChange13(t,e.sourceFile,e.span,e.program)));if(t.length>0){return[createCodeFixAction(Tf,t,wt.Add_void_to_Promise_resolved_without_a_value,Sf,wt.Add_void_to_all_Promises_resolved_without_a_value)]}},getAllCodeActions(e){return codeFixAll(e,vf,((t,n)=>makeChange13(t,n.file,n,e.program,new Set)))}});function makeChange13(e,t,n,r,i){const o=getTokenAtPosition(t,n.start);if(!isIdentifier(o)||!isCallExpression(o.parent)||o.parent.expression!==o||o.parent.arguments.length!==0)return;const a=r.getTypeChecker();const s=a.getSymbolAtLocation(o);const c=s==null?void 0:s.valueDeclaration;if(!c||!isParameter(c)||!isNewExpression(c.parent.parent))return;if(i==null?void 0:i.has(c))return;i==null?void 0:i.add(c);const l=getEffectiveTypeArguments(c.parent.parent);if(some(l)){const n=l[0];const r=!isUnionTypeNode(n)&&!isParenthesizedTypeNode(n)&&isParenthesizedTypeNode(zr.createUnionTypeNode([n,zr.createKeywordTypeNode(116)]).types[0]);if(r){e.insertText(t,n.pos,"(")}e.insertText(t,n.end,r?") | void":" | void")}else{const n=a.getResolvedSignature(o.parent);const r=n==null?void 0:n.parameters[0];const i=r&&a.getTypeOfSymbolAtLocation(r,c.parent.parent);if(isInJSFile(c)){if(!i||i.flags&3){e.insertText(t,c.parent.parent.end,`)`);e.insertText(t,skipTrivia(t.text,c.parent.parent.pos),`/** @type {Promise} */(`)}}else{if(!i||i.flags&2){e.insertText(t,c.parent.parent.expression.end,"")}}}}function getEffectiveTypeArguments(e){var t;if(isInJSFile(e)){if(isParenthesizedExpression(e.parent)){const n=(t=getJSDocTypeTag(e.parent))==null?void 0:t.typeExpression.type;if(n&&isTypeReferenceNode(n)&&isIdentifier(n.typeName)&&idText(n.typeName)==="Promise"){return n.typeArguments}}}else{return e.typeArguments}}var xf={};__export(xf,{CompletionKind:()=>Df,CompletionSource:()=>Ff,SortText:()=>Ef,StringCompletions:()=>Of,SymbolOriginInfoKind:()=>Pf,createCompletionDetails:()=>createCompletionDetails,createCompletionDetailsForSymbol:()=>createCompletionDetailsForSymbol,getCompletionEntriesFromSymbols:()=>getCompletionEntriesFromSymbols,getCompletionEntryDetails:()=>getCompletionEntryDetails,getCompletionEntrySymbol:()=>getCompletionEntrySymbol,getCompletionsAtPosition:()=>getCompletionsAtPosition,getDefaultCommitCharacters:()=>getDefaultCommitCharacters,getPropertiesForObjectExpression:()=>getPropertiesForObjectExpression,moduleSpecifierResolutionCacheAttemptLimit:()=>Cf,moduleSpecifierResolutionLimit:()=>bf});var bf=100;var Cf=1e3;var Ef={LocalDeclarationPriority:"10",LocationPriority:"11",OptionalMember:"12",MemberDeclaredBySpreadAssignment:"13",SuggestedClassMembers:"14",GlobalsOrKeywords:"15",AutoImportSuggestions:"16",ClassMemberSnippets:"17",JavascriptIdentifiers:"18",Deprecated(e){return"z"+e},ObjectLiteralProperty(e,t){return`${e}\0${t}\0`},SortBelow(e){return e+"1"}};var Nf=[".",",",";"];var kf=[".",";"];var Ff=(e=>{e["ThisProperty"]="ThisProperty/";e["ClassMemberSnippet"]="ClassMemberSnippet/";e["TypeOnlyAlias"]="TypeOnlyAlias/";e["ObjectLiteralMethodSnippet"]="ObjectLiteralMethodSnippet/";e["SwitchCases"]="SwitchCases/";e["ObjectLiteralMemberWithComma"]="ObjectLiteralMemberWithComma/";return e})(Ff||{});var Pf=(e=>{e[e["ThisType"]=1]="ThisType";e[e["SymbolMember"]=2]="SymbolMember";e[e["Export"]=4]="Export";e[e["Promise"]=8]="Promise";e[e["Nullable"]=16]="Nullable";e[e["ResolvedExport"]=32]="ResolvedExport";e[e["TypeOnlyAlias"]=64]="TypeOnlyAlias";e[e["ObjectLiteralMethod"]=128]="ObjectLiteralMethod";e[e["Ignore"]=256]="Ignore";e[e["ComputedPropertyName"]=512]="ComputedPropertyName";e[e["SymbolMemberNoExport"]=2]="SymbolMemberNoExport";e[e["SymbolMemberExport"]=6]="SymbolMemberExport";return e})(Pf||{});function originIsThisType(e){return!!(e.kind&1)}function originIsSymbolMember(e){return!!(e.kind&2)}function originIsExport(e){return!!(e&&e.kind&4)}function originIsResolvedExport(e){return!!(e&&e.kind===32)}function originIncludesSymbolName(e){return originIsExport(e)||originIsResolvedExport(e)||originIsComputedPropertyName(e)}function originIsPackageJsonImport(e){return(originIsExport(e)||originIsResolvedExport(e))&&!!e.isFromPackageJson}function originIsPromise(e){return!!(e.kind&8)}function originIsNullableMember(e){return!!(e.kind&16)}function originIsTypeOnlyAlias(e){return!!(e&&e.kind&64)}function originIsObjectLiteralMethod(e){return!!(e&&e.kind&128)}function originIsIgnore(e){return!!(e&&e.kind&256)}function originIsComputedPropertyName(e){return!!(e&&e.kind&512)}function resolvingModuleSpecifiers(e,t,n,r,i,o,a,s,c){var l,d,p,u;const f=R();const m=a||Qn(r.getCompilerOptions())||((l=o.autoImportSpecifierExcludeRegexes)==null?void 0:l.length);let _=false;let g=0;let y=0;let h=0;let T=0;const S=c({tryResolve:tryResolve,skippedAny:()=>_,resolvedAny:()=>y>0,resolvedBeyondLimit:()=>y>bf});const v=T?` (${(h/T*100).toFixed(1)}% hit rate)`:"";(d=t.log)==null?void 0:d.call(t,`${e}: resolved ${y} module specifiers, plus ${g} ambient and ${h} from cache${v}`);(p=t.log)==null?void 0:p.call(t,`${e}: response is ${_?"incomplete":"complete"}`);(u=t.log)==null?void 0:u.call(t,`${e}: ${R()-f}`);return S;function tryResolve(e,t){if(t){const t=n.getModuleSpecifierForBestExportInfo(e,i,s);if(t){g++}return t||"failed"}const r=m||o.allowIncompleteCompletions&&y{const n=mapDefined(c.entries,(n=>{var o;if(!n.hasAction||!n.source||!n.data||completionEntryDataIsResolved(n.data)){return n}if(!charactersFuzzyMatchInString(n.name,d)){return void 0}const{origin:a}=S.checkDefined(getAutoImportSymbolFromCompletionEntryData(n.name,n.data,r,i));const s=p.get(t.path,n.data.exportMapKey);const c=s&&e.tryResolve(s,!isExternalModuleNameRelative(stripQuotes(a.moduleSymbol.name)));if(c==="skipped")return n;if(!c||c==="failed"){(o=i.log)==null?void 0:o.call(i,`Unexpected failure resolving auto import for '${n.name}' from '${n.source}'`);return void 0}const l={...a,kind:32,moduleSpecifier:c.moduleSpecifier};n.data=originToCompletionEntryData(l);n.source=getSourceFromOrigin(l);n.sourceDisplay=[textPart(l.moduleSpecifier)];return n}));if(!e.skippedAny()){c.isIncomplete=void 0}return n}));c.entries=u;c.flags=(c.flags||0)|4;c.optionalReplacementSpan=getOptionalReplacementSpan(l);return c}function jsdocCompletionInfo(e){return{isGlobalCompletion:false,isMemberCompletion:false,isNewIdentifierLocation:false,entries:e,defaultCommitCharacters:getDefaultCommitCharacters(false)}}function getJSDocParameterCompletions(e,t,n,r,i,o){const a=getTokenAtPosition(e,t);if(!isJSDocTag(a)&&!isJSDoc(a)){return[]}const s=isJSDoc(a)?a:a.parent;if(!isJSDoc(s)){return[]}const c=s.parent;if(!isFunctionLike(c)){return[]}const l=isSourceFileJS(e);const d=i.includeCompletionsWithSnippetText||void 0;const p=countWhere(s.tags,(e=>isJSDocParameterTag(e)&&e.getEnd()<=t));return mapDefined(c.parameters,(e=>{if(getJSDocParameterTags(e).length){return void 0}if(isIdentifier(e.name)){const t={tabstop:1};const a=e.name.text;let s=getJSDocParamAnnotation(a,e.initializer,e.dotDotDotToken,l,false,false,n,r,i);let c=d?getJSDocParamAnnotation(a,e.initializer,e.dotDotDotToken,l,false,true,n,r,i,t):void 0;if(o){s=s.slice(1);if(c)c=c.slice(1)}return{name:s,kind:"parameter",sortText:Ef.LocationPriority,insertText:d?c:void 0,isSnippet:d}}else if(e.parent.parameters.indexOf(e)===p){const t=`param${p}`;const a=generateJSDocParamTagsForDestructuring(t,e.name,e.initializer,e.dotDotDotToken,l,false,n,r,i);const s=d?generateJSDocParamTagsForDestructuring(t,e.name,e.initializer,e.dotDotDotToken,l,true,n,r,i):void 0;let c=a.join(getNewLineCharacter(r)+"* ");let u=s==null?void 0:s.join(getNewLineCharacter(r)+"* ");if(o){c=c.slice(1);if(u)u=u.slice(1)}return{name:c,kind:"parameter",sortText:Ef.LocationPriority,insertText:d?u:void 0,isSnippet:d}}}))}function generateJSDocParamTagsForDestructuring(e,t,n,r,i,o,a,s,c){if(!i){return[getJSDocParamAnnotation(e,n,r,i,false,o,a,s,c,{tabstop:1})]}return patternWorker(e,t,n,r,{tabstop:1});function patternWorker(e,t,n,r,l){if(isObjectBindingPattern(t)&&!r){const d=l.tabstop;const p={tabstop:d};const u=getJSDocParamAnnotation(e,n,r,i,true,o,a,s,c,p);let f=[];for(const n of t.elements){const t=elementWorker(e,n,p);if(!t){f=void 0;break}else{f.push(...t)}}if(f){l.tabstop=p.tabstop;return[u,...f]}}return[getJSDocParamAnnotation(e,n,r,i,false,o,a,s,c,l)]}function elementWorker(e,t,n){if(!t.propertyName&&isIdentifier(t.name)||isIdentifier(t.name)){const r=t.propertyName?tryGetTextOfPropertyName(t.propertyName):t.name.text;if(!r){return void 0}const l=`${e}.${r}`;return[getJSDocParamAnnotation(l,t.initializer,t.dotDotDotToken,i,false,o,a,s,c,n)]}else if(t.propertyName){const r=tryGetTextOfPropertyName(t.propertyName);return r&&patternWorker(`${e}.${r}`,t.name,t.initializer,t.dotDotDotToken,n)}return void 0}}function getJSDocParamAnnotation(e,t,n,r,i,o,a,s,c,l){if(o){S.assertIsDefined(l)}if(t){e=getJSDocParamNameWithInitializer(e,t)}if(o){e=escapeSnippetText(e)}if(r){let r="*";if(i){S.assert(!n,`Cannot annotate a rest parameter with type 'Object'.`);r="Object"}else{if(t){const e=a.getTypeAtLocation(t.parent);if(!(e.flags&(1|16384))){const n=t.getSourceFile();const i=getQuotePreference(n,c);const l=i===0?268435456:0;const d=a.typeToTypeNode(e,findAncestor(t,isFunctionLike),l);if(d){const e=o?createSnippetPrinter({removeComments:true,module:s.module,moduleResolution:s.moduleResolution,target:s.target}):createPrinter({removeComments:true,module:s.module,moduleResolution:s.moduleResolution,target:s.target});setEmitFlags(d,1);r=e.printNode(4,d,n)}}}if(o&&r==="*"){r=`\${${l.tabstop++}:${r}}`}}const d=!i&&n?"...":"";const p=o?`\${${l.tabstop++}}`:"";return`@param {${d}${r}} ${e} ${p}`}else{const t=o?`\${${l.tabstop++}}`:"";return`@param ${e} ${t}`}}function getJSDocParamNameWithInitializer(e,t){const n=t.getText().trim();if(n.includes("\n")||n.length>80){return`[${e}]`}return`[${e}=${n}]`}function keywordToCompletionEntry(e){return{name:tokenToString(e),kind:"keyword",kindModifiers:"",sortText:Ef.GlobalsOrKeywords}}function specificKeywordCompletionInfo(e,t){return{isGlobalCompletion:false,isMemberCompletion:false,isNewIdentifierLocation:t,entries:e.slice(),defaultCommitCharacters:getDefaultCommitCharacters(t)}}function keywordCompletionData(e,t,n){return{kind:4,keywordCompletions:getKeywordCompletions(e,t),isNewIdentifierLocation:n}}function keywordFiltersFromSyntaxKind(e){switch(e){case 156:return 8;default:S.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters")}}function getOptionalReplacementSpan(e){return(e==null?void 0:e.kind)===80?createTextSpanFromNode(e):void 0}function completionInfoFromData(e,t,n,r,i,o,a,s,c,l){const{symbols:d,contextToken:p,completionKind:u,isInSnippetScope:f,isNewIdentifierLocation:m,location:_,propertyAccessToConvert:g,keywordFilters:y,symbolToOriginInfoMap:h,recommendedCompletion:T,isJsxInitializer:S,isTypeOnlyLocation:v,isJsxIdentifierExpected:x,isRightOfOpenTag:b,isRightOfDotOrQuestionDot:C,importStatementCompletion:E,insideJsDocTagTypeExpression:N,symbolToSortTextMap:k,hasUnresolvedAutoImports:F,defaultCommitCharacters:P}=o;let D=o.literals;const I=n.getTypeChecker();if(getLanguageVariant(e.scriptKind)===1){const t=getJsxClosingTagCompletion(_,e);if(t){return t}}const A=findAncestor(p,isCaseClause);if(A&&(isCaseKeyword(p)||isNodeDescendantOf(p,A.expression))){const e=newCaseClauseTracker(I,A.parent.clauses);D=D.filter((t=>!e.hasValue(t)));d.forEach(((t,n)=>{if(t.valueDeclaration&&isEnumMember(t.valueDeclaration)){const r=I.getConstantValue(t.valueDeclaration);if(r!==void 0&&e.hasValue(r)){h[n]={kind:256}}}}))}const O=createSortedArray();const w=isCheckedFile(e,r);if(w&&!m&&(!d||d.length===0)&&y===0){return void 0}const L=getCompletionEntriesFromSymbols(d,O,void 0,p,_,c,e,t,n,zn(r),i,u,a,r,s,v,g,x,S,E,T,h,k,x,b,l);if(y!==0){for(const t of getKeywordCompletions(y,!N&&isSourceFileJS(e))){if(v&&isTypeKeyword(stringToToken(t.name))||!v&&isContextualKeywordInAutoImportableExpressionSpace(t.name)||!L.has(t.name)){L.add(t.name);insertSorted(O,t,compareCompletionEntries,void 0,true)}}}for(const e of getContextualKeywords(p,c)){if(!L.has(e.name)){L.add(e.name);insertSorted(O,e,compareCompletionEntries,void 0,true)}}for(const t of D){const n=createCompletionEntryForLiteral(e,a,t);L.add(n.name);insertSorted(O,n,compareCompletionEntries,void 0,true)}if(!w){getJSCompletionEntries(e,_.pos,L,zn(r),O)}let M;if(a.includeCompletionsWithInsertText&&p&&!b&&!C&&(M=findAncestor(p,isCaseBlock))){const i=getExhaustiveCaseSnippets(M,e,a,r,t,n,s);if(i){O.push(i.entry)}}return{flags:o.flags,isGlobalCompletion:f,isIncomplete:a.allowIncompleteCompletions&&F?true:void 0,isMemberCompletion:isMemberCompletionKind(u),isNewIdentifierLocation:m,optionalReplacementSpan:getOptionalReplacementSpan(_),entries:O,defaultCommitCharacters:P??getDefaultCommitCharacters(m)}}function isCheckedFile(e,t){return!isSourceFileJS(e)||!!isCheckJsEnabledForFile(e,t)}function getExhaustiveCaseSnippets(e,t,n,r,i,o,a){const s=e.clauses;const c=o.getTypeChecker();const l=c.getTypeAtLocation(e.parent.expression);if(l&&l.isUnion()&&every(l.types,(e=>e.isLiteral()))){const d=newCaseClauseTracker(c,s);const p=zn(r);const u=getQuotePreference(t,n);const f=id.createImportAdder(t,o,n,i);const m=[];for(const t of l.types){if(t.flags&1024){S.assert(t.symbol,"An enum member type should have a symbol");S.assert(t.symbol.parent,"An enum member type should have a parent symbol (the enum symbol)");const n=t.symbol.valueDeclaration&&c.getConstantValue(t.symbol.valueDeclaration);if(n!==void 0){if(d.hasValue(n)){continue}d.addValue(n)}const r=id.typeToAutoImportableTypeNode(c,f,t,e,p);if(!r){return void 0}const i=typeNodeToExpression(r,p,u);if(!i){return void 0}m.push(i)}else if(!d.hasValue(t.value)){switch(typeof t.value){case"object":m.push(t.value.negative?zr.createPrefixUnaryExpression(41,zr.createBigIntLiteral({negative:false,base10Value:t.value.base10Value})):zr.createBigIntLiteral(t.value));break;case"number":m.push(t.value<0?zr.createPrefixUnaryExpression(41,zr.createNumericLiteral(-t.value)):zr.createNumericLiteral(t.value));break;case"string":m.push(zr.createStringLiteral(t.value,u===0));break}}}if(m.length===0){return void 0}const _=map(m,(e=>zr.createCaseClause(e,[])));const g=getNewLineOrDefaultFromHost(i,a==null?void 0:a.options);const y=createSnippetPrinter({removeComments:true,module:r.module,moduleResolution:r.moduleResolution,target:r.target,newLine:getNewLineKind(g)});const h=a?e=>y.printAndFormatNode(4,e,t,a):e=>y.printNode(4,e,t);const T=map(_,((e,t)=>{if(n.includeCompletionsWithSnippetText){return`${h(e)}$${t+1}`}return`${h(e)}`})).join(g);const v=y.printNode(4,_[0],t);return{entry:{name:`${v} ...`,kind:"",sortText:Ef.GlobalsOrKeywords,insertText:T,hasAction:f.hasFixes()||void 0,source:"SwitchCases/",isSnippet:n.includeCompletionsWithSnippetText?true:void 0},importAdder:f}}return void 0}function typeNodeToExpression(e,t,n){switch(e.kind){case 183:const r=e.typeName;return entityNameToExpression(r,t,n);case 199:const i=typeNodeToExpression(e.objectType,t,n);const o=typeNodeToExpression(e.indexType,t,n);return i&&o&&zr.createElementAccessExpression(i,o);case 201:const a=e.literal;switch(a.kind){case 11:return zr.createStringLiteral(a.text,n===0);case 9:return zr.createNumericLiteral(a.text,a.numericLiteralFlags)}return void 0;case 196:const s=typeNodeToExpression(e.type,t,n);return s&&(isIdentifier(s)?s:zr.createParenthesizedExpression(s));case 186:return entityNameToExpression(e.exprName,t,n);case 205:S.fail(`We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.`)}return void 0}function entityNameToExpression(e,t,n){if(isIdentifier(e)){return e}const r=unescapeLeadingUnderscores(e.right.escapedText);if(canUsePropertyAccess(r,t)){return zr.createPropertyAccessExpression(entityNameToExpression(e.left,t,n),r)}else{return zr.createElementAccessExpression(entityNameToExpression(e.left,t,n),zr.createStringLiteral(r,n===0))}}function isMemberCompletionKind(e){switch(e){case 0:case 3:case 2:return true;default:return false}}function getJsxClosingTagCompletion(e,t){const n=findAncestor(e,(e=>{switch(e.kind){case 287:return true;case 44:case 32:case 80:case 211:return false;default:return"quit"}}));if(n){const e=!!findChildOfKind(n,32,t);const r=n.parent.openingElement.tagName;const i=r.getText(t);const o=i+(e?"":">");const a=createTextSpanFromNode(n.tagName);const s={name:o,kind:"class",kindModifiers:void 0,sortText:Ef.LocationPriority};return{isGlobalCompletion:false,isMemberCompletion:true,isNewIdentifierLocation:false,optionalReplacementSpan:a,entries:[s],defaultCommitCharacters:getDefaultCommitCharacters(false)}}return}function getJSCompletionEntries(e,t,n,r,i){getNameTable(e).forEach(((e,o)=>{if(e===t){return}const a=unescapeLeadingUnderscores(o);if(!n.has(a)&&isIdentifierText(a,r)){n.add(a);insertSorted(i,{name:a,kind:"warning",kindModifiers:"",sortText:Ef.JavascriptIdentifiers,isFromUncheckedFile:true,commitCharacters:[]},compareCompletionEntries)}}))}function completionNameForLiteral(e,t,n){return typeof n==="object"?pseudoBigIntToString(n)+"n":isString(n)?quote(e,t,n):JSON.stringify(n)}function createCompletionEntryForLiteral(e,t,n){return{name:completionNameForLiteral(e,t,n),kind:"string",kindModifiers:"",sortText:Ef.LocationPriority,commitCharacters:[]}}function createCompletionEntry(e,t,n,r,i,o,a,s,c,l,d,p,u,f,m,_,g,y,h,T,S,v,x,b){var C,E;let N;let k;let F=getReplacementSpanForContextToken(n,o);let P;let D;let I=getSourceFromOrigin(p);let A;let O;let w;const L=c.getTypeChecker();const M=p&&originIsNullableMember(p);const R=p&&originIsSymbolMember(p)||d;if(p&&originIsThisType(p)){N=d?`this${M?"?.":""}[${quotePropertyName(a,h,l)}]`:`this${M?"?.":"."}${l}`}else if((R||M)&&f){N=R?d?`[${quotePropertyName(a,h,l)}]`:`[${l}]`:l;if(M||f.questionDotToken){N=`?.${N}`}const e=findChildOfKind(f,25,a)||findChildOfKind(f,29,a);if(!e){return void 0}const t=startsWith(l,f.name.text)?f.name.end:e.end;F=createTextSpanFromBounds(e.getStart(a),t)}if(m){if(N===void 0)N=l;N=`{${N}}`;if(typeof m!=="boolean"){F=createTextSpanFromNode(m,a)}}if(p&&originIsPromise(p)&&f){if(N===void 0)N=l;const e=findPrecedingToken(f.pos,a);let t="";if(e&&positionIsASICandidate(e.end,e.parent,a)){t=";"}t+=`(await ${f.expression.getText()})`;N=d?`${t}${N}`:`${t}${M?"?.":"."}${N}`;const n=tryCast(f.parent,isAwaitExpression);const r=n?f.parent:f.expression;F=createTextSpanFromBounds(r.getStart(a),f.end)}if(originIsResolvedExport(p)){A=[textPart(p.moduleSpecifier)];if(_){({insertText:N,replacementSpan:F}=getInsertTextAndReplacementSpanForImportCompletion(l,_,p,g,a,c,h));D=h.includeCompletionsWithSnippetText?true:void 0}}if((p==null?void 0:p.kind)===64){O=true}if(T===0&&r&&((C=findPrecedingToken(r.pos,a,r))==null?void 0:C.kind)!==28){if(isMethodDeclaration(r.parent.parent)||isGetAccessorDeclaration(r.parent.parent)||isSetAccessorDeclaration(r.parent.parent)||isSpreadAssignment(r.parent)||((E=findAncestor(r.parent,isPropertyAssignment))==null?void 0:E.getLastToken(a))===r||isShorthandPropertyAssignment(r.parent)&&getLineAndCharacterOfPosition(a,r.getEnd()).line!==getLineAndCharacterOfPosition(a,o).line){I="ObjectLiteralMemberWithComma/";O=true}}if(h.includeCompletionsWithClassMemberSnippets&&h.includeCompletionsWithInsertText&&T===3&&isClassLikeMemberCompletion(e,i,a)){let t;const n=getEntryForMemberCompletion(s,c,y,h,l,e,i,o,r,S);if(n){({insertText:N,filterText:k,isSnippet:D,importAdder:t}=n);if((t==null?void 0:t.hasFixes())||n.eraseRange){O=true;I="ClassMemberSnippet/"}}else{return void 0}}if(p&&originIsObjectLiteralMethod(p)){({insertText:N,isSnippet:D,labelDetails:w}=p);if(!h.useLabelDetailsInCompletionEntries){l=l+w.detail;w=void 0}I="ObjectLiteralMethodSnippet/";t=Ef.SortBelow(t)}if(v&&!x&&h.includeCompletionsWithSnippetText&&h.jsxAttributeCompletionStyle&&h.jsxAttributeCompletionStyle!=="none"&&!(isJsxAttribute(i.parent)&&i.parent.initializer)){let t=h.jsxAttributeCompletionStyle==="braces";const n=L.getTypeOfSymbolAtLocation(e,i);if(h.jsxAttributeCompletionStyle==="auto"&&!(n.flags&528)&&!(n.flags&1048576&&find(n.types,(e=>!!(e.flags&528))))){if(n.flags&402653316||n.flags&1048576&&every(n.types,(e=>!!(e.flags&(402653316|32768)||isStringAndEmptyAnonymousObjectIntersection(e))))){N=`${escapeSnippetText(l)}=${quote(a,h,"$1")}`;D=true}else{t=true}}if(t){N=`${escapeSnippetText(l)}={$1}`;D=true}}if(N!==void 0&&!h.includeCompletionsWithInsertText){return void 0}if(originIsExport(p)||originIsResolvedExport(p)){P=originToCompletionEntryData(p);O=!_}const B=findAncestor(i,isNamedImportsOrExports);if(B){const e=zn(s.getCompilationSettings());if(!isIdentifierText(l,e)){N=quotePropertyName(a,h,l);if(B.kind===275){Gs.setText(a.text);Gs.resetTokenState(o);if(!(Gs.scan()===130&&Gs.scan()===80)){N+=" as "+generateIdentifierForArbitraryString(l,e)}}}else if(B.kind===275){const e=stringToToken(l);if(e&&(e===135||isNonContextualKeyword(e))){N=`${l} as ${l}_`}}}const j=cm.getSymbolKind(L,e,i);const J=j==="warning"||j==="string"?[]:void 0;return{name:l,kind:j,kindModifiers:cm.getSymbolModifiers(L,e),sortText:t,source:I,hasAction:O?true:void 0,isRecommended:isRecommendedCompletionMatch(e,u,L)||void 0,insertText:N,filterText:k,replacementSpan:F,sourceDisplay:A,labelDetails:w,isSnippet:D,isPackageJsonImport:originIsPackageJsonImport(p)||void 0,isImportStatementCompletion:!!_||void 0,data:P,commitCharacters:J,...b?{symbol:e}:void 0}}function generateIdentifierForArbitraryString(e,t){let n=false;let r="";let i;for(let o=0;o=65536?2:1){i=e.codePointAt(o);if(i!==void 0&&(o===0?isIdentifierStart(i,t):isIdentifierPart(i,t))){if(n)r+="_";r+=String.fromCodePoint(i);n=false}else{n=true}}if(n)r+="_";return r||"_"}function isClassLikeMemberCompletion(e,t,n){if(isInJSFile(t)){return false}const r=106500&900095;return!!(e.flags&r)&&(isClassLike(t)||t.parent&&t.parent.parent&&isClassElement(t.parent)&&t===t.parent.name&&t.parent.getLastToken(n)===t.parent.name&&isClassLike(t.parent.parent)||t.parent&&isSyntaxList(t)&&isClassLike(t.parent))}function getEntryForMemberCompletion(e,t,n,r,i,o,a,s,c,l){const d=findAncestor(a,isClassLike);if(!d){return void 0}let p;let u=i;const f=i;const m=t.getTypeChecker();const _=a.getSourceFile();const g=createSnippetPrinter({removeComments:true,module:n.module,moduleResolution:n.moduleResolution,target:n.target,omitTrailingSemicolon:false,newLine:getNewLineKind(getNewLineOrDefaultFromHost(e,l==null?void 0:l.options))});const y=id.createImportAdder(_,t,r,e);let h;if(r.includeCompletionsWithSnippetText){p=true;const e=zr.createEmptyStatement();h=zr.createBlock([e],true);setSnippetElement(e,{kind:0,order:0})}else{h=zr.createBlock([],true)}let T=0;const{modifiers:S,range:v,decorators:x}=getPresentModifiers(c,_,s);const b=S&64&&d.modifierFlagsCache&64;let C=[];id.addNewNodeForMemberSymbol(o,d,_,{program:t,host:e},r,y,(e=>{let t=0;if(b){t|=64}if(isClassElement(e)&&m.getMemberOverrideModifierStatus(d,e,o)===1){t|=16}if(!C.length){T=e.modifierFlagsCache|t}e=zr.replaceModifiers(e,T);C.push(e)}),h,id.PreserveOptionalFlags.Property,!!b);if(C.length){const e=o.flags&8192;let t=T|16|1;if(!e){t|=128|8}else{t|=1024}const n=S&t;if(S&~t){return void 0}if(T&4&&n&1){T&=~4}if(n!==0&&!(n&1)){T&=~1}T|=n;C=C.map((e=>zr.replaceModifiers(e,T)));if(x==null?void 0:x.length){const e=C[C.length-1];if(canHaveDecorators(e)){C[C.length-1]=zr.replaceDecoratorsAndModifiers(e,x.concat(getModifiers(e)||[]))}}const r=1|131072;if(l){u=g.printAndFormatSnippetList(r,zr.createNodeArray(C),_,l)}else{u=g.printSnippetList(r,zr.createNodeArray(C),_)}}return{insertText:u,filterText:f,isSnippet:p,importAdder:y,eraseRange:v}}function getPresentModifiers(e,t,n){if(!e||getLineAndCharacterOfPosition(t,n).line>getLineAndCharacterOfPosition(t,e.getEnd()).line){return{modifiers:0}}let r=0;let i;let o;const a={pos:n,end:n};if(isPropertyDeclaration(e.parent)&&(o=isModifierLike2(e))){if(e.parent.modifiers){r|=modifiersToFlags(e.parent.modifiers)&98303;i=e.parent.modifiers.filter(isDecorator)||[];a.pos=Math.min(...e.parent.modifiers.map((e=>e.getStart(t))))}const n=modifierToFlag(o);if(!(r&n)){r|=n;a.pos=Math.min(a.pos,e.getStart(t))}if(e.parent.name!==e){a.end=e.parent.name.getStart(t)}}return{modifiers:r,decorators:i,range:a.poss.getSignaturesOfType(e,0).length>0));if(t.length===1){e=t[0]}else{return void 0}}const n=s.getSignaturesOfType(e,0);if(n.length!==1){return void 0}const a=s.typeToTypeNode(e,t,u,void 0,id.getNoopSymbolTrackerWithResolver({program:r,host:i}));if(!a||!isFunctionTypeNode(a)){return void 0}let c;if(o.includeCompletionsWithSnippetText){const e=zr.createEmptyStatement();c=zr.createBlock([e],true);setSnippetElement(e,{kind:0,order:0})}else{c=zr.createBlock([],true)}const p=a.parameters.map((e=>zr.createParameterDeclaration(void 0,e.dotDotDotToken,e.name,void 0,void 0,e.initializer)));return zr.createMethodDeclaration(void 0,void 0,l,void 0,void 0,p,void 0,c)}default:return void 0}}function createSnippetPrinter(e){let t;const n=dm.createWriter(getNewLineCharacter(e));const r=createPrinter(e,n);const i={...n,write:e=>escapingWrite(e,(()=>n.write(e))),nonEscapingWrite:n.write,writeLiteral:e=>escapingWrite(e,(()=>n.writeLiteral(e))),writeStringLiteral:e=>escapingWrite(e,(()=>n.writeStringLiteral(e))),writeSymbol:(e,t)=>escapingWrite(e,(()=>n.writeSymbol(e,t))),writeParameter:e=>escapingWrite(e,(()=>n.writeParameter(e))),writeComment:e=>escapingWrite(e,(()=>n.writeComment(e))),writeProperty:e=>escapingWrite(e,(()=>n.writeProperty(e)))};return{printSnippetList:printSnippetList,printAndFormatSnippetList:printAndFormatSnippetList,printNode:printNode,printAndFormatNode:printAndFormatNode};function escapingWrite(e,r){const i=escapeSnippetText(e);if(i!==e){const e=n.getTextPos();r();const o=n.getTextPos();t=append(t||(t=[]),{newText:i,span:{start:e,length:o-e}})}else{r()}}function printSnippetList(e,n,r){const i=printUnescapedSnippetList(e,n,r);return t?dm.applyChanges(i,t):i}function printUnescapedSnippetList(e,n,o){t=void 0;i.clear();r.writeList(e,n,o,i);return i.getText()}function printAndFormatSnippetList(e,n,r,i){const o={text:printUnescapedSnippetList(e,n,r),getLineAndCharacterOfPosition(e){return getLineAndCharacterOfPosition(this,e)}};const a=getFormatCodeSettingsForWriting(i,r);const s=flatMap(n,(e=>{const t=dm.assignPositionsToNode(e);return hm.formatNodeGivenIndentation(t,o,r.languageVariant,0,0,{...i,options:a})}));const c=t?toSorted(concatenate(s,t),((e,t)=>compareTextSpans(e.span,t.span))):s;return dm.applyChanges(o.text,c)}function printNode(e,n,r){const i=printUnescapedNode(e,n,r);return t?dm.applyChanges(i,t):i}function printUnescapedNode(e,n,o){t=void 0;i.clear();r.writeNode(e,n,o,i);return i.getText()}function printAndFormatNode(e,n,r,i){const o={text:printUnescapedNode(e,n,r),getLineAndCharacterOfPosition(e){return getLineAndCharacterOfPosition(this,e)}};const a=getFormatCodeSettingsForWriting(i,r);const s=dm.assignPositionsToNode(n);const c=hm.formatNodeGivenIndentation(s,o,r.languageVariant,0,0,{...i,options:a});const l=t?toSorted(concatenate(c,t),((e,t)=>compareTextSpans(e.span,t.span))):c;return dm.applyChanges(o.text,l)}}function originToCompletionEntryData(e){const t=e.fileName?void 0:stripQuotes(e.moduleSymbol.name);const n=e.isFromPackageJson?true:void 0;if(originIsResolvedExport(e)){const r={exportName:e.exportName,exportMapKey:e.exportMapKey,moduleSpecifier:e.moduleSpecifier,ambientModuleName:t,fileName:e.fileName,isPackageJsonImport:n};return r}const r={exportName:e.exportName,exportMapKey:e.exportMapKey,fileName:e.fileName,ambientModuleName:e.fileName?void 0:stripQuotes(e.moduleSymbol.name),isPackageJsonImport:e.isFromPackageJson?true:void 0};return r}function completionEntryDataToSymbolOriginInfo(e,t,n){const r=e.exportName==="default";const i=!!e.isPackageJsonImport;if(completionEntryDataIsResolved(e)){const o={kind:32,exportName:e.exportName,exportMapKey:e.exportMapKey,moduleSpecifier:e.moduleSpecifier,symbolName:t,fileName:e.fileName,moduleSymbol:n,isDefaultExport:r,isFromPackageJson:i};return o}const o={kind:4,exportName:e.exportName,exportMapKey:e.exportMapKey,symbolName:t,fileName:e.fileName,moduleSymbol:n,isDefaultExport:r,isFromPackageJson:i};return o}function getInsertTextAndReplacementSpanForImportCompletion(e,t,n,r,i,o,a){const s=t.replacementSpan;const c=escapeSnippetText(quote(i,a,n.moduleSpecifier));const l=n.isDefaultExport?1:n.exportName==="export="?2:0;const d=a.includeCompletionsWithSnippetText?"$1":"";const p=id.getImportKind(i,l,o,true);const u=t.couldBeTypeOnlyImportSpecifier;const f=t.isTopLevelTypeOnly?` ${tokenToString(156)} `:" ";const m=u?`${tokenToString(156)} `:"";const _=r?";":"";switch(p){case 3:return{replacementSpan:s,insertText:`import${f}${escapeSnippetText(e)}${d} = require(${c})${_}`};case 1:return{replacementSpan:s,insertText:`import${f}${escapeSnippetText(e)}${d} from ${c}${_}`};case 2:return{replacementSpan:s,insertText:`import${f}* as ${escapeSnippetText(e)} from ${c}${_}`};case 0:return{replacementSpan:s,insertText:`import${f}{ ${m}${escapeSnippetText(e)}${d} } from ${c}${_}`}}}function quotePropertyName(e,t,n){if(/^\d+$/.test(n)){return n}return quote(e,t,n)}function isRecommendedCompletionMatch(e,t,n){return e===t||!!(e.flags&1048576)&&n.getExportSymbolOfSymbol(e)===t}function getSourceFromOrigin(e){if(originIsExport(e)){return stripQuotes(e.moduleSymbol.name)}if(originIsResolvedExport(e)){return e.moduleSpecifier}if((e==null?void 0:e.kind)===1){return"ThisProperty/"}if((e==null?void 0:e.kind)===64){return"TypeOnlyAlias/"}}function getCompletionEntriesFromSymbols(e,t,n,r,i,o,a,s,c,l,d,p,u,f,m,_,g,y,h,T,S,v,x,b,C,E=false){const N=R();const k=getClosestSymbolDeclaration(r,i);const F=probablyUsesSemicolons(a);const P=c.getTypeChecker();const D=new Map;for(let d=0;de.getSourceFile()===i.getSourceFile())));D.set(A,R);insertSorted(t,M,compareCompletionEntries,void 0,true)}d("getCompletionsAtPosition: getCompletionEntriesFromSymbols: "+(R()-N));return{has:e=>D.has(e),add:e=>D.set(e,true)};function shouldIncludeSymbol(e,t){var n;let o=e.flags;if(!isSourceFile(i)){if(isExportAssignment(i.parent)){return true}if(tryCast(k,isVariableDeclaration)&&e.valueDeclaration===k){return false}const s=e.valueDeclaration??((n=e.declarations)==null?void 0:n[0]);if(k&&s){if(isParameter(k)&&isParameter(s)){const e=k.parent.parameters;if(s.pos>=k.pos&&s.pos=k.pos&&s.poscompletionNameForLiteral(n,a,e)===i.name));if(h!==void 0)return{type:"literal",literal:h};return firstDefined(l,((e,t)=>{const n=f[t];const r=getCompletionEntryDisplayNameForSymbol(e,zn(s),n,u,c.isJsxIdentifierExpected);return r&&r.name===i.name&&(i.source==="ClassMemberSnippet/"&&e.flags&106500||i.source==="ObjectLiteralMethodSnippet/"&&e.flags&(4|8192)||getSourceFromOrigin(n)===i.source||i.source==="ObjectLiteralMemberWithComma/")?{type:"symbol",symbol:e,location:p,origin:n,contextToken:m,previousToken:_,isJsxInitializer:g,isTypeOnlyLocation:y}:void 0}))||{type:"none"}}function getCompletionEntryDetails(e,t,n,r,i,o,a,s,c){const l=e.getTypeChecker();const d=e.getCompilerOptions();const{name:p,source:u,data:f}=i;const{previousToken:m,contextToken:_}=getRelevantTokens(r,n);if(isInString(n,r,m)){return Of.getStringLiteralCompletionDetails(p,n,r,m,e,o,c,s)}const g=getSymbolCompletionFromEntryId(e,t,n,r,i,o,s);switch(g.type){case"request":{const{request:e}=g;switch(e.kind){case 1:return Gf.getJSDocTagNameCompletionDetails(p);case 2:return Gf.getJSDocTagCompletionDetails(p);case 3:return Gf.getJSDocParameterNameCompletionDetails(p);case 4:return some(e.keywordCompletions,(e=>e.name===p))?createSimpleDetails(p,"keyword",5):void 0;default:return S.assertNever(e)}}case"symbol":{const{symbol:t,location:i,contextToken:m,origin:_,previousToken:y}=g;const{codeActions:h,sourceDisplay:T}=getCompletionEntryCodeActionsAndSourceDisplay(p,i,m,_,t,e,o,d,n,r,y,a,s,f,u,c);const S=originIsComputedPropertyName(_)?_.symbolName:t.name;return createCompletionDetailsForSymbol(t,S,l,n,i,c,h,T)}case"literal":{const{literal:e}=g;return createSimpleDetails(completionNameForLiteral(n,s,e),"string",typeof e==="string"?8:7)}case"cases":{const t=getExhaustiveCaseSnippets(_.parent,n,s,e.getCompilerOptions(),o,e,void 0);if(t==null?void 0:t.importAdder.hasFixes()){const{entry:e,importAdder:n}=t;const r=dm.ChangeTracker.with({host:o,formatContext:a,preferences:s},n.writeFixes);return{name:e.name,kind:"",kindModifiers:"",displayParts:[],sourceDisplay:void 0,codeActions:[{changes:r,description:diagnosticToString([wt.Includes_imports_of_types_referenced_by_0,p])}]}}return{name:p,kind:"",kindModifiers:"",displayParts:[],sourceDisplay:void 0}}case"none":return Af().some((e=>e.name===p))?createSimpleDetails(p,"keyword",5):void 0;default:S.assertNever(g)}}function createSimpleDetails(e,t,n){return createCompletionDetails(e,"",t,[displayPart(e,n)])}function createCompletionDetailsForSymbol(e,t,n,r,i,o,a,s){const{displayParts:c,documentation:l,symbolKind:d,tags:p}=n.runWithCancellationToken(o,(t=>cm.getSymbolDisplayPartsDocumentationAndSymbolKind(t,e,r,i,i,7)));return createCompletionDetails(t,cm.getSymbolModifiers(n,e),d,c,l,p,a,s)}function createCompletionDetails(e,t,n,r,i,o,a,s){return{name:e,kindModifiers:t,kind:n,displayParts:r,documentation:i,tags:o,codeActions:a,source:s,sourceDisplay:s}}function getCompletionEntryCodeActionsAndSourceDisplay(e,t,n,r,i,o,a,s,c,l,d,p,u,f,m,_){if(f==null?void 0:f.moduleSpecifier){if(d&&getImportStatementCompletionInfo(n||d,c).replacementSpan){return{codeActions:void 0,sourceDisplay:[textPart(f.moduleSpecifier)]}}}if(m==="ClassMemberSnippet/"){const{importAdder:r,eraseRange:d}=getEntryForMemberCompletion(a,o,s,u,e,i,t,l,n,p);if((r==null?void 0:r.hasFixes())||d){const t=dm.ChangeTracker.with({host:a,formatContext:p,preferences:u},(e=>{if(r){r.writeFixes(e)}if(d){e.deleteRange(c,d)}}));return{sourceDisplay:void 0,codeActions:[{changes:t,description:(r==null?void 0:r.hasFixes())?diagnosticToString([wt.Includes_imports_of_types_referenced_by_0,e]):diagnosticToString([wt.Update_modifiers_of_0,e])}]}}}if(originIsTypeOnlyAlias(r)){const e=id.getPromoteTypeOnlyCompletionAction(c,r.declaration.name,o,a,p,u);S.assertIsDefined(e,"Expected to have a code action for promoting type-only alias");return{codeActions:[e],sourceDisplay:void 0}}if(m==="ObjectLiteralMemberWithComma/"&&n){const t=dm.ChangeTracker.with({host:a,formatContext:p,preferences:u},(e=>e.insertText(c,n.end,",")));if(t){return{sourceDisplay:void 0,codeActions:[{changes:t,description:diagnosticToString([wt.Add_missing_comma_for_object_member_completion_0,e])}]}}}if(!r||!(originIsExport(r)||originIsResolvedExport(r))){return{codeActions:void 0,sourceDisplay:void 0}}const g=r.isFromPackageJson?a.getPackageJsonAutoImportProvider().getTypeChecker():o.getTypeChecker();const{moduleSymbol:y}=r;const h=g.getMergedSymbol(skipAlias(i.exportSymbol||i,g));const T=(n==null?void 0:n.kind)===30&&isJsxOpeningLikeElement(n.parent);const{moduleSpecifier:v,codeAction:x}=id.getImportCompletionAction(h,y,f==null?void 0:f.exportMapKey,c,e,T,a,o,p,d&&isIdentifier(d)?d.getStart(c):l,u,_);S.assert(!(f==null?void 0:f.moduleSpecifier)||v===f.moduleSpecifier);return{sourceDisplay:[textPart(v)],codeActions:[x]}}function getCompletionEntrySymbol(e,t,n,r,i,o,a){const s=getSymbolCompletionFromEntryId(e,t,n,r,i,o,a);return s.type==="symbol"?s.symbol:void 0}var Df=(e=>{e[e["ObjectPropertyDeclaration"]=0]="ObjectPropertyDeclaration";e[e["Global"]=1]="Global";e[e["PropertyAccess"]=2]="PropertyAccess";e[e["MemberLike"]=3]="MemberLike";e[e["String"]=4]="String";e[e["None"]=5]="None";return e})(Df||{});function getRecommendedCompletion(e,t,n){return firstDefined(t&&(t.isUnion()?t.types:[t]),(t=>{const r=t&&t.symbol;return r&&(r.flags&(8|384|32)&&!isAbstractConstructorSymbol(r))?getFirstSymbolInChain(r,e,n):void 0}))}function getContextualType(e,t,n,r){const{parent:i}=e;switch(e.kind){case 80:return getContextualTypeFromParent(e,r);case 64:switch(i.kind){case 260:return r.getContextualType(i.initializer);case 226:return r.getTypeAtLocation(i.left);case 291:return r.getContextualTypeForJsxAttribute(i);default:return void 0}case 105:return r.getContextualType(i);case 84:const o=tryCast(i,isCaseClause);return o?getSwitchedType(o,r):void 0;case 19:return isJsxExpression(i)&&!isJsxElement(i.parent)&&!isJsxFragment(i.parent)?r.getContextualTypeForJsxAttribute(i.parent):void 0;default:const a=rm.getArgumentInfoForCompletions(e,t,n,r);return a?r.getContextualTypeForArgumentAtIndex(a.invocation,a.argumentIndex):isEqualityOperatorKind(e.kind)&&isBinaryExpression(i)&&isEqualityOperatorKind(i.operatorToken.kind)?r.getTypeAtLocation(i.left):r.getContextualType(e,4)||r.getContextualType(e)}}function getFirstSymbolInChain(e,t,n){const r=n.getAccessibleSymbolChain(e,t,-1,false);if(r)return first(r);return e.parent&&(isModuleSymbol(e.parent)?e:getFirstSymbolInChain(e.parent,t,n))}function isModuleSymbol(e){var t;return!!((t=e.declarations)==null?void 0:t.some((e=>e.kind===307)))}function getCompletionData(e,t,n,r,i,o,a,s,c,l){const d=e.getTypeChecker();const p=isCheckedFile(n,r);let u=R();let f=getTokenAtPosition(n,i);t("getCompletionData: Get current token: "+(R()-u));u=R();const m=isInComment(n,i,f);t("getCompletionData: Is inside comment: "+(R()-u));let _=false;let g=false;let y=false;if(m){if(hasDocComment(n,i)){if(n.text.charCodeAt(i-1)===64){return{kind:1}}else{const e=getLineStartPositionForPosition(i,n);if(!/[^*|\s(/)]/.test(n.text.substring(e,i))){return{kind:2}}}}const e=getJsDocTagAtPosition(f,i);if(e){if(e.tagName.pos<=i&&i<=e.tagName.end){return{kind:1}}if(isJSDocImportTag(e)){g=true}else{const t=tryGetTypeExpressionFromTag(e);if(t){f=getTokenAtPosition(n,i);if(!f||!isDeclarationName(f)&&(f.parent.kind!==348||f.parent.name!==f)){_=isCurrentlyEditingNode(t)}}if(!_&&isJSDocParameterTag(e)&&(nodeIsMissing(e.name)||e.name.pos<=i&&i<=e.name.end)){return{kind:3,tag:e}}}}if(!_&&!g){t("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.");return void 0}}u=R();const h=!_&&!g&&isSourceFileJS(n);const T=getRelevantTokens(i,n);const v=T.previousToken;let x=T.contextToken;t("getCompletionData: Get previous token: "+(R()-u));let b=f;let C;let E=false;let N=false;let k=false;let F=false;let P=false;let D=false;let I;let A=getTouchingPropertyName(n,i);let O=0;let w=false;let L=0;let M;if(x){const e=getImportStatementCompletionInfo(x,n);if(e.keywordCompletion){if(e.isKeywordOnlyCompletion){return{kind:4,keywordCompletions:[keywordToCompletionEntry(e.keywordCompletion)],isNewIdentifierLocation:e.isNewIdentifierLocation}}O=keywordFiltersFromSyntaxKind(e.keywordCompletion)}if(e.replacementSpan&&o.includeCompletionsForImportStatements&&o.includeCompletionsWithInsertText){L|=2;I=e;w=e.isNewIdentifierLocation}if(!e.replacementSpan&&isCompletionListBlocker(x)){t("Returning an empty list because completion was requested in an invalid position.");return O?keywordCompletionData(O,h,computeCommitCharactersAndIsNewIdentifier().isNewIdentifierLocation):void 0}let r=x.parent;if(x.kind===25||x.kind===29){E=x.kind===25;N=x.kind===29;switch(r.kind){case 211:C=r;b=C.expression;const e=getLeftmostAccessExpression(C);if(nodeIsMissing(e)||(isCallExpression(b)||isFunctionLike(b))&&b.end===x.pos&&b.getChildCount(n)&&last(b.getChildren(n)).kind!==22){return void 0}break;case 166:b=r.left;break;case 267:b=r.name;break;case 205:b=r;break;case 236:b=r.getFirstToken(n);S.assert(b.kind===102||b.kind===105);break;default:return void 0}}else if(!I){if(r&&r.kind===211){x=r;r=r.parent}if(f.parent===A){switch(f.kind){case 32:if(f.parent.kind===284||f.parent.kind===286){A=f}break;case 44:if(f.parent.kind===285){A=f}break}}switch(r.kind){case 287:if(x.kind===44){F=true;A=x}break;case 226:if(!binaryExpressionMayBeOpenTag(r)){break}case 285:case 284:case 286:D=true;if(x.kind===30){k=true;A=x}break;case 294:case 293:if(v.kind===20||v.kind===80&&v.parent.kind===291){D=true}break;case 291:if(r.initializer===v&&v.endcreateModuleSpecifierResolutionHost(t?s.getPackageJsonAutoImportProvider():e,s)));if(E||N){getTypeScriptMemberSymbols()}else if(k){W=d.getJsxIntrinsicTagNamesAt(A);S.assertEachIsDefined(W,"getJsxIntrinsicTagNames() should all be defined");tryGetGlobalSymbols();j=1;O=0}else if(F){const e=x.parent.parent.openingElement.tagName;const t=d.getSymbolAtLocation(e);if(t){W=[t]}j=1;O=0}else{if(!tryGetGlobalSymbols()){return O?keywordCompletionData(O,h,w):void 0}}t("getCompletionData: Semantic work: "+(R()-B));const K=v&&getContextualType(v,i,n,d);const $=!tryCast(v,isStringLiteralLike)&&!D;const Q=!$?[]:mapDefined(K&&(K.isUnion()?K.types:[K]),(e=>e.isLiteral()&&!(e.flags&1024)?e.value:void 0));const X=v&&K&&getRecommendedCompletion(v,K,d);return{kind:0,symbols:W,completionKind:j,isInSnippetScope:y,propertyAccessToConvert:C,isNewIdentifierLocation:w,location:A,keywordFilters:O,literals:Q,symbolToOriginInfoMap:z,recommendedCompletion:X,previousToken:v,contextToken:x,isJsxInitializer:P,insideJsDocTagTypeExpression:_,symbolToSortTextMap:V,isTypeOnlyLocation:H,isJsxIdentifierExpected:D,isRightOfOpenTag:k,isRightOfDotOrQuestionDot:E||N,importStatementCompletion:I,hasUnresolvedAutoImports:J,flags:L,defaultCommitCharacters:M};function isTagWithTypeExpression(e){switch(e.kind){case 341:case 348:case 342:case 344:case 346:case 349:case 350:return true;case 345:return!!e.constraint;default:return false}}function tryGetTypeExpressionFromTag(e){if(isTagWithTypeExpression(e)){const t=isJSDocTemplateTag(e)?e.constraint:e.typeExpression;return t&&t.kind===309?t:void 0}if(isJSDocAugmentsTag(e)||isJSDocImplementsTag(e)){return e.class}return void 0}function getTypeScriptMemberSymbols(){j=2;const e=isLiteralImportTypeNode(b);const t=e&&!b.isTypeOf||isPartOfTypeNode(b.parent)||isPossiblyTypeArgumentPosition(x,n,d);const r=isInRightSideOfInternalImportEqualsDeclaration(b);if(isEntityName(b)||e||isPropertyAccessExpression(b)){const n=isModuleDeclaration(b.parent);if(n){w=true;M=[]}let i=d.getSymbolAtLocation(b);if(i){i=skipAlias(i,d);if(i.flags&(1536|384)){const a=d.getExportsOfModule(i);S.assertEachIsDefined(a,"getExportsOfModule() should all be defined");const isValidValueAccess=t=>d.isValidPropertyAccess(e?b:b.parent,t.name);const isValidTypeAccess=e=>symbolCanBeReferencedAtTypeLocation(e,d);const s=n?e=>{var t;return!!(e.flags&1920)&&!((t=e.declarations)==null?void 0:t.every((e=>e.parent===b.parent)))}:r?e=>isValidTypeAccess(e)||isValidValueAccess(e):t||_?isValidTypeAccess:isValidValueAccess;for(const e of a){if(s(e)){W.push(e)}}if(!t&&!_&&i.declarations&&i.declarations.some((e=>e.kind!==307&&e.kind!==267&&e.kind!==266))){let e=d.getTypeOfSymbolAtLocation(i,b).getNonOptionalType();let t=false;if(e.isNullableType()){const n=E&&!N&&o.includeAutomaticOptionalChainCompletions!==false;if(n||N){e=e.getNonNullableType();if(n){t=true}}}addTypeProperties(e,!!(b.flags&65536),t)}return}}}if(!t||isInTypeQuery(b)){d.tryGetThisTypeAt(b,false);let e=d.getTypeAtLocation(b).getNonOptionalType();if(!t){let t=false;if(e.isNullableType()){const n=E&&!N&&o.includeAutomaticOptionalChainCompletions!==false;if(n||N){e=e.getNonNullableType();if(n){t=true}}}addTypeProperties(e,!!(b.flags&65536),t)}else{addTypeProperties(e.getNonNullableType(),false,false)}}}function addTypeProperties(e,t,n){if(e.getStringIndexType()){w=true;M=[]}if(N&&some(e.getCallSignatures())){w=true;M??(M=Nf)}const r=b.kind===205?b:b.parent;if(p){for(const t of e.getApparentProperties()){if(d.isValidPropertyAccessForCompletions(r,e,t)){addPropertySymbol(t,false,n)}}}else{W.push(...filter(getPropertiesForCompletion(e,d),(t=>d.isValidPropertyAccessForCompletions(r,e,t))))}if(t&&o.includeCompletionsWithInsertText){const t=d.getPromisedTypeOfPromise(e);if(t){for(const e of t.getApparentProperties()){if(d.isValidPropertyAccessForCompletions(r,t,e)){addPropertySymbol(e,true,n)}}}}}function addPropertySymbol(t,r,a){var c;const l=firstDefined(t.declarations,(e=>tryCast(getNameOfDeclaration(e),isComputedPropertyName)));if(l){const r=getLeftMostName(l.expression);const a=r&&d.getSymbolAtLocation(r);const p=a&&getFirstSymbolInChain(a,x,d);const u=p&&getSymbolId(p);if(u&&addToSeen(q,u)){const t=W.length;W.push(p);const r=p.parent;if(!r||!isExternalModuleSymbol(r)||d.tryGetMemberInModuleExportsAndProperties(p.name,r)!==p){z[t]={kind:getNullableSymbolOriginInfoKind(2)}}else{const a=isExternalModuleNameRelative(stripQuotes(r.name))?(c=getSourceFileOfModule(r))==null?void 0:c.fileName:void 0;const{moduleSpecifier:l}=(U||(U=id.createImportSpecifierResolver(n,e,s,o))).getModuleSpecifierForBestExportInfo([{exportKind:0,moduleFileName:a,isFromPackageJson:false,moduleSymbol:r,symbol:p,targetFlags:skipAlias(p,d).flags}],i,isValidTypeOnlyAliasUseSite(A))||{};if(l){const e={kind:getNullableSymbolOriginInfoKind(6),moduleSymbol:r,isDefaultExport:false,symbolName:p.name,exportName:p.name,fileName:a,moduleSpecifier:l};z[t]=e}}}else if(o.includeCompletionsWithInsertText){if(u&&q.has(u)){return}addSymbolOriginInfo(t);addSymbolSortInfo(t);W.push(t)}}else{addSymbolOriginInfo(t);addSymbolSortInfo(t);W.push(t)}function addSymbolSortInfo(e){if(isStaticProperty(e)){V[getSymbolId(e)]=Ef.LocalDeclarationPriority}}function addSymbolOriginInfo(e){if(o.includeCompletionsWithInsertText){if(r&&addToSeen(q,getSymbolId(e))){z[W.length]={kind:getNullableSymbolOriginInfoKind(8)}}else if(a){z[W.length]={kind:16}}}}function getNullableSymbolOriginInfoKind(e){return a?e|16:e}}function getLeftMostName(e){return isIdentifier(e)?e:isPropertyAccessExpression(e)?getLeftMostName(e.expression):void 0}function tryGetGlobalSymbols(){const e=tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols()||tryGetObjectLikeCompletionSymbols()||tryGetImportCompletionSymbols()||tryGetImportOrExportClauseCompletionSymbols()||tryGetImportAttributesCompletionSymbols()||tryGetLocalNamedExportCompletionSymbols()||tryGetConstructorCompletion()||tryGetClassLikeCompletionSymbols()||tryGetJsxCompletionSymbols()||(getGlobalCompletions(),1);return e===1}function tryGetConstructorCompletion(){if(!tryGetConstructorLikeCompletionContainer(x))return 0;j=5;w=true;O=4;return 1}function tryGetJsxCompletionSymbols(){const e=tryGetContainingJsxElement(x);const t=e&&d.getContextualType(e.attributes);if(!t)return 0;const n=e&&d.getContextualType(e.attributes,4);W=concatenate(W,filterJsxAttributes(getPropertiesForObjectExpression(t,n,e.attributes,d),e.attributes.properties));setSortTextToOptionalMember();j=3;w=false;return 1}function tryGetImportCompletionSymbols(){if(!I)return 0;w=true;collectAutoImports();return 1}function getGlobalCompletions(){O=tryGetFunctionLikeBodyCompletionContainer(x)?5:1;j=1;({isNewIdentifierLocation:w,defaultCommitCharacters:M}=computeCommitCharactersAndIsNewIdentifier());if(v!==x){S.assert(!!v,"Expected 'contextToken' to be defined when different from 'previousToken'.")}const e=v!==x?v.getStart():i;const t=getScopeNode(x,e,n)||n;y=isSnippetScope(t);const r=(H?0:111551)|788968|1920|2097152;const a=v&&!isValidTypeOnlyAliasUseSite(v);W=concatenate(W,d.getSymbolsInScope(t,r));S.assertEachIsDefined(W,"getSymbolsInScope() should all be defined");for(let e=0;ee.getSourceFile()===n))){V[getSymbolId(t)]=Ef.GlobalsOrKeywords}if(a&&!(t.flags&111551)){const n=t.declarations&&find(t.declarations,isTypeOnlyImportDeclaration);if(n){const t={kind:64,declaration:n};z[e]=t}}}if(o.includeCompletionsWithInsertText&&t.kind!==307){const e=d.tryGetThisTypeAt(t,false,isClassLike(t.parent)?t:void 0);if(e&&!isProbablyGlobalType(e,n,d)){for(const t of getPropertiesForCompletion(e,d)){z[W.length]={kind:1};W.push(t);V[getSymbolId(t)]=Ef.SuggestedClassMembers}}}collectAutoImports();if(H){O=x&&isAssertionExpression(x.parent)?6:7}}function shouldOfferImportCompletions(){var t;if(I)return true;if(!o.includeCompletionsForModuleExports)return false;if(n.externalModuleIndicator||n.commonJsModuleIndicator)return true;if(compilerOptionsIndicateEsModules(e.getCompilerOptions()))return true;return((t=e.getSymlinkCache)==null?void 0:t.call(e).hasAnySymlinks())||!!e.getCompilerOptions().paths||programContainsModules(e)}function isSnippetScope(e){switch(e.kind){case 307:case 228:case 294:case 241:return true;default:return isStatement(e)}}function isTypeOnlyCompletion(){return _||g||!!I&&isTypeOnlyImportOrExportDeclaration(A.parent)||!isContextTokenValueLocation(x)&&(isPossiblyTypeArgumentPosition(x,n,d)||isPartOfTypeNode(A)||isContextTokenTypeLocation(x))}function isContextTokenValueLocation(e){return e&&(e.kind===114&&(e.parent.kind===186||isTypeOfExpression(e.parent))||e.kind===131&&e.parent.kind===182)}function isContextTokenTypeLocation(e){if(e){const t=e.parent.kind;switch(e.kind){case 59:return t===172||t===171||t===169||t===260||isFunctionLikeKind(t);case 64:return t===265||t===168;case 130:return t===234;case 30:return t===183||t===216;case 96:return t===168;case 152:return t===238}}return false}function collectAutoImports(){var t,r;if(!shouldOfferImportCompletions())return;S.assert(!(a==null?void 0:a.data),"Should not run 'collectAutoImports' when faster path is available via `data`");if(a&&!a.source){return}L|=1;const c=v===x&&I;const d=c?"":v&&isIdentifier(v)?v.text.toLowerCase():"";const p=(t=s.getModuleSpecifierCache)==null?void 0:t.call(s);const u=getExportInfoMap(n,s,e,o,l);const f=(r=s.getPackageJsonAutoImportProvider)==null?void 0:r.call(s);const m=a?void 0:createPackageJsonImportFilter(n,o,s);resolvingModuleSpecifiers("collectAutoImports",s,U||(U=id.createImportSpecifierResolver(n,e,s,o)),e,i,o,!!I,isValidTypeOnlyAliasUseSite(A),(e=>{u.search(n.path,k,((e,t)=>{if(!isIdentifierText(e,zn(s.getCompilationSettings())))return false;if(!a&&isStringANonContextualKeyword(e))return false;if(!H&&!I&&!(t&111551))return false;if(H&&!(t&(1536|788968)))return false;const n=e.charCodeAt(0);if(k&&(n<65||n>90))return false;if(a)return true;return charactersFuzzyMatchInString(e,d)}),((t,n,r,i)=>{if(a&&!some(t,(e=>a.source===stripQuotes(e.moduleSymbol.name)))){return}t=filter(t,isImportableExportInfo);if(!t.length){return}const o=e.tryResolve(t,r)||{};if(o==="failed")return;let s=t[0],c;if(o!=="skipped"){({exportInfo:s=t[0],moduleSpecifier:c}=o)}const l=s.exportKind===1;const d=l&&getLocalSymbolForExportDefault(S.checkDefined(s.symbol))||S.checkDefined(s.symbol);pushAutoImportSymbol(d,{kind:c?32:4,moduleSpecifier:c,symbolName:n,exportMapKey:i,exportName:s.exportKind===2?"export=":S.checkDefined(s.symbol).name,fileName:s.moduleFileName,isDefaultExport:l,moduleSymbol:s.moduleSymbol,isFromPackageJson:s.isFromPackageJson})}));J=e.skippedAny();L|=e.resolvedAny()?8:0;L|=e.resolvedBeyondLimit()?16:0}));function isImportableExportInfo(t){return isImportable(t.isFromPackageJson?f:e,n,tryCast(t.moduleSymbol.valueDeclaration,isSourceFile),t.moduleSymbol,o,m,G(t.isFromPackageJson),p)}}function pushAutoImportSymbol(e,t){const n=getSymbolId(e);if(V[n]===Ef.GlobalsOrKeywords){return}z[W.length]=t;V[n]=I?Ef.LocationPriority:Ef.AutoImportSuggestions;W.push(e)}function collectObjectLiteralMethodSymbols(t,n){if(isInJSFile(A)){return}t.forEach((t=>{if(!isObjectLiteralMethodSymbol(t)){return}const i=getCompletionEntryDisplayNameForSymbol(t,zn(r),void 0,0,false);if(!i){return}const{name:a}=i;const l=getEntryForObjectLiteralMethodCompletion(t,a,n,e,s,r,o,c);if(!l){return}const d={kind:128,...l};L|=32;z[W.length]=d;W.push(t)}))}function isObjectLiteralMethodSymbol(e){if(!(e.flags&(4|8192))){return false}return true}function getScopeNode(e,t,n){let r=e;while(r&&!positionBelongsToNode(r,t,n)){r=r.parent}return r}function isCompletionListBlocker(e){const n=R();const r=isInStringOrRegularExpressionOrTemplateLiteral(e)||isSolelyIdentifierDefinitionLocation(e)||isDotOfNumericLiteral(e)||isInJsxText(e)||isBigIntLiteral(e);t("getCompletionsAtPosition: isCompletionListBlocker: "+(R()-n));return r}function isInJsxText(e){if(e.kind===12){return true}if(e.kind===32&&e.parent){if(A===e.parent&&(A.kind===286||A.kind===285)){return false}if(e.parent.kind===286){return A.parent.kind!==286}if(e.parent.kind===287||e.parent.kind===285){return!!e.parent.parent&&e.parent.parent.kind===284}}return false}function computeCommitCharactersAndIsNewIdentifier(){if(x){const e=x.parent.kind;const t=keywordForNode(x);switch(t){case 28:switch(e){case 213:case 214:{const e=x.parent.expression;if(getLineAndCharacterOfPosition(n,e.end).line!==getLineAndCharacterOfPosition(n,i).line){return{defaultCommitCharacters:kf,isNewIdentifierLocation:true}}return{defaultCommitCharacters:Nf,isNewIdentifierLocation:true}}case 226:return{defaultCommitCharacters:kf,isNewIdentifierLocation:true};case 176:case 184:case 210:return{defaultCommitCharacters:[],isNewIdentifierLocation:true};case 209:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:true};default:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:false}}case 21:switch(e){case 213:case 214:{const e=x.parent.expression;if(getLineAndCharacterOfPosition(n,e.end).line!==getLineAndCharacterOfPosition(n,i).line){return{defaultCommitCharacters:kf,isNewIdentifierLocation:true}}return{defaultCommitCharacters:Nf,isNewIdentifierLocation:true}}case 217:return{defaultCommitCharacters:kf,isNewIdentifierLocation:true};case 176:case 196:return{defaultCommitCharacters:[],isNewIdentifierLocation:true};default:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:false}}case 23:switch(e){case 209:case 181:case 189:case 167:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:true};default:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:false}}case 144:case 145:case 102:return{defaultCommitCharacters:[],isNewIdentifierLocation:true};case 25:switch(e){case 267:return{defaultCommitCharacters:[],isNewIdentifierLocation:true};default:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:false}}case 19:switch(e){case 263:case 210:return{defaultCommitCharacters:[],isNewIdentifierLocation:true};default:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:false}}case 64:switch(e){case 260:case 226:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:true};default:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:false}}case 16:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:e===228};case 17:return{defaultCommitCharacters:Nf,isNewIdentifierLocation:e===239};case 134:return e===174||e===304?{defaultCommitCharacters:[],isNewIdentifierLocation:true}:{defaultCommitCharacters:Nf,isNewIdentifierLocation:false};case 42:return e===174?{defaultCommitCharacters:[],isNewIdentifierLocation:true}:{defaultCommitCharacters:Nf,isNewIdentifierLocation:false}}if(isClassMemberCompletionKeyword(t)){return{defaultCommitCharacters:[],isNewIdentifierLocation:true}}}return{defaultCommitCharacters:Nf,isNewIdentifierLocation:false}}function isInStringOrRegularExpressionOrTemplateLiteral(e){return(isRegularExpressionLiteral(e)||isStringTextContainingNode(e))&&(rangeContainsPositionExclusive(e,i)||i===e.end&&(!!e.isUnterminated||isRegularExpressionLiteral(e)))}function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols(){const e=tryGetTypeLiteralNode(x);if(!e)return 0;const t=isIntersectionTypeNode(e.parent)?e.parent:void 0;const n=t||e;const r=getConstraintOfTypeArgumentProperty(n,d);if(!r)return 0;const i=d.getTypeFromTypeNode(n);const o=getPropertiesForCompletion(r,d);const a=getPropertiesForCompletion(i,d);const s=new Set;a.forEach((e=>s.add(e.escapedName)));W=concatenate(W,filter(o,(e=>!s.has(e.escapedName))));j=0;w=true;return 1}function tryGetObjectLikeCompletionSymbols(){if((x==null?void 0:x.kind)===26)return 0;const e=W.length;const t=tryGetObjectLikeCompletionContainer(x,i,n);if(!t)return 0;j=0;let r;let a;if(t.kind===210){const e=tryGetObjectLiteralContextualType(t,d);if(e===void 0){if(t.flags&67108864){return 2}return 0}const n=d.getContextualType(t,4);const i=(n||e).getStringIndexType();const o=(n||e).getNumberIndexType();w=!!i||!!o;r=getPropertiesForObjectExpression(e,n,t,d);a=t.properties;if(r.length===0){if(!o){return 0}}}else{S.assert(t.kind===206);w=false;const e=getRootDeclaration(t.parent);if(!isVariableLike(e))return S.fail("Root declaration is not variable-like.");let n=hasInitializer(e)||!!getEffectiveTypeAnnotationNode(e)||e.parent.parent.kind===250;if(!n&&e.kind===169){if(isExpression(e.parent)){n=!!d.getContextualType(e.parent)}else if(e.parent.kind===174||e.parent.kind===178){n=isExpression(e.parent.parent)&&!!d.getContextualType(e.parent.parent)}}if(n){const e=d.getTypeAtLocation(t);if(!e)return 2;r=d.getPropertiesOfType(e).filter((n=>d.isPropertyAccessible(t,false,false,e,n)));a=t.elements}}if(r&&r.length>0){const n=filterObjectMembersList(r,S.checkDefined(a));W=concatenate(W,n);setSortTextToOptionalMember();if(t.kind===210&&o.includeCompletionsWithObjectLiteralMethodSnippets&&o.includeCompletionsWithInsertText){transformObjectLiteralMembersSortText(e);collectObjectLiteralMethodSymbols(n,t)}}return 1}function tryGetImportOrExportClauseCompletionSymbols(){if(!x)return 0;const e=x.kind===19||x.kind===28?tryCast(x.parent,isNamedImportsOrExports):isTypeKeywordTokenOrIdentifier(x)?tryCast(x.parent.parent,isNamedImportsOrExports):void 0;if(!e)return 0;if(!isTypeKeywordTokenOrIdentifier(x)){O=8}const{moduleSpecifier:t}=e.kind===275?e.parent.parent:e.parent;if(!t){w=true;return e.kind===275?2:0}const n=d.getSymbolAtLocation(t);if(!n){w=true;return 2}j=3;w=false;const r=d.getExportsAndPropertiesOfModule(n);const i=new Set(e.elements.filter((e=>!isCurrentlyEditingNode(e))).map((e=>moduleExportNameTextEscaped(e.propertyName||e.name))));const o=r.filter((e=>e.escapedName!=="default"&&!i.has(e.escapedName)));W=concatenate(W,o);if(!o.length){O=0}return 1}function tryGetImportAttributesCompletionSymbols(){if(x===void 0)return 0;const e=x.kind===19||x.kind===28?tryCast(x.parent,isImportAttributes):x.kind===59?tryCast(x.parent.parent,isImportAttributes):void 0;if(e===void 0)return 0;const t=new Set(e.elements.map(getNameFromImportAttribute));W=filter(d.getTypeAtLocation(e).getApparentProperties(),(e=>!t.has(e.escapedName)));return 1}function tryGetLocalNamedExportCompletionSymbols(){var e;const t=x&&(x.kind===19||x.kind===28)?tryCast(x.parent,isNamedExports):void 0;if(!t){return 0}const n=findAncestor(t,or(isSourceFile,isModuleDeclaration));j=5;w=false;(e=n.locals)==null?void 0:e.forEach(((e,t)=>{var r,i;W.push(e);if((i=(r=n.symbol)==null?void 0:r.exports)==null?void 0:i.has(t)){V[getSymbolId(e)]=Ef.OptionalMember}}));return 1}function tryGetClassLikeCompletionSymbols(){const e=tryGetObjectTypeDeclarationCompletionContainer(n,x,A,i);if(!e)return 0;j=3;w=true;O=x.kind===42?0:isClassLike(e)?2:3;if(!isClassLike(e))return 1;const t=x.kind===27?x.parent.parent:x.parent;let r=isClassElement(t)?getEffectiveModifierFlags(t):0;if(x.kind===80&&!isCurrentlyEditingNode(x)){switch(x.getText()){case"private":r=r|2;break;case"static":r=r|256;break;case"override":r=r|16;break}}if(isClassStaticBlockDeclaration(t)){r|=256}if(!(r&2)){const t=isClassLike(e)&&r&16?singleElementArray(getEffectiveBaseTypeNode(e)):getAllSuperTypeNodes(e);const n=flatMap(t,(t=>{const n=d.getTypeAtLocation(t);return r&256?(n==null?void 0:n.symbol)&&d.getPropertiesOfType(d.getTypeOfSymbolAtLocation(n.symbol,e)):n&&d.getPropertiesOfType(n)}));W=concatenate(W,filterClassMembersList(n,e.members,r));forEach(W,((e,t)=>{const n=e==null?void 0:e.valueDeclaration;if(n&&isClassElement(n)&&n.name&&isComputedPropertyName(n.name)){const n={kind:512,symbolName:d.symbolToString(e)};z[t]=n}}))}return 1}function isConstructorParameterCompletion(e){return!!e.parent&&isParameter(e.parent)&&isConstructorDeclaration(e.parent.parent)&&(isParameterPropertyModifier(e.kind)||isDeclarationName(e))}function tryGetConstructorLikeCompletionContainer(e){if(e){const t=e.parent;switch(e.kind){case 21:case 28:return isConstructorDeclaration(e.parent)?e.parent:void 0;default:if(isConstructorParameterCompletion(e)){return t.parent}}}return void 0}function tryGetFunctionLikeBodyCompletionContainer(e){if(e){let t;const n=findAncestor(e.parent,(e=>{if(isClassLike(e)){return"quit"}if(isFunctionLikeDeclaration(e)&&t===e.body){return true}t=e;return false}));return n&&n}}function tryGetContainingJsxElement(e){if(e){const t=e.parent;switch(e.kind){case 32:case 31:case 44:case 80:case 211:case 292:case 291:case 293:if(t&&(t.kind===285||t.kind===286)){if(e.kind===32){const r=findPrecedingToken(e.pos,n,void 0);if(!t.typeArguments||r&&r.kind===44)break}return t}else if(t.kind===291){return t.parent.parent}break;case 11:if(t&&(t.kind===291||t.kind===293)){return t.parent.parent}break;case 20:if(t&&t.kind===294&&t.parent&&t.parent.kind===291){return t.parent.parent.parent}if(t&&t.kind===293){return t.parent.parent}break}}return void 0}function isInDifferentLineThanContextToken(e,t){return n.getLineEndOfPosition(e.getEnd())=e.pos;case 25:return n===207;case 59:return n===208;case 23:return n===207;case 21:return n===299||isFunctionLikeButNotConstructor(n);case 19:return n===266;case 30:return n===263||n===231||n===264||n===265||isFunctionLikeKind(n);case 126:return n===172&&!isClassLike(t.parent);case 26:return n===169||!!t.parent&&t.parent.kind===207;case 125:case 123:case 124:return n===169&&!isConstructorDeclaration(t.parent);case 130:return n===276||n===281||n===274;case 139:case 153:return!isFromObjectTypeDeclaration(e);case 80:{if((n===276||n===281)&&e===t.name&&e.text==="type"){return false}const r=findAncestor(e.parent,isVariableDeclaration);if(r&&isInDifferentLineThanContextToken(e,i)){return false}break}case 86:case 94:case 120:case 100:case 115:case 102:case 121:case 87:case 140:return true;case 156:return n!==276;case 42:return isFunctionLike(e.parent)&&!isMethodDeclaration(e.parent)}if(isClassMemberCompletionKeyword(keywordForNode(e))&&isFromObjectTypeDeclaration(e)){return false}if(isConstructorParameterCompletion(e)){if(!isIdentifier(e)||isParameterPropertyModifier(keywordForNode(e))||isCurrentlyEditingNode(e)){return false}}switch(keywordForNode(e)){case 128:case 86:case 87:case 138:case 94:case 100:case 120:case 121:case 123:case 124:case 125:case 126:case 115:return true;case 134:return isPropertyDeclaration(e.parent)}const r=findAncestor(e.parent,isClassLike);if(r&&e===v&&isPreviousPropertyDeclarationTerminated(e,i)){return false}const o=getAncestor(e.parent,172);if(o&&e!==v&&isClassLike(v.parent.parent)&&i<=v.end){if(isPreviousPropertyDeclarationTerminated(e,v.end)){return false}else if(e.kind!==64&&(isInitializedProperty(o)||hasType(o))){return true}}return isDeclarationName(e)&&!isShorthandPropertyAssignment(e.parent)&&!isJsxAttribute(e.parent)&&!((isClassLike(e.parent)||isInterfaceDeclaration(e.parent)||isTypeParameterDeclaration(e.parent))&&(e!==v||i>v.end))}function isPreviousPropertyDeclarationTerminated(e,t){return e.kind!==64&&(e.kind===27||!positionsAreOnSameLine(e.end,t,n))}function isFunctionLikeButNotConstructor(e){return isFunctionLikeKind(e)&&e!==176}function isDotOfNumericLiteral(e){if(e.kind===9){const t=e.getFullText();return t.charAt(t.length-1)==="."}return false}function isVariableDeclarationListButNotTypeArgument(e){return e.parent.kind===261&&!isPossiblyTypeArgumentPosition(e,n,d)}function filterObjectMembersList(e,t){if(t.length===0){return e}const n=new Set;const r=new Set;for(const e of t){if(e.kind!==303&&e.kind!==304&&e.kind!==208&&e.kind!==174&&e.kind!==177&&e.kind!==178&&e.kind!==305){continue}if(isCurrentlyEditingNode(e)){continue}let t;if(isSpreadAssignment(e)){setMembersDeclaredBySpreadAssignment(e,n)}else if(isBindingElement(e)&&e.propertyName){if(e.propertyName.kind===80){t=e.propertyName.escapedText}}else{const n=getNameOfDeclaration(e);t=n&&isPropertyNameLiteral(n)?getEscapedTextOfIdentifierOrLiteral(n):void 0}if(t!==void 0){r.add(t)}}const i=e.filter((e=>!r.has(e.escapedName)));setSortTextToMemberDeclaredBySpreadAssignment(n,i);return i}function setMembersDeclaredBySpreadAssignment(e,t){const n=e.expression;const r=d.getSymbolAtLocation(n);const i=r&&d.getTypeOfSymbolAtLocation(r,n);const o=i&&i.properties;if(o){o.forEach((e=>{t.add(e.name)}))}}function setSortTextToOptionalMember(){W.forEach((e=>{if(e.flags&16777216){const t=getSymbolId(e);V[t]=V[t]??Ef.OptionalMember}}))}function setSortTextToMemberDeclaredBySpreadAssignment(e,t){if(e.size===0){return}for(const n of t){if(e.has(n.name)){V[getSymbolId(n)]=Ef.MemberDeclaredBySpreadAssignment}}}function transformObjectLiteralMembersSortText(e){for(let t=e;t!r.has(e.escapedName)&&!!e.declarations&&!(getDeclarationModifierFlagsFromSymbol(e)&2)&&!(e.valueDeclaration&&isPrivateIdentifierClassElementDeclaration(e.valueDeclaration))))}function filterJsxAttributes(e,t){const n=new Set;const r=new Set;for(const e of t){if(isCurrentlyEditingNode(e)){continue}if(e.kind===291){n.add(getEscapedTextOfJsxAttributeName(e.name))}else if(isJsxSpreadAttribute(e)){setMembersDeclaredBySpreadAssignment(e,r)}}const i=e.filter((e=>!n.has(e.escapedName)));setSortTextToMemberDeclaredBySpreadAssignment(r,i);return i}function isCurrentlyEditingNode(e){return e.getStart(n)<=i&&i<=e.getEnd()}}function tryGetObjectLikeCompletionContainer(e,t,n){var r;if(e){const{parent:i}=e;switch(e.kind){case 19:case 28:if(isObjectLiteralExpression(i)||isObjectBindingPattern(i)){return i}break;case 42:return isMethodDeclaration(i)?tryCast(i.parent,isObjectLiteralExpression):void 0;case 134:return tryCast(i.parent,isObjectLiteralExpression);case 80:if(e.text==="async"&&isShorthandPropertyAssignment(e.parent)){return e.parent.parent}else{if(isObjectLiteralExpression(e.parent.parent)&&(isSpreadAssignment(e.parent)||isShorthandPropertyAssignment(e.parent)&&getLineAndCharacterOfPosition(n,e.getEnd()).line!==getLineAndCharacterOfPosition(n,t).line)){return e.parent.parent}const r=findAncestor(i,isPropertyAssignment);if((r==null?void 0:r.getLastToken(n))===e&&isObjectLiteralExpression(r.parent)){return r.parent}}break;default:if(((r=i.parent)==null?void 0:r.parent)&&(isMethodDeclaration(i.parent)||isGetAccessorDeclaration(i.parent)||isSetAccessorDeclaration(i.parent))&&isObjectLiteralExpression(i.parent.parent)){return i.parent.parent}if(isSpreadAssignment(i)&&isObjectLiteralExpression(i.parent)){return i.parent}const o=findAncestor(i,isPropertyAssignment);if(e.kind!==59&&(o==null?void 0:o.getLastToken(n))===e&&isObjectLiteralExpression(o.parent)){return o.parent}}}return void 0}function getRelevantTokens(e,t){const n=findPrecedingToken(e,t);if(n&&e<=n.end&&(isMemberName(n)||isKeyword(n.kind))){const e=findPrecedingToken(n.getFullStart(),t,void 0);return{contextToken:e,previousToken:n}}return{contextToken:n,previousToken:n}}function getAutoImportSymbolFromCompletionEntryData(e,t,n,r){const i=t.isPackageJsonImport?r.getPackageJsonAutoImportProvider():n;const o=i.getTypeChecker();const a=t.ambientModuleName?o.tryFindAmbientModule(t.ambientModuleName):t.fileName?o.getMergedSymbol(S.checkDefined(i.getSourceFile(t.fileName)).symbol):void 0;if(!a)return void 0;let s=t.exportName==="export="?o.resolveExternalModuleSymbol(a):o.tryGetMemberInModuleExportsAndProperties(t.exportName,a);if(!s)return void 0;const c=t.exportName==="default";s=c&&getLocalSymbolForExportDefault(s)||s;return{symbol:s,origin:completionEntryDataToSymbolOriginInfo(t,e,a)}}function getCompletionEntryDisplayNameForSymbol(e,t,n,r,i){if(originIsIgnore(n)){return void 0}const o=originIncludesSymbolName(n)?n.symbolName:e.name;if(o===void 0||e.flags&1536&&isSingleOrDoubleQuote(o.charCodeAt(0))||isKnownSymbol(e)){return void 0}const a={name:o,needsConvertPropertyAccess:false};if(isIdentifierText(o,t,i?1:0)||e.valueDeclaration&&isPrivateIdentifierClassElementDeclaration(e.valueDeclaration)){return a}if(e.flags&2097152){return{name:o,needsConvertPropertyAccess:true}}switch(r){case 3:return originIsComputedPropertyName(n)?{name:n.symbolName,needsConvertPropertyAccess:false}:void 0;case 0:return{name:JSON.stringify(o),needsConvertPropertyAccess:false};case 2:case 1:return o.charCodeAt(0)===32?void 0:{name:o,needsConvertPropertyAccess:true};case 5:case 4:return a;default:S.assertNever(r)}}var If=[];var Af=memoize((()=>{const e=[];for(let t=83;t<=165;t++){e.push({name:tokenToString(t),kind:"keyword",kindModifiers:"",sortText:Ef.GlobalsOrKeywords})}return e}));function getKeywordCompletions(e,t){if(!t)return getTypescriptKeywordCompletions(e);const n=e+8+1;return If[n]||(If[n]=getTypescriptKeywordCompletions(e).filter((e=>!isTypeScriptOnlyKeyword(stringToToken(e.name)))))}function getTypescriptKeywordCompletions(e){return If[e]||(If[e]=Af().filter((t=>{const n=stringToToken(t.name);switch(e){case 0:return false;case 1:return isFunctionLikeBodyKeyword(n)||n===138||n===144||n===156||n===145||n===128||isTypeKeyword(n)&&n!==157;case 5:return isFunctionLikeBodyKeyword(n);case 2:return isClassMemberCompletionKeyword(n);case 3:return isInterfaceOrTypeLiteralCompletionKeyword(n);case 4:return isParameterPropertyModifier(n);case 6:return isTypeKeyword(n)||n===87;case 7:return isTypeKeyword(n);case 8:return n===156;default:return S.assertNever(e)}})))}function isTypeScriptOnlyKeyword(e){switch(e){case 128:case 133:case 163:case 136:case 138:case 94:case 162:case 119:case 140:case 120:case 142:case 143:case 144:case 145:case 146:case 150:case 151:case 164:case 123:case 124:case 125:case 148:case 154:case 155:case 156:case 158:case 159:return true;default:return false}}function isInterfaceOrTypeLiteralCompletionKeyword(e){return e===148}function isClassMemberCompletionKeyword(e){switch(e){case 128:case 129:case 137:case 139:case 153:case 134:case 138:case 164:return true;default:return isClassMemberModifier(e)}}function isFunctionLikeBodyKeyword(e){return e===134||e===135||e===160||e===130||e===152||e===156||!isContextualKeyword(e)&&!isClassMemberCompletionKeyword(e)}function keywordForNode(e){return isIdentifier(e)?identifierToKeywordKind(e)??0:e.kind}function getContextualKeywords(e,t){const n=[];if(e){const r=e.getSourceFile();const i=e.parent;const o=r.getLineAndCharacterOfPosition(e.end).line;const a=r.getLineAndCharacterOfPosition(t).line;if((isImportDeclaration(i)||isExportDeclaration(i)&&i.moduleSpecifier)&&e===i.moduleSpecifier&&o===a){n.push({name:tokenToString(132),kind:"keyword",kindModifiers:"",sortText:Ef.GlobalsOrKeywords})}}return n}function getJsDocTagAtPosition(e,t){return findAncestor(e,(e=>isJSDocTag(e)&&rangeContainsPosition(e,t)?true:isJSDoc(e)?"quit":false))}function getPropertiesForObjectExpression(e,t,n,r){const i=t&&t!==e;const o=r.getUnionType(filter(e.flags&1048576?e.types:[e],(e=>!r.getPromisedTypeOfPromise(e))));const a=i&&!(t.flags&3)?r.getUnionType([o,t]):o;const s=getApparentProperties(a,n,r);return a.isClass()&&containsNonPublicProperties(s)?[]:i?filter(s,hasDeclarationOtherThanSelf):s;function hasDeclarationOtherThanSelf(e){if(!length(e.declarations))return true;return some(e.declarations,(e=>e.parent!==n))}}function getApparentProperties(e,t,n){if(!e.isUnion())return e.getApparentProperties();return n.getAllPossiblePropertiesOfTypes(filter(e.types,(e=>!(e.flags&402784252||n.isArrayLikeType(e)||n.isTypeInvalidDueToUnionDiscriminant(e,t)||n.typeHasCallOrConstructSignatures(e)||e.isClass()&&containsNonPublicProperties(e.getApparentProperties())))))}function containsNonPublicProperties(e){return some(e,(e=>!!(getDeclarationModifierFlagsFromSymbol(e)&6)))}function getPropertiesForCompletion(e,t){return e.isUnion()?S.checkEachDefined(t.getAllPossiblePropertiesOfTypes(e.types),"getAllPossiblePropertiesOfTypes() should all be defined"):S.checkEachDefined(e.getApparentProperties(),"getApparentProperties() should all be defined")}function tryGetObjectTypeDeclarationCompletionContainer(e,t,n,r){switch(n.kind){case 352:return tryCast(n.parent,isObjectTypeDeclaration);case 1:const t=tryCast(lastOrUndefined(cast(n.parent,isSourceFile).statements),isObjectTypeDeclaration);if(t&&!findChildOfKind(t,20,e)){return t}break;case 81:if(tryCast(n.parent,isPropertyDeclaration)){return findAncestor(n,isClassLike)}break;case 80:{const e=identifierToKeywordKind(n);if(e){return void 0}if(isPropertyDeclaration(n.parent)&&n.parent.initializer===n){return void 0}if(isFromObjectTypeDeclaration(n)){return findAncestor(n,isObjectTypeDeclaration)}}}if(!t)return void 0;if(n.kind===137||isIdentifier(t)&&isPropertyDeclaration(t.parent)&&isClassLike(n)){return findAncestor(t,isClassLike)}switch(t.kind){case 64:return void 0;case 27:case 20:return isFromObjectTypeDeclaration(n)&&n.parent.name===n?n.parent.parent:tryCast(n,isObjectTypeDeclaration);case 19:case 28:return tryCast(t.parent,isObjectTypeDeclaration);default:if(isObjectTypeDeclaration(n)){if(getLineAndCharacterOfPosition(e,t.getEnd()).line!==getLineAndCharacterOfPosition(e,r).line){return n}const i=isClassLike(t.parent.parent)?isClassMemberCompletionKeyword:isInterfaceOrTypeLiteralCompletionKeyword;return i(t.kind)||t.kind===42||isIdentifier(t)&&i(identifierToKeywordKind(t)??0)?t.parent.parent:void 0}return void 0}}function tryGetTypeLiteralNode(e){if(!e)return void 0;const t=e.parent;switch(e.kind){case 19:if(isTypeLiteralNode(t)){return t}break;case 27:case 28:case 80:if(t.kind===171&&isTypeLiteralNode(t.parent)){return t.parent}break}return void 0}function getConstraintOfTypeArgumentProperty(e,t){if(!e)return void 0;if(isTypeNode(e)&&isTypeReferenceType(e.parent)){return t.getTypeArgumentConstraint(e)}const n=getConstraintOfTypeArgumentProperty(e.parent,t);if(!n)return void 0;switch(e.kind){case 171:return t.getTypeOfPropertyOfContextualType(n,e.symbol.escapedName);case 193:case 187:case 192:return n}}function isFromObjectTypeDeclaration(e){return e.parent&&isClassOrTypeElement(e.parent)&&isObjectTypeDeclaration(e.parent.parent)}function isValidTrigger(e,t,n,r){switch(t){case".":case"@":return true;case'"':case"'":case"`":return!!n&&isStringLiteralOrTemplate(n)&&r===n.getStart(e)+1;case"#":return!!n&&isPrivateIdentifier(n)&&!!getContainingClass(n);case"<":return!!n&&n.kind===30&&(!isBinaryExpression(n.parent)||binaryExpressionMayBeOpenTag(n.parent));case"/":return!!n&&(isStringLiteralLike(n)?!!tryGetImportFromModuleSpecifier(n):n.kind===44&&isJsxClosingElement(n.parent));case" ":return!!n&&isImportKeyword(n)&&n.parent.kind===307;default:return S.assertNever(t)}}function binaryExpressionMayBeOpenTag({left:e}){return nodeIsMissing(e)}function isProbablyGlobalType(e,t,n){const r=n.resolveName("self",void 0,111551,false);if(r&&n.getTypeOfSymbolAtLocation(r,t)===e){return true}const i=n.resolveName("global",void 0,111551,false);if(i&&n.getTypeOfSymbolAtLocation(i,t)===e){return true}const o=n.resolveName("globalThis",void 0,111551,false);if(o&&n.getTypeOfSymbolAtLocation(o,t)===e){return true}return false}function isStaticProperty(e){return!!(e.valueDeclaration&&getEffectiveModifierFlags(e.valueDeclaration)&256&&isClassLike(e.valueDeclaration.parent))}function tryGetObjectLiteralContextualType(e,t){const n=t.getContextualType(e);if(n){return n}const r=walkUpParenthesizedExpressions(e.parent);if(isBinaryExpression(r)&&r.operatorToken.kind===64&&e===r.left){return t.getTypeAtLocation(r)}if(isExpression(r)){return t.getContextualType(r)}return void 0}function getImportStatementCompletionInfo(e,t){var n,r,i;let o;let a=false;const s=getCandidate();return{isKeywordOnlyCompletion:a,keywordCompletion:o,isNewIdentifierLocation:!!(s||o===156),isTopLevelTypeOnly:!!((r=(n=tryCast(s,isImportDeclaration))==null?void 0:n.importClause)==null?void 0:r.isTypeOnly)||!!((i=tryCast(s,isImportEqualsDeclaration))==null?void 0:i.isTypeOnly),couldBeTypeOnlyImportSpecifier:!!s&&couldBeTypeOnlyImportSpecifier(s,e),replacementSpan:getSingleLineReplacementSpanForImportCompletionNode(s)};function getCandidate(){const n=e.parent;if(isImportEqualsDeclaration(n)){const r=n.getLastToken(t);if(isIdentifier(e)&&r!==e){o=161;a=true;return void 0}o=e.kind===156?void 0:156;return isModuleSpecifierMissingOrEmpty(n.moduleReference)?n:void 0}if(couldBeTypeOnlyImportSpecifier(n,e)&&canCompleteFromNamedBindings(n.parent)){return n}if(isNamedImports(n)||isNamespaceImport(n)){if(!n.parent.isTypeOnly&&(e.kind===19||e.kind===102||e.kind===28)){o=156}if(canCompleteFromNamedBindings(n)){if(e.kind===20||e.kind===80){a=true;o=161}else{return n.parent.parent}}return void 0}if(isExportDeclaration(n)&&e.kind===42||isNamedExports(n)&&e.kind===20){a=true;o=161;return void 0}if(isImportKeyword(e)&&isSourceFile(n)){o=156;return e}if(isImportKeyword(e)&&isImportDeclaration(n)){o=156;return isModuleSpecifierMissingOrEmpty(n.moduleSpecifier)?n:void 0}return void 0}}function getSingleLineReplacementSpanForImportCompletionNode(e){var t;if(!e)return void 0;const n=findAncestor(e,or(isImportDeclaration,isImportEqualsDeclaration,isJSDocImportTag))??e;const r=n.getSourceFile();if(rangeIsOnSingleLine(n,r)){return createTextSpanFromNode(n,r)}S.assert(n.kind!==102&&n.kind!==276);const i=n.kind===272||n.kind===351?getPotentiallyInvalidImportSpecifier((t=n.importClause)==null?void 0:t.namedBindings)??n.moduleSpecifier:n.moduleReference;const o={pos:n.getFirstToken().getStart(),end:i.pos};if(rangeIsOnSingleLine(o,r)){return createTextSpanFromRange(o)}}function getPotentiallyInvalidImportSpecifier(e){var t;return find((t=tryCast(e,isNamedImports))==null?void 0:t.elements,(t=>{var n;return!t.propertyName&&isStringANonContextualKeyword(t.name.text)&&((n=findPrecedingToken(t.name.pos,e.getSourceFile(),e))==null?void 0:n.kind)!==28}))}function couldBeTypeOnlyImportSpecifier(e,t){return isImportSpecifier(e)&&(e.isTypeOnly||t===e.name&&isTypeKeywordTokenOrIdentifier(t))}function canCompleteFromNamedBindings(e){if(!isModuleSpecifierMissingOrEmpty(e.parent.parent.moduleSpecifier)||e.parent.name){return false}if(isNamedImports(e)){const t=getPotentiallyInvalidImportSpecifier(e);const n=t?e.elements.indexOf(t):e.elements.length;return n<2}return true}function isModuleSpecifierMissingOrEmpty(e){var t;if(nodeIsMissing(e))return true;return!((t=tryCast(isExternalModuleReference(e)?e.expression:e,isStringLiteralLike))==null?void 0:t.text)}function getClosestSymbolDeclaration(e,t){if(!e)return;let n=findAncestor(e,(e=>isFunctionBlock(e)||isArrowFunctionBody(e)||isBindingPattern(e)?"quit":(isParameter(e)||isTypeParameterDeclaration(e))&&!isIndexSignatureDeclaration(e.parent)));if(!n){n=findAncestor(t,(e=>isFunctionBlock(e)||isArrowFunctionBody(e)||isBindingPattern(e)?"quit":isVariableDeclaration(e)))}return n}function isInTypeParameterDefault(e){if(!e){return false}let t=e;let n=e.parent;while(n){if(isTypeParameterDeclaration(n)){return n.default===t||t.kind===64}t=n;n=n.parent}return false}function isArrowFunctionBody(e){return e.parent&&isArrowFunction(e.parent)&&(e.parent.body===e||e.kind===39)}function symbolCanBeReferencedAtTypeLocation(e,t,n=new Set){return nonAliasCanBeReferencedAtTypeLocation(e)||nonAliasCanBeReferencedAtTypeLocation(skipAlias(e.exportSymbol||e,t));function nonAliasCanBeReferencedAtTypeLocation(e){return!!(e.flags&788968)||t.isUnknownSymbol(e)||!!(e.flags&1536)&&addToSeen(n,e)&&t.getExportsOfModule(e).some((e=>symbolCanBeReferencedAtTypeLocation(e,t,n)))}}function isDeprecated(e,t){const n=skipAlias(e,t).declarations;return!!length(n)&&every(n,isDeprecatedDeclaration)}function charactersFuzzyMatchInString(e,t){if(t.length===0){return true}let n=false;let r;let i=0;const o=e.length;for(let a=0;agetStringLiteralCompletionDetails,getStringLiteralCompletions:()=>getStringLiteralCompletions});var wf={["directory"]:0,["script"]:1,["external module name"]:2};function createNameAndKindSet(){const e=new Map;function add(t){const n=e.get(t.name);if(!n||wf[n.kind]({name:escapeString(e.value,n),kindModifiers:"",kind:"string",sortText:Ef.LocationPriority,replacementSpan:getReplacementSpanForContextToken(t,c),commitCharacters:[]})));return{isGlobalCompletion:false,isMemberCompletion:false,isNewIdentifierLocation:e.isNewIdentifier,optionalReplacementSpan:d,entries:r,defaultCommitCharacters:getDefaultCommitCharacters(e.isNewIdentifier)}}default:return S.assertNever(e)}}function getStringLiteralCompletionDetails(e,t,n,r,i,o,a,s){if(!r||!isStringLiteralLike(r))return void 0;const c=getStringLiteralCompletionEntries(t,r,n,i,o,s);return c&&stringLiteralCompletionDetails(e,r,c,t,i.getTypeChecker(),a)}function stringLiteralCompletionDetails(e,t,n,r,i,o){switch(n.kind){case 0:{const t=find(n.paths,(t=>t.name===e));return t&&createCompletionDetails(e,kindModifiersFromExtension(t.extension),t.kind,[textPart(e)])}case 1:{const a=find(n.symbols,(t=>t.name===e));return a&&createCompletionDetailsForSymbol(a,a.name,i,r,t,o)}case 2:return find(n.types,(t=>t.value===e))?createCompletionDetails(e,"","string",[textPart(e)]):void 0;default:return S.assertNever(n)}}function convertPathCompletions(e){const t=false;const n=true;const r=e.map((({name:e,kind:t,span:n,extension:r})=>({name:e,kind:t,kindModifiers:kindModifiersFromExtension(r),sortText:Ef.LocationPriority,replacementSpan:n})));return{isGlobalCompletion:t,isMemberCompletion:false,isNewIdentifierLocation:n,entries:r,defaultCommitCharacters:getDefaultCommitCharacters(n)}}function kindModifiersFromExtension(e){switch(e){case".d.ts":return".d.ts";case".js":return".js";case".json":return".json";case".jsx":return".jsx";case".ts":return".ts";case".tsx":return".tsx";case".d.mts":return".d.mts";case".mjs":return".mjs";case".mts":return".mts";case".d.cts":return".d.cts";case".cjs":return".cjs";case".cts":return".cts";case".tsbuildinfo":return S.fail(`Extension ${".tsbuildinfo"} is unsupported.`);case void 0:return"";default:return S.assertNever(e)}}function getStringLiteralCompletionEntries(e,t,n,r,i,o){const a=r.getTypeChecker();const s=walkUpParentheses(t.parent);switch(s.kind){case 201:{const n=walkUpParentheses(s.parent);if(n.kind===205){return{kind:0,paths:getStringLiteralCompletionsFromModuleNames(e,t,r,i,o)}}return fromUnionableLiteralType(n)}case 303:if(isObjectLiteralExpression(s.parent)&&s.name===t){return stringLiteralCompletionsForObjectLiteral(a,s.parent)}return fromContextualType()||fromContextualType(0);case 212:{const{expression:e,argumentExpression:n}=s;if(t===skipParentheses(n)){return stringLiteralCompletionsFromProperties(a.getTypeAtLocation(e))}return void 0}case 213:case 214:case 291:if(!isRequireCallArgument(t)&&!isImportCall(s)){const r=rm.getArgumentInfoForCompletions(s.kind===291?s.parent:t,n,e,a);return r&&getStringLiteralCompletionsFromSignature(r.invocation,t,r,a)||fromContextualType(0)}case 272:case 278:case 283:case 351:return{kind:0,paths:getStringLiteralCompletionsFromModuleNames(e,t,r,i,o)};case 296:const c=newCaseClauseTracker(a,s.parent.clauses);const l=fromContextualType();if(!l){return}const d=l.types.filter((e=>!c.hasValue(e.value)));return{kind:2,types:d,isNewIdentifier:false};case 276:case 281:const p=s;if(p.propertyName&&t!==p.propertyName){return}const u=p.parent;const{moduleSpecifier:f}=u.kind===275?u.parent.parent:u.parent;if(!f)return;const m=a.getSymbolAtLocation(f);if(!m)return;const _=a.getExportsAndPropertiesOfModule(m);const g=new Set(u.elements.map((e=>moduleExportNameTextEscaped(e.propertyName||e.name))));const y=_.filter((e=>e.escapedName!=="default"&&!g.has(e.escapedName)));return{kind:1,symbols:y,hasIndexSignature:false};default:return fromContextualType()||fromContextualType(0)}function fromUnionableLiteralType(e){switch(e.kind){case 233:case 183:{const t=findAncestor(s,(t=>t.parent===e));if(t){return{kind:2,types:getStringLiteralTypes(a.getTypeArgumentConstraint(t)),isNewIdentifier:false}}return void 0}case 199:const{indexType:t,objectType:r}=e;if(!rangeContainsPosition(t,n)){return void 0}return stringLiteralCompletionsFromProperties(a.getTypeFromTypeNode(r));case 192:{const t=fromUnionableLiteralType(walkUpParentheses(e.parent));if(!t){return void 0}const n=getAlreadyUsedTypesInStringLiteralUnion(e,s);if(t.kind===1){return{kind:1,symbols:t.symbols.filter((e=>!contains(n,e.name))),hasIndexSignature:t.hasIndexSignature}}return{kind:2,types:t.types.filter((e=>!contains(n,e.value))),isNewIdentifier:false}}default:return void 0}}function fromContextualType(e=4){const n=getStringLiteralTypes(getContextualTypeFromParent(t,a,e));if(!n.length){return}return{kind:2,types:n,isNewIdentifier:false}}}function walkUpParentheses(e){switch(e.kind){case 196:return walkUpParenthesizedTypes(e);case 217:return walkUpParenthesizedExpressions(e);default:return e}}function getAlreadyUsedTypesInStringLiteralUnion(e,t){return mapDefined(e.types,(e=>e!==t&&isLiteralTypeNode(e)&&isStringLiteral(e.literal)?e.literal.text:void 0))}function getStringLiteralCompletionsFromSignature(e,t,n,r){let i=false;const o=new Set;const a=isJsxOpeningLikeElement(e)?S.checkDefined(findAncestor(t.parent,isJsxAttribute)):t;const s=r.getCandidateSignaturesForStringLiteralCompletions(e,a);const c=flatMap(s,(t=>{if(!signatureHasRestParameter(t)&&n.argumentCount>t.parameters.length)return;let s=t.getTypeParameterAtPosition(n.argumentIndex);if(isJsxOpeningLikeElement(e)){const e=r.getTypeOfPropertyOfType(s,getTextOfJsxAttributeName(a.name));if(e){s=e}}i=i||!!(s.flags&4);return getStringLiteralTypes(s,o)}));return length(c)?{kind:2,types:c,isNewIdentifier:i}:void 0}function stringLiteralCompletionsFromProperties(e){return e&&{kind:1,symbols:filter(e.getApparentProperties(),(e=>!(e.valueDeclaration&&isPrivateIdentifierClassElementDeclaration(e.valueDeclaration)))),hasIndexSignature:hasIndexSignature(e)}}function stringLiteralCompletionsForObjectLiteral(e,t){const n=e.getContextualType(t);if(!n)return void 0;const r=e.getContextualType(t,4);const i=getPropertiesForObjectExpression(n,r,t,e);return{kind:1,symbols:i,hasIndexSignature:hasIndexSignature(n)}}function getStringLiteralTypes(e,t=new Set){if(!e)return d;e=skipConstraint(e);return e.isUnion()?flatMap(e.types,(e=>getStringLiteralTypes(e,t))):e.isStringLiteral()&&!(e.flags&1024)&&addToSeen(t,e.value)?[e]:d}function nameAndKind(e,t,n){return{name:e,kind:t,extension:n}}function directoryResult(e){return nameAndKind(e,"directory",void 0)}function addReplacementSpans(e,t,n){const r=getDirectoryFragmentTextSpan(e,t);const i=e.length===0?void 0:createTextSpan(t,e.length);return n.map((({name:e,kind:t,extension:n})=>e.includes(Pt)||e.includes(Dt)?{name:e,kind:t,extension:n,span:i}:{name:e,kind:t,extension:n,span:r}))}function getStringLiteralCompletionsFromModuleNames(e,t,n,r,i){return addReplacementSpans(t.text,t.getStart(e)+1,getStringLiteralCompletionsFromModuleNamesWorker(e,t,n,r,i))}function getStringLiteralCompletionsFromModuleNamesWorker(e,t,n,r,i){const o=normalizeSlashes(t.text);const a=isStringLiteralLike(t)?n.getModeForUsageLocation(e,t):void 0;const s=e.path;const c=getDirectoryPath(s);const l=n.getCompilerOptions();const d=n.getTypeChecker();const p=createModuleSpecifierResolutionHost(n,r);const u=getExtensionOptions(l,1,e,d,i,a);return isPathRelativeToScript(o)||!l.baseUrl&&!l.paths&&(isRootedDiskPath(o)||isUrl(o))?getCompletionEntriesForRelativeModules(o,c,n,r,p,s,u):getCompletionEntriesForNonRelativeModules(o,c,a,n,r,p,u)}function getExtensionOptions(e,t,n,r,i,o){return{extensionsToSearch:flatten(getSupportedExtensionsForModuleResolution(e,r)),referenceKind:t,importingSourceFile:n,endingPreference:i==null?void 0:i.importModuleSpecifierEnding,resolutionMode:o}}function getCompletionEntriesForRelativeModules(e,t,n,r,i,o,a){const s=n.getCompilerOptions();if(s.rootDirs){return getCompletionEntriesForDirectoryFragmentWithRootDirs(s.rootDirs,e,t,a,n,r,i,o)}else{return arrayFrom(getCompletionEntriesForDirectoryFragment(e,t,a,n,r,i,true,o).values())}}function getSupportedExtensionsForModuleResolution(e,t){const n=!t?[]:mapDefined(t.getAmbientModules(),(e=>{const t=e.name.slice(1,-1);if(!t.startsWith("*.")||t.includes("/"))return;return t.slice(1)}));const r=[...getSupportedExtensions(e),n];const i=qn(e);return moduleResolutionUsesNodeModules(i)?getSupportedExtensionsWithJsonIfResolveJsonModule(e,r):r}function getBaseDirectoriesFromRootDirs(e,t,n,r){e=e.map((e=>ensureTrailingDirectorySeparator(normalizePath(isRootedDiskPath(e)?e:combinePaths(t,e)))));const i=firstDefined(e,(e=>containsPath(e,n,t,r)?n.substr(e.length):void 0));return deduplicate([...e.map((e=>combinePaths(e,i))),n].map((e=>removeTrailingDirectorySeparator(e))),equateStringsCaseSensitive,compareStringsCaseSensitive)}function getCompletionEntriesForDirectoryFragmentWithRootDirs(e,t,n,r,i,o,a,s){const c=i.getCompilerOptions();const l=c.project||o.getCurrentDirectory();const d=!(o.useCaseSensitiveFileNames&&o.useCaseSensitiveFileNames());const p=getBaseDirectoriesFromRootDirs(e,l,n,d);return deduplicate(flatMap(p,(e=>arrayFrom(getCompletionEntriesForDirectoryFragment(t,e,r,i,o,a,true,s).values()))),((e,t)=>e.name===t.name&&e.kind===t.kind&&e.extension===t.extension))}function getCompletionEntriesForDirectoryFragment(e,t,n,r,i,o,a,s,c=createNameAndKindSet()){var l;if(e===void 0){e=""}e=normalizeSlashes(e);if(!hasTrailingDirectorySeparator(e)){e=getDirectoryPath(e)}if(e===""){e="."+Pt}e=ensureTrailingDirectorySeparator(e);const d=resolvePath(t,e);const p=hasTrailingDirectorySeparator(d)?d:getDirectoryPath(d);if(!a){const e=findPackageJson(p,i);if(e){const t=readJson(e,i);const a=t.typesVersions;if(typeof a==="object"){const t=(l=getPackageJsonTypesVersionsPaths(a))==null?void 0:l.paths;if(t){const a=getDirectoryPath(e);const s=d.slice(ensureTrailingDirectorySeparator(a).length);if(addCompletionEntriesFromPaths(c,s,a,n,r,i,o,t)){return c}}}}}const u=!(i.useCaseSensitiveFileNames&&i.useCaseSensitiveFileNames());if(!tryDirectoryExists(i,p))return c;const f=tryReadDirectory(i,p,n.extensionsToSearch,void 0,["./*"]);if(f){for(let e of f){e=normalizePath(e);if(s&&comparePaths(e,s,t,u)===0){continue}const{name:i,extension:o}=getFilenameWithExtensionOption(getBaseFileName(e),r,n,false);c.add(nameAndKind(i,"script",o))}}const m=tryGetDirectories(i,p);if(m){for(const e of m){const t=getBaseFileName(normalizePath(e));if(t!=="@types"){c.add(directoryResult(t))}}}return c}function getFilenameWithExtensionOption(e,t,n,r){const i=Ho.tryGetRealFileNameForNonJsDeclarationFileName(e);if(i){return{name:i,extension:tryGetExtensionFromPath2(i)}}if(n.referenceKind===0){return{name:e,extension:tryGetExtensionFromPath2(e)}}let o=Ho.getModuleSpecifierPreferences({importModuleSpecifierEnding:n.endingPreference},t,t.getCompilerOptions(),n.importingSourceFile).getAllowedEndingsInPreferredOrder(n.resolutionMode);if(r){o=o.filter((e=>e!==0&&e!==1))}if(o[0]===3){if(fileExtensionIsOneOf(e,br)){return{name:e,extension:tryGetExtensionFromPath2(e)}}const n=Ho.tryGetJSExtensionForFile(e,t.getCompilerOptions());return n?{name:changeExtension(e,n),extension:n}:{name:e,extension:tryGetExtensionFromPath2(e)}}if(!r&&(o[0]===0||o[0]===1)&&fileExtensionIsOneOf(e,[".js",".jsx",".ts",".tsx",".d.ts"])){return{name:removeFileExtension(e),extension:tryGetExtensionFromPath2(e)}}const a=Ho.tryGetJSExtensionForFile(e,t.getCompilerOptions());return a?{name:changeExtension(e,a),extension:a}:{name:e,extension:tryGetExtensionFromPath2(e)}}function addCompletionEntriesFromPaths(e,t,n,r,i,o,a,s){const getPatternsForKey=e=>s[e];const comparePaths2=(e,t)=>{const n=tryParsePattern(e);const r=tryParsePattern(t);const i=typeof n==="object"?n.prefix.length:e.length;const o=typeof r==="object"?r.prefix.length:t.length;return compareValues(o,i)};return addCompletionEntriesFromPathsOrExportsOrImports(e,false,false,t,n,r,i,o,a,getOwnKeys(s),getPatternsForKey,comparePaths2)}function addCompletionEntriesFromPathsOrExportsOrImports(e,t,n,r,i,o,a,s,c,l,d,p){let u=[];let f;for(const e of l){if(e===".")continue;const l=e.replace(/^\.\//,"")+((t||n)&&endsWith(e,"/")?"*":"");const m=d(e);if(m){const e=tryParsePattern(l);if(!e)continue;const d=typeof e==="object"&&isPatternMatch(e,r);const _=d&&(f===void 0||p(l,f)===-1);if(_){f=l;u=u.filter((e=>!e.matchedPattern))}if(typeof e==="string"||f===void 0||p(l,f)!==1){u.push({matchedPattern:d,results:getCompletionsForPathMapping(l,m,r,i,o,t,n,a,s,c).map((({name:e,kind:t,extension:n})=>nameAndKind(e,t,n)))})}}}u.forEach((t=>t.results.forEach((t=>e.add(t)))));return f!==void 0}function getCompletionEntriesForNonRelativeModules(e,t,n,r,i,o,a){const s=r.getTypeChecker();const c=r.getCompilerOptions();const{baseUrl:l,paths:d}=c;const p=createNameAndKindSet();const u=qn(c);if(l){const t=normalizePath(combinePaths(i.getCurrentDirectory(),l));getCompletionEntriesForDirectoryFragment(e,t,a,r,i,o,false,void 0,p)}if(d){const t=getPathsBasePath(c,i);addCompletionEntriesFromPaths(p,e,t,a,r,i,o,d)}const f=getFragmentDirectory(e);for(const t of getAmbientModuleCompletions(e,f,s)){p.add(nameAndKind(t,"external module name",void 0))}getCompletionEntriesFromTypings(r,i,o,t,f,a,p);if(moduleResolutionUsesNodeModules(u)){let n=false;if(f===void 0){for(const e of enumerateNodeModulesVisibleToScript(i,t)){const t=nameAndKind(e,"external module name",void 0);if(!p.has(t.name)){n=true;p.add(t)}}}if(!n){const n=Qn(c);const s=Xn(c);let l=false;const importsLookup=t=>{if(s&&!l){const n=combinePaths(t,"package.json");if(l=tryFileExists(i,n)){const r=readJson(n,i);exportsOrImportsLookup(r.imports,e,t,false,true)}}};let ancestorLookup=t=>{const n=combinePaths(t,"node_modules");if(tryDirectoryExists(i,n)){getCompletionEntriesForDirectoryFragment(e,n,a,r,i,o,false,void 0,p)}importsLookup(t)};if(f&&n){const t=ancestorLookup;ancestorLookup=n=>{const r=getPathComponents(e);r.shift();let o=r.shift();if(!o){return t(n)}if(startsWith(o,"@")){const e=r.shift();if(!e){return t(n)}o=combinePaths(o,e)}if(s&&startsWith(o,"#")){return importsLookup(n)}const a=combinePaths(n,"node_modules",o);const c=combinePaths(a,"package.json");if(tryFileExists(i,c)){const t=readJson(c,i);const n=r.join("/")+(r.length&&hasTrailingDirectorySeparator(e)?"/":"");exportsOrImportsLookup(t.exports,n,a,true,false);return}return t(n)}}forEachAncestorDirectoryStoppingAtGlobalCache(i,t,ancestorLookup)}}return arrayFrom(p.values());function exportsOrImportsLookup(e,t,s,l,d){if(typeof e!=="object"||e===null){return}const u=getOwnKeys(e);const f=getConditions(c,n);addCompletionEntriesFromPathsOrExportsOrImports(p,l,d,t,s,a,r,i,o,u,(t=>{const n=getPatternFromFirstMatchingCondition(e[t],f);if(n===void 0){return void 0}return singleElementArray(endsWith(t,"/")&&endsWith(n,"/")?n+"*":n)}),comparePatternKeys)}}function getPatternFromFirstMatchingCondition(e,t){if(typeof e==="string"){return e}if(e&&typeof e==="object"&&!isArray(e)){for(const n in e){if(n==="default"||t.includes(n)||isApplicableVersionedTypesKey(t,n)){const r=e[n];return getPatternFromFirstMatchingCondition(r,t)}}}}function getFragmentDirectory(e){return containsSlash(e)?hasTrailingDirectorySeparator(e)?e:getDirectoryPath(e):void 0}function getCompletionsForPathMapping(e,t,n,r,i,o,a,s,c,l){const p=tryParsePattern(e);if(!p){return d}if(typeof p==="string"){return justPathMappingName(e,"script")}const u=tryRemovePrefix(n,p.prefix);if(u===void 0){const n=endsWith(e,"/*");return n?justPathMappingName(p.prefix,"directory"):flatMap(t,(e=>{var t;return(t=getModulesForPathsPattern("",r,e,i,o,a,s,c,l))==null?void 0:t.map((({name:e,...t})=>({name:p.prefix+e+p.suffix,...t})))}))}return flatMap(t,(e=>getModulesForPathsPattern(u,r,e,i,o,a,s,c,l)));function justPathMappingName(e,t){return startsWith(e,n)?[{name:removeTrailingDirectorySeparator(e),kind:t,extension:void 0}]:d}}function getModulesForPathsPattern(e,t,n,r,i,o,a,s,c){if(!s.readDirectory){return void 0}const l=tryParsePattern(n);if(l===void 0||isString(l)){return void 0}const d=resolvePath(l.prefix);const p=hasTrailingDirectorySeparator(l.prefix)?d:getDirectoryPath(d);const u=hasTrailingDirectorySeparator(l.prefix)?"":getBaseFileName(d);const f=containsSlash(e);const m=f?hasTrailingDirectorySeparator(e)?e:getDirectoryPath(e):void 0;const getCommonSourceDirectory2=()=>c.getCommonSourceDirectory();const _=!hostUsesCaseSensitiveFileNames(c);const g=a.getCompilerOptions().outDir;const y=a.getCompilerOptions().declarationDir;const h=f?combinePaths(p,u+m):p;const T=normalizePath(combinePaths(t,h));const S=o&&g&&getPossibleOriginalInputPathWithoutChangingExt(T,_,g,getCommonSourceDirectory2);const v=o&&y&&getPossibleOriginalInputPathWithoutChangingExt(T,_,y,getCommonSourceDirectory2);const x=normalizePath(l.suffix);const b=x&&getDeclarationEmitExtensionForPath("_"+x);const C=x?getPossibleOriginalInputExtensionForExtension("_"+x):void 0;const E=[b&&changeExtension(x,b),...C?C.map((e=>changeExtension(x,e))):[],x].filter(isString);const N=x?E.map((e=>"**/*"+e)):["./*"];const k=(i||o)&&endsWith(n,"/*");let F=getMatchesWithPrefix(T);if(S){F=concatenate(F,getMatchesWithPrefix(S))}if(v){F=concatenate(F,getMatchesWithPrefix(v))}if(!x){F=concatenate(F,getDirectoryMatches(T));if(S){F=concatenate(F,getDirectoryMatches(S))}if(v){F=concatenate(F,getDirectoryMatches(v))}}return F;function getMatchesWithPrefix(e){const t=f?e:ensureTrailingDirectorySeparator(e)+u;return mapDefined(tryReadDirectory(s,e,r.extensionsToSearch,void 0,N),(e=>{const n=trimPrefixAndSuffix(e,t);if(n){if(containsSlash(n)){return directoryResult(getPathComponents(removeLeadingDirectorySeparator(n))[1])}const{name:e,extension:t}=getFilenameWithExtensionOption(n,a,r,k);return nameAndKind(e,"script",t)}}))}function getDirectoryMatches(e){return mapDefined(tryGetDirectories(s,e),(e=>e==="node_modules"?void 0:directoryResult(e)))}function trimPrefixAndSuffix(e,t){return firstDefined(E,(n=>{const r=withoutStartAndEnd(normalizePath(e),t,n);return r===void 0?void 0:removeLeadingDirectorySeparator(r)}))}}function withoutStartAndEnd(e,t,n){return startsWith(e,t)&&endsWith(e,n)?e.slice(t.length,e.length-n.length):void 0}function removeLeadingDirectorySeparator(e){return e[0]===Pt?e.slice(1):e}function getAmbientModuleCompletions(e,t,n){const r=n.getAmbientModules().map((e=>stripQuotes(e.name)));const i=r.filter((t=>startsWith(t,e)&&!t.includes("*")));if(t!==void 0){const e=ensureTrailingDirectorySeparator(t);return i.map((t=>removePrefix(t,e)))}return i}function getTripleSlashReferenceCompletion(e,t,n,r,i){const o=n.getCompilerOptions();const a=getTokenAtPosition(e,t);const s=getLeadingCommentRanges(e.text,a.pos);const c=s&&find(s,(e=>t>=e.pos&&t<=e.end));if(!c){return void 0}const l=e.text.slice(c.pos,t);const d=Lf.exec(l);if(!d){return void 0}const[,p,u,f]=d;const m=getDirectoryPath(e.path);const _=u==="path"?getCompletionEntriesForDirectoryFragment(f,m,getExtensionOptions(o,0,e),n,r,i,true,e.path):u==="types"?getCompletionEntriesFromTypings(n,r,i,m,getFragmentDirectory(f),getExtensionOptions(o,1,e)):S.fail();return addReplacementSpans(f,c.pos+p.length,arrayFrom(_.values()))}function getCompletionEntriesFromTypings(e,t,n,r,i,o,a=createNameAndKindSet()){const s=e.getCompilerOptions();const c=new Map;const l=tryAndIgnoreErrors((()=>getEffectiveTypeRoots(s,t)))||d;for(const e of l){getCompletionEntriesFromDirectories(e)}for(const e of findPackageJsons(r,t)){const t=combinePaths(getDirectoryPath(e),"node_modules/@types");getCompletionEntriesFromDirectories(t)}return a;function getCompletionEntriesFromDirectories(r){if(!tryDirectoryExists(t,r))return;for(const l of tryGetDirectories(t,r)){const d=unmangleScopedPackageName(l);if(s.types&&!contains(s.types,d))continue;if(i===void 0){if(!c.has(d)){a.add(nameAndKind(d,"external module name",void 0));c.set(d,true)}}else{const s=combinePaths(r,l);const c=tryRemoveDirectoryPrefix(i,d,hostGetCanonicalFileName(t));if(c!==void 0){getCompletionEntriesForDirectoryFragment(c,s,o,e,t,n,false,void 0,a)}}}}}function enumerateNodeModulesVisibleToScript(e,t){if(!e.readFile||!e.fileExists)return d;const n=[];for(const r of findPackageJsons(t,e)){const t=readJson(r,e);for(const e of Mf){const r=t[e];if(!r)continue;for(const e in r){if(hasProperty(r,e)&&!startsWith(e,"@types/")){n.push(e)}}}}return n}function getDirectoryFragmentTextSpan(e,t){const n=Math.max(e.lastIndexOf(Pt),e.lastIndexOf(Dt));const r=n!==-1?n+1:0;const i=e.length-r;return i===0||isIdentifierText(e.substr(r,i),99)?void 0:createTextSpan(t+r,i)}function isPathRelativeToScript(e){if(e&&e.length>=2&&e.charCodeAt(0)===46){const t=e.length>=3&&e.charCodeAt(1)===46?2:1;const n=e.charCodeAt(t);return n===47||n===92}return false}var Lf=/^(\/\/\/\s*zf,DefinitionKind:()=>Jf,EntryKind:()=>Wf,ExportKind:()=>Bf,FindReferencesUse:()=>Uf,ImportExport:()=>jf,createImportTracker:()=>createImportTracker,findModuleReferences:()=>findModuleReferences,findReferenceOrRenameEntries:()=>findReferenceOrRenameEntries,findReferencedSymbols:()=>findReferencedSymbols,getContextNode:()=>getContextNode,getExportInfo:()=>getExportInfo,getImplementationsAtPosition:()=>getImplementationsAtPosition,getImportOrExportSymbol:()=>getImportOrExportSymbol,getReferenceEntriesForNode:()=>getReferenceEntriesForNode,isContextWithStartAndEndNode:()=>isContextWithStartAndEndNode,isDeclarationOfSymbol:()=>isDeclarationOfSymbol,isWriteAccessForReference:()=>isWriteAccessForReference,toContextSpan:()=>toContextSpan,toHighlightSpan:()=>toHighlightSpan,toReferenceEntry:()=>toReferenceEntry,toRenameLocation:()=>toRenameLocation});function createImportTracker(e,t,n,r){const i=getDirectImportsMap(e,n,r);return(o,a,s)=>{const{directImports:c,indirectUsers:l}=getImportersForExport(e,t,i,a,n,r);return{indirectUsers:l,...getSearchesFromDirectImports(c,o,a.exportKind,n,s)}}}var Bf=(e=>{e[e["Named"]=0]="Named";e[e["Default"]=1]="Default";e[e["ExportEquals"]=2]="ExportEquals";return e})(Bf||{});var jf=(e=>{e[e["Import"]=0]="Import";e[e["Export"]=1]="Export";return e})(jf||{});function getImportersForExport(e,t,n,{exportingModuleSymbol:r,exportKind:i},o,a){const s=nodeSeenTracker();const c=nodeSeenTracker();const l=[];const d=!!r.globalExports;const p=d?void 0:[];handleDirectImports(r);return{directImports:l,indirectUsers:getIndirectUsers()};function getIndirectUsers(){if(d){return e}if(r.declarations){for(const e of r.declarations){if(isExternalModuleAugmentation(e)&&t.has(e.getSourceFile().fileName)){addIndirectUser(e)}}}return p.map(getSourceFileOfNode)}function handleDirectImports(e){const t=getDirectImports(e);if(t){for(const e of t){if(!s(e)){continue}if(a)a.throwIfCancellationRequested();switch(e.kind){case 213:if(isImportCall(e)){handleImportCall(e);break}if(!d){const t=e.parent;if(i===2&&t.kind===260){const{name:e}=t;if(e.kind===80){l.push(e);break}}}break;case 80:break;case 271:handleNamespaceImport(e,e.name,hasSyntacticModifier(e,32),false);break;case 272:case 351:l.push(e);const t=e.importClause&&e.importClause.namedBindings;if(t&&t.kind===274){handleNamespaceImport(e,t.name,false,true)}else if(!d&&isDefaultImport(e)){addIndirectUser(getSourceFileLikeForImportDeclaration(e))}break;case 278:if(!e.exportClause){handleDirectImports(getContainingModuleSymbol(e,o))}else if(e.exportClause.kind===280){addIndirectUser(getSourceFileLikeForImportDeclaration(e),true)}else{l.push(e)}break;case 205:if(!d&&e.isTypeOf&&!e.qualifier&&isExported2(e)){addIndirectUser(e.getSourceFile(),true)}l.push(e);break;default:S.failBadSyntaxKind(e,"Unexpected import kind.")}}}}function handleImportCall(e){const t=findAncestor(e,isAmbientModuleDeclaration)||e.getSourceFile();addIndirectUser(t,!!isExported2(e,true))}function isExported2(e,t=false){return findAncestor(e,(e=>{if(t&&isAmbientModuleDeclaration(e))return"quit";return canHaveModifiers(e)&&some(e.modifiers,isExportModifier)}))}function handleNamespaceImport(e,t,n,r){if(i===2){if(!r)l.push(e)}else if(!d){const r=getSourceFileLikeForImportDeclaration(e);S.assert(r.kind===307||r.kind===267);if(n||findNamespaceReExports(r,t,o)){addIndirectUser(r,true)}else{addIndirectUser(r)}}}function addIndirectUser(e,t=false){S.assert(!d);const n=c(e);if(!n)return;p.push(e);if(!t)return;const r=o.getMergedSymbol(e.symbol);if(!r)return;S.assert(!!(r.flags&1536));const i=getDirectImports(r);if(i){for(const e of i){if(!isImportTypeNode(e)){addIndirectUser(getSourceFileLikeForImportDeclaration(e),true)}}}}function getDirectImports(e){return n.get(getSymbolId(e).toString())}}function getSearchesFromDirectImports(e,t,n,r,i){const o=[];const a=[];function addSearch(e,t){o.push([e,t])}if(e){for(const t of e){handleImport(t)}}return{importSearches:o,singleReferences:a};function handleImport(e){if(e.kind===271){if(isExternalModuleImportEquals(e)){handleNamespaceImportLike(e.name)}return}if(e.kind===80){handleNamespaceImportLike(e);return}if(e.kind===205){if(e.qualifier){const n=getFirstIdentifier(e.qualifier);if(n.escapedText===symbolName(t)){a.push(n)}}else if(n===2){a.push(e.argument.literal)}return}if(e.moduleSpecifier.kind!==11){return}if(e.kind===278){if(e.exportClause&&isNamedExports(e.exportClause)){searchForNamedImport(e.exportClause)}return}const{name:o,namedBindings:s}=e.importClause||{name:void 0,namedBindings:void 0};if(s){switch(s.kind){case 274:handleNamespaceImportLike(s.name);break;case 275:if(n===0||n===1){searchForNamedImport(s)}break;default:S.assertNever(s)}}if(o&&(n===1||n===2)&&(!i||o.escapedText===symbolEscapedNameNoDefault(t))){const e=r.getSymbolAtLocation(o);addSearch(o,e)}}function handleNamespaceImportLike(e){if(n===2&&(!i||isNameMatch(e.escapedText))){addSearch(e,r.getSymbolAtLocation(e))}}function searchForNamedImport(e){if(!e){return}for(const n of e.elements){const{name:e,propertyName:o}=n;if(!isNameMatch(moduleExportNameTextEscaped(o||e))){continue}if(o){a.push(o);if(!i||moduleExportNameTextEscaped(e)===t.escapedName){addSearch(e,r.getSymbolAtLocation(e))}}else{const t=n.kind===281&&n.propertyName?r.getExportSpecifierLocalTargetSymbol(n):r.getSymbolAtLocation(e);addSearch(e,t)}}}function isNameMatch(e){return e===t.escapedName||n!==0&&e==="default"}}function findNamespaceReExports(e,t,n){const r=n.getSymbolAtLocation(t);return!!forEachPossibleImportOrExportStatement(e,(e=>{if(!isExportDeclaration(e))return;const{exportClause:t,moduleSpecifier:i}=e;return!i&&t&&isNamedExports(t)&&t.elements.some((e=>n.getExportSpecifierLocalTargetSymbol(e)===r))}))}function findModuleReferences(e,t,n){var r;const i=[];const o=e.getTypeChecker();for(const a of t){const t=n.valueDeclaration;if((t==null?void 0:t.kind)===307){for(const n of a.referencedFiles){if(e.getSourceFileFromReference(a,n)===t){i.push({kind:"reference",referencingFile:a,ref:n})}}for(const n of a.typeReferenceDirectives){const o=(r=e.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(n,a))==null?void 0:r.resolvedTypeReferenceDirective;if(o!==void 0&&o.resolvedFileName===t.fileName){i.push({kind:"reference",referencingFile:a,ref:n})}}}forEachImport(a,((e,t)=>{const r=o.getSymbolAtLocation(t);if(r===n){i.push(nodeIsSynthesized(e)?{kind:"implicit",literal:t,referencingFile:a}:{kind:"import",literal:t})}}))}return i}function getDirectImportsMap(e,t,n){const r=new Map;for(const i of e){if(n)n.throwIfCancellationRequested();forEachImport(i,((e,n)=>{const i=t.getSymbolAtLocation(n);if(i){const t=getSymbolId(i).toString();let n=r.get(t);if(!n){r.set(t,n=[])}n.push(e)}}))}return r}function forEachPossibleImportOrExportStatement(e,t){return forEach(e.kind===307?e.statements:e.body.statements,(e=>t(e)||isAmbientModuleDeclaration(e)&&forEach(e.body&&e.body.statements,t)))}function forEachImport(e,t){if(e.externalModuleIndicator||e.imports!==void 0){for(const n of e.imports){t(importFromModuleSpecifier(n),n)}}else{forEachPossibleImportOrExportStatement(e,(e=>{switch(e.kind){case 278:case 272:{const n=e;if(n.moduleSpecifier&&isStringLiteral(n.moduleSpecifier)){t(n,n.moduleSpecifier)}break}case 271:{const n=e;if(isExternalModuleImportEquals(n)){t(n,n.moduleReference.expression)}break}}}))}}function getImportOrExportSymbol(e,t,n,r){return r?getExport():getExport()||getImport();function getExport(){var i;const{parent:o}=e;const a=o.parent;if(t.exportSymbol){if(o.kind===211){return((i=t.declarations)==null?void 0:i.some((e=>e===o)))&&isBinaryExpression(a)?getSpecialPropertyExport(a,false):void 0}else{return exportInfo(t.exportSymbol,getExportKindForDeclaration(o))}}else{const i=getExportNode(o,e);if(i&&hasSyntacticModifier(i,32)){if(isImportEqualsDeclaration(i)&&i.moduleReference===e){if(r){return void 0}const e=n.getSymbolAtLocation(i.name);return{kind:0,symbol:e}}else{return exportInfo(t,getExportKindForDeclaration(i))}}else if(isNamespaceExport(o)){return exportInfo(t,0)}else if(isExportAssignment(o)){return getExportAssignmentExport(o)}else if(isExportAssignment(a)){return getExportAssignmentExport(a)}else if(isBinaryExpression(o)){return getSpecialPropertyExport(o,true)}else if(isBinaryExpression(a)){return getSpecialPropertyExport(a,true)}else if(isJSDocTypedefTag(o)||isJSDocCallbackTag(o)){return exportInfo(t,0)}}function getExportAssignmentExport(e){if(!e.symbol.parent)return void 0;const n=e.isExportEquals?2:1;return{kind:1,symbol:t,exportInfo:{exportingModuleSymbol:e.symbol.parent,exportKind:n}}}function getSpecialPropertyExport(e,r){let i;switch(getAssignmentDeclarationKind(e)){case 1:i=0;break;case 2:i=2;break;default:return void 0}const o=r?n.getSymbolAtLocation(getNameOfAccessExpression(cast(e.left,isAccessExpression))):t;return o&&exportInfo(o,i)}}function getImport(){const r=isNodeImport(e);if(!r)return void 0;let i=n.getImmediateAliasedSymbol(t);if(!i)return void 0;i=skipExportSpecifierSymbol(i,n);if(i.escapedName==="export="){i=getExportEqualsLocalSymbol(i,n);if(i===void 0)return void 0}const o=symbolEscapedNameNoDefault(i);if(o===void 0||o==="default"||o===t.escapedName){return{kind:0,symbol:i}}}function exportInfo(e,t){const r=getExportInfo(e,t,n);return r&&{kind:1,symbol:e,exportInfo:r}}function getExportKindForDeclaration(e){return hasSyntacticModifier(e,2048)?1:0}}function getExportEqualsLocalSymbol(e,t){var n,r;if(e.flags&2097152){return t.getImmediateAliasedSymbol(e)}const i=S.checkDefined(e.valueDeclaration);if(isExportAssignment(i)){return(n=tryCast(i.expression,canHaveSymbol))==null?void 0:n.symbol}else if(isBinaryExpression(i)){return(r=tryCast(i.right,canHaveSymbol))==null?void 0:r.symbol}else if(isSourceFile(i)){return i.symbol}return void 0}function getExportNode(e,t){const n=isVariableDeclaration(e)?e:isBindingElement(e)?walkUpBindingElementsAndPatterns(e):void 0;if(n){return e.name!==t?void 0:isCatchClause(n.parent)?void 0:isVariableStatement(n.parent.parent)?n.parent.parent:void 0}else{return e}}function isNodeImport(e){const{parent:t}=e;switch(t.kind){case 271:return t.name===e&&isExternalModuleImportEquals(t);case 276:return!t.propertyName;case 273:case 274:S.assert(t.name===e);return true;case 208:return isInJSFile(e)&&isVariableDeclarationInitializedToBareOrAccessedRequire(t.parent.parent);default:return false}}function getExportInfo(e,t,n){const r=e.parent;if(!r)return void 0;const i=n.getMergedSymbol(r);return isExternalModuleSymbol(i)?{exportingModuleSymbol:i,exportKind:t}:void 0}function skipExportSpecifierSymbol(e,t){if(e.declarations){for(const n of e.declarations){if(isExportSpecifier(n)&&!n.propertyName&&!n.parent.parent.moduleSpecifier){return t.getExportSpecifierLocalTargetSymbol(n)||e}else if(isPropertyAccessExpression(n)&&isModuleExportsAccessExpression(n.expression)&&!isPrivateIdentifier(n.name)){return t.getSymbolAtLocation(n)}else if(isShorthandPropertyAssignment(n)&&isBinaryExpression(n.parent.parent)&&getAssignmentDeclarationKind(n.parent.parent)===2){return t.getExportSpecifierLocalTargetSymbol(n.name)}}}return e}function getContainingModuleSymbol(e,t){return t.getMergedSymbol(getSourceFileLikeForImportDeclaration(e).symbol)}function getSourceFileLikeForImportDeclaration(e){if(e.kind===213||e.kind===351){return e.getSourceFile()}const{parent:t}=e;if(t.kind===307){return t}S.assert(t.kind===268);return cast(t.parent,isAmbientModuleDeclaration)}function isAmbientModuleDeclaration(e){return e.kind===267&&e.name.kind===11}function isExternalModuleImportEquals(e){return e.moduleReference.kind===283&&e.moduleReference.expression.kind===11}var Jf=(e=>{e[e["Symbol"]=0]="Symbol";e[e["Label"]=1]="Label";e[e["Keyword"]=2]="Keyword";e[e["This"]=3]="This";e[e["String"]=4]="String";e[e["TripleSlashReference"]=5]="TripleSlashReference";return e})(Jf||{});var Wf=(e=>{e[e["Span"]=0]="Span";e[e["Node"]=1]="Node";e[e["StringLiteral"]=2]="StringLiteral";e[e["SearchedLocalFoundProperty"]=3]="SearchedLocalFoundProperty";e[e["SearchedPropertyFoundLocal"]=4]="SearchedPropertyFoundLocal";return e})(Wf||{});function nodeEntry(e,t=1){return{kind:t,node:e.name||e,context:getContextNodeForNodeEntry(e)}}function isContextWithStartAndEndNode(e){return e&&e.kind===void 0}function getContextNodeForNodeEntry(e){if(isDeclaration(e)){return getContextNode(e)}if(!e.parent)return void 0;if(!isDeclaration(e.parent)&&!isExportAssignment(e.parent)){if(isInJSFile(e)){const t=isBinaryExpression(e.parent)?e.parent:isAccessExpression(e.parent)&&isBinaryExpression(e.parent.parent)&&e.parent.parent.left===e.parent?e.parent.parent:void 0;if(t&&getAssignmentDeclarationKind(t)!==0){return getContextNode(t)}}if(isJsxOpeningElement(e.parent)||isJsxClosingElement(e.parent)){return e.parent.parent}else if(isJsxSelfClosingElement(e.parent)||isLabeledStatement(e.parent)||isBreakOrContinueStatement(e.parent)){return e.parent}else if(isStringLiteralLike(e)){const t=tryGetImportFromModuleSpecifier(e);if(t){const e=findAncestor(t,(e=>isDeclaration(e)||isStatement(e)||isJSDocTag(e)));return isDeclaration(e)?getContextNode(e):e}}const t=findAncestor(e,isComputedPropertyName);return t?getContextNode(t.parent):void 0}if(e.parent.name===e||isConstructorDeclaration(e.parent)||isExportAssignment(e.parent)||(isImportOrExportSpecifier(e.parent)||isBindingElement(e.parent))&&e.parent.propertyName===e||e.kind===90&&hasSyntacticModifier(e.parent,2080)){return getContextNode(e.parent)}return void 0}function getContextNode(e){if(!e)return void 0;switch(e.kind){case 260:return!isVariableDeclarationList(e.parent)||e.parent.declarations.length!==1?e:isVariableStatement(e.parent.parent)?e.parent.parent:isForInOrOfStatement(e.parent.parent)?getContextNode(e.parent.parent):e.parent;case 208:return getContextNode(e.parent.parent);case 276:return e.parent.parent.parent;case 281:case 274:return e.parent.parent;case 273:case 280:return e.parent;case 226:return isExpressionStatement(e.parent)?e.parent:e;case 250:case 249:return{start:e.initializer,end:e.expression};case 303:case 304:return isArrayLiteralOrObjectLiteralDestructuringPattern(e.parent)?getContextNode(findAncestor(e.parent,(e=>isBinaryExpression(e)||isForInOrOfStatement(e)))):e;case 255:return{start:find(e.getChildren(e.getSourceFile()),(e=>e.kind===109)),end:e.caseBlock};default:return e}}function toContextSpan(e,t,n){if(!n)return void 0;const r=isContextWithStartAndEndNode(n)?getTextSpan(n.start,t,n.end):getTextSpan(n,t);return r.start!==e.start||r.length!==e.length?{contextSpan:r}:void 0}var Uf=(e=>{e[e["Other"]=0]="Other";e[e["References"]=1]="References";e[e["Rename"]=2]="Rename";return e})(Uf||{});function findReferencedSymbols(e,t,n,r,i){const o=getTouchingPropertyName(r,i);const a={use:1};const s=zf.getReferencedSymbolsForNode(i,o,e,n,t,a);const c=e.getTypeChecker();const l=zf.getAdjustedNode(o,a);const d=isDefinitionForReference(l)?c.getSymbolAtLocation(l):void 0;return!s||!s.length?void 0:mapDefined(s,(({definition:e,references:n})=>e&&{definition:c.runWithCancellationToken(t,(t=>definitionToReferencedSymbolDefinitionInfo(e,t,o))),references:n.map((e=>toReferencedSymbolEntry(e,d)))}))}function isDefinitionForReference(e){return e.kind===90||!!getDeclarationFromName(e)||isLiteralComputedPropertyDeclarationName(e)||e.kind===137&&isConstructorDeclaration(e.parent)}function getImplementationsAtPosition(e,t,n,r,i){const o=getTouchingPropertyName(r,i);let a;const s=getImplementationReferenceEntries(e,t,n,o,i);if(o.parent.kind===211||o.parent.kind===208||o.parent.kind===212||o.kind===108){a=s&&[...s]}else if(s){const r=createQueue(s);const i=new Set;while(!r.isEmpty()){const o=r.dequeue();if(!addToSeen(i,getNodeId(o.node))){continue}a=append(a,o);const s=getImplementationReferenceEntries(e,t,n,o.node,o.node.pos);if(s){r.enqueue(...s)}}}const c=e.getTypeChecker();return map(a,(e=>toImplementationLocation(e,c)))}function getImplementationReferenceEntries(e,t,n,r,i){if(r.kind===307){return void 0}const o=e.getTypeChecker();if(r.parent.kind===304){const e=[];zf.getReferenceEntriesForShorthandPropertyAssignment(r,o,(t=>e.push(nodeEntry(t))));return e}else if(r.kind===108||isSuperProperty(r.parent)){const e=o.getSymbolAtLocation(r);return e.valueDeclaration&&[nodeEntry(e.valueDeclaration)]}else{return getReferenceEntriesForNode(i,r,e,n,t,{implementations:true,use:1})}}function findReferenceOrRenameEntries(e,t,n,r,i,o,a){return map(flattenEntries(zf.getReferencedSymbolsForNode(i,r,e,n,t,o)),(t=>a(t,r,e.getTypeChecker())))}function getReferenceEntriesForNode(e,t,n,r,i,o={},a=new Set(r.map((e=>e.fileName)))){return flattenEntries(zf.getReferencedSymbolsForNode(e,t,n,r,i,o,a))}function flattenEntries(e){return e&&flatMap(e,(e=>e.references))}function definitionToReferencedSymbolDefinitionInfo(e,t,n){const r=(()=>{switch(e.type){case 0:{const{symbol:r}=e;const{displayParts:i,kind:o}=getDefinitionKindAndDisplayParts(r,t,n);const a=i.map((e=>e.text)).join("");const s=r.declarations&&firstOrUndefined(r.declarations);const c=s?getNameOfDeclaration(s)||s:n;return{...getFileAndTextSpanFromNode(c),name:a,kind:o,displayParts:i,context:getContextNode(s)}}case 1:{const{node:t}=e;return{...getFileAndTextSpanFromNode(t),name:t.text,kind:"label",displayParts:[displayPart(t.text,17)]}}case 2:{const{node:t}=e;const n=tokenToString(t.kind);return{...getFileAndTextSpanFromNode(t),name:n,kind:"keyword",displayParts:[{text:n,kind:"keyword"}]}}case 3:{const{node:n}=e;const r=t.getSymbolAtLocation(n);const i=r&&cm.getSymbolDisplayPartsDocumentationAndSymbolKind(t,r,n.getSourceFile(),getContainerNode(n),n).displayParts||[textPart("this")];return{...getFileAndTextSpanFromNode(n),name:"this",kind:"var",displayParts:i}}case 4:{const{node:t}=e;return{...getFileAndTextSpanFromNode(t),name:t.text,kind:"var",displayParts:[displayPart(getTextOfNode(t),8)]}}case 5:{return{textSpan:createTextSpanFromRange(e.reference),sourceFile:e.file,name:e.reference.fileName,kind:"string",displayParts:[displayPart(`"${e.reference.fileName}"`,8)]}}default:return S.assertNever(e)}})();const{sourceFile:i,textSpan:o,name:a,kind:s,displayParts:c,context:l}=r;return{containerKind:"",containerName:"",fileName:i.fileName,kind:s,name:a,textSpan:o,displayParts:c,...toContextSpan(o,i,l)}}function getFileAndTextSpanFromNode(e){const t=e.getSourceFile();return{sourceFile:t,textSpan:getTextSpan(isComputedPropertyName(e)?e.expression:e,t)}}function getDefinitionKindAndDisplayParts(e,t,n){const r=zf.getIntersectingMeaningFromDeclarations(n,e);const i=e.declarations&&firstOrUndefined(e.declarations)||n;const{displayParts:o,symbolKind:a}=cm.getSymbolDisplayPartsDocumentationAndSymbolKind(t,e,i.getSourceFile(),i,i,r);return{displayParts:o,kind:a}}function toRenameLocation(e,t,n,r,i){return{...entryToDocumentSpan(e),...r&&getPrefixAndSuffixText(e,t,n,i)}}function toReferencedSymbolEntry(e,t){const n=toReferenceEntry(e);if(!t)return n;return{...n,isDefinition:e.kind!==0&&isDeclarationOfSymbol(e.node,t)}}function toReferenceEntry(e){const t=entryToDocumentSpan(e);if(e.kind===0){return{...t,isWriteAccess:false}}const{kind:n,node:r}=e;return{...t,isWriteAccess:isWriteAccessForReference(r),isInString:n===2?true:void 0}}function entryToDocumentSpan(e){if(e.kind===0){return{textSpan:e.textSpan,fileName:e.fileName}}else{const t=e.node.getSourceFile();const n=getTextSpan(e.node,t);return{textSpan:n,fileName:t.fileName,...toContextSpan(n,t,e.context)}}}function getPrefixAndSuffixText(e,t,n,r){if(e.kind!==0&&(isIdentifier(t)||isStringLiteralLike(t))){const{node:r,kind:i}=e;const o=r.parent;const a=t.text;const s=isShorthandPropertyAssignment(o);if(s||isObjectBindingElementWithoutPropertyName(o)&&o.name===r&&o.dotDotDotToken===void 0){const e={prefixText:a+": "};const t={suffixText:": "+a};if(i===3){return e}if(i===4){return t}if(s){const n=o.parent;if(isObjectLiteralExpression(n)&&isBinaryExpression(n.parent)&&isModuleExportsAccessExpression(n.parent.left)){return e}return t}else{return e}}else if(isImportSpecifier(o)&&!o.propertyName){const e=isExportSpecifier(t.parent)?n.getExportSpecifierLocalTargetSymbol(t.parent):n.getSymbolAtLocation(t);return contains(e.declarations,o)?{prefixText:a+" as "}:Fs}else if(isExportSpecifier(o)&&!o.propertyName){return t===e.node||n.getSymbolAtLocation(t)===n.getSymbolAtLocation(e.node)?{prefixText:a+" as "}:{suffixText:" as "+a}}}if(e.kind!==0&&isNumericLiteral(e.node)&&isAccessExpression(e.node.parent)){const e=getQuoteFromPreference(r);return{prefixText:e,suffixText:e}}return Fs}function toImplementationLocation(e,t){const n=entryToDocumentSpan(e);if(e.kind!==0){const{node:r}=e;return{...n,...implementationKindDisplayParts(r,t)}}else{return{...n,kind:"",displayParts:[]}}}function implementationKindDisplayParts(e,t){const n=t.getSymbolAtLocation(isDeclaration(e)&&e.name?e.name:e);if(n){return getDefinitionKindAndDisplayParts(n,t,e)}else if(e.kind===210){return{kind:"interface",displayParts:[punctuationPart(21),textPart("object literal"),punctuationPart(22)]}}else if(e.kind===231){return{kind:"local class",displayParts:[punctuationPart(21),textPart("anonymous local class"),punctuationPart(22)]}}else{return{kind:getNodeKind(e),displayParts:[]}}}function toHighlightSpan(e){const t=entryToDocumentSpan(e);if(e.kind===0){return{fileName:t.fileName,span:{textSpan:t.textSpan,kind:"reference"}}}const n=isWriteAccessForReference(e.node);const r={textSpan:t.textSpan,kind:n?"writtenReference":"reference",isInString:e.kind===2?true:void 0,...t.contextSpan&&{contextSpan:t.contextSpan}};return{fileName:t.fileName,span:r}}function getTextSpan(e,t,n){let r=e.getStart(t);let i=(n||e).getEnd();if(isStringLiteralLike(e)&&i-r>2){S.assert(n===void 0);r+=1;i-=1}if((n==null?void 0:n.kind)===269){i=n.getFullStart()}return createTextSpanFromBounds(r,i)}function getTextSpanOfEntry(e){return e.kind===0?e.textSpan:getTextSpan(e.node,e.node.getSourceFile())}function isWriteAccessForReference(e){const t=getDeclarationFromName(e);return!!t&&declarationIsWriteAccess(t)||e.kind===90||isWriteAccess(e)}function isDeclarationOfSymbol(e,t){var n;if(!t)return false;const r=getDeclarationFromName(e)||(e.kind===90?e.parent:isLiteralComputedPropertyDeclarationName(e)?e.parent.parent:e.kind===137&&isConstructorDeclaration(e.parent)?e.parent.parent:void 0);const i=r&&isBinaryExpression(r)?r.left:void 0;return!!(r&&((n=t.declarations)==null?void 0:n.some((e=>e===r||e===i))))}function declarationIsWriteAccess(e){if(!!(e.flags&33554432))return true;switch(e.kind){case 226:case 208:case 263:case 231:case 90:case 266:case 306:case 281:case 273:case 271:case 276:case 264:case 338:case 346:case 291:case 267:case 270:case 274:case 280:case 169:case 304:case 265:case 168:return true;case 303:return!isArrayLiteralOrObjectLiteralDestructuringPattern(e.parent);case 262:case 218:case 176:case 174:case 177:case 178:return!!e.body;case 260:case 172:return!!e.initializer||isCatchClause(e.parent);case 173:case 171:case 348:case 341:return false;default:return S.failBadSyntaxKind(e)}}var zf;(e=>{function getReferencedSymbolsForNode(e,t,n,r,i,o={},a=new Set(r.map((e=>e.fileName)))){var s,c;t=getAdjustedNode2(t,o);if(isSourceFile(t)){const i=Vf.getReferenceAtPosition(t,e,n);if(!(i==null?void 0:i.file)){return void 0}const o=n.getTypeChecker().getMergedSymbol(i.file.symbol);if(o){return getReferencedSymbolsForModule(n,o,false,r,a)}const s=n.getFileIncludeReasons();if(!s){return void 0}return[{definition:{type:5,reference:i.reference,file:t},references:getReferencesForNonModule(i.file,s,n)||d}]}if(!o.implementations){const e=getReferencedSymbolsSpecial(t,r,i);if(e){return e}}const l=n.getTypeChecker();const p=l.getSymbolAtLocation(isConstructorDeclaration(t)&&t.parent.name||t);if(!p){if(!o.implementations&&isStringLiteralLike(t)){if(isModuleSpecifierLike(t)){const e=n.getFileIncludeReasons();const r=(c=(s=n.getResolvedModuleFromModuleSpecifier(t))==null?void 0:s.resolvedModule)==null?void 0:c.resolvedFileName;const i=r?n.getSourceFile(r):void 0;if(i){return[{definition:{type:4,node:t},references:getReferencesForNonModule(i,e,n)||d}]}}return getReferencesForStringLiteral(t,r,l,i)}return void 0}if(p.escapedName==="export="){return getReferencedSymbolsForModule(n,p.parent,false,r,a)}const u=getReferencedSymbolsForModuleIfDeclaredBySourceFile(p,n,r,i,o,a);if(u&&!(p.flags&33554432)){return u}const f=getMergedAliasedSymbolOfNamespaceExportDeclaration(t,p,l);const m=f&&getReferencedSymbolsForModuleIfDeclaredBySourceFile(f,n,r,i,o,a);const _=getReferencedSymbolsForSymbol(p,t,r,a,l,i,o);return mergeReferences(n,u,_,m)}e.getReferencedSymbolsForNode=getReferencedSymbolsForNode;function getAdjustedNode2(e,t){if(t.use===1){e=getAdjustedReferenceLocation(e)}else if(t.use===2){e=getAdjustedRenameLocation(e)}return e}e.getAdjustedNode=getAdjustedNode2;function getReferencesForFileName(e,t,n,r=new Set(n.map((e=>e.fileName)))){var i,o;const a=(i=t.getSourceFile(e))==null?void 0:i.symbol;if(a){return((o=getReferencedSymbolsForModule(t,a,false,n,r)[0])==null?void 0:o.references)||d}const s=t.getFileIncludeReasons();const c=t.getSourceFile(e);return c&&s&&getReferencesForNonModule(c,s,t)||d}e.getReferencesForFileName=getReferencesForFileName;function getReferencesForNonModule(e,t,n){let r;const i=t.get(e.path)||d;for(const e of i){if(isReferencedFile(e)){const t=n.getSourceFileByPath(e.file);const i=getReferencedFileLocation(n,e);if(isReferenceFileLocation(i)){r=append(r,{kind:0,fileName:t.fileName,textSpan:createTextSpanFromRange(i)})}}}return r}function getMergedAliasedSymbolOfNamespaceExportDeclaration(e,t,n){if(e.parent&&isNamespaceExportDeclaration(e.parent)){const e=n.getAliasedSymbol(t);const r=n.getMergedSymbol(e);if(e!==r){return r}}return void 0}function getReferencedSymbolsForModuleIfDeclaredBySourceFile(e,t,n,r,i,o){const a=e.flags&1536&&e.declarations&&find(e.declarations,isSourceFile);if(!a)return void 0;const s=e.exports.get("export=");const c=getReferencedSymbolsForModule(t,e,!!s,n,o);if(!s||!o.has(a.fileName))return c;const l=t.getTypeChecker();e=skipAlias(s,l);return mergeReferences(t,c,getReferencedSymbolsForSymbol(e,void 0,n,o,l,r,i))}function mergeReferences(e,...t){let n;for(const r of t){if(!r||!r.length)continue;if(!n){n=r;continue}for(const t of r){if(!t.definition||t.definition.type!==0){n.push(t);continue}const r=t.definition.symbol;const i=findIndex(n,(e=>!!e.definition&&e.definition.type===0&&e.definition.symbol===r));if(i===-1){n.push(t);continue}const o=n[i];n[i]={definition:o.definition,references:o.references.concat(t.references).sort(((t,n)=>{const r=getSourceFileIndexOfEntry(e,t);const i=getSourceFileIndexOfEntry(e,n);if(r!==i){return compareValues(r,i)}const o=getTextSpanOfEntry(t);const a=getTextSpanOfEntry(n);return o.start!==a.start?compareValues(o.start,a.start):compareValues(o.length,a.length)}))}}}return n}function getSourceFileIndexOfEntry(e,t){const n=t.kind===0?e.getSourceFile(t.fileName):t.node.getSourceFile();return e.getSourceFiles().indexOf(n)}function getReferencedSymbolsForModule(e,t,n,r,i){S.assert(!!t.valueDeclaration);const o=mapDefined(findModuleReferences(e,r,t),(e=>{if(e.kind==="import"){const t=e.literal.parent;if(isLiteralTypeNode(t)){const e=cast(t.parent,isImportTypeNode);if(n&&!e.qualifier){return void 0}}return nodeEntry(e.literal)}else if(e.kind==="implicit"){const t=e.literal.text!==cn&&forEachChildRecursively(e.referencingFile,(e=>!(e.transformFlags&2)?"skip":isJsxElement(e)||isJsxSelfClosingElement(e)||isJsxFragment(e)?e:void 0))||e.referencingFile.statements[0]||e.referencingFile;return nodeEntry(t)}else{return{kind:0,fileName:e.referencingFile.fileName,textSpan:createTextSpanFromRange(e.ref)}}}));if(t.declarations){for(const e of t.declarations){switch(e.kind){case 307:break;case 267:if(i.has(e.getSourceFile().fileName)){o.push(nodeEntry(e.name))}break;default:S.assert(!!(t.flags&33554432),"Expected a module symbol to be declared by a SourceFile or ModuleDeclaration.")}}}const a=t.exports.get("export=");if(a==null?void 0:a.declarations){for(const e of a.declarations){const t=e.getSourceFile();if(i.has(t.fileName)){const n=isBinaryExpression(e)&&isPropertyAccessExpression(e.left)?e.left.expression:isExportAssignment(e)?S.checkDefined(findChildOfKind(e,95,t)):getNameOfDeclaration(e)||e;o.push(nodeEntry(n))}}}return o.length?[{definition:{type:0,symbol:t},references:o}]:d}function isReadonlyTypeOperator(e){return e.kind===148&&isTypeOperatorNode(e.parent)&&e.parent.operator===148}function getReferencedSymbolsSpecial(e,t,n){if(isTypeKeyword(e.kind)){if(e.kind===116&&isVoidExpression(e.parent)){return void 0}if(e.kind===148&&!isReadonlyTypeOperator(e)){return void 0}return getAllReferencesForKeyword(t,e.kind,n,e.kind===148?isReadonlyTypeOperator:void 0)}if(isImportMeta(e.parent)&&e.parent.name===e){return getAllReferencesForImportMeta(t,n)}if(isStaticModifier(e)&&isClassStaticBlockDeclaration(e.parent)){return[{definition:{type:2,node:e},references:[nodeEntry(e)]}]}if(isJumpStatementTarget(e)){const t=getTargetLabel(e.parent,e.text);return t&&getLabelReferencesInNode(t.parent,t)}else if(isLabelOfLabeledStatement(e)){return getLabelReferencesInNode(e.parent,e)}if(isThis(e)){return getReferencesForThisKeyword(e,t,n)}if(e.kind===108){return getReferencesForSuperKeyword(e)}return void 0}function getReferencedSymbolsForSymbol(e,t,n,r,i,o,a){const s=t&&skipPastExportOrImportSpecifierOrUnion(e,t,i,!isForRenameWithPrefixAndSuffixText(a))||e;const c=t?getIntersectingMeaningFromDeclarations(t,s):7;const l=[];const d=new State(n,r,t?getSpecialSearchKind(t):0,i,o,c,a,l);const p=!isForRenameWithPrefixAndSuffixText(a)||!s.declarations?void 0:find(s.declarations,isExportSpecifier);if(p){getReferencesAtExportSpecifier(p.name,s,p,d.createSearch(t,e,void 0),d,true,true)}else if(t&&t.kind===90&&s.escapedName==="default"&&s.parent){addReference(t,s,d);searchForImportsOfExport(t,s,{exportingModuleSymbol:s.parent,exportKind:1},d)}else{const e=d.createSearch(t,s,void 0,{allSearchSymbols:t?populateSearchSymbolSet(s,t,i,a.use===2,!!a.providePrefixAndSuffixTextForRename,!!a.implementations):[s]});getReferencesInContainerOrFiles(s,d,e)}return l}function getReferencesInContainerOrFiles(e,t,n){const r=getSymbolScope(e);if(r){getReferencesInContainer(r,r.getSourceFile(),n,t,!(isSourceFile(r)&&!contains(t.sourceFiles,r)))}else{for(const e of t.sourceFiles){t.cancellationToken.throwIfCancellationRequested();searchForName(e,n,t)}}}function getSpecialSearchKind(e){switch(e.kind){case 176:case 137:return 1;case 80:if(isClassLike(e.parent)){S.assert(e.parent.name===e);return 2}default:return 0}}function skipPastExportOrImportSpecifierOrUnion(e,t,n,r){const{parent:i}=t;if(isExportSpecifier(i)&&r){return getLocalSymbolForExportSpecifier(t,e,i,n)}return firstDefined(e.declarations,(r=>{if(!r.parent){if(e.flags&33554432)return void 0;S.fail(`Unexpected symbol at ${S.formatSyntaxKind(t.kind)}: ${S.formatSymbol(e)}`)}return isTypeLiteralNode(r.parent)&&isUnionTypeNode(r.parent.parent)?n.getPropertyOfType(n.getTypeFromTypeNode(r.parent.parent),e.name):void 0}))}let t;(e=>{e[e["None"]=0]="None";e[e["Constructor"]=1]="Constructor";e[e["Class"]=2]="Class"})(t||(t={}));function getNonModuleSymbolOfMergedModuleSymbol(e){if(!(e.flags&(1536|33554432)))return void 0;const t=e.declarations&&find(e.declarations,(e=>!isSourceFile(e)&&!isModuleDeclaration(e)));return t&&t.symbol}class State{constructor(e,t,n,r,i,o,a,s){this.sourceFiles=e;this.sourceFilesSet=t;this.specialSearchKind=n;this.checker=r;this.cancellationToken=i;this.searchMeaning=o;this.options=a;this.result=s;this.inheritsFromCache=new Map;this.markSeenContainingTypeReference=nodeSeenTracker();this.markSeenReExportRHS=nodeSeenTracker();this.symbolIdToReferences=[];this.sourceFileToSeenSymbols=[]}includesSourceFile(e){return this.sourceFilesSet.has(e.fileName)}getImportSearches(e,t){if(!this.importTracker)this.importTracker=createImportTracker(this.sourceFiles,this.sourceFilesSet,this.checker,this.cancellationToken);return this.importTracker(e,t,this.options.use===2)}createSearch(e,t,n,r={}){const{text:i=stripQuotes(symbolName(getLocalSymbolForExportDefault(t)||getNonModuleSymbolOfMergedModuleSymbol(t)||t)),allSearchSymbols:o=[t]}=r;const a=escapeLeadingUnderscores(i);const s=this.options.implementations&&e?getParentSymbolsOfPropertyAccess(e,t,this.checker):void 0;return{symbol:t,comingFrom:n,text:i,escapedText:a,parents:s,allSearchSymbols:o,includes:e=>contains(o,e)}}referenceAdder(e){const t=getSymbolId(e);let n=this.symbolIdToReferences[t];if(!n){n=this.symbolIdToReferences[t]=[];this.result.push({definition:{type:0,symbol:e},references:n})}return(e,t)=>n.push(nodeEntry(e,t))}addStringOrCommentReference(e,t){this.result.push({definition:void 0,references:[{kind:0,fileName:e,textSpan:t}]})}markSearchedSymbols(e,t){const n=getNodeId(e);const r=this.sourceFileToSeenSymbols[n]||(this.sourceFileToSeenSymbols[n]=new Set);let i=false;for(const e of t){i=tryAddToSet(r,getSymbolId(e))||i}return i}}function searchForImportsOfExport(e,t,n,r){const{importSearches:i,singleReferences:o,indirectUsers:a}=r.getImportSearches(t,n);if(o.length){const e=r.referenceAdder(t);for(const t of o){if(shouldAddSingleReference(t,r))e(t)}}for(const[e,t]of i){getReferencesInSourceFile(e.getSourceFile(),r.createSearch(e,t,1),r)}if(a.length){let i;switch(n.exportKind){case 0:i=r.createSearch(e,t,1);break;case 1:i=r.options.use===2?void 0:r.createSearch(e,t,1,{text:"default"});break;case 2:break}if(i){for(const e of a){searchForName(e,i,r)}}}}function eachExportReference(e,t,n,r,i,o,a,s){const c=createImportTracker(e,new Set(e.map((e=>e.fileName))),t,n);const{importSearches:l,indirectUsers:d,singleReferences:p}=c(r,{exportKind:a?1:0,exportingModuleSymbol:i},false);for(const[e]of l){s(e)}for(const e of p){if(isIdentifier(e)&&isImportTypeNode(e.parent)){s(e)}}for(const e of d){for(const n of getPossibleSymbolReferenceNodes(e,a?"default":o)){const e=t.getSymbolAtLocation(n);const i=some(e==null?void 0:e.declarations,(e=>tryCast(e,isExportAssignment)?true:false));if(isIdentifier(n)&&!isImportOrExportSpecifier(n.parent)&&(e===r||i)){s(n)}}}}e.eachExportReference=eachExportReference;function shouldAddSingleReference(e,t){if(!hasMatchingMeaning(e,t))return false;if(t.options.use!==2)return true;if(!isIdentifier(e)&&!isImportOrExportSpecifier(e.parent))return false;return!(isImportOrExportSpecifier(e.parent)&&moduleExportNameIsDefault(e))}function searchForImportedSymbol(e,t){if(!e.declarations)return;for(const n of e.declarations){const r=n.getSourceFile();getReferencesInSourceFile(r,t.createSearch(n,e,0),t,t.includesSourceFile(r))}}function searchForName(e,t,n){if(getNameTable(e).get(t.escapedText)!==void 0){getReferencesInSourceFile(e,t,n)}}function getPropertySymbolOfDestructuringAssignment(e,t){return isArrayLiteralOrObjectLiteralDestructuringPattern(e.parent.parent)?t.getPropertySymbolOfDestructuringAssignment(e):void 0}function getSymbolScope(e){const{declarations:t,flags:n,parent:r,valueDeclaration:i}=e;if(i&&(i.kind===218||i.kind===231)){return i}if(!t){return void 0}if(n&(4|8192)){const e=find(t,(e=>hasEffectiveModifier(e,2)||isPrivateIdentifierClassElementDeclaration(e)));if(e){return getAncestor(e,263)}return void 0}if(t.some(isObjectBindingElementWithoutPropertyName)){return void 0}const o=r&&!(e.flags&262144);if(o&&!(isExternalModuleSymbol(r)&&!r.globalExports)){return void 0}let a;for(const e of t){const t=getContainerNode(e);if(a&&a!==t){return void 0}if(!t||t.kind===307&&!isExternalOrCommonJsModule(t)){return void 0}a=t;if(isFunctionExpression(a)){let e;while(e=getNextJSDocCommentLocation(a)){a=e}}}return o?a.getSourceFile():a}function isSymbolReferencedInFile(e,t,n,r=n){return eachSymbolReferenceInFile(e,t,n,(()=>true),r)||false}e.isSymbolReferencedInFile=isSymbolReferencedInFile;function eachSymbolReferenceInFile(e,t,n,r,i=n){const o=isParameterPropertyDeclaration(e.parent,e.parent.parent)?first(t.getSymbolsOfParameterPropertyDeclaration(e.parent,e.text)):t.getSymbolAtLocation(e);if(!o)return void 0;for(const a of getPossibleSymbolReferenceNodes(n,o.name,i)){if(!isIdentifier(a)||a===e||a.escapedText!==e.escapedText)continue;const n=t.getSymbolAtLocation(a);if(n===o||t.getShorthandAssignmentValueSymbol(a.parent)===o||isExportSpecifier(a.parent)&&getLocalSymbolForExportSpecifier(a,n,a.parent,t)===o){const e=r(a);if(e)return e}}}e.eachSymbolReferenceInFile=eachSymbolReferenceInFile;function getTopMostDeclarationNamesInFile(e,t){const n=filter(getPossibleSymbolReferenceNodes(t,e),(e=>!!getDeclarationFromName(e)));return n.reduce(((e,t)=>{const n=getDepth(t);if(!some(e.declarationNames)||n===e.depth){e.declarationNames.push(t);e.depth=n}else if(ne===i))){if(r(t,a)){return true}}}}return false}e.someSignatureUsage=someSignatureUsage;function getPossibleSymbolReferenceNodes(e,t,n=e){return mapDefined(getPossibleSymbolReferencePositions(e,t,n),(t=>{const n=getTouchingPropertyName(e,t);return n===e?void 0:n}))}function getPossibleSymbolReferencePositions(e,t,n=e){const r=[];if(!t||!t.length){return r}const i=e.text;const o=i.length;const a=t.length;let s=i.indexOf(t,n.pos);while(s>=0){if(s>n.end)break;const e=s+a;if((s===0||!isIdentifierPart(i.charCodeAt(s-1),99))&&(e===o||!isIdentifierPart(i.charCodeAt(e),99))){r.push(s)}s=i.indexOf(t,s+a+1)}return r}function getLabelReferencesInNode(e,t){const n=e.getSourceFile();const r=t.text;const i=mapDefined(getPossibleSymbolReferenceNodes(n,r,e),(e=>e===t||isJumpStatementTarget(e)&&getTargetLabel(e,r)===t?nodeEntry(e):void 0));return[{definition:{type:1,node:t},references:i}]}function isValidReferencePosition(e,t){switch(e.kind){case 81:if(isJSDocMemberName(e.parent)){return true}case 80:return e.text.length===t.length;case 15:case 11:{const n=e;return n.text.length===t.length&&(isLiteralNameOfPropertyDeclarationOrIndexAccess(n)||isNameOfModuleDeclaration(e)||isExpressionOfExternalModuleImportEqualsDeclaration(e)||isCallExpression(e.parent)&&isBindableObjectDefinePropertyCall(e.parent)&&e.parent.arguments[1]===e||isImportOrExportSpecifier(e.parent))}case 9:return isLiteralNameOfPropertyDeclarationOrIndexAccess(e)&&e.text.length===t.length;case 90:return"default".length===t.length;default:return false}}function getAllReferencesForImportMeta(e,t){const n=flatMap(e,(e=>{t.throwIfCancellationRequested();return mapDefined(getPossibleSymbolReferenceNodes(e,"meta",e),(e=>{const t=e.parent;if(isImportMeta(t)){return nodeEntry(t)}}))}));return n.length?[{definition:{type:2,node:n[0].node},references:n}]:void 0}function getAllReferencesForKeyword(e,t,n,r){const i=flatMap(e,(e=>{n.throwIfCancellationRequested();return mapDefined(getPossibleSymbolReferenceNodes(e,tokenToString(t),e),(e=>{if(e.kind===t&&(!r||r(e))){return nodeEntry(e)}}))}));return i.length?[{definition:{type:2,node:i[0].node},references:i}]:void 0}function getReferencesInSourceFile(e,t,n,r=true){n.cancellationToken.throwIfCancellationRequested();return getReferencesInContainer(e,e,t,n,r)}function getReferencesInContainer(e,t,n,r,i){if(!r.markSearchedSymbols(t,n.allSearchSymbols)){return}for(const o of getPossibleSymbolReferencePositions(t,n.text,e)){getReferencesAtLocation(t,o,n,r,i)}}function hasMatchingMeaning(e,t){return!!(getMeaningFromLocation(e)&t.searchMeaning)}function getReferencesAtLocation(e,t,n,r,i){const o=getTouchingPropertyName(e,t);if(!isValidReferencePosition(o,n.text)){if(!r.options.implementations&&(r.options.findInStrings&&isInString(e,t)||r.options.findInComments&&isInNonReferenceComment(e,t))){r.addStringOrCommentReference(e.fileName,createTextSpan(t,n.text.length))}return}if(!hasMatchingMeaning(o,r))return;let a=r.checker.getSymbolAtLocation(o);if(!a){return}const s=o.parent;if(isImportSpecifier(s)&&s.propertyName===o){return}if(isExportSpecifier(s)){S.assert(o.kind===80||o.kind===11);getReferencesAtExportSpecifier(o,a,s,n,r,i);return}if(isJSDocPropertyLikeTag(s)&&s.isNameFirst&&s.typeExpression&&isJSDocTypeLiteral(s.typeExpression.type)&&s.typeExpression.type.jsDocPropertyTags&&length(s.typeExpression.type.jsDocPropertyTags)){getReferencesAtJSDocTypeLiteral(s.typeExpression.type.jsDocPropertyTags,o,n,r);return}const c=getRelatedSymbol(n,a,o,r);if(!c){getReferenceForShorthandProperty(a,n,r);return}switch(r.specialSearchKind){case 0:if(i)addReference(o,c,r);break;case 1:addConstructorReferences(o,e,n,r);break;case 2:addClassStaticThisReferences(o,n,r);break;default:S.assertNever(r.specialSearchKind)}if(isInJSFile(o)&&isBindingElement(o.parent)&&isVariableDeclarationInitializedToBareOrAccessedRequire(o.parent.parent.parent)){a=o.parent.symbol;if(!a)return}getImportOrExportReferences(o,a,n,r)}function getReferencesAtJSDocTypeLiteral(e,t,n,r){const i=r.referenceAdder(n.symbol);addReference(t,n.symbol,r);forEach(e,(e=>{if(isQualifiedName(e.name)){i(e.name.left)}}))}function getReferencesAtExportSpecifier(e,t,n,r,i,o,a){S.assert(!a||!!i.options.providePrefixAndSuffixTextForRename,"If alwaysGetReferences is true, then prefix/suffix text must be enabled");const{parent:s,propertyName:c,name:l}=n;const d=s.parent;const p=getLocalSymbolForExportSpecifier(e,t,n,i.checker);if(!a&&!r.includes(p)){return}if(!c){if(!(i.options.use===2&&moduleExportNameIsDefault(l))){addRef()}}else if(e===c){if(!d.moduleSpecifier){addRef()}if(o&&i.options.use!==2&&i.markSeenReExportRHS(l)){addReference(l,S.checkDefined(n.symbol),i)}}else{if(i.markSeenReExportRHS(e)){addRef()}}if(!isForRenameWithPrefixAndSuffixText(i.options)||a){const t=moduleExportNameIsDefault(e)||moduleExportNameIsDefault(n.name);const r=t?1:0;const o=S.checkDefined(n.symbol);const a=getExportInfo(o,r,i.checker);if(a){searchForImportsOfExport(e,o,a,i)}}if(r.comingFrom!==1&&d.moduleSpecifier&&!c&&!isForRenameWithPrefixAndSuffixText(i.options)){const e=i.checker.getExportSpecifierLocalTargetSymbol(n);if(e)searchForImportedSymbol(e,i)}function addRef(){if(o)addReference(e,p,i)}}function getLocalSymbolForExportSpecifier(e,t,n,r){return isExportSpecifierAlias(e,n)&&r.getExportSpecifierLocalTargetSymbol(n)||t}function isExportSpecifierAlias(e,t){const{parent:n,propertyName:r,name:i}=t;S.assert(r===e||i===e);if(r){return r===e}else{return!n.parent.moduleSpecifier}}function getImportOrExportReferences(e,t,n,r){const i=getImportOrExportSymbol(e,t,r.checker,n.comingFrom===1);if(!i)return;const{symbol:o}=i;if(i.kind===0){if(!isForRenameWithPrefixAndSuffixText(r.options)){searchForImportedSymbol(o,r)}}else{searchForImportsOfExport(e,o,i.exportInfo,r)}}function getReferenceForShorthandProperty({flags:e,valueDeclaration:t},n,r){const i=r.checker.getShorthandAssignmentValueSymbol(t);const o=t&&getNameOfDeclaration(t);if(!(e&33554432)&&o&&n.includes(i)){addReference(o,i,r)}}function addReference(e,t,n){const{kind:r,symbol:i}="kind"in t?t:{kind:void 0,symbol:t};if(n.options.use===2&&e.kind===90){return}const o=n.referenceAdder(i);if(n.options.implementations){addImplementationReferences(e,o,n)}else{o(e,r)}}function addConstructorReferences(e,t,n,r){if(isNewExpressionTarget(e)){addReference(e,n.symbol,r)}const pusher=()=>r.referenceAdder(n.symbol);if(isClassLike(e.parent)){S.assert(e.kind===90||e.parent.name===e);findOwnConstructorReferences(n.symbol,t,pusher())}else{const t=tryGetClassByExtendingIdentifier(e);if(t){findSuperConstructorAccesses(t,pusher());findInheritedConstructorReferences(t,r)}}}function addClassStaticThisReferences(e,t,n){addReference(e,t.symbol,n);const r=e.parent;if(n.options.use===2||!isClassLike(r))return;S.assert(r.name===e);const i=n.referenceAdder(t.symbol);for(const e of r.members){if(!(isMethodOrAccessor(e)&&isStatic(e))){continue}if(e.body){e.body.forEachChild((function cb(e){if(e.kind===110){i(e)}else if(!isFunctionLike(e)&&!isClassLike(e)){e.forEachChild(cb)}}))}}}function findOwnConstructorReferences(e,t,n){const r=getClassConstructorSymbol(e);if(r&&r.declarations){for(const e of r.declarations){const r=findChildOfKind(e,137,t);S.assert(e.kind===176&&!!r);n(r)}}if(e.exports){e.exports.forEach((e=>{const t=e.valueDeclaration;if(t&&t.kind===174){const e=t.body;if(e){forEachDescendantOfKind(e,110,(e=>{if(isNewExpressionTarget(e)){n(e)}}))}}}))}}function getClassConstructorSymbol(e){return e.members&&e.members.get("__constructor")}function findSuperConstructorAccesses(e,t){const n=getClassConstructorSymbol(e.symbol);if(!(n&&n.declarations)){return}for(const e of n.declarations){S.assert(e.kind===176);const n=e.body;if(n){forEachDescendantOfKind(n,108,(e=>{if(isCallExpressionTarget(e)){t(e)}}))}}}function hasOwnConstructor(e){return!!getClassConstructorSymbol(e.symbol)}function findInheritedConstructorReferences(e,t){if(hasOwnConstructor(e))return;const n=e.symbol;const r=t.createSearch(void 0,n,void 0);getReferencesInContainerOrFiles(n,t,r)}function addImplementationReferences(e,t,n){if(isDeclarationName(e)&&isImplementation(e.parent)){t(e);return}if(e.kind!==80){return}if(e.parent.kind===304){getReferenceEntriesForShorthandPropertyAssignment(e,n.checker,t)}const r=getContainingNodeIfInHeritageClause(e);if(r){t(r);return}const i=findAncestor(e,(e=>!isQualifiedName(e.parent)&&!isTypeNode(e.parent)&&!isTypeElement(e.parent)));const o=i.parent;if(hasType(o)&&o.type===i&&n.markSeenContainingTypeReference(o)){if(hasInitializer(o)){addIfImplementation(o.initializer)}else if(isFunctionLike(o)&&o.body){const e=o.body;if(e.kind===241){forEachReturnStatement(e,(e=>{if(e.expression)addIfImplementation(e.expression)}))}else{addIfImplementation(e)}}else if(isAssertionExpression(o)||isSatisfiesExpression(o)){addIfImplementation(o.expression)}}function addIfImplementation(e){if(isImplementationExpression(e))t(e)}}function getContainingNodeIfInHeritageClause(e){return isIdentifier(e)||isPropertyAccessExpression(e)?getContainingNodeIfInHeritageClause(e.parent):isExpressionWithTypeArguments(e)?tryCast(e.parent.parent,or(isClassLike,isInterfaceDeclaration)):void 0}function isImplementationExpression(e){switch(e.kind){case 217:return isImplementationExpression(e.expression);case 219:case 218:case 210:case 231:case 209:return true;default:return false}}function explicitlyInheritsFrom(e,t,n,r){if(e===t){return true}const i=getSymbolId(e)+","+getSymbolId(t);const o=n.get(i);if(o!==void 0){return o}n.set(i,false);const a=!!e.declarations&&e.declarations.some((e=>getAllSuperTypeNodes(e).some((e=>{const i=r.getTypeAtLocation(e);return!!i&&!!i.symbol&&explicitlyInheritsFrom(i.symbol,t,n,r)}))));n.set(i,a);return a}function getReferencesForSuperKeyword(e){let t=getSuperContainer(e,false);if(!t){return void 0}let n=256;switch(t.kind){case 172:case 171:case 174:case 173:case 176:case 177:case 178:n&=getSyntacticModifierFlags(t);t=t.parent;break;default:return void 0}const r=t.getSourceFile();const i=mapDefined(getPossibleSymbolReferenceNodes(r,"super",t),(e=>{if(e.kind!==108){return}const r=getSuperContainer(e,false);return r&&isStatic(r)===!!n&&r.parent.symbol===t.symbol?nodeEntry(e):void 0}));return[{definition:{type:0,symbol:t.symbol},references:i}]}function isParameterName(e){return e.kind===80&&e.parent.kind===169&&e.parent.name===e}function getReferencesForThisKeyword(e,t,n){let r=getThisContainer(e,false,false);let i=256;switch(r.kind){case 174:case 173:if(isObjectLiteralMethod(r)){i&=getSyntacticModifierFlags(r);r=r.parent;break}case 172:case 171:case 176:case 177:case 178:i&=getSyntacticModifierFlags(r);r=r.parent;break;case 307:if(isExternalModule(r)||isParameterName(e)){return void 0}case 262:case 218:break;default:return void 0}const o=flatMap(r.kind===307?t:[r.getSourceFile()],(e=>{n.throwIfCancellationRequested();return getPossibleSymbolReferenceNodes(e,"this",isSourceFile(r)?e:r).filter((e=>{if(!isThis(e)){return false}const t=getThisContainer(e,false,false);if(!canHaveSymbol(t))return false;switch(r.kind){case 218:case 262:return r.symbol===t.symbol;case 174:case 173:return isObjectLiteralMethod(r)&&r.symbol===t.symbol;case 231:case 263:case 210:return t.parent&&canHaveSymbol(t.parent)&&r.symbol===t.parent.symbol&&isStatic(t)===!!i;case 307:return t.kind===307&&!isExternalModule(t)&&!isParameterName(e)}}))})).map((e=>nodeEntry(e)));const a=firstDefined(o,(e=>isParameter(e.node.parent)?e.node:void 0));return[{definition:{type:3,node:a||e},references:o}]}function getReferencesForStringLiteral(e,t,n,r){const i=getContextualTypeFromParentOrAncestorTypeNode(e,n);const o=flatMap(t,(t=>{r.throwIfCancellationRequested();return mapDefined(getPossibleSymbolReferenceNodes(t,e.text),(r=>{if(isStringLiteralLike(r)&&r.text===e.text){if(i){const e=getContextualTypeFromParentOrAncestorTypeNode(r,n);if(i!==n.getStringType()&&(i===e||isStringLiteralPropertyReference(r,n))){return nodeEntry(r,2)}}else{return isNoSubstitutionTemplateLiteral(r)&&!rangeIsOnSingleLine(r,t)?void 0:nodeEntry(r,2)}}}))}));return[{definition:{type:4,node:e},references:o}]}function isStringLiteralPropertyReference(e,t){if(isPropertySignature(e.parent)){return t.getPropertyOfType(t.getTypeAtLocation(e.parent.parent),e.text)}}function populateSearchSymbolSet(e,t,n,r,i,o){const a=[];forEachRelatedSymbol(e,t,n,r,!(r&&i),((t,n,r)=>{if(r){if(isStaticSymbol(e)!==isStaticSymbol(r)){r=void 0}}a.push(r||n||t)}),(()=>!o));return a}function forEachRelatedSymbol(e,t,n,r,i,o,a){const s=getContainingObjectLiteralElement(t);if(s){const e=n.getShorthandAssignmentValueSymbol(t.parent);if(e&&r){return o(e,void 0,void 0,3)}const i=n.getContextualType(s.parent);const a=i&&firstDefined(getPropertySymbolsFromContextualType(s,n,i,true),(e=>fromRoot(e,4)));if(a)return a;const c=getPropertySymbolOfDestructuringAssignment(t,n);const l=c&&o(c,void 0,void 0,4);if(l)return l;const d=e&&o(e,void 0,void 0,3);if(d)return d}const c=getMergedAliasedSymbolOfNamespaceExportDeclaration(t,e,n);if(c){const e=o(c,void 0,void 0,1);if(e)return e}const l=fromRoot(e);if(l)return l;if(e.valueDeclaration&&isParameterPropertyDeclaration(e.valueDeclaration,e.valueDeclaration.parent)){const t=n.getSymbolsOfParameterPropertyDeclaration(cast(e.valueDeclaration,isParameter),e.name);S.assert(t.length===2&&!!(t[0].flags&1)&&!!(t[1].flags&4));return fromRoot(e.flags&1?t[1]:t[0])}const d=getDeclarationOfKind(e,281);if(!r||d&&!d.propertyName){const e=d&&n.getExportSpecifierLocalTargetSymbol(d);if(e){const t=o(e,void 0,void 0,1);if(t)return t}}if(!r){let r;if(i){r=isObjectBindingElementWithoutPropertyName(t.parent)?getPropertySymbolFromBindingElement(n,t.parent):void 0}else{r=getPropertySymbolOfObjectBindingPatternWithoutPropertyName(e,n)}return r&&fromRoot(r,4)}S.assert(r);const p=i;if(p){const t=getPropertySymbolOfObjectBindingPatternWithoutPropertyName(e,n);return t&&fromRoot(t,4)}function fromRoot(e,t){return firstDefined(n.getRootSymbols(e),(r=>o(e,r,void 0,t)||(r.parent&&r.parent.flags&(32|64)&&a(r)?getPropertySymbolsFromBaseTypes(r.parent,r.name,n,(n=>o(e,r,n,t))):void 0)))}function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(e,t){const n=getDeclarationOfKind(e,208);if(n&&isObjectBindingElementWithoutPropertyName(n)){return getPropertySymbolFromBindingElement(t,n)}}}function getPropertySymbolsFromBaseTypes(e,t,n,r){const i=new Set;return recur(e);function recur(e){if(!(e.flags&(32|64))||!addToSeen(i,e))return;return firstDefined(e.declarations,(e=>firstDefined(getAllSuperTypeNodes(e),(e=>{const i=n.getTypeAtLocation(e);const o=i&&i.symbol&&n.getPropertyOfType(i,t);return i&&o&&(firstDefined(n.getRootSymbols(o),r)||recur(i.symbol))}))))}}function isStaticSymbol(e){if(!e.valueDeclaration)return false;const t=getEffectiveModifierFlags(e.valueDeclaration);return!!(t&256)}function getRelatedSymbol(e,t,n,r){const{checker:i}=r;return forEachRelatedSymbol(t,n,i,false,r.options.use!==2||!!r.options.providePrefixAndSuffixTextForRename,((n,r,i,o)=>{if(i){if(isStaticSymbol(t)!==isStaticSymbol(i)){i=void 0}}return e.includes(i||r||n)?{symbol:r&&!(getCheckFlags(n)&6)?r:n,kind:o}:void 0}),(t=>!(e.parents&&!e.parents.some((e=>explicitlyInheritsFrom(t.parent,e,r.inheritsFromCache,i))))))}function getIntersectingMeaningFromDeclarations(e,t){let n=getMeaningFromLocation(e);const{declarations:r}=t;if(r){let e;do{e=n;for(const e of r){const t=getMeaningFromDeclaration(e);if(t&n){n|=t}}}while(n!==e)}return n}e.getIntersectingMeaningFromDeclarations=getIntersectingMeaningFromDeclarations;function isImplementation(e){return!!(e.flags&33554432)?!(isInterfaceDeclaration(e)||isTypeAliasDeclaration(e)):isVariableLike(e)?hasInitializer(e):isFunctionLikeDeclaration(e)?!!e.body:isClassLike(e)||isModuleOrEnumDeclaration(e)}function getReferenceEntriesForShorthandPropertyAssignment(e,t,n){const r=t.getSymbolAtLocation(e);const i=t.getShorthandAssignmentValueSymbol(r.valueDeclaration);if(i){for(const e of i.getDeclarations()){if(getMeaningFromDeclaration(e)&1){n(e)}}}}e.getReferenceEntriesForShorthandPropertyAssignment=getReferenceEntriesForShorthandPropertyAssignment;function forEachDescendantOfKind(e,t,n){forEachChild(e,(e=>{if(e.kind===t){n(e)}forEachDescendantOfKind(e,t,n)}))}function tryGetClassByExtendingIdentifier(e){return tryGetClassExtendingExpressionWithTypeArguments(climbPastPropertyAccess(e).parent)}function getParentSymbolsOfPropertyAccess(e,t,n){const r=isRightSideOfPropertyAccess(e)?e.parent:void 0;const i=r&&n.getTypeAtLocation(r.expression);const o=mapDefined(i&&(i.isUnionOrIntersection()?i.types:i.symbol===t.parent?void 0:[i]),(e=>e.symbol&&e.symbol.flags&(32|64)?e.symbol:void 0));return o.length===0?void 0:o}function isForRenameWithPrefixAndSuffixText(e){return e.use===2&&e.providePrefixAndSuffixTextForRename}})(zf||(zf={}));var Vf={};__export(Vf,{createDefinitionInfo:()=>createDefinitionInfo,getDefinitionAndBoundSpan:()=>getDefinitionAndBoundSpan,getDefinitionAtPosition:()=>getDefinitionAtPosition,getReferenceAtPosition:()=>getReferenceAtPosition,getTypeDefinitionAtPosition:()=>getTypeDefinitionAtPosition});function getDefinitionAtPosition(e,t,n,r,i){var o;const a=getReferenceAtPosition(t,n,e);const s=a&&[getDefinitionInfoForFileReference(a.reference.fileName,a.fileName,a.unverified)]||d;if(a==null?void 0:a.file){return s}const c=getTouchingPropertyName(t,n);if(c===t){return void 0}const{parent:l}=c;const p=e.getTypeChecker();if(c.kind===164||isIdentifier(c)&&isJSDocOverrideTag(l)&&l.tagName===c){const e=getDefinitionFromOverriddenMember(p,c);if(e!==void 0||c.kind!==164){return e||d}}if(isJumpStatementTarget(c)){const e=getTargetLabel(c.parent,c.text);return e?[createDefinitionInfoFromName(p,e,"label",c.text,void 0)]:void 0}switch(c.kind){case 90:if(!isDefaultClause(c.parent)){break}case 84:const e=findAncestor(c.parent,isSwitchStatement);if(e){return[createDefinitionInfoFromSwitch(e,t)]}break}let u;switch(c.kind){case 107:case 135:case 127:u=isFunctionLikeDeclaration;const e=findAncestor(c,u);return e?[createDefinitionFromSignatureDeclaration(p,e)]:void 0}if(isStaticModifier(c)&&isClassStaticBlockDeclaration(c.parent)){const e=c.parent.parent;const{symbol:t,failedAliasResolution:n}=getSymbol(e,p,i);const r=filter(e.members,isClassStaticBlockDeclaration);const o=t?p.symbolToString(t,e):"";const a=c.getSourceFile();return map(r,(e=>{let{pos:t}=moveRangePastModifiers(e);t=skipTrivia(a.text,t);return createDefinitionInfoFromName(p,e,"constructor","static {}",o,false,n,{start:t,length:"static".length})}))}let{symbol:f,failedAliasResolution:m}=getSymbol(c,p,i);let _=c;if(r&&m){const e=forEach([c,...(f==null?void 0:f.declarations)||d],(e=>findAncestor(e,isAnyImportOrBareOrAccessedRequire)));const t=e&&tryGetModuleSpecifierFromDeclaration(e);if(t){({symbol:f,failedAliasResolution:m}=getSymbol(t,p,i));_=t}}if(!f&&isModuleSpecifierLike(_)){const n=(o=e.getResolvedModuleFromModuleSpecifier(_,t))==null?void 0:o.resolvedModule;if(n){return[{name:_.text,fileName:n.resolvedFileName,containerName:void 0,containerKind:void 0,kind:"script",textSpan:createTextSpan(0,0),failedAliasResolution:m,isAmbient:isDeclarationFileName(n.resolvedFileName),unverified:_!==c}]}}if(isModifier(c)&&(isClassElement(l)||isNamedDeclaration(l))){f=l.symbol}if(!f){return concatenate(s,getDefinitionInfoForIndexSignatures(c,p))}if(r&&every(f.declarations,(e=>e.getSourceFile().fileName===t.fileName)))return void 0;const g=tryGetSignatureDeclaration(p,c);if(g&&!(isJsxOpeningLikeElement(c.parent)&&isJsxConstructorLike(g))){const e=createDefinitionFromSignatureDeclaration(p,g,m);let declarationFilter=e=>e!==g;if(p.getRootSymbols(f).some((e=>symbolMatchesSignature(e,g)))){if(!isConstructorDeclaration(g))return[e];declarationFilter=e=>e!==g&&(isClassDeclaration(e)||isClassExpression(e))}const t=getDefinitionFromSymbol(p,f,c,m,declarationFilter)||d;return c.kind===108?[e,...t]:[...t,e]}if(c.parent.kind===304){const e=p.getShorthandAssignmentValueSymbol(f.valueDeclaration);const t=(e==null?void 0:e.declarations)?e.declarations.map((t=>createDefinitionInfo(t,p,e,c,false,m))):d;return concatenate(t,getDefinitionFromObjectLiteralElement(p,c))}if(isPropertyName(c)&&isBindingElement(l)&&isObjectBindingPattern(l.parent)&&c===(l.propertyName||l.name)){const e=getNameFromPropertyName(c);const t=p.getTypeAtLocation(l.parent);return e===void 0?d:flatMap(t.isUnion()?t.types:[t],(t=>{const n=t.getProperty(e);return n&&getDefinitionFromSymbol(p,n,c)}))}const y=getDefinitionFromObjectLiteralElement(p,c);return concatenate(s,y.length?y:getDefinitionFromSymbol(p,f,c,m))}function symbolMatchesSignature(e,t){var n;return e===t.symbol||e===t.symbol.parent||isAssignmentExpression(t.parent)||!isCallLikeExpression(t.parent)&&e===((n=tryCast(t.parent,canHaveSymbol))==null?void 0:n.symbol)}function getDefinitionFromObjectLiteralElement(e,t){const n=getContainingObjectLiteralElement(t);if(n){const r=n&&e.getContextualType(n.parent);if(r){return flatMap(getPropertySymbolsFromContextualType(n,e,r,false),(n=>getDefinitionFromSymbol(e,n,t)))}}return d}function getDefinitionFromOverriddenMember(e,t){const n=findAncestor(t,isClassElement);if(!(n&&n.name))return;const r=findAncestor(n,isClassLike);if(!r)return;const i=getEffectiveBaseTypeNode(r);if(!i)return;const o=skipParentheses(i.expression);const a=isClassExpression(o)?o.symbol:e.getSymbolAtLocation(o);if(!a)return;const s=unescapeLeadingUnderscores(getTextOfPropertyName(n.name));const c=hasStaticModifier(n)?e.getPropertyOfType(e.getTypeOfSymbol(a),s):e.getPropertyOfType(e.getDeclaredTypeOfSymbol(a),s);if(!c)return;return getDefinitionFromSymbol(e,c,t)}function getReferenceAtPosition(e,t,n){var r,i;const o=findReferenceInPosition(e.referencedFiles,t);if(o){const t=n.getSourceFileFromReference(e,o);return t&&{reference:o,fileName:t.fileName,file:t,unverified:false}}const a=findReferenceInPosition(e.typeReferenceDirectives,t);if(a){const t=(r=n.getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(a,e))==null?void 0:r.resolvedTypeReferenceDirective;const i=t&&n.getSourceFile(t.resolvedFileName);return i&&{reference:a,fileName:i.fileName,file:i,unverified:false}}const s=findReferenceInPosition(e.libReferenceDirectives,t);if(s){const e=n.getLibFileFromReference(s);return e&&{reference:s,fileName:e.fileName,file:e,unverified:false}}if(e.imports.length||e.moduleAugmentations.length){const r=getTouchingToken(e,t);let o;if(isModuleSpecifierLike(r)&&isExternalModuleNameRelative(r.text)&&(o=n.getResolvedModuleFromModuleSpecifier(r,e))){const t=(i=o.resolvedModule)==null?void 0:i.resolvedFileName;const a=t||resolvePath(getDirectoryPath(e.fileName),r.text);return{file:n.getSourceFile(a),fileName:a,reference:{pos:r.getStart(),end:r.getEnd(),fileName:r.text},unverified:!t}}}return void 0}var qf=new Set(["Array","ArrayLike","ReadonlyArray","Promise","PromiseLike","Iterable","IterableIterator","AsyncIterable","Set","WeakSet","ReadonlySet","Map","WeakMap","ReadonlyMap","Partial","Required","Readonly","Pick","Omit"]);function shouldUnwrapFirstTypeArgumentTypeDefinitionFromTypeReference(e,t){const n=t.symbol.name;if(!qf.has(n)){return false}const r=e.resolveName(n,void 0,788968,false);return!!r&&r===t.target.symbol}function shouldUnwrapFirstTypeArgumentTypeDefinitionFromAlias(e,t){if(!t.aliasSymbol){return false}const n=t.aliasSymbol.name;if(!qf.has(n)){return false}const r=e.resolveName(n,void 0,788968,false);return!!r&&r===t.aliasSymbol}function getFirstTypeArgumentDefinitions(e,t,n,r){var i,o;if(!!(getObjectFlags(t)&4)&&shouldUnwrapFirstTypeArgumentTypeDefinitionFromTypeReference(e,t)){return definitionFromType(e.getTypeArguments(t)[0],e,n,r)}if(shouldUnwrapFirstTypeArgumentTypeDefinitionFromAlias(e,t)&&t.aliasTypeArguments){return definitionFromType(t.aliasTypeArguments[0],e,n,r)}if(getObjectFlags(t)&32&&t.target&&shouldUnwrapFirstTypeArgumentTypeDefinitionFromAlias(e,t.target)){const a=(o=(i=t.aliasSymbol)==null?void 0:i.declarations)==null?void 0:o[0];if(a&&isTypeAliasDeclaration(a)&&isTypeReferenceNode(a.type)&&a.type.typeArguments){return definitionFromType(e.getTypeAtLocation(a.type.typeArguments[0]),e,n,r)}}return[]}function getTypeDefinitionAtPosition(e,t,n){const r=getTouchingPropertyName(t,n);if(r===t){return void 0}if(isImportMeta(r.parent)&&r.parent.name===r){return definitionFromType(e.getTypeAtLocation(r.parent),e,r.parent,false)}let{symbol:i,failedAliasResolution:o}=getSymbol(r,e,false);if(isModifier(r)&&(isClassElement(r.parent)||isNamedDeclaration(r.parent))){i=r.parent.symbol;o=false}if(!i)return void 0;const a=e.getTypeOfSymbolAtLocation(i,r);const s=tryGetReturnTypeOfFunction(i,a,e);const c=s&&definitionFromType(s,e,r,o);const[l,d]=c&&c.length!==0?[s,c]:[a,definitionFromType(a,e,r,o)];return d.length?[...getFirstTypeArgumentDefinitions(e,l,r,o),...d]:!(i.flags&111551)&&i.flags&788968?getDefinitionFromSymbol(e,skipAlias(i,e),r,o):void 0}function definitionFromType(e,t,n,r){return flatMap(e.isUnion()&&!(e.flags&32)?e.types:[e],(e=>e.symbol&&getDefinitionFromSymbol(t,e.symbol,n,r)))}function tryGetReturnTypeOfFunction(e,t,n){if(t.symbol===e||e.valueDeclaration&&t.symbol&&isVariableDeclaration(e.valueDeclaration)&&e.valueDeclaration.initializer===t.symbol.valueDeclaration){const e=t.getCallSignatures();if(e.length===1)return n.getReturnTypeOfSignature(first(e))}return void 0}function getDefinitionAndBoundSpan(e,t,n){const r=getDefinitionAtPosition(e,t,n);if(!r||r.length===0){return void 0}const i=findReferenceInPosition(t.referencedFiles,n)||findReferenceInPosition(t.typeReferenceDirectives,n)||findReferenceInPosition(t.libReferenceDirectives,n);if(i){return{definitions:r,textSpan:createTextSpanFromRange(i)}}const o=getTouchingPropertyName(t,n);const a=createTextSpan(o.getStart(),o.getWidth());return{definitions:r,textSpan:a}}function getDefinitionInfoForIndexSignatures(e,t){return mapDefined(t.getIndexInfosAtLocation(e),(e=>e.declaration&&createDefinitionFromSignatureDeclaration(t,e.declaration)))}function getSymbol(e,t,n){const r=t.getSymbolAtLocation(e);let i=false;if((r==null?void 0:r.declarations)&&r.flags&2097152&&!n&&shouldSkipAlias(e,r.declarations[0])){const e=t.getAliasedSymbol(r);if(e.declarations){return{symbol:e}}else{i=true}}return{symbol:r,failedAliasResolution:i}}function shouldSkipAlias(e,t){if(e.kind!==80&&(e.kind!==11||!isImportOrExportSpecifier(e.parent))){return false}if(e.parent===t){return true}if(t.kind===274){return false}return true}function isExpandoDeclaration(e){if(!isAssignmentDeclaration(e))return false;const t=findAncestor(e,(e=>{if(isAssignmentExpression(e))return true;if(!isAssignmentDeclaration(e))return"quit";return false}));return!!t&&getAssignmentDeclarationKind(t)===5}function getDefinitionFromSymbol(e,t,n,r,i){const o=i!==void 0?filter(t.declarations,i):t.declarations;const a=!i&&(getConstructSignatureDefinition()||getCallSignatureDefinition());if(a){return a}const s=filter(o,(e=>!isExpandoDeclaration(e)));const c=some(s)?s:o;return map(c,(i=>createDefinitionInfo(i,e,t,n,false,r)));function getConstructSignatureDefinition(){if(t.flags&32&&!(t.flags&(16|3))&&(isNewExpressionTarget(n)||n.kind===137)){const e=find(o,isClassLike);return e&&getSignatureDefinition(e.members,true)}}function getCallSignatureDefinition(){return isCallOrNewExpressionTarget(n)||isNameOfFunctionDeclaration(n)?getSignatureDefinition(o,false):void 0}function getSignatureDefinition(i,o){if(!i){return void 0}const a=i.filter(o?isConstructorDeclaration:isFunctionLike);const s=a.filter((e=>!!e.body));return a.length?s.length!==0?s.map((r=>createDefinitionInfo(r,e,t,n))):[createDefinitionInfo(last(a),e,t,n,false,r)]:void 0}}function createDefinitionInfo(e,t,n,r,i,o){const a=t.symbolToString(n);const s=cm.getSymbolKind(t,n,r);const c=n.parent?t.symbolToString(n.parent,r):"";return createDefinitionInfoFromName(t,e,s,a,c,i,o)}function createDefinitionInfoFromName(e,t,n,r,i,o,a,s){const c=t.getSourceFile();if(!s){const e=getNameOfDeclaration(t)||t;s=createTextSpanFromNode(e,c)}return{fileName:c.fileName,textSpan:s,kind:n,name:r,containerKind:void 0,containerName:i,...Rf.toContextSpan(s,c,Rf.getContextNode(t)),isLocal:!isDefinitionVisible(e,t),isAmbient:!!(t.flags&33554432),unverified:o,failedAliasResolution:a}}function createDefinitionInfoFromSwitch(e,t){const n=Rf.getContextNode(e);const r=createTextSpanFromNode(isContextWithStartAndEndNode(n)?n.start:n,t);return{fileName:t.fileName,textSpan:r,kind:"keyword",name:"switch",containerKind:void 0,containerName:"",...Rf.toContextSpan(r,t,n),isLocal:true,isAmbient:false,unverified:false,failedAliasResolution:void 0}}function isDefinitionVisible(e,t){if(e.isDeclarationVisible(t))return true;if(!t.parent)return false;if(hasInitializer(t.parent)&&t.parent.initializer===t)return isDefinitionVisible(e,t.parent);switch(t.kind){case 172:case 177:case 178:case 174:if(hasEffectiveModifier(t,2))return false;case 176:case 303:case 304:case 210:case 231:case 219:case 218:return isDefinitionVisible(e,t.parent);default:return false}}function createDefinitionFromSignatureDeclaration(e,t,n){return createDefinitionInfo(t,e,t.symbol,t,false,n)}function findReferenceInPosition(e,t){return find(e,(e=>textRangeContainsPositionInclusive(e,t)))}function getDefinitionInfoForFileReference(e,t,n){return{fileName:t,textSpan:createTextSpanFromBounds(0,0),kind:"script",name:e,containerName:void 0,containerKind:void 0,unverified:n}}function getAncestorCallLikeExpression(e){const t=findAncestor(e,(e=>!isRightSideOfPropertyAccess(e)));const n=t==null?void 0:t.parent;return n&&isCallLikeExpression(n)&&getInvokedExpression(n)===t?n:void 0}function tryGetSignatureDeclaration(e,t){const n=getAncestorCallLikeExpression(t);const r=n&&e.getResolvedSignature(n);return tryCast(r&&r.declaration,(e=>isFunctionLike(e)&&!isFunctionTypeNode(e)))}function isJsxConstructorLike(e){switch(e.kind){case 176:case 185:case 179:case 180:return true;default:return false}}var Hf={};__export(Hf,{provideInlayHints:()=>provideInlayHints});var leadingParameterNameCommentRegexFactory=e=>new RegExp(`^\\s?/\\*\\*?\\s?${e}\\s?\\*\\/\\s?$`);function shouldShowParameterNameHints(e){return e.includeInlayParameterNameHints==="literals"||e.includeInlayParameterNameHints==="all"}function shouldShowLiteralParameterNameHintsOnly(e){return e.includeInlayParameterNameHints==="literals"}function shouldUseInteractiveInlayHints(e){return e.interactiveInlayHints===true}function provideInlayHints(e){const{file:t,program:n,span:r,cancellationToken:i,preferences:o}=e;const a=t.text;const s=n.getCompilerOptions();const c=getQuotePreference(t,o);const l=n.getTypeChecker();const d=[];visitor(t);return d;function visitor(e){if(!e||e.getFullWidth()===0){return}switch(e.kind){case 267:case 263:case 264:case 262:case 231:case 218:case 174:case 219:i.throwIfCancellationRequested()}if(!textSpanIntersectsWith(r,e.pos,e.getFullWidth())){return}if(isTypeNode(e)&&!isExpressionWithTypeArguments(e)){return}if(o.includeInlayVariableTypeHints&&isVariableDeclaration(e)){visitVariableLikeDeclaration(e)}else if(o.includeInlayPropertyDeclarationTypeHints&&isPropertyDeclaration(e)){visitVariableLikeDeclaration(e)}else if(o.includeInlayEnumMemberValueHints&&isEnumMember(e)){visitEnumMember(e)}else if(shouldShowParameterNameHints(o)&&(isCallExpression(e)||isNewExpression(e))){visitCallOrNewExpression(e)}else{if(o.includeInlayFunctionParameterTypeHints&&isFunctionLikeDeclaration(e)&&hasContextSensitiveParameters(e)){visitFunctionLikeForParameterType(e)}if(o.includeInlayFunctionLikeReturnTypeHints&&isSignatureSupportingReturnAnnotation(e)){visitFunctionDeclarationLikeForReturnType(e)}}return forEachChild(e,visitor)}function isSignatureSupportingReturnAnnotation(e){return isArrowFunction(e)||isFunctionExpression(e)||isFunctionDeclaration(e)||isMethodDeclaration(e)||isGetAccessorDeclaration(e)}function addParameterHints(e,t,n,r){let i=`${r?"...":""}${e}`;let a;if(shouldUseInteractiveInlayHints(o)){a=[getNodeDisplayPart(i,t),{text:":"}];i=""}else{i+=":"}d.push({text:i,position:n,kind:"Parameter",whitespaceAfter:true,displayParts:a})}function addTypeHints(e,t){d.push({text:typeof e==="string"?`: ${e}`:"",displayParts:typeof e==="string"?void 0:[{text:": "},...e],position:t,kind:"Type",whitespaceBefore:true})}function addEnumMemberValueHints(e,t){d.push({text:`= ${e}`,position:t,kind:"Enum",whitespaceBefore:true})}function visitEnumMember(e){if(e.initializer){return}const t=l.getConstantValue(e);if(t!==void 0){addEnumMemberValueHints(t.toString(),e.end)}}function isModuleReferenceType(e){return e.symbol&&e.symbol.flags&1536}function visitVariableLikeDeclaration(e){if(e.initializer===void 0&&!(isPropertyDeclaration(e)&&!(l.getTypeAtLocation(e).flags&1))||isBindingPattern(e.name)||isVariableDeclaration(e)&&!isHintableDeclaration(e)){return}const t=getEffectiveTypeAnnotationNode(e);if(t){return}const n=l.getTypeAtLocation(e);if(isModuleReferenceType(n)){return}const r=typeToInlayHintParts(n);if(r){const t=typeof r==="string"?r:r.map((e=>e.text)).join("");const n=o.includeInlayVariableTypeHintsWhenTypeMatchesName===false&&equateStringsCaseInsensitive(e.name.getText(),t);if(n){return}addTypeHints(r,e.name.end)}}function visitCallOrNewExpression(e){const t=e.arguments;if(!t||!t.length){return}const n=l.getResolvedSignature(e);if(n===void 0)return;let r=0;for(const e of t){const t=skipParentheses(e);if(shouldShowLiteralParameterNameHintsOnly(o)&&!isHintableLiteral(t)){r++;continue}let i=0;if(isSpreadElement(t)){const e=l.getTypeAtLocation(t.expression);if(l.isTupleType(e)){const{elementFlags:t,fixedLength:n}=e.target;if(n===0){continue}const r=findIndex(t,(e=>!(e&1)));const o=r<0?n:r;if(o>0){i=r<0?n:r}}}const a=l.getParameterIdentifierInfoAtPosition(n,r);r=r+(i||1);if(a){const{parameter:n,parameterName:r,isRestParameter:i}=a;const s=o.includeInlayParameterNameHintsWhenArgumentMatchesName||!identifierOrAccessExpressionPostfixMatchesParameterName(t,r);if(!s&&!i){continue}const c=unescapeLeadingUnderscores(r);if(leadingCommentsContainsParameterName(t,c)){continue}addParameterHints(c,n,e.getStart(),i)}}}function identifierOrAccessExpressionPostfixMatchesParameterName(e,t){if(isIdentifier(e)){return e.text===t}if(isPropertyAccessExpression(e)){return e.name.text===t}return false}function leadingCommentsContainsParameterName(e,n){if(!isIdentifierText(n,zn(s),getLanguageVariant(t.scriptKind))){return false}const r=getLeadingCommentRanges(a,e.pos);if(!(r==null?void 0:r.length)){return false}const i=leadingParameterNameCommentRegexFactory(n);return some(r,(e=>i.test(a.substring(e.pos,e.end))))}function isHintableLiteral(e){switch(e.kind){case 224:{const t=e.operand;return isLiteralExpression(t)||isIdentifier(t)&&isInfinityOrNaNString(t.escapedText)}case 112:case 97:case 106:case 15:case 228:return true;case 80:{const t=e.escapedText;return isUndefined(t)||isInfinityOrNaNString(t)}}return isLiteralExpression(e)}function visitFunctionDeclarationLikeForReturnType(e){if(isArrowFunction(e)){if(!findChildOfKind(e,21,t)){return}}const n=getEffectiveReturnTypeNode(e);if(n||!e.body){return}const r=l.getSignatureFromDeclaration(e);if(!r){return}const i=l.getTypePredicateOfSignature(r);if(i==null?void 0:i.type){const t=typePredicateToInlayHintParts(i);if(t){addTypeHints(t,getTypeAnnotationPosition(e));return}}const o=l.getReturnTypeOfSignature(r);if(isModuleReferenceType(o)){return}const a=typeToInlayHintParts(o);if(a){addTypeHints(a,getTypeAnnotationPosition(e))}}function getTypeAnnotationPosition(e){const n=findChildOfKind(e,22,t);if(n){return n.end}return e.parameters.end}function visitFunctionLikeForParameterType(e){const t=l.getSignatureFromDeclaration(e);if(!t){return}let n=0;for(const r of e.parameters){if(isHintableDeclaration(r)){addParameterTypeHint(r,parameterIsThisKeyword(r)?t.thisParameter:t.parameters[n])}if(parameterIsThisKeyword(r)){continue}n++}}function addParameterTypeHint(e,t){const n=getEffectiveTypeAnnotationNode(e);if(n||t===void 0)return;const r=getParameterDeclarationTypeHints(t);if(r===void 0)return;addTypeHints(r,e.questionToken?e.questionToken.end:e.name.end)}function getParameterDeclarationTypeHints(e){const t=e.valueDeclaration;if(!t||!isParameter(t)){return void 0}const n=l.getTypeOfSymbolAtLocation(e,t);if(isModuleReferenceType(n)){return void 0}return typeToInlayHintParts(n)}function printTypeInSingleLine(e){const n=70221824|1048576|16384;const r=Ia();return usingSingleLineStringWriter((i=>{const o=l.typeToTypeNode(e,void 0,n);S.assertIsDefined(o,"should always get typenode");r.writeNode(4,o,t,i)}))}function printTypePredicateInSingleLine(e){const n=70221824|1048576|16384;const r=Ia();return usingSingleLineStringWriter((i=>{const o=l.typePredicateToTypePredicateNode(e,void 0,n);S.assertIsDefined(o,"should always get typePredicateNode");r.writeNode(4,o,t,i)}))}function typeToInlayHintParts(e){if(!shouldUseInteractiveInlayHints(o)){return printTypeInSingleLine(e)}const t=70221824|1048576|16384;const n=l.typeToTypeNode(e,void 0,t);S.assertIsDefined(n,"should always get typeNode");return getInlayHintDisplayParts(n)}function typePredicateToInlayHintParts(e){if(!shouldUseInteractiveInlayHints(o)){return printTypePredicateInSingleLine(e)}const t=70221824|1048576|16384;const n=l.typePredicateToTypePredicateNode(e,void 0,t);S.assertIsDefined(n,"should always get typenode");return getInlayHintDisplayParts(n)}function getInlayHintDisplayParts(e){const t=[];visitForDisplayParts(e);return t;function visitForDisplayParts(e){var n,r;if(!e){return}const i=tokenToString(e.kind);if(i){t.push({text:i});return}if(isLiteralExpression(e)){t.push({text:getLiteralText2(e)});return}switch(e.kind){case 80:S.assertNode(e,isIdentifier);const i=idText(e);const o=e.symbol&&e.symbol.declarations&&e.symbol.declarations.length&&getNameOfDeclaration(e.symbol.declarations[0]);if(o){t.push(getNodeDisplayPart(i,o))}else{t.push({text:i})}break;case 166:S.assertNode(e,isQualifiedName);visitForDisplayParts(e.left);t.push({text:"."});visitForDisplayParts(e.right);break;case 182:S.assertNode(e,isTypePredicateNode);if(e.assertsModifier){t.push({text:"asserts "})}visitForDisplayParts(e.parameterName);if(e.type){t.push({text:" is "});visitForDisplayParts(e.type)}break;case 183:S.assertNode(e,isTypeReferenceNode);visitForDisplayParts(e.typeName);if(e.typeArguments){t.push({text:"<"});visitDisplayPartList(e.typeArguments,", ");t.push({text:">"})}break;case 168:S.assertNode(e,isTypeParameterDeclaration);if(e.modifiers){visitDisplayPartList(e.modifiers," ")}visitForDisplayParts(e.name);if(e.constraint){t.push({text:" extends "});visitForDisplayParts(e.constraint)}if(e.default){t.push({text:" = "});visitForDisplayParts(e.default)}break;case 169:S.assertNode(e,isParameter);if(e.modifiers){visitDisplayPartList(e.modifiers," ")}if(e.dotDotDotToken){t.push({text:"..."})}visitForDisplayParts(e.name);if(e.questionToken){t.push({text:"?"})}if(e.type){t.push({text:": "});visitForDisplayParts(e.type)}break;case 185:S.assertNode(e,isConstructorTypeNode);t.push({text:"new "});visitParametersAndTypeParameters(e);t.push({text:" => "});visitForDisplayParts(e.type);break;case 186:S.assertNode(e,isTypeQueryNode);t.push({text:"typeof "});visitForDisplayParts(e.exprName);if(e.typeArguments){t.push({text:"<"});visitDisplayPartList(e.typeArguments,", ");t.push({text:">"})}break;case 187:S.assertNode(e,isTypeLiteralNode);t.push({text:"{"});if(e.members.length){t.push({text:" "});visitDisplayPartList(e.members,"; ");t.push({text:" "})}t.push({text:"}"});break;case 188:S.assertNode(e,isArrayTypeNode);visitForDisplayParts(e.elementType);t.push({text:"[]"});break;case 189:S.assertNode(e,isTupleTypeNode);t.push({text:"["});visitDisplayPartList(e.elements,", ");t.push({text:"]"});break;case 202:S.assertNode(e,isNamedTupleMember);if(e.dotDotDotToken){t.push({text:"..."})}visitForDisplayParts(e.name);if(e.questionToken){t.push({text:"?"})}t.push({text:": "});visitForDisplayParts(e.type);break;case 190:S.assertNode(e,isOptionalTypeNode);visitForDisplayParts(e.type);t.push({text:"?"});break;case 191:S.assertNode(e,isRestTypeNode);t.push({text:"..."});visitForDisplayParts(e.type);break;case 192:S.assertNode(e,isUnionTypeNode);visitDisplayPartList(e.types," | ");break;case 193:S.assertNode(e,isIntersectionTypeNode);visitDisplayPartList(e.types," & ");break;case 194:S.assertNode(e,isConditionalTypeNode);visitForDisplayParts(e.checkType);t.push({text:" extends "});visitForDisplayParts(e.extendsType);t.push({text:" ? "});visitForDisplayParts(e.trueType);t.push({text:" : "});visitForDisplayParts(e.falseType);break;case 195:S.assertNode(e,isInferTypeNode);t.push({text:"infer "});visitForDisplayParts(e.typeParameter);break;case 196:S.assertNode(e,isParenthesizedTypeNode);t.push({text:"("});visitForDisplayParts(e.type);t.push({text:")"});break;case 198:S.assertNode(e,isTypeOperatorNode);t.push({text:`${tokenToString(e.operator)} `});visitForDisplayParts(e.type);break;case 199:S.assertNode(e,isIndexedAccessTypeNode);visitForDisplayParts(e.objectType);t.push({text:"["});visitForDisplayParts(e.indexType);t.push({text:"]"});break;case 200:S.assertNode(e,isMappedTypeNode);t.push({text:"{ "});if(e.readonlyToken){if(e.readonlyToken.kind===40){t.push({text:"+"})}else if(e.readonlyToken.kind===41){t.push({text:"-"})}t.push({text:"readonly "})}t.push({text:"["});visitForDisplayParts(e.typeParameter);if(e.nameType){t.push({text:" as "});visitForDisplayParts(e.nameType)}t.push({text:"]"});if(e.questionToken){if(e.questionToken.kind===40){t.push({text:"+"})}else if(e.questionToken.kind===41){t.push({text:"-"})}t.push({text:"?"})}t.push({text:": "});if(e.type){visitForDisplayParts(e.type)}t.push({text:"; }"});break;case 201:S.assertNode(e,isLiteralTypeNode);visitForDisplayParts(e.literal);break;case 184:S.assertNode(e,isFunctionTypeNode);visitParametersAndTypeParameters(e);t.push({text:" => "});visitForDisplayParts(e.type);break;case 205:S.assertNode(e,isImportTypeNode);if(e.isTypeOf){t.push({text:"typeof "})}t.push({text:"import("});visitForDisplayParts(e.argument);if(e.assertions){t.push({text:", { assert: "});visitDisplayPartList(e.assertions.assertClause.elements,", ");t.push({text:" }"})}t.push({text:")"});if(e.qualifier){t.push({text:"."});visitForDisplayParts(e.qualifier)}if(e.typeArguments){t.push({text:"<"});visitDisplayPartList(e.typeArguments,", ");t.push({text:">"})}break;case 171:S.assertNode(e,isPropertySignature);if((n=e.modifiers)==null?void 0:n.length){visitDisplayPartList(e.modifiers," ");t.push({text:" "})}visitForDisplayParts(e.name);if(e.questionToken){t.push({text:"?"})}if(e.type){t.push({text:": "});visitForDisplayParts(e.type)}break;case 181:S.assertNode(e,isIndexSignatureDeclaration);t.push({text:"["});visitDisplayPartList(e.parameters,", ");t.push({text:"]"});if(e.type){t.push({text:": "});visitForDisplayParts(e.type)}break;case 173:S.assertNode(e,isMethodSignature);if((r=e.modifiers)==null?void 0:r.length){visitDisplayPartList(e.modifiers," ");t.push({text:" "})}visitForDisplayParts(e.name);if(e.questionToken){t.push({text:"?"})}visitParametersAndTypeParameters(e);if(e.type){t.push({text:": "});visitForDisplayParts(e.type)}break;case 179:S.assertNode(e,isCallSignatureDeclaration);visitParametersAndTypeParameters(e);if(e.type){t.push({text:": "});visitForDisplayParts(e.type)}break;case 207:S.assertNode(e,isArrayBindingPattern);t.push({text:"["});visitDisplayPartList(e.elements,", ");t.push({text:"]"});break;case 206:S.assertNode(e,isObjectBindingPattern);t.push({text:"{"});if(e.elements.length){t.push({text:" "});visitDisplayPartList(e.elements,", ");t.push({text:" "})}t.push({text:"}"});break;case 208:S.assertNode(e,isBindingElement);visitForDisplayParts(e.name);break;case 224:S.assertNode(e,isPrefixUnaryExpression);t.push({text:tokenToString(e.operator)});visitForDisplayParts(e.operand);break;case 203:S.assertNode(e,isTemplateLiteralTypeNode);visitForDisplayParts(e.head);e.templateSpans.forEach(visitForDisplayParts);break;case 16:S.assertNode(e,isTemplateHead);t.push({text:getLiteralText2(e)});break;case 204:S.assertNode(e,isTemplateLiteralTypeSpan);visitForDisplayParts(e.type);visitForDisplayParts(e.literal);break;case 17:S.assertNode(e,isTemplateMiddle);t.push({text:getLiteralText2(e)});break;case 18:S.assertNode(e,isTemplateTail);t.push({text:getLiteralText2(e)});break;case 197:S.assertNode(e,isThisTypeNode);t.push({text:"this"});break;default:S.failBadSyntaxKind(e)}}function visitParametersAndTypeParameters(e){if(e.typeParameters){t.push({text:"<"});visitDisplayPartList(e.typeParameters,", ");t.push({text:">"})}t.push({text:"("});visitDisplayPartList(e.parameters,", ");t.push({text:")"})}function visitDisplayPartList(e,n){e.forEach(((e,r)=>{if(r>0){t.push({text:n})}visitForDisplayParts(e)}))}function getLiteralText2(e){switch(e.kind){case 11:return c===0?`'${escapeString(e.text,39)}'`:`"${escapeString(e.text,34)}"`;case 16:case 17:case 18:{const t=e.rawText??escapeTemplateSubstitution(escapeString(e.text,96));switch(e.kind){case 16:return"`"+t+"${";case 17:return"}"+t+"${";case 18:return"}"+t+"`"}}}return e.text}}function isUndefined(e){return e==="undefined"}function isHintableDeclaration(e){if((isPartOfParameterDeclaration(e)||isVariableDeclaration(e)&&isVarConst(e))&&e.initializer){const t=skipParentheses(e.initializer);return!(isHintableLiteral(t)||isNewExpression(t)||isObjectLiteralExpression(t)||isAssertionExpression(t))}return true}function getNodeDisplayPart(e,t){const n=t.getSourceFile();return{text:e,span:createTextSpanFromNode(t,n),file:n.fileName}}}var Gf={};__export(Gf,{getDocCommentTemplateAtPosition:()=>getDocCommentTemplateAtPosition,getJSDocParameterNameCompletionDetails:()=>getJSDocParameterNameCompletionDetails,getJSDocParameterNameCompletions:()=>getJSDocParameterNameCompletions,getJSDocTagCompletionDetails:()=>getJSDocTagCompletionDetails,getJSDocTagCompletions:()=>getJSDocTagCompletions,getJSDocTagNameCompletionDetails:()=>Xf,getJSDocTagNameCompletions:()=>getJSDocTagNameCompletions,getJsDocCommentsFromDeclarations:()=>getJsDocCommentsFromDeclarations,getJsDocTagsFromDeclarations:()=>getJsDocTagsFromDeclarations});var Kf=["abstract","access","alias","argument","async","augments","author","borrows","callback","class","classdesc","constant","constructor","constructs","copyright","default","deprecated","description","emits","enum","event","example","exports","extends","external","field","file","fileoverview","fires","function","generator","global","hideconstructor","host","ignore","implements","import","inheritdoc","inner","instance","interface","kind","lends","license","link","linkcode","linkplain","listens","member","memberof","method","mixes","module","name","namespace","overload","override","package","param","private","prop","property","protected","public","readonly","requires","returns","satisfies","see","since","static","summary","template","this","throws","todo","tutorial","type","typedef","var","variation","version","virtual","yields"];var $f;var Qf;function getJsDocCommentsFromDeclarations(e,t){const n=[];forEachUnique(e,(e=>{for(const r of getCommentHavingNodes(e)){const i=isJSDoc(r)&&r.tags&&find(r.tags,(e=>e.kind===327&&(e.tagName.escapedText==="inheritDoc"||e.tagName.escapedText==="inheritdoc")));if(r.comment===void 0&&!i||isJSDoc(r)&&e.kind!==346&&e.kind!==338&&r.tags&&r.tags.some((e=>e.kind===346||e.kind===338))&&!r.tags.some((e=>e.kind===341||e.kind===342))){continue}let o=r.comment?getDisplayPartsFromComment(r.comment,t):[];if(i&&i.comment){o=o.concat(getDisplayPartsFromComment(i.comment,t))}if(!contains(n,o,isIdenticalListOfDisplayParts)){n.push(o)}}}));return flatten(intersperse(n,[lineBreakPart()]))}function isIdenticalListOfDisplayParts(e,t){return arrayIsEqualTo(e,t,((e,t)=>e.kind===t.kind&&e.text===t.text))}function getCommentHavingNodes(e){switch(e.kind){case 341:case 348:return[e];case 338:case 346:return[e,e.parent];case 323:if(isJSDocOverloadTag(e.parent)){return[e.parent.parent]}default:return getJSDocCommentsAndTags(e)}}function getJsDocTagsFromDeclarations(e,t){const n=[];forEachUnique(e,(e=>{const r=getJSDocTags(e);if(r.some((e=>e.kind===346||e.kind===338))&&!r.some((e=>e.kind===341||e.kind===342))){return}for(const e of r){n.push({name:e.tagName.text,text:getCommentDisplayParts(e,t)});n.push(...getJSDocPropertyTagsInfo(tryGetJSDocPropertyTags(e),t))}}));return n}function getJSDocPropertyTagsInfo(e,t){return flatMap(e,(e=>concatenate([{name:e.tagName.text,text:getCommentDisplayParts(e,t)}],getJSDocPropertyTagsInfo(tryGetJSDocPropertyTags(e),t))))}function tryGetJSDocPropertyTags(e){return isJSDocPropertyLikeTag(e)&&e.isNameFirst&&e.typeExpression&&isJSDocTypeLiteral(e.typeExpression.type)?e.typeExpression.type.jsDocPropertyTags:void 0}function getDisplayPartsFromComment(e,t){if(typeof e==="string"){return[textPart(e)]}return flatMap(e,(e=>e.kind===321?[textPart(e.text)]:buildLinkParts(e,t)))}function getCommentDisplayParts(e,t){const{comment:n,kind:r}=e;const i=getTagNameDisplayPart(r);switch(r){case 349:const r=e.typeExpression;return r?withNode(r):n===void 0?void 0:getDisplayPartsFromComment(n,t);case 329:return withNode(e.class);case 328:return withNode(e.class);case 345:const o=e;const a=[];if(o.constraint){a.push(textPart(o.constraint.getText()))}if(length(o.typeParameters)){if(length(a)){a.push(spacePart())}const e=o.typeParameters[o.typeParameters.length-1];forEach(o.typeParameters,(t=>{a.push(i(t.getText()));if(e!==t){a.push(...[punctuationPart(28),spacePart()])}}))}if(n){a.push(...[spacePart(),...getDisplayPartsFromComment(n,t)])}return a;case 344:case 350:return withNode(e.typeExpression);case 346:case 338:case 348:case 341:case 347:const{name:s}=e;return s?withNode(s):n===void 0?void 0:getDisplayPartsFromComment(n,t);default:return n===void 0?void 0:getDisplayPartsFromComment(n,t)}function withNode(e){return addComment(e.getText())}function addComment(e){if(n){if(e.match(/^https?$/)){return[textPart(e),...getDisplayPartsFromComment(n,t)]}else{return[i(e),spacePart(),...getDisplayPartsFromComment(n,t)]}}else{return[textPart(e)]}}}function getTagNameDisplayPart(e){switch(e){case 341:return parameterNamePart;case 348:return propertyNamePart;case 345:return typeParameterNamePart;case 346:case 338:return typeAliasNamePart;default:return textPart}}function getJSDocTagNameCompletions(){return $f||($f=map(Kf,(e=>({name:e,kind:"keyword",kindModifiers:"",sortText:xf.SortText.LocationPriority}))))}var Xf=getJSDocTagCompletionDetails;function getJSDocTagCompletions(){return Qf||(Qf=map(Kf,(e=>({name:`@${e}`,kind:"keyword",kindModifiers:"",sortText:xf.SortText.LocationPriority}))))}function getJSDocTagCompletionDetails(e){return{name:e,kind:"",kindModifiers:"",displayParts:[textPart(e)],documentation:d,tags:void 0,codeActions:void 0}}function getJSDocParameterNameCompletions(e){if(!isIdentifier(e.name)){return d}const t=e.name.text;const n=e.parent;const r=n.parent;if(!isFunctionLike(r))return[];return mapDefined(r.parameters,(r=>{if(!isIdentifier(r.name))return void 0;const i=r.name.text;if(n.tags.some((t=>t!==e&&isJSDocParameterTag(t)&&isIdentifier(t.name)&&t.name.escapedText===i))||t!==void 0&&!startsWith(i,t)){return void 0}return{name:i,kind:"parameter",kindModifiers:"",sortText:xf.SortText.LocationPriority}}))}function getJSDocParameterNameCompletionDetails(e){return{name:e,kind:"parameter",kindModifiers:"",displayParts:[textPart(e)],documentation:d,tags:void 0,codeActions:void 0}}function getDocCommentTemplateAtPosition(e,t,n,r){const i=getTokenAtPosition(t,n);const o=findAncestor(i,isJSDoc);if(o&&(o.comment!==void 0||length(o.tags))){return void 0}const a=i.getStart(t);if(!o&&a0;if(_&&!h){const t=g+e+f+" * ";const r=a===n?e+f:"";const i=t+e+_+f+y+r;return{newText:i,caretOffset:t.length}}return{newText:g+y,caretOffset:3}}function getIndentationStringAtPosition(e,t){const{text:n}=e;const r=getLineStartPositionForPosition(t,e);let i=r;for(;i<=t&&isWhiteSpaceSingleLine(n.charCodeAt(i));i++);return n.slice(r,i)}function parameterDocComments(e,t,n,r){return e.map((({name:e,dotDotDotToken:i},o)=>{const a=e.kind===80?e.text:"param"+o;const s=t?i?"{...any} ":"{any} ":"";return`${n} * @param ${s}${a}${r}`})).join("")}function returnsDocComment(e,t){return`${e} * @returns${t}`}function getCommentOwnerInfo(e,t){return forEachAncestor(e,(e=>getCommentOwnerInfoWorker(e,t)))}function getCommentOwnerInfoWorker(e,t){switch(e.kind){case 262:case 218:case 174:case 176:case 173:case 219:const n=e;return{commentOwner:e,parameters:n.parameters,hasReturn:hasReturn(n,t)};case 303:return getCommentOwnerInfoWorker(e.initializer,t);case 263:case 264:case 266:case 306:case 265:return{commentOwner:e};case 171:{const n=e;return n.type&&isFunctionTypeNode(n.type)?{commentOwner:e,parameters:n.type.parameters,hasReturn:hasReturn(n.type,t)}:{commentOwner:e}}case 243:{const n=e;const r=n.declarationList.declarations;const i=r.length===1&&r[0].initializer?getRightHandSideOfAssignment(r[0].initializer):void 0;return i?{commentOwner:e,parameters:i.parameters,hasReturn:hasReturn(i,t)}:{commentOwner:e}}case 307:return"quit";case 267:return e.parent.kind===267?void 0:{commentOwner:e};case 244:return getCommentOwnerInfoWorker(e.expression,t);case 226:{const n=e;if(getAssignmentDeclarationKind(n)===0){return"quit"}return isFunctionLike(n.right)?{commentOwner:e,parameters:n.right.parameters,hasReturn:hasReturn(n.right,t)}:{commentOwner:e}}case 172:const r=e.initializer;if(r&&(isFunctionExpression(r)||isArrowFunction(r))){return{commentOwner:e,parameters:r.parameters,hasReturn:hasReturn(r,t)}}}}function hasReturn(e,t){return!!(t==null?void 0:t.generateReturnInDocTemplate)&&(isFunctionTypeNode(e)||isArrowFunction(e)&&isExpression(e.body)||isFunctionLikeDeclaration(e)&&e.body&&isBlock(e.body)&&!!forEachReturnStatement(e.body,(e=>e)))}function getRightHandSideOfAssignment(e){while(e.kind===217){e=e.expression}switch(e.kind){case 218:case 219:return e;case 231:return find(e.members,isConstructorDeclaration)}}var Yf={};__export(Yf,{mapCode:()=>mapCode});function mapCode(e,t,n,r,i,o){return dm.ChangeTracker.with({host:r,formatContext:i,preferences:o},(r=>{const i=t.map((t=>parse(e,t)));const o=n&&flatten(n);for(const t of i){placeNodeGroup(e,r,t,o)}}))}function parse(e,t){const n=[{parse:()=>createSourceFile("__mapcode_content_nodes.ts",t,e.languageVersion,true,e.scriptKind),body:e=>e.statements},{parse:()=>createSourceFile("__mapcode_class_content_nodes.ts",`class __class {\n${t}\n}`,e.languageVersion,true,e.scriptKind),body:e=>e.statements[0].members}];const r=[];for(const{parse:e,body:t}of n){const n=e();const i=t(n);if(i.length&&n.parseDiagnostics.length===0){return i}else if(i.length){r.push({sourceFile:n,body:i})}}r.sort(((e,t)=>e.sourceFile.parseDiagnostics.length-t.sourceFile.parseDiagnostics.length));const{body:i}=r[0];return i}function placeNodeGroup(e,t,n,r){if(isClassElement(n[0])||isTypeElement(n[0])){placeClassNodeGroup(e,t,n,r)}else{placeStatements(e,t,n,r)}}function placeClassNodeGroup(e,t,n,r){let i;if(!r||!r.length){i=find(e.statements,or(isClassLike,isInterfaceDeclaration))}else{i=forEach(r,(t=>findAncestor(getTokenAtPosition(e,t.start),or(isClassLike,isInterfaceDeclaration))))}if(!i){return}const o=i.members.find((e=>n.some((t=>matchNode(t,e)))));if(o){const r=findLast(i.members,(e=>n.some((t=>matchNode(t,e)))));forEach(n,wipeNode);t.replaceNodeRangeWithNodes(e,o,r,n);return}forEach(n,wipeNode);t.insertNodesAfter(e,i.members[i.members.length-1],n)}function placeStatements(e,t,n,r){if(!(r==null?void 0:r.length)){t.insertNodesAtEndOfFile(e,n,false);return}for(const i of r){const r=findAncestor(getTokenAtPosition(e,i.start),(e=>or(isBlock,isSourceFile)(e)&&some(e.statements,(e=>n.some((t=>matchNode(t,e)))))));if(r){const i=r.statements.find((e=>n.some((t=>matchNode(t,e)))));if(i){const o=findLast(r.statements,(e=>n.some((t=>matchNode(t,e)))));forEach(n,wipeNode);t.replaceNodeRangeWithNodes(e,i,o,n);return}}}let i=e.statements;for(const t of r){const n=findAncestor(getTokenAtPosition(e,t.start),isBlock);if(n){i=n.statements;break}}forEach(n,wipeNode);t.insertNodesAfter(e,i[i.length-1],n)}function matchNode(e,t){var n,r,i,o,a,s;if(e.kind!==t.kind){return false}if(e.kind===176){return e.kind===t.kind}if(isNamedDeclaration(e)&&isNamedDeclaration(t)){return e.name.getText()===t.name.getText()}if(isIfStatement(e)&&isIfStatement(t)){return e.expression.getText()===t.expression.getText()}if(isWhileStatement(e)&&isWhileStatement(t)){return e.expression.getText()===t.expression.getText()}if(isForStatement(e)&&isForStatement(t)){return((n=e.initializer)==null?void 0:n.getText())===((r=t.initializer)==null?void 0:r.getText())&&((i=e.incrementor)==null?void 0:i.getText())===((o=t.incrementor)==null?void 0:o.getText())&&((a=e.condition)==null?void 0:a.getText())===((s=t.condition)==null?void 0:s.getText())}if(isForInOrOfStatement(e)&&isForInOrOfStatement(t)){return e.expression.getText()===t.expression.getText()&&e.initializer.getText()===t.initializer.getText()}if(isLabeledStatement(e)&&isLabeledStatement(t)){return e.label.getText()===t.label.getText()}if(e.getText()===t.getText()){return true}return false}function wipeNode(e){resetNodePositions(e);e.parent=void 0}function resetNodePositions(e){e.pos=-1;e.end=-1;e.forEachChild(resetNodePositions)}var Zf={};__export(Zf,{compareImportsOrRequireStatements:()=>compareImportsOrRequireStatements,compareModuleSpecifiers:()=>compareModuleSpecifiers2,getImportDeclarationInsertionIndex:()=>getImportDeclarationInsertionIndex,getImportSpecifierInsertionIndex:()=>getImportSpecifierInsertionIndex,getNamedImportSpecifierComparerWithDetection:()=>getNamedImportSpecifierComparerWithDetection,getOrganizeImportsStringComparerWithDetection:()=>getOrganizeImportsStringComparerWithDetection,organizeImports:()=>organizeImports,testCoalesceExports:()=>testCoalesceExports,testCoalesceImports:()=>testCoalesceImports});function organizeImports(e,t,n,r,i,o){const a=dm.ChangeTracker.fromContext({host:n,formatContext:t,preferences:i});const s=o==="SortAndCombine"||o==="All";const c=s;const l=o==="RemoveUnused"||o==="All";const d=e.statements.filter(isImportDeclaration);const p=groupByNewlineContiguous(e,d);const{comparersToTest:u,typeOrdersToTest:f}=getDetectionLists(i);const m=u[0];const _={moduleSpecifierComparer:typeof i.organizeImportsIgnoreCase==="boolean"?m:void 0,namedImportComparer:typeof i.organizeImportsIgnoreCase==="boolean"?m:void 0,typeOrder:i.organizeImportsTypeOrder};if(typeof i.organizeImportsIgnoreCase!=="boolean"){({comparer:_.moduleSpecifierComparer}=detectModuleSpecifierCaseBySort(p,u))}if(!_.typeOrder||typeof i.organizeImportsIgnoreCase!=="boolean"){const e=detectNamedImportOrganizationBySort(d,u,f);if(e){const{namedImportComparer:t,typeOrder:n}=e;_.namedImportComparer=_.namedImportComparer??t;_.typeOrder=_.typeOrder??n}}p.forEach((e=>organizeImportsWorker(e,_)));if(o!=="RemoveUnused"){getTopLevelExportGroups(e).forEach((e=>organizeExportsWorker(e,_.namedImportComparer)))}for(const t of e.statements.filter(isAmbientModule)){if(!t.body)continue;const n=groupByNewlineContiguous(e,t.body.statements.filter(isImportDeclaration));n.forEach((e=>organizeImportsWorker(e,_)));if(o!=="RemoveUnused"){const e=t.body.statements.filter(isExportDeclaration);organizeExportsWorker(e,_.namedImportComparer)}}return a.getChanges();function organizeDeclsWorker(r,i){if(length(r)===0){return}setEmitFlags(r[0],1024);const o=c?group(r,(e=>getExternalModuleName2(e.moduleSpecifier))):[r];const l=s?toSorted(o,((e,t)=>compareModuleSpecifiersWorker(e[0].moduleSpecifier,t[0].moduleSpecifier,_.moduleSpecifierComparer??m))):o;const d=flatMap(l,(e=>getExternalModuleName2(e[0].moduleSpecifier)||e[0].moduleSpecifier===void 0?i(e):e));if(d.length===0){a.deleteNodes(e,r,{leadingTriviaOption:dm.LeadingTriviaOption.Exclude,trailingTriviaOption:dm.TrailingTriviaOption.Include},true)}else{const i={leadingTriviaOption:dm.LeadingTriviaOption.Exclude,trailingTriviaOption:dm.TrailingTriviaOption.Include,suffix:getNewLineOrDefaultFromHost(n,t.options)};a.replaceNodeWithNodes(e,r[0],d,i);const o=a.nodeHasTrailingComment(e,r[0],i);a.deleteNodes(e,r.slice(1),{trailingTriviaOption:dm.TrailingTriviaOption.Include},o)}}function organizeImportsWorker(t,n){const i=n.moduleSpecifierComparer??m;const o=n.namedImportComparer??m;const a=n.typeOrder??"last";const d=getNamedImportSpecifierComparer({organizeImportsTypeOrder:a},o);const processImportsOfSameModuleSpecifier=t=>{if(l)t=removeUnusedImports(t,e,r);if(c)t=coalesceImportsWorker(t,i,d,e);if(s)t=toSorted(t,((e,t)=>compareImportsOrRequireStatements(e,t,i)));return t};organizeDeclsWorker(t,processImportsOfSameModuleSpecifier)}function organizeExportsWorker(e,t){const n=getNamedImportSpecifierComparer(i,t);organizeDeclsWorker(e,(e=>coalesceExportsWorker(e,n)))}}function getDetectionLists(e){return{comparersToTest:typeof e.organizeImportsIgnoreCase==="boolean"?[getOrganizeImportsStringComparer(e,e.organizeImportsIgnoreCase)]:[getOrganizeImportsStringComparer(e,true),getOrganizeImportsStringComparer(e,false)],typeOrdersToTest:e.organizeImportsTypeOrder?[e.organizeImportsTypeOrder]:["last","inline","first"]}}function groupByNewlineContiguous(e,t){const n=createScanner(e.languageVersion,false,e.languageVariant);const r=[];let i=0;for(const o of t){if(r[i]&&isNewGroup(e,o,n)){i++}if(!r[i]){r[i]=[]}r[i].push(o)}return r}function isNewGroup(e,t,n){const r=t.getFullStart();const i=t.getStart();n.setText(e.text,r,i-r);let o=0;while(n.getTokenStart()=2){return true}}}return false}function getTopLevelExportGroups(e){const t=[];const n=e.statements;const r=length(n);let i=0;let o=0;while(igroupByNewlineContiguous(e,t)))}function removeUnusedImports(e,t,n){const r=n.getTypeChecker();const i=n.getCompilerOptions();const o=r.getJsxNamespace(t);const a=r.getJsxFragmentFactory(t);const s=!!(t.transformFlags&2);const c=[];for(const n of e){const{importClause:e,moduleSpecifier:r}=n;if(!e){c.push(n);continue}let{name:i,namedBindings:o}=e;if(i&&!isDeclarationUsed(i)){i=void 0}if(o){if(isNamespaceImport(o)){if(!isDeclarationUsed(o.name)){o=void 0}}else{const e=o.elements.filter((e=>isDeclarationUsed(e.name)));if(e.length{if(e.attributes){let t=e.attributes.token+" ";for(const n of toSorted(e.attributes.elements,((e,t)=>compareStringsCaseSensitive(e.name.text,t.name.text)))){t+=n.name.text+":";t+=isStringLiteralLike(n.value)?`"${n.value.text}"`:n.value.getText()+" "}return t}return""}));const o=[];for(const e in i){const a=i[e];const{importWithoutClause:s,typeOnlyImports:c,regularImports:l}=getCategorizedImports(a);if(s){o.push(s)}for(const e of[l,c]){const i=e===c;const{defaultImports:a,namespaceImports:s,namedImports:l}=e;if(!i&&a.length===1&&s.length===1&&l.length===0){const e=a[0];o.push(updateImportDeclarationAndClause(e,e.importClause.name,s[0].importClause.namedBindings));continue}const p=toSorted(s,((e,n)=>t(e.importClause.namedBindings.name.text,n.importClause.namedBindings.name.text)));for(const e of p){o.push(updateImportDeclarationAndClause(e,void 0,e.importClause.namedBindings))}const u=firstOrUndefined(a);const f=firstOrUndefined(l);const m=u??f;if(!m){continue}let _;const g=[];if(a.length===1){_=a[0].importClause.name}else{for(const e of a){g.push(zr.createImportSpecifier(false,zr.createIdentifier("default"),e.importClause.name))}}g.push(...getNewImportSpecifiers(l));const y=zr.createNodeArray(toSorted(g,n),f==null?void 0:f.importClause.namedBindings.elements.hasTrailingComma);const h=y.length===0?_?void 0:zr.createNamedImports(d):f?zr.updateNamedImports(f.importClause.namedBindings,y):zr.createNamedImports(y);if(r&&h&&(f==null?void 0:f.importClause.namedBindings)&&!rangeIsOnSingleLine(f.importClause.namedBindings,r)){setEmitFlags(h,2)}if(i&&_&&h){o.push(updateImportDeclarationAndClause(m,_,void 0));o.push(updateImportDeclarationAndClause(f??m,void 0,h))}else{o.push(updateImportDeclarationAndClause(m,_,h))}}}return o}function coalesceExportsWorker(e,t){if(e.length===0){return e}const{exportWithoutClause:n,namedExports:r,typeOnlyExports:i}=getCategorizedExports(e);const o=[];if(n){o.push(n)}for(const e of[r,i]){if(e.length===0){continue}const n=[];n.push(...flatMap(e,(e=>e.exportClause&&isNamedExports(e.exportClause)?e.exportClause.elements:d)));const r=toSorted(n,t);const i=e[0];o.push(zr.updateExportDeclaration(i,i.modifiers,i.isTypeOnly,i.exportClause&&(isNamedExports(i.exportClause)?zr.updateNamedExports(i.exportClause,r):zr.updateNamespaceExport(i.exportClause,i.exportClause.name)),i.moduleSpecifier,i.attributes))}return o;function getCategorizedExports(e){let t;const n=[];const r=[];for(const i of e){if(i.exportClause===void 0){t=t||i}else if(i.isTypeOnly){r.push(i)}else{n.push(i)}}return{exportWithoutClause:t,namedExports:n,typeOnlyExports:r}}}function updateImportDeclarationAndClause(e,t,n){return zr.updateImportDeclaration(e,e.modifiers,zr.updateImportClause(e.importClause,e.importClause.isTypeOnly,t,n),e.moduleSpecifier,e.attributes)}function compareImportOrExportSpecifiers(e,t,n,r){switch(r==null?void 0:r.organizeImportsTypeOrder){case"first":return compareBooleans(t.isTypeOnly,e.isTypeOnly)||n(e.name.text,t.name.text);case"inline":return n(e.name.text,t.name.text);default:return compareBooleans(e.isTypeOnly,t.isTypeOnly)||n(e.name.text,t.name.text)}}function compareModuleSpecifiersWorker(e,t,n){const r=e===void 0?void 0:getExternalModuleName2(e);const i=t===void 0?void 0:getExternalModuleName2(t);return compareBooleans(r===void 0,i===void 0)||compareBooleans(isExternalModuleNameRelative(r),isExternalModuleNameRelative(i))||n(r,i)}function getModuleNamesFromDecls(e){return e.map((e=>getExternalModuleName2(getModuleSpecifierExpression(e))||""))}function getModuleSpecifierExpression(e){var t;switch(e.kind){case 271:return(t=tryCast(e.moduleReference,isExternalModuleReference))==null?void 0:t.expression;case 272:return e.moduleSpecifier;case 243:return e.declarationList.declarations[0].initializer.arguments[0]}}function hasModuleDeclarationMatchingSpecifier(e,t){const n=isStringLiteral(t)&&t.text;return isString(n)&&some(e.moduleAugmentations,(e=>isStringLiteral(e)&&e.text===n))}function getNewImportSpecifiers(e){return flatMap(e,(e=>map(tryGetNamedBindingElements(e),(e=>e.name&&e.propertyName&&moduleExportNameTextEscaped(e.name)===moduleExportNameTextEscaped(e.propertyName)?zr.updateImportSpecifier(e,e.isTypeOnly,void 0,e.name):e))))}function tryGetNamedBindingElements(e){var t;return((t=e.importClause)==null?void 0:t.namedBindings)&&isNamedImports(e.importClause.namedBindings)?e.importClause.namedBindings.elements:void 0}function detectModuleSpecifierCaseBySort(e,t){const n=[];e.forEach((e=>{n.push(getModuleNamesFromDecls(e))}));return detectCaseSensitivityBySort(n,t)}function detectNamedImportOrganizationBySort(e,t,n){let r=false;const i=e.filter((e=>{var t,n;const i=(n=tryCast((t=e.importClause)==null?void 0:t.namedBindings,isNamedImports))==null?void 0:n.elements;if(!(i==null?void 0:i.length))return false;if(!r&&i.some((e=>e.isTypeOnly))&&i.some((e=>!e.isTypeOnly))){r=true}return true}));if(i.length===0)return;const o=i.map((e=>{var t,n;return(n=tryCast((t=e.importClause)==null?void 0:t.namedBindings,isNamedImports))==null?void 0:n.elements})).filter((e=>e!==void 0));if(!r||n.length===0){const e=detectCaseSensitivityBySort(o.map((e=>e.map((e=>e.name.text)))),t);return{namedImportComparer:e.comparer,typeOrder:n.length===1?n[0]:void 0,isSorted:e.isSorted}}const a={first:Infinity,last:Infinity,inline:Infinity};const s={first:t[0],last:t[0],inline:t[0]};for(const e of t){const t={first:0,last:0,inline:0};for(const r of o){for(const i of n){t[i]=(t[i]??0)+measureSortedness(r,((t,n)=>compareImportOrExportSpecifiers(t,n,e,{organizeImportsTypeOrder:i})))}}for(const r of n){const n=r;if(t[n]0){n++}}return n}function detectCaseSensitivityBySort(e,t){let n;let r=Infinity;for(const i of t){let t=0;for(const n of e){if(n.length<=1)continue;const e=measureSortedness(n,i);t+=e}if(tcompareImportOrExportSpecifiers(t,r,n,e)}function getNamedImportSpecifierComparerWithDetection(e,t,n){const{comparersToTest:r,typeOrdersToTest:i}=getDetectionLists(t);const o=detectNamedImportOrganizationBySort([e],r,i);let a=getNamedImportSpecifierComparer(t,r[0]);let s;if(typeof t.organizeImportsIgnoreCase!=="boolean"||!t.organizeImportsTypeOrder){if(o){const{namedImportComparer:e,typeOrder:t,isSorted:n}=o;s=n;a=getNamedImportSpecifierComparer({organizeImportsTypeOrder:t},e)}else if(n){const e=detectNamedImportOrganizationBySort(n.statements.filter(isImportDeclaration),r,i);if(e){const{namedImportComparer:t,typeOrder:n,isSorted:r}=e;s=r;a=getNamedImportSpecifierComparer({organizeImportsTypeOrder:n},t)}}}return{specifierComparer:a,isSorted:s}}function getImportDeclarationInsertionIndex(e,t,n){const r=binarySearch(e,t,identity,((e,t)=>compareImportsOrRequireStatements(e,t,n)));return r<0?~r:r}function getImportSpecifierInsertionIndex(e,t,n){const r=binarySearch(e,t,identity,n);return r<0?~r:r}function compareImportsOrRequireStatements(e,t,n){return compareModuleSpecifiersWorker(getModuleSpecifierExpression(e),getModuleSpecifierExpression(t),n)||compareImportKind(e,t)}function testCoalesceImports(e,t,n,r){const i=getOrganizeImportsOrdinalStringComparer(t);const o=getNamedImportSpecifierComparer({organizeImportsTypeOrder:r==null?void 0:r.organizeImportsTypeOrder},i);return coalesceImportsWorker(e,i,o,n)}function testCoalesceExports(e,t,n){const comparer=(e,r)=>compareImportOrExportSpecifiers(e,r,getOrganizeImportsOrdinalStringComparer(t),{organizeImportsTypeOrder:(n==null?void 0:n.organizeImportsTypeOrder)??"last"});return coalesceExportsWorker(e,comparer)}function compareModuleSpecifiers2(e,t,n){const r=getOrganizeImportsOrdinalStringComparer(!!n);return compareModuleSpecifiersWorker(e,t,r)}var em={};__export(em,{collectElements:()=>collectElements});function collectElements(e,t){const n=[];addNodeOutliningSpans(e,t,n);addRegionOutliningSpans(e,n);n.sort(((e,t)=>e.textSpan.start-t.textSpan.start));return n}function addNodeOutliningSpans(e,t,n){let r=40;let i=0;const o=[...e.statements,e.endOfFileToken];const a=o.length;while(i1){r.push(createOutliningSpanFromBounds(o,a,"comment"))}}}function addOutliningForLeadingCommentsForNode(e,t,n,r){if(isJsxText(e))return;addOutliningForLeadingCommentsForPos(e.pos,t,n,r)}function createOutliningSpanFromBounds(e,t,n){return createOutliningSpan(createTextSpanFromBounds(e,t),n)}function getOutliningSpanForNode(e,t){switch(e.kind){case 241:if(isFunctionLike(e.parent)){return functionSpan(e.parent,e,t)}switch(e.parent.kind){case 246:case 249:case 250:case 248:case 245:case 247:case 254:case 299:return spanForNode(e.parent);case 258:const n=e.parent;if(n.tryBlock===e){return spanForNode(e.parent)}else if(n.finallyBlock===e){const e=findChildOfKind(n,98,t);if(e)return spanForNode(e)}default:return createOutliningSpan(createTextSpanFromNode(e,t),"code")}case 268:return spanForNode(e.parent);case 263:case 231:case 264:case 266:case 269:case 187:case 206:return spanForNode(e);case 189:return spanForNode(e,false,!isTupleTypeNode(e.parent),23);case 296:case 297:return spanForNodeArray(e.statements);case 210:return spanForObjectOrArrayLiteral(e);case 209:return spanForObjectOrArrayLiteral(e,23);case 284:return spanForJSXElement(e);case 288:return spanForJSXFragment(e);case 285:case 286:return spanForJSXAttributes(e.attributes);case 228:case 15:return spanForTemplateLiteral(e);case 207:return spanForNode(e,false,!isBindingElement(e.parent),23);case 219:return spanForArrowFunction(e);case 213:return spanForCallExpression(e);case 217:return spanForParenthesizedExpression(e);case 275:case 279:case 300:return spanForImportExportElements(e)}function spanForImportExportElements(e){if(!e.elements.length){return void 0}const n=findChildOfKind(e,19,t);const r=findChildOfKind(e,20,t);if(!n||!r||positionsAreOnSameLine(n.pos,r.pos,t)){return void 0}return spanBetweenTokens(n,r,e,t,false,false)}function spanForCallExpression(e){if(!e.arguments.length){return void 0}const n=findChildOfKind(e,21,t);const r=findChildOfKind(e,22,t);if(!n||!r||positionsAreOnSameLine(n.pos,r.pos,t)){return void 0}return spanBetweenTokens(n,r,e,t,false,true)}function spanForArrowFunction(e){if(isBlock(e.body)||isParenthesizedExpression(e.body)||positionsAreOnSameLine(e.body.getFullStart(),e.body.getEnd(),t)){return void 0}const n=createTextSpanFromBounds(e.body.getFullStart(),e.body.getEnd());return createOutliningSpan(n,"code",createTextSpanFromNode(e))}function spanForJSXElement(e){const n=createTextSpanFromBounds(e.openingElement.getStart(t),e.closingElement.getEnd());const r=e.openingElement.tagName.getText(t);const i="<"+r+">...";return createOutliningSpan(n,"code",n,false,i)}function spanForJSXFragment(e){const n=createTextSpanFromBounds(e.openingFragment.getStart(t),e.closingFragment.getEnd());const r="<>...";return createOutliningSpan(n,"code",n,false,r)}function spanForJSXAttributes(e){if(e.properties.length===0){return void 0}return createOutliningSpanFromBounds(e.getStart(t),e.getEnd(),"code")}function spanForTemplateLiteral(e){if(e.kind===15&&e.text.length===0){return void 0}return createOutliningSpanFromBounds(e.getStart(t),e.getEnd(),"code")}function spanForObjectOrArrayLiteral(e,t=19){return spanForNode(e,false,!isArrayLiteralExpression(e.parent)&&!isCallExpression(e.parent),t)}function spanForNode(n,r=false,i=true,o=19,a=(o===19?20:24)){const s=findChildOfKind(e,o,t);const c=findChildOfKind(e,a,t);return s&&c&&spanBetweenTokens(s,c,n,t,r,i)}function spanForNodeArray(e){return e.length?createOutliningSpan(createTextSpanFromRange(e),"code"):void 0}function spanForParenthesizedExpression(e){if(positionsAreOnSameLine(e.getStart(),e.getEnd(),t))return void 0;const n=createTextSpanFromBounds(e.getStart(),e.getEnd());return createOutliningSpan(n,"code",createTextSpanFromNode(e))}}function functionSpan(e,t,n){const r=tryGetFunctionOpenToken(e,t,n);const i=findChildOfKind(t,20,n);return r&&i&&spanBetweenTokens(r,i,e,n,e.kind!==219)}function spanBetweenTokens(e,t,n,r,i=false,o=true){const a=createTextSpanFromBounds(o?e.getFullStart():e.getStart(r),t.getEnd());return createOutliningSpan(a,"code",createTextSpanFromNode(n,r),i)}function createOutliningSpan(e,t,n=e,r=false,i="..."){return{textSpan:e,kind:t,hintSpan:n,bannerText:i,autoCollapse:r}}function tryGetFunctionOpenToken(e,t,n){if(isNodeArrayMultiLine(e.parameters,n)){const t=findChildOfKind(e,21,n);if(t){return t}}return findChildOfKind(t,19,n)}var nm={};__export(nm,{getRenameInfo:()=>getRenameInfo,nodeIsEligibleForRename:()=>nodeIsEligibleForRename});function getRenameInfo(e,t,n,r){const i=getAdjustedRenameLocation(getTouchingPropertyName(t,n));if(nodeIsEligibleForRename(i)){const n=getRenameInfoForNode(i,e.getTypeChecker(),t,e,r);if(n){return n}}return getRenameInfoError(wt.You_cannot_rename_this_element)}function getRenameInfoForNode(e,t,n,r,i){const o=t.getSymbolAtLocation(e);if(!o){if(isStringLiteralLike(e)){const r=getContextualTypeFromParentOrAncestorTypeNode(e,t);if(r&&(r.flags&128||r.flags&1048576&&every(r.types,(e=>!!(e.flags&128))))){return getRenameInfoSuccess(e.text,e.text,"string","",e,n)}}else if(isLabelName(e)){const t=getTextOfNode(e);return getRenameInfoSuccess(t,t,"label","",e,n)}return void 0}const{declarations:a}=o;if(!a||a.length===0)return;if(a.some((e=>isDefinedInLibraryFile(r,e)))){return getRenameInfoError(wt.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)}if(isIdentifier(e)&&e.escapedText==="default"&&o.parent&&o.parent.flags&1536){return void 0}if(isStringLiteralLike(e)&&tryGetImportFromModuleSpecifier(e)){return i.allowRenameOfImportPath?getRenameInfoForModule(e,n,o):void 0}const s=wouldRenameInOtherNodeModules(n,o,t,i);if(s){return getRenameInfoError(s)}const c=cm.getSymbolKind(t,o,e);const l=isImportOrExportSpecifierName(e)||isStringOrNumericLiteralLike(e)&&e.parent.kind===167?stripQuotes(getTextOfIdentifierOrLiteral(e)):void 0;const d=l||t.symbolToString(o);const p=l||t.getFullyQualifiedName(o);return getRenameInfoSuccess(d,p,c,cm.getSymbolModifiers(t,o),e,n)}function isDefinedInLibraryFile(e,t){const n=t.getSourceFile();return e.isSourceFileDefaultLibrary(n)&&fileExtensionIs(n.fileName,".d.ts")}function wouldRenameInOtherNodeModules(e,t,n,r){if(!r.providePrefixAndSuffixTextForRename&&t.flags&2097152){const e=t.declarations&&find(t.declarations,(e=>isImportSpecifier(e)));if(e&&!e.propertyName){t=n.getAliasedSymbol(t)}}const{declarations:i}=t;if(!i){return void 0}const o=getPackagePathComponents(e.path);if(o===void 0){if(some(i,(e=>isInsideNodeModules(e.getSourceFile().path)))){return wt.You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder}else{return void 0}}for(const e of i){const t=getPackagePathComponents(e.getSourceFile().path);if(t){const e=Math.min(o.length,t.length);for(let n=0;n<=e;n++){if(compareStringsCaseSensitive(o[n],t[n])!==0){return wt.You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder}}}}return void 0}function getPackagePathComponents(e){const t=getPathComponents(e);const n=t.lastIndexOf("node_modules");if(n===-1){return void 0}return t.slice(0,n+2)}function getRenameInfoForModule(e,t,n){if(!isExternalModuleNameRelative(e.text)){return getRenameInfoError(wt.You_cannot_rename_a_module_via_a_global_import)}const r=n.declarations&&find(n.declarations,isSourceFile);if(!r)return void 0;const i=endsWith(e.text,"/index")||endsWith(e.text,"/index.js")?void 0:tryRemoveSuffix(removeFileExtension(r.fileName),"/index");const o=i===void 0?r.fileName:i;const a=i===void 0?"module":"directory";const s=e.text.lastIndexOf("/")+1;const c=createTextSpan(e.getStart(t)+1+s,e.text.length-s);return{canRename:true,fileToRename:o,kind:a,displayName:o,fullDisplayName:e.text,kindModifiers:"",triggerSpan:c}}function getRenameInfoSuccess(e,t,n,r,i,o){return{canRename:true,fileToRename:void 0,kind:n,displayName:e,fullDisplayName:t,kindModifiers:r,triggerSpan:createTriggerSpanForNode(i,o)}}function getRenameInfoError(e){return{canRename:false,localizedErrorMessage:getLocaleSpecificMessage(e)}}function createTriggerSpanForNode(e,t){let n=e.getStart(t);let r=e.getWidth(t);if(isStringLiteralLike(e)){n+=1;r-=2}return createTextSpan(n,r)}function nodeIsEligibleForRename(e){switch(e.kind){case 80:case 81:case 11:case 15:case 110:return true;case 9:return isLiteralNameOfPropertyDeclarationOrIndexAccess(e);default:return false}}var rm={};__export(rm,{getArgumentInfoForCompletions:()=>getArgumentInfoForCompletions,getSignatureHelpItems:()=>getSignatureHelpItems});function getSignatureHelpItems(e,t,n,r,i){const o=e.getTypeChecker();const a=findTokenOnLeftOfPosition(t,n);if(!a){return void 0}const s=!!r&&r.kind==="characterTyped";if(s&&(isInString(t,n,a)||isInComment(t,n))){return void 0}const c=!!r&&r.kind==="invoked";const l=getContainingArgumentInfo(a,n,t,o,c);if(!l)return void 0;i.throwIfCancellationRequested();const d=getCandidateOrTypeInfo(l,o,t,a,s);i.throwIfCancellationRequested();if(!d){return isSourceFileJS(t)?createJSSignatureHelpItems(l,e,i):void 0}return o.runWithCancellationToken(i,(e=>d.kind===0?createSignatureHelpItems(d.candidates,d.resolvedSignature,l,t,e):createTypeHelpItems(d.symbol,l,t,e)))}function getCandidateOrTypeInfo({invocation:e,argumentCount:t},n,r,i,o){switch(e.kind){case 0:{if(o&&!isSyntacticOwner(i,e.node,r)){return void 0}const a=[];const s=n.getResolvedSignatureForSignatureHelp(e.node,a,t);return a.length===0?void 0:{kind:0,candidates:a,resolvedSignature:s}}case 1:{const{called:a}=e;if(o&&!containsPrecedingToken(i,r,isIdentifier(a)?a.parent:a)){return void 0}const s=getPossibleGenericSignatures(a,t,n);if(s.length!==0)return{kind:0,candidates:s,resolvedSignature:first(s)};const c=n.getSymbolAtLocation(a);return c&&{kind:1,symbol:c}}case 2:return{kind:0,candidates:[e.signature],resolvedSignature:e.signature};default:return S.assertNever(e)}}function isSyntacticOwner(e,t,n){if(!isCallOrNewExpression(t))return false;const r=t.getChildren(n);switch(e.kind){case 21:return contains(r,e);case 28:{const t=findContainingList(e);return!!t&&contains(r,t)}case 30:return containsPrecedingToken(e,n,t.expression);default:return false}}function createJSSignatureHelpItems(e,t,n){if(e.invocation.kind===2)return void 0;const r=getExpressionFromInvocation(e.invocation);const i=isPropertyAccessExpression(r)?r.name.text:void 0;const o=t.getTypeChecker();return i===void 0?void 0:firstDefined(t.getSourceFiles(),(t=>firstDefined(t.getNamedDeclarations().get(i),(r=>{const i=r.symbol&&o.getTypeOfSymbolAtLocation(r.symbol,r);const a=i&&i.getCallSignatures();if(a&&a.length){return o.runWithCancellationToken(n,(n=>createSignatureHelpItems(a,a[0],e,t,n,true)))}}))))}function containsPrecedingToken(e,t,n){const r=e.getFullStart();let i=e.parent;while(i){const e=findPrecedingToken(r,t,i,true);if(e){return rangeContainsRange(n,e)}i=i.parent}return S.fail("Could not find preceding token")}function getArgumentInfoForCompletions(e,t,n,r){const i=getImmediatelyContainingArgumentInfo(e,t,n,r);return!i||i.isTypeParameterList||i.invocation.kind!==0?void 0:{invocation:i.invocation.node,argumentCount:i.argumentCount,argumentIndex:i.argumentIndex}}function getArgumentOrParameterListInfo(e,t,n,r){const i=getArgumentOrParameterListAndIndex(e,n,r);if(!i)return void 0;const{list:o,argumentIndex:a}=i;const s=getArgumentCount(r,o);const c=getApplicableSpanForArguments(o,n);return{list:o,argumentIndex:a,argumentCount:s,argumentsSpan:c}}function getArgumentOrParameterListAndIndex(e,t,n){if(e.kind===30||e.kind===21){return{list:getChildListThatStartsWithOpenerToken(e.parent,e,t),argumentIndex:0}}else{const t=findContainingList(e);return t&&{list:t,argumentIndex:getArgumentIndex(n,t,e)}}}function getImmediatelyContainingArgumentInfo(e,t,n,r){const{parent:i}=e;if(isCallOrNewExpression(i)){const o=i;const a=getArgumentOrParameterListInfo(e,t,n,r);if(!a)return void 0;const{list:s,argumentIndex:c,argumentCount:l,argumentsSpan:d}=a;const p=!!i.typeArguments&&i.typeArguments.pos===s.pos;return{isTypeParameterList:p,invocation:{kind:0,node:o},argumentsSpan:d,argumentIndex:c,argumentCount:l}}else if(isNoSubstitutionTemplateLiteral(e)&&isTaggedTemplateExpression(i)){if(isInsideTemplateLiteral(e,t,n)){return getArgumentListInfoForTemplate(i,0,n)}return void 0}else if(isTemplateHead(e)&&i.parent.kind===215){const r=i;const o=r.parent;S.assert(r.kind===228);const a=isInsideTemplateLiteral(e,t,n)?0:1;return getArgumentListInfoForTemplate(o,a,n)}else if(isTemplateSpan(i)&&isTaggedTemplateExpression(i.parent.parent)){const r=i;const o=i.parent.parent;if(isTemplateTail(e)&&!isInsideTemplateLiteral(e,t,n)){return void 0}const a=r.parent.templateSpans.indexOf(r);const s=getArgumentIndexForTemplatePiece(a,e,t,n);return getArgumentListInfoForTemplate(o,s,n)}else if(isJsxOpeningLikeElement(i)){const e=i.attributes.pos;const t=skipTrivia(n.text,i.attributes.end,false);return{isTypeParameterList:false,invocation:{kind:0,node:i},argumentsSpan:createTextSpan(e,t-e),argumentIndex:0,argumentCount:1}}else{const t=getPossibleTypeArgumentsInfo(e,n);if(t){const{called:r,nTypeArguments:i}=t;const o={kind:1,called:r};const a=createTextSpanFromBounds(r.getStart(n),e.end);return{isTypeParameterList:true,invocation:o,argumentsSpan:a,argumentIndex:i,argumentCount:i+1}}return void 0}}function getImmediatelyContainingArgumentOrContextualParameterInfo(e,t,n,r){return tryGetParameterInfo(e,t,n,r)||getImmediatelyContainingArgumentInfo(e,t,n,r)}function getHighestBinary(e){return isBinaryExpression(e.parent)?getHighestBinary(e.parent):e}function countBinaryExpressionParameters(e){return isBinaryExpression(e.left)?countBinaryExpressionParameters(e.left)+1:2}function tryGetParameterInfo(e,t,n,r){const i=getAdjustedNode(e);if(i===void 0)return void 0;const o=getContextualSignatureLocationInfo(i,n,t,r);if(o===void 0)return void 0;const{contextualType:a,argumentIndex:s,argumentCount:c,argumentsSpan:l}=o;const d=a.getNonNullableType();const p=d.symbol;if(p===void 0)return void 0;const u=lastOrUndefined(d.getCallSignatures());if(u===void 0)return void 0;const f={kind:2,signature:u,node:e,symbol:chooseBetterSymbol(p)};return{isTypeParameterList:false,invocation:f,argumentsSpan:l,argumentIndex:s,argumentCount:c}}function getAdjustedNode(e){switch(e.kind){case 21:case 28:return e;default:return findAncestor(e.parent,(e=>isParameter(e)?true:isBindingElement(e)||isObjectBindingPattern(e)||isArrayBindingPattern(e)?false:"quit"))}}function getContextualSignatureLocationInfo(e,t,n,r){const{parent:i}=e;switch(i.kind){case 217:case 174:case 218:case 219:const o=getArgumentOrParameterListInfo(e,n,t,r);if(!o)return void 0;const{argumentIndex:a,argumentCount:s,argumentsSpan:c}=o;const l=isMethodDeclaration(i)?r.getContextualTypeForObjectLiteralElement(i):r.getContextualType(i);return l&&{contextualType:l,argumentIndex:a,argumentCount:s,argumentsSpan:c};case 226:{const t=getHighestBinary(i);const n=r.getContextualType(t);const o=e.kind===21?0:countBinaryExpressionParameters(i)-1;const a=countBinaryExpressionParameters(t);return n&&{contextualType:n,argumentIndex:o,argumentCount:a,argumentsSpan:createTextSpanFromNode(i)}}default:return void 0}}function chooseBetterSymbol(e){return e.name==="__type"?firstDefined(e.declarations,(e=>{var t;return isFunctionTypeNode(e)?(t=tryCast(e.parent,canHaveSymbol))==null?void 0:t.symbol:void 0}))||e:e}function getSpreadElementCount(e,t){const n=t.getTypeAtLocation(e.expression);if(t.isTupleType(n)){const{elementFlags:e,fixedLength:t}=n.target;if(t===0){return 0}const r=findIndex(e,(e=>!(e&1)));return r<0?t:r}return 0}function getArgumentIndex(e,t,n){return getArgumentIndexOrCount(e,t,n)}function getArgumentCount(e,t){return getArgumentIndexOrCount(e,t,void 0)}function getArgumentIndexOrCount(e,t,n){const r=t.getChildren();let i=0;let o=false;for(const t of r){if(n&&t===n){if(!o&&t.kind===28){i++}return i}if(isSpreadElement(t)){i+=getSpreadElementCount(t,e);o=true;continue}if(t.kind!==28){i++;o=true;continue}if(o){o=false;continue}i++}if(n){return i}return r.length&&last(r).kind===28?i+1:i}function getArgumentIndexForTemplatePiece(e,t,n,r){S.assert(n>=t.getStart(),"Assumed 'position' could not occur before node.");if(isTemplateLiteralToken(t)){if(isInsideTemplateLiteral(t,n,r)){return 0}return e+2}return e+1}function getArgumentListInfoForTemplate(e,t,n){const r=isNoSubstitutionTemplateLiteral(e.template)?1:e.template.templateSpans.length+1;if(t!==0){S.assertLessThan(t,r)}return{isTypeParameterList:false,invocation:{kind:0,node:e},argumentsSpan:getApplicableSpanForTaggedTemplate(e,n),argumentIndex:t,argumentCount:r}}function getApplicableSpanForArguments(e,t){const n=e.getFullStart();const r=skipTrivia(t.text,e.getEnd(),false);return createTextSpan(n,r-n)}function getApplicableSpanForTaggedTemplate(e,t){const n=e.template;const r=n.getStart();let i=n.getEnd();if(n.kind===228){const e=last(n.templateSpans);if(e.literal.getFullWidth()===0){i=skipTrivia(t.text,i,false)}}return createTextSpan(r,i-r)}function getContainingArgumentInfo(e,t,n,r,i){for(let o=e;!isSourceFile(o)&&(i||!isBlock(o));o=o.parent){S.assert(rangeContainsRange(o.parent,o),"Not a subspan",(()=>`Child: ${S.formatSyntaxKind(o.kind)}, parent: ${S.formatSyntaxKind(o.parent.kind)}`));const e=getImmediatelyContainingArgumentOrContextualParameterInfo(o,t,n,r);if(e){return e}}return void 0}function getChildListThatStartsWithOpenerToken(e,t,n){const r=e.getChildren(n);const i=r.indexOf(t);S.assert(i>=0&&r.length>i+1);return r[i+1]}function getExpressionFromInvocation(e){return e.kind===0?getInvokedExpression(e.node):e.called}function getEnclosingDeclarationFromInvocation(e){return e.kind===0?e.node:e.kind===1?e.called:e.node}var im=8192|70221824|16384;function createSignatureHelpItems(e,t,{isTypeParameterList:n,argumentCount:r,argumentsSpan:i,invocation:o,argumentIndex:a},s,c,l){var p;const u=getEnclosingDeclarationFromInvocation(o);const f=o.kind===2?o.symbol:c.getSymbolAtLocation(getExpressionFromInvocation(o))||l&&((p=t.declaration)==null?void 0:p.symbol);const m=f?symbolToDisplayParts(c,f,l?s:void 0,void 0):d;const _=map(e,(e=>getSignatureHelpItem(e,m,n,c,u,s)));let g=0;let y=0;for(let n=0;n<_.length;n++){const i=_[n];if(e[n]===t){g=y;if(i.length>1){let e=0;for(const t of i){if(t.isVariadic||t.parameters.length>=r){g=y+e;break}e++}}}y+=i.length}S.assert(g!==-1);const h={items:flatMapToMutable(_,identity),applicableSpan:i,selectedItemIndex:g,argumentIndex:a,argumentCount:r};const T=h.items[g];if(T.isVariadic){const e=findIndex(T.parameters,(e=>!!e.isRest));if(-1createSignatureHelpParameterForTypeParameter(e,n,r,i,a)));const c=e.getDocumentationComment(n);const l=e.getJsDocTags(n);const d=[...o,punctuationPart(30)];return{isVariadic:false,prefixDisplayParts:d,suffixDisplayParts:[punctuationPart(32)],separatorDisplayParts:om,parameters:s,documentation:c,tags:l}}var om=[punctuationPart(28),spacePart()];function getSignatureHelpItem(e,t,n,r,i,o){const a=(n?itemInfoForTypeParameters:itemInfoForParameters)(e,r,i,o);return map(a,(({isVariadic:n,parameters:o,prefix:a,suffix:s})=>{const c=[...t,...a];const l=[...s,...returnTypeToDisplayParts(e,i,r)];const d=e.getDocumentationComment(r);const p=e.getJsDocTags();return{isVariadic:n,prefixDisplayParts:c,suffixDisplayParts:l,separatorDisplayParts:om,parameters:o,documentation:d,tags:p}}))}function returnTypeToDisplayParts(e,t,n){return mapToDisplayParts((r=>{r.writePunctuation(":");r.writeSpace(" ");const i=n.getTypePredicateOfSignature(e);if(i){n.writeTypePredicate(i,t,void 0,r)}else{n.writeType(n.getReturnTypeOfSignature(e),t,void 0,r)}}))}function itemInfoForTypeParameters(e,t,n,r){const i=(e.target||e).typeParameters;const o=Ia();const a=(i||d).map((e=>createSignatureHelpParameterForTypeParameter(e,t,n,r,o)));const s=e.thisParameter?[t.symbolToParameterDeclaration(e.thisParameter,n,im)]:[];return t.getExpandedParameters(e).map((e=>{const i=zr.createNodeArray([...s,...map(e,(e=>t.symbolToParameterDeclaration(e,n,im)))]);const c=mapToDisplayParts((e=>{o.writeList(2576,i,r,e)}));return{isVariadic:false,parameters:a,prefix:[punctuationPart(30)],suffix:[punctuationPart(32),...c]}}))}function itemInfoForParameters(e,t,n,r){const i=Ia();const o=mapToDisplayParts((o=>{if(e.typeParameters&&e.typeParameters.length){const a=zr.createNodeArray(e.typeParameters.map((e=>t.typeParameterToDeclaration(e,n,im))));i.writeList(53776,a,r,o)}}));const a=t.getExpandedParameters(e);const s=!t.hasEffectiveRestParameter(e)?e=>false:a.length===1?e=>true:e=>{var t;return!!(e.length&&((t=tryCast(e[e.length-1],isTransientSymbol))==null?void 0:t.links.checkFlags)&32768)};return a.map((e=>({isVariadic:s(e),parameters:e.map((e=>createSignatureHelpParameterForParameter(e,t,n,r,i))),prefix:[...o,punctuationPart(21)],suffix:[punctuationPart(22)]})))}function createSignatureHelpParameterForParameter(e,t,n,r,i){const o=mapToDisplayParts((o=>{const a=t.symbolToParameterDeclaration(e,n,im);i.writeNode(4,a,r,o)}));const a=t.isOptionalParameter(e.valueDeclaration);const s=isTransientSymbol(e)&&!!(e.links.checkFlags&32768);return{name:e.name,documentation:e.getDocumentationComment(t),displayParts:o,isOptional:a,isRest:s}}function createSignatureHelpParameterForTypeParameter(e,t,n,r,i){const o=mapToDisplayParts((o=>{const a=t.typeParameterToDeclaration(e,n,im);i.writeNode(4,a,r,o)}));return{name:e.symbol.name,documentation:e.symbol.getDocumentationComment(t),displayParts:o,isOptional:false,isRest:false}}var am={};__export(am,{getSmartSelectionRange:()=>getSmartSelectionRange});function getSmartSelectionRange(e,t){var n,r;let i={textSpan:createTextSpanFromBounds(t.getFullStart(),t.getEnd())};let o=t;e:while(true){const i=getSelectionChildren(o);if(!i.length)break;for(let a=0;ae){break e}const d=singleOrUndefined(getTrailingCommentRanges(t.text,c.end));if(d&&d.kind===2){pushSelectionCommentRange(d.pos,d.end)}if(positionShouldSnapToNode(t,e,c)){if(isFunctionBody(c)&&isFunctionLikeDeclaration(o)&&!positionsAreOnSameLine(c.getStart(t),c.getEnd(),t)){pushSelectionRange(c.getStart(t),c.getEnd())}if(isBlock(c)||isTemplateSpan(c)||isTemplateHead(c)||isTemplateTail(c)||s&&isTemplateHead(s)||isVariableDeclarationList(c)&&isVariableStatement(o)||isSyntaxList(c)&&isVariableDeclarationList(o)||isVariableDeclaration(c)&&isSyntaxList(o)&&i.length===1||isJSDocTypeExpression(c)||isJSDocSignature(c)||isJSDocTypeLiteral(c)){o=c;break}if(isTemplateSpan(o)&&l&&isTemplateMiddleOrTemplateTail(l)){const e=c.getFullStart()-"${".length;const t=l.getStart()+"}".length;pushSelectionRange(e,t)}const e=isSyntaxList(c)&&isListOpener(s)&&isListCloser(l)&&!positionsAreOnSameLine(s.getStart(),l.getStart(),t);let a=e?s.getEnd():c.getStart();const d=e?l.getStart():getEndPos(t,c);if(hasJSDocNodes(c)&&((n=c.jsDoc)==null?void 0:n.length)){pushSelectionRange(first(c.jsDoc).getStart(),d)}if(isSyntaxList(c)){const e=c.getChildren()[0];if(e&&hasJSDocNodes(e)&&((r=e.jsDoc)==null?void 0:r.length)&&e.getStart()!==c.pos){a=Math.min(a,first(e.jsDoc).getStart())}}pushSelectionRange(a,d);if(isStringLiteral(c)||isTemplateLiteral(c)){pushSelectionRange(a+1,d-1)}o=c;break}if(a===i.length-1){break e}}}return i;function pushSelectionRange(t,n){if(t!==n){const r=createTextSpanFromBounds(t,n);if(!i||!textSpansEqual(r,i.textSpan)&&textSpanIntersectsWithPosition(r,e)){i={textSpan:r,...i&&{parent:i}}}}}function pushSelectionCommentRange(e,n){pushSelectionRange(e,n);let r=e;while(t.text.charCodeAt(r)===47){r++}pushSelectionRange(r,n)}}function positionShouldSnapToNode(e,t,n){S.assert(n.pos<=t);if(tt===e.readonlyToken||t.kind===148||t===e.questionToken||t.kind===58));const o=groupChildren(i,(({kind:e})=>e===23||e===168||e===24));return[t,createSyntaxList2(splitChildren(o,(({kind:e})=>e===59))),r]}if(isPropertySignature(e)){const n=groupChildren(e.getChildren(),(t=>t===e.name||contains(e.modifiers,t)));const r=((t=n[0])==null?void 0:t.kind)===320?n[0]:void 0;const i=r?n.slice(1):n;const o=splitChildren(i,(({kind:e})=>e===59));return r?[r,createSyntaxList2(o)]:o}if(isParameter(e)){const t=groupChildren(e.getChildren(),(t=>t===e.dotDotDotToken||t===e.name));const n=groupChildren(t,(n=>n===t[0]||n===e.questionToken));return splitChildren(n,(({kind:e})=>e===64))}if(isBindingElement(e)){return splitChildren(e.getChildren(),(({kind:e})=>e===64))}return e.getChildren()}function groupChildren(e,t){const n=[];let r;for(const i of e){if(t(i)){r=r||[];r.push(i)}else{if(r){n.push(createSyntaxList2(r));r=void 0}n.push(i)}}if(r){n.push(createSyntaxList2(r))}return n}function splitChildren(e,t,n=true){if(e.length<2){return e}const r=findIndex(e,t);if(r===-1){return e}const i=e.slice(0,r);const o=e[r];const a=last(e);const s=n&&a.kind===27;const c=e.slice(r+1,s?e.length-1:void 0);const l=compact([i.length?createSyntaxList2(i):void 0,o,c.length?createSyntaxList2(c):void 0]);return s?l.concat(a):l}function createSyntaxList2(e){S.assertGreaterThanOrEqual(e.length,1);return setTextRangePosEnd(wi.createSyntaxList(e),e[0].pos,last(e).end)}function isListOpener(e){const t=e&&e.kind;return t===19||t===23||t===21||t===286}function isListCloser(e){const t=e&&e.kind;return t===20||t===24||t===22||t===287}function getEndPos(e,t){switch(t.kind){case 341:case 338:case 348:case 346:case 343:return e.getLineEndOfPosition(t.getStart());default:return t.getEnd()}}var cm={};__export(cm,{getSymbolDisplayPartsDocumentationAndSymbolKind:()=>getSymbolDisplayPartsDocumentationAndSymbolKind,getSymbolKind:()=>getSymbolKind,getSymbolModifiers:()=>getSymbolModifiers});var lm=8192|70221824|16384;function getSymbolKind(e,t,n){const r=getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(e,t,n);if(r!==""){return r}const i=getCombinedLocalAndExportSymbolFlags(t);if(i&32){return getDeclarationOfKind(t,231)?"local class":"class"}if(i&384)return"enum";if(i&524288)return"type";if(i&64)return"interface";if(i&262144)return"type parameter";if(i&8)return"enum member";if(i&2097152)return"alias";if(i&1536)return"module";return r}function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(e,t,n){const r=e.getRootSymbols(t);if(r.length===1&&first(r).flags&8192&&e.getTypeOfSymbolAtLocation(t,n).getNonNullableType().getCallSignatures().length!==0){return"method"}if(e.isUndefinedSymbol(t)){return"var"}if(e.isArgumentsSymbol(t)){return"local var"}if(n.kind===110&&isExpression(n)||isThisInTypeQuery(n)){return"parameter"}const i=getCombinedLocalAndExportSymbolFlags(t);if(i&3){if(isFirstDeclarationOfSymbolParameter(t)){return"parameter"}else if(t.valueDeclaration&&isVarConst(t.valueDeclaration)){return"const"}else if(t.valueDeclaration&&isVarUsing(t.valueDeclaration)){return"using"}else if(t.valueDeclaration&&isVarAwaitUsing(t.valueDeclaration)){return"await using"}else if(forEach(t.declarations,isLet)){return"let"}return isLocalVariableOrFunction(t)?"local var":"var"}if(i&16)return isLocalVariableOrFunction(t)?"local function":"function";if(i&32768)return"getter";if(i&65536)return"setter";if(i&8192)return"method";if(i&16384)return"constructor";if(i&131072)return"index";if(i&4){if(i&33554432&&t.links.checkFlags&6){const r=forEach(e.getRootSymbols(t),(e=>{const t=e.getFlags();if(t&(98308|3)){return"property"}}));if(!r){const r=e.getTypeOfSymbolAtLocation(t,n);if(r.getCallSignatures().length){return"method"}return"property"}return r}return"property"}return""}function getNormalizedSymbolModifiers(e){if(e.declarations&&e.declarations.length){const[t,...n]=e.declarations;const r=length(n)&&isDeprecatedDeclaration(t)&&some(n,(e=>!isDeprecatedDeclaration(e)))?65536:0;const i=getNodeModifiers(t,r);if(i){return i.split(",")}}return[]}function getSymbolModifiers(e,t){if(!t){return""}const n=new Set(getNormalizedSymbolModifiers(t));if(t.flags&2097152){const r=e.getAliasedSymbol(t);if(r!==t){forEach(getNormalizedSymbolModifiers(r),(e=>{n.add(e)}))}}if(t.flags&16777216){n.add("optional")}return n.size>0?arrayFrom(n.values()).join(","):""}function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(e,t,n,r,i,o,a,s){var c;const l=[];let p=[];let u=[];const f=getCombinedLocalAndExportSymbolFlags(t);let m=a&1?getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(e,t,i):"";let _=false;const g=i.kind===110&&isInExpressionContext(i)||isThisInTypeQuery(i);let y;let h;let T=false;if(i.kind===110&&!g){return{displayParts:[keywordPart(110)],documentation:[],symbolKind:"primitive type",tags:void 0}}if(m!==""||f&32||f&2097152){if(m==="getter"||m==="setter"){const e=find(t.declarations,(e=>e.name===i));if(e){switch(e.kind){case 177:m="getter";break;case 178:m="setter";break;case 172:m="accessor";break;default:S.assertNever(e)}}else{m="property"}}let n;o??(o=g?e.getTypeAtLocation(i):e.getTypeOfSymbolAtLocation(t,i));if(i.parent&&i.parent.kind===211){const e=i.parent.name;if(e===i||e&&e.getFullWidth()===0){i=i.parent}}let a;if(isCallOrNewExpression(i)){a=i}else if(isCallExpressionTarget(i)||isNewExpressionTarget(i)){a=i.parent}else if(i.parent&&(isJsxOpeningLikeElement(i.parent)||isTaggedTemplateExpression(i.parent))&&isFunctionLike(t.valueDeclaration)){a=i.parent}if(a){n=e.getResolvedSignature(a);const i=a.kind===214||isCallExpression(a)&&a.expression.kind===108;const s=i?o.getConstructSignatures():o.getCallSignatures();if(n&&!contains(s,n.target)&&!contains(s,n)){n=s.length?s[0]:void 0}if(n){if(i&&f&32){m="constructor";addPrefixForAnyFunctionOrVar(o.symbol,m)}else if(f&2097152){m="alias";pushSymbolKind(m);l.push(spacePart());if(i){if(n.flags&4){l.push(keywordPart(128));l.push(spacePart())}l.push(keywordPart(105));l.push(spacePart())}addFullSymbolName(t)}else{addPrefixForAnyFunctionOrVar(t,m)}switch(m){case"JSX attribute":case"property":case"var":case"const":case"let":case"parameter":case"local var":l.push(punctuationPart(59));l.push(spacePart());if(!(getObjectFlags(o)&16)&&o.symbol){addRange(l,symbolToDisplayParts(e,o.symbol,r,void 0,4|1));l.push(lineBreakPart())}if(i){if(n.flags&4){l.push(keywordPart(128));l.push(spacePart())}l.push(keywordPart(105));l.push(spacePart())}addSignatureDisplayParts(n,s,262144);break;default:addSignatureDisplayParts(n,s)}_=true;T=s.length>1}}else if(isNameOfFunctionDeclaration(i)&&!(f&98304)||i.kind===137&&i.parent.kind===176){const r=i.parent;const a=t.declarations&&find(t.declarations,(e=>e===(i.kind===137?r.parent:r)));if(a){const i=r.kind===176?o.getNonNullableType().getConstructSignatures():o.getNonNullableType().getCallSignatures();if(!e.isImplementationOfOverload(r)){n=e.getSignatureFromDeclaration(r)}else{n=i[0]}if(r.kind===176){m="constructor";addPrefixForAnyFunctionOrVar(o.symbol,m)}else{addPrefixForAnyFunctionOrVar(r.kind===179&&!(o.symbol.flags&2048||o.symbol.flags&4096)?o.symbol:t,m)}if(n){addSignatureDisplayParts(n,i)}_=true;T=i.length>1}}}if(f&32&&!_&&!g){addAliasPrefixIfNecessary();if(getDeclarationOfKind(t,231)){pushSymbolKind("local class")}else{l.push(keywordPart(86))}l.push(spacePart());addFullSymbolName(t);writeTypeParametersOfSymbol(t,n)}if(f&64&&a&2){prefixNextMeaning();l.push(keywordPart(120));l.push(spacePart());addFullSymbolName(t);writeTypeParametersOfSymbol(t,n)}if(f&524288&&a&2){prefixNextMeaning();l.push(keywordPart(156));l.push(spacePart());addFullSymbolName(t);writeTypeParametersOfSymbol(t,n);l.push(spacePart());l.push(operatorPart(64));l.push(spacePart());addRange(l,typeToDisplayParts(e,i.parent&&isConstTypeReference(i.parent)?e.getTypeAtLocation(i.parent):e.getDeclaredTypeOfSymbol(t),r,8388608))}if(f&384){prefixNextMeaning();if(some(t.declarations,(e=>isEnumDeclaration(e)&&isEnumConst(e)))){l.push(keywordPart(87));l.push(spacePart())}l.push(keywordPart(94));l.push(spacePart());addFullSymbolName(t)}if(f&1536&&!g){prefixNextMeaning();const e=getDeclarationOfKind(t,267);const n=e&&e.name&&e.name.kind===80;l.push(keywordPart(n?145:144));l.push(spacePart());addFullSymbolName(t)}if(f&262144&&a&2){prefixNextMeaning();l.push(punctuationPart(21));l.push(textPart("type parameter"));l.push(punctuationPart(22));l.push(spacePart());addFullSymbolName(t);if(t.parent){addInPrefix();addFullSymbolName(t.parent,r);writeTypeParametersOfSymbol(t.parent,r)}else{const r=getDeclarationOfKind(t,168);if(r===void 0)return S.fail();const i=r.parent;if(i){if(isFunctionLike(i)){addInPrefix();const t=e.getSignatureFromDeclaration(i);if(i.kind===180){l.push(keywordPart(105));l.push(spacePart())}else if(i.kind!==179&&i.name){addFullSymbolName(i.symbol)}addRange(l,signatureToDisplayParts(e,t,n,32))}else if(isTypeAliasDeclaration(i)){addInPrefix();l.push(keywordPart(156));l.push(spacePart());addFullSymbolName(i.symbol);writeTypeParametersOfSymbol(i.symbol,n)}}}}if(f&8){m="enum member";addPrefixForAnyFunctionOrVar(t,"enum member");const n=(c=t.declarations)==null?void 0:c[0];if((n==null?void 0:n.kind)===306){const t=e.getConstantValue(n);if(t!==void 0){l.push(spacePart());l.push(operatorPart(64));l.push(spacePart());l.push(displayPart(getTextOfConstantValue(t),typeof t==="number"?7:8))}}}if(t.flags&2097152){prefixNextMeaning();if(!_||p.length===0&&u.length===0){const n=e.getAliasedSymbol(t);if(n!==t&&n.declarations&&n.declarations.length>0){const i=n.declarations[0];const s=getNameOfDeclaration(i);if(s&&!_){const c=isModuleWithStringLiteralName(i)&&hasSyntacticModifier(i,128);const d=t.name!=="default"&&!c;const p=getSymbolDisplayPartsDocumentationAndSymbolKindWorker(e,n,getSourceFileOfNode(i),r,s,o,a,d?t:n);l.push(...p.displayParts);l.push(lineBreakPart());y=p.documentation;h=p.tags}else{y=n.getContextualDocumentationComment(i,e);h=n.getJsDocTags(e)}}}if(t.declarations){switch(t.declarations[0].kind){case 270:l.push(keywordPart(95));l.push(spacePart());l.push(keywordPart(145));break;case 277:l.push(keywordPart(95));l.push(spacePart());l.push(keywordPart(t.declarations[0].isExportEquals?64:90));break;case 281:l.push(keywordPart(95));break;default:l.push(keywordPart(102))}}l.push(spacePart());addFullSymbolName(t);forEach(t.declarations,(t=>{if(t.kind===271){const n=t;if(isExternalModuleImportEqualsDeclaration(n)){l.push(spacePart());l.push(operatorPart(64));l.push(spacePart());l.push(keywordPart(149));l.push(punctuationPart(21));l.push(displayPart(getTextOfNode(getExternalModuleImportEqualsDeclarationExpression(n)),8));l.push(punctuationPart(22))}else{const t=e.getSymbolAtLocation(n.moduleReference);if(t){l.push(spacePart());l.push(operatorPart(64));l.push(spacePart());addFullSymbolName(t,r)}}return true}}))}if(!_){if(m!==""){if(o){if(g){prefixNextMeaning();l.push(keywordPart(110))}else{addPrefixForAnyFunctionOrVar(t,m)}if(m==="property"||m==="accessor"||m==="getter"||m==="setter"||m==="JSX attribute"||f&3||m==="local var"||m==="index"||m==="using"||m==="await using"||g){l.push(punctuationPart(59));l.push(spacePart());if(o.symbol&&o.symbol.flags&262144&&m!=="index"){const t=mapToDisplayParts((t=>{const n=e.typeParameterToDeclaration(o,r,lm);getPrinter().writeNode(4,n,getSourceFileOfNode(getParseTreeNode(r)),t)}));addRange(l,t)}else{addRange(l,typeToDisplayParts(e,o,r))}if(isTransientSymbol(t)&&t.links.target&&isTransientSymbol(t.links.target)&&t.links.target.links.tupleLabelDeclaration){const e=t.links.target.links.tupleLabelDeclaration;S.assertNode(e.name,isIdentifier);l.push(spacePart());l.push(punctuationPart(21));l.push(textPart(idText(e.name)));l.push(punctuationPart(22))}}else if(f&16||f&8192||f&16384||f&131072||f&98304||m==="method"){const e=o.getNonNullableType().getCallSignatures();if(e.length){addSignatureDisplayParts(e[0],e);T=e.length>1}}}}else{m=getSymbolKind(e,t,i)}}if(p.length===0&&!T){p=t.getContextualDocumentationComment(r,e)}if(p.length===0&&f&4){if(t.parent&&t.declarations&&forEach(t.parent.declarations,(e=>e.kind===307))){for(const n of t.declarations){if(!n.parent||n.parent.kind!==226){continue}const t=e.getSymbolAtLocation(n.parent.right);if(!t){continue}p=t.getDocumentationComment(e);u=t.getJsDocTags(e);if(p.length>0){break}}}}if(p.length===0&&isIdentifier(i)&&t.valueDeclaration&&isBindingElement(t.valueDeclaration)){const n=t.valueDeclaration;const r=n.parent;const i=n.propertyName||n.name;if(isIdentifier(i)&&isObjectBindingPattern(r)){const t=getTextOfIdentifierOrLiteral(i);const n=e.getTypeAtLocation(r);p=firstDefined(n.isUnion()?n.types:[n],(n=>{const r=n.getProperty(t);return r?r.getDocumentationComment(e):void 0}))||d}}if(u.length===0&&!T){u=t.getContextualJsDocTags(r,e)}if(p.length===0&&y){p=y}if(u.length===0&&h){u=h}return{displayParts:l,documentation:p,symbolKind:m,tags:u.length===0?void 0:u};function getPrinter(){return Ia()}function prefixNextMeaning(){if(l.length){l.push(lineBreakPart())}addAliasPrefixIfNecessary()}function addAliasPrefixIfNecessary(){if(s){pushSymbolKind("alias");l.push(spacePart())}}function addInPrefix(){l.push(spacePart());l.push(keywordPart(103));l.push(spacePart())}function addFullSymbolName(r,i){let o;if(s&&r===t){r=s}if(m==="index"){o=e.getIndexInfosOfIndexSymbol(r)}let a=[];if(r.flags&131072&&o){if(r.parent){a=symbolToDisplayParts(e,r.parent)}a.push(punctuationPart(23));o.forEach(((t,n)=>{a.push(...typeToDisplayParts(e,t.keyType));if(n!==o.length-1){a.push(spacePart());a.push(punctuationPart(52));a.push(spacePart())}}));a.push(punctuationPart(24))}else{a=symbolToDisplayParts(e,r,i||n,void 0,1|2|4)}addRange(l,a);if(t.flags&16777216){l.push(punctuationPart(58))}}function addPrefixForAnyFunctionOrVar(e,t){prefixNextMeaning();if(t){pushSymbolKind(t);if(e&&!some(e.declarations,(e=>isArrowFunction(e)||(isFunctionExpression(e)||isClassExpression(e))&&!e.name))){l.push(spacePart());addFullSymbolName(e)}}}function pushSymbolKind(e){switch(e){case"var":case"function":case"let":case"const":case"constructor":case"using":case"await using":l.push(textOrKeywordPart(e));return;default:l.push(punctuationPart(21));l.push(textOrKeywordPart(e));l.push(punctuationPart(22));return}}function addSignatureDisplayParts(t,n,i=0){addRange(l,signatureToDisplayParts(e,t,r,i|32));if(n.length>1){l.push(spacePart());l.push(punctuationPart(21));l.push(operatorPart(40));l.push(displayPart((n.length-1).toString(),7));l.push(spacePart());l.push(textPart(n.length===2?"overload":"overloads"));l.push(punctuationPart(22))}p=t.getDocumentationComment(e);u=t.getJsDocTags();if(n.length>1&&p.length===0&&u.length===0){p=n[0].getDocumentationComment(e);u=n[0].getJsDocTags().filter((e=>e.name!=="deprecated"))}}function writeTypeParametersOfSymbol(t,n){const r=mapToDisplayParts((r=>{const i=e.symbolToTypeParameterDeclarations(t,n,lm);getPrinter().writeList(53776,i,getSourceFileOfNode(getParseTreeNode(n)),r)}));addRange(l,r)}}function getSymbolDisplayPartsDocumentationAndSymbolKind(e,t,n,r,i,o=getMeaningFromLocation(i),a){return getSymbolDisplayPartsDocumentationAndSymbolKindWorker(e,t,n,r,i,void 0,o,a)}function isLocalVariableOrFunction(e){if(e.parent){return false}return forEach(e.declarations,(e=>{if(e.kind===218){return true}if(e.kind!==260&&e.kind!==262){return false}for(let t=e.parent;!isFunctionBlock(t);t=t.parent){if(t.kind===307||t.kind===268){return false}}return true}))}var dm={};__export(dm,{ChangeTracker:()=>mm,LeadingTriviaOption:()=>pm,TrailingTriviaOption:()=>um,applyChanges:()=>applyChanges,assignPositionsToNode:()=>assignPositionsToNode,createWriter:()=>createWriter,deleteNode:()=>deleteNode,getAdjustedEndPosition:()=>getAdjustedEndPosition,isThisTypeAnnotatable:()=>isThisTypeAnnotatable,isValidLocationToAddComment:()=>isValidLocationToAddComment});function getPos2(e){const t=e.__pos;S.assert(typeof t==="number");return t}function setPos(e,t){S.assert(typeof t==="number");e.__pos=t}function getEnd(e){const t=e.__end;S.assert(typeof t==="number");return t}function setEnd(e,t){S.assert(typeof t==="number");e.__end=t}var pm=(e=>{e[e["Exclude"]=0]="Exclude";e[e["IncludeAll"]=1]="IncludeAll";e[e["JSDoc"]=2]="JSDoc";e[e["StartLine"]=3]="StartLine";return e})(pm||{});var um=(e=>{e[e["Exclude"]=0]="Exclude";e[e["ExcludeWhitespace"]=1]="ExcludeWhitespace";e[e["Include"]=2]="Include";return e})(um||{});function skipWhitespacesAndLineBreaks(e,t){return skipTrivia(e,t,false,true)}function hasCommentsBeforeLineBreak(e,t){let n=t;while(n0?1:0;let u=getStartPositionOfLine(getLineOfLocalPosition(e,l)+p,e);u=skipWhitespacesAndLineBreaks(e.text,u);return getStartPositionOfLine(getLineOfLocalPosition(e,u),e)}function getEndPositionOfMultilineTrailingComment(e,t,n){const{end:r}=t;const{trailingTriviaOption:i}=n;if(i===2){const n=getTrailingCommentRanges(e.text,r);if(n){const r=getLineOfLocalPosition(e,t.end);for(const t of n){if(t.kind===2||getLineOfLocalPosition(e,t.pos)>r){break}const n=getLineOfLocalPosition(e,t.end);if(n>r){return skipTrivia(e.text,t.end,true,true)}}}}return void 0}function getAdjustedEndPosition(e,t,n){var r;const{end:i}=t;const{trailingTriviaOption:o}=n;if(o===0){return i}if(o===1){const t=concatenate(getTrailingCommentRanges(e.text,i),getLeadingCommentRanges(e.text,i));const n=(r=t==null?void 0:t[t.length-1])==null?void 0:r.end;if(n){return n}return i}const a=getEndPositionOfMultilineTrailingComment(e,t,n);if(a){return a}const s=skipTrivia(e.text,i,true);return s!==i&&(o===2||isLineBreak(e.text.charCodeAt(s-1)))?s:i}function isSeparator(e,t){return!!t&&!!e.parent&&(t.kind===28||t.kind===27&&e.parent.kind===210)}function isThisTypeAnnotatable(e){return isFunctionExpression(e)||isFunctionDeclaration(e)}var mm=class _ChangeTracker{constructor(e,t){this.newLineCharacter=e;this.formatContext=t;this.changes=[];this.classesWithNodesInsertedAtStart=new Map;this.deletedNodes=[]}static fromContext(e){return new _ChangeTracker(getNewLineOrDefaultFromHost(e.host,e.formatContext.options),e.formatContext)}static with(e,t){const n=_ChangeTracker.fromContext(e);t(n);return n.getChanges()}pushRaw(e,t){S.assertEqual(e.fileName,t.fileName);for(const n of t.textChanges){this.changes.push({kind:3,sourceFile:e,text:n.newText,range:createTextRangeFromSpan(n.span)})}}deleteRange(e,t){this.changes.push({kind:0,sourceFile:e,range:t})}delete(e,t){this.deletedNodes.push({sourceFile:e,node:t})}deleteNode(e,t,n={leadingTriviaOption:1}){this.deleteRange(e,getAdjustedRange(e,t,t,n))}deleteNodes(e,t,n={leadingTriviaOption:1},r){for(const i of t){const t=getAdjustedStartPosition(e,i,n,r);const o=getAdjustedEndPosition(e,i,n);this.deleteRange(e,{pos:t,end:o});r=!!getEndPositionOfMultilineTrailingComment(e,i,n)}}deleteModifier(e,t){this.deleteRange(e,{pos:t.getStart(e),end:skipTrivia(e.text,t.end,true)})}deleteNodeRange(e,t,n,r={leadingTriviaOption:1}){const i=getAdjustedStartPosition(e,t,r);const o=getAdjustedEndPosition(e,n,r);this.deleteRange(e,{pos:i,end:o})}deleteNodeRangeExcludingEnd(e,t,n,r={leadingTriviaOption:1}){const i=getAdjustedStartPosition(e,t,r);const o=n===void 0?e.text.length:getAdjustedStartPosition(e,n,r);this.deleteRange(e,{pos:i,end:o})}replaceRange(e,t,n,r={}){this.changes.push({kind:1,sourceFile:e,range:t,options:r,node:n})}replaceNode(e,t,n,r=fm){this.replaceRange(e,getAdjustedRange(e,t,t,r),n,r)}replaceNodeRange(e,t,n,r,i=fm){this.replaceRange(e,getAdjustedRange(e,t,n,i),r,i)}replaceRangeWithNodes(e,t,n,r={}){this.changes.push({kind:2,sourceFile:e,range:t,options:r,nodes:n})}replaceNodeWithNodes(e,t,n,r=fm){this.replaceRangeWithNodes(e,getAdjustedRange(e,t,t,r),n,r)}replaceNodeWithText(e,t,n){this.replaceRangeWithText(e,getAdjustedRange(e,t,t,fm),n)}replaceNodeRangeWithNodes(e,t,n,r,i=fm){this.replaceRangeWithNodes(e,getAdjustedRange(e,t,n,i),r,i)}nodeHasTrailingComment(e,t,n=fm){return!!getEndPositionOfMultilineTrailingComment(e,t,n)}nextCommaToken(e,t){const n=findNextToken(t,t.parent,e);return n&&n.kind===28?n:void 0}replacePropertyAssignment(e,t,n){const r=this.nextCommaToken(e,t)?"":","+this.newLineCharacter;this.replaceNode(e,t,n,{suffix:r})}insertNodeAt(e,t,n,r={}){this.replaceRange(e,createRange(t),n,r)}insertNodesAt(e,t,n,r={}){this.replaceRangeWithNodes(e,createRange(t),n,r)}insertNodeAtTopOfFile(e,t,n){this.insertAtTopOfFile(e,t,n)}insertNodesAtTopOfFile(e,t,n){this.insertAtTopOfFile(e,t,n)}insertAtTopOfFile(e,t,n){const r=getInsertionPositionAtSourceFileTop(e);const i={prefix:r===0?void 0:this.newLineCharacter,suffix:(isLineBreak(e.text.charCodeAt(r))?"":this.newLineCharacter)+(n?this.newLineCharacter:"")};if(isArray(t)){this.insertNodesAt(e,r,t,i)}else{this.insertNodeAt(e,r,t,i)}}insertNodesAtEndOfFile(e,t,n){this.insertAtEndOfFile(e,t,n)}insertAtEndOfFile(e,t,n){const r=e.end+1;const i={prefix:this.newLineCharacter,suffix:this.newLineCharacter+(n?this.newLineCharacter:"")};this.insertNodesAt(e,r,t,i)}insertStatementsInNewFile(e,t,n){if(!this.newFileChanges){this.newFileChanges=createMultiMap()}this.newFileChanges.add(e,{oldFile:n,statements:t})}insertFirstParameter(e,t,n){const r=firstOrUndefined(t);if(r){this.insertNodeBefore(e,r,n)}else{this.insertNodeAt(e,t.pos,n)}}insertNodeBefore(e,t,n,r=false,i={}){this.insertNodeAt(e,getAdjustedStartPosition(e,t,i),n,this.getOptionsForInsertNodeBefore(t,n,r))}insertNodesBefore(e,t,n,r=false,i={}){this.insertNodesAt(e,getAdjustedStartPosition(e,t,i),n,this.getOptionsForInsertNodeBefore(t,first(n),r))}insertModifierAt(e,t,n,r={}){this.insertNodeAt(e,t,zr.createToken(n),r)}insertModifierBefore(e,t,n){return this.insertModifierAt(e,n.getStart(e),t,{suffix:" "})}insertCommentBeforeLine(e,t,n,r){const i=getStartPositionOfLine(t,e);const o=getFirstNonSpaceCharacterPosition(e.text,i);const a=isValidLocationToAddComment(e,o);const s=getTouchingToken(e,a?o:n);const c=e.text.slice(i,o);const l=`${a?"":this.newLineCharacter}//${r}${this.newLineCharacter}${c}`;this.insertText(e,s.getStart(e),l)}insertJsdocCommentBefore(e,t,n){const r=t.getStart(e);if(t.jsDoc){for(const n of t.jsDoc){this.deleteRange(e,{pos:getLineStartPositionForPosition(n.getStart(e),e),end:getAdjustedEndPosition(e,n,{})})}}const i=getPrecedingNonSpaceCharacterPosition(e.text,r-1);const o=e.text.slice(i,r);this.insertNodeAt(e,r,n,{suffix:this.newLineCharacter+o})}createJSDocText(e,t){const n=flatMap(t.jsDoc,(e=>isString(e.comment)?zr.createJSDocText(e.comment):e.comment));const r=singleOrUndefined(t.jsDoc);return r&&positionsAreOnSameLine(r.pos,r.end,e)&&length(n)===0?void 0:zr.createNodeArray(intersperse(n,zr.createJSDocText("\n")))}replaceJSDocComment(e,t,n){this.insertJsdocCommentBefore(e,updateJSDocHost(t),zr.createJSDocComment(this.createJSDocText(e,t),zr.createNodeArray(n)))}addJSDocTags(e,t,n){const r=flatMapToMutable(t.jsDoc,(e=>e.tags));const i=n.filter((e=>!r.some(((t,n)=>{const i=tryMergeJsdocTags(t,e);if(i)r[n]=i;return!!i}))));this.replaceJSDocComment(e,t,[...r,...i])}filterJSDocTags(e,t,n){this.replaceJSDocComment(e,t,filter(flatMapToMutable(t.jsDoc,(e=>e.tags)),n))}replaceRangeWithText(e,t,n){this.changes.push({kind:3,sourceFile:e,range:t,text:n})}insertText(e,t,n){this.replaceRangeWithText(e,createRange(t),n)}tryInsertTypeAnnotation(e,t,n){let r;if(isFunctionLike(t)){r=findChildOfKind(t,22,e);if(!r){if(!isArrowFunction(t))return false;r=first(t.parameters)}}else{r=(t.kind===260?t.exclamationToken:t.questionToken)??t.name}this.insertNodeAt(e,r.end,n,{prefix:": "});return true}tryInsertThisTypeAnnotation(e,t,n){const r=findChildOfKind(t,21,e).getStart(e)+1;const i=t.parameters.length?", ":"";this.insertNodeAt(e,r,n,{prefix:"this: ",suffix:i})}insertTypeParameters(e,t,n){const r=(findChildOfKind(t,21,e)||first(t.parameters)).getStart(e);this.insertNodesAt(e,r,n,{prefix:"<",suffix:">",joiner:", "})}getOptionsForInsertNodeBefore(e,t,n){if(isStatement(e)||isClassElement(e)){return{suffix:n?this.newLineCharacter+this.newLineCharacter:this.newLineCharacter}}else if(isVariableDeclaration(e)){return{suffix:", "}}else if(isParameter(e)){return isParameter(t)?{suffix:", "}:{}}else if(isStringLiteral(e)&&isImportDeclaration(e.parent)||isNamedImports(e)){return{suffix:", "}}else if(isImportSpecifier(e)){return{suffix:","+(n?this.newLineCharacter:" ")}}return S.failBadSyntaxKind(e)}insertNodeAtConstructorStart(e,t,n){const r=firstOrUndefined(t.body.statements);if(!r||!t.body.multiLine){this.replaceConstructorBody(e,t,[n,...t.body.statements])}else{this.insertNodeBefore(e,r,n)}}insertNodeAtConstructorStartAfterSuperCall(e,t,n){const r=find(t.body.statements,(e=>isExpressionStatement(e)&&isSuperCall(e.expression)));if(!r||!t.body.multiLine){this.replaceConstructorBody(e,t,[...t.body.statements,n])}else{this.insertNodeAfter(e,r,n)}}insertNodeAtConstructorEnd(e,t,n){const r=lastOrUndefined(t.body.statements);if(!r||!t.body.multiLine){this.replaceConstructorBody(e,t,[...t.body.statements,n])}else{this.insertNodeAfter(e,r,n)}}replaceConstructorBody(e,t,n){this.replaceNode(e,t.body,zr.createBlock(n,true))}insertNodeAtEndOfScope(e,t,n){const r=getAdjustedStartPosition(e,t.getLastToken(),{});this.insertNodeAt(e,r,n,{prefix:isLineBreak(e.text.charCodeAt(t.getLastToken().pos))?this.newLineCharacter:this.newLineCharacter+this.newLineCharacter,suffix:this.newLineCharacter})}insertMemberAtStart(e,t,n){this.insertNodeAtStartWorker(e,t,n)}insertNodeAtObjectStart(e,t,n){this.insertNodeAtStartWorker(e,t,n)}insertNodeAtStartWorker(e,t,n){const r=this.guessIndentationFromExistingMembers(e,t)??this.computeIndentationForNewMember(e,t);this.insertNodeAt(e,getMembersOrProperties(t).pos,n,this.getInsertNodeAtStartInsertOptions(e,t,r))}guessIndentationFromExistingMembers(e,t){let n;let r=t;for(const i of getMembersOrProperties(t)){if(rangeStartPositionsAreOnSameLine(r,i,e)){return void 0}const t=i.getStart(e);const o=hm.SmartIndenter.findFirstNonWhitespaceColumn(getLineStartPositionForPosition(t,e),t,e,this.formatContext.options);if(n===void 0){n=o}else if(o!==n){return void 0}r=i}return n}computeIndentationForNewMember(e,t){const n=t.getStart(e);return hm.SmartIndenter.findFirstNonWhitespaceColumn(getLineStartPositionForPosition(n,e),n,e,this.formatContext.options)+(this.formatContext.options.indentSize??4)}getInsertNodeAtStartInsertOptions(e,t,n){const r=getMembersOrProperties(t);const i=r.length===0;const o=!this.classesWithNodesInsertedAtStart.has(getNodeId(t));if(o){this.classesWithNodesInsertedAtStart.set(getNodeId(t),{node:t,sourceFile:e})}const a=isObjectLiteralExpression(t)&&(!isJsonSourceFile(e)||!i);const s=isObjectLiteralExpression(t)&&isJsonSourceFile(e)&&i&&!o;return{indentation:n,prefix:(s?",":"")+this.newLineCharacter,suffix:a?",":isInterfaceDeclaration(t)&&i?";":""}}insertNodeAfterComma(e,t,n){const r=this.insertNodeAfterWorker(e,this.nextCommaToken(e,t)||t,n);this.insertNodeAt(e,r,n,this.getInsertNodeAfterOptions(e,t))}insertNodeAfter(e,t,n){const r=this.insertNodeAfterWorker(e,t,n);this.insertNodeAt(e,r,n,this.getInsertNodeAfterOptions(e,t))}insertNodeAtEndOfList(e,t,n){this.insertNodeAt(e,t.end,n,{prefix:", "})}insertNodesAfter(e,t,n){const r=this.insertNodeAfterWorker(e,t,first(n));this.insertNodesAt(e,r,n,this.getInsertNodeAfterOptions(e,t))}insertNodeAfterWorker(e,t,n){if(needSemicolonBetween(t,n)){if(e.text.charCodeAt(t.end-1)!==59){this.replaceRange(e,createRange(t.end),zr.createToken(27))}}const r=getAdjustedEndPosition(e,t,{});return r}getInsertNodeAfterOptions(e,t){const n=this.getInsertNodeAfterOptionsWorker(t);return{...n,prefix:t.end===e.end&&isStatement(t)?n.prefix?`\n${n.prefix}`:"\n":n.prefix}}getInsertNodeAfterOptionsWorker(e){switch(e.kind){case 263:case 267:return{prefix:this.newLineCharacter,suffix:this.newLineCharacter};case 260:case 11:case 80:return{prefix:", "};case 303:return{suffix:","+this.newLineCharacter};case 95:return{prefix:" "};case 169:return{};default:S.assert(isStatement(e)||isClassOrTypeElement(e));return{suffix:this.newLineCharacter}}}insertName(e,t,n){S.assert(!t.name);if(t.kind===219){const r=findChildOfKind(t,39,e);const i=findChildOfKind(t,21,e);if(i){this.insertNodesAt(e,i.getStart(e),[zr.createToken(100),zr.createIdentifier(n)],{joiner:" "});deleteNode(this,e,r)}else{this.insertText(e,first(t.parameters).getStart(e),`function ${n}(`);this.replaceRange(e,r,zr.createToken(22))}if(t.body.kind!==241){this.insertNodesAt(e,t.body.getStart(e),[zr.createToken(19),zr.createToken(107)],{joiner:" ",suffix:" "});this.insertNodesAt(e,t.body.end,[zr.createToken(27),zr.createToken(20)],{joiner:" "})}}else{const r=findChildOfKind(t,t.kind===218?100:86,e).end;this.insertNodeAt(e,r,zr.createIdentifier(n),{prefix:" "})}}insertExportModifier(e,t){this.insertText(e,t.getStart(e),"export ")}insertImportSpecifierAtIndex(e,t,n,r){const i=n.elements[r-1];if(i){this.insertNodeInListAfter(e,i,t)}else{this.insertNodeBefore(e,n.elements[0],t,!positionsAreOnSameLine(n.elements[0].getStart(),n.parent.parent.getStart(),e))}}insertNodeInListAfter(e,t,n,r=hm.SmartIndenter.getContainingList(t,e)){if(!r){S.fail("node is not a list element");return}const i=indexOfNode(r,t);if(i<0){return}const o=t.getEnd();if(i!==r.length-1){const o=getTokenAtPosition(e,t.end);if(o&&isSeparator(t,o)){const t=r[i+1];const a=skipWhitespacesAndLineBreaks(e.text,t.getFullStart());const s=`${tokenToString(o.kind)}${e.text.substring(o.end,a)}`;this.insertNodesAt(e,a,[n],{suffix:s})}}else{const a=t.getStart(e);const s=getLineStartPositionForPosition(a,e);let c;let l=false;if(r.length===1){c=28}else{const n=findPrecedingToken(t.pos,e);c=isSeparator(t,n)?n.kind:28;const o=getLineStartPositionForPosition(r[i-1].getStart(e),e);l=o!==s}if(hasCommentsBeforeLineBreak(e.text,t.end)||!positionsAreOnSameLine(r.pos,r.end,e)){l=true}if(l){this.replaceRange(e,createRange(o),zr.createToken(c));const t=hm.SmartIndenter.findFirstNonWhitespaceColumn(s,a,e,this.formatContext.options);let r=skipTrivia(e.text,o,true,false);while(r!==o&&isLineBreak(e.text.charCodeAt(r-1))){r--}this.replaceRange(e,createRange(r),n,{indentation:t,prefix:this.newLineCharacter})}else{this.replaceRange(e,createRange(o),n,{prefix:`${tokenToString(c)} `})}}}parenthesizeExpression(e,t){this.replaceRange(e,rangeOfNode(t),zr.createParenthesizedExpression(t))}finishClassesWithNodesInsertedAtStart(){this.classesWithNodesInsertedAtStart.forEach((({node:e,sourceFile:t})=>{const[n,r]=getClassOrObjectBraceEnds(e,t);if(n!==void 0&&r!==void 0){const i=getMembersOrProperties(e).length===0;const o=positionsAreOnSameLine(n,r,t);if(i&&o&&n!==r-1){this.deleteRange(t,createRange(n,r-1))}if(o){this.insertText(t,r-1,this.newLineCharacter)}}}))}finishDeleteDeclarations(){const e=new Set;for(const{sourceFile:t,node:n}of this.deletedNodes){if(!this.deletedNodes.some((e=>e.sourceFile===t&&rangeContainsRangeExclusive(e.node,n)))){if(isArray(n)){this.deleteRange(t,rangeOfTypeParameters(t,n))}else{ym.deleteDeclaration(this,e,t,n)}}}e.forEach((t=>{const n=t.getSourceFile();const r=hm.SmartIndenter.getContainingList(t,n);if(t!==last(r))return;const i=findLastIndex(r,(t=>!e.has(t)),r.length-2);if(i!==-1){this.deleteRange(n,{pos:r[i].end,end:startPositionToDeleteNodeInList(n,r[i+1])})}}))}getChanges(e){this.finishDeleteDeclarations();this.finishClassesWithNodesInsertedAtStart();const t=_m.getTextChangesFromChanges(this.changes,this.newLineCharacter,this.formatContext,e);if(this.newFileChanges){this.newFileChanges.forEach(((e,n)=>{t.push(_m.newFileChanges(n,e,this.newLineCharacter,this.formatContext))}))}return t}createNewFile(e,t,n){this.insertStatementsInNewFile(t,n,e)}};function updateJSDocHost(e){if(e.kind!==219){return e}const t=e.parent.kind===172?e.parent:e.parent.parent;t.jsDoc=e.jsDoc;return t}function tryMergeJsdocTags(e,t){if(e.kind!==t.kind){return void 0}switch(e.kind){case 341:{const n=e;const r=t;return isIdentifier(n.name)&&isIdentifier(r.name)&&n.name.escapedText===r.name.escapedText?zr.createJSDocParameterTag(void 0,r.name,false,r.typeExpression,r.isNameFirst,n.comment):void 0}case 342:return zr.createJSDocReturnTag(void 0,t.typeExpression,e.comment);case 344:return zr.createJSDocTypeTag(void 0,t.typeExpression,e.comment)}}function startPositionToDeleteNodeInList(e,t){return skipTrivia(e.text,getAdjustedStartPosition(e,t,{leadingTriviaOption:1}),false,true)}function endPositionToDeleteNodeInList(e,t,n,r){const i=startPositionToDeleteNodeInList(e,r);if(n===void 0||positionsAreOnSameLine(getAdjustedEndPosition(e,t,{}),i,e)){return i}const o=findPrecedingToken(r.getStart(e),e);if(isSeparator(t,o)){const r=findPrecedingToken(t.getStart(e),e);if(isSeparator(n,r)){const t=skipTrivia(e.text,o.getEnd(),true,true);if(positionsAreOnSameLine(r.getStart(e),o.getStart(e),e)){return isLineBreak(e.text.charCodeAt(t-1))?t-1:t}if(isLineBreak(e.text.charCodeAt(t))){return t}}}return i}function getClassOrObjectBraceEnds(e,t){const n=findChildOfKind(e,19,t);const r=findChildOfKind(e,20,t);return[n==null?void 0:n.end,r==null?void 0:r.end]}function getMembersOrProperties(e){return isObjectLiteralExpression(e)?e.properties:e.members}var _m;(e=>{function getTextChangesFromChanges(e,t,n,r){return mapDefined(group(e,(e=>e.sourceFile.path)),(e=>{const i=e[0].sourceFile;const o=toSorted(e,((e,t)=>e.range.pos-t.range.pos||e.range.end-t.range.end));for(let e=0;e`${JSON.stringify(o[e].range)} and ${JSON.stringify(o[e+1].range)}`))}const a=mapDefined(o,(e=>{const o=createTextSpanFromRange(e.range);const a=e.kind===1?getSourceFileOfNode(getOriginalNode(e.node))??e.sourceFile:e.kind===2?getSourceFileOfNode(getOriginalNode(e.nodes[0]))??e.sourceFile:e.sourceFile;const s=computeNewText(e,a,i,t,n,r);if(o.length===s.length&&stringContainsAt(a.text,s,o.start)){return void 0}return createTextChange(o,s)}));return a.length>0?{fileName:i.fileName,textChanges:a}:void 0}))}e.getTextChangesFromChanges=getTextChangesFromChanges;function newFileChanges(e,t,n,r){const i=newFileChangesWorker(getScriptKindFromFileName(e),t,n,r);return{fileName:e,textChanges:[createTextChange(createTextSpan(0,0),i)],isNewFile:true}}e.newFileChanges=newFileChanges;function newFileChangesWorker(e,t,n,r){const i=flatMap(t,(e=>e.statements.map((t=>t===4?"":getNonformattedText(t,e.oldFile,n).text)))).join(n);const o=createSourceFile("any file name",i,{languageVersion:99,jsDocParsingMode:1},true,e);const a=hm.formatDocument(o,r);return applyChanges(i,a)+n}e.newFileChangesWorker=newFileChangesWorker;function computeNewText(e,t,n,r,i,o){var a;if(e.kind===0){return""}if(e.kind===3){return e.text}const{options:s={},range:{pos:c}}=e;const format=e=>getFormattedTextOfNode(e,t,n,c,s,r,i,o);const l=e.kind===2?e.nodes.map((e=>removeSuffix(format(e),r))).join(((a=e.options)==null?void 0:a.joiner)||r):format(e.node);const d=s.indentation!==void 0||getLineStartPositionForPosition(c,t)===c?l:l.replace(/^\s+/,"");return(s.prefix||"")+d+(!s.suffix||endsWith(d,s.suffix)?"":s.suffix)}function getFormattedTextOfNode(e,t,n,r,{indentation:i,prefix:o,delta:a},s,c,l){const{node:d,text:p}=getNonformattedText(e,t,s);if(l)l(d,p);const u=getFormatCodeSettingsForWriting(c,t);const f=i!==void 0?i:hm.SmartIndenter.getIndentation(r,n,u,o===s||getLineStartPositionForPosition(r,t)===r);if(a===void 0){a=hm.SmartIndenter.shouldIndentChildNode(u,e)?u.indentSize||0:0}const m={text:p,getLineAndCharacterOfPosition(e){return getLineAndCharacterOfPosition(this,e)}};const _=hm.formatNodeGivenIndentation(d,m,t.languageVariant,f,a,{...c,options:u});return applyChanges(p,_)}function getNonformattedText(e,t,n){const r=createWriter(n);const i=getNewLineKind(n);createPrinter({newLine:i,neverAsciiEscape:true,preserveSourceNewlines:true,terminateUnterminatedLiterals:true},r).writeNode(4,e,t,r);return{text:r.getText(),node:assignPositionsToNode(e)}}e.getNonformattedText=getNonformattedText})(_m||(_m={}));function applyChanges(e,t){for(let n=t.length-1;n>=0;n--){const{span:r,newText:i}=t[n];e=`${e.substring(0,r.start)}${i}${e.substring(textSpanEnd(r))}`}return e}function isTrivia2(e){return skipTrivia(e,0)===e.length}var gm={...ka,factory:createNodeFactory(ka.factory.flags|1,ka.factory.baseFactory)};function assignPositionsToNode(e){const t=visitEachChild(e,assignPositionsToNode,gm,assignPositionsToNodeArray,assignPositionsToNode);const n=nodeIsSynthesized(t)?t:Object.create(t);setTextRangePosEnd(n,getPos2(e),getEnd(e));return n}function assignPositionsToNodeArray(e,t,n,r,i){const o=visitNodes2(e,t,n,r,i);if(!o){return o}S.assert(e);const a=o===e?zr.createNodeArray(o.slice(0)):o;setTextRangePosEnd(a,getPos2(e),getEnd(e));return a}function createWriter(e){let t=0;const n=createTextWriter(e);const onBeforeEmitNode=e=>{if(e){setPos(e,t)}};const onAfterEmitNode=e=>{if(e){setEnd(e,t)}};const onBeforeEmitNodeArray=e=>{if(e){setPos(e,t)}};const onAfterEmitNodeArray=e=>{if(e){setEnd(e,t)}};const onBeforeEmitToken=e=>{if(e){setPos(e,t)}};const onAfterEmitToken=e=>{if(e){setEnd(e,t)}};function setLastNonTriviaPosition(e,r){if(r||!isTrivia2(e)){t=n.getTextPos();let r=0;while(isWhiteSpaceLike(e.charCodeAt(e.length-r-1))){r++}t-=r}}function write(e){n.write(e);setLastNonTriviaPosition(e,false)}function writeComment(e){n.writeComment(e)}function writeKeyword(e){n.writeKeyword(e);setLastNonTriviaPosition(e,false)}function writeOperator(e){n.writeOperator(e);setLastNonTriviaPosition(e,false)}function writePunctuation(e){n.writePunctuation(e);setLastNonTriviaPosition(e,false)}function writeTrailingSemicolon(e){n.writeTrailingSemicolon(e);setLastNonTriviaPosition(e,false)}function writeParameter(e){n.writeParameter(e);setLastNonTriviaPosition(e,false)}function writeProperty(e){n.writeProperty(e);setLastNonTriviaPosition(e,false)}function writeSpace(e){n.writeSpace(e);setLastNonTriviaPosition(e,false)}function writeStringLiteral(e){n.writeStringLiteral(e);setLastNonTriviaPosition(e,false)}function writeSymbol(e,t){n.writeSymbol(e,t);setLastNonTriviaPosition(e,false)}function writeLine(e){n.writeLine(e)}function increaseIndent(){n.increaseIndent()}function decreaseIndent(){n.decreaseIndent()}function getText(){return n.getText()}function rawWrite(e){n.rawWrite(e);setLastNonTriviaPosition(e,false)}function writeLiteral(e){n.writeLiteral(e);setLastNonTriviaPosition(e,true)}function getTextPos(){return n.getTextPos()}function getLine(){return n.getLine()}function getColumn(){return n.getColumn()}function getIndent(){return n.getIndent()}function isAtStartOfLine(){return n.isAtStartOfLine()}function clear2(){n.clear();t=0}return{onBeforeEmitNode:onBeforeEmitNode,onAfterEmitNode:onAfterEmitNode,onBeforeEmitNodeArray:onBeforeEmitNodeArray,onAfterEmitNodeArray:onAfterEmitNodeArray,onBeforeEmitToken:onBeforeEmitToken,onAfterEmitToken:onAfterEmitToken,write:write,writeComment:writeComment,writeKeyword:writeKeyword,writeOperator:writeOperator,writePunctuation:writePunctuation,writeTrailingSemicolon:writeTrailingSemicolon,writeParameter:writeParameter,writeProperty:writeProperty,writeSpace:writeSpace,writeStringLiteral:writeStringLiteral,writeSymbol:writeSymbol,writeLine:writeLine,increaseIndent:increaseIndent,decreaseIndent:decreaseIndent,getText:getText,rawWrite:rawWrite,writeLiteral:writeLiteral,getTextPos:getTextPos,getLine:getLine,getColumn:getColumn,getIndent:getIndent,isAtStartOfLine:isAtStartOfLine,hasTrailingComment:()=>n.hasTrailingComment(),hasTrailingWhitespace:()=>n.hasTrailingWhitespace(),clear:clear2}}function getInsertionPositionAtSourceFileTop(e){let t;for(const n of e.statements){if(isPrologueDirective(n)){t=n}else{break}}let n=0;const r=e.text;if(t){n=t.end;advancePastLineBreak();return n}const i=getShebang(r);if(i!==void 0){n=i.length;advancePastLineBreak()}const o=getLeadingCommentRanges(r,n);if(!o)return n;let a;let s;for(const t of o){if(t.kind===3){if(isPinnedComment(r,t.pos)){a={range:t,pinnedOrTripleSlash:true};continue}}else if(isRecognizedTripleSlashComment(r,t.pos,t.end)){a={range:t,pinnedOrTripleSlash:true};continue}if(a){if(a.pinnedOrTripleSlash)break;const n=e.getLineAndCharacterOfPosition(t.pos).line;const r=e.getLineAndCharacterOfPosition(a.range.end).line;if(n>=r+2)break}if(e.statements.length){if(s===void 0)s=e.getLineAndCharacterOfPosition(e.statements[0].getStart()).line;const n=e.getLineAndCharacterOfPosition(t.end).line;if(s{function deleteDeclaration2(e,t,n,r){switch(r.kind){case 169:{const i=r.parent;if(isArrowFunction(i)&&i.parameters.length===1&&!findChildOfKind(i,21,n)){e.replaceNodeWithText(n,r,"()")}else{deleteNodeInList(e,t,n,r)}break}case 272:case 271:const i=n.imports.length&&r===first(n.imports).parent||r===find(n.statements,isAnyImportSyntax);deleteNode(e,n,r,{leadingTriviaOption:i?0:hasJSDocNodes(r)?2:3});break;case 208:const o=r.parent;const a=o.kind===207&&r!==last(o.elements);if(a){deleteNode(e,n,r)}else{deleteNodeInList(e,t,n,r)}break;case 260:deleteVariableDeclaration(e,t,n,r);break;case 168:deleteNodeInList(e,t,n,r);break;case 276:const s=r.parent;if(s.elements.length===1){deleteImportBinding(e,n,s)}else{deleteNodeInList(e,t,n,r)}break;case 274:deleteImportBinding(e,n,r);break;case 27:deleteNode(e,n,r,{trailingTriviaOption:0});break;case 100:deleteNode(e,n,r,{leadingTriviaOption:0});break;case 263:case 262:deleteNode(e,n,r,{leadingTriviaOption:hasJSDocNodes(r)?2:3});break;default:if(!r.parent){deleteNode(e,n,r)}else if(isImportClause(r.parent)&&r.parent.name===r){deleteDefaultImport(e,n,r.parent)}else if(isCallExpression(r.parent)&&contains(r.parent.arguments,r)){deleteNodeInList(e,t,n,r)}else{deleteNode(e,n,r)}}}e.deleteDeclaration=deleteDeclaration2;function deleteDefaultImport(e,t,n){if(!n.namedBindings){deleteNode(e,t,n.parent)}else{const r=n.name.getStart(t);const i=getTokenAtPosition(t,n.name.end);if(i&&i.kind===28){const n=skipTrivia(t.text,i.end,false,true);e.deleteRange(t,{pos:r,end:n})}else{deleteNode(e,t,n.name)}}}function deleteImportBinding(e,t,n){if(n.parent.name){const r=S.checkDefined(getTokenAtPosition(t,n.pos-1));e.deleteRange(t,{pos:r.getStart(t),end:n.end})}else{const r=getAncestor(n,272);deleteNode(e,t,r)}}function deleteVariableDeclaration(e,t,n,r){const{parent:i}=r;if(i.kind===299){e.deleteNodeRange(n,findChildOfKind(i,21,n),findChildOfKind(i,22,n));return}if(i.declarations.length!==1){deleteNodeInList(e,t,n,r);return}const o=i.parent;switch(o.kind){case 250:case 249:e.replaceNode(n,r,zr.createObjectLiteralExpression());break;case 248:deleteNode(e,n,i);break;case 243:deleteNode(e,n,o,{leadingTriviaOption:hasJSDocNodes(o)?2:3});break;default:S.assertNever(o)}}})(ym||(ym={}));function deleteNode(e,t,n,r={leadingTriviaOption:1}){const i=getAdjustedStartPosition(t,n,r);const o=getAdjustedEndPosition(t,n,r);e.deleteRange(t,{pos:i,end:o})}function deleteNodeInList(e,t,n,r){const i=S.checkDefined(hm.SmartIndenter.getContainingList(r,n));const o=indexOfNode(i,r);S.assert(o!==-1);if(i.length===1){deleteNode(e,n,r);return}S.assert(!t.has(r),"Deleting a node twice");t.add(r);e.deleteRange(n,{pos:startPositionToDeleteNodeInList(n,r),end:o===i.length-1?getAdjustedEndPosition(n,r,{}):endPositionToDeleteNodeInList(n,r,i[o-1],i[o+1])})}var hm={};__export(hm,{FormattingContext:()=>Sm,FormattingRequestKind:()=>Tm,RuleAction:()=>Cm,RuleFlags:()=>Em,SmartIndenter:()=>wm,anyContext:()=>bm,createTextRangeWithKind:()=>createTextRangeWithKind,formatDocument:()=>formatDocument,formatNodeGivenIndentation:()=>formatNodeGivenIndentation,formatOnClosingCurly:()=>formatOnClosingCurly,formatOnEnter:()=>formatOnEnter,formatOnOpeningCurly:()=>formatOnOpeningCurly,formatOnSemicolon:()=>formatOnSemicolon,formatSelection:()=>formatSelection,getAllRules:()=>getAllRules,getFormatContext:()=>getFormatContext,getFormattingScanner:()=>getFormattingScanner,getIndentationString:()=>getIndentationString,getRangeOfEnclosingComment:()=>getRangeOfEnclosingComment});var Tm=(e=>{e[e["FormatDocument"]=0]="FormatDocument";e[e["FormatSelection"]=1]="FormatSelection";e[e["FormatOnEnter"]=2]="FormatOnEnter";e[e["FormatOnSemicolon"]=3]="FormatOnSemicolon";e[e["FormatOnOpeningCurlyBrace"]=4]="FormatOnOpeningCurlyBrace";e[e["FormatOnClosingCurlyBrace"]=5]="FormatOnClosingCurlyBrace";return e})(Tm||{});var Sm=class{constructor(e,t,n){this.sourceFile=e;this.formattingRequestKind=t;this.options=n}updateContext(e,t,n,r,i){this.currentTokenSpan=S.checkDefined(e);this.currentTokenParent=S.checkDefined(t);this.nextTokenSpan=S.checkDefined(n);this.nextTokenParent=S.checkDefined(r);this.contextNode=S.checkDefined(i);this.contextNodeAllOnSameLine=void 0;this.nextNodeAllOnSameLine=void 0;this.tokensAreOnSameLine=void 0;this.contextNodeBlockIsOnOneLine=void 0;this.nextNodeBlockIsOnOneLine=void 0}ContextNodeAllOnSameLine(){if(this.contextNodeAllOnSameLine===void 0){this.contextNodeAllOnSameLine=this.NodeIsOnOneLine(this.contextNode)}return this.contextNodeAllOnSameLine}NextNodeAllOnSameLine(){if(this.nextNodeAllOnSameLine===void 0){this.nextNodeAllOnSameLine=this.NodeIsOnOneLine(this.nextTokenParent)}return this.nextNodeAllOnSameLine}TokensAreOnSameLine(){if(this.tokensAreOnSameLine===void 0){const e=this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line;const t=this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;this.tokensAreOnSameLine=e===t}return this.tokensAreOnSameLine}ContextNodeBlockIsOnOneLine(){if(this.contextNodeBlockIsOnOneLine===void 0){this.contextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.contextNode)}return this.contextNodeBlockIsOnOneLine}NextNodeBlockIsOnOneLine(){if(this.nextNodeBlockIsOnOneLine===void 0){this.nextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.nextTokenParent)}return this.nextNodeBlockIsOnOneLine}NodeIsOnOneLine(e){const t=this.sourceFile.getLineAndCharacterOfPosition(e.getStart(this.sourceFile)).line;const n=this.sourceFile.getLineAndCharacterOfPosition(e.getEnd()).line;return t===n}BlockIsOnOneLine(e){const t=findChildOfKind(e,19,this.sourceFile);const n=findChildOfKind(e,20,this.sourceFile);if(t&&n){const e=this.sourceFile.getLineAndCharacterOfPosition(t.getEnd()).line;const r=this.sourceFile.getLineAndCharacterOfPosition(n.getStart(this.sourceFile)).line;return e===r}return false}};var vm=createScanner(99,false,0);var xm=createScanner(99,false,1);function getFormattingScanner(e,t,n,r,i){const o=t===1?xm:vm;o.setText(e);o.resetTokenState(n);let a=true;let s;let c;let l;let d;let p;const u=i({advance:advance,readTokenInfo:readTokenInfo,readEOFTokenRange:readEOFTokenRange,isOnToken:isOnToken,isOnEOF:isOnEOF,getCurrentLeadingTrivia:()=>s,lastTrailingTriviaWasNewLine:()=>a,skipToEndOf:skipToEndOf,skipToStartOf:skipToStartOf,getTokenFullStart:()=>(p==null?void 0:p.token.pos)??o.getTokenStart(),getStartPos:()=>(p==null?void 0:p.token.pos)??o.getTokenStart()});p=void 0;o.setText(void 0);return u;function advance(){p=void 0;const e=o.getTokenFullStart()!==n;if(e){a=!!c&&last(c).kind===4}else{o.scan()}s=void 0;c=void 0;let t=o.getTokenFullStart();while(t{e[e["None"]=0]="None";e[e["StopProcessingSpaceActions"]=1]="StopProcessingSpaceActions";e[e["StopProcessingTokenActions"]=2]="StopProcessingTokenActions";e[e["InsertSpace"]=4]="InsertSpace";e[e["InsertNewLine"]=8]="InsertNewLine";e[e["DeleteSpace"]=16]="DeleteSpace";e[e["DeleteToken"]=32]="DeleteToken";e[e["InsertTrailingSemicolon"]=64]="InsertTrailingSemicolon";e[e["StopAction"]=3]="StopAction";e[e["ModifySpaceAction"]=28]="ModifySpaceAction";e[e["ModifyTokenAction"]=96]="ModifyTokenAction";return e})(Cm||{});var Em=(e=>{e[e["None"]=0]="None";e[e["CanDeleteNewLines"]=1]="CanDeleteNewLines";return e})(Em||{});function getAllRules(){const e=[];for(let t=0;t<=165;t++){if(t!==1){e.push(t)}}function anyTokenExcept(...t){return{tokens:e.filter((e=>!t.some((t=>t===e)))),isSpecific:false}}const t={tokens:e,isSpecific:false};const n=tokenRangeFrom([...e,3]);const r=tokenRangeFrom([...e,1]);const i=tokenRangeFromRange(83,165);const o=tokenRangeFromRange(30,79);const a=[103,104,165,130,142,152];const s=[46,47,55,54];const c=[9,10,80,21,23,19,110,105];const l=[80,21,110,105];const d=[80,22,24,105];const p=[80,21,110,105];const u=[80,22,24,105];const f=[2,3];const m=[80,...Qs];const _=n;const g=tokenRangeFrom([80,32,3,86,95,102]);const y=tokenRangeFrom([22,3,92,113,98,93,85]);const h=[rule("IgnoreBeforeComment",t,f,bm,1),rule("IgnoreAfterLineComment",2,t,bm,1),rule("NotSpaceBeforeColon",t,59,[isNonJsxSameLineTokenContext,isNotBinaryOpContext,isNotTypeAnnotationContext],16),rule("SpaceAfterColon",59,t,[isNonJsxSameLineTokenContext,isNotBinaryOpContext,isNextTokenParentNotJsxNamespacedName],4),rule("NoSpaceBeforeQuestionMark",t,58,[isNonJsxSameLineTokenContext,isNotBinaryOpContext,isNotTypeAnnotationContext],16),rule("SpaceAfterQuestionMarkInConditionalOperator",58,t,[isNonJsxSameLineTokenContext,isConditionalOperatorContext],4),rule("NoSpaceAfterQuestionMark",58,t,[isNonJsxSameLineTokenContext,isNonOptionalPropertyContext],16),rule("NoSpaceBeforeDot",t,[25,29],[isNonJsxSameLineTokenContext,isNotPropertyAccessOnIntegerLiteral],16),rule("NoSpaceAfterDot",[25,29],t,[isNonJsxSameLineTokenContext],16),rule("NoSpaceBetweenImportParenInImportType",102,21,[isNonJsxSameLineTokenContext,isImportTypeContext],16),rule("NoSpaceAfterUnaryPrefixOperator",s,c,[isNonJsxSameLineTokenContext,isNotBinaryOpContext],16),rule("NoSpaceAfterUnaryPreincrementOperator",46,l,[isNonJsxSameLineTokenContext],16),rule("NoSpaceAfterUnaryPredecrementOperator",47,p,[isNonJsxSameLineTokenContext],16),rule("NoSpaceBeforeUnaryPostincrementOperator",d,46,[isNonJsxSameLineTokenContext,isNotStatementConditionContext],16),rule("NoSpaceBeforeUnaryPostdecrementOperator",u,47,[isNonJsxSameLineTokenContext,isNotStatementConditionContext],16),rule("SpaceAfterPostincrementWhenFollowedByAdd",46,40,[isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("SpaceAfterAddWhenFollowedByUnaryPlus",40,40,[isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("SpaceAfterAddWhenFollowedByPreincrement",40,46,[isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("SpaceAfterPostdecrementWhenFollowedBySubtract",47,41,[isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("SpaceAfterSubtractWhenFollowedByUnaryMinus",41,41,[isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("SpaceAfterSubtractWhenFollowedByPredecrement",41,47,[isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("NoSpaceAfterCloseBrace",20,[28,27],[isNonJsxSameLineTokenContext],16),rule("NewLineBeforeCloseBraceInBlockContext",n,20,[isMultilineBlockContext],8),rule("SpaceAfterCloseBrace",20,anyTokenExcept(22),[isNonJsxSameLineTokenContext,isAfterCodeBlockContext],4),rule("SpaceBetweenCloseBraceAndElse",20,93,[isNonJsxSameLineTokenContext],4),rule("SpaceBetweenCloseBraceAndWhile",20,117,[isNonJsxSameLineTokenContext],4),rule("NoSpaceBetweenEmptyBraceBrackets",19,20,[isNonJsxSameLineTokenContext,isObjectContext],16),rule("SpaceAfterConditionalClosingParen",22,23,[isControlDeclContext],4),rule("NoSpaceBetweenFunctionKeywordAndStar",100,42,[isFunctionDeclarationOrFunctionExpressionContext],16),rule("SpaceAfterStarInGeneratorDeclaration",42,80,[isFunctionDeclarationOrFunctionExpressionContext],4),rule("SpaceAfterFunctionInFuncDecl",100,t,[isFunctionDeclContext],4),rule("NewLineAfterOpenBraceInBlockContext",19,t,[isMultilineBlockContext],8),rule("SpaceAfterGetSetInMember",[139,153],80,[isFunctionDeclContext],4),rule("NoSpaceBetweenYieldKeywordAndStar",127,42,[isNonJsxSameLineTokenContext,isYieldOrYieldStarWithOperand],16),rule("SpaceBetweenYieldOrYieldStarAndOperand",[127,42],t,[isNonJsxSameLineTokenContext,isYieldOrYieldStarWithOperand],4),rule("NoSpaceBetweenReturnAndSemicolon",107,27,[isNonJsxSameLineTokenContext],16),rule("SpaceAfterCertainKeywords",[115,111,105,91,107,114,135],t,[isNonJsxSameLineTokenContext],4),rule("SpaceAfterLetConstInVariableDeclaration",[121,87],t,[isNonJsxSameLineTokenContext,isStartOfVariableDeclarationList],4),rule("NoSpaceBeforeOpenParenInFuncCall",t,21,[isNonJsxSameLineTokenContext,isFunctionCallOrNewContext,isPreviousTokenNotComma],16),rule("SpaceBeforeBinaryKeywordOperator",t,a,[isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("SpaceAfterBinaryKeywordOperator",a,t,[isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("SpaceAfterVoidOperator",116,t,[isNonJsxSameLineTokenContext,isVoidOpContext],4),rule("SpaceBetweenAsyncAndOpenParen",134,21,[isArrowFunctionContext,isNonJsxSameLineTokenContext],4),rule("SpaceBetweenAsyncAndFunctionKeyword",134,[100,80],[isNonJsxSameLineTokenContext],4),rule("NoSpaceBetweenTagAndTemplateString",[80,22],[15,16],[isNonJsxSameLineTokenContext],16),rule("SpaceBeforeJsxAttribute",t,80,[isNextTokenParentJsxAttribute,isNonJsxSameLineTokenContext],4),rule("SpaceBeforeSlashInJsxOpeningElement",t,44,[isJsxSelfClosingElementContext,isNonJsxSameLineTokenContext],4),rule("NoSpaceBeforeGreaterThanTokenInJsxOpeningElement",44,32,[isJsxSelfClosingElementContext,isNonJsxSameLineTokenContext],16),rule("NoSpaceBeforeEqualInJsxAttribute",t,64,[isJsxAttributeContext,isNonJsxSameLineTokenContext],16),rule("NoSpaceAfterEqualInJsxAttribute",64,t,[isJsxAttributeContext,isNonJsxSameLineTokenContext],16),rule("NoSpaceBeforeJsxNamespaceColon",80,59,[isNextTokenParentJsxNamespacedName],16),rule("NoSpaceAfterJsxNamespaceColon",59,80,[isNextTokenParentJsxNamespacedName],16),rule("NoSpaceAfterModuleImport",[144,149],21,[isNonJsxSameLineTokenContext],16),rule("SpaceAfterCertainTypeScriptKeywords",[128,129,86,138,90,94,95,96,139,119,102,120,144,145,123,125,124,148,153,126,156,161,143,140],t,[isNonJsxSameLineTokenContext],4),rule("SpaceBeforeCertainTypeScriptKeywords",t,[96,119,161],[isNonJsxSameLineTokenContext],4),rule("SpaceAfterModuleName",11,19,[isModuleDeclContext],4),rule("SpaceBeforeArrow",t,39,[isNonJsxSameLineTokenContext],4),rule("SpaceAfterArrow",39,t,[isNonJsxSameLineTokenContext],4),rule("NoSpaceAfterEllipsis",26,80,[isNonJsxSameLineTokenContext],16),rule("NoSpaceAfterOptionalParameters",58,[22,28],[isNonJsxSameLineTokenContext,isNotBinaryOpContext],16),rule("NoSpaceBetweenEmptyInterfaceBraceBrackets",19,20,[isNonJsxSameLineTokenContext,isObjectTypeContext],16),rule("NoSpaceBeforeOpenAngularBracket",m,30,[isNonJsxSameLineTokenContext,isTypeArgumentOrParameterOrAssertionContext],16),rule("NoSpaceBetweenCloseParenAndAngularBracket",22,30,[isNonJsxSameLineTokenContext,isTypeArgumentOrParameterOrAssertionContext],16),rule("NoSpaceAfterOpenAngularBracket",30,t,[isNonJsxSameLineTokenContext,isTypeArgumentOrParameterOrAssertionContext],16),rule("NoSpaceBeforeCloseAngularBracket",t,32,[isNonJsxSameLineTokenContext,isTypeArgumentOrParameterOrAssertionContext],16),rule("NoSpaceAfterCloseAngularBracket",32,[21,23,32,28],[isNonJsxSameLineTokenContext,isTypeArgumentOrParameterOrAssertionContext,isNotFunctionDeclContext,isNonTypeAssertionContext],16),rule("SpaceBeforeAt",[22,80],60,[isNonJsxSameLineTokenContext],4),rule("NoSpaceAfterAt",60,t,[isNonJsxSameLineTokenContext],16),rule("SpaceAfterDecorator",t,[128,80,95,90,86,126,125,123,124,139,153,23,42],[isEndOfDecoratorContextOnSameLine],4),rule("NoSpaceBeforeNonNullAssertionOperator",t,54,[isNonJsxSameLineTokenContext,isNonNullAssertionContext],16),rule("NoSpaceAfterNewKeywordOnConstructorSignature",105,21,[isNonJsxSameLineTokenContext,isConstructorSignatureContext],16),rule("SpaceLessThanAndNonJSXTypeAnnotation",30,30,[isNonJsxSameLineTokenContext],4)];const T=[rule("SpaceAfterConstructor",137,21,[isOptionEnabled("insertSpaceAfterConstructor"),isNonJsxSameLineTokenContext],4),rule("NoSpaceAfterConstructor",137,21,[isOptionDisabledOrUndefined("insertSpaceAfterConstructor"),isNonJsxSameLineTokenContext],16),rule("SpaceAfterComma",28,t,[isOptionEnabled("insertSpaceAfterCommaDelimiter"),isNonJsxSameLineTokenContext,isNonJsxElementOrFragmentContext,isNextTokenNotCloseBracket,isNextTokenNotCloseParen],4),rule("NoSpaceAfterComma",28,t,[isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"),isNonJsxSameLineTokenContext,isNonJsxElementOrFragmentContext],16),rule("SpaceAfterAnonymousFunctionKeyword",[100,42],21,[isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),isFunctionDeclContext],4),rule("NoSpaceAfterAnonymousFunctionKeyword",[100,42],21,[isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),isFunctionDeclContext],16),rule("SpaceAfterKeywordInControl",i,21,[isOptionEnabled("insertSpaceAfterKeywordsInControlFlowStatements"),isControlDeclContext],4),rule("NoSpaceAfterKeywordInControl",i,21,[isOptionDisabledOrUndefined("insertSpaceAfterKeywordsInControlFlowStatements"),isControlDeclContext],16),rule("SpaceAfterOpenParen",21,t,[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),isNonJsxSameLineTokenContext],4),rule("SpaceBeforeCloseParen",t,22,[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),isNonJsxSameLineTokenContext],4),rule("SpaceBetweenOpenParens",21,21,[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),isNonJsxSameLineTokenContext],4),rule("NoSpaceBetweenParens",21,22,[isNonJsxSameLineTokenContext],16),rule("NoSpaceAfterOpenParen",21,t,[isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),isNonJsxSameLineTokenContext],16),rule("NoSpaceBeforeCloseParen",t,22,[isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),isNonJsxSameLineTokenContext],16),rule("SpaceAfterOpenBracket",23,t,[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),isNonJsxSameLineTokenContext],4),rule("SpaceBeforeCloseBracket",t,24,[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),isNonJsxSameLineTokenContext],4),rule("NoSpaceBetweenBrackets",23,24,[isNonJsxSameLineTokenContext],16),rule("NoSpaceAfterOpenBracket",23,t,[isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),isNonJsxSameLineTokenContext],16),rule("NoSpaceBeforeCloseBracket",t,24,[isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),isNonJsxSameLineTokenContext],16),rule("SpaceAfterOpenBrace",19,t,[isOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),isBraceWrappedContext],4),rule("SpaceBeforeCloseBrace",t,20,[isOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),isBraceWrappedContext],4),rule("NoSpaceBetweenEmptyBraceBrackets",19,20,[isNonJsxSameLineTokenContext,isObjectContext],16),rule("NoSpaceAfterOpenBrace",19,t,[isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),isNonJsxSameLineTokenContext],16),rule("NoSpaceBeforeCloseBrace",t,20,[isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),isNonJsxSameLineTokenContext],16),rule("SpaceBetweenEmptyBraceBrackets",19,20,[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")],4),rule("NoSpaceBetweenEmptyBraceBrackets",19,20,[isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"),isNonJsxSameLineTokenContext],16),rule("SpaceAfterTemplateHeadAndMiddle",[16,17],t,[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),isNonJsxTextContext],4,1),rule("SpaceBeforeTemplateMiddleAndTail",t,[17,18],[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),isNonJsxSameLineTokenContext],4),rule("NoSpaceAfterTemplateHeadAndMiddle",[16,17],t,[isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),isNonJsxTextContext],16,1),rule("NoSpaceBeforeTemplateMiddleAndTail",t,[17,18],[isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),isNonJsxSameLineTokenContext],16),rule("SpaceAfterOpenBraceInJsxExpression",19,t,[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),isNonJsxSameLineTokenContext,isJsxExpressionContext],4),rule("SpaceBeforeCloseBraceInJsxExpression",t,20,[isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),isNonJsxSameLineTokenContext,isJsxExpressionContext],4),rule("NoSpaceAfterOpenBraceInJsxExpression",19,t,[isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),isNonJsxSameLineTokenContext,isJsxExpressionContext],16),rule("NoSpaceBeforeCloseBraceInJsxExpression",t,20,[isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),isNonJsxSameLineTokenContext,isJsxExpressionContext],16),rule("SpaceAfterSemicolonInFor",27,t,[isOptionEnabled("insertSpaceAfterSemicolonInForStatements"),isNonJsxSameLineTokenContext,isForContext],4),rule("NoSpaceAfterSemicolonInFor",27,t,[isOptionDisabledOrUndefined("insertSpaceAfterSemicolonInForStatements"),isNonJsxSameLineTokenContext,isForContext],16),rule("SpaceBeforeBinaryOperator",t,o,[isOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"),isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("SpaceAfterBinaryOperator",o,t,[isOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"),isNonJsxSameLineTokenContext,isBinaryOpContext],4),rule("NoSpaceBeforeBinaryOperator",t,o,[isOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"),isNonJsxSameLineTokenContext,isBinaryOpContext],16),rule("NoSpaceAfterBinaryOperator",o,t,[isOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"),isNonJsxSameLineTokenContext,isBinaryOpContext],16),rule("SpaceBeforeOpenParenInFuncDecl",t,21,[isOptionEnabled("insertSpaceBeforeFunctionParenthesis"),isNonJsxSameLineTokenContext,isFunctionDeclContext],4),rule("NoSpaceBeforeOpenParenInFuncDecl",t,21,[isOptionDisabledOrUndefined("insertSpaceBeforeFunctionParenthesis"),isNonJsxSameLineTokenContext,isFunctionDeclContext],16),rule("NewLineBeforeOpenBraceInControl",y,19,[isOptionEnabled("placeOpenBraceOnNewLineForControlBlocks"),isControlDeclContext,isBeforeMultilineBlockContext],8,1),rule("NewLineBeforeOpenBraceInFunction",_,19,[isOptionEnabled("placeOpenBraceOnNewLineForFunctions"),isFunctionDeclContext,isBeforeMultilineBlockContext],8,1),rule("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock",g,19,[isOptionEnabled("placeOpenBraceOnNewLineForFunctions"),isTypeScriptDeclWithBlockContext,isBeforeMultilineBlockContext],8,1),rule("SpaceAfterTypeAssertion",32,t,[isOptionEnabled("insertSpaceAfterTypeAssertion"),isNonJsxSameLineTokenContext,isTypeAssertionContext],4),rule("NoSpaceAfterTypeAssertion",32,t,[isOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"),isNonJsxSameLineTokenContext,isTypeAssertionContext],16),rule("SpaceBeforeTypeAnnotation",t,[58,59],[isOptionEnabled("insertSpaceBeforeTypeAnnotation"),isNonJsxSameLineTokenContext,isTypeAnnotationContext],4),rule("NoSpaceBeforeTypeAnnotation",t,[58,59],[isOptionDisabledOrUndefined("insertSpaceBeforeTypeAnnotation"),isNonJsxSameLineTokenContext,isTypeAnnotationContext],16),rule("NoOptionalSemicolon",27,r,[optionEquals("semicolons","remove"),isSemicolonDeletionContext],32),rule("OptionalSemicolon",t,r,[optionEquals("semicolons","insert"),isSemicolonInsertionContext],64)];const S=[rule("NoSpaceBeforeSemicolon",t,27,[isNonJsxSameLineTokenContext],16),rule("SpaceBeforeOpenBraceInControl",y,19,[isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForControlBlocks"),isControlDeclContext,isNotFormatOnEnter,isSameLineTokenOrBeforeBlockContext],4,1),rule("SpaceBeforeOpenBraceInFunction",_,19,[isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"),isFunctionDeclContext,isBeforeBlockContext,isNotFormatOnEnter,isSameLineTokenOrBeforeBlockContext],4,1),rule("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock",g,19,[isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"),isTypeScriptDeclWithBlockContext,isNotFormatOnEnter,isSameLineTokenOrBeforeBlockContext],4,1),rule("NoSpaceBeforeComma",t,28,[isNonJsxSameLineTokenContext],16),rule("NoSpaceBeforeOpenBracket",anyTokenExcept(134,84),23,[isNonJsxSameLineTokenContext],16),rule("NoSpaceAfterCloseBracket",24,t,[isNonJsxSameLineTokenContext,isNotBeforeBlockInFunctionDeclarationContext],16),rule("SpaceAfterSemicolon",27,t,[isNonJsxSameLineTokenContext],4),rule("SpaceBetweenForAndAwaitKeyword",99,135,[isNonJsxSameLineTokenContext],4),rule("SpaceBetweenDotDotDotAndTypeName",26,m,[isNonJsxSameLineTokenContext],16),rule("SpaceBetweenStatements",[22,92,93,84],t,[isNonJsxSameLineTokenContext,isNonJsxElementOrFragmentContext,isNotForContext],4),rule("SpaceAfterTryCatchFinally",[113,85,98],19,[isNonJsxSameLineTokenContext],4)];return[...h,...T,...S]}function rule(e,t,n,r,i,o=0){return{leftTokenRange:toTokenRange(t),rightTokenRange:toTokenRange(n),rule:{debugName:e,context:r,action:i,flags:o}}}function tokenRangeFrom(e){return{tokens:e,isSpecific:true}}function toTokenRange(e){return typeof e==="number"?tokenRangeFrom([e]):isArray(e)?tokenRangeFrom(e):e}function tokenRangeFromRange(e,t,n=[]){const r=[];for(let i=e;i<=t;i++){if(!contains(n,i)){r.push(i)}}return tokenRangeFrom(r)}function optionEquals(e,t){return n=>n.options&&n.options[e]===t}function isOptionEnabled(e){return t=>t.options&&hasProperty(t.options,e)&&!!t.options[e]}function isOptionDisabled(e){return t=>t.options&&hasProperty(t.options,e)&&!t.options[e]}function isOptionDisabledOrUndefined(e){return t=>!t.options||!hasProperty(t.options,e)||!t.options[e]}function isOptionDisabledOrUndefinedOrTokensOnSameLine(e){return t=>!t.options||!hasProperty(t.options,e)||!t.options[e]||t.TokensAreOnSameLine()}function isOptionEnabledOrUndefined(e){return t=>!t.options||!hasProperty(t.options,e)||!!t.options[e]}function isForContext(e){return e.contextNode.kind===248}function isNotForContext(e){return!isForContext(e)}function isBinaryOpContext(e){switch(e.contextNode.kind){case 226:return e.contextNode.operatorToken.kind!==28;case 227:case 194:case 234:case 281:case 276:case 182:case 192:case 193:case 238:return true;case 208:case 265:case 271:case 277:case 260:case 169:case 306:case 172:case 171:return e.currentTokenSpan.kind===64||e.nextTokenSpan.kind===64;case 249:case 168:return e.currentTokenSpan.kind===103||e.nextTokenSpan.kind===103||e.currentTokenSpan.kind===64||e.nextTokenSpan.kind===64;case 250:return e.currentTokenSpan.kind===165||e.nextTokenSpan.kind===165}return false}function isNotBinaryOpContext(e){return!isBinaryOpContext(e)}function isNotTypeAnnotationContext(e){return!isTypeAnnotationContext(e)}function isTypeAnnotationContext(e){const t=e.contextNode.kind;return t===172||t===171||t===169||t===260||isFunctionLikeKind(t)}function isOptionalPropertyContext(e){return isPropertyDeclaration(e.contextNode)&&e.contextNode.questionToken}function isNonOptionalPropertyContext(e){return!isOptionalPropertyContext(e)}function isConditionalOperatorContext(e){return e.contextNode.kind===227||e.contextNode.kind===194}function isSameLineTokenOrBeforeBlockContext(e){return e.TokensAreOnSameLine()||isBeforeBlockContext(e)}function isBraceWrappedContext(e){return e.contextNode.kind===206||e.contextNode.kind===200||isSingleLineBlockContext(e)}function isBeforeMultilineBlockContext(e){return isBeforeBlockContext(e)&&!(e.NextNodeAllOnSameLine()||e.NextNodeBlockIsOnOneLine())}function isMultilineBlockContext(e){return isBlockContext(e)&&!(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}function isSingleLineBlockContext(e){return isBlockContext(e)&&(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}function isBlockContext(e){return nodeIsBlockContext(e.contextNode)}function isBeforeBlockContext(e){return nodeIsBlockContext(e.nextTokenParent)}function nodeIsBlockContext(e){if(nodeIsTypeScriptDeclWithBlockContext(e)){return true}switch(e.kind){case 241:case 269:case 210:case 268:return true}return false}function isFunctionDeclContext(e){switch(e.contextNode.kind){case 262:case 174:case 173:case 177:case 178:case 179:case 218:case 176:case 219:case 264:return true}return false}function isNotFunctionDeclContext(e){return!isFunctionDeclContext(e)}function isFunctionDeclarationOrFunctionExpressionContext(e){return e.contextNode.kind===262||e.contextNode.kind===218}function isTypeScriptDeclWithBlockContext(e){return nodeIsTypeScriptDeclWithBlockContext(e.contextNode)}function nodeIsTypeScriptDeclWithBlockContext(e){switch(e.kind){case 263:case 231:case 264:case 266:case 187:case 267:case 278:case 279:case 272:case 275:return true}return false}function isAfterCodeBlockContext(e){switch(e.currentTokenParent.kind){case 263:case 267:case 266:case 299:case 268:case 255:return true;case 241:{const t=e.currentTokenParent.parent;if(!t||t.kind!==219&&t.kind!==218){return true}}}return false}function isControlDeclContext(e){switch(e.contextNode.kind){case 245:case 255:case 248:case 249:case 250:case 247:case 258:case 246:case 254:case 299:return true;default:return false}}function isObjectContext(e){return e.contextNode.kind===210}function isFunctionCallContext(e){return e.contextNode.kind===213}function isNewContext(e){return e.contextNode.kind===214}function isFunctionCallOrNewContext(e){return isFunctionCallContext(e)||isNewContext(e)}function isPreviousTokenNotComma(e){return e.currentTokenSpan.kind!==28}function isNextTokenNotCloseBracket(e){return e.nextTokenSpan.kind!==24}function isNextTokenNotCloseParen(e){return e.nextTokenSpan.kind!==22}function isArrowFunctionContext(e){return e.contextNode.kind===219}function isImportTypeContext(e){return e.contextNode.kind===205}function isNonJsxSameLineTokenContext(e){return e.TokensAreOnSameLine()&&e.contextNode.kind!==12}function isNonJsxTextContext(e){return e.contextNode.kind!==12}function isNonJsxElementOrFragmentContext(e){return e.contextNode.kind!==284&&e.contextNode.kind!==288}function isJsxExpressionContext(e){return e.contextNode.kind===294||e.contextNode.kind===293}function isNextTokenParentJsxAttribute(e){return e.nextTokenParent.kind===291||e.nextTokenParent.kind===295&&e.nextTokenParent.parent.kind===291}function isJsxAttributeContext(e){return e.contextNode.kind===291}function isNextTokenParentNotJsxNamespacedName(e){return e.nextTokenParent.kind!==295}function isNextTokenParentJsxNamespacedName(e){return e.nextTokenParent.kind===295}function isJsxSelfClosingElementContext(e){return e.contextNode.kind===285}function isNotBeforeBlockInFunctionDeclarationContext(e){return!isFunctionDeclContext(e)&&!isBeforeBlockContext(e)}function isEndOfDecoratorContextOnSameLine(e){return e.TokensAreOnSameLine()&&hasDecorators(e.contextNode)&&nodeIsInDecoratorContext(e.currentTokenParent)&&!nodeIsInDecoratorContext(e.nextTokenParent)}function nodeIsInDecoratorContext(e){while(e&&isExpression(e)){e=e.parent}return e&&e.kind===170}function isStartOfVariableDeclarationList(e){return e.currentTokenParent.kind===261&&e.currentTokenParent.getStart(e.sourceFile)===e.currentTokenSpan.pos}function isNotFormatOnEnter(e){return e.formattingRequestKind!==2}function isModuleDeclContext(e){return e.contextNode.kind===267}function isObjectTypeContext(e){return e.contextNode.kind===187}function isConstructorSignatureContext(e){return e.contextNode.kind===180}function isTypeArgumentOrParameterOrAssertion(e,t){if(e.kind!==30&&e.kind!==32){return false}switch(t.kind){case 183:case 216:case 265:case 263:case 231:case 264:case 262:case 218:case 219:case 174:case 173:case 179:case 180:case 213:case 214:case 233:return true;default:return false}}function isTypeArgumentOrParameterOrAssertionContext(e){return isTypeArgumentOrParameterOrAssertion(e.currentTokenSpan,e.currentTokenParent)||isTypeArgumentOrParameterOrAssertion(e.nextTokenSpan,e.nextTokenParent)}function isTypeAssertionContext(e){return e.contextNode.kind===216}function isNonTypeAssertionContext(e){return!isTypeAssertionContext(e)}function isVoidOpContext(e){return e.currentTokenSpan.kind===116&&e.currentTokenParent.kind===222}function isYieldOrYieldStarWithOperand(e){return e.contextNode.kind===229&&e.contextNode.expression!==void 0}function isNonNullAssertionContext(e){return e.contextNode.kind===235}function isNotStatementConditionContext(e){return!isStatementConditionContext(e)}function isStatementConditionContext(e){switch(e.contextNode.kind){case 245:case 248:case 249:case 250:case 246:case 247:return true;default:return false}}function isSemicolonDeletionContext(e){let t=e.nextTokenSpan.kind;let n=e.nextTokenSpan.pos;if(isTrivia(t)){const r=e.nextTokenParent===e.currentTokenParent?findNextToken(e.currentTokenParent,findAncestor(e.currentTokenParent,(e=>!e.parent)),e.sourceFile):e.nextTokenParent.getFirstToken(e.sourceFile);if(!r){return true}t=r.kind;n=r.getStart(e.sourceFile)}const r=e.sourceFile.getLineAndCharacterOfPosition(e.currentTokenSpan.pos).line;const i=e.sourceFile.getLineAndCharacterOfPosition(n).line;if(r===i){return t===20||t===1}if(t===27&&e.currentTokenSpan.kind===27){return true}if(t===240||t===27){return false}if(e.contextNode.kind===264||e.contextNode.kind===265){return!isPropertySignature(e.currentTokenParent)||!!e.currentTokenParent.type||t!==21}if(isPropertyDeclaration(e.currentTokenParent)){return!e.currentTokenParent.initializer}return e.currentTokenParent.kind!==248&&e.currentTokenParent.kind!==242&&e.currentTokenParent.kind!==240&&t!==23&&t!==21&&t!==40&&t!==41&&t!==44&&t!==14&&t!==28&&t!==228&&t!==16&&t!==15&&t!==25}function isSemicolonInsertionContext(e){return positionIsASICandidate(e.currentTokenSpan.end,e.currentTokenParent,e.sourceFile)}function isNotPropertyAccessOnIntegerLiteral(e){return!isPropertyAccessExpression(e.contextNode)||!isNumericLiteral(e.contextNode.expression)||e.contextNode.expression.getText().includes(".")}function getFormatContext(e,t){return{options:e,getRules:getRulesMap(),host:t}}var Nm;function getRulesMap(){if(Nm===void 0){Nm=createRulesMap(getAllRules())}return Nm}function getRuleActionExclusion(e){let t=0;if(e&1){t|=28}if(e&2){t|=96}if(e&28){t|=28}if(e&96){t|=96}return t}function createRulesMap(e){const t=buildMap(e);return e=>{const n=t[getRuleBucketIndex(e.currentTokenSpan.kind,e.nextTokenSpan.kind)];if(n){const t=[];let r=0;for(const i of n){const n=~getRuleActionExclusion(r);if(i.action&n&&every(i.context,(t=>t(e)))){t.push(i);r|=i.action}}if(t.length){return t}}}}function buildMap(e){const t=new Array(Pm*Pm);const n=new Array(t.length);for(const r of e){const e=r.leftTokenRange.isSpecific&&r.rightTokenRange.isSpecific;for(const i of r.leftTokenRange.tokens){for(const o of r.rightTokenRange.tokens){const a=getRuleBucketIndex(i,o);let s=t[a];if(s===void 0){s=t[a]=[]}addRule(s,r.rule,e,n,a)}}}return t}function getRuleBucketIndex(e,t){S.assert(e<=165&&t<=165,"Must compute formatting context from tokens");return e*Pm+t}var km=5;var Fm=31;var Pm=165+1;var Dm=(e=>{e[e["StopRulesSpecific"]=0]="StopRulesSpecific";e[e["StopRulesAny"]=km*1]="StopRulesAny";e[e["ContextRulesSpecific"]=km*2]="ContextRulesSpecific";e[e["ContextRulesAny"]=km*3]="ContextRulesAny";e[e["NoContextRulesSpecific"]=km*4]="NoContextRulesSpecific";e[e["NoContextRulesAny"]=km*5]="NoContextRulesAny";return e})(Dm||{});function addRule(e,t,n,r,i){const o=t.action&3?n?0:Dm.StopRulesAny:t.context!==bm?n?Dm.ContextRulesSpecific:Dm.ContextRulesAny:n?Dm.NoContextRulesSpecific:Dm.NoContextRulesAny;const a=r[i]||0;e.splice(getInsertionIndex(a,o),0,t);r[i]=increaseInsertionIndex(a,o)}function getInsertionIndex(e,t){let n=0;for(let r=0;r<=t;r+=km){n+=e&Fm;e>>=km}return n}function increaseInsertionIndex(e,t){const n=(e>>t&Fm)+1;S.assert((n&Fm)===n,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules.");return e&~(Fm<S.formatSyntaxKind(n)})}return r}function formatOnEnter(e,t,n){const r=t.getLineAndCharacterOfPosition(e).line;if(r===0){return[]}let i=getEndLinePosition(r,t);while(isWhiteSpaceSingleLine(t.text.charCodeAt(i))){i--}if(isLineBreak(t.text.charCodeAt(i))){i--}const o={pos:getStartPositionOfLine(r-1,t),end:i+1};return formatSpan(o,t,n,2)}function formatOnSemicolon(e,t,n){const r=findImmediatelyPrecedingTokenOfKind(e,27,t);return formatNodeLines(findOutermostNodeWithinListLevel(r),t,n,3)}function formatOnOpeningCurly(e,t,n){const r=findImmediatelyPrecedingTokenOfKind(e,19,t);if(!r){return[]}const i=r.parent;const o=findOutermostNodeWithinListLevel(i);const a={pos:getLineStartPositionForPosition(o.getStart(t),t),end:e};return formatSpan(a,t,n,4)}function formatOnClosingCurly(e,t,n){const r=findImmediatelyPrecedingTokenOfKind(e,20,t);return formatNodeLines(findOutermostNodeWithinListLevel(r),t,n,5)}function formatDocument(e,t){const n={pos:0,end:e.text.length};return formatSpan(n,e,t,0)}function formatSelection(e,t,n,r){const i={pos:getLineStartPositionForPosition(e,n),end:t};return formatSpan(i,n,r,1)}function findImmediatelyPrecedingTokenOfKind(e,t,n){const r=findPrecedingToken(e,n);return r&&r.kind===t&&e===r.getEnd()?r:void 0}function findOutermostNodeWithinListLevel(e){let t=e;while(t&&t.parent&&t.parent.end===e.end&&!isListElement(t.parent,t)){t=t.parent}return t}function isListElement(e,t){switch(e.kind){case 263:case 264:return rangeContainsRange(e.members,t);case 267:const n=e.body;return!!n&&n.kind===268&&rangeContainsRange(n.statements,t);case 307:case 241:case 268:return rangeContainsRange(e.statements,t);case 299:return rangeContainsRange(e.block.statements,t)}return false}function findEnclosingNode(e,t){return find2(t);function find2(n){const r=forEachChild(n,(n=>startEndContainsRange(n.getStart(t),n.end,e)&&n));if(r){const e=find2(r);if(e){return e}}return n}}function prepareRangeContainsErrorFunction(e,t){if(!e.length){return rangeHasNoErrors}const n=e.filter((e=>rangeOverlapsWithStartEnd(t,e.start,e.start+e.length))).sort(((e,t)=>e.start-t.start));if(!n.length){return rangeHasNoErrors}let r=0;return e=>{while(true){if(r>=n.length){return false}const t=n[r];if(e.end<=t.start){return false}if(startEndOverlapsWithStartEnd(e.pos,e.end,t.start,t.start+t.length)){return true}r++}};function rangeHasNoErrors(){return false}}function getScanStartPosition(e,t,n){const r=e.getStart(n);if(r===t.pos&&e.end===t.end){return r}const i=findPrecedingToken(t.pos,n);if(!i){return e.pos}if(i.end>=t.pos){return e.pos}return i.end}function getOwnOrInheritedDelta(e,t,n){let r=-1;let i;while(e){const o=n.getLineAndCharacterOfPosition(e.getStart(n)).line;if(r!==-1&&o!==r){break}if(wm.shouldIndentChildNode(t,e,i,n)){return t.indentSize}r=o;i=e;e=e.parent}return 0}function formatNodeGivenIndentation(e,t,n,r,i,o){const a={pos:e.pos,end:e.end};return getFormattingScanner(t.text,n,a.pos,a.end,(n=>formatSpanWorker(a,e,r,i,n,o,1,(e=>false),t)))}function formatNodeLines(e,t,n,r){if(!e){return[]}const i={pos:getLineStartPositionForPosition(e.getStart(t),t),end:e.end};return formatSpan(i,t,n,r)}function formatSpan(e,t,n,r){const i=findEnclosingNode(e,t);return getFormattingScanner(t.text,t.languageVariant,getScanStartPosition(i,e,t),e.end,(o=>formatSpanWorker(e,i,wm.getIndentationForNode(i,e,t,n.options),getOwnOrInheritedDelta(i,n.options,t),o,n,r,prepareRangeContainsErrorFunction(t.parseDiagnostics,e),t)))}function formatSpanWorker(e,t,n,r,i,{options:o,getRules:a,host:s},c,l,d){var p;const u=new Sm(d,c,o);let f;let m;let _;let g;let y;let h=-1;const T=[];i.advance();if(i.isOnToken()){const e=d.getLineAndCharacterOfPosition(t.getStart(d)).line;let i=e;if(hasDecorators(t)){i=d.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(t,d)).line}processNode(t,t,e,i,n,r)}const v=i.getCurrentLeadingTrivia();if(v){const e=wm.nodeWillIndentChild(o,t,void 0,d,false)?n+o.indentSize:n;indentTriviaItems(v,e,true,(n=>{processRange(n,d.getLineAndCharacterOfPosition(n.pos),t,t,void 0);insertIndentation(n.pos,e,false)}));if(o.trimTrailingWhitespace!==false){trimTrailingWhitespacesForRemainingRange(v)}}if(m&&i.getTokenFullStart()>=e.end){const e=i.isOnEOF()?i.readEOFTokenRange():i.isOnToken()?i.readTokenInfo(t).token:void 0;if(e&&e.pos===f){const n=((p=findPrecedingToken(e.end,d,t))==null?void 0:p.parent)||_;processPair(e,d.getLineAndCharacterOfPosition(e.pos).line,n,m,g,_,n,void 0)}}return T;function tryComputeIndentationForListItem(e,t,n,r,i){if(rangeOverlapsWithStartEnd(r,e,t)||rangeContainsStartEnd(r,e,t)){if(i!==-1){return i}}else{const t=d.getLineAndCharacterOfPosition(e).line;const r=getLineStartPositionForPosition(e,d);const i=wm.findFirstNonWhitespaceColumn(r,e,d,o);if(t!==n||e===i){const e=wm.getBaseIndentation(o);return e>i?e:i}}return-1}function computeIndentation(e,t,n,r,i,a){const s=wm.shouldIndentChildNode(o,e)?o.indentSize:0;if(a===t){return{indentation:t===y?h:i.getIndentation(),delta:Math.min(o.indentSize,i.getDelta(e)+s)}}else if(n===-1){if(e.kind===21&&t===y){return{indentation:h,delta:i.getDelta(e)}}else if(wm.childStartsOnTheSameLineWithElseInIfStatement(r,e,t,d)||wm.childIsUnindentedBranchOfConditionalExpression(r,e,t,d)||wm.argumentStartsOnSameLineAsPreviousArgument(r,e,t,d)){return{indentation:i.getIndentation(),delta:s}}else{return{indentation:i.getIndentation()+i.getDelta(e),delta:s}}}else{return{indentation:n,delta:s}}}function getFirstNonDecoratorTokenOfNode(e){if(canHaveModifiers(e)){const t=find(e.modifiers,isModifier,findIndex(e.modifiers,isDecorator));if(t)return t.kind}switch(e.kind){case 263:return 86;case 264:return 120;case 262:return 100;case 266:return 266;case 177:return 139;case 178:return 153;case 174:if(e.asteriskToken){return 42}case 172:case 169:const t=getNameOfDeclaration(e);if(t){return t.kind}}}function getDynamicIndentation(e,t,n,r){return{getIndentationForComment:(e,t,r)=>{switch(e){case 20:case 24:case 22:return n+getDelta(r)}return t!==-1?t:n},getIndentationForToken:(e,t,r,i)=>!i&&shouldAddDelta(e,t,r)?n+getDelta(r):n,getIndentation:()=>n,getDelta:getDelta,recomputeIndentation:(t,i)=>{if(wm.shouldIndentChildNode(o,i,e,d)){n+=t?o.indentSize:-o.indentSize;r=wm.shouldIndentChildNode(o,e)?o.indentSize:0}}};function shouldAddDelta(n,r,i){switch(r){case 19:case 20:case 22:case 93:case 117:case 60:return false;case 44:case 32:switch(i.kind){case 286:case 287:case 285:return false}break;case 23:case 24:if(i.kind!==200){return false}break}return t!==n&&!(hasDecorators(e)&&r===getFirstNonDecoratorTokenOfNode(e))}function getDelta(t){return wm.nodeWillIndentChild(o,e,t,d,true)?r:0}}function processNode(t,n,r,a,s,c){if(!rangeOverlapsWithStartEnd(e,t.getStart(d),t.getEnd())){return}const p=getDynamicIndentation(t,r,s,c);let u=n;forEachChild(t,(e=>{processChildNode(e,-1,t,p,r,a,false)}),(e=>{processChildNodes(e,t,r,p)}));while(i.isOnToken()&&i.getTokenFullStart()Math.min(t.end,e.end)){break}consumeTokenAndAdvanceScanner(n,t,p,t)}function processChildNode(n,r,o,a,s,c,l,p){S.assert(!nodeIsSynthesized(n));if(nodeIsMissing(n)||isGrammarError(o,n)){return r}const f=n.getStart(d);const m=d.getLineAndCharacterOfPosition(f).line;let _=m;if(hasDecorators(n)){_=d.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(n,d)).line}let g=-1;if(l&&rangeContainsRange(e,o)){g=tryComputeIndentationForListItem(f,n.end,s,e,r);if(g!==-1){r=g}}if(!rangeOverlapsWithStartEnd(e,n.pos,n.end)){if(n.ende.end){return r}if(o.token.end>f){if(o.token.pos>f){i.skipToStartOf(n)}break}consumeTokenAndAdvanceScanner(o,t,a,t)}if(!i.isOnToken()||i.getTokenFullStart()>=e.end){return r}if(isToken(n)){const e=i.readTokenInfo(n);if(n.kind!==12){S.assert(e.token.end===n.end,"Token end is child end");consumeTokenAndAdvanceScanner(e,t,a,n);return r}}const y=n.kind===170?m:c;const h=computeIndentation(n,m,g,t,a,y);processNode(n,u,m,_,h.indentation,h.delta);u=t;if(p&&o.kind===209&&r===-1){r=h.indentation}return r}function processChildNodes(n,r,a,s){S.assert(isNodeArray(n));S.assert(!nodeIsSynthesized(n));const c=getOpenTokenForList(r,n);let l=s;let p=a;if(!rangeOverlapsWithStartEnd(e,n.pos,n.end)){if(n.endn.pos){break}else if(e.token.kind===c){p=d.getLineAndCharacterOfPosition(e.token.pos).line;consumeTokenAndAdvanceScanner(e,r,s,r);let t;if(h!==-1){t=h}else{const n=getLineStartPositionForPosition(e.token.pos,d);t=wm.findFirstNonWhitespaceColumn(n,e.token.pos,d,o)}l=getDynamicIndentation(r,a,t,o.indentSize)}else{consumeTokenAndAdvanceScanner(e,r,s,r)}}}let u=-1;for(let e=0;einsertIndentation(e.pos,i,false)))}if(e!==-1&&n){insertIndentation(t.token.pos,e,p===1);y=g.line;h=e}}i.advance();u=n}}function indentTriviaItems(t,n,r,i){for(const o of t){const t=rangeContainsRange(e,o);switch(o.kind){case 3:if(t){indentMultilineComment(o,n,!r)}r=false;break;case 2:if(r&&t){i(o)}r=false;break;case 4:r=true;break}}return r}function processTrivia(t,n,r,i){for(const o of t){if(isComment(o.kind)&&rangeContainsRange(e,o)){const e=d.getLineAndCharacterOfPosition(o.pos);processRange(o,e,n,r,i)}}}function processRange(t,n,r,i,o){const a=l(t);let s=0;if(!a){if(!m){const t=d.getLineAndCharacterOfPosition(e.pos);trimTrailingWhitespacesForLines(t.line,n.line)}else{s=processPair(t,n.line,r,m,g,_,i,o)}}m=t;f=t.end;_=r;g=n.line;return s}function processPair(e,t,n,r,i,o,s,c){u.updateContext(r,o,e,n,s);const l=a(u);let p=u.options.trimTrailingWhitespace!==false;let f=0;if(l){forEachRight(l,(o=>{f=applyRuleEdits(o,r,i,e,t);if(c){switch(f){case 2:if(n.getStart(d)===e.pos){c.recomputeIndentation(false,s)}break;case 1:if(n.getStart(d)===e.pos){c.recomputeIndentation(true,s)}break;default:S.assert(f===0)}}p=p&&!(o.action&16)&&o.flags!==1}))}else{p=p&&e.kind!==1}if(t!==i&&p){trimTrailingWhitespacesForLines(i,t,r)}return f}function insertIndentation(e,t,n){const r=getIndentationString(t,o);if(n){recordReplace(e,0,r)}else{const n=d.getLineAndCharacterOfPosition(e);const i=getStartPositionOfLine(n.line,d);if(t!==characterToColumn(i,n.character)||indentationIsDifferent(r,i)){recordReplace(i,n.character,r)}}}function characterToColumn(e,t){let n=0;for(let r=0;r0){const e=getIndentationString(r,o);recordReplace(t,n.character,e)}else{recordDelete(t,n.character)}}}function trimTrailingWhitespacesForLines(e,t,n){for(let r=e;rt){continue}const i=getTrailingWhitespaceStartPosition(e,t);if(i!==-1){S.assert(i===e||!isWhiteSpaceSingleLine(d.text.charCodeAt(i-1)));recordDelete(i,t+1-i)}}}function getTrailingWhitespaceStartPosition(e,t){let n=t;while(n>=e&&isWhiteSpaceSingleLine(d.text.charCodeAt(n))){n--}if(n!==t){return n+1}return-1}function trimTrailingWhitespacesForRemainingRange(t){let n=m?m.end:e.pos;for(const e of t){if(isComment(e.kind)){if(nrangeContainsPositionExclusive(n,t)||t===n.end&&(n.kind===2||t===e.getFullWidth())))}function getOpenTokenForList(e,t){switch(e.kind){case 176:case 262:case 218:case 174:case 173:case 219:case 179:case 180:case 184:case 185:case 177:case 178:if(e.typeParameters===t){return 30}else if(e.parameters===t){return 21}break;case 213:case 214:if(e.typeArguments===t){return 30}else if(e.arguments===t){return 21}break;case 263:case 231:case 264:case 265:if(e.typeParameters===t){return 30}break;case 183:case 215:case 186:case 233:case 205:if(e.typeArguments===t){return 30}break;case 187:return 19}return 0}function getCloseTokenForOpenToken(e){switch(e){case 21:return 22;case 30:return 32;case 19:return 20}return 0}var Im;var Am;var Om;function getIndentationString(e,t){const n=!Im||(Im.tabSize!==t.tabSize||Im.indentSize!==t.indentSize);if(n){Im={tabSize:t.tabSize,indentSize:t.indentSize};Am=Om=void 0}if(!t.convertTabsToSpaces){const n=Math.floor(e/t.tabSize);const r=e-n*t.tabSize;let i;if(!Am){Am=[]}if(Am[n]===void 0){Am[n]=i=repeatString("\t",n)}else{i=Am[n]}return r?i+repeatString(" ",r):i}else{let n;const r=Math.floor(e/t.indentSize);const i=e%t.indentSize;if(!Om){Om=[]}if(Om[r]===void 0){n=repeatString(" ",t.indentSize*r);Om[r]=n}else{n=Om[r]}return i?n+repeatString(" ",i):n}}var wm;(e=>{let t;(e=>{e[e["Unknown"]=-1]="Unknown"})(t||(t={}));function getIndentation(e,t,n,r=false){if(e>t.text.length){return getBaseIndentation(n)}if(n.indentStyle===0){return 0}const i=findPrecedingToken(e,t,void 0,true);const o=getRangeOfEnclosingComment(t,e,i||null);if(o&&o.kind===3){return getCommentIndent(t,e,n,o)}if(!i){return getBaseIndentation(n)}const a=isStringOrRegularExpressionOrTemplateLiteral(i.kind);if(a&&i.getStart(t)<=e&&e=0);if(i<=o){return findFirstNonWhitespaceColumn(getStartPositionOfLine(o,e),t,e,n)}const a=getStartPositionOfLine(i,e);const{column:s,character:c}=findFirstNonWhitespaceCharacterAndColumn(a,t,e,n);if(s===0){return s}const l=e.text.charCodeAt(a+c);return l===42?s-1:s}function getBlockIndent(e,t,n){let r=t;while(r>0){const t=e.text.charCodeAt(r);if(!isWhiteSpaceLike(t)){break}r--}const i=getLineStartPositionForPosition(r,e);return findFirstNonWhitespaceColumn(i,r,e,n)}function getSmartIndent(e,t,n,r,i,o){let a;let s=n;while(s){if(positionBelongsToNode(s,t,e)&&shouldIndentChildNode(o,s,a,e,true)){const t=getStartLineAndCharacterForNode(s,e);const a=nextTokenIsCurlyBraceOnSameLineAsCursor(n,s,r,e);const c=a!==0?i&&a===2?o.indentSize:0:r!==t.line?o.indentSize:0;return getIndentationForNodeWorker(s,t,void 0,c,e,true,o)}const c=getActualIndentationForListItem(s,e,o,true);if(c!==-1){return c}a=s;s=s.parent}return getBaseIndentation(o)}function getIndentationForNode(e,t,n,r){const i=n.getLineAndCharacterOfPosition(e.getStart(n));return getIndentationForNodeWorker(e,i,t,0,n,false,r)}e.getIndentationForNode=getIndentationForNode;function getBaseIndentation(e){return e.baseIndentSize||0}e.getBaseIndentation=getBaseIndentation;function getIndentationForNodeWorker(e,t,n,r,i,o,a){var s;let c=e.parent;while(c){let l=true;if(n){const t=e.getStart(i);l=tn.end}const d=getContainingListOrParentStart(c,e,i);const p=d.line===t.line||childStartsOnTheSameLineWithElseInIfStatement(c,e,t.line,i);if(l){const n=(s=getContainingList(e,i))==null?void 0:s[0];const o=!!n&&getStartLineAndCharacterForNode(n,i).line>d.line;let l=getActualIndentationForListItem(e,i,a,o);if(l!==-1){return l+r}l=getActualIndentationForNode(e,c,t,p,i,a);if(l!==-1){return l+r}}if(shouldIndentChildNode(a,c,e,i,o)&&!p){r+=a.indentSize}const u=isArgumentAndStartLineOverlapsExpressionBeingCalled(c,e,t.line,i);e=c;c=e.parent;t=u?i.getLineAndCharacterOfPosition(e.getStart(i)):d}return r+getBaseIndentation(a)}function getContainingListOrParentStart(e,t,n){const r=getContainingList(t,n);const i=r?r.pos:e.getStart(n);return n.getLineAndCharacterOfPosition(i)}function getActualIndentationForListItemBeforeComma(e,t,n){const r=findListItemInfo(e);if(r&&r.listItemIndex>0){return deriveActualIndentationFromList(r.list.getChildren(),r.listItemIndex-1,t,n)}else{return-1}}function getActualIndentationForNode(e,t,n,r,i,o){const a=(isDeclaration(e)||isStatementButNotDeclaration(e))&&(t.kind===307||!r);if(!a){return-1}return findColumnForFirstNonWhitespaceCharacterInLine(n,i,o)}let n;(e=>{e[e["Unknown"]=0]="Unknown";e[e["OpenBrace"]=1]="OpenBrace";e[e["CloseBrace"]=2]="CloseBrace"})(n||(n={}));function nextTokenIsCurlyBraceOnSameLineAsCursor(e,t,n,r){const i=findNextToken(e,t,r);if(!i){return 0}if(i.kind===19){return 1}else if(i.kind===20){const e=getStartLineAndCharacterForNode(i,r).line;return n===e?2:0}return 0}function getStartLineAndCharacterForNode(e,t){return t.getLineAndCharacterOfPosition(e.getStart(t))}function isArgumentAndStartLineOverlapsExpressionBeingCalled(e,t,n,r){if(!(isCallExpression(e)&&contains(e.arguments,t))){return false}const i=e.expression.getEnd();const o=getLineAndCharacterOfPosition(r,i).line;return o===n}e.isArgumentAndStartLineOverlapsExpressionBeingCalled=isArgumentAndStartLineOverlapsExpressionBeingCalled;function childStartsOnTheSameLineWithElseInIfStatement(e,t,n,r){if(e.kind===245&&e.elseStatement===t){const t=findChildOfKind(e,93,r);S.assert(t!==void 0);const i=getStartLineAndCharacterForNode(t,r).line;return i===n}return false}e.childStartsOnTheSameLineWithElseInIfStatement=childStartsOnTheSameLineWithElseInIfStatement;function childIsUnindentedBranchOfConditionalExpression(e,t,n,r){if(isConditionalExpression(e)&&(t===e.whenTrue||t===e.whenFalse)){const i=getLineAndCharacterOfPosition(r,e.condition.end).line;if(t===e.whenTrue){return n===i}else{const t=getStartLineAndCharacterForNode(e.whenTrue,r).line;const o=getLineAndCharacterOfPosition(r,e.whenTrue.end).line;return i===t&&o===n}}return false}e.childIsUnindentedBranchOfConditionalExpression=childIsUnindentedBranchOfConditionalExpression;function argumentStartsOnSameLineAsPreviousArgument(e,t,n,r){if(isCallOrNewExpression(e)){if(!e.arguments)return false;const i=find(e.arguments,(e=>e.pos===t.pos));if(!i)return false;const o=e.arguments.indexOf(i);if(o===0)return false;const a=e.arguments[o-1];const s=getLineAndCharacterOfPosition(r,a.getEnd()).line;if(n===s){return true}}return false}e.argumentStartsOnSameLineAsPreviousArgument=argumentStartsOnSameLineAsPreviousArgument;function getContainingList(e,t){return e.parent&&getListByRange(e.getStart(t),e.getEnd(),e.parent,t)}e.getContainingList=getContainingList;function getListByPosition(e,t,n){return t&&getListByRange(e,e,t,n)}function getListByRange(e,t,n,r){switch(n.kind){case 183:return getList(n.typeArguments);case 210:return getList(n.properties);case 209:return getList(n.elements);case 187:return getList(n.members);case 262:case 218:case 219:case 174:case 173:case 179:case 176:case 185:case 180:return getList(n.typeParameters)||getList(n.parameters);case 177:return getList(n.parameters);case 263:case 231:case 264:case 265:case 345:return getList(n.typeParameters);case 214:case 213:return getList(n.typeArguments)||getList(n.arguments);case 261:return getList(n.declarations);case 275:case 279:return getList(n.elements);case 206:case 207:return getList(n.elements)}function getList(i){return i&&rangeContainsStartEnd(getVisualListRange(n,i,r),e,t)?i:void 0}}function getVisualListRange(e,t,n){const r=e.getChildren(n);for(let e=1;e=0&&t=0;i--){if(e[i].kind===28){continue}const t=n.getLineAndCharacterOfPosition(e[i].end).line;if(t!==o.line){return findColumnForFirstNonWhitespaceCharacterInLine(o,n,r)}o=getStartLineAndCharacterForNode(e[i],n)}return-1}function findColumnForFirstNonWhitespaceCharacterInLine(e,t,n){const r=t.getPositionOfLineAndCharacter(e.line,0);return findFirstNonWhitespaceColumn(r,r+e.character,t,n)}function findFirstNonWhitespaceCharacterAndColumn(e,t,n,r){let i=0;let o=0;for(let a=e;apreparePasteEdits});function preparePasteEdits(e,t,n){let r=false;t.forEach((t=>{const i=findAncestor(getTokenAtPosition(e,t.pos),(e=>rangeContainsRange(e,t)));if(!i)return;forEachChild(i,(function checkNameResolution(i){var o;if(r)return;if(isIdentifier(i)&&rangeContainsPosition(t,i.getStart(e))){const t=n.resolveName(i.text,i,-1,false);if(t&&t.declarations){for(const n of t.declarations){if(isInImport(n)||!!(i.text&&e.symbol&&((o=e.symbol.exports)==null?void 0:o.has(i.escapedText)))){r=true;return}}}}i.forEachChild(checkNameResolution)}));if(r)return}));return r}var Mm={};__export(Mm,{pasteEditsProvider:()=>pasteEditsProvider});var Rm="providePostPasteEdits";function pasteEditsProvider(e,t,n,r,i,o,a,s){const c=dm.ChangeTracker.with({host:i,formatContext:a,preferences:o},(c=>pasteEdits(e,t,n,r,i,o,a,s,c)));return{edits:c,fixId:Rm}}function pasteEdits(e,t,n,r,i,o,a,s,c){let l;if(t.length!==n.length){l=t.length===1?t[0]:t.join(getNewLineOrDefaultFromHost(a.host,a.options))}const d=[];let p=e.text;for(let e=n.length-1;e>=0;e--){const{pos:r,end:i}=n[e];p=l?p.slice(0,r)+l+p.slice(i):p.slice(0,r)+t[e]+p.slice(i)}let u;S.checkDefined(i.runWithTemporaryFileUpdate).call(i,e.fileName,p,((p,f,m)=>{u=id.createImportAdder(m,p,o,i);if(r==null?void 0:r.range){S.assert(r.range.length===t.length);r.range.forEach((e=>{const t=r.file.statements;const n=findIndex(t,(t=>t.end>e.pos));if(n===-1)return void 0;let i=findIndex(t,(t=>t.end>=e.end),n);if(i!==-1&&e.end<=t[i].getStart()){i--}d.push(...t.slice(n,i===-1?t.length:i+1))}));S.assertIsDefined(f,"no original program found");const n=f.getTypeChecker();const o=getUsageInfoRangeForPasteEdits(r);const a=getUsageInfo(r.file,d,n,getExistingLocals(m,d,n),o);const s=!fileShouldUseJavaScriptRequire(e.fileName,f,i,!!r.file.commonJsModuleIndicator);addExportsInOldFile(r.file,a.targetFileImportsFromOldFile,c,s);addTargetFileImports(r.file,a.oldImportsNeededByTargetFile,a.targetFileImportsFromOldFile,n,p,u)}else{const e={sourceFile:m,program:f,cancellationToken:s,host:i,preferences:o,formatContext:a};let r=0;n.forEach(((n,i)=>{const o=n.end-n.pos;const a=l??t[i];const s=n.pos+r;const c=s+a.length;const d={pos:s,end:c};r+=a.length-o;const f=findAncestor(getTokenAtPosition(e.sourceFile,d.pos),(e=>rangeContainsRange(e,d)));if(!f)return;forEachChild(f,(function importUnresolvedIdentifiers(t){const n=isIdentifier(t)&&rangeContainsPosition(d,t.getStart(m))&&!(p==null?void 0:p.getTypeChecker().resolveName(t.text,t,-1,false));if(n){return u.addImportForUnresolvedIdentifier(e,t,true)}t.forEachChild(importUnresolvedIdentifiers)}))}))}u.writeFixes(c,getQuotePreference(r?r.file:e,o))}));if(!u.hasFixes()){return}n.forEach(((n,r)=>{c.replaceRangeWithText(e,{pos:n.pos,end:n.end},l??t[r])}))}function getUsageInfoRangeForPasteEdits({file:e,range:t}){const n=t[0].pos;const r=t[t.length-1].end;const i=getTokenAtPosition(e,n);const o=findTokenOnLeftOfPosition(e,n)??getTokenAtPosition(e,r);return{pos:isIdentifier(i)&&n<=i.getStart(e)?i.getFullStart():n,end:isIdentifier(o)&&r===o.getEnd()?dm.getAdjustedEndPosition(e,o,{}):r}}var Bm={};__export(Bm,{ANONYMOUS:()=>ec,AccessFlags:()=>Oe,AssertionLevel:()=>_,AssignmentDeclarationKind:()=>ze,AssignmentKind:()=>Sn,Associativity:()=>xn,BreakpointResolver:()=>ed,BuilderFileEmit:()=>Xa,BuilderProgramKind:()=>Ya,BuilderState:()=>Qa,CallHierarchy:()=>td,CharacterCodes:()=>it,CheckFlags:()=>Ne,CheckMode:()=>ia,ClassificationType:()=>Hs,ClassificationTypeNames:()=>qs,CommentDirectiveType:()=>se,Comparison:()=>l,CompletionInfoFlags:()=>Bs,CompletionTriggerKind:()=>Is,Completions:()=>xf,ContainerFlags:()=>Vo,ContextFlags:()=>ye,Debug:()=>S,DiagnosticCategory:()=>Ve,Diagnostics:()=>wt,DocumentHighlights:()=>oc,ElementFlags:()=>Ae,EmitFlags:()=>ct,EmitHint:()=>ut,EmitOnly:()=>pe,EndOfLineState:()=>Ws,ExitStatus:()=>fe,ExportKind:()=>rc,Extension:()=>ot,ExternalEmitHelpers:()=>pt,FileIncludeKind:()=>le,FilePreprocessingDiagnosticsKind:()=>de,FileSystemEntryKind:()=>kt,FileWatcherEventKind:()=>Tt,FindAllReferences:()=>Rf,FlattenLevel:()=>Ta,FlowFlags:()=>ae,ForegroundColorEscapeSequences:()=>Ma,FunctionFlags:()=>vn,GeneratedIdentifierFlags:()=>re,GetLiteralTextFlags:()=>fn,GoToDefinition:()=>Vf,HighlightSpanKind:()=>Os,IdentifierNameMap:()=>ya,ImportKind:()=>nc,ImportsNotUsedAsValues:()=>Ye,IndentStyle:()=>ws,IndexFlags:()=>we,IndexKind:()=>Be,InferenceFlags:()=>We,InferencePriority:()=>Je,InlayHintKind:()=>As,InlayHints:()=>Hf,InternalEmitFlags:()=>lt,InternalNodeBuilderFlags:()=>Te,InternalSymbolName:()=>ke,IntersectionFlags:()=>ge,InvalidatedProjectKind:()=>os,JSDocParsingMode:()=>ht,JsDoc:()=>Gf,JsTyping:()=>ps,JsxEmit:()=>Xe,JsxFlags:()=>ee,JsxReferenceKind:()=>Le,LanguageFeatureMinimumTarget:()=>dt,LanguageServiceMode:()=>ks,LanguageVariant:()=>nt,LexicalEnvironmentFlags:()=>mt,ListFormat:()=>_t,LogLevel:()=>T,MapCode:()=>Yf,MemberOverrideStatus:()=>me,ModifierFlags:()=>Z,ModuleDetectionKind:()=>He,ModuleInstanceState:()=>zo,ModuleKind:()=>Qe,ModuleResolutionKind:()=>qe,ModuleSpecifierEnding:()=>Er,NavigateTo:()=>mc,NavigationBar:()=>_c,NewLineKind:()=>Ze,NodeBuilderFlags:()=>he,NodeCheckFlags:()=>Fe,NodeFactoryFlags:()=>Rr,NodeFlags:()=>Y,NodeResolutionFeatures:()=>Jo,ObjectFlags:()=>De,OperationCanceledException:()=>ce,OperatorPrecedence:()=>bn,OrganizeImports:()=>Zf,OrganizeImportsMode:()=>Ds,OuterExpressionKinds:()=>ft,OutliningElementsCollector:()=>em,OutliningSpanKind:()=>js,OutputFileType:()=>Js,PackageJsonAutoImportPreference:()=>Ns,PackageJsonDependencyGroup:()=>Es,PatternMatchKind:()=>ac,PollingInterval:()=>St,PollingWatchKind:()=>$e,PragmaKindFlags:()=>gt,PredicateSemantics:()=>ne,PreparePasteEdits:()=>Lm,PrivateIdentifierKind:()=>qr,ProcessLevel:()=>Sa,ProgramUpdateLevel:()=>wa,QuotePreference:()=>Xs,RegularExpressionFlags:()=>ie,RelationComparisonResult:()=>te,Rename:()=>nm,ScriptElementKind:()=>zs,ScriptElementKindModifier:()=>Vs,ScriptKind:()=>et,ScriptSnapshot:()=>Cs,ScriptTarget:()=>tt,SemanticClassificationFormat:()=>Ps,SemanticMeaning:()=>Ks,SemicolonPreference:()=>Ls,SignatureCheckMode:()=>oa,SignatureFlags:()=>Re,SignatureHelp:()=>rm,SignatureInfo:()=>$a,SignatureKind:()=>Me,SmartSelectionRange:()=>am,SnippetKind:()=>st,StatisticType:()=>as,StructureIsReused:()=>ue,SymbolAccessibility:()=>xe,SymbolDisplay:()=>cm,SymbolDisplayPartKind:()=>Rs,SymbolFlags:()=>Ee,SymbolFormatFlags:()=>ve,SyntaxKind:()=>X,Ternary:()=>Ue,ThrottledCancellationToken:()=>Xl,TokenClass:()=>Us,TokenFlags:()=>oe,TransformFlags:()=>at,TypeFacts:()=>na,TypeFlags:()=>Pe,TypeFormatFlags:()=>Se,TypeMapKind:()=>je,TypePredicateKind:()=>be,TypeReferenceSerializationKind:()=>Ce,UnionReduction:()=>_e,UpToDateStatusType:()=>rs,VarianceFlags:()=>Ie,Version:()=>F,VersionRange:()=>P,WatchDirectoryFlags:()=>rt,WatchDirectoryKind:()=>Ke,WatchFileKind:()=>Ge,WatchLogLevel:()=>La,WatchType:()=>ns,accessPrivateIdentifier:()=>accessPrivateIdentifier,addEmitFlags:()=>addEmitFlags,addEmitHelper:()=>addEmitHelper,addEmitHelpers:()=>addEmitHelpers,addInternalEmitFlags:()=>addInternalEmitFlags,addNodeFactoryPatcher:()=>addNodeFactoryPatcher,addObjectAllocatorPatcher:()=>addObjectAllocatorPatcher,addRange:()=>addRange,addRelatedInfo:()=>addRelatedInfo,addSyntheticLeadingComment:()=>addSyntheticLeadingComment,addSyntheticTrailingComment:()=>addSyntheticTrailingComment,addToSeen:()=>addToSeen,advancedAsyncSuperHelper:()=>Ci,affectsDeclarationPathOptionDeclarations:()=>ro,affectsEmitOptionDeclarations:()=>no,allKeysStartWithDot:()=>allKeysStartWithDot,altDirectorySeparator:()=>Dt,and:()=>and,append:()=>append,appendIfUnique:()=>appendIfUnique,arrayFrom:()=>arrayFrom,arrayIsEqualTo:()=>arrayIsEqualTo,arrayIsHomogeneous:()=>arrayIsHomogeneous,arrayOf:()=>arrayOf,arrayReverseIterator:()=>arrayReverseIterator,arrayToMap:()=>arrayToMap,arrayToMultiMap:()=>arrayToMultiMap,arrayToNumericMap:()=>arrayToNumericMap,assertType:()=>assertType,assign:()=>assign,asyncSuperHelper:()=>bi,attachFileToDiagnostics:()=>attachFileToDiagnostics,base64decode:()=>base64decode,base64encode:()=>base64encode,binarySearch:()=>binarySearch,binarySearchKey:()=>binarySearchKey,bindSourceFile:()=>bindSourceFile,breakIntoCharacterSpans:()=>breakIntoCharacterSpans,breakIntoWordSpans:()=>breakIntoWordSpans,buildLinkParts:()=>buildLinkParts,buildOpts:()=>mo,buildOverload:()=>buildOverload,bundlerModuleNameResolver:()=>bundlerModuleNameResolver,canBeConvertedToAsync:()=>canBeConvertedToAsync,canHaveDecorators:()=>canHaveDecorators,canHaveExportModifier:()=>canHaveExportModifier,canHaveFlowNode:()=>canHaveFlowNode,canHaveIllegalDecorators:()=>canHaveIllegalDecorators,canHaveIllegalModifiers:()=>canHaveIllegalModifiers,canHaveIllegalType:()=>canHaveIllegalType,canHaveIllegalTypeParameters:()=>canHaveIllegalTypeParameters,canHaveJSDoc:()=>canHaveJSDoc,canHaveLocals:()=>canHaveLocals,canHaveModifiers:()=>canHaveModifiers,canHaveModuleSpecifier:()=>canHaveModuleSpecifier,canHaveSymbol:()=>canHaveSymbol,canIncludeBindAndCheckDiagnostics:()=>canIncludeBindAndCheckDiagnostics,canJsonReportNoInputFiles:()=>canJsonReportNoInputFiles,canProduceDiagnostics:()=>canProduceDiagnostics,canUsePropertyAccess:()=>canUsePropertyAccess,canWatchAffectingLocation:()=>canWatchAffectingLocation,canWatchAtTypes:()=>canWatchAtTypes,canWatchDirectoryOrFile:()=>canWatchDirectoryOrFile,canWatchDirectoryOrFilePath:()=>canWatchDirectoryOrFilePath,cartesianProduct:()=>cartesianProduct,cast:()=>cast,chainBundle:()=>chainBundle,chainDiagnosticMessages:()=>chainDiagnosticMessages,changeAnyExtension:()=>changeAnyExtension,changeCompilerHostLikeToUseCache:()=>changeCompilerHostLikeToUseCache,changeExtension:()=>changeExtension,changeFullExtension:()=>changeFullExtension,changesAffectModuleResolution:()=>changesAffectModuleResolution,changesAffectingProgramStructure:()=>changesAffectingProgramStructure,characterCodeToRegularExpressionFlag:()=>characterCodeToRegularExpressionFlag,childIsDecorated:()=>childIsDecorated,classElementOrClassElementParameterIsDecorated:()=>classElementOrClassElementParameterIsDecorated,classHasClassThisAssignment:()=>classHasClassThisAssignment,classHasDeclaredOrExplicitlyAssignedName:()=>classHasDeclaredOrExplicitlyAssignedName,classHasExplicitlyAssignedName:()=>classHasExplicitlyAssignedName,classOrConstructorParameterIsDecorated:()=>classOrConstructorParameterIsDecorated,classicNameResolver:()=>classicNameResolver,classifier:()=>nd,cleanExtendedConfigCache:()=>cleanExtendedConfigCache,clear:()=>clear,clearMap:()=>clearMap,clearSharedExtendedConfigFileWatcher:()=>clearSharedExtendedConfigFileWatcher,climbPastPropertyAccess:()=>climbPastPropertyAccess,clone:()=>clone,cloneCompilerOptions:()=>cloneCompilerOptions,closeFileWatcher:()=>closeFileWatcher,closeFileWatcherOf:()=>closeFileWatcherOf,codefix:()=>id,collapseTextChangeRangesAcrossMultipleVersions:()=>collapseTextChangeRangesAcrossMultipleVersions,collectExternalModuleInfo:()=>collectExternalModuleInfo,combine:()=>combine,combinePaths:()=>combinePaths,commandLineOptionOfCustomType:()=>po,commentPragmas:()=>yt,commonOptionsWithBuild:()=>Qi,compact:()=>compact,compareBooleans:()=>compareBooleans,compareDataObjects:()=>compareDataObjects,compareDiagnostics:()=>compareDiagnostics,compareEmitHelpers:()=>compareEmitHelpers,compareNumberOfDirectorySeparators:()=>compareNumberOfDirectorySeparators,comparePaths:()=>comparePaths,comparePathsCaseInsensitive:()=>comparePathsCaseInsensitive,comparePathsCaseSensitive:()=>comparePathsCaseSensitive,comparePatternKeys:()=>comparePatternKeys,compareProperties:()=>compareProperties,compareStringsCaseInsensitive:()=>compareStringsCaseInsensitive,compareStringsCaseInsensitiveEslintCompatible:()=>compareStringsCaseInsensitiveEslintCompatible,compareStringsCaseSensitive:()=>compareStringsCaseSensitive,compareStringsCaseSensitiveUI:()=>compareStringsCaseSensitiveUI,compareTextSpans:()=>compareTextSpans,compareValues:()=>compareValues,compilerOptionsAffectDeclarationPath:()=>compilerOptionsAffectDeclarationPath,compilerOptionsAffectEmit:()=>compilerOptionsAffectEmit,compilerOptionsAffectSemanticDiagnostics:()=>compilerOptionsAffectSemanticDiagnostics,compilerOptionsDidYouMeanDiagnostics:()=>To,compilerOptionsIndicateEsModules:()=>compilerOptionsIndicateEsModules,computeCommonSourceDirectoryOfFilenames:()=>computeCommonSourceDirectoryOfFilenames,computeLineAndCharacterOfPosition:()=>computeLineAndCharacterOfPosition,computeLineOfPosition:()=>computeLineOfPosition,computeLineStarts:()=>computeLineStarts,computePositionOfLineAndCharacter:()=>computePositionOfLineAndCharacter,computeSignatureWithDiagnostics:()=>computeSignatureWithDiagnostics,computeSuggestionDiagnostics:()=>computeSuggestionDiagnostics,computedOptions:()=>Wn,concatenate:()=>concatenate,concatenateDiagnosticMessageChains:()=>concatenateDiagnosticMessageChains,consumesNodeCoreModules:()=>consumesNodeCoreModules,contains:()=>contains,containsIgnoredPath:()=>containsIgnoredPath,containsObjectRestOrSpread:()=>containsObjectRestOrSpread,containsParseError:()=>containsParseError,containsPath:()=>containsPath,convertCompilerOptionsForTelemetry:()=>convertCompilerOptionsForTelemetry,convertCompilerOptionsFromJson:()=>convertCompilerOptionsFromJson,convertJsonOption:()=>convertJsonOption,convertToBase64:()=>convertToBase64,convertToJson:()=>convertToJson,convertToObject:()=>convertToObject,convertToOptionsWithAbsolutePaths:()=>convertToOptionsWithAbsolutePaths,convertToRelativePath:()=>convertToRelativePath,convertToTSConfig:()=>convertToTSConfig,convertTypeAcquisitionFromJson:()=>convertTypeAcquisitionFromJson,copyComments:()=>copyComments,copyEntries:()=>copyEntries,copyLeadingComments:()=>copyLeadingComments,copyProperties:()=>copyProperties,copyTrailingAsLeadingComments:()=>copyTrailingAsLeadingComments,copyTrailingComments:()=>copyTrailingComments,couldStartTrivia:()=>couldStartTrivia,countWhere:()=>countWhere,createAbstractBuilder:()=>createAbstractBuilder,createAccessorPropertyBackingField:()=>createAccessorPropertyBackingField,createAccessorPropertyGetRedirector:()=>createAccessorPropertyGetRedirector,createAccessorPropertySetRedirector:()=>createAccessorPropertySetRedirector,createBaseNodeFactory:()=>createBaseNodeFactory,createBinaryExpressionTrampoline:()=>createBinaryExpressionTrampoline,createBuilderProgram:()=>createBuilderProgram,createBuilderProgramUsingIncrementalBuildInfo:()=>createBuilderProgramUsingIncrementalBuildInfo,createBuilderStatusReporter:()=>createBuilderStatusReporter,createCacheableExportInfoMap:()=>createCacheableExportInfoMap,createCachedDirectoryStructureHost:()=>createCachedDirectoryStructureHost,createClassifier:()=>createClassifier,createCommentDirectivesMap:()=>createCommentDirectivesMap,createCompilerDiagnostic:()=>createCompilerDiagnostic,createCompilerDiagnosticForInvalidCustomType:()=>createCompilerDiagnosticForInvalidCustomType,createCompilerDiagnosticFromMessageChain:()=>createCompilerDiagnosticFromMessageChain,createCompilerHost:()=>createCompilerHost,createCompilerHostFromProgramHost:()=>createCompilerHostFromProgramHost,createCompilerHostWorker:()=>createCompilerHostWorker,createDetachedDiagnostic:()=>createDetachedDiagnostic,createDiagnosticCollection:()=>createDiagnosticCollection,createDiagnosticForFileFromMessageChain:()=>createDiagnosticForFileFromMessageChain,createDiagnosticForNode:()=>createDiagnosticForNode,createDiagnosticForNodeArray:()=>createDiagnosticForNodeArray,createDiagnosticForNodeArrayFromMessageChain:()=>createDiagnosticForNodeArrayFromMessageChain,createDiagnosticForNodeFromMessageChain:()=>createDiagnosticForNodeFromMessageChain,createDiagnosticForNodeInSourceFile:()=>createDiagnosticForNodeInSourceFile,createDiagnosticForRange:()=>createDiagnosticForRange,createDiagnosticMessageChainFromDiagnostic:()=>createDiagnosticMessageChainFromDiagnostic,createDiagnosticReporter:()=>createDiagnosticReporter,createDocumentPositionMapper:()=>createDocumentPositionMapper,createDocumentRegistry:()=>createDocumentRegistry,createDocumentRegistryInternal:()=>createDocumentRegistryInternal,createEmitAndSemanticDiagnosticsBuilderProgram:()=>createEmitAndSemanticDiagnosticsBuilderProgram,createEmitHelperFactory:()=>createEmitHelperFactory,createEmptyExports:()=>createEmptyExports,createEvaluator:()=>createEvaluator,createExpressionForJsxElement:()=>createExpressionForJsxElement,createExpressionForJsxFragment:()=>createExpressionForJsxFragment,createExpressionForObjectLiteralElementLike:()=>createExpressionForObjectLiteralElementLike,createExpressionForPropertyName:()=>createExpressionForPropertyName,createExpressionFromEntityName:()=>createExpressionFromEntityName,createExternalHelpersImportDeclarationIfNeeded:()=>createExternalHelpersImportDeclarationIfNeeded,createFileDiagnostic:()=>createFileDiagnostic,createFileDiagnosticFromMessageChain:()=>createFileDiagnosticFromMessageChain,createFlowNode:()=>createFlowNode,createForOfBindingStatement:()=>createForOfBindingStatement,createFutureSourceFile:()=>createFutureSourceFile,createGetCanonicalFileName:()=>createGetCanonicalFileName,createGetIsolatedDeclarationErrors:()=>createGetIsolatedDeclarationErrors,createGetSourceFile:()=>createGetSourceFile,createGetSymbolAccessibilityDiagnosticForNode:()=>createGetSymbolAccessibilityDiagnosticForNode,createGetSymbolAccessibilityDiagnosticForNodeName:()=>createGetSymbolAccessibilityDiagnosticForNodeName,createGetSymbolWalker:()=>createGetSymbolWalker,createIncrementalCompilerHost:()=>createIncrementalCompilerHost,createIncrementalProgram:()=>createIncrementalProgram,createJsxFactoryExpression:()=>createJsxFactoryExpression,createLanguageService:()=>createLanguageService,createLanguageServiceSourceFile:()=>createLanguageServiceSourceFile,createMemberAccessForPropertyName:()=>createMemberAccessForPropertyName,createModeAwareCache:()=>createModeAwareCache,createModeAwareCacheKey:()=>createModeAwareCacheKey,createModeMismatchDetails:()=>createModeMismatchDetails,createModuleNotFoundChain:()=>createModuleNotFoundChain,createModuleResolutionCache:()=>createModuleResolutionCache,createModuleResolutionLoader:()=>createModuleResolutionLoader,createModuleResolutionLoaderUsingGlobalCache:()=>createModuleResolutionLoaderUsingGlobalCache,createModuleSpecifierResolutionHost:()=>createModuleSpecifierResolutionHost,createMultiMap:()=>createMultiMap,createNameResolver:()=>createNameResolver,createNodeConverters:()=>createNodeConverters,createNodeFactory:()=>createNodeFactory,createOptionNameMap:()=>createOptionNameMap,createOverload:()=>createOverload,createPackageJsonImportFilter:()=>createPackageJsonImportFilter,createPackageJsonInfo:()=>createPackageJsonInfo,createParenthesizerRules:()=>createParenthesizerRules,createPatternMatcher:()=>createPatternMatcher,createPrinter:()=>createPrinter,createPrinterWithDefaults:()=>Da,createPrinterWithRemoveComments:()=>Ia,createPrinterWithRemoveCommentsNeverAsciiEscape:()=>Aa,createPrinterWithRemoveCommentsOmitTrailingSemicolon:()=>Oa,createProgram:()=>createProgram,createProgramDiagnostics:()=>createProgramDiagnostics,createProgramHost:()=>createProgramHost,createPropertyNameNodeForIdentifierOrLiteral:()=>createPropertyNameNodeForIdentifierOrLiteral,createQueue:()=>createQueue,createRange:()=>createRange,createRedirectedBuilderProgram:()=>createRedirectedBuilderProgram,createResolutionCache:()=>createResolutionCache,createRuntimeTypeSerializer:()=>createRuntimeTypeSerializer,createScanner:()=>createScanner,createSemanticDiagnosticsBuilderProgram:()=>createSemanticDiagnosticsBuilderProgram,createSet:()=>createSet,createSolutionBuilder:()=>createSolutionBuilder,createSolutionBuilderHost:()=>createSolutionBuilderHost,createSolutionBuilderWithWatch:()=>createSolutionBuilderWithWatch,createSolutionBuilderWithWatchHost:()=>createSolutionBuilderWithWatchHost,createSortedArray:()=>createSortedArray,createSourceFile:()=>createSourceFile,createSourceMapGenerator:()=>createSourceMapGenerator,createSourceMapSource:()=>createSourceMapSource,createSuperAccessVariableStatement:()=>createSuperAccessVariableStatement,createSymbolTable:()=>createSymbolTable,createSymlinkCache:()=>createSymlinkCache,createSyntacticTypeNodeBuilder:()=>createSyntacticTypeNodeBuilder,createSystemWatchFunctions:()=>createSystemWatchFunctions,createTextChange:()=>createTextChange,createTextChangeFromStartLength:()=>createTextChangeFromStartLength,createTextChangeRange:()=>createTextChangeRange,createTextRangeFromNode:()=>createTextRangeFromNode,createTextRangeFromSpan:()=>createTextRangeFromSpan,createTextSpan:()=>createTextSpan,createTextSpanFromBounds:()=>createTextSpanFromBounds,createTextSpanFromNode:()=>createTextSpanFromNode,createTextSpanFromRange:()=>createTextSpanFromRange,createTextSpanFromStringLiteralLikeContent:()=>createTextSpanFromStringLiteralLikeContent,createTextWriter:()=>createTextWriter,createTokenRange:()=>createTokenRange,createTypeChecker:()=>createTypeChecker,createTypeReferenceDirectiveResolutionCache:()=>createTypeReferenceDirectiveResolutionCache,createTypeReferenceResolutionLoader:()=>createTypeReferenceResolutionLoader,createWatchCompilerHost:()=>createWatchCompilerHost2,createWatchCompilerHostOfConfigFile:()=>createWatchCompilerHostOfConfigFile,createWatchCompilerHostOfFilesAndCompilerOptions:()=>createWatchCompilerHostOfFilesAndCompilerOptions,createWatchFactory:()=>createWatchFactory,createWatchHost:()=>createWatchHost,createWatchProgram:()=>createWatchProgram,createWatchStatusReporter:()=>createWatchStatusReporter,createWriteFileMeasuringIO:()=>createWriteFileMeasuringIO,declarationNameToString:()=>declarationNameToString,decodeMappings:()=>decodeMappings,decodedTextSpanIntersectsWith:()=>decodedTextSpanIntersectsWith,deduplicate:()=>deduplicate,defaultInitCompilerOptions:()=>ho,defaultMaximumTruncationLength:()=>ln,diagnosticCategoryName:()=>diagnosticCategoryName,diagnosticToString:()=>diagnosticToString,diagnosticsEqualityComparer:()=>diagnosticsEqualityComparer,directoryProbablyExists:()=>directoryProbablyExists,directorySeparator:()=>Pt,displayPart:()=>displayPart,displayPartsToString:()=>displayPartsToString,disposeEmitNodes:()=>disposeEmitNodes,documentSpansEqual:()=>documentSpansEqual,dumpTracingLegend:()=>Q,elementAt:()=>u,elideNodes:()=>elideNodes,emitDetachedComments:()=>emitDetachedComments,emitFiles:()=>emitFiles,emitFilesAndReportErrors:()=>emitFilesAndReportErrors,emitFilesAndReportErrorsAndGetExitStatus:()=>emitFilesAndReportErrorsAndGetExitStatus,emitModuleKindIsNonNodeESM:()=>emitModuleKindIsNonNodeESM,emitNewLineBeforeLeadingCommentOfPosition:()=>emitNewLineBeforeLeadingCommentOfPosition,emitResolverSkipsTypeChecking:()=>emitResolverSkipsTypeChecking,emitSkippedWithNoDiagnostics:()=>Ka,emptyArray:()=>d,emptyFileSystemEntries:()=>Fr,emptyMap:()=>p,emptyOptions:()=>Fs,endsWith:()=>endsWith,ensurePathIsNonModuleName:()=>ensurePathIsNonModuleName,ensureScriptKind:()=>ensureScriptKind,ensureTrailingDirectorySeparator:()=>ensureTrailingDirectorySeparator,entityNameToString:()=>entityNameToString,enumerateInsertsAndDeletes:()=>enumerateInsertsAndDeletes,equalOwnProperties:()=>equalOwnProperties,equateStringsCaseInsensitive:()=>equateStringsCaseInsensitive,equateStringsCaseSensitive:()=>equateStringsCaseSensitive,equateValues:()=>equateValues,escapeJsxAttributeString:()=>escapeJsxAttributeString,escapeLeadingUnderscores:()=>escapeLeadingUnderscores,escapeNonAsciiString:()=>escapeNonAsciiString,escapeSnippetText:()=>escapeSnippetText,escapeString:()=>escapeString,escapeTemplateSubstitution:()=>escapeTemplateSubstitution,evaluatorResult:()=>evaluatorResult,every:()=>every,exclusivelyPrefixedNodeCoreModules:()=>Ar,executeCommandLine:()=>executeCommandLine,expandPreOrPostfixIncrementOrDecrementExpression:()=>expandPreOrPostfixIncrementOrDecrementExpression,explainFiles:()=>explainFiles,explainIfFileIsRedirectAndImpliedFormat:()=>explainIfFileIsRedirectAndImpliedFormat,exportAssignmentIsAlias:()=>exportAssignmentIsAlias,expressionResultIsUnused:()=>expressionResultIsUnused,extend:()=>extend,extensionFromPath:()=>extensionFromPath,extensionIsTS:()=>extensionIsTS,extensionsNotSupportingExtensionlessResolution:()=>Cr,externalHelpersModuleNameText:()=>cn,factory:()=>zr,fileExtensionIs:()=>fileExtensionIs,fileExtensionIsOneOf:()=>fileExtensionIsOneOf,fileIncludeReasonToDiagnostics:()=>fileIncludeReasonToDiagnostics,fileShouldUseJavaScriptRequire:()=>fileShouldUseJavaScriptRequire,filter:()=>filter,filterMutate:()=>filterMutate,filterSemanticDiagnostics:()=>filterSemanticDiagnostics,find:()=>find,findAncestor:()=>findAncestor,findBestPatternMatch:()=>findBestPatternMatch,findChildOfKind:()=>findChildOfKind,findComputedPropertyNameCacheAssignment:()=>findComputedPropertyNameCacheAssignment,findConfigFile:()=>findConfigFile,findConstructorDeclaration:()=>findConstructorDeclaration,findContainingList:()=>findContainingList,findDiagnosticForNode:()=>findDiagnosticForNode,findFirstNonJsxWhitespaceToken:()=>findFirstNonJsxWhitespaceToken,findIndex:()=>findIndex,findLast:()=>findLast,findLastIndex:()=>findLastIndex,findListItemInfo:()=>findListItemInfo,findModifier:()=>findModifier,findNextToken:()=>findNextToken,findPackageJson:()=>findPackageJson,findPackageJsons:()=>findPackageJsons,findPrecedingMatchingToken:()=>findPrecedingMatchingToken,findPrecedingToken:()=>findPrecedingToken,findSuperStatementIndexPath:()=>findSuperStatementIndexPath,findTokenOnLeftOfPosition:()=>findTokenOnLeftOfPosition,findUseStrictPrologue:()=>findUseStrictPrologue,first:()=>first,firstDefined:()=>firstDefined,firstDefinedIterator:()=>firstDefinedIterator,firstIterator:()=>firstIterator,firstOrOnly:()=>firstOrOnly,firstOrUndefined:()=>firstOrUndefined,firstOrUndefinedIterator:()=>firstOrUndefinedIterator,fixupCompilerOptions:()=>fixupCompilerOptions,flatMap:()=>flatMap,flatMapIterator:()=>flatMapIterator,flatMapToMutable:()=>flatMapToMutable,flatten:()=>flatten,flattenCommaList:()=>flattenCommaList,flattenDestructuringAssignment:()=>flattenDestructuringAssignment,flattenDestructuringBinding:()=>flattenDestructuringBinding,flattenDiagnosticMessageText:()=>flattenDiagnosticMessageText,forEach:()=>forEach,forEachAncestor:()=>forEachAncestor,forEachAncestorDirectory:()=>forEachAncestorDirectory,forEachAncestorDirectoryStoppingAtGlobalCache:()=>forEachAncestorDirectoryStoppingAtGlobalCache,forEachChild:()=>forEachChild,forEachChildRecursively:()=>forEachChildRecursively,forEachDynamicImportOrRequireCall:()=>forEachDynamicImportOrRequireCall,forEachEmittedFile:()=>forEachEmittedFile,forEachEnclosingBlockScopeContainer:()=>forEachEnclosingBlockScopeContainer,forEachEntry:()=>forEachEntry,forEachExternalModuleToImportFrom:()=>forEachExternalModuleToImportFrom,forEachImportClauseDeclaration:()=>forEachImportClauseDeclaration,forEachKey:()=>forEachKey,forEachLeadingCommentRange:()=>forEachLeadingCommentRange,forEachNameInAccessChainWalkingLeft:()=>forEachNameInAccessChainWalkingLeft,forEachNameOfDefaultExport:()=>forEachNameOfDefaultExport,forEachOptionsSyntaxByName:()=>forEachOptionsSyntaxByName,forEachProjectReference:()=>forEachProjectReference,forEachPropertyAssignment:()=>forEachPropertyAssignment,forEachResolvedProjectReference:()=>forEachResolvedProjectReference,forEachReturnStatement:()=>forEachReturnStatement,forEachRight:()=>forEachRight,forEachTrailingCommentRange:()=>forEachTrailingCommentRange,forEachTsConfigPropArray:()=>forEachTsConfigPropArray,forEachUnique:()=>forEachUnique,forEachYieldExpression:()=>forEachYieldExpression,formatColorAndReset:()=>formatColorAndReset,formatDiagnostic:()=>formatDiagnostic,formatDiagnostics:()=>formatDiagnostics,formatDiagnosticsWithColorAndContext:()=>formatDiagnosticsWithColorAndContext,formatGeneratedName:()=>formatGeneratedName,formatGeneratedNamePart:()=>formatGeneratedNamePart,formatLocation:()=>formatLocation,formatMessage:()=>formatMessage,formatStringFromArgs:()=>formatStringFromArgs,formatting:()=>hm,generateDjb2Hash:()=>generateDjb2Hash,generateTSConfig:()=>generateTSConfig,getAdjustedReferenceLocation:()=>getAdjustedReferenceLocation,getAdjustedRenameLocation:()=>getAdjustedRenameLocation,getAliasDeclarationFromName:()=>getAliasDeclarationFromName,getAllAccessorDeclarations:()=>getAllAccessorDeclarations,getAllDecoratorsOfClass:()=>getAllDecoratorsOfClass,getAllDecoratorsOfClassElement:()=>getAllDecoratorsOfClassElement,getAllJSDocTags:()=>getAllJSDocTags,getAllJSDocTagsOfKind:()=>getAllJSDocTagsOfKind,getAllKeys:()=>getAllKeys,getAllProjectOutputs:()=>getAllProjectOutputs,getAllSuperTypeNodes:()=>getAllSuperTypeNodes,getAllowImportingTsExtensions:()=>Un,getAllowJSCompilerOption:()=>rr,getAllowSyntheticDefaultImports:()=>$n,getAncestor:()=>getAncestor,getAnyExtensionFromPath:()=>getAnyExtensionFromPath,getAreDeclarationMapsEnabled:()=>nr,getAssignedExpandoInitializer:()=>getAssignedExpandoInitializer,getAssignedName:()=>getAssignedName,getAssignmentDeclarationKind:()=>getAssignmentDeclarationKind,getAssignmentDeclarationPropertyAccessKind:()=>getAssignmentDeclarationPropertyAccessKind,getAssignmentTargetKind:()=>getAssignmentTargetKind,getAutomaticTypeDirectiveNames:()=>getAutomaticTypeDirectiveNames,getBaseFileName:()=>getBaseFileName,getBinaryOperatorPrecedence:()=>getBinaryOperatorPrecedence,getBuildInfo:()=>getBuildInfo,getBuildInfoFileVersionMap:()=>getBuildInfoFileVersionMap,getBuildInfoText:()=>getBuildInfoText,getBuildOrderFromAnyBuildOrder:()=>getBuildOrderFromAnyBuildOrder,getBuilderCreationParameters:()=>getBuilderCreationParameters,getBuilderFileEmit:()=>getBuilderFileEmit,getCanonicalDiagnostic:()=>getCanonicalDiagnostic,getCheckFlags:()=>getCheckFlags,getClassExtendsHeritageElement:()=>getClassExtendsHeritageElement,getClassLikeDeclarationOfSymbol:()=>getClassLikeDeclarationOfSymbol,getCombinedLocalAndExportSymbolFlags:()=>getCombinedLocalAndExportSymbolFlags,getCombinedModifierFlags:()=>getCombinedModifierFlags,getCombinedNodeFlags:()=>getCombinedNodeFlags,getCombinedNodeFlagsAlwaysIncludeJSDoc:()=>getCombinedNodeFlagsAlwaysIncludeJSDoc,getCommentRange:()=>getCommentRange,getCommonSourceDirectory:()=>getCommonSourceDirectory,getCommonSourceDirectoryOfConfig:()=>getCommonSourceDirectoryOfConfig,getCompilerOptionValue:()=>getCompilerOptionValue,getCompilerOptionsDiffValue:()=>getCompilerOptionsDiffValue,getConditions:()=>getConditions,getConfigFileParsingDiagnostics:()=>getConfigFileParsingDiagnostics,getConstantValue:()=>getConstantValue,getContainerFlags:()=>getContainerFlags,getContainerNode:()=>getContainerNode,getContainingClass:()=>getContainingClass,getContainingClassExcludingClassDecorators:()=>getContainingClassExcludingClassDecorators,getContainingClassStaticBlock:()=>getContainingClassStaticBlock,getContainingFunction:()=>getContainingFunction,getContainingFunctionDeclaration:()=>getContainingFunctionDeclaration,getContainingFunctionOrClassStaticBlock:()=>getContainingFunctionOrClassStaticBlock,getContainingNodeArray:()=>getContainingNodeArray,getContainingObjectLiteralElement:()=>getContainingObjectLiteralElement,getContextualTypeFromParent:()=>getContextualTypeFromParent,getContextualTypeFromParentOrAncestorTypeNode:()=>getContextualTypeFromParentOrAncestorTypeNode,getDeclarationDiagnostics:()=>getDeclarationDiagnostics,getDeclarationEmitExtensionForPath:()=>getDeclarationEmitExtensionForPath,getDeclarationEmitOutputFilePath:()=>getDeclarationEmitOutputFilePath,getDeclarationEmitOutputFilePathWorker:()=>getDeclarationEmitOutputFilePathWorker,getDeclarationFileExtension:()=>getDeclarationFileExtension,getDeclarationFromName:()=>getDeclarationFromName,getDeclarationModifierFlagsFromSymbol:()=>getDeclarationModifierFlagsFromSymbol,getDeclarationOfKind:()=>getDeclarationOfKind,getDeclarationsOfKind:()=>getDeclarationsOfKind,getDeclaredExpandoInitializer:()=>getDeclaredExpandoInitializer,getDecorators:()=>getDecorators,getDefaultCompilerOptions:()=>getDefaultCompilerOptions2,getDefaultFormatCodeSettings:()=>getDefaultFormatCodeSettings,getDefaultLibFileName:()=>getDefaultLibFileName,getDefaultLibFilePath:()=>getDefaultLibFilePath,getDefaultLikeExportInfo:()=>getDefaultLikeExportInfo,getDefaultLikeExportNameFromDeclaration:()=>getDefaultLikeExportNameFromDeclaration,getDefaultResolutionModeForFileWorker:()=>getDefaultResolutionModeForFileWorker,getDiagnosticText:()=>getDiagnosticText,getDiagnosticsWithinSpan:()=>getDiagnosticsWithinSpan,getDirectoryPath:()=>getDirectoryPath,getDirectoryToWatchFailedLookupLocation:()=>getDirectoryToWatchFailedLookupLocation,getDirectoryToWatchFailedLookupLocationFromTypeRoot:()=>getDirectoryToWatchFailedLookupLocationFromTypeRoot,getDocumentPositionMapper:()=>getDocumentPositionMapper,getDocumentSpansEqualityComparer:()=>getDocumentSpansEqualityComparer,getESModuleInterop:()=>Kn,getEditsForFileRename:()=>getEditsForFileRename,getEffectiveBaseTypeNode:()=>getEffectiveBaseTypeNode,getEffectiveConstraintOfTypeParameter:()=>getEffectiveConstraintOfTypeParameter,getEffectiveContainerForJSDocTemplateTag:()=>getEffectiveContainerForJSDocTemplateTag,getEffectiveImplementsTypeNodes:()=>getEffectiveImplementsTypeNodes,getEffectiveInitializer:()=>getEffectiveInitializer,getEffectiveJSDocHost:()=>getEffectiveJSDocHost,getEffectiveModifierFlags:()=>getEffectiveModifierFlags,getEffectiveModifierFlagsAlwaysIncludeJSDoc:()=>getEffectiveModifierFlagsAlwaysIncludeJSDoc,getEffectiveModifierFlagsNoCache:()=>getEffectiveModifierFlagsNoCache,getEffectiveReturnTypeNode:()=>getEffectiveReturnTypeNode,getEffectiveSetAccessorTypeAnnotationNode:()=>getEffectiveSetAccessorTypeAnnotationNode,getEffectiveTypeAnnotationNode:()=>getEffectiveTypeAnnotationNode,getEffectiveTypeParameterDeclarations:()=>getEffectiveTypeParameterDeclarations,getEffectiveTypeRoots:()=>getEffectiveTypeRoots,getElementOrPropertyAccessArgumentExpressionOrName:()=>getElementOrPropertyAccessArgumentExpressionOrName,getElementOrPropertyAccessName:()=>getElementOrPropertyAccessName,getElementsOfBindingOrAssignmentPattern:()=>getElementsOfBindingOrAssignmentPattern,getEmitDeclarations:()=>Zn,getEmitFlags:()=>getEmitFlags,getEmitHelpers:()=>getEmitHelpers,getEmitModuleDetectionKind:()=>Hn,getEmitModuleFormatOfFileWorker:()=>getEmitModuleFormatOfFileWorker,getEmitModuleKind:()=>Vn,getEmitModuleResolutionKind:()=>qn,getEmitScriptTarget:()=>zn,getEmitStandardClassFields:()=>getEmitStandardClassFields,getEnclosingBlockScopeContainer:()=>getEnclosingBlockScopeContainer,getEnclosingContainer:()=>getEnclosingContainer,getEncodedSemanticClassifications:()=>getEncodedSemanticClassifications,getEncodedSyntacticClassifications:()=>getEncodedSyntacticClassifications,getEndLinePosition:()=>getEndLinePosition,getEntityNameFromTypeNode:()=>getEntityNameFromTypeNode,getEntrypointsFromPackageJsonInfo:()=>getEntrypointsFromPackageJsonInfo,getErrorCountForSummary:()=>getErrorCountForSummary,getErrorSpanForNode:()=>getErrorSpanForNode,getErrorSummaryText:()=>getErrorSummaryText,getEscapedTextOfIdentifierOrLiteral:()=>getEscapedTextOfIdentifierOrLiteral,getEscapedTextOfJsxAttributeName:()=>getEscapedTextOfJsxAttributeName,getEscapedTextOfJsxNamespacedName:()=>getEscapedTextOfJsxNamespacedName,getExpandoInitializer:()=>getExpandoInitializer,getExportAssignmentExpression:()=>getExportAssignmentExpression,getExportInfoMap:()=>getExportInfoMap,getExportNeedsImportStarHelper:()=>getExportNeedsImportStarHelper,getExpressionAssociativity:()=>getExpressionAssociativity,getExpressionPrecedence:()=>getExpressionPrecedence,getExternalHelpersModuleName:()=>getExternalHelpersModuleName,getExternalModuleImportEqualsDeclarationExpression:()=>getExternalModuleImportEqualsDeclarationExpression,getExternalModuleName:()=>getExternalModuleName,getExternalModuleNameFromDeclaration:()=>getExternalModuleNameFromDeclaration,getExternalModuleNameFromPath:()=>getExternalModuleNameFromPath,getExternalModuleNameLiteral:()=>getExternalModuleNameLiteral,getExternalModuleRequireArgument:()=>getExternalModuleRequireArgument,getFallbackOptions:()=>getFallbackOptions,getFileEmitOutput:()=>getFileEmitOutput,getFileMatcherPatterns:()=>getFileMatcherPatterns,getFileNamesFromConfigSpecs:()=>getFileNamesFromConfigSpecs,getFileWatcherEventKind:()=>getFileWatcherEventKind,getFilesInErrorForSummary:()=>getFilesInErrorForSummary,getFirstConstructorWithBody:()=>getFirstConstructorWithBody,getFirstIdentifier:()=>getFirstIdentifier,getFirstNonSpaceCharacterPosition:()=>getFirstNonSpaceCharacterPosition,getFirstProjectOutput:()=>getFirstProjectOutput,getFixableErrorSpanExpression:()=>getFixableErrorSpanExpression,getFormatCodeSettingsForWriting:()=>getFormatCodeSettingsForWriting,getFullWidth:()=>getFullWidth,getFunctionFlags:()=>getFunctionFlags,getHeritageClause:()=>getHeritageClause,getHostSignatureFromJSDoc:()=>getHostSignatureFromJSDoc,getIdentifierAutoGenerate:()=>getIdentifierAutoGenerate,getIdentifierGeneratedImportReference:()=>getIdentifierGeneratedImportReference,getIdentifierTypeArguments:()=>getIdentifierTypeArguments,getImmediatelyInvokedFunctionExpression:()=>getImmediatelyInvokedFunctionExpression,getImpliedNodeFormatForEmitWorker:()=>getImpliedNodeFormatForEmitWorker,getImpliedNodeFormatForFile:()=>getImpliedNodeFormatForFile,getImpliedNodeFormatForFileWorker:()=>getImpliedNodeFormatForFileWorker,getImportNeedsImportDefaultHelper:()=>getImportNeedsImportDefaultHelper,getImportNeedsImportStarHelper:()=>getImportNeedsImportStarHelper,getIndentString:()=>getIndentString,getInferredLibraryNameResolveFrom:()=>getInferredLibraryNameResolveFrom,getInitializedVariables:()=>getInitializedVariables,getInitializerOfBinaryExpression:()=>getInitializerOfBinaryExpression,getInitializerOfBindingOrAssignmentElement:()=>getInitializerOfBindingOrAssignmentElement,getInterfaceBaseTypeNodes:()=>getInterfaceBaseTypeNodes,getInternalEmitFlags:()=>getInternalEmitFlags,getInvokedExpression:()=>getInvokedExpression,getIsFileExcluded:()=>getIsFileExcluded,getIsolatedModules:()=>Gn,getJSDocAugmentsTag:()=>getJSDocAugmentsTag,getJSDocClassTag:()=>getJSDocClassTag,getJSDocCommentRanges:()=>getJSDocCommentRanges,getJSDocCommentsAndTags:()=>getJSDocCommentsAndTags,getJSDocDeprecatedTag:()=>getJSDocDeprecatedTag,getJSDocDeprecatedTagNoCache:()=>getJSDocDeprecatedTagNoCache,getJSDocEnumTag:()=>getJSDocEnumTag,getJSDocHost:()=>getJSDocHost,getJSDocImplementsTags:()=>getJSDocImplementsTags,getJSDocOverloadTags:()=>getJSDocOverloadTags,getJSDocOverrideTagNoCache:()=>getJSDocOverrideTagNoCache,getJSDocParameterTags:()=>getJSDocParameterTags,getJSDocParameterTagsNoCache:()=>getJSDocParameterTagsNoCache,getJSDocPrivateTag:()=>getJSDocPrivateTag,getJSDocPrivateTagNoCache:()=>getJSDocPrivateTagNoCache,getJSDocProtectedTag:()=>getJSDocProtectedTag,getJSDocProtectedTagNoCache:()=>getJSDocProtectedTagNoCache,getJSDocPublicTag:()=>getJSDocPublicTag,getJSDocPublicTagNoCache:()=>getJSDocPublicTagNoCache,getJSDocReadonlyTag:()=>getJSDocReadonlyTag,getJSDocReadonlyTagNoCache:()=>getJSDocReadonlyTagNoCache,getJSDocReturnTag:()=>getJSDocReturnTag,getJSDocReturnType:()=>getJSDocReturnType,getJSDocRoot:()=>getJSDocRoot,getJSDocSatisfiesExpressionType:()=>getJSDocSatisfiesExpressionType,getJSDocSatisfiesTag:()=>getJSDocSatisfiesTag,getJSDocTags:()=>getJSDocTags,getJSDocTemplateTag:()=>getJSDocTemplateTag,getJSDocThisTag:()=>getJSDocThisTag,getJSDocType:()=>getJSDocType,getJSDocTypeAliasName:()=>getJSDocTypeAliasName,getJSDocTypeAssertionType:()=>getJSDocTypeAssertionType,getJSDocTypeParameterDeclarations:()=>getJSDocTypeParameterDeclarations,getJSDocTypeParameterTags:()=>getJSDocTypeParameterTags,getJSDocTypeParameterTagsNoCache:()=>getJSDocTypeParameterTagsNoCache,getJSDocTypeTag:()=>getJSDocTypeTag,getJSXImplicitImportBase:()=>getJSXImplicitImportBase,getJSXRuntimeImport:()=>getJSXRuntimeImport,getJSXTransformEnabled:()=>getJSXTransformEnabled,getKeyForCompilerOptions:()=>getKeyForCompilerOptions,getLanguageVariant:()=>getLanguageVariant,getLastChild:()=>getLastChild,getLeadingCommentRanges:()=>getLeadingCommentRanges,getLeadingCommentRangesOfNode:()=>getLeadingCommentRangesOfNode,getLeftmostAccessExpression:()=>getLeftmostAccessExpression,getLeftmostExpression:()=>getLeftmostExpression,getLibFileNameFromLibReference:()=>getLibFileNameFromLibReference,getLibNameFromLibReference:()=>getLibNameFromLibReference,getLibraryNameFromLibFileName:()=>getLibraryNameFromLibFileName,getLineAndCharacterOfPosition:()=>getLineAndCharacterOfPosition,getLineInfo:()=>getLineInfo,getLineOfLocalPosition:()=>getLineOfLocalPosition,getLineStartPositionForPosition:()=>getLineStartPositionForPosition,getLineStarts:()=>getLineStarts,getLinesBetweenPositionAndNextNonWhitespaceCharacter:()=>getLinesBetweenPositionAndNextNonWhitespaceCharacter,getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter:()=>getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter,getLinesBetweenPositions:()=>getLinesBetweenPositions,getLinesBetweenRangeEndAndRangeStart:()=>getLinesBetweenRangeEndAndRangeStart,getLinesBetweenRangeEndPositions:()=>getLinesBetweenRangeEndPositions,getLiteralText:()=>getLiteralText,getLocalNameForExternalImport:()=>getLocalNameForExternalImport,getLocalSymbolForExportDefault:()=>getLocalSymbolForExportDefault,getLocaleSpecificMessage:()=>getLocaleSpecificMessage,getLocaleTimeString:()=>getLocaleTimeString,getMappedContextSpan:()=>getMappedContextSpan,getMappedDocumentSpan:()=>getMappedDocumentSpan,getMappedLocation:()=>getMappedLocation,getMatchedFileSpec:()=>getMatchedFileSpec,getMatchedIncludeSpec:()=>getMatchedIncludeSpec,getMeaningFromDeclaration:()=>getMeaningFromDeclaration,getMeaningFromLocation:()=>getMeaningFromLocation,getMembersOfDeclaration:()=>getMembersOfDeclaration,getModeForFileReference:()=>getModeForFileReference,getModeForResolutionAtIndex:()=>getModeForResolutionAtIndex,getModeForUsageLocation:()=>getModeForUsageLocation,getModifiedTime:()=>getModifiedTime,getModifiers:()=>getModifiers,getModuleInstanceState:()=>getModuleInstanceState,getModuleNameStringLiteralAt:()=>getModuleNameStringLiteralAt,getModuleSpecifierEndingPreference:()=>getModuleSpecifierEndingPreference,getModuleSpecifierResolverHost:()=>getModuleSpecifierResolverHost,getNameForExportedSymbol:()=>getNameForExportedSymbol,getNameFromImportAttribute:()=>getNameFromImportAttribute,getNameFromIndexInfo:()=>getNameFromIndexInfo,getNameFromPropertyName:()=>getNameFromPropertyName,getNameOfAccessExpression:()=>getNameOfAccessExpression,getNameOfCompilerOptionValue:()=>getNameOfCompilerOptionValue,getNameOfDeclaration:()=>getNameOfDeclaration,getNameOfExpando:()=>getNameOfExpando,getNameOfJSDocTypedef:()=>getNameOfJSDocTypedef,getNameOfScriptTarget:()=>getNameOfScriptTarget,getNameOrArgument:()=>getNameOrArgument,getNameTable:()=>getNameTable,getNamespaceDeclarationNode:()=>getNamespaceDeclarationNode,getNewLineCharacter:()=>getNewLineCharacter,getNewLineKind:()=>getNewLineKind,getNewLineOrDefaultFromHost:()=>getNewLineOrDefaultFromHost,getNewTargetContainer:()=>getNewTargetContainer,getNextJSDocCommentLocation:()=>getNextJSDocCommentLocation,getNodeChildren:()=>getNodeChildren,getNodeForGeneratedName:()=>getNodeForGeneratedName,getNodeId:()=>getNodeId,getNodeKind:()=>getNodeKind,getNodeModifiers:()=>getNodeModifiers,getNodeModulePathParts:()=>getNodeModulePathParts,getNonAssignedNameOfDeclaration:()=>getNonAssignedNameOfDeclaration,getNonAssignmentOperatorForCompoundAssignment:()=>getNonAssignmentOperatorForCompoundAssignment,getNonAugmentationDeclaration:()=>getNonAugmentationDeclaration,getNonDecoratorTokenPosOfNode:()=>getNonDecoratorTokenPosOfNode,getNonIncrementalBuildInfoRoots:()=>getNonIncrementalBuildInfoRoots,getNonModifierTokenPosOfNode:()=>getNonModifierTokenPosOfNode,getNormalizedAbsolutePath:()=>getNormalizedAbsolutePath,getNormalizedAbsolutePathWithoutRoot:()=>getNormalizedAbsolutePathWithoutRoot,getNormalizedPathComponents:()=>getNormalizedPathComponents,getObjectFlags:()=>getObjectFlags,getOperatorAssociativity:()=>getOperatorAssociativity,getOperatorPrecedence:()=>getOperatorPrecedence,getOptionFromName:()=>getOptionFromName,getOptionsForLibraryResolution:()=>getOptionsForLibraryResolution,getOptionsNameMap:()=>getOptionsNameMap,getOptionsSyntaxByArrayElementValue:()=>getOptionsSyntaxByArrayElementValue,getOptionsSyntaxByValue:()=>getOptionsSyntaxByValue,getOrCreateEmitNode:()=>getOrCreateEmitNode,getOrUpdate:()=>getOrUpdate,getOriginalNode:()=>getOriginalNode,getOriginalNodeId:()=>getOriginalNodeId,getOutputDeclarationFileName:()=>getOutputDeclarationFileName,getOutputDeclarationFileNameWorker:()=>getOutputDeclarationFileNameWorker,getOutputExtension:()=>getOutputExtension,getOutputFileNames:()=>getOutputFileNames,getOutputJSFileNameWorker:()=>getOutputJSFileNameWorker,getOutputPathsFor:()=>getOutputPathsFor,getOwnEmitOutputFilePath:()=>getOwnEmitOutputFilePath,getOwnKeys:()=>getOwnKeys,getOwnValues:()=>getOwnValues,getPackageJsonTypesVersionsPaths:()=>getPackageJsonTypesVersionsPaths,getPackageNameFromTypesPackageName:()=>getPackageNameFromTypesPackageName,getPackageScopeForPath:()=>getPackageScopeForPath,getParameterSymbolFromJSDoc:()=>getParameterSymbolFromJSDoc,getParentNodeInSpan:()=>getParentNodeInSpan,getParseTreeNode:()=>getParseTreeNode,getParsedCommandLineOfConfigFile:()=>getParsedCommandLineOfConfigFile,getPathComponents:()=>getPathComponents,getPathFromPathComponents:()=>getPathFromPathComponents,getPathUpdater:()=>getPathUpdater,getPathsBasePath:()=>getPathsBasePath,getPatternFromSpec:()=>getPatternFromSpec,getPendingEmitKindWithSeen:()=>getPendingEmitKindWithSeen,getPositionOfLineAndCharacter:()=>getPositionOfLineAndCharacter,getPossibleGenericSignatures:()=>getPossibleGenericSignatures,getPossibleOriginalInputExtensionForExtension:()=>getPossibleOriginalInputExtensionForExtension,getPossibleOriginalInputPathWithoutChangingExt:()=>getPossibleOriginalInputPathWithoutChangingExt,getPossibleTypeArgumentsInfo:()=>getPossibleTypeArgumentsInfo,getPreEmitDiagnostics:()=>getPreEmitDiagnostics,getPrecedingNonSpaceCharacterPosition:()=>getPrecedingNonSpaceCharacterPosition,getPrivateIdentifier:()=>getPrivateIdentifier,getProperties:()=>getProperties,getProperty:()=>getProperty,getPropertyAssignmentAliasLikeExpression:()=>getPropertyAssignmentAliasLikeExpression,getPropertyNameForPropertyNameNode:()=>getPropertyNameForPropertyNameNode,getPropertyNameFromType:()=>getPropertyNameFromType,getPropertyNameOfBindingOrAssignmentElement:()=>getPropertyNameOfBindingOrAssignmentElement,getPropertySymbolFromBindingElement:()=>getPropertySymbolFromBindingElement,getPropertySymbolsFromContextualType:()=>getPropertySymbolsFromContextualType,getQuoteFromPreference:()=>getQuoteFromPreference,getQuotePreference:()=>getQuotePreference,getRangesWhere:()=>getRangesWhere,getRefactorContextSpan:()=>getRefactorContextSpan,getReferencedFileLocation:()=>getReferencedFileLocation,getRegexFromPattern:()=>getRegexFromPattern,getRegularExpressionForWildcard:()=>getRegularExpressionForWildcard,getRegularExpressionsForWildcards:()=>getRegularExpressionsForWildcards,getRelativePathFromDirectory:()=>getRelativePathFromDirectory,getRelativePathFromFile:()=>getRelativePathFromFile,getRelativePathToDirectoryOrUrl:()=>getRelativePathToDirectoryOrUrl,getRenameLocation:()=>getRenameLocation,getReplacementSpanForContextToken:()=>getReplacementSpanForContextToken,getResolutionDiagnostic:()=>getResolutionDiagnostic,getResolutionModeOverride:()=>getResolutionModeOverride,getResolveJsonModule:()=>Yn,getResolvePackageJsonExports:()=>Qn,getResolvePackageJsonImports:()=>Xn,getResolvedExternalModuleName:()=>getResolvedExternalModuleName,getResolvedModuleFromResolution:()=>getResolvedModuleFromResolution,getResolvedTypeReferenceDirectiveFromResolution:()=>getResolvedTypeReferenceDirectiveFromResolution,getRestIndicatorOfBindingOrAssignmentElement:()=>getRestIndicatorOfBindingOrAssignmentElement,getRestParameterElementType:()=>getRestParameterElementType,getRightMostAssignedExpression:()=>getRightMostAssignedExpression,getRootDeclaration:()=>getRootDeclaration,getRootDirectoryOfResolutionCache:()=>getRootDirectoryOfResolutionCache,getRootLength:()=>getRootLength,getScriptKind:()=>getScriptKind,getScriptKindFromFileName:()=>getScriptKindFromFileName,getScriptTargetFeatures:()=>un,getSelectedEffectiveModifierFlags:()=>getSelectedEffectiveModifierFlags,getSelectedSyntacticModifierFlags:()=>getSelectedSyntacticModifierFlags,getSemanticClassifications:()=>getSemanticClassifications,getSemanticJsxChildren:()=>getSemanticJsxChildren,getSetAccessorTypeAnnotationNode:()=>getSetAccessorTypeAnnotationNode,getSetAccessorValueParameter:()=>getSetAccessorValueParameter,getSetExternalModuleIndicator:()=>getSetExternalModuleIndicator,getShebang:()=>getShebang,getSingleVariableOfVariableStatement:()=>getSingleVariableOfVariableStatement,getSnapshotText:()=>getSnapshotText,getSnippetElement:()=>getSnippetElement,getSourceFileOfModule:()=>getSourceFileOfModule,getSourceFileOfNode:()=>getSourceFileOfNode,getSourceFilePathInNewDir:()=>getSourceFilePathInNewDir,getSourceFileVersionAsHashFromText:()=>getSourceFileVersionAsHashFromText,getSourceFilesToEmit:()=>getSourceFilesToEmit,getSourceMapRange:()=>getSourceMapRange,getSourceMapper:()=>getSourceMapper,getSourceTextOfNodeFromSourceFile:()=>getSourceTextOfNodeFromSourceFile,getSpanOfTokenAtPosition:()=>getSpanOfTokenAtPosition,getSpellingSuggestion:()=>getSpellingSuggestion,getStartPositionOfLine:()=>getStartPositionOfLine,getStartPositionOfRange:()=>getStartPositionOfRange,getStartsOnNewLine:()=>getStartsOnNewLine,getStaticPropertiesAndClassStaticBlock:()=>getStaticPropertiesAndClassStaticBlock,getStrictOptionValue:()=>getStrictOptionValue,getStringComparer:()=>getStringComparer,getSubPatternFromSpec:()=>getSubPatternFromSpec,getSuperCallFromStatement:()=>getSuperCallFromStatement,getSuperContainer:()=>getSuperContainer,getSupportedCodeFixes:()=>getSupportedCodeFixes,getSupportedExtensions:()=>getSupportedExtensions,getSupportedExtensionsWithJsonIfResolveJsonModule:()=>getSupportedExtensionsWithJsonIfResolveJsonModule,getSwitchedType:()=>getSwitchedType,getSymbolId:()=>getSymbolId,getSymbolNameForPrivateIdentifier:()=>getSymbolNameForPrivateIdentifier,getSymbolTarget:()=>getSymbolTarget,getSyntacticClassifications:()=>getSyntacticClassifications,getSyntacticModifierFlags:()=>getSyntacticModifierFlags,getSyntacticModifierFlagsNoCache:()=>getSyntacticModifierFlagsNoCache,getSynthesizedDeepClone:()=>getSynthesizedDeepClone,getSynthesizedDeepCloneWithReplacements:()=>getSynthesizedDeepCloneWithReplacements,getSynthesizedDeepClones:()=>getSynthesizedDeepClones,getSynthesizedDeepClonesWithReplacements:()=>getSynthesizedDeepClonesWithReplacements,getSyntheticLeadingComments:()=>getSyntheticLeadingComments,getSyntheticTrailingComments:()=>getSyntheticTrailingComments,getTargetLabel:()=>getTargetLabel,getTargetOfBindingOrAssignmentElement:()=>getTargetOfBindingOrAssignmentElement,getTemporaryModuleResolutionState:()=>getTemporaryModuleResolutionState,getTextOfConstantValue:()=>getTextOfConstantValue,getTextOfIdentifierOrLiteral:()=>getTextOfIdentifierOrLiteral,getTextOfJSDocComment:()=>getTextOfJSDocComment,getTextOfJsxAttributeName:()=>getTextOfJsxAttributeName,getTextOfJsxNamespacedName:()=>getTextOfJsxNamespacedName,getTextOfNode:()=>getTextOfNode,getTextOfNodeFromSourceText:()=>getTextOfNodeFromSourceText,getTextOfPropertyName:()=>getTextOfPropertyName,getThisContainer:()=>getThisContainer,getThisParameter:()=>getThisParameter,getTokenAtPosition:()=>getTokenAtPosition,getTokenPosOfNode:()=>getTokenPosOfNode,getTokenSourceMapRange:()=>getTokenSourceMapRange,getTouchingPropertyName:()=>getTouchingPropertyName,getTouchingToken:()=>getTouchingToken,getTrailingCommentRanges:()=>getTrailingCommentRanges,getTrailingSemicolonDeferringWriter:()=>getTrailingSemicolonDeferringWriter,getTransformers:()=>getTransformers,getTsBuildInfoEmitOutputFilePath:()=>getTsBuildInfoEmitOutputFilePath,getTsConfigObjectLiteralExpression:()=>getTsConfigObjectLiteralExpression,getTsConfigPropArrayElementValue:()=>getTsConfigPropArrayElementValue,getTypeAnnotationNode:()=>getTypeAnnotationNode,getTypeArgumentOrTypeParameterList:()=>getTypeArgumentOrTypeParameterList,getTypeKeywordOfTypeOnlyImport:()=>getTypeKeywordOfTypeOnlyImport,getTypeNode:()=>getTypeNode,getTypeNodeIfAccessible:()=>getTypeNodeIfAccessible,getTypeParameterFromJsDoc:()=>getTypeParameterFromJsDoc,getTypeParameterOwner:()=>getTypeParameterOwner,getTypesPackageName:()=>getTypesPackageName,getUILocale:()=>getUILocale,getUniqueName:()=>getUniqueName,getUniqueSymbolId:()=>getUniqueSymbolId,getUseDefineForClassFields:()=>ir,getWatchErrorSummaryDiagnosticMessage:()=>getWatchErrorSummaryDiagnosticMessage,getWatchFactory:()=>getWatchFactory,group:()=>group,groupBy:()=>groupBy,guessIndentation:()=>guessIndentation,handleNoEmitOptions:()=>handleNoEmitOptions,handleWatchOptionsConfigDirTemplateSubstitution:()=>handleWatchOptionsConfigDirTemplateSubstitution,hasAbstractModifier:()=>hasAbstractModifier,hasAccessorModifier:()=>hasAccessorModifier,hasAmbientModifier:()=>hasAmbientModifier,hasChangesInResolutions:()=>hasChangesInResolutions,hasContextSensitiveParameters:()=>hasContextSensitiveParameters,hasDecorators:()=>hasDecorators,hasDocComment:()=>hasDocComment,hasDynamicName:()=>hasDynamicName,hasEffectiveModifier:()=>hasEffectiveModifier,hasEffectiveModifiers:()=>hasEffectiveModifiers,hasEffectiveReadonlyModifier:()=>hasEffectiveReadonlyModifier,hasExtension:()=>hasExtension,hasImplementationTSFileExtension:()=>hasImplementationTSFileExtension,hasIndexSignature:()=>hasIndexSignature,hasInferredType:()=>hasInferredType,hasInitializer:()=>hasInitializer,hasInvalidEscape:()=>hasInvalidEscape,hasJSDocNodes:()=>hasJSDocNodes,hasJSDocParameterTags:()=>hasJSDocParameterTags,hasJSFileExtension:()=>hasJSFileExtension,hasJsonModuleEmitEnabled:()=>hasJsonModuleEmitEnabled,hasOnlyExpressionInitializer:()=>hasOnlyExpressionInitializer,hasOverrideModifier:()=>hasOverrideModifier,hasPossibleExternalModuleReference:()=>hasPossibleExternalModuleReference,hasProperty:()=>hasProperty,hasPropertyAccessExpressionWithName:()=>hasPropertyAccessExpressionWithName,hasQuestionToken:()=>hasQuestionToken,hasRecordedExternalHelpers:()=>hasRecordedExternalHelpers,hasResolutionModeOverride:()=>hasResolutionModeOverride,hasRestParameter:()=>hasRestParameter,hasScopeMarker:()=>hasScopeMarker,hasStaticModifier:()=>hasStaticModifier,hasSyntacticModifier:()=>hasSyntacticModifier,hasSyntacticModifiers:()=>hasSyntacticModifiers,hasTSFileExtension:()=>hasTSFileExtension,hasTabstop:()=>hasTabstop,hasTrailingDirectorySeparator:()=>hasTrailingDirectorySeparator,hasType:()=>hasType,hasTypeArguments:()=>hasTypeArguments,hasZeroOrOneAsteriskCharacter:()=>hasZeroOrOneAsteriskCharacter,hostGetCanonicalFileName:()=>hostGetCanonicalFileName,hostUsesCaseSensitiveFileNames:()=>hostUsesCaseSensitiveFileNames,idText:()=>idText,identifierIsThisKeyword:()=>identifierIsThisKeyword,identifierToKeywordKind:()=>identifierToKeywordKind,identity:()=>identity,identitySourceMapConsumer:()=>ga,ignoreSourceNewlines:()=>ignoreSourceNewlines,ignoredPaths:()=>Et,importFromModuleSpecifier:()=>importFromModuleSpecifier,importSyntaxAffectsModuleResolution:()=>importSyntaxAffectsModuleResolution,indexOfAnyCharCode:()=>indexOfAnyCharCode,indexOfNode:()=>indexOfNode,indicesOf:()=>indicesOf,inferredTypesContainingFile:()=>Ha,injectClassNamedEvaluationHelperBlockIfMissing:()=>injectClassNamedEvaluationHelperBlockIfMissing,injectClassThisAssignmentIfMissing:()=>injectClassThisAssignmentIfMissing,insertImports:()=>insertImports,insertSorted:()=>insertSorted,insertStatementAfterCustomPrologue:()=>insertStatementAfterCustomPrologue,insertStatementAfterStandardPrologue:()=>insertStatementAfterStandardPrologue,insertStatementsAfterCustomPrologue:()=>insertStatementsAfterCustomPrologue,insertStatementsAfterStandardPrologue:()=>insertStatementsAfterStandardPrologue,intersperse:()=>intersperse,intrinsicTagNameToString:()=>intrinsicTagNameToString,introducesArgumentsExoticObject:()=>introducesArgumentsExoticObject,inverseJsxOptionMap:()=>qi,isAbstractConstructorSymbol:()=>isAbstractConstructorSymbol,isAbstractModifier:()=>isAbstractModifier,isAccessExpression:()=>isAccessExpression,isAccessibilityModifier:()=>isAccessibilityModifier,isAccessor:()=>isAccessor,isAccessorModifier:()=>isAccessorModifier,isAliasableExpression:()=>isAliasableExpression,isAmbientModule:()=>isAmbientModule,isAmbientPropertyDeclaration:()=>isAmbientPropertyDeclaration,isAnyDirectorySeparator:()=>isAnyDirectorySeparator,isAnyImportOrBareOrAccessedRequire:()=>isAnyImportOrBareOrAccessedRequire,isAnyImportOrReExport:()=>isAnyImportOrReExport,isAnyImportOrRequireStatement:()=>isAnyImportOrRequireStatement,isAnyImportSyntax:()=>isAnyImportSyntax,isAnySupportedFileExtension:()=>isAnySupportedFileExtension,isApplicableVersionedTypesKey:()=>isApplicableVersionedTypesKey,isArgumentExpressionOfElementAccess:()=>isArgumentExpressionOfElementAccess,isArray:()=>isArray,isArrayBindingElement:()=>isArrayBindingElement,isArrayBindingOrAssignmentElement:()=>isArrayBindingOrAssignmentElement,isArrayBindingOrAssignmentPattern:()=>isArrayBindingOrAssignmentPattern,isArrayBindingPattern:()=>isArrayBindingPattern,isArrayLiteralExpression:()=>isArrayLiteralExpression,isArrayLiteralOrObjectLiteralDestructuringPattern:()=>isArrayLiteralOrObjectLiteralDestructuringPattern,isArrayTypeNode:()=>isArrayTypeNode,isArrowFunction:()=>isArrowFunction,isAsExpression:()=>isAsExpression,isAssertClause:()=>isAssertClause,isAssertEntry:()=>isAssertEntry,isAssertionExpression:()=>isAssertionExpression,isAssertsKeyword:()=>isAssertsKeyword,isAssignmentDeclaration:()=>isAssignmentDeclaration,isAssignmentExpression:()=>isAssignmentExpression,isAssignmentOperator:()=>isAssignmentOperator,isAssignmentPattern:()=>isAssignmentPattern,isAssignmentTarget:()=>isAssignmentTarget,isAsteriskToken:()=>isAsteriskToken,isAsyncFunction:()=>isAsyncFunction,isAsyncModifier:()=>isAsyncModifier,isAutoAccessorPropertyDeclaration:()=>isAutoAccessorPropertyDeclaration,isAwaitExpression:()=>isAwaitExpression,isAwaitKeyword:()=>isAwaitKeyword,isBigIntLiteral:()=>isBigIntLiteral,isBinaryExpression:()=>isBinaryExpression,isBinaryLogicalOperator:()=>isBinaryLogicalOperator,isBinaryOperatorToken:()=>isBinaryOperatorToken,isBindableObjectDefinePropertyCall:()=>isBindableObjectDefinePropertyCall,isBindableStaticAccessExpression:()=>isBindableStaticAccessExpression,isBindableStaticElementAccessExpression:()=>isBindableStaticElementAccessExpression,isBindableStaticNameExpression:()=>isBindableStaticNameExpression,isBindingElement:()=>isBindingElement,isBindingElementOfBareOrAccessedRequire:()=>isBindingElementOfBareOrAccessedRequire,isBindingName:()=>isBindingName,isBindingOrAssignmentElement:()=>isBindingOrAssignmentElement,isBindingOrAssignmentPattern:()=>isBindingOrAssignmentPattern,isBindingPattern:()=>isBindingPattern,isBlock:()=>isBlock,isBlockLike:()=>isBlockLike,isBlockOrCatchScoped:()=>isBlockOrCatchScoped,isBlockScope:()=>isBlockScope,isBlockScopedContainerTopLevel:()=>isBlockScopedContainerTopLevel,isBooleanLiteral:()=>isBooleanLiteral,isBreakOrContinueStatement:()=>isBreakOrContinueStatement,isBreakStatement:()=>isBreakStatement,isBuildCommand:()=>isBuildCommand,isBuildInfoFile:()=>isBuildInfoFile,isBuilderProgram:()=>isBuilderProgram,isBundle:()=>isBundle,isCallChain:()=>isCallChain,isCallExpression:()=>isCallExpression,isCallExpressionTarget:()=>isCallExpressionTarget,isCallLikeExpression:()=>isCallLikeExpression,isCallLikeOrFunctionLikeExpression:()=>isCallLikeOrFunctionLikeExpression,isCallOrNewExpression:()=>isCallOrNewExpression,isCallOrNewExpressionTarget:()=>isCallOrNewExpressionTarget,isCallSignatureDeclaration:()=>isCallSignatureDeclaration,isCallToHelper:()=>isCallToHelper,isCaseBlock:()=>isCaseBlock,isCaseClause:()=>isCaseClause,isCaseKeyword:()=>isCaseKeyword,isCaseOrDefaultClause:()=>isCaseOrDefaultClause,isCatchClause:()=>isCatchClause,isCatchClauseVariableDeclaration:()=>isCatchClauseVariableDeclaration,isCatchClauseVariableDeclarationOrBindingElement:()=>isCatchClauseVariableDeclarationOrBindingElement,isCheckJsEnabledForFile:()=>isCheckJsEnabledForFile,isCircularBuildOrder:()=>isCircularBuildOrder,isClassDeclaration:()=>isClassDeclaration,isClassElement:()=>isClassElement,isClassExpression:()=>isClassExpression,isClassInstanceProperty:()=>isClassInstanceProperty,isClassLike:()=>isClassLike,isClassMemberModifier:()=>isClassMemberModifier,isClassNamedEvaluationHelperBlock:()=>isClassNamedEvaluationHelperBlock,isClassOrTypeElement:()=>isClassOrTypeElement,isClassStaticBlockDeclaration:()=>isClassStaticBlockDeclaration,isClassThisAssignmentBlock:()=>isClassThisAssignmentBlock,isColonToken:()=>isColonToken,isCommaExpression:()=>isCommaExpression,isCommaListExpression:()=>isCommaListExpression,isCommaSequence:()=>isCommaSequence,isCommaToken:()=>isCommaToken,isComment:()=>isComment,isCommonJsExportPropertyAssignment:()=>isCommonJsExportPropertyAssignment,isCommonJsExportedExpression:()=>isCommonJsExportedExpression,isCompoundAssignment:()=>isCompoundAssignment,isComputedNonLiteralName:()=>isComputedNonLiteralName,isComputedPropertyName:()=>isComputedPropertyName,isConciseBody:()=>isConciseBody,isConditionalExpression:()=>isConditionalExpression,isConditionalTypeNode:()=>isConditionalTypeNode,isConstAssertion:()=>isConstAssertion,isConstTypeReference:()=>isConstTypeReference,isConstructSignatureDeclaration:()=>isConstructSignatureDeclaration,isConstructorDeclaration:()=>isConstructorDeclaration,isConstructorTypeNode:()=>isConstructorTypeNode,isContextualKeyword:()=>isContextualKeyword,isContinueStatement:()=>isContinueStatement,isCustomPrologue:()=>isCustomPrologue,isDebuggerStatement:()=>isDebuggerStatement,isDeclaration:()=>isDeclaration,isDeclarationBindingElement:()=>isDeclarationBindingElement,isDeclarationFileName:()=>isDeclarationFileName,isDeclarationName:()=>isDeclarationName,isDeclarationNameOfEnumOrNamespace:()=>isDeclarationNameOfEnumOrNamespace,isDeclarationReadonly:()=>isDeclarationReadonly,isDeclarationStatement:()=>isDeclarationStatement,isDeclarationWithTypeParameterChildren:()=>isDeclarationWithTypeParameterChildren,isDeclarationWithTypeParameters:()=>isDeclarationWithTypeParameters,isDecorator:()=>isDecorator,isDecoratorTarget:()=>isDecoratorTarget,isDefaultClause:()=>isDefaultClause,isDefaultImport:()=>isDefaultImport,isDefaultModifier:()=>isDefaultModifier,isDefaultedExpandoInitializer:()=>isDefaultedExpandoInitializer,isDeleteExpression:()=>isDeleteExpression,isDeleteTarget:()=>isDeleteTarget,isDeprecatedDeclaration:()=>isDeprecatedDeclaration,isDestructuringAssignment:()=>isDestructuringAssignment,isDiskPathRoot:()=>isDiskPathRoot,isDoStatement:()=>isDoStatement,isDocumentRegistryEntry:()=>isDocumentRegistryEntry,isDotDotDotToken:()=>isDotDotDotToken,isDottedName:()=>isDottedName,isDynamicName:()=>isDynamicName,isEffectiveExternalModule:()=>isEffectiveExternalModule,isEffectiveStrictModeSourceFile:()=>isEffectiveStrictModeSourceFile,isElementAccessChain:()=>isElementAccessChain,isElementAccessExpression:()=>isElementAccessExpression,isEmittedFileOfProgram:()=>isEmittedFileOfProgram,isEmptyArrayLiteral:()=>isEmptyArrayLiteral,isEmptyBindingElement:()=>isEmptyBindingElement,isEmptyBindingPattern:()=>isEmptyBindingPattern,isEmptyObjectLiteral:()=>isEmptyObjectLiteral,isEmptyStatement:()=>isEmptyStatement,isEmptyStringLiteral:()=>isEmptyStringLiteral,isEntityName:()=>isEntityName,isEntityNameExpression:()=>isEntityNameExpression,isEnumConst:()=>isEnumConst,isEnumDeclaration:()=>isEnumDeclaration,isEnumMember:()=>isEnumMember,isEqualityOperatorKind:()=>isEqualityOperatorKind,isEqualsGreaterThanToken:()=>isEqualsGreaterThanToken,isExclamationToken:()=>isExclamationToken,isExcludedFile:()=>isExcludedFile,isExclusivelyTypeOnlyImportOrExport:()=>isExclusivelyTypeOnlyImportOrExport,isExpandoPropertyDeclaration:()=>isExpandoPropertyDeclaration,isExportAssignment:()=>isExportAssignment,isExportDeclaration:()=>isExportDeclaration,isExportModifier:()=>isExportModifier,isExportName:()=>isExportName,isExportNamespaceAsDefaultDeclaration:()=>isExportNamespaceAsDefaultDeclaration,isExportOrDefaultModifier:()=>isExportOrDefaultModifier,isExportSpecifier:()=>isExportSpecifier,isExportsIdentifier:()=>isExportsIdentifier,isExportsOrModuleExportsOrAlias:()=>isExportsOrModuleExportsOrAlias,isExpression:()=>isExpression,isExpressionNode:()=>isExpressionNode,isExpressionOfExternalModuleImportEqualsDeclaration:()=>isExpressionOfExternalModuleImportEqualsDeclaration,isExpressionOfOptionalChainRoot:()=>isExpressionOfOptionalChainRoot,isExpressionStatement:()=>isExpressionStatement,isExpressionWithTypeArguments:()=>isExpressionWithTypeArguments,isExpressionWithTypeArgumentsInClassExtendsClause:()=>isExpressionWithTypeArgumentsInClassExtendsClause,isExternalModule:()=>isExternalModule,isExternalModuleAugmentation:()=>isExternalModuleAugmentation,isExternalModuleImportEqualsDeclaration:()=>isExternalModuleImportEqualsDeclaration,isExternalModuleIndicator:()=>isExternalModuleIndicator,isExternalModuleNameRelative:()=>isExternalModuleNameRelative,isExternalModuleReference:()=>isExternalModuleReference,isExternalModuleSymbol:()=>isExternalModuleSymbol,isExternalOrCommonJsModule:()=>isExternalOrCommonJsModule,isFileLevelReservedGeneratedIdentifier:()=>isFileLevelReservedGeneratedIdentifier,isFileLevelUniqueName:()=>isFileLevelUniqueName,isFileProbablyExternalModule:()=>isFileProbablyExternalModule,isFirstDeclarationOfSymbolParameter:()=>isFirstDeclarationOfSymbolParameter,isFixablePromiseHandler:()=>isFixablePromiseHandler,isForInOrOfStatement:()=>isForInOrOfStatement,isForInStatement:()=>isForInStatement,isForInitializer:()=>isForInitializer,isForOfStatement:()=>isForOfStatement,isForStatement:()=>isForStatement,isFullSourceFile:()=>isFullSourceFile,isFunctionBlock:()=>isFunctionBlock,isFunctionBody:()=>isFunctionBody,isFunctionDeclaration:()=>isFunctionDeclaration,isFunctionExpression:()=>isFunctionExpression,isFunctionExpressionOrArrowFunction:()=>isFunctionExpressionOrArrowFunction,isFunctionLike:()=>isFunctionLike,isFunctionLikeDeclaration:()=>isFunctionLikeDeclaration,isFunctionLikeKind:()=>isFunctionLikeKind,isFunctionLikeOrClassStaticBlockDeclaration:()=>isFunctionLikeOrClassStaticBlockDeclaration,isFunctionOrConstructorTypeNode:()=>isFunctionOrConstructorTypeNode,isFunctionOrModuleBlock:()=>isFunctionOrModuleBlock,isFunctionSymbol:()=>isFunctionSymbol,isFunctionTypeNode:()=>isFunctionTypeNode,isGeneratedIdentifier:()=>isGeneratedIdentifier,isGeneratedPrivateIdentifier:()=>isGeneratedPrivateIdentifier,isGetAccessor:()=>isGetAccessor,isGetAccessorDeclaration:()=>isGetAccessorDeclaration,isGetOrSetAccessorDeclaration:()=>isGetOrSetAccessorDeclaration,isGlobalScopeAugmentation:()=>isGlobalScopeAugmentation,isGlobalSourceFile:()=>isGlobalSourceFile,isGrammarError:()=>isGrammarError,isHeritageClause:()=>isHeritageClause,isHoistedFunction:()=>isHoistedFunction,isHoistedVariableStatement:()=>isHoistedVariableStatement,isIdentifier:()=>isIdentifier,isIdentifierANonContextualKeyword:()=>isIdentifierANonContextualKeyword,isIdentifierName:()=>isIdentifierName,isIdentifierOrThisTypeNode:()=>isIdentifierOrThisTypeNode,isIdentifierPart:()=>isIdentifierPart,isIdentifierStart:()=>isIdentifierStart,isIdentifierText:()=>isIdentifierText,isIdentifierTypePredicate:()=>isIdentifierTypePredicate,isIdentifierTypeReference:()=>isIdentifierTypeReference,isIfStatement:()=>isIfStatement,isIgnoredFileFromWildCardWatching:()=>isIgnoredFileFromWildCardWatching,isImplicitGlob:()=>isImplicitGlob,isImportAttribute:()=>isImportAttribute,isImportAttributeName:()=>isImportAttributeName,isImportAttributes:()=>isImportAttributes,isImportCall:()=>isImportCall,isImportClause:()=>isImportClause,isImportDeclaration:()=>isImportDeclaration,isImportEqualsDeclaration:()=>isImportEqualsDeclaration,isImportKeyword:()=>isImportKeyword,isImportMeta:()=>isImportMeta,isImportOrExportSpecifier:()=>isImportOrExportSpecifier,isImportOrExportSpecifierName:()=>isImportOrExportSpecifierName,isImportSpecifier:()=>isImportSpecifier,isImportTypeAssertionContainer:()=>isImportTypeAssertionContainer,isImportTypeNode:()=>isImportTypeNode,isImportable:()=>isImportable,isInComment:()=>isInComment,isInCompoundLikeAssignment:()=>isInCompoundLikeAssignment,isInExpressionContext:()=>isInExpressionContext,isInJSDoc:()=>isInJSDoc,isInJSFile:()=>isInJSFile,isInJSXText:()=>isInJSXText,isInJsonFile:()=>isInJsonFile,isInNonReferenceComment:()=>isInNonReferenceComment,isInReferenceComment:()=>isInReferenceComment,isInRightSideOfInternalImportEqualsDeclaration:()=>isInRightSideOfInternalImportEqualsDeclaration,isInString:()=>isInString,isInTemplateString:()=>isInTemplateString,isInTopLevelContext:()=>isInTopLevelContext,isInTypeQuery:()=>isInTypeQuery,isIncrementalBuildInfo:()=>isIncrementalBuildInfo,isIncrementalBundleEmitBuildInfo:()=>isIncrementalBundleEmitBuildInfo,isIncrementalCompilation:()=>tr,isIndexSignatureDeclaration:()=>isIndexSignatureDeclaration,isIndexedAccessTypeNode:()=>isIndexedAccessTypeNode,isInferTypeNode:()=>isInferTypeNode,isInfinityOrNaNString:()=>isInfinityOrNaNString,isInitializedProperty:()=>isInitializedProperty,isInitializedVariable:()=>isInitializedVariable,isInsideJsxElement:()=>isInsideJsxElement,isInsideJsxElementOrAttribute:()=>isInsideJsxElementOrAttribute,isInsideNodeModules:()=>isInsideNodeModules,isInsideTemplateLiteral:()=>isInsideTemplateLiteral,isInstanceOfExpression:()=>isInstanceOfExpression,isInstantiatedModule:()=>isInstantiatedModule,isInterfaceDeclaration:()=>isInterfaceDeclaration,isInternalDeclaration:()=>isInternalDeclaration,isInternalModuleImportEqualsDeclaration:()=>isInternalModuleImportEqualsDeclaration,isInternalName:()=>isInternalName,isIntersectionTypeNode:()=>isIntersectionTypeNode,isIntrinsicJsxName:()=>isIntrinsicJsxName,isIterationStatement:()=>isIterationStatement,isJSDoc:()=>isJSDoc,isJSDocAllType:()=>isJSDocAllType,isJSDocAugmentsTag:()=>isJSDocAugmentsTag,isJSDocAuthorTag:()=>isJSDocAuthorTag,isJSDocCallbackTag:()=>isJSDocCallbackTag,isJSDocClassTag:()=>isJSDocClassTag,isJSDocCommentContainingNode:()=>isJSDocCommentContainingNode,isJSDocConstructSignature:()=>isJSDocConstructSignature,isJSDocDeprecatedTag:()=>isJSDocDeprecatedTag,isJSDocEnumTag:()=>isJSDocEnumTag,isJSDocFunctionType:()=>isJSDocFunctionType,isJSDocImplementsTag:()=>isJSDocImplementsTag,isJSDocImportTag:()=>isJSDocImportTag,isJSDocIndexSignature:()=>isJSDocIndexSignature,isJSDocLikeText:()=>isJSDocLikeText,isJSDocLink:()=>isJSDocLink,isJSDocLinkCode:()=>isJSDocLinkCode,isJSDocLinkLike:()=>isJSDocLinkLike,isJSDocLinkPlain:()=>isJSDocLinkPlain,isJSDocMemberName:()=>isJSDocMemberName,isJSDocNameReference:()=>isJSDocNameReference,isJSDocNamepathType:()=>isJSDocNamepathType,isJSDocNamespaceBody:()=>isJSDocNamespaceBody,isJSDocNode:()=>isJSDocNode,isJSDocNonNullableType:()=>isJSDocNonNullableType,isJSDocNullableType:()=>isJSDocNullableType,isJSDocOptionalParameter:()=>isJSDocOptionalParameter,isJSDocOptionalType:()=>isJSDocOptionalType,isJSDocOverloadTag:()=>isJSDocOverloadTag,isJSDocOverrideTag:()=>isJSDocOverrideTag,isJSDocParameterTag:()=>isJSDocParameterTag,isJSDocPrivateTag:()=>isJSDocPrivateTag,isJSDocPropertyLikeTag:()=>isJSDocPropertyLikeTag,isJSDocPropertyTag:()=>isJSDocPropertyTag,isJSDocProtectedTag:()=>isJSDocProtectedTag,isJSDocPublicTag:()=>isJSDocPublicTag,isJSDocReadonlyTag:()=>isJSDocReadonlyTag,isJSDocReturnTag:()=>isJSDocReturnTag,isJSDocSatisfiesExpression:()=>isJSDocSatisfiesExpression,isJSDocSatisfiesTag:()=>isJSDocSatisfiesTag,isJSDocSeeTag:()=>isJSDocSeeTag,isJSDocSignature:()=>isJSDocSignature,isJSDocTag:()=>isJSDocTag,isJSDocTemplateTag:()=>isJSDocTemplateTag,isJSDocThisTag:()=>isJSDocThisTag,isJSDocThrowsTag:()=>isJSDocThrowsTag,isJSDocTypeAlias:()=>isJSDocTypeAlias,isJSDocTypeAssertion:()=>isJSDocTypeAssertion,isJSDocTypeExpression:()=>isJSDocTypeExpression,isJSDocTypeLiteral:()=>isJSDocTypeLiteral,isJSDocTypeTag:()=>isJSDocTypeTag,isJSDocTypedefTag:()=>isJSDocTypedefTag,isJSDocUnknownTag:()=>isJSDocUnknownTag,isJSDocUnknownType:()=>isJSDocUnknownType,isJSDocVariadicType:()=>isJSDocVariadicType,isJSXTagName:()=>isJSXTagName,isJsonEqual:()=>isJsonEqual,isJsonSourceFile:()=>isJsonSourceFile,isJsxAttribute:()=>isJsxAttribute,isJsxAttributeLike:()=>isJsxAttributeLike,isJsxAttributeName:()=>isJsxAttributeName,isJsxAttributes:()=>isJsxAttributes,isJsxCallLike:()=>isJsxCallLike,isJsxChild:()=>isJsxChild,isJsxClosingElement:()=>isJsxClosingElement,isJsxClosingFragment:()=>isJsxClosingFragment,isJsxElement:()=>isJsxElement,isJsxExpression:()=>isJsxExpression,isJsxFragment:()=>isJsxFragment,isJsxNamespacedName:()=>isJsxNamespacedName,isJsxOpeningElement:()=>isJsxOpeningElement,isJsxOpeningFragment:()=>isJsxOpeningFragment,isJsxOpeningLikeElement:()=>isJsxOpeningLikeElement,isJsxOpeningLikeElementTagName:()=>isJsxOpeningLikeElementTagName,isJsxSelfClosingElement:()=>isJsxSelfClosingElement,isJsxSpreadAttribute:()=>isJsxSpreadAttribute,isJsxTagNameExpression:()=>isJsxTagNameExpression,isJsxText:()=>isJsxText,isJumpStatementTarget:()=>isJumpStatementTarget,isKeyword:()=>isKeyword,isKeywordOrPunctuation:()=>isKeywordOrPunctuation,isKnownSymbol:()=>isKnownSymbol,isLabelName:()=>isLabelName,isLabelOfLabeledStatement:()=>isLabelOfLabeledStatement,isLabeledStatement:()=>isLabeledStatement,isLateVisibilityPaintedStatement:()=>isLateVisibilityPaintedStatement,isLeftHandSideExpression:()=>isLeftHandSideExpression,isLet:()=>isLet,isLineBreak:()=>isLineBreak,isLiteralComputedPropertyDeclarationName:()=>isLiteralComputedPropertyDeclarationName,isLiteralExpression:()=>isLiteralExpression,isLiteralExpressionOfObject:()=>isLiteralExpressionOfObject,isLiteralImportTypeNode:()=>isLiteralImportTypeNode,isLiteralKind:()=>isLiteralKind,isLiteralNameOfPropertyDeclarationOrIndexAccess:()=>isLiteralNameOfPropertyDeclarationOrIndexAccess,isLiteralTypeLiteral:()=>isLiteralTypeLiteral,isLiteralTypeNode:()=>isLiteralTypeNode,isLocalName:()=>isLocalName,isLogicalOperator:()=>isLogicalOperator,isLogicalOrCoalescingAssignmentExpression:()=>isLogicalOrCoalescingAssignmentExpression,isLogicalOrCoalescingAssignmentOperator:()=>isLogicalOrCoalescingAssignmentOperator,isLogicalOrCoalescingBinaryExpression:()=>isLogicalOrCoalescingBinaryExpression,isLogicalOrCoalescingBinaryOperator:()=>isLogicalOrCoalescingBinaryOperator,isMappedTypeNode:()=>isMappedTypeNode,isMemberName:()=>isMemberName,isMetaProperty:()=>isMetaProperty,isMethodDeclaration:()=>isMethodDeclaration,isMethodOrAccessor:()=>isMethodOrAccessor,isMethodSignature:()=>isMethodSignature,isMinusToken:()=>isMinusToken,isMissingDeclaration:()=>isMissingDeclaration,isMissingPackageJsonInfo:()=>isMissingPackageJsonInfo,isModifier:()=>isModifier,isModifierKind:()=>isModifierKind,isModifierLike:()=>isModifierLike,isModuleAugmentationExternal:()=>isModuleAugmentationExternal,isModuleBlock:()=>isModuleBlock,isModuleBody:()=>isModuleBody,isModuleDeclaration:()=>isModuleDeclaration,isModuleExportName:()=>isModuleExportName,isModuleExportsAccessExpression:()=>isModuleExportsAccessExpression,isModuleIdentifier:()=>isModuleIdentifier,isModuleName:()=>isModuleName,isModuleOrEnumDeclaration:()=>isModuleOrEnumDeclaration,isModuleReference:()=>isModuleReference,isModuleSpecifierLike:()=>isModuleSpecifierLike,isModuleWithStringLiteralName:()=>isModuleWithStringLiteralName,isNameOfFunctionDeclaration:()=>isNameOfFunctionDeclaration,isNameOfModuleDeclaration:()=>isNameOfModuleDeclaration,isNamedDeclaration:()=>isNamedDeclaration,isNamedEvaluation:()=>isNamedEvaluation,isNamedEvaluationSource:()=>isNamedEvaluationSource,isNamedExportBindings:()=>isNamedExportBindings,isNamedExports:()=>isNamedExports,isNamedImportBindings:()=>isNamedImportBindings,isNamedImports:()=>isNamedImports,isNamedImportsOrExports:()=>isNamedImportsOrExports,isNamedTupleMember:()=>isNamedTupleMember,isNamespaceBody:()=>isNamespaceBody,isNamespaceExport:()=>isNamespaceExport,isNamespaceExportDeclaration:()=>isNamespaceExportDeclaration,isNamespaceImport:()=>isNamespaceImport,isNamespaceReexportDeclaration:()=>isNamespaceReexportDeclaration,isNewExpression:()=>isNewExpression,isNewExpressionTarget:()=>isNewExpressionTarget,isNewScopeNode:()=>isNewScopeNode,isNoSubstitutionTemplateLiteral:()=>isNoSubstitutionTemplateLiteral,isNodeArray:()=>isNodeArray,isNodeArrayMultiLine:()=>isNodeArrayMultiLine,isNodeDescendantOf:()=>isNodeDescendantOf,isNodeKind:()=>isNodeKind,isNodeLikeSystem:()=>isNodeLikeSystem,isNodeModulesDirectory:()=>isNodeModulesDirectory,isNodeWithPossibleHoistedDeclaration:()=>isNodeWithPossibleHoistedDeclaration,isNonContextualKeyword:()=>isNonContextualKeyword,isNonGlobalAmbientModule:()=>isNonGlobalAmbientModule,isNonNullAccess:()=>isNonNullAccess,isNonNullChain:()=>isNonNullChain,isNonNullExpression:()=>isNonNullExpression,isNonStaticMethodOrAccessorWithPrivateName:()=>isNonStaticMethodOrAccessorWithPrivateName,isNotEmittedStatement:()=>isNotEmittedStatement,isNullishCoalesce:()=>isNullishCoalesce,isNumber:()=>isNumber,isNumericLiteral:()=>isNumericLiteral,isNumericLiteralName:()=>isNumericLiteralName,isObjectBindingElementWithoutPropertyName:()=>isObjectBindingElementWithoutPropertyName,isObjectBindingOrAssignmentElement:()=>isObjectBindingOrAssignmentElement,isObjectBindingOrAssignmentPattern:()=>isObjectBindingOrAssignmentPattern,isObjectBindingPattern:()=>isObjectBindingPattern,isObjectLiteralElement:()=>isObjectLiteralElement,isObjectLiteralElementLike:()=>isObjectLiteralElementLike,isObjectLiteralExpression:()=>isObjectLiteralExpression,isObjectLiteralMethod:()=>isObjectLiteralMethod,isObjectLiteralOrClassExpressionMethodOrAccessor:()=>isObjectLiteralOrClassExpressionMethodOrAccessor,isObjectTypeDeclaration:()=>isObjectTypeDeclaration,isOmittedExpression:()=>isOmittedExpression,isOptionalChain:()=>isOptionalChain,isOptionalChainRoot:()=>isOptionalChainRoot,isOptionalDeclaration:()=>isOptionalDeclaration,isOptionalJSDocPropertyLikeTag:()=>isOptionalJSDocPropertyLikeTag,isOptionalTypeNode:()=>isOptionalTypeNode,isOuterExpression:()=>isOuterExpression,isOutermostOptionalChain:()=>isOutermostOptionalChain,isOverrideModifier:()=>isOverrideModifier,isPackageJsonInfo:()=>isPackageJsonInfo,isPackedArrayLiteral:()=>isPackedArrayLiteral,isParameter:()=>isParameter,isParameterPropertyDeclaration:()=>isParameterPropertyDeclaration,isParameterPropertyModifier:()=>isParameterPropertyModifier,isParenthesizedExpression:()=>isParenthesizedExpression,isParenthesizedTypeNode:()=>isParenthesizedTypeNode,isParseTreeNode:()=>isParseTreeNode,isPartOfParameterDeclaration:()=>isPartOfParameterDeclaration,isPartOfTypeNode:()=>isPartOfTypeNode,isPartOfTypeOnlyImportOrExportDeclaration:()=>isPartOfTypeOnlyImportOrExportDeclaration,isPartOfTypeQuery:()=>isPartOfTypeQuery,isPartiallyEmittedExpression:()=>isPartiallyEmittedExpression,isPatternMatch:()=>isPatternMatch,isPinnedComment:()=>isPinnedComment,isPlainJsFile:()=>isPlainJsFile,isPlusToken:()=>isPlusToken,isPossiblyTypeArgumentPosition:()=>isPossiblyTypeArgumentPosition,isPostfixUnaryExpression:()=>isPostfixUnaryExpression,isPrefixUnaryExpression:()=>isPrefixUnaryExpression,isPrimitiveLiteralValue:()=>isPrimitiveLiteralValue,isPrivateIdentifier:()=>isPrivateIdentifier,isPrivateIdentifierClassElementDeclaration:()=>isPrivateIdentifierClassElementDeclaration,isPrivateIdentifierPropertyAccessExpression:()=>isPrivateIdentifierPropertyAccessExpression,isPrivateIdentifierSymbol:()=>isPrivateIdentifierSymbol,isProgramUptoDate:()=>isProgramUptoDate,isPrologueDirective:()=>isPrologueDirective,isPropertyAccessChain:()=>isPropertyAccessChain,isPropertyAccessEntityNameExpression:()=>isPropertyAccessEntityNameExpression,isPropertyAccessExpression:()=>isPropertyAccessExpression,isPropertyAccessOrQualifiedName:()=>isPropertyAccessOrQualifiedName,isPropertyAccessOrQualifiedNameOrImportTypeNode:()=>isPropertyAccessOrQualifiedNameOrImportTypeNode,isPropertyAssignment:()=>isPropertyAssignment,isPropertyDeclaration:()=>isPropertyDeclaration,isPropertyName:()=>isPropertyName,isPropertyNameLiteral:()=>isPropertyNameLiteral,isPropertySignature:()=>isPropertySignature,isPrototypeAccess:()=>isPrototypeAccess,isPrototypePropertyAssignment:()=>isPrototypePropertyAssignment,isPunctuation:()=>isPunctuation,isPushOrUnshiftIdentifier:()=>isPushOrUnshiftIdentifier,isQualifiedName:()=>isQualifiedName,isQuestionDotToken:()=>isQuestionDotToken,isQuestionOrExclamationToken:()=>isQuestionOrExclamationToken,isQuestionOrPlusOrMinusToken:()=>isQuestionOrPlusOrMinusToken,isQuestionToken:()=>isQuestionToken,isReadonlyKeyword:()=>isReadonlyKeyword,isReadonlyKeywordOrPlusOrMinusToken:()=>isReadonlyKeywordOrPlusOrMinusToken,isRecognizedTripleSlashComment:()=>isRecognizedTripleSlashComment,isReferenceFileLocation:()=>isReferenceFileLocation,isReferencedFile:()=>isReferencedFile,isRegularExpressionLiteral:()=>isRegularExpressionLiteral,isRequireCall:()=>isRequireCall,isRequireVariableStatement:()=>isRequireVariableStatement,isRestParameter:()=>isRestParameter,isRestTypeNode:()=>isRestTypeNode,isReturnStatement:()=>isReturnStatement,isReturnStatementWithFixablePromiseHandler:()=>isReturnStatementWithFixablePromiseHandler,isRightSideOfAccessExpression:()=>isRightSideOfAccessExpression,isRightSideOfInstanceofExpression:()=>isRightSideOfInstanceofExpression,isRightSideOfPropertyAccess:()=>isRightSideOfPropertyAccess,isRightSideOfQualifiedName:()=>isRightSideOfQualifiedName,isRightSideOfQualifiedNameOrPropertyAccess:()=>isRightSideOfQualifiedNameOrPropertyAccess,isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName:()=>isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName,isRootedDiskPath:()=>isRootedDiskPath,isSameEntityName:()=>isSameEntityName,isSatisfiesExpression:()=>isSatisfiesExpression,isSemicolonClassElement:()=>isSemicolonClassElement,isSetAccessor:()=>isSetAccessor,isSetAccessorDeclaration:()=>isSetAccessorDeclaration,isShiftOperatorOrHigher:()=>isShiftOperatorOrHigher,isShorthandAmbientModuleSymbol:()=>isShorthandAmbientModuleSymbol,isShorthandPropertyAssignment:()=>isShorthandPropertyAssignment,isSideEffectImport:()=>isSideEffectImport,isSignedNumericLiteral:()=>isSignedNumericLiteral,isSimpleCopiableExpression:()=>isSimpleCopiableExpression,isSimpleInlineableExpression:()=>isSimpleInlineableExpression,isSimpleParameterList:()=>isSimpleParameterList,isSingleOrDoubleQuote:()=>isSingleOrDoubleQuote,isSolutionConfig:()=>isSolutionConfig,isSourceElement:()=>isSourceElement,isSourceFile:()=>isSourceFile,isSourceFileFromLibrary:()=>isSourceFileFromLibrary,isSourceFileJS:()=>isSourceFileJS,isSourceFileNotJson:()=>isSourceFileNotJson,isSourceMapping:()=>isSourceMapping,isSpecialPropertyDeclaration:()=>isSpecialPropertyDeclaration,isSpreadAssignment:()=>isSpreadAssignment,isSpreadElement:()=>isSpreadElement,isStatement:()=>isStatement,isStatementButNotDeclaration:()=>isStatementButNotDeclaration,isStatementOrBlock:()=>isStatementOrBlock,isStatementWithLocals:()=>isStatementWithLocals,isStatic:()=>isStatic,isStaticModifier:()=>isStaticModifier,isString:()=>isString,isStringANonContextualKeyword:()=>isStringANonContextualKeyword,isStringAndEmptyAnonymousObjectIntersection:()=>isStringAndEmptyAnonymousObjectIntersection,isStringDoubleQuoted:()=>isStringDoubleQuoted,isStringLiteral:()=>isStringLiteral,isStringLiteralLike:()=>isStringLiteralLike,isStringLiteralOrJsxExpression:()=>isStringLiteralOrJsxExpression,isStringLiteralOrTemplate:()=>isStringLiteralOrTemplate,isStringOrNumericLiteralLike:()=>isStringOrNumericLiteralLike,isStringOrRegularExpressionOrTemplateLiteral:()=>isStringOrRegularExpressionOrTemplateLiteral,isStringTextContainingNode:()=>isStringTextContainingNode,isSuperCall:()=>isSuperCall,isSuperKeyword:()=>isSuperKeyword,isSuperProperty:()=>isSuperProperty,isSupportedSourceFileName:()=>isSupportedSourceFileName,isSwitchStatement:()=>isSwitchStatement,isSyntaxList:()=>isSyntaxList,isSyntheticExpression:()=>isSyntheticExpression,isSyntheticReference:()=>isSyntheticReference,isTagName:()=>isTagName,isTaggedTemplateExpression:()=>isTaggedTemplateExpression,isTaggedTemplateTag:()=>isTaggedTemplateTag,isTemplateExpression:()=>isTemplateExpression,isTemplateHead:()=>isTemplateHead,isTemplateLiteral:()=>isTemplateLiteral,isTemplateLiteralKind:()=>isTemplateLiteralKind,isTemplateLiteralToken:()=>isTemplateLiteralToken,isTemplateLiteralTypeNode:()=>isTemplateLiteralTypeNode,isTemplateLiteralTypeSpan:()=>isTemplateLiteralTypeSpan,isTemplateMiddle:()=>isTemplateMiddle,isTemplateMiddleOrTemplateTail:()=>isTemplateMiddleOrTemplateTail,isTemplateSpan:()=>isTemplateSpan,isTemplateTail:()=>isTemplateTail,isTextWhiteSpaceLike:()=>isTextWhiteSpaceLike,isThis:()=>isThis,isThisContainerOrFunctionBlock:()=>isThisContainerOrFunctionBlock,isThisIdentifier:()=>isThisIdentifier,isThisInTypeQuery:()=>isThisInTypeQuery,isThisInitializedDeclaration:()=>isThisInitializedDeclaration,isThisInitializedObjectBindingExpression:()=>isThisInitializedObjectBindingExpression,isThisProperty:()=>isThisProperty,isThisTypeNode:()=>isThisTypeNode,isThisTypeParameter:()=>isThisTypeParameter,isThisTypePredicate:()=>isThisTypePredicate,isThrowStatement:()=>isThrowStatement,isToken:()=>isToken,isTokenKind:()=>isTokenKind,isTraceEnabled:()=>isTraceEnabled,isTransientSymbol:()=>isTransientSymbol,isTrivia:()=>isTrivia,isTryStatement:()=>isTryStatement,isTupleTypeNode:()=>isTupleTypeNode,isTypeAlias:()=>isTypeAlias,isTypeAliasDeclaration:()=>isTypeAliasDeclaration,isTypeAssertionExpression:()=>isTypeAssertionExpression,isTypeDeclaration:()=>isTypeDeclaration,isTypeElement:()=>isTypeElement,isTypeKeyword:()=>isTypeKeyword,isTypeKeywordTokenOrIdentifier:()=>isTypeKeywordTokenOrIdentifier,isTypeLiteralNode:()=>isTypeLiteralNode,isTypeNode:()=>isTypeNode,isTypeNodeKind:()=>isTypeNodeKind,isTypeOfExpression:()=>isTypeOfExpression,isTypeOnlyExportDeclaration:()=>isTypeOnlyExportDeclaration,isTypeOnlyImportDeclaration:()=>isTypeOnlyImportDeclaration,isTypeOnlyImportOrExportDeclaration:()=>isTypeOnlyImportOrExportDeclaration,isTypeOperatorNode:()=>isTypeOperatorNode,isTypeParameterDeclaration:()=>isTypeParameterDeclaration,isTypePredicateNode:()=>isTypePredicateNode,isTypeQueryNode:()=>isTypeQueryNode,isTypeReferenceNode:()=>isTypeReferenceNode,isTypeReferenceType:()=>isTypeReferenceType,isTypeUsableAsPropertyName:()=>isTypeUsableAsPropertyName,isUMDExportSymbol:()=>isUMDExportSymbol,isUnaryExpression:()=>isUnaryExpression,isUnaryExpressionWithWrite:()=>isUnaryExpressionWithWrite,isUnicodeIdentifierStart:()=>isUnicodeIdentifierStart,isUnionTypeNode:()=>isUnionTypeNode,isUrl:()=>isUrl,isValidBigIntString:()=>isValidBigIntString,isValidESSymbolDeclaration:()=>isValidESSymbolDeclaration,isValidTypeOnlyAliasUseSite:()=>isValidTypeOnlyAliasUseSite,isValueSignatureDeclaration:()=>isValueSignatureDeclaration,isVarAwaitUsing:()=>isVarAwaitUsing,isVarConst:()=>isVarConst,isVarConstLike:()=>isVarConstLike,isVarUsing:()=>isVarUsing,isVariableDeclaration:()=>isVariableDeclaration,isVariableDeclarationInVariableStatement:()=>isVariableDeclarationInVariableStatement,isVariableDeclarationInitializedToBareOrAccessedRequire:()=>isVariableDeclarationInitializedToBareOrAccessedRequire,isVariableDeclarationInitializedToRequire:()=>isVariableDeclarationInitializedToRequire,isVariableDeclarationList:()=>isVariableDeclarationList,isVariableLike:()=>isVariableLike,isVariableStatement:()=>isVariableStatement,isVoidExpression:()=>isVoidExpression,isWatchSet:()=>isWatchSet,isWhileStatement:()=>isWhileStatement,isWhiteSpaceLike:()=>isWhiteSpaceLike,isWhiteSpaceSingleLine:()=>isWhiteSpaceSingleLine,isWithStatement:()=>isWithStatement,isWriteAccess:()=>isWriteAccess,isWriteOnlyAccess:()=>isWriteOnlyAccess,isYieldExpression:()=>isYieldExpression,jsxModeNeedsExplicitImport:()=>jsxModeNeedsExplicitImport,keywordPart:()=>keywordPart,last:()=>last,lastOrUndefined:()=>lastOrUndefined,length:()=>length,libMap:()=>Ki,libs:()=>Gi,lineBreakPart:()=>lineBreakPart,loadModuleFromGlobalCache:()=>loadModuleFromGlobalCache,loadWithModeAwareCache:()=>loadWithModeAwareCache,makeIdentifierFromModuleName:()=>makeIdentifierFromModuleName,makeImport:()=>makeImport,makeStringLiteral:()=>makeStringLiteral,mangleScopedPackageName:()=>mangleScopedPackageName,map:()=>map,mapAllOrFail:()=>mapAllOrFail,mapDefined:()=>mapDefined,mapDefinedIterator:()=>mapDefinedIterator,mapEntries:()=>mapEntries,mapIterator:()=>mapIterator,mapOneOrMany:()=>mapOneOrMany,mapToDisplayParts:()=>mapToDisplayParts,matchFiles:()=>matchFiles,matchPatternOrExact:()=>matchPatternOrExact,matchedText:()=>matchedText,matchesExclude:()=>matchesExclude,matchesExcludeWorker:()=>matchesExcludeWorker,maxBy:()=>maxBy,maybeBind:()=>maybeBind,maybeSetLocalizedDiagnosticMessages:()=>maybeSetLocalizedDiagnosticMessages,memoize:()=>memoize,memoizeOne:()=>memoizeOne,min:()=>min,minAndMax:()=>minAndMax,missingFileModifiedTime:()=>vt,modifierToFlag:()=>modifierToFlag,modifiersToFlags:()=>modifiersToFlags,moduleExportNameIsDefault:()=>moduleExportNameIsDefault,moduleExportNameTextEscaped:()=>moduleExportNameTextEscaped,moduleExportNameTextUnescaped:()=>moduleExportNameTextUnescaped,moduleOptionDeclaration:()=>Yi,moduleResolutionIsEqualTo:()=>moduleResolutionIsEqualTo,moduleResolutionNameAndModeGetter:()=>Va,moduleResolutionOptionDeclarations:()=>io,moduleResolutionSupportsPackageJsonExportsAndImports:()=>moduleResolutionSupportsPackageJsonExportsAndImports,moduleResolutionUsesNodeModules:()=>moduleResolutionUsesNodeModules,moduleSpecifierToValidIdentifier:()=>moduleSpecifierToValidIdentifier,moduleSpecifiers:()=>Ho,moduleSupportsImportAttributes:()=>moduleSupportsImportAttributes,moduleSymbolToValidIdentifier:()=>moduleSymbolToValidIdentifier,moveEmitHelpers:()=>moveEmitHelpers,moveRangeEnd:()=>moveRangeEnd,moveRangePastDecorators:()=>moveRangePastDecorators,moveRangePastModifiers:()=>moveRangePastModifiers,moveRangePos:()=>moveRangePos,moveSyntheticComments:()=>moveSyntheticComments,mutateMap:()=>mutateMap,mutateMapSkippingNewValues:()=>mutateMapSkippingNewValues,needsParentheses:()=>needsParentheses,needsScopeMarker:()=>needsScopeMarker,newCaseClauseTracker:()=>newCaseClauseTracker,newPrivateEnvironment:()=>newPrivateEnvironment,noEmitNotification:()=>noEmitNotification,noEmitSubstitution:()=>noEmitSubstitution,noTransformers:()=>Na,noTruncationMaximumTruncationLength:()=>dn,nodeCanBeDecorated:()=>nodeCanBeDecorated,nodeCoreModules:()=>Or,nodeHasName:()=>nodeHasName,nodeIsDecorated:()=>nodeIsDecorated,nodeIsMissing:()=>nodeIsMissing,nodeIsPresent:()=>nodeIsPresent,nodeIsSynthesized:()=>nodeIsSynthesized,nodeModuleNameResolver:()=>nodeModuleNameResolver,nodeModulesPathPart:()=>Wo,nodeNextJsonConfigResolver:()=>nodeNextJsonConfigResolver,nodeOrChildIsDecorated:()=>nodeOrChildIsDecorated,nodeOverlapsWithStartEnd:()=>nodeOverlapsWithStartEnd,nodePosToString:()=>nodePosToString,nodeSeenTracker:()=>nodeSeenTracker,nodeStartsNewLexicalEnvironment:()=>nodeStartsNewLexicalEnvironment,noop:()=>noop,noopFileWatcher:()=>ts,normalizePath:()=>normalizePath,normalizeSlashes:()=>normalizeSlashes,normalizeSpans:()=>normalizeSpans,not:()=>not,notImplemented:()=>notImplemented,notImplementedResolver:()=>Pa,nullNodeConverters:()=>Lr,nullParenthesizerRules:()=>wr,nullTransformationContext:()=>ka,objectAllocator:()=>Rn,operatorPart:()=>operatorPart,optionDeclarations:()=>eo,optionMapToObject:()=>optionMapToObject,optionsAffectingProgramStructure:()=>ao,optionsForBuild:()=>fo,optionsForWatch:()=>$i,optionsHaveChanges:()=>optionsHaveChanges,or:()=>or,orderedRemoveItem:()=>orderedRemoveItem,orderedRemoveItemAt:()=>orderedRemoveItemAt,packageIdToPackageName:()=>packageIdToPackageName,packageIdToString:()=>packageIdToString,parameterIsThisKeyword:()=>parameterIsThisKeyword,parameterNamePart:()=>parameterNamePart,parseBaseNodeFactory:()=>Oi,parseBigInt:()=>parseBigInt,parseBuildCommand:()=>parseBuildCommand,parseCommandLine:()=>parseCommandLine,parseCommandLineWorker:()=>parseCommandLineWorker,parseConfigFileTextToJson:()=>parseConfigFileTextToJson,parseConfigFileWithSystem:()=>parseConfigFileWithSystem,parseConfigHostFromCompilerHostLike:()=>parseConfigHostFromCompilerHostLike,parseCustomTypeOption:()=>parseCustomTypeOption,parseIsolatedEntityName:()=>parseIsolatedEntityName,parseIsolatedJSDocComment:()=>parseIsolatedJSDocComment,parseJSDocTypeExpressionForTests:()=>parseJSDocTypeExpressionForTests,parseJsonConfigFileContent:()=>parseJsonConfigFileContent,parseJsonSourceFileConfigFileContent:()=>parseJsonSourceFileConfigFileContent,parseJsonText:()=>parseJsonText,parseListTypeOption:()=>parseListTypeOption,parseNodeFactory:()=>wi,parseNodeModuleFromPath:()=>parseNodeModuleFromPath,parsePackageName:()=>parsePackageName,parsePseudoBigInt:()=>parsePseudoBigInt,parseValidBigInt:()=>parseValidBigInt,pasteEdits:()=>Mm,patchWriteFileEnsuringDirectory:()=>patchWriteFileEnsuringDirectory,pathContainsNodeModules:()=>pathContainsNodeModules,pathIsAbsolute:()=>pathIsAbsolute,pathIsBareSpecifier:()=>pathIsBareSpecifier,pathIsRelative:()=>pathIsRelative,patternText:()=>patternText,performIncrementalCompilation:()=>performIncrementalCompilation,performance:()=>B,positionBelongsToNode:()=>positionBelongsToNode,positionIsASICandidate:()=>positionIsASICandidate,positionIsSynthesized:()=>positionIsSynthesized,positionsAreOnSameLine:()=>positionsAreOnSameLine,preProcessFile:()=>preProcessFile,probablyUsesSemicolons:()=>probablyUsesSemicolons,processCommentPragmas:()=>processCommentPragmas,processPragmasIntoFields:()=>processPragmasIntoFields,processTaggedTemplateExpression:()=>processTaggedTemplateExpression,programContainsEsModules:()=>programContainsEsModules,programContainsModules:()=>programContainsModules,projectReferenceIsEqualTo:()=>projectReferenceIsEqualTo,propertyNamePart:()=>propertyNamePart,pseudoBigIntToString:()=>pseudoBigIntToString,punctuationPart:()=>punctuationPart,pushIfUnique:()=>pushIfUnique,quote:()=>quote,quotePreferenceFromString:()=>quotePreferenceFromString,rangeContainsPosition:()=>rangeContainsPosition,rangeContainsPositionExclusive:()=>rangeContainsPositionExclusive,rangeContainsRange:()=>rangeContainsRange,rangeContainsRangeExclusive:()=>rangeContainsRangeExclusive,rangeContainsStartEnd:()=>rangeContainsStartEnd,rangeEndIsOnSameLineAsRangeStart:()=>rangeEndIsOnSameLineAsRangeStart,rangeEndPositionsAreOnSameLine:()=>rangeEndPositionsAreOnSameLine,rangeEquals:()=>rangeEquals,rangeIsOnSingleLine:()=>rangeIsOnSingleLine,rangeOfNode:()=>rangeOfNode,rangeOfTypeParameters:()=>rangeOfTypeParameters,rangeOverlapsWithStartEnd:()=>rangeOverlapsWithStartEnd,rangeStartIsOnSameLineAsRangeEnd:()=>rangeStartIsOnSameLineAsRangeEnd,rangeStartPositionsAreOnSameLine:()=>rangeStartPositionsAreOnSameLine,readBuilderProgram:()=>readBuilderProgram,readConfigFile:()=>readConfigFile,readJson:()=>readJson,readJsonConfigFile:()=>readJsonConfigFile,readJsonOrUndefined:()=>readJsonOrUndefined,reduceEachLeadingCommentRange:()=>reduceEachLeadingCommentRange,reduceEachTrailingCommentRange:()=>reduceEachTrailingCommentRange,reduceLeft:()=>reduceLeft,reduceLeftIterator:()=>reduceLeftIterator,reducePathComponents:()=>reducePathComponents,refactor:()=>Nc,regExpEscape:()=>regExpEscape,regularExpressionFlagToCharacterCode:()=>regularExpressionFlagToCharacterCode,relativeComplement:()=>relativeComplement,removeAllComments:()=>removeAllComments,removeEmitHelper:()=>removeEmitHelper,removeExtension:()=>removeExtension,removeFileExtension:()=>removeFileExtension,removeIgnoredPath:()=>removeIgnoredPath,removeMinAndVersionNumbers:()=>removeMinAndVersionNumbers,removePrefix:()=>removePrefix,removeSuffix:()=>removeSuffix,removeTrailingDirectorySeparator:()=>removeTrailingDirectorySeparator,repeatString:()=>repeatString,replaceElement:()=>replaceElement,replaceFirstStar:()=>replaceFirstStar,resolutionExtensionIsTSOrJson:()=>resolutionExtensionIsTSOrJson,resolveConfigFileProjectName:()=>resolveConfigFileProjectName,resolveJSModule:()=>resolveJSModule,resolveLibrary:()=>resolveLibrary,resolveModuleName:()=>resolveModuleName,resolveModuleNameFromCache:()=>resolveModuleNameFromCache,resolvePackageNameToPackageJson:()=>resolvePackageNameToPackageJson,resolvePath:()=>resolvePath,resolveProjectReferencePath:()=>resolveProjectReferencePath,resolveTripleslashReference:()=>resolveTripleslashReference,resolveTypeReferenceDirective:()=>resolveTypeReferenceDirective,resolvingEmptyArray:()=>sn,returnFalse:()=>returnFalse,returnNoopFileWatcher:()=>returnNoopFileWatcher,returnTrue:()=>returnTrue,returnUndefined:()=>returnUndefined,returnsPromise:()=>returnsPromise,rewriteModuleSpecifier:()=>rewriteModuleSpecifier,sameFlatMap:()=>sameFlatMap,sameMap:()=>sameMap,sameMapping:()=>sameMapping,scanTokenAtPosition:()=>scanTokenAtPosition,scanner:()=>Gs,semanticDiagnosticsOptionDeclarations:()=>to,serializeCompilerOptions:()=>serializeCompilerOptions,server:()=>Wm,servicesVersion:()=>Rl,setCommentRange:()=>setCommentRange,setConfigFileInOptions:()=>setConfigFileInOptions,setConstantValue:()=>setConstantValue,setEmitFlags:()=>setEmitFlags,setGetSourceFileAsHashVersioned:()=>setGetSourceFileAsHashVersioned,setIdentifierAutoGenerate:()=>setIdentifierAutoGenerate,setIdentifierGeneratedImportReference:()=>setIdentifierGeneratedImportReference,setIdentifierTypeArguments:()=>setIdentifierTypeArguments,setInternalEmitFlags:()=>setInternalEmitFlags,setLocalizedDiagnosticMessages:()=>setLocalizedDiagnosticMessages,setNodeChildren:()=>setNodeChildren,setNodeFlags:()=>setNodeFlags,setObjectAllocator:()=>setObjectAllocator,setOriginalNode:()=>setOriginalNode,setParent:()=>setParent,setParentRecursive:()=>setParentRecursive,setPrivateIdentifier:()=>setPrivateIdentifier,setSnippetElement:()=>setSnippetElement,setSourceMapRange:()=>setSourceMapRange,setStackTraceLimit:()=>setStackTraceLimit,setStartsOnNewLine:()=>setStartsOnNewLine,setSyntheticLeadingComments:()=>setSyntheticLeadingComments,setSyntheticTrailingComments:()=>setSyntheticTrailingComments,setSys:()=>setSys,setSysLog:()=>setSysLog,setTextRange:()=>setTextRange,setTextRangeEnd:()=>setTextRangeEnd,setTextRangePos:()=>setTextRangePos,setTextRangePosEnd:()=>setTextRangePosEnd,setTextRangePosWidth:()=>setTextRangePosWidth,setTokenSourceMapRange:()=>setTokenSourceMapRange,setTypeNode:()=>setTypeNode,setUILocale:()=>setUILocale,setValueDeclaration:()=>setValueDeclaration,shouldAllowImportingTsExtension:()=>shouldAllowImportingTsExtension,shouldPreserveConstEnums:()=>er,shouldRewriteModuleSpecifier:()=>shouldRewriteModuleSpecifier,shouldUseUriStyleNodeCoreModules:()=>shouldUseUriStyleNodeCoreModules,showModuleSpecifier:()=>showModuleSpecifier,signatureHasRestParameter:()=>signatureHasRestParameter,signatureToDisplayParts:()=>signatureToDisplayParts,single:()=>single,singleElementArray:()=>singleElementArray,singleIterator:()=>singleIterator,singleOrMany:()=>singleOrMany,singleOrUndefined:()=>singleOrUndefined,skipAlias:()=>skipAlias,skipConstraint:()=>skipConstraint,skipOuterExpressions:()=>skipOuterExpressions,skipParentheses:()=>skipParentheses,skipPartiallyEmittedExpressions:()=>skipPartiallyEmittedExpressions,skipTrivia:()=>skipTrivia,skipTypeChecking:()=>skipTypeChecking,skipTypeCheckingIgnoringNoCheck:()=>skipTypeCheckingIgnoringNoCheck,skipTypeParentheses:()=>skipTypeParentheses,skipWhile:()=>skipWhile,sliceAfter:()=>sliceAfter,some:()=>some,sortAndDeduplicate:()=>sortAndDeduplicate,sortAndDeduplicateDiagnostics:()=>sortAndDeduplicateDiagnostics,sourceFileAffectingCompilerOptions:()=>oo,sourceFileMayBeEmitted:()=>sourceFileMayBeEmitted,sourceMapCommentRegExp:()=>ma,sourceMapCommentRegExpDontCareLineStart:()=>fa,spacePart:()=>spacePart,spanMap:()=>spanMap,startEndContainsRange:()=>startEndContainsRange,startEndOverlapsWithStartEnd:()=>startEndOverlapsWithStartEnd,startOnNewLine:()=>startOnNewLine,startTracing:()=>$,startsWith:()=>startsWith,startsWithDirectory:()=>startsWithDirectory,startsWithUnderscore:()=>startsWithUnderscore,startsWithUseStrict:()=>startsWithUseStrict,stringContainsAt:()=>stringContainsAt,stringToToken:()=>stringToToken,stripQuotes:()=>stripQuotes,supportedDeclarationExtensions:()=>xr,supportedJSExtensionsFlat:()=>Tr,supportedLocaleDirectories:()=>on,supportedTSExtensionsFlat:()=>_r,supportedTSImplementationExtensions:()=>br,suppressLeadingAndTrailingTrivia:()=>suppressLeadingAndTrailingTrivia,suppressLeadingTrivia:()=>suppressLeadingTrivia,suppressTrailingTrivia:()=>suppressTrailingTrivia,symbolEscapedNameNoDefault:()=>symbolEscapedNameNoDefault,symbolName:()=>symbolName,symbolNameNoDefault:()=>symbolNameNoDefault,symbolToDisplayParts:()=>symbolToDisplayParts,sys:()=>Ft,sysLog:()=>sysLog,tagNamesAreEquivalent:()=>tagNamesAreEquivalent,takeWhile:()=>takeWhile,targetOptionDeclaration:()=>Xi,targetToLibMap:()=>nn,testFormatSettings:()=>Ms,textChangeRangeIsUnchanged:()=>textChangeRangeIsUnchanged,textChangeRangeNewSpan:()=>textChangeRangeNewSpan,textChanges:()=>dm,textOrKeywordPart:()=>textOrKeywordPart,textPart:()=>textPart,textRangeContainsPositionInclusive:()=>textRangeContainsPositionInclusive,textRangeContainsTextSpan:()=>textRangeContainsTextSpan,textRangeIntersectsWithTextSpan:()=>textRangeIntersectsWithTextSpan,textSpanContainsPosition:()=>textSpanContainsPosition,textSpanContainsTextRange:()=>textSpanContainsTextRange,textSpanContainsTextSpan:()=>textSpanContainsTextSpan,textSpanEnd:()=>textSpanEnd,textSpanIntersection:()=>textSpanIntersection,textSpanIntersectsWith:()=>textSpanIntersectsWith,textSpanIntersectsWithPosition:()=>textSpanIntersectsWithPosition,textSpanIntersectsWithTextSpan:()=>textSpanIntersectsWithTextSpan,textSpanIsEmpty:()=>textSpanIsEmpty,textSpanOverlap:()=>textSpanOverlap,textSpanOverlapsWith:()=>textSpanOverlapsWith,textSpansEqual:()=>textSpansEqual,textToKeywordObj:()=>Lt,timestamp:()=>R,toArray:()=>toArray,toBuilderFileEmit:()=>toBuilderFileEmit,toBuilderStateFileInfoForMultiEmit:()=>toBuilderStateFileInfoForMultiEmit,toEditorSettings:()=>toEditorSettings,toFileNameLowerCase:()=>toFileNameLowerCase,toPath:()=>toPath,toProgramEmitPending:()=>toProgramEmitPending,toSorted:()=>toSorted,tokenIsIdentifierOrKeyword:()=>tokenIsIdentifierOrKeyword,tokenIsIdentifierOrKeywordOrGreaterThan:()=>tokenIsIdentifierOrKeywordOrGreaterThan,tokenToString:()=>tokenToString,trace:()=>trace,tracing:()=>G,tracingEnabled:()=>K,transferSourceFileChildren:()=>transferSourceFileChildren,transform:()=>transform,transformClassFields:()=>transformClassFields,transformDeclarations:()=>transformDeclarations,transformECMAScriptModule:()=>transformECMAScriptModule,transformES2015:()=>transformES2015,transformES2016:()=>transformES2016,transformES2017:()=>transformES2017,transformES2018:()=>transformES2018,transformES2019:()=>transformES2019,transformES2020:()=>transformES2020,transformES2021:()=>transformES2021,transformESDecorators:()=>transformESDecorators,transformESNext:()=>transformESNext,transformGenerators:()=>transformGenerators,transformImpliedNodeFormatDependentModule:()=>transformImpliedNodeFormatDependentModule,transformJsx:()=>transformJsx,transformLegacyDecorators:()=>transformLegacyDecorators,transformModule:()=>transformModule,transformNamedEvaluation:()=>transformNamedEvaluation,transformNodes:()=>transformNodes,transformSystemModule:()=>transformSystemModule,transformTypeScript:()=>transformTypeScript,transpile:()=>transpile,transpileDeclaration:()=>transpileDeclaration,transpileModule:()=>transpileModule,transpileOptionValueCompilerOptions:()=>so,tryAddToSet:()=>tryAddToSet,tryAndIgnoreErrors:()=>tryAndIgnoreErrors,tryCast:()=>tryCast,tryDirectoryExists:()=>tryDirectoryExists,tryExtractTSExtension:()=>tryExtractTSExtension,tryFileExists:()=>tryFileExists,tryGetClassExtendingExpressionWithTypeArguments:()=>tryGetClassExtendingExpressionWithTypeArguments,tryGetClassImplementingOrExtendingExpressionWithTypeArguments:()=>tryGetClassImplementingOrExtendingExpressionWithTypeArguments,tryGetDirectories:()=>tryGetDirectories,tryGetExtensionFromPath:()=>tryGetExtensionFromPath2,tryGetImportFromModuleSpecifier:()=>tryGetImportFromModuleSpecifier,tryGetJSDocSatisfiesTypeNode:()=>tryGetJSDocSatisfiesTypeNode,tryGetModuleNameFromFile:()=>tryGetModuleNameFromFile,tryGetModuleSpecifierFromDeclaration:()=>tryGetModuleSpecifierFromDeclaration,tryGetNativePerformanceHooks:()=>tryGetNativePerformanceHooks,tryGetPropertyAccessOrIdentifierToString:()=>tryGetPropertyAccessOrIdentifierToString,tryGetPropertyNameOfBindingOrAssignmentElement:()=>tryGetPropertyNameOfBindingOrAssignmentElement,tryGetSourceMappingURL:()=>tryGetSourceMappingURL,tryGetTextOfPropertyName:()=>tryGetTextOfPropertyName,tryParseJson:()=>tryParseJson,tryParsePattern:()=>tryParsePattern,tryParsePatterns:()=>tryParsePatterns,tryParseRawSourceMap:()=>tryParseRawSourceMap,tryReadDirectory:()=>tryReadDirectory,tryReadFile:()=>tryReadFile,tryRemoveDirectoryPrefix:()=>tryRemoveDirectoryPrefix,tryRemoveExtension:()=>tryRemoveExtension,tryRemovePrefix:()=>tryRemovePrefix,tryRemoveSuffix:()=>tryRemoveSuffix,tscBuildOption:()=>uo,typeAcquisitionDeclarations:()=>_o,typeAliasNamePart:()=>typeAliasNamePart,typeDirectiveIsEqualTo:()=>typeDirectiveIsEqualTo,typeKeywords:()=>Qs,typeParameterNamePart:()=>typeParameterNamePart,typeToDisplayParts:()=>typeToDisplayParts,unchangedPollThresholds:()=>Ct,unchangedTextChangeRange:()=>rn,unescapeLeadingUnderscores:()=>unescapeLeadingUnderscores,unmangleScopedPackageName:()=>unmangleScopedPackageName,unorderedRemoveItem:()=>unorderedRemoveItem,unprefixedNodeCoreModules:()=>Ir,unreachableCodeIsError:()=>unreachableCodeIsError,unsetNodeChildren:()=>unsetNodeChildren,unusedLabelIsError:()=>unusedLabelIsError,unwrapInnermostStatementOfLabel:()=>unwrapInnermostStatementOfLabel,unwrapParenthesizedExpression:()=>unwrapParenthesizedExpression,updateErrorForNoInputFiles:()=>updateErrorForNoInputFiles,updateLanguageServiceSourceFile:()=>updateLanguageServiceSourceFile,updateMissingFilePathsWatch:()=>updateMissingFilePathsWatch,updateResolutionField:()=>updateResolutionField,updateSharedExtendedConfigFileWatcher:()=>updateSharedExtendedConfigFileWatcher,updateSourceFile:()=>updateSourceFile,updateWatchingWildcardDirectories:()=>updateWatchingWildcardDirectories,usingSingleLineStringWriter:()=>usingSingleLineStringWriter,utf16EncodeAsString:()=>utf16EncodeAsString,validateLocaleAndSetLanguage:()=>validateLocaleAndSetLanguage,version:()=>c,versionMajorMinor:()=>s,visitArray:()=>visitArray,visitCommaListElements:()=>visitCommaListElements,visitEachChild:()=>visitEachChild,visitFunctionBody:()=>visitFunctionBody,visitIterationBody:()=>visitIterationBody,visitLexicalEnvironment:()=>visitLexicalEnvironment,visitNode:()=>visitNode,visitNodes:()=>visitNodes2,visitParameterList:()=>visitParameterList,walkUpBindingElementsAndPatterns:()=>walkUpBindingElementsAndPatterns,walkUpOuterExpressions:()=>walkUpOuterExpressions,walkUpParenthesizedExpressions:()=>walkUpParenthesizedExpressions,walkUpParenthesizedTypes:()=>walkUpParenthesizedTypes,walkUpParenthesizedTypesAndGetParentAndChild:()=>walkUpParenthesizedTypesAndGetParentAndChild,whitespaceOrMapCommentRegExp:()=>_a,writeCommentRange:()=>writeCommentRange,writeFile:()=>writeFile,writeFileEnsuringDirectories:()=>writeFileEnsuringDirectories,zipWith:()=>zipWith});var jm=true;var Jm;function getTypeScriptVersion(){return Jm??(Jm=new F(c))}function formatDeprecationMessage(e,t,n,r,i){let o=t?"DeprecationError: ":"DeprecationWarning: ";o+=`'${e}' `;o+=r?`has been deprecated since v${r}`:"is deprecated";o+=t?" and can no longer be used.":n?` and will no longer be usable after v${n}.`:".";o+=i?` ${formatStringFromArgs(i,[e])}`:"";return o}function createErrorDeprecation(e,t,n,r){const i=formatDeprecationMessage(e,true,t,n,r);return()=>{throw new TypeError(i)}}function createWarningDeprecation(e,t,n,r){let i=false;return()=>{if(jm&&!i){S.log.warn(formatDeprecationMessage(e,false,t,n,r));i=true}}}function createDeprecation(e,t={}){const n=typeof t.typeScriptVersion==="string"?new F(t.typeScriptVersion):t.typeScriptVersion??getTypeScriptVersion();const r=typeof t.errorAfter==="string"?new F(t.errorAfter):t.errorAfter;const i=typeof t.warnAfter==="string"?new F(t.warnAfter):t.warnAfter;const o=typeof t.since==="string"?new F(t.since):t.since??i;const a=t.error||r&&n.compareTo(r)>=0;const s=!i||n.compareTo(i)>=0;return a?createErrorDeprecation(e,r,o,t.message):s?createWarningDeprecation(e,r,o,t.message):noop}function wrapFunction(e,t){return function(){e();return t.apply(this,arguments)}}function deprecate(e,t){const n=createDeprecation((t==null?void 0:t.name)??S.getFunctionName(e),t);return wrapFunction(n,e)}function createOverload(e,t,n,r){Object.defineProperty(call,"name",{...Object.getOwnPropertyDescriptor(call,"name"),value:e});if(r){for(const n of Object.keys(r)){const i=+n;if(!isNaN(i)&&hasProperty(t,`${i}`)){t[i]=deprecate(t[i],{...r[i],name:e})}}}const i=createBinder2(t,n);return call;function call(...e){const n=i(e);const r=n!==void 0?t[n]:void 0;if(typeof r==="function"){return r(...e)}throw new TypeError("Invalid arguments")}}function createBinder2(e,t){return n=>{for(let r=0;hasProperty(e,`${r}`)&&hasProperty(t,`${r}`);r++){const e=t[r];if(e(n)){return r}}}}function buildOverload(e){return{overload:t=>({bind:n=>({finish:()=>createOverload(e,t,n),deprecate:r=>({finish:()=>createOverload(e,t,n,r)})})})}}var Wm={};__export(Wm,{ActionInvalidate:()=>fs,ActionPackageInstalled:()=>ms,ActionSet:()=>us,ActionWatchTypingLocations:()=>Ts,Arguments:()=>Ss,AutoImportProviderProject:()=>__,AuxiliaryProject:()=>f_,CharRangeSection:()=>Q_,CloseFileWatcherEvent:()=>D_,CommandNames:()=>V_,ConfigFileDiagEvent:()=>C_,ConfiguredProject:()=>g_,ConfiguredProjectLoadKind:()=>J_,CreateDirectoryWatcherEvent:()=>P_,CreateFileWatcherEvent:()=>F_,Errors:()=>Km,EventBeginInstallTypes:()=>gs,EventEndInstallTypes:()=>ys,EventInitializationFailed:()=>hs,EventTypesRegistry:()=>_s,ExternalProject:()=>y_,GcTimer:()=>Qm,InferredProject:()=>u_,LargeFileReferencedEvent:()=>b_,LineIndex:()=>ng,LineLeaf:()=>ig,LineNode:()=>rg,LogLevel:()=>qm,Msg:()=>Gm,OpenFileInfoTelemetryEvent:()=>k_,Project:()=>p_,ProjectInfoTelemetryEvent:()=>N_,ProjectKind:()=>d_,ProjectLanguageServiceStateEvent:()=>E_,ProjectLoadingFinishEvent:()=>x_,ProjectLoadingStartEvent:()=>v_,ProjectService:()=>U_,ProjectsUpdatedInBackgroundEvent:()=>S_,ScriptInfo:()=>l_,ScriptVersionCache:()=>eg,Session:()=>K_,TextStorage:()=>c_,ThrottledOperations:()=>$m,TypingsInstallerAdapter:()=>ag,allFilesAreJsOrDts:()=>allFilesAreJsOrDts,allRootFilesAreJsOrDts:()=>allRootFilesAreJsOrDts,asNormalizedPath:()=>asNormalizedPath,convertCompilerOptions:()=>convertCompilerOptions,convertFormatOptions:()=>convertFormatOptions,convertScriptKindName:()=>convertScriptKindName,convertTypeAcquisition:()=>convertTypeAcquisition,convertUserPreferences:()=>convertUserPreferences,convertWatchOptions:()=>convertWatchOptions,countEachFileTypes:()=>countEachFileTypes,createInstallTypingsRequest:()=>createInstallTypingsRequest,createModuleSpecifierCache:()=>createModuleSpecifierCache,createNormalizedPathMap:()=>createNormalizedPathMap,createPackageJsonCache:()=>createPackageJsonCache,createSortedArray:()=>createSortedArray2,emptyArray:()=>Hm,findArgument:()=>findArgument,formatDiagnosticToProtocol:()=>formatDiagnosticToProtocol,formatMessage:()=>formatMessage2,getBaseConfigFileName:()=>getBaseConfigFileName,getDetailWatchInfo:()=>getDetailWatchInfo,getLocationInNewDocument:()=>getLocationInNewDocument,hasArgument:()=>hasArgument,hasNoTypeScriptSource:()=>hasNoTypeScriptSource,indent:()=>indent2,isBackgroundProject:()=>isBackgroundProject,isConfigFile:()=>isConfigFile,isConfiguredProject:()=>isConfiguredProject,isDynamicFileName:()=>isDynamicFileName,isExternalProject:()=>isExternalProject,isInferredProject:()=>isInferredProject,isInferredProjectName:()=>isInferredProjectName,isProjectDeferredClose:()=>isProjectDeferredClose,makeAutoImportProviderProjectName:()=>makeAutoImportProviderProjectName,makeAuxiliaryProjectName:()=>makeAuxiliaryProjectName,makeInferredProjectName:()=>makeInferredProjectName,maxFileSize:()=>T_,maxProgramSizeForNonTsFiles:()=>h_,normalizedPathToPath:()=>normalizedPathToPath,nowString:()=>nowString,nullCancellationToken:()=>z_,nullTypingsInstaller:()=>B_,protocol:()=>Xm,scriptInfoIsContainedByBackgroundProject:()=>scriptInfoIsContainedByBackgroundProject,scriptInfoIsContainedByDeferredClosedProject:()=>scriptInfoIsContainedByDeferredClosedProject,stringifyIndented:()=>stringifyIndented,toEvent:()=>toEvent,toNormalizedPath:()=>toNormalizedPath,tryConvertScriptKindName:()=>tryConvertScriptKindName,typingsInstaller:()=>Um,updateProjectIfDirty:()=>updateProjectIfDirty});var Um={};__export(Um,{TypingsInstaller:()=>Vm,getNpmCommandForInstallation:()=>getNpmCommandForInstallation,installNpmPackages:()=>installNpmPackages,typingsName:()=>typingsName});var zm={isEnabled:()=>false,writeLine:noop};function typingToFileName(e,t,n,r){try{const r=resolveModuleName(t,combinePaths(e,"index.d.ts"),{moduleResolution:2},n);return r.resolvedModule&&r.resolvedModule.resolvedFileName}catch(n){if(r.isEnabled()){r.writeLine(`Failed to resolve ${t} in folder '${e}': ${n.message}`)}return void 0}}function installNpmPackages(e,t,n,r){let i=false;for(let o=n.length;o>0;){const a=getNpmCommandForInstallation(e,t,n,o);o=a.remaining;i=r(a.command)||i}return i}function getNpmCommandForInstallation(e,t,n,r){const i=n.length-r;let o,a=r;while(true){o=`${e} install --ignore-scripts ${(a===n.length?n:n.slice(i,i+a)).join(" ")} --save-dev --user-agent="typesInstaller/${t}"`;if(o.length<8e3){break}a=a-Math.floor(a/2)}return{command:o,remaining:r-a}}var Vm=class{constructor(e,t,n,r,i,o=zm){this.installTypingHost=e;this.globalCachePath=t;this.safeListPath=n;this.typesMapLocation=r;this.throttleLimit=i;this.log=o;this.packageNameToTypingLocation=new Map;this.missingTypingsSet=new Set;this.knownCachesSet=new Set;this.projectWatchers=new Map;this.pendingRunRequests=[];this.installRunCount=1;this.inFlightRequestCount=0;this.latestDistTag="latest";const a=this.log.isEnabled();if(a){this.log.writeLine(`Global cache location '${t}', safe file path '${n}', types map path ${r}`)}this.processCacheLocation(this.globalCachePath)}handleRequest(e){switch(e.kind){case"discover":this.install(e);break;case"closeProject":this.closeProject(e);break;case"typesRegistry":{const e={};this.typesRegistry.forEach(((t,n)=>{e[n]=t}));const t={kind:_s,typesRegistry:e};this.sendResponse(t);break}case"installPackage":{this.installPackage(e);break}default:S.assertNever(e)}}closeProject(e){this.closeWatchers(e.projectName)}closeWatchers(e){if(this.log.isEnabled()){this.log.writeLine(`Closing file watchers for project '${e}'`)}const t=this.projectWatchers.get(e);if(!t){if(this.log.isEnabled()){this.log.writeLine(`No watchers are registered for project '${e}'`)}return}this.projectWatchers.delete(e);this.sendResponse({kind:Ts,projectName:e,files:[]});if(this.log.isEnabled()){this.log.writeLine(`Closing file watchers for project '${e}' - done.`)}}install(e){if(this.log.isEnabled()){this.log.writeLine(`Got install request${stringifyIndented(e)}`)}if(e.cachePath){if(this.log.isEnabled()){this.log.writeLine(`Request specifies cache path '${e.cachePath}', loading cached information...`)}this.processCacheLocation(e.cachePath)}if(this.safeList===void 0){this.initializeSafeList()}const t=ps.discoverTypings(this.installTypingHost,this.log.isEnabled()?e=>this.log.writeLine(e):void 0,e.fileNames,e.projectRootPath,this.safeList,this.packageNameToTypingLocation,e.typeAcquisition,e.unresolvedImports,this.typesRegistry,e.compilerOptions);this.watchFiles(e.projectName,t.filesToWatch);if(t.newTypingNames.length){this.installTypings(e,e.cachePath||this.globalCachePath,t.cachedTypingPaths,t.newTypingNames)}else{this.sendResponse(this.createSetTypings(e,t.cachedTypingPaths));if(this.log.isEnabled()){this.log.writeLine(`No new typings were requested as a result of typings discovery`)}}}installPackage(e){const{fileName:t,packageName:n,projectName:r,projectRootPath:i,id:o}=e;const a=forEachAncestorDirectory(getDirectoryPath(t),(e=>{if(this.installTypingHost.fileExists(combinePaths(e,"package.json"))){return e}}))||i;if(a){this.installWorker(-1,[n],a,(e=>{const t=e?`Package ${n} installed.`:`There was an error installing ${n}.`;const i={kind:ms,projectName:r,id:o,success:e,message:t};this.sendResponse(i)}))}else{const e={kind:ms,projectName:r,id:o,success:false,message:"Could not determine a project root path."};this.sendResponse(e)}}initializeSafeList(){if(this.typesMapLocation){const e=ps.loadTypesMap(this.installTypingHost,this.typesMapLocation);if(e){this.log.writeLine(`Loaded safelist from types map file '${this.typesMapLocation}'`);this.safeList=e;return}this.log.writeLine(`Failed to load safelist from types map file '${this.typesMapLocation}'`)}this.safeList=ps.loadSafeList(this.installTypingHost,this.safeListPath)}processCacheLocation(e){if(this.log.isEnabled()){this.log.writeLine(`Processing cache location '${e}'`)}if(this.knownCachesSet.has(e)){if(this.log.isEnabled()){this.log.writeLine(`Cache location was already processed...`)}return}const t=combinePaths(e,"package.json");const n=combinePaths(e,"package-lock.json");if(this.log.isEnabled()){this.log.writeLine(`Trying to find '${t}'...`)}if(this.installTypingHost.fileExists(t)&&this.installTypingHost.fileExists(n)){const r=JSON.parse(this.installTypingHost.readFile(t));const i=JSON.parse(this.installTypingHost.readFile(n));if(this.log.isEnabled()){this.log.writeLine(`Loaded content of '${t}':${stringifyIndented(r)}`);this.log.writeLine(`Loaded content of '${n}':${stringifyIndented(i)}`)}if(r.devDependencies&&i.dependencies){for(const t in r.devDependencies){if(!hasProperty(i.dependencies,t)){continue}const n=getBaseFileName(t);if(!n){continue}const r=typingToFileName(e,n,this.installTypingHost,this.log);if(!r){this.missingTypingsSet.add(n);continue}const o=this.packageNameToTypingLocation.get(n);if(o){if(o.typingLocation===r){continue}if(this.log.isEnabled()){this.log.writeLine(`New typing for package ${n} from '${r}' conflicts with existing typing file '${o}'`)}}if(this.log.isEnabled()){this.log.writeLine(`Adding entry into typings cache: '${n}' => '${r}'`)}const a=getProperty(i.dependencies,t);const s=a&&a.version;if(!s){continue}const c={typingLocation:r,version:new F(s)};this.packageNameToTypingLocation.set(n,c)}}}if(this.log.isEnabled()){this.log.writeLine(`Finished processing cache location '${e}'`)}this.knownCachesSet.add(e)}filterTypings(e){return mapDefined(e,(e=>{const t=mangleScopedPackageName(e);if(this.missingTypingsSet.has(t)){if(this.log.isEnabled())this.log.writeLine(`'${e}':: '${t}' is in missingTypingsSet - skipping...`);return void 0}const n=ps.validatePackageName(e);if(n!==ps.NameValidationResult.Ok){this.missingTypingsSet.add(t);if(this.log.isEnabled())this.log.writeLine(ps.renderPackageNameValidationFailure(n,e));return void 0}if(!this.typesRegistry.has(t)){if(this.log.isEnabled())this.log.writeLine(`'${e}':: Entry for package '${t}' does not exist in local types registry - skipping...`);return void 0}if(this.packageNameToTypingLocation.get(t)&&ps.isTypingUpToDate(this.packageNameToTypingLocation.get(t),this.typesRegistry.get(t))){if(this.log.isEnabled())this.log.writeLine(`'${e}':: '${t}' already has an up-to-date typing - skipping...`);return void 0}return t}))}ensurePackageDirectoryExists(e){const t=combinePaths(e,"package.json");if(this.log.isEnabled()){this.log.writeLine(`Npm config file: ${t}`)}if(!this.installTypingHost.fileExists(t)){if(this.log.isEnabled()){this.log.writeLine(`Npm config file: '${t}' is missing, creating new one...`)}this.ensureDirectoryExists(e,this.installTypingHost);this.installTypingHost.writeFile(t,'{ "private": true }')}}installTypings(e,t,n,r){if(this.log.isEnabled()){this.log.writeLine(`Installing typings ${JSON.stringify(r)}`)}const i=this.filterTypings(r);if(i.length===0){if(this.log.isEnabled()){this.log.writeLine(`All typings are known to be missing or invalid - no need to install more typings`)}this.sendResponse(this.createSetTypings(e,n));return}this.ensurePackageDirectoryExists(t);const o=this.installRunCount;this.installRunCount++;this.sendResponse({kind:gs,eventId:o,typingsInstallerVersion:c,projectName:e.projectName});const a=i.map(typingsName);this.installTypingsAsync(o,a,t,(r=>{try{if(!r){if(this.log.isEnabled()){this.log.writeLine(`install request failed, marking packages as missing to prevent repeated requests: ${JSON.stringify(i)}`)}for(const e of i){this.missingTypingsSet.add(e)}return}if(this.log.isEnabled()){this.log.writeLine(`Installed typings ${JSON.stringify(a)}`)}const l=[];for(const e of i){const n=typingToFileName(t,e,this.installTypingHost,this.log);if(!n){this.missingTypingsSet.add(e);continue}const r=this.typesRegistry.get(e);const i=new F(r[`ts${s}`]||r[this.latestDistTag]);const o={typingLocation:n,version:i};this.packageNameToTypingLocation.set(e,o);l.push(n)}if(this.log.isEnabled()){this.log.writeLine(`Installed typing files ${JSON.stringify(l)}`)}this.sendResponse(this.createSetTypings(e,n.concat(l)))}finally{const t={kind:ys,eventId:o,projectName:e.projectName,packagesToInstall:a,installSuccess:r,typingsInstallerVersion:c};this.sendResponse(t)}}))}ensureDirectoryExists(e,t){const n=getDirectoryPath(e);if(!t.directoryExists(n)){this.ensureDirectoryExists(n,t)}if(!t.directoryExists(e)){t.createDirectory(e)}}watchFiles(e,t){if(!t.length){this.closeWatchers(e);return}const n=this.projectWatchers.get(e);const r=new Set(t);if(!n||forEachKey(r,(e=>!n.has(e)))||forEachKey(n,(e=>!r.has(e)))){this.projectWatchers.set(e,r);this.sendResponse({kind:Ts,projectName:e,files:t})}else{this.sendResponse({kind:Ts,projectName:e,files:void 0})}}createSetTypings(e,t){return{projectName:e.projectName,typeAcquisition:e.typeAcquisition,compilerOptions:e.compilerOptions,typings:t,unresolvedImports:e.unresolvedImports,kind:us}}installTypingsAsync(e,t,n,r){this.pendingRunRequests.unshift({requestId:e,packageNames:t,cwd:n,onRequestCompleted:r});this.executeWithThrottling()}executeWithThrottling(){while(this.inFlightRequestCount{this.inFlightRequestCount--;e.onRequestCompleted(t);this.executeWithThrottling()}))}}};function typingsName(e){return`@types/${e}@ts${s}`}var qm=(e=>{e[e["terse"]=0]="terse";e[e["normal"]=1]="normal";e[e["requestTime"]=2]="requestTime";e[e["verbose"]=3]="verbose";return e})(qm||{});var Hm=createSortedArray2();var Gm=(e=>{e["Err"]="Err";e["Info"]="Info";e["Perf"]="Perf";return e})(Gm||{});function createInstallTypingsRequest(e,t,n,r){return{projectName:e.getProjectName(),fileNames:e.getFileNames(true,true).concat(e.getExcludedFiles()),compilerOptions:e.getCompilationSettings(),typeAcquisition:t,unresolvedImports:n,projectRootPath:e.getCurrentDirectory(),cachePath:r,kind:"discover"}}var Km;(e=>{function ThrowNoProject(){throw new Error("No Project.")}e.ThrowNoProject=ThrowNoProject;function ThrowProjectLanguageServiceDisabled(){throw new Error("The project's language service is disabled.")}e.ThrowProjectLanguageServiceDisabled=ThrowProjectLanguageServiceDisabled;function ThrowProjectDoesNotContainDocument(e,t){throw new Error(`Project '${t.getProjectName()}' does not contain document '${e}'`)}e.ThrowProjectDoesNotContainDocument=ThrowProjectDoesNotContainDocument})(Km||(Km={}));function toNormalizedPath(e){return normalizePath(e)}function normalizedPathToPath(e,t,n){const r=isRootedDiskPath(e)?e:getNormalizedAbsolutePath(e,t);return n(r)}function asNormalizedPath(e){return e}function createNormalizedPathMap(){const e=new Map;return{get(t){return e.get(t)},set(t,n){e.set(t,n)},contains(t){return e.has(t)},remove(t){e.delete(t)}}}function isInferredProjectName(e){return/dev\/null\/inferredProject\d+\*/.test(e)}function makeInferredProjectName(e){return`/dev/null/inferredProject${e}*`}function makeAutoImportProviderProjectName(e){return`/dev/null/autoImportProviderProject${e}*`}function makeAuxiliaryProjectName(e){return`/dev/null/auxiliaryProject${e}*`}function createSortedArray2(){return[]}var $m=class _ThrottledOperations{constructor(e,t){this.host=e;this.pendingTimeouts=new Map;this.logger=t.hasLevel(3)?t:void 0}schedule(e,t,n){const r=this.pendingTimeouts.get(e);if(r){this.host.clearTimeout(r)}this.pendingTimeouts.set(e,this.host.setTimeout(_ThrottledOperations.run,t,e,this,n));if(this.logger){this.logger.info(`Scheduled: ${e}${r?", Cancelled earlier one":""}`)}}cancel(e){const t=this.pendingTimeouts.get(e);if(!t)return false;this.host.clearTimeout(t);return this.pendingTimeouts.delete(e)}static run(e,t,n){t.pendingTimeouts.delete(e);if(t.logger){t.logger.info(`Running: ${e}`)}n()}};var Qm=class _GcTimer{constructor(e,t,n){this.host=e;this.delay=t;this.logger=n}scheduleCollect(){if(!this.host.gc||this.timerId!==void 0){return}this.timerId=this.host.setTimeout(_GcTimer.run,this.delay,this)}static run(e){e.timerId=void 0;const t=e.logger.hasLevel(2);const n=t&&e.host.getMemoryUsage();e.host.gc();if(t){const t=e.host.getMemoryUsage();e.logger.perftrc(`GC::before ${n}, after ${t}`)}}};function getBaseConfigFileName(e){const t=getBaseFileName(e);return t==="tsconfig.json"||t==="jsconfig.json"?t:void 0}var Xm={};__export(Xm,{ClassificationType:()=>Hs,CommandTypes:()=>Ym,CompletionTriggerKind:()=>Is,IndentStyle:()=>n_,JsxEmit:()=>r_,ModuleKind:()=>i_,ModuleResolutionKind:()=>o_,NewLineKind:()=>a_,OrganizeImportsMode:()=>Ds,PollingWatchKind:()=>t_,ScriptTarget:()=>s_,SemicolonPreference:()=>Ls,WatchDirectoryKind:()=>e_,WatchFileKind:()=>Zm});var Ym=(e=>{e["JsxClosingTag"]="jsxClosingTag";e["LinkedEditingRange"]="linkedEditingRange";e["Brace"]="brace";e["BraceFull"]="brace-full";e["BraceCompletion"]="braceCompletion";e["GetSpanOfEnclosingComment"]="getSpanOfEnclosingComment";e["Change"]="change";e["Close"]="close";e["Completions"]="completions";e["CompletionInfo"]="completionInfo";e["CompletionsFull"]="completions-full";e["CompletionDetails"]="completionEntryDetails";e["CompletionDetailsFull"]="completionEntryDetails-full";e["CompileOnSaveAffectedFileList"]="compileOnSaveAffectedFileList";e["CompileOnSaveEmitFile"]="compileOnSaveEmitFile";e["Configure"]="configure";e["Definition"]="definition";e["DefinitionFull"]="definition-full";e["DefinitionAndBoundSpan"]="definitionAndBoundSpan";e["DefinitionAndBoundSpanFull"]="definitionAndBoundSpan-full";e["Implementation"]="implementation";e["ImplementationFull"]="implementation-full";e["EmitOutput"]="emit-output";e["Exit"]="exit";e["FileReferences"]="fileReferences";e["FileReferencesFull"]="fileReferences-full";e["Format"]="format";e["Formatonkey"]="formatonkey";e["FormatFull"]="format-full";e["FormatonkeyFull"]="formatonkey-full";e["FormatRangeFull"]="formatRange-full";e["Geterr"]="geterr";e["GeterrForProject"]="geterrForProject";e["SemanticDiagnosticsSync"]="semanticDiagnosticsSync";e["SyntacticDiagnosticsSync"]="syntacticDiagnosticsSync";e["SuggestionDiagnosticsSync"]="suggestionDiagnosticsSync";e["NavBar"]="navbar";e["NavBarFull"]="navbar-full";e["Navto"]="navto";e["NavtoFull"]="navto-full";e["NavTree"]="navtree";e["NavTreeFull"]="navtree-full";e["DocumentHighlights"]="documentHighlights";e["DocumentHighlightsFull"]="documentHighlights-full";e["Open"]="open";e["Quickinfo"]="quickinfo";e["QuickinfoFull"]="quickinfo-full";e["References"]="references";e["ReferencesFull"]="references-full";e["Reload"]="reload";e["Rename"]="rename";e["RenameInfoFull"]="rename-full";e["RenameLocationsFull"]="renameLocations-full";e["Saveto"]="saveto";e["SignatureHelp"]="signatureHelp";e["SignatureHelpFull"]="signatureHelp-full";e["FindSourceDefinition"]="findSourceDefinition";e["Status"]="status";e["TypeDefinition"]="typeDefinition";e["ProjectInfo"]="projectInfo";e["ReloadProjects"]="reloadProjects";e["Unknown"]="unknown";e["OpenExternalProject"]="openExternalProject";e["OpenExternalProjects"]="openExternalProjects";e["CloseExternalProject"]="closeExternalProject";e["SynchronizeProjectList"]="synchronizeProjectList";e["ApplyChangedToOpenFiles"]="applyChangedToOpenFiles";e["UpdateOpen"]="updateOpen";e["EncodedSyntacticClassificationsFull"]="encodedSyntacticClassifications-full";e["EncodedSemanticClassificationsFull"]="encodedSemanticClassifications-full";e["Cleanup"]="cleanup";e["GetOutliningSpans"]="getOutliningSpans";e["GetOutliningSpansFull"]="outliningSpans";e["TodoComments"]="todoComments";e["Indentation"]="indentation";e["DocCommentTemplate"]="docCommentTemplate";e["CompilerOptionsDiagnosticsFull"]="compilerOptionsDiagnostics-full";e["NameOrDottedNameSpan"]="nameOrDottedNameSpan";e["BreakpointStatement"]="breakpointStatement";e["CompilerOptionsForInferredProjects"]="compilerOptionsForInferredProjects";e["GetCodeFixes"]="getCodeFixes";e["GetCodeFixesFull"]="getCodeFixes-full";e["GetCombinedCodeFix"]="getCombinedCodeFix";e["GetCombinedCodeFixFull"]="getCombinedCodeFix-full";e["ApplyCodeActionCommand"]="applyCodeActionCommand";e["GetSupportedCodeFixes"]="getSupportedCodeFixes";e["GetApplicableRefactors"]="getApplicableRefactors";e["GetEditsForRefactor"]="getEditsForRefactor";e["GetMoveToRefactoringFileSuggestions"]="getMoveToRefactoringFileSuggestions";e["PreparePasteEdits"]="preparePasteEdits";e["GetPasteEdits"]="getPasteEdits";e["GetEditsForRefactorFull"]="getEditsForRefactor-full";e["OrganizeImports"]="organizeImports";e["OrganizeImportsFull"]="organizeImports-full";e["GetEditsForFileRename"]="getEditsForFileRename";e["GetEditsForFileRenameFull"]="getEditsForFileRename-full";e["ConfigurePlugin"]="configurePlugin";e["SelectionRange"]="selectionRange";e["SelectionRangeFull"]="selectionRange-full";e["ToggleLineComment"]="toggleLineComment";e["ToggleLineCommentFull"]="toggleLineComment-full";e["ToggleMultilineComment"]="toggleMultilineComment";e["ToggleMultilineCommentFull"]="toggleMultilineComment-full";e["CommentSelection"]="commentSelection";e["CommentSelectionFull"]="commentSelection-full";e["UncommentSelection"]="uncommentSelection";e["UncommentSelectionFull"]="uncommentSelection-full";e["PrepareCallHierarchy"]="prepareCallHierarchy";e["ProvideCallHierarchyIncomingCalls"]="provideCallHierarchyIncomingCalls";e["ProvideCallHierarchyOutgoingCalls"]="provideCallHierarchyOutgoingCalls";e["ProvideInlayHints"]="provideInlayHints";e["WatchChange"]="watchChange";e["MapCode"]="mapCode";e["CopilotRelated"]="copilotRelated";return e})(Ym||{});var Zm=(e=>{e["FixedPollingInterval"]="FixedPollingInterval";e["PriorityPollingInterval"]="PriorityPollingInterval";e["DynamicPriorityPolling"]="DynamicPriorityPolling";e["FixedChunkSizePolling"]="FixedChunkSizePolling";e["UseFsEvents"]="UseFsEvents";e["UseFsEventsOnParentDirectory"]="UseFsEventsOnParentDirectory";return e})(Zm||{});var e_=(e=>{e["UseFsEvents"]="UseFsEvents";e["FixedPollingInterval"]="FixedPollingInterval";e["DynamicPriorityPolling"]="DynamicPriorityPolling";e["FixedChunkSizePolling"]="FixedChunkSizePolling";return e})(e_||{});var t_=(e=>{e["FixedInterval"]="FixedInterval";e["PriorityInterval"]="PriorityInterval";e["DynamicPriority"]="DynamicPriority";e["FixedChunkSize"]="FixedChunkSize";return e})(t_||{});var n_=(e=>{e["None"]="None";e["Block"]="Block";e["Smart"]="Smart";return e})(n_||{});var r_=(e=>{e["None"]="none";e["Preserve"]="preserve";e["ReactNative"]="react-native";e["React"]="react";e["ReactJSX"]="react-jsx";e["ReactJSXDev"]="react-jsxdev";return e})(r_||{});var i_=(e=>{e["None"]="none";e["CommonJS"]="commonjs";e["AMD"]="amd";e["UMD"]="umd";e["System"]="system";e["ES6"]="es6";e["ES2015"]="es2015";e["ES2020"]="es2020";e["ES2022"]="es2022";e["ESNext"]="esnext";e["Node16"]="node16";e["Node18"]="node18";e["NodeNext"]="nodenext";e["Preserve"]="preserve";return e})(i_||{});var o_=(e=>{e["Classic"]="classic";e["Node"]="node";e["NodeJs"]="node";e["Node10"]="node10";e["Node16"]="node16";e["NodeNext"]="nodenext";e["Bundler"]="bundler";return e})(o_||{});var a_=(e=>{e["Crlf"]="Crlf";e["Lf"]="Lf";return e})(a_||{});var s_=(e=>{e["ES3"]="es3";e["ES5"]="es5";e["ES6"]="es6";e["ES2015"]="es2015";e["ES2016"]="es2016";e["ES2017"]="es2017";e["ES2018"]="es2018";e["ES2019"]="es2019";e["ES2020"]="es2020";e["ES2021"]="es2021";e["ES2022"]="es2022";e["ES2023"]="es2023";e["ES2024"]="es2024";e["ESNext"]="esnext";e["JSON"]="json";e["Latest"]="esnext";return e})(s_||{});{}var c_=class{constructor(e,t,n){this.host=e;this.info=t;this.isOpen=false;this.ownFileText=false;this.pendingReloadFromDisk=false;this.version=n||0}getVersion(){return this.svc?`SVC-${this.version}-${this.svc.getSnapshotVersion()}`:`Text-${this.version}`}hasScriptVersionCache_TestOnly(){return this.svc!==void 0}resetSourceMapInfo(){this.info.sourceFileLike=void 0;this.info.closeSourceMapFileWatcher();this.info.sourceMapFilePath=void 0;this.info.declarationInfoPath=void 0;this.info.sourceInfos=void 0;this.info.documentPositionMapper=void 0}useText(e){this.svc=void 0;this.text=e;this.textSnapshot=void 0;this.lineMap=void 0;this.fileSize=void 0;this.resetSourceMapInfo();this.version++}edit(e,t,n){this.switchToScriptVersionCache().edit(e,t-e,n);this.ownFileText=false;this.text=void 0;this.textSnapshot=void 0;this.lineMap=void 0;this.fileSize=void 0;this.resetSourceMapInfo()}reload(e){S.assert(e!==void 0);this.pendingReloadFromDisk=false;if(!this.text&&this.svc){this.text=getSnapshotText(this.svc.getSnapshot())}if(this.text!==e){this.useText(e);this.ownFileText=false;return true}return false}reloadWithFileText(e){const{text:t,fileSize:n}=e||!this.info.isDynamicOrHasMixedContent()?this.getFileTextAndSize(e):{text:"",fileSize:void 0};const r=this.reload(t);this.fileSize=n;this.ownFileText=!e||e===this.info.fileName;if(this.ownFileText&&this.info.mTime===vt.getTime()){this.info.mTime=(this.host.getModifiedTime(this.info.fileName)||vt).getTime()}return r}scheduleReloadIfNeeded(){return!this.pendingReloadFromDisk&&!this.ownFileText?this.pendingReloadFromDisk=true:false}delayReloadFromFileIntoText(){this.pendingReloadFromDisk=true}getTelemetryFileSize(){return!!this.fileSize?this.fileSize:!!this.text?this.text.length:!!this.svc?this.svc.getSnapshot().getLength():this.getSnapshot().getLength()}getSnapshot(){var e;return((e=this.tryUseScriptVersionCache())==null?void 0:e.getSnapshot())||(this.textSnapshot??(this.textSnapshot=Cs.fromString(S.checkDefined(this.text))))}getAbsolutePositionAndLineText(e){const t=this.tryUseScriptVersionCache();if(t)return t.getAbsolutePositionAndLineText(e);const n=this.getLineMap();return e<=n.length?{absolutePosition:n[e-1],lineText:this.text.substring(n[e-1],n[e])}:{absolutePosition:this.text.length,lineText:void 0}}lineToTextSpan(e){const t=this.tryUseScriptVersionCache();if(t)return t.lineToTextSpan(e);const n=this.getLineMap();const r=n[e];const i=e+1t===void 0?t=this.host.readFile(n)||"":t;if(!hasTSFileExtension(this.info.fileName)){const e=this.host.getFileSize?this.host.getFileSize(n):getText().length;if(e>T_){S.assert(!!this.info.containingProjects.length);const t=this.info.containingProjects[0].projectService;t.logger.info(`Skipped loading contents of large file ${n} for info ${this.info.fileName}: fileSize: ${e}`);this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(n,e);return{text:"",fileSize:e}}}return{text:getText()}}switchToScriptVersionCache(){if(!this.svc||this.pendingReloadFromDisk){this.svc=eg.fromString(this.getOrLoadText());this.textSnapshot=void 0;this.version++}return this.svc}tryUseScriptVersionCache(){if(!this.svc||this.pendingReloadFromDisk){this.getOrLoadText()}if(this.isOpen){if(!this.svc&&!this.textSnapshot){this.svc=eg.fromString(S.checkDefined(this.text));this.textSnapshot=void 0}return this.svc}return this.svc}getOrLoadText(){if(this.text===void 0||this.pendingReloadFromDisk){S.assert(!this.svc||this.pendingReloadFromDisk,"ScriptVersionCache should not be set when reloading from disk");this.reloadWithFileText()}return this.text}getLineMap(){S.assert(!this.svc,"ScriptVersionCache should not be set");return this.lineMap||(this.lineMap=computeLineStarts(S.checkDefined(this.text)))}getLineInfo(){const e=this.tryUseScriptVersionCache();if(e){return{getLineCount:()=>e.getLineCount(),getLineText:t=>e.getAbsolutePositionAndLineText(t+1).lineText}}const t=this.getLineMap();return getLineInfo(this.text,t)}};function isDynamicFileName(e){return e[0]==="^"||(e.includes("walkThroughSnippet:/")||e.includes("untitled:/"))&&getBaseFileName(e)[0]==="^"||e.includes(":^")&&!e.includes(Pt)}var l_=class{constructor(e,t,n,r,i,o){this.host=e;this.fileName=t;this.scriptKind=n;this.hasMixedContent=r;this.path=i;this.containingProjects=[];this.isDynamic=isDynamicFileName(t);this.textStorage=new c_(e,this,o);if(r||this.isDynamic){this.realpath=this.path}this.scriptKind=n?n:getScriptKindFromFileName(t)}isDynamicOrHasMixedContent(){return this.hasMixedContent||this.isDynamic}isScriptOpen(){return this.textStorage.isOpen}open(e){this.textStorage.isOpen=true;if(e!==void 0&&this.textStorage.reload(e)){this.markContainingProjectsAsDirty()}}close(e=true){this.textStorage.isOpen=false;if(e&&this.textStorage.scheduleReloadIfNeeded()){this.markContainingProjectsAsDirty()}}getSnapshot(){return this.textStorage.getSnapshot()}ensureRealPath(){if(this.realpath===void 0){this.realpath=this.path;if(this.host.realpath){S.assert(!!this.containingProjects.length);const e=this.containingProjects[0];const t=this.host.realpath(this.path);if(t){this.realpath=e.toPath(t);if(this.realpath!==this.path){e.projectService.realpathToScriptInfos.add(this.realpath,this)}}}}}getRealpathIfDifferent(){return this.realpath&&this.realpath!==this.path?this.realpath:void 0}isSymlink(){return this.realpath&&this.realpath!==this.path}getFormatCodeSettings(){return this.formatSettings}getPreferences(){return this.preferences}attachToProject(e){const t=!this.isAttached(e);if(t){this.containingProjects.push(e);if(!e.getCompilerOptions().preserveSymlinks){this.ensureRealPath()}e.onFileAddedOrRemoved(this.isSymlink())}return t}isAttached(e){switch(this.containingProjects.length){case 0:return false;case 1:return this.containingProjects[0]===e;case 2:return this.containingProjects[0]===e||this.containingProjects[1]===e;default:return contains(this.containingProjects,e)}}detachFromProject(e){switch(this.containingProjects.length){case 0:return;case 1:if(this.containingProjects[0]===e){e.onFileAddedOrRemoved(this.isSymlink());this.containingProjects.pop()}break;case 2:if(this.containingProjects[0]===e){e.onFileAddedOrRemoved(this.isSymlink());this.containingProjects[0]=this.containingProjects.pop()}else if(this.containingProjects[1]===e){e.onFileAddedOrRemoved(this.isSymlink());this.containingProjects.pop()}break;default:if(orderedRemoveItem(this.containingProjects,e)){e.onFileAddedOrRemoved(this.isSymlink())}break}}detachAllProjects(){for(const e of this.containingProjects){if(isConfiguredProject(e)){e.getCachedDirectoryStructureHost().addOrDeleteFile(this.fileName,this.path,2)}const t=e.getRootFilesMap().get(this.path);e.removeFile(this,false,false);e.onFileAddedOrRemoved(this.isSymlink());if(t&&!isInferredProject(e)){e.addMissingFileRoot(t.fileName)}}clear(this.containingProjects)}getDefaultProject(){switch(this.containingProjects.length){case 0:return Km.ThrowNoProject();case 1:return isProjectDeferredClose(this.containingProjects[0])||isBackgroundProject(this.containingProjects[0])?Km.ThrowNoProject():this.containingProjects[0];default:let e;let t;let n;let r;for(let i=0;i!e.isOrphan()))}lineToTextSpan(e){return this.textStorage.lineToTextSpan(e)}lineOffsetToPosition(e,t,n){return this.textStorage.lineOffsetToPosition(e,t,n)}positionToLineOffset(e){failIfInvalidPosition(e);const t=this.textStorage.positionToLineOffset(e);failIfInvalidLocation(t);return t}isJavaScript(){return this.scriptKind===1||this.scriptKind===2}closeSourceMapFileWatcher(){if(this.sourceMapFilePath&&!isString(this.sourceMapFilePath)){closeFileWatcherOf(this.sourceMapFilePath);this.sourceMapFilePath=void 0}}};function failIfInvalidPosition(e){S.assert(typeof e==="number",`Expected position ${e} to be a number.`);S.assert(e>=0,`Expected position to be non-negative.`)}function failIfInvalidLocation(e){S.assert(typeof e.line==="number",`Expected line ${e.line} to be a number.`);S.assert(typeof e.offset==="number",`Expected offset ${e.offset} to be a number.`);S.assert(e.line>0,`Expected line to be non-${e.line===0?"zero":"negative"}`);S.assert(e.offset>0,`Expected offset to be non-${e.offset===0?"zero":"negative"}`)}function scriptInfoIsContainedByBackgroundProject(e){return some(e.containingProjects,isBackgroundProject)}function scriptInfoIsContainedByDeferredClosedProject(e){return some(e.containingProjects,isProjectDeferredClose)}var d_=(e=>{e[e["Inferred"]=0]="Inferred";e[e["Configured"]=1]="Configured";e[e["External"]=2]="External";e[e["AutoImportProvider"]=3]="AutoImportProvider";e[e["Auxiliary"]=4]="Auxiliary";return e})(d_||{});function countEachFileTypes(e,t=false){const n={js:0,jsSize:0,jsx:0,jsxSize:0,ts:0,tsSize:0,tsx:0,tsxSize:0,dts:0,dtsSize:0,deferred:0,deferredSize:0};for(const r of e){const e=t?r.textStorage.getTelemetryFileSize():0;switch(r.scriptKind){case 1:n.js+=1;n.jsSize+=e;break;case 2:n.jsx+=1;n.jsxSize+=e;break;case 3:if(isDeclarationFileName(r.fileName)){n.dts+=1;n.dtsSize+=e}else{n.ts+=1;n.tsSize+=e}break;case 4:n.tsx+=1;n.tsxSize+=e;break;case 7:n.deferred+=1;n.deferredSize+=e;break}}return n}function hasOneOrMoreJsAndNoTsFiles(e){const t=countEachFileTypes(e.getScriptInfos());return t.js>0&&t.ts===0&&t.tsx===0}function allRootFilesAreJsOrDts(e){const t=countEachFileTypes(e.getRootScriptInfos());return t.ts===0&&t.tsx===0}function allFilesAreJsOrDts(e){const t=countEachFileTypes(e.getScriptInfos());return t.ts===0&&t.tsx===0}function hasNoTypeScriptSource(e){return!e.some((e=>fileExtensionIs(e,".ts")&&!isDeclarationFileName(e)||fileExtensionIs(e,".tsx")))}function isGeneratedFileWatcher(e){return e.generatedFilePath!==void 0}function setIsEqualTo(e,t){if(e===t){return true}if((e||Hm).length===0&&(t||Hm).length===0){return true}const n=new Map;let r=0;for(const t of e){if(n.get(t)!==true){n.set(t,true);r++}}for(const e of t){const t=n.get(e);if(t===void 0){return false}if(t===true){n.set(e,false);r--}}return r===0}function typeAcquisitionChanged(e,t){return e.enable!==t.enable||!setIsEqualTo(e.include,t.include)||!setIsEqualTo(e.exclude,t.exclude)}function compilerOptionsChanged(e,t){return rr(e)!==rr(t)}function unresolvedImportsChanged(e,t){if(e===t){return false}return!arrayIsEqualTo(e,t)}var p_=class _Project{constructor(e,t,n,r,i,o,a,s,c,l){this.projectKind=t;this.projectService=n;this.compilerOptions=o;this.compileOnSaveEnabled=a;this.watchOptions=s;this.rootFilesMap=new Map;this.plugins=[];this.cachedUnresolvedImportsPerFile=new Map;this.hasAddedorRemovedFiles=false;this.hasAddedOrRemovedSymlinks=false;this.lastReportedVersion=0;this.projectProgramVersion=0;this.projectStateVersion=0;this.initialLoadPending=false;this.dirty=false;this.typingFiles=Hm;this.moduleSpecifierCache=createModuleSpecifierCache(this);this.createHash=maybeBind(this.projectService.host,this.projectService.host.createHash);this.globalCacheResolutionModuleName=ps.nonRelativeModuleNameForTypingCache;this.updateFromProjectInProgress=false;n.logger.info(`Creating ${d_[t]}Project: ${e}, currentDirectory: ${l}`);this.projectName=e;this.directoryStructureHost=c;this.currentDirectory=this.projectService.getNormalizedAbsolutePath(l);this.getCanonicalFileName=this.projectService.toCanonicalFileName;this.jsDocParsingMode=this.projectService.jsDocParsingMode;this.cancellationToken=new Xl(this.projectService.cancellationToken,this.projectService.throttleWaitMilliseconds);if(!this.compilerOptions){this.compilerOptions=getDefaultCompilerOptions2();this.compilerOptions.allowNonTsExtensions=true;this.compilerOptions.allowJs=true}else if(r||rr(this.compilerOptions)||this.projectService.hasDeferredExtension()){this.compilerOptions.allowNonTsExtensions=true}switch(n.serverMode){case 0:this.languageServiceEnabled=true;break;case 1:this.languageServiceEnabled=true;this.compilerOptions.noResolve=true;this.compilerOptions.types=[];break;case 2:this.languageServiceEnabled=false;this.compilerOptions.noResolve=true;this.compilerOptions.types=[];break;default:S.assertNever(n.serverMode)}this.setInternalCompilerOptionsForEmittingJsFiles();const d=this.projectService.host;if(this.projectService.logger.loggingEnabled()){this.trace=e=>this.writeLog(e)}else if(d.trace){this.trace=e=>d.trace(e)}this.realpath=maybeBind(d,d.realpath);this.preferNonRecursiveWatch=this.projectService.canUseWatchEvents||d.preferNonRecursiveWatch;this.resolutionCache=createResolutionCache(this,this.currentDirectory,true);this.languageService=createLanguageService(this,this.projectService.documentRegistry,this.projectService.serverMode);if(i){this.disableLanguageService(i)}this.markAsDirty();if(!isBackgroundProject(this)){this.projectService.pendingEnsureProjectForOpenFiles=true}this.projectService.onProjectCreation(this)}getResolvedProjectReferenceToRedirect(e){return void 0}isNonTsProject(){updateProjectIfDirty(this);return allFilesAreJsOrDts(this)}isJsOnlyProject(){updateProjectIfDirty(this);return hasOneOrMoreJsAndNoTsFiles(this)}static resolveModule(e,t,n,r){return _Project.importServicePluginSync({name:e},[t],n,r).resolvedModule}static importServicePluginSync(e,t,n,r){S.assertIsDefined(n.require);let i;let o;for(const a of t){const t=normalizeSlashes(n.resolvePath(combinePaths(a,"node_modules")));r(`Loading ${e.name} from ${a} (resolved to ${t})`);const s=n.require(t,e.name);if(!s.error){o=s.module;break}const c=s.error.stack||s.error.message||JSON.stringify(s.error);(i??(i=[])).push(`Failed to load module '${e.name}' from ${t}: ${c}`)}return{pluginConfigEntry:e,resolvedModule:o,errorLogs:i}}static async importServicePluginAsync(e,t,n,r){S.assertIsDefined(n.importPlugin);let i;let o;for(const a of t){const t=combinePaths(a,"node_modules");r(`Dynamically importing ${e.name} from ${a} (resolved to ${t})`);let s;try{s=await n.importPlugin(t,e.name)}catch(e){s={module:void 0,error:e}}if(!s.error){o=s.module;break}const c=s.error.stack||s.error.message||JSON.stringify(s.error);(i??(i=[])).push(`Failed to dynamically import module '${e.name}' from ${t}: ${c}`)}return{pluginConfigEntry:e,resolvedModule:o,errorLogs:i}}isKnownTypesPackageName(e){return this.projectService.typingsInstaller.isKnownTypesPackageName(e)}installPackage(e){return this.projectService.typingsInstaller.installPackage({...e,projectName:this.projectName,projectRootPath:this.toPath(this.currentDirectory)})}getGlobalTypingsCacheLocation(){return this.getTypeAcquisition().enable?this.projectService.typingsInstaller.globalTypingsCacheLocation:void 0}getSymlinkCache(){if(!this.symlinks){this.symlinks=createSymlinkCache(this.getCurrentDirectory(),this.getCanonicalFileName)}if(this.program&&!this.symlinks.hasProcessedResolutions()){this.symlinks.setSymlinksFromResolutions(this.program.forEachResolvedModule,this.program.forEachResolvedTypeReferenceDirective,this.program.getAutomaticTypeDirectiveResolutions())}return this.symlinks}getCompilationSettings(){return this.compilerOptions}getCompilerOptions(){return this.getCompilationSettings()}getNewLine(){return this.projectService.host.newLine}getProjectVersion(){return this.projectStateVersion.toString()}getProjectReferences(){return void 0}getScriptFileNames(){if(!this.rootFilesMap.size){return d}let e;this.rootFilesMap.forEach((t=>{if(this.languageServiceEnabled||t.info&&t.info.isScriptOpen()){(e||(e=[])).push(t.fileName)}}));return addRange(e,this.typingFiles)||d}getOrCreateScriptInfoAndAttachToProject(e){const t=this.projectService.getOrCreateScriptInfoNotOpenedByClient(e,this.currentDirectory,this.directoryStructureHost,false);if(t){const e=this.rootFilesMap.get(t.path);if(e&&e.info!==t){e.info=t}t.attachToProject(this)}return t}getScriptKind(e){const t=this.projectService.getScriptInfoForPath(this.toPath(e));return t&&t.scriptKind}getScriptVersion(e){const t=this.projectService.getOrCreateScriptInfoNotOpenedByClient(e,this.currentDirectory,this.directoryStructureHost,false);return t&&t.getLatestVersion()}getScriptSnapshot(e){const t=this.getOrCreateScriptInfoAndAttachToProject(e);if(t){return t.getSnapshot()}}getCancellationToken(){return this.cancellationToken}getCurrentDirectory(){return this.currentDirectory}getDefaultLibFileName(){const e=getDirectoryPath(normalizePath(this.projectService.getExecutingFilePath()));return combinePaths(e,getDefaultLibFileName(this.compilerOptions))}useCaseSensitiveFileNames(){return this.projectService.host.useCaseSensitiveFileNames}readDirectory(e,t,n,r,i){return this.directoryStructureHost.readDirectory(e,t,n,r,i)}readFile(e){return this.projectService.host.readFile(e)}writeFile(e,t){return this.projectService.host.writeFile(e,t)}fileExists(e){const t=this.toPath(e);return!!this.projectService.getScriptInfoForPath(t)||!this.isWatchedMissingFile(t)&&this.directoryStructureHost.fileExists(e)}resolveModuleNameLiterals(e,t,n,r,i,o){return this.resolutionCache.resolveModuleNameLiterals(e,t,n,r,i,o)}getModuleResolutionCache(){return this.resolutionCache.getModuleResolutionCache()}resolveTypeReferenceDirectiveReferences(e,t,n,r,i,o){return this.resolutionCache.resolveTypeReferenceDirectiveReferences(e,t,n,r,i,o)}resolveLibrary(e,t,n,r){return this.resolutionCache.resolveLibrary(e,t,n,r)}directoryExists(e){return this.directoryStructureHost.directoryExists(e)}getDirectories(e){return this.directoryStructureHost.getDirectories(e)}getCachedDirectoryStructureHost(){return void 0}toPath(e){return toPath(e,this.currentDirectory,this.projectService.toCanonicalFileName)}watchDirectoryOfFailedLookupLocation(e,t,n){return this.projectService.watchFactory.watchDirectory(e,t,n,this.projectService.getWatchOptions(this),ns.FailedLookupLocations,this)}watchAffectingFileLocation(e,t){return this.projectService.watchFactory.watchFile(e,t,2e3,this.projectService.getWatchOptions(this),ns.AffectingFileLocation,this)}clearInvalidateResolutionOfFailedLookupTimer(){return this.projectService.throttledOperations.cancel(`${this.getProjectName()}FailedLookupInvalidation`)}scheduleInvalidateResolutionsOfFailedLookupLocations(){this.projectService.throttledOperations.schedule(`${this.getProjectName()}FailedLookupInvalidation`,1e3,(()=>{if(this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()){this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}}))}invalidateResolutionsOfFailedLookupLocations(){if(this.clearInvalidateResolutionOfFailedLookupTimer()&&this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()){this.markAsDirty();this.projectService.delayEnsureProjectForOpenFiles()}}onInvalidatedResolution(){this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}watchTypeRootsDirectory(e,t,n){return this.projectService.watchFactory.watchDirectory(e,t,n,this.projectService.getWatchOptions(this),ns.TypeRoots,this)}hasChangedAutomaticTypeDirectiveNames(){return this.resolutionCache.hasChangedAutomaticTypeDirectiveNames()}onChangedAutomaticTypeDirectiveNames(){this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}fileIsOpen(e){return this.projectService.openFiles.has(e)}writeLog(e){this.projectService.logger.info(e)}log(e){this.writeLog(e)}error(e){this.projectService.logger.msg(e,"Err")}setInternalCompilerOptionsForEmittingJsFiles(){if(this.projectKind===0||this.projectKind===2){this.compilerOptions.noEmitForJsFiles=true}}getGlobalProjectErrors(){return filter(this.projectErrors,(e=>!e.file))||Hm}getAllProjectErrors(){return this.projectErrors||Hm}setProjectErrors(e){this.projectErrors=e}getLanguageService(e=true){if(e){updateProjectIfDirty(this)}return this.languageService}getSourceMapper(){return this.getLanguageService().getSourceMapper()}clearSourceMapperCache(){this.languageService.clearSourceMapperCache()}getDocumentPositionMapper(e,t){return this.projectService.getDocumentPositionMapper(this,e,t)}getSourceFileLike(e){return this.projectService.getSourceFileLike(e,this)}shouldEmitFile(e){return e&&!e.isDynamicOrHasMixedContent()&&!this.program.isSourceOfProjectReferenceRedirect(e.path)}getCompileOnSaveAffectedFileList(e){if(!this.languageServiceEnabled){return[]}updateProjectIfDirty(this);this.builderState=Qa.create(this.program,this.builderState,true);return mapDefined(Qa.getFilesAffectedBy(this.builderState,this.program,e.path,this.cancellationToken,this.projectService.host),(e=>this.shouldEmitFile(this.projectService.getScriptInfoForPath(e.path))?e.fileName:void 0))}emitFile(e,t){if(!this.languageServiceEnabled||!this.shouldEmitFile(e)){return{emitSkipped:true,diagnostics:Hm}}const{emitSkipped:n,diagnostics:r,outputFiles:i}=this.getLanguageService().getEmitOutput(e.fileName);if(!n){for(const e of i){const n=getNormalizedAbsolutePath(e.name,this.currentDirectory);t(n,e.text,e.writeByteOrderMark)}if(this.builderState&&Zn(this.compilerOptions)){const t=i.filter((e=>isDeclarationFileName(e.name)));if(t.length===1){const n=this.program.getSourceFile(e.fileName);const r=this.projectService.host.createHash?this.projectService.host.createHash(t[0].text):generateDjb2Hash(t[0].text);Qa.updateSignatureOfFile(this.builderState,r,n.resolvedPath)}}}return{emitSkipped:n,diagnostics:r}}enableLanguageService(){if(this.languageServiceEnabled||this.projectService.serverMode===2){return}this.languageServiceEnabled=true;this.lastFileExceededProgramSize=void 0;this.projectService.onUpdateLanguageServiceStateForProject(this,true)}cleanupProgram(){if(this.program){for(const e of this.program.getSourceFiles()){this.detachScriptInfoIfNotRoot(e.fileName)}this.program.forEachResolvedProjectReference((e=>this.detachScriptInfoFromProject(e.sourceFile.fileName)));this.program=void 0}}disableLanguageService(e){if(!this.languageServiceEnabled){return}S.assert(this.projectService.serverMode!==2);this.languageService.cleanupSemanticCache();this.languageServiceEnabled=false;this.cleanupProgram();this.lastFileExceededProgramSize=e;this.builderState=void 0;if(this.autoImportProviderHost){this.autoImportProviderHost.close()}this.autoImportProviderHost=void 0;this.resolutionCache.closeTypeRootsWatch();this.clearGeneratedFileWatch();this.projectService.verifyDocumentRegistry();this.projectService.onUpdateLanguageServiceStateForProject(this,false)}getProjectName(){return this.projectName}removeLocalTypingsFromTypeAcquisition(e){if(!e.enable||!e.include){return e}return{...e,include:this.removeExistingTypings(e.include)}}getExternalFiles(e){return toSorted(flatMap(this.plugins,(t=>{if(typeof t.module.getExternalFiles!=="function")return;try{return t.module.getExternalFiles(this,e||0)}catch(e){this.projectService.logger.info(`A plugin threw an exception in getExternalFiles: ${e}`);if(e.stack){this.projectService.logger.info(e.stack)}}})))}getSourceFile(e){if(!this.program){return void 0}return this.program.getSourceFileByPath(e)}getSourceFileOrConfigFile(e){const t=this.program.getCompilerOptions();return e===t.configFilePath?t.configFile:this.getSourceFile(e)}close(){var e;if(this.typingsCache)this.projectService.typingsInstaller.onProjectClosed(this);this.typingsCache=void 0;this.closeWatchingTypingLocations();this.cleanupProgram();forEach(this.externalFiles,(e=>this.detachScriptInfoIfNotRoot(e)));this.rootFilesMap.forEach((e=>{var t;return(t=e.info)==null?void 0:t.detachFromProject(this)}));this.projectService.pendingEnsureProjectForOpenFiles=true;this.rootFilesMap=void 0;this.externalFiles=void 0;this.program=void 0;this.builderState=void 0;this.resolutionCache.clear();this.resolutionCache=void 0;this.cachedUnresolvedImportsPerFile=void 0;(e=this.packageJsonWatches)==null?void 0:e.forEach((e=>{e.projects.delete(this);e.close()}));this.packageJsonWatches=void 0;this.moduleSpecifierCache.clear();this.moduleSpecifierCache=void 0;this.directoryStructureHost=void 0;this.exportMapCache=void 0;this.projectErrors=void 0;this.plugins.length=0;if(this.missingFilesMap){clearMap(this.missingFilesMap,closeFileWatcher);this.missingFilesMap=void 0}this.clearGeneratedFileWatch();this.clearInvalidateResolutionOfFailedLookupTimer();if(this.autoImportProviderHost){this.autoImportProviderHost.close()}this.autoImportProviderHost=void 0;if(this.noDtsResolutionProject){this.noDtsResolutionProject.close()}this.noDtsResolutionProject=void 0;this.languageService.dispose();this.languageService=void 0}detachScriptInfoIfNotRoot(e){const t=this.projectService.getScriptInfo(e);if(t&&!this.isRoot(t)){t.detachFromProject(this)}}isClosed(){return this.rootFilesMap===void 0}hasRoots(){var e;return!!((e=this.rootFilesMap)==null?void 0:e.size)}isOrphan(){return false}getRootFiles(){return this.rootFilesMap&&arrayFrom(mapDefinedIterator(this.rootFilesMap.values(),(e=>{var t;return(t=e.info)==null?void 0:t.fileName})))}getRootFilesMap(){return this.rootFilesMap}getRootScriptInfos(){return arrayFrom(mapDefinedIterator(this.rootFilesMap.values(),(e=>e.info)))}getScriptInfos(){if(!this.languageServiceEnabled){return this.getRootScriptInfos()}return map(this.program.getSourceFiles(),(e=>{const t=this.projectService.getScriptInfoForPath(e.resolvedPath);S.assert(!!t,"getScriptInfo",(()=>`scriptInfo for a file '${e.fileName}' Path: '${e.path}' / '${e.resolvedPath}' is missing.`));return t}))}getExcludedFiles(){return Hm}getFileNames(e,t){if(!this.program){return[]}if(!this.languageServiceEnabled){let e=this.getRootFiles();if(this.compilerOptions){const t=getDefaultLibFilePath(this.compilerOptions);if(t){(e||(e=[])).push(asNormalizedPath(t))}}return e}const n=[];for(const t of this.program.getSourceFiles()){if(e&&this.program.isSourceFileFromExternalLibrary(t)){continue}n.push(asNormalizedPath(t.fileName))}if(!t){const e=this.program.getCompilerOptions().configFile;if(e){n.push(asNormalizedPath(e.fileName));if(e.extendedSourceFiles){for(const t of e.extendedSourceFiles){n.push(asNormalizedPath(t))}}}}return n}getFileNamesWithRedirectInfo(e){return this.getFileNames().map((t=>({fileName:t,isSourceOfProjectReferenceRedirect:e&&this.isSourceOfProjectReferenceRedirect(t)})))}hasConfigFile(e){if(this.program&&this.languageServiceEnabled){const t=this.program.getCompilerOptions().configFile;if(t){if(e===asNormalizedPath(t.fileName)){return true}if(t.extendedSourceFiles){for(const n of t.extendedSourceFiles){if(e===asNormalizedPath(n)){return true}}}}}return false}containsScriptInfo(e){if(this.isRoot(e))return true;if(!this.program)return false;const t=this.program.getSourceFileByPath(e.path);return!!t&&t.resolvedPath===e.path}containsFile(e,t){const n=this.projectService.getScriptInfoForNormalizedPath(e);if(n&&(n.isScriptOpen()||!t)){return this.containsScriptInfo(n)}return false}isRoot(e){var t,n;return((n=(t=this.rootFilesMap)==null?void 0:t.get(e.path))==null?void 0:n.info)===e}addRoot(e,t){S.assert(!this.isRoot(e));this.rootFilesMap.set(e.path,{fileName:t||e.fileName,info:e});e.attachToProject(this);this.markAsDirty()}addMissingFileRoot(e){const t=this.projectService.toPath(e);this.rootFilesMap.set(t,{fileName:e});this.markAsDirty()}removeFile(e,t,n){if(this.isRoot(e)){this.removeRoot(e)}if(t){this.resolutionCache.removeResolutionsOfFile(e.path)}else{this.resolutionCache.invalidateResolutionOfFile(e.path)}this.cachedUnresolvedImportsPerFile.delete(e.path);if(n){e.detachFromProject(this)}this.markAsDirty()}registerFileUpdate(e){(this.updatedFileNames||(this.updatedFileNames=new Set)).add(e)}markFileAsDirty(e){this.markAsDirty();if(this.exportMapCache&&!this.exportMapCache.isEmpty()){(this.changedFilesForExportMapCache||(this.changedFilesForExportMapCache=new Set)).add(e)}}markAsDirty(){if(!this.dirty){this.projectStateVersion++;this.dirty=true}}markAutoImportProviderAsDirty(){var e;if(!this.autoImportProviderHost)this.autoImportProviderHost=void 0;(e=this.autoImportProviderHost)==null?void 0:e.markAsDirty()}onAutoImportProviderSettingsChanged(){this.markAutoImportProviderAsDirty()}onPackageJsonChange(){this.moduleSpecifierCache.clear();this.markAutoImportProviderAsDirty()}onFileAddedOrRemoved(e){this.hasAddedorRemovedFiles=true;if(e){this.hasAddedOrRemovedSymlinks=true}}onDiscoveredSymlink(){this.hasAddedOrRemovedSymlinks=true}onReleaseOldSourceFile(e,t,n,r){if(!r||e.resolvedPath===e.path&&r.resolvedPath!==e.path){this.detachScriptInfoFromProject(e.fileName,n)}}updateFromProject(){updateProjectIfDirty(this)}updateGraph(){var e,t;(e=G)==null?void 0:e.push(G.Phase.Session,"updateGraph",{name:this.projectName,kind:d_[this.projectKind]});this.resolutionCache.startRecordingFilesWithChangedResolutions();const n=this.updateGraphWorker();const r=this.hasAddedorRemovedFiles;this.hasAddedorRemovedFiles=false;this.hasAddedOrRemovedSymlinks=false;const i=this.resolutionCache.finishRecordingFilesWithChangedResolutions()||Hm;for(const e of i){this.cachedUnresolvedImportsPerFile.delete(e)}if(this.languageServiceEnabled&&this.projectService.serverMode===0&&!this.isOrphan()){if(n||i.length){this.lastCachedUnresolvedImportsList=getUnresolvedImports(this.program,this.cachedUnresolvedImportsPerFile)}this.enqueueInstallTypingsForProject(r)}else{this.lastCachedUnresolvedImportsList=void 0}const o=this.projectProgramVersion===0&&n;if(n){this.projectProgramVersion++}if(r){this.markAutoImportProviderAsDirty()}if(o){this.getPackageJsonAutoImportProvider()}(t=G)==null?void 0:t.pop();return!n}enqueueInstallTypingsForProject(e){const t=this.getTypeAcquisition();if(!t||!t.enable||this.projectService.typingsInstaller===B_){return}const n=this.typingsCache;if(e||!n||typeAcquisitionChanged(t,n.typeAcquisition)||compilerOptionsChanged(this.getCompilationSettings(),n.compilerOptions)||unresolvedImportsChanged(this.lastCachedUnresolvedImportsList,n.unresolvedImports)){this.typingsCache={compilerOptions:this.getCompilationSettings(),typeAcquisition:t,unresolvedImports:this.lastCachedUnresolvedImportsList};this.projectService.typingsInstaller.enqueueInstallTypingsRequest(this,t,this.lastCachedUnresolvedImportsList)}}updateTypingFiles(e,t,n,r){this.typingsCache={compilerOptions:e,typeAcquisition:t,unresolvedImports:n};const i=!t||!t.enable?Hm:toSorted(r);if(enumerateInsertsAndDeletes(i,this.typingFiles,getStringComparer(!this.useCaseSensitiveFileNames()),noop,(e=>this.detachScriptInfoFromProject(e)))){this.typingFiles=i;this.resolutionCache.setFilesWithInvalidatedNonRelativeUnresolvedImports(this.cachedUnresolvedImportsPerFile);this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}}closeWatchingTypingLocations(){if(this.typingWatchers)clearMap(this.typingWatchers,closeFileWatcher);this.typingWatchers=void 0}onTypingInstallerWatchInvoke(){this.typingWatchers.isInvoked=true;this.projectService.updateTypingsForProject({projectName:this.getProjectName(),kind:fs})}watchTypingLocations(e){if(!e){this.typingWatchers.isInvoked=false;return}if(!e.length){this.closeWatchingTypingLocations();return}const t=new Map(this.typingWatchers);if(!this.typingWatchers)this.typingWatchers=new Map;this.typingWatchers.isInvoked=false;const createProjectWatcher=(e,n)=>{const r=this.toPath(e);t.delete(r);if(!this.typingWatchers.has(r)){const t=n==="FileWatcher"?ns.TypingInstallerLocationFile:ns.TypingInstallerLocationDirectory;this.typingWatchers.set(r,canWatchDirectoryOrFilePath(r)?n==="FileWatcher"?this.projectService.watchFactory.watchFile(e,(()=>!this.typingWatchers.isInvoked?this.onTypingInstallerWatchInvoke():this.writeLog(`TypingWatchers already invoked`)),2e3,this.projectService.getWatchOptions(this),t,this):this.projectService.watchFactory.watchDirectory(e,(e=>{if(this.typingWatchers.isInvoked)return this.writeLog(`TypingWatchers already invoked`);if(!fileExtensionIs(e,".json"))return this.writeLog(`Ignoring files that are not *.json`);if(comparePaths(e,combinePaths(this.projectService.typingsInstaller.globalTypingsCacheLocation,"package.json"),!this.useCaseSensitiveFileNames()))return this.writeLog(`Ignoring package.json change at global typings location`);this.onTypingInstallerWatchInvoke()}),1,this.projectService.getWatchOptions(this),t,this):(this.writeLog(`Skipping watcher creation at ${e}:: ${getDetailWatchInfo(t,this)}`),ts))}};for(const t of e){const e=getBaseFileName(t);if(e==="package.json"||e==="bower.json"){createProjectWatcher(t,"FileWatcher");continue}if(containsPath(this.currentDirectory,t,this.currentDirectory,!this.useCaseSensitiveFileNames())){const e=t.indexOf(Pt,this.currentDirectory.length+1);if(e!==-1){createProjectWatcher(t.substr(0,e),"DirectoryWatcher")}else{createProjectWatcher(t,"DirectoryWatcher")}continue}if(containsPath(this.projectService.typingsInstaller.globalTypingsCacheLocation,t,this.currentDirectory,!this.useCaseSensitiveFileNames())){createProjectWatcher(this.projectService.typingsInstaller.globalTypingsCacheLocation,"DirectoryWatcher");continue}createProjectWatcher(t,"DirectoryWatcher")}t.forEach(((e,t)=>{e.close();this.typingWatchers.delete(t)}))}getCurrentProgram(){return this.program}removeExistingTypings(e){if(!e.length)return e;const t=getAutomaticTypeDirectiveNames(this.getCompilerOptions(),this);return filter(e,(e=>!t.includes(e)))}updateGraphWorker(){var e,t;const n=this.languageService.getCurrentProgram();S.assert(n===this.program);S.assert(!this.isClosed(),"Called update graph worker of closed project");this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`);const r=R();const{hasInvalidatedResolutions:i,hasInvalidatedLibResolutions:o}=this.resolutionCache.createHasInvalidatedResolutions(returnFalse,returnFalse);this.hasInvalidatedResolutions=i;this.hasInvalidatedLibResolutions=o;this.resolutionCache.startCachingPerDirectoryResolution();this.dirty=false;this.updateFromProjectInProgress=true;this.program=this.languageService.getProgram();this.updateFromProjectInProgress=false;(e=G)==null?void 0:e.push(G.Phase.Session,"finishCachingPerDirectoryResolution");this.resolutionCache.finishCachingPerDirectoryResolution(this.program,n);(t=G)==null?void 0:t.pop();S.assert(n===void 0||this.program!==void 0);let a=false;if(this.program&&(!n||this.program!==n&&this.program.structureIsReused!==2)){a=true;this.rootFilesMap.forEach(((e,t)=>{var n;const r=this.program.getSourceFileByPath(t);const i=e.info;if(!r||((n=e.info)==null?void 0:n.path)===r.resolvedPath)return;e.info=this.projectService.getScriptInfo(r.fileName);S.assert(e.info.isAttached(this));i==null?void 0:i.detachFromProject(this)}));updateMissingFilePathsWatch(this.program,this.missingFilesMap||(this.missingFilesMap=new Map),((e,t)=>this.addMissingFileWatcher(e,t)));if(this.generatedFilesMap){const e=this.compilerOptions.outFile;if(isGeneratedFileWatcher(this.generatedFilesMap)){if(!e||!this.isValidGeneratedFileWatcher(removeFileExtension(e)+".d.ts",this.generatedFilesMap)){this.clearGeneratedFileWatch()}}else{if(e){this.clearGeneratedFileWatch()}else{this.generatedFilesMap.forEach(((e,t)=>{const n=this.program.getSourceFileByPath(t);if(!n||n.resolvedPath!==t||!this.isValidGeneratedFileWatcher(getDeclarationEmitOutputFilePathWorker(n.fileName,this.compilerOptions,this.program),e)){closeFileWatcherOf(e);this.generatedFilesMap.delete(t)}}))}}}if(this.languageServiceEnabled&&this.projectService.serverMode===0){this.resolutionCache.updateTypeRootsWatch()}}this.projectService.verifyProgram(this);if(this.exportMapCache&&!this.exportMapCache.isEmpty()){this.exportMapCache.releaseSymbols();if(this.hasAddedorRemovedFiles||n&&!this.program.structureIsReused){this.exportMapCache.clear()}else if(this.changedFilesForExportMapCache&&n&&this.program){forEachKey(this.changedFilesForExportMapCache,(e=>{const t=n.getSourceFileByPath(e);const r=this.program.getSourceFileByPath(e);if(!t||!r){this.exportMapCache.clear();return true}return this.exportMapCache.onFileChanged(t,r,!!this.getTypeAcquisition().enable)}))}}if(this.changedFilesForExportMapCache){this.changedFilesForExportMapCache.clear()}if(this.hasAddedOrRemovedSymlinks||this.program&&!this.program.structureIsReused&&this.getCompilerOptions().preserveSymlinks){this.symlinks=void 0;this.moduleSpecifierCache.clear()}const s=this.externalFiles||Hm;this.externalFiles=this.getExternalFiles();enumerateInsertsAndDeletes(this.externalFiles,s,getStringComparer(!this.useCaseSensitiveFileNames()),(e=>{const t=this.projectService.getOrCreateScriptInfoNotOpenedByClient(e,this.currentDirectory,this.directoryStructureHost,false);t==null?void 0:t.attachToProject(this)}),(e=>this.detachScriptInfoFromProject(e)));const c=R()-r;this.sendPerformanceEvent("UpdateGraph",c);this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} projectStateVersion: ${this.projectStateVersion} projectProgramVersion: ${this.projectProgramVersion} structureChanged: ${a}${this.program?` structureIsReused:: ${ue[this.program.structureIsReused]}`:""} Elapsed: ${c}ms`);if(this.projectService.logger.isTestLogger){if(this.program!==n){this.print(true,this.hasAddedorRemovedFiles,true)}else{this.writeLog(`Same program as before`)}}else if(this.hasAddedorRemovedFiles){this.print(true,true,false)}else if(this.program!==n){this.writeLog(`Different program with same set of files`)}this.projectService.verifyDocumentRegistry();return a}sendPerformanceEvent(e,t){this.projectService.sendPerformanceEvent(e,t)}detachScriptInfoFromProject(e,t){const n=this.projectService.getScriptInfo(e);if(n){n.detachFromProject(this);if(!t){this.resolutionCache.removeResolutionsOfFile(n.path)}}}addMissingFileWatcher(e,t){var n;if(isConfiguredProject(this)){const t=this.projectService.configFileExistenceInfoCache.get(e);if((n=t==null?void 0:t.config)==null?void 0:n.projects.has(this.canonicalConfigFilePath))return ts}const r=this.projectService.watchFactory.watchFile(getNormalizedAbsolutePath(t,this.currentDirectory),((t,n)=>{if(isConfiguredProject(this)){this.getCachedDirectoryStructureHost().addOrDeleteFile(t,e,n)}if(n===0&&this.missingFilesMap.has(e)){this.missingFilesMap.delete(e);r.close();this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}}),500,this.projectService.getWatchOptions(this),ns.MissingFile,this);return r}isWatchedMissingFile(e){return!!this.missingFilesMap&&this.missingFilesMap.has(e)}addGeneratedFileWatch(e,t){if(this.compilerOptions.outFile){if(!this.generatedFilesMap){this.generatedFilesMap=this.createGeneratedFileWatcher(e)}}else{const n=this.toPath(t);if(this.generatedFilesMap){if(isGeneratedFileWatcher(this.generatedFilesMap)){S.fail(`${this.projectName} Expected to not have --out watcher for generated file with options: ${JSON.stringify(this.compilerOptions)}`);return}if(this.generatedFilesMap.has(n))return}else{this.generatedFilesMap=new Map}this.generatedFilesMap.set(n,this.createGeneratedFileWatcher(e))}}createGeneratedFileWatcher(e){return{generatedFilePath:this.toPath(e),watcher:this.projectService.watchFactory.watchFile(e,(()=>{this.clearSourceMapperCache();this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this)}),2e3,this.projectService.getWatchOptions(this),ns.MissingGeneratedFile,this)}}isValidGeneratedFileWatcher(e,t){return this.toPath(e)===t.generatedFilePath}clearGeneratedFileWatch(){if(this.generatedFilesMap){if(isGeneratedFileWatcher(this.generatedFilesMap)){closeFileWatcherOf(this.generatedFilesMap)}else{clearMap(this.generatedFilesMap,closeFileWatcherOf)}this.generatedFilesMap=void 0}}getScriptInfoForNormalizedPath(e){const t=this.projectService.getScriptInfoForPath(this.toPath(e));if(t&&!t.isAttached(this)){return Km.ThrowProjectDoesNotContainDocument(e,this)}return t}getScriptInfo(e){return this.projectService.getScriptInfo(e)}filesToString(e){return this.filesToStringWorker(e,true,false)}filesToStringWorker(e,t,n){if(this.initialLoadPending)return"\tFiles (0) InitialLoadPending\n";if(!this.program)return"\tFiles (0) NoProgram\n";const r=this.program.getSourceFiles();let i=`\tFiles (${r.length})\n`;if(e){for(const e of r){i+=`\t${e.fileName}${n?` ${e.version} ${JSON.stringify(e.text)}`:""}\n`}if(t){i+="\n\n";explainFiles(this.program,(e=>i+=`\t${e}\n`))}}return i}print(e,t,n){var r;this.writeLog(`Project '${this.projectName}' (${d_[this.projectKind]})`);this.writeLog(this.filesToStringWorker(e&&this.projectService.logger.hasLevel(3),t&&this.projectService.logger.hasLevel(3),n&&this.projectService.logger.hasLevel(3)));this.writeLog("-----------------------------------------------");if(this.autoImportProviderHost){this.autoImportProviderHost.print(false,false,false)}(r=this.noDtsResolutionProject)==null?void 0:r.print(false,false,false)}setCompilerOptions(e){var t;if(e){e.allowNonTsExtensions=true;const n=this.compilerOptions;this.compilerOptions=e;this.setInternalCompilerOptionsForEmittingJsFiles();(t=this.noDtsResolutionProject)==null?void 0:t.setCompilerOptions(this.getCompilerOptionsForNoDtsResolutionProject());if(changesAffectModuleResolution(n,e)){this.cachedUnresolvedImportsPerFile.clear();this.lastCachedUnresolvedImportsList=void 0;this.resolutionCache.onChangesAffectModuleResolution();this.moduleSpecifierCache.clear()}this.markAsDirty()}}setWatchOptions(e){this.watchOptions=e}getWatchOptions(){return this.watchOptions}setTypeAcquisition(e){if(e){this.typeAcquisition=this.removeLocalTypingsFromTypeAcquisition(e)}}getTypeAcquisition(){return this.typeAcquisition||{}}getChangesSinceVersion(e,t){var n,r;const i=t?e=>arrayFrom(e.entries(),(([e,t])=>({fileName:e,isSourceOfProjectReferenceRedirect:t}))):e=>arrayFrom(e.keys());if(!this.initialLoadPending){updateProjectIfDirty(this)}const o={projectName:this.getProjectName(),version:this.projectProgramVersion,isInferred:isInferredProject(this),options:this.getCompilationSettings(),languageServiceDisabled:!this.languageServiceEnabled,lastFileExceededProgramSize:this.lastFileExceededProgramSize};const a=this.updatedFileNames;this.updatedFileNames=void 0;if(this.lastReportedFileNames&&e===this.lastReportedVersion){if(this.projectProgramVersion===this.lastReportedVersion&&!a){return{info:o,projectErrors:this.getGlobalProjectErrors()}}const e=this.lastReportedFileNames;const r=((n=this.externalFiles)==null?void 0:n.map((e=>({fileName:toNormalizedPath(e),isSourceOfProjectReferenceRedirect:false}))))||Hm;const s=arrayToMap(this.getFileNamesWithRedirectInfo(!!t).concat(r),(e=>e.fileName),(e=>e.isSourceOfProjectReferenceRedirect));const c=new Map;const l=new Map;const d=a?arrayFrom(a.keys()):[];const p=[];forEachEntry(s,((n,r)=>{if(!e.has(r)){c.set(r,n)}else if(t&&n!==e.get(r)){p.push({fileName:r,isSourceOfProjectReferenceRedirect:n})}}));forEachEntry(e,((e,t)=>{if(!s.has(t)){l.set(t,e)}}));this.lastReportedFileNames=s;this.lastReportedVersion=this.projectProgramVersion;return{info:o,changes:{added:i(c),removed:i(l),updated:t?d.map((e=>({fileName:e,isSourceOfProjectReferenceRedirect:this.isSourceOfProjectReferenceRedirect(e)}))):d,updatedRedirects:t?p:void 0},projectErrors:this.getGlobalProjectErrors()}}else{const e=this.getFileNamesWithRedirectInfo(!!t);const n=((r=this.externalFiles)==null?void 0:r.map((e=>({fileName:toNormalizedPath(e),isSourceOfProjectReferenceRedirect:false}))))||Hm;const i=e.concat(n);this.lastReportedFileNames=arrayToMap(i,(e=>e.fileName),(e=>e.isSourceOfProjectReferenceRedirect));this.lastReportedVersion=this.projectProgramVersion;return{info:o,files:t?i:i.map((e=>e.fileName)),projectErrors:this.getGlobalProjectErrors()}}}removeRoot(e){this.rootFilesMap.delete(e.path)}isSourceOfProjectReferenceRedirect(e){return!!this.program&&this.program.isSourceOfProjectReferenceRedirect(e)}getGlobalPluginSearchPaths(){return[...this.projectService.pluginProbeLocations,combinePaths(this.projectService.getExecutingFilePath(),"../../..")]}enableGlobalPlugins(e){if(!this.projectService.globalPlugins.length)return;const t=this.projectService.host;if(!t.require&&!t.importPlugin){this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");return}const n=this.getGlobalPluginSearchPaths();for(const t of this.projectService.globalPlugins){if(!t)continue;if(e.plugins&&e.plugins.some((e=>e.name===t)))continue;this.projectService.logger.info(`Loading global plugin ${t}`);this.enablePlugin({name:t,global:true},n)}}enablePlugin(e,t){this.projectService.requestEnablePlugin(this,e,t)}enableProxy(e,t){try{if(typeof e!=="function"){this.projectService.logger.info(`Skipped loading plugin ${t.name} because it did not expose a proper factory function`);return}const n={config:t,project:this,languageService:this.languageService,languageServiceHost:this,serverHost:this.projectService.host,session:this.projectService.session};const r=e({typescript:Bm});const i=r.create(n);for(const e of Object.keys(this.languageService)){if(!(e in i)){this.projectService.logger.info(`Plugin activation warning: Missing proxied method ${e} in created LS. Patching.`);i[e]=this.languageService[e]}}this.projectService.logger.info(`Plugin validation succeeded`);this.languageService=i;this.plugins.push({name:t.name,module:r})}catch(e){this.projectService.logger.info(`Plugin activation failed: ${e}`)}}onPluginConfigurationChanged(e,t){this.plugins.filter((t=>t.name===e)).forEach((e=>{if(e.module.onConfigurationChanged){e.module.onConfigurationChanged(t)}}))}refreshDiagnostics(){this.projectService.sendProjectsUpdatedInBackgroundEvent()}getPackageJsonsVisibleToFile(e,t){if(this.projectService.serverMode!==0)return Hm;return this.projectService.getPackageJsonsVisibleToFile(e,this,t)}getNearestAncestorDirectoryWithPackageJson(e){return this.projectService.getNearestAncestorDirectoryWithPackageJson(e,this)}getPackageJsonsForAutoImport(e){return this.getPackageJsonsVisibleToFile(combinePaths(this.currentDirectory,Ha),e)}getPackageJsonCache(){return this.projectService.packageJsonCache}getCachedExportInfoMap(){return this.exportMapCache||(this.exportMapCache=createCacheableExportInfoMap(this))}clearCachedExportInfoMap(){var e;(e=this.exportMapCache)==null?void 0:e.clear()}getModuleSpecifierCache(){return this.moduleSpecifierCache}includePackageJsonAutoImports(){if(this.projectService.includePackageJsonAutoImports()===0||!this.languageServiceEnabled||isInsideNodeModules(this.currentDirectory)||!this.isDefaultProjectForOpenFiles()){return 0}return this.projectService.includePackageJsonAutoImports()}getHostForAutoImportProvider(){var e,t;if(this.program){return{fileExists:this.program.fileExists,directoryExists:this.program.directoryExists,realpath:this.program.realpath||((e=this.projectService.host.realpath)==null?void 0:e.bind(this.projectService.host)),getCurrentDirectory:this.getCurrentDirectory.bind(this),readFile:this.projectService.host.readFile.bind(this.projectService.host),getDirectories:this.projectService.host.getDirectories.bind(this.projectService.host),trace:(t=this.projectService.host.trace)==null?void 0:t.bind(this.projectService.host),useCaseSensitiveFileNames:this.program.useCaseSensitiveFileNames(),readDirectory:this.projectService.host.readDirectory.bind(this.projectService.host)}}return this.projectService.host}getPackageJsonAutoImportProvider(){var e,t,n;if(this.autoImportProviderHost===false){return void 0}if(this.projectService.serverMode!==0){this.autoImportProviderHost=false;return void 0}if(this.autoImportProviderHost){updateProjectIfDirty(this.autoImportProviderHost);if(this.autoImportProviderHost.isEmpty()){this.autoImportProviderHost.close();this.autoImportProviderHost=void 0;return void 0}return this.autoImportProviderHost.getCurrentProgram()}const r=this.includePackageJsonAutoImports();if(r){(e=G)==null?void 0:e.push(G.Phase.Session,"getPackageJsonAutoImportProvider");const i=R();this.autoImportProviderHost=__.create(r,this,this.getHostForAutoImportProvider())??false;if(this.autoImportProviderHost){updateProjectIfDirty(this.autoImportProviderHost);this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider",R()-i);(t=G)==null?void 0:t.pop();return this.autoImportProviderHost.getCurrentProgram()}(n=G)==null?void 0:n.pop()}}isDefaultProjectForOpenFiles(){return!!forEachEntry(this.projectService.openFiles,((e,t)=>this.projectService.tryGetDefaultProjectForFile(this.projectService.getScriptInfoForPath(t))===this))}watchNodeModulesForPackageJsonChanges(e){return this.projectService.watchPackageJsonsInNodeModules(e,this)}getIncompleteCompletionsCache(){return this.projectService.getIncompleteCompletionsCache()}getNoDtsResolutionProject(e){S.assert(this.projectService.serverMode===0);this.noDtsResolutionProject??(this.noDtsResolutionProject=new f_(this));if(this.noDtsResolutionProject.rootFile!==e){this.projectService.setFileNamesOfAutoImportProviderOrAuxillaryProject(this.noDtsResolutionProject,[e]);this.noDtsResolutionProject.rootFile=e}return this.noDtsResolutionProject}runWithTemporaryFileUpdate(e,t,n){var r,i,o,a;const s=this.program;const c=S.checkDefined((r=this.program)==null?void 0:r.getSourceFile(e),"Expected file to be part of program");const l=S.checkDefined(c.getFullText());(i=this.getScriptInfo(e))==null?void 0:i.editContent(0,l.length,t);this.updateGraph();try{n(this.program,s,(o=this.program)==null?void 0:o.getSourceFile(e))}finally{(a=this.getScriptInfo(e))==null?void 0:a.editContent(0,t.length,l)}}getCompilerOptionsForNoDtsResolutionProject(){return{...this.getCompilerOptions(),noDtsResolution:true,allowJs:true,maxNodeModuleJsDepth:3,diagnostics:false,skipLibCheck:true,sourceMap:false,types:d,lib:d,noLib:true}}};function getUnresolvedImports(e,t){var n,r;const i=e.getSourceFiles();(n=G)==null?void 0:n.push(G.Phase.Session,"getUnresolvedImports",{count:i.length});const o=e.getTypeChecker().getAmbientModules().map((e=>stripQuotes(e.getName())));const a=sortAndDeduplicate(flatMap(i,(n=>extractUnresolvedImportsFromSourceFile(e,n,o,t))));(r=G)==null?void 0:r.pop();return a}function extractUnresolvedImportsFromSourceFile(e,t,n,r){return getOrUpdate(r,t.path,(()=>{let r;e.forEachResolvedModule((({resolvedModule:e},t)=>{if((!e||!resolutionExtensionIsTSOrJson(e.extension))&&!isExternalModuleNameRelative(t)&&!n.some((e=>e===t))){r=append(r,parsePackageName(t).packageName)}}),t);return r||Hm}))}var u_=class extends p_{constructor(e,t,n,r,i,o){super(e.newInferredProjectName(),0,e,false,void 0,t,false,n,e.host,i);this._isJsInferredProject=false;this.typeAcquisition=o;this.projectRootPath=r&&e.toCanonicalFileName(r);if(!r&&!e.useSingleInferredProject){this.canonicalCurrentDirectory=e.toCanonicalFileName(this.currentDirectory)}this.enableGlobalPlugins(this.getCompilerOptions())}toggleJsInferredProject(e){if(e!==this._isJsInferredProject){this._isJsInferredProject=e;this.setCompilerOptions()}}setCompilerOptions(e){if(!e&&!this.getCompilationSettings()){return}const t=cloneCompilerOptions(e||this.getCompilationSettings());if(this._isJsInferredProject&&typeof t.maxNodeModuleJsDepth!=="number"){t.maxNodeModuleJsDepth=2}else if(!this._isJsInferredProject){t.maxNodeModuleJsDepth=void 0}t.allowJs=true;super.setCompilerOptions(t)}addRoot(e){S.assert(e.isScriptOpen());this.projectService.startWatchingConfigFilesForInferredProjectRoot(e);if(!this._isJsInferredProject&&e.isJavaScript()){this.toggleJsInferredProject(true)}else if(this.isOrphan()&&this._isJsInferredProject&&!e.isJavaScript()){this.toggleJsInferredProject(false)}super.addRoot(e)}removeRoot(e){this.projectService.stopWatchingConfigFilesForScriptInfo(e);super.removeRoot(e);if(!this.isOrphan()&&this._isJsInferredProject&&e.isJavaScript()){if(every(this.getRootScriptInfos(),(e=>!e.isJavaScript()))){this.toggleJsInferredProject(false)}}}isOrphan(){return!this.hasRoots()}isProjectWithSingleRoot(){return!this.projectRootPath&&!this.projectService.useSingleInferredProject||this.getRootScriptInfos().length===1}close(){forEach(this.getRootScriptInfos(),(e=>this.projectService.stopWatchingConfigFilesForScriptInfo(e)));super.close()}getTypeAcquisition(){return this.typeAcquisition||{enable:allRootFilesAreJsOrDts(this),include:d,exclude:d}}};var f_=class extends p_{constructor(e){super(e.projectService.newAuxiliaryProjectName(),4,e.projectService,false,void 0,e.getCompilerOptionsForNoDtsResolutionProject(),false,void 0,e.projectService.host,e.currentDirectory)}isOrphan(){return true}scheduleInvalidateResolutionsOfFailedLookupLocations(){return}};var m_=class _AutoImportProviderProject extends p_{constructor(e,t,n){super(e.projectService.newAutoImportProviderProjectName(),3,e.projectService,false,void 0,n,false,e.getWatchOptions(),e.projectService.host,e.currentDirectory);this.hostProject=e;this.rootFileNames=t;this.useSourceOfProjectReferenceRedirect=maybeBind(this.hostProject,this.hostProject.useSourceOfProjectReferenceRedirect);this.getParsedCommandLine=maybeBind(this.hostProject,this.hostProject.getParsedCommandLine)}static getRootFileNames(e,t,n,r){var i,o;if(!e){return d}const a=t.getCurrentProgram();if(!a){return d}const s=R();let c;let l;const p=combinePaths(t.currentDirectory,Ha);const u=t.getPackageJsonsForAutoImport(combinePaths(t.currentDirectory,p));for(const e of u){(i=e.dependencies)==null?void 0:i.forEach(((e,t)=>addDependency(t)));(o=e.peerDependencies)==null?void 0:o.forEach(((e,t)=>addDependency(t)))}let f=0;if(c){const i=t.getSymlinkCache();for(const o of arrayFrom(c.keys())){if(e===2&&f>=this.maxDependencies){t.log(`AutoImportProviderProject: attempted to add more than ${this.maxDependencies} dependencies. Aborting.`);return d}const s=resolvePackageNameToPackageJson(o,t.currentDirectory,r,n,a.getModuleResolutionCache());if(s){const e=getRootNamesFromPackageJson(s,a,i);if(e){f+=addRootNames(e);continue}}const c=forEach([t.currentDirectory,t.getGlobalTypingsCacheLocation()],(e=>{if(e){const t=resolvePackageNameToPackageJson(`@types/${o}`,e,r,n,a.getModuleResolutionCache());if(t){const e=getRootNamesFromPackageJson(t,a,i);f+=addRootNames(e);return true}}}));if(c)continue;if(s&&r.allowJs&&r.maxNodeModuleJsDepth){const e=getRootNamesFromPackageJson(s,a,i,true);f+=addRootNames(e)}}}const m=a.getResolvedProjectReferences();let _=0;if((m==null?void 0:m.length)&&t.projectService.getHostPreferences().includeCompletionsForModuleExports){m.forEach((e=>{if(e==null?void 0:e.commandLine.options.outFile){_+=addRootNames(filterEntrypoints([changeExtension(e.commandLine.options.outFile,".d.ts")]))}else if(e){const n=memoize((()=>getCommonSourceDirectoryOfConfig(e.commandLine,!t.useCaseSensitiveFileNames())));_+=addRootNames(filterEntrypoints(mapDefined(e.commandLine.fileNames,(r=>!isDeclarationFileName(r)&&!fileExtensionIs(r,".json")&&!a.getSourceFile(r)?getOutputDeclarationFileName(r,e.commandLine,!t.useCaseSensitiveFileNames(),n):void 0))))}}))}if(l==null?void 0:l.size){t.log(`AutoImportProviderProject: found ${l.size} root files in ${f} dependencies ${_} referenced projects in ${R()-s} ms`)}return l?arrayFrom(l.values()):d;function addRootNames(e){if(!(e==null?void 0:e.length))return 0;l??(l=new Set);e.forEach((e=>l.add(e)));return 1}function addDependency(e){if(!startsWith(e,"@types/")){(c||(c=new Set)).add(e)}}function getRootNamesFromPackageJson(e,i,o,a){var s;const c=getEntrypointsFromPackageJsonInfo(e,r,n,i.getModuleResolutionCache(),a);if(c){const r=(s=n.realpath)==null?void 0:s.call(n,e.packageDirectory);const i=r?t.toPath(r):void 0;const a=i&&i!==t.toPath(e.packageDirectory);if(a){o.setSymlinkedDirectory(e.packageDirectory,{real:ensureTrailingDirectorySeparator(r),realPath:ensureTrailingDirectorySeparator(i)})}return filterEntrypoints(c,a?t=>t.replace(e.packageDirectory,r):void 0)}}function filterEntrypoints(e,t){return mapDefined(e,(e=>{const n=t?t(e):e;if(!a.getSourceFile(n)&&!(t&&a.getSourceFile(e))){return n}}))}}static create(e,t,n){if(e===0){return void 0}const r={...t.getCompilerOptions(),...this.compilerOptionsOverrides};const i=this.getRootFileNames(e,t,n,r);if(!i.length){return void 0}return new _AutoImportProviderProject(t,i,r)}isEmpty(){return!some(this.rootFileNames)}isOrphan(){return true}updateGraph(){let e=this.rootFileNames;if(!e){e=_AutoImportProviderProject.getRootFileNames(this.hostProject.includePackageJsonAutoImports(),this.hostProject,this.hostProject.getHostForAutoImportProvider(),this.getCompilationSettings())}this.projectService.setFileNamesOfAutoImportProviderOrAuxillaryProject(this,e);this.rootFileNames=e;const t=this.getCurrentProgram();const n=super.updateGraph();if(t&&t!==this.getCurrentProgram()){this.hostProject.clearCachedExportInfoMap()}return n}scheduleInvalidateResolutionsOfFailedLookupLocations(){return}hasRoots(){var e;return!!((e=this.rootFileNames)==null?void 0:e.length)}markAsDirty(){this.rootFileNames=void 0;super.markAsDirty()}getScriptFileNames(){return this.rootFileNames||d}getLanguageService(){throw new Error("AutoImportProviderProject language service should never be used. To get the program, use `project.getCurrentProgram()`.")}onAutoImportProviderSettingsChanged(){throw new Error("AutoImportProviderProject is an auto import provider; use `markAsDirty()` instead.")}onPackageJsonChange(){throw new Error("package.json changes should be notified on an AutoImportProvider's host project")}getHostForAutoImportProvider(){throw new Error("AutoImportProviderProject cannot provide its own host; use `hostProject.getModuleResolutionHostForAutomImportProvider()` instead.")}getProjectReferences(){return this.hostProject.getProjectReferences()}includePackageJsonAutoImports(){return 0}getSymlinkCache(){return this.hostProject.getSymlinkCache()}getModuleResolutionCache(){var e;return(e=this.hostProject.getCurrentProgram())==null?void 0:e.getModuleResolutionCache()}};m_.maxDependencies=10;m_.compilerOptionsOverrides={diagnostics:false,skipLibCheck:true,sourceMap:false,types:d,lib:d,noLib:true};var __=m_;var g_=class extends p_{constructor(e,t,n,r,i){super(e,1,n,false,void 0,{},false,void 0,r,getDirectoryPath(e));this.canonicalConfigFilePath=t;this.openFileWatchTriggered=new Map;this.initialLoadPending=true;this.sendLoadingProjectFinish=false;this.pendingUpdateLevel=2;this.pendingUpdateReason=i}setCompilerHost(e){this.compilerHost=e}getCompilerHost(){return this.compilerHost}useSourceOfProjectReferenceRedirect(){return this.languageServiceEnabled}getParsedCommandLine(e){const t=toNormalizedPath(e);const n=asNormalizedPath(this.projectService.toCanonicalFileName(t));let r=this.projectService.configFileExistenceInfoCache.get(n);if(!r){this.projectService.configFileExistenceInfoCache.set(n,r={exists:this.projectService.host.fileExists(t)})}this.projectService.ensureParsedConfigUptoDate(t,n,r,this);if(this.languageServiceEnabled&&this.projectService.serverMode===0){this.projectService.watchWildcards(t,r,this)}return r.exists?r.config.parsedCommandLine:void 0}onReleaseParsedCommandLine(e){this.releaseParsedConfig(asNormalizedPath(this.projectService.toCanonicalFileName(toNormalizedPath(e))))}releaseParsedConfig(e){this.projectService.stopWatchingWildCards(e,this);this.projectService.releaseParsedConfig(e,this)}updateGraph(){if(this.deferredClose)return false;const e=this.dirty;this.initialLoadPending=false;const t=this.pendingUpdateLevel;this.pendingUpdateLevel=0;let n;switch(t){case 1:this.openFileWatchTriggered.clear();n=this.projectService.reloadFileNamesOfConfiguredProject(this);break;case 2:this.openFileWatchTriggered.clear();const e=S.checkDefined(this.pendingUpdateReason);this.projectService.reloadConfiguredProject(this,e);n=true;break;default:n=super.updateGraph()}this.compilerHost=void 0;this.projectService.sendProjectLoadingFinishEvent(this);this.projectService.sendProjectTelemetry(this);if(t===2||n&&(!e||!this.triggerFileForConfigFileDiag||this.getCurrentProgram().structureIsReused===2)){this.triggerFileForConfigFileDiag=void 0}else if(!this.triggerFileForConfigFileDiag){this.projectService.sendConfigFileDiagEvent(this,void 0,false)}return n}getCachedDirectoryStructureHost(){return this.directoryStructureHost}getConfigFilePath(){return asNormalizedPath(this.getProjectName())}getProjectReferences(){return this.projectReferences}updateReferences(e){this.projectReferences=e;this.potentialProjectReferences=void 0}setPotentialProjectReference(e){S.assert(this.initialLoadPending);(this.potentialProjectReferences||(this.potentialProjectReferences=new Set)).add(e)}getResolvedProjectReferenceToRedirect(e){const t=this.getCurrentProgram();return t&&t.getResolvedProjectReferenceToRedirect(e)}forEachResolvedProjectReference(e){var t;return(t=this.getCurrentProgram())==null?void 0:t.forEachResolvedProjectReference(e)}enablePluginsWithOptions(e){var t;this.plugins.length=0;if(!((t=e.plugins)==null?void 0:t.length)&&!this.projectService.globalPlugins.length)return;const n=this.projectService.host;if(!n.require&&!n.importPlugin){this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");return}const r=this.getGlobalPluginSearchPaths();if(this.projectService.allowLocalPluginLoads){const e=getDirectoryPath(this.canonicalConfigFilePath);this.projectService.logger.info(`Local plugin loading enabled; adding ${e} to search paths`);r.unshift(e)}if(e.plugins){for(const t of e.plugins){this.enablePlugin(t,r)}}return this.enableGlobalPlugins(e)}getGlobalProjectErrors(){return filter(this.projectErrors,(e=>!e.file))||Hm}getAllProjectErrors(){return this.projectErrors||Hm}setProjectErrors(e){this.projectErrors=e}close(){this.projectService.configFileExistenceInfoCache.forEach(((e,t)=>this.releaseParsedConfig(t)));this.projectErrors=void 0;this.openFileWatchTriggered.clear();this.compilerHost=void 0;super.close()}markAsDirty(){if(this.deferredClose)return;super.markAsDirty()}isOrphan(){return!!this.deferredClose}getEffectiveTypeRoots(){return getEffectiveTypeRoots(this.getCompilationSettings(),this)||[]}updateErrorOnNoInputFiles(e){this.parsedCommandLine=e;updateErrorForNoInputFiles(e.fileNames,this.getConfigFilePath(),this.getCompilerOptions().configFile.configFileSpecs,this.projectErrors,canJsonReportNoInputFiles(e.raw))}};var y_=class extends p_{constructor(e,t,n,r,i,o,a){super(e,2,t,true,r,n,i,a,t.host,getDirectoryPath(o||normalizeSlashes(e)));this.externalProjectName=e;this.compileOnSaveEnabled=i;this.excludedFiles=[];this.enableGlobalPlugins(this.getCompilerOptions())}updateGraph(){const e=super.updateGraph();this.projectService.sendProjectTelemetry(this);return e}getExcludedFiles(){return this.excludedFiles}};function isInferredProject(e){return e.projectKind===0}function isConfiguredProject(e){return e.projectKind===1}function isExternalProject(e){return e.projectKind===2}function isBackgroundProject(e){return e.projectKind===3||e.projectKind===4}function isProjectDeferredClose(e){return isConfiguredProject(e)&&!!e.deferredClose}var h_=20*1024*1024;var T_=4*1024*1024;var S_="projectsUpdatedInBackground";var v_="projectLoadingStart";var x_="projectLoadingFinish";var b_="largeFileReferenced";var C_="configFileDiag";var E_="projectLanguageServiceState";var N_="projectInfo";var k_="openFileInfo";var F_="createFileWatcher";var P_="createDirectoryWatcher";var D_="closeFileWatcher";var I_="*ensureProjectForOpenFiles*";function prepareConvertersForEnumLikeCompilerOptions(e){const t=new Map;for(const n of e){if(typeof n.type==="object"){const e=n.type;e.forEach((e=>{S.assert(typeof e==="number")}));t.set(n.name,e)}}return t}var A_=prepareConvertersForEnumLikeCompilerOptions(eo);var O_=prepareConvertersForEnumLikeCompilerOptions($i);var w_=new Map(Object.entries({none:0,block:1,smart:2}));var L_={jquery:{match:/jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i,types:["jquery"]},WinJS:{match:/^(.*\/winjs-[.\d]+)\/js\/base\.js$/i,exclude:[["^",1,"/.*"]],types:["winjs"]},Kendo:{match:/^(.*\/kendo(-ui)?)\/kendo\.all(\.min)?\.js$/i,exclude:[["^",1,"/.*"]],types:["kendo-ui"]},"Office Nuget":{match:/^(.*\/office\/1)\/excel-\d+\.debug\.js$/i,exclude:[["^",1,"/.*"]],types:["office"]},References:{match:/^(.*\/_references\.js)$/i,exclude:[["^",1,"$"]]}};function convertFormatOptions(e){if(isString(e.indentStyle)){e.indentStyle=w_.get(e.indentStyle.toLowerCase());S.assert(e.indentStyle!==void 0)}return e}function convertCompilerOptions(e){A_.forEach(((t,n)=>{const r=e[n];if(isString(r)){e[n]=t.get(r.toLowerCase())}}));return e}function convertWatchOptions(e,t){let n;let r;$i.forEach((i=>{const o=e[i.name];if(o===void 0)return;const a=O_.get(i.name);(n||(n={}))[i.name]=a?isString(o)?a.get(o.toLowerCase()):o:convertJsonOption(i,o,t||"",r||(r=[]))}));return n&&{watchOptions:n,errors:r}}function convertTypeAcquisition(e){let t;_o.forEach((n=>{const r=e[n.name];if(r===void 0)return;(t||(t={}))[n.name]=r}));return t}function tryConvertScriptKindName(e){return isString(e)?convertScriptKindName(e):e}function convertScriptKindName(e){switch(e){case"JS":return 1;case"JSX":return 2;case"TS":return 3;case"TSX":return 4;default:return 0}}function convertUserPreferences(e){const{lazyConfiguredProjectsFromExternalProject:t,...n}=e;return n}var M_={getFileName:e=>e,getScriptKind:(e,t)=>{let n;if(t){const r=getAnyExtensionFromPath(e);if(r){some(t,(e=>{if(e.extension===r){n=e.scriptKind;return true}return false}))}}return n},hasMixedContent:(e,t)=>some(t,(t=>t.isMixedContent&&fileExtensionIs(e,t.extension)))};var R_={getFileName:e=>e.fileName,getScriptKind:e=>tryConvertScriptKindName(e.scriptKind),hasMixedContent:e=>!!e.hasMixedContent};function findProjectByName(e,t){for(const n of t){if(n.getProjectName()===e){return n}}}var B_={isKnownTypesPackageName:returnFalse,installPackage:notImplemented,enqueueInstallTypingsRequest:noop,attach:noop,onProjectClosed:noop,globalTypingsCacheLocation:void 0};var j_={close:noop};function getConfigFileNameFromCache(e,t){if(!t)return void 0;const n=t.get(e.path);if(n===void 0)return void 0;if(!isAncestorConfigFileInfo(e)){return isString(n)||!n?n:n.get(false)}else{return n&&!isString(n)?n.get(e.fileName):void 0}}function isOpenScriptInfo(e){return!!e.containingProjects}function isAncestorConfigFileInfo(e){return!!e.configFileInfo}var J_=(e=>{e[e["FindOptimized"]=0]="FindOptimized";e[e["Find"]=1]="Find";e[e["CreateReplayOptimized"]=2]="CreateReplayOptimized";e[e["CreateReplay"]=3]="CreateReplay";e[e["CreateOptimized"]=4]="CreateOptimized";e[e["Create"]=5]="Create";e[e["ReloadOptimized"]=6]="ReloadOptimized";e[e["Reload"]=7]="Reload";return e})(J_||{});function toConfiguredProjectLoadOptimized(e){return e-1}function forEachAncestorProjectLoad(e,t,n,r,i,o,a,s,c){var l;while(true){if(t.parsedCommandLine&&(s&&!t.parsedCommandLine.options.composite||t.parsedCommandLine.options.disableSolutionSearching))return;const d=t.projectService.getConfigFileNameForFile({fileName:t.getConfigFilePath(),path:e.path,configFileInfo:true,isForDefaultProject:!s},r<=3);if(!d)return;const p=t.projectService.findCreateOrReloadConfiguredProject(d,r,i,o,!s?e.fileName:void 0,a,s,c);if(!p)return;if(!p.project.parsedCommandLine&&((l=t.parsedCommandLine)==null?void 0:l.options.composite)){p.project.setPotentialProjectReference(t.canonicalConfigFilePath)}const u=n(p);if(u)return u;t=p.project}}function forEachResolvedProjectReferenceProjectLoad(e,t,n,r,i,o,a,s){const c=t.options.disableReferencedProjectLoad?0:r;let l;return forEach(t.projectReferences,(t=>{var d;const p=toNormalizedPath(resolveProjectReferencePath(t));const u=asNormalizedPath(e.projectService.toCanonicalFileName(p));const f=s==null?void 0:s.get(u);if(f!==void 0&&f>=c)return void 0;const m=e.projectService.configFileExistenceInfoCache.get(u);let _=c===0?(m==null?void 0:m.exists)||((d=e.resolvedChildConfigs)==null?void 0:d.has(u))?m.config.parsedCommandLine:void 0:e.getParsedCommandLine(p);if(_&&c!==r&&c>2){_=e.getParsedCommandLine(p)}if(!_)return void 0;const g=e.projectService.findConfiguredProjectByProjectName(p,o);if(c===2&&!m&&!g)return void 0;switch(c){case 6:if(g)g.projectService.reloadConfiguredProjectOptimized(g,i,a);case 4:(e.resolvedChildConfigs??(e.resolvedChildConfigs=new Set)).add(u);case 2:case 0:if(g||c!==0){const t=n(m??e.projectService.configFileExistenceInfoCache.get(u),g,p,i,e,u);if(t)return t}break;default:S.assertNever(c)}(s??(s=new Map)).set(u,c);(l??(l=[])).push(_)}))||forEach(l,(t=>t.projectReferences&&forEachResolvedProjectReferenceProjectLoad(e,t,n,c,i,o,a,s)))}function updateProjectFoundUsingFind(e,t,n,r,i){let o=false;let a;switch(t){case 2:case 3:if(useConfigFileExistenceInfoForOptimizedLoading(e)){a=e.projectService.configFileExistenceInfoCache.get(e.canonicalConfigFilePath)}break;case 4:a=configFileExistenceInfoForOptimizedLoading(e);if(a)break;case 5:o=updateConfiguredProject(e,n);break;case 6:e.projectService.reloadConfiguredProjectOptimized(e,r,i);a=configFileExistenceInfoForOptimizedLoading(e);if(a)break;case 7:o=e.projectService.reloadConfiguredProjectClearingSemanticCache(e,r,i);break;case 0:case 1:break;default:S.assertNever(t)}return{project:e,sentConfigFileDiag:o,configFileExistenceInfo:a,reason:r}}function forEachPotentialProjectReference(e,t){return e.initialLoadPending?(e.potentialProjectReferences&&forEachKey(e.potentialProjectReferences,t))??(e.resolvedChildConfigs&&forEachKey(e.resolvedChildConfigs,t)):void 0}function forEachAnyProjectReferenceKind(e,t,n,r){return e.getCurrentProgram()?e.forEachResolvedProjectReference(t):e.initialLoadPending?forEachPotentialProjectReference(e,r):forEach(e.getProjectReferences(),n)}function callbackRefProject(e,t,n){const r=n&&e.projectService.configuredProjects.get(n);return r&&t(r)}function forEachReferencedProject(e,t){return forEachAnyProjectReferenceKind(e,(n=>callbackRefProject(e,t,n.sourceFile.path)),(n=>callbackRefProject(e,t,e.toPath(resolveProjectReferencePath(n)))),(n=>callbackRefProject(e,t,n)))}function getDetailWatchInfo(e,t){return`${isString(t)?`Config: ${t} `:t?`Project: ${t.getProjectName()} `:""}WatchType: ${e}`}function isScriptInfoWatchedFromNodeModules(e){return!e.isScriptOpen()&&e.mTime!==void 0}function updateProjectIfDirty(e){e.invalidateResolutionsOfFailedLookupLocations();return e.dirty&&!e.updateGraph()}function updateWithTriggerFile(e,t,n){if(!n){e.invalidateResolutionsOfFailedLookupLocations();if(!e.dirty)return false}e.triggerFileForConfigFileDiag=t;const r=e.pendingUpdateLevel;e.updateGraph();if(!e.triggerFileForConfigFileDiag&&!n)return r===2;const i=e.projectService.sendConfigFileDiagEvent(e,t,n);e.triggerFileForConfigFileDiag=void 0;return i}function updateConfiguredProject(e,t){if(t){if(updateWithTriggerFile(e,t,false))return true}else{updateProjectIfDirty(e)}return false}function configFileExistenceInfoForOptimizedLoading(e){const t=toNormalizedPath(e.getConfigFilePath());const n=e.projectService.ensureParsedConfigUptoDate(t,e.canonicalConfigFilePath,e.projectService.configFileExistenceInfoCache.get(e.canonicalConfigFilePath),e);const r=n.config.parsedCommandLine;e.parsedCommandLine=r;e.resolvedChildConfigs=void 0;e.updateReferences(r.projectReferences);if(useConfigFileExistenceInfoForOptimizedLoading(e))return n}function useConfigFileExistenceInfoForOptimizedLoading(e){return!!e.parsedCommandLine&&(!!e.parsedCommandLine.options.composite||!!isSolutionConfig(e.parsedCommandLine))}function configFileExistenceInfoForOptimizedReplay(e){return useConfigFileExistenceInfoForOptimizedLoading(e)?e.projectService.configFileExistenceInfoCache.get(e.canonicalConfigFilePath):void 0}function fileOpenReason(e){return`Creating possible configured project for ${e.fileName} to open`}function reloadReason(e){return`User requested reload projects: ${e}`}function setProjectOptionsUsed(e){if(isConfiguredProject(e)){e.projectOptions=true}}function createProjectNameFactoryWithCounter(e){let t=1;return()=>e(t++)}function getHostWatcherMap(){return{idToCallbacks:new Map,pathToId:new Map}}function getCanUseWatchEvents(e,t){return!!t&&!!e.eventHandler&&!!e.session}function createWatchFactoryHostUsingWatchEvents(e,t){if(!getCanUseWatchEvents(e,t))return void 0;const n=getHostWatcherMap();const r=getHostWatcherMap();const i=getHostWatcherMap();let o=1;e.session.addProtocolHandler("watchChange",(e=>{onWatchChange(e.arguments);return{responseRequired:false}}));return{watchFile:watchFile2,watchDirectory:watchDirectory,getCurrentDirectory:()=>e.host.getCurrentDirectory(),useCaseSensitiveFileNames:e.host.useCaseSensitiveFileNames};function watchFile2(e,t){return getOrCreateFileWatcher(n,e,t,(t=>({eventName:F_,data:{id:t,path:e}})))}function watchDirectory(e,t,n){return getOrCreateFileWatcher(n?i:r,e,t,(t=>({eventName:P_,data:{id:t,path:e,recursive:!!n,ignoreUpdate:!e.endsWith("/node_modules")?true:void 0}})))}function getOrCreateFileWatcher({pathToId:t,idToCallbacks:n},r,i,a){const s=e.toPath(r);let c=t.get(s);if(!c)t.set(s,c=o++);let l=n.get(c);if(!l){n.set(c,l=new Set);e.eventHandler(a(c))}l.add(i);return{close(){const r=n.get(c);if(!(r==null?void 0:r.delete(i)))return;if(r.size)return;n.delete(c);t.delete(s);e.eventHandler({eventName:D_,data:{id:c}})}}}function onWatchChange(e){if(isArray(e))e.forEach(onWatchChangeRequestArgs);else onWatchChangeRequestArgs(e)}function onWatchChangeRequestArgs({id:e,created:t,deleted:n,updated:r}){onWatchEventType(e,t,0);onWatchEventType(e,n,2);onWatchEventType(e,r,1)}function onWatchEventType(e,t,o){if(!(t==null?void 0:t.length))return;forEachCallback(n,e,t,((e,t)=>e(t,o)));forEachCallback(r,e,t,((e,t)=>e(t)));forEachCallback(i,e,t,((e,t)=>e(t)))}function forEachCallback(e,t,n,r){var i;(i=e.idToCallbacks.get(t))==null?void 0:i.forEach((e=>{n.forEach((t=>r(e,normalizeSlashes(t))))}))}}var W_=class _ProjectService{constructor(e){this.filenameToScriptInfo=new Map;this.nodeModulesWatchers=new Map;this.filenameToScriptInfoVersion=new Map;this.allJsFilesForOpenFileTelemetry=new Set;this.externalProjectToConfiguredProjectMap=new Map;this.externalProjects=[];this.inferredProjects=[];this.configuredProjects=new Map;this.newInferredProjectName=createProjectNameFactoryWithCounter(makeInferredProjectName);this.newAutoImportProviderProjectName=createProjectNameFactoryWithCounter(makeAutoImportProviderProjectName);this.newAuxiliaryProjectName=createProjectNameFactoryWithCounter(makeAuxiliaryProjectName);this.openFiles=new Map;this.configFileForOpenFiles=new Map;this.rootOfInferredProjects=new Set;this.openFilesWithNonRootedDiskPath=new Map;this.compilerOptionsForInferredProjectsPerProjectRoot=new Map;this.watchOptionsForInferredProjectsPerProjectRoot=new Map;this.typeAcquisitionForInferredProjectsPerProjectRoot=new Map;this.projectToSizeMap=new Map;this.configFileExistenceInfoCache=new Map;this.safelist=L_;this.legacySafelist=new Map;this.pendingProjectUpdates=new Map;this.pendingEnsureProjectForOpenFiles=false;this.seenProjects=new Map;this.sharedExtendedConfigFileWatchers=new Map;this.extendedConfigCache=new Map;this.baseline=noop;this.verifyDocumentRegistry=noop;this.verifyProgram=noop;this.onProjectCreation=noop;var t;this.host=e.host;this.logger=e.logger;this.cancellationToken=e.cancellationToken;this.useSingleInferredProject=e.useSingleInferredProject;this.useInferredProjectPerProjectRoot=e.useInferredProjectPerProjectRoot;this.typingsInstaller=e.typingsInstaller||B_;this.throttleWaitMilliseconds=e.throttleWaitMilliseconds;this.eventHandler=e.eventHandler;this.suppressDiagnosticEvents=e.suppressDiagnosticEvents;this.globalPlugins=e.globalPlugins||Hm;this.pluginProbeLocations=e.pluginProbeLocations||Hm;this.allowLocalPluginLoads=!!e.allowLocalPluginLoads;this.typesMapLocation=e.typesMapLocation===void 0?combinePaths(getDirectoryPath(this.getExecutingFilePath()),"typesMap.json"):e.typesMapLocation;this.session=e.session;this.jsDocParsingMode=e.jsDocParsingMode;if(e.serverMode!==void 0){this.serverMode=e.serverMode}else{this.serverMode=0}if(this.host.realpath){this.realpathToScriptInfos=createMultiMap()}this.currentDirectory=toNormalizedPath(this.host.getCurrentDirectory());this.toCanonicalFileName=createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);this.globalCacheLocationDirectoryPath=this.typingsInstaller.globalTypingsCacheLocation?ensureTrailingDirectorySeparator(this.toPath(this.typingsInstaller.globalTypingsCacheLocation)):void 0;this.throttledOperations=new $m(this.host,this.logger);this.logger.info(`currentDirectory:: ${this.host.getCurrentDirectory()} useCaseSensitiveFileNames:: ${this.host.useCaseSensitiveFileNames}`);this.logger.info(`libs Location:: ${getDirectoryPath(this.host.getExecutingFilePath())}`);this.logger.info(`globalTypingsCacheLocation:: ${this.typingsInstaller.globalTypingsCacheLocation}`);if(this.typesMapLocation){this.loadTypesMap()}else{this.logger.info("No types map provided; using the default")}this.typingsInstaller.attach(this);this.hostConfiguration={formatCodeOptions:getDefaultFormatCodeSettings(this.host.newLine),preferences:Fs,hostInfo:"Unknown host",extraFileExtensions:[]};this.documentRegistry=createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames,this.currentDirectory,this.jsDocParsingMode,this);const n=this.logger.hasLevel(3)?2:this.logger.loggingEnabled()?1:0;const r=n!==0?e=>this.logger.info(e):noop;this.packageJsonCache=createPackageJsonCache(this);this.watchFactory=this.serverMode!==0?{watchFile:returnNoopFileWatcher,watchDirectory:returnNoopFileWatcher}:getWatchFactory(createWatchFactoryHostUsingWatchEvents(this,e.canUseWatchEvents)||this.host,n,r,getDetailWatchInfo);this.canUseWatchEvents=getCanUseWatchEvents(this,e.canUseWatchEvents);(t=e.incrementalVerifier)==null?void 0:t.call(e,this)}toPath(e){return toPath(e,this.currentDirectory,this.toCanonicalFileName)}getExecutingFilePath(){return this.getNormalizedAbsolutePath(this.host.getExecutingFilePath())}getNormalizedAbsolutePath(e){return getNormalizedAbsolutePath(e,this.host.getCurrentDirectory())}setDocument(e,t,n){const r=S.checkDefined(this.getScriptInfoForPath(t));r.cacheSourceFile={key:e,sourceFile:n}}getDocument(e,t){const n=this.getScriptInfoForPath(t);return n&&n.cacheSourceFile&&n.cacheSourceFile.key===e?n.cacheSourceFile.sourceFile:void 0}ensureInferredProjectsUpToDate_TestOnly(){this.ensureProjectStructuresUptoDate()}getCompilerOptionsForInferredProjects(){return this.compilerOptionsForInferredProjects}onUpdateLanguageServiceStateForProject(e,t){if(!this.eventHandler){return}const n={eventName:E_,data:{project:e,languageServiceEnabled:t}};this.eventHandler(n)}loadTypesMap(){try{const e=this.host.readFile(this.typesMapLocation);if(e===void 0){this.logger.info(`Provided types map file "${this.typesMapLocation}" doesn't exist`);return}const t=JSON.parse(e);for(const e of Object.keys(t.typesMap)){t.typesMap[e].match=new RegExp(t.typesMap[e].match,"i")}this.safelist=t.typesMap;for(const e in t.simpleMap){if(hasProperty(t.simpleMap,e)){this.legacySafelist.set(e,t.simpleMap[e].toLowerCase())}}}catch(e){this.logger.info(`Error loading types map: ${e}`);this.safelist=L_;this.legacySafelist.clear()}}updateTypingsForProject(e){const t=this.findProject(e.projectName);if(!t){return}switch(e.kind){case us:t.updateTypingFiles(e.compilerOptions,e.typeAcquisition,e.unresolvedImports,e.typings);return;case fs:t.enqueueInstallTypingsForProject(true);return}}watchTypingLocations(e){var t;(t=this.findProject(e.projectName))==null?void 0:t.watchTypingLocations(e.files)}delayEnsureProjectForOpenFiles(){if(!this.openFiles.size)return;this.pendingEnsureProjectForOpenFiles=true;this.throttledOperations.schedule(I_,2500,(()=>{if(this.pendingProjectUpdates.size!==0){this.delayEnsureProjectForOpenFiles()}else{if(this.pendingEnsureProjectForOpenFiles){this.ensureProjectForOpenFiles();this.sendProjectsUpdatedInBackgroundEvent()}}}))}delayUpdateProjectGraph(e){if(isProjectDeferredClose(e))return;e.markAsDirty();if(isBackgroundProject(e))return;const t=e.getProjectName();this.pendingProjectUpdates.set(t,e);this.throttledOperations.schedule(t,250,(()=>{if(this.pendingProjectUpdates.delete(t)){updateProjectIfDirty(e)}}))}hasPendingProjectUpdate(e){return this.pendingProjectUpdates.has(e.getProjectName())}sendProjectsUpdatedInBackgroundEvent(){if(!this.eventHandler){return}const e={eventName:S_,data:{openFiles:arrayFrom(this.openFiles.keys(),(e=>this.getScriptInfoForPath(e).fileName))}};this.eventHandler(e)}sendLargeFileReferencedEvent(e,t){if(!this.eventHandler){return}const n={eventName:b_,data:{file:e,fileSize:t,maxFileSize:T_}};this.eventHandler(n)}sendProjectLoadingStartEvent(e,t){if(!this.eventHandler){return}e.sendLoadingProjectFinish=true;const n={eventName:v_,data:{project:e,reason:t}};this.eventHandler(n)}sendProjectLoadingFinishEvent(e){if(!this.eventHandler||!e.sendLoadingProjectFinish){return}e.sendLoadingProjectFinish=false;const t={eventName:x_,data:{project:e}};this.eventHandler(t)}sendPerformanceEvent(e,t){if(this.performanceEventHandler){this.performanceEventHandler({kind:e,durationMs:t})}}delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(e){this.delayUpdateProjectGraph(e);this.delayEnsureProjectForOpenFiles()}delayUpdateProjectGraphs(e,t){if(e.length){for(const n of e){if(t)n.clearSourceMapperCache();this.delayUpdateProjectGraph(n)}this.delayEnsureProjectForOpenFiles()}}setCompilerOptionsForInferredProjects(e,t){S.assert(t===void 0||this.useInferredProjectPerProjectRoot,"Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled");const n=convertCompilerOptions(e);const r=convertWatchOptions(e,t);const i=convertTypeAcquisition(e);n.allowNonTsExtensions=true;const o=t&&this.toCanonicalFileName(t);if(o){this.compilerOptionsForInferredProjectsPerProjectRoot.set(o,n);this.watchOptionsForInferredProjectsPerProjectRoot.set(o,r||false);this.typeAcquisitionForInferredProjectsPerProjectRoot.set(o,i)}else{this.compilerOptionsForInferredProjects=n;this.watchOptionsForInferredProjects=r;this.typeAcquisitionForInferredProjects=i}for(const e of this.inferredProjects){if(o?e.projectRootPath===o:!e.projectRootPath||!this.compilerOptionsForInferredProjectsPerProjectRoot.has(e.projectRootPath)){e.setCompilerOptions(n);e.setTypeAcquisition(i);e.setWatchOptions(r==null?void 0:r.watchOptions);e.setProjectErrors(r==null?void 0:r.errors);e.compileOnSaveEnabled=n.compileOnSave;e.markAsDirty();this.delayUpdateProjectGraph(e)}}this.delayEnsureProjectForOpenFiles()}findProject(e){if(e===void 0){return void 0}if(isInferredProjectName(e)){return findProjectByName(e,this.inferredProjects)}return this.findExternalProjectByProjectName(e)||this.findConfiguredProjectByProjectName(toNormalizedPath(e))}forEachProject(e){this.externalProjects.forEach(e);this.configuredProjects.forEach(e);this.inferredProjects.forEach(e)}forEachEnabledProject(e){this.forEachProject((t=>{if(!t.isOrphan()&&t.languageServiceEnabled){e(t)}}))}getDefaultProjectForFile(e,t){return t?this.ensureDefaultProjectForFile(e):this.tryGetDefaultProjectForFile(e)}tryGetDefaultProjectForFile(e){const t=isString(e)?this.getScriptInfoForNormalizedPath(e):e;return t&&!t.isOrphan()?t.getDefaultProject():void 0}tryGetDefaultProjectForEnsuringConfiguredProjectForFile(e){var t;const n=isString(e)?this.getScriptInfoForNormalizedPath(e):e;if(!n)return void 0;if((t=this.pendingOpenFileProjectUpdates)==null?void 0:t.delete(n.path)){this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(n,5);if(n.isOrphan()){this.assignOrphanScriptInfoToInferredProject(n,this.openFiles.get(n.path))}}return this.tryGetDefaultProjectForFile(n)}ensureDefaultProjectForFile(e){return this.tryGetDefaultProjectForEnsuringConfiguredProjectForFile(e)||this.doEnsureDefaultProjectForFile(e)}doEnsureDefaultProjectForFile(e){this.ensureProjectStructuresUptoDate();const t=isString(e)?this.getScriptInfoForNormalizedPath(e):e;return t?t.getDefaultProject():(this.logErrorForScriptInfoNotFound(isString(e)?e:e.fileName),Km.ThrowNoProject())}getScriptInfoEnsuringProjectsUptoDate(e){this.ensureProjectStructuresUptoDate();return this.getScriptInfo(e)}ensureProjectStructuresUptoDate(){let e=this.pendingEnsureProjectForOpenFiles;this.pendingProjectUpdates.clear();const updateGraph=t=>{e=updateProjectIfDirty(t)||e};this.externalProjects.forEach(updateGraph);this.configuredProjects.forEach(updateGraph);this.inferredProjects.forEach(updateGraph);if(e){this.ensureProjectForOpenFiles()}}getFormatCodeOptions(e){const t=this.getScriptInfoForNormalizedPath(e);return t&&t.getFormatCodeSettings()||this.hostConfiguration.formatCodeOptions}getPreferences(e){const t=this.getScriptInfoForNormalizedPath(e);return{...this.hostConfiguration.preferences,...t&&t.getPreferences()}}getHostFormatCodeOptions(){return this.hostConfiguration.formatCodeOptions}getHostPreferences(){return this.hostConfiguration.preferences}onSourceFileChanged(e,t){S.assert(!e.isScriptOpen());if(t===2){this.handleDeletedFile(e,true)}else{if(e.deferredDelete)e.deferredDelete=void 0;e.delayReloadNonMixedContentFile();this.delayUpdateProjectGraphs(e.containingProjects,false);this.handleSourceMapProjects(e)}}handleSourceMapProjects(e){if(e.sourceMapFilePath){if(isString(e.sourceMapFilePath)){const t=this.getScriptInfoForPath(e.sourceMapFilePath);this.delayUpdateSourceInfoProjects(t==null?void 0:t.sourceInfos)}else{this.delayUpdateSourceInfoProjects(e.sourceMapFilePath.sourceInfos)}}this.delayUpdateSourceInfoProjects(e.sourceInfos);if(e.declarationInfoPath){this.delayUpdateProjectsOfScriptInfoPath(e.declarationInfoPath)}}delayUpdateSourceInfoProjects(e){if(e){e.forEach(((e,t)=>this.delayUpdateProjectsOfScriptInfoPath(t)))}}delayUpdateProjectsOfScriptInfoPath(e){const t=this.getScriptInfoForPath(e);if(t){this.delayUpdateProjectGraphs(t.containingProjects,true)}}handleDeletedFile(e,t){S.assert(!e.isScriptOpen());this.delayUpdateProjectGraphs(e.containingProjects,false);this.handleSourceMapProjects(e);e.detachAllProjects();if(t){e.delayReloadNonMixedContentFile();e.deferredDelete=true}else{this.deleteScriptInfo(e)}}watchWildcardDirectory(e,t,n,r){let i=this.watchFactory.watchDirectory(e,(t=>this.onWildCardDirectoryWatcherInvoke(e,n,r,o,t)),t,this.getWatchOptionsFromProjectWatchOptions(r.parsedCommandLine.watchOptions,getDirectoryPath(n)),ns.WildcardDirectory,n);const o={packageJsonWatches:void 0,close(){var e;if(i){i.close();i=void 0;(e=o.packageJsonWatches)==null?void 0:e.forEach((e=>{e.projects.delete(o);e.close()}));o.packageJsonWatches=void 0}}};return o}onWildCardDirectoryWatcherInvoke(e,t,n,r,i){const o=this.toPath(i);const a=n.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(i,o);if(getBaseFileName(o)==="package.json"&&!isInsideNodeModules(o)&&(a&&a.fileExists||!a&&this.host.fileExists(i))){const e=this.getNormalizedAbsolutePath(i);this.logger.info(`Config: ${t} Detected new package.json: ${e}`);this.packageJsonCache.addOrUpdate(e,o);this.watchPackageJsonFile(e,o,r)}if(!(a==null?void 0:a.fileExists)){this.sendSourceFileChange(o)}const s=this.findConfiguredProjectByProjectName(t);if(isIgnoredFileFromWildCardWatching({watchedDirPath:this.toPath(e),fileOrDirectory:i,fileOrDirectoryPath:o,configFileName:t,extraFileExtensions:this.hostConfiguration.extraFileExtensions,currentDirectory:this.currentDirectory,options:n.parsedCommandLine.options,program:(s==null?void 0:s.getCurrentProgram())||n.parsedCommandLine.fileNames,useCaseSensitiveFileNames:this.host.useCaseSensitiveFileNames,writeLog:e=>this.logger.info(e),toPath:e=>this.toPath(e),getScriptKind:s?e=>s.getScriptKind(e):void 0}))return;if(n.updateLevel!==2)n.updateLevel=1;n.projects.forEach(((e,n)=>{var r;if(!e)return;const i=this.getConfiguredProjectByCanonicalConfigFilePath(n);if(!i)return;if(s!==i&&this.getHostPreferences().includeCompletionsForModuleExports){const e=this.toPath(t);if(find((r=i.getCurrentProgram())==null?void 0:r.getResolvedProjectReferences(),(t=>(t==null?void 0:t.sourceFile.path)===e))){i.markAutoImportProviderAsDirty()}}const a=s===i?1:0;if(i.pendingUpdateLevel>a)return;if(this.openFiles.has(o)){const e=S.checkDefined(this.getScriptInfoForPath(o));if(e.isAttached(i)){const e=Math.max(a,i.openFileWatchTriggered.get(o)||0);i.openFileWatchTriggered.set(o,e)}else{i.pendingUpdateLevel=a;this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(i)}}else{i.pendingUpdateLevel=a;this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(i)}}))}delayUpdateProjectsFromParsedConfigOnConfigFileChange(e,t){const n=this.configFileExistenceInfoCache.get(e);if(!(n==null?void 0:n.config))return false;let r=false;n.config.updateLevel=2;n.config.cachedDirectoryStructureHost.clearCache();n.config.projects.forEach(((n,i)=>{var o,a,s;const c=this.getConfiguredProjectByCanonicalConfigFilePath(i);if(!c)return;r=true;if(i===e){if(c.initialLoadPending)return;c.pendingUpdateLevel=2;c.pendingUpdateReason=t;this.delayUpdateProjectGraph(c);c.markAutoImportProviderAsDirty()}else{if(c.initialLoadPending){(a=(o=this.configFileExistenceInfoCache.get(i))==null?void 0:o.openFilesImpactedByConfigFile)==null?void 0:a.forEach((e=>{var t;if(!((t=this.pendingOpenFileProjectUpdates)==null?void 0:t.has(e))){(this.pendingOpenFileProjectUpdates??(this.pendingOpenFileProjectUpdates=new Map)).set(e,this.configFileForOpenFiles.get(e))}}));return}const t=this.toPath(e);c.resolutionCache.removeResolutionsFromProjectReferenceRedirects(t);this.delayUpdateProjectGraph(c);if(this.getHostPreferences().includeCompletionsForModuleExports&&find((s=c.getCurrentProgram())==null?void 0:s.getResolvedProjectReferences(),(e=>(e==null?void 0:e.sourceFile.path)===t))){c.markAutoImportProviderAsDirty()}}}));return r}onConfigFileChanged(e,t,n){const r=this.configFileExistenceInfoCache.get(t);const i=this.getConfiguredProjectByCanonicalConfigFilePath(t);const o=i==null?void 0:i.deferredClose;if(n===2){r.exists=false;if(i)i.deferredClose=true}else{r.exists=true;if(o){i.deferredClose=void 0;i.markAsDirty()}}this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(t,"Change in config file detected");this.openFiles.forEach(((e,t)=>{var n,i;const o=this.configFileForOpenFiles.get(t);if(!((n=r.openFilesImpactedByConfigFile)==null?void 0:n.has(t)))return;this.configFileForOpenFiles.delete(t);const a=this.getScriptInfoForPath(t);const s=this.getConfigFileNameForFile(a,false);if(!s)return;if(!((i=this.pendingOpenFileProjectUpdates)==null?void 0:i.has(t))){(this.pendingOpenFileProjectUpdates??(this.pendingOpenFileProjectUpdates=new Map)).set(t,o)}}));this.delayEnsureProjectForOpenFiles()}removeProject(e){this.logger.info("`remove Project::");e.print(true,true,false);e.close();if(S.shouldAssert(1)){this.filenameToScriptInfo.forEach((t=>S.assert(!t.isAttached(e),"Found script Info still attached to project",(()=>`${e.projectName}: ScriptInfos still attached: ${JSON.stringify(arrayFrom(mapDefinedIterator(this.filenameToScriptInfo.values(),(t=>t.isAttached(e)?{fileName:t.fileName,projects:t.containingProjects.map((e=>e.projectName)),hasMixedContent:t.hasMixedContent}:void 0))),void 0," ")}`))))}this.pendingProjectUpdates.delete(e.getProjectName());switch(e.projectKind){case 2:unorderedRemoveItem(this.externalProjects,e);this.projectToSizeMap.delete(e.getProjectName());break;case 1:this.configuredProjects.delete(e.canonicalConfigFilePath);this.projectToSizeMap.delete(e.canonicalConfigFilePath);break;case 0:unorderedRemoveItem(this.inferredProjects,e);break}}assignOrphanScriptInfoToInferredProject(e,t){S.assert(e.isOrphan());const n=this.getOrCreateInferredProjectForProjectRootPathIfEnabled(e,t)||this.getOrCreateSingleInferredProjectIfEnabled()||this.getOrCreateSingleInferredWithoutProjectRoot(e.isDynamic?t||this.currentDirectory:getDirectoryPath(isRootedDiskPath(e.fileName)?e.fileName:getNormalizedAbsolutePath(e.fileName,t?this.getNormalizedAbsolutePath(t):this.currentDirectory)));n.addRoot(e);if(e.containingProjects[0]!==n){orderedRemoveItem(e.containingProjects,n);e.containingProjects.unshift(n)}n.updateGraph();if(!this.useSingleInferredProject&&!n.projectRootPath){for(const e of this.inferredProjects){if(e===n||e.isOrphan()){continue}const t=e.getRootScriptInfos();S.assert(t.length===1||!!e.projectRootPath);if(t.length===1&&forEach(t[0].containingProjects,(e=>e!==t[0].containingProjects[0]&&!e.isOrphan()))){e.removeFile(t[0],true,true)}}}return n}assignOrphanScriptInfosToInferredProject(){this.openFiles.forEach(((e,t)=>{const n=this.getScriptInfoForPath(t);if(n.isOrphan()){this.assignOrphanScriptInfoToInferredProject(n,e)}}))}closeOpenFile(e,t){var n;const r=e.isDynamic?false:this.host.fileExists(e.fileName);e.close(r);this.stopWatchingConfigFilesForScriptInfo(e);const i=this.toCanonicalFileName(e.fileName);if(this.openFilesWithNonRootedDiskPath.get(i)===e){this.openFilesWithNonRootedDiskPath.delete(i)}let o=false;for(const t of e.containingProjects){if(isConfiguredProject(t)){if(e.hasMixedContent){e.registerFileUpdate()}const n=t.openFileWatchTriggered.get(e.path);if(n!==void 0){t.openFileWatchTriggered.delete(e.path);if(t.pendingUpdateLevelthis.onConfigFileChanged(e,t,r)),2e3,this.getWatchOptionsFromProjectWatchOptions((i=(r=o==null?void 0:o.config)==null?void 0:r.parsedCommandLine)==null?void 0:i.watchOptions,getDirectoryPath(e)),ns.ConfigFile,n)}this.ensureConfigFileWatcherForProject(o,n)}ensureConfigFileWatcherForProject(e,t){const n=e.config.projects;n.set(t.canonicalConfigFilePath,n.get(t.canonicalConfigFilePath)||false)}releaseParsedConfig(e,t){var n,r,i;const o=this.configFileExistenceInfoCache.get(e);if(!((n=o.config)==null?void 0:n.projects.delete(t.canonicalConfigFilePath)))return;if((r=o.config)==null?void 0:r.projects.size)return;o.config=void 0;clearSharedExtendedConfigFileWatcher(e,this.sharedExtendedConfigFileWatchers);S.checkDefined(o.watcher);if((i=o.openFilesImpactedByConfigFile)==null?void 0:i.size){if(o.inferredProjectRoots){if(!canWatchDirectoryOrFilePath(getDirectoryPath(e))){o.watcher.close();o.watcher=j_}}else{o.watcher.close();o.watcher=void 0}}else{o.watcher.close();this.configFileExistenceInfoCache.delete(e)}}stopWatchingConfigFilesForScriptInfo(e){if(this.serverMode!==0)return;const t=this.rootOfInferredProjects.delete(e);const n=e.isScriptOpen();if(n&&!t)return;this.forEachConfigFileLocation(e,(r=>{var i,o,a;const s=this.configFileExistenceInfoCache.get(r);if(!s)return;if(n){if(!((i=s==null?void 0:s.openFilesImpactedByConfigFile)==null?void 0:i.has(e.path)))return}else{if(!((o=s.openFilesImpactedByConfigFile)==null?void 0:o.delete(e.path)))return}if(t){s.inferredProjectRoots--;if(s.watcher&&!s.config&&!s.inferredProjectRoots){s.watcher.close();s.watcher=void 0}}if(!((a=s.openFilesImpactedByConfigFile)==null?void 0:a.size)&&!s.config){S.assert(!s.watcher);this.configFileExistenceInfoCache.delete(r)}}))}startWatchingConfigFilesForInferredProjectRoot(e){if(this.serverMode!==0)return;S.assert(e.isScriptOpen());this.rootOfInferredProjects.add(e);this.forEachConfigFileLocation(e,((t,n)=>{let r=this.configFileExistenceInfoCache.get(t);if(!r){r={exists:this.host.fileExists(n),inferredProjectRoots:1};this.configFileExistenceInfoCache.set(t,r)}else{r.inferredProjectRoots=(r.inferredProjectRoots??0)+1}(r.openFilesImpactedByConfigFile??(r.openFilesImpactedByConfigFile=new Set)).add(e.path);r.watcher||(r.watcher=canWatchDirectoryOrFilePath(getDirectoryPath(t))?this.watchFactory.watchFile(n,((e,r)=>this.onConfigFileChanged(n,t,r)),2e3,this.hostConfiguration.watchOptions,ns.ConfigFileForInferredRoot):j_)}))}forEachConfigFileLocation(e,t){if(this.serverMode!==0){return void 0}S.assert(!isOpenScriptInfo(e)||this.openFiles.has(e.path));const n=this.openFiles.get(e.path);const r=S.checkDefined(this.getScriptInfo(e.path));if(r.isDynamic)return void 0;let i=asNormalizedPath(getDirectoryPath(e.fileName));const isSearchPathInProjectRoot=()=>containsPath(n,i,this.currentDirectory,!this.host.useCaseSensitiveFileNames);const o=!n||!isSearchPathInProjectRoot();let a=true;let s=true;if(isAncestorConfigFileInfo(e)){if(endsWith(e.fileName,"tsconfig.json"))a=false;else a=s=false}do{const e=normalizedPathToPath(i,this.currentDirectory,this.toCanonicalFileName);if(a){const n=asNormalizedPath(combinePaths(i,"tsconfig.json"));const r=t(combinePaths(e,"tsconfig.json"),n);if(r)return n}if(s){const n=asNormalizedPath(combinePaths(i,"jsconfig.json"));const r=t(combinePaths(e,"jsconfig.json"),n);if(r)return n}if(isNodeModulesDirectory(e)){break}const n=asNormalizedPath(getDirectoryPath(i));if(n===i)break;i=n;a=s=true}while(o||isSearchPathInProjectRoot());return void 0}findDefaultConfiguredProject(e){var t;return(t=this.findDefaultConfiguredProjectWorker(e,1))==null?void 0:t.defaultProject}findDefaultConfiguredProjectWorker(e,t){return e.isScriptOpen()?this.tryFindDefaultConfiguredProjectForOpenScriptInfo(e,t):void 0}getConfigFileNameForFileFromCache(e,t){if(t){const t=getConfigFileNameFromCache(e,this.pendingOpenFileProjectUpdates);if(t!==void 0)return t}return getConfigFileNameFromCache(e,this.configFileForOpenFiles)}setConfigFileNameForFileInCache(e,t){if(!this.openFiles.has(e.path))return;const n=t||false;if(!isAncestorConfigFileInfo(e)){this.configFileForOpenFiles.set(e.path,n)}else{let t=this.configFileForOpenFiles.get(e.path);if(!t||isString(t)){this.configFileForOpenFiles.set(e.path,t=(new Map).set(false,t))}t.set(e.fileName,n)}}getConfigFileNameForFile(e,t){const n=this.getConfigFileNameForFileFromCache(e,t);if(n!==void 0)return n||void 0;if(t)return void 0;const r=this.forEachConfigFileLocation(e,((t,n)=>this.configFileExists(n,t,e)));this.logger.info(`getConfigFileNameForFile:: File: ${e.fileName} ProjectRootPath: ${this.openFiles.get(e.path)}:: Result: ${r}`);this.setConfigFileNameForFileInCache(e,r);return r}printProjects(){if(!this.logger.hasLevel(1)){return}this.logger.startGroup();this.externalProjects.forEach(printProjectWithoutFileNames);this.configuredProjects.forEach(printProjectWithoutFileNames);this.inferredProjects.forEach(printProjectWithoutFileNames);this.logger.info("Open files: ");this.openFiles.forEach(((e,t)=>{const n=this.getScriptInfoForPath(t);this.logger.info(`\tFileName: ${n.fileName} ProjectRootPath: ${e}`);this.logger.info(`\t\tProjects: ${n.containingProjects.map((e=>e.getProjectName()))}`)}));this.logger.endGroup()}findConfiguredProjectByProjectName(e,t){const n=asNormalizedPath(this.toCanonicalFileName(e));const r=this.getConfiguredProjectByCanonicalConfigFilePath(n);return t?r:!(r==null?void 0:r.deferredClose)?r:void 0}getConfiguredProjectByCanonicalConfigFilePath(e){return this.configuredProjects.get(e)}findExternalProjectByProjectName(e){return findProjectByName(e,this.externalProjects)}getFilenameForExceededTotalSizeLimitForNonTsFiles(e,t,n,r){if(t&&t.disableSizeLimit||!this.host.getFileSize){return}let i=h_;this.projectToSizeMap.set(e,0);this.projectToSizeMap.forEach((e=>i-=e||0));let o=0;for(const e of n){const t=r.getFileName(e);if(hasTSFileExtension(t)){continue}o+=this.host.getFileSize(t);if(o>h_||o>i){const e=n.map((e=>r.getFileName(e))).filter((e=>!hasTSFileExtension(e))).map((e=>({name:e,size:this.host.getFileSize(e)}))).sort(((e,t)=>t.size-e.size)).slice(0,5);this.logger.info(`Non TS file size exceeded limit (${o}). Largest files: ${e.map((e=>`${e.name}:${e.size}`)).join(", ")}`);return t}}this.projectToSizeMap.set(e,o)}createExternalProject(e,t,n,r,i){const o=convertCompilerOptions(n);const a=convertWatchOptions(n,getDirectoryPath(normalizeSlashes(e)));const s=new y_(e,this,o,this.getFilenameForExceededTotalSizeLimitForNonTsFiles(e,o,t,R_),n.compileOnSave===void 0?true:n.compileOnSave,void 0,a==null?void 0:a.watchOptions);s.setProjectErrors(a==null?void 0:a.errors);s.excludedFiles=i;this.addFilesToNonInferredProject(s,t,R_,r);this.externalProjects.push(s);return s}sendProjectTelemetry(e){if(this.seenProjects.has(e.projectName)){setProjectOptionsUsed(e);return}this.seenProjects.set(e.projectName,true);if(!this.eventHandler||!this.host.createSHA256Hash){setProjectOptionsUsed(e);return}const t=isConfiguredProject(e)?e.projectOptions:void 0;setProjectOptionsUsed(e);const n={projectId:this.host.createSHA256Hash(e.projectName),fileStats:countEachFileTypes(e.getScriptInfos(),true),compilerOptions:convertCompilerOptionsForTelemetry(e.getCompilationSettings()),typeAcquisition:convertTypeAcquisition2(e.getTypeAcquisition()),extends:t&&t.configHasExtendsProperty,files:t&&t.configHasFilesProperty,include:t&&t.configHasIncludeProperty,exclude:t&&t.configHasExcludeProperty,compileOnSave:e.compileOnSaveEnabled,configFileName:configFileName(),projectType:e instanceof y_?"external":"configured",languageServiceEnabled:e.languageServiceEnabled,version:c};this.eventHandler({eventName:N_,data:n});function configFileName(){if(!isConfiguredProject(e)){return"other"}return getBaseConfigFileName(e.getConfigFilePath())||"other"}function convertTypeAcquisition2({enable:e,include:t,exclude:n}){return{enable:e,include:t!==void 0&&t.length!==0,exclude:n!==void 0&&n.length!==0}}}addFilesToNonInferredProject(e,t,n,r){this.updateNonInferredProjectFiles(e,t,n);e.setTypeAcquisition(r);e.markAsDirty()}createConfiguredProject(e,t){var n;(n=G)==null?void 0:n.instant(G.Phase.Session,"createConfiguredProject",{configFilePath:e});const r=asNormalizedPath(this.toCanonicalFileName(e));let i=this.configFileExistenceInfoCache.get(r);if(!i){this.configFileExistenceInfoCache.set(r,i={exists:true})}else{i.exists=true}if(!i.config){i.config={cachedDirectoryStructureHost:createCachedDirectoryStructureHost(this.host,this.host.getCurrentDirectory(),this.host.useCaseSensitiveFileNames),projects:new Map,updateLevel:2}}const o=new g_(e,r,this,i.config.cachedDirectoryStructureHost,t);S.assert(!this.configuredProjects.has(r));this.configuredProjects.set(r,o);this.createConfigFileWatcherForParsedConfig(e,r,o);return o}loadConfiguredProject(e,t){var n,r;(n=G)==null?void 0:n.push(G.Phase.Session,"loadConfiguredProject",{configFilePath:e.canonicalConfigFilePath});this.sendProjectLoadingStartEvent(e,t);const i=toNormalizedPath(e.getConfigFilePath());const o=this.ensureParsedConfigUptoDate(i,e.canonicalConfigFilePath,this.configFileExistenceInfoCache.get(e.canonicalConfigFilePath),e);const a=o.config.parsedCommandLine;S.assert(!!a.fileNames);const s=a.options;if(!e.projectOptions){e.projectOptions={configHasExtendsProperty:a.raw.extends!==void 0,configHasFilesProperty:a.raw.files!==void 0,configHasIncludeProperty:a.raw.include!==void 0,configHasExcludeProperty:a.raw.exclude!==void 0}}e.parsedCommandLine=a;e.setProjectErrors(a.options.configFile.parseDiagnostics);e.updateReferences(a.projectReferences);const c=this.getFilenameForExceededTotalSizeLimitForNonTsFiles(e.canonicalConfigFilePath,s,a.fileNames,M_);if(c){e.disableLanguageService(c);this.configFileExistenceInfoCache.forEach(((t,n)=>this.stopWatchingWildCards(n,e)))}else{e.setCompilerOptions(s);e.setWatchOptions(a.watchOptions);e.enableLanguageService();this.watchWildcards(i,o,e)}e.enablePluginsWithOptions(s);const l=a.fileNames.concat(e.getExternalFiles(2));this.updateRootAndOptionsOfNonInferredProject(e,l,M_,s,a.typeAcquisition,a.compileOnSave,a.watchOptions);(r=G)==null?void 0:r.pop()}ensureParsedConfigUptoDate(e,t,n,r){var i,o,a;if(n.config){if(n.config.updateLevel===1){this.reloadFileNamesOfParsedConfig(e,n.config)}if(!n.config.updateLevel){this.ensureConfigFileWatcherForProject(n,r);return n}}if(!n.exists&&n.config){n.config.updateLevel=void 0;this.ensureConfigFileWatcherForProject(n,r);return n}const s=((i=n.config)==null?void 0:i.cachedDirectoryStructureHost)||createCachedDirectoryStructureHost(this.host,this.host.getCurrentDirectory(),this.host.useCaseSensitiveFileNames);const c=tryReadFile(e,(e=>this.host.readFile(e)));const l=parseJsonText(e,isString(c)?c:"");const d=l.parseDiagnostics;if(!isString(c))d.push(c);const p=getDirectoryPath(e);const u=parseJsonSourceFileConfigFileContent(l,s,p,void 0,e,void 0,this.hostConfiguration.extraFileExtensions,this.extendedConfigCache);if(u.errors.length){d.push(...u.errors)}this.logger.info(`Config: ${e} : ${JSON.stringify({rootNames:u.fileNames,options:u.options,watchOptions:u.watchOptions,projectReferences:u.projectReferences},void 0," ")}`);const f=(o=n.config)==null?void 0:o.parsedCommandLine;if(!n.config){n.config={parsedCommandLine:u,cachedDirectoryStructureHost:s,projects:new Map}}else{n.config.parsedCommandLine=u;n.config.watchedDirectoriesStale=true;n.config.updateLevel=void 0}if(!f&&!isJsonEqual(this.getWatchOptionsFromProjectWatchOptions(void 0,p),this.getWatchOptionsFromProjectWatchOptions(u.watchOptions,p))){(a=n.watcher)==null?void 0:a.close();n.watcher=void 0}this.createConfigFileWatcherForParsedConfig(e,t,r);updateSharedExtendedConfigFileWatcher(t,u.options,this.sharedExtendedConfigFileWatchers,((t,n)=>this.watchFactory.watchFile(t,(()=>{var e;cleanExtendedConfigCache(this.extendedConfigCache,n,(e=>this.toPath(e)));let r=false;(e=this.sharedExtendedConfigFileWatchers.get(n))==null?void 0:e.projects.forEach((e=>{r=this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(e,`Change in extended config file ${t} detected`)||r}));if(r)this.delayEnsureProjectForOpenFiles()}),2e3,this.hostConfiguration.watchOptions,ns.ExtendedConfigFile,e)),(e=>this.toPath(e)));return n}watchWildcards(e,{exists:t,config:n},r){n.projects.set(r.canonicalConfigFilePath,true);if(t){if(n.watchedDirectories&&!n.watchedDirectoriesStale)return;n.watchedDirectoriesStale=false;updateWatchingWildcardDirectories(n.watchedDirectories||(n.watchedDirectories=new Map),n.parsedCommandLine.wildcardDirectories,((t,r)=>this.watchWildcardDirectory(t,r,e,n)))}else{n.watchedDirectoriesStale=false;if(!n.watchedDirectories)return;clearMap(n.watchedDirectories,closeFileWatcherOf);n.watchedDirectories=void 0}}stopWatchingWildCards(e,t){const n=this.configFileExistenceInfoCache.get(e);if(!n.config||!n.config.projects.get(t.canonicalConfigFilePath)){return}n.config.projects.set(t.canonicalConfigFilePath,false);if(forEachEntry(n.config.projects,identity))return;if(n.config.watchedDirectories){clearMap(n.config.watchedDirectories,closeFileWatcherOf);n.config.watchedDirectories=void 0}n.config.watchedDirectoriesStale=void 0}updateNonInferredProjectFiles(e,t,n){var r;const i=e.getRootFilesMap();const o=new Map;for(const a of t){const t=n.getFileName(a);const s=toNormalizedPath(t);const c=isDynamicFileName(s);let l;if(!c&&!e.fileExists(t)){l=normalizedPathToPath(s,this.currentDirectory,this.toCanonicalFileName);const t=i.get(l);if(t){if(((r=t.info)==null?void 0:r.path)===l){e.removeFile(t.info,false,true);t.info=void 0}t.fileName=s}else{i.set(l,{fileName:s})}}else{const t=n.getScriptKind(a,this.hostConfiguration.extraFileExtensions);const r=n.hasMixedContent(a,this.hostConfiguration.extraFileExtensions);const o=S.checkDefined(this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(s,e.currentDirectory,t,r,e.directoryStructureHost,false));l=o.path;const c=i.get(l);if(!c||c.info!==o){e.addRoot(o,s);if(o.isScriptOpen()){this.removeRootOfInferredProjectIfNowPartOfOtherProject(o)}}else{c.fileName=s}}o.set(l,true)}if(i.size>o.size){i.forEach(((t,n)=>{if(!o.has(n)){if(t.info){e.removeFile(t.info,e.fileExists(t.info.fileName),true)}else{i.delete(n)}}}))}}updateRootAndOptionsOfNonInferredProject(e,t,n,r,i,o,a){e.setCompilerOptions(r);e.setWatchOptions(a);if(o!==void 0){e.compileOnSaveEnabled=o}this.addFilesToNonInferredProject(e,t,n,i)}reloadFileNamesOfConfiguredProject(e){const t=this.reloadFileNamesOfParsedConfig(e.getConfigFilePath(),this.configFileExistenceInfoCache.get(e.canonicalConfigFilePath).config);e.updateErrorOnNoInputFiles(t);this.updateNonInferredProjectFiles(e,t.fileNames.concat(e.getExternalFiles(1)),M_);e.markAsDirty();return e.updateGraph()}reloadFileNamesOfParsedConfig(e,t){if(t.updateLevel===void 0)return t.parsedCommandLine;S.assert(t.updateLevel===1);const n=t.parsedCommandLine.options.configFile.configFileSpecs;const r=getFileNamesFromConfigSpecs(n,getDirectoryPath(e),t.parsedCommandLine.options,t.cachedDirectoryStructureHost,this.hostConfiguration.extraFileExtensions);t.parsedCommandLine={...t.parsedCommandLine,fileNames:r};t.updateLevel=void 0;return t.parsedCommandLine}setFileNamesOfAutoImportProviderOrAuxillaryProject(e,t){this.updateNonInferredProjectFiles(e,t,M_)}reloadConfiguredProjectOptimized(e,t,n){if(n.has(e))return;n.set(e,6);if(!e.initialLoadPending){this.setProjectForReload(e,2,t)}}reloadConfiguredProjectClearingSemanticCache(e,t,n){if(n.get(e)===7)return false;n.set(e,7);this.clearSemanticCache(e);this.reloadConfiguredProject(e,reloadReason(t));return true}setProjectForReload(e,t,n){if(t===2)this.clearSemanticCache(e);e.pendingUpdateReason=n&&reloadReason(n);e.pendingUpdateLevel=t}reloadConfiguredProject(e,t){e.initialLoadPending=false;this.setProjectForReload(e,0);this.loadConfiguredProject(e,t);updateWithTriggerFile(e,e.triggerFileForConfigFileDiag??e.getConfigFilePath(),true)}clearSemanticCache(e){e.originalConfiguredProjects=void 0;e.resolutionCache.clear();e.getLanguageService(false).cleanupSemanticCache();e.cleanupProgram();e.markAsDirty()}sendConfigFileDiagEvent(e,t,n){if(!this.eventHandler||this.suppressDiagnosticEvents)return false;const r=e.getLanguageService().getCompilerOptionsDiagnostics();r.push(...e.getAllProjectErrors());if(!n&&r.length===(e.configDiagDiagnosticsReported??0))return false;e.configDiagDiagnosticsReported=r.length;this.eventHandler({eventName:C_,data:{configFileName:e.getConfigFilePath(),diagnostics:r,triggerFile:t??e.getConfigFilePath()}});return true}getOrCreateInferredProjectForProjectRootPathIfEnabled(e,t){if(!this.useInferredProjectPerProjectRoot||e.isDynamic&&t===void 0){return void 0}if(t){const e=this.toCanonicalFileName(t);for(const t of this.inferredProjects){if(t.projectRootPath===e){return t}}return this.createInferredProject(t,false,t)}let n;for(const t of this.inferredProjects){if(!t.projectRootPath)continue;if(!containsPath(t.projectRootPath,e.path,this.host.getCurrentDirectory(),!this.host.useCaseSensitiveFileNames))continue;if(n&&n.projectRootPath.length>t.projectRootPath.length)continue;n=t}return n}getOrCreateSingleInferredProjectIfEnabled(){if(!this.useSingleInferredProject){return void 0}if(this.inferredProjects.length>0&&this.inferredProjects[0].projectRootPath===void 0){return this.inferredProjects[0]}return this.createInferredProject(this.currentDirectory,true,void 0)}getOrCreateSingleInferredWithoutProjectRoot(e){S.assert(!this.useSingleInferredProject);const t=this.toCanonicalFileName(this.getNormalizedAbsolutePath(e));for(const e of this.inferredProjects){if(!e.projectRootPath&&e.isOrphan()&&e.canonicalCurrentDirectory===t){return e}}return this.createInferredProject(e,false,void 0)}createInferredProject(e,t,n){const r=n&&this.compilerOptionsForInferredProjectsPerProjectRoot.get(n)||this.compilerOptionsForInferredProjects;let i;let o;if(n){i=this.watchOptionsForInferredProjectsPerProjectRoot.get(n);o=this.typeAcquisitionForInferredProjectsPerProjectRoot.get(n)}if(i===void 0){i=this.watchOptionsForInferredProjects}if(o===void 0){o=this.typeAcquisitionForInferredProjects}i=i||void 0;const a=new u_(this,r,i==null?void 0:i.watchOptions,n,e,o);a.setProjectErrors(i==null?void 0:i.errors);if(t){this.inferredProjects.unshift(a)}else{this.inferredProjects.push(a)}return a}getOrCreateScriptInfoNotOpenedByClient(e,t,n,r){return this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(toNormalizedPath(e),t,void 0,void 0,n,r)}getScriptInfo(e){return this.getScriptInfoForNormalizedPath(toNormalizedPath(e))}getScriptInfoOrConfig(e){const t=toNormalizedPath(e);const n=this.getScriptInfoForNormalizedPath(t);if(n)return n;const r=this.configuredProjects.get(this.toPath(e));return r&&r.getCompilerOptions().configFile}logErrorForScriptInfoNotFound(e){const t=arrayFrom(mapDefinedIterator(this.filenameToScriptInfo.entries(),(e=>e[1].deferredDelete?void 0:e)),(([e,t])=>({path:e,fileName:t.fileName})));this.logger.msg(`Could not find file ${JSON.stringify(e)}.\nAll files are: ${JSON.stringify(t)}`,"Err")}getSymlinkedProjects(e){let t;if(this.realpathToScriptInfos){const t=e.getRealpathIfDifferent();if(t){forEach(this.realpathToScriptInfos.get(t),combineProjects)}forEach(this.realpathToScriptInfos.get(e.path),combineProjects)}return t;function combineProjects(n){if(n!==e){for(const r of n.containingProjects){if(r.languageServiceEnabled&&!r.isOrphan()&&!r.getCompilerOptions().preserveSymlinks&&!e.isAttached(r)){if(!t){t=createMultiMap();t.add(n.path,r)}else if(!forEachEntry(t,((e,t)=>t===n.path?false:contains(e,r)))){t.add(n.path,r)}}}}}}watchClosedScriptInfo(e){S.assert(!e.fileWatcher);if(!e.isDynamicOrHasMixedContent()&&(!this.globalCacheLocationDirectoryPath||!startsWith(e.path,this.globalCacheLocationDirectoryPath))){const t=e.fileName.indexOf("/node_modules/");if(!this.host.getModifiedTime||t===-1){e.fileWatcher=this.watchFactory.watchFile(e.fileName,((t,n)=>this.onSourceFileChanged(e,n)),500,this.hostConfiguration.watchOptions,ns.ClosedScriptInfo)}else{e.mTime=this.getModifiedTime(e);e.fileWatcher=this.watchClosedScriptInfoInNodeModules(e.fileName.substring(0,t))}}}createNodeModulesWatcher(e,t){let n=this.watchFactory.watchDirectory(e,(e=>{var n;const i=removeIgnoredPath(this.toPath(e));if(!i)return;const o=getBaseFileName(i);if(((n=r.affectedModuleSpecifierCacheProjects)==null?void 0:n.size)&&(o==="package.json"||o==="node_modules")){r.affectedModuleSpecifierCacheProjects.forEach((e=>{var t;(t=e.getModuleSpecifierCache())==null?void 0:t.clear()}))}if(r.refreshScriptInfoRefCount){if(t===i){this.refreshScriptInfosInDirectory(t)}else{const e=this.filenameToScriptInfo.get(i);if(e){if(isScriptInfoWatchedFromNodeModules(e)){this.refreshScriptInfo(e)}}else if(!hasExtension(i)){this.refreshScriptInfosInDirectory(i)}}}}),1,this.hostConfiguration.watchOptions,ns.NodeModules);const r={refreshScriptInfoRefCount:0,affectedModuleSpecifierCacheProjects:void 0,close:()=>{var e;if(n&&!r.refreshScriptInfoRefCount&&!((e=r.affectedModuleSpecifierCacheProjects)==null?void 0:e.size)){n.close();n=void 0;this.nodeModulesWatchers.delete(t)}}};this.nodeModulesWatchers.set(t,r);return r}watchPackageJsonsInNodeModules(e,t){var n;const r=this.toPath(e);const i=this.nodeModulesWatchers.get(r)||this.createNodeModulesWatcher(e,r);S.assert(!((n=i.affectedModuleSpecifierCacheProjects)==null?void 0:n.has(t)));(i.affectedModuleSpecifierCacheProjects||(i.affectedModuleSpecifierCacheProjects=new Set)).add(t);return{close:()=>{var e;(e=i.affectedModuleSpecifierCacheProjects)==null?void 0:e.delete(t);i.close()}}}watchClosedScriptInfoInNodeModules(e){const t=e+"/node_modules";const n=this.toPath(t);const r=this.nodeModulesWatchers.get(n)||this.createNodeModulesWatcher(t,n);r.refreshScriptInfoRefCount++;return{close:()=>{r.refreshScriptInfoRefCount--;r.close()}}}getModifiedTime(e){return(this.host.getModifiedTime(e.fileName)||vt).getTime()}refreshScriptInfo(e){const t=this.getModifiedTime(e);if(t!==e.mTime){const n=getFileWatcherEventKind(e.mTime,t);e.mTime=t;this.onSourceFileChanged(e,n)}}refreshScriptInfosInDirectory(e){e=e+Pt;this.filenameToScriptInfo.forEach((t=>{if(isScriptInfoWatchedFromNodeModules(t)&&startsWith(t.path,e)){this.refreshScriptInfo(t)}}))}stopWatchingScriptInfo(e){if(e.fileWatcher){e.fileWatcher.close();e.fileWatcher=void 0}}getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(e,t,n,r,i,o){if(isRootedDiskPath(e)||isDynamicFileName(e)){return this.getOrCreateScriptInfoWorker(e,t,false,void 0,n,!!r,i,o)}const a=this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(e));if(a){return a}return void 0}getOrCreateScriptInfoForNormalizedPath(e,t,n,r,i,o){return this.getOrCreateScriptInfoWorker(e,this.currentDirectory,t,n,r,!!i,o,false)}getOrCreateScriptInfoWorker(e,t,n,r,i,o,a,s){S.assert(r===void 0||n,"ScriptInfo needs to be opened by client to be able to set its user defined content");const c=normalizedPathToPath(e,t,this.toCanonicalFileName);let l=this.filenameToScriptInfo.get(c);if(!l){const r=isDynamicFileName(e);S.assert(isRootedDiskPath(e)||r||n,"",(()=>`${JSON.stringify({fileName:e,currentDirectory:t,hostCurrentDirectory:this.currentDirectory,openKeys:arrayFrom(this.openFilesWithNonRootedDiskPath.keys())})}\nScript info with non-dynamic relative file name can only be open script info or in context of host currentDirectory`));S.assert(!isRootedDiskPath(e)||this.currentDirectory===t||!this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(e)),"",(()=>`${JSON.stringify({fileName:e,currentDirectory:t,hostCurrentDirectory:this.currentDirectory,openKeys:arrayFrom(this.openFilesWithNonRootedDiskPath.keys())})}\nOpen script files with non rooted disk path opened with current directory context cannot have same canonical names`));S.assert(!r||this.currentDirectory===t||this.useInferredProjectPerProjectRoot,"",(()=>`${JSON.stringify({fileName:e,currentDirectory:t,hostCurrentDirectory:this.currentDirectory,openKeys:arrayFrom(this.openFilesWithNonRootedDiskPath.keys())})}\nDynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath.`));if(!n&&!r&&!(a||this.host).fileExists(e)){return}l=new l_(this.host,e,i,o,c,this.filenameToScriptInfoVersion.get(c));this.filenameToScriptInfo.set(l.path,l);this.filenameToScriptInfoVersion.delete(l.path);if(!n){this.watchClosedScriptInfo(l)}else if(!isRootedDiskPath(e)&&(!r||this.currentDirectory!==t)){this.openFilesWithNonRootedDiskPath.set(this.toCanonicalFileName(e),l)}}else if(l.deferredDelete){S.assert(!l.isDynamic);if(!n&&!(a||this.host).fileExists(e)){return s?l:void 0}l.deferredDelete=void 0}if(n){this.stopWatchingScriptInfo(l);l.open(r);if(o){l.registerFileUpdate()}}return l}getScriptInfoForNormalizedPath(e){return!isRootedDiskPath(e)&&this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(e))||this.getScriptInfoForPath(normalizedPathToPath(e,this.currentDirectory,this.toCanonicalFileName))}getScriptInfoForPath(e){const t=this.filenameToScriptInfo.get(e);return!t||!t.deferredDelete?t:void 0}getDocumentPositionMapper(e,t,n){const r=this.getOrCreateScriptInfoNotOpenedByClient(t,e.currentDirectory,this.host,false);if(!r){if(n){e.addGeneratedFileWatch(t,n)}return void 0}r.getSnapshot();if(isString(r.sourceMapFilePath)){const t=this.getScriptInfoForPath(r.sourceMapFilePath);if(t){t.getSnapshot();if(t.documentPositionMapper!==void 0){t.sourceInfos=this.addSourceInfoToSourceMap(n,e,t.sourceInfos);return t.documentPositionMapper?t.documentPositionMapper:void 0}}r.sourceMapFilePath=void 0}else if(r.sourceMapFilePath){r.sourceMapFilePath.sourceInfos=this.addSourceInfoToSourceMap(n,e,r.sourceMapFilePath.sourceInfos);return void 0}else if(r.sourceMapFilePath!==void 0){return void 0}let i;let readMapFile=(t,n)=>{const r=this.getOrCreateScriptInfoNotOpenedByClient(t,e.currentDirectory,this.host,true);i=r||n;if(!r||r.deferredDelete)return void 0;const o=r.getSnapshot();if(r.documentPositionMapper!==void 0)return r.documentPositionMapper;return getSnapshotText(o)};const o=e.projectName;const a=getDocumentPositionMapper({getCanonicalFileName:this.toCanonicalFileName,log:e=>this.logger.info(e),getSourceFileLike:e=>this.getSourceFileLike(e,o,r)},r.fileName,r.textStorage.getLineInfo(),readMapFile);readMapFile=void 0;if(i){if(!isString(i)){r.sourceMapFilePath=i.path;i.declarationInfoPath=r.path;if(!i.deferredDelete)i.documentPositionMapper=a||false;i.sourceInfos=this.addSourceInfoToSourceMap(n,e,i.sourceInfos)}else{r.sourceMapFilePath={watcher:this.addMissingSourceMapFile(e.currentDirectory===this.currentDirectory?i:getNormalizedAbsolutePath(i,e.currentDirectory),r.path),sourceInfos:this.addSourceInfoToSourceMap(n,e)}}}else{r.sourceMapFilePath=false}return a}addSourceInfoToSourceMap(e,t,n){if(e){const r=this.getOrCreateScriptInfoNotOpenedByClient(e,t.currentDirectory,t.directoryStructureHost,false);(n||(n=new Set)).add(r.path)}return n}addMissingSourceMapFile(e,t){const n=this.watchFactory.watchFile(e,(()=>{const e=this.getScriptInfoForPath(t);if(e&&e.sourceMapFilePath&&!isString(e.sourceMapFilePath)){this.delayUpdateProjectGraphs(e.containingProjects,true);this.delayUpdateSourceInfoProjects(e.sourceMapFilePath.sourceInfos);e.closeSourceMapFileWatcher()}}),2e3,this.hostConfiguration.watchOptions,ns.MissingSourceMapFile);return n}getSourceFileLike(e,t,n){const r=t.projectName?t:this.findProject(t);if(r){const t=r.toPath(e);const n=r.getSourceFile(t);if(n&&n.resolvedPath===t)return n}const i=this.getOrCreateScriptInfoNotOpenedByClient(e,(r||this).currentDirectory,r?r.directoryStructureHost:this.host,false);if(!i)return void 0;if(n&&isString(n.sourceMapFilePath)&&i!==n){const e=this.getScriptInfoForPath(n.sourceMapFilePath);if(e){(e.sourceInfos??(e.sourceInfos=new Set)).add(i.path)}}if(i.cacheSourceFile)return i.cacheSourceFile.sourceFile;if(!i.sourceFileLike){i.sourceFileLike={get text(){S.fail("shouldnt need text");return""},getLineAndCharacterOfPosition:e=>{const t=i.positionToLineOffset(e);return{line:t.line-1,character:t.offset-1}},getPositionOfLineAndCharacter:(e,t,n)=>i.lineOffsetToPosition(e+1,t+1,n)}}return i.sourceFileLike}setPerformanceEventHandler(e){this.performanceEventHandler=e}setHostConfiguration(e){var t;if(e.file){const t=this.getScriptInfoForNormalizedPath(toNormalizedPath(e.file));if(t){t.setOptions(convertFormatOptions(e.formatOptions),e.preferences);this.logger.info(`Host configuration update for file ${e.file}`)}}else{if(e.hostInfo!==void 0){this.hostConfiguration.hostInfo=e.hostInfo;this.logger.info(`Host information ${e.hostInfo}`)}if(e.formatOptions){this.hostConfiguration.formatCodeOptions={...this.hostConfiguration.formatCodeOptions,...convertFormatOptions(e.formatOptions)};this.logger.info("Format host information updated")}if(e.preferences){const{lazyConfiguredProjectsFromExternalProject:t,includePackageJsonAutoImports:n,includeCompletionsForModuleExports:r}=this.hostConfiguration.preferences;this.hostConfiguration.preferences={...this.hostConfiguration.preferences,...e.preferences};if(t&&!this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject){this.externalProjectToConfiguredProjectMap.forEach((e=>e.forEach((e=>{if(!e.deferredClose&&!e.isClosed()&&e.pendingUpdateLevel===2&&!this.hasPendingProjectUpdate(e)){e.updateGraph()}}))))}if(n!==e.preferences.includePackageJsonAutoImports||!!r!==!!e.preferences.includeCompletionsForModuleExports){this.forEachProject((e=>{e.onAutoImportProviderSettingsChanged()}))}}if(e.extraFileExtensions){this.hostConfiguration.extraFileExtensions=e.extraFileExtensions;this.reloadProjects();this.logger.info("Host file extension mappings updated")}if(e.watchOptions){const n=(t=convertWatchOptions(e.watchOptions))==null?void 0:t.watchOptions;const r=handleWatchOptionsConfigDirTemplateSubstitution(n,this.currentDirectory);this.hostConfiguration.watchOptions=r;this.hostConfiguration.beforeSubstitution=r===n?void 0:n;this.logger.info(`Host watch options changed to ${JSON.stringify(this.hostConfiguration.watchOptions)}, it will be take effect for next watches.`)}}}getWatchOptions(e){return this.getWatchOptionsFromProjectWatchOptions(e.getWatchOptions(),e.getCurrentDirectory())}getWatchOptionsFromProjectWatchOptions(e,t){const n=!this.hostConfiguration.beforeSubstitution?this.hostConfiguration.watchOptions:handleWatchOptionsConfigDirTemplateSubstitution(this.hostConfiguration.beforeSubstitution,t);return e&&n?{...n,...e}:e||n}closeLog(){this.logger.close()}sendSourceFileChange(e){this.filenameToScriptInfo.forEach((t=>{if(this.openFiles.has(t.path))return;if(!t.fileWatcher)return;const n=memoize((()=>this.host.fileExists(t.fileName)?t.deferredDelete?0:1:2));if(e){if(isScriptInfoWatchedFromNodeModules(t)||!t.path.startsWith(e))return;if(n()===2&&t.deferredDelete)return;this.logger.info(`Invoking sourceFileChange on ${t.fileName}:: ${n()}`)}this.onSourceFileChanged(t,n())}))}reloadProjects(){this.logger.info("reload projects.");this.sendSourceFileChange(void 0);this.pendingProjectUpdates.forEach(((e,t)=>{this.throttledOperations.cancel(t);this.pendingProjectUpdates.delete(t)}));this.throttledOperations.cancel(I_);this.pendingOpenFileProjectUpdates=void 0;this.pendingEnsureProjectForOpenFiles=false;this.configFileExistenceInfoCache.forEach((e=>{if(e.config){e.config.updateLevel=2;e.config.cachedDirectoryStructureHost.clearCache()}}));this.configFileForOpenFiles.clear();this.externalProjects.forEach((e=>{this.clearSemanticCache(e);e.updateGraph()}));const e=new Map;const t=new Set;this.externalProjectToConfiguredProjectMap.forEach(((t,n)=>{const r=`Reloading configured project in external project: ${n}`;t.forEach((t=>{if(this.getHostPreferences().lazyConfiguredProjectsFromExternalProject){this.reloadConfiguredProjectOptimized(t,r,e)}else{this.reloadConfiguredProjectClearingSemanticCache(t,r,e)}}))}));this.openFiles.forEach(((n,r)=>{const i=this.getScriptInfoForPath(r);if(find(i.containingProjects,isExternalProject))return;this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(i,7,e,t)}));t.forEach((t=>e.set(t,7)));this.inferredProjects.forEach((e=>this.clearSemanticCache(e)));this.ensureProjectForOpenFiles();this.cleanupProjectsAndScriptInfos(e,new Set(this.openFiles.keys()),new Set(this.externalProjectToConfiguredProjectMap.keys()));this.logger.info("After reloading projects..");this.printProjects()}removeRootOfInferredProjectIfNowPartOfOtherProject(e){S.assert(e.containingProjects.length>0);const t=e.containingProjects[0];if(!t.isOrphan()&&isInferredProject(t)&&t.isRoot(e)&&forEach(e.containingProjects,(e=>e!==t&&!e.isOrphan()))){t.removeFile(e,true,true)}}ensureProjectForOpenFiles(){this.logger.info("Before ensureProjectForOpenFiles:");this.printProjects();const e=this.pendingOpenFileProjectUpdates;this.pendingOpenFileProjectUpdates=void 0;e==null?void 0:e.forEach(((e,t)=>this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(this.getScriptInfoForPath(t),5)));this.openFiles.forEach(((e,t)=>{const n=this.getScriptInfoForPath(t);if(n.isOrphan()){this.assignOrphanScriptInfoToInferredProject(n,e)}else{this.removeRootOfInferredProjectIfNowPartOfOtherProject(n)}}));this.pendingEnsureProjectForOpenFiles=false;this.inferredProjects.forEach(updateProjectIfDirty);this.logger.info("After ensureProjectForOpenFiles:");this.printProjects()}openClientFile(e,t,n,r){return this.openClientFileWithNormalizedPath(toNormalizedPath(e),t,n,false,r?toNormalizedPath(r):void 0)}getOriginalLocationEnsuringConfiguredProject(e,t){const n=e.isSourceOfProjectReferenceRedirect(t.fileName);const r=n?t:e.getSourceMapper().tryGetSourcePosition(t);if(!r)return void 0;const{fileName:i}=r;const o=this.getScriptInfo(i);if(!o&&!this.host.fileExists(i))return void 0;const a={fileName:toNormalizedPath(i),path:this.toPath(i)};const s=this.getConfigFileNameForFile(a,false);if(!s)return void 0;let c=this.findConfiguredProjectByProjectName(s);if(!c){if(e.getCompilerOptions().disableReferencedProjectLoad){if(n){return t}return(o==null?void 0:o.containingProjects.length)?r:t}c=this.createConfiguredProject(s,`Creating project for original file: ${a.fileName}${t!==r?" for location: "+t.fileName:""}`)}const l=this.tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo(a,5,updateProjectFoundUsingFind(c,4),(e=>`Creating project referenced in solution ${e.projectName} to find possible configured project for original file: ${a.fileName}${t!==r?" for location: "+t.fileName:""}`));if(!l.defaultProject)return void 0;if(l.defaultProject===e)return r;addOriginalConfiguredProject(l.defaultProject);const d=this.getScriptInfo(i);if(!d||!d.containingProjects.length)return void 0;d.containingProjects.forEach((e=>{if(isConfiguredProject(e)){addOriginalConfiguredProject(e)}}));return r;function addOriginalConfiguredProject(t){(e.originalConfiguredProjects??(e.originalConfiguredProjects=new Set)).add(t.canonicalConfigFilePath)}}fileExists(e){return!!this.getScriptInfoForNormalizedPath(e)||this.host.fileExists(e)}findExternalProjectContainingOpenScriptInfo(e){return find(this.externalProjects,(t=>{updateProjectIfDirty(t);return t.containsScriptInfo(e)}))}getOrCreateOpenScriptInfo(e,t,n,r,i){const o=this.getOrCreateScriptInfoWorker(e,i?this.getNormalizedAbsolutePath(i):this.currentDirectory,true,t,n,!!r,void 0,true);this.openFiles.set(o.path,i);return o}assignProjectToOpenedScriptInfo(e){let t;let n;const r=this.findExternalProjectContainingOpenScriptInfo(e);let i;let o;if(!r&&this.serverMode===0){const r=this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(e,5);if(r){i=r.seenProjects;o=r.sentConfigDiag;if(r.defaultProject){t=r.defaultProject.getConfigFilePath();n=r.defaultProject.getAllProjectErrors()}}}e.containingProjects.forEach(updateProjectIfDirty);if(e.isOrphan()){i==null?void 0:i.forEach(((t,n)=>{if(t!==4&&!o.has(n))this.sendConfigFileDiagEvent(n,e.fileName,true)}));S.assert(this.openFiles.has(e.path));this.assignOrphanScriptInfoToInferredProject(e,this.openFiles.get(e.path))}S.assert(!e.isOrphan());return{configFileName:t,configFileErrors:n,retainProjects:i}}findCreateOrReloadConfiguredProject(e,t,n,r,i,o,a,s,c){let l=c??this.findConfiguredProjectByProjectName(e,r);let d=false;let p;switch(t){case 0:case 1:case 3:if(!l)return;break;case 2:if(!l)return;p=configFileExistenceInfoForOptimizedReplay(l);break;case 4:case 5:l??(l=this.createConfiguredProject(e,n));if(!a){({sentConfigFileDiag:d,configFileExistenceInfo:p}=updateProjectFoundUsingFind(l,t,i))}break;case 6:l??(l=this.createConfiguredProject(e,reloadReason(n)));l.projectService.reloadConfiguredProjectOptimized(l,n,o);p=configFileExistenceInfoForOptimizedLoading(l);if(p)break;case 7:l??(l=this.createConfiguredProject(e,reloadReason(n)));d=!s&&this.reloadConfiguredProjectClearingSemanticCache(l,n,o);if(s&&!s.has(l)&&!o.has(l)){this.setProjectForReload(l,2,n);s.add(l)}break;default:S.assertNever(t)}return{project:l,sentConfigFileDiag:d,configFileExistenceInfo:p,reason:n}}tryFindDefaultConfiguredProjectForOpenScriptInfo(e,t,n,r){const i=this.getConfigFileNameForFile(e,t<=3);if(!i)return;const o=toConfiguredProjectLoadOptimized(t);const a=this.findCreateOrReloadConfiguredProject(i,o,fileOpenReason(e),n,e.fileName,r);return a&&this.tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo(e,t,a,(t=>`Creating project referenced in solution ${t.projectName} to find possible configured project for ${e.fileName} to open`),n,r)}isMatchedByConfig(e,t,n){if(t.fileNames.some((e=>this.toPath(e)===n.path)))return true;if(isSupportedSourceFileName(n.fileName,t.options,this.hostConfiguration.extraFileExtensions))return false;const{validatedFilesSpec:r,validatedIncludeSpecs:i,validatedExcludeSpecs:o}=t.options.configFile.configFileSpecs;const a=toNormalizedPath(getNormalizedAbsolutePath(getDirectoryPath(e),this.currentDirectory));if(r==null?void 0:r.some((e=>this.toPath(getNormalizedAbsolutePath(e,a))===n.path)))return true;if(!(i==null?void 0:i.length))return false;if(matchesExcludeWorker(n.fileName,o,this.host.useCaseSensitiveFileNames,this.currentDirectory,a))return false;return i==null?void 0:i.some((e=>{const t=getPatternFromSpec(e,a,"files");return!!t&&getRegexFromPattern(`(${t})$`,this.host.useCaseSensitiveFileNames).test(n.fileName)}))}tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo(e,t,n,r,i,o){const a=isOpenScriptInfo(e);const s=toConfiguredProjectLoadOptimized(t);const c=new Map;let l;const d=new Set;let p;let u;let f;let m;tryFindDefaultConfiguredProject(n);return{defaultProject:p??u,tsconfigProject:f??m,sentConfigDiag:d,seenProjects:c,seenConfigs:l};function tryFindDefaultConfiguredProject(e){return isDefaultProjectOptimized(e,e.project)??tryFindDefaultConfiguredProjectFromReferences(e.project)??tryFindDefaultConfiguredProjectFromAncestor(e.project)}function isDefaultConfigFileExistenceInfo(n,r,a,p,u,f){if(r){if(c.has(r))return;c.set(r,s)}else{if(l==null?void 0:l.has(f))return;(l??(l=new Set)).add(f)}if(!u.projectService.isMatchedByConfig(a,n.config.parsedCommandLine,e)){if(u.languageServiceEnabled){u.projectService.watchWildcards(a,n,u)}return}const m=r?updateProjectFoundUsingFind(r,t,e.fileName,p,o):u.projectService.findCreateOrReloadConfiguredProject(a,t,p,i,e.fileName,o);if(!m){S.assert(t===3);return void 0}c.set(m.project,s);if(m.sentConfigFileDiag)d.add(m.project);return isDefaultProject(m.project,u)}function isDefaultProject(n,r){if(c.get(n)===t)return;c.set(n,t);const i=a?e:n.projectService.getScriptInfo(e.fileName);const o=i&&n.containsScriptInfo(i);if(o&&!n.isSourceOfProjectReferenceRedirect(i.path)){f=r;return p=n}if(!u&&a&&o){m=r;u=n}}function isDefaultProjectOptimized(e,t){if(e.sentConfigFileDiag)d.add(e.project);return e.configFileExistenceInfo?isDefaultConfigFileExistenceInfo(e.configFileExistenceInfo,e.project,toNormalizedPath(e.project.getConfigFilePath()),e.reason,e.project,e.project.canonicalConfigFilePath):isDefaultProject(e.project,t)}function tryFindDefaultConfiguredProjectFromReferences(e){return e.parsedCommandLine&&forEachResolvedProjectReferenceProjectLoad(e,e.parsedCommandLine,isDefaultConfigFileExistenceInfo,s,r(e),i,o)}function tryFindDefaultConfiguredProjectFromAncestor(t){return a?forEachAncestorProjectLoad(e,t,tryFindDefaultConfiguredProject,s,`Creating possible configured project for ${e.fileName} to open`,i,o,false):void 0}}tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(e,t,n,r){const i=t===1;const o=this.tryFindDefaultConfiguredProjectForOpenScriptInfo(e,t,i,n);if(!o)return;const{defaultProject:a,tsconfigProject:s,seenProjects:c}=o;if(a){forEachAncestorProjectLoad(e,s,(e=>{c.set(e.project,t)}),t,`Creating project possibly referencing default composite project ${a.getProjectName()} of open file ${e.fileName}`,i,n,true,r)}return o}loadAncestorProjectTree(e){e??(e=new Set(mapDefinedIterator(this.configuredProjects.entries(),(([e,t])=>!t.initialLoadPending?e:void 0))));const t=new Set;const n=arrayFrom(this.configuredProjects.values());for(const r of n){if(forEachPotentialProjectReference(r,(t=>e.has(t)))){updateProjectIfDirty(r)}this.ensureProjectChildren(r,e,t)}}ensureProjectChildren(e,t,n){var r;if(!tryAddToSet(n,e.canonicalConfigFilePath))return;if(e.getCompilerOptions().disableReferencedProjectLoad)return;const i=(r=e.getCurrentProgram())==null?void 0:r.getResolvedProjectReferences();if(!i)return;for(const r of i){if(!r)continue;const i=forEachResolvedProjectReference(r.references,(e=>t.has(e.sourceFile.path)?e:void 0));if(!i)continue;const o=toNormalizedPath(r.sourceFile.fileName);const a=this.findConfiguredProjectByProjectName(o)??this.createConfiguredProject(o,`Creating project referenced by : ${e.projectName} as it references project ${i.sourceFile.fileName}`);updateProjectIfDirty(a);this.ensureProjectChildren(a,t,n)}}cleanupConfiguredProjects(e,t,n){this.getOrphanConfiguredProjects(e,n,t).forEach((e=>this.removeProject(e)))}cleanupProjectsAndScriptInfos(e,t,n){this.cleanupConfiguredProjects(e,n,t);for(const e of this.inferredProjects.slice()){if(e.isOrphan()){this.removeProject(e)}}this.removeOrphanScriptInfos()}tryInvokeWildCardDirectories(e){this.configFileExistenceInfoCache.forEach(((t,n)=>{var r,i;if(!((r=t.config)==null?void 0:r.parsedCommandLine)||contains(t.config.parsedCommandLine.fileNames,e.fileName,!this.host.useCaseSensitiveFileNames?equateStringsCaseInsensitive:equateStringsCaseSensitive)){return}(i=t.config.watchedDirectories)==null?void 0:i.forEach(((r,i)=>{if(containsPath(i,e.fileName,!this.host.useCaseSensitiveFileNames)){this.logger.info(`Invoking ${n}:: wildcard for open scriptInfo:: ${e.fileName}`);this.onWildCardDirectoryWatcherInvoke(i,n,t.config,r.watcher,e.fileName)}}))}))}openClientFileWithNormalizedPath(e,t,n,r,i){const o=this.getScriptInfoForPath(normalizedPathToPath(e,i?this.getNormalizedAbsolutePath(i):this.currentDirectory,this.toCanonicalFileName));const a=this.getOrCreateOpenScriptInfo(e,t,n,r,i);if(!o&&a&&!a.isDynamic)this.tryInvokeWildCardDirectories(a);const{retainProjects:s,...c}=this.assignProjectToOpenedScriptInfo(a);this.cleanupProjectsAndScriptInfos(s,new Set([a.path]),void 0);this.telemetryOnOpenFile(a);this.printProjects();return c}getOrphanConfiguredProjects(e,t,n){const r=new Set(this.configuredProjects.values());const markOriginalProjectsAsUsed=e=>{if(e.originalConfiguredProjects&&(isConfiguredProject(e)||!e.isOrphan())){e.originalConfiguredProjects.forEach(((e,t)=>{const n=this.getConfiguredProjectByCanonicalConfigFilePath(t);return n&&retainConfiguredProject(n)}))}};e==null?void 0:e.forEach(((e,t)=>retainConfiguredProject(t)));if(!r.size)return r;this.inferredProjects.forEach(markOriginalProjectsAsUsed);this.externalProjects.forEach(markOriginalProjectsAsUsed);this.externalProjectToConfiguredProjectMap.forEach(((e,t)=>{if(!(n==null?void 0:n.has(t))){e.forEach(retainConfiguredProject)}}));if(!r.size)return r;forEachEntry(this.openFiles,((e,n)=>{if(t==null?void 0:t.has(n))return;const i=this.getScriptInfoForPath(n);if(find(i.containingProjects,isExternalProject))return;const o=this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(i,1);if(o==null?void 0:o.defaultProject){o==null?void 0:o.seenProjects.forEach(((e,t)=>retainConfiguredProject(t)));if(!r.size)return r}}));if(!r.size)return r;forEachEntry(this.configuredProjects,(e=>{if(r.has(e)){if(isPendingUpdate(e)||forEachReferencedProject(e,isRetained)){retainConfiguredProject(e);if(!r.size)return r}}}));return r;function isRetained(e){return!r.has(e)||isPendingUpdate(e)}function isPendingUpdate(e){var t,n;return(e.deferredClose||e.projectService.hasPendingProjectUpdate(e))&&!!((n=(t=e.projectService.configFileExistenceInfoCache.get(e.canonicalConfigFilePath))==null?void 0:t.openFilesImpactedByConfigFile)==null?void 0:n.size)}function retainConfiguredProject(e){if(!r.delete(e))return;markOriginalProjectsAsUsed(e);forEachReferencedProject(e,retainConfiguredProject)}}removeOrphanScriptInfos(){const e=new Map(this.filenameToScriptInfo);this.filenameToScriptInfo.forEach((t=>{if(t.deferredDelete)return;if(!t.isScriptOpen()&&t.isOrphan()&&!scriptInfoIsContainedByDeferredClosedProject(t)&&!scriptInfoIsContainedByBackgroundProject(t)){if(!t.sourceMapFilePath)return;let e;if(isString(t.sourceMapFilePath)){const n=this.filenameToScriptInfo.get(t.sourceMapFilePath);e=n==null?void 0:n.sourceInfos}else{e=t.sourceMapFilePath.sourceInfos}if(!e)return;if(!forEachKey(e,(e=>{const t=this.getScriptInfoForPath(e);return!!t&&(t.isScriptOpen()||!t.isOrphan())}))){return}}e.delete(t.path);if(t.sourceMapFilePath){let n;if(isString(t.sourceMapFilePath)){const r=this.filenameToScriptInfo.get(t.sourceMapFilePath);if(r==null?void 0:r.deferredDelete){t.sourceMapFilePath={watcher:this.addMissingSourceMapFile(r.fileName,t.path),sourceInfos:r.sourceInfos}}else{e.delete(t.sourceMapFilePath)}n=r==null?void 0:r.sourceInfos}else{n=t.sourceMapFilePath.sourceInfos}if(n){n.forEach(((t,n)=>e.delete(n)))}}}));e.forEach((e=>this.deleteScriptInfo(e)))}telemetryOnOpenFile(e){if(this.serverMode!==0||!this.eventHandler||!e.isJavaScript()||!addToSeen(this.allJsFilesForOpenFileTelemetry,e.path)){return}const t=this.ensureDefaultProjectForFile(e);if(!t.languageServiceEnabled){return}const n=t.getSourceFile(e.path);const r=!!n&&!!n.checkJsDirective;this.eventHandler({eventName:k_,data:{info:{checkJs:r}}})}closeClientFile(e,t){const n=this.getScriptInfoForNormalizedPath(toNormalizedPath(e));const r=n?this.closeOpenFile(n,t):false;if(!t){this.printProjects()}return r}collectChanges(e,t,n,r){for(const i of t){const t=find(e,(e=>e.projectName===i.getProjectName()));r.push(i.getChangesSinceVersion(t&&t.version,n))}}synchronizeProjectList(e,t){const n=[];this.collectChanges(e,this.externalProjects,t,n);this.collectChanges(e,mapDefinedIterator(this.configuredProjects.values(),(e=>e.deferredClose?void 0:e)),t,n);this.collectChanges(e,this.inferredProjects,t,n);return n}applyChangesInOpenFiles(e,t,n){let r;let i;let o=false;if(e){for(const t of e){(r??(r=[])).push(this.getScriptInfoForPath(normalizedPathToPath(toNormalizedPath(t.fileName),t.projectRootPath?this.getNormalizedAbsolutePath(t.projectRootPath):this.currentDirectory,this.toCanonicalFileName)));const e=this.getOrCreateOpenScriptInfo(toNormalizedPath(t.fileName),t.content,tryConvertScriptKindName(t.scriptKind),t.hasMixedContent,t.projectRootPath?toNormalizedPath(t.projectRootPath):void 0);(i||(i=[])).push(e)}}if(t){for(const e of t){const t=this.getScriptInfo(e.fileName);S.assert(!!t);this.applyChangesToFile(t,e.changes)}}if(n){for(const e of n){o=this.closeClientFile(e,true)||o}}let a;forEach(r,((e,t)=>!e&&i[t]&&!i[t].isDynamic?this.tryInvokeWildCardDirectories(i[t]):void 0));i==null?void 0:i.forEach((e=>{var t;return(t=this.assignProjectToOpenedScriptInfo(e).retainProjects)==null?void 0:t.forEach(((e,t)=>(a??(a=new Map)).set(t,e)))}));if(o){this.assignOrphanScriptInfosToInferredProject()}if(i){this.cleanupProjectsAndScriptInfos(a,new Set(i.map((e=>e.path))),void 0);i.forEach((e=>this.telemetryOnOpenFile(e)));this.printProjects()}else if(length(n)){this.printProjects()}}applyChangesToFile(e,t){for(const n of t){e.editContent(n.span.start,n.span.start+n.span.length,n.newText)}}closeExternalProject(e,t){const n=toNormalizedPath(e);const r=this.externalProjectToConfiguredProjectMap.get(n);if(r){this.externalProjectToConfiguredProjectMap.delete(n)}else{const t=this.findExternalProjectByProjectName(e);if(t){this.removeProject(t)}}if(t){this.cleanupConfiguredProjects();this.printProjects()}}openExternalProjects(e){const t=new Set(this.externalProjects.map((e=>e.getProjectName())));this.externalProjectToConfiguredProjectMap.forEach(((e,n)=>t.add(n)));for(const n of e){this.openExternalProject(n,false);t.delete(n.projectFileName)}t.forEach((e=>this.closeExternalProject(e,false)));this.cleanupConfiguredProjects();this.printProjects()}static escapeFilenameForRegex(e){return e.replace(this.filenameEscapeRegexp,"\\$&")}resetSafeList(){this.safelist=L_}applySafeList(e){const t=e.typeAcquisition;S.assert(!!t,"proj.typeAcquisition should be set by now");const n=this.applySafeListWorker(e,e.rootFiles,t);return(n==null?void 0:n.excludedFiles)??[]}applySafeListWorker(e,t,n){if(n.enable===false||n.disableFilenameBasedTypeAcquisition){return void 0}const r=n.include||(n.include=[]);const i=[];const o=t.map((e=>normalizeSlashes(e.fileName)));for(const e of Object.keys(this.safelist)){const t=this.safelist[e];for(const n of o){if(t.match.test(n)){this.logger.info(`Excluding files based on rule ${e} matching file '${n}'`);if(t.types){for(const e of t.types){if(!r.includes(e)){r.push(e)}}}if(t.exclude){for(const r of t.exclude){const o=n.replace(t.match,((...t)=>r.map((n=>{if(typeof n==="number"){if(!isString(t[n])){this.logger.info(`Incorrect RegExp specification in safelist rule ${e} - not enough groups`);return"\\*"}return _ProjectService.escapeFilenameForRegex(t[n])}return n})).join("")));if(!i.includes(o)){i.push(o)}}}else{const e=_ProjectService.escapeFilenameForRegex(n);if(!i.includes(e)){i.push(e)}}}}}const a=i.map((e=>new RegExp(e,"i")));let s;let c;for(let e=0;et.test(o[e])))){addExcludedFile(e)}else{if(n.enable){const t=getBaseFileName(toFileNameLowerCase(o[e]));if(fileExtensionIs(t,"js")){const n=removeFileExtension(t);const i=removeMinAndVersionNumbers(n);const a=this.legacySafelist.get(i);if(a!==void 0){this.logger.info(`Excluded '${o[e]}' because it matched ${i} from the legacy safelist`);addExcludedFile(e);if(!r.includes(a)){r.push(a)}continue}}}if(/^.+[.-]min\.js$/.test(o[e])){addExcludedFile(e)}else{s==null?void 0:s.push(t[e])}}}return c?{rootFiles:s,excludedFiles:c}:void 0;function addExcludedFile(e){if(!c){S.assert(!s);s=t.slice(0,e);c=[]}c.push(o[e])}}openExternalProject(e,t){const n=this.findExternalProjectByProjectName(e.projectFileName);let r;let i=[];for(const t of e.rootFiles){const n=toNormalizedPath(t.fileName);if(getBaseConfigFileName(n)){if(this.serverMode===0&&this.host.fileExists(n)){let t=this.findConfiguredProjectByProjectName(n);if(!t){t=this.createConfiguredProject(n,`Creating configured project in external project: ${e.projectFileName}`);if(!this.getHostPreferences().lazyConfiguredProjectsFromExternalProject)t.updateGraph()}(r??(r=new Set)).add(t);S.assert(!t.isClosed())}}else{i.push(t)}}if(r){this.externalProjectToConfiguredProjectMap.set(e.projectFileName,r);if(n)this.removeProject(n)}else{this.externalProjectToConfiguredProjectMap.delete(e.projectFileName);const t=e.typeAcquisition||{};t.include=t.include||[];t.exclude=t.exclude||[];if(t.enable===void 0){t.enable=hasNoTypeScriptSource(i.map((e=>e.fileName)))}const r=this.applySafeListWorker(e,i,t);const o=(r==null?void 0:r.excludedFiles)??[];i=(r==null?void 0:r.rootFiles)??i;if(n){n.excludedFiles=o;const r=convertCompilerOptions(e.options);const a=convertWatchOptions(e.options,n.getCurrentDirectory());const s=this.getFilenameForExceededTotalSizeLimitForNonTsFiles(e.projectFileName,r,i,R_);if(s){n.disableLanguageService(s)}else{n.enableLanguageService()}n.setProjectErrors(a==null?void 0:a.errors);this.updateRootAndOptionsOfNonInferredProject(n,i,R_,r,t,e.options.compileOnSave,a==null?void 0:a.watchOptions);n.updateGraph()}else{const n=this.createExternalProject(e.projectFileName,i,e.options,t,o);n.updateGraph()}}if(t){this.cleanupConfiguredProjects(r,new Set([e.projectFileName]));this.printProjects()}}hasDeferredExtension(){for(const e of this.hostConfiguration.extraFileExtensions){if(e.scriptKind===7){return true}}return false}requestEnablePlugin(e,t,n){if(!this.host.importPlugin&&!this.host.require){this.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");return}this.logger.info(`Enabling plugin ${t.name} from candidate paths: ${n.join(",")}`);if(!t.name||isExternalModuleNameRelative(t.name)||/[\\/]\.\.?(?:$|[\\/])/.test(t.name)){this.logger.info(`Skipped loading plugin ${t.name||JSON.stringify(t)} because only package name is allowed plugin name`);return}if(this.host.importPlugin){const r=p_.importServicePluginAsync(t,n,this.host,(e=>this.logger.info(e)));this.pendingPluginEnablements??(this.pendingPluginEnablements=new Map);let i=this.pendingPluginEnablements.get(e);if(!i)this.pendingPluginEnablements.set(e,i=[]);i.push(r);return}this.endEnablePlugin(e,p_.importServicePluginSync(t,n,this.host,(e=>this.logger.info(e))))}endEnablePlugin(e,{pluginConfigEntry:t,resolvedModule:n,errorLogs:r}){var i;if(n){const r=(i=this.currentPluginConfigOverrides)==null?void 0:i.get(t.name);if(r){const e=t.name;t=r;t.name=e}e.enableProxy(n,t)}else{forEach(r,(e=>this.logger.info(e)));this.logger.info(`Couldn't find ${t.name}`)}}hasNewPluginEnablementRequests(){return!!this.pendingPluginEnablements}hasPendingPluginEnablements(){return!!this.currentPluginEnablementPromise}async waitForPendingPlugins(){while(this.currentPluginEnablementPromise){await this.currentPluginEnablementPromise}}enableRequestedPlugins(){if(this.pendingPluginEnablements){void this.enableRequestedPluginsAsync()}}async enableRequestedPluginsAsync(){if(this.currentPluginEnablementPromise){await this.waitForPendingPlugins()}if(!this.pendingPluginEnablements){return}const e=arrayFrom(this.pendingPluginEnablements.entries());this.pendingPluginEnablements=void 0;this.currentPluginEnablementPromise=this.enableRequestedPluginsWorker(e);await this.currentPluginEnablementPromise}async enableRequestedPluginsWorker(e){S.assert(this.currentPluginEnablementPromise===void 0);let t=false;await Promise.all(map(e,(async([e,n])=>{const r=await Promise.all(n);if(e.isClosed()||isProjectDeferredClose(e)){this.logger.info(`Cancelling plugin enabling for ${e.getProjectName()} as it is ${e.isClosed()?"closed":"deferred close"}`);return}t=true;for(const t of r){this.endEnablePlugin(e,t)}this.delayUpdateProjectGraph(e)})));this.currentPluginEnablementPromise=void 0;if(t)this.sendProjectsUpdatedInBackgroundEvent()}configurePlugin(e){this.forEachEnabledProject((t=>t.onPluginConfigurationChanged(e.pluginName,e.configuration)));this.currentPluginConfigOverrides=this.currentPluginConfigOverrides||new Map;this.currentPluginConfigOverrides.set(e.pluginName,e.configuration)}getPackageJsonsVisibleToFile(e,t,n){const r=this.packageJsonCache;const i=n&&this.toPath(n);const o=[];const processDirectory=e=>{switch(r.directoryHasPackageJson(e)){case 3:r.searchDirectoryAndAncestors(e,t);return processDirectory(e);case-1:const n=combinePaths(e,"package.json");this.watchPackageJsonFile(n,this.toPath(n),t);const i=r.getInDirectory(e);if(i)o.push(i)}if(i&&i===e){return true}};forEachAncestorDirectoryStoppingAtGlobalCache(t,getDirectoryPath(e),processDirectory);return o}getNearestAncestorDirectoryWithPackageJson(e,t){return forEachAncestorDirectoryStoppingAtGlobalCache(t,e,(e=>{switch(this.packageJsonCache.directoryHasPackageJson(e)){case-1:return e;case 0:return void 0;case 3:return this.host.fileExists(combinePaths(e,"package.json"))?e:void 0}}))}watchPackageJsonFile(e,t,n){S.assert(n!==void 0);let r=(this.packageJsonFilesMap??(this.packageJsonFilesMap=new Map)).get(t);if(!r){let n=this.watchFactory.watchFile(e,((e,n)=>{switch(n){case 0:case 1:this.packageJsonCache.addOrUpdate(e,t);this.onPackageJsonChange(r);break;case 2:this.packageJsonCache.delete(t);this.onPackageJsonChange(r);r.projects.clear();r.close()}}),250,this.hostConfiguration.watchOptions,ns.PackageJson);r={projects:new Set,close:()=>{var e;if(r.projects.size||!n)return;n.close();n=void 0;(e=this.packageJsonFilesMap)==null?void 0:e.delete(t);this.packageJsonCache.invalidate(t)}};this.packageJsonFilesMap.set(t,r)}r.projects.add(n);(n.packageJsonWatches??(n.packageJsonWatches=new Set)).add(r)}onPackageJsonChange(e){e.projects.forEach((e=>{var t;return(t=e.onPackageJsonChange)==null?void 0:t.call(e)}))}includePackageJsonAutoImports(){switch(this.hostConfiguration.preferences.includePackageJsonAutoImports){case"on":return 1;case"off":return 0;default:return 2}}getIncompleteCompletionsCache(){return this.incompleteCompletionsCache||(this.incompleteCompletionsCache=createIncompleteCompletionsCache())}};W_.filenameEscapeRegexp=/[-/\\^$*+?.()|[\]{}]/g;var U_=W_;function createIncompleteCompletionsCache(){let e;return{get(){return e},set(t){e=t},clear(){e=void 0}}}function isConfigFile(e){return e.kind!==void 0}function printProjectWithoutFileNames(e){e.print(false,false,false)}function createModuleSpecifierCache(e){let t;let n;let r;const i={get(e,t,i,o){if(!n||r!==key(e,i,o))return void 0;return n.get(t)},set(n,r,i,o,a,s,c){ensureCache(n,i,o).set(r,createInfo(a,s,c,void 0,false));if(c){for(const n of s){if(n.isInNodeModules){const r=n.path.substring(0,n.path.indexOf(Wo)+Wo.length-1);const i=e.toPath(r);if(!(t==null?void 0:t.has(i))){(t||(t=new Map)).set(i,e.watchNodeModulesForPackageJsonChanges(r))}}}}},setModulePaths(e,t,n,r,i){const o=ensureCache(e,n,r);const a=o.get(t);if(a){a.modulePaths=i}else{o.set(t,createInfo(void 0,i,void 0,void 0,void 0))}},setBlockedByPackageJsonDependencies(e,t,n,r,i,o){const a=ensureCache(e,n,r);const s=a.get(t);if(s){s.isBlockedByPackageJsonDependencies=o;s.packageName=i}else{a.set(t,createInfo(void 0,void 0,void 0,i,o))}},clear(){t==null?void 0:t.forEach(closeFileWatcher);n==null?void 0:n.clear();t==null?void 0:t.clear();r=void 0},count(){return n?n.size:0}};if(S.isDebugging){Object.defineProperty(i,"__cache",{get:()=>n})}return i;function ensureCache(e,t,o){const a=key(e,t,o);if(n&&r!==a){i.clear()}r=a;return n||(n=new Map)}function key(e,t,n){return`${e},${t.importModuleSpecifierEnding},${t.importModuleSpecifierPreference},${n.overrideImportMode}`}function createInfo(e,t,n,r,i){return{kind:e,modulePaths:t,moduleSpecifiers:n,packageName:r,isBlockedByPackageJsonDependencies:i}}}function createPackageJsonCache(e){const t=new Map;const n=new Map;return{addOrUpdate:addOrUpdate,invalidate:invalidate,delete:e=>{t.delete(e);n.set(getDirectoryPath(e),true)},getInDirectory:n=>t.get(e.toPath(combinePaths(n,"package.json")))||void 0,directoryHasPackageJson:t=>directoryHasPackageJson(e.toPath(t)),searchDirectoryAndAncestors:(t,r)=>{forEachAncestorDirectoryStoppingAtGlobalCache(r,t,(t=>{const r=e.toPath(t);if(directoryHasPackageJson(r)!==3){return true}const i=combinePaths(t,"package.json");if(tryFileExists(e,i)){addOrUpdate(i,combinePaths(r,"package.json"))}else{n.set(r,true)}}))}};function addOrUpdate(r,i){const o=S.checkDefined(createPackageJsonInfo(r,e.host));t.set(i,o);n.delete(getDirectoryPath(i))}function invalidate(e){t.delete(e);n.delete(getDirectoryPath(e))}function directoryHasPackageJson(e){return t.has(combinePaths(e,"package.json"))?-1:n.has(e)?0:3}}var z_={isCancellationRequested:()=>false,setRequest:()=>void 0,resetRequest:()=>void 0};function hrTimeToMilliseconds(e){const t=e[0];const n=e[1];return(1e9*t+n)/1e6}function isDeclarationFileInJSOnlyNonConfiguredProject(e,t){if((isInferredProject(e)||isExternalProject(e))&&e.isJsOnlyProject()){const n=e.getScriptInfoForNormalizedPath(t);return n&&!n.isJavaScript()}return false}function dtsChangeCanAffectEmit(e){return Zn(e)||!!e.emitDecoratorMetadata}function formatDiag(e,t,n){const r=t.getScriptInfoForNormalizedPath(e);return{start:r.positionToLineOffset(n.start),end:r.positionToLineOffset(n.start+n.length),text:flattenDiagnosticMessageText(n.messageText,"\n"),code:n.code,category:diagnosticCategoryName(n),reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated,source:n.source,relatedInformation:map(n.relatedInformation,formatRelatedInformation)}}function formatRelatedInformation(e){if(!e.file){return{message:flattenDiagnosticMessageText(e.messageText,"\n"),category:diagnosticCategoryName(e),code:e.code}}return{span:{start:convertToLocation(getLineAndCharacterOfPosition(e.file,e.start)),end:convertToLocation(getLineAndCharacterOfPosition(e.file,e.start+e.length)),file:e.file.fileName},message:flattenDiagnosticMessageText(e.messageText,"\n"),category:diagnosticCategoryName(e),code:e.code}}function convertToLocation(e){return{line:e.line+1,offset:e.character+1}}function formatDiagnosticToProtocol(e,t){const n=e.file&&convertToLocation(getLineAndCharacterOfPosition(e.file,e.start));const r=e.file&&convertToLocation(getLineAndCharacterOfPosition(e.file,e.start+e.length));const i=flattenDiagnosticMessageText(e.messageText,"\n");const{code:o,source:a}=e;const s=diagnosticCategoryName(e);const c={start:n,end:r,text:i,code:o,category:s,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated,source:a,relatedInformation:map(e.relatedInformation,formatRelatedInformation)};return t?{...c,fileName:e.file&&e.file.fileName}:c}function allEditsBeforePos(e,t){return e.every((e=>textSpanEnd(e.span){this.immediateId=void 0;this.operationHost.executeWithRequestId(n,(()=>this.executeAction(t)),this.performanceData)}),e))}delay(e,t,n){const r=this.requestId;S.assert(r===this.operationHost.getCurrentRequestId(),"delay: incorrect request id");this.setTimerHandle(this.operationHost.getServerHost().setTimeout((()=>{this.timerHandle=void 0;this.operationHost.executeWithRequestId(r,(()=>this.executeAction(n)),this.performanceData)}),t,e))}executeAction(e){var t,n,r,i,o,a;let s=false;try{if(this.operationHost.isCancellationRequested()){s=true;(t=G)==null?void 0:t.instant(G.Phase.Session,"stepCanceled",{seq:this.requestId,early:true})}else{(n=G)==null?void 0:n.push(G.Phase.Session,"stepAction",{seq:this.requestId});e(this);(r=G)==null?void 0:r.pop()}}catch(e){(i=G)==null?void 0:i.popAll();s=true;if(e instanceof ce){(o=G)==null?void 0:o.instant(G.Phase.Session,"stepCanceled",{seq:this.requestId})}else{(a=G)==null?void 0:a.instant(G.Phase.Session,"stepError",{seq:this.requestId,message:e.message});this.operationHost.logError(e,`delayed processing of request ${this.requestId}`)}}this.performanceData=this.operationHost.getPerformanceData();if(s||!this.hasPendingWork()){this.complete()}}setTimerHandle(e){if(this.timerHandle!==void 0){this.operationHost.getServerHost().clearTimeout(this.timerHandle)}this.timerHandle=e}setImmediateId(e){if(this.immediateId!==void 0){this.operationHost.getServerHost().clearImmediate(this.immediateId)}this.immediateId=e}hasPendingWork(){return!!this.timerHandle||!!this.immediateId}};function toEvent(e,t){return{seq:0,type:"event",event:e,body:t}}function combineProjectOutput(e,t,n,r){const i=flatMapToMutable(isArray(n)?n:n.projects,(t=>r(t,e)));if(!isArray(n)&&n.symLinkedProjects){n.symLinkedProjects.forEach(((e,n)=>{const o=t(n);i.push(...flatMap(e,(e=>r(e,o))))}))}return deduplicate(i,equateValues)}function createDocumentSpanSet(e){return createSet((({textSpan:e})=>e.start+100003*e.length),getDocumentSpansEqualityComparer(e))}function getRenameLocationsWorker(e,t,n,r,i,o,a){const s=getPerProjectReferences(e,t,n,getDefinitionLocation(t,n,true),mapDefinitionInProject,((e,t)=>e.getLanguageService().findRenameLocations(t.fileName,t.pos,r,i,o)),((e,t)=>t(documentSpanLocation(e))));if(isArray(s)){return s}const c=[];const l=createDocumentSpanSet(a);s.forEach(((e,t)=>{for(const n of e){if(!l.has(n)&&!getMappedLocationForProject(documentSpanLocation(n),t)){c.push(n);l.add(n)}}}));return c}function getDefinitionLocation(e,t,n){const r=e.getLanguageService().getDefinitionAtPosition(t.fileName,t.pos,false,n);const i=r&&firstOrUndefined(r);return i&&!i.isLocal?{fileName:i.fileName,pos:i.textSpan.start}:void 0}function getReferencesWorker(e,t,n,r,i){var o,a;const s=getPerProjectReferences(e,t,n,getDefinitionLocation(t,n,false),mapDefinitionInProject,((e,t)=>{i.info(`Finding references to ${t.fileName} position ${t.pos} in project ${e.getProjectName()}`);return e.getLanguageService().findReferences(t.fileName,t.pos)}),((e,t)=>{t(documentSpanLocation(e.definition));for(const n of e.references){t(documentSpanLocation(n))}}));if(isArray(s)){return s}const c=s.get(t);if(((a=(o=c==null?void 0:c[0])==null?void 0:o.references[0])==null?void 0:a.isDefinition)===void 0){s.forEach((e=>{for(const t of e){for(const e of t.references){delete e.isDefinition}}}))}else{const e=createDocumentSpanSet(r);for(const t of c){for(const n of t.references){if(n.isDefinition){e.add(n);break}}}const t=new Set;while(true){let n=false;s.forEach(((r,i)=>{if(t.has(i))return;const o=i.getLanguageService().updateIsDefinitionOfReferencedSymbols(r,e);if(o){t.add(i);n=true}}));if(!n)break}s.forEach(((e,n)=>{if(t.has(n))return;for(const t of e){for(const e of t.references){e.isDefinition=false}}}))}const l=[];const d=createDocumentSpanSet(r);s.forEach(((e,t)=>{for(const n of e){const e=getMappedLocationForProject(documentSpanLocation(n.definition),t);const i=e===void 0?n.definition:{...n.definition,textSpan:createTextSpan(e.pos,n.definition.textSpan.length),fileName:e.fileName,contextSpan:getMappedContextSpanForProject(n.definition,t)};let o=find(l,(e=>documentSpansEqual(e.definition,i,r)));if(!o){o={definition:i,references:[]};l.push(o)}for(const e of n.references){if(!d.has(e)&&!getMappedLocationForProject(documentSpanLocation(e),t)){d.add(e);o.references.push(e)}}}}));return l.filter((e=>e.references.length!==0))}function forEachProjectInProjects(e,t,n){for(const r of isArray(e)?e:e.projects){n(r,t)}if(!isArray(e)&&e.symLinkedProjects){e.symLinkedProjects.forEach(((e,t)=>{for(const r of e){n(r,t)}}))}}function getPerProjectReferences(e,t,n,r,i,o,a){const s=new Map;const c=createQueue();c.enqueue({project:t,location:n});forEachProjectInProjects(e,n.fileName,((e,t)=>{const r={fileName:t,pos:n.pos};c.enqueue({project:e,location:r})}));const l=t.projectService;const d=t.getCancellationToken();const p=memoize((()=>t.isSourceOfProjectReferenceRedirect(r.fileName)?r:t.getLanguageService().getSourceMapper().tryGetGeneratedPosition(r)));const u=memoize((()=>t.isSourceOfProjectReferenceRedirect(r.fileName)?r:t.getLanguageService().getSourceMapper().tryGetSourcePosition(r)));const f=new Set;e:while(!c.isEmpty()){while(!c.isEmpty()){if(d.isCancellationRequested())break e;const{project:e,location:t}=c.dequeue();if(s.has(e))continue;if(isLocationProjectReferenceRedirect(e,t))continue;updateProjectIfDirty(e);if(!e.containsFile(toNormalizedPath(t.fileName))){continue}const n=searchPosition(e,t);s.set(e,n??Hm);f.add(getProjectKey(e))}if(r){l.loadAncestorProjectTree(f);l.forEachEnabledProject((e=>{if(d.isCancellationRequested())return;if(s.has(e))return;const t=i(r,e,p,u);if(t){c.enqueue({project:e,location:t})}}))}}if(s.size===1){return firstIterator(s.values())}return s;function searchPosition(e,t){const n=o(e,t);if(!n||!a)return n;for(const t of n){a(t,(t=>{const n=l.getOriginalLocationEnsuringConfiguredProject(e,t);if(!n)return;const r=l.getScriptInfo(n.fileName);for(const e of r.containingProjects){if(!e.isOrphan()&&!s.has(e)){c.enqueue({project:e,location:n})}}const i=l.getSymlinkedProjects(r);if(i){i.forEach(((e,t)=>{for(const r of e){if(!r.isOrphan()&&!s.has(r)){c.enqueue({project:r,location:{fileName:t,pos:n.pos}})}}}))}}))}return n}}function mapDefinitionInProjectIfFileInProject(e,t){if(t.containsFile(toNormalizedPath(e.fileName))&&!isLocationProjectReferenceRedirect(t,e)){return e}}function mapDefinitionInProject(e,t,n,r){const i=mapDefinitionInProjectIfFileInProject(e,t);if(i)return i;const o=n();if(o&&t.containsFile(toNormalizedPath(o.fileName)))return o;const a=r();return a&&t.containsFile(toNormalizedPath(a.fileName))?a:void 0}function isLocationProjectReferenceRedirect(e,t){if(!t)return false;const n=e.getLanguageService().getProgram();if(!n)return false;const r=n.getSourceFile(t.fileName);return!!r&&r.resolvedPath!==r.path&&r.resolvedPath!==e.toPath(t.fileName)}function getProjectKey(e){return isConfiguredProject(e)?e.canonicalConfigFilePath:e.getProjectName()}function documentSpanLocation({fileName:e,textSpan:t}){return{fileName:e,pos:t.start}}function getMappedLocationForProject(e,t){return getMappedLocation(e,t.getSourceMapper(),(e=>t.projectService.fileExists(e)))}function getMappedDocumentSpanForProject(e,t){return getMappedDocumentSpan(e,t.getSourceMapper(),(e=>t.projectService.fileExists(e)))}function getMappedContextSpanForProject(e,t){return getMappedContextSpan(e,t.getSourceMapper(),(e=>t.projectService.fileExists(e)))}var H_=["openExternalProject","openExternalProjects","closeExternalProject","synchronizeProjectList","emit-output","compileOnSaveAffectedFileList","compileOnSaveEmitFile","compilerOptionsDiagnostics-full","encodedSemanticClassifications-full","semanticDiagnosticsSync","suggestionDiagnosticsSync","geterrForProject","reload","reloadProjects","getCodeFixes","getCodeFixes-full","getCombinedCodeFix","getCombinedCodeFix-full","applyCodeActionCommand","getSupportedCodeFixes","getApplicableRefactors","getMoveToRefactoringFileSuggestions","getEditsForRefactor","getEditsForRefactor-full","organizeImports","organizeImports-full","getEditsForFileRename","getEditsForFileRename-full","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","getPasteEdits","copilotRelated"];var G_=[...H_,"definition","definition-full","definitionAndBoundSpan","definitionAndBoundSpan-full","typeDefinition","implementation","implementation-full","references","references-full","rename","renameLocations-full","rename-full","quickinfo","quickinfo-full","completionInfo","completions","completions-full","completionEntryDetails","completionEntryDetails-full","signatureHelp","signatureHelp-full","navto","navto-full","documentHighlights","documentHighlights-full","preparePasteEdits"];var K_=class _Session{constructor(e){this.changeSeq=0;this.regionDiagLineCountThreshold=500;this.handlers=new Map(Object.entries({["status"]:()=>{const e={version:c};return this.requiredResponse(e)},["openExternalProject"]:e=>{this.projectService.openExternalProject(e.arguments,true);return this.requiredResponse(true)},["openExternalProjects"]:e=>{this.projectService.openExternalProjects(e.arguments.projects);return this.requiredResponse(true)},["closeExternalProject"]:e=>{this.projectService.closeExternalProject(e.arguments.projectFileName,true);return this.requiredResponse(true)},["synchronizeProjectList"]:e=>{const t=this.projectService.synchronizeProjectList(e.arguments.knownProjects,e.arguments.includeProjectReferenceRedirectInfo);if(!t.some((e=>e.projectErrors&&e.projectErrors.length!==0))){return this.requiredResponse(t)}const n=map(t,(e=>{if(!e.projectErrors||e.projectErrors.length===0){return e}return{info:e.info,changes:e.changes,files:e.files,projectErrors:this.convertToDiagnosticsWithLinePosition(e.projectErrors,void 0)}}));return this.requiredResponse(n)},["updateOpen"]:e=>{this.changeSeq++;this.projectService.applyChangesInOpenFiles(e.arguments.openFiles&&mapIterator(e.arguments.openFiles,(e=>({fileName:e.file,content:e.fileContent,scriptKind:e.scriptKindName,projectRootPath:e.projectRootPath}))),e.arguments.changedFiles&&mapIterator(e.arguments.changedFiles,(e=>({fileName:e.fileName,changes:mapDefinedIterator(arrayReverseIterator(e.textChanges),(t=>{const n=S.checkDefined(this.projectService.getScriptInfo(e.fileName));const r=n.lineOffsetToPosition(t.start.line,t.start.offset);const i=n.lineOffsetToPosition(t.end.line,t.end.offset);return r>=0?{span:{start:r,length:i-r},newText:t.newText}:void 0}))}))),e.arguments.closedFiles);return this.requiredResponse(true)},["applyChangedToOpenFiles"]:e=>{this.changeSeq++;this.projectService.applyChangesInOpenFiles(e.arguments.openFiles,e.arguments.changedFiles&&mapIterator(e.arguments.changedFiles,(e=>({fileName:e.fileName,changes:arrayReverseIterator(e.changes)}))),e.arguments.closedFiles);return this.requiredResponse(true)},["exit"]:()=>{this.exit();return this.notRequired(void 0)},["definition"]:e=>this.requiredResponse(this.getDefinition(e.arguments,true)),["definition-full"]:e=>this.requiredResponse(this.getDefinition(e.arguments,false)),["definitionAndBoundSpan"]:e=>this.requiredResponse(this.getDefinitionAndBoundSpan(e.arguments,true)),["definitionAndBoundSpan-full"]:e=>this.requiredResponse(this.getDefinitionAndBoundSpan(e.arguments,false)),["findSourceDefinition"]:e=>this.requiredResponse(this.findSourceDefinition(e.arguments)),["emit-output"]:e=>this.requiredResponse(this.getEmitOutput(e.arguments)),["typeDefinition"]:e=>this.requiredResponse(this.getTypeDefinition(e.arguments)),["implementation"]:e=>this.requiredResponse(this.getImplementation(e.arguments,true)),["implementation-full"]:e=>this.requiredResponse(this.getImplementation(e.arguments,false)),["references"]:e=>this.requiredResponse(this.getReferences(e.arguments,true)),["references-full"]:e=>this.requiredResponse(this.getReferences(e.arguments,false)),["rename"]:e=>this.requiredResponse(this.getRenameLocations(e.arguments,true)),["renameLocations-full"]:e=>this.requiredResponse(this.getRenameLocations(e.arguments,false)),["rename-full"]:e=>this.requiredResponse(this.getRenameInfo(e.arguments)),["open"]:e=>{this.openClientFile(toNormalizedPath(e.arguments.file),e.arguments.fileContent,convertScriptKindName(e.arguments.scriptKindName),e.arguments.projectRootPath?toNormalizedPath(e.arguments.projectRootPath):void 0);return this.notRequired(e)},["quickinfo"]:e=>this.requiredResponse(this.getQuickInfoWorker(e.arguments,true)),["quickinfo-full"]:e=>this.requiredResponse(this.getQuickInfoWorker(e.arguments,false)),["getOutliningSpans"]:e=>this.requiredResponse(this.getOutliningSpans(e.arguments,true)),["outliningSpans"]:e=>this.requiredResponse(this.getOutliningSpans(e.arguments,false)),["todoComments"]:e=>this.requiredResponse(this.getTodoComments(e.arguments)),["indentation"]:e=>this.requiredResponse(this.getIndentation(e.arguments)),["nameOrDottedNameSpan"]:e=>this.requiredResponse(this.getNameOrDottedNameSpan(e.arguments)),["breakpointStatement"]:e=>this.requiredResponse(this.getBreakpointStatement(e.arguments)),["braceCompletion"]:e=>this.requiredResponse(this.isValidBraceCompletion(e.arguments)),["docCommentTemplate"]:e=>this.requiredResponse(this.getDocCommentTemplate(e.arguments)),["getSpanOfEnclosingComment"]:e=>this.requiredResponse(this.getSpanOfEnclosingComment(e.arguments)),["fileReferences"]:e=>this.requiredResponse(this.getFileReferences(e.arguments,true)),["fileReferences-full"]:e=>this.requiredResponse(this.getFileReferences(e.arguments,false)),["format"]:e=>this.requiredResponse(this.getFormattingEditsForRange(e.arguments)),["formatonkey"]:e=>this.requiredResponse(this.getFormattingEditsAfterKeystroke(e.arguments)),["format-full"]:e=>this.requiredResponse(this.getFormattingEditsForDocumentFull(e.arguments)),["formatonkey-full"]:e=>this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(e.arguments)),["formatRange-full"]:e=>this.requiredResponse(this.getFormattingEditsForRangeFull(e.arguments)),["completionInfo"]:e=>this.requiredResponse(this.getCompletions(e.arguments,"completionInfo")),["completions"]:e=>this.requiredResponse(this.getCompletions(e.arguments,"completions")),["completions-full"]:e=>this.requiredResponse(this.getCompletions(e.arguments,"completions-full")),["completionEntryDetails"]:e=>this.requiredResponse(this.getCompletionEntryDetails(e.arguments,false)),["completionEntryDetails-full"]:e=>this.requiredResponse(this.getCompletionEntryDetails(e.arguments,true)),["compileOnSaveAffectedFileList"]:e=>this.requiredResponse(this.getCompileOnSaveAffectedFileList(e.arguments)),["compileOnSaveEmitFile"]:e=>this.requiredResponse(this.emitFile(e.arguments)),["signatureHelp"]:e=>this.requiredResponse(this.getSignatureHelpItems(e.arguments,true)),["signatureHelp-full"]:e=>this.requiredResponse(this.getSignatureHelpItems(e.arguments,false)),["compilerOptionsDiagnostics-full"]:e=>this.requiredResponse(this.getCompilerOptionsDiagnostics(e.arguments)),["encodedSyntacticClassifications-full"]:e=>this.requiredResponse(this.getEncodedSyntacticClassifications(e.arguments)),["encodedSemanticClassifications-full"]:e=>this.requiredResponse(this.getEncodedSemanticClassifications(e.arguments)),["cleanup"]:()=>{this.cleanup();return this.requiredResponse(true)},["semanticDiagnosticsSync"]:e=>this.requiredResponse(this.getSemanticDiagnosticsSync(e.arguments)),["syntacticDiagnosticsSync"]:e=>this.requiredResponse(this.getSyntacticDiagnosticsSync(e.arguments)),["suggestionDiagnosticsSync"]:e=>this.requiredResponse(this.getSuggestionDiagnosticsSync(e.arguments)),["geterr"]:e=>{this.errorCheck.startNew((t=>this.getDiagnostics(t,e.arguments.delay,e.arguments.files)));return this.notRequired(void 0)},["geterrForProject"]:e=>{this.errorCheck.startNew((t=>this.getDiagnosticsForProject(t,e.arguments.delay,e.arguments.file)));return this.notRequired(void 0)},["change"]:e=>{this.change(e.arguments);return this.notRequired(e)},["configure"]:e=>{this.projectService.setHostConfiguration(e.arguments);return this.notRequired(e)},["reload"]:e=>{this.reload(e.arguments);return this.requiredResponse({reloadFinished:true})},["saveto"]:e=>{const t=e.arguments;this.saveToTmp(t.file,t.tmpfile);return this.notRequired(e)},["close"]:e=>{const t=e.arguments;this.closeClientFile(t.file);return this.notRequired(e)},["navto"]:e=>this.requiredResponse(this.getNavigateToItems(e.arguments,true)),["navto-full"]:e=>this.requiredResponse(this.getNavigateToItems(e.arguments,false)),["brace"]:e=>this.requiredResponse(this.getBraceMatching(e.arguments,true)),["brace-full"]:e=>this.requiredResponse(this.getBraceMatching(e.arguments,false)),["navbar"]:e=>this.requiredResponse(this.getNavigationBarItems(e.arguments,true)),["navbar-full"]:e=>this.requiredResponse(this.getNavigationBarItems(e.arguments,false)),["navtree"]:e=>this.requiredResponse(this.getNavigationTree(e.arguments,true)),["navtree-full"]:e=>this.requiredResponse(this.getNavigationTree(e.arguments,false)),["documentHighlights"]:e=>this.requiredResponse(this.getDocumentHighlights(e.arguments,true)),["documentHighlights-full"]:e=>this.requiredResponse(this.getDocumentHighlights(e.arguments,false)),["compilerOptionsForInferredProjects"]:e=>{this.setCompilerOptionsForInferredProjects(e.arguments);return this.requiredResponse(true)},["projectInfo"]:e=>this.requiredResponse(this.getProjectInfo(e.arguments)),["reloadProjects"]:e=>{this.projectService.reloadProjects();return this.notRequired(e)},["jsxClosingTag"]:e=>this.requiredResponse(this.getJsxClosingTag(e.arguments)),["linkedEditingRange"]:e=>this.requiredResponse(this.getLinkedEditingRange(e.arguments)),["getCodeFixes"]:e=>this.requiredResponse(this.getCodeFixes(e.arguments,true)),["getCodeFixes-full"]:e=>this.requiredResponse(this.getCodeFixes(e.arguments,false)),["getCombinedCodeFix"]:e=>this.requiredResponse(this.getCombinedCodeFix(e.arguments,true)),["getCombinedCodeFix-full"]:e=>this.requiredResponse(this.getCombinedCodeFix(e.arguments,false)),["applyCodeActionCommand"]:e=>this.requiredResponse(this.applyCodeActionCommand(e.arguments)),["getSupportedCodeFixes"]:e=>this.requiredResponse(this.getSupportedCodeFixes(e.arguments)),["getApplicableRefactors"]:e=>this.requiredResponse(this.getApplicableRefactors(e.arguments)),["getEditsForRefactor"]:e=>this.requiredResponse(this.getEditsForRefactor(e.arguments,true)),["getMoveToRefactoringFileSuggestions"]:e=>this.requiredResponse(this.getMoveToRefactoringFileSuggestions(e.arguments)),["preparePasteEdits"]:e=>this.requiredResponse(this.preparePasteEdits(e.arguments)),["getPasteEdits"]:e=>this.requiredResponse(this.getPasteEdits(e.arguments)),["getEditsForRefactor-full"]:e=>this.requiredResponse(this.getEditsForRefactor(e.arguments,false)),["organizeImports"]:e=>this.requiredResponse(this.organizeImports(e.arguments,true)),["organizeImports-full"]:e=>this.requiredResponse(this.organizeImports(e.arguments,false)),["getEditsForFileRename"]:e=>this.requiredResponse(this.getEditsForFileRename(e.arguments,true)),["getEditsForFileRename-full"]:e=>this.requiredResponse(this.getEditsForFileRename(e.arguments,false)),["configurePlugin"]:e=>{this.configurePlugin(e.arguments);return this.notRequired(e)},["selectionRange"]:e=>this.requiredResponse(this.getSmartSelectionRange(e.arguments,true)),["selectionRange-full"]:e=>this.requiredResponse(this.getSmartSelectionRange(e.arguments,false)),["prepareCallHierarchy"]:e=>this.requiredResponse(this.prepareCallHierarchy(e.arguments)),["provideCallHierarchyIncomingCalls"]:e=>this.requiredResponse(this.provideCallHierarchyIncomingCalls(e.arguments)),["provideCallHierarchyOutgoingCalls"]:e=>this.requiredResponse(this.provideCallHierarchyOutgoingCalls(e.arguments)),["toggleLineComment"]:e=>this.requiredResponse(this.toggleLineComment(e.arguments,true)),["toggleLineComment-full"]:e=>this.requiredResponse(this.toggleLineComment(e.arguments,false)),["toggleMultilineComment"]:e=>this.requiredResponse(this.toggleMultilineComment(e.arguments,true)),["toggleMultilineComment-full"]:e=>this.requiredResponse(this.toggleMultilineComment(e.arguments,false)),["commentSelection"]:e=>this.requiredResponse(this.commentSelection(e.arguments,true)),["commentSelection-full"]:e=>this.requiredResponse(this.commentSelection(e.arguments,false)),["uncommentSelection"]:e=>this.requiredResponse(this.uncommentSelection(e.arguments,true)),["uncommentSelection-full"]:e=>this.requiredResponse(this.uncommentSelection(e.arguments,false)),["provideInlayHints"]:e=>this.requiredResponse(this.provideInlayHints(e.arguments)),["mapCode"]:e=>this.requiredResponse(this.mapCode(e.arguments)),["copilotRelated"]:()=>this.requiredResponse(this.getCopilotRelatedInfo())}));this.host=e.host;this.cancellationToken=e.cancellationToken;this.typingsInstaller=e.typingsInstaller||B_;this.byteLength=e.byteLength;this.hrtime=e.hrtime;this.logger=e.logger;this.canUseEvents=e.canUseEvents;this.suppressDiagnosticEvents=e.suppressDiagnosticEvents;this.noGetErrOnBackgroundUpdate=e.noGetErrOnBackgroundUpdate;const{throttleWaitMilliseconds:t}=e;this.eventHandler=this.canUseEvents?e.eventHandler||(e=>this.defaultEventHandler(e)):void 0;const n={executeWithRequestId:(e,t,n)=>this.executeWithRequestId(e,t,n),getCurrentRequestId:()=>this.currentRequestId,getPerformanceData:()=>this.performanceData,getServerHost:()=>this.host,logError:(e,t)=>this.logError(e,t),sendRequestCompletedEvent:(e,t)=>this.sendRequestCompletedEvent(e,t),isCancellationRequested:()=>this.cancellationToken.isCancellationRequested()};this.errorCheck=new q_(n);const r={host:this.host,logger:this.logger,cancellationToken:this.cancellationToken,useSingleInferredProject:e.useSingleInferredProject,useInferredProjectPerProjectRoot:e.useInferredProjectPerProjectRoot,typingsInstaller:this.typingsInstaller,throttleWaitMilliseconds:t,eventHandler:this.eventHandler,suppressDiagnosticEvents:this.suppressDiagnosticEvents,globalPlugins:e.globalPlugins,pluginProbeLocations:e.pluginProbeLocations,allowLocalPluginLoads:e.allowLocalPluginLoads,typesMapLocation:e.typesMapLocation,serverMode:e.serverMode,session:this,canUseWatchEvents:e.canUseWatchEvents,incrementalVerifier:e.incrementalVerifier};this.projectService=new U_(r);this.projectService.setPerformanceEventHandler(this.performanceEventHandler.bind(this));this.gcTimer=new Qm(this.host,7e3,this.logger);switch(this.projectService.serverMode){case 0:break;case 1:H_.forEach((e=>this.handlers.set(e,(e=>{throw new Error(`Request: ${e.command} not allowed in LanguageServiceMode.PartialSemantic`)}))));break;case 2:G_.forEach((e=>this.handlers.set(e,(e=>{throw new Error(`Request: ${e.command} not allowed in LanguageServiceMode.Syntactic`)}))));break;default:S.assertNever(this.projectService.serverMode)}}sendRequestCompletedEvent(e,t){this.event({request_seq:e,performanceData:t&&toProtocolPerformanceData(t)},"requestCompleted")}addPerformanceData(e,t){if(!this.performanceData){this.performanceData={}}this.performanceData[e]=(this.performanceData[e]??0)+t}addDiagnosticsPerformanceData(e,t,n){var r,i;if(!this.performanceData){this.performanceData={}}let o=(r=this.performanceData.diagnosticsDuration)==null?void 0:r.get(e);if(!o)((i=this.performanceData).diagnosticsDuration??(i.diagnosticsDuration=new Map)).set(e,o={});o[t]=n}performanceEventHandler(e){switch(e.kind){case"UpdateGraph":this.addPerformanceData("updateGraphDurationMs",e.durationMs);break;case"CreatePackageJsonAutoImportProvider":this.addPerformanceData("createAutoImportProviderProgramDurationMs",e.durationMs);break}}defaultEventHandler(e){switch(e.eventName){case S_:this.projectsUpdatedInBackgroundEvent(e.data.openFiles);break;case v_:this.event({projectName:e.data.project.getProjectName(),reason:e.data.reason},e.eventName);break;case x_:this.event({projectName:e.data.project.getProjectName()},e.eventName);break;case b_:case F_:case P_:case D_:this.event(e.data,e.eventName);break;case C_:this.event({triggerFile:e.data.triggerFile,configFile:e.data.configFileName,diagnostics:map(e.data.diagnostics,(e=>formatDiagnosticToProtocol(e,true)))},e.eventName);break;case E_:{this.event({projectName:e.data.project.getProjectName(),languageServiceEnabled:e.data.languageServiceEnabled},e.eventName);break}case N_:{const t="telemetry";this.event({telemetryEventName:e.eventName,payload:e.data},t);break}}}projectsUpdatedInBackgroundEvent(e){this.projectService.logger.info(`got projects updated in background ${e}`);if(e.length){if(!this.suppressDiagnosticEvents&&!this.noGetErrOnBackgroundUpdate){this.projectService.logger.info(`Queueing diagnostics update for ${e}`);this.errorCheck.startNew((t=>this.updateErrorCheck(t,e,100,true)))}this.event({openFiles:e},S_)}}logError(e,t){this.logErrorWorker(e,t)}logErrorWorker(e,t,n){let r="Exception on executing command "+t;if(e.message){r+=":\n"+indent2(e.message);if(e.stack){r+="\n"+indent2(e.stack)}}if(this.logger.hasLevel(3)){if(n){try{const{file:e,project:t}=this.getFileAndProject(n);const i=t.getScriptInfoForNormalizedPath(e);if(i){const e=getSnapshotText(i.getSnapshot());r+=`\n\nFile text of ${n.file}:${indent2(e)}\n`}}catch{}}if(e.ProgramFiles){r+=`\n\nProgram files: ${JSON.stringify(e.ProgramFiles)}\n`;r+=`\n\nProjects::\n`;let t=0;const addProjectInfo=e=>{r+=`\nProject '${e.projectName}' (${d_[e.projectKind]}) ${t}\n`;r+=e.filesToString(true);r+="\n-----------------------------------------------\n";t++};this.projectService.externalProjects.forEach(addProjectInfo);this.projectService.configuredProjects.forEach(addProjectInfo);this.projectService.inferredProjects.forEach(addProjectInfo)}}this.logger.msg(r,"Err")}send(e){if(e.type==="event"&&!this.canUseEvents){if(this.logger.hasLevel(3)){this.logger.info(`Session does not support events: ignored event: ${stringifyIndented(e)}`)}return}this.writeMessage(e)}writeMessage(e){const t=formatMessage2(e,this.logger,this.byteLength,this.host.newLine);this.host.write(t)}event(e,t){this.send(toEvent(t,e))}doOutput(e,t,n,r,i,o){const a={seq:0,type:"response",command:t,request_seq:n,success:r,performanceData:i&&toProtocolPerformanceData(i)};if(r){let t;if(isArray(e)){a.body=e;t=e.metadata;delete e.metadata}else if(typeof e==="object"){if(e.metadata){const{metadata:n,...r}=e;a.body=r;t=n}else{a.body=e}}else{a.body=e}if(t)a.metadata=t}else{S.assert(e===void 0)}if(o){a.message=o}this.send(a)}semanticCheck(e,t){var n,r;const i=R();(n=G)==null?void 0:n.push(G.Phase.Session,"semanticCheck",{file:e,configFilePath:t.canonicalConfigFilePath});const o=isDeclarationFileInJSOnlyNonConfiguredProject(t,e)?Hm:t.getLanguageService().getSemanticDiagnostics(e).filter((e=>!!e.file));this.sendDiagnosticsEvent(e,t,o,"semanticDiag",i);(r=G)==null?void 0:r.pop()}syntacticCheck(e,t){var n,r;const i=R();(n=G)==null?void 0:n.push(G.Phase.Session,"syntacticCheck",{file:e,configFilePath:t.canonicalConfigFilePath});this.sendDiagnosticsEvent(e,t,t.getLanguageService().getSyntacticDiagnostics(e),"syntaxDiag",i);(r=G)==null?void 0:r.pop()}suggestionCheck(e,t){var n,r;const i=R();(n=G)==null?void 0:n.push(G.Phase.Session,"suggestionCheck",{file:e,configFilePath:t.canonicalConfigFilePath});this.sendDiagnosticsEvent(e,t,t.getLanguageService().getSuggestionDiagnostics(e),"suggestionDiag",i);(r=G)==null?void 0:r.pop()}regionSemanticCheck(e,t,n){var r,i,o;const a=R();(r=G)==null?void 0:r.push(G.Phase.Session,"regionSemanticCheck",{file:e,configFilePath:t.canonicalConfigFilePath});let s;if(!this.shouldDoRegionCheck(e)||!(s=t.getLanguageService().getRegionSemanticDiagnostics(e,n))){(i=G)==null?void 0:i.pop();return}this.sendDiagnosticsEvent(e,t,s.diagnostics,"regionSemanticDiag",a,s.spans);(o=G)==null?void 0:o.pop();return}shouldDoRegionCheck(e){var t;const n=(t=this.projectService.getScriptInfoForNormalizedPath(e))==null?void 0:t.textStorage.getLineInfo().getLineCount();return!!(n&&n>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(e,t,n,r,i,o){try{const a=S.checkDefined(t.getScriptInfo(e));const s=R()-i;const c={file:e,diagnostics:n.map((n=>formatDiag(e,t,n))),spans:o==null?void 0:o.map((e=>toProtocolTextSpan(e,a)))};this.event(c,r);this.addDiagnosticsPerformanceData(e,r,s)}catch(e){this.logError(e,r)}}updateErrorCheck(e,t,n,r=true){if(t.length===0){return}S.assert(!this.suppressDiagnosticEvents);const i=this.changeSeq;const o=Math.min(n,200);let a=0;const goNext=()=>{a++;if(t.length>a){return e.delay("checkOne",o,checkOne)}};const doSemanticCheck=(t,n)=>{this.semanticCheck(t,n);if(this.changeSeq!==i){return}if(this.getPreferences(t).disableSuggestions){return goNext()}e.immediate("suggestionCheck",(()=>{this.suggestionCheck(t,n);goNext()}))};const checkOne=()=>{if(this.changeSeq!==i){return}let n;let o=t[a];if(isString(o)){o=this.toPendingErrorCheck(o)}else if("ranges"in o){n=o.ranges;o=this.toPendingErrorCheck(o.file)}if(!o){return goNext()}const{fileName:s,project:c}=o;updateProjectIfDirty(c);if(!c.containsFile(s,r)){return}this.syntacticCheck(s,c);if(this.changeSeq!==i){return}if(c.projectService.serverMode!==0){return goNext()}if(n){return e.immediate("regionSemanticCheck",(()=>{const t=this.projectService.getScriptInfoForNormalizedPath(s);if(t){this.regionSemanticCheck(s,c,n.map((e=>this.getRange({file:s,...e},t))))}if(this.changeSeq!==i){return}e.immediate("semanticCheck",(()=>doSemanticCheck(s,c)))}))}e.immediate("semanticCheck",(()=>doSemanticCheck(s,c)))};if(t.length>a&&this.changeSeq===i){e.delay("checkOne",n,checkOne)}}cleanProjects(e,t){if(!t){return}this.logger.info(`cleaning ${e}`);for(const e of t){e.getLanguageService(false).cleanupSemanticCache();e.cleanupProgram()}}cleanup(){this.cleanProjects("inferred projects",this.projectService.inferredProjects);this.cleanProjects("configured projects",arrayFrom(this.projectService.configuredProjects.values()));this.cleanProjects("external projects",this.projectService.externalProjects);if(this.host.gc){this.logger.info(`host.gc()`);this.host.gc()}}getEncodedSyntacticClassifications(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);return n.getEncodedSyntacticClassifications(t,e)}getEncodedSemanticClassifications(e){const{file:t,project:n}=this.getFileAndProject(e);const r=e.format==="2020"?"2020":"original";return n.getLanguageService().getEncodedSemanticClassifications(t,e,r)}getProject(e){return e===void 0?void 0:this.projectService.findProject(e)}getConfigFileAndProject(e){const t=this.getProject(e.projectFileName);const n=toNormalizedPath(e.file);return{configFile:t&&t.hasConfigFile(n)?n:void 0,project:t}}getConfigFileDiagnostics(e,t,n){const r=t.getAllProjectErrors();const i=t.getLanguageService().getCompilerOptionsDiagnostics();const o=filter(concatenate(r,i),(t=>!!t.file&&t.file.fileName===e));return n?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(o):map(o,(e=>formatDiagnosticToProtocol(e,false)))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(e){return e.map((e=>({message:flattenDiagnosticMessageText(e.messageText,this.host.newLine),start:e.start,length:e.length,category:diagnosticCategoryName(e),code:e.code,source:e.source,startLocation:e.file&&convertToLocation(getLineAndCharacterOfPosition(e.file,e.start)),endLocation:e.file&&convertToLocation(getLineAndCharacterOfPosition(e.file,e.start+e.length)),reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated,relatedInformation:map(e.relatedInformation,formatRelatedInformation)})))}getCompilerOptionsDiagnostics(e){const t=this.getProject(e.projectFileName);return this.convertToDiagnosticsWithLinePosition(filter(t.getLanguageService().getCompilerOptionsDiagnostics(),(e=>!e.file)),void 0)}convertToDiagnosticsWithLinePosition(e,t){return e.map((e=>({message:flattenDiagnosticMessageText(e.messageText,this.host.newLine),start:e.start,length:e.length,category:diagnosticCategoryName(e),code:e.code,source:e.source,startLocation:t&&t.positionToLineOffset(e.start),endLocation:t&&t.positionToLineOffset(e.start+e.length),reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated,relatedInformation:map(e.relatedInformation,formatRelatedInformation)})))}getDiagnosticsWorker(e,t,n,r){const{project:i,file:o}=this.getFileAndProject(e);if(t&&isDeclarationFileInJSOnlyNonConfiguredProject(i,o)){return Hm}const a=i.getScriptInfoForNormalizedPath(o);const s=n(i,o);return r?this.convertToDiagnosticsWithLinePosition(s,a):s.map((e=>formatDiag(o,i,e)))}getDefinition(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=this.getPositionInFile(e,n);const o=this.mapDefinitionInfoLocations(r.getLanguageService().getDefinitionAtPosition(n,i)||Hm,r);return t?this.mapDefinitionInfo(o,r):o.map(_Session.mapToOriginalLocation)}mapDefinitionInfoLocations(e,t){return e.map((e=>{const n=getMappedDocumentSpanForProject(e,t);return!n?e:{...n,containerKind:e.containerKind,containerName:e.containerName,kind:e.kind,name:e.name,failedAliasResolution:e.failedAliasResolution,...e.unverified&&{unverified:e.unverified}}}))}getDefinitionAndBoundSpan(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=this.getPositionInFile(e,n);const o=S.checkDefined(r.getScriptInfo(n));const a=r.getLanguageService().getDefinitionAndBoundSpan(n,i);if(!a||!a.definitions){return{definitions:Hm,textSpan:void 0}}const s=this.mapDefinitionInfoLocations(a.definitions,r);const{textSpan:c}=a;if(t){return{definitions:this.mapDefinitionInfo(s,r),textSpan:toProtocolTextSpan(c,o)}}return{definitions:s.map(_Session.mapToOriginalLocation),textSpan:c}}findSourceDefinition(e){var t;const{file:n,project:r}=this.getFileAndProject(e);const i=this.getPositionInFile(e,n);const o=r.getLanguageService().getDefinitionAtPosition(n,i);let a=this.mapDefinitionInfoLocations(o||Hm,r).slice();const s=this.projectService.serverMode===0&&(!some(a,(e=>toNormalizedPath(e.fileName)!==n&&!e.isAmbient))||some(a,(e=>!!e.failedAliasResolution)));if(s){const e=createSet((e=>e.textSpan.start),getDocumentSpansEqualityComparer(this.host.useCaseSensitiveFileNames));a==null?void 0:a.forEach((t=>e.add(t)));const o=r.getNoDtsResolutionProject(n);const s=o.getLanguageService();const c=(t=s.getDefinitionAtPosition(n,i,true,false))==null?void 0:t.filter((e=>toNormalizedPath(e.fileName)!==n));if(some(c)){for(const t of c){if(t.unverified){const n=tryRefineDefinition(t,r.getLanguageService().getProgram(),s.getProgram());if(some(n)){for(const t of n){e.add(t)}continue}}e.add(t)}}else{const t=a.filter((e=>toNormalizedPath(e.fileName)!==n&&e.isAmbient));for(const r of some(t)?t:getAmbientCandidatesByClimbingAccessChain()){const t=findImplementationFileFromDtsFileName(r.fileName,n,o);if(!t)continue;const i=this.projectService.getOrCreateScriptInfoNotOpenedByClient(t,o.currentDirectory,o.directoryStructureHost,false);if(!i)continue;if(!o.containsScriptInfo(i)){o.addRoot(i);o.updateGraph()}const a=s.getProgram();const c=S.checkDefined(a.getSourceFile(t));for(const t of searchForDeclaration(r.name,c,a)){e.add(t)}}}a=arrayFrom(e.values())}a=a.filter((e=>!e.isAmbient&&!e.failedAliasResolution));return this.mapDefinitionInfo(a,r);function findImplementationFileFromDtsFileName(e,t,n){var i,o,a;const s=getNodeModulePathParts(e);if(s&&e.lastIndexOf(Wo)===s.topLevelNodeModulesIndex){const c=e.substring(0,s.packageRootIndex);const l=(i=r.getModuleResolutionCache())==null?void 0:i.getPackageJsonInfoCache();const d=r.getCompilationSettings();const p=getPackageScopeForPath(getNormalizedAbsolutePath(c,r.getCurrentDirectory()),getTemporaryModuleResolutionState(l,r,d));if(!p)return void 0;const u=getEntrypointsFromPackageJsonInfo(p,{moduleResolution:2},r,r.getModuleResolutionCache());const f=e.substring(s.topLevelPackageNameIndex+1,s.packageRootIndex);const m=getPackageNameFromTypesPackageName(unmangleScopedPackageName(f));const _=r.toPath(e);if(u&&some(u,(e=>r.toPath(e)===_))){return(o=n.resolutionCache.resolveSingleModuleNameWithoutWatching(m,t).resolvedModule)==null?void 0:o.resolvedFileName}else{const r=e.substring(s.packageRootIndex+1);const i=`${m}/${removeFileExtension(r)}`;return(a=n.resolutionCache.resolveSingleModuleNameWithoutWatching(i,t).resolvedModule)==null?void 0:a.resolvedFileName}}return void 0}function getAmbientCandidatesByClimbingAccessChain(){const e=r.getLanguageService();const t=e.getProgram();const o=getTouchingPropertyName(t.getSourceFile(n),i);if((isStringLiteralLike(o)||isIdentifier(o))&&isAccessExpression(o.parent)){return forEachNameInAccessChainWalkingLeft(o,(t=>{var r;if(t===o)return void 0;const i=(r=e.getDefinitionAtPosition(n,t.getStart(),true,false))==null?void 0:r.filter((e=>toNormalizedPath(e.fileName)!==n&&e.isAmbient)).map((e=>({fileName:e.fileName,name:getTextOfIdentifierOrLiteral(o)})));if(some(i)){return i}}))||Hm}return Hm}function tryRefineDefinition(e,t,r){var o;const a=r.getSourceFile(e.fileName);if(!a){return void 0}const s=getTouchingPropertyName(t.getSourceFile(n),i);const c=t.getTypeChecker().getSymbolAtLocation(s);const l=c&&getDeclarationOfKind(c,276);if(!l)return void 0;const d=((o=l.propertyName)==null?void 0:o.text)||l.name.text;return searchForDeclaration(d,a,r)}function searchForDeclaration(e,t,n){const r=Rf.Core.getTopMostDeclarationNamesInFile(e,t);return mapDefined(r,(e=>{const t=n.getTypeChecker().getSymbolAtLocation(e);const r=getDeclarationFromName(e);if(t&&r){return Vf.createDefinitionInfo(r,n.getTypeChecker(),t,r,true)}}))}}getEmitOutput(e){const{file:t,project:n}=this.getFileAndProject(e);if(!n.shouldEmitFile(n.getScriptInfo(t))){return{emitSkipped:true,outputFiles:[],diagnostics:[]}}const r=n.getLanguageService().getEmitOutput(t);return e.richResponse?{...r,diagnostics:e.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(r.diagnostics):r.diagnostics.map((e=>formatDiagnosticToProtocol(e,true)))}:r}mapJSDocTagInfo(e,t,n){return e?e.map((e=>{var r;return{...e,text:n?this.mapDisplayParts(e.text,t):(r=e.text)==null?void 0:r.map((e=>e.text)).join("")}})):[]}mapDisplayParts(e,t){if(!e){return[]}return e.map((e=>e.kind!=="linkName"?e:{...e,target:this.toFileSpan(e.target.fileName,e.target.textSpan,t)}))}mapSignatureHelpItems(e,t,n){return e.map((e=>({...e,documentation:this.mapDisplayParts(e.documentation,t),parameters:e.parameters.map((e=>({...e,documentation:this.mapDisplayParts(e.documentation,t)}))),tags:this.mapJSDocTagInfo(e.tags,t,n)})))}mapDefinitionInfo(e,t){return e.map((e=>({...this.toFileSpanWithContext(e.fileName,e.textSpan,e.contextSpan,t),...e.unverified&&{unverified:e.unverified}})))}static mapToOriginalLocation(e){if(e.originalFileName){S.assert(e.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is");return{...e,fileName:e.originalFileName,textSpan:e.originalTextSpan,targetFileName:e.fileName,targetTextSpan:e.textSpan,contextSpan:e.originalContextSpan,targetContextSpan:e.contextSpan}}return e}toFileSpan(e,t,n){const r=n.getLanguageService();const i=r.toLineColumnOffset(e,t.start);const o=r.toLineColumnOffset(e,textSpanEnd(t));return{file:e,start:{line:i.line+1,offset:i.character+1},end:{line:o.line+1,offset:o.character+1}}}toFileSpanWithContext(e,t,n,r){const i=this.toFileSpan(e,t,r);const o=n&&this.toFileSpan(e,n,r);return o?{...i,contextStart:o.start,contextEnd:o.end}:i}getTypeDefinition(e){const{file:t,project:n}=this.getFileAndProject(e);const r=this.getPositionInFile(e,t);const i=this.mapDefinitionInfoLocations(n.getLanguageService().getTypeDefinitionAtPosition(t,r)||Hm,n);return this.mapDefinitionInfo(i,n)}mapImplementationLocations(e,t){return e.map((e=>{const n=getMappedDocumentSpanForProject(e,t);return!n?e:{...n,kind:e.kind,displayParts:e.displayParts}}))}getImplementation(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=this.getPositionInFile(e,n);const o=this.mapImplementationLocations(r.getLanguageService().getImplementationAtPosition(n,i)||Hm,r);return t?o.map((({fileName:e,textSpan:t,contextSpan:n})=>this.toFileSpanWithContext(e,t,n,r))):o.map(_Session.mapToOriginalLocation)}getSyntacticDiagnosticsSync(e){const{configFile:t}=this.getConfigFileAndProject(e);if(t){return Hm}return this.getDiagnosticsWorker(e,false,((e,t)=>e.getLanguageService().getSyntacticDiagnostics(t)),!!e.includeLinePosition)}getSemanticDiagnosticsSync(e){const{configFile:t,project:n}=this.getConfigFileAndProject(e);if(t){return this.getConfigFileDiagnostics(t,n,!!e.includeLinePosition)}return this.getDiagnosticsWorker(e,true,((e,t)=>e.getLanguageService().getSemanticDiagnostics(t).filter((e=>!!e.file))),!!e.includeLinePosition)}getSuggestionDiagnosticsSync(e){const{configFile:t}=this.getConfigFileAndProject(e);if(t){return Hm}return this.getDiagnosticsWorker(e,true,((e,t)=>e.getLanguageService().getSuggestionDiagnostics(t)),!!e.includeLinePosition)}getJsxClosingTag(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=this.getPositionInFile(e,t);const i=n.getJsxClosingTagAtPosition(t,r);return i===void 0?void 0:{newText:i.newText,caretOffset:0}}getLinkedEditingRange(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=this.getPositionInFile(e,t);const i=n.getLinkedEditingRangeAtPosition(t,r);const o=this.projectService.getScriptInfoForNormalizedPath(t);if(o===void 0||i===void 0)return void 0;return convertLinkedEditInfoToRanges(i,o)}getDocumentHighlights(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=this.getPositionInFile(e,n);const o=r.getLanguageService().getDocumentHighlights(n,i,e.filesToSearch);if(!o)return Hm;if(!t)return o;return o.map((({fileName:e,highlightSpans:t})=>{const n=r.getScriptInfo(e);return{file:e,highlightSpans:t.map((({textSpan:e,kind:t,contextSpan:r})=>({...toProtocolTextSpanWithContext(e,r,n),kind:t})))}}))}provideInlayHints(e){const{file:t,project:n}=this.getFileAndProject(e);const r=this.projectService.getScriptInfoForNormalizedPath(t);const i=n.getLanguageService().provideInlayHints(t,e,this.getPreferences(t));return i.map((e=>{const{position:t,displayParts:n}=e;return{...e,position:r.positionToLineOffset(t),displayParts:n==null?void 0:n.map((({text:e,span:t,file:n})=>{if(t){S.assertIsDefined(n,"Target file should be defined together with its span.");const r=this.projectService.getScriptInfo(n);return{text:e,span:{start:r.positionToLineOffset(t.start),end:r.positionToLineOffset(t.start+t.length),file:n}}}else{return{text:e}}}))}}))}mapCode(e){var t;const n=this.getHostFormatOptions();const r=this.getHostPreferences();const{file:i,languageService:o}=this.getFileAndLanguageServiceForSyntacticOperation(e);const a=this.projectService.getScriptInfoForNormalizedPath(i);const s=(t=e.mapping.focusLocations)==null?void 0:t.map((e=>e.map((e=>{const t=a.lineOffsetToPosition(e.start.line,e.start.offset);const n=a.lineOffsetToPosition(e.end.line,e.end.offset);return{start:t,length:n-t}}))));const c=o.mapCode(i,e.mapping.contents,s,n,r);return this.mapTextChangesToCodeEdits(c)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects(e){this.projectService.setCompilerOptionsForInferredProjects(e.options,e.projectRootPath)}getProjectInfo(e){return this.getProjectInfoWorker(e.file,e.projectFileName,e.needFileNameList,e.needDefaultConfiguredProjectInfo,false)}getProjectInfoWorker(e,t,n,r,i){const{project:o}=this.getFileAndProjectWorker(e,t);updateProjectIfDirty(o);const a={configFileName:o.getProjectName(),languageServiceDisabled:!o.languageServiceEnabled,fileNames:n?o.getFileNames(false,i):void 0,configuredProjectInfo:r?this.getDefaultConfiguredProjectInfo(e):void 0};return a}getDefaultConfiguredProjectInfo(e){var t;const n=this.projectService.getScriptInfo(e);if(!n)return;const r=this.projectService.findDefaultConfiguredProjectWorker(n,3);if(!r)return void 0;let i;let o;r.seenProjects.forEach(((e,t)=>{if(t!==r.defaultProject){if(e!==3){(i??(i=[])).push(toNormalizedPath(t.getConfigFilePath()))}else{(o??(o=[])).push(toNormalizedPath(t.getConfigFilePath()))}}}));(t=r.seenConfigs)==null?void 0:t.forEach((e=>(i??(i=[])).push(e)));return{notMatchedByConfig:i,notInProject:o,defaultProject:r.defaultProject&&toNormalizedPath(r.defaultProject.getConfigFilePath())}}getRenameInfo(e){const{file:t,project:n}=this.getFileAndProject(e);const r=this.getPositionInFile(e,t);const i=this.getPreferences(t);return n.getLanguageService().getRenameInfo(t,r,i)}getProjects(e,t,n){let r;let i;if(e.projectFileName){const t=this.getProject(e.projectFileName);if(t){r=[t]}}else{const o=t?this.projectService.getScriptInfoEnsuringProjectsUptoDate(e.file):this.projectService.getScriptInfo(e.file);if(!o){if(n)return Hm;this.projectService.logErrorForScriptInfoNotFound(e.file);return Km.ThrowNoProject()}else if(!t){this.projectService.ensureDefaultProjectForFile(o)}r=o.containingProjects;i=this.projectService.getSymlinkedProjects(o)}r=filter(r,(e=>e.languageServiceEnabled&&!e.isOrphan()));if(!n&&(!r||!r.length)&&!i){this.projectService.logErrorForScriptInfoNotFound(e.file??e.projectFileName);return Km.ThrowNoProject()}return i?{projects:r,symLinkedProjects:i}:r}getDefaultProject(e){if(e.projectFileName){const t=this.getProject(e.projectFileName);if(t){return t}if(!e.file){return Km.ThrowNoProject()}}const t=this.projectService.getScriptInfo(e.file);return t.getDefaultProject()}getRenameLocations(e,t){const n=toNormalizedPath(e.file);const r=this.getPositionInFile(e,n);const i=this.getProjects(e);const o=this.getDefaultProject(e);const a=this.getPreferences(n);const s=this.mapRenameInfo(o.getLanguageService().getRenameInfo(n,r,a),S.checkDefined(this.projectService.getScriptInfo(n)));if(!s.canRename)return t?{info:s,locs:[]}:[];const c=getRenameLocationsWorker(i,o,{fileName:e.file,pos:r},!!e.findInStrings,!!e.findInComments,a,this.host.useCaseSensitiveFileNames);if(!t)return c;return{info:s,locs:this.toSpanGroups(c)}}mapRenameInfo(e,t){if(e.canRename){const{canRename:n,fileToRename:r,displayName:i,fullDisplayName:o,kind:a,kindModifiers:s,triggerSpan:c}=e;return identity({canRename:n,fileToRename:r,displayName:i,fullDisplayName:o,kind:a,kindModifiers:s,triggerSpan:toProtocolTextSpan(c,t)})}else{return e}}toSpanGroups(e){const t=new Map;for(const{fileName:n,textSpan:r,contextSpan:i,originalContextSpan:o,originalTextSpan:a,originalFileName:s,...c}of e){let e=t.get(n);if(!e)t.set(n,e={file:n,locs:[]});const o=S.checkDefined(this.projectService.getScriptInfo(n));e.locs.push({...toProtocolTextSpanWithContext(r,i,o),...c})}return arrayFrom(t.values())}getReferences(e,t){const n=toNormalizedPath(e.file);const r=this.getProjects(e);const i=this.getPositionInFile(e,n);const o=getReferencesWorker(r,this.getDefaultProject(e),{fileName:e.file,pos:i},this.host.useCaseSensitiveFileNames,this.logger);if(!t)return o;const a=this.getPreferences(n);const s=this.getDefaultProject(e);const c=s.getScriptInfoForNormalizedPath(n);const l=s.getLanguageService().getQuickInfoAtPosition(n,i);const d=l?displayPartsToString(l.displayParts):"";const p=l&&l.textSpan;const u=p?c.positionToLineOffset(p.start).offset:0;const f=p?c.getSnapshot().getText(p.start,textSpanEnd(p)):"";const m=flatMap(o,(e=>e.references.map((e=>referenceEntryToReferencesResponseItem(this.projectService,e,a)))));return{refs:m,symbolName:f,symbolStartOffset:u,symbolDisplayString:d}}getFileReferences(e,t){const n=this.getProjects(e);const r=toNormalizedPath(e.file);const i=this.getPreferences(r);const o={fileName:r,pos:0};const a=getPerProjectReferences(n,this.getDefaultProject(e),o,o,mapDefinitionInProjectIfFileInProject,(e=>{this.logger.info(`Finding references to file ${r} in project ${e.getProjectName()}`);return e.getLanguageService().getFileReferences(r)}));let s;if(isArray(a)){s=a}else{s=[];const e=createDocumentSpanSet(this.host.useCaseSensitiveFileNames);a.forEach((t=>{for(const n of t){if(!e.has(n)){s.push(n);e.add(n)}}}))}if(!t)return s;const c=s.map((e=>referenceEntryToReferencesResponseItem(this.projectService,e,i)));return{refs:c,symbolName:`"${e.file}"`}}openClientFile(e,t,n,r){this.projectService.openClientFileWithNormalizedPath(e,t,n,false,r)}getPosition(e,t){return e.position!==void 0?e.position:t.lineOffsetToPosition(e.line,e.offset)}getPositionInFile(e,t){const n=this.projectService.getScriptInfoForNormalizedPath(t);return this.getPosition(e,n)}getFileAndProject(e){return this.getFileAndProjectWorker(e.file,e.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(e){const{file:t,project:n}=this.getFileAndProject(e);return{file:t,languageService:n.getLanguageService(false)}}getFileAndProjectWorker(e,t){const n=toNormalizedPath(e);const r=this.getProject(t)||this.projectService.ensureDefaultProjectForFile(n);return{file:n,project:r}}getOutliningSpans(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e);const i=r.getOutliningSpans(n);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return i.map((t=>({textSpan:toProtocolTextSpan(t.textSpan,e),hintSpan:toProtocolTextSpan(t.hintSpan,e),bannerText:t.bannerText,autoCollapse:t.autoCollapse,kind:t.kind})))}else{return i}}getTodoComments(e){const{file:t,project:n}=this.getFileAndProject(e);return n.getLanguageService().getTodoComments(t,e.descriptors)}getDocCommentTemplate(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=this.getPositionInFile(e,t);return n.getDocCommentTemplateAtPosition(t,r,this.getPreferences(t),this.getFormatOptions(t))}getSpanOfEnclosingComment(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=e.onlyMultiLine;const i=this.getPositionInFile(e,t);return n.getSpanOfEnclosingComment(t,i,r)}getIndentation(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=this.getPositionInFile(e,t);const i=e.options?convertFormatOptions(e.options):this.getFormatOptions(t);const o=n.getIndentationAtPosition(t,r,i);return{position:r,indentation:o}}getBreakpointStatement(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=this.getPositionInFile(e,t);return n.getBreakpointStatementAtPosition(t,r)}getNameOrDottedNameSpan(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=this.getPositionInFile(e,t);return n.getNameOrDottedNameSpan(t,r,r)}isValidBraceCompletion(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=this.getPositionInFile(e,t);return n.isValidBraceCompletionAtPosition(t,r,e.openingBrace.charCodeAt(0))}getQuickInfoWorker(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=this.projectService.getScriptInfoForNormalizedPath(n);const o=r.getLanguageService().getQuickInfoAtPosition(n,this.getPosition(e,i));if(!o){return void 0}const a=!!this.getPreferences(n).displayPartsForJSDoc;if(t){const e=displayPartsToString(o.displayParts);return{kind:o.kind,kindModifiers:o.kindModifiers,start:i.positionToLineOffset(o.textSpan.start),end:i.positionToLineOffset(textSpanEnd(o.textSpan)),displayString:e,documentation:a?this.mapDisplayParts(o.documentation,r):displayPartsToString(o.documentation),tags:this.mapJSDocTagInfo(o.tags,r,a)}}else{return a?o:{...o,tags:this.mapJSDocTagInfo(o.tags,r,false)}}}getFormattingEditsForRange(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=this.projectService.getScriptInfoForNormalizedPath(t);const i=r.lineOffsetToPosition(e.line,e.offset);const o=r.lineOffsetToPosition(e.endLine,e.endOffset);const a=n.getFormattingEditsForRange(t,i,o,this.getFormatOptions(t));if(!a){return void 0}return a.map((e=>this.convertTextChangeToCodeEdit(e,r)))}getFormattingEditsForRangeFull(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=e.options?convertFormatOptions(e.options):this.getFormatOptions(t);return n.getFormattingEditsForRange(t,e.position,e.endPosition,r)}getFormattingEditsForDocumentFull(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=e.options?convertFormatOptions(e.options):this.getFormatOptions(t);return n.getFormattingEditsForDocument(t,r)}getFormattingEditsAfterKeystrokeFull(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=e.options?convertFormatOptions(e.options):this.getFormatOptions(t);return n.getFormattingEditsAfterKeystroke(t,e.position,e.key,r)}getFormattingEditsAfterKeystroke(e){const{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);const r=this.projectService.getScriptInfoForNormalizedPath(t);const i=r.lineOffsetToPosition(e.line,e.offset);const o=this.getFormatOptions(t);const a=n.getFormattingEditsAfterKeystroke(t,i,e.key,o);if(e.key==="\n"&&(!a||a.length===0||allEditsBeforePos(a,i))){const{lineText:s,absolutePosition:c}=r.textStorage.getAbsolutePositionAndLineText(e.line);if(s&&s.search("\\S")<0){const e=n.getIndentationAtPosition(t,i,o);let r=0;let l,d;for(l=0,d=s.length;l({start:r.positionToLineOffset(e.span.start),end:r.positionToLineOffset(textSpanEnd(e.span)),newText:e.newText?e.newText:""})))}getCompletions(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=this.projectService.getScriptInfoForNormalizedPath(n);const o=this.getPosition(e,i);const a=r.getLanguageService().getCompletionsAtPosition(n,o,{...convertUserPreferences(this.getPreferences(n)),triggerCharacter:e.triggerCharacter,triggerKind:e.triggerKind,includeExternalModuleExports:e.includeExternalModuleExports,includeInsertTextCompletions:e.includeInsertTextCompletions},r.projectService.getFormatCodeOptions(n));if(a===void 0)return void 0;if(t==="completions-full")return a;const s=e.prefix||"";const c=mapDefined(a.entries,(e=>{if(a.isMemberCompletion||startsWith(e.name.toLowerCase(),s.toLowerCase())){const t=e.replacementSpan?toProtocolTextSpan(e.replacementSpan,i):void 0;return{...e,replacementSpan:t,hasAction:e.hasAction||void 0,symbol:void 0}}}));if(t==="completions"){if(a.metadata)c.metadata=a.metadata;return c}const l={...a,optionalReplacementSpan:a.optionalReplacementSpan&&toProtocolTextSpan(a.optionalReplacementSpan,i),entries:c};return l}getCompletionEntryDetails(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=this.projectService.getScriptInfoForNormalizedPath(n);const o=this.getPosition(e,i);const a=r.projectService.getFormatCodeOptions(n);const s=!!this.getPreferences(n).displayPartsForJSDoc;const c=mapDefined(e.entryNames,(e=>{const{name:t,source:i,data:s}=typeof e==="string"?{name:e,source:void 0,data:void 0}:e;return r.getLanguageService().getCompletionEntryDetails(n,o,t,a,i,this.getPreferences(n),s?cast(s,isCompletionEntryData):void 0)}));return t?s?c:c.map((e=>({...e,tags:this.mapJSDocTagInfo(e.tags,r,false)}))):c.map((e=>({...e,codeActions:map(e.codeActions,(e=>this.mapCodeAction(e))),documentation:this.mapDisplayParts(e.documentation,r),tags:this.mapJSDocTagInfo(e.tags,r,s)})))}getCompileOnSaveAffectedFileList(e){const t=this.getProjects(e,true,true);const n=this.projectService.getScriptInfo(e.file);if(!n){return Hm}return combineProjectOutput(n,(e=>this.projectService.getScriptInfoForPath(e)),t,((e,t)=>{if(!e.compileOnSaveEnabled||!e.languageServiceEnabled||e.isOrphan()){return void 0}const n=e.getCompilationSettings();if(!!n.noEmit||isDeclarationFileName(t.fileName)&&!dtsChangeCanAffectEmit(n)){return void 0}return{projectFileName:e.getProjectName(),fileNames:e.getCompileOnSaveAffectedFileList(t),projectUsesOutFile:!!n.outFile}}))}emitFile(e){const{file:t,project:n}=this.getFileAndProject(e);if(!n){Km.ThrowNoProject()}if(!n.languageServiceEnabled){return e.richResponse?{emitSkipped:true,diagnostics:[]}:false}const r=n.getScriptInfo(t);const{emitSkipped:i,diagnostics:o}=n.emitFile(r,((e,t,n)=>this.host.writeFile(e,t,n)));return e.richResponse?{emitSkipped:i,diagnostics:e.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(o):o.map((e=>formatDiagnosticToProtocol(e,true)))}:!i}getSignatureHelpItems(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=this.projectService.getScriptInfoForNormalizedPath(n);const o=this.getPosition(e,i);const a=r.getLanguageService().getSignatureHelpItems(n,o,e);const s=!!this.getPreferences(n).displayPartsForJSDoc;if(a&&t){const e=a.applicableSpan;return{...a,applicableSpan:{start:i.positionToLineOffset(e.start),end:i.positionToLineOffset(e.start+e.length)},items:this.mapSignatureHelpItems(a.items,r,s)}}else if(s||!a){return a}else{return{...a,items:a.items.map((e=>({...e,tags:this.mapJSDocTagInfo(e.tags,r,false)})))}}}toPendingErrorCheck(e){const t=toNormalizedPath(e);const n=this.projectService.tryGetDefaultProjectForFile(t);return n&&{fileName:t,project:n}}getDiagnostics(e,t,n){if(this.suppressDiagnosticEvents){return}if(n.length>0){this.updateErrorCheck(e,n,t)}}change(e){const t=this.projectService.getScriptInfo(e.file);S.assert(!!t);t.textStorage.switchToScriptVersionCache();const n=t.lineOffsetToPosition(e.line,e.offset);const r=t.lineOffsetToPosition(e.endLine,e.endOffset);if(n>=0){this.changeSeq++;this.projectService.applyChangesToFile(t,singleIterator({span:{start:n,length:r-n},newText:e.insertString}))}}reload(e){const t=toNormalizedPath(e.file);const n=e.tmpfile===void 0?void 0:toNormalizedPath(e.tmpfile);const r=this.projectService.getScriptInfoForNormalizedPath(t);if(r){this.changeSeq++;r.reloadFromFile(n)}}saveToTmp(e,t){const n=this.projectService.getScriptInfo(e);if(n){n.saveTo(t)}}closeClientFile(e){if(!e){return}const t=normalizePath(e);this.projectService.closeClientFile(t)}mapLocationNavigationBarItems(e,t){return map(e,(e=>({text:e.text,kind:e.kind,kindModifiers:e.kindModifiers,spans:e.spans.map((e=>toProtocolTextSpan(e,t))),childItems:this.mapLocationNavigationBarItems(e.childItems,t),indent:e.indent})))}getNavigationBarItems(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e);const i=r.getNavigationBarItems(n);return!i?void 0:t?this.mapLocationNavigationBarItems(i,this.projectService.getScriptInfoForNormalizedPath(n)):i}toLocationNavigationTree(e,t){return{text:e.text,kind:e.kind,kindModifiers:e.kindModifiers,spans:e.spans.map((e=>toProtocolTextSpan(e,t))),nameSpan:e.nameSpan&&toProtocolTextSpan(e.nameSpan,t),childItems:map(e.childItems,(e=>this.toLocationNavigationTree(e,t)))}}getNavigationTree(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e);const i=r.getNavigationTree(n);return!i?void 0:t?this.toLocationNavigationTree(i,this.projectService.getScriptInfoForNormalizedPath(n)):i}getNavigateToItems(e,t){const n=this.getFullNavigateToItems(e);return!t?flatMap(n,(({navigateToItems:e})=>e)):flatMap(n,(({project:e,navigateToItems:t})=>t.map((t=>{const n=e.getScriptInfo(t.fileName);const r={name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,isCaseSensitive:t.isCaseSensitive,matchKind:t.matchKind,file:t.fileName,start:n.positionToLineOffset(t.textSpan.start),end:n.positionToLineOffset(textSpanEnd(t.textSpan))};if(t.kindModifiers&&t.kindModifiers!==""){r.kindModifiers=t.kindModifiers}if(t.containerName&&t.containerName.length>0){r.containerName=t.containerName}if(t.containerKind&&t.containerKind.length>0){r.containerKind=t.containerKind}return r}))))}getFullNavigateToItems(e){const{currentFileOnly:t,searchValue:n,maxResultCount:r,projectFileName:i}=e;if(t){S.assertIsDefined(e.file);const{file:t,project:i}=this.getFileAndProject(e);return[{project:i,navigateToItems:i.getLanguageService().getNavigateToItems(n,r,t)}]}const o=this.getHostPreferences();const a=[];const s=new Map;if(!e.file&&!i){this.projectService.loadAncestorProjectTree();this.projectService.forEachEnabledProject((e=>addItemsForProject(e)))}else{const t=this.getProjects(e);forEachProjectInProjects(t,void 0,(e=>addItemsForProject(e)))}return a;function addItemsForProject(e){const t=e.getLanguageService().getNavigateToItems(n,r,void 0,e.isNonTsProject(),o.excludeLibrarySymbolsInNavTo);const i=filter(t,(t=>tryAddSeenItem(t)&&!getMappedLocationForProject(documentSpanLocation(t),e)));if(i.length){a.push({project:e,navigateToItems:i})}}function tryAddSeenItem(e){const t=e.name;if(!s.has(t)){s.set(t,[e]);return true}const n=s.get(t);for(const t of n){if(navigateToItemIsEqualTo(t,e)){return false}}n.push(e);return true}function navigateToItemIsEqualTo(e,t){if(e===t){return true}if(!e||!t){return false}return e.containerKind===t.containerKind&&e.containerName===t.containerName&&e.fileName===t.fileName&&e.isCaseSensitive===t.isCaseSensitive&&e.kind===t.kind&&e.kindModifiers===t.kindModifiers&&e.matchKind===t.matchKind&&e.name===t.name&&e.textSpan.start===t.textSpan.start&&e.textSpan.length===t.textSpan.length}}getSupportedCodeFixes(e){if(!e)return getSupportedCodeFixes();if(e.file){const{file:t,project:n}=this.getFileAndProject(e);return n.getLanguageService().getSupportedCodeFixes(t)}const t=this.getProject(e.projectFileName);if(!t)Km.ThrowNoProject();return t.getLanguageService().getSupportedCodeFixes()}isLocation(e){return e.line!==void 0}extractPositionOrRange(e,t){let n;let r;if(this.isLocation(e)){n=getPosition(e)}else{r=this.getRange(e,t)}return S.checkDefined(n===void 0?r:n);function getPosition(e){return e.position!==void 0?e.position:t.lineOffsetToPosition(e.line,e.offset)}}getRange(e,t){const{startPosition:n,endPosition:r}=this.getStartAndEndPosition(e,t);return{pos:n,end:r}}getApplicableRefactors(e){const{file:t,project:n}=this.getFileAndProject(e);const r=n.getScriptInfoForNormalizedPath(t);const i=n.getLanguageService().getApplicableRefactors(t,this.extractPositionOrRange(e,r),this.getPreferences(t),e.triggerReason,e.kind,e.includeInteractiveActions);return i.map((e=>({...e,actions:e.actions.map((e=>({...e,range:e.range?{start:convertToLocation({line:e.range.start.line,character:e.range.start.offset}),end:convertToLocation({line:e.range.end.line,character:e.range.end.offset})}:void 0})))})))}getEditsForRefactor(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=r.getScriptInfoForNormalizedPath(n);const o=r.getLanguageService().getEditsForRefactor(n,this.getFormatOptions(n),this.extractPositionOrRange(e,i),e.refactor,e.action,this.getPreferences(n),e.interactiveRefactorArguments);if(o===void 0){return{edits:[]}}if(t){const{renameFilename:e,renameLocation:t,edits:n}=o;let i;if(e!==void 0&&t!==void 0){const o=r.getScriptInfoForNormalizedPath(toNormalizedPath(e));i=getLocationInNewDocument(getSnapshotText(o.getSnapshot()),e,t,n)}return{renameLocation:i,renameFilename:e,edits:this.mapTextChangesToCodeEdits(n),notApplicableReason:o.notApplicableReason}}return o}getMoveToRefactoringFileSuggestions(e){const{file:t,project:n}=this.getFileAndProject(e);const r=n.getScriptInfoForNormalizedPath(t);return n.getLanguageService().getMoveToRefactoringFileSuggestions(t,this.extractPositionOrRange(e,r),this.getPreferences(t))}preparePasteEdits(e){const{file:t,project:n}=this.getFileAndProject(e);return n.getLanguageService().preparePasteEditsForFile(t,e.copiedTextSpan.map((e=>this.getRange({file:t,startLine:e.start.line,startOffset:e.start.offset,endLine:e.end.line,endOffset:e.end.offset},this.projectService.getScriptInfoForNormalizedPath(t)))))}getPasteEdits(e){const{file:t,project:n}=this.getFileAndProject(e);if(isDynamicFileName(t))return void 0;const r=e.copiedFrom?{file:e.copiedFrom.file,range:e.copiedFrom.spans.map((t=>this.getRange({file:e.copiedFrom.file,startLine:t.start.line,startOffset:t.start.offset,endLine:t.end.line,endOffset:t.end.offset},n.getScriptInfoForNormalizedPath(toNormalizedPath(e.copiedFrom.file)))))}:void 0;const i=n.getLanguageService().getPasteEdits({targetFile:t,pastedText:e.pastedText,pasteLocations:e.pasteLocations.map((e=>this.getRange({file:t,startLine:e.start.line,startOffset:e.start.offset,endLine:e.end.line,endOffset:e.end.offset},n.getScriptInfoForNormalizedPath(t)))),copiedFrom:r,preferences:this.getPreferences(t)},this.getFormatOptions(t));return i&&this.mapPasteEditsAction(i)}organizeImports(e,t){S.assert(e.scope.type==="file");const{file:n,project:r}=this.getFileAndProject(e.scope.args);const i=r.getLanguageService().organizeImports({fileName:n,mode:e.mode??(e.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(n),this.getPreferences(n));if(t){return this.mapTextChangesToCodeEdits(i)}else{return i}}getEditsForFileRename(e,t){const n=toNormalizedPath(e.oldFilePath);const r=toNormalizedPath(e.newFilePath);const i=this.getHostFormatOptions();const o=this.getHostPreferences();const a=new Set;const s=[];this.projectService.loadAncestorProjectTree();this.projectService.forEachEnabledProject((e=>{const t=e.getLanguageService().getEditsForFileRename(n,r,i,o);const c=[];for(const e of t){if(!a.has(e.fileName)){s.push(e);c.push(e.fileName)}}for(const e of c){a.add(e)}}));return t?s.map((e=>this.mapTextChangeToCodeEdit(e))):s}getCodeFixes(e,t){const{file:n,project:r}=this.getFileAndProject(e);const i=r.getScriptInfoForNormalizedPath(n);const{startPosition:o,endPosition:a}=this.getStartAndEndPosition(e,i);let s;try{s=r.getLanguageService().getCodeFixesAtPosition(n,o,a,e.errorCodes,this.getFormatOptions(n),this.getPreferences(n))}catch(t){const i=t instanceof Error?t:new Error(t);const s=r.getLanguageService();const c=[...s.getSyntacticDiagnostics(n),...s.getSemanticDiagnostics(n),...s.getSuggestionDiagnostics(n)].filter((e=>decodedTextSpanIntersectsWith(o,a-o,e.start,e.length))).map((e=>e.code));const l=e.errorCodes.find((e=>!c.includes(e)));if(l!==void 0){i.message+=`\nAdditional information: BADCLIENT: Bad error code, ${l} not found in range ${o}..${a} (found: ${c.join(", ")})`}throw i}return t?s.map((e=>this.mapCodeFixAction(e))):s}getCombinedCodeFix({scope:e,fixId:t},n){S.assert(e.type==="file");const{file:r,project:i}=this.getFileAndProject(e.args);const o=i.getLanguageService().getCombinedCodeFix({type:"file",fileName:r},t,this.getFormatOptions(r),this.getPreferences(r));if(n){return{changes:this.mapTextChangesToCodeEdits(o.changes),commands:o.commands}}else{return o}}applyCodeActionCommand(e){const t=e.command;for(const e of toArray(t)){const{file:t,project:n}=this.getFileAndProject(e);n.getLanguageService().applyCodeActionCommand(e,this.getFormatOptions(t)).then((e=>{}),(e=>{}))}return{}}getStartAndEndPosition(e,t){let n,r;if(e.startPosition!==void 0){n=e.startPosition}else{n=t.lineOffsetToPosition(e.startLine,e.startOffset);e.startPosition=n}if(e.endPosition!==void 0){r=e.endPosition}else{r=t.lineOffsetToPosition(e.endLine,e.endOffset);e.endPosition=r}return{startPosition:n,endPosition:r}}mapCodeAction({description:e,changes:t,commands:n}){return{description:e,changes:this.mapTextChangesToCodeEdits(t),commands:n}}mapCodeFixAction({fixName:e,description:t,changes:n,commands:r,fixId:i,fixAllDescription:o}){return{fixName:e,description:t,changes:this.mapTextChangesToCodeEdits(n),commands:r,fixId:i,fixAllDescription:o}}mapPasteEditsAction({edits:e,fixId:t}){return{edits:this.mapTextChangesToCodeEdits(e),fixId:t}}mapTextChangesToCodeEdits(e){return e.map((e=>this.mapTextChangeToCodeEdit(e)))}mapTextChangeToCodeEdit(e){const t=this.projectService.getScriptInfoOrConfig(e.fileName);if(!!e.isNewFile===!!t){if(!t){this.projectService.logErrorForScriptInfoNotFound(e.fileName)}S.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!e.isNewFile,hasScriptInfo:!!t}))}return t?{fileName:e.fileName,textChanges:e.textChanges.map((e=>convertTextChangeToCodeEdit(e,t)))}:convertNewFileTextChangeToCodeEdit(e)}convertTextChangeToCodeEdit(e,t){return{start:t.positionToLineOffset(e.span.start),end:t.positionToLineOffset(e.span.start+e.span.length),newText:e.newText?e.newText:""}}getBraceMatching(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e);const i=this.projectService.getScriptInfoForNormalizedPath(n);const o=this.getPosition(e,i);const a=r.getBraceMatchingAtPosition(n,o);return!a?void 0:t?a.map((e=>toProtocolTextSpan(e,i))):a}getDiagnosticsForProject(e,t,n){if(this.suppressDiagnosticEvents){return}const{fileNames:r,languageServiceDisabled:i}=this.getProjectInfoWorker(n,void 0,true,void 0,true);if(i)return;const o=r.filter((e=>!e.includes("lib.d.ts")));if(o.length===0)return;const a=[];const s=[];const c=[];const l=[];const d=toNormalizedPath(n);const p=this.projectService.ensureDefaultProjectForFile(d);for(const e of o){if(this.getCanonicalFileName(e)===this.getCanonicalFileName(n)){a.push(e)}else{const t=this.projectService.getScriptInfo(e);if(!t.isScriptOpen()){if(isDeclarationFileName(e)){l.push(e)}else{c.push(e)}}else{s.push(e)}}}const u=[...a,...s,...c,...l];const f=u.map((e=>({fileName:e,project:p})));this.updateErrorCheck(e,f,t,false)}configurePlugin(e){this.projectService.configurePlugin(e)}getSmartSelectionRange(e,t){const{locations:n}=e;const{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(e);const o=S.checkDefined(this.projectService.getScriptInfo(r));return map(n,(e=>{const n=this.getPosition(e,o);const a=i.getSmartSelectionRange(r,n);return t?this.mapSelectionRange(a,o):a}))}toggleLineComment(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e);const i=this.projectService.getScriptInfo(n);const o=this.getRange(e,i);const a=r.toggleLineComment(n,o);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return a.map((t=>this.convertTextChangeToCodeEdit(t,e)))}return a}toggleMultilineComment(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e);const i=this.projectService.getScriptInfoForNormalizedPath(n);const o=this.getRange(e,i);const a=r.toggleMultilineComment(n,o);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return a.map((t=>this.convertTextChangeToCodeEdit(t,e)))}return a}commentSelection(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e);const i=this.projectService.getScriptInfoForNormalizedPath(n);const o=this.getRange(e,i);const a=r.commentSelection(n,o);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return a.map((t=>this.convertTextChangeToCodeEdit(t,e)))}return a}uncommentSelection(e,t){const{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e);const i=this.projectService.getScriptInfoForNormalizedPath(n);const o=this.getRange(e,i);const a=r.uncommentSelection(n,o);if(t){const e=this.projectService.getScriptInfoForNormalizedPath(n);return a.map((t=>this.convertTextChangeToCodeEdit(t,e)))}return a}mapSelectionRange(e,t){const n={textSpan:toProtocolTextSpan(e.textSpan,t)};if(e.parent){n.parent=this.mapSelectionRange(e.parent,t)}return n}getScriptInfoFromProjectService(e){const t=toNormalizedPath(e);const n=this.projectService.getScriptInfoForNormalizedPath(t);if(!n){this.projectService.logErrorForScriptInfoNotFound(t);return Km.ThrowNoProject()}return n}toProtocolCallHierarchyItem(e){const t=this.getScriptInfoFromProjectService(e.file);return{name:e.name,kind:e.kind,kindModifiers:e.kindModifiers,file:e.file,containerName:e.containerName,span:toProtocolTextSpan(e.span,t),selectionSpan:toProtocolTextSpan(e.selectionSpan,t)}}toProtocolCallHierarchyIncomingCall(e){const t=this.getScriptInfoFromProjectService(e.from.file);return{from:this.toProtocolCallHierarchyItem(e.from),fromSpans:e.fromSpans.map((e=>toProtocolTextSpan(e,t)))}}toProtocolCallHierarchyOutgoingCall(e,t){return{to:this.toProtocolCallHierarchyItem(e.to),fromSpans:e.fromSpans.map((e=>toProtocolTextSpan(e,t)))}}prepareCallHierarchy(e){const{file:t,project:n}=this.getFileAndProject(e);const r=this.projectService.getScriptInfoForNormalizedPath(t);if(r){const i=this.getPosition(e,r);const o=n.getLanguageService().prepareCallHierarchy(t,i);return o&&mapOneOrMany(o,(e=>this.toProtocolCallHierarchyItem(e)))}return void 0}provideCallHierarchyIncomingCalls(e){const{file:t,project:n}=this.getFileAndProject(e);const r=this.getScriptInfoFromProjectService(t);const i=n.getLanguageService().provideCallHierarchyIncomingCalls(t,this.getPosition(e,r));return i.map((e=>this.toProtocolCallHierarchyIncomingCall(e)))}provideCallHierarchyOutgoingCalls(e){const{file:t,project:n}=this.getFileAndProject(e);const r=this.getScriptInfoFromProjectService(t);const i=n.getLanguageService().provideCallHierarchyOutgoingCalls(t,this.getPosition(e,r));return i.map((e=>this.toProtocolCallHierarchyOutgoingCall(e,r)))}getCanonicalFileName(e){const t=this.host.useCaseSensitiveFileNames?e:toFileNameLowerCase(e);return normalizePath(t)}exit(){}notRequired(e){if(e)this.doOutput(void 0,e.command,e.seq,true,this.performanceData);return{responseRequired:false,performanceData:this.performanceData}}requiredResponse(e){return{response:e,responseRequired:true,performanceData:this.performanceData}}addProtocolHandler(e,t){if(this.handlers.has(e)){throw new Error(`Protocol handler already exists for command "${e}"`)}this.handlers.set(e,t)}setCurrentRequest(e){S.assert(this.currentRequestId===void 0);this.currentRequestId=e;this.cancellationToken.setRequest(e)}resetCurrentRequest(e){S.assert(this.currentRequestId===e);this.currentRequestId=void 0;this.cancellationToken.resetRequest(e)}executeWithRequestId(e,t,n){const r=this.performanceData;try{this.performanceData=n;this.setCurrentRequest(e);return t()}finally{this.resetCurrentRequest(e);this.performanceData=r}}executeCommand(e){const t=this.handlers.get(e.command);if(t){const n=this.executeWithRequestId(e.seq,(()=>t(e)),void 0);this.projectService.enableRequestedPlugins();return n}else{this.logger.msg(`Unrecognized JSON command:${stringifyIndented(e)}`,"Err");this.doOutput(void 0,"unknown",e.seq,false,void 0,`Unrecognized JSON command: ${e.command}`);return{responseRequired:false}}}onMessage(e){var t,n,r,i,o,a,s;this.gcTimer.scheduleCollect();let c;const l=this.performanceData;if(this.logger.hasLevel(2)){c=this.hrtime();if(this.logger.hasLevel(3)){this.logger.info(`request:${indent2(this.toStringMessage(e))}`)}}let d;let p;try{d=this.parseMessage(e);p=d.arguments&&d.arguments.file?d.arguments:void 0;(t=G)==null?void 0:t.instant(G.Phase.Session,"request",{seq:d.seq,command:d.command});(n=G)==null?void 0:n.push(G.Phase.Session,"executeCommand",{seq:d.seq,command:d.command},true);const{response:o,responseRequired:a,performanceData:s}=this.executeCommand(d);(r=G)==null?void 0:r.pop();if(this.logger.hasLevel(2)){const e=hrTimeToMilliseconds(this.hrtime(c)).toFixed(4);if(a){this.logger.perftrc(`${d.seq}::${d.command}: elapsed time (in milliseconds) ${e}`)}else{this.logger.perftrc(`${d.seq}::${d.command}: async elapsed time (in milliseconds) ${e}`)}}(i=G)==null?void 0:i.instant(G.Phase.Session,"response",{seq:d.seq,command:d.command,success:!!o});if(o){this.doOutput(o,d.command,d.seq,true,s)}else if(a){this.doOutput(void 0,d.command,d.seq,false,s,"No content available.")}}catch(t){(o=G)==null?void 0:o.popAll();if(t instanceof ce){(a=G)==null?void 0:a.instant(G.Phase.Session,"commandCanceled",{seq:d==null?void 0:d.seq,command:d==null?void 0:d.command});this.doOutput({canceled:true},d.command,d.seq,true,this.performanceData);return}this.logErrorWorker(t,this.toStringMessage(e),p);(s=G)==null?void 0:s.instant(G.Phase.Session,"commandError",{seq:d==null?void 0:d.seq,command:d==null?void 0:d.command,message:t.message});this.doOutput(void 0,d?d.command:"unknown",d?d.seq:0,false,this.performanceData,"Error processing request. "+t.message+"\n"+t.stack)}finally{this.performanceData=l}}parseMessage(e){return JSON.parse(e)}toStringMessage(e){return e}getFormatOptions(e){return this.projectService.getFormatCodeOptions(e)}getPreferences(e){return this.projectService.getPreferences(e)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function toProtocolPerformanceData(e){const t=e.diagnosticsDuration&&arrayFrom(e.diagnosticsDuration,(([e,t])=>({...t,file:e})));return{...e,diagnosticsDuration:t}}function toProtocolTextSpan(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(textSpanEnd(e))}}function toProtocolTextSpanWithContext(e,t,n){const r=toProtocolTextSpan(e,n);const i=t&&toProtocolTextSpan(t,n);return i?{...r,contextStart:i.start,contextEnd:i.end}:r}function convertTextChangeToCodeEdit(e,t){return{start:positionToLineOffset(t,e.span.start),end:positionToLineOffset(t,textSpanEnd(e.span)),newText:e.newText}}function positionToLineOffset(e,t){return isConfigFile(e)?locationFromLineAndCharacter(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function convertLinkedEditInfoToRanges(e,t){const n=e.ranges.map((e=>({start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(e.start+e.length)})));if(!e.wordPattern)return{ranges:n};return{ranges:n,wordPattern:e.wordPattern}}function locationFromLineAndCharacter(e){return{line:e.line+1,offset:e.character+1}}function convertNewFileTextChangeToCodeEdit(e){S.assert(e.textChanges.length===1);const t=first(e.textChanges);S.assert(t.span.start===0&&t.span.length===0);return{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function getLocationInNewDocument(e,t,n,r){const i=applyEdits(e,t,r);const{line:o,character:a}=computeLineAndCharacterOfPosition(computeLineStarts(i),n);return{line:o+1,offset:a+1}}function applyEdits(e,t,n){for(const{fileName:r,textChanges:i}of n){if(r!==t){continue}for(let t=i.length-1;t>=0;t--){const{newText:n,span:{start:r,length:o}}=i[t];e=e.slice(0,r)+n+e.slice(r+o)}}return e}function referenceEntryToReferencesResponseItem(e,{fileName:t,textSpan:n,contextSpan:r,isWriteAccess:i,isDefinition:o},{disableLineTextInReferences:a}){const s=S.checkDefined(e.getScriptInfo(t));const c=toProtocolTextSpanWithContext(n,r,s);const l=a?void 0:getLineText(s,c);return{file:t,...c,lineText:l,isWriteAccess:i,isDefinition:o}}function getLineText(e,t){const n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,textSpanEnd(n)).replace(/\r|\n/g,"")}function isCompletionEntryData(e){return e===void 0||e&&typeof e==="object"&&typeof e.exportName==="string"&&(e.fileName===void 0||typeof e.fileName==="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName==="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport==="boolean"))}var $_=4;var Q_=(e=>{e[e["PreStart"]=0]="PreStart";e[e["Start"]=1]="Start";e[e["Entire"]=2]="Entire";e[e["Mid"]=3]="Mid";e[e["End"]=4]="End";e[e["PostEnd"]=5]="PostEnd";return e})(Q_||{});var X_=class{constructor(){this.goSubtree=true;this.lineIndex=new ng;this.endBranch=[];this.state=2;this.initialText="";this.trailingText="";this.lineIndex.root=new rg;this.startPath=[this.lineIndex.root];this.stack=[this.lineIndex.root]}get done(){return false}insertLines(e,t){if(t){this.trailingText=""}if(e){e=this.initialText+e+this.trailingText}else{e=this.initialText+this.trailingText}const n=ng.linesFromText(e);const r=n.lines;if(r.length>1&&r[r.length-1]===""){r.pop()}let i;let o;for(let e=this.endBranch.length-1;e>=0;e--){this.endBranch[e].updateCounts();if(this.endBranch[e].charCount()===0){o=this.endBranch[e];if(e>0){i=this.endBranch[e-1]}else{i=this.branchNode}}}if(o){i.remove(o)}const a=this.startPath[this.startPath.length-1];if(r.length>0){a.text=r[0];if(r.length>1){let e=new Array(r.length-1);let t=a;for(let t=1;t=0){const r=this.startPath[n];e=r.insertAt(t,e);n--;t=r}let i=e.length;while(i>0){const t=new rg;t.add(this.lineIndex.root);e=t.insertAt(this.lineIndex.root,e);i=e.length;this.lineIndex.root=t}this.lineIndex.root.updateCounts()}else{for(let e=this.startPath.length-2;e>=0;e--){this.startPath[e].updateCounts()}}}else{const e=this.startPath[this.startPath.length-2];e.remove(a);for(let e=this.startPath.length-2;e>=0;e--){this.startPath[e].updateCounts()}}return this.lineIndex}post(e,t,n){if(n===this.lineCollectionAtBranch){this.state=4}this.stack.pop()}pre(e,t,n,r,i){const o=this.stack[this.stack.length-1];if(this.state===2&&i===1){this.state=1;this.branchNode=o;this.lineCollectionAtBranch=n}let a;function fresh(e){if(e.isLeaf()){return new ig("")}else return new rg}switch(i){case 0:this.goSubtree=false;if(this.state!==4){o.add(n)}break;case 1:if(this.state===4){this.goSubtree=false}else{a=fresh(n);o.add(a);this.startPath.push(a)}break;case 2:if(this.state!==4){a=fresh(n);o.add(a);this.startPath.push(a)}else{if(!n.isLeaf()){a=fresh(n);o.add(a);this.endBranch.push(a)}}break;case 3:this.goSubtree=false;break;case 4:if(this.state!==4){this.goSubtree=false}else{if(!n.isLeaf()){a=fresh(n);o.add(a);this.endBranch.push(a)}}break;case 5:this.goSubtree=false;if(this.state!==1){o.add(n)}break}if(this.goSubtree){this.stack.push(a)}}leaf(e,t,n){if(this.state===1){this.initialText=n.text.substring(0,e)}else if(this.state===2){this.initialText=n.text.substring(0,e);this.trailingText=n.text.substring(e+t)}else{this.trailingText=n.text.substring(e+t)}}};var Y_=class{constructor(e,t,n){this.pos=e;this.deleteLen=t;this.insertedText=n}getTextChangeRange(){return createTextChangeRange(createTextSpan(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}};var Z_=class _ScriptVersionCache{constructor(){this.changes=[];this.versions=new Array(_ScriptVersionCache.maxVersions);this.minVersion=0;this.currentVersion=0}versionToIndex(e){if(ethis.currentVersion){return void 0}return e%_ScriptVersionCache.maxVersions}currentVersionToIndex(){return this.currentVersion%_ScriptVersionCache.maxVersions}edit(e,t,n){this.changes.push(new Y_(e,t,n));if(this.changes.length>_ScriptVersionCache.changeNumberThreshold||t>_ScriptVersionCache.changeLengthThreshold||n&&n.length>_ScriptVersionCache.changeLengthThreshold){this.getSnapshot()}}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let e=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let t=e.index;for(const e of this.changes){t=t.edit(e.pos,e.deleteLen,e.insertedText)}e=new tg(this.currentVersion+1,this,t,this.changes);this.currentVersion=e.version;this.versions[this.currentVersionToIndex()]=e;this.changes=[];if(this.currentVersion-this.minVersion>=_ScriptVersionCache.maxVersions){this.minVersion=this.currentVersion-_ScriptVersionCache.maxVersions+1}}return e}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(e){return this._getSnapshot().index.lineNumberToInfo(e)}lineOffsetToPosition(e,t){return this._getSnapshot().index.absolutePositionOfStartOfLine(e)+(t-1)}positionToLineOffset(e){return this._getSnapshot().index.positionToLineOffset(e)}lineToTextSpan(e){const t=this._getSnapshot().index;const{lineText:n,absolutePosition:r}=t.lineNumberToInfo(e+1);const i=n!==void 0?n.length:t.absolutePositionOfStartOfLine(e+2)-r;return createTextSpan(r,i)}getTextChangesBetweenVersions(e,t){if(e=this.minVersion){const n=[];for(let r=e+1;r<=t;r++){const e=this.versions[this.versionToIndex(r)];for(const t of e.changesSincePreviousVersion){n.push(t.getTextChangeRange())}}return collapseTextChangeRangesAcrossMultipleVersions(n)}else{return void 0}}else{return rn}}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(e){const t=new _ScriptVersionCache;const n=new tg(0,t,new ng);t.versions[t.currentVersion]=n;const r=ng.linesFromText(e);n.index.load(r.lines);return t}};Z_.changeNumberThreshold=8;Z_.changeLengthThreshold=256;Z_.maxVersions=8;var eg=Z_;var tg=class _LineIndexSnapshot{constructor(e,t,n,r=Hm){this.version=e;this.cache=t;this.index=n;this.changesSincePreviousVersion=r}getText(e,t){return this.index.getText(e,t-e)}getLength(){return this.index.getLength()}getChangeRange(e){if(e instanceof _LineIndexSnapshot&&this.cache===e.cache){if(this.version<=e.version){return rn}else{return this.cache.getTextChangesBetweenVersions(e.version,this.version)}}}};var ng=class _LineIndex{constructor(){this.checkEdits=false}absolutePositionOfStartOfLine(e){return this.lineNumberToInfo(e).absolutePosition}positionToLineOffset(e){const{oneBasedLine:t,zeroBasedColumn:n}=this.root.charOffsetToLineInfo(1,e);return{line:t,offset:n+1}}positionToColumnAndLineText(e){return this.root.charOffsetToLineInfo(1,e)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(e){const t=this.getLineCount();if(e<=t){const{position:t,leaf:n}=this.root.lineNumberToInfo(e,0);return{absolutePosition:t,lineText:n&&n.text}}else{return{absolutePosition:this.root.charCount(),lineText:void 0}}}load(e){if(e.length>0){const t=[];for(let n=0;n0&&e{n=n.concat(r.text.substring(e,e+t))}})}return n}getLength(){return this.root.charCount()}every(e,t,n){if(!n){n=this.root.charCount()}const r={goSubtree:true,done:false,leaf(t,n,r){if(!e(r,t,n)){this.done=true}}};this.walk(t,n-t,r);return!r.done}edit(e,t,n){if(this.root.charCount()===0){S.assert(t===0);if(n!==void 0){this.load(_LineIndex.linesFromText(n).lines);return this}return void 0}else{let r;if(this.checkEdits){const i=this.getText(0,this.root.charCount());r=i.slice(0,e)+n+i.slice(e+t)}const i=new X_;let o=false;if(e>=this.root.charCount()){e=this.root.charCount()-1;const r=this.getText(e,1);if(n){n=r+n}else{n=r}t=0;o=true}else if(t>0){const r=e+t;const{zeroBasedColumn:i,lineText:o}=this.positionToColumnAndLineText(r);if(i===0){t+=o.length;n=n?n+o:o}}this.root.walk(e,t,i);i.insertLines(n,o);if(this.checkEdits){const e=i.lineIndex.getText(0,i.lineIndex.getLength());S.assert(r===e,"buffer edit mismatch")}return i.lineIndex}}static buildTreeFromBottom(e){if(e.length<$_){return new rg(e)}const t=new Array(Math.ceil(e.length/$_));let n=0;for(let r=0;r0){n[r]=i}else{n.pop()}return{lines:n,lineMap:t}}};var rg=class _LineNode{constructor(e=[]){this.children=e;this.totalChars=0;this.totalLines=0;if(e.length)this.updateCounts()}isLeaf(){return false}updateCounts(){this.totalChars=0;this.totalLines=0;for(const e of this.children){this.totalChars+=e.charCount();this.totalLines+=e.lineCount()}}execWalk(e,t,n,r,i){if(n.pre){n.pre(e,t,this.children[r],this,i)}if(n.goSubtree){this.children[r].walk(e,t,n);if(n.post){n.post(e,t,this.children[r],this,i)}}else{n.goSubtree=true}return n.done}skipChild(e,t,n,r,i){if(r.pre&&!r.done){r.pre(e,t,this.children[n],this,i);r.goSubtree=true}}walk(e,t,n){if(this.children.length===0)return;let r=0;let i=this.children[r].charCount();let o=e;while(o>=i){this.skipChild(o,t,r,n,0);o-=i;r++;i=this.children[r].charCount()}if(o+t<=i){if(this.execWalk(o,t,n,r,2)){return}}else{if(this.execWalk(o,i-o,n,r,1)){return}let e=t-(i-o);r++;const a=this.children[r];i=a.charCount();while(e>i){if(this.execWalk(0,i,n,r,3)){return}e-=i;r++;i=this.children[r].charCount()}if(e>0){if(this.execWalk(0,e,n,r,4)){return}}}if(n.pre){const e=this.children.length;if(rt){if(n.isLeaf()){return{oneBasedLine:e,zeroBasedColumn:t,lineText:n.text}}else{return n.charOffsetToLineInfo(e,t)}}else{t-=n.charCount();e+=n.lineCount()}}const n=this.lineCount();if(n===0){return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0}}const r=S.checkDefined(this.lineNumberToInfo(n,0).leaf);return{oneBasedLine:n,zeroBasedColumn:r.charCount(),lineText:void 0}}lineNumberToInfo(e,t){for(const n of this.children){const r=n.lineCount();if(r>=e){return n.isLeaf()?{position:t,leaf:n}:n.lineNumberToInfo(e,t)}else{e-=r;t+=n.charCount()}}return{position:t,leaf:void 0}}splitAfter(e){let t;const n=this.children.length;e++;const r=e;if(e=0;e--){if(o[e].children.length===0){o.pop()}}}if(e){o.push(e)}this.updateCounts();for(let e=0;e{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:e,reject:t})}));this.installer.send(t);return n}attach(e){this.projectService=e;this.installer=this.createInstallerProcess()}onProjectClosed(e){this.installer.send({projectName:e.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(e,t,n){const r=createInstallTypingsRequest(e,t,n);if(this.logger.hasLevel(3)){this.logger.info(`TIAdapter:: Scheduling throttled operation:${stringifyIndented(r)}`)}if(this.activeRequestCount0){this.activeRequestCount--}else{S.fail("TIAdapter:: Received too many responses")}while(!this.requestQueue.isEmpty()){const e=this.requestQueue.dequeue();if(this.requestMap.get(e.projectName)===e){this.requestMap.delete(e.projectName);this.scheduleRequest(e);break}if(this.logger.hasLevel(3)){this.logger.info(`TIAdapter:: Skipping defunct request for: ${e.projectName}`)}}this.projectService.updateTypingsForProject(e);this.event(e,"setTypings");break}case Ts:this.projectService.watchTypingLocations(e);break;default:assertType(e)}}scheduleRequest(e){if(this.logger.hasLevel(3)){this.logger.info(`TIAdapter:: Scheduling request for: ${e.projectName}`)}this.activeRequestCount++;this.host.setTimeout((()=>{if(this.logger.hasLevel(3)){this.logger.info(`TIAdapter:: Sending request:${stringifyIndented(e)}`)}this.installer.send(e)}),_TypingsInstallerAdapter.requestDelayMillis,`${e.projectName}::${e.kind}`)}};og.requestDelayMillis=100;var ag=og;var sg={};__export(sg,{ActionInvalidate:()=>fs,ActionPackageInstalled:()=>ms,ActionSet:()=>us,ActionWatchTypingLocations:()=>Ts,Arguments:()=>Ss,AutoImportProviderProject:()=>__,AuxiliaryProject:()=>f_,CharRangeSection:()=>Q_,CloseFileWatcherEvent:()=>D_,CommandNames:()=>V_,ConfigFileDiagEvent:()=>C_,ConfiguredProject:()=>g_,ConfiguredProjectLoadKind:()=>J_,CreateDirectoryWatcherEvent:()=>P_,CreateFileWatcherEvent:()=>F_,Errors:()=>Km,EventBeginInstallTypes:()=>gs,EventEndInstallTypes:()=>ys,EventInitializationFailed:()=>hs,EventTypesRegistry:()=>_s,ExternalProject:()=>y_,GcTimer:()=>Qm,InferredProject:()=>u_,LargeFileReferencedEvent:()=>b_,LineIndex:()=>ng,LineLeaf:()=>ig,LineNode:()=>rg,LogLevel:()=>qm,Msg:()=>Gm,OpenFileInfoTelemetryEvent:()=>k_,Project:()=>p_,ProjectInfoTelemetryEvent:()=>N_,ProjectKind:()=>d_,ProjectLanguageServiceStateEvent:()=>E_,ProjectLoadingFinishEvent:()=>x_,ProjectLoadingStartEvent:()=>v_,ProjectService:()=>U_,ProjectsUpdatedInBackgroundEvent:()=>S_,ScriptInfo:()=>l_,ScriptVersionCache:()=>eg,Session:()=>K_,TextStorage:()=>c_,ThrottledOperations:()=>$m,TypingsInstallerAdapter:()=>ag,allFilesAreJsOrDts:()=>allFilesAreJsOrDts,allRootFilesAreJsOrDts:()=>allRootFilesAreJsOrDts,asNormalizedPath:()=>asNormalizedPath,convertCompilerOptions:()=>convertCompilerOptions,convertFormatOptions:()=>convertFormatOptions,convertScriptKindName:()=>convertScriptKindName,convertTypeAcquisition:()=>convertTypeAcquisition,convertUserPreferences:()=>convertUserPreferences,convertWatchOptions:()=>convertWatchOptions,countEachFileTypes:()=>countEachFileTypes,createInstallTypingsRequest:()=>createInstallTypingsRequest,createModuleSpecifierCache:()=>createModuleSpecifierCache,createNormalizedPathMap:()=>createNormalizedPathMap,createPackageJsonCache:()=>createPackageJsonCache,createSortedArray:()=>createSortedArray2,emptyArray:()=>Hm,findArgument:()=>findArgument,formatDiagnosticToProtocol:()=>formatDiagnosticToProtocol,formatMessage:()=>formatMessage2,getBaseConfigFileName:()=>getBaseConfigFileName,getDetailWatchInfo:()=>getDetailWatchInfo,getLocationInNewDocument:()=>getLocationInNewDocument,hasArgument:()=>hasArgument,hasNoTypeScriptSource:()=>hasNoTypeScriptSource,indent:()=>indent2,isBackgroundProject:()=>isBackgroundProject,isConfigFile:()=>isConfigFile,isConfiguredProject:()=>isConfiguredProject,isDynamicFileName:()=>isDynamicFileName,isExternalProject:()=>isExternalProject,isInferredProject:()=>isInferredProject,isInferredProjectName:()=>isInferredProjectName,isProjectDeferredClose:()=>isProjectDeferredClose,makeAutoImportProviderProjectName:()=>makeAutoImportProviderProjectName,makeAuxiliaryProjectName:()=>makeAuxiliaryProjectName,makeInferredProjectName:()=>makeInferredProjectName,maxFileSize:()=>T_,maxProgramSizeForNonTsFiles:()=>h_,normalizedPathToPath:()=>normalizedPathToPath,nowString:()=>nowString,nullCancellationToken:()=>z_,nullTypingsInstaller:()=>B_,protocol:()=>Xm,scriptInfoIsContainedByBackgroundProject:()=>scriptInfoIsContainedByBackgroundProject,scriptInfoIsContainedByDeferredClosedProject:()=>scriptInfoIsContainedByDeferredClosedProject,stringifyIndented:()=>stringifyIndented,toEvent:()=>toEvent,toNormalizedPath:()=>toNormalizedPath,tryConvertScriptKindName:()=>tryConvertScriptKindName,typingsInstaller:()=>Um,updateProjectIfDirty:()=>updateProjectIfDirty});if(typeof console!=="undefined"){S.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}}}0&&0})({get exports(){return r},set exports(t){r=t;if(true&&e.exports){e.exports=t}}})},113:e=>{"use strict";e.exports=require("crypto")},147:e=>{"use strict";e.exports=require("fs")},405:e=>{"use strict";e.exports=require("inspector")},749:e=>{"use strict";e.exports=require("next/dist/compiled/source-map")},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")},74:e=>{"use strict";e.exports=require("perf_hooks")}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var i=t[n]={id:n,loaded:false,exports:{}};var o=true;try{e[n](i,i.exports,__nccwpck_require__);o=false}finally{if(o)delete t[n]}i.loaded=true;return i.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(219);module.exports=n})(); \ No newline at end of file diff --git a/packages/next/src/server/typescript/index.ts b/packages/next/src/server/typescript/index.ts index ad6823d2c01b9..5e900195e799e 100644 --- a/packages/next/src/server/typescript/index.ts +++ b/packages/next/src/server/typescript/index.ts @@ -39,15 +39,15 @@ export const createTSPlugin: tsModule.server.PluginModuleFactory = ({ // The default user config is { "name": "next" } const isPluginEnabled = info.config.enabled ?? true - const isPluginInitialized = init({ + if (!isPluginEnabled) { + return info.languageService + } + + init({ ts, info, }) - if (!isPluginEnabled || !isPluginInitialized) { - return info.languageService - } - // Set up decorator object const proxy: tsModule.LanguageService = Object.create(null) for (let k of Object.keys(info.languageService)) { @@ -79,14 +79,6 @@ export const createTSPlugin: tsModule.server.PluginModuleFactory = ({ if (!entryInfo.client) { // Remove specified entries from completion list prior.entries = serverLayer.filterCompletionsAtPosition(prior.entries) - - // Provide autocompletion for metadata fields - prior = metadata.filterCompletionsAtPosition( - fileName, - position, - options, - prior - ) } // Add auto completions for export configs. @@ -126,21 +118,11 @@ export const createTSPlugin: tsModule.server.PluginModuleFactory = ({ ) => { const entryCompletionEntryDetails = entryConfig.getCompletionEntryDetails( entryName, - data + data, + fileName ) if (entryCompletionEntryDetails) return entryCompletionEntryDetails - const metadataCompletionEntryDetails = metadata.getCompletionEntryDetails( - fileName, - position, - entryName, - formatOptions, - source, - preferences, - data - ) - if (metadataCompletionEntryDetails) return metadataCompletionEntryDetails - return info.languageService.getCompletionEntryDetails( fileName, position, @@ -173,9 +155,6 @@ export const createTSPlugin: tsModule.server.PluginModuleFactory = ({ ) { return } - - const metadataInfo = metadata.getQuickInfoAtPosition(fileName, position) - if (metadataInfo) return metadataInfo } const overridden = entryConfig.getQuickInfoAtPosition(fileName, position) @@ -248,10 +227,7 @@ export const createTSPlugin: tsModule.server.PluginModuleFactory = ({ fileName, node ) - : metadata.getSemanticDiagnosticsForExportVariableStatement( - fileName, - node - ) + : [] prior.push(...diagnostics, ...metadataDiagnostics) } @@ -311,10 +287,7 @@ export const createTSPlugin: tsModule.server.PluginModuleFactory = ({ fileName, node ) - : metadata.getSemanticDiagnosticsForExportVariableStatement( - fileName, - node - ) + : [] prior.push(...metadataDiagnostics) } @@ -368,11 +341,6 @@ export const createTSPlugin: tsModule.server.PluginModuleFactory = ({ proxy.getDefinitionAndBoundSpan = (fileName: string, position: number) => { const entryInfo = getEntryInfo(fileName) if (isAppEntryFile(fileName) && !entryInfo.client) { - const metadataDefinition = metadata.getDefinitionAndBoundSpan( - fileName, - position - ) - if (metadataDefinition) return metadataDefinition } return info.languageService.getDefinitionAndBoundSpan(fileName, position) diff --git a/packages/next/src/server/typescript/rules/config.ts b/packages/next/src/server/typescript/rules/config.ts index 9f1df6d0ef835..4d667627e511d 100644 --- a/packages/next/src/server/typescript/rules/config.ts +++ b/packages/next/src/server/typescript/rules/config.ts @@ -22,6 +22,7 @@ const API_DOCS: Record< type?: string isValid?: (value: string) => boolean getHint?: (value: any) => string | undefined + insertText?: string } > = { dynamic: { @@ -29,7 +30,7 @@ const API_DOCS: Record< 'The `dynamic` option provides a few ways to opt in or out of dynamic behavior.', options: { '"auto"': - 'Heuristic to cache as much as possible but doesn’t prevent any component to opt-in to dynamic behavior.', + "Heuristic to cache as much as possible but doesn't prevent any component to opt-in to dynamic behavior.", '"force-dynamic"': 'This disables all caching of fetches and always revalidates. (This is equivalent to `getServerSideProps`.)', '"error"': @@ -41,7 +42,7 @@ const API_DOCS: Record< }, fetchCache: { description: - 'The `fetchCache` option controls how Next.js statically caches fetches. By default it statically caches fetches reachable before any dynamic Hooks are used, and it doesn’t cache fetches that are discovered after that.', + "The `fetchCache` option controls how Next.js statically caches fetches. By default it statically caches fetches reachable before any dynamic Hooks are used, and it doesn't cache fetches that are discovered after that.", options: { '"force-no-store"': "This lets you intentionally opt-out of all caching of data. This option forces all fetches to be refetched every request even if the `cache: 'force-cache'` option is passed to `fetch()`.", @@ -50,7 +51,7 @@ const API_DOCS: Record< '"default-no-store"': "Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'no-store'`. This means that even fetches before a dynamic Hook are considered dynamic.", '"auto"': - 'This is the default option. It caches any fetches with the default `cache` option provided, that happened before a dynamic Hook is used and don’t cache any such fetches if they’re issued after a dynamic Hook.', + "This is the default option. It caches any fetches with the default `cache` option provided, that happened before a dynamic Hook is used and don't cache any such fetches if they're issued after a dynamic Hook.", '"default-cache"': "Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'force-cache'`. This means that even fetches before a dynamic Hook are considered dynamic.", '"only-cache"': @@ -65,7 +66,7 @@ const API_DOCS: Record< 'Specify the perferred region that this layout or page should be deployed to. If the region option is not specified, it inherits the option from the nearest parent layout. The root defaults to `"auto"`.\n\nYou can also specify a region, such as "iad1", or an array of regions, such as `["iad1", "sfo1"]`.', options: { '"auto"': - 'Next.js will first deploy to the `"home"` region. Then if it doesn’t detect any waterfall requests after a few requests, it can upgrade that route, to be deployed globally. If it detects any waterfall requests after that, it can eventually downgrade back to `"home`".', + 'Next.js will first deploy to the `"home"` region. Then if it doesn\'t detect any waterfall requests after a few requests, it can upgrade that route, to be deployed globally. If it detects any waterfall requests after that, it can eventually downgrade back to `"home`".', '"global"': 'Prefer deploying globally.', '"home"': 'Prefer deploying to the Home region.', }, @@ -91,7 +92,7 @@ const API_DOCS: Record< }, revalidate: { description: - 'The `revalidate` option sets the default revalidation time for that layout or page. Note that it doesn’t override the value specify by each `fetch()`.', + "The `revalidate` option sets the default revalidation time for that layout or page. Note that it doesn't override the value specify by each `fetch()`.", type: 'mixed', options: { false: @@ -133,6 +134,12 @@ const API_DOCS: Record< metadata: { description: 'Next.js Metadata configurations', link: 'https://nextjs.org/docs/app/building-your-application/optimizing/metadata', + insertText: 'metadata: Metadata = {};', + }, + generateMetadata: { + description: 'Next.js generateMetadata configurations', + link: 'https://nextjs.org/docs/app/api-reference/functions/generate-metadata', + insertText: 'generateMetadata = (): Metadata => { return {} };', }, maxDuration: { description: @@ -185,8 +192,10 @@ function visitEntryConfig( function createAutoCompletionOptionName(sort: number, name: string) { const ts = getTs() + return { name, + insertText: API_DOCS[name].insertText, sortText: '!' + sort, kind: ts.ScriptElementKind.constElement, kindModifiers: ts.ScriptElementKindModifier.exportedModifier, @@ -232,6 +241,7 @@ function getAPIDescription(api: string): string { .join('\n') ) } + const config = { // Auto completion for entry exported configs. addCompletionsAtPosition( @@ -348,8 +358,9 @@ const config = { // Show details on the side when auto completing. getCompletionEntryDetails( entryName: string, - data: tsModule.CompletionEntryData - ) { + data: tsModule.CompletionEntryData, + fileName: string + ): tsModule.CompletionEntryDetails | undefined { const ts = getTs() if ( data && @@ -364,6 +375,87 @@ const config = { if (!options) return content = options[entryName] } + + if (entryName === 'metadata' || entryName === 'generateMetadata') { + const sourceFile = getSource(fileName) + let start = 0 + let foundMetadataImport = false + + if (sourceFile) { + const visitor: tsModule.Visitor = (node) => { + // Check for top directive + if ( + ts.isExpressionStatement(node) && + ts.isStringLiteral(node.expression) && + node.expression.getStart() === 0 + ) { + const text = node.expression.text + if (text.startsWith('use ')) { + start = node.end + 1 + return node // Continue traversal + } + } + + // Check for Metadata import + if ( + ts.isImportDeclaration(node) && + (node.moduleSpecifier.getText() === '"next"' || + node.moduleSpecifier.getText() === "'next'") + ) { + const namedImports = node.importClause?.namedBindings + if (namedImports && ts.isNamedImports(namedImports)) { + foundMetadataImport = namedImports.elements.some((element) => { + const name = element.name.getText() + const propertyName = element.propertyName?.getText() + return name === 'Metadata' || propertyName === 'Metadata' + }) + if (foundMetadataImport) { + return // Stop traversal + } + } + } + + return node + } + + for (const statement of sourceFile.statements) { + if (foundMetadataImport) break + ts.visitNode(statement, visitor) + } + } + + return { + name: entryName, + kind: ts.ScriptElementKind.enumElement, + kindModifiers: ts.ScriptElementKindModifier.none, + displayParts: [], + codeActions: foundMetadataImport + ? undefined + : [ + { + description: `Import type 'Metadata' from module 'next'`, + changes: [ + { + fileName, + textChanges: [ + { + span: { start, length: 0 }, + newText: `import type { Metadata } from 'next';\n`, + }, + ], + }, + ], + }, + ], + documentation: [ + { + kind: 'text', + text: content, + }, + ], + } + } + return { name: entryName, kind: ts.ScriptElementKind.enumElement, diff --git a/packages/next/src/server/typescript/rules/metadata.ts b/packages/next/src/server/typescript/rules/metadata.ts index 7f4b52708aa80..eefc0db7c5cf1 100644 --- a/packages/next/src/server/typescript/rules/metadata.ts +++ b/packages/next/src/server/typescript/rules/metadata.ts @@ -1,204 +1,9 @@ import { NEXT_TS_ERRORS } from '../constant' -import { - getSource, - getSourceFromVirtualTsEnv, - getTs, - getTypeChecker, - isPositionInsideNode, - log, - virtualTsEnv, -} from '../utils' +import { getSource, getTs, getTypeChecker } from '../utils' import type tsModule from 'typescript/lib/tsserverlibrary' -const TYPE_ANNOTATION = ': Metadata | null' -const TYPE_ANNOTATION_ASYNC = ': Promise' -const TYPE_IMPORT = `\n\nimport type { Metadata } from 'next'` - -// Find the `export const metadata = ...` node. -function getMetadataExport(fileName: string, position: number) { - const source = getSource(fileName) - let metadataExport: tsModule.VariableDeclaration | undefined - - if (source) { - const ts = getTs() - ts.forEachChild(source, function visit(node) { - if (metadataExport) return - - // Covered by this node - if (isPositionInsideNode(position, node)) { - // Export variable - if ( - ts.isVariableStatement(node) && - node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword) - ) { - if (ts.isVariableDeclarationList(node.declarationList)) { - for (const declaration of node.declarationList.declarations) { - if ( - isPositionInsideNode(position, declaration) && - declaration.name.getText() === 'metadata' - ) { - // `export const metadata = ...` - metadataExport = declaration - return - } - } - } - } - } - }) - } - return metadataExport -} - -function updateVirtualFileWithType( - fileName: string, - node: tsModule.VariableDeclaration | tsModule.FunctionDeclaration, - isGenerateMetadata?: boolean -) { - const source = getSource(fileName) - if (!source) return - - // We annotate with the type in a virtual language service - const sourceText = source.getFullText() - let nodeEnd: number - let annotation: string - - const ts = getTs() - if (ts.isFunctionDeclaration(node)) { - if (isGenerateMetadata) { - nodeEnd = node.body!.getFullStart() - const isAsync = node.modifiers?.some( - (m) => m.kind === ts.SyntaxKind.AsyncKeyword - ) - annotation = isAsync ? TYPE_ANNOTATION_ASYNC : TYPE_ANNOTATION - } else { - return - } - } else { - nodeEnd = node.name.getFullStart() + node.name.getFullWidth() - annotation = TYPE_ANNOTATION - } - - const newSource = - sourceText.slice(0, nodeEnd) + - annotation + - sourceText.slice(nodeEnd) + - TYPE_IMPORT - - if (virtualTsEnv.getSourceFile(fileName)) { - log('Updating file: ' + fileName) - virtualTsEnv.updateFile(fileName, newSource) - } else { - log('Creating file: ' + fileName) - virtualTsEnv.createFile(fileName, newSource) - } - - return [nodeEnd, annotation.length] -} - -function isTyped( - node: tsModule.VariableDeclaration | tsModule.FunctionDeclaration -) { - return node.type !== undefined -} - -function proxyDiagnostics( - fileName: string, - pos: number[], - n: tsModule.VariableDeclaration | tsModule.FunctionDeclaration -) { - // Get diagnostics - const diagnostics = - virtualTsEnv.languageService.getSemanticDiagnostics(fileName) - const source = getSourceFromVirtualTsEnv(fileName) - - // Filter and map the results - return diagnostics - .filter((d) => { - if (d.start === undefined || d.length === undefined) return false - if (d.start < n.getFullStart()) return false - if (d.start + d.length >= n.getFullStart() + n.getFullWidth() + pos[1]) - return false - return true - }) - .map((d) => { - return { - file: source, - category: d.category, - code: d.code, - messageText: d.messageText, - start: d.start! < pos[0] ? d.start : d.start! - pos[1], - length: d.length, - } - }) -} - const metadata = { - filterCompletionsAtPosition( - fileName: string, - position: number, - _options: any, - prior: tsModule.WithMetadata - ) { - const node = getMetadataExport(fileName, position) - if (!node) return prior - if (isTyped(node)) return prior - - // We annotate with the type in a virtual language service - const pos = updateVirtualFileWithType(fileName, node) - if (pos === undefined) return prior - - // Get completions - const newPos = position <= pos[0] ? position : position + pos[1] - const completions = virtualTsEnv.languageService.getCompletionsAtPosition( - fileName, - newPos, - undefined - ) - - if (completions) { - const ts = getTs() - completions.isIncomplete = true - // https://github.com/microsoft/TypeScript/blob/4dc677b292354f4b9162452b2e00f4d7dd118221/src/services/types.ts#L1428-L1433 - if (completions.optionalReplacementSpan) { - // Adjust the start position of the text span to original source. - completions.optionalReplacementSpan.start -= newPos - position - } - completions.entries = completions.entries - .filter((e) => { - return [ - ts.ScriptElementKind.memberVariableElement, - ts.ScriptElementKind.typeElement, - ts.ScriptElementKind.string, - ].includes(e.kind) - }) - .map((e) => { - const insertText = - e.kind === ts.ScriptElementKind.memberVariableElement && - /^[a-zA-Z0-9_]+$/.test(e.name) - ? e.name + ': ' - : e.name - - return { - name: e.name, - insertText, - kind: e.kind, - kindModifiers: e.kindModifiers, - sortText: '!' + e.name, - labelDetails: { - description: `Next.js metadata`, - }, - data: e.data, - } - }) - - return completions - } - - return prior - }, - getSemanticDiagnosticsForExportVariableStatementInClientEntry( fileName: string, node: tsModule.VariableStatement | tsModule.FunctionDeclaration @@ -240,38 +45,6 @@ const metadata = { return [] }, - getSemanticDiagnosticsForExportVariableStatement( - fileName: string, - node: tsModule.VariableStatement | tsModule.FunctionDeclaration - ) { - const ts = getTs() - - if (ts.isFunctionDeclaration(node)) { - if (node.name?.getText() === 'generateMetadata') { - if (isTyped(node)) return [] - - // We annotate with the type in a virtual language service - const pos = updateVirtualFileWithType(fileName, node, true) - if (!pos) return [] - - return proxyDiagnostics(fileName, pos, node) - } - } else { - for (const declaration of node.declarationList.declarations) { - if (declaration.name.getText() === 'metadata') { - if (isTyped(declaration)) break - - // We annotate with the type in a virtual language service - const pos = updateVirtualFileWithType(fileName, declaration) - if (!pos) break - - return proxyDiagnostics(fileName, pos, declaration) - } - } - } - return [] - }, - getSemanticDiagnosticsForExportDeclarationInClientEntry( fileName: string, node: tsModule.ExportDeclaration @@ -318,28 +91,9 @@ const metadata = { if (metadataSymbol && metadataSymbol.declarations) { const declaration = metadataSymbol.declarations[0] if (declaration && ts.isVariableDeclaration(declaration)) { - if (isTyped(declaration)) break - - const declarationFileName = - declaration.getSourceFile().fileName - const isSameFile = declarationFileName === fileName - - // We annotate with the type in a virtual language service - const pos = updateVirtualFileWithType( - declarationFileName, - declaration - ) - if (!pos) break - - const diagnostics = proxyDiagnostics( - declarationFileName, - pos, - declaration - ) - if (diagnostics.length) { - if (isSameFile) { - return diagnostics - } else { + if (declaration.type) { + const typeText = declaration.type.getText() + if (!typeText.includes('Metadata')) { return [ { file: getSource(fileName), @@ -362,76 +116,6 @@ const metadata = { return [] }, - - getCompletionEntryDetails( - fileName: string, - position: number, - entryName: string, - formatOptions: tsModule.FormatCodeOptions, - source: string, - preferences: tsModule.UserPreferences, - data: tsModule.CompletionEntryData - ) { - const node = getMetadataExport(fileName, position) - if (!node) return - if (isTyped(node)) return - - // We annotate with the type in a virtual language service - const pos = updateVirtualFileWithType(fileName, node) - if (pos === undefined) return - - const newPos = position <= pos[0] ? position : position + pos[1] - - const details = virtualTsEnv.languageService.getCompletionEntryDetails( - fileName, - newPos, - entryName, - formatOptions, - source, - preferences, - data - ) - return details - }, - - getQuickInfoAtPosition(fileName: string, position: number) { - const node = getMetadataExport(fileName, position) - if (!node) return - if (isTyped(node)) return - - // We annotate with the type in a virtual language service - const pos = updateVirtualFileWithType(fileName, node) - if (pos === undefined) return - - const newPos = position <= pos[0] ? position : position + pos[1] - const insight = virtualTsEnv.languageService.getQuickInfoAtPosition( - fileName, - newPos - ) - return insight - }, - - getDefinitionAndBoundSpan(fileName: string, position: number) { - const node = getMetadataExport(fileName, position) - if (!node) return - if (isTyped(node)) return - if (!isPositionInsideNode(position, node)) return - // We annotate with the type in a virtual language service - const pos = updateVirtualFileWithType(fileName, node) - if (pos === undefined) return - const newPos = position <= pos[0] ? position : position + pos[1] - - const definitionInfoAndBoundSpan = - virtualTsEnv.languageService.getDefinitionAndBoundSpan(fileName, newPos) - - if (definitionInfoAndBoundSpan) { - // Adjust the start position of the text span - if (definitionInfoAndBoundSpan.textSpan.start > pos[0]) { - definitionInfoAndBoundSpan.textSpan.start -= pos[1] - } - } - return definitionInfoAndBoundSpan - }, } export default metadata diff --git a/packages/next/src/server/typescript/utils.ts b/packages/next/src/server/typescript/utils.ts index c272809b7f82c..42bff2cf934a1 100644 --- a/packages/next/src/server/typescript/utils.ts +++ b/packages/next/src/server/typescript/utils.ts @@ -1,11 +1,4 @@ -import type { VirtualTypeScriptEnvironment } from 'next/dist/compiled/@typescript/vfs' -import { - createFSBackedSystem, - createDefaultMapFromNodeModules, - createVirtualTypeScriptEnvironment, -} from 'next/dist/compiled/@typescript/vfs' - -import path, { join } from 'path' +import path from 'path' import type tsModule from 'typescript/lib/tsserverlibrary' type TypeScript = typeof import('typescript/lib/tsserverlibrary') @@ -13,7 +6,6 @@ type TypeScript = typeof import('typescript/lib/tsserverlibrary') let ts: TypeScript let info: tsModule.server.PluginCreateInfo let appDirRegExp: RegExp -export let virtualTsEnv: VirtualTypeScriptEnvironment export function log(message: string) { info.project.projectService.logger.info('[next] ' + message) @@ -23,7 +15,7 @@ export function log(message: string) { export function init(opts: { ts: TypeScript info: tsModule.server.PluginCreateInfo -}): boolean { +}) { const projectDir = opts.info.project.getCurrentDirectory() ts = opts.ts info = opts.info @@ -31,32 +23,7 @@ export function init(opts: { '^' + (projectDir + '(/src)?/app').replace(/[\\/]/g, '[\\/]') ) - log('Initializing Next.js TypeScript plugin: ' + projectDir) - - const compilerOptions = info.project.getCompilerOptions() - const fsMap = createDefaultMapFromNodeModules( - compilerOptions, - ts, - join(projectDir, 'node_modules/typescript/lib') - ) - const system = createFSBackedSystem(fsMap, projectDir, ts) - - virtualTsEnv = createVirtualTypeScriptEnvironment( - system, - [], - ts, - compilerOptions - ) - - if (!virtualTsEnv) { - log( - 'Failed to create virtual TypeScript environment. This is a bug in Next.js TypeScript plugin. Please report it by opening an issue at https://github.com/vercel/next.js/issues.' - ) - return false - } - - log('Successfully initialized Next.js TypeScript plugin!') - return true + log('Initialized Next.js TypeScript plugin: ' + projectDir) } export function getTs() { @@ -75,13 +42,6 @@ export function getSource(fileName: string) { return info.languageService.getProgram()?.getSourceFile(fileName) } -export function getSourceFromVirtualTsEnv(fileName: string) { - if (virtualTsEnv.sys.fileExists(fileName)) { - return virtualTsEnv.getSourceFile(fileName) - } - return getSource(fileName) -} - export function removeStringQuotes(str: string): string { return str.replace(/^['"`]|['"`]$/g, '') } diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index 942df19a49bb9..72433e03847da 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -2234,14 +2234,6 @@ export async function ncc_https_proxy_agent(task, opts) { .target('src/compiled/https-proxy-agent') } -externals['@typescript/vfs'] = 'next/dist/compiled/@typescript/vfs' -export async function ncc_typescript_vfs(task, opts) { - await task - .source(relative(__dirname, require.resolve('@typescript/vfs'))) - .ncc({ packageName: '@typescript/vfs', externals }) - .target('src/compiled/@typescript/vfs') -} - export async function precompile(task, opts) { await task.parallel( ['browser_polyfills', 'copy_ncced', 'copy_styled_jsx_assets'], @@ -2389,7 +2381,6 @@ export async function ncc(task, opts) { 'ncc_opentelemetry_api', 'ncc_http_proxy_agent', 'ncc_https_proxy_agent', - 'ncc_typescript_vfs', 'ncc_mini_css_extract_plugin', ], opts diff --git a/packages/next/types/$$compiled.internal.d.ts b/packages/next/types/$$compiled.internal.d.ts index 6be8aaf43b0c4..d13e5e9ca1d61 100644 --- a/packages/next/types/$$compiled.internal.d.ts +++ b/packages/next/types/$$compiled.internal.d.ts @@ -747,11 +747,6 @@ declare module 'next/dist/compiled/zod-validation-error' { export = zve } -declare module 'next/dist/compiled/@typescript/vfs' { - import m from '@typescript/vfs' - export = m -} - declare module 'mini-css-extract-plugin' declare module 'next/dist/compiled/loader-utils3' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a3956d83fd289..7e0b80ddaa9bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1173,9 +1173,6 @@ importers: '@types/ws': specifier: 8.2.0 version: 8.2.0 - '@typescript/vfs': - specifier: 1.6.1 - version: 1.6.1(typescript@5.8.2) '@vercel/ncc': specifier: 0.34.0 version: 0.34.0 @@ -6567,11 +6564,6 @@ packages: resolution: {integrity: sha512-RGLh5CRaUEf02viP5c1Vh1cMGffQscyHe7HPAzGpfmfflFg1wUz2rYxd+OZqwpeypYvZ8UxSxuIpF++fmOzEcg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript/vfs@1.6.1': - resolution: {integrity: sha512-JwoxboBh7Oz1v38tPbkrZ62ZXNHAk9bJ7c9x0eI5zBfBnBYGhURdbnh7Z4smN/MV48Y5OCcZb58n972UtbazsA==} - peerDependencies: - typescript: '*' - '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -23266,13 +23258,6 @@ snapshots: eslint-visitor-keys: 4.2.0 optional: true - '@typescript/vfs@1.6.1(typescript@5.8.2)': - dependencies: - debug: 4.1.1 - typescript: 5.8.2 - transitivePeerDependencies: - - supports-color - '@ungap/structured-clone@1.2.0': {} '@vercel/fetch-cached-dns@2.0.2(node-fetch@2.6.7(encoding@0.1.13))':